{"_id":"@ascendance-hub/sapphire-bson","_rev":"8-d836e0b946685d58e2ec79230cb9a5cd","name":"@ascendance-hub/sapphire-bson","dist-tags":{"latest":"1.2.0","preview":"0.0.0-preview-20260531194731"},"versions":{"1.0.0":{"name":"@ascendance-hub/sapphire-bson","version":"1.0.0","keywords":["typescript","schema","bson","mongodb","jsonschema","validator","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","_id":"@ascendance-hub/sapphire-bson@1.0.0","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"dist":{"shasum":"cb2fb056f938165be1f682c9ec6d91b92d9bc41d","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-bson/-/sapphire-bson-1.0.0.tgz","fileCount":7,"integrity":"sha512-q6XMv5jXmerBqrAIsW8KU+P4hZ18znwPLufucSZh1HHfZLHo2DmiJHegv+FQmAtDQNH22ASFCh+fkRnmAbMocg==","signatures":[{"sig":"MEYCIQDvPgB2ZJLpvC+72y5qdMIjPrzMU5HloUsCtcUbgOPL2wIhAK2gFui+ub6O4DppEjTMH6PzpfTkN9TySfIO2VcMRn8q","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23002},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"7ca237cf34d7dbf4b6002e6eeb8f1948b5fa1401","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"repository":{"url":"git+https://github.com/Ascendance-Hub/Sapphire.git","type":"git","directory":"packages/bson"},"_npmVersion":"10.9.7","description":"Native MongoDB driver adapter for Sapphire — emits $jsonSchema collection validators.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mongodb":"^7.2.0","mongodb-memory-server":"^11.0.0","@ascendance-hub/sapphire-core":"*"},"peerDependencies":{"mongodb":"^6 || ^7","@ascendance-hub/sapphire-core":">=1.0.0"},"peerDependenciesMeta":{"mongodb":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sapphire-bson_1.0.0_1778967982064_0.2555059304644147","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-preview-20260518150854":{"name":"@ascendance-hub/sapphire-bson","version":"0.0.0-preview-20260518150854","keywords":["typescript","schema","bson","mongodb","jsonschema","validator","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","_id":"@ascendance-hub/sapphire-bson@0.0.0-preview-20260518150854","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"dist":{"shasum":"7843f53e3cbb41171d5ad86b443d71c57252bf38","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-bson/-/sapphire-bson-0.0.0-preview-20260518150854.tgz","fileCount":7,"integrity":"sha512-6AYRiGmbU/KwgBzMR2EhoBeC4gP2FvT6i1+z+LDTMOmilzZbTw3pcpuD+z/h74oogbBloq300lKGLB2wKZ/H1g==","signatures":[{"sig":"MEUCIBxCU7ohISYSRwrn24MZnHD9mOpFhjFzZtXeoKP0M2MfAiEArl+reRO3J6f/lIjmSMtjNzvVnigPiUCZqvKe1PLHvbE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23073},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"7b0ae9d5231c706543b59d36b56e9d7a73697dd8","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"repository":{"url":"git+https://github.com/Ascendance-Hub/Sapphire.git","type":"git","directory":"packages/bson"},"_npmVersion":"10.9.7","description":"Native MongoDB driver adapter for Sapphire — emits $jsonSchema collection validators.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"mongodb":"^7.2.0","mongodb-memory-server":"^11.0.0","@ascendance-hub/sapphire-core":"0.0.0-preview-20260518150854"},"peerDependencies":{"mongodb":"^6 || ^7","@ascendance-hub/sapphire-core":"0.0.0-preview-20260518150854"},"peerDependenciesMeta":{"mongodb":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sapphire-bson_0.0.0-preview-20260518150854_1779116938201_0.03337752389147153","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-preview-20260518153515":{"name":"@ascendance-hub/sapphire-bson","version":"0.0.0-preview-20260518153515","keywords":["typescript","schema","bson","mongodb","jsonschema","validator","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","_id":"@ascendance-hub/sapphire-bson@0.0.0-preview-20260518153515","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"dist":{"shasum":"83ba7a989762ba7b84b9ea92ea852976a0622d4e","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-bson/-/sapphire-bson-0.0.0-preview-20260518153515.tgz","fileCount":7,"integrity":"sha512-oWWH91h8Wqk9Nbf90WulZ4Q8j2KuckH5l9fU4mzJmVtc9MexKErXapfQ1fFF77ACiPMDVjGSy4ywVFVFKDavRA==","signatures":[{"sig":"MEUCIQD335I24Nq8KRm8GPjC67fop9Yb2Jk8OwyHHCVbIk/2yQIgaYgc0ScVWK8o16B/6J7L7axRyjfr0bJyOsz4a5jRYCY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23073},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"7f07a1e46fe73ca49f03f7b373377b184481c0b2","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"repository":{"url":"git+https://github.com/Ascendance-Hub/Sapphire.git","type":"git","directory":"packages/bson"},"_npmVersion":"10.9.7","description":"Native MongoDB driver adapter for Sapphire — emits $jsonSchema collection validators.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"mongodb":"^7.2.0","mongodb-memory-server":"^11.0.0","@ascendance-hub/sapphire-core":"0.0.0-preview-20260518153515"},"peerDependencies":{"mongodb":"^6 || ^7","@ascendance-hub/sapphire-core":"0.0.0-preview-20260518153515"},"peerDependenciesMeta":{"mongodb":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sapphire-bson_0.0.0-preview-20260518153515_1779118519461_0.9357939472510441","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@ascendance-hub/sapphire-bson","version":"1.1.0","keywords":["typescript","schema","bson","mongodb","jsonschema","validator","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","_id":"@ascendance-hub/sapphire-bson@1.1.0","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"dist":{"shasum":"9a1a9d900db957625cd8971d0d7e799461b4b15f","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-bson/-/sapphire-bson-1.1.0.tgz","fileCount":7,"integrity":"sha512-SnGbrLbQM4zPVg7mjRZZbkM3Pf7+9MI6J20tuMpgrPf1aOvKxZDIl9Pxa4Mn+9xrw9FqozWAZnA0ph6AoxdYOw==","signatures":[{"sig":"MEYCIQCgzhc+tG0dUR6RdK4LbrhNW5A//VhkN03QZS7MsNGBngIhANOdCsEqNWBwTA3Ouyf0BhEIpEw6hcSaxZpz2t+gOOUW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23002},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"76178e21015fe89d02d149a06998178a2d956a3f","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"repository":{"url":"git+https://github.com/Ascendance-Hub/Sapphire.git","type":"git","directory":"packages/bson"},"_npmVersion":"10.9.7","description":"Native MongoDB driver adapter for Sapphire — emits $jsonSchema collection validators.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mongodb":"^7.2.0","mongodb-memory-server":"^11.0.0","@ascendance-hub/sapphire-core":"*"},"peerDependencies":{"mongodb":"^6 || ^7","@ascendance-hub/sapphire-core":">=1.0.0"},"peerDependenciesMeta":{"mongodb":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sapphire-bson_1.1.0_1779118573308_0.5012986081068218","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-preview-20260531184331":{"name":"@ascendance-hub/sapphire-bson","version":"0.0.0-preview-20260531184331","keywords":["typescript","schema","bson","mongodb","jsonschema","validator","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","_id":"@ascendance-hub/sapphire-bson@0.0.0-preview-20260531184331","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"dist":{"shasum":"ba456f7c9bfce2e49e394f5fa36504b70db22160","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-bson/-/sapphire-bson-0.0.0-preview-20260531184331.tgz","fileCount":7,"integrity":"sha512-NTI4eblY6UpUEJdpr3p+CN2Z1UkyJdIcc3j7tzJ2kIG8ZAPhLjop05C90JS2rnCzMF3HVfAIyku1BKr86WGI0Q==","signatures":[{"sig":"MEUCIA5uy93LPKn3iTXCeKd59Mbsv8K5jjAPx8uHSHuNcxn+AiEA7yKlQ3DHZksGvwDGaHhBa+ZPaY/CPi50+oJh1QagXkY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23073},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"e8461b27236d5fc3b9b0810c610bc53c79e7e5fc","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"repository":{"url":"git+https://github.com/Ascendance-Hub/Sapphire.git","type":"git","directory":"packages/bson"},"_npmVersion":"10.9.8","description":"Native MongoDB driver adapter for Sapphire — emits $jsonSchema collection validators.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"mongodb":"^7.2.0","mongodb-memory-server":"^11.0.0","@ascendance-hub/sapphire-core":"0.0.0-preview-20260531184331"},"peerDependencies":{"mongodb":"^6 || ^7","@ascendance-hub/sapphire-core":"0.0.0-preview-20260531184331"},"peerDependenciesMeta":{"mongodb":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sapphire-bson_0.0.0-preview-20260531184331_1780253015388_0.7275145088854544","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-preview-20260531190529":{"name":"@ascendance-hub/sapphire-bson","version":"0.0.0-preview-20260531190529","keywords":["typescript","schema","bson","mongodb","jsonschema","validator","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","_id":"@ascendance-hub/sapphire-bson@0.0.0-preview-20260531190529","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"dist":{"shasum":"19f58ea949d3c7467b6943f8f6a7b83042c16baa","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-bson/-/sapphire-bson-0.0.0-preview-20260531190529.tgz","fileCount":7,"integrity":"sha512-4Gtyjdg61OqkYWanWylfbtYFAOIkm+F0siWoNZXN7n21dxgPZ/g/EEtItVJJ23QV2ywil9e3RLX+ozWWGHH4dg==","signatures":[{"sig":"MEUCIBoWUO4jzNU/PsD2aHIut/aUifDedeecJnYIGFEh0R+kAiEAkRUdQI+Sr1ZAGPJR12ADgfyK9y6VS/RoYtDWvFk4BIQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23073},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"8a9b61513b5f64c6449a6a061d9bb6e0ffe7c865","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"repository":{"url":"git+https://github.com/Ascendance-Hub/Sapphire.git","type":"git","directory":"packages/bson"},"_npmVersion":"10.9.8","description":"Native MongoDB driver adapter for Sapphire — emits $jsonSchema collection validators.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"mongodb":"^7.2.0","mongodb-memory-server":"^11.0.0","@ascendance-hub/sapphire-core":"0.0.0-preview-20260531190529"},"peerDependencies":{"mongodb":"^6 || ^7","@ascendance-hub/sapphire-core":"0.0.0-preview-20260531190529"},"peerDependenciesMeta":{"mongodb":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sapphire-bson_0.0.0-preview-20260531190529_1780254332888_0.9057207504382621","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-preview-20260531194731":{"name":"@ascendance-hub/sapphire-bson","version":"0.0.0-preview-20260531194731","keywords":["typescript","schema","bson","mongodb","jsonschema","validator","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","_id":"@ascendance-hub/sapphire-bson@0.0.0-preview-20260531194731","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"dist":{"shasum":"1a2c90ee83b90ffb0e5096ce1ee9897408a97e5d","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-bson/-/sapphire-bson-0.0.0-preview-20260531194731.tgz","fileCount":7,"integrity":"sha512-dfbHn8OHlJ4/zDVuzE7pcmtJbTumGdcDgwYQQgJYhPPixLSTfrk85IdixB+xyEXWnyM0jsC9ucAJdQI4kBwDqQ==","signatures":[{"sig":"MEUCIBkMWPk1XHYh3TERro1H4v/CIqB8uhUdRKypZn9At4IvAiEAtHuDnEr6btu0lk+C/yw3Kjw9Ou0ipE00u5JjzD4c8u0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23073},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"dd7c2b94ce17eb7f2754a707b058e45e23baa1f9","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"repository":{"url":"git+https://github.com/Ascendance-Hub/Sapphire.git","type":"git","directory":"packages/bson"},"_npmVersion":"10.9.8","description":"Native MongoDB driver adapter for Sapphire — emits $jsonSchema collection validators.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"mongodb":"^7.2.0","mongodb-memory-server":"^11.0.0","@ascendance-hub/sapphire-core":"0.0.0-preview-20260531194731"},"peerDependencies":{"mongodb":"^6 || ^7","@ascendance-hub/sapphire-core":"0.0.0-preview-20260531194731"},"peerDependenciesMeta":{"mongodb":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/sapphire-bson_0.0.0-preview-20260531194731_1780256854213_0.3662232474923559","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@ascendance-hub/sapphire-bson","version":"1.2.0","description":"Native MongoDB driver adapter for Sapphire — emits $jsonSchema collection validators.","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"sideEffects":false,"scripts":{"build":"tsup","test":"vitest run","typecheck":"tsc --noEmit"},"peerDependencies":{"@ascendance-hub/sapphire-core":">=1.0.0","mongodb":"^6 || ^7"},"peerDependenciesMeta":{"mongodb":{"optional":true}},"devDependencies":{"@ascendance-hub/sapphire-core":"*","mongodb":"^7.2.0","mongodb-memory-server":"^11.0.0"},"repository":{"type":"git","url":"git+https://github.com/Ascendance-Hub/Sapphire.git","directory":"packages/bson"},"keywords":["typescript","schema","bson","mongodb","jsonschema","validator","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","publishConfig":{"access":"public"},"engines":{"node":">=20"},"bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","_id":"@ascendance-hub/sapphire-bson@1.2.0","gitHead":"c385975185892d170d5f003f45740273bfb29d15","_nodeVersion":"22.22.3","_npmVersion":"10.9.8","dist":{"integrity":"sha512-Pm+rSTvLJGbScbk30EW57AbJmyUD6NV5IG8phzrr0O4D4IEPmJW00ImDJ/Fnp+xTO7SuFFMHnWrZVogHTB2UqA==","shasum":"461b42ff7852aaff26b9286facde8e92db931978","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-bson/-/sapphire-bson-1.2.0.tgz","fileCount":7,"unpackedSize":23002,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEMLBH0LSMNmJvhTVqJ6tsmkPAwD92Is4Yie3nnLM/e+AiEA6wm6Zfsglsq6BhOoP2RofepspNXdLCIbPbxpDipbNqg="}]},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"directories":{},"maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sapphire-bson_1.2.0_1780257338449_0.04609129784561383"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-16T21:46:21.980Z","modified":"2026-05-31T19:55:38.728Z","1.0.0":"2026-05-16T21:46:22.199Z","0.0.0-preview-20260518150854":"2026-05-18T15:08:58.380Z","0.0.0-preview-20260518153515":"2026-05-18T15:35:19.634Z","1.1.0":"2026-05-18T15:36:13.460Z","0.0.0-preview-20260531184331":"2026-05-31T18:43:35.530Z","0.0.0-preview-20260531190529":"2026-05-31T19:05:33.064Z","0.0.0-preview-20260531194731":"2026-05-31T19:47:34.367Z","1.2.0":"2026-05-31T19:55:38.613Z"},"bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","keywords":["typescript","schema","bson","mongodb","jsonschema","validator","sapphire"],"repository":{"type":"git","url":"git+https://github.com/Ascendance-Hub/Sapphire.git","directory":"packages/bson"},"description":"Native MongoDB driver adapter for Sapphire — emits $jsonSchema collection validators.","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"readme":"# @ascendance-hub/sapphire-bson\n\nNative MongoDB driver adapter for [Sapphire](https://github.com/Ascendance-Hub/Sapphire). Converts a Sapphire IR (`SapphireSchemaNode`) into a MongoDB **collection validator** — a `{ $jsonSchema: ... }` document you hand to the driver so the database itself rejects malformed inserts.\n\n> **Unofficial.** A community adapter — not affiliated with, sponsored, or endorsed by MongoDB, Inc.\n\n> Using Mongoose? See [`@ascendance-hub/sapphire-mongoose`](https://www.npmjs.com/package/@ascendance-hub/sapphire-mongoose) instead.\n\n## Install\n\n```bash\nnpm install @ascendance-hub/sapphire-core @ascendance-hub/sapphire-bson\n```\n\n`@ascendance-hub/sapphire-core` is a peer dependency. `mongodb` is an **optional** peer dependency — `toBsonSchema` emits a plain object and never imports the driver; you only need `mongodb` installed to actually create the collection.\n\n## Register the adapter\n\nThe adapter is **not auto-registered**. Call `registerAdapter` once in your application entry point:\n\n```ts\nimport { Sapphire, registerAdapter } from '@ascendance-hub/sapphire-core'\nimport { toBsonSchema } from '@ascendance-hub/sapphire-bson'\n\nregisterAdapter('bson', toBsonSchema)\n\nexport const a = new Sapphire({ defaultAdapter: 'bson' })\n```\n\n## Quickstart\n\n```ts\nimport { MongoClient } from 'mongodb'\nimport { toBsonSchema } from '@ascendance-hub/sapphire-bson'\nimport { a } from './sapphire'\n\nconst User = a.object({\n  name: a.string().min(1),\n  email: a.string().email(),\n  age: a.number().int().min(0).optional(),\n})\n\nconst validator = toBsonSchema(User.toSchema())\n// → { $jsonSchema: { bsonType: 'object', required: [...], properties: {...} } }\n\nconst db = new MongoClient(process.env.MONGO_URL!).db('app')\nawait db.createCollection('users', { validator })\n// or, on an existing collection:\nawait db.command({ collMod: 'users', validator })\n```\n\n## IR → `$jsonSchema` mapping\n\nMongoDB's flavor of JSON Schema — `bsonType` instead of `type`, BSON type names, everything inlined (no `$ref`).\n\n| IR `kind` | `$jsonSchema` output                                          | Notes                                                                                                |\n| --------- | ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |\n| `string`  | `{ bsonType: 'string' }`                                      | `minLength`/`maxLength`/`length` direct. `regex`/`startsWith`/`endsWith`/`email`/`uuid` → `pattern`. |\n| `number`  | `{ bsonType: 'number' }` or `{ bsonType: 'int' }`             | `.int()` → `'int'`. `min`/`max`/`multipleOf` direct; exclusive bounds use draft-4 boolean flags.     |\n| `boolean` | `{ bsonType: 'bool' }`                                        | —                                                                                                    |\n| `date`    | `{ bsonType: 'date' }`                                        | —                                                                                                    |\n| `object`  | `{ bsonType: 'object', properties, required }`                | Named objects are inlined — there is no `$ref`.                                                      |\n| `array`   | `{ bsonType: 'array', items }`                                | `minItems`/`maxItems`/`length` direct.                                                               |\n| `tuple`   | `{ bsonType: 'array', items: [...], additionalItems: false }` | `minItems`/`maxItems` pinned to the tuple length.                                                    |\n| `union`   | `{ anyOf: [...] }`                                            | Requires MongoDB 5.0+.                                                                               |\n| `literal` | `{ enum: [value] }`                                           | —                                                                                                    |\n| `enum`    | `{ enum: [...values] }`                                       | —                                                                                                    |\n| `record`  | `{ bsonType: 'object', additionalProperties: <values> }`      | —                                                                                                    |\n| `ref`     | `{ bsonType: 'objectId' }`                                    | A reference is stored as an ObjectId.                                                                |\n\nA `nullable()` primitive lifts into a `bsonType` array (`['string', 'null']`); a nullable `union`/`literal`/`enum` wraps in `anyOf` with a `{ bsonType: 'null' }` branch.\n\n## `BsonValidatorOptions`\n\n| Option                 | Default     | Effect                                                                                                                                  |\n| ---------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| `additionalProperties` | _(omitted)_ | When set, emits `additionalProperties` on every object. `false` gives a closed shape (the root still permits MongoDB's injected `_id`). |\n\n## `.adapter('bson', opts)` escape hatch\n\nKeys passed via `.adapter('bson', { ... })` are merged into the emitted node. The adapter-computed keys `bsonType`, `type`, `required`, `enum`, `properties`, `items` are blacklisted and cannot be overridden.\n\n**Note:** MongoDB rejects unknown `$jsonSchema` keywords — only pass keys that are valid `$jsonSchema` keywords (`title`, `minProperties`, `patternProperties`, …).\n\n## Typed documents — `BsonDoc`\n\n```ts\nimport type { Collection } from 'mongodb'\nimport type { BsonDoc } from '@ascendance-hub/sapphire-bson'\n\nconst users: Collection<BsonDoc<typeof User>> = db.collection('users')\n```\n\n`BsonDoc<F>` is a type-only alias over core's `Infer` — there is no runtime helper.\n\n## Limitations\n\n- **A validator only validates.** It does not transform input or fill defaults. `transforms`, `default(v)`, `coerce()`, and the numeric `finite`/`safe` checks have no `$jsonSchema` equivalent and are not emitted — run them client-side via `parse()` / `safeParse()`.\n- **`format('url')`** is not enforced server-side (no exported URL regex); email and uuid become `pattern`. Validate URLs client-side.\n- **`unique` / `index`** are not part of the validator — create indexes with `db.collection.createIndex(...)`.\n- **`union`** needs MongoDB 5.0+ (`anyOf` in `$jsonSchema`).\n\n## License\n\nMIT\n","readmeFilename":"README.md"}