dsh-db-tool 1.9.0 → 1.9.1
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 +14 -0
- package/README.md +1 -1
- package/README_EN.md +1 -1
- package/package.json +1 -1
- package/vendor/sqlserver-driver.cjs +1046 -747
|
@@ -42,9 +42,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
42
42
|
));
|
|
43
43
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
44
44
|
|
|
45
|
-
// node_modules/
|
|
45
|
+
// node_modules/ms/index.js
|
|
46
46
|
var require_ms = __commonJS({
|
|
47
|
-
"node_modules/
|
|
47
|
+
"node_modules/ms/index.js"(exports2, module2) {
|
|
48
48
|
var s = 1e3;
|
|
49
49
|
var m = s * 60;
|
|
50
50
|
var h = m * 60;
|
|
@@ -2356,7 +2356,7 @@ var require_table = __commonJS({
|
|
|
2356
2356
|
let cursor = -1;
|
|
2357
2357
|
let buffer = "";
|
|
2358
2358
|
let escaped = false;
|
|
2359
|
-
const
|
|
2359
|
+
const path3 = [];
|
|
2360
2360
|
while (++cursor < length) {
|
|
2361
2361
|
const char = name.charAt(cursor);
|
|
2362
2362
|
if (char === "[") {
|
|
@@ -2375,7 +2375,7 @@ var require_table = __commonJS({
|
|
|
2375
2375
|
if (escaped) {
|
|
2376
2376
|
buffer += char;
|
|
2377
2377
|
} else {
|
|
2378
|
-
|
|
2378
|
+
path3.push(buffer);
|
|
2379
2379
|
buffer = "";
|
|
2380
2380
|
}
|
|
2381
2381
|
} else {
|
|
@@ -2383,26 +2383,26 @@ var require_table = __commonJS({
|
|
|
2383
2383
|
}
|
|
2384
2384
|
}
|
|
2385
2385
|
if (buffer) {
|
|
2386
|
-
|
|
2386
|
+
path3.push(buffer);
|
|
2387
2387
|
}
|
|
2388
|
-
switch (
|
|
2388
|
+
switch (path3.length) {
|
|
2389
2389
|
case 1:
|
|
2390
2390
|
return {
|
|
2391
|
-
name:
|
|
2391
|
+
name: path3[0],
|
|
2392
2392
|
schema: null,
|
|
2393
2393
|
database: null
|
|
2394
2394
|
};
|
|
2395
2395
|
case 2:
|
|
2396
2396
|
return {
|
|
2397
|
-
name:
|
|
2398
|
-
schema:
|
|
2397
|
+
name: path3[1],
|
|
2398
|
+
schema: path3[0],
|
|
2399
2399
|
database: null
|
|
2400
2400
|
};
|
|
2401
2401
|
case 3:
|
|
2402
2402
|
return {
|
|
2403
|
-
name:
|
|
2404
|
-
schema:
|
|
2405
|
-
database:
|
|
2403
|
+
name: path3[2],
|
|
2404
|
+
schema: path3[1],
|
|
2405
|
+
database: path3[0]
|
|
2406
2406
|
};
|
|
2407
2407
|
default:
|
|
2408
2408
|
throw new Error("Invalid table name.");
|
|
@@ -5783,7 +5783,7 @@ var require_constants = __commonJS({
|
|
|
5783
5783
|
SDK_VERSION: () => SDK_VERSION
|
|
5784
5784
|
});
|
|
5785
5785
|
module2.exports = __toCommonJS2(constants_exports);
|
|
5786
|
-
var SDK_VERSION = `4.
|
|
5786
|
+
var SDK_VERSION = `4.14.1`;
|
|
5787
5787
|
var DeveloperSignOnClientId = "04b07795-8ddb-461a-bbee-02f9e1bf7b46";
|
|
5788
5788
|
var DefaultTenantId = "common";
|
|
5789
5789
|
var AzureAuthorityHosts2 = /* @__PURE__ */ ((AzureAuthorityHosts22) => {
|
|
@@ -5860,8 +5860,8 @@ var require_msalPlugins = __commonJS({
|
|
|
5860
5860
|
}
|
|
5861
5861
|
};
|
|
5862
5862
|
var msalNodeFlowVSCodeCredentialControl = {
|
|
5863
|
-
setVSCodeAuthRecordPath(
|
|
5864
|
-
vsCodeAuthRecordPath =
|
|
5863
|
+
setVSCodeAuthRecordPath(path3) {
|
|
5864
|
+
vsCodeAuthRecordPath = path3;
|
|
5865
5865
|
},
|
|
5866
5866
|
setVSCodeBroker(broker) {
|
|
5867
5867
|
vsCodeBrokerInfo = {
|
|
@@ -6162,10 +6162,10 @@ var require_log = __commonJS({
|
|
|
6162
6162
|
});
|
|
6163
6163
|
module2.exports = __toCommonJS2(log_exports);
|
|
6164
6164
|
var import_node_os2 = require("node:os");
|
|
6165
|
-
var
|
|
6166
|
-
var
|
|
6165
|
+
var import_node_util7 = __toESM2(require("node:util"));
|
|
6166
|
+
var import_node_process9 = __toESM2(require("node:process"));
|
|
6167
6167
|
function log(message, ...args) {
|
|
6168
|
-
|
|
6168
|
+
import_node_process9.default.stderr.write(`${import_node_util7.default.format(message, ...args)}${import_node_os2.EOL}`);
|
|
6169
6169
|
}
|
|
6170
6170
|
}
|
|
6171
6171
|
});
|
|
@@ -6213,17 +6213,17 @@ var require_env = __commonJS({
|
|
|
6213
6213
|
isWebWorker: () => isWebWorker2
|
|
6214
6214
|
});
|
|
6215
6215
|
module2.exports = __toCommonJS2(env_exports);
|
|
6216
|
-
var
|
|
6216
|
+
var import_node_process9 = __toESM2(require("node:process"));
|
|
6217
6217
|
function getEnvironmentVariable(name) {
|
|
6218
|
-
return
|
|
6218
|
+
return import_node_process9.default.env[name];
|
|
6219
6219
|
}
|
|
6220
6220
|
function emitNodeWarning(warning) {
|
|
6221
|
-
|
|
6221
|
+
import_node_process9.default.emitWarning(warning);
|
|
6222
6222
|
}
|
|
6223
6223
|
var isBrowser2 = false;
|
|
6224
6224
|
var isWebWorker2 = false;
|
|
6225
|
-
var isDeno2 = typeof
|
|
6226
|
-
var isBun2 = typeof
|
|
6225
|
+
var isDeno2 = typeof import_node_process9.default.versions.deno === "string" && import_node_process9.default.versions.deno.length > 0;
|
|
6226
|
+
var isBun2 = typeof import_node_process9.default.versions.bun === "string" && import_node_process9.default.versions.bun.length > 0;
|
|
6227
6227
|
var isNodeLike2 = true;
|
|
6228
6228
|
var isNodeRuntime2 = !isBun2 && !isDeno2;
|
|
6229
6229
|
var isReactNative2 = false;
|
|
@@ -7922,126 +7922,10 @@ var require_TokenExpiredError = __commonJS({
|
|
|
7922
7922
|
}
|
|
7923
7923
|
});
|
|
7924
7924
|
|
|
7925
|
-
// node_modules/jsonwebtoken/node_modules/ms/index.js
|
|
7926
|
-
var require_ms2 = __commonJS({
|
|
7927
|
-
"node_modules/jsonwebtoken/node_modules/ms/index.js"(exports2, module2) {
|
|
7928
|
-
var s = 1e3;
|
|
7929
|
-
var m = s * 60;
|
|
7930
|
-
var h = m * 60;
|
|
7931
|
-
var d = h * 24;
|
|
7932
|
-
var w = d * 7;
|
|
7933
|
-
var y = d * 365.25;
|
|
7934
|
-
module2.exports = function(val, options) {
|
|
7935
|
-
options = options || {};
|
|
7936
|
-
var type = typeof val;
|
|
7937
|
-
if (type === "string" && val.length > 0) {
|
|
7938
|
-
return parse(val);
|
|
7939
|
-
} else if (type === "number" && isFinite(val)) {
|
|
7940
|
-
return options.long ? fmtLong(val) : fmtShort(val);
|
|
7941
|
-
}
|
|
7942
|
-
throw new Error(
|
|
7943
|
-
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
7944
|
-
);
|
|
7945
|
-
};
|
|
7946
|
-
function parse(str) {
|
|
7947
|
-
str = String(str);
|
|
7948
|
-
if (str.length > 100) {
|
|
7949
|
-
return;
|
|
7950
|
-
}
|
|
7951
|
-
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
7952
|
-
str
|
|
7953
|
-
);
|
|
7954
|
-
if (!match) {
|
|
7955
|
-
return;
|
|
7956
|
-
}
|
|
7957
|
-
var n = parseFloat(match[1]);
|
|
7958
|
-
var type = (match[2] || "ms").toLowerCase();
|
|
7959
|
-
switch (type) {
|
|
7960
|
-
case "years":
|
|
7961
|
-
case "year":
|
|
7962
|
-
case "yrs":
|
|
7963
|
-
case "yr":
|
|
7964
|
-
case "y":
|
|
7965
|
-
return n * y;
|
|
7966
|
-
case "weeks":
|
|
7967
|
-
case "week":
|
|
7968
|
-
case "w":
|
|
7969
|
-
return n * w;
|
|
7970
|
-
case "days":
|
|
7971
|
-
case "day":
|
|
7972
|
-
case "d":
|
|
7973
|
-
return n * d;
|
|
7974
|
-
case "hours":
|
|
7975
|
-
case "hour":
|
|
7976
|
-
case "hrs":
|
|
7977
|
-
case "hr":
|
|
7978
|
-
case "h":
|
|
7979
|
-
return n * h;
|
|
7980
|
-
case "minutes":
|
|
7981
|
-
case "minute":
|
|
7982
|
-
case "mins":
|
|
7983
|
-
case "min":
|
|
7984
|
-
case "m":
|
|
7985
|
-
return n * m;
|
|
7986
|
-
case "seconds":
|
|
7987
|
-
case "second":
|
|
7988
|
-
case "secs":
|
|
7989
|
-
case "sec":
|
|
7990
|
-
case "s":
|
|
7991
|
-
return n * s;
|
|
7992
|
-
case "milliseconds":
|
|
7993
|
-
case "millisecond":
|
|
7994
|
-
case "msecs":
|
|
7995
|
-
case "msec":
|
|
7996
|
-
case "ms":
|
|
7997
|
-
return n;
|
|
7998
|
-
default:
|
|
7999
|
-
return void 0;
|
|
8000
|
-
}
|
|
8001
|
-
}
|
|
8002
|
-
function fmtShort(ms) {
|
|
8003
|
-
var msAbs = Math.abs(ms);
|
|
8004
|
-
if (msAbs >= d) {
|
|
8005
|
-
return Math.round(ms / d) + "d";
|
|
8006
|
-
}
|
|
8007
|
-
if (msAbs >= h) {
|
|
8008
|
-
return Math.round(ms / h) + "h";
|
|
8009
|
-
}
|
|
8010
|
-
if (msAbs >= m) {
|
|
8011
|
-
return Math.round(ms / m) + "m";
|
|
8012
|
-
}
|
|
8013
|
-
if (msAbs >= s) {
|
|
8014
|
-
return Math.round(ms / s) + "s";
|
|
8015
|
-
}
|
|
8016
|
-
return ms + "ms";
|
|
8017
|
-
}
|
|
8018
|
-
function fmtLong(ms) {
|
|
8019
|
-
var msAbs = Math.abs(ms);
|
|
8020
|
-
if (msAbs >= d) {
|
|
8021
|
-
return plural(ms, msAbs, d, "day");
|
|
8022
|
-
}
|
|
8023
|
-
if (msAbs >= h) {
|
|
8024
|
-
return plural(ms, msAbs, h, "hour");
|
|
8025
|
-
}
|
|
8026
|
-
if (msAbs >= m) {
|
|
8027
|
-
return plural(ms, msAbs, m, "minute");
|
|
8028
|
-
}
|
|
8029
|
-
if (msAbs >= s) {
|
|
8030
|
-
return plural(ms, msAbs, s, "second");
|
|
8031
|
-
}
|
|
8032
|
-
return ms + " ms";
|
|
8033
|
-
}
|
|
8034
|
-
function plural(ms, msAbs, n, name) {
|
|
8035
|
-
var isPlural = msAbs >= n * 1.5;
|
|
8036
|
-
return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
|
|
8037
|
-
}
|
|
8038
|
-
}
|
|
8039
|
-
});
|
|
8040
|
-
|
|
8041
7925
|
// node_modules/jsonwebtoken/lib/timespan.js
|
|
8042
7926
|
var require_timespan = __commonJS({
|
|
8043
7927
|
"node_modules/jsonwebtoken/lib/timespan.js"(exports2, module2) {
|
|
8044
|
-
var ms =
|
|
7928
|
+
var ms = require_ms();
|
|
8045
7929
|
module2.exports = function(time, iat) {
|
|
8046
7930
|
var timestamp = iat || Math.floor(Date.now() / 1e3);
|
|
8047
7931
|
if (typeof time === "string") {
|
|
@@ -11015,7 +10899,7 @@ var require_msal_node = __commonJS({
|
|
|
11015
10899
|
var jwt = require_jsonwebtoken();
|
|
11016
10900
|
var http = require("http");
|
|
11017
10901
|
var fs6 = require("fs");
|
|
11018
|
-
var
|
|
10902
|
+
var path3 = require("path");
|
|
11019
10903
|
var Serializer = class {
|
|
11020
10904
|
/**
|
|
11021
10905
|
* serialize the JSON blob
|
|
@@ -11201,6 +11085,7 @@ var require_msal_node = __commonJS({
|
|
|
11201
11085
|
var USER_ID = "user_id";
|
|
11202
11086
|
var FMI_PATH = "fmi_path";
|
|
11203
11087
|
var ATTRIBUTE_TOKENS = "attribute_tokens";
|
|
11088
|
+
var POPUP_ORIGIN_CHECK_DONE = "pocd";
|
|
11204
11089
|
var SKU = "msal.js.common";
|
|
11205
11090
|
var DEFAULT_AUTHORITY = "https://login.microsoftonline.com/common/";
|
|
11206
11091
|
var DEFAULT_AUTHORITY_HOST = "login.microsoftonline.com";
|
|
@@ -11232,7 +11117,6 @@ var require_msal_node = __commonJS({
|
|
|
11232
11117
|
];
|
|
11233
11118
|
var INVALID_INSTANCE = "invalid_instance";
|
|
11234
11119
|
var HTTP_SUCCESS = 200;
|
|
11235
|
-
var HTTP_REDIRECT = 302;
|
|
11236
11120
|
var HTTP_CLIENT_ERROR_RANGE_START = 400;
|
|
11237
11121
|
var HTTP_BAD_REQUEST = 400;
|
|
11238
11122
|
var HTTP_UNAUTHORIZED = 401;
|
|
@@ -11389,7 +11273,7 @@ var require_msal_node = __commonJS({
|
|
|
11389
11273
|
function getDefaultErrorMessage(code) {
|
|
11390
11274
|
return `See https://aka.ms/msal.js.errors#${code} for details`;
|
|
11391
11275
|
}
|
|
11392
|
-
var
|
|
11276
|
+
var AuthError2 = class _AuthError extends Error {
|
|
11393
11277
|
constructor(errorCode, correlationId, errorMessage, suberror) {
|
|
11394
11278
|
const message = errorMessage || (errorCode ? getDefaultErrorMessage(errorCode) : "");
|
|
11395
11279
|
const errorString = message ? `${errorCode}: ${message}` : errorCode;
|
|
@@ -11403,9 +11287,9 @@ var require_msal_node = __commonJS({
|
|
|
11403
11287
|
}
|
|
11404
11288
|
};
|
|
11405
11289
|
function createAuthError(code, correlationId, additionalMessage) {
|
|
11406
|
-
return new
|
|
11290
|
+
return new AuthError2(code, correlationId, additionalMessage || getDefaultErrorMessage(code));
|
|
11407
11291
|
}
|
|
11408
|
-
var ClientAuthError = class _ClientAuthError extends
|
|
11292
|
+
var ClientAuthError = class _ClientAuthError extends AuthError2 {
|
|
11409
11293
|
constructor(errorCode, correlationId, additionalMessage) {
|
|
11410
11294
|
super(errorCode, correlationId, additionalMessage);
|
|
11411
11295
|
this.name = "ClientAuthError";
|
|
@@ -11720,7 +11604,7 @@ var require_msal_node = __commonJS({
|
|
|
11720
11604
|
postRequestFailed,
|
|
11721
11605
|
unexpectedError
|
|
11722
11606
|
});
|
|
11723
|
-
var ClientConfigurationError = class _ClientConfigurationError extends
|
|
11607
|
+
var ClientConfigurationError = class _ClientConfigurationError extends AuthError2 {
|
|
11724
11608
|
constructor(errorCode, correlationId) {
|
|
11725
11609
|
super(errorCode, correlationId);
|
|
11726
11610
|
this.name = "ClientConfigurationError";
|
|
@@ -11730,6 +11614,29 @@ var require_msal_node = __commonJS({
|
|
|
11730
11614
|
function createClientConfigurationError(errorCode, correlationId) {
|
|
11731
11615
|
return new ClientConfigurationError(errorCode, correlationId);
|
|
11732
11616
|
}
|
|
11617
|
+
var normalizedHeaderRecords = /* @__PURE__ */ new WeakSet();
|
|
11618
|
+
function normalizeResponseHeaders(headers) {
|
|
11619
|
+
if (normalizedHeaderRecords.has(headers)) {
|
|
11620
|
+
return headers;
|
|
11621
|
+
}
|
|
11622
|
+
const normalized = Object.fromEntries(Object.entries(headers).map(([name2, value]) => [
|
|
11623
|
+
name2.toLowerCase(),
|
|
11624
|
+
value
|
|
11625
|
+
]));
|
|
11626
|
+
normalizedHeaderRecords.add(normalized);
|
|
11627
|
+
return normalized;
|
|
11628
|
+
}
|
|
11629
|
+
function getResponseHeader(headers, name2) {
|
|
11630
|
+
const key = name2.toLowerCase();
|
|
11631
|
+
if (Object.prototype.hasOwnProperty.call(headers, key)) {
|
|
11632
|
+
return headers[key];
|
|
11633
|
+
}
|
|
11634
|
+
if (normalizedHeaderRecords.has(headers)) {
|
|
11635
|
+
return void 0;
|
|
11636
|
+
}
|
|
11637
|
+
const headerName = Object.keys(headers).find((header) => header.toLowerCase() === key);
|
|
11638
|
+
return headerName === void 0 ? void 0 : headers[headerName];
|
|
11639
|
+
}
|
|
11733
11640
|
var redirectUriEmpty = "redirect_uri_empty";
|
|
11734
11641
|
var claimsRequestParsingError = "claims_request_parsing_error";
|
|
11735
11642
|
var authorityUriInsecure = "authority_uri_insecure";
|
|
@@ -12996,7 +12903,7 @@ var require_msal_node = __commonJS({
|
|
|
12996
12903
|
this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request.", this.correlationId);
|
|
12997
12904
|
match = getCloudDiscoveryMetadataFromNetworkResponse(metadata, this.hostnameAndPort);
|
|
12998
12905
|
} catch (error) {
|
|
12999
|
-
if (error instanceof
|
|
12906
|
+
if (error instanceof AuthError2) {
|
|
13000
12907
|
this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata.
|
|
13001
12908
|
Error: '${error.errorCode}'
|
|
13002
12909
|
Error Description: '${error.errorMessage}'`, this.correlationId);
|
|
@@ -13601,6 +13508,11 @@ Error Description: '${typedError.message}'`, this.correlationId);
|
|
|
13601
13508
|
parameters.set(INSTANCE_AWARE, "true");
|
|
13602
13509
|
}
|
|
13603
13510
|
}
|
|
13511
|
+
function addPopupOriginCheckDone(parameters) {
|
|
13512
|
+
if (!parameters.has(POPUP_ORIGIN_CHECK_DONE)) {
|
|
13513
|
+
parameters.set(POPUP_ORIGIN_CHECK_DONE, "1");
|
|
13514
|
+
}
|
|
13515
|
+
}
|
|
13604
13516
|
function addExtraParameters(parameters, extraParams) {
|
|
13605
13517
|
Object.entries(extraParams).forEach(([key, value]) => {
|
|
13606
13518
|
if (!parameters.has(key) && value) {
|
|
@@ -13729,6 +13641,9 @@ Error Description: '${typedError.message}'`, this.correlationId);
|
|
|
13729
13641
|
}
|
|
13730
13642
|
try {
|
|
13731
13643
|
const normalizedResponse = stripLeadingHashOrQuery(responseString);
|
|
13644
|
+
if (!/^[^=&?#/]+(?:=|&|$)/.test(normalizedResponse)) {
|
|
13645
|
+
return null;
|
|
13646
|
+
}
|
|
13732
13647
|
const deserializedHash = Object.fromEntries(new URLSearchParams(normalizedResponse));
|
|
13733
13648
|
if (deserializedHash.code || deserializedHash.ear_jwe || deserializedHash.error || deserializedHash.error_description || deserializedHash.state) {
|
|
13734
13649
|
return deserializedHash;
|
|
@@ -13790,12 +13705,12 @@ Error Description: '${typedError.message}'`, this.correlationId);
|
|
|
13790
13705
|
}
|
|
13791
13706
|
};
|
|
13792
13707
|
exports2.LogLevel = void 0;
|
|
13793
|
-
(function(
|
|
13794
|
-
|
|
13795
|
-
|
|
13796
|
-
|
|
13797
|
-
|
|
13798
|
-
|
|
13708
|
+
(function(LogLevel2) {
|
|
13709
|
+
LogLevel2[LogLevel2["Error"] = 0] = "Error";
|
|
13710
|
+
LogLevel2[LogLevel2["Warning"] = 1] = "Warning";
|
|
13711
|
+
LogLevel2[LogLevel2["Info"] = 2] = "Info";
|
|
13712
|
+
LogLevel2[LogLevel2["Verbose"] = 3] = "Verbose";
|
|
13713
|
+
LogLevel2[LogLevel2["Trace"] = 4] = "Trace";
|
|
13799
13714
|
})(exports2.LogLevel || (exports2.LogLevel = {}));
|
|
13800
13715
|
var CACHE_CAPACITY = 50;
|
|
13801
13716
|
var MAX_LOGS_PER_CORRELATION = 500;
|
|
@@ -14014,7 +13929,7 @@ Error Description: '${typedError.message}'`, this.correlationId);
|
|
|
14014
13929
|
}
|
|
14015
13930
|
};
|
|
14016
13931
|
var name$1 = "@azure/msal-common";
|
|
14017
|
-
var version$1 = "16.
|
|
13932
|
+
var version$1 = "16.15.0";
|
|
14018
13933
|
var cacheQuotaExceeded = "cache_quota_exceeded";
|
|
14019
13934
|
var cacheErrorUnknown = "cache_error_unknown";
|
|
14020
13935
|
var CacheError = class _CacheError extends Error {
|
|
@@ -14214,7 +14129,7 @@ Error Description: '${typedError.message}'`, this.correlationId);
|
|
|
14214
14129
|
}
|
|
14215
14130
|
} catch (e) {
|
|
14216
14131
|
this.commonLogger?.error(`CacheManager.saveCacheRecord: failed`, correlationId);
|
|
14217
|
-
if (e instanceof
|
|
14132
|
+
if (e instanceof AuthError2) {
|
|
14218
14133
|
throw e;
|
|
14219
14134
|
} else {
|
|
14220
14135
|
throw createCacheError(e);
|
|
@@ -15224,7 +15139,7 @@ Error Description: '${typedError.message}'`, this.correlationId);
|
|
|
15224
15139
|
return this.cache;
|
|
15225
15140
|
}
|
|
15226
15141
|
};
|
|
15227
|
-
var JoseHeaderError = class _JoseHeaderError extends
|
|
15142
|
+
var JoseHeaderError = class _JoseHeaderError extends AuthError2 {
|
|
15228
15143
|
constructor(errorCode, correlationId, errorMessage) {
|
|
15229
15144
|
super(errorCode, correlationId, errorMessage);
|
|
15230
15145
|
this.name = "JoseHeaderError";
|
|
@@ -15550,7 +15465,7 @@ Error Description: '${typedError.message}'`, this.correlationId);
|
|
|
15550
15465
|
"ui_not_allowed",
|
|
15551
15466
|
"interrupted_user"
|
|
15552
15467
|
];
|
|
15553
|
-
var InteractionRequiredAuthError = class _InteractionRequiredAuthError extends
|
|
15468
|
+
var InteractionRequiredAuthError = class _InteractionRequiredAuthError extends AuthError2 {
|
|
15554
15469
|
constructor(errorCode, correlationId, errorMessage, subError, timestamp, traceId, claims, errorNo) {
|
|
15555
15470
|
super(errorCode, correlationId, errorMessage, subError);
|
|
15556
15471
|
Object.setPrototypeOf(this, _InteractionRequiredAuthError.prototype);
|
|
@@ -15572,7 +15487,7 @@ Error Description: '${typedError.message}'`, this.correlationId);
|
|
|
15572
15487
|
function createInteractionRequiredAuthError(errorCode, correlationId, errorMessage) {
|
|
15573
15488
|
return new InteractionRequiredAuthError(errorCode, correlationId, errorMessage);
|
|
15574
15489
|
}
|
|
15575
|
-
var ServerError = class _ServerError extends
|
|
15490
|
+
var ServerError = class _ServerError extends AuthError2 {
|
|
15576
15491
|
constructor(errorCode, correlationId, errorMessage, subError, errorNo, status) {
|
|
15577
15492
|
super(errorCode, correlationId, errorMessage, subError);
|
|
15578
15493
|
this.name = "ServerError";
|
|
@@ -15985,12 +15900,13 @@ ${serverError}`, correlationId);
|
|
|
15985
15900
|
* Performs necessary throttling checks after a network request.
|
|
15986
15901
|
* @param cacheManager
|
|
15987
15902
|
* @param thumbprint
|
|
15988
|
-
* @param response
|
|
15903
|
+
* @param response - Token response with case-insensitive header names.
|
|
15989
15904
|
*/
|
|
15990
15905
|
static postProcess(cacheManager, thumbprint, response, correlationId) {
|
|
15991
|
-
|
|
15906
|
+
const retryAfter = getRetryAfterHeader(response);
|
|
15907
|
+
if (_ThrottlingUtils.checkResponseStatus(response) || retryAfter !== void 0) {
|
|
15992
15908
|
const thumbprintValue = {
|
|
15993
|
-
throttleTime: _ThrottlingUtils.calculateThrottleTime(parseInt(
|
|
15909
|
+
throttleTime: _ThrottlingUtils.calculateThrottleTime(parseInt(retryAfter || "")),
|
|
15994
15910
|
error: response.body.error,
|
|
15995
15911
|
errorCodes: response.body.error_codes,
|
|
15996
15912
|
errorMessage: response.body.error_description,
|
|
@@ -16008,13 +15924,10 @@ ${serverError}`, correlationId);
|
|
|
16008
15924
|
}
|
|
16009
15925
|
/**
|
|
16010
15926
|
* Checks a NetworkResponse object's RetryAfter header
|
|
16011
|
-
* @param response
|
|
15927
|
+
* @param response - Token response with case-insensitive header names.
|
|
16012
15928
|
*/
|
|
16013
15929
|
static checkResponseForRetryAfter(response) {
|
|
16014
|
-
|
|
16015
|
-
return response.headers.hasOwnProperty(HeaderNames.RETRY_AFTER) && (response.status < 200 || response.status >= 300);
|
|
16016
|
-
}
|
|
16017
|
-
return false;
|
|
15930
|
+
return getRetryAfterHeader(response) !== void 0;
|
|
16018
15931
|
}
|
|
16019
15932
|
/**
|
|
16020
15933
|
* Calculates the Unix-time value for a throttle to expire given throttleTime in seconds.
|
|
@@ -16031,7 +15944,13 @@ ${serverError}`, correlationId);
|
|
|
16031
15944
|
cacheManager.removeItem(key, request.correlationId);
|
|
16032
15945
|
}
|
|
16033
15946
|
};
|
|
16034
|
-
|
|
15947
|
+
function getRetryAfterHeader(response) {
|
|
15948
|
+
if ((response.status < 200 || response.status >= 300) && response.headers) {
|
|
15949
|
+
return getResponseHeader(response.headers, HeaderNames.RETRY_AFTER);
|
|
15950
|
+
}
|
|
15951
|
+
return void 0;
|
|
15952
|
+
}
|
|
15953
|
+
var NetworkError = class _NetworkError extends AuthError2 {
|
|
16035
15954
|
constructor(error, httpStatus, responseHeaders) {
|
|
16036
15955
|
super(error.errorCode, error.correlationId, error.errorMessage, error.subError);
|
|
16037
15956
|
Object.setPrototypeOf(this, _NetworkError.prototype);
|
|
@@ -16102,7 +16021,8 @@ ${serverError}`, correlationId);
|
|
|
16102
16021
|
let response;
|
|
16103
16022
|
try {
|
|
16104
16023
|
response = await invokeAsync(networkClient.sendPostRequestAsync.bind(networkClient), NetworkClientSendPostRequestAsync, logger2, performanceClient, correlationId)(tokenEndpoint, { ...options, correlationId, performanceClient });
|
|
16105
|
-
const responseHeaders = response.headers || {};
|
|
16024
|
+
const responseHeaders = normalizeResponseHeaders(response.headers || {});
|
|
16025
|
+
response = { ...response, headers: responseHeaders };
|
|
16106
16026
|
performanceClient?.addFields({
|
|
16107
16027
|
refreshTokenSize: response.body.refresh_token?.length || 0,
|
|
16108
16028
|
httpVerToken: responseHeaders[HeaderNames.X_MS_HTTP_VERSION] || "",
|
|
@@ -16110,19 +16030,19 @@ ${serverError}`, correlationId);
|
|
|
16110
16030
|
}, correlationId);
|
|
16111
16031
|
} catch (e) {
|
|
16112
16032
|
if (e instanceof NetworkError) {
|
|
16113
|
-
const responseHeaders = e.responseHeaders;
|
|
16033
|
+
const responseHeaders = e.responseHeaders ? normalizeResponseHeaders(e.responseHeaders) : void 0;
|
|
16114
16034
|
if (responseHeaders) {
|
|
16115
16035
|
performanceClient?.addFields({
|
|
16116
16036
|
httpVerToken: responseHeaders[HeaderNames.X_MS_HTTP_VERSION] || "",
|
|
16117
16037
|
requestId: responseHeaders[HeaderNames.X_MS_REQUEST_ID] || "",
|
|
16118
|
-
contentTypeHeader: responseHeaders
|
|
16119
|
-
contentLengthHeader: responseHeaders
|
|
16038
|
+
contentTypeHeader: getResponseHeader(responseHeaders, HeaderNames.CONTENT_TYPE) || void 0,
|
|
16039
|
+
contentLengthHeader: getResponseHeader(responseHeaders, HeaderNames.CONTENT_LENGTH) || void 0,
|
|
16120
16040
|
httpStatus: e.httpStatus
|
|
16121
16041
|
}, correlationId);
|
|
16122
16042
|
}
|
|
16123
16043
|
throw e.error;
|
|
16124
16044
|
}
|
|
16125
|
-
if (e instanceof
|
|
16045
|
+
if (e instanceof AuthError2) {
|
|
16126
16046
|
throw e;
|
|
16127
16047
|
} else {
|
|
16128
16048
|
throw createClientAuthError(networkError, correlationId);
|
|
@@ -16325,6 +16245,9 @@ ${serverError}`, correlationId);
|
|
|
16325
16245
|
if (request.logoutHint) {
|
|
16326
16246
|
addLogoutHint(parameters, request.logoutHint);
|
|
16327
16247
|
}
|
|
16248
|
+
if (request.popupOriginCheckDone) {
|
|
16249
|
+
addPopupOriginCheckDone(parameters);
|
|
16250
|
+
}
|
|
16328
16251
|
if (request.extraQueryParameters) {
|
|
16329
16252
|
addExtraParameters(parameters, request.extraQueryParameters);
|
|
16330
16253
|
}
|
|
@@ -16429,6 +16352,9 @@ ${serverError}`, correlationId);
|
|
|
16429
16352
|
if (authOptions.instanceAware && (!request.extraQueryParameters || !Object.keys(request.extraQueryParameters).includes(INSTANCE_AWARE))) {
|
|
16430
16353
|
addInstanceAware(parameters);
|
|
16431
16354
|
}
|
|
16355
|
+
if (request.popupOriginCheckDone) {
|
|
16356
|
+
addPopupOriginCheckDone(parameters);
|
|
16357
|
+
}
|
|
16432
16358
|
return parameters;
|
|
16433
16359
|
}
|
|
16434
16360
|
function getAuthorizeUrl(authority, requestParameters) {
|
|
@@ -16558,6 +16484,7 @@ ${serverError}`, correlationId);
|
|
|
16558
16484
|
addRedirectUri(parameters, request.redirectUri);
|
|
16559
16485
|
}
|
|
16560
16486
|
addScopes(parameters, request.scopes, request.correlationId, true, this.config.authOptions.authority.options.OIDCOptions?.defaultScopes);
|
|
16487
|
+
addResource(parameters, request.resource);
|
|
16561
16488
|
addGrantType(parameters, GrantType.REFRESH_TOKEN_GRANT);
|
|
16562
16489
|
addClientInfo(parameters);
|
|
16563
16490
|
addLibraryInfo(parameters, this.config.libraryInfo);
|
|
@@ -16727,7 +16654,7 @@ ${serverError}`, correlationId);
|
|
|
16727
16654
|
}
|
|
16728
16655
|
lastRequests.failedRequests.push(this.apiId, this.correlationId);
|
|
16729
16656
|
if (error instanceof Error && !!error && error.toString()) {
|
|
16730
|
-
if (error instanceof
|
|
16657
|
+
if (error instanceof AuthError2) {
|
|
16731
16658
|
if (error.subError) {
|
|
16732
16659
|
lastRequests.errors.push(error.subError);
|
|
16733
16660
|
} else if (error.errorCode) {
|
|
@@ -17382,7 +17309,7 @@ ${serverError}`, correlationId);
|
|
|
17382
17309
|
[wwwAuthenticateHeaderMissing]: "A 401 response was received from the Azure Arc Managed Identity, but the www-authenticate header is missing.",
|
|
17383
17310
|
[wwwAuthenticateHeaderUnsupportedFormat]: "A 401 response was received from the Azure Arc Managed Identity, but the www-authenticate header is in an unsupported format."
|
|
17384
17311
|
};
|
|
17385
|
-
var ManagedIdentityError = class _ManagedIdentityError extends
|
|
17312
|
+
var ManagedIdentityError = class _ManagedIdentityError extends AuthError2 {
|
|
17386
17313
|
constructor(errorCode, correlationId) {
|
|
17387
17314
|
super(errorCode, correlationId, ManagedIdentityErrorMessages[errorCode]);
|
|
17388
17315
|
this.name = "ManagedIdentityError";
|
|
@@ -17458,6 +17385,10 @@ ${serverError}`, correlationId);
|
|
|
17458
17385
|
code: "loopback_server_timeout",
|
|
17459
17386
|
desc: "Timed out waiting for auth code listener to be registered."
|
|
17460
17387
|
},
|
|
17388
|
+
loopbackServerQueryResponseNotSupported: {
|
|
17389
|
+
code: "loopback_server_query_response_not_supported",
|
|
17390
|
+
desc: "The loopback server received an OAuth response in the URL. Interactive authentication requires form_post."
|
|
17391
|
+
},
|
|
17461
17392
|
stateNotFoundError: {
|
|
17462
17393
|
code: "state_not_found",
|
|
17463
17394
|
desc: "State not found. Please verify that the request originated from msal."
|
|
@@ -17469,9 +17400,13 @@ ${serverError}`, correlationId);
|
|
|
17469
17400
|
redirectUriNotSupported: {
|
|
17470
17401
|
code: "redirect_uri_not_supported",
|
|
17471
17402
|
desc: "RedirectUri is not supported in this scenario. Please remove redirectUri from the request."
|
|
17403
|
+
},
|
|
17404
|
+
unsupportedCcaInstanceAware: {
|
|
17405
|
+
code: "unsupported_cca_instance_aware",
|
|
17406
|
+
desc: "Instance-aware configuration is not supported by ConfidentialClientApplication."
|
|
17472
17407
|
}
|
|
17473
17408
|
};
|
|
17474
|
-
var NodeAuthError = class _NodeAuthError extends
|
|
17409
|
+
var NodeAuthError = class _NodeAuthError extends AuthError2 {
|
|
17475
17410
|
constructor(errorCode, correlationId, errorMessage) {
|
|
17476
17411
|
super(errorCode, correlationId, errorMessage);
|
|
17477
17412
|
this.name = "NodeAuthError";
|
|
@@ -17512,6 +17447,12 @@ ${serverError}`, correlationId);
|
|
|
17512
17447
|
static createLoopbackServerTimeoutError(correlationId = "") {
|
|
17513
17448
|
return new _NodeAuthError(NodeAuthErrorMessage.loopbackServerTimeout.code, correlationId, `${NodeAuthErrorMessage.loopbackServerTimeout.desc}`);
|
|
17514
17449
|
}
|
|
17450
|
+
/**
|
|
17451
|
+
* Creates an error thrown if the loopback server receives an OAuth response in a query string.
|
|
17452
|
+
*/
|
|
17453
|
+
static createLoopbackServerQueryResponseNotSupportedError() {
|
|
17454
|
+
return new _NodeAuthError(NodeAuthErrorMessage.loopbackServerQueryResponseNotSupported.code, "", NodeAuthErrorMessage.loopbackServerQueryResponseNotSupported.desc);
|
|
17455
|
+
}
|
|
17515
17456
|
/**
|
|
17516
17457
|
* Creates an error thrown when the state is not present.
|
|
17517
17458
|
*/
|
|
@@ -17530,6 +17471,12 @@ ${serverError}`, correlationId);
|
|
|
17530
17471
|
static createRedirectUriNotSupportedError(correlationId = "") {
|
|
17531
17472
|
return new _NodeAuthError(NodeAuthErrorMessage.redirectUriNotSupported.code, correlationId, NodeAuthErrorMessage.redirectUriNotSupported.desc);
|
|
17532
17473
|
}
|
|
17474
|
+
/**
|
|
17475
|
+
* Creates an error thrown when instance-aware behavior is requested for a confidential client.
|
|
17476
|
+
*/
|
|
17477
|
+
static createUnsupportedCcaInstanceAwareError(correlationId = "") {
|
|
17478
|
+
return new _NodeAuthError(NodeAuthErrorMessage.unsupportedCcaInstanceAware.code, correlationId, NodeAuthErrorMessage.unsupportedCcaInstanceAware.desc);
|
|
17479
|
+
}
|
|
17533
17480
|
};
|
|
17534
17481
|
var DEFAULT_AUTH_OPTIONS = {
|
|
17535
17482
|
clientId: "",
|
|
@@ -18593,7 +18540,7 @@ ${serverError}`, correlationId);
|
|
|
18593
18540
|
}
|
|
18594
18541
|
};
|
|
18595
18542
|
var name = "@azure/msal-node";
|
|
18596
|
-
var version = "
|
|
18543
|
+
var version = "7.1.2";
|
|
18597
18544
|
var BaseClient = class {
|
|
18598
18545
|
constructor(configuration) {
|
|
18599
18546
|
this.config = buildClientConfiguration(configuration);
|
|
@@ -18743,6 +18690,87 @@ ${serverError}`, correlationId);
|
|
|
18743
18690
|
addExtraParameters(parameters, request.extraQueryParameters || {});
|
|
18744
18691
|
return getAuthorizeUrl(authority, parameters);
|
|
18745
18692
|
}
|
|
18693
|
+
var activeSilentTokenRequests = /* @__PURE__ */ new WeakMap();
|
|
18694
|
+
function acquireTokenSilentDeduped(owner, logger2, silentRequestKey, correlationId, acquireToken) {
|
|
18695
|
+
const existingRequests = activeSilentTokenRequests.get(owner);
|
|
18696
|
+
const activeRequests = existingRequests || /* @__PURE__ */ new Map();
|
|
18697
|
+
if (!existingRequests) {
|
|
18698
|
+
activeSilentTokenRequests.set(owner, activeRequests);
|
|
18699
|
+
}
|
|
18700
|
+
const inProgressRequest = activeRequests.get(silentRequestKey);
|
|
18701
|
+
if (inProgressRequest) {
|
|
18702
|
+
logger2.verbose("acquireTokenSilent has been called previously, returning the result from the first call", correlationId);
|
|
18703
|
+
return applyCallerCorrelationIdToResult(inProgressRequest, correlationId);
|
|
18704
|
+
}
|
|
18705
|
+
logger2.verbose("acquireTokenSilent called for the first time, storing active request", correlationId);
|
|
18706
|
+
const activeRequest = Promise.resolve().then(acquireToken).finally(() => {
|
|
18707
|
+
activeRequests.delete(silentRequestKey);
|
|
18708
|
+
if (activeRequests.size === 0) {
|
|
18709
|
+
activeSilentTokenRequests.delete(owner);
|
|
18710
|
+
}
|
|
18711
|
+
});
|
|
18712
|
+
activeRequests.set(silentRequestKey, activeRequest);
|
|
18713
|
+
return applyCallerCorrelationIdToResult(activeRequest, correlationId);
|
|
18714
|
+
}
|
|
18715
|
+
function getSilentRequestKey(input) {
|
|
18716
|
+
const { request } = input;
|
|
18717
|
+
const authority = input.requestType === "native" ? request.authority : input.authority;
|
|
18718
|
+
const commonKeyFields = {
|
|
18719
|
+
requestType: input.requestType,
|
|
18720
|
+
clientId: input.requestType === "native" ? input.request.clientId : input.clientId,
|
|
18721
|
+
authority,
|
|
18722
|
+
scopes: canonicalizeRequestValues(request.scopes),
|
|
18723
|
+
claims: request.claims,
|
|
18724
|
+
authenticationScheme: request.authenticationScheme,
|
|
18725
|
+
resourceRequestMethod: request.resourceRequestMethod,
|
|
18726
|
+
resourceRequestUri: request.resourceRequestUri,
|
|
18727
|
+
forceRefresh: request.forceRefresh,
|
|
18728
|
+
redirectUri: request.redirectUri || "",
|
|
18729
|
+
resource: request.resource,
|
|
18730
|
+
extraParameters: canonicalizeRequestValues(request.extraParameters)
|
|
18731
|
+
};
|
|
18732
|
+
if (input.requestType === "native") {
|
|
18733
|
+
return JSON.stringify({
|
|
18734
|
+
...commonKeyFields,
|
|
18735
|
+
accountId: input.request.accountId,
|
|
18736
|
+
shrNonce: input.request.shrNonce,
|
|
18737
|
+
extraScopesToConsent: canonicalizeRequestValues(input.request.extraScopesToConsent),
|
|
18738
|
+
loginHint: input.request.loginHint,
|
|
18739
|
+
prompt: input.request.prompt
|
|
18740
|
+
});
|
|
18741
|
+
}
|
|
18742
|
+
const nonNativeRequest = input.request;
|
|
18743
|
+
const thumbprint = getRequestThumbprint(input.clientId, { ...nonNativeRequest, authority }, nonNativeRequest.account.homeAccountId);
|
|
18744
|
+
return JSON.stringify({
|
|
18745
|
+
...thumbprint,
|
|
18746
|
+
...commonKeyFields,
|
|
18747
|
+
accountTenantId: nonNativeRequest.account.tenantId,
|
|
18748
|
+
accountEnvironment: nonNativeRequest.account.environment,
|
|
18749
|
+
refreshTokenExpirationOffsetSeconds: nonNativeRequest.refreshTokenExpirationOffsetSeconds,
|
|
18750
|
+
extraQueryParameters: canonicalizeRequestValues(nonNativeRequest.extraQueryParameters),
|
|
18751
|
+
skipBrokerClaims: thumbprint.embeddedClientId || nonNativeRequest.extraParameters?.[BROKER_CLIENT_ID] ? nonNativeRequest.skipBrokerClaims : void 0
|
|
18752
|
+
});
|
|
18753
|
+
}
|
|
18754
|
+
function snapshotNativeRequest(request) {
|
|
18755
|
+
return {
|
|
18756
|
+
...request,
|
|
18757
|
+
scopes: [...request.scopes],
|
|
18758
|
+
extraParameters: request.extraParameters ? { ...request.extraParameters } : void 0,
|
|
18759
|
+
extraScopesToConsent: request.extraScopesToConsent ? [...request.extraScopesToConsent] : void 0
|
|
18760
|
+
};
|
|
18761
|
+
}
|
|
18762
|
+
function canonicalizeRequestValues(values) {
|
|
18763
|
+
if (Array.isArray(values)) {
|
|
18764
|
+
return Array.from(new Set(values.map((scope) => scope.trim()).filter((scope) => scope.length > 0))).sort();
|
|
18765
|
+
}
|
|
18766
|
+
return values ? Object.keys(values).sort().map((key) => [key, values[key]]) : void 0;
|
|
18767
|
+
}
|
|
18768
|
+
function applyCallerCorrelationIdToResult(activeRequest, correlationId) {
|
|
18769
|
+
return activeRequest.then((result) => ({
|
|
18770
|
+
...result,
|
|
18771
|
+
correlationId
|
|
18772
|
+
}));
|
|
18773
|
+
}
|
|
18746
18774
|
var ClientApplication = class {
|
|
18747
18775
|
/**
|
|
18748
18776
|
* Constructor for the ClientApplication
|
|
@@ -18814,7 +18842,7 @@ ${serverError}`, correlationId);
|
|
|
18814
18842
|
this.logger.verbose("Auth code client created", validRequest.correlationId);
|
|
18815
18843
|
return await authorizationCodeClient.acquireToken(validRequest, ApiId.acquireTokenByCode, validatedAuthCodePayload);
|
|
18816
18844
|
} catch (e) {
|
|
18817
|
-
if (e instanceof
|
|
18845
|
+
if (e instanceof AuthError2) {
|
|
18818
18846
|
e.correlationId = validRequest.correlationId;
|
|
18819
18847
|
}
|
|
18820
18848
|
serverTelemetryManager.cacheFailedRequest(e);
|
|
@@ -18843,7 +18871,7 @@ ${serverError}`, correlationId);
|
|
|
18843
18871
|
this.logger.verbose("Refresh token client created", validRequest.correlationId);
|
|
18844
18872
|
return await refreshTokenClient.acquireToken(validRequest, ApiId.acquireTokenByRefreshToken);
|
|
18845
18873
|
} catch (e) {
|
|
18846
|
-
if (e instanceof
|
|
18874
|
+
if (e instanceof AuthError2) {
|
|
18847
18875
|
e.correlationId = validRequest.correlationId;
|
|
18848
18876
|
}
|
|
18849
18877
|
serverTelemetryManager.cacheFailedRequest(e);
|
|
@@ -18855,6 +18883,7 @@ ${serverError}`, correlationId);
|
|
|
18855
18883
|
*
|
|
18856
18884
|
* This API expects the user to provide an account object and looks into the cache to retrieve the token if present.
|
|
18857
18885
|
* There is also an optional "forceRefresh" boolean the user can send to bypass the cache for access_token and id_token.
|
|
18886
|
+
* Concurrent requests with the same request thumbprint return the same in-progress result.
|
|
18858
18887
|
* In case the refresh_token is expired or not found, an error is thrown
|
|
18859
18888
|
* and the guidance is for the user to call any interactive token acquisition API (eg: `acquireTokenByCode()`).
|
|
18860
18889
|
*/
|
|
@@ -18864,9 +18893,22 @@ ${serverError}`, correlationId);
|
|
|
18864
18893
|
...await this.initializeBaseRequest(request),
|
|
18865
18894
|
forceRefresh: request.forceRefresh || false
|
|
18866
18895
|
};
|
|
18896
|
+
if (!validRequest.account) {
|
|
18897
|
+
return this.acquireTokenSilentAsync(validRequest, request.azureCloudOptions);
|
|
18898
|
+
}
|
|
18899
|
+
const authorityForThumbprint = Authority.generateAuthority(validRequest.authority, request.azureCloudOptions || this.config.auth.azureCloudOptions);
|
|
18900
|
+
const silentRequestKey = getSilentRequestKey({
|
|
18901
|
+
requestType: "non-native",
|
|
18902
|
+
request: validRequest,
|
|
18903
|
+
authority: authorityForThumbprint,
|
|
18904
|
+
clientId: this.config.auth.clientId
|
|
18905
|
+
});
|
|
18906
|
+
return acquireTokenSilentDeduped(this, this.logger, silentRequestKey, validRequest.correlationId, () => this.acquireTokenSilentAsync(validRequest, request.azureCloudOptions));
|
|
18907
|
+
}
|
|
18908
|
+
async acquireTokenSilentAsync(validRequest, azureCloudOptions) {
|
|
18867
18909
|
const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent, validRequest.correlationId, validRequest.forceRefresh);
|
|
18868
18910
|
try {
|
|
18869
|
-
const discoveredAuthority = await this.createAuthority(validRequest.authority, validRequest.correlationId, void 0,
|
|
18911
|
+
const discoveredAuthority = await this.createAuthority(validRequest.authority, validRequest.correlationId, void 0, azureCloudOptions);
|
|
18870
18912
|
const clientConfiguration = await this.buildOauthClientConfiguration(discoveredAuthority, validRequest.correlationId, validRequest.redirectUri || "", serverTelemetryManager);
|
|
18871
18913
|
const silentFlowClient = new SilentFlowClient(clientConfiguration, new StubPerformanceClient());
|
|
18872
18914
|
this.logger.verbose("Silent flow client created", validRequest.correlationId);
|
|
@@ -18881,7 +18923,7 @@ ${serverError}`, correlationId);
|
|
|
18881
18923
|
throw error;
|
|
18882
18924
|
}
|
|
18883
18925
|
} catch (error) {
|
|
18884
|
-
if (error instanceof
|
|
18926
|
+
if (error instanceof AuthError2) {
|
|
18885
18927
|
error.correlationId = validRequest.correlationId;
|
|
18886
18928
|
}
|
|
18887
18929
|
serverTelemetryManager.cacheFailedRequest(error);
|
|
@@ -18928,7 +18970,7 @@ ${serverError}`, correlationId);
|
|
|
18928
18970
|
this.logger.verbose("Username password client created", validRequest.correlationId);
|
|
18929
18971
|
return await usernamePasswordClient.acquireToken(validRequest);
|
|
18930
18972
|
} catch (e) {
|
|
18931
|
-
if (e instanceof
|
|
18973
|
+
if (e instanceof AuthError2) {
|
|
18932
18974
|
e.correlationId = validRequest.correlationId;
|
|
18933
18975
|
}
|
|
18934
18976
|
serverTelemetryManager.cacheFailedRequest(e);
|
|
@@ -19130,16 +19172,9 @@ ${serverError}`, correlationId);
|
|
|
19130
19172
|
res.end();
|
|
19131
19173
|
return;
|
|
19132
19174
|
}
|
|
19133
|
-
|
|
19134
|
-
|
|
19135
|
-
|
|
19136
|
-
});
|
|
19137
|
-
res.end();
|
|
19138
|
-
}
|
|
19139
|
-
if (authCodeResponse.error) {
|
|
19140
|
-
res.end(errorTemplate || `Error occurred: ${authCodeResponse.error}`);
|
|
19141
|
-
}
|
|
19142
|
-
resolve(authCodeResponse);
|
|
19175
|
+
res.writeHead(400);
|
|
19176
|
+
res.end("OAuth responses must use form_post and cannot be returned in the URL.");
|
|
19177
|
+
reject(NodeAuthError.createLoopbackServerQueryResponseNotSupportedError());
|
|
19143
19178
|
} else {
|
|
19144
19179
|
res.writeHead(200);
|
|
19145
19180
|
res.end();
|
|
@@ -19457,7 +19492,7 @@ ${serverError}`, correlationId);
|
|
|
19457
19492
|
this.logger.verbose("Device code client created", validRequest.correlationId);
|
|
19458
19493
|
return await deviceCodeClient.acquireToken(validRequest);
|
|
19459
19494
|
} catch (e) {
|
|
19460
|
-
if (e instanceof
|
|
19495
|
+
if (e instanceof AuthError2) {
|
|
19461
19496
|
e.correlationId = validRequest.correlationId;
|
|
19462
19497
|
}
|
|
19463
19498
|
serverTelemetryManager.cacheFailedRequest(e);
|
|
@@ -19497,8 +19532,8 @@ ${serverError}`, correlationId);
|
|
|
19497
19532
|
}
|
|
19498
19533
|
const { verifier, challenge } = await this.cryptoProvider.generatePkceCodes();
|
|
19499
19534
|
const loopbackClient = new LoopbackClient(preferredPort);
|
|
19500
|
-
const responseMode = remainingProperties.responseMode
|
|
19501
|
-
if (responseMode !==
|
|
19535
|
+
const responseMode = remainingProperties.responseMode;
|
|
19536
|
+
if (responseMode !== void 0 && responseMode !== ResponseMode$1.FORM_POST) {
|
|
19502
19537
|
throw createClientConfigurationError(invalidResponseMode, correlationId);
|
|
19503
19538
|
}
|
|
19504
19539
|
let authCodeResponse = {};
|
|
@@ -19515,7 +19550,7 @@ ${serverError}`, correlationId);
|
|
|
19515
19550
|
correlationId,
|
|
19516
19551
|
scopes: request.scopes || OIDC_DEFAULT_SCOPES,
|
|
19517
19552
|
redirectUri,
|
|
19518
|
-
responseMode,
|
|
19553
|
+
responseMode: ResponseMode$1.FORM_POST,
|
|
19519
19554
|
codeChallenge: challenge,
|
|
19520
19555
|
codeChallengeMethod: CodeChallengeMethodValues.S256
|
|
19521
19556
|
};
|
|
@@ -19552,7 +19587,8 @@ ${serverError}`, correlationId);
|
|
|
19552
19587
|
this.logger.trace("acquireTokenSilent called", correlationId);
|
|
19553
19588
|
enforceResourceParameter(this.config.auth.isMcp, request);
|
|
19554
19589
|
if (this.nativeBrokerPlugin) {
|
|
19555
|
-
const
|
|
19590
|
+
const nativeBrokerPlugin = this.nativeBrokerPlugin;
|
|
19591
|
+
const brokerRequest = snapshotNativeRequest({
|
|
19556
19592
|
...request,
|
|
19557
19593
|
clientId: this.config.auth.clientId,
|
|
19558
19594
|
scopes: request.scopes || OIDC_DEFAULT_SCOPES,
|
|
@@ -19566,8 +19602,12 @@ ${serverError}`, correlationId);
|
|
|
19566
19602
|
},
|
|
19567
19603
|
accountId: request.account.nativeAccountId,
|
|
19568
19604
|
forceRefresh: request.forceRefresh || false
|
|
19569
|
-
};
|
|
19570
|
-
|
|
19605
|
+
});
|
|
19606
|
+
const silentRequestKey = getSilentRequestKey({
|
|
19607
|
+
requestType: "native",
|
|
19608
|
+
request: brokerRequest
|
|
19609
|
+
});
|
|
19610
|
+
return acquireTokenSilentDeduped(this, this.logger, silentRequestKey, correlationId, () => nativeBrokerPlugin.acquireTokenSilent(brokerRequest));
|
|
19571
19611
|
}
|
|
19572
19612
|
if (request.redirectUri) {
|
|
19573
19613
|
if (!this.config.broker.nativeBrokerPlugin) {
|
|
@@ -19641,7 +19681,7 @@ ${serverError}`, correlationId);
|
|
|
19641
19681
|
resolve(r);
|
|
19642
19682
|
return;
|
|
19643
19683
|
} catch (e) {
|
|
19644
|
-
if (e instanceof
|
|
19684
|
+
if (e instanceof AuthError2 && e.errorCode === NodeAuthErrorMessage.noLoopbackServerExists.code) {
|
|
19645
19685
|
ticks++;
|
|
19646
19686
|
return;
|
|
19647
19687
|
}
|
|
@@ -20164,6 +20204,9 @@ ${serverError}`, correlationId);
|
|
|
20164
20204
|
* @param Configuration - configuration object for the MSAL ConfidentialClientApplication instance
|
|
20165
20205
|
*/
|
|
20166
20206
|
constructor(configuration) {
|
|
20207
|
+
if ("instanceAware" in configuration.auth && configuration.auth.instanceAware === true) {
|
|
20208
|
+
throw NodeAuthError.createUnsupportedCcaInstanceAwareError();
|
|
20209
|
+
}
|
|
20167
20210
|
super(configuration);
|
|
20168
20211
|
const clientSecretNotEmpty = !!this.config.auth.clientSecret;
|
|
20169
20212
|
const clientAssertionNotEmpty = !!this.config.auth.clientAssertion;
|
|
@@ -20194,6 +20237,26 @@ ${serverError}`, correlationId);
|
|
|
20194
20237
|
}
|
|
20195
20238
|
this.appTokenProvider = void 0;
|
|
20196
20239
|
}
|
|
20240
|
+
/**
|
|
20241
|
+
* Creates the URL of the authorization request.
|
|
20242
|
+
*/
|
|
20243
|
+
async getAuthCodeUrl(request) {
|
|
20244
|
+
if (request.extraQueryParameters && Object.prototype.hasOwnProperty.call(request.extraQueryParameters, "instance_aware")) {
|
|
20245
|
+
throw NodeAuthError.createUnsupportedCcaInstanceAwareError(request.correlationId);
|
|
20246
|
+
}
|
|
20247
|
+
return super.getAuthCodeUrl(request);
|
|
20248
|
+
}
|
|
20249
|
+
/**
|
|
20250
|
+
* Acquires a token by exchanging an authorization code.
|
|
20251
|
+
*/
|
|
20252
|
+
async acquireTokenByCode(request, authCodePayload) {
|
|
20253
|
+
const sanitizedAuthCodePayload = authCodePayload ? {
|
|
20254
|
+
code: request.code,
|
|
20255
|
+
state: authCodePayload.state,
|
|
20256
|
+
nonce: request.nonce
|
|
20257
|
+
} : void 0;
|
|
20258
|
+
return super.acquireTokenByCode(request, sanitizedAuthCodePayload);
|
|
20259
|
+
}
|
|
20197
20260
|
/**
|
|
20198
20261
|
* This extensibility point only works for the client_credential flow, i.e. acquireTokenByClientCredential and
|
|
20199
20262
|
* is meant for Azure SDK to enhance Managed Identity support.
|
|
@@ -20255,7 +20318,7 @@ ${serverError}`, correlationId);
|
|
|
20255
20318
|
this.logger.verbose("Client credential client created", validRequest.correlationId);
|
|
20256
20319
|
return await clientCredentialClient.acquireToken(validRequest);
|
|
20257
20320
|
} catch (e) {
|
|
20258
|
-
if (e instanceof
|
|
20321
|
+
if (e instanceof AuthError2) {
|
|
20259
20322
|
e.correlationId = validRequest.correlationId;
|
|
20260
20323
|
}
|
|
20261
20324
|
serverTelemetryManager.cacheFailedRequest(e);
|
|
@@ -20286,7 +20349,7 @@ ${serverError}`, correlationId);
|
|
|
20286
20349
|
this.logger.verbose("On behalf of client created", validRequest.correlationId);
|
|
20287
20350
|
return await oboClient.acquireToken(validRequest);
|
|
20288
20351
|
} catch (e) {
|
|
20289
|
-
if (e instanceof
|
|
20352
|
+
if (e instanceof AuthError2) {
|
|
20290
20353
|
e.correlationId = validRequest.correlationId;
|
|
20291
20354
|
}
|
|
20292
20355
|
throw e;
|
|
@@ -20333,7 +20396,7 @@ ${serverError}`, correlationId);
|
|
|
20333
20396
|
this.logger.verbose("UserFederatedIdentityCredential client created", validRequest.correlationId);
|
|
20334
20397
|
return await ficClient.acquireToken(validRequest);
|
|
20335
20398
|
} catch (e) {
|
|
20336
|
-
if (e instanceof
|
|
20399
|
+
if (e instanceof AuthError2) {
|
|
20337
20400
|
e.correlationId = validRequest.correlationId;
|
|
20338
20401
|
}
|
|
20339
20402
|
serverTelemetryManager.cacheFailedRequest(e);
|
|
@@ -20507,7 +20570,7 @@ ${serverError}`, correlationId);
|
|
|
20507
20570
|
response = await networkClientHelper.sendGetRequestAsync(networkRequest.computeUri(), networkRequestOptions);
|
|
20508
20571
|
}
|
|
20509
20572
|
} catch (error) {
|
|
20510
|
-
if (error instanceof
|
|
20573
|
+
if (error instanceof AuthError2) {
|
|
20511
20574
|
throw error;
|
|
20512
20575
|
} else {
|
|
20513
20576
|
throw createClientAuthError(networkError, managedIdentityRequest.correlationId);
|
|
@@ -20898,7 +20961,7 @@ ${serverError}`, correlationId);
|
|
|
20898
20961
|
throw createManagedIdentityError(platformNotSupported, "");
|
|
20899
20962
|
}
|
|
20900
20963
|
const expectedSecretFilePath = SUPPORTED_AZURE_ARC_PLATFORMS[process.platform];
|
|
20901
|
-
const fileName =
|
|
20964
|
+
const fileName = path3.basename(secretFilePath);
|
|
20902
20965
|
if (!fileName.endsWith(".key")) {
|
|
20903
20966
|
throw createManagedIdentityError(invalidFileExtension, "");
|
|
20904
20967
|
}
|
|
@@ -20926,7 +20989,7 @@ ${serverError}`, correlationId);
|
|
|
20926
20989
|
try {
|
|
20927
20990
|
retryResponse = await networkClient.sendGetRequestAsync(networkRequest.computeUri(), networkRequestOptions);
|
|
20928
20991
|
} catch (error) {
|
|
20929
|
-
if (error instanceof
|
|
20992
|
+
if (error instanceof AuthError2) {
|
|
20930
20993
|
throw error;
|
|
20931
20994
|
} else {
|
|
20932
20995
|
throw createClientAuthError(networkError, "");
|
|
@@ -21568,7 +21631,7 @@ ${serverError}`, correlationId);
|
|
|
21568
21631
|
};
|
|
21569
21632
|
var PromptValue = PromptValue$1;
|
|
21570
21633
|
var ResponseMode = ResponseMode$1;
|
|
21571
|
-
exports2.AuthError =
|
|
21634
|
+
exports2.AuthError = AuthError2;
|
|
21572
21635
|
exports2.AuthErrorCodes = AuthErrorCodes;
|
|
21573
21636
|
exports2.AzureCloudInstance = AzureCloudInstance;
|
|
21574
21637
|
exports2.ClientAssertion = ClientAssertion;
|
|
@@ -22470,11 +22533,9 @@ var require_commonjs4 = __commonJS({
|
|
|
22470
22533
|
// node_modules/@azure/identity/dist/commonjs/msal/msal.js
|
|
22471
22534
|
var require_msal = __commonJS({
|
|
22472
22535
|
"node_modules/@azure/identity/dist/commonjs/msal/msal.js"(exports2, module2) {
|
|
22473
|
-
var __create2 = Object.create;
|
|
22474
22536
|
var __defProp2 = Object.defineProperty;
|
|
22475
22537
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
22476
22538
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
22477
|
-
var __getProtoOf2 = Object.getPrototypeOf;
|
|
22478
22539
|
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
22479
22540
|
var __export2 = (target, all) => {
|
|
22480
22541
|
for (var name in all)
|
|
@@ -22488,21 +22549,14 @@ var require_msal = __commonJS({
|
|
|
22488
22549
|
}
|
|
22489
22550
|
return to;
|
|
22490
22551
|
};
|
|
22491
|
-
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
22492
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22493
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22494
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22495
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
22496
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
22497
|
-
mod
|
|
22498
|
-
));
|
|
22499
22552
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
22500
22553
|
var msal_exports = {};
|
|
22501
22554
|
__export2(msal_exports, {
|
|
22502
|
-
|
|
22555
|
+
AuthError: () => import_msal_node.AuthError,
|
|
22556
|
+
LogLevel: () => import_msal_node.LogLevel
|
|
22503
22557
|
});
|
|
22504
22558
|
module2.exports = __toCommonJS2(msal_exports);
|
|
22505
|
-
var
|
|
22559
|
+
var import_msal_node = require_msal_node();
|
|
22506
22560
|
}
|
|
22507
22561
|
});
|
|
22508
22562
|
|
|
@@ -22532,7 +22586,6 @@ var require_utils3 = __commonJS({
|
|
|
22532
22586
|
deserializeAuthenticationRecord: () => deserializeAuthenticationRecord2,
|
|
22533
22587
|
ensureValidMsalToken: () => ensureValidMsalToken,
|
|
22534
22588
|
getAuthority: () => getAuthority,
|
|
22535
|
-
getAuthorityHost: () => getAuthorityHost,
|
|
22536
22589
|
getKnownAuthorities: () => getKnownAuthorities,
|
|
22537
22590
|
getMSALLogLevel: () => getMSALLogLevel,
|
|
22538
22591
|
handleMsalError: () => handleMsalError,
|
|
@@ -22569,13 +22622,6 @@ var require_utils3 = __commonJS({
|
|
|
22569
22622
|
throw error(`Response had no "accessToken" property.`);
|
|
22570
22623
|
}
|
|
22571
22624
|
}
|
|
22572
|
-
function getAuthorityHost(options) {
|
|
22573
|
-
let authorityHost = options?.authorityHost;
|
|
22574
|
-
if (!authorityHost && import_core_util.isNodeLike) {
|
|
22575
|
-
authorityHost = process.env.AZURE_AUTHORITY_HOST;
|
|
22576
|
-
}
|
|
22577
|
-
return authorityHost ?? import_constants.DefaultAuthorityHost;
|
|
22578
|
-
}
|
|
22579
22625
|
function getAuthority(tenantId, host) {
|
|
22580
22626
|
if (!host) {
|
|
22581
22627
|
host = import_constants.DefaultAuthorityHost;
|
|
@@ -22595,21 +22641,21 @@ var require_utils3 = __commonJS({
|
|
|
22595
22641
|
}
|
|
22596
22642
|
return [];
|
|
22597
22643
|
}
|
|
22598
|
-
var defaultLoggerCallback = (credLogger, platform2 = import_core_util.
|
|
22644
|
+
var defaultLoggerCallback = (credLogger, platform2 = import_core_util.isNodeLike ? "Node" : "Browser") => (level, message, containsPii) => {
|
|
22599
22645
|
if (containsPii) {
|
|
22600
22646
|
return;
|
|
22601
22647
|
}
|
|
22602
22648
|
switch (level) {
|
|
22603
|
-
case import_msal.
|
|
22649
|
+
case import_msal.LogLevel.Error:
|
|
22604
22650
|
credLogger.info(`MSAL ${platform2} V2 error: ${message}`);
|
|
22605
22651
|
return;
|
|
22606
|
-
case import_msal.
|
|
22652
|
+
case import_msal.LogLevel.Info:
|
|
22607
22653
|
credLogger.info(`MSAL ${platform2} V2 info message: ${message}`);
|
|
22608
22654
|
return;
|
|
22609
|
-
case import_msal.
|
|
22655
|
+
case import_msal.LogLevel.Verbose:
|
|
22610
22656
|
credLogger.info(`MSAL ${platform2} V2 verbose message: ${message}`);
|
|
22611
22657
|
return;
|
|
22612
|
-
case import_msal.
|
|
22658
|
+
case import_msal.LogLevel.Warning:
|
|
22613
22659
|
credLogger.info(`MSAL ${platform2} V2 warning: ${message}`);
|
|
22614
22660
|
return;
|
|
22615
22661
|
}
|
|
@@ -22617,15 +22663,15 @@ var require_utils3 = __commonJS({
|
|
|
22617
22663
|
function getMSALLogLevel(logLevel) {
|
|
22618
22664
|
switch (logLevel) {
|
|
22619
22665
|
case "error":
|
|
22620
|
-
return import_msal.
|
|
22666
|
+
return import_msal.LogLevel.Error;
|
|
22621
22667
|
case "info":
|
|
22622
|
-
return import_msal.
|
|
22668
|
+
return import_msal.LogLevel.Info;
|
|
22623
22669
|
case "verbose":
|
|
22624
|
-
return import_msal.
|
|
22670
|
+
return import_msal.LogLevel.Verbose;
|
|
22625
22671
|
case "warning":
|
|
22626
|
-
return import_msal.
|
|
22672
|
+
return import_msal.LogLevel.Warning;
|
|
22627
22673
|
default:
|
|
22628
|
-
return import_msal.
|
|
22674
|
+
return import_msal.LogLevel.Info;
|
|
22629
22675
|
}
|
|
22630
22676
|
}
|
|
22631
22677
|
function randomUUID2() {
|
|
@@ -22664,7 +22710,12 @@ var require_utils3 = __commonJS({
|
|
|
22664
22710
|
);
|
|
22665
22711
|
return error;
|
|
22666
22712
|
}
|
|
22667
|
-
return new import_errors.AuthenticationRequiredError({
|
|
22713
|
+
return new import_errors.AuthenticationRequiredError({
|
|
22714
|
+
scopes,
|
|
22715
|
+
getTokenOptions,
|
|
22716
|
+
message: error.message,
|
|
22717
|
+
cause: error
|
|
22718
|
+
});
|
|
22668
22719
|
}
|
|
22669
22720
|
function publicToMsal(account) {
|
|
22670
22721
|
return {
|
|
@@ -23128,13 +23179,13 @@ function __disposeResources(env) {
|
|
|
23128
23179
|
}
|
|
23129
23180
|
return next();
|
|
23130
23181
|
}
|
|
23131
|
-
function __rewriteRelativeImportExtension(
|
|
23132
|
-
if (typeof
|
|
23133
|
-
return
|
|
23182
|
+
function __rewriteRelativeImportExtension(path3, preserveJsx) {
|
|
23183
|
+
if (typeof path3 === "string" && /^\.\.?\//.test(path3)) {
|
|
23184
|
+
return path3.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
|
|
23134
23185
|
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
|
|
23135
23186
|
});
|
|
23136
23187
|
}
|
|
23137
|
-
return
|
|
23188
|
+
return path3;
|
|
23138
23189
|
}
|
|
23139
23190
|
var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default;
|
|
23140
23191
|
var init_tslib_es6 = __esm({
|
|
@@ -24565,8 +24616,8 @@ var require_inspect = __commonJS({
|
|
|
24565
24616
|
custom: () => custom
|
|
24566
24617
|
});
|
|
24567
24618
|
module2.exports = __toCommonJS2(inspect_exports);
|
|
24568
|
-
var
|
|
24569
|
-
var custom =
|
|
24619
|
+
var import_node_util7 = require("node:util");
|
|
24620
|
+
var custom = import_node_util7.inspect.custom;
|
|
24570
24621
|
}
|
|
24571
24622
|
});
|
|
24572
24623
|
|
|
@@ -25166,19 +25217,19 @@ var require_userAgentPlatform = __commonJS({
|
|
|
25166
25217
|
});
|
|
25167
25218
|
module2.exports = __toCommonJS2(userAgentPlatform_exports);
|
|
25168
25219
|
var import_node_os2 = __toESM2(require("node:os"));
|
|
25169
|
-
var
|
|
25220
|
+
var import_node_process9 = __toESM2(require("node:process"));
|
|
25170
25221
|
function getHeaderName() {
|
|
25171
25222
|
return "User-Agent";
|
|
25172
25223
|
}
|
|
25173
25224
|
async function setPlatformSpecificData2(map) {
|
|
25174
|
-
if (
|
|
25225
|
+
if (import_node_process9.default && import_node_process9.default.versions) {
|
|
25175
25226
|
const osInfo = `${import_node_os2.default.type()} ${import_node_os2.default.release()}; ${import_node_os2.default.arch()}`;
|
|
25176
|
-
if (
|
|
25177
|
-
map.set("Bun", `${
|
|
25178
|
-
} else if (
|
|
25179
|
-
map.set("Deno", `${
|
|
25180
|
-
} else if (
|
|
25181
|
-
map.set("Node", `${
|
|
25227
|
+
if (import_node_process9.default.versions.bun) {
|
|
25228
|
+
map.set("Bun", `${import_node_process9.default.versions.bun} (${osInfo})`);
|
|
25229
|
+
} else if (import_node_process9.default.versions.deno) {
|
|
25230
|
+
map.set("Deno", `${import_node_process9.default.versions.deno} (${osInfo})`);
|
|
25231
|
+
} else if (import_node_process9.default.versions.node) {
|
|
25232
|
+
map.set("Node", `${import_node_process9.default.versions.node} (${osInfo})`);
|
|
25182
25233
|
}
|
|
25183
25234
|
}
|
|
25184
25235
|
}
|
|
@@ -25918,122 +25969,6 @@ var require_tlsPolicy = __commonJS({
|
|
|
25918
25969
|
}
|
|
25919
25970
|
});
|
|
25920
25971
|
|
|
25921
|
-
// node_modules/https-proxy-agent/node_modules/ms/index.js
|
|
25922
|
-
var require_ms3 = __commonJS({
|
|
25923
|
-
"node_modules/https-proxy-agent/node_modules/ms/index.js"(exports2, module2) {
|
|
25924
|
-
var s = 1e3;
|
|
25925
|
-
var m = s * 60;
|
|
25926
|
-
var h = m * 60;
|
|
25927
|
-
var d = h * 24;
|
|
25928
|
-
var w = d * 7;
|
|
25929
|
-
var y = d * 365.25;
|
|
25930
|
-
module2.exports = function(val, options) {
|
|
25931
|
-
options = options || {};
|
|
25932
|
-
var type = typeof val;
|
|
25933
|
-
if (type === "string" && val.length > 0) {
|
|
25934
|
-
return parse(val);
|
|
25935
|
-
} else if (type === "number" && isFinite(val)) {
|
|
25936
|
-
return options.long ? fmtLong(val) : fmtShort(val);
|
|
25937
|
-
}
|
|
25938
|
-
throw new Error(
|
|
25939
|
-
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
25940
|
-
);
|
|
25941
|
-
};
|
|
25942
|
-
function parse(str) {
|
|
25943
|
-
str = String(str);
|
|
25944
|
-
if (str.length > 100) {
|
|
25945
|
-
return;
|
|
25946
|
-
}
|
|
25947
|
-
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
25948
|
-
str
|
|
25949
|
-
);
|
|
25950
|
-
if (!match) {
|
|
25951
|
-
return;
|
|
25952
|
-
}
|
|
25953
|
-
var n = parseFloat(match[1]);
|
|
25954
|
-
var type = (match[2] || "ms").toLowerCase();
|
|
25955
|
-
switch (type) {
|
|
25956
|
-
case "years":
|
|
25957
|
-
case "year":
|
|
25958
|
-
case "yrs":
|
|
25959
|
-
case "yr":
|
|
25960
|
-
case "y":
|
|
25961
|
-
return n * y;
|
|
25962
|
-
case "weeks":
|
|
25963
|
-
case "week":
|
|
25964
|
-
case "w":
|
|
25965
|
-
return n * w;
|
|
25966
|
-
case "days":
|
|
25967
|
-
case "day":
|
|
25968
|
-
case "d":
|
|
25969
|
-
return n * d;
|
|
25970
|
-
case "hours":
|
|
25971
|
-
case "hour":
|
|
25972
|
-
case "hrs":
|
|
25973
|
-
case "hr":
|
|
25974
|
-
case "h":
|
|
25975
|
-
return n * h;
|
|
25976
|
-
case "minutes":
|
|
25977
|
-
case "minute":
|
|
25978
|
-
case "mins":
|
|
25979
|
-
case "min":
|
|
25980
|
-
case "m":
|
|
25981
|
-
return n * m;
|
|
25982
|
-
case "seconds":
|
|
25983
|
-
case "second":
|
|
25984
|
-
case "secs":
|
|
25985
|
-
case "sec":
|
|
25986
|
-
case "s":
|
|
25987
|
-
return n * s;
|
|
25988
|
-
case "milliseconds":
|
|
25989
|
-
case "millisecond":
|
|
25990
|
-
case "msecs":
|
|
25991
|
-
case "msec":
|
|
25992
|
-
case "ms":
|
|
25993
|
-
return n;
|
|
25994
|
-
default:
|
|
25995
|
-
return void 0;
|
|
25996
|
-
}
|
|
25997
|
-
}
|
|
25998
|
-
function fmtShort(ms) {
|
|
25999
|
-
var msAbs = Math.abs(ms);
|
|
26000
|
-
if (msAbs >= d) {
|
|
26001
|
-
return Math.round(ms / d) + "d";
|
|
26002
|
-
}
|
|
26003
|
-
if (msAbs >= h) {
|
|
26004
|
-
return Math.round(ms / h) + "h";
|
|
26005
|
-
}
|
|
26006
|
-
if (msAbs >= m) {
|
|
26007
|
-
return Math.round(ms / m) + "m";
|
|
26008
|
-
}
|
|
26009
|
-
if (msAbs >= s) {
|
|
26010
|
-
return Math.round(ms / s) + "s";
|
|
26011
|
-
}
|
|
26012
|
-
return ms + "ms";
|
|
26013
|
-
}
|
|
26014
|
-
function fmtLong(ms) {
|
|
26015
|
-
var msAbs = Math.abs(ms);
|
|
26016
|
-
if (msAbs >= d) {
|
|
26017
|
-
return plural(ms, msAbs, d, "day");
|
|
26018
|
-
}
|
|
26019
|
-
if (msAbs >= h) {
|
|
26020
|
-
return plural(ms, msAbs, h, "hour");
|
|
26021
|
-
}
|
|
26022
|
-
if (msAbs >= m) {
|
|
26023
|
-
return plural(ms, msAbs, m, "minute");
|
|
26024
|
-
}
|
|
26025
|
-
if (msAbs >= s) {
|
|
26026
|
-
return plural(ms, msAbs, s, "second");
|
|
26027
|
-
}
|
|
26028
|
-
return ms + " ms";
|
|
26029
|
-
}
|
|
26030
|
-
function plural(ms, msAbs, n, name) {
|
|
26031
|
-
var isPlural = msAbs >= n * 1.5;
|
|
26032
|
-
return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
|
|
26033
|
-
}
|
|
26034
|
-
}
|
|
26035
|
-
});
|
|
26036
|
-
|
|
26037
25972
|
// node_modules/https-proxy-agent/node_modules/debug/src/common.js
|
|
26038
25973
|
var require_common2 = __commonJS({
|
|
26039
25974
|
"node_modules/https-proxy-agent/node_modules/debug/src/common.js"(exports2, module2) {
|
|
@@ -26044,7 +25979,7 @@ var require_common2 = __commonJS({
|
|
|
26044
25979
|
createDebug.disable = disable;
|
|
26045
25980
|
createDebug.enable = enable;
|
|
26046
25981
|
createDebug.enabled = enabled;
|
|
26047
|
-
createDebug.humanize =
|
|
25982
|
+
createDebug.humanize = require_ms();
|
|
26048
25983
|
createDebug.destroy = destroy;
|
|
26049
25984
|
Object.keys(env).forEach((key) => {
|
|
26050
25985
|
createDebug[key] = env[key];
|
|
@@ -27038,122 +26973,6 @@ var require_dist2 = __commonJS({
|
|
|
27038
26973
|
}
|
|
27039
26974
|
});
|
|
27040
26975
|
|
|
27041
|
-
// node_modules/http-proxy-agent/node_modules/ms/index.js
|
|
27042
|
-
var require_ms4 = __commonJS({
|
|
27043
|
-
"node_modules/http-proxy-agent/node_modules/ms/index.js"(exports2, module2) {
|
|
27044
|
-
var s = 1e3;
|
|
27045
|
-
var m = s * 60;
|
|
27046
|
-
var h = m * 60;
|
|
27047
|
-
var d = h * 24;
|
|
27048
|
-
var w = d * 7;
|
|
27049
|
-
var y = d * 365.25;
|
|
27050
|
-
module2.exports = function(val, options) {
|
|
27051
|
-
options = options || {};
|
|
27052
|
-
var type = typeof val;
|
|
27053
|
-
if (type === "string" && val.length > 0) {
|
|
27054
|
-
return parse(val);
|
|
27055
|
-
} else if (type === "number" && isFinite(val)) {
|
|
27056
|
-
return options.long ? fmtLong(val) : fmtShort(val);
|
|
27057
|
-
}
|
|
27058
|
-
throw new Error(
|
|
27059
|
-
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
27060
|
-
);
|
|
27061
|
-
};
|
|
27062
|
-
function parse(str) {
|
|
27063
|
-
str = String(str);
|
|
27064
|
-
if (str.length > 100) {
|
|
27065
|
-
return;
|
|
27066
|
-
}
|
|
27067
|
-
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
27068
|
-
str
|
|
27069
|
-
);
|
|
27070
|
-
if (!match) {
|
|
27071
|
-
return;
|
|
27072
|
-
}
|
|
27073
|
-
var n = parseFloat(match[1]);
|
|
27074
|
-
var type = (match[2] || "ms").toLowerCase();
|
|
27075
|
-
switch (type) {
|
|
27076
|
-
case "years":
|
|
27077
|
-
case "year":
|
|
27078
|
-
case "yrs":
|
|
27079
|
-
case "yr":
|
|
27080
|
-
case "y":
|
|
27081
|
-
return n * y;
|
|
27082
|
-
case "weeks":
|
|
27083
|
-
case "week":
|
|
27084
|
-
case "w":
|
|
27085
|
-
return n * w;
|
|
27086
|
-
case "days":
|
|
27087
|
-
case "day":
|
|
27088
|
-
case "d":
|
|
27089
|
-
return n * d;
|
|
27090
|
-
case "hours":
|
|
27091
|
-
case "hour":
|
|
27092
|
-
case "hrs":
|
|
27093
|
-
case "hr":
|
|
27094
|
-
case "h":
|
|
27095
|
-
return n * h;
|
|
27096
|
-
case "minutes":
|
|
27097
|
-
case "minute":
|
|
27098
|
-
case "mins":
|
|
27099
|
-
case "min":
|
|
27100
|
-
case "m":
|
|
27101
|
-
return n * m;
|
|
27102
|
-
case "seconds":
|
|
27103
|
-
case "second":
|
|
27104
|
-
case "secs":
|
|
27105
|
-
case "sec":
|
|
27106
|
-
case "s":
|
|
27107
|
-
return n * s;
|
|
27108
|
-
case "milliseconds":
|
|
27109
|
-
case "millisecond":
|
|
27110
|
-
case "msecs":
|
|
27111
|
-
case "msec":
|
|
27112
|
-
case "ms":
|
|
27113
|
-
return n;
|
|
27114
|
-
default:
|
|
27115
|
-
return void 0;
|
|
27116
|
-
}
|
|
27117
|
-
}
|
|
27118
|
-
function fmtShort(ms) {
|
|
27119
|
-
var msAbs = Math.abs(ms);
|
|
27120
|
-
if (msAbs >= d) {
|
|
27121
|
-
return Math.round(ms / d) + "d";
|
|
27122
|
-
}
|
|
27123
|
-
if (msAbs >= h) {
|
|
27124
|
-
return Math.round(ms / h) + "h";
|
|
27125
|
-
}
|
|
27126
|
-
if (msAbs >= m) {
|
|
27127
|
-
return Math.round(ms / m) + "m";
|
|
27128
|
-
}
|
|
27129
|
-
if (msAbs >= s) {
|
|
27130
|
-
return Math.round(ms / s) + "s";
|
|
27131
|
-
}
|
|
27132
|
-
return ms + "ms";
|
|
27133
|
-
}
|
|
27134
|
-
function fmtLong(ms) {
|
|
27135
|
-
var msAbs = Math.abs(ms);
|
|
27136
|
-
if (msAbs >= d) {
|
|
27137
|
-
return plural(ms, msAbs, d, "day");
|
|
27138
|
-
}
|
|
27139
|
-
if (msAbs >= h) {
|
|
27140
|
-
return plural(ms, msAbs, h, "hour");
|
|
27141
|
-
}
|
|
27142
|
-
if (msAbs >= m) {
|
|
27143
|
-
return plural(ms, msAbs, m, "minute");
|
|
27144
|
-
}
|
|
27145
|
-
if (msAbs >= s) {
|
|
27146
|
-
return plural(ms, msAbs, s, "second");
|
|
27147
|
-
}
|
|
27148
|
-
return ms + " ms";
|
|
27149
|
-
}
|
|
27150
|
-
function plural(ms, msAbs, n, name) {
|
|
27151
|
-
var isPlural = msAbs >= n * 1.5;
|
|
27152
|
-
return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
|
|
27153
|
-
}
|
|
27154
|
-
}
|
|
27155
|
-
});
|
|
27156
|
-
|
|
27157
26976
|
// node_modules/http-proxy-agent/node_modules/debug/src/common.js
|
|
27158
26977
|
var require_common3 = __commonJS({
|
|
27159
26978
|
"node_modules/http-proxy-agent/node_modules/debug/src/common.js"(exports2, module2) {
|
|
@@ -27164,7 +26983,7 @@ var require_common3 = __commonJS({
|
|
|
27164
26983
|
createDebug.disable = disable;
|
|
27165
26984
|
createDebug.enable = enable;
|
|
27166
26985
|
createDebug.enabled = enabled;
|
|
27167
|
-
createDebug.humanize =
|
|
26986
|
+
createDebug.humanize = require_ms();
|
|
27168
26987
|
createDebug.destroy = destroy;
|
|
27169
26988
|
Object.keys(env).forEach((key) => {
|
|
27170
26989
|
createDebug[key] = env[key];
|
|
@@ -29504,8 +29323,8 @@ var require_getClient = __commonJS({
|
|
|
29504
29323
|
const noDefaultAcceptHeader = clientOptions.internal?.noDefaultAcceptHeader ?? false;
|
|
29505
29324
|
const { allowInsecureConnection, httpClient } = clientOptions;
|
|
29506
29325
|
const endpointUrl = clientOptions.endpoint ?? endpoint;
|
|
29507
|
-
const client = (
|
|
29508
|
-
const getUrl = (requestOptions) => (0, import_urlHelpers.buildRequestUrl)(endpointUrl,
|
|
29326
|
+
const client = (path3, ...args) => {
|
|
29327
|
+
const getUrl = (requestOptions) => (0, import_urlHelpers.buildRequestUrl)(endpointUrl, path3, args, { allowInsecureConnection, ...requestOptions });
|
|
29509
29328
|
return {
|
|
29510
29329
|
get: (requestOptions = {}) => {
|
|
29511
29330
|
return buildOperation(
|
|
@@ -30173,19 +29992,19 @@ var require_userAgentPlatform2 = __commonJS({
|
|
|
30173
29992
|
});
|
|
30174
29993
|
module2.exports = __toCommonJS2(userAgentPlatform_exports);
|
|
30175
29994
|
var import_node_os2 = __toESM2(require("node:os"));
|
|
30176
|
-
var
|
|
29995
|
+
var import_node_process9 = __toESM2(require("node:process"));
|
|
30177
29996
|
function getHeaderName() {
|
|
30178
29997
|
return "User-Agent";
|
|
30179
29998
|
}
|
|
30180
29999
|
async function setPlatformSpecificData2(map) {
|
|
30181
|
-
if (
|
|
30000
|
+
if (import_node_process9.default && import_node_process9.default.versions) {
|
|
30182
30001
|
const osInfo = `${import_node_os2.default.type()} ${import_node_os2.default.release()}; ${import_node_os2.default.arch()}`;
|
|
30183
|
-
if (
|
|
30184
|
-
map.set("Bun", `${
|
|
30185
|
-
} else if (
|
|
30186
|
-
map.set("Deno", `${
|
|
30187
|
-
} else if (
|
|
30188
|
-
map.set("Node", `${
|
|
30002
|
+
if (import_node_process9.default.versions.bun) {
|
|
30003
|
+
map.set("Bun", `${import_node_process9.default.versions.bun} (${osInfo})`);
|
|
30004
|
+
} else if (import_node_process9.default.versions.deno) {
|
|
30005
|
+
map.set("Deno", `${import_node_process9.default.versions.deno} (${osInfo})`);
|
|
30006
|
+
} else if (import_node_process9.default.versions.node) {
|
|
30007
|
+
map.set("Node", `${import_node_process9.default.versions.node} (${osInfo})`);
|
|
30189
30008
|
}
|
|
30190
30009
|
}
|
|
30191
30010
|
}
|
|
@@ -32461,15 +32280,15 @@ var require_urlHelpers2 = __commonJS({
|
|
|
32461
32280
|
let isAbsolutePath = false;
|
|
32462
32281
|
let requestUrl = replaceAll(baseUri, urlReplacements);
|
|
32463
32282
|
if (operationSpec.path) {
|
|
32464
|
-
let
|
|
32465
|
-
if (operationSpec.path === "/{nextLink}" &&
|
|
32466
|
-
|
|
32283
|
+
let path3 = replaceAll(operationSpec.path, urlReplacements);
|
|
32284
|
+
if (operationSpec.path === "/{nextLink}" && path3.startsWith("/")) {
|
|
32285
|
+
path3 = path3.substring(1);
|
|
32467
32286
|
}
|
|
32468
|
-
if (isAbsoluteUrl(
|
|
32469
|
-
requestUrl =
|
|
32287
|
+
if (isAbsoluteUrl(path3)) {
|
|
32288
|
+
requestUrl = path3;
|
|
32470
32289
|
isAbsolutePath = true;
|
|
32471
32290
|
} else {
|
|
32472
|
-
requestUrl = appendPath(requestUrl,
|
|
32291
|
+
requestUrl = appendPath(requestUrl, path3);
|
|
32473
32292
|
}
|
|
32474
32293
|
}
|
|
32475
32294
|
const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject);
|
|
@@ -32515,9 +32334,9 @@ var require_urlHelpers2 = __commonJS({
|
|
|
32515
32334
|
}
|
|
32516
32335
|
const searchStart = pathToAppend.indexOf("?");
|
|
32517
32336
|
if (searchStart !== -1) {
|
|
32518
|
-
const
|
|
32337
|
+
const path3 = pathToAppend.substring(0, searchStart);
|
|
32519
32338
|
const search = pathToAppend.substring(searchStart + 1);
|
|
32520
|
-
newPath = newPath +
|
|
32339
|
+
newPath = newPath + path3;
|
|
32521
32340
|
if (search) {
|
|
32522
32341
|
parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search;
|
|
32523
32342
|
}
|
|
@@ -33130,6 +32949,43 @@ var require_utils5 = __commonJS({
|
|
|
33130
32949
|
}
|
|
33131
32950
|
});
|
|
33132
32951
|
|
|
32952
|
+
// node_modules/@azure/identity/dist/commonjs/util/authorityHost.js
|
|
32953
|
+
var require_authorityHost = __commonJS({
|
|
32954
|
+
"node_modules/@azure/identity/dist/commonjs/util/authorityHost.js"(exports2, module2) {
|
|
32955
|
+
var __defProp2 = Object.defineProperty;
|
|
32956
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
32957
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
32958
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
32959
|
+
var __export2 = (target, all) => {
|
|
32960
|
+
for (var name in all)
|
|
32961
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
32962
|
+
};
|
|
32963
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
32964
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
32965
|
+
for (let key of __getOwnPropNames2(from))
|
|
32966
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
32967
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
32968
|
+
}
|
|
32969
|
+
return to;
|
|
32970
|
+
};
|
|
32971
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
32972
|
+
var authorityHost_exports = {};
|
|
32973
|
+
__export2(authorityHost_exports, {
|
|
32974
|
+
getAuthorityHost: () => getAuthorityHost
|
|
32975
|
+
});
|
|
32976
|
+
module2.exports = __toCommonJS2(authorityHost_exports);
|
|
32977
|
+
var import_core_util = require_commonjs4();
|
|
32978
|
+
var import_constants = require_constants();
|
|
32979
|
+
function getAuthorityHost(options) {
|
|
32980
|
+
let authorityHost = options?.authorityHost;
|
|
32981
|
+
if (!authorityHost && import_core_util.isNodeLike) {
|
|
32982
|
+
authorityHost = process.env.AZURE_AUTHORITY_HOST;
|
|
32983
|
+
}
|
|
32984
|
+
return authorityHost ?? import_constants.DefaultAuthorityHost;
|
|
32985
|
+
}
|
|
32986
|
+
}
|
|
32987
|
+
});
|
|
32988
|
+
|
|
33133
32989
|
// node_modules/@azure/identity/dist/commonjs/client/identityClient.js
|
|
33134
32990
|
var require_identityClient = __commonJS({
|
|
33135
32991
|
"node_modules/@azure/identity/dist/commonjs/client/identityClient.js"(exports2, module2) {
|
|
@@ -33152,27 +33008,26 @@ var require_identityClient = __commonJS({
|
|
|
33152
33008
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
33153
33009
|
var identityClient_exports = {};
|
|
33154
33010
|
__export2(identityClient_exports, {
|
|
33155
|
-
IdentityClient: () => IdentityClient
|
|
33156
|
-
getIdentityClientAuthorityHost: () => getIdentityClientAuthorityHost
|
|
33011
|
+
IdentityClient: () => IdentityClient
|
|
33157
33012
|
});
|
|
33158
33013
|
module2.exports = __toCommonJS2(identityClient_exports);
|
|
33159
33014
|
var import_core_client = require_commonjs7();
|
|
33160
|
-
var import_core_util = require_commonjs4();
|
|
33161
33015
|
var import_core_rest_pipeline = require_commonjs6();
|
|
33016
|
+
var import_core_util = require_commonjs4();
|
|
33162
33017
|
var import_errors = require_errors2();
|
|
33163
33018
|
var import_identityTokenEndpoint = require_identityTokenEndpoint();
|
|
33164
33019
|
var import_constants = require_constants();
|
|
33165
33020
|
var import_tracing = require_tracing();
|
|
33166
33021
|
var import_logging = require_logging();
|
|
33167
33022
|
var import_utils = require_utils5();
|
|
33023
|
+
var import_authorityHost = require_authorityHost();
|
|
33168
33024
|
var noCorrelationId = "noCorrelationId";
|
|
33169
|
-
|
|
33170
|
-
|
|
33171
|
-
|
|
33172
|
-
|
|
33173
|
-
|
|
33174
|
-
|
|
33175
|
-
}
|
|
33025
|
+
var HttpStatus = {
|
|
33026
|
+
CLIENT_ERROR_RANGE_START: 400,
|
|
33027
|
+
CLIENT_ERROR_RANGE_END: 499,
|
|
33028
|
+
SERVER_ERROR_RANGE_START: 500,
|
|
33029
|
+
SERVER_ERROR_RANGE_END: 599
|
|
33030
|
+
};
|
|
33176
33031
|
var IdentityClient = class extends import_core_client.ServiceClient {
|
|
33177
33032
|
authorityHost;
|
|
33178
33033
|
allowLoggingAccountIdentifiers;
|
|
@@ -33183,7 +33038,7 @@ var require_identityClient = __commonJS({
|
|
|
33183
33038
|
constructor(options) {
|
|
33184
33039
|
const packageDetails = `azsdk-js-identity/${import_constants.SDK_VERSION}`;
|
|
33185
33040
|
const userAgentPrefix = options?.userAgentOptions?.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`;
|
|
33186
|
-
const baseUri =
|
|
33041
|
+
const baseUri = (0, import_authorityHost.getAuthorityHost)(options);
|
|
33187
33042
|
if (!baseUri.startsWith("https:")) {
|
|
33188
33043
|
throw new Error("The authorityHost address must use the 'https' protocol.");
|
|
33189
33044
|
}
|
|
@@ -33335,7 +33190,7 @@ var require_identityClient = __commonJS({
|
|
|
33335
33190
|
const response = await this.sendRequest(request);
|
|
33336
33191
|
this.logIdentifiers(response);
|
|
33337
33192
|
return {
|
|
33338
|
-
body:
|
|
33193
|
+
body: this.parseResponseBody(response),
|
|
33339
33194
|
headers: response.headers.toJSON(),
|
|
33340
33195
|
status: response.status
|
|
33341
33196
|
};
|
|
@@ -33353,7 +33208,7 @@ var require_identityClient = __commonJS({
|
|
|
33353
33208
|
const response = await this.sendRequest(request);
|
|
33354
33209
|
this.logIdentifiers(response);
|
|
33355
33210
|
return {
|
|
33356
|
-
body:
|
|
33211
|
+
body: this.parseResponseBody(response),
|
|
33357
33212
|
headers: response.headers.toJSON(),
|
|
33358
33213
|
status: response.status
|
|
33359
33214
|
};
|
|
@@ -33390,7 +33245,7 @@ var require_identityClient = __commonJS({
|
|
|
33390
33245
|
}
|
|
33391
33246
|
const base64Metadata = accessToken.split(".")[1];
|
|
33392
33247
|
const { appid, upn, tid, oid } = JSON.parse(
|
|
33393
|
-
|
|
33248
|
+
(0, import_core_util.uint8ArrayToString)((0, import_core_util.stringToUint8Array)(base64Metadata, "base64url"), "utf-8")
|
|
33394
33249
|
);
|
|
33395
33250
|
import_logging.logger.info(
|
|
33396
33251
|
`[Authenticated account] Client ID: ${appid}. Tenant ID: ${tid}. User Principal Name: ${upn || unavailableUpn}. Object ID (user): ${oid}`
|
|
@@ -33402,6 +33257,41 @@ var require_identityClient = __commonJS({
|
|
|
33402
33257
|
);
|
|
33403
33258
|
}
|
|
33404
33259
|
}
|
|
33260
|
+
/**
|
|
33261
|
+
* Parses the response body if possible. Add error properties if parsing fails.
|
|
33262
|
+
* This follows MSAL INetworkModule behavior so the response is in expected format.
|
|
33263
|
+
*/
|
|
33264
|
+
parseResponseBody(response) {
|
|
33265
|
+
let parsedBody;
|
|
33266
|
+
try {
|
|
33267
|
+
parsedBody = JSON.parse(response.bodyAsText || "");
|
|
33268
|
+
} catch (error) {
|
|
33269
|
+
import_logging.logger.info(`IdentityClient: Could not parse response body: ${error}`);
|
|
33270
|
+
let errorType;
|
|
33271
|
+
let errorDescriptionHelper;
|
|
33272
|
+
if (response.status >= HttpStatus.CLIENT_ERROR_RANGE_START && response.status <= HttpStatus.CLIENT_ERROR_RANGE_END) {
|
|
33273
|
+
errorType = "client_error";
|
|
33274
|
+
errorDescriptionHelper = "A client";
|
|
33275
|
+
} else if (response.status >= HttpStatus.SERVER_ERROR_RANGE_START && response.status <= HttpStatus.SERVER_ERROR_RANGE_END) {
|
|
33276
|
+
errorType = "server_error";
|
|
33277
|
+
errorDescriptionHelper = "A server";
|
|
33278
|
+
} else {
|
|
33279
|
+
errorType = "unknown_error";
|
|
33280
|
+
errorDescriptionHelper = "An unknown";
|
|
33281
|
+
}
|
|
33282
|
+
const errorDescriptionLines = [
|
|
33283
|
+
`${errorDescriptionHelper} error occured.`,
|
|
33284
|
+
`Http status code: ${response.status}`,
|
|
33285
|
+
`Http status message: ${response.bodyAsText || "Unknown"}`,
|
|
33286
|
+
`Headers: ${JSON.stringify(response.headers)}`
|
|
33287
|
+
];
|
|
33288
|
+
parsedBody = {
|
|
33289
|
+
error: errorType,
|
|
33290
|
+
error_description: errorDescriptionLines.join("\n")
|
|
33291
|
+
};
|
|
33292
|
+
}
|
|
33293
|
+
return parsedBody;
|
|
33294
|
+
}
|
|
33405
33295
|
};
|
|
33406
33296
|
}
|
|
33407
33297
|
});
|
|
@@ -33699,14 +33589,80 @@ var init_is_wsl = __esm({
|
|
|
33699
33589
|
}
|
|
33700
33590
|
});
|
|
33701
33591
|
|
|
33592
|
+
// node_modules/powershell-utils/index.js
|
|
33593
|
+
var import_node_process2, import_node_buffer, import_node_util, import_node_child_process, execFile2, powerShellPath, argumentsPrefix, encodeCommand, escapeArgument, createArguments, createExecFileOptions, executePowerShell;
|
|
33594
|
+
var init_powershell_utils = __esm({
|
|
33595
|
+
"node_modules/powershell-utils/index.js"() {
|
|
33596
|
+
import_node_process2 = __toESM(require("node:process"), 1);
|
|
33597
|
+
import_node_buffer = require("node:buffer");
|
|
33598
|
+
import_node_util = require("node:util");
|
|
33599
|
+
import_node_child_process = __toESM(require("node:child_process"), 1);
|
|
33600
|
+
execFile2 = (0, import_node_util.promisify)(import_node_child_process.default.execFile);
|
|
33601
|
+
powerShellPath = () => `${import_node_process2.default.env.SYSTEMROOT || import_node_process2.default.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
33602
|
+
argumentsPrefix = [
|
|
33603
|
+
"-NoProfile",
|
|
33604
|
+
"-NonInteractive",
|
|
33605
|
+
"-ExecutionPolicy",
|
|
33606
|
+
"Bypass",
|
|
33607
|
+
"-EncodedCommand"
|
|
33608
|
+
];
|
|
33609
|
+
encodeCommand = (command) => import_node_buffer.Buffer.from(command, "utf16le").toString("base64");
|
|
33610
|
+
escapeArgument = (value) => `'${String(value).replaceAll(/['‘’‚‛]/g, (match) => match + match)}'`;
|
|
33611
|
+
createArguments = (command) => [...argumentsPrefix, encodeCommand(command)];
|
|
33612
|
+
createExecFileOptions = (options) => ({
|
|
33613
|
+
encoding: "utf8",
|
|
33614
|
+
...options,
|
|
33615
|
+
shell: false
|
|
33616
|
+
});
|
|
33617
|
+
executePowerShell = async (command, options = {}) => {
|
|
33618
|
+
const {
|
|
33619
|
+
powerShellPath: psPath,
|
|
33620
|
+
...execFileOptions
|
|
33621
|
+
} = options;
|
|
33622
|
+
return execFile2(
|
|
33623
|
+
psPath ?? powerShellPath(),
|
|
33624
|
+
createArguments(command),
|
|
33625
|
+
createExecFileOptions(execFileOptions)
|
|
33626
|
+
);
|
|
33627
|
+
};
|
|
33628
|
+
executePowerShell.argumentsPrefix = argumentsPrefix;
|
|
33629
|
+
executePowerShell.encodeCommand = encodeCommand;
|
|
33630
|
+
executePowerShell.escapeArgument = escapeArgument;
|
|
33631
|
+
executePowerShell.createArguments = createArguments;
|
|
33632
|
+
}
|
|
33633
|
+
});
|
|
33634
|
+
|
|
33635
|
+
// node_modules/wsl-utils/utilities.js
|
|
33636
|
+
function parseMountPointFromConfig(content) {
|
|
33637
|
+
for (const line of content.split("\n")) {
|
|
33638
|
+
if (/^\s*#/.test(line)) {
|
|
33639
|
+
continue;
|
|
33640
|
+
}
|
|
33641
|
+
const match = /^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(line);
|
|
33642
|
+
if (!match) {
|
|
33643
|
+
continue;
|
|
33644
|
+
}
|
|
33645
|
+
return match.groups.mountPoint.trim().replaceAll(/^["']|["']$/g, "");
|
|
33646
|
+
}
|
|
33647
|
+
}
|
|
33648
|
+
var init_utilities = __esm({
|
|
33649
|
+
"node_modules/wsl-utils/utilities.js"() {
|
|
33650
|
+
}
|
|
33651
|
+
});
|
|
33652
|
+
|
|
33702
33653
|
// node_modules/wsl-utils/index.js
|
|
33703
|
-
var
|
|
33654
|
+
var import_node_path, import_node_util2, import_node_child_process2, import_promises, execFile3, wslDrivesMountPoint, powerShellPathFromWsl, powerShellPath2, canAccessPowerShellPromise, canAccessPowerShell, wslDefaultBrowser, isUrl, convertPath, convertWslPathToWindows;
|
|
33704
33655
|
var init_wsl_utils = __esm({
|
|
33705
33656
|
"node_modules/wsl-utils/index.js"() {
|
|
33706
|
-
|
|
33657
|
+
import_node_path = __toESM(require("node:path"), 1);
|
|
33658
|
+
import_node_util2 = require("node:util");
|
|
33659
|
+
import_node_child_process2 = __toESM(require("node:child_process"), 1);
|
|
33707
33660
|
import_promises = __toESM(require("node:fs/promises"), 1);
|
|
33708
33661
|
init_is_wsl();
|
|
33662
|
+
init_powershell_utils();
|
|
33663
|
+
init_utilities();
|
|
33709
33664
|
init_is_wsl();
|
|
33665
|
+
execFile3 = (0, import_node_util2.promisify)(import_node_child_process2.default.execFile);
|
|
33710
33666
|
wslDrivesMountPoint = /* @__PURE__ */ (() => {
|
|
33711
33667
|
const defaultMountPoint = "/mnt/";
|
|
33712
33668
|
let mountPoint;
|
|
@@ -33725,11 +33681,11 @@ var init_wsl_utils = __esm({
|
|
|
33725
33681
|
return defaultMountPoint;
|
|
33726
33682
|
}
|
|
33727
33683
|
const configContent = await import_promises.default.readFile(configFilePath, { encoding: "utf8" });
|
|
33728
|
-
const
|
|
33729
|
-
if (
|
|
33684
|
+
const parsedMountPoint = parseMountPointFromConfig(configContent);
|
|
33685
|
+
if (parsedMountPoint === void 0) {
|
|
33730
33686
|
return defaultMountPoint;
|
|
33731
33687
|
}
|
|
33732
|
-
mountPoint =
|
|
33688
|
+
mountPoint = parsedMountPoint;
|
|
33733
33689
|
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
|
|
33734
33690
|
return mountPoint;
|
|
33735
33691
|
};
|
|
@@ -33738,11 +33694,43 @@ var init_wsl_utils = __esm({
|
|
|
33738
33694
|
const mountPoint = await wslDrivesMountPoint();
|
|
33739
33695
|
return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
|
|
33740
33696
|
};
|
|
33741
|
-
|
|
33742
|
-
|
|
33743
|
-
|
|
33697
|
+
powerShellPath2 = is_wsl_default ? powerShellPathFromWsl : powerShellPath;
|
|
33698
|
+
canAccessPowerShell = async () => {
|
|
33699
|
+
canAccessPowerShellPromise ??= (async () => {
|
|
33700
|
+
try {
|
|
33701
|
+
const psPath = await powerShellPath2();
|
|
33702
|
+
await import_promises.default.access(psPath, import_promises.constants.X_OK);
|
|
33703
|
+
return true;
|
|
33704
|
+
} catch {
|
|
33705
|
+
return false;
|
|
33706
|
+
}
|
|
33707
|
+
})();
|
|
33708
|
+
return canAccessPowerShellPromise;
|
|
33709
|
+
};
|
|
33710
|
+
wslDefaultBrowser = async () => {
|
|
33711
|
+
const psPath = await powerShellPath2();
|
|
33712
|
+
const command = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
|
|
33713
|
+
const { stdout } = await executePowerShell(command, {
|
|
33714
|
+
powerShellPath: psPath,
|
|
33715
|
+
cwd: import_node_path.default.dirname(psPath)
|
|
33716
|
+
});
|
|
33717
|
+
return stdout.trim();
|
|
33718
|
+
};
|
|
33719
|
+
isUrl = (path3) => /^[a-z]+:\/\//i.test(path3);
|
|
33720
|
+
convertPath = async (flag, path3) => {
|
|
33721
|
+
const wslpathArguments = path3.startsWith("-") ? [flag, "--", path3] : [flag, path3];
|
|
33722
|
+
try {
|
|
33723
|
+
const { stdout } = await execFile3("wslpath", wslpathArguments, { encoding: "utf8" });
|
|
33724
|
+
return stdout.replace(/\r?\n$/, "") || path3;
|
|
33725
|
+
} catch {
|
|
33726
|
+
return path3;
|
|
33744
33727
|
}
|
|
33745
|
-
|
|
33728
|
+
};
|
|
33729
|
+
convertWslPathToWindows = async (paths) => {
|
|
33730
|
+
const isBatch = Array.isArray(paths);
|
|
33731
|
+
const pathArray = isBatch ? paths : [paths];
|
|
33732
|
+
const results = await Promise.all(pathArray.map((path3) => isUrl(path3) ? path3 : convertPath("-aw", path3)));
|
|
33733
|
+
return isBatch ? results : results[0];
|
|
33746
33734
|
};
|
|
33747
33735
|
}
|
|
33748
33736
|
});
|
|
@@ -33782,13 +33770,13 @@ async function defaultBrowserId() {
|
|
|
33782
33770
|
}
|
|
33783
33771
|
return browserId;
|
|
33784
33772
|
}
|
|
33785
|
-
var
|
|
33773
|
+
var import_node_util3, import_node_process3, import_node_child_process3, execFileAsync;
|
|
33786
33774
|
var init_default_browser_id = __esm({
|
|
33787
33775
|
"node_modules/default-browser-id/index.js"() {
|
|
33788
|
-
|
|
33776
|
+
import_node_util3 = require("node:util");
|
|
33789
33777
|
import_node_process3 = __toESM(require("node:process"), 1);
|
|
33790
|
-
|
|
33791
|
-
execFileAsync = (0,
|
|
33778
|
+
import_node_child_process3 = require("node:child_process");
|
|
33779
|
+
execFileAsync = (0, import_node_util3.promisify)(import_node_child_process3.execFile);
|
|
33792
33780
|
}
|
|
33793
33781
|
});
|
|
33794
33782
|
|
|
@@ -33805,13 +33793,13 @@ async function runAppleScript(script, { humanReadableOutput = true, signal } = {
|
|
|
33805
33793
|
const { stdout } = await execFileAsync2("osascript", ["-e", script, outputArguments], execOptions);
|
|
33806
33794
|
return stdout.trim();
|
|
33807
33795
|
}
|
|
33808
|
-
var import_node_process4,
|
|
33796
|
+
var import_node_process4, import_node_util4, import_node_child_process4, execFileAsync2;
|
|
33809
33797
|
var init_run_applescript = __esm({
|
|
33810
33798
|
"node_modules/run-applescript/index.js"() {
|
|
33811
33799
|
import_node_process4 = __toESM(require("node:process"), 1);
|
|
33812
|
-
|
|
33813
|
-
|
|
33814
|
-
execFileAsync2 = (0,
|
|
33800
|
+
import_node_util4 = require("node:util");
|
|
33801
|
+
import_node_child_process4 = require("node:child_process");
|
|
33802
|
+
execFileAsync2 = (0, import_node_util4.promisify)(import_node_child_process4.execFile);
|
|
33815
33803
|
}
|
|
33816
33804
|
});
|
|
33817
33805
|
|
|
@@ -33854,13 +33842,13 @@ async function defaultBrowser(_execFileAsync = execFileAsync3) {
|
|
|
33854
33842
|
const baseIdByHyphen = hyphenIndex === -1 ? void 0 : id.slice(0, hyphenIndex);
|
|
33855
33843
|
return windowsBrowserProgIds[id] ?? windowsBrowserProgIds[baseIdByDot] ?? windowsBrowserProgIds[baseIdByHyphen] ?? { name: id, id };
|
|
33856
33844
|
}
|
|
33857
|
-
var import_node_process5,
|
|
33845
|
+
var import_node_process5, import_node_util5, import_node_child_process5, execFileAsync3, windowsBrowserProgIds, _windowsBrowserProgIdMap, UnknownBrowserError;
|
|
33858
33846
|
var init_windows = __esm({
|
|
33859
33847
|
"node_modules/default-browser/windows.js"() {
|
|
33860
33848
|
import_node_process5 = __toESM(require("node:process"), 1);
|
|
33861
|
-
|
|
33862
|
-
|
|
33863
|
-
execFileAsync3 = (0,
|
|
33849
|
+
import_node_util5 = require("node:util");
|
|
33850
|
+
import_node_child_process5 = require("node:child_process");
|
|
33851
|
+
execFileAsync3 = (0, import_node_util5.promisify)(import_node_child_process5.execFile);
|
|
33864
33852
|
windowsBrowserProgIds = {
|
|
33865
33853
|
MSEdgeHTM: { name: "Edge", id: "com.microsoft.edge" },
|
|
33866
33854
|
// The missing `L` is correct.
|
|
@@ -33904,20 +33892,31 @@ async function defaultBrowser2() {
|
|
|
33904
33892
|
}
|
|
33905
33893
|
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
33906
33894
|
}
|
|
33907
|
-
var
|
|
33895
|
+
var import_node_util6, import_node_process6, import_node_child_process6, execFileAsync4, titleize;
|
|
33908
33896
|
var init_default_browser = __esm({
|
|
33909
33897
|
"node_modules/default-browser/index.js"() {
|
|
33910
|
-
|
|
33898
|
+
import_node_util6 = require("node:util");
|
|
33911
33899
|
import_node_process6 = __toESM(require("node:process"), 1);
|
|
33912
|
-
|
|
33900
|
+
import_node_child_process6 = require("node:child_process");
|
|
33913
33901
|
init_default_browser_id();
|
|
33914
33902
|
init_bundle_name();
|
|
33915
33903
|
init_windows();
|
|
33916
|
-
|
|
33904
|
+
init_windows();
|
|
33905
|
+
execFileAsync4 = (0, import_node_util6.promisify)(import_node_child_process6.execFile);
|
|
33917
33906
|
titleize = (string) => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x) => x.toUpperCase());
|
|
33918
33907
|
}
|
|
33919
33908
|
});
|
|
33920
33909
|
|
|
33910
|
+
// node_modules/is-in-ssh/index.js
|
|
33911
|
+
var import_node_process7, isInSsh, is_in_ssh_default;
|
|
33912
|
+
var init_is_in_ssh = __esm({
|
|
33913
|
+
"node_modules/is-in-ssh/index.js"() {
|
|
33914
|
+
import_node_process7 = __toESM(require("node:process"), 1);
|
|
33915
|
+
isInSsh = Boolean(import_node_process7.default.env.SSH_CONNECTION || import_node_process7.default.env.SSH_CLIENT || import_node_process7.default.env.SSH_TTY);
|
|
33916
|
+
is_in_ssh_default = isInSsh;
|
|
33917
|
+
}
|
|
33918
|
+
});
|
|
33919
|
+
|
|
33921
33920
|
// node_modules/open/index.js
|
|
33922
33921
|
var open_exports = {};
|
|
33923
33922
|
__export(open_exports, {
|
|
@@ -33925,31 +33924,6 @@ __export(open_exports, {
|
|
|
33925
33924
|
default: () => open_default,
|
|
33926
33925
|
openApp: () => openApp
|
|
33927
33926
|
});
|
|
33928
|
-
async function getWindowsDefaultBrowserFromWsl() {
|
|
33929
|
-
const powershellPath = await powerShellPath();
|
|
33930
|
-
const rawCommand = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
|
|
33931
|
-
const encodedCommand = import_node_buffer.Buffer.from(rawCommand, "utf16le").toString("base64");
|
|
33932
|
-
const { stdout } = await execFile6(
|
|
33933
|
-
powershellPath,
|
|
33934
|
-
[
|
|
33935
|
-
"-NoProfile",
|
|
33936
|
-
"-NonInteractive",
|
|
33937
|
-
"-ExecutionPolicy",
|
|
33938
|
-
"Bypass",
|
|
33939
|
-
"-EncodedCommand",
|
|
33940
|
-
encodedCommand
|
|
33941
|
-
],
|
|
33942
|
-
{ encoding: "utf8" }
|
|
33943
|
-
);
|
|
33944
|
-
const progId = stdout.trim();
|
|
33945
|
-
const browserMap = {
|
|
33946
|
-
ChromeHTML: "com.google.chrome",
|
|
33947
|
-
BraveHTML: "com.brave.Browser",
|
|
33948
|
-
MSEdgeHTM: "com.microsoft.edge",
|
|
33949
|
-
FirefoxURL: "org.mozilla.firefox"
|
|
33950
|
-
};
|
|
33951
|
-
return browserMap[progId] ? { id: browserMap[progId] } : {};
|
|
33952
|
-
}
|
|
33953
33927
|
function detectArchBinary(binary) {
|
|
33954
33928
|
if (typeof binary === "string" || Array.isArray(binary)) {
|
|
33955
33929
|
return binary;
|
|
@@ -33960,7 +33934,7 @@ function detectArchBinary(binary) {
|
|
|
33960
33934
|
}
|
|
33961
33935
|
return archBinary;
|
|
33962
33936
|
}
|
|
33963
|
-
function detectPlatformBinary({ [platform]: platformBinary }, { wsl }) {
|
|
33937
|
+
function detectPlatformBinary({ [platform]: platformBinary }, { wsl } = {}) {
|
|
33964
33938
|
if (wsl && is_wsl_default) {
|
|
33965
33939
|
return detectArchBinary(wsl);
|
|
33966
33940
|
}
|
|
@@ -33969,35 +33943,38 @@ function detectPlatformBinary({ [platform]: platformBinary }, { wsl }) {
|
|
|
33969
33943
|
}
|
|
33970
33944
|
return detectArchBinary(platformBinary);
|
|
33971
33945
|
}
|
|
33972
|
-
var
|
|
33946
|
+
var import_node_process8, import_node_path2, import_node_url, import_node_child_process7, import_promises2, import_meta, fallbackAttemptSymbol, __dirname, localXdgOpenPath, platform, arch, tryEachApp, baseOpen, open, openApp, apps, open_default;
|
|
33973
33947
|
var init_open = __esm({
|
|
33974
33948
|
"node_modules/open/index.js"() {
|
|
33975
|
-
|
|
33976
|
-
|
|
33977
|
-
import_node_path = __toESM(require("node:path"), 1);
|
|
33949
|
+
import_node_process8 = __toESM(require("node:process"), 1);
|
|
33950
|
+
import_node_path2 = __toESM(require("node:path"), 1);
|
|
33978
33951
|
import_node_url = require("node:url");
|
|
33979
|
-
|
|
33980
|
-
import_node_child_process5 = __toESM(require("node:child_process"), 1);
|
|
33952
|
+
import_node_child_process7 = __toESM(require("node:child_process"), 1);
|
|
33981
33953
|
import_promises2 = __toESM(require("node:fs/promises"), 1);
|
|
33982
33954
|
init_wsl_utils();
|
|
33955
|
+
init_powershell_utils();
|
|
33983
33956
|
init_define_lazy_prop();
|
|
33984
33957
|
init_default_browser();
|
|
33985
33958
|
init_is_inside_container();
|
|
33959
|
+
init_is_in_ssh();
|
|
33986
33960
|
import_meta = {};
|
|
33987
|
-
|
|
33988
|
-
__dirname =
|
|
33989
|
-
localXdgOpenPath =
|
|
33990
|
-
({ platform, arch } =
|
|
33991
|
-
|
|
33992
|
-
|
|
33993
|
-
|
|
33961
|
+
fallbackAttemptSymbol = /* @__PURE__ */ Symbol("fallbackAttempt");
|
|
33962
|
+
__dirname = import_meta.url ? import_node_path2.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url)) : "";
|
|
33963
|
+
localXdgOpenPath = import_node_path2.default.join(__dirname, "xdg-open");
|
|
33964
|
+
({ platform, arch } = import_node_process8.default);
|
|
33965
|
+
tryEachApp = async (apps2, opener) => {
|
|
33966
|
+
if (apps2.length === 0) {
|
|
33967
|
+
return;
|
|
33968
|
+
}
|
|
33969
|
+
const errors = [];
|
|
33970
|
+
for (const app of apps2) {
|
|
33994
33971
|
try {
|
|
33995
|
-
return await
|
|
33972
|
+
return await opener(app);
|
|
33996
33973
|
} catch (error) {
|
|
33997
|
-
|
|
33974
|
+
errors.push(error);
|
|
33998
33975
|
}
|
|
33999
33976
|
}
|
|
34000
|
-
throw
|
|
33977
|
+
throw new AggregateError(errors, "Failed to open in all supported apps");
|
|
34001
33978
|
};
|
|
34002
33979
|
baseOpen = async (options) => {
|
|
34003
33980
|
options = {
|
|
@@ -34007,45 +33984,62 @@ var init_open = __esm({
|
|
|
34007
33984
|
allowNonzeroExitCode: false,
|
|
34008
33985
|
...options
|
|
34009
33986
|
};
|
|
33987
|
+
const isFallbackAttempt = options[fallbackAttemptSymbol] === true;
|
|
33988
|
+
delete options[fallbackAttemptSymbol];
|
|
34010
33989
|
if (Array.isArray(options.app)) {
|
|
34011
|
-
return
|
|
33990
|
+
return tryEachApp(options.app, (singleApp) => baseOpen({
|
|
34012
33991
|
...options,
|
|
34013
|
-
app: singleApp
|
|
33992
|
+
app: singleApp,
|
|
33993
|
+
[fallbackAttemptSymbol]: true
|
|
34014
33994
|
}));
|
|
34015
33995
|
}
|
|
34016
33996
|
let { name: app, arguments: appArguments = [] } = options.app ?? {};
|
|
34017
33997
|
appArguments = [...appArguments];
|
|
34018
33998
|
if (Array.isArray(app)) {
|
|
34019
|
-
return
|
|
33999
|
+
return tryEachApp(app, (appName) => baseOpen({
|
|
34020
34000
|
...options,
|
|
34021
34001
|
app: {
|
|
34022
34002
|
name: appName,
|
|
34023
34003
|
arguments: appArguments
|
|
34024
|
-
}
|
|
34004
|
+
},
|
|
34005
|
+
[fallbackAttemptSymbol]: true
|
|
34025
34006
|
}));
|
|
34026
34007
|
}
|
|
34027
34008
|
if (app === "browser" || app === "browserPrivate") {
|
|
34028
34009
|
const ids = {
|
|
34029
34010
|
"com.google.chrome": "chrome",
|
|
34030
34011
|
"google-chrome.desktop": "chrome",
|
|
34031
|
-
"com.brave.
|
|
34012
|
+
"com.brave.browser": "brave",
|
|
34032
34013
|
"org.mozilla.firefox": "firefox",
|
|
34033
34014
|
"firefox.desktop": "firefox",
|
|
34034
34015
|
"com.microsoft.msedge": "edge",
|
|
34035
34016
|
"com.microsoft.edge": "edge",
|
|
34036
34017
|
"com.microsoft.edgemac": "edge",
|
|
34037
|
-
"microsoft-edge.desktop": "edge"
|
|
34018
|
+
"microsoft-edge.desktop": "edge",
|
|
34019
|
+
"com.apple.safari": "safari"
|
|
34038
34020
|
};
|
|
34039
34021
|
const flags = {
|
|
34040
34022
|
chrome: "--incognito",
|
|
34041
34023
|
brave: "--incognito",
|
|
34042
34024
|
firefox: "--private-window",
|
|
34043
34025
|
edge: "--inPrivate"
|
|
34026
|
+
// Safari doesn't support private mode via command line
|
|
34044
34027
|
};
|
|
34045
|
-
|
|
34046
|
-
if (
|
|
34047
|
-
const
|
|
34028
|
+
let browser;
|
|
34029
|
+
if (is_wsl_default) {
|
|
34030
|
+
const progId = await wslDefaultBrowser();
|
|
34031
|
+
const browserInfo = _windowsBrowserProgIdMap.get(progId);
|
|
34032
|
+
browser = browserInfo ?? {};
|
|
34033
|
+
} else {
|
|
34034
|
+
browser = await defaultBrowser2();
|
|
34035
|
+
}
|
|
34036
|
+
const browserId = browser.id?.toLowerCase();
|
|
34037
|
+
if (Object.hasOwn(ids, browserId)) {
|
|
34038
|
+
const browserName = ids[browserId];
|
|
34048
34039
|
if (app === "browserPrivate") {
|
|
34040
|
+
if (browserName === "safari") {
|
|
34041
|
+
throw new Error("Safari doesn't support opening in private mode via command line");
|
|
34042
|
+
}
|
|
34049
34043
|
appArguments.push(flags[browserName]);
|
|
34050
34044
|
}
|
|
34051
34045
|
return baseOpen({
|
|
@@ -34061,6 +34055,10 @@ var init_open = __esm({
|
|
|
34061
34055
|
let command;
|
|
34062
34056
|
const cliArguments = [];
|
|
34063
34057
|
const childProcessOptions = {};
|
|
34058
|
+
let shouldUseWindowsInWsl = false;
|
|
34059
|
+
if (is_wsl_default && !isInsideContainer() && !is_in_ssh_default && !app) {
|
|
34060
|
+
shouldUseWindowsInWsl = await canAccessPowerShell();
|
|
34061
|
+
}
|
|
34064
34062
|
if (platform === "darwin") {
|
|
34065
34063
|
command = "open";
|
|
34066
34064
|
if (options.wait) {
|
|
@@ -34075,35 +34073,38 @@ var init_open = __esm({
|
|
|
34075
34073
|
if (app) {
|
|
34076
34074
|
cliArguments.push("-a", app);
|
|
34077
34075
|
}
|
|
34078
|
-
} else if (platform === "win32" ||
|
|
34079
|
-
command = await
|
|
34080
|
-
cliArguments.push(
|
|
34081
|
-
"-NoProfile",
|
|
34082
|
-
"-NonInteractive",
|
|
34083
|
-
"-ExecutionPolicy",
|
|
34084
|
-
"Bypass",
|
|
34085
|
-
"-EncodedCommand"
|
|
34086
|
-
);
|
|
34076
|
+
} else if (platform === "win32" || shouldUseWindowsInWsl) {
|
|
34077
|
+
command = await powerShellPath2();
|
|
34078
|
+
cliArguments.push(...executePowerShell.argumentsPrefix);
|
|
34087
34079
|
if (!is_wsl_default) {
|
|
34088
34080
|
childProcessOptions.windowsVerbatimArguments = true;
|
|
34089
34081
|
}
|
|
34090
|
-
|
|
34082
|
+
if (is_wsl_default && options.target) {
|
|
34083
|
+
options.target = await convertWslPathToWindows(options.target);
|
|
34084
|
+
}
|
|
34085
|
+
const encodedArguments = ["$ProgressPreference = 'SilentlyContinue';", "Start"];
|
|
34091
34086
|
if (options.wait) {
|
|
34092
34087
|
encodedArguments.push("-Wait");
|
|
34093
34088
|
}
|
|
34094
34089
|
if (app) {
|
|
34095
|
-
encodedArguments.push(
|
|
34090
|
+
encodedArguments.push(executePowerShell.escapeArgument(app));
|
|
34096
34091
|
if (options.target) {
|
|
34097
34092
|
appArguments.push(options.target);
|
|
34098
34093
|
}
|
|
34099
34094
|
} else if (options.target) {
|
|
34100
|
-
encodedArguments.push(
|
|
34095
|
+
encodedArguments.push(executePowerShell.escapeArgument(options.target));
|
|
34101
34096
|
}
|
|
34102
34097
|
if (appArguments.length > 0) {
|
|
34103
|
-
appArguments = appArguments.map((argument) =>
|
|
34098
|
+
appArguments = appArguments.map((argument) => executePowerShell.escapeArgument(argument));
|
|
34104
34099
|
encodedArguments.push("-ArgumentList", appArguments.join(","));
|
|
34105
34100
|
}
|
|
34106
|
-
options.target =
|
|
34101
|
+
options.target = executePowerShell.encodeCommand(encodedArguments.join(" "));
|
|
34102
|
+
if (!options.wait) {
|
|
34103
|
+
childProcessOptions.stdio = "ignore";
|
|
34104
|
+
}
|
|
34105
|
+
if (is_wsl_default) {
|
|
34106
|
+
childProcessOptions.cwd = import_node_path2.default.dirname(command);
|
|
34107
|
+
}
|
|
34107
34108
|
} else {
|
|
34108
34109
|
if (app) {
|
|
34109
34110
|
command = app;
|
|
@@ -34115,7 +34116,7 @@ var init_open = __esm({
|
|
|
34115
34116
|
exeLocalXdgOpen = true;
|
|
34116
34117
|
} catch {
|
|
34117
34118
|
}
|
|
34118
|
-
const useSystemXdgOpen =
|
|
34119
|
+
const useSystemXdgOpen = import_node_process8.default.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen);
|
|
34119
34120
|
command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
34120
34121
|
}
|
|
34121
34122
|
if (appArguments.length > 0) {
|
|
@@ -34132,12 +34133,12 @@ var init_open = __esm({
|
|
|
34132
34133
|
if (options.target) {
|
|
34133
34134
|
cliArguments.push(options.target);
|
|
34134
34135
|
}
|
|
34135
|
-
const subprocess =
|
|
34136
|
+
const subprocess = import_node_child_process7.default.spawn(command, cliArguments, childProcessOptions);
|
|
34136
34137
|
if (options.wait) {
|
|
34137
34138
|
return new Promise((resolve, reject) => {
|
|
34138
34139
|
subprocess.once("error", reject);
|
|
34139
34140
|
subprocess.once("close", (exitCode) => {
|
|
34140
|
-
if (!options.allowNonzeroExitCode && exitCode
|
|
34141
|
+
if (!options.allowNonzeroExitCode && exitCode !== 0) {
|
|
34141
34142
|
reject(new Error(`Exited with code ${exitCode}`));
|
|
34142
34143
|
return;
|
|
34143
34144
|
}
|
|
@@ -34145,8 +34146,30 @@ var init_open = __esm({
|
|
|
34145
34146
|
});
|
|
34146
34147
|
});
|
|
34147
34148
|
}
|
|
34149
|
+
if (isFallbackAttempt || platform === "win32" || shouldUseWindowsInWsl) {
|
|
34150
|
+
return new Promise((resolve, reject) => {
|
|
34151
|
+
subprocess.once("error", reject);
|
|
34152
|
+
subprocess.once("spawn", () => {
|
|
34153
|
+
subprocess.once("close", (exitCode) => {
|
|
34154
|
+
subprocess.off("error", reject);
|
|
34155
|
+
if (isFallbackAttempt && exitCode !== 0) {
|
|
34156
|
+
reject(new Error(`Exited with code ${exitCode}`));
|
|
34157
|
+
return;
|
|
34158
|
+
}
|
|
34159
|
+
subprocess.unref();
|
|
34160
|
+
resolve(subprocess);
|
|
34161
|
+
});
|
|
34162
|
+
});
|
|
34163
|
+
});
|
|
34164
|
+
}
|
|
34148
34165
|
subprocess.unref();
|
|
34149
|
-
return
|
|
34166
|
+
return new Promise((resolve, reject) => {
|
|
34167
|
+
subprocess.once("error", reject);
|
|
34168
|
+
subprocess.once("spawn", () => {
|
|
34169
|
+
subprocess.off("error", reject);
|
|
34170
|
+
resolve(subprocess);
|
|
34171
|
+
});
|
|
34172
|
+
});
|
|
34150
34173
|
};
|
|
34151
34174
|
open = (target, options) => {
|
|
34152
34175
|
if (typeof target !== "string") {
|
|
@@ -34173,11 +34196,15 @@ var init_open = __esm({
|
|
|
34173
34196
|
}
|
|
34174
34197
|
});
|
|
34175
34198
|
};
|
|
34176
|
-
apps = {
|
|
34199
|
+
apps = {
|
|
34200
|
+
browser: "browser",
|
|
34201
|
+
browserPrivate: "browserPrivate"
|
|
34202
|
+
};
|
|
34177
34203
|
defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
|
|
34178
34204
|
darwin: "google chrome",
|
|
34179
34205
|
win32: "chrome",
|
|
34180
|
-
|
|
34206
|
+
// `chromium-browser` is the older deb package name used by Ubuntu/Debian before snap.
|
|
34207
|
+
linux: ["google-chrome", "google-chrome-stable", "chromium", "chromium-browser"]
|
|
34181
34208
|
}, {
|
|
34182
34209
|
wsl: {
|
|
34183
34210
|
ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
|
|
@@ -34208,8 +34235,9 @@ var init_open = __esm({
|
|
|
34208
34235
|
}, {
|
|
34209
34236
|
wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
|
|
34210
34237
|
}));
|
|
34211
|
-
defineLazyProperty(apps, "
|
|
34212
|
-
|
|
34238
|
+
defineLazyProperty(apps, "safari", () => detectPlatformBinary({
|
|
34239
|
+
darwin: "Safari"
|
|
34240
|
+
}));
|
|
34213
34241
|
open_default = open;
|
|
34214
34242
|
}
|
|
34215
34243
|
});
|
|
@@ -34259,6 +34287,7 @@ var require_msalClient = __commonJS({
|
|
|
34259
34287
|
var import_regionalAuthority = require_regionalAuthority();
|
|
34260
34288
|
var import_logger = require_commonjs();
|
|
34261
34289
|
var import_tenantIdUtils = require_tenantIdUtils();
|
|
34290
|
+
var import_authorityHost = require_authorityHost();
|
|
34262
34291
|
var msalLogger = (0, import_logging.credentialLogger)("MsalClient");
|
|
34263
34292
|
function generateMsalConfiguration(clientId, tenantId, msalClientOptions = {}) {
|
|
34264
34293
|
const resolvedTenant = (0, import_tenantIdUtils.resolveTenantId)(
|
|
@@ -34266,9 +34295,9 @@ var require_msalClient = __commonJS({
|
|
|
34266
34295
|
tenantId,
|
|
34267
34296
|
clientId
|
|
34268
34297
|
);
|
|
34269
|
-
const authority = (0, import_utils.getAuthority)(resolvedTenant, (0,
|
|
34298
|
+
const authority = (0, import_utils.getAuthority)(resolvedTenant, (0, import_authorityHost.getAuthorityHost)(msalClientOptions));
|
|
34270
34299
|
const httpClient = new import_identityClient.IdentityClient({
|
|
34271
|
-
...msalClientOptions
|
|
34300
|
+
...msalClientOptions,
|
|
34272
34301
|
authorityHost: authority,
|
|
34273
34302
|
loggingOptions: msalClientOptions.loggingOptions
|
|
34274
34303
|
});
|
|
@@ -34378,7 +34407,7 @@ var require_msalClient = __commonJS({
|
|
|
34378
34407
|
}
|
|
34379
34408
|
function calculateRequestAuthority(options) {
|
|
34380
34409
|
if (options?.tenantId) {
|
|
34381
|
-
return (0, import_utils.getAuthority)(options.tenantId, (0,
|
|
34410
|
+
return (0, import_utils.getAuthority)(options.tenantId, (0, import_authorityHost.getAuthorityHost)(createMsalClientOptions));
|
|
34382
34411
|
}
|
|
34383
34412
|
return state.msalConfig.auth.authority;
|
|
34384
34413
|
}
|
|
@@ -34689,6 +34718,66 @@ var require_msalClient = __commonJS({
|
|
|
34689
34718
|
}
|
|
34690
34719
|
});
|
|
34691
34720
|
|
|
34721
|
+
// node_modules/@azure/identity/dist/commonjs/util/certificatesUtils.js
|
|
34722
|
+
var require_certificatesUtils = __commonJS({
|
|
34723
|
+
"node_modules/@azure/identity/dist/commonjs/util/certificatesUtils.js"(exports2, module2) {
|
|
34724
|
+
var __defProp2 = Object.defineProperty;
|
|
34725
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
34726
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
34727
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
34728
|
+
var __export2 = (target, all) => {
|
|
34729
|
+
for (var name in all)
|
|
34730
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
34731
|
+
};
|
|
34732
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
34733
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
34734
|
+
for (let key of __getOwnPropNames2(from))
|
|
34735
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
34736
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
34737
|
+
}
|
|
34738
|
+
return to;
|
|
34739
|
+
};
|
|
34740
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
34741
|
+
var certificatesUtils_exports = {};
|
|
34742
|
+
__export2(certificatesUtils_exports, {
|
|
34743
|
+
canParseAsX509Certificate: () => canParseAsX509Certificate,
|
|
34744
|
+
extractPemCertificateKeys: () => extractPemCertificateKeys
|
|
34745
|
+
});
|
|
34746
|
+
module2.exports = __toCommonJS2(certificatesUtils_exports);
|
|
34747
|
+
var import_crypto = require("crypto");
|
|
34748
|
+
function extractPemCertificateKeys(pemContent) {
|
|
34749
|
+
const certificatePattern = /(-+BEGIN CERTIFICATE-+)(\n\r?|\r\n?)([A-Za-z0-9+/\n\r]+=*)(\n\r?|\r\n?)(-+END CERTIFICATE-+)/g;
|
|
34750
|
+
const publicKeys = [];
|
|
34751
|
+
let match;
|
|
34752
|
+
do {
|
|
34753
|
+
match = certificatePattern.exec(pemContent);
|
|
34754
|
+
if (match) {
|
|
34755
|
+
publicKeys.push(match[3]);
|
|
34756
|
+
}
|
|
34757
|
+
} while (match);
|
|
34758
|
+
if (publicKeys.length === 0) {
|
|
34759
|
+
throw new Error("The file at the specified path does not contain a PEM-encoded certificate.");
|
|
34760
|
+
}
|
|
34761
|
+
return publicKeys;
|
|
34762
|
+
}
|
|
34763
|
+
function canParseAsX509Certificate(pemCert) {
|
|
34764
|
+
try {
|
|
34765
|
+
const pemContents = extractPemCertificateKeys(pemCert);
|
|
34766
|
+
for (let i = 0; i < pemContents.length; i++) {
|
|
34767
|
+
const pemContent = pemContents[i];
|
|
34768
|
+
const fullPemCertificate = `-----BEGIN CERTIFICATE-----
|
|
34769
|
+
${pemContent}
|
|
34770
|
+
-----END CERTIFICATE-----`;
|
|
34771
|
+
new import_crypto.X509Certificate(fullPemCertificate);
|
|
34772
|
+
}
|
|
34773
|
+
return true;
|
|
34774
|
+
} catch (extractError) {
|
|
34775
|
+
return false;
|
|
34776
|
+
}
|
|
34777
|
+
}
|
|
34778
|
+
}
|
|
34779
|
+
});
|
|
34780
|
+
|
|
34692
34781
|
// node_modules/@azure/identity/dist/commonjs/credentials/clientCertificateCredential.js
|
|
34693
34782
|
var require_clientCertificateCredential = __commonJS({
|
|
34694
34783
|
"node_modules/@azure/identity/dist/commonjs/credentials/clientCertificateCredential.js"(exports2, module2) {
|
|
@@ -34721,6 +34810,7 @@ var require_clientCertificateCredential = __commonJS({
|
|
|
34721
34810
|
var import_logging = require_logging();
|
|
34722
34811
|
var import_promises3 = require("node:fs/promises");
|
|
34723
34812
|
var import_tracing = require_tracing();
|
|
34813
|
+
var import_certificatesUtils = require_certificatesUtils();
|
|
34724
34814
|
var credentialName = "ClientCertificateCredential";
|
|
34725
34815
|
var logger2 = (0, import_logging.credentialLogger)(credentialName);
|
|
34726
34816
|
var ClientCertificateCredential2 = class {
|
|
@@ -34757,8 +34847,7 @@ var require_clientCertificateCredential = __commonJS({
|
|
|
34757
34847
|
}
|
|
34758
34848
|
this.msalClient = (0, import_msalClient.createMsalClient)(clientId, tenantId, {
|
|
34759
34849
|
...options,
|
|
34760
|
-
logger: logger2
|
|
34761
|
-
tokenCredentialOptions: options
|
|
34850
|
+
logger: logger2
|
|
34762
34851
|
});
|
|
34763
34852
|
}
|
|
34764
34853
|
/**
|
|
@@ -34813,18 +34902,7 @@ var require_clientCertificateCredential = __commonJS({
|
|
|
34813
34902
|
const certificatePath = certificateConfiguration.certificatePath;
|
|
34814
34903
|
const certificateContents = certificate || await (0, import_promises3.readFile)(certificatePath, "utf8");
|
|
34815
34904
|
const x5c = sendCertificateChain ? certificateContents : void 0;
|
|
34816
|
-
const
|
|
34817
|
-
const publicKeys = [];
|
|
34818
|
-
let match;
|
|
34819
|
-
do {
|
|
34820
|
-
match = certificatePattern.exec(certificateContents);
|
|
34821
|
-
if (match) {
|
|
34822
|
-
publicKeys.push(match[3]);
|
|
34823
|
-
}
|
|
34824
|
-
} while (match);
|
|
34825
|
-
if (publicKeys.length === 0) {
|
|
34826
|
-
throw new Error("The file at the specified path does not contain a PEM-encoded certificate.");
|
|
34827
|
-
}
|
|
34905
|
+
const publicKeys = (0, import_certificatesUtils.extractPemCertificateKeys)(certificateContents);
|
|
34828
34906
|
const thumbprint = (0, import_node_crypto.createHash)("sha1").update(Buffer.from(publicKeys[0], "base64")).digest("hex").toUpperCase();
|
|
34829
34907
|
const thumbprintSha256 = (0, import_node_crypto.createHash)("sha256").update(Buffer.from(publicKeys[0], "base64")).digest("hex").toUpperCase();
|
|
34830
34908
|
return {
|
|
@@ -34951,8 +35029,7 @@ var require_clientSecretCredential = __commonJS({
|
|
|
34951
35029
|
);
|
|
34952
35030
|
this.msalClient = (0, import_msalClient.createMsalClient)(clientId, tenantId, {
|
|
34953
35031
|
...options,
|
|
34954
|
-
logger: logger2
|
|
34955
|
-
tokenCredentialOptions: options
|
|
35032
|
+
logger: logger2
|
|
34956
35033
|
});
|
|
34957
35034
|
}
|
|
34958
35035
|
/**
|
|
@@ -35060,8 +35137,7 @@ var require_usernamePasswordCredential = __commonJS({
|
|
|
35060
35137
|
this.username = username;
|
|
35061
35138
|
this.password = password;
|
|
35062
35139
|
this.msalClient = (0, import_msalClient.createMsalClient)(clientId, this.tenantId, {
|
|
35063
|
-
...options
|
|
35064
|
-
tokenCredentialOptions: options ?? {}
|
|
35140
|
+
...options
|
|
35065
35141
|
});
|
|
35066
35142
|
}
|
|
35067
35143
|
/**
|
|
@@ -35147,8 +35223,8 @@ var require_environmentCredential = __commonJS({
|
|
|
35147
35223
|
"AZURE_CLIENT_SEND_CERTIFICATE_CHAIN"
|
|
35148
35224
|
];
|
|
35149
35225
|
function getAdditionallyAllowedTenants() {
|
|
35150
|
-
const additionallyAllowedValues = process.env.AZURE_ADDITIONALLY_ALLOWED_TENANTS
|
|
35151
|
-
return additionallyAllowedValues.split(";");
|
|
35226
|
+
const additionallyAllowedValues = process.env.AZURE_ADDITIONALLY_ALLOWED_TENANTS;
|
|
35227
|
+
return additionallyAllowedValues ? additionallyAllowedValues.split(";") : void 0;
|
|
35152
35228
|
}
|
|
35153
35229
|
var credentialName = "EnvironmentCredential";
|
|
35154
35230
|
var logger2 = (0, import_logging.credentialLogger)(credentialName);
|
|
@@ -35191,9 +35267,13 @@ var require_environmentCredential = __commonJS({
|
|
|
35191
35267
|
const assigned = (0, import_logging.processEnvVars)(AllSupportedEnvironmentVariables).assigned.join(", ");
|
|
35192
35268
|
logger2.info(`Found the following environment variables: ${assigned}`);
|
|
35193
35269
|
const tenantId = process.env.AZURE_TENANT_ID, clientId = process.env.AZURE_CLIENT_ID, clientSecret = process.env.AZURE_CLIENT_SECRET;
|
|
35194
|
-
const
|
|
35270
|
+
const additionallyAllowedTenants = options?.additionallyAllowedTenants ?? getAdditionallyAllowedTenants();
|
|
35195
35271
|
const sendCertificateChain = getSendCertificateChain();
|
|
35196
|
-
const newOptions = {
|
|
35272
|
+
const newOptions = {
|
|
35273
|
+
...options,
|
|
35274
|
+
additionallyAllowedTenants,
|
|
35275
|
+
sendCertificateChain
|
|
35276
|
+
};
|
|
35197
35277
|
if (tenantId) {
|
|
35198
35278
|
(0, import_tenantIdUtils.checkTenantId)(logger2, tenantId);
|
|
35199
35279
|
}
|
|
@@ -35493,9 +35573,8 @@ var require_clientAssertionCredential = __commonJS({
|
|
|
35493
35573
|
this.options = options;
|
|
35494
35574
|
this.getAssertion = getAssertion;
|
|
35495
35575
|
this.msalClient = (0, import_msalClient.createMsalClient)(clientId, tenantId, {
|
|
35496
|
-
...options,
|
|
35497
|
-
logger: logger2
|
|
35498
|
-
tokenCredentialOptions: this.options
|
|
35576
|
+
...this.options,
|
|
35577
|
+
logger: logger2
|
|
35499
35578
|
});
|
|
35500
35579
|
}
|
|
35501
35580
|
/**
|
|
@@ -35553,7 +35632,8 @@ var require_workloadIdentityCredential = __commonJS({
|
|
|
35553
35632
|
var workloadIdentityCredential_exports = {};
|
|
35554
35633
|
__export2(workloadIdentityCredential_exports, {
|
|
35555
35634
|
SupportedWorkloadEnvironmentVariables: () => SupportedWorkloadEnvironmentVariables,
|
|
35556
|
-
WorkloadIdentityCredential: () => WorkloadIdentityCredential2
|
|
35635
|
+
WorkloadIdentityCredential: () => WorkloadIdentityCredential2,
|
|
35636
|
+
parseAndValidateCustomTokenProxy: () => parseAndValidateCustomTokenProxy
|
|
35557
35637
|
});
|
|
35558
35638
|
module2.exports = __toCommonJS2(workloadIdentityCredential_exports);
|
|
35559
35639
|
var import_logging = require_logging();
|
|
@@ -35561,6 +35641,9 @@ var require_workloadIdentityCredential = __commonJS({
|
|
|
35561
35641
|
var import_errors = require_errors2();
|
|
35562
35642
|
var import_tenantIdUtils = require_tenantIdUtils();
|
|
35563
35643
|
var import_promises3 = require("node:fs/promises");
|
|
35644
|
+
var import_core_rest_pipeline = require_commonjs6();
|
|
35645
|
+
var import_certificatesUtils = require_certificatesUtils();
|
|
35646
|
+
var import_node_fs4 = require("node:fs");
|
|
35564
35647
|
var credentialName = "WorkloadIdentityCredential";
|
|
35565
35648
|
var SupportedWorkloadEnvironmentVariables = [
|
|
35566
35649
|
"AZURE_TENANT_ID",
|
|
@@ -35568,11 +35651,77 @@ var require_workloadIdentityCredential = __commonJS({
|
|
|
35568
35651
|
"AZURE_FEDERATED_TOKEN_FILE"
|
|
35569
35652
|
];
|
|
35570
35653
|
var logger2 = (0, import_logging.credentialLogger)(credentialName);
|
|
35654
|
+
var ErrorMessages = {
|
|
35655
|
+
FAILED_TO_PARSE_TOKEN_PROXY: (endpoint, error) => `Failed to parse custom token proxy URL "${endpoint}": ${error}`,
|
|
35656
|
+
INVALID_HTTPS_SCHEME: (protocol) => `Custom token endpoint must use https scheme, got "${protocol}"`,
|
|
35657
|
+
TOKEN_ENDPOINT_NO_USER_INFO: (url) => `Custom token endpoint URL "${url}" must not contain user info`,
|
|
35658
|
+
TOKEN_ENDPOINT_NO_QUERY: (url) => `Custom token endpoint URL "${url}" must not contain a query`,
|
|
35659
|
+
TOKEN_ENDPOINT_NO_FRAGMENT: (url) => `Custom token endpoint URL "${url}" must not contain a fragment`,
|
|
35660
|
+
CA_FILE_EMPTY: (file) => `CA certificate file is empty: ${file}`,
|
|
35661
|
+
FAILED_TO_READ_CA_FILE: (file, error) => `Failed to read CA certificate file: ${file}. ${error}`,
|
|
35662
|
+
INVALID_CA_CERTIFICATES: `Invalid CA certificate data: no valid PEM certificates found`,
|
|
35663
|
+
INVALID_FILE_PATH: (path3) => `Invalid file path provided ${path3}.`,
|
|
35664
|
+
NO_FILE_CONTENT: (path3) => `No content on the file ${path3}.`,
|
|
35665
|
+
NO_CA_SOURCE: `No CA certificate source specified.`,
|
|
35666
|
+
CLIENT_ID_REQUIRED: `clientId is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_CLIENT_ID".
|
|
35667
|
+
See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`,
|
|
35668
|
+
TENANT_ID_REQUIRED: `tenantId is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_TENANT_ID".
|
|
35669
|
+
See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`,
|
|
35670
|
+
TOKEN_FILE_PATH_REQUIRED: `federatedTokenFilePath is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_FEDERATED_TOKEN_FILE".
|
|
35671
|
+
See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`,
|
|
35672
|
+
TOKEN_PROXY_NOT_SET: `AZURE_KUBERNETES_TOKEN_PROXY is not set but other custom endpoint-related environment variables are present`,
|
|
35673
|
+
CA_FILE_AND_DATA_EXCLUSIVE: `AZURE_KUBERNETES_CA_FILE and AZURE_KUBERNETES_CA_DATA are mutually exclusive. Specify only one.`,
|
|
35674
|
+
MISSING_ENV_VARS: `tenantId, clientId, and federatedTokenFilePath are required parameters.
|
|
35675
|
+
In DefaultAzureCredential and ManagedIdentityCredential, these can be provided as environment variables -
|
|
35676
|
+
"AZURE_TENANT_ID",
|
|
35677
|
+
"AZURE_CLIENT_ID",
|
|
35678
|
+
"AZURE_FEDERATED_TOKEN_FILE". See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`
|
|
35679
|
+
};
|
|
35680
|
+
function parseAndValidateCustomTokenProxy(endpoint) {
|
|
35681
|
+
let tokenProxy;
|
|
35682
|
+
try {
|
|
35683
|
+
tokenProxy = new URL(endpoint);
|
|
35684
|
+
} catch (error) {
|
|
35685
|
+
throw new import_errors.CredentialUnavailableError(
|
|
35686
|
+
`${credentialName}: is unavailable. ${ErrorMessages.FAILED_TO_PARSE_TOKEN_PROXY(endpoint, error)}`
|
|
35687
|
+
);
|
|
35688
|
+
}
|
|
35689
|
+
if (tokenProxy.protocol !== "https:") {
|
|
35690
|
+
throw new import_errors.CredentialUnavailableError(
|
|
35691
|
+
`${credentialName}: is unavailable. ${ErrorMessages.INVALID_HTTPS_SCHEME(tokenProxy.protocol)}`
|
|
35692
|
+
);
|
|
35693
|
+
}
|
|
35694
|
+
if (tokenProxy.username || tokenProxy.password) {
|
|
35695
|
+
throw new import_errors.CredentialUnavailableError(
|
|
35696
|
+
`${credentialName}: is unavailable. ${ErrorMessages.TOKEN_ENDPOINT_NO_USER_INFO(tokenProxy.toString())}`
|
|
35697
|
+
);
|
|
35698
|
+
}
|
|
35699
|
+
if (tokenProxy.search) {
|
|
35700
|
+
throw new import_errors.CredentialUnavailableError(
|
|
35701
|
+
`${credentialName}: is unavailable. ${ErrorMessages.TOKEN_ENDPOINT_NO_QUERY(tokenProxy.toString())}`
|
|
35702
|
+
);
|
|
35703
|
+
}
|
|
35704
|
+
if (tokenProxy.hash) {
|
|
35705
|
+
throw new import_errors.CredentialUnavailableError(
|
|
35706
|
+
`${credentialName}: is unavailable. ${ErrorMessages.TOKEN_ENDPOINT_NO_FRAGMENT(tokenProxy.toString())}`
|
|
35707
|
+
);
|
|
35708
|
+
}
|
|
35709
|
+
if (!tokenProxy.pathname || tokenProxy.pathname === "") {
|
|
35710
|
+
tokenProxy.pathname = "/";
|
|
35711
|
+
}
|
|
35712
|
+
return tokenProxy.toString();
|
|
35713
|
+
}
|
|
35571
35714
|
var WorkloadIdentityCredential2 = class {
|
|
35572
35715
|
client;
|
|
35573
35716
|
azureFederatedTokenFileContent = void 0;
|
|
35574
35717
|
cacheDate = void 0;
|
|
35575
35718
|
federatedTokenFilePath;
|
|
35719
|
+
// AKS proxy CA caching - persists across token requests
|
|
35720
|
+
cachedTlsSettings;
|
|
35721
|
+
cachedCaData;
|
|
35722
|
+
caData;
|
|
35723
|
+
caFile;
|
|
35724
|
+
sniName;
|
|
35576
35725
|
/**
|
|
35577
35726
|
* WorkloadIdentityCredential supports Microsoft Entra Workload ID on Kubernetes.
|
|
35578
35727
|
*
|
|
@@ -35590,22 +35739,48 @@ var require_workloadIdentityCredential = __commonJS({
|
|
|
35590
35739
|
}
|
|
35591
35740
|
if (!clientId) {
|
|
35592
35741
|
throw new import_errors.CredentialUnavailableError(
|
|
35593
|
-
`${credentialName}: is unavailable.
|
|
35594
|
-
See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`
|
|
35742
|
+
`${credentialName}: is unavailable. ${ErrorMessages.CLIENT_ID_REQUIRED}`
|
|
35595
35743
|
);
|
|
35596
35744
|
}
|
|
35597
35745
|
if (!tenantId) {
|
|
35598
35746
|
throw new import_errors.CredentialUnavailableError(
|
|
35599
|
-
`${credentialName}: is unavailable.
|
|
35600
|
-
See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`
|
|
35747
|
+
`${credentialName}: is unavailable. ${ErrorMessages.TENANT_ID_REQUIRED}`
|
|
35601
35748
|
);
|
|
35602
35749
|
}
|
|
35603
35750
|
if (!this.federatedTokenFilePath) {
|
|
35604
35751
|
throw new import_errors.CredentialUnavailableError(
|
|
35605
|
-
`${credentialName}: is unavailable.
|
|
35606
|
-
See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`
|
|
35752
|
+
`${credentialName}: is unavailable. ${ErrorMessages.TOKEN_FILE_PATH_REQUIRED}`
|
|
35607
35753
|
);
|
|
35608
35754
|
}
|
|
35755
|
+
if (workloadIdentityCredentialOptions.enableAzureProxy) {
|
|
35756
|
+
const kubernetesTokenProxy = process.env.AZURE_KUBERNETES_TOKEN_PROXY;
|
|
35757
|
+
const kubernetesSNIName = process.env.AZURE_KUBERNETES_SNI_NAME;
|
|
35758
|
+
const kubernetesCAFile = process.env.AZURE_KUBERNETES_CA_FILE;
|
|
35759
|
+
const kubernetesCAData = process.env.AZURE_KUBERNETES_CA_DATA;
|
|
35760
|
+
if (!kubernetesTokenProxy) {
|
|
35761
|
+
if (kubernetesSNIName || kubernetesCAFile || kubernetesCAData) {
|
|
35762
|
+
throw new import_errors.CredentialUnavailableError(
|
|
35763
|
+
`${credentialName}: is unavailable. ${ErrorMessages.TOKEN_PROXY_NOT_SET}`
|
|
35764
|
+
);
|
|
35765
|
+
}
|
|
35766
|
+
logger2.info(
|
|
35767
|
+
`enableAzureProxy is true but AZURE_KUBERNETES_TOKEN_PROXY is not set, using normal authentication flow`
|
|
35768
|
+
);
|
|
35769
|
+
} else {
|
|
35770
|
+
const tokenProxy = parseAndValidateCustomTokenProxy(kubernetesTokenProxy);
|
|
35771
|
+
if (kubernetesCAFile && kubernetesCAData) {
|
|
35772
|
+
throw new import_errors.CredentialUnavailableError(
|
|
35773
|
+
`${credentialName}: is unavailable. ${ErrorMessages.CA_FILE_AND_DATA_EXCLUSIVE}`
|
|
35774
|
+
);
|
|
35775
|
+
}
|
|
35776
|
+
this.caData = kubernetesCAData;
|
|
35777
|
+
this.caFile = kubernetesCAFile;
|
|
35778
|
+
this.sniName = kubernetesSNIName;
|
|
35779
|
+
const proxyClient = this.createAksProxyClient(tokenProxy);
|
|
35780
|
+
workloadIdentityCredentialOptions.httpClient = proxyClient;
|
|
35781
|
+
logger2.info(`${credentialName}: Using proxy client for token requests`);
|
|
35782
|
+
}
|
|
35783
|
+
}
|
|
35609
35784
|
logger2.info(
|
|
35610
35785
|
`Invoking ClientAssertionCredential with tenant ID: ${tenantId}, clientId: ${workloadIdentityCredentialOptions.clientId} and federated token path: [REDACTED]`
|
|
35611
35786
|
);
|
|
@@ -35613,9 +35788,90 @@ var require_workloadIdentityCredential = __commonJS({
|
|
|
35613
35788
|
tenantId,
|
|
35614
35789
|
clientId,
|
|
35615
35790
|
this.readFileContents.bind(this),
|
|
35616
|
-
|
|
35791
|
+
workloadIdentityCredentialOptions
|
|
35617
35792
|
);
|
|
35618
35793
|
}
|
|
35794
|
+
/**
|
|
35795
|
+
* Creates a proxy HttpClient that intercepts token requests and redirects them to the Kubernetes endpoint
|
|
35796
|
+
* Caching is handled at the credential level to persist across token requests
|
|
35797
|
+
*/
|
|
35798
|
+
createAksProxyClient(tokenEndpoint) {
|
|
35799
|
+
const defaultClient = (0, import_core_rest_pipeline.createDefaultHttpClient)();
|
|
35800
|
+
this.cachedTlsSettings = this.getTlsSettings();
|
|
35801
|
+
return {
|
|
35802
|
+
sendRequest: async (request) => {
|
|
35803
|
+
const requestUrl = new URL(request.url);
|
|
35804
|
+
logger2.info(
|
|
35805
|
+
`${credentialName}: Redirecting request to Kubernetes endpoint: ${tokenEndpoint}`
|
|
35806
|
+
);
|
|
35807
|
+
const proxyUrl = new URL(tokenEndpoint);
|
|
35808
|
+
const requestPath = requestUrl.pathname.replace(/^\//, "");
|
|
35809
|
+
const combinedPath = proxyUrl.pathname.endsWith("/") ? proxyUrl.pathname + requestPath : proxyUrl.pathname + "/" + requestPath;
|
|
35810
|
+
const newUrl = new URL(proxyUrl.origin);
|
|
35811
|
+
newUrl.pathname = combinedPath;
|
|
35812
|
+
newUrl.search = requestUrl.search;
|
|
35813
|
+
newUrl.hash = requestUrl.hash;
|
|
35814
|
+
request.url = newUrl.toString();
|
|
35815
|
+
request.tlsSettings = this.getTlsSettings();
|
|
35816
|
+
logger2.info(`${credentialName}: Sending request to ${request.url}`);
|
|
35817
|
+
return defaultClient.sendRequest(request);
|
|
35818
|
+
}
|
|
35819
|
+
};
|
|
35820
|
+
}
|
|
35821
|
+
/**
|
|
35822
|
+
* Gets TLS settings for the request.
|
|
35823
|
+
* Handles a few scenarios with CA data or CA file provided.
|
|
35824
|
+
*/
|
|
35825
|
+
getTlsSettings() {
|
|
35826
|
+
if (!this.caData && !this.caFile) {
|
|
35827
|
+
if (!this.cachedTlsSettings) {
|
|
35828
|
+
this.cachedTlsSettings = this.sniName ? { servername: this.sniName } : {};
|
|
35829
|
+
}
|
|
35830
|
+
return this.cachedTlsSettings;
|
|
35831
|
+
}
|
|
35832
|
+
if (!this.caFile) {
|
|
35833
|
+
if (!this.cachedTlsSettings) {
|
|
35834
|
+
if (!(0, import_certificatesUtils.canParseAsX509Certificate)(this.caData)) {
|
|
35835
|
+
throw new import_errors.CredentialUnavailableError(
|
|
35836
|
+
`${credentialName}: is unavailable. ${ErrorMessages.INVALID_CA_CERTIFICATES}`
|
|
35837
|
+
);
|
|
35838
|
+
}
|
|
35839
|
+
this.cachedTlsSettings = this.sniName ? { servername: this.sniName } : {};
|
|
35840
|
+
this.cachedTlsSettings.ca = this.caData;
|
|
35841
|
+
}
|
|
35842
|
+
return this.cachedTlsSettings;
|
|
35843
|
+
}
|
|
35844
|
+
let fileContent;
|
|
35845
|
+
try {
|
|
35846
|
+
fileContent = (0, import_node_fs4.readFileSync)(this.caFile);
|
|
35847
|
+
} catch (error) {
|
|
35848
|
+
throw new import_errors.CredentialUnavailableError(
|
|
35849
|
+
`${credentialName}: is unavailable. ${ErrorMessages.FAILED_TO_READ_CA_FILE(this.caFile, error)}`
|
|
35850
|
+
);
|
|
35851
|
+
}
|
|
35852
|
+
if (fileContent.length === 0) {
|
|
35853
|
+
if (!this.cachedTlsSettings) {
|
|
35854
|
+
throw new import_errors.CredentialUnavailableError(
|
|
35855
|
+
`${credentialName}: is unavailable. ${ErrorMessages.CA_FILE_EMPTY(this.caFile)}`
|
|
35856
|
+
);
|
|
35857
|
+
}
|
|
35858
|
+
return this.cachedTlsSettings;
|
|
35859
|
+
}
|
|
35860
|
+
if (!this.cachedCaData || !fileContent.equals(this.cachedCaData)) {
|
|
35861
|
+
const caDataString = fileContent.toString("utf8");
|
|
35862
|
+
if (!(0, import_certificatesUtils.canParseAsX509Certificate)(caDataString)) {
|
|
35863
|
+
throw new import_errors.CredentialUnavailableError(
|
|
35864
|
+
`${credentialName}: is unavailable. ${ErrorMessages.INVALID_CA_CERTIFICATES}`
|
|
35865
|
+
);
|
|
35866
|
+
}
|
|
35867
|
+
this.cachedTlsSettings = {
|
|
35868
|
+
ca: caDataString,
|
|
35869
|
+
...this.sniName && { servername: this.sniName }
|
|
35870
|
+
};
|
|
35871
|
+
this.cachedCaData = fileContent;
|
|
35872
|
+
}
|
|
35873
|
+
return this.cachedTlsSettings;
|
|
35874
|
+
}
|
|
35619
35875
|
/**
|
|
35620
35876
|
* Authenticates with Microsoft Entra ID and returns an access token if successful.
|
|
35621
35877
|
* If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
|
|
@@ -35626,11 +35882,7 @@ var require_workloadIdentityCredential = __commonJS({
|
|
|
35626
35882
|
*/
|
|
35627
35883
|
async getToken(scopes, options) {
|
|
35628
35884
|
if (!this.client) {
|
|
35629
|
-
const errorMessage = `${credentialName}: is unavailable.
|
|
35630
|
-
In DefaultAzureCredential and ManagedIdentityCredential, these can be provided as environment variables -
|
|
35631
|
-
"AZURE_TENANT_ID",
|
|
35632
|
-
"AZURE_CLIENT_ID",
|
|
35633
|
-
"AZURE_FEDERATED_TOKEN_FILE". See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`;
|
|
35885
|
+
const errorMessage = `${credentialName}: is unavailable. ${ErrorMessages.MISSING_ENV_VARS}`;
|
|
35634
35886
|
logger2.info(errorMessage);
|
|
35635
35887
|
throw new import_errors.CredentialUnavailableError(errorMessage);
|
|
35636
35888
|
}
|
|
@@ -35643,7 +35895,7 @@ var require_workloadIdentityCredential = __commonJS({
|
|
|
35643
35895
|
}
|
|
35644
35896
|
if (!this.federatedTokenFilePath) {
|
|
35645
35897
|
throw new import_errors.CredentialUnavailableError(
|
|
35646
|
-
`${credentialName}: is unavailable.
|
|
35898
|
+
`${credentialName}: is unavailable. ${ErrorMessages.INVALID_FILE_PATH(this.federatedTokenFilePath)}`
|
|
35647
35899
|
);
|
|
35648
35900
|
}
|
|
35649
35901
|
if (!this.azureFederatedTokenFileContent) {
|
|
@@ -35651,7 +35903,7 @@ var require_workloadIdentityCredential = __commonJS({
|
|
|
35651
35903
|
const value = file.trim();
|
|
35652
35904
|
if (!value) {
|
|
35653
35905
|
throw new import_errors.CredentialUnavailableError(
|
|
35654
|
-
`${credentialName}: is unavailable.
|
|
35906
|
+
`${credentialName}: is unavailable. ${ErrorMessages.NO_FILE_CONTENT(this.federatedTokenFilePath)}`
|
|
35655
35907
|
);
|
|
35656
35908
|
} else {
|
|
35657
35909
|
this.azureFederatedTokenFileContent = value;
|
|
@@ -36141,7 +36393,7 @@ var require_resolveExecutable = __commonJS({
|
|
|
36141
36393
|
});
|
|
36142
36394
|
module2.exports = __toCommonJS2(resolveExecutable_exports);
|
|
36143
36395
|
var import_node_fs4 = require("node:fs");
|
|
36144
|
-
var
|
|
36396
|
+
var import_node_path3 = __toESM2(require("node:path"));
|
|
36145
36397
|
var import_node_url2 = require("node:url");
|
|
36146
36398
|
var import_errors = require_errors3();
|
|
36147
36399
|
var WINDOWS_NATIVE_EXTENSIONS = [".exe", ".com"];
|
|
@@ -36189,7 +36441,7 @@ var require_resolveExecutable = __commonJS({
|
|
|
36189
36441
|
}
|
|
36190
36442
|
function normalizeCwd(cwd) {
|
|
36191
36443
|
const cwdPath = cwd instanceof URL ? (0, import_node_url2.fileURLToPath)(cwd) : cwd;
|
|
36192
|
-
return
|
|
36444
|
+
return import_node_path3.default.resolve(cwdPath ?? process.cwd());
|
|
36193
36445
|
}
|
|
36194
36446
|
function createProcessContext(options = {}) {
|
|
36195
36447
|
if (options.allowWindowsBatchFiles !== void 0 && typeof options.allowWindowsBatchFiles !== "boolean") {
|
|
@@ -36223,7 +36475,7 @@ var require_resolveExecutable = __commonJS({
|
|
|
36223
36475
|
return WINDOWS_BATCH_EXTENSIONS.some((candidate) => candidate === extension);
|
|
36224
36476
|
}
|
|
36225
36477
|
function resolveWindowsCandidate(candidate, allowWindowsBatchFiles) {
|
|
36226
|
-
const extension =
|
|
36478
|
+
const extension = import_node_path3.default.extname(candidate).toLowerCase();
|
|
36227
36479
|
if (extension) {
|
|
36228
36480
|
if (!isNativeExtension(extension) && !(allowWindowsBatchFiles && isBatchExtension(extension))) {
|
|
36229
36481
|
return void 0;
|
|
@@ -36250,7 +36502,7 @@ var require_resolveExecutable = __commonJS({
|
|
|
36250
36502
|
const pathValue = getEnvironmentValue(context.env, "PATH") ?? "";
|
|
36251
36503
|
const paths = [];
|
|
36252
36504
|
const seen = /* @__PURE__ */ new Set();
|
|
36253
|
-
for (const entry of pathValue.split(
|
|
36505
|
+
for (const entry of pathValue.split(import_node_path3.default.delimiter)) {
|
|
36254
36506
|
let candidate = entry;
|
|
36255
36507
|
if (process.platform === "win32") {
|
|
36256
36508
|
candidate = candidate.trim();
|
|
@@ -36258,10 +36510,10 @@ var require_resolveExecutable = __commonJS({
|
|
|
36258
36510
|
candidate = candidate.slice(1, -1);
|
|
36259
36511
|
}
|
|
36260
36512
|
}
|
|
36261
|
-
if (!candidate || !
|
|
36513
|
+
if (!candidate || !import_node_path3.default.isAbsolute(candidate)) {
|
|
36262
36514
|
continue;
|
|
36263
36515
|
}
|
|
36264
|
-
const normalized =
|
|
36516
|
+
const normalized = import_node_path3.default.resolve(candidate);
|
|
36265
36517
|
const key = process.platform === "win32" ? normalized.toLowerCase() : normalized;
|
|
36266
36518
|
if (!seen.has(key)) {
|
|
36267
36519
|
seen.add(key);
|
|
@@ -36287,8 +36539,8 @@ var require_resolveExecutable = __commonJS({
|
|
|
36287
36539
|
}
|
|
36288
36540
|
function resolveExecutableWithContext(command, context) {
|
|
36289
36541
|
validateCommand(command);
|
|
36290
|
-
if (hasPathSeparator(command) ||
|
|
36291
|
-
const candidate =
|
|
36542
|
+
if (hasPathSeparator(command) || import_node_path3.default.isAbsolute(command)) {
|
|
36543
|
+
const candidate = import_node_path3.default.resolve(context.cwd, command);
|
|
36292
36544
|
if (process.platform === "win32") {
|
|
36293
36545
|
return resolveWindowsCandidate(candidate, context.allowWindowsBatchFiles);
|
|
36294
36546
|
}
|
|
@@ -36297,20 +36549,20 @@ var require_resolveExecutable = __commonJS({
|
|
|
36297
36549
|
const searchPaths = getSearchPaths(context);
|
|
36298
36550
|
if (process.platform !== "win32") {
|
|
36299
36551
|
for (const searchPath of searchPaths) {
|
|
36300
|
-
const candidate =
|
|
36552
|
+
const candidate = import_node_path3.default.join(searchPath, command);
|
|
36301
36553
|
if (isExecutableFile(candidate)) {
|
|
36302
36554
|
return candidate;
|
|
36303
36555
|
}
|
|
36304
36556
|
}
|
|
36305
36557
|
return void 0;
|
|
36306
36558
|
}
|
|
36307
|
-
const extension =
|
|
36559
|
+
const extension = import_node_path3.default.extname(command).toLowerCase();
|
|
36308
36560
|
if (extension) {
|
|
36309
36561
|
if (!isNativeExtension(extension) && !(context.allowWindowsBatchFiles && isBatchExtension(extension))) {
|
|
36310
36562
|
return void 0;
|
|
36311
36563
|
}
|
|
36312
36564
|
for (const searchPath of searchPaths) {
|
|
36313
|
-
const candidate =
|
|
36565
|
+
const candidate = import_node_path3.default.join(searchPath, command);
|
|
36314
36566
|
if (isExecutableFile(candidate)) {
|
|
36315
36567
|
return candidate;
|
|
36316
36568
|
}
|
|
@@ -36319,7 +36571,7 @@ var require_resolveExecutable = __commonJS({
|
|
|
36319
36571
|
}
|
|
36320
36572
|
for (const searchPath of searchPaths) {
|
|
36321
36573
|
for (const nativeExtension of WINDOWS_NATIVE_EXTENSIONS) {
|
|
36322
|
-
const candidate =
|
|
36574
|
+
const candidate = import_node_path3.default.join(searchPath, command + nativeExtension);
|
|
36323
36575
|
if (isExecutableFile(candidate)) {
|
|
36324
36576
|
return candidate;
|
|
36325
36577
|
}
|
|
@@ -36328,7 +36580,7 @@ var require_resolveExecutable = __commonJS({
|
|
|
36328
36580
|
if (context.allowWindowsBatchFiles) {
|
|
36329
36581
|
for (const searchPath of searchPaths) {
|
|
36330
36582
|
for (const batchExtension of WINDOWS_BATCH_EXTENSIONS) {
|
|
36331
|
-
const candidate =
|
|
36583
|
+
const candidate = import_node_path3.default.join(searchPath, command + batchExtension);
|
|
36332
36584
|
if (isExecutableFile(candidate)) {
|
|
36333
36585
|
return candidate;
|
|
36334
36586
|
}
|
|
@@ -36344,7 +36596,7 @@ var require_resolveExecutable = __commonJS({
|
|
|
36344
36596
|
try {
|
|
36345
36597
|
return import_node_fs4.realpathSync.native(filePath).toLowerCase();
|
|
36346
36598
|
} catch {
|
|
36347
|
-
return
|
|
36599
|
+
return import_node_path3.default.resolve(filePath).toLowerCase();
|
|
36348
36600
|
}
|
|
36349
36601
|
}
|
|
36350
36602
|
function isWindowsDriveAbsolutePath(filePath) {
|
|
@@ -36358,7 +36610,7 @@ var require_resolveExecutable = __commonJS({
|
|
|
36358
36610
|
code: "ERR_UNTRUSTED_COMMAND_INTERPRETER"
|
|
36359
36611
|
});
|
|
36360
36612
|
}
|
|
36361
|
-
const executablePath =
|
|
36613
|
+
const executablePath = import_node_path3.default.join(systemRoot, "System32", "cmd.exe");
|
|
36362
36614
|
if (!isExecutableFile(executablePath)) {
|
|
36363
36615
|
throw new import_errors.ProcessError("The Windows command interpreter could not be found.", {
|
|
36364
36616
|
code: "ERR_UNTRUSTED_COMMAND_INTERPRETER"
|
|
@@ -36424,7 +36676,7 @@ var require_normalizeCommand = __commonJS({
|
|
|
36424
36676
|
normalizeCommand: () => normalizeCommand
|
|
36425
36677
|
});
|
|
36426
36678
|
module2.exports = __toCommonJS2(normalizeCommand_exports);
|
|
36427
|
-
var
|
|
36679
|
+
var import_node_path3 = __toESM2(require("node:path"));
|
|
36428
36680
|
var import_errors = require_errors3();
|
|
36429
36681
|
var import_resolveExecutable = require_resolveExecutable();
|
|
36430
36682
|
var UNSAFE_BATCH_ARGUMENT = /[%!^&|<>()]/;
|
|
@@ -36488,7 +36740,7 @@ var require_normalizeCommand = __commonJS({
|
|
|
36488
36740
|
windowsVerbatimArguments: false
|
|
36489
36741
|
};
|
|
36490
36742
|
}
|
|
36491
|
-
const extension =
|
|
36743
|
+
const extension = import_node_path3.default.extname(resolvedPath).toLowerCase();
|
|
36492
36744
|
if (extension === ".exe" || extension === ".com") {
|
|
36493
36745
|
return {
|
|
36494
36746
|
executable: resolvedPath,
|
|
@@ -36562,12 +36814,12 @@ var require_process = __commonJS({
|
|
|
36562
36814
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
36563
36815
|
var process_exports = {};
|
|
36564
36816
|
__export2(process_exports, {
|
|
36565
|
-
execFile: () =>
|
|
36817
|
+
execFile: () => execFile8,
|
|
36566
36818
|
spawn: () => spawn2,
|
|
36567
36819
|
spawnSync: () => spawnSync2
|
|
36568
36820
|
});
|
|
36569
36821
|
module2.exports = __toCommonJS2(process_exports);
|
|
36570
|
-
var
|
|
36822
|
+
var childProcess4 = __toESM2(require("node:child_process"));
|
|
36571
36823
|
var import_errors = require_errors3();
|
|
36572
36824
|
var import_normalizeCommand = require_normalizeCommand();
|
|
36573
36825
|
var import_resolveExecutable = require_resolveExecutable();
|
|
@@ -36650,7 +36902,7 @@ var require_process = __commonJS({
|
|
|
36650
36902
|
function spawn2(command, args = [], options = {}) {
|
|
36651
36903
|
const prepared = prepareProcess(command, args, options, spawnOptionNames);
|
|
36652
36904
|
const child = callWithSanitizedChildProcessErrors(
|
|
36653
|
-
() =>
|
|
36905
|
+
() => childProcess4.spawn(prepared.command.executable, prepared.command.args, {
|
|
36654
36906
|
...prepared.nodeOptions,
|
|
36655
36907
|
cwd: prepared.command.cwd,
|
|
36656
36908
|
env: prepared.command.env,
|
|
@@ -36663,7 +36915,7 @@ var require_process = __commonJS({
|
|
|
36663
36915
|
function spawnSync2(command, args = [], options = {}) {
|
|
36664
36916
|
const prepared = prepareProcess(command, args, options, spawnSyncOptionNames);
|
|
36665
36917
|
const result = callWithSanitizedChildProcessErrors(
|
|
36666
|
-
() =>
|
|
36918
|
+
() => childProcess4.spawnSync(prepared.command.executable, prepared.command.args, {
|
|
36667
36919
|
...prepared.nodeOptions,
|
|
36668
36920
|
cwd: prepared.command.cwd,
|
|
36669
36921
|
env: prepared.command.env,
|
|
@@ -36679,11 +36931,11 @@ var require_process = __commonJS({
|
|
|
36679
36931
|
}
|
|
36680
36932
|
return result;
|
|
36681
36933
|
}
|
|
36682
|
-
async function
|
|
36934
|
+
async function execFile8(command, args = [], options = {}) {
|
|
36683
36935
|
const prepared = prepareProcess(command, args, options, execFileOptionNames);
|
|
36684
36936
|
return new Promise((resolve, reject) => {
|
|
36685
36937
|
callWithSanitizedChildProcessErrors(
|
|
36686
|
-
() =>
|
|
36938
|
+
() => childProcess4.execFile(
|
|
36687
36939
|
prepared.command.executable,
|
|
36688
36940
|
prepared.command.args,
|
|
36689
36941
|
{
|
|
@@ -36845,6 +37097,7 @@ var require_azureDeveloperCliCredential = __commonJS({
|
|
|
36845
37097
|
var import_tenantIdUtils = require_tenantIdUtils();
|
|
36846
37098
|
var import_tracing = require_tracing();
|
|
36847
37099
|
var import_scopeUtils = require_scopeUtils();
|
|
37100
|
+
var import_core_util = require_commonjs4();
|
|
36848
37101
|
var import_processUtils = require_processUtils();
|
|
36849
37102
|
var logger2 = (0, import_logging.credentialLogger)("AzureDeveloperCliCredential");
|
|
36850
37103
|
var azureDeveloperCliPublicErrorMessages = {
|
|
@@ -36854,6 +37107,51 @@ var require_azureDeveloperCliCredential = __commonJS({
|
|
|
36854
37107
|
claim: "This credential doesn't support claims challenges. To authenticate with the required claims, please run the following command:"
|
|
36855
37108
|
};
|
|
36856
37109
|
var developerCliCredentialInternals = {
|
|
37110
|
+
/**
|
|
37111
|
+
* Parses azd stderr JSON output to extract a human-readable error message.
|
|
37112
|
+
*
|
|
37113
|
+
* Three formats are supported across azd versions:
|
|
37114
|
+
* - pre-v1.23.7: `{"type":"consoleMessage","data":{"message":"..."}}`
|
|
37115
|
+
* - v1.23.7 - v1.23.15: an empty `consoleMessage` line followed by `{"error":"...","message":"...","suggestion":"..."}`
|
|
37116
|
+
* - v1.24.0+: `{"error":"...","message":"...","suggestion":"..."}`
|
|
37117
|
+
*
|
|
37118
|
+
* The structured `error` field is preferred. If absent, falls back to the
|
|
37119
|
+
* first non-empty `data.message` from a legacy `consoleMessage` line. If
|
|
37120
|
+
* neither is found, the raw stderr is returned unchanged so plain-text and
|
|
37121
|
+
* malformed output continue to surface to callers.
|
|
37122
|
+
*
|
|
37123
|
+
* @param stderr - The stderr output from azd command
|
|
37124
|
+
* @returns The parsed error message or raw stderr
|
|
37125
|
+
* @internal
|
|
37126
|
+
*/
|
|
37127
|
+
parseAzdStderr(stderr) {
|
|
37128
|
+
if (!stderr?.trim()) {
|
|
37129
|
+
return stderr;
|
|
37130
|
+
}
|
|
37131
|
+
let fallback;
|
|
37132
|
+
for (const rawLine of stderr.split("\n")) {
|
|
37133
|
+
const line = rawLine.trim();
|
|
37134
|
+
if (!line.startsWith("{")) {
|
|
37135
|
+
continue;
|
|
37136
|
+
}
|
|
37137
|
+
let parsed;
|
|
37138
|
+
try {
|
|
37139
|
+
parsed = JSON.parse(line);
|
|
37140
|
+
} catch {
|
|
37141
|
+
continue;
|
|
37142
|
+
}
|
|
37143
|
+
if (typeof parsed?.error === "string" && parsed.error.trim()) {
|
|
37144
|
+
return parsed.error.trim();
|
|
37145
|
+
}
|
|
37146
|
+
if (fallback === void 0) {
|
|
37147
|
+
const message = parsed?.data?.message;
|
|
37148
|
+
if (typeof message === "string" && message.trim()) {
|
|
37149
|
+
fallback = message.trim();
|
|
37150
|
+
}
|
|
37151
|
+
}
|
|
37152
|
+
}
|
|
37153
|
+
return fallback ?? stderr;
|
|
37154
|
+
},
|
|
36857
37155
|
/**
|
|
36858
37156
|
* @internal
|
|
36859
37157
|
*/
|
|
@@ -36883,7 +37181,7 @@ var require_azureDeveloperCliCredential = __commonJS({
|
|
|
36883
37181
|
}
|
|
36884
37182
|
let claimsSections = [];
|
|
36885
37183
|
if (claims) {
|
|
36886
|
-
const encodedClaims =
|
|
37184
|
+
const encodedClaims = (0, import_core_util.uint8ArrayToString)((0, import_core_util.stringToUint8Array)(claims, "utf-8"), "base64");
|
|
36887
37185
|
claimsSections = ["--claims", encodedClaims];
|
|
36888
37186
|
}
|
|
36889
37187
|
const args = [
|
|
@@ -36995,7 +37293,8 @@ var require_azureDeveloperCliCredential = __commonJS({
|
|
|
36995
37293
|
};
|
|
36996
37294
|
} catch (e) {
|
|
36997
37295
|
if (obj.stderr) {
|
|
36998
|
-
|
|
37296
|
+
const errorMessage = developerCliCredentialInternals.parseAzdStderr(obj.stderr);
|
|
37297
|
+
throw new import_errors.CredentialUnavailableError(errorMessage);
|
|
36999
37298
|
}
|
|
37000
37299
|
throw e;
|
|
37001
37300
|
}
|
|
@@ -37081,6 +37380,7 @@ var require_azureCliCredential = __commonJS({
|
|
|
37081
37380
|
var import_logging = require_logging();
|
|
37082
37381
|
var import_scopeUtils = require_scopeUtils();
|
|
37083
37382
|
var import_errors = require_errors2();
|
|
37383
|
+
var import_core_util = require_commonjs4();
|
|
37084
37384
|
var import_tracing = require_tracing();
|
|
37085
37385
|
var import_subscriptionUtils = require_subscriptionUtils();
|
|
37086
37386
|
var import_processUtils = require_processUtils();
|
|
@@ -37182,7 +37482,7 @@ var require_azureCliCredential = __commonJS({
|
|
|
37182
37482
|
const scope = typeof scopes === "string" ? scopes : scopes[0];
|
|
37183
37483
|
const claimsValue = options.claims;
|
|
37184
37484
|
if (claimsValue && claimsValue.trim()) {
|
|
37185
|
-
const encodedClaims =
|
|
37485
|
+
const encodedClaims = (0, import_core_util.uint8ArrayToString)((0, import_core_util.stringToUint8Array)(claimsValue, "utf-8"), "base64");
|
|
37186
37486
|
let loginCmd = `az login --claims-challenge ${encodedClaims} --scope ${scope}`;
|
|
37187
37487
|
const tenantIdFromOptions = options.tenantId;
|
|
37188
37488
|
if (tenantIdFromOptions) {
|
|
@@ -37324,6 +37624,7 @@ var require_azurePowerShellCredential = __commonJS({
|
|
|
37324
37624
|
var import_errors = require_errors2();
|
|
37325
37625
|
var import_processUtils = require_processUtils();
|
|
37326
37626
|
var import_tracing = require_tracing();
|
|
37627
|
+
var import_core_util = require_commonjs4();
|
|
37327
37628
|
var logger2 = (0, import_logging.credentialLogger)("AzurePowerShellCredential");
|
|
37328
37629
|
var isWindows = process.platform === "win32";
|
|
37329
37630
|
var powerShellResourceEnvironmentVariable = "AZURE_IDENTITY_POWERSHELL_RESOURCE";
|
|
@@ -37488,7 +37789,10 @@ var require_azurePowerShellCredential = __commonJS({
|
|
|
37488
37789
|
const scope = typeof scopes === "string" ? scopes : scopes[0];
|
|
37489
37790
|
const claimsValue = options.claims;
|
|
37490
37791
|
if (claimsValue && claimsValue.trim()) {
|
|
37491
|
-
const encodedClaims =
|
|
37792
|
+
const encodedClaims = (0, import_core_util.uint8ArrayToString)(
|
|
37793
|
+
(0, import_core_util.stringToUint8Array)(claimsValue, "utf-8"),
|
|
37794
|
+
"base64"
|
|
37795
|
+
);
|
|
37492
37796
|
let loginCmd = `Connect-AzAccount -ClaimsChallenge ${encodedClaims}`;
|
|
37493
37797
|
const tenantIdFromOptions = options.tenantId;
|
|
37494
37798
|
if (tenantIdFromOptions) {
|
|
@@ -37779,7 +38083,6 @@ var require_brokerCredential = __commonJS({
|
|
|
37779
38083
|
);
|
|
37780
38084
|
const msalClientOptions = {
|
|
37781
38085
|
...options,
|
|
37782
|
-
tokenCredentialOptions: options,
|
|
37783
38086
|
logger: logger2,
|
|
37784
38087
|
brokerOptions: {
|
|
37785
38088
|
enabled: true,
|
|
@@ -38145,7 +38448,6 @@ var require_interactiveBrowserCredential = __commonJS({
|
|
|
38145
38448
|
);
|
|
38146
38449
|
const msalClientOptions = {
|
|
38147
38450
|
...options,
|
|
38148
|
-
tokenCredentialOptions: options,
|
|
38149
38451
|
logger: logger2
|
|
38150
38452
|
};
|
|
38151
38453
|
const ibcNodeOptions = options;
|
|
@@ -38313,8 +38615,7 @@ var require_deviceCodeCredential = __commonJS({
|
|
|
38313
38615
|
this.userPromptCallback = options?.userPromptCallback ?? defaultDeviceCodePromptCallback;
|
|
38314
38616
|
this.msalClient = (0, import_msalClient.createMsalClient)(clientId, tenantId, {
|
|
38315
38617
|
...options,
|
|
38316
|
-
logger: logger2
|
|
38317
|
-
tokenCredentialOptions: options || {}
|
|
38618
|
+
logger: logger2
|
|
38318
38619
|
});
|
|
38319
38620
|
this.disableAutomaticAuthentication = options?.disableAutomaticAuthentication;
|
|
38320
38621
|
}
|
|
@@ -38634,8 +38935,7 @@ var require_authorizationCodeCredential = __commonJS({
|
|
|
38634
38935
|
);
|
|
38635
38936
|
this.msalClient = (0, import_msalClient.createMsalClient)(clientId, tenantId, {
|
|
38636
38937
|
...options,
|
|
38637
|
-
logger: logger2
|
|
38638
|
-
tokenCredentialOptions: options ?? {}
|
|
38938
|
+
logger: logger2
|
|
38639
38939
|
});
|
|
38640
38940
|
}
|
|
38641
38941
|
/**
|
|
@@ -38760,8 +39060,7 @@ var require_onBehalfOfCredential = __commonJS({
|
|
|
38760
39060
|
);
|
|
38761
39061
|
this.msalClient = (0, import_msalClient.createMsalClient)(clientId, this.tenantId, {
|
|
38762
39062
|
...options,
|
|
38763
|
-
logger: logger2
|
|
38764
|
-
tokenCredentialOptions: options
|
|
39063
|
+
logger: logger2
|
|
38765
39064
|
});
|
|
38766
39065
|
}
|
|
38767
39066
|
/**
|
|
@@ -60289,7 +60588,7 @@ var require_process2 = __commonJS({
|
|
|
60289
60588
|
var require_process3 = __commonJS({
|
|
60290
60589
|
"node_modules/readable-stream/lib/internal/shims/process.js"(exports2, module2) {
|
|
60291
60590
|
"use strict";
|
|
60292
|
-
var
|
|
60591
|
+
var process10 = ((base, esmKey, keys, isValid) => {
|
|
60293
60592
|
if (esmKey in base && base[esmKey] === true) {
|
|
60294
60593
|
let candidate;
|
|
60295
60594
|
for (const key of keys) {
|
|
@@ -60304,7 +60603,7 @@ var require_process3 = __commonJS({
|
|
|
60304
60603
|
}
|
|
60305
60604
|
return base;
|
|
60306
60605
|
})(require_process2(), "__esModule", ["default", "process"], (candidate) => "nextTick" in candidate);
|
|
60307
|
-
module2.exports =
|
|
60606
|
+
module2.exports = process10;
|
|
60308
60607
|
}
|
|
60309
60608
|
});
|
|
60310
60609
|
|
|
@@ -60521,7 +60820,7 @@ var require_utils6 = __commonJS({
|
|
|
60521
60820
|
var require_end_of_stream = __commonJS({
|
|
60522
60821
|
"node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(exports2, module2) {
|
|
60523
60822
|
"use strict";
|
|
60524
|
-
var
|
|
60823
|
+
var process10 = require_process3();
|
|
60525
60824
|
var { AbortError: AbortError2, codes } = require_errors4();
|
|
60526
60825
|
var { ERR_INVALID_ARG_TYPE, ERR_STREAM_PREMATURE_CLOSE } = codes;
|
|
60527
60826
|
var { kEmptyObject, once } = require_util();
|
|
@@ -60657,17 +60956,17 @@ var require_end_of_stream = __commonJS({
|
|
|
60657
60956
|
}
|
|
60658
60957
|
stream.on("close", onclose);
|
|
60659
60958
|
if (closed) {
|
|
60660
|
-
|
|
60959
|
+
process10.nextTick(onclose);
|
|
60661
60960
|
} else if (wState !== null && wState !== void 0 && wState.errorEmitted || rState !== null && rState !== void 0 && rState.errorEmitted) {
|
|
60662
60961
|
if (!willEmitClose) {
|
|
60663
|
-
|
|
60962
|
+
process10.nextTick(onclosed);
|
|
60664
60963
|
}
|
|
60665
60964
|
} else if (!readable && (!willEmitClose || isReadable(stream)) && (writableFinished || isWritable(stream) === false)) {
|
|
60666
|
-
|
|
60965
|
+
process10.nextTick(onclosed);
|
|
60667
60966
|
} else if (!writable && (!willEmitClose || isWritable(stream)) && (readableFinished || isReadable(stream) === false)) {
|
|
60668
|
-
|
|
60967
|
+
process10.nextTick(onclosed);
|
|
60669
60968
|
} else if (rState && stream.req && stream.aborted) {
|
|
60670
|
-
|
|
60969
|
+
process10.nextTick(onclosed);
|
|
60671
60970
|
}
|
|
60672
60971
|
const cleanup = () => {
|
|
60673
60972
|
callback = nop;
|
|
@@ -60695,7 +60994,7 @@ var require_end_of_stream = __commonJS({
|
|
|
60695
60994
|
);
|
|
60696
60995
|
};
|
|
60697
60996
|
if (options.signal.aborted) {
|
|
60698
|
-
|
|
60997
|
+
process10.nextTick(abort);
|
|
60699
60998
|
} else {
|
|
60700
60999
|
addAbortListener = addAbortListener || require_util().addAbortListener;
|
|
60701
61000
|
const disposable = addAbortListener(options.signal, abort);
|
|
@@ -60722,7 +61021,7 @@ var require_end_of_stream = __commonJS({
|
|
|
60722
61021
|
);
|
|
60723
61022
|
};
|
|
60724
61023
|
if (options.signal.aborted) {
|
|
60725
|
-
|
|
61024
|
+
process10.nextTick(abort);
|
|
60726
61025
|
} else {
|
|
60727
61026
|
addAbortListener = addAbortListener || require_util().addAbortListener;
|
|
60728
61027
|
const disposable = addAbortListener(options.signal, abort);
|
|
@@ -60735,7 +61034,7 @@ var require_end_of_stream = __commonJS({
|
|
|
60735
61034
|
}
|
|
60736
61035
|
const resolverFn = (...args) => {
|
|
60737
61036
|
if (!isAborted) {
|
|
60738
|
-
|
|
61037
|
+
process10.nextTick(() => callback.apply(stream, args));
|
|
60739
61038
|
}
|
|
60740
61039
|
};
|
|
60741
61040
|
PromisePrototypeThen(stream[kIsClosedPromise].promise, resolverFn, resolverFn);
|
|
@@ -60773,7 +61072,7 @@ var require_end_of_stream = __commonJS({
|
|
|
60773
61072
|
var require_destroy = __commonJS({
|
|
60774
61073
|
"node_modules/readable-stream/lib/internal/streams/destroy.js"(exports2, module2) {
|
|
60775
61074
|
"use strict";
|
|
60776
|
-
var
|
|
61075
|
+
var process10 = require_process3();
|
|
60777
61076
|
var {
|
|
60778
61077
|
aggregateTwoErrors,
|
|
60779
61078
|
codes: { ERR_MULTIPLE_CALLBACK },
|
|
@@ -60840,9 +61139,9 @@ var require_destroy = __commonJS({
|
|
|
60840
61139
|
cb(err2);
|
|
60841
61140
|
}
|
|
60842
61141
|
if (err2) {
|
|
60843
|
-
|
|
61142
|
+
process10.nextTick(emitErrorCloseNT, self2, err2);
|
|
60844
61143
|
} else {
|
|
60845
|
-
|
|
61144
|
+
process10.nextTick(emitCloseNT, self2);
|
|
60846
61145
|
}
|
|
60847
61146
|
}
|
|
60848
61147
|
try {
|
|
@@ -60927,7 +61226,7 @@ var require_destroy = __commonJS({
|
|
|
60927
61226
|
r.errored = err;
|
|
60928
61227
|
}
|
|
60929
61228
|
if (sync) {
|
|
60930
|
-
|
|
61229
|
+
process10.nextTick(emitErrorNT, stream, err);
|
|
60931
61230
|
} else {
|
|
60932
61231
|
emitErrorNT(stream, err);
|
|
60933
61232
|
}
|
|
@@ -60949,7 +61248,7 @@ var require_destroy = __commonJS({
|
|
|
60949
61248
|
if (stream.listenerCount(kConstruct) > 1) {
|
|
60950
61249
|
return;
|
|
60951
61250
|
}
|
|
60952
|
-
|
|
61251
|
+
process10.nextTick(constructNT, stream);
|
|
60953
61252
|
}
|
|
60954
61253
|
function constructNT(stream) {
|
|
60955
61254
|
let called = false;
|
|
@@ -60973,15 +61272,15 @@ var require_destroy = __commonJS({
|
|
|
60973
61272
|
} else if (err) {
|
|
60974
61273
|
errorOrDestroy(stream, err, true);
|
|
60975
61274
|
} else {
|
|
60976
|
-
|
|
61275
|
+
process10.nextTick(emitConstructNT, stream);
|
|
60977
61276
|
}
|
|
60978
61277
|
}
|
|
60979
61278
|
try {
|
|
60980
61279
|
stream._construct((err) => {
|
|
60981
|
-
|
|
61280
|
+
process10.nextTick(onConstruct, err);
|
|
60982
61281
|
});
|
|
60983
61282
|
} catch (err) {
|
|
60984
|
-
|
|
61283
|
+
process10.nextTick(onConstruct, err);
|
|
60985
61284
|
}
|
|
60986
61285
|
}
|
|
60987
61286
|
function emitConstructNT(stream) {
|
|
@@ -60995,7 +61294,7 @@ var require_destroy = __commonJS({
|
|
|
60995
61294
|
}
|
|
60996
61295
|
function emitErrorCloseLegacy(stream, err) {
|
|
60997
61296
|
stream.emit("error", err);
|
|
60998
|
-
|
|
61297
|
+
process10.nextTick(emitCloseLegacy, stream);
|
|
60999
61298
|
}
|
|
61000
61299
|
function destroyer(stream, err) {
|
|
61001
61300
|
if (!stream || isDestroyed(stream)) {
|
|
@@ -61016,9 +61315,9 @@ var require_destroy = __commonJS({
|
|
|
61016
61315
|
} else if (typeof stream.close === "function") {
|
|
61017
61316
|
stream.close();
|
|
61018
61317
|
} else if (err) {
|
|
61019
|
-
|
|
61318
|
+
process10.nextTick(emitErrorCloseLegacy, stream, err);
|
|
61020
61319
|
} else {
|
|
61021
|
-
|
|
61320
|
+
process10.nextTick(emitCloseLegacy, stream);
|
|
61022
61321
|
}
|
|
61023
61322
|
if (!stream.destroyed) {
|
|
61024
61323
|
stream[kIsDestroyed] = true;
|
|
@@ -61603,7 +61902,7 @@ var require_string_decoder = __commonJS({
|
|
|
61603
61902
|
var require_from = __commonJS({
|
|
61604
61903
|
"node_modules/readable-stream/lib/internal/streams/from.js"(exports2, module2) {
|
|
61605
61904
|
"use strict";
|
|
61606
|
-
var
|
|
61905
|
+
var process10 = require_process3();
|
|
61607
61906
|
var { PromisePrototypeThen, SymbolAsyncIterator, SymbolIterator } = require_primordials();
|
|
61608
61907
|
var { Buffer: Buffer3 } = require("buffer");
|
|
61609
61908
|
var { ERR_INVALID_ARG_TYPE, ERR_STREAM_NULL_VALUES } = require_errors4().codes;
|
|
@@ -61645,9 +61944,9 @@ var require_from = __commonJS({
|
|
|
61645
61944
|
readable._destroy = function(error, cb) {
|
|
61646
61945
|
PromisePrototypeThen(
|
|
61647
61946
|
close(error),
|
|
61648
|
-
() =>
|
|
61947
|
+
() => process10.nextTick(cb, error),
|
|
61649
61948
|
// nextTick is here in case cb throws
|
|
61650
|
-
(e) =>
|
|
61949
|
+
(e) => process10.nextTick(cb, e || error)
|
|
61651
61950
|
);
|
|
61652
61951
|
};
|
|
61653
61952
|
async function close(error) {
|
|
@@ -61698,7 +61997,7 @@ var require_from = __commonJS({
|
|
|
61698
61997
|
var require_readable = __commonJS({
|
|
61699
61998
|
"node_modules/readable-stream/lib/internal/streams/readable.js"(exports2, module2) {
|
|
61700
61999
|
"use strict";
|
|
61701
|
-
var
|
|
62000
|
+
var process10 = require_process3();
|
|
61702
62001
|
var {
|
|
61703
62002
|
ArrayPrototypeIndexOf,
|
|
61704
62003
|
NumberIsInteger,
|
|
@@ -62083,7 +62382,7 @@ var require_readable = __commonJS({
|
|
|
62083
62382
|
if (!state.emittedReadable) {
|
|
62084
62383
|
debug("emitReadable", state.flowing);
|
|
62085
62384
|
state.emittedReadable = true;
|
|
62086
|
-
|
|
62385
|
+
process10.nextTick(emitReadable_, stream);
|
|
62087
62386
|
}
|
|
62088
62387
|
}
|
|
62089
62388
|
function emitReadable_(stream) {
|
|
@@ -62099,7 +62398,7 @@ var require_readable = __commonJS({
|
|
|
62099
62398
|
function maybeReadMore(stream, state) {
|
|
62100
62399
|
if (!state.readingMore && state.constructed) {
|
|
62101
62400
|
state.readingMore = true;
|
|
62102
|
-
|
|
62401
|
+
process10.nextTick(maybeReadMore_, stream, state);
|
|
62103
62402
|
}
|
|
62104
62403
|
}
|
|
62105
62404
|
function maybeReadMore_(stream, state) {
|
|
@@ -62126,9 +62425,9 @@ var require_readable = __commonJS({
|
|
|
62126
62425
|
}
|
|
62127
62426
|
state.pipes.push(dest);
|
|
62128
62427
|
debug("pipe count=%d opts=%j", state.pipes.length, pipeOpts);
|
|
62129
|
-
const doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !==
|
|
62428
|
+
const doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process10.stdout && dest !== process10.stderr;
|
|
62130
62429
|
const endFn = doEnd ? onend : unpipe;
|
|
62131
|
-
if (state.endEmitted)
|
|
62430
|
+
if (state.endEmitted) process10.nextTick(endFn);
|
|
62132
62431
|
else src.once("end", endFn);
|
|
62133
62432
|
dest.on("unpipe", onunpipe);
|
|
62134
62433
|
function onunpipe(readable, unpipeInfo) {
|
|
@@ -62278,7 +62577,7 @@ var require_readable = __commonJS({
|
|
|
62278
62577
|
if (state.length) {
|
|
62279
62578
|
emitReadable(this);
|
|
62280
62579
|
} else if (!state.reading) {
|
|
62281
|
-
|
|
62580
|
+
process10.nextTick(nReadingNextTick, this);
|
|
62282
62581
|
}
|
|
62283
62582
|
}
|
|
62284
62583
|
}
|
|
@@ -62288,7 +62587,7 @@ var require_readable = __commonJS({
|
|
|
62288
62587
|
Readable.prototype.removeListener = function(ev, fn) {
|
|
62289
62588
|
const res = Stream.prototype.removeListener.call(this, ev, fn);
|
|
62290
62589
|
if (ev === "readable") {
|
|
62291
|
-
|
|
62590
|
+
process10.nextTick(updateReadableListening, this);
|
|
62292
62591
|
}
|
|
62293
62592
|
return res;
|
|
62294
62593
|
};
|
|
@@ -62296,7 +62595,7 @@ var require_readable = __commonJS({
|
|
|
62296
62595
|
Readable.prototype.removeAllListeners = function(ev) {
|
|
62297
62596
|
const res = Stream.prototype.removeAllListeners.apply(this, arguments);
|
|
62298
62597
|
if (ev === "readable" || ev === void 0) {
|
|
62299
|
-
|
|
62598
|
+
process10.nextTick(updateReadableListening, this);
|
|
62300
62599
|
}
|
|
62301
62600
|
return res;
|
|
62302
62601
|
};
|
|
@@ -62328,7 +62627,7 @@ var require_readable = __commonJS({
|
|
|
62328
62627
|
function resume(stream, state) {
|
|
62329
62628
|
if (!state.resumeScheduled) {
|
|
62330
62629
|
state.resumeScheduled = true;
|
|
62331
|
-
|
|
62630
|
+
process10.nextTick(resume_, stream, state);
|
|
62332
62631
|
}
|
|
62333
62632
|
}
|
|
62334
62633
|
function resume_(stream, state) {
|
|
@@ -62605,7 +62904,7 @@ var require_readable = __commonJS({
|
|
|
62605
62904
|
debug("endReadable", state.endEmitted);
|
|
62606
62905
|
if (!state.endEmitted) {
|
|
62607
62906
|
state.ended = true;
|
|
62608
|
-
|
|
62907
|
+
process10.nextTick(endReadableNT, state, stream);
|
|
62609
62908
|
}
|
|
62610
62909
|
}
|
|
62611
62910
|
function endReadableNT(state, stream) {
|
|
@@ -62614,7 +62913,7 @@ var require_readable = __commonJS({
|
|
|
62614
62913
|
state.endEmitted = true;
|
|
62615
62914
|
stream.emit("end");
|
|
62616
62915
|
if (stream.writable && stream.allowHalfOpen === false) {
|
|
62617
|
-
|
|
62916
|
+
process10.nextTick(endWritableNT, stream);
|
|
62618
62917
|
} else if (state.autoDestroy) {
|
|
62619
62918
|
const wState = stream._writableState;
|
|
62620
62919
|
const autoDestroy = !wState || wState.autoDestroy && // We don't expect the writable to ever 'finish'
|
|
@@ -62664,7 +62963,7 @@ var require_readable = __commonJS({
|
|
|
62664
62963
|
var require_writable = __commonJS({
|
|
62665
62964
|
"node_modules/readable-stream/lib/internal/streams/writable.js"(exports2, module2) {
|
|
62666
62965
|
"use strict";
|
|
62667
|
-
var
|
|
62966
|
+
var process10 = require_process3();
|
|
62668
62967
|
var {
|
|
62669
62968
|
ArrayPrototypeSlice,
|
|
62670
62969
|
Error: Error2,
|
|
@@ -62817,7 +63116,7 @@ var require_writable = __commonJS({
|
|
|
62817
63116
|
err = new ERR_STREAM_DESTROYED("write");
|
|
62818
63117
|
}
|
|
62819
63118
|
if (err) {
|
|
62820
|
-
|
|
63119
|
+
process10.nextTick(cb, err);
|
|
62821
63120
|
errorOrDestroy(stream, err, true);
|
|
62822
63121
|
return err;
|
|
62823
63122
|
}
|
|
@@ -62907,7 +63206,7 @@ var require_writable = __commonJS({
|
|
|
62907
63206
|
stream._readableState.errored = er;
|
|
62908
63207
|
}
|
|
62909
63208
|
if (sync) {
|
|
62910
|
-
|
|
63209
|
+
process10.nextTick(onwriteError, stream, state, er, cb);
|
|
62911
63210
|
} else {
|
|
62912
63211
|
onwriteError(stream, state, er, cb);
|
|
62913
63212
|
}
|
|
@@ -62925,7 +63224,7 @@ var require_writable = __commonJS({
|
|
|
62925
63224
|
stream,
|
|
62926
63225
|
state
|
|
62927
63226
|
};
|
|
62928
|
-
|
|
63227
|
+
process10.nextTick(afterWriteTick, state.afterWriteTickInfo);
|
|
62929
63228
|
}
|
|
62930
63229
|
} else {
|
|
62931
63230
|
afterWrite(stream, state, 1, cb);
|
|
@@ -63062,7 +63361,7 @@ var require_writable = __commonJS({
|
|
|
63062
63361
|
}
|
|
63063
63362
|
if (typeof cb === "function") {
|
|
63064
63363
|
if (err || state.finished) {
|
|
63065
|
-
|
|
63364
|
+
process10.nextTick(cb, err);
|
|
63066
63365
|
} else {
|
|
63067
63366
|
state[kOnFinished].push(cb);
|
|
63068
63367
|
}
|
|
@@ -63091,7 +63390,7 @@ var require_writable = __commonJS({
|
|
|
63091
63390
|
state.prefinished = true;
|
|
63092
63391
|
stream.emit("prefinish");
|
|
63093
63392
|
state.pendingcb++;
|
|
63094
|
-
|
|
63393
|
+
process10.nextTick(finish, stream, state);
|
|
63095
63394
|
}
|
|
63096
63395
|
}
|
|
63097
63396
|
state.sync = true;
|
|
@@ -63120,7 +63419,7 @@ var require_writable = __commonJS({
|
|
|
63120
63419
|
if (state.pendingcb === 0) {
|
|
63121
63420
|
if (sync) {
|
|
63122
63421
|
state.pendingcb++;
|
|
63123
|
-
|
|
63422
|
+
process10.nextTick(
|
|
63124
63423
|
(stream2, state2) => {
|
|
63125
63424
|
if (needFinish(state2)) {
|
|
63126
63425
|
finish(stream2, state2);
|
|
@@ -63255,7 +63554,7 @@ var require_writable = __commonJS({
|
|
|
63255
63554
|
Writable.prototype.destroy = function(err, cb) {
|
|
63256
63555
|
const state = this._writableState;
|
|
63257
63556
|
if (!state.destroyed && (state.bufferedIndex < state.buffered.length || state[kOnFinished].length)) {
|
|
63258
|
-
|
|
63557
|
+
process10.nextTick(errorBuffer, state);
|
|
63259
63558
|
}
|
|
63260
63559
|
destroy.call(this, err, cb);
|
|
63261
63560
|
return this;
|
|
@@ -63284,7 +63583,7 @@ var require_writable = __commonJS({
|
|
|
63284
63583
|
// node_modules/readable-stream/lib/internal/streams/duplexify.js
|
|
63285
63584
|
var require_duplexify = __commonJS({
|
|
63286
63585
|
"node_modules/readable-stream/lib/internal/streams/duplexify.js"(exports2, module2) {
|
|
63287
|
-
var
|
|
63586
|
+
var process10 = require_process3();
|
|
63288
63587
|
var bufferModule = require("buffer");
|
|
63289
63588
|
var {
|
|
63290
63589
|
isReadable,
|
|
@@ -63397,9 +63696,9 @@ var require_duplexify = __commonJS({
|
|
|
63397
63696
|
final(async () => {
|
|
63398
63697
|
try {
|
|
63399
63698
|
await promise;
|
|
63400
|
-
|
|
63699
|
+
process10.nextTick(cb, null);
|
|
63401
63700
|
} catch (err) {
|
|
63402
|
-
|
|
63701
|
+
process10.nextTick(cb, err);
|
|
63403
63702
|
}
|
|
63404
63703
|
});
|
|
63405
63704
|
},
|
|
@@ -63478,7 +63777,7 @@ var require_duplexify = __commonJS({
|
|
|
63478
63777
|
const _promise = promise;
|
|
63479
63778
|
promise = null;
|
|
63480
63779
|
const { chunk, done, cb } = await _promise;
|
|
63481
|
-
|
|
63780
|
+
process10.nextTick(cb);
|
|
63482
63781
|
if (done) return;
|
|
63483
63782
|
if (signal.aborted)
|
|
63484
63783
|
throw new AbortError2(void 0, {
|
|
@@ -63869,7 +64168,7 @@ var require_passthrough = __commonJS({
|
|
|
63869
64168
|
// node_modules/readable-stream/lib/internal/streams/pipeline.js
|
|
63870
64169
|
var require_pipeline4 = __commonJS({
|
|
63871
64170
|
"node_modules/readable-stream/lib/internal/streams/pipeline.js"(exports2, module2) {
|
|
63872
|
-
var
|
|
64171
|
+
var process10 = require_process3();
|
|
63873
64172
|
var { ArrayIsArray, Promise: Promise2, SymbolAsyncIterator, SymbolDispose } = require_primordials();
|
|
63874
64173
|
var eos = require_end_of_stream();
|
|
63875
64174
|
var { once } = require_util();
|
|
@@ -64071,7 +64370,7 @@ var require_pipeline4 = __commonJS({
|
|
|
64071
64370
|
if (!error) {
|
|
64072
64371
|
lastStreamCleanup.forEach((fn) => fn());
|
|
64073
64372
|
}
|
|
64074
|
-
|
|
64373
|
+
process10.nextTick(callback, error, value);
|
|
64075
64374
|
}
|
|
64076
64375
|
}
|
|
64077
64376
|
let ret;
|
|
@@ -64150,11 +64449,11 @@ var require_pipeline4 = __commonJS({
|
|
|
64150
64449
|
if (end) {
|
|
64151
64450
|
pt.end();
|
|
64152
64451
|
}
|
|
64153
|
-
|
|
64452
|
+
process10.nextTick(finish);
|
|
64154
64453
|
},
|
|
64155
64454
|
(err) => {
|
|
64156
64455
|
pt.destroy(err);
|
|
64157
|
-
|
|
64456
|
+
process10.nextTick(finish, err);
|
|
64158
64457
|
}
|
|
64159
64458
|
);
|
|
64160
64459
|
} else if (isIterable(ret, true)) {
|
|
@@ -64235,7 +64534,7 @@ var require_pipeline4 = __commonJS({
|
|
|
64235
64534
|
}
|
|
64236
64535
|
}
|
|
64237
64536
|
if (signal !== null && signal !== void 0 && signal.aborted || outerSignal !== null && outerSignal !== void 0 && outerSignal.aborted) {
|
|
64238
|
-
|
|
64537
|
+
process10.nextTick(abort);
|
|
64239
64538
|
}
|
|
64240
64539
|
return ret;
|
|
64241
64540
|
}
|
|
@@ -64256,7 +64555,7 @@ var require_pipeline4 = __commonJS({
|
|
|
64256
64555
|
};
|
|
64257
64556
|
var endFn = endFn2;
|
|
64258
64557
|
if (isReadableFinished(src)) {
|
|
64259
|
-
|
|
64558
|
+
process10.nextTick(endFn2);
|
|
64260
64559
|
} else {
|
|
64261
64560
|
src.once("end", endFn2);
|
|
64262
64561
|
}
|