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