@pkcprotocol/pkc-js 0.0.114 → 0.0.116

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 (149) hide show
  1. package/dist/browser/challenges.d.ts +1 -0
  2. package/dist/browser/challenges.js +1 -1
  3. package/dist/browser/challenges.js.map +1 -1
  4. package/dist/browser/clients/base-client-manager.js +25 -2
  5. package/dist/browser/clients/base-client-manager.js.map +1 -1
  6. package/dist/browser/clients/rpc-client/rpc-schema-util.d.ts +2 -2
  7. package/dist/browser/clients/rpc-client/schema.d.ts +7 -7
  8. package/dist/browser/community/schema.d.ts +72 -72
  9. package/dist/browser/constants.d.ts +2 -1
  10. package/dist/browser/constants.js +3 -0
  11. package/dist/browser/constants.js.map +1 -1
  12. package/dist/browser/errors.d.ts +1 -0
  13. package/dist/browser/errors.js +1 -0
  14. package/dist/browser/errors.js.map +1 -1
  15. package/dist/browser/generated-version.d.ts +1 -1
  16. package/dist/browser/generated-version.js +1 -1
  17. package/dist/browser/index-with-compile-cache.d.ts +4 -4
  18. package/dist/browser/index.d.ts +8 -8
  19. package/dist/browser/page-sorts.d.ts +2 -0
  20. package/dist/browser/page-sorts.js +2 -0
  21. package/dist/browser/page-sorts.js.map +1 -0
  22. package/dist/browser/pages/schema.d.ts +17 -17
  23. package/dist/browser/pkc-error.d.ts +1 -1
  24. package/dist/browser/publications/comment/schema.d.ts +18 -18
  25. package/dist/browser/publications/comment-edit/schema.d.ts +5 -5
  26. package/dist/browser/publications/comment-moderation/schema.d.ts +4 -4
  27. package/dist/browser/publications/community-edit/schema.d.ts +4 -4
  28. package/dist/browser/pubsub-messages/schema.d.ts +9 -9
  29. package/dist/browser/rpc/src/index.d.ts +2 -0
  30. package/dist/browser/rpc/src/index.js +22 -0
  31. package/dist/browser/rpc/src/index.js.map +1 -1
  32. package/dist/browser/rpc/src/lib/pkc-js/index.d.ts +4 -4
  33. package/dist/browser/rpc/src/lib/pkc-js/index.js +3 -1
  34. package/dist/browser/rpc/src/lib/pkc-js/index.js.map +1 -1
  35. package/dist/browser/rpc/src/schema.d.ts +30 -30
  36. package/dist/browser/runtime/node/community/db-handler.d.ts +6 -0
  37. package/dist/browser/runtime/node/community/db-handler.js +33 -1
  38. package/dist/browser/runtime/node/community/db-handler.js.map +1 -1
  39. package/dist/browser/runtime/node/community/local-community/challenges.js +0 -2
  40. package/dist/browser/runtime/node/community/local-community/challenges.js.map +1 -1
  41. package/dist/browser/runtime/node/community/local-community/cleanup.d.ts +4 -2
  42. package/dist/browser/runtime/node/community/local-community/cleanup.js +11 -6
  43. package/dist/browser/runtime/node/community/local-community/cleanup.js.map +1 -1
  44. package/dist/browser/runtime/node/community/local-community/editing.d.ts +2 -1
  45. package/dist/browser/runtime/node/community/local-community/editing.js +10 -7
  46. package/dist/browser/runtime/node/community/local-community/editing.js.map +1 -1
  47. package/dist/browser/runtime/node/community/local-community/ipns-publishing.js +11 -1
  48. package/dist/browser/runtime/node/community/local-community/ipns-publishing.js.map +1 -1
  49. package/dist/browser/runtime/node/community/local-community/lifecycle.js +7 -3
  50. package/dist/browser/runtime/node/community/local-community/lifecycle.js.map +1 -1
  51. package/dist/browser/runtime/node/community/local-community/publication-store.js +51 -27
  52. package/dist/browser/runtime/node/community/local-community/publication-store.js.map +1 -1
  53. package/dist/browser/runtime/node/community/local-community/registry-sync.d.ts +7 -0
  54. package/dist/browser/runtime/node/community/local-community/registry-sync.js +80 -0
  55. package/dist/browser/runtime/node/community/local-community/registry-sync.js.map +1 -0
  56. package/dist/browser/runtime/node/community/local-community.d.ts +2 -1
  57. package/dist/browser/runtime/node/community/local-community.js +3 -0
  58. package/dist/browser/runtime/node/community/local-community.js.map +1 -1
  59. package/dist/browser/runtime/node/community/page-sorts/index.d.ts +9 -0
  60. package/dist/browser/runtime/node/community/page-sorts/index.js +64 -6
  61. package/dist/browser/runtime/node/community/page-sorts/index.js.map +1 -1
  62. package/dist/browser/schema/schema-util.d.ts +12 -12
  63. package/dist/browser/schema.d.ts +32 -32
  64. package/dist/browser/test/test-util.d.ts +30 -30
  65. package/dist/browser/validate-package-factories.d.ts +7 -0
  66. package/dist/browser/validate-package-factories.js +37 -0
  67. package/dist/browser/validate-package-factories.js.map +1 -0
  68. package/dist/bundled/bundle-manifest.json +62 -27
  69. package/dist/bundled/challenges.js +2 -1
  70. package/dist/bundled/chunks/{helia-for-pkc-hSpmyI9D.js → helia-for-pkc-BvltkMx7.js} +2 -2
  71. package/dist/bundled/chunks/{local-community-Dc_fNPrx.js → local-community-Cm4X7RjW.js} +1 -1
  72. package/dist/bundled/chunks/{local-community-EeQMdfYM.js → local-community-nSmHRx5s.js} +165 -46
  73. package/dist/bundled/chunks/{node-apYZl3B3.js → node-CaeXEQ5O.js} +5 -5
  74. package/dist/bundled/chunks/page-sort-scoring-Bj73WnwW.js +112 -0
  75. package/dist/bundled/chunks/{rpc-local-community-C_0FRCqg.js → rpc-local-community-DfJ3wj-p.js} +80 -124
  76. package/dist/bundled/chunks/{util-B2SuJZg-.js → util-DkyQHyK7.js} +1 -1
  77. package/dist/bundled/chunks/{util-DFGl6QDd.js → util-vJMTa4rC.js} +2 -1
  78. package/dist/bundled/chunks/validate-package-factories-tZC8XxoO.js +41 -0
  79. package/dist/bundled/index.js +1 -1
  80. package/dist/bundled/page-sorts.js +2 -0
  81. package/dist/bundled/rpc/src/index.js +17 -4
  82. package/dist/node/challenges.d.ts +1 -0
  83. package/dist/node/challenges.js +1 -1
  84. package/dist/node/challenges.js.map +1 -1
  85. package/dist/node/clients/base-client-manager.js +25 -2
  86. package/dist/node/clients/base-client-manager.js.map +1 -1
  87. package/dist/node/clients/rpc-client/rpc-schema-util.d.ts +2 -2
  88. package/dist/node/clients/rpc-client/schema.d.ts +7 -7
  89. package/dist/node/community/schema.d.ts +72 -72
  90. package/dist/node/constants.d.ts +2 -1
  91. package/dist/node/constants.js +3 -0
  92. package/dist/node/constants.js.map +1 -1
  93. package/dist/node/errors.d.ts +1 -0
  94. package/dist/node/errors.js +1 -0
  95. package/dist/node/errors.js.map +1 -1
  96. package/dist/node/generated-version.d.ts +1 -1
  97. package/dist/node/generated-version.js +1 -1
  98. package/dist/node/index-with-compile-cache.d.ts +4 -4
  99. package/dist/node/index.d.ts +8 -8
  100. package/dist/node/page-sorts.d.ts +2 -0
  101. package/dist/node/page-sorts.js +2 -0
  102. package/dist/node/page-sorts.js.map +1 -0
  103. package/dist/node/pages/schema.d.ts +17 -17
  104. package/dist/node/pkc-error.d.ts +1 -1
  105. package/dist/node/publications/comment/schema.d.ts +18 -18
  106. package/dist/node/publications/comment-edit/schema.d.ts +5 -5
  107. package/dist/node/publications/comment-moderation/schema.d.ts +4 -4
  108. package/dist/node/publications/community-edit/schema.d.ts +4 -4
  109. package/dist/node/pubsub-messages/schema.d.ts +9 -9
  110. package/dist/node/rpc/src/index.d.ts +2 -0
  111. package/dist/node/rpc/src/index.js +22 -0
  112. package/dist/node/rpc/src/index.js.map +1 -1
  113. package/dist/node/rpc/src/lib/pkc-js/index.d.ts +4 -4
  114. package/dist/node/rpc/src/lib/pkc-js/index.js +3 -1
  115. package/dist/node/rpc/src/lib/pkc-js/index.js.map +1 -1
  116. package/dist/node/rpc/src/schema.d.ts +30 -30
  117. package/dist/node/runtime/node/community/db-handler.d.ts +6 -0
  118. package/dist/node/runtime/node/community/db-handler.js +33 -1
  119. package/dist/node/runtime/node/community/db-handler.js.map +1 -1
  120. package/dist/node/runtime/node/community/local-community/challenges.js +0 -2
  121. package/dist/node/runtime/node/community/local-community/challenges.js.map +1 -1
  122. package/dist/node/runtime/node/community/local-community/cleanup.d.ts +4 -2
  123. package/dist/node/runtime/node/community/local-community/cleanup.js +11 -6
  124. package/dist/node/runtime/node/community/local-community/cleanup.js.map +1 -1
  125. package/dist/node/runtime/node/community/local-community/editing.d.ts +2 -1
  126. package/dist/node/runtime/node/community/local-community/editing.js +10 -7
  127. package/dist/node/runtime/node/community/local-community/editing.js.map +1 -1
  128. package/dist/node/runtime/node/community/local-community/ipns-publishing.js +11 -1
  129. package/dist/node/runtime/node/community/local-community/ipns-publishing.js.map +1 -1
  130. package/dist/node/runtime/node/community/local-community/lifecycle.js +7 -3
  131. package/dist/node/runtime/node/community/local-community/lifecycle.js.map +1 -1
  132. package/dist/node/runtime/node/community/local-community/publication-store.js +51 -27
  133. package/dist/node/runtime/node/community/local-community/publication-store.js.map +1 -1
  134. package/dist/node/runtime/node/community/local-community/registry-sync.d.ts +7 -0
  135. package/dist/node/runtime/node/community/local-community/registry-sync.js +80 -0
  136. package/dist/node/runtime/node/community/local-community/registry-sync.js.map +1 -0
  137. package/dist/node/runtime/node/community/local-community.d.ts +2 -1
  138. package/dist/node/runtime/node/community/local-community.js +3 -0
  139. package/dist/node/runtime/node/community/local-community.js.map +1 -1
  140. package/dist/node/runtime/node/community/page-sorts/index.d.ts +9 -0
  141. package/dist/node/runtime/node/community/page-sorts/index.js +64 -6
  142. package/dist/node/runtime/node/community/page-sorts/index.js.map +1 -1
  143. package/dist/node/schema/schema-util.d.ts +12 -12
  144. package/dist/node/schema.d.ts +32 -32
  145. package/dist/node/test/test-util.d.ts +30 -30
  146. package/dist/node/validate-package-factories.d.ts +7 -0
  147. package/dist/node/validate-package-factories.js +37 -0
  148. package/dist/node/validate-package-factories.js.map +1 -0
  149. package/package.json +6 -1
