@cipherstash/protect-ffi 0.23.0 → 0.25.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/dist/wasm/package.json +3 -0
- package/dist/wasm/protect_ffi.d.ts +84 -0
- package/dist/wasm/protect_ffi.js +9 -0
- package/dist/wasm/protect_ffi_bg.js +1051 -0
- package/dist/wasm/protect_ffi_bg.wasm +0 -0
- package/dist/wasm/protect_ffi_bg.wasm.d.ts +40 -0
- package/dist/wasm/protect_ffi_inline.js +16 -0
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +17 -11
- package/package.json +36 -16
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* The `ReadableStreamType` enum.
|
|
5
|
+
*
|
|
6
|
+
* *This API requires the following crate features to be activated: `ReadableStreamType`*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
type ReadableStreamType = "bytes";
|
|
10
|
+
|
|
11
|
+
export class IntoUnderlyingByteSource {
|
|
12
|
+
private constructor();
|
|
13
|
+
free(): void;
|
|
14
|
+
[Symbol.dispose](): void;
|
|
15
|
+
cancel(): void;
|
|
16
|
+
pull(controller: ReadableByteStreamController): Promise<any>;
|
|
17
|
+
start(controller: ReadableByteStreamController): void;
|
|
18
|
+
readonly autoAllocateChunkSize: number;
|
|
19
|
+
readonly type: ReadableStreamType;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export class IntoUnderlyingSink {
|
|
23
|
+
private constructor();
|
|
24
|
+
free(): void;
|
|
25
|
+
[Symbol.dispose](): void;
|
|
26
|
+
abort(reason: any): Promise<any>;
|
|
27
|
+
close(): Promise<any>;
|
|
28
|
+
write(chunk: any): Promise<any>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class IntoUnderlyingSource {
|
|
32
|
+
private constructor();
|
|
33
|
+
free(): void;
|
|
34
|
+
[Symbol.dispose](): void;
|
|
35
|
+
cancel(): void;
|
|
36
|
+
pull(controller: ReadableStreamDefaultController): Promise<any>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Wasm-side client handle. Wraps the same `ScopedCipher` +
|
|
41
|
+
* `ZeroKMSWithClientKey` pair the Neon side does, parameterised by
|
|
42
|
+
* [`JsAuthStrategy`] instead of `AutoStrategy`.
|
|
43
|
+
*/
|
|
44
|
+
export class WasmClient {
|
|
45
|
+
private constructor();
|
|
46
|
+
free(): void;
|
|
47
|
+
[Symbol.dispose](): void;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function decrypt(client: WasmClient, opts: any): Promise<any>;
|
|
51
|
+
|
|
52
|
+
export function decryptBulk(client: WasmClient, opts: any): Promise<any>;
|
|
53
|
+
|
|
54
|
+
export function decryptBulkFallible(client: WasmClient, opts: any): Promise<any>;
|
|
55
|
+
|
|
56
|
+
export function encrypt(client: WasmClient, opts: any): Promise<any>;
|
|
57
|
+
|
|
58
|
+
export function encryptBulk(client: WasmClient, opts: any): Promise<any>;
|
|
59
|
+
|
|
60
|
+
export function encryptQuery(client: WasmClient, opts: any): Promise<any>;
|
|
61
|
+
|
|
62
|
+
export function encryptQueryBulk(client: WasmClient, opts: any): Promise<any>;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Install [`console_error_panic_hook`] so Rust panics surface as a JS
|
|
66
|
+
* `Error` in the browser / Node console instead of a bare
|
|
67
|
+
* `RuntimeError: unreachable executed` from the wasm trap. Idempotent —
|
|
68
|
+
* safe to call from any number of entry points.
|
|
69
|
+
*
|
|
70
|
+
* Wired via `#[wasm_bindgen(start)]` so it runs once at module
|
|
71
|
+
* instantiation, before any `newClient` / `encrypt` / `decrypt` call.
|
|
72
|
+
*/
|
|
73
|
+
export function init(): void;
|
|
74
|
+
|
|
75
|
+
export function isEncrypted(raw: any): boolean;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Construct a [`WasmClient`].
|
|
79
|
+
*
|
|
80
|
+
* `opts.strategy` must be an `@cipherstash/auth`-shaped object — anything
|
|
81
|
+
* with a `getToken(): Promise<{ token: string, ... }>` method works. It is
|
|
82
|
+
* required: wasm has no env / filesystem fallback path.
|
|
83
|
+
*/
|
|
84
|
+
export function newClient(opts: any): Promise<WasmClient>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* @ts-self-types="./protect_ffi.d.ts" */
|
|
2
|
+
|
|
3
|
+
import * as wasm from "./protect_ffi_bg.wasm";
|
|
4
|
+
import { __wbg_set_wasm } from "./protect_ffi_bg.js";
|
|
5
|
+
__wbg_set_wasm(wasm);
|
|
6
|
+
wasm.__wbindgen_start();
|
|
7
|
+
export {
|
|
8
|
+
IntoUnderlyingByteSource, IntoUnderlyingSink, IntoUnderlyingSource, WasmClient, decrypt, decryptBulk, decryptBulkFallible, encrypt, encryptBulk, encryptQuery, encryptQueryBulk, init, isEncrypted, newClient
|
|
9
|
+
} from "./protect_ffi_bg.js";
|