@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
@@ -0,0 +1,32 @@
1
+ import { Result } from '@byteslice/result';
2
+ import { EncryptionError } from './errors/index.cjs';
3
+
4
+ type AuditConfig = {
5
+ metadata?: Record<string, unknown>;
6
+ };
7
+ type AuditData = {
8
+ metadata?: Record<string, unknown>;
9
+ };
10
+ declare abstract class EncryptionOperation<T> {
11
+ protected auditMetadata?: Record<string, unknown>;
12
+ /**
13
+ * Attach audit metadata to this operation. Can be chained.
14
+ * @param config Configuration for ZeroKMS audit logging
15
+ * @param config.metadata Arbitrary JSON object for appending metadata to the audit log
16
+ */
17
+ audit(config: AuditConfig): this;
18
+ /**
19
+ * Get the audit data for this operation.
20
+ */
21
+ getAuditData(): AuditData;
22
+ /**
23
+ * Execute the operation and return a Result
24
+ */
25
+ abstract execute(): Promise<Result<T, EncryptionError>>;
26
+ /**
27
+ * Make the operation thenable
28
+ */
29
+ then<TResult1 = Result<T, EncryptionError>, TResult2 = never>(onfulfilled?: ((value: Result<T, EncryptionError>) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
30
+ }
31
+
32
+ export { type AuditConfig as A, EncryptionOperation as E };
@@ -0,0 +1,32 @@
1
+ import { Result } from '@byteslice/result';
2
+ import { EncryptionError } from './errors/index.js';
3
+
4
+ type AuditConfig = {
5
+ metadata?: Record<string, unknown>;
6
+ };
7
+ type AuditData = {
8
+ metadata?: Record<string, unknown>;
9
+ };
10
+ declare abstract class EncryptionOperation<T> {
11
+ protected auditMetadata?: Record<string, unknown>;
12
+ /**
13
+ * Attach audit metadata to this operation. Can be chained.
14
+ * @param config Configuration for ZeroKMS audit logging
15
+ * @param config.metadata Arbitrary JSON object for appending metadata to the audit log
16
+ */
17
+ audit(config: AuditConfig): this;
18
+ /**
19
+ * Get the audit data for this operation.
20
+ */
21
+ getAuditData(): AuditData;
22
+ /**
23
+ * Execute the operation and return a Result
24
+ */
25
+ abstract execute(): Promise<Result<T, EncryptionError>>;
26
+ /**
27
+ * Make the operation thenable
28
+ */
29
+ then<TResult1 = Result<T, EncryptionError>, TResult2 = never>(onfulfilled?: ((value: Result<T, EncryptionError>) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
30
+ }
31
+
32
+ export { type AuditConfig as A, EncryptionOperation as E };
@@ -8,6 +8,8 @@ var queryTypes = {
8
8
  searchableJson: "searchableJson"
9
9
  };
10
10
  var queryTypeToFfi = {
11
+ // v3 `_ord` domains carry `ope` instead — `resolveIndexType` swaps this
12
+ // static default for the ordering index the column actually configures.
11
13
  orderAndRange: "ore",
12
14
  freeTextSearch: "match",
13
15
  equality: "unique",
@@ -25,4 +27,4 @@ export {
25
27
  queryTypeToFfi,
26
28
  queryTypeToQueryOp
27
29
  };
28
- //# sourceMappingURL=chunk-4AVL4VZD.js.map
30
+ //# sourceMappingURL=chunk-3B5ZX3IS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type {\n AuthStrategy,\n Encrypted as CipherStashEncrypted,\n EncryptedPayload as CipherStashEncryptedPayload,\n EncryptedQuery as CipherStashEncryptedQuery,\n EncryptedV3Query as CipherStashEncryptedV3Query,\n JsPlaintext,\n newClient,\n QueryOpName,\n} from '@cipherstash/protect-ffi'\nimport type {\n ColumnSchema,\n EncryptedColumn,\n EncryptedField,\n EncryptedTableColumn,\n // Imported type-only for the TSDoc {@link} references in the comments below.\n encryptedColumn,\n encryptedField,\n} from '@/schema'\n\n/**\n * A pluggable authentication strategy for ZeroKMS requests. Any object\n * with a `getToken(): Promise<{ token: string }>` method satisfies it —\n * notably the strategies from `@cipherstash/auth`: `OidcFederationStrategy`\n * (per-user, identity-bound encryption) and `AccessKeyStrategy`\n * (service-to-service / CI). When supplied to {@link ClientConfig.authStrategy},\n * `getToken()` is invoked on every ZeroKMS request, taking precedence over\n * the default `auto` strategy.\n *\n * @see ClientConfig.authStrategy\n */\nexport type { AuthStrategy }\n\n// ---------------------------------------------------------------------------\n// Branded type utilities\n// ---------------------------------------------------------------------------\n\n/** Brand symbol for nominal typing */\ndeclare const __brand: unique symbol\n\n/** Creates a branded type that is structurally incompatible with the base type */\ntype Brand<T, B extends string> = T & { readonly [__brand]: B }\n\n// ---------------------------------------------------------------------------\n// Core types\n// ---------------------------------------------------------------------------\n\nexport type Client = Awaited<ReturnType<typeof newClient>> | undefined\n\n/** A branded type representing encrypted data. Cannot be accidentally used as plaintext. */\nexport type EncryptedValue = Brand<CipherStashEncrypted, 'encrypted'>\n\n/** Structural type representing encrypted data stored in the database. Always\n * carries a ciphertext. Covers BOTH wire formats: the EQL v2.3 payloads\n * (`k: \"ct\"` / `k: \"sv\"`) and the EQL v3 payloads (flat `{v: 3, i, c, …}`\n * scalars and `{v: 3, k: \"sv\", i, sv}` SteVec documents). Which format\n * `encrypt` produces is selected by the client's\n * {@link ClientConfig.eqlVersion}; `decrypt` accepts both regardless.\n * v3 scalars carry no `k` discriminator, so narrow with `'k' in payload`\n * before reading it. See also `EncryptedValue` for branded nominal typing,\n * and {@link EncryptedQuery} for the search-term shape returned by\n * `encryptQuery`. */\nexport type Encrypted = CipherStashEncryptedPayload\n\n/** Structural type representing an encrypted query term (search needle)\n * returned by `encryptQuery` / `encryptQueryBulk` for scalar\n * (`unique` / `match` / `ore`) lookups and `ste_vec_selector` JSON path\n * queries, plus — under `eqlVersion: 3` — the `eql_v3.jsonb_query`\n * containment needle. Carries no ciphertext — matched against stored\n * values, never decrypted. v2 JSON containment queries (`ste_vec_term`)\n * return a storage-shaped {@link Encrypted} payload instead. */\nexport type EncryptedQuery =\n | CipherStashEncryptedQuery\n | CipherStashEncryptedV3Query\n\n/**\n * Plaintext values the SDK accepts for encryption.\n *\n * Widens the FFI's `JsPlaintext` (`string | number | boolean |\n * Record<string, unknown> | JsPlaintext[]`) with `Date` and `bigint`. `Date`\n * is a supported cast target that is omitted from the FFI's `JsPlaintext` INPUT\n * union, but it serializes at the boundary via `toJSON` (ISO string), so it is\n * accepted on the way in.\n *\n * `bigint` is the plaintext for the v3 int8/bigint domains (see `eql/v3`),\n * which always decrypt to a JS `bigint`. protect-ffi 0.28 marshals a native\n * `bigint` across the Neon boundary losslessly. i64 bounds\n * (`-2^63 … 2^63 - 1`) are enforced at the protect-ffi boundary, not here —\n * out-of-range values surface as encryption errors from the FFI.\n *\n * When the upstream FFI `JsPlaintext` includes `Date` and `bigint`, both extra\n * arms can collapse back into `JsPlaintext`.\n */\nexport type Plaintext = JsPlaintext | Date | bigint\n\n// ---------------------------------------------------------------------------\n// Client configuration\n// ---------------------------------------------------------------------------\n\nexport type KeysetIdentifier = { name: string } | { id: string }\n\nexport type ClientConfig = {\n /**\n * The CipherStash workspace CRN (Cloud Resource Name).\n * Format: `crn:<region>.aws:<workspace-id>`.\n * Can also be set via the `CS_WORKSPACE_CRN` environment variable.\n */\n workspaceCrn?: string\n\n /**\n * The API access key used for authenticating with the CipherStash API.\n * Can also be set via the `CS_CLIENT_ACCESS_KEY` environment variable.\n * Obtain this from the CipherStash dashboard after creating a workspace.\n */\n accessKey?: string\n\n /**\n * The client identifier used to authenticate with CipherStash services.\n * Can also be set via the `CS_CLIENT_ID` environment variable.\n * Generated during workspace onboarding in the CipherStash dashboard.\n */\n clientId?: string\n\n /**\n * The client key material used in combination with ZeroKMS for encryption operations.\n * Can also be set via the `CS_CLIENT_KEY` environment variable.\n * Generated during workspace onboarding in the CipherStash dashboard.\n */\n clientKey?: string\n\n /**\n * An optional keyset identifier for multi-tenant encryption.\n * Each keyset provides cryptographic isolation, giving each tenant its own keyspace.\n * Specify by name (`{ name: \"tenant-a\" }`) or UUID (`{ id: \"...\" }`).\n * Keysets are created and managed in the\n * [dashboard](https://dashboard.cipherstash.com/workspaces/_/keysets); omit to\n * use the workspace's default keyset. A client is bound to one keyset for its\n * lifetime, so use one client per tenant.\n *\n * @see {@link Encryption} for the full keysets walkthrough.\n */\n keyset?: KeysetIdentifier\n\n /**\n * An optional authentication strategy for ZeroKMS requests, from\n * `@cipherstash/auth` (re-exported by `@cipherstash/stack`). When provided,\n * its `getToken()` is invoked on every ZeroKMS request and takes precedence\n * over the default `auto` strategy (the `clientKey` is still required for\n * encryption). Use:\n *\n * - `OidcFederationStrategy` for per-user, identity-bound encryption —\n * federates an end user's OIDC JWT into a CTS service token, so requests\n * authenticate as that user. Pair with `.withLockContext({ identityClaim })`\n * to bind the data key to a claim. This replaces the older\n * `LockContext.identify()` ceremony.\n * - `AccessKeyStrategy` for service-to-service / CI, or any custom\n * `{ getToken() }` object for bespoke token acquisition / caching.\n *\n * Leave unset to use the default `auto` strategy, which reads credentials\n * from the `CS_*` environment variables and falls back to the local dev\n * profile created by `npx stash auth login`.\n *\n * @see {@link AuthStrategy}\n * @see {@link Encryption} for a full walkthrough of the authentication options.\n */\n authStrategy?: AuthStrategy\n\n /**\n * @deprecated Renamed to {@link ClientConfig.authStrategy}. Still honoured for\n * backwards compatibility — passing it logs a deprecation warning at runtime —\n * but it will be removed in a future release. Set `authStrategy` instead.\n */\n strategy?: AuthStrategy\n\n /**\n * The EQL wire version the client emits — one FFI client always emits\n * exactly one wire format.\n *\n * - `2` (the protect-ffi default): payloads target the\n * `eql_v2_encrypted` column type.\n * - `3`: payloads target the per-capability `eql_v3` domains\n * (`eql_v3.text_eq`, `eql_v3.integer_ord_ore`, `eql_v3.json`, …),\n * derived from each column's `cast_as` and indexes.\n *\n * When omitted, {@link Encryption} auto-detects from the schema set:\n * EQL v3 tables (from `@cipherstash/stack/v3`, marked by\n * `buildColumnKeyMap()`) select `3`; v2 tables leave the FFI default\n * (`2`) untouched. Mixing v2 and v3 tables in one client is an error —\n * split them across two clients instead.\n *\n * `decrypt` accepts BOTH formats regardless of this setting, so v2 and\n * v3 data can coexist during a migration.\n *\n * Under `3`, `encryptQuery` returns EQL v3 query operands (protect-ffi\n * 0.29+): term-only scalar operands for the `eql_v3.query_<name>` twins,\n * the `eql_v3.query_jsonb` containment needle, and bare selector-hash\n * strings for JSON path queries.\n */\n eqlVersion?: 2 | 3\n}\n\ntype AtLeastOneCsTable<T> = [T, ...T[]]\n\n/** Structural contract for a column builder the client can consume for STORAGE\n * (`encrypt`). Satisfied by v2 `EncryptedColumn` / `EncryptedField` AND v3\n * `EncryptedTextSearchColumn` — fields ARE encryptable, so this stays wide. */\nexport interface BuildableColumn {\n getName(): string\n build(): ColumnSchema\n}\n\n/** Structural contract for a column the client can consume for QUERIES\n * (`encryptQuery` / search terms). Narrower than `BuildableColumn`: it must\n * EXCLUDE non-queryable `EncryptedField` (a field has no indexes). A v2\n * `EncryptedColumn` qualifies via the nominal arm; a v3 queryable concrete\n * type qualifies via the `getEqlType()` structural arm; `EncryptedField` (no\n * `getEqlType`, not an `EncryptedColumn`) is rejected. */\nexport interface BuildableV3QueryableColumn extends BuildableColumn {\n getEqlType(): string\n getQueryCapabilities(): {\n equality: boolean\n orderAndRange: boolean\n freeTextSearch: boolean\n }\n isQueryable(): true\n}\n\nexport type BuildableQueryColumn = EncryptedColumn | BuildableV3QueryableColumn\n\n/** Structural contract for a table builder the client can consume. Satisfied by\n * v2 and v3 `EncryptedTable` alike. */\nexport interface BuildableTable {\n tableName: string\n build(): { tableName: string; columns: Record<string, ColumnSchema> }\n /**\n * Optional map from a model field's JS property name to its encrypt-config\n * column name (the DB name). Present when the two can differ — v3 tables key\n * their config by DB name (`column.getName()`) while models are written with\n * JS property keys, so the model path must match by property but address the\n * FFI/config by DB name.\n *\n * Absent on v2 tables, whose `build()` already keys columns by the JS property\n * name; the model path then matches and addresses by that same key.\n */\n buildColumnKeyMap?(): Record<string, string>\n}\n\nexport type EncryptionClientConfig = {\n schemas: AtLeastOneCsTable<BuildableTable>\n config?: ClientConfig\n}\n\n/**\n * The literal column map of a buildable table, read from its type-level\n * `_columnType` brand. Both v2 and v3 `EncryptedTable` carry this brand, so this\n * recovers the literal column keys structurally.\n *\n * This deliberately uses the `_columnType` brand rather than `build().columns`:\n * `BuildableTable.build()` is typed to return `Record<string, ColumnSchema>`,\n * which erases the literal keys and would mark EVERY model field as encrypted.\n *\n * The fallbacks resolve to `Record<never, never>` (a no-key type), NOT `never`:\n * a value typed as the bare structural `BuildableTable` carries no `_columnType`\n * brand, and `keyof never` is `string | number | symbol` — which would wrongly\n * mark EVERY model field as encrypted. `keyof Record<never, never>` is `never`,\n * so `EncryptedFromBuildableTable` degrades gracefully to the model unchanged.\n */\nexport type BuildableTableColumns<T extends BuildableTable> = T extends {\n readonly _columnType: infer C\n}\n ? C extends Record<string, unknown>\n ? C\n : Record<never, never>\n : Record<never, never>\n\n/**\n * Maps a plaintext model type to its encrypted form using a buildable table.\n *\n * Fields whose keys match a column defined in `Table` (via its `_columnType`\n * brand) become `Encrypted` (`Encrypted | null` when the source field is\n * nullable); all other fields retain their original types from `T`. Works for\n * both v2 and v3 tables. See {@link EncryptedFromSchema} for the v2-specific\n * variant retained for backward compatibility.\n */\nexport type EncryptedFromBuildableTable<T, Table extends BuildableTable> = {\n [K in keyof T]: [K] extends [keyof BuildableTableColumns<Table>]\n ? null extends T[K]\n ? Encrypted | null\n : Encrypted\n : T[K]\n}\n\n// ---------------------------------------------------------------------------\n// Encrypt / decrypt operation options and results\n// ---------------------------------------------------------------------------\n\n/**\n * Options for single-value encrypt operations.\n * Use a column from your table schema (from {@link encryptedColumn}) or a nested\n * field (from {@link encryptedField}) as the target for encryption.\n */\nexport type EncryptOptions = {\n /** The column or nested field to encrypt into. From {@link EncryptedColumn} or {@link EncryptedField}. */\n column: BuildableColumn // storage: fields are encryptable, so stays wide\n table: BuildableTable\n}\n\n/** Format for encrypted query/search term return values */\nexport type EncryptedReturnType =\n | 'eql'\n | 'composite-literal'\n | 'escaped-composite-literal'\n\nexport type SearchTerm = {\n value: Plaintext\n column: BuildableQueryColumn // query: excludes non-queryable EncryptedField\n table: BuildableTable\n returnType?: EncryptedReturnType\n}\n\n/** Encrypted search term result. `eql` return type yields either a storage\n * payload (`Encrypted`, for `ste_vec_term`) or a query-only term\n * (`EncryptedQuery`, for scalar lookups and `ste_vec_selector`); the\n * `composite-literal` return types yield a string. */\nexport type EncryptedSearchTerm = Encrypted | EncryptedQuery | string\n\n/** Result of encryptQuery (single or batch). `eql` return type yields either a\n * storage payload (`Encrypted`) or a query-only term (`EncryptedQuery`); the\n * `composite-literal` return types yield a string. */\n// null elements appear in the batch path when a term has a null/undefined\n// value — the operation preserves position so callers can correlate results\n// with their input array.\nexport type EncryptedQueryResult = Encrypted | EncryptedQuery | string | null\n\n// ---------------------------------------------------------------------------\n// Model field types (encrypted vs decrypted views)\n// ---------------------------------------------------------------------------\n\nexport type EncryptedFields<T> = {\n [K in keyof T as NonNullable<T[K]> extends Encrypted ? K : never]: T[K]\n}\n\nexport type OtherFields<T> = {\n [K in keyof T as NonNullable<T[K]> extends Encrypted ? never : K]: T[K]\n}\n\nexport type DecryptedFields<T> = {\n [K in keyof T as NonNullable<T[K]> extends Encrypted\n ? K\n : never]: null extends T[K] ? string | null : string\n}\n\n/** Model with encrypted fields replaced by plaintext (decrypted) values */\nexport type Decrypted<T> = OtherFields<T> & DecryptedFields<T>\n\n/**\n * Maps a plaintext model type to its encrypted form using the table schema.\n *\n * Fields whose keys match columns defined in `S` become `Encrypted`;\n * all other fields retain their original types from `T`.\n *\n * When `S` is the widened `EncryptedTableColumn` (e.g. when a user passes an\n * explicit `<User>` type argument without specifying `S`), the type degrades\n * gracefully to `T` — preserving backward compatibility.\n *\n * @typeParam T - The plaintext model type (e.g. `{ id: string; email: string }`)\n * @typeParam S - The table schema column definition, inferred from the `table` argument\n *\n * @example\n * ```typescript\n * type User = { id: string; email: string }\n * // With a schema that defines `email`:\n * type Encrypted = EncryptedFromSchema<User, { email: EncryptedColumn }>\n * // => { id: string; email: Encrypted }\n * ```\n */\nexport type EncryptedFromSchema<T, S extends EncryptedTableColumn> = {\n [K in keyof T]: [K] extends [keyof S]\n ? [S[K & keyof S]] extends [EncryptedColumn | EncryptedField]\n ? null extends T[K]\n ? Encrypted | null\n : Encrypted\n : T[K]\n : T[K]\n}\n\n// ---------------------------------------------------------------------------\n// Bulk operations\n// ---------------------------------------------------------------------------\n\n// Bulk payloads admit null elements — bulk operations pass them through\n// untouched (encrypt(null) -> null, decrypt(null) -> null) so callers can\n// process mixed nullable arrays without filtering ahead of time. The\n// runtime guards in the operation classes preserve the null in the\n// position-stable output.\nexport type BulkEncryptPayload = Array<{\n id?: string\n plaintext: Plaintext | null\n}>\n\nexport type BulkEncryptedData = Array<{ id?: string; data: Encrypted | null }>\nexport type BulkDecryptPayload = Array<{ id?: string; data: Encrypted | null }>\nexport type BulkDecryptedData = Array<DecryptionResult<JsPlaintext | null>>\n\ntype DecryptionSuccess<T> = { error?: never; data: T; id?: string }\ntype DecryptionError<T> = { error: T; id?: string; data?: never }\n\n/**\n * Result type for individual items in bulk decrypt operations.\n * Uses `error`/`data` fields (not `failure`/`data`) since bulk operations\n * can have per-item failures.\n */\nexport type DecryptionResult<T> = DecryptionSuccess<T> | DecryptionError<T>\n\n// ---------------------------------------------------------------------------\n// Query types (for searchable encryption / encryptQuery)\n// ---------------------------------------------------------------------------\n\n/**\n * User-facing query type names for encrypting query values.\n *\n * - `'equality'`: Exact match. [Exact Queries](https://cipherstash.com/docs/stack/cipherstash/encryption/searchable-encryption)\n * - `'freeTextSearch'`: Text search. [Match Queries](https://cipherstash.com/docs/stack/cipherstash/encryption/searchable-encryption)\n * - `'orderAndRange'`: Comparison and range. [Range Queries](https://cipherstash.com/docs/stack/cipherstash/encryption/searchable-encryption)\n * - `'steVecSelector'`: JSONPath selector (e.g. `'$.user.email'`)\n * - `'steVecTerm'`: Containment (e.g. `{ role: 'admin' }`)\n * - `'searchableJson'`: Auto-infers selector or term from plaintext type (recommended)\n */\nexport type QueryTypeName =\n | 'orderAndRange'\n | 'freeTextSearch'\n | 'equality'\n | 'steVecSelector'\n | 'steVecTerm'\n | 'searchableJson'\n\n/** @internal */\nexport type FfiIndexTypeName = 'ore' | 'ope' | 'match' | 'unique' | 'ste_vec'\n\nexport const queryTypes = {\n orderAndRange: 'orderAndRange',\n freeTextSearch: 'freeTextSearch',\n equality: 'equality',\n steVecSelector: 'steVecSelector',\n steVecTerm: 'steVecTerm',\n searchableJson: 'searchableJson',\n} as const satisfies Record<string, QueryTypeName>\n\n/** @internal */\nexport const queryTypeToFfi: Record<QueryTypeName, FfiIndexTypeName> = {\n // v3 `_ord` domains carry `ope` instead — `resolveIndexType` swaps this\n // static default for the ordering index the column actually configures.\n orderAndRange: 'ore',\n freeTextSearch: 'match',\n equality: 'unique',\n steVecSelector: 'ste_vec',\n steVecTerm: 'ste_vec',\n searchableJson: 'ste_vec',\n}\n\n/** @internal */\nexport const queryTypeToQueryOp: Partial<Record<QueryTypeName, QueryOpName>> = {\n steVecSelector: 'ste_vec_selector',\n steVecTerm: 'ste_vec_term',\n}\n\n/** @internal */\nexport type QueryTermBase = {\n column: BuildableQueryColumn // query: excludes non-queryable EncryptedField\n table: BuildableTable\n queryType?: QueryTypeName\n returnType?: EncryptedReturnType\n}\n\nexport type EncryptQueryOptions = QueryTermBase\n\nexport type ScalarQueryTerm = QueryTermBase & {\n value: Plaintext\n}\n"],"mappings":";AAubO,IAAM,aAAa;AAAA,EACxB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,gBAAgB;AAClB;AAGO,IAAM,iBAA0D;AAAA;AAAA;AAAA,EAGrE,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,gBAAgB;AAClB;AAGO,IAAM,qBAAkE;AAAA,EAC7E,gBAAgB;AAAA,EAChB,YAAY;AACd;","names":[]}
@@ -1,9 +1,9 @@
1
1
  import {
2
- cloneMatchOpts,
3
2
  defaultMatchOpts
4
- } from "./chunk-IADZCZEA.js";
3
+ } from "./chunk-7333ZC6L.js";
5
4
 
6
5
  // src/eql/v3/columns.ts
6
+ var DATE_LIKE_CASTS = ["date", "timestamp"];
7
7
  var STORAGE_ONLY = {
8
8
  equality: false,
9
9
  orderAndRange: false,
@@ -29,192 +29,222 @@ var TEXT_SEARCH = {
29
29
  orderAndRange: true,
30
30
  freeTextSearch: true
31
31
  };
32
- var TEXT_SEARCH_EQL_TYPE = "eql_v3.text_search";
32
+ var TEXT_SEARCH_EQL_TYPE = "public.eql_v3_text_search";
33
33
  var INTEGER = {
34
- eqlType: "eql_v3.integer",
34
+ eqlType: "public.eql_v3_integer",
35
35
  castAs: "number",
36
36
  capabilities: STORAGE_ONLY
37
37
  };
38
38
  var INTEGER_EQ = {
39
- eqlType: "eql_v3.integer_eq",
39
+ eqlType: "public.eql_v3_integer_eq",
40
40
  castAs: "number",
41
41
  capabilities: EQUALITY_ONLY
42
42
  };
43
43
  var INTEGER_ORD_ORE = {
44
- eqlType: "eql_v3.integer_ord_ore",
44
+ eqlType: "public.eql_v3_integer_ord_ore",
45
45
  castAs: "number",
46
46
  capabilities: ORDER_AND_RANGE
47
47
  };
48
48
  var INTEGER_ORD = {
49
- eqlType: "eql_v3.integer_ord",
49
+ eqlType: "public.eql_v3_integer_ord",
50
50
  castAs: "number",
51
51
  capabilities: ORDER_AND_RANGE
52
52
  };
53
53
  var SMALLINT = {
54
- eqlType: "eql_v3.smallint",
54
+ eqlType: "public.eql_v3_smallint",
55
55
  castAs: "number",
56
56
  capabilities: STORAGE_ONLY
57
57
  };
58
58
  var SMALLINT_EQ = {
59
- eqlType: "eql_v3.smallint_eq",
59
+ eqlType: "public.eql_v3_smallint_eq",
60
60
  castAs: "number",
61
61
  capabilities: EQUALITY_ONLY
62
62
  };
63
63
  var SMALLINT_ORD_ORE = {
64
- eqlType: "eql_v3.smallint_ord_ore",
64
+ eqlType: "public.eql_v3_smallint_ord_ore",
65
65
  castAs: "number",
66
66
  capabilities: ORDER_AND_RANGE
67
67
  };
68
68
  var SMALLINT_ORD = {
69
- eqlType: "eql_v3.smallint_ord",
69
+ eqlType: "public.eql_v3_smallint_ord",
70
70
  castAs: "number",
71
71
  capabilities: ORDER_AND_RANGE
72
72
  };
73
+ var BIGINT = {
74
+ eqlType: "public.eql_v3_bigint",
75
+ castAs: "bigint",
76
+ capabilities: STORAGE_ONLY
77
+ };
78
+ var BIGINT_EQ = {
79
+ eqlType: "public.eql_v3_bigint_eq",
80
+ castAs: "bigint",
81
+ capabilities: EQUALITY_ONLY
82
+ };
83
+ var BIGINT_ORD_ORE = {
84
+ eqlType: "public.eql_v3_bigint_ord_ore",
85
+ castAs: "bigint",
86
+ capabilities: ORDER_AND_RANGE
87
+ };
88
+ var BIGINT_ORD = {
89
+ eqlType: "public.eql_v3_bigint_ord",
90
+ castAs: "bigint",
91
+ capabilities: ORDER_AND_RANGE
92
+ };
73
93
  var DATE = {
74
- eqlType: "eql_v3.date",
94
+ eqlType: "public.eql_v3_date",
75
95
  castAs: "date",
76
96
  capabilities: STORAGE_ONLY
77
97
  };
78
98
  var DATE_EQ = {
79
- eqlType: "eql_v3.date_eq",
99
+ eqlType: "public.eql_v3_date_eq",
80
100
  castAs: "date",
81
101
  capabilities: EQUALITY_ONLY
82
102
  };
83
103
  var DATE_ORD_ORE = {
84
- eqlType: "eql_v3.date_ord_ore",
104
+ eqlType: "public.eql_v3_date_ord_ore",
85
105
  castAs: "date",
86
106
  capabilities: ORDER_AND_RANGE
87
107
  };
88
108
  var DATE_ORD = {
89
- eqlType: "eql_v3.date_ord",
109
+ eqlType: "public.eql_v3_date_ord",
90
110
  castAs: "date",
91
111
  capabilities: ORDER_AND_RANGE
92
112
  };
93
113
  var TIMESTAMP = {
94
- eqlType: "eql_v3.timestamp",
114
+ eqlType: "public.eql_v3_timestamp",
95
115
  castAs: "timestamp",
96
116
  capabilities: STORAGE_ONLY
97
117
  };
98
118
  var TIMESTAMP_EQ = {
99
- eqlType: "eql_v3.timestamp_eq",
119
+ eqlType: "public.eql_v3_timestamp_eq",
100
120
  castAs: "timestamp",
101
121
  capabilities: EQUALITY_ONLY
102
122
  };
103
123
  var TIMESTAMP_ORD_ORE = {
104
- eqlType: "eql_v3.timestamp_ord_ore",
124
+ eqlType: "public.eql_v3_timestamp_ord_ore",
105
125
  castAs: "timestamp",
106
126
  capabilities: ORDER_AND_RANGE
107
127
  };
108
128
  var TIMESTAMP_ORD = {
109
- eqlType: "eql_v3.timestamp_ord",
129
+ eqlType: "public.eql_v3_timestamp_ord",
110
130
  castAs: "timestamp",
111
131
  capabilities: ORDER_AND_RANGE
112
132
  };
113
133
  var NUMERIC = {
114
- eqlType: "eql_v3.numeric",
134
+ eqlType: "public.eql_v3_numeric",
115
135
  castAs: "number",
116
136
  capabilities: STORAGE_ONLY
117
137
  };
118
138
  var NUMERIC_EQ = {
119
- eqlType: "eql_v3.numeric_eq",
139
+ eqlType: "public.eql_v3_numeric_eq",
120
140
  castAs: "number",
121
141
  capabilities: EQUALITY_ONLY
122
142
  };
123
143
  var NUMERIC_ORD_ORE = {
124
- eqlType: "eql_v3.numeric_ord_ore",
144
+ eqlType: "public.eql_v3_numeric_ord_ore",
125
145
  castAs: "number",
126
146
  capabilities: ORDER_AND_RANGE
127
147
  };
128
148
  var NUMERIC_ORD = {
129
- eqlType: "eql_v3.numeric_ord",
149
+ eqlType: "public.eql_v3_numeric_ord",
130
150
  castAs: "number",
131
151
  capabilities: ORDER_AND_RANGE
132
152
  };
133
153
  var TEXT = {
134
- eqlType: "eql_v3.text",
154
+ eqlType: "public.eql_v3_text",
135
155
  castAs: "string",
136
156
  capabilities: STORAGE_ONLY
137
157
  };
138
158
  var TEXT_EQ = {
139
- eqlType: "eql_v3.text_eq",
159
+ eqlType: "public.eql_v3_text_eq",
140
160
  castAs: "string",
141
161
  capabilities: EQUALITY_ONLY
142
162
  };
143
163
  var TEXT_MATCH = {
144
- eqlType: "eql_v3.text_match",
164
+ eqlType: "public.eql_v3_text_match",
145
165
  castAs: "string",
146
166
  capabilities: MATCH_ONLY
147
167
  };
148
168
  var TEXT_ORD_ORE = {
149
- eqlType: "eql_v3.text_ord_ore",
169
+ eqlType: "public.eql_v3_text_ord_ore",
150
170
  castAs: "string",
151
171
  capabilities: ORDER_AND_RANGE
152
172
  };
153
173
  var TEXT_ORD = {
154
- eqlType: "eql_v3.text_ord",
174
+ eqlType: "public.eql_v3_text_ord",
155
175
  castAs: "string",
156
176
  capabilities: ORDER_AND_RANGE
157
177
  };
158
178
  var BOOLEAN = {
159
- eqlType: "eql_v3.boolean",
179
+ eqlType: "public.eql_v3_boolean",
160
180
  castAs: "boolean",
161
181
  capabilities: STORAGE_ONLY
162
182
  };
163
183
  var REAL = {
164
- eqlType: "eql_v3.real",
184
+ eqlType: "public.eql_v3_real",
165
185
  castAs: "number",
166
186
  capabilities: STORAGE_ONLY
167
187
  };
168
188
  var REAL_EQ = {
169
- eqlType: "eql_v3.real_eq",
189
+ eqlType: "public.eql_v3_real_eq",
170
190
  castAs: "number",
171
191
  capabilities: EQUALITY_ONLY
172
192
  };
173
193
  var REAL_ORD_ORE = {
174
- eqlType: "eql_v3.real_ord_ore",
194
+ eqlType: "public.eql_v3_real_ord_ore",
175
195
  castAs: "number",
176
196
  capabilities: ORDER_AND_RANGE
177
197
  };
178
198
  var REAL_ORD = {
179
- eqlType: "eql_v3.real_ord",
199
+ eqlType: "public.eql_v3_real_ord",
180
200
  castAs: "number",
181
201
  capabilities: ORDER_AND_RANGE
182
202
  };
183
203
  var DOUBLE = {
184
- eqlType: "eql_v3.double",
204
+ eqlType: "public.eql_v3_double",
185
205
  castAs: "number",
186
206
  capabilities: STORAGE_ONLY
187
207
  };
188
208
  var DOUBLE_EQ = {
189
- eqlType: "eql_v3.double_eq",
209
+ eqlType: "public.eql_v3_double_eq",
190
210
  castAs: "number",
191
211
  capabilities: EQUALITY_ONLY
192
212
  };
193
213
  var DOUBLE_ORD_ORE = {
194
- eqlType: "eql_v3.double_ord_ore",
214
+ eqlType: "public.eql_v3_double_ord_ore",
195
215
  castAs: "number",
196
216
  capabilities: ORDER_AND_RANGE
197
217
  };
198
218
  var DOUBLE_ORD = {
199
- eqlType: "eql_v3.double_ord",
219
+ eqlType: "public.eql_v3_double_ord",
200
220
  castAs: "number",
201
221
  capabilities: ORDER_AND_RANGE
202
222
  };
203
- function indexesForCapabilities(capabilities, castAs) {
223
+ function indexesForCapabilities(capabilities, castAs, ordering) {
204
224
  const indexes = {};
205
225
  if (capabilities.equality && (!capabilities.orderAndRange || castAs === "string")) {
206
226
  indexes.unique = { token_filters: [] };
207
227
  }
208
228
  if (capabilities.orderAndRange) {
209
- indexes.ore = {};
229
+ indexes[ordering] = {};
210
230
  }
211
231
  if (capabilities.freeTextSearch) {
212
- indexes.match = defaultMatchOpts();
232
+ indexes.match = { ...defaultMatchOpts(), include_original: false };
233
+ }
234
+ if (capabilities.searchableJson) {
235
+ indexes.ste_vec = {
236
+ prefix: "enabled",
237
+ array_index_mode: { item: true, wildcard: true, position: false },
238
+ mode: "compat"
239
+ };
213
240
  }
214
241
  return indexes;
215
242
  }
243
+ function orderingForEqlType(eqlType) {
244
+ return eqlType.endsWith("_ord_ore") ? "ore" : "ope";
245
+ }
216
246
  function isQueryableCapabilities(capabilities) {
217
- return capabilities.equality || capabilities.orderAndRange || capabilities.freeTextSearch;
247
+ return capabilities.equality || capabilities.orderAndRange || capabilities.freeTextSearch || (capabilities.searchableJson ?? false);
218
248
  }
219
249
  var EncryptedV3Column = class {
220
250
  constructor(columnName, definition) {
@@ -246,7 +276,8 @@ var EncryptedV3Column = class {
246
276
  cast_as: this.definition.castAs,
247
277
  indexes: indexesForCapabilities(
248
278
  this.definition.capabilities,
249
- this.definition.castAs
279
+ this.definition.castAs,
280
+ orderingForEqlType(this.definition.eqlType)
250
281
  )
251
282
  };
252
283
  }
@@ -257,37 +288,8 @@ var TEXT_SEARCH_DOMAIN = {
257
288
  capabilities: TEXT_SEARCH
258
289
  };
259
290
  var EncryptedTextSearchColumn = class extends EncryptedV3Column {
260
- matchOpts;
261
291
  constructor(columnName) {
262
292
  super(columnName, TEXT_SEARCH_DOMAIN);
263
- this.matchOpts = defaultMatchOpts();
264
- }
265
- /**
266
- * Tune the match index. Each provided key replaces its default; omitted
267
- * keys keep the default. This NEVER enables a capability — match is always
268
- * on for this type. Merge semantics mirror v2's `opts?.x ?? default`.
269
- */
270
- freeTextSearch(opts) {
271
- const defaults = defaultMatchOpts();
272
- this.matchOpts = cloneMatchOpts({
273
- tokenizer: opts?.tokenizer ?? defaults.tokenizer,
274
- token_filters: opts?.token_filters ?? defaults.token_filters,
275
- k: opts?.k ?? defaults.k,
276
- m: opts?.m ?? defaults.m,
277
- include_original: opts?.include_original ?? defaults.include_original
278
- });
279
- return this;
280
- }
281
- /** Emit the encrypt-config column. Byte-identical to a v2 equality+order+match column. */
282
- build() {
283
- return {
284
- cast_as: "string",
285
- indexes: {
286
- unique: { token_filters: [] },
287
- ore: {},
288
- match: cloneMatchOpts(this.matchOpts)
289
- }
290
- };
291
293
  }
292
294
  };
293
295
  var EncryptedIntegerColumn = class extends EncryptedV3Column {
@@ -306,6 +308,14 @@ var EncryptedSmallintOrdOreColumn = class extends EncryptedV3Column {
306
308
  };
307
309
  var EncryptedSmallintOrdColumn = class extends EncryptedV3Column {
308
310
  };
311
+ var EncryptedBigintColumn = class extends EncryptedV3Column {
312
+ };
313
+ var EncryptedBigintEqColumn = class extends EncryptedV3Column {
314
+ };
315
+ var EncryptedBigintOrdOreColumn = class extends EncryptedV3Column {
316
+ };
317
+ var EncryptedBigintOrdColumn = class extends EncryptedV3Column {
318
+ };
309
319
  var EncryptedDateColumn = class extends EncryptedV3Column {
310
320
  };
311
321
  var EncryptedDateEqColumn = class extends EncryptedV3Column {
@@ -358,43 +368,86 @@ var EncryptedDoubleOrdOreColumn = class extends EncryptedV3Column {
358
368
  };
359
369
  var EncryptedDoubleOrdColumn = class extends EncryptedV3Column {
360
370
  };
371
+ var JSON_DOMAIN = {
372
+ eqlType: "public.eql_v3_json",
373
+ castAs: "json",
374
+ capabilities: {
375
+ equality: false,
376
+ orderAndRange: false,
377
+ freeTextSearch: false,
378
+ searchableJson: true
379
+ }
380
+ };
381
+ var EncryptedJsonColumn = class extends EncryptedV3Column {
382
+ constructor(columnName) {
383
+ super(columnName, JSON_DOMAIN);
384
+ }
385
+ };
386
+
387
+ // src/eql/v3/types.ts
388
+ var types = {
389
+ // integer
390
+ Integer: (name) => new EncryptedIntegerColumn(name, INTEGER),
391
+ IntegerEq: (name) => new EncryptedIntegerEqColumn(name, INTEGER_EQ),
392
+ IntegerOrdOre: (name) => new EncryptedIntegerOrdOreColumn(name, INTEGER_ORD_ORE),
393
+ IntegerOrd: (name) => new EncryptedIntegerOrdColumn(name, INTEGER_ORD),
394
+ // smallint
395
+ Smallint: (name) => new EncryptedSmallintColumn(name, SMALLINT),
396
+ SmallintEq: (name) => new EncryptedSmallintEqColumn(name, SMALLINT_EQ),
397
+ SmallintOrdOre: (name) => new EncryptedSmallintOrdOreColumn(name, SMALLINT_ORD_ORE),
398
+ SmallintOrd: (name) => new EncryptedSmallintOrdColumn(name, SMALLINT_ORD),
399
+ // bigint (int8) — plaintext is a JS `bigint`, round-tripped losslessly by
400
+ // the native protect-ffi boundary (see ./columns)
401
+ Bigint: (name) => new EncryptedBigintColumn(name, BIGINT),
402
+ BigintEq: (name) => new EncryptedBigintEqColumn(name, BIGINT_EQ),
403
+ BigintOrdOre: (name) => new EncryptedBigintOrdOreColumn(name, BIGINT_ORD_ORE),
404
+ BigintOrd: (name) => new EncryptedBigintOrdColumn(name, BIGINT_ORD),
405
+ // date
406
+ Date: (name) => new EncryptedDateColumn(name, DATE),
407
+ DateEq: (name) => new EncryptedDateEqColumn(name, DATE_EQ),
408
+ DateOrdOre: (name) => new EncryptedDateOrdOreColumn(name, DATE_ORD_ORE),
409
+ DateOrd: (name) => new EncryptedDateOrdColumn(name, DATE_ORD),
410
+ // timestamp
411
+ Timestamp: (name) => new EncryptedTimestampColumn(name, TIMESTAMP),
412
+ TimestampEq: (name) => new EncryptedTimestampEqColumn(name, TIMESTAMP_EQ),
413
+ TimestampOrdOre: (name) => new EncryptedTimestampOrdOreColumn(name, TIMESTAMP_ORD_ORE),
414
+ TimestampOrd: (name) => new EncryptedTimestampOrdColumn(name, TIMESTAMP_ORD),
415
+ // numeric
416
+ Numeric: (name) => new EncryptedNumericColumn(name, NUMERIC),
417
+ NumericEq: (name) => new EncryptedNumericEqColumn(name, NUMERIC_EQ),
418
+ NumericOrdOre: (name) => new EncryptedNumericOrdOreColumn(name, NUMERIC_ORD_ORE),
419
+ NumericOrd: (name) => new EncryptedNumericOrdColumn(name, NUMERIC_ORD),
420
+ // text
421
+ Text: (name) => new EncryptedTextColumn(name, TEXT),
422
+ TextEq: (name) => new EncryptedTextEqColumn(name, TEXT_EQ),
423
+ TextMatch: (name) => new EncryptedTextMatchColumn(name, TEXT_MATCH),
424
+ TextOrdOre: (name) => new EncryptedTextOrdOreColumn(name, TEXT_ORD_ORE),
425
+ TextOrd: (name) => new EncryptedTextOrdColumn(name, TEXT_ORD),
426
+ TextSearch: (name) => new EncryptedTextSearchColumn(name),
427
+ // boolean
428
+ Boolean: (name) => new EncryptedBooleanColumn(name, BOOLEAN),
429
+ // real
430
+ Real: (name) => new EncryptedRealColumn(name, REAL),
431
+ RealEq: (name) => new EncryptedRealEqColumn(name, REAL_EQ),
432
+ RealOrdOre: (name) => new EncryptedRealOrdOreColumn(name, REAL_ORD_ORE),
433
+ RealOrd: (name) => new EncryptedRealOrdColumn(name, REAL_ORD),
434
+ // double
435
+ Double: (name) => new EncryptedDoubleColumn(name, DOUBLE),
436
+ DoubleEq: (name) => new EncryptedDoubleEqColumn(name, DOUBLE_EQ),
437
+ DoubleOrdOre: (name) => new EncryptedDoubleOrdOreColumn(name, DOUBLE_ORD_ORE),
438
+ DoubleOrd: (name) => new EncryptedDoubleOrdColumn(name, DOUBLE_ORD),
439
+ // json (encrypted JSONB document, ste_vec containment)
440
+ Json: (name) => new EncryptedJsonColumn(name)
441
+ // `satisfies` is load-bearing, not decoration: `DOMAIN_REGISTRY` derives itself
442
+ // by calling every value here at module load. A non-factory export would throw
443
+ // during module evaluation and take the supabase introspect/schema-build/verify
444
+ // path down with it. This turns that into a compile error at the offending line.
445
+ // `as const` applies first, so literal key inference is preserved.
446
+ };
361
447
 
362
448
  export {
449
+ DATE_LIKE_CASTS,
363
450
  TEXT_SEARCH_EQL_TYPE,
364
- INTEGER,
365
- INTEGER_EQ,
366
- INTEGER_ORD_ORE,
367
- INTEGER_ORD,
368
- SMALLINT,
369
- SMALLINT_EQ,
370
- SMALLINT_ORD_ORE,
371
- SMALLINT_ORD,
372
- DATE,
373
- DATE_EQ,
374
- DATE_ORD_ORE,
375
- DATE_ORD,
376
- TIMESTAMP,
377
- TIMESTAMP_EQ,
378
- TIMESTAMP_ORD_ORE,
379
- TIMESTAMP_ORD,
380
- NUMERIC,
381
- NUMERIC_EQ,
382
- NUMERIC_ORD_ORE,
383
- NUMERIC_ORD,
384
- TEXT,
385
- TEXT_EQ,
386
- TEXT_MATCH,
387
- TEXT_ORD_ORE,
388
- TEXT_ORD,
389
- BOOLEAN,
390
- REAL,
391
- REAL_EQ,
392
- REAL_ORD_ORE,
393
- REAL_ORD,
394
- DOUBLE,
395
- DOUBLE_EQ,
396
- DOUBLE_ORD_ORE,
397
- DOUBLE_ORD,
398
451
  EncryptedV3Column,
399
452
  EncryptedTextSearchColumn,
400
453
  EncryptedIntegerColumn,
@@ -405,6 +458,10 @@ export {
405
458
  EncryptedSmallintEqColumn,
406
459
  EncryptedSmallintOrdOreColumn,
407
460
  EncryptedSmallintOrdColumn,
461
+ EncryptedBigintColumn,
462
+ EncryptedBigintEqColumn,
463
+ EncryptedBigintOrdOreColumn,
464
+ EncryptedBigintOrdColumn,
408
465
  EncryptedDateColumn,
409
466
  EncryptedDateEqColumn,
410
467
  EncryptedDateOrdOreColumn,
@@ -430,6 +487,8 @@ export {
430
487
  EncryptedDoubleColumn,
431
488
  EncryptedDoubleEqColumn,
432
489
  EncryptedDoubleOrdOreColumn,
433
- EncryptedDoubleOrdColumn
490
+ EncryptedDoubleOrdColumn,
491
+ EncryptedJsonColumn,
492
+ types
434
493
  };
435
- //# sourceMappingURL=chunk-U66S7VIF.js.map
494
+ //# sourceMappingURL=chunk-6SGN52W6.js.map