@cipherstash/protect-ffi 0.10.0 → 0.12.0-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/README.md +4 -4
- package/lib/index.cjs +2 -2
- package/lib/index.d.cts +2 -2
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Protect.js CipherStash Client FFI
|
|
2
2
|
|
|
3
|
-
> [!IMPORTANT]
|
|
3
|
+
> [!IMPORTANT]
|
|
4
4
|
> If you are looking to implement this package into your application please use the official [protect package](https://github.com/cipherstash/protectjs).
|
|
5
5
|
|
|
6
6
|
This project provides the JS bindings for the CipherStash Client Rust SDK and is bootstrapped by [create-neon](https://www.npmjs.com/package/create-neon).
|
|
@@ -38,9 +38,9 @@ $ npm i
|
|
|
38
38
|
$ npm run build
|
|
39
39
|
$ node
|
|
40
40
|
> const addon = require(".");
|
|
41
|
-
> const client = await addon.newClient();
|
|
42
|
-
> const ciphertext = await addon.encrypt(client, "plaintext", "
|
|
43
|
-
> const plaintext = await addon.decrypt(client, ciphertext);
|
|
41
|
+
> const client = await addon.newClient(JSON.stringify({v: 1, tables: {users: {email: {indexes: {ore: {}, match: {}, unique: {}}}}}}));
|
|
42
|
+
> const ciphertext = await addon.encrypt(client, "plaintext", "email", "users");
|
|
43
|
+
> const plaintext = await addon.decrypt(client, JSON.parse(ciphertext).c);
|
|
44
44
|
> console.log({ciphertext, plaintext});
|
|
45
45
|
```
|
|
46
46
|
|
package/lib/index.cjs
CHANGED
|
@@ -41,8 +41,8 @@ exports.encryptBulk = encryptBulk;
|
|
|
41
41
|
exports.decryptBulk = decryptBulk;
|
|
42
42
|
// The Rust addon.
|
|
43
43
|
const addon = __importStar(require("./load.cjs"));
|
|
44
|
-
function newClient() {
|
|
45
|
-
return addon.newClient();
|
|
44
|
+
function newClient(encryptSchema) {
|
|
45
|
+
return addon.newClient(encryptSchema);
|
|
46
46
|
}
|
|
47
47
|
function encrypt(client, plaintext, columnName, lockContext, ctsToken) {
|
|
48
48
|
if (ctsToken) {
|
package/lib/index.d.cts
CHANGED
|
@@ -2,13 +2,13 @@ import * as addon from './load.cjs';
|
|
|
2
2
|
declare module './load.cjs' {
|
|
3
3
|
interface Client {
|
|
4
4
|
}
|
|
5
|
-
function newClient(): Promise<Client>;
|
|
5
|
+
function newClient(encryptSchema?: string): Promise<Client>;
|
|
6
6
|
function encrypt(client: Client, plaintext: string, columnName: string, context?: Context, ctsToken?: CtsToken): Promise<string>;
|
|
7
7
|
function decrypt(client: Client, ciphertext: string, context?: Context, ctsToken?: CtsToken): Promise<string>;
|
|
8
8
|
function encryptBulk(client: Client, plaintextTargets: BulkEncryptPayload[], ctsToken?: CtsToken): Promise<string[]>;
|
|
9
9
|
function decryptBulk(client: Client, ciphertexts: BulkDecryptPayload[], ctsToken?: CtsToken): Promise<string[]>;
|
|
10
10
|
}
|
|
11
|
-
export declare function newClient(): Promise<addon.Client>;
|
|
11
|
+
export declare function newClient(encryptSchema?: string): Promise<addon.Client>;
|
|
12
12
|
export declare function encrypt(client: addon.Client, plaintext: string, columnName: string, lockContext?: Context, ctsToken?: CtsToken): Promise<string>;
|
|
13
13
|
export declare function decrypt(client: addon.Client, ciphertext: string, lockContext?: Context, ctsToken?: CtsToken): Promise<string>;
|
|
14
14
|
export declare function encryptBulk(client: addon.Client, plaintextTargets: BulkEncryptPayload[], ctsToken?: CtsToken): Promise<string[]>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cipherstash/protect-ffi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0-0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/index.cjs",
|
|
6
6
|
"scripts": {
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"@neon-rs/load": "^0.1.82"
|
|
53
53
|
},
|
|
54
54
|
"optionalDependencies": {
|
|
55
|
-
"@cipherstash/protect-ffi-win32-x64-msvc": "0.
|
|
56
|
-
"@cipherstash/protect-ffi-darwin-x64": "0.
|
|
57
|
-
"@cipherstash/protect-ffi-darwin-arm64": "0.
|
|
58
|
-
"@cipherstash/protect-ffi-linux-x64-gnu": "0.
|
|
59
|
-
"@cipherstash/protect-ffi-linux-arm64-gnu": "0.
|
|
55
|
+
"@cipherstash/protect-ffi-win32-x64-msvc": "0.12.0-0",
|
|
56
|
+
"@cipherstash/protect-ffi-darwin-x64": "0.12.0-0",
|
|
57
|
+
"@cipherstash/protect-ffi-darwin-arm64": "0.12.0-0",
|
|
58
|
+
"@cipherstash/protect-ffi-linux-x64-gnu": "0.12.0-0",
|
|
59
|
+
"@cipherstash/protect-ffi-linux-arm64-gnu": "0.12.0-0"
|
|
60
60
|
}
|
|
61
61
|
}
|