Compare commits

..
Author SHA1 Message Date
Dave Hadka 345e0e411a Merge branch 'dhadka/update-cache-module' of https://github.com/actions/cache into dhadka/update-cache-module 2020-10-20 13:00:13 -05:00
Dave Hadka def3a7d616 Update dist files 2020-10-20 12:59:57 -05:00
David Hadka 648a1f9e09 Real licenses 2020-10-20 12:55:59 -05:00
David Hadka b32535486f Revert "Update licenses"
This reverts commit 97314e1d15.
2020-10-20 12:55:08 -05:00
David Hadka 97314e1d15 Update licenses 2020-10-20 12:30:03 -05:00
Dave Hadka d74c9636bf Bump cache action version 2020-10-20 12:19:34 -05:00
Dave Hadka 0c7f3b7744 Update to @actions/cache 1.0.3 2020-10-20 12:15:13 -05:00
11 changed files with 1469 additions and 2488 deletions
-1
View File
@@ -1 +0,0 @@
* @actions/artifacts-actions
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: "@actions/cache"
version: 1.0.5
version: 1.0.3
type: npm
summary: Actions cache lib
homepage: https://github.com/actions/toolkit/tree/main/packages/cache
+20 -10
View File
@@ -1,20 +1,30 @@
---
name: "@actions/core"
version: 1.2.6
version: 1.2.4
type: npm
summary: Actions core lib
homepage: https://github.com/actions/toolkit/tree/main/packages/core
homepage: https://github.com/actions/toolkit/tree/master/packages/core
license: mit
licenses:
- sources: LICENSE.md
text: |-
The MIT License (MIT)
- sources: Auto-generated MIT license text
text: |
MIT License
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
notices: []
+20 -10
View File
@@ -1,20 +1,30 @@
---
name: "@actions/glob"
version: 0.1.1
version: 0.1.0
type: npm
summary: Actions glob lib
homepage: https://github.com/actions/toolkit/tree/main/packages/glob
homepage: https://github.com/actions/toolkit/tree/master/packages/glob
license: mit
licenses:
- sources: LICENSE.md
text: |-
The MIT License (MIT)
- sources: Auto-generated MIT license text
text: |
MIT License
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
notices: []
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: "@azure/core-http"
version: 1.2.1
version: 1.1.9
type: npm
summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
libraries generated using AutoRest
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: "@azure/storage-blob"
version: 12.3.0
version: 12.2.1
type: npm
summary: Microsoft Azure Storage SDK for JavaScript - Blob
homepage: https://github.com/Azure/azure-sdk-for-js#readme
@@ -1,6 +1,6 @@
---
name: uuid
version: 8.3.2
version: 8.3.1
type: npm
summary: RFC4122 (v1, v4, and v5) UUIDs
homepage: https://github.com/uuidjs/uuid#readme
+700 -1219
View File
@@ -1074,9 +1074,7 @@ function resolvePaths(patterns) {
try {
for (var _c = __asyncValues(globber.globGenerator()), _d; _d = yield _c.next(), !_d.done;) {
const file = _d.value;
const relativeFile = path
.relative(workspace, file)
.replace(new RegExp(`\\${path.sep}`, 'g'), '/');
const relativeFile = path.relative(workspace, file);
core.debug(`Matched: ${relativeFile}`);
// Paths are made relative so the tar entries are all relative to the root of the workspace.
paths.push(`${relativeFile}`);
@@ -1522,31 +1520,7 @@ if (typeof Symbol === undefined || !Symbol.asyncIterator) {
/* 79 */,
/* 80 */,
/* 81 */,
/* 82 */
/***/ (function(__unusedmodule, exports) {
"use strict";
// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Sanitizes an input into a string so it can be passed into issueCommand safely
* @param input input to sanitize into a string
*/
function toCommandValue(input) {
if (input === null || input === undefined) {
return '';
}
else if (typeof input === 'string' || input instanceof String) {
return input;
}
return JSON.stringify(input);
}
exports.toCommandValue = toCommandValue;
//# sourceMappingURL=utils.js.map
/***/ }),
/* 82 */,
/* 83 */,
/* 84 */,
/* 85 */,
@@ -2756,38 +2730,31 @@ Object.defineProperty(exports, "__esModule", { value: true });
/* 100 */,
/* 101 */,
/* 102 */
/***/ (function(__unusedmodule, exports, __webpack_require__) {
/***/ (function(__unusedmodule, exports) {
"use strict";
// For internal use, subject to change.
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */
const fs = __importStar(__webpack_require__(747));
const os = __importStar(__webpack_require__(87));
const utils_1 = __webpack_require__(82);
function issueCommand(command, message) {
const filePath = process.env[`GITHUB_${command}`];
if (!filePath) {
throw new Error(`Unable to find environment variable for file command ${command}`);
}
if (!fs.existsSync(filePath)) {
throw new Error(`Missing file at path: ${filePath}`);
}
fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
encoding: 'utf8'
});
}
exports.issueCommand = issueCommand;
//# sourceMappingURL=file-command.js.map
exports._globalThis = void 0;
/** only globals that common to node and browsers are allowed */
// eslint-disable-next-line node/no-unsupported-features/es-builtins
exports._globalThis = typeof globalThis === 'object' ? globalThis : global;
//# sourceMappingURL=globalThis.js.map
/***/ }),
/* 103 */,
@@ -3269,12 +3236,9 @@ function uploadChunk(httpClient, resourceUrl, openStream, start, end) {
'Content-Type': 'application/octet-stream',
'Content-Range': getContentRange(start, end)
};
const uploadChunkResponse = yield requestUtils_1.retryHttpClientResponse(`uploadChunk (start: ${start}, end: ${end})`, () => __awaiter(this, void 0, void 0, function* () {
yield requestUtils_1.retryHttpClientResponse(`uploadChunk (start: ${start}, end: ${end})`, () => __awaiter(this, void 0, void 0, function* () {
return httpClient.sendStream('PATCH', resourceUrl, openStream(), additionalHeaders);
}));
if (!requestUtils_1.isSuccessStatusCode(uploadChunkResponse.message.statusCode)) {
throw new Error(`Cache service responded with ${uploadChunkResponse.message.statusCode} during upload chunk.`);
}
});
}
function uploadFile(httpClient, cacheId, archivePath, options) {
@@ -4028,34 +3992,7 @@ var __createBinding;
/***/ }),
/* 145 */
/***/ (function(__unusedmodule, exports) {
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports._globalThis = void 0;
/** only globals that common to node and browsers are allowed */
// eslint-disable-next-line node/no-unsupported-features/es-builtins
exports._globalThis = typeof globalThis === 'object' ? globalThis : global;
//# sourceMappingURL=globalThis.js.map
/***/ }),
/* 145 */,
/* 146 */,
/* 147 */
/***/ (function(__unusedmodule, exports) {
@@ -8542,19 +8479,12 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(__webpack_require__(470));
const fs = __importStar(__webpack_require__(747));
const globOptionsHelper = __importStar(__webpack_require__(601));
const path = __importStar(__webpack_require__(622));
const patternHelper = __importStar(__webpack_require__(597));
const core = __webpack_require__(470);
const fs = __webpack_require__(747);
const globOptionsHelper = __webpack_require__(601);
const path = __webpack_require__(622);
const patternHelper = __webpack_require__(597);
const internal_match_kind_1 = __webpack_require__(327);
const internal_pattern_1 = __webpack_require__(923);
const internal_search_state_1 = __webpack_require__(728);
@@ -9805,13 +9735,6 @@ var StorageError = {
type: {
name: "String"
}
},
code: {
xmlName: "Code",
serializedName: "Code",
type: {
name: "String"
}
}
}
}
@@ -10172,13 +10095,6 @@ var BlobPropertiesInternal = {
type: {
name: "String"
}
},
lastAccessedOn: {
xmlName: "LastAccessTime",
serializedName: "LastAccessTime",
type: {
name: "DateTimeRfc1123"
}
}
}
}
@@ -10884,70 +10800,6 @@ var JsonTextConfiguration = {
}
}
};
var ArrowField = {
xmlName: "Field",
serializedName: "ArrowField",
type: {
name: "Composite",
className: "ArrowField",
modelProperties: {
type: {
xmlName: "Type",
required: true,
serializedName: "Type",
type: {
name: "String"
}
},
name: {
xmlName: "Name",
serializedName: "Name",
type: {
name: "String"
}
},
precision: {
xmlName: "Precision",
serializedName: "Precision",
type: {
name: "Number"
}
},
scale: {
xmlName: "Scale",
serializedName: "Scale",
type: {
name: "Number"
}
}
}
}
};
var ArrowConfiguration = {
serializedName: "ArrowConfiguration",
type: {
name: "Composite",
className: "ArrowConfiguration",
modelProperties: {
schema: {
xmlIsWrapped: true,
xmlName: "Schema",
xmlElementName: "Field",
required: true,
serializedName: "Schema",
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ArrowField"
}
}
}
}
}
}
};
var ListContainersSegmentResponse = {
xmlName: "EnumerationResults",
serializedName: "ListContainersSegmentResponse",
@@ -11388,8 +11240,7 @@ var QueryFormat = {
name: "Enum",
allowedValues: [
"delimited",
"json",
"arrow"
"json"
]
}
},
@@ -11408,14 +11259,6 @@ var QueryFormat = {
name: "Composite",
className: "JsonTextConfiguration"
}
},
arrowConfiguration: {
xmlName: "ArrowConfiguration",
serializedName: "ArrowConfiguration",
type: {
name: "Composite",
className: "ArrowConfiguration"
}
}
}
}
@@ -13069,12 +12912,6 @@ var BlobDownloadHeaders = {
name: "Boolean"
}
},
lastAccessed: {
serializedName: "x-ms-last-access-time",
type: {
name: "DateTimeRfc1123"
}
},
contentCrc64: {
serializedName: "x-ms-content-crc64",
type: {
@@ -13404,12 +13241,6 @@ var BlobGetPropertiesHeaders = {
name: "String"
}
},
lastAccessed: {
serializedName: "x-ms-last-access-time",
type: {
name: "DateTimeRfc1123"
}
},
errorCode: {
serializedName: "x-ms-error-code",
type: {
@@ -17796,7 +17627,7 @@ var version = {
required: true,
isConstant: true,
serializedName: "x-ms-version",
defaultValue: '2020-02-10',
defaultValue: '2019-12-12',
type: {
name: "String"
}
@@ -18788,8 +18619,6 @@ var getAccountInfoOperationSpec$1 = {
var Mappers$2 = /*#__PURE__*/Object.freeze({
__proto__: null,
ArrowConfiguration: ArrowConfiguration,
ArrowField: ArrowField,
BlobAbortCopyFromURLHeaders: BlobAbortCopyFromURLHeaders,
BlobAcquireLeaseHeaders: BlobAcquireLeaseHeaders,
BlobBreakLeaseHeaders: BlobBreakLeaseHeaders,
@@ -20879,8 +20708,8 @@ var logger = logger$1.createClientLogger("storage-blob");
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
var SDK_VERSION = "12.3.0";
var SERVICE_VERSION = "2020-02-10";
var SDK_VERSION = "12.2.1";
var SERVICE_VERSION = "2019-12-12";
var BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB
var BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB
var BLOCK_BLOB_MAX_BLOCKS = 50000;
@@ -21587,7 +21416,7 @@ function toTags(tags) {
* Convert BlobQueryTextConfiguration to QuerySerialization type.
*
* @export
* @param {(BlobQueryJsonTextConfiguration | BlobQueryCsvTextConfiguration | BlobQueryArrowConfiguration)} [textConfiguration]
* @param {(BlobQueryJsonTextConfiguration | BlobQueryCsvTextConfiguration)} [textConfiguration]
* @returns {(QuerySerialization | undefined)}
*/
function toQuerySerialization(textConfiguration) {
@@ -21617,15 +21446,6 @@ function toQuerySerialization(textConfiguration) {
}
}
};
case "arrow":
return {
format: {
type: "arrow",
arrowConfiguration: {
schema: textConfiguration.schema
}
}
};
default:
throw Error("Invalid BlobQueryTextConfiguration.");
}
@@ -22913,21 +22733,6 @@ var BlobDownloadResponse = /** @class */ (function () {
enumerable: false,
configurable: true
});
Object.defineProperty(BlobDownloadResponse.prototype, "lastAccessed", {
/**
* Returns the UTC date and time generated by the service that indicates the time at which the blob was
* last read or written to.
*
* @readonly
* @type {(Date | undefined)}
* @memberof BlobDownloadResponse
*/
get: function () {
return this.originalResponse.lastAccessed;
},
enumerable: false,
configurable: true
});
Object.defineProperty(BlobDownloadResponse.prototype, "metadata", {
/**
* A name-value pair
@@ -24932,7 +24737,7 @@ var StorageSharedKeyCredential = /** @class */ (function (_super) {
* regenerated.
*/
var packageName = "azure-storage-blob";
var packageVersion = "12.3.0";
var packageVersion = "12.2.1";
var StorageClientContext = /** @class */ (function (_super) {
tslib.__extends(StorageClientContext, _super);
/**
@@ -24954,7 +24759,7 @@ var StorageClientContext = /** @class */ (function (_super) {
options.userAgent = packageName + "/" + packageVersion + " " + defaultUserAgent;
}
_this = _super.call(this, undefined, options) || this;
_this.version = "2020-02-10";
_this.version = "2019-12-12";
_this.baseUri = "{url}";
_this.requestContentType = "application/json; charset=utf-8";
_this.url = url;
@@ -28298,56 +28103,6 @@ var BlockBlobClient = /** @class */ (function (_super) {
});
};
// High level functions
/**
* Uploads a Buffer(Node.js)/Blob(browsers)/ArrayBuffer/ArrayBufferView object to a BlockBlob.
*
* When data length is no more than the specifiled {@link BlockBlobParallelUploadOptions.maxSingleShotSize} (default is
* {@link BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}), this method will use 1 {@link upload} call to finish the upload.
* Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call {@link commitBlockList}
* to commit the block list.
*
* @export
* @param {Buffer | Blob | ArrayBuffer | ArrayBufferView} data Buffer(Node.js), Blob, ArrayBuffer or ArrayBufferView
* @param {BlockBlobParallelUploadOptions} [options]
* @returns {Promise<BlobUploadCommonResponse>}
* @memberof BlockBlobClient
*/
BlockBlobClient.prototype.uploadData = function (data, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, buffer_1, browserBlob_1;
return tslib.__generator(this, function (_b) {
_a = createSpan("BlockBlobClient-uploadData", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions;
try {
if (true) {
if (data instanceof Buffer) {
buffer_1 = data;
}
else if (data instanceof ArrayBuffer) {
buffer_1 = Buffer.from(data);
}
else {
data = data;
buffer_1 = Buffer.from(data.buffer, data.byteOffset, data.byteLength);
}
return [2 /*return*/, this.uploadSeekableInternal(function (offset, size) { return buffer_1.slice(offset, offset + size); }, buffer_1.byteLength, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))];
}
else {}
}
catch (e) {
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e.message
});
throw e;
}
finally {
span.end();
}
return [2 /*return*/];
});
});
};
/**
* ONLY AVAILABLE IN BROWSERS.
*
@@ -28357,8 +28112,6 @@ var BlockBlobClient = /** @class */ (function (_super) {
* Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call
* {@link commitBlockList} to commit the block list.
*
* @deprecated Use {@link uploadData} instead.
*
* @export
* @param {Blob | ArrayBuffer | ArrayBufferView} browserData Blob, File, ArrayBuffer or ArrayBufferView
* @param {BlockBlobParallelUploadOptions} [options] Options to upload browser data.
@@ -28368,7 +28121,7 @@ var BlockBlobClient = /** @class */ (function (_super) {
BlockBlobClient.prototype.uploadBrowserData = function (browserData, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, browserBlob_2, e_29;
var _a, span, spanOptions, browserBlob_1, e_29;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -28376,8 +28129,10 @@ var BlockBlobClient = /** @class */ (function (_super) {
_b.label = 1;
case 1:
_b.trys.push([1, 3, 4, 5]);
browserBlob_2 = new Blob([browserData]);
return [4 /*yield*/, this.uploadSeekableInternal(function (offset, size) { return browserBlob_2.slice(offset, offset + size); }, browserBlob_2.size, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))];
browserBlob_1 = new Blob([browserData]);
return [4 /*yield*/, this.uploadSeekableBlob(function (offset, size) {
return browserBlob_1.slice(offset, offset + size);
}, browserBlob_1.size, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))];
case 2: return [2 /*return*/, _b.sent()];
case 3:
e_29 = _b.sent();
@@ -28395,22 +28150,22 @@ var BlockBlobClient = /** @class */ (function (_super) {
});
};
/**
* ONLY AVAILABLE IN BROWSERS.
*
* Uploads data to block blob. Requires a bodyFactory as the data source,
* which need to return a {@link HttpRequestBody} object with the offset and size provided.
* Uploads a browser {@link Blob} object to block blob. Requires a blobFactory as the data source,
* which need to return a {@link Blob} object with the offset and size provided.
*
* When data length is no more than the specifiled {@link BlockBlobParallelUploadOptions.maxSingleShotSize} (default is
* {@link BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}), this method will use 1 {@link upload} call to finish the upload.
* Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call {@link commitBlockList}
* When buffer length <= 256MB, this method will use 1 upload call to finish the upload.
* Otherwise, this method will call stageBlock to upload blocks, and finally call commitBlockList
* to commit the block list.
*
* @param {(offset: number, size: number) => HttpRequestBody} bodyFactory
* @param {(offset: number, size: number) => Blob} blobFactory
* @param {number} size size of the data to upload.
* @param {BlockBlobParallelUploadOptions} [options] Options to Upload to Block Blob operation.
* @returns {Promise<BlobUploadCommonResponse>} Response data for the Blob Upload operation.
* @memberof BlockBlobClient
*/
BlockBlobClient.prototype.uploadSeekableInternal = function (bodyFactory, size, options) {
BlockBlobClient.prototype.uploadSeekableBlob = function (blobFactory, size, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, numBlocks_1, blockList_1, blockIDPrefix_1, transferProgress_2, batch, _loop_2, i, e_30;
@@ -28448,12 +28203,12 @@ var BlockBlobClient = /** @class */ (function (_super) {
if (!options.conditions) {
options.conditions = {};
}
_a = createSpan("BlockBlobClient-uploadSeekableInternal", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions;
_a = createSpan("BlockBlobClient-UploadSeekableBlob", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions;
_b.label = 1;
case 1:
_b.trys.push([1, 5, 6, 7]);
if (!(size <= options.maxSingleShotSize)) return [3 /*break*/, 3];
return [4 /*yield*/, this.upload(bodyFactory(0, size), size, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))];
return [4 /*yield*/, this.upload(blobFactory(0, size), size, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))];
case 2: return [2 /*return*/, _b.sent()];
case 3:
numBlocks_1 = Math.floor((size - 1) / options.blockSize) + 1;
@@ -28476,7 +28231,7 @@ var BlockBlobClient = /** @class */ (function (_super) {
end = i === numBlocks_1 - 1 ? size : start + options.blockSize;
contentLength = end - start;
blockList_1.push(blockID);
return [4 /*yield*/, this.stageBlock(blockID, bodyFactory(start, contentLength), contentLength, {
return [4 /*yield*/, this.stageBlock(blockID, blobFactory(start, contentLength), contentLength, {
abortSignal: options.abortSignal,
conditions: options.conditions,
encryptionScope: options.encryptionScope,
@@ -28547,14 +28302,12 @@ var BlockBlobClient = /** @class */ (function (_super) {
return [4 /*yield*/, fsStat(filePath)];
case 2:
size = (_b.sent()).size;
return [4 /*yield*/, this.uploadSeekableInternal(function (offset, count) {
return function () {
return fsCreateReadStream(filePath, {
autoClose: true,
end: count ? offset + count - 1 : Infinity,
start: offset
});
};
return [4 /*yield*/, this.uploadResetableStream(function (offset, count) {
return fsCreateReadStream(filePath, {
autoClose: true,
end: count ? offset + count - 1 : Infinity,
start: offset
});
}, size, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))];
case 3: return [2 /*return*/, _b.sent()];
case 4:
@@ -28662,6 +28415,132 @@ var BlockBlobClient = /** @class */ (function (_super) {
});
});
};
/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
*
* Accepts a Node.js Readable stream factory, and uploads in blocks to a block blob.
* The Readable stream factory must returns a Node.js Readable stream starting from the offset defined. The offset
* is the offset in the block blob to be uploaded.
*
* When buffer length <= 256MB, this method will use 1 upload call to finish the upload.
* Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call {@link commitBlockList}
* to commit the block list.
*
* @export
* @param {(offset: number) => NodeJS.ReadableStream} streamFactory Returns a Node.js Readable stream starting
* from the offset defined
* @param {number} size Size of the block blob
* @param {BlockBlobParallelUploadOptions} [options] Options to Upload to Block Blob operation.
* @returns {(Promise<BlobUploadCommonResponse>)} Response data for the Blob Upload operation.
* @memberof BlockBlobClient
*/
BlockBlobClient.prototype.uploadResetableStream = function (streamFactory, size, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, numBlocks_2, blockList_3, blockIDPrefix_3, transferProgress_4, batch, _loop_3, i, e_33;
var _this = this;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
if (!options.blockSize) {
options.blockSize = 0;
}
if (options.blockSize < 0 || options.blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) {
throw new RangeError("blockSize option must be >= 0 and <= " + BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES);
}
if (options.maxSingleShotSize !== 0 && !options.maxSingleShotSize) {
options.maxSingleShotSize = BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES;
}
if (options.maxSingleShotSize < 0 ||
options.maxSingleShotSize > BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) {
throw new RangeError("maxSingleShotSize option must be >= 0 and <= " + BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES);
}
if (options.blockSize === 0) {
if (size > BLOCK_BLOB_MAX_BLOCKS * BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) {
throw new RangeError(size + " is too larger to upload to a block blob.");
}
if (size > options.maxSingleShotSize) {
options.blockSize = Math.ceil(size / BLOCK_BLOB_MAX_BLOCKS);
if (options.blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) {
options.blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES;
}
}
}
if (!options.blobHTTPHeaders) {
options.blobHTTPHeaders = {};
}
if (!options.conditions) {
options.conditions = {};
}
_a = createSpan("BlockBlobClient-uploadResetableStream", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions;
_b.label = 1;
case 1:
_b.trys.push([1, 6, 7, 8]);
if (!(size <= options.maxSingleShotSize)) return [3 /*break*/, 3];
return [4 /*yield*/, this.upload(function () { return streamFactory(0); }, size, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))];
case 2: return [2 /*return*/, _b.sent()];
case 3:
numBlocks_2 = Math.floor((size - 1) / options.blockSize) + 1;
if (numBlocks_2 > BLOCK_BLOB_MAX_BLOCKS) {
throw new RangeError("The buffer's size is too big or the BlockSize is too small;" +
("the number of blocks must be <= " + BLOCK_BLOB_MAX_BLOCKS));
}
blockList_3 = [];
blockIDPrefix_3 = coreHttp.generateUuid();
transferProgress_4 = 0;
batch = new Batch(options.concurrency);
_loop_3 = function (i) {
batch.addOperation(function () { return tslib.__awaiter(_this, void 0, void 0, function () {
var blockID, start, end, contentLength;
return tslib.__generator(this, function (_a) {
switch (_a.label) {
case 0:
blockID = generateBlockID(blockIDPrefix_3, i);
start = options.blockSize * i;
end = i === numBlocks_2 - 1 ? size : start + options.blockSize;
contentLength = end - start;
blockList_3.push(blockID);
return [4 /*yield*/, this.stageBlock(blockID, function () { return streamFactory(start, contentLength); }, contentLength, {
abortSignal: options.abortSignal,
conditions: options.conditions,
encryptionScope: options.encryptionScope,
tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions })
})];
case 1:
_a.sent();
// Update progress after block is successfully uploaded to server, in case of block trying
transferProgress_4 += contentLength;
if (options.onProgress) {
options.onProgress({ loadedBytes: transferProgress_4 });
}
return [2 /*return*/];
}
});
}); });
};
for (i = 0; i < numBlocks_2; i++) {
_loop_3(i);
}
return [4 /*yield*/, batch.do()];
case 4:
_b.sent();
return [4 /*yield*/, this.commitBlockList(blockList_3, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))];
case 5: return [2 /*return*/, _b.sent()];
case 6:
e_33 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_33.message
});
throw e_33;
case 7:
span.end();
return [7 /*endfinally*/];
case 8: return [2 /*return*/];
}
});
});
};
return BlockBlobClient;
}(BlobClient));
/**
@@ -28760,7 +28639,7 @@ var PageBlobClient = /** @class */ (function (_super) {
var _a;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _b, span, spanOptions, e_33;
var _b, span, spanOptions, e_34;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
@@ -28785,12 +28664,12 @@ var PageBlobClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _c.sent()];
case 3:
e_33 = _c.sent();
e_34 = _c.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_33.message
message: e_34.message
});
throw e_33;
throw e_34;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -28814,7 +28693,7 @@ var PageBlobClient = /** @class */ (function (_super) {
var _a, _b;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _c, span, spanOptions, conditions, res, e_34;
var _c, span, spanOptions, conditions, res, e_35;
return tslib.__generator(this, function (_d) {
switch (_d.label) {
case 0:
@@ -28829,19 +28708,19 @@ var PageBlobClient = /** @class */ (function (_super) {
return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable
})];
case 3:
e_34 = _d.sent();
if (((_a = e_34.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") {
e_35 = _d.sent();
if (((_a = e_35.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") {
span.setStatus({
code: api.CanonicalCode.ALREADY_EXISTS,
message: "Expected exception when creating a blob only if it does not already exist."
});
return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_34.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_34.response })];
return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_35.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_35.response })];
}
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_34.message
message: e_35.message
});
throw e_34;
throw e_35;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -28865,7 +28744,7 @@ var PageBlobClient = /** @class */ (function (_super) {
var _a;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _b, span, spanOptions, e_35;
var _b, span, spanOptions, e_36;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
@@ -28890,12 +28769,12 @@ var PageBlobClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _c.sent()];
case 3:
e_35 = _c.sent();
e_36 = _c.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_35.message
message: e_36.message
});
throw e_35;
throw e_36;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -28921,7 +28800,7 @@ var PageBlobClient = /** @class */ (function (_super) {
var _a;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _b, span, spanOptions, e_36;
var _b, span, spanOptions, e_37;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
@@ -28951,12 +28830,12 @@ var PageBlobClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _c.sent()];
case 3:
e_36 = _c.sent();
e_37 = _c.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_36.message
message: e_37.message
});
throw e_36;
throw e_37;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -28980,7 +28859,7 @@ var PageBlobClient = /** @class */ (function (_super) {
if (offset === void 0) { offset = 0; }
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _b, span, spanOptions, e_37;
var _b, span, spanOptions, e_38;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
@@ -29001,12 +28880,12 @@ var PageBlobClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _c.sent()];
case 3:
e_37 = _c.sent();
e_38 = _c.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_37.message
message: e_38.message
});
throw e_37;
throw e_38;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29030,7 +28909,7 @@ var PageBlobClient = /** @class */ (function (_super) {
if (offset === void 0) { offset = 0; }
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _b, span, spanOptions, e_38;
var _b, span, spanOptions, e_39;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
@@ -29050,12 +28929,12 @@ var PageBlobClient = /** @class */ (function (_super) {
.then(rangeResponseFromModel)];
case 2: return [2 /*return*/, _c.sent()];
case 3:
e_38 = _c.sent();
e_39 = _c.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_38.message
message: e_39.message
});
throw e_38;
throw e_39;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29079,7 +28958,7 @@ var PageBlobClient = /** @class */ (function (_super) {
var _a;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _b, span, spanOptions, e_39;
var _b, span, spanOptions, e_40;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
@@ -29100,12 +28979,12 @@ var PageBlobClient = /** @class */ (function (_super) {
.then(rangeResponseFromModel)];
case 2: return [2 /*return*/, _c.sent()];
case 3:
e_39 = _c.sent();
e_40 = _c.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_39.message
message: e_40.message
});
throw e_39;
throw e_40;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29129,7 +29008,7 @@ var PageBlobClient = /** @class */ (function (_super) {
var _a;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _b, span, spanOptions, e_40;
var _b, span, spanOptions, e_41;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
@@ -29150,12 +29029,12 @@ var PageBlobClient = /** @class */ (function (_super) {
.then(rangeResponseFromModel)];
case 2: return [2 /*return*/, _c.sent()];
case 3:
e_40 = _c.sent();
e_41 = _c.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_40.message
message: e_41.message
});
throw e_40;
throw e_41;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29177,7 +29056,7 @@ var PageBlobClient = /** @class */ (function (_super) {
var _a;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _b, span, spanOptions, e_41;
var _b, span, spanOptions, e_42;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
@@ -29195,12 +29074,12 @@ var PageBlobClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _c.sent()];
case 3:
e_41 = _c.sent();
e_42 = _c.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_41.message
message: e_42.message
});
throw e_41;
throw e_42;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29223,7 +29102,7 @@ var PageBlobClient = /** @class */ (function (_super) {
var _a;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _b, span, spanOptions, e_42;
var _b, span, spanOptions, e_43;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
@@ -29241,12 +29120,12 @@ var PageBlobClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _c.sent()];
case 3:
e_42 = _c.sent();
e_43 = _c.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_42.message
message: e_43.message
});
throw e_42;
throw e_43;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29273,7 +29152,7 @@ var PageBlobClient = /** @class */ (function (_super) {
var _a;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _b, span, spanOptions, e_43;
var _b, span, spanOptions, e_44;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
@@ -29288,12 +29167,12 @@ var PageBlobClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _c.sent()];
case 3:
e_43 = _c.sent();
e_44 = _c.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_43.message
message: e_44.message
});
throw e_43;
throw e_44;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29378,7 +29257,7 @@ var BlobLeaseClient = /** @class */ (function () {
var _a, _b, _c, _d, _e, _f;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _g, span, spanOptions, e_44;
var _g, span, spanOptions, e_45;
return tslib.__generator(this, function (_h) {
switch (_h.label) {
case 0:
@@ -29400,12 +29279,12 @@ var BlobLeaseClient = /** @class */ (function () {
})];
case 2: return [2 /*return*/, _h.sent()];
case 3:
e_44 = _h.sent();
e_45 = _h.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_44.message
message: e_45.message
});
throw e_44;
throw e_45;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29429,7 +29308,7 @@ var BlobLeaseClient = /** @class */ (function () {
var _a, _b, _c, _d, _e, _f;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _g, span, spanOptions, response, e_45;
var _g, span, spanOptions, response, e_46;
return tslib.__generator(this, function (_h) {
switch (_h.label) {
case 0:
@@ -29452,12 +29331,12 @@ var BlobLeaseClient = /** @class */ (function () {
this._leaseId = proposedLeaseId;
return [2 /*return*/, response];
case 3:
e_45 = _h.sent();
e_46 = _h.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_45.message
message: e_46.message
});
throw e_45;
throw e_46;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29481,7 +29360,7 @@ var BlobLeaseClient = /** @class */ (function () {
var _a, _b, _c, _d, _e, _f;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _g, span, spanOptions, e_46;
var _g, span, spanOptions, e_47;
return tslib.__generator(this, function (_h) {
switch (_h.label) {
case 0:
@@ -29501,12 +29380,12 @@ var BlobLeaseClient = /** @class */ (function () {
})];
case 2: return [2 /*return*/, _h.sent()];
case 3:
e_46 = _h.sent();
e_47 = _h.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_46.message
message: e_47.message
});
throw e_46;
throw e_47;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29529,7 +29408,7 @@ var BlobLeaseClient = /** @class */ (function () {
var _a, _b, _c, _d, _e, _f;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _g, span, spanOptions, e_47;
var _g, span, spanOptions, e_48;
return tslib.__generator(this, function (_h) {
switch (_h.label) {
case 0:
@@ -29549,12 +29428,12 @@ var BlobLeaseClient = /** @class */ (function () {
})];
case 2: return [2 /*return*/, _h.sent()];
case 3:
e_47 = _h.sent();
e_48 = _h.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_47.message
message: e_48.message
});
throw e_47;
throw e_48;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29580,7 +29459,7 @@ var BlobLeaseClient = /** @class */ (function () {
var _a, _b, _c, _d, _e, _f;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _g, span, spanOptions, operationOptions, e_48;
var _g, span, spanOptions, operationOptions, e_49;
return tslib.__generator(this, function (_h) {
switch (_h.label) {
case 0:
@@ -29602,12 +29481,12 @@ var BlobLeaseClient = /** @class */ (function () {
return [4 /*yield*/, this._containerOrBlobOperation.breakLease(operationOptions)];
case 2: return [2 /*return*/, _h.sent()];
case 3:
e_48 = _h.sent();
e_49 = _h.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_48.message
message: e_49.message
});
throw e_48;
throw e_49;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29712,7 +29591,7 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.create = function (options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, e_49;
var _a, span, spanOptions, e_50;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -29726,12 +29605,12 @@ var ContainerClient = /** @class */ (function (_super) {
// this will filter out unwanted properties from the response object into result object
return [2 /*return*/, _b.sent()];
case 3:
e_49 = _b.sent();
e_50 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_49.message
message: e_50.message
});
throw e_49;
throw e_50;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29753,7 +29632,7 @@ var ContainerClient = /** @class */ (function (_super) {
var _a, _b;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _c, span, spanOptions, res, e_50;
var _c, span, spanOptions, res, e_51;
return tslib.__generator(this, function (_d) {
switch (_d.label) {
case 0:
@@ -29767,19 +29646,19 @@ var ContainerClient = /** @class */ (function (_super) {
return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable
})];
case 3:
e_50 = _d.sent();
if (((_a = e_50.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") {
e_51 = _d.sent();
if (((_a = e_51.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") {
span.setStatus({
code: api.CanonicalCode.ALREADY_EXISTS,
message: "Expected exception when creating a container only if it does not already exist."
});
return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_50.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_50.response })];
return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_51.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_51.response })];
}
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_50.message
message: e_51.message
});
throw e_50;
throw e_51;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29802,7 +29681,7 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.exists = function (options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, e_51;
var _a, span, spanOptions, e_52;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -29818,8 +29697,8 @@ var ContainerClient = /** @class */ (function (_super) {
_b.sent();
return [2 /*return*/, true];
case 3:
e_51 = _b.sent();
if (e_51.statusCode === 404) {
e_52 = _b.sent();
if (e_52.statusCode === 404) {
span.setStatus({
code: api.CanonicalCode.NOT_FOUND,
message: "Expected exception when checking container existence"
@@ -29828,9 +29707,9 @@ var ContainerClient = /** @class */ (function (_super) {
}
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_51.message
message: e_52.message
});
throw e_51;
throw e_52;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29905,7 +29784,7 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.getProperties = function (options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, e_52;
var _a, span, spanOptions, e_53;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -29919,12 +29798,12 @@ var ContainerClient = /** @class */ (function (_super) {
return [4 /*yield*/, this.containerContext.getProperties(tslib.__assign(tslib.__assign({ abortSignal: options.abortSignal }, options.conditions), { spanOptions: spanOptions }))];
case 2: return [2 /*return*/, _b.sent()];
case 3:
e_52 = _b.sent();
e_53 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_52.message
message: e_53.message
});
throw e_52;
throw e_53;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29945,7 +29824,7 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.delete = function (options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, e_53;
var _a, span, spanOptions, e_54;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -29964,12 +29843,12 @@ var ContainerClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _b.sent()];
case 3:
e_53 = _b.sent();
e_54 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_53.message
message: e_54.message
});
throw e_53;
throw e_54;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29991,7 +29870,7 @@ var ContainerClient = /** @class */ (function (_super) {
var _a, _b;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _c, span, spanOptions, res, e_54;
var _c, span, spanOptions, res, e_55;
return tslib.__generator(this, function (_d) {
switch (_d.label) {
case 0:
@@ -30005,19 +29884,19 @@ var ContainerClient = /** @class */ (function (_super) {
return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable
})];
case 3:
e_54 = _d.sent();
if (((_a = e_54.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") {
e_55 = _d.sent();
if (((_a = e_55.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") {
span.setStatus({
code: api.CanonicalCode.NOT_FOUND,
message: "Expected exception when deleting a container only if it exists."
});
return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_54.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_54.response })];
return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_55.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_55.response })];
}
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_54.message
message: e_55.message
});
throw e_54;
throw e_55;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -30043,7 +29922,7 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.setMetadata = function (metadata, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, e_55;
var _a, span, spanOptions, e_56;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -30066,12 +29945,12 @@ var ContainerClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _b.sent()];
case 3:
e_55 = _b.sent();
e_56 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_55.message
message: e_56.message
});
throw e_55;
throw e_56;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -30096,7 +29975,7 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.getAccessPolicy = function (options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, response, res, _i, response_1, identifier, accessPolicy, e_56;
var _a, span, spanOptions, response, res, _i, response_1, identifier, accessPolicy, e_57;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -30147,12 +30026,12 @@ var ContainerClient = /** @class */ (function (_super) {
}
return [2 /*return*/, res];
case 3:
e_56 = _b.sent();
e_57 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_56.message
message: e_57.message
});
throw e_56;
throw e_57;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -30183,7 +30062,7 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.setAccessPolicy = function (access, containerAcl, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, acl, _i, _b, identifier, e_57;
var _a, span, spanOptions, acl, _i, _b, identifier, e_58;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
@@ -30218,12 +30097,12 @@ var ContainerClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _c.sent()];
case 3:
e_57 = _c.sent();
e_58 = _c.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_57.message
message: e_58.message
});
throw e_57;
throw e_58;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -30268,7 +30147,7 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.uploadBlockBlob = function (blobName, body, contentLength, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, blockBlobClient, response, e_58;
var _a, span, spanOptions, blockBlobClient, response, e_59;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -30285,12 +30164,12 @@ var ContainerClient = /** @class */ (function (_super) {
response: response
}];
case 3:
e_58 = _b.sent();
e_59 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_58.message
message: e_59.message
});
throw e_58;
throw e_59;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -30314,7 +30193,7 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.deleteBlob = function (blobName, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, blobClient, e_59;
var _a, span, spanOptions, blobClient, e_60;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -30329,12 +30208,12 @@ var ContainerClient = /** @class */ (function (_super) {
return [4 /*yield*/, blobClient.delete(tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))];
case 2: return [2 /*return*/, _b.sent()];
case 3:
e_59 = _b.sent();
e_60 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_59.message
message: e_60.message
});
throw e_59;
throw e_60;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -30358,7 +30237,7 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.listBlobFlatSegment = function (marker, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, response, wrappedResponse, e_60;
var _a, span, spanOptions, response, wrappedResponse, e_61;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -30375,12 +30254,12 @@ var ContainerClient = /** @class */ (function (_super) {
}) }) });
return [2 /*return*/, wrappedResponse];
case 3:
e_60 = _b.sent();
e_61 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_60.message
message: e_61.message
});
throw e_60;
throw e_61;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -30405,7 +30284,7 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.listBlobHierarchySegment = function (delimiter, marker, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, response, wrappedResponse, e_61;
var _a, span, spanOptions, response, wrappedResponse, e_62;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -30422,12 +30301,12 @@ var ContainerClient = /** @class */ (function (_super) {
}) }) });
return [2 /*return*/, wrappedResponse];
case 3:
e_61 = _b.sent();
e_62 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_61.message
message: e_62.message
});
throw e_61;
throw e_62;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -30489,8 +30368,8 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.listItems = function (options) {
if (options === void 0) { options = {}; }
return tslib.__asyncGenerator(this, arguments, function listItems_1() {
var marker, _a, _b, listBlobsFlatSegmentResponse, e_62_1;
var e_62, _c;
var marker, _a, _b, listBlobsFlatSegmentResponse, e_63_1;
var e_63, _c;
return tslib.__generator(this, function (_d) {
switch (_d.label) {
case 0:
@@ -30509,8 +30388,8 @@ var ContainerClient = /** @class */ (function (_super) {
case 5: return [3 /*break*/, 1];
case 6: return [3 /*break*/, 13];
case 7:
e_62_1 = _d.sent();
e_62 = { error: e_62_1 };
e_63_1 = _d.sent();
e_63 = { error: e_63_1 };
return [3 /*break*/, 13];
case 8:
_d.trys.push([8, , 11, 12]);
@@ -30521,7 +30400,7 @@ var ContainerClient = /** @class */ (function (_super) {
_d.label = 10;
case 10: return [3 /*break*/, 12];
case 11:
if (e_62) throw e_62.error;
if (e_63) throw e_63.error;
return [7 /*endfinally*/];
case 12: return [7 /*endfinally*/];
case 13: return [2 /*return*/];
@@ -30710,8 +30589,8 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.listItemsByHierarchy = function (delimiter, options) {
if (options === void 0) { options = {}; }
return tslib.__asyncGenerator(this, arguments, function listItemsByHierarchy_1() {
var marker, _a, _b, listBlobsHierarchySegmentResponse, segment, _i, _c, prefix, _d, _e, blob, e_63_1;
var e_63, _f;
var marker, _a, _b, listBlobsHierarchySegmentResponse, segment, _i, _c, prefix, _d, _e, blob, e_64_1;
var e_64, _f;
return tslib.__generator(this, function (_g) {
switch (_g.label) {
case 0:
@@ -30754,8 +30633,8 @@ var ContainerClient = /** @class */ (function (_super) {
case 12: return [3 /*break*/, 1];
case 13: return [3 /*break*/, 20];
case 14:
e_63_1 = _g.sent();
e_63 = { error: e_63_1 };
e_64_1 = _g.sent();
e_64 = { error: e_64_1 };
return [3 /*break*/, 20];
case 15:
_g.trys.push([15, , 18, 19]);
@@ -30766,7 +30645,7 @@ var ContainerClient = /** @class */ (function (_super) {
_g.label = 17;
case 17: return [3 /*break*/, 19];
case 18:
if (e_63) throw e_63.error;
if (e_64) throw e_64.error;
return [7 /*endfinally*/];
case 19: return [7 /*endfinally*/];
case 20: return [2 /*return*/];
@@ -31873,48 +31752,6 @@ var BlobServiceClient = /** @class */ (function (_super) {
});
});
};
/**
* Restore a previously deleted Blob container.
* This API is only functional if Container Soft Delete is enabled for the storage account associated with the container.
*
* @param {string} deletedContainerName Name of the previously deleted container.
* @param {string} deletedContainerVersion Version of the previously deleted container, used to uniquely identify the deleted container.
* @returns {Promise<ContainerUndeleteResponse>} Container deletion response.
* @memberof BlobServiceClient
*/
BlobServiceClient.prototype.undeleteContainer = function (deletedContainerName, deletedContainerVersion, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, containerClient, containerContext, containerUndeleteResponse, e_3;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = createSpan("BlobServiceClient-undeleteContainer", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions;
_b.label = 1;
case 1:
_b.trys.push([1, 3, 4, 5]);
containerClient = this.getContainerClient(options.destinationContainerName || deletedContainerName);
containerContext = new Container(containerClient["storageClientContext"]);
return [4 /*yield*/, containerContext.restore(tslib.__assign(tslib.__assign({ deletedContainerName: deletedContainerName,
deletedContainerVersion: deletedContainerVersion }, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))];
case 2:
containerUndeleteResponse = _b.sent();
return [2 /*return*/, { containerClient: containerClient, containerUndeleteResponse: containerUndeleteResponse }];
case 3:
e_3 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_3.message
});
throw e_3;
case 4:
span.end();
return [7 /*endfinally*/];
case 5: return [2 /*return*/];
}
});
});
};
/**
* Gets the properties of a storage accounts Blob service, including properties
* for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
@@ -31927,7 +31764,7 @@ var BlobServiceClient = /** @class */ (function (_super) {
BlobServiceClient.prototype.getProperties = function (options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, e_4;
var _a, span, spanOptions, e_3;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -31941,12 +31778,12 @@ var BlobServiceClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _b.sent()];
case 3:
e_4 = _b.sent();
e_3 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_4.message
message: e_3.message
});
throw e_4;
throw e_3;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -31968,7 +31805,7 @@ var BlobServiceClient = /** @class */ (function (_super) {
BlobServiceClient.prototype.setProperties = function (properties, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, e_5;
var _a, span, spanOptions, e_4;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -31982,12 +31819,12 @@ var BlobServiceClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _b.sent()];
case 3:
e_5 = _b.sent();
e_4 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_5.message
message: e_4.message
});
throw e_5;
throw e_4;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -32009,7 +31846,7 @@ var BlobServiceClient = /** @class */ (function (_super) {
BlobServiceClient.prototype.getStatistics = function (options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, e_6;
var _a, span, spanOptions, e_5;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -32023,12 +31860,12 @@ var BlobServiceClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _b.sent()];
case 3:
e_6 = _b.sent();
e_5 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_6.message
message: e_5.message
});
throw e_6;
throw e_5;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -32051,7 +31888,7 @@ var BlobServiceClient = /** @class */ (function (_super) {
BlobServiceClient.prototype.getAccountInfo = function (options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, e_7;
var _a, span, spanOptions, e_6;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -32065,12 +31902,12 @@ var BlobServiceClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _b.sent()];
case 3:
e_7 = _b.sent();
e_6 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_7.message
message: e_6.message
});
throw e_7;
throw e_6;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -32085,9 +31922,9 @@ var BlobServiceClient = /** @class */ (function (_super) {
*
* @param {string} [marker] A string value that identifies the portion of
* the list of containers to be returned with the next listing operation. The
* operation returns the continuationToken value within the response body if the
* operation returns the NextMarker value within the response body if the
* listing operation did not return all containers remaining to be listed
* with the current page. The continuationToken value can be used as the value for
* with the current page. The NextMarker value can be used as the value for
* the marker parameter in a subsequent call to request the next page of list
* items. The marker value is opaque to the client.
* @param {ServiceListContainersSegmentOptions} [options] Options to the Service List Container Segment operation.
@@ -32097,7 +31934,7 @@ var BlobServiceClient = /** @class */ (function (_super) {
BlobServiceClient.prototype.listContainersSegment = function (marker, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, e_8;
var _a, span, spanOptions, e_7;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -32108,12 +31945,12 @@ var BlobServiceClient = /** @class */ (function (_super) {
return [4 /*yield*/, this.serviceContext.listContainersSegment(tslib.__assign(tslib.__assign({ abortSignal: options.abortSignal, marker: marker }, options), { include: typeof options.include === "string" ? [options.include] : options.include, spanOptions: spanOptions }))];
case 2: return [2 /*return*/, _b.sent()];
case 3:
e_8 = _b.sent();
e_7 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_8.message
message: e_7.message
});
throw e_8;
throw e_7;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -32134,9 +31971,9 @@ var BlobServiceClient = /** @class */ (function (_super) {
* however, only a subset of the OData filter syntax is supported in the Blob service.
* @param {string} [marker] A string value that identifies the portion of
* the list of blobs to be returned with the next listing operation. The
* operation returns the continuationToken value within the response body if the
* operation returns the NextMarker value within the response body if the
* listing operation did not return all blobs remaining to be listed
* with the current page. The continuationToken value can be used as the value for
* with the current page. The NextMarker value can be used as the value for
* the marker parameter in a subsequent call to request the next page of list
* items. The marker value is opaque to the client.
* @param {ServiceFindBlobsByTagsSegmentOptions} [options={}] Options to find blobs by tags.
@@ -32146,7 +31983,7 @@ var BlobServiceClient = /** @class */ (function (_super) {
BlobServiceClient.prototype.findBlobsByTagsSegment = function (tagFilterSqlExpression, marker, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, e_9;
var _a, span, spanOptions, e_8;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -32163,12 +32000,12 @@ var BlobServiceClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _b.sent()];
case 3:
e_9 = _b.sent();
e_8 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_9.message
message: e_8.message
});
throw e_9;
throw e_8;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -32187,9 +32024,9 @@ var BlobServiceClient = /** @class */ (function (_super) {
* however, only a subset of the OData filter syntax is supported in the Blob service.
* @param {string} [marker] A string value that identifies the portion of
* the list of blobs to be returned with the next listing operation. The
* operation returns the continuationToken value within the response body if the
* operation returns the NextMarker value within the response body if the
* listing operation did not return all blobs remaining to be listed
* with the current page. The continuationToken value can be used as the value for
* with the current page. The NextMarker value can be used as the value for
* the marker parameter in a subsequent call to request the next page of list
* items. The marker value is opaque to the client.
* @param {ServiceFindBlobsByTagsSegmentOptions} [options={}] Options to find blobs by tags.
@@ -32238,8 +32075,8 @@ var BlobServiceClient = /** @class */ (function (_super) {
BlobServiceClient.prototype.findBlobsByTagsItems = function (tagFilterSqlExpression, options) {
if (options === void 0) { options = {}; }
return tslib.__asyncGenerator(this, arguments, function findBlobsByTagsItems_1() {
var marker, _a, _b, segment, e_10_1;
var e_10, _c;
var marker, _a, _b, segment, e_9_1;
var e_9, _c;
return tslib.__generator(this, function (_d) {
switch (_d.label) {
case 0:
@@ -32258,8 +32095,8 @@ var BlobServiceClient = /** @class */ (function (_super) {
case 5: return [3 /*break*/, 1];
case 6: return [3 /*break*/, 13];
case 7:
e_10_1 = _d.sent();
e_10 = { error: e_10_1 };
e_9_1 = _d.sent();
e_9 = { error: e_9_1 };
return [3 /*break*/, 13];
case 8:
_d.trys.push([8, , 11, 12]);
@@ -32270,7 +32107,7 @@ var BlobServiceClient = /** @class */ (function (_super) {
_d.label = 10;
case 10: return [3 /*break*/, 12];
case 11:
if (e_10) throw e_10.error;
if (e_9) throw e_9.error;
return [7 /*endfinally*/];
case 12: return [7 /*endfinally*/];
case 13: return [2 /*return*/];
@@ -32395,9 +32232,9 @@ var BlobServiceClient = /** @class */ (function (_super) {
* @private
* @param {string} [marker] A string value that identifies the portion of
* the list of containers to be returned with the next listing operation. The
* operation returns the continuationToken value within the response body if the
* operation returns the NextMarker value within the response body if the
* listing operation did not return all containers remaining to be listed
* with the current page. The continuationToken value can be used as the value for
* with the current page. The NextMarker value can be used as the value for
* the marker parameter in a subsequent call to request the next page of list
* items. The marker value is opaque to the client.
* @param {ServiceListContainersSegmentOptions} [options] Options to list containers operation.
@@ -32444,8 +32281,8 @@ var BlobServiceClient = /** @class */ (function (_super) {
BlobServiceClient.prototype.listItems = function (options) {
if (options === void 0) { options = {}; }
return tslib.__asyncGenerator(this, arguments, function listItems_1() {
var marker, _a, _b, segment, e_11_1;
var e_11, _c;
var marker, _a, _b, segment, e_10_1;
var e_10, _c;
return tslib.__generator(this, function (_d) {
switch (_d.label) {
case 0:
@@ -32464,8 +32301,8 @@ var BlobServiceClient = /** @class */ (function (_super) {
case 5: return [3 /*break*/, 1];
case 6: return [3 /*break*/, 13];
case 7:
e_11_1 = _d.sent();
e_11 = { error: e_11_1 };
e_10_1 = _d.sent();
e_10 = { error: e_10_1 };
return [3 /*break*/, 13];
case 8:
_d.trys.push([8, , 11, 12]);
@@ -32476,7 +32313,7 @@ var BlobServiceClient = /** @class */ (function (_super) {
_d.label = 10;
case 10: return [3 /*break*/, 12];
case 11:
if (e_11) throw e_11.error;
if (e_10) throw e_10.error;
return [7 /*endfinally*/];
case 12: return [7 /*endfinally*/];
case 13: return [2 /*return*/];
@@ -32566,15 +32403,8 @@ var BlobServiceClient = /** @class */ (function (_super) {
if (options.prefix === "") {
options.prefix = undefined;
}
var include = [];
if (options.includeDeleted) {
include.push("deleted");
}
if (options.includeMetadata) {
include.push("metadata");
}
// AsyncIterableIterator to iterate over containers
var listSegmentOptions = tslib.__assign(tslib.__assign({}, options), (include.length > 0 ? { include: include } : {}));
var listSegmentOptions = tslib.__assign(tslib.__assign({}, options), (options.includeMetadata ? { include: "metadata" } : {}));
var iter = this.listItems(listSegmentOptions);
return _a = {
/**
@@ -32615,7 +32445,7 @@ var BlobServiceClient = /** @class */ (function (_super) {
BlobServiceClient.prototype.getUserDelegationKey = function (startsOn, expiresOn, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, response, userDelegationKey, res, e_12;
var _a, span, spanOptions, response, userDelegationKey, res, e_11;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -32644,12 +32474,12 @@ var BlobServiceClient = /** @class */ (function (_super) {
res = tslib.__assign({ _response: response._response, requestId: response.requestId, clientRequestId: response.clientRequestId, version: response.version, date: response.date, errorCode: response.errorCode }, userDelegationKey);
return [2 /*return*/, res];
case 3:
e_12 = _b.sent();
e_11 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_12.message
message: e_11.message
});
throw e_12;
throw e_11;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -33105,61 +32935,52 @@ function ipRangeToString(ipRange) {
* @class SASQueryParameters
*/
var SASQueryParameters = /** @class */ (function () {
function SASQueryParameters(version, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, userDelegationKey, preauthorizedAgentObjectId, correlationId) {
/**
* Creates an instance of SASQueryParameters.
*
* @param {string} version Representing the storage version
* @param {string} signature Representing the signature for the SAS token
* @param {string} [permissions] Representing the storage permissions
* @param {string} [services] Representing the storage services being accessed (only for Account SAS)
* @param {string} [resourceTypes] Representing the storage resource types being accessed (only for Account SAS)
* @param {SASProtocol} [protocol] Representing the allowed HTTP protocol(s)
* @param {Date} [startsOn] Representing the start time for this SAS token
* @param {Date} [expiresOn] Representing the expiry time for this SAS token
* @param {SasIPRange} [ipRange] Representing the range of valid IP addresses for this SAS token
* @param {string} [identifier] Representing the signed identifier (only for Service SAS)
* @param {string} [resource] Representing the storage container or blob (only for Service SAS)
* @param {string} [cacheControl] Representing the cache-control header (only for Blob/File Service SAS)
* @param {string} [contentDisposition] Representing the content-disposition header (only for Blob/File Service SAS)
* @param {string} [contentEncoding] Representing the content-encoding header (only for Blob/File Service SAS)
* @param {string} [contentLanguage] Representing the content-language header (only for Blob/File Service SAS)
* @param {string} [contentType] Representing the content-type header (only for Blob/File Service SAS)
* @param {userDelegationKey} [userDelegationKey] Representing the user delegation key properties
* @memberof SASQueryParameters
*/
function SASQueryParameters(version, signature, permissions, services, resourceTypes, protocol, startsOn, expiresOn, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, userDelegationKey) {
this.version = version;
this.services = services;
this.resourceTypes = resourceTypes;
this.expiresOn = expiresOn;
this.permissions = permissions;
this.protocol = protocol;
this.startsOn = startsOn;
this.ipRangeInner = ipRange;
this.identifier = identifier;
this.resource = resource;
this.signature = signature;
if (permissionsOrOptions !== undefined && typeof permissionsOrOptions !== "string") {
// SASQueryParametersOptions
this.permissions = permissionsOrOptions.permissions;
this.services = permissionsOrOptions.services;
this.resourceTypes = permissionsOrOptions.resourceTypes;
this.protocol = permissionsOrOptions.protocol;
this.startsOn = permissionsOrOptions.startsOn;
this.expiresOn = permissionsOrOptions.expiresOn;
this.ipRangeInner = permissionsOrOptions.ipRange;
this.identifier = permissionsOrOptions.identifier;
this.resource = permissionsOrOptions.resource;
this.cacheControl = permissionsOrOptions.cacheControl;
this.contentDisposition = permissionsOrOptions.contentDisposition;
this.contentEncoding = permissionsOrOptions.contentEncoding;
this.contentLanguage = permissionsOrOptions.contentLanguage;
this.contentType = permissionsOrOptions.contentType;
if (permissionsOrOptions.userDelegationKey) {
this.signedOid = permissionsOrOptions.userDelegationKey.signedObjectId;
this.signedTenantId = permissionsOrOptions.userDelegationKey.signedTenantId;
this.signedStartsOn = permissionsOrOptions.userDelegationKey.signedStartsOn;
this.signedExpiresOn = permissionsOrOptions.userDelegationKey.signedExpiresOn;
this.signedService = permissionsOrOptions.userDelegationKey.signedService;
this.signedVersion = permissionsOrOptions.userDelegationKey.signedVersion;
this.preauthorizedAgentObjectId = permissionsOrOptions.preauthorizedAgentObjectId;
this.correlationId = permissionsOrOptions.correlationId;
}
}
else {
this.services = services;
this.resourceTypes = resourceTypes;
this.expiresOn = expiresOn;
this.permissions = permissionsOrOptions;
this.protocol = protocol;
this.startsOn = startsOn;
this.ipRangeInner = ipRange;
this.identifier = identifier;
this.resource = resource;
this.cacheControl = cacheControl;
this.contentDisposition = contentDisposition;
this.contentEncoding = contentEncoding;
this.contentLanguage = contentLanguage;
this.contentType = contentType;
if (userDelegationKey) {
this.signedOid = userDelegationKey.signedObjectId;
this.signedTenantId = userDelegationKey.signedTenantId;
this.signedStartsOn = userDelegationKey.signedStartsOn;
this.signedExpiresOn = userDelegationKey.signedExpiresOn;
this.signedService = userDelegationKey.signedService;
this.signedVersion = userDelegationKey.signedVersion;
this.preauthorizedAgentObjectId = preauthorizedAgentObjectId;
this.correlationId = correlationId;
}
this.cacheControl = cacheControl;
this.contentDisposition = contentDisposition;
this.contentEncoding = contentEncoding;
this.contentLanguage = contentLanguage;
this.contentType = contentType;
if (userDelegationKey) {
this.signedOid = userDelegationKey.signedObjectId;
this.signedTenantId = userDelegationKey.signedTenantId;
this.signedStartsOn = userDelegationKey.signedStartsOn;
this.signedExpiresOn = userDelegationKey.signedExpiresOn;
this.signedService = userDelegationKey.signedService;
this.signedVersion = userDelegationKey.signedVersion;
}
}
Object.defineProperty(SASQueryParameters.prototype, "ipRange", {
@@ -33211,9 +33032,7 @@ var SASQueryParameters = /** @class */ (function () {
"rscd",
"rsce",
"rscl",
"rsct",
"saoid",
"scid"
"rsct"
];
var queries = [];
for (var _i = 0, params_1 = params; _i < params_1.length; _i++) {
@@ -33285,12 +33104,6 @@ var SASQueryParameters = /** @class */ (function () {
case "rsct":
this.tryAppendQueryParameter(queries, param, this.contentType);
break;
case "saoid":
this.tryAppendQueryParameter(queries, param, this.preauthorizedAgentObjectId);
break;
case "scid":
this.tryAppendQueryParameter(queries, param, this.correlationId);
break;
}
}
return queries.join("&");
@@ -33437,20 +33250,6 @@ var BlobSASPermissions = /** @class */ (function () {
* @memberof BlobSASPermissions
*/
this.tag = false;
/**
* Specifies Move access granted.
*
* @type {boolean}
* @memberof BlobSASPermissions
*/
this.move = false;
/**
* Specifies Execute access granted.
*
* @type {boolean}
* @memberof BlobSASPermissions
*/
this.execute = false;
}
/**
* Creates a {@link BlobSASPermissions} from the specified permissions string. This method will throw an
@@ -33487,12 +33286,6 @@ var BlobSASPermissions = /** @class */ (function () {
case "t":
blobSASPermissions.tag = true;
break;
case "m":
blobSASPermissions.move = true;
break;
case "e":
blobSASPermissions.execute = true;
break;
default:
throw new RangeError("Invalid permission: " + char);
}
@@ -33529,12 +33322,6 @@ var BlobSASPermissions = /** @class */ (function () {
if (this.tag) {
permissions.push("t");
}
if (this.move) {
permissions.push("m");
}
if (this.execute) {
permissions.push("e");
}
return permissions.join("");
};
return BlobSASPermissions;
@@ -33610,20 +33397,6 @@ var ContainerSASPermissions = /** @class */ (function () {
* @memberof ContainerSASPermissions
*/
this.tag = false;
/**
* Specifies Move access granted.
*
* @type {boolean}
* @memberof ContainerSASPermissions
*/
this.move = false;
/**
* Specifies Execute access granted.
*
* @type {boolean}
* @memberof ContainerSASPermissions
*/
this.execute = false;
}
/**
* Creates an {@link ContainerSASPermissions} from the specified permissions string. This method will throw an
@@ -33663,12 +33436,6 @@ var ContainerSASPermissions = /** @class */ (function () {
case "x":
containerSASPermissions.deleteVersion = true;
break;
case "m":
containerSASPermissions.move = true;
break;
case "e":
containerSASPermissions.execute = true;
break;
default:
throw new RangeError("Invalid permission " + char);
}
@@ -33711,12 +33478,6 @@ var ContainerSASPermissions = /** @class */ (function () {
if (this.tag) {
permissions.push("t");
}
if (this.move) {
permissions.push("m");
}
if (this.execute) {
permissions.push("e");
}
return permissions.join("");
};
return ContainerSASPermissions;
@@ -33780,13 +33541,7 @@ function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredent
return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential);
}
else {
// Version 2020-02-10 delegation SAS signature construction includes preauthorizedAgentObjectId, agentObjectId, correlationId.
if (version >= "2020-02-10") {
return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential);
}
else {
return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential);
}
return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential);
}
}
if (version >= "2015-04-05") {
@@ -33817,18 +33572,34 @@ function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredent
* @returns {SASQueryParameters}
*/
function generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKeyCredential) {
blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);
if (!blobSASSignatureValues.identifier &&
!blobSASSignatureValues.permissions &&
!blobSASSignatureValues.expiresOn) {
throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.");
}
var version = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION;
var resource = "c";
var verifiedPermissions;
if (blobSASSignatureValues.snapshotTime) {
throw RangeError("'version' must be >= '2018-11-09' when provided 'snapshotTime'.");
}
if (blobSASSignatureValues.versionId) {
throw RangeError("'version' must be >= '2019-10-10' when provided 'versionId'.");
}
if (blobSASSignatureValues.permissions &&
blobSASSignatureValues.permissions.deleteVersion &&
version < "2019-10-10") {
throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission.");
}
if (blobSASSignatureValues.permissions &&
blobSASSignatureValues.permissions.tag &&
version < "2019-12-12") {
throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission.");
}
if (blobSASSignatureValues.blobName) {
resource = "b";
}
// Calling parse and toString guarantees the proper ordering and throws on invalid characters.
var verifiedPermissions;
if (blobSASSignatureValues.permissions) {
if (blobSASSignatureValues.blobName) {
verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
@@ -33850,7 +33621,7 @@ function generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKe
blobSASSignatureValues.identifier,
blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "",
blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
blobSASSignatureValues.version,
version,
blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "",
blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "",
blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "",
@@ -33858,7 +33629,7 @@ function generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKe
blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : ""
].join("\n");
var signature = sharedKeyCredential.computeHMACSHA256(stringToSign);
return new 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);
return new SASQueryParameters(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);
}
/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
@@ -33878,13 +33649,33 @@ function generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKe
* @returns {SASQueryParameters}
*/
function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential) {
blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);
if (!blobSASSignatureValues.identifier &&
!blobSASSignatureValues.permissions &&
!blobSASSignatureValues.expiresOn) {
throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.");
}
var version = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION;
var resource = "c";
var verifiedPermissions;
if (blobSASSignatureValues.versionId && version < "2019-10-10") {
throw RangeError("'version' must be >= '2019-10-10' when provided 'versionId'.");
}
if (blobSASSignatureValues.permissions &&
blobSASSignatureValues.permissions.deleteVersion &&
version < "2019-10-10") {
throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission.");
}
if (blobSASSignatureValues.permissions &&
blobSASSignatureValues.permissions.tag &&
version < "2019-12-12") {
throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission.");
}
if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.snapshotTime) {
throw RangeError("Must provide 'blobName' when provided 'snapshotTime'.");
}
if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.versionId) {
throw RangeError("Must provide 'blobName' when provided 'versionId'.");
}
var timestamp = blobSASSignatureValues.snapshotTime;
if (blobSASSignatureValues.blobName) {
resource = "b";
@@ -33897,7 +33688,6 @@ function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKe
}
}
// Calling parse and toString guarantees the proper ordering and throws on invalid characters.
var verifiedPermissions;
if (blobSASSignatureValues.permissions) {
if (blobSASSignatureValues.blobName) {
verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
@@ -33919,7 +33709,7 @@ function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKe
blobSASSignatureValues.identifier,
blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "",
blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
blobSASSignatureValues.version,
version,
resource,
timestamp,
blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "",
@@ -33929,7 +33719,7 @@ function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKe
blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : ""
].join("\n");
var signature = sharedKeyCredential.computeHMACSHA256(stringToSign);
return new 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);
return new SASQueryParameters(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);
}
/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
@@ -33938,7 +33728,7 @@ function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKe
* Creates an instance of SASQueryParameters.
*
* Only accepts required settings needed to create a SAS. For optional settings please
* set corresponding properties directly, such as permissions, startsOn.
* set corresponding properties directly, such as permissions, startsOn and identifier.
*
* WARNING: identifier will be ignored, permissions and expiresOn are required.
*
@@ -33947,12 +33737,31 @@ function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKe
* @returns {SASQueryParameters}
*/
function generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential) {
blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);
// Stored access policies are not supported for a user delegation SAS.
if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) {
throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.");
}
var version = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION;
if (blobSASSignatureValues.versionId && version < "2019-10-10") {
throw RangeError("'version' must be >= '2019-10-10' when provided 'versionId'.");
}
if (blobSASSignatureValues.permissions &&
blobSASSignatureValues.permissions.deleteVersion &&
version < "2019-10-10") {
throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission.");
}
if (blobSASSignatureValues.permissions &&
blobSASSignatureValues.permissions.tag &&
version < "2019-12-12") {
throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission.");
}
var resource = "c";
var verifiedPermissions;
if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.snapshotTime) {
throw RangeError("Must provide 'blobName' when provided 'snapshotTime'.");
}
if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.versionId) {
throw RangeError("Must provide 'blobName' when provided 'versionId'.");
}
var timestamp = blobSASSignatureValues.snapshotTime;
if (blobSASSignatureValues.blobName) {
resource = "b";
@@ -33965,7 +33774,6 @@ function generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userD
}
}
// Calling parse and toString guarantees the proper ordering and throws on invalid characters.
var verifiedPermissions;
if (blobSASSignatureValues.permissions) {
if (blobSASSignatureValues.blobName) {
verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
@@ -33996,7 +33804,7 @@ function generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userD
userDelegationKeyCredential.userDelegationKey.signedVersion,
blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "",
blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
blobSASSignatureValues.version,
version,
resource,
timestamp,
blobSASSignatureValues.cacheControl,
@@ -34006,87 +33814,7 @@ function generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userD
blobSASSignatureValues.contentType
].join("\n");
var signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign);
return new 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);
}
/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
* IMPLEMENTATION FOR API VERSION FROM 2020-02-10.
*
* Creates an instance of SASQueryParameters.
*
* Only accepts required settings needed to create a SAS. For optional settings please
* set corresponding properties directly, such as permissions, startsOn.
*
* WARNING: identifier will be ignored, permissions and expiresOn are required.
*
* @param {BlobSASSignatureValues} blobSASSignatureValues
* @param {UserDelegationKeyCredential} userDelegationKeyCredential
* @returns {SASQueryParameters}
*/
function generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential) {
blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);
// Stored access policies are not supported for a user delegation SAS.
if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) {
throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.");
}
var resource = "c";
var timestamp = blobSASSignatureValues.snapshotTime;
if (blobSASSignatureValues.blobName) {
resource = "b";
if (blobSASSignatureValues.snapshotTime) {
resource = "bs";
}
else if (blobSASSignatureValues.versionId) {
resource = "bv";
timestamp = blobSASSignatureValues.versionId;
}
}
// Calling parse and toString guarantees the proper ordering and throws on invalid characters.
var verifiedPermissions;
if (blobSASSignatureValues.permissions) {
if (blobSASSignatureValues.blobName) {
verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
}
else {
verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
}
}
// Signature is generated on the un-url-encoded values.
var stringToSign = [
verifiedPermissions ? verifiedPermissions : "",
blobSASSignatureValues.startsOn
? truncatedISO8061Date(blobSASSignatureValues.startsOn, false)
: "",
blobSASSignatureValues.expiresOn
? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)
: "",
getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),
userDelegationKeyCredential.userDelegationKey.signedObjectId,
userDelegationKeyCredential.userDelegationKey.signedTenantId,
userDelegationKeyCredential.userDelegationKey.signedStartsOn
? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false)
: "",
userDelegationKeyCredential.userDelegationKey.signedExpiresOn
? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false)
: "",
userDelegationKeyCredential.userDelegationKey.signedService,
userDelegationKeyCredential.userDelegationKey.signedVersion,
blobSASSignatureValues.preauthorizedAgentObjectId,
undefined,
blobSASSignatureValues.correlationId,
blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "",
blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
blobSASSignatureValues.version,
resource,
timestamp,
blobSASSignatureValues.cacheControl,
blobSASSignatureValues.contentDisposition,
blobSASSignatureValues.contentEncoding,
blobSASSignatureValues.contentLanguage,
blobSASSignatureValues.contentType
].join("\n");
var signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign);
return new 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);
return new SASQueryParameters(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);
}
function getCanonicalName(accountName, containerName, blobName) {
// Container: "/blob/account/containerName"
@@ -34097,42 +33825,6 @@ function getCanonicalName(accountName, containerName, blobName) {
}
return elements.join("");
}
function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) {
var version = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION;
if (blobSASSignatureValues.snapshotTime && version < "2018-11-09") {
throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'.");
}
if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.snapshotTime) {
throw RangeError("Must provide 'blobName' when providing 'snapshotTime'.");
}
if (blobSASSignatureValues.versionId && version < "2019-10-10") {
throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'.");
}
if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.versionId) {
throw RangeError("Must provide 'blobName' when providing 'versionId'.");
}
if (blobSASSignatureValues.permissions &&
blobSASSignatureValues.permissions.deleteVersion &&
version < "2019-10-10") {
throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission.");
}
if (blobSASSignatureValues.permissions &&
blobSASSignatureValues.permissions.tag &&
version < "2019-12-12") {
throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission.");
}
if (version < "2020-02-10" &&
blobSASSignatureValues.permissions &&
(blobSASSignatureValues.permissions.move || blobSASSignatureValues.permissions.execute)) {
throw RangeError("'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission.");
}
if (version < "2020-02-10" &&
(blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) {
throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'.");
}
blobSASSignatureValues.version = version;
return blobSASSignatureValues;
}
Object.defineProperty(exports, 'BaseRequestPolicy', {
enumerable: true,
@@ -34219,20 +33911,10 @@ exports.newPipeline = newPipeline;
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const path = __importStar(__webpack_require__(622));
const pathHelper = __importStar(__webpack_require__(972));
const assert_1 = __importDefault(__webpack_require__(357));
const assert = __webpack_require__(357);
const path = __webpack_require__(622);
const pathHelper = __webpack_require__(972);
const IS_WINDOWS = process.platform === 'win32';
/**
* Helper class for parsing paths into segments
@@ -34246,7 +33928,7 @@ class Path {
this.segments = [];
// String
if (typeof itemPath === 'string') {
assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`);
assert(itemPath, `Parameter 'itemPath' must not be empty`);
// Normalize slashes and trim unnecessary trailing slash
itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);
// Not rooted
@@ -34273,24 +33955,24 @@ class Path {
// Array
else {
// Must not be empty
assert_1.default(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`);
assert(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`);
// Each segment
for (let i = 0; i < itemPath.length; i++) {
let segment = itemPath[i];
// Must not be empty
assert_1.default(segment, `Parameter 'itemPath' must not contain any empty segments`);
assert(segment, `Parameter 'itemPath' must not contain any empty segments`);
// Normalize slashes
segment = pathHelper.normalizeSeparators(itemPath[i]);
// Root segment
if (i === 0 && pathHelper.hasRoot(segment)) {
segment = pathHelper.safeTrimTrailingSeparator(segment);
assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`);
assert(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`);
this.segments.push(segment);
}
// All other segments
else {
// Must not contain slash
assert_1.default(!segment.includes(path.sep), `Parameter 'itemPath' contains unexpected path separators`);
assert(!segment.includes(path.sep), `Parameter 'itemPath' contains unexpected path separators`);
this.segments.push(segment);
}
}
@@ -36839,7 +36521,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
};
Object.defineProperty(exports, "__esModule", { value: true });
const os = __importStar(__webpack_require__(87));
const utils_1 = __webpack_require__(82);
/**
* Commands
*
@@ -36893,14 +36574,28 @@ class Command {
return cmdStr;
}
}
/**
* Sanitizes an input into a string so it can be passed into issueCommand safely
* @param input input to sanitize into a string
*/
function toCommandValue(input) {
if (input === null || input === undefined) {
return '';
}
else if (typeof input === 'string' || input instanceof String) {
return input;
}
return JSON.stringify(input);
}
exports.toCommandValue = toCommandValue;
function escapeData(s) {
return utils_1.toCommandValue(s)
return toCommandValue(s)
.replace(/%/g, '%25')
.replace(/\r/g, '%0D')
.replace(/\n/g, '%0A');
}
function escapeProperty(s) {
return utils_1.toCommandValue(s)
return toCommandValue(s)
.replace(/%/g, '%25')
.replace(/\r/g, '%0D')
.replace(/\n/g, '%0A')
@@ -39272,8 +38967,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
};
Object.defineProperty(exports, "__esModule", { value: true });
const command_1 = __webpack_require__(431);
const file_command_1 = __webpack_require__(102);
const utils_1 = __webpack_require__(82);
const os = __importStar(__webpack_require__(87));
const path = __importStar(__webpack_require__(622));
/**
@@ -39300,17 +38993,9 @@ var ExitCode;
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function exportVariable(name, val) {
const convertedVal = utils_1.toCommandValue(val);
const convertedVal = command_1.toCommandValue(val);
process.env[name] = convertedVal;
const filePath = process.env['GITHUB_ENV'] || '';
if (filePath) {
const delimiter = '_GitHubActionsFileCommandDelimeter_';
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
file_command_1.issueCommand('ENV', commandValue);
}
else {
command_1.issueCommand('set-env', { name }, convertedVal);
}
command_1.issueCommand('set-env', { name }, convertedVal);
}
exports.exportVariable = exportVariable;
/**
@@ -39326,13 +39011,7 @@ exports.setSecret = setSecret;
* @param inputPath
*/
function addPath(inputPath) {
const filePath = process.env['GITHUB_PATH'] || '';
if (filePath) {
file_command_1.issueCommand('PATH', inputPath);
}
else {
command_1.issueCommand('add-path', {}, inputPath);
}
command_1.issueCommand('add-path', {}, inputPath);
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
}
exports.addPath = addPath;
@@ -41464,15 +41143,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const pathHelper = __importStar(__webpack_require__(972));
const pathHelper = __webpack_require__(972);
const internal_match_kind_1 = __webpack_require__(327);
const IS_WINDOWS = process.platform === 'win32';
/**
@@ -41554,15 +41226,8 @@ exports.partialMatch = partialMatch;
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(__webpack_require__(470));
const core = __webpack_require__(470);
/**
* Returns a copy with defaults filled in.
*/
@@ -45710,7 +45375,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(__webpack_require__(145), exports);
__exportStar(__webpack_require__(102), exports);
//# sourceMappingURL=index.js.map
/***/ }),
@@ -49894,27 +49559,17 @@ __exportStar(__webpack_require__(764), exports);
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const os = __importStar(__webpack_require__(87));
const path = __importStar(__webpack_require__(622));
const pathHelper = __importStar(__webpack_require__(972));
const assert_1 = __importDefault(__webpack_require__(357));
const assert = __webpack_require__(357);
const os = __webpack_require__(87);
const path = __webpack_require__(622);
const pathHelper = __webpack_require__(972);
const minimatch_1 = __webpack_require__(93);
const internal_match_kind_1 = __webpack_require__(327);
const internal_path_1 = __webpack_require__(383);
const IS_WINDOWS = process.platform === 'win32';
class Pattern {
constructor(patternOrNegate, segments, homedir) {
constructor(patternOrNegate, segments) {
/**
* Indicates whether matches should be excluded from the result set
*/
@@ -49928,9 +49583,9 @@ class Pattern {
else {
// Convert to pattern
segments = segments || [];
assert_1.default(segments.length, `Parameter 'segments' must not empty`);
assert(segments.length, `Parameter 'segments' must not empty`);
const root = Pattern.getLiteral(segments[0]);
assert_1.default(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`);
assert(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`);
pattern = new internal_path_1.Path(segments).toString().trim();
if (patternOrNegate) {
pattern = `!${pattern}`;
@@ -49942,7 +49597,7 @@ class Pattern {
pattern = pattern.substr(1).trim();
}
// Normalize slashes and ensures absolute root
pattern = Pattern.fixupPattern(pattern, homedir);
pattern = Pattern.fixupPattern(pattern);
// Segments
this.segments = new internal_path_1.Path(pattern).segments;
// Trailing slash indicates the pattern should only match directories, not regular files
@@ -49979,11 +49634,11 @@ class Pattern {
// Normalize slashes
itemPath = pathHelper.normalizeSeparators(itemPath);
// Append a trailing slash. Otherwise Minimatch will not match the directory immediately
// preceding the globstar. For example, given the pattern `/foo/**`, Minimatch returns
// preceeding the globstar. For example, given the pattern `/foo/**`, Minimatch returns
// false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk.
if (!itemPath.endsWith(path.sep)) {
// Note, this is safe because the constructor ensures the pattern has an absolute root.
// For example, formats like C: and C:foo on Windows are resolved to an absolute root.
// For example, formats like C: and C:foo on Windows are resolved to an aboslute root.
itemPath = `${itemPath}${path.sep}`;
}
}
@@ -50021,15 +49676,15 @@ class Pattern {
/**
* Normalizes slashes and ensures absolute root
*/
static fixupPattern(pattern, homedir) {
static fixupPattern(pattern) {
// Empty
assert_1.default(pattern, 'pattern cannot be empty');
assert(pattern, 'pattern cannot be empty');
// Must not contain `.` segment, unless first segment
// Must not contain `..` segment
const literalSegments = new internal_path_1.Path(pattern).segments.map(x => Pattern.getLiteral(x));
assert_1.default(literalSegments.every((x, i) => (x !== '.' || i === 0) && x !== '..'), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`);
assert(literalSegments.every((x, i) => (x !== '.' || i === 0) && x !== '..'), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`);
// Must not contain globs in root, e.g. Windows UNC path \\foo\b*r
assert_1.default(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`);
assert(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`);
// Normalize slashes
pattern = pathHelper.normalizeSeparators(pattern);
// Replace leading `.` segment
@@ -50038,9 +49693,9 @@ class Pattern {
}
// Replace leading `~` segment
else if (pattern === '~' || pattern.startsWith(`~${path.sep}`)) {
homedir = homedir || os.homedir();
assert_1.default(homedir, 'Unable to determine HOME directory');
assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`);
const homedir = os.homedir();
assert(homedir, 'Unable to determine HOME directory');
assert(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`);
pattern = Pattern.globEscape(homedir) + pattern.substr(1);
}
// Replace relative drive root, e.g. pattern is C: or C:foo
@@ -50829,19 +50484,9 @@ exports.checkBypass = checkBypass;
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const path = __importStar(__webpack_require__(622));
const assert_1 = __importDefault(__webpack_require__(357));
const assert = __webpack_require__(357);
const path = __webpack_require__(622);
const IS_WINDOWS = process.platform === 'win32';
/**
* Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths.
@@ -50881,8 +50526,8 @@ exports.dirname = dirname;
* or `C:` are expanded based on the current working directory.
*/
function ensureAbsoluteRoot(root, itemPath) {
assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`);
assert_1.default(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`);
assert(root, `ensureAbsoluteRoot parameter 'root' must not be empty`);
assert(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`);
// Already rooted
if (hasAbsoluteRoot(itemPath)) {
return itemPath;
@@ -50892,7 +50537,7 @@ function ensureAbsoluteRoot(root, itemPath) {
// Check for itemPath like C: or C:foo
if (itemPath.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)) {
let cwd = process.cwd();
assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);
assert(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);
// Drive letter matches cwd? Expand to cwd
if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) {
// Drive only, e.g. C:
@@ -50917,11 +50562,11 @@ function ensureAbsoluteRoot(root, itemPath) {
// Check for itemPath like \ or \foo
else if (normalizeSeparators(itemPath).match(/^\\$|^\\[^\\]/)) {
const cwd = process.cwd();
assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);
assert(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);
return `${cwd[0]}:\\${itemPath.substr(1)}`;
}
}
assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`);
assert(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`);
// Otherwise ensure root ends with a separator
if (root.endsWith('/') || (IS_WINDOWS && root.endsWith('\\'))) {
// Intentionally empty
@@ -50938,7 +50583,7 @@ exports.ensureAbsoluteRoot = ensureAbsoluteRoot;
* `\\hello\share` and `C:\hello` (and using alternate separator).
*/
function hasAbsoluteRoot(itemPath) {
assert_1.default(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`);
assert(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`);
// Normalize separators
itemPath = normalizeSeparators(itemPath);
// Windows
@@ -50955,7 +50600,7 @@ exports.hasAbsoluteRoot = hasAbsoluteRoot;
* `\`, `\hello`, `\\hello\share`, `C:`, and `C:\hello` (and using alternate separator).
*/
function hasRoot(itemPath) {
assert_1.default(itemPath, `isRooted parameter 'itemPath' must not be empty`);
assert(itemPath, `isRooted parameter 'itemPath' must not be empty`);
// Normalize separators
itemPath = normalizeSeparators(itemPath);
// Windows
@@ -51236,7 +50881,6 @@ var node_fetch = _interopDefault(__webpack_require__(454));
var abortController = __webpack_require__(106);
var FormData = _interopDefault(__webpack_require__(790));
var util = __webpack_require__(669);
var url = __webpack_require__(835);
var stream = __webpack_require__(794);
var tunnel = __webpack_require__(413);
var coreAuth = __webpack_require__(229);
@@ -51420,7 +51064,7 @@ var Constants = {
* @const
* @type {string}
*/
coreHttpVersion: "1.2.1",
coreHttpVersion: "1.1.9",
/**
* Specifies HTTP.
*
@@ -51514,17 +51158,6 @@ var Constants = {
}
};
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
/**
* Default key used to access the XML attributes.
*/
var XML_ATTRKEY = "$";
/**
* Default key used to access the XML value content.
*/
var XML_CHARKEY = "_";
// Copyright (c) Microsoft Corporation.
var validUuidRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/i;
/**
@@ -51672,9 +51305,7 @@ function prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) {
if (!xmlNamespaceKey || !xmlNamespace) {
return _a = {}, _a[elementName] = obj, _a;
}
var result = (_b = {}, _b[elementName] = obj, _b);
result[XML_ATTRKEY] = (_c = {}, _c[xmlNamespaceKey] = xmlNamespace, _c);
return result;
return _b = {}, _b[elementName] = obj, _b.$ = (_c = {}, _c[xmlNamespaceKey] = xmlNamespace, _c), _b;
}
/**
* Applies the properties on the prototype of sourceCtors to the prototype of targetCtor
@@ -51787,18 +51418,9 @@ var Serializer = /** @class */ (function () {
*
* @param {string} objectName Name of the serialized object
*
* @param {options} options additional options to deserialization
*
* @returns {object|string|Array|number|boolean|Date|stream} A valid serialized Javascript object
*/
Serializer.prototype.serialize = function (mapper, object, objectName, options) {
var _a, _b, _c;
if (options === void 0) { options = {}; }
var updatedOptions = {
rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "",
includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false,
xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY
};
Serializer.prototype.serialize = function (mapper, object, objectName) {
var payload = {};
var mapperType = mapper.type.name;
if (!objectName) {
@@ -51855,13 +51477,13 @@ var Serializer = /** @class */ (function () {
payload = serializeBase64UrlType(objectName, object);
}
else if (mapperType.match(/^Sequence$/i) !== null) {
payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions);
payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML));
}
else if (mapperType.match(/^Dictionary$/i) !== null) {
payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions);
payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML));
}
else if (mapperType.match(/^Composite$/i) !== null) {
payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions);
payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML));
}
}
return payload;
@@ -51875,18 +51497,9 @@ var Serializer = /** @class */ (function () {
*
* @param {string} objectName Name of the deserialized object
*
* @param options Controls behavior of XML parser and builder.
*
* @returns {object|string|Array|number|boolean|Date|stream} A valid deserialized Javascript object
*/
Serializer.prototype.deserialize = function (mapper, responseBody, objectName, options) {
var _a, _b, _c;
if (options === void 0) { options = {}; }
var updatedOptions = {
rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "",
includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false,
xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY
};
Serializer.prototype.deserialize = function (mapper, responseBody, objectName) {
if (responseBody == undefined) {
if (this.isXML && mapper.type.name === "Sequence" && !mapper.xmlIsWrapped) {
// Edge case for empty XML non-wrapped lists. xml2js can't distinguish
@@ -51906,18 +51519,17 @@ var Serializer = /** @class */ (function () {
objectName = mapper.serializedName;
}
if (mapperType.match(/^Composite$/i) !== null) {
payload = deserializeCompositeType(this, mapper, responseBody, objectName, updatedOptions);
payload = deserializeCompositeType(this, mapper, responseBody, objectName);
}
else {
if (this.isXML) {
var xmlCharKey = updatedOptions.xmlCharKey;
/**
* If the mapper specifies this as a non-composite type value but the responseBody contains
* both header ("$" i.e., XML_ATTRKEY) and body ("#" i.e., XML_CHARKEY) properties,
* then just reduce the responseBody value to the body ("#" i.e., XML_CHARKEY) property.
* both header ("$") and body ("_") properties, then just reduce the responseBody value to
* the body ("_") property.
*/
if (responseBody[XML_ATTRKEY] != undefined && responseBody[xmlCharKey] != undefined) {
responseBody = responseBody[xmlCharKey];
if (responseBody["$"] != undefined && responseBody["_"] != undefined) {
responseBody = responseBody["_"];
}
}
if (mapperType.match(/^Number$/i) !== null) {
@@ -51953,10 +51565,10 @@ var Serializer = /** @class */ (function () {
payload = base64UrlToByteArray(responseBody);
}
else if (mapperType.match(/^Sequence$/i) !== null) {
payload = deserializeSequenceType(this, mapper, responseBody, objectName, updatedOptions);
payload = deserializeSequenceType(this, mapper, responseBody, objectName);
}
else if (mapperType.match(/^Dictionary$/i) !== null) {
payload = deserializeDictionaryType(this, mapper, responseBody, objectName, updatedOptions);
payload = deserializeDictionaryType(this, mapper, responseBody, objectName);
}
}
if (mapper.isConstant) {
@@ -52061,7 +51673,7 @@ function serializeBasicTypes(typeName, objectName, value) {
objectType !== "function" &&
!(value instanceof ArrayBuffer) &&
!ArrayBuffer.isView(value) &&
!((typeof Blob === "function" || typeof Blob === "object") && value instanceof Blob)) {
!(typeof Blob === "function" && value instanceof Blob)) {
throw new Error(objectName + " must be a string, Blob, ArrayBuffer, ArrayBufferView, or a function returning NodeJS.ReadableStream.");
}
}
@@ -52145,7 +51757,7 @@ function serializeDateTypes(typeName, value, objectName) {
}
return value;
}
function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) {
function serializeSequenceType(serializer, mapper, object, objectName, isXml) {
var _a, _b;
if (!Array.isArray(object)) {
throw new Error(objectName + " must be of type Array.");
@@ -52157,19 +51769,16 @@ function serializeSequenceType(serializer, mapper, object, objectName, isXml, op
}
var tempArray = [];
for (var i = 0; i < object.length; i++) {
var serializedValue = serializer.serialize(elementType, object[i], objectName, options);
var serializedValue = serializer.serialize(elementType, object[i], objectName);
if (isXml && elementType.xmlNamespace) {
var xmlnsKey = elementType.xmlNamespacePrefix
? "xmlns:" + elementType.xmlNamespacePrefix
: "xmlns";
if (elementType.type.name === "Composite") {
tempArray[i] = tslib.__assign({}, serializedValue);
tempArray[i][XML_ATTRKEY] = (_a = {}, _a[xmlnsKey] = elementType.xmlNamespace, _a);
tempArray[i] = tslib.__assign(tslib.__assign({}, serializedValue), { $: (_a = {}, _a[xmlnsKey] = elementType.xmlNamespace, _a) });
}
else {
tempArray[i] = {};
tempArray[i][options.xmlCharKey] = serializedValue;
tempArray[i][XML_ATTRKEY] = (_b = {}, _b[xmlnsKey] = elementType.xmlNamespace, _b);
tempArray[i] = { _: serializedValue, $: (_b = {}, _b[xmlnsKey] = elementType.xmlNamespace, _b) };
}
}
else {
@@ -52178,7 +51787,7 @@ function serializeSequenceType(serializer, mapper, object, objectName, isXml, op
}
return tempArray;
}
function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) {
function serializeDictionaryType(serializer, mapper, object, objectName, isXml) {
var _a;
if (typeof object !== "object") {
throw new Error(objectName + " must be of type object.");
@@ -52191,16 +51800,14 @@ function serializeDictionaryType(serializer, mapper, object, objectName, isXml,
var tempDictionary = {};
for (var _i = 0, _b = Object.keys(object); _i < _b.length; _i++) {
var key = _b[_i];
var serializedValue = serializer.serialize(valueType, object[key], objectName, options);
var serializedValue = serializer.serialize(valueType, object[key], objectName);
// If the element needs an XML namespace we need to add it within the $ property
tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options);
tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml);
}
// Add the namespace to the root element if needed
if (isXml && mapper.xmlNamespace) {
var xmlnsKey = mapper.xmlNamespacePrefix ? "xmlns:" + mapper.xmlNamespacePrefix : "xmlns";
var result = tempDictionary;
result[XML_ATTRKEY] = (_a = {}, _a[xmlnsKey] = mapper.xmlNamespace, _a);
return result;
return tslib.__assign(tslib.__assign({}, tempDictionary), { $: (_a = {}, _a[xmlnsKey] = mapper.xmlNamespace, _a) });
}
return tempDictionary;
}
@@ -52251,7 +51858,7 @@ function resolveModelProperties(serializer, mapper, objectName) {
}
return modelProps;
}
function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) {
function serializeCompositeType(serializer, mapper, object, objectName, isXml) {
var _a, _b;
if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) {
mapper = getPolymorphicMapper(serializer, mapper, object, "clientName");
@@ -52293,7 +51900,7 @@ function serializeCompositeType(serializer, mapper, object, objectName, isXml, o
var xmlnsKey = mapper.xmlNamespacePrefix
? "xmlns:" + mapper.xmlNamespacePrefix
: "xmlns";
parentObject[XML_ATTRKEY] = tslib.__assign(tslib.__assign({}, parentObject[XML_ATTRKEY]), (_a = {}, _a[xmlnsKey] = mapper.xmlNamespace, _a));
parentObject.$ = tslib.__assign(tslib.__assign({}, parentObject.$), (_a = {}, _a[xmlnsKey] = mapper.xmlNamespace, _a));
}
var propertyObjectName = propertyMapper.serializedName !== ""
? objectName + "." + propertyMapper.serializedName
@@ -52305,15 +51912,15 @@ function serializeCompositeType(serializer, mapper, object, objectName, isXml, o
toSerialize == undefined) {
toSerialize = mapper.serializedName;
}
var serializedValue = serializer.serialize(propertyMapper, toSerialize, propertyObjectName, options);
var serializedValue = serializer.serialize(propertyMapper, toSerialize, propertyObjectName);
if (serializedValue !== undefined && propName != undefined) {
var value = getXmlObjectValue(propertyMapper, serializedValue, isXml, options);
var value = getXmlObjectValue(propertyMapper, serializedValue, isXml);
if (isXml && propertyMapper.xmlIsAttribute) {
// XML_ATTRKEY, i.e., $ is the key attributes are kept under in xml2js.
// $ is the key attributes are kept under in xml2js.
// This keeps things simple while preventing name collision
// with names in user documents.
parentObject[XML_ATTRKEY] = parentObject[XML_ATTRKEY] || {};
parentObject[XML_ATTRKEY][propName] = serializedValue;
parentObject.$ = parentObject.$ || {};
parentObject.$[propName] = serializedValue;
}
else if (isXml && propertyMapper.xmlIsWrapped) {
parentObject[propName] = (_b = {}, _b[propertyMapper.xmlElementName] = value, _b);
@@ -52330,7 +51937,7 @@ function serializeCompositeType(serializer, mapper, object, objectName, isXml, o
var _loop_1 = function (clientPropName) {
var isAdditionalProperty = propNames.every(function (pn) { return pn !== clientPropName; });
if (isAdditionalProperty) {
payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options);
payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]');
}
};
for (var clientPropName in object) {
@@ -52341,7 +51948,7 @@ function serializeCompositeType(serializer, mapper, object, objectName, isXml, o
}
return object;
}
function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) {
function getXmlObjectValue(propertyMapper, serializedValue, isXml) {
var _a;
if (!isXml || !propertyMapper.xmlNamespace) {
return serializedValue;
@@ -52351,24 +51958,14 @@ function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) {
: "xmlns";
var xmlNamespace = (_a = {}, _a[xmlnsKey] = propertyMapper.xmlNamespace, _a);
if (["Composite"].includes(propertyMapper.type.name)) {
if (serializedValue[XML_ATTRKEY]) {
return serializedValue;
}
else {
var result_1 = tslib.__assign({}, serializedValue);
result_1[XML_ATTRKEY] = xmlNamespace;
return result_1;
}
return tslib.__assign({ $: xmlNamespace }, serializedValue);
}
var result = {};
result[options.xmlCharKey] = serializedValue;
result[XML_ATTRKEY] = xmlNamespace;
return result;
return { _: serializedValue, $: xmlNamespace };
}
function isSpecialXmlProperty(propertyName, options) {
return [XML_ATTRKEY, options.xmlCharKey].includes(propertyName);
function isSpecialXmlProperty(propertyName) {
return ["$", "_"].includes(propertyName);
}
function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) {
function deserializeCompositeType(serializer, mapper, responseBody, objectName) {
var _a;
if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) {
mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName");
@@ -52392,15 +51989,15 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName,
for (var _c = 0, _d = Object.keys(responseBody); _c < _d.length; _c++) {
var headerKey = _d[_c];
if (headerKey.startsWith(headerCollectionPrefix)) {
dictionary[headerKey.substring(headerCollectionPrefix.length)] = serializer.deserialize(propertyMapper.type.value, responseBody[headerKey], propertyObjectName, options);
dictionary[headerKey.substring(headerCollectionPrefix.length)] = serializer.deserialize(propertyMapper.type.value, responseBody[headerKey], propertyObjectName);
}
handledPropertyNames.push(headerKey);
}
instance[key] = dictionary;
}
else if (serializer.isXML) {
if (propertyMapper.xmlIsAttribute && responseBody[XML_ATTRKEY]) {
instance[key] = serializer.deserialize(propertyMapper, responseBody[XML_ATTRKEY][xmlName], propertyObjectName, options);
if (propertyMapper.xmlIsAttribute && responseBody.$) {
instance[key] = serializer.deserialize(propertyMapper, responseBody.$[xmlName], propertyObjectName);
}
else {
var propertyName = xmlElementName || xmlName || serializedName;
@@ -52421,11 +52018,11 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName,
*/
var wrapped = responseBody[xmlName];
var elementList = (_a = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _a !== void 0 ? _a : [];
instance[key] = serializer.deserialize(propertyMapper, elementList, propertyObjectName, options);
instance[key] = serializer.deserialize(propertyMapper, elementList, propertyObjectName);
}
else {
var property = responseBody[propertyName];
instance[key] = serializer.deserialize(propertyMapper, property, propertyObjectName, options);
instance[key] = serializer.deserialize(propertyMapper, property, propertyObjectName);
}
}
}
@@ -52460,10 +52057,10 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName,
// paging
if (Array.isArray(responseBody[key]) && modelProps[key].serializedName === "") {
propertyInstance = responseBody[key];
instance = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options);
instance = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName);
}
else if (propertyInstance !== undefined || propertyMapper.defaultValue !== undefined) {
serializedValue = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options);
serializedValue = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName);
instance[key] = serializedValue;
}
}
@@ -52481,7 +52078,7 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName,
};
for (var responsePropName in responseBody) {
if (isAdditionalProperty(responsePropName)) {
instance[responsePropName] = serializer.deserialize(additionalPropertiesMapper, responseBody[responsePropName], objectName + '["' + responsePropName + '"]', options);
instance[responsePropName] = serializer.deserialize(additionalPropertiesMapper, responseBody[responsePropName], objectName + '["' + responsePropName + '"]');
}
}
}
@@ -52490,14 +52087,14 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName,
var key = _g[_f];
if (instance[key] === undefined &&
!handledPropertyNames.includes(key) &&
!isSpecialXmlProperty(key, options)) {
!isSpecialXmlProperty(key)) {
instance[key] = responseBody[key];
}
}
}
return instance;
}
function deserializeDictionaryType(serializer, mapper, responseBody, objectName, options) {
function deserializeDictionaryType(serializer, mapper, responseBody, objectName) {
var value = mapper.type.value;
if (!value || typeof value !== "object") {
throw new Error("\"value\" metadata for a Dictionary must be defined in the " +
@@ -52507,13 +52104,13 @@ function deserializeDictionaryType(serializer, mapper, responseBody, objectName,
var tempDictionary = {};
for (var _i = 0, _a = Object.keys(responseBody); _i < _a.length; _i++) {
var key = _a[_i];
tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options);
tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName);
}
return tempDictionary;
}
return responseBody;
}
function deserializeSequenceType(serializer, mapper, responseBody, objectName, options) {
function deserializeSequenceType(serializer, mapper, responseBody, objectName) {
var element = mapper.type.element;
if (!element || typeof element !== "object") {
throw new Error("element\" metadata for an Array must be defined in the " +
@@ -52526,7 +52123,7 @@ function deserializeSequenceType(serializer, mapper, responseBody, objectName, o
}
var tempArray = [];
for (var i = 0; i < responseBody.length; i++) {
tempArray[i] = serializer.deserialize(element, responseBody[i], objectName + "[" + i + "]", options);
tempArray[i] = serializer.deserialize(element, responseBody[i], objectName + "[" + i + "]");
}
return tempArray;
}
@@ -52827,7 +52424,7 @@ var WebResource = /** @class */ (function () {
if (!this.headers.get("Content-Type")) {
this.headers.set("Content-Type", "application/json; charset=utf-8");
}
// set the request body. request.js automatically sets the Content-Length request header, so we need not set it explicitly
// set the request body. request.js automatically sets the Content-Length request header, so we need not set it explicilty
this.body = options.body;
if (options.body !== undefined && options.body !== null) {
// body as a stream special case. set the body as-is and check for some special request headers specific to sending a stream.
@@ -53686,9 +53283,8 @@ var FetchHttpClient = /** @class */ (function () {
if (typeof value === "function") {
value = value();
}
if (value &&
Object.prototype.hasOwnProperty.call(value, "value") &&
Object.prototype.hasOwnProperty.call(value, "options")) {
// eslint-disable-next-line no-prototype-builtins
if (value && value.hasOwnProperty("value") && value.hasOwnProperty("options")) {
requestForm_1.append(key, value.value, value.options);
}
else {
@@ -53739,7 +53335,7 @@ var FetchHttpClient = /** @class */ (function () {
return [4 /*yield*/, this.prepareRequest(httpRequest)];
case 1:
platformSpecificRequestInit = _d.sent();
requestInit = tslib.__assign({ body: body, headers: httpRequest.headers.rawHeaders(), method: httpRequest.method, signal: abortController$1.signal, redirect: "manual" }, platformSpecificRequestInit);
requestInit = tslib.__assign({ body: body, headers: httpRequest.headers.rawHeaders(), method: httpRequest.method, signal: abortController$1.signal }, platformSpecificRequestInit);
_d.label = 2;
case 2:
_d.trys.push([2, 8, 9, 10]);
@@ -54219,12 +53815,13 @@ var xml2jsDefaultOptionsV2 = {
trim: false,
normalize: false,
normalizeTags: false,
attrkey: XML_ATTRKEY,
attrkey: "$",
charkey: "_",
explicitArray: true,
ignoreAttrs: false,
mergeAttrs: false,
explicitRoot: true,
validator: undefined,
validator: null,
xmlns: false,
explicitChildren: false,
preserveChildrenOrder: false,
@@ -54233,17 +53830,17 @@ var xml2jsDefaultOptionsV2 = {
includeWhiteChars: false,
async: false,
strict: true,
attrNameProcessors: undefined,
attrValueProcessors: undefined,
tagNameProcessors: undefined,
valueProcessors: undefined,
attrNameProcessors: null,
attrValueProcessors: null,
tagNameProcessors: null,
valueProcessors: null,
rootName: "root",
xmldec: {
version: "1.0",
encoding: "UTF-8",
standalone: true
},
doctype: undefined,
doctype: null,
renderOpts: {
pretty: true,
indent: " ",
@@ -54270,10 +53867,7 @@ xml2jsBuilderSettings.renderOpts = {
* `rootName` indicates the name of the root element in the resulting XML
*/
function stringifyXML(obj, opts) {
var _a;
if (opts === void 0) { opts = {}; }
xml2jsBuilderSettings.rootName = opts.rootName;
xml2jsBuilderSettings.charkey = (_a = opts.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY;
xml2jsBuilderSettings.rootName = (opts || {}).rootName;
var builder = new xml2js.Builder(xml2jsBuilderSettings);
return builder.buildObject(obj);
}
@@ -54284,10 +53878,7 @@ function stringifyXML(obj, opts) {
* `includeRoot` indicates whether the root element is to be included or not in the output
*/
function parseXML(str, opts) {
var _a;
if (opts === void 0) { opts = {}; }
xml2jsParserSettings.explicitRoot = !!opts.includeRoot;
xml2jsParserSettings.charkey = (_a = opts.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY;
xml2jsParserSettings.explicitRoot = !!(opts && opts.includeRoot);
var xmlParser = new xml2js.Parser(xml2jsParserSettings);
return new Promise(function (resolve, reject) {
if (!str) {
@@ -54311,10 +53902,10 @@ function parseXML(str, opts) {
* Create a new serialization RequestPolicyCreator that will serialized HTTP request bodies as they
* pass through the HTTP pipeline.
*/
function deserializationPolicy(deserializationContentTypes, parsingOptions) {
function deserializationPolicy(deserializationContentTypes) {
return {
create: function (nextPolicy, options) {
return new DeserializationPolicy(nextPolicy, options, deserializationContentTypes, parsingOptions);
return new DeserializationPolicy(nextPolicy, deserializationContentTypes, options);
}
};
}
@@ -54332,25 +53923,22 @@ var DefaultDeserializationOptions = {
*/
var DeserializationPolicy = /** @class */ (function (_super) {
tslib.__extends(DeserializationPolicy, _super);
function DeserializationPolicy(nextPolicy, requestPolicyOptions, deserializationContentTypes, parsingOptions) {
if (parsingOptions === void 0) { parsingOptions = {}; }
var _a;
var _this = _super.call(this, nextPolicy, requestPolicyOptions) || this;
function DeserializationPolicy(nextPolicy, deserializationContentTypes, options) {
var _this = _super.call(this, nextPolicy, options) || this;
_this.jsonContentTypes =
(deserializationContentTypes && deserializationContentTypes.json) || defaultJsonContentTypes;
_this.xmlContentTypes =
(deserializationContentTypes && deserializationContentTypes.xml) || defaultXmlContentTypes;
_this.xmlCharKey = (_a = parsingOptions.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY;
return _this;
}
DeserializationPolicy.prototype.sendRequest = function (request) {
return tslib.__awaiter(this, void 0, void 0, function () {
var _this = this;
return tslib.__generator(this, function (_a) {
return [2 /*return*/, this._nextPolicy.sendRequest(request).then(function (response) {
return deserializeResponseBody(_this.jsonContentTypes, _this.xmlContentTypes, response, {
xmlCharKey: _this.xmlCharKey
});
return [2 /*return*/, this._nextPolicy
.sendRequest(request)
.then(function (response) {
return deserializeResponseBody(_this.jsonContentTypes, _this.xmlContentTypes, response);
})];
});
});
@@ -54386,15 +53974,8 @@ function shouldDeserializeResponse(parsedResponse) {
}
return result;
}
function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options) {
var _a, _b, _c;
if (options === void 0) { options = {}; }
var updatedOptions = {
rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "",
includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false,
xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY
};
return parse(jsonContentTypes, xmlContentTypes, response, updatedOptions).then(function (parsedResponse) {
function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response) {
return parse(jsonContentTypes, xmlContentTypes, response).then(function (parsedResponse) {
if (!shouldDeserializeResponse(parsedResponse)) {
return parsedResponse;
}
@@ -54403,13 +53984,54 @@ function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, op
return parsedResponse;
}
var responseSpec = getOperationResponse(parsedResponse);
var _a = handleErrorResponse(parsedResponse, operationSpec, responseSpec), error = _a.error, shouldReturnResponse = _a.shouldReturnResponse;
if (error) {
var expectedStatusCodes = Object.keys(operationSpec.responses);
var hasNoExpectedStatusCodes = expectedStatusCodes.length === 0 ||
(expectedStatusCodes.length === 1 && expectedStatusCodes[0] === "default");
var isExpectedStatusCode = hasNoExpectedStatusCodes
? 200 <= parsedResponse.status && parsedResponse.status < 300
: !!responseSpec;
// There is no operation response spec for current status code.
// So, treat it as an error case and use the default response spec to deserialize the response.
if (!isExpectedStatusCode) {
var defaultResponseSpec = operationSpec.responses.default;
if (!defaultResponseSpec) {
return parsedResponse;
}
var defaultBodyMapper = defaultResponseSpec.bodyMapper;
var defaultHeadersMapper = defaultResponseSpec.headersMapper;
var initialErrorMessage = isStreamOperation(operationSpec)
? "Unexpected status code: " + parsedResponse.status
: parsedResponse.bodyAsText;
var error = new RestError(initialErrorMessage, undefined, parsedResponse.status, parsedResponse.request, parsedResponse);
try {
// If error response has a body, try to extract error code & message from it
// Then try to deserialize it using default body mapper
if (parsedResponse.parsedBody) {
var parsedBody = parsedResponse.parsedBody;
var internalError = parsedBody.error || parsedBody;
error.code = internalError.code;
if (internalError.message) {
error.message = internalError.message;
}
if (defaultBodyMapper) {
var valueToDeserialize = parsedBody;
if (operationSpec.isXML && defaultBodyMapper.type.name === MapperType.Sequence) {
valueToDeserialize =
typeof parsedBody === "object" ? parsedBody[defaultBodyMapper.xmlElementName] : [];
}
error.response.parsedBody = operationSpec.serializer.deserialize(defaultBodyMapper, valueToDeserialize, "error.response.parsedBody");
}
}
// If error response has headers, try to deserialize it using default header mapper
if (parsedResponse.headers && defaultHeadersMapper) {
error.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.rawHeaders(), "operationRes.parsedHeaders");
}
}
catch (defaultError) {
error.message = "Error \"" + defaultError.message + "\" occurred in deserializing the responseBody - \"" + parsedResponse.bodyAsText + "\" for the default response.";
}
throw error;
}
else if (shouldReturnResponse) {
return parsedResponse;
}
// An operation response spec does exist for current status code, so
// use it to deserialize the response.
if (responseSpec) {
@@ -54422,7 +54044,7 @@ function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, op
: [];
}
try {
parsedResponse.parsedBody = operationSpec.serializer.deserialize(responseSpec.bodyMapper, valueToDeserialize, "operationRes.parsedBody", options);
parsedResponse.parsedBody = operationSpec.serializer.deserialize(responseSpec.bodyMapper, valueToDeserialize, "operationRes.parsedBody");
}
catch (error) {
var restError = new RestError("Error " + error + " occurred in deserializing the responseBody - " + parsedResponse.bodyAsText, undefined, parsedResponse.status, parsedResponse.request, parsedResponse);
@@ -54434,78 +54056,13 @@ function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, op
parsedResponse.parsedBody = response.status >= 200 && response.status < 300;
}
if (responseSpec.headersMapper) {
parsedResponse.parsedHeaders = operationSpec.serializer.deserialize(responseSpec.headersMapper, parsedResponse.headers.rawHeaders(), "operationRes.parsedHeaders", options);
parsedResponse.parsedHeaders = operationSpec.serializer.deserialize(responseSpec.headersMapper, parsedResponse.headers.rawHeaders(), "operationRes.parsedHeaders");
}
}
return parsedResponse;
});
}
function isOperationSpecEmpty(operationSpec) {
var expectedStatusCodes = Object.keys(operationSpec.responses);
return (expectedStatusCodes.length === 0 ||
(expectedStatusCodes.length === 1 && expectedStatusCodes[0] === "default"));
}
function handleErrorResponse(parsedResponse, operationSpec, responseSpec) {
var isSuccessByStatus = 200 <= parsedResponse.status && parsedResponse.status < 300;
var isExpectedStatusCode = isOperationSpecEmpty(operationSpec)
? isSuccessByStatus
: !!responseSpec;
if (isExpectedStatusCode) {
if (responseSpec) {
if (!responseSpec.isError) {
return { error: null, shouldReturnResponse: false };
}
}
else {
return { error: null, shouldReturnResponse: false };
}
}
var errorResponseSpec = responseSpec !== null && responseSpec !== void 0 ? responseSpec : operationSpec.responses.default;
var initialErrorMessage = isStreamOperation(operationSpec)
? "Unexpected status code: " + parsedResponse.status
: parsedResponse.bodyAsText;
var error = new RestError(initialErrorMessage, undefined, parsedResponse.status, parsedResponse.request, parsedResponse);
// If the item failed but there's no error spec or default spec to deserialize the error,
// we should fail so we just throw the parsed response
if (!errorResponseSpec) {
throw error;
}
var defaultBodyMapper = errorResponseSpec.bodyMapper;
var defaultHeadersMapper = errorResponseSpec.headersMapper;
try {
// If error response has a body, try to deserialize it using default body mapper.
// Then try to extract error code & message from it
if (parsedResponse.parsedBody) {
var parsedBody = parsedResponse.parsedBody;
var parsedError = void 0;
if (defaultBodyMapper) {
var valueToDeserialize = parsedBody;
if (operationSpec.isXML && defaultBodyMapper.type.name === MapperType.Sequence) {
valueToDeserialize =
typeof parsedBody === "object" ? parsedBody[defaultBodyMapper.xmlElementName] : [];
}
parsedError = operationSpec.serializer.deserialize(defaultBodyMapper, valueToDeserialize, "error.response.parsedBody");
}
var internalError = parsedBody.error || parsedError || parsedBody;
error.code = internalError.code;
if (internalError.message) {
error.message = internalError.message;
}
if (defaultBodyMapper) {
error.response.parsedBody = parsedError;
}
}
// If error response has headers, try to deserialize it using default header mapper
if (parsedResponse.headers && defaultHeadersMapper) {
error.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.rawHeaders(), "operationRes.parsedHeaders");
}
}
catch (defaultError) {
error.message = "Error \"" + defaultError.message + "\" occurred in deserializing the responseBody - \"" + parsedResponse.bodyAsText + "\" for the default response.";
}
return { error: error, shouldReturnResponse: false };
}
function parse(jsonContentTypes, xmlContentTypes, operationResponse, opts) {
function parse(jsonContentTypes, xmlContentTypes, operationResponse) {
var errorHandler = function (err) {
var msg = "Error \"" + err + "\" occurred while parsing the response body - " + operationResponse.bodyAsText + ".";
var errCode = err.code || RestError.PARSE_ERROR;
@@ -54526,7 +54083,7 @@ function parse(jsonContentTypes, xmlContentTypes, operationResponse, opts) {
}).catch(errorHandler);
}
else if (contentComponents.some(function (component) { return xmlContentTypes.indexOf(component) !== -1; })) {
return parseXML(text_1, opts)
return parseXML(text_1)
.then(function (body) {
operationResponse.parsedBody = body;
return operationResponse;
@@ -54796,10 +54353,6 @@ var UserAgentPolicy = /** @class */ (function (_super) {
}(BaseRequestPolicy));
// Copyright (c) Microsoft Corporation.
/**
* Methods that are allowed to follow redirects 301 and 302
*/
var allowedRedirect = ["GET", "HEAD"];
var DefaultRedirectOptions = {
handleRedirects: true,
maxRetries: 20
@@ -54832,11 +54385,7 @@ function handleRedirect(policy, response, currentRetries) {
var request = response.request, status = response.status;
var locationHeader = response.headers.get("location");
if (locationHeader &&
(status === 300 ||
(status === 301 && allowedRedirect.includes(request.method)) ||
(status === 302 && allowedRedirect.includes(request.method)) ||
(status === 303 && request.method === "POST") ||
status === 307) &&
(status === 300 || status === 307 || (status === 303 && request.method === "POST")) &&
(!policy.maxRetries || currentRetries < policy.maxRetries)) {
var builder = URLBuilder.parse(request.url);
builder.setPath(locationHeader);
@@ -54845,7 +54394,6 @@ function handleRedirect(policy, response, currentRetries) {
// redirected GET request if the redirect url is present in the location header
if (status === 303) {
request.method = "GET";
delete request.body;
}
return policy._nextPolicy
.sendRequest(request)
@@ -55107,12 +54655,6 @@ var AccessTokenRefresher = /** @class */ (function () {
}());
// Copyright (c) Microsoft Corporation.
/**
* The automated token refresh will only start to happen at the
* expiration date minus the value of timeBetweenRefreshAttemptsInMs,
* which is by default 30 seconds.
*/
var timeBetweenRefreshAttemptsInMs = 30000;
/**
* Creates a new BearerTokenAuthenticationPolicy factory.
*
@@ -55128,6 +54670,12 @@ function bearerTokenAuthenticationPolicy(credential, scopes) {
}
};
}
/**
* The automated token refresh will only start to happen at the
* expiration date minus the value of timeBetweenRefreshAttemptsInMs,
* which is by default 30 seconds.
*/
var timeBetweenRefreshAttemptsInMs = 30000;
/**
*
* Provides a RequestPolicy that can request a token from a TokenCredential
@@ -55787,15 +55335,10 @@ var ServiceClient = /** @class */ (function () {
var bearerTokenPolicyFactory = undefined;
// eslint-disable-next-line @typescript-eslint/no-this-alias
var serviceClient = _this;
var serviceClientOptions = options;
return {
create: function (nextPolicy, options) {
var credentialScopes = getCredentialScopes(serviceClientOptions, serviceClient.baseUri);
if (!credentialScopes) {
throw new Error("When using credential, the ServiceClient must contain a baseUri or a credentialScopes in ServiceClientOptions. Unable to create a bearerTokenAuthenticationPolicy");
}
if (bearerTokenPolicyFactory === undefined || bearerTokenPolicyFactory === null) {
bearerTokenPolicyFactory = bearerTokenAuthenticationPolicy(credentials, credentialScopes);
bearerTokenPolicyFactory = bearerTokenAuthenticationPolicy(credentials, (serviceClient.baseUri || "") + "/.default");
}
return bearerTokenPolicyFactory.create(nextPolicy, options);
}
@@ -55859,21 +55402,19 @@ var ServiceClient = /** @class */ (function () {
* @param {ServiceCallback} callback The callback to call when the response is received.
*/
ServiceClient.prototype.sendOperationRequest = function (operationArguments, operationSpec, callback) {
var _a;
return tslib.__awaiter(this, void 0, void 0, function () {
var serializerOptions, httpRequest, result, baseUri, requestUrl, _i, _b, urlParameter, urlParameterValue, _c, _d, queryParameter, queryParameterValue, index, item, index, contentType, _e, _f, headerParameter, headerValue, headerCollectionPrefix, _g, _h, key, options, customHeaderName, rawResponse, sendRequestError, error_1, error_2, cb;
return tslib.__generator(this, function (_j) {
switch (_j.label) {
var httpRequest, result, baseUri, requestUrl, _i, _a, urlParameter, urlParameterValue, _b, _c, queryParameter, queryParameterValue, index, item, index, contentType, _d, _e, headerParameter, headerValue, headerCollectionPrefix, _f, _g, key, options, customHeaderName, rawResponse, sendRequestError, error_1, error_2, cb;
return tslib.__generator(this, function (_h) {
switch (_h.label) {
case 0:
if (typeof operationArguments.options === "function") {
callback = operationArguments.options;
operationArguments.options = undefined;
}
serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions;
httpRequest = new WebResource();
_j.label = 1;
_h.label = 1;
case 1:
_j.trys.push([1, 6, , 7]);
_h.trys.push([1, 6, , 7]);
baseUri = operationSpec.baseUrl || this.baseUri;
if (!baseUri) {
throw new Error("If operationSpec.baseUrl is not specified, then the ServiceClient must have a baseUri string property that contains the base URL to use.");
@@ -55885,10 +55426,10 @@ var ServiceClient = /** @class */ (function () {
requestUrl.appendPath(operationSpec.path);
}
if (operationSpec.urlParameters && operationSpec.urlParameters.length > 0) {
for (_i = 0, _b = operationSpec.urlParameters; _i < _b.length; _i++) {
urlParameter = _b[_i];
for (_i = 0, _a = operationSpec.urlParameters; _i < _a.length; _i++) {
urlParameter = _a[_i];
urlParameterValue = getOperationArgumentValueFromParameter(this, operationArguments, urlParameter, operationSpec.serializer);
urlParameterValue = operationSpec.serializer.serialize(urlParameter.mapper, urlParameterValue, getPathStringFromParameter(urlParameter), serializerOptions);
urlParameterValue = operationSpec.serializer.serialize(urlParameter.mapper, urlParameterValue, getPathStringFromParameter(urlParameter));
if (!urlParameter.skipEncoding) {
urlParameterValue = encodeURIComponent(urlParameterValue);
}
@@ -55896,17 +55437,16 @@ var ServiceClient = /** @class */ (function () {
}
}
if (operationSpec.queryParameters && operationSpec.queryParameters.length > 0) {
for (_c = 0, _d = operationSpec.queryParameters; _c < _d.length; _c++) {
queryParameter = _d[_c];
for (_b = 0, _c = operationSpec.queryParameters; _b < _c.length; _b++) {
queryParameter = _c[_b];
queryParameterValue = getOperationArgumentValueFromParameter(this, operationArguments, queryParameter, operationSpec.serializer);
if (queryParameterValue !== undefined && queryParameterValue !== null) {
queryParameterValue = operationSpec.serializer.serialize(queryParameter.mapper, queryParameterValue, getPathStringFromParameter(queryParameter), serializerOptions);
queryParameterValue = operationSpec.serializer.serialize(queryParameter.mapper, queryParameterValue, getPathStringFromParameter(queryParameter));
if (queryParameter.collectionFormat !== undefined &&
queryParameter.collectionFormat !== null) {
if (queryParameter.collectionFormat === exports.QueryCollectionFormat.Multi) {
if (queryParameterValue.length === 0) {
// The collection is empty, no need to try serializing the current queryParam
continue;
queryParameterValue = "";
}
else {
for (index in queryParameterValue) {
@@ -55951,16 +55491,16 @@ var ServiceClient = /** @class */ (function () {
httpRequest.headers.set("Content-Type", contentType);
}
if (operationSpec.headerParameters) {
for (_e = 0, _f = operationSpec.headerParameters; _e < _f.length; _e++) {
headerParameter = _f[_e];
for (_d = 0, _e = operationSpec.headerParameters; _d < _e.length; _d++) {
headerParameter = _e[_d];
headerValue = getOperationArgumentValueFromParameter(this, operationArguments, headerParameter, operationSpec.serializer);
if (headerValue !== undefined && headerValue !== null) {
headerValue = operationSpec.serializer.serialize(headerParameter.mapper, headerValue, getPathStringFromParameter(headerParameter), serializerOptions);
headerValue = operationSpec.serializer.serialize(headerParameter.mapper, headerValue, getPathStringFromParameter(headerParameter));
headerCollectionPrefix = headerParameter.mapper
.headerCollectionPrefix;
if (headerCollectionPrefix) {
for (_g = 0, _h = Object.keys(headerValue); _g < _h.length; _g++) {
key = _h[_g];
for (_f = 0, _g = Object.keys(headerValue); _f < _g.length; _f++) {
key = _g[_f];
httpRequest.headers.set(headerCollectionPrefix + key, headerValue[key]);
}
}
@@ -56004,15 +55544,15 @@ var ServiceClient = /** @class */ (function () {
}
rawResponse = void 0;
sendRequestError = void 0;
_j.label = 2;
_h.label = 2;
case 2:
_j.trys.push([2, 4, , 5]);
_h.trys.push([2, 4, , 5]);
return [4 /*yield*/, this.sendRequest(httpRequest)];
case 3:
rawResponse = _j.sent();
rawResponse = _h.sent();
return [3 /*break*/, 5];
case 4:
error_1 = _j.sent();
error_1 = _h.sent();
sendRequestError = error_1;
return [3 /*break*/, 5];
case 5:
@@ -56028,7 +55568,7 @@ var ServiceClient = /** @class */ (function () {
}
return [3 /*break*/, 7];
case 6:
error_2 = _j.sent();
error_2 = _h.sent();
result = Promise.reject(error_2);
return [3 /*break*/, 7];
case 7:
@@ -56047,14 +55587,7 @@ var ServiceClient = /** @class */ (function () {
return ServiceClient;
}());
function serializeRequestBody(serviceClient, httpRequest, operationArguments, operationSpec) {
var _a, _b, _c, _d, _e, _f;
var serializerOptions = (_b = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions) !== null && _b !== void 0 ? _b : {};
var updatedOptions = {
rootName: (_c = serializerOptions.rootName) !== null && _c !== void 0 ? _c : "",
includeRoot: (_d = serializerOptions.includeRoot) !== null && _d !== void 0 ? _d : false,
xmlCharKey: (_e = serializerOptions.xmlCharKey) !== null && _e !== void 0 ? _e : XML_CHARKEY
};
var xmlCharKey = serializerOptions.xmlCharKey;
var _a;
if (operationSpec.requestBody && operationSpec.requestBody.mapper) {
httpRequest.body = getOperationArgumentValueFromParameter(serviceClient, operationArguments, operationSpec.requestBody, operationSpec.serializer);
var bodyMapper = operationSpec.requestBody.mapper;
@@ -56063,26 +55596,22 @@ function serializeRequestBody(serviceClient, httpRequest, operationArguments, op
try {
if ((httpRequest.body !== undefined && httpRequest.body !== null) || required) {
var requestBodyParameterPathString = getPathStringFromParameter(operationSpec.requestBody);
httpRequest.body = operationSpec.serializer.serialize(bodyMapper, httpRequest.body, requestBodyParameterPathString, updatedOptions);
httpRequest.body = operationSpec.serializer.serialize(bodyMapper, httpRequest.body, requestBodyParameterPathString);
var isStream = typeName === MapperType.Stream;
if (operationSpec.isXML) {
var xmlnsKey = xmlNamespacePrefix ? "xmlns:" + xmlNamespacePrefix : "xmlns";
var value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, httpRequest.body, updatedOptions);
var value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, httpRequest.body);
if (typeName === MapperType.Sequence) {
httpRequest.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), {
rootName: xmlName || serializedName,
xmlCharKey: xmlCharKey
});
httpRequest.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName });
}
else if (!isStream) {
httpRequest.body = stringifyXML(value, {
rootName: xmlName || serializedName,
xmlCharKey: xmlCharKey
rootName: xmlName || serializedName
});
}
}
else if (typeName === MapperType.String &&
(((_f = operationSpec.contentType) === null || _f === void 0 ? void 0 : _f.match("text/plain")) || operationSpec.mediaType === "text")) {
(((_a = operationSpec.contentType) === null || _a === void 0 ? void 0 : _a.match("text/plain")) || operationSpec.mediaType === "text")) {
// the String serializer has validated that request body is a string
// so just send the string.
return;
@@ -56098,12 +55627,12 @@ function serializeRequestBody(serviceClient, httpRequest, operationArguments, op
}
else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) {
httpRequest.formData = {};
for (var _i = 0, _g = operationSpec.formDataParameters; _i < _g.length; _i++) {
var formDataParameter = _g[_i];
for (var _i = 0, _b = operationSpec.formDataParameters; _i < _b.length; _i++) {
var formDataParameter = _b[_i];
var formDataParameterValue = getOperationArgumentValueFromParameter(serviceClient, operationArguments, formDataParameter, operationSpec.serializer);
if (formDataParameterValue !== undefined && formDataParameterValue !== null) {
var formDataParameterPropertyName = formDataParameter.mapper.serializedName || getPathStringFromParameter(formDataParameter);
httpRequest.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, getPathStringFromParameter(formDataParameter), updatedOptions);
httpRequest.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, getPathStringFromParameter(formDataParameter));
}
}
}
@@ -56111,15 +55640,12 @@ function serializeRequestBody(serviceClient, httpRequest, operationArguments, op
/**
* Adds an xml namespace to the xml serialized object if needed, otherwise it just returns the value itself
*/
function getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, serializedValue, options) {
function getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, serializedValue) {
var _a;
// Composite and Sequence schemas already got their root namespace set during serialization
// We just need to add xmlns to the other schema types
if (xmlNamespace && !["Composite", "Sequence", "Dictionary"].includes(typeName)) {
var result = {};
result[options.xmlCharKey] = serializedValue;
result[XML_ATTRKEY] = (_a = {}, _a[xmlnsKey] = xmlNamespace, _a);
return result;
return { _: serializedValue, $: (_a = {}, _a[xmlnsKey] = xmlNamespace, _a) };
}
return serializedValue;
}
@@ -56208,12 +55734,10 @@ function getOperationArgumentValueFromParameter(serviceClient, operationArgument
return getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, parameter.parameterPath, parameter.mapper, serializer);
}
function getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, parameterPath, parameterMapper, serializer) {
var _a;
var value;
if (typeof parameterPath === "string") {
parameterPath = [parameterPath];
}
var serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions;
if (Array.isArray(parameterPath)) {
if (parameterPath.length > 0) {
if (parameterMapper.isConstant) {
@@ -56234,7 +55758,7 @@ function getOperationArgumentValueFromParameterPath(serviceClient, operationArgu
}
// Serialize just for validation purposes.
var parameterPathString = getPathStringFromParameterPath(parameterPath, parameterMapper);
serializer.serialize(parameterMapper, value, parameterPathString, serializerOptions);
serializer.serialize(parameterMapper, value, parameterPathString);
}
}
else {
@@ -56247,7 +55771,7 @@ function getOperationArgumentValueFromParameterPath(serviceClient, operationArgu
var propertyValue = getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, propertyPath, propertyMapper, serializer);
// Serialize just for validation purposes.
var propertyPathString = getPathStringFromParameterPath(propertyPath, propertyMapper);
serializer.serialize(propertyMapper, propertyValue, propertyPathString, serializerOptions);
serializer.serialize(propertyMapper, propertyValue, propertyPathString);
if (propertyValue !== undefined && propertyValue !== null) {
if (!value) {
value = {};
@@ -56321,46 +55845,6 @@ function flattenResponse(_response, responseSpec) {
}
return addOperationResponse(tslib.__assign(tslib.__assign({}, parsedHeaders), _response.parsedBody));
}
function getCredentialScopes(options, baseUri) {
if (options === null || options === void 0 ? void 0 : options.credentialScopes) {
var scopes = options.credentialScopes;
return Array.isArray(scopes)
? scopes.map(function (scope) { return new url.URL(scope).toString(); })
: new url.URL(scopes).toString();
}
if (baseUri) {
return baseUri + "/.default";
}
return undefined;
}
// Copyright (c) Microsoft Corporation.
/**
* Creates a function called createSpan to create spans using the global tracer.
* @ignore
* @param spanConfig The name of the operation being performed.
* @param tracingOptions The options for the underlying http request.
*/
function createSpanFunction(_a) {
var packagePrefix = _a.packagePrefix, namespace = _a.namespace;
return function (operationName, operationOptions) {
var tracer = coreTracing.getTracer();
var tracingOptions = operationOptions.tracingOptions || {};
var spanOptions = tslib.__assign(tslib.__assign({}, tracingOptions.spanOptions), { kind: api.SpanKind.INTERNAL });
var span = tracer.startSpan(packagePrefix + "." + operationName, spanOptions);
span.setAttribute("az.namespace", namespace);
var newSpanOptions = tracingOptions.spanOptions || {};
if (span.isRecording()) {
newSpanOptions = tslib.__assign(tslib.__assign({}, tracingOptions.spanOptions), { parent: span.context(), attributes: tslib.__assign(tslib.__assign({}, spanOptions.attributes), { "az.namespace": namespace }) });
}
var newTracingOptions = tslib.__assign(tslib.__assign({}, tracingOptions), { spanOptions: newSpanOptions });
var newOperationOptions = tslib.__assign(tslib.__assign({}, operationOptions), { tracingOptions: newTracingOptions });
return {
span: span,
updatedOptions: newOperationOptions
};
};
}
// Copyright (c) Microsoft Corporation.
var HeaderConstants = Constants.HeaderConstants;
@@ -56505,12 +55989,9 @@ exports.TopicCredentials = TopicCredentials;
exports.URLBuilder = URLBuilder;
exports.URLQuery = URLQuery;
exports.WebResource = WebResource;
exports.XML_ATTRKEY = XML_ATTRKEY;
exports.XML_CHARKEY = XML_CHARKEY;
exports.applyMixins = applyMixins;
exports.bearerTokenAuthenticationPolicy = bearerTokenAuthenticationPolicy;
exports.createPipelineFromOptions = createPipelineFromOptions;
exports.createSpanFunction = createSpanFunction;
exports.delay = delay;
exports.deserializationPolicy = deserializationPolicy;
exports.deserializeResponseBody = deserializeResponseBody;
+700 -1219
View File
@@ -1074,9 +1074,7 @@ function resolvePaths(patterns) {
try {
for (var _c = __asyncValues(globber.globGenerator()), _d; _d = yield _c.next(), !_d.done;) {
const file = _d.value;
const relativeFile = path
.relative(workspace, file)
.replace(new RegExp(`\\${path.sep}`, 'g'), '/');
const relativeFile = path.relative(workspace, file);
core.debug(`Matched: ${relativeFile}`);
// Paths are made relative so the tar entries are all relative to the root of the workspace.
paths.push(`${relativeFile}`);
@@ -1522,31 +1520,7 @@ if (typeof Symbol === undefined || !Symbol.asyncIterator) {
/* 79 */,
/* 80 */,
/* 81 */,
/* 82 */
/***/ (function(__unusedmodule, exports) {
"use strict";
// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Sanitizes an input into a string so it can be passed into issueCommand safely
* @param input input to sanitize into a string
*/
function toCommandValue(input) {
if (input === null || input === undefined) {
return '';
}
else if (typeof input === 'string' || input instanceof String) {
return input;
}
return JSON.stringify(input);
}
exports.toCommandValue = toCommandValue;
//# sourceMappingURL=utils.js.map
/***/ }),
/* 82 */,
/* 83 */,
/* 84 */,
/* 85 */,
@@ -2756,38 +2730,31 @@ Object.defineProperty(exports, "__esModule", { value: true });
/* 100 */,
/* 101 */,
/* 102 */
/***/ (function(__unusedmodule, exports, __webpack_require__) {
/***/ (function(__unusedmodule, exports) {
"use strict";
// For internal use, subject to change.
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */
const fs = __importStar(__webpack_require__(747));
const os = __importStar(__webpack_require__(87));
const utils_1 = __webpack_require__(82);
function issueCommand(command, message) {
const filePath = process.env[`GITHUB_${command}`];
if (!filePath) {
throw new Error(`Unable to find environment variable for file command ${command}`);
}
if (!fs.existsSync(filePath)) {
throw new Error(`Missing file at path: ${filePath}`);
}
fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
encoding: 'utf8'
});
}
exports.issueCommand = issueCommand;
//# sourceMappingURL=file-command.js.map
exports._globalThis = void 0;
/** only globals that common to node and browsers are allowed */
// eslint-disable-next-line node/no-unsupported-features/es-builtins
exports._globalThis = typeof globalThis === 'object' ? globalThis : global;
//# sourceMappingURL=globalThis.js.map
/***/ }),
/* 103 */,
@@ -3269,12 +3236,9 @@ function uploadChunk(httpClient, resourceUrl, openStream, start, end) {
'Content-Type': 'application/octet-stream',
'Content-Range': getContentRange(start, end)
};
const uploadChunkResponse = yield requestUtils_1.retryHttpClientResponse(`uploadChunk (start: ${start}, end: ${end})`, () => __awaiter(this, void 0, void 0, function* () {
yield requestUtils_1.retryHttpClientResponse(`uploadChunk (start: ${start}, end: ${end})`, () => __awaiter(this, void 0, void 0, function* () {
return httpClient.sendStream('PATCH', resourceUrl, openStream(), additionalHeaders);
}));
if (!requestUtils_1.isSuccessStatusCode(uploadChunkResponse.message.statusCode)) {
throw new Error(`Cache service responded with ${uploadChunkResponse.message.statusCode} during upload chunk.`);
}
});
}
function uploadFile(httpClient, cacheId, archivePath, options) {
@@ -4028,34 +3992,7 @@ var __createBinding;
/***/ }),
/* 145 */
/***/ (function(__unusedmodule, exports) {
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports._globalThis = void 0;
/** only globals that common to node and browsers are allowed */
// eslint-disable-next-line node/no-unsupported-features/es-builtins
exports._globalThis = typeof globalThis === 'object' ? globalThis : global;
//# sourceMappingURL=globalThis.js.map
/***/ }),
/* 145 */,
/* 146 */,
/* 147 */
/***/ (function(__unusedmodule, exports) {
@@ -8542,19 +8479,12 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(__webpack_require__(470));
const fs = __importStar(__webpack_require__(747));
const globOptionsHelper = __importStar(__webpack_require__(601));
const path = __importStar(__webpack_require__(622));
const patternHelper = __importStar(__webpack_require__(597));
const core = __webpack_require__(470);
const fs = __webpack_require__(747);
const globOptionsHelper = __webpack_require__(601);
const path = __webpack_require__(622);
const patternHelper = __webpack_require__(597);
const internal_match_kind_1 = __webpack_require__(327);
const internal_pattern_1 = __webpack_require__(923);
const internal_search_state_1 = __webpack_require__(728);
@@ -9805,13 +9735,6 @@ var StorageError = {
type: {
name: "String"
}
},
code: {
xmlName: "Code",
serializedName: "Code",
type: {
name: "String"
}
}
}
}
@@ -10172,13 +10095,6 @@ var BlobPropertiesInternal = {
type: {
name: "String"
}
},
lastAccessedOn: {
xmlName: "LastAccessTime",
serializedName: "LastAccessTime",
type: {
name: "DateTimeRfc1123"
}
}
}
}
@@ -10884,70 +10800,6 @@ var JsonTextConfiguration = {
}
}
};
var ArrowField = {
xmlName: "Field",
serializedName: "ArrowField",
type: {
name: "Composite",
className: "ArrowField",
modelProperties: {
type: {
xmlName: "Type",
required: true,
serializedName: "Type",
type: {
name: "String"
}
},
name: {
xmlName: "Name",
serializedName: "Name",
type: {
name: "String"
}
},
precision: {
xmlName: "Precision",
serializedName: "Precision",
type: {
name: "Number"
}
},
scale: {
xmlName: "Scale",
serializedName: "Scale",
type: {
name: "Number"
}
}
}
}
};
var ArrowConfiguration = {
serializedName: "ArrowConfiguration",
type: {
name: "Composite",
className: "ArrowConfiguration",
modelProperties: {
schema: {
xmlIsWrapped: true,
xmlName: "Schema",
xmlElementName: "Field",
required: true,
serializedName: "Schema",
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ArrowField"
}
}
}
}
}
}
};
var ListContainersSegmentResponse = {
xmlName: "EnumerationResults",
serializedName: "ListContainersSegmentResponse",
@@ -11388,8 +11240,7 @@ var QueryFormat = {
name: "Enum",
allowedValues: [
"delimited",
"json",
"arrow"
"json"
]
}
},
@@ -11408,14 +11259,6 @@ var QueryFormat = {
name: "Composite",
className: "JsonTextConfiguration"
}
},
arrowConfiguration: {
xmlName: "ArrowConfiguration",
serializedName: "ArrowConfiguration",
type: {
name: "Composite",
className: "ArrowConfiguration"
}
}
}
}
@@ -13069,12 +12912,6 @@ var BlobDownloadHeaders = {
name: "Boolean"
}
},
lastAccessed: {
serializedName: "x-ms-last-access-time",
type: {
name: "DateTimeRfc1123"
}
},
contentCrc64: {
serializedName: "x-ms-content-crc64",
type: {
@@ -13404,12 +13241,6 @@ var BlobGetPropertiesHeaders = {
name: "String"
}
},
lastAccessed: {
serializedName: "x-ms-last-access-time",
type: {
name: "DateTimeRfc1123"
}
},
errorCode: {
serializedName: "x-ms-error-code",
type: {
@@ -17796,7 +17627,7 @@ var version = {
required: true,
isConstant: true,
serializedName: "x-ms-version",
defaultValue: '2020-02-10',
defaultValue: '2019-12-12',
type: {
name: "String"
}
@@ -18788,8 +18619,6 @@ var getAccountInfoOperationSpec$1 = {
var Mappers$2 = /*#__PURE__*/Object.freeze({
__proto__: null,
ArrowConfiguration: ArrowConfiguration,
ArrowField: ArrowField,
BlobAbortCopyFromURLHeaders: BlobAbortCopyFromURLHeaders,
BlobAcquireLeaseHeaders: BlobAcquireLeaseHeaders,
BlobBreakLeaseHeaders: BlobBreakLeaseHeaders,
@@ -20879,8 +20708,8 @@ var logger = logger$1.createClientLogger("storage-blob");
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
var SDK_VERSION = "12.3.0";
var SERVICE_VERSION = "2020-02-10";
var SDK_VERSION = "12.2.1";
var SERVICE_VERSION = "2019-12-12";
var BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB
var BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB
var BLOCK_BLOB_MAX_BLOCKS = 50000;
@@ -21587,7 +21416,7 @@ function toTags(tags) {
* Convert BlobQueryTextConfiguration to QuerySerialization type.
*
* @export
* @param {(BlobQueryJsonTextConfiguration | BlobQueryCsvTextConfiguration | BlobQueryArrowConfiguration)} [textConfiguration]
* @param {(BlobQueryJsonTextConfiguration | BlobQueryCsvTextConfiguration)} [textConfiguration]
* @returns {(QuerySerialization | undefined)}
*/
function toQuerySerialization(textConfiguration) {
@@ -21617,15 +21446,6 @@ function toQuerySerialization(textConfiguration) {
}
}
};
case "arrow":
return {
format: {
type: "arrow",
arrowConfiguration: {
schema: textConfiguration.schema
}
}
};
default:
throw Error("Invalid BlobQueryTextConfiguration.");
}
@@ -22913,21 +22733,6 @@ var BlobDownloadResponse = /** @class */ (function () {
enumerable: false,
configurable: true
});
Object.defineProperty(BlobDownloadResponse.prototype, "lastAccessed", {
/**
* Returns the UTC date and time generated by the service that indicates the time at which the blob was
* last read or written to.
*
* @readonly
* @type {(Date | undefined)}
* @memberof BlobDownloadResponse
*/
get: function () {
return this.originalResponse.lastAccessed;
},
enumerable: false,
configurable: true
});
Object.defineProperty(BlobDownloadResponse.prototype, "metadata", {
/**
* A name-value pair
@@ -24932,7 +24737,7 @@ var StorageSharedKeyCredential = /** @class */ (function (_super) {
* regenerated.
*/
var packageName = "azure-storage-blob";
var packageVersion = "12.3.0";
var packageVersion = "12.2.1";
var StorageClientContext = /** @class */ (function (_super) {
tslib.__extends(StorageClientContext, _super);
/**
@@ -24954,7 +24759,7 @@ var StorageClientContext = /** @class */ (function (_super) {
options.userAgent = packageName + "/" + packageVersion + " " + defaultUserAgent;
}
_this = _super.call(this, undefined, options) || this;
_this.version = "2020-02-10";
_this.version = "2019-12-12";
_this.baseUri = "{url}";
_this.requestContentType = "application/json; charset=utf-8";
_this.url = url;
@@ -28298,56 +28103,6 @@ var BlockBlobClient = /** @class */ (function (_super) {
});
};
// High level functions
/**
* Uploads a Buffer(Node.js)/Blob(browsers)/ArrayBuffer/ArrayBufferView object to a BlockBlob.
*
* When data length is no more than the specifiled {@link BlockBlobParallelUploadOptions.maxSingleShotSize} (default is
* {@link BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}), this method will use 1 {@link upload} call to finish the upload.
* Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call {@link commitBlockList}
* to commit the block list.
*
* @export
* @param {Buffer | Blob | ArrayBuffer | ArrayBufferView} data Buffer(Node.js), Blob, ArrayBuffer or ArrayBufferView
* @param {BlockBlobParallelUploadOptions} [options]
* @returns {Promise<BlobUploadCommonResponse>}
* @memberof BlockBlobClient
*/
BlockBlobClient.prototype.uploadData = function (data, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, buffer_1, browserBlob_1;
return tslib.__generator(this, function (_b) {
_a = createSpan("BlockBlobClient-uploadData", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions;
try {
if (true) {
if (data instanceof Buffer) {
buffer_1 = data;
}
else if (data instanceof ArrayBuffer) {
buffer_1 = Buffer.from(data);
}
else {
data = data;
buffer_1 = Buffer.from(data.buffer, data.byteOffset, data.byteLength);
}
return [2 /*return*/, this.uploadSeekableInternal(function (offset, size) { return buffer_1.slice(offset, offset + size); }, buffer_1.byteLength, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))];
}
else {}
}
catch (e) {
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e.message
});
throw e;
}
finally {
span.end();
}
return [2 /*return*/];
});
});
};
/**
* ONLY AVAILABLE IN BROWSERS.
*
@@ -28357,8 +28112,6 @@ var BlockBlobClient = /** @class */ (function (_super) {
* Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call
* {@link commitBlockList} to commit the block list.
*
* @deprecated Use {@link uploadData} instead.
*
* @export
* @param {Blob | ArrayBuffer | ArrayBufferView} browserData Blob, File, ArrayBuffer or ArrayBufferView
* @param {BlockBlobParallelUploadOptions} [options] Options to upload browser data.
@@ -28368,7 +28121,7 @@ var BlockBlobClient = /** @class */ (function (_super) {
BlockBlobClient.prototype.uploadBrowserData = function (browserData, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, browserBlob_2, e_29;
var _a, span, spanOptions, browserBlob_1, e_29;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -28376,8 +28129,10 @@ var BlockBlobClient = /** @class */ (function (_super) {
_b.label = 1;
case 1:
_b.trys.push([1, 3, 4, 5]);
browserBlob_2 = new Blob([browserData]);
return [4 /*yield*/, this.uploadSeekableInternal(function (offset, size) { return browserBlob_2.slice(offset, offset + size); }, browserBlob_2.size, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))];
browserBlob_1 = new Blob([browserData]);
return [4 /*yield*/, this.uploadSeekableBlob(function (offset, size) {
return browserBlob_1.slice(offset, offset + size);
}, browserBlob_1.size, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))];
case 2: return [2 /*return*/, _b.sent()];
case 3:
e_29 = _b.sent();
@@ -28395,22 +28150,22 @@ var BlockBlobClient = /** @class */ (function (_super) {
});
};
/**
* ONLY AVAILABLE IN BROWSERS.
*
* Uploads data to block blob. Requires a bodyFactory as the data source,
* which need to return a {@link HttpRequestBody} object with the offset and size provided.
* Uploads a browser {@link Blob} object to block blob. Requires a blobFactory as the data source,
* which need to return a {@link Blob} object with the offset and size provided.
*
* When data length is no more than the specifiled {@link BlockBlobParallelUploadOptions.maxSingleShotSize} (default is
* {@link BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}), this method will use 1 {@link upload} call to finish the upload.
* Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call {@link commitBlockList}
* When buffer length <= 256MB, this method will use 1 upload call to finish the upload.
* Otherwise, this method will call stageBlock to upload blocks, and finally call commitBlockList
* to commit the block list.
*
* @param {(offset: number, size: number) => HttpRequestBody} bodyFactory
* @param {(offset: number, size: number) => Blob} blobFactory
* @param {number} size size of the data to upload.
* @param {BlockBlobParallelUploadOptions} [options] Options to Upload to Block Blob operation.
* @returns {Promise<BlobUploadCommonResponse>} Response data for the Blob Upload operation.
* @memberof BlockBlobClient
*/
BlockBlobClient.prototype.uploadSeekableInternal = function (bodyFactory, size, options) {
BlockBlobClient.prototype.uploadSeekableBlob = function (blobFactory, size, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, numBlocks_1, blockList_1, blockIDPrefix_1, transferProgress_2, batch, _loop_2, i, e_30;
@@ -28448,12 +28203,12 @@ var BlockBlobClient = /** @class */ (function (_super) {
if (!options.conditions) {
options.conditions = {};
}
_a = createSpan("BlockBlobClient-uploadSeekableInternal", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions;
_a = createSpan("BlockBlobClient-UploadSeekableBlob", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions;
_b.label = 1;
case 1:
_b.trys.push([1, 5, 6, 7]);
if (!(size <= options.maxSingleShotSize)) return [3 /*break*/, 3];
return [4 /*yield*/, this.upload(bodyFactory(0, size), size, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))];
return [4 /*yield*/, this.upload(blobFactory(0, size), size, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))];
case 2: return [2 /*return*/, _b.sent()];
case 3:
numBlocks_1 = Math.floor((size - 1) / options.blockSize) + 1;
@@ -28476,7 +28231,7 @@ var BlockBlobClient = /** @class */ (function (_super) {
end = i === numBlocks_1 - 1 ? size : start + options.blockSize;
contentLength = end - start;
blockList_1.push(blockID);
return [4 /*yield*/, this.stageBlock(blockID, bodyFactory(start, contentLength), contentLength, {
return [4 /*yield*/, this.stageBlock(blockID, blobFactory(start, contentLength), contentLength, {
abortSignal: options.abortSignal,
conditions: options.conditions,
encryptionScope: options.encryptionScope,
@@ -28547,14 +28302,12 @@ var BlockBlobClient = /** @class */ (function (_super) {
return [4 /*yield*/, fsStat(filePath)];
case 2:
size = (_b.sent()).size;
return [4 /*yield*/, this.uploadSeekableInternal(function (offset, count) {
return function () {
return fsCreateReadStream(filePath, {
autoClose: true,
end: count ? offset + count - 1 : Infinity,
start: offset
});
};
return [4 /*yield*/, this.uploadResetableStream(function (offset, count) {
return fsCreateReadStream(filePath, {
autoClose: true,
end: count ? offset + count - 1 : Infinity,
start: offset
});
}, size, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))];
case 3: return [2 /*return*/, _b.sent()];
case 4:
@@ -28662,6 +28415,132 @@ var BlockBlobClient = /** @class */ (function (_super) {
});
});
};
/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
*
* Accepts a Node.js Readable stream factory, and uploads in blocks to a block blob.
* The Readable stream factory must returns a Node.js Readable stream starting from the offset defined. The offset
* is the offset in the block blob to be uploaded.
*
* When buffer length <= 256MB, this method will use 1 upload call to finish the upload.
* Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call {@link commitBlockList}
* to commit the block list.
*
* @export
* @param {(offset: number) => NodeJS.ReadableStream} streamFactory Returns a Node.js Readable stream starting
* from the offset defined
* @param {number} size Size of the block blob
* @param {BlockBlobParallelUploadOptions} [options] Options to Upload to Block Blob operation.
* @returns {(Promise<BlobUploadCommonResponse>)} Response data for the Blob Upload operation.
* @memberof BlockBlobClient
*/
BlockBlobClient.prototype.uploadResetableStream = function (streamFactory, size, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, numBlocks_2, blockList_3, blockIDPrefix_3, transferProgress_4, batch, _loop_3, i, e_33;
var _this = this;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
if (!options.blockSize) {
options.blockSize = 0;
}
if (options.blockSize < 0 || options.blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) {
throw new RangeError("blockSize option must be >= 0 and <= " + BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES);
}
if (options.maxSingleShotSize !== 0 && !options.maxSingleShotSize) {
options.maxSingleShotSize = BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES;
}
if (options.maxSingleShotSize < 0 ||
options.maxSingleShotSize > BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) {
throw new RangeError("maxSingleShotSize option must be >= 0 and <= " + BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES);
}
if (options.blockSize === 0) {
if (size > BLOCK_BLOB_MAX_BLOCKS * BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) {
throw new RangeError(size + " is too larger to upload to a block blob.");
}
if (size > options.maxSingleShotSize) {
options.blockSize = Math.ceil(size / BLOCK_BLOB_MAX_BLOCKS);
if (options.blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) {
options.blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES;
}
}
}
if (!options.blobHTTPHeaders) {
options.blobHTTPHeaders = {};
}
if (!options.conditions) {
options.conditions = {};
}
_a = createSpan("BlockBlobClient-uploadResetableStream", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions;
_b.label = 1;
case 1:
_b.trys.push([1, 6, 7, 8]);
if (!(size <= options.maxSingleShotSize)) return [3 /*break*/, 3];
return [4 /*yield*/, this.upload(function () { return streamFactory(0); }, size, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))];
case 2: return [2 /*return*/, _b.sent()];
case 3:
numBlocks_2 = Math.floor((size - 1) / options.blockSize) + 1;
if (numBlocks_2 > BLOCK_BLOB_MAX_BLOCKS) {
throw new RangeError("The buffer's size is too big or the BlockSize is too small;" +
("the number of blocks must be <= " + BLOCK_BLOB_MAX_BLOCKS));
}
blockList_3 = [];
blockIDPrefix_3 = coreHttp.generateUuid();
transferProgress_4 = 0;
batch = new Batch(options.concurrency);
_loop_3 = function (i) {
batch.addOperation(function () { return tslib.__awaiter(_this, void 0, void 0, function () {
var blockID, start, end, contentLength;
return tslib.__generator(this, function (_a) {
switch (_a.label) {
case 0:
blockID = generateBlockID(blockIDPrefix_3, i);
start = options.blockSize * i;
end = i === numBlocks_2 - 1 ? size : start + options.blockSize;
contentLength = end - start;
blockList_3.push(blockID);
return [4 /*yield*/, this.stageBlock(blockID, function () { return streamFactory(start, contentLength); }, contentLength, {
abortSignal: options.abortSignal,
conditions: options.conditions,
encryptionScope: options.encryptionScope,
tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions })
})];
case 1:
_a.sent();
// Update progress after block is successfully uploaded to server, in case of block trying
transferProgress_4 += contentLength;
if (options.onProgress) {
options.onProgress({ loadedBytes: transferProgress_4 });
}
return [2 /*return*/];
}
});
}); });
};
for (i = 0; i < numBlocks_2; i++) {
_loop_3(i);
}
return [4 /*yield*/, batch.do()];
case 4:
_b.sent();
return [4 /*yield*/, this.commitBlockList(blockList_3, tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))];
case 5: return [2 /*return*/, _b.sent()];
case 6:
e_33 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_33.message
});
throw e_33;
case 7:
span.end();
return [7 /*endfinally*/];
case 8: return [2 /*return*/];
}
});
});
};
return BlockBlobClient;
}(BlobClient));
/**
@@ -28760,7 +28639,7 @@ var PageBlobClient = /** @class */ (function (_super) {
var _a;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _b, span, spanOptions, e_33;
var _b, span, spanOptions, e_34;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
@@ -28785,12 +28664,12 @@ var PageBlobClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _c.sent()];
case 3:
e_33 = _c.sent();
e_34 = _c.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_33.message
message: e_34.message
});
throw e_33;
throw e_34;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -28814,7 +28693,7 @@ var PageBlobClient = /** @class */ (function (_super) {
var _a, _b;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _c, span, spanOptions, conditions, res, e_34;
var _c, span, spanOptions, conditions, res, e_35;
return tslib.__generator(this, function (_d) {
switch (_d.label) {
case 0:
@@ -28829,19 +28708,19 @@ var PageBlobClient = /** @class */ (function (_super) {
return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable
})];
case 3:
e_34 = _d.sent();
if (((_a = e_34.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") {
e_35 = _d.sent();
if (((_a = e_35.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") {
span.setStatus({
code: api.CanonicalCode.ALREADY_EXISTS,
message: "Expected exception when creating a blob only if it does not already exist."
});
return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_34.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_34.response })];
return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_35.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_35.response })];
}
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_34.message
message: e_35.message
});
throw e_34;
throw e_35;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -28865,7 +28744,7 @@ var PageBlobClient = /** @class */ (function (_super) {
var _a;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _b, span, spanOptions, e_35;
var _b, span, spanOptions, e_36;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
@@ -28890,12 +28769,12 @@ var PageBlobClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _c.sent()];
case 3:
e_35 = _c.sent();
e_36 = _c.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_35.message
message: e_36.message
});
throw e_35;
throw e_36;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -28921,7 +28800,7 @@ var PageBlobClient = /** @class */ (function (_super) {
var _a;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _b, span, spanOptions, e_36;
var _b, span, spanOptions, e_37;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
@@ -28951,12 +28830,12 @@ var PageBlobClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _c.sent()];
case 3:
e_36 = _c.sent();
e_37 = _c.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_36.message
message: e_37.message
});
throw e_36;
throw e_37;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -28980,7 +28859,7 @@ var PageBlobClient = /** @class */ (function (_super) {
if (offset === void 0) { offset = 0; }
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _b, span, spanOptions, e_37;
var _b, span, spanOptions, e_38;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
@@ -29001,12 +28880,12 @@ var PageBlobClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _c.sent()];
case 3:
e_37 = _c.sent();
e_38 = _c.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_37.message
message: e_38.message
});
throw e_37;
throw e_38;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29030,7 +28909,7 @@ var PageBlobClient = /** @class */ (function (_super) {
if (offset === void 0) { offset = 0; }
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _b, span, spanOptions, e_38;
var _b, span, spanOptions, e_39;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
@@ -29050,12 +28929,12 @@ var PageBlobClient = /** @class */ (function (_super) {
.then(rangeResponseFromModel)];
case 2: return [2 /*return*/, _c.sent()];
case 3:
e_38 = _c.sent();
e_39 = _c.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_38.message
message: e_39.message
});
throw e_38;
throw e_39;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29079,7 +28958,7 @@ var PageBlobClient = /** @class */ (function (_super) {
var _a;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _b, span, spanOptions, e_39;
var _b, span, spanOptions, e_40;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
@@ -29100,12 +28979,12 @@ var PageBlobClient = /** @class */ (function (_super) {
.then(rangeResponseFromModel)];
case 2: return [2 /*return*/, _c.sent()];
case 3:
e_39 = _c.sent();
e_40 = _c.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_39.message
message: e_40.message
});
throw e_39;
throw e_40;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29129,7 +29008,7 @@ var PageBlobClient = /** @class */ (function (_super) {
var _a;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _b, span, spanOptions, e_40;
var _b, span, spanOptions, e_41;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
@@ -29150,12 +29029,12 @@ var PageBlobClient = /** @class */ (function (_super) {
.then(rangeResponseFromModel)];
case 2: return [2 /*return*/, _c.sent()];
case 3:
e_40 = _c.sent();
e_41 = _c.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_40.message
message: e_41.message
});
throw e_40;
throw e_41;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29177,7 +29056,7 @@ var PageBlobClient = /** @class */ (function (_super) {
var _a;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _b, span, spanOptions, e_41;
var _b, span, spanOptions, e_42;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
@@ -29195,12 +29074,12 @@ var PageBlobClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _c.sent()];
case 3:
e_41 = _c.sent();
e_42 = _c.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_41.message
message: e_42.message
});
throw e_41;
throw e_42;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29223,7 +29102,7 @@ var PageBlobClient = /** @class */ (function (_super) {
var _a;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _b, span, spanOptions, e_42;
var _b, span, spanOptions, e_43;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
@@ -29241,12 +29120,12 @@ var PageBlobClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _c.sent()];
case 3:
e_42 = _c.sent();
e_43 = _c.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_42.message
message: e_43.message
});
throw e_42;
throw e_43;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29273,7 +29152,7 @@ var PageBlobClient = /** @class */ (function (_super) {
var _a;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _b, span, spanOptions, e_43;
var _b, span, spanOptions, e_44;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
@@ -29288,12 +29167,12 @@ var PageBlobClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _c.sent()];
case 3:
e_43 = _c.sent();
e_44 = _c.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_43.message
message: e_44.message
});
throw e_43;
throw e_44;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29378,7 +29257,7 @@ var BlobLeaseClient = /** @class */ (function () {
var _a, _b, _c, _d, _e, _f;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _g, span, spanOptions, e_44;
var _g, span, spanOptions, e_45;
return tslib.__generator(this, function (_h) {
switch (_h.label) {
case 0:
@@ -29400,12 +29279,12 @@ var BlobLeaseClient = /** @class */ (function () {
})];
case 2: return [2 /*return*/, _h.sent()];
case 3:
e_44 = _h.sent();
e_45 = _h.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_44.message
message: e_45.message
});
throw e_44;
throw e_45;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29429,7 +29308,7 @@ var BlobLeaseClient = /** @class */ (function () {
var _a, _b, _c, _d, _e, _f;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _g, span, spanOptions, response, e_45;
var _g, span, spanOptions, response, e_46;
return tslib.__generator(this, function (_h) {
switch (_h.label) {
case 0:
@@ -29452,12 +29331,12 @@ var BlobLeaseClient = /** @class */ (function () {
this._leaseId = proposedLeaseId;
return [2 /*return*/, response];
case 3:
e_45 = _h.sent();
e_46 = _h.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_45.message
message: e_46.message
});
throw e_45;
throw e_46;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29481,7 +29360,7 @@ var BlobLeaseClient = /** @class */ (function () {
var _a, _b, _c, _d, _e, _f;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _g, span, spanOptions, e_46;
var _g, span, spanOptions, e_47;
return tslib.__generator(this, function (_h) {
switch (_h.label) {
case 0:
@@ -29501,12 +29380,12 @@ var BlobLeaseClient = /** @class */ (function () {
})];
case 2: return [2 /*return*/, _h.sent()];
case 3:
e_46 = _h.sent();
e_47 = _h.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_46.message
message: e_47.message
});
throw e_46;
throw e_47;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29529,7 +29408,7 @@ var BlobLeaseClient = /** @class */ (function () {
var _a, _b, _c, _d, _e, _f;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _g, span, spanOptions, e_47;
var _g, span, spanOptions, e_48;
return tslib.__generator(this, function (_h) {
switch (_h.label) {
case 0:
@@ -29549,12 +29428,12 @@ var BlobLeaseClient = /** @class */ (function () {
})];
case 2: return [2 /*return*/, _h.sent()];
case 3:
e_47 = _h.sent();
e_48 = _h.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_47.message
message: e_48.message
});
throw e_47;
throw e_48;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29580,7 +29459,7 @@ var BlobLeaseClient = /** @class */ (function () {
var _a, _b, _c, _d, _e, _f;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _g, span, spanOptions, operationOptions, e_48;
var _g, span, spanOptions, operationOptions, e_49;
return tslib.__generator(this, function (_h) {
switch (_h.label) {
case 0:
@@ -29602,12 +29481,12 @@ var BlobLeaseClient = /** @class */ (function () {
return [4 /*yield*/, this._containerOrBlobOperation.breakLease(operationOptions)];
case 2: return [2 /*return*/, _h.sent()];
case 3:
e_48 = _h.sent();
e_49 = _h.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_48.message
message: e_49.message
});
throw e_48;
throw e_49;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29712,7 +29591,7 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.create = function (options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, e_49;
var _a, span, spanOptions, e_50;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -29726,12 +29605,12 @@ var ContainerClient = /** @class */ (function (_super) {
// this will filter out unwanted properties from the response object into result object
return [2 /*return*/, _b.sent()];
case 3:
e_49 = _b.sent();
e_50 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_49.message
message: e_50.message
});
throw e_49;
throw e_50;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29753,7 +29632,7 @@ var ContainerClient = /** @class */ (function (_super) {
var _a, _b;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _c, span, spanOptions, res, e_50;
var _c, span, spanOptions, res, e_51;
return tslib.__generator(this, function (_d) {
switch (_d.label) {
case 0:
@@ -29767,19 +29646,19 @@ var ContainerClient = /** @class */ (function (_super) {
return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable
})];
case 3:
e_50 = _d.sent();
if (((_a = e_50.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") {
e_51 = _d.sent();
if (((_a = e_51.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") {
span.setStatus({
code: api.CanonicalCode.ALREADY_EXISTS,
message: "Expected exception when creating a container only if it does not already exist."
});
return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_50.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_50.response })];
return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_51.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_51.response })];
}
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_50.message
message: e_51.message
});
throw e_50;
throw e_51;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29802,7 +29681,7 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.exists = function (options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, e_51;
var _a, span, spanOptions, e_52;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -29818,8 +29697,8 @@ var ContainerClient = /** @class */ (function (_super) {
_b.sent();
return [2 /*return*/, true];
case 3:
e_51 = _b.sent();
if (e_51.statusCode === 404) {
e_52 = _b.sent();
if (e_52.statusCode === 404) {
span.setStatus({
code: api.CanonicalCode.NOT_FOUND,
message: "Expected exception when checking container existence"
@@ -29828,9 +29707,9 @@ var ContainerClient = /** @class */ (function (_super) {
}
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_51.message
message: e_52.message
});
throw e_51;
throw e_52;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29905,7 +29784,7 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.getProperties = function (options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, e_52;
var _a, span, spanOptions, e_53;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -29919,12 +29798,12 @@ var ContainerClient = /** @class */ (function (_super) {
return [4 /*yield*/, this.containerContext.getProperties(tslib.__assign(tslib.__assign({ abortSignal: options.abortSignal }, options.conditions), { spanOptions: spanOptions }))];
case 2: return [2 /*return*/, _b.sent()];
case 3:
e_52 = _b.sent();
e_53 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_52.message
message: e_53.message
});
throw e_52;
throw e_53;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29945,7 +29824,7 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.delete = function (options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, e_53;
var _a, span, spanOptions, e_54;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -29964,12 +29843,12 @@ var ContainerClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _b.sent()];
case 3:
e_53 = _b.sent();
e_54 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_53.message
message: e_54.message
});
throw e_53;
throw e_54;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -29991,7 +29870,7 @@ var ContainerClient = /** @class */ (function (_super) {
var _a, _b;
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _c, span, spanOptions, res, e_54;
var _c, span, spanOptions, res, e_55;
return tslib.__generator(this, function (_d) {
switch (_d.label) {
case 0:
@@ -30005,19 +29884,19 @@ var ContainerClient = /** @class */ (function (_super) {
return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable
})];
case 3:
e_54 = _d.sent();
if (((_a = e_54.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") {
e_55 = _d.sent();
if (((_a = e_55.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") {
span.setStatus({
code: api.CanonicalCode.NOT_FOUND,
message: "Expected exception when deleting a container only if it exists."
});
return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_54.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_54.response })];
return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_55.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_55.response })];
}
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_54.message
message: e_55.message
});
throw e_54;
throw e_55;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -30043,7 +29922,7 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.setMetadata = function (metadata, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, e_55;
var _a, span, spanOptions, e_56;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -30066,12 +29945,12 @@ var ContainerClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _b.sent()];
case 3:
e_55 = _b.sent();
e_56 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_55.message
message: e_56.message
});
throw e_55;
throw e_56;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -30096,7 +29975,7 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.getAccessPolicy = function (options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, response, res, _i, response_1, identifier, accessPolicy, e_56;
var _a, span, spanOptions, response, res, _i, response_1, identifier, accessPolicy, e_57;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -30147,12 +30026,12 @@ var ContainerClient = /** @class */ (function (_super) {
}
return [2 /*return*/, res];
case 3:
e_56 = _b.sent();
e_57 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_56.message
message: e_57.message
});
throw e_56;
throw e_57;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -30183,7 +30062,7 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.setAccessPolicy = function (access, containerAcl, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, acl, _i, _b, identifier, e_57;
var _a, span, spanOptions, acl, _i, _b, identifier, e_58;
return tslib.__generator(this, function (_c) {
switch (_c.label) {
case 0:
@@ -30218,12 +30097,12 @@ var ContainerClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _c.sent()];
case 3:
e_57 = _c.sent();
e_58 = _c.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_57.message
message: e_58.message
});
throw e_57;
throw e_58;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -30268,7 +30147,7 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.uploadBlockBlob = function (blobName, body, contentLength, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, blockBlobClient, response, e_58;
var _a, span, spanOptions, blockBlobClient, response, e_59;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -30285,12 +30164,12 @@ var ContainerClient = /** @class */ (function (_super) {
response: response
}];
case 3:
e_58 = _b.sent();
e_59 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_58.message
message: e_59.message
});
throw e_58;
throw e_59;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -30314,7 +30193,7 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.deleteBlob = function (blobName, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, blobClient, e_59;
var _a, span, spanOptions, blobClient, e_60;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -30329,12 +30208,12 @@ var ContainerClient = /** @class */ (function (_super) {
return [4 /*yield*/, blobClient.delete(tslib.__assign(tslib.__assign({}, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))];
case 2: return [2 /*return*/, _b.sent()];
case 3:
e_59 = _b.sent();
e_60 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_59.message
message: e_60.message
});
throw e_59;
throw e_60;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -30358,7 +30237,7 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.listBlobFlatSegment = function (marker, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, response, wrappedResponse, e_60;
var _a, span, spanOptions, response, wrappedResponse, e_61;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -30375,12 +30254,12 @@ var ContainerClient = /** @class */ (function (_super) {
}) }) });
return [2 /*return*/, wrappedResponse];
case 3:
e_60 = _b.sent();
e_61 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_60.message
message: e_61.message
});
throw e_60;
throw e_61;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -30405,7 +30284,7 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.listBlobHierarchySegment = function (delimiter, marker, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, response, wrappedResponse, e_61;
var _a, span, spanOptions, response, wrappedResponse, e_62;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -30422,12 +30301,12 @@ var ContainerClient = /** @class */ (function (_super) {
}) }) });
return [2 /*return*/, wrappedResponse];
case 3:
e_61 = _b.sent();
e_62 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_61.message
message: e_62.message
});
throw e_61;
throw e_62;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -30489,8 +30368,8 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.listItems = function (options) {
if (options === void 0) { options = {}; }
return tslib.__asyncGenerator(this, arguments, function listItems_1() {
var marker, _a, _b, listBlobsFlatSegmentResponse, e_62_1;
var e_62, _c;
var marker, _a, _b, listBlobsFlatSegmentResponse, e_63_1;
var e_63, _c;
return tslib.__generator(this, function (_d) {
switch (_d.label) {
case 0:
@@ -30509,8 +30388,8 @@ var ContainerClient = /** @class */ (function (_super) {
case 5: return [3 /*break*/, 1];
case 6: return [3 /*break*/, 13];
case 7:
e_62_1 = _d.sent();
e_62 = { error: e_62_1 };
e_63_1 = _d.sent();
e_63 = { error: e_63_1 };
return [3 /*break*/, 13];
case 8:
_d.trys.push([8, , 11, 12]);
@@ -30521,7 +30400,7 @@ var ContainerClient = /** @class */ (function (_super) {
_d.label = 10;
case 10: return [3 /*break*/, 12];
case 11:
if (e_62) throw e_62.error;
if (e_63) throw e_63.error;
return [7 /*endfinally*/];
case 12: return [7 /*endfinally*/];
case 13: return [2 /*return*/];
@@ -30710,8 +30589,8 @@ var ContainerClient = /** @class */ (function (_super) {
ContainerClient.prototype.listItemsByHierarchy = function (delimiter, options) {
if (options === void 0) { options = {}; }
return tslib.__asyncGenerator(this, arguments, function listItemsByHierarchy_1() {
var marker, _a, _b, listBlobsHierarchySegmentResponse, segment, _i, _c, prefix, _d, _e, blob, e_63_1;
var e_63, _f;
var marker, _a, _b, listBlobsHierarchySegmentResponse, segment, _i, _c, prefix, _d, _e, blob, e_64_1;
var e_64, _f;
return tslib.__generator(this, function (_g) {
switch (_g.label) {
case 0:
@@ -30754,8 +30633,8 @@ var ContainerClient = /** @class */ (function (_super) {
case 12: return [3 /*break*/, 1];
case 13: return [3 /*break*/, 20];
case 14:
e_63_1 = _g.sent();
e_63 = { error: e_63_1 };
e_64_1 = _g.sent();
e_64 = { error: e_64_1 };
return [3 /*break*/, 20];
case 15:
_g.trys.push([15, , 18, 19]);
@@ -30766,7 +30645,7 @@ var ContainerClient = /** @class */ (function (_super) {
_g.label = 17;
case 17: return [3 /*break*/, 19];
case 18:
if (e_63) throw e_63.error;
if (e_64) throw e_64.error;
return [7 /*endfinally*/];
case 19: return [7 /*endfinally*/];
case 20: return [2 /*return*/];
@@ -31873,48 +31752,6 @@ var BlobServiceClient = /** @class */ (function (_super) {
});
});
};
/**
* Restore a previously deleted Blob container.
* This API is only functional if Container Soft Delete is enabled for the storage account associated with the container.
*
* @param {string} deletedContainerName Name of the previously deleted container.
* @param {string} deletedContainerVersion Version of the previously deleted container, used to uniquely identify the deleted container.
* @returns {Promise<ContainerUndeleteResponse>} Container deletion response.
* @memberof BlobServiceClient
*/
BlobServiceClient.prototype.undeleteContainer = function (deletedContainerName, deletedContainerVersion, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, containerClient, containerContext, containerUndeleteResponse, e_3;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = createSpan("BlobServiceClient-undeleteContainer", options.tracingOptions), span = _a.span, spanOptions = _a.spanOptions;
_b.label = 1;
case 1:
_b.trys.push([1, 3, 4, 5]);
containerClient = this.getContainerClient(options.destinationContainerName || deletedContainerName);
containerContext = new Container(containerClient["storageClientContext"]);
return [4 /*yield*/, containerContext.restore(tslib.__assign(tslib.__assign({ deletedContainerName: deletedContainerName,
deletedContainerVersion: deletedContainerVersion }, options), { tracingOptions: tslib.__assign(tslib.__assign({}, options.tracingOptions), { spanOptions: spanOptions }) }))];
case 2:
containerUndeleteResponse = _b.sent();
return [2 /*return*/, { containerClient: containerClient, containerUndeleteResponse: containerUndeleteResponse }];
case 3:
e_3 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_3.message
});
throw e_3;
case 4:
span.end();
return [7 /*endfinally*/];
case 5: return [2 /*return*/];
}
});
});
};
/**
* Gets the properties of a storage accounts Blob service, including properties
* for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
@@ -31927,7 +31764,7 @@ var BlobServiceClient = /** @class */ (function (_super) {
BlobServiceClient.prototype.getProperties = function (options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, e_4;
var _a, span, spanOptions, e_3;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -31941,12 +31778,12 @@ var BlobServiceClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _b.sent()];
case 3:
e_4 = _b.sent();
e_3 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_4.message
message: e_3.message
});
throw e_4;
throw e_3;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -31968,7 +31805,7 @@ var BlobServiceClient = /** @class */ (function (_super) {
BlobServiceClient.prototype.setProperties = function (properties, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, e_5;
var _a, span, spanOptions, e_4;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -31982,12 +31819,12 @@ var BlobServiceClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _b.sent()];
case 3:
e_5 = _b.sent();
e_4 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_5.message
message: e_4.message
});
throw e_5;
throw e_4;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -32009,7 +31846,7 @@ var BlobServiceClient = /** @class */ (function (_super) {
BlobServiceClient.prototype.getStatistics = function (options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, e_6;
var _a, span, spanOptions, e_5;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -32023,12 +31860,12 @@ var BlobServiceClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _b.sent()];
case 3:
e_6 = _b.sent();
e_5 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_6.message
message: e_5.message
});
throw e_6;
throw e_5;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -32051,7 +31888,7 @@ var BlobServiceClient = /** @class */ (function (_super) {
BlobServiceClient.prototype.getAccountInfo = function (options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, e_7;
var _a, span, spanOptions, e_6;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -32065,12 +31902,12 @@ var BlobServiceClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _b.sent()];
case 3:
e_7 = _b.sent();
e_6 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_7.message
message: e_6.message
});
throw e_7;
throw e_6;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -32085,9 +31922,9 @@ var BlobServiceClient = /** @class */ (function (_super) {
*
* @param {string} [marker] A string value that identifies the portion of
* the list of containers to be returned with the next listing operation. The
* operation returns the continuationToken value within the response body if the
* operation returns the NextMarker value within the response body if the
* listing operation did not return all containers remaining to be listed
* with the current page. The continuationToken value can be used as the value for
* with the current page. The NextMarker value can be used as the value for
* the marker parameter in a subsequent call to request the next page of list
* items. The marker value is opaque to the client.
* @param {ServiceListContainersSegmentOptions} [options] Options to the Service List Container Segment operation.
@@ -32097,7 +31934,7 @@ var BlobServiceClient = /** @class */ (function (_super) {
BlobServiceClient.prototype.listContainersSegment = function (marker, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, e_8;
var _a, span, spanOptions, e_7;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -32108,12 +31945,12 @@ var BlobServiceClient = /** @class */ (function (_super) {
return [4 /*yield*/, this.serviceContext.listContainersSegment(tslib.__assign(tslib.__assign({ abortSignal: options.abortSignal, marker: marker }, options), { include: typeof options.include === "string" ? [options.include] : options.include, spanOptions: spanOptions }))];
case 2: return [2 /*return*/, _b.sent()];
case 3:
e_8 = _b.sent();
e_7 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_8.message
message: e_7.message
});
throw e_8;
throw e_7;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -32134,9 +31971,9 @@ var BlobServiceClient = /** @class */ (function (_super) {
* however, only a subset of the OData filter syntax is supported in the Blob service.
* @param {string} [marker] A string value that identifies the portion of
* the list of blobs to be returned with the next listing operation. The
* operation returns the continuationToken value within the response body if the
* operation returns the NextMarker value within the response body if the
* listing operation did not return all blobs remaining to be listed
* with the current page. The continuationToken value can be used as the value for
* with the current page. The NextMarker value can be used as the value for
* the marker parameter in a subsequent call to request the next page of list
* items. The marker value is opaque to the client.
* @param {ServiceFindBlobsByTagsSegmentOptions} [options={}] Options to find blobs by tags.
@@ -32146,7 +31983,7 @@ var BlobServiceClient = /** @class */ (function (_super) {
BlobServiceClient.prototype.findBlobsByTagsSegment = function (tagFilterSqlExpression, marker, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, e_9;
var _a, span, spanOptions, e_8;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -32163,12 +32000,12 @@ var BlobServiceClient = /** @class */ (function (_super) {
})];
case 2: return [2 /*return*/, _b.sent()];
case 3:
e_9 = _b.sent();
e_8 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_9.message
message: e_8.message
});
throw e_9;
throw e_8;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -32187,9 +32024,9 @@ var BlobServiceClient = /** @class */ (function (_super) {
* however, only a subset of the OData filter syntax is supported in the Blob service.
* @param {string} [marker] A string value that identifies the portion of
* the list of blobs to be returned with the next listing operation. The
* operation returns the continuationToken value within the response body if the
* operation returns the NextMarker value within the response body if the
* listing operation did not return all blobs remaining to be listed
* with the current page. The continuationToken value can be used as the value for
* with the current page. The NextMarker value can be used as the value for
* the marker parameter in a subsequent call to request the next page of list
* items. The marker value is opaque to the client.
* @param {ServiceFindBlobsByTagsSegmentOptions} [options={}] Options to find blobs by tags.
@@ -32238,8 +32075,8 @@ var BlobServiceClient = /** @class */ (function (_super) {
BlobServiceClient.prototype.findBlobsByTagsItems = function (tagFilterSqlExpression, options) {
if (options === void 0) { options = {}; }
return tslib.__asyncGenerator(this, arguments, function findBlobsByTagsItems_1() {
var marker, _a, _b, segment, e_10_1;
var e_10, _c;
var marker, _a, _b, segment, e_9_1;
var e_9, _c;
return tslib.__generator(this, function (_d) {
switch (_d.label) {
case 0:
@@ -32258,8 +32095,8 @@ var BlobServiceClient = /** @class */ (function (_super) {
case 5: return [3 /*break*/, 1];
case 6: return [3 /*break*/, 13];
case 7:
e_10_1 = _d.sent();
e_10 = { error: e_10_1 };
e_9_1 = _d.sent();
e_9 = { error: e_9_1 };
return [3 /*break*/, 13];
case 8:
_d.trys.push([8, , 11, 12]);
@@ -32270,7 +32107,7 @@ var BlobServiceClient = /** @class */ (function (_super) {
_d.label = 10;
case 10: return [3 /*break*/, 12];
case 11:
if (e_10) throw e_10.error;
if (e_9) throw e_9.error;
return [7 /*endfinally*/];
case 12: return [7 /*endfinally*/];
case 13: return [2 /*return*/];
@@ -32395,9 +32232,9 @@ var BlobServiceClient = /** @class */ (function (_super) {
* @private
* @param {string} [marker] A string value that identifies the portion of
* the list of containers to be returned with the next listing operation. The
* operation returns the continuationToken value within the response body if the
* operation returns the NextMarker value within the response body if the
* listing operation did not return all containers remaining to be listed
* with the current page. The continuationToken value can be used as the value for
* with the current page. The NextMarker value can be used as the value for
* the marker parameter in a subsequent call to request the next page of list
* items. The marker value is opaque to the client.
* @param {ServiceListContainersSegmentOptions} [options] Options to list containers operation.
@@ -32444,8 +32281,8 @@ var BlobServiceClient = /** @class */ (function (_super) {
BlobServiceClient.prototype.listItems = function (options) {
if (options === void 0) { options = {}; }
return tslib.__asyncGenerator(this, arguments, function listItems_1() {
var marker, _a, _b, segment, e_11_1;
var e_11, _c;
var marker, _a, _b, segment, e_10_1;
var e_10, _c;
return tslib.__generator(this, function (_d) {
switch (_d.label) {
case 0:
@@ -32464,8 +32301,8 @@ var BlobServiceClient = /** @class */ (function (_super) {
case 5: return [3 /*break*/, 1];
case 6: return [3 /*break*/, 13];
case 7:
e_11_1 = _d.sent();
e_11 = { error: e_11_1 };
e_10_1 = _d.sent();
e_10 = { error: e_10_1 };
return [3 /*break*/, 13];
case 8:
_d.trys.push([8, , 11, 12]);
@@ -32476,7 +32313,7 @@ var BlobServiceClient = /** @class */ (function (_super) {
_d.label = 10;
case 10: return [3 /*break*/, 12];
case 11:
if (e_11) throw e_11.error;
if (e_10) throw e_10.error;
return [7 /*endfinally*/];
case 12: return [7 /*endfinally*/];
case 13: return [2 /*return*/];
@@ -32566,15 +32403,8 @@ var BlobServiceClient = /** @class */ (function (_super) {
if (options.prefix === "") {
options.prefix = undefined;
}
var include = [];
if (options.includeDeleted) {
include.push("deleted");
}
if (options.includeMetadata) {
include.push("metadata");
}
// AsyncIterableIterator to iterate over containers
var listSegmentOptions = tslib.__assign(tslib.__assign({}, options), (include.length > 0 ? { include: include } : {}));
var listSegmentOptions = tslib.__assign(tslib.__assign({}, options), (options.includeMetadata ? { include: "metadata" } : {}));
var iter = this.listItems(listSegmentOptions);
return _a = {
/**
@@ -32615,7 +32445,7 @@ var BlobServiceClient = /** @class */ (function (_super) {
BlobServiceClient.prototype.getUserDelegationKey = function (startsOn, expiresOn, options) {
if (options === void 0) { options = {}; }
return tslib.__awaiter(this, void 0, void 0, function () {
var _a, span, spanOptions, response, userDelegationKey, res, e_12;
var _a, span, spanOptions, response, userDelegationKey, res, e_11;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
@@ -32644,12 +32474,12 @@ var BlobServiceClient = /** @class */ (function (_super) {
res = tslib.__assign({ _response: response._response, requestId: response.requestId, clientRequestId: response.clientRequestId, version: response.version, date: response.date, errorCode: response.errorCode }, userDelegationKey);
return [2 /*return*/, res];
case 3:
e_12 = _b.sent();
e_11 = _b.sent();
span.setStatus({
code: api.CanonicalCode.UNKNOWN,
message: e_12.message
message: e_11.message
});
throw e_12;
throw e_11;
case 4:
span.end();
return [7 /*endfinally*/];
@@ -33105,61 +32935,52 @@ function ipRangeToString(ipRange) {
* @class SASQueryParameters
*/
var SASQueryParameters = /** @class */ (function () {
function SASQueryParameters(version, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, userDelegationKey, preauthorizedAgentObjectId, correlationId) {
/**
* Creates an instance of SASQueryParameters.
*
* @param {string} version Representing the storage version
* @param {string} signature Representing the signature for the SAS token
* @param {string} [permissions] Representing the storage permissions
* @param {string} [services] Representing the storage services being accessed (only for Account SAS)
* @param {string} [resourceTypes] Representing the storage resource types being accessed (only for Account SAS)
* @param {SASProtocol} [protocol] Representing the allowed HTTP protocol(s)
* @param {Date} [startsOn] Representing the start time for this SAS token
* @param {Date} [expiresOn] Representing the expiry time for this SAS token
* @param {SasIPRange} [ipRange] Representing the range of valid IP addresses for this SAS token
* @param {string} [identifier] Representing the signed identifier (only for Service SAS)
* @param {string} [resource] Representing the storage container or blob (only for Service SAS)
* @param {string} [cacheControl] Representing the cache-control header (only for Blob/File Service SAS)
* @param {string} [contentDisposition] Representing the content-disposition header (only for Blob/File Service SAS)
* @param {string} [contentEncoding] Representing the content-encoding header (only for Blob/File Service SAS)
* @param {string} [contentLanguage] Representing the content-language header (only for Blob/File Service SAS)
* @param {string} [contentType] Representing the content-type header (only for Blob/File Service SAS)
* @param {userDelegationKey} [userDelegationKey] Representing the user delegation key properties
* @memberof SASQueryParameters
*/
function SASQueryParameters(version, signature, permissions, services, resourceTypes, protocol, startsOn, expiresOn, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, userDelegationKey) {
this.version = version;
this.services = services;
this.resourceTypes = resourceTypes;
this.expiresOn = expiresOn;
this.permissions = permissions;
this.protocol = protocol;
this.startsOn = startsOn;
this.ipRangeInner = ipRange;
this.identifier = identifier;
this.resource = resource;
this.signature = signature;
if (permissionsOrOptions !== undefined && typeof permissionsOrOptions !== "string") {
// SASQueryParametersOptions
this.permissions = permissionsOrOptions.permissions;
this.services = permissionsOrOptions.services;
this.resourceTypes = permissionsOrOptions.resourceTypes;
this.protocol = permissionsOrOptions.protocol;
this.startsOn = permissionsOrOptions.startsOn;
this.expiresOn = permissionsOrOptions.expiresOn;
this.ipRangeInner = permissionsOrOptions.ipRange;
this.identifier = permissionsOrOptions.identifier;
this.resource = permissionsOrOptions.resource;
this.cacheControl = permissionsOrOptions.cacheControl;
this.contentDisposition = permissionsOrOptions.contentDisposition;
this.contentEncoding = permissionsOrOptions.contentEncoding;
this.contentLanguage = permissionsOrOptions.contentLanguage;
this.contentType = permissionsOrOptions.contentType;
if (permissionsOrOptions.userDelegationKey) {
this.signedOid = permissionsOrOptions.userDelegationKey.signedObjectId;
this.signedTenantId = permissionsOrOptions.userDelegationKey.signedTenantId;
this.signedStartsOn = permissionsOrOptions.userDelegationKey.signedStartsOn;
this.signedExpiresOn = permissionsOrOptions.userDelegationKey.signedExpiresOn;
this.signedService = permissionsOrOptions.userDelegationKey.signedService;
this.signedVersion = permissionsOrOptions.userDelegationKey.signedVersion;
this.preauthorizedAgentObjectId = permissionsOrOptions.preauthorizedAgentObjectId;
this.correlationId = permissionsOrOptions.correlationId;
}
}
else {
this.services = services;
this.resourceTypes = resourceTypes;
this.expiresOn = expiresOn;
this.permissions = permissionsOrOptions;
this.protocol = protocol;
this.startsOn = startsOn;
this.ipRangeInner = ipRange;
this.identifier = identifier;
this.resource = resource;
this.cacheControl = cacheControl;
this.contentDisposition = contentDisposition;
this.contentEncoding = contentEncoding;
this.contentLanguage = contentLanguage;
this.contentType = contentType;
if (userDelegationKey) {
this.signedOid = userDelegationKey.signedObjectId;
this.signedTenantId = userDelegationKey.signedTenantId;
this.signedStartsOn = userDelegationKey.signedStartsOn;
this.signedExpiresOn = userDelegationKey.signedExpiresOn;
this.signedService = userDelegationKey.signedService;
this.signedVersion = userDelegationKey.signedVersion;
this.preauthorizedAgentObjectId = preauthorizedAgentObjectId;
this.correlationId = correlationId;
}
this.cacheControl = cacheControl;
this.contentDisposition = contentDisposition;
this.contentEncoding = contentEncoding;
this.contentLanguage = contentLanguage;
this.contentType = contentType;
if (userDelegationKey) {
this.signedOid = userDelegationKey.signedObjectId;
this.signedTenantId = userDelegationKey.signedTenantId;
this.signedStartsOn = userDelegationKey.signedStartsOn;
this.signedExpiresOn = userDelegationKey.signedExpiresOn;
this.signedService = userDelegationKey.signedService;
this.signedVersion = userDelegationKey.signedVersion;
}
}
Object.defineProperty(SASQueryParameters.prototype, "ipRange", {
@@ -33211,9 +33032,7 @@ var SASQueryParameters = /** @class */ (function () {
"rscd",
"rsce",
"rscl",
"rsct",
"saoid",
"scid"
"rsct"
];
var queries = [];
for (var _i = 0, params_1 = params; _i < params_1.length; _i++) {
@@ -33285,12 +33104,6 @@ var SASQueryParameters = /** @class */ (function () {
case "rsct":
this.tryAppendQueryParameter(queries, param, this.contentType);
break;
case "saoid":
this.tryAppendQueryParameter(queries, param, this.preauthorizedAgentObjectId);
break;
case "scid":
this.tryAppendQueryParameter(queries, param, this.correlationId);
break;
}
}
return queries.join("&");
@@ -33437,20 +33250,6 @@ var BlobSASPermissions = /** @class */ (function () {
* @memberof BlobSASPermissions
*/
this.tag = false;
/**
* Specifies Move access granted.
*
* @type {boolean}
* @memberof BlobSASPermissions
*/
this.move = false;
/**
* Specifies Execute access granted.
*
* @type {boolean}
* @memberof BlobSASPermissions
*/
this.execute = false;
}
/**
* Creates a {@link BlobSASPermissions} from the specified permissions string. This method will throw an
@@ -33487,12 +33286,6 @@ var BlobSASPermissions = /** @class */ (function () {
case "t":
blobSASPermissions.tag = true;
break;
case "m":
blobSASPermissions.move = true;
break;
case "e":
blobSASPermissions.execute = true;
break;
default:
throw new RangeError("Invalid permission: " + char);
}
@@ -33529,12 +33322,6 @@ var BlobSASPermissions = /** @class */ (function () {
if (this.tag) {
permissions.push("t");
}
if (this.move) {
permissions.push("m");
}
if (this.execute) {
permissions.push("e");
}
return permissions.join("");
};
return BlobSASPermissions;
@@ -33610,20 +33397,6 @@ var ContainerSASPermissions = /** @class */ (function () {
* @memberof ContainerSASPermissions
*/
this.tag = false;
/**
* Specifies Move access granted.
*
* @type {boolean}
* @memberof ContainerSASPermissions
*/
this.move = false;
/**
* Specifies Execute access granted.
*
* @type {boolean}
* @memberof ContainerSASPermissions
*/
this.execute = false;
}
/**
* Creates an {@link ContainerSASPermissions} from the specified permissions string. This method will throw an
@@ -33663,12 +33436,6 @@ var ContainerSASPermissions = /** @class */ (function () {
case "x":
containerSASPermissions.deleteVersion = true;
break;
case "m":
containerSASPermissions.move = true;
break;
case "e":
containerSASPermissions.execute = true;
break;
default:
throw new RangeError("Invalid permission " + char);
}
@@ -33711,12 +33478,6 @@ var ContainerSASPermissions = /** @class */ (function () {
if (this.tag) {
permissions.push("t");
}
if (this.move) {
permissions.push("m");
}
if (this.execute) {
permissions.push("e");
}
return permissions.join("");
};
return ContainerSASPermissions;
@@ -33780,13 +33541,7 @@ function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredent
return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential);
}
else {
// Version 2020-02-10 delegation SAS signature construction includes preauthorizedAgentObjectId, agentObjectId, correlationId.
if (version >= "2020-02-10") {
return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential);
}
else {
return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential);
}
return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential);
}
}
if (version >= "2015-04-05") {
@@ -33817,18 +33572,34 @@ function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredent
* @returns {SASQueryParameters}
*/
function generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKeyCredential) {
blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);
if (!blobSASSignatureValues.identifier &&
!blobSASSignatureValues.permissions &&
!blobSASSignatureValues.expiresOn) {
throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.");
}
var version = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION;
var resource = "c";
var verifiedPermissions;
if (blobSASSignatureValues.snapshotTime) {
throw RangeError("'version' must be >= '2018-11-09' when provided 'snapshotTime'.");
}
if (blobSASSignatureValues.versionId) {
throw RangeError("'version' must be >= '2019-10-10' when provided 'versionId'.");
}
if (blobSASSignatureValues.permissions &&
blobSASSignatureValues.permissions.deleteVersion &&
version < "2019-10-10") {
throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission.");
}
if (blobSASSignatureValues.permissions &&
blobSASSignatureValues.permissions.tag &&
version < "2019-12-12") {
throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission.");
}
if (blobSASSignatureValues.blobName) {
resource = "b";
}
// Calling parse and toString guarantees the proper ordering and throws on invalid characters.
var verifiedPermissions;
if (blobSASSignatureValues.permissions) {
if (blobSASSignatureValues.blobName) {
verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
@@ -33850,7 +33621,7 @@ function generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKe
blobSASSignatureValues.identifier,
blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "",
blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
blobSASSignatureValues.version,
version,
blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "",
blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "",
blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "",
@@ -33858,7 +33629,7 @@ function generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKe
blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : ""
].join("\n");
var signature = sharedKeyCredential.computeHMACSHA256(stringToSign);
return new 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);
return new SASQueryParameters(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);
}
/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
@@ -33878,13 +33649,33 @@ function generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKe
* @returns {SASQueryParameters}
*/
function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential) {
blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);
if (!blobSASSignatureValues.identifier &&
!blobSASSignatureValues.permissions &&
!blobSASSignatureValues.expiresOn) {
throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.");
}
var version = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION;
var resource = "c";
var verifiedPermissions;
if (blobSASSignatureValues.versionId && version < "2019-10-10") {
throw RangeError("'version' must be >= '2019-10-10' when provided 'versionId'.");
}
if (blobSASSignatureValues.permissions &&
blobSASSignatureValues.permissions.deleteVersion &&
version < "2019-10-10") {
throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission.");
}
if (blobSASSignatureValues.permissions &&
blobSASSignatureValues.permissions.tag &&
version < "2019-12-12") {
throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission.");
}
if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.snapshotTime) {
throw RangeError("Must provide 'blobName' when provided 'snapshotTime'.");
}
if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.versionId) {
throw RangeError("Must provide 'blobName' when provided 'versionId'.");
}
var timestamp = blobSASSignatureValues.snapshotTime;
if (blobSASSignatureValues.blobName) {
resource = "b";
@@ -33897,7 +33688,6 @@ function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKe
}
}
// Calling parse and toString guarantees the proper ordering and throws on invalid characters.
var verifiedPermissions;
if (blobSASSignatureValues.permissions) {
if (blobSASSignatureValues.blobName) {
verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
@@ -33919,7 +33709,7 @@ function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKe
blobSASSignatureValues.identifier,
blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "",
blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
blobSASSignatureValues.version,
version,
resource,
timestamp,
blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "",
@@ -33929,7 +33719,7 @@ function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKe
blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : ""
].join("\n");
var signature = sharedKeyCredential.computeHMACSHA256(stringToSign);
return new 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);
return new SASQueryParameters(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);
}
/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
@@ -33938,7 +33728,7 @@ function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKe
* Creates an instance of SASQueryParameters.
*
* Only accepts required settings needed to create a SAS. For optional settings please
* set corresponding properties directly, such as permissions, startsOn.
* set corresponding properties directly, such as permissions, startsOn and identifier.
*
* WARNING: identifier will be ignored, permissions and expiresOn are required.
*
@@ -33947,12 +33737,31 @@ function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKe
* @returns {SASQueryParameters}
*/
function generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential) {
blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);
// Stored access policies are not supported for a user delegation SAS.
if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) {
throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.");
}
var version = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION;
if (blobSASSignatureValues.versionId && version < "2019-10-10") {
throw RangeError("'version' must be >= '2019-10-10' when provided 'versionId'.");
}
if (blobSASSignatureValues.permissions &&
blobSASSignatureValues.permissions.deleteVersion &&
version < "2019-10-10") {
throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission.");
}
if (blobSASSignatureValues.permissions &&
blobSASSignatureValues.permissions.tag &&
version < "2019-12-12") {
throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission.");
}
var resource = "c";
var verifiedPermissions;
if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.snapshotTime) {
throw RangeError("Must provide 'blobName' when provided 'snapshotTime'.");
}
if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.versionId) {
throw RangeError("Must provide 'blobName' when provided 'versionId'.");
}
var timestamp = blobSASSignatureValues.snapshotTime;
if (blobSASSignatureValues.blobName) {
resource = "b";
@@ -33965,7 +33774,6 @@ function generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userD
}
}
// Calling parse and toString guarantees the proper ordering and throws on invalid characters.
var verifiedPermissions;
if (blobSASSignatureValues.permissions) {
if (blobSASSignatureValues.blobName) {
verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
@@ -33996,7 +33804,7 @@ function generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userD
userDelegationKeyCredential.userDelegationKey.signedVersion,
blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "",
blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
blobSASSignatureValues.version,
version,
resource,
timestamp,
blobSASSignatureValues.cacheControl,
@@ -34006,87 +33814,7 @@ function generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userD
blobSASSignatureValues.contentType
].join("\n");
var signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign);
return new 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);
}
/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
* IMPLEMENTATION FOR API VERSION FROM 2020-02-10.
*
* Creates an instance of SASQueryParameters.
*
* Only accepts required settings needed to create a SAS. For optional settings please
* set corresponding properties directly, such as permissions, startsOn.
*
* WARNING: identifier will be ignored, permissions and expiresOn are required.
*
* @param {BlobSASSignatureValues} blobSASSignatureValues
* @param {UserDelegationKeyCredential} userDelegationKeyCredential
* @returns {SASQueryParameters}
*/
function generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential) {
blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);
// Stored access policies are not supported for a user delegation SAS.
if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) {
throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.");
}
var resource = "c";
var timestamp = blobSASSignatureValues.snapshotTime;
if (blobSASSignatureValues.blobName) {
resource = "b";
if (blobSASSignatureValues.snapshotTime) {
resource = "bs";
}
else if (blobSASSignatureValues.versionId) {
resource = "bv";
timestamp = blobSASSignatureValues.versionId;
}
}
// Calling parse and toString guarantees the proper ordering and throws on invalid characters.
var verifiedPermissions;
if (blobSASSignatureValues.permissions) {
if (blobSASSignatureValues.blobName) {
verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
}
else {
verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();
}
}
// Signature is generated on the un-url-encoded values.
var stringToSign = [
verifiedPermissions ? verifiedPermissions : "",
blobSASSignatureValues.startsOn
? truncatedISO8061Date(blobSASSignatureValues.startsOn, false)
: "",
blobSASSignatureValues.expiresOn
? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)
: "",
getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),
userDelegationKeyCredential.userDelegationKey.signedObjectId,
userDelegationKeyCredential.userDelegationKey.signedTenantId,
userDelegationKeyCredential.userDelegationKey.signedStartsOn
? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false)
: "",
userDelegationKeyCredential.userDelegationKey.signedExpiresOn
? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false)
: "",
userDelegationKeyCredential.userDelegationKey.signedService,
userDelegationKeyCredential.userDelegationKey.signedVersion,
blobSASSignatureValues.preauthorizedAgentObjectId,
undefined,
blobSASSignatureValues.correlationId,
blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "",
blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
blobSASSignatureValues.version,
resource,
timestamp,
blobSASSignatureValues.cacheControl,
blobSASSignatureValues.contentDisposition,
blobSASSignatureValues.contentEncoding,
blobSASSignatureValues.contentLanguage,
blobSASSignatureValues.contentType
].join("\n");
var signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign);
return new 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);
return new SASQueryParameters(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);
}
function getCanonicalName(accountName, containerName, blobName) {
// Container: "/blob/account/containerName"
@@ -34097,42 +33825,6 @@ function getCanonicalName(accountName, containerName, blobName) {
}
return elements.join("");
}
function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) {
var version = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION;
if (blobSASSignatureValues.snapshotTime && version < "2018-11-09") {
throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'.");
}
if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.snapshotTime) {
throw RangeError("Must provide 'blobName' when providing 'snapshotTime'.");
}
if (blobSASSignatureValues.versionId && version < "2019-10-10") {
throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'.");
}
if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.versionId) {
throw RangeError("Must provide 'blobName' when providing 'versionId'.");
}
if (blobSASSignatureValues.permissions &&
blobSASSignatureValues.permissions.deleteVersion &&
version < "2019-10-10") {
throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission.");
}
if (blobSASSignatureValues.permissions &&
blobSASSignatureValues.permissions.tag &&
version < "2019-12-12") {
throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission.");
}
if (version < "2020-02-10" &&
blobSASSignatureValues.permissions &&
(blobSASSignatureValues.permissions.move || blobSASSignatureValues.permissions.execute)) {
throw RangeError("'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission.");
}
if (version < "2020-02-10" &&
(blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) {
throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'.");
}
blobSASSignatureValues.version = version;
return blobSASSignatureValues;
}
Object.defineProperty(exports, 'BaseRequestPolicy', {
enumerable: true,
@@ -34219,20 +33911,10 @@ exports.newPipeline = newPipeline;
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const path = __importStar(__webpack_require__(622));
const pathHelper = __importStar(__webpack_require__(972));
const assert_1 = __importDefault(__webpack_require__(357));
const assert = __webpack_require__(357);
const path = __webpack_require__(622);
const pathHelper = __webpack_require__(972);
const IS_WINDOWS = process.platform === 'win32';
/**
* Helper class for parsing paths into segments
@@ -34246,7 +33928,7 @@ class Path {
this.segments = [];
// String
if (typeof itemPath === 'string') {
assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`);
assert(itemPath, `Parameter 'itemPath' must not be empty`);
// Normalize slashes and trim unnecessary trailing slash
itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);
// Not rooted
@@ -34273,24 +33955,24 @@ class Path {
// Array
else {
// Must not be empty
assert_1.default(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`);
assert(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`);
// Each segment
for (let i = 0; i < itemPath.length; i++) {
let segment = itemPath[i];
// Must not be empty
assert_1.default(segment, `Parameter 'itemPath' must not contain any empty segments`);
assert(segment, `Parameter 'itemPath' must not contain any empty segments`);
// Normalize slashes
segment = pathHelper.normalizeSeparators(itemPath[i]);
// Root segment
if (i === 0 && pathHelper.hasRoot(segment)) {
segment = pathHelper.safeTrimTrailingSeparator(segment);
assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`);
assert(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`);
this.segments.push(segment);
}
// All other segments
else {
// Must not contain slash
assert_1.default(!segment.includes(path.sep), `Parameter 'itemPath' contains unexpected path separators`);
assert(!segment.includes(path.sep), `Parameter 'itemPath' contains unexpected path separators`);
this.segments.push(segment);
}
}
@@ -36839,7 +36521,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
};
Object.defineProperty(exports, "__esModule", { value: true });
const os = __importStar(__webpack_require__(87));
const utils_1 = __webpack_require__(82);
/**
* Commands
*
@@ -36893,14 +36574,28 @@ class Command {
return cmdStr;
}
}
/**
* Sanitizes an input into a string so it can be passed into issueCommand safely
* @param input input to sanitize into a string
*/
function toCommandValue(input) {
if (input === null || input === undefined) {
return '';
}
else if (typeof input === 'string' || input instanceof String) {
return input;
}
return JSON.stringify(input);
}
exports.toCommandValue = toCommandValue;
function escapeData(s) {
return utils_1.toCommandValue(s)
return toCommandValue(s)
.replace(/%/g, '%25')
.replace(/\r/g, '%0D')
.replace(/\n/g, '%0A');
}
function escapeProperty(s) {
return utils_1.toCommandValue(s)
return toCommandValue(s)
.replace(/%/g, '%25')
.replace(/\r/g, '%0D')
.replace(/\n/g, '%0A')
@@ -39272,8 +38967,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
};
Object.defineProperty(exports, "__esModule", { value: true });
const command_1 = __webpack_require__(431);
const file_command_1 = __webpack_require__(102);
const utils_1 = __webpack_require__(82);
const os = __importStar(__webpack_require__(87));
const path = __importStar(__webpack_require__(622));
/**
@@ -39300,17 +38993,9 @@ var ExitCode;
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function exportVariable(name, val) {
const convertedVal = utils_1.toCommandValue(val);
const convertedVal = command_1.toCommandValue(val);
process.env[name] = convertedVal;
const filePath = process.env['GITHUB_ENV'] || '';
if (filePath) {
const delimiter = '_GitHubActionsFileCommandDelimeter_';
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
file_command_1.issueCommand('ENV', commandValue);
}
else {
command_1.issueCommand('set-env', { name }, convertedVal);
}
command_1.issueCommand('set-env', { name }, convertedVal);
}
exports.exportVariable = exportVariable;
/**
@@ -39326,13 +39011,7 @@ exports.setSecret = setSecret;
* @param inputPath
*/
function addPath(inputPath) {
const filePath = process.env['GITHUB_PATH'] || '';
if (filePath) {
file_command_1.issueCommand('PATH', inputPath);
}
else {
command_1.issueCommand('add-path', {}, inputPath);
}
command_1.issueCommand('add-path', {}, inputPath);
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
}
exports.addPath = addPath;
@@ -41464,15 +41143,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const pathHelper = __importStar(__webpack_require__(972));
const pathHelper = __webpack_require__(972);
const internal_match_kind_1 = __webpack_require__(327);
const IS_WINDOWS = process.platform === 'win32';
/**
@@ -41554,15 +41226,8 @@ exports.partialMatch = partialMatch;
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(__webpack_require__(470));
const core = __webpack_require__(470);
/**
* Returns a copy with defaults filled in.
*/
@@ -45799,7 +45464,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(__webpack_require__(145), exports);
__exportStar(__webpack_require__(102), exports);
//# sourceMappingURL=index.js.map
/***/ }),
@@ -49892,27 +49557,17 @@ __exportStar(__webpack_require__(764), exports);
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const os = __importStar(__webpack_require__(87));
const path = __importStar(__webpack_require__(622));
const pathHelper = __importStar(__webpack_require__(972));
const assert_1 = __importDefault(__webpack_require__(357));
const assert = __webpack_require__(357);
const os = __webpack_require__(87);
const path = __webpack_require__(622);
const pathHelper = __webpack_require__(972);
const minimatch_1 = __webpack_require__(93);
const internal_match_kind_1 = __webpack_require__(327);
const internal_path_1 = __webpack_require__(383);
const IS_WINDOWS = process.platform === 'win32';
class Pattern {
constructor(patternOrNegate, segments, homedir) {
constructor(patternOrNegate, segments) {
/**
* Indicates whether matches should be excluded from the result set
*/
@@ -49926,9 +49581,9 @@ class Pattern {
else {
// Convert to pattern
segments = segments || [];
assert_1.default(segments.length, `Parameter 'segments' must not empty`);
assert(segments.length, `Parameter 'segments' must not empty`);
const root = Pattern.getLiteral(segments[0]);
assert_1.default(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`);
assert(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`);
pattern = new internal_path_1.Path(segments).toString().trim();
if (patternOrNegate) {
pattern = `!${pattern}`;
@@ -49940,7 +49595,7 @@ class Pattern {
pattern = pattern.substr(1).trim();
}
// Normalize slashes and ensures absolute root
pattern = Pattern.fixupPattern(pattern, homedir);
pattern = Pattern.fixupPattern(pattern);
// Segments
this.segments = new internal_path_1.Path(pattern).segments;
// Trailing slash indicates the pattern should only match directories, not regular files
@@ -49977,11 +49632,11 @@ class Pattern {
// Normalize slashes
itemPath = pathHelper.normalizeSeparators(itemPath);
// Append a trailing slash. Otherwise Minimatch will not match the directory immediately
// preceding the globstar. For example, given the pattern `/foo/**`, Minimatch returns
// preceeding the globstar. For example, given the pattern `/foo/**`, Minimatch returns
// false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk.
if (!itemPath.endsWith(path.sep)) {
// Note, this is safe because the constructor ensures the pattern has an absolute root.
// For example, formats like C: and C:foo on Windows are resolved to an absolute root.
// For example, formats like C: and C:foo on Windows are resolved to an aboslute root.
itemPath = `${itemPath}${path.sep}`;
}
}
@@ -50019,15 +49674,15 @@ class Pattern {
/**
* Normalizes slashes and ensures absolute root
*/
static fixupPattern(pattern, homedir) {
static fixupPattern(pattern) {
// Empty
assert_1.default(pattern, 'pattern cannot be empty');
assert(pattern, 'pattern cannot be empty');
// Must not contain `.` segment, unless first segment
// Must not contain `..` segment
const literalSegments = new internal_path_1.Path(pattern).segments.map(x => Pattern.getLiteral(x));
assert_1.default(literalSegments.every((x, i) => (x !== '.' || i === 0) && x !== '..'), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`);
assert(literalSegments.every((x, i) => (x !== '.' || i === 0) && x !== '..'), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`);
// Must not contain globs in root, e.g. Windows UNC path \\foo\b*r
assert_1.default(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`);
assert(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`);
// Normalize slashes
pattern = pathHelper.normalizeSeparators(pattern);
// Replace leading `.` segment
@@ -50036,9 +49691,9 @@ class Pattern {
}
// Replace leading `~` segment
else if (pattern === '~' || pattern.startsWith(`~${path.sep}`)) {
homedir = homedir || os.homedir();
assert_1.default(homedir, 'Unable to determine HOME directory');
assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`);
const homedir = os.homedir();
assert(homedir, 'Unable to determine HOME directory');
assert(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`);
pattern = Pattern.globEscape(homedir) + pattern.substr(1);
}
// Replace relative drive root, e.g. pattern is C: or C:foo
@@ -50827,19 +50482,9 @@ exports.checkBypass = checkBypass;
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const path = __importStar(__webpack_require__(622));
const assert_1 = __importDefault(__webpack_require__(357));
const assert = __webpack_require__(357);
const path = __webpack_require__(622);
const IS_WINDOWS = process.platform === 'win32';
/**
* Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths.
@@ -50879,8 +50524,8 @@ exports.dirname = dirname;
* or `C:` are expanded based on the current working directory.
*/
function ensureAbsoluteRoot(root, itemPath) {
assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`);
assert_1.default(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`);
assert(root, `ensureAbsoluteRoot parameter 'root' must not be empty`);
assert(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`);
// Already rooted
if (hasAbsoluteRoot(itemPath)) {
return itemPath;
@@ -50890,7 +50535,7 @@ function ensureAbsoluteRoot(root, itemPath) {
// Check for itemPath like C: or C:foo
if (itemPath.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)) {
let cwd = process.cwd();
assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);
assert(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);
// Drive letter matches cwd? Expand to cwd
if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) {
// Drive only, e.g. C:
@@ -50915,11 +50560,11 @@ function ensureAbsoluteRoot(root, itemPath) {
// Check for itemPath like \ or \foo
else if (normalizeSeparators(itemPath).match(/^\\$|^\\[^\\]/)) {
const cwd = process.cwd();
assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);
assert(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);
return `${cwd[0]}:\\${itemPath.substr(1)}`;
}
}
assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`);
assert(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`);
// Otherwise ensure root ends with a separator
if (root.endsWith('/') || (IS_WINDOWS && root.endsWith('\\'))) {
// Intentionally empty
@@ -50936,7 +50581,7 @@ exports.ensureAbsoluteRoot = ensureAbsoluteRoot;
* `\\hello\share` and `C:\hello` (and using alternate separator).
*/
function hasAbsoluteRoot(itemPath) {
assert_1.default(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`);
assert(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`);
// Normalize separators
itemPath = normalizeSeparators(itemPath);
// Windows
@@ -50953,7 +50598,7 @@ exports.hasAbsoluteRoot = hasAbsoluteRoot;
* `\`, `\hello`, `\\hello\share`, `C:`, and `C:\hello` (and using alternate separator).
*/
function hasRoot(itemPath) {
assert_1.default(itemPath, `isRooted parameter 'itemPath' must not be empty`);
assert(itemPath, `isRooted parameter 'itemPath' must not be empty`);
// Normalize separators
itemPath = normalizeSeparators(itemPath);
// Windows
@@ -51234,7 +50879,6 @@ var node_fetch = _interopDefault(__webpack_require__(454));
var abortController = __webpack_require__(106);
var FormData = _interopDefault(__webpack_require__(790));
var util = __webpack_require__(669);
var url = __webpack_require__(835);
var stream = __webpack_require__(794);
var tunnel = __webpack_require__(413);
var coreAuth = __webpack_require__(229);
@@ -51418,7 +51062,7 @@ var Constants = {
* @const
* @type {string}
*/
coreHttpVersion: "1.2.1",
coreHttpVersion: "1.1.9",
/**
* Specifies HTTP.
*
@@ -51512,17 +51156,6 @@ var Constants = {
}
};
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
/**
* Default key used to access the XML attributes.
*/
var XML_ATTRKEY = "$";
/**
* Default key used to access the XML value content.
*/
var XML_CHARKEY = "_";
// Copyright (c) Microsoft Corporation.
var validUuidRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/i;
/**
@@ -51670,9 +51303,7 @@ function prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) {
if (!xmlNamespaceKey || !xmlNamespace) {
return _a = {}, _a[elementName] = obj, _a;
}
var result = (_b = {}, _b[elementName] = obj, _b);
result[XML_ATTRKEY] = (_c = {}, _c[xmlNamespaceKey] = xmlNamespace, _c);
return result;
return _b = {}, _b[elementName] = obj, _b.$ = (_c = {}, _c[xmlNamespaceKey] = xmlNamespace, _c), _b;
}
/**
* Applies the properties on the prototype of sourceCtors to the prototype of targetCtor
@@ -51785,18 +51416,9 @@ var Serializer = /** @class */ (function () {
*
* @param {string} objectName Name of the serialized object
*
* @param {options} options additional options to deserialization
*
* @returns {object|string|Array|number|boolean|Date|stream} A valid serialized Javascript object
*/
Serializer.prototype.serialize = function (mapper, object, objectName, options) {
var _a, _b, _c;
if (options === void 0) { options = {}; }
var updatedOptions = {
rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "",
includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false,
xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY
};
Serializer.prototype.serialize = function (mapper, object, objectName) {
var payload = {};
var mapperType = mapper.type.name;
if (!objectName) {
@@ -51853,13 +51475,13 @@ var Serializer = /** @class */ (function () {
payload = serializeBase64UrlType(objectName, object);
}
else if (mapperType.match(/^Sequence$/i) !== null) {
payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions);
payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML));
}
else if (mapperType.match(/^Dictionary$/i) !== null) {
payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions);
payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML));
}
else if (mapperType.match(/^Composite$/i) !== null) {
payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions);
payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML));
}
}
return payload;
@@ -51873,18 +51495,9 @@ var Serializer = /** @class */ (function () {
*
* @param {string} objectName Name of the deserialized object
*
* @param options Controls behavior of XML parser and builder.
*
* @returns {object|string|Array|number|boolean|Date|stream} A valid deserialized Javascript object
*/
Serializer.prototype.deserialize = function (mapper, responseBody, objectName, options) {
var _a, _b, _c;
if (options === void 0) { options = {}; }
var updatedOptions = {
rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "",
includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false,
xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY
};
Serializer.prototype.deserialize = function (mapper, responseBody, objectName) {
if (responseBody == undefined) {
if (this.isXML && mapper.type.name === "Sequence" && !mapper.xmlIsWrapped) {
// Edge case for empty XML non-wrapped lists. xml2js can't distinguish
@@ -51904,18 +51517,17 @@ var Serializer = /** @class */ (function () {
objectName = mapper.serializedName;
}
if (mapperType.match(/^Composite$/i) !== null) {
payload = deserializeCompositeType(this, mapper, responseBody, objectName, updatedOptions);
payload = deserializeCompositeType(this, mapper, responseBody, objectName);
}
else {
if (this.isXML) {
var xmlCharKey = updatedOptions.xmlCharKey;
/**
* If the mapper specifies this as a non-composite type value but the responseBody contains
* both header ("$" i.e., XML_ATTRKEY) and body ("#" i.e., XML_CHARKEY) properties,
* then just reduce the responseBody value to the body ("#" i.e., XML_CHARKEY) property.
* both header ("$") and body ("_") properties, then just reduce the responseBody value to
* the body ("_") property.
*/
if (responseBody[XML_ATTRKEY] != undefined && responseBody[xmlCharKey] != undefined) {
responseBody = responseBody[xmlCharKey];
if (responseBody["$"] != undefined && responseBody["_"] != undefined) {
responseBody = responseBody["_"];
}
}
if (mapperType.match(/^Number$/i) !== null) {
@@ -51951,10 +51563,10 @@ var Serializer = /** @class */ (function () {
payload = base64UrlToByteArray(responseBody);
}
else if (mapperType.match(/^Sequence$/i) !== null) {
payload = deserializeSequenceType(this, mapper, responseBody, objectName, updatedOptions);
payload = deserializeSequenceType(this, mapper, responseBody, objectName);
}
else if (mapperType.match(/^Dictionary$/i) !== null) {
payload = deserializeDictionaryType(this, mapper, responseBody, objectName, updatedOptions);
payload = deserializeDictionaryType(this, mapper, responseBody, objectName);
}
}
if (mapper.isConstant) {
@@ -52059,7 +51671,7 @@ function serializeBasicTypes(typeName, objectName, value) {
objectType !== "function" &&
!(value instanceof ArrayBuffer) &&
!ArrayBuffer.isView(value) &&
!((typeof Blob === "function" || typeof Blob === "object") && value instanceof Blob)) {
!(typeof Blob === "function" && value instanceof Blob)) {
throw new Error(objectName + " must be a string, Blob, ArrayBuffer, ArrayBufferView, or a function returning NodeJS.ReadableStream.");
}
}
@@ -52143,7 +51755,7 @@ function serializeDateTypes(typeName, value, objectName) {
}
return value;
}
function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) {
function serializeSequenceType(serializer, mapper, object, objectName, isXml) {
var _a, _b;
if (!Array.isArray(object)) {
throw new Error(objectName + " must be of type Array.");
@@ -52155,19 +51767,16 @@ function serializeSequenceType(serializer, mapper, object, objectName, isXml, op
}
var tempArray = [];
for (var i = 0; i < object.length; i++) {
var serializedValue = serializer.serialize(elementType, object[i], objectName, options);
var serializedValue = serializer.serialize(elementType, object[i], objectName);
if (isXml && elementType.xmlNamespace) {
var xmlnsKey = elementType.xmlNamespacePrefix
? "xmlns:" + elementType.xmlNamespacePrefix
: "xmlns";
if (elementType.type.name === "Composite") {
tempArray[i] = tslib.__assign({}, serializedValue);
tempArray[i][XML_ATTRKEY] = (_a = {}, _a[xmlnsKey] = elementType.xmlNamespace, _a);
tempArray[i] = tslib.__assign(tslib.__assign({}, serializedValue), { $: (_a = {}, _a[xmlnsKey] = elementType.xmlNamespace, _a) });
}
else {
tempArray[i] = {};
tempArray[i][options.xmlCharKey] = serializedValue;
tempArray[i][XML_ATTRKEY] = (_b = {}, _b[xmlnsKey] = elementType.xmlNamespace, _b);
tempArray[i] = { _: serializedValue, $: (_b = {}, _b[xmlnsKey] = elementType.xmlNamespace, _b) };
}
}
else {
@@ -52176,7 +51785,7 @@ function serializeSequenceType(serializer, mapper, object, objectName, isXml, op
}
return tempArray;
}
function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) {
function serializeDictionaryType(serializer, mapper, object, objectName, isXml) {
var _a;
if (typeof object !== "object") {
throw new Error(objectName + " must be of type object.");
@@ -52189,16 +51798,14 @@ function serializeDictionaryType(serializer, mapper, object, objectName, isXml,
var tempDictionary = {};
for (var _i = 0, _b = Object.keys(object); _i < _b.length; _i++) {
var key = _b[_i];
var serializedValue = serializer.serialize(valueType, object[key], objectName, options);
var serializedValue = serializer.serialize(valueType, object[key], objectName);
// If the element needs an XML namespace we need to add it within the $ property
tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options);
tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml);
}
// Add the namespace to the root element if needed
if (isXml && mapper.xmlNamespace) {
var xmlnsKey = mapper.xmlNamespacePrefix ? "xmlns:" + mapper.xmlNamespacePrefix : "xmlns";
var result = tempDictionary;
result[XML_ATTRKEY] = (_a = {}, _a[xmlnsKey] = mapper.xmlNamespace, _a);
return result;
return tslib.__assign(tslib.__assign({}, tempDictionary), { $: (_a = {}, _a[xmlnsKey] = mapper.xmlNamespace, _a) });
}
return tempDictionary;
}
@@ -52249,7 +51856,7 @@ function resolveModelProperties(serializer, mapper, objectName) {
}
return modelProps;
}
function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) {
function serializeCompositeType(serializer, mapper, object, objectName, isXml) {
var _a, _b;
if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) {
mapper = getPolymorphicMapper(serializer, mapper, object, "clientName");
@@ -52291,7 +51898,7 @@ function serializeCompositeType(serializer, mapper, object, objectName, isXml, o
var xmlnsKey = mapper.xmlNamespacePrefix
? "xmlns:" + mapper.xmlNamespacePrefix
: "xmlns";
parentObject[XML_ATTRKEY] = tslib.__assign(tslib.__assign({}, parentObject[XML_ATTRKEY]), (_a = {}, _a[xmlnsKey] = mapper.xmlNamespace, _a));
parentObject.$ = tslib.__assign(tslib.__assign({}, parentObject.$), (_a = {}, _a[xmlnsKey] = mapper.xmlNamespace, _a));
}
var propertyObjectName = propertyMapper.serializedName !== ""
? objectName + "." + propertyMapper.serializedName
@@ -52303,15 +51910,15 @@ function serializeCompositeType(serializer, mapper, object, objectName, isXml, o
toSerialize == undefined) {
toSerialize = mapper.serializedName;
}
var serializedValue = serializer.serialize(propertyMapper, toSerialize, propertyObjectName, options);
var serializedValue = serializer.serialize(propertyMapper, toSerialize, propertyObjectName);
if (serializedValue !== undefined && propName != undefined) {
var value = getXmlObjectValue(propertyMapper, serializedValue, isXml, options);
var value = getXmlObjectValue(propertyMapper, serializedValue, isXml);
if (isXml && propertyMapper.xmlIsAttribute) {
// XML_ATTRKEY, i.e., $ is the key attributes are kept under in xml2js.
// $ is the key attributes are kept under in xml2js.
// This keeps things simple while preventing name collision
// with names in user documents.
parentObject[XML_ATTRKEY] = parentObject[XML_ATTRKEY] || {};
parentObject[XML_ATTRKEY][propName] = serializedValue;
parentObject.$ = parentObject.$ || {};
parentObject.$[propName] = serializedValue;
}
else if (isXml && propertyMapper.xmlIsWrapped) {
parentObject[propName] = (_b = {}, _b[propertyMapper.xmlElementName] = value, _b);
@@ -52328,7 +51935,7 @@ function serializeCompositeType(serializer, mapper, object, objectName, isXml, o
var _loop_1 = function (clientPropName) {
var isAdditionalProperty = propNames.every(function (pn) { return pn !== clientPropName; });
if (isAdditionalProperty) {
payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options);
payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]');
}
};
for (var clientPropName in object) {
@@ -52339,7 +51946,7 @@ function serializeCompositeType(serializer, mapper, object, objectName, isXml, o
}
return object;
}
function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) {
function getXmlObjectValue(propertyMapper, serializedValue, isXml) {
var _a;
if (!isXml || !propertyMapper.xmlNamespace) {
return serializedValue;
@@ -52349,24 +51956,14 @@ function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) {
: "xmlns";
var xmlNamespace = (_a = {}, _a[xmlnsKey] = propertyMapper.xmlNamespace, _a);
if (["Composite"].includes(propertyMapper.type.name)) {
if (serializedValue[XML_ATTRKEY]) {
return serializedValue;
}
else {
var result_1 = tslib.__assign({}, serializedValue);
result_1[XML_ATTRKEY] = xmlNamespace;
return result_1;
}
return tslib.__assign({ $: xmlNamespace }, serializedValue);
}
var result = {};
result[options.xmlCharKey] = serializedValue;
result[XML_ATTRKEY] = xmlNamespace;
return result;
return { _: serializedValue, $: xmlNamespace };
}
function isSpecialXmlProperty(propertyName, options) {
return [XML_ATTRKEY, options.xmlCharKey].includes(propertyName);
function isSpecialXmlProperty(propertyName) {
return ["$", "_"].includes(propertyName);
}
function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) {
function deserializeCompositeType(serializer, mapper, responseBody, objectName) {
var _a;
if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) {
mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName");
@@ -52390,15 +51987,15 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName,
for (var _c = 0, _d = Object.keys(responseBody); _c < _d.length; _c++) {
var headerKey = _d[_c];
if (headerKey.startsWith(headerCollectionPrefix)) {
dictionary[headerKey.substring(headerCollectionPrefix.length)] = serializer.deserialize(propertyMapper.type.value, responseBody[headerKey], propertyObjectName, options);
dictionary[headerKey.substring(headerCollectionPrefix.length)] = serializer.deserialize(propertyMapper.type.value, responseBody[headerKey], propertyObjectName);
}
handledPropertyNames.push(headerKey);
}
instance[key] = dictionary;
}
else if (serializer.isXML) {
if (propertyMapper.xmlIsAttribute && responseBody[XML_ATTRKEY]) {
instance[key] = serializer.deserialize(propertyMapper, responseBody[XML_ATTRKEY][xmlName], propertyObjectName, options);
if (propertyMapper.xmlIsAttribute && responseBody.$) {
instance[key] = serializer.deserialize(propertyMapper, responseBody.$[xmlName], propertyObjectName);
}
else {
var propertyName = xmlElementName || xmlName || serializedName;
@@ -52419,11 +52016,11 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName,
*/
var wrapped = responseBody[xmlName];
var elementList = (_a = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _a !== void 0 ? _a : [];
instance[key] = serializer.deserialize(propertyMapper, elementList, propertyObjectName, options);
instance[key] = serializer.deserialize(propertyMapper, elementList, propertyObjectName);
}
else {
var property = responseBody[propertyName];
instance[key] = serializer.deserialize(propertyMapper, property, propertyObjectName, options);
instance[key] = serializer.deserialize(propertyMapper, property, propertyObjectName);
}
}
}
@@ -52458,10 +52055,10 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName,
// paging
if (Array.isArray(responseBody[key]) && modelProps[key].serializedName === "") {
propertyInstance = responseBody[key];
instance = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options);
instance = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName);
}
else if (propertyInstance !== undefined || propertyMapper.defaultValue !== undefined) {
serializedValue = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options);
serializedValue = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName);
instance[key] = serializedValue;
}
}
@@ -52479,7 +52076,7 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName,
};
for (var responsePropName in responseBody) {
if (isAdditionalProperty(responsePropName)) {
instance[responsePropName] = serializer.deserialize(additionalPropertiesMapper, responseBody[responsePropName], objectName + '["' + responsePropName + '"]', options);
instance[responsePropName] = serializer.deserialize(additionalPropertiesMapper, responseBody[responsePropName], objectName + '["' + responsePropName + '"]');
}
}
}
@@ -52488,14 +52085,14 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName,
var key = _g[_f];
if (instance[key] === undefined &&
!handledPropertyNames.includes(key) &&
!isSpecialXmlProperty(key, options)) {
!isSpecialXmlProperty(key)) {
instance[key] = responseBody[key];
}
}
}
return instance;
}
function deserializeDictionaryType(serializer, mapper, responseBody, objectName, options) {
function deserializeDictionaryType(serializer, mapper, responseBody, objectName) {
var value = mapper.type.value;
if (!value || typeof value !== "object") {
throw new Error("\"value\" metadata for a Dictionary must be defined in the " +
@@ -52505,13 +52102,13 @@ function deserializeDictionaryType(serializer, mapper, responseBody, objectName,
var tempDictionary = {};
for (var _i = 0, _a = Object.keys(responseBody); _i < _a.length; _i++) {
var key = _a[_i];
tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options);
tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName);
}
return tempDictionary;
}
return responseBody;
}
function deserializeSequenceType(serializer, mapper, responseBody, objectName, options) {
function deserializeSequenceType(serializer, mapper, responseBody, objectName) {
var element = mapper.type.element;
if (!element || typeof element !== "object") {
throw new Error("element\" metadata for an Array must be defined in the " +
@@ -52524,7 +52121,7 @@ function deserializeSequenceType(serializer, mapper, responseBody, objectName, o
}
var tempArray = [];
for (var i = 0; i < responseBody.length; i++) {
tempArray[i] = serializer.deserialize(element, responseBody[i], objectName + "[" + i + "]", options);
tempArray[i] = serializer.deserialize(element, responseBody[i], objectName + "[" + i + "]");
}
return tempArray;
}
@@ -52825,7 +52422,7 @@ var WebResource = /** @class */ (function () {
if (!this.headers.get("Content-Type")) {
this.headers.set("Content-Type", "application/json; charset=utf-8");
}
// set the request body. request.js automatically sets the Content-Length request header, so we need not set it explicitly
// set the request body. request.js automatically sets the Content-Length request header, so we need not set it explicilty
this.body = options.body;
if (options.body !== undefined && options.body !== null) {
// body as a stream special case. set the body as-is and check for some special request headers specific to sending a stream.
@@ -53684,9 +53281,8 @@ var FetchHttpClient = /** @class */ (function () {
if (typeof value === "function") {
value = value();
}
if (value &&
Object.prototype.hasOwnProperty.call(value, "value") &&
Object.prototype.hasOwnProperty.call(value, "options")) {
// eslint-disable-next-line no-prototype-builtins
if (value && value.hasOwnProperty("value") && value.hasOwnProperty("options")) {
requestForm_1.append(key, value.value, value.options);
}
else {
@@ -53737,7 +53333,7 @@ var FetchHttpClient = /** @class */ (function () {
return [4 /*yield*/, this.prepareRequest(httpRequest)];
case 1:
platformSpecificRequestInit = _d.sent();
requestInit = tslib.__assign({ body: body, headers: httpRequest.headers.rawHeaders(), method: httpRequest.method, signal: abortController$1.signal, redirect: "manual" }, platformSpecificRequestInit);
requestInit = tslib.__assign({ body: body, headers: httpRequest.headers.rawHeaders(), method: httpRequest.method, signal: abortController$1.signal }, platformSpecificRequestInit);
_d.label = 2;
case 2:
_d.trys.push([2, 8, 9, 10]);
@@ -54217,12 +53813,13 @@ var xml2jsDefaultOptionsV2 = {
trim: false,
normalize: false,
normalizeTags: false,
attrkey: XML_ATTRKEY,
attrkey: "$",
charkey: "_",
explicitArray: true,
ignoreAttrs: false,
mergeAttrs: false,
explicitRoot: true,
validator: undefined,
validator: null,
xmlns: false,
explicitChildren: false,
preserveChildrenOrder: false,
@@ -54231,17 +53828,17 @@ var xml2jsDefaultOptionsV2 = {
includeWhiteChars: false,
async: false,
strict: true,
attrNameProcessors: undefined,
attrValueProcessors: undefined,
tagNameProcessors: undefined,
valueProcessors: undefined,
attrNameProcessors: null,
attrValueProcessors: null,
tagNameProcessors: null,
valueProcessors: null,
rootName: "root",
xmldec: {
version: "1.0",
encoding: "UTF-8",
standalone: true
},
doctype: undefined,
doctype: null,
renderOpts: {
pretty: true,
indent: " ",
@@ -54268,10 +53865,7 @@ xml2jsBuilderSettings.renderOpts = {
* `rootName` indicates the name of the root element in the resulting XML
*/
function stringifyXML(obj, opts) {
var _a;
if (opts === void 0) { opts = {}; }
xml2jsBuilderSettings.rootName = opts.rootName;
xml2jsBuilderSettings.charkey = (_a = opts.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY;
xml2jsBuilderSettings.rootName = (opts || {}).rootName;
var builder = new xml2js.Builder(xml2jsBuilderSettings);
return builder.buildObject(obj);
}
@@ -54282,10 +53876,7 @@ function stringifyXML(obj, opts) {
* `includeRoot` indicates whether the root element is to be included or not in the output
*/
function parseXML(str, opts) {
var _a;
if (opts === void 0) { opts = {}; }
xml2jsParserSettings.explicitRoot = !!opts.includeRoot;
xml2jsParserSettings.charkey = (_a = opts.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY;
xml2jsParserSettings.explicitRoot = !!(opts && opts.includeRoot);
var xmlParser = new xml2js.Parser(xml2jsParserSettings);
return new Promise(function (resolve, reject) {
if (!str) {
@@ -54309,10 +53900,10 @@ function parseXML(str, opts) {
* Create a new serialization RequestPolicyCreator that will serialized HTTP request bodies as they
* pass through the HTTP pipeline.
*/
function deserializationPolicy(deserializationContentTypes, parsingOptions) {
function deserializationPolicy(deserializationContentTypes) {
return {
create: function (nextPolicy, options) {
return new DeserializationPolicy(nextPolicy, options, deserializationContentTypes, parsingOptions);
return new DeserializationPolicy(nextPolicy, deserializationContentTypes, options);
}
};
}
@@ -54330,25 +53921,22 @@ var DefaultDeserializationOptions = {
*/
var DeserializationPolicy = /** @class */ (function (_super) {
tslib.__extends(DeserializationPolicy, _super);
function DeserializationPolicy(nextPolicy, requestPolicyOptions, deserializationContentTypes, parsingOptions) {
if (parsingOptions === void 0) { parsingOptions = {}; }
var _a;
var _this = _super.call(this, nextPolicy, requestPolicyOptions) || this;
function DeserializationPolicy(nextPolicy, deserializationContentTypes, options) {
var _this = _super.call(this, nextPolicy, options) || this;
_this.jsonContentTypes =
(deserializationContentTypes && deserializationContentTypes.json) || defaultJsonContentTypes;
_this.xmlContentTypes =
(deserializationContentTypes && deserializationContentTypes.xml) || defaultXmlContentTypes;
_this.xmlCharKey = (_a = parsingOptions.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY;
return _this;
}
DeserializationPolicy.prototype.sendRequest = function (request) {
return tslib.__awaiter(this, void 0, void 0, function () {
var _this = this;
return tslib.__generator(this, function (_a) {
return [2 /*return*/, this._nextPolicy.sendRequest(request).then(function (response) {
return deserializeResponseBody(_this.jsonContentTypes, _this.xmlContentTypes, response, {
xmlCharKey: _this.xmlCharKey
});
return [2 /*return*/, this._nextPolicy
.sendRequest(request)
.then(function (response) {
return deserializeResponseBody(_this.jsonContentTypes, _this.xmlContentTypes, response);
})];
});
});
@@ -54384,15 +53972,8 @@ function shouldDeserializeResponse(parsedResponse) {
}
return result;
}
function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options) {
var _a, _b, _c;
if (options === void 0) { options = {}; }
var updatedOptions = {
rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "",
includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false,
xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY
};
return parse(jsonContentTypes, xmlContentTypes, response, updatedOptions).then(function (parsedResponse) {
function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response) {
return parse(jsonContentTypes, xmlContentTypes, response).then(function (parsedResponse) {
if (!shouldDeserializeResponse(parsedResponse)) {
return parsedResponse;
}
@@ -54401,13 +53982,54 @@ function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, op
return parsedResponse;
}
var responseSpec = getOperationResponse(parsedResponse);
var _a = handleErrorResponse(parsedResponse, operationSpec, responseSpec), error = _a.error, shouldReturnResponse = _a.shouldReturnResponse;
if (error) {
var expectedStatusCodes = Object.keys(operationSpec.responses);
var hasNoExpectedStatusCodes = expectedStatusCodes.length === 0 ||
(expectedStatusCodes.length === 1 && expectedStatusCodes[0] === "default");
var isExpectedStatusCode = hasNoExpectedStatusCodes
? 200 <= parsedResponse.status && parsedResponse.status < 300
: !!responseSpec;
// There is no operation response spec for current status code.
// So, treat it as an error case and use the default response spec to deserialize the response.
if (!isExpectedStatusCode) {
var defaultResponseSpec = operationSpec.responses.default;
if (!defaultResponseSpec) {
return parsedResponse;
}
var defaultBodyMapper = defaultResponseSpec.bodyMapper;
var defaultHeadersMapper = defaultResponseSpec.headersMapper;
var initialErrorMessage = isStreamOperation(operationSpec)
? "Unexpected status code: " + parsedResponse.status
: parsedResponse.bodyAsText;
var error = new RestError(initialErrorMessage, undefined, parsedResponse.status, parsedResponse.request, parsedResponse);
try {
// If error response has a body, try to extract error code & message from it
// Then try to deserialize it using default body mapper
if (parsedResponse.parsedBody) {
var parsedBody = parsedResponse.parsedBody;
var internalError = parsedBody.error || parsedBody;
error.code = internalError.code;
if (internalError.message) {
error.message = internalError.message;
}
if (defaultBodyMapper) {
var valueToDeserialize = parsedBody;
if (operationSpec.isXML && defaultBodyMapper.type.name === MapperType.Sequence) {
valueToDeserialize =
typeof parsedBody === "object" ? parsedBody[defaultBodyMapper.xmlElementName] : [];
}
error.response.parsedBody = operationSpec.serializer.deserialize(defaultBodyMapper, valueToDeserialize, "error.response.parsedBody");
}
}
// If error response has headers, try to deserialize it using default header mapper
if (parsedResponse.headers && defaultHeadersMapper) {
error.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.rawHeaders(), "operationRes.parsedHeaders");
}
}
catch (defaultError) {
error.message = "Error \"" + defaultError.message + "\" occurred in deserializing the responseBody - \"" + parsedResponse.bodyAsText + "\" for the default response.";
}
throw error;
}
else if (shouldReturnResponse) {
return parsedResponse;
}
// An operation response spec does exist for current status code, so
// use it to deserialize the response.
if (responseSpec) {
@@ -54420,7 +54042,7 @@ function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, op
: [];
}
try {
parsedResponse.parsedBody = operationSpec.serializer.deserialize(responseSpec.bodyMapper, valueToDeserialize, "operationRes.parsedBody", options);
parsedResponse.parsedBody = operationSpec.serializer.deserialize(responseSpec.bodyMapper, valueToDeserialize, "operationRes.parsedBody");
}
catch (error) {
var restError = new RestError("Error " + error + " occurred in deserializing the responseBody - " + parsedResponse.bodyAsText, undefined, parsedResponse.status, parsedResponse.request, parsedResponse);
@@ -54432,78 +54054,13 @@ function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, op
parsedResponse.parsedBody = response.status >= 200 && response.status < 300;
}
if (responseSpec.headersMapper) {
parsedResponse.parsedHeaders = operationSpec.serializer.deserialize(responseSpec.headersMapper, parsedResponse.headers.rawHeaders(), "operationRes.parsedHeaders", options);
parsedResponse.parsedHeaders = operationSpec.serializer.deserialize(responseSpec.headersMapper, parsedResponse.headers.rawHeaders(), "operationRes.parsedHeaders");
}
}
return parsedResponse;
});
}
function isOperationSpecEmpty(operationSpec) {
var expectedStatusCodes = Object.keys(operationSpec.responses);
return (expectedStatusCodes.length === 0 ||
(expectedStatusCodes.length === 1 && expectedStatusCodes[0] === "default"));
}
function handleErrorResponse(parsedResponse, operationSpec, responseSpec) {
var isSuccessByStatus = 200 <= parsedResponse.status && parsedResponse.status < 300;
var isExpectedStatusCode = isOperationSpecEmpty(operationSpec)
? isSuccessByStatus
: !!responseSpec;
if (isExpectedStatusCode) {
if (responseSpec) {
if (!responseSpec.isError) {
return { error: null, shouldReturnResponse: false };
}
}
else {
return { error: null, shouldReturnResponse: false };
}
}
var errorResponseSpec = responseSpec !== null && responseSpec !== void 0 ? responseSpec : operationSpec.responses.default;
var initialErrorMessage = isStreamOperation(operationSpec)
? "Unexpected status code: " + parsedResponse.status
: parsedResponse.bodyAsText;
var error = new RestError(initialErrorMessage, undefined, parsedResponse.status, parsedResponse.request, parsedResponse);
// If the item failed but there's no error spec or default spec to deserialize the error,
// we should fail so we just throw the parsed response
if (!errorResponseSpec) {
throw error;
}
var defaultBodyMapper = errorResponseSpec.bodyMapper;
var defaultHeadersMapper = errorResponseSpec.headersMapper;
try {
// If error response has a body, try to deserialize it using default body mapper.
// Then try to extract error code & message from it
if (parsedResponse.parsedBody) {
var parsedBody = parsedResponse.parsedBody;
var parsedError = void 0;
if (defaultBodyMapper) {
var valueToDeserialize = parsedBody;
if (operationSpec.isXML && defaultBodyMapper.type.name === MapperType.Sequence) {
valueToDeserialize =
typeof parsedBody === "object" ? parsedBody[defaultBodyMapper.xmlElementName] : [];
}
parsedError = operationSpec.serializer.deserialize(defaultBodyMapper, valueToDeserialize, "error.response.parsedBody");
}
var internalError = parsedBody.error || parsedError || parsedBody;
error.code = internalError.code;
if (internalError.message) {
error.message = internalError.message;
}
if (defaultBodyMapper) {
error.response.parsedBody = parsedError;
}
}
// If error response has headers, try to deserialize it using default header mapper
if (parsedResponse.headers && defaultHeadersMapper) {
error.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.rawHeaders(), "operationRes.parsedHeaders");
}
}
catch (defaultError) {
error.message = "Error \"" + defaultError.message + "\" occurred in deserializing the responseBody - \"" + parsedResponse.bodyAsText + "\" for the default response.";
}
return { error: error, shouldReturnResponse: false };
}
function parse(jsonContentTypes, xmlContentTypes, operationResponse, opts) {
function parse(jsonContentTypes, xmlContentTypes, operationResponse) {
var errorHandler = function (err) {
var msg = "Error \"" + err + "\" occurred while parsing the response body - " + operationResponse.bodyAsText + ".";
var errCode = err.code || RestError.PARSE_ERROR;
@@ -54524,7 +54081,7 @@ function parse(jsonContentTypes, xmlContentTypes, operationResponse, opts) {
}).catch(errorHandler);
}
else if (contentComponents.some(function (component) { return xmlContentTypes.indexOf(component) !== -1; })) {
return parseXML(text_1, opts)
return parseXML(text_1)
.then(function (body) {
operationResponse.parsedBody = body;
return operationResponse;
@@ -54794,10 +54351,6 @@ var UserAgentPolicy = /** @class */ (function (_super) {
}(BaseRequestPolicy));
// Copyright (c) Microsoft Corporation.
/**
* Methods that are allowed to follow redirects 301 and 302
*/
var allowedRedirect = ["GET", "HEAD"];
var DefaultRedirectOptions = {
handleRedirects: true,
maxRetries: 20
@@ -54830,11 +54383,7 @@ function handleRedirect(policy, response, currentRetries) {
var request = response.request, status = response.status;
var locationHeader = response.headers.get("location");
if (locationHeader &&
(status === 300 ||
(status === 301 && allowedRedirect.includes(request.method)) ||
(status === 302 && allowedRedirect.includes(request.method)) ||
(status === 303 && request.method === "POST") ||
status === 307) &&
(status === 300 || status === 307 || (status === 303 && request.method === "POST")) &&
(!policy.maxRetries || currentRetries < policy.maxRetries)) {
var builder = URLBuilder.parse(request.url);
builder.setPath(locationHeader);
@@ -54843,7 +54392,6 @@ function handleRedirect(policy, response, currentRetries) {
// redirected GET request if the redirect url is present in the location header
if (status === 303) {
request.method = "GET";
delete request.body;
}
return policy._nextPolicy
.sendRequest(request)
@@ -55105,12 +54653,6 @@ var AccessTokenRefresher = /** @class */ (function () {
}());
// Copyright (c) Microsoft Corporation.
/**
* The automated token refresh will only start to happen at the
* expiration date minus the value of timeBetweenRefreshAttemptsInMs,
* which is by default 30 seconds.
*/
var timeBetweenRefreshAttemptsInMs = 30000;
/**
* Creates a new BearerTokenAuthenticationPolicy factory.
*
@@ -55126,6 +54668,12 @@ function bearerTokenAuthenticationPolicy(credential, scopes) {
}
};
}
/**
* The automated token refresh will only start to happen at the
* expiration date minus the value of timeBetweenRefreshAttemptsInMs,
* which is by default 30 seconds.
*/
var timeBetweenRefreshAttemptsInMs = 30000;
/**
*
* Provides a RequestPolicy that can request a token from a TokenCredential
@@ -55785,15 +55333,10 @@ var ServiceClient = /** @class */ (function () {
var bearerTokenPolicyFactory = undefined;
// eslint-disable-next-line @typescript-eslint/no-this-alias
var serviceClient = _this;
var serviceClientOptions = options;
return {
create: function (nextPolicy, options) {
var credentialScopes = getCredentialScopes(serviceClientOptions, serviceClient.baseUri);
if (!credentialScopes) {
throw new Error("When using credential, the ServiceClient must contain a baseUri or a credentialScopes in ServiceClientOptions. Unable to create a bearerTokenAuthenticationPolicy");
}
if (bearerTokenPolicyFactory === undefined || bearerTokenPolicyFactory === null) {
bearerTokenPolicyFactory = bearerTokenAuthenticationPolicy(credentials, credentialScopes);
bearerTokenPolicyFactory = bearerTokenAuthenticationPolicy(credentials, (serviceClient.baseUri || "") + "/.default");
}
return bearerTokenPolicyFactory.create(nextPolicy, options);
}
@@ -55857,21 +55400,19 @@ var ServiceClient = /** @class */ (function () {
* @param {ServiceCallback} callback The callback to call when the response is received.
*/
ServiceClient.prototype.sendOperationRequest = function (operationArguments, operationSpec, callback) {
var _a;
return tslib.__awaiter(this, void 0, void 0, function () {
var serializerOptions, httpRequest, result, baseUri, requestUrl, _i, _b, urlParameter, urlParameterValue, _c, _d, queryParameter, queryParameterValue, index, item, index, contentType, _e, _f, headerParameter, headerValue, headerCollectionPrefix, _g, _h, key, options, customHeaderName, rawResponse, sendRequestError, error_1, error_2, cb;
return tslib.__generator(this, function (_j) {
switch (_j.label) {
var httpRequest, result, baseUri, requestUrl, _i, _a, urlParameter, urlParameterValue, _b, _c, queryParameter, queryParameterValue, index, item, index, contentType, _d, _e, headerParameter, headerValue, headerCollectionPrefix, _f, _g, key, options, customHeaderName, rawResponse, sendRequestError, error_1, error_2, cb;
return tslib.__generator(this, function (_h) {
switch (_h.label) {
case 0:
if (typeof operationArguments.options === "function") {
callback = operationArguments.options;
operationArguments.options = undefined;
}
serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions;
httpRequest = new WebResource();
_j.label = 1;
_h.label = 1;
case 1:
_j.trys.push([1, 6, , 7]);
_h.trys.push([1, 6, , 7]);
baseUri = operationSpec.baseUrl || this.baseUri;
if (!baseUri) {
throw new Error("If operationSpec.baseUrl is not specified, then the ServiceClient must have a baseUri string property that contains the base URL to use.");
@@ -55883,10 +55424,10 @@ var ServiceClient = /** @class */ (function () {
requestUrl.appendPath(operationSpec.path);
}
if (operationSpec.urlParameters && operationSpec.urlParameters.length > 0) {
for (_i = 0, _b = operationSpec.urlParameters; _i < _b.length; _i++) {
urlParameter = _b[_i];
for (_i = 0, _a = operationSpec.urlParameters; _i < _a.length; _i++) {
urlParameter = _a[_i];
urlParameterValue = getOperationArgumentValueFromParameter(this, operationArguments, urlParameter, operationSpec.serializer);
urlParameterValue = operationSpec.serializer.serialize(urlParameter.mapper, urlParameterValue, getPathStringFromParameter(urlParameter), serializerOptions);
urlParameterValue = operationSpec.serializer.serialize(urlParameter.mapper, urlParameterValue, getPathStringFromParameter(urlParameter));
if (!urlParameter.skipEncoding) {
urlParameterValue = encodeURIComponent(urlParameterValue);
}
@@ -55894,17 +55435,16 @@ var ServiceClient = /** @class */ (function () {
}
}
if (operationSpec.queryParameters && operationSpec.queryParameters.length > 0) {
for (_c = 0, _d = operationSpec.queryParameters; _c < _d.length; _c++) {
queryParameter = _d[_c];
for (_b = 0, _c = operationSpec.queryParameters; _b < _c.length; _b++) {
queryParameter = _c[_b];
queryParameterValue = getOperationArgumentValueFromParameter(this, operationArguments, queryParameter, operationSpec.serializer);
if (queryParameterValue !== undefined && queryParameterValue !== null) {
queryParameterValue = operationSpec.serializer.serialize(queryParameter.mapper, queryParameterValue, getPathStringFromParameter(queryParameter), serializerOptions);
queryParameterValue = operationSpec.serializer.serialize(queryParameter.mapper, queryParameterValue, getPathStringFromParameter(queryParameter));
if (queryParameter.collectionFormat !== undefined &&
queryParameter.collectionFormat !== null) {
if (queryParameter.collectionFormat === exports.QueryCollectionFormat.Multi) {
if (queryParameterValue.length === 0) {
// The collection is empty, no need to try serializing the current queryParam
continue;
queryParameterValue = "";
}
else {
for (index in queryParameterValue) {
@@ -55949,16 +55489,16 @@ var ServiceClient = /** @class */ (function () {
httpRequest.headers.set("Content-Type", contentType);
}
if (operationSpec.headerParameters) {
for (_e = 0, _f = operationSpec.headerParameters; _e < _f.length; _e++) {
headerParameter = _f[_e];
for (_d = 0, _e = operationSpec.headerParameters; _d < _e.length; _d++) {
headerParameter = _e[_d];
headerValue = getOperationArgumentValueFromParameter(this, operationArguments, headerParameter, operationSpec.serializer);
if (headerValue !== undefined && headerValue !== null) {
headerValue = operationSpec.serializer.serialize(headerParameter.mapper, headerValue, getPathStringFromParameter(headerParameter), serializerOptions);
headerValue = operationSpec.serializer.serialize(headerParameter.mapper, headerValue, getPathStringFromParameter(headerParameter));
headerCollectionPrefix = headerParameter.mapper
.headerCollectionPrefix;
if (headerCollectionPrefix) {
for (_g = 0, _h = Object.keys(headerValue); _g < _h.length; _g++) {
key = _h[_g];
for (_f = 0, _g = Object.keys(headerValue); _f < _g.length; _f++) {
key = _g[_f];
httpRequest.headers.set(headerCollectionPrefix + key, headerValue[key]);
}
}
@@ -56002,15 +55542,15 @@ var ServiceClient = /** @class */ (function () {
}
rawResponse = void 0;
sendRequestError = void 0;
_j.label = 2;
_h.label = 2;
case 2:
_j.trys.push([2, 4, , 5]);
_h.trys.push([2, 4, , 5]);
return [4 /*yield*/, this.sendRequest(httpRequest)];
case 3:
rawResponse = _j.sent();
rawResponse = _h.sent();
return [3 /*break*/, 5];
case 4:
error_1 = _j.sent();
error_1 = _h.sent();
sendRequestError = error_1;
return [3 /*break*/, 5];
case 5:
@@ -56026,7 +55566,7 @@ var ServiceClient = /** @class */ (function () {
}
return [3 /*break*/, 7];
case 6:
error_2 = _j.sent();
error_2 = _h.sent();
result = Promise.reject(error_2);
return [3 /*break*/, 7];
case 7:
@@ -56045,14 +55585,7 @@ var ServiceClient = /** @class */ (function () {
return ServiceClient;
}());
function serializeRequestBody(serviceClient, httpRequest, operationArguments, operationSpec) {
var _a, _b, _c, _d, _e, _f;
var serializerOptions = (_b = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions) !== null && _b !== void 0 ? _b : {};
var updatedOptions = {
rootName: (_c = serializerOptions.rootName) !== null && _c !== void 0 ? _c : "",
includeRoot: (_d = serializerOptions.includeRoot) !== null && _d !== void 0 ? _d : false,
xmlCharKey: (_e = serializerOptions.xmlCharKey) !== null && _e !== void 0 ? _e : XML_CHARKEY
};
var xmlCharKey = serializerOptions.xmlCharKey;
var _a;
if (operationSpec.requestBody && operationSpec.requestBody.mapper) {
httpRequest.body = getOperationArgumentValueFromParameter(serviceClient, operationArguments, operationSpec.requestBody, operationSpec.serializer);
var bodyMapper = operationSpec.requestBody.mapper;
@@ -56061,26 +55594,22 @@ function serializeRequestBody(serviceClient, httpRequest, operationArguments, op
try {
if ((httpRequest.body !== undefined && httpRequest.body !== null) || required) {
var requestBodyParameterPathString = getPathStringFromParameter(operationSpec.requestBody);
httpRequest.body = operationSpec.serializer.serialize(bodyMapper, httpRequest.body, requestBodyParameterPathString, updatedOptions);
httpRequest.body = operationSpec.serializer.serialize(bodyMapper, httpRequest.body, requestBodyParameterPathString);
var isStream = typeName === MapperType.Stream;
if (operationSpec.isXML) {
var xmlnsKey = xmlNamespacePrefix ? "xmlns:" + xmlNamespacePrefix : "xmlns";
var value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, httpRequest.body, updatedOptions);
var value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, httpRequest.body);
if (typeName === MapperType.Sequence) {
httpRequest.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), {
rootName: xmlName || serializedName,
xmlCharKey: xmlCharKey
});
httpRequest.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName });
}
else if (!isStream) {
httpRequest.body = stringifyXML(value, {
rootName: xmlName || serializedName,
xmlCharKey: xmlCharKey
rootName: xmlName || serializedName
});
}
}
else if (typeName === MapperType.String &&
(((_f = operationSpec.contentType) === null || _f === void 0 ? void 0 : _f.match("text/plain")) || operationSpec.mediaType === "text")) {
(((_a = operationSpec.contentType) === null || _a === void 0 ? void 0 : _a.match("text/plain")) || operationSpec.mediaType === "text")) {
// the String serializer has validated that request body is a string
// so just send the string.
return;
@@ -56096,12 +55625,12 @@ function serializeRequestBody(serviceClient, httpRequest, operationArguments, op
}
else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) {
httpRequest.formData = {};
for (var _i = 0, _g = operationSpec.formDataParameters; _i < _g.length; _i++) {
var formDataParameter = _g[_i];
for (var _i = 0, _b = operationSpec.formDataParameters; _i < _b.length; _i++) {
var formDataParameter = _b[_i];
var formDataParameterValue = getOperationArgumentValueFromParameter(serviceClient, operationArguments, formDataParameter, operationSpec.serializer);
if (formDataParameterValue !== undefined && formDataParameterValue !== null) {
var formDataParameterPropertyName = formDataParameter.mapper.serializedName || getPathStringFromParameter(formDataParameter);
httpRequest.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, getPathStringFromParameter(formDataParameter), updatedOptions);
httpRequest.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, getPathStringFromParameter(formDataParameter));
}
}
}
@@ -56109,15 +55638,12 @@ function serializeRequestBody(serviceClient, httpRequest, operationArguments, op
/**
* Adds an xml namespace to the xml serialized object if needed, otherwise it just returns the value itself
*/
function getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, serializedValue, options) {
function getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, serializedValue) {
var _a;
// Composite and Sequence schemas already got their root namespace set during serialization
// We just need to add xmlns to the other schema types
if (xmlNamespace && !["Composite", "Sequence", "Dictionary"].includes(typeName)) {
var result = {};
result[options.xmlCharKey] = serializedValue;
result[XML_ATTRKEY] = (_a = {}, _a[xmlnsKey] = xmlNamespace, _a);
return result;
return { _: serializedValue, $: (_a = {}, _a[xmlnsKey] = xmlNamespace, _a) };
}
return serializedValue;
}
@@ -56206,12 +55732,10 @@ function getOperationArgumentValueFromParameter(serviceClient, operationArgument
return getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, parameter.parameterPath, parameter.mapper, serializer);
}
function getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, parameterPath, parameterMapper, serializer) {
var _a;
var value;
if (typeof parameterPath === "string") {
parameterPath = [parameterPath];
}
var serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions;
if (Array.isArray(parameterPath)) {
if (parameterPath.length > 0) {
if (parameterMapper.isConstant) {
@@ -56232,7 +55756,7 @@ function getOperationArgumentValueFromParameterPath(serviceClient, operationArgu
}
// Serialize just for validation purposes.
var parameterPathString = getPathStringFromParameterPath(parameterPath, parameterMapper);
serializer.serialize(parameterMapper, value, parameterPathString, serializerOptions);
serializer.serialize(parameterMapper, value, parameterPathString);
}
}
else {
@@ -56245,7 +55769,7 @@ function getOperationArgumentValueFromParameterPath(serviceClient, operationArgu
var propertyValue = getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, propertyPath, propertyMapper, serializer);
// Serialize just for validation purposes.
var propertyPathString = getPathStringFromParameterPath(propertyPath, propertyMapper);
serializer.serialize(propertyMapper, propertyValue, propertyPathString, serializerOptions);
serializer.serialize(propertyMapper, propertyValue, propertyPathString);
if (propertyValue !== undefined && propertyValue !== null) {
if (!value) {
value = {};
@@ -56319,46 +55843,6 @@ function flattenResponse(_response, responseSpec) {
}
return addOperationResponse(tslib.__assign(tslib.__assign({}, parsedHeaders), _response.parsedBody));
}
function getCredentialScopes(options, baseUri) {
if (options === null || options === void 0 ? void 0 : options.credentialScopes) {
var scopes = options.credentialScopes;
return Array.isArray(scopes)
? scopes.map(function (scope) { return new url.URL(scope).toString(); })
: new url.URL(scopes).toString();
}
if (baseUri) {
return baseUri + "/.default";
}
return undefined;
}
// Copyright (c) Microsoft Corporation.
/**
* Creates a function called createSpan to create spans using the global tracer.
* @ignore
* @param spanConfig The name of the operation being performed.
* @param tracingOptions The options for the underlying http request.
*/
function createSpanFunction(_a) {
var packagePrefix = _a.packagePrefix, namespace = _a.namespace;
return function (operationName, operationOptions) {
var tracer = coreTracing.getTracer();
var tracingOptions = operationOptions.tracingOptions || {};
var spanOptions = tslib.__assign(tslib.__assign({}, tracingOptions.spanOptions), { kind: api.SpanKind.INTERNAL });
var span = tracer.startSpan(packagePrefix + "." + operationName, spanOptions);
span.setAttribute("az.namespace", namespace);
var newSpanOptions = tracingOptions.spanOptions || {};
if (span.isRecording()) {
newSpanOptions = tslib.__assign(tslib.__assign({}, tracingOptions.spanOptions), { parent: span.context(), attributes: tslib.__assign(tslib.__assign({}, spanOptions.attributes), { "az.namespace": namespace }) });
}
var newTracingOptions = tslib.__assign(tslib.__assign({}, tracingOptions), { spanOptions: newSpanOptions });
var newOperationOptions = tslib.__assign(tslib.__assign({}, operationOptions), { tracingOptions: newTracingOptions });
return {
span: span,
updatedOptions: newOperationOptions
};
};
}
// Copyright (c) Microsoft Corporation.
var HeaderConstants = Constants.HeaderConstants;
@@ -56503,12 +55987,9 @@ exports.TopicCredentials = TopicCredentials;
exports.URLBuilder = URLBuilder;
exports.URLQuery = URLQuery;
exports.WebResource = WebResource;
exports.XML_ATTRKEY = XML_ATTRKEY;
exports.XML_CHARKEY = XML_CHARKEY;
exports.applyMixins = applyMixins;
exports.bearerTokenAuthenticationPolicy = bearerTokenAuthenticationPolicy;
exports.createPipelineFromOptions = createPipelineFromOptions;
exports.createSpanFunction = createSpanFunction;
exports.delay = delay;
exports.deserializationPolicy = deserializationPolicy;
exports.deserializeResponseBody = deserializeResponseBody;
+22 -22
View File
@@ -5,11 +5,11 @@
"requires": true,
"dependencies": {
"@actions/cache": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-1.0.5.tgz",
"integrity": "sha512-TcvJOduwsPP27KLmIa5cqXsQYFK2GzILcEpnhvYmhGwi1aYx9XwhKmp6Im8X6DJMBxbvupKPsOntG6f6sSkIPA==",
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-1.0.3.tgz",
"integrity": "sha512-2DcdMrqbfj5LcsEYIh6ACgjb0bNMeMPP7y1a+bf/Sk0MFfkkrYRNFihkXRV6v0TNkNo0b5X38xmUguRZ5ZPLbw==",
"requires": {
"@actions/core": "^1.2.6",
"@actions/core": "^1.2.4",
"@actions/exec": "^1.0.1",
"@actions/glob": "^0.1.0",
"@actions/http-client": "^1.0.9",
@@ -21,9 +21,9 @@
}
},
"@actions/core": {
"version": "1.2.6",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz",
"integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA=="
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.4.tgz",
"integrity": "sha512-YJCEq8BE3CdN8+7HPZ/4DxJjk/OkZV2FFIf+DlZTC/4iBlzYCD5yjRR6eiOS5llO11zbRltIRuKAjMKaWTE6cg=="
},
"@actions/exec": {
"version": "1.0.4",
@@ -34,11 +34,11 @@
}
},
"@actions/glob": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.1.1.tgz",
"integrity": "sha512-ikM4GVZOgSGDNTjv0ECJ8AOqmDqQwtO4K1M4P465C9iikRq34+FwCjUVSwzgOYDP85qtddyWpzBw5lTub/9Xmg==",
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.1.0.tgz",
"integrity": "sha512-lx8SzyQ2FE9+UUvjqY1f28QbTJv+w8qP7kHHbfQRhphrlcx0Mdmm1tZdGJzfxv1jxREa/sLW4Oy8CbGQKCJySA==",
"requires": {
"@actions/core": "^1.2.6",
"@actions/core": "^1.2.0",
"minimatch": "^3.0.4"
}
},
@@ -112,9 +112,9 @@
}
},
"@azure/core-http": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-1.2.1.tgz",
"integrity": "sha512-vPHIQXjLVs4iin2BUaj7/sqIAfGq3MW1TLEc3yYKFNpi/sBQn2KI0g+Ow0EQYvAkkHhTHGArA7JKhcjsnJMGLw==",
"version": "1.1.9",
"resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-1.1.9.tgz",
"integrity": "sha512-wM0HMRNQaE2NtTHb+9FXF7uxUqaAHFTMVu6OzlEll6gUGybcDqM7+9Oklp33BhEfq+ZumpCoqxq3njNbMHuf/w==",
"requires": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-auth": "^1.1.3",
@@ -129,7 +129,7 @@
"tough-cookie": "^4.0.0",
"tslib": "^2.0.0",
"tunnel": "^0.0.6",
"uuid": "^8.3.0",
"uuid": "^8.1.0",
"xml2js": "^0.4.19"
},
"dependencies": {
@@ -159,9 +159,9 @@
"integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ=="
},
"uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
"version": "8.3.1",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.1.tgz",
"integrity": "sha512-FOmRr+FmWEIG8uhZv6C2bTgEVXsHk08kE7mPlrBbEe+c3r9pjceVPgupIfNIhc4yx55H69OXANrUaSuu9eInKg=="
}
}
},
@@ -249,12 +249,12 @@
}
},
"@azure/storage-blob": {
"version": "12.3.0",
"resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.3.0.tgz",
"integrity": "sha512-nCySzNfm782pEW3sg9GHj1zE4gBeVVMeEBdWb4MefifrCwQQOoz5cXZTNFiUJAJqAO+/72r2UjZcUwHk/QmzkA==",
"version": "12.2.1",
"resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.2.1.tgz",
"integrity": "sha512-erqCSmDL8b/AHZi94nq+nCE+2whQmvBDkAv4N9uic0MRac/gRyZqnsqkfrun/gr2rZo+qVtnMenwkkE3roXn8Q==",
"requires": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-http": "^1.2.0",
"@azure/core-http": "^1.1.6",
"@azure/core-lro": "^1.0.2",
"@azure/core-paging": "^1.1.1",
"@azure/core-tracing": "1.0.0-preview.9",
+3 -3
View File
@@ -23,10 +23,10 @@
"author": "GitHub",
"license": "MIT",
"dependencies": {
"@actions/cache": "^1.0.5",
"@actions/core": "^1.2.6",
"@actions/core": "^1.2.0",
"@actions/exec": "^1.0.1",
"@actions/io": "^1.0.1"
"@actions/io": "^1.0.1",
"@actions/cache": "^1.0.3"
},
"devDependencies": {
"@types/jest": "^24.0.13",