@cipherstash/stack 1.0.0-rc.0 → 1.0.0-rc.2

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.
Files changed (50) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/README.md +321 -239
  3. package/dist/adapter-kit.cjs +83 -4
  4. package/dist/adapter-kit.cjs.map +1 -1
  5. package/dist/adapter-kit.d.cts +41 -3
  6. package/dist/adapter-kit.d.ts +41 -3
  7. package/dist/adapter-kit.js +78 -3
  8. package/dist/adapter-kit.js.map +1 -1
  9. package/dist/{chunk-V2Q3NYIH.js → chunk-6SGN52W6.js} +1 -1
  10. package/dist/{chunk-V2Q3NYIH.js.map → chunk-6SGN52W6.js.map} +1 -1
  11. package/dist/{chunk-HQANMV7R.js → chunk-BCY6WB24.js} +3 -3
  12. package/dist/{chunk-HQANMV7R.js.map → chunk-BCY6WB24.js.map} +1 -1
  13. package/dist/{chunk-LBMC4D6D.js → chunk-NVKK7UDN.js} +1 -1
  14. package/dist/chunk-NVKK7UDN.js.map +1 -0
  15. package/dist/{chunk-OFQ555AX.js → chunk-Q4WTOYVI.js} +3 -3
  16. package/dist/{chunk-ZTP5QJ27.js → chunk-UI7V2QCK.js} +6 -6
  17. package/dist/{chunk-ZTP5QJ27.js.map → chunk-UI7V2QCK.js.map} +1 -1
  18. package/dist/{columns-rZc7fQHI.d.ts → columns-0lbT9stl.d.ts} +2 -2
  19. package/dist/{columns-D2_YzrCX.d.cts → columns-Bxv7Oo9o.d.cts} +2 -2
  20. package/dist/dynamodb/index.cjs +2 -2
  21. package/dist/dynamodb/index.cjs.map +1 -1
  22. package/dist/dynamodb/index.js +1 -1
  23. package/dist/encryption/index.cjs +4 -4
  24. package/dist/encryption/index.cjs.map +1 -1
  25. package/dist/encryption/index.js +4 -4
  26. package/dist/encryption/v3.cjs +4 -4
  27. package/dist/encryption/v3.cjs.map +1 -1
  28. package/dist/encryption/v3.d.cts +2 -2
  29. package/dist/encryption/v3.d.ts +2 -2
  30. package/dist/encryption/v3.js +5 -5
  31. package/dist/eql/v3/index.cjs.map +1 -1
  32. package/dist/eql/v3/index.d.cts +2 -2
  33. package/dist/eql/v3/index.d.ts +2 -2
  34. package/dist/eql/v3/index.js +1 -1
  35. package/dist/errors/index.cjs.map +1 -1
  36. package/dist/errors/index.d.cts +5 -5
  37. package/dist/errors/index.d.ts +5 -5
  38. package/dist/errors/index.js +1 -1
  39. package/dist/identity/index.cjs +2 -2
  40. package/dist/identity/index.cjs.map +1 -1
  41. package/dist/identity/index.js +3 -3
  42. package/dist/index.cjs +4 -4
  43. package/dist/index.cjs.map +1 -1
  44. package/dist/index.js +4 -4
  45. package/dist/wasm-inline.d.ts +243 -58
  46. package/dist/wasm-inline.js +268 -0
  47. package/dist/wasm-inline.js.map +1 -1
  48. package/package.json +16 -16
  49. package/dist/chunk-LBMC4D6D.js.map +0 -1
  50. /package/dist/{chunk-OFQ555AX.js.map → chunk-Q4WTOYVI.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,89 @@
1
1
  # @cipherstash/stack
2
2
 
3
+ ## 1.0.0-rc.2
4
+
5
+ ### Minor Changes
6
+
7
+ - b085f66: `@cipherstash/stack/wasm-inline` now exposes `encryptQuery` and
8
+ `encryptQueryBulk` on `WasmEncryptionClient` (#662) — searchable encryption
9
+ is reachable on Deno/edge runtimes. Previously the WASM entry exposed only
10
+ `encrypt`/`decrypt`/`isEncrypted`, so encrypted WHERE-clause search was
11
+ architecturally impossible on the edge even though the underlying protect-ffi
12
+ WASM build carries the capability.
13
+
14
+ The new methods mint ciphertext-free EQL v3 query terms — equality,
15
+ free-text match, ORE range, and JSON containment/selector — with the same
16
+ index-type resolution as the native client (explicit `queryType`, or
17
+ inference from the column's configured indexes). Cast the term to the
18
+ column's `eql_v3.query_<domain>` type in SQL to reach the indexed operators.
19
+ Errors throw, consistent with the WASM surface's `encrypt`/`decrypt`; the
20
+ bulk form is position-stable (`null` values pass through as `null`).
21
+
22
+ ## 1.0.0-rc.1
23
+
24
+ ### Minor Changes
25
+
26
+ - 5fe9a2f: Encrypted-JSON querying on the v3 Supabase surface (#650). A `types.Json`
27
+ column now supports exact encrypted containment — `contains(col, subDocument)`
28
+ (ste_vec `@>` via PostgREST `cs`, with the sub-document storage-encrypted
29
+ against the column) — and JSONPath selector predicates: `selectorEq(col, path,
30
+ value)` and `selectorNe(col, path, value)` (dot-notation paths; `ne` includes
31
+ rows where the path is absent, mirroring the Drizzle selector's semantics).
32
+ Raw `.filter(col, 'cs', subDocument)` and `not(col, 'contains', …)` route
33
+ through the same encrypted path. Selector ordering is not expressible over
34
+ PostgREST yet (needs an EQL-bundle overload — see
35
+ cipherstash/encrypt-query-language#407); the Drizzle integration's
36
+ `ops.selector()` covers ordering today.
37
+
38
+ In core, `QueryTypesForColumn` gains the `searchableJson` arm (a `types.Json`
39
+ column no longer resolves to `never`, so typed adapter key sets can include
40
+ it), and the JSONPath selector-path helpers the Drizzle adapter introduced in
41
+ #651 moved to `@cipherstash/stack/adapter-kit` so both adapters share one
42
+ validation surface (`@cipherstash/stack-drizzle` re-exports them unchanged).
43
+
44
+ The bundled `stash-supabase` and `stash-encryption` skills are updated to
45
+ document the new querying surface (including the array-leaf and SQL-NULL
46
+ semantics, and the operand-exposure caveat) — skills ship inside the `stash`
47
+ tarball, hence the patch.
48
+
49
+ ### Patch Changes
50
+
51
+ - e297f64: Docs: EQL v3 is now the sole documented approach. The `stash-encryption`,
52
+ `stash-drizzle`, and `stash-supabase` skills and the `@cipherstash/stack`
53
+ README teach only the v3 typed surface (`EncryptionV3`, `types.*` concrete
54
+ domains, `@cipherstash/stack-drizzle/v3`, `encryptedSupabaseV3`); EQL v2
55
+ shrinks to one short Legacy section per document. Two explicit exceptions are
56
+ called out: DynamoDB still requires the v2 schema surface (#657), and the
57
+ encrypt rollout tooling (`stash encrypt backfill`/`cutover`,
58
+ `@cipherstash/migrate`) currently targets v2 columns (#648) — its guidance is
59
+ kept under a version callout. Also corrects the legacy `@cipherstash/drizzle`
60
+ README's pointer to the removed `@cipherstash/stack/drizzle` subpath (now the
61
+ separate `@cipherstash/stack-drizzle` package).
62
+ - 40ab142: Docs: stop teaching the deprecated `LockContext.identify()` as the primary
63
+ identity-aware-encryption path (#591). The `stash-encryption` and `stash-supabase`
64
+ skills and the `@cipherstash/stack` README now lead with the current pattern —
65
+ authenticate the client with `OidcFederationStrategy`, then bind the claim per
66
+ operation with `.withLockContext({ identityClaim })` — and demote
67
+ `LockContext.identify()` to a clearly-marked deprecated note (per-operation CTS
68
+ tokens were removed in protect-ffi 0.25). Skills ship in the `stash` tarball, so
69
+ this keeps the bundled guidance correct for the 1.0 surface.
70
+ - 7b53141: Three correctness fixes surfaced while documenting the v3 surface:
71
+
72
+ - **Supabase `matches()` now rejects a short free-text needle.** A needle
73
+ below the tokenizer's `token_length` blooms to zero tokens, so `bloom @> {}`
74
+ matched (and the caller decrypted) every row — a fail-open exposure. The
75
+ guard (`matchNeedleError`) was wired into the Drizzle adapter only; the
76
+ Supabase adapter now applies it at the same term-resolution choke point, so
77
+ both first-party surfaces reject identically. (Authoritative FFI-level backstop
78
+ for the `encryptQuery` paths tracked in cipherstash/protectjs-ffi#138.)
79
+ - **Supabase `.withLockContext()` accepts the plain `{ identityClaim }` form**,
80
+ not only a `LockContext` instance — matching the stack-level operations and
81
+ the documented identity-aware example (widened to `LockContextInput`).
82
+ - **`EncryptionErrorTypes` is now `as const`**, so the `StackError` union
83
+ actually discriminates: `switch (error.type)` narrows and `error.code` is
84
+ reachable on the relevant branches. Without it every `type` was `string` and
85
+ the documented exhaustive error handler did not compile.
86
+
3
87
  ## 1.0.0-rc.0
4
88
 
5
89
  ### Major Changes