{"_id":"@absolutejs/secure-messaging-postgres","_rev":"4-cbca357376ff0b72abbb2760a2a087a1","name":"@absolutejs/secure-messaging-postgres","dist-tags":{"latest":"0.2.1"},"versions":{"0.0.1":{"name":"@absolutejs/secure-messaging-postgres","version":"0.0.1","author":{"name":"Alex Kahn"},"license":"Apache-2.0","_id":"@absolutejs/secure-messaging-postgres@0.0.1","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"homepage":"https://github.com/absolutejs/secure-messaging-adapters#readme","bugs":{"url":"https://github.com/absolutejs/secure-messaging-adapters/issues"},"dist":{"shasum":"5c82bf253f0a7b9cb8eec3383cefb7472dbce286","tarball":"https://registry.npmjs.org/@absolutejs/secure-messaging-postgres/-/secure-messaging-postgres-0.0.1.tgz","fileCount":8,"integrity":"sha512-0EkWbmtYTomOet2gi8h25VRDXZUeqMrrWVcBIvo1nVsCt22skki4hcrPlASsyAxsykpmD3LANE+BY1y7SWoTcA==","signatures":[{"sig":"MEYCIQC307qn+/LA8pHTe56VvdbrMq+N4cBB2Gjv7vUpRb5REQIhAMVMn59Pk+lSlgXdDAqDEhfYRkEs9ljKrSzCCMLg4GAt","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68083},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./migrations/postgres.sql":"./migrations/001_secure_messaging.sql"},"gitHead":"cac2a620a8539a395976e452b5eed74ab34b65bf","scripts":{"test":"bun test tests/","build":"rm -rf dist && bun build src/index.ts --outdir dist --root src --sourcemap --target=browser --external @absolutejs/secure-messaging && tsc --project tsconfig.build.json","release":"bun run check:package && npm publish --access public","typecheck":"tsc --noEmit","format:check":"prettier --check \"./**/*.{ts,json,md}\"","check:package":"bun run format:check && bun run typecheck && bun run test && bun run build","test:integration":"bun test tests/postgres.test.ts"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"repository":{"url":"git+https://github.com/absolutejs/secure-messaging-adapters.git","type":"git","directory":"postgres"},"_npmVersion":"10.9.2","description":"Tenant-scoped atomic PostgreSQL SecureMessagingStore for AbsoluteJS.","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"pg":"8.23.0","@types/pg":"8.23.1","@absolutejs/secure-messaging":"0.5.1","@absolutejs/secure-messaging-store-conformance":"0.0.1"},"peerDependencies":{"@absolutejs/secure-messaging":">=0.5.1 <0.6"},"_npmOperationalInternal":{"tmp":"tmp/secure-messaging-postgres_0.0.1_1787874287647_0.9407146127857307","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@absolutejs/secure-messaging-postgres","version":"0.1.0","author":{"name":"Alex Kahn"},"license":"Apache-2.0","_id":"@absolutejs/secure-messaging-postgres@0.1.0","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"homepage":"https://github.com/absolutejs/secure-messaging-adapters#readme","bugs":{"url":"https://github.com/absolutejs/secure-messaging-adapters/issues"},"dist":{"shasum":"fbccb8d47fa4aa5bbe8d86ff0f5576d9ede68b06","tarball":"https://registry.npmjs.org/@absolutejs/secure-messaging-postgres/-/secure-messaging-postgres-0.1.0.tgz","fileCount":8,"integrity":"sha512-g1X1nxjFn//eBRFT6RXwqP895Z4EkvH+S2ioGHthd+E2oxw23bU2kky8V+uu1lrqe1yGjQgRZNIuj+TJW/2OJg==","signatures":[{"sig":"MEUCIQDUSwmHc4jG2ahOp2L1BXj/tdwJath+f7IA/CruF47pJgIgUXJ+IkC97Oa7YKkWHoc5q21BSGXNtyerOgEC9xBGoxo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68544},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./migrations/postgres.sql":"./migrations/001_secure_messaging.sql"},"gitHead":"7c4d4a466cbc6dcd1fbb65cf2eb0c30378865ab7","scripts":{"test":"bun test tests/","build":"rm -rf dist && bun build src/index.ts --outdir dist --root src --sourcemap --target=browser --external @absolutejs/secure-messaging && tsc --project tsconfig.build.json","release":"bun run check:package && npm publish --access public","typecheck":"tsc --noEmit","format:check":"prettier --check \"./**/*.{ts,json,md}\"","check:package":"bun run format:check && bun run typecheck && bun run test && bun run build","test:integration":"bun test tests/postgres.test.ts"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"repository":{"url":"git+https://github.com/absolutejs/secure-messaging-adapters.git","type":"git","directory":"postgres"},"_npmVersion":"10.9.2","description":"Tenant-scoped atomic PostgreSQL SecureMessagingStore for AbsoluteJS.","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"pg":"8.23.0","@types/pg":"8.23.1","@absolutejs/secure-messaging":"0.5.1","@absolutejs/secure-messaging-store-conformance":"0.0.1"},"peerDependencies":{"@absolutejs/secure-messaging":">=0.5.1 <0.6"},"_npmOperationalInternal":{"tmp":"tmp/secure-messaging-postgres_0.1.0_1787874453772_0.5402569843163088","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@absolutejs/secure-messaging-postgres","version":"0.2.0","author":{"name":"Alex Kahn"},"license":"Apache-2.0","_id":"@absolutejs/secure-messaging-postgres@0.2.0","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"homepage":"https://github.com/absolutejs/secure-messaging-adapters#readme","bugs":{"url":"https://github.com/absolutejs/secure-messaging-adapters/issues"},"dist":{"shasum":"a523ee8aeb0b7f408fb0d1e161f9281a211cf680","tarball":"https://registry.npmjs.org/@absolutejs/secure-messaging-postgres/-/secure-messaging-postgres-0.2.0.tgz","fileCount":8,"integrity":"sha512-iQcAOlQmL1ae7FoTrdV+NwcdX+QKI/nitPpZQe5/EA4ysAQXD6xsWvNEy6tij11RObdcsS+x/Uv7Ae4HJ/m+Aw==","signatures":[{"sig":"MEUCIBUn4jx4Kqcc6JG50nf9wF0MkynEmWvkBMom6ERn6VqzAiEA7ijuS4AGXCM2hQxusi5JVionr/BPjSFC0zv0Mq7V32M=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":71891},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./migrations/postgres.sql":"./migrations/001_secure_messaging.sql"},"gitHead":"a5e3ea32991615e717652e6ae73dd93086131466","scripts":{"test":"bun test tests/","build":"rm -rf dist && bun build src/index.ts --outdir dist --root src --sourcemap --target=browser --external @absolutejs/secure-messaging && tsc --project tsconfig.build.json","release":"bun run check:package && npm publish --access public","typecheck":"tsc --noEmit","format:check":"prettier --check \"./**/*.{ts,json,md}\"","check:package":"bun run format:check && bun run typecheck && bun run test && bun run build","test:integration":"bun test tests/postgres.test.ts"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"repository":{"url":"git+https://github.com/absolutejs/secure-messaging-adapters.git","type":"git","directory":"postgres"},"_npmVersion":"10.9.2","description":"Tenant-scoped atomic PostgreSQL SecureMessagingStore for AbsoluteJS.","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"pg":"8.23.0","@types/pg":"8.23.1","@absolutejs/secure-messaging":"0.5.1","@absolutejs/secure-messaging-store-conformance":"0.1.0"},"peerDependencies":{"@absolutejs/secure-messaging":">=0.5.1 <0.6"},"_npmOperationalInternal":{"tmp":"tmp/secure-messaging-postgres_0.2.0_1787875757817_0.9826326686883864","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@absolutejs/secure-messaging-postgres","version":"0.2.1","description":"Tenant-scoped atomic PostgreSQL SecureMessagingStore for AbsoluteJS.","type":"module","license":"Apache-2.0","author":{"name":"Alex Kahn"},"repository":{"type":"git","url":"git+https://github.com/absolutejs/secure-messaging-adapters.git","directory":"postgres"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./migrations/postgres.sql":"./migrations/001_secure_messaging.sql"},"publishConfig":{"access":"public"},"scripts":{"build":"rm -rf dist && bun build src/index.ts --outdir dist --root src --sourcemap --target=browser --external @absolutejs/secure-messaging && tsc --project tsconfig.build.json","check:package":"bun run format:check && bun run typecheck && bun run test && bun run build","format:check":"prettier --check \"./**/*.{ts,json,md}\"","release":"bun run check:package && npm publish --access public","test":"bun test tests/","test:integration":"bun test tests/postgres.test.ts","typecheck":"tsc --noEmit"},"peerDependencies":{"@absolutejs/secure-messaging":">=0.6.1 <0.7"},"devDependencies":{"@absolutejs/secure-messaging":"0.6.1","@absolutejs/secure-messaging-store-conformance":"0.2.0","@types/pg":"8.23.1","pg":"8.23.0"},"_id":"@absolutejs/secure-messaging-postgres@0.2.1","gitHead":"9c94ad2e5e2a7ed1d7ad259b82c6094265f423e5","bugs":{"url":"https://github.com/absolutejs/secure-messaging-adapters/issues"},"homepage":"https://github.com/absolutejs/secure-messaging-adapters#readme","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-lfztsaaA49EtUM2yy95mWbiAn7RGPYWNnuFvt50ukrZ6Cs30vJCCCR9yELlvP7eJ9Mrj6uF1bl3H/cthyPyKtQ==","shasum":"5e620f37967edc99f1c3cc5fd31e22ac4a1fbfc3","tarball":"https://registry.npmjs.org/@absolutejs/secure-messaging-postgres/-/secure-messaging-postgres-0.2.1.tgz","fileCount":8,"unpackedSize":73666,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCMQLzjNrYPzyNVoiMO+pAXSiwUMcj9tCODcosgRmSLOgIgSvmWXOG5WM4ZKUavQGhLuzu98uEEdsNLWVQfGWxYl0Q="}]},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"directories":{},"maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/secure-messaging-postgres_0.2.1_1787884358633_0.22283926924502162"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-27T23:44:47.435Z","modified":"2026-08-28T02:32:39.024Z","0.0.1":"2026-08-27T23:44:47.770Z","0.1.0":"2026-08-27T23:47:33.918Z","0.2.0":"2026-08-28T00:09:17.964Z","0.2.1":"2026-08-28T02:32:38.785Z"},"bugs":{"url":"https://github.com/absolutejs/secure-messaging-adapters/issues"},"author":{"name":"Alex Kahn"},"license":"Apache-2.0","homepage":"https://github.com/absolutejs/secure-messaging-adapters#readme","repository":{"type":"git","url":"git+https://github.com/absolutejs/secure-messaging-adapters.git","directory":"postgres"},"description":"Tenant-scoped atomic PostgreSQL SecureMessagingStore for AbsoluteJS.","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"readme":"# `@absolutejs/secure-messaging-postgres`\n\nThe recommended production `SecureMessagingStore` for AbsoluteJS. One database\ntransaction atomically commits sealed MLS state, an inbound replay receipt, and\nencrypted outbox entries. Conversation updates use revision compare-and-swap.\n\n```ts\nimport postgres from \"postgres\";\nimport {\n  createPostgresJsSecureMessagingClient,\n  createPostgresSecureMessagingStore,\n} from \"@absolutejs/secure-messaging-postgres\";\n\nconst sql = postgres(process.env.DATABASE_URL!);\nconst store = createPostgresSecureMessagingStore({\n  client: createPostgresJsSecureMessagingClient(sql),\n  deviceId: authenticatedDevice.id,\n  durability: \"local-wal\",\n  tenantId: authenticatedTenant.id,\n});\n```\n\n`createNodePostgresSecureMessagingClient(pool)` supports `pg` pools without\nmaking either driver a runtime dependency.\n\n`durability` is mandatory. `local-wal` forces `synchronous_commit=on` for every\nadapter transaction, regardless of a weaker session or database default.\n`synchronous-replica` forces `synchronous_commit=remote_apply` and must only be\nused with an intentionally configured synchronous standby. It can block when\nthat standby is unavailable, so rehearse failover and define an operator-owned\navailability policy instead of weakening durability silently.\nBoth modes fail closed when PostgreSQL reports `fsync=off`; the replica mode\nalso rejects an empty `synchronous_standby_names` setting.\n\nApply the exported `SECURE_MESSAGING_POSTGRES_MIGRATION` or the packaged\n`./migrations/postgres.sql` through your migration system. The migration is\nidempotent. Call `deleteExpiredInbound()` repeatedly from a maintenance job\nuntil it returns zero.\n\nTenant/device scope, conversation, message, and queue identifiers are SHA-256\ndigested before use as keys. Device scope is mandatory because two devices hold\ndifferent MLS state for the same conversation. Delivery routing metadata and\nencrypted frames remain visible to the database; message plaintext and unsealed\nMLS state do not.\n\nRun `@absolutejs/secure-messaging-store-conformance` against an isolated tenant\nafter database upgrades and restore drills.\n\nThis release accepts the `@absolutejs/secure-messaging@0.6` store contract and\nclassifies mutation response loss as `SecureMessagingDurabilityUncertainError`.\nReconnect to the authoritative database and call\n`resolveSecureMessagingStoreCommit()` before retrying a conversation commit.\n\nLicensed under Apache-2.0.\n","readmeFilename":"README.md"}