{"_id":"@civitai/cybertipline-tools","_rev":"4-907ea9dfbeb6a1f5e84d8b0c0423da8d","name":"@civitai/cybertipline-tools","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@civitai/cybertipline-tools","version":"0.1.0","keywords":["CyberTipline","NCMEC","utils"],"author":{"url":"https://johand.dev","name":"Johannes Andersen"},"license":"MIT","_id":"@civitai/cybertipline-tools@0.1.0","maintainers":[{"name":"flipperbw","email":"flipperbw@gmail.com"},{"name":"justmaier","email":"just.maier@gmail.com"},{"name":"bkdiehl","email":"bkdiehl@gmail.com"},{"name":"manuelurenah","email":"manuel.ureh@hotmail.com"}],"homepage":"https://github.com/Johannes-Andersen/CyberTipline-Tools","bugs":{"url":"https://github.com/Johannes-Andersen/CyberTipline-Tools/issues"},"dist":{"shasum":"c5318ed8ef5e7a760d8c46ffefcb52c8dfc72e79","tarball":"https://registry.npmjs.org/@civitai/cybertipline-tools/-/cybertipline-tools-0.1.0.tgz","fileCount":9,"integrity":"sha512-j+aIZy+d3mvPhE93lrx9d3k08PABFeH025DIYuR1T5LWqJ9xnAHTuFXdhLCeIDZESdOg95fNJcVqhOvAcCpddw==","signatures":[{"sig":"MEYCIQDZWDsJYIUKEkonCgS3K5iFtwHiwUG0VrOC1C5W9ryyHgIhAJB+osRdWwCwSIRwvmz4DrBwSOPi73T+8tGBvio27/43","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":447119},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"npm":">=10","node":">=22.18.0","pnpm":">=10"},"exports":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"gitHead":"87457a5cbfff6f58183dc86f0034daf56ace760b","scripts":{"lint":"biome lint .","test":"tsx --test './src/**/*.test.ts'","build":"tsup","check":"biome check .","format":"biome format .","lint:fix":"biome lint --write .","changeset":"changeset","check:fix":"biome check --write .","format:fix":"biome format --write .","type-check":"tsc --noEmit","test:update":"tsx --test-update-snapshots --test './src/**/*.test.ts'","check-exports":"attw --pack .","local-release":"changeset version && changeset publish","test:coverage":"tsx --experimental-test-coverage --test-coverage-exclude=**/*.test.ts --test-coverage-exclude=src/types/** --test './src/**/*.test.ts'"},"_npmUser":{"name":"bkdiehl","email":"bkdiehl@gmail.com"},"repository":{"url":"git+https://github.com/Johannes-Andersen/CyberTipline-Tools.git","type":"git"},"_npmVersion":"10.9.3","description":"Unofficial Types and Utilities for working with the CyberTipline API","directories":{},"_nodeVersion":"22.19.0","dependencies":{"fast-xml-parser":"5.2.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"4.20.5","tsup":"8.5.0","typescript":"5.9.2","@types/node":"22.18.0","@biomejs/biome":"2.2.2","@changesets/cli":"2.29.6","@arethetypeswrong/cli":"0.18.2"},"_npmOperationalInternal":{"tmp":"tmp/cybertipline-tools_0.1.0_1757351049089_0.9804980797097873","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-09-08T17:04:08.985Z","modified":"2026-06-19T19:38:54.734Z","0.1.0":"2025-09-08T17:04:09.332Z"},"bugs":{"url":"https://github.com/Johannes-Andersen/CyberTipline-Tools/issues"},"author":{"url":"https://johand.dev","name":"Johannes Andersen"},"license":"MIT","homepage":"https://github.com/Johannes-Andersen/CyberTipline-Tools","keywords":["CyberTipline","NCMEC","utils"],"repository":{"url":"git+https://github.com/Johannes-Andersen/CyberTipline-Tools.git","type":"git"},"description":"Unofficial Types and Utilities for working with the CyberTipline API","maintainers":[{"email":"lrojas94@gmail.com","name":"lrojas94"},{"email":"just.maier@gmail.com","name":"justmaier"},{"email":"bkdiehl@gmail.com","name":"bkdiehl"},{"email":"manuel.ureh@hotmail.com","name":"manuelurenah"},{"email":"zachlowden1@gmail.com","name":"devzacx"}],"readme":"# CyberTipline Tools\r\n\r\nA **unofficial** collection of tools for interacting with the National Center for Missing & Exploited Children's [CyberTipline Reporting API](https://report.cybertip.org/ispws/documentation).\r\n\r\n## Installation\r\n\r\n```bash\r\n# Using pnpm\r\npnpm add cybertipline-tools\r\n\r\n# Using npm\r\nnpm install cybertipline-tools\r\n\r\n# Using yarn\r\nyarn add cybertipline-tools\r\n```\r\n\r\n## Quick Start\r\n\r\n```typescript\r\nimport { Client, Environment, IncidentType } from 'cybertipline-tools';\r\n\r\n// Create a new client\r\nconst client = new Client({\r\n  environment: Environment.Testing, // Use Testing for development\r\n  credentials: {\r\n    username: 'your-username',\r\n    password: 'your-password',\r\n  },\r\n});\r\n\r\n// Test your connection\r\nconst status = await client.getStatus();\r\nconsole.log('Connected:', status.data.responseDescription);\r\n\r\n// Submit a report\r\nconst report = await client.submitReport({\r\n  incidentSummary: {\r\n    incidentType: IncidentType.ChildSexTourism,\r\n    // ... other required fields\r\n  },\r\n  reporter: {\r\n    reportingPerson: {\r\n      email: 'reporter@example.com',\r\n      // ... other required fields\r\n    },\r\n  },\r\n});\r\nconsole.log('Report ID:', report.data.reportId);\r\n\r\n// Upload a file\r\nconst fileUpload = await client.uploadFile({\r\n  id: report.data.reportId,\r\n  file: new File(['...'], 'evidence.jpg'),\r\n});\r\nconsole.log('File ID:', fileUpload.data.fileId);\r\n\r\n// Add file details\r\nawait client.submitFileDetails({\r\n  reportId: Number(report.data.reportId),\r\n  fileId: fileUpload.data.fileId,\r\n  fileName: 'evidence.jpg',\r\n  // ... other optional fields\r\n});\r\n\r\n// Mark report as complete\r\nawait client.finishReport({\r\n  id: report.data.reportId,\r\n});\r\n```\r\n\r\n## Requirements\r\n\r\n- Node.js 22.x or later (TypeScript 5.x for type definitions)\r\n  - Older versions may work, but are not officially verified.\r\n- ESM module support\r\n  - CommonJS is exported, but not officially tested. We welcome contributions to improve this.\r\n\r\n## Features\r\n\r\n✨ **Type Safety**\r\n- Full TypeScript support with detailed type definitions\r\n- Inline documentation with JSDoc comments\r\n  - Allowing for IDE autocompletion for all APIs\r\n\r\n🐛 **Error Handling**\r\n- Request ID extraction for all operations\r\n- Error handling with detailed messages\r\n\r\n🛠️ **API Support**\r\n- `GET /status` - Test API connectivity\r\n- `POST /submit` - Submit new reports\r\n- `POST /upload` - Upload evidence files\r\n- `POST /fileinfo` - Add file metadata\r\n- `POST /finish` - Complete reports\r\n- `POST /retract` - Cancel reports\r\n\r\n- You provide JSON, we convert it to XML and back, so no need to worry about XML!\r\n\r\n## Error Handling\r\n\r\nThe client includes built-in error handling:\r\n\r\n```typescript\r\ntry {\r\n  await client.getStatus();\r\n} catch (error) {\r\n  // All API errors include the Request-ID for troubleshooting\r\n  console.error('API Error:', error.message);\r\n  // Example: \"Authentication failed (Request-ID: abc-123)\"\r\n}\r\n```\r\n\r\n## Development Status\r\n\r\n🚧 **Todo**\r\n- [ ] Schema validation (Zod?)\r\n- [ ] Examples and demos\r\n- [ ] Documentation improvements\r\n- [ ] Performance optimizations\r\n- [ ] Stabilize developer experience\r\n\r\n🔮 **Possible Future Plans**\r\n- [ ] E2E testing against running CyberTipline test environment\r\n- [ ] Batch reporting support\r\n- [ ] XSD schema to TypeScript generation\r\n\r\n## License\r\n\r\nMIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n## Resources\r\n\r\n- [CyberTipline API Documentation](https://report.cybertip.org/ispws/documentation) (official documentation from NCMEC)\r\n- [Apply for API Access](https://esp.ncmec.org/registration) (done by the NCMEC team)\r\n- [Report Issues](https://github.com/Johannes-Andersen/cybertipline-tools/issues)\r\n","readmeFilename":"README.md"}