@cipherstash/stack 0.19.0 → 1.0.0-rc.1

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 (101) hide show
  1. package/CHANGELOG.md +596 -0
  2. package/README.md +376 -276
  3. package/dist/adapter-kit.cjs +1002 -0
  4. package/dist/adapter-kit.cjs.map +1 -0
  5. package/dist/adapter-kit.d.cts +120 -0
  6. package/dist/adapter-kit.d.ts +120 -0
  7. package/dist/adapter-kit.js +122 -0
  8. package/dist/adapter-kit.js.map +1 -0
  9. package/dist/base-operation-AOAIvsSB.d.cts +32 -0
  10. package/dist/base-operation-FXEzUXIq.d.ts +32 -0
  11. package/dist/{chunk-4AVL4VZD.js → chunk-3B5ZX3IS.js} +3 -1
  12. package/dist/chunk-3B5ZX3IS.js.map +1 -0
  13. package/dist/{chunk-U66S7VIF.js → chunk-6SGN52W6.js} +166 -107
  14. package/dist/chunk-6SGN52W6.js.map +1 -0
  15. package/dist/chunk-7333ZC6L.js +48 -0
  16. package/dist/chunk-7333ZC6L.js.map +1 -0
  17. package/dist/{chunk-MP3SSDNN.js → chunk-CLM7E4I6.js} +15 -15
  18. package/dist/{chunk-MP3SSDNN.js.map → chunk-CLM7E4I6.js.map} +1 -1
  19. package/dist/{chunk-OFQ555AX.js → chunk-IDKP6ABU.js} +2 -2
  20. package/dist/{chunk-36AA7IBJ.js → chunk-L7ISHSG7.js} +53 -20
  21. package/dist/chunk-L7ISHSG7.js.map +1 -0
  22. package/dist/{chunk-LBMC4D6D.js → chunk-NVKK7UDN.js} +1 -1
  23. package/dist/chunk-NVKK7UDN.js.map +1 -0
  24. package/dist/chunk-X3JRXEIB.js +98 -0
  25. package/dist/chunk-X3JRXEIB.js.map +1 -0
  26. package/dist/client.cjs +29 -12
  27. package/dist/client.cjs.map +1 -1
  28. package/dist/client.d.cts +3 -2
  29. package/dist/client.d.ts +3 -2
  30. package/dist/client.js +2 -2
  31. package/dist/{table-CIH7jZ2h.d.ts → columns-0lbT9stl.d.ts} +157 -138
  32. package/dist/{table-DihEAlxG.d.cts → columns-Bxv7Oo9o.d.cts} +157 -138
  33. package/dist/dynamodb/index.d.cts +3 -2
  34. package/dist/dynamodb/index.d.ts +3 -2
  35. package/dist/encryption/index.cjs +54 -16
  36. package/dist/encryption/index.cjs.map +1 -1
  37. package/dist/encryption/index.d.cts +807 -6
  38. package/dist/encryption/index.d.ts +807 -6
  39. package/dist/encryption/index.js +6 -6
  40. package/dist/encryption/v3.cjs +1078 -973
  41. package/dist/encryption/v3.cjs.map +1 -1
  42. package/dist/encryption/v3.d.cts +15 -12
  43. package/dist/encryption/v3.d.ts +15 -12
  44. package/dist/encryption/v3.js +50 -22
  45. package/dist/encryption/v3.js.map +1 -1
  46. package/dist/eql/v3/index.cjs +130 -79
  47. package/dist/eql/v3/index.cjs.map +1 -1
  48. package/dist/eql/v3/index.d.cts +115 -13
  49. package/dist/eql/v3/index.d.ts +115 -13
  50. package/dist/eql/v3/index.js +16 -6
  51. package/dist/errors/index.cjs.map +1 -1
  52. package/dist/errors/index.d.cts +5 -5
  53. package/dist/errors/index.d.ts +5 -5
  54. package/dist/errors/index.js +1 -1
  55. package/dist/identity/index.cjs.map +1 -1
  56. package/dist/identity/index.js +2 -2
  57. package/dist/index-BquA71_Y.d.ts +24 -0
  58. package/dist/index-fhWTOV0K.d.cts +24 -0
  59. package/dist/index.cjs +79 -27
  60. package/dist/index.cjs.map +1 -1
  61. package/dist/index.d.cts +5 -17
  62. package/dist/index.d.ts +5 -17
  63. package/dist/index.js +6 -6
  64. package/dist/schema/index.cjs +29 -12
  65. package/dist/schema/index.cjs.map +1 -1
  66. package/dist/schema/index.d.cts +1 -1
  67. package/dist/schema/index.d.ts +1 -1
  68. package/dist/schema/index.js +2 -2
  69. package/dist/{types-public-CpS5KjwX.d.ts → types-public-QMjYNfQO.d.cts} +765 -726
  70. package/dist/{types-public-CpS5KjwX.d.cts → types-public-QMjYNfQO.d.ts} +765 -726
  71. package/dist/types-public.cjs.map +1 -1
  72. package/dist/types-public.d.cts +1 -1
  73. package/dist/types-public.d.ts +1 -1
  74. package/dist/types-public.js +1 -1
  75. package/dist/wasm-inline.d.ts +779 -405
  76. package/dist/wasm-inline.js +606 -299
  77. package/dist/wasm-inline.js.map +1 -1
  78. package/package.json +25 -53
  79. package/dist/chunk-36AA7IBJ.js.map +0 -1
  80. package/dist/chunk-4AVL4VZD.js.map +0 -1
  81. package/dist/chunk-IADZCZEA.js +0 -23
  82. package/dist/chunk-IADZCZEA.js.map +0 -1
  83. package/dist/chunk-IBSK6P33.js +0 -209
  84. package/dist/chunk-IBSK6P33.js.map +0 -1
  85. package/dist/chunk-LBMC4D6D.js.map +0 -1
  86. package/dist/chunk-U66S7VIF.js.map +0 -1
  87. package/dist/client-DSGHBN-g.d.cts +0 -834
  88. package/dist/client-DfCrlHXh.d.ts +0 -834
  89. package/dist/drizzle/index.cjs +0 -5617
  90. package/dist/drizzle/index.cjs.map +0 -1
  91. package/dist/drizzle/index.d.cts +0 -358
  92. package/dist/drizzle/index.d.ts +0 -358
  93. package/dist/drizzle/index.js +0 -1220
  94. package/dist/drizzle/index.js.map +0 -1
  95. package/dist/supabase/index.cjs +0 -5951
  96. package/dist/supabase/index.cjs.map +0 -1
  97. package/dist/supabase/index.d.cts +0 -223
  98. package/dist/supabase/index.d.ts +0 -223
  99. package/dist/supabase/index.js +0 -1217
  100. package/dist/supabase/index.js.map +0 -1
  101. /package/dist/{chunk-OFQ555AX.js.map → chunk-IDKP6ABU.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import { i as ColumnSchema, M as MatchIndexOpts, a as Encrypted, j as EncryptConfig } from './types-public-CpS5KjwX.cjs';
1
+ import { k as ColumnSchema } from './types-public-QMjYNfQO.cjs';
2
2
 
3
3
  /**
4
4
  * The query capabilities a v3 concrete domain exposes. These are SDK-facing
@@ -7,17 +7,36 @@ import { i as ColumnSchema, M as MatchIndexOpts, a as Encrypted, j as EncryptCon
7
7
  * `build()`.
8
8
  *
9
9
  * - `equality`: exact-match lookups (EQL `hm`, or comparison via `ob`).
10
- * - `orderAndRange`: comparison / range lookups (EQL `ob`).
10
+ * - `orderAndRange`: comparison / range lookups (EQL `op`, or `ob` on `_ord_ore` domains).
11
11
  * - `freeTextSearch`: tokenised substring match (EQL `bf`).
12
+ * - `searchableJson`: encrypted-JSONB containment / selector lookups (EQL
13
+ * `ste_vec`). Optional and mutually exclusive with the scalar flags — a
14
+ * `public.eql_v3_json` document is queried by structure, not by scalar term.
12
15
  */
13
16
  type QueryCapabilities = Readonly<{
14
17
  equality: boolean;
15
18
  orderAndRange: boolean;
16
19
  freeTextSearch: boolean;
20
+ searchableJson?: boolean;
17
21
  }>;
22
+ /**
23
+ * The `cast_as` kinds whose decrypted plaintext reconstructs to a JS `Date`.
24
+ *
25
+ * SINGLE SOURCE OF TRUTH for the date-like set. Both the type-level
26
+ * {@link PlaintextFromKind} and the runtime `rowReconstructor` (encryption/v3.ts)
27
+ * derive their "reconstructs to `Date`" decision from this array, so the next
28
+ * `Date`-backed cast is added in exactly one place — never hand-synced across a
29
+ * type and a runtime guard that could silently drift.
30
+ *
31
+ * (`timestamp` reconstructs to `Date` just like `date`, but its `cast_as` tells
32
+ * the FFI not to truncate the time-of-day.)
33
+ */
34
+ declare const DATE_LIKE_CASTS: readonly ["date", "timestamp"];
35
+ /** A `cast_as` kind that reconstructs to `Date` — see {@link DATE_LIKE_CASTS}. */
36
+ type DateLikeCast = (typeof DATE_LIKE_CASTS)[number];
18
37
  /** The plaintext (TypeScript) kind a v3 domain decrypts to. A subset of the
19
38
  * SDK `CastAs` enum, restricted to the scalar kinds v3 domains actually use. */
20
- type PlaintextKind = 'string' | 'number' | 'boolean' | 'date' | 'timestamp';
39
+ type PlaintextKind = 'string' | 'number' | 'bigint' | 'boolean' | 'json' | DateLikeCast;
21
40
  /**
22
41
  * The full, literal definition of a v3 domain. This is the LOAD-BEARING type:
23
42
  * the base column class carries a private field of this type so that every
@@ -27,7 +46,7 @@ type PlaintextKind = 'string' | 'number' | 'boolean' | 'date' | 'timestamp';
27
46
  * a storage-only `date` column and plaintext inference would collapse.
28
47
  */
29
48
  type V3DomainDefinition = Readonly<{
30
- eqlType: `eql_v3.${string}`;
49
+ eqlType: `public.${string}`;
31
50
  castAs: PlaintextKind;
32
51
  capabilities: QueryCapabilities;
33
52
  }>;
@@ -37,15 +56,16 @@ type QueryableFlag<D extends V3DomainDefinition> = D['capabilities'] extends {
37
56
  equality: false;
38
57
  orderAndRange: false;
39
58
  freeTextSearch: false;
59
+ searchableJson?: false | undefined;
40
60
  } ? false : true;
41
61
  /**
42
62
  * The concrete EQL v3 domain name for a full-capability text column.
43
63
  * Recorded as metadata for future DDL / query-dialect increments; it is
44
64
  * intentionally absent from the emitted encrypt config.
45
65
  */
46
- declare const TEXT_SEARCH_EQL_TYPE = "eql_v3.text_search";
66
+ declare const TEXT_SEARCH_EQL_TYPE = "public.eql_v3_text_search";
47
67
  declare const INTEGER: {
48
- readonly eqlType: "eql_v3.integer";
68
+ readonly eqlType: "public.eql_v3_integer";
49
69
  readonly castAs: "number";
50
70
  readonly capabilities: {
51
71
  readonly equality: false;
@@ -54,7 +74,7 @@ declare const INTEGER: {
54
74
  };
55
75
  };
56
76
  declare const INTEGER_EQ: {
57
- readonly eqlType: "eql_v3.integer_eq";
77
+ readonly eqlType: "public.eql_v3_integer_eq";
58
78
  readonly castAs: "number";
59
79
  readonly capabilities: {
60
80
  readonly equality: true;
@@ -63,7 +83,7 @@ declare const INTEGER_EQ: {
63
83
  };
64
84
  };
65
85
  declare const INTEGER_ORD_ORE: {
66
- readonly eqlType: "eql_v3.integer_ord_ore";
86
+ readonly eqlType: "public.eql_v3_integer_ord_ore";
67
87
  readonly castAs: "number";
68
88
  readonly capabilities: {
69
89
  readonly equality: true;
@@ -72,7 +92,7 @@ declare const INTEGER_ORD_ORE: {
72
92
  };
73
93
  };
74
94
  declare const INTEGER_ORD: {
75
- readonly eqlType: "eql_v3.integer_ord";
95
+ readonly eqlType: "public.eql_v3_integer_ord";
76
96
  readonly castAs: "number";
77
97
  readonly capabilities: {
78
98
  readonly equality: true;
@@ -81,7 +101,7 @@ declare const INTEGER_ORD: {
81
101
  };
82
102
  };
83
103
  declare const SMALLINT: {
84
- readonly eqlType: "eql_v3.smallint";
104
+ readonly eqlType: "public.eql_v3_smallint";
85
105
  readonly castAs: "number";
86
106
  readonly capabilities: {
87
107
  readonly equality: false;
@@ -90,7 +110,7 @@ declare const SMALLINT: {
90
110
  };
91
111
  };
92
112
  declare const SMALLINT_EQ: {
93
- readonly eqlType: "eql_v3.smallint_eq";
113
+ readonly eqlType: "public.eql_v3_smallint_eq";
94
114
  readonly castAs: "number";
95
115
  readonly capabilities: {
96
116
  readonly equality: true;
@@ -99,7 +119,7 @@ declare const SMALLINT_EQ: {
99
119
  };
100
120
  };
101
121
  declare const SMALLINT_ORD_ORE: {
102
- readonly eqlType: "eql_v3.smallint_ord_ore";
122
+ readonly eqlType: "public.eql_v3_smallint_ord_ore";
103
123
  readonly castAs: "number";
104
124
  readonly capabilities: {
105
125
  readonly equality: true;
@@ -108,7 +128,7 @@ declare const SMALLINT_ORD_ORE: {
108
128
  };
109
129
  };
110
130
  declare const SMALLINT_ORD: {
111
- readonly eqlType: "eql_v3.smallint_ord";
131
+ readonly eqlType: "public.eql_v3_smallint_ord";
112
132
  readonly castAs: "number";
113
133
  readonly capabilities: {
114
134
  readonly equality: true;
@@ -116,8 +136,44 @@ declare const SMALLINT_ORD: {
116
136
  readonly freeTextSearch: false;
117
137
  };
118
138
  };
139
+ declare const BIGINT: {
140
+ readonly eqlType: "public.eql_v3_bigint";
141
+ readonly castAs: "bigint";
142
+ readonly capabilities: {
143
+ readonly equality: false;
144
+ readonly orderAndRange: false;
145
+ readonly freeTextSearch: false;
146
+ };
147
+ };
148
+ declare const BIGINT_EQ: {
149
+ readonly eqlType: "public.eql_v3_bigint_eq";
150
+ readonly castAs: "bigint";
151
+ readonly capabilities: {
152
+ readonly equality: true;
153
+ readonly orderAndRange: false;
154
+ readonly freeTextSearch: false;
155
+ };
156
+ };
157
+ declare const BIGINT_ORD_ORE: {
158
+ readonly eqlType: "public.eql_v3_bigint_ord_ore";
159
+ readonly castAs: "bigint";
160
+ readonly capabilities: {
161
+ readonly equality: true;
162
+ readonly orderAndRange: true;
163
+ readonly freeTextSearch: false;
164
+ };
165
+ };
166
+ declare const BIGINT_ORD: {
167
+ readonly eqlType: "public.eql_v3_bigint_ord";
168
+ readonly castAs: "bigint";
169
+ readonly capabilities: {
170
+ readonly equality: true;
171
+ readonly orderAndRange: true;
172
+ readonly freeTextSearch: false;
173
+ };
174
+ };
119
175
  declare const DATE: {
120
- readonly eqlType: "eql_v3.date";
176
+ readonly eqlType: "public.eql_v3_date";
121
177
  readonly castAs: "date";
122
178
  readonly capabilities: {
123
179
  readonly equality: false;
@@ -126,7 +182,7 @@ declare const DATE: {
126
182
  };
127
183
  };
128
184
  declare const DATE_EQ: {
129
- readonly eqlType: "eql_v3.date_eq";
185
+ readonly eqlType: "public.eql_v3_date_eq";
130
186
  readonly castAs: "date";
131
187
  readonly capabilities: {
132
188
  readonly equality: true;
@@ -135,7 +191,7 @@ declare const DATE_EQ: {
135
191
  };
136
192
  };
137
193
  declare const DATE_ORD_ORE: {
138
- readonly eqlType: "eql_v3.date_ord_ore";
194
+ readonly eqlType: "public.eql_v3_date_ord_ore";
139
195
  readonly castAs: "date";
140
196
  readonly capabilities: {
141
197
  readonly equality: true;
@@ -144,7 +200,7 @@ declare const DATE_ORD_ORE: {
144
200
  };
145
201
  };
146
202
  declare const DATE_ORD: {
147
- readonly eqlType: "eql_v3.date_ord";
203
+ readonly eqlType: "public.eql_v3_date_ord";
148
204
  readonly castAs: "date";
149
205
  readonly capabilities: {
150
206
  readonly equality: true;
@@ -153,7 +209,7 @@ declare const DATE_ORD: {
153
209
  };
154
210
  };
155
211
  declare const TIMESTAMP: {
156
- readonly eqlType: "eql_v3.timestamp";
212
+ readonly eqlType: "public.eql_v3_timestamp";
157
213
  readonly castAs: "timestamp";
158
214
  readonly capabilities: {
159
215
  readonly equality: false;
@@ -162,7 +218,7 @@ declare const TIMESTAMP: {
162
218
  };
163
219
  };
164
220
  declare const TIMESTAMP_EQ: {
165
- readonly eqlType: "eql_v3.timestamp_eq";
221
+ readonly eqlType: "public.eql_v3_timestamp_eq";
166
222
  readonly castAs: "timestamp";
167
223
  readonly capabilities: {
168
224
  readonly equality: true;
@@ -171,7 +227,7 @@ declare const TIMESTAMP_EQ: {
171
227
  };
172
228
  };
173
229
  declare const TIMESTAMP_ORD_ORE: {
174
- readonly eqlType: "eql_v3.timestamp_ord_ore";
230
+ readonly eqlType: "public.eql_v3_timestamp_ord_ore";
175
231
  readonly castAs: "timestamp";
176
232
  readonly capabilities: {
177
233
  readonly equality: true;
@@ -180,7 +236,7 @@ declare const TIMESTAMP_ORD_ORE: {
180
236
  };
181
237
  };
182
238
  declare const TIMESTAMP_ORD: {
183
- readonly eqlType: "eql_v3.timestamp_ord";
239
+ readonly eqlType: "public.eql_v3_timestamp_ord";
184
240
  readonly castAs: "timestamp";
185
241
  readonly capabilities: {
186
242
  readonly equality: true;
@@ -189,7 +245,7 @@ declare const TIMESTAMP_ORD: {
189
245
  };
190
246
  };
191
247
  declare const NUMERIC: {
192
- readonly eqlType: "eql_v3.numeric";
248
+ readonly eqlType: "public.eql_v3_numeric";
193
249
  readonly castAs: "number";
194
250
  readonly capabilities: {
195
251
  readonly equality: false;
@@ -198,7 +254,7 @@ declare const NUMERIC: {
198
254
  };
199
255
  };
200
256
  declare const NUMERIC_EQ: {
201
- readonly eqlType: "eql_v3.numeric_eq";
257
+ readonly eqlType: "public.eql_v3_numeric_eq";
202
258
  readonly castAs: "number";
203
259
  readonly capabilities: {
204
260
  readonly equality: true;
@@ -207,7 +263,7 @@ declare const NUMERIC_EQ: {
207
263
  };
208
264
  };
209
265
  declare const NUMERIC_ORD_ORE: {
210
- readonly eqlType: "eql_v3.numeric_ord_ore";
266
+ readonly eqlType: "public.eql_v3_numeric_ord_ore";
211
267
  readonly castAs: "number";
212
268
  readonly capabilities: {
213
269
  readonly equality: true;
@@ -216,7 +272,7 @@ declare const NUMERIC_ORD_ORE: {
216
272
  };
217
273
  };
218
274
  declare const NUMERIC_ORD: {
219
- readonly eqlType: "eql_v3.numeric_ord";
275
+ readonly eqlType: "public.eql_v3_numeric_ord";
220
276
  readonly castAs: "number";
221
277
  readonly capabilities: {
222
278
  readonly equality: true;
@@ -225,7 +281,7 @@ declare const NUMERIC_ORD: {
225
281
  };
226
282
  };
227
283
  declare const TEXT: {
228
- readonly eqlType: "eql_v3.text";
284
+ readonly eqlType: "public.eql_v3_text";
229
285
  readonly castAs: "string";
230
286
  readonly capabilities: {
231
287
  readonly equality: false;
@@ -234,7 +290,7 @@ declare const TEXT: {
234
290
  };
235
291
  };
236
292
  declare const TEXT_EQ: {
237
- readonly eqlType: "eql_v3.text_eq";
293
+ readonly eqlType: "public.eql_v3_text_eq";
238
294
  readonly castAs: "string";
239
295
  readonly capabilities: {
240
296
  readonly equality: true;
@@ -243,7 +299,7 @@ declare const TEXT_EQ: {
243
299
  };
244
300
  };
245
301
  declare const TEXT_MATCH: {
246
- readonly eqlType: "eql_v3.text_match";
302
+ readonly eqlType: "public.eql_v3_text_match";
247
303
  readonly castAs: "string";
248
304
  readonly capabilities: {
249
305
  readonly equality: false;
@@ -252,7 +308,7 @@ declare const TEXT_MATCH: {
252
308
  };
253
309
  };
254
310
  declare const TEXT_ORD_ORE: {
255
- readonly eqlType: "eql_v3.text_ord_ore";
311
+ readonly eqlType: "public.eql_v3_text_ord_ore";
256
312
  readonly castAs: "string";
257
313
  readonly capabilities: {
258
314
  readonly equality: true;
@@ -261,7 +317,7 @@ declare const TEXT_ORD_ORE: {
261
317
  };
262
318
  };
263
319
  declare const TEXT_ORD: {
264
- readonly eqlType: "eql_v3.text_ord";
320
+ readonly eqlType: "public.eql_v3_text_ord";
265
321
  readonly castAs: "string";
266
322
  readonly capabilities: {
267
323
  readonly equality: true;
@@ -270,7 +326,7 @@ declare const TEXT_ORD: {
270
326
  };
271
327
  };
272
328
  declare const BOOLEAN: {
273
- readonly eqlType: "eql_v3.boolean";
329
+ readonly eqlType: "public.eql_v3_boolean";
274
330
  readonly castAs: "boolean";
275
331
  readonly capabilities: {
276
332
  readonly equality: false;
@@ -279,7 +335,7 @@ declare const BOOLEAN: {
279
335
  };
280
336
  };
281
337
  declare const REAL: {
282
- readonly eqlType: "eql_v3.real";
338
+ readonly eqlType: "public.eql_v3_real";
283
339
  readonly castAs: "number";
284
340
  readonly capabilities: {
285
341
  readonly equality: false;
@@ -288,7 +344,7 @@ declare const REAL: {
288
344
  };
289
345
  };
290
346
  declare const REAL_EQ: {
291
- readonly eqlType: "eql_v3.real_eq";
347
+ readonly eqlType: "public.eql_v3_real_eq";
292
348
  readonly castAs: "number";
293
349
  readonly capabilities: {
294
350
  readonly equality: true;
@@ -297,7 +353,7 @@ declare const REAL_EQ: {
297
353
  };
298
354
  };
299
355
  declare const REAL_ORD_ORE: {
300
- readonly eqlType: "eql_v3.real_ord_ore";
356
+ readonly eqlType: "public.eql_v3_real_ord_ore";
301
357
  readonly castAs: "number";
302
358
  readonly capabilities: {
303
359
  readonly equality: true;
@@ -306,7 +362,7 @@ declare const REAL_ORD_ORE: {
306
362
  };
307
363
  };
308
364
  declare const REAL_ORD: {
309
- readonly eqlType: "eql_v3.real_ord";
365
+ readonly eqlType: "public.eql_v3_real_ord";
310
366
  readonly castAs: "number";
311
367
  readonly capabilities: {
312
368
  readonly equality: true;
@@ -315,7 +371,7 @@ declare const REAL_ORD: {
315
371
  };
316
372
  };
317
373
  declare const DOUBLE: {
318
- readonly eqlType: "eql_v3.double";
374
+ readonly eqlType: "public.eql_v3_double";
319
375
  readonly castAs: "number";
320
376
  readonly capabilities: {
321
377
  readonly equality: false;
@@ -324,7 +380,7 @@ declare const DOUBLE: {
324
380
  };
325
381
  };
326
382
  declare const DOUBLE_EQ: {
327
- readonly eqlType: "eql_v3.double_eq";
383
+ readonly eqlType: "public.eql_v3_double_eq";
328
384
  readonly castAs: "number";
329
385
  readonly capabilities: {
330
386
  readonly equality: true;
@@ -333,7 +389,7 @@ declare const DOUBLE_EQ: {
333
389
  };
334
390
  };
335
391
  declare const DOUBLE_ORD_ORE: {
336
- readonly eqlType: "eql_v3.double_ord_ore";
392
+ readonly eqlType: "public.eql_v3_double_ord_ore";
337
393
  readonly castAs: "number";
338
394
  readonly capabilities: {
339
395
  readonly equality: true;
@@ -342,7 +398,7 @@ declare const DOUBLE_ORD_ORE: {
342
398
  };
343
399
  };
344
400
  declare const DOUBLE_ORD: {
345
- readonly eqlType: "eql_v3.double_ord";
401
+ readonly eqlType: "public.eql_v3_double_ord";
346
402
  readonly castAs: "number";
347
403
  readonly capabilities: {
348
404
  readonly equality: true;
@@ -373,7 +429,7 @@ declare class EncryptedV3Column<D extends V3DomainDefinition> {
373
429
  build(): ColumnSchema;
374
430
  }
375
431
  declare const TEXT_SEARCH_DOMAIN: {
376
- readonly eqlType: "eql_v3.text_search";
432
+ readonly eqlType: "public.eql_v3_text_search";
377
433
  readonly castAs: "string";
378
434
  readonly capabilities: {
379
435
  readonly equality: true;
@@ -382,15 +438,15 @@ declare const TEXT_SEARCH_DOMAIN: {
382
438
  };
383
439
  };
384
440
  /**
385
- * Builder for an `eql_v3.text_search` column.
441
+ * Builder for a `public.eql_v3_text_search` column.
386
442
  *
387
443
  * The concrete type inherently enables equality + order/range + free-text
388
- * match — there are no capability-enabling methods. `.freeTextSearch(opts?)`
389
- * tunes the match index only.
444
+ * match — there are no capability-enabling or tuning methods. The match index
445
+ * is always emitted with the default configuration.
390
446
  *
391
447
  * NOTE — querying: a `text_search` column emits all three indexes (`unique`,
392
- * `ore`, `match`), and the shared index-inference picks them by fixed priority
393
- * `unique > match > ore`. So `encryptQuery(value, { column, table })` with NO
448
+ * `ope`, `match`), and the shared index-inference picks them by fixed priority
449
+ * `unique > match > ordering`. So `encryptQuery(value, { column, table })` with NO
394
450
  * explicit `queryType` builds an EQUALITY term (via `unique`), NOT a free-text
395
451
  * match — a substring like `'joh'` then matches nothing. To run a free-text
396
452
  * match query you MUST pass `queryType: 'freeTextSearch'`:
@@ -403,16 +459,7 @@ declare const TEXT_SEARCH_DOMAIN: {
403
459
  * ```
404
460
  */
405
461
  declare class EncryptedTextSearchColumn extends EncryptedV3Column<typeof TEXT_SEARCH_DOMAIN> {
406
- private matchOpts;
407
462
  constructor(columnName: string);
408
- /**
409
- * Tune the match index. Each provided key replaces its default; omitted
410
- * keys keep the default. This NEVER enables a capability — match is always
411
- * on for this type. Merge semantics mirror v2's `opts?.x ?? default`.
412
- */
413
- freeTextSearch(opts?: MatchIndexOpts): this;
414
- /** Emit the encrypt-config column. Byte-identical to a v2 equality+order+match column. */
415
- build(): ColumnSchema;
416
463
  }
417
464
  declare class EncryptedIntegerColumn extends EncryptedV3Column<typeof INTEGER> {
418
465
  }
@@ -430,6 +477,14 @@ declare class EncryptedSmallintOrdOreColumn extends EncryptedV3Column<typeof SMA
430
477
  }
431
478
  declare class EncryptedSmallintOrdColumn extends EncryptedV3Column<typeof SMALLINT_ORD> {
432
479
  }
480
+ declare class EncryptedBigintColumn extends EncryptedV3Column<typeof BIGINT> {
481
+ }
482
+ declare class EncryptedBigintEqColumn extends EncryptedV3Column<typeof BIGINT_EQ> {
483
+ }
484
+ declare class EncryptedBigintOrdOreColumn extends EncryptedV3Column<typeof BIGINT_ORD_ORE> {
485
+ }
486
+ declare class EncryptedBigintOrdColumn extends EncryptedV3Column<typeof BIGINT_ORD> {
487
+ }
433
488
  declare class EncryptedDateColumn extends EncryptedV3Column<typeof DATE> {
434
489
  }
435
490
  declare class EncryptedDateEqColumn extends EncryptedV3Column<typeof DATE_EQ> {
@@ -482,11 +537,39 @@ declare class EncryptedDoubleOrdOreColumn extends EncryptedV3Column<typeof DOUBL
482
537
  }
483
538
  declare class EncryptedDoubleOrdColumn extends EncryptedV3Column<typeof DOUBLE_ORD> {
484
539
  }
540
+ declare const JSON_DOMAIN: {
541
+ readonly eqlType: "public.eql_v3_json";
542
+ readonly castAs: "json";
543
+ readonly capabilities: {
544
+ readonly equality: false;
545
+ readonly orderAndRange: false;
546
+ readonly freeTextSearch: false;
547
+ readonly searchableJson: true;
548
+ };
549
+ };
550
+ /**
551
+ * Builder for a `public.eql_v3_json` column — an encrypted JSONB document
552
+ * (a {@link JsonDocument}: object, array, or null). It round-trips through
553
+ * `encrypt`/`decrypt`, and containment queries use the encrypted-JSONB index
554
+ * emitted by `build()`. (The stored payload is protect-ffi's `SteVecDocument`,
555
+ * and the config index kind is `ste_vec` — both protect-ffi names.)
556
+ */
557
+ declare class EncryptedJsonColumn extends EncryptedV3Column<typeof JSON_DOMAIN> {
558
+ constructor(columnName: string);
559
+ }
485
560
  /**
486
561
  * Union of every v3 concrete column type. Used as the value type for v3 table
487
562
  * columns so a table may mix any generated domains.
488
563
  */
489
- type AnyEncryptedV3Column = EncryptedIntegerColumn | EncryptedIntegerEqColumn | EncryptedIntegerOrdOreColumn | EncryptedIntegerOrdColumn | EncryptedSmallintColumn | EncryptedSmallintEqColumn | EncryptedSmallintOrdOreColumn | EncryptedSmallintOrdColumn | EncryptedDateColumn | EncryptedDateEqColumn | EncryptedDateOrdOreColumn | EncryptedDateOrdColumn | EncryptedTimestampColumn | EncryptedTimestampEqColumn | EncryptedTimestampOrdOreColumn | EncryptedTimestampOrdColumn | EncryptedNumericColumn | EncryptedNumericEqColumn | EncryptedNumericOrdOreColumn | EncryptedNumericOrdColumn | EncryptedTextColumn | EncryptedTextEqColumn | EncryptedTextMatchColumn | EncryptedTextOrdOreColumn | EncryptedTextOrdColumn | EncryptedTextSearchColumn | EncryptedBooleanColumn | EncryptedRealColumn | EncryptedRealEqColumn | EncryptedRealOrdOreColumn | EncryptedRealOrdColumn | EncryptedDoubleColumn | EncryptedDoubleEqColumn | EncryptedDoubleOrdOreColumn | EncryptedDoubleOrdColumn;
564
+ type AnyEncryptedV3Column = EncryptedIntegerColumn | EncryptedIntegerEqColumn | EncryptedIntegerOrdOreColumn | EncryptedIntegerOrdColumn | EncryptedSmallintColumn | EncryptedSmallintEqColumn | EncryptedSmallintOrdOreColumn | EncryptedSmallintOrdColumn | EncryptedBigintColumn | EncryptedBigintEqColumn | EncryptedBigintOrdOreColumn | EncryptedBigintOrdColumn | EncryptedDateColumn | EncryptedDateEqColumn | EncryptedDateOrdOreColumn | EncryptedDateOrdColumn | EncryptedTimestampColumn | EncryptedTimestampEqColumn | EncryptedTimestampOrdOreColumn | EncryptedTimestampOrdColumn | EncryptedNumericColumn | EncryptedNumericEqColumn | EncryptedNumericOrdOreColumn | EncryptedNumericOrdColumn | EncryptedTextColumn | EncryptedTextEqColumn | EncryptedTextMatchColumn | EncryptedTextOrdOreColumn | EncryptedTextOrdColumn | EncryptedTextSearchColumn | EncryptedBooleanColumn | EncryptedRealColumn | EncryptedRealEqColumn | EncryptedRealOrdOreColumn | EncryptedRealOrdColumn | EncryptedDoubleColumn | EncryptedDoubleEqColumn | EncryptedDoubleOrdOreColumn | EncryptedDoubleOrdColumn | EncryptedJsonColumn;
565
+ /**
566
+ * A factory that builds a concrete v3 column for a given DB column name.
567
+ *
568
+ * Declared here rather than beside `DOMAIN_REGISTRY` so that `./types` can
569
+ * constrain its own export against it without importing from `./domain-registry`,
570
+ * which imports `./types` back as a value.
571
+ */
572
+ type V3ColumnFactory = (name: string) => AnyEncryptedV3Column;
490
573
  /**
491
574
  * Shape of v3 table columns: every value is a v3 concrete column builder.
492
575
  * (Nested fields are deferred to later increments.)
@@ -494,8 +577,23 @@ type AnyEncryptedV3Column = EncryptedIntegerColumn | EncryptedIntegerEqColumn |
494
577
  type EncryptedV3TableColumn = {
495
578
  [key: string]: AnyEncryptedV3Column;
496
579
  };
580
+ /** A JSON value at any depth. Used for the values NESTED inside a document. */
581
+ type JsonValue = string | number | boolean | null | JsonValue[] | {
582
+ [key: string]: JsonValue;
583
+ };
584
+ /**
585
+ * The plaintext a `public.eql_v3_json` column encrypts and reconstructs: a JSON
586
+ * DOCUMENT — an object, an array, or `null`. NOT a bare top-level scalar:
587
+ * protect-ffi's `json` cast rejects a top-level string/number/boolean
588
+ * ("Cannot convert … to Json"), because a scalar belongs in a scalar domain
589
+ * (`types.TextEq`, `types.IntegerEq`, …). Nested scalars are ordinary
590
+ * {@link JsonValue}s and are fully supported.
591
+ */
592
+ type JsonDocument = null | JsonValue[] | {
593
+ [key: string]: JsonValue;
594
+ };
497
595
  /** Map a domain's {@link PlaintextKind} to its TypeScript plaintext type. */
498
- type PlaintextFromKind<K extends PlaintextKind> = K extends 'string' ? string : K extends 'number' ? number : K extends 'boolean' ? boolean : K extends 'date' | 'timestamp' ? Date : never;
596
+ type PlaintextFromKind<K extends PlaintextKind> = K extends 'string' ? string : K extends 'number' ? number : K extends 'bigint' ? bigint : K extends 'boolean' ? boolean : K extends DateLikeCast ? Date : K extends 'json' ? JsonDocument : never;
499
597
  /**
500
598
  * The plaintext type for a single v3 column, read from the literal domain
501
599
  * definition carried on the base class's private field. This is stable across
@@ -508,9 +606,9 @@ type PlaintextForColumn<C> = C extends EncryptedV3Column<infer D> ? PlaintextFro
508
606
  * The user-facing `queryType` names a v3 column supports, derived 1:1 from its
509
607
  * capability flags. Resolves to `never` for a storage-only column (all flags
510
608
  * `false`) and for any non-v3 value. The names mirror the {@link QueryCapabilities}
511
- * keys and the first three {@link import('@/types').QueryTypeName} members.
609
+ * keys, each of which is also a {@link import('@/types').QueryTypeName} member.
512
610
  */
513
- type QueryTypesForColumn<C> = C extends EncryptedV3Column<infer D> ? (D['capabilities']['equality'] extends true ? 'equality' : never) | (D['capabilities']['orderAndRange'] extends true ? 'orderAndRange' : never) | (D['capabilities']['freeTextSearch'] extends true ? 'freeTextSearch' : never) : never;
611
+ type QueryTypesForColumn<C> = C extends EncryptedV3Column<infer D> ? (D['capabilities']['equality'] extends true ? 'equality' : never) | (D['capabilities']['orderAndRange'] extends true ? 'orderAndRange' : never) | (D['capabilities']['freeTextSearch'] extends true ? 'freeTextSearch' : never) | (D['capabilities']['searchableJson'] extends true ? 'searchableJson' : never) : never;
514
612
  /**
515
613
  * The concrete EQL v3 type string for a single column, read from the literal
516
614
  * domain definition carried on the base class's private field (mirrors
@@ -521,83 +619,4 @@ type QueryTypesForColumn<C> = C extends EncryptedV3Column<infer D> ? (D['capabil
521
619
  */
522
620
  type EqlTypeForColumn<C> = C extends EncryptedV3Column<infer D> ? D['eqlType'] : never;
523
621
 
524
- interface TableDefinition {
525
- tableName: string;
526
- columns: Record<string, ColumnSchema>;
527
- }
528
- /**
529
- * A v3 encrypted table. Mirrors the v2 `EncryptedTable` but only accepts v3
530
- * column builders. Emits the same `{ tableName, columns }` definition shape.
531
- */
532
- declare class EncryptedTable<T extends EncryptedV3TableColumn> {
533
- readonly tableName: string;
534
- readonly columnBuilders: T;
535
- /** @internal Type-level brand so TypeScript can infer `T` from `EncryptedTable<T>`. */
536
- readonly _columnType: T;
537
- constructor(tableName: string, columnBuilders: T);
538
- build(): TableDefinition;
539
- /**
540
- * Map each column's JS property name to its DB column name (`getName()`).
541
- * The model path matches user models by property name but must address the
542
- * encrypt config and FFI by DB name — `build()` keys columns by DB name, so
543
- * the two only agree when property == name. This recovers the mapping that
544
- * `build()` discards.
545
- */
546
- buildColumnKeyMap(): Record<string, string>;
547
- }
548
- /**
549
- * Define a v3 encrypted table. Intentionally shadows the v2 `encryptedTable`
550
- * name but lives on the `/eql/v3` subpath — the importer picks the model by
551
- * import path. The returned object is also a column accessor (`users.email`).
552
- */
553
- declare function encryptedTable<T extends EncryptedV3TableColumn>(tableName: string, columns: T): EncryptedTable<T> & T;
554
- /**
555
- * Build an `EncryptConfig` (`v: 1`) from one or more v3 tables. Emits the same
556
- * shape as v2's `buildEncryptConfig`.
557
- */
558
- declare function buildEncryptConfig(...tables: Array<EncryptedTable<EncryptedV3TableColumn>>): EncryptConfig;
559
- /**
560
- * Infer the plaintext (decrypted) shape from a v3 table schema. Each column maps
561
- * to the TypeScript type of its domain's `castAs` kind.
562
- */
563
- type InferPlaintext<T extends EncryptedTable<EncryptedV3TableColumn>> = T extends EncryptedTable<infer C> ? {
564
- [K in keyof C]: PlaintextForColumn<C[K]>;
565
- } : never;
566
- /**
567
- * Infer the encrypted shape from a v3 table schema. See {@link InferPlaintext}
568
- * for why no key-remap filter is needed in the flat single-type model.
569
- */
570
- type InferEncrypted<T extends EncryptedTable<EncryptedV3TableColumn>> = T extends EncryptedTable<infer C> ? {
571
- [K in keyof C]: Encrypted;
572
- } : never;
573
- /** Any v3 table, regardless of its column map. */
574
- type AnyV3Table = EncryptedTable<EncryptedV3TableColumn>;
575
- /** Union of the concrete column builders declared on a v3 table. */
576
- type ColumnsOf<T extends AnyV3Table> = T extends EncryptedTable<infer C> ? C[keyof C] : never;
577
- /**
578
- * Union of the *queryable* column builders on a v3 table. Storage-only columns
579
- * (whose {@link QueryTypesForColumn} is `never`) are filtered out, so they can't
580
- * be passed to a query method.
581
- */
582
- type QueryableColumnsOf<T extends AnyV3Table> = T extends EncryptedTable<infer C> ? {
583
- [K in keyof C]: [QueryTypesForColumn<C[K]>] extends [never] ? never : C[K];
584
- }[keyof C] : never;
585
- /**
586
- * The accepted input model for {@link import('@/encryption/v3').TypedEncryptionClient.encryptModel}.
587
- * `T` is inferred from the argument: keys that name a schema column are pinned to
588
- * the column's plaintext type (nullable if the field is nullable), so a wrong-typed
589
- * field fails assignability; all other keys pass through unchanged.
590
- */
591
- type V3ModelInput<Table extends AnyV3Table, T> = {
592
- [K in keyof T]: K extends keyof InferPlaintext<Table> ? null extends T[K] ? InferPlaintext<Table>[K] | null : InferPlaintext<Table>[K] : T[K];
593
- };
594
- /** The encrypted result model: schema columns become `Encrypted`, others pass through. */
595
- type V3EncryptedModel<Table extends AnyV3Table, T> = {
596
- [K in keyof T]: K extends keyof InferPlaintext<Table> ? null extends T[K] ? Encrypted | null : Encrypted : T[K];
597
- };
598
- /** The decrypted result model: schema columns become their plaintext type, others pass through. */
599
- type V3DecryptedModel<Table extends AnyV3Table, T> = {
600
- [K in keyof T]: K extends keyof InferPlaintext<Table> ? null extends T[K] ? InferPlaintext<Table>[K] | null : InferPlaintext<Table>[K] : T[K];
601
- };
602
-
603
- export { type AnyV3Table as A, EncryptedSmallintOrdColumn as B, type ColumnsOf as C, EncryptedSmallintOrdOreColumn as D, EncryptedBooleanColumn as E, EncryptedTable as F, EncryptedTextColumn as G, EncryptedTextEqColumn as H, EncryptedTextMatchColumn as I, EncryptedTextOrdColumn as J, EncryptedTextOrdOreColumn as K, EncryptedTextSearchColumn as L, EncryptedTimestampColumn as M, EncryptedTimestampEqColumn as N, EncryptedTimestampOrdColumn as O, type PlaintextForColumn as P, type QueryableColumnsOf as Q, EncryptedTimestampOrdOreColumn as R, type EncryptedV3TableColumn as S, type EqlTypeForColumn as T, type InferEncrypted as U, type V3ModelInput as V, type InferPlaintext as W, type QueryCapabilities as X, TEXT_SEARCH_EQL_TYPE as Y, buildEncryptConfig as Z, encryptedTable as _, type QueryTypesForColumn as a, type V3EncryptedModel as b, type V3DecryptedModel as c, type AnyEncryptedV3Column as d, EncryptedDateColumn as e, EncryptedDateEqColumn as f, EncryptedDateOrdColumn as g, EncryptedDateOrdOreColumn as h, EncryptedDoubleColumn as i, EncryptedDoubleEqColumn as j, EncryptedDoubleOrdColumn as k, EncryptedDoubleOrdOreColumn as l, EncryptedIntegerColumn as m, EncryptedIntegerEqColumn as n, EncryptedIntegerOrdColumn as o, EncryptedIntegerOrdOreColumn as p, EncryptedNumericColumn as q, EncryptedNumericEqColumn as r, EncryptedNumericOrdColumn as s, EncryptedNumericOrdOreColumn as t, EncryptedRealColumn as u, EncryptedRealEqColumn as v, EncryptedRealOrdColumn as w, EncryptedRealOrdOreColumn as x, EncryptedSmallintColumn as y, EncryptedSmallintEqColumn as z };
622
+ export { type AnyEncryptedV3Column as A, EncryptedSmallintEqColumn as B, EncryptedSmallintOrdColumn as C, DATE_LIKE_CASTS as D, EncryptedBigintColumn as E, EncryptedSmallintOrdOreColumn as F, EncryptedTextColumn as G, EncryptedTextEqColumn as H, EncryptedTextMatchColumn as I, EncryptedTextOrdColumn as J, EncryptedTextOrdOreColumn as K, EncryptedTextSearchColumn as L, EncryptedTimestampColumn as M, EncryptedTimestampEqColumn as N, EncryptedTimestampOrdColumn as O, EncryptedTimestampOrdOreColumn as P, EncryptedV3Column as Q, type EncryptedV3TableColumn as R, type EqlTypeForColumn as S, type JsonDocument as T, type JsonValue as U, type PlaintextForColumn as V, type QueryCapabilities as W, type QueryTypesForColumn as X, TEXT_SEARCH_EQL_TYPE as Y, type V3ColumnFactory as Z, EncryptedBigintEqColumn as a, EncryptedBigintOrdColumn as b, EncryptedBigintOrdOreColumn as c, EncryptedBooleanColumn as d, EncryptedDateColumn as e, EncryptedDateEqColumn as f, EncryptedDateOrdColumn as g, EncryptedDateOrdOreColumn as h, EncryptedDoubleColumn as i, EncryptedDoubleEqColumn as j, EncryptedDoubleOrdColumn as k, EncryptedDoubleOrdOreColumn as l, EncryptedIntegerColumn as m, EncryptedIntegerEqColumn as n, EncryptedIntegerOrdColumn as o, EncryptedIntegerOrdOreColumn as p, EncryptedJsonColumn as q, EncryptedNumericColumn as r, EncryptedNumericEqColumn as s, EncryptedNumericOrdColumn as t, EncryptedNumericOrdOreColumn as u, EncryptedRealColumn as v, EncryptedRealEqColumn as w, EncryptedRealOrdColumn as x, EncryptedRealOrdOreColumn as y, EncryptedSmallintColumn as z };
@@ -1,9 +1,10 @@
1
1
  import { Result } from '@byteslice/result';
2
- import { e as EncryptionClient } from '../client-DSGHBN-g.cjs';
3
- import { g as EncryptedTable, h as EncryptedTableColumn, D as Decrypted, m as EncryptedValue } from '../types-public-CpS5KjwX.cjs';
2
+ import { EncryptionClient } from '../encryption/index.cjs';
3
+ import { z as EncryptedTable, A as EncryptedTableColumn, D as Decrypted, F as EncryptedValue } from '../types-public-QMjYNfQO.cjs';
4
4
  import { ProtectErrorCode } from '@cipherstash/protect-ffi';
5
5
  import '../errors/index.cjs';
6
6
  import '../identity/index.cjs';
7
+ import '../base-operation-AOAIvsSB.cjs';
7
8
  import 'zod';
8
9
 
9
10
  type AuditConfig = {
@@ -1,9 +1,10 @@
1
1
  import { Result } from '@byteslice/result';
2
- import { e as EncryptionClient } from '../client-DfCrlHXh.js';
3
- import { g as EncryptedTable, h as EncryptedTableColumn, D as Decrypted, m as EncryptedValue } from '../types-public-CpS5KjwX.js';
2
+ import { EncryptionClient } from '../encryption/index.js';
3
+ import { z as EncryptedTable, A as EncryptedTableColumn, D as Decrypted, F as EncryptedValue } from '../types-public-QMjYNfQO.js';
4
4
  import { ProtectErrorCode } from '@cipherstash/protect-ffi';
5
5
  import '../errors/index.js';
6
6
  import '../identity/index.js';
7
+ import '../base-operation-FXEzUXIq.js';
7
8
  import 'zod';
8
9
 
9
10
  type AuditConfig = {