@pkcprotocol/pkc-js 0.0.62 → 0.0.64
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 +15 -15
- package/dist/browser/clients/base-client-manager.js.map +1 -1
- package/dist/browser/community/community-client-manager.js +10 -12
- 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/generated-version.d.ts +1 -1
- package/dist/browser/generated-version.js +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 +19 -13
- package/dist/browser/pkc/pkc.js.map +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 +16 -16
- 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 +54 -15
- 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/browser/util.d.ts +1 -1
- package/dist/browser/runtime/browser/util.js +4 -2
- package/dist/browser/runtime/browser/util.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.d.ts +1 -1
- package/dist/browser/runtime/node/util.js +12 -8
- package/dist/browser/runtime/node/util.js.map +1 -1
- package/dist/browser/schema/schema.js +4 -4
- 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/types.d.ts +1 -1
- package/dist/browser/util.d.ts +2 -2
- package/dist/browser/util.js +24 -22
- package/dist/browser/util.js.map +1 -1
- package/dist/bundled/bundle-manifest.json +242 -312
- package/dist/bundled/chunks/chunk-2rV9d50f.js +35 -0
- package/dist/bundled/chunks/{helia-for-pkc-55fcY7oN.js → helia-for-pkc-CYDRSysz.js} +6 -6
- package/dist/bundled/chunks/{local-community-Bdasy8ZJ.js → local-community-DYvRQWsK.js} +148 -98
- package/dist/bundled/chunks/{local-community-Bz-P-EGM.js → local-community-DyaGG6lj.js} +1 -1
- package/dist/bundled/chunks/{node-DU0tGecu.js → node-DadVit9c.js} +50 -43
- package/dist/bundled/chunks/{rpc-local-community-NkCEOv2-.js → rpc-local-community-1Uvl5iwp.js} +343 -111
- package/dist/bundled/chunks/schema-Dtvt2tQ8.js +16182 -0
- package/dist/bundled/chunks/src-0J9-Tmgd.js +4147 -0
- package/dist/bundled/chunks/src-4u0f92eE.js +9899 -0
- package/dist/bundled/chunks/src-BOzgM7Fp.js +800 -0
- package/dist/bundled/chunks/src-CYIMjhjK.js +48 -0
- package/dist/bundled/chunks/{util-DpR-szdu.js → util-CjfTxkQ8.js} +1 -1
- package/dist/bundled/index.js +1 -1
- package/dist/bundled/rpc/src/index.js +44 -25
- package/dist/node/clients/base-client-manager.js +15 -15
- package/dist/node/clients/base-client-manager.js.map +1 -1
- package/dist/node/community/community-client-manager.js +10 -12
- 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/generated-version.d.ts +1 -1
- package/dist/node/generated-version.js +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 +19 -13
- package/dist/node/pkc/pkc.js.map +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 +16 -16
- 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 +54 -15
- 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/browser/util.d.ts +1 -1
- package/dist/node/runtime/browser/util.js +4 -2
- package/dist/node/runtime/browser/util.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.d.ts +1 -1
- package/dist/node/runtime/node/util.js +12 -8
- package/dist/node/runtime/node/util.js.map +1 -1
- package/dist/node/schema/schema.js +4 -4
- 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/types.d.ts +1 -1
- package/dist/node/util.d.ts +2 -2
- package/dist/node/util.js +24 -22
- package/dist/node/util.js.map +1 -1
- package/package.json +2 -2
- package/dist/bundled/chunks/schema-qXcvCeAO.js +0 -34744
package/dist/bundled/chunks/{rpc-local-community-NkCEOv2-.js → rpc-local-community-1Uvl5iwp.js}
RENAMED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as __toESM, n as __exportAll, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
|
|
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-Dtvt2tQ8.js";
|
|
3
|
+
import { t as all } from "./src-CYIMjhjK.js";
|
|
2
4
|
import http from "node:http";
|
|
3
5
|
import { createHash } from "node:crypto";
|
|
4
6
|
import { pathToFileURL } from "node:url";
|
|
5
|
-
import
|
|
7
|
+
import fsp from "node:fs/promises";
|
|
6
8
|
import path from "node:path";
|
|
7
9
|
import dns from "node:dns";
|
|
8
10
|
import os from "os";
|
|
@@ -11,18 +13,18 @@ import path$1 from "path";
|
|
|
11
13
|
import assert from "assert";
|
|
12
14
|
import { Agent } from "https";
|
|
13
15
|
import { Agent as Agent$1 } from "http";
|
|
14
|
-
import { CID } from "multiformats/cid";
|
|
15
|
-
import { bases } from "multiformats/basics";
|
|
16
|
-
import { fromString } from "uint8arrays/from-string";
|
|
17
|
-
import { peerIdFromMultihash, peerIdFromPrivateKey, peerIdFromPublicKey, peerIdFromString } from "@libp2p/peer-id";
|
|
18
|
-
import https from "node:https";
|
|
19
|
-
import { toString } from "uint8arrays/to-string";
|
|
20
|
-
import { privateKeyFromProtobuf, privateKeyFromRaw, privateKeyToProtobuf, publicKeyFromRaw, publicKeyToProtobuf } from "@libp2p/crypto/keys";
|
|
21
16
|
import Database from "better-sqlite3";
|
|
17
|
+
import { CID } from "multiformats/cid";
|
|
22
18
|
import * as Digest from "multiformats/hashes/digest";
|
|
23
19
|
import { of } from "typestub-ipfs-only-hash";
|
|
24
|
-
import {
|
|
20
|
+
import { toString } from "uint8arrays/to-string";
|
|
21
|
+
import { peerIdFromMultihash, peerIdFromPrivateKey, peerIdFromPublicKey, peerIdFromString } from "@libp2p/peer-id";
|
|
22
|
+
import { privateKeyFromProtobuf, privateKeyFromRaw, privateKeyToProtobuf, publicKeyFromRaw, publicKeyToProtobuf } from "@libp2p/crypto/keys";
|
|
23
|
+
import { fromString } from "uint8arrays/from-string";
|
|
24
|
+
import { bases } from "multiformats/basics";
|
|
25
25
|
import { EventEmitter as EventEmitter$1 } from "events";
|
|
26
|
+
import { concat } from "uint8arrays/concat";
|
|
27
|
+
import https from "node:https";
|
|
26
28
|
import { performance as performance$1 } from "perf_hooks";
|
|
27
29
|
//#region node_modules/undici/lib/core/symbols.js
|
|
28
30
|
var require_symbols = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -88343,7 +88345,7 @@ var require_package$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
88343
88345
|
//#endregion
|
|
88344
88346
|
//#region node_modules/needle/lib/needle.js
|
|
88345
88347
|
var require_needle = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
88346
|
-
var fs
|
|
88348
|
+
var fs = __require("fs"), http$2 = __require("http"), https$1 = __require("https"), url = __require("url"), stream = __require("stream"), debug$2 = require_src()("needle"), stringify$1 = require_querystring().build, multipart = require_multipart(), auth = require_auth(), cookies = require_cookies(), parsers = require_parsers(), decoder = require_decoder();
|
|
88347
88349
|
var version = require_package$1().version;
|
|
88348
88350
|
var user_agent = "Needle/" + version;
|
|
88349
88351
|
user_agent += " (Node.js " + process.version + "; " + process.platform + " " + process.arch + ")";
|
|
@@ -88435,7 +88437,7 @@ var require_needle = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
88435
88437
|
function get_stream_length(stream, given_length, cb) {
|
|
88436
88438
|
if (given_length > 0) return cb(given_length);
|
|
88437
88439
|
if (stream.end !== void 0 && stream.end !== Infinity && stream.start !== void 0) return cb(stream.end + 1 - (stream.start || 0));
|
|
88438
|
-
fs
|
|
88440
|
+
fs.stat(stream.path, function(err, stat) {
|
|
88439
88441
|
cb(stat ? stat.size - (stream.start || 0) : null);
|
|
88440
88442
|
});
|
|
88441
88443
|
}
|
|
@@ -88698,7 +88700,7 @@ var require_needle = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
88698
88700
|
if (err && err.message == "write after end") request.destroy();
|
|
88699
88701
|
});
|
|
88700
88702
|
if (config.output && resp.statusCode == 200) {
|
|
88701
|
-
var file = fs
|
|
88703
|
+
var file = fs.createWriteStream(config.output);
|
|
88702
88704
|
file.on("error", had_error);
|
|
88703
88705
|
out.on("end", function() {
|
|
88704
88706
|
if (file.writable) file.end();
|
|
@@ -91409,9 +91411,239 @@ var import_safe_stable_stringify = /* @__PURE__ */ __toESM(require_safe_stable_s
|
|
|
91409
91411
|
const configure = import_safe_stable_stringify.configure;
|
|
91410
91412
|
const stringify = import_safe_stable_stringify.default;
|
|
91411
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
|
|
91412
91645
|
//#region dist/node/clients/rpc-client/schema.js
|
|
91413
91646
|
var import_retry = /* @__PURE__ */ __toESM(require_retry$1(), 1);
|
|
91414
|
-
var import_commonjs = /* @__PURE__ */ __toESM(require_commonjs$4(), 1);
|
|
91415
91647
|
var import_sha256 = require_sha256$1();
|
|
91416
91648
|
const SubscriptionIdSchema = number().positive().int();
|
|
91417
91649
|
const RpcCommentEventResultSchema = object({
|
|
@@ -97274,11 +97506,11 @@ const runtimeOnlyAuthorFields = [
|
|
|
97274
97506
|
];
|
|
97275
97507
|
function omitRuntimeAuthorFields(author) {
|
|
97276
97508
|
if (!author) return {};
|
|
97277
|
-
return
|
|
97509
|
+
return n$9(author, runtimeOnlyAuthorFields);
|
|
97278
97510
|
}
|
|
97279
97511
|
function cleanWireAuthor(author) {
|
|
97280
97512
|
const wireAuthor = omitRuntimeAuthorFields(author);
|
|
97281
|
-
if (
|
|
97513
|
+
if (e$5(wireAuthor)) return void 0;
|
|
97282
97514
|
return wireAuthor;
|
|
97283
97515
|
}
|
|
97284
97516
|
function normalizeCreatePublicationAuthor(author) {
|
|
@@ -97343,7 +97575,7 @@ async function _validateAuthorAddressBeforeSigning(author, signer, pkc) {
|
|
|
97343
97575
|
}
|
|
97344
97576
|
async function _signJson(signedPropertyNames, cleanedPublication, signer, log) {
|
|
97345
97577
|
assert(signer.publicKey && typeof signer.type === "string" && signer.privateKey, "Signer props need to be defined befoe signing");
|
|
97346
|
-
const propsToSign =
|
|
97578
|
+
const propsToSign = t$2(cleanedPublication, signedPropertyNames);
|
|
97347
97579
|
let publicationEncoded;
|
|
97348
97580
|
try {
|
|
97349
97581
|
publicationEncoded = encode(propsToSign, cborgEncodeOptions);
|
|
@@ -97356,12 +97588,12 @@ async function _signJson(signedPropertyNames, cleanedPublication, signer, log) {
|
|
|
97356
97588
|
signature: toString(await signBufferEd25519(publicationEncoded, signer.privateKey), "base64"),
|
|
97357
97589
|
publicKey: signer.publicKey,
|
|
97358
97590
|
type: signer.type,
|
|
97359
|
-
signedPropertyNames:
|
|
97591
|
+
signedPropertyNames: t$13(propsToSign)
|
|
97360
97592
|
};
|
|
97361
97593
|
}
|
|
97362
97594
|
async function _signPubsubMsg({ signedPropertyNames, msg, signer, log }) {
|
|
97363
97595
|
assert(signer.publicKey && typeof signer.type === "string" && signer.privateKey, "Signer props need to be defined befoe signing");
|
|
97364
|
-
const propsToSign =
|
|
97596
|
+
const propsToSign = t$2(msg, signedPropertyNames);
|
|
97365
97597
|
let publicationEncoded;
|
|
97366
97598
|
try {
|
|
97367
97599
|
publicationEncoded = encode(propsToSign, cborgEncodeOptions);
|
|
@@ -97373,7 +97605,7 @@ async function _signPubsubMsg({ signedPropertyNames, msg, signer, log }) {
|
|
|
97373
97605
|
signature: await signBufferEd25519(publicationEncoded, signer.privateKey),
|
|
97374
97606
|
publicKey: fromString(signer.publicKey, "base64"),
|
|
97375
97607
|
type: signer.type,
|
|
97376
|
-
signedPropertyNames:
|
|
97608
|
+
signedPropertyNames: t$13(propsToSign)
|
|
97377
97609
|
};
|
|
97378
97610
|
}
|
|
97379
97611
|
function cleanUpBeforePublishing(msg) {
|
|
@@ -97530,13 +97762,13 @@ async function verifyCommentIpfs(opts) {
|
|
|
97530
97762
|
valid: false,
|
|
97531
97763
|
reason: messages.ERR_COMMENT_IPFS_RECORD_INCLUDES_RESERVED_FIELD
|
|
97532
97764
|
};
|
|
97533
|
-
if (opts.comment.author &&
|
|
97765
|
+
if (opts.comment.author && r(Object.keys(opts.comment.author), AuthorCommentIpfsReservedFields).length > 0) return {
|
|
97534
97766
|
valid: false,
|
|
97535
97767
|
reason: messages.ERR_COMMENT_IPFS_AUTHOR_INCLUDES_RESERVED_FIELD
|
|
97536
97768
|
};
|
|
97537
97769
|
const keysCasted = opts.comment.signature.signedPropertyNames;
|
|
97538
97770
|
const validRes = await verifyCommentPubsubMessage({
|
|
97539
|
-
comment:
|
|
97771
|
+
comment: t$2(opts.comment, ["signature", ...keysCasted]),
|
|
97540
97772
|
resolveAuthorNames: opts.resolveAuthorNames,
|
|
97541
97773
|
clientsManager: opts.clientsManager,
|
|
97542
97774
|
abortSignal: opts.abortSignal
|
|
@@ -97546,7 +97778,7 @@ async function verifyCommentIpfs(opts) {
|
|
|
97546
97778
|
return validRes;
|
|
97547
97779
|
}
|
|
97548
97780
|
function _allFieldsOfRecordInSignedPropertyNames(record) {
|
|
97549
|
-
const fieldsOfRecord =
|
|
97781
|
+
const fieldsOfRecord = t$13(n$9(record, ["signature"]));
|
|
97550
97782
|
for (const field of fieldsOfRecord) if (!record.signature.signedPropertyNames.includes(field)) return false;
|
|
97551
97783
|
return true;
|
|
97552
97784
|
}
|
|
@@ -97573,10 +97805,10 @@ async function verifyCommunity({ community, communityIpnsName, resolveAuthorName
|
|
|
97573
97805
|
name: community.name,
|
|
97574
97806
|
signature: community.signature
|
|
97575
97807
|
};
|
|
97576
|
-
if (community.posts?.pages && validatePages) for (const preloadedPageSortName of
|
|
97808
|
+
if (community.posts?.pages && validatePages) for (const preloadedPageSortName of t$13(community.posts.pages)) {
|
|
97577
97809
|
const pageCid = community.posts.pageCids?.[preloadedPageSortName];
|
|
97578
97810
|
const preloadedPage = community.posts.pages[preloadedPageSortName];
|
|
97579
|
-
if (!
|
|
97811
|
+
if (!e$6(preloadedPage)) throw Error("failed to find page ipfs of community to verify");
|
|
97580
97812
|
const pageValidity = await verifyPage({
|
|
97581
97813
|
pageCid,
|
|
97582
97814
|
page: preloadedPage,
|
|
@@ -97629,7 +97861,7 @@ async function _validateSignatureOfPubsubMsg(publication) {
|
|
|
97629
97861
|
return { valid: true };
|
|
97630
97862
|
}
|
|
97631
97863
|
function _isThereReservedFieldInRecord(record, reservedFields) {
|
|
97632
|
-
return
|
|
97864
|
+
return r(Object.keys(record), reservedFields).length > 0;
|
|
97633
97865
|
}
|
|
97634
97866
|
async function verifyCommentUpdate({ update, resolveAuthorNames, clientsManager, community, comment, validatePages, validateUpdateSignature, abortSignal }) {
|
|
97635
97867
|
if (!_allFieldsOfRecordInSignedPropertyNames(update)) return {
|
|
@@ -97662,7 +97894,7 @@ async function verifyCommentUpdate({ update, resolveAuthorNames, clientsManager,
|
|
|
97662
97894
|
reason: messages.ERR_COMMENT_UPDATE_DIFFERENT_CID_THAN_COMMENT
|
|
97663
97895
|
};
|
|
97664
97896
|
if ("replies" in update && update.replies && validatePages) {
|
|
97665
|
-
const replyPageKeys =
|
|
97897
|
+
const replyPageKeys = t$13(update.replies.pages);
|
|
97666
97898
|
for (const replySortName of replyPageKeys) {
|
|
97667
97899
|
const pageCid = update.replies.pageCids?.[replySortName];
|
|
97668
97900
|
const page = update.replies.pages[replySortName];
|
|
@@ -98309,12 +98541,12 @@ var NameResolutionCache = class NameResolutionCache {
|
|
|
98309
98541
|
//#endregion
|
|
98310
98542
|
//#region dist/node/clients/base-client-manager.js
|
|
98311
98543
|
const createUrlFromPathResolution = (gateway, opts) => {
|
|
98312
|
-
const root = opts.recordIpfsType === "ipfs" ? CID
|
|
98544
|
+
const root = opts.recordIpfsType === "ipfs" ? CID.parse(opts.root).toV1().toString() : convertBase58IpnsNameToBase36Cid(opts.root);
|
|
98313
98545
|
return `${gateway}/${opts.recordIpfsType}/${root}${opts.path ? "/" + opts.path : ""}`;
|
|
98314
98546
|
};
|
|
98315
98547
|
const createUrlFromSubdomainResolution = (gateway, opts) => {
|
|
98316
98548
|
const gatewayUrl = new URL(gateway);
|
|
98317
|
-
const root = opts.recordIpfsType === "ipfs" ? CID
|
|
98549
|
+
const root = opts.recordIpfsType === "ipfs" ? CID.parse(opts.root).toV1().toString() : opts.recordIpfsType === "ipns" ? convertBase58IpnsNameToBase36Cid(opts.root) : opts.root;
|
|
98318
98550
|
return `${gatewayUrl.protocol}//${root}.${opts.recordIpfsType}.${gatewayUrl.host}${opts.path ? "/" + opts.path : ""}`;
|
|
98319
98551
|
};
|
|
98320
98552
|
const GATEWAYS_THAT_SUPPORT_SUBDOMAIN_RESOLUTION = {};
|
|
@@ -98322,15 +98554,15 @@ var BaseClientsManager = class BaseClientsManager {
|
|
|
98322
98554
|
constructor(pkc) {
|
|
98323
98555
|
this.pubsubProviderSubscriptions = {};
|
|
98324
98556
|
this._pkc = pkc;
|
|
98325
|
-
for (const provider of
|
|
98326
|
-
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] = [];
|
|
98327
98559
|
hideClassPrivateProps(this);
|
|
98328
98560
|
}
|
|
98329
98561
|
toJSON() {}
|
|
98330
98562
|
getDefaultPubsubKuboRpcClientOrHelia() {
|
|
98331
|
-
const defaultPubsubProviderUrl =
|
|
98563
|
+
const defaultPubsubProviderUrl = t$13(this._pkc.clients.pubsubKuboRpcClients)[0];
|
|
98332
98564
|
if (defaultPubsubProviderUrl) return this._pkc.clients.pubsubKuboRpcClients[defaultPubsubProviderUrl];
|
|
98333
|
-
const defaultLibp2pJsClient =
|
|
98565
|
+
const defaultLibp2pJsClient = t$13(this._pkc.clients.libp2pJsClients)[0];
|
|
98334
98566
|
if (defaultLibp2pJsClient) return this._pkc.clients.libp2pJsClients[defaultLibp2pJsClient];
|
|
98335
98567
|
throw new PKCError("ERR_NO_DEFAULT_PUBSUB_PROVIDER", {
|
|
98336
98568
|
pubsubKuboRpcClients: this._pkc.clients.pubsubKuboRpcClients,
|
|
@@ -98338,9 +98570,9 @@ var BaseClientsManager = class BaseClientsManager {
|
|
|
98338
98570
|
});
|
|
98339
98571
|
}
|
|
98340
98572
|
getDefaultKuboRpcClientOrHelia() {
|
|
98341
|
-
const defaultKuboRpcClient =
|
|
98573
|
+
const defaultKuboRpcClient = t$13(this._pkc.clients.kuboRpcClients)[0];
|
|
98342
98574
|
if (defaultKuboRpcClient) return this._pkc.clients.kuboRpcClients[defaultKuboRpcClient];
|
|
98343
|
-
const defaultLibp2pJsClient =
|
|
98575
|
+
const defaultLibp2pJsClient = t$13(this._pkc.clients.libp2pJsClients)[0];
|
|
98344
98576
|
if (defaultLibp2pJsClient) return this._pkc.clients.libp2pJsClients[defaultLibp2pJsClient];
|
|
98345
98577
|
throw new PKCError("ERR_NO_DEFAULT_IPFS_PROVIDER", {
|
|
98346
98578
|
kuboRpcClients: this._pkc.clients.kuboRpcClients,
|
|
@@ -98348,7 +98580,7 @@ var BaseClientsManager = class BaseClientsManager {
|
|
|
98348
98580
|
});
|
|
98349
98581
|
}
|
|
98350
98582
|
getDefaultKuboRpcClient() {
|
|
98351
|
-
const defaultKuboRpcClient =
|
|
98583
|
+
const defaultKuboRpcClient = t$13(this._pkc.clients.kuboRpcClients)[0];
|
|
98352
98584
|
if (defaultKuboRpcClient) return this._pkc.clients.kuboRpcClients[defaultKuboRpcClient];
|
|
98353
98585
|
throw new PKCError("ERR_NO_DEFAULT_KUBO_RPC_IPFS_PROVIDER", {
|
|
98354
98586
|
kuboRpcClients: this._pkc.clients.kuboRpcClients,
|
|
@@ -98356,14 +98588,14 @@ var BaseClientsManager = class BaseClientsManager {
|
|
|
98356
98588
|
});
|
|
98357
98589
|
}
|
|
98358
98590
|
getDefaultKuboPubsubClient() {
|
|
98359
|
-
const defaultKuboPubsubClient =
|
|
98591
|
+
const defaultKuboPubsubClient = t$13(this._pkc.clients.pubsubKuboRpcClients)[0];
|
|
98360
98592
|
if (defaultKuboPubsubClient) return this._pkc.clients.pubsubKuboRpcClients[defaultKuboPubsubClient];
|
|
98361
98593
|
throw new PKCError("ERR_NO_DEFAULT_KUBO_RPC_PUBSUB_PROVIDER", { pubsubKuboRpcClients: this._pkc.clients.pubsubKuboRpcClients });
|
|
98362
98594
|
}
|
|
98363
98595
|
getIpfsClientWithKuboRpcClientFunctions() {
|
|
98364
|
-
const defaultKuboRpcClient =
|
|
98596
|
+
const defaultKuboRpcClient = t$13(this._pkc.clients.kuboRpcClients)[0];
|
|
98365
98597
|
if (defaultKuboRpcClient) return this._pkc.clients.kuboRpcClients[defaultKuboRpcClient]._client;
|
|
98366
|
-
const defaultLibp2pJsClient =
|
|
98598
|
+
const defaultLibp2pJsClient = t$13(this._pkc.clients.libp2pJsClients)[0];
|
|
98367
98599
|
if (defaultLibp2pJsClient) return this._pkc.clients.libp2pJsClients[defaultLibp2pJsClient].heliaWithKuboRpcClientFunctions;
|
|
98368
98600
|
throw new PKCError("ERR_NO_DEFAULT_IPFS_PROVIDER", {
|
|
98369
98601
|
kuboRpcClients: this._pkc.clients.kuboRpcClients,
|
|
@@ -98441,7 +98673,7 @@ var BaseClientsManager = class BaseClientsManager {
|
|
|
98441
98673
|
}
|
|
98442
98674
|
}
|
|
98443
98675
|
async pubsubUnsubscribe(pubsubTopic, handler) {
|
|
98444
|
-
for (const pubsubProviderUrl of
|
|
98676
|
+
for (const pubsubProviderUrl of t$13(this._pkc.clients.pubsubKuboRpcClients)) try {
|
|
98445
98677
|
await this.pubsubUnsubscribeOnProvider(pubsubTopic, pubsubProviderUrl, handler);
|
|
98446
98678
|
} catch (e) {
|
|
98447
98679
|
await this._pkc._stats.recordGatewayFailure(pubsubProviderUrl, "pubsub-unsubscribe");
|
|
@@ -98645,7 +98877,7 @@ var BaseClientsManager = class BaseClientsManager {
|
|
|
98645
98877
|
const timeoutMs = loadOpts.timeoutMs;
|
|
98646
98878
|
const concurrencyLimit = 3;
|
|
98647
98879
|
const queueLimit = pLimit(concurrencyLimit);
|
|
98648
|
-
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);
|
|
98649
98881
|
const gatewayFetches = {};
|
|
98650
98882
|
const cleanUp = () => {
|
|
98651
98883
|
queueLimit.clearQueue();
|
|
@@ -99079,28 +99311,28 @@ var PKCClientsManager = class extends BaseClientsManager {
|
|
|
99079
99311
|
}
|
|
99080
99312
|
_initIpfsGateways() {
|
|
99081
99313
|
this.clients.ipfsGateways = {};
|
|
99082
|
-
for (const gatewayUrl of
|
|
99314
|
+
for (const gatewayUrl of t$13(this._pkc.clients.ipfsGateways)) this.clients.ipfsGateways = {
|
|
99083
99315
|
...this.clients.ipfsGateways,
|
|
99084
99316
|
[gatewayUrl]: new PKCIpfsGatewayClient("stopped")
|
|
99085
99317
|
};
|
|
99086
99318
|
}
|
|
99087
99319
|
_initKuboRpcClients() {
|
|
99088
99320
|
this.clients.kuboRpcClients = {};
|
|
99089
|
-
for (const kuboRpcUrl of
|
|
99321
|
+
for (const kuboRpcUrl of t$13(this._pkc.clients.kuboRpcClients)) this.clients.kuboRpcClients = {
|
|
99090
99322
|
...this.clients.kuboRpcClients,
|
|
99091
99323
|
[kuboRpcUrl]: new PKCKuboRpcClient("stopped")
|
|
99092
99324
|
};
|
|
99093
99325
|
}
|
|
99094
99326
|
_initPubsubKuboRpcClients() {
|
|
99095
99327
|
this.clients.pubsubKuboRpcClients = {};
|
|
99096
|
-
for (const pubsubUrl of
|
|
99328
|
+
for (const pubsubUrl of t$13(this._pkc.clients.pubsubKuboRpcClients)) this.clients.pubsubKuboRpcClients = {
|
|
99097
99329
|
...this.clients.pubsubKuboRpcClients,
|
|
99098
99330
|
[pubsubUrl]: new GenericStateClient("stopped")
|
|
99099
99331
|
};
|
|
99100
99332
|
}
|
|
99101
99333
|
_initLibp2pJsClients() {
|
|
99102
99334
|
this.clients.libp2pJsClients = {};
|
|
99103
|
-
for (const libp2pJsClientKey of
|
|
99335
|
+
for (const libp2pJsClientKey of t$13(this._pkc.clients.libp2pJsClients)) this.clients.libp2pJsClients = {
|
|
99104
99336
|
...this.clients.libp2pJsClients,
|
|
99105
99337
|
[libp2pJsClientKey]: new PKCLibp2pJsClient("stopped")
|
|
99106
99338
|
};
|
|
@@ -99168,7 +99400,7 @@ var PKCClientsManager = class extends BaseClientsManager {
|
|
|
99168
99400
|
this.clients.nameResolvers[resolverKey].emit("statechange", newState);
|
|
99169
99401
|
}
|
|
99170
99402
|
async fetchCid(cid) {
|
|
99171
|
-
let finalCid =
|
|
99403
|
+
let finalCid = t$8(cid);
|
|
99172
99404
|
if (!isIpfsCid(finalCid) && isIpfsPath(finalCid)) finalCid = finalCid.split("/")[2];
|
|
99173
99405
|
if (!isIpfsCid(finalCid)) throw new PKCError("ERR_CID_IS_INVALID", { cid });
|
|
99174
99406
|
const timeoutMs = this._pkc._timeouts["generic-ipfs"];
|
|
@@ -99212,19 +99444,19 @@ var PublicationClientsManager = class extends PKCClientsManager {
|
|
|
99212
99444
|
this.handleUpdatingStateChangeEventFromCommunity = this.handleUpdatingStateChangeEventFromCommunity.bind(this);
|
|
99213
99445
|
}
|
|
99214
99446
|
_initKuboRpcClients() {
|
|
99215
|
-
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 = {
|
|
99216
99448
|
...this.clients.kuboRpcClients,
|
|
99217
99449
|
[ipfsUrl]: new PublicationKuboRpcClient("stopped")
|
|
99218
99450
|
};
|
|
99219
99451
|
}
|
|
99220
99452
|
_initPubsubKuboRpcClients() {
|
|
99221
|
-
for (const pubsubUrl of
|
|
99453
|
+
for (const pubsubUrl of t$13(this._pkc.clients.pubsubKuboRpcClients)) this.clients.pubsubKuboRpcClients = {
|
|
99222
99454
|
...this.clients.pubsubKuboRpcClients,
|
|
99223
99455
|
[pubsubUrl]: new PublicationKuboPubsubClient("stopped")
|
|
99224
99456
|
};
|
|
99225
99457
|
}
|
|
99226
99458
|
_initPKCRpcClients() {
|
|
99227
|
-
for (const rpcUrl of
|
|
99459
|
+
for (const rpcUrl of t$13(this._pkc.clients.pkcRpcClients)) this.clients.pkcRpcClients = {
|
|
99228
99460
|
...this.clients.pkcRpcClients,
|
|
99229
99461
|
[rpcUrl]: new PublicationPKCRpcStateClient("stopped")
|
|
99230
99462
|
};
|
|
@@ -99432,28 +99664,28 @@ var BasePagesClientsManager = class extends BaseClientsManager {
|
|
|
99432
99664
|
if (!this.clients.ipfsGateways) this.clients.ipfsGateways = {};
|
|
99433
99665
|
for (const sortType of sortTypes) {
|
|
99434
99666
|
if (!this.clients.ipfsGateways[sortType]) this.clients.ipfsGateways[sortType] = {};
|
|
99435
|
-
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");
|
|
99436
99668
|
}
|
|
99437
99669
|
}
|
|
99438
99670
|
_updateKuboRpcClientStates(sortTypes) {
|
|
99439
99671
|
if (this._pkc.clients.kuboRpcClients && !this.clients.kuboRpcClients) this.clients.kuboRpcClients = {};
|
|
99440
99672
|
for (const sortType of sortTypes) {
|
|
99441
99673
|
if (!this.clients.kuboRpcClients[sortType]) this.clients.kuboRpcClients[sortType] = {};
|
|
99442
|
-
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");
|
|
99443
99675
|
}
|
|
99444
99676
|
}
|
|
99445
99677
|
_updateLibp2pJsClientStates(sortTypes) {
|
|
99446
99678
|
if (this._pkc.clients.libp2pJsClients && !this.clients.libp2pJsClients) this.clients.libp2pJsClients = {};
|
|
99447
99679
|
for (const sortType of sortTypes) {
|
|
99448
99680
|
if (!this.clients.libp2pJsClients[sortType]) this.clients.libp2pJsClients[sortType] = {};
|
|
99449
|
-
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");
|
|
99450
99682
|
}
|
|
99451
99683
|
}
|
|
99452
99684
|
_updatePKCRpcClientStates(sortTypes) {
|
|
99453
99685
|
if (this._pkc.clients.pkcRpcClients && !this.clients.pkcRpcClients) this.clients.pkcRpcClients = {};
|
|
99454
99686
|
for (const sortType of sortTypes) {
|
|
99455
99687
|
if (!this.clients.pkcRpcClients[sortType]) this.clients.pkcRpcClients[sortType] = {};
|
|
99456
|
-
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");
|
|
99457
99689
|
}
|
|
99458
99690
|
}
|
|
99459
99691
|
preFetchGateway(gatewayUrl, loadOpts) {
|
|
@@ -99476,7 +99708,7 @@ var BasePagesClientsManager = class extends BaseClientsManager {
|
|
|
99476
99708
|
const curSortTypes = this._pkc._memCaches.pageCidToSortTypes.get(pageCid);
|
|
99477
99709
|
if (!curSortTypes) this._pkc._memCaches.pageCidToSortTypes.set(pageCid, sortTypes);
|
|
99478
99710
|
else {
|
|
99479
|
-
const newSortTypes =
|
|
99711
|
+
const newSortTypes = n$10([...curSortTypes, ...sortTypes]);
|
|
99480
99712
|
this._pkc._memCaches.pageCidToSortTypes.set(pageCid, newSortTypes);
|
|
99481
99713
|
}
|
|
99482
99714
|
}
|
|
@@ -99490,7 +99722,7 @@ var BasePagesClientsManager = class extends BaseClientsManager {
|
|
|
99490
99722
|
return (0, import_sha256.sha256)((this._pages._community.name || this._pages._community.publicKey) + pageCid);
|
|
99491
99723
|
}
|
|
99492
99724
|
updatePagesMaxSizeCache(newPageCids, pageMaxSizeBytes) {
|
|
99493
|
-
|
|
99725
|
+
n$10(newPageCids).forEach((pageCid) => this._pkc._memCaches.pagesMaxSize.set(this._calculatePageMaxSizeCacheKey(pageCid), pageMaxSizeBytes));
|
|
99494
99726
|
}
|
|
99495
99727
|
updatePageCidsToSortTypesToIncludeSubsequent(nextPageCid, previousPageCid) {
|
|
99496
99728
|
const sortTypes = this._pkc._memCaches.pageCidToSortTypes.get(previousPageCid);
|
|
@@ -99601,10 +99833,10 @@ var BasePagesClientsManager = class extends BaseClientsManager {
|
|
|
99601
99833
|
async fetchPage(opts) {
|
|
99602
99834
|
const { pageCid } = opts;
|
|
99603
99835
|
const log = logger_default("pkc-js:pages:getPage");
|
|
99604
|
-
const sortTypesFromPageCids =
|
|
99836
|
+
const sortTypesFromPageCids = t$13(this._pages.pageCids).filter((sortType) => this._pages.pageCids[sortType] === pageCid);
|
|
99605
99837
|
if (sortTypesFromPageCids.length > 0) this.updatePageCidsToSortTypes(this._pages.pageCids);
|
|
99606
99838
|
const sortTypesFromMemcache = this._pkc._memCaches.pageCidToSortTypes.get(pageCid);
|
|
99607
|
-
const isFirstPage = Object.values(this._pages.pageCids).includes(pageCid) ||
|
|
99839
|
+
const isFirstPage = Object.values(this._pages.pageCids).includes(pageCid) || e$5(this._pages.pageCids);
|
|
99608
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;
|
|
99609
99841
|
if (!pageMaxSize) throw Error("Failed to calculate max page size. Is this page cid under the correct community/comment?");
|
|
99610
99842
|
const destroySignal = this._pkc._getDestroyAbortSignal();
|
|
@@ -99655,7 +99887,7 @@ var BasePagesClientsManager = class extends BaseClientsManager {
|
|
|
99655
99887
|
};
|
|
99656
99888
|
var RepliesPagesClientsManager = class extends BasePagesClientsManager {
|
|
99657
99889
|
getSortTypes() {
|
|
99658
|
-
return
|
|
99890
|
+
return t$13(POST_REPLIES_SORT_TYPES);
|
|
99659
99891
|
}
|
|
99660
99892
|
preFetchPage() {
|
|
99661
99893
|
if (!this._pages._parentComment) throw Error("parent comment needs to be defined");
|
|
@@ -99677,7 +99909,7 @@ var RepliesPagesClientsManager = class extends BasePagesClientsManager {
|
|
|
99677
99909
|
};
|
|
99678
99910
|
var CommunityPostsPagesClientsManager = class extends BasePagesClientsManager {
|
|
99679
99911
|
getSortTypes() {
|
|
99680
|
-
return
|
|
99912
|
+
return t$13(POSTS_SORT_TYPES);
|
|
99681
99913
|
}
|
|
99682
99914
|
preFetchPage() {
|
|
99683
99915
|
if (!this._pages._community) throw Error("Community needs to be defined");
|
|
@@ -100041,7 +100273,7 @@ const POSTS_SORT_TYPES = {
|
|
|
100041
100273
|
}
|
|
100042
100274
|
};
|
|
100043
100275
|
const POST_REPLIES_SORT_TYPES = {
|
|
100044
|
-
...
|
|
100276
|
+
...t$2(POSTS_SORT_TYPES, ["new"]),
|
|
100045
100277
|
best: { score: (...args) => bestScore(...args) },
|
|
100046
100278
|
old: { score: (...args) => oldScore(...args) },
|
|
100047
100279
|
newFlat: {
|
|
@@ -100054,7 +100286,7 @@ const POST_REPLIES_SORT_TYPES = {
|
|
|
100054
100286
|
}
|
|
100055
100287
|
};
|
|
100056
100288
|
const REPLY_REPLIES_SORT_TYPES = {
|
|
100057
|
-
...
|
|
100289
|
+
...t$2(POSTS_SORT_TYPES, ["new"]),
|
|
100058
100290
|
best: { score: (...args) => bestScore(...args) },
|
|
100059
100291
|
old: { score: (...args) => oldScore(...args) }
|
|
100060
100292
|
};
|
|
@@ -100065,7 +100297,7 @@ function hotScore(comment) {
|
|
|
100065
100297
|
const order = Math.log10(Math.max(Math.abs(score), 1));
|
|
100066
100298
|
const sign = score > 0 ? 1 : score < 0 ? -1 : 0;
|
|
100067
100299
|
const seconds = comment.comment.timestamp - 1134028003;
|
|
100068
|
-
return
|
|
100300
|
+
return n(sign * order + seconds / 45e3, 7);
|
|
100069
100301
|
}
|
|
100070
100302
|
function bestScore(comment) {
|
|
100071
100303
|
assert(typeof comment.commentUpdate.downvoteCount === "number" && typeof comment.commentUpdate.upvoteCount === "number");
|
|
@@ -100177,20 +100409,20 @@ function mapPageIpfsCommentToPageJsonComment(pageComment) {
|
|
|
100177
100409
|
function parsePageIpfs(pageIpfs) {
|
|
100178
100410
|
return {
|
|
100179
100411
|
comments: pageIpfs.comments.map(mapPageIpfsCommentToPageJsonComment),
|
|
100180
|
-
...
|
|
100412
|
+
...n$9(pageIpfs, ["comments"])
|
|
100181
100413
|
};
|
|
100182
100414
|
}
|
|
100183
100415
|
function parseModQueuePageIpfs(modqueuePageIpfs) {
|
|
100184
100416
|
return {
|
|
100185
100417
|
comments: modqueuePageIpfs.comments.map(mapModqueuePageIpfsCommentToModQueuePageJsonComment),
|
|
100186
|
-
...
|
|
100418
|
+
...n$9(modqueuePageIpfs, ["comments"])
|
|
100187
100419
|
};
|
|
100188
100420
|
}
|
|
100189
100421
|
function parsePagesIpfs(pagesRaw) {
|
|
100190
|
-
const keys =
|
|
100422
|
+
const keys = t$13(pagesRaw.pages);
|
|
100191
100423
|
const parsedPages = Object.values(pagesRaw.pages).map((pageIpfs) => parsePageIpfs(pageIpfs));
|
|
100192
100424
|
return {
|
|
100193
|
-
pages:
|
|
100425
|
+
pages: t$6(keys.map((key, i) => [key, parsedPages[i]])),
|
|
100194
100426
|
pageCids: pagesRaw.pageCids || {}
|
|
100195
100427
|
};
|
|
100196
100428
|
}
|
|
@@ -100223,7 +100455,7 @@ function findCommentInPageInstance(pageInstance, targetCommentCid) {
|
|
|
100223
100455
|
function findCommentInParsedPages(pageJson, targetCommentCid) {
|
|
100224
100456
|
if (!pageJson) throw Error("should define page json");
|
|
100225
100457
|
if (!targetCommentCid) throw Error("should define target comment cid");
|
|
100226
|
-
return
|
|
100458
|
+
return r$5(pageJson.comments, (comment) => comment.cid === targetCommentCid);
|
|
100227
100459
|
}
|
|
100228
100460
|
function findCommentInHierarchicalPageIpfsRecursively(page, targetCid) {
|
|
100229
100461
|
if (!page) throw Error("should define page ipfs");
|
|
@@ -100580,19 +100812,19 @@ var CommentClientsManager = class extends PublicationClientsManager {
|
|
|
100580
100812
|
return AbortSignal.any(signals);
|
|
100581
100813
|
}
|
|
100582
100814
|
_initKuboRpcClients() {
|
|
100583
|
-
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 = {
|
|
100584
100816
|
...this.clients.kuboRpcClients,
|
|
100585
100817
|
[ipfsUrl]: new CommentKuboRpcClient("stopped")
|
|
100586
100818
|
};
|
|
100587
100819
|
}
|
|
100588
100820
|
_initLibp2pJsClients() {
|
|
100589
|
-
for (const libp2pJsClientKey of
|
|
100821
|
+
for (const libp2pJsClientKey of t$13(this._pkc.clients.libp2pJsClients)) this.clients.libp2pJsClients = {
|
|
100590
100822
|
...this.clients.libp2pJsClients,
|
|
100591
100823
|
[libp2pJsClientKey]: new CommentLibp2pJsClient("stopped")
|
|
100592
100824
|
};
|
|
100593
100825
|
}
|
|
100594
100826
|
_initPKCRpcClients() {
|
|
100595
|
-
for (const rpcUrl of
|
|
100827
|
+
for (const rpcUrl of t$13(this._pkc.clients.pkcRpcClients)) this.clients.pkcRpcClients = {
|
|
100596
100828
|
...this.clients.pkcRpcClients,
|
|
100597
100829
|
[rpcUrl]: new CommentPKCRpcStateClient("stopped")
|
|
100598
100830
|
};
|
|
@@ -100969,7 +101201,7 @@ var CommentClientsManager = class extends PublicationClientsManager {
|
|
|
100969
101201
|
const cachedComment = this._pkc._memCaches.commentIpfs.get(cid);
|
|
100970
101202
|
if (cachedComment) {
|
|
100971
101203
|
fetchCommentLogger.trace("Serving comment CID from cache", cid);
|
|
100972
|
-
return
|
|
101204
|
+
return t$8(cachedComment);
|
|
100973
101205
|
}
|
|
100974
101206
|
const verifiedComment = await this._pkc._inflightFetchManager.withResource(InflightResourceTypes.COMMENT_IPFS, cid, async () => {
|
|
100975
101207
|
fetchCommentLogger.trace("Fetching comment CID", cid);
|
|
@@ -101474,7 +101706,7 @@ async function tryToDeleteCommunitiesThatFailedToBeDeletedBefore(pkc, log) {
|
|
|
101474
101706
|
log.error(`Failed to delete stale db (${communityAddress}). This error should go away after restarting the daemon or process`, e);
|
|
101475
101707
|
}
|
|
101476
101708
|
}
|
|
101477
|
-
const newPersistentDeletedCommunities =
|
|
101709
|
+
const newPersistentDeletedCommunities = r$8(n$10(deletedPersistentCommunities), communitiesThatWereDeletedSuccessfully);
|
|
101478
101710
|
if (newPersistentDeletedCommunities.length === 0) {
|
|
101479
101711
|
await pkc._storage.removeItem(STORAGE_KEYS[STORAGE_KEYS.PERSISTENT_DELETED_COMMUNITIES]);
|
|
101480
101712
|
log("Removed persistent deleted communities from storage because there are none left");
|
|
@@ -101683,11 +101915,12 @@ async function moveCommunityDbToDeletedDirectory(communityAddress, pkc) {
|
|
|
101683
101915
|
throw error;
|
|
101684
101916
|
}
|
|
101685
101917
|
}
|
|
101686
|
-
function createKuboRpcClient(kuboRpcClientOptions) {
|
|
101918
|
+
async function createKuboRpcClient(kuboRpcClientOptions) {
|
|
101687
101919
|
logger_default("pkc-js:pkc:createKuboRpcClient").trace("Creating a new kubo client on node with options", kuboRpcClientOptions);
|
|
101920
|
+
const { create: CreateKuboRpcClient } = await import("./src-4u0f92eE.js");
|
|
101688
101921
|
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;
|
|
101689
101922
|
const onehourMs = 1e3 * 60 * 60;
|
|
101690
|
-
return
|
|
101923
|
+
return CreateKuboRpcClient({
|
|
101691
101924
|
...kuboRpcClientOptions,
|
|
101692
101925
|
agent: kuboRpcClientOptions.agent || new Agent$2({
|
|
101693
101926
|
keepAlive: true,
|
|
@@ -101737,9 +101970,9 @@ function calculateExpectedSignatureSize(newIpns) {
|
|
|
101737
101970
|
return Buffer.byteLength(JSON.stringify(mockSignature), "utf8");
|
|
101738
101971
|
}
|
|
101739
101972
|
function deriveCommentIpfsFromCommentTableRow(commentTableRow) {
|
|
101740
|
-
const commentIpfs =
|
|
101973
|
+
const commentIpfs = t$2(commentTableRow, t$13(CommentIpfsSchema.shape));
|
|
101741
101974
|
const finalCommentIpfsJson = {
|
|
101742
|
-
...
|
|
101975
|
+
...t$2(commentTableRow, commentTableRow.signature.signedPropertyNames),
|
|
101743
101976
|
...commentIpfs,
|
|
101744
101977
|
...commentTableRow.extraProps
|
|
101745
101978
|
};
|
|
@@ -101793,8 +102026,8 @@ function deriveDbPosts(opts) {
|
|
|
101793
102026
|
}
|
|
101794
102027
|
function resolveDbPostsCidRefs(opts) {
|
|
101795
102028
|
const { dbPosts, dbHandler } = opts;
|
|
101796
|
-
const commentUpdateCols =
|
|
101797
|
-
const commentIpfsCols = [...
|
|
102029
|
+
const commentUpdateCols = t$13(CommentUpdateSchema.shape);
|
|
102030
|
+
const commentIpfsCols = [...t$13(CommentIpfsSchema.shape), "extraProps"];
|
|
101798
102031
|
const pages = {};
|
|
101799
102032
|
const pageCids = {};
|
|
101800
102033
|
for (const [sortName, sortEntry] of Object.entries(dbPosts)) {
|
|
@@ -124352,7 +124585,7 @@ const runtimeOnlyCommunityFields = [
|
|
|
124352
124585
|
];
|
|
124353
124586
|
function omitRuntimeCommunityFields(community) {
|
|
124354
124587
|
if (!community) return {};
|
|
124355
|
-
return
|
|
124588
|
+
return n$9(community, runtimeOnlyCommunityFields);
|
|
124356
124589
|
}
|
|
124357
124590
|
function getCommunityNameFromWire(community) {
|
|
124358
124591
|
const wireCommunity = omitRuntimeCommunityFields(community);
|
|
@@ -124420,10 +124653,10 @@ var CommunityLibp2pJsClient = class extends GenericStateClient {};
|
|
|
124420
124653
|
//#region dist/node/community/community-gateway-selection.js
|
|
124421
124654
|
function selectWinningGatewayCommunity(opts) {
|
|
124422
124655
|
const { gatewayFetches, currentUpdatedAt, totalGateways, fallbackIpnsName } = opts;
|
|
124423
|
-
const gatewaysWithCommunity =
|
|
124656
|
+
const gatewaysWithCommunity = t$13(gatewayFetches).filter((gatewayUrl) => gatewayFetches[gatewayUrl].communityRecord);
|
|
124424
124657
|
if (gatewaysWithCommunity.length === 0) return void 0;
|
|
124425
|
-
const gatewaysWithError =
|
|
124426
|
-
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"]);
|
|
124427
124660
|
const best = gatewayFetches[bestGatewayUrl];
|
|
124428
124661
|
if (best.communityRecord.updatedAt > currentUpdatedAt) return {
|
|
124429
124662
|
community: best.communityRecord,
|
|
@@ -124448,25 +124681,25 @@ var CommunityClientsManager = class extends PKCClientsManager {
|
|
|
124448
124681
|
hideClassPrivateProps(this);
|
|
124449
124682
|
}
|
|
124450
124683
|
_initKuboRpcClients() {
|
|
124451
|
-
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 = {
|
|
124452
124685
|
...this.clients.kuboRpcClients,
|
|
124453
124686
|
[ipfsUrl]: new CommunityKuboRpcClient("stopped")
|
|
124454
124687
|
};
|
|
124455
124688
|
}
|
|
124456
124689
|
_initPubsubKuboRpcClients() {
|
|
124457
|
-
for (const pubsubUrl of
|
|
124690
|
+
for (const pubsubUrl of t$13(this._pkc.clients.pubsubKuboRpcClients)) this.clients.pubsubKuboRpcClients = {
|
|
124458
124691
|
...this.clients.pubsubKuboRpcClients,
|
|
124459
124692
|
[pubsubUrl]: new CommunityKuboPubsubClient("stopped")
|
|
124460
124693
|
};
|
|
124461
124694
|
}
|
|
124462
124695
|
_initLibp2pJsClients() {
|
|
124463
|
-
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 = {
|
|
124464
124697
|
...this.clients.libp2pJsClients,
|
|
124465
124698
|
[libp2pJsClientUrl]: new CommunityLibp2pJsClient("stopped")
|
|
124466
124699
|
};
|
|
124467
124700
|
}
|
|
124468
124701
|
_initPKCRpcClients() {
|
|
124469
|
-
for (const rpcUrl of
|
|
124702
|
+
for (const rpcUrl of t$13(this._pkc.clients.pkcRpcClients)) this.clients.pkcRpcClients = {
|
|
124470
124703
|
...this.clients.pkcRpcClients,
|
|
124471
124704
|
[rpcUrl]: new CommunityPKCRpcStateClient("stopped")
|
|
124472
124705
|
};
|
|
@@ -124797,7 +125030,7 @@ var CommunityClientsManager = class extends PKCClientsManager {
|
|
|
124797
125030
|
const concurrencyLimit = 3;
|
|
124798
125031
|
const timeoutMs = this._pkc._timeouts["community-ipns"];
|
|
124799
125032
|
const queueLimit = pLimit(concurrencyLimit);
|
|
124800
|
-
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");
|
|
124801
125034
|
const gatewayFetches = {};
|
|
124802
125035
|
for (const gatewayUrl of gatewaysSorted) {
|
|
124803
125036
|
const abortController = new AbortController();
|
|
@@ -124882,7 +125115,7 @@ var CommunityClientsManager = class extends PKCClientsManager {
|
|
|
124882
125115
|
if (!cidOfIpnsFromEtagHeader) return;
|
|
124883
125116
|
let parsedCid;
|
|
124884
125117
|
try {
|
|
124885
|
-
parsedCid = CID
|
|
125118
|
+
parsedCid = CID.parse(cidOfIpnsFromEtagHeader.replace(/^W\//, "").split("\"").join("")).toV0().toString();
|
|
124886
125119
|
} catch (e) {
|
|
124887
125120
|
return;
|
|
124888
125121
|
}
|
|
@@ -124948,7 +125181,7 @@ var CommunityClientsManager = class extends PKCClientsManager {
|
|
|
124948
125181
|
try {
|
|
124949
125182
|
suitableCommunity = await new Promise((resolve, reject) => promisesToIterate.map((gatewayPromise, i) => gatewayPromise.then(async (res) => {
|
|
124950
125183
|
if ("error" in res) Object.values(gatewayFetches)[i].error = res.error;
|
|
124951
|
-
if (
|
|
125184
|
+
if (t$13(gatewayFetches).filter((gatewayUrl) => gatewayFetches[gatewayUrl].error).length === gatewaysSorted.length) reject("All gateways failed to fetch community record " + ipnsName);
|
|
124952
125185
|
const recentCommunity = _findRecentCommunity();
|
|
124953
125186
|
if (recentCommunity) {
|
|
124954
125187
|
cleanUp();
|
|
@@ -124958,7 +125191,7 @@ var CommunityClientsManager = class extends PKCClientsManager {
|
|
|
124958
125191
|
} catch {
|
|
124959
125192
|
cleanUp();
|
|
124960
125193
|
throwIfAbortSignalAborted(stopSignal);
|
|
124961
|
-
const gatewayToError =
|
|
125194
|
+
const gatewayToError = t$4(gatewayFetches, (gatewayFetch) => gatewayFetch.error);
|
|
124962
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;
|
|
124963
125196
|
const combinedError = new FailedToFetchCommunityFromGatewaysError({
|
|
124964
125197
|
ipnsName,
|
|
@@ -125001,7 +125234,7 @@ var CommunityClientsManager = class extends PKCClientsManager {
|
|
|
125001
125234
|
if (isIpfsPath(value)) {
|
|
125002
125235
|
let terminalCidV0;
|
|
125003
125236
|
try {
|
|
125004
|
-
terminalCidV0 = CID
|
|
125237
|
+
terminalCidV0 = CID.parse(value.split("/")[2]).toV0().toString();
|
|
125005
125238
|
} catch (e) {
|
|
125006
125239
|
throw new PKCError("ERR_GATEWAY_IPNS_RECORD_CHAIN_INVALID", {
|
|
125007
125240
|
reason: "Terminal IPNS record value is not a valid CID",
|
|
@@ -125223,10 +125456,10 @@ var RemoteCommunity = class extends import_lib$1.TypedEmitter {
|
|
|
125223
125456
|
const log = logger_default("pkc-js:remote-community:initCommunityIpfsPropsNoMerge");
|
|
125224
125457
|
this.raw.communityIpfs = newProps;
|
|
125225
125458
|
this.initRemoteCommunityPropsNoMerge(newProps);
|
|
125226
|
-
const unknownProps =
|
|
125459
|
+
const unknownProps = r$8(t$13(this.raw.communityIpfs), t$13(CommunityIpfsSchema.shape));
|
|
125227
125460
|
if (unknownProps.length > 0) {
|
|
125228
125461
|
log(`Found unknown props on community (${this.address}) ipfs record`, unknownProps);
|
|
125229
|
-
Object.assign(this,
|
|
125462
|
+
Object.assign(this, t$2(this.raw.communityIpfs, unknownProps));
|
|
125230
125463
|
}
|
|
125231
125464
|
}
|
|
125232
125465
|
_updateIpnsPubsubPropsIfNeeded(newProps) {
|
|
@@ -125326,8 +125559,8 @@ var RemoteCommunity = class extends import_lib$1.TypedEmitter {
|
|
|
125326
125559
|
this._assertHasIdentity();
|
|
125327
125560
|
}
|
|
125328
125561
|
_toJSONIpfsBaseNoPosts() {
|
|
125329
|
-
const communityIpfsKeys =
|
|
125330
|
-
return
|
|
125562
|
+
const communityIpfsKeys = t$13(n$9(CommunityIpfsSchema.shape, ["posts", "modQueue"]));
|
|
125563
|
+
return t$2(this, communityIpfsKeys);
|
|
125331
125564
|
}
|
|
125332
125565
|
toJSONRpcRemote() {
|
|
125333
125566
|
if (!this.updateCid || !this.raw.communityIpfs) return {
|
|
@@ -125506,7 +125739,7 @@ var RemoteCommunity = class extends import_lib$1.TypedEmitter {
|
|
|
125506
125739
|
this._updatingCommunityInstanceWithListeners.community.on("updatingstatechange", this._updatingCommunityInstanceWithListeners.updatingstatechange);
|
|
125507
125740
|
this._updatingCommunityInstanceWithListeners.community.on("error", this._updatingCommunityInstanceWithListeners.error);
|
|
125508
125741
|
this._updatingCommunityInstanceWithListeners.community.on("statechange", this._updatingCommunityInstanceWithListeners.statechange);
|
|
125509
|
-
const clientKeys =
|
|
125742
|
+
const clientKeys = t$13(this.clients);
|
|
125510
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]);
|
|
125511
125744
|
this._updatingCommunityInstanceWithListeners.community._numOfListenersForUpdatingInstance++;
|
|
125512
125745
|
if (this._updatingCommunityInstanceWithListeners.community.state === "stopped") {
|
|
@@ -125534,7 +125767,7 @@ var RemoteCommunity = class extends import_lib$1.TypedEmitter {
|
|
|
125534
125767
|
this._updatingCommunityInstanceWithListeners.community.removeListener("update", this._updatingCommunityInstanceWithListeners.update);
|
|
125535
125768
|
this._updatingCommunityInstanceWithListeners.community.removeListener("updatingstatechange", this._updatingCommunityInstanceWithListeners.updatingstatechange);
|
|
125536
125769
|
this._updatingCommunityInstanceWithListeners.community.removeListener("error", this._updatingCommunityInstanceWithListeners.error);
|
|
125537
|
-
const clientKeys =
|
|
125770
|
+
const clientKeys = t$13(this.clients);
|
|
125538
125771
|
for (const clientType of clientKeys) if (this.clients[clientType]) for (const clientUrl of Object.keys(this.clients[clientType])) this.clients[clientType][clientUrl].unmirror();
|
|
125539
125772
|
this._updatingCommunityInstanceWithListeners.community._numOfListenersForUpdatingInstance--;
|
|
125540
125773
|
if (this._updatingCommunityInstanceWithListeners.community._numOfListenersForUpdatingInstance === 0 && this._updatingCommunityInstanceWithListeners.community.state !== "stopped") {
|
|
@@ -125597,7 +125830,7 @@ var AddressRewriterDatabase = class {
|
|
|
125597
125830
|
async initialize() {
|
|
125598
125831
|
try {
|
|
125599
125832
|
const dbDir = path.dirname(this._dbPath);
|
|
125600
|
-
await
|
|
125833
|
+
await fsp.mkdir(dbDir, { recursive: true });
|
|
125601
125834
|
this._db = new Database(this._dbPath);
|
|
125602
125835
|
this._db.exec(`
|
|
125603
125836
|
CREATE TABLE IF NOT EXISTS request_logs (
|
|
@@ -125701,7 +125934,7 @@ const debug = logger_default("pkc-js:addresses-rewriter");
|
|
|
125701
125934
|
const MAX_BODY_PREVIEW_BYTES = 4096;
|
|
125702
125935
|
function normalizeSelfAddrsForProvider(addrs, peerId) {
|
|
125703
125936
|
const suffix = `/p2p/${peerId}`;
|
|
125704
|
-
return
|
|
125937
|
+
return n$10(addrs.map((addr) => addr.endsWith(suffix) ? addr.slice(0, -suffix.length) : addr));
|
|
125705
125938
|
}
|
|
125706
125939
|
var AddressesRewriterProxyServer = class {
|
|
125707
125940
|
constructor({ kuboClients: kuboClient, port, hostname, proxyTargetUrl, pkc }) {
|
|
@@ -125933,7 +126166,7 @@ var AddressesRewriterProxyServer = class {
|
|
|
125933
126166
|
const peerId = idRes.id.toString();
|
|
125934
126167
|
if (typeof peerId !== "string") throw Error("Failed to get Peer ID of kubo node");
|
|
125935
126168
|
const swarmListeningAddresses = swarmAddrsRes.filter((swarmAddr) => swarmAddr.id.toString() === peerId);
|
|
125936
|
-
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);
|
|
125937
126170
|
if (addresses.length === 0) throw Error(`Failed to get any addresses for peer ${peerId}`);
|
|
125938
126171
|
this.addresses[peerId] = addresses;
|
|
125939
126172
|
resolve();
|
|
@@ -128274,8 +128507,7 @@ const getChallenge = async ({ challengeSettings, challengeRequestMessage }) => {
|
|
|
128274
128507
|
const matchResults = [];
|
|
128275
128508
|
for (const match of matches) {
|
|
128276
128509
|
const { propertyName, regexp } = match;
|
|
128277
|
-
const
|
|
128278
|
-
const value = import_commonjs.pathOr(publication, pathSegments, void 0);
|
|
128510
|
+
const value = t$3(publication, t(propertyName), void 0);
|
|
128279
128511
|
if (value === void 0) {
|
|
128280
128512
|
matchResults.push({
|
|
128281
128513
|
success: false,
|
|
@@ -128825,7 +129057,7 @@ const getChallengeVerification = async ({ challengeRequestMessage, community, ge
|
|
|
128825
129057
|
let pendingApprovalSuccess = "pendingApprovalSuccess" in res ? res.pendingApprovalSuccess : false;
|
|
128826
129058
|
let challengeVerification;
|
|
128827
129059
|
if ("pendingChallenges" in res) {
|
|
128828
|
-
const challengeAnswers = await getChallengeAnswers(res.pendingChallenges.map((challenge) =>
|
|
129060
|
+
const challengeAnswers = await getChallengeAnswers(res.pendingChallenges.map((challenge) => n$9(challenge, ["index", "verify"])));
|
|
128829
129061
|
const verificationFromPending = await getChallengeVerificationFromChallengeAnswers({
|
|
128830
129062
|
pendingChallenges: res.pendingChallenges,
|
|
128831
129063
|
challengeAnswers,
|
|
@@ -128837,7 +129069,7 @@ const getChallengeVerification = async ({ challengeRequestMessage, community, ge
|
|
|
128837
129069
|
});
|
|
128838
129070
|
if ("pendingApprovalSuccess" in verificationFromPending) {
|
|
128839
129071
|
pendingApprovalSuccess = pendingApprovalSuccess || verificationFromPending.pendingApprovalSuccess;
|
|
128840
|
-
challengeVerification =
|
|
129072
|
+
challengeVerification = n$9(verificationFromPending, ["pendingApprovalSuccess"]);
|
|
128841
129073
|
} else {
|
|
128842
129074
|
pendingApprovalSuccess = false;
|
|
128843
129075
|
challengeVerification = verificationFromPending;
|
|
@@ -128899,12 +129131,12 @@ var RpcRemoteCommunity = class extends RemoteCommunity {
|
|
|
128899
129131
|
this._updatingRpcCommunityInstanceWithListeners = void 0;
|
|
128900
129132
|
}
|
|
128901
129133
|
_setRpcClientStateWithoutEmission(newState) {
|
|
128902
|
-
const currentRpcUrl =
|
|
129134
|
+
const currentRpcUrl = t$13(this.clients.pkcRpcClients)[0];
|
|
128903
129135
|
if (newState === this.clients.pkcRpcClients[currentRpcUrl].state) return;
|
|
128904
129136
|
this.clients.pkcRpcClients[currentRpcUrl].state = newState;
|
|
128905
129137
|
}
|
|
128906
129138
|
_setRpcClientStateWithEmission(newState) {
|
|
128907
|
-
const currentRpcUrl =
|
|
129139
|
+
const currentRpcUrl = t$13(this.clients.pkcRpcClients)[0];
|
|
128908
129140
|
if (newState === this.clients.pkcRpcClients[currentRpcUrl].state) return;
|
|
128909
129141
|
this.clients.pkcRpcClients[currentRpcUrl].state = newState;
|
|
128910
129142
|
this.clients.pkcRpcClients[currentRpcUrl].emit("statechange", newState);
|
|
@@ -128992,7 +129224,7 @@ var RpcRemoteCommunity = class extends RemoteCommunity {
|
|
|
128992
129224
|
this._updatingRpcCommunityInstanceWithListeners.community.on("challengeanswer", this._updatingRpcCommunityInstanceWithListeners.challengeanswer);
|
|
128993
129225
|
this._updatingRpcCommunityInstanceWithListeners.community.on("challenge", this._updatingRpcCommunityInstanceWithListeners.challenge);
|
|
128994
129226
|
this._updatingRpcCommunityInstanceWithListeners.community.on("startedstatechange", this._updatingRpcCommunityInstanceWithListeners.startedstatechange);
|
|
128995
|
-
const clientKeys =
|
|
129227
|
+
const clientKeys = t$13(this.clients);
|
|
128996
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]);
|
|
128997
129229
|
this._updatingRpcCommunityInstanceWithListeners.community._numOfListenersForUpdatingInstance++;
|
|
128998
129230
|
const nameResolvedBeforeMirror = this.nameResolved;
|
|
@@ -129083,7 +129315,7 @@ var RpcRemoteCommunity = class extends RemoteCommunity {
|
|
|
129083
129315
|
this._updatingRpcCommunityInstanceWithListeners.community.removeListener("challengeanswer", this._updatingRpcCommunityInstanceWithListeners.challengeanswer);
|
|
129084
129316
|
this._updatingRpcCommunityInstanceWithListeners.community.removeListener("challenge", this._updatingRpcCommunityInstanceWithListeners.challenge);
|
|
129085
129317
|
this._updatingRpcCommunityInstanceWithListeners.community.removeListener("startedstatechange", this._updatingRpcCommunityInstanceWithListeners.startedstatechange);
|
|
129086
|
-
const clientKeys =
|
|
129318
|
+
const clientKeys = t$13(this.clients);
|
|
129087
129319
|
for (const clientType of clientKeys) if (this.clients[clientType]) for (const clientUrl of Object.keys(this.clients[clientType])) this.clients[clientType][clientUrl].unmirror();
|
|
129088
129320
|
this._updatingRpcCommunityInstanceWithListeners.community._numOfListenersForUpdatingInstance--;
|
|
129089
129321
|
if (this._updatingRpcCommunityInstanceWithListeners.community._numOfListenersForUpdatingInstance === 0 && this._updatingRpcCommunityInstanceWithListeners.community.state === "updating") {
|
|
@@ -129136,7 +129368,7 @@ var RpcLocalCommunity = class extends RpcRemoteCommunity {
|
|
|
129136
129368
|
this.edit = this.edit.bind(this);
|
|
129137
129369
|
this._setStartedStateWithEmission("stopped");
|
|
129138
129370
|
this.on("update", () => {
|
|
129139
|
-
this.editable =
|
|
129371
|
+
this.editable = t$2(this, t$13(CommunityEditOptionsSchema.shape));
|
|
129140
129372
|
});
|
|
129141
129373
|
hideClassPrivateProps(this);
|
|
129142
129374
|
}
|
|
@@ -129189,7 +129421,7 @@ var RpcLocalCommunity = class extends RpcRemoteCommunity {
|
|
|
129189
129421
|
this.started = newProps.localCommunity.started;
|
|
129190
129422
|
this.updateCid = newProps.runtimeFields.updateCid;
|
|
129191
129423
|
this.raw.localCommunity = newProps;
|
|
129192
|
-
this.editable =
|
|
129424
|
+
this.editable = t$2(this, t$13(CommunityEditOptionsSchema.shape));
|
|
129193
129425
|
}
|
|
129194
129426
|
_updateRpcClientStateFromStartedState(startedState) {
|
|
129195
129427
|
({
|
|
@@ -129453,4 +129685,4 @@ var RpcLocalCommunity = class extends RpcRemoteCommunity {
|
|
|
129453
129685
|
}
|
|
129454
129686
|
};
|
|
129455
129687
|
//#endregion
|
|
129456
|
-
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 };
|