@cipherstash/stack 0.18.0 → 0.19.0
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 +173 -0
- package/README.md +2 -2
- package/dist/{chunk-ZYOZHZMJ.js → chunk-36AA7IBJ.js} +151 -160
- package/dist/chunk-36AA7IBJ.js.map +1 -0
- package/dist/{chunk-VPOTNP4K.js → chunk-4AVL4VZD.js} +1 -1
- package/dist/chunk-4AVL4VZD.js.map +1 -0
- package/dist/{chunk-XWPGAHBZ.js → chunk-BNO32ZMV.js} +1 -1
- package/dist/chunk-BNO32ZMV.js.map +1 -0
- package/dist/{chunk-LLCCNKDL.js → chunk-HQANMV7R.js} +3 -3
- package/dist/{chunk-LLCCNKDL.js.map → chunk-HQANMV7R.js.map} +1 -1
- package/dist/chunk-IADZCZEA.js +23 -0
- package/dist/chunk-IADZCZEA.js.map +1 -0
- package/dist/chunk-IBSK6P33.js +209 -0
- package/dist/chunk-IBSK6P33.js.map +1 -0
- package/dist/chunk-JSG2AMDI.js +17 -0
- package/dist/chunk-JSG2AMDI.js.map +1 -0
- package/dist/chunk-MP3SSDNN.js +4439 -0
- package/dist/chunk-MP3SSDNN.js.map +1 -0
- package/dist/chunk-OFQ555AX.js +191 -0
- package/dist/chunk-OFQ555AX.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/chunk-U66S7VIF.js +435 -0
- package/dist/chunk-U66S7VIF.js.map +1 -0
- package/dist/{client-Dt98Rugc.d.cts → client-DSGHBN-g.d.cts} +200 -58
- package/dist/{client-CIsfZ2zg.d.ts → client-DfCrlHXh.d.ts} +200 -58
- package/dist/client.cjs +4101 -43
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/client.js +3 -1
- package/dist/drizzle/index.cjs +4133 -74
- package/dist/drizzle/index.cjs.map +1 -1
- package/dist/drizzle/index.d.cts +33 -33
- package/dist/drizzle/index.d.ts +33 -33
- package/dist/drizzle/index.js +35 -30
- package/dist/drizzle/index.js.map +1 -1
- package/dist/dynamodb/index.cjs +19 -12
- package/dist/dynamodb/index.cjs.map +1 -1
- package/dist/dynamodb/index.d.cts +2 -2
- package/dist/dynamodb/index.d.ts +2 -2
- package/dist/dynamodb/index.js +8 -10
- package/dist/dynamodb/index.js.map +1 -1
- package/dist/encryption/index.cjs +4448 -212
- package/dist/encryption/index.cjs.map +1 -1
- package/dist/encryption/index.d.cts +3 -3
- package/dist/encryption/index.d.ts +3 -3
- package/dist/encryption/index.js +15 -7
- package/dist/encryption/v3.cjs +7791 -0
- package/dist/encryption/v3.cjs.map +1 -0
- package/dist/encryption/v3.d.cts +100 -0
- package/dist/encryption/v3.d.ts +100 -0
- package/dist/encryption/v3.js +161 -0
- package/dist/encryption/v3.js.map +1 -0
- package/dist/eql/v3/index.cjs +612 -0
- package/dist/eql/v3/index.cjs.map +1 -0
- package/dist/eql/v3/index.d.cts +71 -0
- package/dist/eql/v3/index.d.ts +71 -0
- package/dist/eql/v3/index.js +89 -0
- package/dist/eql/v3/index.js.map +1 -0
- package/dist/errors/index.js +1 -0
- package/dist/identity/index.cjs +55 -35
- package/dist/identity/index.cjs.map +1 -1
- package/dist/identity/index.d.cts +54 -30
- package/dist/identity/index.d.ts +54 -30
- package/dist/identity/index.js +9 -177
- package/dist/identity/index.js.map +1 -1
- package/dist/index.cjs +4480 -228
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -7
- package/dist/index.d.ts +18 -7
- package/dist/index.js +20 -5
- package/dist/index.js.map +1 -1
- package/dist/schema/index.cjs +4105 -43
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.cts +1 -1
- package/dist/schema/index.d.ts +1 -1
- package/dist/schema/index.js +3 -1
- package/dist/supabase/index.cjs +4500 -75
- package/dist/supabase/index.cjs.map +1 -1
- package/dist/supabase/index.d.cts +113 -34
- package/dist/supabase/index.d.ts +113 -34
- package/dist/supabase/index.js +350 -32
- package/dist/supabase/index.js.map +1 -1
- package/dist/table-CIH7jZ2h.d.ts +603 -0
- package/dist/table-DihEAlxG.d.cts +603 -0
- package/dist/{types-public-BTxqjmtv.d.ts → types-public-CpS5KjwX.d.cts} +250 -92
- package/dist/{types-public-BTxqjmtv.d.cts → types-public-CpS5KjwX.d.ts} +250 -92
- package/dist/types-public.cjs.map +1 -1
- package/dist/types-public.d.cts +2 -2
- package/dist/types-public.d.ts +2 -2
- package/dist/types-public.js +2 -1
- package/dist/wasm-inline.d.ts +1269 -0
- package/dist/wasm-inline.js +4594 -0
- package/dist/wasm-inline.js.map +1 -0
- package/package.json +54 -4
- package/dist/chunk-VPOTNP4K.js.map +0 -1
- package/dist/chunk-XWPGAHBZ.js.map +0 -1
- package/dist/chunk-YWQXTZ5M.js +0 -383
- package/dist/chunk-YWQXTZ5M.js.map +0 -1
- package/dist/chunk-ZYOZHZMJ.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { JsPlaintext, EncryptedPayload, newClient, EncryptedQuery as EncryptedQuery$1, EncryptedV3Query, AuthStrategy, Encrypted as Encrypted$1 } from '@cipherstash/protect-ffi';
|
|
1
2
|
import { z } from 'zod';
|
|
2
|
-
import { Encrypted as Encrypted$1, newClient, EncryptedQuery as EncryptedQuery$1, JsPlaintext } from '@cipherstash/protect-ffi';
|
|
3
3
|
|
|
4
4
|
/** Brand symbol for nominal typing */
|
|
5
5
|
declare const __brand: unique symbol;
|
|
@@ -11,17 +11,43 @@ type Client = Awaited<ReturnType<typeof newClient>> | undefined;
|
|
|
11
11
|
/** A branded type representing encrypted data. Cannot be accidentally used as plaintext. */
|
|
12
12
|
type EncryptedValue = Brand<Encrypted$1, 'encrypted'>;
|
|
13
13
|
/** Structural type representing encrypted data stored in the database. Always
|
|
14
|
-
* carries a ciphertext.
|
|
14
|
+
* carries a ciphertext. Covers BOTH wire formats: the EQL v2.3 payloads
|
|
15
|
+
* (`k: "ct"` / `k: "sv"`) and the EQL v3 payloads (flat `{v: 3, i, c, …}`
|
|
16
|
+
* scalars and `{v: 3, k: "sv", i, sv}` SteVec documents). Which format
|
|
17
|
+
* `encrypt` produces is selected by the client's
|
|
18
|
+
* {@link ClientConfig.eqlVersion}; `decrypt` accepts both regardless.
|
|
19
|
+
* v3 scalars carry no `k` discriminator, so narrow with `'k' in payload`
|
|
20
|
+
* before reading it. See also `EncryptedValue` for branded nominal typing,
|
|
15
21
|
* and {@link EncryptedQuery} for the search-term shape returned by
|
|
16
22
|
* `encryptQuery`. */
|
|
17
|
-
type Encrypted =
|
|
23
|
+
type Encrypted = EncryptedPayload;
|
|
18
24
|
/** Structural type representing an encrypted query term (search needle)
|
|
19
25
|
* returned by `encryptQuery` / `encryptQueryBulk` for scalar
|
|
20
26
|
* (`unique` / `match` / `ore`) lookups and `ste_vec_selector` JSON path
|
|
21
|
-
* queries
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
|
|
27
|
+
* queries, plus — under `eqlVersion: 3` — the `eql_v3.jsonb_query`
|
|
28
|
+
* containment needle. Carries no ciphertext — matched against stored
|
|
29
|
+
* values, never decrypted. v2 JSON containment queries (`ste_vec_term`)
|
|
30
|
+
* return a storage-shaped {@link Encrypted} payload instead. */
|
|
31
|
+
type EncryptedQuery = EncryptedQuery$1 | EncryptedV3Query;
|
|
32
|
+
/**
|
|
33
|
+
* Plaintext values the SDK accepts for encryption.
|
|
34
|
+
*
|
|
35
|
+
* Widens the FFI's `JsPlaintext` (`string | number | boolean |
|
|
36
|
+
* Record<string, unknown> | JsPlaintext[]`) with `Date`. `Date` is a supported
|
|
37
|
+
* cast target that is omitted from the FFI's `JsPlaintext` INPUT union, but it
|
|
38
|
+
* serializes at the boundary via `toJSON` (ISO string), so it is accepted on the
|
|
39
|
+
* way in.
|
|
40
|
+
*
|
|
41
|
+
* `bigint` is intentionally NOT included: the native `@cipherstash/protect-ffi`
|
|
42
|
+
* build cannot marshal a JS `bigint` (V8 throws "Do not know how to serialize a
|
|
43
|
+
* BigInt") and rejects a `string` for a `big_int` column. The v3 int8 domains
|
|
44
|
+
* are therefore omitted from the SDK entirely (see `eql/v3`) until the FFI
|
|
45
|
+
* supports lossless bigint I/O; `bigint` returns here alongside them.
|
|
46
|
+
*
|
|
47
|
+
* When the upstream FFI `JsPlaintext` is corrected to include `Date`, the `Date`
|
|
48
|
+
* arm can collapse back into `JsPlaintext`.
|
|
49
|
+
*/
|
|
50
|
+
type Plaintext = JsPlaintext | Date;
|
|
25
51
|
type KeysetIdentifier = {
|
|
26
52
|
name: string;
|
|
27
53
|
} | {
|
|
@@ -56,15 +82,146 @@ type ClientConfig = {
|
|
|
56
82
|
* An optional keyset identifier for multi-tenant encryption.
|
|
57
83
|
* Each keyset provides cryptographic isolation, giving each tenant its own keyspace.
|
|
58
84
|
* Specify by name (`{ name: "tenant-a" }`) or UUID (`{ id: "..." }`).
|
|
59
|
-
* Keysets are created and managed in the
|
|
85
|
+
* Keysets are created and managed in the
|
|
86
|
+
* [dashboard](https://dashboard.cipherstash.com/workspaces/_/keysets); omit to
|
|
87
|
+
* use the workspace's default keyset. A client is bound to one keyset for its
|
|
88
|
+
* lifetime, so use one client per tenant.
|
|
89
|
+
*
|
|
90
|
+
* @see {@link Encryption} for the full keysets walkthrough.
|
|
60
91
|
*/
|
|
61
92
|
keyset?: KeysetIdentifier;
|
|
93
|
+
/**
|
|
94
|
+
* An optional authentication strategy for ZeroKMS requests, from
|
|
95
|
+
* `@cipherstash/auth` (re-exported by `@cipherstash/stack`). When provided,
|
|
96
|
+
* its `getToken()` is invoked on every ZeroKMS request and takes precedence
|
|
97
|
+
* over the default `auto` strategy (the `clientKey` is still required for
|
|
98
|
+
* encryption). Use:
|
|
99
|
+
*
|
|
100
|
+
* - `OidcFederationStrategy` for per-user, identity-bound encryption —
|
|
101
|
+
* federates an end user's OIDC JWT into a CTS service token, so requests
|
|
102
|
+
* authenticate as that user. Pair with `.withLockContext({ identityClaim })`
|
|
103
|
+
* to bind the data key to a claim. This replaces the older
|
|
104
|
+
* `LockContext.identify()` ceremony.
|
|
105
|
+
* - `AccessKeyStrategy` for service-to-service / CI, or any custom
|
|
106
|
+
* `{ getToken() }` object for bespoke token acquisition / caching.
|
|
107
|
+
*
|
|
108
|
+
* Leave unset to use the default `auto` strategy, which reads credentials
|
|
109
|
+
* from the `CS_*` environment variables and falls back to the local dev
|
|
110
|
+
* profile created by `npx stash auth login`.
|
|
111
|
+
*
|
|
112
|
+
* @see {@link AuthStrategy}
|
|
113
|
+
* @see {@link Encryption} for a full walkthrough of the authentication options.
|
|
114
|
+
*/
|
|
115
|
+
authStrategy?: AuthStrategy;
|
|
116
|
+
/**
|
|
117
|
+
* @deprecated Renamed to {@link ClientConfig.authStrategy}. Still honoured for
|
|
118
|
+
* backwards compatibility — passing it logs a deprecation warning at runtime —
|
|
119
|
+
* but it will be removed in a future release. Set `authStrategy` instead.
|
|
120
|
+
*/
|
|
121
|
+
strategy?: AuthStrategy;
|
|
122
|
+
/**
|
|
123
|
+
* The EQL wire version the client emits — one FFI client always emits
|
|
124
|
+
* exactly one wire format.
|
|
125
|
+
*
|
|
126
|
+
* - `2` (the protect-ffi default): payloads target the
|
|
127
|
+
* `eql_v2_encrypted` column type.
|
|
128
|
+
* - `3`: payloads target the per-capability `eql_v3` domains
|
|
129
|
+
* (`eql_v3.text_eq`, `eql_v3.integer_ord_ore`, `eql_v3.json`, …),
|
|
130
|
+
* derived from each column's `cast_as` and indexes.
|
|
131
|
+
*
|
|
132
|
+
* When omitted, {@link Encryption} auto-detects from the schema set:
|
|
133
|
+
* EQL v3 tables (from `@cipherstash/stack/v3`, marked by
|
|
134
|
+
* `buildColumnKeyMap()`) select `3`; v2 tables leave the FFI default
|
|
135
|
+
* (`2`) untouched. Mixing v2 and v3 tables in one client is an error —
|
|
136
|
+
* split them across two clients instead.
|
|
137
|
+
*
|
|
138
|
+
* `decrypt` accepts BOTH formats regardless of this setting, so v2 and
|
|
139
|
+
* v3 data can coexist during a migration.
|
|
140
|
+
*
|
|
141
|
+
* v3 limitation (protect-ffi 0.27): `encryptQuery` supports only JSON
|
|
142
|
+
* containment queries — scalar-index and selector queries throw
|
|
143
|
+
* `EQL_V3_QUERY_UNSUPPORTED` until a v3 scalar query wire shape exists.
|
|
144
|
+
*/
|
|
145
|
+
eqlVersion?: 2 | 3;
|
|
62
146
|
};
|
|
63
147
|
type AtLeastOneCsTable<T> = [T, ...T[]];
|
|
148
|
+
/** Structural contract for a column builder the client can consume for STORAGE
|
|
149
|
+
* (`encrypt`). Satisfied by v2 `EncryptedColumn` / `EncryptedField` AND v3
|
|
150
|
+
* `EncryptedTextSearchColumn` — fields ARE encryptable, so this stays wide. */
|
|
151
|
+
interface BuildableColumn {
|
|
152
|
+
getName(): string;
|
|
153
|
+
build(): ColumnSchema;
|
|
154
|
+
}
|
|
155
|
+
/** Structural contract for a column the client can consume for QUERIES
|
|
156
|
+
* (`encryptQuery` / search terms). Narrower than `BuildableColumn`: it must
|
|
157
|
+
* EXCLUDE non-queryable `EncryptedField` (a field has no indexes). A v2
|
|
158
|
+
* `EncryptedColumn` qualifies via the nominal arm; a v3 queryable concrete
|
|
159
|
+
* type qualifies via the `getEqlType()` structural arm; `EncryptedField` (no
|
|
160
|
+
* `getEqlType`, not an `EncryptedColumn`) is rejected. */
|
|
161
|
+
interface BuildableV3QueryableColumn extends BuildableColumn {
|
|
162
|
+
getEqlType(): string;
|
|
163
|
+
getQueryCapabilities(): {
|
|
164
|
+
equality: boolean;
|
|
165
|
+
orderAndRange: boolean;
|
|
166
|
+
freeTextSearch: boolean;
|
|
167
|
+
};
|
|
168
|
+
isQueryable(): true;
|
|
169
|
+
}
|
|
170
|
+
type BuildableQueryColumn = EncryptedColumn | BuildableV3QueryableColumn;
|
|
171
|
+
/** Structural contract for a table builder the client can consume. Satisfied by
|
|
172
|
+
* v2 and v3 `EncryptedTable` alike. */
|
|
173
|
+
interface BuildableTable {
|
|
174
|
+
tableName: string;
|
|
175
|
+
build(): {
|
|
176
|
+
tableName: string;
|
|
177
|
+
columns: Record<string, ColumnSchema>;
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* Optional map from a model field's JS property name to its encrypt-config
|
|
181
|
+
* column name (the DB name). Present when the two can differ — v3 tables key
|
|
182
|
+
* their config by DB name (`column.getName()`) while models are written with
|
|
183
|
+
* JS property keys, so the model path must match by property but address the
|
|
184
|
+
* FFI/config by DB name.
|
|
185
|
+
*
|
|
186
|
+
* Absent on v2 tables, whose `build()` already keys columns by the JS property
|
|
187
|
+
* name; the model path then matches and addresses by that same key.
|
|
188
|
+
*/
|
|
189
|
+
buildColumnKeyMap?(): Record<string, string>;
|
|
190
|
+
}
|
|
64
191
|
type EncryptionClientConfig = {
|
|
65
|
-
schemas: AtLeastOneCsTable<
|
|
192
|
+
schemas: AtLeastOneCsTable<BuildableTable>;
|
|
66
193
|
config?: ClientConfig;
|
|
67
194
|
};
|
|
195
|
+
/**
|
|
196
|
+
* The literal column map of a buildable table, read from its type-level
|
|
197
|
+
* `_columnType` brand. Both v2 and v3 `EncryptedTable` carry this brand, so this
|
|
198
|
+
* recovers the literal column keys structurally.
|
|
199
|
+
*
|
|
200
|
+
* This deliberately uses the `_columnType` brand rather than `build().columns`:
|
|
201
|
+
* `BuildableTable.build()` is typed to return `Record<string, ColumnSchema>`,
|
|
202
|
+
* which erases the literal keys and would mark EVERY model field as encrypted.
|
|
203
|
+
*
|
|
204
|
+
* The fallbacks resolve to `Record<never, never>` (a no-key type), NOT `never`:
|
|
205
|
+
* a value typed as the bare structural `BuildableTable` carries no `_columnType`
|
|
206
|
+
* brand, and `keyof never` is `string | number | symbol` — which would wrongly
|
|
207
|
+
* mark EVERY model field as encrypted. `keyof Record<never, never>` is `never`,
|
|
208
|
+
* so `EncryptedFromBuildableTable` degrades gracefully to the model unchanged.
|
|
209
|
+
*/
|
|
210
|
+
type BuildableTableColumns<T extends BuildableTable> = T extends {
|
|
211
|
+
readonly _columnType: infer C;
|
|
212
|
+
} ? C extends Record<string, unknown> ? C : Record<never, never> : Record<never, never>;
|
|
213
|
+
/**
|
|
214
|
+
* Maps a plaintext model type to its encrypted form using a buildable table.
|
|
215
|
+
*
|
|
216
|
+
* Fields whose keys match a column defined in `Table` (via its `_columnType`
|
|
217
|
+
* brand) become `Encrypted` (`Encrypted | null` when the source field is
|
|
218
|
+
* nullable); all other fields retain their original types from `T`. Works for
|
|
219
|
+
* both v2 and v3 tables. See {@link EncryptedFromSchema} for the v2-specific
|
|
220
|
+
* variant retained for backward compatibility.
|
|
221
|
+
*/
|
|
222
|
+
type EncryptedFromBuildableTable<T, Table extends BuildableTable> = {
|
|
223
|
+
[K in keyof T]: [K] extends [keyof BuildableTableColumns<Table>] ? null extends T[K] ? Encrypted | null : Encrypted : T[K];
|
|
224
|
+
};
|
|
68
225
|
/**
|
|
69
226
|
* Options for single-value encrypt operations.
|
|
70
227
|
* Use a column from your table schema (from {@link encryptedColumn}) or a nested
|
|
@@ -72,15 +229,15 @@ type EncryptionClientConfig = {
|
|
|
72
229
|
*/
|
|
73
230
|
type EncryptOptions = {
|
|
74
231
|
/** The column or nested field to encrypt into. From {@link EncryptedColumn} or {@link EncryptedField}. */
|
|
75
|
-
column:
|
|
76
|
-
table:
|
|
232
|
+
column: BuildableColumn;
|
|
233
|
+
table: BuildableTable;
|
|
77
234
|
};
|
|
78
235
|
/** Format for encrypted query/search term return values */
|
|
79
236
|
type EncryptedReturnType = 'eql' | 'composite-literal' | 'escaped-composite-literal';
|
|
80
237
|
type SearchTerm = {
|
|
81
|
-
value:
|
|
82
|
-
column:
|
|
83
|
-
table:
|
|
238
|
+
value: Plaintext;
|
|
239
|
+
column: BuildableQueryColumn;
|
|
240
|
+
table: BuildableTable;
|
|
84
241
|
returnType?: EncryptedReturnType;
|
|
85
242
|
};
|
|
86
243
|
/** Encrypted search term result. `eql` return type yields either a storage
|
|
@@ -129,7 +286,7 @@ type EncryptedFromSchema<T, S extends EncryptedTableColumn> = {
|
|
|
129
286
|
};
|
|
130
287
|
type BulkEncryptPayload = Array<{
|
|
131
288
|
id?: string;
|
|
132
|
-
plaintext:
|
|
289
|
+
plaintext: Plaintext | null;
|
|
133
290
|
}>;
|
|
134
291
|
type BulkEncryptedData = Array<{
|
|
135
292
|
id?: string;
|
|
@@ -177,14 +334,14 @@ declare const queryTypes: {
|
|
|
177
334
|
};
|
|
178
335
|
/** @internal */
|
|
179
336
|
type QueryTermBase = {
|
|
180
|
-
column:
|
|
181
|
-
table:
|
|
337
|
+
column: BuildableQueryColumn;
|
|
338
|
+
table: BuildableTable;
|
|
182
339
|
queryType?: QueryTypeName;
|
|
183
340
|
returnType?: EncryptedReturnType;
|
|
184
341
|
};
|
|
185
342
|
type EncryptQueryOptions = QueryTermBase;
|
|
186
343
|
type ScalarQueryTerm = QueryTermBase & {
|
|
187
|
-
value:
|
|
344
|
+
value: Plaintext;
|
|
188
345
|
};
|
|
189
346
|
|
|
190
347
|
/**
|
|
@@ -194,6 +351,7 @@ type ScalarQueryTerm = QueryTermBase & {
|
|
|
194
351
|
* - `"bigint"`
|
|
195
352
|
* - `"boolean"`
|
|
196
353
|
* - `"date"`
|
|
354
|
+
* - `"timestamp"`
|
|
197
355
|
* - `"number"`
|
|
198
356
|
* - `"string"`
|
|
199
357
|
* - `"json"`
|
|
@@ -209,11 +367,11 @@ type ScalarQueryTerm = QueryTermBase & {
|
|
|
209
367
|
* EQL cast types — the PostgreSQL-aligned types that EQL actually accepts.
|
|
210
368
|
* These are stored in the `cast_as` field of the EncryptConfig.
|
|
211
369
|
*/
|
|
212
|
-
declare const eqlCastAsEnum: z.ZodDefault<z.ZodEnum<["text", "int", "small_int", "big_int", "real", "double", "boolean", "date", "jsonb"]>>;
|
|
370
|
+
declare const eqlCastAsEnum: z.ZodDefault<z.ZodEnum<["text", "int", "small_int", "big_int", "real", "double", "boolean", "date", "timestamp", "jsonb"]>>;
|
|
213
371
|
/**
|
|
214
372
|
* SDK-facing data types — developer-friendly aliases accepted by `dataType()`.
|
|
215
373
|
*/
|
|
216
|
-
declare const castAsEnum: z.ZodDefault<z.ZodEnum<["bigint", "boolean", "date", "number", "string", "json", "text"]>>;
|
|
374
|
+
declare const castAsEnum: z.ZodDefault<z.ZodEnum<["bigint", "boolean", "date", "timestamp", "number", "string", "json", "text"]>>;
|
|
217
375
|
/**
|
|
218
376
|
* Map SDK-facing data types to EQL `cast_as` values.
|
|
219
377
|
*
|
|
@@ -331,7 +489,7 @@ declare const steVecIndexOptsSchema: z.ZodObject<{
|
|
|
331
489
|
} | undefined;
|
|
332
490
|
}>;
|
|
333
491
|
declare const columnSchema: z.ZodDefault<z.ZodObject<{
|
|
334
|
-
cast_as: z.ZodDefault<z.ZodEnum<["bigint", "boolean", "date", "number", "string", "json", "text"]>>;
|
|
492
|
+
cast_as: z.ZodDefault<z.ZodEnum<["bigint", "boolean", "date", "timestamp", "number", "string", "json", "text"]>>;
|
|
335
493
|
indexes: z.ZodDefault<z.ZodObject<{
|
|
336
494
|
ore: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
337
495
|
unique: z.ZodOptional<z.ZodObject<{
|
|
@@ -436,12 +594,6 @@ declare const columnSchema: z.ZodDefault<z.ZodObject<{
|
|
|
436
594
|
} | undefined;
|
|
437
595
|
}>>;
|
|
438
596
|
}, "strip", z.ZodTypeAny, {
|
|
439
|
-
ore?: {} | undefined;
|
|
440
|
-
unique?: {
|
|
441
|
-
token_filters?: {
|
|
442
|
-
kind: "downcase";
|
|
443
|
-
}[] | undefined;
|
|
444
|
-
} | undefined;
|
|
445
597
|
match?: {
|
|
446
598
|
token_filters?: {
|
|
447
599
|
kind: "downcase";
|
|
@@ -456,6 +608,12 @@ declare const columnSchema: z.ZodDefault<z.ZodObject<{
|
|
|
456
608
|
m?: number | undefined;
|
|
457
609
|
include_original?: boolean | undefined;
|
|
458
610
|
} | undefined;
|
|
611
|
+
ore?: {} | undefined;
|
|
612
|
+
unique?: {
|
|
613
|
+
token_filters?: {
|
|
614
|
+
kind: "downcase";
|
|
615
|
+
}[] | undefined;
|
|
616
|
+
} | undefined;
|
|
459
617
|
ste_vec?: {
|
|
460
618
|
prefix: string;
|
|
461
619
|
array_index_mode?: "all" | "none" | {
|
|
@@ -465,12 +623,6 @@ declare const columnSchema: z.ZodDefault<z.ZodObject<{
|
|
|
465
623
|
} | undefined;
|
|
466
624
|
} | undefined;
|
|
467
625
|
}, {
|
|
468
|
-
ore?: {} | undefined;
|
|
469
|
-
unique?: {
|
|
470
|
-
token_filters?: {
|
|
471
|
-
kind: "downcase";
|
|
472
|
-
}[] | undefined;
|
|
473
|
-
} | undefined;
|
|
474
626
|
match?: {
|
|
475
627
|
token_filters?: {
|
|
476
628
|
kind: "downcase";
|
|
@@ -485,6 +637,12 @@ declare const columnSchema: z.ZodDefault<z.ZodObject<{
|
|
|
485
637
|
m?: number | undefined;
|
|
486
638
|
include_original?: boolean | undefined;
|
|
487
639
|
} | undefined;
|
|
640
|
+
ore?: {} | undefined;
|
|
641
|
+
unique?: {
|
|
642
|
+
token_filters?: {
|
|
643
|
+
kind: "downcase";
|
|
644
|
+
}[] | undefined;
|
|
645
|
+
} | undefined;
|
|
488
646
|
ste_vec?: {
|
|
489
647
|
prefix: string;
|
|
490
648
|
array_index_mode?: "all" | "none" | {
|
|
@@ -495,14 +653,8 @@ declare const columnSchema: z.ZodDefault<z.ZodObject<{
|
|
|
495
653
|
} | undefined;
|
|
496
654
|
}>>;
|
|
497
655
|
}, "strip", z.ZodTypeAny, {
|
|
498
|
-
cast_as: "string" | "number" | "bigint" | "boolean" | "date" | "json" | "text";
|
|
656
|
+
cast_as: "string" | "number" | "bigint" | "boolean" | "date" | "timestamp" | "json" | "text";
|
|
499
657
|
indexes: {
|
|
500
|
-
ore?: {} | undefined;
|
|
501
|
-
unique?: {
|
|
502
|
-
token_filters?: {
|
|
503
|
-
kind: "downcase";
|
|
504
|
-
}[] | undefined;
|
|
505
|
-
} | undefined;
|
|
506
658
|
match?: {
|
|
507
659
|
token_filters?: {
|
|
508
660
|
kind: "downcase";
|
|
@@ -517,6 +669,12 @@ declare const columnSchema: z.ZodDefault<z.ZodObject<{
|
|
|
517
669
|
m?: number | undefined;
|
|
518
670
|
include_original?: boolean | undefined;
|
|
519
671
|
} | undefined;
|
|
672
|
+
ore?: {} | undefined;
|
|
673
|
+
unique?: {
|
|
674
|
+
token_filters?: {
|
|
675
|
+
kind: "downcase";
|
|
676
|
+
}[] | undefined;
|
|
677
|
+
} | undefined;
|
|
520
678
|
ste_vec?: {
|
|
521
679
|
prefix: string;
|
|
522
680
|
array_index_mode?: "all" | "none" | {
|
|
@@ -527,14 +685,8 @@ declare const columnSchema: z.ZodDefault<z.ZodObject<{
|
|
|
527
685
|
} | undefined;
|
|
528
686
|
};
|
|
529
687
|
}, {
|
|
530
|
-
cast_as?: "string" | "number" | "bigint" | "boolean" | "date" | "json" | "text" | undefined;
|
|
688
|
+
cast_as?: "string" | "number" | "bigint" | "boolean" | "date" | "timestamp" | "json" | "text" | undefined;
|
|
531
689
|
indexes?: {
|
|
532
|
-
ore?: {} | undefined;
|
|
533
|
-
unique?: {
|
|
534
|
-
token_filters?: {
|
|
535
|
-
kind: "downcase";
|
|
536
|
-
}[] | undefined;
|
|
537
|
-
} | undefined;
|
|
538
690
|
match?: {
|
|
539
691
|
token_filters?: {
|
|
540
692
|
kind: "downcase";
|
|
@@ -549,6 +701,12 @@ declare const columnSchema: z.ZodDefault<z.ZodObject<{
|
|
|
549
701
|
m?: number | undefined;
|
|
550
702
|
include_original?: boolean | undefined;
|
|
551
703
|
} | undefined;
|
|
704
|
+
ore?: {} | undefined;
|
|
705
|
+
unique?: {
|
|
706
|
+
token_filters?: {
|
|
707
|
+
kind: "downcase";
|
|
708
|
+
}[] | undefined;
|
|
709
|
+
} | undefined;
|
|
552
710
|
ste_vec?: {
|
|
553
711
|
prefix: string;
|
|
554
712
|
array_index_mode?: "all" | "none" | {
|
|
@@ -563,7 +721,7 @@ declare const columnSchema: z.ZodDefault<z.ZodObject<{
|
|
|
563
721
|
declare const encryptConfigSchema: z.ZodObject<{
|
|
564
722
|
v: z.ZodNumber;
|
|
565
723
|
tables: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodObject<{
|
|
566
|
-
cast_as: z.ZodDefault<z.ZodEnum<["bigint", "boolean", "date", "number", "string", "json", "text"]>>;
|
|
724
|
+
cast_as: z.ZodDefault<z.ZodEnum<["bigint", "boolean", "date", "timestamp", "number", "string", "json", "text"]>>;
|
|
567
725
|
indexes: z.ZodDefault<z.ZodObject<{
|
|
568
726
|
ore: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
569
727
|
unique: z.ZodOptional<z.ZodObject<{
|
|
@@ -668,12 +826,6 @@ declare const encryptConfigSchema: z.ZodObject<{
|
|
|
668
826
|
} | undefined;
|
|
669
827
|
}>>;
|
|
670
828
|
}, "strip", z.ZodTypeAny, {
|
|
671
|
-
ore?: {} | undefined;
|
|
672
|
-
unique?: {
|
|
673
|
-
token_filters?: {
|
|
674
|
-
kind: "downcase";
|
|
675
|
-
}[] | undefined;
|
|
676
|
-
} | undefined;
|
|
677
829
|
match?: {
|
|
678
830
|
token_filters?: {
|
|
679
831
|
kind: "downcase";
|
|
@@ -688,6 +840,12 @@ declare const encryptConfigSchema: z.ZodObject<{
|
|
|
688
840
|
m?: number | undefined;
|
|
689
841
|
include_original?: boolean | undefined;
|
|
690
842
|
} | undefined;
|
|
843
|
+
ore?: {} | undefined;
|
|
844
|
+
unique?: {
|
|
845
|
+
token_filters?: {
|
|
846
|
+
kind: "downcase";
|
|
847
|
+
}[] | undefined;
|
|
848
|
+
} | undefined;
|
|
691
849
|
ste_vec?: {
|
|
692
850
|
prefix: string;
|
|
693
851
|
array_index_mode?: "all" | "none" | {
|
|
@@ -697,12 +855,6 @@ declare const encryptConfigSchema: z.ZodObject<{
|
|
|
697
855
|
} | undefined;
|
|
698
856
|
} | undefined;
|
|
699
857
|
}, {
|
|
700
|
-
ore?: {} | undefined;
|
|
701
|
-
unique?: {
|
|
702
|
-
token_filters?: {
|
|
703
|
-
kind: "downcase";
|
|
704
|
-
}[] | undefined;
|
|
705
|
-
} | undefined;
|
|
706
858
|
match?: {
|
|
707
859
|
token_filters?: {
|
|
708
860
|
kind: "downcase";
|
|
@@ -717,6 +869,12 @@ declare const encryptConfigSchema: z.ZodObject<{
|
|
|
717
869
|
m?: number | undefined;
|
|
718
870
|
include_original?: boolean | undefined;
|
|
719
871
|
} | undefined;
|
|
872
|
+
ore?: {} | undefined;
|
|
873
|
+
unique?: {
|
|
874
|
+
token_filters?: {
|
|
875
|
+
kind: "downcase";
|
|
876
|
+
}[] | undefined;
|
|
877
|
+
} | undefined;
|
|
720
878
|
ste_vec?: {
|
|
721
879
|
prefix: string;
|
|
722
880
|
array_index_mode?: "all" | "none" | {
|
|
@@ -727,14 +885,8 @@ declare const encryptConfigSchema: z.ZodObject<{
|
|
|
727
885
|
} | undefined;
|
|
728
886
|
}>>;
|
|
729
887
|
}, "strip", z.ZodTypeAny, {
|
|
730
|
-
cast_as: "string" | "number" | "bigint" | "boolean" | "date" | "json" | "text";
|
|
888
|
+
cast_as: "string" | "number" | "bigint" | "boolean" | "date" | "timestamp" | "json" | "text";
|
|
731
889
|
indexes: {
|
|
732
|
-
ore?: {} | undefined;
|
|
733
|
-
unique?: {
|
|
734
|
-
token_filters?: {
|
|
735
|
-
kind: "downcase";
|
|
736
|
-
}[] | undefined;
|
|
737
|
-
} | undefined;
|
|
738
890
|
match?: {
|
|
739
891
|
token_filters?: {
|
|
740
892
|
kind: "downcase";
|
|
@@ -749,6 +901,12 @@ declare const encryptConfigSchema: z.ZodObject<{
|
|
|
749
901
|
m?: number | undefined;
|
|
750
902
|
include_original?: boolean | undefined;
|
|
751
903
|
} | undefined;
|
|
904
|
+
ore?: {} | undefined;
|
|
905
|
+
unique?: {
|
|
906
|
+
token_filters?: {
|
|
907
|
+
kind: "downcase";
|
|
908
|
+
}[] | undefined;
|
|
909
|
+
} | undefined;
|
|
752
910
|
ste_vec?: {
|
|
753
911
|
prefix: string;
|
|
754
912
|
array_index_mode?: "all" | "none" | {
|
|
@@ -759,14 +917,8 @@ declare const encryptConfigSchema: z.ZodObject<{
|
|
|
759
917
|
} | undefined;
|
|
760
918
|
};
|
|
761
919
|
}, {
|
|
762
|
-
cast_as?: "string" | "number" | "bigint" | "boolean" | "date" | "json" | "text" | undefined;
|
|
920
|
+
cast_as?: "string" | "number" | "bigint" | "boolean" | "date" | "timestamp" | "json" | "text" | undefined;
|
|
763
921
|
indexes?: {
|
|
764
|
-
ore?: {} | undefined;
|
|
765
|
-
unique?: {
|
|
766
|
-
token_filters?: {
|
|
767
|
-
kind: "downcase";
|
|
768
|
-
}[] | undefined;
|
|
769
|
-
} | undefined;
|
|
770
922
|
match?: {
|
|
771
923
|
token_filters?: {
|
|
772
924
|
kind: "downcase";
|
|
@@ -781,6 +933,12 @@ declare const encryptConfigSchema: z.ZodObject<{
|
|
|
781
933
|
m?: number | undefined;
|
|
782
934
|
include_original?: boolean | undefined;
|
|
783
935
|
} | undefined;
|
|
936
|
+
ore?: {} | undefined;
|
|
937
|
+
unique?: {
|
|
938
|
+
token_filters?: {
|
|
939
|
+
kind: "downcase";
|
|
940
|
+
}[] | undefined;
|
|
941
|
+
} | undefined;
|
|
784
942
|
ste_vec?: {
|
|
785
943
|
prefix: string;
|
|
786
944
|
array_index_mode?: "all" | "none" | {
|
|
@@ -794,14 +952,8 @@ declare const encryptConfigSchema: z.ZodObject<{
|
|
|
794
952
|
}, "strip", z.ZodTypeAny, {
|
|
795
953
|
v: number;
|
|
796
954
|
tables: Record<string, Record<string, {
|
|
797
|
-
cast_as: "string" | "number" | "bigint" | "boolean" | "date" | "json" | "text";
|
|
955
|
+
cast_as: "string" | "number" | "bigint" | "boolean" | "date" | "timestamp" | "json" | "text";
|
|
798
956
|
indexes: {
|
|
799
|
-
ore?: {} | undefined;
|
|
800
|
-
unique?: {
|
|
801
|
-
token_filters?: {
|
|
802
|
-
kind: "downcase";
|
|
803
|
-
}[] | undefined;
|
|
804
|
-
} | undefined;
|
|
805
957
|
match?: {
|
|
806
958
|
token_filters?: {
|
|
807
959
|
kind: "downcase";
|
|
@@ -816,6 +968,12 @@ declare const encryptConfigSchema: z.ZodObject<{
|
|
|
816
968
|
m?: number | undefined;
|
|
817
969
|
include_original?: boolean | undefined;
|
|
818
970
|
} | undefined;
|
|
971
|
+
ore?: {} | undefined;
|
|
972
|
+
unique?: {
|
|
973
|
+
token_filters?: {
|
|
974
|
+
kind: "downcase";
|
|
975
|
+
}[] | undefined;
|
|
976
|
+
} | undefined;
|
|
819
977
|
ste_vec?: {
|
|
820
978
|
prefix: string;
|
|
821
979
|
array_index_mode?: "all" | "none" | {
|
|
@@ -829,14 +987,8 @@ declare const encryptConfigSchema: z.ZodObject<{
|
|
|
829
987
|
}, {
|
|
830
988
|
v: number;
|
|
831
989
|
tables?: Record<string, Record<string, {
|
|
832
|
-
cast_as?: "string" | "number" | "bigint" | "boolean" | "date" | "json" | "text" | undefined;
|
|
990
|
+
cast_as?: "string" | "number" | "bigint" | "boolean" | "date" | "timestamp" | "json" | "text" | undefined;
|
|
833
991
|
indexes?: {
|
|
834
|
-
ore?: {} | undefined;
|
|
835
|
-
unique?: {
|
|
836
|
-
token_filters?: {
|
|
837
|
-
kind: "downcase";
|
|
838
|
-
}[] | undefined;
|
|
839
|
-
} | undefined;
|
|
840
992
|
match?: {
|
|
841
993
|
token_filters?: {
|
|
842
994
|
kind: "downcase";
|
|
@@ -851,6 +1003,12 @@ declare const encryptConfigSchema: z.ZodObject<{
|
|
|
851
1003
|
m?: number | undefined;
|
|
852
1004
|
include_original?: boolean | undefined;
|
|
853
1005
|
} | undefined;
|
|
1006
|
+
ore?: {} | undefined;
|
|
1007
|
+
unique?: {
|
|
1008
|
+
token_filters?: {
|
|
1009
|
+
kind: "downcase";
|
|
1010
|
+
}[] | undefined;
|
|
1011
|
+
} | undefined;
|
|
854
1012
|
ste_vec?: {
|
|
855
1013
|
prefix: string;
|
|
856
1014
|
array_index_mode?: "all" | "none" | {
|
|
@@ -918,7 +1076,7 @@ declare class EncryptedField {
|
|
|
918
1076
|
*/
|
|
919
1077
|
dataType(castAs: CastAs): this;
|
|
920
1078
|
build(): {
|
|
921
|
-
cast_as: "string" | "number" | "bigint" | "boolean" | "date" | "json" | "text";
|
|
1079
|
+
cast_as: "string" | "number" | "bigint" | "boolean" | "date" | "timestamp" | "json" | "text";
|
|
922
1080
|
indexes: {};
|
|
923
1081
|
};
|
|
924
1082
|
getName(): string;
|
|
@@ -1037,7 +1195,7 @@ declare class EncryptedColumn {
|
|
|
1037
1195
|
*/
|
|
1038
1196
|
searchableJson(): this;
|
|
1039
1197
|
build(): {
|
|
1040
|
-
cast_as: "string" | "number" | "bigint" | "boolean" | "date" | "json" | "text";
|
|
1198
|
+
cast_as: "string" | "number" | "bigint" | "boolean" | "date" | "timestamp" | "json" | "text";
|
|
1041
1199
|
indexes: {
|
|
1042
1200
|
ore?: OreIndexOpts;
|
|
1043
1201
|
unique?: UniqueIndexOpts;
|
|
@@ -1212,6 +1370,6 @@ declare function encryptedField(valueName: string): EncryptedField;
|
|
|
1212
1370
|
* console.log(config)
|
|
1213
1371
|
* ```
|
|
1214
1372
|
*/
|
|
1215
|
-
declare function buildEncryptConfig(...protectTables: Array<
|
|
1373
|
+
declare function buildEncryptConfig(...protectTables: Array<BuildableTable>): EncryptConfig;
|
|
1216
1374
|
|
|
1217
|
-
export {
|
|
1375
|
+
export { type OtherFields as $, type SteVecIndexOpts as A, type BulkEncryptPayload as B, type ClientConfig as C, type Decrypted as D, type EncryptedReturnType as E, buildEncryptConfig as F, castAsEnum as G, encryptConfigSchema as H, type InferEncrypted as I, eqlCastAsEnum as J, type KeysetIdentifier as K, toEqlCastAs as L, type MatchIndexOpts as M, type BuildableTableColumns as N, type OreIndexOpts as O, type Plaintext as P, type QueryTypeName as Q, type BuildableV3QueryableColumn as R, type ScalarQueryTerm as S, type TokenFilter as T, type UniqueIndexOpts as U, type DecryptedFields as V, type DecryptionResult as W, type EncryptedFields as X, type EncryptedFromSchema as Y, type EncryptedQuery as Z, type EncryptedSearchTerm as _, type Encrypted as a, type SearchTerm as a0, queryTypes as a1, type EncryptOptions as b, type BulkDecryptPayload as c, encryptedField as d, encryptedColumn as e, encryptedTable as f, EncryptedTable as g, type EncryptedTableColumn as h, type ColumnSchema as i, type EncryptConfig as j, EncryptedColumn as k, type CastAs as l, type EncryptedValue as m, type EncryptedQueryResult as n, type Client as o, type BulkDecryptedData as p, type BulkEncryptedData as q, type BuildableColumn as r, type BuildableTable as s, type EncryptQueryOptions as t, type BuildableQueryColumn as u, type EncryptedFromBuildableTable as v, type EncryptionClientConfig as w, EncryptedField as x, type InferPlaintext as y, type EqlCastAs as z };
|