@pkcprotocol/pkc-js 0.0.62 → 0.0.64

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 (237) hide show
  1. package/dist/browser/clients/base-client-manager.js +15 -15
  2. package/dist/browser/clients/base-client-manager.js.map +1 -1
  3. package/dist/browser/community/community-client-manager.js +10 -12
  4. package/dist/browser/community/community-client-manager.js.map +1 -1
  5. package/dist/browser/community/community-gateway-selection.js +4 -4
  6. package/dist/browser/community/community-gateway-selection.js.map +1 -1
  7. package/dist/browser/community/community-wire.js +3 -3
  8. package/dist/browser/community/community-wire.js.map +1 -1
  9. package/dist/browser/community/remote-community.d.ts +1 -1
  10. package/dist/browser/community/remote-community.js +10 -7
  11. package/dist/browser/community/remote-community.js.map +1 -1
  12. package/dist/browser/community/rpc-local-community.js +3 -3
  13. package/dist/browser/community/rpc-local-community.js.map +1 -1
  14. package/dist/browser/community/rpc-remote-community.js +5 -5
  15. package/dist/browser/community/rpc-remote-community.js.map +1 -1
  16. package/dist/browser/community/schema.js +5 -5
  17. package/dist/browser/community/schema.js.map +1 -1
  18. package/dist/browser/generated-version.d.ts +1 -1
  19. package/dist/browser/generated-version.js +1 -1
  20. package/dist/browser/pages/pages-client-manager.js +11 -15
  21. package/dist/browser/pages/pages-client-manager.js.map +1 -1
  22. package/dist/browser/pages/util.js +9 -9
  23. package/dist/browser/pages/util.js.map +1 -1
  24. package/dist/browser/pkc/pkc-client-manager.js +6 -6
  25. package/dist/browser/pkc/pkc-client-manager.js.map +1 -1
  26. package/dist/browser/pkc/pkc.js +19 -13
  27. package/dist/browser/pkc/pkc.js.map +1 -1
  28. package/dist/browser/publications/comment/comment-client-manager.js +5 -5
  29. package/dist/browser/publications/comment/comment-client-manager.js.map +1 -1
  30. package/dist/browser/publications/comment/comment.js +16 -16
  31. package/dist/browser/publications/comment/comment.js.map +1 -1
  32. package/dist/browser/publications/comment/schema.js +17 -17
  33. package/dist/browser/publications/comment/schema.js.map +1 -1
  34. package/dist/browser/publications/comment-edit/schema.js +7 -7
  35. package/dist/browser/publications/comment-edit/schema.js.map +1 -1
  36. package/dist/browser/publications/comment-moderation/schema.js +11 -7
  37. package/dist/browser/publications/comment-moderation/schema.js.map +1 -1
  38. package/dist/browser/publications/community-edit/schema.js +6 -6
  39. package/dist/browser/publications/community-edit/schema.js.map +1 -1
  40. package/dist/browser/publications/publication-author.js +3 -3
  41. package/dist/browser/publications/publication-author.js.map +1 -1
  42. package/dist/browser/publications/publication-client-manager.js +4 -4
  43. package/dist/browser/publications/publication-client-manager.js.map +1 -1
  44. package/dist/browser/publications/publication.js +9 -9
  45. package/dist/browser/publications/publication.js.map +1 -1
  46. package/dist/browser/publications/vote/schema.js +11 -7
  47. package/dist/browser/publications/vote/schema.js.map +1 -1
  48. package/dist/browser/publications/vote/vote.js.map +1 -1
  49. package/dist/browser/pubsub-messages/schema.js +5 -5
  50. package/dist/browser/pubsub-messages/schema.js.map +1 -1
  51. package/dist/browser/rpc/src/index.js +54 -15
  52. package/dist/browser/rpc/src/index.js.map +1 -1
  53. package/dist/browser/runtime/browser/localforage-lru.js +2 -2
  54. package/dist/browser/runtime/browser/localforage-lru.js.map +1 -1
  55. package/dist/browser/runtime/browser/util.d.ts +1 -1
  56. package/dist/browser/runtime/browser/util.js +4 -2
  57. package/dist/browser/runtime/browser/util.js.map +1 -1
  58. package/dist/browser/runtime/node/addresses-rewriter-proxy-server.js +3 -3
  59. package/dist/browser/runtime/node/addresses-rewriter-proxy-server.js.map +1 -1
  60. package/dist/browser/runtime/node/community/challenges/index.js +3 -3
  61. package/dist/browser/runtime/node/community/challenges/index.js.map +1 -1
  62. package/dist/browser/runtime/node/community/challenges/pkc-js-challenges/publication-match.js +4 -4
  63. package/dist/browser/runtime/node/community/challenges/pkc-js-challenges/publication-match.js.map +1 -1
  64. package/dist/browser/runtime/node/community/db-handler.js +32 -32
  65. package/dist/browser/runtime/node/community/db-handler.js.map +1 -1
  66. package/dist/browser/runtime/node/community/local-community/challenges.js +7 -7
  67. package/dist/browser/runtime/node/community/local-community/challenges.js.map +1 -1
  68. package/dist/browser/runtime/node/community/local-community/comment-updates.js +5 -5
  69. package/dist/browser/runtime/node/community/local-community/comment-updates.js.map +1 -1
  70. package/dist/browser/runtime/node/community/local-community/db-state.js +8 -8
  71. package/dist/browser/runtime/node/community/local-community/db-state.js.map +1 -1
  72. package/dist/browser/runtime/node/community/local-community/editing.js +6 -6
  73. package/dist/browser/runtime/node/community/local-community/editing.js.map +1 -1
  74. package/dist/browser/runtime/node/community/local-community/ipns-publishing.js +10 -7
  75. package/dist/browser/runtime/node/community/local-community/ipns-publishing.js.map +1 -1
  76. package/dist/browser/runtime/node/community/local-community/lifecycle.js +4 -4
  77. package/dist/browser/runtime/node/community/local-community/lifecycle.js.map +1 -1
  78. package/dist/browser/runtime/node/community/local-community/publication-store.js +13 -19
  79. package/dist/browser/runtime/node/community/local-community/publication-store.js.map +1 -1
  80. package/dist/browser/runtime/node/community/local-community/publication-validation.js +10 -10
  81. package/dist/browser/runtime/node/community/local-community/publication-validation.js.map +1 -1
  82. package/dist/browser/runtime/node/community/local-community/reprovide-on-address-change.js +5 -5
  83. package/dist/browser/runtime/node/community/local-community/reprovide-on-address-change.js.map +1 -1
  84. package/dist/browser/runtime/node/community/local-community.js +7 -7
  85. package/dist/browser/runtime/node/community/local-community.js.map +1 -1
  86. package/dist/browser/runtime/node/community/page-generator.js +5 -7
  87. package/dist/browser/runtime/node/community/page-generator.js.map +1 -1
  88. package/dist/browser/runtime/node/setup-kubo-address-rewriter-and-http-router.js +2 -2
  89. package/dist/browser/runtime/node/setup-kubo-address-rewriter-and-http-router.js.map +1 -1
  90. package/dist/browser/runtime/node/sqlite-lru-cache.js +2 -2
  91. package/dist/browser/runtime/node/sqlite-lru-cache.js.map +1 -1
  92. package/dist/browser/runtime/node/util.d.ts +1 -1
  93. package/dist/browser/runtime/node/util.js +12 -8
  94. package/dist/browser/runtime/node/util.js.map +1 -1
  95. package/dist/browser/schema/schema.js +4 -4
  96. package/dist/browser/schema/schema.js.map +1 -1
  97. package/dist/browser/signer/constants.d.ts +1 -2
  98. package/dist/browser/signer/constants.js +9 -1
  99. package/dist/browser/signer/constants.js.map +1 -1
  100. package/dist/browser/signer/signatures.js +14 -12
  101. package/dist/browser/signer/signatures.js.map +1 -1
  102. package/dist/browser/stats.js +5 -5
  103. package/dist/browser/stats.js.map +1 -1
  104. package/dist/browser/test/test-util.d.ts +9 -10
  105. package/dist/browser/test/test-util.js +25 -37
  106. package/dist/browser/test/test-util.js.map +1 -1
  107. package/dist/browser/types.d.ts +1 -1
  108. package/dist/browser/util.d.ts +2 -2
  109. package/dist/browser/util.js +24 -22
  110. package/dist/browser/util.js.map +1 -1
  111. package/dist/bundled/bundle-manifest.json +242 -312
  112. package/dist/bundled/chunks/chunk-2rV9d50f.js +35 -0
  113. package/dist/bundled/chunks/{helia-for-pkc-55fcY7oN.js → helia-for-pkc-CYDRSysz.js} +6 -6
  114. package/dist/bundled/chunks/{local-community-Bdasy8ZJ.js → local-community-DYvRQWsK.js} +148 -98
  115. package/dist/bundled/chunks/{local-community-Bz-P-EGM.js → local-community-DyaGG6lj.js} +1 -1
  116. package/dist/bundled/chunks/{node-DU0tGecu.js → node-DadVit9c.js} +50 -43
  117. package/dist/bundled/chunks/{rpc-local-community-NkCEOv2-.js → rpc-local-community-1Uvl5iwp.js} +343 -111
  118. package/dist/bundled/chunks/schema-Dtvt2tQ8.js +16182 -0
  119. package/dist/bundled/chunks/src-0J9-Tmgd.js +4147 -0
  120. package/dist/bundled/chunks/src-4u0f92eE.js +9899 -0
  121. package/dist/bundled/chunks/src-BOzgM7Fp.js +800 -0
  122. package/dist/bundled/chunks/src-CYIMjhjK.js +48 -0
  123. package/dist/bundled/chunks/{util-DpR-szdu.js → util-CjfTxkQ8.js} +1 -1
  124. package/dist/bundled/index.js +1 -1
  125. package/dist/bundled/rpc/src/index.js +44 -25
  126. package/dist/node/clients/base-client-manager.js +15 -15
  127. package/dist/node/clients/base-client-manager.js.map +1 -1
  128. package/dist/node/community/community-client-manager.js +10 -12
  129. package/dist/node/community/community-client-manager.js.map +1 -1
  130. package/dist/node/community/community-gateway-selection.js +4 -4
  131. package/dist/node/community/community-gateway-selection.js.map +1 -1
  132. package/dist/node/community/community-wire.js +3 -3
  133. package/dist/node/community/community-wire.js.map +1 -1
  134. package/dist/node/community/remote-community.d.ts +1 -1
  135. package/dist/node/community/remote-community.js +10 -7
  136. package/dist/node/community/remote-community.js.map +1 -1
  137. package/dist/node/community/rpc-local-community.js +3 -3
  138. package/dist/node/community/rpc-local-community.js.map +1 -1
  139. package/dist/node/community/rpc-remote-community.js +5 -5
  140. package/dist/node/community/rpc-remote-community.js.map +1 -1
  141. package/dist/node/community/schema.js +5 -5
  142. package/dist/node/community/schema.js.map +1 -1
  143. package/dist/node/generated-version.d.ts +1 -1
  144. package/dist/node/generated-version.js +1 -1
  145. package/dist/node/pages/pages-client-manager.js +11 -15
  146. package/dist/node/pages/pages-client-manager.js.map +1 -1
  147. package/dist/node/pages/util.js +9 -9
  148. package/dist/node/pages/util.js.map +1 -1
  149. package/dist/node/pkc/pkc-client-manager.js +6 -6
  150. package/dist/node/pkc/pkc-client-manager.js.map +1 -1
  151. package/dist/node/pkc/pkc.js +19 -13
  152. package/dist/node/pkc/pkc.js.map +1 -1
  153. package/dist/node/publications/comment/comment-client-manager.js +5 -5
  154. package/dist/node/publications/comment/comment-client-manager.js.map +1 -1
  155. package/dist/node/publications/comment/comment.js +16 -16
  156. package/dist/node/publications/comment/comment.js.map +1 -1
  157. package/dist/node/publications/comment/schema.js +17 -17
  158. package/dist/node/publications/comment/schema.js.map +1 -1
  159. package/dist/node/publications/comment-edit/schema.js +7 -7
  160. package/dist/node/publications/comment-edit/schema.js.map +1 -1
  161. package/dist/node/publications/comment-moderation/schema.js +11 -7
  162. package/dist/node/publications/comment-moderation/schema.js.map +1 -1
  163. package/dist/node/publications/community-edit/schema.js +6 -6
  164. package/dist/node/publications/community-edit/schema.js.map +1 -1
  165. package/dist/node/publications/publication-author.js +3 -3
  166. package/dist/node/publications/publication-author.js.map +1 -1
  167. package/dist/node/publications/publication-client-manager.js +4 -4
  168. package/dist/node/publications/publication-client-manager.js.map +1 -1
  169. package/dist/node/publications/publication.js +9 -9
  170. package/dist/node/publications/publication.js.map +1 -1
  171. package/dist/node/publications/vote/schema.js +11 -7
  172. package/dist/node/publications/vote/schema.js.map +1 -1
  173. package/dist/node/publications/vote/vote.js.map +1 -1
  174. package/dist/node/pubsub-messages/schema.js +5 -5
  175. package/dist/node/pubsub-messages/schema.js.map +1 -1
  176. package/dist/node/rpc/src/index.js +54 -15
  177. package/dist/node/rpc/src/index.js.map +1 -1
  178. package/dist/node/runtime/browser/localforage-lru.js +2 -2
  179. package/dist/node/runtime/browser/localforage-lru.js.map +1 -1
  180. package/dist/node/runtime/browser/util.d.ts +1 -1
  181. package/dist/node/runtime/browser/util.js +4 -2
  182. package/dist/node/runtime/browser/util.js.map +1 -1
  183. package/dist/node/runtime/node/addresses-rewriter-proxy-server.js +3 -3
  184. package/dist/node/runtime/node/addresses-rewriter-proxy-server.js.map +1 -1
  185. package/dist/node/runtime/node/community/challenges/index.js +3 -3
  186. package/dist/node/runtime/node/community/challenges/index.js.map +1 -1
  187. package/dist/node/runtime/node/community/challenges/pkc-js-challenges/publication-match.js +4 -4
  188. package/dist/node/runtime/node/community/challenges/pkc-js-challenges/publication-match.js.map +1 -1
  189. package/dist/node/runtime/node/community/db-handler.js +32 -32
  190. package/dist/node/runtime/node/community/db-handler.js.map +1 -1
  191. package/dist/node/runtime/node/community/local-community/challenges.js +7 -7
  192. package/dist/node/runtime/node/community/local-community/challenges.js.map +1 -1
  193. package/dist/node/runtime/node/community/local-community/comment-updates.js +5 -5
  194. package/dist/node/runtime/node/community/local-community/comment-updates.js.map +1 -1
  195. package/dist/node/runtime/node/community/local-community/db-state.js +8 -8
  196. package/dist/node/runtime/node/community/local-community/db-state.js.map +1 -1
  197. package/dist/node/runtime/node/community/local-community/editing.js +6 -6
  198. package/dist/node/runtime/node/community/local-community/editing.js.map +1 -1
  199. package/dist/node/runtime/node/community/local-community/ipns-publishing.js +10 -7
  200. package/dist/node/runtime/node/community/local-community/ipns-publishing.js.map +1 -1
  201. package/dist/node/runtime/node/community/local-community/lifecycle.js +4 -4
  202. package/dist/node/runtime/node/community/local-community/lifecycle.js.map +1 -1
  203. package/dist/node/runtime/node/community/local-community/publication-store.js +13 -19
  204. package/dist/node/runtime/node/community/local-community/publication-store.js.map +1 -1
  205. package/dist/node/runtime/node/community/local-community/publication-validation.js +10 -10
  206. package/dist/node/runtime/node/community/local-community/publication-validation.js.map +1 -1
  207. package/dist/node/runtime/node/community/local-community/reprovide-on-address-change.js +5 -5
  208. package/dist/node/runtime/node/community/local-community/reprovide-on-address-change.js.map +1 -1
  209. package/dist/node/runtime/node/community/local-community.js +7 -7
  210. package/dist/node/runtime/node/community/local-community.js.map +1 -1
  211. package/dist/node/runtime/node/community/page-generator.js +5 -7
  212. package/dist/node/runtime/node/community/page-generator.js.map +1 -1
  213. package/dist/node/runtime/node/setup-kubo-address-rewriter-and-http-router.js +2 -2
  214. package/dist/node/runtime/node/setup-kubo-address-rewriter-and-http-router.js.map +1 -1
  215. package/dist/node/runtime/node/sqlite-lru-cache.js +2 -2
  216. package/dist/node/runtime/node/sqlite-lru-cache.js.map +1 -1
  217. package/dist/node/runtime/node/util.d.ts +1 -1
  218. package/dist/node/runtime/node/util.js +12 -8
  219. package/dist/node/runtime/node/util.js.map +1 -1
  220. package/dist/node/schema/schema.js +4 -4
  221. package/dist/node/schema/schema.js.map +1 -1
  222. package/dist/node/signer/constants.d.ts +1 -2
  223. package/dist/node/signer/constants.js +9 -1
  224. package/dist/node/signer/constants.js.map +1 -1
  225. package/dist/node/signer/signatures.js +14 -12
  226. package/dist/node/signer/signatures.js.map +1 -1
  227. package/dist/node/stats.js +5 -5
  228. package/dist/node/stats.js.map +1 -1
  229. package/dist/node/test/test-util.d.ts +9 -10
  230. package/dist/node/test/test-util.js +25 -37
  231. package/dist/node/test/test-util.js.map +1 -1
  232. package/dist/node/types.d.ts +1 -1
  233. package/dist/node/util.d.ts +2 -2
  234. package/dist/node/util.js +24 -22
  235. package/dist/node/util.js.map +1 -1
  236. package/package.json +2 -2
  237. package/dist/bundled/chunks/schema-qXcvCeAO.js +0 -34744
