@cipherstash/protect-ffi 0.19.0 → 0.20.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/lib/index.cjs CHANGED
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
  // This module is the CJS entry point for the library.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.decryptBulkFallible = exports.decryptBulk = exports.decrypt = exports.isEncrypted = exports.encryptBulk = exports.encrypt = exports.newClient = void 0;
4
+ exports.decryptBulkFallible = exports.decryptBulk = exports.decrypt = exports.isEncrypted = exports.encryptQueryBulk = exports.encryptQuery = exports.encryptBulk = exports.encrypt = exports.newClient = void 0;
5
5
  var load_cjs_1 = require("./load.cjs");
6
6
  Object.defineProperty(exports, "newClient", { enumerable: true, get: function () { return load_cjs_1.newClient; } });
7
7
  Object.defineProperty(exports, "encrypt", { enumerable: true, get: function () { return load_cjs_1.encrypt; } });
8
8
  Object.defineProperty(exports, "encryptBulk", { enumerable: true, get: function () { return load_cjs_1.encryptBulk; } });
9
+ Object.defineProperty(exports, "encryptQuery", { enumerable: true, get: function () { return load_cjs_1.encryptQuery; } });
10
+ Object.defineProperty(exports, "encryptQueryBulk", { enumerable: true, get: function () { return load_cjs_1.encryptQueryBulk; } });
9
11
  Object.defineProperty(exports, "isEncrypted", { enumerable: true, get: function () { return load_cjs_1.isEncrypted; } });
10
12
  Object.defineProperty(exports, "decrypt", { enumerable: true, get: function () { return load_cjs_1.decrypt; } });
11
13
  Object.defineProperty(exports, "decryptBulk", { enumerable: true, get: function () { return load_cjs_1.decryptBulk; } });
package/lib/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { newClient, encrypt, encryptBulk, isEncrypted, decrypt, decryptBulk, decryptBulkFallible, } from './load.cjs';
1
+ export { newClient, encrypt, encryptBulk, encryptQuery, encryptQueryBulk, isEncrypted, decrypt, decryptBulk, decryptBulkFallible, } from './load.cjs';
2
2
  declare const sym: unique symbol;
3
3
  export type Client = {
4
4
  readonly [sym]: unknown;
@@ -11,6 +11,8 @@ declare module './load.cjs' {
11
11
  function encryptBulk(client: Client, opts: EncryptBulkOptions): Promise<Encrypted[]>;
12
12
  function decryptBulk(client: Client, opts: DecryptBulkOptions): Promise<JsPlaintext[]>;
13
13
  function decryptBulkFallible(client: Client, opts: DecryptBulkOptions): Promise<DecryptResult[]>;
14
+ function encryptQuery(client: Client, opts: EncryptQueryOptions): Promise<Encrypted>;
15
+ function encryptQueryBulk(client: Client, opts: EncryptQueryBulkOptions): Promise<Encrypted[]>;
14
16
  }
15
17
  export type DecryptResult = {
16
18
  data: string;
@@ -186,3 +188,28 @@ export type DecryptBulkOptions = {
186
188
  serviceToken?: CtsToken;
187
189
  unverifiedContext?: Record<string, unknown>;
188
190
  };
191
+ export type IndexTypeName = 'ste_vec' | 'match' | 'ore' | 'unique';
192
+ export type QueryOpName = 'default' | 'ste_vec_selector' | 'ste_vec_term';
193
+ export type EncryptQueryOptions = {
194
+ plaintext: JsPlaintext;
195
+ column: string;
196
+ table: string;
197
+ indexType: IndexTypeName;
198
+ queryOp?: QueryOpName;
199
+ lockContext?: Context;
200
+ serviceToken?: CtsToken;
201
+ unverifiedContext?: Record<string, unknown>;
202
+ };
203
+ export type QueryPayload = {
204
+ plaintext: JsPlaintext;
205
+ column: string;
206
+ table: string;
207
+ indexType: IndexTypeName;
208
+ queryOp?: QueryOpName;
209
+ lockContext?: Context;
210
+ };
211
+ export type EncryptQueryBulkOptions = {
212
+ queries: QueryPayload[];
213
+ serviceToken?: CtsToken;
214
+ unverifiedContext?: Record<string, unknown>;
215
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cipherstash/protect-ffi",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "description": "",
5
5
  "main": "./lib/index.cjs",
6
6
  "scripts": {
@@ -67,11 +67,11 @@
67
67
  "@neon-rs/load": "^0.1.82"
68
68
  },
69
69
  "optionalDependencies": {
70
- "@cipherstash/protect-ffi-darwin-x64": "0.19.0",
71
- "@cipherstash/protect-ffi-darwin-arm64": "0.19.0",
72
- "@cipherstash/protect-ffi-win32-x64-msvc": "0.19.0",
73
- "@cipherstash/protect-ffi-linux-x64-gnu": "0.19.0",
74
- "@cipherstash/protect-ffi-linux-arm64-gnu": "0.19.0",
75
- "@cipherstash/protect-ffi-linux-x64-musl": "0.19.0"
70
+ "@cipherstash/protect-ffi-darwin-x64": "0.20.0",
71
+ "@cipherstash/protect-ffi-darwin-arm64": "0.20.0",
72
+ "@cipherstash/protect-ffi-win32-x64-msvc": "0.20.0",
73
+ "@cipherstash/protect-ffi-linux-x64-gnu": "0.20.0",
74
+ "@cipherstash/protect-ffi-linux-arm64-gnu": "0.20.0",
75
+ "@cipherstash/protect-ffi-linux-x64-musl": "0.20.0"
76
76
  }
77
77
  }