@pkcprotocol/pkc-js 0.0.147 → 0.0.148

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 (41) hide show
  1. package/dist/browser/generated-version.d.ts +1 -1
  2. package/dist/browser/generated-version.js +1 -1
  3. package/dist/browser/runtime/node/community/challenges/exclude/exclude.js +1 -1
  4. package/dist/browser/runtime/node/community/challenges/exclude/exclude.js.map +1 -1
  5. package/dist/browser/runtime/node/community/challenges/exclude/rate-limiter.d.ts +2 -2
  6. package/dist/browser/runtime/node/community/challenges/exclude/rate-limiter.js +21 -17
  7. package/dist/browser/runtime/node/community/challenges/exclude/rate-limiter.js.map +1 -1
  8. package/dist/browser/runtime/node/community/challenges/index.js +1 -1
  9. package/dist/browser/runtime/node/community/challenges/index.js.map +1 -1
  10. package/dist/browser/runtime/node/community/local-community/challenges.js +21 -11
  11. package/dist/browser/runtime/node/community/local-community/challenges.js.map +1 -1
  12. package/dist/browser/runtime/node/community/local-community/publication-store.js +9 -0
  13. package/dist/browser/runtime/node/community/local-community/publication-store.js.map +1 -1
  14. package/dist/bundled/bundle-manifest.json +53 -53
  15. package/dist/bundled/challenges.js +1 -1
  16. package/dist/bundled/chunks/{helia-for-pkc-jM3y3OXF.js → helia-for-pkc-BUVgQgXa.js} +33 -33
  17. package/dist/bundled/chunks/{local-community-P9e5jksW.js → local-community-GWqz4s3g.js} +1 -1
  18. package/dist/bundled/chunks/{local-community-5X7bvOoN.js → local-community-dVaQtJNM.js} +53 -47
  19. package/dist/bundled/chunks/{node-By3og2hw.js → node-fEBX1Nar.js} +5 -5
  20. package/dist/bundled/chunks/{page-sort-scoring-DwYGP_0d.js → page-sort-scoring-DbI7k_K5.js} +1 -1
  21. package/dist/bundled/chunks/{rpc-local-community-WnhiTbxm.js → rpc-local-community-ouDezuGZ.js} +26 -20
  22. package/dist/bundled/chunks/{util-DMr7Hj-w.js → util-B81IOt07.js} +1 -1
  23. package/dist/bundled/chunks/{util-7QtFMzpc.js → util-DofMBAFz.js} +1 -1
  24. package/dist/bundled/chunks/{validate-package-factories-TwRblx9f.js → validate-package-factories-Bi1OLIPw.js} +2 -2
  25. package/dist/bundled/index.js +1 -1
  26. package/dist/bundled/page-sorts.js +1 -1
  27. package/dist/bundled/rpc/src/index.js +4 -4
  28. package/dist/node/generated-version.d.ts +1 -1
  29. package/dist/node/generated-version.js +1 -1
  30. package/dist/node/runtime/node/community/challenges/exclude/exclude.js +1 -1
  31. package/dist/node/runtime/node/community/challenges/exclude/exclude.js.map +1 -1
  32. package/dist/node/runtime/node/community/challenges/exclude/rate-limiter.d.ts +2 -2
  33. package/dist/node/runtime/node/community/challenges/exclude/rate-limiter.js +21 -17
  34. package/dist/node/runtime/node/community/challenges/exclude/rate-limiter.js.map +1 -1
  35. package/dist/node/runtime/node/community/challenges/index.js +1 -1
  36. package/dist/node/runtime/node/community/challenges/index.js.map +1 -1
  37. package/dist/node/runtime/node/community/local-community/challenges.js +21 -11
  38. package/dist/node/runtime/node/community/local-community/challenges.js.map +1 -1
  39. package/dist/node/runtime/node/community/local-community/publication-store.js +9 -0
  40. package/dist/node/runtime/node/community/local-community/publication-store.js.map +1 -1
  41. package/package.json +1 -1
@@ -1,12 +1,12 @@
1
1
  import { i as __toESM } from "./chunk-2rV9d50f.js";
