norn-cli 1.10.0 → 1.10.2
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/CHANGELOG.md +17 -0
- package/dist/cli.js +626 -554
- package/package.json +1 -1
- package/vendor/microsoft.data.sqlclient/README.md +25 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/Azure.Core.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/Azure.Identity.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/LICENSE.txt +46 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/Microsoft.Data.SqlClient.SNI.arm64.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/Microsoft.Data.SqlClient.SNI.x64.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/Microsoft.Data.SqlClient.SNI.x86.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/Microsoft.Data.SqlClient.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/Microsoft.Identity.Client.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/Microsoft.IdentityModel.Abstractions.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/Microsoft.IdentityModel.JsonWebTokens.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/Microsoft.IdentityModel.Logging.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/Microsoft.IdentityModel.Protocols.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/Microsoft.IdentityModel.Tokens.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.Buffers.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.ClientModel.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.Configuration.ConfigurationManager.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.Diagnostics.DiagnosticSource.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.IO.FileSystem.AccessControl.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.IdentityModel.Tokens.Jwt.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.Memory.Data.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.Memory.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.Net.Http.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.Numerics.Vectors.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.Runtime.CompilerServices.Unsafe.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.Runtime.InteropServices.RuntimeInformation.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.Security.AccessControl.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.Security.Cryptography.Algorithms.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.Security.Cryptography.Encoding.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.Security.Cryptography.Primitives.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.Security.Cryptography.ProtectedData.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.Security.Cryptography.X509Certificates.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.Security.Permissions.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.Security.Principal.Windows.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.Text.Encodings.Web.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.Text.Json.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.Threading.Tasks.Extensions.dll +0 -0
- package/vendor/microsoft.data.sqlclient/windows-netfx/System.ValueTuple.dll +0 -0
package/dist/cli.js
CHANGED
|
@@ -8881,11 +8881,11 @@ var require_mime_types = __commonJS({
|
|
|
8881
8881
|
}
|
|
8882
8882
|
return exts[0];
|
|
8883
8883
|
}
|
|
8884
|
-
function lookup(
|
|
8885
|
-
if (!
|
|
8884
|
+
function lookup(path14) {
|
|
8885
|
+
if (!path14 || typeof path14 !== "string") {
|
|
8886
8886
|
return false;
|
|
8887
8887
|
}
|
|
8888
|
-
var extension2 = extname3("x." +
|
|
8888
|
+
var extension2 = extname3("x." + path14).toLowerCase().substr(1);
|
|
8889
8889
|
if (!extension2) {
|
|
8890
8890
|
return false;
|
|
8891
8891
|
}
|
|
@@ -9990,11 +9990,11 @@ var require_form_data = __commonJS({
|
|
|
9990
9990
|
"use strict";
|
|
9991
9991
|
var CombinedStream = require_combined_stream();
|
|
9992
9992
|
var util3 = require("util");
|
|
9993
|
-
var
|
|
9993
|
+
var path14 = require("path");
|
|
9994
9994
|
var http3 = require("http");
|
|
9995
9995
|
var https3 = require("https");
|
|
9996
9996
|
var parseUrl = require("url").parse;
|
|
9997
|
-
var
|
|
9997
|
+
var fs18 = require("fs");
|
|
9998
9998
|
var Stream = require("stream").Stream;
|
|
9999
9999
|
var crypto7 = require("crypto");
|
|
10000
10000
|
var mime = require_mime_types();
|
|
@@ -10061,7 +10061,7 @@ var require_form_data = __commonJS({
|
|
|
10061
10061
|
if (value.end != void 0 && value.end != Infinity && value.start != void 0) {
|
|
10062
10062
|
callback(null, value.end + 1 - (value.start ? value.start : 0));
|
|
10063
10063
|
} else {
|
|
10064
|
-
|
|
10064
|
+
fs18.stat(value.path, function(err, stat) {
|
|
10065
10065
|
if (err) {
|
|
10066
10066
|
callback(err);
|
|
10067
10067
|
return;
|
|
@@ -10118,11 +10118,11 @@ var require_form_data = __commonJS({
|
|
|
10118
10118
|
FormData3.prototype._getContentDisposition = function(value, options) {
|
|
10119
10119
|
var filename;
|
|
10120
10120
|
if (typeof options.filepath === "string") {
|
|
10121
|
-
filename =
|
|
10121
|
+
filename = path14.normalize(options.filepath).replace(/\\/g, "/");
|
|
10122
10122
|
} else if (options.filename || value && (value.name || value.path)) {
|
|
10123
|
-
filename =
|
|
10123
|
+
filename = path14.basename(options.filename || value && (value.name || value.path));
|
|
10124
10124
|
} else if (value && value.readable && hasOwn(value, "httpVersion")) {
|
|
10125
|
-
filename =
|
|
10125
|
+
filename = path14.basename(value.client._httpMessage.path || "");
|
|
10126
10126
|
}
|
|
10127
10127
|
if (filename) {
|
|
10128
10128
|
return 'filename="' + filename + '"';
|
|
@@ -15089,7 +15089,7 @@ var require_compile = __commonJS({
|
|
|
15089
15089
|
const schOrFunc = root.refs[ref];
|
|
15090
15090
|
if (schOrFunc)
|
|
15091
15091
|
return schOrFunc;
|
|
15092
|
-
let _sch =
|
|
15092
|
+
let _sch = resolve12.call(this, root, ref);
|
|
15093
15093
|
if (_sch === void 0) {
|
|
15094
15094
|
const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref];
|
|
15095
15095
|
const { schemaId } = this.opts;
|
|
@@ -15116,7 +15116,7 @@ var require_compile = __commonJS({
|
|
|
15116
15116
|
function sameSchemaEnv(s1, s2) {
|
|
15117
15117
|
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
|
|
15118
15118
|
}
|
|
15119
|
-
function
|
|
15119
|
+
function resolve12(root, ref) {
|
|
15120
15120
|
let sch;
|
|
15121
15121
|
while (typeof (sch = this.refs[ref]) == "string")
|
|
15122
15122
|
ref = sch;
|
|
@@ -15331,8 +15331,8 @@ var require_utils = __commonJS({
|
|
|
15331
15331
|
}
|
|
15332
15332
|
return ind;
|
|
15333
15333
|
}
|
|
15334
|
-
function removeDotSegments(
|
|
15335
|
-
let input2 =
|
|
15334
|
+
function removeDotSegments(path14) {
|
|
15335
|
+
let input2 = path14;
|
|
15336
15336
|
const output2 = [];
|
|
15337
15337
|
let nextSlash = -1;
|
|
15338
15338
|
let len = 0;
|
|
@@ -15531,8 +15531,8 @@ var require_schemes = __commonJS({
|
|
|
15531
15531
|
wsComponent.secure = void 0;
|
|
15532
15532
|
}
|
|
15533
15533
|
if (wsComponent.resourceName) {
|
|
15534
|
-
const [
|
|
15535
|
-
wsComponent.path =
|
|
15534
|
+
const [path14, query] = wsComponent.resourceName.split("?");
|
|
15535
|
+
wsComponent.path = path14 && path14 !== "/" ? path14 : void 0;
|
|
15536
15536
|
wsComponent.query = query;
|
|
15537
15537
|
wsComponent.resourceName = void 0;
|
|
15538
15538
|
}
|
|
@@ -15691,7 +15691,7 @@ var require_fast_uri = __commonJS({
|
|
|
15691
15691
|
}
|
|
15692
15692
|
return uri;
|
|
15693
15693
|
}
|
|
15694
|
-
function
|
|
15694
|
+
function resolve12(baseURI, relativeURI, options) {
|
|
15695
15695
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
15696
15696
|
const resolved = resolveComponent(parse3(baseURI, schemelessOptions), parse3(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
15697
15697
|
schemelessOptions.skipEscape = true;
|
|
@@ -15918,7 +15918,7 @@ var require_fast_uri = __commonJS({
|
|
|
15918
15918
|
var fastUri = {
|
|
15919
15919
|
SCHEMES,
|
|
15920
15920
|
normalize,
|
|
15921
|
-
resolve:
|
|
15921
|
+
resolve: resolve12,
|
|
15922
15922
|
resolveComponent,
|
|
15923
15923
|
equal,
|
|
15924
15924
|
serialize,
|
|
@@ -18738,8 +18738,8 @@ function validateAgainstSchemaDetailed(value, schemaPath, basePath, workspaceRoo
|
|
|
18738
18738
|
if (!valid && validate3.errors) {
|
|
18739
18739
|
const errors = validate3.errors.map((err) => convertAjvError(err, value));
|
|
18740
18740
|
const errorStrings = validate3.errors.map((err) => {
|
|
18741
|
-
const
|
|
18742
|
-
return `${
|
|
18741
|
+
const path14 = err.instancePath || "(root)";
|
|
18742
|
+
return `${path14}: ${err.message}`;
|
|
18743
18743
|
});
|
|
18744
18744
|
return {
|
|
18745
18745
|
valid: false,
|
|
@@ -18910,7 +18910,7 @@ function resolveValue(expr, responses, variables, getValueByPath2, responseIndex
|
|
|
18910
18910
|
if (refMatch) {
|
|
18911
18911
|
const responseIdx = parseInt(refMatch[1], 10);
|
|
18912
18912
|
const responseIndex = responseIdx - 1;
|
|
18913
|
-
const
|
|
18913
|
+
const path14 = refMatch[2];
|
|
18914
18914
|
if (responseIndex < 0 || responseIndex >= responses.length) {
|
|
18915
18915
|
return {
|
|
18916
18916
|
value: void 0,
|
|
@@ -18918,12 +18918,12 @@ function resolveValue(expr, responses, variables, getValueByPath2, responseIndex
|
|
|
18918
18918
|
};
|
|
18919
18919
|
}
|
|
18920
18920
|
const response = responses[responseIndex];
|
|
18921
|
-
const value = getValueByPath2(response,
|
|
18921
|
+
const value = getValueByPath2(response, path14);
|
|
18922
18922
|
return {
|
|
18923
18923
|
value,
|
|
18924
18924
|
responseIndex: responseIdx,
|
|
18925
18925
|
response,
|
|
18926
|
-
jsonPath:
|
|
18926
|
+
jsonPath: path14,
|
|
18927
18927
|
variableName: responseIndexToVariable?.get(responseIdx)
|
|
18928
18928
|
};
|
|
18929
18929
|
}
|
|
@@ -18940,22 +18940,22 @@ function resolveValue(expr, responses, variables, getValueByPath2, responseIndex
|
|
|
18940
18940
|
if (varName in variables) {
|
|
18941
18941
|
const varValue = variables[varName];
|
|
18942
18942
|
if (typeof varValue === "object" && varValue !== null) {
|
|
18943
|
-
const
|
|
18944
|
-
const value = getNestedValue2(varValue,
|
|
18943
|
+
const path14 = pathPart.replace(/^\./, "");
|
|
18944
|
+
const value = getNestedValue2(varValue, path14);
|
|
18945
18945
|
const isHttpResponse = "status" in varValue && "body" in varValue;
|
|
18946
18946
|
return {
|
|
18947
18947
|
value,
|
|
18948
18948
|
variableName: varName,
|
|
18949
|
-
jsonPath:
|
|
18949
|
+
jsonPath: path14,
|
|
18950
18950
|
response: isHttpResponse ? varValue : void 0
|
|
18951
18951
|
};
|
|
18952
18952
|
}
|
|
18953
18953
|
if (typeof varValue === "string") {
|
|
18954
18954
|
try {
|
|
18955
18955
|
const parsed = JSON.parse(varValue);
|
|
18956
|
-
const
|
|
18957
|
-
const value = getNestedValue2(parsed,
|
|
18958
|
-
return { value, variableName: varName, jsonPath:
|
|
18956
|
+
const path14 = pathPart.replace(/^\./, "");
|
|
18957
|
+
const value = getNestedValue2(parsed, path14);
|
|
18958
|
+
return { value, variableName: varName, jsonPath: path14 };
|
|
18959
18959
|
} catch {
|
|
18960
18960
|
return { value: void 0, error: `Cannot access path on non-object variable: ${varName}` };
|
|
18961
18961
|
}
|
|
@@ -18984,14 +18984,14 @@ function resolveValue(expr, responses, variables, getValueByPath2, responseIndex
|
|
|
18984
18984
|
const varValue = variables[varName];
|
|
18985
18985
|
if (pathPart) {
|
|
18986
18986
|
if (typeof varValue === "object" && varValue !== null) {
|
|
18987
|
-
const
|
|
18988
|
-
return { value: getNestedValue2(varValue,
|
|
18987
|
+
const path14 = pathPart.replace(/^\./, "");
|
|
18988
|
+
return { value: getNestedValue2(varValue, path14) };
|
|
18989
18989
|
}
|
|
18990
18990
|
if (typeof varValue === "string") {
|
|
18991
18991
|
try {
|
|
18992
18992
|
const parsed = JSON.parse(varValue);
|
|
18993
|
-
const
|
|
18994
|
-
return { value: getNestedValue2(parsed,
|
|
18993
|
+
const path14 = pathPart.replace(/^\./, "");
|
|
18994
|
+
return { value: getNestedValue2(parsed, path14) };
|
|
18995
18995
|
} catch {
|
|
18996
18996
|
return { value: void 0, error: `Cannot access path on non-object variable: ${varName}` };
|
|
18997
18997
|
}
|
|
@@ -19028,11 +19028,11 @@ function resolveValue(expr, responses, variables, getValueByPath2, responseIndex
|
|
|
19028
19028
|
}
|
|
19029
19029
|
return { value: void 0, error: `Cannot resolve expression: ${trimmed}` };
|
|
19030
19030
|
}
|
|
19031
|
-
function getNestedValue2(obj,
|
|
19032
|
-
if (!
|
|
19031
|
+
function getNestedValue2(obj, path14) {
|
|
19032
|
+
if (!path14 || obj === null || obj === void 0) {
|
|
19033
19033
|
return obj;
|
|
19034
19034
|
}
|
|
19035
|
-
const parts =
|
|
19035
|
+
const parts = path14.replace(/\[(\d+)\]/g, ".$1").split(".").filter((p) => p !== "");
|
|
19036
19036
|
let current = obj;
|
|
19037
19037
|
for (const part of parts) {
|
|
19038
19038
|
if (current === null || current === void 0) {
|
|
@@ -20921,15 +20921,15 @@ var require_pg_connection_string = __commonJS({
|
|
|
20921
20921
|
if (config.sslcert || config.sslkey || config.sslrootcert || config.sslmode) {
|
|
20922
20922
|
config.ssl = {};
|
|
20923
20923
|
}
|
|
20924
|
-
const
|
|
20924
|
+
const fs18 = config.sslcert || config.sslkey || config.sslrootcert ? require("fs") : null;
|
|
20925
20925
|
if (config.sslcert) {
|
|
20926
|
-
config.ssl.cert =
|
|
20926
|
+
config.ssl.cert = fs18.readFileSync(config.sslcert).toString();
|
|
20927
20927
|
}
|
|
20928
20928
|
if (config.sslkey) {
|
|
20929
|
-
config.ssl.key =
|
|
20929
|
+
config.ssl.key = fs18.readFileSync(config.sslkey).toString();
|
|
20930
20930
|
}
|
|
20931
20931
|
if (config.sslrootcert) {
|
|
20932
|
-
config.ssl.ca =
|
|
20932
|
+
config.ssl.ca = fs18.readFileSync(config.sslrootcert).toString();
|
|
20933
20933
|
}
|
|
20934
20934
|
if (options.useLibpqCompat && config.uselibpqcompat) {
|
|
20935
20935
|
throw new Error("Both useLibpqCompat and uselibpqcompat are set. Please use only one of them.");
|
|
@@ -22325,7 +22325,7 @@ var require_dist = __commonJS({
|
|
|
22325
22325
|
function parse3(stream4, callback) {
|
|
22326
22326
|
const parser = new parser_1.Parser();
|
|
22327
22327
|
stream4.on("data", (buffer) => parser.parse(buffer, callback));
|
|
22328
|
-
return new Promise((
|
|
22328
|
+
return new Promise((resolve12) => stream4.on("end", () => resolve12()));
|
|
22329
22329
|
}
|
|
22330
22330
|
exports2.parse = parse3;
|
|
22331
22331
|
}
|
|
@@ -22694,7 +22694,7 @@ var require_split2 = __commonJS({
|
|
|
22694
22694
|
var require_helper = __commonJS({
|
|
22695
22695
|
"node_modules/pgpass/lib/helper.js"(exports2, module2) {
|
|
22696
22696
|
"use strict";
|
|
22697
|
-
var
|
|
22697
|
+
var path14 = require("path");
|
|
22698
22698
|
var Stream = require("stream").Stream;
|
|
22699
22699
|
var split = require_split2();
|
|
22700
22700
|
var util3 = require("util");
|
|
@@ -22733,7 +22733,7 @@ var require_helper = __commonJS({
|
|
|
22733
22733
|
};
|
|
22734
22734
|
module2.exports.getFileName = function(rawEnv) {
|
|
22735
22735
|
var env3 = rawEnv || process.env;
|
|
22736
|
-
var file = env3.PGPASSFILE || (isWin ?
|
|
22736
|
+
var file = env3.PGPASSFILE || (isWin ? path14.join(env3.APPDATA || "./", "postgresql", "pgpass.conf") : path14.join(env3.HOME || "./", ".pgpass"));
|
|
22737
22737
|
return file;
|
|
22738
22738
|
};
|
|
22739
22739
|
module2.exports.usePgPass = function(stats, fname) {
|
|
@@ -22865,16 +22865,16 @@ var require_helper = __commonJS({
|
|
|
22865
22865
|
var require_lib = __commonJS({
|
|
22866
22866
|
"node_modules/pgpass/lib/index.js"(exports2, module2) {
|
|
22867
22867
|
"use strict";
|
|
22868
|
-
var
|
|
22869
|
-
var
|
|
22868
|
+
var path14 = require("path");
|
|
22869
|
+
var fs18 = require("fs");
|
|
22870
22870
|
var helper = require_helper();
|
|
22871
22871
|
module2.exports = function(connInfo, cb) {
|
|
22872
22872
|
var file = helper.getFileName();
|
|
22873
|
-
|
|
22873
|
+
fs18.stat(file, function(err, stat) {
|
|
22874
22874
|
if (err || !helper.usePgPass(stat, file)) {
|
|
22875
22875
|
return cb(void 0);
|
|
22876
22876
|
}
|
|
22877
|
-
var st =
|
|
22877
|
+
var st = fs18.createReadStream(file);
|
|
22878
22878
|
helper.getPassword(connInfo, st, cb);
|
|
22879
22879
|
});
|
|
22880
22880
|
};
|
|
@@ -23056,12 +23056,12 @@ var require_client = __commonJS({
|
|
|
23056
23056
|
this._connect(callback);
|
|
23057
23057
|
return;
|
|
23058
23058
|
}
|
|
23059
|
-
return new this._Promise((
|
|
23059
|
+
return new this._Promise((resolve12, reject) => {
|
|
23060
23060
|
this._connect((error) => {
|
|
23061
23061
|
if (error) {
|
|
23062
23062
|
reject(error);
|
|
23063
23063
|
} else {
|
|
23064
|
-
|
|
23064
|
+
resolve12(this);
|
|
23065
23065
|
}
|
|
23066
23066
|
});
|
|
23067
23067
|
});
|
|
@@ -23407,8 +23407,8 @@ var require_client = __commonJS({
|
|
|
23407
23407
|
readTimeout = config.query_timeout || this.connectionParameters.query_timeout;
|
|
23408
23408
|
query = new Query2(config, values, callback);
|
|
23409
23409
|
if (!query.callback) {
|
|
23410
|
-
result = new this._Promise((
|
|
23411
|
-
query.callback = (err, res) => err ? reject(err) :
|
|
23410
|
+
result = new this._Promise((resolve12, reject) => {
|
|
23411
|
+
query.callback = (err, res) => err ? reject(err) : resolve12(res);
|
|
23412
23412
|
}).catch((err) => {
|
|
23413
23413
|
Error.captureStackTrace(err);
|
|
23414
23414
|
throw err;
|
|
@@ -23485,8 +23485,8 @@ var require_client = __commonJS({
|
|
|
23485
23485
|
if (cb) {
|
|
23486
23486
|
this.connection.once("end", cb);
|
|
23487
23487
|
} else {
|
|
23488
|
-
return new this._Promise((
|
|
23489
|
-
this.connection.once("end",
|
|
23488
|
+
return new this._Promise((resolve12) => {
|
|
23489
|
+
this.connection.once("end", resolve12);
|
|
23490
23490
|
});
|
|
23491
23491
|
}
|
|
23492
23492
|
}
|
|
@@ -23535,8 +23535,8 @@ var require_pg_pool = __commonJS({
|
|
|
23535
23535
|
const cb = function(err, client) {
|
|
23536
23536
|
err ? rej(err) : res(client);
|
|
23537
23537
|
};
|
|
23538
|
-
const result = new Promise2(function(
|
|
23539
|
-
res =
|
|
23538
|
+
const result = new Promise2(function(resolve12, reject) {
|
|
23539
|
+
res = resolve12;
|
|
23540
23540
|
rej = reject;
|
|
23541
23541
|
}).catch((err) => {
|
|
23542
23542
|
Error.captureStackTrace(err);
|
|
@@ -23597,7 +23597,7 @@ var require_pg_pool = __commonJS({
|
|
|
23597
23597
|
if (typeof Promise2.try === "function") {
|
|
23598
23598
|
return Promise2.try(f);
|
|
23599
23599
|
}
|
|
23600
|
-
return new Promise2((
|
|
23600
|
+
return new Promise2((resolve12) => resolve12(f()));
|
|
23601
23601
|
}
|
|
23602
23602
|
_isFull() {
|
|
23603
23603
|
return this._clients.length >= this.options.max;
|
|
@@ -23990,8 +23990,8 @@ var require_query2 = __commonJS({
|
|
|
23990
23990
|
NativeQuery.prototype._getPromise = function() {
|
|
23991
23991
|
if (this._promise) return this._promise;
|
|
23992
23992
|
this._promise = new Promise(
|
|
23993
|
-
function(
|
|
23994
|
-
this._once("end",
|
|
23993
|
+
function(resolve12, reject) {
|
|
23994
|
+
this._once("end", resolve12);
|
|
23995
23995
|
this._once("error", reject);
|
|
23996
23996
|
}.bind(this)
|
|
23997
23997
|
);
|
|
@@ -24168,12 +24168,12 @@ var require_client2 = __commonJS({
|
|
|
24168
24168
|
this._connect(callback);
|
|
24169
24169
|
return;
|
|
24170
24170
|
}
|
|
24171
|
-
return new this._Promise((
|
|
24171
|
+
return new this._Promise((resolve12, reject) => {
|
|
24172
24172
|
this._connect((error) => {
|
|
24173
24173
|
if (error) {
|
|
24174
24174
|
reject(error);
|
|
24175
24175
|
} else {
|
|
24176
|
-
|
|
24176
|
+
resolve12(this);
|
|
24177
24177
|
}
|
|
24178
24178
|
});
|
|
24179
24179
|
});
|
|
@@ -24197,8 +24197,8 @@ var require_client2 = __commonJS({
|
|
|
24197
24197
|
query = new NativeQuery(config, values, callback);
|
|
24198
24198
|
if (!query.callback) {
|
|
24199
24199
|
let resolveOut, rejectOut;
|
|
24200
|
-
result = new this._Promise((
|
|
24201
|
-
resolveOut =
|
|
24200
|
+
result = new this._Promise((resolve12, reject) => {
|
|
24201
|
+
resolveOut = resolve12;
|
|
24202
24202
|
rejectOut = reject;
|
|
24203
24203
|
}).catch((err) => {
|
|
24204
24204
|
Error.captureStackTrace(err);
|
|
@@ -24258,8 +24258,8 @@ var require_client2 = __commonJS({
|
|
|
24258
24258
|
}
|
|
24259
24259
|
let result;
|
|
24260
24260
|
if (!cb) {
|
|
24261
|
-
result = new this._Promise(function(
|
|
24262
|
-
cb = (err) => err ? reject(err) :
|
|
24261
|
+
result = new this._Promise(function(resolve12, reject) {
|
|
24262
|
+
cb = (err) => err ? reject(err) : resolve12();
|
|
24263
24263
|
});
|
|
24264
24264
|
}
|
|
24265
24265
|
this.native.end(function() {
|
|
@@ -24957,15 +24957,15 @@ var require_utils4 = __commonJS({
|
|
|
24957
24957
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
24958
24958
|
var PromiseInspection_1 = require_PromiseInspection();
|
|
24959
24959
|
function defer() {
|
|
24960
|
-
let
|
|
24960
|
+
let resolve12 = null;
|
|
24961
24961
|
let reject = null;
|
|
24962
24962
|
const promise = new Promise((resolver, rejecter) => {
|
|
24963
|
-
|
|
24963
|
+
resolve12 = resolver;
|
|
24964
24964
|
reject = rejecter;
|
|
24965
24965
|
});
|
|
24966
24966
|
return {
|
|
24967
24967
|
promise,
|
|
24968
|
-
resolve:
|
|
24968
|
+
resolve: resolve12,
|
|
24969
24969
|
reject
|
|
24970
24970
|
};
|
|
24971
24971
|
}
|
|
@@ -24990,7 +24990,7 @@ var require_utils4 = __commonJS({
|
|
|
24990
24990
|
}
|
|
24991
24991
|
exports2.checkRequiredTime = checkRequiredTime;
|
|
24992
24992
|
function delay(millis) {
|
|
24993
|
-
return new Promise((
|
|
24993
|
+
return new Promise((resolve12) => setTimeout(resolve12, millis));
|
|
24994
24994
|
}
|
|
24995
24995
|
exports2.delay = delay;
|
|
24996
24996
|
function reflect(promise) {
|
|
@@ -25050,11 +25050,11 @@ var require_PendingOperation = __commonJS({
|
|
|
25050
25050
|
};
|
|
25051
25051
|
exports2.PendingOperation = PendingOperation;
|
|
25052
25052
|
function timeout(promise, time) {
|
|
25053
|
-
return new Promise((
|
|
25053
|
+
return new Promise((resolve12, reject) => {
|
|
25054
25054
|
const timeoutHandle = setTimeout(() => reject(new TimeoutError_1.TimeoutError()), time);
|
|
25055
25055
|
promise.then((result) => {
|
|
25056
25056
|
clearTimeout(timeoutHandle);
|
|
25057
|
-
|
|
25057
|
+
resolve12(result);
|
|
25058
25058
|
}).catch((err) => {
|
|
25059
25059
|
clearTimeout(timeoutHandle);
|
|
25060
25060
|
reject(err);
|
|
@@ -25262,15 +25262,15 @@ var require_Pool = __commonJS({
|
|
|
25262
25262
|
this._stopReaping();
|
|
25263
25263
|
this.destroyed = true;
|
|
25264
25264
|
return utils_1.reflect(Promise.all(this.pendingCreates.map((create) => utils_1.reflect(create.promise))).then(() => {
|
|
25265
|
-
return new Promise((
|
|
25265
|
+
return new Promise((resolve12, reject) => {
|
|
25266
25266
|
if (this.numPendingValidations() === 0) {
|
|
25267
|
-
|
|
25267
|
+
resolve12();
|
|
25268
25268
|
return;
|
|
25269
25269
|
}
|
|
25270
25270
|
const interval = setInterval(() => {
|
|
25271
25271
|
if (this.numPendingValidations() === 0) {
|
|
25272
25272
|
timers_1.clearInterval(interval);
|
|
25273
|
-
|
|
25273
|
+
resolve12();
|
|
25274
25274
|
}
|
|
25275
25275
|
}, 100);
|
|
25276
25276
|
});
|
|
@@ -25494,17 +25494,17 @@ var require_Pool = __commonJS({
|
|
|
25494
25494
|
}
|
|
25495
25495
|
}
|
|
25496
25496
|
function callbackOrPromise(func) {
|
|
25497
|
-
return new Promise((
|
|
25497
|
+
return new Promise((resolve12, reject) => {
|
|
25498
25498
|
const callback = (err, resource) => {
|
|
25499
25499
|
if (err) {
|
|
25500
25500
|
reject(err);
|
|
25501
25501
|
} else {
|
|
25502
|
-
|
|
25502
|
+
resolve12(resource);
|
|
25503
25503
|
}
|
|
25504
25504
|
};
|
|
25505
25505
|
utils_1.tryPromise(() => func(callback)).then((res) => {
|
|
25506
25506
|
if (res) {
|
|
25507
|
-
|
|
25507
|
+
resolve12(res);
|
|
25508
25508
|
}
|
|
25509
25509
|
}).catch((err) => {
|
|
25510
25510
|
reject(err);
|
|
@@ -25938,7 +25938,7 @@ var require_table = __commonJS({
|
|
|
25938
25938
|
let cursor = -1;
|
|
25939
25939
|
let buffer = "";
|
|
25940
25940
|
let escaped = false;
|
|
25941
|
-
const
|
|
25941
|
+
const path14 = [];
|
|
25942
25942
|
while (++cursor < length) {
|
|
25943
25943
|
const char = name.charAt(cursor);
|
|
25944
25944
|
if (char === "[") {
|
|
@@ -25957,7 +25957,7 @@ var require_table = __commonJS({
|
|
|
25957
25957
|
if (escaped) {
|
|
25958
25958
|
buffer += char;
|
|
25959
25959
|
} else {
|
|
25960
|
-
|
|
25960
|
+
path14.push(buffer);
|
|
25961
25961
|
buffer = "";
|
|
25962
25962
|
}
|
|
25963
25963
|
} else {
|
|
@@ -25965,26 +25965,26 @@ var require_table = __commonJS({
|
|
|
25965
25965
|
}
|
|
25966
25966
|
}
|
|
25967
25967
|
if (buffer) {
|
|
25968
|
-
|
|
25968
|
+
path14.push(buffer);
|
|
25969
25969
|
}
|
|
25970
|
-
switch (
|
|
25970
|
+
switch (path14.length) {
|
|
25971
25971
|
case 1:
|
|
25972
25972
|
return {
|
|
25973
|
-
name:
|
|
25973
|
+
name: path14[0],
|
|
25974
25974
|
schema: null,
|
|
25975
25975
|
database: null
|
|
25976
25976
|
};
|
|
25977
25977
|
case 2:
|
|
25978
25978
|
return {
|
|
25979
|
-
name:
|
|
25980
|
-
schema:
|
|
25979
|
+
name: path14[1],
|
|
25980
|
+
schema: path14[0],
|
|
25981
25981
|
database: null
|
|
25982
25982
|
};
|
|
25983
25983
|
case 3:
|
|
25984
25984
|
return {
|
|
25985
|
-
name:
|
|
25986
|
-
schema:
|
|
25987
|
-
database:
|
|
25985
|
+
name: path14[2],
|
|
25986
|
+
schema: path14[1],
|
|
25987
|
+
database: path14[0]
|
|
25988
25988
|
};
|
|
25989
25989
|
default:
|
|
25990
25990
|
throw new Error("Invalid table name.");
|
|
@@ -26570,10 +26570,10 @@ var require_connection_pool = __commonJS({
|
|
|
26570
26570
|
this._connect(callback);
|
|
26571
26571
|
return this;
|
|
26572
26572
|
}
|
|
26573
|
-
return new shared.Promise((
|
|
26573
|
+
return new shared.Promise((resolve12, reject) => {
|
|
26574
26574
|
return this._connect((err) => {
|
|
26575
26575
|
if (err) return reject(err);
|
|
26576
|
-
|
|
26576
|
+
resolve12(this);
|
|
26577
26577
|
});
|
|
26578
26578
|
});
|
|
26579
26579
|
}
|
|
@@ -26654,10 +26654,10 @@ var require_connection_pool = __commonJS({
|
|
|
26654
26654
|
this._close(callback);
|
|
26655
26655
|
return this;
|
|
26656
26656
|
}
|
|
26657
|
-
return new shared.Promise((
|
|
26657
|
+
return new shared.Promise((resolve12, reject) => {
|
|
26658
26658
|
this._close((err) => {
|
|
26659
26659
|
if (err) return reject(err);
|
|
26660
|
-
|
|
26660
|
+
resolve12(this);
|
|
26661
26661
|
});
|
|
26662
26662
|
});
|
|
26663
26663
|
}
|
|
@@ -26818,8 +26818,8 @@ var require_global_connection = __commonJS({
|
|
|
26818
26818
|
setImmediate(callback);
|
|
26819
26819
|
return null;
|
|
26820
26820
|
}
|
|
26821
|
-
return new shared.Promise((
|
|
26822
|
-
|
|
26821
|
+
return new shared.Promise((resolve12) => {
|
|
26822
|
+
resolve12(globalConnection);
|
|
26823
26823
|
});
|
|
26824
26824
|
}
|
|
26825
26825
|
function on(event, handler) {
|
|
@@ -27030,10 +27030,10 @@ var require_prepared_statement = __commonJS({
|
|
|
27030
27030
|
this._prepare(statement, callback);
|
|
27031
27031
|
return this;
|
|
27032
27032
|
}
|
|
27033
|
-
return new shared.Promise((
|
|
27033
|
+
return new shared.Promise((resolve12, reject) => {
|
|
27034
27034
|
this._prepare(statement, (err) => {
|
|
27035
27035
|
if (err) return reject(err);
|
|
27036
|
-
|
|
27036
|
+
resolve12(this);
|
|
27037
27037
|
});
|
|
27038
27038
|
});
|
|
27039
27039
|
}
|
|
@@ -27096,10 +27096,10 @@ var require_prepared_statement = __commonJS({
|
|
|
27096
27096
|
if (this.stream || typeof callback === "function") {
|
|
27097
27097
|
return this._execute(values, callback);
|
|
27098
27098
|
}
|
|
27099
|
-
return new shared.Promise((
|
|
27099
|
+
return new shared.Promise((resolve12, reject) => {
|
|
27100
27100
|
this._execute(values, (err, recordset) => {
|
|
27101
27101
|
if (err) return reject(err);
|
|
27102
|
-
|
|
27102
|
+
resolve12(recordset);
|
|
27103
27103
|
});
|
|
27104
27104
|
});
|
|
27105
27105
|
}
|
|
@@ -27145,10 +27145,10 @@ var require_prepared_statement = __commonJS({
|
|
|
27145
27145
|
this._unprepare(callback);
|
|
27146
27146
|
return this;
|
|
27147
27147
|
}
|
|
27148
|
-
return new shared.Promise((
|
|
27148
|
+
return new shared.Promise((resolve12, reject) => {
|
|
27149
27149
|
this._unprepare((err) => {
|
|
27150
27150
|
if (err) return reject(err);
|
|
27151
|
-
|
|
27151
|
+
resolve12();
|
|
27152
27152
|
});
|
|
27153
27153
|
});
|
|
27154
27154
|
}
|
|
@@ -27392,7 +27392,7 @@ var require_request = __commonJS({
|
|
|
27392
27392
|
const strings = values.shift();
|
|
27393
27393
|
batch = this._template(strings, values);
|
|
27394
27394
|
}
|
|
27395
|
-
return new shared.Promise((
|
|
27395
|
+
return new shared.Promise((resolve12, reject) => {
|
|
27396
27396
|
this._batch(batch, (err, recordsets, output2, rowsAffected) => {
|
|
27397
27397
|
if (this.stream) {
|
|
27398
27398
|
if (err) this.emit("error", err);
|
|
@@ -27403,7 +27403,7 @@ var require_request = __commonJS({
|
|
|
27403
27403
|
});
|
|
27404
27404
|
}
|
|
27405
27405
|
if (err) return reject(err);
|
|
27406
|
-
|
|
27406
|
+
resolve12({
|
|
27407
27407
|
recordsets,
|
|
27408
27408
|
recordset: recordsets && recordsets[0],
|
|
27409
27409
|
output: output2,
|
|
@@ -27459,10 +27459,10 @@ var require_request = __commonJS({
|
|
|
27459
27459
|
});
|
|
27460
27460
|
return this;
|
|
27461
27461
|
}
|
|
27462
|
-
return new shared.Promise((
|
|
27462
|
+
return new shared.Promise((resolve12, reject) => {
|
|
27463
27463
|
this._bulk(table, options, (err, rowsAffected) => {
|
|
27464
27464
|
if (err) return reject(err);
|
|
27465
|
-
|
|
27465
|
+
resolve12({
|
|
27466
27466
|
rowsAffected
|
|
27467
27467
|
});
|
|
27468
27468
|
});
|
|
@@ -27563,7 +27563,7 @@ var require_request = __commonJS({
|
|
|
27563
27563
|
const strings = values.shift();
|
|
27564
27564
|
command = this._template(strings, values);
|
|
27565
27565
|
}
|
|
27566
|
-
return new shared.Promise((
|
|
27566
|
+
return new shared.Promise((resolve12, reject) => {
|
|
27567
27567
|
this._query(command, (err, recordsets, output2, rowsAffected, columns) => {
|
|
27568
27568
|
if (this.stream) {
|
|
27569
27569
|
if (err) this.emit("error", err);
|
|
@@ -27581,7 +27581,7 @@ var require_request = __commonJS({
|
|
|
27581
27581
|
rowsAffected
|
|
27582
27582
|
};
|
|
27583
27583
|
if (this.arrayRowMode) result.columns = columns;
|
|
27584
|
-
|
|
27584
|
+
resolve12(result);
|
|
27585
27585
|
});
|
|
27586
27586
|
});
|
|
27587
27587
|
}
|
|
@@ -27635,7 +27635,7 @@ var require_request = __commonJS({
|
|
|
27635
27635
|
});
|
|
27636
27636
|
return this;
|
|
27637
27637
|
}
|
|
27638
|
-
return new shared.Promise((
|
|
27638
|
+
return new shared.Promise((resolve12, reject) => {
|
|
27639
27639
|
this._execute(command, (err, recordsets, output2, returnValue, rowsAffected, columns) => {
|
|
27640
27640
|
if (this.stream) {
|
|
27641
27641
|
if (err) this.emit("error", err);
|
|
@@ -27655,7 +27655,7 @@ var require_request = __commonJS({
|
|
|
27655
27655
|
returnValue
|
|
27656
27656
|
};
|
|
27657
27657
|
if (this.arrayRowMode) result.columns = columns;
|
|
27658
|
-
|
|
27658
|
+
resolve12(result);
|
|
27659
27659
|
});
|
|
27660
27660
|
});
|
|
27661
27661
|
}
|
|
@@ -27819,11 +27819,11 @@ var require_transaction = __commonJS({
|
|
|
27819
27819
|
});
|
|
27820
27820
|
return this;
|
|
27821
27821
|
}
|
|
27822
|
-
return new shared.Promise((
|
|
27822
|
+
return new shared.Promise((resolve12, reject) => {
|
|
27823
27823
|
this._begin(isolationLevel, (err) => {
|
|
27824
27824
|
if (err) return reject(err);
|
|
27825
27825
|
this.emit("begin");
|
|
27826
|
-
|
|
27826
|
+
resolve12(this);
|
|
27827
27827
|
});
|
|
27828
27828
|
});
|
|
27829
27829
|
}
|
|
@@ -27866,11 +27866,11 @@ var require_transaction = __commonJS({
|
|
|
27866
27866
|
});
|
|
27867
27867
|
return this;
|
|
27868
27868
|
}
|
|
27869
|
-
return new shared.Promise((
|
|
27869
|
+
return new shared.Promise((resolve12, reject) => {
|
|
27870
27870
|
this._commit((err) => {
|
|
27871
27871
|
if (err) return reject(err);
|
|
27872
27872
|
this.emit("commit");
|
|
27873
|
-
|
|
27873
|
+
resolve12();
|
|
27874
27874
|
});
|
|
27875
27875
|
});
|
|
27876
27876
|
}
|
|
@@ -27915,11 +27915,11 @@ var require_transaction = __commonJS({
|
|
|
27915
27915
|
});
|
|
27916
27916
|
return this;
|
|
27917
27917
|
}
|
|
27918
|
-
return new shared.Promise((
|
|
27918
|
+
return new shared.Promise((resolve12, reject) => {
|
|
27919
27919
|
return this._rollback((err) => {
|
|
27920
27920
|
if (err) return reject(err);
|
|
27921
27921
|
this.emit("rollback", this._aborted);
|
|
27922
|
-
|
|
27922
|
+
resolve12();
|
|
27923
27923
|
});
|
|
27924
27924
|
});
|
|
27925
27925
|
}
|
|
@@ -29160,11 +29160,11 @@ function __metadata(metadataKey, metadataValue) {
|
|
|
29160
29160
|
}
|
|
29161
29161
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
29162
29162
|
function adopt(value) {
|
|
29163
|
-
return value instanceof P ? value : new P(function(
|
|
29164
|
-
|
|
29163
|
+
return value instanceof P ? value : new P(function(resolve12) {
|
|
29164
|
+
resolve12(value);
|
|
29165
29165
|
});
|
|
29166
29166
|
}
|
|
29167
|
-
return new (P || (P = Promise))(function(
|
|
29167
|
+
return new (P || (P = Promise))(function(resolve12, reject) {
|
|
29168
29168
|
function fulfilled(value) {
|
|
29169
29169
|
try {
|
|
29170
29170
|
step(generator.next(value));
|
|
@@ -29180,7 +29180,7 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
29180
29180
|
}
|
|
29181
29181
|
}
|
|
29182
29182
|
function step(result) {
|
|
29183
|
-
result.done ?
|
|
29183
|
+
result.done ? resolve12(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
29184
29184
|
}
|
|
29185
29185
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
29186
29186
|
});
|
|
@@ -29371,14 +29371,14 @@ function __asyncValues(o) {
|
|
|
29371
29371
|
}, i);
|
|
29372
29372
|
function verb(n) {
|
|
29373
29373
|
i[n] = o[n] && function(v) {
|
|
29374
|
-
return new Promise(function(
|
|
29375
|
-
v = o[n](v), settle2(
|
|
29374
|
+
return new Promise(function(resolve12, reject) {
|
|
29375
|
+
v = o[n](v), settle2(resolve12, reject, v.done, v.value);
|
|
29376
29376
|
});
|
|
29377
29377
|
};
|
|
29378
29378
|
}
|
|
29379
|
-
function settle2(
|
|
29379
|
+
function settle2(resolve12, reject, d, v) {
|
|
29380
29380
|
Promise.resolve(v).then(function(v2) {
|
|
29381
|
-
|
|
29381
|
+
resolve12({ value: v2, done: d });
|
|
29382
29382
|
}, reject);
|
|
29383
29383
|
}
|
|
29384
29384
|
}
|
|
@@ -29470,13 +29470,13 @@ function __disposeResources(env3) {
|
|
|
29470
29470
|
}
|
|
29471
29471
|
return next();
|
|
29472
29472
|
}
|
|
29473
|
-
function __rewriteRelativeImportExtension(
|
|
29474
|
-
if (typeof
|
|
29475
|
-
return
|
|
29473
|
+
function __rewriteRelativeImportExtension(path14, preserveJsx) {
|
|
29474
|
+
if (typeof path14 === "string" && /^\.\.?\//.test(path14)) {
|
|
29475
|
+
return path14.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
|
|
29476
29476
|
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
|
|
29477
29477
|
});
|
|
29478
29478
|
}
|
|
29479
|
-
return
|
|
29479
|
+
return path14;
|
|
29480
29480
|
}
|
|
29481
29481
|
var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default;
|
|
29482
29482
|
var init_tslib_es6 = __esm({
|
|
@@ -29623,8 +29623,8 @@ var require_msalPlugins = __commonJS({
|
|
|
29623
29623
|
}
|
|
29624
29624
|
};
|
|
29625
29625
|
exports2.msalNodeFlowVSCodeCredentialControl = {
|
|
29626
|
-
setVSCodeAuthRecordPath(
|
|
29627
|
-
exports2.vsCodeAuthRecordPath =
|
|
29626
|
+
setVSCodeAuthRecordPath(path14) {
|
|
29627
|
+
exports2.vsCodeAuthRecordPath = path14;
|
|
29628
29628
|
},
|
|
29629
29629
|
setVSCodeBroker(broker) {
|
|
29630
29630
|
exports2.vsCodeBrokerInfo = {
|
|
@@ -32973,7 +32973,7 @@ var require_index_node_BtzY9XyU = __commonJS({
|
|
|
32973
32973
|
return cachedAtSec > nowSeconds();
|
|
32974
32974
|
}
|
|
32975
32975
|
function delay(t, value) {
|
|
32976
|
-
return new Promise((
|
|
32976
|
+
return new Promise((resolve12) => setTimeout(() => resolve12(value), t));
|
|
32977
32977
|
}
|
|
32978
32978
|
var TimeUtils = /* @__PURE__ */ Object.freeze({
|
|
32979
32979
|
__proto__: null,
|
|
@@ -42365,8 +42365,8 @@ var require_msal_node = __commonJS({
|
|
|
42365
42365
|
var crypto7 = require("crypto");
|
|
42366
42366
|
var msalCommon = require_lib4();
|
|
42367
42367
|
var jwt = require_jsonwebtoken();
|
|
42368
|
-
var
|
|
42369
|
-
var
|
|
42368
|
+
var fs18 = require("fs");
|
|
42369
|
+
var path14 = require("path");
|
|
42370
42370
|
var Serializer = class {
|
|
42371
42371
|
/**
|
|
42372
42372
|
* serialize the JSON blob
|
|
@@ -46159,7 +46159,7 @@ var require_msal_node = __commonJS({
|
|
|
46159
46159
|
return cachedAtSec > nowSeconds();
|
|
46160
46160
|
}
|
|
46161
46161
|
function delay(t, value) {
|
|
46162
|
-
return new Promise((
|
|
46162
|
+
return new Promise((resolve12) => setTimeout(() => resolve12(value), t));
|
|
46163
46163
|
}
|
|
46164
46164
|
function createIdTokenEntity(homeAccountId, environment, idToken, clientId, tenantId) {
|
|
46165
46165
|
const idTokenEntity = {
|
|
@@ -48862,7 +48862,7 @@ ${body}`;
|
|
|
48862
48862
|
Host: ${destinationUrl.host}\r
|
|
48863
48863
|
Connection: close\r
|
|
48864
48864
|
` + postRequestStringContent + "\r\n";
|
|
48865
|
-
return new Promise((
|
|
48865
|
+
return new Promise((resolve12, reject) => {
|
|
48866
48866
|
const request = http3.request(tunnelRequestOptions);
|
|
48867
48867
|
if (timeout) {
|
|
48868
48868
|
request.on("timeout", () => {
|
|
@@ -48911,7 +48911,7 @@ Connection: close\r
|
|
|
48911
48911
|
if (this.shouldDestroyRequest(httpStatusCode, networkResponse)) {
|
|
48912
48912
|
request.destroy();
|
|
48913
48913
|
}
|
|
48914
|
-
|
|
48914
|
+
resolve12(networkResponse);
|
|
48915
48915
|
});
|
|
48916
48916
|
socket.on("error", (chunk) => {
|
|
48917
48917
|
request.destroy();
|
|
@@ -48953,7 +48953,7 @@ Connection: close\r
|
|
|
48953
48953
|
customOptions.timeout = timeout;
|
|
48954
48954
|
}
|
|
48955
48955
|
}
|
|
48956
|
-
return new Promise((
|
|
48956
|
+
return new Promise((resolve12, reject) => {
|
|
48957
48957
|
let request;
|
|
48958
48958
|
if (customOptions.protocol === "http:") {
|
|
48959
48959
|
request = http3.request(customOptions);
|
|
@@ -48986,7 +48986,7 @@ Connection: close\r
|
|
|
48986
48986
|
if (this.shouldDestroyRequest(statusCode, networkResponse)) {
|
|
48987
48987
|
request.destroy();
|
|
48988
48988
|
}
|
|
48989
|
-
|
|
48989
|
+
resolve12(networkResponse);
|
|
48990
48990
|
});
|
|
48991
48991
|
});
|
|
48992
48992
|
request.on("error", (chunk) => {
|
|
@@ -50756,7 +50756,7 @@ Headers: ${JSON.stringify(headers)}`
|
|
|
50756
50756
|
if (this.server) {
|
|
50757
50757
|
throw NodeAuthError.createLoopbackServerAlreadyExistsError();
|
|
50758
50758
|
}
|
|
50759
|
-
return new Promise((
|
|
50759
|
+
return new Promise((resolve12, reject) => {
|
|
50760
50760
|
this.server = http3.createServer((req, res) => {
|
|
50761
50761
|
const url2 = req.url;
|
|
50762
50762
|
if (!url2) {
|
|
@@ -50779,7 +50779,7 @@ Headers: ${JSON.stringify(headers)}`
|
|
|
50779
50779
|
if (authCodeResponse.error) {
|
|
50780
50780
|
res.end(errorTemplate || `Error occurred: ${authCodeResponse.error}`);
|
|
50781
50781
|
}
|
|
50782
|
-
|
|
50782
|
+
resolve12(authCodeResponse);
|
|
50783
50783
|
});
|
|
50784
50784
|
this.server.listen(0, "127.0.0.1");
|
|
50785
50785
|
});
|
|
@@ -51192,7 +51192,7 @@ Headers: ${JSON.stringify(headers)}`
|
|
|
51192
51192
|
* @returns
|
|
51193
51193
|
*/
|
|
51194
51194
|
async waitForRedirectUri(loopbackClient) {
|
|
51195
|
-
return new Promise((
|
|
51195
|
+
return new Promise((resolve12, reject) => {
|
|
51196
51196
|
let ticks = 0;
|
|
51197
51197
|
const id = setInterval(() => {
|
|
51198
51198
|
if (LOOPBACK_SERVER_CONSTANTS.TIMEOUT_MS / LOOPBACK_SERVER_CONSTANTS.INTERVAL_MS < ticks) {
|
|
@@ -51203,7 +51203,7 @@ Headers: ${JSON.stringify(headers)}`
|
|
|
51203
51203
|
try {
|
|
51204
51204
|
const r = loopbackClient.getRedirectUri();
|
|
51205
51205
|
clearInterval(id);
|
|
51206
|
-
|
|
51206
|
+
resolve12(r);
|
|
51207
51207
|
return;
|
|
51208
51208
|
} catch (e) {
|
|
51209
51209
|
if (e instanceof AuthError && e.errorCode === NodeAuthErrorMessage.noLoopbackServerExists.code) {
|
|
@@ -51957,8 +51957,8 @@ Headers: ${JSON.stringify(headers)}`
|
|
|
51957
51957
|
if (DEFAULT_MANAGED_IDENTITY_HTTP_STATUS_CODES_TO_RETRY_ON.includes(httpStatusCode) && currentRetry < DEFAULT_MANAGED_IDENTITY_MAX_RETRIES) {
|
|
51958
51958
|
const retryAfterDelay = this.linearRetryStrategy.calculateDelay(retryAfterHeader, _DefaultManagedIdentityRetryPolicy.DEFAULT_MANAGED_IDENTITY_RETRY_DELAY_MS);
|
|
51959
51959
|
logger.verbose(`Retrying request in ${retryAfterDelay}ms (retry attempt: ${currentRetry + 1})`);
|
|
51960
|
-
await new Promise((
|
|
51961
|
-
return setTimeout(
|
|
51960
|
+
await new Promise((resolve12) => {
|
|
51961
|
+
return setTimeout(resolve12, retryAfterDelay);
|
|
51962
51962
|
});
|
|
51963
51963
|
return true;
|
|
51964
51964
|
}
|
|
@@ -52114,7 +52114,7 @@ Headers: ${JSON.stringify(headers)}`
|
|
|
52114
52114
|
if (!identityEndpoint || !imdsEndpoint) {
|
|
52115
52115
|
const fileDetectionPath = AZURE_ARC_FILE_DETECTION[process.platform];
|
|
52116
52116
|
try {
|
|
52117
|
-
|
|
52117
|
+
fs18.accessSync(fileDetectionPath, fs18.constants.F_OK | fs18.constants.R_OK);
|
|
52118
52118
|
identityEndpoint = DEFAULT_AZURE_ARC_IDENTITY_ENDPOINT;
|
|
52119
52119
|
imdsEndpoint = HIMDS_EXECUTABLE_HELPER_STRING;
|
|
52120
52120
|
} catch (err) {
|
|
@@ -52217,7 +52217,7 @@ Headers: ${JSON.stringify(headers)}`
|
|
|
52217
52217
|
throw createManagedIdentityError(platformNotSupported);
|
|
52218
52218
|
}
|
|
52219
52219
|
const expectedSecretFilePath = SUPPORTED_AZURE_ARC_PLATFORMS[process.platform];
|
|
52220
|
-
const fileName =
|
|
52220
|
+
const fileName = path14.basename(secretFilePath);
|
|
52221
52221
|
if (!fileName.endsWith(".key")) {
|
|
52222
52222
|
throw createManagedIdentityError(invalidFileExtension);
|
|
52223
52223
|
}
|
|
@@ -52226,7 +52226,7 @@ Headers: ${JSON.stringify(headers)}`
|
|
|
52226
52226
|
}
|
|
52227
52227
|
let secretFileSize;
|
|
52228
52228
|
try {
|
|
52229
|
-
secretFileSize = await
|
|
52229
|
+
secretFileSize = await fs18.statSync(secretFilePath).size;
|
|
52230
52230
|
} catch (e) {
|
|
52231
52231
|
throw createManagedIdentityError(unableToReadSecretFile);
|
|
52232
52232
|
}
|
|
@@ -52235,7 +52235,7 @@ Headers: ${JSON.stringify(headers)}`
|
|
|
52235
52235
|
}
|
|
52236
52236
|
let secret;
|
|
52237
52237
|
try {
|
|
52238
|
-
secret =
|
|
52238
|
+
secret = fs18.readFileSync(secretFilePath, EncodingTypes.UTF8);
|
|
52239
52239
|
} catch (e) {
|
|
52240
52240
|
throw createManagedIdentityError(unableToReadSecretFile);
|
|
52241
52241
|
}
|
|
@@ -52412,8 +52412,8 @@ Headers: ${JSON.stringify(headers)}`
|
|
|
52412
52412
|
if ((HTTP_STATUS_400_CODES_FOR_EXPONENTIAL_STRATEGY.includes(httpStatusCode) || httpStatusCode >= msalCommon.HttpStatus.SERVER_ERROR_RANGE_START && httpStatusCode <= msalCommon.HttpStatus.SERVER_ERROR_RANGE_END && currentRetry < this.maxRetries) && currentRetry < this.maxRetries) {
|
|
52413
52413
|
const retryAfterDelay = httpStatusCode === msalCommon.HttpStatus.GONE ? _ImdsRetryPolicy.HTTP_STATUS_GONE_RETRY_AFTER_MS : this.exponentialRetryStrategy.calculateDelay(currentRetry);
|
|
52414
52414
|
logger.verbose(`Retrying request in ${retryAfterDelay}ms (retry attempt: ${currentRetry + 1})`);
|
|
52415
|
-
await new Promise((
|
|
52416
|
-
return setTimeout(
|
|
52415
|
+
await new Promise((resolve12) => {
|
|
52416
|
+
return setTimeout(resolve12, retryAfterDelay);
|
|
52417
52417
|
});
|
|
52418
52418
|
return true;
|
|
52419
52419
|
}
|
|
@@ -53479,7 +53479,7 @@ var require_createAbortablePromise = __commonJS({
|
|
|
53479
53479
|
var abort_controller_1 = require_commonjs3();
|
|
53480
53480
|
function createAbortablePromise(buildPromise, options) {
|
|
53481
53481
|
const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options ?? {};
|
|
53482
|
-
return new Promise((
|
|
53482
|
+
return new Promise((resolve12, reject) => {
|
|
53483
53483
|
function rejectOnAbort() {
|
|
53484
53484
|
reject(new abort_controller_1.AbortError(abortErrorMsg ?? "The operation was aborted."));
|
|
53485
53485
|
}
|
|
@@ -53497,7 +53497,7 @@ var require_createAbortablePromise = __commonJS({
|
|
|
53497
53497
|
try {
|
|
53498
53498
|
buildPromise((x) => {
|
|
53499
53499
|
removeListeners();
|
|
53500
|
-
|
|
53500
|
+
resolve12(x);
|
|
53501
53501
|
}, (x) => {
|
|
53502
53502
|
removeListeners();
|
|
53503
53503
|
reject(x);
|
|
@@ -53524,8 +53524,8 @@ var require_delay2 = __commonJS({
|
|
|
53524
53524
|
function delay(timeInMs, options) {
|
|
53525
53525
|
let token;
|
|
53526
53526
|
const { abortSignal, abortErrorMsg } = options ?? {};
|
|
53527
|
-
return (0, createAbortablePromise_js_1.createAbortablePromise)((
|
|
53528
|
-
token = setTimeout(
|
|
53527
|
+
return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve12) => {
|
|
53528
|
+
token = setTimeout(resolve12, timeInMs);
|
|
53529
53529
|
}, {
|
|
53530
53530
|
cleanupBeforeAbort: () => clearTimeout(token),
|
|
53531
53531
|
abortSignal,
|
|
@@ -55360,9 +55360,9 @@ var require_nodeHttpClient = __commonJS({
|
|
|
55360
55360
|
if (stream4.readable === false) {
|
|
55361
55361
|
return Promise.resolve();
|
|
55362
55362
|
}
|
|
55363
|
-
return new Promise((
|
|
55363
|
+
return new Promise((resolve12) => {
|
|
55364
55364
|
const handler = () => {
|
|
55365
|
-
|
|
55365
|
+
resolve12();
|
|
55366
55366
|
stream4.removeListener("close", handler);
|
|
55367
55367
|
stream4.removeListener("end", handler);
|
|
55368
55368
|
stream4.removeListener("error", handler);
|
|
@@ -55517,8 +55517,8 @@ var require_nodeHttpClient = __commonJS({
|
|
|
55517
55517
|
headers: request.headers.toJSON({ preserveCase: true }),
|
|
55518
55518
|
...request.requestOverrides
|
|
55519
55519
|
};
|
|
55520
|
-
return new Promise((
|
|
55521
|
-
const req = isInsecure ? import_node_http.default.request(options,
|
|
55520
|
+
return new Promise((resolve12, reject) => {
|
|
55521
|
+
const req = isInsecure ? import_node_http.default.request(options, resolve12) : import_node_https.default.request(options, resolve12);
|
|
55522
55522
|
req.once("error", (err) => {
|
|
55523
55523
|
reject(
|
|
55524
55524
|
new import_restError.RestError(err.message, { code: err.code ?? import_restError.RestError.REQUEST_SEND_ERROR, request })
|
|
@@ -55606,7 +55606,7 @@ var require_nodeHttpClient = __commonJS({
|
|
|
55606
55606
|
return stream4;
|
|
55607
55607
|
}
|
|
55608
55608
|
function streamToText(stream4) {
|
|
55609
|
-
return new Promise((
|
|
55609
|
+
return new Promise((resolve12, reject) => {
|
|
55610
55610
|
const buffer = [];
|
|
55611
55611
|
stream4.on("data", (chunk) => {
|
|
55612
55612
|
if (Buffer.isBuffer(chunk)) {
|
|
@@ -55616,7 +55616,7 @@ var require_nodeHttpClient = __commonJS({
|
|
|
55616
55616
|
}
|
|
55617
55617
|
});
|
|
55618
55618
|
stream4.on("end", () => {
|
|
55619
|
-
|
|
55619
|
+
resolve12(Buffer.concat(buffer).toString("utf8"));
|
|
55620
55620
|
});
|
|
55621
55621
|
stream4.on("error", (e) => {
|
|
55622
55622
|
if (e && e?.name === "AbortError") {
|
|
@@ -56056,7 +56056,7 @@ var require_helpers = __commonJS({
|
|
|
56056
56056
|
var import_AbortError = require_AbortError2();
|
|
56057
56057
|
var StandardAbortMessage = "The operation was aborted.";
|
|
56058
56058
|
function delay(delayInMs, value, options) {
|
|
56059
|
-
return new Promise((
|
|
56059
|
+
return new Promise((resolve12, reject) => {
|
|
56060
56060
|
let timer = void 0;
|
|
56061
56061
|
let onAborted = void 0;
|
|
56062
56062
|
const rejectOnAbort = () => {
|
|
@@ -56081,7 +56081,7 @@ var require_helpers = __commonJS({
|
|
|
56081
56081
|
}
|
|
56082
56082
|
timer = setTimeout(() => {
|
|
56083
56083
|
removeListeners();
|
|
56084
|
-
|
|
56084
|
+
resolve12(value);
|
|
56085
56085
|
}, delayInMs);
|
|
56086
56086
|
if (options?.abortSignal) {
|
|
56087
56087
|
options.abortSignal.addEventListener("abort", onAborted);
|
|
@@ -56576,8 +56576,8 @@ var require_helpers2 = __commonJS({
|
|
|
56576
56576
|
function req(url2, opts = {}) {
|
|
56577
56577
|
const href = typeof url2 === "string" ? url2 : url2.href;
|
|
56578
56578
|
const req2 = (href.startsWith("https:") ? https3 : http3).request(url2, opts);
|
|
56579
|
-
const promise = new Promise((
|
|
56580
|
-
req2.once("response",
|
|
56579
|
+
const promise = new Promise((resolve12, reject) => {
|
|
56580
|
+
req2.once("response", resolve12).once("error", reject).end();
|
|
56581
56581
|
});
|
|
56582
56582
|
req2.then = promise.then.bind(promise);
|
|
56583
56583
|
return req2;
|
|
@@ -56754,7 +56754,7 @@ var require_parse_proxy_response = __commonJS({
|
|
|
56754
56754
|
var debug_1 = __importDefault2(require_src());
|
|
56755
56755
|
var debug = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
|
|
56756
56756
|
function parseProxyResponse(socket) {
|
|
56757
|
-
return new Promise((
|
|
56757
|
+
return new Promise((resolve12, reject) => {
|
|
56758
56758
|
let buffersLength = 0;
|
|
56759
56759
|
const buffers = [];
|
|
56760
56760
|
function read() {
|
|
@@ -56820,7 +56820,7 @@ var require_parse_proxy_response = __commonJS({
|
|
|
56820
56820
|
}
|
|
56821
56821
|
debug("got proxy server response: %o %o", firstLine, headers);
|
|
56822
56822
|
cleanup();
|
|
56823
|
-
|
|
56823
|
+
resolve12({
|
|
56824
56824
|
connect: {
|
|
56825
56825
|
statusCode,
|
|
56826
56826
|
statusText,
|
|
@@ -58614,8 +58614,8 @@ var require_getClient = __commonJS({
|
|
|
58614
58614
|
}
|
|
58615
58615
|
const { allowInsecureConnection, httpClient } = clientOptions;
|
|
58616
58616
|
const endpointUrl = clientOptions.endpoint ?? endpoint;
|
|
58617
|
-
const client = (
|
|
58618
|
-
const getUrl = (requestOptions) => (0, import_urlHelpers.buildRequestUrl)(endpointUrl,
|
|
58617
|
+
const client = (path14, ...args) => {
|
|
58618
|
+
const getUrl = (requestOptions) => (0, import_urlHelpers.buildRequestUrl)(endpointUrl, path14, args, { allowInsecureConnection, ...requestOptions });
|
|
58619
58619
|
return {
|
|
58620
58620
|
get: (requestOptions = {}) => {
|
|
58621
58621
|
return buildOperation(
|
|
@@ -61520,15 +61520,15 @@ var require_urlHelpers2 = __commonJS({
|
|
|
61520
61520
|
let isAbsolutePath = false;
|
|
61521
61521
|
let requestUrl = replaceAll(baseUri, urlReplacements);
|
|
61522
61522
|
if (operationSpec.path) {
|
|
61523
|
-
let
|
|
61524
|
-
if (operationSpec.path === "/{nextLink}" &&
|
|
61525
|
-
|
|
61523
|
+
let path14 = replaceAll(operationSpec.path, urlReplacements);
|
|
61524
|
+
if (operationSpec.path === "/{nextLink}" && path14.startsWith("/")) {
|
|
61525
|
+
path14 = path14.substring(1);
|
|
61526
61526
|
}
|
|
61527
|
-
if (isAbsoluteUrl(
|
|
61528
|
-
requestUrl =
|
|
61527
|
+
if (isAbsoluteUrl(path14)) {
|
|
61528
|
+
requestUrl = path14;
|
|
61529
61529
|
isAbsolutePath = true;
|
|
61530
61530
|
} else {
|
|
61531
|
-
requestUrl = appendPath(requestUrl,
|
|
61531
|
+
requestUrl = appendPath(requestUrl, path14);
|
|
61532
61532
|
}
|
|
61533
61533
|
}
|
|
61534
61534
|
const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject);
|
|
@@ -61574,9 +61574,9 @@ var require_urlHelpers2 = __commonJS({
|
|
|
61574
61574
|
}
|
|
61575
61575
|
const searchStart = pathToAppend.indexOf("?");
|
|
61576
61576
|
if (searchStart !== -1) {
|
|
61577
|
-
const
|
|
61577
|
+
const path14 = pathToAppend.substring(0, searchStart);
|
|
61578
61578
|
const search = pathToAppend.substring(searchStart + 1);
|
|
61579
|
-
newPath = newPath +
|
|
61579
|
+
newPath = newPath + path14;
|
|
61580
61580
|
if (search) {
|
|
61581
61581
|
parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search;
|
|
61582
61582
|
}
|
|
@@ -62886,7 +62886,7 @@ function detectPlatformBinary({ [platform]: platformBinary }, { wsl }) {
|
|
|
62886
62886
|
}
|
|
62887
62887
|
return detectArchBinary(platformBinary);
|
|
62888
62888
|
}
|
|
62889
|
-
var import_node_process7, import_node_buffer, import_node_path, import_node_url, import_node_util5, import_node_child_process5, import_promises2, import_meta, execFile5,
|
|
62889
|
+
var import_node_process7, import_node_buffer, import_node_path, import_node_url, import_node_util5, import_node_child_process5, import_promises2, import_meta, execFile5, __dirname2, localXdgOpenPath, platform, arch, pTryEach, baseOpen, open, openApp, apps, open_default;
|
|
62890
62890
|
var init_open = __esm({
|
|
62891
62891
|
"node_modules/open/index.js"() {
|
|
62892
62892
|
import_node_process7 = __toESM(require("node:process"), 1);
|
|
@@ -62902,8 +62902,8 @@ var init_open = __esm({
|
|
|
62902
62902
|
init_is_inside_container();
|
|
62903
62903
|
import_meta = {};
|
|
62904
62904
|
execFile5 = (0, import_node_util5.promisify)(import_node_child_process5.default.execFile);
|
|
62905
|
-
|
|
62906
|
-
localXdgOpenPath = import_node_path.default.join(
|
|
62905
|
+
__dirname2 = import_node_path.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url));
|
|
62906
|
+
localXdgOpenPath = import_node_path.default.join(__dirname2, "xdg-open");
|
|
62907
62907
|
({ platform, arch } = import_node_process7.default);
|
|
62908
62908
|
pTryEach = async (array, mapper) => {
|
|
62909
62909
|
let latestError;
|
|
@@ -63025,7 +63025,7 @@ var init_open = __esm({
|
|
|
63025
63025
|
if (app) {
|
|
63026
63026
|
command = app;
|
|
63027
63027
|
} else {
|
|
63028
|
-
const isBundled = !
|
|
63028
|
+
const isBundled = !__dirname2 || __dirname2 === "/";
|
|
63029
63029
|
let exeLocalXdgOpen = false;
|
|
63030
63030
|
try {
|
|
63031
63031
|
await import_promises2.default.access(localXdgOpenPath, import_promises2.constants.X_OK);
|
|
@@ -63051,14 +63051,14 @@ var init_open = __esm({
|
|
|
63051
63051
|
}
|
|
63052
63052
|
const subprocess = import_node_child_process5.default.spawn(command, cliArguments, childProcessOptions);
|
|
63053
63053
|
if (options.wait) {
|
|
63054
|
-
return new Promise((
|
|
63054
|
+
return new Promise((resolve12, reject) => {
|
|
63055
63055
|
subprocess.once("error", reject);
|
|
63056
63056
|
subprocess.once("close", (exitCode) => {
|
|
63057
63057
|
if (!options.allowNonzeroExitCode && exitCode > 0) {
|
|
63058
63058
|
reject(new Error(`Exited with code ${exitCode}`));
|
|
63059
63059
|
return;
|
|
63060
63060
|
}
|
|
63061
|
-
|
|
63061
|
+
resolve12(subprocess);
|
|
63062
63062
|
});
|
|
63063
63063
|
});
|
|
63064
63064
|
}
|
|
@@ -64550,7 +64550,7 @@ var require_azureDeveloperCliCredential = __commonJS({
|
|
|
64550
64550
|
const encodedClaims = btoa(claims);
|
|
64551
64551
|
claimsSections = ["--claims", encodedClaims];
|
|
64552
64552
|
}
|
|
64553
|
-
return new Promise((
|
|
64553
|
+
return new Promise((resolve12, reject) => {
|
|
64554
64554
|
try {
|
|
64555
64555
|
const args = [
|
|
64556
64556
|
"auth",
|
|
@@ -64567,7 +64567,7 @@ var require_azureDeveloperCliCredential = __commonJS({
|
|
|
64567
64567
|
cwd: exports2.developerCliCredentialInternals.getSafeWorkingDir(),
|
|
64568
64568
|
timeout
|
|
64569
64569
|
}, (error, stdout, stderr) => {
|
|
64570
|
-
|
|
64570
|
+
resolve12({ stdout, stderr, error });
|
|
64571
64571
|
});
|
|
64572
64572
|
} catch (err) {
|
|
64573
64573
|
reject(err);
|
|
@@ -64736,7 +64736,7 @@ var require_azureCliCredential = __commonJS({
|
|
|
64736
64736
|
if (subscription) {
|
|
64737
64737
|
subscriptionSection = ["--subscription", `"${subscription}"`];
|
|
64738
64738
|
}
|
|
64739
|
-
return new Promise((
|
|
64739
|
+
return new Promise((resolve12, reject) => {
|
|
64740
64740
|
try {
|
|
64741
64741
|
const args = [
|
|
64742
64742
|
"account",
|
|
@@ -64750,7 +64750,7 @@ var require_azureCliCredential = __commonJS({
|
|
|
64750
64750
|
];
|
|
64751
64751
|
const command = ["az", ...args].join(" ");
|
|
64752
64752
|
child_process_1.default.exec(command, { cwd: exports2.cliCredentialInternals.getSafeWorkingDir(), timeout }, (error, stdout, stderr) => {
|
|
64753
|
-
|
|
64753
|
+
resolve12({ stdout, stderr, error });
|
|
64754
64754
|
});
|
|
64755
64755
|
} catch (err) {
|
|
64756
64756
|
reject(err);
|
|
@@ -64900,7 +64900,7 @@ var require_processUtils = __commonJS({
|
|
|
64900
64900
|
* @internal
|
|
64901
64901
|
*/
|
|
64902
64902
|
execFile(file, params, options) {
|
|
64903
|
-
return new Promise((
|
|
64903
|
+
return new Promise((resolve12, reject) => {
|
|
64904
64904
|
node_child_process_1.default.execFile(file, params, options, (error, stdout, stderr) => {
|
|
64905
64905
|
if (Buffer.isBuffer(stdout)) {
|
|
64906
64906
|
stdout = stdout.toString("utf8");
|
|
@@ -64911,7 +64911,7 @@ var require_processUtils = __commonJS({
|
|
|
64911
64911
|
if (stderr || error) {
|
|
64912
64912
|
reject(stderr ? new Error(stderr) : error);
|
|
64913
64913
|
} else {
|
|
64914
|
-
|
|
64914
|
+
resolve12(stdout);
|
|
64915
64915
|
}
|
|
64916
64916
|
});
|
|
64917
64917
|
});
|
|
@@ -66589,7 +66589,7 @@ var require_sender = __commonJS({
|
|
|
66589
66589
|
}
|
|
66590
66590
|
async function sendInParallel(addresses, port, request, signal) {
|
|
66591
66591
|
signal.throwIfAborted();
|
|
66592
|
-
return await new Promise((
|
|
66592
|
+
return await new Promise((resolve12, reject) => {
|
|
66593
66593
|
const sockets = [];
|
|
66594
66594
|
let errorCount = 0;
|
|
66595
66595
|
const onError = (err) => {
|
|
@@ -66603,7 +66603,7 @@ var require_sender = __commonJS({
|
|
|
66603
66603
|
const onMessage = (message) => {
|
|
66604
66604
|
signal.removeEventListener("abort", onAbort);
|
|
66605
66605
|
clearSockets();
|
|
66606
|
-
|
|
66606
|
+
resolve12(message);
|
|
66607
66607
|
};
|
|
66608
66608
|
const onAbort = () => {
|
|
66609
66609
|
clearSockets();
|
|
@@ -66638,7 +66638,7 @@ var require_sender = __commonJS({
|
|
|
66638
66638
|
family: _net.default.isIPv6(host) ? 6 : 4
|
|
66639
66639
|
}];
|
|
66640
66640
|
} else {
|
|
66641
|
-
addresses = await new Promise((
|
|
66641
|
+
addresses = await new Promise((resolve12, reject) => {
|
|
66642
66642
|
const onAbort = () => {
|
|
66643
66643
|
reject(signal.reason);
|
|
66644
66644
|
};
|
|
@@ -66647,7 +66647,7 @@ var require_sender = __commonJS({
|
|
|
66647
66647
|
all: true
|
|
66648
66648
|
}, (err, addresses2) => {
|
|
66649
66649
|
signal.removeEventListener("abort", onAbort);
|
|
66650
|
-
err ? reject(err) :
|
|
66650
|
+
err ? reject(err) : resolve12(addresses2);
|
|
66651
66651
|
});
|
|
66652
66652
|
});
|
|
66653
66653
|
}
|
|
@@ -70122,25 +70122,25 @@ var require_util2 = __commonJS({
|
|
|
70122
70122
|
};
|
|
70123
70123
|
},
|
|
70124
70124
|
createDeferredPromise: function() {
|
|
70125
|
-
let
|
|
70125
|
+
let resolve12;
|
|
70126
70126
|
let reject;
|
|
70127
70127
|
const promise = new Promise((res, rej) => {
|
|
70128
|
-
|
|
70128
|
+
resolve12 = res;
|
|
70129
70129
|
reject = rej;
|
|
70130
70130
|
});
|
|
70131
70131
|
return {
|
|
70132
70132
|
promise,
|
|
70133
|
-
resolve:
|
|
70133
|
+
resolve: resolve12,
|
|
70134
70134
|
reject
|
|
70135
70135
|
};
|
|
70136
70136
|
},
|
|
70137
70137
|
promisify(fn) {
|
|
70138
|
-
return new Promise((
|
|
70138
|
+
return new Promise((resolve12, reject) => {
|
|
70139
70139
|
fn((err, ...args) => {
|
|
70140
70140
|
if (err) {
|
|
70141
70141
|
return reject(err);
|
|
70142
70142
|
}
|
|
70143
|
-
return
|
|
70143
|
+
return resolve12(...args);
|
|
70144
70144
|
});
|
|
70145
70145
|
});
|
|
70146
70146
|
},
|
|
@@ -70931,7 +70931,7 @@ var require_end_of_stream = __commonJS({
|
|
|
70931
70931
|
validateBoolean(opts.cleanup, "cleanup");
|
|
70932
70932
|
autoCleanup = opts.cleanup;
|
|
70933
70933
|
}
|
|
70934
|
-
return new Promise2((
|
|
70934
|
+
return new Promise2((resolve12, reject) => {
|
|
70935
70935
|
const cleanup = eos(stream4, opts, (err) => {
|
|
70936
70936
|
if (autoCleanup) {
|
|
70937
70937
|
cleanup();
|
|
@@ -70939,7 +70939,7 @@ var require_end_of_stream = __commonJS({
|
|
|
70939
70939
|
if (err) {
|
|
70940
70940
|
reject(err);
|
|
70941
70941
|
} else {
|
|
70942
|
-
|
|
70942
|
+
resolve12();
|
|
70943
70943
|
}
|
|
70944
70944
|
});
|
|
70945
70945
|
});
|
|
@@ -72105,7 +72105,7 @@ var require_readable = __commonJS({
|
|
|
72105
72105
|
error = this.readableEnded ? null : new AbortError2();
|
|
72106
72106
|
this.destroy(error);
|
|
72107
72107
|
}
|
|
72108
|
-
return new Promise2((
|
|
72108
|
+
return new Promise2((resolve12, reject) => eos(this, (err) => err && err !== error ? reject(err) : resolve12(null)));
|
|
72109
72109
|
};
|
|
72110
72110
|
Readable2.prototype.push = function(chunk, encoding) {
|
|
72111
72111
|
return readableAddChunk(this, chunk, encoding, false);
|
|
@@ -72649,12 +72649,12 @@ var require_readable = __commonJS({
|
|
|
72649
72649
|
}
|
|
72650
72650
|
async function* createAsyncIterator(stream4, options) {
|
|
72651
72651
|
let callback = nop;
|
|
72652
|
-
function next(
|
|
72652
|
+
function next(resolve12) {
|
|
72653
72653
|
if (this === stream4) {
|
|
72654
72654
|
callback();
|
|
72655
72655
|
callback = nop;
|
|
72656
72656
|
} else {
|
|
72657
|
-
callback =
|
|
72657
|
+
callback = resolve12;
|
|
72658
72658
|
}
|
|
72659
72659
|
}
|
|
72660
72660
|
stream4.on("readable", next);
|
|
@@ -73706,7 +73706,7 @@ var require_duplexify = __commonJS({
|
|
|
73706
73706
|
);
|
|
73707
73707
|
};
|
|
73708
73708
|
function fromAsyncGen(fn) {
|
|
73709
|
-
let { promise, resolve:
|
|
73709
|
+
let { promise, resolve: resolve12 } = createDeferredPromise();
|
|
73710
73710
|
const ac = new AbortController2();
|
|
73711
73711
|
const signal = ac.signal;
|
|
73712
73712
|
const value = fn(
|
|
@@ -73721,7 +73721,7 @@ var require_duplexify = __commonJS({
|
|
|
73721
73721
|
throw new AbortError2(void 0, {
|
|
73722
73722
|
cause: signal.reason
|
|
73723
73723
|
});
|
|
73724
|
-
({ promise, resolve:
|
|
73724
|
+
({ promise, resolve: resolve12 } = createDeferredPromise());
|
|
73725
73725
|
yield chunk;
|
|
73726
73726
|
}
|
|
73727
73727
|
})(),
|
|
@@ -73732,8 +73732,8 @@ var require_duplexify = __commonJS({
|
|
|
73732
73732
|
return {
|
|
73733
73733
|
value,
|
|
73734
73734
|
write(chunk, encoding, cb) {
|
|
73735
|
-
const _resolve =
|
|
73736
|
-
|
|
73735
|
+
const _resolve = resolve12;
|
|
73736
|
+
resolve12 = null;
|
|
73737
73737
|
_resolve({
|
|
73738
73738
|
chunk,
|
|
73739
73739
|
done: false,
|
|
@@ -73741,8 +73741,8 @@ var require_duplexify = __commonJS({
|
|
|
73741
73741
|
});
|
|
73742
73742
|
},
|
|
73743
73743
|
final(cb) {
|
|
73744
|
-
const _resolve =
|
|
73745
|
-
|
|
73744
|
+
const _resolve = resolve12;
|
|
73745
|
+
resolve12 = null;
|
|
73746
73746
|
_resolve({
|
|
73747
73747
|
done: true,
|
|
73748
73748
|
cb
|
|
@@ -74193,7 +74193,7 @@ var require_pipeline4 = __commonJS({
|
|
|
74193
74193
|
callback();
|
|
74194
74194
|
}
|
|
74195
74195
|
};
|
|
74196
|
-
const wait = () => new Promise2((
|
|
74196
|
+
const wait = () => new Promise2((resolve12, reject) => {
|
|
74197
74197
|
if (error) {
|
|
74198
74198
|
reject(error);
|
|
74199
74199
|
} else {
|
|
@@ -74201,7 +74201,7 @@ var require_pipeline4 = __commonJS({
|
|
|
74201
74201
|
if (error) {
|
|
74202
74202
|
reject(error);
|
|
74203
74203
|
} else {
|
|
74204
|
-
|
|
74204
|
+
resolve12();
|
|
74205
74205
|
}
|
|
74206
74206
|
};
|
|
74207
74207
|
}
|
|
@@ -74845,8 +74845,8 @@ var require_operators = __commonJS({
|
|
|
74845
74845
|
next = null;
|
|
74846
74846
|
}
|
|
74847
74847
|
if (!done && (queue.length >= highWaterMark || cnt >= concurrency)) {
|
|
74848
|
-
await new Promise2((
|
|
74849
|
-
resume =
|
|
74848
|
+
await new Promise2((resolve12) => {
|
|
74849
|
+
resume = resolve12;
|
|
74850
74850
|
});
|
|
74851
74851
|
}
|
|
74852
74852
|
}
|
|
@@ -74880,8 +74880,8 @@ var require_operators = __commonJS({
|
|
|
74880
74880
|
queue.shift();
|
|
74881
74881
|
maybeResume();
|
|
74882
74882
|
}
|
|
74883
|
-
await new Promise2((
|
|
74884
|
-
next =
|
|
74883
|
+
await new Promise2((resolve12) => {
|
|
74884
|
+
next = resolve12;
|
|
74885
74885
|
});
|
|
74886
74886
|
}
|
|
74887
74887
|
} finally {
|
|
@@ -75139,7 +75139,7 @@ var require_promises = __commonJS({
|
|
|
75139
75139
|
var { finished } = require_end_of_stream();
|
|
75140
75140
|
require_stream2();
|
|
75141
75141
|
function pipeline(...streams) {
|
|
75142
|
-
return new Promise2((
|
|
75142
|
+
return new Promise2((resolve12, reject) => {
|
|
75143
75143
|
let signal;
|
|
75144
75144
|
let end;
|
|
75145
75145
|
const lastArg = streams[streams.length - 1];
|
|
@@ -75154,7 +75154,7 @@ var require_promises = __commonJS({
|
|
|
75154
75154
|
if (err) {
|
|
75155
75155
|
reject(err);
|
|
75156
75156
|
} else {
|
|
75157
|
-
|
|
75157
|
+
resolve12(value);
|
|
75158
75158
|
}
|
|
75159
75159
|
},
|
|
75160
75160
|
{
|
|
@@ -76021,7 +76021,7 @@ var require_message_io = __commonJS({
|
|
|
76021
76021
|
credentialsDetails.maxVersion = "TLSv1.2";
|
|
76022
76022
|
}
|
|
76023
76023
|
const secureContext = tls.createSecureContext(credentialsDetails);
|
|
76024
|
-
return new Promise((
|
|
76024
|
+
return new Promise((resolve12, reject) => {
|
|
76025
76025
|
const duplexpair = new _nativeDuplexpair.default();
|
|
76026
76026
|
const securePair = this.securePair = {
|
|
76027
76027
|
cleartext: tls.connect({
|
|
@@ -76052,7 +76052,7 @@ var require_message_io = __commonJS({
|
|
|
76052
76052
|
securePair.cleartext.pipe(this.incomingMessageStream);
|
|
76053
76053
|
this.outgoingMessageStream.pipe(securePair.cleartext);
|
|
76054
76054
|
this.tlsNegotiationComplete = true;
|
|
76055
|
-
|
|
76055
|
+
resolve12();
|
|
76056
76056
|
};
|
|
76057
76057
|
const onError = (err) => {
|
|
76058
76058
|
securePair.encrypted.removeListener("readable", onReadable);
|
|
@@ -79547,7 +79547,7 @@ var require_js_joda = __commonJS({
|
|
|
79547
79547
|
this.fieldValues.put(field, value);
|
|
79548
79548
|
return this;
|
|
79549
79549
|
};
|
|
79550
|
-
_proto.resolve = function
|
|
79550
|
+
_proto.resolve = function resolve12(resolverStyle, resolverFields) {
|
|
79551
79551
|
if (resolverFields != null) {
|
|
79552
79552
|
this.fieldValues.retainAll(resolverFields);
|
|
79553
79553
|
}
|
|
@@ -80151,7 +80151,7 @@ var require_js_joda = __commonJS({
|
|
|
80151
80151
|
_proto.displayName = function displayName() {
|
|
80152
80152
|
return this.toString();
|
|
80153
80153
|
};
|
|
80154
|
-
_proto.resolve = function
|
|
80154
|
+
_proto.resolve = function resolve12() {
|
|
80155
80155
|
return null;
|
|
80156
80156
|
};
|
|
80157
80157
|
_proto.name = function name() {
|
|
@@ -80209,7 +80209,7 @@ var require_js_joda = __commonJS({
|
|
|
80209
80209
|
this.range().checkValidValue(newValue, this);
|
|
80210
80210
|
return temporal.with(ChronoField.DAY_OF_YEAR, temporal.getLong(ChronoField.DAY_OF_YEAR) + (newValue - curValue));
|
|
80211
80211
|
};
|
|
80212
|
-
_proto2.resolve = function
|
|
80212
|
+
_proto2.resolve = function resolve12(fieldValues, partialTemporal, resolverStyle) {
|
|
80213
80213
|
var yearLong = fieldValues.get(ChronoField.YEAR);
|
|
80214
80214
|
var qoyLong = fieldValues.get(QUARTER_OF_YEAR);
|
|
80215
80215
|
if (yearLong == null || qoyLong == null) {
|
|
@@ -80320,7 +80320,7 @@ var require_js_joda = __commonJS({
|
|
|
80320
80320
|
this.range().checkValidValue(newValue, this);
|
|
80321
80321
|
return temporal.plus(MathUtil.safeSubtract(newValue, this.getFrom(temporal)), ChronoUnit.WEEKS);
|
|
80322
80322
|
};
|
|
80323
|
-
_proto4.resolve = function
|
|
80323
|
+
_proto4.resolve = function resolve12(fieldValues, partialTemporal, resolverStyle) {
|
|
80324
80324
|
var wbyLong = fieldValues.get(WEEK_BASED_YEAR);
|
|
80325
80325
|
var dowLong = fieldValues.get(ChronoField.DAY_OF_WEEK);
|
|
80326
80326
|
if (wbyLong == null || dowLong == null) {
|
|
@@ -96392,7 +96392,7 @@ var require_connector = __commonJS({
|
|
|
96392
96392
|
async function connectInParallel(options, lookup, signal) {
|
|
96393
96393
|
signal.throwIfAborted();
|
|
96394
96394
|
const addresses = await lookupAllAddresses(options.host, lookup, signal);
|
|
96395
|
-
return await new Promise((
|
|
96395
|
+
return await new Promise((resolve12, reject) => {
|
|
96396
96396
|
const sockets = new Array(addresses.length);
|
|
96397
96397
|
const errors = [];
|
|
96398
96398
|
function onError(err) {
|
|
@@ -96416,7 +96416,7 @@ var require_connector = __commonJS({
|
|
|
96416
96416
|
socket.removeListener("connect", onConnect);
|
|
96417
96417
|
socket.destroy();
|
|
96418
96418
|
}
|
|
96419
|
-
|
|
96419
|
+
resolve12(this);
|
|
96420
96420
|
}
|
|
96421
96421
|
const onAbort = () => {
|
|
96422
96422
|
for (let j = 0; j < sockets.length; j++) {
|
|
@@ -96447,7 +96447,7 @@ var require_connector = __commonJS({
|
|
|
96447
96447
|
const addresses = await lookupAllAddresses(options.host, lookup, signal);
|
|
96448
96448
|
for (const address of addresses) {
|
|
96449
96449
|
try {
|
|
96450
|
-
return await new Promise((
|
|
96450
|
+
return await new Promise((resolve12, reject) => {
|
|
96451
96451
|
const socket = _net.default.connect({
|
|
96452
96452
|
...options,
|
|
96453
96453
|
host: address.address,
|
|
@@ -96470,7 +96470,7 @@ var require_connector = __commonJS({
|
|
|
96470
96470
|
signal.removeEventListener("abort", onAbort);
|
|
96471
96471
|
socket.removeListener("error", onError);
|
|
96472
96472
|
socket.removeListener("connect", onConnect);
|
|
96473
|
-
|
|
96473
|
+
resolve12(socket);
|
|
96474
96474
|
};
|
|
96475
96475
|
signal.addEventListener("abort", onAbort, {
|
|
96476
96476
|
once: true
|
|
@@ -96499,7 +96499,7 @@ var require_connector = __commonJS({
|
|
|
96499
96499
|
family: 4
|
|
96500
96500
|
}];
|
|
96501
96501
|
} else {
|
|
96502
|
-
return await new Promise((
|
|
96502
|
+
return await new Promise((resolve12, reject) => {
|
|
96503
96503
|
const onAbort = () => {
|
|
96504
96504
|
reject(signal.reason);
|
|
96505
96505
|
};
|
|
@@ -96509,7 +96509,7 @@ var require_connector = __commonJS({
|
|
|
96509
96509
|
all: true
|
|
96510
96510
|
}, (err, addresses) => {
|
|
96511
96511
|
signal.removeEventListener("abort", onAbort);
|
|
96512
|
-
err ? reject(err) :
|
|
96512
|
+
err ? reject(err) : resolve12(addresses);
|
|
96513
96513
|
});
|
|
96514
96514
|
});
|
|
96515
96515
|
}
|
|
@@ -97295,15 +97295,15 @@ var require_connection2 = __commonJS({
|
|
|
97295
97295
|
var DEFAULT_LANGUAGE = "us_english";
|
|
97296
97296
|
var DEFAULT_DATEFORMAT = "mdy";
|
|
97297
97297
|
function withResolvers() {
|
|
97298
|
-
let
|
|
97298
|
+
let resolve12;
|
|
97299
97299
|
let reject;
|
|
97300
97300
|
const promise = new Promise((res, rej) => {
|
|
97301
|
-
|
|
97301
|
+
resolve12 = res;
|
|
97302
97302
|
reject = rej;
|
|
97303
97303
|
});
|
|
97304
97304
|
return {
|
|
97305
97305
|
promise,
|
|
97306
|
-
resolve:
|
|
97306
|
+
resolve: resolve12,
|
|
97307
97307
|
reject
|
|
97308
97308
|
};
|
|
97309
97309
|
}
|
|
@@ -98294,7 +98294,7 @@ var require_connection2 = __commonJS({
|
|
|
98294
98294
|
};
|
|
98295
98295
|
const {
|
|
98296
98296
|
promise,
|
|
98297
|
-
resolve:
|
|
98297
|
+
resolve: resolve12,
|
|
98298
98298
|
reject
|
|
98299
98299
|
} = withResolvers();
|
|
98300
98300
|
const encryptsocket = tls.connect(encryptOptions);
|
|
@@ -98308,7 +98308,7 @@ var require_connection2 = __commonJS({
|
|
|
98308
98308
|
try {
|
|
98309
98309
|
const onError = reject;
|
|
98310
98310
|
const onConnect = () => {
|
|
98311
|
-
|
|
98311
|
+
resolve12(encryptsocket);
|
|
98312
98312
|
};
|
|
98313
98313
|
encryptsocket.once("error", onError);
|
|
98314
98314
|
encryptsocket.once("secureConnect", onConnect);
|
|
@@ -99351,9 +99351,9 @@ var require_connection2 = __commonJS({
|
|
|
99351
99351
|
this.debug.log("Retry after transient failure connecting to " + server + ":" + port);
|
|
99352
99352
|
const {
|
|
99353
99353
|
promise,
|
|
99354
|
-
resolve:
|
|
99354
|
+
resolve: resolve12
|
|
99355
99355
|
} = withResolvers();
|
|
99356
|
-
setTimeout(
|
|
99356
|
+
setTimeout(resolve12, this.config.options.connectionRetryInterval);
|
|
99357
99357
|
await promise;
|
|
99358
99358
|
this.emit("retry");
|
|
99359
99359
|
this.transitionTo(this.STATE.CONNECTING);
|
|
@@ -99863,15 +99863,15 @@ var require_connection_pool2 = __commonJS({
|
|
|
99863
99863
|
return cfg;
|
|
99864
99864
|
}
|
|
99865
99865
|
_poolCreate() {
|
|
99866
|
-
return new shared.Promise((
|
|
99866
|
+
return new shared.Promise((resolve12, reject) => {
|
|
99867
99867
|
const resolveOnce = (v) => {
|
|
99868
|
-
|
|
99869
|
-
|
|
99868
|
+
resolve12(v);
|
|
99869
|
+
resolve12 = reject = () => {
|
|
99870
99870
|
};
|
|
99871
99871
|
};
|
|
99872
99872
|
const rejectOnce = (e) => {
|
|
99873
99873
|
reject(e);
|
|
99874
|
-
|
|
99874
|
+
resolve12 = reject = () => {
|
|
99875
99875
|
};
|
|
99876
99876
|
};
|
|
99877
99877
|
let tedious;
|
|
@@ -99915,9 +99915,9 @@ var require_connection_pool2 = __commonJS({
|
|
|
99915
99915
|
}
|
|
99916
99916
|
_poolValidate(tedious) {
|
|
99917
99917
|
if (tedious && !tedious.closed && !tedious.hasError) {
|
|
99918
|
-
return !this.config.validateConnection || new shared.Promise((
|
|
99918
|
+
return !this.config.validateConnection || new shared.Promise((resolve12) => {
|
|
99919
99919
|
const req = new tds.Request("SELECT 1;", (err) => {
|
|
99920
|
-
|
|
99920
|
+
resolve12(!err);
|
|
99921
99921
|
});
|
|
99922
99922
|
tedious.execSql(req);
|
|
99923
99923
|
});
|
|
@@ -99925,19 +99925,19 @@ var require_connection_pool2 = __commonJS({
|
|
|
99925
99925
|
return false;
|
|
99926
99926
|
}
|
|
99927
99927
|
_poolDestroy(tedious) {
|
|
99928
|
-
return new shared.Promise((
|
|
99928
|
+
return new shared.Promise((resolve12, reject) => {
|
|
99929
99929
|
if (!tedious) {
|
|
99930
|
-
|
|
99930
|
+
resolve12();
|
|
99931
99931
|
return;
|
|
99932
99932
|
}
|
|
99933
99933
|
debug("connection(%d): destroying", IDS.get(tedious));
|
|
99934
99934
|
if (tedious.closed) {
|
|
99935
99935
|
debug("connection(%d): already closed", IDS.get(tedious));
|
|
99936
|
-
|
|
99936
|
+
resolve12();
|
|
99937
99937
|
} else {
|
|
99938
99938
|
tedious.once("end", () => {
|
|
99939
99939
|
debug("connection(%d): destroyed", IDS.get(tedious));
|
|
99940
|
-
|
|
99940
|
+
resolve12();
|
|
99941
99941
|
});
|
|
99942
99942
|
tedious.close();
|
|
99943
99943
|
}
|
|
@@ -101720,19 +101720,19 @@ var init_source = __esm({
|
|
|
101720
101720
|
});
|
|
101721
101721
|
|
|
101722
101722
|
// src/cli.ts
|
|
101723
|
-
var
|
|
101723
|
+
var fs17 = __toESM(require("fs"));
|
|
101724
101724
|
var fsPromises = __toESM(require("fs/promises"));
|
|
101725
|
-
var
|
|
101725
|
+
var path13 = __toESM(require("path"));
|
|
101726
101726
|
|
|
101727
101727
|
// src/parser.ts
|
|
101728
101728
|
var path = __toESM(require("path"));
|
|
101729
101729
|
|
|
101730
101730
|
// src/nornapiParser.ts
|
|
101731
|
-
function extractPathParameters(
|
|
101731
|
+
function extractPathParameters(path14) {
|
|
101732
101732
|
const params = [];
|
|
101733
101733
|
const regex = /(?<!\{)\{([a-zA-Z_][a-zA-Z0-9_]*)\}(?!\})/g;
|
|
101734
101734
|
let match;
|
|
101735
|
-
while ((match = regex.exec(
|
|
101735
|
+
while ((match = regex.exec(path14)) !== null) {
|
|
101736
101736
|
params.push(match[1]);
|
|
101737
101737
|
}
|
|
101738
101738
|
return params;
|
|
@@ -101782,12 +101782,12 @@ function parseNornApiFile(content) {
|
|
|
101782
101782
|
if (inEndpointsBlock) {
|
|
101783
101783
|
const endpointMatch = trimmed.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\s*:\s*(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)\s+(.+)$/i);
|
|
101784
101784
|
if (endpointMatch) {
|
|
101785
|
-
const
|
|
101785
|
+
const path14 = endpointMatch[3].trim();
|
|
101786
101786
|
endpoints.push({
|
|
101787
101787
|
name: endpointMatch[1],
|
|
101788
101788
|
method: endpointMatch[2].toUpperCase(),
|
|
101789
|
-
path:
|
|
101790
|
-
parameters: extractPathParameters(
|
|
101789
|
+
path: path14,
|
|
101790
|
+
parameters: extractPathParameters(path14)
|
|
101791
101791
|
});
|
|
101792
101792
|
}
|
|
101793
101793
|
continue;
|
|
@@ -101801,6 +101801,16 @@ function getHeaderGroup(definition, name) {
|
|
|
101801
101801
|
function getEndpoint(definition, name) {
|
|
101802
101802
|
return definition.endpoints.find((ep) => ep.name === name);
|
|
101803
101803
|
}
|
|
101804
|
+
function resolveEndpointPath(endpoint, params) {
|
|
101805
|
+
let resolvedPath = endpoint.path;
|
|
101806
|
+
for (const paramName of endpoint.parameters) {
|
|
101807
|
+
const value = params[paramName];
|
|
101808
|
+
if (value !== void 0) {
|
|
101809
|
+
resolvedPath = resolvedPath.replace(`{${paramName}}`, value);
|
|
101810
|
+
}
|
|
101811
|
+
}
|
|
101812
|
+
return resolvedPath;
|
|
101813
|
+
}
|
|
101804
101814
|
function resolveHeaderValues(headerGroup, variables) {
|
|
101805
101815
|
const resolved = {};
|
|
101806
101816
|
for (const [name, value] of Object.entries(headerGroup.headers)) {
|
|
@@ -102283,7 +102293,7 @@ function extractNamedRequests(text) {
|
|
|
102283
102293
|
let endLine = lines.length - 1;
|
|
102284
102294
|
for (let j = contentStartLine; j < lines.length; j++) {
|
|
102285
102295
|
const scanLine = lines[j].trim();
|
|
102286
|
-
if (scanLine
|
|
102296
|
+
if (isNamedRequestDeclarationLine(scanLine) || isSequenceStartDeclaration(scanLine) || isSequenceEndDeclaration(scanLine) || scanLine.startsWith("###")) {
|
|
102287
102297
|
endLine = j - 1;
|
|
102288
102298
|
break;
|
|
102289
102299
|
}
|
|
@@ -102359,11 +102369,11 @@ function extractFileLevelVariables(text) {
|
|
|
102359
102369
|
}
|
|
102360
102370
|
return variables;
|
|
102361
102371
|
}
|
|
102362
|
-
function getNestedValue(obj,
|
|
102363
|
-
if (!
|
|
102372
|
+
function getNestedValue(obj, path14) {
|
|
102373
|
+
if (!path14 || obj === null || obj === void 0) {
|
|
102364
102374
|
return obj;
|
|
102365
102375
|
}
|
|
102366
|
-
const parts =
|
|
102376
|
+
const parts = path14.replace(/\[(\d+)\]/g, ".$1").split(".").filter((p) => p !== "");
|
|
102367
102377
|
let current = obj;
|
|
102368
102378
|
for (const part of parts) {
|
|
102369
102379
|
if (current === null || current === void 0) {
|
|
@@ -102415,8 +102425,8 @@ function substituteVariables(text, variables) {
|
|
|
102415
102425
|
const value = variables[varName];
|
|
102416
102426
|
if (typeof value === "object" && value !== null) {
|
|
102417
102427
|
if (pathPart) {
|
|
102418
|
-
const
|
|
102419
|
-
const nestedValue = getNestedValue(value,
|
|
102428
|
+
const path14 = pathPart.replace(/^\./, "");
|
|
102429
|
+
const nestedValue = getNestedValue(value, path14);
|
|
102420
102430
|
if (nestedValue === void 0 && varName === ENV_SCOPE_KEY) {
|
|
102421
102431
|
return match;
|
|
102422
102432
|
}
|
|
@@ -102430,8 +102440,8 @@ function substituteVariables(text, variables) {
|
|
|
102430
102440
|
if (pathPart && typeof value === "string") {
|
|
102431
102441
|
try {
|
|
102432
102442
|
const parsed = JSON.parse(value);
|
|
102433
|
-
const
|
|
102434
|
-
const nestedValue = getNestedValue(parsed,
|
|
102443
|
+
const path14 = pathPart.replace(/^\./, "");
|
|
102444
|
+
const nestedValue = getNestedValue(parsed, path14);
|
|
102435
102445
|
if (nestedValue === void 0 && varName === ENV_SCOPE_KEY) {
|
|
102436
102446
|
return match;
|
|
102437
102447
|
}
|
|
@@ -102499,10 +102509,9 @@ function parserHttpRequest(text, variables = {}) {
|
|
|
102499
102509
|
let body;
|
|
102500
102510
|
if (bodyStartIndex > 0) {
|
|
102501
102511
|
const bodyLines = [];
|
|
102502
|
-
const boundaryRegex = /^\[.*\]$|^sequence\s+|^(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)\s+/i;
|
|
102503
102512
|
for (let i = bodyStartIndex; i < allLines.length; i++) {
|
|
102504
102513
|
const line2 = allLines[i].trim();
|
|
102505
|
-
if (
|
|
102514
|
+
if (isRequestLine(line2) || isNamedRequestDeclarationLine(line2) || isSequenceLine(line2) || isEndSequenceLine(line2) || line2.startsWith("###")) {
|
|
102506
102515
|
break;
|
|
102507
102516
|
}
|
|
102508
102517
|
if (line2 && !line2.startsWith("#") && !line2.startsWith("var ")) {
|
|
@@ -102516,6 +102525,19 @@ function parserHttpRequest(text, variables = {}) {
|
|
|
102516
102525
|
}
|
|
102517
102526
|
return { method: method.toUpperCase(), url: url2, headers, body, retryCount, backoffMs };
|
|
102518
102527
|
}
|
|
102528
|
+
var METHOD_REGEX = /^(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS|TRACE|CONNECT)\s+/i;
|
|
102529
|
+
function isRequestLine(line2) {
|
|
102530
|
+
return METHOD_REGEX.test(line2.trim());
|
|
102531
|
+
}
|
|
102532
|
+
function isSequenceLine(line2) {
|
|
102533
|
+
return isSequenceStartDeclaration(line2.trim());
|
|
102534
|
+
}
|
|
102535
|
+
function isNamedRequestDeclarationLine(line2) {
|
|
102536
|
+
return /^\[[^\]]+\]\s*$/.test(line2.trim());
|
|
102537
|
+
}
|
|
102538
|
+
function isEndSequenceLine(line2) {
|
|
102539
|
+
return isSequenceEndDeclaration(line2.trim());
|
|
102540
|
+
}
|
|
102519
102541
|
function extractImports(text) {
|
|
102520
102542
|
const lines = text.split("\n");
|
|
102521
102543
|
const imports = [];
|
|
@@ -103264,9 +103286,9 @@ function isVisitable(thing) {
|
|
|
103264
103286
|
function removeBrackets(key) {
|
|
103265
103287
|
return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key;
|
|
103266
103288
|
}
|
|
103267
|
-
function renderKey(
|
|
103268
|
-
if (!
|
|
103269
|
-
return
|
|
103289
|
+
function renderKey(path14, key, dots) {
|
|
103290
|
+
if (!path14) return key;
|
|
103291
|
+
return path14.concat(key).map(function each(token, i) {
|
|
103270
103292
|
token = removeBrackets(token);
|
|
103271
103293
|
return !dots && i ? "[" + token + "]" : token;
|
|
103272
103294
|
}).join(dots ? "." : "");
|
|
@@ -103314,9 +103336,9 @@ function toFormData(obj, formData, options) {
|
|
|
103314
103336
|
}
|
|
103315
103337
|
return value;
|
|
103316
103338
|
}
|
|
103317
|
-
function defaultVisitor(value, key,
|
|
103339
|
+
function defaultVisitor(value, key, path14) {
|
|
103318
103340
|
let arr = value;
|
|
103319
|
-
if (value && !
|
|
103341
|
+
if (value && !path14 && typeof value === "object") {
|
|
103320
103342
|
if (utils_default.endsWith(key, "{}")) {
|
|
103321
103343
|
key = metaTokens ? key : key.slice(0, -2);
|
|
103322
103344
|
value = JSON.stringify(value);
|
|
@@ -103335,7 +103357,7 @@ function toFormData(obj, formData, options) {
|
|
|
103335
103357
|
if (isVisitable(value)) {
|
|
103336
103358
|
return true;
|
|
103337
103359
|
}
|
|
103338
|
-
formData.append(renderKey(
|
|
103360
|
+
formData.append(renderKey(path14, key, dots), convertValue(value));
|
|
103339
103361
|
return false;
|
|
103340
103362
|
}
|
|
103341
103363
|
const stack = [];
|
|
@@ -103344,10 +103366,10 @@ function toFormData(obj, formData, options) {
|
|
|
103344
103366
|
convertValue,
|
|
103345
103367
|
isVisitable
|
|
103346
103368
|
});
|
|
103347
|
-
function build(value,
|
|
103369
|
+
function build(value, path14) {
|
|
103348
103370
|
if (utils_default.isUndefined(value)) return;
|
|
103349
103371
|
if (stack.indexOf(value) !== -1) {
|
|
103350
|
-
throw Error("Circular reference detected in " +
|
|
103372
|
+
throw Error("Circular reference detected in " + path14.join("."));
|
|
103351
103373
|
}
|
|
103352
103374
|
stack.push(value);
|
|
103353
103375
|
utils_default.forEach(value, function each(el, key) {
|
|
@@ -103355,11 +103377,11 @@ function toFormData(obj, formData, options) {
|
|
|
103355
103377
|
formData,
|
|
103356
103378
|
el,
|
|
103357
103379
|
utils_default.isString(key) ? key.trim() : key,
|
|
103358
|
-
|
|
103380
|
+
path14,
|
|
103359
103381
|
exposedHelpers
|
|
103360
103382
|
);
|
|
103361
103383
|
if (result === true) {
|
|
103362
|
-
build(el,
|
|
103384
|
+
build(el, path14 ? path14.concat(key) : [key]);
|
|
103363
103385
|
}
|
|
103364
103386
|
});
|
|
103365
103387
|
stack.pop();
|
|
@@ -103571,7 +103593,7 @@ var platform_default = {
|
|
|
103571
103593
|
// node_modules/axios/lib/helpers/toURLEncodedForm.js
|
|
103572
103594
|
function toURLEncodedForm(data, options) {
|
|
103573
103595
|
return toFormData_default(data, new platform_default.classes.URLSearchParams(), {
|
|
103574
|
-
visitor: function(value, key,
|
|
103596
|
+
visitor: function(value, key, path14, helpers) {
|
|
103575
103597
|
if (platform_default.isNode && utils_default.isBuffer(value)) {
|
|
103576
103598
|
this.append(key, value.toString("base64"));
|
|
103577
103599
|
return false;
|
|
@@ -103601,11 +103623,11 @@ function arrayToObject(arr) {
|
|
|
103601
103623
|
return obj;
|
|
103602
103624
|
}
|
|
103603
103625
|
function formDataToJSON(formData) {
|
|
103604
|
-
function buildPath(
|
|
103605
|
-
let name =
|
|
103626
|
+
function buildPath(path14, value, target, index) {
|
|
103627
|
+
let name = path14[index++];
|
|
103606
103628
|
if (name === "__proto__") return true;
|
|
103607
103629
|
const isNumericKey = Number.isFinite(+name);
|
|
103608
|
-
const isLast = index >=
|
|
103630
|
+
const isLast = index >= path14.length;
|
|
103609
103631
|
name = !name && utils_default.isArray(target) ? target.length : name;
|
|
103610
103632
|
if (isLast) {
|
|
103611
103633
|
if (utils_default.hasOwnProp(target, name)) {
|
|
@@ -103618,7 +103640,7 @@ function formDataToJSON(formData) {
|
|
|
103618
103640
|
if (!target[name] || !utils_default.isObject(target[name])) {
|
|
103619
103641
|
target[name] = [];
|
|
103620
103642
|
}
|
|
103621
|
-
const result = buildPath(
|
|
103643
|
+
const result = buildPath(path14, value, target[name], index);
|
|
103622
103644
|
if (result && utils_default.isArray(target[name])) {
|
|
103623
103645
|
target[name] = arrayToObject(target[name]);
|
|
103624
103646
|
}
|
|
@@ -104047,10 +104069,10 @@ utils_default.inherits(CanceledError, AxiosError_default, {
|
|
|
104047
104069
|
var CanceledError_default = CanceledError;
|
|
104048
104070
|
|
|
104049
104071
|
// node_modules/axios/lib/core/settle.js
|
|
104050
|
-
function settle(
|
|
104072
|
+
function settle(resolve12, reject, response) {
|
|
104051
104073
|
const validateStatus2 = response.config.validateStatus;
|
|
104052
104074
|
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
|
|
104053
|
-
|
|
104075
|
+
resolve12(response);
|
|
104054
104076
|
} else {
|
|
104055
104077
|
reject(new AxiosError_default(
|
|
104056
104078
|
"Request failed with status code " + response.status,
|
|
@@ -104673,7 +104695,7 @@ function setProxy(options, configProxy, location) {
|
|
|
104673
104695
|
}
|
|
104674
104696
|
var isHttpAdapterSupported = typeof process !== "undefined" && utils_default.kindOf(process) === "process";
|
|
104675
104697
|
var wrapAsync = (asyncExecutor) => {
|
|
104676
|
-
return new Promise((
|
|
104698
|
+
return new Promise((resolve12, reject) => {
|
|
104677
104699
|
let onDone;
|
|
104678
104700
|
let isDone;
|
|
104679
104701
|
const done = (value, isRejected) => {
|
|
@@ -104683,7 +104705,7 @@ var wrapAsync = (asyncExecutor) => {
|
|
|
104683
104705
|
};
|
|
104684
104706
|
const _resolve = (value) => {
|
|
104685
104707
|
done(value);
|
|
104686
|
-
|
|
104708
|
+
resolve12(value);
|
|
104687
104709
|
};
|
|
104688
104710
|
const _reject = (reason) => {
|
|
104689
104711
|
done(reason, true);
|
|
@@ -104735,7 +104757,7 @@ var http2Transport = {
|
|
|
104735
104757
|
}
|
|
104736
104758
|
};
|
|
104737
104759
|
var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
104738
|
-
return wrapAsync(async function dispatchHttpRequest(
|
|
104760
|
+
return wrapAsync(async function dispatchHttpRequest(resolve12, reject, onDone) {
|
|
104739
104761
|
let { data, lookup, family, httpVersion = 1, http2Options } = config;
|
|
104740
104762
|
const { responseType, responseEncoding } = config;
|
|
104741
104763
|
const method = config.method.toUpperCase();
|
|
@@ -104820,7 +104842,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
104820
104842
|
}
|
|
104821
104843
|
let convertedData;
|
|
104822
104844
|
if (method !== "GET") {
|
|
104823
|
-
return settle(
|
|
104845
|
+
return settle(resolve12, reject, {
|
|
104824
104846
|
status: 405,
|
|
104825
104847
|
statusText: "method not allowed",
|
|
104826
104848
|
headers: {},
|
|
@@ -104842,7 +104864,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
104842
104864
|
} else if (responseType === "stream") {
|
|
104843
104865
|
convertedData = import_stream4.default.Readable.from(convertedData);
|
|
104844
104866
|
}
|
|
104845
|
-
return settle(
|
|
104867
|
+
return settle(resolve12, reject, {
|
|
104846
104868
|
data: convertedData,
|
|
104847
104869
|
status: 200,
|
|
104848
104870
|
statusText: "OK",
|
|
@@ -104940,9 +104962,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
104940
104962
|
auth = urlUsername + ":" + urlPassword;
|
|
104941
104963
|
}
|
|
104942
104964
|
auth && headers.delete("authorization");
|
|
104943
|
-
let
|
|
104965
|
+
let path14;
|
|
104944
104966
|
try {
|
|
104945
|
-
|
|
104967
|
+
path14 = buildURL(
|
|
104946
104968
|
parsed.pathname + parsed.search,
|
|
104947
104969
|
config.params,
|
|
104948
104970
|
config.paramsSerializer
|
|
@@ -104960,7 +104982,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
104960
104982
|
false
|
|
104961
104983
|
);
|
|
104962
104984
|
const options = {
|
|
104963
|
-
path:
|
|
104985
|
+
path: path14,
|
|
104964
104986
|
method,
|
|
104965
104987
|
headers: headers.toJSON(),
|
|
104966
104988
|
agents: { http: config.httpAgent, https: config.httpsAgent },
|
|
@@ -105061,7 +105083,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
105061
105083
|
};
|
|
105062
105084
|
if (responseType === "stream") {
|
|
105063
105085
|
response.data = responseStream;
|
|
105064
|
-
settle(
|
|
105086
|
+
settle(resolve12, reject, response);
|
|
105065
105087
|
} else {
|
|
105066
105088
|
const responseBuffer = [];
|
|
105067
105089
|
let totalResponseBytes = 0;
|
|
@@ -105109,7 +105131,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
105109
105131
|
} catch (err) {
|
|
105110
105132
|
return reject(AxiosError_default.from(err, null, config, response.request, response));
|
|
105111
105133
|
}
|
|
105112
|
-
settle(
|
|
105134
|
+
settle(resolve12, reject, response);
|
|
105113
105135
|
});
|
|
105114
105136
|
}
|
|
105115
105137
|
abortEmitter.once("abort", (err) => {
|
|
@@ -105196,14 +105218,14 @@ var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PUR
|
|
|
105196
105218
|
var cookies_default = platform_default.hasStandardBrowserEnv ? (
|
|
105197
105219
|
// Standard browser envs support document.cookie
|
|
105198
105220
|
{
|
|
105199
|
-
write(name, value, expires,
|
|
105221
|
+
write(name, value, expires, path14, domain, secure, sameSite) {
|
|
105200
105222
|
if (typeof document === "undefined") return;
|
|
105201
105223
|
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
105202
105224
|
if (utils_default.isNumber(expires)) {
|
|
105203
105225
|
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
105204
105226
|
}
|
|
105205
|
-
if (utils_default.isString(
|
|
105206
|
-
cookie.push(`path=${
|
|
105227
|
+
if (utils_default.isString(path14)) {
|
|
105228
|
+
cookie.push(`path=${path14}`);
|
|
105207
105229
|
}
|
|
105208
105230
|
if (utils_default.isString(domain)) {
|
|
105209
105231
|
cookie.push(`domain=${domain}`);
|
|
@@ -105358,7 +105380,7 @@ var resolveConfig_default = (config) => {
|
|
|
105358
105380
|
// node_modules/axios/lib/adapters/xhr.js
|
|
105359
105381
|
var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
|
|
105360
105382
|
var xhr_default = isXHRAdapterSupported && function(config) {
|
|
105361
|
-
return new Promise(function dispatchXhrRequest(
|
|
105383
|
+
return new Promise(function dispatchXhrRequest(resolve12, reject) {
|
|
105362
105384
|
const _config = resolveConfig_default(config);
|
|
105363
105385
|
let requestData = _config.data;
|
|
105364
105386
|
const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize();
|
|
@@ -105392,7 +105414,7 @@ var xhr_default = isXHRAdapterSupported && function(config) {
|
|
|
105392
105414
|
request
|
|
105393
105415
|
};
|
|
105394
105416
|
settle(function _resolve(value) {
|
|
105395
|
-
|
|
105417
|
+
resolve12(value);
|
|
105396
105418
|
done();
|
|
105397
105419
|
}, function _reject(err) {
|
|
105398
105420
|
reject(err);
|
|
@@ -105763,8 +105785,8 @@ var factory = (env3) => {
|
|
|
105763
105785
|
responseType = responseType || "text";
|
|
105764
105786
|
let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config);
|
|
105765
105787
|
!isStreamResponse && unsubscribe && unsubscribe();
|
|
105766
|
-
return await new Promise((
|
|
105767
|
-
settle(
|
|
105788
|
+
return await new Promise((resolve12, reject) => {
|
|
105789
|
+
settle(resolve12, reject, {
|
|
105768
105790
|
data: responseData,
|
|
105769
105791
|
headers: AxiosHeaders_default.from(response.headers),
|
|
105770
105792
|
status: response.status,
|
|
@@ -106160,8 +106182,8 @@ var CancelToken = class _CancelToken {
|
|
|
106160
106182
|
throw new TypeError("executor must be a function.");
|
|
106161
106183
|
}
|
|
106162
106184
|
let resolvePromise;
|
|
106163
|
-
this.promise = new Promise(function promiseExecutor(
|
|
106164
|
-
resolvePromise =
|
|
106185
|
+
this.promise = new Promise(function promiseExecutor(resolve12) {
|
|
106186
|
+
resolvePromise = resolve12;
|
|
106165
106187
|
});
|
|
106166
106188
|
const token = this;
|
|
106167
106189
|
this.promise.then((cancel) => {
|
|
@@ -106174,9 +106196,9 @@ var CancelToken = class _CancelToken {
|
|
|
106174
106196
|
});
|
|
106175
106197
|
this.promise.then = (onfulfilled) => {
|
|
106176
106198
|
let _resolve;
|
|
106177
|
-
const promise = new Promise((
|
|
106178
|
-
token.subscribe(
|
|
106179
|
-
_resolve =
|
|
106199
|
+
const promise = new Promise((resolve12) => {
|
|
106200
|
+
token.subscribe(resolve12);
|
|
106201
|
+
_resolve = resolve12;
|
|
106180
106202
|
}).then(onfulfilled);
|
|
106181
106203
|
promise.cancel = function reject() {
|
|
106182
106204
|
token.unsubscribe(_resolve);
|
|
@@ -106550,10 +106572,10 @@ var safeToStringImpl = (val, seenArrays = /* @__PURE__ */ new WeakSet()) => {
|
|
|
106550
106572
|
var safeToString = (val) => safeToStringImpl(val);
|
|
106551
106573
|
function createPromiseCallback(cb) {
|
|
106552
106574
|
let callback;
|
|
106553
|
-
let
|
|
106575
|
+
let resolve12;
|
|
106554
106576
|
let reject;
|
|
106555
106577
|
const promise = new Promise((_resolve, _reject) => {
|
|
106556
|
-
|
|
106578
|
+
resolve12 = _resolve;
|
|
106557
106579
|
reject = _reject;
|
|
106558
106580
|
});
|
|
106559
106581
|
if (typeof cb === "function") {
|
|
@@ -106569,7 +106591,7 @@ function createPromiseCallback(cb) {
|
|
|
106569
106591
|
callback = (err, result) => {
|
|
106570
106592
|
try {
|
|
106571
106593
|
if (err) reject(err);
|
|
106572
|
-
else
|
|
106594
|
+
else resolve12(result);
|
|
106573
106595
|
} catch (e) {
|
|
106574
106596
|
reject(e instanceof Error ? e : new Error());
|
|
106575
106597
|
}
|
|
@@ -106603,18 +106625,18 @@ var MemoryCookieStore = class extends Store {
|
|
|
106603
106625
|
/**
|
|
106604
106626
|
* @internal No doc because this is an overload that supports the implementation
|
|
106605
106627
|
*/
|
|
106606
|
-
findCookie(domain,
|
|
106628
|
+
findCookie(domain, path14, key, callback) {
|
|
106607
106629
|
const promiseCallback = createPromiseCallback(callback);
|
|
106608
|
-
if (domain == null ||
|
|
106630
|
+
if (domain == null || path14 == null || key == null) {
|
|
106609
106631
|
return promiseCallback.resolve(void 0);
|
|
106610
106632
|
}
|
|
106611
|
-
const result = this.idx[domain]?.[
|
|
106633
|
+
const result = this.idx[domain]?.[path14]?.[key];
|
|
106612
106634
|
return promiseCallback.resolve(result);
|
|
106613
106635
|
}
|
|
106614
106636
|
/**
|
|
106615
106637
|
* @internal No doc because this is an overload that supports the implementation
|
|
106616
106638
|
*/
|
|
106617
|
-
findCookies(domain,
|
|
106639
|
+
findCookies(domain, path14, allowSpecialUseDomain = false, callback) {
|
|
106618
106640
|
if (typeof allowSpecialUseDomain === "function") {
|
|
106619
106641
|
callback = allowSpecialUseDomain;
|
|
106620
106642
|
allowSpecialUseDomain = true;
|
|
@@ -106625,7 +106647,7 @@ var MemoryCookieStore = class extends Store {
|
|
|
106625
106647
|
return promiseCallback.resolve([]);
|
|
106626
106648
|
}
|
|
106627
106649
|
let pathMatcher;
|
|
106628
|
-
if (!
|
|
106650
|
+
if (!path14) {
|
|
106629
106651
|
pathMatcher = function matchAll2(domainIndex) {
|
|
106630
106652
|
for (const curPath in domainIndex) {
|
|
106631
106653
|
const pathIndex = domainIndex[curPath];
|
|
@@ -106640,7 +106662,7 @@ var MemoryCookieStore = class extends Store {
|
|
|
106640
106662
|
} else {
|
|
106641
106663
|
pathMatcher = function matchRFC(domainIndex) {
|
|
106642
106664
|
for (const cookiePath in domainIndex) {
|
|
106643
|
-
if (pathMatch(
|
|
106665
|
+
if (pathMatch(path14, cookiePath)) {
|
|
106644
106666
|
const pathIndex = domainIndex[cookiePath];
|
|
106645
106667
|
for (const key in pathIndex) {
|
|
106646
106668
|
const value = pathIndex[key];
|
|
@@ -106668,14 +106690,14 @@ var MemoryCookieStore = class extends Store {
|
|
|
106668
106690
|
*/
|
|
106669
106691
|
putCookie(cookie, callback) {
|
|
106670
106692
|
const promiseCallback = createPromiseCallback(callback);
|
|
106671
|
-
const { domain, path:
|
|
106672
|
-
if (domain == null ||
|
|
106693
|
+
const { domain, path: path14, key } = cookie;
|
|
106694
|
+
if (domain == null || path14 == null || key == null) {
|
|
106673
106695
|
return promiseCallback.resolve(void 0);
|
|
106674
106696
|
}
|
|
106675
106697
|
const domainEntry = this.idx[domain] ?? /* @__PURE__ */ Object.create(null);
|
|
106676
106698
|
this.idx[domain] = domainEntry;
|
|
106677
|
-
const pathEntry = domainEntry[
|
|
106678
|
-
domainEntry[
|
|
106699
|
+
const pathEntry = domainEntry[path14] ?? /* @__PURE__ */ Object.create(null);
|
|
106700
|
+
domainEntry[path14] = pathEntry;
|
|
106679
106701
|
pathEntry[key] = cookie;
|
|
106680
106702
|
return promiseCallback.resolve(void 0);
|
|
106681
106703
|
}
|
|
@@ -106689,20 +106711,20 @@ var MemoryCookieStore = class extends Store {
|
|
|
106689
106711
|
/**
|
|
106690
106712
|
* @internal No doc because this is an overload that supports the implementation
|
|
106691
106713
|
*/
|
|
106692
|
-
removeCookie(domain,
|
|
106714
|
+
removeCookie(domain, path14, key, callback) {
|
|
106693
106715
|
const promiseCallback = createPromiseCallback(callback);
|
|
106694
|
-
delete this.idx[domain]?.[
|
|
106716
|
+
delete this.idx[domain]?.[path14]?.[key];
|
|
106695
106717
|
return promiseCallback.resolve(void 0);
|
|
106696
106718
|
}
|
|
106697
106719
|
/**
|
|
106698
106720
|
* @internal No doc because this is an overload that supports the implementation
|
|
106699
106721
|
*/
|
|
106700
|
-
removeCookies(domain,
|
|
106722
|
+
removeCookies(domain, path14, callback) {
|
|
106701
106723
|
const promiseCallback = createPromiseCallback(callback);
|
|
106702
106724
|
const domainEntry = this.idx[domain];
|
|
106703
106725
|
if (domainEntry) {
|
|
106704
|
-
if (
|
|
106705
|
-
delete domainEntry[
|
|
106726
|
+
if (path14) {
|
|
106727
|
+
delete domainEntry[path14];
|
|
106706
106728
|
} else {
|
|
106707
106729
|
delete this.idx[domain];
|
|
106708
106730
|
}
|
|
@@ -106728,8 +106750,8 @@ var MemoryCookieStore = class extends Store {
|
|
|
106728
106750
|
domains.forEach((domain) => {
|
|
106729
106751
|
const domainEntry = idx[domain] ?? {};
|
|
106730
106752
|
const paths = Object.keys(domainEntry);
|
|
106731
|
-
paths.forEach((
|
|
106732
|
-
const pathEntry = domainEntry[
|
|
106753
|
+
paths.forEach((path14) => {
|
|
106754
|
+
const pathEntry = domainEntry[path14] ?? {};
|
|
106733
106755
|
const keys = Object.keys(pathEntry);
|
|
106734
106756
|
keys.forEach((key) => {
|
|
106735
106757
|
const keyEntry = pathEntry[key];
|
|
@@ -107613,18 +107635,18 @@ function cookieCompare(a, b) {
|
|
|
107613
107635
|
cmp = (a.creationIndex || 0) - (b.creationIndex || 0);
|
|
107614
107636
|
return cmp;
|
|
107615
107637
|
}
|
|
107616
|
-
function defaultPath(
|
|
107617
|
-
if (!
|
|
107638
|
+
function defaultPath(path14) {
|
|
107639
|
+
if (!path14 || path14.slice(0, 1) !== "/") {
|
|
107618
107640
|
return "/";
|
|
107619
107641
|
}
|
|
107620
|
-
if (
|
|
107621
|
-
return
|
|
107642
|
+
if (path14 === "/") {
|
|
107643
|
+
return path14;
|
|
107622
107644
|
}
|
|
107623
|
-
const rightSlash =
|
|
107645
|
+
const rightSlash = path14.lastIndexOf("/");
|
|
107624
107646
|
if (rightSlash === 0) {
|
|
107625
107647
|
return "/";
|
|
107626
107648
|
}
|
|
107627
|
-
return
|
|
107649
|
+
return path14.slice(0, rightSlash);
|
|
107628
107650
|
}
|
|
107629
107651
|
var IP_REGEX_LOWERCASE = /(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-f\d]{1,4}:){7}(?:[a-f\d]{1,4}|:)|(?:[a-f\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-f\d]{1,4}|:)|(?:[a-f\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,2}|:)|(?:[a-f\d]{1,4}:){4}(?:(?::[a-f\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,3}|:)|(?:[a-f\d]{1,4}:){3}(?:(?::[a-f\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,4}|:)|(?:[a-f\d]{1,4}:){2}(?:(?::[a-f\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,5}|:)|(?:[a-f\d]{1,4}:){1}(?:(?::[a-f\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,6}|:)|(?::(?:(?::[a-f\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,7}|:)))$)/;
|
|
107630
107652
|
function domainMatch(domain, cookieDomain, canonicalize) {
|
|
@@ -108026,7 +108048,7 @@ var CookieJar = class _CookieJar {
|
|
|
108026
108048
|
return promiseCallback.reject(parameterError);
|
|
108027
108049
|
}
|
|
108028
108050
|
const host = canonicalDomain(context.hostname);
|
|
108029
|
-
const
|
|
108051
|
+
const path14 = context.pathname || "/";
|
|
108030
108052
|
const potentiallyTrustworthy = isPotentiallyTrustworthy(
|
|
108031
108053
|
url2,
|
|
108032
108054
|
this.allowSecureOnLocal
|
|
@@ -108057,7 +108079,7 @@ var CookieJar = class _CookieJar {
|
|
|
108057
108079
|
return false;
|
|
108058
108080
|
}
|
|
108059
108081
|
}
|
|
108060
|
-
if (!allPaths && typeof c.path === "string" && !pathMatch(
|
|
108082
|
+
if (!allPaths && typeof c.path === "string" && !pathMatch(path14, c.path)) {
|
|
108061
108083
|
return false;
|
|
108062
108084
|
}
|
|
108063
108085
|
if (c.secure && !potentiallyTrustworthy) {
|
|
@@ -108089,7 +108111,7 @@ var CookieJar = class _CookieJar {
|
|
|
108089
108111
|
}
|
|
108090
108112
|
store.findCookies(
|
|
108091
108113
|
host,
|
|
108092
|
-
allPaths ? null :
|
|
108114
|
+
allPaths ? null : path14,
|
|
108093
108115
|
this.allowSpecialUseDomain,
|
|
108094
108116
|
(err, cookies) => {
|
|
108095
108117
|
if (err) {
|
|
@@ -108601,7 +108623,7 @@ async function sendRequest(request, retryOptions) {
|
|
|
108601
108623
|
return sendRequestWithJar(request, sharedCookieJar, retryOptions);
|
|
108602
108624
|
}
|
|
108603
108625
|
function sleep(ms) {
|
|
108604
|
-
return new Promise((
|
|
108626
|
+
return new Promise((resolve12) => setTimeout(resolve12, ms));
|
|
108605
108627
|
}
|
|
108606
108628
|
function shouldRetry(response, error) {
|
|
108607
108629
|
if (error) return true;
|
|
@@ -109014,7 +109036,7 @@ async function runScript(type, scriptPath, args, workingDir, variables = {}, cap
|
|
|
109014
109036
|
captureVar
|
|
109015
109037
|
};
|
|
109016
109038
|
}
|
|
109017
|
-
return new Promise((
|
|
109039
|
+
return new Promise((resolve12) => {
|
|
109018
109040
|
const env3 = {
|
|
109019
109041
|
...process.env,
|
|
109020
109042
|
// Pass variables as environment variables with NORN_ prefix
|
|
@@ -109038,7 +109060,7 @@ async function runScript(type, scriptPath, args, workingDir, variables = {}, cap
|
|
|
109038
109060
|
stderr += data.toString();
|
|
109039
109061
|
});
|
|
109040
109062
|
child.on("error", (err) => {
|
|
109041
|
-
|
|
109063
|
+
resolve12({
|
|
109042
109064
|
success: false,
|
|
109043
109065
|
output: cleanScriptOutput(stdout),
|
|
109044
109066
|
error: `Failed to execute script: ${err.message}`,
|
|
@@ -109052,7 +109074,7 @@ async function runScript(type, scriptPath, args, workingDir, variables = {}, cap
|
|
|
109052
109074
|
child.on("close", (code) => {
|
|
109053
109075
|
const exitCode = code ?? 0;
|
|
109054
109076
|
const cleanedOutput = cleanScriptOutput(stdout);
|
|
109055
|
-
|
|
109077
|
+
resolve12({
|
|
109056
109078
|
success: exitCode === 0,
|
|
109057
109079
|
output: cleanedOutput,
|
|
109058
109080
|
error: stderr.trim(),
|
|
@@ -109117,11 +109139,11 @@ function readJsonFile(filePath, workingDir) {
|
|
|
109117
109139
|
};
|
|
109118
109140
|
}
|
|
109119
109141
|
}
|
|
109120
|
-
function setNestedValue(obj,
|
|
109121
|
-
if (!
|
|
109142
|
+
function setNestedValue(obj, path14, value) {
|
|
109143
|
+
if (!path14 || obj === null || obj === void 0 || typeof obj !== "object") {
|
|
109122
109144
|
return false;
|
|
109123
109145
|
}
|
|
109124
|
-
const parts =
|
|
109146
|
+
const parts = path14.replace(/\[(\d+)\]/g, ".$1").split(".").filter((p) => p !== "");
|
|
109125
109147
|
if (parts.length === 0) {
|
|
109126
109148
|
return false;
|
|
109127
109149
|
}
|
|
@@ -109372,10 +109394,12 @@ function validatePreparedRequest(parsed, context) {
|
|
|
109372
109394
|
init_quotedString();
|
|
109373
109395
|
|
|
109374
109396
|
// src/sqlConfig.ts
|
|
109375
|
-
var
|
|
109376
|
-
var
|
|
109397
|
+
var fs9 = __toESM(require("fs"));
|
|
109398
|
+
var path7 = __toESM(require("path"));
|
|
109377
109399
|
|
|
109378
109400
|
// src/sqlBuiltInAdapters.ts
|
|
109401
|
+
var fs8 = __toESM(require("fs"));
|
|
109402
|
+
var path6 = __toESM(require("path"));
|
|
109379
109403
|
var import_child_process2 = require("child_process");
|
|
109380
109404
|
|
|
109381
109405
|
// node_modules/pg/esm/index.mjs
|
|
@@ -109410,9 +109434,9 @@ var BUILT_IN_SQL_ADAPTERS = [
|
|
|
109410
109434
|
optionalConnectionKeys: []
|
|
109411
109435
|
},
|
|
109412
109436
|
{
|
|
109413
|
-
id: "sqlserver-
|
|
109437
|
+
id: "sqlserver-windows",
|
|
109414
109438
|
label: "SQL Server (Integrated Auth)",
|
|
109415
|
-
description: "Built-in SQL Server adapter using PowerShell for Windows/Trusted authentication.",
|
|
109439
|
+
description: "Built-in SQL Server adapter using PowerShell and Microsoft.Data.SqlClient for Windows/Trusted authentication.",
|
|
109416
109440
|
connectionSetupSummary: "connectionString",
|
|
109417
109441
|
optionalConnectionKeys: []
|
|
109418
109442
|
}
|
|
@@ -109439,6 +109463,17 @@ function getConnectionString(values) {
|
|
|
109439
109463
|
function buildMissingConnectionError(adapterLabel, profile) {
|
|
109440
109464
|
return `Missing required ${adapterLabel} connection string. Expected 'connectionString ${profile} = ...' in .nornenv.`;
|
|
109441
109465
|
}
|
|
109466
|
+
function getBundledSqlClientDirectory() {
|
|
109467
|
+
return path6.resolve(__dirname, "..", "vendor", "microsoft.data.sqlclient", "windows-netfx");
|
|
109468
|
+
}
|
|
109469
|
+
function ensureBundledSqlClientDirectory() {
|
|
109470
|
+
const sqlClientDir = getBundledSqlClientDirectory();
|
|
109471
|
+
const mainAssemblyPath = path6.join(sqlClientDir, "Microsoft.Data.SqlClient.dll");
|
|
109472
|
+
if (!fs8.existsSync(mainAssemblyPath)) {
|
|
109473
|
+
fail(`Missing bundled Microsoft.Data.SqlClient runtime at '${mainAssemblyPath}'.`);
|
|
109474
|
+
}
|
|
109475
|
+
return sqlClientDir;
|
|
109476
|
+
}
|
|
109442
109477
|
var pwshAvailable2 = null;
|
|
109443
109478
|
function isPwshAvailable2() {
|
|
109444
109479
|
if (pwshAvailable2 !== null) {
|
|
@@ -109458,10 +109493,20 @@ function isPwshAvailable2() {
|
|
|
109458
109493
|
function getPowerShellCommand() {
|
|
109459
109494
|
return isPwshAvailable2() ? "pwsh" : "powershell";
|
|
109460
109495
|
}
|
|
109496
|
+
function getIntegratedPowerShellCommand() {
|
|
109497
|
+
if (process.platform === "win32") {
|
|
109498
|
+
return "powershell";
|
|
109499
|
+
}
|
|
109500
|
+
return getPowerShellCommand();
|
|
109501
|
+
}
|
|
109461
109502
|
function encodePowerShellCommand(script) {
|
|
109462
109503
|
return Buffer.from(script, "utf16le").toString("base64");
|
|
109463
109504
|
}
|
|
109464
109505
|
async function runSqlServerIntegratedViaPowerShell(request) {
|
|
109506
|
+
if (process.platform !== "win32") {
|
|
109507
|
+
fail("Built-in adapter sqlserver-windows is supported on Windows only.");
|
|
109508
|
+
}
|
|
109509
|
+
const sqlClientDir = ensureBundledSqlClientDirectory();
|
|
109465
109510
|
const script = `
|
|
109466
109511
|
$ErrorActionPreference = 'Stop'
|
|
109467
109512
|
[Console]::InputEncoding = [System.Text.Encoding]::UTF8
|
|
@@ -109478,13 +109523,35 @@ if ([string]::IsNullOrWhiteSpace($connectionString)) {
|
|
|
109478
109523
|
throw 'Missing SQL Server Integrated Auth connection string.'
|
|
109479
109524
|
}
|
|
109480
109525
|
|
|
109526
|
+
$sqlClientDir = [string]$env:NORN_SQLCLIENT_DIR
|
|
109527
|
+
if ([string]::IsNullOrWhiteSpace($sqlClientDir) -or -not (Test-Path $sqlClientDir)) {
|
|
109528
|
+
throw 'Missing bundled Microsoft.Data.SqlClient runtime files.'
|
|
109529
|
+
}
|
|
109530
|
+
|
|
109531
|
+
$env:PATH = "$sqlClientDir;$env:PATH"
|
|
109532
|
+
|
|
109533
|
+
$resolveHandler = [System.ResolveEventHandler]{
|
|
109534
|
+
param($sender, $eventArgs)
|
|
109535
|
+
|
|
109536
|
+
$assemblyName = ([System.Reflection.AssemblyName]$eventArgs.Name).Name + '.dll'
|
|
109537
|
+
$candidate = Join-Path $env:NORN_SQLCLIENT_DIR $assemblyName
|
|
109538
|
+
if (Test-Path $candidate) {
|
|
109539
|
+
return [System.Reflection.Assembly]::LoadFrom($candidate)
|
|
109540
|
+
}
|
|
109541
|
+
|
|
109542
|
+
return $null
|
|
109543
|
+
}
|
|
109544
|
+
|
|
109545
|
+
[System.AppDomain]::CurrentDomain.add_AssemblyResolve($resolveHandler)
|
|
109546
|
+
[void][System.Reflection.Assembly]::LoadFrom((Join-Path $sqlClientDir 'Microsoft.Data.SqlClient.dll'))
|
|
109547
|
+
|
|
109481
109548
|
$sqlText = [string]$payload.operation.sql
|
|
109482
109549
|
$mode = [string]$payload.mode
|
|
109483
109550
|
$paramsObject = $payload.params
|
|
109484
109551
|
|
|
109485
109552
|
$connection = $null
|
|
109486
109553
|
try {
|
|
109487
|
-
$connection = New-Object
|
|
109554
|
+
$connection = New-Object Microsoft.Data.SqlClient.SqlConnection $connectionString
|
|
109488
109555
|
$command = $connection.CreateCommand()
|
|
109489
109556
|
$command.CommandText = $sqlText
|
|
109490
109557
|
|
|
@@ -109570,20 +109637,24 @@ catch {
|
|
|
109570
109637
|
exit 1
|
|
109571
109638
|
}
|
|
109572
109639
|
finally {
|
|
109640
|
+
if ($null -ne $resolveHandler) {
|
|
109641
|
+
[System.AppDomain]::CurrentDomain.remove_AssemblyResolve($resolveHandler)
|
|
109642
|
+
}
|
|
109573
109643
|
if ($null -ne $connection) {
|
|
109574
109644
|
$connection.Dispose()
|
|
109575
109645
|
}
|
|
109576
109646
|
}
|
|
109577
109647
|
`.trim();
|
|
109578
109648
|
const payload = JSON.stringify(request);
|
|
109579
|
-
const command =
|
|
109649
|
+
const command = getIntegratedPowerShellCommand();
|
|
109580
109650
|
const commandArgs = ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-OutputFormat", "Text", "-EncodedCommand", encodePowerShellCommand(script)];
|
|
109581
|
-
return new Promise((
|
|
109651
|
+
return new Promise((resolve12, reject) => {
|
|
109582
109652
|
const child = (0, import_child_process2.spawn)(command, commandArgs, {
|
|
109583
109653
|
cwd: request.context?.workingDir || process.cwd(),
|
|
109584
109654
|
shell: false,
|
|
109585
109655
|
env: {
|
|
109586
|
-
...process.env
|
|
109656
|
+
...process.env,
|
|
109657
|
+
NORN_SQLCLIENT_DIR: sqlClientDir
|
|
109587
109658
|
}
|
|
109588
109659
|
});
|
|
109589
109660
|
let stdout = "";
|
|
@@ -109604,7 +109675,7 @@ finally {
|
|
|
109604
109675
|
}
|
|
109605
109676
|
try {
|
|
109606
109677
|
const parsed = JSON.parse(stdout.trim());
|
|
109607
|
-
|
|
109678
|
+
resolve12(parsed);
|
|
109608
109679
|
} catch (error) {
|
|
109609
109680
|
reject(new Error(`Invalid PowerShell SQL adapter response: ${error instanceof Error ? error.message : String(error)}`));
|
|
109610
109681
|
}
|
|
@@ -109787,7 +109858,7 @@ async function runBuiltInSqlAdapter(adapterId, request) {
|
|
|
109787
109858
|
return runBuiltInPostgresAdapter(request);
|
|
109788
109859
|
case "sqlserver":
|
|
109789
109860
|
return runBuiltInSqlServerAdapter(request);
|
|
109790
|
-
case "sqlserver-
|
|
109861
|
+
case "sqlserver-windows":
|
|
109791
109862
|
return runBuiltInSqlServerIntegratedAdapter(request);
|
|
109792
109863
|
default:
|
|
109793
109864
|
fail(`Built-in SQL adapter '${adapterId}' is not supported`);
|
|
@@ -109801,22 +109872,22 @@ function getSearchDirectory(startPath) {
|
|
|
109801
109872
|
if (!startPath) {
|
|
109802
109873
|
return process.cwd();
|
|
109803
109874
|
}
|
|
109804
|
-
const absolute =
|
|
109875
|
+
const absolute = path7.resolve(startPath);
|
|
109805
109876
|
try {
|
|
109806
|
-
const stats =
|
|
109807
|
-
return stats.isDirectory() ? absolute :
|
|
109877
|
+
const stats = fs9.statSync(absolute);
|
|
109878
|
+
return stats.isDirectory() ? absolute : path7.dirname(absolute);
|
|
109808
109879
|
} catch {
|
|
109809
|
-
return
|
|
109880
|
+
return path7.extname(absolute) ? path7.dirname(absolute) : absolute;
|
|
109810
109881
|
}
|
|
109811
109882
|
}
|
|
109812
109883
|
function findNearestConfigFile(startPath, fileName) {
|
|
109813
109884
|
let currentDir = getSearchDirectory(startPath);
|
|
109814
109885
|
while (true) {
|
|
109815
|
-
const candidate =
|
|
109816
|
-
if (
|
|
109886
|
+
const candidate = path7.join(currentDir, fileName);
|
|
109887
|
+
if (fs9.existsSync(candidate)) {
|
|
109817
109888
|
return candidate;
|
|
109818
109889
|
}
|
|
109819
|
-
const parentDir =
|
|
109890
|
+
const parentDir = path7.dirname(currentDir);
|
|
109820
109891
|
if (parentDir === currentDir) {
|
|
109821
109892
|
return void 0;
|
|
109822
109893
|
}
|
|
@@ -109826,7 +109897,7 @@ function findNearestConfigFile(startPath, fileName) {
|
|
|
109826
109897
|
function parseJsonFile(filePath, validator, label) {
|
|
109827
109898
|
let raw;
|
|
109828
109899
|
try {
|
|
109829
|
-
raw =
|
|
109900
|
+
raw = fs9.readFileSync(filePath, "utf-8");
|
|
109830
109901
|
} catch (error) {
|
|
109831
109902
|
throw new Error(`Failed to read ${label}: ${error instanceof Error ? error.message : String(error)}`);
|
|
109832
109903
|
}
|
|
@@ -109920,19 +109991,19 @@ function resolveSqlConnection(startPath, alias) {
|
|
|
109920
109991
|
};
|
|
109921
109992
|
}
|
|
109922
109993
|
function resolveCommandParts(configPath, command) {
|
|
109923
|
-
const configDir =
|
|
109994
|
+
const configDir = path7.dirname(configPath);
|
|
109924
109995
|
return command.map((part, index) => {
|
|
109925
109996
|
if (!part) {
|
|
109926
109997
|
return part;
|
|
109927
109998
|
}
|
|
109928
109999
|
if (index === 0) {
|
|
109929
|
-
if (
|
|
110000
|
+
if (path7.isAbsolute(part) || !part.startsWith(".") && !part.includes(path7.sep) && !part.includes("/")) {
|
|
109930
110001
|
return part;
|
|
109931
110002
|
}
|
|
109932
|
-
return
|
|
110003
|
+
return path7.resolve(configDir, part);
|
|
109933
110004
|
}
|
|
109934
110005
|
if (part.startsWith(".")) {
|
|
109935
|
-
return
|
|
110006
|
+
return path7.resolve(configDir, part);
|
|
109936
110007
|
}
|
|
109937
110008
|
return part;
|
|
109938
110009
|
});
|
|
@@ -110005,7 +110076,7 @@ async function runExternalSqlAdapter(command, request, workingDir) {
|
|
|
110005
110076
|
if (!command.length) {
|
|
110006
110077
|
throw new Error("SQL adapter command is empty");
|
|
110007
110078
|
}
|
|
110008
|
-
return new Promise((
|
|
110079
|
+
return new Promise((resolve12, reject) => {
|
|
110009
110080
|
const child = (0, import_child_process3.spawn)(command[0], command.slice(1), {
|
|
110010
110081
|
cwd: workingDir,
|
|
110011
110082
|
env: process.env,
|
|
@@ -110026,7 +110097,7 @@ async function runExternalSqlAdapter(command, request, workingDir) {
|
|
|
110026
110097
|
return;
|
|
110027
110098
|
}
|
|
110028
110099
|
settled = true;
|
|
110029
|
-
|
|
110100
|
+
resolve12(response);
|
|
110030
110101
|
};
|
|
110031
110102
|
child.stdout.on("data", (chunk) => {
|
|
110032
110103
|
stdout += chunk.toString();
|
|
@@ -110231,6 +110302,10 @@ function resolveReturnExpression(expr, runtimeVariables) {
|
|
|
110231
110302
|
return { key: varName, value: varValue };
|
|
110232
110303
|
}
|
|
110233
110304
|
}
|
|
110305
|
+
function resolveSingleReturnValue(expr, runtimeVariables) {
|
|
110306
|
+
const result = evaluateSqlArgumentExpression(expr, runtimeVariables);
|
|
110307
|
+
return result.error ? "" : result.value;
|
|
110308
|
+
}
|
|
110234
110309
|
function extractReturnVariables(content) {
|
|
110235
110310
|
const lines = content.split("\n");
|
|
110236
110311
|
for (const line2 of lines) {
|
|
@@ -110240,6 +110315,54 @@ function extractReturnVariables(content) {
|
|
|
110240
110315
|
}
|
|
110241
110316
|
return null;
|
|
110242
110317
|
}
|
|
110318
|
+
function buildParsedNamedRequest(requestContent, runtimeVariables, apiDefinitions) {
|
|
110319
|
+
if (apiDefinitions && apiDefinitions.endpoints.length > 0 && isApiRequestLine(requestContent, apiDefinitions.endpoints)) {
|
|
110320
|
+
const apiRequest = parseApiRequest(
|
|
110321
|
+
requestContent,
|
|
110322
|
+
apiDefinitions.endpoints,
|
|
110323
|
+
apiDefinitions.headerGroups
|
|
110324
|
+
);
|
|
110325
|
+
if (apiRequest) {
|
|
110326
|
+
const endpoint = getEndpoint(apiDefinitions, apiRequest.endpointName);
|
|
110327
|
+
if (!endpoint) {
|
|
110328
|
+
throw new Error(`Unknown endpoint: ${apiRequest.endpointName}`);
|
|
110329
|
+
}
|
|
110330
|
+
const resolvedParams = {};
|
|
110331
|
+
for (const [paramName, paramValue] of Object.entries(apiRequest.params)) {
|
|
110332
|
+
if (runtimeVariables[paramValue] !== void 0) {
|
|
110333
|
+
resolvedParams[paramName] = String(runtimeVariables[paramValue]);
|
|
110334
|
+
} else {
|
|
110335
|
+
resolvedParams[paramName] = substituteVariables(paramValue, runtimeVariables);
|
|
110336
|
+
}
|
|
110337
|
+
}
|
|
110338
|
+
const resolvedPath = substituteVariables(
|
|
110339
|
+
resolveEndpointPath(endpoint, resolvedParams),
|
|
110340
|
+
runtimeVariables
|
|
110341
|
+
);
|
|
110342
|
+
const combinedHeaders = {};
|
|
110343
|
+
for (const groupName of apiRequest.headerGroupNames) {
|
|
110344
|
+
const group = getHeaderGroup(apiDefinitions, groupName);
|
|
110345
|
+
if (group) {
|
|
110346
|
+
Object.assign(combinedHeaders, resolveHeaderValues(group, runtimeVariables));
|
|
110347
|
+
}
|
|
110348
|
+
}
|
|
110349
|
+
for (const [headerName, headerValue] of Object.entries(apiRequest.inlineHeaders)) {
|
|
110350
|
+
combinedHeaders[headerName] = substituteVariables(headerValue, runtimeVariables);
|
|
110351
|
+
}
|
|
110352
|
+
return {
|
|
110353
|
+
method: apiRequest.method,
|
|
110354
|
+
url: resolvedPath,
|
|
110355
|
+
headers: combinedHeaders,
|
|
110356
|
+
body: apiRequest.body ? substituteVariables(apiRequest.body, runtimeVariables) : void 0
|
|
110357
|
+
};
|
|
110358
|
+
}
|
|
110359
|
+
}
|
|
110360
|
+
let parsed = parserHttpRequest(requestContent, runtimeVariables);
|
|
110361
|
+
if (apiDefinitions && apiDefinitions.headerGroups.length > 0) {
|
|
110362
|
+
parsed = applyHeaderGroupsToRequest(parsed, requestContent, apiDefinitions.headerGroups, runtimeVariables);
|
|
110363
|
+
}
|
|
110364
|
+
return parsed;
|
|
110365
|
+
}
|
|
110243
110366
|
function parseRunArguments(argsStr) {
|
|
110244
110367
|
const args = [];
|
|
110245
110368
|
if (!argsStr || !argsStr.trim()) {
|
|
@@ -110514,8 +110637,8 @@ function bindSequenceArguments(params, args, runtimeVariables) {
|
|
|
110514
110637
|
}
|
|
110515
110638
|
return { variables: result };
|
|
110516
110639
|
}
|
|
110517
|
-
function getVariableValueByPath(
|
|
110518
|
-
const parts =
|
|
110640
|
+
function getVariableValueByPath(path14, variables) {
|
|
110641
|
+
const parts = path14.split(".");
|
|
110519
110642
|
let current = variables;
|
|
110520
110643
|
for (const part of parts) {
|
|
110521
110644
|
if (current === null || current === void 0) {
|
|
@@ -110880,8 +111003,8 @@ function evaluateValueExpression(expr, runtimeVariables) {
|
|
|
110880
111003
|
} else {
|
|
110881
111004
|
return { value: String(varValue), error: `Cannot access path on non-object value` };
|
|
110882
111005
|
}
|
|
110883
|
-
const
|
|
110884
|
-
const parts =
|
|
111006
|
+
const path14 = pathPart.replace(/^\./, "").replace(/\[(\d+)\]/g, ".$1");
|
|
111007
|
+
const parts = path14.split(".").filter((p) => p !== "");
|
|
110885
111008
|
let current = dataToNavigate;
|
|
110886
111009
|
for (const part of parts) {
|
|
110887
111010
|
if (current === null || current === void 0) {
|
|
@@ -111002,8 +111125,8 @@ function resolveBareVariables(text, variables) {
|
|
|
111002
111125
|
if (varName in variables) {
|
|
111003
111126
|
const value = variables[varName];
|
|
111004
111127
|
if (pathPart) {
|
|
111005
|
-
const
|
|
111006
|
-
const nestedValue = getNestedValueFromObject(value,
|
|
111128
|
+
const path14 = pathPart.replace(/^\./, "");
|
|
111129
|
+
const nestedValue = getNestedValueFromObject(value, path14);
|
|
111007
111130
|
return valueToString2(nestedValue);
|
|
111008
111131
|
}
|
|
111009
111132
|
return valueToString2(value);
|
|
@@ -111023,8 +111146,8 @@ function resolveBareVariables(text, variables) {
|
|
|
111023
111146
|
if (varName in variables) {
|
|
111024
111147
|
const value = variables[varName];
|
|
111025
111148
|
if (pathPart) {
|
|
111026
|
-
const
|
|
111027
|
-
return valueToString2(getNestedValueFromObject(value,
|
|
111149
|
+
const path14 = pathPart.replace(/^\./, "");
|
|
111150
|
+
return valueToString2(getNestedValueFromObject(value, path14));
|
|
111028
111151
|
}
|
|
111029
111152
|
return valueToString2(value);
|
|
111030
111153
|
}
|
|
@@ -111072,11 +111195,11 @@ function splitExpressionParts(expr) {
|
|
|
111072
111195
|
}
|
|
111073
111196
|
return parts;
|
|
111074
111197
|
}
|
|
111075
|
-
function getNestedValueFromObject(obj,
|
|
111076
|
-
if (!
|
|
111198
|
+
function getNestedValueFromObject(obj, path14) {
|
|
111199
|
+
if (!path14) {
|
|
111077
111200
|
return obj;
|
|
111078
111201
|
}
|
|
111079
|
-
const parts =
|
|
111202
|
+
const parts = path14.split(/\.|\[(\d+)\]/).filter((p) => p !== "" && p !== void 0);
|
|
111080
111203
|
let current = obj;
|
|
111081
111204
|
for (const part of parts) {
|
|
111082
111205
|
if (current === null || current === void 0) {
|
|
@@ -111099,7 +111222,7 @@ function valueToString2(value) {
|
|
|
111099
111222
|
return String(value);
|
|
111100
111223
|
}
|
|
111101
111224
|
function sleep2(ms) {
|
|
111102
|
-
return new Promise((
|
|
111225
|
+
return new Promise((resolve12) => setTimeout(resolve12, ms));
|
|
111103
111226
|
}
|
|
111104
111227
|
function isIfCommand(line2) {
|
|
111105
111228
|
return /^if\s+.+$/i.test(line2.trim());
|
|
@@ -111439,24 +111562,24 @@ function extractCaptureDirectives(content) {
|
|
|
111439
111562
|
for (const line2 of content.split("\n")) {
|
|
111440
111563
|
const match = line2.trim().match(captureRegex);
|
|
111441
111564
|
if (match) {
|
|
111442
|
-
let
|
|
111443
|
-
if (
|
|
111444
|
-
|
|
111565
|
+
let path14 = match[3] || "";
|
|
111566
|
+
if (path14.startsWith(".")) {
|
|
111567
|
+
path14 = path14.substring(1);
|
|
111445
111568
|
}
|
|
111446
111569
|
captures.push({
|
|
111447
111570
|
varName: match[1],
|
|
111448
111571
|
afterRequest: parseInt(match[2], 10),
|
|
111449
|
-
path:
|
|
111572
|
+
path: path14
|
|
111450
111573
|
});
|
|
111451
111574
|
}
|
|
111452
111575
|
}
|
|
111453
111576
|
return captures;
|
|
111454
111577
|
}
|
|
111455
|
-
function getValueByPath(response,
|
|
111456
|
-
if (!
|
|
111578
|
+
function getValueByPath(response, path14) {
|
|
111579
|
+
if (!path14) {
|
|
111457
111580
|
return void 0;
|
|
111458
111581
|
}
|
|
111459
|
-
const parts =
|
|
111582
|
+
const parts = path14.replace(/\[(\d+)\]/g, ".$1").split(".").filter((p) => p !== "");
|
|
111460
111583
|
if (parts.length === 0) {
|
|
111461
111584
|
return void 0;
|
|
111462
111585
|
}
|
|
@@ -111613,6 +111736,7 @@ async function runSequenceWithJar(sequenceContent, fileVariables, cookieJar, wor
|
|
|
111613
111736
|
for (let stepIdx = 0; stepIdx < steps.length; stepIdx++) {
|
|
111614
111737
|
const step = steps[stepIdx];
|
|
111615
111738
|
await emitBeforeStep(step, stepIdx);
|
|
111739
|
+
const stepStartTime = Date.now();
|
|
111616
111740
|
try {
|
|
111617
111741
|
if (step.type === "if") {
|
|
111618
111742
|
if (shouldSkip()) {
|
|
@@ -111623,6 +111747,7 @@ async function runSequenceWithJar(sequenceContent, fileVariables, cookieJar, wor
|
|
|
111623
111747
|
const stepResult = {
|
|
111624
111748
|
type: "print",
|
|
111625
111749
|
stepIndex: stepIdx,
|
|
111750
|
+
durationMs: Date.now() - stepStartTime,
|
|
111626
111751
|
print: {
|
|
111627
111752
|
title: `if ${step.content}: ${conditionMet ? "true" : "false"}`,
|
|
111628
111753
|
timestamp: Date.now() - startTime
|
|
@@ -111664,6 +111789,7 @@ async function runSequenceWithJar(sequenceContent, fileVariables, cookieJar, wor
|
|
|
111664
111789
|
const stepResult = {
|
|
111665
111790
|
type: "assertion",
|
|
111666
111791
|
stepIndex: stepIdx,
|
|
111792
|
+
durationMs: Date.now() - stepStartTime,
|
|
111667
111793
|
assertion: result,
|
|
111668
111794
|
lineNumber: step.lineNumber
|
|
111669
111795
|
};
|
|
@@ -111672,13 +111798,6 @@ async function runSequenceWithJar(sequenceContent, fileVariables, cookieJar, wor
|
|
|
111672
111798
|
reportProgress(stepIdx, "assertion", `${statusIcon} assert ${result.expression}`, stepResult);
|
|
111673
111799
|
if (!result.passed) {
|
|
111674
111800
|
const failMessage = result.message ? `Assertion failed: ${result.message}` : `Assertion failed: ${result.expression}`;
|
|
111675
|
-
errors.push(failMessage);
|
|
111676
|
-
if (result.error) {
|
|
111677
|
-
errors.push(` Error: ${result.error}`);
|
|
111678
|
-
} else {
|
|
111679
|
-
errors.push(` Expected: ${result.rightExpression ?? result.operator}`);
|
|
111680
|
-
errors.push(` Actual: ${JSON.stringify(result.leftValue)}`);
|
|
111681
|
-
}
|
|
111682
111801
|
await emitFailure(failMessage, step, stepIdx);
|
|
111683
111802
|
return {
|
|
111684
111803
|
name: "",
|
|
@@ -111702,6 +111821,7 @@ async function runSequenceWithJar(sequenceContent, fileVariables, cookieJar, wor
|
|
|
111702
111821
|
const stepResult = {
|
|
111703
111822
|
type: "print",
|
|
111704
111823
|
stepIndex: stepIdx,
|
|
111824
|
+
durationMs: Date.now() - stepStartTime,
|
|
111705
111825
|
print: {
|
|
111706
111826
|
title,
|
|
111707
111827
|
body,
|
|
@@ -111719,6 +111839,7 @@ async function runSequenceWithJar(sequenceContent, fileVariables, cookieJar, wor
|
|
|
111719
111839
|
const stepResult = {
|
|
111720
111840
|
type: "print",
|
|
111721
111841
|
stepIndex: stepIdx,
|
|
111842
|
+
durationMs: Date.now() - stepStartTime,
|
|
111722
111843
|
print: {
|
|
111723
111844
|
title: `Waited ${durationMs >= 1e3 ? durationMs / 1e3 + "s" : durationMs + "ms"}`,
|
|
111724
111845
|
timestamp: Date.now() - startTime
|
|
@@ -111747,6 +111868,7 @@ async function runSequenceWithJar(sequenceContent, fileVariables, cookieJar, wor
|
|
|
111747
111868
|
const stepResult = {
|
|
111748
111869
|
type: "json",
|
|
111749
111870
|
stepIndex: stepIdx,
|
|
111871
|
+
durationMs: Date.now() - stepStartTime,
|
|
111750
111872
|
json: {
|
|
111751
111873
|
varName: parsed.varName,
|
|
111752
111874
|
filePath: result.filePath,
|
|
@@ -111835,8 +111957,8 @@ async function runSequenceWithJar(sequenceContent, fileVariables, cookieJar, wor
|
|
|
111835
111957
|
}
|
|
111836
111958
|
}
|
|
111837
111959
|
if (pathPart) {
|
|
111838
|
-
const
|
|
111839
|
-
newValue = getNestedValueFromObject(value,
|
|
111960
|
+
const path14 = pathPart.replace(/^\./, "");
|
|
111961
|
+
newValue = getNestedValueFromObject(value, path14);
|
|
111840
111962
|
} else {
|
|
111841
111963
|
newValue = value;
|
|
111842
111964
|
}
|
|
@@ -112025,6 +112147,7 @@ async function runSequenceWithJar(sequenceContent, fileVariables, cookieJar, wor
|
|
|
112025
112147
|
const stepResult = {
|
|
112026
112148
|
type: "sql",
|
|
112027
112149
|
stepIndex: stepIdx,
|
|
112150
|
+
durationMs: Date.now() - stepStartTime,
|
|
112028
112151
|
sql: sqlResult,
|
|
112029
112152
|
variableName: parsed.variableName,
|
|
112030
112153
|
lineNumber: step.lineNumber
|
|
@@ -112347,8 +112470,8 @@ ${indentMultiline(userMessage)}`;
|
|
|
112347
112470
|
if (sequenceSources) {
|
|
112348
112471
|
const sourceFile = sequenceSources.get(targetName.toLowerCase());
|
|
112349
112472
|
if (sourceFile) {
|
|
112350
|
-
const
|
|
112351
|
-
subWorkingDir =
|
|
112473
|
+
const path14 = await import("path");
|
|
112474
|
+
subWorkingDir = path14.dirname(sourceFile);
|
|
112352
112475
|
}
|
|
112353
112476
|
}
|
|
112354
112477
|
const targetLocation = executionContext?.sequenceLocationIndex?.get(targetName.toLowerCase());
|
|
@@ -112430,60 +112553,7 @@ ${indentMultiline(userMessage)}`;
|
|
|
112430
112553
|
let requestUrl = "";
|
|
112431
112554
|
let requestMethod = "";
|
|
112432
112555
|
try {
|
|
112433
|
-
|
|
112434
|
-
if (apiDefinitions && apiDefinitions.endpoints.length > 0 && isApiRequestLine(namedRequest.content, apiDefinitions.endpoints)) {
|
|
112435
|
-
const apiRequest = parseApiRequest(
|
|
112436
|
-
namedRequest.content,
|
|
112437
|
-
apiDefinitions.endpoints,
|
|
112438
|
-
apiDefinitions.headerGroups
|
|
112439
|
-
);
|
|
112440
|
-
if (apiRequest) {
|
|
112441
|
-
const endpoint = getEndpoint(
|
|
112442
|
-
{ headerGroups: apiDefinitions.headerGroups, endpoints: apiDefinitions.endpoints },
|
|
112443
|
-
apiRequest.endpointName
|
|
112444
|
-
);
|
|
112445
|
-
if (endpoint) {
|
|
112446
|
-
let resolvedPath = substituteVariables(endpoint.path, runtimeVariables);
|
|
112447
|
-
for (const [paramName, paramValue] of Object.entries(apiRequest.params)) {
|
|
112448
|
-
let resolvedValue = paramValue;
|
|
112449
|
-
if (runtimeVariables[paramValue] !== void 0) {
|
|
112450
|
-
resolvedValue = String(runtimeVariables[paramValue]);
|
|
112451
|
-
} else {
|
|
112452
|
-
resolvedValue = substituteVariables(paramValue, runtimeVariables);
|
|
112453
|
-
}
|
|
112454
|
-
resolvedPath = resolvedPath.replace(`{${paramName}}`, resolvedValue);
|
|
112455
|
-
}
|
|
112456
|
-
const combinedHeaders = {};
|
|
112457
|
-
for (const groupName of apiRequest.headerGroupNames) {
|
|
112458
|
-
const group = getHeaderGroup(apiDefinitions, groupName);
|
|
112459
|
-
if (group) {
|
|
112460
|
-
const resolvedHeaders = resolveHeaderValues(group, runtimeVariables);
|
|
112461
|
-
Object.assign(combinedHeaders, resolvedHeaders);
|
|
112462
|
-
}
|
|
112463
|
-
}
|
|
112464
|
-
for (const [headerName, headerValue] of Object.entries(apiRequest.inlineHeaders)) {
|
|
112465
|
-
const resolved = substituteVariables(headerValue, runtimeVariables);
|
|
112466
|
-
combinedHeaders[headerName] = resolved;
|
|
112467
|
-
}
|
|
112468
|
-
const bodyParsed = parserHttpRequest(namedRequest.content, runtimeVariables);
|
|
112469
|
-
requestParsed = {
|
|
112470
|
-
method: apiRequest.method,
|
|
112471
|
-
url: resolvedPath,
|
|
112472
|
-
headers: combinedHeaders,
|
|
112473
|
-
body: bodyParsed.body
|
|
112474
|
-
};
|
|
112475
|
-
} else {
|
|
112476
|
-
throw new Error(`Unknown endpoint: ${apiRequest.endpointName}`);
|
|
112477
|
-
}
|
|
112478
|
-
} else {
|
|
112479
|
-
requestParsed = parserHttpRequest(namedRequest.content, runtimeVariables);
|
|
112480
|
-
}
|
|
112481
|
-
} else {
|
|
112482
|
-
requestParsed = parserHttpRequest(namedRequest.content, runtimeVariables);
|
|
112483
|
-
if (apiDefinitions && apiDefinitions.headerGroups.length > 0) {
|
|
112484
|
-
requestParsed = applyHeaderGroupsToRequest(requestParsed, namedRequest.content, apiDefinitions.headerGroups, runtimeVariables);
|
|
112485
|
-
}
|
|
112486
|
-
}
|
|
112556
|
+
const requestParsed = buildParsedNamedRequest(namedRequest.content, runtimeVariables, apiDefinitions);
|
|
112487
112557
|
requestUrl = requestParsed.url;
|
|
112488
112558
|
requestMethod = requestParsed.method;
|
|
112489
112559
|
validatePreparedRequest(
|
|
@@ -112593,7 +112663,7 @@ ${indentMultiline(userMessage)}`;
|
|
|
112593
112663
|
let requestUrl = "";
|
|
112594
112664
|
let requestMethod = "";
|
|
112595
112665
|
try {
|
|
112596
|
-
const requestParsed =
|
|
112666
|
+
const requestParsed = buildParsedNamedRequest(namedRequest.content, runtimeVariables, apiDefinitions);
|
|
112597
112667
|
requestUrl = requestParsed.url;
|
|
112598
112668
|
requestMethod = requestParsed.method;
|
|
112599
112669
|
validatePreparedRequest(
|
|
@@ -112706,8 +112776,8 @@ ${indentMultiline(userMessage)}`;
|
|
|
112706
112776
|
if (sequenceSources) {
|
|
112707
112777
|
const sourceFile = sequenceSources.get(sequenceName.toLowerCase());
|
|
112708
112778
|
if (sourceFile) {
|
|
112709
|
-
const
|
|
112710
|
-
subWorkingDir =
|
|
112779
|
+
const path14 = await import("path");
|
|
112780
|
+
subWorkingDir = path14.dirname(sourceFile);
|
|
112711
112781
|
}
|
|
112712
112782
|
}
|
|
112713
112783
|
const targetLocation = executionContext?.sequenceLocationIndex?.get(sequenceName.toLowerCase());
|
|
@@ -112753,12 +112823,7 @@ ${indentMultiline(userMessage)}`;
|
|
|
112753
112823
|
const returnExpressions = extractReturnVariables(targetSequence.content);
|
|
112754
112824
|
if (returnExpressions && returnExpressions.length > 0 && subResult.variables) {
|
|
112755
112825
|
if (returnExpressions.length === 1) {
|
|
112756
|
-
|
|
112757
|
-
if (resolved) {
|
|
112758
|
-
runtimeVariables[varName] = resolved.value;
|
|
112759
|
-
} else {
|
|
112760
|
-
runtimeVariables[varName] = "";
|
|
112761
|
-
}
|
|
112826
|
+
runtimeVariables[varName] = resolveSingleReturnValue(returnExpressions[0], subResult.variables);
|
|
112762
112827
|
} else {
|
|
112763
112828
|
const returnedObj = {};
|
|
112764
112829
|
for (const expr of returnExpressions) {
|
|
@@ -113365,7 +113430,14 @@ function formatSequenceResult(result, options) {
|
|
|
113365
113430
|
lines.push("");
|
|
113366
113431
|
lines.push(colors.warning("Warnings/Errors:"));
|
|
113367
113432
|
for (const err of result.errors) {
|
|
113368
|
-
|
|
113433
|
+
const errLines = String(err ?? "").split("\n");
|
|
113434
|
+
if (errLines.length === 0) {
|
|
113435
|
+
continue;
|
|
113436
|
+
}
|
|
113437
|
+
lines.push(` ${colors.bullet} ${errLines[0]}`);
|
|
113438
|
+
for (const line2 of errLines.slice(1)) {
|
|
113439
|
+
lines.push(` ${line2}`);
|
|
113440
|
+
}
|
|
113369
113441
|
}
|
|
113370
113442
|
}
|
|
113371
113443
|
return lines;
|
|
@@ -113508,7 +113580,7 @@ function formatRunSummary(results, totalDuration, colors) {
|
|
|
113508
113580
|
}
|
|
113509
113581
|
|
|
113510
113582
|
// src/cli/reporters/junit.ts
|
|
113511
|
-
var
|
|
113583
|
+
var fs10 = __toESM(require("fs"));
|
|
113512
113584
|
function escapeXml(text) {
|
|
113513
113585
|
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
113514
113586
|
}
|
|
@@ -113528,7 +113600,7 @@ function generateJUnitReport(results, options) {
|
|
|
113528
113600
|
xml += generateTestSuite(result, redaction);
|
|
113529
113601
|
}
|
|
113530
113602
|
xml += "</testsuites>\n";
|
|
113531
|
-
|
|
113603
|
+
fs10.writeFileSync(outputPath, xml, "utf-8");
|
|
113532
113604
|
}
|
|
113533
113605
|
function generateTestSuite(result, redaction) {
|
|
113534
113606
|
const assertions = result.assertionResults || [];
|
|
@@ -113641,11 +113713,11 @@ Response: ${bodyStr}`;
|
|
|
113641
113713
|
xml += " </testcase>\n";
|
|
113642
113714
|
xml += " </testsuite>\n";
|
|
113643
113715
|
xml += "</testsuites>\n";
|
|
113644
|
-
|
|
113716
|
+
fs10.writeFileSync(outputPath, xml, "utf-8");
|
|
113645
113717
|
}
|
|
113646
113718
|
|
|
113647
113719
|
// src/cli/reporters/html.ts
|
|
113648
|
-
var
|
|
113720
|
+
var fs11 = __toESM(require("fs"));
|
|
113649
113721
|
function escapeHtml(text) {
|
|
113650
113722
|
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
113651
113723
|
}
|
|
@@ -113757,7 +113829,7 @@ function generateHtmlReport(results, options) {
|
|
|
113757
113829
|
</script>
|
|
113758
113830
|
</body>
|
|
113759
113831
|
</html>`;
|
|
113760
|
-
|
|
113832
|
+
fs11.writeFileSync(outputPath, html, "utf-8");
|
|
113761
113833
|
}
|
|
113762
113834
|
function generateSequenceHtml(result, index, redaction) {
|
|
113763
113835
|
const statusClass = result.success ? "passed" : "failed";
|
|
@@ -113927,7 +113999,7 @@ function generateErrorsHtml(errors, redaction) {
|
|
|
113927
113999
|
<div class="errors">
|
|
113928
114000
|
<h4>Errors</h4>
|
|
113929
114001
|
<ul>
|
|
113930
|
-
${errors.map((e) => `<li>${escapeHtml(redactString(e, redaction))}</li>`).join("\n")}
|
|
114002
|
+
${errors.map((e) => `<li>${escapeHtml(redactString(e, redaction)).replace(/\n/g, "<br>")}</li>`).join("\n")}
|
|
113931
114003
|
</ul>
|
|
113932
114004
|
</div>`;
|
|
113933
114005
|
}
|
|
@@ -114174,8 +114246,8 @@ function generateHtmlReportFromResponse(response, testName, options) {
|
|
|
114174
114246
|
}
|
|
114175
114247
|
|
|
114176
114248
|
// src/environmentParser.ts
|
|
114177
|
-
var
|
|
114178
|
-
var
|
|
114249
|
+
var fs14 = __toESM(require("fs"));
|
|
114250
|
+
var path10 = __toESM(require("path"));
|
|
114179
114251
|
|
|
114180
114252
|
// src/secrets/crypto.ts
|
|
114181
114253
|
var crypto6 = __toESM(require("crypto"));
|
|
@@ -114243,33 +114315,33 @@ function decryptSecretValue(encryptedValue, sharedKey) {
|
|
|
114243
114315
|
}
|
|
114244
114316
|
|
|
114245
114317
|
// src/secrets/keyStore.ts
|
|
114246
|
-
var
|
|
114247
|
-
var
|
|
114318
|
+
var fs13 = __toESM(require("fs"));
|
|
114319
|
+
var path9 = __toESM(require("path"));
|
|
114248
114320
|
|
|
114249
114321
|
// src/cacheDir.ts
|
|
114250
|
-
var
|
|
114251
|
-
var
|
|
114322
|
+
var fs12 = __toESM(require("fs"));
|
|
114323
|
+
var path8 = __toESM(require("path"));
|
|
114252
114324
|
var NORN_CACHE_DIR = ".norn-cache";
|
|
114253
114325
|
var CACHE_GITIGNORE_FILE = ".gitignore";
|
|
114254
114326
|
var CACHE_GITIGNORE_CONTENT = "*\n";
|
|
114255
114327
|
var PROJECT_ROOT_MARKERS = [".git", "package.json", "pnpm-workspace.yaml", "package-lock.json", "yarn.lock", ".nornenv"];
|
|
114256
114328
|
function getSearchStartDirectory(targetPath) {
|
|
114257
|
-
const resolvedPath =
|
|
114329
|
+
const resolvedPath = path8.resolve(targetPath);
|
|
114258
114330
|
try {
|
|
114259
|
-
const stats =
|
|
114260
|
-
return stats.isDirectory() ? resolvedPath :
|
|
114331
|
+
const stats = fs12.statSync(resolvedPath);
|
|
114332
|
+
return stats.isDirectory() ? resolvedPath : path8.dirname(resolvedPath);
|
|
114261
114333
|
} catch {
|
|
114262
|
-
return
|
|
114334
|
+
return path8.dirname(resolvedPath);
|
|
114263
114335
|
}
|
|
114264
114336
|
}
|
|
114265
114337
|
function findProjectRoot(targetPath) {
|
|
114266
114338
|
let dir = getSearchStartDirectory(targetPath);
|
|
114267
114339
|
let projectRoot;
|
|
114268
114340
|
while (true) {
|
|
114269
|
-
if (PROJECT_ROOT_MARKERS.some((marker) =>
|
|
114341
|
+
if (PROJECT_ROOT_MARKERS.some((marker) => fs12.existsSync(path8.join(dir, marker)))) {
|
|
114270
114342
|
projectRoot = dir;
|
|
114271
114343
|
}
|
|
114272
|
-
const parent =
|
|
114344
|
+
const parent = path8.dirname(dir);
|
|
114273
114345
|
if (parent === dir) {
|
|
114274
114346
|
break;
|
|
114275
114347
|
}
|
|
@@ -114278,13 +114350,13 @@ function findProjectRoot(targetPath) {
|
|
|
114278
114350
|
return projectRoot ?? getSearchStartDirectory(targetPath);
|
|
114279
114351
|
}
|
|
114280
114352
|
function ensureNornCacheGitignore(cacheDir) {
|
|
114281
|
-
const gitignorePath =
|
|
114353
|
+
const gitignorePath = path8.join(cacheDir, CACHE_GITIGNORE_FILE);
|
|
114282
114354
|
try {
|
|
114283
|
-
const hasDesiredContent =
|
|
114355
|
+
const hasDesiredContent = fs12.existsSync(gitignorePath) && fs12.readFileSync(gitignorePath, "utf8") === CACHE_GITIGNORE_CONTENT;
|
|
114284
114356
|
if (hasDesiredContent) {
|
|
114285
114357
|
return;
|
|
114286
114358
|
}
|
|
114287
|
-
|
|
114359
|
+
fs12.writeFileSync(gitignorePath, CACHE_GITIGNORE_CONTENT, "utf8");
|
|
114288
114360
|
} catch {
|
|
114289
114361
|
}
|
|
114290
114362
|
}
|
|
@@ -114296,12 +114368,12 @@ var CACHE_SCAN_IGNORED_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git", "
|
|
|
114296
114368
|
var sessionKeys = /* @__PURE__ */ new Map();
|
|
114297
114369
|
var projectSecretKeyCacheDirs = /* @__PURE__ */ new Map();
|
|
114298
114370
|
function getCacheFilePath(cacheDir) {
|
|
114299
|
-
return
|
|
114371
|
+
return path9.join(cacheDir, CACHE_FILE);
|
|
114300
114372
|
}
|
|
114301
114373
|
function cacheFileExists(cacheDir) {
|
|
114302
114374
|
const cacheFilePath = getCacheFilePath(cacheDir);
|
|
114303
114375
|
try {
|
|
114304
|
-
return
|
|
114376
|
+
return fs13.existsSync(cacheFilePath) && fs13.statSync(cacheFilePath).isFile();
|
|
114305
114377
|
} catch {
|
|
114306
114378
|
return false;
|
|
114307
114379
|
}
|
|
@@ -114318,13 +114390,13 @@ function getProjectSecretKeyCacheDirs(projectRoot) {
|
|
|
114318
114390
|
if (!dir) {
|
|
114319
114391
|
continue;
|
|
114320
114392
|
}
|
|
114321
|
-
const cacheDir =
|
|
114393
|
+
const cacheDir = path9.join(dir, NORN_CACHE_DIR);
|
|
114322
114394
|
if (cacheFileExists(cacheDir)) {
|
|
114323
114395
|
results.push(cacheDir);
|
|
114324
114396
|
}
|
|
114325
114397
|
let entries;
|
|
114326
114398
|
try {
|
|
114327
|
-
entries =
|
|
114399
|
+
entries = fs13.readdirSync(dir, { withFileTypes: true });
|
|
114328
114400
|
} catch {
|
|
114329
114401
|
continue;
|
|
114330
114402
|
}
|
|
@@ -114335,7 +114407,7 @@ function getProjectSecretKeyCacheDirs(projectRoot) {
|
|
|
114335
114407
|
if (entry.name === NORN_CACHE_DIR || CACHE_SCAN_IGNORED_DIRS.has(entry.name)) {
|
|
114336
114408
|
continue;
|
|
114337
114409
|
}
|
|
114338
|
-
queue.push(
|
|
114410
|
+
queue.push(path9.join(dir, entry.name));
|
|
114339
114411
|
}
|
|
114340
114412
|
}
|
|
114341
114413
|
results.sort();
|
|
@@ -114343,11 +114415,11 @@ function getProjectSecretKeyCacheDirs(projectRoot) {
|
|
|
114343
114415
|
return results;
|
|
114344
114416
|
}
|
|
114345
114417
|
function getCacheDistance(targetPath, cacheDir) {
|
|
114346
|
-
const relative5 =
|
|
114418
|
+
const relative5 = path9.relative(getSearchStartDirectory(targetPath), cacheDir);
|
|
114347
114419
|
if (!relative5 || relative5 === ".") {
|
|
114348
114420
|
return 0;
|
|
114349
114421
|
}
|
|
114350
|
-
return relative5.split(
|
|
114422
|
+
return relative5.split(path9.sep).filter((segment) => segment !== "").length;
|
|
114351
114423
|
}
|
|
114352
114424
|
function findExistingSecretKeyCacheDir(targetPath) {
|
|
114353
114425
|
const projectRoot = findProjectRoot(targetPath);
|
|
@@ -114374,9 +114446,9 @@ function rememberSecretKeyCacheDir(targetPath, cacheDir) {
|
|
|
114374
114446
|
function ensureCacheDir(targetPath) {
|
|
114375
114447
|
const existing = findExistingSecretKeyCacheDir(targetPath);
|
|
114376
114448
|
const projectRoot = findProjectRoot(targetPath);
|
|
114377
|
-
const cacheDir = existing ??
|
|
114378
|
-
if (!
|
|
114379
|
-
|
|
114449
|
+
const cacheDir = existing ?? path9.join(projectRoot, NORN_CACHE_DIR);
|
|
114450
|
+
if (!fs13.existsSync(cacheDir)) {
|
|
114451
|
+
fs13.mkdirSync(cacheDir, { recursive: true });
|
|
114380
114452
|
}
|
|
114381
114453
|
ensureNornCacheGitignore(cacheDir);
|
|
114382
114454
|
rememberSecretKeyCacheDir(targetPath, cacheDir);
|
|
@@ -114388,8 +114460,8 @@ function getReadCachePath(targetPath) {
|
|
|
114388
114460
|
return getCacheFilePath(existing);
|
|
114389
114461
|
}
|
|
114390
114462
|
const projectRoot = findProjectRoot(targetPath);
|
|
114391
|
-
const projectCacheDir =
|
|
114392
|
-
if (
|
|
114463
|
+
const projectCacheDir = path9.join(projectRoot, NORN_CACHE_DIR);
|
|
114464
|
+
if (fs13.existsSync(projectCacheDir) && fs13.statSync(projectCacheDir).isDirectory()) {
|
|
114393
114465
|
return getCacheFilePath(projectCacheDir);
|
|
114394
114466
|
}
|
|
114395
114467
|
return void 0;
|
|
@@ -114399,11 +114471,11 @@ function getWriteCachePath(targetPath) {
|
|
|
114399
114471
|
}
|
|
114400
114472
|
function readCache(targetPath) {
|
|
114401
114473
|
const cachePath = getReadCachePath(targetPath);
|
|
114402
|
-
if (!cachePath || !
|
|
114474
|
+
if (!cachePath || !fs13.existsSync(cachePath)) {
|
|
114403
114475
|
return { version: CACHE_VERSION, keys: {} };
|
|
114404
114476
|
}
|
|
114405
114477
|
try {
|
|
114406
|
-
const parsed = JSON.parse(
|
|
114478
|
+
const parsed = JSON.parse(fs13.readFileSync(cachePath, "utf8"));
|
|
114407
114479
|
if (parsed.version !== CACHE_VERSION || typeof parsed.keys !== "object" || parsed.keys === null) {
|
|
114408
114480
|
return { version: CACHE_VERSION, keys: {} };
|
|
114409
114481
|
}
|
|
@@ -114414,9 +114486,9 @@ function readCache(targetPath) {
|
|
|
114414
114486
|
}
|
|
114415
114487
|
function writeCache(targetPath, cache) {
|
|
114416
114488
|
const cachePath = getWriteCachePath(targetPath);
|
|
114417
|
-
|
|
114489
|
+
fs13.writeFileSync(cachePath, JSON.stringify(cache, null, 2), { encoding: "utf8", mode: 384 });
|
|
114418
114490
|
try {
|
|
114419
|
-
|
|
114491
|
+
fs13.chmodSync(cachePath, 384);
|
|
114420
114492
|
} catch {
|
|
114421
114493
|
}
|
|
114422
114494
|
}
|
|
@@ -114607,22 +114679,22 @@ function parseEnvFile(content, sourceFilePath) {
|
|
|
114607
114679
|
return config;
|
|
114608
114680
|
}
|
|
114609
114681
|
function getEnvSearchStartDirectory(targetPath) {
|
|
114610
|
-
const resolvedPath =
|
|
114682
|
+
const resolvedPath = path10.resolve(targetPath);
|
|
114611
114683
|
try {
|
|
114612
|
-
const stats =
|
|
114613
|
-
return stats.isDirectory() ? resolvedPath :
|
|
114684
|
+
const stats = fs14.statSync(resolvedPath);
|
|
114685
|
+
return stats.isDirectory() ? resolvedPath : path10.dirname(resolvedPath);
|
|
114614
114686
|
} catch {
|
|
114615
|
-
return
|
|
114687
|
+
return path10.dirname(resolvedPath);
|
|
114616
114688
|
}
|
|
114617
114689
|
}
|
|
114618
114690
|
function findEnvFileFromPath(filePath) {
|
|
114619
114691
|
let dir = getEnvSearchStartDirectory(filePath);
|
|
114620
114692
|
while (true) {
|
|
114621
|
-
const envPath =
|
|
114622
|
-
if (
|
|
114693
|
+
const envPath = path10.join(dir, ENV_FILENAME);
|
|
114694
|
+
if (fs14.existsSync(envPath)) {
|
|
114623
114695
|
return envPath;
|
|
114624
114696
|
}
|
|
114625
|
-
const parentDir =
|
|
114697
|
+
const parentDir = path10.dirname(dir);
|
|
114626
114698
|
if (parentDir === dir) {
|
|
114627
114699
|
break;
|
|
114628
114700
|
}
|
|
@@ -114647,7 +114719,7 @@ function resolveNornenvImports(config, baseDir, entryFilePath, readFile2, import
|
|
|
114647
114719
|
}
|
|
114648
114720
|
for (const imp of config.imports) {
|
|
114649
114721
|
const resolvedImportPath = resolveImportPath(imp.path, baseDir);
|
|
114650
|
-
if (!resolvedImportPath || !
|
|
114722
|
+
if (!resolvedImportPath || !fs14.existsSync(resolvedImportPath)) {
|
|
114651
114723
|
errors.push({
|
|
114652
114724
|
message: `Imported file not found: '${imp.path}'`,
|
|
114653
114725
|
filePath: entryFilePath,
|
|
@@ -114663,10 +114735,10 @@ function resolveNornenvImports(config, baseDir, entryFilePath, readFile2, import
|
|
|
114663
114735
|
});
|
|
114664
114736
|
continue;
|
|
114665
114737
|
}
|
|
114666
|
-
const normalizedPath =
|
|
114738
|
+
const normalizedPath = path10.resolve(resolvedImportPath);
|
|
114667
114739
|
if (stack.includes(normalizedPath)) {
|
|
114668
|
-
const entryDir =
|
|
114669
|
-
const cycle = [...stack, normalizedPath].map((p) =>
|
|
114740
|
+
const entryDir = path10.dirname(stack[0]);
|
|
114741
|
+
const cycle = [...stack, normalizedPath].map((p) => path10.relative(entryDir, p) || path10.basename(p)).join(" \u2192 ");
|
|
114670
114742
|
errors.push({
|
|
114671
114743
|
message: `Circular import detected: ${cycle}`,
|
|
114672
114744
|
filePath: entryFilePath,
|
|
@@ -114695,7 +114767,7 @@ function resolveNornenvImports(config, baseDir, entryFilePath, readFile2, import
|
|
|
114695
114767
|
if (importedConfig.imports.length > 0) {
|
|
114696
114768
|
const childResult = resolveNornenvImports(
|
|
114697
114769
|
importedConfig,
|
|
114698
|
-
|
|
114770
|
+
path10.dirname(normalizedPath),
|
|
114699
114771
|
normalizedPath,
|
|
114700
114772
|
readFile2,
|
|
114701
114773
|
[...stack, normalizedPath],
|
|
@@ -114713,7 +114785,7 @@ function resolveNornenvImports(config, baseDir, entryFilePath, readFile2, import
|
|
|
114713
114785
|
}
|
|
114714
114786
|
function resolveImportPath(importPath, baseDir) {
|
|
114715
114787
|
const cleaned = importPath.replace(/^["']|["']$/g, "");
|
|
114716
|
-
return
|
|
114788
|
+
return path10.resolve(baseDir, cleaned);
|
|
114717
114789
|
}
|
|
114718
114790
|
function registerVariableOrigins(config, filePath, origins) {
|
|
114719
114791
|
for (const varName of Object.keys(config.common)) {
|
|
@@ -114777,12 +114849,12 @@ function mergeConfigs(target, source, targetFilePath, sourceFilePath, variableOr
|
|
|
114777
114849
|
}
|
|
114778
114850
|
}
|
|
114779
114851
|
function toDisplayPath(filePath, entryFilePath) {
|
|
114780
|
-
const entryDir =
|
|
114781
|
-
const relative5 =
|
|
114782
|
-
return relative5 && relative5 !== "" ? relative5 :
|
|
114852
|
+
const entryDir = path10.dirname(entryFilePath);
|
|
114853
|
+
const relative5 = path10.relative(entryDir, filePath);
|
|
114854
|
+
return relative5 && relative5 !== "" ? relative5 : path10.basename(filePath);
|
|
114783
114855
|
}
|
|
114784
114856
|
function loadAndResolveEnvFile(filePath) {
|
|
114785
|
-
const content =
|
|
114857
|
+
const content = fs14.readFileSync(filePath, "utf-8");
|
|
114786
114858
|
const config = parseEnvFile(content, filePath);
|
|
114787
114859
|
if (config.imports.length === 0) {
|
|
114788
114860
|
const secretErrors = resolveEncryptedSecretValues(config, filePath);
|
|
@@ -114790,9 +114862,9 @@ function loadAndResolveEnvFile(filePath) {
|
|
|
114790
114862
|
}
|
|
114791
114863
|
const result = resolveNornenvImports(
|
|
114792
114864
|
config,
|
|
114793
|
-
|
|
114865
|
+
path10.dirname(filePath),
|
|
114794
114866
|
filePath,
|
|
114795
|
-
(p) =>
|
|
114867
|
+
(p) => fs14.readFileSync(p, "utf-8")
|
|
114796
114868
|
);
|
|
114797
114869
|
result.secretErrors.push(...resolveEncryptedSecretValues(result.config, filePath));
|
|
114798
114870
|
return result;
|
|
@@ -114858,14 +114930,14 @@ function resolveEncryptedSecretValues(config, entryFilePath) {
|
|
|
114858
114930
|
}
|
|
114859
114931
|
|
|
114860
114932
|
// src/secrets/cliSecrets.ts
|
|
114861
|
-
var
|
|
114862
|
-
var
|
|
114933
|
+
var fs16 = __toESM(require("fs"));
|
|
114934
|
+
var path12 = __toESM(require("path"));
|
|
114863
114935
|
var readline = __toESM(require("readline"));
|
|
114864
114936
|
var import_process = require("process");
|
|
114865
114937
|
|
|
114866
114938
|
// src/secrets/envFileSecrets.ts
|
|
114867
|
-
var
|
|
114868
|
-
var
|
|
114939
|
+
var fs15 = __toESM(require("fs"));
|
|
114940
|
+
var path11 = __toESM(require("path"));
|
|
114869
114941
|
var envRegex2 = /^\s*\[env:([a-zA-Z_][a-zA-Z0-9_-]*)\]\s*$/;
|
|
114870
114942
|
var secretConnectionStringRegex2 = /^(\s*secret\s+connectionString\s+)([a-zA-Z_][a-zA-Z0-9_]*)(\s*=\s*)(.+)$/;
|
|
114871
114943
|
var secretRegex2 = /^(\s*secret\s+)([a-zA-Z_][a-zA-Z0-9_]*)(\s*=\s*)(.+)$/;
|
|
@@ -114876,7 +114948,7 @@ function detectEol(content) {
|
|
|
114876
114948
|
return content.includes("\r\n") ? "\r\n" : "\n";
|
|
114877
114949
|
}
|
|
114878
114950
|
function isNornenvFilePath(filePath) {
|
|
114879
|
-
return
|
|
114951
|
+
return path11.basename(filePath).toLowerCase() === ".nornenv";
|
|
114880
114952
|
}
|
|
114881
114953
|
function extractSecretLines(content, filePath) {
|
|
114882
114954
|
const lines = splitContentLines(content);
|
|
@@ -114950,7 +115022,7 @@ function findSecretLine(content, variableName, envName) {
|
|
|
114950
115022
|
return secretLines.find((secret) => secret.name === variableName);
|
|
114951
115023
|
}
|
|
114952
115024
|
function loadSecretLine(filePath, variableName, envName) {
|
|
114953
|
-
const content =
|
|
115025
|
+
const content = fs15.readFileSync(filePath, "utf8");
|
|
114954
115026
|
const secret = findSecretLine(content, variableName, envName);
|
|
114955
115027
|
if (!secret) {
|
|
114956
115028
|
const envLabel = envName ? ` in [env:${envName}]` : "";
|
|
@@ -114959,22 +115031,22 @@ function loadSecretLine(filePath, variableName, envName) {
|
|
|
114959
115031
|
return { content, secret };
|
|
114960
115032
|
}
|
|
114961
115033
|
function writeSecretLine(filePath, content) {
|
|
114962
|
-
|
|
115034
|
+
fs15.writeFileSync(filePath, content, "utf8");
|
|
114963
115035
|
}
|
|
114964
115036
|
function discoverNornenvFiles(targetPath) {
|
|
114965
|
-
const resolved =
|
|
114966
|
-
if (!
|
|
115037
|
+
const resolved = path11.resolve(targetPath);
|
|
115038
|
+
if (!fs15.existsSync(resolved)) {
|
|
114967
115039
|
return [];
|
|
114968
115040
|
}
|
|
114969
|
-
const stats =
|
|
115041
|
+
const stats = fs15.statSync(resolved);
|
|
114970
115042
|
if (stats.isFile()) {
|
|
114971
115043
|
return isNornenvFilePath(resolved) ? [resolved] : [];
|
|
114972
115044
|
}
|
|
114973
115045
|
const results = [];
|
|
114974
115046
|
const walk = (dir) => {
|
|
114975
|
-
const entries =
|
|
115047
|
+
const entries = fs15.readdirSync(dir, { withFileTypes: true });
|
|
114976
115048
|
for (const entry of entries) {
|
|
114977
|
-
const fullPath =
|
|
115049
|
+
const fullPath = path11.join(dir, entry.name);
|
|
114978
115050
|
if (entry.isDirectory()) {
|
|
114979
115051
|
if (entry.name === "node_modules" || entry.name === ".git" || entry.name === "dist" || entry.name === "out") {
|
|
114980
115052
|
continue;
|
|
@@ -115011,8 +115083,8 @@ async function promptLine(question) {
|
|
|
115011
115083
|
}
|
|
115012
115084
|
const rl = readline.createInterface({ input: import_process.stdin, output: import_process.stdout });
|
|
115013
115085
|
try {
|
|
115014
|
-
const answer = await new Promise((
|
|
115015
|
-
rl.question(question,
|
|
115086
|
+
const answer = await new Promise((resolve12) => {
|
|
115087
|
+
rl.question(question, resolve12);
|
|
115016
115088
|
});
|
|
115017
115089
|
const trimmed = answer.trim();
|
|
115018
115090
|
return trimmed === "" ? void 0 : trimmed;
|
|
@@ -115033,8 +115105,8 @@ function formatSecretError(err, envFilePath) {
|
|
|
115033
115105
|
if (!envFilePath) {
|
|
115034
115106
|
return `${err.message}`;
|
|
115035
115107
|
}
|
|
115036
|
-
const relative5 =
|
|
115037
|
-
const fileLabel = relative5 && relative5 !== "" ? relative5 :
|
|
115108
|
+
const relative5 = path12.relative(path12.dirname(envFilePath), err.filePath);
|
|
115109
|
+
const fileLabel = relative5 && relative5 !== "" ? relative5 : path12.basename(err.filePath);
|
|
115038
115110
|
const lineLabel = err.line >= 0 ? `${fileLabel}:${err.line + 1}` : fileLabel;
|
|
115039
115111
|
return `${lineLabel} - ${err.message}`;
|
|
115040
115112
|
}
|
|
@@ -115130,7 +115202,7 @@ async function handleEncrypt(args) {
|
|
|
115130
115202
|
console.error(`Error: encrypt requires --file and --var.`);
|
|
115131
115203
|
return 1;
|
|
115132
115204
|
}
|
|
115133
|
-
const absoluteFilePath =
|
|
115205
|
+
const absoluteFilePath = path12.resolve(filePath);
|
|
115134
115206
|
const { content, secret } = loadSecretLine(absoluteFilePath, variableName, envName);
|
|
115135
115207
|
if (secret.encrypted) {
|
|
115136
115208
|
console.error(`Error: Secret '${variableName}' is already encrypted. Use rotate instead.`);
|
|
@@ -115162,7 +115234,7 @@ async function handleRotate(args) {
|
|
|
115162
115234
|
console.error(`Error: rotate requires --file and --var.`);
|
|
115163
115235
|
return 1;
|
|
115164
115236
|
}
|
|
115165
|
-
const absoluteFilePath =
|
|
115237
|
+
const absoluteFilePath = path12.resolve(filePath);
|
|
115166
115238
|
const { content, secret } = loadSecretLine(absoluteFilePath, variableName, envName);
|
|
115167
115239
|
let kid = explicitKid;
|
|
115168
115240
|
if (!kid && secret.encrypted) {
|
|
@@ -115193,7 +115265,7 @@ async function handleRotate(args) {
|
|
|
115193
115265
|
}
|
|
115194
115266
|
async function handleRekey(args) {
|
|
115195
115267
|
const positional = args.filter((arg) => !arg.startsWith("-"));
|
|
115196
|
-
const targetPath = positional[0] ?
|
|
115268
|
+
const targetPath = positional[0] ? path12.resolve(positional[0]) : process.cwd();
|
|
115197
115269
|
const targetKid = getFlagValue(args, "--kid");
|
|
115198
115270
|
const files = discoverNornenvFiles(targetPath);
|
|
115199
115271
|
if (files.length === 0) {
|
|
@@ -115203,7 +115275,7 @@ async function handleRekey(args) {
|
|
|
115203
115275
|
let updatedFiles = 0;
|
|
115204
115276
|
let updatedSecrets = 0;
|
|
115205
115277
|
for (const filePath of files) {
|
|
115206
|
-
const original =
|
|
115278
|
+
const original = fs16.readFileSync(filePath, "utf8");
|
|
115207
115279
|
const secretLines = extractSecretLines(original, filePath);
|
|
115208
115280
|
if (secretLines.length === 0) {
|
|
115209
115281
|
continue;
|
|
@@ -115254,7 +115326,7 @@ async function handleRekey(args) {
|
|
|
115254
115326
|
updatedSecrets += 1;
|
|
115255
115327
|
}
|
|
115256
115328
|
if (updated !== original) {
|
|
115257
|
-
|
|
115329
|
+
fs16.writeFileSync(filePath, updated, "utf8");
|
|
115258
115330
|
updatedFiles += 1;
|
|
115259
115331
|
}
|
|
115260
115332
|
}
|
|
@@ -115263,7 +115335,7 @@ async function handleRekey(args) {
|
|
|
115263
115335
|
}
|
|
115264
115336
|
async function handleAudit(args) {
|
|
115265
115337
|
const positional = args.filter((arg) => !arg.startsWith("-"));
|
|
115266
|
-
const targetPath = positional[0] ?
|
|
115338
|
+
const targetPath = positional[0] ? path12.resolve(positional[0]) : process.cwd();
|
|
115267
115339
|
const files = discoverNornenvFiles(targetPath);
|
|
115268
115340
|
if (files.length === 0) {
|
|
115269
115341
|
console.log(`No .nornenv files found under ${targetPath}`);
|
|
@@ -115271,7 +115343,7 @@ async function handleAudit(args) {
|
|
|
115271
115343
|
}
|
|
115272
115344
|
const issues = [];
|
|
115273
115345
|
for (const filePath of files) {
|
|
115274
|
-
const content =
|
|
115346
|
+
const content = fs16.readFileSync(filePath, "utf8");
|
|
115275
115347
|
const secrets = extractSecretLines(content, filePath);
|
|
115276
115348
|
for (const secret of secrets) {
|
|
115277
115349
|
if (!secret.encrypted) {
|
|
@@ -115358,9 +115430,9 @@ function printSecretResolutionErrors(errors, envFilePath) {
|
|
|
115358
115430
|
|
|
115359
115431
|
// src/cli.ts
|
|
115360
115432
|
function formatNornenvErrorLocation(rootEnvFilePath, errorFilePath, line2) {
|
|
115361
|
-
const baseDir =
|
|
115362
|
-
const relativePath =
|
|
115363
|
-
const fileLabel = relativePath && relativePath !== "" ? relativePath :
|
|
115433
|
+
const baseDir = path13.dirname(rootEnvFilePath);
|
|
115434
|
+
const relativePath = path13.relative(baseDir, errorFilePath);
|
|
115435
|
+
const fileLabel = relativePath && relativePath !== "" ? relativePath : path13.basename(errorFilePath);
|
|
115364
115436
|
return line2 >= 0 ? `${fileLabel}:${line2 + 1}` : fileLabel;
|
|
115365
115437
|
}
|
|
115366
115438
|
function resolveEnvironmentForPath(targetPath, selectedEnv) {
|
|
@@ -115442,10 +115514,10 @@ function generateTimestamp() {
|
|
|
115442
115514
|
return `${year}-${month}-${day}-${hours}${minutes}${seconds}`;
|
|
115443
115515
|
}
|
|
115444
115516
|
function generateReportPaths(outputDir, inputFile, timestamp) {
|
|
115445
|
-
const baseName =
|
|
115517
|
+
const baseName = path13.basename(inputFile, path13.extname(inputFile));
|
|
115446
115518
|
return {
|
|
115447
|
-
junitPath:
|
|
115448
|
-
htmlPath:
|
|
115519
|
+
junitPath: path13.join(outputDir, `${baseName}-${timestamp}-results.xml`),
|
|
115520
|
+
htmlPath: path13.join(outputDir, `${baseName}-${timestamp}-report.html`)
|
|
115449
115521
|
};
|
|
115450
115522
|
}
|
|
115451
115523
|
function parseArgs(args) {
|
|
@@ -115710,9 +115782,9 @@ async function runSingleRequest(fileContent, variables, cookieJar, apiDefinition
|
|
|
115710
115782
|
function discoverNornFiles(dirPath) {
|
|
115711
115783
|
const files = [];
|
|
115712
115784
|
function walkDir(currentPath) {
|
|
115713
|
-
const entries =
|
|
115785
|
+
const entries = fs17.readdirSync(currentPath, { withFileTypes: true });
|
|
115714
115786
|
for (const entry of entries) {
|
|
115715
|
-
const fullPath =
|
|
115787
|
+
const fullPath = path13.join(currentPath, entry.name);
|
|
115716
115788
|
if (entry.isDirectory()) {
|
|
115717
115789
|
if (!entry.name.startsWith(".") && entry.name !== "node_modules") {
|
|
115718
115790
|
walkDir(fullPath);
|
|
@@ -115732,7 +115804,7 @@ function countTestSequences(fileContent, tagFilterOptions) {
|
|
|
115732
115804
|
return { total: testSequences.length, filtered };
|
|
115733
115805
|
}
|
|
115734
115806
|
async function loadTheoryFile(theoryPath, workingDir) {
|
|
115735
|
-
const absolutePath =
|
|
115807
|
+
const absolutePath = path13.resolve(workingDir, theoryPath);
|
|
115736
115808
|
const content = await fsPromises.readFile(absolutePath, "utf-8");
|
|
115737
115809
|
return JSON.parse(content);
|
|
115738
115810
|
}
|
|
@@ -115853,12 +115925,12 @@ async function main() {
|
|
|
115853
115925
|
if (options.insecure) {
|
|
115854
115926
|
console.error(colors.warning("Warning: TLS certificate verification is disabled (--insecure). Use this only for local development."));
|
|
115855
115927
|
}
|
|
115856
|
-
const inputPath =
|
|
115857
|
-
if (!
|
|
115928
|
+
const inputPath = path13.resolve(options.file);
|
|
115929
|
+
if (!fs17.existsSync(inputPath)) {
|
|
115858
115930
|
console.error(`Error: Path not found: ${inputPath}`);
|
|
115859
115931
|
process.exit(1);
|
|
115860
115932
|
}
|
|
115861
|
-
const isDirectory =
|
|
115933
|
+
const isDirectory = fs17.statSync(inputPath).isDirectory();
|
|
115862
115934
|
let filesToRun;
|
|
115863
115935
|
if (isDirectory) {
|
|
115864
115936
|
filesToRun = discoverNornFiles(inputPath);
|
|
@@ -115925,11 +115997,11 @@ async function main() {
|
|
|
115925
115997
|
}
|
|
115926
115998
|
mergeSecrets(combinedSecretNames, combinedSecretValues, resolvedEnv.secretNames, resolvedEnv.secretValues);
|
|
115927
115999
|
const redaction2 = createRedactionOptions(combinedSecretNames, combinedSecretValues, !options.noRedact);
|
|
115928
|
-
const fileContent =
|
|
116000
|
+
const fileContent = fs17.readFileSync(filePath, "utf-8");
|
|
115929
116001
|
const fileVariables = extractFileLevelVariables(fileContent);
|
|
115930
116002
|
const variables = attachEnvironmentScope({ ...resolvedEnv.variables, ...fileVariables }, resolvedEnv.variables);
|
|
115931
116003
|
const cookieJar = createCookieJar();
|
|
115932
|
-
const workingDir =
|
|
116004
|
+
const workingDir = path13.dirname(filePath);
|
|
115933
116005
|
const importResult = await resolveImports(
|
|
115934
116006
|
fileContent,
|
|
115935
116007
|
workingDir,
|
|
@@ -116097,7 +116169,7 @@ ${fileContent}` : fileContent;
|
|
|
116097
116169
|
let totalTestCount = 0;
|
|
116098
116170
|
let filteredTestCount = 0;
|
|
116099
116171
|
for (const filePath of filesToRun) {
|
|
116100
|
-
const fileContent =
|
|
116172
|
+
const fileContent = fs17.readFileSync(filePath, "utf-8");
|
|
116101
116173
|
const counts = countTestSequences(fileContent, tagFilterOptions);
|
|
116102
116174
|
totalTestCount += counts.total;
|
|
116103
116175
|
filteredTestCount += counts.filtered;
|
|
@@ -116139,16 +116211,16 @@ ${fileContent}` : fileContent;
|
|
|
116139
116211
|
process.exit(1);
|
|
116140
116212
|
}
|
|
116141
116213
|
if (!resolvedEnv.envFilePath && options.env) {
|
|
116142
|
-
const relPath = isDirectory ?
|
|
116214
|
+
const relPath = isDirectory ? path13.relative(inputPath, filePath) : path13.basename(filePath);
|
|
116143
116215
|
console.error(colors.warning(`Warning: --env specified but no .nornenv file found for ${relPath}`));
|
|
116144
116216
|
}
|
|
116145
116217
|
mergeSecrets(combinedSecretNames, combinedSecretValues, resolvedEnv.secretNames, resolvedEnv.secretValues);
|
|
116146
116218
|
const redaction2 = createRedactionOptions(combinedSecretNames, combinedSecretValues, !options.noRedact);
|
|
116147
|
-
const fileContent =
|
|
116219
|
+
const fileContent = fs17.readFileSync(filePath, "utf-8");
|
|
116148
116220
|
const fileVariables = extractFileLevelVariables(fileContent);
|
|
116149
116221
|
const variables = attachEnvironmentScope({ ...resolvedEnv.variables, ...fileVariables }, resolvedEnv.variables);
|
|
116150
116222
|
const cookieJar = createCookieJar();
|
|
116151
|
-
const workingDir =
|
|
116223
|
+
const workingDir = path13.dirname(filePath);
|
|
116152
116224
|
const importResult = await resolveImports(
|
|
116153
116225
|
fileContent,
|
|
116154
116226
|
workingDir,
|
|
@@ -116181,7 +116253,7 @@ ${fileContent}` : fileContent;
|
|
|
116181
116253
|
continue;
|
|
116182
116254
|
}
|
|
116183
116255
|
if (isDirectory && options.output !== "json") {
|
|
116184
|
-
const relPath =
|
|
116256
|
+
const relPath = path13.relative(inputPath, filePath);
|
|
116185
116257
|
console.log(colors.info(`
|
|
116186
116258
|
\u2501\u2501\u2501 ${relPath} \u2501\u2501\u2501`));
|
|
116187
116259
|
}
|
|
@@ -116226,7 +116298,7 @@ ${fileContent}` : fileContent;
|
|
|
116226
116298
|
let htmlOutputPath = options.htmlOutput;
|
|
116227
116299
|
if (options.outputDir) {
|
|
116228
116300
|
const timestamp = generateTimestamp();
|
|
116229
|
-
const baseName = isDirectory ?
|
|
116301
|
+
const baseName = isDirectory ? path13.basename(inputPath) : path13.basename(inputPath, path13.extname(inputPath));
|
|
116230
116302
|
const generatedPaths = generateReportPaths(options.outputDir, baseName + ".norn", timestamp);
|
|
116231
116303
|
if (!junitOutputPath) {
|
|
116232
116304
|
junitOutputPath = generatedPaths.junitPath;
|
|
@@ -116234,12 +116306,12 @@ ${fileContent}` : fileContent;
|
|
|
116234
116306
|
if (!htmlOutputPath) {
|
|
116235
116307
|
htmlOutputPath = generatedPaths.htmlPath;
|
|
116236
116308
|
}
|
|
116237
|
-
if (!
|
|
116238
|
-
|
|
116309
|
+
if (!fs17.existsSync(options.outputDir)) {
|
|
116310
|
+
fs17.mkdirSync(options.outputDir, { recursive: true });
|
|
116239
116311
|
}
|
|
116240
116312
|
}
|
|
116241
116313
|
if (junitOutputPath) {
|
|
116242
|
-
const suiteName = isDirectory ?
|
|
116314
|
+
const suiteName = isDirectory ? path13.basename(inputPath) : path13.basename(inputPath, path13.extname(inputPath));
|
|
116243
116315
|
if (result.type === "request") {
|
|
116244
116316
|
generateJUnitReportFromResponse(
|
|
116245
116317
|
result.results[0],
|
|
@@ -116255,11 +116327,11 @@ ${fileContent}` : fileContent;
|
|
|
116255
116327
|
console.log(colors.info(`JUnit report written to: ${junitOutputPath}`));
|
|
116256
116328
|
}
|
|
116257
116329
|
if (htmlOutputPath) {
|
|
116258
|
-
const title = `Norn Test Report - ${
|
|
116330
|
+
const title = `Norn Test Report - ${path13.basename(inputPath)}`;
|
|
116259
116331
|
if (result.type === "request") {
|
|
116260
116332
|
generateHtmlReportFromResponse(
|
|
116261
116333
|
result.results[0],
|
|
116262
|
-
options.request ||
|
|
116334
|
+
options.request || path13.basename(inputPath),
|
|
116263
116335
|
{ outputPath: htmlOutputPath, redaction, title }
|
|
116264
116336
|
);
|
|
116265
116337
|
} else {
|