@pkcprotocol/pkc-js 0.0.131 → 0.0.133

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.
Files changed (98) hide show
  1. package/README.md +17 -7
  2. package/dist/browser/clients/rpc-client/rpc-schema-util.d.ts +2 -0
  3. package/dist/browser/clients/rpc-client/schema.d.ts +24 -0
  4. package/dist/browser/community/schema.d.ts +193 -0
  5. package/dist/browser/community/schema.js +4 -0
  6. package/dist/browser/community/schema.js.map +1 -1
  7. package/dist/browser/errors.d.ts +9 -1
  8. package/dist/browser/errors.js +9 -1
  9. package/dist/browser/errors.js.map +1 -1
  10. package/dist/browser/generated-version.d.ts +1 -1
  11. package/dist/browser/generated-version.js +1 -1
  12. package/dist/browser/index-with-compile-cache.d.ts +32 -0
  13. package/dist/browser/index.d.ts +64 -0
  14. package/dist/browser/pages/schema.d.ts +44 -0
  15. package/dist/browser/pkc-error.d.ts +1 -1
  16. package/dist/browser/publications/comment/comment.d.ts +1 -0
  17. package/dist/browser/publications/comment/comment.js +2 -0
  18. package/dist/browser/publications/comment/comment.js.map +1 -1
  19. package/dist/browser/publications/comment/schema.d.ts +133 -1
  20. package/dist/browser/publications/comment/schema.js +21 -6
  21. package/dist/browser/publications/comment/schema.js.map +1 -1
  22. package/dist/browser/publications/comment/types.d.ts +2 -1
  23. package/dist/browser/publications/community-edit/schema.d.ts +8 -0
  24. package/dist/browser/pubsub-messages/schema.d.ts +37 -0
  25. package/dist/browser/rpc/src/lib/pkc-js/index.d.ts +32 -0
  26. package/dist/browser/rpc/src/schema.d.ts +192 -0
  27. package/dist/browser/runtime/node/community/db-handler.js +3 -2
  28. package/dist/browser/runtime/node/community/db-handler.js.map +1 -1
  29. package/dist/browser/runtime/node/community/local-community/editing.js +60 -7
  30. package/dist/browser/runtime/node/community/local-community/editing.js.map +1 -1
  31. package/dist/browser/runtime/node/community/local-community/publication-validation.js +41 -17
  32. package/dist/browser/runtime/node/community/local-community/publication-validation.js.map +1 -1
  33. package/dist/browser/runtime/node/polyfill.js +3 -1
  34. package/dist/browser/runtime/node/polyfill.js.map +1 -1
  35. package/dist/browser/schema/schema-util.d.ts +82 -0
  36. package/dist/browser/schema.d.ts +256 -0
  37. package/dist/browser/signer/signatures.js +18 -6
  38. package/dist/browser/signer/signatures.js.map +1 -1
  39. package/dist/browser/test/test-util.d.ts +40 -0
  40. package/dist/browser/version.js +1 -1
  41. package/dist/bundled/bundle-manifest.json +434 -211
  42. package/dist/bundled/challenges.js +1 -1
  43. package/dist/bundled/chunks/{helia-for-pkc-C7_eLx63.js → helia-for-pkc-B6cVl9Fj.js} +2 -2
  44. package/dist/bundled/chunks/{local-community-CtL1aSwt.js → local-community-CEsw9IC3.js} +1 -1
  45. package/dist/bundled/chunks/{local-community-RlYLG5QV.js → local-community-JxRohlLp.js} +114 -47
  46. package/dist/bundled/chunks/node-DsWFSaNV.js +36843 -0
  47. package/dist/bundled/chunks/{page-sort-scoring-CaoGFyhT.js → page-sort-scoring-iqMGLuRC.js} +1 -1
  48. package/dist/bundled/chunks/{rpc-local-community-BXt7eK9l.js → rpc-local-community-jndojGZl.js} +56870 -33780
  49. package/dist/bundled/chunks/{src-B07ldGHS.js → src-BggJ_InF.js} +435 -149
  50. package/dist/bundled/chunks/{src-629pKfxo.js → src-BsiPSkhv.js} +2 -2
  51. package/dist/bundled/chunks/{src-BOzgM7Fp.js → src-evzEHW9W.js} +26 -9
  52. package/dist/bundled/chunks/{util-CaL93qd4.js → util-Bna9pur0.js} +32 -9
  53. package/dist/bundled/chunks/{util-cD0RAlzC.js → util-CYgZRMVL.js} +1 -1
  54. package/dist/bundled/chunks/{validate-package-factories-DWI4TSli.js → validate-package-factories-FeyM9Tw1.js} +2 -2
  55. package/dist/bundled/index.js +1 -1
  56. package/dist/bundled/page-sorts.js +1 -1
  57. package/dist/bundled/rpc/src/index.js +4 -4
  58. package/dist/node/clients/rpc-client/rpc-schema-util.d.ts +2 -0
  59. package/dist/node/clients/rpc-client/schema.d.ts +24 -0
  60. package/dist/node/community/schema.d.ts +193 -0
  61. package/dist/node/community/schema.js +4 -0
  62. package/dist/node/community/schema.js.map +1 -1
  63. package/dist/node/errors.d.ts +9 -1
  64. package/dist/node/errors.js +9 -1
  65. package/dist/node/errors.js.map +1 -1
  66. package/dist/node/generated-version.d.ts +1 -1
  67. package/dist/node/generated-version.js +1 -1
  68. package/dist/node/index-with-compile-cache.d.ts +32 -0
  69. package/dist/node/index.d.ts +64 -0
  70. package/dist/node/pages/schema.d.ts +44 -0
  71. package/dist/node/pkc-error.d.ts +1 -1
  72. package/dist/node/publications/comment/comment.d.ts +1 -0
  73. package/dist/node/publications/comment/comment.js +2 -0
  74. package/dist/node/publications/comment/comment.js.map +1 -1
  75. package/dist/node/publications/comment/schema.d.ts +133 -1
  76. package/dist/node/publications/comment/schema.js +21 -6
  77. package/dist/node/publications/comment/schema.js.map +1 -1
  78. package/dist/node/publications/comment/types.d.ts +2 -1
  79. package/dist/node/publications/community-edit/schema.d.ts +8 -0
  80. package/dist/node/pubsub-messages/schema.d.ts +37 -0
  81. package/dist/node/rpc/src/lib/pkc-js/index.d.ts +32 -0
  82. package/dist/node/rpc/src/schema.d.ts +192 -0
  83. package/dist/node/runtime/node/community/db-handler.js +3 -2
  84. package/dist/node/runtime/node/community/db-handler.js.map +1 -1
  85. package/dist/node/runtime/node/community/local-community/editing.js +60 -7
  86. package/dist/node/runtime/node/community/local-community/editing.js.map +1 -1
  87. package/dist/node/runtime/node/community/local-community/publication-validation.js +41 -17
  88. package/dist/node/runtime/node/community/local-community/publication-validation.js.map +1 -1
  89. package/dist/node/runtime/node/polyfill.js +3 -1
  90. package/dist/node/runtime/node/polyfill.js.map +1 -1
  91. package/dist/node/schema/schema-util.d.ts +82 -0
  92. package/dist/node/schema.d.ts +256 -0
  93. package/dist/node/signer/signatures.js +18 -6
  94. package/dist/node/signer/signatures.js.map +1 -1
  95. package/dist/node/test/test-util.d.ts +40 -0
  96. package/dist/node/version.js +1 -1
  97. package/package.json +18 -18
  98. package/dist/bundled/chunks/node-DFp6m62Y.js +0 -9770
