{"_id":"@anderson.tec12/utils","_rev":"7-c8e767e1a46c93669b839b2622da5ec1","name":"@anderson.tec12/utils","dist-tags":{"latest":"1.4.0"},"versions":{"1.0.0":{"name":"@anderson.tec12/utils","version":"1.0.0","keywords":["util","typescript","biblioteca"],"author":{"name":"Seu Nome"},"license":"MIT","_id":"@anderson.tec12/utils@1.0.0","maintainers":[{"name":"anderson.tec12","email":"anderson.tec12@gmail.com"}],"dist":{"shasum":"07aaddfd8dedd099ca37c192be3aa14fb8a7820b","tarball":"https://registry.npmjs.org/@anderson.tec12/utils/-/utils-1.0.0.tgz","fileCount":8,"integrity":"sha512-9JscAvhFqu5B+TqckMevtW7HwKmgCI213jfs9N26ZiI78fYe5YHpwSqS9B/m22avYQdnksD4uis9aI7gyW5sUQ==","signatures":[{"sig":"MEQCIEaZxwUGF0+AEXduBcw1bxTx6FUZMnzim+69hkVzCs6eAiBnOnp1umqs/62GwqMjjvLqGOYnll/bzrTwq2638ZWvJg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6705},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"53b80fe6c79cab48009d8b1d6343a54f1d6edf67","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"anderson.tec12","email":"anderson.tec12@gmail.com"},"_npmVersion":"6.14.13","directories":{},"_nodeVersion":"14.17.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.2"},"_npmOperationalInternal":{"tmp":"tmp/utils_1.0.0_1754399731014_0.926519135012833","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@anderson.tec12/utils","version":"1.1.0","keywords":["util","typescript","biblioteca"],"author":{"name":"Seu Nome"},"license":"MIT","_id":"@anderson.tec12/utils@1.1.0","maintainers":[{"name":"anderson.tec12","email":"anderson.tec12@gmail.com"}],"dist":{"shasum":"0fde4821c7333bce04c5ae7eada02bf1444e0b30","tarball":"https://registry.npmjs.org/@anderson.tec12/utils/-/utils-1.1.0.tgz","fileCount":11,"integrity":"sha512-wJaqXkUE1RLymFvQG1dp0Teytdg7HaoVBJnBfkd2xXah0pCYrtsVUO7XPP8bCbVsusbEWH9LAjSkZ+29pbOtxA==","signatures":[{"sig":"MEUCIEbLyQ+Ll1OJuUpp29Gwq8JMKqpxjnmIWCMM/VhidgYNAiEAmlcoyXA/tf9G5OoE3pKxRTzGlY7Odk1ImHMcyJHKVPI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8922},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"b47dacd58421cc7df10a2950386e68c41810b161","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"anderson.tec12","email":"anderson.tec12@gmail.com"},"_npmVersion":"6.14.13","directories":{},"_nodeVersion":"14.17.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.2"},"_npmOperationalInternal":{"tmp":"tmp/utils_1.1.0_1754404789862_0.08374886313994101","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@anderson.tec12/utils","version":"1.1.1","keywords":["util","typescript","biblioteca"],"author":{"name":"Seu Nome"},"license":"MIT","_id":"@anderson.tec12/utils@1.1.1","maintainers":[{"name":"anderson.tec12","email":"anderson.tec12@gmail.com"}],"dist":{"shasum":"6097c87571a6ee5d1901cadbf365cdffec977327","tarball":"https://registry.npmjs.org/@anderson.tec12/utils/-/utils-1.1.1.tgz","fileCount":12,"integrity":"sha512-/6gsneBJYlPDJb4Cf+anBGPobIrE8FHvGi6AjcYVFVtDzEGK3fIITkdBknlSQWPj+6R3n+krwLDtiq6mCmjTbA==","signatures":[{"sig":"MEUCIF1xKTlJTuDAxEGjltV9pNtX3Dufzgn2psWAZ0j0JTKrAiEAnuDekYu018Y0EJgInYQJXe7QAfauRWyjDD70F9BVfkM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13513},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"ea329079777087f011703593d8a1df0605502e6b","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"anderson.tec12","email":"anderson.tec12@gmail.com"},"_npmVersion":"6.14.13","description":"[![npm version](https://badge.fury.io/js/%40anderson.tec12%2Futils.svg)](https://badge.fury.io/js/%40anderson.tec12%2Futils)\r [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)","directories":{},"_nodeVersion":"14.17.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.2"},"_npmOperationalInternal":{"tmp":"tmp/utils_1.1.1_1754406975456_0.9703988749147312","host":"s3://npm-registry-packages-npm-production"}},"1.1.2":{"name":"@anderson.tec12/utils","version":"1.1.2","keywords":["util","typescript","biblioteca"],"author":{"name":"Seu Nome"},"license":"MIT","_id":"@anderson.tec12/utils@1.1.2","maintainers":[{"name":"anderson.tec12","email":"anderson.tec12@gmail.com"}],"dist":{"shasum":"fe2579c5cd7da12b7a7b747d16aaa30d5c517324","tarball":"https://registry.npmjs.org/@anderson.tec12/utils/-/utils-1.1.2.tgz","fileCount":15,"integrity":"sha512-A4/YTZjVdsdSdOqsdwc+I4qzYeUjHCQEhka92n5+saG9CFZAqF2Sp6eMIwgt4xsMsGIkqYk/b1F+FAbkFMjrLw==","signatures":[{"sig":"MEUCIG0eznLh3kX6gZ3tmUsgjy5Rtv1XfhYQhKYK1DnccMTnAiEAqdaY3BV9LJn6LZlhM1CIiheCJBfn1fQto0VqYpk1HIg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14816},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"ff4c20449dd07d58fd81f33505ca8b44ef9d204f","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"anderson.tec12","email":"anderson.tec12@gmail.com"},"_npmVersion":"10.9.3","description":"[![npm version](https://badge.fury.io/js/%40anderson.tec12%2Futils.svg)](https://badge.fury.io/js/%40anderson.tec12%2Futils)\r [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)","directories":{},"_nodeVersion":"22.18.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.2"},"_npmOperationalInternal":{"tmp":"tmp/utils_1.1.2_1754922103449_0.9058378387965089","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@anderson.tec12/utils","version":"1.2.0","keywords":["util","typescript","biblioteca"],"author":{"name":"Seu Nome"},"license":"MIT","_id":"@anderson.tec12/utils@1.2.0","maintainers":[{"name":"anderson.tec12","email":"anderson.tec12@gmail.com"}],"dist":{"shasum":"bf224fb1b5e7c617a797243c687924759840b508","tarball":"https://registry.npmjs.org/@anderson.tec12/utils/-/utils-1.2.0.tgz","fileCount":18,"integrity":"sha512-qzatf24dqHiyXjtCNEYIGCkzmfbr2DRLPSefceGNu+tk4EiLWNI/oXt0FkbRUhimB359oZGMd25LhkKouxLbQA==","signatures":[{"sig":"MEQCIC3EPsRUDupuKI+yYNzK26JYeDAssVVRRA5sJ8KCXEePAiAHp9Y1B1cxqHLg2P3/k4GX+n/VjOJKGdLJjDfGfpQ/3w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16151},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"ffa2743d430775a01cd55b543cac44e30cf93a21","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"anderson.tec12","email":"anderson.tec12@gmail.com"},"_npmVersion":"10.9.3","description":"[![npm version](https://badge.fury.io/js/%40anderson.tec12%2Futils.svg)](https://badge.fury.io/js/%40anderson.tec12%2Futils)\r [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)","directories":{},"_nodeVersion":"22.18.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.2"},"_npmOperationalInternal":{"tmp":"tmp/utils_1.2.0_1756301538737_0.006970629043137722","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@anderson.tec12/utils","version":"1.3.0","keywords":["util","typescript","biblioteca"],"author":{"name":"Anderson Barros Silva","email":"anderson.tec12@gmail.com"},"license":"MIT","_id":"@anderson.tec12/utils@1.3.0","maintainers":[{"name":"anderson.tec12","email":"anderson.tec12@gmail.com"}],"homepage":"https://github.com/anderson-tec12/utils#readme","bugs":{"url":"https://github.com/anderson-tec12/utils/issues"},"dist":{"shasum":"0eb3c3c2908e340cbfcf34ce72df1d33768c8fe3","tarball":"https://registry.npmjs.org/@anderson.tec12/utils/-/utils-1.3.0.tgz","fileCount":16,"integrity":"sha512-AZMNybtwsAQzHna/CD2cjlhOdYxalOviVgBCC4V1N7hrf9PpObwQKxli6hGGO7N4bVMpdIHufiJm+bo6Sk3bow==","signatures":[{"sig":"MEYCIQDOzY7XuS0lxjalffDAKvUO+nCYY6wQj3AkMOKBfKB+hwIhAMZHD/qgFSOmXQMxeMbrTZ2h5iDm3c70Bk6OncJ/0kWP","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15003},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"37ecf94f0c481129855d59ab82e2bbbd602fd421","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"anderson.tec12","email":"anderson.tec12@gmail.com"},"repository":{"url":"git+https://github.com/anderson-tec12/utils.git","type":"git"},"_npmVersion":"10.9.2","description":"Utilitários TypeScript para desenvolvimento web (storage seguro, dispositivos, requests).","directories":{},"_nodeVersion":"22.13.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.2"},"_npmOperationalInternal":{"tmp":"tmp/utils_1.3.0_1775753829955_0.8717620785776319","host":"s3://npm-registry-packages-npm-production"}},"1.4.0":{"name":"@anderson.tec12/utils","version":"1.4.0","description":"Utilitários TypeScript para desenvolvimento web (storage seguro, dispositivos, requests).","main":"dist/index.js","types":"dist/index.d.ts","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/anderson-tec12/utils.git"},"bugs":{"url":"https://github.com/anderson-tec12/utils/issues"},"homepage":"https://github.com/anderson-tec12/utils#readme","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"keywords":["util","typescript","biblioteca"],"author":{"name":"Anderson Barros Silva","email":"anderson.tec12@gmail.com"},"license":"MIT","devDependencies":{"@types/pouchdb":"^6.4.2","typescript":"^5.9.2"},"dependencies":{"pouchdb":"^9.0.0"},"_id":"@anderson.tec12/utils@1.4.0","gitHead":"26ba9d17fe95813c3d891b81f91c955b7be65c12","_nodeVersion":"22.13.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-o+LaVOtyqDd4hBwPkuyue33lUqmee/1l74t+ApYoEuUslxqck3lfqucw2dd3Hl+aHqOjSaIF5V+qeqjPDcDsaA==","shasum":"10aa1d72f52605659aaecf93b7344958ca603d4f","tarball":"https://registry.npmjs.org/@anderson.tec12/utils/-/utils-1.4.0.tgz","fileCount":20,"unpackedSize":19736,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCgnqmXFAamrMtOkWQiyTewxw/7XguoGlSsM+gFZndaagIgDEkDxSNpPSZJl6xEX8x6takqPHH99C7uS/gAMZ2nB6A="}]},"_npmUser":{"name":"anderson.tec12","email":"anderson.tec12@gmail.com"},"directories":{},"maintainers":[{"name":"anderson.tec12","email":"anderson.tec12@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/utils_1.4.0_1775852966466_0.9818240909706437"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-05T13:15:30.921Z","modified":"2026-04-10T20:29:26.706Z","1.0.0":"2025-08-05T13:15:31.165Z","1.1.0":"2025-08-05T14:39:50.041Z","1.1.1":"2025-08-05T15:16:15.662Z","1.1.2":"2025-08-11T14:21:43.606Z","1.2.0":"2025-08-27T13:32:18.933Z","1.3.0":"2026-04-09T16:57:10.107Z","1.4.0":"2026-04-10T20:29:26.610Z"},"bugs":{"url":"https://github.com/anderson-tec12/utils/issues"},"author":{"name":"Anderson Barros Silva","email":"anderson.tec12@gmail.com"},"license":"MIT","homepage":"https://github.com/anderson-tec12/utils#readme","keywords":["util","typescript","biblioteca"],"repository":{"type":"git","url":"git+https://github.com/anderson-tec12/utils.git"},"description":"Utilitários TypeScript para desenvolvimento web (storage seguro, dispositivos, requests).","maintainers":[{"name":"anderson.tec12","email":"anderson.tec12@gmail.com"}],"readme":"# @anderson.tec12/utils\n\n[![npm version](https://badge.fury.io/js/%40anderson.tec12%2Futils.svg)](https://badge.fury.io/js/%40anderson.tec12%2Futils)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nUma biblioteca TypeScript com utilitários essenciais para desenvolvimento web, incluindo armazenamento seguro criptografado e verificação de dispositivos de mídia.\n\n## 📦 Instalação\n\n```bash\nnpm install @anderson.tec12/utils\n```\n\n## 🚀 Funcionalidades\n\n### 🔐 SecureStorage\nArmazenamento seguro no localStorage com criptografia AES-GCM de 256 bits.\n\n### 📹 Device Verification\nVerificação de disponibilidade de câmera e microfone do usuário.\n\n## 📖 Uso\n\n### SecureStorage\n\nO `secureStorage` permite armazenar dados de forma criptografada no localStorage do navegador:\n\n```typescript\nimport { secureStorage } from '@anderson.tec12/utils';\n\n// Armazenar dados\nawait secureStorage.setItem('userData', {\n  name: 'João',\n  email: 'joao@example.com',\n  preferences: { theme: 'dark' }\n});\n\n// Recuperar dados\nconst userData = await secureStorage.getItem<{\n  name: string;\n  email: string;\n  preferences: { theme: string };\n}>('userData');\n\nconsole.log(userData); // { name: 'João', email: 'joao@example.com', ... }\n\n// Remover item específico\nsecureStorage.removeItem('userData');\n\n// Limpar todo o storage\nsecureStorage.clear();\n```\n\n### Verificação de Dispositivos\n\nVerifique se o usuário possui câmera e microfone disponíveis:\n\n```typescript\nimport { verifyMicAndCam } from '@anderson.tec12/utils';\n\nconst hasDevices = await verifyMicAndCam();\n\nif (hasDevices) {\n  console.log('Usuário possui câmera e microfone');\n  // Prosseguir com funcionalidades de vídeo/áudio\n} else {\n  console.log('Dispositivos não disponíveis');\n  // Mostrar mensagem de erro ou alternativas\n}\n```\n\n## 📚 API Reference\n\n### SecureStorage\n\n#### `setItem(key: string, value: any): Promise<void>`\nArmazena um valor criptografado no localStorage.\n\n- **key**: Chave para identificar o item\n- **value**: Qualquer valor serializável em JSON\n\n#### `getItem<T>(key: string): Promise<T | null>`\nRecupera e descriptografa um valor do localStorage.\n\n- **key**: Chave do item a ser recuperado\n- **Retorna**: O valor descriptografado ou `null` se não encontrado\n\n#### `removeItem(key: string): void`\nRemove um item específico do localStorage.\n\n#### `clear(): void`\nRemove todos os itens do localStorage.\n\n### Device Verification\n\n#### `verifyMicAndCam(): Promise<boolean>`\nVerifica se o usuário possui câmera e microfone disponíveis.\n\n- **Retorna**: `true` se ambos os dispositivos estão disponíveis, `false` caso contrário\n\n## 🔒 Segurança\n\nO `SecureStorage` utiliza:\n- **Algoritmo**: AES-GCM com chave de 256 bits\n- **Derivação de chave**: PBKDF2 com 100.000 iterações\n- **Salt**: Valor fixo para consistência\n- **IV**: Vetor de inicialização aleatório para cada operação\n\n> ⚠️ **Importante**: Esta implementação é adequada para proteger dados contra acesso casual ao localStorage, mas não substitui medidas de segurança do lado servidor para dados altamente sensíveis.\n\n## 🌐 Compatibilidade\n\nEsta biblioteca requer navegadores com suporte à:\n- **Web Crypto API** (para SecureStorage)\n- **MediaDevices API** (para verificação de dispositivos)\n\n### Navegadores Suportados:\n- Chrome 37+\n- Firefox 34+\n- Safari 7+\n- Edge 12+\n\n## 🛠️ Desenvolvimento\n\n```bash\n# Instalar dependências\nnpm install\n\n# Compilar TypeScript\nnpm run build\n\n# Preparar para publicação\nnpm run prepublishOnly\n```\n\n## 📄 Estrutura do Projeto\n\n```\nsrc/\n├── index.ts          # Exportações principais\n├── storage/\n│   └── index.ts      # SecureStorage implementation\n└── devices/\n    └── index.ts      # Device verification utilities\n```\n\n## 🤝 Contribuição\n\n1. Faça um fork do projeto\n2. Crie uma branch para sua feature (`git checkout -b feature/AmazingFeature`)\n3. Commit suas mudanças (`git commit -m 'Add some AmazingFeature'`)\n4. Push para a branch (`git push origin feature/AmazingFeature`)\n5. Abra um Pull Request\n\n## 📝 Licença\n\nEste projeto está licenciado sob a Licença MIT - veja o arquivo [LICENSE](LICENSE) para detalhes.\n\n## 👨‍💻 Autor\n\n**Anderson** - [@anderson-tec12](https://github.com/anderson-tec12)\n\n---\n\n⭐ Se este projeto foi útil para você, considere dar uma estrela no GitHub!\n","readmeFilename":"README.md"}