@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
package/dist/drizzle/index.d.cts
CHANGED
|
@@ -1,43 +1,14 @@
|
|
|
1
1
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
2
2
|
import { PgTable, PgCustomColumn } from 'drizzle-orm/pg-core';
|
|
3
|
-
import {
|
|
4
|
-
import { a as EncryptionClient } from '../client-Dt98Rugc.cjs';
|
|
3
|
+
import { g as EncryptedTable, k as EncryptedColumn, l as CastAs, M as MatchIndexOpts, T as TokenFilter } from '../types-public-CpS5KjwX.cjs';
|
|
5
4
|
import { SQLWrapper, SQL, exists, notExists, isNull, isNotNull, not, arrayContains, arrayContained, arrayOverlaps } from 'drizzle-orm';
|
|
6
|
-
import '
|
|
5
|
+
import { e as EncryptionClient } from '../client-DSGHBN-g.cjs';
|
|
7
6
|
import '@cipherstash/protect-ffi';
|
|
8
|
-
import '
|
|
7
|
+
import 'zod';
|
|
9
8
|
import '@byteslice/result';
|
|
9
|
+
import '../errors/index.cjs';
|
|
10
10
|
import '../identity/index.cjs';
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* Extracts the encrypted column keys from a Drizzle table type.
|
|
14
|
-
* Columns created with `encryptedType` are `PgCustomColumn` instances;
|
|
15
|
-
* this picks only those keys and maps them to `EncryptedColumn`.
|
|
16
|
-
*/
|
|
17
|
-
type DrizzleEncryptedSchema<T> = {
|
|
18
|
-
[K in keyof T as T[K] extends PgCustomColumn<any> ? K : never]: EncryptedColumn;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Extracts an encryption schema from a Drizzle table definition.
|
|
22
|
-
* This function identifies columns created with `encryptedType` and
|
|
23
|
-
* builds a corresponding `EncryptedTable` with `encryptedColumn` definitions.
|
|
24
|
-
*
|
|
25
|
-
* @param table - The Drizzle table definition
|
|
26
|
-
* @returns A EncryptedTable that can be used with encryption client initialization
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```ts
|
|
30
|
-
* const drizzleUsersTable = pgTable('users', {
|
|
31
|
-
* email: encryptedType('email', { freeTextSearch: true, equality: true }),
|
|
32
|
-
* age: encryptedType('age', { dataType: 'number', orderAndRange: true }),
|
|
33
|
-
* })
|
|
34
|
-
*
|
|
35
|
-
* const encryptionSchema = extractEncryptionSchema(drizzleUsersTable)
|
|
36
|
-
* const client = await createEncryptionClient({ schemas: [encryptionSchema.build()] })
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
declare function extractEncryptionSchema<T extends PgTable<any>>(table: T): EncryptedTable<DrizzleEncryptedSchema<T>> & DrizzleEncryptedSchema<T>;
|
|
40
|
-
|
|
41
12
|
/**
|
|
42
13
|
* Custom error types for better debugging
|
|
43
14
|
*/
|
|
@@ -265,6 +236,35 @@ declare function createEncryptionOperators(encryptionClient: EncryptionClient):
|
|
|
265
236
|
arrayOverlaps: typeof arrayOverlaps;
|
|
266
237
|
};
|
|
267
238
|
|
|
239
|
+
/**
|
|
240
|
+
* Extracts the encrypted column keys from a Drizzle table type.
|
|
241
|
+
* Columns created with `encryptedType` are `PgCustomColumn` instances;
|
|
242
|
+
* this picks only those keys and maps them to `EncryptedColumn`.
|
|
243
|
+
*/
|
|
244
|
+
type DrizzleEncryptedSchema<T> = {
|
|
245
|
+
[K in keyof T as T[K] extends PgCustomColumn<any> ? K : never]: EncryptedColumn;
|
|
246
|
+
};
|
|
247
|
+
/**
|
|
248
|
+
* Extracts an encryption schema from a Drizzle table definition.
|
|
249
|
+
* This function identifies columns created with `encryptedType` and
|
|
250
|
+
* builds a corresponding `EncryptedTable` with `encryptedColumn` definitions.
|
|
251
|
+
*
|
|
252
|
+
* @param table - The Drizzle table definition
|
|
253
|
+
* @returns A EncryptedTable that can be used with encryption client initialization
|
|
254
|
+
*
|
|
255
|
+
* @example
|
|
256
|
+
* ```ts
|
|
257
|
+
* const drizzleUsersTable = pgTable('users', {
|
|
258
|
+
* email: encryptedType('email', { freeTextSearch: true, equality: true }),
|
|
259
|
+
* age: encryptedType('age', { dataType: 'number', orderAndRange: true }),
|
|
260
|
+
* })
|
|
261
|
+
*
|
|
262
|
+
* const encryptionSchema = extractEncryptionSchema(drizzleUsersTable)
|
|
263
|
+
* const client = await createEncryptionClient({ schemas: [encryptionSchema.build()] })
|
|
264
|
+
* ```
|
|
265
|
+
*/
|
|
266
|
+
declare function extractEncryptionSchema<T extends PgTable<any>>(table: T): EncryptedTable<DrizzleEncryptedSchema<T>> & DrizzleEncryptedSchema<T>;
|
|
267
|
+
|
|
268
268
|
/**
|
|
269
269
|
* Configuration for encrypted column indexes and data types
|
|
270
270
|
*/
|
package/dist/drizzle/index.d.ts
CHANGED
|
@@ -1,43 +1,14 @@
|
|
|
1
1
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
2
2
|
import { PgTable, PgCustomColumn } from 'drizzle-orm/pg-core';
|
|
3
|
-
import {
|
|
4
|
-
import { a as EncryptionClient } from '../client-CIsfZ2zg.js';
|
|
3
|
+
import { g as EncryptedTable, k as EncryptedColumn, l as CastAs, M as MatchIndexOpts, T as TokenFilter } from '../types-public-CpS5KjwX.js';
|
|
5
4
|
import { SQLWrapper, SQL, exists, notExists, isNull, isNotNull, not, arrayContains, arrayContained, arrayOverlaps } from 'drizzle-orm';
|
|
6
|
-
import '
|
|
5
|
+
import { e as EncryptionClient } from '../client-DfCrlHXh.js';
|
|
7
6
|
import '@cipherstash/protect-ffi';
|
|
8
|
-
import '
|
|
7
|
+
import 'zod';
|
|
9
8
|
import '@byteslice/result';
|
|
9
|
+
import '../errors/index.js';
|
|
10
10
|
import '../identity/index.js';
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* Extracts the encrypted column keys from a Drizzle table type.
|
|
14
|
-
* Columns created with `encryptedType` are `PgCustomColumn` instances;
|
|
15
|
-
* this picks only those keys and maps them to `EncryptedColumn`.
|
|
16
|
-
*/
|
|
17
|
-
type DrizzleEncryptedSchema<T> = {
|
|
18
|
-
[K in keyof T as T[K] extends PgCustomColumn<any> ? K : never]: EncryptedColumn;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Extracts an encryption schema from a Drizzle table definition.
|
|
22
|
-
* This function identifies columns created with `encryptedType` and
|
|
23
|
-
* builds a corresponding `EncryptedTable` with `encryptedColumn` definitions.
|
|
24
|
-
*
|
|
25
|
-
* @param table - The Drizzle table definition
|
|
26
|
-
* @returns A EncryptedTable that can be used with encryption client initialization
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```ts
|
|
30
|
-
* const drizzleUsersTable = pgTable('users', {
|
|
31
|
-
* email: encryptedType('email', { freeTextSearch: true, equality: true }),
|
|
32
|
-
* age: encryptedType('age', { dataType: 'number', orderAndRange: true }),
|
|
33
|
-
* })
|
|
34
|
-
*
|
|
35
|
-
* const encryptionSchema = extractEncryptionSchema(drizzleUsersTable)
|
|
36
|
-
* const client = await createEncryptionClient({ schemas: [encryptionSchema.build()] })
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
declare function extractEncryptionSchema<T extends PgTable<any>>(table: T): EncryptedTable<DrizzleEncryptedSchema<T>> & DrizzleEncryptedSchema<T>;
|
|
40
|
-
|
|
41
12
|
/**
|
|
42
13
|
* Custom error types for better debugging
|
|
43
14
|
*/
|
|
@@ -265,6 +236,35 @@ declare function createEncryptionOperators(encryptionClient: EncryptionClient):
|
|
|
265
236
|
arrayOverlaps: typeof arrayOverlaps;
|
|
266
237
|
};
|
|
267
238
|
|
|
239
|
+
/**
|
|
240
|
+
* Extracts the encrypted column keys from a Drizzle table type.
|
|
241
|
+
* Columns created with `encryptedType` are `PgCustomColumn` instances;
|
|
242
|
+
* this picks only those keys and maps them to `EncryptedColumn`.
|
|
243
|
+
*/
|
|
244
|
+
type DrizzleEncryptedSchema<T> = {
|
|
245
|
+
[K in keyof T as T[K] extends PgCustomColumn<any> ? K : never]: EncryptedColumn;
|
|
246
|
+
};
|
|
247
|
+
/**
|
|
248
|
+
* Extracts an encryption schema from a Drizzle table definition.
|
|
249
|
+
* This function identifies columns created with `encryptedType` and
|
|
250
|
+
* builds a corresponding `EncryptedTable` with `encryptedColumn` definitions.
|
|
251
|
+
*
|
|
252
|
+
* @param table - The Drizzle table definition
|
|
253
|
+
* @returns A EncryptedTable that can be used with encryption client initialization
|
|
254
|
+
*
|
|
255
|
+
* @example
|
|
256
|
+
* ```ts
|
|
257
|
+
* const drizzleUsersTable = pgTable('users', {
|
|
258
|
+
* email: encryptedType('email', { freeTextSearch: true, equality: true }),
|
|
259
|
+
* age: encryptedType('age', { dataType: 'number', orderAndRange: true }),
|
|
260
|
+
* })
|
|
261
|
+
*
|
|
262
|
+
* const encryptionSchema = extractEncryptionSchema(drizzleUsersTable)
|
|
263
|
+
* const client = await createEncryptionClient({ schemas: [encryptionSchema.build()] })
|
|
264
|
+
* ```
|
|
265
|
+
*/
|
|
266
|
+
declare function extractEncryptionSchema<T extends PgTable<any>>(table: T): EncryptedTable<DrizzleEncryptedSchema<T>> & DrizzleEncryptedSchema<T>;
|
|
267
|
+
|
|
268
268
|
/**
|
|
269
269
|
* Configuration for encrypted column indexes and data types
|
|
270
270
|
*/
|
package/dist/drizzle/index.js
CHANGED
|
@@ -1,14 +1,47 @@
|
|
|
1
1
|
import {
|
|
2
2
|
encryptedColumn,
|
|
3
3
|
encryptedTable
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-MP3SSDNN.js";
|
|
5
|
+
import "../chunk-IADZCZEA.js";
|
|
5
6
|
import {
|
|
6
7
|
queryTypes
|
|
7
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-4AVL4VZD.js";
|
|
9
|
+
import "../chunk-PZ5AY32C.js";
|
|
8
10
|
|
|
9
11
|
// src/drizzle/index.ts
|
|
10
12
|
import { customType } from "drizzle-orm/pg-core";
|
|
11
13
|
|
|
14
|
+
// src/drizzle/operators.ts
|
|
15
|
+
import {
|
|
16
|
+
and,
|
|
17
|
+
arrayContained,
|
|
18
|
+
arrayContains,
|
|
19
|
+
arrayOverlaps,
|
|
20
|
+
asc,
|
|
21
|
+
between,
|
|
22
|
+
bindIfParam,
|
|
23
|
+
desc,
|
|
24
|
+
eq,
|
|
25
|
+
exists,
|
|
26
|
+
gt,
|
|
27
|
+
gte,
|
|
28
|
+
ilike,
|
|
29
|
+
inArray,
|
|
30
|
+
isNotNull,
|
|
31
|
+
isNull,
|
|
32
|
+
like,
|
|
33
|
+
lt,
|
|
34
|
+
lte,
|
|
35
|
+
ne,
|
|
36
|
+
not,
|
|
37
|
+
notBetween,
|
|
38
|
+
notExists,
|
|
39
|
+
notIlike,
|
|
40
|
+
notInArray,
|
|
41
|
+
or,
|
|
42
|
+
sql
|
|
43
|
+
} from "drizzle-orm";
|
|
44
|
+
|
|
12
45
|
// src/drizzle/schema-extraction.ts
|
|
13
46
|
function extractEncryptionSchema(table) {
|
|
14
47
|
const tableName = table[/* @__PURE__ */ Symbol.for("drizzle:Name")];
|
|
@@ -66,34 +99,6 @@ function extractEncryptionSchema(table) {
|
|
|
66
99
|
}
|
|
67
100
|
|
|
68
101
|
// src/drizzle/operators.ts
|
|
69
|
-
import {
|
|
70
|
-
and,
|
|
71
|
-
arrayContained,
|
|
72
|
-
arrayContains,
|
|
73
|
-
arrayOverlaps,
|
|
74
|
-
asc,
|
|
75
|
-
between,
|
|
76
|
-
desc,
|
|
77
|
-
eq,
|
|
78
|
-
exists,
|
|
79
|
-
gt,
|
|
80
|
-
gte,
|
|
81
|
-
ilike,
|
|
82
|
-
inArray,
|
|
83
|
-
isNotNull,
|
|
84
|
-
isNull,
|
|
85
|
-
like,
|
|
86
|
-
lt,
|
|
87
|
-
lte,
|
|
88
|
-
ne,
|
|
89
|
-
not,
|
|
90
|
-
notBetween,
|
|
91
|
-
notExists,
|
|
92
|
-
notIlike,
|
|
93
|
-
notInArray,
|
|
94
|
-
or
|
|
95
|
-
} from "drizzle-orm";
|
|
96
|
-
import { bindIfParam, sql } from "drizzle-orm";
|
|
97
102
|
function isSQLWrapper(value) {
|
|
98
103
|
return typeof value === "object" && value !== null && "sql" in value && typeof value.sql !== "undefined";
|
|
99
104
|
}
|