@@ -1,10 +1,10 @@
1
1
  import { i as __toESM, n as __exportAll, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
2
2
  import { t as all } from "./src-CYIMjhjK.js";
3
3
  import { n as peekable, t as map } from "./src-Cpx2Sts8.js";
4
- import { i as first, n as src_exports$2 } from "./src-BOzgM7Fp.js";
4
+ import { i as first, n as src_exports$2 } from "./src-evzEHW9W.js";
5
5
  import http from "node:http";
6
- import { Buffer as Buffer$1 } from "node:buffer";
7
6
  import { webcrypto } from "node:crypto";
7
+ import { Buffer as Buffer$1 } from "node:buffer";
8
8
  import { CID } from "multiformats/cid";
9
9
  import { peerIdFromString } from "@libp2p/peer-id";
10
10
  import { toString } from "uint8arrays/to-string";
@@ -181,6 +181,9 @@ const maxUInt32 = 2 ** 31;
181
181
  * @typedef {import('./interface.js').RawPBNode} RawPBNode
182
182
  */
183
183
  /**
184
+ * @typedef {import('./interface.js').EncodeOptions} EncodeOptions
185
+ */
186
+ /**
184
187
  * encodeLink() is passed a slice of the parent byte array that ends where this
185
188
  * link needs to end, so it packs to the right-most part of the passed `bytes`
186
189
  *
@@ -212,27 +215,38 @@ function encodeLink(link, bytes) {
212
215
  return bytes.length - i;
213
216
  }
214
217
  /**
218
+ * @param {number} i
219
+ * @param {RawPBNode} node
220
+ * @param {Uint8Array} bytes
221
+ * @returns number
222
+ */
223
+ function encodeData(i, node, bytes) {
224
+ i -= node.Data.length;
225
+ bytes.set(node.Data, i);
226
+ i = encodeVarint(bytes, i, node.Data.length) - 1;
227
+ bytes[i] = 10;
228
+ return i;
229
+ }
230
+ /**
215
231
  * Encodes a PBNode into a new byte array of precisely the correct size
216
232
  *
217
233
  * @param {RawPBNode} node
234
+ * @param {EncodeOptions} [options]
218
235
  * @returns {Uint8Array}
219
236
  */
220
- function encodeNode(node) {
237
+ function encodeNode(node, options) {
221
238
  const size = sizeNode(node);
222
239
  const bytes = new Uint8Array(size);
223
240
  let i = size;
224
- if (node.Data) {
225
- i -= node.Data.length;
226
- bytes.set(node.Data, i);
227
- i = encodeVarint(bytes, i, node.Data.length) - 1;
228
- bytes[i] = 10;
229
- }
241
+ const fieldOrder = options?.fieldOrder === "data-first" ? options.fieldOrder : "links-first";
242
+ if (node.Data && fieldOrder === "links-first") i = encodeData(i, node, bytes);
230
243
  if (node.Links) for (let index = node.Links.length - 1; index >= 0; index--) {
231
244
  const size = encodeLink(node.Links[index], bytes.subarray(0, i));
232
245
  i -= size;
233
246
  i = encodeVarint(bytes, i, size) - 1;
234
247
  bytes[i] = 18;
235
248
  }
249
+ if (node.Data && fieldOrder === "data-first") i = encodeData(i, node, bytes);
236
250
  return bytes;
237
251
  }
238
252
  /**
@@ -757,13 +771,16 @@ var src_exports = /* @__PURE__ */ __exportAll({
757
771
  /**
758
772
  * @typedef {import('./interface.js').PBLink} PBLink
759
773
  * @typedef {import('./interface.js').PBNode} PBNode
774
+ * @typedef {import('./interface.js').FieldOrder} FieldOrder
775
+ * @typedef {import('./interface.js').EncodeOptions} EncodeOptions
760
776
  */
761
777
  const name = "dag-pb";
762
778
  /**
763
779
  * @param {PBNode} node
780
+ * @param {EncodeOptions} [options]
764
781
  * @returns {ByteView<PBNode>}
765
782
  */
766
- function encode(node) {
783
+ function encode(node, options) {
767
784
  validate(node);
768
785
  const pbn = {};
769
786
  if (node.Links) pbn.Links = node.Links.map((l) => {
@@ -774,7 +791,7 @@ function encode(node) {
774
791
  return link;
775
792
  });
776
793
  if (node.Data) pbn.Data = node.Data;
777
- return encodeNode(pbn);
794
+ return encodeNode(pbn, options);
778
795
  }
779
796
  /**
780
797
  * @param {ByteView<PBNode> | ArrayBufferView<PBNode>} bytes
@@ -7053,6 +7053,8 @@ var messages;
7053
7053
  messages["ERR_COMMENT_SHOULD_BE_THE_LATEST_EDIT"] = "comment.content is not set to the latest comment.authorEdit.content";
7054
7054
  messages["ERR_COMMENT_UPDATE_IS_NOT_SIGNED_BY_COMMUNITY"] = "Comment update is not signed by the community";
7055
7055
  messages["ERR_AUTHOR_EDIT_IS_NOT_SIGNED_BY_AUTHOR"] = "Author edit is not signed by original author of comment";
7056
+ messages["ERR_COMMENT_UPDATE_EDIT_INCLUDES_FIELD_NOT_IN_SIGNED_PROPERTY_NAMES"] = "The author edit of comment (commentUpdate.edit) includes a field that is not in commentUpdate.edit.signature.signedPropertyNames";
7057
+ messages["ERR_COMMENT_UPDATE_EDIT_IS_FOR_A_DIFFERENT_COMMENT"] = "The author edit of comment (commentUpdate.edit) is an edit of a different comment: commentUpdate.edit.commentCid !== commentUpdate.cid";
7056
7058
  messages["ERR_COMMENT_UPDATE_DIFFERENT_CID_THAN_COMMENT"] = "CommentUpdate.cid is different than calculated or provided comment.cid";
7057
7059
  messages["ERR_PAGE_COMMENT_POST_HAS_POST_CID_DEFINED_WITH_DEPTH_0"] = "pageComment.comment.postCid is defined even though depth = 0, comments in page need to adhere to strict CommentIpfs and CommentUpdate props";
7058
7060
  messages["ERR_CHALLENGE_MSG_SIGNER_IS_NOT_COMMUNITY"] = "The signer of challenge pubsub message is not the community";
@@ -7169,10 +7171,16 @@ var messages;
7169
7171
  messages["ERR_COMMENT_HAS_LINK_THAT_IS_AUDIO"] = "This community does not allow comments with audio links";
7170
7172
  messages["ERR_REPLY_HAS_LINK_THAT_IS_AUDIO"] = "This community does not allow replies with audio links";
7171
7173
  messages["ERR_REPLY_HAS_LINK"] = "This community does not allow replies with links";
7174
+ messages["ERR_POST_GALLERY_NOT_ALLOWED"] = "This community does not allow posts with a gallery";
7175
+ messages["ERR_REPLY_GALLERY_NOT_ALLOWED"] = "This community does not allow replies with a gallery";
7176
+ messages["ERR_POST_GALLERY_EXCEEDS_MAX_ITEMS"] = "The post's gallery has more items than this community's features.maxPostGalleryItems";
7177
+ messages["ERR_REPLY_GALLERY_EXCEEDS_MAX_ITEMS"] = "The reply's gallery has more items than this community's features.maxReplyGalleryItems";
7178
+ messages["ERR_GALLERY_ITEM_NOT_MEDIA"] = "Every gallery item url must be an https url with an image, video or audio file extension";
7179
+ messages["ERR_GALLERY_ITEM_HTML_TAG_NAME_MISMATCH"] = "A gallery item's htmlTagName does not match its url's media type (img for image, video for video, audio for audio)";
7172
7180
  messages["ERR_COMMENT_CONTENT_CONTAINS_MARKDOWN_AUDIO"] = "This community does not allow embedding audio in markdown content";
7173
7181
  messages["ERR_REPLY_HAS_SPOILER_ENABLED"] = "This community does not allow authors to mark replies as spoilers";
7174
7182
  messages["ERR_NESTED_REPLIES_NOT_ALLOWED"] = "This community does not allow nested replies (depth > 1)";
7175
- messages["ERR_COMMENT_HAS_NO_CONTENT_LINK_TITLE"] = "Comment has no content, link, title or crosspost";
7183
+ messages["ERR_COMMENT_HAS_NO_CONTENT_LINK_TITLE"] = "Comment has no content, link, title, crosspost or gallery";
7176
7184
  messages["ERR_COMMENT_EDIT_HAS_NO_EDIT_FIELD"] = "CommentEdit has no editable field. At least one of content, deleted, flairs, spoiler or nsfw must be defined";
7177
7185
  messages["ERR_COMMENT_MODERATION_HAS_NO_MODERATION_FIELD"] = "CommentModeration has no moderation field. At least one moderation field other than reason must be defined";
7178
7186
  messages["ERR_REQUEST_ENCRYPTED_IS_INVALID_JSON_AFTER_DECRYPTION"] = "request.encrypted is an invalid json after decrypting";
@@ -8143,6 +8151,17 @@ const CrosspostSchema = object({
8143
8151
  cid: CidStringSchema,
8144
8152
  comment: lazy(() => CommentIpfsSchema.loose())
8145
8153
  });
8154
+ const CommentGalleryItemSchema = looseObject({
8155
+ url: string().min(1).max(2e3),
8156
+ htmlTagName: _enum([
8157
+ "img",
8158
+ "video",
8159
+ "audio"
8160
+ ]),
8161
+ width: number().positive().optional(),
8162
+ height: number().positive().optional(),
8163
+ alt: string().max(1e3).optional()
8164
+ });
8146
8165
  const CreateCommentOptionsSchema = object({
8147
8166
  flairs: FlairSchema.array().optional(),
8148
8167
  spoiler: boolean().optional(),
@@ -8156,15 +8175,17 @@ const CreateCommentOptionsSchema = object({
8156
8175
  parentCid: CidStringSchema.optional(),
8157
8176
  postCid: CidStringSchema.optional(),
8158
8177
  quotedCids: array(CidStringSchema).optional(),
8159
- crosspost: CrosspostSchema.optional()
8178
+ crosspost: CrosspostSchema.optional(),
8179
+ gallery: CommentGalleryItemSchema.array().min(1).optional()
8160
8180
  }).merge(CreatePublicationUserOptionsSchema).strict();
8161
- const CreateCommentOptionsWithRefinementSchema = CreateCommentOptionsSchema.refine((arg) => arg.link || arg.content || arg.title || arg.crosspost, messages.ERR_COMMENT_HAS_NO_CONTENT_LINK_TITLE).refine((arg) => arg.parentCid ? arg.postCid : true, messages.ERR_REPLY_HAS_NOT_DEFINED_POST_CID).refine(hasAtLeastOneCommunityIdentifier, atLeastOneCommunityIdentifierMessage);
8181
+ const commentHasPayload = (arg) => Boolean(arg.link || arg.content || arg.title || arg.crosspost || arg.gallery);
8182
+ const CreateCommentOptionsWithRefinementSchema = CreateCommentOptionsSchema.refine(commentHasPayload, messages.ERR_COMMENT_HAS_NO_CONTENT_LINK_TITLE).refine((arg) => arg.parentCid ? arg.postCid : true, messages.ERR_REPLY_HAS_NOT_DEFINED_POST_CID).refine(hasAtLeastOneCommunityIdentifier, atLeastOneCommunityIdentifierMessage);
8162
8183
  const CommentSignedPropertyNames = t$3(n$3(CreateCommentOptionsSchema.shape, keysToOmitFromSignedPropertyNames));
8163
8184
  const commentPubsubKeys = t$2([...CommentSignedPropertyNames, "signature"], (x) => [x, true]);
8164
8185
  const CommentPubsubMessagePublicationSchema = CreateCommentOptionsSchema.merge(PublicationBaseBeforeSigning).extend({ signature: JsonSignatureSchema }).pick(commentPubsubKeys).strict();
8165
8186
  const CommentPubsubMessageWithFlexibleAuthorSchema = CommentPubsubMessagePublicationSchema.merge(object({ author: AuthorPubsubSchema.loose().optional() })).strict();
8166
- const CommentPubsubMessageWithFlexibleAuthorRefinementSchema = CommentPubsubMessageWithFlexibleAuthorSchema.loose().refine((arg) => arg.link || arg.content || arg.title || arg.crosspost, messages.ERR_COMMENT_HAS_NO_CONTENT_LINK_TITLE);
8167
- CommentPubsubMessagePublicationSchema.refine((arg) => arg.link || arg.content || arg.title || arg.crosspost, messages.ERR_COMMENT_HAS_NO_CONTENT_LINK_TITLE).refine((arg) => arg.parentCid ? arg.postCid : true, messages.ERR_REPLY_HAS_NOT_DEFINED_POST_CID);
8187
+ const CommentPubsubMessageWithFlexibleAuthorRefinementSchema = CommentPubsubMessageWithFlexibleAuthorSchema.loose().refine(commentHasPayload, messages.ERR_COMMENT_HAS_NO_CONTENT_LINK_TITLE);
8188
+ CommentPubsubMessagePublicationSchema.refine(commentHasPayload, messages.ERR_COMMENT_HAS_NO_CONTENT_LINK_TITLE).refine((arg) => arg.parentCid ? arg.postCid : true, messages.ERR_REPLY_HAS_NOT_DEFINED_POST_CID);
8168
8189
  const CommentChallengeRequestToEncryptSchema = CreateCommentOptionsSchema.shape.challengeRequest.unwrap().extend({ comment: CommentPubsubMessageWithFlexibleAuthorSchema.loose() }).strict();
8169
8190
  const CommentIpfsSchema = CommentPubsubMessageWithFlexibleAuthorSchema.extend({
8170
8191
  depth: number().nonnegative().int(),
@@ -8178,7 +8199,7 @@ const CommentIpfsSchema = CommentPubsubMessageWithFlexibleAuthorSchema.extend({
8178
8199
  "per-author"
8179
8200
  ]).optional()
8180
8201
  }).strict();
8181
- CommentIpfsSchema.refine((arg) => arg.link || arg.content || arg.title || arg.crosspost, messages.ERR_COMMENT_HAS_NO_CONTENT_LINK_TITLE);
8202
+ CommentIpfsSchema.refine(commentHasPayload, messages.ERR_COMMENT_HAS_NO_CONTENT_LINK_TITLE);
8182
8203
  const AuthorWithCommentUpdateSchema = CommentPubsubMessagePublicationSchema.shape.author.unwrap().extend({ community: CommunityAuthorSchema.optional() }).loose();
8183
8204
  const CommentUpdateSchema = object({
8184
8205
  cid: CidStringSchema,
@@ -16141,6 +16162,8 @@ const CommunityFeaturesSchema = looseObject({
16141
16162
  requirePostLinkIsMedia: boolean().optional(),
16142
16163
  requireReplyLink: boolean().optional(),
16143
16164
  requireReplyLinkIsMedia: boolean().optional(),
16165
+ maxPostGalleryItems: number().int().nonnegative().optional(),
16166
+ maxReplyGalleryItems: number().int().nonnegative().optional(),
16144
16167
  pseudonymityMode: _enum([
16145
16168
  "per-post",
16146
16169
  "per-reply",
@@ -16526,14 +16549,14 @@ const CommunityEditPublicationPubsubReservedFields = r$2([
16526
16549
  ], t$3(CommunityEditPubsubMessagePublicationSchema.shape));
16527
16550
  //#endregion
16528
16551
  //#region dist/node/generated-version.js
16529
- const version = "0.0.131";
16552
+ const version = "0.0.133";
16530
16553
  //#endregion
16531
16554
  //#region dist/node/version.js
16532
16555
  const protocolVersion = ProtocolVersionSchema.parse("1.0.0");
16533
16556
  const pkcJsVersion = version;
16534
16557
  var version_default = {
16535
16558
  PKC_JS_VERSION: pkcJsVersion,
16536
- DB_VERSION: 44,
16559
+ DB_VERSION: 45,
16537
16560
  PROTOCOL_VERSION: protocolVersion,
16538
16561
  USER_AGENT: UserAgentSchema.parse(`/pkc-js:${pkcJsVersion}/`)
16539
16562
  };
@@ -18284,7 +18307,7 @@ function calculateStringSizeSameAsIpfsAddCidV0Sync(content) {
18284
18307
  }
18285
18308
  async function calculateStringSizeSameAsIpfsAddCidV0(content) {
18286
18309
  const { MemoryBlockstore } = await import("blockstore-core");
18287
- const { importFile } = await import("./src-B07ldGHS.js");
18310
+ const { importFile } = await import("./src-BggJ_InF.js");
18288
18311
  const blockstore = new MemoryBlockstore();
18289
18312
  const entry = await importFile({
18290
18313
  path: "content.json",
@@ -1,4 +1,4 @@
1
- import { B as pubsubTopicToDhtKeyCid, Lr as PKCError } from "./util-CaL93qd4.js";
1
+ import { B as pubsubTopicToDhtKeyCid, Lr as PKCError } from "./util-Bna9pur0.js";
2
2
  import { ipnsSelector } from "ipns/selector";
3
3
  import { ipnsValidator } from "ipns/validator";
4
4
  import { unmarshalIPNSRecord } from "ipns";
@@ -1,5 +1,5 @@
1
- import { Lr as PKCError, on as ChallengeFileFactorySchema, sn as ChallengeFileSchema, yn as PageSortFileFactorySchema } from "./util-CaL93qd4.js";
2
- import { s as validatePageSortFile } from "./page-sort-scoring-CaoGFyhT.js";
1
+ import { Lr as PKCError, on as ChallengeFileFactorySchema, sn as ChallengeFileSchema, yn as PageSortFileFactorySchema } from "./util-Bna9pur0.js";
2
+ import { s as validatePageSortFile } from "./page-sort-scoring-iqMGLuRC.js";
3
3
  //#region dist/node/validate-package-factories.js
4
4
  function validateChallengeFileFactory(factory, { name }) {
5
5
  try {
@@ -1,2 +1,2 @@
1
- import { a as getShortCid, c as setNativeFunctions, i as getShortAddress, n as challenges, o as nativeFunctions, r as createAnchorIpnsRecord, s as pageSorts, t as PKC } from "./chunks/node-DFp6m62Y.js";
1
+ import { a as getShortCid, c as setNativeFunctions, i as getShortAddress, n as challenges, o as nativeFunctions, r as createAnchorIpnsRecord, s as pageSorts, t as PKC } from "./chunks/node-DsWFSaNV.js";
2
2
  export { challenges, createAnchorIpnsRecord, PKC as default, getShortAddress, getShortCid, nativeFunctions, pageSorts, setNativeFunctions };
@@ -1,2 +1,2 @@
1
- import { n as validatePageSortFileFactory } from "./chunks/validate-package-factories-DWI4TSli.js";
1
+ import { n as validatePageSortFileFactory } from "./chunks/validate-package-factories-FeyM9Tw1.js";
2
2
  export { validatePageSortFileFactory };
@@ -1,7 +1,7 @@
1
- import { $ as retryKuboIpfsAddAndProvide, C as hideClassPrivateProps, Lr as PKCError, Y as replaceXWithY, br as t, dt as findStartedCommunity, i as calculateStringSizeSameAsIpfsAddCidV0, kt as pTimeout, vr as n, zr as logger_default } from "../../chunks/util-CaL93qd4.js";
2
- import { S as parseRpcUnsubscribeParam, _ as parseRpcExportCommunityParam, b as parseRpcPublishChallengeAnswersParam, d as parseRpcCidParam, f as parseRpcCommentRepliesPageParam, g as parseRpcExportCommunityModLogsParam, h as parseRpcEditCommunityParam, l as parseRpcAuthorNameParam, m as parseRpcCommunityPageParam, p as parseRpcCommunityIdentifierParam, t as PKC, u as parseRpcCancelExportParam, v as parseRpcFetchCommunityListParam, x as parseRpcPublishCommunityListParam, y as parseRpcPublishAnchorRecordParam } from "../../chunks/node-DFp6m62Y.js";
3
- import { Dt as parseJsonWithPKCErrorIfFails, E as buildPagesRuntimeFields, Gr as stringify, L as extractCrosspostRuntimeFields, Mt as parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, Pr as toCommunitiesWireEntry, Rr as t$1, T as buildPageRuntimeFields, Tr as listCommunitiesSync, U as pRetry, Vn as verifyCommunityList, W as pLimit, Xn as MAX_COMMUNITY_LIST_SIZE_BYTES, at as parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, br as findLocalCommunityAddress, bt as parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails, dt as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, jt as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, mt as parseCommunityListSchemaWithPKCErrorIfItFails, nt as parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, sn as require_lib, tt as parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, ut as parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, wt as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, yt as parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails } from "../../chunks/rpc-local-community-BXt7eK9l.js";
4
- import { t as LocalCommunity } from "../../chunks/local-community-RlYLG5QV.js";
1
+ import { $ as retryKuboIpfsAddAndProvide, C as hideClassPrivateProps, Lr as PKCError, Y as replaceXWithY, br as t, dt as findStartedCommunity, i as calculateStringSizeSameAsIpfsAddCidV0, kt as pTimeout, vr as n, zr as logger_default } from "../../chunks/util-Bna9pur0.js";
2
+ import { S as parseRpcUnsubscribeParam, _ as parseRpcExportCommunityParam, b as parseRpcPublishChallengeAnswersParam, d as parseRpcCidParam, f as parseRpcCommentRepliesPageParam, g as parseRpcExportCommunityModLogsParam, h as parseRpcEditCommunityParam, l as parseRpcAuthorNameParam, m as parseRpcCommunityPageParam, p as parseRpcCommunityIdentifierParam, t as PKC, u as parseRpcCancelExportParam, v as parseRpcFetchCommunityListParam, x as parseRpcPublishCommunityListParam, y as parseRpcPublishAnchorRecordParam } from "../../chunks/node-DsWFSaNV.js";
3
+ import { Dt as parseJsonWithPKCErrorIfFails, E as buildPagesRuntimeFields, Gr as stringify, L as extractCrosspostRuntimeFields, Mt as parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, Pr as toCommunitiesWireEntry, Rr as t$1, T as buildPageRuntimeFields, Tr as listCommunitiesSync, U as pRetry, Vn as verifyCommunityList, W as pLimit, Xn as MAX_COMMUNITY_LIST_SIZE_BYTES, at as parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, br as findLocalCommunityAddress, bt as parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails, dt as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, jt as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, mt as parseCommunityListSchemaWithPKCErrorIfItFails, nt as parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, sn as require_lib, tt as parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, ut as parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, wt as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, yt as parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails } from "../../chunks/rpc-local-community-jndojGZl.js";
4
+ import { t as LocalCommunity } from "../../chunks/local-community-JxRohlLp.js";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import path from "path";
7
7
  import assert from "assert";
@@ -87,6 +87,8 @@ export declare const parseRpcEditCommunityParam: (params: unknown) => {
87
87
  requirePostLinkIsMedia?: boolean | undefined;
88
88
  requireReplyLink?: boolean | undefined;
89
89
  requireReplyLinkIsMedia?: boolean | undefined;
90
+ maxPostGalleryItems?: number | undefined;
91
+ maxReplyGalleryItems?: number | undefined;
90
92
  pseudonymityMode?: "per-post" | "per-reply" | "per-author" | undefined;
91
93
  } | undefined;
92
94
  suggested?: {
@@ -31,6 +31,17 @@ export declare const RpcCommentEventResultSchema: z.ZodObject<{
31
31
  postCid: z.ZodOptional<z.ZodString>;
32
32
  quotedCids: z.ZodOptional<z.ZodArray<z.ZodString>>;
33
33
  crosspost: z.ZodOptional<z.ZodType<import("../../publications/comment/schema.js").Crosspost, import("../../publications/comment/schema.js").Crosspost, z.core.$ZodTypeInternals<import("../../publications/comment/schema.js").Crosspost, import("../../publications/comment/schema.js").Crosspost>>>;
34
+ gallery: z.ZodOptional<z.ZodArray<z.ZodObject<{
35
+ url: z.ZodString;
36
+ htmlTagName: z.ZodEnum<{
37
+ img: "img";
38
+ video: "video";
39
+ audio: "audio";
40
+ }>;
41
+ width: z.ZodOptional<z.ZodNumber>;
42
+ height: z.ZodOptional<z.ZodNumber>;
43
+ alt: z.ZodOptional<z.ZodString>;
44
+ }, z.core.$loose>>>;
34
45
  author: z.ZodOptional<z.ZodObject<{
35
46
  name: z.ZodOptional<z.ZodString>;
36
47
  previousCommentCid: z.ZodOptional<z.ZodString>;
@@ -212,6 +223,17 @@ export declare const RpcCommentUpdateResultSchema: z.ZodObject<{
212
223
  postCid: z.ZodOptional<z.ZodString>;
213
224
  quotedCids: z.ZodOptional<z.ZodArray<z.ZodString>>;
214
225
  crosspost: z.ZodOptional<z.ZodType<import("../../publications/comment/schema.js").Crosspost, import("../../publications/comment/schema.js").Crosspost, z.core.$ZodTypeInternals<import("../../publications/comment/schema.js").Crosspost, import("../../publications/comment/schema.js").Crosspost>>>;
226
+ gallery: z.ZodOptional<z.ZodArray<z.ZodObject<{
227
+ url: z.ZodString;
228
+ htmlTagName: z.ZodEnum<{
229
+ img: "img";
230
+ video: "video";
231
+ audio: "audio";
232
+ }>;
233
+ width: z.ZodOptional<z.ZodNumber>;
234
+ height: z.ZodOptional<z.ZodNumber>;
235
+ alt: z.ZodOptional<z.ZodString>;
236
+ }, z.core.$loose>>>;
215
237
  author: z.ZodOptional<z.ZodObject<{
216
238
  name: z.ZodOptional<z.ZodString>;
217
239
  previousCommentCid: z.ZodOptional<z.ZodString>;
@@ -356,6 +378,8 @@ export declare const RpcEditCommunityParamSchema: z.ZodObject<{
356
378
  requirePostLinkIsMedia: z.ZodOptional<z.ZodBoolean>;
357
379
  requireReplyLink: z.ZodOptional<z.ZodBoolean>;
358
380
  requireReplyLinkIsMedia: z.ZodOptional<z.ZodBoolean>;
381
+ maxPostGalleryItems: z.ZodOptional<z.ZodNumber>;
382
+ maxReplyGalleryItems: z.ZodOptional<z.ZodNumber>;
359
383
  pseudonymityMode: z.ZodOptional<z.ZodEnum<{
360
384
  "per-post": "per-post";
361
385
  "per-reply": "per-reply";