@pkcprotocol/pkc-js 0.0.141 → 0.0.143
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 +1 -0
- package/dist/browser/clients/base-client-manager.js +6 -1
- package/dist/browser/clients/base-client-manager.js.map +1 -1
- package/dist/browser/clients/rpc-client/pkc-rpc-client.js +15 -8
- package/dist/browser/clients/rpc-client/pkc-rpc-client.js.map +1 -1
- package/dist/browser/clients/rpc-client/rpc-schema-util.d.ts +2 -0
- package/dist/browser/clients/rpc-client/schema.d.ts +2 -0
- package/dist/browser/community/rpc-local-community.d.ts +12 -1
- package/dist/browser/community/rpc-local-community.js +133 -10
- package/dist/browser/community/rpc-local-community.js.map +1 -1
- package/dist/browser/community/schema.d.ts +19 -0
- package/dist/browser/community/schema.js +7 -3
- package/dist/browser/community/schema.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 +18 -1
- 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/object-key-util.js +5 -1
- package/dist/browser/object-key-util.js.map +1 -1
- package/dist/browser/pages/pages-client-manager.d.ts +1 -0
- package/dist/browser/pages/pages-client-manager.js +22 -5
- package/dist/browser/pages/pages-client-manager.js.map +1 -1
- package/dist/browser/pages/pkc-js-page-sorts/top.js +2 -1
- package/dist/browser/pages/pkc-js-page-sorts/top.js.map +1 -1
- package/dist/browser/pages/schema.js +3 -1
- package/dist/browser/pages/schema.js.map +1 -1
- package/dist/browser/pkc/pkc-with-rpc-client.js +9 -5
- package/dist/browser/pkc/pkc-with-rpc-client.js.map +1 -1
- package/dist/browser/pkc/pkc.d.ts +4 -1
- package/dist/browser/pkc/pkc.js +6 -5
- package/dist/browser/pkc/pkc.js.map +1 -1
- package/dist/browser/publications/comment/comment-client-manager.js +11 -11
- package/dist/browser/publications/comment/comment-client-manager.js.map +1 -1
- package/dist/browser/publications/comment/comment.js +2 -0
- package/dist/browser/publications/comment/comment.js.map +1 -1
- package/dist/browser/publications/community-edit/schema.d.ts +8 -0
- package/dist/browser/publications/publication-client-manager.js +7 -1
- package/dist/browser/publications/publication-client-manager.js.map +1 -1
- package/dist/browser/publications/publication.d.ts +7 -0
- package/dist/browser/publications/publication.js +88 -24
- package/dist/browser/publications/publication.js.map +1 -1
- package/dist/browser/pubsub-messages/schema.d.ts +4 -0
- 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.d.ts +3 -0
- package/dist/browser/runtime/node/community/db-handler.js +22 -4
- package/dist/browser/runtime/node/community/db-handler.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community/comment-updates.d.ts +1 -0
- package/dist/browser/runtime/node/community/local-community/comment-updates.js +70 -19
- package/dist/browser/runtime/node/community/local-community/comment-updates.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community/post-updates-bucket.d.ts +14 -0
- package/dist/browser/runtime/node/community/local-community/post-updates-bucket.js +206 -0
- package/dist/browser/runtime/node/community/local-community/post-updates-bucket.js.map +1 -0
- package/dist/browser/runtime/node/community/local-community.d.ts +1 -0
- package/dist/browser/runtime/node/community/local-community.js +4 -0
- package/dist/browser/runtime/node/community/local-community.js.map +1 -1
- package/dist/browser/runtime/node/community/page-sorts/index.js +10 -10
- package/dist/browser/runtime/node/community/page-sorts/index.js.map +1 -1
- package/dist/browser/schema/schema-util.d.ts +8 -0
- package/dist/browser/schema.d.ts +16 -0
- package/dist/browser/test/mock-ipfs-client.js +10 -4
- package/dist/browser/test/mock-ipfs-client.js.map +1 -1
- package/dist/browser/util.d.ts +5 -0
- package/dist/browser/util.js +52 -5
- package/dist/browser/util.js.map +1 -1
- package/dist/bundled/bundle-manifest.json +165 -123
- package/dist/bundled/challenges.js +1 -1
- package/dist/bundled/chunks/{helia-for-pkc-C3zShnXN.js → helia-for-pkc-DpsMZzv8.js} +41 -34
- package/dist/bundled/chunks/{local-community-PFaUvMFo.js → local-community-BglT8AUy.js} +284 -47
- package/dist/bundled/chunks/{local-community-DMklqSLp.js → local-community-DEaDtekb.js} +1 -1
- package/dist/bundled/chunks/{node-CGmAA0az.js → node-Tkx_TCqE.js} +84 -34
- package/dist/bundled/chunks/{page-sort-scoring-Bz65Z28_.js → page-sort-scoring-DY7SvqJA.js} +1 -1
- package/dist/bundled/chunks/{rpc-local-community-Dq_6nnU1.js → rpc-local-community-Br_xomgn.js} +128 -20
- package/dist/bundled/chunks/src-ABfmT8J2.js +2323 -0
- package/dist/bundled/chunks/src-BC60-Q7v.js +2 -0
- package/dist/bundled/chunks/src-BHqirG63.js +2 -0
- package/dist/bundled/chunks/{src-BggJ_InF.js → src-Bj5iE3qB.js} +2 -1999
- package/dist/bundled/chunks/src-CNab3O7M.js +2001 -0
- package/dist/bundled/chunks/{src-BsiPSkhv.js → src-ltPxiZKf.js} +1312 -3632
- package/dist/bundled/chunks/{util-C6YaxADn.js → util-C5RiQF_G.js} +59 -10
- package/dist/bundled/chunks/{util-CzoLr9RY.js → util-DIkZirPy.js} +1 -1
- package/dist/bundled/chunks/{validate-package-factories-DMzx5r6y.js → validate-package-factories-DnW2JiL5.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 +6 -1
- package/dist/node/clients/base-client-manager.js.map +1 -1
- package/dist/node/clients/rpc-client/pkc-rpc-client.js +15 -8
- package/dist/node/clients/rpc-client/pkc-rpc-client.js.map +1 -1
- package/dist/node/clients/rpc-client/rpc-schema-util.d.ts +2 -0
- package/dist/node/clients/rpc-client/schema.d.ts +2 -0
- package/dist/node/community/rpc-local-community.d.ts +12 -1
- package/dist/node/community/rpc-local-community.js +133 -10
- package/dist/node/community/rpc-local-community.js.map +1 -1
- package/dist/node/community/schema.d.ts +19 -0
- package/dist/node/community/schema.js +7 -3
- package/dist/node/community/schema.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 +18 -1
- 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/object-key-util.js +5 -1
- package/dist/node/object-key-util.js.map +1 -1
- package/dist/node/pages/pages-client-manager.d.ts +1 -0
- package/dist/node/pages/pages-client-manager.js +22 -5
- package/dist/node/pages/pages-client-manager.js.map +1 -1
- package/dist/node/pages/pkc-js-page-sorts/top.js +2 -1
- package/dist/node/pages/pkc-js-page-sorts/top.js.map +1 -1
- package/dist/node/pages/schema.js +3 -1
- package/dist/node/pages/schema.js.map +1 -1
- package/dist/node/pkc/pkc-with-rpc-client.js +9 -5
- package/dist/node/pkc/pkc-with-rpc-client.js.map +1 -1
- package/dist/node/pkc/pkc.d.ts +4 -1
- package/dist/node/pkc/pkc.js +6 -5
- package/dist/node/pkc/pkc.js.map +1 -1
- package/dist/node/publications/comment/comment-client-manager.js +11 -11
- package/dist/node/publications/comment/comment-client-manager.js.map +1 -1
- package/dist/node/publications/comment/comment.js +2 -0
- package/dist/node/publications/comment/comment.js.map +1 -1
- package/dist/node/publications/community-edit/schema.d.ts +8 -0
- package/dist/node/publications/publication-client-manager.js +7 -1
- package/dist/node/publications/publication-client-manager.js.map +1 -1
- package/dist/node/publications/publication.d.ts +7 -0
- package/dist/node/publications/publication.js +88 -24
- package/dist/node/publications/publication.js.map +1 -1
- package/dist/node/pubsub-messages/schema.d.ts +4 -0
- 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.d.ts +3 -0
- package/dist/node/runtime/node/community/db-handler.js +22 -4
- package/dist/node/runtime/node/community/db-handler.js.map +1 -1
- package/dist/node/runtime/node/community/local-community/comment-updates.d.ts +1 -0
- package/dist/node/runtime/node/community/local-community/comment-updates.js +70 -19
- package/dist/node/runtime/node/community/local-community/comment-updates.js.map +1 -1
- package/dist/node/runtime/node/community/local-community/post-updates-bucket.d.ts +14 -0
- package/dist/node/runtime/node/community/local-community/post-updates-bucket.js +206 -0
- package/dist/node/runtime/node/community/local-community/post-updates-bucket.js.map +1 -0
- package/dist/node/runtime/node/community/local-community.d.ts +1 -0
- package/dist/node/runtime/node/community/local-community.js +4 -0
- package/dist/node/runtime/node/community/local-community.js.map +1 -1
- package/dist/node/runtime/node/community/page-sorts/index.js +10 -10
- package/dist/node/runtime/node/community/page-sorts/index.js.map +1 -1
- package/dist/node/schema/schema-util.d.ts +8 -0
- package/dist/node/schema.d.ts +16 -0
- package/dist/node/test/mock-ipfs-client.js +10 -4
- package/dist/node/test/mock-ipfs-client.js.map +1 -1
- package/dist/node/util.d.ts +5 -0
- package/dist/node/util.js +52 -5
- package/dist/node/util.js.map +1 -1
- package/package.json +4 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
|
|
2
|
-
import { $ as
|
|
3
|
-
import { $n as buildRuntimeCommunityFields, $t as RpcPublishCommunityListParamSchema, A as findCommentInParsedPages, Ar as setNativeFunctions$1, At as parseRpcCommentUpdateEventWithPKCErrorIfItFails, B as GenericStateClient, Bn as verifyCommunityEdit, Br as t$3, Bt as RpcCommunityIdentifierParamSchema, C as RepliesPages, Cn as signCommentModeration, Ct as parseCreateVoteOptionsSchemaWithPKCErrorIfItFails, D as extractCommunityRuntimeFieldsFromParsedPages, Dn as signCommunityEdit, Dt as parseJsonWithPKCErrorIfFails, Er as monitorCommunitiesDirectory, Et as parseDecryptedChallengeWithPKCErrorIfItFails, F as cloneCrosspostForRuntime, Fn as verifyCommentIpfs, Ft as RpcAuthorNameParamSchema, G as PKCTypedEmitter, Gn as getAuthorNameFromRuntime, Gt as RpcExportCommunityParamSchema, H as InflightResourceTypes, Hn as verifyVote, Ht as RpcEditCommunityParamSchema, I as collectCrosspostAuthorsToResolve, In as verifyCommentModeration, It as RpcCancelExportParamSchema, J as decodeRpcChallengeRequestPubsubMsg, Jn as CreateCommunityListWithCidOptionsSchema, Jr as NAME_RESOLVED_TRUE_TTL_MS, Jt as RpcFetchCidResultSchema, K as decodeRpcChallengeAnswerPubsubMsg, Kn as getAuthorNameFromWire, Kr as MAX_FILE_SIZE_BYTES_FOR_COMMENT_UPDATE, Kt as RpcExportCommunityResultSchema, Ln as verifyCommentPubsubMessage, Lr as t$5, Lt as RpcCidParamSchema, M as parseRawPages, Mr as findCommunitiesEntry, Nn as verifyChallengeVerification, Nr as toCommunitiesEntry, Nt as parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails, O as findCommentInPageInstance, On as signCommunityList, Ot as parsePKCUserOptionsSchemaWithPKCErrorIfItFails, P as applyNameResolvedCacheToCrosspost, Pn as verifyCommentEdit, Pt as RpcAnchorPublishPreparationResultSchema, Qr as nativeFunctions$2, Qt as RpcPublishChallengeAnswersParamSchema, R as stripNameResolvedFromCrosspost, Rn as verifyCommentUpdate, Rt as RpcCommentRepliesPageParamSchema, Sn as signCommentEdit, Sr as getDefaultDataPath, St as parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, Tr as listCommunitiesSync, Tt as parseDecryptedChallengeVerification, Un as buildRuntimeAuthor, Ur as t$2, Ut as RpcExportCommunityModLogsParamSchema, V as InflightFetchManager, Vn as verifyCommunityList, Vr as n$3, Vt as RpcCommunityPageParamSchema, Wn as cleanWireAuthor, Wr as t$4, Wt as RpcExportCommunityModLogsResultSchema, Xn as MAX_COMMUNITY_LIST_SIZE_BYTES, Xt as RpcFetchCommunityListResultSchema, Y as decodeRpcChallengeVerificationPubsubMsg, Yn as CreateNewCommunityListOptionsSchema, Yr as NAME_RESOLVE_FAILED_RETRY_FLOOR_MS, Yt as RpcFetchCommunityListParamSchema, Zt as RpcPublishAnchorRecordParamSchema, _n as signChallengeAnswer, _t as parseCreateCommentOptionsSchemaWithPKCErrorIfItFails, an as RpcUnsubscribeParamSchema, b as KeyvBetterSqlite3, br as findLocalCommunityAddress, ct as parseCommentUpdateSchemaWithPKCErrorIfItFails, dn as decryptEd25519AesGcm, 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, jr as tryToDeleteCommunitiesThatFailedToBeDeletedBefore, 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, qr as NAME_RESOLVED_FALSE_TTL_MS, 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, zt as RpcCommunitiesChangeEventResultSchema } from "./rpc-local-community-
|
|
4
|
-
import { s as getHeliaDebugContext } from "./util-
|
|
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, 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-C5RiQF_G.js";
|
|
3
|
+
import { $n as buildRuntimeCommunityFields, $t as RpcPublishCommunityListParamSchema, A as findCommentInParsedPages, Ar as setNativeFunctions$1, At as parseRpcCommentUpdateEventWithPKCErrorIfItFails, B as GenericStateClient, Bn as verifyCommunityEdit, Br as t$3, Bt as RpcCommunityIdentifierParamSchema, C as RepliesPages, Cn as signCommentModeration, Ct as parseCreateVoteOptionsSchemaWithPKCErrorIfItFails, D as extractCommunityRuntimeFieldsFromParsedPages, Dn as signCommunityEdit, Dt as parseJsonWithPKCErrorIfFails, Er as monitorCommunitiesDirectory, Et as parseDecryptedChallengeWithPKCErrorIfItFails, F as cloneCrosspostForRuntime, Fn as verifyCommentIpfs, Ft as RpcAuthorNameParamSchema, G as PKCTypedEmitter, Gn as getAuthorNameFromRuntime, Gt as RpcExportCommunityParamSchema, H as InflightResourceTypes, Hn as verifyVote, Ht as RpcEditCommunityParamSchema, I as collectCrosspostAuthorsToResolve, In as verifyCommentModeration, It as RpcCancelExportParamSchema, J as decodeRpcChallengeRequestPubsubMsg, Jn as CreateCommunityListWithCidOptionsSchema, Jr as NAME_RESOLVED_TRUE_TTL_MS, Jt as RpcFetchCidResultSchema, K as decodeRpcChallengeAnswerPubsubMsg, Kn as getAuthorNameFromWire, Kr as MAX_FILE_SIZE_BYTES_FOR_COMMENT_UPDATE, Kt as RpcExportCommunityResultSchema, Ln as verifyCommentPubsubMessage, Lr as t$5, Lt as RpcCidParamSchema, M as parseRawPages, Mr as findCommunitiesEntry, Nn as verifyChallengeVerification, Nr as toCommunitiesEntry, Nt as parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails, O as findCommentInPageInstance, On as signCommunityList, Ot as parsePKCUserOptionsSchemaWithPKCErrorIfItFails, P as applyNameResolvedCacheToCrosspost, Pn as verifyCommentEdit, Pt as RpcAnchorPublishPreparationResultSchema, Qr as nativeFunctions$2, Qt as RpcPublishChallengeAnswersParamSchema, R as stripNameResolvedFromCrosspost, Rn as verifyCommentUpdate, Rt as RpcCommentRepliesPageParamSchema, Sn as signCommentEdit, Sr as getDefaultDataPath, St as parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, Tr as listCommunitiesSync, Tt as parseDecryptedChallengeVerification, Un as buildRuntimeAuthor, Ur as t$2, Ut as RpcExportCommunityModLogsParamSchema, V as InflightFetchManager, Vn as verifyCommunityList, Vr as n$3, Vt as RpcCommunityPageParamSchema, Wn as cleanWireAuthor, Wr as t$4, Wt as RpcExportCommunityModLogsResultSchema, Xn as MAX_COMMUNITY_LIST_SIZE_BYTES, Xt as RpcFetchCommunityListResultSchema, Y as decodeRpcChallengeVerificationPubsubMsg, Yn as CreateNewCommunityListOptionsSchema, Yr as NAME_RESOLVE_FAILED_RETRY_FLOOR_MS, Yt as RpcFetchCommunityListParamSchema, Zt as RpcPublishAnchorRecordParamSchema, _n as signChallengeAnswer, _t as parseCreateCommentOptionsSchemaWithPKCErrorIfItFails, an as RpcUnsubscribeParamSchema, b as KeyvBetterSqlite3, br as findLocalCommunityAddress, ct as parseCommentUpdateSchemaWithPKCErrorIfItFails, dn as decryptEd25519AesGcm, 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, jr as tryToDeleteCommunitiesThatFailedToBeDeletedBefore, 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, qr as NAME_RESOLVED_FALSE_TTL_MS, 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, zt as RpcCommunitiesChangeEventResultSchema } from "./rpc-local-community-Br_xomgn.js";
|
|
4
|
+
import { s as getHeliaDebugContext } from "./util-DIkZirPy.js";
|
|
5
5
|
import path from "path";
|
|
6
6
|
import assert from "assert";
|
|
7
7
|
import fs from "fs";
|
|
@@ -27353,13 +27353,15 @@ var PublicationClientsManager = class extends PKCClientsManager {
|
|
|
27353
27353
|
communityPublicKey: updatingCommunityInstance.community.publicKey
|
|
27354
27354
|
});
|
|
27355
27355
|
if (nameMismatch) throw nameMismatch;
|
|
27356
|
-
|
|
27356
|
+
const communityForPublishing = {
|
|
27357
27357
|
address: updatingCommunityInstance.community.address,
|
|
27358
27358
|
publicKey: updatingCommunityInstance.community.publicKey,
|
|
27359
27359
|
name: updatingCommunityInstance.community.name,
|
|
27360
27360
|
encryption: communityIpfs.encryption,
|
|
27361
27361
|
pubsubTopic: communityIpfs.pubsubTopic
|
|
27362
27362
|
};
|
|
27363
|
+
this._pkc._memCaches.communityForPublishing.set(this._publication.communityAddress, communityForPublishing);
|
|
27364
|
+
return communityForPublishing;
|
|
27363
27365
|
}
|
|
27364
27366
|
};
|
|
27365
27367
|
//#endregion
|
|
@@ -27497,6 +27499,7 @@ var Publication = class extends import_lib.TypedEmitter {
|
|
|
27497
27499
|
args: [verification, this instanceof Comment && verification.comment ? this : void 0]
|
|
27498
27500
|
}
|
|
27499
27501
|
});
|
|
27502
|
+
this._unregisterFromPkcOncePublishWorkSettles();
|
|
27500
27503
|
if (this._rpcPublishSubscriptionId) {
|
|
27501
27504
|
const subscriptionId = this._rpcPublishSubscriptionId;
|
|
27502
27505
|
this._rpcPublishSubscriptionId = void 0;
|
|
@@ -27863,17 +27866,39 @@ var Publication = class extends import_lib.TypedEmitter {
|
|
|
27863
27866
|
_getCommunityFetchAbortSignal() {
|
|
27864
27867
|
if (!this._communityFetchAbortSignal) {
|
|
27865
27868
|
this._communityFetchAbortController = new AbortController();
|
|
27866
|
-
this._communityFetchAbortSignal =
|
|
27869
|
+
this._communityFetchAbortSignal = this._communityFetchAbortController.signal;
|
|
27867
27870
|
}
|
|
27868
27871
|
return this._communityFetchAbortSignal;
|
|
27869
27872
|
}
|
|
27873
|
+
async _cancelBackgroundCommunityRefresh() {
|
|
27874
|
+
this._communityFetchAbortController?.abort(new PKCError("ERR_GET_COMMUNITY_ABORTED", {
|
|
27875
|
+
publicationType: this.getType(),
|
|
27876
|
+
communityAddress: this.communityAddress
|
|
27877
|
+
}));
|
|
27878
|
+
if (this._backgroundCommunityRefresh) await this._backgroundCommunityRefresh;
|
|
27879
|
+
this._resetCommunityFetchAbortSignal();
|
|
27880
|
+
}
|
|
27870
27881
|
_resetCommunityFetchAbortSignal() {
|
|
27871
27882
|
this._communityFetchAbortController = void 0;
|
|
27872
27883
|
this._communityFetchAbortSignal = void 0;
|
|
27873
27884
|
}
|
|
27885
|
+
_beginPublishRun() {
|
|
27886
|
+
this._publishRunAbortController = new AbortController();
|
|
27887
|
+
this._publishRunWaitSignal = this._publishRunAbortController.signal;
|
|
27888
|
+
}
|
|
27889
|
+
_getPublishRunWaitSignal() {
|
|
27890
|
+
if (!this._publishRunWaitSignal) this._beginPublishRun();
|
|
27891
|
+
return this._publishRunWaitSignal;
|
|
27892
|
+
}
|
|
27893
|
+
_isPublishRunOver(runSignal) {
|
|
27894
|
+
return this._pkc.destroyed || runSignal.aborted;
|
|
27895
|
+
}
|
|
27874
27896
|
_getCommunityCache() {
|
|
27875
|
-
const
|
|
27876
|
-
if (
|
|
27897
|
+
const cache = this._pkc._memCaches.communityForPublishing;
|
|
27898
|
+
if (cache.has(this.communityAddress)) return cache.get(this.communityAddress);
|
|
27899
|
+
return this._getCommunityFromLiveInstance() ?? cache.get(this.communityAddress, { allowStale: true });
|
|
27900
|
+
}
|
|
27901
|
+
_getCommunityFromLiveInstance() {
|
|
27877
27902
|
const subInstance = findUpdatingCommunity(this._pkc, {
|
|
27878
27903
|
publicKey: this.communityPublicKey,
|
|
27879
27904
|
name: this.communityName
|
|
@@ -27899,12 +27924,21 @@ var Publication = class extends import_lib.TypedEmitter {
|
|
|
27899
27924
|
const log = logger_default("pkc-js:publish:_fetchCommunityForPublishing");
|
|
27900
27925
|
const cachedCommunity = this._getCommunityCache();
|
|
27901
27926
|
if (cachedCommunity) {
|
|
27902
|
-
if (!this._pkc._memCaches.communityForPublishing.has(this.communityAddress)) {
|
|
27927
|
+
if (!(this._pkc._memCaches.communityForPublishing.has(this.communityAddress) || this._getCommunityFromLiveInstance() !== void 0)) {
|
|
27903
27928
|
log("The cache of community is stale, we will use the cached and update in the background");
|
|
27904
27929
|
const refresh = this._pkc.getCommunity({
|
|
27905
27930
|
publicKey: this.communityPublicKey,
|
|
27906
27931
|
name: this.communityName,
|
|
27907
27932
|
abortSignal: this._getCommunityFetchAbortSignal()
|
|
27933
|
+
}).then((community) => {
|
|
27934
|
+
const record = community.raw.communityIpfs;
|
|
27935
|
+
if (record && community.publicKey) this._pkc._memCaches.communityForPublishing.set(this.communityAddress, {
|
|
27936
|
+
address: community.address,
|
|
27937
|
+
publicKey: community.publicKey,
|
|
27938
|
+
name: community.name,
|
|
27939
|
+
encryption: record.encryption,
|
|
27940
|
+
pubsubTopic: record.pubsubTopic
|
|
27941
|
+
});
|
|
27908
27942
|
}).catch((e) => {
|
|
27909
27943
|
if (e?.code === "ERR_GET_COMMUNITY_ABORTED") log("Stopped the background refresh of the community cache", this.communityAddress);
|
|
27910
27944
|
else {
|
|
@@ -27958,6 +27992,7 @@ var Publication = class extends import_lib.TypedEmitter {
|
|
|
27958
27992
|
}
|
|
27959
27993
|
async _postSucessOrFailurePublishing() {
|
|
27960
27994
|
const log = logger_default("pkc-js:publication:_postSucessOrFailurePublishing");
|
|
27995
|
+
this._publishRunAbortController?.abort();
|
|
27961
27996
|
this._unregisterFromPkcOncePublishWorkSettles();
|
|
27962
27997
|
this._setStateWithEmission("stopped");
|
|
27963
27998
|
if (this._rpcPublishSubscriptionId) {
|
|
@@ -28150,8 +28185,9 @@ var Publication = class extends import_lib.TypedEmitter {
|
|
|
28150
28185
|
return contexts;
|
|
28151
28186
|
}
|
|
28152
28187
|
async _handleNotReceivingResponseToChallengeRequest({ providers, currentPubsubProviderIndex, acceptedChallengeTypes }) {
|
|
28153
|
-
|
|
28154
|
-
|
|
28188
|
+
const runSignal = this._getPublishRunWaitSignal();
|
|
28189
|
+
await sleepUntilTimeoutOrAbort(this._publishToDifferentProviderThresholdSeconds * 1e3, runSignal);
|
|
28190
|
+
if (this._isPublishRunOver(runSignal)) return;
|
|
28155
28191
|
if (this._didWeReceiveChallengeOrChallengeVerification()) return;
|
|
28156
28192
|
const currentPubsubProvider = providers[currentPubsubProviderIndex];
|
|
28157
28193
|
this._pkc._stats.recordGatewayFailure(currentPubsubProvider, "pubsub-publish");
|
|
@@ -28183,6 +28219,7 @@ var Publication = class extends import_lib.TypedEmitter {
|
|
|
28183
28219
|
currentPubsubProviderIndex += 1;
|
|
28184
28220
|
while (!this._didWeReceiveChallengeOrChallengeVerification() && currentPubsubProviderIndex < providers.length) {
|
|
28185
28221
|
const providerUrl = providers[currentPubsubProviderIndex];
|
|
28222
|
+
if (this._isPublishRunOver(runSignal)) return;
|
|
28186
28223
|
const challengeRequest = await this._generateChallengeRequestToPublish(providerUrl, acceptedChallengeTypes);
|
|
28187
28224
|
this._updatePublishingStateWithEmission("publishing-challenge-request");
|
|
28188
28225
|
this._updatePubsubState("subscribing-pubsub", providerUrl);
|
|
@@ -28206,11 +28243,11 @@ var Publication = class extends import_lib.TypedEmitter {
|
|
|
28206
28243
|
}
|
|
28207
28244
|
log(`Published a challenge request of publication`, this.getType(), "with provider", providerUrl);
|
|
28208
28245
|
this.emit("challengerequest", decryptedRequest);
|
|
28209
|
-
if (currentPubsubProviderIndex !== providers.length) await sleepUntilTimeoutOrAbort(this._publishToDifferentProviderThresholdSeconds * 1e3,
|
|
28210
|
-
if (this.
|
|
28246
|
+
if (currentPubsubProviderIndex !== providers.length) await sleepUntilTimeoutOrAbort(this._publishToDifferentProviderThresholdSeconds * 1e3, runSignal);
|
|
28247
|
+
if (this._isPublishRunOver(runSignal)) return;
|
|
28211
28248
|
}
|
|
28212
|
-
await sleepUntilTimeoutOrAbort(this._setProviderFailureThresholdSeconds * 1e3,
|
|
28213
|
-
if (this.
|
|
28249
|
+
await sleepUntilTimeoutOrAbort(this._setProviderFailureThresholdSeconds * 1e3, runSignal);
|
|
28250
|
+
if (this._isPublishRunOver(runSignal)) return;
|
|
28214
28251
|
if (this.state === "stopped") return;
|
|
28215
28252
|
if (this._didWeReceiveChallengeOrChallengeVerification()) {
|
|
28216
28253
|
log(`Received a challenge or challenge verification while waiting for retried providers, will keep the exchange alive`);
|
|
@@ -28278,11 +28315,13 @@ var Publication = class extends import_lib.TypedEmitter {
|
|
|
28278
28315
|
async publish() {
|
|
28279
28316
|
this._validatePublicationFields();
|
|
28280
28317
|
if (this._getCommunityFetchAbortSignal().aborted) this._resetCommunityFetchAbortSignal();
|
|
28318
|
+
this._beginPublishRun();
|
|
28281
28319
|
this._pkc._publishingPublications.add(this);
|
|
28282
28320
|
try {
|
|
28283
28321
|
return await this._publishAfterRegistering();
|
|
28284
28322
|
} catch (e) {
|
|
28285
28323
|
this._unregisterFromPkcOncePublishWorkSettles();
|
|
28324
|
+
this._publishRunAbortController?.abort();
|
|
28286
28325
|
throw e;
|
|
28287
28326
|
}
|
|
28288
28327
|
}
|
|
@@ -28564,10 +28603,7 @@ var CommentClientsManager = class extends PublicationClientsManager {
|
|
|
28564
28603
|
this._freshHandlerAbortController = new AbortController();
|
|
28565
28604
|
}
|
|
28566
28605
|
_combinedAbortSignalForRetry() {
|
|
28567
|
-
|
|
28568
|
-
if (signals.length === 0) return void 0;
|
|
28569
|
-
if (signals.length === 1) return signals[0];
|
|
28570
|
-
return AbortSignal.any(signals);
|
|
28606
|
+
return linkAbortSignals([this._comment._getStopAbortSignal(), this._freshHandlerAbortController?.signal]);
|
|
28571
28607
|
}
|
|
28572
28608
|
_initKuboRpcClients() {
|
|
28573
28609
|
if (this._pkc.clients.kuboRpcClients) for (const ipfsUrl of t$1(this._pkc.clients.kuboRpcClients)) this.clients.kuboRpcClients = {
|
|
@@ -28883,7 +28919,8 @@ var CommentClientsManager = class extends PublicationClientsManager {
|
|
|
28883
28919
|
if (typeof postTimestamp !== "number") throw Error("Post timestamp is not defined by the time we're fetching from postUpdates");
|
|
28884
28920
|
const timestampRanges = getPostUpdateTimestampRange(subIpfs.postUpdates, postTimestamp);
|
|
28885
28921
|
if (timestampRanges.length === 0) throw Error("Post has no timestamp range bucket");
|
|
28886
|
-
const
|
|
28922
|
+
const linkedAbortSignal = this._combinedAbortSignalForRetry();
|
|
28923
|
+
const abortSignal = linkedAbortSignal.signal;
|
|
28887
28924
|
let newCommentUpdate;
|
|
28888
28925
|
try {
|
|
28889
28926
|
if (Object.keys(this._pkc.clients.kuboRpcClients).length > 0 || Object.keys(this._pkc.clients.libp2pJsClients).length > 0) newCommentUpdate = await this._fetchPostCommentUpdateIpfsP2P(subIpfs, timestampRanges, log, abortSignal);
|
|
@@ -28912,6 +28949,8 @@ var CommentClientsManager = class extends PublicationClientsManager {
|
|
|
28912
28949
|
}
|
|
28913
28950
|
}
|
|
28914
28951
|
return;
|
|
28952
|
+
} finally {
|
|
28953
|
+
linkedAbortSignal.dispose();
|
|
28915
28954
|
}
|
|
28916
28955
|
if (newCommentUpdate) this._useLoadedCommentUpdateIfNewInfo(newCommentUpdate, subIpfs, log);
|
|
28917
28956
|
else if (newCommentUpdate === void 0) {
|
|
@@ -30309,6 +30348,7 @@ var Comment = class extends Publication {
|
|
|
30309
30348
|
async stop() {
|
|
30310
30349
|
this._abortStopOperations(`Aborting comment operations for ${this.cid || this.author?.address || "comment"} because comment.stop() was called`);
|
|
30311
30350
|
if (this.state === "publishing") await super.stop();
|
|
30351
|
+
else await this._cancelBackgroundCommunityRefresh();
|
|
30312
30352
|
this._setStateWithEmission("stopped");
|
|
30313
30353
|
await this._stopUpdateLoop();
|
|
30314
30354
|
this.replies._stop();
|
|
@@ -30781,12 +30821,15 @@ var PKCRpcClient = class extends import_lib.TypedEmitter {
|
|
|
30781
30821
|
const serverSubscriptionId = this._serverIdByLocalId.get(subscriptionId) ?? subscriptionId;
|
|
30782
30822
|
this._resubscribeCalls.delete(subscriptionId);
|
|
30783
30823
|
this._publishSubscriptionIds.delete(subscriptionId);
|
|
30784
|
-
|
|
30785
|
-
|
|
30786
|
-
|
|
30787
|
-
|
|
30788
|
-
|
|
30789
|
-
|
|
30824
|
+
try {
|
|
30825
|
+
if (liveOnServer) await this._webSocketClient.call("unsubscribe", [{ subscriptionId: serverSubscriptionId }]);
|
|
30826
|
+
} finally {
|
|
30827
|
+
this._serverIdByLocalId.delete(subscriptionId);
|
|
30828
|
+
this._localIdByServerId.delete(serverSubscriptionId);
|
|
30829
|
+
if (this._subscriptionEvents[subscriptionId]) this._subscriptionEvents[subscriptionId].removeAllListeners();
|
|
30830
|
+
delete this._subscriptionEvents[subscriptionId];
|
|
30831
|
+
delete this._pendingSubscriptionMsgs[subscriptionId];
|
|
30832
|
+
}
|
|
30790
30833
|
}
|
|
30791
30834
|
_attachNotificationHandler() {
|
|
30792
30835
|
const socket = this._webSocketClient.socket;
|
|
@@ -35902,7 +35945,7 @@ var PKC$1 = class extends PKCTypedEmitter {
|
|
|
35902
35945
|
this.clients.libp2pJsClients = {};
|
|
35903
35946
|
if (!this.libp2pJsClientsOptions) return;
|
|
35904
35947
|
if (!this.httpRoutersOptions) throw Error("httpRoutersOptions is required for libp2pJsClient");
|
|
35905
|
-
const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-
|
|
35948
|
+
const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-DpsMZzv8.js");
|
|
35906
35949
|
for (const clientOptions of this.libp2pJsClientsOptions) {
|
|
35907
35950
|
const heliaNode = await createLibp2pJsClientOrUseExistingOne({
|
|
35908
35951
|
...clientOptions,
|
|
@@ -36267,7 +36310,7 @@ var PKC$1 = class extends PKCTypedEmitter {
|
|
|
36267
36310
|
const log = logger_default("pkc-js:pkc:createLocalCommunity");
|
|
36268
36311
|
log.trace("Received community options to create a local community instance:", options);
|
|
36269
36312
|
if (!this._canCreateNewLocalCommunity()) throw new PKCError("ERR_CAN_NOT_CREATE_A_LOCAL_COMMUNITY", { pkcOptions: this._userPKCOptions });
|
|
36270
|
-
const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-
|
|
36313
|
+
const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-DEaDtekb.js");
|
|
36271
36314
|
const isLocalCommunity = (await listCommunitiesSync(this)).includes(options.address);
|
|
36272
36315
|
const community = new LocalCommunity(this);
|
|
36273
36316
|
if (isLocalCommunity) {
|
|
@@ -36635,8 +36678,11 @@ var PKC$1 = class extends PKCTypedEmitter {
|
|
|
36635
36678
|
return this._destroyAbortController.signal;
|
|
36636
36679
|
}
|
|
36637
36680
|
_combineWithDestroyAbortSignal(abortSignal) {
|
|
36638
|
-
const
|
|
36639
|
-
return
|
|
36681
|
+
const linked = linkAbortSignals([abortSignal, this._getDestroyAbortSignal()]);
|
|
36682
|
+
return {
|
|
36683
|
+
signal: linked.signal,
|
|
36684
|
+
dispose: linked.dispose
|
|
36685
|
+
};
|
|
36640
36686
|
}
|
|
36641
36687
|
async destroy() {
|
|
36642
36688
|
const log = logger_default("pkc-js:pkc:destroy");
|
|
@@ -36790,8 +36836,9 @@ var PKCWithRpcClient = class extends PKC$1 {
|
|
|
36790
36836
|
async getComment(getCommentArgs) {
|
|
36791
36837
|
const { abortSignal, ...cidArgs } = getCommentArgs;
|
|
36792
36838
|
const parsedArgs = parseRpcCidParam(cidArgs);
|
|
36839
|
+
const combined = this._combineWithDestroyAbortSignal(abortSignal);
|
|
36793
36840
|
const cancellation = rejectWhenAbortSignalFires({
|
|
36794
|
-
abortSignal:
|
|
36841
|
+
abortSignal: combined.signal,
|
|
36795
36842
|
error: () => new PKCError("ERR_GET_COMMENT_ABORTED", {
|
|
36796
36843
|
getCommentArgs: parsedArgs,
|
|
36797
36844
|
abortReason: abortSignal?.reason
|
|
@@ -36802,6 +36849,7 @@ var PKCWithRpcClient = class extends PKC$1 {
|
|
|
36802
36849
|
commentIpfs = await Promise.race([this._pkcRpcClient.getComment(parsedArgs), cancellation.promise]);
|
|
36803
36850
|
} finally {
|
|
36804
36851
|
cancellation.cleanup();
|
|
36852
|
+
combined.dispose();
|
|
36805
36853
|
}
|
|
36806
36854
|
return this.createComment({
|
|
36807
36855
|
...parsedArgs,
|
|
@@ -36837,7 +36885,7 @@ var PKCWithRpcClient = class extends PKC$1 {
|
|
|
36837
36885
|
if (rawRecord) if ("community" in rawRecord) community.initRpcInternalCommunityAfterFirstUpdateNoMerge(rawRecord);
|
|
36838
36886
|
else community.initRpcInternalCommunityBeforeFirstUpdateNoMerge(rawRecord);
|
|
36839
36887
|
if (jsonified.raw) Object.assign(community.raw, jsonified.raw);
|
|
36840
|
-
await community.
|
|
36888
|
+
await community._loadExportsSnapshot();
|
|
36841
36889
|
return community;
|
|
36842
36890
|
} else if (isCommunityRpcLocal) {
|
|
36843
36891
|
const community = new RpcLocalCommunity(this);
|
|
@@ -36845,9 +36893,10 @@ var PKCWithRpcClient = class extends PKC$1 {
|
|
|
36845
36893
|
const updatePromise = new Promise((resolve) => community.once("update", resolve));
|
|
36846
36894
|
let error;
|
|
36847
36895
|
const errorPromise = new Promise((resolve) => community.once("error", (err) => resolve(error = err)));
|
|
36896
|
+
const combined = this._combineWithDestroyAbortSignal(opts?.abortSignal);
|
|
36848
36897
|
const cancellation = rejectWhenCommunityStopsOrAborts({
|
|
36849
36898
|
community,
|
|
36850
|
-
abortSignal:
|
|
36899
|
+
abortSignal: combined.signal
|
|
36851
36900
|
});
|
|
36852
36901
|
try {
|
|
36853
36902
|
await Promise.race([community._createAndSubscribeToNewUpdatingCommunity(community), cancellation.promise]);
|
|
@@ -36862,10 +36911,11 @@ var PKCWithRpcClient = class extends PKC$1 {
|
|
|
36862
36911
|
throw e;
|
|
36863
36912
|
} finally {
|
|
36864
36913
|
cancellation.cleanup();
|
|
36914
|
+
combined.dispose();
|
|
36865
36915
|
}
|
|
36866
36916
|
await community.stop();
|
|
36867
36917
|
if (error) throw error;
|
|
36868
|
-
await community.
|
|
36918
|
+
await community._loadExportsSnapshot();
|
|
36869
36919
|
return community;
|
|
36870
36920
|
} else {
|
|
36871
36921
|
log.trace("Creating a remote RPC community instance with address", effectiveAddress);
|
|
@@ -36885,7 +36935,7 @@ var PKCWithRpcClient = class extends PKC$1 {
|
|
|
36885
36935
|
await community.initRpcInternalCommunityBeforeFirstUpdateNoMerge(communityPropsAfterCreation);
|
|
36886
36936
|
community.emit("update", community);
|
|
36887
36937
|
await this._awaitCommunitiesToIncludeCommunity(communityPropsAfterCreation.localCommunity.address);
|
|
36888
|
-
await community.
|
|
36938
|
+
await community._loadExportsSnapshot();
|
|
36889
36939
|
return community;
|
|
36890
36940
|
} else throw Error("Failed to create community rpc instance, are you sure you provided the correct args?");
|
|
36891
36941
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { gr as isStringDomain, v as getEquivalentCommunityAddresses, xn as PageSortFileSchema } from "./util-C5RiQF_G.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-Dq_6nnU1.js → rpc-local-community-Br_xomgn.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
|
|
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-C5RiQF_G.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-DY7SvqJA.js";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
7
|
import dns from "node:dns";
|
|
@@ -118106,7 +118106,7 @@ async function moveCommunityDbToDeletedDirectory(communityAddress, pkc) {
|
|
|
118106
118106
|
}
|
|
118107
118107
|
async function createKuboRpcClient(kuboRpcClientOptions) {
|
|
118108
118108
|
logger_default("pkc-js:pkc:createKuboRpcClient").trace("Creating a new kubo client on node with options", kuboRpcClientOptions);
|
|
118109
|
-
const { create: CreateKuboRpcClient } = await import("./src-
|
|
118109
|
+
const { create: CreateKuboRpcClient } = await import("./src-ltPxiZKf.js");
|
|
118110
118110
|
const Agent$2 = typeof kuboRpcClientOptions.url === "string" && kuboRpcClientOptions.url.startsWith("https") || kuboRpcClientOptions?.protocol === "https" || kuboRpcClientOptions.url instanceof URL && kuboRpcClientOptions?.url?.protocol === "https:" || kuboRpcClientOptions.url?.toString()?.includes("https") ? Agent : Agent$1;
|
|
118111
118111
|
const onehourMs = 1e3 * 60 * 60;
|
|
118112
118112
|
return CreateKuboRpcClient({
|
|
@@ -148259,7 +148259,8 @@ var BaseClientsManager = class BaseClientsManager {
|
|
|
148259
148259
|
}
|
|
148260
148260
|
}
|
|
148261
148261
|
async pubsubUnsubscribe(pubsubTopic, handler) {
|
|
148262
|
-
|
|
148262
|
+
const libp2pJsProvidersWithTopic = t$13(this._pkc.clients.libp2pJsClients).filter((key) => this.pubsubProviderSubscriptions[key]?.includes(pubsubTopic));
|
|
148263
|
+
for (const pubsubProviderUrl of [...t$13(this._pkc.clients.pubsubKuboRpcClients), ...libp2pJsProvidersWithTopic]) try {
|
|
148263
148264
|
await this.pubsubUnsubscribeOnProvider(pubsubTopic, pubsubProviderUrl, handler);
|
|
148264
148265
|
} catch (e) {
|
|
148265
148266
|
await this._pkc._stats.recordGatewayFailure(pubsubProviderUrl, "pubsub-unsubscribe");
|
|
@@ -149782,10 +149783,24 @@ var BasePagesClientsManager = class extends BaseClientsManager {
|
|
|
149782
149783
|
const isFirstPage = Object.values(this._pages.pageCids).includes(pageCid) || e$5(this._pages.pageCids);
|
|
149783
149784
|
const pageMaxSize = opts.pageMaxSize ? opts.pageMaxSize : this._pkc._memCaches.pagesMaxSize.get(this._calculatePageMaxSizeCacheKey(pageCid)) ? this._pkc._memCaches.pagesMaxSize.get(this._calculatePageMaxSizeCacheKey(pageCid)) : isFirstPage ? 1024 * 1024 : void 0;
|
|
149784
149785
|
if (!pageMaxSize) throw Error("Failed to calculate max page size. Is this page cid under the correct community/comment?");
|
|
149785
|
-
const
|
|
149786
|
-
const
|
|
149787
|
-
|
|
149788
|
-
|
|
149786
|
+
const linked = linkAbortSignals([opts.abortSignal, this._pkc._getDestroyAbortSignal()]);
|
|
149787
|
+
const combinedSignal = linked.signal;
|
|
149788
|
+
try {
|
|
149789
|
+
throwIfAbortSignalAborted(combinedSignal);
|
|
149790
|
+
return await this._fetchPageAfterSignalCombined({
|
|
149791
|
+
pageCid,
|
|
149792
|
+
log,
|
|
149793
|
+
pageMaxSize,
|
|
149794
|
+
isFirstPage,
|
|
149795
|
+
sortTypesFromPageCids,
|
|
149796
|
+
sortTypesFromMemcache,
|
|
149797
|
+
combinedSignal
|
|
149798
|
+
});
|
|
149799
|
+
} finally {
|
|
149800
|
+
linked.dispose();
|
|
149801
|
+
}
|
|
149802
|
+
}
|
|
149803
|
+
async _fetchPageAfterSignalCombined({ pageCid, log, pageMaxSize, isFirstPage, sortTypesFromPageCids, sortTypesFromMemcache, combinedSignal }) {
|
|
149789
149804
|
let result;
|
|
149790
149805
|
try {
|
|
149791
149806
|
if (this._pkc._pkcRpcClient) result = await this._fetchPageWithRpc({
|
|
@@ -155371,6 +155386,7 @@ function computePageSortsFingerprint({ pagesSettings, resolved, factories }) {
|
|
|
155371
155386
|
}) ?? "");
|
|
155372
155387
|
}
|
|
155373
155388
|
const describePageSort = (pageSortSettings) => pageSortSettings.name || pageSortSettings.path || "unknown page sort";
|
|
155389
|
+
const resolveSortName = ({ pageSortSettings, file }) => pageSortSettings.sortName ?? file.sortName;
|
|
155374
155390
|
async function loadPageSortFile({ pageSortSettings, pkc }) {
|
|
155375
155391
|
let factory;
|
|
155376
155392
|
try {
|
|
@@ -155415,11 +155431,15 @@ function withoutRemovedPageSortSettingOptions(pageSortSettings) {
|
|
|
155415
155431
|
};
|
|
155416
155432
|
}
|
|
155417
155433
|
function resolveOneEntry({ pageSortSettings, file, scope, pageSortIndex }) {
|
|
155434
|
+
const sortName = resolveSortName({
|
|
155435
|
+
pageSortSettings,
|
|
155436
|
+
file
|
|
155437
|
+
});
|
|
155418
155438
|
const baseDetails = {
|
|
155419
155439
|
scope,
|
|
155420
155440
|
pageSortIndex,
|
|
155421
155441
|
pageSortName: describePageSort(pageSortSettings),
|
|
155422
|
-
sortName
|
|
155442
|
+
sortName
|
|
155423
155443
|
};
|
|
155424
155444
|
const entryOptions = pageSortSettings.options ?? {};
|
|
155425
155445
|
if (file.scope && file.scope !== scope) return { error: new PKCError("ERR_PAGE_SORT_SCOPE_MISMATCH", {
|
|
@@ -155476,7 +155496,7 @@ function resolveOneEntry({ pageSortSettings, file, scope, pageSortIndex }) {
|
|
|
155476
155496
|
}
|
|
155477
155497
|
return { resolved: {
|
|
155478
155498
|
...reserved,
|
|
155479
|
-
sortName
|
|
155499
|
+
sortName,
|
|
155480
155500
|
scope,
|
|
155481
155501
|
file,
|
|
155482
155502
|
settings: pageSortSettings,
|
|
@@ -155512,7 +155532,11 @@ async function resolvePageSortsAndCollectFailures({ pagesSettings, pkc, tolerate
|
|
|
155512
155532
|
});
|
|
155513
155533
|
continue;
|
|
155514
155534
|
}
|
|
155515
|
-
|
|
155535
|
+
const sortName = resolveSortName({
|
|
155536
|
+
pageSortSettings,
|
|
155537
|
+
file
|
|
155538
|
+
});
|
|
155539
|
+
if (seenSortNames.has(sortName)) {
|
|
155516
155540
|
failures.push({
|
|
155517
155541
|
scope,
|
|
155518
155542
|
pageSortIndex,
|
|
@@ -155521,12 +155545,12 @@ async function resolvePageSortsAndCollectFailures({ pagesSettings, pkc, tolerate
|
|
|
155521
155545
|
scope,
|
|
155522
155546
|
pageSortIndex,
|
|
155523
155547
|
pageSortName,
|
|
155524
|
-
sortName
|
|
155548
|
+
sortName
|
|
155525
155549
|
})
|
|
155526
155550
|
});
|
|
155527
155551
|
continue;
|
|
155528
155552
|
}
|
|
155529
|
-
seenSortNames.add(
|
|
155553
|
+
seenSortNames.add(sortName);
|
|
155530
155554
|
const result = resolveOneEntry({
|
|
155531
155555
|
pageSortSettings,
|
|
155532
155556
|
file,
|
|
@@ -155910,12 +155934,19 @@ function cloneExportRecord(record) {
|
|
|
155910
155934
|
...record.error ? { error: { ...record.error } } : {}
|
|
155911
155935
|
};
|
|
155912
155936
|
}
|
|
155937
|
+
function isTerminalExportRecord(record) {
|
|
155938
|
+
return record.progress === 1 || Boolean(record.error);
|
|
155939
|
+
}
|
|
155913
155940
|
var RpcLocalCommunity = class extends RpcRemoteCommunity {
|
|
155914
155941
|
constructor(pkc) {
|
|
155915
155942
|
super(pkc);
|
|
155916
155943
|
this.raw = {};
|
|
155917
155944
|
this._startRpcSubscriptionId = void 0;
|
|
155918
155945
|
this._exportsSubscriptionId = void 0;
|
|
155946
|
+
this._exportsSubscriptionManaged = false;
|
|
155947
|
+
this._exportsSubscriptionSyncQueue = Promise.resolve();
|
|
155948
|
+
this._pendingExportCalls = 0;
|
|
155949
|
+
this._inFlightExportIds = /* @__PURE__ */ new Set();
|
|
155919
155950
|
this._exportsCache = [];
|
|
155920
155951
|
this._exportSignalDetachers = /* @__PURE__ */ new Map();
|
|
155921
155952
|
this.started = false;
|
|
@@ -155926,6 +155957,13 @@ var RpcLocalCommunity = class extends RpcRemoteCommunity {
|
|
|
155926
155957
|
this.on("update", () => {
|
|
155927
155958
|
this.editable = t$2(this, t$13(CommunityEditOptionsSchema.shape));
|
|
155928
155959
|
});
|
|
155960
|
+
this.on("statechange", () => this._scheduleExportsSubscriptionSync());
|
|
155961
|
+
const emitter = this;
|
|
155962
|
+
const onListenerChange = (eventName) => {
|
|
155963
|
+
if (eventName === "exportschange") this._scheduleExportsSubscriptionSync();
|
|
155964
|
+
};
|
|
155965
|
+
emitter.on("newListener", onListenerChange);
|
|
155966
|
+
emitter.on("removeListener", onListenerChange);
|
|
155929
155967
|
hideClassPrivateProps(this);
|
|
155930
155968
|
}
|
|
155931
155969
|
toJSONInternalRpcAfterFirstUpdate() {
|
|
@@ -156116,6 +156154,7 @@ var RpcLocalCommunity = class extends RpcRemoteCommunity {
|
|
|
156116
156154
|
this._setRpcClientStateWithEmission("stopped");
|
|
156117
156155
|
this.started = false;
|
|
156118
156156
|
untrackStartedCommunity(this._pkc, this);
|
|
156157
|
+
await this._releaseExportsSubscriptionIfUnneeded();
|
|
156119
156158
|
}
|
|
156120
156159
|
async prepareAnchorPublish() {
|
|
156121
156160
|
return this._pkc._pkcRpcClient.prepareAnchorPublish({
|
|
@@ -156133,6 +156172,17 @@ var RpcLocalCommunity = class extends RpcRemoteCommunity {
|
|
|
156133
156172
|
return result;
|
|
156134
156173
|
}
|
|
156135
156174
|
async stop() {
|
|
156175
|
+
await this._stopRunOrUpdate();
|
|
156176
|
+
await this._releaseExportsSubscriptionIfUnneeded();
|
|
156177
|
+
}
|
|
156178
|
+
async _releaseExportsSubscriptionIfUnneeded() {
|
|
156179
|
+
try {
|
|
156180
|
+
await this._syncExportsSubscription();
|
|
156181
|
+
} catch (e) {
|
|
156182
|
+
logger_default("pkc-js:rpc-local-community:exports").error("Failed to sync the exports subscription on stop", this.address, e);
|
|
156183
|
+
}
|
|
156184
|
+
}
|
|
156185
|
+
async _stopRunOrUpdate() {
|
|
156136
156186
|
this.posts._stop();
|
|
156137
156187
|
if (this.state === "updating") return super.stop();
|
|
156138
156188
|
else if (this.state === "started") {
|
|
@@ -156188,12 +156238,24 @@ var RpcLocalCommunity = class extends RpcRemoteCommunity {
|
|
|
156188
156238
|
async export(options = {}) {
|
|
156189
156239
|
if (options.exportPath !== void 0) throw new PKCError("ERR_EXPORT_PATH_NOT_SUPPORTED_OVER_RPC", { address: this.address });
|
|
156190
156240
|
if (options.signal?.aborted) throw options.signal.reason ?? new DOMException("The operation was aborted.", "AbortError");
|
|
156191
|
-
|
|
156192
|
-
|
|
156193
|
-
|
|
156194
|
-
|
|
156195
|
-
|
|
156196
|
-
|
|
156241
|
+
this._pendingExportCalls++;
|
|
156242
|
+
let exportId;
|
|
156243
|
+
let alreadyTerminal = false;
|
|
156244
|
+
try {
|
|
156245
|
+
await this._syncExportsSubscription();
|
|
156246
|
+
({exportId} = await this._pkc._pkcRpcClient.exportCommunity({
|
|
156247
|
+
name: this.name,
|
|
156248
|
+
publicKey: this.publicKey,
|
|
156249
|
+
includePrivateKey: options.includePrivateKey
|
|
156250
|
+
}));
|
|
156251
|
+
const knownRecord = this._exportsCache.find((rec) => rec.exportId === exportId);
|
|
156252
|
+
alreadyTerminal = knownRecord !== void 0 && isTerminalExportRecord(knownRecord);
|
|
156253
|
+
if (!alreadyTerminal) this._inFlightExportIds.add(exportId);
|
|
156254
|
+
} finally {
|
|
156255
|
+
this._pendingExportCalls--;
|
|
156256
|
+
this._scheduleExportsSubscriptionSync();
|
|
156257
|
+
}
|
|
156258
|
+
if (options.signal && !alreadyTerminal) {
|
|
156197
156259
|
const userSignal = options.signal;
|
|
156198
156260
|
const onAbort = () => {
|
|
156199
156261
|
this._pkc._pkcRpcClient.cancelExport({ exportId }).catch((e) => {
|
|
@@ -156215,6 +156277,38 @@ var RpcLocalCommunity = class extends RpcRemoteCommunity {
|
|
|
156215
156277
|
...opts
|
|
156216
156278
|
});
|
|
156217
156279
|
}
|
|
156280
|
+
async _loadExportsSnapshot() {
|
|
156281
|
+
this._exportsSubscriptionManaged = true;
|
|
156282
|
+
await this._syncExportsSubscription({ loadSnapshot: true });
|
|
156283
|
+
}
|
|
156284
|
+
_needsLiveExports() {
|
|
156285
|
+
if (this._pkc.destroyed) return false;
|
|
156286
|
+
return this.state !== "stopped" || this._pendingExportCalls > 0 || this._inFlightExportIds.size > 0 || this.listenerCount("exportschange") > 0;
|
|
156287
|
+
}
|
|
156288
|
+
_syncExportsSubscription(opts) {
|
|
156289
|
+
const run = async () => {
|
|
156290
|
+
if (!this._exportsSubscriptionManaged) return;
|
|
156291
|
+
if ((this._needsLiveExports() || opts?.loadSnapshot) && this._exportsSubscriptionId === void 0 && !this._pkc.destroyed) await this._attachExportsSubscription();
|
|
156292
|
+
if (!this._needsLiveExports() && this._exportsSubscriptionId !== void 0) await this._detachExportsSubscription();
|
|
156293
|
+
};
|
|
156294
|
+
const result = this._exportsSubscriptionSyncQueue.then(run);
|
|
156295
|
+
this._exportsSubscriptionSyncQueue = result.catch(() => void 0);
|
|
156296
|
+
return result;
|
|
156297
|
+
}
|
|
156298
|
+
_scheduleExportsSubscriptionSync() {
|
|
156299
|
+
if (!this._exportsSubscriptionManaged) return;
|
|
156300
|
+
this._syncExportsSubscription().catch((e) => logger_default("pkc-js:rpc-local-community:exports").error("Failed to sync the exports subscription", this.address, e));
|
|
156301
|
+
}
|
|
156302
|
+
async _detachExportsSubscription() {
|
|
156303
|
+
const subscriptionId = this._exportsSubscriptionId;
|
|
156304
|
+
this._exportsSubscriptionId = void 0;
|
|
156305
|
+
if (subscriptionId === void 0) return;
|
|
156306
|
+
try {
|
|
156307
|
+
await this._pkc._pkcRpcClient.unsubscribe(subscriptionId);
|
|
156308
|
+
} catch (e) {
|
|
156309
|
+
logger_default("pkc-js:rpc-local-community:exports").error("Failed to unsubscribe from exportsSubscribe", this.address, e);
|
|
156310
|
+
}
|
|
156311
|
+
}
|
|
156218
156312
|
async _attachExportsSubscription() {
|
|
156219
156313
|
if (this._exportsSubscriptionId !== void 0) return;
|
|
156220
156314
|
if (!this._pkc._pkcRpcClient) return;
|
|
@@ -156246,7 +156340,12 @@ var RpcLocalCommunity = class extends RpcRemoteCommunity {
|
|
|
156246
156340
|
}
|
|
156247
156341
|
});
|
|
156248
156342
|
this._pkc._pkcRpcClient.emitAllPendingMessages(subscriptionId);
|
|
156249
|
-
|
|
156343
|
+
try {
|
|
156344
|
+
await initialReceived;
|
|
156345
|
+
} catch (e) {
|
|
156346
|
+
if (this._exportsSubscriptionId === subscriptionId) await this._detachExportsSubscription();
|
|
156347
|
+
throw e;
|
|
156348
|
+
}
|
|
156250
156349
|
}
|
|
156251
156350
|
_absorbExportRecords(wireRecords) {
|
|
156252
156351
|
const httpOrigin = this._pkc._pkcRpcClient.rpcHttpOrigin;
|
|
@@ -156264,7 +156363,16 @@ var RpcLocalCommunity = class extends RpcRemoteCommunity {
|
|
|
156264
156363
|
this._exportSignalDetachers.delete(rec.exportId);
|
|
156265
156364
|
}
|
|
156266
156365
|
}
|
|
156366
|
+
let inFlightChanged = false;
|
|
156367
|
+
for (const exportId of [...this._inFlightExportIds]) {
|
|
156368
|
+
const rec = wireRecords.find((r) => r.exportId === exportId);
|
|
156369
|
+
if (!rec || isTerminalExportRecord(rec)) {
|
|
156370
|
+
this._inFlightExportIds.delete(exportId);
|
|
156371
|
+
inFlightChanged = true;
|
|
156372
|
+
}
|
|
156373
|
+
}
|
|
156267
156374
|
this.emit("exportschange", this._exportsCache.map(cloneExportRecord));
|
|
156375
|
+
if (inFlightChanged) this._scheduleExportsSubscriptionSync();
|
|
156268
156376
|
}
|
|
156269
156377
|
async delete() {
|
|
156270
156378
|
const startedCommunity = findStartedCommunity(this._pkc, {
|