@pkcprotocol/pkc-js 0.0.63 → 0.0.65
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/dist/browser/clients/base-client-manager.js +14 -14
- package/dist/browser/clients/base-client-manager.js.map +1 -1
- package/dist/browser/community/community-client-manager.js +9 -11
- package/dist/browser/community/community-client-manager.js.map +1 -1
- package/dist/browser/community/community-gateway-selection.js +4 -4
- package/dist/browser/community/community-gateway-selection.js.map +1 -1
- package/dist/browser/community/community-wire.js +3 -3
- package/dist/browser/community/community-wire.js.map +1 -1
- package/dist/browser/community/remote-community.d.ts +1 -1
- package/dist/browser/community/remote-community.js +10 -7
- package/dist/browser/community/remote-community.js.map +1 -1
- package/dist/browser/community/rpc-local-community.js +3 -3
- package/dist/browser/community/rpc-local-community.js.map +1 -1
- package/dist/browser/community/rpc-remote-community.js +5 -5
- package/dist/browser/community/rpc-remote-community.js.map +1 -1
- package/dist/browser/community/schema.js +5 -5
- package/dist/browser/community/schema.js.map +1 -1
- package/dist/browser/errors.d.ts +1 -0
- package/dist/browser/errors.js +1 -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 +52 -6
- package/dist/browser/helia/helia-for-pkc.js.map +1 -1
- package/dist/browser/helia/types.d.ts +2 -0
- package/dist/browser/helia/util.d.ts +18 -0
- package/dist/browser/helia/util.js +123 -0
- package/dist/browser/helia/util.js.map +1 -1
- package/dist/browser/pages/pages-client-manager.js +11 -15
- package/dist/browser/pages/pages-client-manager.js.map +1 -1
- package/dist/browser/pages/util.js +9 -9
- package/dist/browser/pages/util.js.map +1 -1
- package/dist/browser/pkc/pkc-client-manager.js +6 -6
- package/dist/browser/pkc/pkc-client-manager.js.map +1 -1
- package/dist/browser/pkc/pkc.js +7 -7
- package/dist/browser/pkc/pkc.js.map +1 -1
- package/dist/browser/pkc-error.d.ts +1 -1
- package/dist/browser/publications/comment/comment-client-manager.js +5 -5
- package/dist/browser/publications/comment/comment-client-manager.js.map +1 -1
- package/dist/browser/publications/comment/comment.js +15 -15
- package/dist/browser/publications/comment/comment.js.map +1 -1
- package/dist/browser/publications/comment/schema.js +17 -17
- package/dist/browser/publications/comment/schema.js.map +1 -1
- package/dist/browser/publications/comment-edit/schema.js +7 -7
- package/dist/browser/publications/comment-edit/schema.js.map +1 -1
- package/dist/browser/publications/comment-moderation/schema.js +11 -7
- package/dist/browser/publications/comment-moderation/schema.js.map +1 -1
- package/dist/browser/publications/community-edit/schema.js +6 -6
- package/dist/browser/publications/community-edit/schema.js.map +1 -1
- package/dist/browser/publications/publication-author.js +3 -3
- package/dist/browser/publications/publication-author.js.map +1 -1
- package/dist/browser/publications/publication-client-manager.js +4 -4
- package/dist/browser/publications/publication-client-manager.js.map +1 -1
- package/dist/browser/publications/publication.js +9 -9
- package/dist/browser/publications/publication.js.map +1 -1
- package/dist/browser/publications/vote/schema.js +11 -7
- package/dist/browser/publications/vote/schema.js.map +1 -1
- package/dist/browser/publications/vote/vote.js.map +1 -1
- package/dist/browser/pubsub-messages/schema.js +5 -5
- package/dist/browser/pubsub-messages/schema.js.map +1 -1
- package/dist/browser/rpc/src/index.js +12 -12
- package/dist/browser/rpc/src/index.js.map +1 -1
- package/dist/browser/runtime/browser/localforage-lru.js +2 -2
- package/dist/browser/runtime/browser/localforage-lru.js.map +1 -1
- package/dist/browser/runtime/node/addresses-rewriter-proxy-server.js +3 -3
- package/dist/browser/runtime/node/addresses-rewriter-proxy-server.js.map +1 -1
- package/dist/browser/runtime/node/community/challenges/index.js +3 -3
- package/dist/browser/runtime/node/community/challenges/index.js.map +1 -1
- package/dist/browser/runtime/node/community/challenges/pkc-js-challenges/publication-match.js +4 -4
- package/dist/browser/runtime/node/community/challenges/pkc-js-challenges/publication-match.js.map +1 -1
- package/dist/browser/runtime/node/community/db-handler.js +32 -32
- package/dist/browser/runtime/node/community/db-handler.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community/challenges.js +7 -7
- package/dist/browser/runtime/node/community/local-community/challenges.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community/comment-updates.js +5 -5
- package/dist/browser/runtime/node/community/local-community/comment-updates.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community/db-state.js +8 -8
- package/dist/browser/runtime/node/community/local-community/db-state.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community/editing.js +6 -6
- package/dist/browser/runtime/node/community/local-community/editing.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community/ipns-publishing.js +10 -7
- package/dist/browser/runtime/node/community/local-community/ipns-publishing.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community/lifecycle.js +4 -4
- package/dist/browser/runtime/node/community/local-community/lifecycle.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community/publication-store.js +13 -19
- package/dist/browser/runtime/node/community/local-community/publication-store.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community/publication-validation.js +10 -10
- package/dist/browser/runtime/node/community/local-community/publication-validation.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community/reprovide-on-address-change.js +5 -5
- package/dist/browser/runtime/node/community/local-community/reprovide-on-address-change.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community.js +7 -7
- package/dist/browser/runtime/node/community/local-community.js.map +1 -1
- package/dist/browser/runtime/node/community/page-generator.js +5 -7
- package/dist/browser/runtime/node/community/page-generator.js.map +1 -1
- package/dist/browser/runtime/node/setup-kubo-address-rewriter-and-http-router.js +2 -2
- package/dist/browser/runtime/node/setup-kubo-address-rewriter-and-http-router.js.map +1 -1
- package/dist/browser/runtime/node/sqlite-lru-cache.js +2 -2
- package/dist/browser/runtime/node/sqlite-lru-cache.js.map +1 -1
- package/dist/browser/runtime/node/util.js +8 -6
- package/dist/browser/runtime/node/util.js.map +1 -1
- package/dist/browser/schema/schema.js +3 -3
- package/dist/browser/schema/schema.js.map +1 -1
- package/dist/browser/signer/constants.d.ts +1 -2
- package/dist/browser/signer/constants.js +9 -1
- package/dist/browser/signer/constants.js.map +1 -1
- package/dist/browser/signer/signatures.js +14 -12
- package/dist/browser/signer/signatures.js.map +1 -1
- package/dist/browser/stats.js +5 -5
- package/dist/browser/stats.js.map +1 -1
- package/dist/browser/test/test-util.d.ts +9 -10
- package/dist/browser/test/test-util.js +25 -37
- package/dist/browser/test/test-util.js.map +1 -1
- package/dist/browser/util.js +18 -17
- package/dist/browser/util.js.map +1 -1
- package/dist/bundled/bundle-manifest.json +61 -190
- package/dist/bundled/chunks/{helia-for-pkc-C6vMsrJ-.js → helia-for-pkc-h-rjuHh7.js} +46 -3
- package/dist/bundled/chunks/{local-community-BQmiwsV4.js → local-community-DEWf2apw.js} +170 -121
- package/dist/bundled/chunks/{local-community-BoIoFZHk.js → local-community-DdDpaZqk.js} +1 -1
- package/dist/bundled/chunks/{node-G40jxRL2.js → node-CrnvA79m.js} +40 -37
- package/dist/bundled/chunks/{rpc-local-community-D4-NEPJb.js → rpc-local-community-CpN6R3ZN.js} +337 -108
- package/dist/bundled/chunks/{schema-SPGmy_14.js → schema-Db4geGeo.js} +248 -3900
- package/dist/bundled/chunks/{util-CJ6nXIW9.js → util-DrHyKxFe.js} +98 -2
- package/dist/bundled/index.js +1 -1
- package/dist/bundled/rpc/src/index.js +18 -22
- package/dist/node/clients/base-client-manager.js +14 -14
- package/dist/node/clients/base-client-manager.js.map +1 -1
- package/dist/node/community/community-client-manager.js +9 -11
- package/dist/node/community/community-client-manager.js.map +1 -1
- package/dist/node/community/community-gateway-selection.js +4 -4
- package/dist/node/community/community-gateway-selection.js.map +1 -1
- package/dist/node/community/community-wire.js +3 -3
- package/dist/node/community/community-wire.js.map +1 -1
- package/dist/node/community/remote-community.d.ts +1 -1
- package/dist/node/community/remote-community.js +10 -7
- package/dist/node/community/remote-community.js.map +1 -1
- package/dist/node/community/rpc-local-community.js +3 -3
- package/dist/node/community/rpc-local-community.js.map +1 -1
- package/dist/node/community/rpc-remote-community.js +5 -5
- package/dist/node/community/rpc-remote-community.js.map +1 -1
- package/dist/node/community/schema.js +5 -5
- package/dist/node/community/schema.js.map +1 -1
- package/dist/node/errors.d.ts +1 -0
- package/dist/node/errors.js +1 -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 +52 -6
- package/dist/node/helia/helia-for-pkc.js.map +1 -1
- package/dist/node/helia/types.d.ts +2 -0
- package/dist/node/helia/util.d.ts +18 -0
- package/dist/node/helia/util.js +123 -0
- package/dist/node/helia/util.js.map +1 -1
- package/dist/node/pages/pages-client-manager.js +11 -15
- package/dist/node/pages/pages-client-manager.js.map +1 -1
- package/dist/node/pages/util.js +9 -9
- package/dist/node/pages/util.js.map +1 -1
- package/dist/node/pkc/pkc-client-manager.js +6 -6
- package/dist/node/pkc/pkc-client-manager.js.map +1 -1
- package/dist/node/pkc/pkc.js +7 -7
- package/dist/node/pkc/pkc.js.map +1 -1
- package/dist/node/pkc-error.d.ts +1 -1
- package/dist/node/publications/comment/comment-client-manager.js +5 -5
- package/dist/node/publications/comment/comment-client-manager.js.map +1 -1
- package/dist/node/publications/comment/comment.js +15 -15
- package/dist/node/publications/comment/comment.js.map +1 -1
- package/dist/node/publications/comment/schema.js +17 -17
- package/dist/node/publications/comment/schema.js.map +1 -1
- package/dist/node/publications/comment-edit/schema.js +7 -7
- package/dist/node/publications/comment-edit/schema.js.map +1 -1
- package/dist/node/publications/comment-moderation/schema.js +11 -7
- package/dist/node/publications/comment-moderation/schema.js.map +1 -1
- package/dist/node/publications/community-edit/schema.js +6 -6
- package/dist/node/publications/community-edit/schema.js.map +1 -1
- package/dist/node/publications/publication-author.js +3 -3
- package/dist/node/publications/publication-author.js.map +1 -1
- package/dist/node/publications/publication-client-manager.js +4 -4
- package/dist/node/publications/publication-client-manager.js.map +1 -1
- package/dist/node/publications/publication.js +9 -9
- package/dist/node/publications/publication.js.map +1 -1
- package/dist/node/publications/vote/schema.js +11 -7
- package/dist/node/publications/vote/schema.js.map +1 -1
- package/dist/node/publications/vote/vote.js.map +1 -1
- package/dist/node/pubsub-messages/schema.js +5 -5
- package/dist/node/pubsub-messages/schema.js.map +1 -1
- package/dist/node/rpc/src/index.js +12 -12
- package/dist/node/rpc/src/index.js.map +1 -1
- package/dist/node/runtime/browser/localforage-lru.js +2 -2
- package/dist/node/runtime/browser/localforage-lru.js.map +1 -1
- package/dist/node/runtime/node/addresses-rewriter-proxy-server.js +3 -3
- package/dist/node/runtime/node/addresses-rewriter-proxy-server.js.map +1 -1
- package/dist/node/runtime/node/community/challenges/index.js +3 -3
- package/dist/node/runtime/node/community/challenges/index.js.map +1 -1
- package/dist/node/runtime/node/community/challenges/pkc-js-challenges/publication-match.js +4 -4
- package/dist/node/runtime/node/community/challenges/pkc-js-challenges/publication-match.js.map +1 -1
- package/dist/node/runtime/node/community/db-handler.js +32 -32
- package/dist/node/runtime/node/community/db-handler.js.map +1 -1
- package/dist/node/runtime/node/community/local-community/challenges.js +7 -7
- package/dist/node/runtime/node/community/local-community/challenges.js.map +1 -1
- package/dist/node/runtime/node/community/local-community/comment-updates.js +5 -5
- package/dist/node/runtime/node/community/local-community/comment-updates.js.map +1 -1
- package/dist/node/runtime/node/community/local-community/db-state.js +8 -8
- package/dist/node/runtime/node/community/local-community/db-state.js.map +1 -1
- package/dist/node/runtime/node/community/local-community/editing.js +6 -6
- package/dist/node/runtime/node/community/local-community/editing.js.map +1 -1
- package/dist/node/runtime/node/community/local-community/ipns-publishing.js +10 -7
- package/dist/node/runtime/node/community/local-community/ipns-publishing.js.map +1 -1
- package/dist/node/runtime/node/community/local-community/lifecycle.js +4 -4
- package/dist/node/runtime/node/community/local-community/lifecycle.js.map +1 -1
- package/dist/node/runtime/node/community/local-community/publication-store.js +13 -19
- package/dist/node/runtime/node/community/local-community/publication-store.js.map +1 -1
- package/dist/node/runtime/node/community/local-community/publication-validation.js +10 -10
- package/dist/node/runtime/node/community/local-community/publication-validation.js.map +1 -1
- package/dist/node/runtime/node/community/local-community/reprovide-on-address-change.js +5 -5
- package/dist/node/runtime/node/community/local-community/reprovide-on-address-change.js.map +1 -1
- package/dist/node/runtime/node/community/local-community.js +7 -7
- package/dist/node/runtime/node/community/local-community.js.map +1 -1
- package/dist/node/runtime/node/community/page-generator.js +5 -7
- package/dist/node/runtime/node/community/page-generator.js.map +1 -1
- package/dist/node/runtime/node/setup-kubo-address-rewriter-and-http-router.js +2 -2
- package/dist/node/runtime/node/setup-kubo-address-rewriter-and-http-router.js.map +1 -1
- package/dist/node/runtime/node/sqlite-lru-cache.js +2 -2
- package/dist/node/runtime/node/sqlite-lru-cache.js.map +1 -1
- package/dist/node/runtime/node/util.js +8 -6
- package/dist/node/runtime/node/util.js.map +1 -1
- package/dist/node/schema/schema.js +3 -3
- package/dist/node/schema/schema.js.map +1 -1
- package/dist/node/signer/constants.d.ts +1 -2
- package/dist/node/signer/constants.js +9 -1
- package/dist/node/signer/constants.js.map +1 -1
- package/dist/node/signer/signatures.js +14 -12
- package/dist/node/signer/signatures.js.map +1 -1
- package/dist/node/stats.js +5 -5
- package/dist/node/stats.js.map +1 -1
- package/dist/node/test/test-util.d.ts +9 -10
- package/dist/node/test/test-util.js +25 -37
- package/dist/node/test/test-util.js.map +1 -1
- package/dist/node/util.js +18 -17
- package/dist/node/util.js.map +1 -1
- package/package.json +2 -2
package/dist/bundled/chunks/{rpc-local-community-D4-NEPJb.js → rpc-local-community-CpN6R3ZN.js}
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { i as __toESM, n as __exportAll, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
|
|
2
|
-
import { $ as pubsubTopicToDhtKey, $
|
|
2
|
+
import { $ as pubsubTopicToDhtKey, $t as CommunityEditOptionsSchema, A as extractNetworkErrorDetails, An as CreateCommentOptionsWithRefinementSchema, Ar as record, At as trackStartedCommunity, B as isIpfsCid, Bn as CreateCommentEditOptionsWithRefinementSchema, Cr as _enum, Ct as findUpdatingCommunity, D as deepMergeRuntimeFields, Dn as CommentUpdateSignedPropertyNames, Dr as literal, E as createAbortError, En as CommentUpdateSchema, Er as custom, Et as listUpdatingCommunities, Ft as untrackUpdatingCommunity, Gn as CidPathSchema, Gt as CommentModerationPubsubMessagePublicationSchema, H as isIpns, Hn as AuthorCommentIpfsReservedFields, Ht as CommunityEditPubsubMessagePublicationSchema, I as getPostUpdateTimestampRange, In as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, It as require_sha256$1, Jn as CommunityAuthorChallengeReservedFieldNames, Jt as CommentModerationsTableRowSchema, Kn as CidStringSchema, L as hideClassPrivateProps, Mn as ModQueuePageIpfsSchema, Mt as trackUpdatingCommunity, Nn as PageIpfsSchema, Nt as untrackStartedCommunity, O as derivePublicationFromChallengeRequest, Or as number, Ot as refreshTrackedCommunityAliases, Pn as CommentEditChallengeRequestToEncryptSchema, Q as isStringDomain, Qn as n$9, Qt as CommunityChallengeSettingSchema, R as ipnsNameToIpnsOverPubsubTopic, Rn as CommentEditSignedPropertyNames, Rt as pTimeout, Sn as CommentUpdateChallengeReservedFieldNames, St as findUpdatingComment, Tn as CommentUpdateReservedFields, Tr as boolean, U as isIpnsPath, Ut as CreateCommunityEditPublicationOptionsWithRefinementSchema, V as isIpfsPath, Vn as AuthorAddressSchema, Vt as CommunityEditPublicationSignedPropertyNames, Wn as ChallengeAnswersSchema, Wt as CommentModerationChallengeRequestToEncryptSchema, X as isRequestPubsubPublicationOfPost, Xn as n$10, Xt as ChallengeFileFactorySchema, Yn as CreateSignerSchema, Yt as CreateCommentModerationOptionsWithRefinementSchema, Z as isRequestPubsubPublicationOfReply, Zt as ChallengeFileSchema, _ as PKCUserOptionBaseSchema, _n as CommentIpfsReservedFields, _r as PKCError, _t as timestamp, an as CreateRemoteCommunityFunctionArgumentSchema, ar as t$12, b as areEquivalentCommunityAddresses, bn as CommentPubsubMessageWithFlexibleAuthorRefinementSchema, br as require_supports_color, c as ChallengeVerificationMessageSignedPropertyNames, cr as t$10, ct as resolveWhenPredicateIsTrue, dn as VoteChallengeRequestToEncryptSchema, dr as require_retry$1, en as CommunityExportRecordsSchema, er as t$13, f as DecryptedChallengeSchema, fn as VotePubsubMessagePublicationSchema, fr as FailedToFetchCommentIpfsFromGatewaysError, ft as shortifyAddress, g as PKCParsedOptionsSchema, gn as CommentChallengeRequestToEncryptSchema, gr as FailedToFetchPageIpfsFromGatewaysError, gt as throwIfAbortSignalAborted, h as NameResolverSerializedSchema, hr as FailedToFetchGenericIpfsFromGatewaysError, i as ChallengeMessageSignedPropertyNames, in as CreateNewLocalCommunityUserOptionsSchema, ir as r$8, it as removeNullUndefinedEmptyObjectsValuesRecursively, j as fetchAndValidateIpnsRecordFromGateway, jn as GetPageParamSchema, jr as string, k as doesDomainAddressHaveCapitalLetter, kr as object, l as DecryptedChallengeAnswerSchema, ln as RpcRemoteCommunityUpdateEventResultSchema, lr as t$9, m as NameResolveCacheOptionsSchema, mn as VoteSignedPropertyNames, mr as FailedToFetchCommunityFromGatewaysError, mt as sleepUntilTimeoutOrAbort, n as ChallengeAnswerMessageSignedPropertyNames, nn as CommunityIpfsSchema, nr as e$5, o as ChallengeRequestMessageSignedPropertyNames, on as CreateRpcCommunityFunctionArgumentSchema, or as n$8, p as DecryptedChallengeVerificationSchema, pr as FailedToFetchCommentUpdateFromGatewaysError, pt as shortifyCid, qn as CommunityAddressSchema, qt as CommentModerationSignedPropertyNames, rn as CommunitySignedPropertyNames, rr as t$11, sn as ExportCommunityModLogsOptionsSchema, sr as r$7, tn as CommunityIpfsReservedFields, tr as e$6, tt as raceAgainstAbort, un as CreateVoteUserOptionsWithRefinementSchema, ur as e$4, v as PKCUserOptionsSchema, vn as CommentIpfsSchema, vr as messages, vt as waitForUpdateInCommunityInstanceWithErrorAndTimeout, wn as CommentUpdateForChallengeVerificationSignedPropertyNames, wr as array, wt as listStartedCommunities, x as calculateIpfsCidV0, xn as CommentSignedPropertyNames, xr as require_ms$1, xt as findStartedCommunity, yr as logger_default, z as isAbortError, zt as CommunityEditPublicationChallengeRequestToEncryptSchema } from "./schema-Db4geGeo.js";
|
|
3
3
|
import { t as all } from "./src-CYIMjhjK.js";
|
|
4
4
|
import http from "node:http";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
7
|
import fsp from "node:fs/promises";
|
|
8
|
-
import
|
|
8
|
+
import Path from "node:path";
|
|
9
9
|
import dns from "node:dns";
|
|
10
10
|
import os from "os";
|
|
11
11
|
import { closeSync, createReadStream, existsSync, openSync, promises, readSync, readdirSync, rm, watch } from "node:fs";
|
|
12
|
-
import path
|
|
12
|
+
import path from "path";
|
|
13
13
|
import assert from "assert";
|
|
14
14
|
import { Agent } from "https";
|
|
15
15
|
import { Agent as Agent$1 } from "http";
|
|
@@ -91411,9 +91411,239 @@ var import_safe_stable_stringify = /* @__PURE__ */ __toESM(require_safe_stable_s
|
|
|
91411
91411
|
const configure = import_safe_stable_stringify.configure;
|
|
91412
91412
|
const stringify = import_safe_stable_stringify.default;
|
|
91413
91413
|
//#endregion
|
|
91414
|
+
//#region node_modules/remeda/dist/clone.js
|
|
91415
|
+
function t$8(...t) {
|
|
91416
|
+
return t$9(n$7, t);
|
|
91417
|
+
}
|
|
91418
|
+
function n$7(e, t = [], n = []) {
|
|
91419
|
+
if (typeof e == `function`) return e;
|
|
91420
|
+
if (typeof e != `object` || !e) return structuredClone(e);
|
|
91421
|
+
let a = Object.getPrototypeOf(e);
|
|
91422
|
+
if (!Array.isArray(e) && a !== null && a !== Object.prototype) return structuredClone(e);
|
|
91423
|
+
let o = t.indexOf(e);
|
|
91424
|
+
return o === -1 ? (t.push(e), Array.isArray(e) ? i$5(e, t, n) : r$6(e, t, n)) : n[o];
|
|
91425
|
+
}
|
|
91426
|
+
function r$6(e, t, r) {
|
|
91427
|
+
let i = {};
|
|
91428
|
+
r.push(i);
|
|
91429
|
+
for (let [a, o] of Object.entries(e)) i[a] = n$7(o, t, r);
|
|
91430
|
+
return i;
|
|
91431
|
+
}
|
|
91432
|
+
function i$5(e, t, r) {
|
|
91433
|
+
let i = [];
|
|
91434
|
+
r.push(i);
|
|
91435
|
+
for (let [a, o] of e.entries()) i[a] = n$7(o, t, r);
|
|
91436
|
+
return i;
|
|
91437
|
+
}
|
|
91438
|
+
//#endregion
|
|
91439
|
+
//#region node_modules/remeda/dist/toSingle-DiQSixar.js
|
|
91440
|
+
const e$3 = (e) => Object.assign(e, { single: !0 });
|
|
91441
|
+
//#endregion
|
|
91442
|
+
//#region node_modules/remeda/dist/find.js
|
|
91443
|
+
function r$5(...t) {
|
|
91444
|
+
return t$9(i$4, t, e$3(a$3));
|
|
91445
|
+
}
|
|
91446
|
+
const i$4 = (e, t) => e.find(t), a$3 = (e) => (n, r, i) => e(n, r, i) ? {
|
|
91447
|
+
done: !0,
|
|
91448
|
+
hasNext: !0,
|
|
91449
|
+
next: n
|
|
91450
|
+
} : t$10;
|
|
91451
|
+
//#endregion
|
|
91452
|
+
//#region node_modules/remeda/dist/purryOrderRules-DItZvucQ.js
|
|
91453
|
+
const e$2 = {
|
|
91454
|
+
asc: (e, t) => e > t,
|
|
91455
|
+
desc: (e, t) => e < t
|
|
91456
|
+
};
|
|
91457
|
+
function t$7(e, t) {
|
|
91458
|
+
let [n, ...a] = t;
|
|
91459
|
+
if (!i$3(n)) return e(n, r$4(...a));
|
|
91460
|
+
let o = r$4(n, ...a);
|
|
91461
|
+
return (t) => e(t, o);
|
|
91462
|
+
}
|
|
91463
|
+
function r$4(t, n, ...i) {
|
|
91464
|
+
let a = typeof t == `function` ? t : t[0], o = typeof t == `function` ? `asc` : t[1], { [o]: s } = e$2, c = n === void 0 ? void 0 : r$4(n, ...i);
|
|
91465
|
+
return (e, t) => {
|
|
91466
|
+
let n = a(e), r = a(t);
|
|
91467
|
+
return s(n, r) ? 1 : s(r, n) ? -1 : c?.(e, t) ?? 0;
|
|
91468
|
+
};
|
|
91469
|
+
}
|
|
91470
|
+
function i$3(t) {
|
|
91471
|
+
if (a$2(t)) return !0;
|
|
91472
|
+
if (typeof t != `object` || !Array.isArray(t)) return !1;
|
|
91473
|
+
let [n, r, ...i] = t;
|
|
91474
|
+
return a$2(n) && typeof r == `string` && r in e$2 && i.length === 0;
|
|
91475
|
+
}
|
|
91476
|
+
const a$2 = (e) => typeof e == `function` && e.length === 1;
|
|
91477
|
+
//#endregion
|
|
91478
|
+
//#region node_modules/remeda/dist/firstBy.js
|
|
91479
|
+
function n$6(...e) {
|
|
91480
|
+
return t$7(r$3, e);
|
|
91481
|
+
}
|
|
91482
|
+
function r$3(t, n) {
|
|
91483
|
+
if (!t$11(t, 2)) return t[0];
|
|
91484
|
+
let [r] = t, [, ...i] = t;
|
|
91485
|
+
for (let e of i) n(e, r) < 0 && (r = e);
|
|
91486
|
+
return r;
|
|
91487
|
+
}
|
|
91488
|
+
//#endregion
|
|
91489
|
+
//#region node_modules/remeda/dist/flat.js
|
|
91490
|
+
function n$5(t, n) {
|
|
91491
|
+
return typeof t == `object` ? r$2(t, n) : e$4(r$2, t === void 0 ? [] : [t], i$2);
|
|
91492
|
+
}
|
|
91493
|
+
const r$2 = (e, t) => t === void 0 ? e.flat() : e.flat(t), i$2 = (e) => e === void 0 || e === 1 ? a$1 : e <= 0 ? r$7 : (t) => Array.isArray(t) ? {
|
|
91494
|
+
next: t.flat(e - 1),
|
|
91495
|
+
hasNext: !0,
|
|
91496
|
+
hasMany: !0,
|
|
91497
|
+
done: !1
|
|
91498
|
+
} : {
|
|
91499
|
+
next: t,
|
|
91500
|
+
hasNext: !0,
|
|
91501
|
+
done: !1
|
|
91502
|
+
}, a$1 = (e) => Array.isArray(e) ? {
|
|
91503
|
+
next: e,
|
|
91504
|
+
hasNext: !0,
|
|
91505
|
+
hasMany: !0,
|
|
91506
|
+
done: !1
|
|
91507
|
+
} : {
|
|
91508
|
+
next: e,
|
|
91509
|
+
hasNext: !0,
|
|
91510
|
+
done: !1
|
|
91511
|
+
};
|
|
91512
|
+
//#endregion
|
|
91513
|
+
//#region node_modules/remeda/dist/fromEntries.js
|
|
91514
|
+
function t$6(...t) {
|
|
91515
|
+
return t$9(Object.fromEntries, t);
|
|
91516
|
+
}
|
|
91517
|
+
//#endregion
|
|
91518
|
+
//#region node_modules/remeda/dist/isDeepEqual.js
|
|
91519
|
+
function t$5(...t) {
|
|
91520
|
+
return t$9(n$4, t);
|
|
91521
|
+
}
|
|
91522
|
+
function n$4(e, t) {
|
|
91523
|
+
if (e === t || Object.is(e, t)) return !0;
|
|
91524
|
+
if (typeof e != `object` || typeof t != `object` || e === null || t === null || !r$1(e, t)) return !1;
|
|
91525
|
+
if (Array.isArray(e)) return i$1(e, t);
|
|
91526
|
+
if (e instanceof Map) return a(e, t);
|
|
91527
|
+
if (e instanceof Set) return o(e, t);
|
|
91528
|
+
if (e instanceof Date) return e.getTime() === t.getTime();
|
|
91529
|
+
if (e instanceof RegExp) return e.toString() === t.toString();
|
|
91530
|
+
if (Object.keys(e).length !== Object.keys(t).length) return !1;
|
|
91531
|
+
for (let [r, i] of Object.entries(e)) if (!(r in t) || !n$4(i, t[r])) return !1;
|
|
91532
|
+
return !0;
|
|
91533
|
+
}
|
|
91534
|
+
function r$1(e, t) {
|
|
91535
|
+
let n = Object.getPrototypeOf(e), r = Object.getPrototypeOf(t);
|
|
91536
|
+
return n === r ? !0 : n === null ? r === Object.prototype : n === Object.prototype && r === null;
|
|
91537
|
+
}
|
|
91538
|
+
function i$1(e, t) {
|
|
91539
|
+
if (e.length !== t.length) return !1;
|
|
91540
|
+
for (let [r, i] of e.entries()) if (!n$4(i, t[r])) return !1;
|
|
91541
|
+
return !0;
|
|
91542
|
+
}
|
|
91543
|
+
function a(e, t) {
|
|
91544
|
+
if (e.size !== t.size) return !1;
|
|
91545
|
+
for (let [r, i] of e.entries()) if (!t.has(r) || !n$4(i, t.get(r))) return !1;
|
|
91546
|
+
return !0;
|
|
91547
|
+
}
|
|
91548
|
+
function o(e, t) {
|
|
91549
|
+
if (e.size !== t.size) return !1;
|
|
91550
|
+
let r = [...t];
|
|
91551
|
+
for (let t of e) {
|
|
91552
|
+
let e = !1;
|
|
91553
|
+
for (let [i, a] of r.entries()) if (n$4(t, a)) {
|
|
91554
|
+
e = !0, r.splice(i, 1);
|
|
91555
|
+
break;
|
|
91556
|
+
}
|
|
91557
|
+
if (!e) return !1;
|
|
91558
|
+
}
|
|
91559
|
+
return !0;
|
|
91560
|
+
}
|
|
91561
|
+
//#endregion
|
|
91562
|
+
//#region node_modules/remeda/dist/intersection.js
|
|
91563
|
+
function r(...e) {
|
|
91564
|
+
return t$12(i, e);
|
|
91565
|
+
}
|
|
91566
|
+
function i(n) {
|
|
91567
|
+
if (n.length === 0) return n$8;
|
|
91568
|
+
let r = /* @__PURE__ */ new Map();
|
|
91569
|
+
for (let e of n) r.set(e, (r.get(e) ?? 0) + 1);
|
|
91570
|
+
return (e) => {
|
|
91571
|
+
let n = r.get(e);
|
|
91572
|
+
return n === void 0 || n === 0 ? t$10 : (n === 1 ? r.delete(e) : r.set(e, n - 1), {
|
|
91573
|
+
hasNext: !0,
|
|
91574
|
+
next: e,
|
|
91575
|
+
done: r.size === 0
|
|
91576
|
+
});
|
|
91577
|
+
};
|
|
91578
|
+
}
|
|
91579
|
+
//#endregion
|
|
91580
|
+
//#region node_modules/remeda/dist/mapValues.js
|
|
91581
|
+
function t$4(...t) {
|
|
91582
|
+
return t$9(n$3, t);
|
|
91583
|
+
}
|
|
91584
|
+
function n$3(e, t) {
|
|
91585
|
+
let n = {};
|
|
91586
|
+
for (let [r, i] of Object.entries(e)) n[r] = t(i, r, e);
|
|
91587
|
+
return n;
|
|
91588
|
+
}
|
|
91589
|
+
//#endregion
|
|
91590
|
+
//#region node_modules/remeda/dist/pathOr.js
|
|
91591
|
+
function t$3(...t) {
|
|
91592
|
+
return t$9(n$2, t);
|
|
91593
|
+
}
|
|
91594
|
+
function n$2(e, t, n) {
|
|
91595
|
+
let r = e;
|
|
91596
|
+
for (let e of t) {
|
|
91597
|
+
if (r == null) break;
|
|
91598
|
+
r = r[e];
|
|
91599
|
+
}
|
|
91600
|
+
return r ?? n;
|
|
91601
|
+
}
|
|
91602
|
+
//#endregion
|
|
91603
|
+
//#region node_modules/remeda/dist/pick.js
|
|
91604
|
+
function t$2(...t) {
|
|
91605
|
+
return t$9(n$1, t);
|
|
91606
|
+
}
|
|
91607
|
+
function n$1(e, t) {
|
|
91608
|
+
let n = {};
|
|
91609
|
+
for (let r of t) r in e && (n[r] = e[r]);
|
|
91610
|
+
return n;
|
|
91611
|
+
}
|
|
91612
|
+
//#endregion
|
|
91613
|
+
//#region node_modules/remeda/dist/withPrecision-CqXhgRqZ.js
|
|
91614
|
+
const e$1 = (e) => (n, r) => {
|
|
91615
|
+
if (r === 0) return e(n);
|
|
91616
|
+
if (!Number.isInteger(r)) throw TypeError(`precision must be an integer: ${r.toString()}`);
|
|
91617
|
+
if (r > 15 || r < -15) throw RangeError(`precision must be between -15 and 15`);
|
|
91618
|
+
return Number.isNaN(n) || !Number.isFinite(n) ? e(n) : t$1(e(t$1(n, r)), -r);
|
|
91619
|
+
};
|
|
91620
|
+
function t$1(e, t) {
|
|
91621
|
+
let [n, r] = e.toString().split(`e`), i = `${n}e${((r === void 0 ? 0 : Number.parseInt(r, 10)) + t).toString()}`;
|
|
91622
|
+
return Number.parseFloat(i);
|
|
91623
|
+
}
|
|
91624
|
+
//#endregion
|
|
91625
|
+
//#region node_modules/remeda/dist/round.js
|
|
91626
|
+
function n(...n) {
|
|
91627
|
+
return t$9(e$1(Math.round), n);
|
|
91628
|
+
}
|
|
91629
|
+
//#endregion
|
|
91630
|
+
//#region node_modules/remeda/dist/stringToPath.js
|
|
91631
|
+
const e = /^(?:0|[1-9][0-9]*)$/u;
|
|
91632
|
+
function t(n) {
|
|
91633
|
+
let r = [], i = /\.{0,4096}(?<propName>[^.[\]]+)|\['(?<quoted>.{0,4096}?)'\]|\["(?<doubleQuoted>.{0,4096}?)"\]|\[(?<unquoted>.{0,4096}?)\]/uy, a;
|
|
91634
|
+
for (; (a = i.exec(n)) !== null;) {
|
|
91635
|
+
let { propName: n, quoted: i, doubleQuoted: o, unquoted: s } = a.groups;
|
|
91636
|
+
if (s !== void 0) {
|
|
91637
|
+
r.push(...t(s));
|
|
91638
|
+
continue;
|
|
91639
|
+
}
|
|
91640
|
+
r.push(n === void 0 ? i ?? o : e.test(n) ? Number(n) : n);
|
|
91641
|
+
}
|
|
91642
|
+
return r;
|
|
91643
|
+
}
|
|
91644
|
+
//#endregion
|
|
91414
91645
|
//#region dist/node/clients/rpc-client/schema.js
|
|
91415
91646
|
var import_retry = /* @__PURE__ */ __toESM(require_retry$1(), 1);
|
|
91416
|
-
var import_commonjs = /* @__PURE__ */ __toESM(require_commonjs$4(), 1);
|
|
91417
91647
|
var import_sha256 = require_sha256$1();
|
|
91418
91648
|
const SubscriptionIdSchema = number().positive().int();
|
|
91419
91649
|
const RpcCommentEventResultSchema = object({
|
|
@@ -97276,11 +97506,11 @@ const runtimeOnlyAuthorFields = [
|
|
|
97276
97506
|
];
|
|
97277
97507
|
function omitRuntimeAuthorFields(author) {
|
|
97278
97508
|
if (!author) return {};
|
|
97279
|
-
return
|
|
97509
|
+
return n$9(author, runtimeOnlyAuthorFields);
|
|
97280
97510
|
}
|
|
97281
97511
|
function cleanWireAuthor(author) {
|
|
97282
97512
|
const wireAuthor = omitRuntimeAuthorFields(author);
|
|
97283
|
-
if (
|
|
97513
|
+
if (e$5(wireAuthor)) return void 0;
|
|
97284
97514
|
return wireAuthor;
|
|
97285
97515
|
}
|
|
97286
97516
|
function normalizeCreatePublicationAuthor(author) {
|
|
@@ -97345,7 +97575,7 @@ async function _validateAuthorAddressBeforeSigning(author, signer, pkc) {
|
|
|
97345
97575
|
}
|
|
97346
97576
|
async function _signJson(signedPropertyNames, cleanedPublication, signer, log) {
|
|
97347
97577
|
assert(signer.publicKey && typeof signer.type === "string" && signer.privateKey, "Signer props need to be defined befoe signing");
|
|
97348
|
-
const propsToSign =
|
|
97578
|
+
const propsToSign = t$2(cleanedPublication, signedPropertyNames);
|
|
97349
97579
|
let publicationEncoded;
|
|
97350
97580
|
try {
|
|
97351
97581
|
publicationEncoded = encode(propsToSign, cborgEncodeOptions);
|
|
@@ -97358,12 +97588,12 @@ async function _signJson(signedPropertyNames, cleanedPublication, signer, log) {
|
|
|
97358
97588
|
signature: toString(await signBufferEd25519(publicationEncoded, signer.privateKey), "base64"),
|
|
97359
97589
|
publicKey: signer.publicKey,
|
|
97360
97590
|
type: signer.type,
|
|
97361
|
-
signedPropertyNames:
|
|
97591
|
+
signedPropertyNames: t$13(propsToSign)
|
|
97362
97592
|
};
|
|
97363
97593
|
}
|
|
97364
97594
|
async function _signPubsubMsg({ signedPropertyNames, msg, signer, log }) {
|
|
97365
97595
|
assert(signer.publicKey && typeof signer.type === "string" && signer.privateKey, "Signer props need to be defined befoe signing");
|
|
97366
|
-
const propsToSign =
|
|
97596
|
+
const propsToSign = t$2(msg, signedPropertyNames);
|
|
97367
97597
|
let publicationEncoded;
|
|
97368
97598
|
try {
|
|
97369
97599
|
publicationEncoded = encode(propsToSign, cborgEncodeOptions);
|
|
@@ -97375,7 +97605,7 @@ async function _signPubsubMsg({ signedPropertyNames, msg, signer, log }) {
|
|
|
97375
97605
|
signature: await signBufferEd25519(publicationEncoded, signer.privateKey),
|
|
97376
97606
|
publicKey: fromString(signer.publicKey, "base64"),
|
|
97377
97607
|
type: signer.type,
|
|
97378
|
-
signedPropertyNames:
|
|
97608
|
+
signedPropertyNames: t$13(propsToSign)
|
|
97379
97609
|
};
|
|
97380
97610
|
}
|
|
97381
97611
|
function cleanUpBeforePublishing(msg) {
|
|
@@ -97532,13 +97762,13 @@ async function verifyCommentIpfs(opts) {
|
|
|
97532
97762
|
valid: false,
|
|
97533
97763
|
reason: messages.ERR_COMMENT_IPFS_RECORD_INCLUDES_RESERVED_FIELD
|
|
97534
97764
|
};
|
|
97535
|
-
if (opts.comment.author &&
|
|
97765
|
+
if (opts.comment.author && r(Object.keys(opts.comment.author), AuthorCommentIpfsReservedFields).length > 0) return {
|
|
97536
97766
|
valid: false,
|
|
97537
97767
|
reason: messages.ERR_COMMENT_IPFS_AUTHOR_INCLUDES_RESERVED_FIELD
|
|
97538
97768
|
};
|
|
97539
97769
|
const keysCasted = opts.comment.signature.signedPropertyNames;
|
|
97540
97770
|
const validRes = await verifyCommentPubsubMessage({
|
|
97541
|
-
comment:
|
|
97771
|
+
comment: t$2(opts.comment, ["signature", ...keysCasted]),
|
|
97542
97772
|
resolveAuthorNames: opts.resolveAuthorNames,
|
|
97543
97773
|
clientsManager: opts.clientsManager,
|
|
97544
97774
|
abortSignal: opts.abortSignal
|
|
@@ -97548,7 +97778,7 @@ async function verifyCommentIpfs(opts) {
|
|
|
97548
97778
|
return validRes;
|
|
97549
97779
|
}
|
|
97550
97780
|
function _allFieldsOfRecordInSignedPropertyNames(record) {
|
|
97551
|
-
const fieldsOfRecord =
|
|
97781
|
+
const fieldsOfRecord = t$13(n$9(record, ["signature"]));
|
|
97552
97782
|
for (const field of fieldsOfRecord) if (!record.signature.signedPropertyNames.includes(field)) return false;
|
|
97553
97783
|
return true;
|
|
97554
97784
|
}
|
|
@@ -97575,10 +97805,10 @@ async function verifyCommunity({ community, communityIpnsName, resolveAuthorName
|
|
|
97575
97805
|
name: community.name,
|
|
97576
97806
|
signature: community.signature
|
|
97577
97807
|
};
|
|
97578
|
-
if (community.posts?.pages && validatePages) for (const preloadedPageSortName of
|
|
97808
|
+
if (community.posts?.pages && validatePages) for (const preloadedPageSortName of t$13(community.posts.pages)) {
|
|
97579
97809
|
const pageCid = community.posts.pageCids?.[preloadedPageSortName];
|
|
97580
97810
|
const preloadedPage = community.posts.pages[preloadedPageSortName];
|
|
97581
|
-
if (!
|
|
97811
|
+
if (!e$6(preloadedPage)) throw Error("failed to find page ipfs of community to verify");
|
|
97582
97812
|
const pageValidity = await verifyPage({
|
|
97583
97813
|
pageCid,
|
|
97584
97814
|
page: preloadedPage,
|
|
@@ -97631,7 +97861,7 @@ async function _validateSignatureOfPubsubMsg(publication) {
|
|
|
97631
97861
|
return { valid: true };
|
|
97632
97862
|
}
|
|
97633
97863
|
function _isThereReservedFieldInRecord(record, reservedFields) {
|
|
97634
|
-
return
|
|
97864
|
+
return r(Object.keys(record), reservedFields).length > 0;
|
|
97635
97865
|
}
|
|
97636
97866
|
async function verifyCommentUpdate({ update, resolveAuthorNames, clientsManager, community, comment, validatePages, validateUpdateSignature, abortSignal }) {
|
|
97637
97867
|
if (!_allFieldsOfRecordInSignedPropertyNames(update)) return {
|
|
@@ -97664,7 +97894,7 @@ async function verifyCommentUpdate({ update, resolveAuthorNames, clientsManager,
|
|
|
97664
97894
|
reason: messages.ERR_COMMENT_UPDATE_DIFFERENT_CID_THAN_COMMENT
|
|
97665
97895
|
};
|
|
97666
97896
|
if ("replies" in update && update.replies && validatePages) {
|
|
97667
|
-
const replyPageKeys =
|
|
97897
|
+
const replyPageKeys = t$13(update.replies.pages);
|
|
97668
97898
|
for (const replySortName of replyPageKeys) {
|
|
97669
97899
|
const pageCid = update.replies.pageCids?.[replySortName];
|
|
97670
97900
|
const page = update.replies.pages[replySortName];
|
|
@@ -98324,15 +98554,15 @@ var BaseClientsManager = class BaseClientsManager {
|
|
|
98324
98554
|
constructor(pkc) {
|
|
98325
98555
|
this.pubsubProviderSubscriptions = {};
|
|
98326
98556
|
this._pkc = pkc;
|
|
98327
|
-
for (const provider of
|
|
98328
|
-
for (const provider of
|
|
98557
|
+
for (const provider of t$13(pkc.clients.pubsubKuboRpcClients)) this.pubsubProviderSubscriptions[provider] = [];
|
|
98558
|
+
for (const provider of t$13(pkc.clients.libp2pJsClients)) this.pubsubProviderSubscriptions[provider] = [];
|
|
98329
98559
|
hideClassPrivateProps(this);
|
|
98330
98560
|
}
|
|
98331
98561
|
toJSON() {}
|
|
98332
98562
|
getDefaultPubsubKuboRpcClientOrHelia() {
|
|
98333
|
-
const defaultPubsubProviderUrl =
|
|
98563
|
+
const defaultPubsubProviderUrl = t$13(this._pkc.clients.pubsubKuboRpcClients)[0];
|
|
98334
98564
|
if (defaultPubsubProviderUrl) return this._pkc.clients.pubsubKuboRpcClients[defaultPubsubProviderUrl];
|
|
98335
|
-
const defaultLibp2pJsClient =
|
|
98565
|
+
const defaultLibp2pJsClient = t$13(this._pkc.clients.libp2pJsClients)[0];
|
|
98336
98566
|
if (defaultLibp2pJsClient) return this._pkc.clients.libp2pJsClients[defaultLibp2pJsClient];
|
|
98337
98567
|
throw new PKCError("ERR_NO_DEFAULT_PUBSUB_PROVIDER", {
|
|
98338
98568
|
pubsubKuboRpcClients: this._pkc.clients.pubsubKuboRpcClients,
|
|
@@ -98340,9 +98570,9 @@ var BaseClientsManager = class BaseClientsManager {
|
|
|
98340
98570
|
});
|
|
98341
98571
|
}
|
|
98342
98572
|
getDefaultKuboRpcClientOrHelia() {
|
|
98343
|
-
const defaultKuboRpcClient =
|
|
98573
|
+
const defaultKuboRpcClient = t$13(this._pkc.clients.kuboRpcClients)[0];
|
|
98344
98574
|
if (defaultKuboRpcClient) return this._pkc.clients.kuboRpcClients[defaultKuboRpcClient];
|
|
98345
|
-
const defaultLibp2pJsClient =
|
|
98575
|
+
const defaultLibp2pJsClient = t$13(this._pkc.clients.libp2pJsClients)[0];
|
|
98346
98576
|
if (defaultLibp2pJsClient) return this._pkc.clients.libp2pJsClients[defaultLibp2pJsClient];
|
|
98347
98577
|
throw new PKCError("ERR_NO_DEFAULT_IPFS_PROVIDER", {
|
|
98348
98578
|
kuboRpcClients: this._pkc.clients.kuboRpcClients,
|
|
@@ -98350,7 +98580,7 @@ var BaseClientsManager = class BaseClientsManager {
|
|
|
98350
98580
|
});
|
|
98351
98581
|
}
|
|
98352
98582
|
getDefaultKuboRpcClient() {
|
|
98353
|
-
const defaultKuboRpcClient =
|
|
98583
|
+
const defaultKuboRpcClient = t$13(this._pkc.clients.kuboRpcClients)[0];
|
|
98354
98584
|
if (defaultKuboRpcClient) return this._pkc.clients.kuboRpcClients[defaultKuboRpcClient];
|
|
98355
98585
|
throw new PKCError("ERR_NO_DEFAULT_KUBO_RPC_IPFS_PROVIDER", {
|
|
98356
98586
|
kuboRpcClients: this._pkc.clients.kuboRpcClients,
|
|
@@ -98358,14 +98588,14 @@ var BaseClientsManager = class BaseClientsManager {
|
|
|
98358
98588
|
});
|
|
98359
98589
|
}
|
|
98360
98590
|
getDefaultKuboPubsubClient() {
|
|
98361
|
-
const defaultKuboPubsubClient =
|
|
98591
|
+
const defaultKuboPubsubClient = t$13(this._pkc.clients.pubsubKuboRpcClients)[0];
|
|
98362
98592
|
if (defaultKuboPubsubClient) return this._pkc.clients.pubsubKuboRpcClients[defaultKuboPubsubClient];
|
|
98363
98593
|
throw new PKCError("ERR_NO_DEFAULT_KUBO_RPC_PUBSUB_PROVIDER", { pubsubKuboRpcClients: this._pkc.clients.pubsubKuboRpcClients });
|
|
98364
98594
|
}
|
|
98365
98595
|
getIpfsClientWithKuboRpcClientFunctions() {
|
|
98366
|
-
const defaultKuboRpcClient =
|
|
98596
|
+
const defaultKuboRpcClient = t$13(this._pkc.clients.kuboRpcClients)[0];
|
|
98367
98597
|
if (defaultKuboRpcClient) return this._pkc.clients.kuboRpcClients[defaultKuboRpcClient]._client;
|
|
98368
|
-
const defaultLibp2pJsClient =
|
|
98598
|
+
const defaultLibp2pJsClient = t$13(this._pkc.clients.libp2pJsClients)[0];
|
|
98369
98599
|
if (defaultLibp2pJsClient) return this._pkc.clients.libp2pJsClients[defaultLibp2pJsClient].heliaWithKuboRpcClientFunctions;
|
|
98370
98600
|
throw new PKCError("ERR_NO_DEFAULT_IPFS_PROVIDER", {
|
|
98371
98601
|
kuboRpcClients: this._pkc.clients.kuboRpcClients,
|
|
@@ -98443,7 +98673,7 @@ var BaseClientsManager = class BaseClientsManager {
|
|
|
98443
98673
|
}
|
|
98444
98674
|
}
|
|
98445
98675
|
async pubsubUnsubscribe(pubsubTopic, handler) {
|
|
98446
|
-
for (const pubsubProviderUrl of
|
|
98676
|
+
for (const pubsubProviderUrl of t$13(this._pkc.clients.pubsubKuboRpcClients)) try {
|
|
98447
98677
|
await this.pubsubUnsubscribeOnProvider(pubsubTopic, pubsubProviderUrl, handler);
|
|
98448
98678
|
} catch (e) {
|
|
98449
98679
|
await this._pkc._stats.recordGatewayFailure(pubsubProviderUrl, "pubsub-unsubscribe");
|
|
@@ -98647,7 +98877,7 @@ var BaseClientsManager = class BaseClientsManager {
|
|
|
98647
98877
|
const timeoutMs = loadOpts.timeoutMs;
|
|
98648
98878
|
const concurrencyLimit = 3;
|
|
98649
98879
|
const queueLimit = pLimit(concurrencyLimit);
|
|
98650
|
-
const gatewaysSorted =
|
|
98880
|
+
const gatewaysSorted = t$13(this._pkc.clients.ipfsGateways).length <= concurrencyLimit ? t$13(this._pkc.clients.ipfsGateways) : await this._pkc._stats.sortGatewaysAccordingToScore(loadOpts.recordIpfsType);
|
|
98651
98881
|
const gatewayFetches = {};
|
|
98652
98882
|
const cleanUp = () => {
|
|
98653
98883
|
queueLimit.clearQueue();
|
|
@@ -99081,28 +99311,28 @@ var PKCClientsManager = class extends BaseClientsManager {
|
|
|
99081
99311
|
}
|
|
99082
99312
|
_initIpfsGateways() {
|
|
99083
99313
|
this.clients.ipfsGateways = {};
|
|
99084
|
-
for (const gatewayUrl of
|
|
99314
|
+
for (const gatewayUrl of t$13(this._pkc.clients.ipfsGateways)) this.clients.ipfsGateways = {
|
|
99085
99315
|
...this.clients.ipfsGateways,
|
|
99086
99316
|
[gatewayUrl]: new PKCIpfsGatewayClient("stopped")
|
|
99087
99317
|
};
|
|
99088
99318
|
}
|
|
99089
99319
|
_initKuboRpcClients() {
|
|
99090
99320
|
this.clients.kuboRpcClients = {};
|
|
99091
|
-
for (const kuboRpcUrl of
|
|
99321
|
+
for (const kuboRpcUrl of t$13(this._pkc.clients.kuboRpcClients)) this.clients.kuboRpcClients = {
|
|
99092
99322
|
...this.clients.kuboRpcClients,
|
|
99093
99323
|
[kuboRpcUrl]: new PKCKuboRpcClient("stopped")
|
|
99094
99324
|
};
|
|
99095
99325
|
}
|
|
99096
99326
|
_initPubsubKuboRpcClients() {
|
|
99097
99327
|
this.clients.pubsubKuboRpcClients = {};
|
|
99098
|
-
for (const pubsubUrl of
|
|
99328
|
+
for (const pubsubUrl of t$13(this._pkc.clients.pubsubKuboRpcClients)) this.clients.pubsubKuboRpcClients = {
|
|
99099
99329
|
...this.clients.pubsubKuboRpcClients,
|
|
99100
99330
|
[pubsubUrl]: new GenericStateClient("stopped")
|
|
99101
99331
|
};
|
|
99102
99332
|
}
|
|
99103
99333
|
_initLibp2pJsClients() {
|
|
99104
99334
|
this.clients.libp2pJsClients = {};
|
|
99105
|
-
for (const libp2pJsClientKey of
|
|
99335
|
+
for (const libp2pJsClientKey of t$13(this._pkc.clients.libp2pJsClients)) this.clients.libp2pJsClients = {
|
|
99106
99336
|
...this.clients.libp2pJsClients,
|
|
99107
99337
|
[libp2pJsClientKey]: new PKCLibp2pJsClient("stopped")
|
|
99108
99338
|
};
|
|
@@ -99170,7 +99400,7 @@ var PKCClientsManager = class extends BaseClientsManager {
|
|
|
99170
99400
|
this.clients.nameResolvers[resolverKey].emit("statechange", newState);
|
|
99171
99401
|
}
|
|
99172
99402
|
async fetchCid(cid) {
|
|
99173
|
-
let finalCid =
|
|
99403
|
+
let finalCid = t$8(cid);
|
|
99174
99404
|
if (!isIpfsCid(finalCid) && isIpfsPath(finalCid)) finalCid = finalCid.split("/")[2];
|
|
99175
99405
|
if (!isIpfsCid(finalCid)) throw new PKCError("ERR_CID_IS_INVALID", { cid });
|
|
99176
99406
|
const timeoutMs = this._pkc._timeouts["generic-ipfs"];
|
|
@@ -99214,19 +99444,19 @@ var PublicationClientsManager = class extends PKCClientsManager {
|
|
|
99214
99444
|
this.handleUpdatingStateChangeEventFromCommunity = this.handleUpdatingStateChangeEventFromCommunity.bind(this);
|
|
99215
99445
|
}
|
|
99216
99446
|
_initKuboRpcClients() {
|
|
99217
|
-
if (this._pkc.clients.kuboRpcClients) for (const ipfsUrl of
|
|
99447
|
+
if (this._pkc.clients.kuboRpcClients) for (const ipfsUrl of t$13(this._pkc.clients.kuboRpcClients)) this.clients.kuboRpcClients = {
|
|
99218
99448
|
...this.clients.kuboRpcClients,
|
|
99219
99449
|
[ipfsUrl]: new PublicationKuboRpcClient("stopped")
|
|
99220
99450
|
};
|
|
99221
99451
|
}
|
|
99222
99452
|
_initPubsubKuboRpcClients() {
|
|
99223
|
-
for (const pubsubUrl of
|
|
99453
|
+
for (const pubsubUrl of t$13(this._pkc.clients.pubsubKuboRpcClients)) this.clients.pubsubKuboRpcClients = {
|
|
99224
99454
|
...this.clients.pubsubKuboRpcClients,
|
|
99225
99455
|
[pubsubUrl]: new PublicationKuboPubsubClient("stopped")
|
|
99226
99456
|
};
|
|
99227
99457
|
}
|
|
99228
99458
|
_initPKCRpcClients() {
|
|
99229
|
-
for (const rpcUrl of
|
|
99459
|
+
for (const rpcUrl of t$13(this._pkc.clients.pkcRpcClients)) this.clients.pkcRpcClients = {
|
|
99230
99460
|
...this.clients.pkcRpcClients,
|
|
99231
99461
|
[rpcUrl]: new PublicationPKCRpcStateClient("stopped")
|
|
99232
99462
|
};
|
|
@@ -99434,28 +99664,28 @@ var BasePagesClientsManager = class extends BaseClientsManager {
|
|
|
99434
99664
|
if (!this.clients.ipfsGateways) this.clients.ipfsGateways = {};
|
|
99435
99665
|
for (const sortType of sortTypes) {
|
|
99436
99666
|
if (!this.clients.ipfsGateways[sortType]) this.clients.ipfsGateways[sortType] = {};
|
|
99437
|
-
for (const gatewayUrl of
|
|
99667
|
+
for (const gatewayUrl of t$13(this._pkc.clients.ipfsGateways)) if (!this.clients.ipfsGateways[sortType][gatewayUrl]) this.clients.ipfsGateways[sortType][gatewayUrl] = new PagesIpfsGatewayClient("stopped");
|
|
99438
99668
|
}
|
|
99439
99669
|
}
|
|
99440
99670
|
_updateKuboRpcClientStates(sortTypes) {
|
|
99441
99671
|
if (this._pkc.clients.kuboRpcClients && !this.clients.kuboRpcClients) this.clients.kuboRpcClients = {};
|
|
99442
99672
|
for (const sortType of sortTypes) {
|
|
99443
99673
|
if (!this.clients.kuboRpcClients[sortType]) this.clients.kuboRpcClients[sortType] = {};
|
|
99444
|
-
for (const kuboRpcUrl of
|
|
99674
|
+
for (const kuboRpcUrl of t$13(this._pkc.clients.kuboRpcClients)) if (!this.clients.kuboRpcClients[sortType][kuboRpcUrl]) this.clients.kuboRpcClients[sortType][kuboRpcUrl] = new PagesKuboRpcClient("stopped");
|
|
99445
99675
|
}
|
|
99446
99676
|
}
|
|
99447
99677
|
_updateLibp2pJsClientStates(sortTypes) {
|
|
99448
99678
|
if (this._pkc.clients.libp2pJsClients && !this.clients.libp2pJsClients) this.clients.libp2pJsClients = {};
|
|
99449
99679
|
for (const sortType of sortTypes) {
|
|
99450
99680
|
if (!this.clients.libp2pJsClients[sortType]) this.clients.libp2pJsClients[sortType] = {};
|
|
99451
|
-
for (const libp2pJsClientKey of
|
|
99681
|
+
for (const libp2pJsClientKey of t$13(this._pkc.clients.libp2pJsClients)) if (!this.clients.libp2pJsClients[sortType][libp2pJsClientKey]) this.clients.libp2pJsClients[sortType][libp2pJsClientKey] = new PagesLibp2pJsClient("stopped");
|
|
99452
99682
|
}
|
|
99453
99683
|
}
|
|
99454
99684
|
_updatePKCRpcClientStates(sortTypes) {
|
|
99455
99685
|
if (this._pkc.clients.pkcRpcClients && !this.clients.pkcRpcClients) this.clients.pkcRpcClients = {};
|
|
99456
99686
|
for (const sortType of sortTypes) {
|
|
99457
99687
|
if (!this.clients.pkcRpcClients[sortType]) this.clients.pkcRpcClients[sortType] = {};
|
|
99458
|
-
for (const rpcUrl of
|
|
99688
|
+
for (const rpcUrl of t$13(this._pkc.clients.pkcRpcClients)) if (!this.clients.pkcRpcClients[sortType][rpcUrl]) this.clients.pkcRpcClients[sortType][rpcUrl] = new PagesPKCRpcStateClient("stopped");
|
|
99459
99689
|
}
|
|
99460
99690
|
}
|
|
99461
99691
|
preFetchGateway(gatewayUrl, loadOpts) {
|
|
@@ -99478,7 +99708,7 @@ var BasePagesClientsManager = class extends BaseClientsManager {
|
|
|
99478
99708
|
const curSortTypes = this._pkc._memCaches.pageCidToSortTypes.get(pageCid);
|
|
99479
99709
|
if (!curSortTypes) this._pkc._memCaches.pageCidToSortTypes.set(pageCid, sortTypes);
|
|
99480
99710
|
else {
|
|
99481
|
-
const newSortTypes =
|
|
99711
|
+
const newSortTypes = n$10([...curSortTypes, ...sortTypes]);
|
|
99482
99712
|
this._pkc._memCaches.pageCidToSortTypes.set(pageCid, newSortTypes);
|
|
99483
99713
|
}
|
|
99484
99714
|
}
|
|
@@ -99492,7 +99722,7 @@ var BasePagesClientsManager = class extends BaseClientsManager {
|
|
|
99492
99722
|
return (0, import_sha256.sha256)((this._pages._community.name || this._pages._community.publicKey) + pageCid);
|
|
99493
99723
|
}
|
|
99494
99724
|
updatePagesMaxSizeCache(newPageCids, pageMaxSizeBytes) {
|
|
99495
|
-
|
|
99725
|
+
n$10(newPageCids).forEach((pageCid) => this._pkc._memCaches.pagesMaxSize.set(this._calculatePageMaxSizeCacheKey(pageCid), pageMaxSizeBytes));
|
|
99496
99726
|
}
|
|
99497
99727
|
updatePageCidsToSortTypesToIncludeSubsequent(nextPageCid, previousPageCid) {
|
|
99498
99728
|
const sortTypes = this._pkc._memCaches.pageCidToSortTypes.get(previousPageCid);
|
|
@@ -99603,10 +99833,10 @@ var BasePagesClientsManager = class extends BaseClientsManager {
|
|
|
99603
99833
|
async fetchPage(opts) {
|
|
99604
99834
|
const { pageCid } = opts;
|
|
99605
99835
|
const log = logger_default("pkc-js:pages:getPage");
|
|
99606
|
-
const sortTypesFromPageCids =
|
|
99836
|
+
const sortTypesFromPageCids = t$13(this._pages.pageCids).filter((sortType) => this._pages.pageCids[sortType] === pageCid);
|
|
99607
99837
|
if (sortTypesFromPageCids.length > 0) this.updatePageCidsToSortTypes(this._pages.pageCids);
|
|
99608
99838
|
const sortTypesFromMemcache = this._pkc._memCaches.pageCidToSortTypes.get(pageCid);
|
|
99609
|
-
const isFirstPage = Object.values(this._pages.pageCids).includes(pageCid) ||
|
|
99839
|
+
const isFirstPage = Object.values(this._pages.pageCids).includes(pageCid) || e$5(this._pages.pageCids);
|
|
99610
99840
|
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;
|
|
99611
99841
|
if (!pageMaxSize) throw Error("Failed to calculate max page size. Is this page cid under the correct community/comment?");
|
|
99612
99842
|
const destroySignal = this._pkc._getDestroyAbortSignal();
|
|
@@ -99657,7 +99887,7 @@ var BasePagesClientsManager = class extends BaseClientsManager {
|
|
|
99657
99887
|
};
|
|
99658
99888
|
var RepliesPagesClientsManager = class extends BasePagesClientsManager {
|
|
99659
99889
|
getSortTypes() {
|
|
99660
|
-
return
|
|
99890
|
+
return t$13(POST_REPLIES_SORT_TYPES);
|
|
99661
99891
|
}
|
|
99662
99892
|
preFetchPage() {
|
|
99663
99893
|
if (!this._pages._parentComment) throw Error("parent comment needs to be defined");
|
|
@@ -99679,7 +99909,7 @@ var RepliesPagesClientsManager = class extends BasePagesClientsManager {
|
|
|
99679
99909
|
};
|
|
99680
99910
|
var CommunityPostsPagesClientsManager = class extends BasePagesClientsManager {
|
|
99681
99911
|
getSortTypes() {
|
|
99682
|
-
return
|
|
99912
|
+
return t$13(POSTS_SORT_TYPES);
|
|
99683
99913
|
}
|
|
99684
99914
|
preFetchPage() {
|
|
99685
99915
|
if (!this._pages._community) throw Error("Community needs to be defined");
|
|
@@ -100043,7 +100273,7 @@ const POSTS_SORT_TYPES = {
|
|
|
100043
100273
|
}
|
|
100044
100274
|
};
|
|
100045
100275
|
const POST_REPLIES_SORT_TYPES = {
|
|
100046
|
-
...
|
|
100276
|
+
...t$2(POSTS_SORT_TYPES, ["new"]),
|
|
100047
100277
|
best: { score: (...args) => bestScore(...args) },
|
|
100048
100278
|
old: { score: (...args) => oldScore(...args) },
|
|
100049
100279
|
newFlat: {
|
|
@@ -100056,7 +100286,7 @@ const POST_REPLIES_SORT_TYPES = {
|
|
|
100056
100286
|
}
|
|
100057
100287
|
};
|
|
100058
100288
|
const REPLY_REPLIES_SORT_TYPES = {
|
|
100059
|
-
...
|
|
100289
|
+
...t$2(POSTS_SORT_TYPES, ["new"]),
|
|
100060
100290
|
best: { score: (...args) => bestScore(...args) },
|
|
100061
100291
|
old: { score: (...args) => oldScore(...args) }
|
|
100062
100292
|
};
|
|
@@ -100067,7 +100297,7 @@ function hotScore(comment) {
|
|
|
100067
100297
|
const order = Math.log10(Math.max(Math.abs(score), 1));
|
|
100068
100298
|
const sign = score > 0 ? 1 : score < 0 ? -1 : 0;
|
|
100069
100299
|
const seconds = comment.comment.timestamp - 1134028003;
|
|
100070
|
-
return
|
|
100300
|
+
return n(sign * order + seconds / 45e3, 7);
|
|
100071
100301
|
}
|
|
100072
100302
|
function bestScore(comment) {
|
|
100073
100303
|
assert(typeof comment.commentUpdate.downvoteCount === "number" && typeof comment.commentUpdate.upvoteCount === "number");
|
|
@@ -100179,20 +100409,20 @@ function mapPageIpfsCommentToPageJsonComment(pageComment) {
|
|
|
100179
100409
|
function parsePageIpfs(pageIpfs) {
|
|
100180
100410
|
return {
|
|
100181
100411
|
comments: pageIpfs.comments.map(mapPageIpfsCommentToPageJsonComment),
|
|
100182
|
-
...
|
|
100412
|
+
...n$9(pageIpfs, ["comments"])
|
|
100183
100413
|
};
|
|
100184
100414
|
}
|
|
100185
100415
|
function parseModQueuePageIpfs(modqueuePageIpfs) {
|
|
100186
100416
|
return {
|
|
100187
100417
|
comments: modqueuePageIpfs.comments.map(mapModqueuePageIpfsCommentToModQueuePageJsonComment),
|
|
100188
|
-
...
|
|
100418
|
+
...n$9(modqueuePageIpfs, ["comments"])
|
|
100189
100419
|
};
|
|
100190
100420
|
}
|
|
100191
100421
|
function parsePagesIpfs(pagesRaw) {
|
|
100192
|
-
const keys =
|
|
100422
|
+
const keys = t$13(pagesRaw.pages);
|
|
100193
100423
|
const parsedPages = Object.values(pagesRaw.pages).map((pageIpfs) => parsePageIpfs(pageIpfs));
|
|
100194
100424
|
return {
|
|
100195
|
-
pages:
|
|
100425
|
+
pages: t$6(keys.map((key, i) => [key, parsedPages[i]])),
|
|
100196
100426
|
pageCids: pagesRaw.pageCids || {}
|
|
100197
100427
|
};
|
|
100198
100428
|
}
|
|
@@ -100225,7 +100455,7 @@ function findCommentInPageInstance(pageInstance, targetCommentCid) {
|
|
|
100225
100455
|
function findCommentInParsedPages(pageJson, targetCommentCid) {
|
|
100226
100456
|
if (!pageJson) throw Error("should define page json");
|
|
100227
100457
|
if (!targetCommentCid) throw Error("should define target comment cid");
|
|
100228
|
-
return
|
|
100458
|
+
return r$5(pageJson.comments, (comment) => comment.cid === targetCommentCid);
|
|
100229
100459
|
}
|
|
100230
100460
|
function findCommentInHierarchicalPageIpfsRecursively(page, targetCid) {
|
|
100231
100461
|
if (!page) throw Error("should define page ipfs");
|
|
@@ -100582,19 +100812,19 @@ var CommentClientsManager = class extends PublicationClientsManager {
|
|
|
100582
100812
|
return AbortSignal.any(signals);
|
|
100583
100813
|
}
|
|
100584
100814
|
_initKuboRpcClients() {
|
|
100585
|
-
if (this._pkc.clients.kuboRpcClients) for (const ipfsUrl of
|
|
100815
|
+
if (this._pkc.clients.kuboRpcClients) for (const ipfsUrl of t$13(this._pkc.clients.kuboRpcClients)) this.clients.kuboRpcClients = {
|
|
100586
100816
|
...this.clients.kuboRpcClients,
|
|
100587
100817
|
[ipfsUrl]: new CommentKuboRpcClient("stopped")
|
|
100588
100818
|
};
|
|
100589
100819
|
}
|
|
100590
100820
|
_initLibp2pJsClients() {
|
|
100591
|
-
for (const libp2pJsClientKey of
|
|
100821
|
+
for (const libp2pJsClientKey of t$13(this._pkc.clients.libp2pJsClients)) this.clients.libp2pJsClients = {
|
|
100592
100822
|
...this.clients.libp2pJsClients,
|
|
100593
100823
|
[libp2pJsClientKey]: new CommentLibp2pJsClient("stopped")
|
|
100594
100824
|
};
|
|
100595
100825
|
}
|
|
100596
100826
|
_initPKCRpcClients() {
|
|
100597
|
-
for (const rpcUrl of
|
|
100827
|
+
for (const rpcUrl of t$13(this._pkc.clients.pkcRpcClients)) this.clients.pkcRpcClients = {
|
|
100598
100828
|
...this.clients.pkcRpcClients,
|
|
100599
100829
|
[rpcUrl]: new CommentPKCRpcStateClient("stopped")
|
|
100600
100830
|
};
|
|
@@ -100971,7 +101201,7 @@ var CommentClientsManager = class extends PublicationClientsManager {
|
|
|
100971
101201
|
const cachedComment = this._pkc._memCaches.commentIpfs.get(cid);
|
|
100972
101202
|
if (cachedComment) {
|
|
100973
101203
|
fetchCommentLogger.trace("Serving comment CID from cache", cid);
|
|
100974
|
-
return
|
|
101204
|
+
return t$8(cachedComment);
|
|
100975
101205
|
}
|
|
100976
101206
|
const verifiedComment = await this._pkc._inflightFetchManager.withResource(InflightResourceTypes.COMMENT_IPFS, cid, async () => {
|
|
100977
101207
|
fetchCommentLogger.trace("Fetching comment CID", cid);
|
|
@@ -101337,14 +101567,14 @@ var CommentClientsManager = class extends PublicationClientsManager {
|
|
|
101337
101567
|
};
|
|
101338
101568
|
//#endregion
|
|
101339
101569
|
//#region dist/node/runtime/node/util.js
|
|
101340
|
-
const getDefaultDataPath = () => path
|
|
101570
|
+
const getDefaultDataPath = () => path.join(process.cwd(), ".pkc");
|
|
101341
101571
|
const getDefaultCommunityDbConfig = async (communityAddress, pkc) => {
|
|
101342
101572
|
let filename;
|
|
101343
101573
|
if (pkc.noData) filename = ":memory:";
|
|
101344
101574
|
else {
|
|
101345
101575
|
assert(typeof pkc.dataPath === "string", "pkc.dataPath need to be defined to get default community db config");
|
|
101346
|
-
filename = path
|
|
101347
|
-
await promises.mkdir(path
|
|
101576
|
+
filename = path.join(pkc.dataPath, "communities", communityAddress);
|
|
101577
|
+
await promises.mkdir(path.dirname(filename), { recursive: true });
|
|
101348
101578
|
}
|
|
101349
101579
|
return {
|
|
101350
101580
|
filename,
|
|
@@ -101443,7 +101673,7 @@ const setNativeFunctions = (newNativeFunctions) => {
|
|
|
101443
101673
|
};
|
|
101444
101674
|
const deleteOldCommunityInWindows = async (subPath, pkc) => {
|
|
101445
101675
|
const log = logger_default("pkc-js:community:deleteStaleCommunityInWindows");
|
|
101446
|
-
const communityAddress = path
|
|
101676
|
+
const communityAddress = path.basename(subPath);
|
|
101447
101677
|
await new Promise((resolve) => setTimeout(resolve, 1e4));
|
|
101448
101678
|
try {
|
|
101449
101679
|
await promises.rm(subPath, { force: true });
|
|
@@ -101467,7 +101697,7 @@ async function tryToDeleteCommunitiesThatFailedToBeDeletedBefore(pkc, log) {
|
|
|
101467
101697
|
}
|
|
101468
101698
|
const communitiesThatWereDeletedSuccessfully = [];
|
|
101469
101699
|
for (const communityAddress of deletedPersistentCommunities) {
|
|
101470
|
-
const communityPath = path
|
|
101700
|
+
const communityPath = path.join(pkc.dataPath, "communities", communityAddress);
|
|
101471
101701
|
try {
|
|
101472
101702
|
await promises.rm(communityPath, { force: true });
|
|
101473
101703
|
log(`Succeeded in deleting old db path (${communityAddress})`);
|
|
@@ -101476,7 +101706,7 @@ async function tryToDeleteCommunitiesThatFailedToBeDeletedBefore(pkc, log) {
|
|
|
101476
101706
|
log.error(`Failed to delete stale db (${communityAddress}). This error should go away after restarting the daemon or process`, e);
|
|
101477
101707
|
}
|
|
101478
101708
|
}
|
|
101479
|
-
const newPersistentDeletedCommunities =
|
|
101709
|
+
const newPersistentDeletedCommunities = r$8(n$10(deletedPersistentCommunities), communitiesThatWereDeletedSuccessfully);
|
|
101480
101710
|
if (newPersistentDeletedCommunities.length === 0) {
|
|
101481
101711
|
await pkc._storage.removeItem(STORAGE_KEYS[STORAGE_KEYS.PERSISTENT_DELETED_COMMUNITIES]);
|
|
101482
101712
|
log("Removed persistent deleted communities from storage because there are none left");
|
|
@@ -101491,7 +101721,7 @@ async function tryToDeleteCommunitiesThatFailedToBeDeletedBefore(pkc, log) {
|
|
|
101491
101721
|
function listCommunitiesSync(pkc) {
|
|
101492
101722
|
logger_default("pkc-js:listCommunitiesSync");
|
|
101493
101723
|
if (typeof pkc.dataPath !== "string") throw Error("pkc.dataPath needs to be defined to listCommunities");
|
|
101494
|
-
const communitiesPath = path
|
|
101724
|
+
const communitiesPath = path.join(pkc.dataPath, "communities");
|
|
101495
101725
|
const files = readdirSync(communitiesPath, {
|
|
101496
101726
|
recursive: false,
|
|
101497
101727
|
withFileTypes: false
|
|
@@ -101499,7 +101729,7 @@ function listCommunitiesSync(pkc) {
|
|
|
101499
101729
|
const communityFilesWeDontNeedToCheck = pkc.communities ? files.filter((address) => pkc.communities.includes(address)) : [];
|
|
101500
101730
|
const sqliteFiles = files.filter((address) => !communityFilesWeDontNeedToCheck.includes(address)).filter((address) => {
|
|
101501
101731
|
try {
|
|
101502
|
-
const filePath = path
|
|
101732
|
+
const filePath = path.join(communitiesPath, address);
|
|
101503
101733
|
if (!existsSync(filePath)) return false;
|
|
101504
101734
|
const fd = openSync(filePath, "r");
|
|
101505
101735
|
const buffer = Buffer.alloc(16);
|
|
@@ -101580,7 +101810,7 @@ var BackupAbortError = class extends Error {
|
|
|
101580
101810
|
async function backupCommunityDb(opts) {
|
|
101581
101811
|
const { sourcePath, destPath, includePrivateKey, onProgress, signal } = opts;
|
|
101582
101812
|
if (signal?.aborted) throw new BackupAbortError();
|
|
101583
|
-
await promises.mkdir(path
|
|
101813
|
+
await promises.mkdir(path.dirname(destPath), { recursive: true });
|
|
101584
101814
|
const partialPath = destPath + ".partial";
|
|
101585
101815
|
try {
|
|
101586
101816
|
await promises.unlink(partialPath);
|
|
@@ -101664,9 +101894,9 @@ async function statAndHashFile(filePath) {
|
|
|
101664
101894
|
}
|
|
101665
101895
|
async function moveCommunityDbToDeletedDirectory(communityAddress, pkc) {
|
|
101666
101896
|
if (typeof pkc.dataPath !== "string") throw Error("pkc.dataPath is not defined");
|
|
101667
|
-
const oldPath = path
|
|
101668
|
-
const newPath = path
|
|
101669
|
-
await promises.mkdir(path
|
|
101897
|
+
const oldPath = path.join(pkc.dataPath, "communities", communityAddress);
|
|
101898
|
+
const newPath = path.join(pkc.dataPath, "communities", "deleted", communityAddress);
|
|
101899
|
+
await promises.mkdir(path.join(pkc.dataPath, "communities", "deleted"), { recursive: true });
|
|
101670
101900
|
if (!existsSync(oldPath)) throw Error(`Source database ${oldPath} does not exist`);
|
|
101671
101901
|
try {
|
|
101672
101902
|
const sourceDb = new Database(oldPath, { fileMustExist: true });
|
|
@@ -101702,7 +101932,7 @@ async function createKuboRpcClient(kuboRpcClientOptions) {
|
|
|
101702
101932
|
}
|
|
101703
101933
|
async function monitorCommunitiesDirectory(pkc) {
|
|
101704
101934
|
const watchAbortController = new AbortController();
|
|
101705
|
-
const communitiesPath = path
|
|
101935
|
+
const communitiesPath = path.join(pkc.dataPath, "communities");
|
|
101706
101936
|
await promises.mkdir(communitiesPath, { recursive: true });
|
|
101707
101937
|
const extensionsToIgnore = [
|
|
101708
101938
|
".lock",
|
|
@@ -101740,9 +101970,9 @@ function calculateExpectedSignatureSize(newIpns) {
|
|
|
101740
101970
|
return Buffer.byteLength(JSON.stringify(mockSignature), "utf8");
|
|
101741
101971
|
}
|
|
101742
101972
|
function deriveCommentIpfsFromCommentTableRow(commentTableRow) {
|
|
101743
|
-
const commentIpfs =
|
|
101973
|
+
const commentIpfs = t$2(commentTableRow, t$13(CommentIpfsSchema.shape));
|
|
101744
101974
|
const finalCommentIpfsJson = {
|
|
101745
|
-
...
|
|
101975
|
+
...t$2(commentTableRow, commentTableRow.signature.signedPropertyNames),
|
|
101746
101976
|
...commentIpfs,
|
|
101747
101977
|
...commentTableRow.extraProps
|
|
101748
101978
|
};
|
|
@@ -101796,8 +102026,8 @@ function deriveDbPosts(opts) {
|
|
|
101796
102026
|
}
|
|
101797
102027
|
function resolveDbPostsCidRefs(opts) {
|
|
101798
102028
|
const { dbPosts, dbHandler } = opts;
|
|
101799
|
-
const commentUpdateCols =
|
|
101800
|
-
const commentIpfsCols = [...
|
|
102029
|
+
const commentUpdateCols = t$13(CommentUpdateSchema.shape);
|
|
102030
|
+
const commentIpfsCols = [...t$13(CommentIpfsSchema.shape), "extraProps"];
|
|
101801
102031
|
const pages = {};
|
|
101802
102032
|
const pageCids = {};
|
|
101803
102033
|
for (const [sortName, sortEntry] of Object.entries(dbPosts)) {
|
|
@@ -124355,7 +124585,7 @@ const runtimeOnlyCommunityFields = [
|
|
|
124355
124585
|
];
|
|
124356
124586
|
function omitRuntimeCommunityFields(community) {
|
|
124357
124587
|
if (!community) return {};
|
|
124358
|
-
return
|
|
124588
|
+
return n$9(community, runtimeOnlyCommunityFields);
|
|
124359
124589
|
}
|
|
124360
124590
|
function getCommunityNameFromWire(community) {
|
|
124361
124591
|
const wireCommunity = omitRuntimeCommunityFields(community);
|
|
@@ -124423,10 +124653,10 @@ var CommunityLibp2pJsClient = class extends GenericStateClient {};
|
|
|
124423
124653
|
//#region dist/node/community/community-gateway-selection.js
|
|
124424
124654
|
function selectWinningGatewayCommunity(opts) {
|
|
124425
124655
|
const { gatewayFetches, currentUpdatedAt, totalGateways, fallbackIpnsName } = opts;
|
|
124426
|
-
const gatewaysWithCommunity =
|
|
124656
|
+
const gatewaysWithCommunity = t$13(gatewayFetches).filter((gatewayUrl) => gatewayFetches[gatewayUrl].communityRecord);
|
|
124427
124657
|
if (gatewaysWithCommunity.length === 0) return void 0;
|
|
124428
|
-
const gatewaysWithError =
|
|
124429
|
-
const bestGatewayUrl =
|
|
124658
|
+
const gatewaysWithError = t$13(gatewayFetches).filter((gatewayUrl) => gatewayFetches[gatewayUrl].error);
|
|
124659
|
+
const bestGatewayUrl = n$6(gatewaysWithCommunity, [(gatewayUrl) => gatewayFetches[gatewayUrl].communityRecord.updatedAt, "desc"]);
|
|
124430
124660
|
const best = gatewayFetches[bestGatewayUrl];
|
|
124431
124661
|
if (best.communityRecord.updatedAt > currentUpdatedAt) return {
|
|
124432
124662
|
community: best.communityRecord,
|
|
@@ -124451,25 +124681,25 @@ var CommunityClientsManager = class extends PKCClientsManager {
|
|
|
124451
124681
|
hideClassPrivateProps(this);
|
|
124452
124682
|
}
|
|
124453
124683
|
_initKuboRpcClients() {
|
|
124454
|
-
if (this._pkc.clients.kuboRpcClients) for (const ipfsUrl of
|
|
124684
|
+
if (this._pkc.clients.kuboRpcClients) for (const ipfsUrl of t$13(this._pkc.clients.kuboRpcClients)) this.clients.kuboRpcClients = {
|
|
124455
124685
|
...this.clients.kuboRpcClients,
|
|
124456
124686
|
[ipfsUrl]: new CommunityKuboRpcClient("stopped")
|
|
124457
124687
|
};
|
|
124458
124688
|
}
|
|
124459
124689
|
_initPubsubKuboRpcClients() {
|
|
124460
|
-
for (const pubsubUrl of
|
|
124690
|
+
for (const pubsubUrl of t$13(this._pkc.clients.pubsubKuboRpcClients)) this.clients.pubsubKuboRpcClients = {
|
|
124461
124691
|
...this.clients.pubsubKuboRpcClients,
|
|
124462
124692
|
[pubsubUrl]: new CommunityKuboPubsubClient("stopped")
|
|
124463
124693
|
};
|
|
124464
124694
|
}
|
|
124465
124695
|
_initLibp2pJsClients() {
|
|
124466
|
-
if (this._pkc.clients.libp2pJsClients) for (const libp2pJsClientUrl of
|
|
124696
|
+
if (this._pkc.clients.libp2pJsClients) for (const libp2pJsClientUrl of t$13(this._pkc.clients.libp2pJsClients)) this.clients.libp2pJsClients = {
|
|
124467
124697
|
...this.clients.libp2pJsClients,
|
|
124468
124698
|
[libp2pJsClientUrl]: new CommunityLibp2pJsClient("stopped")
|
|
124469
124699
|
};
|
|
124470
124700
|
}
|
|
124471
124701
|
_initPKCRpcClients() {
|
|
124472
|
-
for (const rpcUrl of
|
|
124702
|
+
for (const rpcUrl of t$13(this._pkc.clients.pkcRpcClients)) this.clients.pkcRpcClients = {
|
|
124473
124703
|
...this.clients.pkcRpcClients,
|
|
124474
124704
|
[rpcUrl]: new CommunityPKCRpcStateClient("stopped")
|
|
124475
124705
|
};
|
|
@@ -124800,7 +125030,7 @@ var CommunityClientsManager = class extends PKCClientsManager {
|
|
|
124800
125030
|
const concurrencyLimit = 3;
|
|
124801
125031
|
const timeoutMs = this._pkc._timeouts["community-ipns"];
|
|
124802
125032
|
const queueLimit = pLimit(concurrencyLimit);
|
|
124803
|
-
const gatewaysSorted =
|
|
125033
|
+
const gatewaysSorted = t$13(this._pkc.clients.ipfsGateways).length <= concurrencyLimit ? t$13(this._pkc.clients.ipfsGateways) : await this._pkc._stats.sortGatewaysAccordingToScore("ipns");
|
|
124804
125034
|
const gatewayFetches = {};
|
|
124805
125035
|
for (const gatewayUrl of gatewaysSorted) {
|
|
124806
125036
|
const abortController = new AbortController();
|
|
@@ -124951,7 +125181,7 @@ var CommunityClientsManager = class extends PKCClientsManager {
|
|
|
124951
125181
|
try {
|
|
124952
125182
|
suitableCommunity = await new Promise((resolve, reject) => promisesToIterate.map((gatewayPromise, i) => gatewayPromise.then(async (res) => {
|
|
124953
125183
|
if ("error" in res) Object.values(gatewayFetches)[i].error = res.error;
|
|
124954
|
-
if (
|
|
125184
|
+
if (t$13(gatewayFetches).filter((gatewayUrl) => gatewayFetches[gatewayUrl].error).length === gatewaysSorted.length) reject("All gateways failed to fetch community record " + ipnsName);
|
|
124955
125185
|
const recentCommunity = _findRecentCommunity();
|
|
124956
125186
|
if (recentCommunity) {
|
|
124957
125187
|
cleanUp();
|
|
@@ -124961,7 +125191,7 @@ var CommunityClientsManager = class extends PKCClientsManager {
|
|
|
124961
125191
|
} catch {
|
|
124962
125192
|
cleanUp();
|
|
124963
125193
|
throwIfAbortSignalAborted(stopSignal);
|
|
124964
|
-
const gatewayToError =
|
|
125194
|
+
const gatewayToError = t$4(gatewayFetches, (gatewayFetch) => gatewayFetch.error);
|
|
124965
125195
|
if (Object.keys(gatewayFetches).map((gatewayUrl) => gatewayFetches[gatewayUrl].error).some((err) => err.details?.status === 304 || err.code === "ERR_GATEWAY_ABORTING_LOADING_COMMUNITY_BECAUSE_WE_ALREADY_LOADED_THIS_RECORD")) return void 0;
|
|
124966
125196
|
const combinedError = new FailedToFetchCommunityFromGatewaysError({
|
|
124967
125197
|
ipnsName,
|
|
@@ -125226,10 +125456,10 @@ var RemoteCommunity = class extends import_lib$1.TypedEmitter {
|
|
|
125226
125456
|
const log = logger_default("pkc-js:remote-community:initCommunityIpfsPropsNoMerge");
|
|
125227
125457
|
this.raw.communityIpfs = newProps;
|
|
125228
125458
|
this.initRemoteCommunityPropsNoMerge(newProps);
|
|
125229
|
-
const unknownProps =
|
|
125459
|
+
const unknownProps = r$8(t$13(this.raw.communityIpfs), t$13(CommunityIpfsSchema.shape));
|
|
125230
125460
|
if (unknownProps.length > 0) {
|
|
125231
125461
|
log(`Found unknown props on community (${this.address}) ipfs record`, unknownProps);
|
|
125232
|
-
Object.assign(this,
|
|
125462
|
+
Object.assign(this, t$2(this.raw.communityIpfs, unknownProps));
|
|
125233
125463
|
}
|
|
125234
125464
|
}
|
|
125235
125465
|
_updateIpnsPubsubPropsIfNeeded(newProps) {
|
|
@@ -125329,8 +125559,8 @@ var RemoteCommunity = class extends import_lib$1.TypedEmitter {
|
|
|
125329
125559
|
this._assertHasIdentity();
|
|
125330
125560
|
}
|
|
125331
125561
|
_toJSONIpfsBaseNoPosts() {
|
|
125332
|
-
const communityIpfsKeys =
|
|
125333
|
-
return
|
|
125562
|
+
const communityIpfsKeys = t$13(n$9(CommunityIpfsSchema.shape, ["posts", "modQueue"]));
|
|
125563
|
+
return t$2(this, communityIpfsKeys);
|
|
125334
125564
|
}
|
|
125335
125565
|
toJSONRpcRemote() {
|
|
125336
125566
|
if (!this.updateCid || !this.raw.communityIpfs) return {
|
|
@@ -125509,7 +125739,7 @@ var RemoteCommunity = class extends import_lib$1.TypedEmitter {
|
|
|
125509
125739
|
this._updatingCommunityInstanceWithListeners.community.on("updatingstatechange", this._updatingCommunityInstanceWithListeners.updatingstatechange);
|
|
125510
125740
|
this._updatingCommunityInstanceWithListeners.community.on("error", this._updatingCommunityInstanceWithListeners.error);
|
|
125511
125741
|
this._updatingCommunityInstanceWithListeners.community.on("statechange", this._updatingCommunityInstanceWithListeners.statechange);
|
|
125512
|
-
const clientKeys =
|
|
125742
|
+
const clientKeys = t$13(this.clients);
|
|
125513
125743
|
for (const clientType of clientKeys) if (this.clients[clientType]) for (const clientUrl of Object.keys(this.clients[clientType])) this.clients[clientType][clientUrl].mirror(this._updatingCommunityInstanceWithListeners.community.clients[clientType][clientUrl]);
|
|
125514
125744
|
this._updatingCommunityInstanceWithListeners.community._numOfListenersForUpdatingInstance++;
|
|
125515
125745
|
if (this._updatingCommunityInstanceWithListeners.community.state === "stopped") {
|
|
@@ -125537,7 +125767,7 @@ var RemoteCommunity = class extends import_lib$1.TypedEmitter {
|
|
|
125537
125767
|
this._updatingCommunityInstanceWithListeners.community.removeListener("update", this._updatingCommunityInstanceWithListeners.update);
|
|
125538
125768
|
this._updatingCommunityInstanceWithListeners.community.removeListener("updatingstatechange", this._updatingCommunityInstanceWithListeners.updatingstatechange);
|
|
125539
125769
|
this._updatingCommunityInstanceWithListeners.community.removeListener("error", this._updatingCommunityInstanceWithListeners.error);
|
|
125540
|
-
const clientKeys =
|
|
125770
|
+
const clientKeys = t$13(this.clients);
|
|
125541
125771
|
for (const clientType of clientKeys) if (this.clients[clientType]) for (const clientUrl of Object.keys(this.clients[clientType])) this.clients[clientType][clientUrl].unmirror();
|
|
125542
125772
|
this._updatingCommunityInstanceWithListeners.community._numOfListenersForUpdatingInstance--;
|
|
125543
125773
|
if (this._updatingCommunityInstanceWithListeners.community._numOfListenersForUpdatingInstance === 0 && this._updatingCommunityInstanceWithListeners.community.state !== "stopped") {
|
|
@@ -125595,11 +125825,11 @@ var AddressRewriterDatabase = class {
|
|
|
125595
125825
|
if (kuboConfig && typeof kuboConfig === "object" && "host" in kuboConfig && "port" in kuboConfig) kuboIdentifier = `${kuboConfig.host}_${kuboConfig.port}`;
|
|
125596
125826
|
const proxyIdentifier = `${proxyTarget.hostname}_${proxyTarget.port || (proxyTarget.protocol === "https:" ? "443" : "80")}`;
|
|
125597
125827
|
const fileName = `address_rewriter_${kuboIdentifier}_${proxyIdentifier}.db`;
|
|
125598
|
-
return
|
|
125828
|
+
return Path.join(dataPath, ".address-rewriter", fileName);
|
|
125599
125829
|
}
|
|
125600
125830
|
async initialize() {
|
|
125601
125831
|
try {
|
|
125602
|
-
const dbDir =
|
|
125832
|
+
const dbDir = Path.dirname(this._dbPath);
|
|
125603
125833
|
await fsp.mkdir(dbDir, { recursive: true });
|
|
125604
125834
|
this._db = new Database(this._dbPath);
|
|
125605
125835
|
this._db.exec(`
|
|
@@ -125704,7 +125934,7 @@ const debug = logger_default("pkc-js:addresses-rewriter");
|
|
|
125704
125934
|
const MAX_BODY_PREVIEW_BYTES = 4096;
|
|
125705
125935
|
function normalizeSelfAddrsForProvider(addrs, peerId) {
|
|
125706
125936
|
const suffix = `/p2p/${peerId}`;
|
|
125707
|
-
return
|
|
125937
|
+
return n$10(addrs.map((addr) => addr.endsWith(suffix) ? addr.slice(0, -suffix.length) : addr));
|
|
125708
125938
|
}
|
|
125709
125939
|
var AddressesRewriterProxyServer = class {
|
|
125710
125940
|
constructor({ kuboClients: kuboClient, port, hostname, proxyTargetUrl, pkc }) {
|
|
@@ -125936,7 +126166,7 @@ var AddressesRewriterProxyServer = class {
|
|
|
125936
126166
|
const peerId = idRes.id.toString();
|
|
125937
126167
|
if (typeof peerId !== "string") throw Error("Failed to get Peer ID of kubo node");
|
|
125938
126168
|
const swarmListeningAddresses = swarmAddrsRes.filter((swarmAddr) => swarmAddr.id.toString() === peerId);
|
|
125939
|
-
const addresses = normalizeSelfAddrsForProvider([...idRes.addresses.map((addr) => addr.toString()), ...
|
|
126169
|
+
const addresses = normalizeSelfAddrsForProvider([...idRes.addresses.map((addr) => addr.toString()), ...n$5(swarmListeningAddresses.map((swarmAddr) => swarmAddr.addrs.map((addr) => addr.toString())))], peerId);
|
|
125940
126170
|
if (addresses.length === 0) throw Error(`Failed to get any addresses for peer ${peerId}`);
|
|
125941
126171
|
this.addresses[peerId] = addresses;
|
|
125942
126172
|
resolve();
|
|
@@ -128277,8 +128507,7 @@ const getChallenge = async ({ challengeSettings, challengeRequestMessage }) => {
|
|
|
128277
128507
|
const matchResults = [];
|
|
128278
128508
|
for (const match of matches) {
|
|
128279
128509
|
const { propertyName, regexp } = match;
|
|
128280
|
-
const
|
|
128281
|
-
const value = import_commonjs.pathOr(publication, pathSegments, void 0);
|
|
128510
|
+
const value = t$3(publication, t(propertyName), void 0);
|
|
128282
128511
|
if (value === void 0) {
|
|
128283
128512
|
matchResults.push({
|
|
128284
128513
|
success: false,
|
|
@@ -128828,7 +129057,7 @@ const getChallengeVerification = async ({ challengeRequestMessage, community, ge
|
|
|
128828
129057
|
let pendingApprovalSuccess = "pendingApprovalSuccess" in res ? res.pendingApprovalSuccess : false;
|
|
128829
129058
|
let challengeVerification;
|
|
128830
129059
|
if ("pendingChallenges" in res) {
|
|
128831
|
-
const challengeAnswers = await getChallengeAnswers(res.pendingChallenges.map((challenge) =>
|
|
129060
|
+
const challengeAnswers = await getChallengeAnswers(res.pendingChallenges.map((challenge) => n$9(challenge, ["index", "verify"])));
|
|
128832
129061
|
const verificationFromPending = await getChallengeVerificationFromChallengeAnswers({
|
|
128833
129062
|
pendingChallenges: res.pendingChallenges,
|
|
128834
129063
|
challengeAnswers,
|
|
@@ -128840,7 +129069,7 @@ const getChallengeVerification = async ({ challengeRequestMessage, community, ge
|
|
|
128840
129069
|
});
|
|
128841
129070
|
if ("pendingApprovalSuccess" in verificationFromPending) {
|
|
128842
129071
|
pendingApprovalSuccess = pendingApprovalSuccess || verificationFromPending.pendingApprovalSuccess;
|
|
128843
|
-
challengeVerification =
|
|
129072
|
+
challengeVerification = n$9(verificationFromPending, ["pendingApprovalSuccess"]);
|
|
128844
129073
|
} else {
|
|
128845
129074
|
pendingApprovalSuccess = false;
|
|
128846
129075
|
challengeVerification = verificationFromPending;
|
|
@@ -128902,12 +129131,12 @@ var RpcRemoteCommunity = class extends RemoteCommunity {
|
|
|
128902
129131
|
this._updatingRpcCommunityInstanceWithListeners = void 0;
|
|
128903
129132
|
}
|
|
128904
129133
|
_setRpcClientStateWithoutEmission(newState) {
|
|
128905
|
-
const currentRpcUrl =
|
|
129134
|
+
const currentRpcUrl = t$13(this.clients.pkcRpcClients)[0];
|
|
128906
129135
|
if (newState === this.clients.pkcRpcClients[currentRpcUrl].state) return;
|
|
128907
129136
|
this.clients.pkcRpcClients[currentRpcUrl].state = newState;
|
|
128908
129137
|
}
|
|
128909
129138
|
_setRpcClientStateWithEmission(newState) {
|
|
128910
|
-
const currentRpcUrl =
|
|
129139
|
+
const currentRpcUrl = t$13(this.clients.pkcRpcClients)[0];
|
|
128911
129140
|
if (newState === this.clients.pkcRpcClients[currentRpcUrl].state) return;
|
|
128912
129141
|
this.clients.pkcRpcClients[currentRpcUrl].state = newState;
|
|
128913
129142
|
this.clients.pkcRpcClients[currentRpcUrl].emit("statechange", newState);
|
|
@@ -128995,7 +129224,7 @@ var RpcRemoteCommunity = class extends RemoteCommunity {
|
|
|
128995
129224
|
this._updatingRpcCommunityInstanceWithListeners.community.on("challengeanswer", this._updatingRpcCommunityInstanceWithListeners.challengeanswer);
|
|
128996
129225
|
this._updatingRpcCommunityInstanceWithListeners.community.on("challenge", this._updatingRpcCommunityInstanceWithListeners.challenge);
|
|
128997
129226
|
this._updatingRpcCommunityInstanceWithListeners.community.on("startedstatechange", this._updatingRpcCommunityInstanceWithListeners.startedstatechange);
|
|
128998
|
-
const clientKeys =
|
|
129227
|
+
const clientKeys = t$13(this.clients);
|
|
128999
129228
|
for (const clientType of clientKeys) if (updatingCommunity.clients[clientType]) for (const clientUrl of Object.keys(updatingCommunity.clients[clientType])) this.clients[clientType][clientUrl].mirror(updatingCommunity.clients[clientType][clientUrl]);
|
|
129000
129229
|
this._updatingRpcCommunityInstanceWithListeners.community._numOfListenersForUpdatingInstance++;
|
|
129001
129230
|
const nameResolvedBeforeMirror = this.nameResolved;
|
|
@@ -129086,7 +129315,7 @@ var RpcRemoteCommunity = class extends RemoteCommunity {
|
|
|
129086
129315
|
this._updatingRpcCommunityInstanceWithListeners.community.removeListener("challengeanswer", this._updatingRpcCommunityInstanceWithListeners.challengeanswer);
|
|
129087
129316
|
this._updatingRpcCommunityInstanceWithListeners.community.removeListener("challenge", this._updatingRpcCommunityInstanceWithListeners.challenge);
|
|
129088
129317
|
this._updatingRpcCommunityInstanceWithListeners.community.removeListener("startedstatechange", this._updatingRpcCommunityInstanceWithListeners.startedstatechange);
|
|
129089
|
-
const clientKeys =
|
|
129318
|
+
const clientKeys = t$13(this.clients);
|
|
129090
129319
|
for (const clientType of clientKeys) if (this.clients[clientType]) for (const clientUrl of Object.keys(this.clients[clientType])) this.clients[clientType][clientUrl].unmirror();
|
|
129091
129320
|
this._updatingRpcCommunityInstanceWithListeners.community._numOfListenersForUpdatingInstance--;
|
|
129092
129321
|
if (this._updatingRpcCommunityInstanceWithListeners.community._numOfListenersForUpdatingInstance === 0 && this._updatingRpcCommunityInstanceWithListeners.community.state === "updating") {
|
|
@@ -129139,7 +129368,7 @@ var RpcLocalCommunity = class extends RpcRemoteCommunity {
|
|
|
129139
129368
|
this.edit = this.edit.bind(this);
|
|
129140
129369
|
this._setStartedStateWithEmission("stopped");
|
|
129141
129370
|
this.on("update", () => {
|
|
129142
|
-
this.editable =
|
|
129371
|
+
this.editable = t$2(this, t$13(CommunityEditOptionsSchema.shape));
|
|
129143
129372
|
});
|
|
129144
129373
|
hideClassPrivateProps(this);
|
|
129145
129374
|
}
|
|
@@ -129192,7 +129421,7 @@ var RpcLocalCommunity = class extends RpcRemoteCommunity {
|
|
|
129192
129421
|
this.started = newProps.localCommunity.started;
|
|
129193
129422
|
this.updateCid = newProps.runtimeFields.updateCid;
|
|
129194
129423
|
this.raw.localCommunity = newProps;
|
|
129195
|
-
this.editable =
|
|
129424
|
+
this.editable = t$2(this, t$13(CommunityEditOptionsSchema.shape));
|
|
129196
129425
|
}
|
|
129197
129426
|
_updateRpcClientStateFromStartedState(startedState) {
|
|
129198
129427
|
({
|
|
@@ -129456,4 +129685,4 @@ var RpcLocalCommunity = class extends RpcRemoteCommunity {
|
|
|
129456
129685
|
}
|
|
129457
129686
|
};
|
|
129458
129687
|
//#endregion
|
|
129459
|
-
export { RepliesPages as $, parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails as $t, deriveDbPosts as A, RpcCidParamSchema as An, verifyCommunityEdit as At, setNativeFunctions as B, RpcFetchCidResultSchema as Bn, getCommunityPublicKeyFromWire as Bt, BackupAbortError as C, parseRpcCommentEventWithPKCErrorIfItFails as Cn, verifyChallengeVerification as Ct, createKuboRpcClient as D, parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails as Dn, verifyCommentPubsubMessage as Dt, calculateInlineRepliesBudget as E, parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as En, verifyCommentModeration as Et, importSignerIntoKuboNode as F, RpcExportCommunityModLogsParamSchema as Fn, getAuthorNameFromWire as Ft, REPLY_REPLIES_SORT_TYPES as G, RpcUnsubscribeParamSchema as Gn, getIpfsKeyFromPrivateKey as Gt, CommentClientsManager as H, RpcResolveAuthorNameResultSchema as Hn, decode as Ht, listCommunitiesSync as I, RpcExportCommunityModLogsResultSchema as In, normalizeCreatePublicationAuthor as It, buildPagesRuntimeFields as J,
|
|
129688
|
+
export { RepliesPages as $, t$8 as $n, parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails as $t, deriveDbPosts as A, RpcCidParamSchema as An, verifyCommunityEdit as At, setNativeFunctions as B, RpcFetchCidResultSchema as Bn, getCommunityPublicKeyFromWire as Bt, BackupAbortError as C, parseRpcCommentEventWithPKCErrorIfItFails as Cn, verifyChallengeVerification as Ct, createKuboRpcClient as D, parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails as Dn, verifyCommentPubsubMessage as Dt, calculateInlineRepliesBudget as E, parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as En, verifyCommentModeration as Et, importSignerIntoKuboNode as F, RpcExportCommunityModLogsParamSchema as Fn, getAuthorNameFromWire as Ft, REPLY_REPLIES_SORT_TYPES as G, RpcUnsubscribeParamSchema as Gn, getIpfsKeyFromPrivateKey as Gt, CommentClientsManager as H, RpcResolveAuthorNameResultSchema as Hn, decode as Ht, listCommunitiesSync as I, RpcExportCommunityModLogsResultSchema as In, normalizeCreatePublicationAuthor as It, buildPagesRuntimeFields as J, r as Jn, getPublicKeyFromPrivateKey as Jt, TIMEFRAMES_TO_SECONDS as K, t$2 as Kn, getPKCAddressFromPublicKey as Kt, monitorCommunitiesDirectory as L, RpcExportCommunityParamSchema as Ln, buildRuntimeCommunityFields as Lt, getDefaultCommunityDbConfig as M, RpcCommunityIdentifierParamSchema as Mn, buildRuntimeAuthor as Mt, getDefaultDataPath as N, RpcCommunityPageParamSchema as Nn, cleanWireAuthor as Nt, deleteOldCommunityInWindows as O, RpcAuthorNameParamSchema as On, verifyCommentUpdate as Ot, getThumbnailPropsOfLink as P, RpcEditCommunityParamSchema as Pn, getAuthorNameFromRuntime as Pt, parseRawPages as Q, t$7 as Qn, parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as Qt, moveCommunityDbToDeletedDirectory as R, RpcExportCommunityResultSchema as Rn, getCommunityAddressFromRecord as Rt, encryptEd25519AesGcmPublicKeyBuffer as S, parsePKCUserOptionsSchemaWithPKCErrorIfItFails as Sn, verifyChallengeRequest as St, calculateExpectedSignatureSize as T, parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails as Tn, verifyCommentIpfs as Tt, POSTS_SORT_TYPES as U, RpcSubscriptionIdResultSchema as Un, encode as Ut, tryToDeleteCommunitiesThatFailedToBeDeletedBefore as V, RpcPublishChallengeAnswersParamSchema as Vn, normalizeCommunityInputFromCommunity as Vt, POST_REPLIES_SORT_TYPES as W, RpcSuccessResultSchema as Wn, getBufferedPKCAddressFromPublicKey as Wt, findCommentInPageInstanceRecursively as X, n$5 as Xn, parseCidStringSchemaWithPKCErrorIfItFails as Xt, extractCommunityRuntimeFieldsFromParsedPages as Y, t$5 as Yn, createSchemaRowParser as Yt, iterateOverPageCidsToFindAllCids as Z, n$6 as Zn, parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as Zt, SignerWithPublicKeyAddress as _, parseCreateVoteOptionsSchemaWithPKCErrorIfItFails as _n, signCommunity as _t, pkcJsChallenges as a, parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as an, PKCTypedEmitter as at, decryptEd25519AesGcmPublicKeyBuffer as b, parseDecryptedChallengeWithPKCErrorIfItFails as bn, verifyChallengeAnswer as bt, AddressesRewriterProxyServer as c, parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails as cn, signChallengeAnswer as ct, MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS as d, parseCreateCommentOptionsSchemaWithPKCErrorIfItFails as dn, signChallengeVerification as dt, parseCommentIpfsSchemaWithPKCErrorIfItFails as en, stringify as er, PublicationClientsManager as et, KeyvBetterSqlite3 as f, parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails as fn, signComment as ft, decodeRpcChallengeVerificationPubsubMsg as g, parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails as gn, signCommentUpdateForChallengeVerification as gt, decodeRpcChallengeRequestPubsubMsg as h, parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails as hn, signCommentUpdate as ht, getCommunityChallengeFromCommunityChallengeSettings as i, parseCommunityAddressWithPKCErrorIfItFails as in, require_undici as ir, pLimit as it, deriveDbReplies as j, RpcCommentRepliesPageParamSchema as jn, verifyVote as jt, deriveCommentIpfsFromCommentTableRow as k, RpcCancelExportParamSchema as kn, verifyCommunity as kt, normalizeSelfAddrsForProvider as l, parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails as ln, signChallengeMessage as lt, decodeRpcChallengePubsubMsg as m, parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails as mn, signCommentModeration as mt, RpcRemoteCommunity as n, parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails as nn, require_lodash_merge as nr, InflightFetchManager as nt, TrackedInstanceRegistry as o, parseCommunityEditOptionsSchemaWithPKCErrorIfItFails as on, require_lib$1 as ot, decodeRpcChallengeAnswerPubsubMsg as p, parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails as pn, signCommentEdit as pt, buildPageRuntimeFields as q, t$4 as qn, getPKCAddressFromPublicKeySync as qt, getChallengeVerification as r, parseCommentPubsubMessagePublicationWithPKCErrorIfItFails as rn, nativeFunctions$1 as rr, pRetry as rt, LRUCache as s, parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails as sn, cleanUpBeforePublishing as st, RpcLocalCommunity as t, parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as tn, STORAGE_KEYS as tr, PKCClientsManager as tt, RemoteCommunity as u, parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails as un, signChallengeRequest as ut, createSigner as v, parseDecryptedChallengeAnswerWithPKCErrorIfItFails as vn, signCommunityEdit as vt, backupCommunityDb as w, parseRpcCommentUpdateEventWithPKCErrorIfItFails as wn, verifyCommentEdit as wt, encryptEd25519AesGcm as x, parseJsonWithPKCErrorIfFails as xn, verifyChallengeMessage as xt, decryptEd25519AesGcm as y, parseDecryptedChallengeVerification as yn, signVote as yt, resolveDbPostsCidRefs as z, RpcFetchCidParamSchema as zn, getCommunityNameFromWire$1 as zt };
|