pubky-app-specs 0.4.4 → 0.5.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.
@@ -1,898 +1,554 @@
1
+ /* @ts-self-types="./pubky_app_specs.d.ts" */
1
2
 
2
- let imports = {};
3
- imports['__wbindgen_placeholder__'] = module.exports;
4
- let wasm;
5
- const { TextEncoder, TextDecoder } = require(`util`);
6
-
7
- let WASM_VECTOR_LEN = 0;
8
-
9
- let cachedUint8ArrayMemory0 = null;
10
-
11
- function getUint8ArrayMemory0() {
12
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
13
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
3
+ class BlobResult {
4
+ static __wrap(ptr) {
5
+ ptr = ptr >>> 0;
6
+ const obj = Object.create(BlobResult.prototype);
7
+ obj.__wbg_ptr = ptr;
8
+ BlobResultFinalization.register(obj, obj.__wbg_ptr, obj);
9
+ return obj;
14
10
  }
15
- return cachedUint8ArrayMemory0;
16
- }
17
-
18
- let cachedTextEncoder = new TextEncoder('utf-8');
19
-
20
- const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
21
- ? function (arg, view) {
22
- return cachedTextEncoder.encodeInto(arg, view);
23
- }
24
- : function (arg, view) {
25
- const buf = cachedTextEncoder.encode(arg);
26
- view.set(buf);
27
- return {
28
- read: arg.length,
29
- written: buf.length
30
- };
31
- });
32
-
33
- function passStringToWasm0(arg, malloc, realloc) {
34
-
35
- if (realloc === undefined) {
36
- const buf = cachedTextEncoder.encode(arg);
37
- const ptr = malloc(buf.length, 1) >>> 0;
38
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
39
- WASM_VECTOR_LEN = buf.length;
11
+ __destroy_into_raw() {
12
+ const ptr = this.__wbg_ptr;
13
+ this.__wbg_ptr = 0;
14
+ BlobResultFinalization.unregister(this);
40
15
  return ptr;
41
16
  }
42
-
43
- let len = arg.length;
44
- let ptr = malloc(len, 1) >>> 0;
45
-
46
- const mem = getUint8ArrayMemory0();
47
-
48
- let offset = 0;
49
-
50
- for (; offset < len; offset++) {
51
- const code = arg.charCodeAt(offset);
52
- if (code > 0x7F) break;
53
- mem[ptr + offset] = code;
17
+ free() {
18
+ const ptr = this.__destroy_into_raw();
19
+ wasm.__wbg_blobresult_free(ptr, 0);
54
20
  }
55
-
56
- if (offset !== len) {
57
- if (offset !== 0) {
58
- arg = arg.slice(offset);
59
- }
60
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
61
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
62
- const ret = encodeString(arg, view);
63
-
64
- offset += ret.written;
65
- ptr = realloc(ptr, len, offset, 1) >>> 0;
21
+ /**
22
+ * @returns {PubkyAppBlob}
23
+ */
24
+ get blob() {
25
+ const ret = wasm.blobresult_blob(this.__wbg_ptr);
26
+ return PubkyAppBlob.__wrap(ret);
66
27
  }
67
-
68
- WASM_VECTOR_LEN = offset;
69
- return ptr;
70
- }
71
-
72
- let cachedDataViewMemory0 = null;
73
-
74
- function getDataViewMemory0() {
75
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
76
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
28
+ /**
29
+ * @returns {Meta}
30
+ */
31
+ get meta() {
32
+ const ret = wasm.blobresult_meta(this.__wbg_ptr);
33
+ return Meta.__wrap(ret);
77
34
  }
78
- return cachedDataViewMemory0;
79
- }
80
-
81
- function addToExternrefTable0(obj) {
82
- const idx = wasm.__externref_table_alloc();
83
- wasm.__wbindgen_export_4.set(idx, obj);
84
- return idx;
85
35
  }
36
+ if (Symbol.dispose) BlobResult.prototype[Symbol.dispose] = BlobResult.prototype.free;
37
+ exports.BlobResult = BlobResult;
86
38
 
87
- function handleError(f, args) {
88
- try {
89
- return f.apply(this, args);
90
- } catch (e) {
91
- const idx = addToExternrefTable0(e);
92
- wasm.__wbindgen_exn_store(idx);
39
+ class BookmarkResult {
40
+ static __wrap(ptr) {
41
+ ptr = ptr >>> 0;
42
+ const obj = Object.create(BookmarkResult.prototype);
43
+ obj.__wbg_ptr = ptr;
44
+ BookmarkResultFinalization.register(obj, obj.__wbg_ptr, obj);
45
+ return obj;
93
46
  }
94
- }
95
-
96
- function isLikeNone(x) {
97
- return x === undefined || x === null;
98
- }
99
-
100
- function debugString(val) {
101
- // primitive types
102
- const type = typeof val;
103
- if (type == 'number' || type == 'boolean' || val == null) {
104
- return `${val}`;
47
+ __destroy_into_raw() {
48
+ const ptr = this.__wbg_ptr;
49
+ this.__wbg_ptr = 0;
50
+ BookmarkResultFinalization.unregister(this);
51
+ return ptr;
105
52
  }
106
- if (type == 'string') {
107
- return `"${val}"`;
53
+ free() {
54
+ const ptr = this.__destroy_into_raw();
55
+ wasm.__wbg_bookmarkresult_free(ptr, 0);
108
56
  }
109
- if (type == 'symbol') {
110
- const description = val.description;
111
- if (description == null) {
112
- return 'Symbol';
113
- } else {
114
- return `Symbol(${description})`;
115
- }
57
+ /**
58
+ * @returns {PubkyAppBookmark}
59
+ */
60
+ get bookmark() {
61
+ const ret = wasm.bookmarkresult_bookmark(this.__wbg_ptr);
62
+ return PubkyAppBookmark.__wrap(ret);
116
63
  }
117
- if (type == 'function') {
118
- const name = val.name;
119
- if (typeof name == 'string' && name.length > 0) {
120
- return `Function(${name})`;
121
- } else {
122
- return 'Function';
123
- }
64
+ /**
65
+ * @returns {Meta}
66
+ */
67
+ get meta() {
68
+ const ret = wasm.bookmarkresult_meta(this.__wbg_ptr);
69
+ return Meta.__wrap(ret);
124
70
  }
125
- // objects
126
- if (Array.isArray(val)) {
127
- const length = val.length;
128
- let debug = '[';
129
- if (length > 0) {
130
- debug += debugString(val[0]);
131
- }
132
- for(let i = 1; i < length; i++) {
133
- debug += ', ' + debugString(val[i]);
134
- }
135
- debug += ']';
136
- return debug;
71
+ }
72
+ if (Symbol.dispose) BookmarkResult.prototype[Symbol.dispose] = BookmarkResult.prototype.free;
73
+ exports.BookmarkResult = BookmarkResult;
74
+
75
+ class FeedResult {
76
+ static __wrap(ptr) {
77
+ ptr = ptr >>> 0;
78
+ const obj = Object.create(FeedResult.prototype);
79
+ obj.__wbg_ptr = ptr;
80
+ FeedResultFinalization.register(obj, obj.__wbg_ptr, obj);
81
+ return obj;
137
82
  }
138
- // Test for built-in
139
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
140
- let className;
141
- if (builtInMatches && builtInMatches.length > 1) {
142
- className = builtInMatches[1];
143
- } else {
144
- // Failed to match the standard '[object ClassName]'
145
- return toString.call(val);
83
+ __destroy_into_raw() {
84
+ const ptr = this.__wbg_ptr;
85
+ this.__wbg_ptr = 0;
86
+ FeedResultFinalization.unregister(this);
87
+ return ptr;
146
88
  }
147
- if (className == 'Object') {
148
- // we're a user defined class or Object
149
- // JSON.stringify avoids problems with cycles, and is generally much
150
- // easier than looping through ownProperties of `val`.
151
- try {
152
- return 'Object(' + JSON.stringify(val) + ')';
153
- } catch (_) {
154
- return 'Object';
155
- }
89
+ free() {
90
+ const ptr = this.__destroy_into_raw();
91
+ wasm.__wbg_feedresult_free(ptr, 0);
156
92
  }
157
- // errors
158
- if (val instanceof Error) {
159
- return `${val.name}: ${val.message}\n${val.stack}`;
93
+ /**
94
+ * @returns {PubkyAppFeed}
95
+ */
96
+ get feed() {
97
+ const ret = wasm.feedresult_feed(this.__wbg_ptr);
98
+ return PubkyAppFeed.__wrap(ret);
160
99
  }
161
- // TODO we could test for more things here, like `Set`s and `Map`s.
162
- return className;
163
- }
164
-
165
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
166
-
167
- cachedTextDecoder.decode();
168
-
169
- function getStringFromWasm0(ptr, len) {
170
- ptr = ptr >>> 0;
171
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
172
- }
173
-
174
- function takeFromExternrefTable0(idx) {
175
- const value = wasm.__wbindgen_export_4.get(idx);
176
- wasm.__externref_table_dealloc(idx);
177
- return value;
178
- }
179
-
180
- function getArrayJsValueFromWasm0(ptr, len) {
181
- ptr = ptr >>> 0;
182
- const mem = getDataViewMemory0();
183
- const result = [];
184
- for (let i = ptr; i < ptr + 4 * len; i += 4) {
185
- result.push(wasm.__wbindgen_export_4.get(mem.getUint32(i, true)));
100
+ /**
101
+ * @returns {Meta}
102
+ */
103
+ get meta() {
104
+ const ret = wasm.feedresult_meta(this.__wbg_ptr);
105
+ return Meta.__wrap(ret);
186
106
  }
187
- wasm.__externref_drop_slice(ptr, len);
188
- return result;
189
107
  }
108
+ if (Symbol.dispose) FeedResult.prototype[Symbol.dispose] = FeedResult.prototype.free;
109
+ exports.FeedResult = FeedResult;
190
110
 
191
- function _assertClass(instance, klass) {
192
- if (!(instance instanceof klass)) {
193
- throw new Error(`expected instance of ${klass.name}`);
111
+ class FileResult {
112
+ static __wrap(ptr) {
113
+ ptr = ptr >>> 0;
114
+ const obj = Object.create(FileResult.prototype);
115
+ obj.__wbg_ptr = ptr;
116
+ FileResultFinalization.register(obj, obj.__wbg_ptr, obj);
117
+ return obj;
194
118
  }
195
- }
196
-
197
- function passArrayJsValueToWasm0(array, malloc) {
198
- const ptr = malloc(array.length * 4, 4) >>> 0;
199
- for (let i = 0; i < array.length; i++) {
200
- const add = addToExternrefTable0(array[i]);
201
- getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
119
+ __destroy_into_raw() {
120
+ const ptr = this.__wbg_ptr;
121
+ this.__wbg_ptr = 0;
122
+ FileResultFinalization.unregister(this);
123
+ return ptr;
202
124
  }
203
- WASM_VECTOR_LEN = array.length;
204
- return ptr;
205
- }
206
- /**
207
- * @param {string} user_id
208
- * @returns {string}
209
- */
210
- module.exports.baseUriBuilder = function(user_id) {
211
- let deferred2_0;
212
- let deferred2_1;
213
- try {
214
- const ptr0 = passStringToWasm0(user_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
215
- const len0 = WASM_VECTOR_LEN;
216
- const ret = wasm.baseUriBuilder(ptr0, len0);
217
- deferred2_0 = ret[0];
218
- deferred2_1 = ret[1];
219
- return getStringFromWasm0(ret[0], ret[1]);
220
- } finally {
221
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
125
+ free() {
126
+ const ptr = this.__destroy_into_raw();
127
+ wasm.__wbg_fileresult_free(ptr, 0);
222
128
  }
223
- };
224
-
225
- /**
226
- * Builds an User URI of the form "pubky://<user_pubky_id>/pub/pubky.app/profile.json"
227
- * @param {string} user_id
228
- * @returns {string}
229
- */
230
- module.exports.userUriBuilder = function(user_id) {
231
- let deferred2_0;
232
- let deferred2_1;
233
- try {
234
- const ptr0 = passStringToWasm0(user_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
235
- const len0 = WASM_VECTOR_LEN;
236
- const ret = wasm.userUriBuilder(ptr0, len0);
237
- deferred2_0 = ret[0];
238
- deferred2_1 = ret[1];
239
- return getStringFromWasm0(ret[0], ret[1]);
240
- } finally {
241
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
129
+ /**
130
+ * @returns {PubkyAppFile}
131
+ */
132
+ get file() {
133
+ const ret = wasm.fileresult_file(this.__wbg_ptr);
134
+ return PubkyAppFile.__wrap(ret);
242
135
  }
243
- };
244
-
245
- /**
246
- * Builds a Post URI of the form "pubky://<author_id>/pub/pubky.app/posts/<post_id>"
247
- * @param {string} author_id
248
- * @param {string} post_id
249
- * @returns {string}
250
- */
251
- module.exports.postUriBuilder = function(author_id, post_id) {
252
- let deferred3_0;
253
- let deferred3_1;
254
- try {
255
- const ptr0 = passStringToWasm0(author_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
256
- const len0 = WASM_VECTOR_LEN;
257
- const ptr1 = passStringToWasm0(post_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
258
- const len1 = WASM_VECTOR_LEN;
259
- const ret = wasm.postUriBuilder(ptr0, len0, ptr1, len1);
260
- deferred3_0 = ret[0];
261
- deferred3_1 = ret[1];
262
- return getStringFromWasm0(ret[0], ret[1]);
263
- } finally {
264
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
136
+ /**
137
+ * @returns {Meta}
138
+ */
139
+ get meta() {
140
+ const ret = wasm.fileresult_meta(this.__wbg_ptr);
141
+ return Meta.__wrap(ret);
265
142
  }
266
- };
143
+ }
144
+ if (Symbol.dispose) FileResult.prototype[Symbol.dispose] = FileResult.prototype.free;
145
+ exports.FileResult = FileResult;
267
146
 
268
- /**
269
- * Builds a Follow URI of the form "pubky://<author_id>/pub/pubky.app/follows/<follow_id>"
270
- * @param {string} author_id
271
- * @param {string} follow_id
272
- * @returns {string}
273
- */
274
- module.exports.followUriBuilder = function(author_id, follow_id) {
275
- let deferred3_0;
276
- let deferred3_1;
277
- try {
278
- const ptr0 = passStringToWasm0(author_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
279
- const len0 = WASM_VECTOR_LEN;
280
- const ptr1 = passStringToWasm0(follow_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
281
- const len1 = WASM_VECTOR_LEN;
282
- const ret = wasm.followUriBuilder(ptr0, len0, ptr1, len1);
283
- deferred3_0 = ret[0];
284
- deferred3_1 = ret[1];
285
- return getStringFromWasm0(ret[0], ret[1]);
286
- } finally {
287
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
147
+ class FollowResult {
148
+ static __wrap(ptr) {
149
+ ptr = ptr >>> 0;
150
+ const obj = Object.create(FollowResult.prototype);
151
+ obj.__wbg_ptr = ptr;
152
+ FollowResultFinalization.register(obj, obj.__wbg_ptr, obj);
153
+ return obj;
288
154
  }
289
- };
290
-
291
- /**
292
- * Builds a Mute URI of the form "pubky://<author_id>/pub/pubky.app/mutes/<mute_id>"
293
- * @param {string} author_id
294
- * @param {string} mute_id
295
- * @returns {string}
296
- */
297
- module.exports.muteUriBuilder = function(author_id, mute_id) {
298
- let deferred3_0;
299
- let deferred3_1;
300
- try {
301
- const ptr0 = passStringToWasm0(author_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
302
- const len0 = WASM_VECTOR_LEN;
303
- const ptr1 = passStringToWasm0(mute_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
304
- const len1 = WASM_VECTOR_LEN;
305
- const ret = wasm.muteUriBuilder(ptr0, len0, ptr1, len1);
306
- deferred3_0 = ret[0];
307
- deferred3_1 = ret[1];
308
- return getStringFromWasm0(ret[0], ret[1]);
309
- } finally {
310
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
155
+ __destroy_into_raw() {
156
+ const ptr = this.__wbg_ptr;
157
+ this.__wbg_ptr = 0;
158
+ FollowResultFinalization.unregister(this);
159
+ return ptr;
311
160
  }
312
- };
313
-
314
- /**
315
- * Builds a Bookmark URI of the form "pubky://<author_id>/pub/pubky.app/bookmarks/<bookmark_id>"
316
- * @param {string} author_id
317
- * @param {string} bookmark_id
318
- * @returns {string}
319
- */
320
- module.exports.bookmarkUriBuilder = function(author_id, bookmark_id) {
321
- let deferred3_0;
322
- let deferred3_1;
323
- try {
324
- const ptr0 = passStringToWasm0(author_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
325
- const len0 = WASM_VECTOR_LEN;
326
- const ptr1 = passStringToWasm0(bookmark_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
327
- const len1 = WASM_VECTOR_LEN;
328
- const ret = wasm.bookmarkUriBuilder(ptr0, len0, ptr1, len1);
329
- deferred3_0 = ret[0];
330
- deferred3_1 = ret[1];
331
- return getStringFromWasm0(ret[0], ret[1]);
332
- } finally {
333
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
161
+ free() {
162
+ const ptr = this.__destroy_into_raw();
163
+ wasm.__wbg_followresult_free(ptr, 0);
334
164
  }
335
- };
336
-
337
- /**
338
- * Builds a Tag URI of the form "pubky://<author_id>/pub/pubky.app/tags/<tag_id>"
339
- * @param {string} author_id
340
- * @param {string} tag_id
341
- * @returns {string}
342
- */
343
- module.exports.tagUriBuilder = function(author_id, tag_id) {
344
- let deferred3_0;
345
- let deferred3_1;
346
- try {
347
- const ptr0 = passStringToWasm0(author_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
348
- const len0 = WASM_VECTOR_LEN;
349
- const ptr1 = passStringToWasm0(tag_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
350
- const len1 = WASM_VECTOR_LEN;
351
- const ret = wasm.tagUriBuilder(ptr0, len0, ptr1, len1);
352
- deferred3_0 = ret[0];
353
- deferred3_1 = ret[1];
354
- return getStringFromWasm0(ret[0], ret[1]);
355
- } finally {
356
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
165
+ /**
166
+ * @returns {PubkyAppFollow}
167
+ */
168
+ get follow() {
169
+ const ret = wasm.followresult_follow(this.__wbg_ptr);
170
+ return PubkyAppFollow.__wrap(ret);
357
171
  }
358
- };
359
-
360
- /**
361
- * Builds a File URI of the form "pubky://<author_id>/pub/pubky.app/files/<file_id>"
362
- * @param {string} author_id
363
- * @param {string} file_id
364
- * @returns {string}
365
- */
366
- module.exports.fileUriBuilder = function(author_id, file_id) {
367
- let deferred3_0;
368
- let deferred3_1;
369
- try {
370
- const ptr0 = passStringToWasm0(author_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
371
- const len0 = WASM_VECTOR_LEN;
372
- const ptr1 = passStringToWasm0(file_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
373
- const len1 = WASM_VECTOR_LEN;
374
- const ret = wasm.fileUriBuilder(ptr0, len0, ptr1, len1);
375
- deferred3_0 = ret[0];
376
- deferred3_1 = ret[1];
377
- return getStringFromWasm0(ret[0], ret[1]);
378
- } finally {
379
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
172
+ /**
173
+ * @returns {Meta}
174
+ */
175
+ get meta() {
176
+ const ret = wasm.followresult_meta(this.__wbg_ptr);
177
+ return Meta.__wrap(ret);
380
178
  }
381
- };
179
+ }
180
+ if (Symbol.dispose) FollowResult.prototype[Symbol.dispose] = FollowResult.prototype.free;
181
+ exports.FollowResult = FollowResult;
382
182
 
383
- /**
384
- * Builds a Blob URI of the form "pubky://<author_id>/pub/pubky.app/blobs/<blob_id>"
385
- * @param {string} author_id
386
- * @param {string} blob_id
387
- * @returns {string}
388
- */
389
- module.exports.blobUriBuilder = function(author_id, blob_id) {
390
- let deferred3_0;
391
- let deferred3_1;
392
- try {
393
- const ptr0 = passStringToWasm0(author_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
394
- const len0 = WASM_VECTOR_LEN;
395
- const ptr1 = passStringToWasm0(blob_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
396
- const len1 = WASM_VECTOR_LEN;
397
- const ret = wasm.blobUriBuilder(ptr0, len0, ptr1, len1);
398
- deferred3_0 = ret[0];
399
- deferred3_1 = ret[1];
400
- return getStringFromWasm0(ret[0], ret[1]);
401
- } finally {
402
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
183
+ class LastReadResult {
184
+ static __wrap(ptr) {
185
+ ptr = ptr >>> 0;
186
+ const obj = Object.create(LastReadResult.prototype);
187
+ obj.__wbg_ptr = ptr;
188
+ LastReadResultFinalization.register(obj, obj.__wbg_ptr, obj);
189
+ return obj;
403
190
  }
404
- };
405
-
406
- /**
407
- * Builds a Feed URI of the form "pubky://<author_id>/pub/pubky.app/feeds/<feed_id>"
408
- * @param {string} author_id
409
- * @param {string} feed_id
410
- * @returns {string}
411
- */
412
- module.exports.feedUriBuilder = function(author_id, feed_id) {
413
- let deferred3_0;
414
- let deferred3_1;
415
- try {
416
- const ptr0 = passStringToWasm0(author_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
417
- const len0 = WASM_VECTOR_LEN;
418
- const ptr1 = passStringToWasm0(feed_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
419
- const len1 = WASM_VECTOR_LEN;
420
- const ret = wasm.feedUriBuilder(ptr0, len0, ptr1, len1);
421
- deferred3_0 = ret[0];
422
- deferred3_1 = ret[1];
423
- return getStringFromWasm0(ret[0], ret[1]);
424
- } finally {
425
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
191
+ __destroy_into_raw() {
192
+ const ptr = this.__wbg_ptr;
193
+ this.__wbg_ptr = 0;
194
+ LastReadResultFinalization.unregister(this);
195
+ return ptr;
426
196
  }
427
- };
428
-
429
- /**
430
- * Builds a LastRead URI of the form "pubky://<author_id>/pub/pubky.app/last_read"
431
- * @param {string} author_id
432
- * @returns {string}
433
- */
434
- module.exports.lastReadUriBuilder = function(author_id) {
435
- let deferred2_0;
436
- let deferred2_1;
437
- try {
438
- const ptr0 = passStringToWasm0(author_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
439
- const len0 = WASM_VECTOR_LEN;
440
- const ret = wasm.lastReadUriBuilder(ptr0, len0);
441
- deferred2_0 = ret[0];
442
- deferred2_1 = ret[1];
443
- return getStringFromWasm0(ret[0], ret[1]);
444
- } finally {
445
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
446
- }
447
- };
448
-
449
- /**
450
- * Each FFI function:
451
- * - Accepts minimal fields in a JavaScript-friendly manner (e.g. strings, JSON).
452
- * - Creates the Rust model, sanitizes, and validates it.
453
- * - Generates the ID (if applicable).
454
- * - Generates the path (if applicable).
455
- * - Returns { json, id, path, url } or a descriptive error.
456
- * Returns validation limits as a JSON value for client-side use without a builder.
457
- * @returns {any}
458
- */
459
- module.exports.getValidationLimits = function() {
460
- const ret = wasm.getValidationLimits();
461
- if (ret[2]) {
462
- throw takeFromExternrefTable0(ret[1]);
463
- }
464
- return takeFromExternrefTable0(ret[0]);
465
- };
466
-
467
- /**
468
- * Returns the list of valid MIME types for file attachments.
469
- *
470
- * This allows JavaScript consumers to validate file types before submission
471
- * without having to duplicate the list.
472
- *
473
- * # Example (TypeScript)
474
- *
475
- * ```typescript
476
- * import { get_valid_mime_types } from "pubky-app-specs";
477
- *
478
- * const validTypes = get_valid_mime_types();
479
- * const fileType = "image/png";
480
- * if (validTypes.includes(fileType)) {
481
- * console.log("Valid file type!");
482
- * }
483
- * ```
484
- * @returns {any[]}
485
- */
486
- module.exports.getValidMimeTypes = function() {
487
- const ret = wasm.getValidMimeTypes();
488
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
489
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
490
- return v1;
491
- };
492
-
493
- /**
494
- * Parses a Pubky URI and returns a strongly typed `ParsedUriResult`.
495
- *
496
- * This function wraps the internal ParsedUri ust parsing logic. It converts the result into a
497
- * strongly typed object that is easier to use in TypeScript.
498
- *
499
- * # Parameters
500
- *
501
- * - `uri`: A string slice representing the Pubky URI. The URI should follow the format:
502
- * `pubky://<user_id>/pub/pubky.app/<resource>[/<id>]`.
503
- *
504
- * # Returns
505
- *
506
- * On success, returns a `ParsedUriResult` with:
507
- * - `user_id`: the parsed user ID,
508
- * - `resource`: a string (derived from the Display implementation of internal `Resource` enum),
509
- * - `resource_id`: an optional resource identifier (if applicable).
510
- *
511
- * On failure, returns a JavaScript error (`String`) containing an error message.
512
- *
513
- * # Example (TypeScript)
514
- *
515
- * ```typescript
516
- * import { parse_uri } from "pubky-app-specs";
517
- *
518
- * try {
519
- * const result = parse_uri("pubky://user123/pub/pubky.app/posts/abc123");
520
- * console.log(result.user_id); // e.g. "user123"
521
- * console.log(result.resource); // e.g. "posts"
522
- * console.log(result.resource_id); // e.g. "abc123" or null
523
- * } catch (error) {
524
- * console.error("Error parsing URI:", error);
525
- * }
526
- * ```
527
- * @param {string} uri
528
- * @returns {ParsedUriResult}
529
- */
530
- module.exports.parse_uri = function(uri) {
531
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
532
- const len0 = WASM_VECTOR_LEN;
533
- const ret = wasm.parse_uri(ptr0, len0);
534
- if (ret[2]) {
535
- throw takeFromExternrefTable0(ret[1]);
536
- }
537
- return ParsedUriResult.__wrap(ret[0]);
538
- };
539
-
540
- /**
541
- * Enum representing the layout of the feed.
542
- * @enum {0 | 1 | 2}
543
- */
544
- module.exports.PubkyAppFeedLayout = Object.freeze({
545
- Columns: 0, "0": "Columns",
546
- Wide: 1, "1": "Wide",
547
- Visual: 2, "2": "Visual",
548
- });
549
- /**
550
- * Enum representing the reach of the feed.
551
- * @enum {0 | 1 | 2 | 3}
552
- */
553
- module.exports.PubkyAppFeedReach = Object.freeze({
554
- Following: 0, "0": "Following",
555
- Followers: 1, "1": "Followers",
556
- Friends: 2, "2": "Friends",
557
- All: 3, "3": "All",
558
- });
559
- /**
560
- * Enum representing the sort order of the feed.
561
- * @enum {0 | 1}
562
- */
563
- module.exports.PubkyAppFeedSort = Object.freeze({
564
- Recent: 0, "0": "Recent",
565
- Popularity: 1, "1": "Popularity",
566
- });
567
- /**
568
- * Represents the type of pubky-app posted data
569
- * Used primarily to best display the content in UI
570
- * @enum {0 | 1 | 2 | 3 | 4 | 5}
571
- */
572
- module.exports.PubkyAppPostKind = Object.freeze({
573
- Short: 0, "0": "Short",
574
- Long: 1, "1": "Long",
575
- Image: 2, "2": "Image",
576
- Video: 3, "3": "Video",
577
- Link: 4, "4": "Link",
578
- File: 5, "5": "File",
579
- });
580
-
581
- const BlobResultFinalization = (typeof FinalizationRegistry === 'undefined')
582
- ? { register: () => {}, unregister: () => {} }
583
- : new FinalizationRegistry(ptr => wasm.__wbg_blobresult_free(ptr >>> 0, 1));
584
-
585
- class BlobResult {
586
-
587
- static __wrap(ptr) {
588
- ptr = ptr >>> 0;
589
- const obj = Object.create(BlobResult.prototype);
590
- obj.__wbg_ptr = ptr;
591
- BlobResultFinalization.register(obj, obj.__wbg_ptr, obj);
592
- return obj;
593
- }
594
-
595
- __destroy_into_raw() {
596
- const ptr = this.__wbg_ptr;
597
- this.__wbg_ptr = 0;
598
- BlobResultFinalization.unregister(this);
599
- return ptr;
600
- }
601
-
602
197
  free() {
603
198
  const ptr = this.__destroy_into_raw();
604
- wasm.__wbg_blobresult_free(ptr, 0);
199
+ wasm.__wbg_lastreadresult_free(ptr, 0);
605
200
  }
606
201
  /**
607
- * @returns {PubkyAppBlob}
202
+ * @returns {PubkyAppLastRead}
608
203
  */
609
- get blob() {
610
- const ret = wasm.blobresult_blob(this.__wbg_ptr);
611
- return PubkyAppBlob.__wrap(ret);
204
+ get last_read() {
205
+ const ret = wasm.lastreadresult_last_read(this.__wbg_ptr);
206
+ return PubkyAppLastRead.__wrap(ret);
612
207
  }
613
208
  /**
614
209
  * @returns {Meta}
615
210
  */
616
211
  get meta() {
617
- const ret = wasm.blobresult_meta(this.__wbg_ptr);
212
+ const ret = wasm.lastreadresult_meta(this.__wbg_ptr);
618
213
  return Meta.__wrap(ret);
619
214
  }
620
215
  }
621
- module.exports.BlobResult = BlobResult;
622
-
623
- const BookmarkResultFinalization = (typeof FinalizationRegistry === 'undefined')
624
- ? { register: () => {}, unregister: () => {} }
625
- : new FinalizationRegistry(ptr => wasm.__wbg_bookmarkresult_free(ptr >>> 0, 1));
626
-
627
- class BookmarkResult {
216
+ if (Symbol.dispose) LastReadResult.prototype[Symbol.dispose] = LastReadResult.prototype.free;
217
+ exports.LastReadResult = LastReadResult;
628
218
 
219
+ class Meta {
629
220
  static __wrap(ptr) {
630
221
  ptr = ptr >>> 0;
631
- const obj = Object.create(BookmarkResult.prototype);
222
+ const obj = Object.create(Meta.prototype);
632
223
  obj.__wbg_ptr = ptr;
633
- BookmarkResultFinalization.register(obj, obj.__wbg_ptr, obj);
224
+ MetaFinalization.register(obj, obj.__wbg_ptr, obj);
634
225
  return obj;
635
226
  }
636
-
637
227
  __destroy_into_raw() {
638
228
  const ptr = this.__wbg_ptr;
639
229
  this.__wbg_ptr = 0;
640
- BookmarkResultFinalization.unregister(this);
230
+ MetaFinalization.unregister(this);
641
231
  return ptr;
642
232
  }
643
-
644
233
  free() {
645
234
  const ptr = this.__destroy_into_raw();
646
- wasm.__wbg_bookmarkresult_free(ptr, 0);
235
+ wasm.__wbg_meta_free(ptr, 0);
647
236
  }
648
237
  /**
649
- * @returns {PubkyAppBookmark}
238
+ * @returns {string}
650
239
  */
651
- get bookmark() {
652
- const ret = wasm.bookmarkresult_bookmark(this.__wbg_ptr);
653
- return PubkyAppBookmark.__wrap(ret);
240
+ get id() {
241
+ let deferred1_0;
242
+ let deferred1_1;
243
+ try {
244
+ const ret = wasm.meta_id(this.__wbg_ptr);
245
+ deferred1_0 = ret[0];
246
+ deferred1_1 = ret[1];
247
+ return getStringFromWasm0(ret[0], ret[1]);
248
+ } finally {
249
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
250
+ }
654
251
  }
655
252
  /**
656
- * @returns {Meta}
253
+ * @returns {string}
657
254
  */
658
- get meta() {
659
- const ret = wasm.bookmarkresult_meta(this.__wbg_ptr);
660
- return Meta.__wrap(ret);
255
+ get path() {
256
+ let deferred1_0;
257
+ let deferred1_1;
258
+ try {
259
+ const ret = wasm.meta_path(this.__wbg_ptr);
260
+ deferred1_0 = ret[0];
261
+ deferred1_1 = ret[1];
262
+ return getStringFromWasm0(ret[0], ret[1]);
263
+ } finally {
264
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
265
+ }
266
+ }
267
+ /**
268
+ * @returns {string}
269
+ */
270
+ get url() {
271
+ let deferred1_0;
272
+ let deferred1_1;
273
+ try {
274
+ const ret = wasm.meta_url(this.__wbg_ptr);
275
+ deferred1_0 = ret[0];
276
+ deferred1_1 = ret[1];
277
+ return getStringFromWasm0(ret[0], ret[1]);
278
+ } finally {
279
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
280
+ }
661
281
  }
662
282
  }
663
- module.exports.BookmarkResult = BookmarkResult;
664
-
665
- const FeedResultFinalization = (typeof FinalizationRegistry === 'undefined')
666
- ? { register: () => {}, unregister: () => {} }
667
- : new FinalizationRegistry(ptr => wasm.__wbg_feedresult_free(ptr >>> 0, 1));
668
-
669
- class FeedResult {
283
+ if (Symbol.dispose) Meta.prototype[Symbol.dispose] = Meta.prototype.free;
284
+ exports.Meta = Meta;
670
285
 
286
+ class MuteResult {
671
287
  static __wrap(ptr) {
672
288
  ptr = ptr >>> 0;
673
- const obj = Object.create(FeedResult.prototype);
289
+ const obj = Object.create(MuteResult.prototype);
674
290
  obj.__wbg_ptr = ptr;
675
- FeedResultFinalization.register(obj, obj.__wbg_ptr, obj);
291
+ MuteResultFinalization.register(obj, obj.__wbg_ptr, obj);
676
292
  return obj;
677
293
  }
678
-
679
294
  __destroy_into_raw() {
680
295
  const ptr = this.__wbg_ptr;
681
296
  this.__wbg_ptr = 0;
682
- FeedResultFinalization.unregister(this);
297
+ MuteResultFinalization.unregister(this);
683
298
  return ptr;
684
299
  }
685
-
686
300
  free() {
687
301
  const ptr = this.__destroy_into_raw();
688
- wasm.__wbg_feedresult_free(ptr, 0);
689
- }
690
- /**
691
- * @returns {PubkyAppFeed}
692
- */
693
- get feed() {
694
- const ret = wasm.feedresult_feed(this.__wbg_ptr);
695
- return PubkyAppFeed.__wrap(ret);
302
+ wasm.__wbg_muteresult_free(ptr, 0);
696
303
  }
697
304
  /**
698
305
  * @returns {Meta}
699
306
  */
700
307
  get meta() {
701
- const ret = wasm.feedresult_meta(this.__wbg_ptr);
308
+ const ret = wasm.muteresult_meta(this.__wbg_ptr);
702
309
  return Meta.__wrap(ret);
703
310
  }
704
- }
705
- module.exports.FeedResult = FeedResult;
706
-
707
- const FileResultFinalization = (typeof FinalizationRegistry === 'undefined')
708
- ? { register: () => {}, unregister: () => {} }
709
- : new FinalizationRegistry(ptr => wasm.__wbg_fileresult_free(ptr >>> 0, 1));
710
-
711
- class FileResult {
311
+ /**
312
+ * @returns {PubkyAppMute}
313
+ */
314
+ get mute() {
315
+ const ret = wasm.muteresult_mute(this.__wbg_ptr);
316
+ return PubkyAppMute.__wrap(ret);
317
+ }
318
+ }
319
+ if (Symbol.dispose) MuteResult.prototype[Symbol.dispose] = MuteResult.prototype.free;
320
+ exports.MuteResult = MuteResult;
712
321
 
322
+ /**
323
+ * This object represents the result of parsing a Pubky URI. It contains:
324
+ * - `user_id`: the parsed user ID as a string.
325
+ * - `resource`: a string representing the kind of resource (derived from internal `Resource` enum Display).
326
+ * - `resource_id`: an optional resource identifier (if applicable).
327
+ */
328
+ class ParsedUriResult {
713
329
  static __wrap(ptr) {
714
330
  ptr = ptr >>> 0;
715
- const obj = Object.create(FileResult.prototype);
331
+ const obj = Object.create(ParsedUriResult.prototype);
716
332
  obj.__wbg_ptr = ptr;
717
- FileResultFinalization.register(obj, obj.__wbg_ptr, obj);
333
+ ParsedUriResultFinalization.register(obj, obj.__wbg_ptr, obj);
718
334
  return obj;
719
335
  }
720
-
721
336
  __destroy_into_raw() {
722
337
  const ptr = this.__wbg_ptr;
723
338
  this.__wbg_ptr = 0;
724
- FileResultFinalization.unregister(this);
339
+ ParsedUriResultFinalization.unregister(this);
725
340
  return ptr;
726
341
  }
727
-
728
342
  free() {
729
343
  const ptr = this.__destroy_into_raw();
730
- wasm.__wbg_fileresult_free(ptr, 0);
344
+ wasm.__wbg_parseduriresult_free(ptr, 0);
731
345
  }
732
346
  /**
733
- * @returns {PubkyAppFile}
347
+ * Returns the resource kind.
348
+ * @returns {string}
734
349
  */
735
- get file() {
736
- const ret = wasm.fileresult_file(this.__wbg_ptr);
737
- return PubkyAppFile.__wrap(ret);
350
+ get resource() {
351
+ let deferred1_0;
352
+ let deferred1_1;
353
+ try {
354
+ const ret = wasm.parseduriresult_resource(this.__wbg_ptr);
355
+ deferred1_0 = ret[0];
356
+ deferred1_1 = ret[1];
357
+ return getStringFromWasm0(ret[0], ret[1]);
358
+ } finally {
359
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
360
+ }
738
361
  }
739
362
  /**
740
- * @returns {Meta}
363
+ * Returns the resource ID if present.
364
+ * @returns {string | undefined}
741
365
  */
742
- get meta() {
743
- const ret = wasm.fileresult_meta(this.__wbg_ptr);
744
- return Meta.__wrap(ret);
366
+ get resource_id() {
367
+ const ret = wasm.parseduriresult_resource_id(this.__wbg_ptr);
368
+ let v1;
369
+ if (ret[0] !== 0) {
370
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
371
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
372
+ }
373
+ return v1;
374
+ }
375
+ /**
376
+ * Returns the user ID.
377
+ * @returns {string}
378
+ */
379
+ get user_id() {
380
+ let deferred1_0;
381
+ let deferred1_1;
382
+ try {
383
+ const ret = wasm.parseduriresult_user_id(this.__wbg_ptr);
384
+ deferred1_0 = ret[0];
385
+ deferred1_1 = ret[1];
386
+ return getStringFromWasm0(ret[0], ret[1]);
387
+ } finally {
388
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
389
+ }
745
390
  }
746
391
  }
747
- module.exports.FileResult = FileResult;
748
-
749
- const FollowResultFinalization = (typeof FinalizationRegistry === 'undefined')
750
- ? { register: () => {}, unregister: () => {} }
751
- : new FinalizationRegistry(ptr => wasm.__wbg_followresult_free(ptr >>> 0, 1));
752
-
753
- class FollowResult {
392
+ if (Symbol.dispose) ParsedUriResult.prototype[Symbol.dispose] = ParsedUriResult.prototype.free;
393
+ exports.ParsedUriResult = ParsedUriResult;
754
394
 
395
+ class PostResult {
755
396
  static __wrap(ptr) {
756
397
  ptr = ptr >>> 0;
757
- const obj = Object.create(FollowResult.prototype);
398
+ const obj = Object.create(PostResult.prototype);
758
399
  obj.__wbg_ptr = ptr;
759
- FollowResultFinalization.register(obj, obj.__wbg_ptr, obj);
400
+ PostResultFinalization.register(obj, obj.__wbg_ptr, obj);
760
401
  return obj;
761
402
  }
762
-
763
403
  __destroy_into_raw() {
764
404
  const ptr = this.__wbg_ptr;
765
405
  this.__wbg_ptr = 0;
766
- FollowResultFinalization.unregister(this);
406
+ PostResultFinalization.unregister(this);
767
407
  return ptr;
768
408
  }
769
-
770
409
  free() {
771
410
  const ptr = this.__destroy_into_raw();
772
- wasm.__wbg_followresult_free(ptr, 0);
773
- }
774
- /**
775
- * @returns {PubkyAppFollow}
776
- */
777
- get follow() {
778
- const ret = wasm.followresult_follow(this.__wbg_ptr);
779
- return PubkyAppFollow.__wrap(ret);
411
+ wasm.__wbg_postresult_free(ptr, 0);
780
412
  }
781
413
  /**
782
414
  * @returns {Meta}
783
415
  */
784
416
  get meta() {
785
- const ret = wasm.followresult_meta(this.__wbg_ptr);
417
+ const ret = wasm.postresult_meta(this.__wbg_ptr);
786
418
  return Meta.__wrap(ret);
787
419
  }
420
+ /**
421
+ * @returns {PubkyAppPost}
422
+ */
423
+ get post() {
424
+ const ret = wasm.postresult_post(this.__wbg_ptr);
425
+ return PubkyAppPost.__wrap(ret);
426
+ }
788
427
  }
789
- module.exports.FollowResult = FollowResult;
790
-
791
- const LastReadResultFinalization = (typeof FinalizationRegistry === 'undefined')
792
- ? { register: () => {}, unregister: () => {} }
793
- : new FinalizationRegistry(ptr => wasm.__wbg_lastreadresult_free(ptr >>> 0, 1));
794
-
795
- class LastReadResult {
428
+ if (Symbol.dispose) PostResult.prototype[Symbol.dispose] = PostResult.prototype.free;
429
+ exports.PostResult = PostResult;
796
430
 
431
+ /**
432
+ * Represents a blob, which backs a file uploaded by the user.
433
+ * URI: /pub/pubky.app/blobs/:blob_id
434
+ */
435
+ class PubkyAppBlob {
797
436
  static __wrap(ptr) {
798
437
  ptr = ptr >>> 0;
799
- const obj = Object.create(LastReadResult.prototype);
438
+ const obj = Object.create(PubkyAppBlob.prototype);
800
439
  obj.__wbg_ptr = ptr;
801
- LastReadResultFinalization.register(obj, obj.__wbg_ptr, obj);
440
+ PubkyAppBlobFinalization.register(obj, obj.__wbg_ptr, obj);
802
441
  return obj;
803
442
  }
804
-
805
443
  __destroy_into_raw() {
806
444
  const ptr = this.__wbg_ptr;
807
445
  this.__wbg_ptr = 0;
808
- LastReadResultFinalization.unregister(this);
446
+ PubkyAppBlobFinalization.unregister(this);
809
447
  return ptr;
810
448
  }
811
-
812
449
  free() {
813
450
  const ptr = this.__destroy_into_raw();
814
- wasm.__wbg_lastreadresult_free(ptr, 0);
451
+ wasm.__wbg_pubkyappblob_free(ptr, 0);
815
452
  }
816
453
  /**
817
- * @returns {PubkyAppLastRead}
454
+ * Getter for the blob data as a `Uint8Array`.
455
+ * @returns {Uint8Array}
818
456
  */
819
- get last_read() {
820
- const ret = wasm.followresult_follow(this.__wbg_ptr);
821
- return PubkyAppLastRead.__wrap(ret);
457
+ get data() {
458
+ const ret = wasm.pubkyappblob_data(this.__wbg_ptr);
459
+ return ret;
822
460
  }
823
461
  /**
824
- * @returns {Meta}
462
+ * @param {any} js_value
463
+ * @returns {PubkyAppBlob}
825
464
  */
826
- get meta() {
827
- const ret = wasm.followresult_meta(this.__wbg_ptr);
828
- return Meta.__wrap(ret);
465
+ static fromJson(js_value) {
466
+ const ret = wasm.pubkyappblob_fromJson(js_value);
467
+ if (ret[2]) {
468
+ throw takeFromExternrefTable0(ret[1]);
469
+ }
470
+ return PubkyAppBlob.__wrap(ret[0]);
471
+ }
472
+ /**
473
+ * @returns {any}
474
+ */
475
+ toJson() {
476
+ const ret = wasm.pubkyappblob_toJson(this.__wbg_ptr);
477
+ if (ret[2]) {
478
+ throw takeFromExternrefTable0(ret[1]);
479
+ }
480
+ return takeFromExternrefTable0(ret[0]);
829
481
  }
830
482
  }
831
- module.exports.LastReadResult = LastReadResult;
832
-
833
- const MetaFinalization = (typeof FinalizationRegistry === 'undefined')
834
- ? { register: () => {}, unregister: () => {} }
835
- : new FinalizationRegistry(ptr => wasm.__wbg_meta_free(ptr >>> 0, 1));
836
-
837
- class Meta {
483
+ if (Symbol.dispose) PubkyAppBlob.prototype[Symbol.dispose] = PubkyAppBlob.prototype.free;
484
+ exports.PubkyAppBlob = PubkyAppBlob;
838
485
 
486
+ /**
487
+ * Represents raw homeserver bookmark with id
488
+ * URI: /pub/pubky.app/bookmarks/:bookmark_id
489
+ *
490
+ * Example URI:
491
+ *
492
+ * `/pub/pubky.app/bookmarks/AF7KQ6NEV5XV1EG5DVJ2E74JJ4`
493
+ *
494
+ * Where bookmark_id is Crockford-base32(Blake3("{uri_bookmarked}"")[:half])
495
+ */
496
+ class PubkyAppBookmark {
839
497
  static __wrap(ptr) {
840
498
  ptr = ptr >>> 0;
841
- const obj = Object.create(Meta.prototype);
499
+ const obj = Object.create(PubkyAppBookmark.prototype);
842
500
  obj.__wbg_ptr = ptr;
843
- MetaFinalization.register(obj, obj.__wbg_ptr, obj);
501
+ PubkyAppBookmarkFinalization.register(obj, obj.__wbg_ptr, obj);
844
502
  return obj;
845
503
  }
846
-
847
504
  __destroy_into_raw() {
848
505
  const ptr = this.__wbg_ptr;
849
506
  this.__wbg_ptr = 0;
850
- MetaFinalization.unregister(this);
507
+ PubkyAppBookmarkFinalization.unregister(this);
851
508
  return ptr;
852
509
  }
853
-
854
510
  free() {
855
511
  const ptr = this.__destroy_into_raw();
856
- wasm.__wbg_meta_free(ptr, 0);
512
+ wasm.__wbg_pubkyappbookmark_free(ptr, 0);
857
513
  }
858
514
  /**
859
- * @returns {string}
515
+ * @returns {bigint}
860
516
  */
861
- get id() {
862
- let deferred1_0;
863
- let deferred1_1;
864
- try {
865
- const ret = wasm.meta_id(this.__wbg_ptr);
866
- deferred1_0 = ret[0];
867
- deferred1_1 = ret[1];
868
- return getStringFromWasm0(ret[0], ret[1]);
869
- } finally {
870
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
517
+ get created_at() {
518
+ const ret = wasm.__wbg_get_pubkyappbookmark_created_at(this.__wbg_ptr);
519
+ return ret;
520
+ }
521
+ /**
522
+ * Serialize to JSON for WASM.
523
+ * @param {any} js_value
524
+ * @returns {PubkyAppBookmark}
525
+ */
526
+ static fromJson(js_value) {
527
+ const ret = wasm.pubkyappbookmark_fromJson(js_value);
528
+ if (ret[2]) {
529
+ throw takeFromExternrefTable0(ret[1]);
871
530
  }
531
+ return PubkyAppBookmark.__wrap(ret[0]);
872
532
  }
873
533
  /**
874
- * @returns {string}
534
+ * @returns {any}
875
535
  */
876
- get path() {
877
- let deferred1_0;
878
- let deferred1_1;
879
- try {
880
- const ret = wasm.meta_path(this.__wbg_ptr);
881
- deferred1_0 = ret[0];
882
- deferred1_1 = ret[1];
883
- return getStringFromWasm0(ret[0], ret[1]);
884
- } finally {
885
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
536
+ toJson() {
537
+ const ret = wasm.pubkyappbookmark_toJson(this.__wbg_ptr);
538
+ if (ret[2]) {
539
+ throw takeFromExternrefTable0(ret[1]);
886
540
  }
541
+ return takeFromExternrefTable0(ret[0]);
887
542
  }
888
543
  /**
544
+ * Getter for `uri`.
889
545
  * @returns {string}
890
546
  */
891
- get url() {
547
+ get uri() {
892
548
  let deferred1_0;
893
549
  let deferred1_1;
894
550
  try {
895
- const ret = wasm.meta_url(this.__wbg_ptr);
551
+ const ret = wasm.pubkyappbookmark_uri(this.__wbg_ptr);
896
552
  deferred1_0 = ret[0];
897
553
  deferred1_1 = ret[1];
898
554
  return getStringFromWasm0(ret[0], ret[1]);
@@ -900,106 +556,73 @@ class Meta {
900
556
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
901
557
  }
902
558
  }
559
+ /**
560
+ * @param {bigint} arg0
561
+ */
562
+ set created_at(arg0) {
563
+ wasm.__wbg_set_pubkyappbookmark_created_at(this.__wbg_ptr, arg0);
564
+ }
903
565
  }
904
- module.exports.Meta = Meta;
905
-
906
- const MuteResultFinalization = (typeof FinalizationRegistry === 'undefined')
907
- ? { register: () => {}, unregister: () => {} }
908
- : new FinalizationRegistry(ptr => wasm.__wbg_muteresult_free(ptr >>> 0, 1));
909
-
910
- class MuteResult {
566
+ if (Symbol.dispose) PubkyAppBookmark.prototype[Symbol.dispose] = PubkyAppBookmark.prototype.free;
567
+ exports.PubkyAppBookmark = PubkyAppBookmark;
911
568
 
569
+ /**
570
+ * Represents a feed configuration.
571
+ */
572
+ class PubkyAppFeed {
912
573
  static __wrap(ptr) {
913
574
  ptr = ptr >>> 0;
914
- const obj = Object.create(MuteResult.prototype);
575
+ const obj = Object.create(PubkyAppFeed.prototype);
915
576
  obj.__wbg_ptr = ptr;
916
- MuteResultFinalization.register(obj, obj.__wbg_ptr, obj);
577
+ PubkyAppFeedFinalization.register(obj, obj.__wbg_ptr, obj);
917
578
  return obj;
918
579
  }
919
-
920
580
  __destroy_into_raw() {
921
581
  const ptr = this.__wbg_ptr;
922
582
  this.__wbg_ptr = 0;
923
- MuteResultFinalization.unregister(this);
583
+ PubkyAppFeedFinalization.unregister(this);
924
584
  return ptr;
925
585
  }
926
-
927
586
  free() {
928
587
  const ptr = this.__destroy_into_raw();
929
- wasm.__wbg_muteresult_free(ptr, 0);
588
+ wasm.__wbg_pubkyappfeed_free(ptr, 0);
930
589
  }
931
590
  /**
932
- * @returns {PubkyAppMute}
591
+ * @returns {bigint}
933
592
  */
934
- get mute() {
935
- const ret = wasm.followresult_follow(this.__wbg_ptr);
936
- return PubkyAppMute.__wrap(ret);
593
+ get created_at() {
594
+ const ret = wasm.__wbg_get_pubkyappfeed_created_at(this.__wbg_ptr);
595
+ return ret;
937
596
  }
938
597
  /**
939
- * @returns {Meta}
598
+ * Getter for `feed`.
599
+ * @returns {PubkyAppFeedConfig}
940
600
  */
941
- get meta() {
942
- const ret = wasm.followresult_meta(this.__wbg_ptr);
943
- return Meta.__wrap(ret);
944
- }
945
- }
946
- module.exports.MuteResult = MuteResult;
947
-
948
- const ParsedUriResultFinalization = (typeof FinalizationRegistry === 'undefined')
949
- ? { register: () => {}, unregister: () => {} }
950
- : new FinalizationRegistry(ptr => wasm.__wbg_parseduriresult_free(ptr >>> 0, 1));
951
- /**
952
- * This object represents the result of parsing a Pubky URI. It contains:
953
- * - `user_id`: the parsed user ID as a string.
954
- * - `resource`: a string representing the kind of resource (derived from internal `Resource` enum Display).
955
- * - `resource_id`: an optional resource identifier (if applicable).
956
- */
957
- class ParsedUriResult {
958
-
959
- static __wrap(ptr) {
960
- ptr = ptr >>> 0;
961
- const obj = Object.create(ParsedUriResult.prototype);
962
- obj.__wbg_ptr = ptr;
963
- ParsedUriResultFinalization.register(obj, obj.__wbg_ptr, obj);
964
- return obj;
965
- }
966
-
967
- __destroy_into_raw() {
968
- const ptr = this.__wbg_ptr;
969
- this.__wbg_ptr = 0;
970
- ParsedUriResultFinalization.unregister(this);
971
- return ptr;
972
- }
973
-
974
- free() {
975
- const ptr = this.__destroy_into_raw();
976
- wasm.__wbg_parseduriresult_free(ptr, 0);
601
+ get feed() {
602
+ const ret = wasm.pubkyappfeed_feed(this.__wbg_ptr);
603
+ return PubkyAppFeedConfig.__wrap(ret);
977
604
  }
978
605
  /**
979
- * Returns the user ID.
980
- * @returns {string}
606
+ * Serialize to JSON for WASM.
607
+ * @param {any} js_value
608
+ * @returns {PubkyAppFeed}
981
609
  */
982
- get user_id() {
983
- let deferred1_0;
984
- let deferred1_1;
985
- try {
986
- const ret = wasm.parseduriresult_user_id(this.__wbg_ptr);
987
- deferred1_0 = ret[0];
988
- deferred1_1 = ret[1];
989
- return getStringFromWasm0(ret[0], ret[1]);
990
- } finally {
991
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
610
+ static fromJson(js_value) {
611
+ const ret = wasm.pubkyappfeed_fromJson(js_value);
612
+ if (ret[2]) {
613
+ throw takeFromExternrefTable0(ret[1]);
992
614
  }
615
+ return PubkyAppFeed.__wrap(ret[0]);
993
616
  }
994
617
  /**
995
- * Returns the resource kind.
618
+ * Getter for `name`.
996
619
  * @returns {string}
997
620
  */
998
- get resource() {
621
+ get name() {
999
622
  let deferred1_0;
1000
623
  let deferred1_1;
1001
624
  try {
1002
- const ret = wasm.parseduriresult_resource(this.__wbg_ptr);
625
+ const ret = wasm.pubkyappfeed_name(this.__wbg_ptr);
1003
626
  deferred1_0 = ret[0];
1004
627
  deferred1_1 = ret[1];
1005
628
  return getStringFromWasm0(ret[0], ret[1]);
@@ -1008,290 +631,234 @@ class ParsedUriResult {
1008
631
  }
1009
632
  }
1010
633
  /**
1011
- * Returns the resource ID if present.
1012
- * @returns {string | undefined}
634
+ * @returns {any}
1013
635
  */
1014
- get resource_id() {
1015
- const ret = wasm.parseduriresult_resource_id(this.__wbg_ptr);
1016
- let v1;
1017
- if (ret[0] !== 0) {
1018
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1019
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
636
+ toJson() {
637
+ const ret = wasm.pubkyappfeed_toJson(this.__wbg_ptr);
638
+ if (ret[2]) {
639
+ throw takeFromExternrefTable0(ret[1]);
1020
640
  }
1021
- return v1;
1022
- }
1023
- }
1024
- module.exports.ParsedUriResult = ParsedUriResult;
1025
-
1026
- const PostResultFinalization = (typeof FinalizationRegistry === 'undefined')
1027
- ? { register: () => {}, unregister: () => {} }
1028
- : new FinalizationRegistry(ptr => wasm.__wbg_postresult_free(ptr >>> 0, 1));
1029
-
1030
- class PostResult {
1031
-
1032
- static __wrap(ptr) {
1033
- ptr = ptr >>> 0;
1034
- const obj = Object.create(PostResult.prototype);
1035
- obj.__wbg_ptr = ptr;
1036
- PostResultFinalization.register(obj, obj.__wbg_ptr, obj);
1037
- return obj;
1038
- }
1039
-
1040
- __destroy_into_raw() {
1041
- const ptr = this.__wbg_ptr;
1042
- this.__wbg_ptr = 0;
1043
- PostResultFinalization.unregister(this);
1044
- return ptr;
1045
- }
1046
-
1047
- free() {
1048
- const ptr = this.__destroy_into_raw();
1049
- wasm.__wbg_postresult_free(ptr, 0);
1050
- }
1051
- /**
1052
- * @returns {PubkyAppPost}
1053
- */
1054
- get post() {
1055
- const ret = wasm.postresult_post(this.__wbg_ptr);
1056
- return PubkyAppPost.__wrap(ret);
641
+ return takeFromExternrefTable0(ret[0]);
1057
642
  }
1058
643
  /**
1059
- * @returns {Meta}
644
+ * @param {bigint} arg0
1060
645
  */
1061
- get meta() {
1062
- const ret = wasm.postresult_meta(this.__wbg_ptr);
1063
- return Meta.__wrap(ret);
646
+ set created_at(arg0) {
647
+ wasm.__wbg_set_pubkyappfeed_created_at(this.__wbg_ptr, arg0);
1064
648
  }
1065
649
  }
1066
- module.exports.PostResult = PostResult;
650
+ if (Symbol.dispose) PubkyAppFeed.prototype[Symbol.dispose] = PubkyAppFeed.prototype.free;
651
+ exports.PubkyAppFeed = PubkyAppFeed;
1067
652
 
1068
- const PubkyAppBlobFinalization = (typeof FinalizationRegistry === 'undefined')
1069
- ? { register: () => {}, unregister: () => {} }
1070
- : new FinalizationRegistry(ptr => wasm.__wbg_pubkyappblob_free(ptr >>> 0, 1));
1071
653
  /**
1072
- * Represents a blob, which backs a file uploaded by the user.
1073
- * URI: /pub/pubky.app/blobs/:blob_id
654
+ * Configuration object for the feed.
1074
655
  */
1075
- class PubkyAppBlob {
1076
-
656
+ class PubkyAppFeedConfig {
1077
657
  static __wrap(ptr) {
1078
658
  ptr = ptr >>> 0;
1079
- const obj = Object.create(PubkyAppBlob.prototype);
659
+ const obj = Object.create(PubkyAppFeedConfig.prototype);
1080
660
  obj.__wbg_ptr = ptr;
1081
- PubkyAppBlobFinalization.register(obj, obj.__wbg_ptr, obj);
661
+ PubkyAppFeedConfigFinalization.register(obj, obj.__wbg_ptr, obj);
1082
662
  return obj;
1083
663
  }
1084
-
1085
664
  __destroy_into_raw() {
1086
665
  const ptr = this.__wbg_ptr;
1087
666
  this.__wbg_ptr = 0;
1088
- PubkyAppBlobFinalization.unregister(this);
667
+ PubkyAppFeedConfigFinalization.unregister(this);
1089
668
  return ptr;
1090
669
  }
1091
-
1092
670
  free() {
1093
671
  const ptr = this.__destroy_into_raw();
1094
- wasm.__wbg_pubkyappblob_free(ptr, 0);
672
+ wasm.__wbg_pubkyappfeedconfig_free(ptr, 0);
1095
673
  }
1096
674
  /**
1097
- * @param {any} js_value
1098
- * @returns {PubkyAppBlob}
675
+ * Getter for `content`.
676
+ * @returns {PubkyAppPostKind | undefined}
1099
677
  */
1100
- static fromJson(js_value) {
1101
- const ret = wasm.pubkyappblob_fromJson(js_value);
1102
- if (ret[2]) {
1103
- throw takeFromExternrefTable0(ret[1]);
1104
- }
1105
- return PubkyAppBlob.__wrap(ret[0]);
678
+ get content() {
679
+ const ret = wasm.pubkyappfeedconfig_content(this.__wbg_ptr);
680
+ return ret === 8 ? undefined : ret;
1106
681
  }
1107
682
  /**
1108
- * @returns {any}
683
+ * @param {any} js_value
684
+ * @returns {PubkyAppFeedConfig}
1109
685
  */
1110
- toJson() {
1111
- const ret = wasm.pubkyappblob_toJson(this.__wbg_ptr);
686
+ static fromJson(js_value) {
687
+ const ret = wasm.pubkyappfeedconfig_fromJson(js_value);
1112
688
  if (ret[2]) {
1113
689
  throw takeFromExternrefTable0(ret[1]);
1114
690
  }
1115
- return takeFromExternrefTable0(ret[0]);
691
+ return PubkyAppFeedConfig.__wrap(ret[0]);
1116
692
  }
1117
693
  /**
1118
- * Getter for the blob data as a `Uint8Array`.
1119
- * @returns {Uint8Array}
694
+ * Getter for `layout`.
695
+ * @returns {PubkyAppFeedLayout}
1120
696
  */
1121
- get data() {
1122
- const ret = wasm.pubkyappblob_data(this.__wbg_ptr);
697
+ get layout() {
698
+ const ret = wasm.pubkyappfeedconfig_layout(this.__wbg_ptr);
1123
699
  return ret;
1124
700
  }
1125
- }
1126
- module.exports.PubkyAppBlob = PubkyAppBlob;
1127
-
1128
- const PubkyAppBookmarkFinalization = (typeof FinalizationRegistry === 'undefined')
1129
- ? { register: () => {}, unregister: () => {} }
1130
- : new FinalizationRegistry(ptr => wasm.__wbg_pubkyappbookmark_free(ptr >>> 0, 1));
1131
- /**
1132
- * Represents raw homeserver bookmark with id
1133
- * URI: /pub/pubky.app/bookmarks/:bookmark_id
1134
- *
1135
- * Example URI:
1136
- *
1137
- * `/pub/pubky.app/bookmarks/AF7KQ6NEV5XV1EG5DVJ2E74JJ4`
1138
- *
1139
- * Where bookmark_id is Crockford-base32(Blake3("{uri_bookmarked}"")[:half])
1140
- */
1141
- class PubkyAppBookmark {
1142
-
1143
- static __wrap(ptr) {
1144
- ptr = ptr >>> 0;
1145
- const obj = Object.create(PubkyAppBookmark.prototype);
1146
- obj.__wbg_ptr = ptr;
1147
- PubkyAppBookmarkFinalization.register(obj, obj.__wbg_ptr, obj);
1148
- return obj;
1149
- }
1150
-
1151
- __destroy_into_raw() {
1152
- const ptr = this.__wbg_ptr;
1153
- this.__wbg_ptr = 0;
1154
- PubkyAppBookmarkFinalization.unregister(this);
1155
- return ptr;
1156
- }
1157
-
1158
- free() {
1159
- const ptr = this.__destroy_into_raw();
1160
- wasm.__wbg_pubkyappbookmark_free(ptr, 0);
1161
- }
1162
701
  /**
1163
- * @returns {bigint}
702
+ * Getter for `name`.
703
+ * @returns {PubkyAppFeedReach}
1164
704
  */
1165
- get created_at() {
1166
- const ret = wasm.__wbg_get_pubkyappbookmark_created_at(this.__wbg_ptr);
705
+ get reach() {
706
+ const ret = wasm.pubkyappfeedconfig_reach(this.__wbg_ptr);
1167
707
  return ret;
1168
708
  }
1169
709
  /**
1170
- * @param {bigint} arg0
710
+ * Getter for `sort`.
711
+ * @returns {PubkyAppFeedSort}
1171
712
  */
1172
- set created_at(arg0) {
1173
- wasm.__wbg_set_pubkyappbookmark_created_at(this.__wbg_ptr, arg0);
713
+ get sort() {
714
+ const ret = wasm.pubkyappfeedconfig_sort(this.__wbg_ptr);
715
+ return ret;
1174
716
  }
1175
717
  /**
1176
- * Serialize to JSON for WASM.
1177
- * @param {any} js_value
1178
- * @returns {PubkyAppBookmark}
718
+ * Getter for `tags`.
719
+ * @returns {string[] | undefined}
1179
720
  */
1180
- static fromJson(js_value) {
1181
- const ret = wasm.pubkyappbookmark_fromJson(js_value);
1182
- if (ret[2]) {
1183
- throw takeFromExternrefTable0(ret[1]);
721
+ get tags() {
722
+ const ret = wasm.pubkyappfeedconfig_tags(this.__wbg_ptr);
723
+ let v1;
724
+ if (ret[0] !== 0) {
725
+ v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
726
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1184
727
  }
1185
- return PubkyAppBookmark.__wrap(ret[0]);
728
+ return v1;
1186
729
  }
1187
730
  /**
1188
731
  * @returns {any}
1189
732
  */
1190
733
  toJson() {
1191
- const ret = wasm.pubkyappbookmark_toJson(this.__wbg_ptr);
734
+ const ret = wasm.pubkyappfeedconfig_toJson(this.__wbg_ptr);
1192
735
  if (ret[2]) {
1193
736
  throw takeFromExternrefTable0(ret[1]);
1194
737
  }
1195
738
  return takeFromExternrefTable0(ret[0]);
1196
739
  }
1197
- /**
1198
- * Getter for `uri`.
1199
- * @returns {string}
1200
- */
1201
- get uri() {
1202
- let deferred1_0;
1203
- let deferred1_1;
1204
- try {
1205
- const ret = wasm.pubkyappbookmark_uri(this.__wbg_ptr);
1206
- deferred1_0 = ret[0];
1207
- deferred1_1 = ret[1];
1208
- return getStringFromWasm0(ret[0], ret[1]);
1209
- } finally {
1210
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1211
- }
1212
- }
1213
740
  }
1214
- module.exports.PubkyAppBookmark = PubkyAppBookmark;
741
+ if (Symbol.dispose) PubkyAppFeedConfig.prototype[Symbol.dispose] = PubkyAppFeedConfig.prototype.free;
742
+ exports.PubkyAppFeedConfig = PubkyAppFeedConfig;
1215
743
 
1216
- const PubkyAppFeedFinalization = (typeof FinalizationRegistry === 'undefined')
1217
- ? { register: () => {}, unregister: () => {} }
1218
- : new FinalizationRegistry(ptr => wasm.__wbg_pubkyappfeed_free(ptr >>> 0, 1));
1219
744
  /**
1220
- * Represents a feed configuration.
745
+ * Enum representing the layout of the feed.
746
+ * @enum {0 | 1 | 2}
1221
747
  */
1222
- class PubkyAppFeed {
748
+ const PubkyAppFeedLayout = Object.freeze({
749
+ Columns: 0, "0": "Columns",
750
+ Wide: 1, "1": "Wide",
751
+ Visual: 2, "2": "Visual",
752
+ });
753
+ exports.PubkyAppFeedLayout = PubkyAppFeedLayout;
754
+
755
+ /**
756
+ * Enum representing the reach of the feed.
757
+ * @enum {0 | 1 | 2 | 3}
758
+ */
759
+ const PubkyAppFeedReach = Object.freeze({
760
+ Following: 0, "0": "Following",
761
+ Followers: 1, "1": "Followers",
762
+ Friends: 2, "2": "Friends",
763
+ All: 3, "3": "All",
764
+ });
765
+ exports.PubkyAppFeedReach = PubkyAppFeedReach;
766
+
767
+ /**
768
+ * Enum representing the sort order of the feed.
769
+ * @enum {0 | 1}
770
+ */
771
+ const PubkyAppFeedSort = Object.freeze({
772
+ Recent: 0, "0": "Recent",
773
+ Popularity: 1, "1": "Popularity",
774
+ });
775
+ exports.PubkyAppFeedSort = PubkyAppFeedSort;
1223
776
 
777
+ /**
778
+ * Represents a file uploaded by the user.
779
+ * URI: /pub/pubky.app/files/:file_id
780
+ */
781
+ class PubkyAppFile {
1224
782
  static __wrap(ptr) {
1225
783
  ptr = ptr >>> 0;
1226
- const obj = Object.create(PubkyAppFeed.prototype);
784
+ const obj = Object.create(PubkyAppFile.prototype);
1227
785
  obj.__wbg_ptr = ptr;
1228
- PubkyAppFeedFinalization.register(obj, obj.__wbg_ptr, obj);
786
+ PubkyAppFileFinalization.register(obj, obj.__wbg_ptr, obj);
1229
787
  return obj;
1230
788
  }
1231
-
1232
789
  __destroy_into_raw() {
1233
790
  const ptr = this.__wbg_ptr;
1234
791
  this.__wbg_ptr = 0;
1235
- PubkyAppFeedFinalization.unregister(this);
792
+ PubkyAppFileFinalization.unregister(this);
1236
793
  return ptr;
1237
794
  }
1238
-
1239
795
  free() {
1240
796
  const ptr = this.__destroy_into_raw();
1241
- wasm.__wbg_pubkyappfeed_free(ptr, 0);
797
+ wasm.__wbg_pubkyappfile_free(ptr, 0);
1242
798
  }
1243
799
  /**
1244
800
  * @returns {bigint}
1245
801
  */
1246
802
  get created_at() {
1247
- const ret = wasm.__wbg_get_pubkyappfeed_created_at(this.__wbg_ptr);
803
+ const ret = wasm.__wbg_get_pubkyappfile_created_at(this.__wbg_ptr);
1248
804
  return ret;
1249
805
  }
1250
806
  /**
1251
- * @param {bigint} arg0
807
+ * @returns {number}
1252
808
  */
1253
- set created_at(arg0) {
1254
- wasm.__wbg_set_pubkyappfeed_created_at(this.__wbg_ptr, arg0);
809
+ get size() {
810
+ const ret = wasm.__wbg_get_pubkyappfile_size(this.__wbg_ptr);
811
+ return ret >>> 0;
1255
812
  }
1256
813
  /**
1257
- * Serialize to JSON for WASM.
1258
- * @param {any} js_value
1259
- * @returns {PubkyAppFeed}
814
+ * @returns {string}
1260
815
  */
1261
- static fromJson(js_value) {
1262
- const ret = wasm.pubkyappfeed_fromJson(js_value);
1263
- if (ret[2]) {
1264
- throw takeFromExternrefTable0(ret[1]);
816
+ get content_type() {
817
+ let deferred1_0;
818
+ let deferred1_1;
819
+ try {
820
+ const ret = wasm.pubkyappfile_content_type(this.__wbg_ptr);
821
+ deferred1_0 = ret[0];
822
+ deferred1_1 = ret[1];
823
+ return getStringFromWasm0(ret[0], ret[1]);
824
+ } finally {
825
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1265
826
  }
1266
- return PubkyAppFeed.__wrap(ret[0]);
1267
827
  }
1268
828
  /**
1269
- * @returns {any}
829
+ * @param {any} js_value
830
+ * @returns {PubkyAppFile}
1270
831
  */
1271
- toJson() {
1272
- const ret = wasm.pubkyappfeed_toJson(this.__wbg_ptr);
832
+ static fromJson(js_value) {
833
+ const ret = wasm.pubkyappfile_fromJson(js_value);
1273
834
  if (ret[2]) {
1274
835
  throw takeFromExternrefTable0(ret[1]);
1275
836
  }
1276
- return takeFromExternrefTable0(ret[0]);
837
+ return PubkyAppFile.__wrap(ret[0]);
1277
838
  }
1278
839
  /**
1279
- * Getter for `feed`.
1280
- * @returns {PubkyAppFeedConfig}
840
+ * @returns {string}
1281
841
  */
1282
- get feed() {
1283
- const ret = wasm.pubkyappfeed_feed(this.__wbg_ptr);
1284
- return PubkyAppFeedConfig.__wrap(ret);
842
+ get name() {
843
+ let deferred1_0;
844
+ let deferred1_1;
845
+ try {
846
+ const ret = wasm.pubkyappfile_name(this.__wbg_ptr);
847
+ deferred1_0 = ret[0];
848
+ deferred1_1 = ret[1];
849
+ return getStringFromWasm0(ret[0], ret[1]);
850
+ } finally {
851
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
852
+ }
1285
853
  }
1286
854
  /**
1287
- * Getter for `name`.
1288
855
  * @returns {string}
1289
856
  */
1290
- get name() {
857
+ get src() {
1291
858
  let deferred1_0;
1292
859
  let deferred1_1;
1293
860
  try {
1294
- const ret = wasm.pubkyappfeed_name(this.__wbg_ptr);
861
+ const ret = wasm.pubkyappfile_src(this.__wbg_ptr);
1295
862
  deferred1_0 = ret[0];
1296
863
  deferred1_1 = ret[1];
1297
864
  return getStringFromWasm0(ret[0], ret[1]);
@@ -1299,368 +866,159 @@ class PubkyAppFeed {
1299
866
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1300
867
  }
1301
868
  }
869
+ /**
870
+ * @returns {any}
871
+ */
872
+ toJson() {
873
+ const ret = wasm.pubkyappfile_toJson(this.__wbg_ptr);
874
+ if (ret[2]) {
875
+ throw takeFromExternrefTable0(ret[1]);
876
+ }
877
+ return takeFromExternrefTable0(ret[0]);
878
+ }
879
+ /**
880
+ * @param {bigint} arg0
881
+ */
882
+ set created_at(arg0) {
883
+ wasm.__wbg_set_pubkyappfile_created_at(this.__wbg_ptr, arg0);
884
+ }
885
+ /**
886
+ * @param {number} arg0
887
+ */
888
+ set size(arg0) {
889
+ wasm.__wbg_set_pubkyappfile_size(this.__wbg_ptr, arg0);
890
+ }
1302
891
  }
1303
- module.exports.PubkyAppFeed = PubkyAppFeed;
892
+ if (Symbol.dispose) PubkyAppFile.prototype[Symbol.dispose] = PubkyAppFile.prototype.free;
893
+ exports.PubkyAppFile = PubkyAppFile;
1304
894
 
1305
- const PubkyAppFeedConfigFinalization = (typeof FinalizationRegistry === 'undefined')
1306
- ? { register: () => {}, unregister: () => {} }
1307
- : new FinalizationRegistry(ptr => wasm.__wbg_pubkyappfeedconfig_free(ptr >>> 0, 1));
1308
895
  /**
1309
- * Configuration object for the feed.
896
+ * Represents raw homeserver follow object with timestamp
897
+ *
898
+ * On follow objects, the main data is encoded in the path
899
+ *
900
+ * URI: /pub/pubky.app/follows/:user_id
901
+ *
902
+ * Example URI:
903
+ *
904
+ * `/pub/pubky.app/follows/pxnu33x7jtpx9ar1ytsi4yxbp6a5o36gwhffs8zoxmbuptici1jy`
1310
905
  */
1311
- class PubkyAppFeedConfig {
1312
-
906
+ class PubkyAppFollow {
1313
907
  static __wrap(ptr) {
1314
908
  ptr = ptr >>> 0;
1315
- const obj = Object.create(PubkyAppFeedConfig.prototype);
909
+ const obj = Object.create(PubkyAppFollow.prototype);
1316
910
  obj.__wbg_ptr = ptr;
1317
- PubkyAppFeedConfigFinalization.register(obj, obj.__wbg_ptr, obj);
911
+ PubkyAppFollowFinalization.register(obj, obj.__wbg_ptr, obj);
1318
912
  return obj;
1319
913
  }
1320
-
1321
914
  __destroy_into_raw() {
1322
915
  const ptr = this.__wbg_ptr;
1323
916
  this.__wbg_ptr = 0;
1324
- PubkyAppFeedConfigFinalization.unregister(this);
917
+ PubkyAppFollowFinalization.unregister(this);
1325
918
  return ptr;
1326
919
  }
1327
-
1328
920
  free() {
1329
921
  const ptr = this.__destroy_into_raw();
1330
- wasm.__wbg_pubkyappfeedconfig_free(ptr, 0);
922
+ wasm.__wbg_pubkyappfollow_free(ptr, 0);
923
+ }
924
+ /**
925
+ * @returns {bigint}
926
+ */
927
+ get created_at() {
928
+ const ret = wasm.__wbg_get_pubkyappfollow_created_at(this.__wbg_ptr);
929
+ return ret;
1331
930
  }
1332
931
  /**
1333
932
  * @param {any} js_value
1334
- * @returns {PubkyAppFeedConfig}
933
+ * @returns {PubkyAppFollow}
1335
934
  */
1336
935
  static fromJson(js_value) {
1337
- const ret = wasm.pubkyappfeedconfig_fromJson(js_value);
936
+ const ret = wasm.pubkyappfollow_fromJson(js_value);
1338
937
  if (ret[2]) {
1339
938
  throw takeFromExternrefTable0(ret[1]);
1340
939
  }
1341
- return PubkyAppFeedConfig.__wrap(ret[0]);
940
+ return PubkyAppFollow.__wrap(ret[0]);
1342
941
  }
1343
942
  /**
1344
943
  * @returns {any}
1345
944
  */
1346
945
  toJson() {
1347
- const ret = wasm.pubkyappfeedconfig_toJson(this.__wbg_ptr);
946
+ const ret = wasm.pubkyappfollow_toJson(this.__wbg_ptr);
1348
947
  if (ret[2]) {
1349
948
  throw takeFromExternrefTable0(ret[1]);
1350
949
  }
1351
950
  return takeFromExternrefTable0(ret[0]);
1352
951
  }
1353
952
  /**
1354
- * Getter for `tags`.
1355
- * @returns {string[] | undefined}
1356
- */
1357
- get tags() {
1358
- const ret = wasm.pubkyappfeedconfig_tags(this.__wbg_ptr);
1359
- let v1;
1360
- if (ret[0] !== 0) {
1361
- v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1362
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1363
- }
1364
- return v1;
1365
- }
1366
- /**
1367
- * Getter for `name`.
1368
- * @returns {PubkyAppFeedReach}
1369
- */
1370
- get reach() {
1371
- const ret = wasm.pubkyappfeedconfig_reach(this.__wbg_ptr);
1372
- return ret;
1373
- }
1374
- /**
1375
- * Getter for `layout`.
1376
- * @returns {PubkyAppFeedLayout}
1377
- */
1378
- get layout() {
1379
- const ret = wasm.pubkyappfeedconfig_layout(this.__wbg_ptr);
1380
- return ret;
1381
- }
1382
- /**
1383
- * Getter for `sort`.
1384
- * @returns {PubkyAppFeedSort}
1385
- */
1386
- get sort() {
1387
- const ret = wasm.pubkyappfeedconfig_sort(this.__wbg_ptr);
1388
- return ret;
1389
- }
1390
- /**
1391
- * Getter for `content`.
1392
- * @returns {PubkyAppPostKind | undefined}
953
+ * @param {bigint} arg0
1393
954
  */
1394
- get content() {
1395
- const ret = wasm.pubkyappfeedconfig_content(this.__wbg_ptr);
1396
- return ret === 6 ? undefined : ret;
955
+ set created_at(arg0) {
956
+ wasm.__wbg_set_pubkyappfollow_created_at(this.__wbg_ptr, arg0);
1397
957
  }
1398
958
  }
1399
- module.exports.PubkyAppFeedConfig = PubkyAppFeedConfig;
959
+ if (Symbol.dispose) PubkyAppFollow.prototype[Symbol.dispose] = PubkyAppFollow.prototype.free;
960
+ exports.PubkyAppFollow = PubkyAppFollow;
1400
961
 
1401
- const PubkyAppFileFinalization = (typeof FinalizationRegistry === 'undefined')
1402
- ? { register: () => {}, unregister: () => {} }
1403
- : new FinalizationRegistry(ptr => wasm.__wbg_pubkyappfile_free(ptr >>> 0, 1));
1404
962
  /**
1405
- * Represents a file uploaded by the user.
1406
- * URI: /pub/pubky.app/files/:file_id
963
+ * Represents the last read timestamp for notifications.
964
+ * URI: /pub/pubky.app/last_read
1407
965
  */
1408
- class PubkyAppFile {
1409
-
966
+ class PubkyAppLastRead {
1410
967
  static __wrap(ptr) {
1411
968
  ptr = ptr >>> 0;
1412
- const obj = Object.create(PubkyAppFile.prototype);
969
+ const obj = Object.create(PubkyAppLastRead.prototype);
1413
970
  obj.__wbg_ptr = ptr;
1414
- PubkyAppFileFinalization.register(obj, obj.__wbg_ptr, obj);
971
+ PubkyAppLastReadFinalization.register(obj, obj.__wbg_ptr, obj);
1415
972
  return obj;
1416
973
  }
1417
-
1418
974
  __destroy_into_raw() {
1419
975
  const ptr = this.__wbg_ptr;
1420
976
  this.__wbg_ptr = 0;
1421
- PubkyAppFileFinalization.unregister(this);
977
+ PubkyAppLastReadFinalization.unregister(this);
1422
978
  return ptr;
1423
979
  }
1424
-
1425
980
  free() {
1426
981
  const ptr = this.__destroy_into_raw();
1427
- wasm.__wbg_pubkyappfile_free(ptr, 0);
982
+ wasm.__wbg_pubkyapplastread_free(ptr, 0);
1428
983
  }
1429
984
  /**
1430
985
  * @returns {bigint}
1431
986
  */
1432
- get created_at() {
1433
- const ret = wasm.__wbg_get_pubkyappbookmark_created_at(this.__wbg_ptr);
987
+ get timestamp() {
988
+ const ret = wasm.__wbg_get_pubkyapplastread_timestamp(this.__wbg_ptr);
1434
989
  return ret;
1435
990
  }
1436
991
  /**
1437
- * @param {bigint} arg0
992
+ * @param {any} js_value
993
+ * @returns {PubkyAppLastRead}
1438
994
  */
1439
- set created_at(arg0) {
1440
- wasm.__wbg_set_pubkyappbookmark_created_at(this.__wbg_ptr, arg0);
995
+ static fromJson(js_value) {
996
+ const ret = wasm.pubkyapplastread_fromJson(js_value);
997
+ if (ret[2]) {
998
+ throw takeFromExternrefTable0(ret[1]);
999
+ }
1000
+ return PubkyAppLastRead.__wrap(ret[0]);
1441
1001
  }
1442
1002
  /**
1443
- * @returns {number}
1444
- */
1445
- get size() {
1446
- const ret = wasm.__wbg_get_pubkyappfile_size(this.__wbg_ptr);
1447
- return ret >>> 0;
1448
- }
1449
- /**
1450
- * @param {number} arg0
1451
- */
1452
- set size(arg0) {
1453
- wasm.__wbg_set_pubkyappfile_size(this.__wbg_ptr, arg0);
1454
- }
1455
- /**
1456
- * @returns {string}
1457
- */
1458
- get name() {
1459
- let deferred1_0;
1460
- let deferred1_1;
1461
- try {
1462
- const ret = wasm.pubkyappfile_name(this.__wbg_ptr);
1463
- deferred1_0 = ret[0];
1464
- deferred1_1 = ret[1];
1465
- return getStringFromWasm0(ret[0], ret[1]);
1466
- } finally {
1467
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1468
- }
1469
- }
1470
- /**
1471
- * @returns {string}
1472
- */
1473
- get src() {
1474
- let deferred1_0;
1475
- let deferred1_1;
1476
- try {
1477
- const ret = wasm.pubkyappfile_src(this.__wbg_ptr);
1478
- deferred1_0 = ret[0];
1479
- deferred1_1 = ret[1];
1480
- return getStringFromWasm0(ret[0], ret[1]);
1481
- } finally {
1482
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1483
- }
1484
- }
1485
- /**
1486
- * @returns {string}
1487
- */
1488
- get content_type() {
1489
- let deferred1_0;
1490
- let deferred1_1;
1491
- try {
1492
- const ret = wasm.pubkyappfile_content_type(this.__wbg_ptr);
1493
- deferred1_0 = ret[0];
1494
- deferred1_1 = ret[1];
1495
- return getStringFromWasm0(ret[0], ret[1]);
1496
- } finally {
1497
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1498
- }
1499
- }
1500
- /**
1501
- * @param {any} js_value
1502
- * @returns {PubkyAppFile}
1503
- */
1504
- static fromJson(js_value) {
1505
- const ret = wasm.pubkyappfile_fromJson(js_value);
1506
- if (ret[2]) {
1507
- throw takeFromExternrefTable0(ret[1]);
1508
- }
1509
- return PubkyAppFile.__wrap(ret[0]);
1510
- }
1511
- /**
1512
- * @returns {any}
1513
- */
1514
- toJson() {
1515
- const ret = wasm.pubkyappfile_toJson(this.__wbg_ptr);
1516
- if (ret[2]) {
1517
- throw takeFromExternrefTable0(ret[1]);
1518
- }
1519
- return takeFromExternrefTable0(ret[0]);
1520
- }
1521
- }
1522
- module.exports.PubkyAppFile = PubkyAppFile;
1523
-
1524
- const PubkyAppFollowFinalization = (typeof FinalizationRegistry === 'undefined')
1525
- ? { register: () => {}, unregister: () => {} }
1526
- : new FinalizationRegistry(ptr => wasm.__wbg_pubkyappfollow_free(ptr >>> 0, 1));
1527
- /**
1528
- * Represents raw homeserver follow object with timestamp
1529
- *
1530
- * On follow objects, the main data is encoded in the path
1531
- *
1532
- * URI: /pub/pubky.app/follows/:user_id
1533
- *
1534
- * Example URI:
1535
- *
1536
- * `/pub/pubky.app/follows/pxnu33x7jtpx9ar1ytsi4yxbp6a5o36gwhffs8zoxmbuptici1jy`
1537
- */
1538
- class PubkyAppFollow {
1539
-
1540
- static __wrap(ptr) {
1541
- ptr = ptr >>> 0;
1542
- const obj = Object.create(PubkyAppFollow.prototype);
1543
- obj.__wbg_ptr = ptr;
1544
- PubkyAppFollowFinalization.register(obj, obj.__wbg_ptr, obj);
1545
- return obj;
1546
- }
1547
-
1548
- __destroy_into_raw() {
1549
- const ptr = this.__wbg_ptr;
1550
- this.__wbg_ptr = 0;
1551
- PubkyAppFollowFinalization.unregister(this);
1552
- return ptr;
1553
- }
1554
-
1555
- free() {
1556
- const ptr = this.__destroy_into_raw();
1557
- wasm.__wbg_pubkyappfollow_free(ptr, 0);
1558
- }
1559
- /**
1560
- * @returns {bigint}
1561
- */
1562
- get created_at() {
1563
- const ret = wasm.__wbg_get_pubkyappbookmark_created_at(this.__wbg_ptr);
1564
- return ret;
1565
- }
1566
- /**
1567
- * @param {bigint} arg0
1568
- */
1569
- set created_at(arg0) {
1570
- wasm.__wbg_set_pubkyappbookmark_created_at(this.__wbg_ptr, arg0);
1571
- }
1572
- /**
1573
- * @param {any} js_value
1574
- * @returns {PubkyAppFollow}
1575
- */
1576
- static fromJson(js_value) {
1577
- const ret = wasm.pubkyappfollow_fromJson(js_value);
1578
- if (ret[2]) {
1579
- throw takeFromExternrefTable0(ret[1]);
1580
- }
1581
- return PubkyAppFollow.__wrap(ret[0]);
1582
- }
1583
- /**
1584
- * @returns {any}
1003
+ * @returns {any}
1585
1004
  */
1586
1005
  toJson() {
1587
- const ret = wasm.pubkyappfollow_toJson(this.__wbg_ptr);
1006
+ const ret = wasm.pubkyapplastread_toJson(this.__wbg_ptr);
1588
1007
  if (ret[2]) {
1589
1008
  throw takeFromExternrefTable0(ret[1]);
1590
1009
  }
1591
1010
  return takeFromExternrefTable0(ret[0]);
1592
1011
  }
1593
- }
1594
- module.exports.PubkyAppFollow = PubkyAppFollow;
1595
-
1596
- const PubkyAppLastReadFinalization = (typeof FinalizationRegistry === 'undefined')
1597
- ? { register: () => {}, unregister: () => {} }
1598
- : new FinalizationRegistry(ptr => wasm.__wbg_pubkyapplastread_free(ptr >>> 0, 1));
1599
- /**
1600
- * Represents the last read timestamp for notifications.
1601
- * URI: /pub/pubky.app/last_read
1602
- */
1603
- class PubkyAppLastRead {
1604
-
1605
- static __wrap(ptr) {
1606
- ptr = ptr >>> 0;
1607
- const obj = Object.create(PubkyAppLastRead.prototype);
1608
- obj.__wbg_ptr = ptr;
1609
- PubkyAppLastReadFinalization.register(obj, obj.__wbg_ptr, obj);
1610
- return obj;
1611
- }
1612
-
1613
- __destroy_into_raw() {
1614
- const ptr = this.__wbg_ptr;
1615
- this.__wbg_ptr = 0;
1616
- PubkyAppLastReadFinalization.unregister(this);
1617
- return ptr;
1618
- }
1619
-
1620
- free() {
1621
- const ptr = this.__destroy_into_raw();
1622
- wasm.__wbg_pubkyapplastread_free(ptr, 0);
1623
- }
1624
- /**
1625
- * @returns {bigint}
1626
- */
1627
- get timestamp() {
1628
- const ret = wasm.__wbg_get_pubkyappbookmark_created_at(this.__wbg_ptr);
1629
- return ret;
1630
- }
1631
1012
  /**
1632
1013
  * @param {bigint} arg0
1633
1014
  */
1634
1015
  set timestamp(arg0) {
1635
- wasm.__wbg_set_pubkyappbookmark_created_at(this.__wbg_ptr, arg0);
1636
- }
1637
- /**
1638
- * @param {any} js_value
1639
- * @returns {PubkyAppLastRead}
1640
- */
1641
- static fromJson(js_value) {
1642
- const ret = wasm.pubkyapplastread_fromJson(js_value);
1643
- if (ret[2]) {
1644
- throw takeFromExternrefTable0(ret[1]);
1645
- }
1646
- return PubkyAppLastRead.__wrap(ret[0]);
1647
- }
1648
- /**
1649
- * @returns {any}
1650
- */
1651
- toJson() {
1652
- const ret = wasm.pubkyapplastread_toJson(this.__wbg_ptr);
1653
- if (ret[2]) {
1654
- throw takeFromExternrefTable0(ret[1]);
1655
- }
1656
- return takeFromExternrefTable0(ret[0]);
1016
+ wasm.__wbg_set_pubkyapplastread_timestamp(this.__wbg_ptr, arg0);
1657
1017
  }
1658
1018
  }
1659
- module.exports.PubkyAppLastRead = PubkyAppLastRead;
1019
+ if (Symbol.dispose) PubkyAppLastRead.prototype[Symbol.dispose] = PubkyAppLastRead.prototype.free;
1020
+ exports.PubkyAppLastRead = PubkyAppLastRead;
1660
1021
 
1661
- const PubkyAppMuteFinalization = (typeof FinalizationRegistry === 'undefined')
1662
- ? { register: () => {}, unregister: () => {} }
1663
- : new FinalizationRegistry(ptr => wasm.__wbg_pubkyappmute_free(ptr >>> 0, 1));
1664
1022
  /**
1665
1023
  * Represents raw homeserver Mute object with timestamp
1666
1024
  * URI: /pub/pubky.app/mutes/:user_id
@@ -1670,7 +1028,6 @@ const PubkyAppMuteFinalization = (typeof FinalizationRegistry === 'undefined')
1670
1028
  * `/pub/pubky.app/mutes/pxnu33x7jtpx9ar1ytsi4yxbp6a5o36gwhffs8zoxmbuptici1jy`
1671
1029
  */
1672
1030
  class PubkyAppMute {
1673
-
1674
1031
  static __wrap(ptr) {
1675
1032
  ptr = ptr >>> 0;
1676
1033
  const obj = Object.create(PubkyAppMute.prototype);
@@ -1678,14 +1035,12 @@ class PubkyAppMute {
1678
1035
  PubkyAppMuteFinalization.register(obj, obj.__wbg_ptr, obj);
1679
1036
  return obj;
1680
1037
  }
1681
-
1682
1038
  __destroy_into_raw() {
1683
1039
  const ptr = this.__wbg_ptr;
1684
1040
  this.__wbg_ptr = 0;
1685
1041
  PubkyAppMuteFinalization.unregister(this);
1686
1042
  return ptr;
1687
1043
  }
1688
-
1689
1044
  free() {
1690
1045
  const ptr = this.__destroy_into_raw();
1691
1046
  wasm.__wbg_pubkyappmute_free(ptr, 0);
@@ -1694,15 +1049,9 @@ class PubkyAppMute {
1694
1049
  * @returns {bigint}
1695
1050
  */
1696
1051
  get created_at() {
1697
- const ret = wasm.__wbg_get_pubkyappbookmark_created_at(this.__wbg_ptr);
1052
+ const ret = wasm.__wbg_get_pubkyappmute_created_at(this.__wbg_ptr);
1698
1053
  return ret;
1699
1054
  }
1700
- /**
1701
- * @param {bigint} arg0
1702
- */
1703
- set created_at(arg0) {
1704
- wasm.__wbg_set_pubkyappbookmark_created_at(this.__wbg_ptr, arg0);
1705
- }
1706
1055
  /**
1707
1056
  * @param {any} js_value
1708
1057
  * @returns {PubkyAppMute}
@@ -1724,12 +1073,16 @@ class PubkyAppMute {
1724
1073
  }
1725
1074
  return takeFromExternrefTable0(ret[0]);
1726
1075
  }
1076
+ /**
1077
+ * @param {bigint} arg0
1078
+ */
1079
+ set created_at(arg0) {
1080
+ wasm.__wbg_set_pubkyappmute_created_at(this.__wbg_ptr, arg0);
1081
+ }
1727
1082
  }
1728
- module.exports.PubkyAppMute = PubkyAppMute;
1083
+ if (Symbol.dispose) PubkyAppMute.prototype[Symbol.dispose] = PubkyAppMute.prototype.free;
1084
+ exports.PubkyAppMute = PubkyAppMute;
1729
1085
 
1730
- const PubkyAppPostFinalization = (typeof FinalizationRegistry === 'undefined')
1731
- ? { register: () => {}, unregister: () => {} }
1732
- : new FinalizationRegistry(ptr => wasm.__wbg_pubkyapppost_free(ptr >>> 0, 1));
1733
1086
  /**
1734
1087
  * Represents raw post in homeserver with content and kind
1735
1088
  * URI: /pub/pubky.app/posts/:post_id
@@ -1740,7 +1093,6 @@ const PubkyAppPostFinalization = (typeof FinalizationRegistry === 'undefined')
1740
1093
  * `/pub/pubky.app/posts/00321FCW75ZFY`
1741
1094
  */
1742
1095
  class PubkyAppPost {
1743
-
1744
1096
  static __wrap(ptr) {
1745
1097
  ptr = ptr >>> 0;
1746
1098
  const obj = Object.create(PubkyAppPost.prototype);
@@ -1748,18 +1100,28 @@ class PubkyAppPost {
1748
1100
  PubkyAppPostFinalization.register(obj, obj.__wbg_ptr, obj);
1749
1101
  return obj;
1750
1102
  }
1751
-
1752
1103
  __destroy_into_raw() {
1753
1104
  const ptr = this.__wbg_ptr;
1754
1105
  this.__wbg_ptr = 0;
1755
1106
  PubkyAppPostFinalization.unregister(this);
1756
1107
  return ptr;
1757
1108
  }
1758
-
1759
1109
  free() {
1760
1110
  const ptr = this.__destroy_into_raw();
1761
1111
  wasm.__wbg_pubkyapppost_free(ptr, 0);
1762
1112
  }
1113
+ /**
1114
+ * @returns {string[] | undefined}
1115
+ */
1116
+ get attachments() {
1117
+ const ret = wasm.pubkyapppost_attachments(this.__wbg_ptr);
1118
+ let v1;
1119
+ if (ret[0] !== 0) {
1120
+ v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1121
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1122
+ }
1123
+ return v1;
1124
+ }
1763
1125
  /**
1764
1126
  * @returns {string}
1765
1127
  */
@@ -1775,6 +1137,24 @@ class PubkyAppPost {
1775
1137
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1776
1138
  }
1777
1139
  }
1140
+ /**
1141
+ * @returns {PubkyAppPostEmbed | undefined}
1142
+ */
1143
+ get embed() {
1144
+ const ret = wasm.pubkyapppost_embed(this.__wbg_ptr);
1145
+ return ret === 0 ? undefined : PubkyAppPostEmbed.__wrap(ret);
1146
+ }
1147
+ /**
1148
+ * @param {any} js_value
1149
+ * @returns {PubkyAppPost}
1150
+ */
1151
+ static fromJson(js_value) {
1152
+ const ret = wasm.pubkyapppost_fromJson(js_value);
1153
+ if (ret[2]) {
1154
+ throw takeFromExternrefTable0(ret[1]);
1155
+ }
1156
+ return PubkyAppPost.__wrap(ret[0]);
1157
+ }
1778
1158
  /**
1779
1159
  * @returns {string}
1780
1160
  */
@@ -1790,58 +1170,6 @@ class PubkyAppPost {
1790
1170
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1791
1171
  }
1792
1172
  }
1793
- /**
1794
- * @returns {string | undefined}
1795
- */
1796
- get parent() {
1797
- const ret = wasm.pubkyapppost_parent(this.__wbg_ptr);
1798
- let v1;
1799
- if (ret[0] !== 0) {
1800
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1801
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1802
- }
1803
- return v1;
1804
- }
1805
- /**
1806
- * @returns {PubkyAppPostEmbed | undefined}
1807
- */
1808
- get embed() {
1809
- const ret = wasm.pubkyapppost_embed(this.__wbg_ptr);
1810
- return ret === 0 ? undefined : PubkyAppPostEmbed.__wrap(ret);
1811
- }
1812
- /**
1813
- * @returns {string[] | undefined}
1814
- */
1815
- get attachments() {
1816
- const ret = wasm.pubkyapppost_attachments(this.__wbg_ptr);
1817
- let v1;
1818
- if (ret[0] !== 0) {
1819
- v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1820
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1821
- }
1822
- return v1;
1823
- }
1824
- /**
1825
- * @param {any} js_value
1826
- * @returns {PubkyAppPost}
1827
- */
1828
- static fromJson(js_value) {
1829
- const ret = wasm.pubkyapppost_fromJson(js_value);
1830
- if (ret[2]) {
1831
- throw takeFromExternrefTable0(ret[1]);
1832
- }
1833
- return PubkyAppPost.__wrap(ret[0]);
1834
- }
1835
- /**
1836
- * @returns {any}
1837
- */
1838
- toJson() {
1839
- const ret = wasm.pubkyapppost_toJson(this.__wbg_ptr);
1840
- if (ret[2]) {
1841
- throw takeFromExternrefTable0(ret[1]);
1842
- }
1843
- return takeFromExternrefTable0(ret[0]);
1844
- }
1845
1173
  /**
1846
1174
  * Creates a new `PubkyAppPost` instance and sanitizes it.
1847
1175
  * @param {string} content
@@ -1867,17 +1195,36 @@ class PubkyAppPost {
1867
1195
  PubkyAppPostFinalization.register(this, this.__wbg_ptr, this);
1868
1196
  return this;
1869
1197
  }
1198
+ /**
1199
+ * @returns {string | undefined}
1200
+ */
1201
+ get parent() {
1202
+ const ret = wasm.pubkyapppost_parent(this.__wbg_ptr);
1203
+ let v1;
1204
+ if (ret[0] !== 0) {
1205
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1206
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1207
+ }
1208
+ return v1;
1209
+ }
1210
+ /**
1211
+ * @returns {any}
1212
+ */
1213
+ toJson() {
1214
+ const ret = wasm.pubkyapppost_toJson(this.__wbg_ptr);
1215
+ if (ret[2]) {
1216
+ throw takeFromExternrefTable0(ret[1]);
1217
+ }
1218
+ return takeFromExternrefTable0(ret[0]);
1219
+ }
1870
1220
  }
1871
- module.exports.PubkyAppPost = PubkyAppPost;
1221
+ if (Symbol.dispose) PubkyAppPost.prototype[Symbol.dispose] = PubkyAppPost.prototype.free;
1222
+ exports.PubkyAppPost = PubkyAppPost;
1872
1223
 
1873
- const PubkyAppPostEmbedFinalization = (typeof FinalizationRegistry === 'undefined')
1874
- ? { register: () => {}, unregister: () => {} }
1875
- : new FinalizationRegistry(ptr => wasm.__wbg_pubkyapppostembed_free(ptr >>> 0, 1));
1876
1224
  /**
1877
1225
  * Represents embedded content within a post
1878
1226
  */
1879
1227
  class PubkyAppPostEmbed {
1880
-
1881
1228
  static __wrap(ptr) {
1882
1229
  ptr = ptr >>> 0;
1883
1230
  const obj = Object.create(PubkyAppPostEmbed.prototype);
@@ -1885,30 +1232,16 @@ class PubkyAppPostEmbed {
1885
1232
  PubkyAppPostEmbedFinalization.register(obj, obj.__wbg_ptr, obj);
1886
1233
  return obj;
1887
1234
  }
1888
-
1889
1235
  __destroy_into_raw() {
1890
1236
  const ptr = this.__wbg_ptr;
1891
1237
  this.__wbg_ptr = 0;
1892
1238
  PubkyAppPostEmbedFinalization.unregister(this);
1893
1239
  return ptr;
1894
1240
  }
1895
-
1896
1241
  free() {
1897
1242
  const ptr = this.__destroy_into_raw();
1898
1243
  wasm.__wbg_pubkyapppostembed_free(ptr, 0);
1899
1244
  }
1900
- /**
1901
- * @param {string} uri
1902
- * @param {PubkyAppPostKind} kind
1903
- */
1904
- constructor(uri, kind) {
1905
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1906
- const len0 = WASM_VECTOR_LEN;
1907
- const ret = wasm.pubkyapppostembed_new(ptr0, len0, kind);
1908
- this.__wbg_ptr = ret >>> 0;
1909
- PubkyAppPostEmbedFinalization.register(this, this.__wbg_ptr, this);
1910
- return this;
1911
- }
1912
1245
  /**
1913
1246
  * @returns {string}
1914
1247
  */
@@ -1924,6 +1257,18 @@ class PubkyAppPostEmbed {
1924
1257
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1925
1258
  }
1926
1259
  }
1260
+ /**
1261
+ * @param {string} uri
1262
+ * @param {PubkyAppPostKind} kind
1263
+ */
1264
+ constructor(uri, kind) {
1265
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1266
+ const len0 = WASM_VECTOR_LEN;
1267
+ const ret = wasm.pubkyapppostembed_new(ptr0, len0, kind);
1268
+ this.__wbg_ptr = ret >>> 0;
1269
+ PubkyAppPostEmbedFinalization.register(this, this.__wbg_ptr, this);
1270
+ return this;
1271
+ }
1927
1272
  /**
1928
1273
  * @returns {string}
1929
1274
  */
@@ -1940,11 +1285,26 @@ class PubkyAppPostEmbed {
1940
1285
  }
1941
1286
  }
1942
1287
  }
1943
- module.exports.PubkyAppPostEmbed = PubkyAppPostEmbed;
1288
+ if (Symbol.dispose) PubkyAppPostEmbed.prototype[Symbol.dispose] = PubkyAppPostEmbed.prototype.free;
1289
+ exports.PubkyAppPostEmbed = PubkyAppPostEmbed;
1290
+
1291
+ /**
1292
+ * Represents the type of pubky-app posted data
1293
+ * Used primarily to best display the content in UI
1294
+ * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7}
1295
+ */
1296
+ const PubkyAppPostKind = Object.freeze({
1297
+ Short: 0, "0": "Short",
1298
+ Long: 1, "1": "Long",
1299
+ Image: 2, "2": "Image",
1300
+ Video: 3, "3": "Video",
1301
+ Link: 4, "4": "Link",
1302
+ File: 5, "5": "File",
1303
+ Collection: 6, "6": "Collection",
1304
+ Unknown: 7, "7": "Unknown",
1305
+ });
1306
+ exports.PubkyAppPostKind = PubkyAppPostKind;
1944
1307
 
1945
- const PubkyAppTagFinalization = (typeof FinalizationRegistry === 'undefined')
1946
- ? { register: () => {}, unregister: () => {} }
1947
- : new FinalizationRegistry(ptr => wasm.__wbg_pubkyapptag_free(ptr >>> 0, 1));
1948
1308
  /**
1949
1309
  * Represents raw homeserver tag with id
1950
1310
  * URI: /pub/pubky.app/tags/:tag_id
@@ -1956,7 +1316,6 @@ const PubkyAppTagFinalization = (typeof FinalizationRegistry === 'undefined')
1956
1316
  * Where tag_id is Crockford-base32(Blake3("{uri_tagged}:{label}")[:half])
1957
1317
  */
1958
1318
  class PubkyAppTag {
1959
-
1960
1319
  static __wrap(ptr) {
1961
1320
  ptr = ptr >>> 0;
1962
1321
  const obj = Object.create(PubkyAppTag.prototype);
@@ -1964,14 +1323,12 @@ class PubkyAppTag {
1964
1323
  PubkyAppTagFinalization.register(obj, obj.__wbg_ptr, obj);
1965
1324
  return obj;
1966
1325
  }
1967
-
1968
1326
  __destroy_into_raw() {
1969
1327
  const ptr = this.__wbg_ptr;
1970
1328
  this.__wbg_ptr = 0;
1971
1329
  PubkyAppTagFinalization.unregister(this);
1972
1330
  return ptr;
1973
1331
  }
1974
-
1975
1332
  free() {
1976
1333
  const ptr = this.__destroy_into_raw();
1977
1334
  wasm.__wbg_pubkyapptag_free(ptr, 0);
@@ -1980,15 +1337,9 @@ class PubkyAppTag {
1980
1337
  * @returns {bigint}
1981
1338
  */
1982
1339
  get created_at() {
1983
- const ret = wasm.__wbg_get_pubkyappbookmark_created_at(this.__wbg_ptr);
1340
+ const ret = wasm.__wbg_get_pubkyapptag_created_at(this.__wbg_ptr);
1984
1341
  return ret;
1985
1342
  }
1986
- /**
1987
- * @param {bigint} arg0
1988
- */
1989
- set created_at(arg0) {
1990
- wasm.__wbg_set_pubkyappbookmark_created_at(this.__wbg_ptr, arg0);
1991
- }
1992
1343
  /**
1993
1344
  * @param {any} js_value
1994
1345
  * @returns {PubkyAppTag}
@@ -2000,6 +1351,22 @@ class PubkyAppTag {
2000
1351
  }
2001
1352
  return PubkyAppTag.__wrap(ret[0]);
2002
1353
  }
1354
+ /**
1355
+ * Getter for `label`.
1356
+ * @returns {string}
1357
+ */
1358
+ get label() {
1359
+ let deferred1_0;
1360
+ let deferred1_1;
1361
+ try {
1362
+ const ret = wasm.pubkyapptag_label(this.__wbg_ptr);
1363
+ deferred1_0 = ret[0];
1364
+ deferred1_1 = ret[1];
1365
+ return getStringFromWasm0(ret[0], ret[1]);
1366
+ } finally {
1367
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1368
+ }
1369
+ }
2003
1370
  /**
2004
1371
  * Serialize to JSON for WASM.
2005
1372
  * @returns {any}
@@ -2028,32 +1395,19 @@ class PubkyAppTag {
2028
1395
  }
2029
1396
  }
2030
1397
  /**
2031
- * Getter for `label`.
2032
- * @returns {string}
1398
+ * @param {bigint} arg0
2033
1399
  */
2034
- get label() {
2035
- let deferred1_0;
2036
- let deferred1_1;
2037
- try {
2038
- const ret = wasm.pubkyapptag_label(this.__wbg_ptr);
2039
- deferred1_0 = ret[0];
2040
- deferred1_1 = ret[1];
2041
- return getStringFromWasm0(ret[0], ret[1]);
2042
- } finally {
2043
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2044
- }
1400
+ set created_at(arg0) {
1401
+ wasm.__wbg_set_pubkyapptag_created_at(this.__wbg_ptr, arg0);
2045
1402
  }
2046
1403
  }
2047
- module.exports.PubkyAppTag = PubkyAppTag;
1404
+ if (Symbol.dispose) PubkyAppTag.prototype[Symbol.dispose] = PubkyAppTag.prototype.free;
1405
+ exports.PubkyAppTag = PubkyAppTag;
2048
1406
 
2049
- const PubkyAppUserFinalization = (typeof FinalizationRegistry === 'undefined')
2050
- ? { register: () => {}, unregister: () => {} }
2051
- : new FinalizationRegistry(ptr => wasm.__wbg_pubkyappuser_free(ptr >>> 0, 1));
2052
1407
  /**
2053
1408
  * URI: /pub/pubky.app/profile.json
2054
1409
  */
2055
1410
  class PubkyAppUser {
2056
-
2057
1411
  static __wrap(ptr) {
2058
1412
  ptr = ptr >>> 0;
2059
1413
  const obj = Object.create(PubkyAppUser.prototype);
@@ -2061,33 +1415,16 @@ class PubkyAppUser {
2061
1415
  PubkyAppUserFinalization.register(obj, obj.__wbg_ptr, obj);
2062
1416
  return obj;
2063
1417
  }
2064
-
2065
1418
  __destroy_into_raw() {
2066
1419
  const ptr = this.__wbg_ptr;
2067
1420
  this.__wbg_ptr = 0;
2068
1421
  PubkyAppUserFinalization.unregister(this);
2069
1422
  return ptr;
2070
1423
  }
2071
-
2072
1424
  free() {
2073
1425
  const ptr = this.__destroy_into_raw();
2074
1426
  wasm.__wbg_pubkyappuser_free(ptr, 0);
2075
1427
  }
2076
- /**
2077
- * @returns {string}
2078
- */
2079
- get name() {
2080
- let deferred1_0;
2081
- let deferred1_1;
2082
- try {
2083
- const ret = wasm.pubkyappuser_name(this.__wbg_ptr);
2084
- deferred1_0 = ret[0];
2085
- deferred1_1 = ret[1];
2086
- return getStringFromWasm0(ret[0], ret[1]);
2087
- } finally {
2088
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2089
- }
2090
- }
2091
1428
  /**
2092
1429
  * @returns {string | undefined}
2093
1430
  */
@@ -2100,6 +1437,17 @@ class PubkyAppUser {
2100
1437
  }
2101
1438
  return v1;
2102
1439
  }
1440
+ /**
1441
+ * @param {any} js_value
1442
+ * @returns {PubkyAppUser}
1443
+ */
1444
+ static fromJson(js_value) {
1445
+ const ret = wasm.pubkyappuser_fromJson(js_value);
1446
+ if (ret[2]) {
1447
+ throw takeFromExternrefTable0(ret[1]);
1448
+ }
1449
+ return PubkyAppUser.__wrap(ret[0]);
1450
+ }
2103
1451
  /**
2104
1452
  * @returns {string | undefined}
2105
1453
  */
@@ -2125,37 +1473,19 @@ class PubkyAppUser {
2125
1473
  return v1;
2126
1474
  }
2127
1475
  /**
2128
- * @returns {string | undefined}
2129
- */
2130
- get status() {
2131
- const ret = wasm.pubkyappuser_status(this.__wbg_ptr);
2132
- let v1;
2133
- if (ret[0] !== 0) {
2134
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
2135
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2136
- }
2137
- return v1;
2138
- }
2139
- /**
2140
- * @param {any} js_value
2141
- * @returns {PubkyAppUser}
2142
- */
2143
- static fromJson(js_value) {
2144
- const ret = wasm.pubkyappuser_fromJson(js_value);
2145
- if (ret[2]) {
2146
- throw takeFromExternrefTable0(ret[1]);
2147
- }
2148
- return PubkyAppUser.__wrap(ret[0]);
2149
- }
2150
- /**
2151
- * @returns {any}
1476
+ * @returns {string}
2152
1477
  */
2153
- toJson() {
2154
- const ret = wasm.pubkyappuser_toJson(this.__wbg_ptr);
2155
- if (ret[2]) {
2156
- throw takeFromExternrefTable0(ret[1]);
1478
+ get name() {
1479
+ let deferred1_0;
1480
+ let deferred1_1;
1481
+ try {
1482
+ const ret = wasm.pubkyappuser_name(this.__wbg_ptr);
1483
+ deferred1_0 = ret[0];
1484
+ deferred1_1 = ret[1];
1485
+ return getStringFromWasm0(ret[0], ret[1]);
1486
+ } finally {
1487
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2157
1488
  }
2158
- return takeFromExternrefTable0(ret[0]);
2159
1489
  }
2160
1490
  /**
2161
1491
  * Creates a new `PubkyAppUser` instance and sanitizes it.
@@ -2181,17 +1511,36 @@ class PubkyAppUser {
2181
1511
  PubkyAppUserFinalization.register(this, this.__wbg_ptr, this);
2182
1512
  return this;
2183
1513
  }
1514
+ /**
1515
+ * @returns {string | undefined}
1516
+ */
1517
+ get status() {
1518
+ const ret = wasm.pubkyappuser_status(this.__wbg_ptr);
1519
+ let v1;
1520
+ if (ret[0] !== 0) {
1521
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1522
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1523
+ }
1524
+ return v1;
1525
+ }
1526
+ /**
1527
+ * @returns {any}
1528
+ */
1529
+ toJson() {
1530
+ const ret = wasm.pubkyappuser_toJson(this.__wbg_ptr);
1531
+ if (ret[2]) {
1532
+ throw takeFromExternrefTable0(ret[1]);
1533
+ }
1534
+ return takeFromExternrefTable0(ret[0]);
1535
+ }
2184
1536
  }
2185
- module.exports.PubkyAppUser = PubkyAppUser;
1537
+ if (Symbol.dispose) PubkyAppUser.prototype[Symbol.dispose] = PubkyAppUser.prototype.free;
1538
+ exports.PubkyAppUser = PubkyAppUser;
2186
1539
 
2187
- const PubkyAppUserLinkFinalization = (typeof FinalizationRegistry === 'undefined')
2188
- ? { register: () => {}, unregister: () => {} }
2189
- : new FinalizationRegistry(ptr => wasm.__wbg_pubkyappuserlink_free(ptr >>> 0, 1));
2190
1540
  /**
2191
1541
  * Represents a user's single link with a title and URL.
2192
1542
  */
2193
1543
  class PubkyAppUserLink {
2194
-
2195
1544
  static __wrap(ptr) {
2196
1545
  ptr = ptr >>> 0;
2197
1546
  const obj = Object.create(PubkyAppUserLink.prototype);
@@ -2199,25 +1548,37 @@ class PubkyAppUserLink {
2199
1548
  PubkyAppUserLinkFinalization.register(obj, obj.__wbg_ptr, obj);
2200
1549
  return obj;
2201
1550
  }
2202
-
2203
1551
  static __unwrap(jsValue) {
2204
1552
  if (!(jsValue instanceof PubkyAppUserLink)) {
2205
1553
  return 0;
2206
1554
  }
2207
1555
  return jsValue.__destroy_into_raw();
2208
1556
  }
2209
-
2210
1557
  __destroy_into_raw() {
2211
1558
  const ptr = this.__wbg_ptr;
2212
1559
  this.__wbg_ptr = 0;
2213
1560
  PubkyAppUserLinkFinalization.unregister(this);
2214
1561
  return ptr;
2215
1562
  }
2216
-
2217
1563
  free() {
2218
1564
  const ptr = this.__destroy_into_raw();
2219
1565
  wasm.__wbg_pubkyappuserlink_free(ptr, 0);
2220
1566
  }
1567
+ /**
1568
+ * Creates a new `PubkyAppUserLink` instance and sanitizes it.
1569
+ * @param {string} title
1570
+ * @param {string} url
1571
+ */
1572
+ constructor(title, url) {
1573
+ const ptr0 = passStringToWasm0(title, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1574
+ const len0 = WASM_VECTOR_LEN;
1575
+ const ptr1 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1576
+ const len1 = WASM_VECTOR_LEN;
1577
+ const ret = wasm.pubkyappuserlink_new(ptr0, len0, ptr1, len1);
1578
+ this.__wbg_ptr = ret >>> 0;
1579
+ PubkyAppUserLinkFinalization.register(this, this.__wbg_ptr, this);
1580
+ return this;
1581
+ }
2221
1582
  /**
2222
1583
  * @returns {string}
2223
1584
  */
@@ -2248,113 +1609,94 @@ class PubkyAppUserLink {
2248
1609
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2249
1610
  }
2250
1611
  }
2251
- /**
2252
- * Creates a new `PubkyAppUserLink` instance and sanitizes it.
2253
- * @param {string} title
2254
- * @param {string} url
2255
- */
2256
- constructor(title, url) {
2257
- const ptr0 = passStringToWasm0(title, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2258
- const len0 = WASM_VECTOR_LEN;
2259
- const ptr1 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2260
- const len1 = WASM_VECTOR_LEN;
2261
- const ret = wasm.pubkyappuserlink_new(ptr0, len0, ptr1, len1);
2262
- this.__wbg_ptr = ret >>> 0;
2263
- PubkyAppUserLinkFinalization.register(this, this.__wbg_ptr, this);
2264
- return this;
2265
- }
2266
1612
  }
2267
- module.exports.PubkyAppUserLink = PubkyAppUserLink;
1613
+ if (Symbol.dispose) PubkyAppUserLink.prototype[Symbol.dispose] = PubkyAppUserLink.prototype.free;
1614
+ exports.PubkyAppUserLink = PubkyAppUserLink;
2268
1615
 
2269
- const PubkyIdFinalization = (typeof FinalizationRegistry === 'undefined')
2270
- ? { register: () => {}, unregister: () => {} }
2271
- : new FinalizationRegistry(ptr => wasm.__wbg_pubkyid_free(ptr >>> 0, 1));
2272
1616
  /**
2273
1617
  * Represents user data with name, bio, image, links, and status.
2274
1618
  */
2275
1619
  class PubkyId {
2276
-
2277
1620
  __destroy_into_raw() {
2278
1621
  const ptr = this.__wbg_ptr;
2279
1622
  this.__wbg_ptr = 0;
2280
1623
  PubkyIdFinalization.unregister(this);
2281
1624
  return ptr;
2282
1625
  }
2283
-
2284
1626
  free() {
2285
1627
  const ptr = this.__destroy_into_raw();
2286
1628
  wasm.__wbg_pubkyid_free(ptr, 0);
2287
1629
  }
2288
1630
  }
2289
- module.exports.PubkyId = PubkyId;
1631
+ if (Symbol.dispose) PubkyId.prototype[Symbol.dispose] = PubkyId.prototype.free;
1632
+ exports.PubkyId = PubkyId;
2290
1633
 
2291
- const PubkySpecsBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
2292
- ? { register: () => {}, unregister: () => {} }
2293
- : new FinalizationRegistry(ptr => wasm.__wbg_pubkyspecsbuilder_free(ptr >>> 0, 1));
2294
1634
  /**
2295
1635
  * Represents a user's single link with a title and URL.
2296
1636
  */
2297
1637
  class PubkySpecsBuilder {
2298
-
2299
1638
  __destroy_into_raw() {
2300
1639
  const ptr = this.__wbg_ptr;
2301
1640
  this.__wbg_ptr = 0;
2302
1641
  PubkySpecsBuilderFinalization.unregister(this);
2303
1642
  return ptr;
2304
1643
  }
2305
-
2306
1644
  free() {
2307
1645
  const ptr = this.__destroy_into_raw();
2308
1646
  wasm.__wbg_pubkyspecsbuilder_free(ptr, 0);
2309
1647
  }
2310
1648
  /**
2311
- * Creates a new `PubkyAppBuilder` instance.
2312
- * @param {string} pubky_id
1649
+ * @param {any} blob_data
1650
+ * @returns {BlobResult}
2313
1651
  */
2314
- constructor(pubky_id) {
2315
- const ptr0 = passStringToWasm0(pubky_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2316
- const len0 = WASM_VECTOR_LEN;
2317
- const ret = wasm.pubkyspecsbuilder_new(ptr0, len0);
1652
+ createBlob(blob_data) {
1653
+ const ret = wasm.pubkyspecsbuilder_createBlob(this.__wbg_ptr, blob_data);
2318
1654
  if (ret[2]) {
2319
1655
  throw takeFromExternrefTable0(ret[1]);
2320
1656
  }
2321
- this.__wbg_ptr = ret[0] >>> 0;
2322
- PubkySpecsBuilderFinalization.register(this, this.__wbg_ptr, this);
2323
- return this;
1657
+ return BlobResult.__wrap(ret[0]);
2324
1658
  }
2325
1659
  /**
2326
- * Returns validation limits as a JSON value for client-side use.
2327
- * @returns {any}
1660
+ * @param {string} uri
1661
+ * @returns {BookmarkResult}
2328
1662
  */
2329
- get validationLimits() {
2330
- const ret = wasm.pubkyspecsbuilder_validationLimits(this.__wbg_ptr);
1663
+ createBookmark(uri) {
1664
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1665
+ const len0 = WASM_VECTOR_LEN;
1666
+ const ret = wasm.pubkyspecsbuilder_createBookmark(this.__wbg_ptr, ptr0, len0);
2331
1667
  if (ret[2]) {
2332
1668
  throw takeFromExternrefTable0(ret[1]);
2333
1669
  }
2334
- return takeFromExternrefTable0(ret[0]);
1670
+ return BookmarkResult.__wrap(ret[0]);
2335
1671
  }
2336
1672
  /**
1673
+ * Creates a `kind = Collection` post — a curated list of URIs under
1674
+ * a name and optional description.
1675
+ *
1676
+ * Convenience wrapper around `createPost` that builds the
1677
+ * `PubkyAppCollectionContent` envelope (`{ name, description, items }`) and
1678
+ * JSON-serializes it into `content` internally, so JS callers don't
1679
+ * have to stringify the envelope themselves.
1680
+ *
1681
+ * `parent` and `embed` are not supported for Collection posts — the
1682
+ * validator rejects them — so this helper omits those arguments.
2337
1683
  * @param {string} name
2338
- * @param {string | null | undefined} bio
2339
- * @param {string | null | undefined} image
2340
- * @param {any} links
2341
- * @param {string | null} [status]
2342
- * @returns {UserResult}
1684
+ * @param {string | null} [description]
1685
+ * @param {string[] | null} [items]
1686
+ * @returns {PostResult}
2343
1687
  */
2344
- createUser(name, bio, image, links, status) {
1688
+ createCollectionPost(name, description, items) {
2345
1689
  const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2346
1690
  const len0 = WASM_VECTOR_LEN;
2347
- var ptr1 = isLikeNone(bio) ? 0 : passStringToWasm0(bio, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1691
+ var ptr1 = isLikeNone(description) ? 0 : passStringToWasm0(description, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2348
1692
  var len1 = WASM_VECTOR_LEN;
2349
- var ptr2 = isLikeNone(image) ? 0 : passStringToWasm0(image, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1693
+ var ptr2 = isLikeNone(items) ? 0 : passArrayJsValueToWasm0(items, wasm.__wbindgen_malloc);
2350
1694
  var len2 = WASM_VECTOR_LEN;
2351
- var ptr3 = isLikeNone(status) ? 0 : passStringToWasm0(status, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2352
- var len3 = WASM_VECTOR_LEN;
2353
- const ret = wasm.pubkyspecsbuilder_createUser(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, links, ptr3, len3);
1695
+ const ret = wasm.pubkyspecsbuilder_createCollectionPost(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
2354
1696
  if (ret[2]) {
2355
1697
  throw takeFromExternrefTable0(ret[1]);
2356
1698
  }
2357
- return UserResult.__wrap(ret[0]);
1699
+ return PostResult.__wrap(ret[0]);
2358
1700
  }
2359
1701
  /**
2360
1702
  * @param {any} tags
@@ -2402,6 +1744,42 @@ class PubkySpecsBuilder {
2402
1744
  }
2403
1745
  return FileResult.__wrap(ret[0]);
2404
1746
  }
1747
+ /**
1748
+ * @param {string} followee_id
1749
+ * @returns {FollowResult}
1750
+ */
1751
+ createFollow(followee_id) {
1752
+ const ptr0 = passStringToWasm0(followee_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1753
+ const len0 = WASM_VECTOR_LEN;
1754
+ const ret = wasm.pubkyspecsbuilder_createFollow(this.__wbg_ptr, ptr0, len0);
1755
+ if (ret[2]) {
1756
+ throw takeFromExternrefTable0(ret[1]);
1757
+ }
1758
+ return FollowResult.__wrap(ret[0]);
1759
+ }
1760
+ /**
1761
+ * @returns {LastReadResult}
1762
+ */
1763
+ createLastRead() {
1764
+ const ret = wasm.pubkyspecsbuilder_createLastRead(this.__wbg_ptr);
1765
+ if (ret[2]) {
1766
+ throw takeFromExternrefTable0(ret[1]);
1767
+ }
1768
+ return LastReadResult.__wrap(ret[0]);
1769
+ }
1770
+ /**
1771
+ * @param {string} mutee_id
1772
+ * @returns {MuteResult}
1773
+ */
1774
+ createMute(mutee_id) {
1775
+ const ptr0 = passStringToWasm0(mutee_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1776
+ const len0 = WASM_VECTOR_LEN;
1777
+ const ret = wasm.pubkyspecsbuilder_createMute(this.__wbg_ptr, ptr0, len0);
1778
+ if (ret[2]) {
1779
+ throw takeFromExternrefTable0(ret[1]);
1780
+ }
1781
+ return MuteResult.__wrap(ret[0]);
1782
+ }
2405
1783
  /**
2406
1784
  * @param {string} content
2407
1785
  * @param {PubkyAppPostKind} kind
@@ -2428,6 +1806,45 @@ class PubkySpecsBuilder {
2428
1806
  }
2429
1807
  return PostResult.__wrap(ret[0]);
2430
1808
  }
1809
+ /**
1810
+ * @param {string} uri
1811
+ * @param {string} label
1812
+ * @returns {TagResult}
1813
+ */
1814
+ createTag(uri, label) {
1815
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1816
+ const len0 = WASM_VECTOR_LEN;
1817
+ const ptr1 = passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1818
+ const len1 = WASM_VECTOR_LEN;
1819
+ const ret = wasm.pubkyspecsbuilder_createTag(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1820
+ if (ret[2]) {
1821
+ throw takeFromExternrefTable0(ret[1]);
1822
+ }
1823
+ return TagResult.__wrap(ret[0]);
1824
+ }
1825
+ /**
1826
+ * @param {string} name
1827
+ * @param {string | null | undefined} bio
1828
+ * @param {string | null | undefined} image
1829
+ * @param {any} links
1830
+ * @param {string | null} [status]
1831
+ * @returns {UserResult}
1832
+ */
1833
+ createUser(name, bio, image, links, status) {
1834
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1835
+ const len0 = WASM_VECTOR_LEN;
1836
+ var ptr1 = isLikeNone(bio) ? 0 : passStringToWasm0(bio, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1837
+ var len1 = WASM_VECTOR_LEN;
1838
+ var ptr2 = isLikeNone(image) ? 0 : passStringToWasm0(image, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1839
+ var len2 = WASM_VECTOR_LEN;
1840
+ var ptr3 = isLikeNone(status) ? 0 : passStringToWasm0(status, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1841
+ var len3 = WASM_VECTOR_LEN;
1842
+ const ret = wasm.pubkyspecsbuilder_createUser(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, links, ptr3, len3);
1843
+ if (ret[2]) {
1844
+ throw takeFromExternrefTable0(ret[1]);
1845
+ }
1846
+ return UserResult.__wrap(ret[0]);
1847
+ }
2431
1848
  /**
2432
1849
  * Edits an existing post by updating its content while preserving its original ID and timestamp.
2433
1850
  * @param {PubkyAppPost} original_post
@@ -2449,465 +1866,986 @@ class PubkySpecsBuilder {
2449
1866
  return PostResult.__wrap(ret[0]);
2450
1867
  }
2451
1868
  /**
2452
- * @param {string} uri
2453
- * @param {string} label
2454
- * @returns {TagResult}
1869
+ * Creates a new `PubkyAppBuilder` instance.
1870
+ * @param {string} pubky_id
2455
1871
  */
2456
- createTag(uri, label) {
2457
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1872
+ constructor(pubky_id) {
1873
+ const ptr0 = passStringToWasm0(pubky_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2458
1874
  const len0 = WASM_VECTOR_LEN;
2459
- const ptr1 = passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2460
- const len1 = WASM_VECTOR_LEN;
2461
- const ret = wasm.pubkyspecsbuilder_createTag(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1875
+ const ret = wasm.pubkyspecsbuilder_new(ptr0, len0);
2462
1876
  if (ret[2]) {
2463
1877
  throw takeFromExternrefTable0(ret[1]);
2464
1878
  }
2465
- return TagResult.__wrap(ret[0]);
1879
+ this.__wbg_ptr = ret[0] >>> 0;
1880
+ PubkySpecsBuilderFinalization.register(this, this.__wbg_ptr, this);
1881
+ return this;
1882
+ }
1883
+ /**
1884
+ * Returns validation limits as a JSON value for client-side use.
1885
+ * @returns {any}
1886
+ */
1887
+ get validationLimits() {
1888
+ const ret = wasm.pubkyspecsbuilder_validationLimits(this.__wbg_ptr);
1889
+ if (ret[2]) {
1890
+ throw takeFromExternrefTable0(ret[1]);
1891
+ }
1892
+ return takeFromExternrefTable0(ret[0]);
1893
+ }
1894
+ }
1895
+ if (Symbol.dispose) PubkySpecsBuilder.prototype[Symbol.dispose] = PubkySpecsBuilder.prototype.free;
1896
+ exports.PubkySpecsBuilder = PubkySpecsBuilder;
1897
+
1898
+ class TagResult {
1899
+ static __wrap(ptr) {
1900
+ ptr = ptr >>> 0;
1901
+ const obj = Object.create(TagResult.prototype);
1902
+ obj.__wbg_ptr = ptr;
1903
+ TagResultFinalization.register(obj, obj.__wbg_ptr, obj);
1904
+ return obj;
1905
+ }
1906
+ __destroy_into_raw() {
1907
+ const ptr = this.__wbg_ptr;
1908
+ this.__wbg_ptr = 0;
1909
+ TagResultFinalization.unregister(this);
1910
+ return ptr;
1911
+ }
1912
+ free() {
1913
+ const ptr = this.__destroy_into_raw();
1914
+ wasm.__wbg_tagresult_free(ptr, 0);
1915
+ }
1916
+ /**
1917
+ * @returns {Meta}
1918
+ */
1919
+ get meta() {
1920
+ const ret = wasm.tagresult_meta(this.__wbg_ptr);
1921
+ return Meta.__wrap(ret);
1922
+ }
1923
+ /**
1924
+ * @returns {PubkyAppTag}
1925
+ */
1926
+ get tag() {
1927
+ const ret = wasm.tagresult_tag(this.__wbg_ptr);
1928
+ return PubkyAppTag.__wrap(ret);
1929
+ }
1930
+ }
1931
+ if (Symbol.dispose) TagResult.prototype[Symbol.dispose] = TagResult.prototype.free;
1932
+ exports.TagResult = TagResult;
1933
+
1934
+ class UserResult {
1935
+ static __wrap(ptr) {
1936
+ ptr = ptr >>> 0;
1937
+ const obj = Object.create(UserResult.prototype);
1938
+ obj.__wbg_ptr = ptr;
1939
+ UserResultFinalization.register(obj, obj.__wbg_ptr, obj);
1940
+ return obj;
1941
+ }
1942
+ __destroy_into_raw() {
1943
+ const ptr = this.__wbg_ptr;
1944
+ this.__wbg_ptr = 0;
1945
+ UserResultFinalization.unregister(this);
1946
+ return ptr;
1947
+ }
1948
+ free() {
1949
+ const ptr = this.__destroy_into_raw();
1950
+ wasm.__wbg_userresult_free(ptr, 0);
1951
+ }
1952
+ /**
1953
+ * @returns {Meta}
1954
+ */
1955
+ get meta() {
1956
+ const ret = wasm.userresult_meta(this.__wbg_ptr);
1957
+ return Meta.__wrap(ret);
1958
+ }
1959
+ /**
1960
+ * @returns {PubkyAppUser}
1961
+ */
1962
+ get user() {
1963
+ const ret = wasm.userresult_user(this.__wbg_ptr);
1964
+ return PubkyAppUser.__wrap(ret);
1965
+ }
1966
+ }
1967
+ if (Symbol.dispose) UserResult.prototype[Symbol.dispose] = UserResult.prototype.free;
1968
+ exports.UserResult = UserResult;
1969
+
1970
+ /**
1971
+ * @param {string} user_id
1972
+ * @returns {string}
1973
+ */
1974
+ function baseUriBuilder(user_id) {
1975
+ let deferred2_0;
1976
+ let deferred2_1;
1977
+ try {
1978
+ const ptr0 = passStringToWasm0(user_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1979
+ const len0 = WASM_VECTOR_LEN;
1980
+ const ret = wasm.baseUriBuilder(ptr0, len0);
1981
+ deferred2_0 = ret[0];
1982
+ deferred2_1 = ret[1];
1983
+ return getStringFromWasm0(ret[0], ret[1]);
1984
+ } finally {
1985
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1986
+ }
1987
+ }
1988
+ exports.baseUriBuilder = baseUriBuilder;
1989
+
1990
+ /**
1991
+ * Builds a Blob URI of the form "pubky://<author_id>/pub/pubky.app/blobs/<blob_id>"
1992
+ * @param {string} author_id
1993
+ * @param {string} blob_id
1994
+ * @returns {string}
1995
+ */
1996
+ function blobUriBuilder(author_id, blob_id) {
1997
+ let deferred3_0;
1998
+ let deferred3_1;
1999
+ try {
2000
+ const ptr0 = passStringToWasm0(author_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2001
+ const len0 = WASM_VECTOR_LEN;
2002
+ const ptr1 = passStringToWasm0(blob_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2003
+ const len1 = WASM_VECTOR_LEN;
2004
+ const ret = wasm.blobUriBuilder(ptr0, len0, ptr1, len1);
2005
+ deferred3_0 = ret[0];
2006
+ deferred3_1 = ret[1];
2007
+ return getStringFromWasm0(ret[0], ret[1]);
2008
+ } finally {
2009
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
2010
+ }
2011
+ }
2012
+ exports.blobUriBuilder = blobUriBuilder;
2013
+
2014
+ /**
2015
+ * Builds a Bookmark URI of the form "pubky://<author_id>/pub/pubky.app/bookmarks/<bookmark_id>"
2016
+ * @param {string} author_id
2017
+ * @param {string} bookmark_id
2018
+ * @returns {string}
2019
+ */
2020
+ function bookmarkUriBuilder(author_id, bookmark_id) {
2021
+ let deferred3_0;
2022
+ let deferred3_1;
2023
+ try {
2024
+ const ptr0 = passStringToWasm0(author_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2025
+ const len0 = WASM_VECTOR_LEN;
2026
+ const ptr1 = passStringToWasm0(bookmark_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2027
+ const len1 = WASM_VECTOR_LEN;
2028
+ const ret = wasm.bookmarkUriBuilder(ptr0, len0, ptr1, len1);
2029
+ deferred3_0 = ret[0];
2030
+ deferred3_1 = ret[1];
2031
+ return getStringFromWasm0(ret[0], ret[1]);
2032
+ } finally {
2033
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
2034
+ }
2035
+ }
2036
+ exports.bookmarkUriBuilder = bookmarkUriBuilder;
2037
+
2038
+ /**
2039
+ * Builds a Feed URI of the form "pubky://<author_id>/pub/pubky.app/feeds/<feed_id>"
2040
+ * @param {string} author_id
2041
+ * @param {string} feed_id
2042
+ * @returns {string}
2043
+ */
2044
+ function feedUriBuilder(author_id, feed_id) {
2045
+ let deferred3_0;
2046
+ let deferred3_1;
2047
+ try {
2048
+ const ptr0 = passStringToWasm0(author_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2049
+ const len0 = WASM_VECTOR_LEN;
2050
+ const ptr1 = passStringToWasm0(feed_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2051
+ const len1 = WASM_VECTOR_LEN;
2052
+ const ret = wasm.feedUriBuilder(ptr0, len0, ptr1, len1);
2053
+ deferred3_0 = ret[0];
2054
+ deferred3_1 = ret[1];
2055
+ return getStringFromWasm0(ret[0], ret[1]);
2056
+ } finally {
2057
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
2058
+ }
2059
+ }
2060
+ exports.feedUriBuilder = feedUriBuilder;
2061
+
2062
+ /**
2063
+ * Builds a File URI of the form "pubky://<author_id>/pub/pubky.app/files/<file_id>"
2064
+ * @param {string} author_id
2065
+ * @param {string} file_id
2066
+ * @returns {string}
2067
+ */
2068
+ function fileUriBuilder(author_id, file_id) {
2069
+ let deferred3_0;
2070
+ let deferred3_1;
2071
+ try {
2072
+ const ptr0 = passStringToWasm0(author_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2073
+ const len0 = WASM_VECTOR_LEN;
2074
+ const ptr1 = passStringToWasm0(file_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2075
+ const len1 = WASM_VECTOR_LEN;
2076
+ const ret = wasm.fileUriBuilder(ptr0, len0, ptr1, len1);
2077
+ deferred3_0 = ret[0];
2078
+ deferred3_1 = ret[1];
2079
+ return getStringFromWasm0(ret[0], ret[1]);
2080
+ } finally {
2081
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
2082
+ }
2083
+ }
2084
+ exports.fileUriBuilder = fileUriBuilder;
2085
+
2086
+ /**
2087
+ * Builds a Follow URI of the form "pubky://<author_id>/pub/pubky.app/follows/<follow_id>"
2088
+ * @param {string} author_id
2089
+ * @param {string} follow_id
2090
+ * @returns {string}
2091
+ */
2092
+ function followUriBuilder(author_id, follow_id) {
2093
+ let deferred3_0;
2094
+ let deferred3_1;
2095
+ try {
2096
+ const ptr0 = passStringToWasm0(author_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2097
+ const len0 = WASM_VECTOR_LEN;
2098
+ const ptr1 = passStringToWasm0(follow_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2099
+ const len1 = WASM_VECTOR_LEN;
2100
+ const ret = wasm.followUriBuilder(ptr0, len0, ptr1, len1);
2101
+ deferred3_0 = ret[0];
2102
+ deferred3_1 = ret[1];
2103
+ return getStringFromWasm0(ret[0], ret[1]);
2104
+ } finally {
2105
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
2106
+ }
2107
+ }
2108
+ exports.followUriBuilder = followUriBuilder;
2109
+
2110
+ /**
2111
+ * Returns the list of valid MIME types for file attachments.
2112
+ *
2113
+ * This allows JavaScript consumers to validate file types before submission
2114
+ * without having to duplicate the list.
2115
+ *
2116
+ * # Example (TypeScript)
2117
+ *
2118
+ * ```typescript
2119
+ * import { get_valid_mime_types } from "pubky-app-specs";
2120
+ *
2121
+ * const validTypes = get_valid_mime_types();
2122
+ * const fileType = "image/png";
2123
+ * if (validTypes.includes(fileType)) {
2124
+ * console.log("Valid file type!");
2125
+ * }
2126
+ * ```
2127
+ * @returns {any[]}
2128
+ */
2129
+ function getValidMimeTypes() {
2130
+ const ret = wasm.getValidMimeTypes();
2131
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
2132
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2133
+ return v1;
2134
+ }
2135
+ exports.getValidMimeTypes = getValidMimeTypes;
2136
+
2137
+ /**
2138
+ * Each FFI function:
2139
+ * - Accepts minimal fields in a JavaScript-friendly manner (e.g. strings, JSON).
2140
+ * - Creates the Rust model, sanitizes, and validates it.
2141
+ * - Generates the ID (if applicable).
2142
+ * - Generates the path (if applicable).
2143
+ * - Returns { json, id, path, url } or a descriptive error.
2144
+ * Returns validation limits as a JSON value for client-side use without a builder.
2145
+ * @returns {any}
2146
+ */
2147
+ function getValidationLimits() {
2148
+ const ret = wasm.getValidationLimits();
2149
+ if (ret[2]) {
2150
+ throw takeFromExternrefTable0(ret[1]);
2151
+ }
2152
+ return takeFromExternrefTable0(ret[0]);
2153
+ }
2154
+ exports.getValidationLimits = getValidationLimits;
2155
+
2156
+ /**
2157
+ * Builds a LastRead URI of the form "pubky://<author_id>/pub/pubky.app/last_read"
2158
+ * @param {string} author_id
2159
+ * @returns {string}
2160
+ */
2161
+ function lastReadUriBuilder(author_id) {
2162
+ let deferred2_0;
2163
+ let deferred2_1;
2164
+ try {
2165
+ const ptr0 = passStringToWasm0(author_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2166
+ const len0 = WASM_VECTOR_LEN;
2167
+ const ret = wasm.lastReadUriBuilder(ptr0, len0);
2168
+ deferred2_0 = ret[0];
2169
+ deferred2_1 = ret[1];
2170
+ return getStringFromWasm0(ret[0], ret[1]);
2171
+ } finally {
2172
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
2173
+ }
2174
+ }
2175
+ exports.lastReadUriBuilder = lastReadUriBuilder;
2176
+
2177
+ /**
2178
+ * Builds a Mute URI of the form "pubky://<author_id>/pub/pubky.app/mutes/<mute_id>"
2179
+ * @param {string} author_id
2180
+ * @param {string} mute_id
2181
+ * @returns {string}
2182
+ */
2183
+ function muteUriBuilder(author_id, mute_id) {
2184
+ let deferred3_0;
2185
+ let deferred3_1;
2186
+ try {
2187
+ const ptr0 = passStringToWasm0(author_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2188
+ const len0 = WASM_VECTOR_LEN;
2189
+ const ptr1 = passStringToWasm0(mute_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2190
+ const len1 = WASM_VECTOR_LEN;
2191
+ const ret = wasm.muteUriBuilder(ptr0, len0, ptr1, len1);
2192
+ deferred3_0 = ret[0];
2193
+ deferred3_1 = ret[1];
2194
+ return getStringFromWasm0(ret[0], ret[1]);
2195
+ } finally {
2196
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
2197
+ }
2198
+ }
2199
+ exports.muteUriBuilder = muteUriBuilder;
2200
+
2201
+ /**
2202
+ * Parses a Pubky URI and returns a strongly typed `ParsedUriResult`.
2203
+ *
2204
+ * This function wraps the internal ParsedUri ust parsing logic. It converts the result into a
2205
+ * strongly typed object that is easier to use in TypeScript.
2206
+ *
2207
+ * # Parameters
2208
+ *
2209
+ * - `uri`: A string slice representing the Pubky URI. The URI should follow the format:
2210
+ * `pubky://<user_id>/pub/pubky.app/<resource>[/<id>]`.
2211
+ *
2212
+ * # Returns
2213
+ *
2214
+ * On success, returns a `ParsedUriResult` with:
2215
+ * - `user_id`: the parsed user ID,
2216
+ * - `resource`: a string (derived from the Display implementation of internal `Resource` enum),
2217
+ * - `resource_id`: an optional resource identifier (if applicable).
2218
+ *
2219
+ * On failure, returns a JavaScript error (`String`) containing an error message.
2220
+ *
2221
+ * # Example (TypeScript)
2222
+ *
2223
+ * ```typescript
2224
+ * import { parse_uri } from "pubky-app-specs";
2225
+ *
2226
+ * try {
2227
+ * const result = parse_uri("pubky://user123/pub/pubky.app/posts/abc123");
2228
+ * console.log(result.user_id); // e.g. "user123"
2229
+ * console.log(result.resource); // e.g. "posts"
2230
+ * console.log(result.resource_id); // e.g. "abc123" or null
2231
+ * } catch (error) {
2232
+ * console.error("Error parsing URI:", error);
2233
+ * }
2234
+ * ```
2235
+ * @param {string} uri
2236
+ * @returns {ParsedUriResult}
2237
+ */
2238
+ function parse_uri(uri) {
2239
+ const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2240
+ const len0 = WASM_VECTOR_LEN;
2241
+ const ret = wasm.parse_uri(ptr0, len0);
2242
+ if (ret[2]) {
2243
+ throw takeFromExternrefTable0(ret[1]);
2244
+ }
2245
+ return ParsedUriResult.__wrap(ret[0]);
2246
+ }
2247
+ exports.parse_uri = parse_uri;
2248
+
2249
+ /**
2250
+ * Builds a Post URI of the form "pubky://<author_id>/pub/pubky.app/posts/<post_id>"
2251
+ * @param {string} author_id
2252
+ * @param {string} post_id
2253
+ * @returns {string}
2254
+ */
2255
+ function postUriBuilder(author_id, post_id) {
2256
+ let deferred3_0;
2257
+ let deferred3_1;
2258
+ try {
2259
+ const ptr0 = passStringToWasm0(author_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2260
+ const len0 = WASM_VECTOR_LEN;
2261
+ const ptr1 = passStringToWasm0(post_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2262
+ const len1 = WASM_VECTOR_LEN;
2263
+ const ret = wasm.postUriBuilder(ptr0, len0, ptr1, len1);
2264
+ deferred3_0 = ret[0];
2265
+ deferred3_1 = ret[1];
2266
+ return getStringFromWasm0(ret[0], ret[1]);
2267
+ } finally {
2268
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
2269
+ }
2270
+ }
2271
+ exports.postUriBuilder = postUriBuilder;
2272
+
2273
+ /**
2274
+ * Builds a Tag URI of the form "pubky://<author_id>/pub/pubky.app/tags/<tag_id>"
2275
+ * @param {string} author_id
2276
+ * @param {string} tag_id
2277
+ * @returns {string}
2278
+ */
2279
+ function tagUriBuilder(author_id, tag_id) {
2280
+ let deferred3_0;
2281
+ let deferred3_1;
2282
+ try {
2283
+ const ptr0 = passStringToWasm0(author_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2284
+ const len0 = WASM_VECTOR_LEN;
2285
+ const ptr1 = passStringToWasm0(tag_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2286
+ const len1 = WASM_VECTOR_LEN;
2287
+ const ret = wasm.tagUriBuilder(ptr0, len0, ptr1, len1);
2288
+ deferred3_0 = ret[0];
2289
+ deferred3_1 = ret[1];
2290
+ return getStringFromWasm0(ret[0], ret[1]);
2291
+ } finally {
2292
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
2293
+ }
2294
+ }
2295
+ exports.tagUriBuilder = tagUriBuilder;
2296
+
2297
+ /**
2298
+ * Builds an User URI of the form "pubky://<user_pubky_id>/pub/pubky.app/profile.json"
2299
+ * @param {string} user_id
2300
+ * @returns {string}
2301
+ */
2302
+ function userUriBuilder(user_id) {
2303
+ let deferred2_0;
2304
+ let deferred2_1;
2305
+ try {
2306
+ const ptr0 = passStringToWasm0(user_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2307
+ const len0 = WASM_VECTOR_LEN;
2308
+ const ret = wasm.userUriBuilder(ptr0, len0);
2309
+ deferred2_0 = ret[0];
2310
+ deferred2_1 = ret[1];
2311
+ return getStringFromWasm0(ret[0], ret[1]);
2312
+ } finally {
2313
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
2314
+ }
2315
+ }
2316
+ exports.userUriBuilder = userUriBuilder;
2317
+ function __wbg_get_imports() {
2318
+ const import0 = {
2319
+ __proto__: null,
2320
+ __wbg_Error_960c155d3d49e4c2: function(arg0, arg1) {
2321
+ const ret = Error(getStringFromWasm0(arg0, arg1));
2322
+ return ret;
2323
+ },
2324
+ __wbg_Number_32bf70a599af1d4b: function(arg0) {
2325
+ const ret = Number(arg0);
2326
+ return ret;
2327
+ },
2328
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
2329
+ const ret = String(arg1);
2330
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2331
+ const len1 = WASM_VECTOR_LEN;
2332
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2333
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2334
+ },
2335
+ __wbg___wbindgen_bigint_get_as_i64_3d3aba5d616c6a51: function(arg0, arg1) {
2336
+ const v = arg1;
2337
+ const ret = typeof(v) === 'bigint' ? v : undefined;
2338
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
2339
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
2340
+ },
2341
+ __wbg___wbindgen_boolean_get_6ea149f0a8dcc5ff: function(arg0) {
2342
+ const v = arg0;
2343
+ const ret = typeof(v) === 'boolean' ? v : undefined;
2344
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
2345
+ },
2346
+ __wbg___wbindgen_debug_string_ab4b34d23d6778bd: function(arg0, arg1) {
2347
+ const ret = debugString(arg1);
2348
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2349
+ const len1 = WASM_VECTOR_LEN;
2350
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2351
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2352
+ },
2353
+ __wbg___wbindgen_in_a5d8b22e52b24dd1: function(arg0, arg1) {
2354
+ const ret = arg0 in arg1;
2355
+ return ret;
2356
+ },
2357
+ __wbg___wbindgen_is_bigint_ec25c7f91b4d9e93: function(arg0) {
2358
+ const ret = typeof(arg0) === 'bigint';
2359
+ return ret;
2360
+ },
2361
+ __wbg___wbindgen_is_function_3baa9db1a987f47d: function(arg0) {
2362
+ const ret = typeof(arg0) === 'function';
2363
+ return ret;
2364
+ },
2365
+ __wbg___wbindgen_is_null_52ff4ec04186736f: function(arg0) {
2366
+ const ret = arg0 === null;
2367
+ return ret;
2368
+ },
2369
+ __wbg___wbindgen_is_object_63322ec0cd6ea4ef: function(arg0) {
2370
+ const val = arg0;
2371
+ const ret = typeof(val) === 'object' && val !== null;
2372
+ return ret;
2373
+ },
2374
+ __wbg___wbindgen_is_string_6df3bf7ef1164ed3: function(arg0) {
2375
+ const ret = typeof(arg0) === 'string';
2376
+ return ret;
2377
+ },
2378
+ __wbg___wbindgen_is_undefined_29a43b4d42920abd: function(arg0) {
2379
+ const ret = arg0 === undefined;
2380
+ return ret;
2381
+ },
2382
+ __wbg___wbindgen_jsval_eq_d3465d8a07697228: function(arg0, arg1) {
2383
+ const ret = arg0 === arg1;
2384
+ return ret;
2385
+ },
2386
+ __wbg___wbindgen_jsval_loose_eq_cac3565e89b4134c: function(arg0, arg1) {
2387
+ const ret = arg0 == arg1;
2388
+ return ret;
2389
+ },
2390
+ __wbg___wbindgen_number_get_c7f42aed0525c451: function(arg0, arg1) {
2391
+ const obj = arg1;
2392
+ const ret = typeof(obj) === 'number' ? obj : undefined;
2393
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
2394
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
2395
+ },
2396
+ __wbg___wbindgen_string_get_7ed5322991caaec5: function(arg0, arg1) {
2397
+ const obj = arg1;
2398
+ const ret = typeof(obj) === 'string' ? obj : undefined;
2399
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2400
+ var len1 = WASM_VECTOR_LEN;
2401
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2402
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2403
+ },
2404
+ __wbg___wbindgen_throw_6b64449b9b9ed33c: function(arg0, arg1) {
2405
+ throw new Error(getStringFromWasm0(arg0, arg1));
2406
+ },
2407
+ __wbg_call_14b169f759b26747: function() { return handleError(function (arg0, arg1) {
2408
+ const ret = arg0.call(arg1);
2409
+ return ret;
2410
+ }, arguments); },
2411
+ __wbg_done_9158f7cc8751ba32: function(arg0) {
2412
+ const ret = arg0.done;
2413
+ return ret;
2414
+ },
2415
+ __wbg_entries_e0b73aa8571ddb56: function(arg0) {
2416
+ const ret = Object.entries(arg0);
2417
+ return ret;
2418
+ },
2419
+ __wbg_fromCodePoint_4592108dc134086a: function() { return handleError(function (arg0) {
2420
+ const ret = String.fromCodePoint(arg0 >>> 0);
2421
+ return ret;
2422
+ }, arguments); },
2423
+ __wbg_get_1affdbdd5573b16a: function() { return handleError(function (arg0, arg1) {
2424
+ const ret = Reflect.get(arg0, arg1);
2425
+ return ret;
2426
+ }, arguments); },
2427
+ __wbg_get_8360291721e2339f: function(arg0, arg1) {
2428
+ const ret = arg0[arg1 >>> 0];
2429
+ return ret;
2430
+ },
2431
+ __wbg_get_unchecked_17f53dad852b9588: function(arg0, arg1) {
2432
+ const ret = arg0[arg1 >>> 0];
2433
+ return ret;
2434
+ },
2435
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
2436
+ const ret = arg0[arg1];
2437
+ return ret;
2438
+ },
2439
+ __wbg_instanceof_ArrayBuffer_7c8433c6ed14ffe3: function(arg0) {
2440
+ let result;
2441
+ try {
2442
+ result = arg0 instanceof ArrayBuffer;
2443
+ } catch (_) {
2444
+ result = false;
2445
+ }
2446
+ const ret = result;
2447
+ return ret;
2448
+ },
2449
+ __wbg_instanceof_Uint8Array_152ba1f289edcf3f: function(arg0) {
2450
+ let result;
2451
+ try {
2452
+ result = arg0 instanceof Uint8Array;
2453
+ } catch (_) {
2454
+ result = false;
2455
+ }
2456
+ const ret = result;
2457
+ return ret;
2458
+ },
2459
+ __wbg_isArray_c3109d14ffc06469: function(arg0) {
2460
+ const ret = Array.isArray(arg0);
2461
+ return ret;
2462
+ },
2463
+ __wbg_isSafeInteger_4fc213d1989d6d2a: function(arg0) {
2464
+ const ret = Number.isSafeInteger(arg0);
2465
+ return ret;
2466
+ },
2467
+ __wbg_iterator_013bc09ec998c2a7: function() {
2468
+ const ret = Symbol.iterator;
2469
+ return ret;
2470
+ },
2471
+ __wbg_length_3d4ecd04bd8d22f1: function(arg0) {
2472
+ const ret = arg0.length;
2473
+ return ret;
2474
+ },
2475
+ __wbg_length_9f1775224cf1d815: function(arg0) {
2476
+ const ret = arg0.length;
2477
+ return ret;
2478
+ },
2479
+ __wbg_new_0c7403db6e782f19: function(arg0) {
2480
+ const ret = new Uint8Array(arg0);
2481
+ return ret;
2482
+ },
2483
+ __wbg_new_682678e2f47e32bc: function() {
2484
+ const ret = new Array();
2485
+ return ret;
2486
+ },
2487
+ __wbg_new_aa8d0fa9762c29bd: function() {
2488
+ const ret = new Object();
2489
+ return ret;
2490
+ },
2491
+ __wbg_new_from_slice_b5ea43e23f6008c0: function(arg0, arg1) {
2492
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
2493
+ return ret;
2494
+ },
2495
+ __wbg_next_0340c4ae324393c3: function() { return handleError(function (arg0) {
2496
+ const ret = arg0.next();
2497
+ return ret;
2498
+ }, arguments); },
2499
+ __wbg_next_7646edaa39458ef7: function(arg0) {
2500
+ const ret = arg0.next;
2501
+ return ret;
2502
+ },
2503
+ __wbg_now_a9b7df1cbee90986: function() {
2504
+ const ret = Date.now();
2505
+ return ret;
2506
+ },
2507
+ __wbg_prototypesetcall_a6b02eb00b0f4ce2: function(arg0, arg1, arg2) {
2508
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
2509
+ },
2510
+ __wbg_pubkyappuserlink_new: function(arg0) {
2511
+ const ret = PubkyAppUserLink.__wrap(arg0);
2512
+ return ret;
2513
+ },
2514
+ __wbg_pubkyappuserlink_unwrap: function(arg0) {
2515
+ const ret = PubkyAppUserLink.__unwrap(arg0);
2516
+ return ret;
2517
+ },
2518
+ __wbg_set_3bf1de9fab0cd644: function(arg0, arg1, arg2) {
2519
+ arg0[arg1 >>> 0] = arg2;
2520
+ },
2521
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
2522
+ arg0[arg1] = arg2;
2523
+ },
2524
+ __wbg_value_ee3a06f4579184fa: function(arg0) {
2525
+ const ret = arg0.value;
2526
+ return ret;
2527
+ },
2528
+ __wbindgen_cast_0000000000000001: function(arg0) {
2529
+ // Cast intrinsic for `F64 -> Externref`.
2530
+ const ret = arg0;
2531
+ return ret;
2532
+ },
2533
+ __wbindgen_cast_0000000000000002: function(arg0) {
2534
+ // Cast intrinsic for `I64 -> Externref`.
2535
+ const ret = arg0;
2536
+ return ret;
2537
+ },
2538
+ __wbindgen_cast_0000000000000003: function(arg0, arg1) {
2539
+ // Cast intrinsic for `Ref(String) -> Externref`.
2540
+ const ret = getStringFromWasm0(arg0, arg1);
2541
+ return ret;
2542
+ },
2543
+ __wbindgen_cast_0000000000000004: function(arg0) {
2544
+ // Cast intrinsic for `U64 -> Externref`.
2545
+ const ret = BigInt.asUintN(64, arg0);
2546
+ return ret;
2547
+ },
2548
+ __wbindgen_init_externref_table: function() {
2549
+ const table = wasm.__wbindgen_externrefs;
2550
+ const offset = table.grow(4);
2551
+ table.set(0, undefined);
2552
+ table.set(offset + 0, undefined);
2553
+ table.set(offset + 1, null);
2554
+ table.set(offset + 2, true);
2555
+ table.set(offset + 3, false);
2556
+ },
2557
+ };
2558
+ return {
2559
+ __proto__: null,
2560
+ "./pubky_app_specs_bg.js": import0,
2561
+ };
2562
+ }
2563
+
2564
+ const BlobResultFinalization = (typeof FinalizationRegistry === 'undefined')
2565
+ ? { register: () => {}, unregister: () => {} }
2566
+ : new FinalizationRegistry(ptr => wasm.__wbg_blobresult_free(ptr >>> 0, 1));
2567
+ const BookmarkResultFinalization = (typeof FinalizationRegistry === 'undefined')
2568
+ ? { register: () => {}, unregister: () => {} }
2569
+ : new FinalizationRegistry(ptr => wasm.__wbg_bookmarkresult_free(ptr >>> 0, 1));
2570
+ const FeedResultFinalization = (typeof FinalizationRegistry === 'undefined')
2571
+ ? { register: () => {}, unregister: () => {} }
2572
+ : new FinalizationRegistry(ptr => wasm.__wbg_feedresult_free(ptr >>> 0, 1));
2573
+ const FileResultFinalization = (typeof FinalizationRegistry === 'undefined')
2574
+ ? { register: () => {}, unregister: () => {} }
2575
+ : new FinalizationRegistry(ptr => wasm.__wbg_fileresult_free(ptr >>> 0, 1));
2576
+ const FollowResultFinalization = (typeof FinalizationRegistry === 'undefined')
2577
+ ? { register: () => {}, unregister: () => {} }
2578
+ : new FinalizationRegistry(ptr => wasm.__wbg_followresult_free(ptr >>> 0, 1));
2579
+ const LastReadResultFinalization = (typeof FinalizationRegistry === 'undefined')
2580
+ ? { register: () => {}, unregister: () => {} }
2581
+ : new FinalizationRegistry(ptr => wasm.__wbg_lastreadresult_free(ptr >>> 0, 1));
2582
+ const MetaFinalization = (typeof FinalizationRegistry === 'undefined')
2583
+ ? { register: () => {}, unregister: () => {} }
2584
+ : new FinalizationRegistry(ptr => wasm.__wbg_meta_free(ptr >>> 0, 1));
2585
+ const MuteResultFinalization = (typeof FinalizationRegistry === 'undefined')
2586
+ ? { register: () => {}, unregister: () => {} }
2587
+ : new FinalizationRegistry(ptr => wasm.__wbg_muteresult_free(ptr >>> 0, 1));
2588
+ const ParsedUriResultFinalization = (typeof FinalizationRegistry === 'undefined')
2589
+ ? { register: () => {}, unregister: () => {} }
2590
+ : new FinalizationRegistry(ptr => wasm.__wbg_parseduriresult_free(ptr >>> 0, 1));
2591
+ const PostResultFinalization = (typeof FinalizationRegistry === 'undefined')
2592
+ ? { register: () => {}, unregister: () => {} }
2593
+ : new FinalizationRegistry(ptr => wasm.__wbg_postresult_free(ptr >>> 0, 1));
2594
+ const PubkyAppBlobFinalization = (typeof FinalizationRegistry === 'undefined')
2595
+ ? { register: () => {}, unregister: () => {} }
2596
+ : new FinalizationRegistry(ptr => wasm.__wbg_pubkyappblob_free(ptr >>> 0, 1));
2597
+ const PubkyAppBookmarkFinalization = (typeof FinalizationRegistry === 'undefined')
2598
+ ? { register: () => {}, unregister: () => {} }
2599
+ : new FinalizationRegistry(ptr => wasm.__wbg_pubkyappbookmark_free(ptr >>> 0, 1));
2600
+ const PubkyAppFeedFinalization = (typeof FinalizationRegistry === 'undefined')
2601
+ ? { register: () => {}, unregister: () => {} }
2602
+ : new FinalizationRegistry(ptr => wasm.__wbg_pubkyappfeed_free(ptr >>> 0, 1));
2603
+ const PubkyAppFeedConfigFinalization = (typeof FinalizationRegistry === 'undefined')
2604
+ ? { register: () => {}, unregister: () => {} }
2605
+ : new FinalizationRegistry(ptr => wasm.__wbg_pubkyappfeedconfig_free(ptr >>> 0, 1));
2606
+ const PubkyAppFileFinalization = (typeof FinalizationRegistry === 'undefined')
2607
+ ? { register: () => {}, unregister: () => {} }
2608
+ : new FinalizationRegistry(ptr => wasm.__wbg_pubkyappfile_free(ptr >>> 0, 1));
2609
+ const PubkyAppFollowFinalization = (typeof FinalizationRegistry === 'undefined')
2610
+ ? { register: () => {}, unregister: () => {} }
2611
+ : new FinalizationRegistry(ptr => wasm.__wbg_pubkyappfollow_free(ptr >>> 0, 1));
2612
+ const PubkyAppLastReadFinalization = (typeof FinalizationRegistry === 'undefined')
2613
+ ? { register: () => {}, unregister: () => {} }
2614
+ : new FinalizationRegistry(ptr => wasm.__wbg_pubkyapplastread_free(ptr >>> 0, 1));
2615
+ const PubkyAppMuteFinalization = (typeof FinalizationRegistry === 'undefined')
2616
+ ? { register: () => {}, unregister: () => {} }
2617
+ : new FinalizationRegistry(ptr => wasm.__wbg_pubkyappmute_free(ptr >>> 0, 1));
2618
+ const PubkyAppPostFinalization = (typeof FinalizationRegistry === 'undefined')
2619
+ ? { register: () => {}, unregister: () => {} }
2620
+ : new FinalizationRegistry(ptr => wasm.__wbg_pubkyapppost_free(ptr >>> 0, 1));
2621
+ const PubkyAppPostEmbedFinalization = (typeof FinalizationRegistry === 'undefined')
2622
+ ? { register: () => {}, unregister: () => {} }
2623
+ : new FinalizationRegistry(ptr => wasm.__wbg_pubkyapppostembed_free(ptr >>> 0, 1));
2624
+ const PubkyAppTagFinalization = (typeof FinalizationRegistry === 'undefined')
2625
+ ? { register: () => {}, unregister: () => {} }
2626
+ : new FinalizationRegistry(ptr => wasm.__wbg_pubkyapptag_free(ptr >>> 0, 1));
2627
+ const PubkyAppUserFinalization = (typeof FinalizationRegistry === 'undefined')
2628
+ ? { register: () => {}, unregister: () => {} }
2629
+ : new FinalizationRegistry(ptr => wasm.__wbg_pubkyappuser_free(ptr >>> 0, 1));
2630
+ const PubkyAppUserLinkFinalization = (typeof FinalizationRegistry === 'undefined')
2631
+ ? { register: () => {}, unregister: () => {} }
2632
+ : new FinalizationRegistry(ptr => wasm.__wbg_pubkyappuserlink_free(ptr >>> 0, 1));
2633
+ const PubkyIdFinalization = (typeof FinalizationRegistry === 'undefined')
2634
+ ? { register: () => {}, unregister: () => {} }
2635
+ : new FinalizationRegistry(ptr => wasm.__wbg_pubkyid_free(ptr >>> 0, 1));
2636
+ const PubkySpecsBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
2637
+ ? { register: () => {}, unregister: () => {} }
2638
+ : new FinalizationRegistry(ptr => wasm.__wbg_pubkyspecsbuilder_free(ptr >>> 0, 1));
2639
+ const TagResultFinalization = (typeof FinalizationRegistry === 'undefined')
2640
+ ? { register: () => {}, unregister: () => {} }
2641
+ : new FinalizationRegistry(ptr => wasm.__wbg_tagresult_free(ptr >>> 0, 1));
2642
+ const UserResultFinalization = (typeof FinalizationRegistry === 'undefined')
2643
+ ? { register: () => {}, unregister: () => {} }
2644
+ : new FinalizationRegistry(ptr => wasm.__wbg_userresult_free(ptr >>> 0, 1));
2645
+
2646
+ function addToExternrefTable0(obj) {
2647
+ const idx = wasm.__externref_table_alloc();
2648
+ wasm.__wbindgen_externrefs.set(idx, obj);
2649
+ return idx;
2650
+ }
2651
+
2652
+ function _assertClass(instance, klass) {
2653
+ if (!(instance instanceof klass)) {
2654
+ throw new Error(`expected instance of ${klass.name}`);
2655
+ }
2656
+ }
2657
+
2658
+ function debugString(val) {
2659
+ // primitive types
2660
+ const type = typeof val;
2661
+ if (type == 'number' || type == 'boolean' || val == null) {
2662
+ return `${val}`;
2466
2663
  }
2467
- /**
2468
- * @param {string} uri
2469
- * @returns {BookmarkResult}
2470
- */
2471
- createBookmark(uri) {
2472
- const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2473
- const len0 = WASM_VECTOR_LEN;
2474
- const ret = wasm.pubkyspecsbuilder_createBookmark(this.__wbg_ptr, ptr0, len0);
2475
- if (ret[2]) {
2476
- throw takeFromExternrefTable0(ret[1]);
2477
- }
2478
- return BookmarkResult.__wrap(ret[0]);
2664
+ if (type == 'string') {
2665
+ return `"${val}"`;
2479
2666
  }
2480
- /**
2481
- * @param {string} followee_id
2482
- * @returns {FollowResult}
2483
- */
2484
- createFollow(followee_id) {
2485
- const ptr0 = passStringToWasm0(followee_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2486
- const len0 = WASM_VECTOR_LEN;
2487
- const ret = wasm.pubkyspecsbuilder_createFollow(this.__wbg_ptr, ptr0, len0);
2488
- if (ret[2]) {
2489
- throw takeFromExternrefTable0(ret[1]);
2667
+ if (type == 'symbol') {
2668
+ const description = val.description;
2669
+ if (description == null) {
2670
+ return 'Symbol';
2671
+ } else {
2672
+ return `Symbol(${description})`;
2490
2673
  }
2491
- return FollowResult.__wrap(ret[0]);
2492
2674
  }
2493
- /**
2494
- * @param {string} mutee_id
2495
- * @returns {MuteResult}
2496
- */
2497
- createMute(mutee_id) {
2498
- const ptr0 = passStringToWasm0(mutee_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2499
- const len0 = WASM_VECTOR_LEN;
2500
- const ret = wasm.pubkyspecsbuilder_createMute(this.__wbg_ptr, ptr0, len0);
2501
- if (ret[2]) {
2502
- throw takeFromExternrefTable0(ret[1]);
2675
+ if (type == 'function') {
2676
+ const name = val.name;
2677
+ if (typeof name == 'string' && name.length > 0) {
2678
+ return `Function(${name})`;
2679
+ } else {
2680
+ return 'Function';
2503
2681
  }
2504
- return MuteResult.__wrap(ret[0]);
2505
2682
  }
2506
- /**
2507
- * @returns {LastReadResult}
2508
- */
2509
- createLastRead() {
2510
- const ret = wasm.pubkyspecsbuilder_createLastRead(this.__wbg_ptr);
2511
- if (ret[2]) {
2512
- throw takeFromExternrefTable0(ret[1]);
2683
+ // objects
2684
+ if (Array.isArray(val)) {
2685
+ const length = val.length;
2686
+ let debug = '[';
2687
+ if (length > 0) {
2688
+ debug += debugString(val[0]);
2513
2689
  }
2514
- return LastReadResult.__wrap(ret[0]);
2690
+ for(let i = 1; i < length; i++) {
2691
+ debug += ', ' + debugString(val[i]);
2692
+ }
2693
+ debug += ']';
2694
+ return debug;
2515
2695
  }
2516
- /**
2517
- * @param {any} blob_data
2518
- * @returns {BlobResult}
2519
- */
2520
- createBlob(blob_data) {
2521
- const ret = wasm.pubkyspecsbuilder_createBlob(this.__wbg_ptr, blob_data);
2522
- if (ret[2]) {
2523
- throw takeFromExternrefTable0(ret[1]);
2696
+ // Test for built-in
2697
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
2698
+ let className;
2699
+ if (builtInMatches && builtInMatches.length > 1) {
2700
+ className = builtInMatches[1];
2701
+ } else {
2702
+ // Failed to match the standard '[object ClassName]'
2703
+ return toString.call(val);
2704
+ }
2705
+ if (className == 'Object') {
2706
+ // we're a user defined class or Object
2707
+ // JSON.stringify avoids problems with cycles, and is generally much
2708
+ // easier than looping through ownProperties of `val`.
2709
+ try {
2710
+ return 'Object(' + JSON.stringify(val) + ')';
2711
+ } catch (_) {
2712
+ return 'Object';
2524
2713
  }
2525
- return BlobResult.__wrap(ret[0]);
2526
2714
  }
2715
+ // errors
2716
+ if (val instanceof Error) {
2717
+ return `${val.name}: ${val.message}\n${val.stack}`;
2718
+ }
2719
+ // TODO we could test for more things here, like `Set`s and `Map`s.
2720
+ return className;
2527
2721
  }
2528
- module.exports.PubkySpecsBuilder = PubkySpecsBuilder;
2529
2722
 
2530
- const TagResultFinalization = (typeof FinalizationRegistry === 'undefined')
2531
- ? { register: () => {}, unregister: () => {} }
2532
- : new FinalizationRegistry(ptr => wasm.__wbg_tagresult_free(ptr >>> 0, 1));
2723
+ function getArrayJsValueFromWasm0(ptr, len) {
2724
+ ptr = ptr >>> 0;
2725
+ const mem = getDataViewMemory0();
2726
+ const result = [];
2727
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
2728
+ result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
2729
+ }
2730
+ wasm.__externref_drop_slice(ptr, len);
2731
+ return result;
2732
+ }
2533
2733
 
2534
- class TagResult {
2734
+ function getArrayU8FromWasm0(ptr, len) {
2735
+ ptr = ptr >>> 0;
2736
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
2737
+ }
2535
2738
 
2536
- static __wrap(ptr) {
2537
- ptr = ptr >>> 0;
2538
- const obj = Object.create(TagResult.prototype);
2539
- obj.__wbg_ptr = ptr;
2540
- TagResultFinalization.register(obj, obj.__wbg_ptr, obj);
2541
- return obj;
2739
+ let cachedDataViewMemory0 = null;
2740
+ function getDataViewMemory0() {
2741
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
2742
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
2542
2743
  }
2744
+ return cachedDataViewMemory0;
2745
+ }
2543
2746
 
2544
- __destroy_into_raw() {
2545
- const ptr = this.__wbg_ptr;
2546
- this.__wbg_ptr = 0;
2547
- TagResultFinalization.unregister(this);
2548
- return ptr;
2549
- }
2747
+ function getStringFromWasm0(ptr, len) {
2748
+ ptr = ptr >>> 0;
2749
+ return decodeText(ptr, len);
2750
+ }
2550
2751
 
2551
- free() {
2552
- const ptr = this.__destroy_into_raw();
2553
- wasm.__wbg_tagresult_free(ptr, 0);
2554
- }
2555
- /**
2556
- * @returns {PubkyAppTag}
2557
- */
2558
- get tag() {
2559
- const ret = wasm.tagresult_tag(this.__wbg_ptr);
2560
- return PubkyAppTag.__wrap(ret);
2561
- }
2562
- /**
2563
- * @returns {Meta}
2564
- */
2565
- get meta() {
2566
- const ret = wasm.tagresult_meta(this.__wbg_ptr);
2567
- return Meta.__wrap(ret);
2752
+ let cachedUint8ArrayMemory0 = null;
2753
+ function getUint8ArrayMemory0() {
2754
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
2755
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
2568
2756
  }
2757
+ return cachedUint8ArrayMemory0;
2569
2758
  }
2570
- module.exports.TagResult = TagResult;
2571
2759
 
2572
- const UserResultFinalization = (typeof FinalizationRegistry === 'undefined')
2573
- ? { register: () => {}, unregister: () => {} }
2574
- : new FinalizationRegistry(ptr => wasm.__wbg_userresult_free(ptr >>> 0, 1));
2760
+ function handleError(f, args) {
2761
+ try {
2762
+ return f.apply(this, args);
2763
+ } catch (e) {
2764
+ const idx = addToExternrefTable0(e);
2765
+ wasm.__wbindgen_exn_store(idx);
2766
+ }
2767
+ }
2575
2768
 
2576
- class UserResult {
2769
+ function isLikeNone(x) {
2770
+ return x === undefined || x === null;
2771
+ }
2577
2772
 
2578
- static __wrap(ptr) {
2579
- ptr = ptr >>> 0;
2580
- const obj = Object.create(UserResult.prototype);
2581
- obj.__wbg_ptr = ptr;
2582
- UserResultFinalization.register(obj, obj.__wbg_ptr, obj);
2583
- return obj;
2773
+ function passArrayJsValueToWasm0(array, malloc) {
2774
+ const ptr = malloc(array.length * 4, 4) >>> 0;
2775
+ for (let i = 0; i < array.length; i++) {
2776
+ const add = addToExternrefTable0(array[i]);
2777
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
2584
2778
  }
2779
+ WASM_VECTOR_LEN = array.length;
2780
+ return ptr;
2781
+ }
2585
2782
 
2586
- __destroy_into_raw() {
2587
- const ptr = this.__wbg_ptr;
2588
- this.__wbg_ptr = 0;
2589
- UserResultFinalization.unregister(this);
2783
+ function passStringToWasm0(arg, malloc, realloc) {
2784
+ if (realloc === undefined) {
2785
+ const buf = cachedTextEncoder.encode(arg);
2786
+ const ptr = malloc(buf.length, 1) >>> 0;
2787
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
2788
+ WASM_VECTOR_LEN = buf.length;
2590
2789
  return ptr;
2591
2790
  }
2592
2791
 
2593
- free() {
2594
- const ptr = this.__destroy_into_raw();
2595
- wasm.__wbg_userresult_free(ptr, 0);
2596
- }
2597
- /**
2598
- * @returns {PubkyAppUser}
2599
- */
2600
- get user() {
2601
- const ret = wasm.userresult_user(this.__wbg_ptr);
2602
- return PubkyAppUser.__wrap(ret);
2792
+ let len = arg.length;
2793
+ let ptr = malloc(len, 1) >>> 0;
2794
+
2795
+ const mem = getUint8ArrayMemory0();
2796
+
2797
+ let offset = 0;
2798
+
2799
+ for (; offset < len; offset++) {
2800
+ const code = arg.charCodeAt(offset);
2801
+ if (code > 0x7F) break;
2802
+ mem[ptr + offset] = code;
2603
2803
  }
2604
- /**
2605
- * @returns {Meta}
2606
- */
2607
- get meta() {
2608
- const ret = wasm.userresult_meta(this.__wbg_ptr);
2609
- return Meta.__wrap(ret);
2804
+ if (offset !== len) {
2805
+ if (offset !== 0) {
2806
+ arg = arg.slice(offset);
2807
+ }
2808
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
2809
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
2810
+ const ret = cachedTextEncoder.encodeInto(arg, view);
2811
+
2812
+ offset += ret.written;
2813
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
2610
2814
  }
2815
+
2816
+ WASM_VECTOR_LEN = offset;
2817
+ return ptr;
2611
2818
  }
2612
- module.exports.UserResult = UserResult;
2613
-
2614
- module.exports.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
2615
- const ret = String(arg1);
2616
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2617
- const len1 = WASM_VECTOR_LEN;
2618
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2619
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2620
- };
2621
-
2622
- module.exports.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
2623
- const ret = arg0.buffer;
2624
- return ret;
2625
- };
2626
-
2627
- module.exports.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
2628
- const ret = arg0.call(arg1);
2629
- return ret;
2630
- }, arguments) };
2631
-
2632
- module.exports.__wbg_done_769e5ede4b31c67b = function(arg0) {
2633
- const ret = arg0.done;
2634
- return ret;
2635
- };
2636
-
2637
- module.exports.__wbg_entries_3265d4158b33e5dc = function(arg0) {
2638
- const ret = Object.entries(arg0);
2639
- return ret;
2640
- };
2641
-
2642
- module.exports.__wbg_fromCodePoint_f37c25c172f2e8b5 = function() { return handleError(function (arg0) {
2643
- const ret = String.fromCodePoint(arg0 >>> 0);
2644
- return ret;
2645
- }, arguments) };
2646
-
2647
- module.exports.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
2648
- const ret = Reflect.get(arg0, arg1);
2649
- return ret;
2650
- }, arguments) };
2651
-
2652
- module.exports.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
2653
- const ret = arg0[arg1 >>> 0];
2654
- return ret;
2655
- };
2656
-
2657
- module.exports.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
2658
- const ret = arg0[arg1];
2659
- return ret;
2660
- };
2661
-
2662
- module.exports.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
2663
- let result;
2664
- try {
2665
- result = arg0 instanceof ArrayBuffer;
2666
- } catch (_) {
2667
- result = false;
2668
- }
2669
- const ret = result;
2670
- return ret;
2671
- };
2672
2819
 
2673
- module.exports.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
2674
- let result;
2675
- try {
2676
- result = arg0 instanceof Uint8Array;
2677
- } catch (_) {
2678
- result = false;
2679
- }
2680
- const ret = result;
2681
- return ret;
2682
- };
2683
-
2684
- module.exports.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
2685
- const ret = Array.isArray(arg0);
2686
- return ret;
2687
- };
2688
-
2689
- module.exports.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
2690
- const ret = Number.isSafeInteger(arg0);
2691
- return ret;
2692
- };
2693
-
2694
- module.exports.__wbg_iterator_9a24c88df860dc65 = function() {
2695
- const ret = Symbol.iterator;
2696
- return ret;
2697
- };
2698
-
2699
- module.exports.__wbg_length_a446193dc22c12f8 = function(arg0) {
2700
- const ret = arg0.length;
2701
- return ret;
2702
- };
2703
-
2704
- module.exports.__wbg_length_e2d2a49132c1b256 = function(arg0) {
2705
- const ret = arg0.length;
2706
- return ret;
2707
- };
2708
-
2709
- module.exports.__wbg_new_405e22f390576ce2 = function() {
2710
- const ret = new Object();
2711
- return ret;
2712
- };
2713
-
2714
- module.exports.__wbg_new_78feb108b6472713 = function() {
2715
- const ret = new Array();
2716
- return ret;
2717
- };
2718
-
2719
- module.exports.__wbg_new_a12002a7f91c75be = function(arg0) {
2720
- const ret = new Uint8Array(arg0);
2721
- return ret;
2722
- };
2723
-
2724
- module.exports.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
2725
- const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
2726
- return ret;
2727
- };
2728
-
2729
- module.exports.__wbg_next_25feadfc0913fea9 = function(arg0) {
2730
- const ret = arg0.next;
2731
- return ret;
2732
- };
2733
-
2734
- module.exports.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
2735
- const ret = arg0.next();
2736
- return ret;
2737
- }, arguments) };
2738
-
2739
- module.exports.__wbg_now_807e54c39636c349 = function() {
2740
- const ret = Date.now();
2741
- return ret;
2742
- };
2743
-
2744
- module.exports.__wbg_pubkyappuserlink_new = function(arg0) {
2745
- const ret = PubkyAppUserLink.__wrap(arg0);
2746
- return ret;
2747
- };
2748
-
2749
- module.exports.__wbg_pubkyappuserlink_unwrap = function(arg0) {
2750
- const ret = PubkyAppUserLink.__unwrap(arg0);
2751
- return ret;
2752
- };
2753
-
2754
- module.exports.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
2755
- arg0[arg1 >>> 0] = arg2;
2756
- };
2757
-
2758
- module.exports.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
2759
- arg0[arg1] = arg2;
2760
- };
2761
-
2762
- module.exports.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
2763
- arg0.set(arg1, arg2 >>> 0);
2764
- };
2765
-
2766
- module.exports.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
2767
- const ret = arg0.value;
2768
- return ret;
2769
- };
2770
-
2771
- module.exports.__wbindgen_as_number = function(arg0) {
2772
- const ret = +arg0;
2773
- return ret;
2774
- };
2775
-
2776
- module.exports.__wbindgen_bigint_from_i64 = function(arg0) {
2777
- const ret = arg0;
2778
- return ret;
2779
- };
2780
-
2781
- module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
2782
- const ret = BigInt.asUintN(64, arg0);
2783
- return ret;
2784
- };
2785
-
2786
- module.exports.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
2787
- const v = arg1;
2788
- const ret = typeof(v) === 'bigint' ? v : undefined;
2789
- getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
2790
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
2791
- };
2792
-
2793
- module.exports.__wbindgen_boolean_get = function(arg0) {
2794
- const v = arg0;
2795
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
2796
- return ret;
2797
- };
2798
-
2799
- module.exports.__wbindgen_debug_string = function(arg0, arg1) {
2800
- const ret = debugString(arg1);
2801
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2802
- const len1 = WASM_VECTOR_LEN;
2803
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2804
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2805
- };
2806
-
2807
- module.exports.__wbindgen_error_new = function(arg0, arg1) {
2808
- const ret = new Error(getStringFromWasm0(arg0, arg1));
2809
- return ret;
2810
- };
2811
-
2812
- module.exports.__wbindgen_in = function(arg0, arg1) {
2813
- const ret = arg0 in arg1;
2814
- return ret;
2815
- };
2816
-
2817
- module.exports.__wbindgen_init_externref_table = function() {
2818
- const table = wasm.__wbindgen_export_4;
2819
- const offset = table.grow(4);
2820
- table.set(0, undefined);
2821
- table.set(offset + 0, undefined);
2822
- table.set(offset + 1, null);
2823
- table.set(offset + 2, true);
2824
- table.set(offset + 3, false);
2825
- ;
2826
- };
2827
-
2828
- module.exports.__wbindgen_is_bigint = function(arg0) {
2829
- const ret = typeof(arg0) === 'bigint';
2830
- return ret;
2831
- };
2832
-
2833
- module.exports.__wbindgen_is_function = function(arg0) {
2834
- const ret = typeof(arg0) === 'function';
2835
- return ret;
2836
- };
2837
-
2838
- module.exports.__wbindgen_is_null = function(arg0) {
2839
- const ret = arg0 === null;
2840
- return ret;
2841
- };
2842
-
2843
- module.exports.__wbindgen_is_object = function(arg0) {
2844
- const val = arg0;
2845
- const ret = typeof(val) === 'object' && val !== null;
2846
- return ret;
2847
- };
2848
-
2849
- module.exports.__wbindgen_is_string = function(arg0) {
2850
- const ret = typeof(arg0) === 'string';
2851
- return ret;
2852
- };
2853
-
2854
- module.exports.__wbindgen_is_undefined = function(arg0) {
2855
- const ret = arg0 === undefined;
2856
- return ret;
2857
- };
2858
-
2859
- module.exports.__wbindgen_jsval_eq = function(arg0, arg1) {
2860
- const ret = arg0 === arg1;
2861
- return ret;
2862
- };
2863
-
2864
- module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
2865
- const ret = arg0 == arg1;
2866
- return ret;
2867
- };
2868
-
2869
- module.exports.__wbindgen_memory = function() {
2870
- const ret = wasm.memory;
2871
- return ret;
2872
- };
2873
-
2874
- module.exports.__wbindgen_number_get = function(arg0, arg1) {
2875
- const obj = arg1;
2876
- const ret = typeof(obj) === 'number' ? obj : undefined;
2877
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
2878
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
2879
- };
2880
-
2881
- module.exports.__wbindgen_number_new = function(arg0) {
2882
- const ret = arg0;
2883
- return ret;
2884
- };
2885
-
2886
- module.exports.__wbindgen_string_get = function(arg0, arg1) {
2887
- const obj = arg1;
2888
- const ret = typeof(obj) === 'string' ? obj : undefined;
2889
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2890
- var len1 = WASM_VECTOR_LEN;
2891
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2892
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2893
- };
2894
-
2895
- module.exports.__wbindgen_string_new = function(arg0, arg1) {
2896
- const ret = getStringFromWasm0(arg0, arg1);
2897
- return ret;
2898
- };
2899
-
2900
- module.exports.__wbindgen_throw = function(arg0, arg1) {
2901
- throw new Error(getStringFromWasm0(arg0, arg1));
2902
- };
2903
-
2904
- const path = require('path').join(__dirname, 'pubky_app_specs_bg.wasm');
2905
- const bytes = require('fs').readFileSync(path);
2906
-
2907
- const wasmModule = new WebAssembly.Module(bytes);
2908
- const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
2909
- wasm = wasmInstance.exports;
2910
- module.exports.__wasm = wasm;
2820
+ function takeFromExternrefTable0(idx) {
2821
+ const value = wasm.__wbindgen_externrefs.get(idx);
2822
+ wasm.__externref_table_dealloc(idx);
2823
+ return value;
2824
+ }
2911
2825
 
2912
- wasm.__wbindgen_start();
2826
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
2827
+ cachedTextDecoder.decode();
2828
+ function decodeText(ptr, len) {
2829
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
2830
+ }
2913
2831
 
2832
+ const cachedTextEncoder = new TextEncoder();
2833
+
2834
+ if (!('encodeInto' in cachedTextEncoder)) {
2835
+ cachedTextEncoder.encodeInto = function (arg, view) {
2836
+ const buf = cachedTextEncoder.encode(arg);
2837
+ view.set(buf);
2838
+ return {
2839
+ read: arg.length,
2840
+ written: buf.length
2841
+ };
2842
+ };
2843
+ }
2844
+
2845
+ let WASM_VECTOR_LEN = 0;
2846
+
2847
+ const wasmPath = `${__dirname}/pubky_app_specs_bg.wasm`;
2848
+ const wasmBytes = require('fs').readFileSync(wasmPath);
2849
+ const wasmModule = new WebAssembly.Module(wasmBytes);
2850
+ let wasm = new WebAssembly.Instance(wasmModule, __wbg_get_imports()).exports;
2851
+ wasm.__wbindgen_start();