@awsless/cli 0.1.17 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +255 -1858
- package/package.json +11 -12
package/dist/bin.js
CHANGED
|
@@ -118797,7 +118797,7 @@ var require_client4 = __commonJS((exports) => {
|
|
|
118797
118797
|
};
|
|
118798
118798
|
};
|
|
118799
118799
|
var sleep2 = (seconds9) => {
|
|
118800
|
-
return new Promise((
|
|
118800
|
+
return new Promise((resolve5) => setTimeout(resolve5, seconds9 * 1000));
|
|
118801
118801
|
};
|
|
118802
118802
|
var waiterServiceDefaults = {
|
|
118803
118803
|
minDelay: 2,
|
|
@@ -118926,8 +118926,8 @@ var require_client4 = __commonJS((exports) => {
|
|
|
118926
118926
|
};
|
|
118927
118927
|
var abortTimeout = (abortSignal) => {
|
|
118928
118928
|
let onAbort;
|
|
118929
|
-
const promise2 = new Promise((
|
|
118930
|
-
onAbort = () =>
|
|
118929
|
+
const promise2 = new Promise((resolve5) => {
|
|
118930
|
+
onAbort = () => resolve5({ state: WaiterState.ABORTED });
|
|
118931
118931
|
if (typeof abortSignal.addEventListener === "function") {
|
|
118932
118932
|
abortSignal.addEventListener("abort", onAbort);
|
|
118933
118933
|
} else {
|
|
@@ -119581,7 +119581,7 @@ var require_client4 = __commonJS((exports) => {
|
|
|
119581
119581
|
// ../../node_modules/.pnpm/@smithy+core@3.29.7/node_modules/@smithy/core/dist-cjs/submodules/config/index.js
|
|
119582
119582
|
var require_config2 = __commonJS((exports) => {
|
|
119583
119583
|
var { homedir: homedir3 } = __require("os");
|
|
119584
|
-
var { sep: sep6, join:
|
|
119584
|
+
var { sep: sep6, join: join51 } = __require("path");
|
|
119585
119585
|
var { createHash: createHash22 } = __require("crypto");
|
|
119586
119586
|
var { readFile: readFile$1 } = __require("fs/promises");
|
|
119587
119587
|
var { IniSectionType: IniSectionType2 } = require_dist_cjs();
|
|
@@ -119739,7 +119739,7 @@ var require_config2 = __commonJS((exports) => {
|
|
|
119739
119739
|
var getSSOTokenFilepath2 = (id) => {
|
|
119740
119740
|
const hasher = createHash22("sha1");
|
|
119741
119741
|
const cacheName = hasher.update(id).digest("hex");
|
|
119742
|
-
return
|
|
119742
|
+
return join51(getHomeDir(), ".aws", "sso", "cache", `${cacheName}.json`);
|
|
119743
119743
|
};
|
|
119744
119744
|
var tokenIntercept = {};
|
|
119745
119745
|
var getSSOTokenFromFile3 = async (id) => {
|
|
@@ -119766,9 +119766,9 @@ var require_config2 = __commonJS((exports) => {
|
|
|
119766
119766
|
...data.default && { default: data.default }
|
|
119767
119767
|
});
|
|
119768
119768
|
var ENV_CONFIG_PATH = "AWS_CONFIG_FILE";
|
|
119769
|
-
var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] ||
|
|
119769
|
+
var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || join51(getHomeDir(), ".aws", "config");
|
|
119770
119770
|
var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE";
|
|
119771
|
-
var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] ||
|
|
119771
|
+
var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || join51(getHomeDir(), ".aws", "credentials");
|
|
119772
119772
|
var prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@+.%:/]+)\2$/;
|
|
119773
119773
|
var profileNameBlockList = ["__proto__", "profile __proto__"];
|
|
119774
119774
|
var parseIni = (iniData) => {
|
|
@@ -119834,11 +119834,11 @@ var require_config2 = __commonJS((exports) => {
|
|
|
119834
119834
|
const relativeHomeDirPrefix = "~/";
|
|
119835
119835
|
let resolvedFilepath = filepath;
|
|
119836
119836
|
if (filepath.startsWith(relativeHomeDirPrefix)) {
|
|
119837
|
-
resolvedFilepath =
|
|
119837
|
+
resolvedFilepath = join51(homeDir, filepath.slice(2));
|
|
119838
119838
|
}
|
|
119839
119839
|
let resolvedConfigFilepath = configFilepath;
|
|
119840
119840
|
if (configFilepath.startsWith(relativeHomeDirPrefix)) {
|
|
119841
|
-
resolvedConfigFilepath =
|
|
119841
|
+
resolvedConfigFilepath = join51(homeDir, configFilepath.slice(2));
|
|
119842
119842
|
}
|
|
119843
119843
|
const parsedFiles = await Promise.all([
|
|
119844
119844
|
readFile21(resolvedConfigFilepath, {
|
|
@@ -120055,7 +120055,7 @@ var require_config2 = __commonJS((exports) => {
|
|
|
120055
120055
|
};
|
|
120056
120056
|
var imdsRequest = async (options) => {
|
|
120057
120057
|
const { request } = __require("http");
|
|
120058
|
-
return new Promise((
|
|
120058
|
+
return new Promise((resolve5, reject) => {
|
|
120059
120059
|
const req = request({
|
|
120060
120060
|
hostname: options.hostname,
|
|
120061
120061
|
port: options.port,
|
|
@@ -120083,7 +120083,7 @@ var require_config2 = __commonJS((exports) => {
|
|
|
120083
120083
|
const chunks = [];
|
|
120084
120084
|
res.on("data", (chunk3) => chunks.push(chunk3));
|
|
120085
120085
|
res.on("end", () => {
|
|
120086
|
-
|
|
120086
|
+
resolve5(Buffer.concat(chunks));
|
|
120087
120087
|
req.destroy();
|
|
120088
120088
|
});
|
|
120089
120089
|
});
|
|
@@ -121091,7 +121091,7 @@ var require_serde2 = __commonJS((exports) => {
|
|
|
121091
121091
|
var { ReadStream: ReadStream2, lstatSync, fstatSync } = __require("fs");
|
|
121092
121092
|
var { HttpResponse: HttpResponse2 } = require_transport3();
|
|
121093
121093
|
var { toEndpointV1 } = require_endpoints2();
|
|
121094
|
-
var { Readable
|
|
121094
|
+
var { Readable, Writable, PassThrough } = __require("stream");
|
|
121095
121095
|
var isArrayBuffer = (arg) => typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer || Object.prototype.toString.call(arg) === "[object ArrayBuffer]";
|
|
121096
121096
|
var fromArrayBuffer = (input, offset = 0, length2 = input.byteLength - offset) => {
|
|
121097
121097
|
if (!isArrayBuffer(input)) {
|
|
@@ -122004,7 +122004,7 @@ var require_serde2 = __commonJS((exports) => {
|
|
|
122004
122004
|
}
|
|
122005
122005
|
return fromArrayBuffer(toCast);
|
|
122006
122006
|
}
|
|
122007
|
-
var ChecksumStream$1 = class ChecksumStream2 extends
|
|
122007
|
+
var ChecksumStream$1 = class ChecksumStream2 extends Readable {
|
|
122008
122008
|
expectedChecksum;
|
|
122009
122009
|
checksumSourceLocation;
|
|
122010
122010
|
checksum;
|
|
@@ -122288,7 +122288,7 @@ var require_serde2 = __commonJS((exports) => {
|
|
|
122288
122288
|
if (isReadableStream(upstream)) {
|
|
122289
122289
|
return createBufferedReadableStream(upstream, size, logger2);
|
|
122290
122290
|
}
|
|
122291
|
-
const downstream = new
|
|
122291
|
+
const downstream = new Readable({ read() {} });
|
|
122292
122292
|
let streamBufferingLoggedWarning = false;
|
|
122293
122293
|
let bytesSeen = 0;
|
|
122294
122294
|
const buffers = [
|
|
@@ -122372,7 +122372,7 @@ ${value}\r
|
|
|
122372
122372
|
const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options;
|
|
122373
122373
|
const checksumRequired = base64Encoder !== undefined && checksumAlgorithmFn !== undefined && checksumLocationName !== undefined && streamHasher !== undefined;
|
|
122374
122374
|
const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readable) : undefined;
|
|
122375
|
-
const awsChunkedEncodingStream = new
|
|
122375
|
+
const awsChunkedEncodingStream = new Readable({
|
|
122376
122376
|
read: () => {}
|
|
122377
122377
|
});
|
|
122378
122378
|
readable.on("data", (data) => {
|
|
@@ -122434,7 +122434,7 @@ ${value}\r
|
|
|
122434
122434
|
if (isReadableStream(stream)) {
|
|
122435
122435
|
return headStream$1(stream, bytes2);
|
|
122436
122436
|
}
|
|
122437
|
-
return new Promise((
|
|
122437
|
+
return new Promise((resolve5, reject) => {
|
|
122438
122438
|
const collector = new Collector$1;
|
|
122439
122439
|
collector.limit = bytes2;
|
|
122440
122440
|
stream.pipe(collector);
|
|
@@ -122445,7 +122445,7 @@ ${value}\r
|
|
|
122445
122445
|
collector.on("error", reject);
|
|
122446
122446
|
collector.on("finish", function() {
|
|
122447
122447
|
const bytes3 = concatBytes(this.buffers);
|
|
122448
|
-
|
|
122448
|
+
resolve5(bytes3);
|
|
122449
122449
|
});
|
|
122450
122450
|
});
|
|
122451
122451
|
};
|
|
@@ -122559,7 +122559,7 @@ ${value}\r
|
|
|
122559
122559
|
if (isReadableStream(stream)) {
|
|
122560
122560
|
return collectReadableStream(stream);
|
|
122561
122561
|
}
|
|
122562
|
-
return new Promise((
|
|
122562
|
+
return new Promise((resolve5, reject) => {
|
|
122563
122563
|
const collector = new Collector;
|
|
122564
122564
|
const nodeStream = stream;
|
|
122565
122565
|
nodeStream.pipe(collector);
|
|
@@ -122570,7 +122570,7 @@ ${value}\r
|
|
|
122570
122570
|
collector.on("error", reject);
|
|
122571
122571
|
collector.on("finish", function() {
|
|
122572
122572
|
const bytes2 = concatBytes(this.bufferedBytes);
|
|
122573
|
-
|
|
122573
|
+
resolve5(bytes2);
|
|
122574
122574
|
});
|
|
122575
122575
|
});
|
|
122576
122576
|
};
|
|
@@ -122584,7 +122584,7 @@ ${value}\r
|
|
|
122584
122584
|
}
|
|
122585
122585
|
var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed.";
|
|
122586
122586
|
var sdkStreamMixin2 = (stream) => {
|
|
122587
|
-
if (!(stream instanceof
|
|
122587
|
+
if (!(stream instanceof Readable)) {
|
|
122588
122588
|
try {
|
|
122589
122589
|
return sdkStreamMixin$1(stream);
|
|
122590
122590
|
} catch (ignored) {
|
|
@@ -122618,11 +122618,11 @@ ${value}\r
|
|
|
122618
122618
|
if (stream.readableFlowing !== null) {
|
|
122619
122619
|
throw new Error("The stream has been consumed by other callbacks.");
|
|
122620
122620
|
}
|
|
122621
|
-
if (typeof
|
|
122621
|
+
if (typeof Readable.toWeb !== "function") {
|
|
122622
122622
|
throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");
|
|
122623
122623
|
}
|
|
122624
122624
|
transformed = true;
|
|
122625
|
-
return
|
|
122625
|
+
return Readable.toWeb(stream);
|
|
122626
122626
|
}
|
|
122627
122627
|
});
|
|
122628
122628
|
};
|
|
@@ -122762,7 +122762,7 @@ var require_checksum2 = __commonJS((exports) => {
|
|
|
122762
122762
|
callback();
|
|
122763
122763
|
}
|
|
122764
122764
|
}
|
|
122765
|
-
var fileStreamHasher = (hashCtor, fileStream) => new Promise((
|
|
122765
|
+
var fileStreamHasher = (hashCtor, fileStream) => new Promise((resolve5, reject) => {
|
|
122766
122766
|
if (!isReadStream(fileStream)) {
|
|
122767
122767
|
reject(new Error("Unable to calculate hash for non-file streams."));
|
|
122768
122768
|
return;
|
|
@@ -122780,7 +122780,7 @@ var require_checksum2 = __commonJS((exports) => {
|
|
|
122780
122780
|
});
|
|
122781
122781
|
hashCalculator.on("error", reject);
|
|
122782
122782
|
hashCalculator.on("finish", function() {
|
|
122783
|
-
hash3.digest().then(
|
|
122783
|
+
hash3.digest().then(resolve5).catch(reject);
|
|
122784
122784
|
});
|
|
122785
122785
|
});
|
|
122786
122786
|
var isReadStream = (stream) => typeof stream.path === "string";
|
|
@@ -122791,14 +122791,14 @@ var require_checksum2 = __commonJS((exports) => {
|
|
|
122791
122791
|
const hash3 = new hashCtor;
|
|
122792
122792
|
const hashCalculator = new HashCalculator(hash3);
|
|
122793
122793
|
readableStream.pipe(hashCalculator);
|
|
122794
|
-
return new Promise((
|
|
122794
|
+
return new Promise((resolve5, reject) => {
|
|
122795
122795
|
readableStream.on("error", (err) => {
|
|
122796
122796
|
hashCalculator.end();
|
|
122797
122797
|
reject(err);
|
|
122798
122798
|
});
|
|
122799
122799
|
hashCalculator.on("error", reject);
|
|
122800
122800
|
hashCalculator.on("finish", () => {
|
|
122801
|
-
hash3.digest().then(
|
|
122801
|
+
hash3.digest().then(resolve5).catch(reject);
|
|
122802
122802
|
});
|
|
122803
122803
|
});
|
|
122804
122804
|
};
|
|
@@ -123343,7 +123343,7 @@ var require_checksum2 = __commonJS((exports) => {
|
|
|
123343
123343
|
var require_event_streams2 = __commonJS((exports) => {
|
|
123344
123344
|
var { Crc32 } = require_checksum2();
|
|
123345
123345
|
var { toHex, fromHex, toUtf8: toUtf83, fromUtf8: fromUtf83 } = require_serde2();
|
|
123346
|
-
var { Readable
|
|
123346
|
+
var { Readable } = __require("stream");
|
|
123347
123347
|
var { TypeRegistry: TypeRegistry3 } = require_schema2();
|
|
123348
123348
|
|
|
123349
123349
|
class Int64 {
|
|
@@ -123881,7 +123881,7 @@ var require_event_streams2 = __commonJS((exports) => {
|
|
|
123881
123881
|
return this.universalMarshaller.deserialize(bodyIterable, deserializer);
|
|
123882
123882
|
}
|
|
123883
123883
|
serialize(input, serializer) {
|
|
123884
|
-
return
|
|
123884
|
+
return Readable.from(this.universalMarshaller.serialize(input, serializer));
|
|
123885
123885
|
}
|
|
123886
123886
|
}
|
|
123887
123887
|
var eventStreamSerdeProvider = (options) => new EventStreamMarshaller(options);
|
|
@@ -123904,7 +123904,7 @@ var require_event_streams2 = __commonJS((exports) => {
|
|
|
123904
123904
|
streamEnded = true;
|
|
123905
123905
|
});
|
|
123906
123906
|
while (!generationEnded) {
|
|
123907
|
-
const value = await new Promise((
|
|
123907
|
+
const value = await new Promise((resolve5) => setTimeout(() => resolve5(records.shift()), 0));
|
|
123908
123908
|
if (value) {
|
|
123909
123909
|
yield value;
|
|
123910
123910
|
}
|
|
@@ -126747,7 +126747,7 @@ var init_node_http2 = () => {};
|
|
|
126747
126747
|
|
|
126748
126748
|
// ../../node_modules/.pnpm/@smithy+credential-provider-imds@4.4.10/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/httpRequest.js
|
|
126749
126749
|
function httpRequest2(options) {
|
|
126750
|
-
return new Promise((
|
|
126750
|
+
return new Promise((resolve5, reject) => {
|
|
126751
126751
|
const req = node_http2.request({
|
|
126752
126752
|
method: "GET",
|
|
126753
126753
|
...options,
|
|
@@ -126772,7 +126772,7 @@ function httpRequest2(options) {
|
|
|
126772
126772
|
chunks.push(chunk3);
|
|
126773
126773
|
});
|
|
126774
126774
|
res.on("end", () => {
|
|
126775
|
-
|
|
126775
|
+
resolve5(Buffer.concat(chunks));
|
|
126776
126776
|
req.destroy();
|
|
126777
126777
|
});
|
|
126778
126778
|
});
|
|
@@ -127217,7 +127217,7 @@ var retryWrapper2 = (toRetry, maxRetries, delayMs) => {
|
|
|
127217
127217
|
try {
|
|
127218
127218
|
return await toRetry();
|
|
127219
127219
|
} catch (e4) {
|
|
127220
|
-
await new Promise((
|
|
127220
|
+
await new Promise((resolve5) => setTimeout(resolve5, delayMs));
|
|
127221
127221
|
}
|
|
127222
127222
|
}
|
|
127223
127223
|
return await toRetry();
|
|
@@ -127229,12 +127229,12 @@ import fs7 from "fs/promises";
|
|
|
127229
127229
|
var import_client27, import_config42, import_node_http_handler3, AWS_CONTAINER_CREDENTIALS_RELATIVE_URI2 = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI", DEFAULT_LINK_LOCAL_HOST2 = "http://169.254.170.2", AWS_CONTAINER_CREDENTIALS_FULL_URI2 = "AWS_CONTAINER_CREDENTIALS_FULL_URI", AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE2 = "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE", AWS_CONTAINER_AUTHORIZATION_TOKEN2 = "AWS_CONTAINER_AUTHORIZATION_TOKEN", fromHttp2 = (options = {}) => {
|
|
127230
127230
|
options.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");
|
|
127231
127231
|
let host;
|
|
127232
|
-
const
|
|
127232
|
+
const relative13 = options.awsContainerCredentialsRelativeUri ?? process.env[AWS_CONTAINER_CREDENTIALS_RELATIVE_URI2];
|
|
127233
127233
|
const full = options.awsContainerCredentialsFullUri ?? process.env[AWS_CONTAINER_CREDENTIALS_FULL_URI2];
|
|
127234
127234
|
const token = options.awsContainerAuthorizationToken ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN2];
|
|
127235
127235
|
const tokenFile = options.awsContainerAuthorizationTokenFile ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE2];
|
|
127236
127236
|
const warn = options.logger?.constructor?.name === "NoOpLogger" || !options.logger?.warn ? console.warn : options.logger.warn.bind(options.logger);
|
|
127237
|
-
if (
|
|
127237
|
+
if (relative13 && full) {
|
|
127238
127238
|
warn("@aws-sdk/credential-provider-http: " + "you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri.");
|
|
127239
127239
|
warn("awsContainerCredentialsRelativeUri will take precedence.");
|
|
127240
127240
|
}
|
|
@@ -127242,8 +127242,8 @@ var import_client27, import_config42, import_node_http_handler3, AWS_CONTAINER_C
|
|
|
127242
127242
|
warn("@aws-sdk/credential-provider-http: " + "you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile.");
|
|
127243
127243
|
warn("awsContainerAuthorizationTokenFile will take precedence.");
|
|
127244
127244
|
}
|
|
127245
|
-
if (
|
|
127246
|
-
host = `${DEFAULT_LINK_LOCAL_HOST2}${
|
|
127245
|
+
if (relative13) {
|
|
127246
|
+
host = `${DEFAULT_LINK_LOCAL_HOST2}${relative13}`;
|
|
127247
127247
|
} else if (full) {
|
|
127248
127248
|
host = full;
|
|
127249
127249
|
} else {
|
|
@@ -130717,7 +130717,7 @@ var require_signin2 = __commonJS((exports) => {
|
|
|
130717
130717
|
import { createHash as createHash22, createPrivateKey as createPrivateKey2, createPublicKey as createPublicKey2, sign as sign2 } from "crypto";
|
|
130718
130718
|
import { promises as fs8 } from "fs";
|
|
130719
130719
|
import { homedir as homedir4 } from "os";
|
|
130720
|
-
import { dirname as
|
|
130720
|
+
import { dirname as dirname26, join as join54 } from "path";
|
|
130721
130721
|
var import_config53, import_protocols10, LoginCredentialsFetcher2;
|
|
130722
130722
|
var init_LoginCredentialsFetcher2 = __esm(() => {
|
|
130723
130723
|
import_config53 = __toESM(require_config(), 1);
|
|
@@ -130869,17 +130869,17 @@ var init_LoginCredentialsFetcher2 = __esm(() => {
|
|
|
130869
130869
|
}
|
|
130870
130870
|
async saveToken(token) {
|
|
130871
130871
|
const tokenFilePath = this.getTokenFilePath();
|
|
130872
|
-
const directory =
|
|
130872
|
+
const directory = dirname26(tokenFilePath);
|
|
130873
130873
|
try {
|
|
130874
130874
|
await fs8.mkdir(directory, { recursive: true });
|
|
130875
130875
|
} catch (error52) {}
|
|
130876
130876
|
await fs8.writeFile(tokenFilePath, JSON.stringify(token, null, 2), "utf8");
|
|
130877
130877
|
}
|
|
130878
130878
|
getTokenFilePath() {
|
|
130879
|
-
const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ??
|
|
130879
|
+
const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? join54(homedir4(), ".aws", "login", "cache");
|
|
130880
130880
|
const loginSessionBytes = Buffer.from(this.loginSession, "utf8");
|
|
130881
130881
|
const loginSessionSha256 = createHash22("sha256").update(loginSessionBytes).digest("hex");
|
|
130882
|
-
return
|
|
130882
|
+
return join54(directory, `${loginSessionSha256}.json`);
|
|
130883
130883
|
}
|
|
130884
130884
|
derToRawSignature(derSignature) {
|
|
130885
130885
|
let offset = 2;
|
|
@@ -196109,6 +196109,24 @@ var createTestManifest = (appConfig, stackConfigs) => {
|
|
|
196109
196109
|
manifest.instances.push({ stack: stack.name, id });
|
|
196110
196110
|
}
|
|
196111
196111
|
}
|
|
196112
|
+
const byStackAndId = (left, right) => {
|
|
196113
|
+
return left.stack.localeCompare(right.stack) || left.id.localeCompare(right.id);
|
|
196114
|
+
};
|
|
196115
|
+
manifest.tables.sort((left, right) => {
|
|
196116
|
+
return String(left.TableName).localeCompare(String(right.TableName));
|
|
196117
|
+
});
|
|
196118
|
+
manifest.tableKeys.sort(byStackAndId);
|
|
196119
|
+
manifest.streams.sort(byStackAndId);
|
|
196120
|
+
manifest.searches.sort(byStackAndId);
|
|
196121
|
+
manifest.functions.sort(byStackAndId);
|
|
196122
|
+
manifest.tasks.sort(byStackAndId);
|
|
196123
|
+
manifest.queues.sort(byStackAndId);
|
|
196124
|
+
manifest.caches.sort(byStackAndId);
|
|
196125
|
+
manifest.jobs.sort(byStackAndId);
|
|
196126
|
+
manifest.instances.sort(byStackAndId);
|
|
196127
|
+
manifest.topics.sort();
|
|
196128
|
+
manifest.pubsub.sort();
|
|
196129
|
+
manifest.alerts.sort();
|
|
196112
196130
|
return manifest;
|
|
196113
196131
|
};
|
|
196114
196132
|
|
|
@@ -197428,1688 +197446,58 @@ var bind = (program3) => {
|
|
|
197428
197446
|
});
|
|
197429
197447
|
};
|
|
197430
197448
|
|
|
197431
|
-
// ../../node_modules/.pnpm/chokidar@5.0.0/node_modules/chokidar/index.js
|
|
197432
|
-
import { EventEmitter as EventEmitter3 } from "events";
|
|
197433
|
-
import { stat as statcb, Stats } from "fs";
|
|
197434
|
-
import { readdir as readdir7, stat as stat8 } from "fs/promises";
|
|
197435
|
-
import * as sp2 from "path";
|
|
197436
|
-
|
|
197437
|
-
// ../../node_modules/.pnpm/readdirp@5.1.1/node_modules/readdirp/index.js
|
|
197438
|
-
import { lstat as lstat3, readdir as readdir6, realpath, stat as stat6 } from "fs/promises";
|
|
197439
|
-
import { join as pjoin, resolve as presolve, sep as psep } from "path";
|
|
197440
|
-
import { Readable } from "stream";
|
|
197441
|
-
var EntryTypes = {
|
|
197442
|
-
FILE_TYPE: "files",
|
|
197443
|
-
DIR_TYPE: "directories",
|
|
197444
|
-
FILE_DIR_TYPE: "files_directories",
|
|
197445
|
-
EVERYTHING_TYPE: "all"
|
|
197446
|
-
};
|
|
197447
|
-
var defaultOptions3 = {
|
|
197448
|
-
root: ".",
|
|
197449
|
-
fileFilter: (_entryInfo) => true,
|
|
197450
|
-
directoryFilter: (_entryInfo) => true,
|
|
197451
|
-
type: EntryTypes.FILE_TYPE,
|
|
197452
|
-
lstat: false,
|
|
197453
|
-
depth: 2147483648,
|
|
197454
|
-
alwaysStat: false,
|
|
197455
|
-
highWaterMark: 256
|
|
197456
|
-
};
|
|
197457
|
-
Object.freeze(defaultOptions3);
|
|
197458
|
-
var RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR";
|
|
197459
|
-
var NORMAL_FLOW_ERRORS = new Set(["ENOENT", "EPERM", "EACCES", "ELOOP", RECURSIVE_ERROR_CODE]);
|
|
197460
|
-
var ALL_TYPES = [
|
|
197461
|
-
EntryTypes.DIR_TYPE,
|
|
197462
|
-
EntryTypes.EVERYTHING_TYPE,
|
|
197463
|
-
EntryTypes.FILE_DIR_TYPE,
|
|
197464
|
-
EntryTypes.FILE_TYPE
|
|
197465
|
-
];
|
|
197466
|
-
var DIR_TYPES = new Set([
|
|
197467
|
-
EntryTypes.DIR_TYPE,
|
|
197468
|
-
EntryTypes.EVERYTHING_TYPE,
|
|
197469
|
-
EntryTypes.FILE_DIR_TYPE
|
|
197470
|
-
]);
|
|
197471
|
-
var FILE_TYPES = new Set([
|
|
197472
|
-
EntryTypes.EVERYTHING_TYPE,
|
|
197473
|
-
EntryTypes.FILE_DIR_TYPE,
|
|
197474
|
-
EntryTypes.FILE_TYPE
|
|
197475
|
-
]);
|
|
197476
|
-
var isNormalFlowError = (error52) => NORMAL_FLOW_ERRORS.has(error52.code);
|
|
197477
|
-
var wantBigintFsStats = process.platform === "win32";
|
|
197478
|
-
var emptyFn = (_entryInfo) => true;
|
|
197479
|
-
var normalizeFilter = (filter2) => {
|
|
197480
|
-
if (filter2 === undefined)
|
|
197481
|
-
return emptyFn;
|
|
197482
|
-
if (typeof filter2 === "function")
|
|
197483
|
-
return filter2;
|
|
197484
|
-
if (typeof filter2 === "string") {
|
|
197485
|
-
const fl = filter2.trim();
|
|
197486
|
-
return (entry) => entry.basename === fl;
|
|
197487
|
-
}
|
|
197488
|
-
if (Array.isArray(filter2)) {
|
|
197489
|
-
const trItems = filter2.map((item) => item.trim());
|
|
197490
|
-
return (entry) => trItems.some((f4) => entry.basename === f4);
|
|
197491
|
-
}
|
|
197492
|
-
return emptyFn;
|
|
197493
|
-
};
|
|
197494
|
-
|
|
197495
|
-
class ReaddirpStream extends Readable {
|
|
197496
|
-
parents;
|
|
197497
|
-
reading;
|
|
197498
|
-
parent;
|
|
197499
|
-
_stat;
|
|
197500
|
-
_maxDepth;
|
|
197501
|
-
_wantsDir;
|
|
197502
|
-
_wantsFile;
|
|
197503
|
-
_wantsEverything;
|
|
197504
|
-
_root;
|
|
197505
|
-
_isDirent;
|
|
197506
|
-
_statsProp;
|
|
197507
|
-
_rdOptions;
|
|
197508
|
-
_fileFilter;
|
|
197509
|
-
_directoryFilter;
|
|
197510
|
-
_relStart;
|
|
197511
|
-
constructor(options = {}) {
|
|
197512
|
-
super({
|
|
197513
|
-
objectMode: true,
|
|
197514
|
-
autoDestroy: true,
|
|
197515
|
-
highWaterMark: options.highWaterMark ?? defaultOptions3.highWaterMark
|
|
197516
|
-
});
|
|
197517
|
-
const opts = { ...defaultOptions3, ...options };
|
|
197518
|
-
const root4 = opts.root ?? defaultOptions3.root;
|
|
197519
|
-
const type = opts.type ?? defaultOptions3.type;
|
|
197520
|
-
this._fileFilter = normalizeFilter(opts.fileFilter);
|
|
197521
|
-
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
197522
|
-
const statMethod = opts.lstat ? lstat3 : stat6;
|
|
197523
|
-
if (wantBigintFsStats) {
|
|
197524
|
-
this._stat = (path7) => statMethod(path7, { bigint: true });
|
|
197525
|
-
} else {
|
|
197526
|
-
this._stat = statMethod;
|
|
197527
|
-
}
|
|
197528
|
-
this._maxDepth = opts.depth != null && Number.isSafeInteger(opts.depth) ? opts.depth : defaultOptions3.depth;
|
|
197529
|
-
this._wantsDir = DIR_TYPES.has(type);
|
|
197530
|
-
this._wantsFile = FILE_TYPES.has(type);
|
|
197531
|
-
this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE;
|
|
197532
|
-
this._root = presolve(root4);
|
|
197533
|
-
this._relStart = this._root.endsWith(psep) ? this._root.length : this._root.length + 1;
|
|
197534
|
-
this._isDirent = !opts.alwaysStat;
|
|
197535
|
-
this._statsProp = this._isDirent ? "dirent" : "stats";
|
|
197536
|
-
this._rdOptions = { encoding: "utf8", withFileTypes: this._isDirent };
|
|
197537
|
-
const rootDir = { path: this._root, depth: 1 };
|
|
197538
|
-
rootDir.pending = this._exploreDir(this._root, 1);
|
|
197539
|
-
this.parents = [rootDir];
|
|
197540
|
-
this.reading = false;
|
|
197541
|
-
this.parent = undefined;
|
|
197542
|
-
}
|
|
197543
|
-
async _read(batch) {
|
|
197544
|
-
if (this.reading)
|
|
197545
|
-
return;
|
|
197546
|
-
this.reading = true;
|
|
197547
|
-
try {
|
|
197548
|
-
while (!this.destroyed && batch > 0) {
|
|
197549
|
-
const par = this.parent;
|
|
197550
|
-
const fil = par && par.files;
|
|
197551
|
-
if (fil && fil.length > 0) {
|
|
197552
|
-
const { path: path7, depth } = par;
|
|
197553
|
-
const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path7));
|
|
197554
|
-
const awaited = this._isDirent ? slice : await Promise.all(slice);
|
|
197555
|
-
for (const entry of awaited) {
|
|
197556
|
-
if (!entry)
|
|
197557
|
-
continue;
|
|
197558
|
-
if (this.destroyed)
|
|
197559
|
-
return;
|
|
197560
|
-
let entryType = this._getEntryType(entry);
|
|
197561
|
-
if (typeof entryType !== "string")
|
|
197562
|
-
entryType = await entryType;
|
|
197563
|
-
if (entryType === "directory" && this._directoryFilter(entry)) {
|
|
197564
|
-
if (depth <= this._maxDepth) {
|
|
197565
|
-
this.parents.push({ path: entry.fullPath, depth: depth + 1 });
|
|
197566
|
-
}
|
|
197567
|
-
if (this._wantsDir) {
|
|
197568
|
-
this.push(entry);
|
|
197569
|
-
batch--;
|
|
197570
|
-
}
|
|
197571
|
-
} else if ((entryType === "file" || this._includeAsFile(entry)) && this._fileFilter(entry)) {
|
|
197572
|
-
if (this._wantsFile) {
|
|
197573
|
-
this.push(entry);
|
|
197574
|
-
batch--;
|
|
197575
|
-
}
|
|
197576
|
-
}
|
|
197577
|
-
}
|
|
197578
|
-
} else {
|
|
197579
|
-
const parent = this.parents.pop();
|
|
197580
|
-
if (!parent) {
|
|
197581
|
-
this.push(null);
|
|
197582
|
-
break;
|
|
197583
|
-
}
|
|
197584
|
-
const dir = parent.pending ?? this._exploreDir(parent.path, parent.depth);
|
|
197585
|
-
const next = this.parents[this.parents.length - 1];
|
|
197586
|
-
if (next && !next.pending) {
|
|
197587
|
-
next.pending = this._exploreDir(next.path, next.depth);
|
|
197588
|
-
}
|
|
197589
|
-
this.parent = await dir;
|
|
197590
|
-
if (this.destroyed)
|
|
197591
|
-
return;
|
|
197592
|
-
}
|
|
197593
|
-
}
|
|
197594
|
-
} catch (error52) {
|
|
197595
|
-
this.destroy(error52);
|
|
197596
|
-
} finally {
|
|
197597
|
-
this.reading = false;
|
|
197598
|
-
}
|
|
197599
|
-
}
|
|
197600
|
-
async _exploreDir(path7, depth) {
|
|
197601
|
-
let files;
|
|
197602
|
-
try {
|
|
197603
|
-
files = await readdir6(path7, this._rdOptions);
|
|
197604
|
-
} catch (error52) {
|
|
197605
|
-
this._onError(error52);
|
|
197606
|
-
}
|
|
197607
|
-
return { files, depth, path: path7 };
|
|
197608
|
-
}
|
|
197609
|
-
_formatEntry(dirent, path7) {
|
|
197610
|
-
const basename4 = this._isDirent ? dirent.name : dirent;
|
|
197611
|
-
const fullPath = pjoin(path7, basename4);
|
|
197612
|
-
const entry = { path: fullPath.slice(this._relStart), fullPath, basename: basename4 };
|
|
197613
|
-
if (this._isDirent) {
|
|
197614
|
-
entry.dirent = dirent;
|
|
197615
|
-
return entry;
|
|
197616
|
-
}
|
|
197617
|
-
return this._stat(fullPath).then((stats2) => {
|
|
197618
|
-
entry.stats = stats2;
|
|
197619
|
-
return entry;
|
|
197620
|
-
}, (err) => {
|
|
197621
|
-
this._onError(err);
|
|
197622
|
-
return;
|
|
197623
|
-
});
|
|
197624
|
-
}
|
|
197625
|
-
_onError(err) {
|
|
197626
|
-
if (isNormalFlowError(err) && !this.destroyed) {
|
|
197627
|
-
this.emit("warn", err);
|
|
197628
|
-
} else {
|
|
197629
|
-
this.destroy(err);
|
|
197630
|
-
}
|
|
197631
|
-
}
|
|
197632
|
-
_getEntryType(entry) {
|
|
197633
|
-
if (!entry || !(this._statsProp in entry)) {
|
|
197634
|
-
return "";
|
|
197635
|
-
}
|
|
197636
|
-
const stats2 = entry[this._statsProp];
|
|
197637
|
-
if (stats2.isFile())
|
|
197638
|
-
return "file";
|
|
197639
|
-
if (stats2.isDirectory())
|
|
197640
|
-
return "directory";
|
|
197641
|
-
if (stats2.isSymbolicLink())
|
|
197642
|
-
return this._getSymlinkEntryType(entry);
|
|
197643
|
-
return "";
|
|
197644
|
-
}
|
|
197645
|
-
async _getSymlinkEntryType(entry) {
|
|
197646
|
-
const full = entry.fullPath;
|
|
197647
|
-
try {
|
|
197648
|
-
const entryRealPath = await realpath(full);
|
|
197649
|
-
const entryRealPathStats = await lstat3(entryRealPath);
|
|
197650
|
-
if (entryRealPathStats.isFile()) {
|
|
197651
|
-
return "file";
|
|
197652
|
-
}
|
|
197653
|
-
if (entryRealPathStats.isDirectory()) {
|
|
197654
|
-
const len = entryRealPath.length;
|
|
197655
|
-
if (full.startsWith(entryRealPath) && full[len] === psep) {
|
|
197656
|
-
const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
|
|
197657
|
-
recursiveError.code = RECURSIVE_ERROR_CODE;
|
|
197658
|
-
this._onError(recursiveError);
|
|
197659
|
-
return "";
|
|
197660
|
-
}
|
|
197661
|
-
return "directory";
|
|
197662
|
-
}
|
|
197663
|
-
} catch (error52) {
|
|
197664
|
-
this._onError(error52);
|
|
197665
|
-
}
|
|
197666
|
-
return "";
|
|
197667
|
-
}
|
|
197668
|
-
_includeAsFile(entry) {
|
|
197669
|
-
const stats2 = entry && entry[this._statsProp];
|
|
197670
|
-
return stats2 && this._wantsEverything && !stats2.isDirectory();
|
|
197671
|
-
}
|
|
197672
|
-
}
|
|
197673
|
-
function readdirp(root4, options = {}) {
|
|
197674
|
-
let type = options.entryType || options.type;
|
|
197675
|
-
if (type === "both")
|
|
197676
|
-
type = EntryTypes.FILE_DIR_TYPE;
|
|
197677
|
-
if (!root4) {
|
|
197678
|
-
throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
|
|
197679
|
-
} else if (typeof root4 !== "string") {
|
|
197680
|
-
throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
|
|
197681
|
-
} else if (type && !ALL_TYPES.includes(type)) {
|
|
197682
|
-
throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);
|
|
197683
|
-
}
|
|
197684
|
-
const opts = { ...options, root: root4 };
|
|
197685
|
-
if (type)
|
|
197686
|
-
opts.type = type;
|
|
197687
|
-
return new ReaddirpStream(opts);
|
|
197688
|
-
}
|
|
197689
|
-
|
|
197690
|
-
// ../../node_modules/.pnpm/chokidar@5.0.0/node_modules/chokidar/handler.js
|
|
197691
|
-
import { watch as fs_watch, unwatchFile, watchFile } from "fs";
|
|
197692
|
-
import { realpath as fsrealpath, lstat as lstat4, open as open2, stat as stat7 } from "fs/promises";
|
|
197693
|
-
import { type as osType } from "os";
|
|
197694
|
-
import * as sp from "path";
|
|
197695
|
-
var STR_DATA = "data";
|
|
197696
|
-
var STR_END = "end";
|
|
197697
|
-
var STR_CLOSE = "close";
|
|
197698
|
-
var EMPTY_FN = () => {};
|
|
197699
|
-
var pl = process.platform;
|
|
197700
|
-
var isWindows = pl === "win32";
|
|
197701
|
-
var isMacos = pl === "darwin";
|
|
197702
|
-
var isLinux = pl === "linux";
|
|
197703
|
-
var isFreeBSD = pl === "freebsd";
|
|
197704
|
-
var isIBMi = osType() === "OS400";
|
|
197705
|
-
var EVENTS = {
|
|
197706
|
-
ALL: "all",
|
|
197707
|
-
READY: "ready",
|
|
197708
|
-
ADD: "add",
|
|
197709
|
-
CHANGE: "change",
|
|
197710
|
-
ADD_DIR: "addDir",
|
|
197711
|
-
UNLINK: "unlink",
|
|
197712
|
-
UNLINK_DIR: "unlinkDir",
|
|
197713
|
-
RAW: "raw",
|
|
197714
|
-
ERROR: "error"
|
|
197715
|
-
};
|
|
197716
|
-
var EV = EVENTS;
|
|
197717
|
-
var THROTTLE_MODE_WATCH = "watch";
|
|
197718
|
-
var statMethods = { lstat: lstat4, stat: stat7 };
|
|
197719
|
-
var KEY_LISTENERS = "listeners";
|
|
197720
|
-
var KEY_ERR = "errHandlers";
|
|
197721
|
-
var KEY_RAW = "rawEmitters";
|
|
197722
|
-
var HANDLER_KEYS = [KEY_LISTENERS, KEY_ERR, KEY_RAW];
|
|
197723
|
-
var binaryExtensions = new Set([
|
|
197724
|
-
"3dm",
|
|
197725
|
-
"3ds",
|
|
197726
|
-
"3g2",
|
|
197727
|
-
"3gp",
|
|
197728
|
-
"7z",
|
|
197729
|
-
"a",
|
|
197730
|
-
"aac",
|
|
197731
|
-
"adp",
|
|
197732
|
-
"afdesign",
|
|
197733
|
-
"afphoto",
|
|
197734
|
-
"afpub",
|
|
197735
|
-
"ai",
|
|
197736
|
-
"aif",
|
|
197737
|
-
"aiff",
|
|
197738
|
-
"alz",
|
|
197739
|
-
"ape",
|
|
197740
|
-
"apk",
|
|
197741
|
-
"appimage",
|
|
197742
|
-
"ar",
|
|
197743
|
-
"arj",
|
|
197744
|
-
"asf",
|
|
197745
|
-
"au",
|
|
197746
|
-
"avi",
|
|
197747
|
-
"bak",
|
|
197748
|
-
"baml",
|
|
197749
|
-
"bh",
|
|
197750
|
-
"bin",
|
|
197751
|
-
"bk",
|
|
197752
|
-
"bmp",
|
|
197753
|
-
"btif",
|
|
197754
|
-
"bz2",
|
|
197755
|
-
"bzip2",
|
|
197756
|
-
"cab",
|
|
197757
|
-
"caf",
|
|
197758
|
-
"cgm",
|
|
197759
|
-
"class",
|
|
197760
|
-
"cmx",
|
|
197761
|
-
"cpio",
|
|
197762
|
-
"cr2",
|
|
197763
|
-
"cur",
|
|
197764
|
-
"dat",
|
|
197765
|
-
"dcm",
|
|
197766
|
-
"deb",
|
|
197767
|
-
"dex",
|
|
197768
|
-
"djvu",
|
|
197769
|
-
"dll",
|
|
197770
|
-
"dmg",
|
|
197771
|
-
"dng",
|
|
197772
|
-
"doc",
|
|
197773
|
-
"docm",
|
|
197774
|
-
"docx",
|
|
197775
|
-
"dot",
|
|
197776
|
-
"dotm",
|
|
197777
|
-
"dra",
|
|
197778
|
-
"DS_Store",
|
|
197779
|
-
"dsk",
|
|
197780
|
-
"dts",
|
|
197781
|
-
"dtshd",
|
|
197782
|
-
"dvb",
|
|
197783
|
-
"dwg",
|
|
197784
|
-
"dxf",
|
|
197785
|
-
"ecelp4800",
|
|
197786
|
-
"ecelp7470",
|
|
197787
|
-
"ecelp9600",
|
|
197788
|
-
"egg",
|
|
197789
|
-
"eol",
|
|
197790
|
-
"eot",
|
|
197791
|
-
"epub",
|
|
197792
|
-
"exe",
|
|
197793
|
-
"f4v",
|
|
197794
|
-
"fbs",
|
|
197795
|
-
"fh",
|
|
197796
|
-
"fla",
|
|
197797
|
-
"flac",
|
|
197798
|
-
"flatpak",
|
|
197799
|
-
"fli",
|
|
197800
|
-
"flv",
|
|
197801
|
-
"fpx",
|
|
197802
|
-
"fst",
|
|
197803
|
-
"fvt",
|
|
197804
|
-
"g3",
|
|
197805
|
-
"gh",
|
|
197806
|
-
"gif",
|
|
197807
|
-
"graffle",
|
|
197808
|
-
"gz",
|
|
197809
|
-
"gzip",
|
|
197810
|
-
"h261",
|
|
197811
|
-
"h263",
|
|
197812
|
-
"h264",
|
|
197813
|
-
"icns",
|
|
197814
|
-
"ico",
|
|
197815
|
-
"ief",
|
|
197816
|
-
"img",
|
|
197817
|
-
"ipa",
|
|
197818
|
-
"iso",
|
|
197819
|
-
"jar",
|
|
197820
|
-
"jpeg",
|
|
197821
|
-
"jpg",
|
|
197822
|
-
"jpgv",
|
|
197823
|
-
"jpm",
|
|
197824
|
-
"jxr",
|
|
197825
|
-
"key",
|
|
197826
|
-
"ktx",
|
|
197827
|
-
"lha",
|
|
197828
|
-
"lib",
|
|
197829
|
-
"lvp",
|
|
197830
|
-
"lz",
|
|
197831
|
-
"lzh",
|
|
197832
|
-
"lzma",
|
|
197833
|
-
"lzo",
|
|
197834
|
-
"m3u",
|
|
197835
|
-
"m4a",
|
|
197836
|
-
"m4v",
|
|
197837
|
-
"mar",
|
|
197838
|
-
"mdi",
|
|
197839
|
-
"mht",
|
|
197840
|
-
"mid",
|
|
197841
|
-
"midi",
|
|
197842
|
-
"mj2",
|
|
197843
|
-
"mka",
|
|
197844
|
-
"mkv",
|
|
197845
|
-
"mmr",
|
|
197846
|
-
"mng",
|
|
197847
|
-
"mobi",
|
|
197848
|
-
"mov",
|
|
197849
|
-
"movie",
|
|
197850
|
-
"mp3",
|
|
197851
|
-
"mp4",
|
|
197852
|
-
"mp4a",
|
|
197853
|
-
"mpeg",
|
|
197854
|
-
"mpg",
|
|
197855
|
-
"mpga",
|
|
197856
|
-
"mxu",
|
|
197857
|
-
"nef",
|
|
197858
|
-
"npx",
|
|
197859
|
-
"numbers",
|
|
197860
|
-
"nupkg",
|
|
197861
|
-
"o",
|
|
197862
|
-
"odp",
|
|
197863
|
-
"ods",
|
|
197864
|
-
"odt",
|
|
197865
|
-
"oga",
|
|
197866
|
-
"ogg",
|
|
197867
|
-
"ogv",
|
|
197868
|
-
"otf",
|
|
197869
|
-
"ott",
|
|
197870
|
-
"pages",
|
|
197871
|
-
"pbm",
|
|
197872
|
-
"pcx",
|
|
197873
|
-
"pdb",
|
|
197874
|
-
"pdf",
|
|
197875
|
-
"pea",
|
|
197876
|
-
"pgm",
|
|
197877
|
-
"pic",
|
|
197878
|
-
"png",
|
|
197879
|
-
"pnm",
|
|
197880
|
-
"pot",
|
|
197881
|
-
"potm",
|
|
197882
|
-
"potx",
|
|
197883
|
-
"ppa",
|
|
197884
|
-
"ppam",
|
|
197885
|
-
"ppm",
|
|
197886
|
-
"pps",
|
|
197887
|
-
"ppsm",
|
|
197888
|
-
"ppsx",
|
|
197889
|
-
"ppt",
|
|
197890
|
-
"pptm",
|
|
197891
|
-
"pptx",
|
|
197892
|
-
"psd",
|
|
197893
|
-
"pya",
|
|
197894
|
-
"pyc",
|
|
197895
|
-
"pyo",
|
|
197896
|
-
"pyv",
|
|
197897
|
-
"qt",
|
|
197898
|
-
"rar",
|
|
197899
|
-
"ras",
|
|
197900
|
-
"raw",
|
|
197901
|
-
"resources",
|
|
197902
|
-
"rgb",
|
|
197903
|
-
"rip",
|
|
197904
|
-
"rlc",
|
|
197905
|
-
"rmf",
|
|
197906
|
-
"rmvb",
|
|
197907
|
-
"rpm",
|
|
197908
|
-
"rtf",
|
|
197909
|
-
"rz",
|
|
197910
|
-
"s3m",
|
|
197911
|
-
"s7z",
|
|
197912
|
-
"scpt",
|
|
197913
|
-
"sgi",
|
|
197914
|
-
"shar",
|
|
197915
|
-
"snap",
|
|
197916
|
-
"sil",
|
|
197917
|
-
"sketch",
|
|
197918
|
-
"slk",
|
|
197919
|
-
"smv",
|
|
197920
|
-
"snk",
|
|
197921
|
-
"so",
|
|
197922
|
-
"stl",
|
|
197923
|
-
"suo",
|
|
197924
|
-
"sub",
|
|
197925
|
-
"swf",
|
|
197926
|
-
"tar",
|
|
197927
|
-
"tbz",
|
|
197928
|
-
"tbz2",
|
|
197929
|
-
"tga",
|
|
197930
|
-
"tgz",
|
|
197931
|
-
"thmx",
|
|
197932
|
-
"tif",
|
|
197933
|
-
"tiff",
|
|
197934
|
-
"tlz",
|
|
197935
|
-
"ttc",
|
|
197936
|
-
"ttf",
|
|
197937
|
-
"txz",
|
|
197938
|
-
"udf",
|
|
197939
|
-
"uvh",
|
|
197940
|
-
"uvi",
|
|
197941
|
-
"uvm",
|
|
197942
|
-
"uvp",
|
|
197943
|
-
"uvs",
|
|
197944
|
-
"uvu",
|
|
197945
|
-
"viv",
|
|
197946
|
-
"vob",
|
|
197947
|
-
"war",
|
|
197948
|
-
"wav",
|
|
197949
|
-
"wax",
|
|
197950
|
-
"wbmp",
|
|
197951
|
-
"wdp",
|
|
197952
|
-
"weba",
|
|
197953
|
-
"webm",
|
|
197954
|
-
"webp",
|
|
197955
|
-
"whl",
|
|
197956
|
-
"wim",
|
|
197957
|
-
"wm",
|
|
197958
|
-
"wma",
|
|
197959
|
-
"wmv",
|
|
197960
|
-
"wmx",
|
|
197961
|
-
"woff",
|
|
197962
|
-
"woff2",
|
|
197963
|
-
"wrm",
|
|
197964
|
-
"wvx",
|
|
197965
|
-
"xbm",
|
|
197966
|
-
"xif",
|
|
197967
|
-
"xla",
|
|
197968
|
-
"xlam",
|
|
197969
|
-
"xls",
|
|
197970
|
-
"xlsb",
|
|
197971
|
-
"xlsm",
|
|
197972
|
-
"xlsx",
|
|
197973
|
-
"xlt",
|
|
197974
|
-
"xltm",
|
|
197975
|
-
"xltx",
|
|
197976
|
-
"xm",
|
|
197977
|
-
"xmind",
|
|
197978
|
-
"xpi",
|
|
197979
|
-
"xpm",
|
|
197980
|
-
"xwd",
|
|
197981
|
-
"xz",
|
|
197982
|
-
"z",
|
|
197983
|
-
"zip",
|
|
197984
|
-
"zipx"
|
|
197985
|
-
]);
|
|
197986
|
-
var isBinaryPath = (filePath) => binaryExtensions.has(sp.extname(filePath).slice(1).toLowerCase());
|
|
197987
|
-
var foreach = (val, fn) => {
|
|
197988
|
-
if (val instanceof Set) {
|
|
197989
|
-
val.forEach(fn);
|
|
197990
|
-
} else {
|
|
197991
|
-
fn(val);
|
|
197992
|
-
}
|
|
197993
|
-
};
|
|
197994
|
-
var addAndConvert = (main, prop, item) => {
|
|
197995
|
-
let container = main[prop];
|
|
197996
|
-
if (!(container instanceof Set)) {
|
|
197997
|
-
main[prop] = container = new Set([container]);
|
|
197998
|
-
}
|
|
197999
|
-
container.add(item);
|
|
198000
|
-
};
|
|
198001
|
-
var clearItem = (cont) => (key) => {
|
|
198002
|
-
const set4 = cont[key];
|
|
198003
|
-
if (set4 instanceof Set) {
|
|
198004
|
-
set4.clear();
|
|
198005
|
-
} else {
|
|
198006
|
-
delete cont[key];
|
|
198007
|
-
}
|
|
198008
|
-
};
|
|
198009
|
-
var delFromSet = (main, prop, item) => {
|
|
198010
|
-
const container = main[prop];
|
|
198011
|
-
if (container instanceof Set) {
|
|
198012
|
-
container.delete(item);
|
|
198013
|
-
} else if (container === item) {
|
|
198014
|
-
delete main[prop];
|
|
198015
|
-
}
|
|
198016
|
-
};
|
|
198017
|
-
var isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
|
|
198018
|
-
var FsWatchInstances = new Map;
|
|
198019
|
-
function createFsWatchInstance(path7, options, listener, errHandler, emitRaw) {
|
|
198020
|
-
const handleEvent = (rawEvent, evPath) => {
|
|
198021
|
-
listener(path7);
|
|
198022
|
-
emitRaw(rawEvent, evPath, { watchedPath: path7 });
|
|
198023
|
-
if (evPath && path7 !== evPath) {
|
|
198024
|
-
fsWatchBroadcast(sp.resolve(path7, evPath), KEY_LISTENERS, sp.join(path7, evPath));
|
|
198025
|
-
}
|
|
198026
|
-
};
|
|
198027
|
-
try {
|
|
198028
|
-
return fs_watch(path7, {
|
|
198029
|
-
persistent: options.persistent
|
|
198030
|
-
}, handleEvent);
|
|
198031
|
-
} catch (error52) {
|
|
198032
|
-
errHandler(error52);
|
|
198033
|
-
return;
|
|
198034
|
-
}
|
|
198035
|
-
}
|
|
198036
|
-
var fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
|
|
198037
|
-
const cont = FsWatchInstances.get(fullPath);
|
|
198038
|
-
if (!cont)
|
|
198039
|
-
return;
|
|
198040
|
-
foreach(cont[listenerType], (listener) => {
|
|
198041
|
-
listener(val1, val2, val3);
|
|
198042
|
-
});
|
|
198043
|
-
};
|
|
198044
|
-
var setFsWatchListener = (path7, fullPath, options, handlers) => {
|
|
198045
|
-
const { listener, errHandler, rawEmitter } = handlers;
|
|
198046
|
-
let cont = FsWatchInstances.get(fullPath);
|
|
198047
|
-
let watcher;
|
|
198048
|
-
if (!options.persistent) {
|
|
198049
|
-
watcher = createFsWatchInstance(path7, options, listener, errHandler, rawEmitter);
|
|
198050
|
-
if (!watcher)
|
|
198051
|
-
return;
|
|
198052
|
-
return watcher.close.bind(watcher);
|
|
198053
|
-
}
|
|
198054
|
-
if (cont) {
|
|
198055
|
-
addAndConvert(cont, KEY_LISTENERS, listener);
|
|
198056
|
-
addAndConvert(cont, KEY_ERR, errHandler);
|
|
198057
|
-
addAndConvert(cont, KEY_RAW, rawEmitter);
|
|
198058
|
-
} else {
|
|
198059
|
-
watcher = createFsWatchInstance(path7, options, fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), errHandler, fsWatchBroadcast.bind(null, fullPath, KEY_RAW));
|
|
198060
|
-
if (!watcher)
|
|
198061
|
-
return;
|
|
198062
|
-
watcher.on(EV.ERROR, async (error52) => {
|
|
198063
|
-
const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
|
|
198064
|
-
if (cont)
|
|
198065
|
-
cont.watcherUnusable = true;
|
|
198066
|
-
if (isWindows && error52.code === "EPERM") {
|
|
198067
|
-
try {
|
|
198068
|
-
const fd = await open2(path7, "r");
|
|
198069
|
-
await fd.close();
|
|
198070
|
-
broadcastErr(error52);
|
|
198071
|
-
} catch (err) {}
|
|
198072
|
-
} else {
|
|
198073
|
-
broadcastErr(error52);
|
|
198074
|
-
}
|
|
198075
|
-
});
|
|
198076
|
-
cont = {
|
|
198077
|
-
listeners: listener,
|
|
198078
|
-
errHandlers: errHandler,
|
|
198079
|
-
rawEmitters: rawEmitter,
|
|
198080
|
-
watcher
|
|
198081
|
-
};
|
|
198082
|
-
FsWatchInstances.set(fullPath, cont);
|
|
198083
|
-
}
|
|
198084
|
-
return () => {
|
|
198085
|
-
delFromSet(cont, KEY_LISTENERS, listener);
|
|
198086
|
-
delFromSet(cont, KEY_ERR, errHandler);
|
|
198087
|
-
delFromSet(cont, KEY_RAW, rawEmitter);
|
|
198088
|
-
if (isEmptySet(cont.listeners)) {
|
|
198089
|
-
cont.watcher.close();
|
|
198090
|
-
FsWatchInstances.delete(fullPath);
|
|
198091
|
-
HANDLER_KEYS.forEach(clearItem(cont));
|
|
198092
|
-
cont.watcher = undefined;
|
|
198093
|
-
Object.freeze(cont);
|
|
198094
|
-
}
|
|
198095
|
-
};
|
|
198096
|
-
};
|
|
198097
|
-
var FsWatchFileInstances = new Map;
|
|
198098
|
-
var setFsWatchFileListener = (path7, fullPath, options, handlers) => {
|
|
198099
|
-
const { listener, rawEmitter } = handlers;
|
|
198100
|
-
let cont = FsWatchFileInstances.get(fullPath);
|
|
198101
|
-
const copts = cont && cont.options;
|
|
198102
|
-
if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) {
|
|
198103
|
-
unwatchFile(fullPath);
|
|
198104
|
-
cont = undefined;
|
|
198105
|
-
}
|
|
198106
|
-
if (cont) {
|
|
198107
|
-
addAndConvert(cont, KEY_LISTENERS, listener);
|
|
198108
|
-
addAndConvert(cont, KEY_RAW, rawEmitter);
|
|
198109
|
-
} else {
|
|
198110
|
-
cont = {
|
|
198111
|
-
listeners: listener,
|
|
198112
|
-
rawEmitters: rawEmitter,
|
|
198113
|
-
options,
|
|
198114
|
-
watcher: watchFile(fullPath, options, (curr, prev) => {
|
|
198115
|
-
foreach(cont.rawEmitters, (rawEmitter2) => {
|
|
198116
|
-
rawEmitter2(EV.CHANGE, fullPath, { curr, prev });
|
|
198117
|
-
});
|
|
198118
|
-
const currmtime = curr.mtimeMs;
|
|
198119
|
-
if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
|
|
198120
|
-
foreach(cont.listeners, (listener2) => listener2(path7, curr));
|
|
198121
|
-
}
|
|
198122
|
-
})
|
|
198123
|
-
};
|
|
198124
|
-
FsWatchFileInstances.set(fullPath, cont);
|
|
198125
|
-
}
|
|
198126
|
-
return () => {
|
|
198127
|
-
delFromSet(cont, KEY_LISTENERS, listener);
|
|
198128
|
-
delFromSet(cont, KEY_RAW, rawEmitter);
|
|
198129
|
-
if (isEmptySet(cont.listeners)) {
|
|
198130
|
-
FsWatchFileInstances.delete(fullPath);
|
|
198131
|
-
unwatchFile(fullPath);
|
|
198132
|
-
cont.options = cont.watcher = undefined;
|
|
198133
|
-
Object.freeze(cont);
|
|
198134
|
-
}
|
|
198135
|
-
};
|
|
198136
|
-
};
|
|
198137
|
-
|
|
198138
|
-
class NodeFsHandler {
|
|
198139
|
-
fsw;
|
|
198140
|
-
_boundHandleError;
|
|
198141
|
-
constructor(fsW) {
|
|
198142
|
-
this.fsw = fsW;
|
|
198143
|
-
this._boundHandleError = (error52) => fsW._handleError(error52);
|
|
198144
|
-
}
|
|
198145
|
-
_watchWithNodeFs(path7, listener) {
|
|
198146
|
-
const opts = this.fsw.options;
|
|
198147
|
-
const directory = sp.dirname(path7);
|
|
198148
|
-
const basename5 = sp.basename(path7);
|
|
198149
|
-
const parent = this.fsw._getWatchedDir(directory);
|
|
198150
|
-
parent.add(basename5);
|
|
198151
|
-
const absolutePath = sp.resolve(path7);
|
|
198152
|
-
const options = {
|
|
198153
|
-
persistent: opts.persistent
|
|
198154
|
-
};
|
|
198155
|
-
if (!listener)
|
|
198156
|
-
listener = EMPTY_FN;
|
|
198157
|
-
let closer;
|
|
198158
|
-
if (opts.usePolling) {
|
|
198159
|
-
const enableBin = opts.interval !== opts.binaryInterval;
|
|
198160
|
-
options.interval = enableBin && isBinaryPath(basename5) ? opts.binaryInterval : opts.interval;
|
|
198161
|
-
closer = setFsWatchFileListener(path7, absolutePath, options, {
|
|
198162
|
-
listener,
|
|
198163
|
-
rawEmitter: this.fsw._emitRaw
|
|
198164
|
-
});
|
|
198165
|
-
} else {
|
|
198166
|
-
closer = setFsWatchListener(path7, absolutePath, options, {
|
|
198167
|
-
listener,
|
|
198168
|
-
errHandler: this._boundHandleError,
|
|
198169
|
-
rawEmitter: this.fsw._emitRaw
|
|
198170
|
-
});
|
|
198171
|
-
}
|
|
198172
|
-
return closer;
|
|
198173
|
-
}
|
|
198174
|
-
_handleFile(file3, stats2, initialAdd) {
|
|
198175
|
-
if (this.fsw.closed) {
|
|
198176
|
-
return;
|
|
198177
|
-
}
|
|
198178
|
-
const dirname23 = sp.dirname(file3);
|
|
198179
|
-
const basename5 = sp.basename(file3);
|
|
198180
|
-
const parent = this.fsw._getWatchedDir(dirname23);
|
|
198181
|
-
let prevStats = stats2;
|
|
198182
|
-
if (parent.has(basename5))
|
|
198183
|
-
return;
|
|
198184
|
-
const listener = async (path7, newStats) => {
|
|
198185
|
-
if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file3, 5))
|
|
198186
|
-
return;
|
|
198187
|
-
if (!newStats || newStats.mtimeMs === 0) {
|
|
198188
|
-
try {
|
|
198189
|
-
const newStats2 = await stat7(file3);
|
|
198190
|
-
if (this.fsw.closed)
|
|
198191
|
-
return;
|
|
198192
|
-
const at2 = newStats2.atimeMs;
|
|
198193
|
-
const mt2 = newStats2.mtimeMs;
|
|
198194
|
-
if (!at2 || at2 <= mt2 || mt2 !== prevStats.mtimeMs) {
|
|
198195
|
-
this.fsw._emit(EV.CHANGE, file3, newStats2);
|
|
198196
|
-
}
|
|
198197
|
-
if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats2.ino) {
|
|
198198
|
-
this.fsw._closeFile(path7);
|
|
198199
|
-
prevStats = newStats2;
|
|
198200
|
-
const closer2 = this._watchWithNodeFs(file3, listener);
|
|
198201
|
-
if (closer2)
|
|
198202
|
-
this.fsw._addPathCloser(path7, closer2);
|
|
198203
|
-
} else {
|
|
198204
|
-
prevStats = newStats2;
|
|
198205
|
-
}
|
|
198206
|
-
} catch (error52) {
|
|
198207
|
-
this.fsw._remove(dirname23, basename5);
|
|
198208
|
-
}
|
|
198209
|
-
} else if (parent.has(basename5)) {
|
|
198210
|
-
const at2 = newStats.atimeMs;
|
|
198211
|
-
const mt2 = newStats.mtimeMs;
|
|
198212
|
-
if (!at2 || at2 <= mt2 || mt2 !== prevStats.mtimeMs) {
|
|
198213
|
-
this.fsw._emit(EV.CHANGE, file3, newStats);
|
|
198214
|
-
}
|
|
198215
|
-
prevStats = newStats;
|
|
198216
|
-
}
|
|
198217
|
-
};
|
|
198218
|
-
const closer = this._watchWithNodeFs(file3, listener);
|
|
198219
|
-
if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file3)) {
|
|
198220
|
-
if (!this.fsw._throttle(EV.ADD, file3, 0))
|
|
198221
|
-
return;
|
|
198222
|
-
this.fsw._emit(EV.ADD, file3, stats2);
|
|
198223
|
-
}
|
|
198224
|
-
return closer;
|
|
198225
|
-
}
|
|
198226
|
-
async _handleSymlink(entry, directory, path7, item) {
|
|
198227
|
-
if (this.fsw.closed) {
|
|
198228
|
-
return;
|
|
198229
|
-
}
|
|
198230
|
-
const full = entry.fullPath;
|
|
198231
|
-
const dir = this.fsw._getWatchedDir(directory);
|
|
198232
|
-
if (!this.fsw.options.followSymlinks) {
|
|
198233
|
-
this.fsw._incrReadyCount();
|
|
198234
|
-
let linkPath;
|
|
198235
|
-
try {
|
|
198236
|
-
linkPath = await fsrealpath(path7);
|
|
198237
|
-
} catch (e4) {
|
|
198238
|
-
this.fsw._emitReady();
|
|
198239
|
-
return true;
|
|
198240
|
-
}
|
|
198241
|
-
if (this.fsw.closed)
|
|
198242
|
-
return;
|
|
198243
|
-
if (dir.has(item)) {
|
|
198244
|
-
if (this.fsw._symlinkPaths.get(full) !== linkPath) {
|
|
198245
|
-
this.fsw._symlinkPaths.set(full, linkPath);
|
|
198246
|
-
this.fsw._emit(EV.CHANGE, path7, entry.stats);
|
|
198247
|
-
}
|
|
198248
|
-
} else {
|
|
198249
|
-
dir.add(item);
|
|
198250
|
-
this.fsw._symlinkPaths.set(full, linkPath);
|
|
198251
|
-
this.fsw._emit(EV.ADD, path7, entry.stats);
|
|
198252
|
-
}
|
|
198253
|
-
this.fsw._emitReady();
|
|
198254
|
-
return true;
|
|
198255
|
-
}
|
|
198256
|
-
if (this.fsw._symlinkPaths.has(full)) {
|
|
198257
|
-
return true;
|
|
198258
|
-
}
|
|
198259
|
-
this.fsw._symlinkPaths.set(full, true);
|
|
198260
|
-
}
|
|
198261
|
-
_handleRead(directory, initialAdd, wh, target2, dir, depth, throttler) {
|
|
198262
|
-
directory = sp.join(directory, "");
|
|
198263
|
-
const throttleKey = target2 ? `${directory}:${target2}` : directory;
|
|
198264
|
-
throttler = this.fsw._throttle("readdir", throttleKey, 1000);
|
|
198265
|
-
if (!throttler)
|
|
198266
|
-
return;
|
|
198267
|
-
const previous = this.fsw._getWatchedDir(wh.path);
|
|
198268
|
-
const current = new Set;
|
|
198269
|
-
let stream = this.fsw._readdirp(directory, {
|
|
198270
|
-
fileFilter: (entry) => wh.filterPath(entry),
|
|
198271
|
-
directoryFilter: (entry) => wh.filterDir(entry)
|
|
198272
|
-
});
|
|
198273
|
-
if (!stream)
|
|
198274
|
-
return;
|
|
198275
|
-
stream.on(STR_DATA, async (entry) => {
|
|
198276
|
-
if (this.fsw.closed) {
|
|
198277
|
-
stream = undefined;
|
|
198278
|
-
return;
|
|
198279
|
-
}
|
|
198280
|
-
const item = entry.path;
|
|
198281
|
-
let path7 = sp.join(directory, item);
|
|
198282
|
-
current.add(item);
|
|
198283
|
-
if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path7, item)) {
|
|
198284
|
-
return;
|
|
198285
|
-
}
|
|
198286
|
-
if (this.fsw.closed) {
|
|
198287
|
-
stream = undefined;
|
|
198288
|
-
return;
|
|
198289
|
-
}
|
|
198290
|
-
if (item === target2 || !target2 && !previous.has(item)) {
|
|
198291
|
-
this.fsw._incrReadyCount();
|
|
198292
|
-
path7 = sp.join(dir, sp.relative(dir, path7));
|
|
198293
|
-
this._addToNodeFs(path7, initialAdd, wh, depth + 1);
|
|
198294
|
-
}
|
|
198295
|
-
}).on(EV.ERROR, this._boundHandleError);
|
|
198296
|
-
return new Promise((resolve6, reject) => {
|
|
198297
|
-
if (!stream)
|
|
198298
|
-
return reject();
|
|
198299
|
-
stream.once(STR_END, () => {
|
|
198300
|
-
if (this.fsw.closed) {
|
|
198301
|
-
stream = undefined;
|
|
198302
|
-
return;
|
|
198303
|
-
}
|
|
198304
|
-
const wasThrottled = throttler ? throttler.clear() : false;
|
|
198305
|
-
resolve6(undefined);
|
|
198306
|
-
previous.getChildren().filter((item) => {
|
|
198307
|
-
return item !== directory && !current.has(item);
|
|
198308
|
-
}).forEach((item) => {
|
|
198309
|
-
this.fsw._remove(directory, item);
|
|
198310
|
-
});
|
|
198311
|
-
stream = undefined;
|
|
198312
|
-
if (wasThrottled)
|
|
198313
|
-
this._handleRead(directory, false, wh, target2, dir, depth, throttler);
|
|
198314
|
-
});
|
|
198315
|
-
});
|
|
198316
|
-
}
|
|
198317
|
-
async _handleDir(dir, stats2, initialAdd, depth, target2, wh, realpath2) {
|
|
198318
|
-
const parentDir = this.fsw._getWatchedDir(sp.dirname(dir));
|
|
198319
|
-
const tracked = parentDir.has(sp.basename(dir));
|
|
198320
|
-
if (!(initialAdd && this.fsw.options.ignoreInitial) && !target2 && !tracked) {
|
|
198321
|
-
this.fsw._emit(EV.ADD_DIR, dir, stats2);
|
|
198322
|
-
}
|
|
198323
|
-
parentDir.add(sp.basename(dir));
|
|
198324
|
-
this.fsw._getWatchedDir(dir);
|
|
198325
|
-
let throttler;
|
|
198326
|
-
let closer;
|
|
198327
|
-
const oDepth = this.fsw.options.depth;
|
|
198328
|
-
if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath2)) {
|
|
198329
|
-
if (!target2) {
|
|
198330
|
-
await this._handleRead(dir, initialAdd, wh, target2, dir, depth, throttler);
|
|
198331
|
-
if (this.fsw.closed)
|
|
198332
|
-
return;
|
|
198333
|
-
}
|
|
198334
|
-
closer = this._watchWithNodeFs(dir, (dirPath, stats3) => {
|
|
198335
|
-
if (stats3 && stats3.mtimeMs === 0)
|
|
198336
|
-
return;
|
|
198337
|
-
this._handleRead(dirPath, false, wh, target2, dir, depth, throttler);
|
|
198338
|
-
});
|
|
198339
|
-
}
|
|
198340
|
-
return closer;
|
|
198341
|
-
}
|
|
198342
|
-
async _addToNodeFs(path7, initialAdd, priorWh, depth, target2) {
|
|
198343
|
-
const ready2 = this.fsw._emitReady;
|
|
198344
|
-
if (this.fsw._isIgnored(path7) || this.fsw.closed) {
|
|
198345
|
-
ready2();
|
|
198346
|
-
return false;
|
|
198347
|
-
}
|
|
198348
|
-
const wh = this.fsw._getWatchHelpers(path7);
|
|
198349
|
-
if (priorWh) {
|
|
198350
|
-
wh.filterPath = (entry) => priorWh.filterPath(entry);
|
|
198351
|
-
wh.filterDir = (entry) => priorWh.filterDir(entry);
|
|
198352
|
-
}
|
|
198353
|
-
try {
|
|
198354
|
-
const stats2 = await statMethods[wh.statMethod](wh.watchPath);
|
|
198355
|
-
if (this.fsw.closed)
|
|
198356
|
-
return;
|
|
198357
|
-
if (this.fsw._isIgnored(wh.watchPath, stats2)) {
|
|
198358
|
-
ready2();
|
|
198359
|
-
return false;
|
|
198360
|
-
}
|
|
198361
|
-
const follow = this.fsw.options.followSymlinks;
|
|
198362
|
-
let closer;
|
|
198363
|
-
if (stats2.isDirectory()) {
|
|
198364
|
-
const absPath = sp.resolve(path7);
|
|
198365
|
-
const targetPath = follow ? await fsrealpath(path7) : path7;
|
|
198366
|
-
if (this.fsw.closed)
|
|
198367
|
-
return;
|
|
198368
|
-
closer = await this._handleDir(wh.watchPath, stats2, initialAdd, depth, target2, wh, targetPath);
|
|
198369
|
-
if (this.fsw.closed)
|
|
198370
|
-
return;
|
|
198371
|
-
if (absPath !== targetPath && targetPath !== undefined) {
|
|
198372
|
-
this.fsw._symlinkPaths.set(absPath, targetPath);
|
|
198373
|
-
}
|
|
198374
|
-
} else if (stats2.isSymbolicLink()) {
|
|
198375
|
-
const targetPath = follow ? await fsrealpath(path7) : path7;
|
|
198376
|
-
if (this.fsw.closed)
|
|
198377
|
-
return;
|
|
198378
|
-
const parent = sp.dirname(wh.watchPath);
|
|
198379
|
-
this.fsw._getWatchedDir(parent).add(wh.watchPath);
|
|
198380
|
-
this.fsw._emit(EV.ADD, wh.watchPath, stats2);
|
|
198381
|
-
closer = await this._handleDir(parent, stats2, initialAdd, depth, path7, wh, targetPath);
|
|
198382
|
-
if (this.fsw.closed)
|
|
198383
|
-
return;
|
|
198384
|
-
if (targetPath !== undefined) {
|
|
198385
|
-
this.fsw._symlinkPaths.set(sp.resolve(path7), targetPath);
|
|
198386
|
-
}
|
|
198387
|
-
} else {
|
|
198388
|
-
closer = this._handleFile(wh.watchPath, stats2, initialAdd);
|
|
198389
|
-
}
|
|
198390
|
-
ready2();
|
|
198391
|
-
if (closer)
|
|
198392
|
-
this.fsw._addPathCloser(path7, closer);
|
|
198393
|
-
return false;
|
|
198394
|
-
} catch (error52) {
|
|
198395
|
-
if (this.fsw._handleError(error52)) {
|
|
198396
|
-
ready2();
|
|
198397
|
-
return path7;
|
|
198398
|
-
}
|
|
198399
|
-
}
|
|
198400
|
-
}
|
|
198401
|
-
}
|
|
198402
|
-
|
|
198403
|
-
// ../../node_modules/.pnpm/chokidar@5.0.0/node_modules/chokidar/index.js
|
|
198404
|
-
/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */
|
|
198405
|
-
var SLASH = "/";
|
|
198406
|
-
var SLASH_SLASH = "//";
|
|
198407
|
-
var ONE_DOT = ".";
|
|
198408
|
-
var TWO_DOTS = "..";
|
|
198409
|
-
var STRING_TYPE = "string";
|
|
198410
|
-
var BACK_SLASH_RE = /\\/g;
|
|
198411
|
-
var DOUBLE_SLASH_RE = /\/\//g;
|
|
198412
|
-
var DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
|
|
198413
|
-
var REPLACER_RE = /^\.[/\\]/;
|
|
198414
|
-
function arrify(item) {
|
|
198415
|
-
return Array.isArray(item) ? item : [item];
|
|
198416
|
-
}
|
|
198417
|
-
var isMatcherObject = (matcher) => typeof matcher === "object" && matcher !== null && !(matcher instanceof RegExp);
|
|
198418
|
-
function createPattern(matcher) {
|
|
198419
|
-
if (typeof matcher === "function")
|
|
198420
|
-
return matcher;
|
|
198421
|
-
if (typeof matcher === "string")
|
|
198422
|
-
return (string6) => matcher === string6;
|
|
198423
|
-
if (matcher instanceof RegExp)
|
|
198424
|
-
return (string6) => matcher.test(string6);
|
|
198425
|
-
if (typeof matcher === "object" && matcher !== null) {
|
|
198426
|
-
return (string6) => {
|
|
198427
|
-
if (matcher.path === string6)
|
|
198428
|
-
return true;
|
|
198429
|
-
if (matcher.recursive) {
|
|
198430
|
-
const relative12 = sp2.relative(matcher.path, string6);
|
|
198431
|
-
if (!relative12) {
|
|
198432
|
-
return false;
|
|
198433
|
-
}
|
|
198434
|
-
return !relative12.startsWith("..") && !sp2.isAbsolute(relative12);
|
|
198435
|
-
}
|
|
198436
|
-
return false;
|
|
198437
|
-
};
|
|
198438
|
-
}
|
|
198439
|
-
return () => false;
|
|
198440
|
-
}
|
|
198441
|
-
function normalizePath3(path7) {
|
|
198442
|
-
if (typeof path7 !== "string")
|
|
198443
|
-
throw new Error("string expected");
|
|
198444
|
-
path7 = sp2.normalize(path7);
|
|
198445
|
-
path7 = path7.replace(/\\/g, "/");
|
|
198446
|
-
let prepend = false;
|
|
198447
|
-
if (path7.startsWith("//"))
|
|
198448
|
-
prepend = true;
|
|
198449
|
-
path7 = path7.replace(DOUBLE_SLASH_RE, "/");
|
|
198450
|
-
if (prepend)
|
|
198451
|
-
path7 = "/" + path7;
|
|
198452
|
-
return path7;
|
|
198453
|
-
}
|
|
198454
|
-
function matchPatterns(patterns, testString, stats2) {
|
|
198455
|
-
const path7 = normalizePath3(testString);
|
|
198456
|
-
for (let index = 0;index < patterns.length; index++) {
|
|
198457
|
-
const pattern = patterns[index];
|
|
198458
|
-
if (pattern(path7, stats2)) {
|
|
198459
|
-
return true;
|
|
198460
|
-
}
|
|
198461
|
-
}
|
|
198462
|
-
return false;
|
|
198463
|
-
}
|
|
198464
|
-
function anymatch(matchers, testString) {
|
|
198465
|
-
if (matchers == null) {
|
|
198466
|
-
throw new TypeError("anymatch: specify first argument");
|
|
198467
|
-
}
|
|
198468
|
-
const matchersArray = arrify(matchers);
|
|
198469
|
-
const patterns = matchersArray.map((matcher) => createPattern(matcher));
|
|
198470
|
-
if (testString == null) {
|
|
198471
|
-
return (testString2, stats2) => {
|
|
198472
|
-
return matchPatterns(patterns, testString2, stats2);
|
|
198473
|
-
};
|
|
198474
|
-
}
|
|
198475
|
-
return matchPatterns(patterns, testString);
|
|
198476
|
-
}
|
|
198477
|
-
var unifyPaths = (paths_) => {
|
|
198478
|
-
const paths = arrify(paths_).flat();
|
|
198479
|
-
if (!paths.every((p4) => typeof p4 === STRING_TYPE)) {
|
|
198480
|
-
throw new TypeError(`Non-string provided as watch path: ${paths}`);
|
|
198481
|
-
}
|
|
198482
|
-
return paths.map(normalizePathToUnix);
|
|
198483
|
-
};
|
|
198484
|
-
var toUnix = (string6) => {
|
|
198485
|
-
let str = string6.replace(BACK_SLASH_RE, SLASH);
|
|
198486
|
-
let prepend = false;
|
|
198487
|
-
if (str.startsWith(SLASH_SLASH)) {
|
|
198488
|
-
prepend = true;
|
|
198489
|
-
}
|
|
198490
|
-
str = str.replace(DOUBLE_SLASH_RE, SLASH);
|
|
198491
|
-
if (prepend) {
|
|
198492
|
-
str = SLASH + str;
|
|
198493
|
-
}
|
|
198494
|
-
return str;
|
|
198495
|
-
};
|
|
198496
|
-
var normalizePathToUnix = (path7) => toUnix(sp2.normalize(toUnix(path7)));
|
|
198497
|
-
var normalizeIgnored = (cwd2 = "") => (path7) => {
|
|
198498
|
-
if (typeof path7 === "string") {
|
|
198499
|
-
return normalizePathToUnix(sp2.isAbsolute(path7) ? path7 : sp2.join(cwd2, path7));
|
|
198500
|
-
} else {
|
|
198501
|
-
return path7;
|
|
198502
|
-
}
|
|
198503
|
-
};
|
|
198504
|
-
var getAbsolutePath = (path7, cwd2) => {
|
|
198505
|
-
if (sp2.isAbsolute(path7)) {
|
|
198506
|
-
return path7;
|
|
198507
|
-
}
|
|
198508
|
-
return sp2.join(cwd2, path7);
|
|
198509
|
-
};
|
|
198510
|
-
var EMPTY_SET = Object.freeze(new Set);
|
|
198511
|
-
|
|
198512
|
-
class DirEntry {
|
|
198513
|
-
path;
|
|
198514
|
-
_removeWatcher;
|
|
198515
|
-
items;
|
|
198516
|
-
constructor(dir, removeWatcher) {
|
|
198517
|
-
this.path = dir;
|
|
198518
|
-
this._removeWatcher = removeWatcher;
|
|
198519
|
-
this.items = new Set;
|
|
198520
|
-
}
|
|
198521
|
-
add(item) {
|
|
198522
|
-
const { items } = this;
|
|
198523
|
-
if (!items)
|
|
198524
|
-
return;
|
|
198525
|
-
if (item !== ONE_DOT && item !== TWO_DOTS)
|
|
198526
|
-
items.add(item);
|
|
198527
|
-
}
|
|
198528
|
-
async remove(item) {
|
|
198529
|
-
const { items } = this;
|
|
198530
|
-
if (!items)
|
|
198531
|
-
return;
|
|
198532
|
-
items.delete(item);
|
|
198533
|
-
if (items.size > 0)
|
|
198534
|
-
return;
|
|
198535
|
-
const dir = this.path;
|
|
198536
|
-
try {
|
|
198537
|
-
await readdir7(dir);
|
|
198538
|
-
} catch (err) {
|
|
198539
|
-
if (this._removeWatcher) {
|
|
198540
|
-
this._removeWatcher(sp2.dirname(dir), sp2.basename(dir));
|
|
198541
|
-
}
|
|
198542
|
-
}
|
|
198543
|
-
}
|
|
198544
|
-
has(item) {
|
|
198545
|
-
const { items } = this;
|
|
198546
|
-
if (!items)
|
|
198547
|
-
return;
|
|
198548
|
-
return items.has(item);
|
|
198549
|
-
}
|
|
198550
|
-
getChildren() {
|
|
198551
|
-
const { items } = this;
|
|
198552
|
-
if (!items)
|
|
198553
|
-
return [];
|
|
198554
|
-
return [...items.values()];
|
|
198555
|
-
}
|
|
198556
|
-
dispose() {
|
|
198557
|
-
this.items.clear();
|
|
198558
|
-
this.path = "";
|
|
198559
|
-
this._removeWatcher = EMPTY_FN;
|
|
198560
|
-
this.items = EMPTY_SET;
|
|
198561
|
-
Object.freeze(this);
|
|
198562
|
-
}
|
|
198563
|
-
}
|
|
198564
|
-
var STAT_METHOD_F = "stat";
|
|
198565
|
-
var STAT_METHOD_L = "lstat";
|
|
198566
|
-
|
|
198567
|
-
class WatchHelper {
|
|
198568
|
-
fsw;
|
|
198569
|
-
path;
|
|
198570
|
-
watchPath;
|
|
198571
|
-
fullWatchPath;
|
|
198572
|
-
dirParts;
|
|
198573
|
-
followSymlinks;
|
|
198574
|
-
statMethod;
|
|
198575
|
-
constructor(path7, follow, fsw) {
|
|
198576
|
-
this.fsw = fsw;
|
|
198577
|
-
const watchPath = path7;
|
|
198578
|
-
this.path = path7 = path7.replace(REPLACER_RE, "");
|
|
198579
|
-
this.watchPath = watchPath;
|
|
198580
|
-
this.fullWatchPath = sp2.resolve(watchPath);
|
|
198581
|
-
this.dirParts = [];
|
|
198582
|
-
this.dirParts.forEach((parts) => {
|
|
198583
|
-
if (parts.length > 1)
|
|
198584
|
-
parts.pop();
|
|
198585
|
-
});
|
|
198586
|
-
this.followSymlinks = follow;
|
|
198587
|
-
this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
|
|
198588
|
-
}
|
|
198589
|
-
entryPath(entry) {
|
|
198590
|
-
return sp2.join(this.watchPath, sp2.relative(this.watchPath, entry.fullPath));
|
|
198591
|
-
}
|
|
198592
|
-
filterPath(entry) {
|
|
198593
|
-
const { stats: stats2 } = entry;
|
|
198594
|
-
if (stats2 && stats2.isSymbolicLink())
|
|
198595
|
-
return this.filterDir(entry);
|
|
198596
|
-
const resolvedPath = this.entryPath(entry);
|
|
198597
|
-
return this.fsw._isntIgnored(resolvedPath, stats2) && this.fsw._hasReadPermissions(stats2);
|
|
198598
|
-
}
|
|
198599
|
-
filterDir(entry) {
|
|
198600
|
-
return this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
|
|
198601
|
-
}
|
|
198602
|
-
}
|
|
198603
|
-
|
|
198604
|
-
class FSWatcher extends EventEmitter3 {
|
|
198605
|
-
closed;
|
|
198606
|
-
options;
|
|
198607
|
-
_closers;
|
|
198608
|
-
_ignoredPaths;
|
|
198609
|
-
_throttled;
|
|
198610
|
-
_streams;
|
|
198611
|
-
_symlinkPaths;
|
|
198612
|
-
_watched;
|
|
198613
|
-
_pendingWrites;
|
|
198614
|
-
_pendingUnlinks;
|
|
198615
|
-
_readyCount;
|
|
198616
|
-
_emitReady;
|
|
198617
|
-
_closePromise;
|
|
198618
|
-
_userIgnored;
|
|
198619
|
-
_readyEmitted;
|
|
198620
|
-
_emitRaw;
|
|
198621
|
-
_boundRemove;
|
|
198622
|
-
_nodeFsHandler;
|
|
198623
|
-
constructor(_opts = {}) {
|
|
198624
|
-
super();
|
|
198625
|
-
this.closed = false;
|
|
198626
|
-
this._closers = new Map;
|
|
198627
|
-
this._ignoredPaths = new Set;
|
|
198628
|
-
this._throttled = new Map;
|
|
198629
|
-
this._streams = new Set;
|
|
198630
|
-
this._symlinkPaths = new Map;
|
|
198631
|
-
this._watched = new Map;
|
|
198632
|
-
this._pendingWrites = new Map;
|
|
198633
|
-
this._pendingUnlinks = new Map;
|
|
198634
|
-
this._readyCount = 0;
|
|
198635
|
-
this._readyEmitted = false;
|
|
198636
|
-
const awf = _opts.awaitWriteFinish;
|
|
198637
|
-
const DEF_AWF = { stabilityThreshold: 2000, pollInterval: 100 };
|
|
198638
|
-
const opts = {
|
|
198639
|
-
persistent: true,
|
|
198640
|
-
ignoreInitial: false,
|
|
198641
|
-
ignorePermissionErrors: false,
|
|
198642
|
-
interval: 100,
|
|
198643
|
-
binaryInterval: 300,
|
|
198644
|
-
followSymlinks: true,
|
|
198645
|
-
usePolling: false,
|
|
198646
|
-
atomic: true,
|
|
198647
|
-
..._opts,
|
|
198648
|
-
ignored: _opts.ignored ? arrify(_opts.ignored) : arrify([]),
|
|
198649
|
-
awaitWriteFinish: awf === true ? DEF_AWF : typeof awf === "object" ? { ...DEF_AWF, ...awf } : false
|
|
198650
|
-
};
|
|
198651
|
-
if (isIBMi)
|
|
198652
|
-
opts.usePolling = true;
|
|
198653
|
-
if (opts.atomic === undefined)
|
|
198654
|
-
opts.atomic = !opts.usePolling;
|
|
198655
|
-
const envPoll = process.env.CHOKIDAR_USEPOLLING;
|
|
198656
|
-
if (envPoll !== undefined) {
|
|
198657
|
-
const envLower = envPoll.toLowerCase();
|
|
198658
|
-
if (envLower === "false" || envLower === "0")
|
|
198659
|
-
opts.usePolling = false;
|
|
198660
|
-
else if (envLower === "true" || envLower === "1")
|
|
198661
|
-
opts.usePolling = true;
|
|
198662
|
-
else
|
|
198663
|
-
opts.usePolling = !!envLower;
|
|
198664
|
-
}
|
|
198665
|
-
const envInterval = process.env.CHOKIDAR_INTERVAL;
|
|
198666
|
-
if (envInterval)
|
|
198667
|
-
opts.interval = Number.parseInt(envInterval, 10);
|
|
198668
|
-
let readyCalls = 0;
|
|
198669
|
-
this._emitReady = () => {
|
|
198670
|
-
readyCalls++;
|
|
198671
|
-
if (readyCalls >= this._readyCount) {
|
|
198672
|
-
this._emitReady = EMPTY_FN;
|
|
198673
|
-
this._readyEmitted = true;
|
|
198674
|
-
process.nextTick(() => this.emit(EVENTS.READY));
|
|
198675
|
-
}
|
|
198676
|
-
};
|
|
198677
|
-
this._emitRaw = (...args) => this.emit(EVENTS.RAW, ...args);
|
|
198678
|
-
this._boundRemove = this._remove.bind(this);
|
|
198679
|
-
this.options = opts;
|
|
198680
|
-
this._nodeFsHandler = new NodeFsHandler(this);
|
|
198681
|
-
Object.freeze(opts);
|
|
198682
|
-
}
|
|
198683
|
-
_addIgnoredPath(matcher) {
|
|
198684
|
-
if (isMatcherObject(matcher)) {
|
|
198685
|
-
for (const ignored of this._ignoredPaths) {
|
|
198686
|
-
if (isMatcherObject(ignored) && ignored.path === matcher.path && ignored.recursive === matcher.recursive) {
|
|
198687
|
-
return;
|
|
198688
|
-
}
|
|
198689
|
-
}
|
|
198690
|
-
}
|
|
198691
|
-
this._ignoredPaths.add(matcher);
|
|
198692
|
-
}
|
|
198693
|
-
_removeIgnoredPath(matcher) {
|
|
198694
|
-
this._ignoredPaths.delete(matcher);
|
|
198695
|
-
if (typeof matcher === "string") {
|
|
198696
|
-
for (const ignored of this._ignoredPaths) {
|
|
198697
|
-
if (isMatcherObject(ignored) && ignored.path === matcher) {
|
|
198698
|
-
this._ignoredPaths.delete(ignored);
|
|
198699
|
-
}
|
|
198700
|
-
}
|
|
198701
|
-
}
|
|
198702
|
-
}
|
|
198703
|
-
add(paths_, _origAdd, _internal) {
|
|
198704
|
-
const { cwd: cwd2 } = this.options;
|
|
198705
|
-
this.closed = false;
|
|
198706
|
-
this._closePromise = undefined;
|
|
198707
|
-
let paths = unifyPaths(paths_);
|
|
198708
|
-
if (cwd2) {
|
|
198709
|
-
paths = paths.map((path7) => {
|
|
198710
|
-
const absPath = getAbsolutePath(path7, cwd2);
|
|
198711
|
-
return absPath;
|
|
198712
|
-
});
|
|
198713
|
-
}
|
|
198714
|
-
paths.forEach((path7) => {
|
|
198715
|
-
this._removeIgnoredPath(path7);
|
|
198716
|
-
});
|
|
198717
|
-
this._userIgnored = undefined;
|
|
198718
|
-
if (!this._readyCount)
|
|
198719
|
-
this._readyCount = 0;
|
|
198720
|
-
this._readyCount += paths.length;
|
|
198721
|
-
Promise.all(paths.map(async (path7) => {
|
|
198722
|
-
const res = await this._nodeFsHandler._addToNodeFs(path7, !_internal, undefined, 0, _origAdd);
|
|
198723
|
-
if (res)
|
|
198724
|
-
this._emitReady();
|
|
198725
|
-
return res;
|
|
198726
|
-
})).then((results) => {
|
|
198727
|
-
if (this.closed)
|
|
198728
|
-
return;
|
|
198729
|
-
results.forEach((item) => {
|
|
198730
|
-
if (item)
|
|
198731
|
-
this.add(sp2.dirname(item), sp2.basename(_origAdd || item));
|
|
198732
|
-
});
|
|
198733
|
-
});
|
|
198734
|
-
return this;
|
|
198735
|
-
}
|
|
198736
|
-
unwatch(paths_) {
|
|
198737
|
-
if (this.closed)
|
|
198738
|
-
return this;
|
|
198739
|
-
const paths = unifyPaths(paths_);
|
|
198740
|
-
const { cwd: cwd2 } = this.options;
|
|
198741
|
-
paths.forEach((path7) => {
|
|
198742
|
-
if (!sp2.isAbsolute(path7) && !this._closers.has(path7)) {
|
|
198743
|
-
if (cwd2)
|
|
198744
|
-
path7 = sp2.join(cwd2, path7);
|
|
198745
|
-
path7 = sp2.resolve(path7);
|
|
198746
|
-
}
|
|
198747
|
-
this._closePath(path7);
|
|
198748
|
-
this._addIgnoredPath(path7);
|
|
198749
|
-
if (this._watched.has(path7)) {
|
|
198750
|
-
this._addIgnoredPath({
|
|
198751
|
-
path: path7,
|
|
198752
|
-
recursive: true
|
|
198753
|
-
});
|
|
198754
|
-
}
|
|
198755
|
-
this._userIgnored = undefined;
|
|
198756
|
-
});
|
|
198757
|
-
return this;
|
|
198758
|
-
}
|
|
198759
|
-
close() {
|
|
198760
|
-
if (this._closePromise) {
|
|
198761
|
-
return this._closePromise;
|
|
198762
|
-
}
|
|
198763
|
-
this.closed = true;
|
|
198764
|
-
this.removeAllListeners();
|
|
198765
|
-
const closers = [];
|
|
198766
|
-
this._closers.forEach((closerList) => closerList.forEach((closer) => {
|
|
198767
|
-
const promise2 = closer();
|
|
198768
|
-
if (promise2 instanceof Promise)
|
|
198769
|
-
closers.push(promise2);
|
|
198770
|
-
}));
|
|
198771
|
-
this._streams.forEach((stream) => stream.destroy());
|
|
198772
|
-
this._userIgnored = undefined;
|
|
198773
|
-
this._readyCount = 0;
|
|
198774
|
-
this._readyEmitted = false;
|
|
198775
|
-
this._watched.forEach((dirent) => dirent.dispose());
|
|
198776
|
-
this._closers.clear();
|
|
198777
|
-
this._watched.clear();
|
|
198778
|
-
this._streams.clear();
|
|
198779
|
-
this._symlinkPaths.clear();
|
|
198780
|
-
this._throttled.clear();
|
|
198781
|
-
this._closePromise = closers.length ? Promise.all(closers).then(() => {
|
|
198782
|
-
return;
|
|
198783
|
-
}) : Promise.resolve();
|
|
198784
|
-
return this._closePromise;
|
|
198785
|
-
}
|
|
198786
|
-
getWatched() {
|
|
198787
|
-
const watchList = {};
|
|
198788
|
-
this._watched.forEach((entry, dir) => {
|
|
198789
|
-
const key = this.options.cwd ? sp2.relative(this.options.cwd, dir) : dir;
|
|
198790
|
-
const index = key || ONE_DOT;
|
|
198791
|
-
watchList[index] = entry.getChildren().sort();
|
|
198792
|
-
});
|
|
198793
|
-
return watchList;
|
|
198794
|
-
}
|
|
198795
|
-
emitWithAll(event, args) {
|
|
198796
|
-
this.emit(event, ...args);
|
|
198797
|
-
if (event !== EVENTS.ERROR)
|
|
198798
|
-
this.emit(EVENTS.ALL, event, ...args);
|
|
198799
|
-
}
|
|
198800
|
-
async _emit(event, path7, stats2) {
|
|
198801
|
-
if (this.closed)
|
|
198802
|
-
return;
|
|
198803
|
-
const opts = this.options;
|
|
198804
|
-
if (isWindows)
|
|
198805
|
-
path7 = sp2.normalize(path7);
|
|
198806
|
-
if (opts.cwd)
|
|
198807
|
-
path7 = sp2.relative(opts.cwd, path7);
|
|
198808
|
-
const args = [path7];
|
|
198809
|
-
if (stats2 != null)
|
|
198810
|
-
args.push(stats2);
|
|
198811
|
-
const awf = opts.awaitWriteFinish;
|
|
198812
|
-
let pw;
|
|
198813
|
-
if (awf && (pw = this._pendingWrites.get(path7))) {
|
|
198814
|
-
pw.lastChange = new Date;
|
|
198815
|
-
return this;
|
|
198816
|
-
}
|
|
198817
|
-
if (opts.atomic) {
|
|
198818
|
-
if (event === EVENTS.UNLINK) {
|
|
198819
|
-
this._pendingUnlinks.set(path7, [event, ...args]);
|
|
198820
|
-
setTimeout(() => {
|
|
198821
|
-
this._pendingUnlinks.forEach((entry, path8) => {
|
|
198822
|
-
this.emit(...entry);
|
|
198823
|
-
this.emit(EVENTS.ALL, ...entry);
|
|
198824
|
-
this._pendingUnlinks.delete(path8);
|
|
198825
|
-
});
|
|
198826
|
-
}, typeof opts.atomic === "number" ? opts.atomic : 100);
|
|
198827
|
-
return this;
|
|
198828
|
-
}
|
|
198829
|
-
if (event === EVENTS.ADD && this._pendingUnlinks.has(path7)) {
|
|
198830
|
-
event = EVENTS.CHANGE;
|
|
198831
|
-
this._pendingUnlinks.delete(path7);
|
|
198832
|
-
}
|
|
198833
|
-
}
|
|
198834
|
-
if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
|
|
198835
|
-
const awfEmit = (err, stats3) => {
|
|
198836
|
-
if (err) {
|
|
198837
|
-
event = EVENTS.ERROR;
|
|
198838
|
-
args[0] = err;
|
|
198839
|
-
this.emitWithAll(event, args);
|
|
198840
|
-
} else if (stats3) {
|
|
198841
|
-
if (args.length > 1) {
|
|
198842
|
-
args[1] = stats3;
|
|
198843
|
-
} else {
|
|
198844
|
-
args.push(stats3);
|
|
198845
|
-
}
|
|
198846
|
-
this.emitWithAll(event, args);
|
|
198847
|
-
}
|
|
198848
|
-
};
|
|
198849
|
-
this._awaitWriteFinish(path7, awf.stabilityThreshold, event, awfEmit);
|
|
198850
|
-
return this;
|
|
198851
|
-
}
|
|
198852
|
-
if (event === EVENTS.CHANGE) {
|
|
198853
|
-
const isThrottled = !this._throttle(EVENTS.CHANGE, path7, 50);
|
|
198854
|
-
if (isThrottled)
|
|
198855
|
-
return this;
|
|
198856
|
-
}
|
|
198857
|
-
if (opts.alwaysStat && stats2 === undefined && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
|
|
198858
|
-
const fullPath = opts.cwd ? sp2.join(opts.cwd, path7) : path7;
|
|
198859
|
-
let stats3;
|
|
198860
|
-
try {
|
|
198861
|
-
stats3 = await stat8(fullPath);
|
|
198862
|
-
} catch (err) {}
|
|
198863
|
-
if (!stats3 || this.closed)
|
|
198864
|
-
return;
|
|
198865
|
-
args.push(stats3);
|
|
198866
|
-
}
|
|
198867
|
-
this.emitWithAll(event, args);
|
|
198868
|
-
return this;
|
|
198869
|
-
}
|
|
198870
|
-
_handleError(error52) {
|
|
198871
|
-
const code = error52 && error52.code;
|
|
198872
|
-
if (error52 && code !== "ENOENT" && code !== "ENOTDIR" && (!this.options.ignorePermissionErrors || code !== "EPERM" && code !== "EACCES")) {
|
|
198873
|
-
this.emit(EVENTS.ERROR, error52);
|
|
198874
|
-
}
|
|
198875
|
-
return error52 || this.closed;
|
|
198876
|
-
}
|
|
198877
|
-
_throttle(actionType, path7, timeout) {
|
|
198878
|
-
if (!this._throttled.has(actionType)) {
|
|
198879
|
-
this._throttled.set(actionType, new Map);
|
|
198880
|
-
}
|
|
198881
|
-
const action = this._throttled.get(actionType);
|
|
198882
|
-
if (!action)
|
|
198883
|
-
throw new Error("invalid throttle");
|
|
198884
|
-
const actionPath = action.get(path7);
|
|
198885
|
-
if (actionPath) {
|
|
198886
|
-
actionPath.count++;
|
|
198887
|
-
return false;
|
|
198888
|
-
}
|
|
198889
|
-
let timeoutObject;
|
|
198890
|
-
const clear = () => {
|
|
198891
|
-
const item = action.get(path7);
|
|
198892
|
-
const count = item ? item.count : 0;
|
|
198893
|
-
action.delete(path7);
|
|
198894
|
-
clearTimeout(timeoutObject);
|
|
198895
|
-
if (item)
|
|
198896
|
-
clearTimeout(item.timeoutObject);
|
|
198897
|
-
return count;
|
|
198898
|
-
};
|
|
198899
|
-
timeoutObject = setTimeout(clear, timeout);
|
|
198900
|
-
const thr = { timeoutObject, clear, count: 0 };
|
|
198901
|
-
action.set(path7, thr);
|
|
198902
|
-
return thr;
|
|
198903
|
-
}
|
|
198904
|
-
_incrReadyCount() {
|
|
198905
|
-
return this._readyCount++;
|
|
198906
|
-
}
|
|
198907
|
-
_awaitWriteFinish(path7, threshold, event, awfEmit) {
|
|
198908
|
-
const awf = this.options.awaitWriteFinish;
|
|
198909
|
-
if (typeof awf !== "object")
|
|
198910
|
-
return;
|
|
198911
|
-
const pollInterval = awf.pollInterval;
|
|
198912
|
-
let timeoutHandler;
|
|
198913
|
-
let fullPath = path7;
|
|
198914
|
-
if (this.options.cwd && !sp2.isAbsolute(path7)) {
|
|
198915
|
-
fullPath = sp2.join(this.options.cwd, path7);
|
|
198916
|
-
}
|
|
198917
|
-
const now = new Date;
|
|
198918
|
-
const writes = this._pendingWrites;
|
|
198919
|
-
function awaitWriteFinishFn(prevStat) {
|
|
198920
|
-
statcb(fullPath, (err, curStat) => {
|
|
198921
|
-
if (err || !writes.has(path7)) {
|
|
198922
|
-
if (err && err.code !== "ENOENT")
|
|
198923
|
-
awfEmit(err);
|
|
198924
|
-
return;
|
|
198925
|
-
}
|
|
198926
|
-
const now2 = Number(new Date);
|
|
198927
|
-
if (prevStat && curStat.size !== prevStat.size) {
|
|
198928
|
-
writes.get(path7).lastChange = now2;
|
|
198929
|
-
}
|
|
198930
|
-
const pw = writes.get(path7);
|
|
198931
|
-
const df = now2 - pw.lastChange;
|
|
198932
|
-
if (df >= threshold) {
|
|
198933
|
-
writes.delete(path7);
|
|
198934
|
-
awfEmit(undefined, curStat);
|
|
198935
|
-
} else {
|
|
198936
|
-
timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);
|
|
198937
|
-
}
|
|
198938
|
-
});
|
|
198939
|
-
}
|
|
198940
|
-
if (!writes.has(path7)) {
|
|
198941
|
-
writes.set(path7, {
|
|
198942
|
-
lastChange: now,
|
|
198943
|
-
cancelWait: () => {
|
|
198944
|
-
writes.delete(path7);
|
|
198945
|
-
clearTimeout(timeoutHandler);
|
|
198946
|
-
return event;
|
|
198947
|
-
}
|
|
198948
|
-
});
|
|
198949
|
-
timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval);
|
|
198950
|
-
}
|
|
198951
|
-
}
|
|
198952
|
-
_isIgnored(path7, stats2) {
|
|
198953
|
-
if (this.options.atomic && DOT_RE.test(path7))
|
|
198954
|
-
return true;
|
|
198955
|
-
if (!this._userIgnored) {
|
|
198956
|
-
const { cwd: cwd2 } = this.options;
|
|
198957
|
-
const ign = this.options.ignored;
|
|
198958
|
-
const ignored = (ign || []).map(normalizeIgnored(cwd2));
|
|
198959
|
-
const ignoredPaths = [...this._ignoredPaths];
|
|
198960
|
-
const list3 = [...ignoredPaths.map(normalizeIgnored(cwd2)), ...ignored];
|
|
198961
|
-
this._userIgnored = anymatch(list3, undefined);
|
|
198962
|
-
}
|
|
198963
|
-
return this._userIgnored(path7, stats2);
|
|
198964
|
-
}
|
|
198965
|
-
_isntIgnored(path7, stat9) {
|
|
198966
|
-
return !this._isIgnored(path7, stat9);
|
|
198967
|
-
}
|
|
198968
|
-
_getWatchHelpers(path7) {
|
|
198969
|
-
return new WatchHelper(path7, this.options.followSymlinks, this);
|
|
198970
|
-
}
|
|
198971
|
-
_getWatchedDir(directory) {
|
|
198972
|
-
const dir = sp2.resolve(directory);
|
|
198973
|
-
if (!this._watched.has(dir))
|
|
198974
|
-
this._watched.set(dir, new DirEntry(dir, this._boundRemove));
|
|
198975
|
-
return this._watched.get(dir);
|
|
198976
|
-
}
|
|
198977
|
-
_hasReadPermissions(stats2) {
|
|
198978
|
-
if (this.options.ignorePermissionErrors)
|
|
198979
|
-
return true;
|
|
198980
|
-
return Boolean(Number(stats2.mode) & 256);
|
|
198981
|
-
}
|
|
198982
|
-
_remove(directory, item, isDirectory) {
|
|
198983
|
-
const path7 = sp2.join(directory, item);
|
|
198984
|
-
const fullPath = sp2.resolve(path7);
|
|
198985
|
-
isDirectory = isDirectory != null ? isDirectory : this._watched.has(path7) || this._watched.has(fullPath);
|
|
198986
|
-
if (!this._throttle("remove", path7, 100))
|
|
198987
|
-
return;
|
|
198988
|
-
if (!isDirectory && this._watched.size === 1) {
|
|
198989
|
-
this.add(directory, item, true);
|
|
198990
|
-
}
|
|
198991
|
-
const wp = this._getWatchedDir(path7);
|
|
198992
|
-
const nestedDirectoryChildren = wp.getChildren();
|
|
198993
|
-
nestedDirectoryChildren.forEach((nested) => this._remove(path7, nested));
|
|
198994
|
-
const parent = this._getWatchedDir(directory);
|
|
198995
|
-
const wasTracked = parent.has(item);
|
|
198996
|
-
parent.remove(item);
|
|
198997
|
-
if (this._symlinkPaths.has(fullPath)) {
|
|
198998
|
-
this._symlinkPaths.delete(fullPath);
|
|
198999
|
-
}
|
|
199000
|
-
let relPath = path7;
|
|
199001
|
-
if (this.options.cwd)
|
|
199002
|
-
relPath = sp2.relative(this.options.cwd, path7);
|
|
199003
|
-
if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
|
|
199004
|
-
const event = this._pendingWrites.get(relPath).cancelWait();
|
|
199005
|
-
if (event === EVENTS.ADD)
|
|
199006
|
-
return;
|
|
199007
|
-
}
|
|
199008
|
-
this._watched.delete(path7);
|
|
199009
|
-
this._watched.delete(fullPath);
|
|
199010
|
-
const eventName = isDirectory ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
|
|
199011
|
-
if (wasTracked && !this._isIgnored(path7))
|
|
199012
|
-
this._emit(eventName, path7);
|
|
199013
|
-
this._closePath(path7);
|
|
199014
|
-
}
|
|
199015
|
-
_closePath(path7) {
|
|
199016
|
-
this._closeFile(path7);
|
|
199017
|
-
const dir = sp2.dirname(path7);
|
|
199018
|
-
this._getWatchedDir(dir).remove(sp2.basename(path7));
|
|
199019
|
-
}
|
|
199020
|
-
_closeFile(path7) {
|
|
199021
|
-
const closers = this._closers.get(path7);
|
|
199022
|
-
if (!closers)
|
|
199023
|
-
return;
|
|
199024
|
-
closers.forEach((closer) => closer());
|
|
199025
|
-
this._closers.delete(path7);
|
|
199026
|
-
}
|
|
199027
|
-
_addPathCloser(path7, closer) {
|
|
199028
|
-
if (!closer)
|
|
199029
|
-
return;
|
|
199030
|
-
let list3 = this._closers.get(path7);
|
|
199031
|
-
if (!list3) {
|
|
199032
|
-
list3 = [];
|
|
199033
|
-
this._closers.set(path7, list3);
|
|
199034
|
-
}
|
|
199035
|
-
list3.push(closer);
|
|
199036
|
-
}
|
|
199037
|
-
_readdirp(root4, opts) {
|
|
199038
|
-
if (this.closed)
|
|
199039
|
-
return;
|
|
199040
|
-
const options = { type: EVENTS.ALL, alwaysStat: true, lstat: true, ...opts, depth: 0 };
|
|
199041
|
-
let stream = readdirp(root4, options);
|
|
199042
|
-
this._streams.add(stream);
|
|
199043
|
-
stream.once(STR_CLOSE, () => {
|
|
199044
|
-
stream = undefined;
|
|
199045
|
-
});
|
|
199046
|
-
stream.once(STR_END, () => {
|
|
199047
|
-
if (stream) {
|
|
199048
|
-
this._streams.delete(stream);
|
|
199049
|
-
stream = undefined;
|
|
199050
|
-
}
|
|
199051
|
-
});
|
|
199052
|
-
return stream;
|
|
199053
|
-
}
|
|
199054
|
-
}
|
|
199055
|
-
function watch(paths, options = {}) {
|
|
199056
|
-
const watcher = new FSWatcher(options);
|
|
199057
|
-
watcher.add(paths);
|
|
199058
|
-
return watcher;
|
|
199059
|
-
}
|
|
199060
|
-
|
|
199061
197449
|
// src/config/load/watch.ts
|
|
199062
|
-
import {
|
|
197450
|
+
import { watch } from "fs";
|
|
197451
|
+
import { basename as basename4, sep as sep2 } from "path";
|
|
197452
|
+
var ignoredDirectories = new Set(["node_modules", ".awsless", "dist", ".git"]);
|
|
199063
197453
|
var isConfigFile = (path7) => {
|
|
199064
|
-
const base =
|
|
197454
|
+
const base = basename4(path7);
|
|
199065
197455
|
return /^app\.(json|jsonc|json5)$/.test(base) || /(^|\.)stack\.(json|jsonc|json5)$/.test(base);
|
|
199066
197456
|
};
|
|
199067
|
-
var watchConfig = async (options,
|
|
197457
|
+
var watchConfig = async (options, resolve5, reject) => {
|
|
199068
197458
|
await loadAppConfig(options);
|
|
199069
197459
|
debug("Start watching...");
|
|
199070
|
-
|
|
199071
|
-
const watcher = watch(directories.root, {
|
|
199072
|
-
|
|
199073
|
-
if (path7.split(sep2).some((segment) => ignoredDirectories.has(segment))) {
|
|
199074
|
-
return true;
|
|
199075
|
-
}
|
|
199076
|
-
if (stats2?.isFile()) {
|
|
199077
|
-
return !isConfigFile(path7);
|
|
199078
|
-
}
|
|
199079
|
-
return false;
|
|
199080
|
-
},
|
|
199081
|
-
awaitWriteFinish: true
|
|
199082
|
-
});
|
|
199083
|
-
watcher.on("change", async (path7) => {
|
|
199084
|
-
if (!isConfigFile(path7)) {
|
|
197460
|
+
let reloadTimer;
|
|
197461
|
+
const watcher = watch(directories.root, { recursive: true }, (_event, filename) => {
|
|
197462
|
+
if (!filename) {
|
|
199085
197463
|
return;
|
|
199086
197464
|
}
|
|
199087
|
-
|
|
199088
|
-
|
|
199089
|
-
|
|
199090
|
-
|
|
199091
|
-
|
|
199092
|
-
} catch (error52) {
|
|
199093
|
-
reject(error52);
|
|
197465
|
+
if (filename.split(sep2).some((segment) => ignoredDirectories.has(segment))) {
|
|
197466
|
+
return;
|
|
197467
|
+
}
|
|
197468
|
+
if (!isConfigFile(filename)) {
|
|
197469
|
+
return;
|
|
199094
197470
|
}
|
|
197471
|
+
clearTimeout(reloadTimer);
|
|
197472
|
+
reloadTimer = setTimeout(async () => {
|
|
197473
|
+
try {
|
|
197474
|
+
const appConfig = await loadAppConfig(options);
|
|
197475
|
+
const stackConfigs = await loadStackConfigs(options);
|
|
197476
|
+
validateFeatures({ appConfig, stackConfigs });
|
|
197477
|
+
resolve5({ appConfig, stackConfigs });
|
|
197478
|
+
} catch (error52) {
|
|
197479
|
+
reject(error52);
|
|
197480
|
+
}
|
|
197481
|
+
}, 150);
|
|
199095
197482
|
});
|
|
199096
197483
|
return watcher;
|
|
199097
197484
|
};
|
|
199098
197485
|
|
|
199099
197486
|
// src/dev/index.ts
|
|
199100
197487
|
import { loadWorkspace as loadWorkspace3 } from "@awsless/ts-file-cache";
|
|
197488
|
+
import { watch as watch2 } from "fs";
|
|
199101
197489
|
import { mkdir as mkdir11, rm as rm12, writeFile as writeFile15 } from "fs/promises";
|
|
199102
|
-
import { basename as
|
|
197490
|
+
import { basename as basename5, dirname as dirname24, join as join49, sep as sep5 } from "path";
|
|
199103
197491
|
|
|
199104
197492
|
// src/dev/context.ts
|
|
199105
197493
|
import { DynamoDBServer } from "@awsless/dynamodb-server";
|
|
199106
|
-
import { join as
|
|
197494
|
+
import { join as join44 } from "path";
|
|
199107
197495
|
|
|
199108
197496
|
// src/dev/servers/s3.ts
|
|
199109
197497
|
import { createHash as createHash20 } from "crypto";
|
|
199110
|
-
import { mkdir as mkdir9, readdir as
|
|
197498
|
+
import { mkdir as mkdir9, readdir as readdir6, readFile as readFile18, rm as rm10, stat as stat6, writeFile as writeFile12 } from "fs/promises";
|
|
199111
197499
|
import { createServer as createServer7 } from "http";
|
|
199112
|
-
import { dirname as
|
|
197500
|
+
import { dirname as dirname22, isAbsolute as isAbsolute6, join as join43, relative as relative10, sep as sep3 } from "path";
|
|
199113
197501
|
var escapeXml = (value) => {
|
|
199114
197502
|
return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
199115
197503
|
};
|
|
@@ -199174,11 +197562,11 @@ var createS3Server = (props) => {
|
|
|
199174
197562
|
res.end(xmlError("InvalidRequest", "Missing bucket name"));
|
|
199175
197563
|
return;
|
|
199176
197564
|
}
|
|
199177
|
-
const bucketDir =
|
|
199178
|
-
const file3 =
|
|
197565
|
+
const bucketDir = join43(props.root, bucket);
|
|
197566
|
+
const file3 = join43(bucketDir, ...keyParts);
|
|
199179
197567
|
const escapes = (base, path7) => {
|
|
199180
|
-
const rel =
|
|
199181
|
-
return rel.startsWith("..") ||
|
|
197568
|
+
const rel = relative10(base, path7);
|
|
197569
|
+
return rel.startsWith("..") || isAbsolute6(rel);
|
|
199182
197570
|
};
|
|
199183
197571
|
if (escapes(props.root, bucketDir) || escapes(bucketDir, file3)) {
|
|
199184
197572
|
res.writeHead(400, { "content-type": "application/xml" });
|
|
@@ -199191,20 +197579,20 @@ var createS3Server = (props) => {
|
|
|
199191
197579
|
const walk2 = async (dir) => {
|
|
199192
197580
|
let entries2;
|
|
199193
197581
|
try {
|
|
199194
|
-
entries2 = await
|
|
197582
|
+
entries2 = await readdir6(dir, { withFileTypes: true });
|
|
199195
197583
|
} catch (_5) {
|
|
199196
197584
|
return;
|
|
199197
197585
|
}
|
|
199198
197586
|
for (const entry of entries2) {
|
|
199199
|
-
const path7 =
|
|
197587
|
+
const path7 = join43(dir, entry.name);
|
|
199200
197588
|
if (entry.isDirectory()) {
|
|
199201
197589
|
await walk2(path7);
|
|
199202
197590
|
} else {
|
|
199203
|
-
const objectKey =
|
|
197591
|
+
const objectKey = relative10(bucketDir, path7).split(sep3).join("/");
|
|
199204
197592
|
if (!objectKey.startsWith(prefix)) {
|
|
199205
197593
|
continue;
|
|
199206
197594
|
}
|
|
199207
|
-
const info2 = await
|
|
197595
|
+
const info2 = await stat6(path7);
|
|
199208
197596
|
contents.push(`<Contents><Key>${escapeXml(objectKey)}</Key><Size>${info2.size}</Size><LastModified>${info2.mtime.toISOString()}</LastModified><ETag>"local"</ETag></Contents>`);
|
|
199209
197597
|
}
|
|
199210
197598
|
}
|
|
@@ -199222,7 +197610,7 @@ var createS3Server = (props) => {
|
|
|
199222
197610
|
if (typeof encoding === "string" && encoding.includes("aws-chunked") || typeof sha === "string" && sha.startsWith("STREAMING")) {
|
|
199223
197611
|
body = decodeAwsChunked(body);
|
|
199224
197612
|
}
|
|
199225
|
-
await mkdir9(
|
|
197613
|
+
await mkdir9(dirname22(file3), { recursive: true });
|
|
199226
197614
|
await writeFile12(file3, body);
|
|
199227
197615
|
const eTag = createHash20("md5").update(body).digest("hex");
|
|
199228
197616
|
res.writeHead(200, { etag: `"${eTag}"` });
|
|
@@ -199268,10 +197656,10 @@ var createS3Server = (props) => {
|
|
|
199268
197656
|
res.end(xmlError("InternalError", error52 instanceof Error ? error52.message : String(error52)));
|
|
199269
197657
|
});
|
|
199270
197658
|
});
|
|
199271
|
-
await new Promise((
|
|
197659
|
+
await new Promise((resolve5, reject) => {
|
|
199272
197660
|
server.once("error", reject);
|
|
199273
197661
|
closeServer = trackConnections(server);
|
|
199274
|
-
server.listen(port, "127.0.0.1", () =>
|
|
197662
|
+
server.listen(port, "127.0.0.1", () => resolve5());
|
|
199275
197663
|
});
|
|
199276
197664
|
return server.address().port;
|
|
199277
197665
|
},
|
|
@@ -199486,7 +197874,7 @@ var createSqsServer = (props) => {
|
|
|
199486
197874
|
if (now >= deadline || signal.aborted) {
|
|
199487
197875
|
return {};
|
|
199488
197876
|
}
|
|
199489
|
-
await new Promise((
|
|
197877
|
+
await new Promise((resolve5) => setTimeout(resolve5, 100));
|
|
199490
197878
|
}
|
|
199491
197879
|
},
|
|
199492
197880
|
DeleteMessage(input) {
|
|
@@ -199592,10 +197980,10 @@ var createSqsServer = (props) => {
|
|
|
199592
197980
|
}
|
|
199593
197981
|
});
|
|
199594
197982
|
});
|
|
199595
|
-
await new Promise((
|
|
197983
|
+
await new Promise((resolve5, reject) => {
|
|
199596
197984
|
server.once("error", reject);
|
|
199597
197985
|
closeServer = trackConnections(server);
|
|
199598
|
-
server.listen(port, "127.0.0.1", () =>
|
|
197986
|
+
server.listen(port, "127.0.0.1", () => resolve5());
|
|
199599
197987
|
});
|
|
199600
197988
|
boundPort = server.address().port;
|
|
199601
197989
|
return boundPort;
|
|
@@ -199670,7 +198058,7 @@ var createDevContext = (props) => {
|
|
|
199670
198058
|
const value = await props.pool.keep("store", null, async () => {
|
|
199671
198059
|
const rules = [];
|
|
199672
198060
|
const server = createS3Server({
|
|
199673
|
-
root:
|
|
198061
|
+
root: join44(directories.output, "local", "store"),
|
|
199674
198062
|
region: props.appConfig.region,
|
|
199675
198063
|
rules
|
|
199676
198064
|
});
|
|
@@ -199797,9 +198185,9 @@ var createDevContext = (props) => {
|
|
|
199797
198185
|
|
|
199798
198186
|
// src/dev/seed.ts
|
|
199799
198187
|
import { spawn as spawn6 } from "child_process";
|
|
199800
|
-
import { isAbsolute as
|
|
198188
|
+
import { isAbsolute as isAbsolute7, join as join45 } from "path";
|
|
199801
198189
|
var createSeedRunner = (props) => {
|
|
199802
|
-
const file3 = props.seed && (
|
|
198190
|
+
const file3 = props.seed && (isAbsolute7(props.seed) ? props.seed : join45(directories.root, props.seed));
|
|
199803
198191
|
let running;
|
|
199804
198192
|
const run = () => {
|
|
199805
198193
|
running ??= (async () => {
|
|
@@ -199808,7 +198196,7 @@ var createSeedRunner = (props) => {
|
|
|
199808
198196
|
return;
|
|
199809
198197
|
}
|
|
199810
198198
|
debug(`Seeding from ${props.seed}`);
|
|
199811
|
-
await new Promise((
|
|
198199
|
+
await new Promise((resolve5, reject) => {
|
|
199812
198200
|
const child = spawn6("bun", [file3], {
|
|
199813
198201
|
cwd: directories.root,
|
|
199814
198202
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -199827,7 +198215,7 @@ var createSeedRunner = (props) => {
|
|
|
199827
198215
|
debug(logs);
|
|
199828
198216
|
}
|
|
199829
198217
|
if (code === 0) {
|
|
199830
|
-
|
|
198218
|
+
resolve5();
|
|
199831
198219
|
} else {
|
|
199832
198220
|
reject(new Error(`The seed exited with code ${code}:
|
|
199833
198221
|
${logs}`));
|
|
@@ -199848,15 +198236,15 @@ var import_ioredis4 = __toESM(require_built5(), 1);
|
|
|
199848
198236
|
import { DynamoDBClient as DynamoDBClient5 } from "@aws-sdk/client-dynamodb";
|
|
199849
198237
|
import { DynamoDBDocumentClient, ScanCommand as ScanCommand2 } from "@aws-sdk/lib-dynamodb";
|
|
199850
198238
|
import { randomUUID as randomUUID8 } from "crypto";
|
|
199851
|
-
import { readdir as
|
|
198239
|
+
import { readdir as readdir7, readFile as readFile19, stat as stat7, writeFile as writeFile14 } from "fs/promises";
|
|
199852
198240
|
import { createServer as createServer9 } from "http";
|
|
199853
|
-
import { join as
|
|
198241
|
+
import { join as join47, relative as relative11, sep as sep4 } from "path";
|
|
199854
198242
|
|
|
199855
198243
|
// src/dev/worker.ts
|
|
199856
198244
|
import { spawn as spawn7 } from "child_process";
|
|
199857
198245
|
import { writeFile as writeFile13 } from "fs/promises";
|
|
199858
198246
|
import { availableParallelism } from "os";
|
|
199859
|
-
import { join as
|
|
198247
|
+
import { join as join46 } from "path";
|
|
199860
198248
|
class WorkerError extends Error {
|
|
199861
198249
|
name;
|
|
199862
198250
|
constructor(name, message3, stack) {
|
|
@@ -200048,12 +198436,12 @@ var createBundleWorker = (props) => {
|
|
|
200048
198436
|
return;
|
|
200049
198437
|
}
|
|
200050
198438
|
} catch (_5) {}
|
|
200051
|
-
await new Promise((
|
|
198439
|
+
await new Promise((resolve5) => setTimeout(resolve5, 50));
|
|
200052
198440
|
}
|
|
200053
198441
|
throw new Error("The bundle worker never became ready.");
|
|
200054
198442
|
};
|
|
200055
198443
|
const startWorker = async () => {
|
|
200056
|
-
const entry =
|
|
198444
|
+
const entry = join46(props.buildDir, "worker.mjs");
|
|
200057
198445
|
const port = await findFreePort();
|
|
200058
198446
|
const child = spawn7("node", ["--enable-source-maps", entry], {
|
|
200059
198447
|
cwd: props.buildDir,
|
|
@@ -200114,7 +198502,7 @@ var createBundleWorker = (props) => {
|
|
|
200114
198502
|
return worker;
|
|
200115
198503
|
};
|
|
200116
198504
|
const doStart = async () => {
|
|
200117
|
-
await writeFile13(
|
|
198505
|
+
await writeFile13(join46(props.buildDir, "worker.mjs"), WORKER_ENTRY);
|
|
200118
198506
|
const results = await Promise.allSettled(Array.from({ length: concurrency }, () => startWorker()));
|
|
200119
198507
|
const started = results.filter((result) => result.status === "fulfilled").map((result) => result.value);
|
|
200120
198508
|
const failed = results.find((result) => result.status === "rejected");
|
|
@@ -202528,18 +200916,18 @@ var createDashboardServer = (props) => {
|
|
|
202528
200916
|
const walk2 = async (dir) => {
|
|
202529
200917
|
let entries2;
|
|
202530
200918
|
try {
|
|
202531
|
-
entries2 = await
|
|
200919
|
+
entries2 = await readdir7(dir, { withFileTypes: true });
|
|
202532
200920
|
} catch (_5) {
|
|
202533
200921
|
return;
|
|
202534
200922
|
}
|
|
202535
200923
|
for (const entry of entries2) {
|
|
202536
|
-
const path7 =
|
|
200924
|
+
const path7 = join47(dir, entry.name);
|
|
202537
200925
|
if (entry.isDirectory()) {
|
|
202538
200926
|
await walk2(path7);
|
|
202539
200927
|
} else {
|
|
202540
|
-
const key =
|
|
200928
|
+
const key = relative11(props.storeRoot, path7).split(sep4).slice(1).join("/");
|
|
202541
200929
|
if (key.startsWith(prefix)) {
|
|
202542
|
-
const info2 = await
|
|
200930
|
+
const info2 = await stat7(path7);
|
|
202543
200931
|
files.push({ key, size: info2.size, modified: info2.mtime.toISOString() });
|
|
202544
200932
|
}
|
|
202545
200933
|
}
|
|
@@ -202665,10 +201053,10 @@ var createDashboardServer = (props) => {
|
|
|
202665
201053
|
res.end(JSON.stringify({ error: message3 }));
|
|
202666
201054
|
});
|
|
202667
201055
|
});
|
|
202668
|
-
await new Promise((
|
|
201056
|
+
await new Promise((resolve5, reject) => {
|
|
202669
201057
|
server.once("error", reject);
|
|
202670
201058
|
closeServer = trackConnections(server);
|
|
202671
|
-
server.listen(port, "127.0.0.1", () =>
|
|
201059
|
+
server.listen(port, "127.0.0.1", () => resolve5());
|
|
202672
201060
|
});
|
|
202673
201061
|
},
|
|
202674
201062
|
stop() {
|
|
@@ -202755,10 +201143,10 @@ var createBlockedServer = (props) => {
|
|
|
202755
201143
|
res.writeHead(400, { "content-type": "application/x-amz-json-1.1" });
|
|
202756
201144
|
res.end(JSON.stringify({ __type: "NotEmulatedLocally", message: message3 }));
|
|
202757
201145
|
});
|
|
202758
|
-
await new Promise((
|
|
201146
|
+
await new Promise((resolve5, reject) => {
|
|
202759
201147
|
server.once("error", reject);
|
|
202760
201148
|
closeServer = trackConnections(server);
|
|
202761
|
-
server.listen(port, "127.0.0.1", () =>
|
|
201149
|
+
server.listen(port, "127.0.0.1", () => resolve5());
|
|
202762
201150
|
});
|
|
202763
201151
|
return server.address().port;
|
|
202764
201152
|
},
|
|
@@ -202836,10 +201224,10 @@ var createLambdaServer = (props) => {
|
|
|
202836
201224
|
}
|
|
202837
201225
|
}).catch(fail);
|
|
202838
201226
|
});
|
|
202839
|
-
await new Promise((
|
|
201227
|
+
await new Promise((resolve5, reject) => {
|
|
202840
201228
|
server.once("error", reject);
|
|
202841
201229
|
closeServer = trackConnections(server);
|
|
202842
|
-
server.listen(port, "127.0.0.1", () =>
|
|
201230
|
+
server.listen(port, "127.0.0.1", () => resolve5());
|
|
202843
201231
|
});
|
|
202844
201232
|
return server.address().port;
|
|
202845
201233
|
},
|
|
@@ -202850,17 +201238,17 @@ var createLambdaServer = (props) => {
|
|
|
202850
201238
|
};
|
|
202851
201239
|
|
|
202852
201240
|
// src/dev/sdk.ts
|
|
202853
|
-
import { readdir as
|
|
201241
|
+
import { readdir as readdir8, readFile as readFile20, mkdir as mkdir10, rm as rm11, stat as stat8, symlink } from "fs/promises";
|
|
202854
201242
|
import { createRequire } from "module";
|
|
202855
|
-
import { dirname as
|
|
201243
|
+
import { dirname as dirname23, join as join48 } from "path";
|
|
202856
201244
|
var linkSdkPackages = async (buildDir, onWarn) => {
|
|
202857
|
-
const filesDir =
|
|
201245
|
+
const filesDir = join48(buildDir, "files");
|
|
202858
201246
|
const packages = new Set;
|
|
202859
|
-
for (const file3 of await
|
|
201247
|
+
for (const file3 of await readdir8(filesDir)) {
|
|
202860
201248
|
if (!file3.endsWith(".mjs")) {
|
|
202861
201249
|
continue;
|
|
202862
201250
|
}
|
|
202863
|
-
const code = await readFile20(
|
|
201251
|
+
const code = await readFile20(join48(filesDir, file3), "utf8");
|
|
202864
201252
|
for (const match3 of code.matchAll(/(?:from\s*|import\()\s*["'](@aws-sdk\/[a-z0-9-]+|sharp)["']/g)) {
|
|
202865
201253
|
packages.add(match3[1]);
|
|
202866
201254
|
}
|
|
@@ -202868,25 +201256,25 @@ var linkSdkPackages = async (buildDir, onWarn) => {
|
|
|
202868
201256
|
const ownRequire = createRequire(import.meta.url);
|
|
202869
201257
|
const isProjectDep = async (name) => {
|
|
202870
201258
|
try {
|
|
202871
|
-
await
|
|
201259
|
+
await stat8(join48(directories.root, "node_modules", name, "package.json"));
|
|
202872
201260
|
return true;
|
|
202873
201261
|
} catch (_5) {
|
|
202874
201262
|
return false;
|
|
202875
201263
|
}
|
|
202876
201264
|
};
|
|
202877
201265
|
const resolveFromStore = async (name) => {
|
|
202878
|
-
const store =
|
|
201266
|
+
const store = join48(directories.root, "node_modules", ".pnpm");
|
|
202879
201267
|
const prefix = name.replaceAll("/", "+") + "@";
|
|
202880
201268
|
try {
|
|
202881
|
-
const entries2 = (await
|
|
201269
|
+
const entries2 = (await readdir8(store)).filter((entry) => entry.startsWith(prefix));
|
|
202882
201270
|
const best = entries2.sort((a4, b6) => a4.slice(prefix.length).localeCompare(b6.slice(prefix.length), undefined, { numeric: true })).at(-1);
|
|
202883
|
-
return best ?
|
|
201271
|
+
return best ? join48(store, best, "node_modules", name) : undefined;
|
|
202884
201272
|
} catch (_5) {
|
|
202885
201273
|
return;
|
|
202886
201274
|
}
|
|
202887
201275
|
};
|
|
202888
201276
|
for (const name of packages) {
|
|
202889
|
-
const target2 =
|
|
201277
|
+
const target2 = join48(buildDir, "node_modules", name);
|
|
202890
201278
|
try {
|
|
202891
201279
|
if (await isProjectDep(name)) {
|
|
202892
201280
|
await rm11(target2, { recursive: true, force: true });
|
|
@@ -202896,16 +201284,16 @@ var linkSdkPackages = async (buildDir, onWarn) => {
|
|
|
202896
201284
|
let source = await resolveFromStore(name);
|
|
202897
201285
|
if (!source) {
|
|
202898
201286
|
try {
|
|
202899
|
-
source =
|
|
201287
|
+
source = dirname23(ownRequire.resolve(`${name}/package.json`));
|
|
202900
201288
|
} catch (_5) {
|
|
202901
201289
|
onWarn?.(`The bundle imports "${name}", which is neither a project dependency nor shipped with the cli. Add it to your project dependencies.`);
|
|
202902
201290
|
continue;
|
|
202903
201291
|
}
|
|
202904
201292
|
}
|
|
202905
|
-
await mkdir10(
|
|
201293
|
+
await mkdir10(dirname23(target2), { recursive: true });
|
|
202906
201294
|
await rm11(target2, { recursive: true, force: true });
|
|
202907
201295
|
await symlink(source, target2, "dir");
|
|
202908
|
-
await
|
|
201296
|
+
await stat8(join48(target2, "package.json"));
|
|
202909
201297
|
debug(`Sdk link ${name}: ${source}`);
|
|
202910
201298
|
} catch (error52) {
|
|
202911
201299
|
onWarn?.(`Linking the "${name}" sdk package failed: ${error52 instanceof Error ? error52.message : String(error52)}`);
|
|
@@ -202931,7 +201319,7 @@ var startDev = async (props) => {
|
|
|
202931
201319
|
dev: true
|
|
202932
201320
|
});
|
|
202933
201321
|
ready2();
|
|
202934
|
-
await mkdir11(
|
|
201322
|
+
await mkdir11(join49(directories.output, "local"), { recursive: true });
|
|
202935
201323
|
const routerPorts = {};
|
|
202936
201324
|
Object.keys(appConfig.router ?? {}).forEach((id, index) => {
|
|
202937
201325
|
routerPorts[id] = props.port + 1 + index;
|
|
@@ -202989,7 +201377,7 @@ var startDev = async (props) => {
|
|
|
202989
201377
|
for (const [id, port] of Object.entries(routerPorts)) {
|
|
202990
201378
|
env4[`ROUTER_${constantCase(id)}_ENDPOINT`] = `localhost:${port}`;
|
|
202991
201379
|
}
|
|
202992
|
-
await writeFile15(
|
|
201380
|
+
await writeFile15(join49(directories.output, "local", "env.json"), JSON.stringify(env4, null, "\t") + `
|
|
202993
201381
|
`);
|
|
202994
201382
|
return { env: env4, lambda: lambda2 };
|
|
202995
201383
|
});
|
|
@@ -203226,8 +201614,8 @@ var startDev = async (props) => {
|
|
|
203226
201614
|
resources: dev.resources,
|
|
203227
201615
|
routes: dev.routes,
|
|
203228
201616
|
env: env3,
|
|
203229
|
-
storeRoot:
|
|
203230
|
-
configFile:
|
|
201617
|
+
storeRoot: join49(directories.output, "local", "store"),
|
|
201618
|
+
configFile: join49(directories.output, "local", "config.json"),
|
|
203231
201619
|
getEmails: () => props.pool.peek("shim:ses-email")?.server.list() ?? [],
|
|
203232
201620
|
getAlerts: () => props.pool.peek("shim:sns")?.alerts ?? [],
|
|
203233
201621
|
getSession: () => ({ startedAt, workers: worker.size() }),
|
|
@@ -203241,20 +201629,19 @@ var startDev = async (props) => {
|
|
|
203241
201629
|
});
|
|
203242
201630
|
dashboard.connect(dispatch);
|
|
203243
201631
|
await dashboard.listen(dashboardPort);
|
|
203244
|
-
const
|
|
203245
|
-
const watcher = watch(directories.root, {
|
|
203246
|
-
ignored: (path7) => {
|
|
203247
|
-
if (path7.split(sep5).some((segment) => ignoredDirectories.has(segment))) {
|
|
203248
|
-
return true;
|
|
203249
|
-
}
|
|
203250
|
-
const base = basename7(path7);
|
|
203251
|
-
return base.includes(".stack.") || base.startsWith("app.json");
|
|
203252
|
-
},
|
|
203253
|
-
ignoreInitial: true,
|
|
203254
|
-
awaitWriteFinish: { stabilityThreshold: 100, pollInterval: 50 }
|
|
203255
|
-
});
|
|
201632
|
+
const ignoredDirectories2 = new Set(["node_modules", ".awsless", "dist", ".git"]);
|
|
203256
201633
|
let rebuildTimer;
|
|
203257
|
-
watcher.
|
|
201634
|
+
const watcher = watch2(directories.root, { recursive: true }, (_event, filename) => {
|
|
201635
|
+
if (!filename) {
|
|
201636
|
+
return;
|
|
201637
|
+
}
|
|
201638
|
+
if (filename.split(sep5).some((segment) => ignoredDirectories2.has(segment))) {
|
|
201639
|
+
return;
|
|
201640
|
+
}
|
|
201641
|
+
const base = basename5(filename);
|
|
201642
|
+
if (base.includes(".stack.") || base.startsWith("app.json")) {
|
|
201643
|
+
return;
|
|
201644
|
+
}
|
|
203258
201645
|
dirty = true;
|
|
203259
201646
|
clearTimeout(rebuildTimer);
|
|
203260
201647
|
rebuildTimer = setTimeout(() => {
|
|
@@ -203263,8 +201650,7 @@ var startDev = async (props) => {
|
|
|
203263
201650
|
});
|
|
203264
201651
|
}, 150);
|
|
203265
201652
|
});
|
|
203266
|
-
const
|
|
203267
|
-
restartWatcher?.on("all", () => {
|
|
201653
|
+
const restartWorker = () => {
|
|
203268
201654
|
if (stopping) {
|
|
203269
201655
|
return;
|
|
203270
201656
|
}
|
|
@@ -203277,16 +201663,27 @@ var startDev = async (props) => {
|
|
|
203277
201663
|
dev.context.reportHealth("workers", "down", error52 instanceof Error ? error52.message : String(error52));
|
|
203278
201664
|
log(`The bundle worker failed to restart: ${error52 instanceof Error ? error52.message : String(error52)}`);
|
|
203279
201665
|
});
|
|
203280
|
-
}
|
|
201666
|
+
};
|
|
201667
|
+
const restartWatchers = [];
|
|
201668
|
+
for (const path7 of dev.restartPaths) {
|
|
201669
|
+
await mkdir11(dirname24(path7), { recursive: true });
|
|
201670
|
+
restartWatchers.push(watch2(dirname24(path7), (_event, filename) => {
|
|
201671
|
+
if (filename === basename5(path7)) {
|
|
201672
|
+
restartWorker();
|
|
201673
|
+
}
|
|
201674
|
+
}));
|
|
201675
|
+
}
|
|
203281
201676
|
return {
|
|
203282
201677
|
dashboardPort,
|
|
203283
201678
|
routerPorts,
|
|
203284
201679
|
async stop() {
|
|
203285
201680
|
stopping = true;
|
|
203286
|
-
await rm12(
|
|
201681
|
+
await rm12(join49(directories.output, "local", "env.json"), { force: true });
|
|
203287
201682
|
clearTimeout(rebuildTimer);
|
|
203288
|
-
|
|
203289
|
-
|
|
201683
|
+
watcher.close();
|
|
201684
|
+
for (const restartWatcher of restartWatchers) {
|
|
201685
|
+
restartWatcher.close();
|
|
201686
|
+
}
|
|
203290
201687
|
await fresh?.catch(() => {});
|
|
203291
201688
|
for (const router of routers) {
|
|
203292
201689
|
await router.stop();
|
|
@@ -203349,7 +201746,7 @@ var createServerPool = () => {
|
|
|
203349
201746
|
|
|
203350
201747
|
// src/type-gen/generate.ts
|
|
203351
201748
|
import { mkdir as mkdir12, writeFile as writeFile16 } from "fs/promises";
|
|
203352
|
-
import { dirname as
|
|
201749
|
+
import { dirname as dirname25, join as join50, relative as relative12 } from "path";
|
|
203353
201750
|
var generateTypes = async (props) => {
|
|
203354
201751
|
const files = [];
|
|
203355
201752
|
await Promise.all(features.map((feature) => {
|
|
@@ -203357,12 +201754,12 @@ var generateTypes = async (props) => {
|
|
|
203357
201754
|
...props,
|
|
203358
201755
|
async write(file3, data, include = false) {
|
|
203359
201756
|
const code = data?.toString("utf8");
|
|
203360
|
-
const path7 =
|
|
201757
|
+
const path7 = join50(directories.types, file3);
|
|
203361
201758
|
if (code) {
|
|
203362
201759
|
if (include) {
|
|
203363
|
-
files.push(
|
|
201760
|
+
files.push(relative12(directories.root, path7));
|
|
203364
201761
|
}
|
|
203365
|
-
await mkdir12(
|
|
201762
|
+
await mkdir12(dirname25(path7), { recursive: true });
|
|
203366
201763
|
await writeFile16(path7, code);
|
|
203367
201764
|
}
|
|
203368
201765
|
}
|
|
@@ -203371,7 +201768,7 @@ var generateTypes = async (props) => {
|
|
|
203371
201768
|
if (files.length) {
|
|
203372
201769
|
const code = files.map((file3) => `/// <reference path='${file3}' />`).join(`
|
|
203373
201770
|
`);
|
|
203374
|
-
await writeFile16(
|
|
201771
|
+
await writeFile16(join50(directories.root, `awsless.d.ts`), code);
|
|
203375
201772
|
}
|
|
203376
201773
|
};
|
|
203377
201774
|
|
|
@@ -203390,8 +201787,8 @@ var dev = (program3) => {
|
|
|
203390
201787
|
const pool = createServerPool();
|
|
203391
201788
|
let instance;
|
|
203392
201789
|
let resolveShutdown;
|
|
203393
|
-
const shutdown = new Promise((
|
|
203394
|
-
resolveShutdown =
|
|
201790
|
+
const shutdown = new Promise((resolve5) => {
|
|
201791
|
+
resolveShutdown = resolve5;
|
|
203395
201792
|
});
|
|
203396
201793
|
const claimSignals = () => {
|
|
203397
201794
|
process.removeAllListeners("SIGINT");
|
|
@@ -204911,7 +203308,7 @@ class DefaultRateLimiter {
|
|
|
204911
203308
|
this.refillTokenBucket();
|
|
204912
203309
|
if (amount > this.availableTokens) {
|
|
204913
203310
|
const delay = (amount - this.availableTokens) / this.fillRate * 1000;
|
|
204914
|
-
await new Promise((
|
|
203311
|
+
await new Promise((resolve5) => DefaultRateLimiter.setTimeoutFn(resolve5, delay));
|
|
204915
203312
|
}
|
|
204916
203313
|
this.availableTokens = this.availableTokens - amount;
|
|
204917
203314
|
}
|
|
@@ -205690,7 +204087,7 @@ var DEFAULT_PROFILE = "default";
|
|
|
205690
204087
|
var getProfileName7 = (init) => init.profile || process.env[ENV_PROFILE2] || DEFAULT_PROFILE;
|
|
205691
204088
|
|
|
205692
204089
|
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js
|
|
205693
|
-
import { join as
|
|
204090
|
+
import { join as join53 } from "path";
|
|
205694
204091
|
|
|
205695
204092
|
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/constants.js
|
|
205696
204093
|
var CONFIG_PREFIX_SEPARATOR = ".";
|
|
@@ -205712,14 +204109,14 @@ var getConfigData = (data) => Object.entries(data).filter(([key]) => {
|
|
|
205712
204109
|
});
|
|
205713
204110
|
|
|
205714
204111
|
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigFilepath.js
|
|
205715
|
-
import { join as
|
|
204112
|
+
import { join as join51 } from "path";
|
|
205716
204113
|
var ENV_CONFIG_PATH = "AWS_CONFIG_FILE";
|
|
205717
|
-
var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] ||
|
|
204114
|
+
var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || join51(getHomeDir(), ".aws", "config");
|
|
205718
204115
|
|
|
205719
204116
|
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/getCredentialsFilepath.js
|
|
205720
|
-
import { join as
|
|
204117
|
+
import { join as join52 } from "path";
|
|
205721
204118
|
var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE";
|
|
205722
|
-
var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] ||
|
|
204119
|
+
var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || join52(getHomeDir(), ".aws", "credentials");
|
|
205723
204120
|
|
|
205724
204121
|
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/parseIni.js
|
|
205725
204122
|
var prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/;
|
|
@@ -205792,11 +204189,11 @@ var loadSharedConfigFiles = async (init = {}) => {
|
|
|
205792
204189
|
const relativeHomeDirPrefix = "~/";
|
|
205793
204190
|
let resolvedFilepath = filepath;
|
|
205794
204191
|
if (filepath.startsWith(relativeHomeDirPrefix)) {
|
|
205795
|
-
resolvedFilepath =
|
|
204192
|
+
resolvedFilepath = join53(homeDir, filepath.slice(2));
|
|
205796
204193
|
}
|
|
205797
204194
|
let resolvedConfigFilepath = configFilepath;
|
|
205798
204195
|
if (configFilepath.startsWith(relativeHomeDirPrefix)) {
|
|
205799
|
-
resolvedConfigFilepath =
|
|
204196
|
+
resolvedConfigFilepath = join53(homeDir, configFilepath.slice(2));
|
|
205800
204197
|
}
|
|
205801
204198
|
const parsedFiles = await Promise.all([
|
|
205802
204199
|
readFile21(resolvedConfigFilepath, {
|
|
@@ -206457,8 +204854,8 @@ class NoOpLogger3 {
|
|
|
206457
204854
|
}
|
|
206458
204855
|
|
|
206459
204856
|
// ../../node_modules/.pnpm/@smithy+middleware-retry@4.4.46/node_modules/@smithy/middleware-retry/dist-es/isStreamingPayload/isStreamingPayload.js
|
|
206460
|
-
import { Readable
|
|
206461
|
-
var isStreamingPayload = (request) => request?.body instanceof
|
|
204857
|
+
import { Readable } from "stream";
|
|
204858
|
+
var isStreamingPayload = (request) => request?.body instanceof Readable || typeof ReadableStream !== "undefined" && request?.body instanceof ReadableStream;
|
|
206462
204859
|
|
|
206463
204860
|
// ../../node_modules/.pnpm/@smithy+middleware-retry@4.4.46/node_modules/@smithy/middleware-retry/dist-es/retryMiddleware.js
|
|
206464
204861
|
var retryMiddleware = (options) => (next, context) => async (args) => {
|
|
@@ -206505,7 +204902,7 @@ var retryMiddleware = (options) => (next, context) => async (args) => {
|
|
|
206505
204902
|
attempts = retryToken.getRetryCount();
|
|
206506
204903
|
const delay = retryToken.getRetryDelay();
|
|
206507
204904
|
totalRetryDelay += delay;
|
|
206508
|
-
await new Promise((
|
|
204905
|
+
await new Promise((resolve5) => setTimeout(resolve5, delay));
|
|
206509
204906
|
}
|
|
206510
204907
|
}
|
|
206511
204908
|
} else {
|
|
@@ -207131,16 +205528,16 @@ var getRuntimeUserAgentPair = () => {
|
|
|
207131
205528
|
|
|
207132
205529
|
// ../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.973.14_aws-crt@1.33.1/node_modules/@aws-sdk/util-user-agent-node/dist-es/getTypeScriptUserAgentPair.js
|
|
207133
205530
|
import { readFile as readFile23 } from "fs/promises";
|
|
207134
|
-
import { join as
|
|
205531
|
+
import { join as join55 } from "path";
|
|
207135
205532
|
|
|
207136
205533
|
// ../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.973.14_aws-crt@1.33.1/node_modules/@aws-sdk/util-user-agent-node/dist-es/getNodeModulesParentDirs.js
|
|
207137
|
-
import { normalize as
|
|
207138
|
-
var getNodeModulesParentDirs = (
|
|
205534
|
+
import { normalize as normalize3, sep as sep7 } from "path";
|
|
205535
|
+
var getNodeModulesParentDirs = (dirname27) => {
|
|
207139
205536
|
const cwd2 = process.cwd();
|
|
207140
|
-
if (!
|
|
205537
|
+
if (!dirname27) {
|
|
207141
205538
|
return [cwd2];
|
|
207142
205539
|
}
|
|
207143
|
-
const normalizedPath =
|
|
205540
|
+
const normalizedPath = normalize3(dirname27);
|
|
207144
205541
|
const parts = normalizedPath.split(sep7);
|
|
207145
205542
|
const nodeModulesIndex = parts.indexOf("node_modules");
|
|
207146
205543
|
const parentDir = nodeModulesIndex !== -1 ? parts.slice(0, nodeModulesIndex).join(sep7) : normalizedPath;
|
|
@@ -207179,7 +205576,7 @@ var getSanitizedDevTypeScriptVersion = (version4 = "") => {
|
|
|
207179
205576
|
// ../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.973.14_aws-crt@1.33.1/node_modules/@aws-sdk/util-user-agent-node/dist-es/getTypeScriptUserAgentPair.js
|
|
207180
205577
|
var __dirname = "/Users/work/Code/awsless/node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.973.14_aws-crt@1.33.1/node_modules/@aws-sdk/util-user-agent-node/dist-es";
|
|
207181
205578
|
var tscVersion;
|
|
207182
|
-
var TS_PACKAGE_JSON =
|
|
205579
|
+
var TS_PACKAGE_JSON = join55("node_modules", "typescript", "package.json");
|
|
207183
205580
|
var getTypeScriptUserAgentPair = async () => {
|
|
207184
205581
|
if (tscVersion === null) {
|
|
207185
205582
|
return;
|
|
@@ -207194,12 +205591,12 @@ var getTypeScriptUserAgentPair = async () => {
|
|
|
207194
205591
|
tscVersion = null;
|
|
207195
205592
|
return;
|
|
207196
205593
|
}
|
|
207197
|
-
const
|
|
207198
|
-
const nodeModulesParentDirs = getNodeModulesParentDirs(
|
|
205594
|
+
const dirname27 = typeof __dirname !== "undefined" ? __dirname : undefined;
|
|
205595
|
+
const nodeModulesParentDirs = getNodeModulesParentDirs(dirname27);
|
|
207199
205596
|
let versionFromApp;
|
|
207200
205597
|
for (const nodeModulesParentDir of nodeModulesParentDirs) {
|
|
207201
205598
|
try {
|
|
207202
|
-
const appPackageJsonPath =
|
|
205599
|
+
const appPackageJsonPath = join55(nodeModulesParentDir, "package.json");
|
|
207203
205600
|
const packageJson = await readFile23(appPackageJsonPath, "utf-8");
|
|
207204
205601
|
const { dependencies, devDependencies } = JSON.parse(packageJson);
|
|
207205
205602
|
const version4 = devDependencies?.typescript ?? dependencies?.typescript;
|
|
@@ -207217,7 +205614,7 @@ var getTypeScriptUserAgentPair = async () => {
|
|
|
207217
205614
|
let versionFromNodeModules;
|
|
207218
205615
|
for (const nodeModulesParentDir of nodeModulesParentDirs) {
|
|
207219
205616
|
try {
|
|
207220
|
-
const tsPackageJsonPath =
|
|
205617
|
+
const tsPackageJsonPath = join55(nodeModulesParentDir, TS_PACKAGE_JSON);
|
|
207221
205618
|
const packageJson = await readFile23(tsPackageJsonPath, "utf-8");
|
|
207222
205619
|
const { version: version4 } = JSON.parse(packageJson);
|
|
207223
205620
|
const sanitizedVersion2 = getSanitizedTypeScriptVersion(version4);
|
|
@@ -207545,7 +205942,7 @@ var setSocketTimeout = (request, reject, timeoutInMs = 0) => {
|
|
|
207545
205942
|
};
|
|
207546
205943
|
|
|
207547
205944
|
// ../../node_modules/.pnpm/@smithy+node-http-handler@4.5.1/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js
|
|
207548
|
-
import { Readable as
|
|
205945
|
+
import { Readable as Readable2 } from "stream";
|
|
207549
205946
|
var MIN_WAIT_TIME = 6000;
|
|
207550
205947
|
async function writeRequestBody(httpRequest3, request, maxContinueTimeoutMs = MIN_WAIT_TIME, externalAgent = false) {
|
|
207551
205948
|
const headers = request.headers ?? {};
|
|
@@ -207554,21 +205951,21 @@ async function writeRequestBody(httpRequest3, request, maxContinueTimeoutMs = MI
|
|
|
207554
205951
|
let sendBody = true;
|
|
207555
205952
|
if (!externalAgent && expect === "100-continue") {
|
|
207556
205953
|
sendBody = await Promise.race([
|
|
207557
|
-
new Promise((
|
|
207558
|
-
timeoutId = Number(timing.setTimeout(() =>
|
|
205954
|
+
new Promise((resolve5) => {
|
|
205955
|
+
timeoutId = Number(timing.setTimeout(() => resolve5(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs)));
|
|
207559
205956
|
}),
|
|
207560
|
-
new Promise((
|
|
205957
|
+
new Promise((resolve5) => {
|
|
207561
205958
|
httpRequest3.on("continue", () => {
|
|
207562
205959
|
timing.clearTimeout(timeoutId);
|
|
207563
|
-
|
|
205960
|
+
resolve5(true);
|
|
207564
205961
|
});
|
|
207565
205962
|
httpRequest3.on("response", () => {
|
|
207566
205963
|
timing.clearTimeout(timeoutId);
|
|
207567
|
-
|
|
205964
|
+
resolve5(false);
|
|
207568
205965
|
});
|
|
207569
205966
|
httpRequest3.on("error", () => {
|
|
207570
205967
|
timing.clearTimeout(timeoutId);
|
|
207571
|
-
|
|
205968
|
+
resolve5(false);
|
|
207572
205969
|
});
|
|
207573
205970
|
})
|
|
207574
205971
|
]);
|
|
@@ -207578,7 +205975,7 @@ async function writeRequestBody(httpRequest3, request, maxContinueTimeoutMs = MI
|
|
|
207578
205975
|
}
|
|
207579
205976
|
}
|
|
207580
205977
|
function writeBody(httpRequest3, body) {
|
|
207581
|
-
if (body instanceof
|
|
205978
|
+
if (body instanceof Readable2) {
|
|
207582
205979
|
body.pipe(httpRequest3);
|
|
207583
205980
|
return;
|
|
207584
205981
|
}
|
|
@@ -207644,13 +206041,13 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
207644
206041
|
return socketWarningTimestamp;
|
|
207645
206042
|
}
|
|
207646
206043
|
constructor(options) {
|
|
207647
|
-
this.configProvider = new Promise((
|
|
206044
|
+
this.configProvider = new Promise((resolve5, reject) => {
|
|
207648
206045
|
if (typeof options === "function") {
|
|
207649
206046
|
options().then((_options) => {
|
|
207650
|
-
|
|
206047
|
+
resolve5(this.resolveDefaultConfig(_options));
|
|
207651
206048
|
}).catch(reject);
|
|
207652
206049
|
} else {
|
|
207653
|
-
|
|
206050
|
+
resolve5(this.resolveDefaultConfig(options));
|
|
207654
206051
|
}
|
|
207655
206052
|
});
|
|
207656
206053
|
}
|
|
@@ -207670,7 +206067,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
207670
206067
|
return new Promise((_resolve, _reject) => {
|
|
207671
206068
|
let writeRequestBodyPromise = undefined;
|
|
207672
206069
|
const timeouts = [];
|
|
207673
|
-
const
|
|
206070
|
+
const resolve5 = async (arg) => {
|
|
207674
206071
|
await writeRequestBodyPromise;
|
|
207675
206072
|
timeouts.forEach(timing.clearTimeout);
|
|
207676
206073
|
_resolve(arg);
|
|
@@ -207734,7 +206131,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
207734
206131
|
headers: getTransformedHeaders(res.headers),
|
|
207735
206132
|
body: res
|
|
207736
206133
|
});
|
|
207737
|
-
|
|
206134
|
+
resolve5({ response: httpResponse });
|
|
207738
206135
|
});
|
|
207739
206136
|
req.on("error", (err) => {
|
|
207740
206137
|
if (NODEJS_TIMEOUT_ERROR_CODES2.includes(err.code)) {
|
|
@@ -207834,7 +206231,7 @@ var streamCollector4 = (stream) => {
|
|
|
207834
206231
|
if (isReadableStreamInstance(stream)) {
|
|
207835
206232
|
return collectReadableStream(stream);
|
|
207836
206233
|
}
|
|
207837
|
-
return new Promise((
|
|
206234
|
+
return new Promise((resolve5, reject) => {
|
|
207838
206235
|
const collector = new Collector;
|
|
207839
206236
|
stream.pipe(collector);
|
|
207840
206237
|
stream.on("error", (err) => {
|
|
@@ -207844,7 +206241,7 @@ var streamCollector4 = (stream) => {
|
|
|
207844
206241
|
collector.on("error", reject);
|
|
207845
206242
|
collector.on("finish", function() {
|
|
207846
206243
|
const bytes2 = new Uint8Array(Buffer.concat(this.bufferedBytes));
|
|
207847
|
-
|
|
206244
|
+
resolve5(bytes2);
|
|
207848
206245
|
});
|
|
207849
206246
|
});
|
|
207850
206247
|
};
|
|
@@ -210376,7 +208773,7 @@ var sinon;
|
|
|
210376
208773
|
const arraySlice = arrayProto.slice;
|
|
210377
208774
|
const concat = arrayProto.concat;
|
|
210378
208775
|
const forEach = arrayProto.forEach;
|
|
210379
|
-
const
|
|
208776
|
+
const join56 = arrayProto.join;
|
|
210380
208777
|
const splice = arrayProto.splice;
|
|
210381
208778
|
function applyDefaults(obj, defaults2) {
|
|
210382
208779
|
for (const key of Object.keys(defaults2)) {
|
|
@@ -210412,7 +208809,7 @@ var sinon;
|
|
|
210412
208809
|
let actual = "";
|
|
210413
208810
|
if (!calledInOrder(arguments)) {
|
|
210414
208811
|
try {
|
|
210415
|
-
expected =
|
|
208812
|
+
expected = join56(arguments, ", ");
|
|
210416
208813
|
const calls = arraySlice(arguments);
|
|
210417
208814
|
let i6 = calls.length;
|
|
210418
208815
|
while (i6) {
|
|
@@ -210420,7 +208817,7 @@ var sinon;
|
|
|
210420
208817
|
splice(calls, i6, 1);
|
|
210421
208818
|
}
|
|
210422
208819
|
}
|
|
210423
|
-
actual =
|
|
208820
|
+
actual = join56(orderByFirstCall(calls), ", ");
|
|
210424
208821
|
} catch (e7) {}
|
|
210425
208822
|
failAssertion(this, `expected ${expected} to be called in order but were called as ${actual}`);
|
|
210426
208823
|
} else {
|
|
@@ -210465,7 +208862,7 @@ var sinon;
|
|
|
210465
208862
|
` expected = ${inspect(expectation)}`,
|
|
210466
208863
|
` actual = ${inspect(actual)}`
|
|
210467
208864
|
];
|
|
210468
|
-
failAssertion(this,
|
|
208865
|
+
failAssertion(this, join56(formatted, `
|
|
210469
208866
|
`));
|
|
210470
208867
|
}
|
|
210471
208868
|
}
|
|
@@ -210570,7 +208967,7 @@ var sinon;
|
|
|
210570
208967
|
const valueToString = require2("@sinonjs/commons").valueToString;
|
|
210571
208968
|
const exportAsyncBehaviors = require2("./util/core/export-async-behaviors");
|
|
210572
208969
|
const concat = arrayProto.concat;
|
|
210573
|
-
const
|
|
208970
|
+
const join56 = arrayProto.join;
|
|
210574
208971
|
const reverse = arrayProto.reverse;
|
|
210575
208972
|
const slice = arrayProto.slice;
|
|
210576
208973
|
const useLeftMostCallback = -1;
|
|
@@ -210607,7 +209004,7 @@ var sinon;
|
|
|
210607
209004
|
msg = `${functionName(behavior.stub)} expected to yield, but no callback was passed.`;
|
|
210608
209005
|
}
|
|
210609
209006
|
if (args.length > 0) {
|
|
210610
|
-
msg += ` Received [${
|
|
209007
|
+
msg += ` Received [${join56(args, ", ")}]`;
|
|
210611
209008
|
}
|
|
210612
209009
|
return msg;
|
|
210613
209010
|
}
|
|
@@ -211417,7 +209814,7 @@ var sinon;
|
|
|
211417
209814
|
const filter2 = arrayProto.filter;
|
|
211418
209815
|
const forEach = arrayProto.forEach;
|
|
211419
209816
|
const every = arrayProto.every;
|
|
211420
|
-
const
|
|
209817
|
+
const join56 = arrayProto.join;
|
|
211421
209818
|
const push = arrayProto.push;
|
|
211422
209819
|
const slice = arrayProto.slice;
|
|
211423
209820
|
const unshift = arrayProto.unshift;
|
|
@@ -211494,10 +209891,10 @@ var sinon;
|
|
|
211494
209891
|
});
|
|
211495
209892
|
this.restore();
|
|
211496
209893
|
if (messages.length > 0) {
|
|
211497
|
-
mockExpectation.fail(
|
|
209894
|
+
mockExpectation.fail(join56(concat(messages, met), `
|
|
211498
209895
|
`));
|
|
211499
209896
|
} else if (met.length > 0) {
|
|
211500
|
-
mockExpectation.pass(
|
|
209897
|
+
mockExpectation.pass(join56(concat(messages, met), `
|
|
211501
209898
|
`));
|
|
211502
209899
|
}
|
|
211503
209900
|
return true;
|
|
@@ -211550,7 +209947,7 @@ var sinon;
|
|
|
211550
209947
|
args,
|
|
211551
209948
|
stack: err.stack
|
|
211552
209949
|
})}`);
|
|
211553
|
-
mockExpectation.fail(
|
|
209950
|
+
mockExpectation.fail(join56(messages, `
|
|
211554
209951
|
`));
|
|
211555
209952
|
}
|
|
211556
209953
|
});
|
|
@@ -211594,8 +209991,8 @@ var sinon;
|
|
|
211594
209991
|
};
|
|
211595
209992
|
sinonPromise.reject = function(reason) {
|
|
211596
209993
|
finalize2(STATUS_REJECTED, reason, fakeExecutor.firstCall.args[1]);
|
|
211597
|
-
return new Promise(function(
|
|
211598
|
-
sinonPromise.catch(() =>
|
|
209994
|
+
return new Promise(function(resolve5) {
|
|
209995
|
+
sinonPromise.catch(() => resolve5());
|
|
211599
209996
|
});
|
|
211600
209997
|
};
|
|
211601
209998
|
return sinonPromise;
|
|
@@ -211657,14 +210054,14 @@ var sinon;
|
|
|
211657
210054
|
const valueToString = require2("@sinonjs/commons").valueToString;
|
|
211658
210055
|
const concat = arrayProto.concat;
|
|
211659
210056
|
const filter2 = arrayProto.filter;
|
|
211660
|
-
const
|
|
210057
|
+
const join56 = arrayProto.join;
|
|
211661
210058
|
const map2 = arrayProto.map;
|
|
211662
210059
|
const reduce = arrayProto.reduce;
|
|
211663
210060
|
const slice = arrayProto.slice;
|
|
211664
210061
|
function throwYieldError(proxy, text, args) {
|
|
211665
210062
|
let msg = functionName(proxy) + text;
|
|
211666
210063
|
if (args.length) {
|
|
211667
|
-
msg += ` Received [${
|
|
210064
|
+
msg += ` Received [${join56(slice(args), ", ")}]`;
|
|
211668
210065
|
}
|
|
211669
210066
|
throw new Error(msg);
|
|
211670
210067
|
}
|
|
@@ -211786,7 +210183,7 @@ var sinon;
|
|
|
211786
210183
|
const formattedArgs = map2(this.args, function(arg) {
|
|
211787
210184
|
return inspect(arg);
|
|
211788
210185
|
});
|
|
211789
|
-
callStr = `${callStr +
|
|
210186
|
+
callStr = `${callStr + join56(formattedArgs, ", ")})`;
|
|
211790
210187
|
if (typeof this.returnValue !== "undefined") {
|
|
211791
210188
|
callStr += ` => ${inspect(this.returnValue)}`;
|
|
211792
210189
|
}
|
|
@@ -212517,7 +210914,7 @@ var sinon;
|
|
|
212517
210914
|
const timesInWords = require2("./util/core/times-in-words");
|
|
212518
210915
|
const inspect = require2("util").inspect;
|
|
212519
210916
|
const jsDiff = require2("diff");
|
|
212520
|
-
const
|
|
210917
|
+
const join56 = arrayProto.join;
|
|
212521
210918
|
const map2 = arrayProto.map;
|
|
212522
210919
|
const push = arrayProto.push;
|
|
212523
210920
|
const slice = arrayProto.slice;
|
|
@@ -212545,7 +210942,7 @@ var sinon;
|
|
|
212545
210942
|
}
|
|
212546
210943
|
return text;
|
|
212547
210944
|
});
|
|
212548
|
-
return
|
|
210945
|
+
return join56(objects, "");
|
|
212549
210946
|
}
|
|
212550
210947
|
function quoteStringValue(value) {
|
|
212551
210948
|
if (typeof value === "string") {
|
|
@@ -212603,7 +211000,7 @@ ${stringifiedCall}`;
|
|
|
212603
211000
|
push(calls, stringifiedCall);
|
|
212604
211001
|
}
|
|
212605
211002
|
return calls.length > 0 ? `
|
|
212606
|
-
${
|
|
211003
|
+
${join56(calls, `
|
|
212607
211004
|
`)}` : "";
|
|
212608
211005
|
},
|
|
212609
211006
|
t: function(spyInstance) {
|
|
@@ -212611,10 +211008,10 @@ ${join58(calls, `
|
|
|
212611
211008
|
for (let i6 = 0, l5 = spyInstance.callCount;i6 < l5; ++i6) {
|
|
212612
211009
|
push(objects, inspect(spyInstance.thisValues[i6]));
|
|
212613
211010
|
}
|
|
212614
|
-
return
|
|
211011
|
+
return join56(objects, ", ");
|
|
212615
211012
|
},
|
|
212616
211013
|
"*": function(spyInstance, args) {
|
|
212617
|
-
return
|
|
211014
|
+
return join56(map2(args, function(arg) {
|
|
212618
211015
|
return inspect(arg);
|
|
212619
211016
|
}), ", ");
|
|
212620
211017
|
}
|
|
@@ -212946,7 +211343,7 @@ ${join58(calls, `
|
|
|
212946
211343
|
}, { "@sinonjs/commons": 48 }], 26: [function(require2, module, exports) {
|
|
212947
211344
|
const arrayProto = require2("@sinonjs/commons").prototypes.array;
|
|
212948
211345
|
const hasOwnProperty2 = require2("@sinonjs/commons").prototypes.object.hasOwnProperty;
|
|
212949
|
-
const
|
|
211346
|
+
const join56 = arrayProto.join;
|
|
212950
211347
|
const push = arrayProto.push;
|
|
212951
211348
|
const hasDontEnumBug = function() {
|
|
212952
211349
|
const obj = {
|
|
@@ -212987,7 +211384,7 @@ ${join58(calls, `
|
|
|
212987
211384
|
push(result, obj[prop]());
|
|
212988
211385
|
}
|
|
212989
211386
|
}
|
|
212990
|
-
return
|
|
211387
|
+
return join56(result, "") !== "0123456789";
|
|
212991
211388
|
}();
|
|
212992
211389
|
function extendCommon(target2, sources, doCopy) {
|
|
212993
211390
|
let source, i6, prop;
|
|
@@ -214221,9 +212618,9 @@ ${job.error.stack.split(`
|
|
|
214221
212618
|
};
|
|
214222
212619
|
if (typeof _global.Promise !== "undefined" && utilPromisify) {
|
|
214223
212620
|
clock.setTimeout[utilPromisify.custom] = function promisifiedSetTimeout(timeout, arg) {
|
|
214224
|
-
return new _global.Promise(function setTimeoutExecutor(
|
|
212621
|
+
return new _global.Promise(function setTimeoutExecutor(resolve5) {
|
|
214225
212622
|
addTimer(clock, {
|
|
214226
|
-
func:
|
|
212623
|
+
func: resolve5,
|
|
214227
212624
|
args: [arg],
|
|
214228
212625
|
delay: timeout
|
|
214229
212626
|
});
|
|
@@ -214265,9 +212662,9 @@ ${job.error.stack.split(`
|
|
|
214265
212662
|
};
|
|
214266
212663
|
if (typeof _global.Promise !== "undefined" && utilPromisify) {
|
|
214267
212664
|
clock.setImmediate[utilPromisify.custom] = function promisifiedSetImmediate(arg) {
|
|
214268
|
-
return new _global.Promise(function setImmediateExecutor(
|
|
212665
|
+
return new _global.Promise(function setImmediateExecutor(resolve5) {
|
|
214269
212666
|
addTimer(clock, {
|
|
214270
|
-
func:
|
|
212667
|
+
func: resolve5,
|
|
214271
212668
|
args: [arg],
|
|
214272
212669
|
immediate: true
|
|
214273
212670
|
});
|
|
@@ -214298,7 +212695,7 @@ ${job.error.stack.split(`
|
|
|
214298
212695
|
clock.runMicrotasks = function runMicrotasks() {
|
|
214299
212696
|
runJobs(clock);
|
|
214300
212697
|
};
|
|
214301
|
-
function doTick(tickValue, isAsync,
|
|
212698
|
+
function doTick(tickValue, isAsync, resolve5, reject) {
|
|
214302
212699
|
const msFloat = typeof tickValue === "number" ? tickValue : parseTime(tickValue);
|
|
214303
212700
|
const ms2 = Math.floor(msFloat);
|
|
214304
212701
|
const remainder = nanoRemainder(msFloat);
|
|
@@ -214365,7 +212762,7 @@ ${job.error.stack.split(`
|
|
|
214365
212762
|
throw firstException;
|
|
214366
212763
|
}
|
|
214367
212764
|
if (isAsync) {
|
|
214368
|
-
|
|
212765
|
+
resolve5(clock.now);
|
|
214369
212766
|
} else {
|
|
214370
212767
|
return clock.now;
|
|
214371
212768
|
}
|
|
@@ -214397,10 +212794,10 @@ ${job.error.stack.split(`
|
|
|
214397
212794
|
};
|
|
214398
212795
|
if (typeof _global.Promise !== "undefined") {
|
|
214399
212796
|
clock.tickAsync = function tickAsync(tickValue) {
|
|
214400
|
-
return new _global.Promise(function(
|
|
212797
|
+
return new _global.Promise(function(resolve5, reject) {
|
|
214401
212798
|
originalSetTimeout(function() {
|
|
214402
212799
|
try {
|
|
214403
|
-
doTick(tickValue, true,
|
|
212800
|
+
doTick(tickValue, true, resolve5, reject);
|
|
214404
212801
|
} catch (e7) {
|
|
214405
212802
|
reject(e7);
|
|
214406
212803
|
}
|
|
@@ -214426,12 +212823,12 @@ ${job.error.stack.split(`
|
|
|
214426
212823
|
};
|
|
214427
212824
|
if (typeof _global.Promise !== "undefined") {
|
|
214428
212825
|
clock.nextAsync = function nextAsync() {
|
|
214429
|
-
return new _global.Promise(function(
|
|
212826
|
+
return new _global.Promise(function(resolve5, reject) {
|
|
214430
212827
|
originalSetTimeout(function() {
|
|
214431
212828
|
try {
|
|
214432
212829
|
const timer = firstTimer(clock);
|
|
214433
212830
|
if (!timer) {
|
|
214434
|
-
|
|
212831
|
+
resolve5(clock.now);
|
|
214435
212832
|
return;
|
|
214436
212833
|
}
|
|
214437
212834
|
let err;
|
|
@@ -214447,7 +212844,7 @@ ${job.error.stack.split(`
|
|
|
214447
212844
|
if (err) {
|
|
214448
212845
|
reject(err);
|
|
214449
212846
|
} else {
|
|
214450
|
-
|
|
212847
|
+
resolve5(clock.now);
|
|
214451
212848
|
}
|
|
214452
212849
|
});
|
|
214453
212850
|
} catch (e7) {
|
|
@@ -214481,7 +212878,7 @@ ${job.error.stack.split(`
|
|
|
214481
212878
|
};
|
|
214482
212879
|
if (typeof _global.Promise !== "undefined") {
|
|
214483
212880
|
clock.runAllAsync = function runAllAsync() {
|
|
214484
|
-
return new _global.Promise(function(
|
|
212881
|
+
return new _global.Promise(function(resolve5, reject) {
|
|
214485
212882
|
let i6 = 0;
|
|
214486
212883
|
function doRun() {
|
|
214487
212884
|
originalSetTimeout(function() {
|
|
@@ -214491,13 +212888,13 @@ ${job.error.stack.split(`
|
|
|
214491
212888
|
if (i6 < clock.loopLimit) {
|
|
214492
212889
|
if (!clock.timers) {
|
|
214493
212890
|
resetIsNearInfiniteLimit();
|
|
214494
|
-
|
|
212891
|
+
resolve5(clock.now);
|
|
214495
212892
|
return;
|
|
214496
212893
|
}
|
|
214497
212894
|
numTimers = Object.keys(clock.timers).length;
|
|
214498
212895
|
if (numTimers === 0) {
|
|
214499
212896
|
resetIsNearInfiniteLimit();
|
|
214500
|
-
|
|
212897
|
+
resolve5(clock.now);
|
|
214501
212898
|
return;
|
|
214502
212899
|
}
|
|
214503
212900
|
clock.next();
|
|
@@ -214527,15 +212924,15 @@ ${job.error.stack.split(`
|
|
|
214527
212924
|
};
|
|
214528
212925
|
if (typeof _global.Promise !== "undefined") {
|
|
214529
212926
|
clock.runToLastAsync = function runToLastAsync() {
|
|
214530
|
-
return new _global.Promise(function(
|
|
212927
|
+
return new _global.Promise(function(resolve5, reject) {
|
|
214531
212928
|
originalSetTimeout(function() {
|
|
214532
212929
|
try {
|
|
214533
212930
|
const timer = lastTimer(clock);
|
|
214534
212931
|
if (!timer) {
|
|
214535
212932
|
runJobs(clock);
|
|
214536
|
-
|
|
212933
|
+
resolve5(clock.now);
|
|
214537
212934
|
}
|
|
214538
|
-
|
|
212935
|
+
resolve5(clock.tickAsync(timer.callAt - clock.now));
|
|
214539
212936
|
} catch (e7) {
|
|
214540
212937
|
reject(e7);
|
|
214541
212938
|
}
|
|
@@ -215052,7 +213449,7 @@ ${job.error.stack.split(`
|
|
|
215052
213449
|
module.exports = matcherPrototype;
|
|
215053
213450
|
}, { "../create-matcher": 63 }], 71: [function(require2, module, exports) {
|
|
215054
213451
|
var functionName = require2("@sinonjs/commons").functionName;
|
|
215055
|
-
var
|
|
213452
|
+
var join56 = require2("@sinonjs/commons").prototypes.array.join;
|
|
215056
213453
|
var map2 = require2("@sinonjs/commons").prototypes.array.map;
|
|
215057
213454
|
var stringIndexOf = require2("@sinonjs/commons").prototypes.string.indexOf;
|
|
215058
213455
|
var valueToString = require2("@sinonjs/commons").valueToString;
|
|
@@ -215083,7 +213480,7 @@ ${job.error.stack.split(`
|
|
|
215083
213480
|
m5.test = function(actual) {
|
|
215084
213481
|
return matchObject(actual, expectation, match3);
|
|
215085
213482
|
};
|
|
215086
|
-
m5.message = `match(${
|
|
213483
|
+
m5.message = `match(${join56(array3, ", ")})`;
|
|
215087
213484
|
return m5;
|
|
215088
213485
|
},
|
|
215089
213486
|
regexp: function(m5, expectation) {
|
|
@@ -218407,7 +216804,7 @@ ${job.error.stack.split(`
|
|
|
218407
216804
|
tokenize: function tokenize(value) {
|
|
218408
216805
|
return value.split("");
|
|
218409
216806
|
},
|
|
218410
|
-
join: function
|
|
216807
|
+
join: function join56(chars) {
|
|
218411
216808
|
return chars.join("");
|
|
218412
216809
|
}
|
|
218413
216810
|
};
|
|
@@ -221166,7 +219563,7 @@ ${inspect(response)}
|
|
|
221166
219563
|
};
|
|
221167
219564
|
extend2(FakeXMLHttpRequest.prototype, sinonEvent.EventTarget, {
|
|
221168
219565
|
async: true,
|
|
221169
|
-
open: function
|
|
219566
|
+
open: function open2(method, url2, async, username, password) {
|
|
221170
219567
|
this.method = method;
|
|
221171
219568
|
this.url = url2;
|
|
221172
219569
|
this.async = typeof async === "boolean" ? async : true;
|
|
@@ -221840,8 +220237,8 @@ ${inspect(response)}
|
|
|
221840
220237
|
});
|
|
221841
220238
|
continue;
|
|
221842
220239
|
}
|
|
221843
|
-
const
|
|
221844
|
-
if (
|
|
220240
|
+
const open2 = it2.tryConsume("{");
|
|
220241
|
+
if (open2) {
|
|
221845
220242
|
tokens2.push({
|
|
221846
220243
|
type: "group",
|
|
221847
220244
|
tokens: consume("}")
|