@cipherstash/protect-ffi 0.17.0 → 0.17.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/lib/index.cjs +2 -1
- package/lib/index.d.cts +18 -3
- package/lib/load.cjs +1 -0
- package/package.json +15 -7
package/lib/index.cjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
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.encryptBulk = exports.encrypt = exports.newClient = void 0;
|
|
4
|
+
exports.decryptBulkFallible = exports.decryptBulk = exports.decrypt = exports.isEncrypted = 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, "isEncrypted", { enumerable: true, get: function () { return load_cjs_1.isEncrypted; } });
|
|
9
10
|
Object.defineProperty(exports, "decrypt", { enumerable: true, get: function () { return load_cjs_1.decrypt; } });
|
|
10
11
|
Object.defineProperty(exports, "decryptBulk", { enumerable: true, get: function () { return load_cjs_1.decryptBulk; } });
|
|
11
12
|
Object.defineProperty(exports, "decryptBulkFallible", { enumerable: true, get: function () { return load_cjs_1.decryptBulkFallible; } });
|
package/lib/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { newClient, encrypt, encryptBulk, decrypt, decryptBulk, decryptBulkFallible, } from './load.cjs';
|
|
1
|
+
export { newClient, encrypt, encryptBulk, isEncrypted, decrypt, decryptBulk, decryptBulkFallible, } from './load.cjs';
|
|
2
2
|
declare const sym: unique symbol;
|
|
3
3
|
export type Client = {
|
|
4
4
|
readonly [sym]: unknown;
|
|
@@ -7,6 +7,7 @@ declare module './load.cjs' {
|
|
|
7
7
|
function newClient(opts: NewClientOptions): Promise<Client>;
|
|
8
8
|
function encrypt(client: Client, opts: EncryptOptions): Promise<Encrypted>;
|
|
9
9
|
function decrypt(client: Client, opts: DecryptOptions): Promise<JsPlaintext>;
|
|
10
|
+
function isEncrypted(encrypted: Encrypted): boolean;
|
|
10
11
|
function encryptBulk(client: Client, opts: EncryptBulkOptions): Promise<Encrypted[]>;
|
|
11
12
|
function decryptBulk(client: Client, opts: DecryptBulkOptions): Promise<JsPlaintext[]>;
|
|
12
13
|
function decryptBulkFallible(client: Client, opts: DecryptBulkOptions): Promise<DecryptResult[]>;
|
|
@@ -34,7 +35,7 @@ export type Context = {
|
|
|
34
35
|
identityClaim: string[];
|
|
35
36
|
};
|
|
36
37
|
export type Encrypted = {
|
|
37
|
-
k:
|
|
38
|
+
k: 'ct';
|
|
38
39
|
c: string;
|
|
39
40
|
ob: string[] | null;
|
|
40
41
|
bf: number[] | null;
|
|
@@ -44,6 +45,20 @@ export type Encrypted = {
|
|
|
44
45
|
t: string;
|
|
45
46
|
};
|
|
46
47
|
v: number;
|
|
48
|
+
} | {
|
|
49
|
+
k: 'sv';
|
|
50
|
+
sv: SteVecEncryptedEntry[];
|
|
51
|
+
i: {
|
|
52
|
+
c: string;
|
|
53
|
+
t: string;
|
|
54
|
+
};
|
|
55
|
+
v: number;
|
|
56
|
+
};
|
|
57
|
+
export type SteVecEncryptedEntry = {
|
|
58
|
+
tokenized_selector: string;
|
|
59
|
+
term: string;
|
|
60
|
+
record: string;
|
|
61
|
+
parent_is_array: boolean;
|
|
47
62
|
};
|
|
48
63
|
export type EncryptConfig = {
|
|
49
64
|
v: number;
|
|
@@ -53,7 +68,7 @@ export type Column = {
|
|
|
53
68
|
cast_as?: CastAs;
|
|
54
69
|
indexes?: Indexes;
|
|
55
70
|
};
|
|
56
|
-
export type CastAs = '
|
|
71
|
+
export type CastAs = 'bigint' | 'boolean' | 'date' | 'number' | 'string' | 'json';
|
|
57
72
|
type TablesOf<C extends EncryptConfig> = C['tables'];
|
|
58
73
|
export type Identifier<C extends EncryptConfig> = {
|
|
59
74
|
[T in keyof TablesOf<C>]: {
|
package/lib/load.cjs
CHANGED
|
@@ -12,6 +12,7 @@ module.exports = require('@neon-rs/load').proxy({
|
|
|
12
12
|
'darwin-x64': () => require('@cipherstash/protect-ffi-darwin-x64'),
|
|
13
13
|
'darwin-arm64': () => require('@cipherstash/protect-ffi-darwin-arm64'),
|
|
14
14
|
'linux-x64-gnu': () => require('@cipherstash/protect-ffi-linux-x64-gnu'),
|
|
15
|
+
'linux-x64-musl': () => require('@cipherstash/protect-ffi-linux-x64-musl'),
|
|
15
16
|
'linux-arm64-gnu': () => require('@cipherstash/protect-ffi-linux-arm64-gnu'),
|
|
16
17
|
},
|
|
17
18
|
debug: () => require('../index.node'),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cipherstash/protect-ffi",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/index.cjs",
|
|
6
6
|
"scripts": {
|
|
@@ -45,7 +45,14 @@
|
|
|
45
45
|
"neon": {
|
|
46
46
|
"type": "library",
|
|
47
47
|
"org": "@cipherstash",
|
|
48
|
-
"platforms":
|
|
48
|
+
"platforms": [
|
|
49
|
+
"darwin-x64",
|
|
50
|
+
"darwin-arm64",
|
|
51
|
+
"win32-x64-msvc",
|
|
52
|
+
"linux-x64-gnu",
|
|
53
|
+
"linux-arm64-gnu",
|
|
54
|
+
"linux-x64-musl"
|
|
55
|
+
],
|
|
49
56
|
"load": "./src/load.cts",
|
|
50
57
|
"prefix": "protect-ffi-"
|
|
51
58
|
},
|
|
@@ -60,10 +67,11 @@
|
|
|
60
67
|
"@neon-rs/load": "^0.1.82"
|
|
61
68
|
},
|
|
62
69
|
"optionalDependencies": {
|
|
63
|
-
"@cipherstash/protect-ffi-
|
|
64
|
-
"@cipherstash/protect-ffi-darwin-
|
|
65
|
-
"@cipherstash/protect-ffi-
|
|
66
|
-
"@cipherstash/protect-ffi-linux-x64-gnu": "0.17.
|
|
67
|
-
"@cipherstash/protect-ffi-linux-arm64-gnu": "0.17.
|
|
70
|
+
"@cipherstash/protect-ffi-darwin-x64": "0.17.1",
|
|
71
|
+
"@cipherstash/protect-ffi-darwin-arm64": "0.17.1",
|
|
72
|
+
"@cipherstash/protect-ffi-win32-x64-msvc": "0.17.1",
|
|
73
|
+
"@cipherstash/protect-ffi-linux-x64-gnu": "0.17.1",
|
|
74
|
+
"@cipherstash/protect-ffi-linux-arm64-gnu": "0.17.1",
|
|
75
|
+
"@cipherstash/protect-ffi-linux-x64-musl": "0.17.1"
|
|
68
76
|
}
|
|
69
77
|
}
|