pubky-app-specs 0.3.0-rc1 → 0.3.0-rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "pubky-app-specs",
3
3
  "type": "module",
4
4
  "description": "Pubky.app Data Model Specifications",
5
- "version": "0.3.0-rc1",
5
+ "version": "0.3.0-rc2",
6
6
  "license": "MIT",
7
7
  "collaborators": [
8
8
  "SHAcollision"
@@ -414,6 +414,10 @@ export class PubkySpecsBuilder {
414
414
  createFeed(tags: any, reach: string, layout: string, sort: string, content: string | null | undefined, name: string): FeedResult;
415
415
  createFile(name: string, src: string, content_type: string, size: bigint): FileResult;
416
416
  createPost(content: string, kind: PubkyAppPostKind, parent?: string | null, embed?: PubkyAppPostEmbed | null, attachments?: string[] | null): PostResult;
417
+ /**
418
+ * Edits an existing post by updating its content while preserving its original ID and timestamp.
419
+ */
420
+ editPost(original_post: PubkyAppPost, post_id: string, new_content: string): PostResult;
417
421
  createTag(uri: string, label: string): TagResult;
418
422
  createBookmark(uri: string): BookmarkResult;
419
423
  createFollow(followee_id: string): FollowResult;
@@ -534,6 +538,7 @@ export interface InitOutput {
534
538
  readonly pubkyspecsbuilder_createFeed: (a: number, b: any, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => [number, number, number];
535
539
  readonly pubkyspecsbuilder_createFile: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: bigint) => [number, number, number];
536
540
  readonly pubkyspecsbuilder_createPost: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
541
+ readonly pubkyspecsbuilder_editPost: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
537
542
  readonly pubkyspecsbuilder_createTag: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
538
543
  readonly pubkyspecsbuilder_createBookmark: (a: number, b: number, c: number) => [number, number, number];
539
544
  readonly pubkyspecsbuilder_createFollow: (a: number, b: number, c: number) => [number, number, number];
@@ -2035,6 +2035,26 @@ export class PubkySpecsBuilder {
2035
2035
  }
2036
2036
  return PostResult.__wrap(ret[0]);
2037
2037
  }
2038
+ /**
2039
+ * Edits an existing post by updating its content while preserving its original ID and timestamp.
2040
+ * @param {PubkyAppPost} original_post
2041
+ * @param {string} post_id
2042
+ * @param {string} new_content
2043
+ * @returns {PostResult}
2044
+ */
2045
+ editPost(original_post, post_id, new_content) {
2046
+ _assertClass(original_post, PubkyAppPost);
2047
+ var ptr0 = original_post.__destroy_into_raw();
2048
+ const ptr1 = passStringToWasm0(post_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2049
+ const len1 = WASM_VECTOR_LEN;
2050
+ const ptr2 = passStringToWasm0(new_content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2051
+ const len2 = WASM_VECTOR_LEN;
2052
+ const ret = wasm.pubkyspecsbuilder_editPost(this.__wbg_ptr, ptr0, ptr1, len1, ptr2, len2);
2053
+ if (ret[2]) {
2054
+ throw takeFromExternrefTable0(ret[1]);
2055
+ }
2056
+ return PostResult.__wrap(ret[0]);
2057
+ }
2038
2058
  /**
2039
2059
  * @param {string} uri
2040
2060
  * @param {string} label
Binary file