@pkcprotocol/pkc-js 0.0.158 → 0.0.159
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.
- package/README.md +3 -0
- package/dist/browser/clients/base-client-manager.js +24 -11
- package/dist/browser/clients/base-client-manager.js.map +1 -1
- package/dist/browser/clients/rpc-client/pkc-rpc-client.js +17 -9
- package/dist/browser/clients/rpc-client/pkc-rpc-client.js.map +1 -1
- package/dist/browser/clients/rpc-client/schema.d.ts +1 -0
- package/dist/browser/community/schema.d.ts +13 -0
- package/dist/browser/detached-guard.d.ts +5 -0
- package/dist/browser/detached-guard.js +50 -0
- package/dist/browser/detached-guard.js.map +1 -0
- package/dist/browser/errors.d.ts +2 -0
- package/dist/browser/errors.js +2 -0
- package/dist/browser/errors.js.map +1 -1
- package/dist/browser/generated-version.d.ts +1 -1
- package/dist/browser/generated-version.js +1 -1
- package/dist/browser/helia/helia-for-pkc.js +6 -5
- package/dist/browser/helia/helia-for-pkc.js.map +1 -1
- package/dist/browser/index-with-compile-cache.d.ts +2 -0
- package/dist/browser/index.d.ts +4 -0
- package/dist/browser/pages/schema.d.ts +3 -0
- package/dist/browser/pkc-error.d.ts +1 -1
- package/dist/browser/publications/comment/comment.d.ts +1 -0
- package/dist/browser/publications/comment/comment.js +1 -0
- package/dist/browser/publications/comment/comment.js.map +1 -1
- package/dist/browser/publications/comment/schema.d.ts +4 -2
- package/dist/browser/publications/comment/schema.js +11 -1
- package/dist/browser/publications/comment/schema.js.map +1 -1
- package/dist/browser/publications/publication.js +26 -32
- package/dist/browser/publications/publication.js.map +1 -1
- package/dist/browser/rpc/src/lib/pkc-js/index.d.ts +2 -0
- package/dist/browser/rpc/src/schema.d.ts +12 -0
- package/dist/browser/runtime/node/community/db-handler.js +5 -4
- package/dist/browser/runtime/node/community/db-handler.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community/comment-updates.js +36 -0
- package/dist/browser/runtime/node/community/local-community/comment-updates.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community/db-fault.d.ts +3 -0
- package/dist/browser/runtime/node/community/local-community/db-fault.js +13 -0
- package/dist/browser/runtime/node/community/local-community/db-fault.js.map +1 -0
- package/dist/browser/runtime/node/community/local-community/lifecycle.js +36 -2
- package/dist/browser/runtime/node/community/local-community/lifecycle.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community.d.ts +4 -0
- package/dist/browser/runtime/node/community/local-community.js +7 -0
- package/dist/browser/runtime/node/community/local-community.js.map +1 -1
- package/dist/browser/runtime/node/test/helpers/hanging-runner.js +7 -3
- package/dist/browser/runtime/node/test/helpers/hanging-runner.js.map +1 -1
- package/dist/browser/runtime/node/test/helpers/run-hanging-node.js +6 -1
- package/dist/browser/runtime/node/test/helpers/run-hanging-node.js.map +1 -1
- package/dist/browser/schema/schema-util.d.ts +5 -0
- package/dist/browser/schema.d.ts +16 -0
- package/dist/browser/signer/pseudonymity-author-tag.d.ts +8 -0
- package/dist/browser/signer/pseudonymity-author-tag.js +39 -0
- package/dist/browser/signer/pseudonymity-author-tag.js.map +1 -0
- package/dist/browser/signer/signatures.js +16 -0
- package/dist/browser/signer/signatures.js.map +1 -1
- package/dist/browser/test/test-util.d.ts +5 -0
- package/dist/browser/version.js +1 -1
- package/dist/bundled/bundle-manifest.json +45 -40
- package/dist/bundled/challenges.js +1 -1
- package/dist/bundled/chunks/{helia-for-pkc-D3uvabO4.js → helia-for-pkc-CP5A7i4M.js} +5 -4
- package/dist/bundled/chunks/{local-community-SgssDrxj.js → local-community-0xsjgulY.js} +180 -9
- package/dist/bundled/chunks/{local-community-ChB5dbEH.js → local-community-CUDfHfH_.js} +1 -1
- package/dist/bundled/chunks/{node-Bx3xTqFv.js → node-Bv7hIiW_.js} +39 -38
- package/dist/bundled/chunks/{page-sort-scoring-CZmdHvps.js → page-sort-scoring-I02fuGkI.js} +1 -1
- package/dist/bundled/chunks/{rpc-local-community-D66Be62U.js → rpc-local-community-Bo4Z7ilA.js} +57 -13
- package/dist/bundled/chunks/{util-BuTE1Bd1.js → util-BZuCmqxu.js} +7 -3
- package/dist/bundled/chunks/{util-CodXreIl.js → util-xhgmI11L.js} +1 -1
- package/dist/bundled/chunks/{validate-package-factories-Bc4uoozL.js → validate-package-factories-BsSEIr__.js} +2 -2
- package/dist/bundled/index.js +1 -1
- package/dist/bundled/page-sorts.js +1 -1
- package/dist/bundled/rpc/src/index.js +4 -4
- package/dist/node/clients/base-client-manager.js +24 -11
- package/dist/node/clients/base-client-manager.js.map +1 -1
- package/dist/node/clients/rpc-client/pkc-rpc-client.js +17 -9
- package/dist/node/clients/rpc-client/pkc-rpc-client.js.map +1 -1
- package/dist/node/clients/rpc-client/schema.d.ts +1 -0
- package/dist/node/community/schema.d.ts +13 -0
- package/dist/node/detached-guard.d.ts +5 -0
- package/dist/node/detached-guard.js +50 -0
- package/dist/node/detached-guard.js.map +1 -0
- package/dist/node/errors.d.ts +2 -0
- package/dist/node/errors.js +2 -0
- package/dist/node/errors.js.map +1 -1
- package/dist/node/generated-version.d.ts +1 -1
- package/dist/node/generated-version.js +1 -1
- package/dist/node/helia/helia-for-pkc.js +6 -5
- package/dist/node/helia/helia-for-pkc.js.map +1 -1
- package/dist/node/index-with-compile-cache.d.ts +2 -0
- package/dist/node/index.d.ts +4 -0
- package/dist/node/pages/schema.d.ts +3 -0
- package/dist/node/pkc-error.d.ts +1 -1
- package/dist/node/publications/comment/comment.d.ts +1 -0
- package/dist/node/publications/comment/comment.js +1 -0
- package/dist/node/publications/comment/comment.js.map +1 -1
- package/dist/node/publications/comment/schema.d.ts +4 -2
- package/dist/node/publications/comment/schema.js +11 -1
- package/dist/node/publications/comment/schema.js.map +1 -1
- package/dist/node/publications/publication.js +26 -32
- package/dist/node/publications/publication.js.map +1 -1
- package/dist/node/rpc/src/lib/pkc-js/index.d.ts +2 -0
- package/dist/node/rpc/src/schema.d.ts +12 -0
- package/dist/node/runtime/node/community/db-handler.js +5 -4
- package/dist/node/runtime/node/community/db-handler.js.map +1 -1
- package/dist/node/runtime/node/community/local-community/comment-updates.js +36 -0
- package/dist/node/runtime/node/community/local-community/comment-updates.js.map +1 -1
- package/dist/node/runtime/node/community/local-community/db-fault.d.ts +3 -0
- package/dist/node/runtime/node/community/local-community/db-fault.js +13 -0
- package/dist/node/runtime/node/community/local-community/db-fault.js.map +1 -0
- package/dist/node/runtime/node/community/local-community/lifecycle.js +36 -2
- package/dist/node/runtime/node/community/local-community/lifecycle.js.map +1 -1
- package/dist/node/runtime/node/community/local-community.d.ts +4 -0
- package/dist/node/runtime/node/community/local-community.js +7 -0
- package/dist/node/runtime/node/community/local-community.js.map +1 -1
- package/dist/node/runtime/node/test/helpers/hanging-runner.js +7 -3
- package/dist/node/runtime/node/test/helpers/hanging-runner.js.map +1 -1
- package/dist/node/runtime/node/test/helpers/run-hanging-node.js +6 -1
- package/dist/node/runtime/node/test/helpers/run-hanging-node.js.map +1 -1
- package/dist/node/schema/schema-util.d.ts +5 -0
- package/dist/node/schema.d.ts +16 -0
- package/dist/node/signer/pseudonymity-author-tag.d.ts +8 -0
- package/dist/node/signer/pseudonymity-author-tag.js +39 -0
- package/dist/node/signer/pseudonymity-author-tag.js.map +1 -0
- package/dist/node/signer/signatures.js +16 -0
- package/dist/node/signer/signatures.js.map +1 -1
- package/dist/node/test/test-util.d.ts +5 -0
- package/dist/node/version.js +1 -1
- package/package.json +3 -2
|
@@ -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 ChallengeAnswerMessageSchema, Br as messages, C as hideClassPrivateProps, Cr as e, D as isIpfsCid, Dt as require_sha256, E as isAbortError, Er as r, Et as untrackUpdatingCommunity, Fr as FailedToFetchCommentUpdateFromGatewaysError, In as CommentUpdateForChallengeVerificationSchema, It as ChallengeVerificationMessageSchema, Jt as version_default, Mt as ChallengeMessageSchema, Nr as require_retry$1, Ot as TimeoutError, Pr as FailedToFetchCommentIpfsFromGatewaysError, Pt as ChallengeRequestMessageSchema, Rr as FailedToFetchPageIpfsFromGatewaysError, Sr as t$1, St as trackUpdatingComment, T as ipnsNameToIpnsOverPubsubTopic, Tt as untrackUpdatingComment, U as rejectWhenAbortSignalFires, Vr as logger_default, W as rejectWhenCommunityStopsOrAborts, Wr as setErrorMap, X as replaceXWithY, Y as removeUndefinedValuesRecursively, Z as resolveWhenPredicateIsTrue, _t as listUpdatingCommunities, a as calculateStringSizeSameAsIpfsAddCidV0Sync, at as throwIfAbortSignalAborted, br as n$1, cn as CommunityAnchorSchema, d as deepMergeRuntimeFields, dt as findStartedCommunity, et as retryKuboIpfsAddAndProvide, ft as findUpdatingComment, gr as isStringDomain, gt as listUpdatingComments, ht as listStartedCommunities, i as calculateStringSizeSameAsIpfsAddCidV0, ii as en_default, jn as CommentIpfsSchema, k as isIpns, kt as pTimeout, nt as shortifyCid, ot as timestamp, p as doesDomainAddressHaveCapitalLetter, pn as CommunityIpfsSchema, pt as findUpdatingCommunity, r as calculateIpfsCidV0, rt as sleepUntilTimeoutOrAbort, st as waitForUpdateInCommunityInstanceWithErrorAndTimeout, tt as shortifyAddress, u as createAbortError, vr as n$2, vt as refreshTrackedCommentAliases, wr as e$1, x as getPostUpdateTimestampRange, xn as PubsubTopicSchema, z as linkAbortSignals, zn as CommentUpdateSchema, zr as PKCError } from "./util-
|
|
3
|
-
import { $n as
|
|
4
|
-
import { s as getHeliaDebugContext } from "./util-
|
|
2
|
+
import { $ as retryKuboIpfsAdd, At as ChallengeAnswerMessageSchema, Br as messages, C as hideClassPrivateProps, Cr as e, D as isIpfsCid, Dt as require_sha256, E as isAbortError, Er as r, Et as untrackUpdatingCommunity, Fr as FailedToFetchCommentUpdateFromGatewaysError, In as CommentUpdateForChallengeVerificationSchema, It as ChallengeVerificationMessageSchema, Jt as version_default, Mt as ChallengeMessageSchema, Nr as require_retry$1, Ot as TimeoutError, Pr as FailedToFetchCommentIpfsFromGatewaysError, Pt as ChallengeRequestMessageSchema, Rr as FailedToFetchPageIpfsFromGatewaysError, Sr as t$1, St as trackUpdatingComment, T as ipnsNameToIpnsOverPubsubTopic, Tt as untrackUpdatingComment, U as rejectWhenAbortSignalFires, Vr as logger_default, W as rejectWhenCommunityStopsOrAborts, Wr as setErrorMap, X as replaceXWithY, Y as removeUndefinedValuesRecursively, Z as resolveWhenPredicateIsTrue, _t as listUpdatingCommunities, a as calculateStringSizeSameAsIpfsAddCidV0Sync, at as throwIfAbortSignalAborted, br as n$1, cn as CommunityAnchorSchema, d as deepMergeRuntimeFields, dt as findStartedCommunity, et as retryKuboIpfsAddAndProvide, ft as findUpdatingComment, gr as isStringDomain, gt as listUpdatingComments, ht as listStartedCommunities, i as calculateStringSizeSameAsIpfsAddCidV0, ii as en_default, jn as CommentIpfsSchema, k as isIpns, kt as pTimeout, nt as shortifyCid, ot as timestamp, p as doesDomainAddressHaveCapitalLetter, pn as CommunityIpfsSchema, pt as findUpdatingCommunity, r as calculateIpfsCidV0, rt as sleepUntilTimeoutOrAbort, st as waitForUpdateInCommunityInstanceWithErrorAndTimeout, tt as shortifyAddress, u as createAbortError, vr as n$2, vt as refreshTrackedCommentAliases, wr as e$1, x as getPostUpdateTimestampRange, xn as PubsubTopicSchema, z as linkAbortSignals, zn as CommentUpdateSchema, zr as PKCError } from "./util-BZuCmqxu.js";
|
|
3
|
+
import { $n as cleanWireAuthor, $t as RpcPublishAnchorRecordParamSchema, A as findCommentInParsedPages, At as parsePKCUserOptionsSchemaWithPKCErrorIfItFails, B as GenericStateClient, Bn as verifyCommentIpfs, Br as getDefaultDataPath, Bt as RpcCommentRepliesPageParamSchema, C as RepliesPages, Ct as parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, D as extractCommunityRuntimeFieldsFromParsedPages, Dn as signCommentEdit, Dt as parseDecryptedChallengeVerification, En as signComment, Et as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, F as cloneCrosspostForRuntime, Ft as parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails, Gn as verifyCommunityEdit, Gr as monitorCommunitiesDirectory, Gt as RpcExportCommunityModLogsParamSchema, Hn as verifyCommentPubsubMessage, Ht as RpcCommunityIdentifierParamSchema, I as collectCrosspostAuthorsToResolve, In as verifyChallengeMessage, It as RpcAnchorPublishPreparationResultSchema, J as decodeRpcChallengeAnswerPubsubMsg, Jn as assignUnknownProps, Jt as RpcExportCommunityResultSchema, Kn as verifyCommunityList, Kt as RpcExportCommunityModLogsResultSchema, Lr as findLocalCommunityAddress, Lt as RpcAuthorNameParamSchema, M as parseRawPages, Mn as signCommunityEdit, Mr as createKuboRpcClient, Mt as parseRpcCommentUpdateEventWithPKCErrorIfItFails, Nn as signCommunityList, Nt as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, O as findCommentInPageInstance, On as signCommentModeration, Ot as parseDecryptedChallengeWithPKCErrorIfItFails, P as applyNameResolvedCacheToCrosspost, Pn as signVote, Qn as buildRuntimeAuthor, Qt as RpcFetchCommunityListResultSchema, R as stripNameResolvedFromCrosspost, Rn as verifyChallengeVerification, Rt as RpcCancelExportParamSchema, Sn as signChallengeAnswer, Tt as parseCreateVoteOptionsSchemaWithPKCErrorIfItFails, U as InflightFetchManager, Un as verifyCommentUpdate, Ur as isLocalCommunityAddress, Ut as RpcCommunityPageParamSchema, Vn as verifyCommentModeration, Vt as RpcCommunitiesChangeEventResultSchema, W as InflightResourceTypes, Wr as markLocalCommunityDbAsBeingWritten, Wt as RpcEditCommunityParamSchema, X as decodeRpcChallengeRequestPubsubMsg, Xn as mergeAuthorProps, Xr as setNativeFunctions$1, Xt as RpcFetchCidResultSchema, Y as decodeRpcChallengePubsubMsg, Yt as RpcFetchCidParamSchema, Z as decodeRpcChallengeVerificationPubsubMsg, Zn as withoutForbiddenKeys, Zr as tryToDeleteCommunitiesThatFailedToBeDeletedBefore, Zt as RpcFetchCommunityListParamSchema, _t as parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails, an as RpcSubscriptionIdResultSchema, ar as CreateNewCommunityListOptionsSchema, at as parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, b as KeyvBetterSqlite3, bt as parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails, ci as n$3, cn as findCommunityRecordNameMismatch, ct as parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails, di as t$4, dn as require_lib$1, dr as getCommunityNameFromWire, dt as parseCommunityAddressWithPKCErrorIfItFails, en as RpcPublishChallengeAnswersParamSchema, er as getAuthorNameFromRuntime, fi as MAX_FILE_SIZE_BYTES_FOR_COMMENT_UPDATE, fn as guardDetached, fr as getCommunityPublicKeyFromWire, gn as decryptEd25519AesGcm, gr as getBufferedPKCAddressFromPublicKey, gt as parseCommunityListSchemaWithPKCErrorIfItFails, hi as NAME_RESOLVE_FAILED_RETRY_FLOOR_MS, hn as createAnchorIpnsRecord$1, ii as t$5, in as RpcResolveAuthorNameResultSchema, ir as CreateCommunityListWithCidOptionsSchema, jt as parseRpcCommentEventWithPKCErrorIfItFails, k as findCommentInPageInstanceRecursively, kt as parseJsonWithPKCErrorIfFails, l as pkcJsPageSorts, ln as verifyAuthorWalletEntry, lr as buildRuntimeCommunityFields, lt as parseCommentPubsubMessagePublicationWithPKCErrorIfItFails, m as pkcJsChallenges, mi as NAME_RESOLVED_TRUE_TTL_MS, mn as createSigner, mr as decode, mt as parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, n as RpcRemoteCommunity, ni as toCommunitiesEntry, nn as RpcPublishCommunityListResultSchema, nr as normalizeCreatePublicationAuthor, nt as parseCidStringSchemaWithPKCErrorIfItFails, on as RpcSuccessResultSchema, or as MAX_COMMUNITY_LIST_SIZE_BYTES, ot as parseCommentIpfsSchemaWithPKCErrorIfItFails, pi as NAME_RESOLVED_FALSE_TTL_MS, pr as normalizeCommunityInputFromCommunity, q as PKCTypedEmitter, qn as verifyVote, qr as registerLocalCommunity, qt as RpcExportCommunityParamSchema, rn as RpcPublishedAnchorRecordResultSchema, si as t$3, sn as RpcUnsubscribeParamSchema, t as RpcLocalCommunity, ti as findCommunitiesEntry, tn as RpcPublishCommunityListParamSchema, tr as getAuthorNameFromWire, ui as t$2, ur as getCommunityAddressFromRecord, ut as parseCommentUpdateSchemaWithPKCErrorIfItFails, v as TrackedInstanceRegistry, vi as nativeFunctions$2, vn as encryptEd25519AesGcm, vt as parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails, wn as signChallengeRequest, wt as parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, x as RemoteCommunity, xn as cleanUpBeforePublishing, y as LRUCache, yr as getPKCAddressFromPublicKeySync, yt as parseCreateCommentOptionsSchemaWithPKCErrorIfItFails, z as PKCClientsManager, zn as verifyCommentEdit, zt as RpcCidParamSchema } from "./rpc-local-community-Bo4Z7ilA.js";
|
|
4
|
+
import { s as getHeliaDebugContext } from "./util-xhgmI11L.js";
|
|
5
5
|
import path from "path";
|
|
6
6
|
import assert from "assert";
|
|
7
7
|
import fs from "fs";
|
|
@@ -28099,13 +28099,11 @@ var Publication = class extends import_lib.TypedEmitter {
|
|
|
28099
28099
|
else this._pkc._publishingPublications.delete(this);
|
|
28100
28100
|
}
|
|
28101
28101
|
_guardDetachedHandler(entryPoint, handler) {
|
|
28102
|
-
return
|
|
28103
|
-
|
|
28104
|
-
|
|
28105
|
-
|
|
28106
|
-
|
|
28107
|
-
}
|
|
28108
|
-
};
|
|
28102
|
+
return guardDetached({
|
|
28103
|
+
entryPoint: `Publication ${entryPoint}`,
|
|
28104
|
+
handler,
|
|
28105
|
+
onFailure: (cause) => this._endPublicationAfterDetachedFailure(entryPoint, cause)
|
|
28106
|
+
});
|
|
28109
28107
|
}
|
|
28110
28108
|
async _endPublicationAfterDetachedFailure(entryPoint, cause) {
|
|
28111
28109
|
const log = logger_default("pkc-js:publication:_endPublicationAfterDetachedFailure");
|
|
@@ -28115,25 +28113,20 @@ var Publication = class extends import_lib.TypedEmitter {
|
|
|
28115
28113
|
cause
|
|
28116
28114
|
});
|
|
28117
28115
|
const endedBefore = this._publishEndedBy;
|
|
28118
|
-
|
|
28119
|
-
|
|
28120
|
-
|
|
28121
|
-
|
|
28122
|
-
|
|
28123
|
-
|
|
28124
|
-
|
|
28116
|
+
if (this._claimPublishEnd("failure")) {
|
|
28117
|
+
try {
|
|
28118
|
+
await this._postSucessOrFailurePublishing();
|
|
28119
|
+
} catch (teardownError) {
|
|
28120
|
+
log.error(`Teardown after the failure of ${entryPoint} threw as well`, teardownError);
|
|
28121
|
+
}
|
|
28122
|
+
this._changePublicationStateEmitEventEmitStateChangeEvent({
|
|
28123
|
+
newPublishingState: "failed",
|
|
28124
|
+
event: {
|
|
28125
|
+
name: "error",
|
|
28126
|
+
args: [error]
|
|
28125
28127
|
}
|
|
28126
|
-
|
|
28127
|
-
|
|
28128
|
-
event: {
|
|
28129
|
-
name: "error",
|
|
28130
|
-
args: [error]
|
|
28131
|
-
}
|
|
28132
|
-
});
|
|
28133
|
-
} else if (endedBefore !== "stop") this.emit("error", error);
|
|
28134
|
-
} catch (emitError) {
|
|
28135
|
-
log.error(`Could not report the failure of ${entryPoint}`, emitError);
|
|
28136
|
-
}
|
|
28128
|
+
});
|
|
28129
|
+
} else if (endedBefore !== "stop") this.emit("error", error);
|
|
28137
28130
|
}
|
|
28138
28131
|
async _tearDownWithoutThrowing() {
|
|
28139
28132
|
try {
|
|
@@ -30078,6 +30071,7 @@ var Comment = class extends Publication {
|
|
|
30078
30071
|
this.author.flairs = props.author?.community?.flairs || props.edit?.author?.flairs || this.author?.flairs;
|
|
30079
30072
|
this.lastChildCid = props.lastChildCid;
|
|
30080
30073
|
this.lastReplyTimestamp = props.lastReplyTimestamp;
|
|
30074
|
+
this.pseudonymityAuthorTag = "pseudonymityAuthorTag" in props ? props.pseudonymityAuthorTag : void 0;
|
|
30081
30075
|
this._updateRepliesPostsInstance(props.replies, community);
|
|
30082
30076
|
if (typeof this.pendingApproval === "boolean" || "pendingApproval" in props) this.pendingApproval = Boolean("pendingApproval" in props && props.pendingApproval);
|
|
30083
30077
|
else if ("approved" in props && typeof props.approved === "boolean") this.pendingApproval = false;
|
|
@@ -31274,14 +31268,21 @@ var PKCRpcClient = class extends import_lib.TypedEmitter {
|
|
|
31274
31268
|
const socket = this._webSocketClient.socket;
|
|
31275
31269
|
if (!socket || this._socketsWithNotificationHandler.has(socket)) return;
|
|
31276
31270
|
this._socketsWithNotificationHandler.add(socket);
|
|
31277
|
-
socket.on("message", (
|
|
31278
|
-
|
|
31279
|
-
|
|
31280
|
-
|
|
31281
|
-
|
|
31282
|
-
|
|
31283
|
-
|
|
31284
|
-
|
|
31271
|
+
socket.on("message", guardDetached({
|
|
31272
|
+
entryPoint: "PKCRpcClient socket message",
|
|
31273
|
+
handler: (jsonMessage) => {
|
|
31274
|
+
const message = JSON.parse(jsonMessage);
|
|
31275
|
+
if (!isRpcSubscriptionNotification(message)) return;
|
|
31276
|
+
const serverSubscriptionId = message.params.subscription;
|
|
31277
|
+
const subscriptionId = this._localIdByServerId.get(serverSubscriptionId) ?? serverSubscriptionId;
|
|
31278
|
+
message.params.subscription = subscriptionId;
|
|
31279
|
+
this._dispatchNotification(subscriptionId, message);
|
|
31280
|
+
},
|
|
31281
|
+
onFailure: (cause) => this.emit("error", new PKCError("ERR_RPC_CLIENT_FAILED_TO_HANDLE_SERVER_MESSAGE", {
|
|
31282
|
+
rpcUrl: this._websocketServerUrl,
|
|
31283
|
+
cause
|
|
31284
|
+
}))
|
|
31285
|
+
}));
|
|
31285
31286
|
}
|
|
31286
31287
|
_dispatchNotification(subscriptionId, message) {
|
|
31287
31288
|
this._initSubscriptionEvent(subscriptionId);
|
|
@@ -36384,7 +36385,7 @@ var PKC$1 = class extends PKCTypedEmitter {
|
|
|
36384
36385
|
this.clients.libp2pJsClients = {};
|
|
36385
36386
|
if (!this.libp2pJsClientsOptions) return;
|
|
36386
36387
|
if (!this.httpRoutersOptions) throw Error("httpRoutersOptions is required for libp2pJsClient");
|
|
36387
|
-
const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-
|
|
36388
|
+
const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-CP5A7i4M.js");
|
|
36388
36389
|
for (const clientOptions of this.libp2pJsClientsOptions) {
|
|
36389
36390
|
const heliaNode = await createLibp2pJsClientOrUseExistingOne({
|
|
36390
36391
|
...clientOptions,
|
|
@@ -36761,7 +36762,7 @@ var PKC$1 = class extends PKCTypedEmitter {
|
|
|
36761
36762
|
const log = logger_default("pkc-js:pkc:createLocalCommunity");
|
|
36762
36763
|
log.trace("Received community options to create a local community instance:", options);
|
|
36763
36764
|
if (!this._canCreateNewLocalCommunity()) throw new PKCError("ERR_CAN_NOT_CREATE_A_LOCAL_COMMUNITY", { pkcOptions: this._userPKCOptions });
|
|
36764
|
-
const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-
|
|
36765
|
+
const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-CUDfHfH_.js");
|
|
36765
36766
|
const isLocalCommunity = isLocalCommunityAddress(this, options.address);
|
|
36766
36767
|
const community = new LocalCommunity(this);
|
|
36767
36768
|
if (isLocalCommunity) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bn as PageSortFileSchema, gr as isStringDomain, v as getEquivalentCommunityAddresses } from "./util-
|
|
1
|
+
import { bn as PageSortFileSchema, gr as isStringDomain, v as getEquivalentCommunityAddresses } from "./util-BZuCmqxu.js";
|
|
2
2
|
//#region dist/node/pages/page-sort-scoring.js
|
|
3
3
|
function validatePageSortFile(rawFile) {
|
|
4
4
|
const validated = PageSortFileSchema.parse(rawFile);
|
package/dist/bundled/chunks/{rpc-local-community-D66Be62U.js → rpc-local-community-Bo4Z7ilA.js}
RENAMED
|
@@ -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 { $r as preprocess, $t as CreateCommunityEditPublicationOptionsWithRefinementSchema, A as isIpnsPath, An as CommentIpfsReservedFields, Ar as t$10, B as pubsubTopicToDhtKey, Bn as CommentUpdateSignedPropertyNames, Br as messages, C as hideClassPrivateProps, Cn as CreateVoteUserOptionsWithRefinementSchema, Cr as e$6, Ct as trackUpdatingCommunity, D as isIpfsCid, Dn as VoteSignedPropertyNames, Dr as t$12, Dt as require_sha256$1, E as isAbortError, Er as r$8, Et as untrackUpdatingCommunity, Fn as CommentUpdateChallengeReservedFieldNames, Fr as FailedToFetchCommentUpdateFromGatewaysError, Ft as ChallengeRequestMessageSignedPropertyNames, Gn as ModQueuePageIpfsSchema, Gr as _enum, Gt as PKCParsedOptionsSchema, H as raceAgainstAbort, Hr as require_supports_color, Ht as DecryptedChallengeVerificationSchema, Ir as FailedToFetchCommunityFromGatewaysError, Jn as CommentEditChallengeRequestToEncryptSchema, Jr as custom, Kn as PageIpfsSchema, Kr as array, Kt as PKCUserOptionBaseSchema, L as isRequestPubsubPublicationOfPost, Ln as CommentUpdateForChallengeVerificationSignedPropertyNames, Lr as FailedToFetchGenericIpfsFromGatewaysError, Lt as ChallengeVerificationMessageSignedPropertyNames, Mr as e$4, Nn as CommentPubsubMessageWithFlexibleAuthorRefinementSchema, Nr as require_retry$2, Nt as ChallengeMessageSignedPropertyNames, O as isIpfsPath, Or as n$8, Pn as CommentSignedPropertyNames, Pr as FailedToFetchCommentIpfsFromGatewaysError, Qn as CommentEditSignedPropertyNames, Qr as object, Qt as CommunityEditPubsubMessagePublicationSchema, R as isRequestPubsubPublicationOfReply, Rn as CommentUpdateReservedFields, Rr as FailedToFetchPageIpfsFromGatewaysError, Rt as DecryptedChallengeAnswerSchema, S as hasTransientNetworkErrorCode, Sn as RpcRemoteCommunityUpdateEventResultSchema, Sr as t$13, T as ipnsNameToIpnsOverPubsubTopic, Tn as VotePubsubMessagePublicationSchema, Tr as t$11, Un as CreateCommentOptionsWithRefinementSchema, Ur as require_ms$1, Ut as NameResolveCacheOptionsSchema, Vr as logger_default, Vt as DecryptedChallengeSchema, Wn as GetPageParamSchema, Wt as NameResolverSerializedSchema, Xn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, Xr as looseObject, Yr as literal, Yt as CommunityEditPublicationChallengeRequestToEncryptSchema, Zr as number, Zt as CommunityEditPublicationSignedPropertyNames, _n as CreateRpcCommunityFunctionArgumentSchema, _r as normalizeEthAliasDomain, an as CreateCommentModerationOptionsWithRefinementSchema, ar as ChallengeAnswersByIndexSchema, at as throwIfAbortSignalAborted, bn as PageSortFileSchema, br as n$10, cr as CommunityAddressSchema, d as deepMergeRuntimeFields, dn as CommunityExportRecordsSchema, dr as JsonSignatureSchema, dt as findStartedCommunity, ei as record, en as CommentModerationChallengeRequestToEncryptSchema, er as CreateCommentEditOptionsWithRefinementSchema, f as derivePublicationFromChallengeRequest, fn as CommunityIpfsReservedFields, fr as PKCTimestampSchema, gn as CreateRemoteCommunityFunctionArgumentSchema, gr as isStringDomain, h as fetchAndValidateIpnsRecordFromGateway, hn as CreateNewLocalCommunityUserOptionsSchema, hr as isEthAliasDomain, in as CommentModerationsTableRowSchema, ir as AuthorReservedFields, jn as CommentIpfsSchema, jr as t$9, jt as ChallengeAnswerMessageSignedPropertyNames, k as isIpns, kn as CommentChallengeRequestToEncryptSchema, kr as r$7, kt as pTimeout, ln as CommunityChallengeSettingSchema, lr as CommunityAuthorChallengeReservedFieldNames, m as extractNetworkErrorDetails, mn as CommunitySignedPropertyNames, mr as areEquivalentNames, mt as forgetTrackedUpdatingCommunityName, ni as union, nr as AuthorCommentIpfsReservedFields, nt as shortifyCid, on as ChallengeFileFactorySchema, or as CidPathSchema, ot as timestamp, p as doesDomainAddressHaveCapitalLetter, pn as CommunityIpfsSchema, pr as ProtocolVersionSchema, pt as findUpdatingCommunity, q as removeNullUndefinedEmptyObjectsValuesRecursively, qn as isReservedObjectKey, qr as boolean, qt as PKCUserOptionsSchema, r as calculateIpfsCidV0, rn as CommentModerationSignedPropertyNames, rr as AuthorPubsubSchema, rt as sleepUntilTimeoutOrAbort, sn as ChallengeFileSchema, sr as CidStringSchema, t as areEquivalentCommunityAddresses, ti as string, tn as CommentModerationPubsubMessagePublicationSchema, tr as AuthorAddressSchema, tt as shortifyAddress, u as createAbortError, un as CommunityEditOptionsSchema, ur as CreateSignerSchema, vn as ExportCommunityModLogsOptionsSchema, vr as n$9, w as interruptibleSleep, wn as VoteChallengeRequestToEncryptSchema, wr as e$5, wt as untrackStartedCommunity, xt as trackStartedCommunity, yn as PageSortFileFactorySchema, yt as refreshTrackedCommunityAliases, z as linkAbortSignals, zn as CommentUpdateSchema, zr as PKCError } from "./util-
|
|
2
|
+
import { $r as preprocess, $t as CreateCommunityEditPublicationOptionsWithRefinementSchema, A as isIpnsPath, An as CommentIpfsReservedFields, Ar as t$10, B as pubsubTopicToDhtKey, Bn as CommentUpdateSignedPropertyNames, Br as messages, C as hideClassPrivateProps, Cn as CreateVoteUserOptionsWithRefinementSchema, Cr as e$6, Ct as trackUpdatingCommunity, D as isIpfsCid, Dn as VoteSignedPropertyNames, Dr as t$12, Dt as require_sha256$1, E as isAbortError, Er as r$8, Et as untrackUpdatingCommunity, Fn as CommentUpdateChallengeReservedFieldNames, Fr as FailedToFetchCommentUpdateFromGatewaysError, Ft as ChallengeRequestMessageSignedPropertyNames, Gn as ModQueuePageIpfsSchema, Gr as _enum, Gt as PKCParsedOptionsSchema, H as raceAgainstAbort, Hr as require_supports_color, Ht as DecryptedChallengeVerificationSchema, Ir as FailedToFetchCommunityFromGatewaysError, Jn as CommentEditChallengeRequestToEncryptSchema, Jr as custom, Kn as PageIpfsSchema, Kr as array, Kt as PKCUserOptionBaseSchema, L as isRequestPubsubPublicationOfPost, Ln as CommentUpdateForChallengeVerificationSignedPropertyNames, Lr as FailedToFetchGenericIpfsFromGatewaysError, Lt as ChallengeVerificationMessageSignedPropertyNames, Mr as e$4, Nn as CommentPubsubMessageWithFlexibleAuthorRefinementSchema, Nr as require_retry$2, Nt as ChallengeMessageSignedPropertyNames, O as isIpfsPath, Or as n$8, Pn as CommentSignedPropertyNames, Pr as FailedToFetchCommentIpfsFromGatewaysError, Qn as CommentEditSignedPropertyNames, Qr as object, Qt as CommunityEditPubsubMessagePublicationSchema, R as isRequestPubsubPublicationOfReply, Rn as CommentUpdateReservedFields, Rr as FailedToFetchPageIpfsFromGatewaysError, Rt as DecryptedChallengeAnswerSchema, S as hasTransientNetworkErrorCode, Sn as RpcRemoteCommunityUpdateEventResultSchema, Sr as t$13, T as ipnsNameToIpnsOverPubsubTopic, Tn as VotePubsubMessagePublicationSchema, Tr as t$11, Un as CreateCommentOptionsWithRefinementSchema, Ur as require_ms$1, Ut as NameResolveCacheOptionsSchema, Vr as logger_default, Vt as DecryptedChallengeSchema, Wn as GetPageParamSchema, Wt as NameResolverSerializedSchema, Xn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, Xr as looseObject, Yr as literal, Yt as CommunityEditPublicationChallengeRequestToEncryptSchema, Zr as number, Zt as CommunityEditPublicationSignedPropertyNames, _n as CreateRpcCommunityFunctionArgumentSchema, _r as normalizeEthAliasDomain, an as CreateCommentModerationOptionsWithRefinementSchema, ar as ChallengeAnswersByIndexSchema, at as throwIfAbortSignalAborted, bn as PageSortFileSchema, br as n$10, cr as CommunityAddressSchema, d as deepMergeRuntimeFields, dn as CommunityExportRecordsSchema, dr as JsonSignatureSchema, dt as findStartedCommunity, ei as record, en as CommentModerationChallengeRequestToEncryptSchema, er as CreateCommentEditOptionsWithRefinementSchema, f as derivePublicationFromChallengeRequest, fn as CommunityIpfsReservedFields, fr as PKCTimestampSchema, gn as CreateRemoteCommunityFunctionArgumentSchema, gr as isStringDomain, h as fetchAndValidateIpnsRecordFromGateway, hn as CreateNewLocalCommunityUserOptionsSchema, hr as isEthAliasDomain, in as CommentModerationsTableRowSchema, ir as AuthorReservedFields, jn as CommentIpfsSchema, jr as t$9, jt as ChallengeAnswerMessageSignedPropertyNames, k as isIpns, kn as CommentChallengeRequestToEncryptSchema, kr as r$7, kt as pTimeout, ln as CommunityChallengeSettingSchema, lr as CommunityAuthorChallengeReservedFieldNames, m as extractNetworkErrorDetails, mn as CommunitySignedPropertyNames, mr as areEquivalentNames, mt as forgetTrackedUpdatingCommunityName, ni as union, nr as AuthorCommentIpfsReservedFields, nt as shortifyCid, on as ChallengeFileFactorySchema, or as CidPathSchema, ot as timestamp, p as doesDomainAddressHaveCapitalLetter, pn as CommunityIpfsSchema, pr as ProtocolVersionSchema, pt as findUpdatingCommunity, q as removeNullUndefinedEmptyObjectsValuesRecursively, qn as isReservedObjectKey, qr as boolean, qt as PKCUserOptionsSchema, r as calculateIpfsCidV0, rn as CommentModerationSignedPropertyNames, rr as AuthorPubsubSchema, rt as sleepUntilTimeoutOrAbort, sn as ChallengeFileSchema, sr as CidStringSchema, t as areEquivalentCommunityAddresses, ti as string, tn as CommentModerationPubsubMessagePublicationSchema, tr as AuthorAddressSchema, tt as shortifyAddress, u as createAbortError, un as CommunityEditOptionsSchema, ur as CreateSignerSchema, vn as ExportCommunityModLogsOptionsSchema, vr as n$9, w as interruptibleSleep, wn as VoteChallengeRequestToEncryptSchema, wr as e$5, wt as untrackStartedCommunity, xt as trackStartedCommunity, yn as PageSortFileFactorySchema, yt as refreshTrackedCommunityAliases, z as linkAbortSignals, zn as CommentUpdateSchema, zr as PKCError } from "./util-BZuCmqxu.js";
|
|
3
3
|
import { t as all } from "./src-CYIMjhjK.js";
|
|
4
|
-
import { s as validatePageSortFile } from "./page-sort-scoring-
|
|
4
|
+
import { s as validatePageSortFile } from "./page-sort-scoring-I02fuGkI.js";
|
|
5
5
|
import { createHash, randomUUID } from "node:crypto";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
7
|
import path from "node:path";
|
|
@@ -123780,6 +123780,9 @@ const verifyBufferEd25519 = async (bufferToSign, bufferSignature, publicKeyBase6
|
|
|
123780
123780
|
if (!publicKeyBase64 || typeof publicKeyBase64 !== "string") throw Error(`verifyBufferEd25519 publicKeyBase64 '${publicKeyBase64}' not a string`);
|
|
123781
123781
|
const publicKeyBuffer = fromString(publicKeyBase64, "base64");
|
|
123782
123782
|
if (publicKeyBuffer.length !== 32) throw Error(`verifyBufferEd25519 publicKeyBase64 '${publicKeyBase64}' ed25519 public key length not 32 bytes (${publicKeyBuffer.length} bytes)`);
|
|
123783
|
+
try {
|
|
123784
|
+
if (ed25519.Point.fromBytes(publicKeyBuffer, true).isSmallOrder()) return false;
|
|
123785
|
+
} catch {}
|
|
123783
123786
|
if (await _isWebCryptoEd25519Supported()) try {
|
|
123784
123787
|
const cryptoKey = await globalThis.crypto.subtle.importKey("raw", publicKeyBuffer, { name: "Ed25519" }, false, ["verify"]);
|
|
123785
123788
|
if (await globalThis.crypto.subtle.verify("Ed25519", cryptoKey, bufferSignature, bufferToSign)) return true;
|
|
@@ -146987,6 +146990,39 @@ const createSigner = async (createSignerOptions) => {
|
|
|
146987
146990
|
});
|
|
146988
146991
|
};
|
|
146989
146992
|
//#endregion
|
|
146993
|
+
//#region dist/node/detached-guard.js
|
|
146994
|
+
function guardDetached({ entryPoint, handler, onFailure }) {
|
|
146995
|
+
const handleFailure = (error) => {
|
|
146996
|
+
logger_default("pkc-js:detached-guard").error(`Detached entry point (${entryPoint}) failed`, describeFailure(error));
|
|
146997
|
+
return onFailure(error);
|
|
146998
|
+
};
|
|
146999
|
+
return ((...args) => {
|
|
147000
|
+
let result;
|
|
147001
|
+
try {
|
|
147002
|
+
result = handler(...args);
|
|
147003
|
+
} catch (error) {
|
|
147004
|
+
const failureResult = handleFailure(error);
|
|
147005
|
+
return isThenable(failureResult) ? Promise.resolve(failureResult).then(() => void 0) : void 0;
|
|
147006
|
+
}
|
|
147007
|
+
if (!isThenable(result)) return void 0;
|
|
147008
|
+
return Promise.resolve(result).then(() => void 0, async (error) => {
|
|
147009
|
+
await handleFailure(error);
|
|
147010
|
+
});
|
|
147011
|
+
});
|
|
147012
|
+
}
|
|
147013
|
+
function isThenable(value) {
|
|
147014
|
+
return typeof value === "object" && value !== null && typeof value.then === "function";
|
|
147015
|
+
}
|
|
147016
|
+
function describeFailure(error) {
|
|
147017
|
+
const chain = [];
|
|
147018
|
+
let current = error;
|
|
147019
|
+
for (let depth = 0; depth < 5 && current !== void 0; depth++) {
|
|
147020
|
+
chain.push(current);
|
|
147021
|
+
current = typeof current === "object" && current !== null ? current.cause : void 0;
|
|
147022
|
+
}
|
|
147023
|
+
return chain;
|
|
147024
|
+
}
|
|
147025
|
+
//#endregion
|
|
146990
147026
|
//#region node_modules/tiny-typed-emitter/lib/index.js
|
|
146991
147027
|
var require_lib = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
146992
147028
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -149862,17 +149898,25 @@ var BaseClientsManager = class BaseClientsManager {
|
|
|
149862
149898
|
const pubsubClient = this._pkc.clients.libp2pJsClients[kuboPubsubRpcUrlOrLibp2pJsKey]?.heliaWithKuboRpcClientFunctions || this._pkc.clients.pubsubKuboRpcClients[kuboPubsubRpcUrlOrLibp2pJsKey]._client;
|
|
149863
149899
|
if (!pubsubClient) throw new PKCError("ERR_INVALID_PUBSUB_PROVIDER", { pubsubProviderUrl: kuboPubsubRpcUrlOrLibp2pJsKey });
|
|
149864
149900
|
const timeBefore = Date.now();
|
|
149865
|
-
const handlePubsubError =
|
|
149866
|
-
|
|
149867
|
-
|
|
149868
|
-
|
|
149869
|
-
|
|
149870
|
-
|
|
149871
|
-
}
|
|
149872
|
-
|
|
149901
|
+
const handlePubsubError = guardDetached({
|
|
149902
|
+
entryPoint: `pubsub onError (${kuboPubsubRpcUrlOrLibp2pJsKey})`,
|
|
149903
|
+
onFailure: (cause) => this._pkc.emit("error", new PKCError("ERR_FAILED_TO_RESUBSCRIBE_TO_PUBSUB_TOPIC_AFTER_ERROR", {
|
|
149904
|
+
pubsubTopic,
|
|
149905
|
+
pubsubProviderUrl: kuboPubsubRpcUrlOrLibp2pJsKey,
|
|
149906
|
+
cause
|
|
149907
|
+
})),
|
|
149908
|
+
handler: async (err) => {
|
|
149909
|
+
error = err;
|
|
149910
|
+
log.error("pubsub callback error, topic", pubsubTopic, "provider url", kuboPubsubRpcUrlOrLibp2pJsKey, "error", err, "Will unsubscribe and re-attempt to subscribe");
|
|
149911
|
+
await this._pkc._stats.recordGatewayFailure(kuboPubsubRpcUrlOrLibp2pJsKey, "pubsub-subscribe");
|
|
149912
|
+
try {
|
|
149913
|
+
await this.pubsubUnsubscribeOnProvider(pubsubTopic, kuboPubsubRpcUrlOrLibp2pJsKey, handler);
|
|
149914
|
+
} catch (e) {
|
|
149915
|
+
log.error("Failed to unsubscribe after onError, topic", pubsubTopic, "provider url", kuboPubsubRpcUrlOrLibp2pJsKey, e);
|
|
149916
|
+
}
|
|
149917
|
+
await this.pubsubSubscribeOnProvider(pubsubTopic, handler, kuboPubsubRpcUrlOrLibp2pJsKey);
|
|
149873
149918
|
}
|
|
149874
|
-
|
|
149875
|
-
};
|
|
149919
|
+
});
|
|
149876
149920
|
let error;
|
|
149877
149921
|
try {
|
|
149878
149922
|
await pRetry(async () => {
|
|
@@ -158169,4 +158213,4 @@ var RpcLocalCommunity = class extends RpcRemoteCommunity {
|
|
|
158169
158213
|
}
|
|
158170
158214
|
};
|
|
158171
158215
|
//#endregion
|
|
158172
|
-
export { coerceSchemaRowJson as $,
|
|
158216
|
+
export { coerceSchemaRowJson as $, cleanWireAuthor as $n, getCommunitiesRegistry as $r, RpcPublishAnchorRecordParamSchema as $t, findCommentInParsedPages as A, signCommentUpdateForChallengeVerification as An, calculateExpectedSignatureSize as Ar, parsePKCUserOptionsSchemaWithPKCErrorIfItFails as At, GenericStateClient as B, verifyCommentIpfs as Bn, getDefaultDataPath as Br, RpcCommentRepliesPageParamSchema as Bt, RepliesPages as C, signChallengeMessage as Cn, sha256$8 as Cr, parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails as Ct, extractCommunityRuntimeFieldsFromParsedPages as D, signCommentEdit as Dn, clean as Dr, parseDecryptedChallengeVerification as Dt, buildPagesRuntimeFields as E, signComment as En, anumber$1 as Er, parseDecryptedChallengeAnswerWithPKCErrorIfItFails as Et, cloneCrosspostForRuntime as F, verifyChallengeAnswer as Fn, deriveDbPosts as Fr, parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails as Ft, pRetry as G, verifyCommunityEdit as Gn, monitorCommunitiesDirectory as Gr, RpcExportCommunityModLogsParamSchema as Gt, listSubscribedPubsubTopicsShared as H, verifyCommentPubsubMessage as Hn, importSignerIntoKuboNode as Hr, RpcCommunityIdentifierParamSchema as Ht, collectCrosspostAuthorsToResolve as I, verifyChallengeMessage as In, deriveDbReplies as Ir, RpcAnchorPublishPreparationResultSchema as It, decodeRpcChallengeAnswerPubsubMsg as J, assignUnknownProps as Jn, removeFileRetryingWhileBusy as Jr, RpcExportCommunityResultSchema as Jt, pLimit as K, verifyCommunityList as Kn, moveCommunityDbToDeletedDirectory as Kr, RpcExportCommunityModLogsResultSchema as Kt, extractCrosspostRuntimeFields as L, verifyChallengeRequest as Ln, findLocalCommunityAddress as Lr, RpcAuthorNameParamSchema as Lt, parseRawPages as M, signCommunityEdit as Mn, createKuboRpcClient as Mr, parseRpcCommentUpdateEventWithPKCErrorIfItFails as Mt, MAX_PAGE_SIZE_BYTES as N, signCommunityList as Nn, deleteOldCommunityInWindows as Nr, parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails as Nt, findCommentInPageInstance as O, signCommentModeration as On, BackupAbortError as Or, parseDecryptedChallengeWithPKCErrorIfItFails as Ot, applyNameResolvedCacheToCrosspost as P, signVote as Pn, deriveCommentIpfsFromCommentTableRow as Pr, parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as Pt, coerceSchemaRowBoolean as Q, buildRuntimeAuthor as Qn, unregisterLocalCommunity as Qr, RpcFetchCommunityListResultSchema as Qt, stripNameResolvedFromCrosspost as R, verifyChallengeVerification as Rn, forgetCommunityThatFailedToBeDeleted as Rr, RpcCancelExportParamSchema as Rt, MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS as S, signChallengeAnswer as Sn, x25519 as Sr, parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails as St, buildPageRuntimeFields as T, signChallengeVerification as Tn, ahash as Tr, parseCreateVoteOptionsSchemaWithPKCErrorIfItFails as Tt, InflightFetchManager as U, verifyCommentUpdate as Un, isLocalCommunityAddress as Ur, RpcCommunityPageParamSchema as Ut, SHARED_KUBO_READ_TIMEOUT_MS as V, verifyCommentModeration as Vn, getThumbnailPropsOfLink as Vr, RpcCommunitiesChangeEventResultSchema as Vt, InflightResourceTypes as W, verifyCommunity as Wn, markLocalCommunityDbAsBeingWritten as Wr, RpcEditCommunityParamSchema as Wt, decodeRpcChallengeRequestPubsubMsg as X, mergeAuthorProps as Xn, setNativeFunctions as Xr, RpcFetchCidResultSchema as Xt, decodeRpcChallengePubsubMsg as Y, forbiddenKeysOf as Yn, resolveDbPostsCidRefs as Yr, RpcFetchCidParamSchema as Yt, decodeRpcChallengeVerificationPubsubMsg as Z, withoutForbiddenKeys as Zn, tryToDeleteCommunitiesThatFailedToBeDeletedBefore as Zr, RpcFetchCommunityListParamSchema as Zt, createAuthorIdentityMatcher as _, require_lodash_merge as _i, decryptEd25519AesGcmPublicKeyBuffer as _n, getIpfsKeyFromPrivateKey as _r, parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails as _t, generatePagesReportingFailedSorts as a, t$4 as ai, RpcSubscriptionIdResultSchema as an, CreateNewCommunityListOptionsSchema as ar, parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails as at, KeyvBetterSqlite3 as b, _validateSignatureOfPKCRecord as bn, getPublicKeyFromPrivateKey as br, parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails as bt, resolvePageSortsOrThrow as c, n$5 as ci, findCommunityRecordNameMismatch as cn, effectiveMaxCrosspostDepth as cr, parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails as ct, getChallengeVerification as d, t$8 as di, require_lib as dn, getCommunityNameFromWire$1 as dr, parseCommunityAddressWithPKCErrorIfItFails as dt, markCommunityDbAsBeingWritten as ei, RpcPublishChallengeAnswersParamSchema as en, getAuthorNameFromRuntime as er, collectSchemaRowCoercions as et, getCommunityChallengeFromCommunityChallengeSettings as f, MAX_FILE_SIZE_BYTES_FOR_COMMENT_UPDATE as fi, guardDetached as fn, getCommunityPublicKeyFromWire as fr, parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as ft, authorNameResolveFailureReason as g, STORAGE_KEYS as gi, decryptEd25519AesGcm as gn, getBufferedPKCAddressFromPublicKey as gr, parseCommunityListSchemaWithPKCErrorIfItFails as gt, authorIdentityMatcherForRequest as h, NAME_RESOLVE_FAILED_RETRY_FLOOR_MS as hi, createAnchorIpnsRecord as hn, encode as hr, parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails as ht, derivePublicPageSorts as i, t$2 as ii, RpcResolveAuthorNameResultSchema as in, CreateCommunityListWithCidOptionsSchema as ir, parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as it, iterateOverPageCidsToFindAllCids as j, signCommunity as jn, calculateInlineRepliesBudget as jr, parseRpcCommentEventWithPKCErrorIfItFails as jt, findCommentInPageInstanceRecursively as k, signCommentUpdate as kn, backupCommunityDb as kr, parseJsonWithPKCErrorIfFails as kt, pkcJsPageSorts as l, n$6 as li, verifyAuthorWalletEntry as ln, buildRuntimeCommunityFields as lr, parseCommentPubsubMessagePublicationWithPKCErrorIfItFails as lt, pkcJsChallenges as m, NAME_RESOLVED_TRUE_TTL_MS as mi, createSigner as mn, decode as mr, parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails as mt, RpcRemoteCommunity as n, toCommunitiesEntry as ni, RpcPublishCommunityListResultSchema as nn, normalizeCreatePublicationAuthor as nr, parseCidStringSchemaWithPKCErrorIfItFails as nt, loadPageSortsForStartedCommunity as o, r as oi, RpcSuccessResultSchema as on, MAX_COMMUNITY_LIST_SIZE_BYTES as or, parseCommentIpfsSchemaWithPKCErrorIfItFails as ot, loadChallengeFileFromCommunityChallengeSettings as p, NAME_RESOLVED_FALSE_TTL_MS as pi, SignerWithPublicKeyAddress as pn, normalizeCommunityInputFromCommunity as pr, parseCommunityEditOptionsSchemaWithPKCErrorIfItFails as pt, PKCTypedEmitter as q, verifyVote as qn, registerLocalCommunity as qr, RpcExportCommunityParamSchema as qt, computePageSortsFingerprint as r, toCommunitiesWireEntry as ri, RpcPublishedAnchorRecordResultSchema as rn, stringify as rr, parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as rt, lookupPageSortFactories as s, t$5 as si, RpcUnsubscribeParamSchema as sn, crosspostChainDepthUpTo as sr, parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as st, RpcLocalCommunity as t, findCommunitiesEntry as ti, RpcPublishCommunityListParamSchema as tn, getAuthorNameFromWire as tr, createSchemaRowParser as tt, deriveCommunityChallengesOrThrow as u, t$7 as ui, hmac as un, getCommunityAddressFromRecord as ur, parseCommentUpdateSchemaWithPKCErrorIfItFails as ut, TrackedInstanceRegistry as v, nativeFunctions$1 as vi, encryptEd25519AesGcm as vn, getPKCAddressFromPublicKey as vr, parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails as vt, TIMEFRAMES_TO_SECONDS as w, signChallengeRequest as wn, abytes$1 as wr, parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails as wt, RemoteCommunity as x, cleanUpBeforePublishing as xn, ed25519 as xr, parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails as xt, LRUCache as y, encryptEd25519AesGcmPublicKeyBuffer as yn, getPKCAddressFromPublicKeySync as yr, parseCreateCommentOptionsSchemaWithPKCErrorIfItFails as yt, PKCClientsManager as z, verifyCommentEdit as zn, getDefaultCommunityDbConfig as zr, RpcCidParamSchema as zt };
|
|
@@ -6891,6 +6891,7 @@ var messages;
|
|
|
6891
6891
|
messages["ERR_GET_COMMUNITY_ABORTED"] = "Aborted while waiting for the community record to load";
|
|
6892
6892
|
messages["ERR_COMMUNITY_STOPPED_WHILE_LOADING"] = "The community instance was stopped while its record was being loaded";
|
|
6893
6893
|
messages["ERR_GET_COMMENT_ABORTED"] = "Aborted while waiting for the comment record to load";
|
|
6894
|
+
messages["ERR_FAILED_TO_RESUBSCRIBE_TO_PUBSUB_TOPIC_AFTER_ERROR"] = "The pubsub provider reported an error on a subscription, and subscribing to the topic again failed";
|
|
6894
6895
|
messages["ERR_TIMEOUT_WAITING_FOR_PUBSUB_TOPIC_PEERS"] = "Timeout waiting for propagation of pubsub topic peers";
|
|
6895
6896
|
messages["ERR_PUBSUB_TOPIC_PEER_WAIT_ABORTED"] = "Aborted while waiting for a peer to subscribe to a pubsub topic";
|
|
6896
6897
|
messages["ERR_IPNS_DIRECT_FETCH_ABORTED"] = "Aborted while fetching an IPNS record directly from subscribers/providers";
|
|
@@ -7281,6 +7282,7 @@ var messages;
|
|
|
7281
7282
|
messages["ERR_FAILED_TO_OPEN_CONNECTION_TO_RPC"] = "Failed to open connection to RPC";
|
|
7282
7283
|
messages["ERR_FAILED_TO_CREATE_WS_RPC_SERVER"] = "Failed to create WebSocket RPC server";
|
|
7283
7284
|
messages["ERR_RPC_CLIENT_ATTEMPTING_TO_START_A_REMOTE_COMMUNITY"] = "Attempting to start a community that is not local";
|
|
7285
|
+
messages["ERR_RPC_CLIENT_FAILED_TO_HANDLE_SERVER_MESSAGE"] = "The RPC server sent a message the RPC client could not handle (not valid JSON, or a notification its handler rejected). The message was dropped";
|
|
7284
7286
|
messages["ERR_RPC_COMMUNITY_NOT_RUNNING"] = "The community is not running on the PKC RPC server and was stopped on purpose, so the RPC client did not start it again after reconnecting";
|
|
7285
7287
|
messages["ERR_RPC_CLIENT_TRYING_TO_STOP_COMMUNITY_THAT_IS_NOT_RUNNING"] = "RPC client is attempting to stop a local community that is not running";
|
|
7286
7288
|
messages["ERR_RPC_CLIENT_TRYING_TO_STOP_REMOTE_COMMUNITY"] = "RPC client is attempting to stop a remote community";
|
|
@@ -8246,6 +8248,7 @@ const CommentUpdateSchema = object({
|
|
|
8246
8248
|
author: AuthorWithCommentUpdateSchema.pick({ community: true }).optional(),
|
|
8247
8249
|
lastChildCid: CidStringSchema.optional(),
|
|
8248
8250
|
lastReplyTimestamp: PKCTimestampSchema.optional(),
|
|
8251
|
+
pseudonymityAuthorTag: string().regex(/^[A-Za-z0-9+/]{22}$/, "pseudonymityAuthorTag must be 22 base64 characters (16 bytes)").optional(),
|
|
8249
8252
|
signature: JsonSignatureSchema,
|
|
8250
8253
|
protocolVersion: ProtocolVersionSchema,
|
|
8251
8254
|
get replies() {
|
|
@@ -8268,7 +8271,8 @@ const CommentUpdateChallengeReservedFieldNames = [
|
|
|
8268
8271
|
"authorBanExpiresAt",
|
|
8269
8272
|
"replies",
|
|
8270
8273
|
"edit",
|
|
8271
|
-
"protocolVersion"
|
|
8274
|
+
"protocolVersion",
|
|
8275
|
+
"pseudonymityAuthorTag"
|
|
8272
8276
|
];
|
|
8273
8277
|
const CommentUpdateForDisapprovedPendingCommentSignedPropertyNames = t$3(n$3(CommentUpdateSchema.pick({
|
|
8274
8278
|
author: true,
|
|
@@ -16602,14 +16606,14 @@ const CommunityEditPublicationPubsubReservedFields = r$2([
|
|
|
16602
16606
|
], t$3(CommunityEditPubsubMessagePublicationSchema.shape));
|
|
16603
16607
|
//#endregion
|
|
16604
16608
|
//#region dist/node/generated-version.js
|
|
16605
|
-
const version = "0.0.
|
|
16609
|
+
const version = "0.0.159";
|
|
16606
16610
|
//#endregion
|
|
16607
16611
|
//#region dist/node/version.js
|
|
16608
16612
|
const protocolVersion = ProtocolVersionSchema.parse("1.0.0");
|
|
16609
16613
|
const pkcJsVersion = version;
|
|
16610
16614
|
var version_default = {
|
|
16611
16615
|
PKC_JS_VERSION: pkcJsVersion,
|
|
16612
|
-
DB_VERSION:
|
|
16616
|
+
DB_VERSION: 49,
|
|
16613
16617
|
PROTOCOL_VERSION: protocolVersion,
|
|
16614
16618
|
USER_AGENT: UserAgentSchema.parse(`/pkc-js:${pkcJsVersion}/`)
|
|
16615
16619
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as pubsubTopicToDhtKeyCid, z as linkAbortSignals, zr as PKCError } from "./util-
|
|
1
|
+
import { V as pubsubTopicToDhtKeyCid, z as linkAbortSignals, zr as PKCError } from "./util-BZuCmqxu.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 { on as ChallengeFileFactorySchema, sn as ChallengeFileSchema, yn as PageSortFileFactorySchema, zr as PKCError } from "./util-
|
|
2
|
-
import { s as validatePageSortFile } from "./page-sort-scoring-
|
|
1
|
+
import { on as ChallengeFileFactorySchema, sn as ChallengeFileSchema, yn as PageSortFileFactorySchema, zr as PKCError } from "./util-BZuCmqxu.js";
|
|
2
|
+
import { s as validatePageSortFile } from "./page-sort-scoring-I02fuGkI.js";
|
|
3
3
|
//#region dist/node/validate-package-factories.js
|
|
4
4
|
function validateChallengeFileFactory(factory, { name }) {
|
|
5
5
|
try {
|
package/dist/bundled/index.js
CHANGED
|
@@ -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-
|
|
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-Bv7hIiW_.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-
|
|
1
|
+
import { n as validatePageSortFileFactory } from "./chunks/validate-package-factories-BsSEIr__.js";
|
|
2
2
|
export { validatePageSortFileFactory };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as hideClassPrivateProps, Sr as t, Vr as logger_default, X as replaceXWithY, br as n, dt as findStartedCommunity, et as retryKuboIpfsAddAndProvide, i as calculateStringSizeSameAsIpfsAddCidV0, kt as pTimeout, zr as PKCError } from "../../chunks/util-
|
|
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-
|
|
3
|
-
import { E as buildPagesRuntimeFields, Et as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, G as pRetry,
|
|
4
|
-
import { t as LocalCommunity } from "../../chunks/local-community-
|
|
1
|
+
import { C as hideClassPrivateProps, Sr as t, Vr as logger_default, X as replaceXWithY, br as n, dt as findStartedCommunity, et as retryKuboIpfsAddAndProvide, i as calculateStringSizeSameAsIpfsAddCidV0, kt as pTimeout, zr as PKCError } from "../../chunks/util-BZuCmqxu.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-Bv7hIiW_.js";
|
|
3
|
+
import { E as buildPagesRuntimeFields, Et as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, G as pRetry, K as pLimit, Kn as verifyCommunityList, L as extractCrosspostRuntimeFields, Lr as findLocalCommunityAddress, Nt as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, Pt as parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, St as parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails, T as buildPageRuntimeFields, Ur as isLocalCommunityAddress, ai as t$1, dn as require_lib, ft as parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, gt as parseCommunityListSchemaWithPKCErrorIfItFails, it as parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, kt as parseJsonWithPKCErrorIfFails, or as MAX_COMMUNITY_LIST_SIZE_BYTES, pt as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, ri as toCommunitiesWireEntry, rr as stringify, rt as parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, st as parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, xt as parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails } from "../../chunks/rpc-local-community-Bo4Z7ilA.js";
|
|
4
|
+
import { t as LocalCommunity } from "../../chunks/local-community-0xsjgulY.js";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import path from "path";
|
|
7
7
|
import assert from "assert";
|
|
@@ -7,6 +7,7 @@ import pLimit from "p-limit";
|
|
|
7
7
|
import pRetry, { AbortError as PRetryAbortError } from "p-retry";
|
|
8
8
|
import { FailedToFetchCommentIpfsFromGatewaysError, FailedToFetchCommentUpdateFromGatewaysError, FailedToFetchGenericIpfsFromGatewaysError, FailedToFetchPageIpfsFromGatewaysError, FailedToFetchCommunityFromGatewaysError, PKCError } from "../pkc-error.js";
|
|
9
9
|
import Logger from "../logger.js";
|
|
10
|
+
import { guardDetached } from "../detached-guard.js";
|
|
10
11
|
import * as cborg from "cborg";
|
|
11
12
|
import { concat as uint8ArrayConcat } from "uint8arrays/concat";
|
|
12
13
|
import { toString as uint8ArrayToString } from "uint8arrays/to-string";
|
|
@@ -162,18 +163,30 @@ export class BaseClientsManager {
|
|
|
162
163
|
if (!pubsubClient)
|
|
163
164
|
throw new PKCError("ERR_INVALID_PUBSUB_PROVIDER", { pubsubProviderUrl: kuboPubsubRpcUrlOrLibp2pJsKey });
|
|
164
165
|
const timeBefore = Date.now();
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
166
|
+
// The pubsub client calls this from a stream callback and does not await or catch it, so a throw or a rejection
|
|
167
|
+
// here (the provider is gone, so subscribing again fails) is an unhandled rejection that ends the process. The
|
|
168
|
+
// guard reports it as an "error" of the pkc instead: delivered to a listener, and, as documented, thrown when
|
|
169
|
+
// nothing listens.
|
|
170
|
+
const handlePubsubError = guardDetached({
|
|
171
|
+
entryPoint: `pubsub onError (${kuboPubsubRpcUrlOrLibp2pJsKey})`,
|
|
172
|
+
onFailure: (cause) => this._pkc.emit("error", new PKCError("ERR_FAILED_TO_RESUBSCRIBE_TO_PUBSUB_TOPIC_AFTER_ERROR", {
|
|
173
|
+
pubsubTopic,
|
|
174
|
+
pubsubProviderUrl: kuboPubsubRpcUrlOrLibp2pJsKey,
|
|
175
|
+
cause
|
|
176
|
+
})),
|
|
177
|
+
handler: async (err) => {
|
|
178
|
+
error = err;
|
|
179
|
+
log.error("pubsub callback error, topic", pubsubTopic, "provider url", kuboPubsubRpcUrlOrLibp2pJsKey, "error", err, "Will unsubscribe and re-attempt to subscribe");
|
|
180
|
+
await this._pkc._stats.recordGatewayFailure(kuboPubsubRpcUrlOrLibp2pJsKey, "pubsub-subscribe");
|
|
181
|
+
try {
|
|
182
|
+
await this.pubsubUnsubscribeOnProvider(pubsubTopic, kuboPubsubRpcUrlOrLibp2pJsKey, handler);
|
|
183
|
+
}
|
|
184
|
+
catch (e) {
|
|
185
|
+
log.error("Failed to unsubscribe after onError, topic", pubsubTopic, "provider url", kuboPubsubRpcUrlOrLibp2pJsKey, e);
|
|
186
|
+
}
|
|
187
|
+
await this.pubsubSubscribeOnProvider(pubsubTopic, handler, kuboPubsubRpcUrlOrLibp2pJsKey);
|
|
174
188
|
}
|
|
175
|
-
|
|
176
|
-
};
|
|
189
|
+
});
|
|
177
190
|
let error;
|
|
178
191
|
try {
|
|
179
192
|
await pRetry(async () => {
|