@diaryx/wasm-node 1.6.0 → 1.6.1-dev.4b9ad80
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/diaryx_wasm.d.ts +20 -7
- package/diaryx_wasm.js +32 -6
- package/diaryx_wasm_bg.wasm +0 -0
- package/diaryx_wasm_bg.wasm.d.ts +4 -2
- package/package.json +1 -1
package/diaryx_wasm.d.ts
CHANGED
|
@@ -52,8 +52,8 @@ export interface JsFileSystemCallbacks {
|
|
|
52
52
|
export class AuthClient {
|
|
53
53
|
free(): void;
|
|
54
54
|
[Symbol.dispose](): void;
|
|
55
|
-
deleteAccount(): Promise<
|
|
56
|
-
deleteDevice(device_id: string): Promise<
|
|
55
|
+
deleteAccount(): Promise<any>;
|
|
56
|
+
deleteDevice(device_id: string): Promise<any>;
|
|
57
57
|
getDevices(): Promise<any>;
|
|
58
58
|
getMe(): Promise<any>;
|
|
59
59
|
/**
|
|
@@ -63,8 +63,8 @@ export class AuthClient {
|
|
|
63
63
|
/**
|
|
64
64
|
* Whether a session is currently established (per the `hasSession` callback).
|
|
65
65
|
*/
|
|
66
|
-
isAuthenticated(): Promise<
|
|
67
|
-
logout(): Promise<
|
|
66
|
+
isAuthenticated(): Promise<any>;
|
|
67
|
+
logout(): Promise<any>;
|
|
68
68
|
/**
|
|
69
69
|
* Create a new auth client targeting the given server URL.
|
|
70
70
|
*
|
|
@@ -73,7 +73,7 @@ export class AuthClient {
|
|
|
73
73
|
*/
|
|
74
74
|
constructor(server_url: string, callbacks: AuthCallbacks);
|
|
75
75
|
refreshToken(): Promise<any>;
|
|
76
|
-
renameDevice(device_id: string, new_name: string): Promise<
|
|
76
|
+
renameDevice(device_id: string, new_name: string): Promise<any>;
|
|
77
77
|
requestMagicLink(email: string): Promise<any>;
|
|
78
78
|
verifyCode(code: string, email: string, device_name?: string | null, replace_device_id?: string | null): Promise<any>;
|
|
79
79
|
verifyMagicLink(token: string, device_name?: string | null, replace_device_id?: string | null): Promise<any>;
|
|
@@ -190,6 +190,17 @@ export class DiaryxBackend {
|
|
|
190
190
|
* ```
|
|
191
191
|
*/
|
|
192
192
|
onFileSystemEvent(callback: Function): bigint;
|
|
193
|
+
/**
|
|
194
|
+
* Publish (or preview) the active workspace to its namespace using the core
|
|
195
|
+
* [`PublishService`]. `provider` is a JS object whose seven async methods
|
|
196
|
+
* perform the namespace HTTP calls on the main thread (see
|
|
197
|
+
* [`crate::publish`] for the expected shape). When `preview` is true the
|
|
198
|
+
* plan is computed but NOT applied (no uploads/deletes/build).
|
|
199
|
+
*
|
|
200
|
+
* Resolves to a JSON string: a publish receipt (apply) or the plan summary
|
|
201
|
+
* (preview).
|
|
202
|
+
*/
|
|
203
|
+
publishWorkspace(provider: any, namespace_id: string, base_url: string | null | undefined, preview: boolean): Promise<any>;
|
|
193
204
|
/**
|
|
194
205
|
* Read binary file.
|
|
195
206
|
*
|
|
@@ -299,9 +310,11 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
299
310
|
|
|
300
311
|
export interface InitOutput {
|
|
301
312
|
readonly memory: WebAssembly.Memory;
|
|
313
|
+
readonly __getrandom_v03_custom: (a: number, b: number) => number;
|
|
302
314
|
readonly __wbg_authclient_free: (a: number, b: number) => void;
|
|
303
315
|
readonly __wbg_diaryxbackend_free: (a: number, b: number) => void;
|
|
304
316
|
readonly __wbg_jsasyncfilesystem_free: (a: number, b: number) => void;
|
|
317
|
+
readonly __wbg_namespaceclient_free: (a: number, b: number) => void;
|
|
305
318
|
readonly authclient_deleteAccount: (a: number) => any;
|
|
306
319
|
readonly authclient_deleteDevice: (a: number, b: number, c: number) => any;
|
|
307
320
|
readonly authclient_getDevices: (a: number) => any;
|
|
@@ -324,6 +337,7 @@ export interface InitOutput {
|
|
|
324
337
|
readonly diaryxbackend_execute: (a: number, b: number, c: number) => any;
|
|
325
338
|
readonly diaryxbackend_offFileSystemEvent: (a: number, b: bigint) => number;
|
|
326
339
|
readonly diaryxbackend_onFileSystemEvent: (a: number, b: any) => bigint;
|
|
340
|
+
readonly diaryxbackend_publishWorkspace: (a: number, b: any, c: number, d: number, e: number, f: number, g: number) => any;
|
|
327
341
|
readonly diaryxbackend_readBinary: (a: number, b: number, c: number) => any;
|
|
328
342
|
readonly diaryxbackend_writeBinary: (a: number, b: number, c: number, d: any) => any;
|
|
329
343
|
readonly jsasyncfilesystem_has_callback: (a: number, b: number, c: number) => number;
|
|
@@ -338,6 +352,7 @@ export interface InitOutput {
|
|
|
338
352
|
readonly namespaceclient_listAudiences: (a: number, b: number, c: number) => any;
|
|
339
353
|
readonly namespaceclient_listDomains: (a: number, b: number, c: number) => any;
|
|
340
354
|
readonly namespaceclient_listSubscribers: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
355
|
+
readonly namespaceclient_new: (a: number, b: number, c: any) => number;
|
|
341
356
|
readonly namespaceclient_registerDomain: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;
|
|
342
357
|
readonly namespaceclient_releaseSubdomain: (a: number, b: number, c: number) => any;
|
|
343
358
|
readonly namespaceclient_removeDomain: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
@@ -349,8 +364,6 @@ export interface InitOutput {
|
|
|
349
364
|
readonly now_timestamp: () => [number, number];
|
|
350
365
|
readonly today_formatted: (a: number, b: number) => [number, number];
|
|
351
366
|
readonly init: () => void;
|
|
352
|
-
readonly namespaceclient_new: (a: number, b: number, c: any) => number;
|
|
353
|
-
readonly __wbg_namespaceclient_free: (a: number, b: number) => void;
|
|
354
367
|
readonly wasm_bindgen__convert__closures_____invoke__h81bafde9f0567339: (a: number, b: number, c: any) => [number, number];
|
|
355
368
|
readonly wasm_bindgen__convert__closures_____invoke__h18406d6ac130c616: (a: number, b: number, c: any, d: any) => void;
|
|
356
369
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
package/diaryx_wasm.js
CHANGED
|
@@ -19,7 +19,7 @@ export class AuthClient {
|
|
|
19
19
|
wasm.__wbg_authclient_free(ptr, 0);
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* @returns {Promise<
|
|
22
|
+
* @returns {Promise<any>}
|
|
23
23
|
*/
|
|
24
24
|
deleteAccount() {
|
|
25
25
|
const ret = wasm.authclient_deleteAccount(this.__wbg_ptr);
|
|
@@ -27,7 +27,7 @@ export class AuthClient {
|
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* @param {string} device_id
|
|
30
|
-
* @returns {Promise<
|
|
30
|
+
* @returns {Promise<any>}
|
|
31
31
|
*/
|
|
32
32
|
deleteDevice(device_id) {
|
|
33
33
|
const ptr0 = passStringToWasm0(device_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -59,14 +59,14 @@ export class AuthClient {
|
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* Whether a session is currently established (per the `hasSession` callback).
|
|
62
|
-
* @returns {Promise<
|
|
62
|
+
* @returns {Promise<any>}
|
|
63
63
|
*/
|
|
64
64
|
isAuthenticated() {
|
|
65
65
|
const ret = wasm.authclient_isAuthenticated(this.__wbg_ptr);
|
|
66
66
|
return ret;
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
|
-
* @returns {Promise<
|
|
69
|
+
* @returns {Promise<any>}
|
|
70
70
|
*/
|
|
71
71
|
logout() {
|
|
72
72
|
const ret = wasm.authclient_logout(this.__wbg_ptr);
|
|
@@ -98,7 +98,7 @@ export class AuthClient {
|
|
|
98
98
|
/**
|
|
99
99
|
* @param {string} device_id
|
|
100
100
|
* @param {string} new_name
|
|
101
|
-
* @returns {Promise<
|
|
101
|
+
* @returns {Promise<any>}
|
|
102
102
|
*/
|
|
103
103
|
renameDevice(device_id, new_name) {
|
|
104
104
|
const ptr0 = passStringToWasm0(device_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -343,6 +343,29 @@ export class DiaryxBackend {
|
|
|
343
343
|
const ret = wasm.diaryxbackend_onFileSystemEvent(this.__wbg_ptr, callback);
|
|
344
344
|
return BigInt.asUintN(64, ret);
|
|
345
345
|
}
|
|
346
|
+
/**
|
|
347
|
+
* Publish (or preview) the active workspace to its namespace using the core
|
|
348
|
+
* [`PublishService`]. `provider` is a JS object whose seven async methods
|
|
349
|
+
* perform the namespace HTTP calls on the main thread (see
|
|
350
|
+
* [`crate::publish`] for the expected shape). When `preview` is true the
|
|
351
|
+
* plan is computed but NOT applied (no uploads/deletes/build).
|
|
352
|
+
*
|
|
353
|
+
* Resolves to a JSON string: a publish receipt (apply) or the plan summary
|
|
354
|
+
* (preview).
|
|
355
|
+
* @param {any} provider
|
|
356
|
+
* @param {string} namespace_id
|
|
357
|
+
* @param {string | null | undefined} base_url
|
|
358
|
+
* @param {boolean} preview
|
|
359
|
+
* @returns {Promise<any>}
|
|
360
|
+
*/
|
|
361
|
+
publishWorkspace(provider, namespace_id, base_url, preview) {
|
|
362
|
+
const ptr0 = passStringToWasm0(namespace_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
363
|
+
const len0 = WASM_VECTOR_LEN;
|
|
364
|
+
var ptr1 = isLikeNone(base_url) ? 0 : passStringToWasm0(base_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
365
|
+
var len1 = WASM_VECTOR_LEN;
|
|
366
|
+
const ret = wasm.diaryxbackend_publishWorkspace(this.__wbg_ptr, provider, ptr0, len0, ptr1, len1, preview);
|
|
367
|
+
return ret;
|
|
368
|
+
}
|
|
346
369
|
/**
|
|
347
370
|
* Read binary file.
|
|
348
371
|
*
|
|
@@ -824,6 +847,9 @@ function __wbg_get_imports() {
|
|
|
824
847
|
__wbg_error_9ad1450feb5d541d: function(arg0, arg1, arg2, arg3) {
|
|
825
848
|
console.error(arg0, arg1, arg2, arg3);
|
|
826
849
|
},
|
|
850
|
+
__wbg_getRandomValues_be0b43e9534c7a7e: function() { return handleError(function (arg0, arg1) {
|
|
851
|
+
crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
852
|
+
}, arguments); },
|
|
827
853
|
__wbg_getTime_00b3f7db575e4ef5: function(arg0) {
|
|
828
854
|
const ret = arg0.getTime();
|
|
829
855
|
return ret;
|
|
@@ -999,7 +1025,7 @@ function __wbg_get_imports() {
|
|
|
999
1025
|
console.warn(arg0, arg1, arg2, arg3);
|
|
1000
1026
|
},
|
|
1001
1027
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1002
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
1028
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 323, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1003
1029
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h81bafde9f0567339);
|
|
1004
1030
|
return ret;
|
|
1005
1031
|
},
|
package/diaryx_wasm_bg.wasm
CHANGED
|
Binary file
|
package/diaryx_wasm_bg.wasm.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __getrandom_v03_custom: (a: number, b: number) => number;
|
|
4
5
|
export const __wbg_authclient_free: (a: number, b: number) => void;
|
|
5
6
|
export const __wbg_diaryxbackend_free: (a: number, b: number) => void;
|
|
6
7
|
export const __wbg_jsasyncfilesystem_free: (a: number, b: number) => void;
|
|
8
|
+
export const __wbg_namespaceclient_free: (a: number, b: number) => void;
|
|
7
9
|
export const authclient_deleteAccount: (a: number) => any;
|
|
8
10
|
export const authclient_deleteDevice: (a: number, b: number, c: number) => any;
|
|
9
11
|
export const authclient_getDevices: (a: number) => any;
|
|
@@ -26,6 +28,7 @@ export const diaryxbackend_eventSubscriberCount: (a: number) => number;
|
|
|
26
28
|
export const diaryxbackend_execute: (a: number, b: number, c: number) => any;
|
|
27
29
|
export const diaryxbackend_offFileSystemEvent: (a: number, b: bigint) => number;
|
|
28
30
|
export const diaryxbackend_onFileSystemEvent: (a: number, b: any) => bigint;
|
|
31
|
+
export const diaryxbackend_publishWorkspace: (a: number, b: any, c: number, d: number, e: number, f: number, g: number) => any;
|
|
29
32
|
export const diaryxbackend_readBinary: (a: number, b: number, c: number) => any;
|
|
30
33
|
export const diaryxbackend_writeBinary: (a: number, b: number, c: number, d: any) => any;
|
|
31
34
|
export const jsasyncfilesystem_has_callback: (a: number, b: number, c: number) => number;
|
|
@@ -40,6 +43,7 @@ export const namespaceclient_getNamespace: (a: number, b: number, c: number) =>
|
|
|
40
43
|
export const namespaceclient_listAudiences: (a: number, b: number, c: number) => any;
|
|
41
44
|
export const namespaceclient_listDomains: (a: number, b: number, c: number) => any;
|
|
42
45
|
export const namespaceclient_listSubscribers: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
46
|
+
export const namespaceclient_new: (a: number, b: number, c: any) => number;
|
|
43
47
|
export const namespaceclient_registerDomain: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;
|
|
44
48
|
export const namespaceclient_releaseSubdomain: (a: number, b: number, c: number) => any;
|
|
45
49
|
export const namespaceclient_removeDomain: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
@@ -51,8 +55,6 @@ export const namespaceclient_updateNamespaceMetadata: (a: number, b: number, c:
|
|
|
51
55
|
export const now_timestamp: () => [number, number];
|
|
52
56
|
export const today_formatted: (a: number, b: number) => [number, number];
|
|
53
57
|
export const init: () => void;
|
|
54
|
-
export const namespaceclient_new: (a: number, b: number, c: any) => number;
|
|
55
|
-
export const __wbg_namespaceclient_free: (a: number, b: number) => void;
|
|
56
58
|
export const wasm_bindgen__convert__closures_____invoke__h81bafde9f0567339: (a: number, b: number, c: any) => [number, number];
|
|
57
59
|
export const wasm_bindgen__convert__closures_____invoke__h18406d6ac130c616: (a: number, b: number, c: any, d: any) => void;
|
|
58
60
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
package/package.json
CHANGED