@@ -1,2 +1,2 @@
1
- import { n as createNewLocalCommunityDb, r as updateInstancePropsWithStartedCommunityOrDb, t as LocalCommunity } from "./local-community-Bdasy8ZJ.js";
1
+ import { n as createNewLocalCommunityDb, r as updateInstancePropsWithStartedCommunityOrDb, t as LocalCommunity } from "./local-community-DYvRQWsK.js";
2
2
  export { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb };
@@ -1,10 +1,12 @@
1
- import { B as isIpfsCid, Cn as CommentUpdateForChallengeVerificationSchema, Cr as parsedType, Ct as findUpdatingCommunity, D as deepMergeRuntimeFields, Dr as __require, Dt as refreshTrackedCommentAliases, E as createAbortError, En as CommentUpdateSchema, Et as listUpdatingCommunities, It as require_sha256, L as hideClassPrivateProps, Lt as TimeoutError, Or as __toESM, Pt as untrackUpdatingComment, Q as isStringDomain, Qn as CID, Rt as pTimeout, Sr as joinValues, St as findUpdatingComment, Tr as __commonJSMin, Tt as listUpdatingComments, Xn as require_commonjs, Zn as require_retry, _t as timestamp, a as ChallengeRequestMessageSchema, b as areEquivalentCommunityAddresses, cn as PubsubTopicSchema, cr as logger_default, ct as resolveWhenPredicateIsTrue, dr as setErrorMap, ft as shortifyAddress, jt as trackUpdatingComment, k as doesDomainAddressHaveCapitalLetter, lr as require_supports_color, mt as sleepUntilTimeoutOrAbort, nn as CommunityIpfsSchema, or as PKCError, ot as removeUndefinedValuesRecursively, pt as shortifyCid, r as ChallengeMessageSchema, s as ChallengeVerificationMessageSchema, sr as messages, st as replaceXWithY, t as ChallengeAnswerMessageSchema, tr as FailedToFetchCommentIpfsFromGatewaysError, ut as retryKuboIpfsAdd, vn as CommentIpfsSchema, vt as waitForUpdateInCommunityInstanceWithErrorAndTimeout, wr as stringifyPrimitive, wt as listStartedCommunities, xt as findStartedCommunity, y as version_default, z as isAbortError } from "./schema-qXcvCeAO.js";
2
- import { $ as RepliesPages, $t as parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, An as RpcCidParamSchema, At as verifyCommunityEdit, B as setNativeFunctions$1, Bn as RpcFetchCidResultSchema, Bt as getCommunityPublicKeyFromWire, Cn as parseRpcCommentEventWithPKCErrorIfItFails, Ct as verifyChallengeVerification, D as createKuboRpcClient, Dn as parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails, Dt as verifyCommentPubsubMessage, Et as verifyCommentModeration, Fn as RpcExportCommunityModLogsParamSchema, Gn as RpcUnsubscribeParamSchema, H as CommentClientsManager, Hn as RpcResolveAuthorNameResultSchema, Ht as decode, I as listCommunitiesSync, In as RpcExportCommunityModLogsResultSchema, It as normalizeCreatePublicationAuthor, L as monitorCommunitiesDirectory, Ln as RpcExportCommunityParamSchema, Lt as buildRuntimeCommunityFields, Mn as RpcCommunityIdentifierParamSchema, Mt as buildRuntimeAuthor, N as getDefaultDataPath, Nn as RpcCommunityPageParamSchema, Nt as cleanWireAuthor, On as RpcAuthorNameParamSchema, Ot as verifyCommentUpdate, Pn as RpcEditCommunityParamSchema, Pt as getAuthorNameFromRuntime, Q as parseRawPages, Rn as RpcExportCommunityResultSchema, Rt as getCommunityAddressFromRecord, Sn as parsePKCUserOptionsSchemaWithPKCErrorIfItFails, Tn as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, Tt as verifyCommentIpfs, Un as RpcSubscriptionIdResultSchema, V as tryToDeleteCommunitiesThatFailedToBeDeletedBefore, Vn as RpcPublishChallengeAnswersParamSchema, Vt as normalizeCommunityInputFromCommunity, Wn as RpcSuccessResultSchema, Wt as getBufferedPKCAddressFromPublicKey, X as findCommentInPageInstanceRecursively, Xn as require_undici, Xt as parseCidStringSchemaWithPKCErrorIfItFails, Y as extractCommunityRuntimeFieldsFromParsedPages, Yn as nativeFunctions$2, _n as parseCreateVoteOptionsSchemaWithPKCErrorIfItFails, a as pkcJsChallenges, at as PKCTypedEmitter, bn as parseDecryptedChallengeWithPKCErrorIfItFails, c as AddressesRewriterProxyServer, ct as signChallengeAnswer, dn as parseCreateCommentOptionsSchemaWithPKCErrorIfItFails, en as parseCommentIpfsSchemaWithPKCErrorIfItFails, et as PublicationClientsManager, f as KeyvBetterSqlite3, fn as parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails, ft as signComment, g as decodeRpcChallengeVerificationPubsubMsg, gn as parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, h as decodeRpcChallengeRequestPubsubMsg, hn as parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, in as parseCommunityAddressWithPKCErrorIfItFails, jn as RpcCommentRepliesPageParamSchema, jt as verifyVote, kn as RpcCancelExportParamSchema, ln as parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails, m as decodeRpcChallengePubsubMsg, mt as signCommentModeration, n as RpcRemoteCommunity, nn as parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails, nt as InflightFetchManager, o as TrackedInstanceRegistry, ot as require_lib$1, p as decodeRpcChallengeAnswerPubsubMsg, pt as signCommentEdit, rn as parseCommentPubsubMessagePublicationWithPKCErrorIfItFails, s as LRUCache, sn as parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, st as cleanUpBeforePublishing, t as RpcLocalCommunity, tt as PKCClientsManager, u as RemoteCommunity, un as parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails, ut as signChallengeRequest, v as createSigner, vn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, vt as signCommunityEdit, wn as parseRpcCommentUpdateEventWithPKCErrorIfItFails, wt as verifyCommentEdit, x as encryptEd25519AesGcm, xn as parseJsonWithPKCErrorIfFails, xt as verifyChallengeMessage, y as decryptEd25519AesGcm, yn as parseDecryptedChallengeVerification, yt as signVote, zn as RpcFetchCidParamSchema, zt as getCommunityNameFromWire } from "./rpc-local-community-NkCEOv2-.js";
3
- import { n as getHeliaDebugContext } from "./util-DpR-szdu.js";
1
+ import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
2
+ import { B as isIpfsCid, Cn as CommentUpdateForChallengeVerificationSchema, Ct as findUpdatingCommunity, D as deepMergeRuntimeFields, Dt as refreshTrackedCommentAliases, E as createAbortError, En as CommentUpdateSchema, Et as listUpdatingCommunities, Fr as stringifyPrimitive, It as require_sha256, L as hideClassPrivateProps, Lt as TimeoutError, Nr as joinValues, Pr as parsedType, Pt as untrackUpdatingComment, Q as isStringDomain, Qn as n$1, Rt as pTimeout, Sr as setErrorMap, St as findUpdatingComment, Tt as listUpdatingComments, Xn as n$2, _r as PKCError, _t as timestamp, a as ChallengeRequestMessageSchema, b as areEquivalentCommunityAddresses, br as require_supports_color, cn as PubsubTopicSchema, ct as resolveWhenPredicateIsTrue, dr as require_retry, er as t$1, fr as FailedToFetchCommentIpfsFromGatewaysError, ft as shortifyAddress, ir as r, jt as trackUpdatingComment, k as doesDomainAddressHaveCapitalLetter, mt as sleepUntilTimeoutOrAbort, nn as CommunityIpfsSchema, nr as e$1, ot as removeUndefinedValuesRecursively, pt as shortifyCid, r as ChallengeMessageSchema, s as ChallengeVerificationMessageSchema, st as replaceXWithY, t as ChallengeAnswerMessageSchema, tr as e, ut as retryKuboIpfsAdd, vn as CommentIpfsSchema, vr as messages, vt as waitForUpdateInCommunityInstanceWithErrorAndTimeout, wt as listStartedCommunities, xt as findStartedCommunity, y as version_default, yr as logger_default, z as isAbortError } from "./schema-Dtvt2tQ8.js";
3
+ import { $ as RepliesPages, $n as t$5, $t as parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, An as RpcCidParamSchema, At as verifyCommunityEdit, B as setNativeFunctions$1, Bn as RpcFetchCidResultSchema, Bt as getCommunityPublicKeyFromWire, Cn as parseRpcCommentEventWithPKCErrorIfItFails, Ct as verifyChallengeVerification, D as createKuboRpcClient, Dn as parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails, Dt as verifyCommentPubsubMessage, Et as verifyCommentModeration, Fn as RpcExportCommunityModLogsParamSchema, Gn as RpcUnsubscribeParamSchema, H as CommentClientsManager, Hn as RpcResolveAuthorNameResultSchema, Ht as decode, I as listCommunitiesSync, In as RpcExportCommunityModLogsResultSchema, It as normalizeCreatePublicationAuthor, Kn as t$4, L as monitorCommunitiesDirectory, Ln as RpcExportCommunityParamSchema, Lt as buildRuntimeCommunityFields, Mn as RpcCommunityIdentifierParamSchema, Mt as buildRuntimeAuthor, N as getDefaultDataPath, Nn as RpcCommunityPageParamSchema, Nt as cleanWireAuthor, On as RpcAuthorNameParamSchema, Ot as verifyCommentUpdate, Pn as RpcEditCommunityParamSchema, Pt as getAuthorNameFromRuntime, Q as parseRawPages, Qn as t$2, Rn as RpcExportCommunityResultSchema, Rt as getCommunityAddressFromRecord, Sn as parsePKCUserOptionsSchemaWithPKCErrorIfItFails, Tn as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, Tt as verifyCommentIpfs, Un as RpcSubscriptionIdResultSchema, V as tryToDeleteCommunitiesThatFailedToBeDeletedBefore, Vn as RpcPublishChallengeAnswersParamSchema, Vt as normalizeCommunityInputFromCommunity, Wn as RpcSuccessResultSchema, Wt as getBufferedPKCAddressFromPublicKey, X as findCommentInPageInstanceRecursively, Xn as n$3, Xt as parseCidStringSchemaWithPKCErrorIfItFails, Y as extractCommunityRuntimeFieldsFromParsedPages, Yn as t$3, _n as parseCreateVoteOptionsSchemaWithPKCErrorIfItFails, a as pkcJsChallenges, at as PKCTypedEmitter, bn as parseDecryptedChallengeWithPKCErrorIfItFails, c as AddressesRewriterProxyServer, ct as signChallengeAnswer, dn as parseCreateCommentOptionsSchemaWithPKCErrorIfItFails, en as parseCommentIpfsSchemaWithPKCErrorIfItFails, et as PublicationClientsManager, f as KeyvBetterSqlite3, fn as parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails, ft as signComment, g as decodeRpcChallengeVerificationPubsubMsg, gn as parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, h as decodeRpcChallengeRequestPubsubMsg, hn as parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, in as parseCommunityAddressWithPKCErrorIfItFails, ir as require_undici, jn as RpcCommentRepliesPageParamSchema, jt as verifyVote, kn as RpcCancelExportParamSchema, ln as parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails, m as decodeRpcChallengePubsubMsg, mt as signCommentModeration, n as RpcRemoteCommunity, nn as parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails, nt as InflightFetchManager, o as TrackedInstanceRegistry, ot as require_lib$1, p as decodeRpcChallengeAnswerPubsubMsg, pt as signCommentEdit, rn as parseCommentPubsubMessagePublicationWithPKCErrorIfItFails, rr as nativeFunctions$2, s as LRUCache, sn as parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, st as cleanUpBeforePublishing, t as RpcLocalCommunity, tt as PKCClientsManager, u as RemoteCommunity, un as parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails, ut as signChallengeRequest, v as createSigner, vn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, vt as signCommunityEdit, wn as parseRpcCommentUpdateEventWithPKCErrorIfItFails, wt as verifyCommentEdit, x as encryptEd25519AesGcm, xn as parseJsonWithPKCErrorIfFails, xt as verifyChallengeMessage, y as decryptEd25519AesGcm, yn as parseDecryptedChallengeVerification, yt as signVote, zn as RpcFetchCidParamSchema, zt as getCommunityNameFromWire } from "./rpc-local-community-1Uvl5iwp.js";
4
+ import { n as getHeliaDebugContext } from "./util-CjfTxkQ8.js";
4
5
  import path from "path";