@@ -134,8 +134,9 @@ export declare const CreateCommentOptionsWithRefinementSchema: z.ZodObject<{
134
134
  challengeCommentCids: z.ZodOptional<z.ZodArray<z.ZodString>>;
135
135
  }, z.core.$strip>>;
136
136
  }, z.core.$strict>;
137
- export declare const CommentSignedPropertyNames: ("timestamp" | "flairs" | "author" | "communityPublicKey" | "communityName" | "protocolVersion" | "link" | "spoiler" | "nsfw" | "content" | "title" | "linkWidth" | "linkHeight" | "linkHtmlTagName" | "parentCid" | "postCid" | "quotedCids" | "crosspost")[];
137
+ export declare const CommentSignedPropertyNames: ("link" | "timestamp" | "flairs" | "author" | "communityPublicKey" | "communityName" | "protocolVersion" | "spoiler" | "nsfw" | "content" | "title" | "linkWidth" | "linkHeight" | "linkHtmlTagName" | "parentCid" | "postCid" | "quotedCids" | "crosspost")[];
138
138
  export declare const CommentPubsubMessagePublicationSchema: z.ZodObject<{
139
+ link: z.ZodOptional<z.ZodString>;
139
140
  timestamp: z.ZodNumber;
140
141
  signature: z.ZodObject<{
141
142
  type: z.ZodString;
@@ -181,7 +182,6 @@ export declare const CommentPubsubMessagePublicationSchema: z.ZodObject<{
181
182
  communityPublicKey: z.ZodOptional<z.ZodString>;
182
183
  communityName: z.ZodOptional<z.ZodString>;
183
184
  protocolVersion: z.ZodString;
184
- link: z.ZodOptional<z.ZodString>;
185
185
  spoiler: z.ZodOptional<z.ZodBoolean>;
186
186
  nsfw: z.ZodOptional<z.ZodBoolean>;
187
187
  content: z.ZodOptional<z.ZodString>;
@@ -195,6 +195,7 @@ export declare const CommentPubsubMessagePublicationSchema: z.ZodObject<{
195
195
  crosspost: z.ZodOptional<z.ZodType<Crosspost, Crosspost, z.core.$ZodTypeInternals<Crosspost, Crosspost>>>;
196
196
  }, z.core.$strict>;
197
197
  export declare const CommentPubsubMessageWithFlexibleAuthorSchema: z.ZodObject<{
198
+ link: z.ZodOptional<z.ZodString>;
198
199
  timestamp: z.ZodNumber;
199
200
  signature: z.ZodObject<{
200
201
  type: z.ZodString;
@@ -211,7 +212,6 @@ export declare const CommentPubsubMessageWithFlexibleAuthorSchema: z.ZodObject<{
211
212
  communityPublicKey: z.ZodOptional<z.ZodString>;
212
213
  communityName: z.ZodOptional<z.ZodString>;
213
214
  protocolVersion: z.ZodString;
214
- link: z.ZodOptional<z.ZodString>;
215
215
  spoiler: z.ZodOptional<z.ZodBoolean>;
216
216
  nsfw: z.ZodOptional<z.ZodBoolean>;
217
217
  content: z.ZodOptional<z.ZodString>;
@@ -254,6 +254,7 @@ export declare const CommentPubsubMessageWithFlexibleAuthorSchema: z.ZodObject<{
254
254
  }, z.core.$loose>>;
255
255
  }, z.core.$strict>;
256
256
  export declare const CommentPubsubMessageWithFlexibleAuthorRefinementSchema: z.ZodObject<{
257
+ link: z.ZodOptional<z.ZodString>;
257
258
  timestamp: z.ZodNumber;
258
259
  signature: z.ZodObject<{
259
260
  type: z.ZodString;
@@ -270,7 +271,6 @@ export declare const CommentPubsubMessageWithFlexibleAuthorRefinementSchema: z.Z
270
271
  communityPublicKey: z.ZodOptional<z.ZodString>;
271
272
  communityName: z.ZodOptional<z.ZodString>;
272
273
  protocolVersion: z.ZodString;
273
- link: z.ZodOptional<z.ZodString>;
274
274
  spoiler: z.ZodOptional<z.ZodBoolean>;
275
275
  nsfw: z.ZodOptional<z.ZodBoolean>;
276
276
  content: z.ZodOptional<z.ZodString>;
@@ -313,6 +313,7 @@ export declare const CommentPubsubMessageWithFlexibleAuthorRefinementSchema: z.Z
313
313
  }, z.core.$loose>>;
314
314
  }, z.core.$loose>;
315
315
  export declare const CommentPubsubMessageWithRefinementSchema: z.ZodObject<{
316
+ link: z.ZodOptional<z.ZodString>;
316
317
  timestamp: z.ZodNumber;
317
318
  signature: z.ZodObject<{
318
319
  type: z.ZodString;
@@ -358,7 +359,6 @@ export declare const CommentPubsubMessageWithRefinementSchema: z.ZodObject<{
358
359
  communityPublicKey: z.ZodOptional<z.ZodString>;
359
360
  communityName: z.ZodOptional<z.ZodString>;
360
361
  protocolVersion: z.ZodString;
361
- link: z.ZodOptional<z.ZodString>;
362
362
  spoiler: z.ZodOptional<z.ZodBoolean>;
363
363
  nsfw: z.ZodOptional<z.ZodBoolean>;
364
364
  content: z.ZodOptional<z.ZodString>;
@@ -375,6 +375,7 @@ export declare const CommentChallengeRequestToEncryptSchema: z.ZodObject<{
375
375
  challengeAnswers: z.ZodOptional<z.ZodArray<z.ZodString>>;
376
376
  challengeCommentCids: z.ZodOptional<z.ZodArray<z.ZodString>>;
377
377
  comment: z.ZodObject<{
378
+ link: z.ZodOptional<z.ZodString>;
378
379
  timestamp: z.ZodNumber;
379
380
  signature: z.ZodObject<{
380
381
  type: z.ZodString;
@@ -391,7 +392,6 @@ export declare const CommentChallengeRequestToEncryptSchema: z.ZodObject<{
391
392
  communityPublicKey: z.ZodOptional<z.ZodString>;
392
393
  communityName: z.ZodOptional<z.ZodString>;
393
394
  protocolVersion: z.ZodString;
394
- link: z.ZodOptional<z.ZodString>;
395
395
  spoiler: z.ZodOptional<z.ZodBoolean>;
396
396
  nsfw: z.ZodOptional<z.ZodBoolean>;
397
397
  content: z.ZodOptional<z.ZodString>;
@@ -435,6 +435,7 @@ export declare const CommentChallengeRequestToEncryptSchema: z.ZodObject<{
435
435
  }, z.core.$loose>;
436
436
  }, z.core.$strict>;
437
437
  export declare const CommentIpfsSchema: z.ZodObject<{
438
+ link: z.ZodOptional<z.ZodString>;
438
439
  timestamp: z.ZodNumber;
439
440
  signature: z.ZodObject<{
440
441
  type: z.ZodString;
@@ -451,7 +452,6 @@ export declare const CommentIpfsSchema: z.ZodObject<{
451
452
  communityPublicKey: z.ZodOptional<z.ZodString>;
452
453
  communityName: z.ZodOptional<z.ZodString>;
453
454
  protocolVersion: z.ZodString;
454
- link: z.ZodOptional<z.ZodString>;
455
455
  spoiler: z.ZodOptional<z.ZodBoolean>;
456
456
  nsfw: z.ZodOptional<z.ZodBoolean>;
457
457
  content: z.ZodOptional<z.ZodString>;
@@ -504,6 +504,7 @@ export declare const CommentIpfsSchema: z.ZodObject<{
504
504
  }>>;
505
505
  }, z.core.$strict>;
506
506
  export declare const CommentIpfsWithRefinementSchema: z.ZodObject<{
507
+ link: z.ZodOptional<z.ZodString>;
507
508
  timestamp: z.ZodNumber;
508
509
  signature: z.ZodObject<{
509
510
  type: z.ZodString;
@@ -520,7 +521,6 @@ export declare const CommentIpfsWithRefinementSchema: z.ZodObject<{
520
521
  communityPublicKey: z.ZodOptional<z.ZodString>;
521
522
  communityName: z.ZodOptional<z.ZodString>;
522
523
  protocolVersion: z.ZodString;
523
- link: z.ZodOptional<z.ZodString>;
524
524
  spoiler: z.ZodOptional<z.ZodBoolean>;
525
525
  nsfw: z.ZodOptional<z.ZodBoolean>;
526
526
  content: z.ZodOptional<z.ZodString>;
@@ -639,10 +639,10 @@ export declare const CommentUpdateSchema: z.ZodObject<{
639
639
  communityPublicKey: z.ZodOptional<z.ZodString>;
640
640
  communityName: z.ZodOptional<z.ZodString>;
641
641
  protocolVersion: z.ZodString;
642
- commentCid: z.ZodString;
643
642
  spoiler: z.ZodOptional<z.ZodBoolean>;
644
643
  nsfw: z.ZodOptional<z.ZodBoolean>;
645
644
  reason: z.ZodOptional<z.ZodString>;
645
+ commentCid: z.ZodString;
646
646
  content: z.ZodOptional<z.ZodString>;
647
647
  deleted: z.ZodOptional<z.ZodBoolean>;
648
648
  author: z.ZodOptional<z.ZodObject<{
@@ -716,14 +716,15 @@ export declare const CommentUpdateSchema: z.ZodObject<{
716
716
  protocolVersion: z.ZodString;
717
717
  replies: z.ZodOptional<z.ZodLazy<z.ZodObject<{
718
718
  pages: z.ZodRecord<z.ZodUnion<[z.ZodEnum<{
719
- new: "new";
720
719
  best: "best";
720
+ new: "new";
721
721
  old: "old";
722
722
  newFlat: "newFlat";
723
723
  oldFlat: "oldFlat";
724
724
  }>, z.ZodString]>, z.ZodObject<{
725
725
  comments: z.ZodLazy<z.ZodArray<z.ZodObject<{
726
726
  comment: z.ZodObject<{
727
+ link: z.ZodOptional<z.ZodString>;
727
728
  timestamp: z.ZodNumber;
728
729
  signature: z.ZodObject<{
729
730
  type: z.ZodString;
@@ -740,7 +741,6 @@ export declare const CommentUpdateSchema: z.ZodObject<{
740
741
  communityPublicKey: z.ZodOptional<z.ZodString>;
741
742
  communityName: z.ZodOptional<z.ZodString>;
742
743
  protocolVersion: z.ZodString;
743
- link: z.ZodOptional<z.ZodString>;
744
744
  spoiler: z.ZodOptional<z.ZodBoolean>;
745
745
  nsfw: z.ZodOptional<z.ZodBoolean>;
746
746
  content: z.ZodOptional<z.ZodString>;
@@ -797,15 +797,15 @@ export declare const CommentUpdateSchema: z.ZodObject<{
797
797
  nextCid: z.ZodOptional<z.ZodString>;
798
798
  }, z.core.$strip>>;
799
799
  pageCids: z.ZodOptional<z.ZodRecord<z.ZodUnion<[z.ZodEnum<{
800
- new: "new";
801
800
  best: "best";
801
+ new: "new";
802
802
  old: "old";
803
803
  newFlat: "newFlat";
804
804
  oldFlat: "oldFlat";
805
805
  }>, z.ZodString]>, z.ZodString>>;
806
806
  }, z.core.$strip>>>;
807
807
  }, z.core.$strict>;
808
- export declare const CommentUpdateSignedPropertyNames: ("number" | "flairs" | "author" | "protocolVersion" | "spoiler" | "nsfw" | "pinned" | "locked" | "archived" | "approved" | "removed" | "reason" | "updatedAt" | "cid" | "upvoteCount" | "downvoteCount" | "replyCount" | "childCount" | "postNumber" | "edit" | "lastChildCid" | "lastReplyTimestamp" | "replies")[];
808
+ export declare const CommentUpdateSignedPropertyNames: ("number" | "flairs" | "author" | "protocolVersion" | "spoiler" | "nsfw" | "pinned" | "locked" | "archived" | "approved" | "removed" | "reason" | "replyCount" | "replies" | "cid" | "updatedAt" | "upvoteCount" | "downvoteCount" | "childCount" | "postNumber" | "edit" | "lastChildCid" | "lastReplyTimestamp")[];
809
809
  export declare const CommentUpdateChallengeReservedFieldNames: readonly ["signature", "cid", "upvoteCount", "downvoteCount", "replyCount", "childCount", "number", "postNumber", "updatedAt", "lastChildCid", "lastReplyTimestamp", "replies", "edit", "protocolVersion"];
810
810
  export declare const CommentUpdateForDisapprovedPendingComment: z.ZodObject<{
811
811
  signature: z.ZodObject<{
@@ -843,10 +843,10 @@ export declare const CommentUpdateForDisapprovedPendingComment: z.ZodObject<{
843
843
  approved: z.ZodOptional<z.ZodBoolean>;
844
844
  removed: z.ZodOptional<z.ZodBoolean>;
845
845
  reason: z.ZodOptional<z.ZodString>;
846
- updatedAt: z.ZodNumber;
847
846
  cid: z.ZodString;
847
+ updatedAt: z.ZodNumber;
848
848
  }, z.core.$strict>;
849
- export declare const CommentUpdateForDisapprovedPendingCommentSignedPropertyNames: ("flairs" | "author" | "protocolVersion" | "spoiler" | "nsfw" | "locked" | "archived" | "approved" | "removed" | "reason" | "updatedAt" | "cid")[];
849
+ export declare const CommentUpdateForDisapprovedPendingCommentSignedPropertyNames: ("flairs" | "author" | "protocolVersion" | "spoiler" | "nsfw" | "locked" | "archived" | "approved" | "removed" | "reason" | "cid" | "updatedAt")[];
850
850
  export declare const CommentUpdateForChallengeVerificationSchema: z.ZodObject<{
851
851
  number: z.ZodOptional<z.ZodNumber>;
852
852
  signature: z.ZodObject<{
@@ -875,8 +875,9 @@ export declare const CommentUpdateForChallengeVerificationSchema: z.ZodObject<{
875
875
  postNumber: z.ZodOptional<z.ZodNumber>;
876
876
  pendingApproval: z.ZodOptional<z.ZodBoolean>;
877
877
  }, z.core.$strict>;
878
- export declare const CommentUpdateForChallengeVerificationSignedPropertyNames: ("number" | "author" | "protocolVersion" | "cid" | "postNumber" | "pendingApproval")[];
878
+ export declare const CommentUpdateForChallengeVerificationSignedPropertyNames: ("number" | "author" | "protocolVersion" | "pendingApproval" | "cid" | "postNumber")[];
879
879
  export declare const CommentsTableRowSchema: z.ZodObject<{
880
+ link: z.ZodOptional<z.ZodString>;
880
881
  timestamp: z.ZodNumber;
881
882
  signature: z.ZodObject<{
882
883
  type: z.ZodString;
@@ -893,7 +894,6 @@ export declare const CommentsTableRowSchema: z.ZodObject<{
893
894
  communityPublicKey: z.ZodOptional<z.ZodString>;
894
895
  communityName: z.ZodOptional<z.ZodString>;
895
896
  protocolVersion: z.ZodString;
896
- link: z.ZodOptional<z.ZodString>;
897
897
  spoiler: z.ZodOptional<z.ZodBoolean>;
898
898
  nsfw: z.ZodOptional<z.ZodBoolean>;
899
899
  content: z.ZodOptional<z.ZodString>;
@@ -991,10 +991,10 @@ export declare const CommentUpdateTableRowSchema: z.ZodObject<{
991
991
  communityPublicKey: z.ZodOptional<z.ZodString>;
992
992
  communityName: z.ZodOptional<z.ZodString>;
993
993
  protocolVersion: z.ZodString;
994
- commentCid: z.ZodString;
995
994
  spoiler: z.ZodOptional<z.ZodBoolean>;
996
995
  nsfw: z.ZodOptional<z.ZodBoolean>;
997
996
  reason: z.ZodOptional<z.ZodString>;
997
+ commentCid: z.ZodString;
998
998
  content: z.ZodOptional<z.ZodString>;
999
999
  deleted: z.ZodOptional<z.ZodBoolean>;
1000
1000
  author: z.ZodOptional<z.ZodObject<{
@@ -129,7 +129,7 @@ export declare const CreateCommentEditOptionsWithRefinementSchema: z.ZodObject<{
129
129
  nsfw: z.ZodOptional<z.ZodBoolean>;
130
130
  reason: z.ZodOptional<z.ZodString>;
131
131
  }, z.core.$strict>;
132
- export declare const CommentEditSignedPropertyNames: ("timestamp" | "flairs" | "author" | "communityPublicKey" | "communityName" | "protocolVersion" | "commentCid" | "spoiler" | "nsfw" | "reason" | "content" | "deleted")[];
132
+ export declare const CommentEditSignedPropertyNames: ("timestamp" | "flairs" | "author" | "communityPublicKey" | "communityName" | "protocolVersion" | "spoiler" | "nsfw" | "reason" | "commentCid" | "content" | "deleted")[];
133
133
  export declare const CommentEditPubsubMessagePublicationSchema: z.ZodObject<{
134
134
  timestamp: z.ZodNumber;
135
135
  signature: z.ZodObject<{
@@ -176,10 +176,10 @@ export declare const CommentEditPubsubMessagePublicationSchema: z.ZodObject<{
176
176
  communityPublicKey: z.ZodOptional<z.ZodString>;
177
177
  communityName: z.ZodOptional<z.ZodString>;
178
178
  protocolVersion: z.ZodString;
179
- commentCid: z.ZodString;
180
179
  spoiler: z.ZodOptional<z.ZodBoolean>;
181
180
  nsfw: z.ZodOptional<z.ZodBoolean>;
182
181
  reason: z.ZodOptional<z.ZodString>;
182
+ commentCid: z.ZodString;
183
183
  content: z.ZodOptional<z.ZodString>;
184
184
  deleted: z.ZodOptional<z.ZodBoolean>;
185
185
  }, z.core.$strict>;
@@ -200,10 +200,10 @@ export declare const CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema
200
200
  communityPublicKey: z.ZodOptional<z.ZodString>;
201
201
  communityName: z.ZodOptional<z.ZodString>;
202
202
  protocolVersion: z.ZodString;
203
- commentCid: z.ZodString;
204
203
  spoiler: z.ZodOptional<z.ZodBoolean>;
205
204
  nsfw: z.ZodOptional<z.ZodBoolean>;
206
205
  reason: z.ZodOptional<z.ZodString>;
206
+ commentCid: z.ZodString;
207
207
  content: z.ZodOptional<z.ZodString>;
208
208
  deleted: z.ZodOptional<z.ZodBoolean>;
209
209
  author: z.ZodOptional<z.ZodObject<{
@@ -282,10 +282,10 @@ export declare const CommentEditsTableRowSchema: z.ZodObject<{
282
282
  communityPublicKey: z.ZodOptional<z.ZodString>;
283
283
  communityName: z.ZodOptional<z.ZodString>;
284
284
  protocolVersion: z.ZodString;
285
- commentCid: z.ZodString;
286
285
  spoiler: z.ZodOptional<z.ZodBoolean>;
287
286
  nsfw: z.ZodOptional<z.ZodBoolean>;
288
287
  reason: z.ZodOptional<z.ZodString>;
288
+ commentCid: z.ZodString;
289
289
  content: z.ZodOptional<z.ZodString>;
290
290
  deleted: z.ZodOptional<z.ZodBoolean>;
291
291
  insertedAt: z.ZodNumber;
@@ -313,10 +313,10 @@ export declare const CommentEditChallengeRequestToEncryptSchema: z.ZodObject<{
313
313
  communityPublicKey: z.ZodOptional<z.ZodString>;
314
314
  communityName: z.ZodOptional<z.ZodString>;
315
315
  protocolVersion: z.ZodString;
316
- commentCid: z.ZodString;
317
316
  spoiler: z.ZodOptional<z.ZodBoolean>;
318
317
  nsfw: z.ZodOptional<z.ZodBoolean>;
319
318
  reason: z.ZodOptional<z.ZodString>;
319
+ commentCid: z.ZodString;
320
320
  content: z.ZodOptional<z.ZodString>;
321
321
  deleted: z.ZodOptional<z.ZodBoolean>;
322
322
  author: z.ZodOptional<z.ZodObject<{
@@ -171,7 +171,7 @@ export declare const CreateCommentModerationOptionsWithRefinementSchema: z.ZodOb
171
171
  }, z.core.$loose>;
172
172
  commentCid: z.ZodString;
173
173
  }, z.core.$strict>;
174
- export declare const CommentModerationSignedPropertyNames: ("timestamp" | "author" | "communityPublicKey" | "communityName" | "protocolVersion" | "commentCid" | "commentModeration")[];
174
+ export declare const CommentModerationSignedPropertyNames: ("timestamp" | "author" | "communityPublicKey" | "communityName" | "protocolVersion" | "commentModeration" | "commentCid")[];
175
175
  export declare const CommentModerationPubsubMessagePublicationSchema: z.ZodObject<{
176
176
  timestamp: z.ZodNumber;
177
177
  signature: z.ZodObject<{
@@ -212,7 +212,6 @@ export declare const CommentModerationPubsubMessagePublicationSchema: z.ZodObjec
212
212
  communityPublicKey: z.ZodOptional<z.ZodString>;
213
213
  communityName: z.ZodOptional<z.ZodString>;
214
214
  protocolVersion: z.ZodString;
215
- commentCid: z.ZodString;
216
215
  commentModeration: z.ZodObject<{
217
216
  flairs: z.ZodOptional<z.ZodArray<z.ZodObject<{
218
217
  text: z.ZodString;
@@ -239,6 +238,7 @@ export declare const CommentModerationPubsubMessagePublicationSchema: z.ZodObjec
239
238
  banExpiresAt: z.ZodOptional<z.ZodNumber>;
240
239
  }, z.core.$loose>>;
241
240
  }, z.core.$loose>;
241
+ commentCid: z.ZodString;
242
242
  }, z.core.$strict>;
243
243
  export declare const CommentModerationsTableRowSchema: z.ZodObject<{
244
244
  timestamp: z.ZodNumber;
@@ -280,7 +280,6 @@ export declare const CommentModerationsTableRowSchema: z.ZodObject<{
280
280
  communityPublicKey: z.ZodOptional<z.ZodString>;
281
281
  communityName: z.ZodOptional<z.ZodString>;
282
282
  protocolVersion: z.ZodString;
283
- commentCid: z.ZodString;
284
283
  commentModeration: z.ZodObject<{
285
284
  flairs: z.ZodOptional<z.ZodArray<z.ZodObject<{
286
285
  text: z.ZodString;
@@ -307,6 +306,7 @@ export declare const CommentModerationsTableRowSchema: z.ZodObject<{
307
306
  banExpiresAt: z.ZodOptional<z.ZodNumber>;
308
307
  }, z.core.$loose>>;
309
308
  }, z.core.$loose>;
309
+ commentCid: z.ZodString;
310
310
  insertedAt: z.ZodNumber;
311
311
  modSignerAddress: z.ZodString;
312
312
  extraProps: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
@@ -356,7 +356,6 @@ export declare const CommentModerationChallengeRequestToEncryptSchema: z.ZodObje
356
356
  communityPublicKey: z.ZodOptional<z.ZodString>;
357
357
  communityName: z.ZodOptional<z.ZodString>;
358
358
  protocolVersion: z.ZodString;
359
- commentCid: z.ZodString;
360
359
  commentModeration: z.ZodObject<{
361
360
  flairs: z.ZodOptional<z.ZodArray<z.ZodObject<{
362
361
  text: z.ZodString;
@@ -383,6 +382,7 @@ export declare const CommentModerationChallengeRequestToEncryptSchema: z.ZodObje
383
382
  banExpiresAt: z.ZodOptional<z.ZodNumber>;
384
383
  }, z.core.$loose>>;
385
384
  }, z.core.$loose>;
385
+ commentCid: z.ZodString;
386
386
  }, z.core.$loose>;
387
387
  }, z.core.$strip>;
388
388
  export declare const CommentModerationReservedFields: string[];
@@ -51,8 +51,8 @@ export declare const CreateCommunityEditPublicationOptionsSchema: import("zod").
51
51
  textColor: import("zod").ZodOptional<import("zod").ZodString>;
52
52
  expiresAt: import("zod").ZodOptional<import("zod").ZodNumber>;
53
53
  }, import("zod/v4/core").$loose>>>>>;
54
- title: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
55
54
  description: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
55
+ title: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
56
56
  pubsubTopic: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
57
57
  rules: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>>;
58
58
  features: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodObject<{
@@ -230,8 +230,8 @@ export declare const CreateCommunityEditPublicationOptionsWithRefinementSchema:
230
230
  textColor: import("zod").ZodOptional<import("zod").ZodString>;
231
231
  expiresAt: import("zod").ZodOptional<import("zod").ZodNumber>;
232
232
  }, import("zod/v4/core").$loose>>>>>;
233
- title: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
234
233
  description: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
234
+ title: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
235
235
  pubsubTopic: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
236
236
  rules: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>>;
237
237
  features: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodObject<{
@@ -405,8 +405,8 @@ export declare const CommunityEditPubsubMessagePublicationSchema: import("zod").
405
405
  textColor: import("zod").ZodOptional<import("zod").ZodString>;
406
406
  expiresAt: import("zod").ZodOptional<import("zod").ZodNumber>;
407
407
  }, import("zod/v4/core").$loose>>>>>;
408
- title: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
409
408
  description: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
409
+ title: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
410
410
  pubsubTopic: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
411
411
  rules: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>>;
412
412
  features: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodObject<{
@@ -582,8 +582,8 @@ export declare const CommunityEditPublicationChallengeRequestToEncryptSchema: im
582
582
  textColor: import("zod").ZodOptional<import("zod").ZodString>;
583
583
  expiresAt: import("zod").ZodOptional<import("zod").ZodNumber>;
584
584
  }, import("zod/v4/core").$loose>>>>>;
585
- title: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
586
585
  description: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
586
+ title: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
587
587
  pubsubTopic: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
588
588
  rules: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>>;
589
589
  features: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodObject<{
@@ -33,6 +33,7 @@ export declare const ChallengeRequestMessageSchema: z.ZodObject<{
33
33
  }, z.core.$strict>;
34
34
  export declare const DecryptedChallengeRequestPublicationSchema: z.ZodObject<{
35
35
  comment: z.ZodOptional<z.ZodObject<{
36
+ link: z.ZodOptional<z.ZodString>;
36
37
  timestamp: z.ZodNumber;
37
38
  signature: z.ZodObject<{
38
39
  type: z.ZodString;
@@ -49,7 +50,6 @@ export declare const DecryptedChallengeRequestPublicationSchema: z.ZodObject<{
49
50
  communityPublicKey: z.ZodOptional<z.ZodString>;
50
51
  communityName: z.ZodOptional<z.ZodString>;
51
52
  protocolVersion: z.ZodString;
52
- link: z.ZodOptional<z.ZodString>;
53
53
  spoiler: z.ZodOptional<z.ZodBoolean>;
54
54
  nsfw: z.ZodOptional<z.ZodBoolean>;
55
55
  content: z.ZodOptional<z.ZodString>;
@@ -151,10 +151,10 @@ export declare const DecryptedChallengeRequestPublicationSchema: z.ZodObject<{
151
151
  communityPublicKey: z.ZodOptional<z.ZodString>;
152
152
  communityName: z.ZodOptional<z.ZodString>;
153
153
  protocolVersion: z.ZodString;
154
- commentCid: z.ZodString;
155
154
  spoiler: z.ZodOptional<z.ZodBoolean>;
156
155
  nsfw: z.ZodOptional<z.ZodBoolean>;
157
156
  reason: z.ZodOptional<z.ZodString>;
157
+ commentCid: z.ZodString;
158
158
  content: z.ZodOptional<z.ZodString>;
159
159
  deleted: z.ZodOptional<z.ZodBoolean>;
160
160
  author: z.ZodOptional<z.ZodObject<{
@@ -227,7 +227,6 @@ export declare const DecryptedChallengeRequestPublicationSchema: z.ZodObject<{
227
227
  communityPublicKey: z.ZodOptional<z.ZodString>;
228
228
  communityName: z.ZodOptional<z.ZodString>;
229
229
  protocolVersion: z.ZodString;
230
- commentCid: z.ZodString;
231
230
  commentModeration: z.ZodObject<{
232
231
  flairs: z.ZodOptional<z.ZodArray<z.ZodObject<{
233
232
  text: z.ZodString;
@@ -254,6 +253,7 @@ export declare const DecryptedChallengeRequestPublicationSchema: z.ZodObject<{
254
253
  banExpiresAt: z.ZodOptional<z.ZodNumber>;
255
254
  }, z.core.$loose>>;
256
255
  }, z.core.$loose>;
256
+ commentCid: z.ZodString;
257
257
  }, z.core.$loose>>;
258
258
  communityEdit: z.ZodOptional<z.ZodObject<{
259
259
  timestamp: z.ZodNumber;
@@ -303,8 +303,8 @@ export declare const DecryptedChallengeRequestPublicationSchema: z.ZodObject<{
303
303
  textColor: z.ZodOptional<z.ZodString>;
304
304
  expiresAt: z.ZodOptional<z.ZodNumber>;
305
305
  }, z.core.$loose>>>>>;
306
- title: z.ZodOptional<z.ZodOptional<z.ZodString>>;
307
306
  description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
307
+ title: z.ZodOptional<z.ZodOptional<z.ZodString>>;
308
308
  pubsubTopic: z.ZodOptional<z.ZodOptional<z.ZodString>>;
309
309
  rules: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
310
310
  features: z.ZodOptional<z.ZodOptional<z.ZodObject<{
@@ -432,6 +432,7 @@ export declare const DecryptedChallengeRequestPublicationSchema: z.ZodObject<{
432
432
  }, z.core.$strip>;
433
433
  export declare const DecryptedChallengeRequestSchema: z.ZodObject<{
434
434
  comment: z.ZodOptional<z.ZodObject<{
435
+ link: z.ZodOptional<z.ZodString>;
435
436
  timestamp: z.ZodNumber;
436
437
  signature: z.ZodObject<{
437
438
  type: z.ZodString;
@@ -448,7 +449,6 @@ export declare const DecryptedChallengeRequestSchema: z.ZodObject<{
448
449
  communityPublicKey: z.ZodOptional<z.ZodString>;
449
450
  communityName: z.ZodOptional<z.ZodString>;
450
451
  protocolVersion: z.ZodString;
451
- link: z.ZodOptional<z.ZodString>;
452
452
  spoiler: z.ZodOptional<z.ZodBoolean>;
453
453
  nsfw: z.ZodOptional<z.ZodBoolean>;
454
454
  content: z.ZodOptional<z.ZodString>;
@@ -550,10 +550,10 @@ export declare const DecryptedChallengeRequestSchema: z.ZodObject<{
550
550
  communityPublicKey: z.ZodOptional<z.ZodString>;
551
551
  communityName: z.ZodOptional<z.ZodString>;
552
552
  protocolVersion: z.ZodString;
553
- commentCid: z.ZodString;
554
553
  spoiler: z.ZodOptional<z.ZodBoolean>;
555
554
  nsfw: z.ZodOptional<z.ZodBoolean>;
556
555
  reason: z.ZodOptional<z.ZodString>;
556
+ commentCid: z.ZodString;
557
557
  content: z.ZodOptional<z.ZodString>;
558
558
  deleted: z.ZodOptional<z.ZodBoolean>;
559
559
  author: z.ZodOptional<z.ZodObject<{
@@ -626,7 +626,6 @@ export declare const DecryptedChallengeRequestSchema: z.ZodObject<{
626
626
  communityPublicKey: z.ZodOptional<z.ZodString>;
627
627
  communityName: z.ZodOptional<z.ZodString>;
628
628
  protocolVersion: z.ZodString;
629
- commentCid: z.ZodString;
630
629
  commentModeration: z.ZodObject<{
631
630
  flairs: z.ZodOptional<z.ZodArray<z.ZodObject<{
632
631
  text: z.ZodString;
@@ -653,6 +652,7 @@ export declare const DecryptedChallengeRequestSchema: z.ZodObject<{
653
652
  banExpiresAt: z.ZodOptional<z.ZodNumber>;
654
653
  }, z.core.$loose>>;
655
654
  }, z.core.$loose>;
655
+ commentCid: z.ZodString;
656
656
  }, z.core.$loose>>;
657
657
  communityEdit: z.ZodOptional<z.ZodObject<{
658
658
  timestamp: z.ZodNumber;
@@ -702,8 +702,8 @@ export declare const DecryptedChallengeRequestSchema: z.ZodObject<{
702
702
  textColor: z.ZodOptional<z.ZodString>;
703
703
  expiresAt: z.ZodOptional<z.ZodNumber>;
704
704
  }, z.core.$loose>>>>>;
705
- title: z.ZodOptional<z.ZodOptional<z.ZodString>>;
706
705
  description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
706
+ title: z.ZodOptional<z.ZodOptional<z.ZodString>>;
707
707
  pubsubTopic: z.ZodOptional<z.ZodOptional<z.ZodString>>;
708
708
  rules: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
709
709
  features: z.ZodOptional<z.ZodOptional<z.ZodObject<{
@@ -911,6 +911,7 @@ export declare const ChallengeVerificationMessageSchema: z.ZodObject<{
911
911
  }, z.core.$strict>;
912
912
  export declare const DecryptedChallengeVerificationSchema: z.ZodObject<{
913
913
  comment: z.ZodObject<{
914
+ link: z.ZodOptional<z.ZodString>;
914
915
  timestamp: z.ZodNumber;
915
916
  signature: z.ZodObject<{
916
917
  type: z.ZodString;
@@ -927,7 +928,6 @@ export declare const DecryptedChallengeVerificationSchema: z.ZodObject<{
927
928
  communityPublicKey: z.ZodOptional<z.ZodString>;
928
929
  communityName: z.ZodOptional<z.ZodString>;
929
930
  protocolVersion: z.ZodString;
930
- link: z.ZodOptional<z.ZodString>;
931
931
  spoiler: z.ZodOptional<z.ZodBoolean>;
932
932
  nsfw: z.ZodOptional<z.ZodBoolean>;
933
933
  content: z.ZodOptional<z.ZodString>;
@@ -34,6 +34,7 @@ declare class PKCWsServer extends TypedEmitter<PKCRpcServerEvents> {
34
34
  private _trackedCommunityListeners;
35
35
  private _getIpFromConnectionRequest;
36
36
  private _onSettingsChange;
37
+ private _settingsSenders;
37
38
  private _startedCommunities;
38
39
  private _autoStartOnBoot;
39
40
  private _autoStartConcurrency;
@@ -81,6 +82,7 @@ declare class PKCWsServer extends TypedEmitter<PKCRpcServerEvents> {
81
82
  settingsSubscribe(params: any, connectionId: string): Promise<RpcSubscriptionIdResult>;
82
83
  private _initPKC;
83
84
  private _createPKCInstanceFromSetSettings;
85
+ notifySettingsChange(): Promise<void>;
84
86
  setSettings(params: any): Promise<RpcSuccessResult>;
85
87
  commentUpdateSubscribe(params: any, connectionId: string): Promise<RpcSubscriptionIdResult>;
86
88
  communityUpdateSubscribe(params: any, connectionId: string): Promise<RpcSubscriptionIdResult>;
@@ -60,6 +60,9 @@ class PKCWsServer extends TypedEmitter {
60
60
  this._trackedCommunityListeners = new WeakMap();
61
61
  this._getIpFromConnectionRequest = (req) => req.socket.remoteAddress; // we set it up here so we can mock it in tests
62
62
  this._onSettingsChange = {}; // TODO rename this to _afterSettingsChange
63
+ // Only the settingsSubscribe senders. Unlike _onSettingsChange, whose handlers restart communities and re-subscribe
64
+ // updates onto a new pkc, these just re-send `settingschange`, which is all notifySettingsChange needs.
65
+ this._settingsSenders = new Map();
63
66
  this._startedCommunities = {};
64
67
  this._autoStartOnBoot = false;
65
68
  // Per-address cache of LocalCommunity instances loaded for export purposes when the
@@ -808,11 +811,14 @@ class PKCWsServer extends TypedEmitter {
808
811
  const sendRpcSettings = async ({ newPKC }) => {
809
812
  sendEvent("settingschange", this._serializeSettingsFromPKC(newPKC));
810
813
  };
814
+ const senderKey = `${connectionId}:${subscriptionId}`;
811
815
  this.subscriptionCleanups[connectionId][subscriptionId] = async () => {
812
816
  if (this._onSettingsChange[connectionId])
813
817
  delete this._onSettingsChange[connectionId][subscriptionId];
818
+ this._settingsSenders.delete(senderKey);
814
819
  };
815
820
  this._onSettingsChange[connectionId][subscriptionId] = sendRpcSettings;
821
+ this._settingsSenders.set(senderKey, sendRpcSettings);
816
822
  await sendRpcSettings({ newPKC: this.pkc });
817
823
  return { subscriptionId };
818
824
  }
@@ -823,6 +829,22 @@ class PKCWsServer extends TypedEmitter {
823
829
  async _createPKCInstanceFromSetSettings(newOptions) {
824
830
  return PKCJs.PKC(newOptions);
825
831
  }
832
+ // For a host that changed the challenge or page sort registry of this server's pkc in place (bitsocial-cli's
833
+ // `challenge install` / `page-sort install` reload, issue #411): re-send `settingschange` with the current
834
+ // registries to every settings subscriber, so connected clients accept the new names without reconnecting. It only
835
+ // reads the in-memory registries. It does not run the other setSettings handlers, which restart every community;
836
+ // communities pick a registry change up on their own next cycle.
837
+ async notifySettingsChange() {
838
+ await this._setSettingsQueue; // never interleave with a setSettings swapping the pkc
839
+ for (const [senderKey, send] of [...this._settingsSenders]) {
840
+ try {
841
+ await send({ newPKC: this.pkc });
842
+ }
843
+ catch (error) {
844
+ log.error(`Failed to send settingschange to settings subscription ${senderKey}, continuing with the rest`, error);
845
+ }
846
+ }
847
+ }
826
848
  async setSettings(params) {
827
849
  const runSetSettings = async () => {
828
850
  const settings = parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails(params[0]);