@pkcprotocol/pkc-js 0.0.122 → 0.0.124
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/domain-util.d.ts +1 -0
- package/dist/browser/domain-util.js +10 -0
- package/dist/browser/domain-util.js.map +1 -1
- package/dist/browser/errors.d.ts +1 -0
- package/dist/browser/errors.js +1 -0
- package/dist/browser/errors.js.map +1 -1
- package/dist/browser/generated-version.d.ts +1 -1
- package/dist/browser/generated-version.js +1 -1
- package/dist/browser/pkc/pkc.js +6 -1
- package/dist/browser/pkc/pkc.js.map +1 -1
- package/dist/browser/pkc-error.d.ts +1 -1
- package/dist/browser/runtime/node/community/local-community/author-identity.js +3 -3
- package/dist/browser/runtime/node/community/local-community/author-identity.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community/publication-validation.js +7 -1
- package/dist/browser/runtime/node/community/local-community/publication-validation.js.map +1 -1
- package/dist/browser/util.d.ts +1 -1
- package/dist/browser/util.js +3 -9
- package/dist/browser/util.js.map +1 -1
- package/dist/bundled/bundle-manifest.json +46 -46
- package/dist/bundled/challenges.js +1 -1
- package/dist/bundled/chunks/{helia-for-pkc-C4NrkWFn.js → helia-for-pkc-DfpR6JSl.js} +2 -2
- package/dist/bundled/chunks/{local-community-ClSrTOTk.js → local-community-CQ9M4cEY.js} +1 -1
- package/dist/bundled/chunks/{local-community-D5JSkLvs.js → local-community-Ll4pUOKV.js} +7 -3
- package/dist/bundled/chunks/{node-DLPRXL6D.js → node-BWOsSCO-.js} +9 -6
- package/dist/bundled/chunks/{page-sort-scoring-4GJmCEUj.js → page-sort-scoring-Y3zgv-l4.js} +1 -1
- package/dist/bundled/chunks/{rpc-local-community-CVeimTAf.js → rpc-local-community-D8wgBsuD.js} +4 -4
- package/dist/bundled/chunks/{util-kh4j7FiT.js → util-Bd4vp_w6.js} +9 -7
- package/dist/bundled/chunks/{util-Cs71YyiF.js → util-IESnqTnj.js} +1 -1
- package/dist/bundled/chunks/{validate-package-factories-DDJZyObD.js → validate-package-factories-D527vDd_.js} +2 -2
- package/dist/bundled/index.js +1 -1
- package/dist/bundled/page-sorts.js +1 -1
- package/dist/bundled/rpc/src/index.js +4 -4
- package/dist/node/domain-util.d.ts +1 -0
- package/dist/node/domain-util.js +10 -0
- package/dist/node/domain-util.js.map +1 -1
- package/dist/node/errors.d.ts +1 -0
- package/dist/node/errors.js +1 -0
- package/dist/node/errors.js.map +1 -1
- package/dist/node/generated-version.d.ts +1 -1
- package/dist/node/generated-version.js +1 -1
- package/dist/node/pkc/pkc.js +6 -1
- package/dist/node/pkc/pkc.js.map +1 -1
- package/dist/node/pkc-error.d.ts +1 -1
- package/dist/node/runtime/node/community/local-community/author-identity.js +3 -3
- package/dist/node/runtime/node/community/local-community/author-identity.js.map +1 -1
- package/dist/node/runtime/node/community/local-community/publication-validation.js +7 -1
- package/dist/node/runtime/node/community/local-community/publication-validation.js.map +1 -1
- package/dist/node/util.d.ts +1 -1
- package/dist/node/util.js +3 -9
- package/dist/node/util.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
|
|
2
|
-
import { $
|
|
3
|
-
import { $n as backupCommunityDb, An as verifyCommunity, Cn as verifyChallengeRequest, Cr as n$4, Dn as verifyCommentModeration, En as verifyCommentIpfs, Er as stringify, Gn as decode, Hn as getCommunityNameFromWire, In as getAuthorNameFromWire, Jn as getIpfsKeyFromPrivateKey, Kn as encode, Mn as verifyVote, Mr as require_lodash_merge, Nn as buildRuntimeAuthor, On as verifyCommentPubsubMessage, Pn as cleanWireAuthor, Q as createSchemaRowParser, Qn as BackupAbortError, Rn as crosspostChainDepthUpTo, S as KeyvBetterSqlite3, Sr as n$5, St as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, Tn as verifyCommentEdit, Tr as t$9, Tt as parseJsonWithPKCErrorIfFails, U as pLimit, Un as getCommunityPublicKeyFromWire, X as coerceSchemaRowJson, Xn as getPKCAddressFromPublicKeySync, Y as coerceSchemaRowBoolean, Yn as getPKCAddressFromPublicKey, Z as collectSchemaRowCoercions, Zn as getPublicKeyFromPrivateKey, _ as createAuthorIdentityMatcher, _n as signCommentUpdateForChallengeVerification, a as generatePagesReportingFailedSorts, ar as deriveDbPosts, br as r$2, c as resolvePageSortsOrThrow, cn as cleanUpBeforePublishing, d as getChallengeVerification, en as SignerWithPublicKeyAddress, er as calculateExpectedSignatureSize, f as getCommunityChallengeFromCommunityChallengeSettings, fn as signChallengeVerification, ft as parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails, g as authorNameResolveFailureReason, gn as signCommentUpdate, h as authorIdentityMatcherForRequest, hr as resolveDbPostsCidRefs, i as derivePublicPageSorts, in as decryptEd25519AesGcmPublicKeyBuffer, ir as deriveCommentIpfsFromCommentTableRow, j as iterateOverPageCidsToFindAllCids, jn as verifyCommunityEdit, jr as STORAGE_KEYS, kn as verifyCommentUpdate, lr as getThumbnailPropsOfLink, m as pkcJsChallenges, mn as signCommentEdit, mr as refreshCommunitiesList, o as loadPageSortsForStartedCommunity, on as encryptEd25519AesGcmPublicKeyBuffer, or as deriveDbReplies, p as loadChallengeFileFromCommunityChallengeSettings, pn as signComment, pr as moveCommunityDbToDeletedDirectory, r as computePageSortsFingerprint, rr as deleteOldCommunityInWindows, s as lookupPageSortFactories, sn as _validateSignatureOfPKCRecord, sr as getDefaultCommunityDbConfig, t as RpcLocalCommunity, tr as calculateInlineRepliesBudget, u as deriveCommunityChallengesOrThrow, un as signChallengeMessage, ur as importSignerIntoKuboNode, ut as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, v as TrackedInstanceRegistry, vn as signCommunity, vr as t$10, w as TIMEFRAMES_TO_SECONDS, x as MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS, xn as verifyChallengeAnswer, xr as t$8, y as LRUCache, yr as t$11, zn as effectiveMaxCrosspostDepth } from "./rpc-local-community-
|
|
4
|
-
import { a as scorePageCommentsWithFile, i as partitionPageCommentsForSort, n as filterRepliesForPageSort, o as stripRepliesFromPageComment, r as orderPageCommentsByScore, t as createDescendantsLookup } from "./page-sort-scoring-
|
|
2
|
+
import { $n as CommentEditsTableRowSchema, $t as CommentModerationPubsubMessagePublicationSchema, A as isLinkOfAnimatedImage, At as ChallengeMessageSchema, Cr as t$2, Dt as pTimeout, En as VotePubsubReservedFields, F as isLinkValid, Hn as CommentsTableRowSchema, Jt as CommunityEditPublicationPubsubReservedFields, K as removeNullUndefinedValues, Kr as ZodError, Kt as version_default, Lt as DecryptedChallengeRequestPublicationSchema, M as isLinkOfImage, Mn as CommentPubsubMessageReservedFields, Mr as messages, Mt as ChallengeRequestMessageSchema, N as isLinkOfMedia, Nr as logger_default, On as VoteTablesRowSchema, Ot as ChallengeAnswerMessageSchema, P as isLinkOfVideo, Pt as ChallengeVerificationMessageSchema, Q as retryKuboIpfsAddAndProvide, R as pubsubTopicToDhtKey, Rt as DecryptedChallengeRequestSchema, S as hideClassPrivateProps, Sn as isStringDomain, Sr as t$4, St as untrackStartedCommunity, Tn as VotePubsubMessagePublicationSchema, Tr as require_retry, Tt as require_sha256, U as removeBlocksFromKuboNode, Vn as CommentUpdateTableRowSchema, W as removeMfsFilesSafely, X as retryKuboBlockPutPinAndProvidePubsubTopic, Xn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, Yn as CommentEditPubsubMessagePublicationSchema, Zn as CommentEditReservedFields, _ as getEquivalentCommunityAddresses, a as calculateUnixFsDagSizeCidV0, c as contentContainsMarkdownVideos, ct as writeKuboFilesWithTimeout, d as derivePublicationFromChallengeRequest, dn as CommunityIpfsSchema, dr as t$7, en as CommentModerationReservedFields, f as doesDomainAddressHaveCapitalLetter, fn as CommunitySignedPropertyNames, fr as n$2, ft as findUpdatingCommunity, g as genToArray, gr as e, h as findMalformedUnicodeString, hr as e$1, i as calculateStringSizeSameAsIpfsAddCidV0, it as timestamp, j as isLinkOfAudio, jn as CommentIpfsSchema, jr as PKCError, lt as findCommunityInRegistry, mr as t$6, nn as CommentModerationsTableRowSchema, nt as statMfsPathSafely, o as contentContainsMarkdownAudio, ot as withSortedKeys, pr as t$5, r as calculateIpfsCidV0, rr as AuthorReservedFields, s as contentContainsMarkdownImages, st as withSortedKeysDeep, t as areEquivalentCommunityAddresses, tt as sleepUntilTimeoutOrAbort, ur as n$3, ut as findStartedCommunity, v as getErrorCodeFromMessage, vr as r$1, vt as syncCommunityRegistryEntry, w as ipnsNameToIpnsOverPubsubTopic, wt as untrackUpdatingCommunity, xt as trackUpdatingCommunity, y as getIpnsRecordInLocalKuboNode, yr as t$3, yt as trackStartedCommunity, zn as CommentUpdateSchema } from "./util-Bd4vp_w6.js";
|
|
3
|
+
import { $n as backupCommunityDb, An as verifyCommunity, Cn as verifyChallengeRequest, Cr as n$4, Dn as verifyCommentModeration, En as verifyCommentIpfs, Er as stringify, Gn as decode, Hn as getCommunityNameFromWire, In as getAuthorNameFromWire, Jn as getIpfsKeyFromPrivateKey, Kn as encode, Mn as verifyVote, Mr as require_lodash_merge, Nn as buildRuntimeAuthor, On as verifyCommentPubsubMessage, Pn as cleanWireAuthor, Q as createSchemaRowParser, Qn as BackupAbortError, Rn as crosspostChainDepthUpTo, S as KeyvBetterSqlite3, Sr as n$5, St as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, Tn as verifyCommentEdit, Tr as t$9, Tt as parseJsonWithPKCErrorIfFails, U as pLimit, Un as getCommunityPublicKeyFromWire, X as coerceSchemaRowJson, Xn as getPKCAddressFromPublicKeySync, Y as coerceSchemaRowBoolean, Yn as getPKCAddressFromPublicKey, Z as collectSchemaRowCoercions, Zn as getPublicKeyFromPrivateKey, _ as createAuthorIdentityMatcher, _n as signCommentUpdateForChallengeVerification, a as generatePagesReportingFailedSorts, ar as deriveDbPosts, br as r$2, c as resolvePageSortsOrThrow, cn as cleanUpBeforePublishing, d as getChallengeVerification, en as SignerWithPublicKeyAddress, er as calculateExpectedSignatureSize, f as getCommunityChallengeFromCommunityChallengeSettings, fn as signChallengeVerification, ft as parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails, g as authorNameResolveFailureReason, gn as signCommentUpdate, h as authorIdentityMatcherForRequest, hr as resolveDbPostsCidRefs, i as derivePublicPageSorts, in as decryptEd25519AesGcmPublicKeyBuffer, ir as deriveCommentIpfsFromCommentTableRow, j as iterateOverPageCidsToFindAllCids, jn as verifyCommunityEdit, jr as STORAGE_KEYS, kn as verifyCommentUpdate, lr as getThumbnailPropsOfLink, m as pkcJsChallenges, mn as signCommentEdit, mr as refreshCommunitiesList, o as loadPageSortsForStartedCommunity, on as encryptEd25519AesGcmPublicKeyBuffer, or as deriveDbReplies, p as loadChallengeFileFromCommunityChallengeSettings, pn as signComment, pr as moveCommunityDbToDeletedDirectory, r as computePageSortsFingerprint, rr as deleteOldCommunityInWindows, s as lookupPageSortFactories, sn as _validateSignatureOfPKCRecord, sr as getDefaultCommunityDbConfig, t as RpcLocalCommunity, tr as calculateInlineRepliesBudget, u as deriveCommunityChallengesOrThrow, un as signChallengeMessage, ur as importSignerIntoKuboNode, ut as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, v as TrackedInstanceRegistry, vn as signCommunity, vr as t$10, w as TIMEFRAMES_TO_SECONDS, x as MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS, xn as verifyChallengeAnswer, xr as t$8, y as LRUCache, yr as t$11, zn as effectiveMaxCrosspostDepth } from "./rpc-local-community-D8wgBsuD.js";
|
|
4
|
+
import { a as scorePageCommentsWithFile, i as partitionPageCommentsForSort, n as filterRepliesForPageSort, o as stripRepliesFromPageComment, r as orderPageCommentsByScore, t as createDescendantsLookup } from "./page-sort-scoring-Y3zgv-l4.js";
|
|
5
5
|
import { randomFillSync, randomUUID } from "node:crypto";
|
|
6
6
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
7
7
|
import path from "node:path";
|
|
@@ -6557,6 +6557,10 @@ async function checkAuthorIdentity(community, publication, log) {
|
|
|
6557
6557
|
log("Rejecting publication: author.name is not a domain", authorName);
|
|
6558
6558
|
return messages.ERR_AUTHOR_NAME_MUST_BE_A_DOMAIN;
|
|
6559
6559
|
}
|
|
6560
|
+
if (authorName && doesDomainAddressHaveCapitalLetter(authorName)) {
|
|
6561
|
+
log("Rejecting publication: author.name has an uppercase letter", authorName);
|
|
6562
|
+
return messages.ERR_AUTHOR_NAME_HAS_CAPITAL_LETTER;
|
|
6563
|
+
}
|
|
6560
6564
|
if (authorName && isStringDomain(authorName) && community._pkc.resolveAuthorNames) {
|
|
6561
6565
|
let resolvedAddress;
|
|
6562
6566
|
try {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
|
|
2
|
-
import { $ as shortifyAddress,
|
|
3
|
-
import { $ as parseCidStringSchemaWithPKCErrorIfItFails, $t as require_lib$1, A as findCommentInParsedPages, Ar as NAME_RESOLVE_FAILED_RETRY_FLOOR_MS, B as InflightFetchManager, Bn as buildRuntimeCommunityFields, Bt as RpcExportCommunityModLogsParamSchema, C as RepliesPages, Ct as parseDecryptedChallengeVerification, D as extractCommunityRuntimeFieldsFromParsedPages, Dn as verifyCommentModeration, Dr as MAX_FILE_SIZE_BYTES_FOR_COMMENT_UPDATE, Dt as parseRpcCommentEventWithPKCErrorIfItFails, En as verifyCommentIpfs, Et as parsePKCUserOptionsSchemaWithPKCErrorIfItFails, F as collectCrosspostAuthorsToResolve, Fn as getAuthorNameFromRuntime, Ft as RpcCidParamSchema, G as decodeRpcChallengeAnswerPubsubMsg, Gn as decode, Gt as RpcFetchCidResultSchema, Hn as getCommunityNameFromWire, Ht as RpcExportCommunityParamSchema, It as RpcCommentRepliesPageParamSchema, J as decodeRpcChallengeVerificationPubsubMsg, Jt as RpcPublishedAnchorRecordResultSchema, K as decodeRpcChallengePubsubMsg, Kt as RpcPublishAnchorRecordParamSchema, L as stripNameResolvedFromCrosspost, Ln as normalizeCreatePublicationAuthor, Lt as RpcCommunityIdentifierParamSchema, M as parseRawPages, Mn as verifyVote, Mt as RpcAnchorPublishPreparationResultSchema, N as applyNameResolvedCacheToCrosspost, Nn as buildRuntimeAuthor, Nr as nativeFunctions$2, Nt as RpcAuthorNameParamSchema, O as findCommentInPageInstance, On as verifyCommentPubsubMessage, Or as NAME_RESOLVED_FALSE_TTL_MS, Ot as parseRpcCommentUpdateEventWithPKCErrorIfItFails, P as cloneCrosspostForRuntime, Pn as cleanWireAuthor, Pr as require_undici, Pt as RpcCancelExportParamSchema, Qt as RpcUnsubscribeParamSchema, R as PKCClientsManager, Rt as RpcCommunityPageParamSchema, S as KeyvBetterSqlite3, Sn as verifyChallengeMessage, Sr as n$3, St as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, Tn as verifyCommentEdit, Tr as t$4, Tt as parseJsonWithPKCErrorIfFails, Un as getCommunityPublicKeyFromWire, Ut as RpcExportCommunityResultSchema, V as InflightResourceTypes, Vn as getCommunityAddressFromRecord, Vt as RpcExportCommunityModLogsResultSchema, W as PKCTypedEmitter, Wn as normalizeCommunityInputFromCommunity, Wt as RpcFetchCidParamSchema, Xn as getPKCAddressFromPublicKeySync, Xt as RpcSubscriptionIdResultSchema, Yt as RpcResolveAuthorNameResultSchema, Zt as RpcSuccessResultSchema, _r as tryToDeleteCommunitiesThatFailedToBeDeletedBefore, an as encryptEd25519AesGcm, at as parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails, b as RemoteCommunity, bn as signVote, bt as parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, cn as cleanUpBeforePublishing, cr as getDefaultDataPath, ct as parseCommunityAddressWithPKCErrorIfItFails, dn as signChallengeRequest, dr as listCommunitiesSync, dt as parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, fr as monitorCommunitiesDirectory, gr as setNativeFunctions$1, gt as parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails, hn as signCommentModeration, ht as parseCreateCommentOptionsSchemaWithPKCErrorIfItFails, jn as verifyCommunityEdit, jt as parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails, k as findCommentInPageInstanceRecursively, kn as verifyCommentUpdate, kr as NAME_RESOLVED_TRUE_TTL_MS, kt as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, l as pkcJsPageSorts, ln as signChallengeAnswer, m as pkcJsChallenges, mn as signCommentEdit, mt as parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails, n as RpcRemoteCommunity, nn as createAnchorIpnsRecord$1, nr as createKuboRpcClient, nt as parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, ot as parseCommentPubsubMessagePublicationWithPKCErrorIfItFails, pn as signComment, pt as parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails, q as decodeRpcChallengeRequestPubsubMsg, qn as getBufferedPKCAddressFromPublicKey, qt as RpcPublishChallengeAnswersParamSchema, rn as decryptEd25519AesGcm, rt as parseCommentIpfsSchemaWithPKCErrorIfItFails, st as parseCommentUpdateSchemaWithPKCErrorIfItFails, t as RpcLocalCommunity, tn as createSigner, v as TrackedInstanceRegistry, vr as t$5, wn as verifyChallengeVerification, wr as t$2, wt as parseDecryptedChallengeWithPKCErrorIfItFails, xr as t$3, xt as parseCreateVoteOptionsSchemaWithPKCErrorIfItFails, y as LRUCache, yn as signCommunityEdit, yt as parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, z as GenericStateClient, zt as RpcEditCommunityParamSchema } from "./rpc-local-community-
|
|
4
|
-
import { s as getHeliaDebugContext } from "./util-
|
|
2
|
+
import { $ as shortifyAddress, At as ChallengeMessageSchema, Ct as untrackUpdatingComment, Dr as FailedToFetchCommentUpdateFromGatewaysError, Dt as pTimeout, E as isIpfsCid, Er as FailedToFetchCommentIpfsFromGatewaysError, Et as TimeoutError, H as rejectWhenCommunityStopsOrAborts, In as CommentUpdateForChallengeVerificationSchema, Ir as setErrorMap, J as replaceXWithY, Jr as parsedType, Kt as version_default, Mr as messages, Mt as ChallengeRequestMessageSchema, Nr as logger_default, O as isIpns, Ot as ChallengeAnswerMessageSchema, Pt as ChallengeVerificationMessageSchema, S as hideClassPrivateProps, Sn as isStringDomain, T as isAbortError, Tr as require_retry, Tt as require_sha256, V as rejectWhenAbortSignalFires, Y as resolveWhenPredicateIsTrue, Yr as stringifyPrimitive, Z as retryKuboIpfsAdd, at as waitForUpdateInCommunityInstanceWithErrorAndTimeout, b as getPostUpdateTimestampRange, bt as trackUpdatingComment, dn as CommunityIpfsSchema, dt as findUpdatingComment, et as shortifyCid, f as doesDomainAddressHaveCapitalLetter, fr as n$1, ft as findUpdatingCommunity, gr as e$1, gt as refreshTrackedCommentAliases, hr as e, ht as listUpdatingCommunities, it as timestamp, jn as CommentIpfsSchema, jr as PKCError, l as createAbortError, mr as t$1, mt as listUpdatingComments, on as CommunityAnchorSchema, pt as listStartedCommunities, q as removeUndefinedValuesRecursively, qr as joinValues, rt as throwIfAbortSignalAborted, t as areEquivalentCommunityAddresses, tt as sleepUntilTimeoutOrAbort, u as deepMergeRuntimeFields, ur as n$2, ut as findStartedCommunity, vr as r, w as ipnsNameToIpnsOverPubsubTopic, wt as untrackUpdatingCommunity, yn as PubsubTopicSchema, zn as CommentUpdateSchema } from "./util-Bd4vp_w6.js";
|
|
3
|
+
import { $ as parseCidStringSchemaWithPKCErrorIfItFails, $t as require_lib$1, A as findCommentInParsedPages, Ar as NAME_RESOLVE_FAILED_RETRY_FLOOR_MS, B as InflightFetchManager, Bn as buildRuntimeCommunityFields, Bt as RpcExportCommunityModLogsParamSchema, C as RepliesPages, Ct as parseDecryptedChallengeVerification, D as extractCommunityRuntimeFieldsFromParsedPages, Dn as verifyCommentModeration, Dr as MAX_FILE_SIZE_BYTES_FOR_COMMENT_UPDATE, Dt as parseRpcCommentEventWithPKCErrorIfItFails, En as verifyCommentIpfs, Et as parsePKCUserOptionsSchemaWithPKCErrorIfItFails, F as collectCrosspostAuthorsToResolve, Fn as getAuthorNameFromRuntime, Ft as RpcCidParamSchema, G as decodeRpcChallengeAnswerPubsubMsg, Gn as decode, Gt as RpcFetchCidResultSchema, Hn as getCommunityNameFromWire, Ht as RpcExportCommunityParamSchema, In as getAuthorNameFromWire, It as RpcCommentRepliesPageParamSchema, J as decodeRpcChallengeVerificationPubsubMsg, Jt as RpcPublishedAnchorRecordResultSchema, K as decodeRpcChallengePubsubMsg, Kt as RpcPublishAnchorRecordParamSchema, L as stripNameResolvedFromCrosspost, Ln as normalizeCreatePublicationAuthor, Lt as RpcCommunityIdentifierParamSchema, M as parseRawPages, Mn as verifyVote, Mt as RpcAnchorPublishPreparationResultSchema, N as applyNameResolvedCacheToCrosspost, Nn as buildRuntimeAuthor, Nr as nativeFunctions$2, Nt as RpcAuthorNameParamSchema, O as findCommentInPageInstance, On as verifyCommentPubsubMessage, Or as NAME_RESOLVED_FALSE_TTL_MS, Ot as parseRpcCommentUpdateEventWithPKCErrorIfItFails, P as cloneCrosspostForRuntime, Pn as cleanWireAuthor, Pr as require_undici, Pt as RpcCancelExportParamSchema, Qt as RpcUnsubscribeParamSchema, R as PKCClientsManager, Rt as RpcCommunityPageParamSchema, S as KeyvBetterSqlite3, Sn as verifyChallengeMessage, Sr as n$3, St as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, Tn as verifyCommentEdit, Tr as t$4, Tt as parseJsonWithPKCErrorIfFails, Un as getCommunityPublicKeyFromWire, Ut as RpcExportCommunityResultSchema, V as InflightResourceTypes, Vn as getCommunityAddressFromRecord, Vt as RpcExportCommunityModLogsResultSchema, W as PKCTypedEmitter, Wn as normalizeCommunityInputFromCommunity, Wt as RpcFetchCidParamSchema, Xn as getPKCAddressFromPublicKeySync, Xt as RpcSubscriptionIdResultSchema, Yt as RpcResolveAuthorNameResultSchema, Zt as RpcSuccessResultSchema, _r as tryToDeleteCommunitiesThatFailedToBeDeletedBefore, an as encryptEd25519AesGcm, at as parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails, b as RemoteCommunity, bn as signVote, bt as parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, cn as cleanUpBeforePublishing, cr as getDefaultDataPath, ct as parseCommunityAddressWithPKCErrorIfItFails, dn as signChallengeRequest, dr as listCommunitiesSync, dt as parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, fr as monitorCommunitiesDirectory, gr as setNativeFunctions$1, gt as parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails, hn as signCommentModeration, ht as parseCreateCommentOptionsSchemaWithPKCErrorIfItFails, jn as verifyCommunityEdit, jt as parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails, k as findCommentInPageInstanceRecursively, kn as verifyCommentUpdate, kr as NAME_RESOLVED_TRUE_TTL_MS, kt as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, l as pkcJsPageSorts, ln as signChallengeAnswer, m as pkcJsChallenges, mn as signCommentEdit, mt as parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails, n as RpcRemoteCommunity, nn as createAnchorIpnsRecord$1, nr as createKuboRpcClient, nt as parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, ot as parseCommentPubsubMessagePublicationWithPKCErrorIfItFails, pn as signComment, pt as parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails, q as decodeRpcChallengeRequestPubsubMsg, qn as getBufferedPKCAddressFromPublicKey, qt as RpcPublishChallengeAnswersParamSchema, rn as decryptEd25519AesGcm, rt as parseCommentIpfsSchemaWithPKCErrorIfItFails, st as parseCommentUpdateSchemaWithPKCErrorIfItFails, t as RpcLocalCommunity, tn as createSigner, v as TrackedInstanceRegistry, vr as t$5, wn as verifyChallengeVerification, wr as t$2, wt as parseDecryptedChallengeWithPKCErrorIfItFails, xr as t$3, xt as parseCreateVoteOptionsSchemaWithPKCErrorIfItFails, y as LRUCache, yn as signCommunityEdit, yt as parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, z as GenericStateClient, zt as RpcEditCommunityParamSchema } from "./rpc-local-community-D8wgBsuD.js";
|
|
4
|
+
import { s as getHeliaDebugContext } from "./util-IESnqTnj.js";
|
|
5
5
|
import path from "path";
|
|
6
6
|
import assert from "assert";
|
|
7
7
|
import fs from "fs";
|
|
@@ -8386,7 +8386,7 @@ var PKC$1 = class extends PKCTypedEmitter {
|
|
|
8386
8386
|
this.clients.libp2pJsClients = {};
|
|
8387
8387
|
if (!this.libp2pJsClientsOptions) return;
|
|
8388
8388
|
if (!this.httpRoutersOptions) throw Error("httpRoutersOptions is required for libp2pJsClient");
|
|
8389
|
-
const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-
|
|
8389
|
+
const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-DfpR6JSl.js");
|
|
8390
8390
|
for (const clientOptions of this.libp2pJsClientsOptions) {
|
|
8391
8391
|
const heliaNode = await createLibp2pJsClientOrUseExistingOne({
|
|
8392
8392
|
...clientOptions,
|
|
@@ -8509,7 +8509,10 @@ var PKC$1 = class extends PKCTypedEmitter {
|
|
|
8509
8509
|
async _initMissingFieldsOfPublicationBeforeSigning(pubOptions, log) {
|
|
8510
8510
|
const finalOptions = t$4(pubOptions);
|
|
8511
8511
|
if (!finalOptions.signer) throw Error("User did not provide a signer to create a local publication");
|
|
8512
|
-
|
|
8512
|
+
const normalizedAuthor = normalizeCreatePublicationAuthor(finalOptions.author);
|
|
8513
|
+
const authorName = getAuthorNameFromWire(normalizedAuthor);
|
|
8514
|
+
if (authorName && doesDomainAddressHaveCapitalLetter(authorName)) throw new PKCError("ERR_AUTHOR_NAME_HAS_CAPITAL_LETTER", { authorName });
|
|
8515
|
+
let cleanedAuthor = cleanWireAuthor(normalizedAuthor);
|
|
8513
8516
|
if (cleanedAuthor) {
|
|
8514
8517
|
for (const key of Object.keys(cleanedAuthor)) {
|
|
8515
8518
|
const val = cleanedAuthor[key];
|
|
@@ -8665,7 +8668,7 @@ var PKC$1 = class extends PKCTypedEmitter {
|
|
|
8665
8668
|
const log = logger_default("pkc-js:pkc:createLocalCommunity");
|
|
8666
8669
|
log.trace("Received community options to create a local community instance:", options);
|
|
8667
8670
|
if (!this._canCreateNewLocalCommunity()) throw new PKCError("ERR_CAN_NOT_CREATE_A_LOCAL_COMMUNITY", { pkcOptions: this._userPKCOptions });
|
|
8668
|
-
const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-
|
|
8671
|
+
const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-CQ9M4cEY.js");
|
|
8669
8672
|
const isLocalCommunity = (await listCommunitiesSync(this)).includes(options.address);
|
|
8670
8673
|
const community = new LocalCommunity(this);
|
|
8671
8674
|
if (isLocalCommunity) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Sn as isStringDomain, _ as getEquivalentCommunityAddresses, vn as PageSortFileSchema } from "./util-Bd4vp_w6.js";
|
|
2
2
|
//#region dist/node/pages/page-sort-scoring.js
|
|
3
3
|
function validatePageSortFile(rawFile) {
|
|
4
4
|
const validated = PageSortFileSchema.parse(rawFile);
|
package/dist/bundled/chunks/{rpc-local-community-CVeimTAf.js → rpc-local-community-D8wgBsuD.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as __toESM, n as __exportAll, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
|
|
2
|
-
import { $ as shortifyAddress, $
|
|
2
|
+
import { $ as shortifyAddress, $t as CommentModerationPubsubMessagePublicationSchema, An as CommentIpfsReservedFields, Ar as FailedToFetchPageIpfsFromGatewaysError, B as raceAgainstAbort, Bn as CommentUpdateSignedPropertyNames, Br as custom, Bt as DecryptedChallengeVerificationSchema, C as interruptibleSleep, Cn as CreateVoteUserOptionsWithRefinementSchema, Cr as t$9, D as isIpfsPath, Dn as VoteSignedPropertyNames, Dr as FailedToFetchCommentUpdateFromGatewaysError, Dt as pTimeout, E as isIpfsCid, Er as FailedToFetchCommentIpfsFromGatewaysError, Fn as CommentUpdateChallengeReservedFieldNames, Fr as require_ms$1, Ft as ChallengeVerificationMessageSignedPropertyNames, G as removeNullUndefinedEmptyObjectsValuesRecursively, Gn as ModQueuePageIpfsSchema, Gr as string, Gt as PKCUserOptionsSchema, Hr as number, Ht as NameResolverSerializedSchema, I as isRequestPubsubPublicationOfPost, It as DecryptedChallengeAnswerSchema, Jn as CommentEditChallengeRequestToEncryptSchema, Kn as PageIpfsSchema, L as isRequestPubsubPublicationOfReply, Ln as CommentUpdateForChallengeVerificationSignedPropertyNames, Lr as _enum, Mr as messages, Nn as CommentPubsubMessageWithFlexibleAuthorRefinementSchema, Nr as logger_default, Nt as ChallengeRequestMessageSignedPropertyNames, O as isIpns, Or as FailedToFetchCommunityFromGatewaysError, Pn as CommentSignedPropertyNames, Pr as require_supports_color, Qn as CommentEditSignedPropertyNames, Qt as CommentModerationChallengeRequestToEncryptSchema, R as pubsubTopicToDhtKey, Rn as CommentUpdateReservedFields, Rr as array, S as hideClassPrivateProps, Sn as isStringDomain, Sr as t$10, St as untrackStartedCommunity, T as isAbortError, Tn as VotePubsubMessagePublicationSchema, Tr as require_retry$1, Tt as require_sha256$1, Un as CreateCommentOptionsWithRefinementSchema, Ur as object, Ut as PKCParsedOptionsSchema, Vr as literal, Vt as NameResolveCacheOptionsSchema, Wn as GetPageParamSchema, Wr as record, Wt as PKCUserOptionBaseSchema, Xn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, Xt as CommunityEditPubsubMessagePublicationSchema, Yt as CommunityEditPublicationSignedPropertyNames, Zt as CreateCommunityEditPublicationOptionsWithRefinementSchema, _n as PageSortFileFactorySchema, _r as t$11, _t as refreshTrackedCommunityAliases, an as ChallengeFileSchema, ar as CidPathSchema, bn as RpcRemoteCommunityUpdateEventResultSchema, br as n$8, cn as CommunityEditOptionsSchema, cr as CommunityAuthorChallengeReservedFieldNames, d as derivePublicationFromChallengeRequest, dn as CommunityIpfsSchema, er as CreateCommentEditOptionsWithRefinementSchema, et as shortifyCid, f as doesDomainAddressHaveCapitalLetter, fn as CommunitySignedPropertyNames, fr as n$10, ft as findUpdatingCommunity, gn as ExportCommunityModLogsOptionsSchema, gr as e$5, hn as CreateRpcCommunityFunctionArgumentSchema, hr as e$6, in as ChallengeFileFactorySchema, ir as ChallengeAnswersSchema, it as timestamp, jn as CommentIpfsSchema, jr as PKCError, jt as ChallengeMessageSignedPropertyNames, k as isIpnsPath, kn as CommentChallengeRequestToEncryptSchema, kr as FailedToFetchGenericIpfsFromGatewaysError, kt as ChallengeAnswerMessageSignedPropertyNames, l as createAbortError, ln as CommunityExportRecordsSchema, lr as CreateSignerSchema, m as fetchAndValidateIpnsRecordFromGateway, mn as CreateRemoteCommunityFunctionArgumentSchema, mr as t$13, nn as CommentModerationsTableRowSchema, nr as AuthorCommentIpfsReservedFields, or as CidStringSchema, p as extractNetworkErrorDetails, pn as CreateNewLocalCommunityUserOptionsSchema, qn as isReservedObjectKey, qt as CommunityEditPublicationChallengeRequestToEncryptSchema, r as calculateIpfsCidV0, rn as CreateCommentModerationOptionsWithRefinementSchema, rt as throwIfAbortSignalAborted, sn as CommunityChallengeSettingSchema, sr as CommunityAddressSchema, t as areEquivalentCommunityAddresses, tn as CommentModerationSignedPropertyNames, tr as AuthorAddressSchema, tt as sleepUntilTimeoutOrAbort, u as deepMergeRuntimeFields, un as CommunityIpfsReservedFields, ur as n$9, ut as findStartedCommunity, vn as PageSortFileSchema, vr as r$8, w as ipnsNameToIpnsOverPubsubTopic, wn as VoteChallengeRequestToEncryptSchema, wr as e$4, wt as untrackUpdatingCommunity, x as hasTransientNetworkErrorCode, xn as areEquivalentNames, xr as r$7, xt as trackUpdatingCommunity, yr as t$12, yt as trackStartedCommunity, zn as CommentUpdateSchema, zr as boolean, zt as DecryptedChallengeSchema } from "./util-Bd4vp_w6.js";
|
|
3
3
|
import { t as all } from "./src-CYIMjhjK.js";
|
|
4
|
-
import { s as validatePageSortFile } from "./page-sort-scoring-
|
|
4
|
+
import { s as validatePageSortFile } from "./page-sort-scoring-Y3zgv-l4.js";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
7
|
import dns from "node:dns";
|
|
@@ -127750,14 +127750,14 @@ function createAuthorIdentityMatcher({ community, publication }) {
|
|
|
127750
127750
|
};
|
|
127751
127751
|
const matchesIdentity = async (identity) => {
|
|
127752
127752
|
if (!isStringDomain(identity)) return identity === signerAddress ? MATCH : NO_MATCH;
|
|
127753
|
-
if (identity
|
|
127753
|
+
if (!wireName || !areEquivalentNames(identity, wireName)) return NO_MATCH;
|
|
127754
127754
|
return nameResolvesToSigner();
|
|
127755
127755
|
};
|
|
127756
127756
|
const matchesAnyIdentity = async (identities) => {
|
|
127757
127757
|
let nameListed = false;
|
|
127758
127758
|
for (const identity of identities) {
|
|
127759
127759
|
if (identity === signerAddress) return MATCH;
|
|
127760
|
-
if (wireName && identity
|
|
127760
|
+
if (wireName && areEquivalentNames(identity, wireName)) nameListed = true;
|
|
127761
127761
|
}
|
|
127762
127762
|
return nameListed ? nameResolvesToSigner() : NO_MATCH;
|
|
127763
127763
|
};
|
|
@@ -5350,6 +5350,7 @@ var messages;
|
|
|
5350
5350
|
messages["ERR_COMMUNITY_NAME_RESOLVES_TO_DIFFERENT_PUBLIC_KEY"] = "The community name resolves to a different public key than the one provided. The community may have migrated to a new key.";
|
|
5351
5351
|
messages["ERR_AUTHOR_NOT_MATCHING_SIGNATURE"] = "comment.author.address doesn't match comment.signature.publicKey";
|
|
5352
5352
|
messages["ERR_AUTHOR_NAME_MUST_BE_A_DOMAIN"] = "author.name must be a domain name (e.g. 'example.bso')";
|
|
5353
|
+
messages["ERR_AUTHOR_NAME_HAS_CAPITAL_LETTER"] = "author.name has an uppercase letter. Author domain names should be lowercase";
|
|
5353
5354
|
messages["ERR_COMMUNITY_IPNS_NAME_DOES_NOT_MATCH_SIGNATURE_PUBLIC_KEY"] = "The IPNS name of community doesn't match community.signature.publicKey";
|
|
5354
5355
|
messages["ERR_COMMUNITY_ENCRYPTION_PUBLIC_KEY_DOES_NOT_MATCH_SIGNATURE_PUBLIC_KEY"] = "community.encryption.publicKey doesn't match community.signature.publicKey. The key that runs the challenge exchange must be the key that signed the record";
|
|
5355
5356
|
messages["ERR_COMMENT_SHOULD_BE_THE_LATEST_EDIT"] = "comment.content is not set to the latest comment.authorEdit.content";
|
|
@@ -14365,6 +14366,11 @@ function isEthAliasDomain$1(address) {
|
|
|
14365
14366
|
function normalizeEthAliasDomain(address) {
|
|
14366
14367
|
return address.endsWith(".bso") ? address.slice(0, -4) + ".eth" : address;
|
|
14367
14368
|
}
|
|
14369
|
+
function areEquivalentNames(nameA, nameB) {
|
|
14370
|
+
if (nameA === nameB) return true;
|
|
14371
|
+
if (!isEthAliasDomain$1(nameA) || !isEthAliasDomain$1(nameB)) return false;
|
|
14372
|
+
return normalizeEthAliasDomain(nameA.toLowerCase()) === normalizeEthAliasDomain(nameB.toLowerCase());
|
|
14373
|
+
}
|
|
14368
14374
|
//#endregion
|
|
14369
14375
|
//#region dist/node/community/schema.js
|
|
14370
14376
|
const CommunityEncryptionSchema = looseObject({
|
|
@@ -14804,7 +14810,7 @@ const CommunityEditPublicationPubsubReservedFields = r$2([
|
|
|
14804
14810
|
], t$3(CommunityEditPubsubMessagePublicationSchema.shape));
|
|
14805
14811
|
//#endregion
|
|
14806
14812
|
//#region dist/node/generated-version.js
|
|
14807
|
-
const version = "0.0.
|
|
14813
|
+
const version = "0.0.124";
|
|
14808
14814
|
//#endregion
|
|
14809
14815
|
//#region dist/node/version.js
|
|
14810
14816
|
const protocolVersion = ProtocolVersionSchema.parse("1.0.0");
|
|
@@ -15875,11 +15881,7 @@ async function genToArray(gen) {
|
|
|
15875
15881
|
return out;
|
|
15876
15882
|
}
|
|
15877
15883
|
function areEquivalentCommunityAddresses(addressA, addressB) {
|
|
15878
|
-
|
|
15879
|
-
const lowerA = addressA.toLowerCase();
|
|
15880
|
-
const lowerB = addressB.toLowerCase();
|
|
15881
|
-
if (!isEthAliasDomain$1(lowerA) || !isEthAliasDomain$1(lowerB)) return false;
|
|
15882
|
-
return normalizeEthAliasDomain(lowerA) === normalizeEthAliasDomain(lowerB);
|
|
15884
|
+
return areEquivalentNames(addressA, addressB);
|
|
15883
15885
|
}
|
|
15884
15886
|
function getEquivalentCommunityAddresses(address) {
|
|
15885
15887
|
const lower = address.toLowerCase();
|
|
@@ -16593,4 +16595,4 @@ function hasTransientNetworkErrorCode(details) {
|
|
|
16593
16595
|
return details.causes?.some(hasTransientNetworkErrorCode) ?? false;
|
|
16594
16596
|
}
|
|
16595
16597
|
//#endregion
|
|
16596
|
-
export { shortifyAddress as $,
|
|
16598
|
+
export { shortifyAddress as $, CommentEditsTableRowSchema as $n, CommentModerationPubsubMessagePublicationSchema as $t, isLinkOfAnimatedImage as A, CommentIpfsReservedFields as An, FailedToFetchPageIpfsFromGatewaysError as Ar, ChallengeMessageSchema as At, raceAgainstAbort as B, CommentUpdateSignedPropertyNames as Bn, custom as Br, DecryptedChallengeVerificationSchema as Bt, interruptibleSleep as C, CreateVoteUserOptionsWithRefinementSchema as Cn, t$8 as Cr, untrackUpdatingComment as Ct, isIpfsPath as D, VoteSignedPropertyNames as Dn, FailedToFetchCommentUpdateFromGatewaysError as Dr, pTimeout as Dt, isIpfsCid as E, VotePubsubReservedFields as En, FailedToFetchCommentIpfsFromGatewaysError as Er, TimeoutError as Et, isLinkValid as F, CommentUpdateChallengeReservedFieldNames as Fn, require_ms as Fr, ChallengeVerificationMessageSignedPropertyNames as Ft, removeNullUndefinedEmptyObjectsValuesRecursively as G, ModQueuePageIpfsSchema as Gn, string as Gr, PKCUserOptionsSchema as Gt, rejectWhenCommunityStopsOrAborts as H, CommentsTableRowSchema as Hn, number as Hr, NameResolverSerializedSchema as Ht, isRequestPubsubPublicationOfPost as I, CommentUpdateForChallengeVerificationSchema as In, setErrorMap as Ir, DecryptedChallengeAnswerSchema as It, replaceXWithY as J, CommentEditChallengeRequestToEncryptSchema as Jn, parsedType as Jr, CommunityEditPublicationPubsubReservedFields as Jt, removeNullUndefinedValues as K, PageIpfsSchema as Kn, ZodError as Kr, version_default as Kt, isRequestPubsubPublicationOfReply as L, CommentUpdateForChallengeVerificationSignedPropertyNames as Ln, _enum as Lr, DecryptedChallengeRequestPublicationSchema as Lt, isLinkOfImage as M, CommentPubsubMessageReservedFields as Mn, messages as Mr, ChallengeRequestMessageSchema as Mt, isLinkOfMedia as N, CommentPubsubMessageWithFlexibleAuthorRefinementSchema as Nn, logger_default as Nr, ChallengeRequestMessageSignedPropertyNames as Nt, isIpns as O, VoteTablesRowSchema as On, FailedToFetchCommunityFromGatewaysError as Or, ChallengeAnswerMessageSchema as Ot, isLinkOfVideo as P, CommentSignedPropertyNames as Pn, require_supports_color as Pr, ChallengeVerificationMessageSchema as Pt, retryKuboIpfsAddAndProvide as Q, CommentEditSignedPropertyNames as Qn, CommentModerationChallengeRequestToEncryptSchema as Qt, pubsubTopicToDhtKey as R, CommentUpdateReservedFields as Rn, array as Rr, DecryptedChallengeRequestSchema as Rt, hideClassPrivateProps as S, isStringDomain as Sn, t$7 as Sr, untrackStartedCommunity as St, isAbortError as T, VotePubsubMessagePublicationSchema as Tn, require_retry as Tr, require_sha256 as Tt, removeBlocksFromKuboNode as U, CreateCommentOptionsWithRefinementSchema as Un, object as Ur, PKCParsedOptionsSchema as Ut, rejectWhenAbortSignalFires as V, CommentUpdateTableRowSchema as Vn, literal as Vr, NameResolveCacheOptionsSchema as Vt, removeMfsFilesSafely as W, GetPageParamSchema as Wn, record as Wr, PKCUserOptionBaseSchema as Wt, retryKuboBlockPutPinAndProvidePubsubTopic as X, CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema as Xn, CommunityEditPubsubMessagePublicationSchema as Xt, resolveWhenPredicateIsTrue as Y, CommentEditPubsubMessagePublicationSchema as Yn, stringifyPrimitive as Yr, CommunityEditPublicationSignedPropertyNames as Yt, retryKuboIpfsAdd as Z, CommentEditReservedFields as Zn, CreateCommunityEditPublicationOptionsWithRefinementSchema as Zt, getEquivalentCommunityAddresses as _, PageSortFileFactorySchema as _n, t$4 as _r, refreshTrackedCommunityAliases as _t, calculateUnixFsDagSizeCidV0 as a, ChallengeFileSchema as an, CidPathSchema as ar, waitForUpdateInCommunityInstanceWithErrorAndTimeout as at, getPostUpdateTimestampRange as b, RpcRemoteCommunityUpdateEventResultSchema as bn, n$7 as br, trackUpdatingComment as bt, contentContainsMarkdownVideos as c, CommunityEditOptionsSchema as cn, CommunityAuthorChallengeReservedFieldNames as cr, writeKuboFilesWithTimeout as ct, derivePublicationFromChallengeRequest as d, CommunityIpfsSchema as dn, t$1 as dr, findUpdatingComment as dt, CommentModerationReservedFields as en, CreateCommentEditOptionsWithRefinementSchema as er, shortifyCid as et, doesDomainAddressHaveCapitalLetter as f, CommunitySignedPropertyNames as fn, n$3 as fr, findUpdatingCommunity as ft, genToArray as g, ExportCommunityModLogsOptionsSchema as gn, e$2 as gr, refreshTrackedCommentAliases as gt, findMalformedUnicodeString as h, CreateRpcCommunityFunctionArgumentSchema as hn, e as hr, listUpdatingCommunities as ht, calculateStringSizeSameAsIpfsAddCidV0 as i, ChallengeFileFactorySchema as in, ChallengeAnswersSchema as ir, timestamp as it, isLinkOfAudio as j, CommentIpfsSchema as jn, PKCError as jr, ChallengeMessageSignedPropertyNames as jt, isIpnsPath as k, CommentChallengeRequestToEncryptSchema as kn, FailedToFetchGenericIpfsFromGatewaysError as kr, ChallengeAnswerMessageSignedPropertyNames as kt, createAbortError as l, CommunityExportRecordsSchema as ln, CreateSignerSchema as lr, findCommunityInRegistry as lt, fetchAndValidateIpnsRecordFromGateway as m, CreateRemoteCommunityFunctionArgumentSchema as mn, t$3 as mr, listUpdatingComments as mt, binaryKeyToPubsubTopic as n, CommentModerationsTableRowSchema as nn, AuthorCommentIpfsReservedFields as nr, statMfsPathSafely as nt, contentContainsMarkdownAudio as o, CommunityAnchorSchema as on, CidStringSchema as or, withSortedKeys as ot, extractNetworkErrorDetails as p, CreateNewLocalCommunityUserOptionsSchema as pn, t$2 as pr, listStartedCommunities as pt, removeUndefinedValuesRecursively as q, isReservedObjectKey as qn, joinValues as qr, CommunityEditPublicationChallengeRequestToEncryptSchema as qt, calculateIpfsCidV0 as r, CreateCommentModerationOptionsWithRefinementSchema as rn, AuthorReservedFields as rr, throwIfAbortSignalAborted as rt, contentContainsMarkdownImages as s, CommunityChallengeSettingSchema as sn, CommunityAddressSchema as sr, withSortedKeysDeep as st, areEquivalentCommunityAddresses as t, CommentModerationSignedPropertyNames as tn, AuthorAddressSchema as tr, sleepUntilTimeoutOrAbort as tt, deepMergeRuntimeFields as u, CommunityIpfsReservedFields as un, n as ur, findStartedCommunity as ut, getErrorCodeFromMessage as v, PageSortFileSchema as vn, r$2 as vr, syncCommunityRegistryEntry as vt, ipnsNameToIpnsOverPubsubTopic as w, VoteChallengeRequestToEncryptSchema as wn, e$4 as wr, untrackUpdatingCommunity as wt, hasTransientNetworkErrorCode as x, areEquivalentNames as xn, r$4 as xr, trackUpdatingCommunity as xt, getIpnsRecordInLocalKuboNode as y, PubsubTopicSchema as yn, t$5 as yr, trackStartedCommunity as yt, pubsubTopicToDhtKeyCid as z, CommentUpdateSchema as zn, boolean as zr, DecryptedChallengeSchema as zt };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jr as PKCError, z as pubsubTopicToDhtKeyCid } from "./util-Bd4vp_w6.js";
|
|
2
2
|
import { ipnsSelector } from "ipns/selector";
|
|
3
3
|
import { ipnsValidator } from "ipns/validator";
|
|
4
4
|
import { unmarshalIPNSRecord } from "ipns";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { s as validatePageSortFile } from "./page-sort-scoring-
|
|
1
|
+
import { _n as PageSortFileFactorySchema, an as ChallengeFileSchema, in as ChallengeFileFactorySchema, jr as PKCError } from "./util-Bd4vp_w6.js";
|
|
2
|
+
import { s as validatePageSortFile } from "./page-sort-scoring-Y3zgv-l4.js";
|
|
3
3
|
//#region dist/node/validate-package-factories.js
|
|
4
4
|
function validateChallengeFileFactory(factory, { name }) {
|
|
5
5
|
try {
|
package/dist/bundled/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as getShortCid, c as setNativeFunctions, i as getShortAddress, n as challenges, o as nativeFunctions, r as createAnchorIpnsRecord, s as pageSorts, t as PKC } from "./chunks/node-
|
|
1
|
+
import { a as getShortCid, c as setNativeFunctions, i as getShortAddress, n as challenges, o as nativeFunctions, r as createAnchorIpnsRecord, s as pageSorts, t as PKC } from "./chunks/node-BWOsSCO-.js";
|
|
2
2
|
export { challenges, createAnchorIpnsRecord, PKC as default, getShortAddress, getShortCid, nativeFunctions, pageSorts, setNativeFunctions };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as validatePageSortFileFactory } from "./chunks/validate-package-factories-
|
|
1
|
+
import { n as validatePageSortFileFactory } from "./chunks/validate-package-factories-D527vDd_.js";
|
|
2
2
|
export { validatePageSortFileFactory };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as parseRpcExportCommunityParam, b as parseRpcUnsubscribeParam, d as parseRpcCidParam, f as parseRpcCommentRepliesPageParam, g as parseRpcExportCommunityModLogsParam, h as parseRpcEditCommunityParam, l as parseRpcAuthorNameParam, m as parseRpcCommunityPageParam, p as parseRpcCommunityIdentifierParam, t as PKC, u as parseRpcCancelExportParam, v as parseRpcPublishAnchorRecordParam, y as parseRpcPublishChallengeAnswersParam } from "../../chunks/node-
|
|
3
|
-
import { $t as require_lib, At as parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, E as buildPagesRuntimeFields, Er as stringify, H as pRetry, I as extractCrosspostRuntimeFields, St as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, T as buildPageRuntimeFields, U as pLimit, _t as parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails, et as parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, it as parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, kt as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, lt as parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, tt as parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, ut as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, vt as parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails, yr as t$1 } from "../../chunks/rpc-local-community-
|
|
4
|
-
import { t as LocalCommunity } from "../../chunks/local-community-
|
|
1
|
+
import { Dt as pTimeout, J as replaceXWithY, Nr as logger_default, S as hideClassPrivateProps, fr as n, jr as PKCError, mr as t, ut as findStartedCommunity } from "../../chunks/util-Bd4vp_w6.js";
|
|
2
|
+
import { _ as parseRpcExportCommunityParam, b as parseRpcUnsubscribeParam, d as parseRpcCidParam, f as parseRpcCommentRepliesPageParam, g as parseRpcExportCommunityModLogsParam, h as parseRpcEditCommunityParam, l as parseRpcAuthorNameParam, m as parseRpcCommunityPageParam, p as parseRpcCommunityIdentifierParam, t as PKC, u as parseRpcCancelExportParam, v as parseRpcPublishAnchorRecordParam, y as parseRpcPublishChallengeAnswersParam } from "../../chunks/node-BWOsSCO-.js";
|
|
3
|
+
import { $t as require_lib, At as parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, E as buildPagesRuntimeFields, Er as stringify, H as pRetry, I as extractCrosspostRuntimeFields, St as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, T as buildPageRuntimeFields, U as pLimit, _t as parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails, et as parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, it as parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, kt as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, lt as parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, tt as parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, ut as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, vt as parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails, yr as t$1 } from "../../chunks/rpc-local-community-D8wgBsuD.js";
|
|
4
|
+
import { t as LocalCommunity } from "../../chunks/local-community-Ll4pUOKV.js";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import path from "path";
|
|
7
7
|
import assert from "assert";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare function isStringDomain(x: string | undefined): boolean;
|
|
2
2
|
export declare function isEthAliasDomain(address: string): boolean;
|
|
3
3
|
export declare function normalizeEthAliasDomain(address: string): string;
|
|
4
|
+
export declare function areEquivalentNames(nameA: string, nameB: string): boolean;
|
package/dist/node/domain-util.js
CHANGED
|
@@ -13,4 +13,14 @@ export function isEthAliasDomain(address) {
|
|
|
13
13
|
export function normalizeEthAliasDomain(address) {
|
|
14
14
|
return address.endsWith(".bso") ? address.slice(0, -4) + ".eth" : address;
|
|
15
15
|
}
|
|
16
|
+
// Do two names refer to the same name? `.bso` is the protocol's spelling of an ENS `.eth` name, and ENS names
|
|
17
|
+
// are case-insensitive, so `x.bso`, `x.eth` and `X.BSO` are one name. Any other name must match exactly: we do
|
|
18
|
+
// not know that its resolver ignores case. Issue #424.
|
|
19
|
+
export function areEquivalentNames(nameA, nameB) {
|
|
20
|
+
if (nameA === nameB)
|
|
21
|
+
return true;
|
|
22
|
+
if (!isEthAliasDomain(nameA) || !isEthAliasDomain(nameB))
|
|
23
|
+
return false;
|
|
24
|
+
return normalizeEthAliasDomain(nameA.toLowerCase()) === normalizeEthAliasDomain(nameB.toLowerCase());
|
|
25
|
+
}
|
|
16
26
|
//# sourceMappingURL=domain-util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-util.js","sourceRoot":"","sources":["../../src/domain-util.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,sFAAsF;AACtF,qEAAqE;AACrE,oGAAoG;AACpG,wEAAwE;AAExE,MAAM,UAAU,cAAc,CAAC,CAAqB;IAChD,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC5C,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IACpC,OAAO,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAe;IACnD,OAAO,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;AAC9E,CAAC"}
|
|
1
|
+
{"version":3,"file":"domain-util.js","sourceRoot":"","sources":["../../src/domain-util.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,sFAAsF;AACtF,qEAAqE;AACrE,oGAAoG;AACpG,wEAAwE;AAExE,MAAM,UAAU,cAAc,CAAC,CAAqB;IAChD,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC5C,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IACpC,OAAO,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAe;IACnD,OAAO,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;AAC9E,CAAC;AAED,8GAA8G;AAC9G,+GAA+G;AAC/G,uDAAuD;AACvD,MAAM,UAAU,kBAAkB,CAAC,KAAa,EAAE,KAAa;IAC3D,IAAI,KAAK,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IACjC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACvE,OAAO,uBAAuB,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,KAAK,uBAAuB,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;AACzG,CAAC"}
|
package/dist/node/errors.d.ts
CHANGED
|
@@ -179,6 +179,7 @@ export declare enum messages {
|
|
|
179
179
|
ERR_COMMUNITY_NAME_RESOLVES_TO_DIFFERENT_PUBLIC_KEY = "The community name resolves to a different public key than the one provided. The community may have migrated to a new key.",
|
|
180
180
|
ERR_AUTHOR_NOT_MATCHING_SIGNATURE = "comment.author.address doesn't match comment.signature.publicKey",
|
|
181
181
|
ERR_AUTHOR_NAME_MUST_BE_A_DOMAIN = "author.name must be a domain name (e.g. 'example.bso')",
|
|
182
|
+
ERR_AUTHOR_NAME_HAS_CAPITAL_LETTER = "author.name has an uppercase letter. Author domain names should be lowercase",
|
|
182
183
|
ERR_COMMUNITY_IPNS_NAME_DOES_NOT_MATCH_SIGNATURE_PUBLIC_KEY = "The IPNS name of community doesn't match community.signature.publicKey",
|
|
183
184
|
ERR_COMMUNITY_ENCRYPTION_PUBLIC_KEY_DOES_NOT_MATCH_SIGNATURE_PUBLIC_KEY = "community.encryption.publicKey doesn't match community.signature.publicKey. The key that runs the challenge exchange must be the key that signed the record",
|
|
184
185
|
ERR_COMMENT_SHOULD_BE_THE_LATEST_EDIT = "comment.content is not set to the latest comment.authorEdit.content",
|
package/dist/node/errors.js
CHANGED
|
@@ -185,6 +185,7 @@ export var messages;
|
|
|
185
185
|
messages["ERR_COMMUNITY_NAME_RESOLVES_TO_DIFFERENT_PUBLIC_KEY"] = "The community name resolves to a different public key than the one provided. The community may have migrated to a new key.";
|
|
186
186
|
messages["ERR_AUTHOR_NOT_MATCHING_SIGNATURE"] = "comment.author.address doesn't match comment.signature.publicKey";
|
|
187
187
|
messages["ERR_AUTHOR_NAME_MUST_BE_A_DOMAIN"] = "author.name must be a domain name (e.g. 'example.bso')";
|
|
188
|
+
messages["ERR_AUTHOR_NAME_HAS_CAPITAL_LETTER"] = "author.name has an uppercase letter. Author domain names should be lowercase";
|
|
188
189
|
messages["ERR_COMMUNITY_IPNS_NAME_DOES_NOT_MATCH_SIGNATURE_PUBLIC_KEY"] = "The IPNS name of community doesn't match community.signature.publicKey";
|
|
189
190
|
messages["ERR_COMMUNITY_ENCRYPTION_PUBLIC_KEY_DOES_NOT_MATCH_SIGNATURE_PUBLIC_KEY"] = "community.encryption.publicKey doesn't match community.signature.publicKey. The key that runs the challenge exchange must be the key that signed the record";
|
|
190
191
|
messages["ERR_COMMENT_SHOULD_BE_THE_LATEST_EDIT"] = "comment.content is not set to the latest comment.authorEdit.content";
|
package/dist/node/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QAmdX;AAndD,WAAY,QAAQ;IAChB,gFAAoE,CAAA;IACpE,yHAA6G,CAAA;IAC7G,6EAAiE,CAAA;IACjE,4FAAgF,CAAA;IAChF,iMAAqL,CAAA;IACrL,4HAAgH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,uGAA2F,CAAA;IAE3F,sNAA0M,CAAA;IAC1M,qNAAyM,CAAA;IACzM,2OAA0N,CAAA;IAC1N,0PAA8O,CAAA;IAE9O,sGAAsG;IACtG,oGAAoG;IACpG,0EAA0E;IAC1E,qLAAyK,CAAA;IACzK,8IAAkI,CAAA;IAClI,mLAAuK,CAAA;IACvK,uIAA2H,CAAA;IAC3H,uIAA2H,CAAA;IAC3H,8KAAkK,CAAA;IAClK,qNAAyM,CAAA;IAEzM,wFAAwF;IACxF,mGAAuF,CAAA;IACvF,iGAAqF,CAAA;IACrF,4GAAgG,CAAA;IAChG,iLAAqK,CAAA;IACrK,iNAAqM,CAAA;IACrM,wIAA4H,CAAA;IAC5H,iJAAqI,CAAA;IACrI,+HAAmH,CAAA;IACnH,kOAAsN,CAAA;IACtN,gIAAoH,CAAA;IACpH,+HAAmH,CAAA;IACnH,8KAAkK,CAAA;IAClK,mNAAuM,CAAA;IACvM,+IAAmI,CAAA;AACvI,CAAC,EAndW,QAAQ,KAAR,QAAQ,QAmdnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.124";
|
package/dist/node/pkc/pkc.js
CHANGED
|
@@ -27,7 +27,7 @@ import CommunityEdit from "../publications/community-edit/community-edit.js";
|
|
|
27
27
|
import { LRUCache } from "lru-cache";
|
|
28
28
|
import { PKCTypedEmitter } from "../clients/pkc-typed-emitter.js";
|
|
29
29
|
import { parseRpcAuthorNameParam, parseRpcCidParam } from "../clients/rpc-client/rpc-schema-util.js";
|
|
30
|
-
import { cleanWireAuthor, normalizeCreatePublicationAuthor } from "../publications/publication-author.js";
|
|
30
|
+
import { cleanWireAuthor, getAuthorNameFromWire, normalizeCreatePublicationAuthor } from "../publications/publication-author.js";
|
|
31
31
|
import { stripNameResolvedFromCrosspost } from "../publications/comment/crosspost-runtime.js";
|
|
32
32
|
import { TrackedInstanceRegistry } from "./tracked-instance-registry.js";
|
|
33
33
|
import { findUpdatingCommunity, listStartedCommunities, listUpdatingComments, listUpdatingCommunities } from "./tracked-instance-registry-util.js";
|
|
@@ -396,6 +396,11 @@ export class PKC extends PKCTypedEmitter {
|
|
|
396
396
|
if (!finalOptions.signer)
|
|
397
397
|
throw Error("User did not provide a signer to create a local publication");
|
|
398
398
|
const normalizedAuthor = normalizeCreatePublicationAuthor(finalOptions.author);
|
|
399
|
+
// Communities reject an author.name with an uppercase letter, the same rule as a community name. Fail here,
|
|
400
|
+
// before signing, rather than at the community after the challenge exchange. Issue #447.
|
|
401
|
+
const authorName = getAuthorNameFromWire(normalizedAuthor);
|
|
402
|
+
if (authorName && doesDomainAddressHaveCapitalLetter(authorName))
|
|
403
|
+
throw new PKCError("ERR_AUTHOR_NAME_HAS_CAPITAL_LETTER", { authorName });
|
|
399
404
|
let cleanedAuthor = cleanWireAuthor(normalizedAuthor);
|
|
400
405
|
// Strip empty objects from author — empty {} should not be signed
|
|
401
406
|
if (cleanedAuthor) {
|