@diaryx/wasm-node 1.4.3-dev.698d97e → 1.4.3-dev.a2e8118
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 +5 -5
- package/diaryx_wasm.d.ts +65 -3
- package/diaryx_wasm.js +292 -65
- package/diaryx_wasm_bg.wasm +0 -0
- package/diaryx_wasm_bg.wasm.d.ts +21 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -100,11 +100,11 @@ console.log(
|
|
|
100
100
|
`Fixed: ${fixSummary.total_fixed}, Failed: ${fixSummary.total_failed}`,
|
|
101
101
|
);
|
|
102
102
|
|
|
103
|
-
// Fix individual
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
validation.
|
|
107
|
-
validation.
|
|
103
|
+
// Fix an individual warning or error by handing the variant straight from
|
|
104
|
+
// a prior `validate_workspace` / `validate_file` result back to the generic
|
|
105
|
+
// fixer. New warning/error kinds Just Work without a frontend patch.
|
|
106
|
+
validation.fix_validation_warning(result.warnings[0]);
|
|
107
|
+
validation.fix_validation_error(result.errors[0]);
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
#### Validation Errors
|
package/diaryx_wasm.d.ts
CHANGED
|
@@ -93,6 +93,50 @@ export interface JsFileSystemCallbacks {
|
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Auth client exposed to JavaScript.
|
|
98
|
+
*
|
|
99
|
+
* Wraps [`AuthService`] with a [`WasmAuthenticatedClient`] backend. All
|
|
100
|
+
* methods return JSON strings on success and throw a JavaScript `Error`
|
|
101
|
+
* carrying `statusCode` and `devices` properties on failure.
|
|
102
|
+
*/
|
|
103
|
+
export class AuthClient {
|
|
104
|
+
free(): void;
|
|
105
|
+
[Symbol.dispose](): void;
|
|
106
|
+
createWorkspace(name: string): Promise<any>;
|
|
107
|
+
deleteAccount(): Promise<void>;
|
|
108
|
+
deleteDevice(device_id: string): Promise<void>;
|
|
109
|
+
deleteWorkspace(workspace_id: string): Promise<void>;
|
|
110
|
+
getDevices(): Promise<any>;
|
|
111
|
+
getMe(): Promise<any>;
|
|
112
|
+
/**
|
|
113
|
+
* Load non-secret session metadata as a JSON string (or `null`).
|
|
114
|
+
*/
|
|
115
|
+
getMetadata(): Promise<any>;
|
|
116
|
+
/**
|
|
117
|
+
* Whether a session is currently established (per the `hasSession` callback).
|
|
118
|
+
*/
|
|
119
|
+
isAuthenticated(): Promise<boolean>;
|
|
120
|
+
logout(): Promise<void>;
|
|
121
|
+
/**
|
|
122
|
+
* Create a new auth client targeting the given server URL.
|
|
123
|
+
*
|
|
124
|
+
* `callbacks` is a JavaScript object implementing the `AuthCallbacks`
|
|
125
|
+
* interface (see module docs for the expected shape).
|
|
126
|
+
*/
|
|
127
|
+
constructor(server_url: string, callbacks: AuthCallbacks);
|
|
128
|
+
refreshToken(): Promise<any>;
|
|
129
|
+
renameDevice(device_id: string, new_name: string): Promise<void>;
|
|
130
|
+
renameWorkspace(workspace_id: string, new_name: string): Promise<void>;
|
|
131
|
+
requestMagicLink(email: string): Promise<any>;
|
|
132
|
+
verifyCode(code: string, email: string, device_name?: string | null, replace_device_id?: string | null): Promise<any>;
|
|
133
|
+
verifyMagicLink(token: string, device_name?: string | null, replace_device_id?: string | null): Promise<any>;
|
|
134
|
+
/**
|
|
135
|
+
* Server URL this client targets.
|
|
136
|
+
*/
|
|
137
|
+
readonly serverUrl: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
96
140
|
/**
|
|
97
141
|
* Unified async backend with native storage.
|
|
98
142
|
*
|
|
@@ -280,8 +324,26 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
280
324
|
|
|
281
325
|
export interface InitOutput {
|
|
282
326
|
readonly memory: WebAssembly.Memory;
|
|
327
|
+
readonly __wbg_authclient_free: (a: number, b: number) => void;
|
|
283
328
|
readonly __wbg_diaryxbackend_free: (a: number, b: number) => void;
|
|
284
329
|
readonly __wbg_jsasyncfilesystem_free: (a: number, b: number) => void;
|
|
330
|
+
readonly authclient_createWorkspace: (a: number, b: number, c: number) => any;
|
|
331
|
+
readonly authclient_deleteAccount: (a: number) => any;
|
|
332
|
+
readonly authclient_deleteDevice: (a: number, b: number, c: number) => any;
|
|
333
|
+
readonly authclient_deleteWorkspace: (a: number, b: number, c: number) => any;
|
|
334
|
+
readonly authclient_getDevices: (a: number) => any;
|
|
335
|
+
readonly authclient_getMe: (a: number) => any;
|
|
336
|
+
readonly authclient_getMetadata: (a: number) => any;
|
|
337
|
+
readonly authclient_isAuthenticated: (a: number) => any;
|
|
338
|
+
readonly authclient_logout: (a: number) => any;
|
|
339
|
+
readonly authclient_new: (a: number, b: number, c: any) => number;
|
|
340
|
+
readonly authclient_refreshToken: (a: number) => any;
|
|
341
|
+
readonly authclient_renameDevice: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
342
|
+
readonly authclient_renameWorkspace: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
343
|
+
readonly authclient_requestMagicLink: (a: number, b: number, c: number) => any;
|
|
344
|
+
readonly authclient_serverUrl: (a: number) => [number, number];
|
|
345
|
+
readonly authclient_verifyCode: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => any;
|
|
346
|
+
readonly authclient_verifyMagicLink: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;
|
|
285
347
|
readonly diaryxbackend_create: (a: number, b: number) => any;
|
|
286
348
|
readonly diaryxbackend_createFromJsFileSystem: (a: any) => [number, number, number];
|
|
287
349
|
readonly diaryxbackend_createInMemory: () => [number, number, number];
|
|
@@ -300,16 +362,16 @@ export interface InitOutput {
|
|
|
300
362
|
readonly today_formatted: (a: number, b: number) => [number, number];
|
|
301
363
|
readonly init: () => void;
|
|
302
364
|
readonly diaryxbackend_isCrdtEnabled: (a: number) => number;
|
|
303
|
-
readonly
|
|
304
|
-
readonly
|
|
365
|
+
readonly wasm_bindgen__convert__closures_____invoke__h3f4718a94aec51d3: (a: number, b: number, c: any) => [number, number];
|
|
366
|
+
readonly wasm_bindgen__convert__closures_____invoke__h33e54e31fc8397d0: (a: number, b: number, c: any, d: any) => void;
|
|
305
367
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
306
368
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
307
369
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
308
370
|
readonly __externref_table_alloc: () => number;
|
|
309
371
|
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
310
372
|
readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
|
|
311
|
-
readonly __externref_table_dealloc: (a: number) => void;
|
|
312
373
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
374
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
313
375
|
readonly __wbindgen_start: () => void;
|
|
314
376
|
}
|
|
315
377
|
|
package/diaryx_wasm.js
CHANGED
|
@@ -1,5 +1,210 @@
|
|
|
1
1
|
/* @ts-self-types="./diaryx_wasm.d.ts" */
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Auth client exposed to JavaScript.
|
|
5
|
+
*
|
|
6
|
+
* Wraps [`AuthService`] with a [`WasmAuthenticatedClient`] backend. All
|
|
7
|
+
* methods return JSON strings on success and throw a JavaScript `Error`
|
|
8
|
+
* carrying `statusCode` and `devices` properties on failure.
|
|
9
|
+
*/
|
|
10
|
+
export class AuthClient {
|
|
11
|
+
__destroy_into_raw() {
|
|
12
|
+
const ptr = this.__wbg_ptr;
|
|
13
|
+
this.__wbg_ptr = 0;
|
|
14
|
+
AuthClientFinalization.unregister(this);
|
|
15
|
+
return ptr;
|
|
16
|
+
}
|
|
17
|
+
free() {
|
|
18
|
+
const ptr = this.__destroy_into_raw();
|
|
19
|
+
wasm.__wbg_authclient_free(ptr, 0);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @param {string} name
|
|
23
|
+
* @returns {Promise<any>}
|
|
24
|
+
*/
|
|
25
|
+
createWorkspace(name) {
|
|
26
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
27
|
+
const len0 = WASM_VECTOR_LEN;
|
|
28
|
+
const ret = wasm.authclient_createWorkspace(this.__wbg_ptr, ptr0, len0);
|
|
29
|
+
return ret;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @returns {Promise<void>}
|
|
33
|
+
*/
|
|
34
|
+
deleteAccount() {
|
|
35
|
+
const ret = wasm.authclient_deleteAccount(this.__wbg_ptr);
|
|
36
|
+
return ret;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @param {string} device_id
|
|
40
|
+
* @returns {Promise<void>}
|
|
41
|
+
*/
|
|
42
|
+
deleteDevice(device_id) {
|
|
43
|
+
const ptr0 = passStringToWasm0(device_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
44
|
+
const len0 = WASM_VECTOR_LEN;
|
|
45
|
+
const ret = wasm.authclient_deleteDevice(this.__wbg_ptr, ptr0, len0);
|
|
46
|
+
return ret;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* @param {string} workspace_id
|
|
50
|
+
* @returns {Promise<void>}
|
|
51
|
+
*/
|
|
52
|
+
deleteWorkspace(workspace_id) {
|
|
53
|
+
const ptr0 = passStringToWasm0(workspace_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
54
|
+
const len0 = WASM_VECTOR_LEN;
|
|
55
|
+
const ret = wasm.authclient_deleteWorkspace(this.__wbg_ptr, ptr0, len0);
|
|
56
|
+
return ret;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* @returns {Promise<any>}
|
|
60
|
+
*/
|
|
61
|
+
getDevices() {
|
|
62
|
+
const ret = wasm.authclient_getDevices(this.__wbg_ptr);
|
|
63
|
+
return ret;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @returns {Promise<any>}
|
|
67
|
+
*/
|
|
68
|
+
getMe() {
|
|
69
|
+
const ret = wasm.authclient_getMe(this.__wbg_ptr);
|
|
70
|
+
return ret;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Load non-secret session metadata as a JSON string (or `null`).
|
|
74
|
+
* @returns {Promise<any>}
|
|
75
|
+
*/
|
|
76
|
+
getMetadata() {
|
|
77
|
+
const ret = wasm.authclient_getMetadata(this.__wbg_ptr);
|
|
78
|
+
return ret;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Whether a session is currently established (per the `hasSession` callback).
|
|
82
|
+
* @returns {Promise<boolean>}
|
|
83
|
+
*/
|
|
84
|
+
isAuthenticated() {
|
|
85
|
+
const ret = wasm.authclient_isAuthenticated(this.__wbg_ptr);
|
|
86
|
+
return ret;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* @returns {Promise<void>}
|
|
90
|
+
*/
|
|
91
|
+
logout() {
|
|
92
|
+
const ret = wasm.authclient_logout(this.__wbg_ptr);
|
|
93
|
+
return ret;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Create a new auth client targeting the given server URL.
|
|
97
|
+
*
|
|
98
|
+
* `callbacks` is a JavaScript object implementing the `AuthCallbacks`
|
|
99
|
+
* interface (see module docs for the expected shape).
|
|
100
|
+
* @param {string} server_url
|
|
101
|
+
* @param {AuthCallbacks} callbacks
|
|
102
|
+
*/
|
|
103
|
+
constructor(server_url, callbacks) {
|
|
104
|
+
const ptr0 = passStringToWasm0(server_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
105
|
+
const len0 = WASM_VECTOR_LEN;
|
|
106
|
+
const ret = wasm.authclient_new(ptr0, len0, callbacks);
|
|
107
|
+
this.__wbg_ptr = ret >>> 0;
|
|
108
|
+
AuthClientFinalization.register(this, this.__wbg_ptr, this);
|
|
109
|
+
return this;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* @returns {Promise<any>}
|
|
113
|
+
*/
|
|
114
|
+
refreshToken() {
|
|
115
|
+
const ret = wasm.authclient_refreshToken(this.__wbg_ptr);
|
|
116
|
+
return ret;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* @param {string} device_id
|
|
120
|
+
* @param {string} new_name
|
|
121
|
+
* @returns {Promise<void>}
|
|
122
|
+
*/
|
|
123
|
+
renameDevice(device_id, new_name) {
|
|
124
|
+
const ptr0 = passStringToWasm0(device_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
125
|
+
const len0 = WASM_VECTOR_LEN;
|
|
126
|
+
const ptr1 = passStringToWasm0(new_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
127
|
+
const len1 = WASM_VECTOR_LEN;
|
|
128
|
+
const ret = wasm.authclient_renameDevice(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
129
|
+
return ret;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* @param {string} workspace_id
|
|
133
|
+
* @param {string} new_name
|
|
134
|
+
* @returns {Promise<void>}
|
|
135
|
+
*/
|
|
136
|
+
renameWorkspace(workspace_id, new_name) {
|
|
137
|
+
const ptr0 = passStringToWasm0(workspace_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
138
|
+
const len0 = WASM_VECTOR_LEN;
|
|
139
|
+
const ptr1 = passStringToWasm0(new_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
140
|
+
const len1 = WASM_VECTOR_LEN;
|
|
141
|
+
const ret = wasm.authclient_renameWorkspace(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
142
|
+
return ret;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* @param {string} email
|
|
146
|
+
* @returns {Promise<any>}
|
|
147
|
+
*/
|
|
148
|
+
requestMagicLink(email) {
|
|
149
|
+
const ptr0 = passStringToWasm0(email, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
150
|
+
const len0 = WASM_VECTOR_LEN;
|
|
151
|
+
const ret = wasm.authclient_requestMagicLink(this.__wbg_ptr, ptr0, len0);
|
|
152
|
+
return ret;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Server URL this client targets.
|
|
156
|
+
* @returns {string}
|
|
157
|
+
*/
|
|
158
|
+
get serverUrl() {
|
|
159
|
+
let deferred1_0;
|
|
160
|
+
let deferred1_1;
|
|
161
|
+
try {
|
|
162
|
+
const ret = wasm.authclient_serverUrl(this.__wbg_ptr);
|
|
163
|
+
deferred1_0 = ret[0];
|
|
164
|
+
deferred1_1 = ret[1];
|
|
165
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
166
|
+
} finally {
|
|
167
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* @param {string} code
|
|
172
|
+
* @param {string} email
|
|
173
|
+
* @param {string | null} [device_name]
|
|
174
|
+
* @param {string | null} [replace_device_id]
|
|
175
|
+
* @returns {Promise<any>}
|
|
176
|
+
*/
|
|
177
|
+
verifyCode(code, email, device_name, replace_device_id) {
|
|
178
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
179
|
+
const len0 = WASM_VECTOR_LEN;
|
|
180
|
+
const ptr1 = passStringToWasm0(email, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
181
|
+
const len1 = WASM_VECTOR_LEN;
|
|
182
|
+
var ptr2 = isLikeNone(device_name) ? 0 : passStringToWasm0(device_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
183
|
+
var len2 = WASM_VECTOR_LEN;
|
|
184
|
+
var ptr3 = isLikeNone(replace_device_id) ? 0 : passStringToWasm0(replace_device_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
185
|
+
var len3 = WASM_VECTOR_LEN;
|
|
186
|
+
const ret = wasm.authclient_verifyCode(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
187
|
+
return ret;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* @param {string} token
|
|
191
|
+
* @param {string | null} [device_name]
|
|
192
|
+
* @param {string | null} [replace_device_id]
|
|
193
|
+
* @returns {Promise<any>}
|
|
194
|
+
*/
|
|
195
|
+
verifyMagicLink(token, device_name, replace_device_id) {
|
|
196
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
197
|
+
const len0 = WASM_VECTOR_LEN;
|
|
198
|
+
var ptr1 = isLikeNone(device_name) ? 0 : passStringToWasm0(device_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
199
|
+
var len1 = WASM_VECTOR_LEN;
|
|
200
|
+
var ptr2 = isLikeNone(replace_device_id) ? 0 : passStringToWasm0(replace_device_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
201
|
+
var len2 = WASM_VECTOR_LEN;
|
|
202
|
+
const ret = wasm.authclient_verifyMagicLink(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
203
|
+
return ret;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
if (Symbol.dispose) AuthClient.prototype[Symbol.dispose] = AuthClient.prototype.free;
|
|
207
|
+
|
|
3
208
|
/**
|
|
4
209
|
* Unified async backend with native storage.
|
|
5
210
|
*
|
|
@@ -325,30 +530,33 @@ export function today_formatted(format) {
|
|
|
325
530
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
326
531
|
}
|
|
327
532
|
}
|
|
328
|
-
|
|
329
533
|
function __wbg_get_imports() {
|
|
330
534
|
const import0 = {
|
|
331
535
|
__proto__: null,
|
|
332
|
-
|
|
536
|
+
__wbg___wbindgen_boolean_get_6ea149f0a8dcc5ff: function(arg0) {
|
|
333
537
|
const v = arg0;
|
|
334
538
|
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
335
539
|
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
336
540
|
},
|
|
337
|
-
|
|
541
|
+
__wbg___wbindgen_is_function_3baa9db1a987f47d: function(arg0) {
|
|
338
542
|
const ret = typeof(arg0) === 'function';
|
|
339
543
|
return ret;
|
|
340
544
|
},
|
|
341
|
-
|
|
545
|
+
__wbg___wbindgen_is_null_52ff4ec04186736f: function(arg0) {
|
|
546
|
+
const ret = arg0 === null;
|
|
547
|
+
return ret;
|
|
548
|
+
},
|
|
549
|
+
__wbg___wbindgen_is_undefined_29a43b4d42920abd: function(arg0) {
|
|
342
550
|
const ret = arg0 === undefined;
|
|
343
551
|
return ret;
|
|
344
552
|
},
|
|
345
|
-
|
|
553
|
+
__wbg___wbindgen_number_get_c7f42aed0525c451: function(arg0, arg1) {
|
|
346
554
|
const obj = arg1;
|
|
347
555
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
348
556
|
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
349
557
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
350
558
|
},
|
|
351
|
-
|
|
559
|
+
__wbg___wbindgen_string_get_7ed5322991caaec5: function(arg0, arg1) {
|
|
352
560
|
const obj = arg1;
|
|
353
561
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
354
562
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -356,62 +564,62 @@ function __wbg_get_imports() {
|
|
|
356
564
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
357
565
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
358
566
|
},
|
|
359
|
-
|
|
567
|
+
__wbg___wbindgen_throw_6b64449b9b9ed33c: function(arg0, arg1) {
|
|
360
568
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
361
569
|
},
|
|
362
|
-
|
|
570
|
+
__wbg__wbg_cb_unref_b46c9b5a9f08ec37: function(arg0) {
|
|
363
571
|
arg0._wbg_cb_unref();
|
|
364
572
|
},
|
|
365
|
-
|
|
573
|
+
__wbg_apply_4c35bd236dda9c14: function() { return handleError(function (arg0, arg1, arg2) {
|
|
366
574
|
const ret = arg0.apply(arg1, arg2);
|
|
367
575
|
return ret;
|
|
368
576
|
}, arguments); },
|
|
369
|
-
|
|
370
|
-
const ret = arg0.call(arg1
|
|
577
|
+
__wbg_call_14b169f759b26747: function() { return handleError(function (arg0, arg1) {
|
|
578
|
+
const ret = arg0.call(arg1);
|
|
371
579
|
return ret;
|
|
372
580
|
}, arguments); },
|
|
373
|
-
|
|
374
|
-
const ret = arg0.call(arg1);
|
|
581
|
+
__wbg_call_86e39d65afc3d9db: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
582
|
+
const ret = arg0.call(arg1, arg2, arg3, arg4);
|
|
375
583
|
return ret;
|
|
376
584
|
}, arguments); },
|
|
377
|
-
|
|
585
|
+
__wbg_call_a24592a6f349a97e: function() { return handleError(function (arg0, arg1, arg2) {
|
|
378
586
|
const ret = arg0.call(arg1, arg2);
|
|
379
587
|
return ret;
|
|
380
588
|
}, arguments); },
|
|
381
|
-
|
|
382
|
-
const ret = arg0.call(arg1, arg2, arg3
|
|
589
|
+
__wbg_call_bb28efe6b2f55b86: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
590
|
+
const ret = arg0.call(arg1, arg2, arg3);
|
|
383
591
|
return ret;
|
|
384
592
|
}, arguments); },
|
|
385
|
-
|
|
593
|
+
__wbg_debug_4e190d233ee2e0d8: function(arg0, arg1, arg2, arg3) {
|
|
386
594
|
console.debug(arg0, arg1, arg2, arg3);
|
|
387
595
|
},
|
|
388
596
|
__wbg_diaryxbackend_new: function(arg0) {
|
|
389
597
|
const ret = DiaryxBackend.__wrap(arg0);
|
|
390
598
|
return ret;
|
|
391
599
|
},
|
|
392
|
-
|
|
600
|
+
__wbg_error_a6a4bb2525a88971: function(arg0, arg1, arg2, arg3) {
|
|
393
601
|
console.error(arg0, arg1, arg2, arg3);
|
|
394
602
|
},
|
|
395
|
-
|
|
603
|
+
__wbg_getTime_da7c55f52b71e8c6: function(arg0) {
|
|
396
604
|
const ret = arg0.getTime();
|
|
397
605
|
return ret;
|
|
398
606
|
},
|
|
399
|
-
|
|
607
|
+
__wbg_getTimezoneOffset_31f57a5389d0d57c: function(arg0) {
|
|
400
608
|
const ret = arg0.getTimezoneOffset();
|
|
401
609
|
return ret;
|
|
402
610
|
},
|
|
403
|
-
|
|
404
|
-
const ret = arg0[arg1 >>> 0];
|
|
405
|
-
return ret;
|
|
406
|
-
},
|
|
407
|
-
__wbg_get_f96702c6245e4ef9: function() { return handleError(function (arg0, arg1) {
|
|
611
|
+
__wbg_get_6011fa3a58f61074: function() { return handleError(function (arg0, arg1) {
|
|
408
612
|
const ret = Reflect.get(arg0, arg1);
|
|
409
613
|
return ret;
|
|
410
614
|
}, arguments); },
|
|
411
|
-
|
|
615
|
+
__wbg_get_8360291721e2339f: function(arg0, arg1) {
|
|
616
|
+
const ret = arg0[arg1 >>> 0];
|
|
617
|
+
return ret;
|
|
618
|
+
},
|
|
619
|
+
__wbg_info_e1c3400f7bf783dc: function(arg0, arg1, arg2, arg3) {
|
|
412
620
|
console.info(arg0, arg1, arg2, arg3);
|
|
413
621
|
},
|
|
414
|
-
|
|
622
|
+
__wbg_instanceof_Object_7c99480a1cdfb911: function(arg0) {
|
|
415
623
|
let result;
|
|
416
624
|
try {
|
|
417
625
|
result = arg0 instanceof Object;
|
|
@@ -421,7 +629,7 @@ function __wbg_get_imports() {
|
|
|
421
629
|
const ret = result;
|
|
422
630
|
return ret;
|
|
423
631
|
},
|
|
424
|
-
|
|
632
|
+
__wbg_instanceof_Promise_78658358a9b27cd4: function(arg0) {
|
|
425
633
|
let result;
|
|
426
634
|
try {
|
|
427
635
|
result = arg0 instanceof Promise;
|
|
@@ -431,7 +639,7 @@ function __wbg_get_imports() {
|
|
|
431
639
|
const ret = result;
|
|
432
640
|
return ret;
|
|
433
641
|
},
|
|
434
|
-
|
|
642
|
+
__wbg_instanceof_Uint8Array_152ba1f289edcf3f: function(arg0) {
|
|
435
643
|
let result;
|
|
436
644
|
try {
|
|
437
645
|
result = arg0 instanceof Uint8Array;
|
|
@@ -441,45 +649,53 @@ function __wbg_get_imports() {
|
|
|
441
649
|
const ret = result;
|
|
442
650
|
return ret;
|
|
443
651
|
},
|
|
444
|
-
|
|
652
|
+
__wbg_isArray_c3109d14ffc06469: function(arg0) {
|
|
445
653
|
const ret = Array.isArray(arg0);
|
|
446
654
|
return ret;
|
|
447
655
|
},
|
|
448
|
-
|
|
656
|
+
__wbg_length_3d4ecd04bd8d22f1: function(arg0) {
|
|
449
657
|
const ret = arg0.length;
|
|
450
658
|
return ret;
|
|
451
659
|
},
|
|
452
|
-
|
|
660
|
+
__wbg_length_9f1775224cf1d815: function(arg0) {
|
|
453
661
|
const ret = arg0.length;
|
|
454
662
|
return ret;
|
|
455
663
|
},
|
|
456
|
-
|
|
664
|
+
__wbg_log_465fe3993e4051bf: function(arg0, arg1, arg2, arg3) {
|
|
457
665
|
console.log(arg0, arg1, arg2, arg3);
|
|
458
666
|
},
|
|
459
|
-
|
|
667
|
+
__wbg_new_0_4d657201ced14de3: function() {
|
|
460
668
|
const ret = new Date();
|
|
461
669
|
return ret;
|
|
462
670
|
},
|
|
463
|
-
|
|
464
|
-
const ret = new
|
|
671
|
+
__wbg_new_5e360d2ff7b9e1c3: function(arg0, arg1) {
|
|
672
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
465
673
|
return ret;
|
|
466
674
|
},
|
|
467
|
-
|
|
675
|
+
__wbg_new_682678e2f47e32bc: function() {
|
|
468
676
|
const ret = new Array();
|
|
469
677
|
return ret;
|
|
470
678
|
},
|
|
471
|
-
|
|
679
|
+
__wbg_new_7913666fe5070684: function(arg0) {
|
|
680
|
+
const ret = new Date(arg0);
|
|
681
|
+
return ret;
|
|
682
|
+
},
|
|
683
|
+
__wbg_new_aa8d0fa9762c29bd: function() {
|
|
684
|
+
const ret = new Object();
|
|
685
|
+
return ret;
|
|
686
|
+
},
|
|
687
|
+
__wbg_new_from_slice_b5ea43e23f6008c0: function(arg0, arg1) {
|
|
472
688
|
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
473
689
|
return ret;
|
|
474
690
|
},
|
|
475
|
-
|
|
691
|
+
__wbg_new_typed_323f37fd55ab048d: function(arg0, arg1) {
|
|
476
692
|
try {
|
|
477
693
|
var state0 = {a: arg0, b: arg1};
|
|
478
694
|
var cb0 = (arg0, arg1) => {
|
|
479
695
|
const a = state0.a;
|
|
480
696
|
state0.a = 0;
|
|
481
697
|
try {
|
|
482
|
-
return
|
|
698
|
+
return wasm_bindgen__convert__closures_____invoke__h33e54e31fc8397d0(a, state0.b, arg0, arg1);
|
|
483
699
|
} finally {
|
|
484
700
|
state0.a = a;
|
|
485
701
|
}
|
|
@@ -490,65 +706,73 @@ function __wbg_get_imports() {
|
|
|
490
706
|
state0.a = 0;
|
|
491
707
|
}
|
|
492
708
|
},
|
|
493
|
-
|
|
709
|
+
__wbg_new_with_length_8c854e41ea4dae9b: function(arg0) {
|
|
494
710
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
495
711
|
return ret;
|
|
496
712
|
},
|
|
497
|
-
|
|
713
|
+
__wbg_parse_1bbc9c053611d0a7: function() { return handleError(function (arg0, arg1) {
|
|
714
|
+
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
715
|
+
return ret;
|
|
716
|
+
}, arguments); },
|
|
717
|
+
__wbg_prototypesetcall_a6b02eb00b0f4ce2: function(arg0, arg1, arg2) {
|
|
498
718
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
499
719
|
},
|
|
500
|
-
|
|
720
|
+
__wbg_push_471a5b068a5295f6: function(arg0, arg1) {
|
|
501
721
|
const ret = arg0.push(arg1);
|
|
502
722
|
return ret;
|
|
503
723
|
},
|
|
504
|
-
|
|
724
|
+
__wbg_queueMicrotask_5d15a957e6aa920e: function(arg0) {
|
|
725
|
+
queueMicrotask(arg0);
|
|
726
|
+
},
|
|
727
|
+
__wbg_queueMicrotask_f8819e5ffc402f36: function(arg0) {
|
|
505
728
|
const ret = arg0.queueMicrotask;
|
|
506
729
|
return ret;
|
|
507
730
|
},
|
|
508
|
-
|
|
509
|
-
queueMicrotask(arg0);
|
|
510
|
-
},
|
|
511
|
-
__wbg_resolve_0a79de24e9d2267b: function(arg0) {
|
|
731
|
+
__wbg_resolve_e6c466bc1052f16c: function(arg0) {
|
|
512
732
|
const ret = Promise.resolve(arg0);
|
|
513
733
|
return ret;
|
|
514
734
|
},
|
|
515
|
-
|
|
735
|
+
__wbg_set_022bee52d0b05b19: function() { return handleError(function (arg0, arg1, arg2) {
|
|
736
|
+
const ret = Reflect.set(arg0, arg1, arg2);
|
|
737
|
+
return ret;
|
|
738
|
+
}, arguments); },
|
|
739
|
+
__wbg_set_3d484eb794afec82: function(arg0, arg1, arg2) {
|
|
516
740
|
arg0.set(getArrayU8FromWasm0(arg1, arg2));
|
|
517
741
|
},
|
|
518
|
-
|
|
519
|
-
const ret = typeof
|
|
742
|
+
__wbg_static_accessor_GLOBAL_8cfadc87a297ca02: function() {
|
|
743
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
520
744
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
521
745
|
},
|
|
522
|
-
|
|
523
|
-
const ret = typeof
|
|
746
|
+
__wbg_static_accessor_GLOBAL_THIS_602256ae5c8f42cf: function() {
|
|
747
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
524
748
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
525
749
|
},
|
|
526
|
-
|
|
750
|
+
__wbg_static_accessor_SELF_e445c1c7484aecc3: function() {
|
|
527
751
|
const ret = typeof self === 'undefined' ? null : self;
|
|
528
752
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
529
753
|
},
|
|
530
|
-
|
|
754
|
+
__wbg_static_accessor_WINDOW_f20e8576ef1e0f17: function() {
|
|
531
755
|
const ret = typeof window === 'undefined' ? null : window;
|
|
532
756
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
533
757
|
},
|
|
534
|
-
|
|
758
|
+
__wbg_then_792e0c862b060889: function(arg0, arg1, arg2) {
|
|
535
759
|
const ret = arg0.then(arg1, arg2);
|
|
536
760
|
return ret;
|
|
537
761
|
},
|
|
538
|
-
|
|
762
|
+
__wbg_then_8e16ee11f05e4827: function(arg0, arg1) {
|
|
539
763
|
const ret = arg0.then(arg1);
|
|
540
764
|
return ret;
|
|
541
765
|
},
|
|
542
|
-
|
|
766
|
+
__wbg_toString_306ed0b9f320c1ca: function(arg0) {
|
|
543
767
|
const ret = arg0.toString();
|
|
544
768
|
return ret;
|
|
545
769
|
},
|
|
546
|
-
|
|
770
|
+
__wbg_warn_ad997e36628bd23a: function(arg0, arg1, arg2, arg3) {
|
|
547
771
|
console.warn(arg0, arg1, arg2, arg3);
|
|
548
772
|
},
|
|
549
773
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
550
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
551
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
774
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 597, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
775
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h3f4718a94aec51d3);
|
|
552
776
|
return ret;
|
|
553
777
|
},
|
|
554
778
|
__wbindgen_cast_0000000000000002: function(arg0) {
|
|
@@ -577,17 +801,20 @@ function __wbg_get_imports() {
|
|
|
577
801
|
};
|
|
578
802
|
}
|
|
579
803
|
|
|
580
|
-
function
|
|
581
|
-
const ret = wasm.
|
|
804
|
+
function wasm_bindgen__convert__closures_____invoke__h3f4718a94aec51d3(arg0, arg1, arg2) {
|
|
805
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h3f4718a94aec51d3(arg0, arg1, arg2);
|
|
582
806
|
if (ret[1]) {
|
|
583
807
|
throw takeFromExternrefTable0(ret[0]);
|
|
584
808
|
}
|
|
585
809
|
}
|
|
586
810
|
|
|
587
|
-
function
|
|
588
|
-
wasm.
|
|
811
|
+
function wasm_bindgen__convert__closures_____invoke__h33e54e31fc8397d0(arg0, arg1, arg2, arg3) {
|
|
812
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h33e54e31fc8397d0(arg0, arg1, arg2, arg3);
|
|
589
813
|
}
|
|
590
814
|
|
|
815
|
+
const AuthClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
816
|
+
? { register: () => {}, unregister: () => {} }
|
|
817
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_authclient_free(ptr >>> 0, 1));
|
|
591
818
|
const DiaryxBackendFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
592
819
|
? { register: () => {}, unregister: () => {} }
|
|
593
820
|
: new FinalizationRegistry(ptr => wasm.__wbg_diaryxbackend_free(ptr >>> 0, 1));
|
package/diaryx_wasm_bg.wasm
CHANGED
|
Binary file
|
package/diaryx_wasm_bg.wasm.d.ts
CHANGED
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __wbg_authclient_free: (a: number, b: number) => void;
|
|
4
5
|
export const __wbg_diaryxbackend_free: (a: number, b: number) => void;
|
|
5
6
|
export const __wbg_jsasyncfilesystem_free: (a: number, b: number) => void;
|
|
7
|
+
export const authclient_createWorkspace: (a: number, b: number, c: number) => any;
|
|
8
|
+
export const authclient_deleteAccount: (a: number) => any;
|
|
9
|
+
export const authclient_deleteDevice: (a: number, b: number, c: number) => any;
|
|
10
|
+
export const authclient_deleteWorkspace: (a: number, b: number, c: number) => any;
|
|
11
|
+
export const authclient_getDevices: (a: number) => any;
|
|
12
|
+
export const authclient_getMe: (a: number) => any;
|
|
13
|
+
export const authclient_getMetadata: (a: number) => any;
|
|
14
|
+
export const authclient_isAuthenticated: (a: number) => any;
|
|
15
|
+
export const authclient_logout: (a: number) => any;
|
|
16
|
+
export const authclient_new: (a: number, b: number, c: any) => number;
|
|
17
|
+
export const authclient_refreshToken: (a: number) => any;
|
|
18
|
+
export const authclient_renameDevice: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
19
|
+
export const authclient_renameWorkspace: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
20
|
+
export const authclient_requestMagicLink: (a: number, b: number, c: number) => any;
|
|
21
|
+
export const authclient_serverUrl: (a: number) => [number, number];
|
|
22
|
+
export const authclient_verifyCode: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => any;
|
|
23
|
+
export const authclient_verifyMagicLink: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;
|
|
6
24
|
export const diaryxbackend_create: (a: number, b: number) => any;
|
|
7
25
|
export const diaryxbackend_createFromJsFileSystem: (a: any) => [number, number, number];
|
|
8
26
|
export const diaryxbackend_createInMemory: () => [number, number, number];
|
|
@@ -21,14 +39,14 @@ export const now_timestamp: () => [number, number];
|
|
|
21
39
|
export const today_formatted: (a: number, b: number) => [number, number];
|
|
22
40
|
export const init: () => void;
|
|
23
41
|
export const diaryxbackend_isCrdtEnabled: (a: number) => number;
|
|
24
|
-
export const
|
|
25
|
-
export const
|
|
42
|
+
export const wasm_bindgen__convert__closures_____invoke__h3f4718a94aec51d3: (a: number, b: number, c: any) => [number, number];
|
|
43
|
+
export const wasm_bindgen__convert__closures_____invoke__h33e54e31fc8397d0: (a: number, b: number, c: any, d: any) => void;
|
|
26
44
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
27
45
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
28
46
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
29
47
|
export const __externref_table_alloc: () => number;
|
|
30
48
|
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
31
49
|
export const __wbindgen_destroy_closure: (a: number, b: number) => void;
|
|
32
|
-
export const __externref_table_dealloc: (a: number) => void;
|
|
33
50
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
51
|
+
export const __externref_table_dealloc: (a: number) => void;
|
|
34
52
|
export const __wbindgen_start: () => void;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@diaryx/wasm-node",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"description": "WebAssembly bindings for Diaryx core functionality",
|
|
5
|
-
"version": "1.4.3-dev.
|
|
5
|
+
"version": "1.4.3-dev.a2e8118",
|
|
6
6
|
"license": "SEE LICENSE IN ../../LICENSE.md",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|