@pkcprotocol/pkc-js 0.0.83 → 0.0.85

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 (154) hide show
  1. package/README.md +16 -0
  2. package/dist/browser/clients/rpc-client/rpc-schema-util.d.ts +1 -0
  3. package/dist/browser/clients/rpc-client/schema.d.ts +1 -0
  4. package/dist/browser/community/rpc-remote-community.js +15 -8
  5. package/dist/browser/community/rpc-remote-community.js.map +1 -1
  6. package/dist/browser/community/schema.d.ts +106 -2
  7. package/dist/browser/community/schema.js +28 -7
  8. package/dist/browser/community/schema.js.map +1 -1
  9. package/dist/browser/errors.d.ts +9 -1
  10. package/dist/browser/errors.js +11 -0
  11. package/dist/browser/errors.js.map +1 -1
  12. package/dist/browser/generated-version.d.ts +1 -1
  13. package/dist/browser/generated-version.js +1 -1
  14. package/dist/browser/index-with-compile-cache.d.ts +88 -2
  15. package/dist/browser/index.d.ts +88 -2
  16. package/dist/browser/pkc/pkc-with-rpc-client.d.ts +5 -3
  17. package/dist/browser/pkc/pkc-with-rpc-client.js +45 -7
  18. package/dist/browser/pkc/pkc-with-rpc-client.js.map +1 -1
  19. package/dist/browser/pkc/pkc.d.ts +6 -3
  20. package/dist/browser/pkc/pkc.js +71 -9
  21. package/dist/browser/pkc/pkc.js.map +1 -1
  22. package/dist/browser/pkc-error.d.ts +1 -1
  23. package/dist/browser/publications/comment/schema.d.ts +1 -1
  24. package/dist/browser/publications/comment/schema.js +5 -1
  25. package/dist/browser/publications/comment/schema.js.map +1 -1
  26. package/dist/browser/publications/community-edit/schema.d.ts +4 -0
  27. package/dist/browser/publications/publication-client-manager.js +10 -2
  28. package/dist/browser/publications/publication-client-manager.js.map +1 -1
  29. package/dist/browser/publications/publication.d.ts +4 -0
  30. package/dist/browser/publications/publication.js +36 -2
  31. package/dist/browser/publications/publication.js.map +1 -1
  32. package/dist/browser/pubsub-messages/schema.d.ts +2 -0
  33. package/dist/browser/rpc/src/index.js +4 -1
  34. package/dist/browser/rpc/src/index.js.map +1 -1
  35. package/dist/browser/rpc/src/lib/pkc-js/index.d.ts +44 -1
  36. package/dist/browser/rpc/src/schema.d.ts +265 -7
  37. package/dist/browser/rpc/src/schema.js +4 -2
  38. package/dist/browser/rpc/src/schema.js.map +1 -1
  39. package/dist/browser/runtime/node/community/challenges/exclude/exclude.d.ts +2 -2
  40. package/dist/browser/runtime/node/community/challenges/exclude/exclude.js +5 -1
  41. package/dist/browser/runtime/node/community/challenges/exclude/exclude.js.map +1 -1
  42. package/dist/browser/runtime/node/community/challenges/index.d.ts +7 -3
  43. package/dist/browser/runtime/node/community/challenges/index.js +29 -6
  44. package/dist/browser/runtime/node/community/challenges/index.js.map +1 -1
  45. package/dist/browser/runtime/node/community/challenges/pkc-js-challenges/address-list-validation.d.ts +4 -0
  46. package/dist/browser/runtime/node/community/challenges/pkc-js-challenges/address-list-validation.js +27 -0
  47. package/dist/browser/runtime/node/community/challenges/pkc-js-challenges/address-list-validation.js.map +1 -0
  48. package/dist/browser/runtime/node/community/challenges/pkc-js-challenges/blacklist.js +2 -1
  49. package/dist/browser/runtime/node/community/challenges/pkc-js-challenges/blacklist.js.map +1 -1
  50. package/dist/browser/runtime/node/community/challenges/pkc-js-challenges/publication-match.js +34 -1
  51. package/dist/browser/runtime/node/community/challenges/pkc-js-challenges/publication-match.js.map +1 -1
  52. package/dist/browser/runtime/node/community/challenges/pkc-js-challenges/question.js +8 -1
  53. package/dist/browser/runtime/node/community/challenges/pkc-js-challenges/question.js.map +1 -1
  54. package/dist/browser/runtime/node/community/challenges/pkc-js-challenges/whitelist.js +2 -1
  55. package/dist/browser/runtime/node/community/challenges/pkc-js-challenges/whitelist.js.map +1 -1
  56. package/dist/browser/runtime/node/community/challenges/validate-challenge-settings.d.ts +22 -0
  57. package/dist/browser/runtime/node/community/challenges/validate-challenge-settings.js +92 -0
  58. package/dist/browser/runtime/node/community/challenges/validate-challenge-settings.js.map +1 -0
  59. package/dist/browser/runtime/node/community/db-handler.d.ts +1 -0
  60. package/dist/browser/runtime/node/community/local-community/db-state.js +8 -0
  61. package/dist/browser/runtime/node/community/local-community/db-state.js.map +1 -1
  62. package/dist/browser/runtime/node/community/local-community/editing.js +8 -0
  63. package/dist/browser/runtime/node/community/local-community/editing.js.map +1 -1
  64. package/dist/browser/runtime/node/community/local-community/lifecycle.js +29 -0
  65. package/dist/browser/runtime/node/community/local-community/lifecycle.js.map +1 -1
  66. package/dist/browser/schema/schema-util.d.ts +9 -0
  67. package/dist/browser/schema.d.ts +352 -8
  68. package/dist/browser/test/test-util.d.ts +2 -0
  69. package/dist/browser/types.d.ts +5 -0
  70. package/dist/browser/util.d.ts +20 -1
  71. package/dist/browser/util.js +100 -2
  72. package/dist/browser/util.js.map +1 -1
  73. package/dist/bundled/bundle-manifest.json +33 -31
  74. package/dist/bundled/chunks/{helia-for-pkc-BtjQ8rfd.js → helia-for-pkc-C5Oe_ZSx.js} +2 -2
  75. package/dist/bundled/chunks/{local-community-DJM47U8C.js → local-community-BqxmCg5p.js} +107 -2
  76. package/dist/bundled/chunks/{local-community-B_Yg8LQH.js → local-community-D4SjlAKS.js} +1 -1
  77. package/dist/bundled/chunks/{node-lb4SvdBh.js → node-C2DKW30L.js} +110 -22
  78. package/dist/bundled/chunks/{rpc-local-community-a464veDe.js → rpc-local-community-o0teUvw_.js} +91 -19
  79. package/dist/bundled/chunks/{schema-mdv9_FG5.js → schema-qhSDu1BU.js} +126 -10
  80. package/dist/bundled/chunks/{util-y9-A9BnM.js → util-BVGNNIgn.js} +1 -1
  81. package/dist/bundled/index.js +1 -1
  82. package/dist/bundled/rpc/src/index.js +5 -5
  83. package/dist/node/clients/rpc-client/rpc-schema-util.d.ts +1 -0
  84. package/dist/node/clients/rpc-client/schema.d.ts +1 -0
  85. package/dist/node/community/rpc-remote-community.js +15 -8
  86. package/dist/node/community/rpc-remote-community.js.map +1 -1
  87. package/dist/node/community/schema.d.ts +106 -2
  88. package/dist/node/community/schema.js +28 -7
  89. package/dist/node/community/schema.js.map +1 -1
  90. package/dist/node/errors.d.ts +9 -1
  91. package/dist/node/errors.js +11 -0
  92. package/dist/node/errors.js.map +1 -1
  93. package/dist/node/generated-version.d.ts +1 -1
  94. package/dist/node/generated-version.js +1 -1
  95. package/dist/node/index-with-compile-cache.d.ts +88 -2
  96. package/dist/node/index.d.ts +88 -2
  97. package/dist/node/pkc/pkc-with-rpc-client.d.ts +5 -3
  98. package/dist/node/pkc/pkc-with-rpc-client.js +45 -7
  99. package/dist/node/pkc/pkc-with-rpc-client.js.map +1 -1
  100. package/dist/node/pkc/pkc.d.ts +6 -3
  101. package/dist/node/pkc/pkc.js +71 -9
  102. package/dist/node/pkc/pkc.js.map +1 -1
  103. package/dist/node/pkc-error.d.ts +1 -1
  104. package/dist/node/publications/comment/schema.d.ts +1 -1
  105. package/dist/node/publications/comment/schema.js +5 -1
  106. package/dist/node/publications/comment/schema.js.map +1 -1
  107. package/dist/node/publications/community-edit/schema.d.ts +4 -0
  108. package/dist/node/publications/publication-client-manager.js +10 -2
  109. package/dist/node/publications/publication-client-manager.js.map +1 -1
  110. package/dist/node/publications/publication.d.ts +4 -0
  111. package/dist/node/publications/publication.js +36 -2
  112. package/dist/node/publications/publication.js.map +1 -1
  113. package/dist/node/pubsub-messages/schema.d.ts +2 -0
  114. package/dist/node/rpc/src/index.js +4 -1
  115. package/dist/node/rpc/src/index.js.map +1 -1
  116. package/dist/node/rpc/src/lib/pkc-js/index.d.ts +44 -1
  117. package/dist/node/rpc/src/schema.d.ts +265 -7
  118. package/dist/node/rpc/src/schema.js +4 -2
  119. package/dist/node/rpc/src/schema.js.map +1 -1
  120. package/dist/node/runtime/node/community/challenges/exclude/exclude.d.ts +2 -2
  121. package/dist/node/runtime/node/community/challenges/exclude/exclude.js +5 -1
  122. package/dist/node/runtime/node/community/challenges/exclude/exclude.js.map +1 -1
  123. package/dist/node/runtime/node/community/challenges/index.d.ts +7 -3
  124. package/dist/node/runtime/node/community/challenges/index.js +29 -6
  125. package/dist/node/runtime/node/community/challenges/index.js.map +1 -1
  126. package/dist/node/runtime/node/community/challenges/pkc-js-challenges/address-list-validation.d.ts +4 -0
  127. package/dist/node/runtime/node/community/challenges/pkc-js-challenges/address-list-validation.js +27 -0
  128. package/dist/node/runtime/node/community/challenges/pkc-js-challenges/address-list-validation.js.map +1 -0
  129. package/dist/node/runtime/node/community/challenges/pkc-js-challenges/blacklist.js +2 -1
  130. package/dist/node/runtime/node/community/challenges/pkc-js-challenges/blacklist.js.map +1 -1
  131. package/dist/node/runtime/node/community/challenges/pkc-js-challenges/publication-match.js +34 -1
  132. package/dist/node/runtime/node/community/challenges/pkc-js-challenges/publication-match.js.map +1 -1
  133. package/dist/node/runtime/node/community/challenges/pkc-js-challenges/question.js +8 -1
  134. package/dist/node/runtime/node/community/challenges/pkc-js-challenges/question.js.map +1 -1
  135. package/dist/node/runtime/node/community/challenges/pkc-js-challenges/whitelist.js +2 -1
  136. package/dist/node/runtime/node/community/challenges/pkc-js-challenges/whitelist.js.map +1 -1
  137. package/dist/node/runtime/node/community/challenges/validate-challenge-settings.d.ts +22 -0
  138. package/dist/node/runtime/node/community/challenges/validate-challenge-settings.js +92 -0
  139. package/dist/node/runtime/node/community/challenges/validate-challenge-settings.js.map +1 -0
  140. package/dist/node/runtime/node/community/db-handler.d.ts +1 -0
  141. package/dist/node/runtime/node/community/local-community/db-state.js +8 -0
  142. package/dist/node/runtime/node/community/local-community/db-state.js.map +1 -1
  143. package/dist/node/runtime/node/community/local-community/editing.js +8 -0
  144. package/dist/node/runtime/node/community/local-community/editing.js.map +1 -1
  145. package/dist/node/runtime/node/community/local-community/lifecycle.js +29 -0
  146. package/dist/node/runtime/node/community/local-community/lifecycle.js.map +1 -1
  147. package/dist/node/schema/schema-util.d.ts +9 -0
  148. package/dist/node/schema.d.ts +352 -8
  149. package/dist/node/test/test-util.d.ts +2 -0
  150. package/dist/node/types.d.ts +5 -0
  151. package/dist/node/util.d.ts +20 -1
  152. package/dist/node/util.js +100 -2
  153. package/dist/node/util.js.map +1 -1
  154. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
