{"_id":"1fichier","_rev":"3-de07559efeab9dc932c2790189c3090e","name":"1fichier","dist-tags":{"latest":"1.0.2"},"versions":{"0.0.1":{"name":"1fichier","version":"0.0.1","keywords":["1fichier"],"author":"","license":"MIT","_id":"1fichier@0.0.1","maintainers":[{"name":"nusrath","email":"nusrath501khan@gmail.com"}],"homepage":"https://github.com/nunsie/1fichier-ts#readme","bugs":{"url":"https://github.com/nunsie/1fichier-ts/issues"},"dist":{"shasum":"f6b7f6d19f986b15c35f7499431e6faafc240841","tarball":"https://registry.npmjs.org/1fichier/-/1fichier-0.0.1.tgz","fileCount":10,"integrity":"sha512-qLCgcRlF1t2zGQCP8L9v+m6MR+q3cNy60npww5eWCbNMzS8hWhavuOsmE+shVhuap95IdJCnNH1oPP2VW9RGmg==","signatures":[{"sig":"MEYCIQCnzpUbwoSebmnhRFOSJpTM4XtUv6BK79nXBu7hn5lkLQIhALHtnpnQihm6K/Q9H17ukjwtgFiQmeHADNZtyFyBKKsS","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":130926},"main":"dist/src/index.js","type":"module","gitHead":"3dfdf5bd0c8f2593ebc03b319291e3e996630f2d","scripts":{"test":"vitest","build":"swc src -d dist"},"_npmUser":{"name":"nusrath","email":"nusrath501khan@gmail.com"},"repository":{"url":"git+https://github.com/nunsie/1fichier-ts.git","type":"git"},"_npmVersion":"10.5.0","description":"A typescript client for the 1fichier API","directories":{},"_nodeVersion":"21.7.3","dependencies":{"axios":"^1.12.2"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4","@swc/cli":"^0.7.8","@swc/core":"^1.13.5","@vitest/ui":"^3.2.4","typescript":"^5.9.2","@types/node":"^24.5.1"},"_npmOperationalInternal":{"tmp":"tmp/1fichier_0.0.1_1758131689543_0.14679152417621455","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"1fichier","version":"1.0.1","keywords":["1fichier"],"author":"","license":"MIT","_id":"1fichier@1.0.1","maintainers":[{"name":"nusrath","email":"nusrath501khan@gmail.com"}],"homepage":"https://github.com/nunsie/1fichier-ts#readme","bugs":{"url":"https://github.com/nunsie/1fichier-ts/issues"},"dist":{"shasum":"20a4ae9a4bf6764e858194631fb3f937b6c68c0f","tarball":"https://registry.npmjs.org/1fichier/-/1fichier-1.0.1.tgz","fileCount":11,"integrity":"sha512-Ui1H8o0LeXqlMT0GvaVCG0g0YlB4yIUFq9otQY4UDJG1AoQz7TY/wpU9CT1QnWHqeZEMQwDDmfC1l6syTmNN8A==","signatures":[{"sig":"MEQCIApHs+GPpUvb7xvivA0OjToBIh8fVDCx6UxVdtkA652PAiBAFh6VKRwDQO7qRVnx0pH6Rchk0tpRzdkUp4LFz5APbw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":78856},"main":"dist/src/index.js","type":"module","gitHead":"4f8fc4a7cb003b0e354b05de89f8520cc15928fe","scripts":{"test":"vitest","build":"swc src -d dist","release":"semantic-release"},"_npmUser":{"name":"nusrath","email":"nusrath501khan@gmail.com"},"repository":{"url":"git+https://github.com/nunsie/1fichier-ts.git","type":"git"},"_npmVersion":"10.9.3","description":"A typescript client for the 1fichier API","directories":{},"_nodeVersion":"20.19.5","dependencies":{"axios":"^1.12.2"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4","@swc/cli":"^0.7.8","@swc/core":"^1.13.5","@vitest/ui":"^3.2.4","typescript":"^5.9.2","@types/node":"^24.5.1","semantic-release":"^24.2.8","@semantic-release/git":"^10.0.1","@semantic-release/npm":"^12.0.2","@semantic-release/github":"^11.0.6","@semantic-release/changelog":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/1fichier_1.0.1_1758132698893_0.7522828857714159","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"1fichier","version":"1.0.2","description":"A typescript client for the 1fichier API","main":"dist/src/index.js","type":"module","scripts":{"build":"swc src -d dist","test":"vitest","release":"semantic-release"},"repository":{"type":"git","url":"git+https://github.com/nunsie/1fichier-ts.git"},"keywords":["1fichier"],"author":"","license":"MIT","bugs":{"url":"https://github.com/nunsie/1fichier-ts/issues"},"homepage":"https://github.com/nunsie/1fichier-ts#readme","dependencies":{"axios":"^1.12.2"},"devDependencies":{"@semantic-release/changelog":"^6.0.3","@semantic-release/git":"^10.0.1","@semantic-release/github":"^11.0.6","@semantic-release/npm":"^12.0.2","@swc/cli":"^0.7.8","@swc/core":"^1.13.5","@types/node":"^24.5.1","@vitest/ui":"^3.2.4","semantic-release":"^24.2.8","typescript":"^5.9.2","vitest":"^3.2.4"},"_id":"1fichier@1.0.2","gitHead":"2951034ef62d468ed631c8fb753d42fe00bfbc08","_nodeVersion":"20.19.5","_npmVersion":"10.9.3","dist":{"integrity":"sha512-I6XekRx4wxdcDaA8Wpz0jTUYZI/kzWuwC0Dd7tJgP0sVSWHoMnF7BoabfhCeqN8YNWOEGxRnCsy/LtAkEyVCRA==","shasum":"e90b861da8d787a3d079804475f9967f297316b9","tarball":"https://registry.npmjs.org/1fichier/-/1fichier-1.0.2.tgz","fileCount":14,"unpackedSize":136625,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBIohdpBHE22+JMczGrVwHbzH5tQqbu50AOjm5DKddXMAiEA4ZGr7ifOhKmCgckX1ED6BgvZbbuEc8DAfcbsoyUXuqA="}]},"_npmUser":{"name":"nusrath","email":"nusrath501khan@gmail.com"},"directories":{},"maintainers":[{"name":"nusrath","email":"nusrath501khan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/1fichier_1.0.2_1758139800337_0.4925419888461533"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-17T17:54:49.455Z","modified":"2025-09-17T20:10:00.786Z","0.0.1":"2025-09-17T17:54:49.767Z","1.0.1":"2025-09-17T18:11:39.075Z","1.0.2":"2025-09-17T20:10:00.584Z"},"bugs":{"url":"https://github.com/nunsie/1fichier-ts/issues"},"license":"MIT","homepage":"https://github.com/nunsie/1fichier-ts#readme","keywords":["1fichier"],"repository":{"type":"git","url":"git+https://github.com/nunsie/1fichier-ts.git"},"description":"A typescript client for the 1fichier API","maintainers":[{"name":"nusrath","email":"nusrath501khan@gmail.com"}],"readme":"# 1fichier-ts\n\nA fully-typed TypeScript client for the [1fichier.com API](https://1fichier.com/api.html). Supports all endpoints from the official OpenAPI spec, including file upload/download, folder management, user info, remote upload, and vouchers.\n\n## Features\n- Full coverage of 1fichier.com API endpoints\n- TypeScript types for all request/response schemas\n- Modern async/await API\n- Built-in authentication via API key\n- Axios-based HTTP client\n- Easy to extend and test\n\n## Installation\n\n```bash\nnpm install 1fichier\n```\n\n## Usage\n\n### Basic Example\n\n```typescript\nimport FichierApiClient from \"1fichier\";\n\nconst client = new FichierApiClient(\"YOUR_API_KEY\");\n\n// Generate a download token\nconst token = await client.getDownloadToken({ url: \"https://1fichier.com/?example\" });\nconsole.log(token.url);\n\n// List files in root folder\nconst files = await client.listFiles({ folder_id: 0 });\nconsole.log(files.items);\n```\n\n### Authentication\nAll requests require a valid API key. Pass your API key when constructing the client:\n\n```typescript\nconst client = new FichierApiClient(\"YOUR_API_KEY\");\n```\n\n## API Reference\n\n### File Operations\n- `getDownloadToken(data)` - Generate a download token for a file\n- `getFileInfo(data)` - Get detailed info about a file\n- `listFiles(data)` - List files in a folder\n- `scanFile(data)` - Scan a file for viruses\n- `removeFiles(data)` - Remove files\n- `moveFiles(data)` - Move files\n- `renameFiles(data)` - Rename files\n- `copyFiles(data)` - Copy files\n- `changeFileAttr(data)` - Change file attributes\n\n### Upload\n- `getUploadServer(pretty)` - Get optimal upload server\n- `uploadFiles(formData)` - Upload files (multipart/form-data)\n- `getUploadResult(xid)` - Get upload result\n\n### Folder Operations\n- `listFolders(data)` - List folders\n- `createFolder(data)` - Create a folder\n- `shareFolder(data)` - Share a folder\n- `moveFolder(data)` - Move a folder\n- `removeFolder(data)` - Remove a folder\n\n### User\n- `getUserInfo(data)` - Get/set account info\n\n### Remote Upload\n- `listRemoteUploads()` - List remote uploads\n- `getRemoteUploadInfo(id)` - Get remote upload info\n- `requestRemoteUpload(data)` - Request remote upload\n\n### Vouchers\n- `listVouchers()` - List unused vouchers\n- `checkVoucher(data)` - Check voucher validity\n- `useVoucher(data)` - Use voucher\n\n## TypeScript Types\nAll request and response schemas are fully typed. See [`src/types.ts`](src/types.ts) for details.\n\n## Error Handling\nAll methods throw on HTTP/network errors. Use try/catch for error handling:\n\n```typescript\ntry {\n\tconst info = await client.getFileInfo({ url: \"https://1fichier.com/?example\" });\n} catch (err) {\n\tconsole.error(\"API error\", err);\n}\n```\n\n## Testing\nUnit tests are provided using [Vitest](https://vitest.dev/). Run tests with:\n\n```bash\nnpm test\n```\n\n## Contributing\n\nContributions are welcome! To contribute:\n\n1. Fork the repo and create your branch.\n2. Write clear, tested code. Add/modify tests in `src/index.test.ts`.\n3. Ensure all types are correct and documented.\n4. Open a pull request with a detailed description.\n\n### Development Setup\n\n```bash\ngit clone https://github.com/nunsie/1fichier-ts.git\ncd 1fichier-ts\nnpm install\nnpm test\n```\n\n### Coding Standards\n- Use TypeScript strict mode\n- Document all public methods\n- Prefer async/await\n- Write unit tests for new features\n\n## License\n\nMIT © 2025 Nusrath Khan\n\n## Links\n- [1fichier.com API Docs](https://1fichier.com/api.html)\n- [OpenAPI Spec](./swagger.yml)\n- [Issues](https://github.com/nunsie/1fichier-ts/issues)\n- [Contributing Guide](#contributing)\n","readmeFilename":"README.md"}