ping-openmls-sdk 0.1.0 → 0.1.2

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 CHANGED
@@ -59,5 +59,5 @@ by:
59
59
 
60
60
  ## React Native
61
61
 
62
- On RN, native binaries are preferred — install `@ping-openmls-sdk/react-native-macos` (autolinked). On RN-Web,
62
+ On RN, native binaries are preferred — install `ping-openmls-sdk-react-native-macos` (autolinked). On RN-Web,
63
63
  this package's WASM build is used as-is.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ping-openmls-sdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "OpenMLS-based secure messaging SDK — runs in browsers, React Native, RN-Web, and Electron/Tauri.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "ping-openmls-sdk-wasm",
3
+ "type": "module",
4
+ "description": "wasm-bindgen surface for the Ping OpenMLS SDK — drives the ping-openmls-sdk npm package",
5
+ "version": "0.1.4",
6
+ "license": "Apache-2.0",
7
+ "files": [
8
+ "ping_wasm_bg.wasm",
9
+ "ping_wasm.js",
10
+ "ping_wasm.d.ts"
11
+ ],
12
+ "main": "ping_wasm.js",
13
+ "types": "ping_wasm.d.ts",
14
+ "sideEffects": [
15
+ "./snippets/*"
16
+ ]
17
+ }
@@ -0,0 +1,191 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ export class PingClient {
5
+ private constructor();
6
+ free(): void;
7
+ [Symbol.dispose](): void;
8
+ addMembers(conv_id: Uint8Array, key_packages: Uint8Array[], now_ms: number): Promise<void>;
9
+ buildLinkingTicket(new_device_id: Uint8Array, new_device_kp: Uint8Array, now_ms: number): Promise<any>;
10
+ consumeLinkingTicket(ticket: any, now_ms: number): Promise<void>;
11
+ createConversation(name: string | null | undefined, now_ms: number): Promise<Uint8Array>;
12
+ deviceId(): Uint8Array;
13
+ freshKeyPackage(): Uint8Array;
14
+ /**
15
+ * Generate a fresh identity. Returns the export bytes — store them under the user's account.
16
+ */
17
+ static generateIdentity(): Uint8Array;
18
+ /**
19
+ * Initialise the client. Pass an exported identity (use `generateIdentity()` for a fresh one).
20
+ */
21
+ static init(identity_export: Uint8Array, device_label: string, storage: JsStorage, transport: JsTransport, now_ms: number): Promise<PingClient>;
22
+ joinConversation(welcome: any, now_ms: number): Promise<Uint8Array>;
23
+ listConversations(): any;
24
+ onMessage(cb: Function): void;
25
+ processEnvelope(env: any, now_ms: number): Promise<any>;
26
+ removeMembers(conv_id: Uint8Array, leaves: Uint32Array, now_ms: number): Promise<void>;
27
+ send(conv_id: Uint8Array, plaintext: Uint8Array, now_ms: number): Promise<any>;
28
+ syncConversations(now_ms: number): Promise<any>;
29
+ userId(): Uint8Array;
30
+ }
31
+
32
+ /**
33
+ * Runtime test harness support instantiated in JS.
34
+ *
35
+ * The node.js entry script instantiates a `Context` here which is used to
36
+ * drive test execution.
37
+ */
38
+ export class WasmBindgenTestContext {
39
+ free(): void;
40
+ [Symbol.dispose](): void;
41
+ /**
42
+ * Handle filter argument.
43
+ */
44
+ filtered_count(filtered: number): void;
45
+ /**
46
+ * Handle `--include-ignored` flag.
47
+ */
48
+ include_ignored(include_ignored: boolean): void;
49
+ /**
50
+ * Creates a new context ready to run tests.
51
+ *
52
+ * A `Context` is the main structure through which test execution is
53
+ * coordinated, and this will collect output and results for all executed
54
+ * tests.
55
+ */
56
+ constructor(is_bench: boolean);
57
+ /**
58
+ * Executes a list of tests, returning a promise representing their
59
+ * eventual completion.
60
+ *
61
+ * This is the main entry point for executing tests. All the tests passed
62
+ * in are the JS `Function` object that was plucked off the
63
+ * `WebAssembly.Instance` exports list.
64
+ *
65
+ * The promise returned resolves to either `true` if all tests passed or
66
+ * `false` if at least one test failed.
67
+ */
68
+ run(tests: any[]): Promise<any>;
69
+ }
70
+
71
+ /**
72
+ * Used to read benchmark data, and then the runner stores it on the local disk.
73
+ */
74
+ export function __wbgbench_dump(): Uint8Array | undefined;
75
+
76
+ /**
77
+ * Used to write previous benchmark data before the benchmark, for later comparison.
78
+ */
79
+ export function __wbgbench_import(baseline: Uint8Array): void;
80
+
81
+ /**
82
+ * Handler for `console.debug` invocations. See above.
83
+ */
84
+ export function __wbgtest_console_debug(args: Array<any>): void;
85
+
86
+ /**
87
+ * Handler for `console.error` invocations. See above.
88
+ */
89
+ export function __wbgtest_console_error(args: Array<any>): void;
90
+
91
+ /**
92
+ * Handler for `console.info` invocations. See above.
93
+ */
94
+ export function __wbgtest_console_info(args: Array<any>): void;
95
+
96
+ /**
97
+ * Handler for `console.log` invocations.
98
+ *
99
+ * If a test is currently running it takes the `args` array and stringifies
100
+ * it and appends it to the current output of the test. Otherwise it passes
101
+ * the arguments to the original `console.log` function, psased as
102
+ * `original`.
103
+ */
104
+ export function __wbgtest_console_log(args: Array<any>): void;
105
+
106
+ /**
107
+ * Handler for `console.warn` invocations. See above.
108
+ */
109
+ export function __wbgtest_console_warn(args: Array<any>): void;
110
+
111
+ export function __wbgtest_cov_dump(): Uint8Array | undefined;
112
+
113
+ /**
114
+ * Path to use for coverage data.
115
+ */
116
+ export function __wbgtest_coverage_path(env: string | null | undefined, pid: number, temp_dir: string, module_signature: bigint): string;
117
+
118
+ export function __wbgtest_module_signature(): bigint | undefined;
119
+
120
+ export function _start(): void;
121
+
122
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
123
+
124
+ export interface InitOutput {
125
+ readonly memory: WebAssembly.Memory;
126
+ readonly __wbg_pingclient_free: (a: number, b: number) => void;
127
+ readonly pingclient_addMembers: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
128
+ readonly pingclient_buildLinkingTicket: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
129
+ readonly pingclient_consumeLinkingTicket: (a: number, b: number, c: number) => number;
130
+ readonly pingclient_createConversation: (a: number, b: number, c: number, d: number) => number;
131
+ readonly pingclient_deviceId: (a: number, b: number) => void;
132
+ readonly pingclient_freshKeyPackage: (a: number, b: number) => void;
133
+ readonly pingclient_generateIdentity: (a: number) => void;
134
+ readonly pingclient_init: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
135
+ readonly pingclient_joinConversation: (a: number, b: number, c: number) => number;
136
+ readonly pingclient_listConversations: (a: number, b: number) => void;
137
+ readonly pingclient_onMessage: (a: number, b: number) => void;
138
+ readonly pingclient_processEnvelope: (a: number, b: number, c: number) => number;
139
+ readonly pingclient_removeMembers: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
140
+ readonly pingclient_send: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
141
+ readonly pingclient_syncConversations: (a: number, b: number) => number;
142
+ readonly pingclient_userId: (a: number, b: number) => void;
143
+ readonly _start: () => void;
144
+ readonly __wbg_wasmbindgentestcontext_free: (a: number, b: number) => void;
145
+ readonly __wbgbench_dump: (a: number) => void;
146
+ readonly __wbgbench_import: (a: number, b: number) => void;
147
+ readonly __wbgtest_console_debug: (a: number) => void;
148
+ readonly __wbgtest_console_error: (a: number) => void;
149
+ readonly __wbgtest_console_info: (a: number) => void;
150
+ readonly __wbgtest_console_log: (a: number) => void;
151
+ readonly __wbgtest_console_warn: (a: number) => void;
152
+ readonly __wbgtest_cov_dump: (a: number) => void;
153
+ readonly __wbgtest_coverage_path: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint) => void;
154
+ readonly __wbgtest_module_signature: (a: number) => void;
155
+ readonly wasmbindgentestcontext_filtered_count: (a: number, b: number) => void;
156
+ readonly wasmbindgentestcontext_include_ignored: (a: number, b: number) => void;
157
+ readonly wasmbindgentestcontext_new: (a: number) => number;
158
+ readonly wasmbindgentestcontext_run: (a: number, b: number, c: number) => number;
159
+ readonly __wasm_bindgen_func_elem_2213: (a: number, b: number, c: number, d: number, e: number) => void;
160
+ readonly __wasm_bindgen_func_elem_2203: (a: number, b: number, c: number, d: number) => void;
161
+ readonly __wasm_bindgen_func_elem_2212: (a: number, b: number, c: number, d: number) => void;
162
+ readonly __wbindgen_export: (a: number, b: number) => number;
163
+ readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
164
+ readonly __wbindgen_export3: (a: number) => void;
165
+ readonly __wbindgen_export4: (a: number, b: number, c: number) => void;
166
+ readonly __wbindgen_export5: (a: number, b: number) => void;
167
+ readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
168
+ readonly __wbindgen_start: () => void;
169
+ }
170
+
171
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
172
+
173
+ /**
174
+ * Instantiates the given `module`, which can either be bytes or
175
+ * a precompiled `WebAssembly.Module`.
176
+ *
177
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
178
+ *
179
+ * @returns {InitOutput}
180
+ */
181
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
182
+
183
+ /**
184
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
185
+ * for everything else, calls `WebAssembly.instantiate` directly.
186
+ *
187
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
188
+ *
189
+ * @returns {Promise<InitOutput>}
190
+ */
191
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;