1
  import { i as __toESM, n as __exportAll, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
2
- import { $ as pubsubTopicToDhtKey, $n as n$9, $t as CommunityChallengeSettingSchema, A as extractNetworkErrorDetails, Ar as object, At as trackStartedCommunity, B as isIpfsCid, Cn as CommentUpdateChallengeReservedFieldNames, Ct as findUpdatingCommunity, D as deepMergeRuntimeFields, Dn as CommentUpdateSchema, Dr as custom, E as createAbortError, En as CommentUpdateReservedFields, Er as boolean, Et as listUpdatingCommunities, Fn as CommentEditChallengeRequestToEncryptSchema, Ft as untrackUpdatingCommunity, Gn as ChallengeAnswersSchema, Gt as CommentModerationPubsubMessagePublicationSchema, H as isIpns, Hn as AuthorAddressSchema, Ht as CommunityEditPubsubMessagePublicationSchema, I as getPostUpdateTimestampRange, It as require_sha256$1, Jn as CommunityAddressSchema, Jt as CommentModerationsTableRowSchema, Kn as CidPathSchema, L as hideClassPrivateProps, Ln as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, Mn as GetPageParamSchema, Mr as string, Mt as trackUpdatingCommunity, Nn as ModQueuePageIpfsSchema, Nt as untrackStartedCommunity, O as derivePublicationFromChallengeRequest, On as CommentUpdateSignedPropertyNames, Or as literal, Ot as refreshTrackedCommunityAliases, Pn as PageIpfsSchema, Pt as untrackUpdatingComment, Q as isStringDomain, R as ipnsNameToIpnsOverPubsubTopic, Rt as pTimeout, Sn as CommentSignedPropertyNames, Sr as require_ms$1, St as findUpdatingComment, Tn as CommentUpdateForChallengeVerificationSignedPropertyNames, Tr as array, U as isIpnsPath, Un as AuthorCommentIpfsReservedFields, Ut as CreateCommunityEditPublicationOptionsWithRefinementSchema, V as isIpfsPath, Vn as CreateCommentEditOptionsWithRefinementSchema, Vt as CommunityEditPublicationSignedPropertyNames, Wt as CommentModerationChallengeRequestToEncryptSchema, X as isRequestPubsubPublicationOfPost, Xn as CreateSignerSchema, Xt as ChallengeFileFactorySchema, Yn as CommunityAuthorChallengeReservedFieldNames, Yt as CreateCommentModerationOptionsWithRefinementSchema, Z as isRequestPubsubPublicationOfReply, Zn as n$10, Zt as ChallengeFileSchema, _ as PKCUserOptionBaseSchema, _n as CommentChallengeRequestToEncryptSchema, _r as FailedToFetchPageIpfsFromGatewaysError, _t as timestamp, an as CreateNewLocalCommunityUserOptionsSchema, ar as r$8, b as areEquivalentCommunityAddresses, br as logger_default, c as ChallengeVerificationMessageSignedPropertyNames, cn as ExportCommunityModLogsOptionsSchema, cr as r$7, ct as resolveWhenPredicateIsTrue, dn as CreateVoteUserOptionsWithRefinementSchema, dr as e$4, en as CommunityEditOptionsSchema, f as DecryptedChallengeSchema, fn as VoteChallengeRequestToEncryptSchema, fr as require_retry$1, ft as shortifyAddress, g as PKCParsedOptionsSchema, gr as FailedToFetchGenericIpfsFromGatewaysError, gt as throwIfAbortSignalAborted, h as NameResolverSerializedSchema, hn as VoteSignedPropertyNames, hr as FailedToFetchCommunityFromGatewaysError, i as ChallengeMessageSignedPropertyNames, in as CommunitySignedPropertyNames, ir as t$11, it as removeNullUndefinedEmptyObjectsValuesRecursively, j as fetchAndValidateIpnsRecordFromGateway, jn as CreateCommentOptionsWithRefinementSchema, jr as record, k as doesDomainAddressHaveCapitalLetter, kr as number, l as DecryptedChallengeAnswerSchema, lr as t$10, m as NameResolveCacheOptionsSchema, mr as FailedToFetchCommentUpdateFromGatewaysError, mt as sleepUntilTimeoutOrAbort, n as ChallengeAnswerMessageSignedPropertyNames, nn as CommunityIpfsReservedFields, nr as e$6, o as ChallengeRequestMessageSignedPropertyNames, on as CreateRemoteCommunityFunctionArgumentSchema, or as t$12, p as DecryptedChallengeVerificationSchema, pn as VotePubsubMessagePublicationSchema, pr as FailedToFetchCommentIpfsFromGatewaysError, pt as shortifyCid, qn as CidStringSchema, qt as CommentModerationSignedPropertyNames, rn as CommunityIpfsSchema, rr as e$5, sn as CreateRpcCommunityFunctionArgumentSchema, sr as n$8, tn as CommunityExportRecordsSchema, tr as t$13, tt as raceAgainstAbort, un as RpcRemoteCommunityUpdateEventResultSchema, ur as t$9, v as PKCUserOptionsSchema, vn as CommentIpfsReservedFields, vr as PKCError, vt as waitForUpdateInCommunityInstanceWithErrorAndTimeout, wr as _enum, wt as listStartedCommunities, x as calculateIpfsCidV0, xn as CommentPubsubMessageWithFlexibleAuthorRefinementSchema, xr as require_supports_color, xt as findStartedCommunity, yn as CommentIpfsSchema, yr as messages, z as isAbortError, zn as CommentEditSignedPropertyNames, zt as CommunityEditPublicationChallengeRequestToEncryptSchema } from "./schema-mdv9_FG5.js";
2
+ import { $ as pubsubTopicToDhtKey, $n as n$10, $t as ChallengeFileSchema, A as extractNetworkErrorDetails, An as CommentUpdateSignedPropertyNames, Ar as literal, At as refreshTrackedCommunityAliases, B as isIpfsCid, Bt as pTimeout, Cn as CommentPubsubMessageWithFlexibleAuthorRefinementSchema, Cr as require_supports_color, Ct as findStartedCommunity, D as deepMergeRuntimeFields, Dn as CommentUpdateForChallengeVerificationSignedPropertyNames, Dr as array, E as createAbortError, Er as _enum, Et as listStartedCommunities, Fn as ModQueuePageIpfsSchema, Ft as untrackStartedCommunity, Gn as AuthorCommentIpfsReservedFields, Gt as CreateCommunityEditPublicationOptionsWithRefinementSchema, H as isIpns, I as getPostUpdateTimestampRange, In as PageIpfsSchema, It as untrackUpdatingComment, Jn as CidPathSchema, Kt as CommentModerationChallengeRequestToEncryptSchema, L as hideClassPrivateProps, Ln as CommentEditChallengeRequestToEncryptSchema, Lt as untrackUpdatingCommunity, Mr as object, Mt as trackStartedCommunity, Nn as CreateCommentOptionsWithRefinementSchema, Nr as record, O as derivePublicationFromChallengeRequest, On as CommentUpdateReservedFields, Or as boolean, Ot as listUpdatingCommunities, Pn as GetPageParamSchema, Pr as string, Pt as trackUpdatingCommunity, Q as isStringDomain, Qn as CreateSignerSchema, Qt as ChallengeFileFactorySchema, R as ipnsNameToIpnsOverPubsubTopic, Rt as require_sha256$1, Sr as logger_default, Tn as CommentUpdateChallengeReservedFieldNames, Tt as findUpdatingCommunity, U as isIpnsPath, Un as CreateCommentEditOptionsWithRefinementSchema, Ut as CommunityEditPublicationSignedPropertyNames, V as isIpfsPath, Vn as CommentEditSignedPropertyNames, Vt as CommunityEditPublicationChallengeRequestToEncryptSchema, Wn as AuthorAddressSchema, Wt as CommunityEditPubsubMessagePublicationSchema, X as isRequestPubsubPublicationOfPost, Xn as CommunityAddressSchema, Xt as CommentModerationsTableRowSchema, Yn as CidStringSchema, Yt as CommentModerationSignedPropertyNames, Z as isRequestPubsubPublicationOfReply, Zn as CommunityAuthorChallengeReservedFieldNames, Zt as CreateCommentModerationOptionsWithRefinementSchema, _ as PKCUserOptionBaseSchema, _n as VoteSignedPropertyNames, _r as FailedToFetchCommunityFromGatewaysError, an as CommunityIpfsSchema, ar as e$5, b as areEquivalentCommunityAddresses, bn as CommentIpfsReservedFields, br as PKCError, bt as waitForUpdateInCommunityInstanceWithErrorAndTimeout, c as ChallengeVerificationMessageSignedPropertyNames, cn as CreateRemoteCommunityFunctionArgumentSchema, cr as t$12, dr as t$10, f as DecryptedChallengeSchema, fn as RpcRemoteCommunityUpdateEventResultSchema, fr as t$9, g as PKCParsedOptionsSchema, gr as FailedToFetchCommentUpdateFromGatewaysError, gt as sleepUntilTimeoutOrAbort, h as NameResolverSerializedSchema, hn as VotePubsubMessagePublicationSchema, hr as FailedToFetchCommentIpfsFromGatewaysError, ht as shortifyCid, i as ChallengeMessageSignedPropertyNames, in as CommunityIpfsReservedFields, ir as e$6, j as fetchAndValidateIpnsRecordFromGateway, jr as number, k as doesDomainAddressHaveCapitalLetter, kn as CommentUpdateSchema, kr as custom, l as DecryptedChallengeAnswerSchema, ln as CreateRpcCommunityFunctionArgumentSchema, lr as n$8, m as NameResolveCacheOptionsSchema, mn as VoteChallengeRequestToEncryptSchema, mr as require_retry$1, mt as shortifyAddress, n as ChallengeAnswerMessageSignedPropertyNames, nn as CommunityEditOptionsSchema, o as ChallengeRequestMessageSignedPropertyNames, on as CommunitySignedPropertyNames, or as t$11, ot as removeNullUndefinedEmptyObjectsValuesRecursively, p as DecryptedChallengeVerificationSchema, pn as CreateVoteUserOptionsWithRefinementSchema, pr as e$4, qn as ChallengeAnswersSchema, qt as CommentModerationPubsubMessagePublicationSchema, rn as CommunityExportRecordsSchema, rr as t$13, sn as CreateNewLocalCommunityUserOptionsSchema, sr as r$8, tn as CommunityChallengeSettingSchema, tr as n$9, tt as raceAgainstAbort, un as ExportCommunityModLogsOptionsSchema, ur as r$7, ut as resolveWhenPredicateIsTrue, v as PKCUserOptionsSchema, vr as FailedToFetchGenericIpfsFromGatewaysError, vt as throwIfAbortSignalAborted, wn as CommentSignedPropertyNames, wr as require_ms$1, wt as findUpdatingComment, x as calculateIpfsCidV0, xn as CommentIpfsSchema, xr as messages, yn as CommentChallengeRequestToEncryptSchema, yr as FailedToFetchPageIpfsFromGatewaysError, yt as timestamp, z as isAbortError, zn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema } from "./schema-qhSDu1BU.js";
3
3
  import { t as all } from "./src-CYIMjhjK.js";
4
4
  import { createHash } from "node:crypto";
5
5
  import { pathToFileURL } from "node:url";
@@ -91779,7 +91779,10 @@ const CreatePKCWsServerOptionsSchema = object({
91779
91779
  const SetNewSettingsPKCWsServerSchema = object({ pkcOptions: PKCUserOptionBaseSchema.extend({ nameResolvers: NameResolverSerializedSchema.array().optional() }).loose() });
91780
91780
  const PKCWsServerSettingsSerializedSchema = object({
91781
91781
  pkcOptions: PKCParsedOptionsSchema.loose(),
91782
- challenges: record(string(), ChallengeFileSchema.omit({ getChallenge: true }))
91782
+ challenges: record(string(), ChallengeFileSchema.omit({
91783
+ getChallenge: true,
91784
+ validateChallengeSettings: true
91785
+ }))
91783
91786
  });
91784
91787
  //#endregion
91785
91788
  //#region dist/node/schema/schema-util.js
@@ -99717,7 +99720,7 @@ var PublicationClientsManager = class extends PKCClientsManager {
99717
99720
  const community = directCommunityInstance || await this._pkc.createCommunity({
99718
99721
  name: this._publication.communityName,
99719
99722
  publicKey: this._publication.communityPublicKey
99720
- });
99723
+ }, { abortSignal: this._publication._getCommunityFetchAbortSignal() });
99721
99724
  this._communityForUpdating = {
99722
99725
  community,
99723
99726
  error: this.handleErrorEventFromCommunity.bind(this),
@@ -99806,7 +99809,11 @@ var PublicationClientsManager = class extends PKCClientsManager {
99806
99809
  if (!updatingCommunityInstance.community.raw.communityIpfs) {
99807
99810
  const timeoutMs = this._pkc._timeouts["community-ipns"];
99808
99811
  try {
99809
- await waitForUpdateInCommunityInstanceWithErrorAndTimeout(updatingCommunityInstance.community, timeoutMs);
99812
+ await waitForUpdateInCommunityInstanceWithErrorAndTimeout({
99813
+ community: updatingCommunityInstance.community,
99814
+ timeoutMs,
99815
+ abortSignal: this._publication._getCommunityFetchAbortSignal()
99816
+ });
99810
99817
  communityIpfs = updatingCommunityInstance.community.raw.communityIpfs;
99811
99818
  } catch (e) {
99812
99819
  await this.cleanUpUpdatingCommunityInstance();
@@ -128112,6 +128119,25 @@ function ChallengeFileFactory$4({ challengeSettings }) {
128112
128119
  };
128113
128120
  }
128114
128121
  //#endregion
128122
+ //#region dist/node/runtime/node/community/challenges/pkc-js-challenges/address-list-validation.js
128123
+ const splitCommaSeparated = (value) => value.split(",").map((entry) => entry.trim());
128124
+ function validateAddressListOptions({ challengeSettings }) {
128125
+ const { addresses, urls } = challengeSettings.options ?? {};
128126
+ if (addresses) {
128127
+ for (const [index, address] of splitCommaSeparated(addresses).entries()) if (!address) throw new Error(`addresses entry ${index} is empty, check for a stray or trailing comma`);
128128
+ }
128129
+ if (urls) for (const [index, url] of splitCommaSeparated(urls).entries()) {
128130
+ if (!url) throw new Error(`urls entry ${index} is empty, check for a stray or trailing comma`);
128131
+ let parsed;
128132
+ try {
128133
+ parsed = new URL(url);
128134
+ } catch {
128135
+ throw new Error(`urls entry ${index} ('${url}') is not a valid URL`);
128136
+ }
128137
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") throw new Error(`urls entry ${index} ('${url}') must use http: or https:, it is fetched over HTTP`);
128138
+ }
128139
+ }
128140
+ //#endregion
128115
128141
  //#region dist/node/runtime/node/community/challenges/pkc-js-challenges/blacklist.js
128116
128142
  const optionInputs$3 = [
128117
128143
  {
@@ -128194,7 +128220,8 @@ function ChallengeFileFactory$3({ challengeSettings }) {
128194
128220
  getChallenge: getChallenge$3,
128195
128221
  optionInputs: optionInputs$3,
128196
128222
  type: type$3,
128197
- description: description$2
128223
+ description: description$2,
128224
+ validateChallengeSettings: validateAddressListOptions
128198
128225
  };
128199
128226
  }
128200
128227
  //#endregion
@@ -128280,7 +128307,8 @@ function ChallengeFileFactory$2({ challengeSettings }) {
128280
128307
  getChallenge: getChallenge$2,
128281
128308
  optionInputs: optionInputs$2,
128282
128309
  type: type$2,
128283
- description: description$1
128310
+ description: description$1,
128311
+ validateChallengeSettings: validateAddressListOptions
128284
128312
  };
128285
128313
  }
128286
128314
  //#endregion
@@ -128323,13 +128351,17 @@ const getChallenge$1 = async ({ challengeSettings, challengeRequestMessage, chal
128323
128351
  };
128324
128352
  return { success: true };
128325
128353
  };
128354
+ const validateChallengeSettings$1 = ({ challengeSettings }) => {
128355
+ if (challengeSettings.publicOptions?.includes("answer")) throw new Error("answer cannot be listed in publicOptions: publishing the answer means anyone can pass the challenge");
128356
+ };
128326
128357
  function ChallengeFileFactory$1({ challengeSettings }) {
128327
128358
  return {
128328
128359
  getChallenge: getChallenge$1,
128329
128360
  optionInputs: optionInputs$1,
128330
128361
  type: type$1,
128331
128362
  challenge: challengeSettings?.options?.question,
128332
- description
128363
+ description,
128364
+ validateChallengeSettings: validateChallengeSettings$1
128333
128365
  };
128334
128366
  }
128335
128367
  //#endregion
@@ -128430,12 +128462,35 @@ const getChallenge = async ({ challengeSettings, challengeRequestMessage }) => {
128430
128462
  error
128431
128463
  };
128432
128464
  };
128465
+ const validateChallengeSettings = ({ challengeSettings }) => {
128466
+ const matchesStr = challengeSettings.options?.matches;
128467
+ if (!matchesStr) return;
128468
+ let parsed;
128469
+ try {
128470
+ parsed = JSON.parse(matchesStr);
128471
+ } catch (e) {
128472
+ throw new Error(`matches is not valid JSON: ${e.message}`);
128473
+ }
128474
+ if (!Array.isArray(parsed)) throw new Error("matches must be a JSON array of {propertyName, regexp} objects");
128475
+ for (const [index, match] of parsed.entries()) {
128476
+ if (typeof match !== "object" || match === null || Array.isArray(match)) throw new Error(`matches[${index}] must be an object with propertyName and regexp`);
128477
+ const { propertyName, regexp } = match;
128478
+ if (typeof propertyName !== "string" || !propertyName) throw new Error(`matches[${index}].propertyName must be a non-empty string`);
128479
+ if (typeof regexp !== "string" || !regexp) throw new Error(`matches[${index}].regexp must be a non-empty string`);
128480
+ try {
128481
+ new RegExp(regexp);
128482
+ } catch (e) {
128483
+ throw new Error(`matches[${index}].regexp ('${regexp}') is not a valid regular expression: ${e.message}`);
128484
+ }
128485
+ }
128486
+ };
128433
128487
  function ChallengeFileFactory({ challengeSettings }) {
128434
128488
  return {
128435
128489
  getChallenge,
128436
128490
  optionInputs,
128437
128491
  type,
128438
- description: challengeSettings?.options?.description || defaultDescription
128492
+ description: challengeSettings?.options?.description || defaultDescription,
128493
+ validateChallengeSettings
128439
128494
  };
128440
128495
  }
128441
128496
  //#endregion
@@ -128970,8 +129025,14 @@ const getChallengeVerification = async ({ challengeRequestMessage, community, ge
128970
129025
  };
128971
129026
  return challengeVerification;
128972
129027
  };
128973
- const getCommunityChallengeFromCommunityChallengeSettings = async ({ communityChallengeSettings, pkc }) => {
128974
- communityChallengeSettings = CommunityChallengeSettingSchema.parse(communityChallengeSettings);
129028
+ const derivePublicOptions = (communityChallengeSettings) => {
129029
+ const { publicOptions, options } = communityChallengeSettings;
129030
+ if (!publicOptions?.length || !options) return void 0;
129031
+ const published = {};
129032
+ for (const optionName of publicOptions) if (typeof options[optionName] === "string") published[optionName] = options[optionName];
129033
+ return e$5(published) ? void 0 : published;
129034
+ };
129035
+ const loadChallengeFileFromCommunityChallengeSettings = async ({ communityChallengeSettings, pkc }) => {
128975
129036
  let challengeFile = void 0;
128976
129037
  if (communityChallengeSettings.path) try {
128977
129038
  const importedFile = await import(pathToFileURL(communityChallengeSettings.path).href);
@@ -128994,6 +129055,14 @@ const getCommunityChallengeFromCommunityChallengeSettings = async ({ communityCh
128994
129055
  challengeFile = ChallengeFileSchema.parse(ChallengeFileFactory({ challengeSettings: communityChallengeSettings }));
128995
129056
  }
128996
129057
  if (!challengeFile) throw Error("Failed to load challenge file");
129058
+ return challengeFile;
129059
+ };
129060
+ const getCommunityChallengeFromCommunityChallengeSettings = async ({ communityChallengeSettings, pkc }) => {
129061
+ communityChallengeSettings = CommunityChallengeSettingSchema.parse(communityChallengeSettings);
129062
+ const challengeFile = await loadChallengeFileFromCommunityChallengeSettings({
129063
+ communityChallengeSettings,
129064
+ pkc
129065
+ });
128997
129066
  const { challenge, type } = challengeFile;
128998
129067
  return { communityChallenge: {
128999
129068
  exclude: communityChallengeSettings.exclude,
@@ -129001,7 +129070,8 @@ const getCommunityChallengeFromCommunityChallengeSettings = async ({ communityCh
129001
129070
  challenge,
129002
129071
  type,
129003
129072
  caseInsensitive: challengeFile.caseInsensitive,
129004
- pendingApproval: communityChallengeSettings.pendingApproval
129073
+ pendingApproval: communityChallengeSettings.pendingApproval,
129074
+ publicOptions: derivePublicOptions(communityChallengeSettings)
129005
129075
  } };
129006
129076
  };
129007
129077
  //#endregion
@@ -129211,14 +129281,16 @@ var RpcRemoteCommunity = class extends RemoteCommunity {
129211
129281
  const log = logger_default("pkc-js:rpc-remote-community:stop");
129212
129282
  if (this.state === "stopped") return;
129213
129283
  if (this._updatingRpcCommunityInstanceWithListeners) await this._cleanupMirroringUpdatingCommunity();
129214
- else if (this._updateRpcSubscriptionId) {
129215
- try {
129216
- await this._pkc._pkcRpcClient.unsubscribe(this._updateRpcSubscriptionId);
129217
- } catch (e) {
129218
- log.error("Failed to unsubscribe from communityUpdate", e);
129284
+ else {
129285
+ if (this._updateRpcSubscriptionId) {
129286
+ try {
129287
+ await this._pkc._pkcRpcClient.unsubscribe(this._updateRpcSubscriptionId);
129288
+ } catch (e) {
129289
+ log.error("Failed to unsubscribe from communityUpdate", e);
129290
+ }
129291
+ this._updateRpcSubscriptionId = void 0;
129292
+ log.trace(`Stopped the update of remote community (${this.address}) via RPC`);
129219
129293
  }
129220
- this._updateRpcSubscriptionId = void 0;
129221
- log.trace(`Stopped the update of remote community (${this.address}) via RPC`);
129222
129294
  untrackUpdatingCommunity(this._pkc, this);
129223
129295
  }
129224
129296
  this._setRpcClientStateWithEmission("stopped");
@@ -129593,4 +129665,4 @@ var RpcLocalCommunity = class extends RpcRemoteCommunity {
129593
129665
  }
129594
129666
  };
129595
129667
  //#endregion
129596
- export { applyNameResolvedCacheToCrosspost as $, crosspostChainDepthUpTo as $n, createSchemaRowParser as $t, deriveDbReplies as A, parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as An, verifyCommentModeration as At, tryToDeleteCommunitiesThatFailedToBeDeletedBefore as B, RpcExportCommunityModLogsParamSchema as Bn, normalizeCreatePublicationAuthor as Bt, backupCommunityDb as C, parseDecryptedChallengeVerification as Cn, signVote as Ct, deleteOldCommunityInWindows as D, parseRpcCommentEventWithPKCErrorIfItFails as Dn, verifyChallengeVerification as Dt, createKuboRpcClient as E, parsePKCUserOptionsSchemaWithPKCErrorIfItFails as En, verifyChallengeRequest as Et, listCommunitiesSync as F, RpcCidParamSchema as Fn, verifyVote as Ft, TIMEFRAMES_TO_SECONDS as G, RpcFetchCidResultSchema as Gn, normalizeCommunityInputFromCommunity as Gt, POSTS_SORT_TYPES as H, RpcExportCommunityParamSchema as Hn, getCommunityAddressFromRecord as Ht, monitorCommunitiesDirectory as I, RpcCommentRepliesPageParamSchema as In, buildRuntimeAuthor as It, extractCommunityRuntimeFieldsFromParsedPages as J, RpcPublishedAnchorRecordResultSchema as Jn, getBufferedPKCAddressFromPublicKey as Jt, buildPageRuntimeFields as K, RpcPublishAnchorRecordParamSchema as Kn, decode as Kt, moveCommunityDbToDeletedDirectory as L, RpcCommunityIdentifierParamSchema as Ln, cleanWireAuthor as Lt, getDefaultDataPath as M, RpcAnchorPublishPreparationResultSchema as Mn, verifyCommentUpdate as Mt, getThumbnailPropsOfLink as N, RpcAuthorNameParamSchema as Nn, verifyCommunity as Nt, deriveCommentIpfsFromCommentTableRow as O, parseRpcCommentUpdateEventWithPKCErrorIfItFails as On, verifyCommentEdit as Ot, importSignerIntoKuboNode as P, RpcCancelExportParamSchema as Pn, verifyCommunityEdit as Pt, RepliesPages as Q, RpcUnsubscribeParamSchema as Qn, getPublicKeyFromPrivateKey as Qt, resolveDbPostsCidRefs as R, RpcCommunityPageParamSchema as Rn, getAuthorNameFromRuntime as Rt, BackupAbortError as S, parseDecryptedChallengeAnswerWithPKCErrorIfItFails as Sn, signCommunityEdit as St, calculateInlineRepliesBudget as T, parseJsonWithPKCErrorIfFails as Tn, verifyChallengeMessage as Tt, POST_REPLIES_SORT_TYPES as U, RpcExportCommunityResultSchema as Un, getCommunityNameFromWire$1 as Ut, CommentClientsManager as V, RpcExportCommunityModLogsResultSchema as Vn, buildRuntimeCommunityFields as Vt, REPLY_REPLIES_SORT_TYPES as W, RpcFetchCidParamSchema as Wn, getCommunityPublicKeyFromWire as Wt, iterateOverPageCidsToFindAllCids as X, RpcSubscriptionIdResultSchema as Xn, getPKCAddressFromPublicKey as Xt, findCommentInPageInstanceRecursively as Y, RpcResolveAuthorNameResultSchema as Yn, getIpfsKeyFromPrivateKey as Yt, parseRawPages as Z, RpcSuccessResultSchema as Zn, getPKCAddressFromPublicKeySync as Zt, createAnchorIpnsRecord as _, parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails as _n, signCommentEdit as _t, pkcJsChallenges as a, parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as an, n$5 as ar, PKCClientsManager as at, encryptEd25519AesGcm as b, parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails as bn, signCommentUpdateForChallengeVerification as bt, RemoteCommunity as c, parseCommunityAddressWithPKCErrorIfItFails as cn, t$8 as cr, pLimit as ct, decodeRpcChallengeAnswerPubsubMsg as d, parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails as dn, require_lodash_merge as dr, cleanUpBeforePublishing as dt, parseCidStringSchemaWithPKCErrorIfItFails as en, effectiveMaxCrosspostDepth as er, cloneCrosspostForRuntime as et, decodeRpcChallengePubsubMsg as f, parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails as fn, nativeFunctions$1 as fr, signChallengeAnswer as ft, createSigner as g, parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails as gn, signComment as gt, SignerWithPublicKeyAddress as h, parseCreateCommentOptionsSchemaWithPKCErrorIfItFails as hn, signChallengeVerification as ht, getCommunityChallengeFromCommunityChallengeSettings as i, parseCommentIpfsSchemaWithPKCErrorIfItFails as in, t$5 as ir, PublicationClientsManager as it, getDefaultCommunityDbConfig as j, parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails as jn, verifyCommentPubsubMessage as jt, deriveDbPosts as k, parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails as kn, verifyCommentIpfs as kt, MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS as l, parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as ln, stringify as lr, PKCTypedEmitter as lt, decodeRpcChallengeVerificationPubsubMsg as m, parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails as mn, signChallengeRequest as mt, RpcRemoteCommunity as n, parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as nn, t$4 as nr, extractCrosspostRuntimeFields as nt, TrackedInstanceRegistry as o, parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails as on, n$6 as or, InflightFetchManager as ot, decodeRpcChallengeRequestPubsubMsg as p, parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails as pn, require_undici as pr, signChallengeMessage as pt, buildPagesRuntimeFields as q, RpcPublishChallengeAnswersParamSchema as qn, encode as qt, getChallengeVerification as r, parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails as rn, r as rr, stripNameResolvedFromCrosspost as rt, LRUCache as s, parseCommentPubsubMessagePublicationWithPKCErrorIfItFails as sn, t$7 as sr, pRetry as st, RpcLocalCommunity as t, parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as tn, t$2 as tr, collectCrosspostAuthorsToResolve as tt, KeyvBetterSqlite3 as u, parseCommunityEditOptionsSchemaWithPKCErrorIfItFails as un, STORAGE_KEYS as ur, require_lib$1 as ut, decryptEd25519AesGcm as v, parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails as vn, signCommentModeration as vt, calculateExpectedSignatureSize as w, parseDecryptedChallengeWithPKCErrorIfItFails as wn, verifyChallengeAnswer as wt, encryptEd25519AesGcmPublicKeyBuffer as x, parseCreateVoteOptionsSchemaWithPKCErrorIfItFails as xn, signCommunity as xt, decryptEd25519AesGcmPublicKeyBuffer as y, parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails as yn, signCommentUpdate as yt, setNativeFunctions as z, RpcEditCommunityParamSchema as zn, getAuthorNameFromWire as zt };
129668
+ export { RepliesPages as $, RpcUnsubscribeParamSchema as $n, getPublicKeyFromPrivateKey as $t, deriveDbPosts as A, parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails as An, verifyCommentIpfs as At, setNativeFunctions as B, RpcEditCommunityParamSchema as Bn, getAuthorNameFromWire as Bt, BackupAbortError as C, parseDecryptedChallengeAnswerWithPKCErrorIfItFails as Cn, signCommunityEdit as Ct, createKuboRpcClient as D, parsePKCUserOptionsSchemaWithPKCErrorIfItFails as Dn, verifyChallengeRequest as Dt, calculateInlineRepliesBudget as E, parseJsonWithPKCErrorIfFails as En, verifyChallengeMessage as Et, importSignerIntoKuboNode as F, RpcCancelExportParamSchema as Fn, verifyCommunityEdit as Ft, REPLY_REPLIES_SORT_TYPES as G, RpcFetchCidParamSchema as Gn, getCommunityPublicKeyFromWire as Gt, CommentClientsManager as H, RpcExportCommunityModLogsResultSchema as Hn, buildRuntimeCommunityFields as Ht, listCommunitiesSync as I, RpcCidParamSchema as In, verifyVote as It, buildPagesRuntimeFields as J, RpcPublishChallengeAnswersParamSchema as Jn, encode as Jt, TIMEFRAMES_TO_SECONDS as K, RpcFetchCidResultSchema as Kn, normalizeCommunityInputFromCommunity as Kt, monitorCommunitiesDirectory as L, RpcCommentRepliesPageParamSchema as Ln, buildRuntimeAuthor as Lt, getDefaultCommunityDbConfig as M, parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails as Mn, verifyCommentPubsubMessage as Mt, getDefaultDataPath as N, RpcAnchorPublishPreparationResultSchema as Nn, verifyCommentUpdate as Nt, deleteOldCommunityInWindows as O, parseRpcCommentEventWithPKCErrorIfItFails as On, verifyChallengeVerification as Ot, getThumbnailPropsOfLink as P, RpcAuthorNameParamSchema as Pn, verifyCommunity as Pt, parseRawPages as Q, RpcSuccessResultSchema as Qn, getPKCAddressFromPublicKeySync as Qt, moveCommunityDbToDeletedDirectory as R, RpcCommunityIdentifierParamSchema as Rn, cleanWireAuthor as Rt, encryptEd25519AesGcmPublicKeyBuffer as S, parseCreateVoteOptionsSchemaWithPKCErrorIfItFails as Sn, signCommunity as St, calculateExpectedSignatureSize as T, parseDecryptedChallengeWithPKCErrorIfItFails as Tn, verifyChallengeAnswer as Tt, POSTS_SORT_TYPES as U, RpcExportCommunityParamSchema as Un, getCommunityAddressFromRecord as Ut, tryToDeleteCommunitiesThatFailedToBeDeletedBefore as V, RpcExportCommunityModLogsParamSchema as Vn, normalizeCreatePublicationAuthor as Vt, POST_REPLIES_SORT_TYPES as W, RpcExportCommunityResultSchema as Wn, getCommunityNameFromWire$1 as Wt, findCommentInPageInstanceRecursively as X, RpcResolveAuthorNameResultSchema as Xn, getIpfsKeyFromPrivateKey as Xt, extractCommunityRuntimeFieldsFromParsedPages as Y, RpcPublishedAnchorRecordResultSchema as Yn, getBufferedPKCAddressFromPublicKey as Yt, iterateOverPageCidsToFindAllCids as Z, RpcSubscriptionIdResultSchema as Zn, getPKCAddressFromPublicKey as Zt, createSigner as _, parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails as _n, signComment as _t, loadChallengeFileFromCommunityChallengeSettings as a, parseCommentIpfsSchemaWithPKCErrorIfItFails as an, t$5 as ar, PublicationClientsManager as at, decryptEd25519AesGcmPublicKeyBuffer as b, parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails as bn, signCommentUpdate as bt, LRUCache as c, parseCommentPubsubMessagePublicationWithPKCErrorIfItFails as cn, t$7 as cr, pRetry as ct, KeyvBetterSqlite3 as d, parseCommunityEditOptionsSchemaWithPKCErrorIfItFails as dn, STORAGE_KEYS as dr, require_lib$1 as dt, createSchemaRowParser as en, crosspostChainDepthUpTo as er, applyNameResolvedCacheToCrosspost as et, decodeRpcChallengeAnswerPubsubMsg as f, parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails as fn, require_lodash_merge as fr, cleanUpBeforePublishing as ft, SignerWithPublicKeyAddress as g, parseCreateCommentOptionsSchemaWithPKCErrorIfItFails as gn, signChallengeVerification as gt, decodeRpcChallengeVerificationPubsubMsg as h, parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails as hn, signChallengeRequest as ht, getCommunityChallengeFromCommunityChallengeSettings as i, parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails as in, r as ir, stripNameResolvedFromCrosspost as it, deriveDbReplies as j, parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as jn, verifyCommentModeration as jt, deriveCommentIpfsFromCommentTableRow as k, parseRpcCommentUpdateEventWithPKCErrorIfItFails as kn, verifyCommentEdit as kt, RemoteCommunity as l, parseCommunityAddressWithPKCErrorIfItFails as ln, t$8 as lr, pLimit as lt, decodeRpcChallengeRequestPubsubMsg as m, parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails as mn, require_undici as mr, signChallengeMessage as mt, RpcRemoteCommunity as n, parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as nn, t$2 as nr, collectCrosspostAuthorsToResolve as nt, pkcJsChallenges as o, parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as on, n$5 as or, PKCClientsManager as ot, decodeRpcChallengePubsubMsg as p, parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails as pn, nativeFunctions$1 as pr, signChallengeAnswer as pt, buildPageRuntimeFields as q, RpcPublishAnchorRecordParamSchema as qn, decode as qt, getChallengeVerification as r, parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as rn, t$4 as rr, extractCrosspostRuntimeFields as rt, TrackedInstanceRegistry as s, parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails as sn, n$6 as sr, InflightFetchManager as st, RpcLocalCommunity as t, parseCidStringSchemaWithPKCErrorIfItFails as tn, effectiveMaxCrosspostDepth as tr, cloneCrosspostForRuntime as tt, MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS as u, parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as un, stringify as ur, PKCTypedEmitter as ut, createAnchorIpnsRecord as v, parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails as vn, signCommentEdit as vt, backupCommunityDb as w, parseDecryptedChallengeVerification as wn, signVote as wt, encryptEd25519AesGcm as x, parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails as xn, signCommentUpdateForChallengeVerification as xt, decryptEd25519AesGcm as y, parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails as yn, signCommentModeration as yt, resolveDbPostsCidRefs as z, RpcCommunityPageParamSchema as zn, getAuthorNameFromRuntime as zt };
@@ -1429,6 +1429,20 @@ const $ZodNever = /*@__PURE__*/ $constructor("$ZodNever", (inst, def) => {
1429
1429
  return payload;
1430
1430
  };
1431
1431
  });
1432
+ const $ZodVoid = /*@__PURE__*/ $constructor("$ZodVoid", (inst, def) => {
1433
+ $ZodType.init(inst, def);
1434
+ inst._zod.parse = (payload, _ctx) => {
1435
+ const input = payload.value;
1436
+ if (typeof input === "undefined") return payload;
1437
+ payload.issues.push({
1438
+ expected: "void",
1439
+ code: "invalid_type",
1440
+ input,
1441
+ inst
1442
+ });
1443
+ return payload;
1444
+ };
1445
+ });
1432
1446
  function handleArrayResult(result, final, index) {
1433
1447
  if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
1434
1448
  final.value[index] = result.value;
@@ -2681,6 +2695,13 @@ function _never(Class, params) {
2681
2695
  });
2682
2696
  }
2683
2697
  // @__NO_SIDE_EFFECTS__
2698
+ function _void$1(Class, params) {
2699
+ return new Class({
2700
+ type: "void",
2701
+ ...normalizeParams(params)
2702
+ });
2703
+ }
2704
+ // @__NO_SIDE_EFFECTS__
2684
2705
  function _lt(value, params) {
2685
2706
  return new $ZodCheckLessThan({
2686
2707
  check: "less_than",
@@ -3229,6 +3250,9 @@ const booleanProcessor = (_schema, _ctx, json, _params) => {
3229
3250
  const undefinedProcessor = (_schema, ctx, _json, _params) => {
3230
3251
  if (ctx.unrepresentable === "throw") throw new Error("Undefined cannot be represented in JSON Schema");
3231
3252
  };
3253
+ const voidProcessor = (_schema, ctx, _json, _params) => {
3254
+ if (ctx.unrepresentable === "throw") throw new Error("Void cannot be represented in JSON Schema");
3255
+ };
3232
3256
  const neverProcessor = (_schema, _ctx, json, _params) => {
3233
3257
  json.not = {};
3234
3258
  };
@@ -3845,6 +3869,14 @@ const ZodNever = /*@__PURE__*/ $constructor("ZodNever", (inst, def) => {
3845
3869
  function never(params) {
3846
3870
  return /* @__PURE__ */ _never(ZodNever, params);
3847
3871
  }
3872
+ const ZodVoid = /*@__PURE__*/ $constructor("ZodVoid", (inst, def) => {
3873
+ $ZodVoid.init(inst, def);
3874
+ ZodType.init(inst, def);
3875
+ inst._zod.processJSONSchema = (ctx, json, params) => voidProcessor(inst, ctx, json, params);
3876
+ });
3877
+ function _void(params) {
3878
+ return /* @__PURE__ */ _void$1(ZodVoid, params);
3879
+ }
3848
3880
  const ZodArray = /*@__PURE__*/ $constructor("ZodArray", (inst, def) => {
3849
3881
  $ZodArray.init(inst, def);
3850
3882
  ZodType.init(inst, def);
@@ -5153,6 +5185,9 @@ var messages;
5153
5185
  messages["ERR_FETCH_OVER_IPNS_OVER_PUBSUB_RETURNED_UNDEFINED"] = "libp2p Fetch over IPNS-Over-Pubsub returned undefined when requested from a peer";
5154
5186
  messages["ERR_FAILED_TO_DIAL_ANY_PEERS_PROVIDING_CID"] = "Failed to dial and connect to any peers providing a CID";
5155
5187
  messages["ERR_GET_COMMUNITY_TIMED_OUT"] = "pkc.getCommunity({address}) timed out";
5188
+ messages["ERR_GET_COMMUNITY_ABORTED"] = "Aborted while waiting for the community record to load";
5189
+ messages["ERR_COMMUNITY_STOPPED_WHILE_LOADING"] = "The community instance was stopped while its record was being loaded";
5190
+ messages["ERR_GET_COMMENT_ABORTED"] = "Aborted while waiting for the comment record to load";
5156
5191
  messages["ERR_TIMEOUT_WAITING_FOR_PUBSUB_TOPIC_PEERS"] = "Timeout waiting for propagation of pubsub topic peers";
5157
5192
  messages["ERR_PUBSUB_TOPIC_PEER_WAIT_ABORTED"] = "Aborted while waiting for a peer to subscribe to a pubsub topic";
5158
5193
  messages["ERR_IPNS_DIRECT_FETCH_ABORTED"] = "Aborted while fetching an IPNS record directly from subscribers/providers";
@@ -5517,6 +5552,11 @@ var messages;
5517
5552
  messages["ERR_CHALLENGE_RESULT_OVERRIDES_RESERVED_COMMENT_UPDATE_FIELD"] = "A challenge result attempted to set commentUpdate.<field> that is in CommentUpdateChallengeReservedFieldNames (community-computed field)";
5518
5553
  messages["ERR_CHALLENGE_RESULT_OVERRIDES_NON_COMMUNITY_AUTHOR_KEY"] = "A challenge result attempted to set commentUpdate.author.<field> with a key other than 'community' — challenges may only extend commentUpdate.author.community";
5519
5554
  messages["ERR_CHALLENGE_RESULT_OVERRIDES_RESERVED_COMMUNITY_AUTHOR_FIELD"] = "A challenge result attempted to set commentUpdate.author.community.<field> that is in CommunityAuthorChallengeReservedFieldNames (community-computed or mod-settable field)";
5555
+ messages["ERR_CHALLENGE_OPTION_NOT_DECLARED_IN_OPTION_INPUTS"] = "settings.challenges[i].options has a key that no optionInputs entry of the challenge declares, so it is never read";
5556
+ messages["ERR_CHALLENGE_REQUIRED_OPTION_MISSING"] = "settings.challenges[i].options is missing an option whose optionInputs entry is required";
5557
+ messages["ERR_CHALLENGE_PUBLIC_OPTION_NOT_DECLARED_IN_OPTION_INPUTS"] = "settings.challenges[i].publicOptions names an option that no optionInputs entry of the challenge declares";
5558
+ messages["ERR_CHALLENGE_SETTINGS_VALIDATION_FAILED"] = "The challenge's validateChallengeSettings hook rejected settings.challenges[i]";
5559
+ messages["ERR_CHALLENGE_SETTINGS_VALIDATION_FAILED_FOR_CHALLENGES"] = "One or more challenges in settings.challenges failed validation";
5520
5560
  })(messages || (messages = {}));
5521
5561
  //#endregion
5522
5562
  //#region dist/node/pkc-error.js
@@ -6463,7 +6503,8 @@ const additionalCommentReservedFields = [
6463
6503
  "publishingState",
6464
6504
  "updatingState",
6465
6505
  "rowid",
6466
- "nameResolved"
6506
+ "nameResolved",
6507
+ "abortSignal"
6467
6508
  ];
6468
6509
  const CommentPubsubMessageReservedFields = r$2(n([
6469
6510
  ...t$3(CommentIpfsSchema.shape),
@@ -6645,6 +6686,7 @@ const CommunityChallengeSettingSchema = object({
6645
6686
  path: string().optional(),
6646
6687
  name: string().optional(),
6647
6688
  options: record(string(), string()).optional(),
6689
+ publicOptions: string().array().optional(),
6648
6690
  exclude: ChallengeExcludeSchema.array().nonempty().optional(),
6649
6691
  description: string().optional(),
6650
6692
  pendingApproval: boolean().optional()
@@ -6655,7 +6697,7 @@ const GetChallengeArgsSchema = object({
6655
6697
  challengeIndex: number().int().nonnegative(),
6656
6698
  community: custom()
6657
6699
  });
6658
- const ChallengeFileSchema = object({
6700
+ const ChallengeFileSchema = looseObject({
6659
6701
  optionInputs: ChallengeOptionInputSchema.array().optional(),
6660
6702
  type: ChallengeFromGetChallengeSchema.shape.type,
6661
6703
  challenge: ChallengeFromGetChallengeSchema.shape.challenge.optional(),
@@ -6664,15 +6706,20 @@ const ChallengeFileSchema = object({
6664
6706
  getChallenge: _function({
6665
6707
  input: [GetChallengeArgsSchema],
6666
6708
  output: promise(ResultOfGetChallengeSchema)
6667
- })
6668
- }).strict();
6709
+ }),
6710
+ validateChallengeSettings: _function({
6711
+ input: [object({ challengeSettings: CommunityChallengeSettingSchema })],
6712
+ output: _void()
6713
+ }).optional()
6714
+ });
6669
6715
  const CommunityChallengeSchema = looseObject({
6670
6716
  exclude: ChallengeExcludeSchema.array().nonempty().optional(),
6671
6717
  description: ChallengeFileSchema.shape.description,
6672
6718
  challenge: ChallengeFileSchema.shape.challenge,
6673
6719
  type: ChallengeFileSchema.shape.type,
6674
6720
  caseInsensitive: ChallengeFileSchema.shape.caseInsensitive,
6675
- pendingApproval: boolean().optional()
6721
+ pendingApproval: boolean().optional(),
6722
+ publicOptions: record(string(), string()).optional()
6676
6723
  });
6677
6724
  const ChallengeFileFactorySchema = _function({
6678
6725
  input: [object({ challengeSettings: CommunityChallengeSettingSchema })],
@@ -6817,7 +6864,8 @@ const CommunityIpfsReservedFields = r$2([
6817
6864
  "publishingState",
6818
6865
  "updatingState",
6819
6866
  "started",
6820
- "exports"
6867
+ "exports",
6868
+ "abortSignal"
6821
6869
  ], t$3(CommunityIpfsSchema.shape));
6822
6870
  //#endregion
6823
6871
  //#region dist/node/publications/comment-moderation/schema.js
@@ -15613,7 +15661,50 @@ async function resolveWhenPredicateIsTrue(options) {
15613
15661
  listener();
15614
15662
  });
15615
15663
  }
15616
- async function waitForUpdateInCommunityInstanceWithErrorAndTimeout(community, timeoutMs) {
15664
+ function rejectWhenAbortSignalFires(opts) {
15665
+ const { abortSignal, error } = opts;
15666
+ let rejectPromise;
15667
+ const promise = new Promise((_, reject) => {
15668
+ rejectPromise = reject;
15669
+ });
15670
+ promise.catch(() => {});
15671
+ const onAbort = () => rejectPromise?.(error());
15672
+ abortSignal?.addEventListener("abort", onAbort);
15673
+ const cleanup = () => abortSignal?.removeEventListener("abort", onAbort);
15674
+ if (abortSignal?.aborted) onAbort();
15675
+ return {
15676
+ promise,
15677
+ cleanup
15678
+ };
15679
+ }
15680
+ function rejectWhenCommunityStopsOrAborts(opts) {
15681
+ const { community, abortSignal } = opts;
15682
+ let rejectPromise;
15683
+ const promise = new Promise((_, reject) => {
15684
+ rejectPromise = reject;
15685
+ });
15686
+ promise.catch(() => {});
15687
+ const onAbort = () => rejectPromise?.(new PKCError("ERR_GET_COMMUNITY_ABORTED", {
15688
+ communityAddress: community.address,
15689
+ abortReason: abortSignal?.reason
15690
+ }));
15691
+ const onStateChange = (newState) => {
15692
+ if (newState === "stopped") rejectPromise?.(new PKCError("ERR_COMMUNITY_STOPPED_WHILE_LOADING", { communityAddress: community.address }));
15693
+ };
15694
+ community.on("statechange", onStateChange);
15695
+ abortSignal?.addEventListener("abort", onAbort);
15696
+ const cleanup = () => {
15697
+ community.removeListener("statechange", onStateChange);
15698
+ abortSignal?.removeEventListener("abort", onAbort);
15699
+ };
15700
+ if (abortSignal?.aborted) onAbort();
15701
+ return {
15702
+ promise,
15703
+ cleanup
15704
+ };
15705
+ }
15706
+ async function waitForUpdateInCommunityInstanceWithErrorAndTimeout(opts) {
15707
+ const { community, timeoutMs, abortSignal } = opts;
15617
15708
  const wasUpdating = community.state === "updating";
15618
15709
  const updatingStates = [];
15619
15710
  const updatingStateChangeListener = (state) => updatingStates.push(state);
@@ -15642,10 +15733,33 @@ async function waitForUpdateInCommunityInstanceWithErrorAndTimeout(community, ti
15642
15733
  }
15643
15734
  };
15644
15735
  community.on("error", errorListener);
15736
+ let abortError;
15737
+ let abortReject;
15738
+ const abortListener = () => {
15739
+ abortError = new PKCError("ERR_GET_COMMUNITY_ABORTED", {
15740
+ communityAddress: community.address,
15741
+ abortReason: abortSignal?.reason,
15742
+ updatingStates,
15743
+ errors
15744
+ });
15745
+ abortReject?.(abortError);
15746
+ };
15747
+ const abortPromise = new Promise((_, reject) => {
15748
+ abortReject = reject;
15749
+ });
15750
+ abortPromise.catch(() => {});
15751
+ if (abortSignal) if (abortSignal.aborted) abortListener();
15752
+ else abortSignal.addEventListener("abort", abortListener);
15645
15753
  try {
15754
+ if (abortError) throw abortError;
15646
15755
  if (community.state !== "started") await community.update();
15756
+ if (abortError) throw abortError;
15647
15757
  if (criticalError) throw criticalError;
15648
- await pTimeout(Promise.race([updatePromise, nonRetriableErrorPromise]), {
15758
+ await pTimeout(Promise.race([
15759
+ updatePromise,
15760
+ nonRetriableErrorPromise,
15761
+ abortPromise
15762
+ ]), {
15649
15763
  milliseconds: timeoutMs,
15650
15764
  message: criticalError || errors.at(-1) || new PKCError("ERR_GET_COMMUNITY_TIMED_OUT", {
15651
15765
  communityAddress: community.address,
@@ -15657,6 +15771,7 @@ async function waitForUpdateInCommunityInstanceWithErrorAndTimeout(community, ti
15657
15771
  });
15658
15772
  if (criticalError) throw criticalError;
15659
15773
  } catch (e) {
15774
+ if (abortError) throw abortError;
15660
15775
  if (criticalError) throw criticalError;
15661
15776
  if (errors.length > 0) throw errors.at(-1);
15662
15777
  const updatingCommunity = findUpdatingCommunity(community._pkc, {
@@ -15666,6 +15781,7 @@ async function waitForUpdateInCommunityInstanceWithErrorAndTimeout(community, ti
15666
15781
  if (updatingCommunity?._clientsManager._ipnsLoadingOperation?.mainError()) throw updatingCommunity._clientsManager._ipnsLoadingOperation.mainError();
15667
15782
  throw e;
15668
15783
  } finally {
15784
+ abortSignal?.removeEventListener("abort", abortListener);
15669
15785
  if (updateListener) community.removeListener("update", updateListener);
15670
15786
  community.removeListener("error", errorListener);
15671
15787
  community.removeListener("updatingstatechange", updatingStateChangeListener);
@@ -16078,7 +16194,7 @@ function extractNetworkErrorDetails(err, depth = 0) {
16078
16194
  }
16079
16195
  //#endregion
16080
16196
  //#region dist/node/generated-version.js
16081
- const version = "0.0.83";
16197
+ const version = "0.0.85";
16082
16198
  //#endregion
16083
16199
  //#region dist/node/version.js
16084
16200
  const protocolVersion = ProtocolVersionSchema.parse("1.0.0");
@@ -16232,4 +16348,4 @@ const DecryptedChallengeVerificationSchema = object({
16232
16348
  }).strict();
16233
16349
  const ChallengeVerificationMessageSignedPropertyNames = t$3(n$3(ChallengeVerificationMessageSchema.shape, ["signature"]));
16234
16350
  //#endregion
16235
- export { pubsubTopicToDhtKey as $, n$3 as $n, CommunityChallengeSettingSchema as $t, extractNetworkErrorDetails as A, CommentsTableRowSchema as An, object as Ar, trackStartedCommunity as At, isIpfsCid as B, CommentEditsTableRowSchema as Bn, CommunityEditPublicationPubsubReservedFields as Bt, contentContainsMarkdownAudio as C, CommentUpdateChallengeReservedFieldNames as Cn, setErrorMap as Cr, findUpdatingCommunity as Ct, deepMergeRuntimeFields as D, CommentUpdateSchema as Dn, custom as Dr, refreshTrackedCommentAliases as Dt, createAbortError as E, CommentUpdateReservedFields as En, boolean as Er, listUpdatingCommunities as Et, getIpnsRecordInLocalKuboNode as F, CommentEditChallengeRequestToEncryptSchema as Fn, parsedType as Fr, untrackUpdatingCommunity as Ft, isLinkOfAudio as G, ChallengeAnswersSchema as Gn, CommentModerationPubsubMessagePublicationSchema as Gt, isIpns as H, AuthorAddressSchema as Hn, CommunityEditPubsubMessagePublicationSchema as Ht, getPostUpdateTimestampRange as I, CommentEditPubsubMessagePublicationSchema as In, stringifyPrimitive as Ir, require_sha256 as It, isLinkOfVideo as J, CommunityAddressSchema as Jn, CommentModerationsTableRowSchema as Jt, isLinkOfImage as K, CidPathSchema as Kn, CommentModerationReservedFields as Kt, hideClassPrivateProps as L, CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema as Ln, TimeoutError as Lt, genToArray as M, GetPageParamSchema as Mn, string as Mr, trackUpdatingCommunity as Mt, getEquivalentCommunityAddresses as N, ModQueuePageIpfsSchema as Nn, ZodError as Nr, untrackStartedCommunity as Nt, derivePublicationFromChallengeRequest as O, CommentUpdateSignedPropertyNames as On, literal as Or, refreshTrackedCommunityAliases as Ot, getErrorCodeFromMessage as P, PageIpfsSchema as Pn, joinValues as Pr, untrackUpdatingComment as Pt, isStringDomain as Q, t$1 as Qn, CommunityAnchorSchema as Qt, ipnsNameToIpnsOverPubsubTopic as R, CommentEditReservedFields as Rn, pTimeout as Rt, calculateStringSizeSameAsIpfsAddCidV0 as S, CommentSignedPropertyNames as Sn, require_ms as Sr, findUpdatingComment as St, contentContainsMarkdownVideos as T, CommentUpdateForChallengeVerificationSignedPropertyNames as Tn, array as Tr, listUpdatingComments as Tt, isIpnsPath as U, AuthorCommentIpfsReservedFields as Un, CreateCommunityEditPublicationOptionsWithRefinementSchema as Ut, isIpfsPath as V, CreateCommentEditOptionsWithRefinementSchema as Vn, CommunityEditPublicationSignedPropertyNames as Vt, isLinkOfAnimatedImage as W, AuthorReservedFields as Wn, CommentModerationChallengeRequestToEncryptSchema as Wt, isRequestPubsubPublicationOfPost as X, CreateSignerSchema as Xn, ChallengeFileFactorySchema as Xt, isLinkValid as Y, CommunityAuthorChallengeReservedFieldNames as Yn, CreateCommentModerationOptionsWithRefinementSchema as Yt, isRequestPubsubPublicationOfReply as Z, n as Zn, ChallengeFileSchema as Zt, PKCUserOptionBaseSchema as _, CommentChallengeRequestToEncryptSchema as _n, FailedToFetchPageIpfsFromGatewaysError as _r, timestamp as _t, ChallengeRequestMessageSchema as a, CreateNewLocalCommunityUserOptionsSchema as an, r$2 as ar, removeNullUndefinedValues as at, areEquivalentCommunityAddresses as b, CommentPubsubMessageReservedFields as bn, logger_default as br, findCommunityInRegistry as bt, ChallengeVerificationMessageSignedPropertyNames as c, ExportCommunityModLogsOptionsSchema as cn, r$4 as cr, resolveWhenPredicateIsTrue as ct, DecryptedChallengeRequestSchema as d, CreateVoteUserOptionsWithRefinementSchema as dn, e$4 as dr, retryKuboIpfsAddAndProvide as dt, CommunityEditOptionsSchema as en, t$2 as er, pubsubTopicToDhtKeyCid as et, DecryptedChallengeSchema as f, VoteChallengeRequestToEncryptSchema as fn, require_retry as fr, shortifyAddress as ft, PKCParsedOptionsSchema as g, VoteTablesRowSchema as gn, FailedToFetchGenericIpfsFromGatewaysError as gr, throwIfAbortSignalAborted as gt, NameResolverSerializedSchema as h, VoteSignedPropertyNames as hn, FailedToFetchCommunityFromGatewaysError as hr, statMfsPathSafely as ht, ChallengeMessageSignedPropertyNames as i, CommunitySignedPropertyNames as in, t$4 as ir, removeNullUndefinedEmptyObjectsValuesRecursively as it, fetchAndValidateIpnsRecordFromGateway as j, CreateCommentOptionsWithRefinementSchema as jn, record as jr, trackUpdatingComment as jt, doesDomainAddressHaveCapitalLetter as k, CommentUpdateTableRowSchema as kn, number as kr, syncCommunityRegistryEntry as kt, DecryptedChallengeAnswerSchema as l, PubsubTopicSchema as ln, t$7 as lr, retryKuboBlockPutPinAndProvidePubsubTopic as lt, NameResolveCacheOptionsSchema as m, VotePubsubReservedFields as mn, FailedToFetchCommentUpdateFromGatewaysError as mr, sleepUntilTimeoutOrAbort as mt, ChallengeAnswerMessageSignedPropertyNames as n, CommunityIpfsReservedFields as nn, e as nr, removeBlocksFromKuboNode as nt, ChallengeRequestMessageSignedPropertyNames as o, CreateRemoteCommunityFunctionArgumentSchema as on, t$5 as or, removeUndefinedValuesRecursively as ot, DecryptedChallengeVerificationSchema as p, VotePubsubMessagePublicationSchema as pn, FailedToFetchCommentIpfsFromGatewaysError as pr, shortifyCid as pt, isLinkOfMedia as q, CidStringSchema as qn, CommentModerationSignedPropertyNames as qt, ChallengeMessageSchema as r, CommunityIpfsSchema as rn, e$2 as rr, removeMfsFilesSafely as rt, ChallengeVerificationMessageSchema as s, CreateRpcCommunityFunctionArgumentSchema as sn, n$7 as sr, replaceXWithY as st, ChallengeAnswerMessageSchema as t, CommunityExportRecordsSchema as tn, t$3 as tr, raceAgainstAbort as tt, DecryptedChallengeRequestPublicationSchema as u, RpcRemoteCommunityUpdateEventResultSchema as un, t$8 as ur, retryKuboIpfsAdd as ut, PKCUserOptionsSchema as v, CommentIpfsReservedFields as vn, PKCError as vr, waitForUpdateInCommunityInstanceWithErrorAndTimeout as vt, contentContainsMarkdownImages as w, CommentUpdateForChallengeVerificationSchema as wn, _enum as wr, listStartedCommunities as wt, calculateIpfsCidV0 as x, CommentPubsubMessageWithFlexibleAuthorRefinementSchema as xn, require_supports_color as xr, findStartedCommunity as xt, version_default as y, CommentIpfsSchema as yn, messages as yr, writeKuboFilesWithTimeout as yt, isAbortError as z, CommentEditSignedPropertyNames as zn, CommunityEditPublicationChallengeRequestToEncryptSchema as zt };
16351
+ export { pubsubTopicToDhtKey as $, n as $n, ChallengeFileSchema as $t, extractNetworkErrorDetails as A, CommentUpdateSignedPropertyNames as An, literal as Ar, refreshTrackedCommunityAliases as At, isIpfsCid as B, CommentEditReservedFields as Bn, pTimeout as Bt, contentContainsMarkdownAudio as C, CommentPubsubMessageWithFlexibleAuthorRefinementSchema as Cn, require_supports_color as Cr, findStartedCommunity as Ct, deepMergeRuntimeFields as D, CommentUpdateForChallengeVerificationSignedPropertyNames as Dn, array as Dr, listUpdatingComments as Dt, createAbortError as E, CommentUpdateForChallengeVerificationSchema as En, _enum as Er, listStartedCommunities as Et, getIpnsRecordInLocalKuboNode as F, ModQueuePageIpfsSchema as Fn, ZodError as Fr, untrackStartedCommunity as Ft, isLinkOfAudio as G, AuthorCommentIpfsReservedFields as Gn, CreateCommunityEditPublicationOptionsWithRefinementSchema as Gt, isIpns as H, CommentEditsTableRowSchema as Hn, CommunityEditPublicationPubsubReservedFields as Ht, getPostUpdateTimestampRange as I, PageIpfsSchema as In, joinValues as Ir, untrackUpdatingComment as It, isLinkOfVideo as J, CidPathSchema as Jn, CommentModerationReservedFields as Jt, isLinkOfImage as K, AuthorReservedFields as Kn, CommentModerationChallengeRequestToEncryptSchema as Kt, hideClassPrivateProps as L, CommentEditChallengeRequestToEncryptSchema as Ln, parsedType as Lr, untrackUpdatingCommunity as Lt, genToArray as M, CommentsTableRowSchema as Mn, object as Mr, trackStartedCommunity as Mt, getEquivalentCommunityAddresses as N, CreateCommentOptionsWithRefinementSchema as Nn, record as Nr, trackUpdatingComment as Nt, derivePublicationFromChallengeRequest as O, CommentUpdateReservedFields as On, boolean as Or, listUpdatingCommunities as Ot, getErrorCodeFromMessage as P, GetPageParamSchema as Pn, string as Pr, trackUpdatingCommunity as Pt, isStringDomain as Q, CreateSignerSchema as Qn, ChallengeFileFactorySchema as Qt, ipnsNameToIpnsOverPubsubTopic as R, CommentEditPubsubMessagePublicationSchema as Rn, stringifyPrimitive as Rr, require_sha256 as Rt, calculateStringSizeSameAsIpfsAddCidV0 as S, CommentPubsubMessageReservedFields as Sn, logger_default as Sr, findCommunityInRegistry as St, contentContainsMarkdownVideos as T, CommentUpdateChallengeReservedFieldNames as Tn, setErrorMap as Tr, findUpdatingCommunity as Tt, isIpnsPath as U, CreateCommentEditOptionsWithRefinementSchema as Un, CommunityEditPublicationSignedPropertyNames as Ut, isIpfsPath as V, CommentEditSignedPropertyNames as Vn, CommunityEditPublicationChallengeRequestToEncryptSchema as Vt, isLinkOfAnimatedImage as W, AuthorAddressSchema as Wn, CommunityEditPubsubMessagePublicationSchema as Wt, isRequestPubsubPublicationOfPost as X, CommunityAddressSchema as Xn, CommentModerationsTableRowSchema as Xt, isLinkValid as Y, CidStringSchema as Yn, CommentModerationSignedPropertyNames as Yt, isRequestPubsubPublicationOfReply as Z, CommunityAuthorChallengeReservedFieldNames as Zn, CreateCommentModerationOptionsWithRefinementSchema as Zt, PKCUserOptionBaseSchema as _, VoteSignedPropertyNames as _n, FailedToFetchCommunityFromGatewaysError as _r, statMfsPathSafely as _t, ChallengeRequestMessageSchema as a, CommunityIpfsSchema as an, e$2 as ar, removeMfsFilesSafely as at, areEquivalentCommunityAddresses as b, CommentIpfsReservedFields as bn, PKCError as br, waitForUpdateInCommunityInstanceWithErrorAndTimeout as bt, ChallengeVerificationMessageSignedPropertyNames as c, CreateRemoteCommunityFunctionArgumentSchema as cn, t$5 as cr, removeUndefinedValuesRecursively as ct, DecryptedChallengeRequestSchema as d, PubsubTopicSchema as dn, t$7 as dr, retryKuboBlockPutPinAndProvidePubsubTopic as dt, CommunityAnchorSchema as en, t$1 as er, pubsubTopicToDhtKeyCid as et, DecryptedChallengeSchema as f, RpcRemoteCommunityUpdateEventResultSchema as fn, t$8 as fr, retryKuboIpfsAdd as ft, PKCParsedOptionsSchema as g, VotePubsubReservedFields as gn, FailedToFetchCommentUpdateFromGatewaysError as gr, sleepUntilTimeoutOrAbort as gt, NameResolverSerializedSchema as h, VotePubsubMessagePublicationSchema as hn, FailedToFetchCommentIpfsFromGatewaysError as hr, shortifyCid as ht, ChallengeMessageSignedPropertyNames as i, CommunityIpfsReservedFields as in, e as ir, removeBlocksFromKuboNode as it, fetchAndValidateIpnsRecordFromGateway as j, CommentUpdateTableRowSchema as jn, number as jr, syncCommunityRegistryEntry as jt, doesDomainAddressHaveCapitalLetter as k, CommentUpdateSchema as kn, custom as kr, refreshTrackedCommentAliases as kt, DecryptedChallengeAnswerSchema as l, CreateRpcCommunityFunctionArgumentSchema as ln, n$7 as lr, replaceXWithY as lt, NameResolveCacheOptionsSchema as m, VoteChallengeRequestToEncryptSchema as mn, require_retry as mr, shortifyAddress as mt, ChallengeAnswerMessageSignedPropertyNames as n, CommunityEditOptionsSchema as nn, t$2 as nr, rejectWhenAbortSignalFires as nt, ChallengeRequestMessageSignedPropertyNames as o, CommunitySignedPropertyNames as on, t$4 as or, removeNullUndefinedEmptyObjectsValuesRecursively as ot, DecryptedChallengeVerificationSchema as p, CreateVoteUserOptionsWithRefinementSchema as pn, e$4 as pr, retryKuboIpfsAddAndProvide as pt, isLinkOfMedia as q, ChallengeAnswersSchema as qn, CommentModerationPubsubMessagePublicationSchema as qt, ChallengeMessageSchema as r, CommunityExportRecordsSchema as rn, t$3 as rr, rejectWhenCommunityStopsOrAborts as rt, ChallengeVerificationMessageSchema as s, CreateNewLocalCommunityUserOptionsSchema as sn, r$2 as sr, removeNullUndefinedValues as st, ChallengeAnswerMessageSchema as t, CommunityChallengeSettingSchema as tn, n$3 as tr, raceAgainstAbort as tt, DecryptedChallengeRequestPublicationSchema as u, ExportCommunityModLogsOptionsSchema as un, r$4 as ur, resolveWhenPredicateIsTrue as ut, PKCUserOptionsSchema as v, VoteTablesRowSchema as vn, FailedToFetchGenericIpfsFromGatewaysError as vr, throwIfAbortSignalAborted as vt, contentContainsMarkdownImages as w, CommentSignedPropertyNames as wn, require_ms as wr, findUpdatingComment as wt, calculateIpfsCidV0 as x, CommentIpfsSchema as xn, messages as xr, writeKuboFilesWithTimeout as xt, version_default as y, CommentChallengeRequestToEncryptSchema as yn, FailedToFetchPageIpfsFromGatewaysError as yr, timestamp as yt, isAbortError as z, CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema as zn, TimeoutError as zt };
@@ -1,4 +1,4 @@
1
- import { et as pubsubTopicToDhtKeyCid, vr as PKCError } from "./schema-mdv9_FG5.js";
1
+ import { br as PKCError, et as pubsubTopicToDhtKeyCid } from "./schema-qhSDu1BU.js";
2
2
  import { ipnsSelector } from "ipns/selector";
3
3
  import { equals } from "uint8arrays/equals";
4
4
  //#region dist/node/helia/util.js
@@ -1,2 +1,2 @@
1
- import { a as getShortCid, i as getShortAddress, n as challenges, o as nativeFunctions, r as createAnchorIpnsRecord, s as setNativeFunctions, t as PKC } from "./chunks/node-lb4SvdBh.js";
1
+ import { a as getShortCid, i as getShortAddress, n as challenges, o as nativeFunctions, r as createAnchorIpnsRecord, s as setNativeFunctions, t as PKC } from "./chunks/node-C2DKW30L.js";
2
2
  export { challenges, createAnchorIpnsRecord, PKC as default, getShortAddress, getShortCid, nativeFunctions, setNativeFunctions };
@@ -1,7 +1,7 @@
1
- import { $n as n, L as hideClassPrivateProps, br as logger_default, st as replaceXWithY, tr as t, vr as PKCError, xt as findStartedCommunity } from "../../chunks/schema-mdv9_FG5.js";
2
- import { _ as parseRpcPublishAnchorRecordParam, c as parseRpcAuthorNameParam, d as parseRpcCommentRepliesPageParam, f as parseRpcCommunityIdentifierParam, g as parseRpcExportCommunityParam, h as parseRpcExportCommunityModLogsParam, l as parseRpcCancelExportParam, m as parseRpcEditCommunityParam, p as parseRpcCommunityPageParam, t as PKC, u as parseRpcCidParam, v as parseRpcPublishChallengeAnswersParam, y as parseRpcUnsubscribeParam } from "../../chunks/node-lb4SvdBh.js";
3
- import { An as parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, K as buildPageRuntimeFields, Sn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, _n as parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails, an as parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, ct as pLimit, kn as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, ln as parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, lr as stringify, nn as parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, nr as t$1, nt as extractCrosspostRuntimeFields, q as buildPagesRuntimeFields, st as pRetry, tn as parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, un as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, ut as require_lib, vn as parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails } from "../../chunks/rpc-local-community-a464veDe.js";
4
- import { t as LocalCommunity } from "../../chunks/local-community-DJM47U8C.js";
1
+ import { Ct as findStartedCommunity, L as hideClassPrivateProps, Sr as logger_default, br as PKCError, lt as replaceXWithY, rr as t, tr as n } from "../../chunks/schema-qhSDu1BU.js";
2
+ import { _ as parseRpcPublishAnchorRecordParam, c as parseRpcAuthorNameParam, d as parseRpcCommentRepliesPageParam, f as parseRpcCommunityIdentifierParam, g as parseRpcExportCommunityParam, h as parseRpcExportCommunityModLogsParam, l as parseRpcCancelExportParam, m as parseRpcEditCommunityParam, p as parseRpcCommunityPageParam, t as PKC, u as parseRpcCidParam, v as parseRpcPublishChallengeAnswersParam, y as parseRpcUnsubscribeParam } from "../../chunks/node-C2DKW30L.js";
3
+ import { An as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, Cn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, J as buildPagesRuntimeFields, ct as pRetry, dn as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, dt as require_lib, jn as parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, lt as pLimit, nn as parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, on as parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, q as buildPageRuntimeFields, rn as parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, rr as t$1, rt as extractCrosspostRuntimeFields, un as parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, ur as stringify, vn as parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails, yn as parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails } from "../../chunks/rpc-local-community-o0teUvw_.js";
4
+ import { t as LocalCommunity } from "../../chunks/local-community-BqxmCg5p.js";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import path from "path";
7
7
  import assert from "assert";
@@ -744,7 +744,7 @@ var PKCWsServer = class extends import_lib.TypedEmitter {
744
744
  challenges: t$1({
745
745
  ...PKCJs.PKC.challenges || {},
746
746
  ...pkc.settings?.challenges || {}
747
- }, (challengeFactory) => n(challengeFactory({ challengeSettings: {} }), ["getChallenge"]))
747
+ }, (challengeFactory) => n(challengeFactory({ challengeSettings: {} }), ["getChallenge", "validateChallengeSettings"]))
748
748
  };
749
749
  }
750
750
  async settingsSubscribe(params, connectionId) {
@@ -105,6 +105,7 @@ export declare const parseRpcEditCommunityParam: (params: unknown) => {
105
105
  path?: string | undefined;
106
106
  name?: string | undefined;
107
107
  options?: Record<string, string> | undefined;
108
+ publicOptions?: string[] | undefined;
108
109
  exclude?: {
109
110
  [x: string]: unknown;
110
111
  community?: {
@@ -377,6 +377,7 @@ export declare const RpcEditCommunityParamSchema: z.ZodObject<{
377
377
  path: z.ZodOptional<z.ZodString>;
378
378
  name: z.ZodOptional<z.ZodString>;
379
379
  options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
380
+ publicOptions: z.ZodOptional<z.ZodArray<z.ZodString>>;
380
381
  exclude: z.ZodOptional<z.ZodArray<z.ZodObject<{
381
382
  community: z.ZodOptional<z.ZodObject<{
382
383
  addresses: z.ZodArray<z.ZodString>;