{"_id":"@dokhna-tech/zatca-storage-mongo","_rev":"6-d627b1ea01bd64357fe7da622c75aa3c","name":"@dokhna-tech/zatca-storage-mongo","dist-tags":{"latest":"4.0.1"},"versions":{"1.0.0":{"name":"@dokhna-tech/zatca-storage-mongo","version":"1.0.0","license":"BUSL-1.1","_id":"@dokhna-tech/zatca-storage-mongo@1.0.0","maintainers":[{"name":"ameensom","email":"amin4mail@yahoo.com"}],"dist":{"shasum":"4c4930b2e2c6ea61f47f21cf3d25badb457779f6","tarball":"https://registry.npmjs.org/@dokhna-tech/zatca-storage-mongo/-/zatca-storage-mongo-1.0.0.tgz","fileCount":9,"integrity":"sha512-dvCekbRfYAf/ZzhcZxXDe/1AcFq/UgFUNfBmSqN5V3RCE3hzkA6Ji6EgVt2I11OPADFTBKRMFfdVeRWDZwQy6g==","signatures":[{"sig":"MEQCIDDzbLNOTG8SnXWDXK72a8BaskgPf96A+/tHpF4r+wVIAiAj9N7UJ1HJ7/fvT5ftldMTxXuDqXnZiFKmxvLz54gwnA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":78861},"main":"./dist/index.cjs","type":"module","_from":"file:dokhna-tech-zatca-storage-mongo-1.0.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","test":"vitest run --passWithNoTests","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"ameensom","email":"amin4mail@yahoo.com"},"_resolved":"/private/var/folders/14/y1m00gyx24b054fzqk4wb_2c0000gn/T/15f0898de383854cf3eb401f6c134511/dokhna-tech-zatca-storage-mongo-1.0.0.tgz","_integrity":"sha512-dvCekbRfYAf/ZzhcZxXDe/1AcFq/UgFUNfBmSqN5V3RCE3hzkA6Ji6EgVt2I11OPADFTBKRMFfdVeRWDZwQy6g==","_npmVersion":"11.6.4","description":"MongoDB (Mongoose) storage adapter for @dokhna-tech/zatca.","directories":{},"_nodeVersion":"22.18.0","dependencies":{"debug":"^4.3.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mongoose":"^9.6.2","@types/debug":"^4.1.12","@dokhna-tech/zatca":"2.0.0","mongodb-memory-server":"^10.1.2"},"peerDependencies":{"mongoose":">=8.0.0","@dokhna-tech/zatca":"2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/zatca-storage-mongo_1.0.0_1778762280454_0.46994218092021955","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"@dokhna-tech/zatca-storage-mongo","version":"2.0.2","license":"BUSL-1.1","_id":"@dokhna-tech/zatca-storage-mongo@2.0.2","maintainers":[{"name":"ameensom","email":"amin4mail@yahoo.com"}],"dist":{"shasum":"bc3cf023d4c2bd35e6194dc98954bf3d3d467865","tarball":"https://registry.npmjs.org/@dokhna-tech/zatca-storage-mongo/-/zatca-storage-mongo-2.0.2.tgz","fileCount":9,"integrity":"sha512-KksAgtRjbsbx0fUK1ZQ4xJLA1A27paFY1NlTHoA/fD40+kpgRdMh8vYYdhTcTS/n0Uhy5My1zFQ4ml7lYTflXw==","signatures":[{"sig":"MEUCIQC+NGocQQZg05O16KaZ89iXhfuJBfQs2LZN8HGMJ94NaQIgHvuYU+0P/0+EtYeGfTo0Ubw5UnD08+T1yaa06CUFuTc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":80229},"main":"./dist/index.cjs","type":"module","_from":"file:dokhna-tech-zatca-storage-mongo-2.0.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","test":"vitest run --passWithNoTests","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"ameensom","email":"amin4mail@yahoo.com"},"_resolved":"/tmp/3ea633ea153de7e895433217cc1b1bdf/dokhna-tech-zatca-storage-mongo-2.0.2.tgz","_integrity":"sha512-KksAgtRjbsbx0fUK1ZQ4xJLA1A27paFY1NlTHoA/fD40+kpgRdMh8vYYdhTcTS/n0Uhy5My1zFQ4ml7lYTflXw==","_npmVersion":"10.9.7","description":"MongoDB (Mongoose) storage adapter for @dokhna-tech/zatca.","directories":{},"_nodeVersion":"22.22.2","dependencies":{"debug":"^4.3.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mongoose":"^9.6.2","@types/debug":"^4.1.12","@dokhna-tech/zatca":"2.0.2","mongodb-memory-server":"^10.1.2"},"peerDependencies":{"mongoose":">=8.0.0","@dokhna-tech/zatca":"2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/zatca-storage-mongo_2.0.2_1778766203330_0.4516955823998601","host":"s3://npm-registry-packages-npm-production"}},"2.0.3":{"name":"@dokhna-tech/zatca-storage-mongo","version":"2.0.3","license":"BUSL-1.1","_id":"@dokhna-tech/zatca-storage-mongo@2.0.3","maintainers":[{"name":"ameensom","email":"amin4mail@yahoo.com"}],"homepage":"https://github.com/dokhna/dokhna-tech-zatca#readme","bugs":{"url":"https://github.com/dokhna/dokhna-tech-zatca/issues"},"dist":{"shasum":"86a3bdf236f661ab0d330b1a033223802e0a3fe8","tarball":"https://registry.npmjs.org/@dokhna-tech/zatca-storage-mongo/-/zatca-storage-mongo-2.0.3.tgz","fileCount":9,"integrity":"sha512-YTZyfwgOBUSBzyKl6Un9rTzBPBvrbOLphiWlweLPJFPs/jGVpeHuAtHkSzVhjidg7gkJDFeAUYMolTLgfxt6wg==","signatures":[{"sig":"MEYCIQD4oXH7t6Q+MRW/BVtiIE7jCYT3XS6VhX3LN0ElLjDUowIhAMgUh3VOyOdjdvF7SsJrNk0vFab/RU0GChaimOh23GJv","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":80528},"main":"./dist/index.cjs","type":"module","_from":"file:dokhna-tech-zatca-storage-mongo-2.0.3.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","test":"vitest run --passWithNoTests","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"ameensom","email":"amin4mail@yahoo.com"},"_resolved":"/tmp/e4ae5d24e11dd3b5c4200f79629ebab5/dokhna-tech-zatca-storage-mongo-2.0.3.tgz","_integrity":"sha512-YTZyfwgOBUSBzyKl6Un9rTzBPBvrbOLphiWlweLPJFPs/jGVpeHuAtHkSzVhjidg7gkJDFeAUYMolTLgfxt6wg==","repository":{"url":"git+https://github.com/dokhna/dokhna-tech-zatca.git","type":"git","directory":"packages/storage-mongo"},"_npmVersion":"10.9.7","description":"MongoDB (Mongoose) storage adapter for @dokhna-tech/zatca.","directories":{},"_nodeVersion":"22.22.2","dependencies":{"debug":"^4.3.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mongoose":"^9.6.2","@types/debug":"^4.1.12","@dokhna-tech/zatca":"2.0.3","mongodb-memory-server":"^10.1.2"},"peerDependencies":{"mongoose":">=8.0.0","@dokhna-tech/zatca":"2.0.3"},"_npmOperationalInternal":{"tmp":"tmp/zatca-storage-mongo_2.0.3_1778781332759_0.9957502284556503","host":"s3://npm-registry-packages-npm-production"}},"2.0.4":{"name":"@dokhna-tech/zatca-storage-mongo","version":"2.0.4","license":"BUSL-1.1","_id":"@dokhna-tech/zatca-storage-mongo@2.0.4","maintainers":[{"name":"ameensom","email":"amin4mail@yahoo.com"}],"homepage":"https://github.com/dokhna/dokhna-tech-zatca#readme","bugs":{"url":"https://github.com/dokhna/dokhna-tech-zatca/issues"},"dist":{"shasum":"b639c123597b6002c4e07052251ce84bd9071f10","tarball":"https://registry.npmjs.org/@dokhna-tech/zatca-storage-mongo/-/zatca-storage-mongo-2.0.4.tgz","fileCount":9,"integrity":"sha512-0+irdjrwDbRg/FXhL3jTN4P0ddeHe8rjtB5cKGvfSp8E9KOuh5TIeHi56Cb6vfhdZlgeOhLjHNj3EgqMfKFvRg==","signatures":[{"sig":"MEUCIGee3Athe2x5ggmQX4lB0tfL5GhYdI+lASHL4IgIKINLAiEAm9HqqXGjYQL9SbQ1REMNyhljgWa/xKpf3CeIXLk765Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":80593},"main":"./dist/index.cjs","type":"module","_from":"file:dokhna-tech-zatca-storage-mongo-2.0.4.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.19.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","test":"vitest run --passWithNoTests","build":"tsup","typecheck":"tsc --noEmit","test:coverage":"vitest run --coverage --passWithNoTests"},"_npmUser":{"name":"ameensom","email":"amin4mail@yahoo.com"},"_resolved":"/tmp/8c01724197e82b7756c4149f3d27b8d0/dokhna-tech-zatca-storage-mongo-2.0.4.tgz","_integrity":"sha512-0+irdjrwDbRg/FXhL3jTN4P0ddeHe8rjtB5cKGvfSp8E9KOuh5TIeHi56Cb6vfhdZlgeOhLjHNj3EgqMfKFvRg==","repository":{"url":"git+https://github.com/dokhna/dokhna-tech-zatca.git","type":"git","directory":"packages/storage-mongo"},"_npmVersion":"10.9.7","description":"MongoDB (Mongoose) storage adapter for @dokhna-tech/zatca.","directories":{},"_nodeVersion":"22.22.2","dependencies":{"debug":"^4.3.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mongoose":"^9.6.2","@types/debug":"^4.1.12","@dokhna-tech/zatca":"2.0.4","mongodb-memory-server":"^11.1.0"},"peerDependencies":{"mongoose":">=9.0.0","@dokhna-tech/zatca":"2.0.4"},"_npmOperationalInternal":{"tmp":"tmp/zatca-storage-mongo_2.0.4_1778842975545_0.5785275946149158","host":"s3://npm-registry-packages-npm-production"}},"4.0.0":{"name":"@dokhna-tech/zatca-storage-mongo","version":"4.0.0","license":"BUSL-1.1","_id":"@dokhna-tech/zatca-storage-mongo@4.0.0","maintainers":[{"name":"ameensom","email":"amin4mail@yahoo.com"}],"homepage":"https://github.com/dokhna/dokhna-tech-zatca#readme","bugs":{"url":"https://github.com/dokhna/dokhna-tech-zatca/issues"},"dist":{"shasum":"3ba693702869500d9823ff8d62a732e98a955f33","tarball":"https://registry.npmjs.org/@dokhna-tech/zatca-storage-mongo/-/zatca-storage-mongo-4.0.0.tgz","fileCount":9,"integrity":"sha512-r6oBTlMqxnZBS6xhrzTo5dHJkRrLDKhshvJxGIMwRRCt4dbvpS3ubwrf+1oBMxNYn+T09r3gO93WBP8WrB+TYw==","signatures":[{"sig":"MEUCIDMyiJZqIlQetYYb6itBihH9rS88eF1in4ceoQYxDSsZAiEAvzCFb+BSP2Oax4zCV482g3vPVnkd9FdGkuJ8Blv39Q0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":80593},"main":"./dist/index.cjs","type":"module","_from":"file:dokhna-tech-zatca-storage-mongo-4.0.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.19.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","test":"vitest run --passWithNoTests","build":"tsup","typecheck":"tsc --noEmit","test:coverage":"vitest run --coverage --passWithNoTests"},"_npmUser":{"name":"ameensom","email":"amin4mail@yahoo.com"},"_resolved":"/tmp/a18b065ead2ba1448653f1234fbb581a/dokhna-tech-zatca-storage-mongo-4.0.0.tgz","_integrity":"sha512-r6oBTlMqxnZBS6xhrzTo5dHJkRrLDKhshvJxGIMwRRCt4dbvpS3ubwrf+1oBMxNYn+T09r3gO93WBP8WrB+TYw==","repository":{"url":"git+https://github.com/dokhna/dokhna-tech-zatca.git","type":"git","directory":"packages/storage-mongo"},"_npmVersion":"10.9.7","description":"MongoDB (Mongoose) storage adapter for @dokhna-tech/zatca.","directories":{},"_nodeVersion":"22.22.2","dependencies":{"debug":"^4.3.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mongoose":"^9.6.2","@types/debug":"^4.1.12","@dokhna-tech/zatca":"4.0.0","mongodb-memory-server":"^11.1.0"},"peerDependencies":{"mongoose":">=9.0.0","@dokhna-tech/zatca":"4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/zatca-storage-mongo_4.0.0_1779089788044_0.8576276305975779","host":"s3://npm-registry-packages-npm-production"}},"4.0.1":{"name":"@dokhna-tech/zatca-storage-mongo","version":"4.0.1","description":"MongoDB (Mongoose) storage adapter for @dokhna-tech/zatca.","license":"BUSL-1.1","repository":{"type":"git","url":"git+https://github.com/dokhna/dokhna-tech-zatca.git","directory":"packages/storage-mongo"},"homepage":"https://github.com/dokhna/dokhna-tech-zatca#readme","bugs":{"url":"https://github.com/dokhna/dokhna-tech-zatca/issues"},"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"engines":{"node":">=20.19.0"},"publishConfig":{"access":"public"},"dependencies":{"debug":"^4.3.7"},"peerDependencies":{"mongoose":">=9.0.0","@dokhna-tech/zatca":"4.0.1"},"devDependencies":{"@types/debug":"^4.1.12","mongodb-memory-server":"^11.1.0","mongoose":"^9.6.2","@dokhna-tech/zatca":"4.0.1"},"scripts":{"build":"tsup","dev":"tsup --watch","typecheck":"tsc --noEmit","test":"vitest run --passWithNoTests","test:coverage":"vitest run --coverage --passWithNoTests"},"_id":"@dokhna-tech/zatca-storage-mongo@4.0.1","_integrity":"sha512-gSJyROd7D6jfE3Rquvmdal2a7HKGywzBqBO4ceDn1Km0ixZw/Y7eRRJdUz38k9bL7aoOFgud6Tuh5etTiE3xJg==","_resolved":"/tmp/d528638d8de244ef2a5487e1e0a8b358/dokhna-tech-zatca-storage-mongo-4.0.1.tgz","_from":"file:dokhna-tech-zatca-storage-mongo-4.0.1.tgz","_nodeVersion":"22.22.3","_npmVersion":"10.9.8","dist":{"integrity":"sha512-gSJyROd7D6jfE3Rquvmdal2a7HKGywzBqBO4ceDn1Km0ixZw/Y7eRRJdUz38k9bL7aoOFgud6Tuh5etTiE3xJg==","shasum":"6e42e764fc647a56cbfaa6ad92342a41997bfa8f","tarball":"https://registry.npmjs.org/@dokhna-tech/zatca-storage-mongo/-/zatca-storage-mongo-4.0.1.tgz","fileCount":9,"unpackedSize":80593,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCpiZx3QAHXfui8CvnJ/J94gUGVPpFl7akZoaGIth0daQIgJEb/rmS/5f7DnJ0dGm/B+xJKXWNyo8NGWJFCdytjEJ4="}]},"_npmUser":{"name":"ameensom","email":"amin4mail@yahoo.com"},"directories":{},"maintainers":[{"name":"ameensom","email":"amin4mail@yahoo.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/zatca-storage-mongo_4.0.1_1781527870935_0.9461608827845722"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-14T12:38:00.338Z","modified":"2026-06-15T12:51:11.184Z","1.0.0":"2026-05-14T12:38:00.597Z","2.0.2":"2026-05-14T13:43:23.482Z","2.0.3":"2026-05-14T17:55:32.908Z","2.0.4":"2026-05-15T11:02:55.707Z","4.0.0":"2026-05-18T07:36:28.204Z","4.0.1":"2026-06-15T12:51:11.062Z"},"bugs":{"url":"https://github.com/dokhna/dokhna-tech-zatca/issues"},"license":"BUSL-1.1","homepage":"https://github.com/dokhna/dokhna-tech-zatca#readme","repository":{"type":"git","url":"git+https://github.com/dokhna/dokhna-tech-zatca.git","directory":"packages/storage-mongo"},"description":"MongoDB (Mongoose) storage adapter for @dokhna-tech/zatca.","maintainers":[{"name":"ameensom","email":"amin4mail@yahoo.com"}],"readme":"# @dokhna-tech/zatca-storage-mongo\n\nMongoDB (Mongoose) `StorageAdapter` for [`@dokhna-tech/zatca`](https://www.npmjs.com/package/@dokhna-tech/zatca). Suitable for production single-VAT and multi-VAT (multi-tenant SaaS) deployments.\n\n[![npm](https://img.shields.io/npm/v/@dokhna-tech/zatca-storage-mongo.svg)](https://www.npmjs.com/package/@dokhna-tech/zatca-storage-mongo)\n[![license](https://img.shields.io/badge/license-BUSL--1.1-blue.svg)](./LICENSE)\n\n## Install\n\n```bash\nnpm install @dokhna-tech/zatca @dokhna-tech/zatca-storage-mongo mongoose\n```\n\nPeer dependencies:\n- `@dokhna-tech/zatca` — the core library\n- `mongoose >= 8.0.0`\n\n## Usage\n\n```ts\nimport mongoose from \"mongoose\";\nimport { createMongoStorageAdapter } from \"@dokhna-tech/zatca-storage-mongo\";\nimport { issueSimplifiedTaxInvoice, asVATNumber, asEGSUuid } from \"@dokhna-tech/zatca\";\n\nawait mongoose.connect(process.env.MONGO_URL!);\n\nconst storage = createMongoStorageAdapter({\n  connection: mongoose.connection,\n});\n\nconst result = await issueSimplifiedTaxInvoice({\n  storage,\n  vatNumber: asVATNumber(\"310123456700003\"),\n  egsUuid: asEGSUuid(\"11111111-2222-3333-4444-555555555555\"),\n  // ...rest of the invoice payload\n});\n```\n\nThe adapter serialises hash-chain writes atomically per `{vatNumber, egsUuid}` scope, so it's safe under concurrent invoice issuance from multiple Node.js processes. Collection models are built lazily from the Mongoose connection you provide — no extra schema registration needed.\n\nThe factory also accepts optional clock and invoice-number formatter overrides; see the TypeScript signature.\n\n## Collections\n\nThe adapter manages two collections:\n\n- `zatcacounters` — per-VAT, per-EGS monthly sequence counters.\n- `zatcainvoices` — issued invoices, hashes, and chain pointers.\n\nCollection names are deterministic from the Mongoose model name; you can deploy alongside your existing application schema.\n\n## License\n\nBUSL-1.1 — see [LICENSE](./LICENSE). The license converts to Apache 2.0 on 2030-05-13. SaaS / multi-tenant production use requires a commercial license; see the [main repo](https://github.com/dokhna-tech/zatca) for terms.\n","readmeFilename":"README.md"}