@pkcprotocol/pkc-js 0.0.153 → 0.0.154
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -1
- package/dist/browser/errors.d.ts +4 -2
- package/dist/browser/errors.js +4 -2
- 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-error.d.ts +1 -1
- package/dist/browser/publications/comment/comment.d.ts +1 -0
- package/dist/browser/publications/comment/comment.js +57 -12
- package/dist/browser/publications/comment/comment.js.map +1 -1
- package/dist/browser/publications/publication.d.ts +8 -1
- package/dist/browser/publications/publication.js +393 -146
- package/dist/browser/publications/publication.js.map +1 -1
- package/dist/browser/publications/types.d.ts +1 -0
- package/dist/browser/rpc/src/index.js +12 -5
- package/dist/browser/rpc/src/index.js.map +1 -1
- package/dist/browser/runtime/node/blockstore.d.ts +2 -2
- package/dist/browser/runtime/node/blockstore.js +2 -2
- package/dist/browser/runtime/node/community/db-handler.d.ts +5 -7
- package/dist/browser/runtime/node/community/db-handler.js +79 -82
- package/dist/browser/runtime/node/community/db-handler.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community/cleanup.js +62 -12
- package/dist/browser/runtime/node/community/local-community/cleanup.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community/db-state.d.ts +1 -1
- package/dist/browser/runtime/node/community/local-community/db-state.js +31 -39
- package/dist/browser/runtime/node/community/local-community/db-state.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community/editing.js +71 -22
- package/dist/browser/runtime/node/community/local-community/editing.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community/ipns-publishing.js +1 -1
- package/dist/browser/runtime/node/community/local-community/ipns-publishing.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community/lifecycle.d.ts +0 -2
- package/dist/browser/runtime/node/community/local-community/lifecycle.js +50 -72
- package/dist/browser/runtime/node/community/local-community/lifecycle.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community.d.ts +4 -2
- package/dist/browser/runtime/node/community/local-community.js +11 -7
- package/dist/browser/runtime/node/community/local-community.js.map +1 -1
- package/dist/browser/runtime/node/community/start-lock.d.ts +14 -5
- package/dist/browser/runtime/node/community/start-lock.js +153 -10
- package/dist/browser/runtime/node/community/start-lock.js.map +1 -1
- package/dist/browser/runtime/node/util.js +18 -10
- package/dist/browser/runtime/node/util.js.map +1 -1
- package/dist/bundled/bundle-manifest.json +35 -44
- package/dist/bundled/challenges.js +1 -1
- package/dist/bundled/chunks/{helia-for-pkc-COJ3xMF9.js → helia-for-pkc-CG9YohPs.js} +4 -4
- package/dist/bundled/chunks/{local-community-BTx2HxIm.js → local-community-CaQmhX8D.js} +1 -1
- package/dist/bundled/chunks/{local-community-CflGu_ET.js → local-community-V8_VyEhO.js} +217 -162
- package/dist/bundled/chunks/{node-B0b6lAIX.js → node-c4vpD2VN.js} +340 -172
- package/dist/bundled/chunks/{page-sort-scoring-DAMnUmDY.js → page-sort-scoring-d1frahfd.js} +1 -1
- package/dist/bundled/chunks/{rpc-local-community-Cy03QajY.js → rpc-local-community-DDAibWpE.js} +144 -1431
- package/dist/bundled/chunks/{util-C4y8KHmp.js → util-B_dKP7Te.js} +1 -1
- package/dist/bundled/chunks/{util-D7AtfLYH.js → util-BwEIge-b.js} +5 -3
- package/dist/bundled/chunks/{validate-package-factories-EH9ydbPR.js → validate-package-factories-DfpNf4oq.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 +14 -9
- package/dist/node/errors.d.ts +4 -2
- package/dist/node/errors.js +4 -2
- 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-error.d.ts +1 -1
- package/dist/node/publications/comment/comment.d.ts +1 -0
- package/dist/node/publications/comment/comment.js +57 -12
- package/dist/node/publications/comment/comment.js.map +1 -1
- package/dist/node/publications/publication.d.ts +8 -1
- package/dist/node/publications/publication.js +393 -146
- package/dist/node/publications/publication.js.map +1 -1
- package/dist/node/publications/types.d.ts +1 -0
- package/dist/node/rpc/src/index.js +12 -5
- package/dist/node/rpc/src/index.js.map +1 -1
- package/dist/node/runtime/node/blockstore.d.ts +2 -2
- package/dist/node/runtime/node/blockstore.js +2 -2
- package/dist/node/runtime/node/community/db-handler.d.ts +5 -7
- package/dist/node/runtime/node/community/db-handler.js +79 -82
- package/dist/node/runtime/node/community/db-handler.js.map +1 -1
- package/dist/node/runtime/node/community/local-community/cleanup.js +62 -12
- package/dist/node/runtime/node/community/local-community/cleanup.js.map +1 -1
- package/dist/node/runtime/node/community/local-community/db-state.d.ts +1 -1
- package/dist/node/runtime/node/community/local-community/db-state.js +31 -39
- package/dist/node/runtime/node/community/local-community/db-state.js.map +1 -1
- package/dist/node/runtime/node/community/local-community/editing.js +71 -22
- package/dist/node/runtime/node/community/local-community/editing.js.map +1 -1
- package/dist/node/runtime/node/community/local-community/ipns-publishing.js +1 -1
- package/dist/node/runtime/node/community/local-community/ipns-publishing.js.map +1 -1
- package/dist/node/runtime/node/community/local-community/lifecycle.d.ts +0 -2
- package/dist/node/runtime/node/community/local-community/lifecycle.js +50 -72
- package/dist/node/runtime/node/community/local-community/lifecycle.js.map +1 -1
- package/dist/node/runtime/node/community/local-community.d.ts +4 -2
- package/dist/node/runtime/node/community/local-community.js +11 -7
- package/dist/node/runtime/node/community/local-community.js.map +1 -1
- package/dist/node/runtime/node/community/start-lock.d.ts +14 -5
- package/dist/node/runtime/node/community/start-lock.js +153 -10
- package/dist/node/runtime/node/community/start-lock.js.map +1 -1
- package/dist/node/runtime/node/util.js +18 -10
- package/dist/node/runtime/node/util.js.map +1 -1
- package/package.json +1 -2
package/dist/bundled/chunks/{rpc-local-community-Cy03QajY.js → rpc-local-community-DDAibWpE.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as __toESM, n as __exportAll, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
|
|
2
|
-
import { $r as string, $t as CreateCommunityEditPublicationOptionsWithRefinementSchema, A as isIpnsPath, An as CommentIpfsReservedFields, Ar as e$4, B as pubsubTopicToDhtKey, Bn as CommentUpdateSignedPropertyNames, Br as require_supports_color, C as hideClassPrivateProps, Cn as CreateVoteUserOptionsWithRefinementSchema, Cr as t$11, Ct as trackUpdatingCommunity, D as isIpfsCid, Dn as VoteSignedPropertyNames, Dr as r$7, Dt as require_sha256$1, E as isAbortError, Er as n$8, Et as untrackUpdatingCommunity, Fn as CommentUpdateChallengeReservedFieldNames, Fr as FailedToFetchGenericIpfsFromGatewaysError, Ft as ChallengeRequestMessageSignedPropertyNames, Gn as ModQueuePageIpfsSchema, Gr as boolean, Gt as PKCParsedOptionsSchema, H as raceAgainstAbort, Ht as DecryptedChallengeVerificationSchema, Ir as FailedToFetchPageIpfsFromGatewaysError, Jn as CommentEditChallengeRequestToEncryptSchema, Jr as looseObject, Kn as PageIpfsSchema, Kr as custom, Kt as PKCUserOptionBaseSchema, L as isRequestPubsubPublicationOfPost, Ln as CommentUpdateForChallengeVerificationSignedPropertyNames, Lr as PKCError, Lt as ChallengeVerificationMessageSignedPropertyNames, Mr as FailedToFetchCommentIpfsFromGatewaysError, Nn as CommentPubsubMessageWithFlexibleAuthorRefinementSchema, Nr as FailedToFetchCommentUpdateFromGatewaysError, Nt as ChallengeMessageSignedPropertyNames, O as isIpfsPath, Or as t$10, Pn as CommentSignedPropertyNames, Pr as FailedToFetchCommunityFromGatewaysError, Qn as CommentEditSignedPropertyNames, Qr as record, Qt as CommunityEditPubsubMessagePublicationSchema, R as isRequestPubsubPublicationOfReply, Rn as CommentUpdateReservedFields, Rr as messages, Rt as DecryptedChallengeAnswerSchema, S as hasTransientNetworkErrorCode, Sn as RpcRemoteCommunityUpdateEventResultSchema, Sr as e$5, T as ipnsNameToIpnsOverPubsubTopic, Tn as VotePubsubMessagePublicationSchema, Tr as t$12, Un as CreateCommentOptionsWithRefinementSchema, Ur as _enum, Ut as NameResolveCacheOptionsSchema, Vr as require_ms$1, Vt as DecryptedChallengeSchema, Wn as GetPageParamSchema, Wr as array, Wt as NameResolverSerializedSchema, Xn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, Xr as object, Yr as number, Yt as CommunityEditPublicationChallengeRequestToEncryptSchema, Zr as preprocess, Zt as CommunityEditPublicationSignedPropertyNames, _n as CreateRpcCommunityFunctionArgumentSchema, an as CreateCommentModerationOptionsWithRefinementSchema, ar as ChallengeAnswersByIndexSchema, at as throwIfAbortSignalAborted, bn as PageSortFileSchema, br as t$13, cr as CommunityAddressSchema, d as deepMergeRuntimeFields, dn as CommunityExportRecordsSchema, dr as JsonSignatureSchema, dt as findStartedCommunity, ei as union, en as CommentModerationChallengeRequestToEncryptSchema, er as CreateCommentEditOptionsWithRefinementSchema, f as derivePublicationFromChallengeRequest, fn as CommunityIpfsReservedFields, fr as PKCTimestampSchema, gn as CreateRemoteCommunityFunctionArgumentSchema, gr as n$9, h as fetchAndValidateIpnsRecordFromGateway, hn as CreateNewLocalCommunityUserOptionsSchema, hr as isStringDomain, in as CommentModerationsTableRowSchema, ir as AuthorReservedFields, jn as CommentIpfsSchema, jr as require_retry$2, jt as ChallengeAnswerMessageSignedPropertyNames, k as isIpns, kn as CommentChallengeRequestToEncryptSchema, kr as t$9, kt as pTimeout, ln as CommunityChallengeSettingSchema, lr as CommunityAuthorChallengeReservedFieldNames, m as extractNetworkErrorDetails, mn as CommunitySignedPropertyNames, mr as areEquivalentNames, mt as forgetTrackedUpdatingCommunityName, nr as AuthorCommentIpfsReservedFields, nt as shortifyCid, on as ChallengeFileFactorySchema, or as CidPathSchema, ot as timestamp, p as doesDomainAddressHaveCapitalLetter, pn as CommunityIpfsSchema, pr as ProtocolVersionSchema, pt as findUpdatingCommunity, q as removeNullUndefinedEmptyObjectsValuesRecursively, qn as isReservedObjectKey, qr as literal, qt as PKCUserOptionsSchema, r as calculateIpfsCidV0, rn as CommentModerationSignedPropertyNames, rr as AuthorPubsubSchema, rt as sleepUntilTimeoutOrAbort, sn as ChallengeFileSchema, sr as CidStringSchema, t as areEquivalentCommunityAddresses, tn as CommentModerationPubsubMessagePublicationSchema, tr as AuthorAddressSchema, tt as shortifyAddress, u as createAbortError, un as CommunityEditOptionsSchema, ur as CreateSignerSchema, vn as ExportCommunityModLogsOptionsSchema, vr as n$10, w as interruptibleSleep, wn as VoteChallengeRequestToEncryptSchema, wr as r$8, wt as untrackStartedCommunity, xr as e$6, xt as trackStartedCommunity, yn as PageSortFileFactorySchema, yt as refreshTrackedCommunityAliases, z as linkAbortSignals, zn as CommentUpdateSchema, zr as logger_default } from "./util-
|
|
2
|
+
import { $r as string, $t as CreateCommunityEditPublicationOptionsWithRefinementSchema, A as isIpnsPath, An as CommentIpfsReservedFields, Ar as e$4, B as pubsubTopicToDhtKey, Bn as CommentUpdateSignedPropertyNames, Br as require_supports_color, C as hideClassPrivateProps, Cn as CreateVoteUserOptionsWithRefinementSchema, Cr as t$11, Ct as trackUpdatingCommunity, D as isIpfsCid, Dn as VoteSignedPropertyNames, Dr as r$7, Dt as require_sha256$1, E as isAbortError, Er as n$8, Et as untrackUpdatingCommunity, Fn as CommentUpdateChallengeReservedFieldNames, Fr as FailedToFetchGenericIpfsFromGatewaysError, Ft as ChallengeRequestMessageSignedPropertyNames, Gn as ModQueuePageIpfsSchema, Gr as boolean, Gt as PKCParsedOptionsSchema, H as raceAgainstAbort, Ht as DecryptedChallengeVerificationSchema, Ir as FailedToFetchPageIpfsFromGatewaysError, Jn as CommentEditChallengeRequestToEncryptSchema, Jr as looseObject, Kn as PageIpfsSchema, Kr as custom, Kt as PKCUserOptionBaseSchema, L as isRequestPubsubPublicationOfPost, Ln as CommentUpdateForChallengeVerificationSignedPropertyNames, Lr as PKCError, Lt as ChallengeVerificationMessageSignedPropertyNames, Mr as FailedToFetchCommentIpfsFromGatewaysError, Nn as CommentPubsubMessageWithFlexibleAuthorRefinementSchema, Nr as FailedToFetchCommentUpdateFromGatewaysError, Nt as ChallengeMessageSignedPropertyNames, O as isIpfsPath, Or as t$10, Pn as CommentSignedPropertyNames, Pr as FailedToFetchCommunityFromGatewaysError, Qn as CommentEditSignedPropertyNames, Qr as record, Qt as CommunityEditPubsubMessagePublicationSchema, R as isRequestPubsubPublicationOfReply, Rn as CommentUpdateReservedFields, Rr as messages, Rt as DecryptedChallengeAnswerSchema, S as hasTransientNetworkErrorCode, Sn as RpcRemoteCommunityUpdateEventResultSchema, Sr as e$5, T as ipnsNameToIpnsOverPubsubTopic, Tn as VotePubsubMessagePublicationSchema, Tr as t$12, Un as CreateCommentOptionsWithRefinementSchema, Ur as _enum, Ut as NameResolveCacheOptionsSchema, Vr as require_ms$1, Vt as DecryptedChallengeSchema, Wn as GetPageParamSchema, Wr as array, Wt as NameResolverSerializedSchema, Xn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, Xr as object, Yr as number, Yt as CommunityEditPublicationChallengeRequestToEncryptSchema, Zr as preprocess, Zt as CommunityEditPublicationSignedPropertyNames, _n as CreateRpcCommunityFunctionArgumentSchema, an as CreateCommentModerationOptionsWithRefinementSchema, ar as ChallengeAnswersByIndexSchema, at as throwIfAbortSignalAborted, bn as PageSortFileSchema, br as t$13, cr as CommunityAddressSchema, d as deepMergeRuntimeFields, dn as CommunityExportRecordsSchema, dr as JsonSignatureSchema, dt as findStartedCommunity, ei as union, en as CommentModerationChallengeRequestToEncryptSchema, er as CreateCommentEditOptionsWithRefinementSchema, f as derivePublicationFromChallengeRequest, fn as CommunityIpfsReservedFields, fr as PKCTimestampSchema, gn as CreateRemoteCommunityFunctionArgumentSchema, gr as n$9, h as fetchAndValidateIpnsRecordFromGateway, hn as CreateNewLocalCommunityUserOptionsSchema, hr as isStringDomain, in as CommentModerationsTableRowSchema, ir as AuthorReservedFields, jn as CommentIpfsSchema, jr as require_retry$2, jt as ChallengeAnswerMessageSignedPropertyNames, k as isIpns, kn as CommentChallengeRequestToEncryptSchema, kr as t$9, kt as pTimeout, ln as CommunityChallengeSettingSchema, lr as CommunityAuthorChallengeReservedFieldNames, m as extractNetworkErrorDetails, mn as CommunitySignedPropertyNames, mr as areEquivalentNames, mt as forgetTrackedUpdatingCommunityName, nr as AuthorCommentIpfsReservedFields, nt as shortifyCid, on as ChallengeFileFactorySchema, or as CidPathSchema, ot as timestamp, p as doesDomainAddressHaveCapitalLetter, pn as CommunityIpfsSchema, pr as ProtocolVersionSchema, pt as findUpdatingCommunity, q as removeNullUndefinedEmptyObjectsValuesRecursively, qn as isReservedObjectKey, qr as literal, qt as PKCUserOptionsSchema, r as calculateIpfsCidV0, rn as CommentModerationSignedPropertyNames, rr as AuthorPubsubSchema, rt as sleepUntilTimeoutOrAbort, sn as ChallengeFileSchema, sr as CidStringSchema, t as areEquivalentCommunityAddresses, tn as CommentModerationPubsubMessagePublicationSchema, tr as AuthorAddressSchema, tt as shortifyAddress, u as createAbortError, un as CommunityEditOptionsSchema, ur as CreateSignerSchema, vn as ExportCommunityModLogsOptionsSchema, vr as n$10, w as interruptibleSleep, wn as VoteChallengeRequestToEncryptSchema, wr as r$8, wt as untrackStartedCommunity, xr as e$6, xt as trackStartedCommunity, yn as PageSortFileFactorySchema, yt as refreshTrackedCommunityAliases, z as linkAbortSignals, zn as CommentUpdateSchema, zr as logger_default } from "./util-BwEIge-b.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-d1frahfd.js";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
7
|
import dns from "node:dns";
|
|
@@ -9,6 +9,7 @@ import os from "os";
|
|
|
9
9
|
import { closeSync, createReadStream, existsSync, openSync, promises, readSync, readdirSync, statSync, watch } from "node:fs";
|
|
10
10
|
import path from "path";
|
|
11
11
|
import assert from "assert";
|
|
12
|
+
import fs$1 from "fs";
|
|
12
13
|
import { Agent } from "https";
|
|
13
14
|
import { Agent as Agent$1 } from "http";
|
|
14
15
|
import Database from "better-sqlite3";
|
|
@@ -18639,7 +18640,7 @@ var require_serializer$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18639
18640
|
}));
|
|
18640
18641
|
//#endregion
|
|
18641
18642
|
//#region node_modules/parse5/dist/cjs/index.js
|
|
18642
|
-
var require_cjs$
|
|
18643
|
+
var require_cjs$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
18643
18644
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18644
18645
|
exports.TokenizerMode = exports.Tokenizer = exports.Token = exports.html = exports.foreignContent = exports.ErrorCodes = exports.serializeOuter = exports.serialize = exports.Parser = exports.defaultTreeAdapter = void 0;
|
|
18645
18646
|
exports.parse = parse;
|
|
@@ -18730,11 +18731,11 @@ var require_cjs$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18730
18731
|
}));
|
|
18731
18732
|
//#endregion
|
|
18732
18733
|
//#region node_modules/parse5-htmlparser2-tree-adapter/dist/cjs/index.js
|
|
18733
|
-
var require_cjs$
|
|
18734
|
+
var require_cjs$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
18734
18735
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18735
18736
|
exports.adapter = void 0;
|
|
18736
18737
|
exports.serializeDoctypeContent = serializeDoctypeContent;
|
|
18737
|
-
const parse5_1 = require_cjs$
|
|
18738
|
+
const parse5_1 = require_cjs$2();
|
|
18738
18739
|
const domhandler_1 = require_lib$13();
|
|
18739
18740
|
function enquoteDoctypeId(id) {
|
|
18740
18741
|
const quote = id.includes("\"") ? "'" : "\"";
|
|
@@ -18922,8 +18923,8 @@ var require_parse5_adapter = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18922
18923
|
exports.parseWithParse5 = parseWithParse5;
|
|
18923
18924
|
exports.renderWithParse5 = renderWithParse5;
|
|
18924
18925
|
const domhandler_1 = require_lib$13();
|
|
18925
|
-
const parse5_1 = require_cjs$
|
|
18926
|
-
const parse5_htmlparser2_tree_adapter_1 = require_cjs$
|
|
18926
|
+
const parse5_1 = require_cjs$2();
|
|
18927
|
+
const parse5_htmlparser2_tree_adapter_1 = require_cjs$1();
|
|
18927
18928
|
/**
|
|
18928
18929
|
* Parse the content with `parse5` in the context of the given `ParentNode`.
|
|
18929
18930
|
*
|
|
@@ -18993,11 +18994,11 @@ var require_load_parse = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18993
18994
|
}));
|
|
18994
18995
|
//#endregion
|
|
18995
18996
|
//#region node_modules/parse5-parser-stream/dist/cjs/index.js
|
|
18996
|
-
var require_cjs
|
|
18997
|
+
var require_cjs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
18997
18998
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18998
18999
|
exports.ParserStream = void 0;
|
|
18999
19000
|
const node_stream_1$2 = __require("node:stream");
|
|
19000
|
-
const parse5_1 = require_cjs$
|
|
19001
|
+
const parse5_1 = require_cjs$2();
|
|
19001
19002
|
exports.ParserStream = class ParserStream extends node_stream_1$2.Writable {
|
|
19002
19003
|
static getFragmentStream(fragmentContext, options) {
|
|
19003
19004
|
return new ParserStream(options, parse5_1.Parser.getFragmentParser(fragmentContext, options));
|
|
@@ -39404,10 +39405,10 @@ var require_stats$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
39404
39405
|
//#region node_modules/cheerio/node_modules/undici/lib/core/diagnostics.js
|
|
39405
39406
|
var require_diagnostics$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
39406
39407
|
const diagnosticsChannel$3 = __require("node:diagnostics_channel");
|
|
39407
|
-
const util$
|
|
39408
|
-
const undiciDebugLog = util$
|
|
39409
|
-
const fetchDebuglog = util$
|
|
39410
|
-
const websocketDebuglog = util$
|
|
39408
|
+
const util$5 = __require("node:util");
|
|
39409
|
+
const undiciDebugLog = util$5.debuglog("undici");
|
|
39410
|
+
const fetchDebuglog = util$5.debuglog("fetch");
|
|
39411
|
+
const websocketDebuglog = util$5.debuglog("websocket");
|
|
39411
39412
|
const channels = {
|
|
39412
39413
|
beforeConnect: diagnosticsChannel$3.channel("undici:client:beforeConnect"),
|
|
39413
39414
|
connected: diagnosticsChannel$3.channel("undici:client:connected"),
|
|
@@ -54013,7 +54014,7 @@ var require_headers$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
54013
54014
|
const { iteratorMixin, isValidHeaderName, isValidHeaderValue } = require_util$11();
|
|
54014
54015
|
const { webidl } = require_webidl$1();
|
|
54015
54016
|
const assert$44 = __require("node:assert");
|
|
54016
|
-
const util$
|
|
54017
|
+
const util$4 = __require("node:util");
|
|
54017
54018
|
/**
|
|
54018
54019
|
* @param {number} code
|
|
54019
54020
|
* @returns {code is (0x0a | 0x0d | 0x09 | 0x20)}
|
|
@@ -54329,9 +54330,9 @@ var require_headers$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
54329
54330
|
if (list) return [...list];
|
|
54330
54331
|
return [];
|
|
54331
54332
|
}
|
|
54332
|
-
[util$
|
|
54333
|
+
[util$4.inspect.custom](depth, options) {
|
|
54333
54334
|
options.depth ??= depth;
|
|
54334
|
-
return `Headers ${util$
|
|
54335
|
+
return `Headers ${util$4.formatWithOptions(options, this.#headersList.entries)}`;
|
|
54335
54336
|
}
|
|
54336
54337
|
static getHeadersGuard(o) {
|
|
54337
54338
|
return o.#guard;
|
|
@@ -54370,12 +54371,12 @@ var require_headers$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
54370
54371
|
value: "Headers",
|
|
54371
54372
|
configurable: true
|
|
54372
54373
|
},
|
|
54373
|
-
[util$
|
|
54374
|
+
[util$4.inspect.custom]: { enumerable: false }
|
|
54374
54375
|
});
|
|
54375
54376
|
webidl.converters.HeadersInit = function(V, prefix, argument) {
|
|
54376
54377
|
if (webidl.util.Type(V) === webidl.util.Types.OBJECT) {
|
|
54377
54378
|
const iterator = Reflect.get(V, Symbol.iterator);
|
|
54378
|
-
if (!util$
|
|
54379
|
+
if (!util$4.types.isProxy(V) && iterator === Headers.prototype.entries) try {
|
|
54379
54380
|
return getHeadersList(V).entriesList;
|
|
54380
54381
|
} catch {}
|
|
54381
54382
|
if (typeof iterator === "function") return webidl.converters["sequence<sequence<ByteString>>"](V, prefix, argument, iterator.bind(V));
|
|
@@ -60571,9 +60572,9 @@ var require_commonjs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
60571
60572
|
return static_js_1.merge;
|
|
60572
60573
|
}
|
|
60573
60574
|
});
|
|
60574
|
-
const parse5_htmlparser2_tree_adapter_1 = require_cjs$
|
|
60575
|
+
const parse5_htmlparser2_tree_adapter_1 = require_cjs$1();
|
|
60575
60576
|
const htmlparser2 = __importStar(require_commonjs$3());
|
|
60576
|
-
const parse5_parser_stream_1 = require_cjs
|
|
60577
|
+
const parse5_parser_stream_1 = require_cjs();
|
|
60577
60578
|
const encoding_sniffer_1 = require_commonjs$1();
|
|
60578
60579
|
const undici = __importStar(require_undici$1());
|
|
60579
60580
|
const whatwg_mimetype_1 = __importDefault(require_mime_type());
|
|
@@ -70425,10 +70426,10 @@ var require_stats = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
70425
70426
|
//#region node_modules/open-graph-scraper/node_modules/undici/lib/core/diagnostics.js
|
|
70426
70427
|
var require_diagnostics = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
70427
70428
|
const diagnosticsChannel$1 = __require("node:diagnostics_channel");
|
|
70428
|
-
const util$
|
|
70429
|
-
const undiciDebugLog = util$
|
|
70430
|
-
const fetchDebuglog = util$
|
|
70431
|
-
const websocketDebuglog = util$
|
|
70429
|
+
const util$3 = __require("node:util");
|
|
70430
|
+
const undiciDebugLog = util$3.debuglog("undici");
|
|
70431
|
+
const fetchDebuglog = util$3.debuglog("fetch");
|
|
70432
|
+
const websocketDebuglog = util$3.debuglog("websocket");
|
|
70432
70433
|
const channels = {
|
|
70433
70434
|
beforeConnect: diagnosticsChannel$1.channel("undici:client:beforeConnect"),
|
|
70434
70435
|
connected: diagnosticsChannel$1.channel("undici:client:connected"),
|
|
@@ -85034,7 +85035,7 @@ var require_headers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
85034
85035
|
const { iteratorMixin, isValidHeaderName, isValidHeaderValue } = require_util$5();
|
|
85035
85036
|
const { webidl } = require_webidl();
|
|
85036
85037
|
const assert$11 = __require("node:assert");
|
|
85037
|
-
const util$
|
|
85038
|
+
const util$2 = __require("node:util");
|
|
85038
85039
|
/**
|
|
85039
85040
|
* @param {number} code
|
|
85040
85041
|
* @returns {code is (0x0a | 0x0d | 0x09 | 0x20)}
|
|
@@ -85350,9 +85351,9 @@ var require_headers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
85350
85351
|
if (list) return [...list];
|
|
85351
85352
|
return [];
|
|
85352
85353
|
}
|
|
85353
|
-
[util$
|
|
85354
|
+
[util$2.inspect.custom](depth, options) {
|
|
85354
85355
|
options.depth ??= depth;
|
|
85355
|
-
return `Headers ${util$
|
|
85356
|
+
return `Headers ${util$2.formatWithOptions(options, this.#headersList.entries)}`;
|
|
85356
85357
|
}
|
|
85357
85358
|
static getHeadersGuard(o) {
|
|
85358
85359
|
return o.#guard;
|
|
@@ -85391,12 +85392,12 @@ var require_headers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
85391
85392
|
value: "Headers",
|
|
85392
85393
|
configurable: true
|
|
85393
85394
|
},
|
|
85394
|
-
[util$
|
|
85395
|
+
[util$2.inspect.custom]: { enumerable: false }
|
|
85395
85396
|
});
|
|
85396
85397
|
webidl.converters.HeadersInit = function(V, prefix, argument) {
|
|
85397
85398
|
if (webidl.util.Type(V) === webidl.util.Types.OBJECT) {
|
|
85398
85399
|
const iterator = Reflect.get(V, Symbol.iterator);
|
|
85399
|
-
if (!util$
|
|
85400
|
+
if (!util$2.types.isProxy(V) && iterator === Headers.prototype.entries) try {
|
|
85400
85401
|
return getHeadersList(V).entriesList;
|
|
85401
85402
|
} catch {}
|
|
85402
85403
|
if (typeof iterator === "function") return webidl.converters["sequence<sequence<ByteString>>"](V, prefix, argument, iterator.bind(V));
|
|
@@ -100612,7 +100613,7 @@ var require_node$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
100612
100613
|
* Module dependencies.
|
|
100613
100614
|
*/
|
|
100614
100615
|
var tty$1 = __require("tty");
|
|
100615
|
-
var util$
|
|
100616
|
+
var util$1 = __require("util");
|
|
100616
100617
|
/**
|
|
100617
100618
|
* This is the Node.js implementation of `debug()`.
|
|
100618
100619
|
*
|
|
@@ -100662,7 +100663,7 @@ var require_node$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
100662
100663
|
* $ DEBUG_FD=3 node script.js 3>debug.log
|
|
100663
100664
|
*/
|
|
100664
100665
|
var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
|
|
100665
|
-
if (1 !== fd && 2 !== fd) util$
|
|
100666
|
+
if (1 !== fd && 2 !== fd) util$1.deprecate(function() {}, "except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)")();
|
|
100666
100667
|
var stream = 1 === fd ? process.stdout : 2 === fd ? process.stderr : createWritableStdioStream(fd);
|
|
100667
100668
|
/**
|
|
100668
100669
|
* Is stdout a TTY? Colored output is enabled when `true`.
|
|
@@ -100675,7 +100676,7 @@ var require_node$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
100675
100676
|
*/
|
|
100676
100677
|
exports.formatters.o = function(v) {
|
|
100677
100678
|
this.inspectOpts.colors = this.useColors;
|
|
100678
|
-
return util$
|
|
100679
|
+
return util$1.inspect(v, this.inspectOpts).split("\n").map(function(str) {
|
|
100679
100680
|
return str.trim();
|
|
100680
100681
|
}).join(" ");
|
|
100681
100682
|
};
|
|
@@ -100684,7 +100685,7 @@ var require_node$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
100684
100685
|
*/
|
|
100685
100686
|
exports.formatters.O = function(v) {
|
|
100686
100687
|
this.inspectOpts.colors = this.useColors;
|
|
100687
|
-
return util$
|
|
100688
|
+
return util$1.inspect(v, this.inspectOpts);
|
|
100688
100689
|
};
|
|
100689
100690
|
/**
|
|
100690
100691
|
* Adds ANSI color escape codes if enabled.
|
|
@@ -100704,7 +100705,7 @@ var require_node$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
100704
100705
|
* Invokes `util.format()` with the specified arguments and writes to `stream`.
|
|
100705
100706
|
*/
|
|
100706
100707
|
function log() {
|
|
100707
|
-
return stream.write(util$
|
|
100708
|
+
return stream.write(util$1.format.apply(util$1, arguments) + "\n");
|
|
100708
100709
|
}
|
|
100709
100710
|
/**
|
|
100710
100711
|
* Save `namespaces`.
|
|
@@ -100779,7 +100780,7 @@ var require_node$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
100779
100780
|
}));
|
|
100780
100781
|
//#endregion
|
|
100781
100782
|
//#region node_modules/stream-parser/node_modules/debug/src/index.js
|
|
100782
|
-
var require_src$
|
|
100783
|
+
var require_src$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
100783
100784
|
/**
|
|
100784
100785
|
* Detect Electron renderer process, which is node, but we should
|
|
100785
100786
|
* treat as a browser.
|
|
@@ -100794,7 +100795,7 @@ var require_stream_parser = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
100794
100795
|
* Module dependencies.
|
|
100795
100796
|
*/
|
|
100796
100797
|
var assert$1 = __require("assert");
|
|
100797
|
-
var debug = require_src$
|
|
100798
|
+
var debug = require_src$1()("stream-parser");
|
|
100798
100799
|
/**
|
|
100799
100800
|
* Module exports.
|
|
100800
100801
|
*/
|
|
@@ -102636,7 +102637,7 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
102636
102637
|
* Module dependencies.
|
|
102637
102638
|
*/
|
|
102638
102639
|
var tty = __require("tty");
|
|
102639
|
-
var util
|
|
102640
|
+
var util = __require("util");
|
|
102640
102641
|
/**
|
|
102641
102642
|
* This is the Node.js implementation of `debug()`.
|
|
102642
102643
|
*/
|
|
@@ -102786,7 +102787,7 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
102786
102787
|
* Invokes `util.format()` with the specified arguments and writes to stderr.
|
|
102787
102788
|
*/
|
|
102788
102789
|
function log() {
|
|
102789
|
-
return process.stderr.write(util
|
|
102790
|
+
return process.stderr.write(util.format.apply(util, arguments) + "\n");
|
|
102790
102791
|
}
|
|
102791
102792
|
/**
|
|
102792
102793
|
* Save `namespaces`.
|
|
@@ -102825,7 +102826,7 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
102825
102826
|
*/
|
|
102826
102827
|
formatters.o = function(v) {
|
|
102827
102828
|
this.inspectOpts.colors = this.useColors;
|
|
102828
|
-
return util
|
|
102829
|
+
return util.inspect(v, this.inspectOpts).split("\n").map(function(str) {
|
|
102829
102830
|
return str.trim();
|
|
102830
102831
|
}).join(" ");
|
|
102831
102832
|
};
|
|
@@ -102834,12 +102835,12 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
102834
102835
|
*/
|
|
102835
102836
|
formatters.O = function(v) {
|
|
102836
102837
|
this.inspectOpts.colors = this.useColors;
|
|
102837
|
-
return util
|
|
102838
|
+
return util.inspect(v, this.inspectOpts);
|
|
102838
102839
|
};
|
|
102839
102840
|
}));
|
|
102840
102841
|
//#endregion
|
|
102841
102842
|
//#region node_modules/needle/node_modules/debug/src/index.js
|
|
102842
|
-
var require_src
|
|
102843
|
+
var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
102843
102844
|
/**
|
|
102844
102845
|
* Detect Electron renderer / nwjs process, which is node, but we should
|
|
102845
102846
|
* treat as a browser.
|
|
@@ -112975,7 +112976,7 @@ var require_package$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
112975
112976
|
//#endregion
|
|
112976
112977
|
//#region node_modules/needle/lib/needle.js
|
|
112977
112978
|
var require_needle = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
112978
|
-
var fs$2 = __require("fs"), http$1 = __require("http"), https = __require("https"), url = __require("url"), stream = __require("stream"), debug = require_src
|
|
112979
|
+
var fs$2 = __require("fs"), http$1 = __require("http"), https = __require("https"), url = __require("url"), stream = __require("stream"), debug = require_src()("needle"), stringify$1 = require_querystring().build, multipart = require_multipart(), auth = require_auth(), cookies = require_cookies(), parsers = require_parsers(), decoder = require_decoder();
|
|
112979
112980
|
var version = require_package$1().version;
|
|
112980
112981
|
var user_agent = "Needle/" + version;
|
|
112981
112982
|
user_agent += " (Node.js " + process.version + "; " + process.platform + " " + process.arch + ")";
|
|
@@ -116232,1401 +116233,106 @@ function t(n) {
|
|
|
116232
116233
|
return r;
|
|
116233
116234
|
}
|
|
116234
116235
|
//#endregion
|
|
116235
|
-
//#region
|
|
116236
|
-
var
|
|
116237
|
-
|
|
116238
|
-
|
|
116239
|
-
|
|
116240
|
-
|
|
116241
|
-
|
|
116242
|
-
|
|
116243
|
-
|
|
116244
|
-
|
|
116236
|
+
//#region dist/node/runtime/node/community/start-lock.js
|
|
116237
|
+
var import_retry = /* @__PURE__ */ __toESM(require_retry$2(), 1);
|
|
116238
|
+
const START_LOCK_SCHEMA = "startlock";
|
|
116239
|
+
const START_LOCK_FILE_SUFFIX = ".start.lock.db";
|
|
116240
|
+
const TAKE_START_LOCK_BUSY_TIMEOUT_MS = 100;
|
|
116241
|
+
function getStartLockPath({ dataPath, communityAddress }) {
|
|
116242
|
+
return path.join(dataPath, "communities", `${communityAddress}${START_LOCK_FILE_SUFFIX}`);
|
|
116243
|
+
}
|
|
116244
|
+
const isSqliteBusyError = (error) => typeof error?.code === "string" && error.code.startsWith("SQLITE_BUSY");
|
|
116245
|
+
const SQLITE_PENDING_BYTE_OFFSET = 1073741824;
|
|
116246
|
+
function isCommunityStartLockedOnWindows(startLockPath) {
|
|
116247
|
+
let fd;
|
|
116245
116248
|
try {
|
|
116246
|
-
|
|
116247
|
-
} catch (
|
|
116248
|
-
|
|
116249
|
-
|
|
116250
|
-
process.chdir = function(d) {
|
|
116251
|
-
cwd = null;
|
|
116252
|
-
chdir.call(process, d);
|
|
116253
|
-
};
|
|
116254
|
-
if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir);
|
|
116255
|
-
}
|
|
116256
|
-
module.exports = patch;
|
|
116257
|
-
function patch(fs) {
|
|
116258
|
-
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) patchLchmod(fs);
|
|
116259
|
-
if (!fs.lutimes) patchLutimes(fs);
|
|
116260
|
-
fs.chown = chownFix(fs.chown);
|
|
116261
|
-
fs.fchown = chownFix(fs.fchown);
|
|
116262
|
-
fs.lchown = chownFix(fs.lchown);
|
|
116263
|
-
fs.chmod = chmodFix(fs.chmod);
|
|
116264
|
-
fs.fchmod = chmodFix(fs.fchmod);
|
|
116265
|
-
fs.lchmod = chmodFix(fs.lchmod);
|
|
116266
|
-
fs.chownSync = chownFixSync(fs.chownSync);
|
|
116267
|
-
fs.fchownSync = chownFixSync(fs.fchownSync);
|
|
116268
|
-
fs.lchownSync = chownFixSync(fs.lchownSync);
|
|
116269
|
-
fs.chmodSync = chmodFixSync(fs.chmodSync);
|
|
116270
|
-
fs.fchmodSync = chmodFixSync(fs.fchmodSync);
|
|
116271
|
-
fs.lchmodSync = chmodFixSync(fs.lchmodSync);
|
|
116272
|
-
fs.stat = statFix(fs.stat);
|
|
116273
|
-
fs.fstat = statFix(fs.fstat);
|
|
116274
|
-
fs.lstat = statFix(fs.lstat);
|
|
116275
|
-
fs.statSync = statFixSync(fs.statSync);
|
|
116276
|
-
fs.fstatSync = statFixSync(fs.fstatSync);
|
|
116277
|
-
fs.lstatSync = statFixSync(fs.lstatSync);
|
|
116278
|
-
if (fs.chmod && !fs.lchmod) {
|
|
116279
|
-
fs.lchmod = function(path, mode, cb) {
|
|
116280
|
-
if (cb) process.nextTick(cb);
|
|
116281
|
-
};
|
|
116282
|
-
fs.lchmodSync = function() {};
|
|
116283
|
-
}
|
|
116284
|
-
if (fs.chown && !fs.lchown) {
|
|
116285
|
-
fs.lchown = function(path, uid, gid, cb) {
|
|
116286
|
-
if (cb) process.nextTick(cb);
|
|
116287
|
-
};
|
|
116288
|
-
fs.lchownSync = function() {};
|
|
116289
|
-
}
|
|
116290
|
-
if (platform === "win32") fs.rename = typeof fs.rename !== "function" ? fs.rename : (function(fs$rename) {
|
|
116291
|
-
function rename(from, to, cb) {
|
|
116292
|
-
var start = Date.now();
|
|
116293
|
-
var backoff = 0;
|
|
116294
|
-
fs$rename(from, to, function CB(er) {
|
|
116295
|
-
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
116296
|
-
setTimeout(function() {
|
|
116297
|
-
fs.stat(to, function(stater, st) {
|
|
116298
|
-
if (stater && stater.code === "ENOENT") fs$rename(from, to, CB);
|
|
116299
|
-
else cb(er);
|
|
116300
|
-
});
|
|
116301
|
-
}, backoff);
|
|
116302
|
-
if (backoff < 100) backoff += 10;
|
|
116303
|
-
return;
|
|
116304
|
-
}
|
|
116305
|
-
if (cb) cb(er);
|
|
116306
|
-
});
|
|
116307
|
-
}
|
|
116308
|
-
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
|
116309
|
-
return rename;
|
|
116310
|
-
})(fs.rename);
|
|
116311
|
-
fs.read = typeof fs.read !== "function" ? fs.read : (function(fs$read) {
|
|
116312
|
-
function read(fd, buffer, offset, length, position, callback_) {
|
|
116313
|
-
var callback;
|
|
116314
|
-
if (callback_ && typeof callback_ === "function") {
|
|
116315
|
-
var eagCounter = 0;
|
|
116316
|
-
callback = function(er, _, __) {
|
|
116317
|
-
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
116318
|
-
eagCounter++;
|
|
116319
|
-
return fs$read.call(fs, fd, buffer, offset, length, position, callback);
|
|
116320
|
-
}
|
|
116321
|
-
callback_.apply(this, arguments);
|
|
116322
|
-
};
|
|
116323
|
-
}
|
|
116324
|
-
return fs$read.call(fs, fd, buffer, offset, length, position, callback);
|
|
116325
|
-
}
|
|
116326
|
-
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
|
|
116327
|
-
return read;
|
|
116328
|
-
})(fs.read);
|
|
116329
|
-
fs.readSync = typeof fs.readSync !== "function" ? fs.readSync : (function(fs$readSync) {
|
|
116330
|
-
return function(fd, buffer, offset, length, position) {
|
|
116331
|
-
var eagCounter = 0;
|
|
116332
|
-
while (true) try {
|
|
116333
|
-
return fs$readSync.call(fs, fd, buffer, offset, length, position);
|
|
116334
|
-
} catch (er) {
|
|
116335
|
-
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
116336
|
-
eagCounter++;
|
|
116337
|
-
continue;
|
|
116338
|
-
}
|
|
116339
|
-
throw er;
|
|
116340
|
-
}
|
|
116341
|
-
};
|
|
116342
|
-
})(fs.readSync);
|
|
116343
|
-
function patchLchmod(fs) {
|
|
116344
|
-
fs.lchmod = function(path, mode, callback) {
|
|
116345
|
-
fs.open(path, constants.O_WRONLY | constants.O_SYMLINK, mode, function(err, fd) {
|
|
116346
|
-
if (err) {
|
|
116347
|
-
if (callback) callback(err);
|
|
116348
|
-
return;
|
|
116349
|
-
}
|
|
116350
|
-
fs.fchmod(fd, mode, function(err) {
|
|
116351
|
-
fs.close(fd, function(err2) {
|
|
116352
|
-
if (callback) callback(err || err2);
|
|
116353
|
-
});
|
|
116354
|
-
});
|
|
116355
|
-
});
|
|
116356
|
-
};
|
|
116357
|
-
fs.lchmodSync = function(path, mode) {
|
|
116358
|
-
var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
116359
|
-
var threw = true;
|
|
116360
|
-
var ret;
|
|
116361
|
-
try {
|
|
116362
|
-
ret = fs.fchmodSync(fd, mode);
|
|
116363
|
-
threw = false;
|
|
116364
|
-
} finally {
|
|
116365
|
-
if (threw) try {
|
|
116366
|
-
fs.closeSync(fd);
|
|
116367
|
-
} catch (er) {}
|
|
116368
|
-
else fs.closeSync(fd);
|
|
116369
|
-
}
|
|
116370
|
-
return ret;
|
|
116371
|
-
};
|
|
116372
|
-
}
|
|
116373
|
-
function patchLutimes(fs) {
|
|
116374
|
-
if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) {
|
|
116375
|
-
fs.lutimes = function(path, at, mt, cb) {
|
|
116376
|
-
fs.open(path, constants.O_SYMLINK, function(er, fd) {
|
|
116377
|
-
if (er) {
|
|
116378
|
-
if (cb) cb(er);
|
|
116379
|
-
return;
|
|
116380
|
-
}
|
|
116381
|
-
fs.futimes(fd, at, mt, function(er) {
|
|
116382
|
-
fs.close(fd, function(er2) {
|
|
116383
|
-
if (cb) cb(er || er2);
|
|
116384
|
-
});
|
|
116385
|
-
});
|
|
116386
|
-
});
|
|
116387
|
-
};
|
|
116388
|
-
fs.lutimesSync = function(path, at, mt) {
|
|
116389
|
-
var fd = fs.openSync(path, constants.O_SYMLINK);
|
|
116390
|
-
var ret;
|
|
116391
|
-
var threw = true;
|
|
116392
|
-
try {
|
|
116393
|
-
ret = fs.futimesSync(fd, at, mt);
|
|
116394
|
-
threw = false;
|
|
116395
|
-
} finally {
|
|
116396
|
-
if (threw) try {
|
|
116397
|
-
fs.closeSync(fd);
|
|
116398
|
-
} catch (er) {}
|
|
116399
|
-
else fs.closeSync(fd);
|
|
116400
|
-
}
|
|
116401
|
-
return ret;
|
|
116402
|
-
};
|
|
116403
|
-
} else if (fs.futimes) {
|
|
116404
|
-
fs.lutimes = function(_a, _b, _c, cb) {
|
|
116405
|
-
if (cb) process.nextTick(cb);
|
|
116406
|
-
};
|
|
116407
|
-
fs.lutimesSync = function() {};
|
|
116408
|
-
}
|
|
116409
|
-
}
|
|
116410
|
-
function chmodFix(orig) {
|
|
116411
|
-
if (!orig) return orig;
|
|
116412
|
-
return function(target, mode, cb) {
|
|
116413
|
-
return orig.call(fs, target, mode, function(er) {
|
|
116414
|
-
if (chownErOk(er)) er = null;
|
|
116415
|
-
if (cb) cb.apply(this, arguments);
|
|
116416
|
-
});
|
|
116417
|
-
};
|
|
116418
|
-
}
|
|
116419
|
-
function chmodFixSync(orig) {
|
|
116420
|
-
if (!orig) return orig;
|
|
116421
|
-
return function(target, mode) {
|
|
116422
|
-
try {
|
|
116423
|
-
return orig.call(fs, target, mode);
|
|
116424
|
-
} catch (er) {
|
|
116425
|
-
if (!chownErOk(er)) throw er;
|
|
116426
|
-
}
|
|
116427
|
-
};
|
|
116428
|
-
}
|
|
116429
|
-
function chownFix(orig) {
|
|
116430
|
-
if (!orig) return orig;
|
|
116431
|
-
return function(target, uid, gid, cb) {
|
|
116432
|
-
return orig.call(fs, target, uid, gid, function(er) {
|
|
116433
|
-
if (chownErOk(er)) er = null;
|
|
116434
|
-
if (cb) cb.apply(this, arguments);
|
|
116435
|
-
});
|
|
116436
|
-
};
|
|
116437
|
-
}
|
|
116438
|
-
function chownFixSync(orig) {
|
|
116439
|
-
if (!orig) return orig;
|
|
116440
|
-
return function(target, uid, gid) {
|
|
116441
|
-
try {
|
|
116442
|
-
return orig.call(fs, target, uid, gid);
|
|
116443
|
-
} catch (er) {
|
|
116444
|
-
if (!chownErOk(er)) throw er;
|
|
116445
|
-
}
|
|
116446
|
-
};
|
|
116447
|
-
}
|
|
116448
|
-
function statFix(orig) {
|
|
116449
|
-
if (!orig) return orig;
|
|
116450
|
-
return function(target, options, cb) {
|
|
116451
|
-
if (typeof options === "function") {
|
|
116452
|
-
cb = options;
|
|
116453
|
-
options = null;
|
|
116454
|
-
}
|
|
116455
|
-
function callback(er, stats) {
|
|
116456
|
-
if (stats) {
|
|
116457
|
-
if (stats.uid < 0) stats.uid += 4294967296;
|
|
116458
|
-
if (stats.gid < 0) stats.gid += 4294967296;
|
|
116459
|
-
}
|
|
116460
|
-
if (cb) cb.apply(this, arguments);
|
|
116461
|
-
}
|
|
116462
|
-
return options ? orig.call(fs, target, options, callback) : orig.call(fs, target, callback);
|
|
116463
|
-
};
|
|
116464
|
-
}
|
|
116465
|
-
function statFixSync(orig) {
|
|
116466
|
-
if (!orig) return orig;
|
|
116467
|
-
return function(target, options) {
|
|
116468
|
-
var stats = options ? orig.call(fs, target, options) : orig.call(fs, target);
|
|
116469
|
-
if (stats) {
|
|
116470
|
-
if (stats.uid < 0) stats.uid += 4294967296;
|
|
116471
|
-
if (stats.gid < 0) stats.gid += 4294967296;
|
|
116472
|
-
}
|
|
116473
|
-
return stats;
|
|
116474
|
-
};
|
|
116475
|
-
}
|
|
116476
|
-
function chownErOk(er) {
|
|
116477
|
-
if (!er) return true;
|
|
116478
|
-
if (er.code === "ENOSYS") return true;
|
|
116479
|
-
if (!process.getuid || process.getuid() !== 0) {
|
|
116480
|
-
if (er.code === "EINVAL" || er.code === "EPERM") return true;
|
|
116481
|
-
}
|
|
116482
|
-
return false;
|
|
116483
|
-
}
|
|
116484
|
-
}
|
|
116485
|
-
}));
|
|
116486
|
-
//#endregion
|
|
116487
|
-
//#region node_modules/graceful-fs/legacy-streams.js
|
|
116488
|
-
var require_legacy_streams = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
116489
|
-
var Stream = __require("stream").Stream;
|
|
116490
|
-
module.exports = legacy;
|
|
116491
|
-
function legacy(fs) {
|
|
116492
|
-
return {
|
|
116493
|
-
ReadStream,
|
|
116494
|
-
WriteStream
|
|
116495
|
-
};
|
|
116496
|
-
function ReadStream(path, options) {
|
|
116497
|
-
if (!(this instanceof ReadStream)) return new ReadStream(path, options);
|
|
116498
|
-
Stream.call(this);
|
|
116499
|
-
var self = this;
|
|
116500
|
-
this.path = path;
|
|
116501
|
-
this.fd = null;
|
|
116502
|
-
this.readable = true;
|
|
116503
|
-
this.paused = false;
|
|
116504
|
-
this.flags = "r";
|
|
116505
|
-
this.mode = 438;
|
|
116506
|
-
this.bufferSize = 64 * 1024;
|
|
116507
|
-
options = options || {};
|
|
116508
|
-
var keys = Object.keys(options);
|
|
116509
|
-
for (var index = 0, length = keys.length; index < length; index++) {
|
|
116510
|
-
var key = keys[index];
|
|
116511
|
-
this[key] = options[key];
|
|
116512
|
-
}
|
|
116513
|
-
if (this.encoding) this.setEncoding(this.encoding);
|
|
116514
|
-
if (this.start !== void 0) {
|
|
116515
|
-
if ("number" !== typeof this.start) throw TypeError("start must be a Number");
|
|
116516
|
-
if (this.end === void 0) this.end = Infinity;
|
|
116517
|
-
else if ("number" !== typeof this.end) throw TypeError("end must be a Number");
|
|
116518
|
-
if (this.start > this.end) throw new Error("start must be <= end");
|
|
116519
|
-
this.pos = this.start;
|
|
116520
|
-
}
|
|
116521
|
-
if (this.fd !== null) {
|
|
116522
|
-
process.nextTick(function() {
|
|
116523
|
-
self._read();
|
|
116524
|
-
});
|
|
116525
|
-
return;
|
|
116526
|
-
}
|
|
116527
|
-
fs.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
116528
|
-
if (err) {
|
|
116529
|
-
self.emit("error", err);
|
|
116530
|
-
self.readable = false;
|
|
116531
|
-
return;
|
|
116532
|
-
}
|
|
116533
|
-
self.fd = fd;
|
|
116534
|
-
self.emit("open", fd);
|
|
116535
|
-
self._read();
|
|
116536
|
-
});
|
|
116537
|
-
}
|
|
116538
|
-
function WriteStream(path, options) {
|
|
116539
|
-
if (!(this instanceof WriteStream)) return new WriteStream(path, options);
|
|
116540
|
-
Stream.call(this);
|
|
116541
|
-
this.path = path;
|
|
116542
|
-
this.fd = null;
|
|
116543
|
-
this.writable = true;
|
|
116544
|
-
this.flags = "w";
|
|
116545
|
-
this.encoding = "binary";
|
|
116546
|
-
this.mode = 438;
|
|
116547
|
-
this.bytesWritten = 0;
|
|
116548
|
-
options = options || {};
|
|
116549
|
-
var keys = Object.keys(options);
|
|
116550
|
-
for (var index = 0, length = keys.length; index < length; index++) {
|
|
116551
|
-
var key = keys[index];
|
|
116552
|
-
this[key] = options[key];
|
|
116553
|
-
}
|
|
116554
|
-
if (this.start !== void 0) {
|
|
116555
|
-
if ("number" !== typeof this.start) throw TypeError("start must be a Number");
|
|
116556
|
-
if (this.start < 0) throw new Error("start must be >= zero");
|
|
116557
|
-
this.pos = this.start;
|
|
116558
|
-
}
|
|
116559
|
-
this.busy = false;
|
|
116560
|
-
this._queue = [];
|
|
116561
|
-
if (this.fd === null) {
|
|
116562
|
-
this._open = fs.open;
|
|
116563
|
-
this._queue.push([
|
|
116564
|
-
this._open,
|
|
116565
|
-
this.path,
|
|
116566
|
-
this.flags,
|
|
116567
|
-
this.mode,
|
|
116568
|
-
void 0
|
|
116569
|
-
]);
|
|
116570
|
-
this.flush();
|
|
116571
|
-
}
|
|
116572
|
-
}
|
|
116573
|
-
}
|
|
116574
|
-
}));
|
|
116575
|
-
//#endregion
|
|
116576
|
-
//#region node_modules/graceful-fs/clone.js
|
|
116577
|
-
var require_clone = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
116578
|
-
module.exports = clone;
|
|
116579
|
-
var getPrototypeOf = Object.getPrototypeOf || function(obj) {
|
|
116580
|
-
return obj.__proto__;
|
|
116581
|
-
};
|
|
116582
|
-
function clone(obj) {
|
|
116583
|
-
if (obj === null || typeof obj !== "object") return obj;
|
|
116584
|
-
if (obj instanceof Object) var copy = { __proto__: getPrototypeOf(obj) };
|
|
116585
|
-
else var copy = Object.create(null);
|
|
116586
|
-
Object.getOwnPropertyNames(obj).forEach(function(key) {
|
|
116587
|
-
Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
|
|
116588
|
-
});
|
|
116589
|
-
return copy;
|
|
116590
|
-
}
|
|
116591
|
-
}));
|
|
116592
|
-
//#endregion
|
|
116593
|
-
//#region node_modules/graceful-fs/graceful-fs.js
|
|
116594
|
-
var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
116595
|
-
var fs$1 = __require("fs");
|
|
116596
|
-
var polyfills = require_polyfills();
|
|
116597
|
-
var legacy = require_legacy_streams();
|
|
116598
|
-
var clone = require_clone();
|
|
116599
|
-
var util = __require("util");
|
|
116600
|
-
/* istanbul ignore next - node 0.x polyfill */
|
|
116601
|
-
var gracefulQueue;
|
|
116602
|
-
var previousSymbol;
|
|
116603
|
-
/* istanbul ignore else - node 0.x polyfill */
|
|
116604
|
-
if (typeof Symbol === "function" && typeof Symbol.for === "function") {
|
|
116605
|
-
gracefulQueue = Symbol.for("graceful-fs.queue");
|
|
116606
|
-
previousSymbol = Symbol.for("graceful-fs.previous");
|
|
116607
|
-
} else {
|
|
116608
|
-
gracefulQueue = "___graceful-fs.queue";
|
|
116609
|
-
previousSymbol = "___graceful-fs.previous";
|
|
116610
|
-
}
|
|
116611
|
-
function noop() {}
|
|
116612
|
-
function publishQueue(context, queue) {
|
|
116613
|
-
Object.defineProperty(context, gracefulQueue, { get: function() {
|
|
116614
|
-
return queue;
|
|
116615
|
-
} });
|
|
116616
|
-
}
|
|
116617
|
-
var debug = noop;
|
|
116618
|
-
if (util.debuglog) debug = util.debuglog("gfs4");
|
|
116619
|
-
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) debug = function() {
|
|
116620
|
-
var m = util.format.apply(util, arguments);
|
|
116621
|
-
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
116622
|
-
console.error(m);
|
|
116623
|
-
};
|
|
116624
|
-
if (!fs$1[gracefulQueue]) {
|
|
116625
|
-
publishQueue(fs$1, global[gracefulQueue] || []);
|
|
116626
|
-
fs$1.close = (function(fs$close) {
|
|
116627
|
-
function close(fd, cb) {
|
|
116628
|
-
return fs$close.call(fs$1, fd, function(err) {
|
|
116629
|
-
if (!err) resetQueue();
|
|
116630
|
-
if (typeof cb === "function") cb.apply(this, arguments);
|
|
116631
|
-
});
|
|
116632
|
-
}
|
|
116633
|
-
Object.defineProperty(close, previousSymbol, { value: fs$close });
|
|
116634
|
-
return close;
|
|
116635
|
-
})(fs$1.close);
|
|
116636
|
-
fs$1.closeSync = (function(fs$closeSync) {
|
|
116637
|
-
function closeSync(fd) {
|
|
116638
|
-
fs$closeSync.apply(fs$1, arguments);
|
|
116639
|
-
resetQueue();
|
|
116640
|
-
}
|
|
116641
|
-
Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync });
|
|
116642
|
-
return closeSync;
|
|
116643
|
-
})(fs$1.closeSync);
|
|
116644
|
-
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) process.on("exit", function() {
|
|
116645
|
-
debug(fs$1[gracefulQueue]);
|
|
116646
|
-
__require("assert").equal(fs$1[gracefulQueue].length, 0);
|
|
116647
|
-
});
|
|
116648
|
-
}
|
|
116649
|
-
if (!global[gracefulQueue]) publishQueue(global, fs$1[gracefulQueue]);
|
|
116650
|
-
module.exports = patch(clone(fs$1));
|
|
116651
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs$1.__patched) {
|
|
116652
|
-
module.exports = patch(fs$1);
|
|
116653
|
-
fs$1.__patched = true;
|
|
116654
|
-
}
|
|
116655
|
-
function patch(fs) {
|
|
116656
|
-
polyfills(fs);
|
|
116657
|
-
fs.gracefulify = patch;
|
|
116658
|
-
fs.createReadStream = createReadStream;
|
|
116659
|
-
fs.createWriteStream = createWriteStream;
|
|
116660
|
-
var fs$readFile = fs.readFile;
|
|
116661
|
-
fs.readFile = readFile;
|
|
116662
|
-
function readFile(path, options, cb) {
|
|
116663
|
-
if (typeof options === "function") cb = options, options = null;
|
|
116664
|
-
return go$readFile(path, options, cb);
|
|
116665
|
-
function go$readFile(path, options, cb, startTime) {
|
|
116666
|
-
return fs$readFile(path, options, function(err) {
|
|
116667
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
|
|
116668
|
-
go$readFile,
|
|
116669
|
-
[
|
|
116670
|
-
path,
|
|
116671
|
-
options,
|
|
116672
|
-
cb
|
|
116673
|
-
],
|
|
116674
|
-
err,
|
|
116675
|
-
startTime || Date.now(),
|
|
116676
|
-
Date.now()
|
|
116677
|
-
]);
|
|
116678
|
-
else if (typeof cb === "function") cb.apply(this, arguments);
|
|
116679
|
-
});
|
|
116680
|
-
}
|
|
116681
|
-
}
|
|
116682
|
-
var fs$writeFile = fs.writeFile;
|
|
116683
|
-
fs.writeFile = writeFile;
|
|
116684
|
-
function writeFile(path, data, options, cb) {
|
|
116685
|
-
if (typeof options === "function") cb = options, options = null;
|
|
116686
|
-
return go$writeFile(path, data, options, cb);
|
|
116687
|
-
function go$writeFile(path, data, options, cb, startTime) {
|
|
116688
|
-
return fs$writeFile(path, data, options, function(err) {
|
|
116689
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
|
|
116690
|
-
go$writeFile,
|
|
116691
|
-
[
|
|
116692
|
-
path,
|
|
116693
|
-
data,
|
|
116694
|
-
options,
|
|
116695
|
-
cb
|
|
116696
|
-
],
|
|
116697
|
-
err,
|
|
116698
|
-
startTime || Date.now(),
|
|
116699
|
-
Date.now()
|
|
116700
|
-
]);
|
|
116701
|
-
else if (typeof cb === "function") cb.apply(this, arguments);
|
|
116702
|
-
});
|
|
116703
|
-
}
|
|
116704
|
-
}
|
|
116705
|
-
var fs$appendFile = fs.appendFile;
|
|
116706
|
-
if (fs$appendFile) fs.appendFile = appendFile;
|
|
116707
|
-
function appendFile(path, data, options, cb) {
|
|
116708
|
-
if (typeof options === "function") cb = options, options = null;
|
|
116709
|
-
return go$appendFile(path, data, options, cb);
|
|
116710
|
-
function go$appendFile(path, data, options, cb, startTime) {
|
|
116711
|
-
return fs$appendFile(path, data, options, function(err) {
|
|
116712
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
|
|
116713
|
-
go$appendFile,
|
|
116714
|
-
[
|
|
116715
|
-
path,
|
|
116716
|
-
data,
|
|
116717
|
-
options,
|
|
116718
|
-
cb
|
|
116719
|
-
],
|
|
116720
|
-
err,
|
|
116721
|
-
startTime || Date.now(),
|
|
116722
|
-
Date.now()
|
|
116723
|
-
]);
|
|
116724
|
-
else if (typeof cb === "function") cb.apply(this, arguments);
|
|
116725
|
-
});
|
|
116726
|
-
}
|
|
116727
|
-
}
|
|
116728
|
-
var fs$copyFile = fs.copyFile;
|
|
116729
|
-
if (fs$copyFile) fs.copyFile = copyFile;
|
|
116730
|
-
function copyFile(src, dest, flags, cb) {
|
|
116731
|
-
if (typeof flags === "function") {
|
|
116732
|
-
cb = flags;
|
|
116733
|
-
flags = 0;
|
|
116734
|
-
}
|
|
116735
|
-
return go$copyFile(src, dest, flags, cb);
|
|
116736
|
-
function go$copyFile(src, dest, flags, cb, startTime) {
|
|
116737
|
-
return fs$copyFile(src, dest, flags, function(err) {
|
|
116738
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
|
|
116739
|
-
go$copyFile,
|
|
116740
|
-
[
|
|
116741
|
-
src,
|
|
116742
|
-
dest,
|
|
116743
|
-
flags,
|
|
116744
|
-
cb
|
|
116745
|
-
],
|
|
116746
|
-
err,
|
|
116747
|
-
startTime || Date.now(),
|
|
116748
|
-
Date.now()
|
|
116749
|
-
]);
|
|
116750
|
-
else if (typeof cb === "function") cb.apply(this, arguments);
|
|
116751
|
-
});
|
|
116752
|
-
}
|
|
116753
|
-
}
|
|
116754
|
-
var fs$readdir = fs.readdir;
|
|
116755
|
-
fs.readdir = readdir;
|
|
116756
|
-
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
116757
|
-
function readdir(path, options, cb) {
|
|
116758
|
-
if (typeof options === "function") cb = options, options = null;
|
|
116759
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir(path, options, cb, startTime) {
|
|
116760
|
-
return fs$readdir(path, fs$readdirCallback(path, options, cb, startTime));
|
|
116761
|
-
} : function go$readdir(path, options, cb, startTime) {
|
|
116762
|
-
return fs$readdir(path, options, fs$readdirCallback(path, options, cb, startTime));
|
|
116763
|
-
};
|
|
116764
|
-
return go$readdir(path, options, cb);
|
|
116765
|
-
function fs$readdirCallback(path, options, cb, startTime) {
|
|
116766
|
-
return function(err, files) {
|
|
116767
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
|
|
116768
|
-
go$readdir,
|
|
116769
|
-
[
|
|
116770
|
-
path,
|
|
116771
|
-
options,
|
|
116772
|
-
cb
|
|
116773
|
-
],
|
|
116774
|
-
err,
|
|
116775
|
-
startTime || Date.now(),
|
|
116776
|
-
Date.now()
|
|
116777
|
-
]);
|
|
116778
|
-
else {
|
|
116779
|
-
if (files && files.sort) files.sort();
|
|
116780
|
-
if (typeof cb === "function") cb.call(this, err, files);
|
|
116781
|
-
}
|
|
116782
|
-
};
|
|
116783
|
-
}
|
|
116784
|
-
}
|
|
116785
|
-
if (process.version.substr(0, 4) === "v0.8") {
|
|
116786
|
-
var legStreams = legacy(fs);
|
|
116787
|
-
ReadStream = legStreams.ReadStream;
|
|
116788
|
-
WriteStream = legStreams.WriteStream;
|
|
116789
|
-
}
|
|
116790
|
-
var fs$ReadStream = fs.ReadStream;
|
|
116791
|
-
if (fs$ReadStream) {
|
|
116792
|
-
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
116793
|
-
ReadStream.prototype.open = ReadStream$open;
|
|
116794
|
-
}
|
|
116795
|
-
var fs$WriteStream = fs.WriteStream;
|
|
116796
|
-
if (fs$WriteStream) {
|
|
116797
|
-
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
116798
|
-
WriteStream.prototype.open = WriteStream$open;
|
|
116799
|
-
}
|
|
116800
|
-
Object.defineProperty(fs, "ReadStream", {
|
|
116801
|
-
get: function() {
|
|
116802
|
-
return ReadStream;
|
|
116803
|
-
},
|
|
116804
|
-
set: function(val) {
|
|
116805
|
-
ReadStream = val;
|
|
116806
|
-
},
|
|
116807
|
-
enumerable: true,
|
|
116808
|
-
configurable: true
|
|
116809
|
-
});
|
|
116810
|
-
Object.defineProperty(fs, "WriteStream", {
|
|
116811
|
-
get: function() {
|
|
116812
|
-
return WriteStream;
|
|
116813
|
-
},
|
|
116814
|
-
set: function(val) {
|
|
116815
|
-
WriteStream = val;
|
|
116816
|
-
},
|
|
116817
|
-
enumerable: true,
|
|
116818
|
-
configurable: true
|
|
116819
|
-
});
|
|
116820
|
-
var FileReadStream = ReadStream;
|
|
116821
|
-
Object.defineProperty(fs, "FileReadStream", {
|
|
116822
|
-
get: function() {
|
|
116823
|
-
return FileReadStream;
|
|
116824
|
-
},
|
|
116825
|
-
set: function(val) {
|
|
116826
|
-
FileReadStream = val;
|
|
116827
|
-
},
|
|
116828
|
-
enumerable: true,
|
|
116829
|
-
configurable: true
|
|
116830
|
-
});
|
|
116831
|
-
var FileWriteStream = WriteStream;
|
|
116832
|
-
Object.defineProperty(fs, "FileWriteStream", {
|
|
116833
|
-
get: function() {
|
|
116834
|
-
return FileWriteStream;
|
|
116835
|
-
},
|
|
116836
|
-
set: function(val) {
|
|
116837
|
-
FileWriteStream = val;
|
|
116838
|
-
},
|
|
116839
|
-
enumerable: true,
|
|
116840
|
-
configurable: true
|
|
116841
|
-
});
|
|
116842
|
-
function ReadStream(path, options) {
|
|
116843
|
-
if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this;
|
|
116844
|
-
else return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
|
|
116845
|
-
}
|
|
116846
|
-
function ReadStream$open() {
|
|
116847
|
-
var that = this;
|
|
116848
|
-
open(that.path, that.flags, that.mode, function(err, fd) {
|
|
116849
|
-
if (err) {
|
|
116850
|
-
if (that.autoClose) that.destroy();
|
|
116851
|
-
that.emit("error", err);
|
|
116852
|
-
} else {
|
|
116853
|
-
that.fd = fd;
|
|
116854
|
-
that.emit("open", fd);
|
|
116855
|
-
that.read();
|
|
116856
|
-
}
|
|
116857
|
-
});
|
|
116858
|
-
}
|
|
116859
|
-
function WriteStream(path, options) {
|
|
116860
|
-
if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this;
|
|
116861
|
-
else return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
|
|
116862
|
-
}
|
|
116863
|
-
function WriteStream$open() {
|
|
116864
|
-
var that = this;
|
|
116865
|
-
open(that.path, that.flags, that.mode, function(err, fd) {
|
|
116866
|
-
if (err) {
|
|
116867
|
-
that.destroy();
|
|
116868
|
-
that.emit("error", err);
|
|
116869
|
-
} else {
|
|
116870
|
-
that.fd = fd;
|
|
116871
|
-
that.emit("open", fd);
|
|
116872
|
-
}
|
|
116873
|
-
});
|
|
116874
|
-
}
|
|
116875
|
-
function createReadStream(path, options) {
|
|
116876
|
-
return new fs.ReadStream(path, options);
|
|
116877
|
-
}
|
|
116878
|
-
function createWriteStream(path, options) {
|
|
116879
|
-
return new fs.WriteStream(path, options);
|
|
116880
|
-
}
|
|
116881
|
-
var fs$open = fs.open;
|
|
116882
|
-
fs.open = open;
|
|
116883
|
-
function open(path, flags, mode, cb) {
|
|
116884
|
-
if (typeof mode === "function") cb = mode, mode = null;
|
|
116885
|
-
return go$open(path, flags, mode, cb);
|
|
116886
|
-
function go$open(path, flags, mode, cb, startTime) {
|
|
116887
|
-
return fs$open(path, flags, mode, function(err, fd) {
|
|
116888
|
-
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
|
|
116889
|
-
go$open,
|
|
116890
|
-
[
|
|
116891
|
-
path,
|
|
116892
|
-
flags,
|
|
116893
|
-
mode,
|
|
116894
|
-
cb
|
|
116895
|
-
],
|
|
116896
|
-
err,
|
|
116897
|
-
startTime || Date.now(),
|
|
116898
|
-
Date.now()
|
|
116899
|
-
]);
|
|
116900
|
-
else if (typeof cb === "function") cb.apply(this, arguments);
|
|
116901
|
-
});
|
|
116902
|
-
}
|
|
116903
|
-
}
|
|
116904
|
-
return fs;
|
|
116905
|
-
}
|
|
116906
|
-
function enqueue(elem) {
|
|
116907
|
-
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
116908
|
-
fs$1[gracefulQueue].push(elem);
|
|
116909
|
-
retry();
|
|
116910
|
-
}
|
|
116911
|
-
var retryTimer;
|
|
116912
|
-
function resetQueue() {
|
|
116913
|
-
var now = Date.now();
|
|
116914
|
-
for (var i = 0; i < fs$1[gracefulQueue].length; ++i) if (fs$1[gracefulQueue][i].length > 2) {
|
|
116915
|
-
fs$1[gracefulQueue][i][3] = now;
|
|
116916
|
-
fs$1[gracefulQueue][i][4] = now;
|
|
116917
|
-
}
|
|
116918
|
-
retry();
|
|
116919
|
-
}
|
|
116920
|
-
function retry() {
|
|
116921
|
-
clearTimeout(retryTimer);
|
|
116922
|
-
retryTimer = void 0;
|
|
116923
|
-
if (fs$1[gracefulQueue].length === 0) return;
|
|
116924
|
-
var elem = fs$1[gracefulQueue].shift();
|
|
116925
|
-
var fn = elem[0];
|
|
116926
|
-
var args = elem[1];
|
|
116927
|
-
var err = elem[2];
|
|
116928
|
-
var startTime = elem[3];
|
|
116929
|
-
var lastTime = elem[4];
|
|
116930
|
-
if (startTime === void 0) {
|
|
116931
|
-
debug("RETRY", fn.name, args);
|
|
116932
|
-
fn.apply(null, args);
|
|
116933
|
-
} else if (Date.now() - startTime >= 6e4) {
|
|
116934
|
-
debug("TIMEOUT", fn.name, args);
|
|
116935
|
-
var cb = args.pop();
|
|
116936
|
-
if (typeof cb === "function") cb.call(null, err);
|
|
116937
|
-
} else {
|
|
116938
|
-
var sinceAttempt = Date.now() - lastTime;
|
|
116939
|
-
var sinceStart = Math.max(lastTime - startTime, 1);
|
|
116940
|
-
if (sinceAttempt >= Math.min(sinceStart * 1.2, 100)) {
|
|
116941
|
-
debug("RETRY", fn.name, args);
|
|
116942
|
-
fn.apply(null, args.concat([startTime]));
|
|
116943
|
-
} else fs$1[gracefulQueue].push(elem);
|
|
116944
|
-
}
|
|
116945
|
-
if (retryTimer === void 0) retryTimer = setTimeout(retry, 0);
|
|
116946
|
-
}
|
|
116947
|
-
}));
|
|
116948
|
-
//#endregion
|
|
116949
|
-
//#region node_modules/signal-exit/dist/cjs/signals.js
|
|
116950
|
-
var require_signals = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
116951
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
116952
|
-
exports.signals = void 0;
|
|
116953
|
-
/**
|
|
116954
|
-
* This is not the set of all possible signals.
|
|
116955
|
-
*
|
|
116956
|
-
* It IS, however, the set of all signals that trigger
|
|
116957
|
-
* an exit on either Linux or BSD systems. Linux is a
|
|
116958
|
-
* superset of the signal names supported on BSD, and
|
|
116959
|
-
* the unknown signals just fail to register, so we can
|
|
116960
|
-
* catch that easily enough.
|
|
116961
|
-
*
|
|
116962
|
-
* Windows signals are a different set, since there are
|
|
116963
|
-
* signals that terminate Windows processes, but don't
|
|
116964
|
-
* terminate (or don't even exist) on Posix systems.
|
|
116965
|
-
*
|
|
116966
|
-
* Don't bother with SIGKILL. It's uncatchable, which
|
|
116967
|
-
* means that we can't fire any callbacks anyway.
|
|
116968
|
-
*
|
|
116969
|
-
* If a user does happen to register a handler on a non-
|
|
116970
|
-
* fatal signal like SIGWINCH or something, and then
|
|
116971
|
-
* exit, it'll end up firing `process.emit('exit')`, so
|
|
116972
|
-
* the handler will be fired anyway.
|
|
116973
|
-
*
|
|
116974
|
-
* SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
|
|
116975
|
-
* artificially, inherently leave the process in a
|
|
116976
|
-
* state from which it is not safe to try and enter JS
|
|
116977
|
-
* listeners.
|
|
116978
|
-
*/
|
|
116979
|
-
exports.signals = [];
|
|
116980
|
-
exports.signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
116981
|
-
if (process.platform !== "win32") exports.signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
|
|
116982
|
-
if (process.platform === "linux") exports.signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
116983
|
-
}));
|
|
116984
|
-
//#endregion
|
|
116985
|
-
//#region node_modules/signal-exit/dist/cjs/index.js
|
|
116986
|
-
var require_cjs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
116987
|
-
var _a;
|
|
116988
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
116989
|
-
exports.unload = exports.load = exports.onExit = exports.signals = void 0;
|
|
116990
|
-
const signals_js_1 = require_signals();
|
|
116991
|
-
Object.defineProperty(exports, "signals", {
|
|
116992
|
-
enumerable: true,
|
|
116993
|
-
get: function() {
|
|
116994
|
-
return signals_js_1.signals;
|
|
116995
|
-
}
|
|
116996
|
-
});
|
|
116997
|
-
const processOk = (process) => !!process && typeof process === "object" && typeof process.removeListener === "function" && typeof process.emit === "function" && typeof process.reallyExit === "function" && typeof process.listeners === "function" && typeof process.kill === "function" && typeof process.pid === "number" && typeof process.on === "function";
|
|
116998
|
-
const kExitEmitter = Symbol.for("signal-exit emitter");
|
|
116999
|
-
const global = globalThis;
|
|
117000
|
-
const ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
117001
|
-
var Emitter = class {
|
|
117002
|
-
emitted = {
|
|
117003
|
-
afterExit: false,
|
|
117004
|
-
exit: false
|
|
117005
|
-
};
|
|
117006
|
-
listeners = {
|
|
117007
|
-
afterExit: [],
|
|
117008
|
-
exit: []
|
|
117009
|
-
};
|
|
117010
|
-
count = 0;
|
|
117011
|
-
id = Math.random();
|
|
117012
|
-
constructor() {
|
|
117013
|
-
if (global[kExitEmitter]) return global[kExitEmitter];
|
|
117014
|
-
ObjectDefineProperty(global, kExitEmitter, {
|
|
117015
|
-
value: this,
|
|
117016
|
-
writable: false,
|
|
117017
|
-
enumerable: false,
|
|
117018
|
-
configurable: false
|
|
117019
|
-
});
|
|
117020
|
-
}
|
|
117021
|
-
on(ev, fn) {
|
|
117022
|
-
this.listeners[ev].push(fn);
|
|
117023
|
-
}
|
|
117024
|
-
removeListener(ev, fn) {
|
|
117025
|
-
const list = this.listeners[ev];
|
|
117026
|
-
const i = list.indexOf(fn);
|
|
117027
|
-
/* c8 ignore start */
|
|
117028
|
-
if (i === -1) return;
|
|
117029
|
-
/* c8 ignore stop */
|
|
117030
|
-
if (i === 0 && list.length === 1) list.length = 0;
|
|
117031
|
-
else list.splice(i, 1);
|
|
117032
|
-
}
|
|
117033
|
-
emit(ev, code, signal) {
|
|
117034
|
-
if (this.emitted[ev]) return false;
|
|
117035
|
-
this.emitted[ev] = true;
|
|
117036
|
-
let ret = false;
|
|
117037
|
-
for (const fn of this.listeners[ev]) ret = fn(code, signal) === true || ret;
|
|
117038
|
-
if (ev === "exit") ret = this.emit("afterExit", code, signal) || ret;
|
|
117039
|
-
return ret;
|
|
117040
|
-
}
|
|
117041
|
-
};
|
|
117042
|
-
var SignalExitBase = class {};
|
|
117043
|
-
const signalExitWrap = (handler) => {
|
|
117044
|
-
return {
|
|
117045
|
-
onExit(cb, opts) {
|
|
117046
|
-
return handler.onExit(cb, opts);
|
|
117047
|
-
},
|
|
117048
|
-
load() {
|
|
117049
|
-
return handler.load();
|
|
117050
|
-
},
|
|
117051
|
-
unload() {
|
|
117052
|
-
return handler.unload();
|
|
117053
|
-
}
|
|
117054
|
-
};
|
|
117055
|
-
};
|
|
117056
|
-
var SignalExitFallback = class extends SignalExitBase {
|
|
117057
|
-
onExit() {
|
|
117058
|
-
return () => {};
|
|
117059
|
-
}
|
|
117060
|
-
load() {}
|
|
117061
|
-
unload() {}
|
|
117062
|
-
};
|
|
117063
|
-
var SignalExit = class extends SignalExitBase {
|
|
117064
|
-
/* c8 ignore start */
|
|
117065
|
-
#hupSig = process.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
117066
|
-
/* c8 ignore stop */
|
|
117067
|
-
#emitter = new Emitter();
|
|
117068
|
-
#process;
|
|
117069
|
-
#originalProcessEmit;
|
|
117070
|
-
#originalProcessReallyExit;
|
|
117071
|
-
#sigListeners = {};
|
|
117072
|
-
#loaded = false;
|
|
117073
|
-
constructor(process) {
|
|
117074
|
-
super();
|
|
117075
|
-
this.#process = process;
|
|
117076
|
-
this.#sigListeners = {};
|
|
117077
|
-
for (const sig of signals_js_1.signals) this.#sigListeners[sig] = () => {
|
|
117078
|
-
const listeners = this.#process.listeners(sig);
|
|
117079
|
-
let { count } = this.#emitter;
|
|
117080
|
-
/* c8 ignore start */
|
|
117081
|
-
const p = process;
|
|
117082
|
-
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") count += p.__signal_exit_emitter__.count;
|
|
117083
|
-
/* c8 ignore stop */
|
|
117084
|
-
if (listeners.length === count) {
|
|
117085
|
-
this.unload();
|
|
117086
|
-
const ret = this.#emitter.emit("exit", null, sig);
|
|
117087
|
-
/* c8 ignore start */
|
|
117088
|
-
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
117089
|
-
if (!ret) process.kill(process.pid, s);
|
|
117090
|
-
}
|
|
117091
|
-
};
|
|
117092
|
-
this.#originalProcessReallyExit = process.reallyExit;
|
|
117093
|
-
this.#originalProcessEmit = process.emit;
|
|
117094
|
-
}
|
|
117095
|
-
onExit(cb, opts) {
|
|
117096
|
-
/* c8 ignore start */
|
|
117097
|
-
if (!processOk(this.#process)) return () => {};
|
|
117098
|
-
/* c8 ignore stop */
|
|
117099
|
-
if (this.#loaded === false) this.load();
|
|
117100
|
-
const ev = opts?.alwaysLast ? "afterExit" : "exit";
|
|
117101
|
-
this.#emitter.on(ev, cb);
|
|
117102
|
-
return () => {
|
|
117103
|
-
this.#emitter.removeListener(ev, cb);
|
|
117104
|
-
if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) this.unload();
|
|
117105
|
-
};
|
|
117106
|
-
}
|
|
117107
|
-
load() {
|
|
117108
|
-
if (this.#loaded) return;
|
|
117109
|
-
this.#loaded = true;
|
|
117110
|
-
this.#emitter.count += 1;
|
|
117111
|
-
for (const sig of signals_js_1.signals) try {
|
|
117112
|
-
const fn = this.#sigListeners[sig];
|
|
117113
|
-
if (fn) this.#process.on(sig, fn);
|
|
117114
|
-
} catch (_) {}
|
|
117115
|
-
this.#process.emit = (ev, ...a) => {
|
|
117116
|
-
return this.#processEmit(ev, ...a);
|
|
117117
|
-
};
|
|
117118
|
-
this.#process.reallyExit = (code) => {
|
|
117119
|
-
return this.#processReallyExit(code);
|
|
117120
|
-
};
|
|
117121
|
-
}
|
|
117122
|
-
unload() {
|
|
117123
|
-
if (!this.#loaded) return;
|
|
117124
|
-
this.#loaded = false;
|
|
117125
|
-
signals_js_1.signals.forEach((sig) => {
|
|
117126
|
-
const listener = this.#sigListeners[sig];
|
|
117127
|
-
/* c8 ignore start */
|
|
117128
|
-
if (!listener) throw new Error("Listener not defined for signal: " + sig);
|
|
117129
|
-
/* c8 ignore stop */
|
|
117130
|
-
try {
|
|
117131
|
-
this.#process.removeListener(sig, listener);
|
|
117132
|
-
} catch (_) {}
|
|
117133
|
-
/* c8 ignore stop */
|
|
117134
|
-
});
|
|
117135
|
-
this.#process.emit = this.#originalProcessEmit;
|
|
117136
|
-
this.#process.reallyExit = this.#originalProcessReallyExit;
|
|
117137
|
-
this.#emitter.count -= 1;
|
|
117138
|
-
}
|
|
117139
|
-
#processReallyExit(code) {
|
|
117140
|
-
/* c8 ignore start */
|
|
117141
|
-
if (!processOk(this.#process)) return 0;
|
|
117142
|
-
this.#process.exitCode = code || 0;
|
|
117143
|
-
/* c8 ignore stop */
|
|
117144
|
-
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
117145
|
-
return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
|
|
117146
|
-
}
|
|
117147
|
-
#processEmit(ev, ...args) {
|
|
117148
|
-
const og = this.#originalProcessEmit;
|
|
117149
|
-
if (ev === "exit" && processOk(this.#process)) {
|
|
117150
|
-
if (typeof args[0] === "number") this.#process.exitCode = args[0];
|
|
117151
|
-
/* c8 ignore start */
|
|
117152
|
-
const ret = og.call(this.#process, ev, ...args);
|
|
117153
|
-
/* c8 ignore start */
|
|
117154
|
-
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
117155
|
-
/* c8 ignore stop */
|
|
117156
|
-
return ret;
|
|
117157
|
-
} else return og.call(this.#process, ev, ...args);
|
|
117158
|
-
}
|
|
117159
|
-
};
|
|
117160
|
-
const process = globalThis.process;
|
|
117161
|
-
_a = signalExitWrap(processOk(process) ? new SignalExit(process) : new SignalExitFallback()), exports.onExit = _a.onExit, exports.load = _a.load, exports.unload = _a.unload;
|
|
117162
|
-
}));
|
|
117163
|
-
//#endregion
|
|
117164
|
-
//#region node_modules/@pkcprotocol/proper-lock-file/dist/src/mtime-precision.js
|
|
117165
|
-
var require_mtime_precision = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
117166
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
117167
|
-
exports.probe = probe;
|
|
117168
|
-
exports.getMtime = getMtime;
|
|
117169
|
-
const cacheSymbol = Symbol();
|
|
117170
|
-
function probe(file, fs, callback) {
|
|
117171
|
-
const cachedPrecision = fs[cacheSymbol];
|
|
117172
|
-
if (cachedPrecision) return fs.stat(file, (err, stat) => {
|
|
117173
|
-
/* istanbul ignore if */
|
|
117174
|
-
if (err) return callback(err);
|
|
117175
|
-
callback(null, stat.mtime, cachedPrecision);
|
|
117176
|
-
});
|
|
117177
|
-
const mtime = /* @__PURE__ */ new Date(Math.ceil(Date.now() / 1e3) * 1e3 + 5);
|
|
117178
|
-
fs.utimes(file, mtime, mtime, (err) => {
|
|
117179
|
-
/* istanbul ignore if */
|
|
117180
|
-
if (err) return callback(err);
|
|
117181
|
-
fs.stat(file, (err, stat) => {
|
|
117182
|
-
/* istanbul ignore if */
|
|
117183
|
-
if (err) return callback(err);
|
|
117184
|
-
const precision = stat.mtime.getTime() % 1e3 === 0 ? "s" : "ms";
|
|
117185
|
-
Object.defineProperty(fs, cacheSymbol, { value: precision });
|
|
117186
|
-
callback(null, stat.mtime, precision);
|
|
117187
|
-
});
|
|
117188
|
-
});
|
|
117189
|
-
}
|
|
117190
|
-
function getMtime(precision) {
|
|
117191
|
-
let now = Date.now();
|
|
117192
|
-
if (precision === "s") now = Math.ceil(now / 1e3) * 1e3;
|
|
117193
|
-
return new Date(now);
|
|
117194
|
-
}
|
|
117195
|
-
}));
|
|
117196
|
-
//#endregion
|
|
117197
|
-
//#region node_modules/@pkcprotocol/proper-lock-file/dist/src/lockfile.js
|
|
117198
|
-
var require_lockfile = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
117199
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
117200
|
-
if (k2 === void 0) k2 = k;
|
|
117201
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
117202
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
117203
|
-
enumerable: true,
|
|
117204
|
-
get: function() {
|
|
117205
|
-
return m[k];
|
|
117206
|
-
}
|
|
117207
|
-
};
|
|
117208
|
-
Object.defineProperty(o, k2, desc);
|
|
117209
|
-
}) : (function(o, m, k, k2) {
|
|
117210
|
-
if (k2 === void 0) k2 = k;
|
|
117211
|
-
o[k2] = m[k];
|
|
117212
|
-
}));
|
|
117213
|
-
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
117214
|
-
Object.defineProperty(o, "default", {
|
|
117215
|
-
enumerable: true,
|
|
117216
|
-
value: v
|
|
117217
|
-
});
|
|
117218
|
-
}) : function(o, v) {
|
|
117219
|
-
o["default"] = v;
|
|
117220
|
-
});
|
|
117221
|
-
var __importStar = exports && exports.__importStar || (function() {
|
|
117222
|
-
var ownKeys = function(o) {
|
|
117223
|
-
ownKeys = Object.getOwnPropertyNames || function(o) {
|
|
117224
|
-
var ar = [];
|
|
117225
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
117226
|
-
return ar;
|
|
117227
|
-
};
|
|
117228
|
-
return ownKeys(o);
|
|
117229
|
-
};
|
|
117230
|
-
return function(mod) {
|
|
117231
|
-
if (mod && mod.__esModule) return mod;
|
|
117232
|
-
var result = {};
|
|
117233
|
-
if (mod != null) {
|
|
117234
|
-
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
117235
|
-
}
|
|
117236
|
-
__setModuleDefault(result, mod);
|
|
117237
|
-
return result;
|
|
117238
|
-
};
|
|
117239
|
-
})();
|
|
117240
|
-
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
117241
|
-
return mod && mod.__esModule ? mod : { "default": mod };
|
|
117242
|
-
};
|
|
117243
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
117244
|
-
exports.lock = lock;
|
|
117245
|
-
exports.unlock = unlock;
|
|
117246
|
-
exports.check = check;
|
|
117247
|
-
exports.getLocks = getLocks;
|
|
117248
|
-
const path_1 = __importDefault(__require("path"));
|
|
117249
|
-
const graceful_fs_1 = __importDefault(require_graceful_fs());
|
|
117250
|
-
const retry_1 = __importDefault(require_retry$2());
|
|
117251
|
-
const signal_exit_1 = require_cjs();
|
|
117252
|
-
const assert_1 = __importDefault(__require("assert"));
|
|
117253
|
-
const mtimePrecision = __importStar(require_mtime_precision());
|
|
117254
|
-
const locks = {};
|
|
117255
|
-
function getLockFile(file, options) {
|
|
117256
|
-
(0, assert_1.default)(typeof options.lockfilePath === "string");
|
|
117257
|
-
return options.lockfilePath;
|
|
117258
|
-
}
|
|
117259
|
-
function resolveCanonicalPath(file, options, callback) {
|
|
117260
|
-
if (!options.realpath) return callback(null, path_1.default.resolve(file));
|
|
117261
|
-
options.fs.realpath(file, (err, resolvedPath) => {
|
|
117262
|
-
callback(err, resolvedPath);
|
|
117263
|
-
});
|
|
117264
|
-
}
|
|
117265
|
-
function acquireLock(file, options, callback) {
|
|
117266
|
-
const lockfilePath = getLockFile(file, options);
|
|
117267
|
-
options.fs.mkdir(lockfilePath, (err) => {
|
|
117268
|
-
if (!err) return mtimePrecision.probe(lockfilePath, options.fs, (err, mtime, precision) => {
|
|
117269
|
-
/* istanbul ignore if */
|
|
117270
|
-
if (err) {
|
|
117271
|
-
options.fs.rmdir(lockfilePath, () => {});
|
|
117272
|
-
return callback(err);
|
|
117273
|
-
}
|
|
117274
|
-
callback(null, mtime, precision);
|
|
117275
|
-
});
|
|
117276
|
-
if (err.code !== "EEXIST") return callback(err);
|
|
117277
|
-
if (options.stale <= 0) return callback(Object.assign(/* @__PURE__ */ new Error("Lock file is already being held"), {
|
|
117278
|
-
code: "ELOCKED",
|
|
117279
|
-
file
|
|
117280
|
-
}));
|
|
117281
|
-
options.fs.stat(lockfilePath, (err, stat) => {
|
|
117282
|
-
if (err) {
|
|
117283
|
-
if (err.code === "ENOENT") return acquireLock(file, {
|
|
117284
|
-
...options,
|
|
117285
|
-
stale: 0
|
|
117286
|
-
}, callback);
|
|
117287
|
-
return callback(err);
|
|
117288
|
-
}
|
|
117289
|
-
if (!isLockStale(stat, options)) return callback(Object.assign(/* @__PURE__ */ new Error("Lock file is already being held"), {
|
|
117290
|
-
code: "ELOCKED",
|
|
117291
|
-
file
|
|
117292
|
-
}));
|
|
117293
|
-
removeLock(file, options, (err) => {
|
|
117294
|
-
if (err) return callback(err);
|
|
117295
|
-
acquireLock(file, {
|
|
117296
|
-
...options,
|
|
117297
|
-
stale: 0
|
|
117298
|
-
}, callback);
|
|
117299
|
-
});
|
|
117300
|
-
});
|
|
117301
|
-
});
|
|
117302
|
-
}
|
|
117303
|
-
function isLockStale(stat, options) {
|
|
117304
|
-
return stat.mtime.getTime() < Date.now() - options.stale;
|
|
117305
|
-
}
|
|
117306
|
-
function removeLock(file, options, callback) {
|
|
117307
|
-
options.fs.rmdir(getLockFile(file, options), (err) => {
|
|
117308
|
-
if (err && err.code !== "ENOENT") return callback(err);
|
|
117309
|
-
callback();
|
|
117310
|
-
});
|
|
117311
|
-
}
|
|
117312
|
-
function updateLock(file, options) {
|
|
117313
|
-
if (typeof options.lockfilePath !== "string") throw Error("Options is not defined ");
|
|
117314
|
-
const lock = locks[file + options.lockfilePath];
|
|
117315
|
-
/* istanbul ignore if */
|
|
117316
|
-
if (lock.updateTimeout) return;
|
|
117317
|
-
lock.updateDelay = lock.updateDelay || options.update;
|
|
117318
|
-
lock.updateTimeout = setTimeout(() => {
|
|
117319
|
-
lock.updateTimeout = null;
|
|
117320
|
-
options.fs.stat(lock.lockfilePath, (err, stat) => {
|
|
117321
|
-
const isOverThreshold = lock.lastUpdate + options.stale < Date.now();
|
|
117322
|
-
if (err) {
|
|
117323
|
-
if (err.code === "ENOENT" || isOverThreshold) return setLockAsCompromised(file, lock, Object.assign(err, { code: "ECOMPROMISED" }));
|
|
117324
|
-
lock.updateDelay = 1e3;
|
|
117325
|
-
return updateLock(file, options);
|
|
117326
|
-
}
|
|
117327
|
-
if (!(lock.mtime.getTime() === stat.mtime.getTime())) return setLockAsCompromised(file, lock, Object.assign(/* @__PURE__ */ new Error("Unable to update lock within the stale threshold"), { code: "ECOMPROMISED" }));
|
|
117328
|
-
const mtime = mtimePrecision.getMtime(lock.mtimePrecision);
|
|
117329
|
-
options.fs.utimes(lock.lockfilePath, mtime, mtime, (err) => {
|
|
117330
|
-
const isOverThreshold = lock.lastUpdate + options.stale < Date.now();
|
|
117331
|
-
if (lock.released) return;
|
|
117332
|
-
if (err) {
|
|
117333
|
-
if (err.code === "ENOENT" || isOverThreshold) return setLockAsCompromised(file, lock, Object.assign(err, { code: "ECOMPROMISED" }));
|
|
117334
|
-
lock.updateDelay = 1e3;
|
|
117335
|
-
return updateLock(file, options);
|
|
117336
|
-
}
|
|
117337
|
-
lock.mtime = mtime;
|
|
117338
|
-
lock.lastUpdate = Date.now();
|
|
117339
|
-
lock.updateDelay = null;
|
|
117340
|
-
updateLock(file, options);
|
|
117341
|
-
});
|
|
117342
|
-
});
|
|
117343
|
-
}, lock.updateDelay);
|
|
117344
|
-
/* istanbul ignore else */
|
|
117345
|
-
if (lock.updateTimeout && lock.updateTimeout.unref) lock.updateTimeout.unref();
|
|
117346
|
-
}
|
|
117347
|
-
function setLockAsCompromised(file, lock, err) {
|
|
117348
|
-
lock.released = true;
|
|
117349
|
-
/* istanbul ignore if */
|
|
117350
|
-
if (lock.updateTimeout) clearTimeout(lock.updateTimeout);
|
|
117351
|
-
const lockKey = file + lock.lockfilePath;
|
|
117352
|
-
if (locks[lockKey] === lock) delete locks[lockKey];
|
|
117353
|
-
lock.options.onCompromised(err);
|
|
117354
|
-
}
|
|
117355
|
-
function lock(file, options, callback) {
|
|
117356
|
-
/* istanbul ignore next */
|
|
117357
|
-
const merged = {
|
|
117358
|
-
stale: 1e4,
|
|
117359
|
-
update: null,
|
|
117360
|
-
realpath: true,
|
|
117361
|
-
retries: { retries: 0 },
|
|
117362
|
-
fs: graceful_fs_1.default,
|
|
117363
|
-
onCompromised: (err) => {
|
|
117364
|
-
throw err;
|
|
117365
|
-
},
|
|
117366
|
-
lockfilePath: "",
|
|
117367
|
-
...options
|
|
117368
|
-
};
|
|
117369
|
-
let retries = merged.retries || { retries: 0 };
|
|
117370
|
-
retries = typeof retries === "number" ? { retries } : retries;
|
|
117371
|
-
const stale = Math.max(merged.stale || 0, 2e3);
|
|
117372
|
-
let update = merged.update == null ? stale / 2 : merged.update || 0;
|
|
117373
|
-
update = Math.max(Math.min(update, stale / 2), 1e3);
|
|
117374
|
-
const opts = {
|
|
117375
|
-
stale,
|
|
117376
|
-
update,
|
|
117377
|
-
realpath: merged.realpath,
|
|
117378
|
-
retries,
|
|
117379
|
-
fs: merged.fs,
|
|
117380
|
-
onCompromised: merged.onCompromised,
|
|
117381
|
-
lockfilePath: merged.lockfilePath
|
|
117382
|
-
};
|
|
117383
|
-
resolveCanonicalPath(file, opts, (err, resolvedFile) => {
|
|
117384
|
-
if (err) return callback(err);
|
|
117385
|
-
file = resolvedFile;
|
|
117386
|
-
const operation = retry_1.default.operation(opts.retries);
|
|
117387
|
-
operation.attempt(() => {
|
|
117388
|
-
acquireLock(file, opts, (err, mtime, precision) => {
|
|
117389
|
-
if (operation.retry(err)) return;
|
|
117390
|
-
if (err) return callback(operation.mainError());
|
|
117391
|
-
const lockKey = file + opts.lockfilePath;
|
|
117392
|
-
const lockEntry = locks[lockKey] = {
|
|
117393
|
-
lockfilePath: getLockFile(file, opts),
|
|
117394
|
-
file,
|
|
117395
|
-
mtime,
|
|
117396
|
-
mtimePrecision: precision,
|
|
117397
|
-
options: opts,
|
|
117398
|
-
lastUpdate: Date.now(),
|
|
117399
|
-
released: false,
|
|
117400
|
-
updateTimeout: null,
|
|
117401
|
-
updateDelay: null
|
|
117402
|
-
};
|
|
117403
|
-
updateLock(file, opts);
|
|
117404
|
-
callback(null, (releasedCallback) => {
|
|
117405
|
-
if (lockEntry.released) return releasedCallback && releasedCallback(Object.assign(/* @__PURE__ */ new Error("Lock is already released"), { code: "ERELEASED" }));
|
|
117406
|
-
unlock(file, {
|
|
117407
|
-
...opts,
|
|
117408
|
-
realpath: false
|
|
117409
|
-
}, releasedCallback);
|
|
117410
|
-
});
|
|
117411
|
-
});
|
|
117412
|
-
});
|
|
117413
|
-
});
|
|
117414
|
-
}
|
|
117415
|
-
function unlock(file, options, callback) {
|
|
117416
|
-
const opts = {
|
|
117417
|
-
fs: graceful_fs_1.default,
|
|
117418
|
-
realpath: true,
|
|
117419
|
-
lockfilePath: "",
|
|
117420
|
-
...options
|
|
117421
|
-
};
|
|
117422
|
-
resolveCanonicalPath(file, opts, (err, resolvedFile) => {
|
|
117423
|
-
if (err) return callback(err);
|
|
117424
|
-
file = resolvedFile;
|
|
117425
|
-
const lockKey = file + opts.lockfilePath;
|
|
117426
|
-
const lockEntry = locks[lockKey];
|
|
117427
|
-
if (!lockEntry) return callback(Object.assign(/* @__PURE__ */ new Error("Lock is not acquired/owned by you"), { code: "ENOTACQUIRED" }));
|
|
117428
|
-
lockEntry.updateTimeout && clearTimeout(lockEntry.updateTimeout);
|
|
117429
|
-
lockEntry.released = true;
|
|
117430
|
-
delete locks[lockKey];
|
|
117431
|
-
removeLock(file, opts, callback);
|
|
117432
|
-
});
|
|
117433
|
-
}
|
|
117434
|
-
function check(file, options, callback) {
|
|
117435
|
-
const merged = {
|
|
117436
|
-
stale: 1e4,
|
|
117437
|
-
realpath: true,
|
|
117438
|
-
fs: graceful_fs_1.default,
|
|
117439
|
-
lockfilePath: "",
|
|
117440
|
-
...options
|
|
117441
|
-
};
|
|
117442
|
-
const opts = {
|
|
117443
|
-
...merged,
|
|
117444
|
-
stale: Math.max(merged.stale || 0, 2e3)
|
|
117445
|
-
};
|
|
117446
|
-
resolveCanonicalPath(file, opts, (err, resolvedFile) => {
|
|
117447
|
-
if (err) return callback(err);
|
|
117448
|
-
file = resolvedFile;
|
|
117449
|
-
opts.fs.stat(getLockFile(file, opts), (err, stat) => {
|
|
117450
|
-
if (err) return err.code === "ENOENT" ? callback(null, false) : callback(err);
|
|
117451
|
-
return callback(null, !isLockStale(stat, opts));
|
|
117452
|
-
});
|
|
117453
|
-
});
|
|
117454
|
-
}
|
|
117455
|
-
function getLocks() {
|
|
117456
|
-
return locks;
|
|
117457
|
-
}
|
|
117458
|
-
/* istanbul ignore next */
|
|
117459
|
-
(0, signal_exit_1.onExit)(() => {
|
|
117460
|
-
for (const entry of Object.values(locks)) try {
|
|
117461
|
-
entry.options.fs.rmdirSync(entry.lockfilePath);
|
|
117462
|
-
} catch (e) {}
|
|
117463
|
-
});
|
|
117464
|
-
}));
|
|
117465
|
-
//#endregion
|
|
117466
|
-
//#region node_modules/@pkcprotocol/proper-lock-file/dist/src/adapter.js
|
|
117467
|
-
var require_adapter = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
117468
|
-
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
117469
|
-
return mod && mod.__esModule ? mod : { "default": mod };
|
|
117470
|
-
};
|
|
117471
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
117472
|
-
exports.toPromise = toPromise;
|
|
117473
|
-
exports.toSync = toSync;
|
|
117474
|
-
exports.toSyncOptions = toSyncOptions;
|
|
117475
|
-
const graceful_fs_1 = __importDefault(require_graceful_fs());
|
|
117476
|
-
function createSyncFs(inputFs) {
|
|
117477
|
-
const methods = [
|
|
117478
|
-
"mkdir",
|
|
117479
|
-
"realpath",
|
|
117480
|
-
"stat",
|
|
117481
|
-
"rmdir",
|
|
117482
|
-
"utimes"
|
|
117483
|
-
];
|
|
117484
|
-
const newFs = { ...inputFs };
|
|
117485
|
-
methods.forEach((method) => {
|
|
117486
|
-
newFs[method] = (...args) => {
|
|
117487
|
-
const callback = args.pop();
|
|
117488
|
-
let ret;
|
|
117489
|
-
try {
|
|
117490
|
-
ret = inputFs[`${method}Sync`](...args);
|
|
117491
|
-
} catch (err) {
|
|
117492
|
-
return callback(err);
|
|
117493
|
-
}
|
|
117494
|
-
callback(null, ret);
|
|
117495
|
-
};
|
|
117496
|
-
});
|
|
117497
|
-
return newFs;
|
|
117498
|
-
}
|
|
117499
|
-
function toPromise(method) {
|
|
117500
|
-
return (...args) => new Promise((resolve, reject) => {
|
|
117501
|
-
args.push((err, result) => {
|
|
117502
|
-
if (err) reject(err);
|
|
117503
|
-
else resolve(result);
|
|
117504
|
-
});
|
|
117505
|
-
method(...args);
|
|
117506
|
-
});
|
|
117507
|
-
}
|
|
117508
|
-
function toSync(method) {
|
|
117509
|
-
return (...args) => {
|
|
117510
|
-
let err;
|
|
117511
|
-
let result;
|
|
117512
|
-
args.push((_err, _result) => {
|
|
117513
|
-
err = _err ?? void 0;
|
|
117514
|
-
result = _result;
|
|
117515
|
-
});
|
|
117516
|
-
method(...args);
|
|
117517
|
-
if (err) throw err;
|
|
117518
|
-
return result;
|
|
117519
|
-
};
|
|
116249
|
+
fd = fs$1.openSync(startLockPath, "r");
|
|
116250
|
+
} catch (e) {
|
|
116251
|
+
if (e.code === "ENOENT") return false;
|
|
116252
|
+
throw e;
|
|
117520
116253
|
}
|
|
117521
|
-
|
|
117522
|
-
|
|
117523
|
-
|
|
117524
|
-
|
|
117525
|
-
return
|
|
116254
|
+
try {
|
|
116255
|
+
fs$1.readSync(fd, Buffer.alloc(1), 0, 1, SQLITE_PENDING_BYTE_OFFSET);
|
|
116256
|
+
return false;
|
|
116257
|
+
} catch (e) {
|
|
116258
|
+
if (e.code === "EBUSY") return true;
|
|
116259
|
+
throw e;
|
|
116260
|
+
} finally {
|
|
116261
|
+
fs$1.closeSync(fd);
|
|
117526
116262
|
}
|
|
117527
|
-
}
|
|
117528
|
-
|
|
117529
|
-
|
|
117530
|
-
|
|
117531
|
-
|
|
117532
|
-
|
|
117533
|
-
|
|
117534
|
-
|
|
117535
|
-
|
|
117536
|
-
|
|
117537
|
-
|
|
117538
|
-
}
|
|
117539
|
-
};
|
|
117540
|
-
Object.defineProperty(o, k2, desc);
|
|
117541
|
-
}) : (function(o, m, k, k2) {
|
|
117542
|
-
if (k2 === void 0) k2 = k;
|
|
117543
|
-
o[k2] = m[k];
|
|
117544
|
-
}));
|
|
117545
|
-
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
117546
|
-
Object.defineProperty(o, "default", {
|
|
117547
|
-
enumerable: true,
|
|
117548
|
-
value: v
|
|
116263
|
+
}
|
|
116264
|
+
function isCommunityStartLockedSync(args) {
|
|
116265
|
+
const startLockPath = getStartLockPath(args);
|
|
116266
|
+
if (process.platform === "win32") return isCommunityStartLockedOnWindows(startLockPath);
|
|
116267
|
+
if (!fs$1.existsSync(startLockPath)) return false;
|
|
116268
|
+
let db;
|
|
116269
|
+
try {
|
|
116270
|
+
db = new Database(startLockPath, {
|
|
116271
|
+
readonly: true,
|
|
116272
|
+
fileMustExist: true,
|
|
116273
|
+
timeout: 0
|
|
117549
116274
|
});
|
|
117550
|
-
}
|
|
117551
|
-
|
|
117552
|
-
|
|
117553
|
-
|
|
117554
|
-
var ownKeys = function(o) {
|
|
117555
|
-
ownKeys = Object.getOwnPropertyNames || function(o) {
|
|
117556
|
-
var ar = [];
|
|
117557
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
117558
|
-
return ar;
|
|
117559
|
-
};
|
|
117560
|
-
return ownKeys(o);
|
|
117561
|
-
};
|
|
117562
|
-
return function(mod) {
|
|
117563
|
-
if (mod && mod.__esModule) return mod;
|
|
117564
|
-
var result = {};
|
|
117565
|
-
if (mod != null) {
|
|
117566
|
-
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
117567
|
-
}
|
|
117568
|
-
__setModuleDefault(result, mod);
|
|
117569
|
-
return result;
|
|
117570
|
-
};
|
|
117571
|
-
})())(require_lockfile());
|
|
117572
|
-
const adapter_1 = require_adapter();
|
|
117573
|
-
async function lock(file, options) {
|
|
117574
|
-
const release = await (0, adapter_1.toPromise)(lockfileModule.lock)(file, options);
|
|
117575
|
-
return (0, adapter_1.toPromise)(release);
|
|
117576
|
-
}
|
|
117577
|
-
function lockSync(file, options) {
|
|
117578
|
-
const release = (0, adapter_1.toSync)(lockfileModule.lock)(file, (0, adapter_1.toSyncOptions)(options));
|
|
117579
|
-
return (0, adapter_1.toSync)(release);
|
|
117580
|
-
}
|
|
117581
|
-
function unlock(file, options) {
|
|
117582
|
-
return (0, adapter_1.toPromise)(lockfileModule.unlock)(file, options);
|
|
117583
|
-
}
|
|
117584
|
-
function unlockSync(file, options) {
|
|
117585
|
-
return (0, adapter_1.toSync)(lockfileModule.unlock)(file, (0, adapter_1.toSyncOptions)(options));
|
|
117586
|
-
}
|
|
117587
|
-
function check(file, options) {
|
|
117588
|
-
return (0, adapter_1.toPromise)(lockfileModule.check)(file, options);
|
|
116275
|
+
} catch (e) {
|
|
116276
|
+
if (!fs$1.existsSync(startLockPath)) return false;
|
|
116277
|
+
if (isSqliteBusyError(e)) return true;
|
|
116278
|
+
throw e;
|
|
117589
116279
|
}
|
|
117590
|
-
|
|
117591
|
-
|
|
116280
|
+
try {
|
|
116281
|
+
db.prepare("SELECT 1 FROM sqlite_master").get();
|
|
116282
|
+
return false;
|
|
116283
|
+
} catch (e) {
|
|
116284
|
+
if (isSqliteBusyError(e)) return true;
|
|
116285
|
+
throw e;
|
|
116286
|
+
} finally {
|
|
116287
|
+
db.close();
|
|
117592
116288
|
}
|
|
117593
|
-
module.exports = Object.assign(lock, {
|
|
117594
|
-
lock,
|
|
117595
|
-
unlock,
|
|
117596
|
-
lockSync,
|
|
117597
|
-
unlockSync,
|
|
117598
|
-
check,
|
|
117599
|
-
checkSync
|
|
117600
|
-
});
|
|
117601
|
-
}));
|
|
117602
|
-
//#endregion
|
|
117603
|
-
//#region dist/node/runtime/node/community/start-lock.js
|
|
117604
|
-
var import_retry = /* @__PURE__ */ __toESM(require_retry$2(), 1);
|
|
117605
|
-
var import_src = /* @__PURE__ */ __toESM(require_src(), 1);
|
|
117606
|
-
const START_LOCK_CHECK_OPTIONS = {
|
|
117607
|
-
realpath: false,
|
|
117608
|
-
stale: 1e4
|
|
117609
|
-
};
|
|
117610
|
-
function getStartLockPaths({ dataPath, communityAddress }) {
|
|
117611
|
-
const communityDbPath = path.join(dataPath, "communities", communityAddress);
|
|
117612
|
-
return {
|
|
117613
|
-
communityDbPath,
|
|
117614
|
-
lockfilePath: `${communityDbPath}.start.lock`
|
|
117615
|
-
};
|
|
117616
116289
|
}
|
|
117617
116290
|
async function isCommunityStartLocked(args) {
|
|
117618
|
-
|
|
117619
|
-
return import_src.default.check(communityDbPath, {
|
|
117620
|
-
...START_LOCK_CHECK_OPTIONS,
|
|
117621
|
-
lockfilePath
|
|
117622
|
-
});
|
|
116291
|
+
return isCommunityStartLockedSync(args);
|
|
117623
116292
|
}
|
|
117624
|
-
function
|
|
117625
|
-
|
|
117626
|
-
|
|
117627
|
-
|
|
117628
|
-
|
|
116293
|
+
function isStartLockAttached(db) {
|
|
116294
|
+
return db.pragma("database_list").some((attached) => attached.name === START_LOCK_SCHEMA);
|
|
116295
|
+
}
|
|
116296
|
+
function takeStartLock({ db, dataPath, communityAddress }) {
|
|
116297
|
+
if (db.readonly) throw Error("The start lock of a community can't be taken on a read-only connection to its DB");
|
|
116298
|
+
if (db.inTransaction) throw Error("The start lock of a community can't be taken inside a transaction");
|
|
116299
|
+
const busyTimeout = db.pragma("busy_timeout", { simple: true });
|
|
116300
|
+
db.pragma(`busy_timeout = ${TAKE_START_LOCK_BUSY_TIMEOUT_MS}`);
|
|
116301
|
+
const startLockPath = getStartLockPath({
|
|
116302
|
+
dataPath,
|
|
116303
|
+
communityAddress
|
|
117629
116304
|
});
|
|
116305
|
+
if (!fs$1.existsSync(startLockPath)) new Database(startLockPath).close();
|
|
116306
|
+
let attached = false;
|
|
116307
|
+
try {
|
|
116308
|
+
db.prepare(`ATTACH DATABASE ? AS ${START_LOCK_SCHEMA}`).run(startLockPath);
|
|
116309
|
+
attached = true;
|
|
116310
|
+
db.pragma(`${START_LOCK_SCHEMA}.page_size = 512`);
|
|
116311
|
+
db.pragma(`${START_LOCK_SCHEMA}.cache_size = 0`);
|
|
116312
|
+
db.pragma(`${START_LOCK_SCHEMA}.journal_mode = MEMORY`);
|
|
116313
|
+
db.pragma(`${START_LOCK_SCHEMA}.locking_mode = EXCLUSIVE`);
|
|
116314
|
+
db.pragma(`${START_LOCK_SCHEMA}.user_version = 1`);
|
|
116315
|
+
return true;
|
|
116316
|
+
} catch (e) {
|
|
116317
|
+
if (attached) db.exec(`DETACH DATABASE ${START_LOCK_SCHEMA}`);
|
|
116318
|
+
if (isSqliteBusyError(e)) return false;
|
|
116319
|
+
throw e;
|
|
116320
|
+
} finally {
|
|
116321
|
+
db.pragma(`busy_timeout = ${busyTimeout}`);
|
|
116322
|
+
}
|
|
116323
|
+
}
|
|
116324
|
+
function releaseStartLock({ db, dataPath, communityAddress }) {
|
|
116325
|
+
if (!db.open || !isStartLockAttached(db)) return;
|
|
116326
|
+
db.exec(`DETACH DATABASE ${START_LOCK_SCHEMA}`);
|
|
116327
|
+
const now = /* @__PURE__ */ new Date();
|
|
116328
|
+
try {
|
|
116329
|
+
fs$1.utimesSync(getStartLockPath({
|
|
116330
|
+
dataPath,
|
|
116331
|
+
communityAddress
|
|
116332
|
+
}), now, now);
|
|
116333
|
+
} catch (e) {
|
|
116334
|
+
if (e.code !== "ENOENT") throw e;
|
|
116335
|
+
}
|
|
117630
116336
|
}
|
|
117631
116337
|
//#endregion
|
|
117632
116338
|
//#region dist/node/community/communities-entry-util.js
|
|
@@ -117838,6 +116544,10 @@ async function tryToDeleteCommunitiesThatFailedToBeDeletedBefore(pkc, log) {
|
|
|
117838
116544
|
const communityPath = path.join(pkc.dataPath, "communities", communityAddress);
|
|
117839
116545
|
try {
|
|
117840
116546
|
await promises.rm(communityPath, { force: true });
|
|
116547
|
+
await promises.rm(getStartLockPath({
|
|
116548
|
+
dataPath: pkc.dataPath,
|
|
116549
|
+
communityAddress
|
|
116550
|
+
}), { force: true });
|
|
117841
116551
|
log(`Succeeded in deleting old db path (${communityAddress})`);
|
|
117842
116552
|
communitiesThatWereDeletedSuccessfully.push(communityAddress);
|
|
117843
116553
|
} catch (e) {
|
|
@@ -118180,6 +116890,10 @@ async function moveCommunityDbToDeletedDirectory(communityAddress, pkc) {
|
|
|
118180
116890
|
sourceDb.close();
|
|
118181
116891
|
if (os.type() === "Windows_NT") await deleteOldCommunityInWindows(oldPath, pkc);
|
|
118182
116892
|
else await promises.rm(oldPath, { force: true });
|
|
116893
|
+
if (!existsSync(oldPath)) await promises.rm(getStartLockPath({
|
|
116894
|
+
dataPath: pkc.dataPath,
|
|
116895
|
+
communityAddress
|
|
116896
|
+
}), { force: true });
|
|
118183
116897
|
} catch (error) {
|
|
118184
116898
|
error.details = {
|
|
118185
116899
|
...error.details,
|
|
@@ -118210,11 +116924,10 @@ const COMMUNITIES_DIR_EXTENSIONS_TO_IGNORE = [
|
|
|
118210
116924
|
"-shm",
|
|
118211
116925
|
"-wal"
|
|
118212
116926
|
];
|
|
118213
|
-
const START_LOCK_SUFFIX = ".start.lock";
|
|
118214
116927
|
function isCommunitiesListChangeEvent({ pkc, filename }) {
|
|
118215
116928
|
if (typeof filename !== "string") return true;
|
|
118216
|
-
if (filename.endsWith(
|
|
118217
|
-
const communityAddress = filename.slice(0, -
|
|
116929
|
+
if (filename.endsWith(".start.lock.db")) {
|
|
116930
|
+
const communityAddress = filename.slice(0, -START_LOCK_FILE_SUFFIX.length);
|
|
118218
116931
|
const entry = pkc.communities.find((listed) => listed.address === communityAddress);
|
|
118219
116932
|
if (!entry) return true;
|
|
118220
116933
|
try {
|
|
@@ -156600,4 +155313,4 @@ var RpcLocalCommunity = class extends RpcRemoteCommunity {
|
|
|
156600
155313
|
}
|
|
156601
155314
|
};
|
|
156602
155315
|
//#endregion
|
|
156603
|
-
export { createSchemaRowParser as $, buildRuntimeCommunityFields as $n,
|
|
155316
|
+
export { createSchemaRowParser as $, buildRuntimeCommunityFields as $n, NAME_RESOLVE_FAILED_RETRY_FLOOR_MS as $r, RpcPublishCommunityListParamSchema as $t, findCommentInParsedPages as A, verifyChallengeAnswer as An, removeFileRetryingWhileBusy as Ar, parseRpcCommentUpdateEventWithPKCErrorIfItFails as At, GenericStateClient as B, verifyCommunityEdit as Bn, takeStartLock as Br, RpcCommunityIdentifierParamSchema as Bt, RepliesPages as C, signCommentModeration as Cn, getDefaultDataPath as Cr, parseCreateVoteOptionsSchemaWithPKCErrorIfItFails as Ct, extractCommunityRuntimeFieldsFromParsedPages as D, signCommunityEdit as Dn, monitorCommunitiesDirectory as Dr, parseJsonWithPKCErrorIfFails as Dt, buildPagesRuntimeFields as E, signCommunity as En, listCommunitiesSync as Er, parseDecryptedChallengeWithPKCErrorIfItFails as Et, cloneCrosspostForRuntime as F, verifyCommentIpfs as Fn, toCommunitiesEntry as Fr, RpcAuthorNameParamSchema as Ft, PKCTypedEmitter as G, getAuthorNameFromRuntime as Gn, n$5 as Gr, RpcExportCommunityParamSchema as Gt, InflightResourceTypes as H, verifyVote as Hn, t$4 as Hr, RpcEditCommunityParamSchema as Ht, collectCrosspostAuthorsToResolve as I, verifyCommentModeration as In, toCommunitiesWireEntry as Ir, RpcCancelExportParamSchema as It, decodeRpcChallengeRequestPubsubMsg as J, CreateCommunityListWithCidOptionsSchema as Jn, t$8 as Jr, RpcFetchCidResultSchema as Jt, decodeRpcChallengeAnswerPubsubMsg as K, getAuthorNameFromWire as Kn, n$6 as Kr, RpcExportCommunityResultSchema as Kt, extractCrosspostRuntimeFields as L, verifyCommentPubsubMessage as Ln, getStartLockPath as Lr, RpcCidParamSchema as Lt, parseRawPages as M, verifyChallengeRequest as Mn, setNativeFunctions as Mr, parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as Mt, MAX_PAGE_SIZE_BYTES as N, verifyChallengeVerification as Nn, tryToDeleteCommunitiesThatFailedToBeDeletedBefore as Nr, parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails as Nt, findCommentInPageInstance as O, signCommunityList as On, moveCommunityDbToDeletedDirectory as Or, parsePKCUserOptionsSchemaWithPKCErrorIfItFails as Ot, applyNameResolvedCacheToCrosspost as P, verifyCommentEdit as Pn, findCommunitiesEntry as Pr, RpcAnchorPublishPreparationResultSchema as Pt, collectSchemaRowCoercions as Q, effectiveMaxCrosspostDepth as Qn, NAME_RESOLVED_TRUE_TTL_MS as Qr, RpcPublishChallengeAnswersParamSchema as Qt, stripNameResolvedFromCrosspost as R, verifyCommentUpdate as Rn, isCommunityStartLocked as Rr, RpcCommentRepliesPageParamSchema as Rt, MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS as S, signCommentEdit as Sn, getDefaultCommunityDbConfig as Sr, parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails as St, buildPageRuntimeFields as T, signCommentUpdateForChallengeVerification as Tn, importSignerIntoKuboNode as Tr, parseDecryptedChallengeVerification as Tt, pRetry as U, buildRuntimeAuthor as Un, r as Ur, RpcExportCommunityModLogsParamSchema as Ut, InflightFetchManager as V, verifyCommunityList as Vn, t$2 as Vr, RpcCommunityPageParamSchema as Vt, pLimit as W, cleanWireAuthor as Wn, t$5 as Wr, RpcExportCommunityModLogsResultSchema as Wt, coerceSchemaRowBoolean as X, MAX_COMMUNITY_LIST_SIZE_BYTES as Xn, MAX_FILE_SIZE_BYTES_FOR_COMMENT_UPDATE as Xr, RpcFetchCommunityListResultSchema as Xt, decodeRpcChallengeVerificationPubsubMsg as Y, CreateNewCommunityListOptionsSchema as Yn, stringify as Yr, RpcFetchCommunityListParamSchema as Yt, coerceSchemaRowJson as Z, crosspostChainDepthUpTo as Zn, NAME_RESOLVED_FALSE_TTL_MS as Zr, RpcPublishAnchorRecordParamSchema as Zt, createAuthorIdentityMatcher as _, signChallengeAnswer as _n, deriveCommentIpfsFromCommentTableRow as _r, parseCreateCommentOptionsSchemaWithPKCErrorIfItFails as _t, generatePagesReportingFailedSorts as a, RpcUnsubscribeParamSchema as an, encode as ar, parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as at, KeyvBetterSqlite3 as b, signChallengeVerification as bn, findLocalCommunityAddress as br, parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails as bt, resolvePageSortsOrThrow as c, SignerWithPublicKeyAddress as cn, getPKCAddressFromPublicKey as cr, parseCommentUpdateSchemaWithPKCErrorIfItFails as ct, getChallengeVerification as d, decryptEd25519AesGcm as dn, BackupAbortError as dr, parseCommunityEditOptionsSchemaWithPKCErrorIfItFails as dt, STORAGE_KEYS as ei, RpcPublishCommunityListResultSchema as en, getCommunityAddressFromRecord as er, parseCidStringSchemaWithPKCErrorIfItFails as et, getCommunityChallengeFromCommunityChallengeSettings as f, decryptEd25519AesGcmPublicKeyBuffer as fn, backupCommunityDb as fr, parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails as ft, authorNameResolveFailureReason as g, cleanUpBeforePublishing as gn, deleteOldCommunityInWindows as gr, parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails as gt, authorIdentityMatcherForRequest as h, _validateSignatureOfPKCRecord as hn, createKuboRpcClient as hr, parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails as ht, derivePublicPageSorts as i, RpcSuccessResultSchema as in, decode as ir, parseCommentIpfsSchemaWithPKCErrorIfItFails as it, iterateOverPageCidsToFindAllCids as j, verifyChallengeMessage as jn, resolveDbPostsCidRefs as jr, parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails as jt, findCommentInPageInstanceRecursively as k, signVote as kn, refreshCommunitiesList as kr, parseRpcCommentEventWithPKCErrorIfItFails as kt, pkcJsPageSorts as l, createSigner as ln, getPKCAddressFromPublicKeySync as lr, parseCommunityAddressWithPKCErrorIfItFails as lt, pkcJsChallenges as m, encryptEd25519AesGcmPublicKeyBuffer as mn, calculateInlineRepliesBudget as mr, parseCommunityListSchemaWithPKCErrorIfItFails as mt, RpcRemoteCommunity as n, nativeFunctions$1 as ni, RpcResolveAuthorNameResultSchema as nn, getCommunityPublicKeyFromWire as nr, parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as nt, loadPageSortsForStartedCommunity as o, findCommunityRecordNameMismatch as on, getBufferedPKCAddressFromPublicKey as or, parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails as ot, loadChallengeFileFromCommunityChallengeSettings as p, encryptEd25519AesGcm as pn, calculateExpectedSignatureSize as pr, parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails as pt, decodeRpcChallengePubsubMsg as q, normalizeCreatePublicationAuthor as qn, t$7 as qr, RpcFetchCidParamSchema as qt, computePageSortsFingerprint as r, RpcSubscriptionIdResultSchema as rn, normalizeCommunityInputFromCommunity as rr, parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails as rt, lookupPageSortFactories as s, require_lib as sn, getIpfsKeyFromPrivateKey as sr, parseCommentPubsubMessagePublicationWithPKCErrorIfItFails as st, RpcLocalCommunity as t, require_lodash_merge as ti, RpcPublishedAnchorRecordResultSchema as tn, getCommunityNameFromWire$1 as tr, parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as tt, deriveCommunityChallengesOrThrow as u, createAnchorIpnsRecord as un, getPublicKeyFromPrivateKey as ur, parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as ut, TrackedInstanceRegistry as v, signChallengeMessage as vn, deriveDbPosts as vr, parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails as vt, TIMEFRAMES_TO_SECONDS as w, signCommentUpdate as wn, getThumbnailPropsOfLink as wr, parseDecryptedChallengeAnswerWithPKCErrorIfItFails as wt, RemoteCommunity as x, signComment as xn, forgetCommunityThatFailedToBeDeleted as xr, parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails as xt, LRUCache as y, signChallengeRequest as yn, deriveDbReplies as yr, parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails as yt, PKCClientsManager as z, verifyCommunity as zn, releaseStartLock as zr, RpcCommunitiesChangeEventResultSchema as zt };
|