@@ -9034,8 +9034,8 @@ var uuid = __nccwpck_require__(2033);
9034
9034
var util = __nccwpck_require__(3837);
9035
9035
var tslib = __nccwpck_require__(2821);
9036
9036
var xml2js = __nccwpck_require__(3184);
9037
- var coreUtil = __nccwpck_require__(9350 );
9038
- var logger$1 = __nccwpck_require__(9423 );
9037
+ var coreUtil = __nccwpck_require__(4225 );
9038
+ var logger$1 = __nccwpck_require__(5269 );
9039
9039
var coreAuth = __nccwpck_require__(3947);
9040
9040
var os = __nccwpck_require__(2037);
9041
9041
var http = __nccwpck_require__(3685);
@@ -14509,7 +14509,7 @@ exports.userAgentPolicy = userAgentPolicy;
14509
14509
14510
14510
Object.defineProperty(exports, "__esModule", ({ value: true }));
14511
14511
14512
- var logger$1 = __nccwpck_require__(9423 );
14512
+ var logger$1 = __nccwpck_require__(5269 );
14513
14513
var abortController = __nccwpck_require__(4992);
14514
14514
14515
14515
// Copyright (c) Microsoft Corporation.
@@ -16017,7 +16017,7 @@ exports.setSpanContext = setSpanContext;
16017
16017
16018
16018
/***/ }),
16019
16019
16020
- /***/ 9350 :
16020
+ /***/ 4225 :
16021
16021
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
16022
16022
16023
16023
@@ -16036,77 +16036,62 @@ var _a;
16036
16036
const isNode = typeof process !== "undefined" && Boolean(process.version) && Boolean((_a = process.versions) === null || _a === void 0 ? void 0 : _a.node);
16037
16037
16038
16038
// Copyright (c) Microsoft Corporation.
16039
- // Licensed under the MIT license.
16040
16039
/**
16041
- * Helper TypeGuard that checks if something is defined or not.
16042
- * @param thing - Anything
16040
+ * Creates an abortable promise.
16041
+ * @param buildPromise - A function that takes the resolve and reject functions as parameters.
16042
+ * @param options - The options for the abortable promise.
16043
+ * @returns A promise that can be aborted.
16043
16044
*/
16044
- function isDefined(thing) {
16045
- return typeof thing !== "undefined" && thing !== null;
16046
- }
16047
- /**
16048
- * Helper TypeGuard that checks if the input is an object with the specified properties.
16049
- * @param thing - Anything.
16050
- * @param properties - The name of the properties that should appear in the object.
16051
- */
16052
- function isObjectWithProperties(thing, properties) {
16053
- if (!isDefined(thing) || typeof thing !== "object") {
16054
- return false;
16055
- }
16056
- for (const property of properties) {
16057
- if (!objectHasProperty(thing, property)) {
16058
- return false;
16045
+ function createAbortablePromise(buildPromise, options) {
16046
+ const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {};
16047
+ return new Promise((resolve, reject) => {
16048
+ function rejectOnAbort() {
16049
+ reject(new abortController.AbortError(abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : "The operation was aborted."));
16059
16050
}
16060
- }
16061
- return true;
16062
- }
16063
- /**
16064
- * Helper TypeGuard that checks if the input is an object with the specified property.
16065
- * @param thing - Any object.
16066
- * @param property - The name of the property that should appear in the object.
16067
- */
16068
- function objectHasProperty(thing, property) {
16069
- return (isDefined(thing) && typeof thing === "object" && property in thing);
16051
+ function removeListeners() {
16052
+ abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener("abort", onAbort);
16053
+ }
16054
+ function onAbort() {
16055
+ cleanupBeforeAbort === null || cleanupBeforeAbort === void 0 ? void 0 : cleanupBeforeAbort();
16056
+ removeListeners();
16057
+ rejectOnAbort();
16058
+ }
16059
+ if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) {
16060
+ return rejectOnAbort();
16061
+ }
16062
+ try {
16063
+ buildPromise((x) => {
16064
+ removeListeners();
16065
+ resolve(x);
16066
+ }, (x) => {
16067
+ removeListeners();
16068
+ reject(x);
16069
+ });
16070
+ }
16071
+ catch (err) {
16072
+ reject(err);
16073
+ }
16074
+ abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener("abort", onAbort);
16075
+ });
16070
16076
}
16071
16077
16072
16078
// Copyright (c) Microsoft Corporation.
16073
- const StandardAbortMessage = "The operation was aborted.";
16079
+ const StandardAbortMessage = "The delay was aborted.";
16074
16080
/**
16075
16081
* A wrapper for setTimeout that resolves a promise after timeInMs milliseconds.
16076
16082
* @param timeInMs - The number of milliseconds to be delayed.
16077
16083
* @param options - The options for delay - currently abort options
16078
16084
* @returns Promise that is resolved after timeInMs
16079
16085
*/
16080
16086
function delay(timeInMs, options) {
16081
- return new Promise((resolve, reject) => {
16082
- let timer = undefined;
16083
- let onAborted = undefined;
16084
- const rejectOnAbort = () => {
16085
- var _a;
16086
- return reject(new abortController.AbortError((_a = options === null || options === void 0 ? void 0 : options.abortErrorMsg) !== null && _a !== void 0 ? _a : StandardAbortMessage));
16087
- };
16088
- const removeListeners = () => {
16089
- if ((options === null || options === void 0 ? void 0 : options.abortSignal) && onAborted) {
16090
- options.abortSignal.removeEventListener("abort", onAborted);
16091
- }
16092
- };
16093
- onAborted = () => {
16094
- if (isDefined(timer)) {
16095
- clearTimeout(timer);
16096
- }
16097
- removeListeners();
16098
- return rejectOnAbort();
16099
- };
16100
- if ((options === null || options === void 0 ? void 0 : options.abortSignal) && options.abortSignal.aborted) {
16101
- return rejectOnAbort();
16102
- }
16103
- timer = setTimeout(() => {
16104
- removeListeners();
16105
- resolve();
16106
- }, timeInMs);
16107
- if (options === null || options === void 0 ? void 0 : options.abortSignal) {
16108
- options.abortSignal.addEventListener("abort", onAborted);
16109
- }
16087
+ let token;
16088
+ const { abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {};
16089
+ return createAbortablePromise((resolve) => {
16090
+ token = setTimeout(resolve, timeInMs);
16091
+ }, {
16092
+ cleanupBeforeAbort: () => clearTimeout(token),
16093
+ abortSignal,
16094
+ abortErrorMsg: abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : StandardAbortMessage,
16110
16095
});
16111
16096
}
16112
16097
@@ -16205,8 +16190,43 @@ async function computeSha256Hash(content, encoding) {
16205
16190
return crypto.createHash("sha256").update(content).digest(encoding);
16206
16191
}
16207
16192
16193
+ // Copyright (c) Microsoft Corporation.
16194
+ // Licensed under the MIT license.
16195
+ /**
16196
+ * Helper TypeGuard that checks if something is defined or not.
16197
+ * @param thing - Anything
16198
+ */
16199
+ function isDefined(thing) {
16200
+ return typeof thing !== "undefined" && thing !== null;
16201
+ }
16202
+ /**
16203
+ * Helper TypeGuard that checks if the input is an object with the specified properties.
16204
+ * @param thing - Anything.
16205
+ * @param properties - The name of the properties that should appear in the object.
16206
+ */
16207
+ function isObjectWithProperties(thing, properties) {
16208
+ if (!isDefined(thing) || typeof thing !== "object") {
16209
+ return false;
16210
+ }
16211
+ for (const property of properties) {
16212
+ if (!objectHasProperty(thing, property)) {
16213
+ return false;
16214
+ }
16215
+ }
16216
+ return true;
16217
+ }
16218
+ /**
16219
+ * Helper TypeGuard that checks if the input is an object with the specified property.
16220
+ * @param thing - Any object.
16221
+ * @param property - The name of the property that should appear in the object.
16222
+ */
16223
+ function objectHasProperty(thing, property) {
16224
+ return (isDefined(thing) && typeof thing === "object" && property in thing);
16225
+ }
16226
+
16208
16227
exports.computeSha256Hash = computeSha256Hash;
16209
16228
exports.computeSha256Hmac = computeSha256Hmac;
16229
+ exports.createAbortablePromise = createAbortablePromise;
16210
16230
exports.delay = delay;
16211
16231
exports.getErrorMessage = getErrorMessage;
16212
16232
exports.getRandomIntegerInclusive = getRandomIntegerInclusive;
@@ -16221,21 +16241,23 @@ exports.objectHasProperty = objectHasProperty;
16221
16241
16222
16242
/***/ }),
16223
16243
16224
- /***/ 9423 :
16244
+ /***/ 5269 :
16225
16245
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
16226
16246
16227
16247
16228
16248
16229
16249
Object.defineProperty(exports, "__esModule", ({ value: true }));
16230
16250
16231
- function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
16232
-
16233
- var util = _interopDefault(__nccwpck_require__(3837));
16234
16251
var os = __nccwpck_require__(2037);
16252
+ var util = __nccwpck_require__(3837);
16253
+
16254
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
16255
+
16256
+ var util__default = /*#__PURE__*/_interopDefaultLegacy(util);
16235
16257
16236
16258
// Copyright (c) Microsoft Corporation.
16237
16259
function log(message, ...args) {
16238
- process.stderr.write(`${util .format(message, ...args)}${os.EOL}`);
16260
+ process.stderr.write(`${util__default["default"] .format(message, ...args)}${os.EOL}`);
16239
16261
}
16240
16262
16241
16263
// Copyright (c) Microsoft Corporation.
@@ -16253,7 +16275,7 @@ const debugObj = Object.assign((namespace) => {
16253
16275
enable,
16254
16276
enabled,
16255
16277
disable,
16256
- log
16278
+ log,
16257
16279
});
16258
16280
function enable(namespaces) {
16259
16281
enabledString = namespaces;
@@ -16300,7 +16322,7 @@ function createDebugger(namespace) {
16300
16322
destroy,
16301
16323
log: debugObj.log,
16302
16324
namespace,
16303
- extend
16325
+ extend,
16304
16326
});
16305
16327
function debug(...args) {
16306
16328
if (!newDebugger.enabled) {
@@ -16327,6 +16349,7 @@ function extend(namespace) {
16327
16349
newDebugger.log = this.log;
16328
16350
return newDebugger;
16329
16351
}
16352
+ var debug = debugObj;
16330
16353
16331
16354
// Copyright (c) Microsoft Corporation.
16332
16355
const registeredLoggers = new Set();
@@ -16337,9 +16360,9 @@ let azureLogLevel;
16337
16360
* By default, logs are sent to stderr.
16338
16361
* Override the `log` method to redirect logs to another location.
16339
16362
*/
16340
- const AzureLogger = debugObj ("azure");
16363
+ const AzureLogger = debug ("azure");
16341
16364
AzureLogger.log = (...args) => {
16342
- debugObj .log(...args);
16365
+ debug .log(...args);
16343
16366
};
16344
16367
const AZURE_LOG_LEVELS = ["verbose", "info", "warning", "error"];
16345
16368
if (logLevelFromEnv) {
@@ -16352,7 +16375,7 @@ if (logLevelFromEnv) {
16352
16375
}
16353
16376
}
16354
16377
/**
16355
- * Immediately enables logging at the specified log level.
16378
+ * Immediately enables logging at the specified log level. If no level is specified, logging is disabled.
16356
16379
* @param level - The log level to enable for logging.
16357
16380
* Options from most verbose to least verbose are:
16358
16381
* - verbose
@@ -16371,7 +16394,7 @@ function setLogLevel(level) {
16371
16394
enabledNamespaces.push(logger.namespace);
16372
16395
}
16373
16396
}
16374
- debugObj .enable(enabledNamespaces.join(","));
16397
+ debug .enable(enabledNamespaces.join(","));
16375
16398
}
16376
16399
/**
16377
16400
* Retrieves the currently specified log level.
@@ -16383,7 +16406,7 @@ const levelMap = {
16383
16406
verbose: 400,
16384
16407
info: 300,
16385
16408
warning: 200,
16386
- error: 100
16409
+ error: 100,
16387
16410
};
16388
16411
/**
16389
16412
* Creates a logger for use by the Azure SDKs that inherits from `AzureLogger`.
@@ -16397,7 +16420,7 @@ function createClientLogger(namespace) {
16397
16420
error: createLogger(clientRootLogger, "error"),
16398
16421
warning: createLogger(clientRootLogger, "warning"),
16399
16422
info: createLogger(clientRootLogger, "info"),
16400
- verbose: createLogger(clientRootLogger, "verbose")
16423
+ verbose: createLogger(clientRootLogger, "verbose"),
16401
16424
};
16402
16425
}
16403
16426
function patchLogMethod(parent, child) {
@@ -16407,23 +16430,18 @@ function patchLogMethod(parent, child) {
16407
16430
}
16408
16431
function createLogger(parent, level) {
16409
16432
const logger = Object.assign(parent.extend(level), {
16410
- level
16433
+ level,
16411
16434
});
16412
16435
patchLogMethod(parent, logger);
16413
16436
if (shouldEnable(logger)) {
16414
- const enabledNamespaces = debugObj .disable();
16415
- debugObj .enable(enabledNamespaces + "," + logger.namespace);
16437
+ const enabledNamespaces = debug .disable();
16438
+ debug .enable(enabledNamespaces + "," + logger.namespace);
16416
16439
}
16417
16440
registeredLoggers.add(logger);
16418
16441
return logger;
16419
16442
}
16420
16443
function shouldEnable(logger) {
16421
- if (azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]) {
16422
- return true;
16423
- }
16424
- else {
16425
- return false;
16426
- }
16444
+ return Boolean(azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]);
16427
16445
}
16428
16446
function isAzureLogLevel(logLevel) {
16429
16447
return AZURE_LOG_LEVELS.includes(logLevel);
@@ -16448,7 +16466,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
16448
16466
var coreHttp = __nccwpck_require__(2405);
16449
16467
var tslib = __nccwpck_require__(2821);
16450
16468
var coreTracing = __nccwpck_require__(3872);
16451
- var logger$1 = __nccwpck_require__(9423 );
16469
+ var logger$1 = __nccwpck_require__(5269 );
16452
16470
var abortController = __nccwpck_require__(4992);
16453
16471
var os = __nccwpck_require__(2037);
16454
16472
var crypto = __nccwpck_require__(6113);
0 commit comments