2
- import { Ar as t$2, At as pTimeout, B as pubsubTopicToDhtKey, Bn as CommentUpdateSchema, Br as logger_default, Bt as DecryptedChallengeRequestPublicationSchema, C as hideClassPrivateProps, Cr as e, Dn as VotePubsubReservedFields, Dt as untrackUpdatingCommunity, En as VotePubsubMessagePublicationSchema, Er as t$3, F as isLinkOfVideo, Ft as ChallengeRequestMessageSchema, G as removeBlocksFromKuboNode, Hn as CommentUpdateTableRowSchema, I as isLinkValid, J as removeNullUndefinedValues, K as removeMfsFilesSafely, Lt as ChallengeVerificationMessageSchema, M as isLinkOfAudio, Mn as CommentIpfsSchema, Mr as require_retry, N as isLinkOfImage, Nn as CommentPubsubMessageReservedFields, Nt as ChallengeMessageSchema, Ot as require_sha256, P as isLinkOfMedia, Q as retryKuboBlockPutPinAndProvidePubsubTopic, Qn as CommentEditReservedFields, Rr as PKCError, Sr as e$1, St as trackStartedCommunity, T as ipnsNameToIpnsOverPubsubTopic, Tr as r$1, Tt as untrackStartedCommunity, Un as CommentsTableRowSchema, Vt as DecryptedChallengeRequestSchema, Xn as CommentEditPubsubMessagePublicationSchema, Yt as version_default, Zn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, Zt as CommunityEditPublicationPubsubReservedFields, _ as genToArray, _r as n$3, an as CommentModerationsTableRowSchema, ar as AuthorReservedFields, b as getIpnsRecordInLocalKuboNode, br as t$5, c as contentContainsMarkdownImages, ct as withSortedKeys, dt as findCommunityInRegistry, er as CommentEditsTableRowSchema, et as retryKuboIpfsAddAndProvide, f as derivePublicationFromChallengeRequest, ft as findStartedCommunity, g as findMalformedUnicodeString, gr as isStringDomain, hn as CommunitySignedPropertyNames, i as calculateStringSizeSameAsIpfsAddCidV0, it as statMfsPathSafely, j as isLinkOfAnimatedImage, jt as ChallengeAnswerMessageSchema, kn as VoteTablesRowSchema, kr as t$4, l as contentContainsMarkdownVideos, lt as withSortedKeysDeep, mn as CommunityIpfsSchema, mt as findUpdatingCommunity, ni as ZodError, nn as CommentModerationPubsubMessagePublicationSchema, o as calculateUnixFsDagSizeCidV0, ot as timestamp, p as doesDomainAddressHaveCapitalLetter, r as calculateIpfsCidV0, rn as CommentModerationReservedFields, rt as sleepUntilTimeoutOrAbort, s as contentContainsMarkdownAudio, ut as writeKuboFilesWithTimeout, v as getEquivalentCommunityAddresses, vr as t$7, wt as trackUpdatingCommunity, xr as t$6, xt as syncCommunityRegistryEntry, y as getErrorCodeFromMessage, yr as n$2, zr as messages } from "./util-DMr7Hj-w.js";
3
- import { $ as createSchemaRowParser, $r as require_lodash_merge, An as verifyChallengeAnswer, Ar as removeFileRetryingWhileBusy, Bn as verifyCommunityEdit, Br as t$11, Dt as parseJsonWithPKCErrorIfFails, En as signCommunity, Fn as verifyCommentIpfs, Hn as verifyVote, Hr as t$8, In as verifyCommentModeration, Kn as getAuthorNameFromWire, Kr as t$9, Ln as verifyCommentPubsubMessage, Lr as isCommunityStartLocked, Mn as verifyChallengeRequest, N as MAX_PAGE_SIZE_BYTES, Or as moveCommunityDbToDeletedDirectory, Pn as verifyCommentEdit, Pr as findCommunitiesEntry, Q as collectSchemaRowCoercions, Qn as effectiveMaxCrosspostDepth, Qr as STORAGE_KEYS, Rn as verifyCommentUpdate, Rr as require_src, S as MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS, Sn as signCommentEdit, Sr as getDefaultCommunityDbConfig, Tn as signCommentUpdateForChallengeVerification, Tr as importSignerIntoKuboNode, Un as buildRuntimeAuthor, Ur as n$5, Vr as r$2, W as pLimit, Wn as cleanWireAuthor, Wr as n$4, X as coerceSchemaRowBoolean, Z as coerceSchemaRowJson, Zn as crosspostChainDepthUpTo, _ as createAuthorIdentityMatcher, _r as deriveCommentIpfsFromCommentTableRow, a as generatePagesReportingFailedSorts, ar as encode, b as KeyvBetterSqlite3, bn as signChallengeVerification, c as resolvePageSortsOrThrow, cn as SignerWithPublicKeyAddress, cr as getPKCAddressFromPublicKey, d as getChallengeVerification, dr as BackupAbortError, dt as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, f as getCommunityChallengeFromCommunityChallengeSettings, fn as decryptEd25519AesGcmPublicKeyBuffer, fr as backupCommunityDb, g as authorNameResolveFailureReason, gn as cleanUpBeforePublishing, gr as deleteOldCommunityInWindows, h as authorIdentityMatcherForRequest, hn as _validateSignatureOfPKCRecord, i as derivePublicPageSorts, ir as decode, j as iterateOverPageCidsToFindAllCids, jr as resolveDbPostsCidRefs, kr as refreshCommunitiesList, lr as getPKCAddressFromPublicKeySync, m as pkcJsChallenges, mn as encryptEd25519AesGcmPublicKeyBuffer, mr as calculateInlineRepliesBudget, nr as getCommunityPublicKeyFromWire, o as loadPageSortsForStartedCommunity, p as loadChallengeFileFromCommunityChallengeSettings, pr as calculateExpectedSignatureSize, pt as parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails, qr as stringify, r as computePageSortsFingerprint, s as lookupPageSortFactories, sr as getIpfsKeyFromPrivateKey, t as RpcLocalCommunity, tr as getCommunityNameFromWire, u as deriveCommunityChallengesOrThrow, ur as getPublicKeyFromPrivateKey, v as TrackedInstanceRegistry, vn as signChallengeMessage, vr as deriveDbPosts, w as TIMEFRAMES_TO_SECONDS, wn as signCommentUpdate, wr as getThumbnailPropsOfLink, wt as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, xn as signComment, xr as forgetCommunityThatFailedToBeDeleted, y as LRUCache, yr as deriveDbReplies, zn as verifyCommunity, zr as t$10 } from "./rpc-local-community-WnhiTbxm.js";
4
- import { a as scorePageCommentsWithFile, i as partitionPageCommentsForSort, n as filterRepliesForPageSort, o as stripRepliesFromPageComment, r as orderPageCommentsByScore, t as createDescendantsLookup } from "./page-sort-scoring-DwYGP_0d.js";
2
+ import { Ar as t$2, At as pTimeout, B as pubsubTopicToDhtKey, Bn as CommentUpdateSchema, Br as logger_default, Bt as DecryptedChallengeRequestPublicationSchema, C as hideClassPrivateProps, Cr as e, Dn as VotePubsubReservedFields, Dt as untrackUpdatingCommunity, En as VotePubsubMessagePublicationSchema, Er as t$3, F as isLinkOfVideo, Ft as ChallengeRequestMessageSchema, G as removeBlocksFromKuboNode, Hn as CommentUpdateTableRowSchema, I as isLinkValid, J as removeNullUndefinedValues, K as removeMfsFilesSafely, Lt as ChallengeVerificationMessageSchema, M as isLinkOfAudio, Mn as CommentIpfsSchema, Mr as require_retry, N as isLinkOfImage, Nn as CommentPubsubMessageReservedFields, Nt as ChallengeMessageSchema, Ot as require_sha256, P as isLinkOfMedia, Q as retryKuboBlockPutPinAndProvidePubsubTopic, Qn as CommentEditReservedFields, Rr as PKCError, Sr as e$1, St as trackStartedCommunity, T as ipnsNameToIpnsOverPubsubTopic, Tr as r$1, Tt as untrackStartedCommunity, Un as CommentsTableRowSchema, Vt as DecryptedChallengeRequestSchema, Xn as CommentEditPubsubMessagePublicationSchema, Yt as version_default, Zn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, Zt as CommunityEditPublicationPubsubReservedFields, _ as genToArray, _r as n$3, an as CommentModerationsTableRowSchema, ar as AuthorReservedFields, b as getIpnsRecordInLocalKuboNode, br as t$5, c as contentContainsMarkdownImages, ct as withSortedKeys, dt as findCommunityInRegistry, er as CommentEditsTableRowSchema, et as retryKuboIpfsAddAndProvide, f as derivePublicationFromChallengeRequest, ft as findStartedCommunity, g as findMalformedUnicodeString, gr as isStringDomain, hn as CommunitySignedPropertyNames, i as calculateStringSizeSameAsIpfsAddCidV0, it as statMfsPathSafely, j as isLinkOfAnimatedImage, jt as ChallengeAnswerMessageSchema, kn as VoteTablesRowSchema, kr as t$4, l as contentContainsMarkdownVideos, lt as withSortedKeysDeep, mn as CommunityIpfsSchema, mt as findUpdatingCommunity, ni as ZodError, nn as CommentModerationPubsubMessagePublicationSchema, o as calculateUnixFsDagSizeCidV0, ot as timestamp, p as doesDomainAddressHaveCapitalLetter, r as calculateIpfsCidV0, rn as CommentModerationReservedFields, rt as sleepUntilTimeoutOrAbort, s as contentContainsMarkdownAudio, ut as writeKuboFilesWithTimeout, v as getEquivalentCommunityAddresses, vr as t$7, wt as trackUpdatingCommunity, xr as t$6, xt as syncCommunityRegistryEntry, y as getErrorCodeFromMessage, yr as n$2, zr as messages } from "./util-B81IOt07.js";
3
+ import { $ as createSchemaRowParser, $r as require_lodash_merge, An as verifyChallengeAnswer, Ar as removeFileRetryingWhileBusy, Bn as verifyCommunityEdit, Br as t$11, Dt as parseJsonWithPKCErrorIfFails, En as signCommunity, Fn as verifyCommentIpfs, Hn as verifyVote, Hr as t$8, In as verifyCommentModeration, Kn as getAuthorNameFromWire, Kr as t$9, Ln as verifyCommentPubsubMessage, Lr as isCommunityStartLocked, Mn as verifyChallengeRequest, N as MAX_PAGE_SIZE_BYTES, Or as moveCommunityDbToDeletedDirectory, Pn as verifyCommentEdit, Pr as findCommunitiesEntry, Q as collectSchemaRowCoercions, Qn as effectiveMaxCrosspostDepth, Qr as STORAGE_KEYS, Rn as verifyCommentUpdate, Rr as require_src, S as MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS, Sn as signCommentEdit, Sr as getDefaultCommunityDbConfig, Tn as signCommentUpdateForChallengeVerification, Tr as importSignerIntoKuboNode, Un as buildRuntimeAuthor, Ur as n$5, Vr as r$2, W as pLimit, Wn as cleanWireAuthor, Wr as n$4, X as coerceSchemaRowBoolean, Z as coerceSchemaRowJson, Zn as crosspostChainDepthUpTo, _ as createAuthorIdentityMatcher, _r as deriveCommentIpfsFromCommentTableRow, a as generatePagesReportingFailedSorts, ar as encode, b as KeyvBetterSqlite3, bn as signChallengeVerification, c as resolvePageSortsOrThrow, cn as SignerWithPublicKeyAddress, cr as getPKCAddressFromPublicKey, d as getChallengeVerification, dr as BackupAbortError, dt as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, f as getCommunityChallengeFromCommunityChallengeSettings, fn as decryptEd25519AesGcmPublicKeyBuffer, fr as backupCommunityDb, g as authorNameResolveFailureReason, gn as cleanUpBeforePublishing, gr as deleteOldCommunityInWindows, h as authorIdentityMatcherForRequest, hn as _validateSignatureOfPKCRecord, i as derivePublicPageSorts, ir as decode, j as iterateOverPageCidsToFindAllCids, jr as resolveDbPostsCidRefs, kr as refreshCommunitiesList, lr as getPKCAddressFromPublicKeySync, m as pkcJsChallenges, mn as encryptEd25519AesGcmPublicKeyBuffer, mr as calculateInlineRepliesBudget, nr as getCommunityPublicKeyFromWire, o as loadPageSortsForStartedCommunity, p as loadChallengeFileFromCommunityChallengeSettings, pr as calculateExpectedSignatureSize, pt as parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails, qr as stringify, r as computePageSortsFingerprint, s as lookupPageSortFactories, sr as getIpfsKeyFromPrivateKey, t as RpcLocalCommunity, tr as getCommunityNameFromWire, u as deriveCommunityChallengesOrThrow, ur as getPublicKeyFromPrivateKey, v as TrackedInstanceRegistry, vn as signChallengeMessage, vr as deriveDbPosts, w as TIMEFRAMES_TO_SECONDS, wn as signCommentUpdate, wr as getThumbnailPropsOfLink, wt as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, xn as signComment, xr as forgetCommunityThatFailedToBeDeleted, y as LRUCache, yr as deriveDbReplies, zn as verifyCommunity, zr as t$10 } from "./rpc-local-community-ouDezuGZ.js";
4
+ import { a as scorePageCommentsWithFile, i as partitionPageCommentsForSort, n as filterRepliesForPageSort, o as stripRepliesFromPageComment, r as orderPageCommentsByScore, t as createDescendantsLookup } from "./page-sort-scoring-DbI7k_K5.js";
5
5
  import { fileURLToPath, pathToFileURL } from "node:url";
6
- import path from "node:path";
6
+ import Path from "node:path";
7
7
  import os from "os";
8
8
  import fs, { closeSync, existsSync, openSync, promises } from "node:fs";
9
- import path$1 from "path";
9
+ import path from "path";
10
10
  import assert from "assert";
11
11
  import { Buffer as Buffer$1 } from "buffer";
12
12
  import fs$1 from "fs";
