@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.
- package/CHANGELOG.md +596 -0
- package/README.md +376 -276
- package/dist/adapter-kit.cjs +1002 -0
- package/dist/adapter-kit.cjs.map +1 -0
- package/dist/adapter-kit.d.cts +120 -0
- package/dist/adapter-kit.d.ts +120 -0
- package/dist/adapter-kit.js +122 -0
- package/dist/adapter-kit.js.map +1 -0
- package/dist/base-operation-AOAIvsSB.d.cts +32 -0
- package/dist/base-operation-FXEzUXIq.d.ts +32 -0
- package/dist/{chunk-4AVL4VZD.js → chunk-3B5ZX3IS.js} +3 -1
- package/dist/chunk-3B5ZX3IS.js.map +1 -0
- package/dist/{chunk-U66S7VIF.js → chunk-6SGN52W6.js} +166 -107
- package/dist/chunk-6SGN52W6.js.map +1 -0
- package/dist/chunk-7333ZC6L.js +48 -0
- package/dist/chunk-7333ZC6L.js.map +1 -0
- package/dist/{chunk-MP3SSDNN.js → chunk-CLM7E4I6.js} +15 -15
- package/dist/{chunk-MP3SSDNN.js.map → chunk-CLM7E4I6.js.map} +1 -1
- package/dist/{chunk-OFQ555AX.js → chunk-IDKP6ABU.js} +2 -2
- package/dist/{chunk-36AA7IBJ.js → chunk-L7ISHSG7.js} +53 -20
- package/dist/chunk-L7ISHSG7.js.map +1 -0
- package/dist/{chunk-LBMC4D6D.js → chunk-NVKK7UDN.js} +1 -1
- package/dist/chunk-NVKK7UDN.js.map +1 -0
- package/dist/chunk-X3JRXEIB.js +98 -0
- package/dist/chunk-X3JRXEIB.js.map +1 -0
- package/dist/client.cjs +29 -12
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +3 -2
- package/dist/client.d.ts +3 -2
- package/dist/client.js +2 -2
- package/dist/{table-CIH7jZ2h.d.ts → columns-0lbT9stl.d.ts} +157 -138
- package/dist/{table-DihEAlxG.d.cts → columns-Bxv7Oo9o.d.cts} +157 -138
- package/dist/dynamodb/index.d.cts +3 -2
- package/dist/dynamodb/index.d.ts +3 -2
- package/dist/encryption/index.cjs +54 -16
- package/dist/encryption/index.cjs.map +1 -1
- package/dist/encryption/index.d.cts +807 -6
- package/dist/encryption/index.d.ts +807 -6
- package/dist/encryption/index.js +6 -6
- package/dist/encryption/v3.cjs +1078 -973
- package/dist/encryption/v3.cjs.map +1 -1
- package/dist/encryption/v3.d.cts +15 -12
- package/dist/encryption/v3.d.ts +15 -12
- package/dist/encryption/v3.js +50 -22
- package/dist/encryption/v3.js.map +1 -1
- package/dist/eql/v3/index.cjs +130 -79
- package/dist/eql/v3/index.cjs.map +1 -1
- package/dist/eql/v3/index.d.cts +115 -13
- package/dist/eql/v3/index.d.ts +115 -13
- package/dist/eql/v3/index.js +16 -6
- package/dist/errors/index.cjs.map +1 -1
- package/dist/errors/index.d.cts +5 -5
- package/dist/errors/index.d.ts +5 -5
- package/dist/errors/index.js +1 -1
- package/dist/identity/index.cjs.map +1 -1
- package/dist/identity/index.js +2 -2
- package/dist/index-BquA71_Y.d.ts +24 -0
- package/dist/index-fhWTOV0K.d.cts +24 -0
- package/dist/index.cjs +79 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -17
- package/dist/index.d.ts +5 -17
- package/dist/index.js +6 -6
- package/dist/schema/index.cjs +29 -12
- 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 +2 -2
- package/dist/{types-public-CpS5KjwX.d.ts → types-public-QMjYNfQO.d.cts} +765 -726
- package/dist/{types-public-CpS5KjwX.d.cts → types-public-QMjYNfQO.d.ts} +765 -726
- package/dist/types-public.cjs.map +1 -1
- package/dist/types-public.d.cts +1 -1
- package/dist/types-public.d.ts +1 -1
- package/dist/types-public.js +1 -1
- package/dist/wasm-inline.d.ts +779 -405
- package/dist/wasm-inline.js +606 -299
- package/dist/wasm-inline.js.map +1 -1
- package/package.json +25 -53
- package/dist/chunk-36AA7IBJ.js.map +0 -1
- package/dist/chunk-4AVL4VZD.js.map +0 -1
- package/dist/chunk-IADZCZEA.js +0 -23
- package/dist/chunk-IADZCZEA.js.map +0 -1
- package/dist/chunk-IBSK6P33.js +0 -209
- package/dist/chunk-IBSK6P33.js.map +0 -1
- package/dist/chunk-LBMC4D6D.js.map +0 -1
- package/dist/chunk-U66S7VIF.js.map +0 -1
- package/dist/client-DSGHBN-g.d.cts +0 -834
- package/dist/client-DfCrlHXh.d.ts +0 -834
- package/dist/drizzle/index.cjs +0 -5617
- package/dist/drizzle/index.cjs.map +0 -1
- package/dist/drizzle/index.d.cts +0 -358
- package/dist/drizzle/index.d.ts +0 -358
- package/dist/drizzle/index.js +0 -1220
- package/dist/drizzle/index.js.map +0 -1
- package/dist/supabase/index.cjs +0 -5951
- package/dist/supabase/index.cjs.map +0 -1
- package/dist/supabase/index.d.cts +0 -223
- package/dist/supabase/index.d.ts +0 -223
- package/dist/supabase/index.js +0 -1217
- package/dist/supabase/index.js.map +0 -1
- /package/dist/{chunk-OFQ555AX.js.map → chunk-IDKP6ABU.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,27 +1,15 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
export {
|
|
1
|
+
export { Encryption } from './encryption/index.cjs';
|
|
2
|
+
export { e as encryptedToPgComposite, i as isEncryptedPayload } from './index-fhWTOV0K.cjs';
|
|
3
|
+
export { p as Encrypted, Z as encryptedColumn, _ as encryptedField, $ as encryptedTable } from './types-public-QMjYNfQO.cjs';
|
|
4
4
|
import auth from '@cipherstash/auth';
|
|
5
5
|
export { AuthErrorCode, AuthFailure, TokenResult } from '@cipherstash/auth';
|
|
6
6
|
import '@byteslice/result';
|
|
7
7
|
import './errors/index.cjs';
|
|
8
8
|
import '@cipherstash/protect-ffi';
|
|
9
9
|
import './identity/index.cjs';
|
|
10
|
+
import './base-operation-AOAIvsSB.cjs';
|
|
10
11
|
import 'zod';
|
|
11
12
|
|
|
12
|
-
type EncryptedPgComposite = {
|
|
13
|
-
data: Encrypted;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Helper function to transform an encrypted payload into a PostgreSQL composite type.
|
|
17
|
-
* Use this when inserting data via Supabase or similar clients.
|
|
18
|
-
*/
|
|
19
|
-
declare function encryptedToPgComposite(obj: Encrypted): EncryptedPgComposite;
|
|
20
|
-
/**
|
|
21
|
-
* Helper function to check if a value is an encrypted payload
|
|
22
|
-
*/
|
|
23
|
-
declare function isEncryptedPayload(value: unknown): value is Encrypted;
|
|
24
|
-
|
|
25
13
|
declare const AccessKeyStrategy: typeof auth.AccessKeyStrategy;
|
|
26
14
|
type AccessKeyStrategy = InstanceType<typeof auth.AccessKeyStrategy>;
|
|
27
15
|
declare const AutoStrategy: typeof auth.AutoStrategy;
|
|
@@ -31,4 +19,4 @@ type DeviceSessionStrategy = InstanceType<typeof auth.DeviceSessionStrategy>;
|
|
|
31
19
|
declare const OidcFederationStrategy: typeof auth.OidcFederationStrategy;
|
|
32
20
|
type OidcFederationStrategy = InstanceType<typeof auth.OidcFederationStrategy>;
|
|
33
21
|
|
|
34
|
-
export { AccessKeyStrategy, AutoStrategy, DeviceSessionStrategy,
|
|
22
|
+
export { AccessKeyStrategy, AutoStrategy, DeviceSessionStrategy, OidcFederationStrategy };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,27 +1,15 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
export {
|
|
1
|
+
export { Encryption } from './encryption/index.js';
|
|
2
|
+
export { e as encryptedToPgComposite, i as isEncryptedPayload } from './index-BquA71_Y.js';
|
|
3
|
+
export { p as Encrypted, Z as encryptedColumn, _ as encryptedField, $ as encryptedTable } from './types-public-QMjYNfQO.js';
|
|
4
4
|
import auth from '@cipherstash/auth';
|
|
5
5
|
export { AuthErrorCode, AuthFailure, TokenResult } from '@cipherstash/auth';
|
|
6
6
|
import '@byteslice/result';
|
|
7
7
|
import './errors/index.js';
|
|
8
8
|
import '@cipherstash/protect-ffi';
|
|
9
9
|
import './identity/index.js';
|
|
10
|
+
import './base-operation-FXEzUXIq.js';
|
|
10
11
|
import 'zod';
|
|
11
12
|
|
|
12
|
-
type EncryptedPgComposite = {
|
|
13
|
-
data: Encrypted;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Helper function to transform an encrypted payload into a PostgreSQL composite type.
|
|
17
|
-
* Use this when inserting data via Supabase or similar clients.
|
|
18
|
-
*/
|
|
19
|
-
declare function encryptedToPgComposite(obj: Encrypted): EncryptedPgComposite;
|
|
20
|
-
/**
|
|
21
|
-
* Helper function to check if a value is an encrypted payload
|
|
22
|
-
*/
|
|
23
|
-
declare function isEncryptedPayload(value: unknown): value is Encrypted;
|
|
24
|
-
|
|
25
13
|
declare const AccessKeyStrategy: typeof auth.AccessKeyStrategy;
|
|
26
14
|
type AccessKeyStrategy = InstanceType<typeof auth.AccessKeyStrategy>;
|
|
27
15
|
declare const AutoStrategy: typeof auth.AutoStrategy;
|
|
@@ -31,4 +19,4 @@ type DeviceSessionStrategy = InstanceType<typeof auth.DeviceSessionStrategy>;
|
|
|
31
19
|
declare const OidcFederationStrategy: typeof auth.OidcFederationStrategy;
|
|
32
20
|
type OidcFederationStrategy = InstanceType<typeof auth.OidcFederationStrategy>;
|
|
33
21
|
|
|
34
|
-
export { AccessKeyStrategy, AutoStrategy, DeviceSessionStrategy,
|
|
22
|
+
export { AccessKeyStrategy, AutoStrategy, DeviceSessionStrategy, OidcFederationStrategy };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Encryption
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-L7ISHSG7.js";
|
|
4
|
+
import "./chunk-IDKP6ABU.js";
|
|
5
5
|
import {
|
|
6
6
|
encryptedToPgComposite,
|
|
7
7
|
isEncryptedPayload
|
|
@@ -10,12 +10,12 @@ import {
|
|
|
10
10
|
encryptedColumn,
|
|
11
11
|
encryptedField,
|
|
12
12
|
encryptedTable
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-CLM7E4I6.js";
|
|
14
|
+
import "./chunk-7333ZC6L.js";
|
|
15
|
+
import "./chunk-3B5ZX3IS.js";
|
|
16
16
|
import "./chunk-JSG2AMDI.js";
|
|
17
17
|
import "./chunk-HQANMV7R.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-NVKK7UDN.js";
|
|
19
19
|
import "./chunk-PZ5AY32C.js";
|
|
20
20
|
|
|
21
21
|
// src/index.ts
|
package/dist/schema/index.cjs
CHANGED
|
@@ -4085,6 +4085,23 @@ function defaultMatchOpts() {
|
|
|
4085
4085
|
include_original: true
|
|
4086
4086
|
};
|
|
4087
4087
|
}
|
|
4088
|
+
function cloneMatchOpts(opts) {
|
|
4089
|
+
return {
|
|
4090
|
+
...opts,
|
|
4091
|
+
tokenizer: { ...opts.tokenizer },
|
|
4092
|
+
token_filters: opts.token_filters.map((f) => ({ ...f }))
|
|
4093
|
+
};
|
|
4094
|
+
}
|
|
4095
|
+
function resolveMatchOpts(opts) {
|
|
4096
|
+
const defaults = defaultMatchOpts();
|
|
4097
|
+
return cloneMatchOpts({
|
|
4098
|
+
tokenizer: opts?.tokenizer ?? defaults.tokenizer,
|
|
4099
|
+
token_filters: opts?.token_filters ?? defaults.token_filters,
|
|
4100
|
+
k: opts?.k ?? defaults.k,
|
|
4101
|
+
m: opts?.m ?? defaults.m,
|
|
4102
|
+
include_original: opts?.include_original ?? defaults.include_original
|
|
4103
|
+
});
|
|
4104
|
+
}
|
|
4088
4105
|
|
|
4089
4106
|
// src/schema/index.ts
|
|
4090
4107
|
var eqlCastAsEnum = external_exports.enum([
|
|
@@ -4142,6 +4159,7 @@ var tokenizerSchema = external_exports.union([
|
|
|
4142
4159
|
})
|
|
4143
4160
|
]).default({ kind: "ngram", token_length: 3 }).optional();
|
|
4144
4161
|
var oreIndexOptsSchema = external_exports.object({});
|
|
4162
|
+
var opeIndexOptsSchema = external_exports.object({});
|
|
4145
4163
|
var uniqueIndexOptsSchema = external_exports.object({
|
|
4146
4164
|
token_filters: external_exports.array(tokenFilterSchema).default([]).optional()
|
|
4147
4165
|
});
|
|
@@ -4163,10 +4181,12 @@ var arrayIndexModeSchema = external_exports.union([
|
|
|
4163
4181
|
]);
|
|
4164
4182
|
var steVecIndexOptsSchema = external_exports.object({
|
|
4165
4183
|
prefix: external_exports.string(),
|
|
4166
|
-
array_index_mode: arrayIndexModeSchema.optional()
|
|
4184
|
+
array_index_mode: arrayIndexModeSchema.optional(),
|
|
4185
|
+
mode: external_exports.enum(["compat", "standard"]).optional()
|
|
4167
4186
|
});
|
|
4168
4187
|
var indexesSchema = external_exports.object({
|
|
4169
4188
|
ore: oreIndexOptsSchema.optional(),
|
|
4189
|
+
ope: opeIndexOptsSchema.optional(),
|
|
4170
4190
|
unique: uniqueIndexOptsSchema.optional(),
|
|
4171
4191
|
match: matchIndexOptsSchema.optional(),
|
|
4172
4192
|
ste_vec: steVecIndexOptsSchema.optional()
|
|
@@ -4195,7 +4215,7 @@ var EncryptedField = class {
|
|
|
4195
4215
|
* a different type so the encryption layer knows how to encode the plaintext
|
|
4196
4216
|
* before encrypting.
|
|
4197
4217
|
*
|
|
4198
|
-
* @param castAs - The plaintext data type: `'string'`, `'number'`, `'boolean'`, `'date'`, `'text'`, `'bigint'`, or `'json'`.
|
|
4218
|
+
* @param castAs - The plaintext data type: `'string'`, `'number'`, `'boolean'`, `'date'`, `'timestamp'`, `'text'`, `'bigint'`, or `'json'`. Use `'timestamp'` (not `'date'`) to preserve time-of-day — `'date'` truncates to midnight.
|
|
4199
4219
|
* @returns This `EncryptedField` instance for method chaining.
|
|
4200
4220
|
*
|
|
4201
4221
|
* @example
|
|
@@ -4234,7 +4254,7 @@ var EncryptedColumn = class {
|
|
|
4234
4254
|
* a different type so the encryption layer knows how to encode the plaintext
|
|
4235
4255
|
* before encrypting.
|
|
4236
4256
|
*
|
|
4237
|
-
* @param castAs - The plaintext data type: `'string'`, `'number'`, `'boolean'`, `'date'`, `'bigint'`, or `'json'`.
|
|
4257
|
+
* @param castAs - The plaintext data type: `'string'`, `'number'`, `'boolean'`, `'date'`, `'timestamp'`, `'text'`, `'bigint'`, or `'json'`. Use `'timestamp'` (not `'date'`) to preserve time-of-day — `'date'` truncates to midnight.
|
|
4238
4258
|
* @returns This `EncryptedColumn` instance for method chaining.
|
|
4239
4259
|
*
|
|
4240
4260
|
* @example
|
|
@@ -4323,14 +4343,7 @@ var EncryptedColumn = class {
|
|
|
4323
4343
|
* ```
|
|
4324
4344
|
*/
|
|
4325
4345
|
freeTextSearch(opts) {
|
|
4326
|
-
|
|
4327
|
-
this.indexesValue.match = {
|
|
4328
|
-
tokenizer: opts?.tokenizer ?? defaults.tokenizer,
|
|
4329
|
-
token_filters: opts?.token_filters ?? defaults.token_filters,
|
|
4330
|
-
k: opts?.k ?? defaults.k,
|
|
4331
|
-
m: opts?.m ?? defaults.m,
|
|
4332
|
-
include_original: opts?.include_original ?? defaults.include_original
|
|
4333
|
-
};
|
|
4346
|
+
this.indexesValue.match = resolveMatchOpts(opts);
|
|
4334
4347
|
return this;
|
|
4335
4348
|
}
|
|
4336
4349
|
/**
|
|
@@ -4357,7 +4370,11 @@ var EncryptedColumn = class {
|
|
|
4357
4370
|
*/
|
|
4358
4371
|
searchableJson() {
|
|
4359
4372
|
this.castAsValue = "json";
|
|
4360
|
-
this.indexesValue.ste_vec = {
|
|
4373
|
+
this.indexesValue.ste_vec = {
|
|
4374
|
+
prefix: "enabled",
|
|
4375
|
+
array_index_mode: "all",
|
|
4376
|
+
mode: "standard"
|
|
4377
|
+
};
|
|
4361
4378
|
return this;
|
|
4362
4379
|
}
|
|
4363
4380
|
build() {
|