@synonymdev/pubky 0.14.0 → 0.15.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 +27 -0
- package/index.cjs +437 -145
- package/index.js +438 -146
- package/package.json +4 -2
- package/pubky.d.ts +130 -5
- package/pubky_bg.wasm +0 -0
package/index.cjs
CHANGED
|
@@ -65,30 +65,18 @@ async function withSessionStore(mode, operation) {
|
|
|
65
65
|
const tx = db.transaction(PUBKY_SESSIONS_STORE_NAME, mode);
|
|
66
66
|
const store = tx.objectStore(PUBKY_SESSIONS_STORE_NAME);
|
|
67
67
|
let result;
|
|
68
|
-
let settled = false;
|
|
69
|
-
|
|
70
|
-
function fail(error) {
|
|
71
|
-
if (settled) return;
|
|
72
|
-
settled = true;
|
|
73
|
-
reject(error);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
68
|
try {
|
|
77
69
|
const request = operation(store);
|
|
78
70
|
request.onsuccess = () => {
|
|
79
71
|
result = request.result;
|
|
80
72
|
};
|
|
81
|
-
request.onerror = () =>
|
|
73
|
+
request.onerror = () => reject(request.error ?? new Error("Pubky session store request failed."));
|
|
82
74
|
} catch (error) {
|
|
83
|
-
|
|
75
|
+
reject(error);
|
|
84
76
|
}
|
|
85
|
-
tx.onerror = () =>
|
|
86
|
-
tx.onabort = () =>
|
|
87
|
-
tx.oncomplete = () =>
|
|
88
|
-
if (settled) return;
|
|
89
|
-
settled = true;
|
|
90
|
-
resolve(result);
|
|
91
|
-
};
|
|
77
|
+
tx.onerror = () => reject(tx.error ?? new Error("Pubky session store transaction failed."));
|
|
78
|
+
tx.onabort = () => reject(tx.error ?? new Error("Pubky session store transaction aborted."));
|
|
79
|
+
tx.oncomplete = () => resolve(result);
|
|
92
80
|
});
|
|
93
81
|
} finally {
|
|
94
82
|
db.close();
|
|
@@ -99,6 +87,7 @@ async function withSessionStore(mode, operation) {
|
|
|
99
87
|
async function __pubkySessionStoreIsAvailable() {
|
|
100
88
|
if (!globalThis.indexedDB) return false;
|
|
101
89
|
try {
|
|
90
|
+
if (!globalThis.navigator?.locks) return false;
|
|
102
91
|
const db = await openSessionStoreDb();
|
|
103
92
|
db.close();
|
|
104
93
|
return true;
|
|
@@ -108,10 +97,15 @@ async function __pubkySessionStoreIsAvailable() {
|
|
|
108
97
|
}
|
|
109
98
|
|
|
110
99
|
/** Persist or replace a browser session record. */
|
|
111
|
-
async function __pubkySessionStorePut(record) {
|
|
100
|
+
async function __pubkySessionStorePut(record, lease) {
|
|
112
101
|
requireIndexedDb();
|
|
113
102
|
try {
|
|
114
|
-
|
|
103
|
+
const previous = await __pubkySessionStoreGet(record.id);
|
|
104
|
+
if (previous?.sharedSession) record.sharedSession = previous.sharedSession;
|
|
105
|
+
await withSessionStore("readwrite", (store) => {
|
|
106
|
+
requireSessionLease(lease, true);
|
|
107
|
+
return store.put(record);
|
|
108
|
+
});
|
|
115
109
|
} catch (error) {
|
|
116
110
|
throw contextualSessionStoreError("Saving Pubky session failed.", error);
|
|
117
111
|
}
|
|
@@ -137,65 +131,130 @@ async function __pubkySessionStoreList() {
|
|
|
137
131
|
}
|
|
138
132
|
}
|
|
139
133
|
|
|
140
|
-
/**
|
|
141
|
-
async function
|
|
142
|
-
requireIndexedDb();
|
|
143
|
-
try {
|
|
144
|
-
await withSessionStore("readwrite", (store) => store.delete(id));
|
|
145
|
-
} catch (error) {
|
|
146
|
-
throw contextualSessionStoreError("Removing Pubky session failed.", error);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Clear saved session records and the delegated keys referenced by those records.
|
|
152
|
-
*
|
|
153
|
-
* Delegated keys not referenced by the supplied ids are intentionally preserved,
|
|
154
|
-
* because they may belong to pending or unsaved grant flows.
|
|
155
|
-
*/
|
|
156
|
-
async function __pubkySessionStoreClear(delegatedKeyIds) {
|
|
134
|
+
/** Clear saved sessions and their keys, or every key when clearing all auth state. */
|
|
135
|
+
async function clearSessionStore(allKeys = false) {
|
|
157
136
|
requireIndexedDb();
|
|
158
137
|
const db = await openSessionStoreDb();
|
|
159
138
|
try {
|
|
160
139
|
await new Promise((resolve, reject) => {
|
|
161
140
|
const tx = db.transaction(
|
|
162
|
-
[PUBKY_SESSIONS_STORE_NAME, PUBKY_SESSIONS_DELEGATED_KEYS_STORE_NAME],
|
|
163
|
-
"readwrite",
|
|
141
|
+
[PUBKY_SESSIONS_STORE_NAME, PUBKY_SESSIONS_DELEGATED_KEYS_STORE_NAME], "readwrite",
|
|
164
142
|
);
|
|
165
143
|
const sessions = tx.objectStore(PUBKY_SESSIONS_STORE_NAME);
|
|
166
144
|
const keys = tx.objectStore(PUBKY_SESSIONS_DELEGATED_KEYS_STORE_NAME);
|
|
167
|
-
sessions.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
145
|
+
const records = sessions.getAll();
|
|
146
|
+
records.onsuccess = () => {
|
|
147
|
+
try {
|
|
148
|
+
if (allKeys) keys.clear();
|
|
149
|
+
else for (const record of records.result) {
|
|
150
|
+
if (record.storageMode === "delegated") keys.delete(JSON.parse(record.credential).keyId);
|
|
151
|
+
}
|
|
152
|
+
sessions.clear();
|
|
153
|
+
} catch (error) { tx.abort(); reject(error); }
|
|
154
|
+
};
|
|
155
|
+
tx.oncomplete = resolve;
|
|
156
|
+
tx.onerror = tx.onabort = () => reject(tx.error ?? new Error("Clearing browser sessions failed."));
|
|
174
157
|
});
|
|
175
|
-
} finally {
|
|
176
|
-
|
|
158
|
+
} finally { db.close(); }
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const SESSION_STORE_LOCK = "pubky-session-store";
|
|
162
|
+
const sessionLeases = new Map();
|
|
163
|
+
let nextSessionLease = 0;
|
|
164
|
+
const sessionChannel = typeof indexedDB !== "undefined" && typeof BroadcastChannel === "function"
|
|
165
|
+
? new BroadcastChannel("pubky-session-store") : null;
|
|
166
|
+
function notifySessionChange(detail) {
|
|
167
|
+
if (typeof globalThis.dispatchEvent === "function") {
|
|
168
|
+
globalThis.dispatchEvent(new CustomEvent("pubky-session-changed", { detail }));
|
|
177
169
|
}
|
|
178
170
|
}
|
|
171
|
+
if (sessionChannel) sessionChannel.onmessage = event => notifySessionChange(event.data);
|
|
172
|
+
function sessionChanged(id, action) {
|
|
173
|
+
const detail = { id, action };
|
|
174
|
+
notifySessionChange(detail);
|
|
175
|
+
sessionChannel?.postMessage(detail);
|
|
176
|
+
}
|
|
179
177
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
178
|
+
function __pubkySessionAcquire(id, homeserver, exclusive) {
|
|
179
|
+
if (!globalThis.navigator?.locks) throw new Error("Browser sessions require Web Locks in a secure context.");
|
|
180
|
+
const token = ++nextSessionLease;
|
|
181
|
+
const abort = new AbortController();
|
|
182
|
+
let release, ready, failed;
|
|
183
|
+
const held = new Promise(resolve => { release = resolve; });
|
|
184
|
+
const waiting = new Promise((resolve, reject) => { ready = resolve; failed = reject; });
|
|
185
|
+
// Cancellation can drop the Rust future before it starts awaiting this promise.
|
|
186
|
+
waiting.catch(() => {});
|
|
187
|
+
const lease = { id, homeserver, exclusive, abort, release, waiting, active: false };
|
|
188
|
+
sessionLeases.set(token, lease);
|
|
189
|
+
navigator.locks.request(SESSION_STORE_LOCK, { mode: "shared", signal: abort.signal }, () =>
|
|
190
|
+
navigator.locks.request(`pubky-shared-session:${homeserver}:${id}`, {
|
|
191
|
+
mode: exclusive ? "exclusive" : "shared", signal: abort.signal,
|
|
192
|
+
}, async () => {
|
|
193
|
+
lease.active = true;
|
|
194
|
+
ready();
|
|
195
|
+
await held;
|
|
196
|
+
})
|
|
197
|
+
).catch(failed);
|
|
198
|
+
return token;
|
|
199
|
+
}
|
|
200
|
+
function __pubkySessionWait(token) {
|
|
201
|
+
return sessionLeases.get(token).waiting;
|
|
202
|
+
}
|
|
203
|
+
function __pubkySessionRelease(token) {
|
|
204
|
+
const lease = sessionLeases.get(token);
|
|
205
|
+
if (!lease) return;
|
|
206
|
+
lease.active = false;
|
|
207
|
+
lease.abort.abort();
|
|
208
|
+
lease.release();
|
|
209
|
+
sessionLeases.delete(token);
|
|
210
|
+
}
|
|
211
|
+
function requireSessionLease(token, write = false) {
|
|
212
|
+
const lease = sessionLeases.get(token);
|
|
213
|
+
if (!lease?.active || (write && !lease.exclusive)) throw new Error("Browser session lock was released.");
|
|
214
|
+
return lease;
|
|
215
|
+
}
|
|
216
|
+
async function __pubkySharedSessionLoad(token) {
|
|
217
|
+
const lease = requireSessionLease(token);
|
|
218
|
+
const record = await __pubkySessionStoreGet(lease.id);
|
|
219
|
+
if (record && record.homeserver !== lease.homeserver) throw new Error("Stored session homeserver changed.");
|
|
220
|
+
return record?.sharedSession;
|
|
221
|
+
}
|
|
222
|
+
async function __pubkySharedSessionStore(token, sharedSession) {
|
|
223
|
+
const lease = requireSessionLease(token, true);
|
|
224
|
+
const record = await __pubkySessionStoreGet(lease.id);
|
|
225
|
+
if (!record || record.homeserver !== lease.homeserver) throw new Error("Browser session was removed or changed.");
|
|
226
|
+
await withSessionStore("readwrite", store => {
|
|
227
|
+
requireSessionLease(token, true);
|
|
228
|
+
return store.put({ ...record, sharedSession });
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
async function __pubkySharedSessionRemove(token) {
|
|
232
|
+
const lease = requireSessionLease(token, true);
|
|
233
|
+
const record = await __pubkySessionStoreGet(lease.id);
|
|
234
|
+
if (!record) return;
|
|
183
235
|
const db = await openSessionStoreDb();
|
|
184
236
|
try {
|
|
237
|
+
requireSessionLease(token, true);
|
|
185
238
|
await new Promise((resolve, reject) => {
|
|
186
|
-
const tx = db.transaction(
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
tx.oncomplete =
|
|
193
|
-
tx.onerror = () => reject(tx.error ?? new Error("
|
|
194
|
-
tx.onabort = () => reject(tx.error ?? new Error("Clearing Pubky auth store aborted."));
|
|
239
|
+
const tx = db.transaction([PUBKY_SESSIONS_STORE_NAME, PUBKY_SESSIONS_DELEGATED_KEYS_STORE_NAME], "readwrite");
|
|
240
|
+
tx.objectStore(PUBKY_SESSIONS_STORE_NAME).delete(lease.id);
|
|
241
|
+
if (record.storageMode === "delegated") {
|
|
242
|
+
const { keyId } = JSON.parse(record.credential);
|
|
243
|
+
tx.objectStore(PUBKY_SESSIONS_DELEGATED_KEYS_STORE_NAME).delete(keyId);
|
|
244
|
+
}
|
|
245
|
+
tx.oncomplete = resolve;
|
|
246
|
+
tx.onerror = tx.onabort = () => reject(tx.error ?? new Error("Removing browser session failed."));
|
|
195
247
|
});
|
|
196
|
-
} finally {
|
|
197
|
-
|
|
198
|
-
|
|
248
|
+
} finally { db.close(); }
|
|
249
|
+
sessionChanged(lease.id, "removed");
|
|
250
|
+
}
|
|
251
|
+
async function __pubkySessionStoreClear() {
|
|
252
|
+
await navigator.locks.request(SESSION_STORE_LOCK, () => clearSessionStore());
|
|
253
|
+
sessionChanged(null, "cleared");
|
|
254
|
+
}
|
|
255
|
+
async function __pubkySessionStoreClearAll() {
|
|
256
|
+
await navigator.locks.request(SESSION_STORE_LOCK, () => clearSessionStore(true));
|
|
257
|
+
sessionChanged(null, "cleared");
|
|
199
258
|
}
|
|
200
259
|
|
|
201
260
|
const PUBKY_GRANT_KEYS_DB_NAME = "pubky-auth";
|
|
@@ -452,16 +511,6 @@ async function __pubkyGrantDelegatedSign(keyId, signingInput) {
|
|
|
452
511
|
return new Uint8Array(await crypto.subtle.sign({ name: "Ed25519" }, existing.privateKey, data));
|
|
453
512
|
}
|
|
454
513
|
|
|
455
|
-
/**
|
|
456
|
-
* Delete a browser-held delegated grant key by id.
|
|
457
|
-
*
|
|
458
|
-
* Used when a persisted delegated session record is removed from the SDK
|
|
459
|
-
* session store. Missing keys are treated as already deleted.
|
|
460
|
-
*/
|
|
461
|
-
async function __pubkyGrantDeleteDelegatedKey(keyId) {
|
|
462
|
-
requireBrowserCrypto();
|
|
463
|
-
await deleteRecord(keyId);
|
|
464
|
-
}
|
|
465
514
|
|
|
466
515
|
/**
|
|
467
516
|
* Start and control a pubkyauth authorization flow.
|
|
@@ -873,7 +922,7 @@ class BrowserSessionStore {
|
|
|
873
922
|
* This removes all stored session records and all browser-held delegated
|
|
874
923
|
* grant keys, including keys for pending delegated grant flows. Saved
|
|
875
924
|
* delegated flow state becomes unrestorable. This does not revoke remote
|
|
876
|
-
* grants
|
|
925
|
+
* grants. Browser-managed handles stop working when their saved record is removed.
|
|
877
926
|
* @returns {Promise<void>}
|
|
878
927
|
*/
|
|
879
928
|
clearAll() {
|
|
@@ -892,7 +941,7 @@ class BrowserSessionStore {
|
|
|
892
941
|
return ret;
|
|
893
942
|
}
|
|
894
943
|
/**
|
|
895
|
-
* Whether IndexedDB
|
|
944
|
+
* Whether IndexedDB and Web Locks are available.
|
|
896
945
|
* @returns {Promise<boolean>}
|
|
897
946
|
*/
|
|
898
947
|
isAvailable() {
|
|
@@ -920,6 +969,9 @@ class BrowserSessionStore {
|
|
|
920
969
|
}
|
|
921
970
|
/**
|
|
922
971
|
* Restore a specific stored session by id.
|
|
972
|
+
*
|
|
973
|
+
* Shares one bearer with other tabs on this origin. Requires IndexedDB and
|
|
974
|
+
* Web Locks in a secure browser context.
|
|
923
975
|
* @param {string} id
|
|
924
976
|
* @returns {Promise<Session>}
|
|
925
977
|
*/
|
|
@@ -3560,7 +3612,8 @@ exports.SessionInfo = SessionInfo;
|
|
|
3560
3612
|
* Only {@link SessionStorage.exists} and {@link SessionStorage.stats} treat
|
|
3561
3613
|
* HTTP 404/410 as missing. Other HTTP failures, including 401/403 and 5xx, reject.
|
|
3562
3614
|
* Writes require write permission and can fail on directory targets (400),
|
|
3563
|
-
* file/directory path conflicts (409),
|
|
3615
|
+
* file/directory path conflicts (409), a path someone holds a
|
|
3616
|
+
* {@link StorageLock} on (423), or exceeded quotas (507).
|
|
3564
3617
|
*/
|
|
3565
3618
|
class SessionStorage {
|
|
3566
3619
|
static __wrap(ptr) {
|
|
@@ -3579,6 +3632,22 @@ class SessionStorage {
|
|
|
3579
3632
|
const ptr = this.__destroy_into_raw();
|
|
3580
3633
|
wasm.__wbg_sessionstorage_free(ptr, 0);
|
|
3581
3634
|
}
|
|
3635
|
+
/**
|
|
3636
|
+
* `DELETE` the path of a lock this client holds. The lock stays in place.
|
|
3637
|
+
*
|
|
3638
|
+
* @param {StorageLock} lock A lock this client holds.
|
|
3639
|
+
* @returns {Promise<void>}
|
|
3640
|
+
* @throws {PubkyError} A lock that has expired or was unlocked rejects with
|
|
3641
|
+
* `RequestError` and status `412`; take a new one.
|
|
3642
|
+
* Otherwise as {@link SessionStorage.delete}.
|
|
3643
|
+
* @param {StorageLock} lock
|
|
3644
|
+
* @returns {Promise<void>}
|
|
3645
|
+
*/
|
|
3646
|
+
deleteLocked(lock) {
|
|
3647
|
+
_assertClass(lock, StorageLock);
|
|
3648
|
+
const ret = wasm.sessionstorage_deleteLocked(this.__wbg_ptr, lock.__wbg_ptr);
|
|
3649
|
+
return ret;
|
|
3650
|
+
}
|
|
3582
3651
|
/**
|
|
3583
3652
|
* Delete a file. Directory targets are unsupported.
|
|
3584
3653
|
*
|
|
@@ -3700,6 +3769,52 @@ class SessionStorage {
|
|
|
3700
3769
|
const ret = wasm.sessionstorage_list(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(reverse) ? 0xFFFFFF : reverse ? 1 : 0, isLikeNone(limit) ? 0xFFFFFF : limit, isLikeNone(shallow) ? 0xFFFFFF : shallow ? 1 : 0);
|
|
3701
3770
|
return ret;
|
|
3702
3771
|
}
|
|
3772
|
+
/**
|
|
3773
|
+
* Take an exclusive write lock on a file at an **absolute session path**.
|
|
3774
|
+
*
|
|
3775
|
+
* The file need not exist; locking a free path reserves it. `timeoutSeconds` is
|
|
3776
|
+
* the lifetime asked for; the homeserver caps it, and
|
|
3777
|
+
* {@link StorageLock.timeoutSeconds} tells what was granted. A write made under
|
|
3778
|
+
* the lock keeps it alive until the write ends, so it need not cover the upload itself.
|
|
3779
|
+
*
|
|
3780
|
+
* @param {Path} path File path; must not end with `/`.
|
|
3781
|
+
* @param {number} timeoutSeconds Lifetime to ask for, in seconds; rounded down to
|
|
3782
|
+
* whole seconds, and at least 1.
|
|
3783
|
+
* @returns {Promise<StorageLock>} The granted lock.
|
|
3784
|
+
* @throws {PubkyError} `InvalidInput` for a negative, NaN or out-of-range timeout;
|
|
3785
|
+
* a path that is already locked rejects with `RequestError` and status `423`;
|
|
3786
|
+
* directory targets with `400`; a homeserver without lock support with `405`.
|
|
3787
|
+
* See {@link SessionStorage} for shared errors.
|
|
3788
|
+
* @param {Path} path
|
|
3789
|
+
* @param {number} timeout_seconds
|
|
3790
|
+
* @returns {Promise<StorageLock>}
|
|
3791
|
+
*/
|
|
3792
|
+
lock(path, timeout_seconds) {
|
|
3793
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3794
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3795
|
+
const ret = wasm.sessionstorage_lock(this.__wbg_ptr, ptr0, len0, timeout_seconds);
|
|
3796
|
+
return ret;
|
|
3797
|
+
}
|
|
3798
|
+
/**
|
|
3799
|
+
* `PUT` binary data to the path of a lock this client holds.
|
|
3800
|
+
*
|
|
3801
|
+
* @param {StorageLock} lock A lock this client holds.
|
|
3802
|
+
* @param {Uint8Array} body
|
|
3803
|
+
* @returns {Promise<void>}
|
|
3804
|
+
* @throws {PubkyError} A lock that has expired or was unlocked rejects with
|
|
3805
|
+
* `RequestError` and status `412`; take a new one and read the file again.
|
|
3806
|
+
* Otherwise as {@link SessionStorage.putBytes}.
|
|
3807
|
+
* @param {StorageLock} lock
|
|
3808
|
+
* @param {Uint8Array} body
|
|
3809
|
+
* @returns {Promise<void>}
|
|
3810
|
+
*/
|
|
3811
|
+
putBytesLocked(lock, body) {
|
|
3812
|
+
_assertClass(lock, StorageLock);
|
|
3813
|
+
const ptr0 = passArray8ToWasm0(body, wasm.__wbindgen_malloc);
|
|
3814
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3815
|
+
const ret = wasm.sessionstorage_putBytesLocked(this.__wbg_ptr, lock.__wbg_ptr, ptr0, len0);
|
|
3816
|
+
return ret;
|
|
3817
|
+
}
|
|
3703
3818
|
/**
|
|
3704
3819
|
* Create or replace a file with binary data at an absolute session path.
|
|
3705
3820
|
*
|
|
@@ -3737,6 +3852,26 @@ class SessionStorage {
|
|
|
3737
3852
|
const ret = wasm.sessionstorage_putJson(this.__wbg_ptr, ptr0, len0, body);
|
|
3738
3853
|
return ret;
|
|
3739
3854
|
}
|
|
3855
|
+
/**
|
|
3856
|
+
* `PUT` text to the path of a lock this client holds.
|
|
3857
|
+
*
|
|
3858
|
+
* @param {StorageLock} lock A lock this client holds.
|
|
3859
|
+
* @param {string} body
|
|
3860
|
+
* @returns {Promise<void>}
|
|
3861
|
+
* @throws {PubkyError} A lock that has expired or was unlocked rejects with
|
|
3862
|
+
* `RequestError` and status `412`; take a new one and read the file again.
|
|
3863
|
+
* Otherwise as {@link SessionStorage.putText}.
|
|
3864
|
+
* @param {StorageLock} lock
|
|
3865
|
+
* @param {string} body
|
|
3866
|
+
* @returns {Promise<void>}
|
|
3867
|
+
*/
|
|
3868
|
+
putTextLocked(lock, body) {
|
|
3869
|
+
_assertClass(lock, StorageLock);
|
|
3870
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3871
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3872
|
+
const ret = wasm.sessionstorage_putTextLocked(this.__wbg_ptr, lock.__wbg_ptr, ptr0, len0);
|
|
3873
|
+
return ret;
|
|
3874
|
+
}
|
|
3740
3875
|
/**
|
|
3741
3876
|
* Create or replace a file with text at an absolute session path.
|
|
3742
3877
|
*
|
|
@@ -3756,6 +3891,29 @@ class SessionStorage {
|
|
|
3756
3891
|
const ret = wasm.sessionstorage_putText(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
3757
3892
|
return ret;
|
|
3758
3893
|
}
|
|
3894
|
+
/**
|
|
3895
|
+
* Restart the lifetime of a lock this client holds.
|
|
3896
|
+
*
|
|
3897
|
+
* On success the lock carries the newly granted
|
|
3898
|
+
* {@link StorageLock.timeoutSeconds}.
|
|
3899
|
+
*
|
|
3900
|
+
* @param {StorageLock} lock A lock this client holds.
|
|
3901
|
+
* @param {number} timeoutSeconds Lifetime to ask for, in seconds; rounded down to
|
|
3902
|
+
* whole seconds, and at least 1.
|
|
3903
|
+
* @returns {Promise<void>}
|
|
3904
|
+
* @throws {PubkyError} A lock that has expired or was unlocked rejects with
|
|
3905
|
+
* `RequestError` and status `412`; take a new one and read the file again.
|
|
3906
|
+
* `InvalidInput` for a negative, NaN or out-of-range timeout.
|
|
3907
|
+
* See {@link SessionStorage} for shared errors.
|
|
3908
|
+
* @param {StorageLock} lock
|
|
3909
|
+
* @param {number} timeout_seconds
|
|
3910
|
+
* @returns {Promise<void>}
|
|
3911
|
+
*/
|
|
3912
|
+
refreshLock(lock, timeout_seconds) {
|
|
3913
|
+
_assertClass(lock, StorageLock);
|
|
3914
|
+
const ret = wasm.sessionstorage_refreshLock(this.__wbg_ptr, lock.__wbg_ptr, timeout_seconds);
|
|
3915
|
+
return ret;
|
|
3916
|
+
}
|
|
3759
3917
|
/**
|
|
3760
3918
|
* Get metadata for an absolute, session-scoped path (e.g. `"/pub/app/file.json"`).
|
|
3761
3919
|
*
|
|
@@ -3773,6 +3931,21 @@ class SessionStorage {
|
|
|
3773
3931
|
const ret = wasm.sessionstorage_stats(this.__wbg_ptr, ptr0, len0);
|
|
3774
3932
|
return ret;
|
|
3775
3933
|
}
|
|
3934
|
+
/**
|
|
3935
|
+
* Release a lock this client holds.
|
|
3936
|
+
*
|
|
3937
|
+
* @param {StorageLock} lock A lock this client holds.
|
|
3938
|
+
* @returns {Promise<void>}
|
|
3939
|
+
* @throws {PubkyError} A lock that no longer exists rejects with `RequestError`
|
|
3940
|
+
* and status `409`. See {@link SessionStorage} for shared errors.
|
|
3941
|
+
* @param {StorageLock} lock
|
|
3942
|
+
* @returns {Promise<void>}
|
|
3943
|
+
*/
|
|
3944
|
+
unlock(lock) {
|
|
3945
|
+
_assertClass(lock, StorageLock);
|
|
3946
|
+
const ret = wasm.sessionstorage_unlock(this.__wbg_ptr, lock.__wbg_ptr);
|
|
3947
|
+
return ret;
|
|
3948
|
+
}
|
|
3776
3949
|
}
|
|
3777
3950
|
if (Symbol.dispose) SessionStorage.prototype[Symbol.dispose] = SessionStorage.prototype.free;
|
|
3778
3951
|
exports.SessionStorage = SessionStorage;
|
|
@@ -4501,6 +4674,107 @@ class SignupGrantDeepLink {
|
|
|
4501
4674
|
if (Symbol.dispose) SignupGrantDeepLink.prototype[Symbol.dispose] = SignupGrantDeepLink.prototype.free;
|
|
4502
4675
|
exports.SignupGrantDeepLink = SignupGrantDeepLink;
|
|
4503
4676
|
|
|
4677
|
+
/**
|
|
4678
|
+
* An exclusive write lock on one file path, granted by the homeserver.
|
|
4679
|
+
*
|
|
4680
|
+
* While the lock lives, only writes that present it are accepted on the path;
|
|
4681
|
+
* every other write, and every other {@link SessionStorage.lock}, rejects with
|
|
4682
|
+
* `423 Locked`. The lock ends when it is {@link SessionStorage.unlock | unlocked}
|
|
4683
|
+
* or when its {@link StorageLock.timeoutSeconds} runs out without a
|
|
4684
|
+
* {@link SessionStorage.refreshLock | refresh}, so a client that disappears never
|
|
4685
|
+
* blocks a path for long.
|
|
4686
|
+
*
|
|
4687
|
+
* The lock is a bearer token: whoever holds this value, and may write the path,
|
|
4688
|
+
* can use and release the lock.
|
|
4689
|
+
*
|
|
4690
|
+
* Calls that take the lock may overlap: a {@link SessionStorage.refreshLock | refresh}
|
|
4691
|
+
* can run while a locked write is in flight.
|
|
4692
|
+
*
|
|
4693
|
+
* @example
|
|
4694
|
+
* const lock = await session.storage.lock("/pub/my.app/state.json", 30);
|
|
4695
|
+
* const state = await session.storage.getText(lock.path);
|
|
4696
|
+
* await session.storage.putTextLocked(lock, state);
|
|
4697
|
+
* await session.storage.unlock(lock);
|
|
4698
|
+
*/
|
|
4699
|
+
class StorageLock {
|
|
4700
|
+
static __wrap(ptr) {
|
|
4701
|
+
const obj = Object.create(StorageLock.prototype);
|
|
4702
|
+
obj.__wbg_ptr = ptr;
|
|
4703
|
+
StorageLockFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
4704
|
+
return obj;
|
|
4705
|
+
}
|
|
4706
|
+
__destroy_into_raw() {
|
|
4707
|
+
const ptr = this.__wbg_ptr;
|
|
4708
|
+
this.__wbg_ptr = 0;
|
|
4709
|
+
StorageLockFinalization.unregister(this);
|
|
4710
|
+
return ptr;
|
|
4711
|
+
}
|
|
4712
|
+
free() {
|
|
4713
|
+
const ptr = this.__destroy_into_raw();
|
|
4714
|
+
wasm.__wbg_storagelock_free(ptr, 0);
|
|
4715
|
+
}
|
|
4716
|
+
/**
|
|
4717
|
+
* Value of the `If` header that presents this lock on a write.
|
|
4718
|
+
* @returns {string}
|
|
4719
|
+
*/
|
|
4720
|
+
ifHeader() {
|
|
4721
|
+
let deferred1_0;
|
|
4722
|
+
let deferred1_1;
|
|
4723
|
+
try {
|
|
4724
|
+
const ret = wasm.storagelock_ifHeader(this.__wbg_ptr);
|
|
4725
|
+
deferred1_0 = ret[0];
|
|
4726
|
+
deferred1_1 = ret[1];
|
|
4727
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
4728
|
+
} finally {
|
|
4729
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
4730
|
+
}
|
|
4731
|
+
}
|
|
4732
|
+
/**
|
|
4733
|
+
* The locked path.
|
|
4734
|
+
* @returns {Path}
|
|
4735
|
+
*/
|
|
4736
|
+
get path() {
|
|
4737
|
+
let deferred1_0;
|
|
4738
|
+
let deferred1_1;
|
|
4739
|
+
try {
|
|
4740
|
+
const ret = wasm.storagelock_path(this.__wbg_ptr);
|
|
4741
|
+
deferred1_0 = ret[0];
|
|
4742
|
+
deferred1_1 = ret[1];
|
|
4743
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
4744
|
+
} finally {
|
|
4745
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
4746
|
+
}
|
|
4747
|
+
}
|
|
4748
|
+
/**
|
|
4749
|
+
* Lifetime the homeserver granted at the last `lock` or `refreshLock`, in seconds,
|
|
4750
|
+
* counted from when that call resolved. It may be shorter than what was asked for.
|
|
4751
|
+
* It is not the time remaining: note when the call resolved to know when to refresh.
|
|
4752
|
+
* @returns {number}
|
|
4753
|
+
*/
|
|
4754
|
+
get timeoutSeconds() {
|
|
4755
|
+
const ret = wasm.storagelock_timeoutSeconds(this.__wbg_ptr);
|
|
4756
|
+
return ret;
|
|
4757
|
+
}
|
|
4758
|
+
/**
|
|
4759
|
+
* The lock token URL, `opaquelocktoken:<uuid>`.
|
|
4760
|
+
* @returns {string}
|
|
4761
|
+
*/
|
|
4762
|
+
get token() {
|
|
4763
|
+
let deferred1_0;
|
|
4764
|
+
let deferred1_1;
|
|
4765
|
+
try {
|
|
4766
|
+
const ret = wasm.storagelock_token(this.__wbg_ptr);
|
|
4767
|
+
deferred1_0 = ret[0];
|
|
4768
|
+
deferred1_1 = ret[1];
|
|
4769
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
4770
|
+
} finally {
|
|
4771
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
4772
|
+
}
|
|
4773
|
+
}
|
|
4774
|
+
}
|
|
4775
|
+
if (Symbol.dispose) StorageLock.prototype[Symbol.dispose] = StorageLock.prototype.free;
|
|
4776
|
+
exports.StorageLock = StorageLock;
|
|
4777
|
+
|
|
4504
4778
|
/**
|
|
4505
4779
|
* Metadata for a session saved in the browser session store.
|
|
4506
4780
|
*/
|
|
@@ -4747,14 +5021,18 @@ const import1 = {
|
|
|
4747
5021
|
__pubkyGrantEnsureDelegatedKey,
|
|
4748
5022
|
__pubkyGrantLoadDelegatedPublicKey,
|
|
4749
5023
|
__pubkyGrantDelegatedSign,
|
|
4750
|
-
__pubkyGrantDeleteDelegatedKey,
|
|
4751
5024
|
};
|
|
4752
5025
|
const import2 = {
|
|
4753
5026
|
__pubkySessionStoreIsAvailable,
|
|
4754
5027
|
__pubkySessionStorePut,
|
|
4755
5028
|
__pubkySessionStoreGet,
|
|
4756
5029
|
__pubkySessionStoreList,
|
|
4757
|
-
|
|
5030
|
+
__pubkySessionAcquire,
|
|
5031
|
+
__pubkySessionWait,
|
|
5032
|
+
__pubkySessionRelease,
|
|
5033
|
+
__pubkySharedSessionLoad,
|
|
5034
|
+
__pubkySharedSessionStore,
|
|
5035
|
+
__pubkySharedSessionRemove,
|
|
4758
5036
|
__pubkySessionStoreClear,
|
|
4759
5037
|
__pubkySessionStoreClearAll,
|
|
4760
5038
|
};
|
|
@@ -4763,7 +5041,12 @@ const import3 = {
|
|
|
4763
5041
|
__pubkySessionStorePut,
|
|
4764
5042
|
__pubkySessionStoreGet,
|
|
4765
5043
|
__pubkySessionStoreList,
|
|
4766
|
-
|
|
5044
|
+
__pubkySessionAcquire,
|
|
5045
|
+
__pubkySessionWait,
|
|
5046
|
+
__pubkySessionRelease,
|
|
5047
|
+
__pubkySharedSessionLoad,
|
|
5048
|
+
__pubkySharedSessionStore,
|
|
5049
|
+
__pubkySharedSessionRemove,
|
|
4767
5050
|
__pubkySessionStoreClear,
|
|
4768
5051
|
__pubkySessionStoreClearAll,
|
|
4769
5052
|
};
|
|
@@ -4772,7 +5055,12 @@ const import4 = {
|
|
|
4772
5055
|
__pubkySessionStorePut,
|
|
4773
5056
|
__pubkySessionStoreGet,
|
|
4774
5057
|
__pubkySessionStoreList,
|
|
4775
|
-
|
|
5058
|
+
__pubkySessionAcquire,
|
|
5059
|
+
__pubkySessionWait,
|
|
5060
|
+
__pubkySessionRelease,
|
|
5061
|
+
__pubkySharedSessionLoad,
|
|
5062
|
+
__pubkySharedSessionStore,
|
|
5063
|
+
__pubkySharedSessionRemove,
|
|
4776
5064
|
__pubkySessionStoreClear,
|
|
4777
5065
|
__pubkySessionStoreClearAll,
|
|
4778
5066
|
};
|
|
@@ -4781,26 +5069,21 @@ const import5 = {
|
|
|
4781
5069
|
__pubkySessionStorePut,
|
|
4782
5070
|
__pubkySessionStoreGet,
|
|
4783
5071
|
__pubkySessionStoreList,
|
|
4784
|
-
|
|
5072
|
+
__pubkySessionAcquire,
|
|
5073
|
+
__pubkySessionWait,
|
|
5074
|
+
__pubkySessionRelease,
|
|
5075
|
+
__pubkySharedSessionLoad,
|
|
5076
|
+
__pubkySharedSessionStore,
|
|
5077
|
+
__pubkySharedSessionRemove,
|
|
4785
5078
|
__pubkySessionStoreClear,
|
|
4786
5079
|
__pubkySessionStoreClearAll,
|
|
4787
5080
|
};
|
|
4788
5081
|
const import6 = {
|
|
4789
|
-
__pubkySessionStoreIsAvailable,
|
|
4790
|
-
__pubkySessionStorePut,
|
|
4791
|
-
__pubkySessionStoreGet,
|
|
4792
|
-
__pubkySessionStoreList,
|
|
4793
|
-
__pubkySessionStoreDelete,
|
|
4794
|
-
__pubkySessionStoreClear,
|
|
4795
|
-
__pubkySessionStoreClearAll,
|
|
4796
|
-
};
|
|
4797
|
-
const import7 = {
|
|
4798
5082
|
__pubkyGrantIsDelegationAvailable,
|
|
4799
5083
|
__pubkyGrantCanUseDelegation,
|
|
4800
5084
|
__pubkyGrantEnsureDelegatedKey,
|
|
4801
5085
|
__pubkyGrantLoadDelegatedPublicKey,
|
|
4802
5086
|
__pubkyGrantDelegatedSign,
|
|
4803
|
-
__pubkyGrantDeleteDelegatedKey,
|
|
4804
5087
|
};
|
|
4805
5088
|
|
|
4806
5089
|
function __wbg_get_imports() {
|
|
@@ -4821,7 +5104,7 @@ function __wbg_get_imports() {
|
|
|
4821
5104
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
4822
5105
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
4823
5106
|
},
|
|
4824
|
-
|
|
5107
|
+
__wbg___pubkyGrantDelegatedSign_3145fede89a925f4: function(arg0, arg1, arg2, arg3) {
|
|
4825
5108
|
let deferred0_0;
|
|
4826
5109
|
let deferred0_1;
|
|
4827
5110
|
let deferred1_0;
|
|
@@ -4838,19 +5121,7 @@ function __wbg_get_imports() {
|
|
|
4838
5121
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
4839
5122
|
}
|
|
4840
5123
|
},
|
|
4841
|
-
|
|
4842
|
-
let deferred0_0;
|
|
4843
|
-
let deferred0_1;
|
|
4844
|
-
try {
|
|
4845
|
-
deferred0_0 = arg0;
|
|
4846
|
-
deferred0_1 = arg1;
|
|
4847
|
-
const ret = __pubkyGrantDeleteDelegatedKey(getStringFromWasm0(arg0, arg1));
|
|
4848
|
-
return ret;
|
|
4849
|
-
} finally {
|
|
4850
|
-
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
4851
|
-
}
|
|
4852
|
-
},
|
|
4853
|
-
__wbg___pubkyGrantEnsureDelegatedKey_70e2f9e5fbabf7e4: function(arg0, arg1) {
|
|
5124
|
+
__wbg___pubkyGrantEnsureDelegatedKey_1067334e491ee176: function(arg0, arg1) {
|
|
4854
5125
|
let v0;
|
|
4855
5126
|
if (arg0 !== 0) {
|
|
4856
5127
|
v0 = getStringFromWasm0(arg0, arg1);
|
|
@@ -4859,7 +5130,7 @@ function __wbg_get_imports() {
|
|
|
4859
5130
|
const ret = __pubkyGrantEnsureDelegatedKey(v0);
|
|
4860
5131
|
return ret;
|
|
4861
5132
|
},
|
|
4862
|
-
|
|
5133
|
+
__wbg___pubkyGrantLoadDelegatedPublicKey_162cec02a5e4b65f: function(arg0, arg1) {
|
|
4863
5134
|
let deferred0_0;
|
|
4864
5135
|
let deferred0_1;
|
|
4865
5136
|
try {
|
|
@@ -4871,19 +5142,14 @@ function __wbg_get_imports() {
|
|
|
4871
5142
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
4872
5143
|
}
|
|
4873
5144
|
},
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
const ret = __pubkySessionStoreDelete(getStringFromWasm0(arg0, arg1));
|
|
4881
|
-
return ret;
|
|
4882
|
-
} finally {
|
|
4883
|
-
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
4884
|
-
}
|
|
5145
|
+
__wbg___pubkySessionAcquire_9cbf23c9cb4de2dd: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
5146
|
+
const ret = __pubkySessionAcquire(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), arg4 !== 0);
|
|
5147
|
+
return ret;
|
|
5148
|
+
}, arguments); },
|
|
5149
|
+
__wbg___pubkySessionRelease_61113613898f8369: function(arg0) {
|
|
5150
|
+
__pubkySessionRelease(arg0 >>> 0);
|
|
4885
5151
|
},
|
|
4886
|
-
|
|
5152
|
+
__wbg___pubkySessionStoreGet_bf3d995400545463: function(arg0, arg1) {
|
|
4887
5153
|
let deferred0_0;
|
|
4888
5154
|
let deferred0_1;
|
|
4889
5155
|
try {
|
|
@@ -4895,6 +5161,26 @@ function __wbg_get_imports() {
|
|
|
4895
5161
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
4896
5162
|
}
|
|
4897
5163
|
},
|
|
5164
|
+
__wbg___pubkySessionStorePut_a1073209d38242cc: function(arg0, arg1) {
|
|
5165
|
+
const ret = __pubkySessionStorePut(arg0, arg1 >>> 0);
|
|
5166
|
+
return ret;
|
|
5167
|
+
},
|
|
5168
|
+
__wbg___pubkySessionWait_21c5e8e3be5de6ff: function(arg0) {
|
|
5169
|
+
const ret = __pubkySessionWait(arg0 >>> 0);
|
|
5170
|
+
return ret;
|
|
5171
|
+
},
|
|
5172
|
+
__wbg___pubkySharedSessionLoad_5cd9c74d47bf2afd: function(arg0) {
|
|
5173
|
+
const ret = __pubkySharedSessionLoad(arg0 >>> 0);
|
|
5174
|
+
return ret;
|
|
5175
|
+
},
|
|
5176
|
+
__wbg___pubkySharedSessionRemove_56831ee1430cf7ad: function(arg0) {
|
|
5177
|
+
const ret = __pubkySharedSessionRemove(arg0 >>> 0);
|
|
5178
|
+
return ret;
|
|
5179
|
+
},
|
|
5180
|
+
__wbg___pubkySharedSessionStore_beb384d555af114b: function(arg0, arg1) {
|
|
5181
|
+
const ret = __pubkySharedSessionStore(arg0 >>> 0, arg1);
|
|
5182
|
+
return ret;
|
|
5183
|
+
},
|
|
4898
5184
|
__wbg___wbindgen_bigint_get_as_i64_b482365c149396c8: function(arg0, arg1) {
|
|
4899
5185
|
const v = arg1;
|
|
4900
5186
|
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
@@ -5062,6 +5348,10 @@ function __wbg_get_imports() {
|
|
|
5062
5348
|
const ret = Event.__wrap(arg0);
|
|
5063
5349
|
return ret;
|
|
5064
5350
|
},
|
|
5351
|
+
__wbg_fetch_1182c189ace424aa: function(arg0) {
|
|
5352
|
+
const ret = fetch(arg0);
|
|
5353
|
+
return ret;
|
|
5354
|
+
},
|
|
5065
5355
|
__wbg_fetch_7a37768ab67c5bd8: function(arg0) {
|
|
5066
5356
|
const ret = fetch(arg0);
|
|
5067
5357
|
return ret;
|
|
@@ -5070,10 +5360,6 @@ function __wbg_get_imports() {
|
|
|
5070
5360
|
const ret = arg0.fetch(arg1);
|
|
5071
5361
|
return ret;
|
|
5072
5362
|
},
|
|
5073
|
-
__wbg_fetch_bed2d90618c78f90: function(arg0) {
|
|
5074
|
-
const ret = fetch(arg0);
|
|
5075
|
-
return ret;
|
|
5076
|
-
},
|
|
5077
5363
|
__wbg_from_a39669ce566077da: function(arg0) {
|
|
5078
5364
|
const ret = Array.from(arg0);
|
|
5079
5365
|
return ret;
|
|
@@ -5265,7 +5551,7 @@ function __wbg_get_imports() {
|
|
|
5265
5551
|
const a = state0.a;
|
|
5266
5552
|
state0.a = 0;
|
|
5267
5553
|
try {
|
|
5268
|
-
return
|
|
5554
|
+
return wasm_bindgen_6fb33c0245079662___convert__closures_____invoke___js_sys_5fd4844d262c835b___Function_fn_wasm_bindgen_6fb33c0245079662___JsValue_____wasm_bindgen_6fb33c0245079662___sys__Undefined___js_sys_5fd4844d262c835b___Function_fn_wasm_bindgen_6fb33c0245079662___JsValue_____wasm_bindgen_6fb33c0245079662___sys__Undefined_______true_(a, state0.b, arg0, arg1);
|
|
5269
5555
|
} finally {
|
|
5270
5556
|
state0.a = a;
|
|
5271
5557
|
}
|
|
@@ -5457,6 +5743,10 @@ function __wbg_get_imports() {
|
|
|
5457
5743
|
const ret = arg0.status;
|
|
5458
5744
|
return ret;
|
|
5459
5745
|
},
|
|
5746
|
+
__wbg_storagelock_new: function(arg0) {
|
|
5747
|
+
const ret = StorageLock.__wrap(arg0);
|
|
5748
|
+
return ret;
|
|
5749
|
+
},
|
|
5460
5750
|
__wbg_storedsessioninfo_new: function(arg0) {
|
|
5461
5751
|
const ret = StoredSessionInfo.__wrap(arg0);
|
|
5462
5752
|
return ret;
|
|
@@ -5508,18 +5798,18 @@ function __wbg_get_imports() {
|
|
|
5508
5798
|
console.warn(arg0, arg1, arg2, arg3);
|
|
5509
5799
|
},
|
|
5510
5800
|
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
5511
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
5512
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
5801
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 129, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
5802
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6fb33c0245079662___convert__closures_____invoke___wasm_bindgen_6fb33c0245079662___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_6fb33c0245079662___JsError___true_);
|
|
5513
5803
|
return ret;
|
|
5514
5804
|
},
|
|
5515
5805
|
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
5516
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
5517
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
5806
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 267, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
5807
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6fb33c0245079662___convert__closures_____invoke___wasm_bindgen_6fb33c0245079662___JsValue______true_);
|
|
5518
5808
|
return ret;
|
|
5519
5809
|
},
|
|
5520
5810
|
__wbindgen_generic_0000000000000003: function(arg0, arg1) {
|
|
5521
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
5522
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
5811
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 269, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
5812
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6fb33c0245079662___convert__closures_____invoke_______true_);
|
|
5523
5813
|
return ret;
|
|
5524
5814
|
},
|
|
5525
5815
|
__wbindgen_generic_0000000000000004: function(arg0) {
|
|
@@ -5557,14 +5847,14 @@ function __wbg_get_imports() {
|
|
|
5557
5847
|
__wbindgen_generic_000000000000000a: function(arg0, arg1) {
|
|
5558
5848
|
var v0 = getArrayJsValueFromWasm0(arg0, arg1);
|
|
5559
5849
|
wasm.__wbindgen_free(arg0, arg1 * 4, 4);
|
|
5560
|
-
// Cast intrinsic for `Vector(RustStruct { name: "GrantInfo", unique_crate_identifier: "pubky-wasm-
|
|
5850
|
+
// Cast intrinsic for `Vector(RustStruct { name: "GrantInfo", unique_crate_identifier: "pubky-wasm-7d6e91dad805c24f" }) -> Externref`.
|
|
5561
5851
|
const ret = v0;
|
|
5562
5852
|
return ret;
|
|
5563
5853
|
},
|
|
5564
5854
|
__wbindgen_generic_000000000000000b: function(arg0, arg1) {
|
|
5565
5855
|
var v0 = getArrayJsValueFromWasm0(arg0, arg1);
|
|
5566
5856
|
wasm.__wbindgen_free(arg0, arg1 * 4, 4);
|
|
5567
|
-
// Cast intrinsic for `Vector(RustStruct { name: "StoredSessionInfo", unique_crate_identifier: "pubky-wasm-
|
|
5857
|
+
// Cast intrinsic for `Vector(RustStruct { name: "StoredSessionInfo", unique_crate_identifier: "pubky-wasm-7d6e91dad805c24f" }) -> Externref`.
|
|
5568
5858
|
const ret = v0;
|
|
5569
5859
|
return ret;
|
|
5570
5860
|
},
|
|
@@ -5581,33 +5871,32 @@ function __wbg_get_imports() {
|
|
|
5581
5871
|
return {
|
|
5582
5872
|
__proto__: null,
|
|
5583
5873
|
"./pubky_bg.js": import0,
|
|
5584
|
-
"./snippets/pubky-wasm-
|
|
5585
|
-
"./snippets/pubky-wasm-
|
|
5586
|
-
"./snippets/pubky-wasm-
|
|
5587
|
-
"./snippets/pubky-wasm-
|
|
5588
|
-
"./snippets/pubky-wasm-
|
|
5589
|
-
"./snippets/pubky-wasm-
|
|
5590
|
-
"./snippets/pubky-wasm-77c580e5b10ee397/inline1.js": import7,
|
|
5874
|
+
"./snippets/pubky-wasm-7d6e91dad805c24f/inline1.js": import1,
|
|
5875
|
+
"./snippets/pubky-wasm-7d6e91dad805c24f/inline0.js": import2,
|
|
5876
|
+
"./snippets/pubky-wasm-7d6e91dad805c24f/inline0.js": import3,
|
|
5877
|
+
"./snippets/pubky-wasm-7d6e91dad805c24f/inline0.js": import4,
|
|
5878
|
+
"./snippets/pubky-wasm-7d6e91dad805c24f/inline0.js": import5,
|
|
5879
|
+
"./snippets/pubky-wasm-7d6e91dad805c24f/inline1.js": import6,
|
|
5591
5880
|
};
|
|
5592
5881
|
}
|
|
5593
5882
|
|
|
5594
|
-
function
|
|
5595
|
-
wasm.
|
|
5883
|
+
function wasm_bindgen_6fb33c0245079662___convert__closures_____invoke_______true_(arg0, arg1) {
|
|
5884
|
+
wasm.wasm_bindgen_6fb33c0245079662___convert__closures_____invoke_______true_(arg0, arg1);
|
|
5596
5885
|
}
|
|
5597
5886
|
|
|
5598
|
-
function
|
|
5599
|
-
wasm.
|
|
5887
|
+
function wasm_bindgen_6fb33c0245079662___convert__closures_____invoke___wasm_bindgen_6fb33c0245079662___JsValue______true_(arg0, arg1, arg2) {
|
|
5888
|
+
wasm.wasm_bindgen_6fb33c0245079662___convert__closures_____invoke___wasm_bindgen_6fb33c0245079662___JsValue______true_(arg0, arg1, arg2);
|
|
5600
5889
|
}
|
|
5601
5890
|
|
|
5602
|
-
function
|
|
5603
|
-
const ret = wasm.
|
|
5891
|
+
function wasm_bindgen_6fb33c0245079662___convert__closures_____invoke___wasm_bindgen_6fb33c0245079662___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_6fb33c0245079662___JsError___true_(arg0, arg1, arg2) {
|
|
5892
|
+
const ret = wasm.wasm_bindgen_6fb33c0245079662___convert__closures_____invoke___wasm_bindgen_6fb33c0245079662___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_6fb33c0245079662___JsError___true_(arg0, arg1, arg2);
|
|
5604
5893
|
if (ret[1]) {
|
|
5605
5894
|
throw takeFromExternrefTable0(ret[0]);
|
|
5606
5895
|
}
|
|
5607
5896
|
}
|
|
5608
5897
|
|
|
5609
|
-
function
|
|
5610
|
-
wasm.
|
|
5898
|
+
function wasm_bindgen_6fb33c0245079662___convert__closures_____invoke___js_sys_5fd4844d262c835b___Function_fn_wasm_bindgen_6fb33c0245079662___JsValue_____wasm_bindgen_6fb33c0245079662___sys__Undefined___js_sys_5fd4844d262c835b___Function_fn_wasm_bindgen_6fb33c0245079662___JsValue_____wasm_bindgen_6fb33c0245079662___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
|
|
5899
|
+
wasm.wasm_bindgen_6fb33c0245079662___convert__closures_____invoke___js_sys_5fd4844d262c835b___Function_fn_wasm_bindgen_6fb33c0245079662___JsValue_____wasm_bindgen_6fb33c0245079662___sys__Undefined___js_sys_5fd4844d262c835b___Function_fn_wasm_bindgen_6fb33c0245079662___JsValue_____wasm_bindgen_6fb33c0245079662___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
|
|
5611
5900
|
}
|
|
5612
5901
|
|
|
5613
5902
|
|
|
@@ -5732,6 +6021,9 @@ const SignupDeepLinkFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
5732
6021
|
const SignupGrantDeepLinkFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5733
6022
|
? { register: () => {}, unregister: () => {} }
|
|
5734
6023
|
: new FinalizationRegistry(ptr => wasm.__wbg_signupgrantdeeplink_free(ptr, 1));
|
|
6024
|
+
const StorageLockFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6025
|
+
? { register: () => {}, unregister: () => {} }
|
|
6026
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_storagelock_free(ptr, 1));
|
|
5735
6027
|
const StoredSessionInfoFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5736
6028
|
? { register: () => {}, unregister: () => {} }
|
|
5737
6029
|
: new FinalizationRegistry(ptr => wasm.__wbg_storedsessioninfo_free(ptr, 1));
|