@cypress/github-action 7.1.2 → 7.1.4
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/README.md +1 -1
- package/dist/index.js +620 -1751
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -52659,6 +52659,8 @@ function Minimatch (pattern, options) {
|
|
|
52659
52659
|
}
|
|
52660
52660
|
|
|
52661
52661
|
this.options = options
|
|
52662
|
+
this.maxGlobstarRecursion = options.maxGlobstarRecursion !== undefined
|
|
52663
|
+
? options.maxGlobstarRecursion : 200
|
|
52662
52664
|
this.set = []
|
|
52663
52665
|
this.pattern = pattern
|
|
52664
52666
|
this.regexp = null
|
|
@@ -52907,6 +52909,9 @@ function parse (pattern, isSub) {
|
|
|
52907
52909
|
continue
|
|
52908
52910
|
}
|
|
52909
52911
|
|
|
52912
|
+
// coalesce consecutive non-globstar * characters
|
|
52913
|
+
if (c === '*' && stateChar === '*') continue
|
|
52914
|
+
|
|
52910
52915
|
// if we already have a stateChar, then it means
|
|
52911
52916
|
// that there was something like ** or +? in there.
|
|
52912
52917
|
// Handle the stateChar, then proceed with this one.
|
|
@@ -53301,109 +53306,173 @@ Minimatch.prototype.match = function match (f, partial) {
|
|
|
53301
53306
|
// out of pattern, then that's fine, as long as all
|
|
53302
53307
|
// the parts match.
|
|
53303
53308
|
Minimatch.prototype.matchOne = function (file, pattern, partial) {
|
|
53304
|
-
|
|
53309
|
+
if (pattern.indexOf(GLOBSTAR) !== -1) {
|
|
53310
|
+
return this._matchGlobstar(file, pattern, partial, 0, 0)
|
|
53311
|
+
}
|
|
53312
|
+
return this._matchOne(file, pattern, partial, 0, 0)
|
|
53313
|
+
}
|
|
53305
53314
|
|
|
53306
|
-
|
|
53307
|
-
|
|
53315
|
+
Minimatch.prototype._matchGlobstar = function (file, pattern, partial, fileIndex, patternIndex) {
|
|
53316
|
+
var i
|
|
53308
53317
|
|
|
53309
|
-
|
|
53318
|
+
// find first globstar from patternIndex
|
|
53319
|
+
var firstgs = -1
|
|
53320
|
+
for (i = patternIndex; i < pattern.length; i++) {
|
|
53321
|
+
if (pattern[i] === GLOBSTAR) { firstgs = i; break }
|
|
53322
|
+
}
|
|
53310
53323
|
|
|
53311
|
-
|
|
53312
|
-
|
|
53313
|
-
|
|
53314
|
-
|
|
53315
|
-
|
|
53316
|
-
; fi++, pi++) {
|
|
53317
|
-
this.debug('matchOne loop')
|
|
53318
|
-
var p = pattern[pi]
|
|
53319
|
-
var f = file[fi]
|
|
53324
|
+
// find last globstar
|
|
53325
|
+
var lastgs = -1
|
|
53326
|
+
for (i = pattern.length - 1; i >= 0; i--) {
|
|
53327
|
+
if (pattern[i] === GLOBSTAR) { lastgs = i; break }
|
|
53328
|
+
}
|
|
53320
53329
|
|
|
53321
|
-
|
|
53330
|
+
var head = pattern.slice(patternIndex, firstgs)
|
|
53331
|
+
var body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs)
|
|
53332
|
+
var tail = partial ? [] : pattern.slice(lastgs + 1)
|
|
53322
53333
|
|
|
53323
|
-
|
|
53324
|
-
|
|
53325
|
-
|
|
53326
|
-
if (
|
|
53327
|
-
|
|
53328
|
-
|
|
53329
|
-
|
|
53330
|
-
|
|
53331
|
-
|
|
53332
|
-
|
|
53333
|
-
|
|
53334
|
-
|
|
53335
|
-
|
|
53336
|
-
|
|
53337
|
-
|
|
53338
|
-
|
|
53339
|
-
|
|
53340
|
-
|
|
53341
|
-
//
|
|
53342
|
-
|
|
53343
|
-
|
|
53344
|
-
|
|
53345
|
-
|
|
53346
|
-
|
|
53347
|
-
|
|
53348
|
-
|
|
53349
|
-
// - matchOne(x/y/z/c, c) -> no
|
|
53350
|
-
// - matchOne(y/z/c, c) -> no
|
|
53351
|
-
// - matchOne(z/c, c) -> no
|
|
53352
|
-
// - matchOne(c, c) yes, hit
|
|
53353
|
-
var fr = fi
|
|
53354
|
-
var pr = pi + 1
|
|
53355
|
-
if (pr === pl) {
|
|
53356
|
-
this.debug('** at the end')
|
|
53357
|
-
// a ** at the end will just swallow the rest.
|
|
53358
|
-
// We have found a match.
|
|
53359
|
-
// however, it will not swallow /.x, unless
|
|
53360
|
-
// options.dot is set.
|
|
53361
|
-
// . and .. are *never* matched by **, for explosively
|
|
53362
|
-
// exponential reasons.
|
|
53363
|
-
for (; fi < fl; fi++) {
|
|
53364
|
-
if (file[fi] === '.' || file[fi] === '..' ||
|
|
53365
|
-
(!options.dot && file[fi].charAt(0) === '.')) return false
|
|
53366
|
-
}
|
|
53367
|
-
return true
|
|
53334
|
+
// check the head
|
|
53335
|
+
if (head.length) {
|
|
53336
|
+
var fileHead = file.slice(fileIndex, fileIndex + head.length)
|
|
53337
|
+
if (!this._matchOne(fileHead, head, partial, 0, 0)) {
|
|
53338
|
+
return false
|
|
53339
|
+
}
|
|
53340
|
+
fileIndex += head.length
|
|
53341
|
+
}
|
|
53342
|
+
|
|
53343
|
+
// check the tail
|
|
53344
|
+
var fileTailMatch = 0
|
|
53345
|
+
if (tail.length) {
|
|
53346
|
+
if (tail.length + fileIndex > file.length) return false
|
|
53347
|
+
|
|
53348
|
+
var tailStart = file.length - tail.length
|
|
53349
|
+
if (this._matchOne(file, tail, partial, tailStart, 0)) {
|
|
53350
|
+
fileTailMatch = tail.length
|
|
53351
|
+
} else {
|
|
53352
|
+
// affordance for stuff like a/**/* matching a/b/
|
|
53353
|
+
if (file[file.length - 1] !== '' ||
|
|
53354
|
+
fileIndex + tail.length === file.length) {
|
|
53355
|
+
return false
|
|
53356
|
+
}
|
|
53357
|
+
tailStart--
|
|
53358
|
+
if (!this._matchOne(file, tail, partial, tailStart, 0)) {
|
|
53359
|
+
return false
|
|
53368
53360
|
}
|
|
53361
|
+
fileTailMatch = tail.length + 1
|
|
53362
|
+
}
|
|
53363
|
+
}
|
|
53369
53364
|
|
|
53370
|
-
|
|
53371
|
-
|
|
53372
|
-
|
|
53365
|
+
// if body is empty (single ** between head and tail)
|
|
53366
|
+
if (!body.length) {
|
|
53367
|
+
var sawSome = !!fileTailMatch
|
|
53368
|
+
for (i = fileIndex; i < file.length - fileTailMatch; i++) {
|
|
53369
|
+
var f = String(file[i])
|
|
53370
|
+
sawSome = true
|
|
53371
|
+
if (f === '.' || f === '..' ||
|
|
53372
|
+
(!this.options.dot && f.charAt(0) === '.')) {
|
|
53373
|
+
return false
|
|
53374
|
+
}
|
|
53375
|
+
}
|
|
53376
|
+
return partial || sawSome
|
|
53377
|
+
}
|
|
53373
53378
|
|
|
53374
|
-
|
|
53379
|
+
// split body into segments at each GLOBSTAR
|
|
53380
|
+
var bodySegments = [[[], 0]]
|
|
53381
|
+
var currentBody = bodySegments[0]
|
|
53382
|
+
var nonGsParts = 0
|
|
53383
|
+
var nonGsPartsSums = [0]
|
|
53384
|
+
for (var bi = 0; bi < body.length; bi++) {
|
|
53385
|
+
var b = body[bi]
|
|
53386
|
+
if (b === GLOBSTAR) {
|
|
53387
|
+
nonGsPartsSums.push(nonGsParts)
|
|
53388
|
+
currentBody = [[], 0]
|
|
53389
|
+
bodySegments.push(currentBody)
|
|
53390
|
+
} else {
|
|
53391
|
+
currentBody[0].push(b)
|
|
53392
|
+
nonGsParts++
|
|
53393
|
+
}
|
|
53394
|
+
}
|
|
53375
53395
|
|
|
53376
|
-
|
|
53377
|
-
|
|
53378
|
-
|
|
53379
|
-
|
|
53380
|
-
|
|
53381
|
-
|
|
53382
|
-
// can't swallow "." or ".." ever.
|
|
53383
|
-
// can only swallow ".foo" when explicitly asked.
|
|
53384
|
-
if (swallowee === '.' || swallowee === '..' ||
|
|
53385
|
-
(!options.dot && swallowee.charAt(0) === '.')) {
|
|
53386
|
-
this.debug('dot detected!', file, fr, pattern, pr)
|
|
53387
|
-
break
|
|
53388
|
-
}
|
|
53396
|
+
var idx = bodySegments.length - 1
|
|
53397
|
+
var fileLength = file.length - fileTailMatch
|
|
53398
|
+
for (var si = 0; si < bodySegments.length; si++) {
|
|
53399
|
+
bodySegments[si][1] = fileLength -
|
|
53400
|
+
(nonGsPartsSums[idx--] + bodySegments[si][0].length)
|
|
53401
|
+
}
|
|
53389
53402
|
|
|
53390
|
-
|
|
53391
|
-
|
|
53392
|
-
|
|
53393
|
-
|
|
53403
|
+
return !!this._matchGlobStarBodySections(
|
|
53404
|
+
file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch
|
|
53405
|
+
)
|
|
53406
|
+
}
|
|
53407
|
+
|
|
53408
|
+
// return false for "nope, not matching"
|
|
53409
|
+
// return null for "not matching, cannot keep trying"
|
|
53410
|
+
Minimatch.prototype._matchGlobStarBodySections = function (
|
|
53411
|
+
file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail
|
|
53412
|
+
) {
|
|
53413
|
+
var bs = bodySegments[bodyIndex]
|
|
53414
|
+
if (!bs) {
|
|
53415
|
+
// just make sure there are no bad dots
|
|
53416
|
+
for (var i = fileIndex; i < file.length; i++) {
|
|
53417
|
+
sawTail = true
|
|
53418
|
+
var f = file[i]
|
|
53419
|
+
if (f === '.' || f === '..' ||
|
|
53420
|
+
(!this.options.dot && f.charAt(0) === '.')) {
|
|
53421
|
+
return false
|
|
53394
53422
|
}
|
|
53423
|
+
}
|
|
53424
|
+
return sawTail
|
|
53425
|
+
}
|
|
53395
53426
|
|
|
53396
|
-
|
|
53397
|
-
|
|
53398
|
-
|
|
53399
|
-
|
|
53400
|
-
|
|
53401
|
-
|
|
53402
|
-
|
|
53403
|
-
|
|
53427
|
+
var body = bs[0]
|
|
53428
|
+
var after = bs[1]
|
|
53429
|
+
while (fileIndex <= after) {
|
|
53430
|
+
var m = this._matchOne(
|
|
53431
|
+
file.slice(0, fileIndex + body.length),
|
|
53432
|
+
body,
|
|
53433
|
+
partial,
|
|
53434
|
+
fileIndex,
|
|
53435
|
+
0
|
|
53436
|
+
)
|
|
53437
|
+
// if limit exceeded, no match. intentional false negative,
|
|
53438
|
+
// acceptable break in correctness for security.
|
|
53439
|
+
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
|
53440
|
+
var sub = this._matchGlobStarBodySections(
|
|
53441
|
+
file, bodySegments,
|
|
53442
|
+
fileIndex + body.length, bodyIndex + 1,
|
|
53443
|
+
partial, globStarDepth + 1, sawTail
|
|
53444
|
+
)
|
|
53445
|
+
if (sub !== false) {
|
|
53446
|
+
return sub
|
|
53404
53447
|
}
|
|
53448
|
+
}
|
|
53449
|
+
var f = file[fileIndex]
|
|
53450
|
+
if (f === '.' || f === '..' ||
|
|
53451
|
+
(!this.options.dot && f.charAt(0) === '.')) {
|
|
53405
53452
|
return false
|
|
53406
53453
|
}
|
|
53454
|
+
fileIndex++
|
|
53455
|
+
}
|
|
53456
|
+
return partial || null
|
|
53457
|
+
}
|
|
53458
|
+
|
|
53459
|
+
Minimatch.prototype._matchOne = function (file, pattern, partial, fileIndex, patternIndex) {
|
|
53460
|
+
var fi, pi, fl, pl
|
|
53461
|
+
for (
|
|
53462
|
+
fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length
|
|
53463
|
+
; (fi < fl) && (pi < pl)
|
|
53464
|
+
; fi++, pi++
|
|
53465
|
+
) {
|
|
53466
|
+
this.debug('matchOne loop')
|
|
53467
|
+
var p = pattern[pi]
|
|
53468
|
+
var f = file[fi]
|
|
53469
|
+
|
|
53470
|
+
this.debug(pattern, p, f)
|
|
53471
|
+
|
|
53472
|
+
// should be impossible.
|
|
53473
|
+
// some invalid regexp stuff in the set.
|
|
53474
|
+
/* istanbul ignore if */
|
|
53475
|
+
if (p === false || p === GLOBSTAR) return false
|
|
53407
53476
|
|
|
53408
53477
|
// something other than **
|
|
53409
53478
|
// non-magic patterns just have to match exactly
|
|
@@ -53420,17 +53489,6 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) {
|
|
|
53420
53489
|
if (!hit) return false
|
|
53421
53490
|
}
|
|
53422
53491
|
|
|
53423
|
-
// Note: ending in / means that we'll get a final ""
|
|
53424
|
-
// at the end of the pattern. This can only match a
|
|
53425
|
-
// corresponding "" at the end of the file.
|
|
53426
|
-
// If the file ends in /, then it can only match a
|
|
53427
|
-
// a pattern that ends in /, unless the pattern just
|
|
53428
|
-
// doesn't have any more for it. But, a/b/ should *not*
|
|
53429
|
-
// match "a/b/*", even though "" matches against the
|
|
53430
|
-
// [^/]*? pattern, except in partial mode, where it might
|
|
53431
|
-
// simply not be reached yet.
|
|
53432
|
-
// However, a/b/ should still satisfy a/*
|
|
53433
|
-
|
|
53434
53492
|
// now either we fell off the end of the pattern, or we're done.
|
|
53435
53493
|
if (fi === fl && pi === pl) {
|
|
53436
53494
|
// ran out of pattern and filename at the same time.
|
|
@@ -67081,17 +67139,15 @@ const core_util_1 = __nccwpck_require__(87779);
|
|
|
67081
67139
|
const core_auth_1 = __nccwpck_require__(50417);
|
|
67082
67140
|
const core_rest_pipeline_1 = __nccwpck_require__(20778);
|
|
67083
67141
|
const core_util_2 = __nccwpck_require__(87779);
|
|
67084
|
-
const
|
|
67142
|
+
const storage_common_1 = __nccwpck_require__(51382);
|
|
67085
67143
|
const Clients_js_1 = __nccwpck_require__(90372);
|
|
67086
67144
|
const Mutex_js_1 = __nccwpck_require__(58913);
|
|
67087
67145
|
const Pipeline_js_1 = __nccwpck_require__(25984);
|
|
67088
67146
|
const utils_common_js_1 = __nccwpck_require__(47764);
|
|
67089
67147
|
const core_xml_1 = __nccwpck_require__(78756);
|
|
67090
67148
|
const constants_js_1 = __nccwpck_require__(27323);
|
|
67091
|
-
const StorageSharedKeyCredential_js_1 = __nccwpck_require__(68999);
|
|
67092
67149
|
const tracing_js_1 = __nccwpck_require__(53952);
|
|
67093
67150
|
const core_client_1 = __nccwpck_require__(60160);
|
|
67094
|
-
const StorageSharedKeyCredentialPolicyV2_js_1 = __nccwpck_require__(97999);
|
|
67095
67151
|
/**
|
|
67096
67152
|
* A BlobBatch represents an aggregated set of operations on blobs.
|
|
67097
67153
|
* Currently, only `delete` and `setAccessTier` are supported.
|
|
@@ -67146,8 +67202,8 @@ class BlobBatch {
|
|
|
67146
67202
|
let url;
|
|
67147
67203
|
let credential;
|
|
67148
67204
|
if (typeof urlOrBlobClient === "string" &&
|
|
67149
|
-
((core_util_2.isNodeLike && credentialOrOptions instanceof
|
|
67150
|
-
credentialOrOptions instanceof
|
|
67205
|
+
((core_util_2.isNodeLike && credentialOrOptions instanceof storage_common_1.StorageSharedKeyCredential) ||
|
|
67206
|
+
credentialOrOptions instanceof storage_common_1.AnonymousCredential ||
|
|
67151
67207
|
(0, core_auth_1.isTokenCredential)(credentialOrOptions))) {
|
|
67152
67208
|
// First overload
|
|
67153
67209
|
url = urlOrBlobClient;
|
|
@@ -67180,8 +67236,8 @@ class BlobBatch {
|
|
|
67180
67236
|
let credential;
|
|
67181
67237
|
let tier;
|
|
67182
67238
|
if (typeof urlOrBlobClient === "string" &&
|
|
67183
|
-
((core_util_2.isNodeLike && credentialOrTier instanceof
|
|
67184
|
-
credentialOrTier instanceof
|
|
67239
|
+
((core_util_2.isNodeLike && credentialOrTier instanceof storage_common_1.StorageSharedKeyCredential) ||
|
|
67240
|
+
credentialOrTier instanceof storage_common_1.AnonymousCredential ||
|
|
67185
67241
|
(0, core_auth_1.isTokenCredential)(credentialOrTier))) {
|
|
67186
67242
|
// First overload
|
|
67187
67243
|
url = urlOrBlobClient;
|
|
@@ -67269,8 +67325,8 @@ class InnerBatchRequest {
|
|
|
67269
67325
|
challengeCallbacks: { authorizeRequestOnChallenge: core_client_1.authorizeRequestOnTenantChallenge },
|
|
67270
67326
|
}), { phase: "Sign" });
|
|
67271
67327
|
}
|
|
67272
|
-
else if (credential instanceof
|
|
67273
|
-
corePipeline.addPolicy((0,
|
|
67328
|
+
else if (credential instanceof storage_common_1.StorageSharedKeyCredential) {
|
|
67329
|
+
corePipeline.addPolicy((0, storage_common_1.storageSharedKeyCredentialPolicy)({
|
|
67274
67330
|
accountName: credential.accountName,
|
|
67275
67331
|
accountKey: credential.accountKey,
|
|
67276
67332
|
}), { phase: "Sign" });
|
|
@@ -67368,7 +67424,7 @@ const BatchResponseParser_js_1 = __nccwpck_require__(41564);
|
|
|
67368
67424
|
const BatchUtils_js_1 = __nccwpck_require__(72995);
|
|
67369
67425
|
const BlobBatch_js_1 = __nccwpck_require__(95561);
|
|
67370
67426
|
const tracing_js_1 = __nccwpck_require__(53952);
|
|
67371
|
-
const
|
|
67427
|
+
const storage_common_1 = __nccwpck_require__(51382);
|
|
67372
67428
|
const StorageContextClient_js_1 = __nccwpck_require__(53789);
|
|
67373
67429
|
const Pipeline_js_1 = __nccwpck_require__(25984);
|
|
67374
67430
|
const utils_common_js_1 = __nccwpck_require__(47764);
|
|
@@ -67389,7 +67445,7 @@ class BlobBatchClient {
|
|
|
67389
67445
|
}
|
|
67390
67446
|
else if (!credentialOrPipeline) {
|
|
67391
67447
|
// no credential provided
|
|
67392
|
-
pipeline = (0, Pipeline_js_1.newPipeline)(new
|
|
67448
|
+
pipeline = (0, Pipeline_js_1.newPipeline)(new storage_common_1.AnonymousCredential(), options);
|
|
67393
67449
|
}
|
|
67394
67450
|
else {
|
|
67395
67451
|
pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options);
|
|
@@ -67512,9 +67568,9 @@ class BlobBatchClient {
|
|
|
67512
67568
|
return tracing_js_1.tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => {
|
|
67513
67569
|
const batchRequestBody = batchRequest.getHttpRequestBody();
|
|
67514
67570
|
// ServiceSubmitBatchResponseModel and ContainerSubmitBatchResponse are compatible for now.
|
|
67515
|
-
const rawBatchResponse = (0, utils_common_js_1.assertResponse)(await this.serviceOrContainerContext.submitBatch((0, BatchUtils_js_1.utf8ByteLength)(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, {
|
|
67571
|
+
const rawBatchResponse = (0, utils_common_js_1.assertResponse)((await this.serviceOrContainerContext.submitBatch((0, BatchUtils_js_1.utf8ByteLength)(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, {
|
|
67516
67572
|
...updatedOptions,
|
|
67517
|
-
}));
|
|
67573
|
+
})));
|
|
67518
67574
|
// Parse the sub responses result, if logic reaches here(i.e. the batch request succeeded with status code 202).
|
|
67519
67575
|
const batchResponseParser = new BatchResponseParser_js_1.BatchResponseParser(rawBatchResponse, batchRequest.getSubRequests());
|
|
67520
67576
|
const responseSummary = await batchResponseParser.parseBatchResponse();
|
|
@@ -68619,8 +68675,7 @@ const core_util_1 = __nccwpck_require__(87779);
|
|
|
68619
68675
|
const Pipeline_js_1 = __nccwpck_require__(25984);
|
|
68620
68676
|
const ContainerClient_js_1 = __nccwpck_require__(81884);
|
|
68621
68677
|
const utils_common_js_1 = __nccwpck_require__(47764);
|
|
68622
|
-
const
|
|
68623
|
-
const AnonymousCredential_js_1 = __nccwpck_require__(35345);
|
|
68678
|
+
const storage_common_1 = __nccwpck_require__(51382);
|
|
68624
68679
|
const utils_common_js_2 = __nccwpck_require__(47764);
|
|
68625
68680
|
const tracing_js_1 = __nccwpck_require__(53952);
|
|
68626
68681
|
const BlobBatchClient_js_1 = __nccwpck_require__(12094);
|
|
@@ -68657,7 +68712,7 @@ class BlobServiceClient extends StorageClient_js_1.StorageClient {
|
|
|
68657
68712
|
const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(connectionString);
|
|
68658
68713
|
if (extractedCreds.kind === "AccountConnString") {
|
|
68659
68714
|
if (core_util_1.isNodeLike) {
|
|
68660
|
-
const sharedKeyCredential = new
|
|
68715
|
+
const sharedKeyCredential = new storage_common_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
|
|
68661
68716
|
if (!options.proxyOptions) {
|
|
68662
68717
|
options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri);
|
|
68663
68718
|
}
|
|
@@ -68669,7 +68724,7 @@ class BlobServiceClient extends StorageClient_js_1.StorageClient {
|
|
|
68669
68724
|
}
|
|
68670
68725
|
}
|
|
68671
68726
|
else if (extractedCreds.kind === "SASConnString") {
|
|
68672
|
-
const pipeline = (0, Pipeline_js_1.newPipeline)(new
|
|
68727
|
+
const pipeline = (0, Pipeline_js_1.newPipeline)(new storage_common_1.AnonymousCredential(), options);
|
|
68673
68728
|
return new BlobServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline);
|
|
68674
68729
|
}
|
|
68675
68730
|
else {
|
|
@@ -68684,14 +68739,14 @@ class BlobServiceClient extends StorageClient_js_1.StorageClient {
|
|
|
68684
68739
|
if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) {
|
|
68685
68740
|
pipeline = credentialOrPipeline;
|
|
68686
68741
|
}
|
|
68687
|
-
else if ((core_util_1.isNodeLike && credentialOrPipeline instanceof
|
|
68688
|
-
credentialOrPipeline instanceof
|
|
68742
|
+
else if ((core_util_1.isNodeLike && credentialOrPipeline instanceof storage_common_1.StorageSharedKeyCredential) ||
|
|
68743
|
+
credentialOrPipeline instanceof storage_common_1.AnonymousCredential ||
|
|
68689
68744
|
(0, core_auth_1.isTokenCredential)(credentialOrPipeline)) {
|
|
68690
68745
|
pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options);
|
|
68691
68746
|
}
|
|
68692
68747
|
else {
|
|
68693
68748
|
// The second parameter is undefined. Use anonymous credential
|
|
68694
|
-
pipeline = (0, Pipeline_js_1.newPipeline)(new
|
|
68749
|
+
pipeline = (0, Pipeline_js_1.newPipeline)(new storage_common_1.AnonymousCredential(), options);
|
|
68695
68750
|
}
|
|
68696
68751
|
super(url, pipeline);
|
|
68697
68752
|
this.serviceContext = this.storageClientContext.service;
|
|
@@ -69268,7 +69323,7 @@ class BlobServiceClient extends StorageClient_js_1.StorageClient {
|
|
|
69268
69323
|
* @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
69269
69324
|
*/
|
|
69270
69325
|
generateAccountSasUrl(expiresOn, permissions = AccountSASPermissions_js_1.AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) {
|
|
69271
|
-
if (!(this.credential instanceof
|
|
69326
|
+
if (!(this.credential instanceof storage_common_1.StorageSharedKeyCredential)) {
|
|
69272
69327
|
throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential");
|
|
69273
69328
|
}
|
|
69274
69329
|
if (expiresOn === undefined) {
|
|
@@ -69299,7 +69354,7 @@ class BlobServiceClient extends StorageClient_js_1.StorageClient {
|
|
|
69299
69354
|
* @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
69300
69355
|
*/
|
|
69301
69356
|
generateSasStringToSign(expiresOn, permissions = AccountSASPermissions_js_1.AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) {
|
|
69302
|
-
if (!(this.credential instanceof
|
|
69357
|
+
if (!(this.credential instanceof storage_common_1.StorageSharedKeyCredential)) {
|
|
69303
69358
|
throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential");
|
|
69304
69359
|
}
|
|
69305
69360
|
if (expiresOn === undefined) {
|
|
@@ -69335,8 +69390,7 @@ const core_util_1 = __nccwpck_require__(87779);
|
|
|
69335
69390
|
const core_util_2 = __nccwpck_require__(87779);
|
|
69336
69391
|
const BlobDownloadResponse_js_1 = __nccwpck_require__(4894);
|
|
69337
69392
|
const BlobQueryResponse_js_1 = __nccwpck_require__(95602);
|
|
69338
|
-
const
|
|
69339
|
-
const StorageSharedKeyCredential_js_1 = __nccwpck_require__(68999);
|
|
69393
|
+
const storage_common_1 = __nccwpck_require__(51382);
|
|
69340
69394
|
const models_js_1 = __nccwpck_require__(58560);
|
|
69341
69395
|
const PageBlobRangeResponse_js_1 = __nccwpck_require__(95302);
|
|
69342
69396
|
const Pipeline_js_1 = __nccwpck_require__(25984);
|
|
@@ -69344,7 +69398,7 @@ const BlobStartCopyFromUrlPoller_js_1 = __nccwpck_require__(73145);
|
|
|
69344
69398
|
const Range_js_1 = __nccwpck_require__(52045);
|
|
69345
69399
|
const StorageClient_js_1 = __nccwpck_require__(73542);
|
|
69346
69400
|
const Batch_js_1 = __nccwpck_require__(81582);
|
|
69347
|
-
const
|
|
69401
|
+
const storage_common_2 = __nccwpck_require__(51382);
|
|
69348
69402
|
const constants_js_1 = __nccwpck_require__(27323);
|
|
69349
69403
|
const tracing_js_1 = __nccwpck_require__(53952);
|
|
69350
69404
|
const utils_common_js_1 = __nccwpck_require__(47764);
|
|
@@ -69388,8 +69442,8 @@ class BlobClient extends StorageClient_js_1.StorageClient {
|
|
|
69388
69442
|
url = urlOrConnectionString;
|
|
69389
69443
|
pipeline = credentialOrPipelineOrContainerName;
|
|
69390
69444
|
}
|
|
69391
|
-
else if ((core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof
|
|
69392
|
-
credentialOrPipelineOrContainerName instanceof
|
|
69445
|
+
else if ((core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof storage_common_1.StorageSharedKeyCredential) ||
|
|
69446
|
+
credentialOrPipelineOrContainerName instanceof storage_common_1.AnonymousCredential ||
|
|
69393
69447
|
(0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) {
|
|
69394
69448
|
// (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
|
|
69395
69449
|
url = urlOrConnectionString;
|
|
@@ -69404,7 +69458,7 @@ class BlobClient extends StorageClient_js_1.StorageClient {
|
|
|
69404
69458
|
if (blobNameOrOptions && typeof blobNameOrOptions !== "string") {
|
|
69405
69459
|
options = blobNameOrOptions;
|
|
69406
69460
|
}
|
|
69407
|
-
pipeline = (0, Pipeline_js_1.newPipeline)(new
|
|
69461
|
+
pipeline = (0, Pipeline_js_1.newPipeline)(new storage_common_1.AnonymousCredential(), options);
|
|
69408
69462
|
}
|
|
69409
69463
|
else if (credentialOrPipelineOrContainerName &&
|
|
69410
69464
|
typeof credentialOrPipelineOrContainerName === "string" &&
|
|
@@ -69416,7 +69470,7 @@ class BlobClient extends StorageClient_js_1.StorageClient {
|
|
|
69416
69470
|
const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString);
|
|
69417
69471
|
if (extractedCreds.kind === "AccountConnString") {
|
|
69418
69472
|
if (core_util_1.isNodeLike) {
|
|
69419
|
-
const sharedKeyCredential = new
|
|
69473
|
+
const sharedKeyCredential = new storage_common_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
|
|
69420
69474
|
url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));
|
|
69421
69475
|
if (!options.proxyOptions) {
|
|
69422
69476
|
options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri);
|
|
@@ -69432,7 +69486,7 @@ class BlobClient extends StorageClient_js_1.StorageClient {
|
|
|
69432
69486
|
(0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) +
|
|
69433
69487
|
"?" +
|
|
69434
69488
|
extractedCreds.accountSas;
|
|
69435
|
-
pipeline = (0, Pipeline_js_1.newPipeline)(new
|
|
69489
|
+
pipeline = (0, Pipeline_js_1.newPipeline)(new storage_common_1.AnonymousCredential(), options);
|
|
69436
69490
|
}
|
|
69437
69491
|
else {
|
|
69438
69492
|
throw new Error("Connection string must be either an Account connection string or a SAS connection string");
|
|
@@ -69575,7 +69629,7 @@ class BlobClient extends StorageClient_js_1.StorageClient {
|
|
|
69575
69629
|
options.conditions = options.conditions || {};
|
|
69576
69630
|
(0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps);
|
|
69577
69631
|
return tracing_js_1.tracingClient.withSpan("BlobClient-download", options, async (updatedOptions) => {
|
|
69578
|
-
const res = (0, utils_common_js_1.assertResponse)(await this.blobContext.download({
|
|
69632
|
+
const res = (0, utils_common_js_1.assertResponse)((await this.blobContext.download({
|
|
69579
69633
|
abortSignal: options.abortSignal,
|
|
69580
69634
|
leaseAccessConditions: options.conditions,
|
|
69581
69635
|
modifiedAccessConditions: {
|
|
@@ -69591,7 +69645,7 @@ class BlobClient extends StorageClient_js_1.StorageClient {
|
|
|
69591
69645
|
snapshot: options.snapshot,
|
|
69592
69646
|
cpkInfo: options.customerProvidedKey,
|
|
69593
69647
|
tracingOptions: updatedOptions.tracingOptions,
|
|
69594
|
-
}));
|
|
69648
|
+
})));
|
|
69595
69649
|
const wrappedRes = {
|
|
69596
69650
|
...res,
|
|
69597
69651
|
_response: res._response, // _response is made non-enumerable
|
|
@@ -69872,6 +69926,7 @@ class BlobClient extends StorageClient_js_1.StorageClient {
|
|
|
69872
69926
|
...options.conditions,
|
|
69873
69927
|
ifTags: options.conditions?.tagConditions,
|
|
69874
69928
|
},
|
|
69929
|
+
blobModifiedAccessConditions: options.conditions,
|
|
69875
69930
|
tracingOptions: updatedOptions.tracingOptions,
|
|
69876
69931
|
tags: (0, utils_common_js_1.toBlobTags)(tags),
|
|
69877
69932
|
}));
|
|
@@ -69891,6 +69946,7 @@ class BlobClient extends StorageClient_js_1.StorageClient {
|
|
|
69891
69946
|
...options.conditions,
|
|
69892
69947
|
ifTags: options.conditions?.tagConditions,
|
|
69893
69948
|
},
|
|
69949
|
+
blobModifiedAccessConditions: options.conditions,
|
|
69894
69950
|
tracingOptions: updatedOptions.tracingOptions,
|
|
69895
69951
|
}));
|
|
69896
69952
|
const wrappedResponse = {
|
|
@@ -70329,7 +70385,7 @@ class BlobClient extends StorageClient_js_1.StorageClient {
|
|
|
70329
70385
|
*/
|
|
70330
70386
|
generateSasUrl(options) {
|
|
70331
70387
|
return new Promise((resolve) => {
|
|
70332
|
-
if (!(this.credential instanceof
|
|
70388
|
+
if (!(this.credential instanceof storage_common_1.StorageSharedKeyCredential)) {
|
|
70333
70389
|
throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
|
|
70334
70390
|
}
|
|
70335
70391
|
const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({
|
|
@@ -70355,7 +70411,7 @@ class BlobClient extends StorageClient_js_1.StorageClient {
|
|
|
70355
70411
|
*/
|
|
70356
70412
|
/* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
|
|
70357
70413
|
generateSasStringToSign(options) {
|
|
70358
|
-
if (!(this.credential instanceof
|
|
70414
|
+
if (!(this.credential instanceof storage_common_1.StorageSharedKeyCredential)) {
|
|
70359
70415
|
throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
|
|
70360
70416
|
}
|
|
70361
70417
|
return (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParametersInternal)({
|
|
@@ -70490,8 +70546,8 @@ class AppendBlobClient extends BlobClient {
|
|
|
70490
70546
|
url = urlOrConnectionString;
|
|
70491
70547
|
pipeline = credentialOrPipelineOrContainerName;
|
|
70492
70548
|
}
|
|
70493
|
-
else if ((core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof
|
|
70494
|
-
credentialOrPipelineOrContainerName instanceof
|
|
70549
|
+
else if ((core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof storage_common_1.StorageSharedKeyCredential) ||
|
|
70550
|
+
credentialOrPipelineOrContainerName instanceof storage_common_1.AnonymousCredential ||
|
|
70495
70551
|
(0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) {
|
|
70496
70552
|
// (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions) url = urlOrConnectionString;
|
|
70497
70553
|
url = urlOrConnectionString;
|
|
@@ -70503,7 +70559,7 @@ class AppendBlobClient extends BlobClient {
|
|
|
70503
70559
|
// (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
|
|
70504
70560
|
url = urlOrConnectionString;
|
|
70505
70561
|
// The second parameter is undefined. Use anonymous credential.
|
|
70506
|
-
pipeline = (0, Pipeline_js_1.newPipeline)(new
|
|
70562
|
+
pipeline = (0, Pipeline_js_1.newPipeline)(new storage_common_1.AnonymousCredential(), options);
|
|
70507
70563
|
}
|
|
70508
70564
|
else if (credentialOrPipelineOrContainerName &&
|
|
70509
70565
|
typeof credentialOrPipelineOrContainerName === "string" &&
|
|
@@ -70515,7 +70571,7 @@ class AppendBlobClient extends BlobClient {
|
|
|
70515
70571
|
const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString);
|
|
70516
70572
|
if (extractedCreds.kind === "AccountConnString") {
|
|
70517
70573
|
if (core_util_1.isNodeLike) {
|
|
70518
|
-
const sharedKeyCredential = new
|
|
70574
|
+
const sharedKeyCredential = new storage_common_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
|
|
70519
70575
|
url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));
|
|
70520
70576
|
if (!options.proxyOptions) {
|
|
70521
70577
|
options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri);
|
|
@@ -70531,7 +70587,7 @@ class AppendBlobClient extends BlobClient {
|
|
|
70531
70587
|
(0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) +
|
|
70532
70588
|
"?" +
|
|
70533
70589
|
extractedCreds.accountSas;
|
|
70534
|
-
pipeline = (0, Pipeline_js_1.newPipeline)(new
|
|
70590
|
+
pipeline = (0, Pipeline_js_1.newPipeline)(new storage_common_1.AnonymousCredential(), options);
|
|
70535
70591
|
}
|
|
70536
70592
|
else {
|
|
70537
70593
|
throw new Error("Connection string must be either an Account connection string or a SAS connection string");
|
|
@@ -70792,8 +70848,8 @@ class BlockBlobClient extends BlobClient {
|
|
|
70792
70848
|
url = urlOrConnectionString;
|
|
70793
70849
|
pipeline = credentialOrPipelineOrContainerName;
|
|
70794
70850
|
}
|
|
70795
|
-
else if ((core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof
|
|
70796
|
-
credentialOrPipelineOrContainerName instanceof
|
|
70851
|
+
else if ((core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof storage_common_1.StorageSharedKeyCredential) ||
|
|
70852
|
+
credentialOrPipelineOrContainerName instanceof storage_common_1.AnonymousCredential ||
|
|
70797
70853
|
(0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) {
|
|
70798
70854
|
// (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
|
|
70799
70855
|
url = urlOrConnectionString;
|
|
@@ -70808,7 +70864,7 @@ class BlockBlobClient extends BlobClient {
|
|
|
70808
70864
|
if (blobNameOrOptions && typeof blobNameOrOptions !== "string") {
|
|
70809
70865
|
options = blobNameOrOptions;
|
|
70810
70866
|
}
|
|
70811
|
-
pipeline = (0, Pipeline_js_1.newPipeline)(new
|
|
70867
|
+
pipeline = (0, Pipeline_js_1.newPipeline)(new storage_common_1.AnonymousCredential(), options);
|
|
70812
70868
|
}
|
|
70813
70869
|
else if (credentialOrPipelineOrContainerName &&
|
|
70814
70870
|
typeof credentialOrPipelineOrContainerName === "string" &&
|
|
@@ -70820,7 +70876,7 @@ class BlockBlobClient extends BlobClient {
|
|
|
70820
70876
|
const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString);
|
|
70821
70877
|
if (extractedCreds.kind === "AccountConnString") {
|
|
70822
70878
|
if (core_util_1.isNodeLike) {
|
|
70823
|
-
const sharedKeyCredential = new
|
|
70879
|
+
const sharedKeyCredential = new storage_common_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
|
|
70824
70880
|
url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));
|
|
70825
70881
|
if (!options.proxyOptions) {
|
|
70826
70882
|
options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri);
|
|
@@ -70836,7 +70892,7 @@ class BlockBlobClient extends BlobClient {
|
|
|
70836
70892
|
(0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) +
|
|
70837
70893
|
"?" +
|
|
70838
70894
|
extractedCreds.accountSas;
|
|
70839
|
-
pipeline = (0, Pipeline_js_1.newPipeline)(new
|
|
70895
|
+
pipeline = (0, Pipeline_js_1.newPipeline)(new storage_common_1.AnonymousCredential(), options);
|
|
70840
70896
|
}
|
|
70841
70897
|
else {
|
|
70842
70898
|
throw new Error("Connection string must be either an Account connection string or a SAS connection string");
|
|
@@ -70913,7 +70969,7 @@ class BlockBlobClient extends BlobClient {
|
|
|
70913
70969
|
throw new Error("This operation currently is only supported in Node.js.");
|
|
70914
70970
|
}
|
|
70915
70971
|
return tracing_js_1.tracingClient.withSpan("BlockBlobClient-query", options, async (updatedOptions) => {
|
|
70916
|
-
const response = (0, utils_common_js_1.assertResponse)(await this._blobContext.query({
|
|
70972
|
+
const response = (0, utils_common_js_1.assertResponse)((await this._blobContext.query({
|
|
70917
70973
|
abortSignal: options.abortSignal,
|
|
70918
70974
|
queryRequest: {
|
|
70919
70975
|
queryType: "SQL",
|
|
@@ -70928,7 +70984,7 @@ class BlockBlobClient extends BlobClient {
|
|
|
70928
70984
|
},
|
|
70929
70985
|
cpkInfo: options.customerProvidedKey,
|
|
70930
70986
|
tracingOptions: updatedOptions.tracingOptions,
|
|
70931
|
-
}));
|
|
70987
|
+
})));
|
|
70932
70988
|
return new BlobQueryResponse_js_1.BlobQueryResponse(response, {
|
|
70933
70989
|
abortSignal: options.abortSignal,
|
|
70934
70990
|
onProgress: options.onProgress,
|
|
@@ -71383,7 +71439,7 @@ class BlockBlobClient extends BlobClient {
|
|
|
71383
71439
|
const blockIDPrefix = (0, core_util_2.randomUUID)();
|
|
71384
71440
|
let transferProgress = 0;
|
|
71385
71441
|
const blockList = [];
|
|
71386
|
-
const scheduler = new
|
|
71442
|
+
const scheduler = new storage_common_2.BufferScheduler(stream, bufferSize, maxConcurrency, async (body, length) => {
|
|
71387
71443
|
const blockID = (0, utils_common_js_1.generateBlockID)(blockIDPrefix, blockNum);
|
|
71388
71444
|
blockList.push(blockID);
|
|
71389
71445
|
blockNum++;
|
|
@@ -71435,8 +71491,8 @@ class PageBlobClient extends BlobClient {
|
|
|
71435
71491
|
url = urlOrConnectionString;
|
|
71436
71492
|
pipeline = credentialOrPipelineOrContainerName;
|
|
71437
71493
|
}
|
|
71438
|
-
else if ((core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof
|
|
71439
|
-
credentialOrPipelineOrContainerName instanceof
|
|
71494
|
+
else if ((core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof storage_common_1.StorageSharedKeyCredential) ||
|
|
71495
|
+
credentialOrPipelineOrContainerName instanceof storage_common_1.AnonymousCredential ||
|
|
71440
71496
|
(0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) {
|
|
71441
71497
|
// (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
|
|
71442
71498
|
url = urlOrConnectionString;
|
|
@@ -71448,7 +71504,7 @@ class PageBlobClient extends BlobClient {
|
|
|
71448
71504
|
// (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
|
|
71449
71505
|
// The second parameter is undefined. Use anonymous credential.
|
|
71450
71506
|
url = urlOrConnectionString;
|
|
71451
|
-
pipeline = (0, Pipeline_js_1.newPipeline)(new
|
|
71507
|
+
pipeline = (0, Pipeline_js_1.newPipeline)(new storage_common_1.AnonymousCredential(), options);
|
|
71452
71508
|
}
|
|
71453
71509
|
else if (credentialOrPipelineOrContainerName &&
|
|
71454
71510
|
typeof credentialOrPipelineOrContainerName === "string" &&
|
|
@@ -71460,7 +71516,7 @@ class PageBlobClient extends BlobClient {
|
|
|
71460
71516
|
const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString);
|
|
71461
71517
|
if (extractedCreds.kind === "AccountConnString") {
|
|
71462
71518
|
if (core_util_1.isNodeLike) {
|
|
71463
|
-
const sharedKeyCredential = new
|
|
71519
|
+
const sharedKeyCredential = new storage_common_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
|
|
71464
71520
|
url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));
|
|
71465
71521
|
if (!options.proxyOptions) {
|
|
71466
71522
|
options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri);
|
|
@@ -71476,7 +71532,7 @@ class PageBlobClient extends BlobClient {
|
|
|
71476
71532
|
(0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) +
|
|
71477
71533
|
"?" +
|
|
71478
71534
|
extractedCreds.accountSas;
|
|
71479
|
-
pipeline = (0, Pipeline_js_1.newPipeline)(new
|
|
71535
|
+
pipeline = (0, Pipeline_js_1.newPipeline)(new storage_common_1.AnonymousCredential(), options);
|
|
71480
71536
|
}
|
|
71481
71537
|
else {
|
|
71482
71538
|
throw new Error("Connection string must be either an Account connection string or a SAS connection string");
|
|
@@ -72188,8 +72244,7 @@ exports.ContainerClient = void 0;
|
|
|
72188
72244
|
const core_rest_pipeline_1 = __nccwpck_require__(20778);
|
|
72189
72245
|
const core_util_1 = __nccwpck_require__(87779);
|
|
72190
72246
|
const core_auth_1 = __nccwpck_require__(50417);
|
|
72191
|
-
const
|
|
72192
|
-
const StorageSharedKeyCredential_js_1 = __nccwpck_require__(68999);
|
|
72247
|
+
const storage_common_1 = __nccwpck_require__(51382);
|
|
72193
72248
|
const Pipeline_js_1 = __nccwpck_require__(25984);
|
|
72194
72249
|
const StorageClient_js_1 = __nccwpck_require__(73542);
|
|
72195
72250
|
const tracing_js_1 = __nccwpck_require__(53952);
|
|
@@ -72225,8 +72280,8 @@ class ContainerClient extends StorageClient_js_1.StorageClient {
|
|
|
72225
72280
|
url = urlOrConnectionString;
|
|
72226
72281
|
pipeline = credentialOrPipelineOrContainerName;
|
|
72227
72282
|
}
|
|
72228
|
-
else if ((core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof
|
|
72229
|
-
credentialOrPipelineOrContainerName instanceof
|
|
72283
|
+
else if ((core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof storage_common_1.StorageSharedKeyCredential) ||
|
|
72284
|
+
credentialOrPipelineOrContainerName instanceof storage_common_1.AnonymousCredential ||
|
|
72230
72285
|
(0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) {
|
|
72231
72286
|
// (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
|
|
72232
72287
|
url = urlOrConnectionString;
|
|
@@ -72237,7 +72292,7 @@ class ContainerClient extends StorageClient_js_1.StorageClient {
|
|
|
72237
72292
|
// (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
|
|
72238
72293
|
// The second parameter is undefined. Use anonymous credential.
|
|
72239
72294
|
url = urlOrConnectionString;
|
|
72240
|
-
pipeline = (0, Pipeline_js_1.newPipeline)(new
|
|
72295
|
+
pipeline = (0, Pipeline_js_1.newPipeline)(new storage_common_1.AnonymousCredential(), options);
|
|
72241
72296
|
}
|
|
72242
72297
|
else if (credentialOrPipelineOrContainerName &&
|
|
72243
72298
|
typeof credentialOrPipelineOrContainerName === "string") {
|
|
@@ -72246,7 +72301,7 @@ class ContainerClient extends StorageClient_js_1.StorageClient {
|
|
|
72246
72301
|
const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString);
|
|
72247
72302
|
if (extractedCreds.kind === "AccountConnString") {
|
|
72248
72303
|
if (core_util_1.isNodeLike) {
|
|
72249
|
-
const sharedKeyCredential = new
|
|
72304
|
+
const sharedKeyCredential = new storage_common_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
|
|
72250
72305
|
url = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName));
|
|
72251
72306
|
if (!options.proxyOptions) {
|
|
72252
72307
|
options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri);
|
|
@@ -72262,7 +72317,7 @@ class ContainerClient extends StorageClient_js_1.StorageClient {
|
|
|
72262
72317
|
(0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)) +
|
|
72263
72318
|
"?" +
|
|
72264
72319
|
extractedCreds.accountSas;
|
|
72265
|
-
pipeline = (0, Pipeline_js_1.newPipeline)(new
|
|
72320
|
+
pipeline = (0, Pipeline_js_1.newPipeline)(new storage_common_1.AnonymousCredential(), options);
|
|
72266
72321
|
}
|
|
72267
72322
|
else {
|
|
72268
72323
|
throw new Error("Connection string must be either an Account connection string or a SAS connection string");
|
|
@@ -73401,7 +73456,7 @@ class ContainerClient extends StorageClient_js_1.StorageClient {
|
|
|
73401
73456
|
*/
|
|
73402
73457
|
generateSasUrl(options) {
|
|
73403
73458
|
return new Promise((resolve) => {
|
|
73404
|
-
if (!(this.credential instanceof
|
|
73459
|
+
if (!(this.credential instanceof storage_common_1.StorageSharedKeyCredential)) {
|
|
73405
73460
|
throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
|
|
73406
73461
|
}
|
|
73407
73462
|
const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({
|
|
@@ -73424,7 +73479,7 @@ class ContainerClient extends StorageClient_js_1.StorageClient {
|
|
|
73424
73479
|
*/
|
|
73425
73480
|
/* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
|
|
73426
73481
|
generateSasStringToSign(options) {
|
|
73427
|
-
if (!(this.credential instanceof
|
|
73482
|
+
if (!(this.credential instanceof storage_common_1.StorageSharedKeyCredential)) {
|
|
73428
73483
|
throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
|
|
73429
73484
|
}
|
|
73430
73485
|
return (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParametersInternal)({
|
|
@@ -73543,17 +73598,9 @@ const core_client_1 = __nccwpck_require__(60160);
|
|
|
73543
73598
|
const core_xml_1 = __nccwpck_require__(78756);
|
|
73544
73599
|
const core_auth_1 = __nccwpck_require__(50417);
|
|
73545
73600
|
const log_js_1 = __nccwpck_require__(46370);
|
|
73546
|
-
const
|
|
73547
|
-
const StorageSharedKeyCredential_js_1 = __nccwpck_require__(68999);
|
|
73548
|
-
const AnonymousCredential_js_1 = __nccwpck_require__(35345);
|
|
73601
|
+
const storage_common_1 = __nccwpck_require__(51382);
|
|
73549
73602
|
const constants_js_1 = __nccwpck_require__(27323);
|
|
73550
73603
|
Object.defineProperty(exports, "StorageOAuthScopes", ({ enumerable: true, get: function () { return constants_js_1.StorageOAuthScopes; } }));
|
|
73551
|
-
const storage_common_1 = __nccwpck_require__(51382);
|
|
73552
|
-
const StorageBrowserPolicyV2_js_1 = __nccwpck_require__(490);
|
|
73553
|
-
const StorageRetryPolicyV2_js_1 = __nccwpck_require__(31160);
|
|
73554
|
-
const StorageSharedKeyCredentialPolicyV2_js_1 = __nccwpck_require__(97999);
|
|
73555
|
-
const StorageBrowserPolicyFactory_js_1 = __nccwpck_require__(31821);
|
|
73556
|
-
const StorageCorrectContentLengthPolicy_js_1 = __nccwpck_require__(99359);
|
|
73557
73604
|
/**
|
|
73558
73605
|
* A helper to decide if a given argument satisfies the Pipeline contract
|
|
73559
73606
|
* @param pipeline - An argument that may be a Pipeline
|
|
@@ -73618,7 +73665,7 @@ exports.Pipeline = Pipeline;
|
|
|
73618
73665
|
*/
|
|
73619
73666
|
function newPipeline(credential, pipelineOptions = {}) {
|
|
73620
73667
|
if (!credential) {
|
|
73621
|
-
credential = new
|
|
73668
|
+
credential = new storage_common_1.AnonymousCredential();
|
|
73622
73669
|
}
|
|
73623
73670
|
const pipeline = new Pipeline([], pipelineOptions);
|
|
73624
73671
|
pipeline._credential = credential;
|
|
@@ -73695,10 +73742,10 @@ function getCoreClientOptions(pipeline) {
|
|
|
73695
73742
|
});
|
|
73696
73743
|
corePipeline.removePolicy({ phase: "Retry" });
|
|
73697
73744
|
corePipeline.removePolicy({ name: core_rest_pipeline_1.decompressResponsePolicyName });
|
|
73698
|
-
corePipeline.addPolicy((0,
|
|
73699
|
-
corePipeline.addPolicy((0,
|
|
73745
|
+
corePipeline.addPolicy((0, storage_common_1.storageCorrectContentLengthPolicy)());
|
|
73746
|
+
corePipeline.addPolicy((0, storage_common_1.storageRetryPolicy)(restOptions.retryOptions), { phase: "Retry" });
|
|
73700
73747
|
corePipeline.addPolicy((0, storage_common_1.storageRequestFailureDetailsParserPolicy)());
|
|
73701
|
-
corePipeline.addPolicy((0,
|
|
73748
|
+
corePipeline.addPolicy((0, storage_common_1.storageBrowserPolicy)());
|
|
73702
73749
|
const downlevelResults = processDownlevelPipeline(pipeline);
|
|
73703
73750
|
if (downlevelResults) {
|
|
73704
73751
|
corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : undefined);
|
|
@@ -73711,8 +73758,8 @@ function getCoreClientOptions(pipeline) {
|
|
|
73711
73758
|
challengeCallbacks: { authorizeRequestOnChallenge: core_client_1.authorizeRequestOnTenantChallenge },
|
|
73712
73759
|
}), { phase: "Sign" });
|
|
73713
73760
|
}
|
|
73714
|
-
else if (credential instanceof
|
|
73715
|
-
corePipeline.addPolicy((0,
|
|
73761
|
+
else if (credential instanceof storage_common_1.StorageSharedKeyCredential) {
|
|
73762
|
+
corePipeline.addPolicy((0, storage_common_1.storageSharedKeyCredentialPolicy)({
|
|
73716
73763
|
accountName: credential.accountName,
|
|
73717
73764
|
accountKey: credential.accountKey,
|
|
73718
73765
|
}), { phase: "Sign" });
|
|
@@ -73732,7 +73779,7 @@ function getCredentialFromPipeline(pipeline) {
|
|
|
73732
73779
|
return pipeline._credential;
|
|
73733
73780
|
}
|
|
73734
73781
|
// if it came from another package, loop over the factories and look for one like before
|
|
73735
|
-
let credential = new
|
|
73782
|
+
let credential = new storage_common_1.AnonymousCredential();
|
|
73736
73783
|
for (const factory of pipeline.factories) {
|
|
73737
73784
|
if ((0, core_auth_1.isTokenCredential)(factory.credential)) {
|
|
73738
73785
|
// Only works if the factory has been attached a "credential" property.
|
|
@@ -73746,13 +73793,13 @@ function getCredentialFromPipeline(pipeline) {
|
|
|
73746
73793
|
return credential;
|
|
73747
73794
|
}
|
|
73748
73795
|
function isStorageSharedKeyCredential(factory) {
|
|
73749
|
-
if (factory instanceof
|
|
73796
|
+
if (factory instanceof storage_common_1.StorageSharedKeyCredential) {
|
|
73750
73797
|
return true;
|
|
73751
73798
|
}
|
|
73752
73799
|
return factory.constructor.name === "StorageSharedKeyCredential";
|
|
73753
73800
|
}
|
|
73754
73801
|
function isAnonymousCredential(factory) {
|
|
73755
|
-
if (factory instanceof
|
|
73802
|
+
if (factory instanceof storage_common_1.AnonymousCredential) {
|
|
73756
73803
|
return true;
|
|
73757
73804
|
}
|
|
73758
73805
|
return factory.constructor.name === "AnonymousCredential";
|
|
@@ -73761,13 +73808,13 @@ function isCoreHttpBearerTokenFactory(factory) {
|
|
|
73761
73808
|
return (0, core_auth_1.isTokenCredential)(factory.credential);
|
|
73762
73809
|
}
|
|
73763
73810
|
function isStorageBrowserPolicyFactory(factory) {
|
|
73764
|
-
if (factory instanceof
|
|
73811
|
+
if (factory instanceof storage_common_1.StorageBrowserPolicyFactory) {
|
|
73765
73812
|
return true;
|
|
73766
73813
|
}
|
|
73767
73814
|
return factory.constructor.name === "StorageBrowserPolicyFactory";
|
|
73768
73815
|
}
|
|
73769
73816
|
function isStorageRetryPolicyFactory(factory) {
|
|
73770
|
-
if (factory instanceof
|
|
73817
|
+
if (factory instanceof storage_common_1.StorageRetryPolicyFactory) {
|
|
73771
73818
|
return true;
|
|
73772
73819
|
}
|
|
73773
73820
|
return factory.constructor.name === "StorageRetryPolicyFactory";
|
|
@@ -73847,36 +73894,6 @@ function rangeToString(iRange) {
|
|
|
73847
73894
|
|
|
73848
73895
|
/***/ }),
|
|
73849
73896
|
|
|
73850
|
-
/***/ 31821:
|
|
73851
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
73852
|
-
|
|
73853
|
-
"use strict";
|
|
73854
|
-
|
|
73855
|
-
// Copyright (c) Microsoft Corporation.
|
|
73856
|
-
// Licensed under the MIT License.
|
|
73857
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
73858
|
-
exports.StorageBrowserPolicyFactory = exports.StorageBrowserPolicy = void 0;
|
|
73859
|
-
const StorageBrowserPolicy_js_1 = __nccwpck_require__(78654);
|
|
73860
|
-
Object.defineProperty(exports, "StorageBrowserPolicy", ({ enumerable: true, get: function () { return StorageBrowserPolicy_js_1.StorageBrowserPolicy; } }));
|
|
73861
|
-
/**
|
|
73862
|
-
* StorageBrowserPolicyFactory is a factory class helping generating StorageBrowserPolicy objects.
|
|
73863
|
-
*/
|
|
73864
|
-
class StorageBrowserPolicyFactory {
|
|
73865
|
-
/**
|
|
73866
|
-
* Creates a StorageBrowserPolicyFactory object.
|
|
73867
|
-
*
|
|
73868
|
-
* @param nextPolicy -
|
|
73869
|
-
* @param options -
|
|
73870
|
-
*/
|
|
73871
|
-
create(nextPolicy, options) {
|
|
73872
|
-
return new StorageBrowserPolicy_js_1.StorageBrowserPolicy(nextPolicy, options);
|
|
73873
|
-
}
|
|
73874
|
-
}
|
|
73875
|
-
exports.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory;
|
|
73876
|
-
//# sourceMappingURL=StorageBrowserPolicyFactory.js.map
|
|
73877
|
-
|
|
73878
|
-
/***/ }),
|
|
73879
|
-
|
|
73880
73897
|
/***/ 73542:
|
|
73881
73898
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
73882
73899
|
|
|
@@ -73968,221 +73985,6 @@ exports.StorageContextClient = StorageContextClient;
|
|
|
73968
73985
|
|
|
73969
73986
|
/***/ }),
|
|
73970
73987
|
|
|
73971
|
-
/***/ 98335:
|
|
73972
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
73973
|
-
|
|
73974
|
-
"use strict";
|
|
73975
|
-
|
|
73976
|
-
// Copyright (c) Microsoft Corporation.
|
|
73977
|
-
// Licensed under the MIT License.
|
|
73978
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
73979
|
-
exports.StorageRetryPolicyFactory = exports.StorageRetryPolicy = exports.StorageRetryPolicyType = void 0;
|
|
73980
|
-
const StorageRetryPolicy_js_1 = __nccwpck_require__(57996);
|
|
73981
|
-
Object.defineProperty(exports, "StorageRetryPolicy", ({ enumerable: true, get: function () { return StorageRetryPolicy_js_1.StorageRetryPolicy; } }));
|
|
73982
|
-
const StorageRetryPolicyType_js_1 = __nccwpck_require__(16308);
|
|
73983
|
-
Object.defineProperty(exports, "StorageRetryPolicyType", ({ enumerable: true, get: function () { return StorageRetryPolicyType_js_1.StorageRetryPolicyType; } }));
|
|
73984
|
-
/**
|
|
73985
|
-
* StorageRetryPolicyFactory is a factory class helping generating {@link StorageRetryPolicy} objects.
|
|
73986
|
-
*/
|
|
73987
|
-
class StorageRetryPolicyFactory {
|
|
73988
|
-
retryOptions;
|
|
73989
|
-
/**
|
|
73990
|
-
* Creates an instance of StorageRetryPolicyFactory.
|
|
73991
|
-
* @param retryOptions -
|
|
73992
|
-
*/
|
|
73993
|
-
constructor(retryOptions) {
|
|
73994
|
-
this.retryOptions = retryOptions;
|
|
73995
|
-
}
|
|
73996
|
-
/**
|
|
73997
|
-
* Creates a StorageRetryPolicy object.
|
|
73998
|
-
*
|
|
73999
|
-
* @param nextPolicy -
|
|
74000
|
-
* @param options -
|
|
74001
|
-
*/
|
|
74002
|
-
create(nextPolicy, options) {
|
|
74003
|
-
return new StorageRetryPolicy_js_1.StorageRetryPolicy(nextPolicy, options, this.retryOptions);
|
|
74004
|
-
}
|
|
74005
|
-
}
|
|
74006
|
-
exports.StorageRetryPolicyFactory = StorageRetryPolicyFactory;
|
|
74007
|
-
//# sourceMappingURL=StorageRetryPolicyFactory.js.map
|
|
74008
|
-
|
|
74009
|
-
/***/ }),
|
|
74010
|
-
|
|
74011
|
-
/***/ 35345:
|
|
74012
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
74013
|
-
|
|
74014
|
-
"use strict";
|
|
74015
|
-
|
|
74016
|
-
// Copyright (c) Microsoft Corporation.
|
|
74017
|
-
// Licensed under the MIT License.
|
|
74018
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
74019
|
-
exports.AnonymousCredential = void 0;
|
|
74020
|
-
const AnonymousCredentialPolicy_js_1 = __nccwpck_require__(13501);
|
|
74021
|
-
const Credential_js_1 = __nccwpck_require__(52596);
|
|
74022
|
-
/**
|
|
74023
|
-
* AnonymousCredential provides a credentialPolicyCreator member used to create
|
|
74024
|
-
* AnonymousCredentialPolicy objects. AnonymousCredentialPolicy is used with
|
|
74025
|
-
* HTTP(S) requests that read public resources or for use with Shared Access
|
|
74026
|
-
* Signatures (SAS).
|
|
74027
|
-
*/
|
|
74028
|
-
class AnonymousCredential extends Credential_js_1.Credential {
|
|
74029
|
-
/**
|
|
74030
|
-
* Creates an {@link AnonymousCredentialPolicy} object.
|
|
74031
|
-
*
|
|
74032
|
-
* @param nextPolicy -
|
|
74033
|
-
* @param options -
|
|
74034
|
-
*/
|
|
74035
|
-
create(nextPolicy, options) {
|
|
74036
|
-
return new AnonymousCredentialPolicy_js_1.AnonymousCredentialPolicy(nextPolicy, options);
|
|
74037
|
-
}
|
|
74038
|
-
}
|
|
74039
|
-
exports.AnonymousCredential = AnonymousCredential;
|
|
74040
|
-
//# sourceMappingURL=AnonymousCredential.js.map
|
|
74041
|
-
|
|
74042
|
-
/***/ }),
|
|
74043
|
-
|
|
74044
|
-
/***/ 52596:
|
|
74045
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
74046
|
-
|
|
74047
|
-
"use strict";
|
|
74048
|
-
|
|
74049
|
-
// Copyright (c) Microsoft Corporation.
|
|
74050
|
-
// Licensed under the MIT License.
|
|
74051
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
74052
|
-
exports.Credential = void 0;
|
|
74053
|
-
/**
|
|
74054
|
-
* Credential is an abstract class for Azure Storage HTTP requests signing. This
|
|
74055
|
-
* class will host an credentialPolicyCreator factory which generates CredentialPolicy.
|
|
74056
|
-
*/
|
|
74057
|
-
class Credential {
|
|
74058
|
-
/**
|
|
74059
|
-
* Creates a RequestPolicy object.
|
|
74060
|
-
*
|
|
74061
|
-
* @param _nextPolicy -
|
|
74062
|
-
* @param _options -
|
|
74063
|
-
*/
|
|
74064
|
-
create(_nextPolicy, _options) {
|
|
74065
|
-
throw new Error("Method should be implemented in children classes.");
|
|
74066
|
-
}
|
|
74067
|
-
}
|
|
74068
|
-
exports.Credential = Credential;
|
|
74069
|
-
//# sourceMappingURL=Credential.js.map
|
|
74070
|
-
|
|
74071
|
-
/***/ }),
|
|
74072
|
-
|
|
74073
|
-
/***/ 68999:
|
|
74074
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
74075
|
-
|
|
74076
|
-
"use strict";
|
|
74077
|
-
|
|
74078
|
-
// Copyright (c) Microsoft Corporation.
|
|
74079
|
-
// Licensed under the MIT License.
|
|
74080
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
74081
|
-
exports.StorageSharedKeyCredential = void 0;
|
|
74082
|
-
const node_crypto_1 = __nccwpck_require__(77598);
|
|
74083
|
-
const StorageSharedKeyCredentialPolicy_js_1 = __nccwpck_require__(45511);
|
|
74084
|
-
const Credential_js_1 = __nccwpck_require__(52596);
|
|
74085
|
-
/**
|
|
74086
|
-
* ONLY AVAILABLE IN NODE.JS RUNTIME.
|
|
74087
|
-
*
|
|
74088
|
-
* StorageSharedKeyCredential for account key authorization of Azure Storage service.
|
|
74089
|
-
*/
|
|
74090
|
-
class StorageSharedKeyCredential extends Credential_js_1.Credential {
|
|
74091
|
-
/**
|
|
74092
|
-
* Azure Storage account name; readonly.
|
|
74093
|
-
*/
|
|
74094
|
-
accountName;
|
|
74095
|
-
/**
|
|
74096
|
-
* Azure Storage account key; readonly.
|
|
74097
|
-
*/
|
|
74098
|
-
accountKey;
|
|
74099
|
-
/**
|
|
74100
|
-
* Creates an instance of StorageSharedKeyCredential.
|
|
74101
|
-
* @param accountName -
|
|
74102
|
-
* @param accountKey -
|
|
74103
|
-
*/
|
|
74104
|
-
constructor(accountName, accountKey) {
|
|
74105
|
-
super();
|
|
74106
|
-
this.accountName = accountName;
|
|
74107
|
-
this.accountKey = Buffer.from(accountKey, "base64");
|
|
74108
|
-
}
|
|
74109
|
-
/**
|
|
74110
|
-
* Creates a StorageSharedKeyCredentialPolicy object.
|
|
74111
|
-
*
|
|
74112
|
-
* @param nextPolicy -
|
|
74113
|
-
* @param options -
|
|
74114
|
-
*/
|
|
74115
|
-
create(nextPolicy, options) {
|
|
74116
|
-
return new StorageSharedKeyCredentialPolicy_js_1.StorageSharedKeyCredentialPolicy(nextPolicy, options, this);
|
|
74117
|
-
}
|
|
74118
|
-
/**
|
|
74119
|
-
* Generates a hash signature for an HTTP request or for a SAS.
|
|
74120
|
-
*
|
|
74121
|
-
* @param stringToSign -
|
|
74122
|
-
*/
|
|
74123
|
-
computeHMACSHA256(stringToSign) {
|
|
74124
|
-
return (0, node_crypto_1.createHmac)("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64");
|
|
74125
|
-
}
|
|
74126
|
-
}
|
|
74127
|
-
exports.StorageSharedKeyCredential = StorageSharedKeyCredential;
|
|
74128
|
-
//# sourceMappingURL=StorageSharedKeyCredential.js.map
|
|
74129
|
-
|
|
74130
|
-
/***/ }),
|
|
74131
|
-
|
|
74132
|
-
/***/ 10992:
|
|
74133
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
74134
|
-
|
|
74135
|
-
"use strict";
|
|
74136
|
-
|
|
74137
|
-
// Copyright (c) Microsoft Corporation.
|
|
74138
|
-
// Licensed under the MIT License.
|
|
74139
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
74140
|
-
exports.UserDelegationKeyCredential = void 0;
|
|
74141
|
-
const node_crypto_1 = __nccwpck_require__(77598);
|
|
74142
|
-
/**
|
|
74143
|
-
* ONLY AVAILABLE IN NODE.JS RUNTIME.
|
|
74144
|
-
*
|
|
74145
|
-
* UserDelegationKeyCredential is only used for generation of user delegation SAS.
|
|
74146
|
-
* @see https://learn.microsoft.com/rest/api/storageservices/create-user-delegation-sas
|
|
74147
|
-
*/
|
|
74148
|
-
class UserDelegationKeyCredential {
|
|
74149
|
-
/**
|
|
74150
|
-
* Azure Storage account name; readonly.
|
|
74151
|
-
*/
|
|
74152
|
-
accountName;
|
|
74153
|
-
/**
|
|
74154
|
-
* Azure Storage user delegation key; readonly.
|
|
74155
|
-
*/
|
|
74156
|
-
userDelegationKey;
|
|
74157
|
-
/**
|
|
74158
|
-
* Key value in Buffer type.
|
|
74159
|
-
*/
|
|
74160
|
-
key;
|
|
74161
|
-
/**
|
|
74162
|
-
* Creates an instance of UserDelegationKeyCredential.
|
|
74163
|
-
* @param accountName -
|
|
74164
|
-
* @param userDelegationKey -
|
|
74165
|
-
*/
|
|
74166
|
-
constructor(accountName, userDelegationKey) {
|
|
74167
|
-
this.accountName = accountName;
|
|
74168
|
-
this.userDelegationKey = userDelegationKey;
|
|
74169
|
-
this.key = Buffer.from(userDelegationKey.value, "base64");
|
|
74170
|
-
}
|
|
74171
|
-
/**
|
|
74172
|
-
* Generates a hash signature for an HTTP request or for a SAS.
|
|
74173
|
-
*
|
|
74174
|
-
* @param stringToSign -
|
|
74175
|
-
*/
|
|
74176
|
-
computeHMACSHA256(stringToSign) {
|
|
74177
|
-
// console.log(`stringToSign: ${JSON.stringify(stringToSign)}`);
|
|
74178
|
-
return (0, node_crypto_1.createHmac)("sha256", this.key).update(stringToSign, "utf8").digest("base64");
|
|
74179
|
-
}
|
|
74180
|
-
}
|
|
74181
|
-
exports.UserDelegationKeyCredential = UserDelegationKeyCredential;
|
|
74182
|
-
//# sourceMappingURL=UserDelegationKeyCredential.js.map
|
|
74183
|
-
|
|
74184
|
-
/***/ }),
|
|
74185
|
-
|
|
74186
73988
|
/***/ 30247:
|
|
74187
73989
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
74188
73990
|
|
|
@@ -82837,8 +82639,8 @@ exports.BlockBlobGetBlockListExceptionHeaders = {
|
|
|
82837
82639
|
*/
|
|
82838
82640
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
82839
82641
|
exports.action3 = exports.action2 = exports.leaseId1 = exports.action1 = exports.proposedLeaseId = exports.duration = exports.action = exports.comp10 = exports.sourceLeaseId = exports.sourceContainerName = exports.comp9 = exports.deletedContainerVersion = exports.deletedContainerName = exports.comp8 = exports.containerAcl = exports.comp7 = exports.comp6 = exports.ifUnmodifiedSince = exports.ifModifiedSince = exports.leaseId = exports.preventEncryptionScopeOverride = exports.defaultEncryptionScope = exports.access = exports.metadata = exports.restype2 = exports.where = exports.comp5 = exports.multipartContentType = exports.contentLength = exports.comp4 = exports.body = exports.restype1 = exports.comp3 = exports.keyInfo = exports.include = exports.maxPageSize = exports.marker = exports.prefix = exports.comp2 = exports.comp1 = exports.accept1 = exports.requestId = exports.version = exports.timeoutInSeconds = exports.comp = exports.restype = exports.url = exports.accept = exports.blobServiceProperties = exports.contentType = void 0;
|
|
82840
|
-
exports.
|
|
82841
|
-
exports.listType = exports.comp25 = exports.blocks = exports.blockId = exports.comp24 = exports.copySourceBlobProperties = exports.blobType2 = exports.comp23 = exports.sourceRange1 = exports.appendPosition = exports.maxSize = exports.comp22 = exports.blobType1 = exports.comp21 = exports.sequenceNumberAction = exports.prevSnapshotUrl = exports.prevsnapshot = exports.comp20 = exports.range1 = exports.sourceContentCrc64 = exports.sourceRange = exports.sourceUrl = exports.pageWrite1 = exports.ifSequenceNumberEqualTo = exports.ifSequenceNumberLessThan = exports.ifSequenceNumberLessThanOrEqualTo = exports.pageWrite = exports.comp19 = exports.accept2 = exports.body1 = exports.contentType1 = exports.blobSequenceNumber = exports.blobContentLength = exports.blobType = exports.transactionalContentCrc64 = exports.transactionalContentMD5 = exports.tags = exports.comp18 = exports.comp17 = exports.queryRequest = exports.tier1 = exports.comp16 = exports.copyId = exports.copyActionAbortConstant = exports.comp15 = void 0;
|
|
82642
|
+
exports.copySourceTags = exports.copySourceAuthorization = exports.sourceContentMD5 = exports.xMsRequiresSync = exports.legalHold1 = exports.sealBlob = exports.blobTagsString = exports.copySource = exports.sourceIfTags = exports.sourceIfNoneMatch = exports.sourceIfMatch = exports.sourceIfUnmodifiedSince = exports.sourceIfModifiedSince = exports.rehydratePriority = exports.tier = exports.comp14 = exports.encryptionScope = exports.legalHold = exports.comp13 = exports.immutabilityPolicyMode = exports.immutabilityPolicyExpiry = exports.comp12 = exports.blobContentDisposition = exports.blobContentLanguage = exports.blobContentEncoding = exports.blobContentMD5 = exports.blobContentType = exports.blobCacheControl = exports.expiresOn = exports.expiryOptions = exports.comp11 = exports.blobDeleteType = exports.deleteSnapshots = exports.ifTags = exports.ifNoneMatch = exports.ifMatch = exports.encryptionAlgorithm = exports.encryptionKeySha256 = exports.encryptionKey = exports.rangeGetContentCRC64 = exports.rangeGetContentMD5 = exports.range = exports.versionId = exports.snapshot = exports.delimiter = exports.startFrom = exports.include1 = exports.proposedLeaseId1 = exports.action4 = exports.breakPeriod = void 0;
|
|
82643
|
+
exports.listType = exports.comp25 = exports.blocks = exports.blockId = exports.comp24 = exports.copySourceBlobProperties = exports.blobType2 = exports.comp23 = exports.sourceRange1 = exports.appendPosition = exports.maxSize = exports.comp22 = exports.blobType1 = exports.comp21 = exports.sequenceNumberAction = exports.prevSnapshotUrl = exports.prevsnapshot = exports.comp20 = exports.range1 = exports.sourceContentCrc64 = exports.sourceRange = exports.sourceUrl = exports.pageWrite1 = exports.ifSequenceNumberEqualTo = exports.ifSequenceNumberLessThan = exports.ifSequenceNumberLessThanOrEqualTo = exports.pageWrite = exports.comp19 = exports.accept2 = exports.body1 = exports.contentType1 = exports.blobSequenceNumber = exports.blobContentLength = exports.blobType = exports.transactionalContentCrc64 = exports.transactionalContentMD5 = exports.tags = exports.ifNoneMatch1 = exports.ifMatch1 = exports.ifUnmodifiedSince1 = exports.ifModifiedSince1 = exports.comp18 = exports.comp17 = exports.queryRequest = exports.tier1 = exports.comp16 = exports.copyId = exports.copyActionAbortConstant = exports.comp15 = exports.fileRequestIntent = void 0;
|
|
82842
82644
|
const mappers_js_1 = __nccwpck_require__(84424);
|
|
82843
82645
|
exports.contentType = {
|
|
82844
82646
|
parameterPath: ["options", "contentType"],
|
|
@@ -82916,7 +82718,7 @@ exports.timeoutInSeconds = {
|
|
|
82916
82718
|
exports.version = {
|
|
82917
82719
|
parameterPath: "version",
|
|
82918
82720
|
mapper: {
|
|
82919
|
-
defaultValue: "
|
|
82721
|
+
defaultValue: "2026-02-06",
|
|
82920
82722
|
isConstant: true,
|
|
82921
82723
|
serializedName: "x-ms-version",
|
|
82922
82724
|
type: {
|
|
@@ -83451,6 +83253,16 @@ exports.include1 = {
|
|
|
83451
83253
|
},
|
|
83452
83254
|
collectionFormat: "CSV",
|
|
83453
83255
|
};
|
|
83256
|
+
exports.startFrom = {
|
|
83257
|
+
parameterPath: ["options", "startFrom"],
|
|
83258
|
+
mapper: {
|
|
83259
|
+
serializedName: "startFrom",
|
|
83260
|
+
xmlName: "startFrom",
|
|
83261
|
+
type: {
|
|
83262
|
+
name: "String",
|
|
83263
|
+
},
|
|
83264
|
+
},
|
|
83265
|
+
};
|
|
83454
83266
|
exports.delimiter = {
|
|
83455
83267
|
parameterPath: "delimiter",
|
|
83456
83268
|
mapper: {
|
|
@@ -84051,6 +83863,50 @@ exports.comp18 = {
|
|
|
84051
83863
|
},
|
|
84052
83864
|
},
|
|
84053
83865
|
};
|
|
83866
|
+
exports.ifModifiedSince1 = {
|
|
83867
|
+
parameterPath: ["options", "blobModifiedAccessConditions", "ifModifiedSince"],
|
|
83868
|
+
mapper: {
|
|
83869
|
+
serializedName: "x-ms-blob-if-modified-since",
|
|
83870
|
+
xmlName: "x-ms-blob-if-modified-since",
|
|
83871
|
+
type: {
|
|
83872
|
+
name: "DateTimeRfc1123",
|
|
83873
|
+
},
|
|
83874
|
+
},
|
|
83875
|
+
};
|
|
83876
|
+
exports.ifUnmodifiedSince1 = {
|
|
83877
|
+
parameterPath: [
|
|
83878
|
+
"options",
|
|
83879
|
+
"blobModifiedAccessConditions",
|
|
83880
|
+
"ifUnmodifiedSince",
|
|
83881
|
+
],
|
|
83882
|
+
mapper: {
|
|
83883
|
+
serializedName: "x-ms-blob-if-unmodified-since",
|
|
83884
|
+
xmlName: "x-ms-blob-if-unmodified-since",
|
|
83885
|
+
type: {
|
|
83886
|
+
name: "DateTimeRfc1123",
|
|
83887
|
+
},
|
|
83888
|
+
},
|
|
83889
|
+
};
|
|
83890
|
+
exports.ifMatch1 = {
|
|
83891
|
+
parameterPath: ["options", "blobModifiedAccessConditions", "ifMatch"],
|
|
83892
|
+
mapper: {
|
|
83893
|
+
serializedName: "x-ms-blob-if-match",
|
|
83894
|
+
xmlName: "x-ms-blob-if-match",
|
|
83895
|
+
type: {
|
|
83896
|
+
name: "String",
|
|
83897
|
+
},
|
|
83898
|
+
},
|
|
83899
|
+
};
|
|
83900
|
+
exports.ifNoneMatch1 = {
|
|
83901
|
+
parameterPath: ["options", "blobModifiedAccessConditions", "ifNoneMatch"],
|
|
83902
|
+
mapper: {
|
|
83903
|
+
serializedName: "x-ms-blob-if-none-match",
|
|
83904
|
+
xmlName: "x-ms-blob-if-none-match",
|
|
83905
|
+
type: {
|
|
83906
|
+
name: "String",
|
|
83907
|
+
},
|
|
83908
|
+
},
|
|
83909
|
+
};
|
|
84054
83910
|
exports.tags = {
|
|
84055
83911
|
parameterPath: ["options", "tags"],
|
|
84056
83912
|
mapper: mappers_js_1.BlobTags,
|
|
@@ -85682,6 +85538,10 @@ const getTagsOperationSpec = {
|
|
|
85682
85538
|
Parameters.accept1,
|
|
85683
85539
|
Parameters.leaseId,
|
|
85684
85540
|
Parameters.ifTags,
|
|
85541
|
+
Parameters.ifModifiedSince1,
|
|
85542
|
+
Parameters.ifUnmodifiedSince1,
|
|
85543
|
+
Parameters.ifMatch1,
|
|
85544
|
+
Parameters.ifNoneMatch1,
|
|
85685
85545
|
],
|
|
85686
85546
|
isXML: true,
|
|
85687
85547
|
serializer: xmlSerializer,
|
|
@@ -85712,6 +85572,10 @@ const setTagsOperationSpec = {
|
|
|
85712
85572
|
Parameters.requestId,
|
|
85713
85573
|
Parameters.leaseId,
|
|
85714
85574
|
Parameters.ifTags,
|
|
85575
|
+
Parameters.ifModifiedSince1,
|
|
85576
|
+
Parameters.ifUnmodifiedSince1,
|
|
85577
|
+
Parameters.ifMatch1,
|
|
85578
|
+
Parameters.ifNoneMatch1,
|
|
85715
85579
|
Parameters.transactionalContentMD5,
|
|
85716
85580
|
Parameters.transactionalContentCrc64,
|
|
85717
85581
|
],
|
|
@@ -86758,6 +86622,7 @@ const listBlobFlatSegmentOperationSpec = {
|
|
|
86758
86622
|
Parameters.maxPageSize,
|
|
86759
86623
|
Parameters.restype2,
|
|
86760
86624
|
Parameters.include1,
|
|
86625
|
+
Parameters.startFrom,
|
|
86761
86626
|
],
|
|
86762
86627
|
urlParameters: [Parameters.url],
|
|
86763
86628
|
headerParameters: [
|
|
@@ -86789,6 +86654,7 @@ const listBlobHierarchySegmentOperationSpec = {
|
|
|
86789
86654
|
Parameters.maxPageSize,
|
|
86790
86655
|
Parameters.restype2,
|
|
86791
86656
|
Parameters.include1,
|
|
86657
|
+
Parameters.startFrom,
|
|
86792
86658
|
Parameters.delimiter,
|
|
86793
86659
|
],
|
|
86794
86660
|
urlParameters: [Parameters.url],
|
|
@@ -87823,7 +87689,7 @@ class StorageClient extends coreHttpCompat.ExtendedServiceClient {
|
|
|
87823
87689
|
const defaults = {
|
|
87824
87690
|
requestContentType: "application/json; charset=utf-8",
|
|
87825
87691
|
};
|
|
87826
|
-
const packageDetails = `azsdk-js-azure-storage-blob/12.
|
|
87692
|
+
const packageDetails = `azsdk-js-azure-storage-blob/12.30.0`;
|
|
87827
87693
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
87828
87694
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
87829
87695
|
: `${packageDetails}`;
|
|
@@ -87839,7 +87705,7 @@ class StorageClient extends coreHttpCompat.ExtendedServiceClient {
|
|
|
87839
87705
|
// Parameter assignments
|
|
87840
87706
|
this.url = url;
|
|
87841
87707
|
// Assigning values to Constant parameters
|
|
87842
|
-
this.version = options.version || "
|
|
87708
|
+
this.version = options.version || "2026-02-06";
|
|
87843
87709
|
this.service = new index_js_1.ServiceImpl(this);
|
|
87844
87710
|
this.container = new index_js_1.ContainerImpl(this);
|
|
87845
87711
|
this.blob = new index_js_1.BlobImpl(this);
|
|
@@ -87885,7 +87751,7 @@ var KnownEncryptionAlgorithmType;
|
|
|
87885
87751
|
// Copyright (c) Microsoft Corporation.
|
|
87886
87752
|
// Licensed under the MIT License.
|
|
87887
87753
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
87888
|
-
exports.logger = exports.RestError = exports.BaseRequestPolicy = exports.StorageOAuthScopes = exports.newPipeline = exports.isPipelineLike = exports.Pipeline = exports.getBlobServiceAccountAudience = exports.StorageBlobAudience = exports.PremiumPageBlobTier = exports.BlockBlobTier = exports.generateBlobSASQueryParameters = exports.generateAccountSASQueryParameters = void 0;
|
|
87754
|
+
exports.logger = exports.RestError = exports.StorageBrowserPolicyFactory = exports.StorageBrowserPolicy = exports.StorageSharedKeyCredentialPolicy = exports.StorageSharedKeyCredential = exports.StorageRetryPolicyFactory = exports.StorageRetryPolicy = exports.StorageRetryPolicyType = exports.Credential = exports.CredentialPolicy = exports.BaseRequestPolicy = exports.AnonymousCredentialPolicy = exports.AnonymousCredential = exports.StorageOAuthScopes = exports.newPipeline = exports.isPipelineLike = exports.Pipeline = exports.getBlobServiceAccountAudience = exports.StorageBlobAudience = exports.PremiumPageBlobTier = exports.BlockBlobTier = exports.generateBlobSASQueryParameters = exports.generateAccountSASQueryParameters = void 0;
|
|
87889
87755
|
const tslib_1 = __nccwpck_require__(61860);
|
|
87890
87756
|
const core_rest_pipeline_1 = __nccwpck_require__(20778);
|
|
87891
87757
|
Object.defineProperty(exports, "RestError", ({ enumerable: true, get: function () { return core_rest_pipeline_1.RestError; } }));
|
|
@@ -87904,11 +87770,7 @@ tslib_1.__exportStar(__nccwpck_require__(48175), exports);
|
|
|
87904
87770
|
tslib_1.__exportStar(__nccwpck_require__(2232), exports);
|
|
87905
87771
|
var BlobSASSignatureValues_js_1 = __nccwpck_require__(656);
|
|
87906
87772
|
Object.defineProperty(exports, "generateBlobSASQueryParameters", ({ enumerable: true, get: function () { return BlobSASSignatureValues_js_1.generateBlobSASQueryParameters; } }));
|
|
87907
|
-
tslib_1.__exportStar(__nccwpck_require__(31821), exports);
|
|
87908
87773
|
tslib_1.__exportStar(__nccwpck_require__(51622), exports);
|
|
87909
|
-
tslib_1.__exportStar(__nccwpck_require__(35345), exports);
|
|
87910
|
-
tslib_1.__exportStar(__nccwpck_require__(52596), exports);
|
|
87911
|
-
tslib_1.__exportStar(__nccwpck_require__(68999), exports);
|
|
87912
87774
|
var models_js_1 = __nccwpck_require__(58560);
|
|
87913
87775
|
Object.defineProperty(exports, "BlockBlobTier", ({ enumerable: true, get: function () { return models_js_1.BlockBlobTier; } }));
|
|
87914
87776
|
Object.defineProperty(exports, "PremiumPageBlobTier", ({ enumerable: true, get: function () { return models_js_1.PremiumPageBlobTier; } }));
|
|
@@ -87919,13 +87781,19 @@ Object.defineProperty(exports, "Pipeline", ({ enumerable: true, get: function ()
|
|
|
87919
87781
|
Object.defineProperty(exports, "isPipelineLike", ({ enumerable: true, get: function () { return Pipeline_js_1.isPipelineLike; } }));
|
|
87920
87782
|
Object.defineProperty(exports, "newPipeline", ({ enumerable: true, get: function () { return Pipeline_js_1.newPipeline; } }));
|
|
87921
87783
|
Object.defineProperty(exports, "StorageOAuthScopes", ({ enumerable: true, get: function () { return Pipeline_js_1.StorageOAuthScopes; } }));
|
|
87922
|
-
|
|
87923
|
-
|
|
87924
|
-
Object.defineProperty(exports, "
|
|
87925
|
-
|
|
87926
|
-
|
|
87927
|
-
|
|
87928
|
-
|
|
87784
|
+
var storage_common_1 = __nccwpck_require__(51382);
|
|
87785
|
+
Object.defineProperty(exports, "AnonymousCredential", ({ enumerable: true, get: function () { return storage_common_1.AnonymousCredential; } }));
|
|
87786
|
+
Object.defineProperty(exports, "AnonymousCredentialPolicy", ({ enumerable: true, get: function () { return storage_common_1.AnonymousCredentialPolicy; } }));
|
|
87787
|
+
Object.defineProperty(exports, "BaseRequestPolicy", ({ enumerable: true, get: function () { return storage_common_1.BaseRequestPolicy; } }));
|
|
87788
|
+
Object.defineProperty(exports, "CredentialPolicy", ({ enumerable: true, get: function () { return storage_common_1.CredentialPolicy; } }));
|
|
87789
|
+
Object.defineProperty(exports, "Credential", ({ enumerable: true, get: function () { return storage_common_1.Credential; } }));
|
|
87790
|
+
Object.defineProperty(exports, "StorageRetryPolicyType", ({ enumerable: true, get: function () { return storage_common_1.StorageRetryPolicyType; } }));
|
|
87791
|
+
Object.defineProperty(exports, "StorageRetryPolicy", ({ enumerable: true, get: function () { return storage_common_1.StorageRetryPolicy; } }));
|
|
87792
|
+
Object.defineProperty(exports, "StorageRetryPolicyFactory", ({ enumerable: true, get: function () { return storage_common_1.StorageRetryPolicyFactory; } }));
|
|
87793
|
+
Object.defineProperty(exports, "StorageSharedKeyCredential", ({ enumerable: true, get: function () { return storage_common_1.StorageSharedKeyCredential; } }));
|
|
87794
|
+
Object.defineProperty(exports, "StorageSharedKeyCredentialPolicy", ({ enumerable: true, get: function () { return storage_common_1.StorageSharedKeyCredentialPolicy; } }));
|
|
87795
|
+
Object.defineProperty(exports, "StorageBrowserPolicy", ({ enumerable: true, get: function () { return storage_common_1.StorageBrowserPolicy; } }));
|
|
87796
|
+
Object.defineProperty(exports, "StorageBrowserPolicyFactory", ({ enumerable: true, get: function () { return storage_common_1.StorageBrowserPolicyFactory; } }));
|
|
87929
87797
|
tslib_1.__exportStar(__nccwpck_require__(26823), exports);
|
|
87930
87798
|
tslib_1.__exportStar(__nccwpck_require__(83627), exports);
|
|
87931
87799
|
var log_js_1 = __nccwpck_require__(46370);
|
|
@@ -88481,1094 +88349,52 @@ class AvroReader {
|
|
|
88481
88349
|
}
|
|
88482
88350
|
}
|
|
88483
88351
|
}
|
|
88484
|
-
hasNext() {
|
|
88485
|
-
return !this._initialized || this._itemsRemainingInBlock > 0;
|
|
88486
|
-
}
|
|
88487
|
-
async *parseObjects(options = {}) {
|
|
88488
|
-
if (!this._initialized) {
|
|
88489
|
-
await this.initialize(options);
|
|
88490
|
-
}
|
|
88491
|
-
while (this.hasNext()) {
|
|
88492
|
-
const result = await this._itemType.read(this._dataStream, {
|
|
88493
|
-
abortSignal: options.abortSignal,
|
|
88494
|
-
});
|
|
88495
|
-
this._itemsRemainingInBlock--;
|
|
88496
|
-
this._objectIndex++;
|
|
88497
|
-
if (this._itemsRemainingInBlock === 0) {
|
|
88498
|
-
const marker = await AvroParser_js_1.AvroParser.readFixedBytes(this._dataStream, AvroConstants_js_1.AVRO_SYNC_MARKER_SIZE, {
|
|
88499
|
-
abortSignal: options.abortSignal,
|
|
88500
|
-
});
|
|
88501
|
-
this._blockOffset = this._initialBlockOffset + this._dataStream.position;
|
|
88502
|
-
this._objectIndex = 0;
|
|
88503
|
-
if (!(0, utils_common_js_1.arraysEqual)(this._syncMarker, marker)) {
|
|
88504
|
-
throw new Error("Stream is not a valid Avro file.");
|
|
88505
|
-
}
|
|
88506
|
-
try {
|
|
88507
|
-
this._itemsRemainingInBlock = await AvroParser_js_1.AvroParser.readLong(this._dataStream, {
|
|
88508
|
-
abortSignal: options.abortSignal,
|
|
88509
|
-
});
|
|
88510
|
-
}
|
|
88511
|
-
catch {
|
|
88512
|
-
// We hit the end of the stream.
|
|
88513
|
-
this._itemsRemainingInBlock = 0;
|
|
88514
|
-
}
|
|
88515
|
-
if (this._itemsRemainingInBlock > 0) {
|
|
88516
|
-
// Ignore block size
|
|
88517
|
-
await AvroParser_js_1.AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal });
|
|
88518
|
-
}
|
|
88519
|
-
}
|
|
88520
|
-
yield result;
|
|
88521
|
-
}
|
|
88522
|
-
}
|
|
88523
|
-
}
|
|
88524
|
-
exports.AvroReader = AvroReader;
|
|
88525
|
-
//# sourceMappingURL=AvroReader.js.map
|
|
88526
|
-
|
|
88527
|
-
/***/ }),
|
|
88528
|
-
|
|
88529
|
-
/***/ 96147:
|
|
88530
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
88531
|
-
|
|
88532
|
-
"use strict";
|
|
88533
|
-
|
|
88534
|
-
// Copyright (c) Microsoft Corporation.
|
|
88535
|
-
// Licensed under the MIT License.
|
|
88536
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
88537
|
-
exports.AvroReadableFromStream = exports.AvroReadable = exports.AvroReader = void 0;
|
|
88538
|
-
var AvroReader_js_1 = __nccwpck_require__(52888);
|
|
88539
|
-
Object.defineProperty(exports, "AvroReader", ({ enumerable: true, get: function () { return AvroReader_js_1.AvroReader; } }));
|
|
88540
|
-
var AvroReadable_js_1 = __nccwpck_require__(41675);
|
|
88541
|
-
Object.defineProperty(exports, "AvroReadable", ({ enumerable: true, get: function () { return AvroReadable_js_1.AvroReadable; } }));
|
|
88542
|
-
var AvroReadableFromStream_js_1 = __nccwpck_require__(48059);
|
|
88543
|
-
Object.defineProperty(exports, "AvroReadableFromStream", ({ enumerable: true, get: function () { return AvroReadableFromStream_js_1.AvroReadableFromStream; } }));
|
|
88544
|
-
//# sourceMappingURL=index.js.map
|
|
88545
|
-
|
|
88546
|
-
/***/ }),
|
|
88547
|
-
|
|
88548
|
-
/***/ 4337:
|
|
88549
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
88550
|
-
|
|
88551
|
-
"use strict";
|
|
88552
|
-
|
|
88553
|
-
// Copyright (c) Microsoft Corporation.
|
|
88554
|
-
// Licensed under the MIT License.
|
|
88555
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
88556
|
-
exports.arraysEqual = arraysEqual;
|
|
88557
|
-
function arraysEqual(a, b) {
|
|
88558
|
-
if (a === b)
|
|
88559
|
-
return true;
|
|
88560
|
-
if (a == null || b == null)
|
|
88561
|
-
return false;
|
|
88562
|
-
if (a.length !== b.length)
|
|
88563
|
-
return false;
|
|
88564
|
-
for (let i = 0; i < a.length; ++i) {
|
|
88565
|
-
if (a[i] !== b[i])
|
|
88566
|
-
return false;
|
|
88567
|
-
}
|
|
88568
|
-
return true;
|
|
88569
|
-
}
|
|
88570
|
-
//# sourceMappingURL=utils.common.js.map
|
|
88571
|
-
|
|
88572
|
-
/***/ }),
|
|
88573
|
-
|
|
88574
|
-
/***/ 46370:
|
|
88575
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
88576
|
-
|
|
88577
|
-
"use strict";
|
|
88578
|
-
|
|
88579
|
-
// Copyright (c) Microsoft Corporation.
|
|
88580
|
-
// Licensed under the MIT License.
|
|
88581
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
88582
|
-
exports.logger = void 0;
|
|
88583
|
-
const logger_1 = __nccwpck_require__(26515);
|
|
88584
|
-
/**
|
|
88585
|
-
* The `@azure/logger` configuration for this package.
|
|
88586
|
-
*/
|
|
88587
|
-
exports.logger = (0, logger_1.createClientLogger)("storage-blob");
|
|
88588
|
-
//# sourceMappingURL=log.js.map
|
|
88589
|
-
|
|
88590
|
-
/***/ }),
|
|
88591
|
-
|
|
88592
|
-
/***/ 58560:
|
|
88593
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
88594
|
-
|
|
88595
|
-
"use strict";
|
|
88596
|
-
|
|
88597
|
-
// Copyright (c) Microsoft Corporation.
|
|
88598
|
-
// Licensed under the MIT License.
|
|
88599
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
88600
|
-
exports.StorageBlobAudience = exports.PremiumPageBlobTier = exports.BlockBlobTier = void 0;
|
|
88601
|
-
exports.toAccessTier = toAccessTier;
|
|
88602
|
-
exports.ensureCpkIfSpecified = ensureCpkIfSpecified;
|
|
88603
|
-
exports.getBlobServiceAccountAudience = getBlobServiceAccountAudience;
|
|
88604
|
-
const constants_js_1 = __nccwpck_require__(27323);
|
|
88605
|
-
/**
|
|
88606
|
-
* Represents the access tier on a blob.
|
|
88607
|
-
* For detailed information about block blob level tiering see {@link https://learn.microsoft.com/azure/storage/blobs/storage-blob-storage-tiers|Hot, cool and archive storage tiers.}
|
|
88608
|
-
*/
|
|
88609
|
-
var BlockBlobTier;
|
|
88610
|
-
(function (BlockBlobTier) {
|
|
88611
|
-
/**
|
|
88612
|
-
* Optimized for storing data that is accessed frequently.
|
|
88613
|
-
*/
|
|
88614
|
-
BlockBlobTier["Hot"] = "Hot";
|
|
88615
|
-
/**
|
|
88616
|
-
* Optimized for storing data that is infrequently accessed and stored for at least 30 days.
|
|
88617
|
-
*/
|
|
88618
|
-
BlockBlobTier["Cool"] = "Cool";
|
|
88619
|
-
/**
|
|
88620
|
-
* Optimized for storing data that is rarely accessed.
|
|
88621
|
-
*/
|
|
88622
|
-
BlockBlobTier["Cold"] = "Cold";
|
|
88623
|
-
/**
|
|
88624
|
-
* Optimized for storing data that is rarely accessed and stored for at least 180 days
|
|
88625
|
-
* with flexible latency requirements (on the order of hours).
|
|
88626
|
-
*/
|
|
88627
|
-
BlockBlobTier["Archive"] = "Archive";
|
|
88628
|
-
})(BlockBlobTier || (exports.BlockBlobTier = BlockBlobTier = {}));
|
|
88629
|
-
/**
|
|
88630
|
-
* Specifies the page blob tier to set the blob to. This is only applicable to page blobs on premium storage accounts.
|
|
88631
|
-
* Please see {@link https://learn.microsoft.com/azure/storage/storage-premium-storage#scalability-and-performance-targets|here}
|
|
88632
|
-
* for detailed information on the corresponding IOPS and throughput per PageBlobTier.
|
|
88633
|
-
*/
|
|
88634
|
-
var PremiumPageBlobTier;
|
|
88635
|
-
(function (PremiumPageBlobTier) {
|
|
88636
|
-
/**
|
|
88637
|
-
* P4 Tier.
|
|
88638
|
-
*/
|
|
88639
|
-
PremiumPageBlobTier["P4"] = "P4";
|
|
88640
|
-
/**
|
|
88641
|
-
* P6 Tier.
|
|
88642
|
-
*/
|
|
88643
|
-
PremiumPageBlobTier["P6"] = "P6";
|
|
88644
|
-
/**
|
|
88645
|
-
* P10 Tier.
|
|
88646
|
-
*/
|
|
88647
|
-
PremiumPageBlobTier["P10"] = "P10";
|
|
88648
|
-
/**
|
|
88649
|
-
* P15 Tier.
|
|
88650
|
-
*/
|
|
88651
|
-
PremiumPageBlobTier["P15"] = "P15";
|
|
88652
|
-
/**
|
|
88653
|
-
* P20 Tier.
|
|
88654
|
-
*/
|
|
88655
|
-
PremiumPageBlobTier["P20"] = "P20";
|
|
88656
|
-
/**
|
|
88657
|
-
* P30 Tier.
|
|
88658
|
-
*/
|
|
88659
|
-
PremiumPageBlobTier["P30"] = "P30";
|
|
88660
|
-
/**
|
|
88661
|
-
* P40 Tier.
|
|
88662
|
-
*/
|
|
88663
|
-
PremiumPageBlobTier["P40"] = "P40";
|
|
88664
|
-
/**
|
|
88665
|
-
* P50 Tier.
|
|
88666
|
-
*/
|
|
88667
|
-
PremiumPageBlobTier["P50"] = "P50";
|
|
88668
|
-
/**
|
|
88669
|
-
* P60 Tier.
|
|
88670
|
-
*/
|
|
88671
|
-
PremiumPageBlobTier["P60"] = "P60";
|
|
88672
|
-
/**
|
|
88673
|
-
* P70 Tier.
|
|
88674
|
-
*/
|
|
88675
|
-
PremiumPageBlobTier["P70"] = "P70";
|
|
88676
|
-
/**
|
|
88677
|
-
* P80 Tier.
|
|
88678
|
-
*/
|
|
88679
|
-
PremiumPageBlobTier["P80"] = "P80";
|
|
88680
|
-
})(PremiumPageBlobTier || (exports.PremiumPageBlobTier = PremiumPageBlobTier = {}));
|
|
88681
|
-
function toAccessTier(tier) {
|
|
88682
|
-
if (tier === undefined) {
|
|
88683
|
-
return undefined;
|
|
88684
|
-
}
|
|
88685
|
-
return tier; // No more check if string is a valid AccessTier, and left this to underlay logic to decide(service).
|
|
88686
|
-
}
|
|
88687
|
-
function ensureCpkIfSpecified(cpk, isHttps) {
|
|
88688
|
-
if (cpk && !isHttps) {
|
|
88689
|
-
throw new RangeError("Customer-provided encryption key must be used over HTTPS.");
|
|
88690
|
-
}
|
|
88691
|
-
if (cpk && !cpk.encryptionAlgorithm) {
|
|
88692
|
-
cpk.encryptionAlgorithm = constants_js_1.EncryptionAlgorithmAES25;
|
|
88693
|
-
}
|
|
88694
|
-
}
|
|
88695
|
-
/**
|
|
88696
|
-
* Defines the known cloud audiences for Storage.
|
|
88697
|
-
*/
|
|
88698
|
-
var StorageBlobAudience;
|
|
88699
|
-
(function (StorageBlobAudience) {
|
|
88700
|
-
/**
|
|
88701
|
-
* The OAuth scope to use to retrieve an AAD token for Azure Storage.
|
|
88702
|
-
*/
|
|
88703
|
-
StorageBlobAudience["StorageOAuthScopes"] = "https://storage.azure.com/.default";
|
|
88704
|
-
/**
|
|
88705
|
-
* The OAuth scope to use to retrieve an AAD token for Azure Disk.
|
|
88706
|
-
*/
|
|
88707
|
-
StorageBlobAudience["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default";
|
|
88708
|
-
})(StorageBlobAudience || (exports.StorageBlobAudience = StorageBlobAudience = {}));
|
|
88709
|
-
/**
|
|
88710
|
-
*
|
|
88711
|
-
* To get OAuth audience for a storage account for blob service.
|
|
88712
|
-
*/
|
|
88713
|
-
function getBlobServiceAccountAudience(storageAccountName) {
|
|
88714
|
-
return `https://${storageAccountName}.blob.core.windows.net/.default`;
|
|
88715
|
-
}
|
|
88716
|
-
//# sourceMappingURL=models.js.map
|
|
88717
|
-
|
|
88718
|
-
/***/ }),
|
|
88719
|
-
|
|
88720
|
-
/***/ 13501:
|
|
88721
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
88722
|
-
|
|
88723
|
-
"use strict";
|
|
88724
|
-
|
|
88725
|
-
// Copyright (c) Microsoft Corporation.
|
|
88726
|
-
// Licensed under the MIT License.
|
|
88727
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
88728
|
-
exports.AnonymousCredentialPolicy = void 0;
|
|
88729
|
-
const CredentialPolicy_js_1 = __nccwpck_require__(63064);
|
|
88730
|
-
/**
|
|
88731
|
-
* AnonymousCredentialPolicy is used with HTTP(S) requests that read public resources
|
|
88732
|
-
* or for use with Shared Access Signatures (SAS).
|
|
88733
|
-
*/
|
|
88734
|
-
class AnonymousCredentialPolicy extends CredentialPolicy_js_1.CredentialPolicy {
|
|
88735
|
-
/**
|
|
88736
|
-
* Creates an instance of AnonymousCredentialPolicy.
|
|
88737
|
-
* @param nextPolicy -
|
|
88738
|
-
* @param options -
|
|
88739
|
-
*/
|
|
88740
|
-
// The base class has a protected constructor. Adding a public one to enable constructing of this class.
|
|
88741
|
-
/* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/
|
|
88742
|
-
constructor(nextPolicy, options) {
|
|
88743
|
-
super(nextPolicy, options);
|
|
88744
|
-
}
|
|
88745
|
-
}
|
|
88746
|
-
exports.AnonymousCredentialPolicy = AnonymousCredentialPolicy;
|
|
88747
|
-
//# sourceMappingURL=AnonymousCredentialPolicy.js.map
|
|
88748
|
-
|
|
88749
|
-
/***/ }),
|
|
88750
|
-
|
|
88751
|
-
/***/ 63064:
|
|
88752
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
88753
|
-
|
|
88754
|
-
"use strict";
|
|
88755
|
-
|
|
88756
|
-
// Copyright (c) Microsoft Corporation.
|
|
88757
|
-
// Licensed under the MIT License.
|
|
88758
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
88759
|
-
exports.CredentialPolicy = void 0;
|
|
88760
|
-
const RequestPolicy_js_1 = __nccwpck_require__(70336);
|
|
88761
|
-
/**
|
|
88762
|
-
* Credential policy used to sign HTTP(S) requests before sending. This is an
|
|
88763
|
-
* abstract class.
|
|
88764
|
-
*/
|
|
88765
|
-
class CredentialPolicy extends RequestPolicy_js_1.BaseRequestPolicy {
|
|
88766
|
-
/**
|
|
88767
|
-
* Sends out request.
|
|
88768
|
-
*
|
|
88769
|
-
* @param request -
|
|
88770
|
-
*/
|
|
88771
|
-
sendRequest(request) {
|
|
88772
|
-
return this._nextPolicy.sendRequest(this.signRequest(request));
|
|
88773
|
-
}
|
|
88774
|
-
/**
|
|
88775
|
-
* Child classes must implement this method with request signing. This method
|
|
88776
|
-
* will be executed in {@link sendRequest}.
|
|
88777
|
-
*
|
|
88778
|
-
* @param request -
|
|
88779
|
-
*/
|
|
88780
|
-
signRequest(request) {
|
|
88781
|
-
// Child classes must override this method with request signing. This method
|
|
88782
|
-
// will be executed in sendRequest().
|
|
88783
|
-
return request;
|
|
88784
|
-
}
|
|
88785
|
-
}
|
|
88786
|
-
exports.CredentialPolicy = CredentialPolicy;
|
|
88787
|
-
//# sourceMappingURL=CredentialPolicy.js.map
|
|
88788
|
-
|
|
88789
|
-
/***/ }),
|
|
88790
|
-
|
|
88791
|
-
/***/ 70336:
|
|
88792
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
88793
|
-
|
|
88794
|
-
"use strict";
|
|
88795
|
-
|
|
88796
|
-
// Copyright (c) Microsoft Corporation.
|
|
88797
|
-
// Licensed under the MIT License.
|
|
88798
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
88799
|
-
exports.BaseRequestPolicy = void 0;
|
|
88800
|
-
/**
|
|
88801
|
-
* The base class from which all request policies derive.
|
|
88802
|
-
*/
|
|
88803
|
-
class BaseRequestPolicy {
|
|
88804
|
-
_nextPolicy;
|
|
88805
|
-
_options;
|
|
88806
|
-
/**
|
|
88807
|
-
* The main method to implement that manipulates a request/response.
|
|
88808
|
-
*/
|
|
88809
|
-
constructor(
|
|
88810
|
-
/**
|
|
88811
|
-
* The next policy in the pipeline. Each policy is responsible for executing the next one if the request is to continue through the pipeline.
|
|
88812
|
-
*/
|
|
88813
|
-
_nextPolicy,
|
|
88814
|
-
/**
|
|
88815
|
-
* The options that can be passed to a given request policy.
|
|
88816
|
-
*/
|
|
88817
|
-
_options) {
|
|
88818
|
-
this._nextPolicy = _nextPolicy;
|
|
88819
|
-
this._options = _options;
|
|
88820
|
-
}
|
|
88821
|
-
/**
|
|
88822
|
-
* Get whether or not a log with the provided log level should be logged.
|
|
88823
|
-
* @param logLevel - The log level of the log that will be logged.
|
|
88824
|
-
* @returns Whether or not a log with the provided log level should be logged.
|
|
88825
|
-
*/
|
|
88826
|
-
shouldLog(logLevel) {
|
|
88827
|
-
return this._options.shouldLog(logLevel);
|
|
88828
|
-
}
|
|
88829
|
-
/**
|
|
88830
|
-
* Attempt to log the provided message to the provided logger. If no logger was provided or if
|
|
88831
|
-
* the log level does not meat the logger's threshold, then nothing will be logged.
|
|
88832
|
-
* @param logLevel - The log level of this log.
|
|
88833
|
-
* @param message - The message of this log.
|
|
88834
|
-
*/
|
|
88835
|
-
log(logLevel, message) {
|
|
88836
|
-
this._options.log(logLevel, message);
|
|
88837
|
-
}
|
|
88838
|
-
}
|
|
88839
|
-
exports.BaseRequestPolicy = BaseRequestPolicy;
|
|
88840
|
-
//# sourceMappingURL=RequestPolicy.js.map
|
|
88841
|
-
|
|
88842
|
-
/***/ }),
|
|
88843
|
-
|
|
88844
|
-
/***/ 78654:
|
|
88845
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
88846
|
-
|
|
88847
|
-
"use strict";
|
|
88848
|
-
|
|
88849
|
-
// Copyright (c) Microsoft Corporation.
|
|
88850
|
-
// Licensed under the MIT License.
|
|
88851
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
88852
|
-
exports.StorageBrowserPolicy = void 0;
|
|
88853
|
-
const RequestPolicy_js_1 = __nccwpck_require__(70336);
|
|
88854
|
-
const core_util_1 = __nccwpck_require__(87779);
|
|
88855
|
-
const constants_js_1 = __nccwpck_require__(27323);
|
|
88856
|
-
const utils_common_js_1 = __nccwpck_require__(47764);
|
|
88857
|
-
/**
|
|
88858
|
-
* StorageBrowserPolicy will handle differences between Node.js and browser runtime, including:
|
|
88859
|
-
*
|
|
88860
|
-
* 1. Browsers cache GET/HEAD requests by adding conditional headers such as 'IF_MODIFIED_SINCE'.
|
|
88861
|
-
* StorageBrowserPolicy is a policy used to add a timestamp query to GET/HEAD request URL
|
|
88862
|
-
* thus avoid the browser cache.
|
|
88863
|
-
*
|
|
88864
|
-
* 2. Remove cookie header for security
|
|
88865
|
-
*
|
|
88866
|
-
* 3. Remove content-length header to avoid browsers warning
|
|
88867
|
-
*/
|
|
88868
|
-
class StorageBrowserPolicy extends RequestPolicy_js_1.BaseRequestPolicy {
|
|
88869
|
-
/**
|
|
88870
|
-
* Creates an instance of StorageBrowserPolicy.
|
|
88871
|
-
* @param nextPolicy -
|
|
88872
|
-
* @param options -
|
|
88873
|
-
*/
|
|
88874
|
-
// The base class has a protected constructor. Adding a public one to enable constructing of this class.
|
|
88875
|
-
/* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/
|
|
88876
|
-
constructor(nextPolicy, options) {
|
|
88877
|
-
super(nextPolicy, options);
|
|
88878
|
-
}
|
|
88879
|
-
/**
|
|
88880
|
-
* Sends out request.
|
|
88881
|
-
*
|
|
88882
|
-
* @param request -
|
|
88883
|
-
*/
|
|
88884
|
-
async sendRequest(request) {
|
|
88885
|
-
if (core_util_1.isNodeLike) {
|
|
88886
|
-
return this._nextPolicy.sendRequest(request);
|
|
88887
|
-
}
|
|
88888
|
-
if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") {
|
|
88889
|
-
request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, new Date().getTime().toString());
|
|
88890
|
-
}
|
|
88891
|
-
request.headers.remove(constants_js_1.HeaderConstants.COOKIE);
|
|
88892
|
-
// According to XHR standards, content-length should be fully controlled by browsers
|
|
88893
|
-
request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH);
|
|
88894
|
-
return this._nextPolicy.sendRequest(request);
|
|
88895
|
-
}
|
|
88896
|
-
}
|
|
88897
|
-
exports.StorageBrowserPolicy = StorageBrowserPolicy;
|
|
88898
|
-
//# sourceMappingURL=StorageBrowserPolicy.js.map
|
|
88899
|
-
|
|
88900
|
-
/***/ }),
|
|
88901
|
-
|
|
88902
|
-
/***/ 490:
|
|
88903
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
88904
|
-
|
|
88905
|
-
"use strict";
|
|
88906
|
-
|
|
88907
|
-
// Copyright (c) Microsoft Corporation.
|
|
88908
|
-
// Licensed under the MIT License.
|
|
88909
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
88910
|
-
exports.storageBrowserPolicyName = void 0;
|
|
88911
|
-
exports.storageBrowserPolicy = storageBrowserPolicy;
|
|
88912
|
-
const core_util_1 = __nccwpck_require__(87779);
|
|
88913
|
-
const constants_js_1 = __nccwpck_require__(27323);
|
|
88914
|
-
const utils_common_js_1 = __nccwpck_require__(47764);
|
|
88915
|
-
/**
|
|
88916
|
-
* The programmatic identifier of the StorageBrowserPolicy.
|
|
88917
|
-
*/
|
|
88918
|
-
exports.storageBrowserPolicyName = "storageBrowserPolicy";
|
|
88919
|
-
/**
|
|
88920
|
-
* storageBrowserPolicy is a policy used to prevent browsers from caching requests
|
|
88921
|
-
* and to remove cookies and explicit content-length headers.
|
|
88922
|
-
*/
|
|
88923
|
-
function storageBrowserPolicy() {
|
|
88924
|
-
return {
|
|
88925
|
-
name: exports.storageBrowserPolicyName,
|
|
88926
|
-
async sendRequest(request, next) {
|
|
88927
|
-
if (core_util_1.isNodeLike) {
|
|
88928
|
-
return next(request);
|
|
88929
|
-
}
|
|
88930
|
-
if (request.method === "GET" || request.method === "HEAD") {
|
|
88931
|
-
request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, new Date().getTime().toString());
|
|
88932
|
-
}
|
|
88933
|
-
request.headers.delete(constants_js_1.HeaderConstants.COOKIE);
|
|
88934
|
-
// According to XHR standards, content-length should be fully controlled by browsers
|
|
88935
|
-
request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH);
|
|
88936
|
-
return next(request);
|
|
88937
|
-
},
|
|
88938
|
-
};
|
|
88939
|
-
}
|
|
88940
|
-
//# sourceMappingURL=StorageBrowserPolicyV2.js.map
|
|
88941
|
-
|
|
88942
|
-
/***/ }),
|
|
88943
|
-
|
|
88944
|
-
/***/ 99359:
|
|
88945
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
88946
|
-
|
|
88947
|
-
"use strict";
|
|
88948
|
-
|
|
88949
|
-
// Copyright (c) Microsoft Corporation.
|
|
88950
|
-
// Licensed under the MIT License.
|
|
88951
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
88952
|
-
exports.storageCorrectContentLengthPolicyName = void 0;
|
|
88953
|
-
exports.storageCorrectContentLengthPolicy = storageCorrectContentLengthPolicy;
|
|
88954
|
-
const constants_js_1 = __nccwpck_require__(27323);
|
|
88955
|
-
/**
|
|
88956
|
-
* The programmatic identifier of the storageCorrectContentLengthPolicy.
|
|
88957
|
-
*/
|
|
88958
|
-
exports.storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy";
|
|
88959
|
-
/**
|
|
88960
|
-
* storageCorrectContentLengthPolicy to correctly set Content-Length header with request body length.
|
|
88961
|
-
*/
|
|
88962
|
-
function storageCorrectContentLengthPolicy() {
|
|
88963
|
-
function correctContentLength(request) {
|
|
88964
|
-
if (request.body &&
|
|
88965
|
-
(typeof request.body === "string" || Buffer.isBuffer(request.body)) &&
|
|
88966
|
-
request.body.length > 0) {
|
|
88967
|
-
request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body));
|
|
88968
|
-
}
|
|
88969
|
-
}
|
|
88970
|
-
return {
|
|
88971
|
-
name: exports.storageCorrectContentLengthPolicyName,
|
|
88972
|
-
async sendRequest(request, next) {
|
|
88973
|
-
correctContentLength(request);
|
|
88974
|
-
return next(request);
|
|
88975
|
-
},
|
|
88976
|
-
};
|
|
88977
|
-
}
|
|
88978
|
-
//# sourceMappingURL=StorageCorrectContentLengthPolicy.js.map
|
|
88979
|
-
|
|
88980
|
-
/***/ }),
|
|
88981
|
-
|
|
88982
|
-
/***/ 57996:
|
|
88983
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
88984
|
-
|
|
88985
|
-
"use strict";
|
|
88986
|
-
|
|
88987
|
-
// Copyright (c) Microsoft Corporation.
|
|
88988
|
-
// Licensed under the MIT License.
|
|
88989
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
88990
|
-
exports.StorageRetryPolicy = void 0;
|
|
88991
|
-
exports.NewRetryPolicyFactory = NewRetryPolicyFactory;
|
|
88992
|
-
const abort_controller_1 = __nccwpck_require__(24517);
|
|
88993
|
-
const RequestPolicy_js_1 = __nccwpck_require__(70336);
|
|
88994
|
-
const constants_js_1 = __nccwpck_require__(27323);
|
|
88995
|
-
const utils_common_js_1 = __nccwpck_require__(47764);
|
|
88996
|
-
const log_js_1 = __nccwpck_require__(46370);
|
|
88997
|
-
const StorageRetryPolicyType_js_1 = __nccwpck_require__(16308);
|
|
88998
|
-
/**
|
|
88999
|
-
* A factory method used to generated a RetryPolicy factory.
|
|
89000
|
-
*
|
|
89001
|
-
* @param retryOptions -
|
|
89002
|
-
*/
|
|
89003
|
-
function NewRetryPolicyFactory(retryOptions) {
|
|
89004
|
-
return {
|
|
89005
|
-
create: (nextPolicy, options) => {
|
|
89006
|
-
return new StorageRetryPolicy(nextPolicy, options, retryOptions);
|
|
89007
|
-
},
|
|
89008
|
-
};
|
|
89009
|
-
}
|
|
89010
|
-
// Default values of StorageRetryOptions
|
|
89011
|
-
const DEFAULT_RETRY_OPTIONS = {
|
|
89012
|
-
maxRetryDelayInMs: 120 * 1000,
|
|
89013
|
-
maxTries: 4,
|
|
89014
|
-
retryDelayInMs: 4 * 1000,
|
|
89015
|
-
retryPolicyType: StorageRetryPolicyType_js_1.StorageRetryPolicyType.EXPONENTIAL,
|
|
89016
|
-
secondaryHost: "",
|
|
89017
|
-
tryTimeoutInMs: undefined, // Use server side default timeout strategy
|
|
89018
|
-
};
|
|
89019
|
-
const RETRY_ABORT_ERROR = new abort_controller_1.AbortError("The operation was aborted.");
|
|
89020
|
-
/**
|
|
89021
|
-
* Retry policy with exponential retry and linear retry implemented.
|
|
89022
|
-
*/
|
|
89023
|
-
class StorageRetryPolicy extends RequestPolicy_js_1.BaseRequestPolicy {
|
|
89024
|
-
/**
|
|
89025
|
-
* RetryOptions.
|
|
89026
|
-
*/
|
|
89027
|
-
retryOptions;
|
|
89028
|
-
/**
|
|
89029
|
-
* Creates an instance of RetryPolicy.
|
|
89030
|
-
*
|
|
89031
|
-
* @param nextPolicy -
|
|
89032
|
-
* @param options -
|
|
89033
|
-
* @param retryOptions -
|
|
89034
|
-
*/
|
|
89035
|
-
constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS) {
|
|
89036
|
-
super(nextPolicy, options);
|
|
89037
|
-
// Initialize retry options
|
|
89038
|
-
this.retryOptions = {
|
|
89039
|
-
retryPolicyType: retryOptions.retryPolicyType
|
|
89040
|
-
? retryOptions.retryPolicyType
|
|
89041
|
-
: DEFAULT_RETRY_OPTIONS.retryPolicyType,
|
|
89042
|
-
maxTries: retryOptions.maxTries && retryOptions.maxTries >= 1
|
|
89043
|
-
? Math.floor(retryOptions.maxTries)
|
|
89044
|
-
: DEFAULT_RETRY_OPTIONS.maxTries,
|
|
89045
|
-
tryTimeoutInMs: retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0
|
|
89046
|
-
? retryOptions.tryTimeoutInMs
|
|
89047
|
-
: DEFAULT_RETRY_OPTIONS.tryTimeoutInMs,
|
|
89048
|
-
retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0
|
|
89049
|
-
? Math.min(retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs
|
|
89050
|
-
? retryOptions.maxRetryDelayInMs
|
|
89051
|
-
: DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs)
|
|
89052
|
-
: DEFAULT_RETRY_OPTIONS.retryDelayInMs,
|
|
89053
|
-
maxRetryDelayInMs: retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0
|
|
89054
|
-
? retryOptions.maxRetryDelayInMs
|
|
89055
|
-
: DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs,
|
|
89056
|
-
secondaryHost: retryOptions.secondaryHost
|
|
89057
|
-
? retryOptions.secondaryHost
|
|
89058
|
-
: DEFAULT_RETRY_OPTIONS.secondaryHost,
|
|
89059
|
-
};
|
|
89060
|
-
}
|
|
89061
|
-
/**
|
|
89062
|
-
* Sends request.
|
|
89063
|
-
*
|
|
89064
|
-
* @param request -
|
|
89065
|
-
*/
|
|
89066
|
-
async sendRequest(request) {
|
|
89067
|
-
return this.attemptSendRequest(request, false, 1);
|
|
89068
|
-
}
|
|
89069
|
-
/**
|
|
89070
|
-
* Decide and perform next retry. Won't mutate request parameter.
|
|
89071
|
-
*
|
|
89072
|
-
* @param request -
|
|
89073
|
-
* @param secondaryHas404 - If attempt was against the secondary & it returned a StatusNotFound (404), then
|
|
89074
|
-
* the resource was not found. This may be due to replication delay. So, in this
|
|
89075
|
-
* case, we'll never try the secondary again for this operation.
|
|
89076
|
-
* @param attempt - How many retries has been attempted to performed, starting from 1, which includes
|
|
89077
|
-
* the attempt will be performed by this method call.
|
|
89078
|
-
*/
|
|
89079
|
-
async attemptSendRequest(request, secondaryHas404, attempt) {
|
|
89080
|
-
const newRequest = request.clone();
|
|
89081
|
-
const isPrimaryRetry = secondaryHas404 ||
|
|
89082
|
-
!this.retryOptions.secondaryHost ||
|
|
89083
|
-
!(request.method === "GET" || request.method === "HEAD" || request.method === "OPTIONS") ||
|
|
89084
|
-
attempt % 2 === 1;
|
|
89085
|
-
if (!isPrimaryRetry) {
|
|
89086
|
-
newRequest.url = (0, utils_common_js_1.setURLHost)(newRequest.url, this.retryOptions.secondaryHost);
|
|
89087
|
-
}
|
|
89088
|
-
// Set the server-side timeout query parameter "timeout=[seconds]"
|
|
89089
|
-
if (this.retryOptions.tryTimeoutInMs) {
|
|
89090
|
-
newRequest.url = (0, utils_common_js_1.setURLParameter)(newRequest.url, constants_js_1.URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1000).toString());
|
|
89091
|
-
}
|
|
89092
|
-
let response;
|
|
89093
|
-
try {
|
|
89094
|
-
log_js_1.logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`);
|
|
89095
|
-
response = await this._nextPolicy.sendRequest(newRequest);
|
|
89096
|
-
if (!this.shouldRetry(isPrimaryRetry, attempt, response)) {
|
|
89097
|
-
return response;
|
|
89098
|
-
}
|
|
89099
|
-
secondaryHas404 = secondaryHas404 || (!isPrimaryRetry && response.status === 404);
|
|
89100
|
-
}
|
|
89101
|
-
catch (err) {
|
|
89102
|
-
log_js_1.logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`);
|
|
89103
|
-
if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) {
|
|
89104
|
-
throw err;
|
|
89105
|
-
}
|
|
89106
|
-
}
|
|
89107
|
-
await this.delay(isPrimaryRetry, attempt, request.abortSignal);
|
|
89108
|
-
return this.attemptSendRequest(request, secondaryHas404, ++attempt);
|
|
89109
|
-
}
|
|
89110
|
-
/**
|
|
89111
|
-
* Decide whether to retry according to last HTTP response and retry counters.
|
|
89112
|
-
*
|
|
89113
|
-
* @param isPrimaryRetry -
|
|
89114
|
-
* @param attempt -
|
|
89115
|
-
* @param response -
|
|
89116
|
-
* @param err -
|
|
89117
|
-
*/
|
|
89118
|
-
shouldRetry(isPrimaryRetry, attempt, response, err) {
|
|
89119
|
-
if (attempt >= this.retryOptions.maxTries) {
|
|
89120
|
-
log_js_1.logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions
|
|
89121
|
-
.maxTries}, no further try.`);
|
|
89122
|
-
return false;
|
|
89123
|
-
}
|
|
89124
|
-
// Handle network failures, you may need to customize the list when you implement
|
|
89125
|
-
// your own http client
|
|
89126
|
-
const retriableErrors = [
|
|
89127
|
-
"ETIMEDOUT",
|
|
89128
|
-
"ESOCKETTIMEDOUT",
|
|
89129
|
-
"ECONNREFUSED",
|
|
89130
|
-
"ECONNRESET",
|
|
89131
|
-
"ENOENT",
|
|
89132
|
-
"ENOTFOUND",
|
|
89133
|
-
"TIMEOUT",
|
|
89134
|
-
"EPIPE",
|
|
89135
|
-
"REQUEST_SEND_ERROR", // For default xhr based http client provided in ms-rest-js
|
|
89136
|
-
];
|
|
89137
|
-
if (err) {
|
|
89138
|
-
for (const retriableError of retriableErrors) {
|
|
89139
|
-
if (err.name.toUpperCase().includes(retriableError) ||
|
|
89140
|
-
err.message.toUpperCase().includes(retriableError) ||
|
|
89141
|
-
(err.code && err.code.toString().toUpperCase() === retriableError)) {
|
|
89142
|
-
log_js_1.logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`);
|
|
89143
|
-
return true;
|
|
89144
|
-
}
|
|
89145
|
-
}
|
|
89146
|
-
}
|
|
89147
|
-
// If attempt was against the secondary & it returned a StatusNotFound (404), then
|
|
89148
|
-
// the resource was not found. This may be due to replication delay. So, in this
|
|
89149
|
-
// case, we'll never try the secondary again for this operation.
|
|
89150
|
-
if (response || err) {
|
|
89151
|
-
const statusCode = response ? response.status : err ? err.statusCode : 0;
|
|
89152
|
-
if (!isPrimaryRetry && statusCode === 404) {
|
|
89153
|
-
log_js_1.logger.info(`RetryPolicy: Secondary access with 404, will retry.`);
|
|
89154
|
-
return true;
|
|
89155
|
-
}
|
|
89156
|
-
// Server internal error or server timeout
|
|
89157
|
-
if (statusCode === 503 || statusCode === 500) {
|
|
89158
|
-
log_js_1.logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`);
|
|
89159
|
-
return true;
|
|
89160
|
-
}
|
|
89161
|
-
}
|
|
89162
|
-
if (response) {
|
|
89163
|
-
// Retry select Copy Source Error Codes.
|
|
89164
|
-
if (response?.status >= 400) {
|
|
89165
|
-
const copySourceError = response.headers.get(constants_js_1.HeaderConstants.X_MS_CopySourceErrorCode);
|
|
89166
|
-
if (copySourceError !== undefined) {
|
|
89167
|
-
switch (copySourceError) {
|
|
89168
|
-
case "InternalError":
|
|
89169
|
-
case "OperationTimedOut":
|
|
89170
|
-
case "ServerBusy":
|
|
89171
|
-
return true;
|
|
89172
|
-
}
|
|
89173
|
-
}
|
|
89174
|
-
}
|
|
89175
|
-
}
|
|
89176
|
-
if (err?.code === "PARSE_ERROR" && err?.message.startsWith(`Error "Error: Unclosed root tag`)) {
|
|
89177
|
-
log_js_1.logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry.");
|
|
89178
|
-
return true;
|
|
89179
|
-
}
|
|
89180
|
-
return false;
|
|
89181
|
-
}
|
|
89182
|
-
/**
|
|
89183
|
-
* Delay a calculated time between retries.
|
|
89184
|
-
*
|
|
89185
|
-
* @param isPrimaryRetry -
|
|
89186
|
-
* @param attempt -
|
|
89187
|
-
* @param abortSignal -
|
|
89188
|
-
*/
|
|
89189
|
-
async delay(isPrimaryRetry, attempt, abortSignal) {
|
|
89190
|
-
let delayTimeInMs = 0;
|
|
89191
|
-
if (isPrimaryRetry) {
|
|
89192
|
-
switch (this.retryOptions.retryPolicyType) {
|
|
89193
|
-
case StorageRetryPolicyType_js_1.StorageRetryPolicyType.EXPONENTIAL:
|
|
89194
|
-
delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs);
|
|
89195
|
-
break;
|
|
89196
|
-
case StorageRetryPolicyType_js_1.StorageRetryPolicyType.FIXED:
|
|
89197
|
-
delayTimeInMs = this.retryOptions.retryDelayInMs;
|
|
89198
|
-
break;
|
|
89199
|
-
}
|
|
89200
|
-
}
|
|
89201
|
-
else {
|
|
89202
|
-
delayTimeInMs = Math.random() * 1000;
|
|
89203
|
-
}
|
|
89204
|
-
log_js_1.logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`);
|
|
89205
|
-
return (0, utils_common_js_1.delay)(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR);
|
|
89206
|
-
}
|
|
89207
|
-
}
|
|
89208
|
-
exports.StorageRetryPolicy = StorageRetryPolicy;
|
|
89209
|
-
//# sourceMappingURL=StorageRetryPolicy.js.map
|
|
89210
|
-
|
|
89211
|
-
/***/ }),
|
|
89212
|
-
|
|
89213
|
-
/***/ 16308:
|
|
89214
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
89215
|
-
|
|
89216
|
-
"use strict";
|
|
89217
|
-
|
|
89218
|
-
// Copyright (c) Microsoft Corporation.
|
|
89219
|
-
// Licensed under the MIT License.
|
|
89220
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
89221
|
-
exports.StorageRetryPolicyType = void 0;
|
|
89222
|
-
/**
|
|
89223
|
-
* RetryPolicy types.
|
|
89224
|
-
*/
|
|
89225
|
-
var StorageRetryPolicyType;
|
|
89226
|
-
(function (StorageRetryPolicyType) {
|
|
89227
|
-
/**
|
|
89228
|
-
* Exponential retry. Retry time delay grows exponentially.
|
|
89229
|
-
*/
|
|
89230
|
-
StorageRetryPolicyType[StorageRetryPolicyType["EXPONENTIAL"] = 0] = "EXPONENTIAL";
|
|
89231
|
-
/**
|
|
89232
|
-
* Linear retry. Retry time delay grows linearly.
|
|
89233
|
-
*/
|
|
89234
|
-
StorageRetryPolicyType[StorageRetryPolicyType["FIXED"] = 1] = "FIXED";
|
|
89235
|
-
})(StorageRetryPolicyType || (exports.StorageRetryPolicyType = StorageRetryPolicyType = {}));
|
|
89236
|
-
//# sourceMappingURL=StorageRetryPolicyType.js.map
|
|
89237
|
-
|
|
89238
|
-
/***/ }),
|
|
89239
|
-
|
|
89240
|
-
/***/ 31160:
|
|
89241
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
89242
|
-
|
|
89243
|
-
"use strict";
|
|
89244
|
-
|
|
89245
|
-
// Copyright (c) Microsoft Corporation.
|
|
89246
|
-
// Licensed under the MIT License.
|
|
89247
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
89248
|
-
exports.storageRetryPolicyName = void 0;
|
|
89249
|
-
exports.storageRetryPolicy = storageRetryPolicy;
|
|
89250
|
-
const abort_controller_1 = __nccwpck_require__(24517);
|
|
89251
|
-
const core_rest_pipeline_1 = __nccwpck_require__(20778);
|
|
89252
|
-
const core_util_1 = __nccwpck_require__(87779);
|
|
89253
|
-
const StorageRetryPolicyFactory_js_1 = __nccwpck_require__(98335);
|
|
89254
|
-
const constants_js_1 = __nccwpck_require__(27323);
|
|
89255
|
-
const utils_common_js_1 = __nccwpck_require__(47764);
|
|
89256
|
-
const log_js_1 = __nccwpck_require__(46370);
|
|
89257
|
-
/**
|
|
89258
|
-
* Name of the {@link storageRetryPolicy}
|
|
89259
|
-
*/
|
|
89260
|
-
exports.storageRetryPolicyName = "storageRetryPolicy";
|
|
89261
|
-
// Default values of StorageRetryOptions
|
|
89262
|
-
const DEFAULT_RETRY_OPTIONS = {
|
|
89263
|
-
maxRetryDelayInMs: 120 * 1000,
|
|
89264
|
-
maxTries: 4,
|
|
89265
|
-
retryDelayInMs: 4 * 1000,
|
|
89266
|
-
retryPolicyType: StorageRetryPolicyFactory_js_1.StorageRetryPolicyType.EXPONENTIAL,
|
|
89267
|
-
secondaryHost: "",
|
|
89268
|
-
tryTimeoutInMs: undefined, // Use server side default timeout strategy
|
|
89269
|
-
};
|
|
89270
|
-
const retriableErrors = [
|
|
89271
|
-
"ETIMEDOUT",
|
|
89272
|
-
"ESOCKETTIMEDOUT",
|
|
89273
|
-
"ECONNREFUSED",
|
|
89274
|
-
"ECONNRESET",
|
|
89275
|
-
"ENOENT",
|
|
89276
|
-
"ENOTFOUND",
|
|
89277
|
-
"TIMEOUT",
|
|
89278
|
-
"EPIPE",
|
|
89279
|
-
"REQUEST_SEND_ERROR",
|
|
89280
|
-
];
|
|
89281
|
-
const RETRY_ABORT_ERROR = new abort_controller_1.AbortError("The operation was aborted.");
|
|
89282
|
-
/**
|
|
89283
|
-
* Retry policy with exponential retry and linear retry implemented.
|
|
89284
|
-
*/
|
|
89285
|
-
function storageRetryPolicy(options = {}) {
|
|
89286
|
-
const retryPolicyType = options.retryPolicyType ?? DEFAULT_RETRY_OPTIONS.retryPolicyType;
|
|
89287
|
-
const maxTries = options.maxTries ?? DEFAULT_RETRY_OPTIONS.maxTries;
|
|
89288
|
-
const retryDelayInMs = options.retryDelayInMs ?? DEFAULT_RETRY_OPTIONS.retryDelayInMs;
|
|
89289
|
-
const maxRetryDelayInMs = options.maxRetryDelayInMs ?? DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs;
|
|
89290
|
-
const secondaryHost = options.secondaryHost ?? DEFAULT_RETRY_OPTIONS.secondaryHost;
|
|
89291
|
-
const tryTimeoutInMs = options.tryTimeoutInMs ?? DEFAULT_RETRY_OPTIONS.tryTimeoutInMs;
|
|
89292
|
-
function shouldRetry({ isPrimaryRetry, attempt, response, error, }) {
|
|
89293
|
-
if (attempt >= maxTries) {
|
|
89294
|
-
log_js_1.logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`);
|
|
89295
|
-
return false;
|
|
89296
|
-
}
|
|
89297
|
-
if (error) {
|
|
89298
|
-
for (const retriableError of retriableErrors) {
|
|
89299
|
-
if (error.name.toUpperCase().includes(retriableError) ||
|
|
89300
|
-
error.message.toUpperCase().includes(retriableError) ||
|
|
89301
|
-
(error.code && error.code.toString().toUpperCase() === retriableError)) {
|
|
89302
|
-
log_js_1.logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`);
|
|
89303
|
-
return true;
|
|
89304
|
-
}
|
|
89305
|
-
}
|
|
89306
|
-
if (error?.code === "PARSE_ERROR" &&
|
|
89307
|
-
error?.message.startsWith(`Error "Error: Unclosed root tag`)) {
|
|
89308
|
-
log_js_1.logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry.");
|
|
89309
|
-
return true;
|
|
89310
|
-
}
|
|
89311
|
-
}
|
|
89312
|
-
// If attempt was against the secondary & it returned a StatusNotFound (404), then
|
|
89313
|
-
// the resource was not found. This may be due to replication delay. So, in this
|
|
89314
|
-
// case, we'll never try the secondary again for this operation.
|
|
89315
|
-
if (response || error) {
|
|
89316
|
-
const statusCode = response?.status ?? error?.statusCode ?? 0;
|
|
89317
|
-
if (!isPrimaryRetry && statusCode === 404) {
|
|
89318
|
-
log_js_1.logger.info(`RetryPolicy: Secondary access with 404, will retry.`);
|
|
89319
|
-
return true;
|
|
89320
|
-
}
|
|
89321
|
-
// Server internal error or server timeout
|
|
89322
|
-
if (statusCode === 503 || statusCode === 500) {
|
|
89323
|
-
log_js_1.logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`);
|
|
89324
|
-
return true;
|
|
89325
|
-
}
|
|
89326
|
-
}
|
|
89327
|
-
if (response) {
|
|
89328
|
-
// Retry select Copy Source Error Codes.
|
|
89329
|
-
if (response?.status >= 400) {
|
|
89330
|
-
const copySourceError = response.headers.get(constants_js_1.HeaderConstants.X_MS_CopySourceErrorCode);
|
|
89331
|
-
if (copySourceError !== undefined) {
|
|
89332
|
-
switch (copySourceError) {
|
|
89333
|
-
case "InternalError":
|
|
89334
|
-
case "OperationTimedOut":
|
|
89335
|
-
case "ServerBusy":
|
|
89336
|
-
return true;
|
|
89337
|
-
}
|
|
89338
|
-
}
|
|
89339
|
-
}
|
|
89340
|
-
}
|
|
89341
|
-
return false;
|
|
89342
|
-
}
|
|
89343
|
-
function calculateDelay(isPrimaryRetry, attempt) {
|
|
89344
|
-
let delayTimeInMs = 0;
|
|
89345
|
-
if (isPrimaryRetry) {
|
|
89346
|
-
switch (retryPolicyType) {
|
|
89347
|
-
case StorageRetryPolicyFactory_js_1.StorageRetryPolicyType.EXPONENTIAL:
|
|
89348
|
-
delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * retryDelayInMs, maxRetryDelayInMs);
|
|
89349
|
-
break;
|
|
89350
|
-
case StorageRetryPolicyFactory_js_1.StorageRetryPolicyType.FIXED:
|
|
89351
|
-
delayTimeInMs = retryDelayInMs;
|
|
89352
|
-
break;
|
|
89353
|
-
}
|
|
89354
|
-
}
|
|
89355
|
-
else {
|
|
89356
|
-
delayTimeInMs = Math.random() * 1000;
|
|
89357
|
-
}
|
|
89358
|
-
log_js_1.logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`);
|
|
89359
|
-
return delayTimeInMs;
|
|
89360
|
-
}
|
|
89361
|
-
return {
|
|
89362
|
-
name: exports.storageRetryPolicyName,
|
|
89363
|
-
async sendRequest(request, next) {
|
|
89364
|
-
// Set the server-side timeout query parameter "timeout=[seconds]"
|
|
89365
|
-
if (tryTimeoutInMs) {
|
|
89366
|
-
request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1000)));
|
|
89367
|
-
}
|
|
89368
|
-
const primaryUrl = request.url;
|
|
89369
|
-
const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.url, secondaryHost) : undefined;
|
|
89370
|
-
let secondaryHas404 = false;
|
|
89371
|
-
let attempt = 1;
|
|
89372
|
-
let retryAgain = true;
|
|
89373
|
-
let response;
|
|
89374
|
-
let error;
|
|
89375
|
-
while (retryAgain) {
|
|
89376
|
-
const isPrimaryRetry = secondaryHas404 ||
|
|
89377
|
-
!secondaryUrl ||
|
|
89378
|
-
!["GET", "HEAD", "OPTIONS"].includes(request.method) ||
|
|
89379
|
-
attempt % 2 === 1;
|
|
89380
|
-
request.url = isPrimaryRetry ? primaryUrl : secondaryUrl;
|
|
89381
|
-
response = undefined;
|
|
89382
|
-
error = undefined;
|
|
89383
|
-
try {
|
|
89384
|
-
log_js_1.logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`);
|
|
89385
|
-
response = await next(request);
|
|
89386
|
-
secondaryHas404 = secondaryHas404 || (!isPrimaryRetry && response.status === 404);
|
|
89387
|
-
}
|
|
89388
|
-
catch (e) {
|
|
89389
|
-
if ((0, core_rest_pipeline_1.isRestError)(e)) {
|
|
89390
|
-
log_js_1.logger.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`);
|
|
89391
|
-
error = e;
|
|
89392
|
-
}
|
|
89393
|
-
else {
|
|
89394
|
-
log_js_1.logger.error(`RetryPolicy: Caught error, message: ${(0, core_util_1.getErrorMessage)(e)}`);
|
|
89395
|
-
throw e;
|
|
89396
|
-
}
|
|
89397
|
-
}
|
|
89398
|
-
retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error });
|
|
89399
|
-
if (retryAgain) {
|
|
89400
|
-
await (0, utils_common_js_1.delay)(calculateDelay(isPrimaryRetry, attempt), request.abortSignal, RETRY_ABORT_ERROR);
|
|
89401
|
-
}
|
|
89402
|
-
attempt++;
|
|
89403
|
-
}
|
|
89404
|
-
if (response) {
|
|
89405
|
-
return response;
|
|
89406
|
-
}
|
|
89407
|
-
throw error ?? new core_rest_pipeline_1.RestError("RetryPolicy failed without known error.");
|
|
89408
|
-
},
|
|
89409
|
-
};
|
|
89410
|
-
}
|
|
89411
|
-
//# sourceMappingURL=StorageRetryPolicyV2.js.map
|
|
89412
|
-
|
|
89413
|
-
/***/ }),
|
|
89414
|
-
|
|
89415
|
-
/***/ 45511:
|
|
89416
|
-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
89417
|
-
|
|
89418
|
-
"use strict";
|
|
89419
|
-
|
|
89420
|
-
// Copyright (c) Microsoft Corporation.
|
|
89421
|
-
// Licensed under the MIT License.
|
|
89422
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
89423
|
-
exports.StorageSharedKeyCredentialPolicy = void 0;
|
|
89424
|
-
const constants_js_1 = __nccwpck_require__(27323);
|
|
89425
|
-
const utils_common_js_1 = __nccwpck_require__(47764);
|
|
89426
|
-
const CredentialPolicy_js_1 = __nccwpck_require__(63064);
|
|
89427
|
-
const SharedKeyComparator_js_1 = __nccwpck_require__(21902);
|
|
89428
|
-
/**
|
|
89429
|
-
* StorageSharedKeyCredentialPolicy is a policy used to sign HTTP request with a shared key.
|
|
89430
|
-
*/
|
|
89431
|
-
class StorageSharedKeyCredentialPolicy extends CredentialPolicy_js_1.CredentialPolicy {
|
|
89432
|
-
/**
|
|
89433
|
-
* Reference to StorageSharedKeyCredential which generates StorageSharedKeyCredentialPolicy
|
|
89434
|
-
*/
|
|
89435
|
-
factory;
|
|
89436
|
-
/**
|
|
89437
|
-
* Creates an instance of StorageSharedKeyCredentialPolicy.
|
|
89438
|
-
* @param nextPolicy -
|
|
89439
|
-
* @param options -
|
|
89440
|
-
* @param factory -
|
|
89441
|
-
*/
|
|
89442
|
-
constructor(nextPolicy, options, factory) {
|
|
89443
|
-
super(nextPolicy, options);
|
|
89444
|
-
this.factory = factory;
|
|
89445
|
-
}
|
|
89446
|
-
/**
|
|
89447
|
-
* Signs request.
|
|
89448
|
-
*
|
|
89449
|
-
* @param request -
|
|
89450
|
-
*/
|
|
89451
|
-
signRequest(request) {
|
|
89452
|
-
request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, new Date().toUTCString());
|
|
89453
|
-
if (request.body &&
|
|
89454
|
-
(typeof request.body === "string" || request.body !== undefined) &&
|
|
89455
|
-
request.body.length > 0) {
|
|
89456
|
-
request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body));
|
|
89457
|
-
}
|
|
89458
|
-
const stringToSign = [
|
|
89459
|
-
request.method.toUpperCase(),
|
|
89460
|
-
this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE),
|
|
89461
|
-
this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING),
|
|
89462
|
-
this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH),
|
|
89463
|
-
this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5),
|
|
89464
|
-
this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE),
|
|
89465
|
-
this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE),
|
|
89466
|
-
this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE),
|
|
89467
|
-
this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH),
|
|
89468
|
-
this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH),
|
|
89469
|
-
this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE),
|
|
89470
|
-
this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE),
|
|
89471
|
-
].join("\n") +
|
|
89472
|
-
"\n" +
|
|
89473
|
-
this.getCanonicalizedHeadersString(request) +
|
|
89474
|
-
this.getCanonicalizedResourceString(request);
|
|
89475
|
-
const signature = this.factory.computeHMACSHA256(stringToSign);
|
|
89476
|
-
request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`);
|
|
89477
|
-
// console.log(`[URL]:${request.url}`);
|
|
89478
|
-
// console.log(`[HEADERS]:${request.headers.toString()}`);
|
|
89479
|
-
// console.log(`[STRING TO SIGN]:${JSON.stringify(stringToSign)}`);
|
|
89480
|
-
// console.log(`[KEY]: ${request.headers.get(HeaderConstants.AUTHORIZATION)}`);
|
|
89481
|
-
return request;
|
|
89482
|
-
}
|
|
89483
|
-
/**
|
|
89484
|
-
* Retrieve header value according to shared key sign rules.
|
|
89485
|
-
* @see https://learn.microsoft.com/rest/api/storageservices/authenticate-with-shared-key
|
|
89486
|
-
*
|
|
89487
|
-
* @param request -
|
|
89488
|
-
* @param headerName -
|
|
89489
|
-
*/
|
|
89490
|
-
getHeaderValueToSign(request, headerName) {
|
|
89491
|
-
const value = request.headers.get(headerName);
|
|
89492
|
-
if (!value) {
|
|
89493
|
-
return "";
|
|
89494
|
-
}
|
|
89495
|
-
// When using version 2015-02-21 or later, if Content-Length is zero, then
|
|
89496
|
-
// set the Content-Length part of the StringToSign to an empty string.
|
|
89497
|
-
// https://learn.microsoft.com/rest/api/storageservices/authenticate-with-shared-key
|
|
89498
|
-
if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") {
|
|
89499
|
-
return "";
|
|
89500
|
-
}
|
|
89501
|
-
return value;
|
|
89502
|
-
}
|
|
89503
|
-
/**
|
|
89504
|
-
* To construct the CanonicalizedHeaders portion of the signature string, follow these steps:
|
|
89505
|
-
* 1. Retrieve all headers for the resource that begin with x-ms-, including the x-ms-date header.
|
|
89506
|
-
* 2. Convert each HTTP header name to lowercase.
|
|
89507
|
-
* 3. Sort the headers lexicographically by header name, in ascending order.
|
|
89508
|
-
* Each header may appear only once in the string.
|
|
89509
|
-
* 4. Replace any linear whitespace in the header value with a single space.
|
|
89510
|
-
* 5. Trim any whitespace around the colon in the header.
|
|
89511
|
-
* 6. Finally, append a new-line character to each canonicalized header in the resulting list.
|
|
89512
|
-
* Construct the CanonicalizedHeaders string by concatenating all headers in this list into a single string.
|
|
89513
|
-
*
|
|
89514
|
-
* @param request -
|
|
89515
|
-
*/
|
|
89516
|
-
getCanonicalizedHeadersString(request) {
|
|
89517
|
-
let headersArray = request.headers.headersArray().filter((value) => {
|
|
89518
|
-
return value.name.toLowerCase().startsWith(constants_js_1.HeaderConstants.PREFIX_FOR_STORAGE);
|
|
89519
|
-
});
|
|
89520
|
-
headersArray.sort((a, b) => {
|
|
89521
|
-
return (0, SharedKeyComparator_js_1.compareHeader)(a.name.toLowerCase(), b.name.toLowerCase());
|
|
89522
|
-
});
|
|
89523
|
-
// Remove duplicate headers
|
|
89524
|
-
headersArray = headersArray.filter((value, index, array) => {
|
|
89525
|
-
if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) {
|
|
89526
|
-
return false;
|
|
89527
|
-
}
|
|
89528
|
-
return true;
|
|
89529
|
-
});
|
|
89530
|
-
let canonicalizedHeadersStringToSign = "";
|
|
89531
|
-
headersArray.forEach((header) => {
|
|
89532
|
-
canonicalizedHeadersStringToSign += `${header.name
|
|
89533
|
-
.toLowerCase()
|
|
89534
|
-
.trimRight()}:${header.value.trimLeft()}\n`;
|
|
89535
|
-
});
|
|
89536
|
-
return canonicalizedHeadersStringToSign;
|
|
89537
|
-
}
|
|
89538
|
-
/**
|
|
89539
|
-
* Retrieves the webResource canonicalized resource string.
|
|
89540
|
-
*
|
|
89541
|
-
* @param request -
|
|
89542
|
-
*/
|
|
89543
|
-
getCanonicalizedResourceString(request) {
|
|
89544
|
-
const path = (0, utils_common_js_1.getURLPath)(request.url) || "/";
|
|
89545
|
-
let canonicalizedResourceString = "";
|
|
89546
|
-
canonicalizedResourceString += `/${this.factory.accountName}${path}`;
|
|
89547
|
-
const queries = (0, utils_common_js_1.getURLQueries)(request.url);
|
|
89548
|
-
const lowercaseQueries = {};
|
|
89549
|
-
if (queries) {
|
|
89550
|
-
const queryKeys = [];
|
|
89551
|
-
for (const key in queries) {
|
|
89552
|
-
if (Object.prototype.hasOwnProperty.call(queries, key)) {
|
|
89553
|
-
const lowercaseKey = key.toLowerCase();
|
|
89554
|
-
lowercaseQueries[lowercaseKey] = queries[key];
|
|
89555
|
-
queryKeys.push(lowercaseKey);
|
|
88352
|
+
hasNext() {
|
|
88353
|
+
return !this._initialized || this._itemsRemainingInBlock > 0;
|
|
88354
|
+
}
|
|
88355
|
+
async *parseObjects(options = {}) {
|
|
88356
|
+
if (!this._initialized) {
|
|
88357
|
+
await this.initialize(options);
|
|
88358
|
+
}
|
|
88359
|
+
while (this.hasNext()) {
|
|
88360
|
+
const result = await this._itemType.read(this._dataStream, {
|
|
88361
|
+
abortSignal: options.abortSignal,
|
|
88362
|
+
});
|
|
88363
|
+
this._itemsRemainingInBlock--;
|
|
88364
|
+
this._objectIndex++;
|
|
88365
|
+
if (this._itemsRemainingInBlock === 0) {
|
|
88366
|
+
const marker = await AvroParser_js_1.AvroParser.readFixedBytes(this._dataStream, AvroConstants_js_1.AVRO_SYNC_MARKER_SIZE, {
|
|
88367
|
+
abortSignal: options.abortSignal,
|
|
88368
|
+
});
|
|
88369
|
+
this._blockOffset = this._initialBlockOffset + this._dataStream.position;
|
|
88370
|
+
this._objectIndex = 0;
|
|
88371
|
+
if (!(0, utils_common_js_1.arraysEqual)(this._syncMarker, marker)) {
|
|
88372
|
+
throw new Error("Stream is not a valid Avro file.");
|
|
88373
|
+
}
|
|
88374
|
+
try {
|
|
88375
|
+
this._itemsRemainingInBlock = await AvroParser_js_1.AvroParser.readLong(this._dataStream, {
|
|
88376
|
+
abortSignal: options.abortSignal,
|
|
88377
|
+
});
|
|
88378
|
+
}
|
|
88379
|
+
catch {
|
|
88380
|
+
// We hit the end of the stream.
|
|
88381
|
+
this._itemsRemainingInBlock = 0;
|
|
88382
|
+
}
|
|
88383
|
+
if (this._itemsRemainingInBlock > 0) {
|
|
88384
|
+
// Ignore block size
|
|
88385
|
+
await AvroParser_js_1.AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal });
|
|
89556
88386
|
}
|
|
89557
88387
|
}
|
|
89558
|
-
|
|
89559
|
-
for (const key of queryKeys) {
|
|
89560
|
-
canonicalizedResourceString += `\n${key}:${decodeURIComponent(lowercaseQueries[key])}`;
|
|
89561
|
-
}
|
|
88388
|
+
yield result;
|
|
89562
88389
|
}
|
|
89563
|
-
return canonicalizedResourceString;
|
|
89564
88390
|
}
|
|
89565
88391
|
}
|
|
89566
|
-
exports.
|
|
89567
|
-
//# sourceMappingURL=
|
|
88392
|
+
exports.AvroReader = AvroReader;
|
|
88393
|
+
//# sourceMappingURL=AvroReader.js.map
|
|
89568
88394
|
|
|
89569
88395
|
/***/ }),
|
|
89570
88396
|
|
|
89571
|
-
/***/
|
|
88397
|
+
/***/ 96147:
|
|
89572
88398
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
89573
88399
|
|
|
89574
88400
|
"use strict";
|
|
@@ -89576,138 +88402,186 @@ exports.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy;
|
|
|
89576
88402
|
// Copyright (c) Microsoft Corporation.
|
|
89577
88403
|
// Licensed under the MIT License.
|
|
89578
88404
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
89579
|
-
exports.
|
|
89580
|
-
|
|
89581
|
-
|
|
88405
|
+
exports.AvroReadableFromStream = exports.AvroReadable = exports.AvroReader = void 0;
|
|
88406
|
+
var AvroReader_js_1 = __nccwpck_require__(52888);
|
|
88407
|
+
Object.defineProperty(exports, "AvroReader", ({ enumerable: true, get: function () { return AvroReader_js_1.AvroReader; } }));
|
|
88408
|
+
var AvroReadable_js_1 = __nccwpck_require__(41675);
|
|
88409
|
+
Object.defineProperty(exports, "AvroReadable", ({ enumerable: true, get: function () { return AvroReadable_js_1.AvroReadable; } }));
|
|
88410
|
+
var AvroReadableFromStream_js_1 = __nccwpck_require__(48059);
|
|
88411
|
+
Object.defineProperty(exports, "AvroReadableFromStream", ({ enumerable: true, get: function () { return AvroReadableFromStream_js_1.AvroReadableFromStream; } }));
|
|
88412
|
+
//# sourceMappingURL=index.js.map
|
|
88413
|
+
|
|
88414
|
+
/***/ }),
|
|
88415
|
+
|
|
88416
|
+
/***/ 4337:
|
|
88417
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
88418
|
+
|
|
88419
|
+
"use strict";
|
|
88420
|
+
|
|
88421
|
+
// Copyright (c) Microsoft Corporation.
|
|
88422
|
+
// Licensed under the MIT License.
|
|
88423
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
88424
|
+
exports.arraysEqual = arraysEqual;
|
|
88425
|
+
function arraysEqual(a, b) {
|
|
88426
|
+
if (a === b)
|
|
88427
|
+
return true;
|
|
88428
|
+
if (a == null || b == null)
|
|
88429
|
+
return false;
|
|
88430
|
+
if (a.length !== b.length)
|
|
88431
|
+
return false;
|
|
88432
|
+
for (let i = 0; i < a.length; ++i) {
|
|
88433
|
+
if (a[i] !== b[i])
|
|
88434
|
+
return false;
|
|
88435
|
+
}
|
|
88436
|
+
return true;
|
|
88437
|
+
}
|
|
88438
|
+
//# sourceMappingURL=utils.common.js.map
|
|
88439
|
+
|
|
88440
|
+
/***/ }),
|
|
88441
|
+
|
|
88442
|
+
/***/ 46370:
|
|
88443
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
88444
|
+
|
|
88445
|
+
"use strict";
|
|
88446
|
+
|
|
88447
|
+
// Copyright (c) Microsoft Corporation.
|
|
88448
|
+
// Licensed under the MIT License.
|
|
88449
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
88450
|
+
exports.logger = void 0;
|
|
88451
|
+
const logger_1 = __nccwpck_require__(26515);
|
|
88452
|
+
/**
|
|
88453
|
+
* The `@azure/logger` configuration for this package.
|
|
88454
|
+
*/
|
|
88455
|
+
exports.logger = (0, logger_1.createClientLogger)("storage-blob");
|
|
88456
|
+
//# sourceMappingURL=log.js.map
|
|
88457
|
+
|
|
88458
|
+
/***/ }),
|
|
88459
|
+
|
|
88460
|
+
/***/ 58560:
|
|
88461
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
88462
|
+
|
|
88463
|
+
"use strict";
|
|
88464
|
+
|
|
88465
|
+
// Copyright (c) Microsoft Corporation.
|
|
88466
|
+
// Licensed under the MIT License.
|
|
88467
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
88468
|
+
exports.StorageBlobAudience = exports.PremiumPageBlobTier = exports.BlockBlobTier = void 0;
|
|
88469
|
+
exports.toAccessTier = toAccessTier;
|
|
88470
|
+
exports.ensureCpkIfSpecified = ensureCpkIfSpecified;
|
|
88471
|
+
exports.getBlobServiceAccountAudience = getBlobServiceAccountAudience;
|
|
89582
88472
|
const constants_js_1 = __nccwpck_require__(27323);
|
|
89583
|
-
const utils_common_js_1 = __nccwpck_require__(47764);
|
|
89584
|
-
const SharedKeyComparator_js_1 = __nccwpck_require__(21902);
|
|
89585
88473
|
/**
|
|
89586
|
-
*
|
|
88474
|
+
* Represents the access tier on a blob.
|
|
88475
|
+
* For detailed information about block blob level tiering see {@link https://learn.microsoft.com/azure/storage/blobs/storage-blob-storage-tiers|Hot, cool and archive storage tiers.}
|
|
89587
88476
|
*/
|
|
89588
|
-
|
|
88477
|
+
var BlockBlobTier;
|
|
88478
|
+
(function (BlockBlobTier) {
|
|
88479
|
+
/**
|
|
88480
|
+
* Optimized for storing data that is accessed frequently.
|
|
88481
|
+
*/
|
|
88482
|
+
BlockBlobTier["Hot"] = "Hot";
|
|
88483
|
+
/**
|
|
88484
|
+
* Optimized for storing data that is infrequently accessed and stored for at least 30 days.
|
|
88485
|
+
*/
|
|
88486
|
+
BlockBlobTier["Cool"] = "Cool";
|
|
88487
|
+
/**
|
|
88488
|
+
* Optimized for storing data that is rarely accessed.
|
|
88489
|
+
*/
|
|
88490
|
+
BlockBlobTier["Cold"] = "Cold";
|
|
88491
|
+
/**
|
|
88492
|
+
* Optimized for storing data that is rarely accessed and stored for at least 180 days
|
|
88493
|
+
* with flexible latency requirements (on the order of hours).
|
|
88494
|
+
*/
|
|
88495
|
+
BlockBlobTier["Archive"] = "Archive";
|
|
88496
|
+
})(BlockBlobTier || (exports.BlockBlobTier = BlockBlobTier = {}));
|
|
89589
88497
|
/**
|
|
89590
|
-
*
|
|
88498
|
+
* Specifies the page blob tier to set the blob to. This is only applicable to page blobs on premium storage accounts.
|
|
88499
|
+
* Please see {@link https://learn.microsoft.com/azure/storage/storage-premium-storage#scalability-and-performance-targets|here}
|
|
88500
|
+
* for detailed information on the corresponding IOPS and throughput per PageBlobTier.
|
|
89591
88501
|
*/
|
|
89592
|
-
|
|
89593
|
-
|
|
89594
|
-
request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, new Date().toUTCString());
|
|
89595
|
-
if (request.body &&
|
|
89596
|
-
(typeof request.body === "string" || Buffer.isBuffer(request.body)) &&
|
|
89597
|
-
request.body.length > 0) {
|
|
89598
|
-
request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body));
|
|
89599
|
-
}
|
|
89600
|
-
const stringToSign = [
|
|
89601
|
-
request.method.toUpperCase(),
|
|
89602
|
-
getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE),
|
|
89603
|
-
getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING),
|
|
89604
|
-
getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH),
|
|
89605
|
-
getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5),
|
|
89606
|
-
getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE),
|
|
89607
|
-
getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE),
|
|
89608
|
-
getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE),
|
|
89609
|
-
getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH),
|
|
89610
|
-
getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH),
|
|
89611
|
-
getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE),
|
|
89612
|
-
getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE),
|
|
89613
|
-
].join("\n") +
|
|
89614
|
-
"\n" +
|
|
89615
|
-
getCanonicalizedHeadersString(request) +
|
|
89616
|
-
getCanonicalizedResourceString(request);
|
|
89617
|
-
const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey)
|
|
89618
|
-
.update(stringToSign, "utf8")
|
|
89619
|
-
.digest("base64");
|
|
89620
|
-
request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`);
|
|
89621
|
-
// console.log(`[URL]:${request.url}`);
|
|
89622
|
-
// console.log(`[HEADERS]:${request.headers.toString()}`);
|
|
89623
|
-
// console.log(`[STRING TO SIGN]:${JSON.stringify(stringToSign)}`);
|
|
89624
|
-
// console.log(`[KEY]: ${request.headers.get(HeaderConstants.AUTHORIZATION)}`);
|
|
89625
|
-
}
|
|
88502
|
+
var PremiumPageBlobTier;
|
|
88503
|
+
(function (PremiumPageBlobTier) {
|
|
89626
88504
|
/**
|
|
89627
|
-
*
|
|
89628
|
-
* @see https://learn.microsoft.com/rest/api/storageservices/authenticate-with-shared-key
|
|
88505
|
+
* P4 Tier.
|
|
89629
88506
|
*/
|
|
89630
|
-
|
|
89631
|
-
const value = request.headers.get(headerName);
|
|
89632
|
-
if (!value) {
|
|
89633
|
-
return "";
|
|
89634
|
-
}
|
|
89635
|
-
// When using version 2015-02-21 or later, if Content-Length is zero, then
|
|
89636
|
-
// set the Content-Length part of the StringToSign to an empty string.
|
|
89637
|
-
// https://learn.microsoft.com/rest/api/storageservices/authenticate-with-shared-key
|
|
89638
|
-
if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") {
|
|
89639
|
-
return "";
|
|
89640
|
-
}
|
|
89641
|
-
return value;
|
|
89642
|
-
}
|
|
88507
|
+
PremiumPageBlobTier["P4"] = "P4";
|
|
89643
88508
|
/**
|
|
89644
|
-
*
|
|
89645
|
-
* 1. Retrieve all headers for the resource that begin with x-ms-, including the x-ms-date header.
|
|
89646
|
-
* 2. Convert each HTTP header name to lowercase.
|
|
89647
|
-
* 3. Sort the headers lexicographically by header name, in ascending order.
|
|
89648
|
-
* Each header may appear only once in the string.
|
|
89649
|
-
* 4. Replace any linear whitespace in the header value with a single space.
|
|
89650
|
-
* 5. Trim any whitespace around the colon in the header.
|
|
89651
|
-
* 6. Finally, append a new-line character to each canonicalized header in the resulting list.
|
|
89652
|
-
* Construct the CanonicalizedHeaders string by concatenating all headers in this list into a single string.
|
|
89653
|
-
*
|
|
88509
|
+
* P6 Tier.
|
|
89654
88510
|
*/
|
|
89655
|
-
|
|
89656
|
-
|
|
89657
|
-
|
|
89658
|
-
|
|
89659
|
-
|
|
89660
|
-
|
|
89661
|
-
|
|
89662
|
-
|
|
89663
|
-
|
|
89664
|
-
|
|
89665
|
-
|
|
89666
|
-
|
|
89667
|
-
|
|
89668
|
-
|
|
89669
|
-
|
|
89670
|
-
|
|
89671
|
-
|
|
89672
|
-
|
|
89673
|
-
|
|
89674
|
-
|
|
89675
|
-
|
|
89676
|
-
|
|
89677
|
-
|
|
89678
|
-
|
|
88511
|
+
PremiumPageBlobTier["P6"] = "P6";
|
|
88512
|
+
/**
|
|
88513
|
+
* P10 Tier.
|
|
88514
|
+
*/
|
|
88515
|
+
PremiumPageBlobTier["P10"] = "P10";
|
|
88516
|
+
/**
|
|
88517
|
+
* P15 Tier.
|
|
88518
|
+
*/
|
|
88519
|
+
PremiumPageBlobTier["P15"] = "P15";
|
|
88520
|
+
/**
|
|
88521
|
+
* P20 Tier.
|
|
88522
|
+
*/
|
|
88523
|
+
PremiumPageBlobTier["P20"] = "P20";
|
|
88524
|
+
/**
|
|
88525
|
+
* P30 Tier.
|
|
88526
|
+
*/
|
|
88527
|
+
PremiumPageBlobTier["P30"] = "P30";
|
|
88528
|
+
/**
|
|
88529
|
+
* P40 Tier.
|
|
88530
|
+
*/
|
|
88531
|
+
PremiumPageBlobTier["P40"] = "P40";
|
|
88532
|
+
/**
|
|
88533
|
+
* P50 Tier.
|
|
88534
|
+
*/
|
|
88535
|
+
PremiumPageBlobTier["P50"] = "P50";
|
|
88536
|
+
/**
|
|
88537
|
+
* P60 Tier.
|
|
88538
|
+
*/
|
|
88539
|
+
PremiumPageBlobTier["P60"] = "P60";
|
|
88540
|
+
/**
|
|
88541
|
+
* P70 Tier.
|
|
88542
|
+
*/
|
|
88543
|
+
PremiumPageBlobTier["P70"] = "P70";
|
|
88544
|
+
/**
|
|
88545
|
+
* P80 Tier.
|
|
88546
|
+
*/
|
|
88547
|
+
PremiumPageBlobTier["P80"] = "P80";
|
|
88548
|
+
})(PremiumPageBlobTier || (exports.PremiumPageBlobTier = PremiumPageBlobTier = {}));
|
|
88549
|
+
function toAccessTier(tier) {
|
|
88550
|
+
if (tier === undefined) {
|
|
88551
|
+
return undefined;
|
|
89679
88552
|
}
|
|
89680
|
-
|
|
89681
|
-
|
|
89682
|
-
|
|
89683
|
-
|
|
89684
|
-
|
|
89685
|
-
|
|
89686
|
-
|
|
89687
|
-
|
|
89688
|
-
for (const key in queries) {
|
|
89689
|
-
if (Object.prototype.hasOwnProperty.call(queries, key)) {
|
|
89690
|
-
const lowercaseKey = key.toLowerCase();
|
|
89691
|
-
lowercaseQueries[lowercaseKey] = queries[key];
|
|
89692
|
-
queryKeys.push(lowercaseKey);
|
|
89693
|
-
}
|
|
89694
|
-
}
|
|
89695
|
-
queryKeys.sort();
|
|
89696
|
-
for (const key of queryKeys) {
|
|
89697
|
-
canonicalizedResourceString += `\n${key}:${decodeURIComponent(lowercaseQueries[key])}`;
|
|
89698
|
-
}
|
|
89699
|
-
}
|
|
89700
|
-
return canonicalizedResourceString;
|
|
88553
|
+
return tier; // No more check if string is a valid AccessTier, and left this to underlay logic to decide(service).
|
|
88554
|
+
}
|
|
88555
|
+
function ensureCpkIfSpecified(cpk, isHttps) {
|
|
88556
|
+
if (cpk && !isHttps) {
|
|
88557
|
+
throw new RangeError("Customer-provided encryption key must be used over HTTPS.");
|
|
88558
|
+
}
|
|
88559
|
+
if (cpk && !cpk.encryptionAlgorithm) {
|
|
88560
|
+
cpk.encryptionAlgorithm = constants_js_1.EncryptionAlgorithmAES25;
|
|
89701
88561
|
}
|
|
89702
|
-
return {
|
|
89703
|
-
name: exports.storageSharedKeyCredentialPolicyName,
|
|
89704
|
-
async sendRequest(request, next) {
|
|
89705
|
-
signRequest(request);
|
|
89706
|
-
return next(request);
|
|
89707
|
-
},
|
|
89708
|
-
};
|
|
89709
88562
|
}
|
|
89710
|
-
|
|
88563
|
+
/**
|
|
88564
|
+
* Defines the known cloud audiences for Storage.
|
|
88565
|
+
*/
|
|
88566
|
+
var StorageBlobAudience;
|
|
88567
|
+
(function (StorageBlobAudience) {
|
|
88568
|
+
/**
|
|
88569
|
+
* The OAuth scope to use to retrieve an AAD token for Azure Storage.
|
|
88570
|
+
*/
|
|
88571
|
+
StorageBlobAudience["StorageOAuthScopes"] = "https://storage.azure.com/.default";
|
|
88572
|
+
/**
|
|
88573
|
+
* The OAuth scope to use to retrieve an AAD token for Azure Disk.
|
|
88574
|
+
*/
|
|
88575
|
+
StorageBlobAudience["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default";
|
|
88576
|
+
})(StorageBlobAudience || (exports.StorageBlobAudience = StorageBlobAudience = {}));
|
|
88577
|
+
/**
|
|
88578
|
+
*
|
|
88579
|
+
* To get OAuth audience for a storage account for blob service.
|
|
88580
|
+
*/
|
|
88581
|
+
function getBlobServiceAccountAudience(storageAccountName) {
|
|
88582
|
+
return `https://${storageAccountName}.blob.core.windows.net/.default`;
|
|
88583
|
+
}
|
|
88584
|
+
//# sourceMappingURL=models.js.map
|
|
89711
88585
|
|
|
89712
88586
|
/***/ }),
|
|
89713
88587
|
|
|
@@ -90589,23 +89463,23 @@ exports.generateBlobSASQueryParametersInternal = generateBlobSASQueryParametersI
|
|
|
90589
89463
|
// Licensed under the MIT License.
|
|
90590
89464
|
const BlobSASPermissions_js_1 = __nccwpck_require__(2232);
|
|
90591
89465
|
const ContainerSASPermissions_js_1 = __nccwpck_require__(51622);
|
|
90592
|
-
const
|
|
90593
|
-
const UserDelegationKeyCredential_js_1 = __nccwpck_require__(10992);
|
|
89466
|
+
const storage_common_1 = __nccwpck_require__(51382);
|
|
90594
89467
|
const SasIPRange_js_1 = __nccwpck_require__(2977);
|
|
90595
89468
|
const SASQueryParameters_js_1 = __nccwpck_require__(26823);
|
|
90596
89469
|
const constants_js_1 = __nccwpck_require__(27323);
|
|
90597
89470
|
const utils_common_js_1 = __nccwpck_require__(47764);
|
|
89471
|
+
const storage_common_2 = __nccwpck_require__(51382);
|
|
90598
89472
|
function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) {
|
|
90599
89473
|
return generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName).sasQueryParameters;
|
|
90600
89474
|
}
|
|
90601
89475
|
function generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) {
|
|
90602
89476
|
const version = blobSASSignatureValues.version ? blobSASSignatureValues.version : constants_js_1.SERVICE_VERSION;
|
|
90603
|
-
const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof
|
|
89477
|
+
const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof storage_common_1.StorageSharedKeyCredential
|
|
90604
89478
|
? sharedKeyCredentialOrUserDelegationKey
|
|
90605
89479
|
: undefined;
|
|
90606
89480
|
let userDelegationKeyCredential;
|
|
90607
89481
|
if (sharedKeyCredential === undefined && accountName !== undefined) {
|
|
90608
|
-
userDelegationKeyCredential = new
|
|
89482
|
+
userDelegationKeyCredential = new storage_common_2.UserDelegationKeyCredential(accountName, sharedKeyCredentialOrUserDelegationKey);
|
|
90609
89483
|
}
|
|
90610
89484
|
if (sharedKeyCredential === undefined && userDelegationKeyCredential === undefined) {
|
|
90611
89485
|
throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName.");
|
|
@@ -91168,7 +90042,7 @@ function generateBlobSASQueryParametersUDK20250705(blobSASSignatureValues, userD
|
|
|
91168
90042
|
undefined, // agentObjectId
|
|
91169
90043
|
blobSASSignatureValues.correlationId,
|
|
91170
90044
|
undefined, // SignedKeyDelegatedUserTenantId, will be added in a future release.
|
|
91171
|
-
|
|
90045
|
+
blobSASSignatureValues.delegatedUserObjectId,
|
|
91172
90046
|
blobSASSignatureValues.ipRange ? (0, SasIPRange_js_1.ipRangeToString)(blobSASSignatureValues.ipRange) : "",
|
|
91173
90047
|
blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
|
|
91174
90048
|
blobSASSignatureValues.version,
|
|
@@ -91183,7 +90057,7 @@ function generateBlobSASQueryParametersUDK20250705(blobSASSignatureValues, userD
|
|
|
91183
90057
|
].join("\n");
|
|
91184
90058
|
const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign);
|
|
91185
90059
|
return {
|
|
91186
|
-
sasQueryParameters: new SASQueryParameters_js_1.SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey, blobSASSignatureValues.preauthorizedAgentObjectId, blobSASSignatureValues.correlationId, blobSASSignatureValues.encryptionScope),
|
|
90060
|
+
sasQueryParameters: new SASQueryParameters_js_1.SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey, blobSASSignatureValues.preauthorizedAgentObjectId, blobSASSignatureValues.correlationId, blobSASSignatureValues.encryptionScope, blobSASSignatureValues.delegatedUserObjectId),
|
|
91187
90061
|
stringToSign: stringToSign,
|
|
91188
90062
|
};
|
|
91189
90063
|
}
|
|
@@ -91557,6 +90431,12 @@ class SASQueryParameters {
|
|
|
91557
90431
|
* @see https://learn.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy
|
|
91558
90432
|
*/
|
|
91559
90433
|
identifier;
|
|
90434
|
+
/**
|
|
90435
|
+
* Optional. Beginning in version 2025-07-05, this value specifies the Entra ID of the user would is authorized to
|
|
90436
|
+
* use the resulting SAS URL. The resulting SAS URL must be used in conjunction with an Entra ID token that has been
|
|
90437
|
+
* issued to the user specified in this value.
|
|
90438
|
+
*/
|
|
90439
|
+
delegatedUserObjectId;
|
|
91560
90440
|
/**
|
|
91561
90441
|
* Optional. Encryption scope to use when sending requests authorized with this SAS URI.
|
|
91562
90442
|
*/
|
|
@@ -91650,7 +90530,7 @@ class SASQueryParameters {
|
|
|
91650
90530
|
}
|
|
91651
90531
|
return undefined;
|
|
91652
90532
|
}
|
|
91653
|
-
constructor(version, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope) {
|
|
90533
|
+
constructor(version, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope, delegatedUserObjectId) {
|
|
91654
90534
|
this.version = version;
|
|
91655
90535
|
this.signature = signature;
|
|
91656
90536
|
if (permissionsOrOptions !== undefined && typeof permissionsOrOptions !== "string") {
|
|
@@ -91663,6 +90543,7 @@ class SASQueryParameters {
|
|
|
91663
90543
|
this.expiresOn = permissionsOrOptions.expiresOn;
|
|
91664
90544
|
this.ipRangeInner = permissionsOrOptions.ipRange;
|
|
91665
90545
|
this.identifier = permissionsOrOptions.identifier;
|
|
90546
|
+
this.delegatedUserObjectId = permissionsOrOptions.delegatedUserObjectId;
|
|
91666
90547
|
this.encryptionScope = permissionsOrOptions.encryptionScope;
|
|
91667
90548
|
this.resource = permissionsOrOptions.resource;
|
|
91668
90549
|
this.cacheControl = permissionsOrOptions.cacheControl;
|
|
@@ -91689,6 +90570,7 @@ class SASQueryParameters {
|
|
|
91689
90570
|
this.protocol = protocol;
|
|
91690
90571
|
this.startsOn = startsOn;
|
|
91691
90572
|
this.ipRangeInner = ipRange;
|
|
90573
|
+
this.delegatedUserObjectId = delegatedUserObjectId;
|
|
91692
90574
|
this.encryptionScope = encryptionScope;
|
|
91693
90575
|
this.identifier = identifier;
|
|
91694
90576
|
this.resource = resource;
|
|
@@ -91740,6 +90622,7 @@ class SASQueryParameters {
|
|
|
91740
90622
|
"rsct",
|
|
91741
90623
|
"saoid",
|
|
91742
90624
|
"scid",
|
|
90625
|
+
"sduoid", // Signed key user delegation object ID
|
|
91743
90626
|
];
|
|
91744
90627
|
const queries = [];
|
|
91745
90628
|
for (const param of params) {
|
|
@@ -91819,6 +90702,9 @@ class SASQueryParameters {
|
|
|
91819
90702
|
case "scid":
|
|
91820
90703
|
this.tryAppendQueryParameter(queries, param, this.correlationId);
|
|
91821
90704
|
break;
|
|
90705
|
+
case "sduoid":
|
|
90706
|
+
this.tryAppendQueryParameter(queries, param, this.delegatedUserObjectId);
|
|
90707
|
+
break;
|
|
91822
90708
|
}
|
|
91823
90709
|
}
|
|
91824
90710
|
return queries.join("&");
|
|
@@ -92351,89 +91237,6 @@ exports.RetriableReadableStream = RetriableReadableStream;
|
|
|
92351
91237
|
|
|
92352
91238
|
/***/ }),
|
|
92353
91239
|
|
|
92354
|
-
/***/ 21902:
|
|
92355
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
92356
|
-
|
|
92357
|
-
"use strict";
|
|
92358
|
-
|
|
92359
|
-
// Copyright (c) Microsoft Corporation.
|
|
92360
|
-
// Licensed under the MIT License.
|
|
92361
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
92362
|
-
exports.compareHeader = compareHeader;
|
|
92363
|
-
/*
|
|
92364
|
-
* We need to imitate .Net culture-aware sorting, which is used in storage service.
|
|
92365
|
-
* Below tables contain sort-keys for en-US culture.
|
|
92366
|
-
*/
|
|
92367
|
-
const table_lv0 = new Uint32Array([
|
|
92368
|
-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
|
92369
|
-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x71c, 0x0, 0x71f, 0x721,
|
|
92370
|
-
0x723, 0x725, 0x0, 0x0, 0x0, 0x72d, 0x803, 0x0, 0x0, 0x733, 0x0, 0xd03, 0xd1a, 0xd1c, 0xd1e,
|
|
92371
|
-
0xd20, 0xd22, 0xd24, 0xd26, 0xd28, 0xd2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe02, 0xe09, 0xe0a,
|
|
92372
|
-
0xe1a, 0xe21, 0xe23, 0xe25, 0xe2c, 0xe32, 0xe35, 0xe36, 0xe48, 0xe51, 0xe70, 0xe7c, 0xe7e, 0xe89,
|
|
92373
|
-
0xe8a, 0xe91, 0xe99, 0xe9f, 0xea2, 0xea4, 0xea6, 0xea7, 0xea9, 0x0, 0x0, 0x0, 0x743, 0x744, 0x748,
|
|
92374
|
-
0xe02, 0xe09, 0xe0a, 0xe1a, 0xe21, 0xe23, 0xe25, 0xe2c, 0xe32, 0xe35, 0xe36, 0xe48, 0xe51, 0xe70,
|
|
92375
|
-
0xe7c, 0xe7e, 0xe89, 0xe8a, 0xe91, 0xe99, 0xe9f, 0xea2, 0xea4, 0xea6, 0xea7, 0xea9, 0x0, 0x74c,
|
|
92376
|
-
0x0, 0x750, 0x0,
|
|
92377
|
-
]);
|
|
92378
|
-
const table_lv2 = new Uint32Array([
|
|
92379
|
-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
|
92380
|
-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
|
92381
|
-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
|
92382
|
-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12,
|
|
92383
|
-
0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12,
|
|
92384
|
-
0x12, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
|
92385
|
-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
|
92386
|
-
]);
|
|
92387
|
-
const table_lv4 = new Uint32Array([
|
|
92388
|
-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
|
92389
|
-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
|
92390
|
-
0x0, 0x8012, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8212, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
|
92391
|
-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
|
92392
|
-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
|
92393
|
-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
|
92394
|
-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
|
92395
|
-
]);
|
|
92396
|
-
function compareHeader(lhs, rhs) {
|
|
92397
|
-
if (isLessThan(lhs, rhs))
|
|
92398
|
-
return -1;
|
|
92399
|
-
return 1;
|
|
92400
|
-
}
|
|
92401
|
-
function isLessThan(lhs, rhs) {
|
|
92402
|
-
const tables = [table_lv0, table_lv2, table_lv4];
|
|
92403
|
-
let curr_level = 0;
|
|
92404
|
-
let i = 0;
|
|
92405
|
-
let j = 0;
|
|
92406
|
-
while (curr_level < tables.length) {
|
|
92407
|
-
if (curr_level === tables.length - 1 && i !== j) {
|
|
92408
|
-
return i > j;
|
|
92409
|
-
}
|
|
92410
|
-
const weight1 = i < lhs.length ? tables[curr_level][lhs[i].charCodeAt(0)] : 0x1;
|
|
92411
|
-
const weight2 = j < rhs.length ? tables[curr_level][rhs[j].charCodeAt(0)] : 0x1;
|
|
92412
|
-
if (weight1 === 0x1 && weight2 === 0x1) {
|
|
92413
|
-
i = 0;
|
|
92414
|
-
j = 0;
|
|
92415
|
-
++curr_level;
|
|
92416
|
-
}
|
|
92417
|
-
else if (weight1 === weight2) {
|
|
92418
|
-
++i;
|
|
92419
|
-
++j;
|
|
92420
|
-
}
|
|
92421
|
-
else if (weight1 === 0) {
|
|
92422
|
-
++i;
|
|
92423
|
-
}
|
|
92424
|
-
else if (weight2 === 0) {
|
|
92425
|
-
++j;
|
|
92426
|
-
}
|
|
92427
|
-
else {
|
|
92428
|
-
return weight1 < weight2;
|
|
92429
|
-
}
|
|
92430
|
-
}
|
|
92431
|
-
return false;
|
|
92432
|
-
}
|
|
92433
|
-
//# sourceMappingURL=SharedKeyComparator.js.map
|
|
92434
|
-
|
|
92435
|
-
/***/ }),
|
|
92436
|
-
|
|
92437
91240
|
/***/ 27323:
|
|
92438
91241
|
/***/ ((__unused_webpack_module, exports) => {
|
|
92439
91242
|
|
|
@@ -92443,8 +91246,8 @@ function isLessThan(lhs, rhs) {
|
|
|
92443
91246
|
// Licensed under the MIT License.
|
|
92444
91247
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
92445
91248
|
exports.PathStylePorts = exports.BlobDoesNotUseCustomerSpecifiedEncryption = exports.BlobUsesCustomerSpecifiedEncryptionMsg = exports.StorageBlobLoggingAllowedQueryParameters = exports.StorageBlobLoggingAllowedHeaderNames = exports.DevelopmentConnectionString = exports.EncryptionAlgorithmAES25 = exports.HTTP_VERSION_1_1 = exports.HTTP_LINE_ENDING = exports.BATCH_MAX_PAYLOAD_IN_BYTES = exports.BATCH_MAX_REQUEST = exports.SIZE_1_MB = exports.ETagAny = exports.ETagNone = exports.HeaderConstants = exports.HTTPURLConnection = exports.URLConstants = exports.StorageOAuthScopes = exports.REQUEST_TIMEOUT = exports.DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = exports.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = exports.DEFAULT_BLOCK_BUFFER_SIZE_BYTES = exports.BLOCK_BLOB_MAX_BLOCKS = exports.BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = exports.BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = exports.SERVICE_VERSION = exports.SDK_VERSION = void 0;
|
|
92446
|
-
exports.SDK_VERSION = "12.
|
|
92447
|
-
exports.SERVICE_VERSION = "
|
|
91249
|
+
exports.SDK_VERSION = "12.31.0";
|
|
91250
|
+
exports.SERVICE_VERSION = "2026-02-06";
|
|
92448
91251
|
exports.BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB
|
|
92449
91252
|
exports.BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB
|
|
92450
91253
|
exports.BLOCK_BLOB_MAX_BLOCKS = 50000;
|
|
@@ -94250,9 +93053,10 @@ exports.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory;
|
|
|
94250
93053
|
// Copyright (c) Microsoft Corporation.
|
|
94251
93054
|
// Licensed under the MIT License.
|
|
94252
93055
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
94253
|
-
exports.StorageRetryPolicyFactory = exports.StorageRetryPolicy = exports.StorageRetryPolicyType = void 0;
|
|
93056
|
+
exports.StorageRetryPolicyFactory = exports.NewRetryPolicyFactory = exports.StorageRetryPolicy = exports.StorageRetryPolicyType = void 0;
|
|
94254
93057
|
const StorageRetryPolicy_js_1 = __nccwpck_require__(27734);
|
|
94255
93058
|
Object.defineProperty(exports, "StorageRetryPolicy", ({ enumerable: true, get: function () { return StorageRetryPolicy_js_1.StorageRetryPolicy; } }));
|
|
93059
|
+
Object.defineProperty(exports, "NewRetryPolicyFactory", ({ enumerable: true, get: function () { return StorageRetryPolicy_js_1.NewRetryPolicyFactory; } }));
|
|
94256
93060
|
const StorageRetryPolicyType_js_1 = __nccwpck_require__(38622);
|
|
94257
93061
|
Object.defineProperty(exports, "StorageRetryPolicyType", ({ enumerable: true, get: function () { return StorageRetryPolicyType_js_1.StorageRetryPolicyType; } }));
|
|
94258
93062
|
/**
|
|
@@ -94424,6 +93228,60 @@ exports.StorageSharedKeyCredential = StorageSharedKeyCredential;
|
|
|
94424
93228
|
|
|
94425
93229
|
/***/ }),
|
|
94426
93230
|
|
|
93231
|
+
/***/ 3602:
|
|
93232
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
93233
|
+
|
|
93234
|
+
"use strict";
|
|
93235
|
+
|
|
93236
|
+
// Copyright (c) Microsoft Corporation.
|
|
93237
|
+
// Licensed under the MIT License.
|
|
93238
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
93239
|
+
exports.UserDelegationKeyCredential = void 0;
|
|
93240
|
+
const node_crypto_1 = __nccwpck_require__(77598);
|
|
93241
|
+
/**
|
|
93242
|
+
* ONLY AVAILABLE IN NODE.JS RUNTIME.
|
|
93243
|
+
*
|
|
93244
|
+
* UserDelegationKeyCredential is only used for generation of user delegation SAS.
|
|
93245
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/create-user-delegation-sas
|
|
93246
|
+
*/
|
|
93247
|
+
class UserDelegationKeyCredential {
|
|
93248
|
+
/**
|
|
93249
|
+
* Azure Storage account name; readonly.
|
|
93250
|
+
*/
|
|
93251
|
+
accountName;
|
|
93252
|
+
/**
|
|
93253
|
+
* Azure Storage user delegation key; readonly.
|
|
93254
|
+
*/
|
|
93255
|
+
userDelegationKey;
|
|
93256
|
+
/**
|
|
93257
|
+
* Key value in Buffer type.
|
|
93258
|
+
*/
|
|
93259
|
+
key;
|
|
93260
|
+
/**
|
|
93261
|
+
* Creates an instance of UserDelegationKeyCredential.
|
|
93262
|
+
* @param accountName -
|
|
93263
|
+
* @param userDelegationKey -
|
|
93264
|
+
*/
|
|
93265
|
+
constructor(accountName, userDelegationKey) {
|
|
93266
|
+
this.accountName = accountName;
|
|
93267
|
+
this.userDelegationKey = userDelegationKey;
|
|
93268
|
+
this.key = Buffer.from(userDelegationKey.value, "base64");
|
|
93269
|
+
}
|
|
93270
|
+
/**
|
|
93271
|
+
* Generates a hash signature for an HTTP request or for a SAS.
|
|
93272
|
+
*
|
|
93273
|
+
* @param stringToSign -
|
|
93274
|
+
*/
|
|
93275
|
+
computeHMACSHA256(stringToSign) {
|
|
93276
|
+
// console.log(`stringToSign: ${JSON.stringify(stringToSign)}`);
|
|
93277
|
+
return (0, node_crypto_1.createHmac)("sha256", this.key).update(stringToSign, "utf8").digest("base64");
|
|
93278
|
+
}
|
|
93279
|
+
}
|
|
93280
|
+
exports.UserDelegationKeyCredential = UserDelegationKeyCredential;
|
|
93281
|
+
//# sourceMappingURL=UserDelegationKeyCredential.js.map
|
|
93282
|
+
|
|
93283
|
+
/***/ }),
|
|
93284
|
+
|
|
94427
93285
|
/***/ 51382:
|
|
94428
93286
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
94429
93287
|
|
|
@@ -94437,6 +93295,7 @@ const tslib_1 = __nccwpck_require__(61860);
|
|
|
94437
93295
|
tslib_1.__exportStar(__nccwpck_require__(86381), exports);
|
|
94438
93296
|
var cache_js_1 = __nccwpck_require__(68376);
|
|
94439
93297
|
Object.defineProperty(exports, "getCachedDefaultHttpClient", ({ enumerable: true, get: function () { return cache_js_1.getCachedDefaultHttpClient; } }));
|
|
93298
|
+
tslib_1.__exportStar(__nccwpck_require__(81420), exports);
|
|
94440
93299
|
tslib_1.__exportStar(__nccwpck_require__(4399), exports);
|
|
94441
93300
|
tslib_1.__exportStar(__nccwpck_require__(32159), exports);
|
|
94442
93301
|
tslib_1.__exportStar(__nccwpck_require__(450), exports);
|
|
@@ -94446,20 +93305,29 @@ var RequestPolicy_js_1 = __nccwpck_require__(40590);
|
|
|
94446
93305
|
Object.defineProperty(exports, "BaseRequestPolicy", ({ enumerable: true, get: function () { return RequestPolicy_js_1.BaseRequestPolicy; } }));
|
|
94447
93306
|
tslib_1.__exportStar(__nccwpck_require__(63611), exports);
|
|
94448
93307
|
tslib_1.__exportStar(__nccwpck_require__(74238), exports);
|
|
94449
|
-
tslib_1.__exportStar(__nccwpck_require__(22312), exports);
|
|
94450
93308
|
tslib_1.__exportStar(__nccwpck_require__(83100), exports);
|
|
94451
93309
|
tslib_1.__exportStar(__nccwpck_require__(92505), exports);
|
|
94452
|
-
tslib_1.__exportStar(__nccwpck_require__(38622), exports);
|
|
94453
|
-
tslib_1.__exportStar(__nccwpck_require__(27734), exports);
|
|
94454
93310
|
tslib_1.__exportStar(__nccwpck_require__(78178), exports);
|
|
94455
93311
|
tslib_1.__exportStar(__nccwpck_require__(35369), exports);
|
|
94456
93312
|
tslib_1.__exportStar(__nccwpck_require__(53233), exports);
|
|
94457
|
-
tslib_1.__exportStar(__nccwpck_require__(77321), exports);
|
|
94458
93313
|
tslib_1.__exportStar(__nccwpck_require__(24174), exports);
|
|
93314
|
+
tslib_1.__exportStar(__nccwpck_require__(3602), exports);
|
|
94459
93315
|
//# sourceMappingURL=index.js.map
|
|
94460
93316
|
|
|
94461
93317
|
/***/ }),
|
|
94462
93318
|
|
|
93319
|
+
/***/ 81420:
|
|
93320
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
93321
|
+
|
|
93322
|
+
"use strict";
|
|
93323
|
+
|
|
93324
|
+
// Copyright (c) Microsoft Corporation.
|
|
93325
|
+
// Licensed under the MIT License.
|
|
93326
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
93327
|
+
//# sourceMappingURL=interfaces.js.map
|
|
93328
|
+
|
|
93329
|
+
/***/ }),
|
|
93330
|
+
|
|
94463
93331
|
/***/ 32780:
|
|
94464
93332
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
94465
93333
|
|
|
@@ -95288,7 +94156,7 @@ class StorageSharedKeyCredentialPolicy extends CredentialPolicy_js_1.CredentialP
|
|
|
95288
94156
|
}
|
|
95289
94157
|
/**
|
|
95290
94158
|
* Retrieve header value according to shared key sign rules.
|
|
95291
|
-
* @see https://learn.microsoft.com/
|
|
94159
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/authenticate-with-shared-key
|
|
95292
94160
|
*
|
|
95293
94161
|
* @param request -
|
|
95294
94162
|
* @param headerName -
|
|
@@ -95300,7 +94168,7 @@ class StorageSharedKeyCredentialPolicy extends CredentialPolicy_js_1.CredentialP
|
|
|
95300
94168
|
}
|
|
95301
94169
|
// When using version 2015-02-21 or later, if Content-Length is zero, then
|
|
95302
94170
|
// set the Content-Length part of the StringToSign to an empty string.
|
|
95303
|
-
// https://learn.microsoft.com/
|
|
94171
|
+
// https://learn.microsoft.com/rest/api/storageservices/authenticate-with-shared-key
|
|
95304
94172
|
if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") {
|
|
95305
94173
|
return "";
|
|
95306
94174
|
}
|
|
@@ -95431,7 +94299,7 @@ function storageSharedKeyCredentialPolicy(options) {
|
|
|
95431
94299
|
}
|
|
95432
94300
|
/**
|
|
95433
94301
|
* Retrieve header value according to shared key sign rules.
|
|
95434
|
-
* @see https://learn.microsoft.com/
|
|
94302
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/authenticate-with-shared-key
|
|
95435
94303
|
*/
|
|
95436
94304
|
function getHeaderValueToSign(request, headerName) {
|
|
95437
94305
|
const value = request.headers.get(headerName);
|
|
@@ -95440,7 +94308,7 @@ function storageSharedKeyCredentialPolicy(options) {
|
|
|
95440
94308
|
}
|
|
95441
94309
|
// When using version 2015-02-21 or later, if Content-Length is zero, then
|
|
95442
94310
|
// set the Content-Length part of the StringToSign to an empty string.
|
|
95443
|
-
// https://learn.microsoft.com/
|
|
94311
|
+
// https://learn.microsoft.com/rest/api/storageservices/authenticate-with-shared-key
|
|
95444
94312
|
if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") {
|
|
95445
94313
|
return "";
|
|
95446
94314
|
}
|
|
@@ -95759,8 +94627,8 @@ const constants_js_1 = __nccwpck_require__(77925);
|
|
|
95759
94627
|
*
|
|
95760
94628
|
* We will apply strategy one, and call encodeURIComponent for these parameters like blobName. Because what customers passes in is a plain name instead of a URL.
|
|
95761
94629
|
*
|
|
95762
|
-
* @see https://learn.microsoft.com/
|
|
95763
|
-
* @see https://learn.microsoft.com/
|
|
94630
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata
|
|
94631
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-shares--directories--files--and-metadata
|
|
95764
94632
|
*
|
|
95765
94633
|
* @param url -
|
|
95766
94634
|
*/
|
|
@@ -95774,7 +94642,7 @@ function escapeURLPath(url) {
|
|
|
95774
94642
|
}
|
|
95775
94643
|
function getProxyUriFromDevConnString(connectionString) {
|
|
95776
94644
|
// Development Connection String
|
|
95777
|
-
// https://learn.microsoft.com/
|
|
94645
|
+
// https://learn.microsoft.com/azure/storage/common/storage-configure-connection-string#connect-to-the-emulator-account-using-the-well-known-account-name-and-key
|
|
95778
94646
|
let proxyUri = "";
|
|
95779
94647
|
if (connectionString.search("DevelopmentStorageProxyUri=") !== -1) {
|
|
95780
94648
|
// CONNECTION_STRING=UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://myProxyUri
|
|
@@ -96872,6 +95740,9 @@ function getRequestContentType(options = {}) {
|
|
|
96872
95740
|
* @returns returns the content-type
|
|
96873
95741
|
*/
|
|
96874
95742
|
function getContentType(body) {
|
|
95743
|
+
if (body === undefined) {
|
|
95744
|
+
return undefined;
|
|
95745
|
+
}
|
|
96875
95746
|
if (ArrayBuffer.isView(body)) {
|
|
96876
95747
|
return "application/octet-stream";
|
|
96877
95748
|
}
|
|
@@ -96891,12 +95762,10 @@ function getContentType(body) {
|
|
|
96891
95762
|
function buildPipelineRequest(method, url, options = {}) {
|
|
96892
95763
|
const requestContentType = getRequestContentType(options);
|
|
96893
95764
|
const { body, multipartBody } = getRequestBody(options.body, requestContentType);
|
|
96894
|
-
const hasContent = body !== undefined || multipartBody !== undefined;
|
|
96895
95765
|
const headers = (0, httpHeaders_js_1.createHttpHeaders)({
|
|
96896
95766
|
...(options.headers ? options.headers : {}),
|
|
96897
95767
|
accept: options.accept ?? options.headers?.accept ?? "application/json",
|
|
96898
|
-
...(
|
|
96899
|
-
requestContentType && {
|
|
95768
|
+
...(requestContentType && {
|
|
96900
95769
|
"content-type": requestContentType,
|
|
96901
95770
|
}),
|
|
96902
95771
|
});
|
|
@@ -97161,7 +96030,7 @@ function replaceAll(value, searchValue, replaceValue) {
|
|
|
97161
96030
|
// Licensed under the MIT License.
|
|
97162
96031
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
97163
96032
|
exports.DEFAULT_RETRY_POLICY_COUNT = exports.SDK_VERSION = void 0;
|
|
97164
|
-
exports.SDK_VERSION = "0.3.
|
|
96033
|
+
exports.SDK_VERSION = "0.3.3";
|
|
97165
96034
|
exports.DEFAULT_RETRY_POLICY_COUNT = 3;
|
|
97166
96035
|
//# sourceMappingURL=constants.js.map
|
|
97167
96036
|
|
|
@@ -100948,7 +99817,7 @@ module.exports = { ping }
|
|
|
100948
99817
|
/***/ 50591:
|
|
100949
99818
|
/***/ ((module) => {
|
|
100950
99819
|
|
|
100951
|
-
(()=>{"use strict";var t={d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{XMLBuilder:()=>ut,XMLParser:()=>et,XMLValidator:()=>ft});const i=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n=new RegExp("^["+i+"]["+i+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function s(t,e){const i=[];let n=e.exec(t);for(;n;){const s=[];s.startIndex=e.lastIndex-n[0].length;const r=n.length;for(let t=0;t<r;t++)s.push(n[t]);i.push(s),n=e.exec(t)}return i}const r=function(t){return!(null==n.exec(t))},o={allowBooleanAttributes:!1,unpairedTags:[]};function a(t,e){e=Object.assign({},o,e);const i=[];let n=!1,s=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let o=0;o<t.length;o++)if("<"===t[o]&&"?"===t[o+1]){if(o+=2,o=u(t,o),o.err)return o}else{if("<"!==t[o]){if(l(t[o]))continue;return x("InvalidChar","char '"+t[o]+"' is not expected.",b(t,o))}{let a=o;if(o++,"!"===t[o]){o=h(t,o);continue}{let d=!1;"/"===t[o]&&(d=!0,o++);let p="";for(;o<t.length&&">"!==t[o]&&" "!==t[o]&&"\t"!==t[o]&&"\n"!==t[o]&&"\r"!==t[o];o++)p+=t[o];if(p=p.trim(),"/"===p[p.length-1]&&(p=p.substring(0,p.length-1),o--),!r(p)){let e;return e=0===p.trim().length?"Invalid space after '<'.":"Tag '"+p+"' is an invalid name.",x("InvalidTag",e,b(t,o))}const c=f(t,o);if(!1===c)return x("InvalidAttr","Attributes for '"+p+"' have open quote.",b(t,o));let N=c.value;if(o=c.index,"/"===N[N.length-1]){const i=o-N.length;N=N.substring(0,N.length-1);const s=g(N,e);if(!0!==s)return x(s.err.code,s.err.msg,b(t,i+s.err.line));n=!0}else if(d){if(!c.tagClosed)return x("InvalidTag","Closing tag '"+p+"' doesn't have proper closing.",b(t,o));if(N.trim().length>0)return x("InvalidTag","Closing tag '"+p+"' can't have attributes or invalid starting.",b(t,a));if(0===i.length)return x("InvalidTag","Closing tag '"+p+"' has not been opened.",b(t,a));{const e=i.pop();if(p!==e.tagName){let i=b(t,e.tagStartPos);return x("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+i.line+", col "+i.col+") instead of closing tag '"+p+"'.",b(t,a))}0==i.length&&(s=!0)}}else{const r=g(N,e);if(!0!==r)return x(r.err.code,r.err.msg,b(t,o-N.length+r.err.line));if(!0===s)return x("InvalidXml","Multiple possible root nodes found.",b(t,o));-1!==e.unpairedTags.indexOf(p)||i.push({tagName:p,tagStartPos:a}),n=!0}for(o++;o<t.length;o++)if("<"===t[o]){if("!"===t[o+1]){o++,o=h(t,o);continue}if("?"!==t[o+1])break;if(o=u(t,++o),o.err)return o}else if("&"===t[o]){const e=m(t,o);if(-1==e)return x("InvalidChar","char '&' is not expected.",b(t,o));o=e}else if(!0===s&&!l(t[o]))return x("InvalidXml","Extra text at the end",b(t,o));"<"===t[o]&&o--}}}return n?1==i.length?x("InvalidTag","Unclosed tag '"+i[0].tagName+"'.",b(t,i[0].tagStartPos)):!(i.length>0)||x("InvalidXml","Invalid '"+JSON.stringify(i.map((t=>t.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):x("InvalidXml","Start tag expected.",1)}function l(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function u(t,e){const i=e;for(;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{const n=t.substr(i,e-i);if(e>5&&"xml"===n)return x("InvalidXml","XML declaration allowed only at the start of the document.",b(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function h(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let i=1;for(e+=8;e<t.length;e++)if("<"===t[e])i++;else if(">"===t[e]&&(i--,0===i))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}const d='"',p="'";function f(t,e){let i="",n="",s=!1;for(;e<t.length;e++){if(t[e]===d||t[e]===p)""===n?n=t[e]:n!==t[e]||(n="");else if(">"===t[e]&&""===n){s=!0;break}i+=t[e]}return""===n&&{value:i,index:e,tagClosed:s}}const c=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function g(t,e){const i=s(t,c),n={};for(let t=0;t<i.length;t++){if(0===i[t][1].length)return x("InvalidAttr","Attribute '"+i[t][2]+"' has no space in starting.",E(i[t]));if(void 0!==i[t][3]&&void 0===i[t][4])return x("InvalidAttr","Attribute '"+i[t][2]+"' is without value.",E(i[t]));if(void 0===i[t][3]&&!e.allowBooleanAttributes)return x("InvalidAttr","boolean attribute '"+i[t][2]+"' is not allowed.",E(i[t]));const s=i[t][2];if(!N(s))return x("InvalidAttr","Attribute '"+s+"' is an invalid name.",E(i[t]));if(n.hasOwnProperty(s))return x("InvalidAttr","Attribute '"+s+"' is repeated.",E(i[t]));n[s]=1}return!0}function m(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){let i=/\d/;for("x"===t[e]&&(e++,i=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(i))break}return-1}(t,++e);let i=0;for(;e<t.length;e++,i++)if(!(t[e].match(/\w/)&&i<20)){if(";"===t[e])break;return-1}return e}function x(t,e,i){return{err:{code:t,msg:e,line:i.line||i,col:i.col}}}function N(t){return r(t)}function b(t,e){const i=t.substring(0,e).split(/\r?\n/);return{line:i.length,col:i[i.length-1].length+1}}function E(t){return t.startIndex+t[1].length}const v={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,i){return t},captureMetaData:!1};let T;T="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");class y{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t,e){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),void 0!==e&&(this.child[this.child.length-1][T]={startIndex:e})}static getMetaDataSymbol(){return T}}class w{constructor(t){this.suppressValidationErr=!t}readDocType(t,e){const i={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let n=1,s=!1,r=!1,o="";for(;e<t.length;e++)if("<"!==t[e]||r)if(">"===t[e]){if(r?"-"===t[e-1]&&"-"===t[e-2]&&(r=!1,n--):n--,0===n)break}else"["===t[e]?s=!0:o+=t[e];else{if(s&&P(t,"!ENTITY",e)){let n,s;e+=7,[n,s,e]=this.readEntityExp(t,e+1,this.suppressValidationErr),-1===s.indexOf("&")&&(i[n]={regx:RegExp(`&${n};`,"g"),val:s})}else if(s&&P(t,"!ELEMENT",e)){e+=8;const{index:i}=this.readElementExp(t,e+1);e=i}else if(s&&P(t,"!ATTLIST",e))e+=8;else if(s&&P(t,"!NOTATION",e)){e+=9;const{index:i}=this.readNotationExp(t,e+1,this.suppressValidationErr);e=i}else{if(!P(t,"!--",e))throw new Error("Invalid DOCTYPE");r=!0}n++,o=""}if(0!==n)throw new Error("Unclosed DOCTYPE")}return{entities:i,i:e}}readEntityExp(t,e){e=I(t,e);let i="";for(;e<t.length&&!/\s/.test(t[e])&&'"'!==t[e]&&"'"!==t[e];)i+=t[e],e++;if(O(i),e=I(t,e),!this.suppressValidationErr){if("SYSTEM"===t.substring(e,e+6).toUpperCase())throw new Error("External entities are not supported");if("%"===t[e])throw new Error("Parameter entities are not supported")}let n="";return[e,n]=this.readIdentifierVal(t,e,"entity"),[i,n,--e]}readNotationExp(t,e){e=I(t,e);let i="";for(;e<t.length&&!/\s/.test(t[e]);)i+=t[e],e++;!this.suppressValidationErr&&O(i),e=I(t,e);const n=t.substring(e,e+6).toUpperCase();if(!this.suppressValidationErr&&"SYSTEM"!==n&&"PUBLIC"!==n)throw new Error(`Expected SYSTEM or PUBLIC, found "${n}"`);e+=n.length,e=I(t,e);let s=null,r=null;if("PUBLIC"===n)[e,s]=this.readIdentifierVal(t,e,"publicIdentifier"),'"'!==t[e=I(t,e)]&&"'"!==t[e]||([e,r]=this.readIdentifierVal(t,e,"systemIdentifier"));else if("SYSTEM"===n&&([e,r]=this.readIdentifierVal(t,e,"systemIdentifier"),!this.suppressValidationErr&&!r))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:i,publicIdentifier:s,systemIdentifier:r,index:--e}}readIdentifierVal(t,e,i){let n="";const s=t[e];if('"'!==s&&"'"!==s)throw new Error(`Expected quoted string, found "${s}"`);for(e++;e<t.length&&t[e]!==s;)n+=t[e],e++;if(t[e]!==s)throw new Error(`Unterminated ${i} value`);return[++e,n]}readElementExp(t,e){e=I(t,e);let i="";for(;e<t.length&&!/\s/.test(t[e]);)i+=t[e],e++;if(!this.suppressValidationErr&&!r(i))throw new Error(`Invalid element name: "${i}"`);let n="";if("E"===t[e=I(t,e)]&&P(t,"MPTY",e))e+=4;else if("A"===t[e]&&P(t,"NY",e))e+=2;else if("("===t[e]){for(e++;e<t.length&&")"!==t[e];)n+=t[e],e++;if(")"!==t[e])throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${t[e]}"`);return{elementName:i,contentModel:n.trim(),index:e}}readAttlistExp(t,e){e=I(t,e);let i="";for(;e<t.length&&!/\s/.test(t[e]);)i+=t[e],e++;O(i),e=I(t,e);let n="";for(;e<t.length&&!/\s/.test(t[e]);)n+=t[e],e++;if(!O(n))throw new Error(`Invalid attribute name: "${n}"`);e=I(t,e);let s="";if("NOTATION"===t.substring(e,e+8).toUpperCase()){if(s="NOTATION","("!==t[e=I(t,e+=8)])throw new Error(`Expected '(', found "${t[e]}"`);e++;let i=[];for(;e<t.length&&")"!==t[e];){let n="";for(;e<t.length&&"|"!==t[e]&&")"!==t[e];)n+=t[e],e++;if(n=n.trim(),!O(n))throw new Error(`Invalid notation name: "${n}"`);i.push(n),"|"===t[e]&&(e++,e=I(t,e))}if(")"!==t[e])throw new Error("Unterminated list of notations");e++,s+=" ("+i.join("|")+")"}else{for(;e<t.length&&!/\s/.test(t[e]);)s+=t[e],e++;const i=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!i.includes(s.toUpperCase()))throw new Error(`Invalid attribute type: "${s}"`)}e=I(t,e);let r="";return"#REQUIRED"===t.substring(e,e+8).toUpperCase()?(r="#REQUIRED",e+=8):"#IMPLIED"===t.substring(e,e+7).toUpperCase()?(r="#IMPLIED",e+=7):[e,r]=this.readIdentifierVal(t,e,"ATTLIST"),{elementName:i,attributeName:n,attributeType:s,defaultValue:r,index:e}}}const I=(t,e)=>{for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function P(t,e,i){for(let n=0;n<e.length;n++)if(e[n]!==t[i+n+1])return!1;return!0}function O(t){if(r(t))return t;throw new Error(`Invalid entity name ${t}`)}const A=/^[-+]?0x[a-fA-F0-9]+$/,S=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,C={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};const V=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function $(t){return"function"==typeof t?t:Array.isArray(t)?e=>{for(const i of t){if("string"==typeof i&&e===i)return!0;if(i instanceof RegExp&&i.test(e))return!0}}:()=>!1}class D{constructor(t){if(this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,e)=>Z(e,10,"&#")},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,e)=>Z(e,16,"&#x")}},this.addExternalEntities=j,this.parseXml=L,this.parseTextData=M,this.resolveNameSpace=F,this.buildAttributesMap=k,this.isItStopNode=Y,this.replaceEntitiesValue=B,this.readStopNodeData=W,this.saveTextToParentTag=R,this.addChild=U,this.ignoreAttributesFn=$(this.options.ignoreAttributes),this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodesExact=new Set,this.stopNodesWildcard=new Set;for(let t=0;t<this.options.stopNodes.length;t++){const e=this.options.stopNodes[t];"string"==typeof e&&(e.startsWith("*.")?this.stopNodesWildcard.add(e.substring(2)):this.stopNodesExact.add(e))}}}}function j(t){const e=Object.keys(t);for(let i=0;i<e.length;i++){const n=e[i];this.lastEntities[n]={regex:new RegExp("&"+n+";","g"),val:t[n]}}}function M(t,e,i,n,s,r,o){if(void 0!==t&&(this.options.trimValues&&!n&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t));const n=this.options.tagValueProcessor(e,t,i,s,r);return null==n?t:typeof n!=typeof t||n!==t?n:this.options.trimValues||t.trim()===t?q(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function F(t){if(this.options.removeNSPrefix){const e=t.split(":"),i="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=i+e[1])}return t}const _=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function k(t,e){if(!0!==this.options.ignoreAttributes&&"string"==typeof t){const i=s(t,_),n=i.length,r={};for(let t=0;t<n;t++){const n=this.resolveNameSpace(i[t][1]);if(this.ignoreAttributesFn(n,e))continue;let s=i[t][4],o=this.options.attributeNamePrefix+n;if(n.length)if(this.options.transformAttributeName&&(o=this.options.transformAttributeName(o)),"__proto__"===o&&(o="#__proto__"),void 0!==s){this.options.trimValues&&(s=s.trim()),s=this.replaceEntitiesValue(s);const t=this.options.attributeValueProcessor(n,s,e);r[o]=null==t?s:typeof t!=typeof s||t!==s?t:q(s,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(r[o]=!0)}if(!Object.keys(r).length)return;if(this.options.attributesGroupName){const t={};return t[this.options.attributesGroupName]=r,t}return r}}const L=function(t){t=t.replace(/\r\n?/g,"\n");const e=new y("!xml");let i=e,n="",s="";const r=new w(this.options.processEntities);for(let o=0;o<t.length;o++)if("<"===t[o])if("/"===t[o+1]){const e=G(t,">",o,"Closing Tag is not closed.");let r=t.substring(o+2,e).trim();if(this.options.removeNSPrefix){const t=r.indexOf(":");-1!==t&&(r=r.substr(t+1))}this.options.transformTagName&&(r=this.options.transformTagName(r)),i&&(n=this.saveTextToParentTag(n,i,s));const a=s.substring(s.lastIndexOf(".")+1);if(r&&-1!==this.options.unpairedTags.indexOf(r))throw new Error(`Unpaired tag can not be used as closing tag: </${r}>`);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=s.lastIndexOf("."),s=s.substring(0,l),i=this.tagsNodeStack.pop(),n="",o=e}else if("?"===t[o+1]){let e=X(t,o,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(n=this.saveTextToParentTag(n,i,s),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new y(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,s)),this.addChild(i,t,s,o)}o=e.closeIndex+1}else if("!--"===t.substr(o+1,3)){const e=G(t,"--\x3e",o+4,"Comment is not closed.");if(this.options.commentPropName){const r=t.substring(o+4,e-2);n=this.saveTextToParentTag(n,i,s),i.add(this.options.commentPropName,[{[this.options.textNodeName]:r}])}o=e}else if("!D"===t.substr(o+1,2)){const e=r.readDocType(t,o);this.docTypeEntities=e.entities,o=e.i}else if("!["===t.substr(o+1,2)){const e=G(t,"]]>",o,"CDATA is not closed.")-2,r=t.substring(o+9,e);n=this.saveTextToParentTag(n,i,s);let a=this.parseTextData(r,i.tagname,s,!0,!1,!0,!0);null==a&&(a=""),this.options.cdataPropName?i.add(this.options.cdataPropName,[{[this.options.textNodeName]:r}]):i.add(this.options.textNodeName,a),o=e+2}else{let r=X(t,o,this.options.removeNSPrefix),a=r.tagName;const l=r.rawTagName;let u=r.tagExp,h=r.attrExpPresent,d=r.closeIndex;if(this.options.transformTagName){const t=this.options.transformTagName(a);u===a&&(u=t),a=t}i&&n&&"!xml"!==i.tagname&&(n=this.saveTextToParentTag(n,i,s,!1));const p=i;p&&-1!==this.options.unpairedTags.indexOf(p.tagname)&&(i=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),a!==e.tagname&&(s+=s?"."+a:a);const f=o;if(this.isItStopNode(this.stopNodesExact,this.stopNodesWildcard,s,a)){let e="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)"/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),u=a):u=u.substr(0,u.length-1),o=r.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))o=r.closeIndex;else{const i=this.readStopNodeData(t,l,d+1);if(!i)throw new Error(`Unexpected end of ${l}`);o=i.i,e=i.tagContent}const n=new y(a);a!==u&&h&&(n[":@"]=this.buildAttributesMap(u,s)),e&&(e=this.parseTextData(e,a,s,!0,h,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),n.add(this.options.textNodeName,e),this.addChild(i,n,s,f)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){if("/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),u=a):u=u.substr(0,u.length-1),this.options.transformTagName){const t=this.options.transformTagName(a);u===a&&(u=t),a=t}const t=new y(a);a!==u&&h&&(t[":@"]=this.buildAttributesMap(u,s)),this.addChild(i,t,s,f),s=s.substr(0,s.lastIndexOf("."))}else{const t=new y(a);this.tagsNodeStack.push(i),a!==u&&h&&(t[":@"]=this.buildAttributesMap(u,s)),this.addChild(i,t,s,f),i=t}n="",o=d}}else n+=t[o];return e.child};function U(t,e,i,n){this.options.captureMetaData||(n=void 0);const s=this.options.updateTag(e.tagname,i,e[":@"]);!1===s||("string"==typeof s?(e.tagname=s,t.addChild(e,n)):t.addChild(e,n))}const B=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const i=this.docTypeEntities[e];t=t.replace(i.regx,i.val)}for(let e in this.lastEntities){const i=this.lastEntities[e];t=t.replace(i.regex,i.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const i=this.htmlEntities[e];t=t.replace(i.regex,i.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function R(t,e,i,n){return t&&(void 0===n&&(n=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,i,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,n))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function Y(t,e,i,n){return!(!e||!e.has(n))||!(!t||!t.has(i))}function G(t,e,i,n){const s=t.indexOf(e,i);if(-1===s)throw new Error(n);return s+e.length-1}function X(t,e,i,n=">"){const s=function(t,e,i=">"){let n,s="";for(let r=e;r<t.length;r++){let e=t[r];if(n)e===n&&(n="");else if('"'===e||"'"===e)n=e;else if(e===i[0]){if(!i[1])return{data:s,index:r};if(t[r+1]===i[1])return{data:s,index:r}}else"\t"===e&&(e=" ");s+=e}}(t,e+1,n);if(!s)return;let r=s.data;const o=s.index,a=r.search(/\s/);let l=r,u=!0;-1!==a&&(l=r.substring(0,a),r=r.substring(a+1).trimStart());const h=l;if(i){const t=l.indexOf(":");-1!==t&&(l=l.substr(t+1),u=l!==s.data.substr(t+1))}return{tagName:l,tagExp:r,closeIndex:o,attrExpPresent:u,rawTagName:h}}function W(t,e,i){const n=i;let s=1;for(;i<t.length;i++)if("<"===t[i])if("/"===t[i+1]){const r=G(t,">",i,`${e} is not closed`);if(t.substring(i+2,r).trim()===e&&(s--,0===s))return{tagContent:t.substring(n,i),i:r};i=r}else if("?"===t[i+1])i=G(t,"?>",i+1,"StopNode is not closed.");else if("!--"===t.substr(i+1,3))i=G(t,"--\x3e",i+3,"StopNode is not closed.");else if("!["===t.substr(i+1,2))i=G(t,"]]>",i,"StopNode is not closed.")-2;else{const n=X(t,i,">");n&&((n&&n.tagName)===e&&"/"!==n.tagExp[n.tagExp.length-1]&&s++,i=n.closeIndex)}}function q(t,e,i){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&function(t,e={}){if(e=Object.assign({},C,e),!t||"string"!=typeof t)return t;let i=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(i))return t;if("0"===t)return 0;if(e.hex&&A.test(i))return function(t){if(parseInt)return parseInt(t,16);if(Number.parseInt)return Number.parseInt(t,16);if(window&&window.parseInt)return window.parseInt(t,16);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(i);if(-1!==i.search(/.+[eE].+/))return function(t,e,i){if(!i.eNotation)return t;const n=e.match(V);if(n){let s=n[1]||"";const r=-1===n[3].indexOf("e")?"E":"e",o=n[2],a=s?t[o.length+1]===r:t[o.length]===r;return o.length>1&&a?t:1!==o.length||!n[3].startsWith(`.${r}`)&&n[3][0]!==r?i.leadingZeros&&!a?(e=(n[1]||"")+n[3],Number(e)):t:Number(e)}return t}(t,i,e);{const s=S.exec(i);if(s){const r=s[1]||"",o=s[2];let a=(n=s[3])&&-1!==n.indexOf(".")?("."===(n=n.replace(/0+$/,""))?n="0":"."===n[0]?n="0"+n:"."===n[n.length-1]&&(n=n.substring(0,n.length-1)),n):n;const l=r?"."===t[o.length+1]:"."===t[o.length];if(!e.leadingZeros&&(o.length>1||1===o.length&&!l))return t;{const n=Number(i),s=String(n);if(0===n||-0===n)return n;if(-1!==s.search(/[eE]/))return e.eNotation?n:t;if(-1!==i.indexOf("."))return"0"===s||s===a||s===`${r}${a}`?n:t;let l=o?a:i;return o?l===s||r+l===s?n:t:l===s||l===r+s?n:t}}return t}var n}(t,i)}return void 0!==t?t:""}function Z(t,e,i){const n=Number.parseInt(t,e);return n>=0&&n<=1114111?String.fromCodePoint(n):i+t+";"}const K=y.getMetaDataSymbol();function Q(t,e){return z(t,e)}function z(t,e,i){let n;const s={};for(let r=0;r<t.length;r++){const o=t[r],a=J(o);let l="";if(l=void 0===i?a:i+"."+a,a===e.textNodeName)void 0===n?n=o[a]:n+=""+o[a];else{if(void 0===a)continue;if(o[a]){let t=z(o[a],e,l);const i=tt(t,e);void 0!==o[K]&&(t[K]=o[K]),o[":@"]?H(t,o[":@"],l,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==s[a]&&s.hasOwnProperty(a)?(Array.isArray(s[a])||(s[a]=[s[a]]),s[a].push(t)):e.isArray(a,l,i)?s[a]=[t]:s[a]=t}}}return"string"==typeof n?n.length>0&&(s[e.textNodeName]=n):void 0!==n&&(s[e.textNodeName]=n),s}function J(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function H(t,e,i,n){if(e){const s=Object.keys(e),r=s.length;for(let o=0;o<r;o++){const r=s[o];n.isArray(r,i+"."+r,!0,!0)?t[r]=[e[r]]:t[r]=e[r]}}}function tt(t,e){const{textNodeName:i}=e,n=Object.keys(t).length;return 0===n||!(1!==n||!t[i]&&"boolean"!=typeof t[i]&&0!==t[i])}class et{constructor(t){this.externalEntities={},this.options=function(t){return Object.assign({},v,t)}(t)}parse(t,e){if("string"!=typeof t&&t.toString)t=t.toString();else if("string"!=typeof t)throw new Error("XML data is accepted in String or Bytes[] form.");if(e){!0===e&&(e={});const i=a(t,e);if(!0!==i)throw Error(`${i.err.msg}:${i.err.line}:${i.err.col}`)}const i=new D(this.options);i.addExternalEntities(this.externalEntities);const n=i.parseXml(t);return this.options.preserveOrder||void 0===n?n:Q(n,this.options)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}static getMetaDataSymbol(){return y.getMetaDataSymbol()}}function it(t,e){let i="";return e.format&&e.indentBy.length>0&&(i="\n"),nt(t,e,"",i)}function nt(t,e,i,n){let s="",r=!1;for(let o=0;o<t.length;o++){const a=t[o],l=st(a);if(void 0===l)continue;let u="";if(u=0===i.length?l:`${i}.${l}`,l===e.textNodeName){let t=a[l];ot(u,e)||(t=e.tagValueProcessor(l,t),t=at(t,e)),r&&(s+=n),s+=t,r=!1;continue}if(l===e.cdataPropName){r&&(s+=n),s+=`<![CDATA[${a[l][0][e.textNodeName]}]]>`,r=!1;continue}if(l===e.commentPropName){s+=n+`\x3c!--${a[l][0][e.textNodeName]}--\x3e`,r=!0;continue}if("?"===l[0]){const t=rt(a[":@"],e),i="?xml"===l?"":n;let o=a[l][0][e.textNodeName];o=0!==o.length?" "+o:"",s+=i+`<${l}${o}${t}?>`,r=!0;continue}let h=n;""!==h&&(h+=e.indentBy);const d=n+`<${l}${rt(a[":@"],e)}`,p=nt(a[l],e,u,h);-1!==e.unpairedTags.indexOf(l)?e.suppressUnpairedNode?s+=d+">":s+=d+"/>":p&&0!==p.length||!e.suppressEmptyNode?p&&p.endsWith(">")?s+=d+`>${p}${n}</${l}>`:(s+=d+">",p&&""!==n&&(p.includes("/>")||p.includes("</"))?s+=n+e.indentBy+p+n:s+=p,s+=`</${l}>`):s+=d+"/>",r=!0}return s}function st(t){const e=Object.keys(t);for(let i=0;i<e.length;i++){const n=e[i];if(t.hasOwnProperty(n)&&":@"!==n)return n}}function rt(t,e){let i="";if(t&&!e.ignoreAttributes)for(let n in t){if(!t.hasOwnProperty(n))continue;let s=e.attributeValueProcessor(n,t[n]);s=at(s,e),!0===s&&e.suppressBooleanAttributes?i+=` ${n.substr(e.attributeNamePrefix.length)}`:i+=` ${n.substr(e.attributeNamePrefix.length)}="${s}"`}return i}function ot(t,e){let i=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(let n in e.stopNodes)if(e.stopNodes[n]===t||e.stopNodes[n]==="*."+i)return!0;return!1}function at(t,e){if(t&&t.length>0&&e.processEntities)for(let i=0;i<e.entities.length;i++){const n=e.entities[i];t=t.replace(n.regex,n.val)}return t}const lt={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function ut(t){this.options=Object.assign({},lt,t),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=$(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=pt),this.processTextOrObjNode=ht,this.options.format?(this.indentate=dt,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function ht(t,e,i,n){const s=this.j2x(t,i+1,n.concat(e));return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,s.attrStr,i):this.buildObjectNode(s.val,e,s.attrStr,i)}function dt(t){return this.options.indentBy.repeat(t)}function pt(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}ut.prototype.build=function(t){return this.options.preserveOrder?it(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0,[]).val)},ut.prototype.j2x=function(t,e,i){let n="",s="";const r=i.join(".");for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o))if(void 0===t[o])this.isAttribute(o)&&(s+="");else if(null===t[o])this.isAttribute(o)||o===this.options.cdataPropName?s+="":"?"===o[0]?s+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if(t[o]instanceof Date)s+=this.buildTextValNode(t[o],o,"",e);else if("object"!=typeof t[o]){const i=this.isAttribute(o);if(i&&!this.ignoreAttributesFn(i,r))n+=this.buildAttrPairStr(i,""+t[o]);else if(!i)if(o===this.options.textNodeName){let e=this.options.tagValueProcessor(o,""+t[o]);s+=this.replaceEntitiesValue(e)}else s+=this.buildTextValNode(t[o],o,"",e)}else if(Array.isArray(t[o])){const n=t[o].length;let r="",a="";for(let l=0;l<n;l++){const n=t[o][l];if(void 0===n);else if(null===n)"?"===o[0]?s+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if("object"==typeof n)if(this.options.oneListGroup){const t=this.j2x(n,e+1,i.concat(o));r+=t.val,this.options.attributesGroupName&&n.hasOwnProperty(this.options.attributesGroupName)&&(a+=t.attrStr)}else r+=this.processTextOrObjNode(n,o,e,i);else if(this.options.oneListGroup){let t=this.options.tagValueProcessor(o,n);t=this.replaceEntitiesValue(t),r+=t}else r+=this.buildTextValNode(n,o,"",e)}this.options.oneListGroup&&(r=this.buildObjectNode(r,o,a,e)),s+=r}else if(this.options.attributesGroupName&&o===this.options.attributesGroupName){const e=Object.keys(t[o]),i=e.length;for(let s=0;s<i;s++)n+=this.buildAttrPairStr(e[s],""+t[o][e[s]])}else s+=this.processTextOrObjNode(t[o],o,e,i);return{attrStr:n,val:s}},ut.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},ut.prototype.buildObjectNode=function(t,e,i,n){if(""===t)return"?"===e[0]?this.indentate(n)+"<"+e+i+"?"+this.tagEndChar:this.indentate(n)+"<"+e+i+this.closeTag(e)+this.tagEndChar;{let s="</"+e+this.tagEndChar,r="";return"?"===e[0]&&(r="?",s=""),!i&&""!==i||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===r.length?this.indentate(n)+`\x3c!--${t}--\x3e`+this.newLine:this.indentate(n)+"<"+e+i+r+this.tagEndChar+t+this.indentate(n)+s:this.indentate(n)+"<"+e+i+r+">"+t+s}},ut.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`></${t}`,e},ut.prototype.buildTextValNode=function(t,e,i,n){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(n)+`<![CDATA[${t}]]>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(n)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(n)+"<"+e+i+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(e,t);return s=this.replaceEntitiesValue(s),""===s?this.indentate(n)+"<"+e+i+this.closeTag(e)+this.tagEndChar:this.indentate(n)+"<"+e+i+">"+s+"</"+e+this.tagEndChar}},ut.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const i=this.options.entities[e];t=t.replace(i.regex,i.val)}return t};const ft={validate:a};module.exports=e})();
|
|
99820
|
+
(()=>{"use strict";var t={d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{XMLBuilder:()=>dt,XMLParser:()=>it,XMLValidator:()=>gt});const n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i=new RegExp("^["+n+"]["+n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function s(t,e){const n=[];let i=e.exec(t);for(;i;){const s=[];s.startIndex=e.lastIndex-i[0].length;const r=i.length;for(let t=0;t<r;t++)s.push(i[t]);n.push(s),i=e.exec(t)}return n}const r=function(t){return!(null==i.exec(t))},o={allowBooleanAttributes:!1,unpairedTags:[]};function a(t,e){e=Object.assign({},o,e);const n=[];let i=!1,s=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let o=0;o<t.length;o++)if("<"===t[o]&&"?"===t[o+1]){if(o+=2,o=u(t,o),o.err)return o}else{if("<"!==t[o]){if(l(t[o]))continue;return m("InvalidChar","char '"+t[o]+"' is not expected.",b(t,o))}{let a=o;if(o++,"!"===t[o]){o=h(t,o);continue}{let d=!1;"/"===t[o]&&(d=!0,o++);let p="";for(;o<t.length&&">"!==t[o]&&" "!==t[o]&&"\t"!==t[o]&&"\n"!==t[o]&&"\r"!==t[o];o++)p+=t[o];if(p=p.trim(),"/"===p[p.length-1]&&(p=p.substring(0,p.length-1),o--),!r(p)){let e;return e=0===p.trim().length?"Invalid space after '<'.":"Tag '"+p+"' is an invalid name.",m("InvalidTag",e,b(t,o))}const c=f(t,o);if(!1===c)return m("InvalidAttr","Attributes for '"+p+"' have open quote.",b(t,o));let E=c.value;if(o=c.index,"/"===E[E.length-1]){const n=o-E.length;E=E.substring(0,E.length-1);const s=g(E,e);if(!0!==s)return m(s.err.code,s.err.msg,b(t,n+s.err.line));i=!0}else if(d){if(!c.tagClosed)return m("InvalidTag","Closing tag '"+p+"' doesn't have proper closing.",b(t,o));if(E.trim().length>0)return m("InvalidTag","Closing tag '"+p+"' can't have attributes or invalid starting.",b(t,a));if(0===n.length)return m("InvalidTag","Closing tag '"+p+"' has not been opened.",b(t,a));{const e=n.pop();if(p!==e.tagName){let n=b(t,e.tagStartPos);return m("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+p+"'.",b(t,a))}0==n.length&&(s=!0)}}else{const r=g(E,e);if(!0!==r)return m(r.err.code,r.err.msg,b(t,o-E.length+r.err.line));if(!0===s)return m("InvalidXml","Multiple possible root nodes found.",b(t,o));-1!==e.unpairedTags.indexOf(p)||n.push({tagName:p,tagStartPos:a}),i=!0}for(o++;o<t.length;o++)if("<"===t[o]){if("!"===t[o+1]){o++,o=h(t,o);continue}if("?"!==t[o+1])break;if(o=u(t,++o),o.err)return o}else if("&"===t[o]){const e=x(t,o);if(-1==e)return m("InvalidChar","char '&' is not expected.",b(t,o));o=e}else if(!0===s&&!l(t[o]))return m("InvalidXml","Extra text at the end",b(t,o));"<"===t[o]&&o--}}}return i?1==n.length?m("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",b(t,n[0].tagStartPos)):!(n.length>0)||m("InvalidXml","Invalid '"+JSON.stringify(n.map((t=>t.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):m("InvalidXml","Start tag expected.",1)}function l(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function u(t,e){const n=e;for(;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{const i=t.substr(n,e-n);if(e>5&&"xml"===i)return m("InvalidXml","XML declaration allowed only at the start of the document.",b(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function h(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let n=1;for(e+=8;e<t.length;e++)if("<"===t[e])n++;else if(">"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}const d='"',p="'";function f(t,e){let n="",i="",s=!1;for(;e<t.length;e++){if(t[e]===d||t[e]===p)""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){s=!0;break}n+=t[e]}return""===i&&{value:n,index:e,tagClosed:s}}const c=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function g(t,e){const n=s(t,c),i={};for(let t=0;t<n.length;t++){if(0===n[t][1].length)return m("InvalidAttr","Attribute '"+n[t][2]+"' has no space in starting.",N(n[t]));if(void 0!==n[t][3]&&void 0===n[t][4])return m("InvalidAttr","Attribute '"+n[t][2]+"' is without value.",N(n[t]));if(void 0===n[t][3]&&!e.allowBooleanAttributes)return m("InvalidAttr","boolean attribute '"+n[t][2]+"' is not allowed.",N(n[t]));const s=n[t][2];if(!E(s))return m("InvalidAttr","Attribute '"+s+"' is an invalid name.",N(n[t]));if(i.hasOwnProperty(s))return m("InvalidAttr","Attribute '"+s+"' is repeated.",N(n[t]));i[s]=1}return!0}function x(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){let n=/\d/;for("x"===t[e]&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(n))break}return-1}(t,++e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(";"===t[e])break;return-1}return e}function m(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function E(t){return r(t)}function b(t,e){const n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function N(t){return t.startIndex+t[1].length}const y={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t},captureMetaData:!1};function T(t){return"boolean"==typeof t?{enabled:t,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1e3,maxExpandedLength:1e5,allowedTags:null,tagFilter:null}:"object"==typeof t&&null!==t?{enabled:!1!==t.enabled,maxEntitySize:t.maxEntitySize??1e4,maxExpansionDepth:t.maxExpansionDepth??10,maxTotalExpansions:t.maxTotalExpansions??1e3,maxExpandedLength:t.maxExpandedLength??1e5,allowedTags:t.allowedTags??null,tagFilter:t.tagFilter??null}:T(!0)}const w=function(t){const e=Object.assign({},y,t);return e.processEntities=T(e.processEntities),e};let v;v="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");class I{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t,e){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),void 0!==e&&(this.child[this.child.length-1][v]={startIndex:e})}static getMetaDataSymbol(){return v}}class O{constructor(t){this.suppressValidationErr=!t,this.options=t}readDocType(t,e){const n={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let i=1,s=!1,r=!1,o="";for(;e<t.length;e++)if("<"!==t[e]||r)if(">"===t[e]){if(r?"-"===t[e-1]&&"-"===t[e-2]&&(r=!1,i--):i--,0===i)break}else"["===t[e]?s=!0:o+=t[e];else{if(s&&A(t,"!ENTITY",e)){let i,s;if(e+=7,[i,s,e]=this.readEntityExp(t,e+1,this.suppressValidationErr),-1===s.indexOf("&")){const t=i.replace(/[.\-+*:]/g,"\\.");n[i]={regx:RegExp(`&${t};`,"g"),val:s}}}else if(s&&A(t,"!ELEMENT",e)){e+=8;const{index:n}=this.readElementExp(t,e+1);e=n}else if(s&&A(t,"!ATTLIST",e))e+=8;else if(s&&A(t,"!NOTATION",e)){e+=9;const{index:n}=this.readNotationExp(t,e+1,this.suppressValidationErr);e=n}else{if(!A(t,"!--",e))throw new Error("Invalid DOCTYPE");r=!0}i++,o=""}if(0!==i)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}}readEntityExp(t,e){e=P(t,e);let n="";for(;e<t.length&&!/\s/.test(t[e])&&'"'!==t[e]&&"'"!==t[e];)n+=t[e],e++;if(S(n),e=P(t,e),!this.suppressValidationErr){if("SYSTEM"===t.substring(e,e+6).toUpperCase())throw new Error("External entities are not supported");if("%"===t[e])throw new Error("Parameter entities are not supported")}let i="";if([e,i]=this.readIdentifierVal(t,e,"entity"),!1!==this.options.enabled&&this.options.maxEntitySize&&i.length>this.options.maxEntitySize)throw new Error(`Entity "${n}" size (${i.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return[n,i,--e]}readNotationExp(t,e){e=P(t,e);let n="";for(;e<t.length&&!/\s/.test(t[e]);)n+=t[e],e++;!this.suppressValidationErr&&S(n),e=P(t,e);const i=t.substring(e,e+6).toUpperCase();if(!this.suppressValidationErr&&"SYSTEM"!==i&&"PUBLIC"!==i)throw new Error(`Expected SYSTEM or PUBLIC, found "${i}"`);e+=i.length,e=P(t,e);let s=null,r=null;if("PUBLIC"===i)[e,s]=this.readIdentifierVal(t,e,"publicIdentifier"),'"'!==t[e=P(t,e)]&&"'"!==t[e]||([e,r]=this.readIdentifierVal(t,e,"systemIdentifier"));else if("SYSTEM"===i&&([e,r]=this.readIdentifierVal(t,e,"systemIdentifier"),!this.suppressValidationErr&&!r))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:n,publicIdentifier:s,systemIdentifier:r,index:--e}}readIdentifierVal(t,e,n){let i="";const s=t[e];if('"'!==s&&"'"!==s)throw new Error(`Expected quoted string, found "${s}"`);for(e++;e<t.length&&t[e]!==s;)i+=t[e],e++;if(t[e]!==s)throw new Error(`Unterminated ${n} value`);return[++e,i]}readElementExp(t,e){e=P(t,e);let n="";for(;e<t.length&&!/\s/.test(t[e]);)n+=t[e],e++;if(!this.suppressValidationErr&&!r(n))throw new Error(`Invalid element name: "${n}"`);let i="";if("E"===t[e=P(t,e)]&&A(t,"MPTY",e))e+=4;else if("A"===t[e]&&A(t,"NY",e))e+=2;else if("("===t[e]){for(e++;e<t.length&&")"!==t[e];)i+=t[e],e++;if(")"!==t[e])throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${t[e]}"`);return{elementName:n,contentModel:i.trim(),index:e}}readAttlistExp(t,e){e=P(t,e);let n="";for(;e<t.length&&!/\s/.test(t[e]);)n+=t[e],e++;S(n),e=P(t,e);let i="";for(;e<t.length&&!/\s/.test(t[e]);)i+=t[e],e++;if(!S(i))throw new Error(`Invalid attribute name: "${i}"`);e=P(t,e);let s="";if("NOTATION"===t.substring(e,e+8).toUpperCase()){if(s="NOTATION","("!==t[e=P(t,e+=8)])throw new Error(`Expected '(', found "${t[e]}"`);e++;let n=[];for(;e<t.length&&")"!==t[e];){let i="";for(;e<t.length&&"|"!==t[e]&&")"!==t[e];)i+=t[e],e++;if(i=i.trim(),!S(i))throw new Error(`Invalid notation name: "${i}"`);n.push(i),"|"===t[e]&&(e++,e=P(t,e))}if(")"!==t[e])throw new Error("Unterminated list of notations");e++,s+=" ("+n.join("|")+")"}else{for(;e<t.length&&!/\s/.test(t[e]);)s+=t[e],e++;const n=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!n.includes(s.toUpperCase()))throw new Error(`Invalid attribute type: "${s}"`)}e=P(t,e);let r="";return"#REQUIRED"===t.substring(e,e+8).toUpperCase()?(r="#REQUIRED",e+=8):"#IMPLIED"===t.substring(e,e+7).toUpperCase()?(r="#IMPLIED",e+=7):[e,r]=this.readIdentifierVal(t,e,"ATTLIST"),{elementName:n,attributeName:i,attributeType:s,defaultValue:r,index:e}}}const P=(t,e)=>{for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function A(t,e,n){for(let i=0;i<e.length;i++)if(e[i]!==t[n+i+1])return!1;return!0}function S(t){if(r(t))return t;throw new Error(`Invalid entity name ${t}`)}const C=/^[-+]?0x[a-fA-F0-9]+$/,$=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,V={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};const D=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function L(t){return"function"==typeof t?t:Array.isArray(t)?e=>{for(const n of t){if("string"==typeof n&&e===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}}:()=>!1}class F{constructor(t){if(this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,e)=>K(e,10,"&#")},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,e)=>K(e,16,"&#x")}},this.addExternalEntities=j,this.parseXml=B,this.parseTextData=M,this.resolveNameSpace=_,this.buildAttributesMap=U,this.isItStopNode=X,this.replaceEntitiesValue=Y,this.readStopNodeData=q,this.saveTextToParentTag=G,this.addChild=R,this.ignoreAttributesFn=L(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0,this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodesExact=new Set,this.stopNodesWildcard=new Set;for(let t=0;t<this.options.stopNodes.length;t++){const e=this.options.stopNodes[t];"string"==typeof e&&(e.startsWith("*.")?this.stopNodesWildcard.add(e.substring(2)):this.stopNodesExact.add(e))}}}}function j(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n],s=i.replace(/[.\-+*:]/g,"\\.");this.lastEntities[i]={regex:new RegExp("&"+s+";","g"),val:t[i]}}}function M(t,e,n,i,s,r,o){if(void 0!==t&&(this.options.trimValues&&!i&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t,e,n));const i=this.options.tagValueProcessor(e,t,n,s,r);return null==i?t:typeof i!=typeof t||i!==t?i:this.options.trimValues||t.trim()===t?Z(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function _(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}const k=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function U(t,e,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof t){const i=s(t,k),r=i.length,o={};for(let t=0;t<r;t++){const s=this.resolveNameSpace(i[t][1]);if(this.ignoreAttributesFn(s,e))continue;let r=i[t][4],a=this.options.attributeNamePrefix+s;if(s.length)if(this.options.transformAttributeName&&(a=this.options.transformAttributeName(a)),"__proto__"===a&&(a="#__proto__"),void 0!==r){this.options.trimValues&&(r=r.trim()),r=this.replaceEntitiesValue(r,n,e);const t=this.options.attributeValueProcessor(s,r,e);o[a]=null==t?r:typeof t!=typeof r||t!==r?t:Z(r,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(o[a]=!0)}if(!Object.keys(o).length)return;if(this.options.attributesGroupName){const t={};return t[this.options.attributesGroupName]=o,t}return o}}const B=function(t){t=t.replace(/\r\n?/g,"\n");const e=new I("!xml");let n=e,i="",s="";this.entityExpansionCount=0,this.currentExpandedLength=0;const r=new O(this.options.processEntities);for(let o=0;o<t.length;o++)if("<"===t[o])if("/"===t[o+1]){const e=z(t,">",o,"Closing Tag is not closed.");let r=t.substring(o+2,e).trim();if(this.options.removeNSPrefix){const t=r.indexOf(":");-1!==t&&(r=r.substr(t+1))}this.options.transformTagName&&(r=this.options.transformTagName(r)),n&&(i=this.saveTextToParentTag(i,n,s));const a=s.substring(s.lastIndexOf(".")+1);if(r&&-1!==this.options.unpairedTags.indexOf(r))throw new Error(`Unpaired tag can not be used as closing tag: </${r}>`);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=s.lastIndexOf("."),s=s.substring(0,l),n=this.tagsNodeStack.pop(),i="",o=e}else if("?"===t[o+1]){let e=W(t,o,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,s),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new I(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,s,e.tagName)),this.addChild(n,t,s,o)}o=e.closeIndex+1}else if("!--"===t.substr(o+1,3)){const e=z(t,"--\x3e",o+4,"Comment is not closed.");if(this.options.commentPropName){const r=t.substring(o+4,e-2);i=this.saveTextToParentTag(i,n,s),n.add(this.options.commentPropName,[{[this.options.textNodeName]:r}])}o=e}else if("!D"===t.substr(o+1,2)){const e=r.readDocType(t,o);this.docTypeEntities=e.entities,o=e.i}else if("!["===t.substr(o+1,2)){const e=z(t,"]]>",o,"CDATA is not closed.")-2,r=t.substring(o+9,e);i=this.saveTextToParentTag(i,n,s);let a=this.parseTextData(r,n.tagname,s,!0,!1,!0,!0);null==a&&(a=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:r}]):n.add(this.options.textNodeName,a),o=e+2}else{let r=W(t,o,this.options.removeNSPrefix),a=r.tagName;const l=r.rawTagName;let u=r.tagExp,h=r.attrExpPresent,d=r.closeIndex;if(this.options.transformTagName){const t=this.options.transformTagName(a);u===a&&(u=t),a=t}n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,s,!1));const p=n;p&&-1!==this.options.unpairedTags.indexOf(p.tagname)&&(n=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),a!==e.tagname&&(s+=s?"."+a:a);const f=o;if(this.isItStopNode(this.stopNodesExact,this.stopNodesWildcard,s,a)){let e="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)"/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),u=a):u=u.substr(0,u.length-1),o=r.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))o=r.closeIndex;else{const n=this.readStopNodeData(t,l,d+1);if(!n)throw new Error(`Unexpected end of ${l}`);o=n.i,e=n.tagContent}const i=new I(a);a!==u&&h&&(i[":@"]=this.buildAttributesMap(u,s,a)),e&&(e=this.parseTextData(e,a,s,!0,h,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),i.add(this.options.textNodeName,e),this.addChild(n,i,s,f)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){if("/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),u=a):u=u.substr(0,u.length-1),this.options.transformTagName){const t=this.options.transformTagName(a);u===a&&(u=t),a=t}const t=new I(a);a!==u&&h&&(t[":@"]=this.buildAttributesMap(u,s,a)),this.addChild(n,t,s,f),s=s.substr(0,s.lastIndexOf("."))}else{const t=new I(a);this.tagsNodeStack.push(n),a!==u&&h&&(t[":@"]=this.buildAttributesMap(u,s,a)),this.addChild(n,t,s,f),n=t}i="",o=d}}else i+=t[o];return e.child};function R(t,e,n,i){this.options.captureMetaData||(i=void 0);const s=this.options.updateTag(e.tagname,n,e[":@"]);!1===s||("string"==typeof s?(e.tagname=s,t.addChild(e,i)):t.addChild(e,i))}const Y=function(t,e,n){if(-1===t.indexOf("&"))return t;const i=this.options.processEntities;if(!i.enabled)return t;if(i.allowedTags&&!i.allowedTags.includes(e))return t;if(i.tagFilter&&!i.tagFilter(e,n))return t;for(let e in this.docTypeEntities){const n=this.docTypeEntities[e],s=t.match(n.regx);if(s){if(this.entityExpansionCount+=s.length,i.maxTotalExpansions&&this.entityExpansionCount>i.maxTotalExpansions)throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${i.maxTotalExpansions}`);const e=t.length;if(t=t.replace(n.regx,n.val),i.maxExpandedLength&&(this.currentExpandedLength+=t.length-e,this.currentExpandedLength>i.maxExpandedLength))throw new Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${i.maxExpandedLength}`)}}if(-1===t.indexOf("&"))return t;for(let e in this.lastEntities){const n=this.lastEntities[e];t=t.replace(n.regex,n.val)}if(-1===t.indexOf("&"))return t;if(this.options.htmlEntities)for(let e in this.htmlEntities){const n=this.htmlEntities[e];t=t.replace(n.regex,n.val)}return t.replace(this.ampEntity.regex,this.ampEntity.val)};function G(t,e,n,i){return t&&(void 0===i&&(i=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function X(t,e,n,i){return!(!e||!e.has(i))||!(!t||!t.has(n))}function z(t,e,n,i){const s=t.indexOf(e,n);if(-1===s)throw new Error(i);return s+e.length-1}function W(t,e,n,i=">"){const s=function(t,e,n=">"){let i,s="";for(let r=e;r<t.length;r++){let e=t[r];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:s,index:r};if(t[r+1]===n[1])return{data:s,index:r}}else"\t"===e&&(e=" ");s+=e}}(t,e+1,i);if(!s)return;let r=s.data;const o=s.index,a=r.search(/\s/);let l=r,u=!0;-1!==a&&(l=r.substring(0,a),r=r.substring(a+1).trimStart());const h=l;if(n){const t=l.indexOf(":");-1!==t&&(l=l.substr(t+1),u=l!==s.data.substr(t+1))}return{tagName:l,tagExp:r,closeIndex:o,attrExpPresent:u,rawTagName:h}}function q(t,e,n){const i=n;let s=1;for(;n<t.length;n++)if("<"===t[n])if("/"===t[n+1]){const r=z(t,">",n,`${e} is not closed`);if(t.substring(n+2,r).trim()===e&&(s--,0===s))return{tagContent:t.substring(i,n),i:r};n=r}else if("?"===t[n+1])n=z(t,"?>",n+1,"StopNode is not closed.");else if("!--"===t.substr(n+1,3))n=z(t,"--\x3e",n+3,"StopNode is not closed.");else if("!["===t.substr(n+1,2))n=z(t,"]]>",n,"StopNode is not closed.")-2;else{const i=W(t,n,">");i&&((i&&i.tagName)===e&&"/"!==i.tagExp[i.tagExp.length-1]&&s++,n=i.closeIndex)}}function Z(t,e,n){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&function(t,e={}){if(e=Object.assign({},V,e),!t||"string"!=typeof t)return t;let n=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(n))return t;if("0"===t)return 0;if(e.hex&&C.test(n))return function(t){if(parseInt)return parseInt(t,16);if(Number.parseInt)return Number.parseInt(t,16);if(window&&window.parseInt)return window.parseInt(t,16);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(n);if(-1!==n.search(/.+[eE].+/))return function(t,e,n){if(!n.eNotation)return t;const i=e.match(D);if(i){let s=i[1]||"";const r=-1===i[3].indexOf("e")?"E":"e",o=i[2],a=s?t[o.length+1]===r:t[o.length]===r;return o.length>1&&a?t:1!==o.length||!i[3].startsWith(`.${r}`)&&i[3][0]!==r?n.leadingZeros&&!a?(e=(i[1]||"")+i[3],Number(e)):t:Number(e)}return t}(t,n,e);{const s=$.exec(n);if(s){const r=s[1]||"",o=s[2];let a=(i=s[3])&&-1!==i.indexOf(".")?("."===(i=i.replace(/0+$/,""))?i="0":"."===i[0]?i="0"+i:"."===i[i.length-1]&&(i=i.substring(0,i.length-1)),i):i;const l=r?"."===t[o.length+1]:"."===t[o.length];if(!e.leadingZeros&&(o.length>1||1===o.length&&!l))return t;{const i=Number(n),s=String(i);if(0===i||-0===i)return i;if(-1!==s.search(/[eE]/))return e.eNotation?i:t;if(-1!==n.indexOf("."))return"0"===s||s===a||s===`${r}${a}`?i:t;let l=o?a:n;return o?l===s||r+l===s?i:t:l===s||l===r+s?i:t}}return t}var i}(t,n)}return void 0!==t?t:""}function K(t,e,n){const i=Number.parseInt(t,e);return i>=0&&i<=1114111?String.fromCodePoint(i):n+t+";"}const Q=I.getMetaDataSymbol();function J(t,e){return H(t,e)}function H(t,e,n){let i;const s={};for(let r=0;r<t.length;r++){const o=t[r],a=tt(o);let l="";if(l=void 0===n?a:n+"."+a,a===e.textNodeName)void 0===i?i=o[a]:i+=""+o[a];else{if(void 0===a)continue;if(o[a]){let t=H(o[a],e,l);const n=nt(t,e);void 0!==o[Q]&&(t[Q]=o[Q]),o[":@"]?et(t,o[":@"],l,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==s[a]&&s.hasOwnProperty(a)?(Array.isArray(s[a])||(s[a]=[s[a]]),s[a].push(t)):e.isArray(a,l,n)?s[a]=[t]:s[a]=t}}}return"string"==typeof i?i.length>0&&(s[e.textNodeName]=i):void 0!==i&&(s[e.textNodeName]=i),s}function tt(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function et(t,e,n,i){if(e){const s=Object.keys(e),r=s.length;for(let o=0;o<r;o++){const r=s[o];i.isArray(r,n+"."+r,!0,!0)?t[r]=[e[r]]:t[r]=e[r]}}}function nt(t,e){const{textNodeName:n}=e,i=Object.keys(t).length;return 0===i||!(1!==i||!t[n]&&"boolean"!=typeof t[n]&&0!==t[n])}class it{constructor(t){this.externalEntities={},this.options=w(t)}parse(t,e){if("string"!=typeof t&&t.toString)t=t.toString();else if("string"!=typeof t)throw new Error("XML data is accepted in String or Bytes[] form.");if(e){!0===e&&(e={});const n=a(t,e);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new F(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(t);return this.options.preserveOrder||void 0===i?i:J(i,this.options)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}static getMetaDataSymbol(){return I.getMetaDataSymbol()}}function st(t,e){let n="";return e.format&&e.indentBy.length>0&&(n="\n"),rt(t,e,"",n)}function rt(t,e,n,i){let s="",r=!1;for(let o=0;o<t.length;o++){const a=t[o],l=ot(a);if(void 0===l)continue;let u="";if(u=0===n.length?l:`${n}.${l}`,l===e.textNodeName){let t=a[l];lt(u,e)||(t=e.tagValueProcessor(l,t),t=ut(t,e)),r&&(s+=i),s+=t,r=!1;continue}if(l===e.cdataPropName){r&&(s+=i),s+=`<![CDATA[${a[l][0][e.textNodeName]}]]>`,r=!1;continue}if(l===e.commentPropName){s+=i+`\x3c!--${a[l][0][e.textNodeName]}--\x3e`,r=!0;continue}if("?"===l[0]){const t=at(a[":@"],e),n="?xml"===l?"":i;let o=a[l][0][e.textNodeName];o=0!==o.length?" "+o:"",s+=n+`<${l}${o}${t}?>`,r=!0;continue}let h=i;""!==h&&(h+=e.indentBy);const d=i+`<${l}${at(a[":@"],e)}`,p=rt(a[l],e,u,h);-1!==e.unpairedTags.indexOf(l)?e.suppressUnpairedNode?s+=d+">":s+=d+"/>":p&&0!==p.length||!e.suppressEmptyNode?p&&p.endsWith(">")?s+=d+`>${p}${i}</${l}>`:(s+=d+">",p&&""!==i&&(p.includes("/>")||p.includes("</"))?s+=i+e.indentBy+p+i:s+=p,s+=`</${l}>`):s+=d+"/>",r=!0}return s}function ot(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];if(t.hasOwnProperty(i)&&":@"!==i)return i}}function at(t,e){let n="";if(t&&!e.ignoreAttributes)for(let i in t){if(!t.hasOwnProperty(i))continue;let s=e.attributeValueProcessor(i,t[i]);s=ut(s,e),!0===s&&e.suppressBooleanAttributes?n+=` ${i.substr(e.attributeNamePrefix.length)}`:n+=` ${i.substr(e.attributeNamePrefix.length)}="${s}"`}return n}function lt(t,e){let n=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(let i in e.stopNodes)if(e.stopNodes[i]===t||e.stopNodes[i]==="*."+n)return!0;return!1}function ut(t,e){if(t&&t.length>0&&e.processEntities)for(let n=0;n<e.entities.length;n++){const i=e.entities[n];t=t.replace(i.regex,i.val)}return t}const ht={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function dt(t){this.options=Object.assign({},ht,t),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=L(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=ct),this.processTextOrObjNode=pt,this.options.format?(this.indentate=ft,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function pt(t,e,n,i){const s=this.j2x(t,n+1,i.concat(e));return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,s.attrStr,n):this.buildObjectNode(s.val,e,s.attrStr,n)}function ft(t){return this.options.indentBy.repeat(t)}function ct(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}dt.prototype.build=function(t){return this.options.preserveOrder?st(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0,[]).val)},dt.prototype.j2x=function(t,e,n){let i="",s="";const r=n.join(".");for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o))if(void 0===t[o])this.isAttribute(o)&&(s+="");else if(null===t[o])this.isAttribute(o)||o===this.options.cdataPropName?s+="":"?"===o[0]?s+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if(t[o]instanceof Date)s+=this.buildTextValNode(t[o],o,"",e);else if("object"!=typeof t[o]){const n=this.isAttribute(o);if(n&&!this.ignoreAttributesFn(n,r))i+=this.buildAttrPairStr(n,""+t[o]);else if(!n)if(o===this.options.textNodeName){let e=this.options.tagValueProcessor(o,""+t[o]);s+=this.replaceEntitiesValue(e)}else s+=this.buildTextValNode(t[o],o,"",e)}else if(Array.isArray(t[o])){const i=t[o].length;let r="",a="";for(let l=0;l<i;l++){const i=t[o][l];if(void 0===i);else if(null===i)"?"===o[0]?s+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if("object"==typeof i)if(this.options.oneListGroup){const t=this.j2x(i,e+1,n.concat(o));r+=t.val,this.options.attributesGroupName&&i.hasOwnProperty(this.options.attributesGroupName)&&(a+=t.attrStr)}else r+=this.processTextOrObjNode(i,o,e,n);else if(this.options.oneListGroup){let t=this.options.tagValueProcessor(o,i);t=this.replaceEntitiesValue(t),r+=t}else r+=this.buildTextValNode(i,o,"",e)}this.options.oneListGroup&&(r=this.buildObjectNode(r,o,a,e)),s+=r}else if(this.options.attributesGroupName&&o===this.options.attributesGroupName){const e=Object.keys(t[o]),n=e.length;for(let s=0;s<n;s++)i+=this.buildAttrPairStr(e[s],""+t[o][e[s]])}else s+=this.processTextOrObjNode(t[o],o,e,n);return{attrStr:i,val:s}},dt.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},dt.prototype.buildObjectNode=function(t,e,n,i){if(""===t)return"?"===e[0]?this.indentate(i)+"<"+e+n+"?"+this.tagEndChar:this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar;{let s="</"+e+this.tagEndChar,r="";return"?"===e[0]&&(r="?",s=""),!n&&""!==n||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===r.length?this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine:this.indentate(i)+"<"+e+n+r+this.tagEndChar+t+this.indentate(i)+s:this.indentate(i)+"<"+e+n+r+">"+t+s}},dt.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`></${t}`,e},dt.prototype.buildTextValNode=function(t,e,n,i){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(i)+`<![CDATA[${t}]]>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(i)+"<"+e+n+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(e,t);return s=this.replaceEntitiesValue(s),""===s?this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+n+">"+s+"</"+e+this.tagEndChar}},dt.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const n=this.options.entities[e];t=t.replace(n.regex,n.val)}return t};const gt={validate:a};module.exports=e})();
|
|
100952
99821
|
|
|
100953
99822
|
/***/ }),
|
|
100954
99823
|
|