@cipherstash/stack 0.1.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 +7 -0
- package/LICENSE.md +21 -0
- package/README.md +670 -0
- package/dist/bin/stash.js +5049 -0
- package/dist/bin/stash.js.map +1 -0
- package/dist/chunk-2GZMIJFO.js +2400 -0
- package/dist/chunk-2GZMIJFO.js.map +1 -0
- package/dist/chunk-5DCT6YU2.js +138 -0
- package/dist/chunk-5DCT6YU2.js.map +1 -0
- package/dist/chunk-7XRPN2KX.js +336 -0
- package/dist/chunk-7XRPN2KX.js.map +1 -0
- package/dist/chunk-SJ7JO4ME.js +28 -0
- package/dist/chunk-SJ7JO4ME.js.map +1 -0
- package/dist/chunk-SUYMGQBY.js +67 -0
- package/dist/chunk-SUYMGQBY.js.map +1 -0
- package/dist/client-BxJG56Ey.d.cts +647 -0
- package/dist/client-DtGq9dJp.d.ts +647 -0
- package/dist/client.cjs +347 -0
- package/dist/client.cjs.map +1 -0
- package/dist/client.d.cts +7 -0
- package/dist/client.d.ts +7 -0
- package/dist/client.js +11 -0
- package/dist/client.js.map +1 -0
- package/dist/drizzle/index.cjs +1528 -0
- package/dist/drizzle/index.cjs.map +1 -0
- package/dist/drizzle/index.d.cts +350 -0
- package/dist/drizzle/index.d.ts +350 -0
- package/dist/drizzle/index.js +1212 -0
- package/dist/drizzle/index.js.map +1 -0
- package/dist/dynamodb/index.cjs +382 -0
- package/dist/dynamodb/index.cjs.map +1 -0
- package/dist/dynamodb/index.d.cts +125 -0
- package/dist/dynamodb/index.d.ts +125 -0
- package/dist/dynamodb/index.js +355 -0
- package/dist/dynamodb/index.js.map +1 -0
- package/dist/identity/index.cjs +271 -0
- package/dist/identity/index.cjs.map +1 -0
- package/dist/identity/index.d.cts +3 -0
- package/dist/identity/index.d.ts +3 -0
- package/dist/identity/index.js +117 -0
- package/dist/identity/index.js.map +1 -0
- package/dist/index-9-Ya3fDK.d.cts +169 -0
- package/dist/index-9-Ya3fDK.d.ts +169 -0
- package/dist/index.cjs +2915 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +22 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/schema/index.cjs +368 -0
- package/dist/schema/index.cjs.map +1 -0
- package/dist/schema/index.d.cts +4 -0
- package/dist/schema/index.d.ts +4 -0
- package/dist/schema/index.js +23 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/secrets/index.cjs +3207 -0
- package/dist/secrets/index.cjs.map +1 -0
- package/dist/secrets/index.d.cts +227 -0
- package/dist/secrets/index.d.ts +227 -0
- package/dist/secrets/index.js +323 -0
- package/dist/secrets/index.js.map +1 -0
- package/dist/supabase/index.cjs +1113 -0
- package/dist/supabase/index.cjs.map +1 -0
- package/dist/supabase/index.d.cts +144 -0
- package/dist/supabase/index.d.ts +144 -0
- package/dist/supabase/index.js +864 -0
- package/dist/supabase/index.js.map +1 -0
- package/dist/types-public-BCj1L4fi.d.cts +1013 -0
- package/dist/types-public-BCj1L4fi.d.ts +1013 -0
- package/dist/types-public.cjs +40 -0
- package/dist/types-public.cjs.map +1 -0
- package/dist/types-public.d.cts +4 -0
- package/dist/types-public.d.ts +4 -0
- package/dist/types-public.js +7 -0
- package/dist/types-public.js.map +1 -0
- package/package.json +202 -0
package/dist/client.cjs
ADDED
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/client.ts
|
|
21
|
+
var client_exports = {};
|
|
22
|
+
__export(client_exports, {
|
|
23
|
+
encryptedColumn: () => encryptedColumn,
|
|
24
|
+
encryptedTable: () => encryptedTable,
|
|
25
|
+
encryptedValue: () => encryptedValue
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(client_exports);
|
|
28
|
+
|
|
29
|
+
// src/schema/index.ts
|
|
30
|
+
var import_zod = require("zod");
|
|
31
|
+
var castAsEnum = import_zod.z.enum(["bigint", "boolean", "date", "number", "string", "json"]).default("string");
|
|
32
|
+
var tokenFilterSchema = import_zod.z.object({
|
|
33
|
+
kind: import_zod.z.literal("downcase")
|
|
34
|
+
});
|
|
35
|
+
var tokenizerSchema = import_zod.z.union([
|
|
36
|
+
import_zod.z.object({
|
|
37
|
+
kind: import_zod.z.literal("standard")
|
|
38
|
+
}),
|
|
39
|
+
import_zod.z.object({
|
|
40
|
+
kind: import_zod.z.literal("ngram"),
|
|
41
|
+
token_length: import_zod.z.number()
|
|
42
|
+
})
|
|
43
|
+
]).default({ kind: "ngram", token_length: 3 }).optional();
|
|
44
|
+
var oreIndexOptsSchema = import_zod.z.object({});
|
|
45
|
+
var uniqueIndexOptsSchema = import_zod.z.object({
|
|
46
|
+
token_filters: import_zod.z.array(tokenFilterSchema).default([]).optional()
|
|
47
|
+
});
|
|
48
|
+
var matchIndexOptsSchema = import_zod.z.object({
|
|
49
|
+
tokenizer: tokenizerSchema,
|
|
50
|
+
token_filters: import_zod.z.array(tokenFilterSchema).default([]).optional(),
|
|
51
|
+
k: import_zod.z.number().default(6).optional(),
|
|
52
|
+
m: import_zod.z.number().default(2048).optional(),
|
|
53
|
+
include_original: import_zod.z.boolean().default(false).optional()
|
|
54
|
+
});
|
|
55
|
+
var steVecIndexOptsSchema = import_zod.z.object({
|
|
56
|
+
prefix: import_zod.z.string()
|
|
57
|
+
});
|
|
58
|
+
var indexesSchema = import_zod.z.object({
|
|
59
|
+
ore: oreIndexOptsSchema.optional(),
|
|
60
|
+
unique: uniqueIndexOptsSchema.optional(),
|
|
61
|
+
match: matchIndexOptsSchema.optional(),
|
|
62
|
+
ste_vec: steVecIndexOptsSchema.optional()
|
|
63
|
+
}).default({});
|
|
64
|
+
var columnSchema = import_zod.z.object({
|
|
65
|
+
cast_as: castAsEnum,
|
|
66
|
+
indexes: indexesSchema
|
|
67
|
+
}).default({});
|
|
68
|
+
var tableSchema = import_zod.z.record(columnSchema).default({});
|
|
69
|
+
var tablesSchema = import_zod.z.record(tableSchema).default({});
|
|
70
|
+
var encryptConfigSchema = import_zod.z.object({
|
|
71
|
+
v: import_zod.z.number(),
|
|
72
|
+
tables: tablesSchema
|
|
73
|
+
});
|
|
74
|
+
var ProtectValue = class {
|
|
75
|
+
valueName;
|
|
76
|
+
castAsValue;
|
|
77
|
+
constructor(valueName) {
|
|
78
|
+
this.valueName = valueName;
|
|
79
|
+
this.castAsValue = "string";
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Set or override the plaintext data type for this value.
|
|
83
|
+
*
|
|
84
|
+
* By default all values are treated as `'string'`. Use this method to specify
|
|
85
|
+
* a different type so the encryption layer knows how to encode the plaintext
|
|
86
|
+
* before encrypting.
|
|
87
|
+
*
|
|
88
|
+
* @param castAs - The plaintext data type: `'string'`, `'number'`, `'boolean'`, `'date'`, `'bigint'`, or `'json'`.
|
|
89
|
+
* @returns This `ProtectValue` instance for method chaining.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```typescript
|
|
93
|
+
* import { encryptedValue } from "@cipherstash/stack/schema"
|
|
94
|
+
*
|
|
95
|
+
* const age = encryptedValue("age").dataType("number")
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
dataType(castAs) {
|
|
99
|
+
this.castAsValue = castAs;
|
|
100
|
+
return this;
|
|
101
|
+
}
|
|
102
|
+
build() {
|
|
103
|
+
return {
|
|
104
|
+
cast_as: this.castAsValue,
|
|
105
|
+
indexes: {}
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
getName() {
|
|
109
|
+
return this.valueName;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
var ProtectColumn = class {
|
|
113
|
+
columnName;
|
|
114
|
+
castAsValue;
|
|
115
|
+
indexesValue = {};
|
|
116
|
+
constructor(columnName) {
|
|
117
|
+
this.columnName = columnName;
|
|
118
|
+
this.castAsValue = "string";
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Set or override the plaintext data type for this column.
|
|
122
|
+
*
|
|
123
|
+
* By default all columns are treated as `'string'`. Use this method to specify
|
|
124
|
+
* a different type so the encryption layer knows how to encode the plaintext
|
|
125
|
+
* before encrypting.
|
|
126
|
+
*
|
|
127
|
+
* @param castAs - The plaintext data type: `'string'`, `'number'`, `'boolean'`, `'date'`, `'bigint'`, or `'json'`.
|
|
128
|
+
* @returns This `ProtectColumn` instance for method chaining.
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```typescript
|
|
132
|
+
* import { encryptedColumn } from "@cipherstash/stack/schema"
|
|
133
|
+
*
|
|
134
|
+
* const dateOfBirth = encryptedColumn("date_of_birth").dataType("date")
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
dataType(castAs) {
|
|
138
|
+
this.castAsValue = castAs;
|
|
139
|
+
return this;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Enable Order-Revealing Encryption (ORE) indexing on this column.
|
|
143
|
+
*
|
|
144
|
+
* ORE allows sorting, comparison, and range queries on encrypted data.
|
|
145
|
+
* Use with `encryptQuery` and `queryType: 'orderAndRange'`.
|
|
146
|
+
*
|
|
147
|
+
* @returns This `ProtectColumn` instance for method chaining.
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```typescript
|
|
151
|
+
* import { encryptedTable, encryptedColumn } from "@cipherstash/stack/schema"
|
|
152
|
+
*
|
|
153
|
+
* const users = encryptedTable("users", {
|
|
154
|
+
* email: encryptedColumn("email").orderAndRange(),
|
|
155
|
+
* })
|
|
156
|
+
* ```
|
|
157
|
+
*/
|
|
158
|
+
orderAndRange() {
|
|
159
|
+
this.indexesValue.ore = {};
|
|
160
|
+
return this;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Enable an exact-match (unique) index on this column.
|
|
164
|
+
*
|
|
165
|
+
* Allows equality queries on encrypted data. Use with `encryptQuery`
|
|
166
|
+
* and `queryType: 'equality'`.
|
|
167
|
+
*
|
|
168
|
+
* @param tokenFilters - Optional array of token filters (e.g. `[{ kind: 'downcase' }]`).
|
|
169
|
+
* When omitted, no token filters are applied.
|
|
170
|
+
* @returns This `ProtectColumn` instance for method chaining.
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```typescript
|
|
174
|
+
* import { encryptedTable, encryptedColumn } from "@cipherstash/stack/schema"
|
|
175
|
+
*
|
|
176
|
+
* const users = encryptedTable("users", {
|
|
177
|
+
* email: encryptedColumn("email").equality(),
|
|
178
|
+
* })
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
equality(tokenFilters) {
|
|
182
|
+
this.indexesValue.unique = {
|
|
183
|
+
token_filters: tokenFilters ?? []
|
|
184
|
+
};
|
|
185
|
+
return this;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Enable a full-text / fuzzy search (match) index on this column.
|
|
189
|
+
*
|
|
190
|
+
* Uses n-gram tokenization by default for substring and fuzzy matching.
|
|
191
|
+
* Use with `encryptQuery` and `queryType: 'freeTextSearch'`.
|
|
192
|
+
*
|
|
193
|
+
* @param opts - Optional match index configuration. Defaults to 3-character ngram
|
|
194
|
+
* tokenization with a downcase filter, `k=6`, `m=2048`, and `include_original=true`.
|
|
195
|
+
* @returns This `ProtectColumn` instance for method chaining.
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```typescript
|
|
199
|
+
* import { encryptedTable, encryptedColumn } from "@cipherstash/stack/schema"
|
|
200
|
+
*
|
|
201
|
+
* const users = encryptedTable("users", {
|
|
202
|
+
* email: encryptedColumn("email").freeTextSearch(),
|
|
203
|
+
* })
|
|
204
|
+
*
|
|
205
|
+
* // With custom options
|
|
206
|
+
* const posts = encryptedTable("posts", {
|
|
207
|
+
* body: encryptedColumn("body").freeTextSearch({
|
|
208
|
+
* tokenizer: { kind: "ngram", token_length: 4 },
|
|
209
|
+
* k: 8,
|
|
210
|
+
* m: 4096,
|
|
211
|
+
* }),
|
|
212
|
+
* })
|
|
213
|
+
* ```
|
|
214
|
+
*/
|
|
215
|
+
freeTextSearch(opts) {
|
|
216
|
+
this.indexesValue.match = {
|
|
217
|
+
tokenizer: opts?.tokenizer ?? { kind: "ngram", token_length: 3 },
|
|
218
|
+
token_filters: opts?.token_filters ?? [
|
|
219
|
+
{
|
|
220
|
+
kind: "downcase"
|
|
221
|
+
}
|
|
222
|
+
],
|
|
223
|
+
k: opts?.k ?? 6,
|
|
224
|
+
m: opts?.m ?? 2048,
|
|
225
|
+
include_original: opts?.include_original ?? true
|
|
226
|
+
};
|
|
227
|
+
return this;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Configure this column for searchable encrypted JSON (STE-Vec).
|
|
231
|
+
*
|
|
232
|
+
* Enables encrypted JSONPath selector queries (e.g. `'$.user.email'`) and
|
|
233
|
+
* containment queries (e.g. `{ role: 'admin' }`). Automatically sets the
|
|
234
|
+
* data type to `'json'`.
|
|
235
|
+
*
|
|
236
|
+
* When used with `encryptQuery`, the query operation is auto-inferred from
|
|
237
|
+
* the plaintext type: strings become selector queries, objects/arrays become
|
|
238
|
+
* containment queries.
|
|
239
|
+
*
|
|
240
|
+
* @returns This `ProtectColumn` instance for method chaining.
|
|
241
|
+
*
|
|
242
|
+
* @example
|
|
243
|
+
* ```typescript
|
|
244
|
+
* import { encryptedTable, encryptedColumn } from "@cipherstash/stack/schema"
|
|
245
|
+
*
|
|
246
|
+
* const documents = encryptedTable("documents", {
|
|
247
|
+
* metadata: encryptedColumn("metadata").searchableJson(),
|
|
248
|
+
* })
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
searchableJson() {
|
|
252
|
+
this.castAsValue = "json";
|
|
253
|
+
this.indexesValue.ste_vec = { prefix: "enabled" };
|
|
254
|
+
return this;
|
|
255
|
+
}
|
|
256
|
+
build() {
|
|
257
|
+
return {
|
|
258
|
+
cast_as: this.castAsValue,
|
|
259
|
+
indexes: this.indexesValue
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
getName() {
|
|
263
|
+
return this.columnName;
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
var ProtectTable = class {
|
|
267
|
+
constructor(tableName, columnBuilders) {
|
|
268
|
+
this.tableName = tableName;
|
|
269
|
+
this.columnBuilders = columnBuilders;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Compile this table schema into a `TableDefinition` used internally by the encryption client.
|
|
273
|
+
*
|
|
274
|
+
* Iterates over all column builders, calls `.build()` on each, and assembles
|
|
275
|
+
* the final `{ tableName, columns }` structure. For `searchableJson()` columns,
|
|
276
|
+
* the STE-Vec prefix is automatically set to `"<tableName>/<columnName>"`.
|
|
277
|
+
*
|
|
278
|
+
* @returns A `TableDefinition` containing the table name and built column configs.
|
|
279
|
+
*
|
|
280
|
+
* @example
|
|
281
|
+
* ```typescript
|
|
282
|
+
* const users = encryptedTable("users", {
|
|
283
|
+
* email: encryptedColumn("email").equality(),
|
|
284
|
+
* })
|
|
285
|
+
*
|
|
286
|
+
* const definition = users.build()
|
|
287
|
+
* // { tableName: "users", columns: { email: { cast_as: "string", indexes: { unique: ... } } } }
|
|
288
|
+
* ```
|
|
289
|
+
*/
|
|
290
|
+
build() {
|
|
291
|
+
const builtColumns = {};
|
|
292
|
+
const processColumn = (builder, colName) => {
|
|
293
|
+
if (builder instanceof ProtectColumn) {
|
|
294
|
+
const builtColumn = builder.build();
|
|
295
|
+
if (builtColumn.cast_as === "json" && builtColumn.indexes.ste_vec?.prefix === "enabled") {
|
|
296
|
+
builtColumns[colName] = {
|
|
297
|
+
...builtColumn,
|
|
298
|
+
indexes: {
|
|
299
|
+
...builtColumn.indexes,
|
|
300
|
+
ste_vec: {
|
|
301
|
+
prefix: `${this.tableName}/${colName}`
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
} else {
|
|
306
|
+
builtColumns[colName] = builtColumn;
|
|
307
|
+
}
|
|
308
|
+
} else {
|
|
309
|
+
for (const [key, value] of Object.entries(builder)) {
|
|
310
|
+
if (value instanceof ProtectValue) {
|
|
311
|
+
builtColumns[value.getName()] = value.build();
|
|
312
|
+
} else {
|
|
313
|
+
processColumn(value, key);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
for (const [colName, builder] of Object.entries(this.columnBuilders)) {
|
|
319
|
+
processColumn(builder, colName);
|
|
320
|
+
}
|
|
321
|
+
return {
|
|
322
|
+
tableName: this.tableName,
|
|
323
|
+
columns: builtColumns
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
function encryptedTable(tableName, columns) {
|
|
328
|
+
const tableBuilder = new ProtectTable(tableName, columns);
|
|
329
|
+
for (const [colName, colBuilder] of Object.entries(columns)) {
|
|
330
|
+
;
|
|
331
|
+
tableBuilder[colName] = colBuilder;
|
|
332
|
+
}
|
|
333
|
+
return tableBuilder;
|
|
334
|
+
}
|
|
335
|
+
function encryptedColumn(columnName) {
|
|
336
|
+
return new ProtectColumn(columnName);
|
|
337
|
+
}
|
|
338
|
+
function encryptedValue(valueName) {
|
|
339
|
+
return new ProtectValue(valueName);
|
|
340
|
+
}
|
|
341
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
342
|
+
0 && (module.exports = {
|
|
343
|
+
encryptedColumn,
|
|
344
|
+
encryptedTable,
|
|
345
|
+
encryptedValue
|
|
346
|
+
});
|
|
347
|
+
//# sourceMappingURL=client.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/client.ts","../src/schema/index.ts"],"sourcesContent":["/**\n * Client-safe exports for `@cipherstash/stack`.\n *\n * This entry point exports types and utilities that can be used in client-side code\n * without requiring the `@cipherstash/protect-ffi` native module.\n *\n * Use this import path: `@cipherstash/stack/client`\n *\n * `EncryptionClient` is exported as a **type-only** export for use in function\n * signatures without pulling in the native FFI dependency.\n */\n\n// Schema types and utilities - client-safe\nexport { encryptedTable, encryptedColumn, encryptedValue } from '@/schema'\nexport type {\n ProtectColumn,\n ProtectTable,\n ProtectTableColumn,\n ProtectValue,\n InferPlaintext,\n InferEncrypted,\n} from '@/schema'\nexport type { EncryptionClient } from '@/encryption/ffi'\n","import type { Encrypted } from '@/types'\nimport { z } from 'zod'\n\n// ------------------------\n// Zod schemas\n// ------------------------\n\n/**\n * Allowed cast types for CipherStash schema fields.\n *\n * **Possible values:**\n * - `\"bigint\"`\n * - `\"boolean\"`\n * - `\"date\"`\n * - `\"number\"`\n * - `\"string\"`\n * - `\"json\"`\n *\n * @remarks\n * This is a Zod enum used at runtime to validate schema definitions.\n * Use {@link CastAs} when typing your own code.\n *\n * @internal\n */\nexport const castAsEnum = z\n .enum(['bigint', 'boolean', 'date', 'number', 'string', 'json'])\n .default('string')\n\nconst tokenFilterSchema = z.object({\n kind: z.literal('downcase'),\n})\n\nconst tokenizerSchema = z\n .union([\n z.object({\n kind: z.literal('standard'),\n }),\n z.object({\n kind: z.literal('ngram'),\n token_length: z.number(),\n }),\n ])\n .default({ kind: 'ngram', token_length: 3 })\n .optional()\n\nconst oreIndexOptsSchema = z.object({})\n\nconst uniqueIndexOptsSchema = z.object({\n token_filters: z.array(tokenFilterSchema).default([]).optional(),\n})\n\nconst matchIndexOptsSchema = z.object({\n tokenizer: tokenizerSchema,\n token_filters: z.array(tokenFilterSchema).default([]).optional(),\n k: z.number().default(6).optional(),\n m: z.number().default(2048).optional(),\n include_original: z.boolean().default(false).optional(),\n})\n\nconst steVecIndexOptsSchema = z.object({\n prefix: z.string(),\n})\n\nconst indexesSchema = z\n .object({\n ore: oreIndexOptsSchema.optional(),\n unique: uniqueIndexOptsSchema.optional(),\n match: matchIndexOptsSchema.optional(),\n ste_vec: steVecIndexOptsSchema.optional(),\n })\n .default({})\n\nconst columnSchema = z\n .object({\n cast_as: castAsEnum,\n indexes: indexesSchema,\n })\n .default({})\n\nconst tableSchema = z.record(columnSchema).default({})\n\nconst tablesSchema = z.record(tableSchema).default({})\n\n/** @internal */\nexport const encryptConfigSchema = z.object({\n v: z.number(),\n tables: tablesSchema,\n})\n\n// ------------------------\n// Type definitions\n// ------------------------\n\n/**\n * Type-safe alias for {@link castAsEnum} used to specify the *unencrypted* data type of a column or value.\n * This is important because once encrypted, all data is stored as binary blobs.\n *\n * @see {@link castAsEnum} for possible values.\n */\nexport type CastAs = z.infer<typeof castAsEnum>\nexport type TokenFilter = z.infer<typeof tokenFilterSchema>\nexport type MatchIndexOpts = z.infer<typeof matchIndexOptsSchema>\nexport type SteVecIndexOpts = z.infer<typeof steVecIndexOptsSchema>\nexport type UniqueIndexOpts = z.infer<typeof uniqueIndexOptsSchema>\nexport type OreIndexOpts = z.infer<typeof oreIndexOptsSchema>\nexport type ColumnSchema = z.infer<typeof columnSchema>\n\nexport type ProtectTableColumn = {\n [key: string]:\n | ProtectColumn\n | {\n [key: string]:\n | ProtectValue\n | {\n [key: string]:\n | ProtectValue\n | {\n [key: string]: ProtectValue\n }\n }\n }\n}\nexport type EncryptConfig = z.infer<typeof encryptConfigSchema>\n\n// ------------------------\n// Interface definitions\n// ------------------------\nexport class ProtectValue {\n private valueName: string\n private castAsValue: CastAs\n\n constructor(valueName: string) {\n this.valueName = valueName\n this.castAsValue = 'string'\n }\n\n /**\n * Set or override the plaintext data type for this value.\n *\n * By default all values are treated as `'string'`. Use this method to specify\n * a different type so the encryption layer knows how to encode the plaintext\n * before encrypting.\n *\n * @param castAs - The plaintext data type: `'string'`, `'number'`, `'boolean'`, `'date'`, `'bigint'`, or `'json'`.\n * @returns This `ProtectValue` instance for method chaining.\n *\n * @example\n * ```typescript\n * import { encryptedValue } from \"@cipherstash/stack/schema\"\n *\n * const age = encryptedValue(\"age\").dataType(\"number\")\n * ```\n */\n dataType(castAs: CastAs) {\n this.castAsValue = castAs\n return this\n }\n\n build() {\n return {\n cast_as: this.castAsValue,\n indexes: {},\n }\n }\n\n getName() {\n return this.valueName\n }\n}\n\nexport class ProtectColumn {\n private columnName: string\n private castAsValue: CastAs\n private indexesValue: {\n ore?: OreIndexOpts\n unique?: UniqueIndexOpts\n match?: Required<MatchIndexOpts>\n ste_vec?: SteVecIndexOpts\n } = {}\n\n constructor(columnName: string) {\n this.columnName = columnName\n this.castAsValue = 'string'\n }\n\n /**\n * Set or override the plaintext data type for this column.\n *\n * By default all columns are treated as `'string'`. Use this method to specify\n * a different type so the encryption layer knows how to encode the plaintext\n * before encrypting.\n *\n * @param castAs - The plaintext data type: `'string'`, `'number'`, `'boolean'`, `'date'`, `'bigint'`, or `'json'`.\n * @returns This `ProtectColumn` instance for method chaining.\n *\n * @example\n * ```typescript\n * import { encryptedColumn } from \"@cipherstash/stack/schema\"\n *\n * const dateOfBirth = encryptedColumn(\"date_of_birth\").dataType(\"date\")\n * ```\n */\n dataType(castAs: CastAs) {\n this.castAsValue = castAs\n return this\n }\n\n /**\n * Enable Order-Revealing Encryption (ORE) indexing on this column.\n *\n * ORE allows sorting, comparison, and range queries on encrypted data.\n * Use with `encryptQuery` and `queryType: 'orderAndRange'`.\n *\n * @returns This `ProtectColumn` instance for method chaining.\n *\n * @example\n * ```typescript\n * import { encryptedTable, encryptedColumn } from \"@cipherstash/stack/schema\"\n *\n * const users = encryptedTable(\"users\", {\n * email: encryptedColumn(\"email\").orderAndRange(),\n * })\n * ```\n */\n orderAndRange() {\n this.indexesValue.ore = {}\n return this\n }\n\n /**\n * Enable an exact-match (unique) index on this column.\n *\n * Allows equality queries on encrypted data. Use with `encryptQuery`\n * and `queryType: 'equality'`.\n *\n * @param tokenFilters - Optional array of token filters (e.g. `[{ kind: 'downcase' }]`).\n * When omitted, no token filters are applied.\n * @returns This `ProtectColumn` instance for method chaining.\n *\n * @example\n * ```typescript\n * import { encryptedTable, encryptedColumn } from \"@cipherstash/stack/schema\"\n *\n * const users = encryptedTable(\"users\", {\n * email: encryptedColumn(\"email\").equality(),\n * })\n * ```\n */\n equality(tokenFilters?: TokenFilter[]) {\n this.indexesValue.unique = {\n token_filters: tokenFilters ?? [],\n }\n return this\n }\n\n /**\n * Enable a full-text / fuzzy search (match) index on this column.\n *\n * Uses n-gram tokenization by default for substring and fuzzy matching.\n * Use with `encryptQuery` and `queryType: 'freeTextSearch'`.\n *\n * @param opts - Optional match index configuration. Defaults to 3-character ngram\n * tokenization with a downcase filter, `k=6`, `m=2048`, and `include_original=true`.\n * @returns This `ProtectColumn` instance for method chaining.\n *\n * @example\n * ```typescript\n * import { encryptedTable, encryptedColumn } from \"@cipherstash/stack/schema\"\n *\n * const users = encryptedTable(\"users\", {\n * email: encryptedColumn(\"email\").freeTextSearch(),\n * })\n *\n * // With custom options\n * const posts = encryptedTable(\"posts\", {\n * body: encryptedColumn(\"body\").freeTextSearch({\n * tokenizer: { kind: \"ngram\", token_length: 4 },\n * k: 8,\n * m: 4096,\n * }),\n * })\n * ```\n */\n freeTextSearch(opts?: MatchIndexOpts) {\n // Provide defaults\n this.indexesValue.match = {\n tokenizer: opts?.tokenizer ?? { kind: 'ngram', token_length: 3 },\n token_filters: opts?.token_filters ?? [\n {\n kind: 'downcase',\n },\n ],\n k: opts?.k ?? 6,\n m: opts?.m ?? 2048,\n include_original: opts?.include_original ?? true,\n }\n return this\n }\n\n /**\n * Configure this column for searchable encrypted JSON (STE-Vec).\n *\n * Enables encrypted JSONPath selector queries (e.g. `'$.user.email'`) and\n * containment queries (e.g. `{ role: 'admin' }`). Automatically sets the\n * data type to `'json'`.\n *\n * When used with `encryptQuery`, the query operation is auto-inferred from\n * the plaintext type: strings become selector queries, objects/arrays become\n * containment queries.\n *\n * @returns This `ProtectColumn` instance for method chaining.\n *\n * @example\n * ```typescript\n * import { encryptedTable, encryptedColumn } from \"@cipherstash/stack/schema\"\n *\n * const documents = encryptedTable(\"documents\", {\n * metadata: encryptedColumn(\"metadata\").searchableJson(),\n * })\n * ```\n */\n searchableJson() {\n this.castAsValue = 'json'\n this.indexesValue.ste_vec = { prefix: 'enabled' }\n return this\n }\n\n build() {\n return {\n cast_as: this.castAsValue,\n indexes: this.indexesValue,\n }\n }\n\n getName() {\n return this.columnName\n }\n}\n\ninterface TableDefinition {\n tableName: string\n columns: Record<string, ColumnSchema>\n}\n\nexport class ProtectTable<T extends ProtectTableColumn> {\n constructor(\n public readonly tableName: string,\n private readonly columnBuilders: T,\n ) {}\n\n /**\n * Compile this table schema into a `TableDefinition` used internally by the encryption client.\n *\n * Iterates over all column builders, calls `.build()` on each, and assembles\n * the final `{ tableName, columns }` structure. For `searchableJson()` columns,\n * the STE-Vec prefix is automatically set to `\"<tableName>/<columnName>\"`.\n *\n * @returns A `TableDefinition` containing the table name and built column configs.\n *\n * @example\n * ```typescript\n * const users = encryptedTable(\"users\", {\n * email: encryptedColumn(\"email\").equality(),\n * })\n *\n * const definition = users.build()\n * // { tableName: \"users\", columns: { email: { cast_as: \"string\", indexes: { unique: ... } } } }\n * ```\n */\n build(): TableDefinition {\n const builtColumns: Record<string, ColumnSchema> = {}\n\n const processColumn = (\n builder:\n | ProtectColumn\n | Record<\n string,\n | ProtectValue\n | Record<\n string,\n | ProtectValue\n | Record<string, ProtectValue | Record<string, ProtectValue>>\n >\n >,\n colName: string,\n ) => {\n if (builder instanceof ProtectColumn) {\n const builtColumn = builder.build()\n\n // Hanlde building the ste_vec index for JSON columns so users don't have to pass the prefix.\n if (\n builtColumn.cast_as === 'json' &&\n builtColumn.indexes.ste_vec?.prefix === 'enabled'\n ) {\n builtColumns[colName] = {\n ...builtColumn,\n indexes: {\n ...builtColumn.indexes,\n ste_vec: {\n prefix: `${this.tableName}/${colName}`,\n },\n },\n }\n } else {\n builtColumns[colName] = builtColumn\n }\n } else {\n for (const [key, value] of Object.entries(builder)) {\n if (value instanceof ProtectValue) {\n builtColumns[value.getName()] = value.build()\n } else {\n processColumn(value, key)\n }\n }\n }\n }\n\n for (const [colName, builder] of Object.entries(this.columnBuilders)) {\n processColumn(builder, colName)\n }\n\n return {\n tableName: this.tableName,\n columns: builtColumns,\n }\n }\n}\n\n// ------------------------\n// Schema type inference helpers\n// ------------------------\n\n/**\n * Infer the plaintext (decrypted) type from a ProtectTable schema.\n *\n * @example\n * ```typescript\n * const users = encryptedTable(\"users\", {\n * email: encryptedColumn(\"email\").equality(),\n * name: encryptedColumn(\"name\"),\n * })\n *\n * type UserPlaintext = InferPlaintext<typeof users>\n * // => { email: string; name: string }\n * ```\n */\nexport type InferPlaintext<T extends ProtectTable<any>> =\n T extends ProtectTable<infer C>\n ? {\n [K in keyof C as C[K] extends ProtectColumn | ProtectValue\n ? K\n : never]: string\n }\n : never\n\n/**\n * Infer the encrypted type from a ProtectTable schema.\n *\n * @example\n * ```typescript\n * const users = encryptedTable(\"users\", {\n * email: encryptedColumn(\"email\").equality(),\n * })\n *\n * type UserEncrypted = InferEncrypted<typeof users>\n * // => { email: Encrypted }\n * ```\n */\nexport type InferEncrypted<T extends ProtectTable<any>> =\n T extends ProtectTable<infer C>\n ? {\n [K in keyof C as C[K] extends ProtectColumn | ProtectValue\n ? K\n : never]: Encrypted\n }\n : never\n\n// ------------------------\n// User facing functions\n// ------------------------\n\n/**\n * Define an encrypted table schema.\n *\n * Creates a `ProtectTable` that maps a database table name to a set of encrypted\n * column definitions. Pass the resulting object to `Encryption({ schemas: [...] })`\n * when initializing the client.\n *\n * The returned object is also a proxy that exposes each column builder directly,\n * so you can reference columns as `users.email` when calling `encrypt`, `decrypt`,\n * and `encryptQuery`.\n *\n * @param tableName - The name of the database table this schema represents.\n * @param columns - An object whose keys are logical column names and values are\n * `ProtectColumn` instances created with {@link encryptedColumn}.\n * @returns A `ProtectTable<T> & T` that can be used as both a schema definition\n * and a column accessor.\n *\n * @example\n * ```typescript\n * import { encryptedTable, encryptedColumn } from \"@cipherstash/stack/schema\"\n *\n * const users = encryptedTable(\"users\", {\n * email: encryptedColumn(\"email\").equality().freeTextSearch(),\n * address: encryptedColumn(\"address\"),\n * })\n *\n * // Use as schema\n * const client = await Encryption({ schemas: [users] })\n *\n * // Use as column accessor\n * await client.encrypt(\"hello@example.com\", { column: users.email, table: users })\n * ```\n */\nexport function encryptedTable<T extends ProtectTableColumn>(\n tableName: string,\n columns: T,\n): ProtectTable<T> & T {\n const tableBuilder = new ProtectTable(tableName, columns) as ProtectTable<T> &\n T\n\n for (const [colName, colBuilder] of Object.entries(columns)) {\n ;(tableBuilder as ProtectTableColumn)[colName] = colBuilder\n }\n\n return tableBuilder\n}\n\n/**\n * Define an encrypted column within a table schema.\n *\n * Creates a `ProtectColumn` builder for the given column name. Chain index\n * methods (`.equality()`, `.freeTextSearch()`, `.orderAndRange()`,\n * `.searchableJson()`) and/or `.dataType()` to configure searchable encryption\n * and the plaintext data type.\n *\n * @param columnName - The name of the database column to encrypt.\n * @returns A new `ProtectColumn` builder.\n *\n * @example\n * ```typescript\n * import { encryptedTable, encryptedColumn } from \"@cipherstash/stack/schema\"\n *\n * const users = encryptedTable(\"users\", {\n * email: encryptedColumn(\"email\").equality().freeTextSearch().orderAndRange(),\n * })\n * ```\n */\nexport function encryptedColumn(columnName: string) {\n return new ProtectColumn(columnName)\n}\n\n/**\n * Define an encrypted value for use in nested or structured schemas.\n *\n * `encryptedValue` is similar to {@link encryptedColumn} but creates a `ProtectValue`\n * intended for nested fields within a table schema. It supports `.dataType()`\n * for specifying the plaintext type.\n *\n * @param valueName - The name of the value field.\n * @returns A new `ProtectValue` builder.\n *\n * @example\n * ```typescript\n * import { encryptedTable, encryptedValue } from \"@cipherstash/stack/schema\"\n *\n * const orders = encryptedTable(\"orders\", {\n * details: {\n * amount: encryptedValue(\"amount\").dataType(\"number\"),\n * currency: encryptedValue(\"currency\"),\n * },\n * })\n * ```\n */\nexport function encryptedValue(valueName: string) {\n return new ProtectValue(valueName)\n}\n\n// ------------------------\n// Internal functions\n// ------------------------\n\n/** @internal */\nexport function buildEncryptConfig(\n ...protectTables: Array<ProtectTable<ProtectTableColumn>>\n): EncryptConfig {\n const config: EncryptConfig = {\n v: 2,\n tables: {},\n }\n\n for (const tb of protectTables) {\n const tableDef = tb.build()\n config.tables[tableDef.tableName] = tableDef.columns\n }\n\n return config\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,iBAAkB;AAuBX,IAAM,aAAa,aACvB,KAAK,CAAC,UAAU,WAAW,QAAQ,UAAU,UAAU,MAAM,CAAC,EAC9D,QAAQ,QAAQ;AAEnB,IAAM,oBAAoB,aAAE,OAAO;AAAA,EACjC,MAAM,aAAE,QAAQ,UAAU;AAC5B,CAAC;AAED,IAAM,kBAAkB,aACrB,MAAM;AAAA,EACL,aAAE,OAAO;AAAA,IACP,MAAM,aAAE,QAAQ,UAAU;AAAA,EAC5B,CAAC;AAAA,EACD,aAAE,OAAO;AAAA,IACP,MAAM,aAAE,QAAQ,OAAO;AAAA,IACvB,cAAc,aAAE,OAAO;AAAA,EACzB,CAAC;AACH,CAAC,EACA,QAAQ,EAAE,MAAM,SAAS,cAAc,EAAE,CAAC,EAC1C,SAAS;AAEZ,IAAM,qBAAqB,aAAE,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,uBAAa,OAAO,IAAI;AAAA,QAC1B;AAAA,MACF,OAAO;AACL,mBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,OAAO,GAAG;AAClD,cAAI,iBAAiB,cAAc;AACjC,yBAAa,MAAM,QAAQ,CAAC,IAAI,MAAM,MAAM;AAAA,UAC9C,OAAO;AACL,0BAAc,OAAO,GAAG;AAAA,UAC1B;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAEA,eAAW,CAAC,SAAS,OAAO,KAAK,OAAO,QAAQ,KAAK,cAAc,GAAG;AACpE,oBAAc,SAAS,OAAO;AAAA,IAChC;AAEA,WAAO;AAAA,MACL,WAAW,KAAK;AAAA,MAChB,SAAS;AAAA,IACX;AAAA,EACF;AACF;AAwFO,SAAS,eACd,WACA,SACqB;AACrB,QAAM,eAAe,IAAI,aAAa,WAAW,OAAO;AAGxD,aAAW,CAAC,SAAS,UAAU,KAAK,OAAO,QAAQ,OAAO,GAAG;AAC3D;AAAC,IAAC,aAAoC,OAAO,IAAI;AAAA,EACnD;AAEA,SAAO;AACT;AAsBO,SAAS,gBAAgB,YAAoB;AAClD,SAAO,IAAI,cAAc,UAAU;AACrC;AAwBO,SAAS,eAAe,WAAmB;AAChD,SAAO,IAAI,aAAa,SAAS;AACnC;","names":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { c as InferEncrypted, I as InferPlaintext, P as ProtectColumn, d as ProtectTable, f as ProtectTableColumn, g as ProtectValue, a as encryptedColumn, e as encryptedTable, b as encryptedValue } from './types-public-BCj1L4fi.cjs';
|
|
2
|
+
export { E as EncryptionClient } from './client-BxJG56Ey.cjs';
|
|
3
|
+
import 'zod';
|
|
4
|
+
import 'evlog';
|
|
5
|
+
import '@cipherstash/protect-ffi';
|
|
6
|
+
import './index-9-Ya3fDK.cjs';
|
|
7
|
+
import '@byteslice/result';
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { c as InferEncrypted, I as InferPlaintext, P as ProtectColumn, d as ProtectTable, f as ProtectTableColumn, g as ProtectValue, a as encryptedColumn, e as encryptedTable, b as encryptedValue } from './types-public-BCj1L4fi.js';
|
|
2
|
+
export { E as EncryptionClient } from './client-DtGq9dJp.js';
|
|
3
|
+
import 'zod';
|
|
4
|
+
import 'evlog';
|
|
5
|
+
import '@cipherstash/protect-ffi';
|
|
6
|
+
import './index-9-Ya3fDK.js';
|
|
7
|
+
import '@byteslice/result';
|
package/dist/client.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|