@awsless/cli 0.1.17 → 0.1.18
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 +237 -1858
- package/package.json +7 -8
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;
|
|
@@ -197428,1688 +197428,58 @@ var bind = (program3) => {
|
|
|
197428
197428
|
});
|
|
197429
197429
|
};
|
|
197430
197430
|
|
|
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
197431
|
// src/config/load/watch.ts
|
|
199062
|
-
import {
|
|
197432
|
+
import { watch } from "fs";
|
|
197433
|
+
import { basename as basename4, sep as sep2 } from "path";
|
|
197434
|
+
var ignoredDirectories = new Set(["node_modules", ".awsless", "dist", ".git"]);
|
|
199063
197435
|
var isConfigFile = (path7) => {
|
|
199064
|
-
const base =
|
|
197436
|
+
const base = basename4(path7);
|
|
199065
197437
|
return /^app\.(json|jsonc|json5)$/.test(base) || /(^|\.)stack\.(json|jsonc|json5)$/.test(base);
|
|
199066
197438
|
};
|
|
199067
|
-
var watchConfig = async (options,
|
|
197439
|
+
var watchConfig = async (options, resolve5, reject) => {
|
|
199068
197440
|
await loadAppConfig(options);
|
|
199069
197441
|
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)) {
|
|
197442
|
+
let reloadTimer;
|
|
197443
|
+
const watcher = watch(directories.root, { recursive: true }, (_event, filename) => {
|
|
197444
|
+
if (!filename) {
|
|
199085
197445
|
return;
|
|
199086
197446
|
}
|
|
199087
|
-
|
|
199088
|
-
|
|
199089
|
-
|
|
199090
|
-
|
|
199091
|
-
|
|
199092
|
-
} catch (error52) {
|
|
199093
|
-
reject(error52);
|
|
197447
|
+
if (filename.split(sep2).some((segment) => ignoredDirectories.has(segment))) {
|
|
197448
|
+
return;
|
|
197449
|
+
}
|
|
197450
|
+
if (!isConfigFile(filename)) {
|
|
197451
|
+
return;
|
|
199094
197452
|
}
|
|
197453
|
+
clearTimeout(reloadTimer);
|
|
197454
|
+
reloadTimer = setTimeout(async () => {
|
|
197455
|
+
try {
|
|
197456
|
+
const appConfig = await loadAppConfig(options);
|
|
197457
|
+
const stackConfigs = await loadStackConfigs(options);
|
|
197458
|
+
validateFeatures({ appConfig, stackConfigs });
|
|
197459
|
+
resolve5({ appConfig, stackConfigs });
|
|
197460
|
+
} catch (error52) {
|
|
197461
|
+
reject(error52);
|
|
197462
|
+
}
|
|
197463
|
+
}, 150);
|
|
199095
197464
|
});
|
|
199096
197465
|
return watcher;
|
|
199097
197466
|
};
|
|
199098
197467
|
|
|
199099
197468
|
// src/dev/index.ts
|
|
199100
197469
|
import { loadWorkspace as loadWorkspace3 } from "@awsless/ts-file-cache";
|
|
197470
|
+
import { watch as watch2 } from "fs";
|
|
199101
197471
|
import { mkdir as mkdir11, rm as rm12, writeFile as writeFile15 } from "fs/promises";
|
|
199102
|
-
import { basename as
|
|
197472
|
+
import { basename as basename5, dirname as dirname24, join as join49, sep as sep5 } from "path";
|
|
199103
197473
|
|
|
199104
197474
|
// src/dev/context.ts
|
|
199105
197475
|
import { DynamoDBServer } from "@awsless/dynamodb-server";
|
|
199106
|
-
import { join as
|
|
197476
|
+
import { join as join44 } from "path";
|
|
199107
197477
|
|
|
199108
197478
|
// src/dev/servers/s3.ts
|
|
199109
197479
|
import { createHash as createHash20 } from "crypto";
|
|
199110
|
-
import { mkdir as mkdir9, readdir as
|
|
197480
|
+
import { mkdir as mkdir9, readdir as readdir6, readFile as readFile18, rm as rm10, stat as stat6, writeFile as writeFile12 } from "fs/promises";
|
|
199111
197481
|
import { createServer as createServer7 } from "http";
|
|
199112
|
-
import { dirname as
|
|
197482
|
+
import { dirname as dirname22, isAbsolute as isAbsolute6, join as join43, relative as relative10, sep as sep3 } from "path";
|
|
199113
197483
|
var escapeXml = (value) => {
|
|
199114
197484
|
return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
199115
197485
|
};
|
|
@@ -199174,11 +197544,11 @@ var createS3Server = (props) => {
|
|
|
199174
197544
|
res.end(xmlError("InvalidRequest", "Missing bucket name"));
|
|
199175
197545
|
return;
|
|
199176
197546
|
}
|
|
199177
|
-
const bucketDir =
|
|
199178
|
-
const file3 =
|
|
197547
|
+
const bucketDir = join43(props.root, bucket);
|
|
197548
|
+
const file3 = join43(bucketDir, ...keyParts);
|
|
199179
197549
|
const escapes = (base, path7) => {
|
|
199180
|
-
const rel =
|
|
199181
|
-
return rel.startsWith("..") ||
|
|
197550
|
+
const rel = relative10(base, path7);
|
|
197551
|
+
return rel.startsWith("..") || isAbsolute6(rel);
|
|
199182
197552
|
};
|
|
199183
197553
|
if (escapes(props.root, bucketDir) || escapes(bucketDir, file3)) {
|
|
199184
197554
|
res.writeHead(400, { "content-type": "application/xml" });
|
|
@@ -199191,20 +197561,20 @@ var createS3Server = (props) => {
|
|
|
199191
197561
|
const walk2 = async (dir) => {
|
|
199192
197562
|
let entries2;
|
|
199193
197563
|
try {
|
|
199194
|
-
entries2 = await
|
|
197564
|
+
entries2 = await readdir6(dir, { withFileTypes: true });
|
|
199195
197565
|
} catch (_5) {
|
|
199196
197566
|
return;
|
|
199197
197567
|
}
|
|
199198
197568
|
for (const entry of entries2) {
|
|
199199
|
-
const path7 =
|
|
197569
|
+
const path7 = join43(dir, entry.name);
|
|
199200
197570
|
if (entry.isDirectory()) {
|
|
199201
197571
|
await walk2(path7);
|
|
199202
197572
|
} else {
|
|
199203
|
-
const objectKey =
|
|
197573
|
+
const objectKey = relative10(bucketDir, path7).split(sep3).join("/");
|
|
199204
197574
|
if (!objectKey.startsWith(prefix)) {
|
|
199205
197575
|
continue;
|
|
199206
197576
|
}
|
|
199207
|
-
const info2 = await
|
|
197577
|
+
const info2 = await stat6(path7);
|
|
199208
197578
|
contents.push(`<Contents><Key>${escapeXml(objectKey)}</Key><Size>${info2.size}</Size><LastModified>${info2.mtime.toISOString()}</LastModified><ETag>"local"</ETag></Contents>`);
|
|
199209
197579
|
}
|
|
199210
197580
|
}
|
|
@@ -199222,7 +197592,7 @@ var createS3Server = (props) => {
|
|
|
199222
197592
|
if (typeof encoding === "string" && encoding.includes("aws-chunked") || typeof sha === "string" && sha.startsWith("STREAMING")) {
|
|
199223
197593
|
body = decodeAwsChunked(body);
|
|
199224
197594
|
}
|
|
199225
|
-
await mkdir9(
|
|
197595
|
+
await mkdir9(dirname22(file3), { recursive: true });
|
|
199226
197596
|
await writeFile12(file3, body);
|
|
199227
197597
|
const eTag = createHash20("md5").update(body).digest("hex");
|
|
199228
197598
|
res.writeHead(200, { etag: `"${eTag}"` });
|
|
@@ -199268,10 +197638,10 @@ var createS3Server = (props) => {
|
|
|
199268
197638
|
res.end(xmlError("InternalError", error52 instanceof Error ? error52.message : String(error52)));
|
|
199269
197639
|
});
|
|
199270
197640
|
});
|
|
199271
|
-
await new Promise((
|
|
197641
|
+
await new Promise((resolve5, reject) => {
|
|
199272
197642
|
server.once("error", reject);
|
|
199273
197643
|
closeServer = trackConnections(server);
|
|
199274
|
-
server.listen(port, "127.0.0.1", () =>
|
|
197644
|
+
server.listen(port, "127.0.0.1", () => resolve5());
|
|
199275
197645
|
});
|
|
199276
197646
|
return server.address().port;
|
|
199277
197647
|
},
|
|
@@ -199486,7 +197856,7 @@ var createSqsServer = (props) => {
|
|
|
199486
197856
|
if (now >= deadline || signal.aborted) {
|
|
199487
197857
|
return {};
|
|
199488
197858
|
}
|
|
199489
|
-
await new Promise((
|
|
197859
|
+
await new Promise((resolve5) => setTimeout(resolve5, 100));
|
|
199490
197860
|
}
|
|
199491
197861
|
},
|
|
199492
197862
|
DeleteMessage(input) {
|
|
@@ -199592,10 +197962,10 @@ var createSqsServer = (props) => {
|
|
|
199592
197962
|
}
|
|
199593
197963
|
});
|
|
199594
197964
|
});
|
|
199595
|
-
await new Promise((
|
|
197965
|
+
await new Promise((resolve5, reject) => {
|
|
199596
197966
|
server.once("error", reject);
|
|
199597
197967
|
closeServer = trackConnections(server);
|
|
199598
|
-
server.listen(port, "127.0.0.1", () =>
|
|
197968
|
+
server.listen(port, "127.0.0.1", () => resolve5());
|
|
199599
197969
|
});
|
|
199600
197970
|
boundPort = server.address().port;
|
|
199601
197971
|
return boundPort;
|
|
@@ -199670,7 +198040,7 @@ var createDevContext = (props) => {
|
|
|
199670
198040
|
const value = await props.pool.keep("store", null, async () => {
|
|
199671
198041
|
const rules = [];
|
|
199672
198042
|
const server = createS3Server({
|
|
199673
|
-
root:
|
|
198043
|
+
root: join44(directories.output, "local", "store"),
|
|
199674
198044
|
region: props.appConfig.region,
|
|
199675
198045
|
rules
|
|
199676
198046
|
});
|
|
@@ -199797,9 +198167,9 @@ var createDevContext = (props) => {
|
|
|
199797
198167
|
|
|
199798
198168
|
// src/dev/seed.ts
|
|
199799
198169
|
import { spawn as spawn6 } from "child_process";
|
|
199800
|
-
import { isAbsolute as
|
|
198170
|
+
import { isAbsolute as isAbsolute7, join as join45 } from "path";
|
|
199801
198171
|
var createSeedRunner = (props) => {
|
|
199802
|
-
const file3 = props.seed && (
|
|
198172
|
+
const file3 = props.seed && (isAbsolute7(props.seed) ? props.seed : join45(directories.root, props.seed));
|
|
199803
198173
|
let running;
|
|
199804
198174
|
const run = () => {
|
|
199805
198175
|
running ??= (async () => {
|
|
@@ -199808,7 +198178,7 @@ var createSeedRunner = (props) => {
|
|
|
199808
198178
|
return;
|
|
199809
198179
|
}
|
|
199810
198180
|
debug(`Seeding from ${props.seed}`);
|
|
199811
|
-
await new Promise((
|
|
198181
|
+
await new Promise((resolve5, reject) => {
|
|
199812
198182
|
const child = spawn6("bun", [file3], {
|
|
199813
198183
|
cwd: directories.root,
|
|
199814
198184
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -199827,7 +198197,7 @@ var createSeedRunner = (props) => {
|
|
|
199827
198197
|
debug(logs);
|
|
199828
198198
|
}
|
|
199829
198199
|
if (code === 0) {
|
|
199830
|
-
|
|
198200
|
+
resolve5();
|
|
199831
198201
|
} else {
|
|
199832
198202
|
reject(new Error(`The seed exited with code ${code}:
|
|
199833
198203
|
${logs}`));
|
|
@@ -199848,15 +198218,15 @@ var import_ioredis4 = __toESM(require_built5(), 1);
|
|
|
199848
198218
|
import { DynamoDBClient as DynamoDBClient5 } from "@aws-sdk/client-dynamodb";
|
|
199849
198219
|
import { DynamoDBDocumentClient, ScanCommand as ScanCommand2 } from "@aws-sdk/lib-dynamodb";
|
|
199850
198220
|
import { randomUUID as randomUUID8 } from "crypto";
|
|
199851
|
-
import { readdir as
|
|
198221
|
+
import { readdir as readdir7, readFile as readFile19, stat as stat7, writeFile as writeFile14 } from "fs/promises";
|
|
199852
198222
|
import { createServer as createServer9 } from "http";
|
|
199853
|
-
import { join as
|
|
198223
|
+
import { join as join47, relative as relative11, sep as sep4 } from "path";
|
|
199854
198224
|
|
|
199855
198225
|
// src/dev/worker.ts
|
|
199856
198226
|
import { spawn as spawn7 } from "child_process";
|
|
199857
198227
|
import { writeFile as writeFile13 } from "fs/promises";
|
|
199858
198228
|
import { availableParallelism } from "os";
|
|
199859
|
-
import { join as
|
|
198229
|
+
import { join as join46 } from "path";
|
|
199860
198230
|
class WorkerError extends Error {
|
|
199861
198231
|
name;
|
|
199862
198232
|
constructor(name, message3, stack) {
|
|
@@ -200048,12 +198418,12 @@ var createBundleWorker = (props) => {
|
|
|
200048
198418
|
return;
|
|
200049
198419
|
}
|
|
200050
198420
|
} catch (_5) {}
|
|
200051
|
-
await new Promise((
|
|
198421
|
+
await new Promise((resolve5) => setTimeout(resolve5, 50));
|
|
200052
198422
|
}
|
|
200053
198423
|
throw new Error("The bundle worker never became ready.");
|
|
200054
198424
|
};
|
|
200055
198425
|
const startWorker = async () => {
|
|
200056
|
-
const entry =
|
|
198426
|
+
const entry = join46(props.buildDir, "worker.mjs");
|
|
200057
198427
|
const port = await findFreePort();
|
|
200058
198428
|
const child = spawn7("node", ["--enable-source-maps", entry], {
|
|
200059
198429
|
cwd: props.buildDir,
|
|
@@ -200114,7 +198484,7 @@ var createBundleWorker = (props) => {
|
|
|
200114
198484
|
return worker;
|
|
200115
198485
|
};
|
|
200116
198486
|
const doStart = async () => {
|
|
200117
|
-
await writeFile13(
|
|
198487
|
+
await writeFile13(join46(props.buildDir, "worker.mjs"), WORKER_ENTRY);
|
|
200118
198488
|
const results = await Promise.allSettled(Array.from({ length: concurrency }, () => startWorker()));
|
|
200119
198489
|
const started = results.filter((result) => result.status === "fulfilled").map((result) => result.value);
|
|
200120
198490
|
const failed = results.find((result) => result.status === "rejected");
|
|
@@ -202528,18 +200898,18 @@ var createDashboardServer = (props) => {
|
|
|
202528
200898
|
const walk2 = async (dir) => {
|
|
202529
200899
|
let entries2;
|
|
202530
200900
|
try {
|
|
202531
|
-
entries2 = await
|
|
200901
|
+
entries2 = await readdir7(dir, { withFileTypes: true });
|
|
202532
200902
|
} catch (_5) {
|
|
202533
200903
|
return;
|
|
202534
200904
|
}
|
|
202535
200905
|
for (const entry of entries2) {
|
|
202536
|
-
const path7 =
|
|
200906
|
+
const path7 = join47(dir, entry.name);
|
|
202537
200907
|
if (entry.isDirectory()) {
|
|
202538
200908
|
await walk2(path7);
|
|
202539
200909
|
} else {
|
|
202540
|
-
const key =
|
|
200910
|
+
const key = relative11(props.storeRoot, path7).split(sep4).slice(1).join("/");
|
|
202541
200911
|
if (key.startsWith(prefix)) {
|
|
202542
|
-
const info2 = await
|
|
200912
|
+
const info2 = await stat7(path7);
|
|
202543
200913
|
files.push({ key, size: info2.size, modified: info2.mtime.toISOString() });
|
|
202544
200914
|
}
|
|
202545
200915
|
}
|
|
@@ -202665,10 +201035,10 @@ var createDashboardServer = (props) => {
|
|
|
202665
201035
|
res.end(JSON.stringify({ error: message3 }));
|
|
202666
201036
|
});
|
|
202667
201037
|
});
|
|
202668
|
-
await new Promise((
|
|
201038
|
+
await new Promise((resolve5, reject) => {
|
|
202669
201039
|
server.once("error", reject);
|
|
202670
201040
|
closeServer = trackConnections(server);
|
|
202671
|
-
server.listen(port, "127.0.0.1", () =>
|
|
201041
|
+
server.listen(port, "127.0.0.1", () => resolve5());
|
|
202672
201042
|
});
|
|
202673
201043
|
},
|
|
202674
201044
|
stop() {
|
|
@@ -202755,10 +201125,10 @@ var createBlockedServer = (props) => {
|
|
|
202755
201125
|
res.writeHead(400, { "content-type": "application/x-amz-json-1.1" });
|
|
202756
201126
|
res.end(JSON.stringify({ __type: "NotEmulatedLocally", message: message3 }));
|
|
202757
201127
|
});
|
|
202758
|
-
await new Promise((
|
|
201128
|
+
await new Promise((resolve5, reject) => {
|
|
202759
201129
|
server.once("error", reject);
|
|
202760
201130
|
closeServer = trackConnections(server);
|
|
202761
|
-
server.listen(port, "127.0.0.1", () =>
|
|
201131
|
+
server.listen(port, "127.0.0.1", () => resolve5());
|
|
202762
201132
|
});
|
|
202763
201133
|
return server.address().port;
|
|
202764
201134
|
},
|
|
@@ -202836,10 +201206,10 @@ var createLambdaServer = (props) => {
|
|
|
202836
201206
|
}
|
|
202837
201207
|
}).catch(fail);
|
|
202838
201208
|
});
|
|
202839
|
-
await new Promise((
|
|
201209
|
+
await new Promise((resolve5, reject) => {
|
|
202840
201210
|
server.once("error", reject);
|
|
202841
201211
|
closeServer = trackConnections(server);
|
|
202842
|
-
server.listen(port, "127.0.0.1", () =>
|
|
201212
|
+
server.listen(port, "127.0.0.1", () => resolve5());
|
|
202843
201213
|
});
|
|
202844
201214
|
return server.address().port;
|
|
202845
201215
|
},
|
|
@@ -202850,17 +201220,17 @@ var createLambdaServer = (props) => {
|
|
|
202850
201220
|
};
|
|
202851
201221
|
|
|
202852
201222
|
// src/dev/sdk.ts
|
|
202853
|
-
import { readdir as
|
|
201223
|
+
import { readdir as readdir8, readFile as readFile20, mkdir as mkdir10, rm as rm11, stat as stat8, symlink } from "fs/promises";
|
|
202854
201224
|
import { createRequire } from "module";
|
|
202855
|
-
import { dirname as
|
|
201225
|
+
import { dirname as dirname23, join as join48 } from "path";
|
|
202856
201226
|
var linkSdkPackages = async (buildDir, onWarn) => {
|
|
202857
|
-
const filesDir =
|
|
201227
|
+
const filesDir = join48(buildDir, "files");
|
|
202858
201228
|
const packages = new Set;
|
|
202859
|
-
for (const file3 of await
|
|
201229
|
+
for (const file3 of await readdir8(filesDir)) {
|
|
202860
201230
|
if (!file3.endsWith(".mjs")) {
|
|
202861
201231
|
continue;
|
|
202862
201232
|
}
|
|
202863
|
-
const code = await readFile20(
|
|
201233
|
+
const code = await readFile20(join48(filesDir, file3), "utf8");
|
|
202864
201234
|
for (const match3 of code.matchAll(/(?:from\s*|import\()\s*["'](@aws-sdk\/[a-z0-9-]+|sharp)["']/g)) {
|
|
202865
201235
|
packages.add(match3[1]);
|
|
202866
201236
|
}
|
|
@@ -202868,25 +201238,25 @@ var linkSdkPackages = async (buildDir, onWarn) => {
|
|
|
202868
201238
|
const ownRequire = createRequire(import.meta.url);
|
|
202869
201239
|
const isProjectDep = async (name) => {
|
|
202870
201240
|
try {
|
|
202871
|
-
await
|
|
201241
|
+
await stat8(join48(directories.root, "node_modules", name, "package.json"));
|
|
202872
201242
|
return true;
|
|
202873
201243
|
} catch (_5) {
|
|
202874
201244
|
return false;
|
|
202875
201245
|
}
|
|
202876
201246
|
};
|
|
202877
201247
|
const resolveFromStore = async (name) => {
|
|
202878
|
-
const store =
|
|
201248
|
+
const store = join48(directories.root, "node_modules", ".pnpm");
|
|
202879
201249
|
const prefix = name.replaceAll("/", "+") + "@";
|
|
202880
201250
|
try {
|
|
202881
|
-
const entries2 = (await
|
|
201251
|
+
const entries2 = (await readdir8(store)).filter((entry) => entry.startsWith(prefix));
|
|
202882
201252
|
const best = entries2.sort((a4, b6) => a4.slice(prefix.length).localeCompare(b6.slice(prefix.length), undefined, { numeric: true })).at(-1);
|
|
202883
|
-
return best ?
|
|
201253
|
+
return best ? join48(store, best, "node_modules", name) : undefined;
|
|
202884
201254
|
} catch (_5) {
|
|
202885
201255
|
return;
|
|
202886
201256
|
}
|
|
202887
201257
|
};
|
|
202888
201258
|
for (const name of packages) {
|
|
202889
|
-
const target2 =
|
|
201259
|
+
const target2 = join48(buildDir, "node_modules", name);
|
|
202890
201260
|
try {
|
|
202891
201261
|
if (await isProjectDep(name)) {
|
|
202892
201262
|
await rm11(target2, { recursive: true, force: true });
|
|
@@ -202896,16 +201266,16 @@ var linkSdkPackages = async (buildDir, onWarn) => {
|
|
|
202896
201266
|
let source = await resolveFromStore(name);
|
|
202897
201267
|
if (!source) {
|
|
202898
201268
|
try {
|
|
202899
|
-
source =
|
|
201269
|
+
source = dirname23(ownRequire.resolve(`${name}/package.json`));
|
|
202900
201270
|
} catch (_5) {
|
|
202901
201271
|
onWarn?.(`The bundle imports "${name}", which is neither a project dependency nor shipped with the cli. Add it to your project dependencies.`);
|
|
202902
201272
|
continue;
|
|
202903
201273
|
}
|
|
202904
201274
|
}
|
|
202905
|
-
await mkdir10(
|
|
201275
|
+
await mkdir10(dirname23(target2), { recursive: true });
|
|
202906
201276
|
await rm11(target2, { recursive: true, force: true });
|
|
202907
201277
|
await symlink(source, target2, "dir");
|
|
202908
|
-
await
|
|
201278
|
+
await stat8(join48(target2, "package.json"));
|
|
202909
201279
|
debug(`Sdk link ${name}: ${source}`);
|
|
202910
201280
|
} catch (error52) {
|
|
202911
201281
|
onWarn?.(`Linking the "${name}" sdk package failed: ${error52 instanceof Error ? error52.message : String(error52)}`);
|
|
@@ -202931,7 +201301,7 @@ var startDev = async (props) => {
|
|
|
202931
201301
|
dev: true
|
|
202932
201302
|
});
|
|
202933
201303
|
ready2();
|
|
202934
|
-
await mkdir11(
|
|
201304
|
+
await mkdir11(join49(directories.output, "local"), { recursive: true });
|
|
202935
201305
|
const routerPorts = {};
|
|
202936
201306
|
Object.keys(appConfig.router ?? {}).forEach((id, index) => {
|
|
202937
201307
|
routerPorts[id] = props.port + 1 + index;
|
|
@@ -202989,7 +201359,7 @@ var startDev = async (props) => {
|
|
|
202989
201359
|
for (const [id, port] of Object.entries(routerPorts)) {
|
|
202990
201360
|
env4[`ROUTER_${constantCase(id)}_ENDPOINT`] = `localhost:${port}`;
|
|
202991
201361
|
}
|
|
202992
|
-
await writeFile15(
|
|
201362
|
+
await writeFile15(join49(directories.output, "local", "env.json"), JSON.stringify(env4, null, "\t") + `
|
|
202993
201363
|
`);
|
|
202994
201364
|
return { env: env4, lambda: lambda2 };
|
|
202995
201365
|
});
|
|
@@ -203226,8 +201596,8 @@ var startDev = async (props) => {
|
|
|
203226
201596
|
resources: dev.resources,
|
|
203227
201597
|
routes: dev.routes,
|
|
203228
201598
|
env: env3,
|
|
203229
|
-
storeRoot:
|
|
203230
|
-
configFile:
|
|
201599
|
+
storeRoot: join49(directories.output, "local", "store"),
|
|
201600
|
+
configFile: join49(directories.output, "local", "config.json"),
|
|
203231
201601
|
getEmails: () => props.pool.peek("shim:ses-email")?.server.list() ?? [],
|
|
203232
201602
|
getAlerts: () => props.pool.peek("shim:sns")?.alerts ?? [],
|
|
203233
201603
|
getSession: () => ({ startedAt, workers: worker.size() }),
|
|
@@ -203241,20 +201611,19 @@ var startDev = async (props) => {
|
|
|
203241
201611
|
});
|
|
203242
201612
|
dashboard.connect(dispatch);
|
|
203243
201613
|
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
|
-
});
|
|
201614
|
+
const ignoredDirectories2 = new Set(["node_modules", ".awsless", "dist", ".git"]);
|
|
203256
201615
|
let rebuildTimer;
|
|
203257
|
-
watcher.
|
|
201616
|
+
const watcher = watch2(directories.root, { recursive: true }, (_event, filename) => {
|
|
201617
|
+
if (!filename) {
|
|
201618
|
+
return;
|
|
201619
|
+
}
|
|
201620
|
+
if (filename.split(sep5).some((segment) => ignoredDirectories2.has(segment))) {
|
|
201621
|
+
return;
|
|
201622
|
+
}
|
|
201623
|
+
const base = basename5(filename);
|
|
201624
|
+
if (base.includes(".stack.") || base.startsWith("app.json")) {
|
|
201625
|
+
return;
|
|
201626
|
+
}
|
|
203258
201627
|
dirty = true;
|
|
203259
201628
|
clearTimeout(rebuildTimer);
|
|
203260
201629
|
rebuildTimer = setTimeout(() => {
|
|
@@ -203263,8 +201632,7 @@ var startDev = async (props) => {
|
|
|
203263
201632
|
});
|
|
203264
201633
|
}, 150);
|
|
203265
201634
|
});
|
|
203266
|
-
const
|
|
203267
|
-
restartWatcher?.on("all", () => {
|
|
201635
|
+
const restartWorker = () => {
|
|
203268
201636
|
if (stopping) {
|
|
203269
201637
|
return;
|
|
203270
201638
|
}
|
|
@@ -203277,16 +201645,27 @@ var startDev = async (props) => {
|
|
|
203277
201645
|
dev.context.reportHealth("workers", "down", error52 instanceof Error ? error52.message : String(error52));
|
|
203278
201646
|
log(`The bundle worker failed to restart: ${error52 instanceof Error ? error52.message : String(error52)}`);
|
|
203279
201647
|
});
|
|
203280
|
-
}
|
|
201648
|
+
};
|
|
201649
|
+
const restartWatchers = [];
|
|
201650
|
+
for (const path7 of dev.restartPaths) {
|
|
201651
|
+
await mkdir11(dirname24(path7), { recursive: true });
|
|
201652
|
+
restartWatchers.push(watch2(dirname24(path7), (_event, filename) => {
|
|
201653
|
+
if (filename === basename5(path7)) {
|
|
201654
|
+
restartWorker();
|
|
201655
|
+
}
|
|
201656
|
+
}));
|
|
201657
|
+
}
|
|
203281
201658
|
return {
|
|
203282
201659
|
dashboardPort,
|
|
203283
201660
|
routerPorts,
|
|
203284
201661
|
async stop() {
|
|
203285
201662
|
stopping = true;
|
|
203286
|
-
await rm12(
|
|
201663
|
+
await rm12(join49(directories.output, "local", "env.json"), { force: true });
|
|
203287
201664
|
clearTimeout(rebuildTimer);
|
|
203288
|
-
|
|
203289
|
-
|
|
201665
|
+
watcher.close();
|
|
201666
|
+
for (const restartWatcher of restartWatchers) {
|
|
201667
|
+
restartWatcher.close();
|
|
201668
|
+
}
|
|
203290
201669
|
await fresh?.catch(() => {});
|
|
203291
201670
|
for (const router of routers) {
|
|
203292
201671
|
await router.stop();
|
|
@@ -203349,7 +201728,7 @@ var createServerPool = () => {
|
|
|
203349
201728
|
|
|
203350
201729
|
// src/type-gen/generate.ts
|
|
203351
201730
|
import { mkdir as mkdir12, writeFile as writeFile16 } from "fs/promises";
|
|
203352
|
-
import { dirname as
|
|
201731
|
+
import { dirname as dirname25, join as join50, relative as relative12 } from "path";
|
|
203353
201732
|
var generateTypes = async (props) => {
|
|
203354
201733
|
const files = [];
|
|
203355
201734
|
await Promise.all(features.map((feature) => {
|
|
@@ -203357,12 +201736,12 @@ var generateTypes = async (props) => {
|
|
|
203357
201736
|
...props,
|
|
203358
201737
|
async write(file3, data, include = false) {
|
|
203359
201738
|
const code = data?.toString("utf8");
|
|
203360
|
-
const path7 =
|
|
201739
|
+
const path7 = join50(directories.types, file3);
|
|
203361
201740
|
if (code) {
|
|
203362
201741
|
if (include) {
|
|
203363
|
-
files.push(
|
|
201742
|
+
files.push(relative12(directories.root, path7));
|
|
203364
201743
|
}
|
|
203365
|
-
await mkdir12(
|
|
201744
|
+
await mkdir12(dirname25(path7), { recursive: true });
|
|
203366
201745
|
await writeFile16(path7, code);
|
|
203367
201746
|
}
|
|
203368
201747
|
}
|
|
@@ -203371,7 +201750,7 @@ var generateTypes = async (props) => {
|
|
|
203371
201750
|
if (files.length) {
|
|
203372
201751
|
const code = files.map((file3) => `/// <reference path='${file3}' />`).join(`
|
|
203373
201752
|
`);
|
|
203374
|
-
await writeFile16(
|
|
201753
|
+
await writeFile16(join50(directories.root, `awsless.d.ts`), code);
|
|
203375
201754
|
}
|
|
203376
201755
|
};
|
|
203377
201756
|
|
|
@@ -203390,8 +201769,8 @@ var dev = (program3) => {
|
|
|
203390
201769
|
const pool = createServerPool();
|
|
203391
201770
|
let instance;
|
|
203392
201771
|
let resolveShutdown;
|
|
203393
|
-
const shutdown = new Promise((
|
|
203394
|
-
resolveShutdown =
|
|
201772
|
+
const shutdown = new Promise((resolve5) => {
|
|
201773
|
+
resolveShutdown = resolve5;
|
|
203395
201774
|
});
|
|
203396
201775
|
const claimSignals = () => {
|
|
203397
201776
|
process.removeAllListeners("SIGINT");
|
|
@@ -204911,7 +203290,7 @@ class DefaultRateLimiter {
|
|
|
204911
203290
|
this.refillTokenBucket();
|
|
204912
203291
|
if (amount > this.availableTokens) {
|
|
204913
203292
|
const delay = (amount - this.availableTokens) / this.fillRate * 1000;
|
|
204914
|
-
await new Promise((
|
|
203293
|
+
await new Promise((resolve5) => DefaultRateLimiter.setTimeoutFn(resolve5, delay));
|
|
204915
203294
|
}
|
|
204916
203295
|
this.availableTokens = this.availableTokens - amount;
|
|
204917
203296
|
}
|
|
@@ -205690,7 +204069,7 @@ var DEFAULT_PROFILE = "default";
|
|
|
205690
204069
|
var getProfileName7 = (init) => init.profile || process.env[ENV_PROFILE2] || DEFAULT_PROFILE;
|
|
205691
204070
|
|
|
205692
204071
|
// ../../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
|
|
204072
|
+
import { join as join53 } from "path";
|
|
205694
204073
|
|
|
205695
204074
|
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/constants.js
|
|
205696
204075
|
var CONFIG_PREFIX_SEPARATOR = ".";
|
|
@@ -205712,14 +204091,14 @@ var getConfigData = (data) => Object.entries(data).filter(([key]) => {
|
|
|
205712
204091
|
});
|
|
205713
204092
|
|
|
205714
204093
|
// ../../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
|
|
204094
|
+
import { join as join51 } from "path";
|
|
205716
204095
|
var ENV_CONFIG_PATH = "AWS_CONFIG_FILE";
|
|
205717
|
-
var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] ||
|
|
204096
|
+
var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || join51(getHomeDir(), ".aws", "config");
|
|
205718
204097
|
|
|
205719
204098
|
// ../../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
|
|
204099
|
+
import { join as join52 } from "path";
|
|
205721
204100
|
var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE";
|
|
205722
|
-
var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] ||
|
|
204101
|
+
var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || join52(getHomeDir(), ".aws", "credentials");
|
|
205723
204102
|
|
|
205724
204103
|
// ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@4.4.7/node_modules/@smithy/shared-ini-file-loader/dist-es/parseIni.js
|
|
205725
204104
|
var prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/;
|
|
@@ -205792,11 +204171,11 @@ var loadSharedConfigFiles = async (init = {}) => {
|
|
|
205792
204171
|
const relativeHomeDirPrefix = "~/";
|
|
205793
204172
|
let resolvedFilepath = filepath;
|
|
205794
204173
|
if (filepath.startsWith(relativeHomeDirPrefix)) {
|
|
205795
|
-
resolvedFilepath =
|
|
204174
|
+
resolvedFilepath = join53(homeDir, filepath.slice(2));
|
|
205796
204175
|
}
|
|
205797
204176
|
let resolvedConfigFilepath = configFilepath;
|
|
205798
204177
|
if (configFilepath.startsWith(relativeHomeDirPrefix)) {
|
|
205799
|
-
resolvedConfigFilepath =
|
|
204178
|
+
resolvedConfigFilepath = join53(homeDir, configFilepath.slice(2));
|
|
205800
204179
|
}
|
|
205801
204180
|
const parsedFiles = await Promise.all([
|
|
205802
204181
|
readFile21(resolvedConfigFilepath, {
|
|
@@ -206457,8 +204836,8 @@ class NoOpLogger3 {
|
|
|
206457
204836
|
}
|
|
206458
204837
|
|
|
206459
204838
|
// ../../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
|
|
204839
|
+
import { Readable } from "stream";
|
|
204840
|
+
var isStreamingPayload = (request) => request?.body instanceof Readable || typeof ReadableStream !== "undefined" && request?.body instanceof ReadableStream;
|
|
206462
204841
|
|
|
206463
204842
|
// ../../node_modules/.pnpm/@smithy+middleware-retry@4.4.46/node_modules/@smithy/middleware-retry/dist-es/retryMiddleware.js
|
|
206464
204843
|
var retryMiddleware = (options) => (next, context) => async (args) => {
|
|
@@ -206505,7 +204884,7 @@ var retryMiddleware = (options) => (next, context) => async (args) => {
|
|
|
206505
204884
|
attempts = retryToken.getRetryCount();
|
|
206506
204885
|
const delay = retryToken.getRetryDelay();
|
|
206507
204886
|
totalRetryDelay += delay;
|
|
206508
|
-
await new Promise((
|
|
204887
|
+
await new Promise((resolve5) => setTimeout(resolve5, delay));
|
|
206509
204888
|
}
|
|
206510
204889
|
}
|
|
206511
204890
|
} else {
|
|
@@ -207131,16 +205510,16 @@ var getRuntimeUserAgentPair = () => {
|
|
|
207131
205510
|
|
|
207132
205511
|
// ../../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
205512
|
import { readFile as readFile23 } from "fs/promises";
|
|
207134
|
-
import { join as
|
|
205513
|
+
import { join as join55 } from "path";
|
|
207135
205514
|
|
|
207136
205515
|
// ../../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 = (
|
|
205516
|
+
import { normalize as normalize3, sep as sep7 } from "path";
|
|
205517
|
+
var getNodeModulesParentDirs = (dirname27) => {
|
|
207139
205518
|
const cwd2 = process.cwd();
|
|
207140
|
-
if (!
|
|
205519
|
+
if (!dirname27) {
|
|
207141
205520
|
return [cwd2];
|
|
207142
205521
|
}
|
|
207143
|
-
const normalizedPath =
|
|
205522
|
+
const normalizedPath = normalize3(dirname27);
|
|
207144
205523
|
const parts = normalizedPath.split(sep7);
|
|
207145
205524
|
const nodeModulesIndex = parts.indexOf("node_modules");
|
|
207146
205525
|
const parentDir = nodeModulesIndex !== -1 ? parts.slice(0, nodeModulesIndex).join(sep7) : normalizedPath;
|
|
@@ -207179,7 +205558,7 @@ var getSanitizedDevTypeScriptVersion = (version4 = "") => {
|
|
|
207179
205558
|
// ../../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
205559
|
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
205560
|
var tscVersion;
|
|
207182
|
-
var TS_PACKAGE_JSON =
|
|
205561
|
+
var TS_PACKAGE_JSON = join55("node_modules", "typescript", "package.json");
|
|
207183
205562
|
var getTypeScriptUserAgentPair = async () => {
|
|
207184
205563
|
if (tscVersion === null) {
|
|
207185
205564
|
return;
|
|
@@ -207194,12 +205573,12 @@ var getTypeScriptUserAgentPair = async () => {
|
|
|
207194
205573
|
tscVersion = null;
|
|
207195
205574
|
return;
|
|
207196
205575
|
}
|
|
207197
|
-
const
|
|
207198
|
-
const nodeModulesParentDirs = getNodeModulesParentDirs(
|
|
205576
|
+
const dirname27 = typeof __dirname !== "undefined" ? __dirname : undefined;
|
|
205577
|
+
const nodeModulesParentDirs = getNodeModulesParentDirs(dirname27);
|
|
207199
205578
|
let versionFromApp;
|
|
207200
205579
|
for (const nodeModulesParentDir of nodeModulesParentDirs) {
|
|
207201
205580
|
try {
|
|
207202
|
-
const appPackageJsonPath =
|
|
205581
|
+
const appPackageJsonPath = join55(nodeModulesParentDir, "package.json");
|
|
207203
205582
|
const packageJson = await readFile23(appPackageJsonPath, "utf-8");
|
|
207204
205583
|
const { dependencies, devDependencies } = JSON.parse(packageJson);
|
|
207205
205584
|
const version4 = devDependencies?.typescript ?? dependencies?.typescript;
|
|
@@ -207217,7 +205596,7 @@ var getTypeScriptUserAgentPair = async () => {
|
|
|
207217
205596
|
let versionFromNodeModules;
|
|
207218
205597
|
for (const nodeModulesParentDir of nodeModulesParentDirs) {
|
|
207219
205598
|
try {
|
|
207220
|
-
const tsPackageJsonPath =
|
|
205599
|
+
const tsPackageJsonPath = join55(nodeModulesParentDir, TS_PACKAGE_JSON);
|
|
207221
205600
|
const packageJson = await readFile23(tsPackageJsonPath, "utf-8");
|
|
207222
205601
|
const { version: version4 } = JSON.parse(packageJson);
|
|
207223
205602
|
const sanitizedVersion2 = getSanitizedTypeScriptVersion(version4);
|
|
@@ -207545,7 +205924,7 @@ var setSocketTimeout = (request, reject, timeoutInMs = 0) => {
|
|
|
207545
205924
|
};
|
|
207546
205925
|
|
|
207547
205926
|
// ../../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
|
|
205927
|
+
import { Readable as Readable2 } from "stream";
|
|
207549
205928
|
var MIN_WAIT_TIME = 6000;
|
|
207550
205929
|
async function writeRequestBody(httpRequest3, request, maxContinueTimeoutMs = MIN_WAIT_TIME, externalAgent = false) {
|
|
207551
205930
|
const headers = request.headers ?? {};
|
|
@@ -207554,21 +205933,21 @@ async function writeRequestBody(httpRequest3, request, maxContinueTimeoutMs = MI
|
|
|
207554
205933
|
let sendBody = true;
|
|
207555
205934
|
if (!externalAgent && expect === "100-continue") {
|
|
207556
205935
|
sendBody = await Promise.race([
|
|
207557
|
-
new Promise((
|
|
207558
|
-
timeoutId = Number(timing.setTimeout(() =>
|
|
205936
|
+
new Promise((resolve5) => {
|
|
205937
|
+
timeoutId = Number(timing.setTimeout(() => resolve5(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs)));
|
|
207559
205938
|
}),
|
|
207560
|
-
new Promise((
|
|
205939
|
+
new Promise((resolve5) => {
|
|
207561
205940
|
httpRequest3.on("continue", () => {
|
|
207562
205941
|
timing.clearTimeout(timeoutId);
|
|
207563
|
-
|
|
205942
|
+
resolve5(true);
|
|
207564
205943
|
});
|
|
207565
205944
|
httpRequest3.on("response", () => {
|
|
207566
205945
|
timing.clearTimeout(timeoutId);
|
|
207567
|
-
|
|
205946
|
+
resolve5(false);
|
|
207568
205947
|
});
|
|
207569
205948
|
httpRequest3.on("error", () => {
|
|
207570
205949
|
timing.clearTimeout(timeoutId);
|
|
207571
|
-
|
|
205950
|
+
resolve5(false);
|
|
207572
205951
|
});
|
|
207573
205952
|
})
|
|
207574
205953
|
]);
|
|
@@ -207578,7 +205957,7 @@ async function writeRequestBody(httpRequest3, request, maxContinueTimeoutMs = MI
|
|
|
207578
205957
|
}
|
|
207579
205958
|
}
|
|
207580
205959
|
function writeBody(httpRequest3, body) {
|
|
207581
|
-
if (body instanceof
|
|
205960
|
+
if (body instanceof Readable2) {
|
|
207582
205961
|
body.pipe(httpRequest3);
|
|
207583
205962
|
return;
|
|
207584
205963
|
}
|
|
@@ -207644,13 +206023,13 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
207644
206023
|
return socketWarningTimestamp;
|
|
207645
206024
|
}
|
|
207646
206025
|
constructor(options) {
|
|
207647
|
-
this.configProvider = new Promise((
|
|
206026
|
+
this.configProvider = new Promise((resolve5, reject) => {
|
|
207648
206027
|
if (typeof options === "function") {
|
|
207649
206028
|
options().then((_options) => {
|
|
207650
|
-
|
|
206029
|
+
resolve5(this.resolveDefaultConfig(_options));
|
|
207651
206030
|
}).catch(reject);
|
|
207652
206031
|
} else {
|
|
207653
|
-
|
|
206032
|
+
resolve5(this.resolveDefaultConfig(options));
|
|
207654
206033
|
}
|
|
207655
206034
|
});
|
|
207656
206035
|
}
|
|
@@ -207670,7 +206049,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
207670
206049
|
return new Promise((_resolve, _reject) => {
|
|
207671
206050
|
let writeRequestBodyPromise = undefined;
|
|
207672
206051
|
const timeouts = [];
|
|
207673
|
-
const
|
|
206052
|
+
const resolve5 = async (arg) => {
|
|
207674
206053
|
await writeRequestBodyPromise;
|
|
207675
206054
|
timeouts.forEach(timing.clearTimeout);
|
|
207676
206055
|
_resolve(arg);
|
|
@@ -207734,7 +206113,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
207734
206113
|
headers: getTransformedHeaders(res.headers),
|
|
207735
206114
|
body: res
|
|
207736
206115
|
});
|
|
207737
|
-
|
|
206116
|
+
resolve5({ response: httpResponse });
|
|
207738
206117
|
});
|
|
207739
206118
|
req.on("error", (err) => {
|
|
207740
206119
|
if (NODEJS_TIMEOUT_ERROR_CODES2.includes(err.code)) {
|
|
@@ -207834,7 +206213,7 @@ var streamCollector4 = (stream) => {
|
|
|
207834
206213
|
if (isReadableStreamInstance(stream)) {
|
|
207835
206214
|
return collectReadableStream(stream);
|
|
207836
206215
|
}
|
|
207837
|
-
return new Promise((
|
|
206216
|
+
return new Promise((resolve5, reject) => {
|
|
207838
206217
|
const collector = new Collector;
|
|
207839
206218
|
stream.pipe(collector);
|
|
207840
206219
|
stream.on("error", (err) => {
|
|
@@ -207844,7 +206223,7 @@ var streamCollector4 = (stream) => {
|
|
|
207844
206223
|
collector.on("error", reject);
|
|
207845
206224
|
collector.on("finish", function() {
|
|
207846
206225
|
const bytes2 = new Uint8Array(Buffer.concat(this.bufferedBytes));
|
|
207847
|
-
|
|
206226
|
+
resolve5(bytes2);
|
|
207848
206227
|
});
|
|
207849
206228
|
});
|
|
207850
206229
|
};
|
|
@@ -210376,7 +208755,7 @@ var sinon;
|
|
|
210376
208755
|
const arraySlice = arrayProto.slice;
|
|
210377
208756
|
const concat = arrayProto.concat;
|
|
210378
208757
|
const forEach = arrayProto.forEach;
|
|
210379
|
-
const
|
|
208758
|
+
const join56 = arrayProto.join;
|
|
210380
208759
|
const splice = arrayProto.splice;
|
|
210381
208760
|
function applyDefaults(obj, defaults2) {
|
|
210382
208761
|
for (const key of Object.keys(defaults2)) {
|
|
@@ -210412,7 +208791,7 @@ var sinon;
|
|
|
210412
208791
|
let actual = "";
|
|
210413
208792
|
if (!calledInOrder(arguments)) {
|
|
210414
208793
|
try {
|
|
210415
|
-
expected =
|
|
208794
|
+
expected = join56(arguments, ", ");
|
|
210416
208795
|
const calls = arraySlice(arguments);
|
|
210417
208796
|
let i6 = calls.length;
|
|
210418
208797
|
while (i6) {
|
|
@@ -210420,7 +208799,7 @@ var sinon;
|
|
|
210420
208799
|
splice(calls, i6, 1);
|
|
210421
208800
|
}
|
|
210422
208801
|
}
|
|
210423
|
-
actual =
|
|
208802
|
+
actual = join56(orderByFirstCall(calls), ", ");
|
|
210424
208803
|
} catch (e7) {}
|
|
210425
208804
|
failAssertion(this, `expected ${expected} to be called in order but were called as ${actual}`);
|
|
210426
208805
|
} else {
|
|
@@ -210465,7 +208844,7 @@ var sinon;
|
|
|
210465
208844
|
` expected = ${inspect(expectation)}`,
|
|
210466
208845
|
` actual = ${inspect(actual)}`
|
|
210467
208846
|
];
|
|
210468
|
-
failAssertion(this,
|
|
208847
|
+
failAssertion(this, join56(formatted, `
|
|
210469
208848
|
`));
|
|
210470
208849
|
}
|
|
210471
208850
|
}
|
|
@@ -210570,7 +208949,7 @@ var sinon;
|
|
|
210570
208949
|
const valueToString = require2("@sinonjs/commons").valueToString;
|
|
210571
208950
|
const exportAsyncBehaviors = require2("./util/core/export-async-behaviors");
|
|
210572
208951
|
const concat = arrayProto.concat;
|
|
210573
|
-
const
|
|
208952
|
+
const join56 = arrayProto.join;
|
|
210574
208953
|
const reverse = arrayProto.reverse;
|
|
210575
208954
|
const slice = arrayProto.slice;
|
|
210576
208955
|
const useLeftMostCallback = -1;
|
|
@@ -210607,7 +208986,7 @@ var sinon;
|
|
|
210607
208986
|
msg = `${functionName(behavior.stub)} expected to yield, but no callback was passed.`;
|
|
210608
208987
|
}
|
|
210609
208988
|
if (args.length > 0) {
|
|
210610
|
-
msg += ` Received [${
|
|
208989
|
+
msg += ` Received [${join56(args, ", ")}]`;
|
|
210611
208990
|
}
|
|
210612
208991
|
return msg;
|
|
210613
208992
|
}
|
|
@@ -211417,7 +209796,7 @@ var sinon;
|
|
|
211417
209796
|
const filter2 = arrayProto.filter;
|
|
211418
209797
|
const forEach = arrayProto.forEach;
|
|
211419
209798
|
const every = arrayProto.every;
|
|
211420
|
-
const
|
|
209799
|
+
const join56 = arrayProto.join;
|
|
211421
209800
|
const push = arrayProto.push;
|
|
211422
209801
|
const slice = arrayProto.slice;
|
|
211423
209802
|
const unshift = arrayProto.unshift;
|
|
@@ -211494,10 +209873,10 @@ var sinon;
|
|
|
211494
209873
|
});
|
|
211495
209874
|
this.restore();
|
|
211496
209875
|
if (messages.length > 0) {
|
|
211497
|
-
mockExpectation.fail(
|
|
209876
|
+
mockExpectation.fail(join56(concat(messages, met), `
|
|
211498
209877
|
`));
|
|
211499
209878
|
} else if (met.length > 0) {
|
|
211500
|
-
mockExpectation.pass(
|
|
209879
|
+
mockExpectation.pass(join56(concat(messages, met), `
|
|
211501
209880
|
`));
|
|
211502
209881
|
}
|
|
211503
209882
|
return true;
|
|
@@ -211550,7 +209929,7 @@ var sinon;
|
|
|
211550
209929
|
args,
|
|
211551
209930
|
stack: err.stack
|
|
211552
209931
|
})}`);
|
|
211553
|
-
mockExpectation.fail(
|
|
209932
|
+
mockExpectation.fail(join56(messages, `
|
|
211554
209933
|
`));
|
|
211555
209934
|
}
|
|
211556
209935
|
});
|
|
@@ -211594,8 +209973,8 @@ var sinon;
|
|
|
211594
209973
|
};
|
|
211595
209974
|
sinonPromise.reject = function(reason) {
|
|
211596
209975
|
finalize2(STATUS_REJECTED, reason, fakeExecutor.firstCall.args[1]);
|
|
211597
|
-
return new Promise(function(
|
|
211598
|
-
sinonPromise.catch(() =>
|
|
209976
|
+
return new Promise(function(resolve5) {
|
|
209977
|
+
sinonPromise.catch(() => resolve5());
|
|
211599
209978
|
});
|
|
211600
209979
|
};
|
|
211601
209980
|
return sinonPromise;
|
|
@@ -211657,14 +210036,14 @@ var sinon;
|
|
|
211657
210036
|
const valueToString = require2("@sinonjs/commons").valueToString;
|
|
211658
210037
|
const concat = arrayProto.concat;
|
|
211659
210038
|
const filter2 = arrayProto.filter;
|
|
211660
|
-
const
|
|
210039
|
+
const join56 = arrayProto.join;
|
|
211661
210040
|
const map2 = arrayProto.map;
|
|
211662
210041
|
const reduce = arrayProto.reduce;
|
|
211663
210042
|
const slice = arrayProto.slice;
|
|
211664
210043
|
function throwYieldError(proxy, text, args) {
|
|
211665
210044
|
let msg = functionName(proxy) + text;
|
|
211666
210045
|
if (args.length) {
|
|
211667
|
-
msg += ` Received [${
|
|
210046
|
+
msg += ` Received [${join56(slice(args), ", ")}]`;
|
|
211668
210047
|
}
|
|
211669
210048
|
throw new Error(msg);
|
|
211670
210049
|
}
|
|
@@ -211786,7 +210165,7 @@ var sinon;
|
|
|
211786
210165
|
const formattedArgs = map2(this.args, function(arg) {
|
|
211787
210166
|
return inspect(arg);
|
|
211788
210167
|
});
|
|
211789
|
-
callStr = `${callStr +
|
|
210168
|
+
callStr = `${callStr + join56(formattedArgs, ", ")})`;
|
|
211790
210169
|
if (typeof this.returnValue !== "undefined") {
|
|
211791
210170
|
callStr += ` => ${inspect(this.returnValue)}`;
|
|
211792
210171
|
}
|
|
@@ -212517,7 +210896,7 @@ var sinon;
|
|
|
212517
210896
|
const timesInWords = require2("./util/core/times-in-words");
|
|
212518
210897
|
const inspect = require2("util").inspect;
|
|
212519
210898
|
const jsDiff = require2("diff");
|
|
212520
|
-
const
|
|
210899
|
+
const join56 = arrayProto.join;
|
|
212521
210900
|
const map2 = arrayProto.map;
|
|
212522
210901
|
const push = arrayProto.push;
|
|
212523
210902
|
const slice = arrayProto.slice;
|
|
@@ -212545,7 +210924,7 @@ var sinon;
|
|
|
212545
210924
|
}
|
|
212546
210925
|
return text;
|
|
212547
210926
|
});
|
|
212548
|
-
return
|
|
210927
|
+
return join56(objects, "");
|
|
212549
210928
|
}
|
|
212550
210929
|
function quoteStringValue(value) {
|
|
212551
210930
|
if (typeof value === "string") {
|
|
@@ -212603,7 +210982,7 @@ ${stringifiedCall}`;
|
|
|
212603
210982
|
push(calls, stringifiedCall);
|
|
212604
210983
|
}
|
|
212605
210984
|
return calls.length > 0 ? `
|
|
212606
|
-
${
|
|
210985
|
+
${join56(calls, `
|
|
212607
210986
|
`)}` : "";
|
|
212608
210987
|
},
|
|
212609
210988
|
t: function(spyInstance) {
|
|
@@ -212611,10 +210990,10 @@ ${join58(calls, `
|
|
|
212611
210990
|
for (let i6 = 0, l5 = spyInstance.callCount;i6 < l5; ++i6) {
|
|
212612
210991
|
push(objects, inspect(spyInstance.thisValues[i6]));
|
|
212613
210992
|
}
|
|
212614
|
-
return
|
|
210993
|
+
return join56(objects, ", ");
|
|
212615
210994
|
},
|
|
212616
210995
|
"*": function(spyInstance, args) {
|
|
212617
|
-
return
|
|
210996
|
+
return join56(map2(args, function(arg) {
|
|
212618
210997
|
return inspect(arg);
|
|
212619
210998
|
}), ", ");
|
|
212620
210999
|
}
|
|
@@ -212946,7 +211325,7 @@ ${join58(calls, `
|
|
|
212946
211325
|
}, { "@sinonjs/commons": 48 }], 26: [function(require2, module, exports) {
|
|
212947
211326
|
const arrayProto = require2("@sinonjs/commons").prototypes.array;
|
|
212948
211327
|
const hasOwnProperty2 = require2("@sinonjs/commons").prototypes.object.hasOwnProperty;
|
|
212949
|
-
const
|
|
211328
|
+
const join56 = arrayProto.join;
|
|
212950
211329
|
const push = arrayProto.push;
|
|
212951
211330
|
const hasDontEnumBug = function() {
|
|
212952
211331
|
const obj = {
|
|
@@ -212987,7 +211366,7 @@ ${join58(calls, `
|
|
|
212987
211366
|
push(result, obj[prop]());
|
|
212988
211367
|
}
|
|
212989
211368
|
}
|
|
212990
|
-
return
|
|
211369
|
+
return join56(result, "") !== "0123456789";
|
|
212991
211370
|
}();
|
|
212992
211371
|
function extendCommon(target2, sources, doCopy) {
|
|
212993
211372
|
let source, i6, prop;
|
|
@@ -214221,9 +212600,9 @@ ${job.error.stack.split(`
|
|
|
214221
212600
|
};
|
|
214222
212601
|
if (typeof _global.Promise !== "undefined" && utilPromisify) {
|
|
214223
212602
|
clock.setTimeout[utilPromisify.custom] = function promisifiedSetTimeout(timeout, arg) {
|
|
214224
|
-
return new _global.Promise(function setTimeoutExecutor(
|
|
212603
|
+
return new _global.Promise(function setTimeoutExecutor(resolve5) {
|
|
214225
212604
|
addTimer(clock, {
|
|
214226
|
-
func:
|
|
212605
|
+
func: resolve5,
|
|
214227
212606
|
args: [arg],
|
|
214228
212607
|
delay: timeout
|
|
214229
212608
|
});
|
|
@@ -214265,9 +212644,9 @@ ${job.error.stack.split(`
|
|
|
214265
212644
|
};
|
|
214266
212645
|
if (typeof _global.Promise !== "undefined" && utilPromisify) {
|
|
214267
212646
|
clock.setImmediate[utilPromisify.custom] = function promisifiedSetImmediate(arg) {
|
|
214268
|
-
return new _global.Promise(function setImmediateExecutor(
|
|
212647
|
+
return new _global.Promise(function setImmediateExecutor(resolve5) {
|
|
214269
212648
|
addTimer(clock, {
|
|
214270
|
-
func:
|
|
212649
|
+
func: resolve5,
|
|
214271
212650
|
args: [arg],
|
|
214272
212651
|
immediate: true
|
|
214273
212652
|
});
|
|
@@ -214298,7 +212677,7 @@ ${job.error.stack.split(`
|
|
|
214298
212677
|
clock.runMicrotasks = function runMicrotasks() {
|
|
214299
212678
|
runJobs(clock);
|
|
214300
212679
|
};
|
|
214301
|
-
function doTick(tickValue, isAsync,
|
|
212680
|
+
function doTick(tickValue, isAsync, resolve5, reject) {
|
|
214302
212681
|
const msFloat = typeof tickValue === "number" ? tickValue : parseTime(tickValue);
|
|
214303
212682
|
const ms2 = Math.floor(msFloat);
|
|
214304
212683
|
const remainder = nanoRemainder(msFloat);
|
|
@@ -214365,7 +212744,7 @@ ${job.error.stack.split(`
|
|
|
214365
212744
|
throw firstException;
|
|
214366
212745
|
}
|
|
214367
212746
|
if (isAsync) {
|
|
214368
|
-
|
|
212747
|
+
resolve5(clock.now);
|
|
214369
212748
|
} else {
|
|
214370
212749
|
return clock.now;
|
|
214371
212750
|
}
|
|
@@ -214397,10 +212776,10 @@ ${job.error.stack.split(`
|
|
|
214397
212776
|
};
|
|
214398
212777
|
if (typeof _global.Promise !== "undefined") {
|
|
214399
212778
|
clock.tickAsync = function tickAsync(tickValue) {
|
|
214400
|
-
return new _global.Promise(function(
|
|
212779
|
+
return new _global.Promise(function(resolve5, reject) {
|
|
214401
212780
|
originalSetTimeout(function() {
|
|
214402
212781
|
try {
|
|
214403
|
-
doTick(tickValue, true,
|
|
212782
|
+
doTick(tickValue, true, resolve5, reject);
|
|
214404
212783
|
} catch (e7) {
|
|
214405
212784
|
reject(e7);
|
|
214406
212785
|
}
|
|
@@ -214426,12 +212805,12 @@ ${job.error.stack.split(`
|
|
|
214426
212805
|
};
|
|
214427
212806
|
if (typeof _global.Promise !== "undefined") {
|
|
214428
212807
|
clock.nextAsync = function nextAsync() {
|
|
214429
|
-
return new _global.Promise(function(
|
|
212808
|
+
return new _global.Promise(function(resolve5, reject) {
|
|
214430
212809
|
originalSetTimeout(function() {
|
|
214431
212810
|
try {
|
|
214432
212811
|
const timer = firstTimer(clock);
|
|
214433
212812
|
if (!timer) {
|
|
214434
|
-
|
|
212813
|
+
resolve5(clock.now);
|
|
214435
212814
|
return;
|
|
214436
212815
|
}
|
|
214437
212816
|
let err;
|
|
@@ -214447,7 +212826,7 @@ ${job.error.stack.split(`
|
|
|
214447
212826
|
if (err) {
|
|
214448
212827
|
reject(err);
|
|
214449
212828
|
} else {
|
|
214450
|
-
|
|
212829
|
+
resolve5(clock.now);
|
|
214451
212830
|
}
|
|
214452
212831
|
});
|
|
214453
212832
|
} catch (e7) {
|
|
@@ -214481,7 +212860,7 @@ ${job.error.stack.split(`
|
|
|
214481
212860
|
};
|
|
214482
212861
|
if (typeof _global.Promise !== "undefined") {
|
|
214483
212862
|
clock.runAllAsync = function runAllAsync() {
|
|
214484
|
-
return new _global.Promise(function(
|
|
212863
|
+
return new _global.Promise(function(resolve5, reject) {
|
|
214485
212864
|
let i6 = 0;
|
|
214486
212865
|
function doRun() {
|
|
214487
212866
|
originalSetTimeout(function() {
|
|
@@ -214491,13 +212870,13 @@ ${job.error.stack.split(`
|
|
|
214491
212870
|
if (i6 < clock.loopLimit) {
|
|
214492
212871
|
if (!clock.timers) {
|
|
214493
212872
|
resetIsNearInfiniteLimit();
|
|
214494
|
-
|
|
212873
|
+
resolve5(clock.now);
|
|
214495
212874
|
return;
|
|
214496
212875
|
}
|
|
214497
212876
|
numTimers = Object.keys(clock.timers).length;
|
|
214498
212877
|
if (numTimers === 0) {
|
|
214499
212878
|
resetIsNearInfiniteLimit();
|
|
214500
|
-
|
|
212879
|
+
resolve5(clock.now);
|
|
214501
212880
|
return;
|
|
214502
212881
|
}
|
|
214503
212882
|
clock.next();
|
|
@@ -214527,15 +212906,15 @@ ${job.error.stack.split(`
|
|
|
214527
212906
|
};
|
|
214528
212907
|
if (typeof _global.Promise !== "undefined") {
|
|
214529
212908
|
clock.runToLastAsync = function runToLastAsync() {
|
|
214530
|
-
return new _global.Promise(function(
|
|
212909
|
+
return new _global.Promise(function(resolve5, reject) {
|
|
214531
212910
|
originalSetTimeout(function() {
|
|
214532
212911
|
try {
|
|
214533
212912
|
const timer = lastTimer(clock);
|
|
214534
212913
|
if (!timer) {
|
|
214535
212914
|
runJobs(clock);
|
|
214536
|
-
|
|
212915
|
+
resolve5(clock.now);
|
|
214537
212916
|
}
|
|
214538
|
-
|
|
212917
|
+
resolve5(clock.tickAsync(timer.callAt - clock.now));
|
|
214539
212918
|
} catch (e7) {
|
|
214540
212919
|
reject(e7);
|
|
214541
212920
|
}
|
|
@@ -215052,7 +213431,7 @@ ${job.error.stack.split(`
|
|
|
215052
213431
|
module.exports = matcherPrototype;
|
|
215053
213432
|
}, { "../create-matcher": 63 }], 71: [function(require2, module, exports) {
|
|
215054
213433
|
var functionName = require2("@sinonjs/commons").functionName;
|
|
215055
|
-
var
|
|
213434
|
+
var join56 = require2("@sinonjs/commons").prototypes.array.join;
|
|
215056
213435
|
var map2 = require2("@sinonjs/commons").prototypes.array.map;
|
|
215057
213436
|
var stringIndexOf = require2("@sinonjs/commons").prototypes.string.indexOf;
|
|
215058
213437
|
var valueToString = require2("@sinonjs/commons").valueToString;
|
|
@@ -215083,7 +213462,7 @@ ${job.error.stack.split(`
|
|
|
215083
213462
|
m5.test = function(actual) {
|
|
215084
213463
|
return matchObject(actual, expectation, match3);
|
|
215085
213464
|
};
|
|
215086
|
-
m5.message = `match(${
|
|
213465
|
+
m5.message = `match(${join56(array3, ", ")})`;
|
|
215087
213466
|
return m5;
|
|
215088
213467
|
},
|
|
215089
213468
|
regexp: function(m5, expectation) {
|
|
@@ -218407,7 +216786,7 @@ ${job.error.stack.split(`
|
|
|
218407
216786
|
tokenize: function tokenize(value) {
|
|
218408
216787
|
return value.split("");
|
|
218409
216788
|
},
|
|
218410
|
-
join: function
|
|
216789
|
+
join: function join56(chars) {
|
|
218411
216790
|
return chars.join("");
|
|
218412
216791
|
}
|
|
218413
216792
|
};
|
|
@@ -221166,7 +219545,7 @@ ${inspect(response)}
|
|
|
221166
219545
|
};
|
|
221167
219546
|
extend2(FakeXMLHttpRequest.prototype, sinonEvent.EventTarget, {
|
|
221168
219547
|
async: true,
|
|
221169
|
-
open: function
|
|
219548
|
+
open: function open2(method, url2, async, username, password) {
|
|
221170
219549
|
this.method = method;
|
|
221171
219550
|
this.url = url2;
|
|
221172
219551
|
this.async = typeof async === "boolean" ? async : true;
|
|
@@ -221840,8 +220219,8 @@ ${inspect(response)}
|
|
|
221840
220219
|
});
|
|
221841
220220
|
continue;
|
|
221842
220221
|
}
|
|
221843
|
-
const
|
|
221844
|
-
if (
|
|
220222
|
+
const open2 = it2.tryConsume("{");
|
|
220223
|
+
if (open2) {
|
|
221845
220224
|
tokens2.push({
|
|
221846
220225
|
type: "group",
|
|
221847
220226
|
tokens: consume("}")
|