@@ -316,15 +316,15 @@ async function throwIfChallengeSettingsAreInvalid({ challengeSettings, pkc, comm
316
316
  const processStartedCommunities = new TrackedInstanceRegistry();
317
317
  function normalizeRegistryDataPath(dataPath) {
318
318
  if (dataPath === void 0) return void 0;
319
- const resolved = path$1.resolve(dataPath);
319
+ const resolved = path.resolve(dataPath);
320
320
  let existing = resolved;
321
321
  let tail = "";
322
322
  while (true) try {
323
- return path$1.join(fs$1.realpathSync.native(existing), tail);
323
+ return path.join(fs$1.realpathSync.native(existing), tail);
324
324
  } catch {
325
- const parent = path$1.dirname(existing);
325
+ const parent = path.dirname(existing);
326
326
  if (parent === existing) return resolved;
327
- tail = path$1.join(path$1.basename(existing), tail);
327
+ tail = path.join(path.basename(existing), tail);
328
328
  existing = parent;
329
329
  }
330
330
  }
@@ -1792,9 +1792,9 @@ var DbHandler = class {
1792
1792
  if (needToMigrate) {
1793
1793
  if (dbExistsAlready && currentDbVersion > 0) {
1794
1794
  this.destoryConnection();
1795
- backupDbPath = path$1.join(path$1.dirname(dbPath), ".backup_before_migration", `${path$1.basename(dbPath)}.${currentDbVersion}.${timestamp()}`);
1796
- log(`Copying db ${path$1.basename(dbPath)} to ${backupDbPath} before migration`);
1797
- if (!fs$1.existsSync(path$1.dirname(backupDbPath))) await fs$1.promises.mkdir(path$1.dirname(backupDbPath), { recursive: true });
1795
+ backupDbPath = path.join(path.dirname(dbPath), ".backup_before_migration", `${path.basename(dbPath)}.${currentDbVersion}.${timestamp()}`);
1796
+ log(`Copying db ${path.basename(dbPath)} to ${backupDbPath} before migration`);
1797
+ if (!fs$1.existsSync(path.dirname(backupDbPath))) await fs$1.promises.mkdir(path.dirname(backupDbPath), { recursive: true });
1798
1798
  const sourceDb = new Database(dbPath, { fileMustExist: true });
1799
1799
  await sourceDb.backup(backupDbPath);
1800
1800
  sourceDb.close();
@@ -3865,10 +3865,10 @@ var DbHandler = class {
3865
3865
  if (this._db || this._keyv) await this.destoryConnection();
3866
3866
  this._transactionDepth = 0;
3867
3867
  const dataPath = this._community._pkc.dataPath;
3868
- const oldPathString = path$1.join(dataPath, "communities", oldDbName);
3869
- const newPathString = path$1.join(dataPath, "communities", newDbName);
3870
- await fs$1.promises.mkdir(path$1.dirname(oldPathString), { recursive: true });
3871
- await fs$1.promises.mkdir(path$1.dirname(newPathString), { recursive: true });
3868
+ const oldPathString = path.join(dataPath, "communities", oldDbName);
3869
+ const newPathString = path.join(dataPath, "communities", newDbName);
3870
+ await fs$1.promises.mkdir(path.dirname(oldPathString), { recursive: true });
3871
+ await fs$1.promises.mkdir(path.dirname(newPathString), { recursive: true });
3872
3872
  try {
3873
3873
  if (!fs$1.existsSync(oldPathString)) log(`Old DB file ${oldPathString} does not exist. Cannot backup/rename.`);
3874
3874
  else {
@@ -3895,8 +3895,8 @@ var DbHandler = class {
3895
3895
  async lockCommunityStart({ onCompromised }) {
3896
3896
  const log = logger_default("pkc-js:local-community:db-handler:lock:start");
3897
3897
  const communityAddress = this._community.address;
3898
- const lockfilePath = path$1.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
3899
- const communityDbPath = path$1.join(this._community._pkc.dataPath, "communities", communityAddress);
3898
+ const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
3899
+ const communityDbPath = path.join(this._community._pkc.dataPath, "communities", communityAddress);
3900
3900
  const startLock = {};
3901
3901
  try {
3902
3902
  await import_src.default.lock(communityDbPath, {
@@ -3925,8 +3925,8 @@ var DbHandler = class {
3925
3925
  const log = logger_default("pkc-js:local-community:db-handler:unlock:start");
3926
3926
  log.trace(`Attempting to unlock the start of community (${communityAddress})`);
3927
3927
  this._heldStartLock = void 0;
3928
- const lockfilePath = path$1.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
3929
- const communityDbPath = path$1.join(this._community._pkc.dataPath, "communities", communityAddress);
3928
+ const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
3929
+ const communityDbPath = path.join(this._community._pkc.dataPath, "communities", communityAddress);
3930
3930
  if (!fs$1.existsSync(lockfilePath) || !fs$1.existsSync(communityDbPath)) return;
3931
3931
  try {
3932
3932
  await import_src.default.unlock(communityDbPath, { lockfilePath });
@@ -3944,8 +3944,8 @@ var DbHandler = class {
3944
3944
  }
3945
3945
  async lockCommunityState() {
3946
3946
  const log = logger_default("pkc-js:local-community:db-handler:lock:lockCommunityState");
3947
- const lockfilePath = path$1.join(this._community._pkc.dataPath, "communities", `${this._community.address}.state.lock`);
3948
- const communityDbPath = path$1.join(this._community._pkc.dataPath, "communities", this._community.address);
3947
+ const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${this._community.address}.state.lock`);
3948
+ const communityDbPath = path.join(this._community._pkc.dataPath, "communities", this._community.address);
3949
3949
  try {
3950
3950
  await import_src.default.lock(communityDbPath, {
3951
3951
  lockfilePath,
@@ -3962,8 +3962,8 @@ var DbHandler = class {
3962
3962
  }
3963
3963
  async unlockCommunityState() {
3964
3964
  const log = logger_default("pkc-js:local-community:db-handler:lock:unlockCommunityState");
3965
- const lockfilePath = path$1.join(this._community._pkc.dataPath, "communities", `${this._community.address}.state.lock`);
3966
- const communityDbPath = path$1.join(this._community._pkc.dataPath, "communities", this._community.address);
3965
+ const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${this._community.address}.state.lock`);
3966
+ const communityDbPath = path.join(this._community._pkc.dataPath, "communities", this._community.address);
3967
3967
  if (!fs$1.existsSync(lockfilePath)) return;
3968
3968
  try {
3969
3969
  await import_src.default.unlock(communityDbPath, { lockfilePath });
@@ -3973,7 +3973,7 @@ var DbHandler = class {
3973
3973
  }
3974
3974
  }
3975
3975
  communityDbExists() {
3976
- const communityDbPath = path$1.join(this._community._pkc.dataPath, "communities", this._community.address);
3976
+ const communityDbPath = path.join(this._community._pkc.dataPath, "communities", this._community.address);
3977
3977
  return fs$1.existsSync(communityDbPath);
3978
3978
  }
3979
3979
  markCommentsAsPublishedToPostUpdates(commentCids) {
@@ -5280,12 +5280,19 @@ async function handleChallengeRequest(community, request, isLocalPublisher) {
5280
5280
  community._challengeExchangesFromLocalPublishers[request.challengeRequestId.toString()] = true;
5281
5281
  }
5282
5282
  community._ongoingChallengeExchanges.set(request.challengeRequestId.toString(), true);
5283
- const requestSignatureValidation = await verifyChallengeRequest({
5284
- request,
5285
- validateTimestampRange: true
5286
- });
5287
- if (!requestSignatureValidation.valid) throw new PKCError(getErrorCodeFromMessage(requestSignatureValidation.reason), { challengeRequest: n$2(request, ["encrypted"]) });
5288
- const decrypted = await parseChallengeRequest(community, request, log);
5283
+ let decrypted;
5284
+ try {
5285
+ const requestSignatureValidation = await verifyChallengeRequest({
5286
+ request,
5287
+ validateTimestampRange: true
5288
+ });
5289
+ if (!requestSignatureValidation.valid) throw new PKCError(getErrorCodeFromMessage(requestSignatureValidation.reason), { challengeRequest: n$2(request, ["encrypted"]) });
5290
+ decrypted = await parseChallengeRequest(community, request, log);
5291
+ } catch (e) {
5292
+ community._ongoingChallengeExchanges.delete(request.challengeRequestId.toString());
5293
+ delete community._challengeExchangesFromLocalPublishers[request.challengeRequestId.toString()];
5294
+ throw e;
5295
+ }
5289
5296
  if (!decrypted) return;
5290
5297
  const publicationSignature = decrypted.publication.signature.signature;
5291
5298
  let waitedForInFlightExchange = false;
@@ -5341,12 +5348,7 @@ async function handleChallengeAnswer(community, challengeAnswer) {
5341
5348
  answer: challengeAnswer,
5342
5349
  validateTimestampRange: true
5343
5350
  });
5344
- if (!answerSignatureValidation.valid) {
5345
- cleanUpChallengeAnswerPromise(community, challengeAnswer.challengeRequestId.toString());
5346
- community._ongoingChallengeExchanges.delete(challengeAnswer.challengeRequestId.toString());
5347
- delete community._challengeExchangesFromLocalPublishers[challengeAnswer.challengeRequestId.toString()];
5348
- throw new PKCError(getErrorCodeFromMessage(answerSignatureValidation.reason), { challengeAnswer });
5349
- }
5351
+ if (!answerSignatureValidation.valid) throw new PKCError(getErrorCodeFromMessage(answerSignatureValidation.reason), { challengeAnswer });
5350
5352
  const decryptedAnswers = await parseChallengeAnswerOrRespondWithFailure(community, challengeAnswer, await decryptOrRespondWithFailure(community, challengeAnswer));
5351
5353
  const decryptedChallengeAnswerPubsubMessage = {
5352
5354
  ...challengeAnswer,
@@ -6006,6 +6008,10 @@ async function storeCommentModeration(community, commentModRaw, challengeRequest
6006
6008
  } else if ("approved" in modTableRow.commentModeration) if (modTableRow.commentModeration.approved) {
6007
6009
  log("commentModeration.approved=true, and therefore move comment from pending approval and add it to IPFS", "comment cid is", modTableRow.commentCid);
6008
6010
  await community._addCommentRowToIPFS(commentToBeEdited, logger_default("pkc-js:local-community:storeCommentModeration:_addCommentRowToIPFS"));
6011
+ if (!community._dbHandler.queryComment(modTableRow.commentCid)) {
6012
+ addAllCidsUnderPurgedCommentToBeRemoved(community, { commentTableRow: commentToBeEdited });
6013
+ throw new PKCError("ERR_COMMENT_MODERATION_NO_COMMENT_TO_EDIT", { commentCid: modTableRow.commentCid });
6014
+ }
6009
6015
  community._dbHandler.approvePendingComment({ cid: modTableRow.commentCid });
6010
6016
  } else {
6011
6017
  const shouldPurgeDisapprovedComment = Object.keys(modTableRow.commentModeration).length === 1;
@@ -7302,9 +7308,9 @@ async function restartCommunityAfterFailedRename({ community, oldAddress, newAdd
7302
7308
  }
7303
7309
  }
7304
7310
  async function removePartialDbCopy({ community, oldAddress, newAddress, log }) {
7305
- const communitiesPath = path.join(community._pkc.dataPath, "communities");
7306
- const partialDbCopyPath = path.join(communitiesPath, newAddress);
7307
- if (!fs.existsSync(path.join(communitiesPath, oldAddress))) return {
7311
+ const communitiesPath = Path.join(community._pkc.dataPath, "communities");
7312
+ const partialDbCopyPath = Path.join(communitiesPath, newAddress);
7313
+ if (!fs.existsSync(Path.join(communitiesPath, oldAddress))) return {
7308
7314
  removed: false,
7309
7315
  path: partialDbCopyPath
7310
7316
  };
@@ -7321,7 +7327,7 @@ async function removePartialDbCopy({ community, oldAddress, newAddress, log }) {
7321
7327
  }
7322
7328
  }
7323
7329
  async function undoRenameAfterDbRenameFailed({ community, oldAddress, newAddress, dbRenameError, log }) {
7324
- const communitiesPath = path.join(community._pkc.dataPath, "communities");
7330
+ const communitiesPath = Path.join(community._pkc.dataPath, "communities");
7325
7331
  const partialDbCopy = await removePartialDbCopy({
7326
7332
  community,
7327
7333
  oldAddress,
@@ -7339,8 +7345,8 @@ async function undoRenameAfterDbRenameFailed({ community, oldAddress, newAddress
7339
7345
  error: new PKCError("ERR_FAILED_TO_RENAME_COMMUNITY_DB", {
7340
7346
  oldAddress,
7341
7347
  newAddress,
7342
- oldDbPath: path.join(communitiesPath, oldAddress),
7343
- newDbPath: path.join(communitiesPath, newAddress),
7348
+ oldDbPath: Path.join(communitiesPath, oldAddress),
7349
+ newDbPath: Path.join(communitiesPath, newAddress),
7344
7350
  error: dbRenameError,
7345
7351
  errorMessage: renameError?.message,
7346
7352
  errorName: renameError?.name,
@@ -7523,11 +7529,11 @@ async function edit(community, newCommunityOptions) {
7523
7529
  const EXPORTS_KEY = STORAGE_KEYS[STORAGE_KEYS.EXPORTS];
7524
7530
  function defaultExportPathFor(community, exportId) {
7525
7531
  if (typeof community._pkc.dataPath !== "string") throw new PKCError("ERR_DATA_PATH_IS_NOT_DEFINED", { communityAddress: community.address });
7526
- return path.join(community._pkc.dataPath, "exports", `${exportId}.sqlite`);
7532
+ return Path.join(community._pkc.dataPath, "exports", `${exportId}.sqlite`);
7527
7533
  }
7528
7534
  function sourceDbPathFor(community) {
7529
7535
  if (typeof community._pkc.dataPath !== "string") throw new PKCError("ERR_DATA_PATH_IS_NOT_DEFINED", { communityAddress: community.address });
7530
- return path.join(community._pkc.dataPath, "communities", community.address);
7536
+ return Path.join(community._pkc.dataPath, "communities", community.address);
7531
7537
  }
7532
7538
  async function persistExports(community) {
7533
7539
  if (!community._dbHandler) return;
@@ -7603,9 +7609,9 @@ async function runExportTask(community, exportId, opts) {
7603
7609
  async function exportCommunityEmbedded(community, options = {}) {
7604
7610
  if (options.signal?.aborted) throw options.signal.reason ?? new DOMException("The operation was aborted.", "AbortError");
7605
7611
  const exportId = v4();
7606
- const destPath = options.exportPath ? path.resolve(options.exportPath) : defaultExportPathFor(community, exportId);
7612
+ const destPath = options.exportPath ? Path.resolve(options.exportPath) : defaultExportPathFor(community, exportId);
7607
7613
  const includePrivateKey = options.includePrivateKey === true;
7608
- if (path.resolve(destPath) === path.resolve(sourceDbPathFor(community))) throw new PKCError("ERR_EXPORT_PATH_TARGETS_LIVE_DB", {
7614
+ if (Path.resolve(destPath) === Path.resolve(sourceDbPathFor(community))) throw new PKCError("ERR_EXPORT_PATH_TARGETS_LIVE_DB", {
7609
7615
  communityAddress: community.address,
7610
7616
  exportPath: destPath
7611
7617
  });
@@ -1,7 +1,7 @@
1
1
  import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
2
- import { $ as retryKuboIpfsAdd, At as pTimeout, Bn as CommentUpdateSchema, Br as logger_default, C as hideClassPrivateProps, Cr as e$1, Ct as trackUpdatingComment, D as isIpfsCid, Dt as untrackUpdatingCommunity, E as isAbortError, Et as untrackUpdatingComment, Ft as ChallengeRequestMessageSchema, Ln as CommentUpdateForChallengeVerificationSchema, Lr as FailedToFetchPageIpfsFromGatewaysError, Lt as ChallengeVerificationMessageSchema, Mn as CommentIpfsSchema, Mr as require_retry$1, Nr as FailedToFetchCommentIpfsFromGatewaysError, Nt as ChallengeMessageSchema, Ot as require_sha256, Pr as FailedToFetchCommentUpdateFromGatewaysError, Rr as PKCError, Sn as PubsubTopicSchema, Sr as e, T as ipnsNameToIpnsOverPubsubTopic, Tr as r, U as rejectWhenAbortSignalFires, Ur as setErrorMap, W as rejectWhenCommunityStopsOrAborts, X as replaceXWithY, Y as removeUndefinedValuesRecursively, Yt as version_default, Z as resolveWhenPredicateIsTrue, _r as n$2, _t as listUpdatingComments, a as calculateStringSizeSameAsIpfsAddCidV0Sync, at as throwIfAbortSignalAborted, d as deepMergeRuntimeFields, et as retryKuboIpfsAddAndProvide, ft as findStartedCommunity, gr as isStringDomain, gt as listStartedCommunities, i as calculateStringSizeSameAsIpfsAddCidV0, jt as ChallengeAnswerMessageSchema, k as isIpns, kt as TimeoutError, ln as CommunityAnchorSchema, mn as CommunityIpfsSchema, mt as findUpdatingCommunity, nt as shortifyCid, ot as timestamp, p as doesDomainAddressHaveCapitalLetter, pt as findUpdatingComment, r as calculateIpfsCidV0, ri as en_default, rt as sleepUntilTimeoutOrAbort, st as waitForUpdateInCommunityInstanceWithErrorAndTimeout, tt as shortifyAddress, u as createAbortError, vt as listUpdatingCommunities, x as getPostUpdateTimestampRange, xr as t$1, yr as n$1, yt as refreshTrackedCommentAliases, z as linkAbortSignals, zr as messages } from "./util-DMr7Hj-w.js";
3
- import { $n as buildRuntimeCommunityFields, $t as RpcPublishCommunityListParamSchema, A as findCommentInParsedPages, At as parseRpcCommentUpdateEventWithPKCErrorIfItFails, B as GenericStateClient, Bn as verifyCommunityEdit, Bt as RpcCommunityIdentifierParamSchema, C as RepliesPages, Cn as signCommentModeration, Cr as getDefaultDataPath, Ct as parseCreateVoteOptionsSchemaWithPKCErrorIfItFails, D as extractCommunityRuntimeFieldsFromParsedPages, Dn as signCommunityEdit, Dr as monitorCommunitiesDirectory, Dt as parseJsonWithPKCErrorIfFails, Er as listCommunitiesSync, Et as parseDecryptedChallengeWithPKCErrorIfItFails, F as cloneCrosspostForRuntime, Fn as verifyCommentIpfs, Fr as toCommunitiesEntry, Ft as RpcAuthorNameParamSchema, G as PKCTypedEmitter, Gn as getAuthorNameFromRuntime, Gr as t$2, Gt as RpcExportCommunityParamSchema, H as InflightResourceTypes, Hn as verifyVote, Hr as t$3, Ht as RpcEditCommunityParamSchema, I as collectCrosspostAuthorsToResolve, In as verifyCommentModeration, It as RpcCancelExportParamSchema, J as decodeRpcChallengeRequestPubsubMsg, Jn as CreateCommunityListWithCidOptionsSchema, Jr as MAX_FILE_SIZE_BYTES_FOR_COMMENT_UPDATE, Jt as RpcFetchCidResultSchema, K as decodeRpcChallengeAnswerPubsubMsg, Kn as getAuthorNameFromWire, Kr as t$4, Kt as RpcExportCommunityResultSchema, Ln as verifyCommentPubsubMessage, Lt as RpcCidParamSchema, M as parseRawPages, Mr as setNativeFunctions$1, Nn as verifyChallengeVerification, Nr as tryToDeleteCommunitiesThatFailedToBeDeletedBefore, Nt as parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails, O as findCommentInPageInstance, On as signCommunityList, Ot as parsePKCUserOptionsSchemaWithPKCErrorIfItFails, P as applyNameResolvedCacheToCrosspost, Pn as verifyCommentEdit, Pr as findCommunitiesEntry, Pt as RpcAnchorPublishPreparationResultSchema, Qt as RpcPublishChallengeAnswersParamSchema, R as stripNameResolvedFromCrosspost, Rn as verifyCommentUpdate, Rt as RpcCommentRepliesPageParamSchema, Sn as signCommentEdit, St as parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, Tt as parseDecryptedChallengeVerification, Un as buildRuntimeAuthor, Ur as n$3, Ut as RpcExportCommunityModLogsParamSchema, V as InflightFetchManager, Vn as verifyCommunityList, Vt as RpcCommunityPageParamSchema, Wn as cleanWireAuthor, Wt as RpcExportCommunityModLogsResultSchema, Xn as MAX_COMMUNITY_LIST_SIZE_BYTES, Xr as NAME_RESOLVED_TRUE_TTL_MS, Xt as RpcFetchCommunityListResultSchema, Y as decodeRpcChallengeVerificationPubsubMsg, Yn as CreateNewCommunityListOptionsSchema, Yr as NAME_RESOLVED_FALSE_TTL_MS, Yt as RpcFetchCommunityListParamSchema, Zr as NAME_RESOLVE_FAILED_RETRY_FLOOR_MS, Zt as RpcPublishAnchorRecordParamSchema, _n as signChallengeAnswer, _t as parseCreateCommentOptionsSchemaWithPKCErrorIfItFails, an as RpcUnsubscribeParamSchema, b as KeyvBetterSqlite3, br as findLocalCommunityAddress, ct as parseCommentUpdateSchemaWithPKCErrorIfItFails, dn as decryptEd25519AesGcm, ei as nativeFunctions$2, en as RpcPublishCommunityListResultSchema, er as getCommunityAddressFromRecord, et as parseCidStringSchemaWithPKCErrorIfItFails, ft as parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, gn as cleanUpBeforePublishing, gt as parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails, hr as createKuboRpcClient, ht as parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails, in as RpcSuccessResultSchema, ir as decode, it as parseCommentIpfsSchemaWithPKCErrorIfItFails, jn as verifyChallengeMessage, jt as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, k as findCommentInPageInstanceRecursively, kn as signVote, kt as parseRpcCommentEventWithPKCErrorIfItFails, l as pkcJsPageSorts, ln as createSigner, lr as getPKCAddressFromPublicKeySync, lt as parseCommunityAddressWithPKCErrorIfItFails, m as pkcJsChallenges, mt as parseCommunityListSchemaWithPKCErrorIfItFails, n as RpcRemoteCommunity, nn as RpcResolveAuthorNameResultSchema, nr as getCommunityPublicKeyFromWire, on as findCommunityRecordNameMismatch, or as getBufferedPKCAddressFromPublicKey, ot as parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails, pn as encryptEd25519AesGcm, q as decodeRpcChallengePubsubMsg, qn as normalizeCreatePublicationAuthor, qt as RpcFetchCidParamSchema, rn as RpcSubscriptionIdResultSchema, rr as normalizeCommunityInputFromCommunity, rt as parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, sn as require_lib$1, st as parseCommentPubsubMessagePublicationWithPKCErrorIfItFails, t as RpcLocalCommunity, tn as RpcPublishedAnchorRecordResultSchema, tr as getCommunityNameFromWire, un as createAnchorIpnsRecord$1, v as TrackedInstanceRegistry, vt as parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails, wt as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, x as RemoteCommunity, xn as signComment, xt as parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, y as LRUCache, yn as signChallengeRequest, z as PKCClientsManager, zr as t$5, zt as RpcCommunitiesChangeEventResultSchema } from "./rpc-local-community-WnhiTbxm.js";
4
- import { s as getHeliaDebugContext } from "./util-7QtFMzpc.js";
2
+ import { $ as retryKuboIpfsAdd, At as pTimeout, Bn as CommentUpdateSchema, Br as logger_default, C as hideClassPrivateProps, Cr as e$1, Ct as trackUpdatingComment, D as isIpfsCid, Dt as untrackUpdatingCommunity, E as isAbortError, Et as untrackUpdatingComment, Ft as ChallengeRequestMessageSchema, Ln as CommentUpdateForChallengeVerificationSchema, Lr as FailedToFetchPageIpfsFromGatewaysError, Lt as ChallengeVerificationMessageSchema, Mn as CommentIpfsSchema, Mr as require_retry$1, Nr as FailedToFetchCommentIpfsFromGatewaysError, Nt as ChallengeMessageSchema, Ot as require_sha256, Pr as FailedToFetchCommentUpdateFromGatewaysError, Rr as PKCError, Sn as PubsubTopicSchema, Sr as e, T as ipnsNameToIpnsOverPubsubTopic, Tr as r, U as rejectWhenAbortSignalFires, Ur as setErrorMap, W as rejectWhenCommunityStopsOrAborts, X as replaceXWithY, Y as removeUndefinedValuesRecursively, Yt as version_default, Z as resolveWhenPredicateIsTrue, _r as n$2, _t as listUpdatingComments, a as calculateStringSizeSameAsIpfsAddCidV0Sync, at as throwIfAbortSignalAborted, d as deepMergeRuntimeFields, et as retryKuboIpfsAddAndProvide, ft as findStartedCommunity, gr as isStringDomain, gt as listStartedCommunities, i as calculateStringSizeSameAsIpfsAddCidV0, jt as ChallengeAnswerMessageSchema, k as isIpns, kt as TimeoutError, ln as CommunityAnchorSchema, mn as CommunityIpfsSchema, mt as findUpdatingCommunity, nt as shortifyCid, ot as timestamp, p as doesDomainAddressHaveCapitalLetter, pt as findUpdatingComment, r as calculateIpfsCidV0, ri as en_default, rt as sleepUntilTimeoutOrAbort, st as waitForUpdateInCommunityInstanceWithErrorAndTimeout, tt as shortifyAddress, u as createAbortError, vt as listUpdatingCommunities, x as getPostUpdateTimestampRange, xr as t$1, yr as n$1, yt as refreshTrackedCommentAliases, z as linkAbortSignals, zr as messages } from "./util-B81IOt07.js";
3
+ import { $n as buildRuntimeCommunityFields, $t as RpcPublishCommunityListParamSchema, A as findCommentInParsedPages, At as parseRpcCommentUpdateEventWithPKCErrorIfItFails, B as GenericStateClient, Bn as verifyCommunityEdit, Bt as RpcCommunityIdentifierParamSchema, C as RepliesPages, Cn as signCommentModeration, Cr as getDefaultDataPath, Ct as parseCreateVoteOptionsSchemaWithPKCErrorIfItFails, D as extractCommunityRuntimeFieldsFromParsedPages, Dn as signCommunityEdit, Dr as monitorCommunitiesDirectory, Dt as parseJsonWithPKCErrorIfFails, Er as listCommunitiesSync, Et as parseDecryptedChallengeWithPKCErrorIfItFails, F as cloneCrosspostForRuntime, Fn as verifyCommentIpfs, Fr as toCommunitiesEntry, Ft as RpcAuthorNameParamSchema, G as PKCTypedEmitter, Gn as getAuthorNameFromRuntime, Gr as t$2, Gt as RpcExportCommunityParamSchema, H as InflightResourceTypes, Hn as verifyVote, Hr as t$3, Ht as RpcEditCommunityParamSchema, I as collectCrosspostAuthorsToResolve, In as verifyCommentModeration, It as RpcCancelExportParamSchema, J as decodeRpcChallengeRequestPubsubMsg, Jn as CreateCommunityListWithCidOptionsSchema, Jr as MAX_FILE_SIZE_BYTES_FOR_COMMENT_UPDATE, Jt as RpcFetchCidResultSchema, K as decodeRpcChallengeAnswerPubsubMsg, Kn as getAuthorNameFromWire, Kr as t$4, Kt as RpcExportCommunityResultSchema, Ln as verifyCommentPubsubMessage, Lt as RpcCidParamSchema, M as parseRawPages, Mr as setNativeFunctions$1, Nn as verifyChallengeVerification, Nr as tryToDeleteCommunitiesThatFailedToBeDeletedBefore, Nt as parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails, O as findCommentInPageInstance, On as signCommunityList, Ot as parsePKCUserOptionsSchemaWithPKCErrorIfItFails, P as applyNameResolvedCacheToCrosspost, Pn as verifyCommentEdit, Pr as findCommunitiesEntry, Pt as RpcAnchorPublishPreparationResultSchema, Qt as RpcPublishChallengeAnswersParamSchema, R as stripNameResolvedFromCrosspost, Rn as verifyCommentUpdate, Rt as RpcCommentRepliesPageParamSchema, Sn as signCommentEdit, St as parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, Tt as parseDecryptedChallengeVerification, Un as buildRuntimeAuthor, Ur as n$3, Ut as RpcExportCommunityModLogsParamSchema, V as InflightFetchManager, Vn as verifyCommunityList, Vt as RpcCommunityPageParamSchema, Wn as cleanWireAuthor, Wt as RpcExportCommunityModLogsResultSchema, Xn as MAX_COMMUNITY_LIST_SIZE_BYTES, Xr as NAME_RESOLVED_TRUE_TTL_MS, Xt as RpcFetchCommunityListResultSchema, Y as decodeRpcChallengeVerificationPubsubMsg, Yn as CreateNewCommunityListOptionsSchema, Yr as NAME_RESOLVED_FALSE_TTL_MS, Yt as RpcFetchCommunityListParamSchema, Zr as NAME_RESOLVE_FAILED_RETRY_FLOOR_MS, Zt as RpcPublishAnchorRecordParamSchema, _n as signChallengeAnswer, _t as parseCreateCommentOptionsSchemaWithPKCErrorIfItFails, an as RpcUnsubscribeParamSchema, b as KeyvBetterSqlite3, br as findLocalCommunityAddress, ct as parseCommentUpdateSchemaWithPKCErrorIfItFails, dn as decryptEd25519AesGcm, ei as nativeFunctions$2, en as RpcPublishCommunityListResultSchema, er as getCommunityAddressFromRecord, et as parseCidStringSchemaWithPKCErrorIfItFails, ft as parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, gn as cleanUpBeforePublishing, gt as parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails, hr as createKuboRpcClient, ht as parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails, in as RpcSuccessResultSchema, ir as decode, it as parseCommentIpfsSchemaWithPKCErrorIfItFails, jn as verifyChallengeMessage, jt as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, k as findCommentInPageInstanceRecursively, kn as signVote, kt as parseRpcCommentEventWithPKCErrorIfItFails, l as pkcJsPageSorts, ln as createSigner, lr as getPKCAddressFromPublicKeySync, lt as parseCommunityAddressWithPKCErrorIfItFails, m as pkcJsChallenges, mt as parseCommunityListSchemaWithPKCErrorIfItFails, n as RpcRemoteCommunity, nn as RpcResolveAuthorNameResultSchema, nr as getCommunityPublicKeyFromWire, on as findCommunityRecordNameMismatch, or as getBufferedPKCAddressFromPublicKey, ot as parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails, pn as encryptEd25519AesGcm, q as decodeRpcChallengePubsubMsg, qn as normalizeCreatePublicationAuthor, qt as RpcFetchCidParamSchema, rn as RpcSubscriptionIdResultSchema, rr as normalizeCommunityInputFromCommunity, rt as parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, sn as require_lib$1, st as parseCommentPubsubMessagePublicationWithPKCErrorIfItFails, t as RpcLocalCommunity, tn as RpcPublishedAnchorRecordResultSchema, tr as getCommunityNameFromWire, un as createAnchorIpnsRecord$1, v as TrackedInstanceRegistry, vt as parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails, wt as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, x as RemoteCommunity, xn as signComment, xt as parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, y as LRUCache, yn as signChallengeRequest, z as PKCClientsManager, zr as t$5, zt as RpcCommunitiesChangeEventResultSchema } from "./rpc-local-community-ouDezuGZ.js";
4
+ import { s as getHeliaDebugContext } from "./util-DofMBAFz.js";
5
5
  import path from "path";
6
6
  import assert from "assert";
7
7
  import fs from "fs";
@@ -36102,7 +36102,7 @@ var PKC$1 = class extends PKCTypedEmitter {
36102
36102
  this.clients.libp2pJsClients = {};
36103
36103
  if (!this.libp2pJsClientsOptions) return;
36104
36104
  if (!this.httpRoutersOptions) throw Error("httpRoutersOptions is required for libp2pJsClient");
36105
- const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-jM3y3OXF.js");
36105
+ const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-BUVgQgXa.js");
36106
36106
  for (const clientOptions of this.libp2pJsClientsOptions) {
36107
36107
  const heliaNode = await createLibp2pJsClientOrUseExistingOne({
36108
36108
  ...clientOptions,
@@ -36469,7 +36469,7 @@ var PKC$1 = class extends PKCTypedEmitter {
36469
36469
  const log = logger_default("pkc-js:pkc:createLocalCommunity");
36470
36470
  log.trace("Received community options to create a local community instance:", options);
36471
36471
  if (!this._canCreateNewLocalCommunity()) throw new PKCError("ERR_CAN_NOT_CREATE_A_LOCAL_COMMUNITY", { pkcOptions: this._userPKCOptions });
36472
- const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-P9e5jksW.js");
36472
+ const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-GWqz4s3g.js");
36473
36473
  const isLocalCommunity = (await listCommunitiesSync(this)).includes(options.address);
36474
36474
  const community = new LocalCommunity(this);
36475
36475
  if (isLocalCommunity) {
@@ -1,4 +1,4 @@
1
- import { gr as isStringDomain, v as getEquivalentCommunityAddresses, xn as PageSortFileSchema } from "./util-DMr7Hj-w.js";
1
+ import { gr as isStringDomain, v as getEquivalentCommunityAddresses, xn as PageSortFileSchema } from "./util-B81IOt07.js";
2
2
  //#region dist/node/pages/page-sort-scoring.js
3
3
  function validatePageSortFile(rawFile) {
4
4
  const validated = PageSortFileSchema.parse(rawFile);
@@ -1,7 +1,7 @@
1
1
  import { i as __toESM, n as __exportAll, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
2
- import { $n as CommentEditSignedPropertyNames, $r as record, $t as CommunityEditPubsubMessagePublicationSchema, A as isIpnsPath, An as CommentChallengeRequestToEncryptSchema, Ar as t$9, At as pTimeout, B as pubsubTopicToDhtKey, Bn as CommentUpdateSchema, Br as logger_default, C as hideClassPrivateProps, Cn as RpcRemoteCommunityUpdateEventResultSchema, Cr as e$5, D as isIpfsCid, Dr as n$8, Dt as untrackUpdatingCommunity, E as isAbortError, En as VotePubsubMessagePublicationSchema, Er as t$12, Fn as CommentSignedPropertyNames, Fr as FailedToFetchCommunityFromGatewaysError, Gn as GetPageParamSchema, Gr as array, Gt as NameResolverSerializedSchema, H as raceAgainstAbort, Hr as require_ms$1, Ht as DecryptedChallengeSchema, In as CommentUpdateChallengeReservedFieldNames, Ir as FailedToFetchGenericIpfsFromGatewaysError, It as ChallengeRequestMessageSignedPropertyNames, Jn as isReservedObjectKey, Jr as literal, Jt as PKCUserOptionsSchema, Kn as ModQueuePageIpfsSchema, Kr as boolean, Kt as PKCParsedOptionsSchema, L as isRequestPubsubPublicationOfPost, Lr as FailedToFetchPageIpfsFromGatewaysError, Mn as CommentIpfsSchema, Mr as require_retry$2, Mt as ChallengeAnswerMessageSignedPropertyNames, Nr as FailedToFetchCommentIpfsFromGatewaysError, O as isIpfsPath, On as VoteSignedPropertyNames, Or as r$7, Ot as require_sha256$1, Pn as CommentPubsubMessageWithFlexibleAuthorRefinementSchema, Pr as FailedToFetchCommentUpdateFromGatewaysError, Pt as ChallengeMessageSignedPropertyNames, Qr as preprocess, Qt as CommunityEditPublicationSignedPropertyNames, R as isRequestPubsubPublicationOfReply, Rn as CommentUpdateForChallengeVerificationSignedPropertyNames, Rr as PKCError, Rt as ChallengeVerificationMessageSignedPropertyNames, S as hasTransientNetworkErrorCode, Sr as e$6, St as trackStartedCommunity, T as ipnsNameToIpnsOverPubsubTopic, Tn as VoteChallengeRequestToEncryptSchema, Tr as r$8, Tt as untrackStartedCommunity, Ut as DecryptedChallengeVerificationSchema, Vn as CommentUpdateSignedPropertyNames, Vr as require_supports_color, Wn as CreateCommentOptionsWithRefinementSchema, Wr as _enum, Wt as NameResolveCacheOptionsSchema, Xr as number, Xt as CommunityEditPublicationChallengeRequestToEncryptSchema, Yn as CommentEditChallengeRequestToEncryptSchema, Yr as looseObject, Zn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, Zr as object, _n as CreateRemoteCommunityFunctionArgumentSchema, _r as n$9, an as CommentModerationsTableRowSchema, ar as AuthorReservedFields, at as throwIfAbortSignalAborted, bn as PageSortFileFactorySchema, bt as refreshTrackedCommunityAliases, cn as ChallengeFileSchema, cr as CidStringSchema, d as deepMergeRuntimeFields, dn as CommunityEditOptionsSchema, dr as CreateSignerSchema, ei as string, en as CreateCommunityEditPublicationOptionsWithRefinementSchema, f as derivePublicationFromChallengeRequest, fn as CommunityExportRecordsSchema, fr as JsonSignatureSchema, ft as findStartedCommunity, gn as CreateNewLocalCommunityUserOptionsSchema, gr as isStringDomain, h as fetchAndValidateIpnsRecordFromGateway, hn as CommunitySignedPropertyNames, hr as areEquivalentNames, ht as forgetTrackedUpdatingCommunityName, in as CommentModerationSignedPropertyNames, ir as AuthorPubsubSchema, jn as CommentIpfsReservedFields, jr as e$4, k as isIpns, kr as t$10, lr as CommunityAddressSchema, m as extractNetworkErrorDetails, mn as CommunityIpfsSchema, mr as ProtocolVersionSchema, mt as findUpdatingCommunity, nn as CommentModerationPubsubMessagePublicationSchema, nr as AuthorAddressSchema, nt as shortifyCid, on as CreateCommentModerationOptionsWithRefinementSchema, or as ChallengeAnswersSchema, ot as timestamp, p as doesDomainAddressHaveCapitalLetter, pn as CommunityIpfsReservedFields, pr as PKCTimestampSchema, q as removeNullUndefinedEmptyObjectsValuesRecursively, qn as PageIpfsSchema, qr as custom, qt as PKCUserOptionBaseSchema, r as calculateIpfsCidV0, rr as AuthorCommentIpfsReservedFields, rt as sleepUntilTimeoutOrAbort, sn as ChallengeFileFactorySchema, sr as CidPathSchema, t as areEquivalentCommunityAddresses, ti as union, tn as CommentModerationChallengeRequestToEncryptSchema, tr as CreateCommentEditOptionsWithRefinementSchema, tt as shortifyAddress, u as createAbortError, un as CommunityChallengeSettingSchema, ur as CommunityAuthorChallengeReservedFieldNames, vn as CreateRpcCommunityFunctionArgumentSchema, w as interruptibleSleep, wn as CreateVoteUserOptionsWithRefinementSchema, wr as t$11, wt as trackUpdatingCommunity, xn as PageSortFileSchema, xr as t$13, yn as ExportCommunityModLogsOptionsSchema, yr as n$10, z as linkAbortSignals, zn as CommentUpdateReservedFields, zr as messages, zt as DecryptedChallengeAnswerSchema } from "./util-DMr7Hj-w.js";
2
+ import { $n as CommentEditSignedPropertyNames, $r as record, $t as CommunityEditPubsubMessagePublicationSchema, A as isIpnsPath, An as CommentChallengeRequestToEncryptSchema, Ar as t$9, At as pTimeout, B as pubsubTopicToDhtKey, Bn as CommentUpdateSchema, Br as logger_default, C as hideClassPrivateProps, Cn as RpcRemoteCommunityUpdateEventResultSchema, Cr as e$5, D as isIpfsCid, Dr as n$8, Dt as untrackUpdatingCommunity, E as isAbortError, En as VotePubsubMessagePublicationSchema, Er as t$12, Fn as CommentSignedPropertyNames, Fr as FailedToFetchCommunityFromGatewaysError, Gn as GetPageParamSchema, Gr as array, Gt as NameResolverSerializedSchema, H as raceAgainstAbort, Hr as require_ms$1, Ht as DecryptedChallengeSchema, In as CommentUpdateChallengeReservedFieldNames, Ir as FailedToFetchGenericIpfsFromGatewaysError, It as ChallengeRequestMessageSignedPropertyNames, Jn as isReservedObjectKey, Jr as literal, Jt as PKCUserOptionsSchema, Kn as ModQueuePageIpfsSchema, Kr as boolean, Kt as PKCParsedOptionsSchema, L as isRequestPubsubPublicationOfPost, Lr as FailedToFetchPageIpfsFromGatewaysError, Mn as CommentIpfsSchema, Mr as require_retry$2, Mt as ChallengeAnswerMessageSignedPropertyNames, Nr as FailedToFetchCommentIpfsFromGatewaysError, O as isIpfsPath, On as VoteSignedPropertyNames, Or as r$7, Ot as require_sha256$1, Pn as CommentPubsubMessageWithFlexibleAuthorRefinementSchema, Pr as FailedToFetchCommentUpdateFromGatewaysError, Pt as ChallengeMessageSignedPropertyNames, Qr as preprocess, Qt as CommunityEditPublicationSignedPropertyNames, R as isRequestPubsubPublicationOfReply, Rn as CommentUpdateForChallengeVerificationSignedPropertyNames, Rr as PKCError, Rt as ChallengeVerificationMessageSignedPropertyNames, S as hasTransientNetworkErrorCode, Sr as e$6, St as trackStartedCommunity, T as ipnsNameToIpnsOverPubsubTopic, Tn as VoteChallengeRequestToEncryptSchema, Tr as r$8, Tt as untrackStartedCommunity, Ut as DecryptedChallengeVerificationSchema, Vn as CommentUpdateSignedPropertyNames, Vr as require_supports_color, Wn as CreateCommentOptionsWithRefinementSchema, Wr as _enum, Wt as NameResolveCacheOptionsSchema, Xr as number, Xt as CommunityEditPublicationChallengeRequestToEncryptSchema, Yn as CommentEditChallengeRequestToEncryptSchema, Yr as looseObject, Zn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, Zr as object, _n as CreateRemoteCommunityFunctionArgumentSchema, _r as n$9, an as CommentModerationsTableRowSchema, ar as AuthorReservedFields, at as throwIfAbortSignalAborted, bn as PageSortFileFactorySchema, bt as refreshTrackedCommunityAliases, cn as ChallengeFileSchema, cr as CidStringSchema, d as deepMergeRuntimeFields, dn as CommunityEditOptionsSchema, dr as CreateSignerSchema, ei as string, en as CreateCommunityEditPublicationOptionsWithRefinementSchema, f as derivePublicationFromChallengeRequest, fn as CommunityExportRecordsSchema, fr as JsonSignatureSchema, ft as findStartedCommunity, gn as CreateNewLocalCommunityUserOptionsSchema, gr as isStringDomain, h as fetchAndValidateIpnsRecordFromGateway, hn as CommunitySignedPropertyNames, hr as areEquivalentNames, ht as forgetTrackedUpdatingCommunityName, in as CommentModerationSignedPropertyNames, ir as AuthorPubsubSchema, jn as CommentIpfsReservedFields, jr as e$4, k as isIpns, kr as t$10, lr as CommunityAddressSchema, m as extractNetworkErrorDetails, mn as CommunityIpfsSchema, mr as ProtocolVersionSchema, mt as findUpdatingCommunity, nn as CommentModerationPubsubMessagePublicationSchema, nr as AuthorAddressSchema, nt as shortifyCid, on as CreateCommentModerationOptionsWithRefinementSchema, or as ChallengeAnswersSchema, ot as timestamp, p as doesDomainAddressHaveCapitalLetter, pn as CommunityIpfsReservedFields, pr as PKCTimestampSchema, q as removeNullUndefinedEmptyObjectsValuesRecursively, qn as PageIpfsSchema, qr as custom, qt as PKCUserOptionBaseSchema, r as calculateIpfsCidV0, rr as AuthorCommentIpfsReservedFields, rt as sleepUntilTimeoutOrAbort, sn as ChallengeFileFactorySchema, sr as CidPathSchema, t as areEquivalentCommunityAddresses, ti as union, tn as CommentModerationChallengeRequestToEncryptSchema, tr as CreateCommentEditOptionsWithRefinementSchema, tt as shortifyAddress, u as createAbortError, un as CommunityChallengeSettingSchema, ur as CommunityAuthorChallengeReservedFieldNames, vn as CreateRpcCommunityFunctionArgumentSchema, w as interruptibleSleep, wn as CreateVoteUserOptionsWithRefinementSchema, wr as t$11, wt as trackUpdatingCommunity, xn as PageSortFileSchema, xr as t$13, yn as ExportCommunityModLogsOptionsSchema, yr as n$10, z as linkAbortSignals, zn as CommentUpdateReservedFields, zr as messages, zt as DecryptedChallengeAnswerSchema } from "./util-B81IOt07.js";
3
3
  import { t as all } from "./src-CYIMjhjK.js";
4
- import { s as validatePageSortFile } from "./page-sort-scoring-DwYGP_0d.js";
4
+ import { s as validatePageSortFile } from "./page-sort-scoring-DbI7k_K5.js";
5
5
  import { createHash } from "node:crypto";
6
6
  import { pathToFileURL } from "node:url";
7
7
  import dns from "node:dns";
@@ -153765,10 +153765,16 @@ var esm_exports = /* @__PURE__ */ __exportAll({
153765
153765
  const { RateLimiter } = esm_exports;
153766
153766
  const rateLimiters = new import_quick_lru.default({ maxSize: 5e4 });
153767
153767
  const getPublicationType = (request) => isPost(request) ? "post" : isReply(request) ? "reply" : isVote(request) ? "vote" : isCommentEdit(request) ? "commentEdit" : isCommentModeration(request) ? "commentModeration" : isCommunityEdit(request) ? "communityEdit" : void 0;
153768
- const getRateLimiterName = (exclude, publication, publicationType, challengeSuccess) => `${publication.author.address}-${exclude.rateLimit}-${publicationType}-${challengeSuccess}`;
153769
- const getOrCreateRateLimiter = (exclude, publication, publicationType, challengeSuccess) => {
153768
+ const getRateLimiterName = (communityAddress, exclude, publication, publicationType, challengeSuccess) => JSON.stringify([
153769
+ communityAddress,
153770
+ publication.author.address,
153771
+ exclude.rateLimit,
153772
+ publicationType,
153773
+ challengeSuccess
153774
+ ]);
153775
+ const getOrCreateRateLimiter = (communityAddress, exclude, publication, publicationType, challengeSuccess) => {
153770
153776
  if (typeof exclude.rateLimit !== "number") throw Error("Can't create a RateLimiter without exclude.rateLimit");
153771
- const rateLimiterName = getRateLimiterName(exclude, publication, publicationType, challengeSuccess);
153777
+ const rateLimiterName = getRateLimiterName(communityAddress, exclude, publication, publicationType, challengeSuccess);
153772
153778
  let rateLimiter = rateLimiters.get(rateLimiterName);
153773
153779
  if (!rateLimiter) {
153774
153780
  rateLimiter = new RateLimiter({
@@ -153781,47 +153787,47 @@ const getOrCreateRateLimiter = (exclude, publication, publicationType, challenge
153781
153787
  }
153782
153788
  return rateLimiter;
153783
153789
  };
153784
- const addFilteredRateLimiter = (exclude, publication, publicationType, challengeSuccess, filteredRateLimiters) => {
153785
- filteredRateLimiters[getRateLimiterName(exclude, publication, publicationType, challengeSuccess)] = getOrCreateRateLimiter(exclude, publication, publicationType, challengeSuccess);
153790
+ const addFilteredRateLimiter = (communityAddress, exclude, publication, publicationType, challengeSuccess, filteredRateLimiters) => {
153791
+ filteredRateLimiters[getRateLimiterName(communityAddress, exclude, publication, publicationType, challengeSuccess)] = getOrCreateRateLimiter(communityAddress, exclude, publication, publicationType, challengeSuccess);
153786
153792
  };
153787
- const getRateLimitersToTest = (exclude, request, challengeSuccess) => {
153793
+ const getRateLimitersToTest = (exclude, request, challengeSuccess, communityAddress) => {
153788
153794
  const publication = derivePublicationFromChallengeRequest(request);
153789
153795
  const filteredRateLimiters = {};
153790
153796
  if (testPublicationType(exclude.publicationType, request)) {
153791
153797
  const publicationType = getPublicationType(request);
153792
- if (publicationType) addFilteredRateLimiter(exclude, publication, publicationType, challengeSuccess, filteredRateLimiters);
153798
+ if (publicationType) addFilteredRateLimiter(communityAddress, exclude, publication, publicationType, challengeSuccess, filteredRateLimiters);
153793
153799
  }
153794
153800
  return filteredRateLimiters;
153795
153801
  };
153796
- const testRateLimit = (exclude, request) => {
153802
+ const testRateLimit = (exclude, request, communityAddress) => {
153797
153803
  if (exclude?.rateLimit === void 0 || !testPublicationType(exclude.publicationType, request)) return true;
153798
153804
  let challengeSuccess = true;
153799
153805
  if (exclude.rateLimitChallengeSuccess === false) challengeSuccess = false;
153800
- const rateLimiters = getRateLimitersToTest(exclude, request, challengeSuccess);
153806
+ const rateLimiters = getRateLimitersToTest(exclude, request, challengeSuccess, communityAddress);
153801
153807
  for (const rateLimiter of Object.values(rateLimiters)) if (rateLimiter.getTokensRemaining() < 1) return false;
153802
153808
  return true;
153803
153809
  };
153804
- const getRateLimitersToAddTo = (excludeArray, request, challengeSuccess) => {
153810
+ const getRateLimitersToAddTo = (excludeArray, request, challengeSuccess, communityAddress) => {
153805
153811
  const filteredRateLimiters = {};
153806
153812
  const publication = derivePublicationFromChallengeRequest(request);
153807
153813
  for (const exclude of excludeArray) {
153808
153814
  if (exclude?.rateLimit === void 0) continue;
153809
153815
  const publicationType = getPublicationType(request);
153810
- if (publicationType) addFilteredRateLimiter(exclude, publication, publicationType, challengeSuccess, filteredRateLimiters);
153811
- if (request.commentEdit) addFilteredRateLimiter(exclude, publication, "commentEdit", challengeSuccess, filteredRateLimiters);
153812
- if (request.commentModeration) addFilteredRateLimiter(exclude, publication, "commentModeration", challengeSuccess, filteredRateLimiters);
153813
- if (request.communityEdit) addFilteredRateLimiter(exclude, publication, "communityEdit", challengeSuccess, filteredRateLimiters);
153816
+ if (publicationType) addFilteredRateLimiter(communityAddress, exclude, publication, publicationType, challengeSuccess, filteredRateLimiters);
153817
+ if (request.commentEdit) addFilteredRateLimiter(communityAddress, exclude, publication, "commentEdit", challengeSuccess, filteredRateLimiters);
153818
+ if (request.commentModeration) addFilteredRateLimiter(communityAddress, exclude, publication, "commentModeration", challengeSuccess, filteredRateLimiters);
153819
+ if (request.communityEdit) addFilteredRateLimiter(communityAddress, exclude, publication, "communityEdit", challengeSuccess, filteredRateLimiters);
153814
153820
  }
153815
153821
  return filteredRateLimiters;
153816
153822
  };
153817
- const addToRateLimiter = (communityChallenges, request, challengeSuccess) => {
153823
+ const addToRateLimiter = (communityChallenges, request, challengeSuccess, communityAddress) => {
153818
153824
  if (!communityChallenges) return;
153819
153825
  if (!Array.isArray(communityChallenges)) throw Error(`addToRateLimiter invalid argument communityChallenges '${communityChallenges}' not an array`);
153820
153826
  if (typeof challengeSuccess !== "boolean") throw Error(`addToRateLimiter invalid argument challengeSuccess '${challengeSuccess}' not a boolean`);
153821
153827
  const excludeArray = [];
153822
153828
  for (const communityChallenge of communityChallenges) for (const exclude of communityChallenge?.exclude || []) excludeArray.push(exclude);
153823
153829
  if (!excludeArray.length) return;
153824
- const rateLimiters = getRateLimitersToAddTo(excludeArray, request, challengeSuccess);
153830
+ const rateLimiters = getRateLimitersToAddTo(excludeArray, request, challengeSuccess, communityAddress);
153825
153831
  for (const rateLimiter of Object.values(rateLimiters)) rateLimiter.tryRemoveTokens(1);
153826
153832
  };
153827
153833
  //#endregion
@@ -153848,7 +153854,7 @@ const shouldExcludePublication = async ({ communityChallenge, request, community
153848
153854
  if (!testScore(exclude.replyScore, author.community?.replyScore)) shouldExclude = false;
153849
153855
  if (!testFirstCommentTimestamp(exclude.firstCommentTimestamp, author.community?.firstCommentTimestamp)) shouldExclude = false;
153850
153856
  if (!testPublicationType(exclude.publicationType, request)) shouldExclude = false;
153851
- if (!testRateLimit(exclude, request)) shouldExclude = false;
153857
+ if (!testRateLimit(exclude, request, community?.address)) shouldExclude = false;
153852
153858
  if (exclude.publicKeys && !exclude.publicKeys.includes(identityMatcher.signerAddress)) shouldExclude = false;
153853
153859
  if (typeof exclude.postCount === "number" || typeof exclude.replyCount === "number") {
153854
153860
  if (!authorPublicationCounts && community?._dbHandler) authorPublicationCounts = community._dbHandler.queryAuthorPublicationCounts(identityMatcher.signerAddress);
@@ -155172,7 +155178,7 @@ const getChallengeVerification = async ({ challengeRequestMessage, community, ge
155172
155178
  const failedChallengeIndexes = Object.keys(challengeVerification.challengeErrors ?? {});
155173
155179
  const decisiveNameFailure = failedChallengeIndexes.length > 0 && identityNameFailureByIndex ? failedChallengeIndexes.every((index) => identityNameFailureByIndex[Number(index)]) ? identityNameFailureByIndex[Number(failedChallengeIndexes[0])] : void 0 : void 0;
155174
155180
  if (challengeVerification.challengeSuccess === false && decisiveNameFailure) challengeVerification.aggregatedReason = decisiveNameFailure.reason;
155175
- addToRateLimiter(community.settings?.challenges, challengeRequestMessage, challengeVerification.challengeSuccess);
155181
+ addToRateLimiter(community.settings?.challenges, challengeRequestMessage, challengeVerification.challengeSuccess, community.address);
155176
155182
  const shouldSendToPendingApproval = Boolean(challengeRequestMessage.comment) && challengeVerification.challengeSuccess === true && pendingApprovalSuccess;
155177
155183
  const postAnswerMatcherField = postAnswerAuthorIdentityMatcher ? { postAnswerAuthorIdentityMatcher } : {};
155178
155184
  if (shouldSendToPendingApproval) return {
@@ -16556,7 +16556,7 @@ const CommunityEditPublicationPubsubReservedFields = r$2([
16556
16556
  ], t$3(CommunityEditPubsubMessagePublicationSchema.shape));
16557
16557
  //#endregion
16558
16558
  //#region dist/node/generated-version.js
16559
- const version = "0.0.147";
16559
+ const version = "0.0.148";
16560
16560
  //#endregion
16561
16561
  //#region dist/node/version.js
16562
16562
  const protocolVersion = ProtocolVersionSchema.parse("1.0.0");
@@ -1,4 +1,4 @@
1
- import { Rr as PKCError, V as pubsubTopicToDhtKeyCid } from "./util-DMr7Hj-w.js";
1
+ import { Rr as PKCError, V as pubsubTopicToDhtKeyCid } from "./util-B81IOt07.js";
2
2
  import { ipnsSelector } from "ipns/selector";
3
3
  import { ipnsValidator } from "ipns/validator";
4
4
  import { unmarshalIPNSRecord } from "ipns";
@@ -1,5 +1,5 @@
1
- import { Rr as PKCError, bn as PageSortFileFactorySchema, cn as ChallengeFileSchema, sn as ChallengeFileFactorySchema } from "./util-DMr7Hj-w.js";
2
- import { s as validatePageSortFile } from "./page-sort-scoring-DwYGP_0d.js";
1
+ import { Rr as PKCError, bn as PageSortFileFactorySchema, cn as ChallengeFileSchema, sn as ChallengeFileFactorySchema } from "./util-B81IOt07.js";
2
+ import { s as validatePageSortFile } from "./page-sort-scoring-DbI7k_K5.js";
3
3
  //#region dist/node/validate-package-factories.js
4
4
  function validateChallengeFileFactory(factory, { name }) {
5
5
  try {
@@ -1,2 +1,2 @@
1
- import { a as getShortCid, c as setNativeFunctions, i as getShortAddress, n as challenges, o as nativeFunctions, r as createAnchorIpnsRecord, s as pageSorts, t as PKC } from "./chunks/node-By3og2hw.js";
1
+ import { a as getShortCid, c as setNativeFunctions, i as getShortAddress, n as challenges, o as nativeFunctions, r as createAnchorIpnsRecord, s as pageSorts, t as PKC } from "./chunks/node-fEBX1Nar.js";
2
2
  export { challenges, createAnchorIpnsRecord, PKC as default, getShortAddress, getShortCid, nativeFunctions, pageSorts, setNativeFunctions };
@@ -1,2 +1,2 @@
1
- import { n as validatePageSortFileFactory } from "./chunks/validate-package-factories-TwRblx9f.js";
1
+ import { n as validatePageSortFileFactory } from "./chunks/validate-package-factories-Bi1OLIPw.js";
2
2
  export { validatePageSortFileFactory };
@@ -1,7 +1,7 @@
1
- import { At as pTimeout, Br as logger_default, C as hideClassPrivateProps, Rr as PKCError, X as replaceXWithY, et as retryKuboIpfsAddAndProvide, ft as findStartedCommunity, i as calculateStringSizeSameAsIpfsAddCidV0, xr as t, yr as n } from "../../chunks/util-DMr7Hj-w.js";
2
- import { S as parseRpcUnsubscribeParam, _ as parseRpcExportCommunityParam, b as parseRpcPublishChallengeAnswersParam, d as parseRpcCidParam, f as parseRpcCommentRepliesPageParam, g as parseRpcExportCommunityModLogsParam, h as parseRpcEditCommunityParam, l as parseRpcAuthorNameParam, m as parseRpcCommunityPageParam, p as parseRpcCommunityIdentifierParam, t as PKC, u as parseRpcCancelExportParam, v as parseRpcFetchCommunityListParam, x as parseRpcPublishCommunityListParam, y as parseRpcPublishAnchorRecordParam } from "../../chunks/node-By3og2hw.js";
3
- import { Br as t$1, Dt as parseJsonWithPKCErrorIfFails, E as buildPagesRuntimeFields, Er as listCommunitiesSync, Ir as toCommunitiesWireEntry, L as extractCrosspostRuntimeFields, Mt as parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, T as buildPageRuntimeFields, U as pRetry, Vn as verifyCommunityList, W as pLimit, Xn as MAX_COMMUNITY_LIST_SIZE_BYTES, at as parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, br as findLocalCommunityAddress, bt as parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails, dt as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, jt as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, mt as parseCommunityListSchemaWithPKCErrorIfItFails, nt as parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, qr as stringify, sn as require_lib, tt as parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, ut as parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, wt as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, yt as parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails } from "../../chunks/rpc-local-community-WnhiTbxm.js";
4
- import { t as LocalCommunity } from "../../chunks/local-community-5X7bvOoN.js";
1
+ import { At as pTimeout, Br as logger_default, C as hideClassPrivateProps, Rr as PKCError, X as replaceXWithY, et as retryKuboIpfsAddAndProvide, ft as findStartedCommunity, i as calculateStringSizeSameAsIpfsAddCidV0, xr as t, yr as n } from "../../chunks/util-B81IOt07.js";
2
+ import { S as parseRpcUnsubscribeParam, _ as parseRpcExportCommunityParam, b as parseRpcPublishChallengeAnswersParam, d as parseRpcCidParam, f as parseRpcCommentRepliesPageParam, g as parseRpcExportCommunityModLogsParam, h as parseRpcEditCommunityParam, l as parseRpcAuthorNameParam, m as parseRpcCommunityPageParam, p as parseRpcCommunityIdentifierParam, t as PKC, u as parseRpcCancelExportParam, v as parseRpcFetchCommunityListParam, x as parseRpcPublishCommunityListParam, y as parseRpcPublishAnchorRecordParam } from "../../chunks/node-fEBX1Nar.js";
3
+ import { Br as t$1, Dt as parseJsonWithPKCErrorIfFails, E as buildPagesRuntimeFields, Er as listCommunitiesSync, Ir as toCommunitiesWireEntry, L as extractCrosspostRuntimeFields, Mt as parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, T as buildPageRuntimeFields, U as pRetry, Vn as verifyCommunityList, W as pLimit, Xn as MAX_COMMUNITY_LIST_SIZE_BYTES, at as parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, br as findLocalCommunityAddress, bt as parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails, dt as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, jt as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, mt as parseCommunityListSchemaWithPKCErrorIfItFails, nt as parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, qr as stringify, sn as require_lib, tt as parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, ut as parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, wt as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, yt as parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails } from "../../chunks/rpc-local-community-ouDezuGZ.js";
4
+ import { t as LocalCommunity } from "../../chunks/local-community-dVaQtJNM.js";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import path from "path";
7
7
  import assert from "assert";
@@ -1 +1 @@
1
- export declare const version = "0.0.147";
1
+ export declare const version = "0.0.148";
@@ -1,3 +1,3 @@
1
1
  // Auto-generated by config/generate-version.js — do not edit
2
- export const version = "0.0.147";
2
+ export const version = "0.0.148";
3
3
  //# sourceMappingURL=generated-version.js.map
@@ -65,7 +65,7 @@ const shouldExcludePublication = async ({ communityChallenge, request, community
65
65
  if (!testPublicationType(exclude.publicationType, request)) {
66
66
  shouldExclude = false;
67
67
  }
68
- if (!testRateLimit(exclude, request)) {
68
+ if (!testRateLimit(exclude, request, community?.address)) {
69
69
  shouldExclude = false;
70
70
  }
71
71
  // Comparing against the signer-derived address is free, so it stays with the other cheap predicates.
@@ -1 +1 @@
1
- {"version":3,"file":"exclude.js","sourceRoot":"","sources":["../../../../../../../src/runtime/node/community/challenges/exclude/exclude.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAClB,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAMlD,OAAO,EAAE,qCAAqC,EAAE,MAAM,wBAAwB,CAAC;AAE/E,OAAO,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAE/E,iHAAiH;AACjH,yGAAyG;AACzG,MAAM,QAAQ,GAAG,KAAK,EAAE,EACpB,WAAW,EAC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,CAAC,CAAC;IAC3D,CAAC;IAED,8CAA8C;IAC9C,IAAI,CAAC;QACD,MAAM,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IAChB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,sEAAsE;IAC1E,CAAC;IAED,8CAA8C;IAC9C,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC;AAEF,OAAO,EAAE,iCAAiC,EAAE,wBAAwB,EAAE,6BAA6B,EAAE,CAAC"}
1
+ {"version":3,"file":"exclude.js","sourceRoot":"","sources":["../../../../../../../src/runtime/node/community/challenges/exclude/exclude.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAClB,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAMlD,OAAO,EAAE,qCAAqC,EAAE,MAAM,wBAAwB,CAAC;AAE/E,OAAO,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAE/E,iHAAiH;AACjH,yGAAyG;AACzG,MAAM,QAAQ,GAAG,KAAK,EAAE,EACpB,WAAW,EACX,eAAe,EACf,cAAc,EAKjB,EAAiC,EAAE;IAChC,IAAI,CAAC,cAAc;QAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,0EAA0E;IAC1H,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACrH,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAA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equestMessageTypeWithCommunityAuthor } from "../../../../../pubsub-messages/types.js";
2
2
  import type { ChallengeResult, Exclude, CommunitySettings } from "../../../../../community/types.js";
3
- declare const testRateLimit: (exclude: Exclude, request: DecryptedChallengeRequestMessageTypeWithCommunityAuthor) => boolean;
4
- declare const addToRateLimiter: (communityChallenges: NonNullable<CommunitySettings["challenges"]>, request: DecryptedChallengeRequestMessageTypeWithCommunityAuthor, challengeSuccess: ChallengeResult["success"]) => void;
3
+ declare const testRateLimit: (exclude: Exclude, request: DecryptedChallengeRequestMessageTypeWithCommunityAuthor, communityAddress: string) => boolean;
4
+ declare const addToRateLimiter: (communityChallenges: NonNullable<CommunitySettings["challenges"]>, request: DecryptedChallengeRequestMessageTypeWithCommunityAuthor, challengeSuccess: ChallengeResult["success"], communityAddress: string) => void;
5
5
  export { addToRateLimiter, testRateLimit };