@jini-ai/db 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/README.md +6 -0
- package/dist/secrets-vault/repo.sql.d.ts +2 -2
- package/dist/secrets-vault/repo.sql.js +2 -2
- package/package.json +9 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## 0.3.4 — 2026-10-13
|
|
2
|
+
|
|
3
|
+
- Vault SQL repo imports `@jini-ai/platform/secrets/credential-sets/contracts`; requires @jini-ai/platform >=0.5.6 (credential-sets/contracts); publish platform first.
|
|
4
|
+
- `@jini-ai/platform` is now an optional peer: only `./secrets-vault` loads it. Hosts using the vault list platform themselves.
|
|
5
|
+
|
|
1
6
|
## 0.3.3 — 2026-10-12
|
|
2
7
|
|
|
3
8
|
- Vault `findDefault` restates the default group in the normalized expressions and binds `is_default` as a dialect literal, so a host's partial default index is matched (SQLite and Postgres). Raw-column filters stay; results are unchanged.
|
package/README.md
CHANGED
|
@@ -29,6 +29,12 @@ the tsx CommonJS bootstrap can resolve the subpaths without an active `import` c
|
|
|
29
29
|
|
|
30
30
|
## Import and driver isolation
|
|
31
31
|
|
|
32
|
+
`@jini-ai/db/secrets-vault` requires the optional `@jini-ai/platform` peer at import
|
|
33
|
+
time for the canonical credential validation and error contracts, plus Kysely for
|
|
34
|
+
SQL. Install platform explicitly when using this subpath; existing vault consumers
|
|
35
|
+
that relied on transitive installation must add it before upgrading. Other database
|
|
36
|
+
entries do not load platform.
|
|
37
|
+
|
|
32
38
|
`kysely` is an optional peer (`^0.29.6`), imported as a value or type only under `src/kernel/`
|
|
33
39
|
and `src/migrate/`. `better-sqlite3`, `pg` and `@electric-sql/pglite` are also optional peers.
|
|
34
40
|
Production code never imports a driver at runtime. PGlite type imports are confined to
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type VaultBatchOp, type VaultBatchResult, type VaultDefaultQuery, type VaultSingletonQuery, type VaultMeta, type VaultOptions, type VaultQuery, type VaultRecord, type VaultRepoPort } from "@jini-ai/platform/secrets/credential-sets";
|
|
1
|
+
import { type VaultBatchOp, type VaultBatchResult, type VaultDefaultQuery, type VaultSingletonQuery, type VaultMeta, type VaultOptions, type VaultQuery, type VaultRecord, type VaultRepoPort } from "@jini-ai/platform/secrets/credential-sets/contracts";
|
|
2
2
|
import type { StorageKernel } from "../kernel/port.js";
|
|
3
3
|
/** Fixed columns consumed by the adapter; hosts own DDL, foreign keys and migration provenance.
|
|
4
4
|
* A partial unique default index and label index use the same scope as VaultRepoPort.
|
|
@@ -59,7 +59,7 @@ export declare class SqlSecretsVaultRepo implements VaultRepoPort {
|
|
|
59
59
|
}, _options?: VaultOptions): Promise<VaultBatchResult[]>;
|
|
60
60
|
/** One indexed exact-group lookup; ciphertext is loaded only for the chosen default.
|
|
61
61
|
* The group is restated in the default index's normalized expressions and `is_default` is a
|
|
62
|
-
* literal, else neither SQLite nor a generic Postgres plan can match the partial index (
|
|
62
|
+
* literal, else neither SQLite nor a generic Postgres plan can match the partial index (host
|
|
63
63
|
* EXPLAIN 2026-10-12: SQLite fell back to a raw-column index, Postgres to the label index). */
|
|
64
64
|
findDefault(input: VaultDefaultQuery, _options?: VaultOptions): Promise<VaultRecord | null>;
|
|
65
65
|
list(input: VaultQuery, _options?: VaultOptions): Promise<VaultRecord[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { sql } from "kysely";
|
|
2
|
-
import { assertVaultReplacement, VaultError } from "@jini-ai/platform/secrets/credential-sets";
|
|
2
|
+
import { assertVaultReplacement, VaultError } from "@jini-ai/platform/secrets/credential-sets/contracts";
|
|
3
3
|
import { jsonSet, toBool } from "../kernel/dialect.js";
|
|
4
4
|
function fromRow(row) {
|
|
5
5
|
const parts = [row.sealed_key_id, row.sealed_ciphertext, row.sealed_nonce, row.sealed_alg];
|
|
@@ -88,7 +88,7 @@ export class SqlSecretsVaultRepo {
|
|
|
88
88
|
}
|
|
89
89
|
/** One indexed exact-group lookup; ciphertext is loaded only for the chosen default.
|
|
90
90
|
* The group is restated in the default index's normalized expressions and `is_default` is a
|
|
91
|
-
* literal, else neither SQLite nor a generic Postgres plan can match the partial index (
|
|
91
|
+
* literal, else neither SQLite nor a generic Postgres plan can match the partial index (host
|
|
92
92
|
* EXPLAIN 2026-10-12: SQLite fell back to a raw-column index, Postgres to the label index). */
|
|
93
93
|
async findDefault(input, _options = {}) {
|
|
94
94
|
const row = await this.kernel.run(db => this.scoped({ db, input }).selectAll()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jini-ai/db",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "Database ports, connection helpers, ownership, isolated Kysely kernels and migrations. All peers are optional; drivers are injected.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -192,14 +192,14 @@
|
|
|
192
192
|
"registry": "https://registry.npmjs.org"
|
|
193
193
|
},
|
|
194
194
|
"dependencies": {
|
|
195
|
-
"@jini-ai/core": "^0.4.
|
|
196
|
-
"@jini-ai/platform": "^0.5.4"
|
|
195
|
+
"@jini-ai/core": "^0.4.4"
|
|
197
196
|
},
|
|
198
197
|
"peerDependencies": {
|
|
199
198
|
"kysely": "^0.29.6",
|
|
200
199
|
"better-sqlite3": "^13.0.0",
|
|
201
200
|
"@electric-sql/pglite": "0.5.8",
|
|
202
|
-
"pg": "^8.23.0"
|
|
201
|
+
"pg": "^8.23.0",
|
|
202
|
+
"@jini-ai/platform": "^0.5.6"
|
|
203
203
|
},
|
|
204
204
|
"peerDependenciesMeta": {
|
|
205
205
|
"better-sqlite3": {
|
|
@@ -213,6 +213,9 @@
|
|
|
213
213
|
},
|
|
214
214
|
"kysely": {
|
|
215
215
|
"optional": true
|
|
216
|
+
},
|
|
217
|
+
"@jini-ai/platform": {
|
|
218
|
+
"optional": true
|
|
216
219
|
}
|
|
217
220
|
},
|
|
218
221
|
"devDependencies": {
|
|
@@ -223,7 +226,8 @@
|
|
|
223
226
|
"better-sqlite3": "13.0.3",
|
|
224
227
|
"kysely": "0.29.6",
|
|
225
228
|
"pg": "8.23.0",
|
|
226
|
-
"@jini-ai/
|
|
229
|
+
"@jini-ai/platform": "0.5.6",
|
|
230
|
+
"@jini-ai/core": "0.4.4"
|
|
227
231
|
},
|
|
228
232
|
"scripts": {
|
|
229
233
|
"build": "tsc -p tsconfig.build.json",
|