@pkcprotocol/pkc-js 0.0.69 → 0.0.70
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/generated-version.d.ts +1 -1
- package/dist/browser/generated-version.js +1 -1
- package/dist/browser/helia/util.js +171 -0
- package/dist/browser/helia/util.js.map +1 -1
- package/dist/browser/rpc/src/schema.d.ts +22 -10
- package/dist/browser/schema.d.ts +10 -21
- package/dist/browser/schema.js.map +1 -1
- package/dist/bundled/bundle-manifest.json +31 -31
- package/dist/bundled/chunks/{helia-for-pkc-x-xe-CrX.js → helia-for-pkc-CkFh5nlx.js} +2 -2
- package/dist/bundled/chunks/{local-community-BuseLMgO.js → local-community-B66sHtZ1.js} +1 -1
- package/dist/bundled/chunks/{local-community-B6IwJoBu.js → local-community-DF2_ny4_.js} +2 -2
- package/dist/bundled/chunks/{node-Dz5IKip2.js → node-C-uEWzwA.js} +5 -5
- package/dist/bundled/chunks/{rpc-local-community-D8woL19t.js → rpc-local-community-uFGcODiy.js} +1 -1
- package/dist/bundled/chunks/{schema-C_l9RSe0.js → schema-CdHApryH.js} +1 -1
- package/dist/bundled/chunks/{util-bpDx_Vq2.js → util-D6lhOdvW.js} +90 -1
- package/dist/bundled/index.js +1 -1
- package/dist/bundled/rpc/src/index.js +4 -4
- package/dist/node/generated-version.d.ts +1 -1
- package/dist/node/generated-version.js +1 -1
- package/dist/node/helia/util.js +171 -0
- package/dist/node/helia/util.js.map +1 -1
- package/dist/node/rpc/src/schema.d.ts +22 -10
- package/dist/node/schema.d.ts +10 -21
- package/dist/node/schema.js.map +1 -1
- package/package.json +2 -1
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"node:module"
|
|
15
15
|
],
|
|
16
16
|
"dynamicImports": [
|
|
17
|
-
"chunks/node-
|
|
17
|
+
"chunks/node-C-uEWzwA.js"
|
|
18
18
|
],
|
|
19
19
|
"inputs": [
|
|
20
20
|
"dist/node/runtime/node/compile-cache.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"index.js": {
|
|
25
25
|
"isEntry": true,
|
|
26
26
|
"imports": [
|
|
27
|
-
"chunks/node-
|
|
27
|
+
"chunks/node-C-uEWzwA.js"
|
|
28
28
|
],
|
|
29
29
|
"dynamicImports": [],
|
|
30
30
|
"inputs": []
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"rpc/src/index.js": {
|
|
33
33
|
"isEntry": true,
|
|
34
34
|
"imports": [
|
|
35
|
-
"chunks/rpc-local-community-
|
|
36
|
-
"chunks/node-
|
|
37
|
-
"chunks/schema-
|
|
38
|
-
"chunks/local-community-
|
|
35
|
+
"chunks/rpc-local-community-uFGcODiy.js",
|
|
36
|
+
"chunks/node-C-uEWzwA.js",
|
|
37
|
+
"chunks/schema-CdHApryH.js",
|
|
38
|
+
"chunks/local-community-DF2_ny4_.js",
|
|
39
39
|
"node:url",
|
|
40
40
|
"path",
|
|
41
41
|
"assert",
|
|
@@ -64,11 +64,11 @@
|
|
|
64
64
|
"\u0000rolldown/runtime.js"
|
|
65
65
|
]
|
|
66
66
|
},
|
|
67
|
-
"chunks/helia-for-pkc-
|
|
67
|
+
"chunks/helia-for-pkc-CkFh5nlx.js": {
|
|
68
68
|
"isEntry": false,
|
|
69
69
|
"imports": [
|
|
70
|
-
"chunks/schema-
|
|
71
|
-
"chunks/util-
|
|
70
|
+
"chunks/schema-CdHApryH.js",
|
|
71
|
+
"chunks/util-D6lhOdvW.js",
|
|
72
72
|
"multiformats/cid",
|
|
73
73
|
"@libp2p/peer-id",
|
|
74
74
|
"events",
|
|
@@ -94,12 +94,20 @@
|
|
|
94
94
|
"dist/node/helia/helia-for-pkc.js"
|
|
95
95
|
]
|
|
96
96
|
},
|
|
97
|
-
"chunks/local-community-
|
|
97
|
+
"chunks/local-community-B66sHtZ1.js": {
|
|
98
|
+
"isEntry": false,
|
|
99
|
+
"imports": [
|
|
100
|
+
"chunks/local-community-DF2_ny4_.js"
|
|
101
|
+
],
|
|
102
|
+
"dynamicImports": [],
|
|
103
|
+
"inputs": []
|
|
104
|
+
},
|
|
105
|
+
"chunks/local-community-DF2_ny4_.js": {
|
|
98
106
|
"isEntry": false,
|
|
99
107
|
"imports": [
|
|
100
108
|
"chunks/chunk-2rV9d50f.js",
|
|
101
|
-
"chunks/rpc-local-community-
|
|
102
|
-
"chunks/schema-
|
|
109
|
+
"chunks/rpc-local-community-uFGcODiy.js",
|
|
110
|
+
"chunks/schema-CdHApryH.js",
|
|
103
111
|
"node:crypto",
|
|
104
112
|
"node:url",
|
|
105
113
|
"node:path",
|
|
@@ -152,21 +160,13 @@
|
|
|
152
160
|
"dist/node/runtime/node/community/local-community.js"
|
|
153
161
|
]
|
|
154
162
|
},
|
|
155
|
-
"chunks/
|
|
156
|
-
"isEntry": false,
|
|
157
|
-
"imports": [
|
|
158
|
-
"chunks/local-community-B6IwJoBu.js"
|
|
159
|
-
],
|
|
160
|
-
"dynamicImports": [],
|
|
161
|
-
"inputs": []
|
|
162
|
-
},
|
|
163
|
-
"chunks/node-Dz5IKip2.js": {
|
|
163
|
+
"chunks/node-C-uEWzwA.js": {
|
|
164
164
|
"isEntry": false,
|
|
165
165
|
"imports": [
|
|
166
166
|
"chunks/chunk-2rV9d50f.js",
|
|
167
|
-
"chunks/rpc-local-community-
|
|
168
|
-
"chunks/schema-
|
|
169
|
-
"chunks/util-
|
|
167
|
+
"chunks/rpc-local-community-uFGcODiy.js",
|
|
168
|
+
"chunks/schema-CdHApryH.js",
|
|
169
|
+
"chunks/util-D6lhOdvW.js",
|
|
170
170
|
"path",
|
|
171
171
|
"assert",
|
|
172
172
|
"fs",
|
|
@@ -177,8 +177,8 @@
|
|
|
177
177
|
"rpc-websockets"
|
|
178
178
|
],
|
|
179
179
|
"dynamicImports": [
|
|
180
|
-
"chunks/helia-for-pkc-
|
|
181
|
-
"chunks/local-community-
|
|
180
|
+
"chunks/helia-for-pkc-CkFh5nlx.js",
|
|
181
|
+
"chunks/local-community-DF2_ny4_.js"
|
|
182
182
|
],
|
|
183
183
|
"inputs": [
|
|
184
184
|
"node_modules/zod/v4/locales/en.js",
|
|
@@ -231,11 +231,11 @@
|
|
|
231
231
|
"dist/node/index.js"
|
|
232
232
|
]
|
|
233
233
|
},
|
|
234
|
-
"chunks/rpc-local-community-
|
|
234
|
+
"chunks/rpc-local-community-uFGcODiy.js": {
|
|
235
235
|
"isEntry": false,
|
|
236
236
|
"imports": [
|
|
237
237
|
"chunks/chunk-2rV9d50f.js",
|
|
238
|
-
"chunks/schema-
|
|
238
|
+
"chunks/schema-CdHApryH.js",
|
|
239
239
|
"chunks/src-CYIMjhjK.js",
|
|
240
240
|
"node:http",
|
|
241
241
|
"node:crypto",
|
|
@@ -791,7 +791,7 @@
|
|
|
791
791
|
"dist/node/community/rpc-local-community.js"
|
|
792
792
|
]
|
|
793
793
|
},
|
|
794
|
-
"chunks/schema-
|
|
794
|
+
"chunks/schema-CdHApryH.js": {
|
|
795
795
|
"isEntry": false,
|
|
796
796
|
"imports": [
|
|
797
797
|
"chunks/chunk-2rV9d50f.js",
|
|
@@ -1228,10 +1228,10 @@
|
|
|
1228
1228
|
"node_modules/ipfs-unixfs-importer/dist/src/index.js"
|
|
1229
1229
|
]
|
|
1230
1230
|
},
|
|
1231
|
-
"chunks/util-
|
|
1231
|
+
"chunks/util-D6lhOdvW.js": {
|
|
1232
1232
|
"isEntry": false,
|
|
1233
1233
|
"imports": [
|
|
1234
|
-
"chunks/schema-
|
|
1234
|
+
"chunks/schema-CdHApryH.js",
|
|
1235
1235
|
"ipns/selector",
|
|
1236
1236
|
"uint8arrays/equals"
|
|
1237
1237
|
],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as hideClassPrivateProps, R as ipnsNameToIpnsOverPubsubTopic, _r as PKCError, yr as logger_default } from "./schema-
|
|
2
|
-
import { a as selectBitswapSessionSeedPeers, i as getHeliaDebugContext, n as connectToPubsubPeers, r as directFetchIpnsRecordFromProviders, t as cacheIpnsRecordInPubsubLocalStore } from "./util-
|
|
1
|
+
import { L as hideClassPrivateProps, R as ipnsNameToIpnsOverPubsubTopic, _r as PKCError, yr as logger_default } from "./schema-CdHApryH.js";
|
|
2
|
+
import { a as selectBitswapSessionSeedPeers, i as getHeliaDebugContext, n as connectToPubsubPeers, r as directFetchIpnsRecordFromProviders, t as cacheIpnsRecordInPubsubLocalStore } from "./util-D6lhOdvW.js";
|
|
3
3
|
import { CID } from "multiformats/cid";
|
|
4
4
|
import { peerIdFromString } from "@libp2p/peer-id";
|
|
5
5
|
import { EventEmitter as EventEmitter$1 } from "events";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as createNewLocalCommunityDb, r as updateInstancePropsWithStartedCommunityOrDb, t as LocalCommunity } from "./local-community-
|
|
1
|
+
import { n as createNewLocalCommunityDb, r as updateInstancePropsWithStartedCommunityOrDb, t as LocalCommunity } from "./local-community-DF2_ny4_.js";
|
|
2
2
|
export { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
|
|
2
|
-
import { $ as pubsubTopicToDhtKey, $n as t$7, At as trackStartedCommunity, Bt as CommunityEditPublicationPubsubReservedFields, C as contentContainsMarkdownAudio, Ct as findUpdatingCommunity, En as CommentUpdateSchema, F as getIpnsRecordInLocalKuboNode, Fn as CommentEditPubsubMessagePublicationSchema, Ft as untrackUpdatingCommunity, G as isLinkOfAudio, Gt as CommentModerationPubsubMessagePublicationSchema, In as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, It as require_sha256, J as isLinkOfVideo, Jt as CommentModerationsTableRowSchema, K as isLinkOfImage, Kt as CommentModerationReservedFields, L as hideClassPrivateProps, Ln as CommentEditReservedFields, M as genToArray, Mr as ZodError, Mt as trackUpdatingCommunity, N as getEquivalentCommunityAddresses, Nt as untrackStartedCommunity, O as derivePublicationFromChallengeRequest, On as CommentUpdateTableRowSchema, P as getErrorCodeFromMessage, Q as isStringDomain, Qn as n$3, R as ipnsNameToIpnsOverPubsubTopic, Rt as pTimeout, S as calculateStringSizeSameAsIpfsAddCidV0, T as contentContainsMarkdownVideos, Un as AuthorReservedFields, W as isLinkOfAnimatedImage, Xn as n$4, Y as isLinkValid, Zn as t$8, _r as PKCError, _t as timestamp, a as ChallengeRequestMessageSchema, ar as t$4, at as removeNullUndefinedValues, b as areEquivalentCommunityAddresses, bt as findCommunityInRegistry, cr as t$5, d as DecryptedChallengeRequestSchema, dr as require_retry, dt as retryKuboIpfsAddAndProvide, er as t$6, fn as VotePubsubMessagePublicationSchema, hn as VoteTablesRowSchema, ht as statMfsPathSafely, ir as r$1, k as doesDomainAddressHaveCapitalLetter, kn as CommentsTableRowSchema, kt as syncCommunityRegistryEntry, lr as t$3, lt as retryKuboBlockPutPinAndProvidePubsubTopic, mt as sleepUntilTimeoutOrAbort, nn as CommunityIpfsSchema, nr as e$1, nt as removeBlocksFromKuboNode, pn as VotePubsubReservedFields, q as isLinkOfMedia, r as ChallengeMessageSchema, rn as CommunitySignedPropertyNames, rt as removeMfsFilesSafely, s as ChallengeVerificationMessageSchema, t as ChallengeAnswerMessageSchema, tr as e, u as DecryptedChallengeRequestPublicationSchema, vn as CommentIpfsSchema, vr as messages, w as contentContainsMarkdownImages, x as calculateIpfsCidV0, xt as findStartedCommunity, y as version_default, yn as CommentPubsubMessageReservedFields, yr as logger_default, yt as writeKuboFilesWithTimeout, zn as CommentEditsTableRowSchema } from "./schema-
|
|
3
|
-
import { $n as t$10, A as deriveDbPosts, At as verifyCommunityEdit, Bt as getCommunityPublicKeyFromWire, C as BackupAbortError, Dt as verifyCommentPubsubMessage, E as calculateInlineRepliesBudget, Et as verifyCommentModeration, F as importSignerIntoKuboNode, Ft as getAuthorNameFromWire, G as REPLY_REPLIES_SORT_TYPES, Gt as getIpfsKeyFromPrivateKey, Ht as decode, Jn as r$2, Jt as getPublicKeyFromPrivateKey, K as TIMEFRAMES_TO_SECONDS, Kn as t$9, Kt as getPKCAddressFromPublicKey, M as getDefaultCommunityDbConfig, Mt as buildRuntimeAuthor, Nt as cleanWireAuthor, O as deleteOldCommunityInWindows, Ot as verifyCommentUpdate, P as getThumbnailPropsOfLink, R as moveCommunityDbToDeletedDirectory, S as encryptEd25519AesGcmPublicKeyBuffer, St as verifyChallengeRequest, T as calculateExpectedSignatureSize, Tt as verifyCommentIpfs, U as POSTS_SORT_TYPES, Ut as encode, W as POST_REPLIES_SORT_TYPES, Xn as n$6, Yn as t$11, Yt as createSchemaRowParser, Z as iterateOverPageCidsToFindAllCids, Zn as n$5, _ as SignerWithPublicKeyAddress, _t as signCommunity, a as pkcJsChallenges, b as decryptEd25519AesGcmPublicKeyBuffer, bt as verifyChallengeAnswer, cn as parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails, d as MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS, dt as signChallengeVerification, er as stringify, f as KeyvBetterSqlite3, ft as signComment, gt as signCommentUpdateForChallengeVerification, ht as signCommentUpdate, i as getCommunityChallengeFromCommunityChallengeSettings, it as pLimit, j as deriveDbReplies, jt as verifyVote, k as deriveCommentIpfsFromCommentTableRow, kt as verifyCommunity, l as normalizeSelfAddrsForProvider, lt as signChallengeMessage, nr as require_lodash_merge, o as TrackedInstanceRegistry, on as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, pt as signCommentEdit, qn as t$12, qt as getPKCAddressFromPublicKeySync, r as getChallengeVerification, s as LRUCache, st as cleanUpBeforePublishing, t as RpcLocalCommunity, tr as STORAGE_KEYS, vn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, w as backupCommunityDb, wt as verifyCommentEdit, xn as parseJsonWithPKCErrorIfFails, z as resolveDbPostsCidRefs, zt as getCommunityNameFromWire } from "./rpc-local-community-
|
|
2
|
+
import { $ as pubsubTopicToDhtKey, $n as t$7, At as trackStartedCommunity, Bt as CommunityEditPublicationPubsubReservedFields, C as contentContainsMarkdownAudio, Ct as findUpdatingCommunity, En as CommentUpdateSchema, F as getIpnsRecordInLocalKuboNode, Fn as CommentEditPubsubMessagePublicationSchema, Ft as untrackUpdatingCommunity, G as isLinkOfAudio, Gt as CommentModerationPubsubMessagePublicationSchema, In as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, It as require_sha256, J as isLinkOfVideo, Jt as CommentModerationsTableRowSchema, K as isLinkOfImage, Kt as CommentModerationReservedFields, L as hideClassPrivateProps, Ln as CommentEditReservedFields, M as genToArray, Mr as ZodError, Mt as trackUpdatingCommunity, N as getEquivalentCommunityAddresses, Nt as untrackStartedCommunity, O as derivePublicationFromChallengeRequest, On as CommentUpdateTableRowSchema, P as getErrorCodeFromMessage, Q as isStringDomain, Qn as n$3, R as ipnsNameToIpnsOverPubsubTopic, Rt as pTimeout, S as calculateStringSizeSameAsIpfsAddCidV0, T as contentContainsMarkdownVideos, Un as AuthorReservedFields, W as isLinkOfAnimatedImage, Xn as n$4, Y as isLinkValid, Zn as t$8, _r as PKCError, _t as timestamp, a as ChallengeRequestMessageSchema, ar as t$4, at as removeNullUndefinedValues, b as areEquivalentCommunityAddresses, bt as findCommunityInRegistry, cr as t$5, d as DecryptedChallengeRequestSchema, dr as require_retry, dt as retryKuboIpfsAddAndProvide, er as t$6, fn as VotePubsubMessagePublicationSchema, hn as VoteTablesRowSchema, ht as statMfsPathSafely, ir as r$1, k as doesDomainAddressHaveCapitalLetter, kn as CommentsTableRowSchema, kt as syncCommunityRegistryEntry, lr as t$3, lt as retryKuboBlockPutPinAndProvidePubsubTopic, mt as sleepUntilTimeoutOrAbort, nn as CommunityIpfsSchema, nr as e$1, nt as removeBlocksFromKuboNode, pn as VotePubsubReservedFields, q as isLinkOfMedia, r as ChallengeMessageSchema, rn as CommunitySignedPropertyNames, rt as removeMfsFilesSafely, s as ChallengeVerificationMessageSchema, t as ChallengeAnswerMessageSchema, tr as e, u as DecryptedChallengeRequestPublicationSchema, vn as CommentIpfsSchema, vr as messages, w as contentContainsMarkdownImages, x as calculateIpfsCidV0, xt as findStartedCommunity, y as version_default, yn as CommentPubsubMessageReservedFields, yr as logger_default, yt as writeKuboFilesWithTimeout, zn as CommentEditsTableRowSchema } from "./schema-CdHApryH.js";
|
|
3
|
+
import { $n as t$10, A as deriveDbPosts, At as verifyCommunityEdit, Bt as getCommunityPublicKeyFromWire, C as BackupAbortError, Dt as verifyCommentPubsubMessage, E as calculateInlineRepliesBudget, Et as verifyCommentModeration, F as importSignerIntoKuboNode, Ft as getAuthorNameFromWire, G as REPLY_REPLIES_SORT_TYPES, Gt as getIpfsKeyFromPrivateKey, Ht as decode, Jn as r$2, Jt as getPublicKeyFromPrivateKey, K as TIMEFRAMES_TO_SECONDS, Kn as t$9, Kt as getPKCAddressFromPublicKey, M as getDefaultCommunityDbConfig, Mt as buildRuntimeAuthor, Nt as cleanWireAuthor, O as deleteOldCommunityInWindows, Ot as verifyCommentUpdate, P as getThumbnailPropsOfLink, R as moveCommunityDbToDeletedDirectory, S as encryptEd25519AesGcmPublicKeyBuffer, St as verifyChallengeRequest, T as calculateExpectedSignatureSize, Tt as verifyCommentIpfs, U as POSTS_SORT_TYPES, Ut as encode, W as POST_REPLIES_SORT_TYPES, Xn as n$6, Yn as t$11, Yt as createSchemaRowParser, Z as iterateOverPageCidsToFindAllCids, Zn as n$5, _ as SignerWithPublicKeyAddress, _t as signCommunity, a as pkcJsChallenges, b as decryptEd25519AesGcmPublicKeyBuffer, bt as verifyChallengeAnswer, cn as parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails, d as MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS, dt as signChallengeVerification, er as stringify, f as KeyvBetterSqlite3, ft as signComment, gt as signCommentUpdateForChallengeVerification, ht as signCommentUpdate, i as getCommunityChallengeFromCommunityChallengeSettings, it as pLimit, j as deriveDbReplies, jt as verifyVote, k as deriveCommentIpfsFromCommentTableRow, kt as verifyCommunity, l as normalizeSelfAddrsForProvider, lt as signChallengeMessage, nr as require_lodash_merge, o as TrackedInstanceRegistry, on as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, pt as signCommentEdit, qn as t$12, qt as getPKCAddressFromPublicKeySync, r as getChallengeVerification, s as LRUCache, st as cleanUpBeforePublishing, t as RpcLocalCommunity, tr as STORAGE_KEYS, vn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, w as backupCommunityDb, wt as verifyCommentEdit, xn as parseJsonWithPKCErrorIfFails, z as resolveDbPostsCidRefs, zt as getCommunityNameFromWire } from "./rpc-local-community-uFGcODiy.js";
|
|
4
4
|
import { randomFillSync, randomUUID } from "node:crypto";
|
|
5
5
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
6
6
|
import path from "node:path";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
|
|
2
|
-
import { B as isIpfsCid, Cn as CommentUpdateForChallengeVerificationSchema, Ct as findUpdatingCommunity, D as deepMergeRuntimeFields, Dt as refreshTrackedCommentAliases, E as createAbortError, En as CommentUpdateSchema, Et as listUpdatingCommunities, Fr as stringifyPrimitive, H as isIpns, It as require_sha256, L as hideClassPrivateProps, Lt as TimeoutError, Nr as joinValues, Pr as parsedType, Pt as untrackUpdatingComment, Q as isStringDomain, Qn as n$1, R as ipnsNameToIpnsOverPubsubTopic, Rt as pTimeout, Sr as setErrorMap, St as findUpdatingComment, Tt as listUpdatingComments, Xn as n$2, _r as PKCError, _t as timestamp, a as ChallengeRequestMessageSchema, b as areEquivalentCommunityAddresses, br as require_supports_color, cn as PubsubTopicSchema, ct as resolveWhenPredicateIsTrue, dr as require_retry, er as t$1, fr as FailedToFetchCommentIpfsFromGatewaysError, ft as shortifyAddress, ir as r, jt as trackUpdatingComment, k as doesDomainAddressHaveCapitalLetter, mt as sleepUntilTimeoutOrAbort, nn as CommunityIpfsSchema, nr as e$1, ot as removeUndefinedValuesRecursively, pt as shortifyCid, r as ChallengeMessageSchema, s as ChallengeVerificationMessageSchema, st as replaceXWithY, t as ChallengeAnswerMessageSchema, tr as e, ut as retryKuboIpfsAdd, vn as CommentIpfsSchema, vr as messages, vt as waitForUpdateInCommunityInstanceWithErrorAndTimeout, wt as listStartedCommunities, xt as findStartedCommunity, y as version_default, yr as logger_default, z as isAbortError } from "./schema-
|
|
3
|
-
import { $ as RepliesPages, $n as t$5, $t as parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, An as RpcCidParamSchema, At as verifyCommunityEdit, B as setNativeFunctions$1, Bn as RpcFetchCidResultSchema, Bt as getCommunityPublicKeyFromWire, Cn as parseRpcCommentEventWithPKCErrorIfItFails, Ct as verifyChallengeVerification, D as createKuboRpcClient, Dn as parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails, Dt as verifyCommentPubsubMessage, Et as verifyCommentModeration, Fn as RpcExportCommunityModLogsParamSchema, Gn as RpcUnsubscribeParamSchema, H as CommentClientsManager, Hn as RpcResolveAuthorNameResultSchema, Ht as decode, I as listCommunitiesSync, In as RpcExportCommunityModLogsResultSchema, It as normalizeCreatePublicationAuthor, Kn as t$4, L as monitorCommunitiesDirectory, Ln as RpcExportCommunityParamSchema, Lt as buildRuntimeCommunityFields, Mn as RpcCommunityIdentifierParamSchema, Mt as buildRuntimeAuthor, N as getDefaultDataPath, Nn as RpcCommunityPageParamSchema, Nt as cleanWireAuthor, On as RpcAuthorNameParamSchema, Ot as verifyCommentUpdate, Pn as RpcEditCommunityParamSchema, Pt as getAuthorNameFromRuntime, Q as parseRawPages, Qn as t$2, Rn as RpcExportCommunityResultSchema, Rt as getCommunityAddressFromRecord, Sn as parsePKCUserOptionsSchemaWithPKCErrorIfItFails, Tn as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, Tt as verifyCommentIpfs, Un as RpcSubscriptionIdResultSchema, V as tryToDeleteCommunitiesThatFailedToBeDeletedBefore, Vn as RpcPublishChallengeAnswersParamSchema, Vt as normalizeCommunityInputFromCommunity, Wn as RpcSuccessResultSchema, Wt as getBufferedPKCAddressFromPublicKey, X as findCommentInPageInstanceRecursively, Xn as n$3, Xt as parseCidStringSchemaWithPKCErrorIfItFails, Y as extractCommunityRuntimeFieldsFromParsedPages, Yn as t$3, _n as parseCreateVoteOptionsSchemaWithPKCErrorIfItFails, a as pkcJsChallenges, at as PKCTypedEmitter, bn as parseDecryptedChallengeWithPKCErrorIfItFails, c as AddressesRewriterProxyServer, ct as signChallengeAnswer, dn as parseCreateCommentOptionsSchemaWithPKCErrorIfItFails, en as parseCommentIpfsSchemaWithPKCErrorIfItFails, et as PublicationClientsManager, f as KeyvBetterSqlite3, fn as parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails, ft as signComment, g as decodeRpcChallengeVerificationPubsubMsg, gn as parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, h as decodeRpcChallengeRequestPubsubMsg, hn as parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, in as parseCommunityAddressWithPKCErrorIfItFails, ir as require_undici, jn as RpcCommentRepliesPageParamSchema, jt as verifyVote, kn as RpcCancelExportParamSchema, ln as parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails, m as decodeRpcChallengePubsubMsg, mt as signCommentModeration, n as RpcRemoteCommunity, nn as parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails, nt as InflightFetchManager, o as TrackedInstanceRegistry, ot as require_lib$1, p as decodeRpcChallengeAnswerPubsubMsg, pt as signCommentEdit, rn as parseCommentPubsubMessagePublicationWithPKCErrorIfItFails, rr as nativeFunctions$2, s as LRUCache, sn as parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, st as cleanUpBeforePublishing, t as RpcLocalCommunity, tt as PKCClientsManager, u as RemoteCommunity, un as parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails, ut as signChallengeRequest, v as createSigner, vn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, vt as signCommunityEdit, wn as parseRpcCommentUpdateEventWithPKCErrorIfItFails, wt as verifyCommentEdit, x as encryptEd25519AesGcm, xn as parseJsonWithPKCErrorIfFails, xt as verifyChallengeMessage, y as decryptEd25519AesGcm, yn as parseDecryptedChallengeVerification, yt as signVote, zn as RpcFetchCidParamSchema, zt as getCommunityNameFromWire } from "./rpc-local-community-
|
|
4
|
-
import { i as getHeliaDebugContext } from "./util-
|
|
2
|
+
import { B as isIpfsCid, Cn as CommentUpdateForChallengeVerificationSchema, Ct as findUpdatingCommunity, D as deepMergeRuntimeFields, Dt as refreshTrackedCommentAliases, E as createAbortError, En as CommentUpdateSchema, Et as listUpdatingCommunities, Fr as stringifyPrimitive, H as isIpns, It as require_sha256, L as hideClassPrivateProps, Lt as TimeoutError, Nr as joinValues, Pr as parsedType, Pt as untrackUpdatingComment, Q as isStringDomain, Qn as n$1, R as ipnsNameToIpnsOverPubsubTopic, Rt as pTimeout, Sr as setErrorMap, St as findUpdatingComment, Tt as listUpdatingComments, Xn as n$2, _r as PKCError, _t as timestamp, a as ChallengeRequestMessageSchema, b as areEquivalentCommunityAddresses, br as require_supports_color, cn as PubsubTopicSchema, ct as resolveWhenPredicateIsTrue, dr as require_retry, er as t$1, fr as FailedToFetchCommentIpfsFromGatewaysError, ft as shortifyAddress, ir as r, jt as trackUpdatingComment, k as doesDomainAddressHaveCapitalLetter, mt as sleepUntilTimeoutOrAbort, nn as CommunityIpfsSchema, nr as e$1, ot as removeUndefinedValuesRecursively, pt as shortifyCid, r as ChallengeMessageSchema, s as ChallengeVerificationMessageSchema, st as replaceXWithY, t as ChallengeAnswerMessageSchema, tr as e, ut as retryKuboIpfsAdd, vn as CommentIpfsSchema, vr as messages, vt as waitForUpdateInCommunityInstanceWithErrorAndTimeout, wt as listStartedCommunities, xt as findStartedCommunity, y as version_default, yr as logger_default, z as isAbortError } from "./schema-CdHApryH.js";
|
|
3
|
+
import { $ as RepliesPages, $n as t$5, $t as parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, An as RpcCidParamSchema, At as verifyCommunityEdit, B as setNativeFunctions$1, Bn as RpcFetchCidResultSchema, Bt as getCommunityPublicKeyFromWire, Cn as parseRpcCommentEventWithPKCErrorIfItFails, Ct as verifyChallengeVerification, D as createKuboRpcClient, Dn as parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails, Dt as verifyCommentPubsubMessage, Et as verifyCommentModeration, Fn as RpcExportCommunityModLogsParamSchema, Gn as RpcUnsubscribeParamSchema, H as CommentClientsManager, Hn as RpcResolveAuthorNameResultSchema, Ht as decode, I as listCommunitiesSync, In as RpcExportCommunityModLogsResultSchema, It as normalizeCreatePublicationAuthor, Kn as t$4, L as monitorCommunitiesDirectory, Ln as RpcExportCommunityParamSchema, Lt as buildRuntimeCommunityFields, Mn as RpcCommunityIdentifierParamSchema, Mt as buildRuntimeAuthor, N as getDefaultDataPath, Nn as RpcCommunityPageParamSchema, Nt as cleanWireAuthor, On as RpcAuthorNameParamSchema, Ot as verifyCommentUpdate, Pn as RpcEditCommunityParamSchema, Pt as getAuthorNameFromRuntime, Q as parseRawPages, Qn as t$2, Rn as RpcExportCommunityResultSchema, Rt as getCommunityAddressFromRecord, Sn as parsePKCUserOptionsSchemaWithPKCErrorIfItFails, Tn as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, Tt as verifyCommentIpfs, Un as RpcSubscriptionIdResultSchema, V as tryToDeleteCommunitiesThatFailedToBeDeletedBefore, Vn as RpcPublishChallengeAnswersParamSchema, Vt as normalizeCommunityInputFromCommunity, Wn as RpcSuccessResultSchema, Wt as getBufferedPKCAddressFromPublicKey, X as findCommentInPageInstanceRecursively, Xn as n$3, Xt as parseCidStringSchemaWithPKCErrorIfItFails, Y as extractCommunityRuntimeFieldsFromParsedPages, Yn as t$3, _n as parseCreateVoteOptionsSchemaWithPKCErrorIfItFails, a as pkcJsChallenges, at as PKCTypedEmitter, bn as parseDecryptedChallengeWithPKCErrorIfItFails, c as AddressesRewriterProxyServer, ct as signChallengeAnswer, dn as parseCreateCommentOptionsSchemaWithPKCErrorIfItFails, en as parseCommentIpfsSchemaWithPKCErrorIfItFails, et as PublicationClientsManager, f as KeyvBetterSqlite3, fn as parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails, ft as signComment, g as decodeRpcChallengeVerificationPubsubMsg, gn as parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, h as decodeRpcChallengeRequestPubsubMsg, hn as parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, in as parseCommunityAddressWithPKCErrorIfItFails, ir as require_undici, jn as RpcCommentRepliesPageParamSchema, jt as verifyVote, kn as RpcCancelExportParamSchema, ln as parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails, m as decodeRpcChallengePubsubMsg, mt as signCommentModeration, n as RpcRemoteCommunity, nn as parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails, nt as InflightFetchManager, o as TrackedInstanceRegistry, ot as require_lib$1, p as decodeRpcChallengeAnswerPubsubMsg, pt as signCommentEdit, rn as parseCommentPubsubMessagePublicationWithPKCErrorIfItFails, rr as nativeFunctions$2, s as LRUCache, sn as parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, st as cleanUpBeforePublishing, t as RpcLocalCommunity, tt as PKCClientsManager, u as RemoteCommunity, un as parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails, ut as signChallengeRequest, v as createSigner, vn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, vt as signCommunityEdit, wn as parseRpcCommentUpdateEventWithPKCErrorIfItFails, wt as verifyCommentEdit, x as encryptEd25519AesGcm, xn as parseJsonWithPKCErrorIfFails, xt as verifyChallengeMessage, y as decryptEd25519AesGcm, yn as parseDecryptedChallengeVerification, yt as signVote, zn as RpcFetchCidParamSchema, zt as getCommunityNameFromWire } from "./rpc-local-community-uFGcODiy.js";
|
|
4
|
+
import { i as getHeliaDebugContext } from "./util-D6lhOdvW.js";
|
|
5
5
|
import path from "path";
|
|
6
6
|
import assert from "assert";
|
|
7
7
|
import fs from "fs";
|
|
@@ -8875,7 +8875,7 @@ var PKC$1 = class extends PKCTypedEmitter {
|
|
|
8875
8875
|
this.clients.libp2pJsClients = {};
|
|
8876
8876
|
if (!this.libp2pJsClientsOptions) return;
|
|
8877
8877
|
if (!this.httpRoutersOptions) throw Error("httpRoutersOptions is required for libp2pJsClient");
|
|
8878
|
-
const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-
|
|
8878
|
+
const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-CkFh5nlx.js");
|
|
8879
8879
|
for (const clientOptions of this.libp2pJsClientsOptions) {
|
|
8880
8880
|
const heliaNode = await createLibp2pJsClientOrUseExistingOne({
|
|
8881
8881
|
...clientOptions,
|
|
@@ -9123,7 +9123,7 @@ var PKC$1 = class extends PKCTypedEmitter {
|
|
|
9123
9123
|
const log = logger_default("pkc-js:pkc:createLocalCommunity");
|
|
9124
9124
|
log.trace("Received community options to create a local community instance:", options);
|
|
9125
9125
|
if (!this._canCreateNewLocalCommunity()) throw new PKCError("ERR_CAN_NOT_CREATE_A_LOCAL_COMMUNITY", { pkcOptions: this._userPKCOptions });
|
|
9126
|
-
const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-
|
|
9126
|
+
const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-B66sHtZ1.js");
|
|
9127
9127
|
const isLocalCommunity = (await listCommunitiesSync(this)).includes(options.address);
|
|
9128
9128
|
const community = new LocalCommunity(this);
|
|
9129
9129
|
if (isLocalCommunity) {
|
package/dist/bundled/chunks/{rpc-local-community-D8woL19t.js → rpc-local-community-uFGcODiy.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
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-
|
|
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-CdHApryH.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";
|
|
@@ -16032,7 +16032,7 @@ function extractNetworkErrorDetails(err, depth = 0) {
|
|
|
16032
16032
|
}
|
|
16033
16033
|
//#endregion
|
|
16034
16034
|
//#region dist/node/generated-version.js
|
|
16035
|
-
const version = "0.0.
|
|
16035
|
+
const version = "0.0.70";
|
|
16036
16036
|
//#endregion
|
|
16037
16037
|
//#region dist/node/version.js
|
|
16038
16038
|
const protocolVersion = ProtocolVersionSchema.parse("1.0.0");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _r as PKCError, et as pubsubTopicToDhtKeyCid } from "./schema-
|
|
1
|
+
import { _r as PKCError, et as pubsubTopicToDhtKeyCid } from "./schema-CdHApryH.js";
|
|
2
2
|
import { ipnsSelector } from "ipns/selector";
|
|
3
3
|
import { equals } from "uint8arrays/equals";
|
|
4
4
|
//#region dist/node/helia/util.js
|
|
@@ -18,6 +18,48 @@ function getHeliaDebugContext(helia) {
|
|
|
18
18
|
}))
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
+
const DIAL_ERROR_NAMES_RETRYABLE_AFTER_ADDR_MERGE = new Set(["DialDeniedError", "NoValidAddressesError"]);
|
|
22
|
+
function isDialRetryableAfterAddrMerge(error) {
|
|
23
|
+
return DIAL_ERROR_NAMES_RETRYABLE_AFTER_ADDR_MERGE.has(error?.name);
|
|
24
|
+
}
|
|
25
|
+
function multiaddrIsCircuitRelay(addr) {
|
|
26
|
+
return addr.getComponents().some((component) => component.name === "p2p-circuit");
|
|
27
|
+
}
|
|
28
|
+
function createAddrMergeRetryScheduler({ helia, runRetry }) {
|
|
29
|
+
const retryablePeers = /* @__PURE__ */ new Map();
|
|
30
|
+
const inFlightOrDone = /* @__PURE__ */ new Set();
|
|
31
|
+
const retryTasks = [];
|
|
32
|
+
let providerStreamEnded = false;
|
|
33
|
+
let listenerRemoved = false;
|
|
34
|
+
const trigger = (peerId) => {
|
|
35
|
+
const key = peerId.toString();
|
|
36
|
+
if (inFlightOrDone.has(key)) return;
|
|
37
|
+
inFlightOrDone.add(key);
|
|
38
|
+
retryTasks.push(runRetry(peerId).then((outcome) => {
|
|
39
|
+
if (outcome === "not-ready") inFlightOrDone.delete(key);
|
|
40
|
+
}, () => void 0));
|
|
41
|
+
};
|
|
42
|
+
const onPeerUpdate = (evt) => {
|
|
43
|
+
const peerId = evt.detail.peer.id;
|
|
44
|
+
if (retryablePeers.has(peerId.toString())) trigger(peerId);
|
|
45
|
+
};
|
|
46
|
+
helia.libp2p.addEventListener("peer:update", onPeerUpdate);
|
|
47
|
+
return {
|
|
48
|
+
markRetryable(peerId) {
|
|
49
|
+
retryablePeers.set(peerId.toString(), peerId);
|
|
50
|
+
if (providerStreamEnded) trigger(peerId);
|
|
51
|
+
},
|
|
52
|
+
onProviderStreamEnded() {
|
|
53
|
+
providerStreamEnded = true;
|
|
54
|
+
for (const peerId of retryablePeers.values()) trigger(peerId);
|
|
55
|
+
if (!listenerRemoved) {
|
|
56
|
+
listenerRemoved = true;
|
|
57
|
+
helia.libp2p.removeEventListener("peer:update", onPeerUpdate);
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
retryTasks
|
|
61
|
+
};
|
|
62
|
+
}
|
|
21
63
|
function waitForTopicSubscriber({ helia, topic, timeoutMs, abortSignal }) {
|
|
22
64
|
const pubsub = helia.libp2p.services.pubsub;
|
|
23
65
|
if (pubsub.getSubscribers(topic).length > 0) return Promise.resolve();
|
|
@@ -118,6 +160,21 @@ async function connectToPubsubPeers({ helia, pubsubTopic, maxPeers, options, log
|
|
|
118
160
|
const findProvidersStart = Date.now();
|
|
119
161
|
const inflightDialPromises = [];
|
|
120
162
|
const dialOptions = { ...options };
|
|
163
|
+
const retryScheduler = createAddrMergeRetryScheduler({
|
|
164
|
+
helia,
|
|
165
|
+
runRetry: async (peerId) => {
|
|
166
|
+
if (options?.signal?.aborted) return "done";
|
|
167
|
+
try {
|
|
168
|
+
const conn = await helia.libp2p.dial(peerId, dialOptions);
|
|
169
|
+
connectedPeersWithContent.push(conn);
|
|
170
|
+
log.trace("Addr-merge retry dial connected to peer", peerId.toString());
|
|
171
|
+
return "done";
|
|
172
|
+
} catch (e) {
|
|
173
|
+
log.trace("Addr-merge retry dial failed for peer", peerId.toString(), "due to error", e);
|
|
174
|
+
return isDialRetryableAfterAddrMerge(e) ? "not-ready" : "done";
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
});
|
|
121
178
|
try {
|
|
122
179
|
for await (const peer of helia.libp2p.contentRouting.findProviders(contentCid, {
|
|
123
180
|
...options,
|
|
@@ -135,6 +192,7 @@ async function connectToPubsubPeers({ helia, pubsubTopic, maxPeers, options, log
|
|
|
135
192
|
}
|
|
136
193
|
} catch (e) {
|
|
137
194
|
const err = e;
|
|
195
|
+
if (isDialRetryableAfterAddrMerge(err)) retryScheduler.markRetryable(peer.id);
|
|
138
196
|
peerDialToError[peer.id.toString()] = {
|
|
139
197
|
multiaddrs: peer.multiaddrs.map(String),
|
|
140
198
|
errorName: err.name,
|
|
@@ -166,6 +224,8 @@ async function connectToPubsubPeers({ helia, pubsubTopic, maxPeers, options, log
|
|
|
166
224
|
throw e;
|
|
167
225
|
}
|
|
168
226
|
}
|
|
227
|
+
retryScheduler.onProviderStreamEnded();
|
|
228
|
+
inflightDialPromises.push(...retryScheduler.retryTasks);
|
|
169
229
|
let graftError = null;
|
|
170
230
|
try {
|
|
171
231
|
await subscriberAppearedPromise;
|
|
@@ -278,6 +338,26 @@ async function directFetchIpnsRecordFromProviders({ helia, pubsubTopic, routingK
|
|
|
278
338
|
resultController.signal
|
|
279
339
|
]) : AbortSignal.any([findProvidersAbort.signal, resultController.signal]);
|
|
280
340
|
const dialFetchTasks = [];
|
|
341
|
+
const retryScheduler = createAddrMergeRetryScheduler({
|
|
342
|
+
helia,
|
|
343
|
+
runRetry: async (peerId) => {
|
|
344
|
+
if (winner || resultController.signal.aborted || options?.signal?.aborted) return "done";
|
|
345
|
+
const directAddrs = ((await helia.libp2p.peerStore.get(peerId).catch(() => void 0))?.addresses ?? []).map(({ multiaddr }) => multiaddr).filter((addr) => !multiaddrIsCircuitRelay(addr));
|
|
346
|
+
if (directAddrs.length === 0 || !await helia.libp2p.isDialable(directAddrs)) return "not-ready";
|
|
347
|
+
try {
|
|
348
|
+
const dialSignal = options?.signal ? AbortSignal.any([options.signal, resultController.signal]) : resultController.signal;
|
|
349
|
+
const dialTargets = directAddrs.map((addr) => {
|
|
350
|
+
const components = addr.getComponents();
|
|
351
|
+
return components[components.length - 1]?.name === "p2p" ? addr : addr.encapsulate(`/p2p/${peerId.toString()}`);
|
|
352
|
+
});
|
|
353
|
+
await helia.libp2p.dial(dialTargets, { signal: dialSignal });
|
|
354
|
+
await tryFetchFromPeer(peerId, "provider");
|
|
355
|
+
} catch (e) {
|
|
356
|
+
recordErr(peerId, e);
|
|
357
|
+
}
|
|
358
|
+
return "done";
|
|
359
|
+
}
|
|
360
|
+
});
|
|
281
361
|
let attempted = 0;
|
|
282
362
|
try {
|
|
283
363
|
for await (const peer of helia.libp2p.contentRouting.findProviders(contentCid, {
|
|
@@ -286,6 +366,12 @@ async function directFetchIpnsRecordFromProviders({ helia, pubsubTopic, routingK
|
|
|
286
366
|
})) {
|
|
287
367
|
if (resultController.signal.aborted) break;
|
|
288
368
|
const announcedAddrs = peer.multiaddrs ?? [];
|
|
369
|
+
if (announcedAddrs.length > 0 && announcedAddrs.every(multiaddrIsCircuitRelay)) {
|
|
370
|
+
await helia.libp2p.peerStore.merge(peer.id, { multiaddrs: announcedAddrs }).catch(() => void 0);
|
|
371
|
+
log.trace("Skipping dial to circuit-only provider", peer.id.toString(), "for topic", pubsubTopic);
|
|
372
|
+
retryScheduler.markRetryable(peer.id);
|
|
373
|
+
continue;
|
|
374
|
+
}
|
|
289
375
|
const hasDialableAddr = announcedAddrs.length > 0 && await helia.libp2p.isDialable(announcedAddrs);
|
|
290
376
|
dialFetchTasks.push((async () => {
|
|
291
377
|
try {
|
|
@@ -294,6 +380,7 @@ async function directFetchIpnsRecordFromProviders({ helia, pubsubTopic, routingK
|
|
|
294
380
|
await helia.libp2p.dial(peer.id, { signal: dialSignal });
|
|
295
381
|
await tryFetchFromPeer(peer.id, "provider");
|
|
296
382
|
} catch (e) {
|
|
383
|
+
if (isDialRetryableAfterAddrMerge(e)) retryScheduler.markRetryable(peer.id);
|
|
297
384
|
recordErr(peer.id, e);
|
|
298
385
|
}
|
|
299
386
|
})());
|
|
@@ -305,7 +392,9 @@ async function directFetchIpnsRecordFromProviders({ helia, pubsubTopic, routingK
|
|
|
305
392
|
} catch (e) {
|
|
306
393
|
if (!findProvidersSignal.aborted) log.trace("findProviders errored during direct IPNS fetch for topic", pubsubTopic, e);
|
|
307
394
|
}
|
|
395
|
+
retryScheduler.onProviderStreamEnded();
|
|
308
396
|
await Promise.allSettled(dialFetchTasks);
|
|
397
|
+
while (retryScheduler.retryTasks.length > 0) await Promise.allSettled(retryScheduler.retryTasks.splice(0));
|
|
309
398
|
})();
|
|
310
399
|
await Promise.allSettled([...subscriberTasks, providerBranch]);
|
|
311
400
|
if (winner) {
|
package/dist/bundled/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as nativeFunctions, i as getShortCid, n as challenges, o as setNativeFunctions, r as getShortAddress, t as PKC } from "./chunks/node-
|
|
1
|
+
import { a as nativeFunctions, i as getShortCid, n as challenges, o as setNativeFunctions, r as getShortAddress, t as PKC } from "./chunks/node-C-uEWzwA.js";
|
|
2
2
|
export { challenges, PKC as default, getShortAddress, getShortCid, nativeFunctions, setNativeFunctions };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { L as hideClassPrivateProps, Qn as n, _r as PKCError, er as t, st as replaceXWithY, xt as findStartedCommunity, yr as logger_default } from "../../chunks/schema-
|
|
2
|
-
import { _ as parseRpcUnsubscribeParam, c as parseRpcCancelExportParam, d as parseRpcCommunityIdentifierParam, f as parseRpcCommunityPageParam, g as parseRpcPublishChallengeAnswersParam, h as parseRpcExportCommunityParam, l as parseRpcCidParam, m as parseRpcExportCommunityModLogsParam, p as parseRpcEditCommunityParam, s as parseRpcAuthorNameParam, t as PKC, u as parseRpcCommentRepliesPageParam } from "../../chunks/node-
|
|
3
|
-
import { En as parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, J as buildPagesRuntimeFields, Qt as parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, Tn as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, Zt as parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, an as parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, er as stringify, it as pLimit, mn as parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails, on as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, ot as require_lib, pn as parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails, q as buildPageRuntimeFields, qn as t$1, rt as pRetry, tn as parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, vn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails } from "../../chunks/rpc-local-community-
|
|
4
|
-
import { t as LocalCommunity } from "../../chunks/local-community-
|
|
1
|
+
import { L as hideClassPrivateProps, Qn as n, _r as PKCError, er as t, st as replaceXWithY, xt as findStartedCommunity, yr as logger_default } from "../../chunks/schema-CdHApryH.js";
|
|
2
|
+
import { _ as parseRpcUnsubscribeParam, c as parseRpcCancelExportParam, d as parseRpcCommunityIdentifierParam, f as parseRpcCommunityPageParam, g as parseRpcPublishChallengeAnswersParam, h as parseRpcExportCommunityParam, l as parseRpcCidParam, m as parseRpcExportCommunityModLogsParam, p as parseRpcEditCommunityParam, s as parseRpcAuthorNameParam, t as PKC, u as parseRpcCommentRepliesPageParam } from "../../chunks/node-C-uEWzwA.js";
|
|
3
|
+
import { En as parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, J as buildPagesRuntimeFields, Qt as parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, Tn as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, Zt as parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, an as parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, er as stringify, it as pLimit, mn as parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails, on as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, ot as require_lib, pn as parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails, q as buildPageRuntimeFields, qn as t$1, rt as pRetry, tn as parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, vn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails } from "../../chunks/rpc-local-community-uFGcODiy.js";
|
|
4
|
+
import { t as LocalCommunity } from "../../chunks/local-community-DF2_ny4_.js";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import path from "path";
|
|
7
7
|
import assert from "assert";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.70";
|