5
6
  import assert from "assert";
6
7
  import fs from "fs";
7
8
  import Database from "better-sqlite3";
9
+ import { CID } from "multiformats/cid";
8
10
  import { of } from "typestub-ipfs-only-hash";
9
11
  import EventEmitter from "events";
10
12
  import { Client } from "rpc-websockets";
@@ -141,10 +143,15 @@ if (Number(process.versions.node.split(".")[0]) >= 18) {
141
143
  }
142
144
  if (typeof globalThis.WebSocket === "undefined") Reflect.set(globalThis, "WebSocket", import_undici.WebSocket);
143
145
  //#endregion
146
+ //#region node_modules/remeda/dist/sortBy.js
147
+ function t(...t) {
148
+ return t$2(n, t);
149
+ }
150
+ const n = (e, t) => [...e].sort(t);
151
+ //#endregion
144
152
  //#region dist/node/publications/publication.js
145
153
  var import_retry = /* @__PURE__ */ __toESM(require_retry(), 1);
146
154
  var import_lib = require_lib$1();
147
- var import_commonjs = /* @__PURE__ */ __toESM(require_commonjs(), 1);
148
155
  var Publication = class extends import_lib.TypedEmitter {
149
156
  constructor(pkc) {
150
157
  super();
@@ -466,7 +473,7 @@ var Publication = class extends import_lib.TypedEmitter {
466
473
  return;
467
474
  }
468
475
  if (pubsubMsgParsed.type === "CHALLENGEREQUEST" || pubsubMsgParsed.type === "CHALLENGEANSWER") log.trace("Received unrelated pubsub message of type", pubsubMsgParsed.type);
469
- else if (!Object.values(this._challengeExchanges).some((exchange) => import_commonjs.isDeepEqual(pubsubMsgParsed.challengeRequestId, exchange.challengeRequest.challengeRequestId))) log.trace(`Received pubsub message with different challenge request id, ignoring it`);
476
+ else if (!Object.values(this._challengeExchanges).some((exchange) => t$3(pubsubMsgParsed.challengeRequestId, exchange.challengeRequest.challengeRequestId))) log.trace(`Received pubsub message with different challenge request id, ignoring it`);
470
477
  else if (pubsubMsgParsed.type === "CHALLENGE") return this._handleIncomingChallengePubsubMessage(pubsubMsgParsed);
471
478
  else if (pubsubMsgParsed.type === "CHALLENGEVERIFICATION") return this._handleIncomingChallengeVerificationPubsubMessage(pubsubMsgParsed);
472
479
  }
@@ -587,7 +594,7 @@ var Publication = class extends import_lib.TypedEmitter {
587
594
  this.emit("statechange", newState);
588
595
  }
589
596
  _setRpcClientState(newState) {
590
- const currentRpcUrl = import_commonjs.keys.strict(this.clients.pkcRpcClients)[0];
597
+ const currentRpcUrl = t$1(this.clients.pkcRpcClients)[0];
591
598
  if (newState === this.clients.pkcRpcClients[currentRpcUrl].state) return;
592
599
  this.clients.pkcRpcClients[currentRpcUrl].state = newState;
593
600
  this.clients.pkcRpcClients[currentRpcUrl].emit("statechange", newState);
@@ -803,7 +810,7 @@ var Publication = class extends import_lib.TypedEmitter {
803
810
  };
804
811
  const omitEncrypted = (msg) => {
805
812
  if (!msg) return void 0;
806
- return import_commonjs.omit(msg, ["encrypted"]);
813
+ return n$1(msg, ["encrypted"]);
807
814
  };
808
815
  return Object.values(this._challengeExchanges).map((exchange) => ({
809
816
  challengeRequest: omitEncrypted(exchange.challengeRequest),
@@ -903,7 +910,7 @@ var Publication = class extends import_lib.TypedEmitter {
903
910
  }
904
911
  }
905
912
  _getPubsubProviders() {
906
- const providers = this.clients.libp2pJsClients && import_commonjs.keys.strict(this.clients.libp2pJsClients).length > 0 ? import_commonjs.keys.strict(this.clients.libp2pJsClients) : import_commonjs.keys.strict(this.clients.pubsubKuboRpcClients);
913
+ const providers = this.clients.libp2pJsClients && t$1(this.clients.libp2pJsClients).length > 0 ? t$1(this.clients.libp2pJsClients) : t$1(this.clients.pubsubKuboRpcClients);
907
914
  if (providers.length === 0) throw new PKCError("ERR_NO_PUBSUB_PROVIDERS_AVAILABLE_TO_PUBLISH_OVER_PUBSUB", { providers });
908
915
  if (providers.length === 1) providers.push(providers[0]);
909
916
  return providers;
@@ -916,14 +923,14 @@ var Publication = class extends import_lib.TypedEmitter {
916
923
  if (challenge.challengeRequestId.toString() === challengeRequest.challengeRequestId.toString()) {
917
924
  const encryptedFields = ["challenges"];
918
925
  log("Received a challenge from the local community", challenge);
919
- await this._handleIncomingChallengePubsubMessage(import_commonjs.omit(challenge, encryptedFields));
926
+ await this._handleIncomingChallengePubsubMessage(n$1(challenge, encryptedFields));
920
927
  }
921
928
  };
922
929
  community.on("challenge", communityChallengeListener);
923
930
  const communityChallengeVerificationListener = async (decryptedChallengeVerification) => {
924
931
  if (decryptedChallengeVerification.challengeRequestId.toString() === challengeRequest.challengeRequestId.toString()) {
925
932
  log("Received a challenge verification from the local community", decryptedChallengeVerification);
926
- await this._handleIncomingChallengeVerificationPubsubMessage(import_commonjs.omit(decryptedChallengeVerification, ["comment", "commentUpdate"]));
933
+ await this._handleIncomingChallengeVerificationPubsubMessage(n$1(decryptedChallengeVerification, ["comment", "commentUpdate"]));
927
934
  }
928
935
  };
929
936
  community.on("challengeverification", communityChallengeVerificationListener);
@@ -1092,9 +1099,9 @@ var Comment = class extends Publication {
1092
1099
  const log = logger_default("pkc-js:comment:_initIpfsProps");
1093
1100
  this.raw.comment = props;
1094
1101
  this._initProps(props);
1095
- const unknownProps = import_commonjs.difference(import_commonjs.keys.strict(props), import_commonjs.keys.strict(CommentIpfsSchema.shape));
1102
+ const unknownProps = r(t$1(props), t$1(CommentIpfsSchema.shape));
1096
1103
  if (unknownProps.length > 0) {
1097
- const unknownPropsWithValues = import_commonjs.pick(props, unknownProps);
1104
+ const unknownPropsWithValues = t$4(props, unknownProps);
1098
1105
  log(`Found unknown props on loaded CommentIpfs (cid: ${this.cid})`, unknownPropsWithValues, "Full props:", props, "Will set them on the Comment instance");
1099
1106
  Object.assign(this, unknownPropsWithValues);
1100
1107
  }
@@ -1177,10 +1184,10 @@ var Comment = class extends Publication {
1177
1184
  const log = logger_default("pkc-js:comment:_initCommentUpdate");
1178
1185
  if ("depth" in props) {} else {
1179
1186
  this.raw.commentUpdate = props;
1180
- const unknownProps = import_commonjs.difference(import_commonjs.keys.strict(props), import_commonjs.keys.strict(CommentUpdateSchema.shape));
1187
+ const unknownProps = r(t$1(props), t$1(CommentUpdateSchema.shape));
1181
1188
  if (unknownProps.length > 0) {
1182
1189
  log("Found unknown props on CommentUpdate record", unknownProps, "Will set them on Comment instance");
1183
- Object.assign(this, import_commonjs.pick(props, unknownProps));
1190
+ Object.assign(this, t$4(props, unknownProps));
1184
1191
  }
1185
1192
  }
1186
1193
  this.upvoteCount = props.upvoteCount;
@@ -1235,7 +1242,7 @@ var Comment = class extends Publication {
1235
1242
  pageCids: {}
1236
1243
  });
1237
1244
  else if ("pages" in newReplies && newReplies.pages && "pageCids" in newReplies && newReplies.pageCids) {
1238
- if (!import_commonjs.isDeepEqual(this.replies.pageCids, newReplies.pageCids)) {
1245
+ if (!t$3(this.replies.pageCids, newReplies.pageCids)) {
1239
1246
  log.trace(`Updating the props of comment instance (${this.cid}) replies`);
1240
1247
  const parsedPages = parseRawPages(newReplies);
1241
1248
  this.replies.updateProps({
@@ -1249,10 +1256,9 @@ var Comment = class extends Publication {
1249
1256
  async _verifyChallengeVerificationCommentProps(decryptedVerification) {
1250
1257
  const log = logger_default("pkc-js:comment:publish:_verifyChallengeVerificationCommentProps");
1251
1258
  if (!this.raw.pubsubMessageToPublish) throw Error("comment._pubsubMsgToPublish should be defined at this point");
1252
- const keysToCompare = import_commonjs.keys.strict(import_commonjs.omit(this.raw.pubsubMessageToPublish, ["signature", "author"]));
1253
- const pubsubMsgFromCommentIpfs = import_commonjs.pick(decryptedVerification.comment, keysToCompare);
1254
- const pubsubMsgFromPublishedPubsubMsg = import_commonjs.pick(this.raw.pubsubMessageToPublish, keysToCompare);
1255
- if (!import_commonjs.isDeepEqual(pubsubMsgFromCommentIpfs, pubsubMsgFromPublishedPubsubMsg)) {
1259
+ const keysToCompare = t$1(n$1(this.raw.pubsubMessageToPublish, ["signature", "author"]));
1260
+ const pubsubMsgFromCommentIpfs = t$4(decryptedVerification.comment, keysToCompare);
1261
+ if (!t$3(pubsubMsgFromCommentIpfs, t$4(this.raw.pubsubMessageToPublish, keysToCompare))) {
1256
1262
  const error = new PKCError("ERR_COMMUNITY_CHANGED_COMMENT_PUBSUB_PUBLICATION_PROPS", {
1257
1263
  pubsubMsgFromSub: pubsubMsgFromCommentIpfs,
1258
1264
  originalPubsubMsg: this.raw.pubsubMessageToPublish
@@ -1354,10 +1360,10 @@ var Comment = class extends Publication {
1354
1360
  this.setCid(decryptedVerification.commentUpdate.cid);
1355
1361
  this._initIpfsProps(decryptedVerification.comment);
1356
1362
  this._initCommentUpdateFromChallengeVerificationProps(decryptedVerification.commentUpdate);
1357
- const unknownProps = import_commonjs.difference(import_commonjs.keys.strict(decryptedVerification.commentUpdate), import_commonjs.keys.strict(CommentUpdateForChallengeVerificationSchema.shape));
1363
+ const unknownProps = r(t$1(decryptedVerification.commentUpdate), t$1(CommentUpdateForChallengeVerificationSchema.shape));
1358
1364
  if (unknownProps.length > 0) {
1359
1365
  log("Found unknown props on decryptedVerification.commentUpdate record", unknownProps, "Will set them on Comment instance");
1360
- Object.assign(this, import_commonjs.pick(decryptedVerification.commentUpdate, unknownProps));
1366
+ Object.assign(this, t$4(decryptedVerification.commentUpdate, unknownProps));
1361
1367
  }
1362
1368
  this.emit("update", this);
1363
1369
  if (!this._pkc._pkcRpcClient) this._resolveAuthorNamesInBackground();
@@ -1549,7 +1555,7 @@ var Comment = class extends Publication {
1549
1555
  this.emit("updatingstatechange", this._updatingState);
1550
1556
  }
1551
1557
  _setRpcClientState(newState) {
1552
- const currentRpcUrl = import_commonjs.keys.strict(this.clients.pkcRpcClients)[0];
1558
+ const currentRpcUrl = t$1(this.clients.pkcRpcClients)[0];
1553
1559
  if (newState === this.clients.pkcRpcClients[currentRpcUrl].state) return;
1554
1560
  this.clients.pkcRpcClients[currentRpcUrl].state = newState;
1555
1561
  this.clients.pkcRpcClients[currentRpcUrl].emit("statechange", newState);
@@ -1781,7 +1787,7 @@ var Comment = class extends Publication {
1781
1787
  updatingCommentInstance.on("error", this._updatingCommentInstance.error);
1782
1788
  updatingCommentInstance.on("updatingstatechange", this._updatingCommentInstance.updatingstatechange);
1783
1789
  updatingCommentInstance.on("statechange", this._updatingCommentInstance.statechange);
1784
- const clientKeys = import_commonjs.keys.strict(this.clients);
1790
+ const clientKeys = t$1(this.clients);
1785
1791
  for (const clientType of clientKeys) if (this.clients[clientType]) for (const clientUrl of Object.keys(this.clients[clientType])) this.clients[clientType][clientUrl].mirror(updatingCommentInstance.clients[clientType][clientUrl]);
1786
1792
  updatingCommentInstance._numOfListenersForUpdatingInstance++;
1787
1793
  this._useUpdatePropsFromUpdatingCommentIfPossible();
@@ -1839,7 +1845,7 @@ var Comment = class extends Publication {
1839
1845
  this._updatingCommentInstance.comment.removeListener("updatingstatechange", this._updatingCommentInstance.updatingstatechange);
1840
1846
  this._updatingCommentInstance.comment.removeListener("update", this._updatingCommentInstance.update);
1841
1847
  this._updatingCommentInstance.comment.removeListener("error", this._updatingCommentInstance.error);
1842
- const clientKeys = import_commonjs.keys.strict(this.clients);
1848
+ const clientKeys = t$1(this.clients);
1843
1849
  for (const clientType of clientKeys) if (this.clients[clientType]) for (const clientUrl of Object.keys(this.clients[clientType])) this.clients[clientType][clientUrl].unmirror();
1844
1850
  this._updatingCommentInstance.comment._numOfListenersForUpdatingInstance--;
1845
1851
  if (this._updatingCommentInstance.comment._numOfListenersForUpdatingInstance === 0 && this._updatingCommentInstance.comment.state !== "stopped") {
@@ -2013,16 +2019,16 @@ var Stats = class {
2013
2019
  return 1 / (successAverageMs + 150) / (1 / (successAverageMs + 100) + 1 / 150) * .2 + (successCounts + .288) / (failureCounts * 2 + successCounts + 1) * .8;
2014
2020
  }
2015
2021
  async sortGatewaysAccordingToScore(type) {
2016
- const gatewayType = type === "ipfs" || type === "ipns" ? "ipfsGateways" : type === "pubsub-publish" || type === "pubsub-subscribe" ? import_commonjs.keys.strict(this._pkc.clients.pubsubKuboRpcClients).length > 0 ? "pubsubKuboRpcClients" : import_commonjs.keys.strict(this._pkc.clients.libp2pJsClients).length > 0 ? "libp2pJsClients" : void 0 : void 0;
2022
+ const gatewayType = type === "ipfs" || type === "ipns" ? "ipfsGateways" : type === "pubsub-publish" || type === "pubsub-subscribe" ? t$1(this._pkc.clients.pubsubKuboRpcClients).length > 0 ? "pubsubKuboRpcClients" : t$1(this._pkc.clients.libp2pJsClients).length > 0 ? "libp2pJsClients" : void 0 : void 0;
2017
2023
  assert(gatewayType, "Can't find the gateway type to sort");
2018
- const gateways = import_commonjs.keys.strict(this._pkc.clients[gatewayType]);
2024
+ const gateways = t$1(this._pkc.clients[gatewayType]);
2019
2025
  const score = async (gatewayUrl) => {
2020
2026
  const failureCounts = await this._pkc._storage.getItem(this._getFailuresCountKey(gatewayUrl, type)) || 0;
2021
2027
  const successCounts = await this._pkc._storage.getItem(this._getSuccessCountKey(gatewayUrl, type)) || 0;
2022
2028
  const successAverageMs = await this._pkc._storage.getItem(this._getSuccessAverageKey(gatewayUrl, type)) || 0;
2023
2029
  return this._gatewayScore(failureCounts, successCounts, successAverageMs);
2024
2030
  };
2025
- return import_commonjs.sortBy.strict(gateways, score);
2031
+ return t(gateways, score);
2026
2032
  }
2027
2033
  };
2028
2034
  //#endregion
@@ -6340,7 +6346,7 @@ var SqliteCache = class {
6340
6346
  key,
6341
6347
  now: now()
6342
6348
  });
6343
- if (!import_commonjs.isPlainObject(res) || !("value" in res)) return;
6349
+ if (!e(res) || !("value" in res)) return;
6344
6350
  let value = res.value;
6345
6351
  return import_cbor.default.decode(value);
6346
6352
  }
@@ -8562,7 +8568,7 @@ async function _setHttpRouterOptionsOnKuboNode(kuboClient, routingValue) {
8562
8568
  await _setProvideDhtSweepEnabledOnKuboNode(kuboClient, false);
8563
8569
  const endpointsBefore = Object.values(routingConfigBeforeChanging?.Routers || {}).map((router) => router.Parameters?.Endpoint).filter((endpoint) => endpoint !== void 0);
8564
8570
  const endpointsAfter = Object.values(mergedRoutingValue.Routers).map((router) => router.Parameters?.Endpoint).filter((endpoint) => endpoint !== void 0);
8565
- if (!import_commonjs.isDeepEqual(endpointsBefore.sort(), endpointsAfter.sort())) {
8571
+ if (!t$3(endpointsBefore.sort(), endpointsAfter.sort())) {
8566
8572
  log("Config on kubo node has been changed. PKC-js will send shutdown command to node", kuboClient._clientOptions.url, "Clients of pkc-js should restart ipfs node");
8567
8573
  const shutdownUrl = `${kuboClient._clientOptions.url}/shutdown`;
8568
8574
  try {
@@ -8798,8 +8804,8 @@ var PKC$1 = class extends PKCTypedEmitter {
8798
8804
  });
8799
8805
  this._promiseToWaitForFirstCommunitieschangeEvent = new Promise((resolve) => this.once("communitieschange", resolve));
8800
8806
  this.clients = {};
8801
- this._initKuboRpcClientsIfNeeded();
8802
- this._initKuboPubsubClientsIfNeeded();
8807
+ this.clients.kuboRpcClients = {};
8808
+ this.clients.pubsubKuboRpcClients = {};
8803
8809
  this._initRpcClientsIfNeeded();
8804
8810
  this._initIpfsGatewaysIfNeeded();
8805
8811
  this._initMemCaches();
@@ -8825,11 +8831,11 @@ var PKC$1 = class extends PKCTypedEmitter {
8825
8831
  nameResolvedCache: new LRUCache({ max: 5e3 })
8826
8832
  };
8827
8833
  }
8828
- _initKuboRpcClientsIfNeeded() {
8834
+ async _initKuboRpcClientsIfNeeded() {
8829
8835
  this.clients.kuboRpcClients = {};
8830
8836
  if (!this.kuboRpcClientsOptions) return;
8831
8837
  for (const clientOptions of this.kuboRpcClientsOptions) {
8832
- const kuboRpcClient = createKuboRpcClient(clientOptions);
8838
+ const kuboRpcClient = await createKuboRpcClient(clientOptions);
8833
8839
  this.clients.kuboRpcClients[clientOptions.url.toString()] = {
8834
8840
  _client: kuboRpcClient,
8835
8841
  _clientOptions: clientOptions,
@@ -8839,18 +8845,17 @@ var PKC$1 = class extends PKCTypedEmitter {
8839
8845
  };
8840
8846
  }
8841
8847
  }
8842
- _initKuboPubsubClientsIfNeeded() {
8848
+ async _initKuboPubsubClientsIfNeeded() {
8843
8849
  this.clients.pubsubKuboRpcClients = {};
8844
8850
  if (!this.pubsubKuboRpcClientsOptions) return;
8845
8851
  for (const clientOptions of this.pubsubKuboRpcClientsOptions) {
8846
- const kuboRpcClient = createKuboRpcClient(clientOptions);
8852
+ const kuboRpcClient = await createKuboRpcClient(clientOptions);
8847
8853
  this.clients.pubsubKuboRpcClients[clientOptions.url.toString()] = {
8848
8854
  _client: kuboRpcClient,
8849
8855
  _clientOptions: clientOptions,
8850
8856
  peers: async () => {
8851
8857
  const topics = await kuboRpcClient.pubsub.ls();
8852
- const topicPeers = import_commonjs.flattenDeep(await Promise.all(topics.map((topic) => kuboRpcClient.pubsub.peers(topic))));
8853
- return import_commonjs.unique(topicPeers.map((topicPeer) => topicPeer.toString()));
8858
+ return n$2(n$3(await Promise.all(topics.map((topic) => kuboRpcClient.pubsub.peers(topic)))).map((topicPeer) => topicPeer.toString()));
8854
8859
  },
8855
8860
  url: clientOptions.url.toString(),
8856
8861
  destroy: async () => {}
@@ -8861,7 +8866,7 @@ var PKC$1 = class extends PKCTypedEmitter {
8861
8866
  this.clients.libp2pJsClients = {};
8862
8867
  if (!this.libp2pJsClientsOptions) return;
8863
8868
  if (!this.httpRoutersOptions) throw Error("httpRoutersOptions is required for libp2pJsClient");
8864
- const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-55fcY7oN.js");
8869
+ const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-CYDRSysz.js");
8865
8870
  for (const clientOptions of this.libp2pJsClientsOptions) {
8866
8871
  const heliaNode = await createLibp2pJsClientOrUseExistingOne({
8867
8872
  ...clientOptions,
@@ -8904,6 +8909,8 @@ var PKC$1 = class extends PKCTypedEmitter {
8904
8909
  }
8905
8910
  async _init() {
8906
8911
  const log = logger_default("pkc-js:pkc:_init");
8912
+ await this._initKuboRpcClientsIfNeeded();
8913
+ await this._initKuboPubsubClientsIfNeeded();
8907
8914
  this._storage = new Storage(this);
8908
8915
  await this._storage.init();
8909
8916
  this._stats = new Stats({
@@ -8952,7 +8959,7 @@ var PKC$1 = class extends PKCTypedEmitter {
8952
8959
  }
8953
8960
  }
8954
8961
  async _initMissingFieldsOfPublicationBeforeSigning(pubOptions, log) {
8955
- const finalOptions = import_commonjs.clone(pubOptions);
8962
+ const finalOptions = t$5(pubOptions);
8956
8963
  if (!finalOptions.signer) throw Error("User did not provide a signer to create a local publication");
8957
8964
  let cleanedAuthor = cleanWireAuthor(normalizeCreatePublicationAuthor(finalOptions.author));
8958
8965
  if (cleanedAuthor) {
@@ -8960,7 +8967,7 @@ var PKC$1 = class extends PKCTypedEmitter {
8960
8967
  const val = cleanedAuthor[key];
8961
8968
  if (typeof val === "object" && val !== null && !Array.isArray(val) && Object.keys(val).length === 0) delete cleanedAuthor[key];
8962
8969
  }
8963
- if (import_commonjs.isEmpty(cleanedAuthor)) cleanedAuthor = void 0;
8970
+ if (e$1(cleanedAuthor)) cleanedAuthor = void 0;
8964
8971
  }
8965
8972
  const filledTimestamp = typeof finalOptions.timestamp !== "number" ? timestamp() : finalOptions.timestamp;
8966
8973
  const filledSigner = await this.createSigner(finalOptions.signer);
@@ -9024,7 +9031,7 @@ var PKC$1 = class extends PKCTypedEmitter {
9024
9031
  if (derivedCommunityAddress) commentInstance.setCommunityAddress(derivedCommunityAddress);
9025
9032
  if ("depth" in options) {
9026
9033
  if ("cid" in options) commentInstance.setCid(parseCidStringSchemaWithPKCErrorIfItFails(options.cid));
9027
- const commentIpfs = import_commonjs.omit(options, ["cid"]);
9034
+ const commentIpfs = n$1(options, ["cid"]);
9028
9035
  if (!("signature" in options)) Object.assign(commentInstance, options);
9029
9036
  else commentInstance._initIpfsProps(parseCommentIpfsSchemaWithPKCErrorIfItFails(commentIpfs));
9030
9037
  if (commentInstance.author?.nameResolved !== void 0) delete commentInstance.author.nameResolved;
@@ -9070,7 +9077,7 @@ var PKC$1 = class extends PKCTypedEmitter {
9070
9077
  }
9071
9078
  if (!community.raw.communityIpfs) {
9072
9079
  if (options.signature) {
9073
- const resParseCommunityIpfs = CommunityIpfsSchema.loose().safeParse(import_commonjs.pick(options, [...options.signature.signedPropertyNames, "signature"]));
9080
+ const resParseCommunityIpfs = CommunityIpfsSchema.loose().safeParse(t$4(options, [...options.signature.signedPropertyNames, "signature"]));
9074
9081
  if (resParseCommunityIpfs.success) {
9075
9082
  const cleanedRecord = removeUndefinedValuesRecursively(resParseCommunityIpfs.data);
9076
9083
  await community.initCommunityIpfsPropsNoMerge(cleanedRecord);
@@ -9107,7 +9114,7 @@ var PKC$1 = class extends PKCTypedEmitter {
9107
9114
  const log = logger_default("pkc-js:pkc:createLocalCommunity");
9108
9115
  log.trace("Received community options to create a local community instance:", options);
9109
9116
  if (!this._canCreateNewLocalCommunity()) throw new PKCError("ERR_CAN_NOT_CREATE_A_LOCAL_COMMUNITY", { pkcOptions: this._userPKCOptions });
9110
- const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-Bz-P-EGM.js");
9117
+ const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-DyaGG6lj.js");
9111
9118
  const isLocalCommunity = (await listCommunitiesSync(this)).includes(options.address);
9112
9119
  const community = new LocalCommunity(this);
9113
9120
  if (isLocalCommunity) {