Compare commits

...
Author SHA1 Message Date
vsvipul 770a27cf65 Update licenses 2022-04-05 12:17:59 +05:30
Deepak Dahiya c2131abcd8 New build 2022-04-05 06:40:46 +00:00
Deepak Dahiya 575160481d Updated @actions/cache to 2.0.1 2022-04-05 05:53:11 +00:00
Shubham Tiwari 136d96b4ae Enabling actions/cache for GHES based on presence of AC service (#774)
* initial changes

* Update package-lock.json

* Update package-lock.json

* review comments and updated test cases

* package.json

* changed name

* added new line

* changed tookit

* updated with 2.0

* changed with public released package

* ran code format

* linting errors

* Update actionUtils.test.ts

* Update cache.dep.yml

* Update package.json

* Update README.md

* Create RELEASES.md

* Update RELEASES.md

* Update package.json

* Update package-lock.json

* typo
2022-03-30 15:46:49 +05:30
Ashwin Sangemandvsvipul 7d4f40b464 Bumping up the version to fix download issue for files > 2 GB. (#775)
* Bumping up the version to fix download issue for files > 2 GB.

* Update license for cache

Co-authored-by: vsvipul <vsvipul@github.com>
2022-03-30 15:33:23 +05:30
Ashwin Sangem 2d8d0d1c9b Updated what's new. (#771)
* Updated what's new.

* Segregated major versions and added changelog.

* Update README.md
2022-03-22 14:04:39 +05:30
Ashwin Sangem 7799d864d9 Updated the usage and docs to the major version release. (#770) 2022-03-21 14:31:26 +05:30
Ashwin Sangem 4b0cf6cc46 Merge pull request #769 from actions/users/ashwinsangem/bump_major_version
Bumped up to a major version(v3.0.0)
2022-03-21 13:56:53 +05:30
vsvipul 60c606a2b4 Update licensed files 2022-03-21 12:01:49 +05:30
Ashwin Sangem b6e9a919a7 Revert "Updated to the latest version."
This reverts commit c842503583.
2022-03-21 04:56:07 +00:00
Ashwin Sangem c842503583 Updated to the latest version. 2022-03-21 04:53:37 +00:00
Ashwin Sangem 2b7da2a62c Bumped up to a major version. 2022-03-21 04:42:02 +00:00
Vipul deae296ab3 Merge pull request #651 from magnetikonline/fix-golang-windows-example
Fix Golang windows example - updated `README.md` test badge markdown.
2022-03-09 18:22:38 +05:30
Vipul c7c46bcb6d Merge pull request #707 from duxtland/main
Add Deno cache example
2022-02-24 15:51:48 +05:30
Peter Mescalchin 6535c5fb5f Regenerated examples.md TOC 2022-02-24 16:36:38 +11:00
Peter Mescalchin 3fdafa472e Update GitHub Actions status badge markdown in README.md 2022-02-24 16:32:52 +11:00
Peter Mescalchin 341e6d75d9 Merge branch 'actions:main' into fix-golang-windows-example 2022-02-24 16:28:28 +11:00
Jheyson Saavedra 3fe001f5ca chore: add Deno cache example to readme 2022-02-23 16:18:41 -05:00
Vipul ab4bea262c Merge pull request #567 from yuichkun/fix-typo-in-lerna-example
Fix typo of cache path in Lerna example
2022-02-23 11:24:07 +05:30
Yuichi Yogo 7772fcab79 remove unnecessary sub directory from search path 2022-02-23 12:39:46 +09:00
Vipul 6c2ab9416b Merge pull request #747 from malob/add-stack-example
Add example for Haskell Stack
2022-02-23 02:21:45 +05:30
Malo Bourgon 2c7b30f330 Add example for Haskell Stack 2022-02-22 10:21:09 -08:00
Vipul 73cb7e0405 Merge pull request #742 from actions/node-update
Update node version, @types/node and some outdated dependencies
2022-02-16 11:09:30 +05:30
Jheyson Saavedra de7c17c6a9 chore: add Deno cache example 2022-01-15 19:33:29 -05:00
Peter Mescalchin 447f0fd1d3 Chomp some markdown whitespace 2021-09-26 22:10:48 +10:00
Peter Mescalchin 47e8bd685f Small fix to README.md examples link 2021-09-26 22:10:29 +10:00
Peter Mescalchin 795a8f09a9 Fixed Windows Golang cache paths in example 2021-09-26 22:05:48 +10:00
Yuichi Yogo 4762de4681 simplify path in lerna example 2021-04-21 02:47:03 +09:00
Yuichi Yogo 12ed05f49a Fix typo of cache path in Lerna example 2021-04-17 12:35:30 +09:00
23 changed files with 3868 additions and 1410 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ jobs:
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: Restore npm cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
+3 -3
View File
@@ -1,9 +1,9 @@
---
name: "@actions/cache"
version: 1.0.9
version: 2.0.1
type: npm
summary: Actions cache lib
homepage: https://github.com/actions/toolkit/tree/main/packages/cache
summary:
homepage:
license: mit
licenses:
- sources: LICENSE.md
+3 -3
View File
@@ -1,9 +1,9 @@
---
name: "@actions/exec"
version: 1.1.0
version: 1.1.1
type: npm
summary: Actions exec lib
homepage: https://github.com/actions/toolkit/tree/main/packages/exec
summary:
homepage:
license: mit
licenses:
- sources: LICENSE.md
+3 -3
View File
@@ -1,9 +1,9 @@
---
name: "@actions/io"
version: 1.1.1
version: 1.1.2
type: npm
summary: Actions io lib
homepage: https://github.com/actions/toolkit/tree/main/packages/io
summary:
homepage:
license: mit
licenses:
- sources: LICENSE.md
+3 -3
View File
@@ -1,9 +1,9 @@
---
name: "@azure/core-asynciterator-polyfill"
version: 1.0.0
version: 1.0.2
type: npm
summary: Polyfill for IE/Node 8 for Symbol.asyncIterator
homepage: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/core-asynciterator-polyfill
summary:
homepage:
license: mit
licenses:
- sources: LICENSE
+3 -4
View File
@@ -1,10 +1,9 @@
---
name: "@azure/core-lro"
version: 2.2.3
version: 2.2.4
type: npm
summary: Isomorphic client library for supporting long-running operations in node.js
and browser.
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-lro/README.md
summary:
homepage:
license: mit
licenses:
- sources: LICENSE
+3 -4
View File
@@ -1,10 +1,9 @@
---
name: "@azure/ms-rest-js"
version: 2.6.0
version: 2.6.1
type: npm
summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
libraries generated using AutoRest
homepage: https://github.com/Azure/ms-rest-js
summary:
homepage:
license: mit
licenses:
- sources: LICENSE
+3 -3
View File
@@ -1,9 +1,9 @@
---
name: "@azure/storage-blob"
version: 12.8.0
version: 12.9.0
type: npm
summary: Microsoft Azure Storage SDK for JavaScript - Blob
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storage/storage-blob/
summary:
homepage:
license: mit
licenses:
- sources: LICENSE
+3 -3
View File
@@ -1,9 +1,9 @@
---
name: "@types/node-fetch"
version: 2.5.12
version: 2.6.1
type: npm
summary: TypeScript definitions for node-fetch
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-fetch
summary:
homepage:
license: mit
licenses:
- sources: LICENSE
+3 -3
View File
@@ -1,9 +1,9 @@
---
name: "@types/node"
version: 12.20.42
version: 16.11.26
type: npm
summary: TypeScript definitions for Node.js
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
summary:
homepage:
license: mit
licenses:
- sources: LICENSE
+15 -13
View File
@@ -2,19 +2,25 @@
This action allows caching dependencies and build outputs to improve workflow execution time.
<a href="https://github.com/actions/cache/actions?query=workflow%3ATests"><img alt="GitHub Actions status" src="https://github.com/actions/cache/workflows/Tests/badge.svg?branch=main&event=push"></a>
[![Tests](https://github.com/actions/cache/actions/workflows/workflow.yml/badge.svg)](https://github.com/actions/cache/actions/workflows/workflow.yml)
## Documentation
See ["Caching dependencies to speed up workflows"](https://help.github.com/github/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows).
## What's New
### v3
* Added support for caching from GHES 3.5.
* Fixed download issue for files > 2GB during restore.
* Updated the minimum runner version support from node 12 -> node 16.
### v2
* Increased the cache size limit to 10 GB.
* Added support for multiple paths, [glob patterns](https://github.com/actions/toolkit/tree/main/packages/glob), and single file caches.
```yaml
- name: Cache multiple paths
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/cache
@@ -69,7 +75,7 @@ jobs:
- name: Cache Primes
id: cache-primes
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: prime-numbers
key: ${{ runner.os }}-primes
@@ -88,11 +94,13 @@ Every programming language and framework has its own way of caching.
See [Examples](examples.md) for a list of `actions/cache` implementations for use with:
- [C# - Nuget](./examples.md#c---nuget)
- [C# - NuGet](./examples.md#c---nuget)
- [D - DUB](./examples.md#d---dub)
- [Deno](./examples.md#deno)
- [Elixir - Mix](./examples.md#elixir---mix)
- [Go - Modules](./examples.md#go---modules)
- [Haskell - Cabal](./examples.md#haskell---cabal)
- [Haskell - Stack](./examples.md#haskell---stack)
- [Java - Gradle](./examples.md#java---gradle)
- [Java - Maven](./examples.md#java---maven)
- [Node - npm](./examples.md#node---npm)
@@ -117,7 +125,7 @@ A cache key can include any of the contexts, functions, literals, and operators
For example, using the [`hashFiles`](https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#hashfiles) function allows you to create a new cache when dependencies change.
```yaml
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
path/to/dependencies
@@ -135,7 +143,7 @@ Additionally, you can use arbitrary command output in a cache key, such as a dat
echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
shell: bash
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: path/to/dependencies
key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/lockfiles') }}
@@ -156,7 +164,7 @@ Example:
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/cache@v3
id: cache
with:
path: path/to/dependencies
@@ -169,12 +177,6 @@ steps:
> Note: The `id` defined in `actions/cache` must match the `id` in the `if` statement (i.e. `steps.[ID].outputs.cache-hit`)
## Known limitation
- `action/cache` is currently not supported on GitHub Enterprise Server. <https://github.com/github/roadmap/issues/273> is tracking this.
Since GitHub Enterprise Server uses self-hosted runners, dependencies are typically cached on the runner by whatever dependency management tool is being used (npm, maven, etc.). This eliminates the need for explicit caching in some scenarios.
## Contributing
We would love for you to contribute to `actions/cache`, pull requests are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
+8
View File
@@ -0,0 +1,8 @@
# Releases
### 3.0.0
- Updated minimum runner version support from node 12 -> node 16
### 3.0.1
- Added support for caching from GHES 3.5.
- Fixed download issue for files > 2GB during restore.
+40
View File
@@ -1,3 +1,4 @@
import * as cache from "@actions/cache";
import * as core from "@actions/core";
import { Events, Outputs, RefKey, State } from "../src/constants";
@@ -5,6 +6,7 @@ import * as actionUtils from "../src/utils/actionUtils";
import * as testUtils from "../src/utils/testUtils";
jest.mock("@actions/core");
jest.mock("@actions/cache");
beforeAll(() => {
jest.spyOn(core, "getInput").mockImplementation((name, options) => {
@@ -232,3 +234,41 @@ test("getInputAsInt throws if required and value missing", () => {
actionUtils.getInputAsInt("undefined", { required: true })
).toThrowError();
});
test("isCacheFeatureAvailable for ac enabled", () => {
jest.spyOn(cache, "isFeatureAvailable").mockImplementation(() => true);
expect(actionUtils.isCacheFeatureAvailable()).toBe(true);
});
test("isCacheFeatureAvailable for ac disabled on GHES", () => {
jest.spyOn(cache, "isFeatureAvailable").mockImplementation(() => false);
const message =
"Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not.";
const infoMock = jest.spyOn(core, "info");
try {
process.env["GITHUB_SERVER_URL"] = "http://example.com";
expect(actionUtils.isCacheFeatureAvailable()).toBe(false);
expect(infoMock).toHaveBeenCalledWith(`[warning]${message}`);
} finally {
delete process.env["GITHUB_SERVER_URL"];
}
});
test("isCacheFeatureAvailable for ac disabled on dotcom", () => {
jest.spyOn(cache, "isFeatureAvailable").mockImplementation(() => false);
const message =
"An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions.";
const infoMock = jest.spyOn(core, "info");
try {
process.env["GITHUB_SERVER_URL"] = "http://github.com";
expect(actionUtils.isCacheFeatureAvailable()).toBe(false);
expect(infoMock).toHaveBeenCalledWith(`[warning]${message}`);
} finally {
delete process.env["GITHUB_SERVER_URL"];
}
});
+55 -5
View File
@@ -34,6 +34,9 @@ beforeEach(() => {
process.env[RefKey] = "refs/heads/feature-branch";
jest.spyOn(actionUtils, "isGhes").mockImplementation(() => false);
jest.spyOn(actionUtils, "isCacheFeatureAvailable").mockImplementation(
() => true
);
});
afterEach(() => {
@@ -55,10 +58,12 @@ test("restore with invalid event outputs warning", async () => {
expect(failedMock).toHaveBeenCalledTimes(0);
});
test("restore on GHES should no-op", async () => {
jest.spyOn(actionUtils, "isGhes").mockImplementation(() => true);
test("restore without AC available should no-op", async () => {
jest.spyOn(actionUtils, "isGhes").mockImplementation(() => false);
jest.spyOn(actionUtils, "isCacheFeatureAvailable").mockImplementation(
() => false
);
const logWarningMock = jest.spyOn(actionUtils, "logWarning");
const restoreCacheMock = jest.spyOn(cache, "restoreCache");
const setCacheHitOutputMock = jest.spyOn(actionUtils, "setCacheHitOutput");
@@ -67,9 +72,54 @@ test("restore on GHES should no-op", async () => {
expect(restoreCacheMock).toHaveBeenCalledTimes(0);
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
expect(setCacheHitOutputMock).toHaveBeenCalledWith(false);
expect(logWarningMock).toHaveBeenCalledWith(
"Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details"
});
test("restore on GHES without AC available should no-op", async () => {
jest.spyOn(actionUtils, "isGhes").mockImplementation(() => true);
jest.spyOn(actionUtils, "isCacheFeatureAvailable").mockImplementation(
() => false
);
const restoreCacheMock = jest.spyOn(cache, "restoreCache");
const setCacheHitOutputMock = jest.spyOn(actionUtils, "setCacheHitOutput");
await run();
expect(restoreCacheMock).toHaveBeenCalledTimes(0);
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
expect(setCacheHitOutputMock).toHaveBeenCalledWith(false);
});
test("restore on GHES with AC available ", async () => {
jest.spyOn(actionUtils, "isGhes").mockImplementation(() => true);
const path = "node_modules";
const key = "node-test";
testUtils.setInputs({
path: path,
key
});
const infoMock = jest.spyOn(core, "info");
const failedMock = jest.spyOn(core, "setFailed");
const stateMock = jest.spyOn(core, "saveState");
const setCacheHitOutputMock = jest.spyOn(actionUtils, "setCacheHitOutput");
const restoreCacheMock = jest
.spyOn(cache, "restoreCache")
.mockImplementationOnce(() => {
return Promise.resolve(key);
});
await run();
expect(restoreCacheMock).toHaveBeenCalledTimes(1);
expect(restoreCacheMock).toHaveBeenCalledWith([path], key, []);
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
expect(setCacheHitOutputMock).toHaveBeenCalledWith(true);
expect(infoMock).toHaveBeenCalledWith(`Cache restored from key: ${key}`);
expect(failedMock).toHaveBeenCalledTimes(0);
});
test("restore with no path should fail", async () => {
+57 -5
View File
@@ -54,6 +54,9 @@ beforeEach(() => {
process.env[RefKey] = "refs/heads/feature-branch";
jest.spyOn(actionUtils, "isGhes").mockImplementation(() => false);
jest.spyOn(actionUtils, "isCacheFeatureAvailable").mockImplementation(
() => true
);
});
afterEach(() => {
@@ -101,18 +104,67 @@ test("save with no primary key in state outputs warning", async () => {
expect(failedMock).toHaveBeenCalledTimes(0);
});
test("save on GHES should no-op", async () => {
jest.spyOn(actionUtils, "isGhes").mockImplementation(() => true);
test("save without AC available should no-op", async () => {
jest.spyOn(actionUtils, "isCacheFeatureAvailable").mockImplementation(
() => false
);
const logWarningMock = jest.spyOn(actionUtils, "logWarning");
const saveCacheMock = jest.spyOn(cache, "saveCache");
await run();
expect(saveCacheMock).toHaveBeenCalledTimes(0);
expect(logWarningMock).toHaveBeenCalledWith(
"Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details"
});
test("save on ghes without AC available should no-op", async () => {
jest.spyOn(actionUtils, "isGhes").mockImplementation(() => true);
jest.spyOn(actionUtils, "isCacheFeatureAvailable").mockImplementation(
() => false
);
const saveCacheMock = jest.spyOn(cache, "saveCache");
await run();
expect(saveCacheMock).toHaveBeenCalledTimes(0);
});
test("save on GHES with AC available", async () => {
jest.spyOn(actionUtils, "isGhes").mockImplementation(() => true);
const failedMock = jest.spyOn(core, "setFailed");
const primaryKey = "Linux-node-bb828da54c148048dd17899ba9fda624811cfb43";
const savedCacheKey = "Linux-node-";
jest.spyOn(core, "getState")
// Cache Entry State
.mockImplementationOnce(() => {
return savedCacheKey;
})
// Cache Key State
.mockImplementationOnce(() => {
return primaryKey;
});
const inputPath = "node_modules";
testUtils.setInput(Inputs.Path, inputPath);
testUtils.setInput(Inputs.UploadChunkSize, "4000000");
const cacheId = 4;
const saveCacheMock = jest
.spyOn(cache, "saveCache")
.mockImplementationOnce(() => {
return Promise.resolve(cacheId);
});
await run();
expect(saveCacheMock).toHaveBeenCalledTimes(1);
expect(saveCacheMock).toHaveBeenCalledWith([inputPath], primaryKey, {
uploadChunkSize: 4000000
});
expect(failedMock).toHaveBeenCalledTimes(0);
});
test("save with exact match returns early", async () => {
+1711 -550
View File
@@ -1199,6 +1199,11 @@ function assertDefined(name, value) {
return value;
}
exports.assertDefined = assertDefined;
function isGhes() {
const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
}
exports.isGhes = isGhes;
//# sourceMappingURL=cacheUtils.js.map
/***/ }),
@@ -1473,17 +1478,7 @@ exports.parseURL = __webpack_require__(936).parseURL;
/***/ }),
/* 71 */
/***/ (function() {
"use strict";
if (typeof Symbol === undefined || !Symbol.asyncIterator) {
Symbol.asyncIterator = Symbol.for("Symbol.asyncIterator");
}
//# sourceMappingURL=index.js.map
/***/ }),
/* 71 */,
/* 72 */,
/* 73 */,
/* 74 */,
@@ -2743,7 +2738,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
/***/ }),
/* 96 */,
/* 97 */,
/* 97 */
/***/ (function() {
"use strict";
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
if (typeof Symbol === undefined || !Symbol.asyncIterator) {
Symbol.asyncIterator = Symbol.for("Symbol.asyncIterator");
}
//# sourceMappingURL=index.js.map
/***/ }),
/* 98 */,
/* 99 */,
/* 100 */,
@@ -3190,10 +3197,7 @@ const options_1 = __webpack_require__(538);
const requestUtils_1 = __webpack_require__(899);
const versionSalt = '1.0';
function getCacheApiUrl(resource) {
// Ideally we just use ACTIONS_CACHE_URL
const baseUrl = (process.env['ACTIONS_CACHE_URL'] ||
process.env['ACTIONS_RUNTIME_URL'] ||
'').replace('pipelines', 'artifactcache');
const baseUrl = process.env['ACTIONS_CACHE_URL'] || '';
if (!baseUrl) {
throw new Error('Cache Service Url not found, unable to restore cache.');
}
@@ -3271,18 +3275,18 @@ function downloadCache(archiveLocation, archivePath, options) {
exports.downloadCache = downloadCache;
// Reserve Cache
function reserveCache(key, paths, options) {
var _a, _b;
return __awaiter(this, void 0, void 0, function* () {
const httpClient = createHttpClient();
const version = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod);
const reserveCacheRequest = {
key,
version
version,
cacheSize: options === null || options === void 0 ? void 0 : options.cacheSize
};
const response = yield requestUtils_1.retryTypedResponse('reserveCache', () => __awaiter(this, void 0, void 0, function* () {
return httpClient.postJson(getCacheApiUrl('caches'), reserveCacheRequest);
}));
return (_b = (_a = response === null || response === void 0 ? void 0 : response.result) === null || _a === void 0 ? void 0 : _a.cacheId) !== null && _b !== void 0 ? _b : -1;
return response;
});
}
exports.reserveCache = reserveCache;
@@ -5488,7 +5492,8 @@ function downloadCacheStorageSDK(archiveLocation, archivePath, options) {
//
// If the file exceeds the buffer maximum length (~1 GB on 32-bit systems and ~2 GB
// on 64-bit systems), split the download into multiple segments
const maxSegmentSize = buffer.constants.MAX_LENGTH;
// ~2 GB = 2147483647, beyond this, we start getting out of range error. So, capping it accordingly.
const maxSegmentSize = Math.min(2147483647, buffer.constants.MAX_LENGTH);
const downloadProgress = new DownloadProgress(contentLength);
const fd = fs.openSync(archivePath, 'w');
try {
@@ -9645,6 +9650,29 @@ var events = __webpack_require__(614);
var fs = __webpack_require__(747);
var util = __webpack_require__(669);
function _interopNamespace(e) {
if (e && e.__esModule) return e;
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n["default"] = e;
return Object.freeze(n);
}
var coreHttp__namespace = /*#__PURE__*/_interopNamespace(coreHttp);
var os__namespace = /*#__PURE__*/_interopNamespace(os);
var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
var util__namespace = /*#__PURE__*/_interopNamespace(util);
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
@@ -10599,10 +10627,10 @@ const BlobItemInternal = {
modelProperties: {
name: {
serializedName: "Name",
required: true,
xmlName: "Name",
type: {
name: "String"
name: "Composite",
className: "BlobName"
}
},
deleted: {
@@ -10677,6 +10705,30 @@ const BlobItemInternal = {
}
}
};
const BlobName = {
serializedName: "BlobName",
type: {
name: "Composite",
className: "BlobName",
modelProperties: {
encoded: {
serializedName: "Encoded",
xmlName: "Encoded",
xmlIsAttribute: true,
type: {
name: "Boolean"
}
},
content: {
serializedName: "content",
xmlName: "content",
type: {
name: "String"
}
}
}
}
};
const BlobPropertiesInternal = {
serializedName: "BlobPropertiesInternal",
xmlName: "Properties",
@@ -11120,10 +11172,10 @@ const BlobPrefix = {
modelProperties: {
name: {
serializedName: "Name",
required: true,
xmlName: "Name",
type: {
name: "String"
name: "Composite",
className: "BlobName"
}
}
}
@@ -12746,6 +12798,59 @@ const ContainerSubmitBatchExceptionHeaders = {
}
}
};
const ContainerFilterBlobsHeaders = {
serializedName: "Container_filterBlobsHeaders",
type: {
name: "Composite",
className: "ContainerFilterBlobsHeaders",
modelProperties: {
clientRequestId: {
serializedName: "x-ms-client-request-id",
xmlName: "x-ms-client-request-id",
type: {
name: "String"
}
},
requestId: {
serializedName: "x-ms-request-id",
xmlName: "x-ms-request-id",
type: {
name: "String"
}
},
version: {
serializedName: "x-ms-version",
xmlName: "x-ms-version",
type: {
name: "String"
}
},
date: {
serializedName: "date",
xmlName: "date",
type: {
name: "DateTimeRfc1123"
}
}
}
}
};
const ContainerFilterBlobsExceptionHeaders = {
serializedName: "Container_filterBlobsExceptionHeaders",
type: {
name: "Composite",
className: "ContainerFilterBlobsExceptionHeaders",
modelProperties: {
errorCode: {
serializedName: "x-ms-error-code",
xmlName: "x-ms-error-code",
type: {
name: "String"
}
}
}
}
};
const ContainerAcquireLeaseHeaders = {
serializedName: "Container_acquireLeaseHeaders",
type: {
@@ -15254,6 +15359,13 @@ const BlobCopyFromURLHeaders = {
name: "ByteArray"
}
},
encryptionScope: {
serializedName: "x-ms-encryption-scope",
xmlName: "x-ms-encryption-scope",
type: {
name: "String"
}
},
errorCode: {
serializedName: "x-ms-error-code",
xmlName: "x-ms-error-code",
@@ -17771,6 +17883,7 @@ var Mappers = /*#__PURE__*/Object.freeze({
ListBlobsFlatSegmentResponse: ListBlobsFlatSegmentResponse,
BlobFlatListSegment: BlobFlatListSegment,
BlobItemInternal: BlobItemInternal,
BlobName: BlobName,
BlobPropertiesInternal: BlobPropertiesInternal,
ListBlobsHierarchySegmentResponse: ListBlobsHierarchySegmentResponse,
BlobHierarchyListSegment: BlobHierarchyListSegment,
@@ -17822,6 +17935,8 @@ var Mappers = /*#__PURE__*/Object.freeze({
ContainerRenameExceptionHeaders: ContainerRenameExceptionHeaders,
ContainerSubmitBatchHeaders: ContainerSubmitBatchHeaders,
ContainerSubmitBatchExceptionHeaders: ContainerSubmitBatchExceptionHeaders,
ContainerFilterBlobsHeaders: ContainerFilterBlobsHeaders,
ContainerFilterBlobsExceptionHeaders: ContainerFilterBlobsExceptionHeaders,
ContainerAcquireLeaseHeaders: ContainerAcquireLeaseHeaders,
ContainerAcquireLeaseExceptionHeaders: ContainerAcquireLeaseExceptionHeaders,
ContainerReleaseLeaseHeaders: ContainerReleaseLeaseHeaders,
@@ -18009,7 +18124,7 @@ const timeoutInSeconds = {
const version = {
parameterPath: "version",
mapper: {
defaultValue: "2020-10-02",
defaultValue: "2021-04-10",
isConstant: true,
serializedName: "x-ms-version",
type: {
@@ -18104,7 +18219,7 @@ const include = {
element: {
type: {
name: "Enum",
allowedValues: ["metadata", "deleted"]
allowedValues: ["metadata", "deleted", "system"]
}
}
}
@@ -18626,11 +18741,10 @@ const encryptionKeySha256 = {
}
};
const encryptionAlgorithm = {
parameterPath: ["options", "encryptionAlgorithm"],
parameterPath: ["options", "cpkInfo", "encryptionAlgorithm"],
mapper: {
defaultValue: "AES256",
isConstant: true,
serializedName: "x-ms-encryption-algorithm",
xmlName: "x-ms-encryption-algorithm",
type: {
name: "String"
}
@@ -19547,7 +19661,7 @@ class Service {
setProperties(blobServiceProperties, options) {
const operationArguments = {
blobServiceProperties,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, setPropertiesOperationSpec);
}
@@ -19558,9 +19672,9 @@ class Service {
*/
getProperties(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec);
return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec$2);
}
/**
* Retrieves statistics related to replication for the Blob service. It is only available on the
@@ -19570,7 +19684,7 @@ class Service {
*/
getStatistics(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getStatisticsOperationSpec);
}
@@ -19580,7 +19694,7 @@ class Service {
*/
listContainersSegment(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, listContainersSegmentOperationSpec);
}
@@ -19593,7 +19707,7 @@ class Service {
getUserDelegationKey(keyInfo, options) {
const operationArguments = {
keyInfo,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getUserDelegationKeyOperationSpec);
}
@@ -19603,9 +19717,9 @@ class Service {
*/
getAccountInfo(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec);
return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec$2);
}
/**
* The Batch operation allows multiple API calls to be embedded into a single HTTP request.
@@ -19620,9 +19734,9 @@ class Service {
contentLength,
multipartContentType,
body,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, submitBatchOperationSpec);
return this.client.sendOperationRequest(operationArguments, submitBatchOperationSpec$1);
}
/**
* The Filter Blobs operation enables callers to list blobs across all containers whose tags match a
@@ -19632,13 +19746,13 @@ class Service {
*/
filterBlobs(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, filterBlobsOperationSpec);
return this.client.sendOperationRequest(operationArguments, filterBlobsOperationSpec$1);
}
}
// Operation Specifications
const xmlSerializer = new coreHttp.Serializer(Mappers, /* isXml */ true);
const xmlSerializer$5 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true);
const setPropertiesOperationSpec = {
path: "/",
httpMethod: "PUT",
@@ -19667,9 +19781,9 @@ const setPropertiesOperationSpec = {
isXML: true,
contentType: "application/xml; charset=utf-8",
mediaType: "xml",
serializer: xmlSerializer
serializer: xmlSerializer$5
};
const getPropertiesOperationSpec = {
const getPropertiesOperationSpec$2 = {
path: "/",
httpMethod: "GET",
responses: {
@@ -19694,7 +19808,7 @@ const getPropertiesOperationSpec = {
accept1
],
isXML: true,
serializer: xmlSerializer
serializer: xmlSerializer$5
};
const getStatisticsOperationSpec = {
path: "/",
@@ -19721,7 +19835,7 @@ const getStatisticsOperationSpec = {
accept1
],
isXML: true,
serializer: xmlSerializer
serializer: xmlSerializer$5
};
const listContainersSegmentOperationSpec = {
path: "/",
@@ -19751,7 +19865,7 @@ const listContainersSegmentOperationSpec = {
accept1
],
isXML: true,
serializer: xmlSerializer
serializer: xmlSerializer$5
};
const getUserDelegationKeyOperationSpec = {
path: "/",
@@ -19782,9 +19896,9 @@ const getUserDelegationKeyOperationSpec = {
isXML: true,
contentType: "application/xml; charset=utf-8",
mediaType: "xml",
serializer: xmlSerializer
serializer: xmlSerializer$5
};
const getAccountInfoOperationSpec = {
const getAccountInfoOperationSpec$2 = {
path: "/",
httpMethod: "GET",
responses: {
@@ -19800,9 +19914,9 @@ const getAccountInfoOperationSpec = {
urlParameters: [url],
headerParameters: [version, accept1],
isXML: true,
serializer: xmlSerializer
serializer: xmlSerializer$5
};
const submitBatchOperationSpec = {
const submitBatchOperationSpec$1 = {
path: "/",
httpMethod: "POST",
responses: {
@@ -19832,9 +19946,9 @@ const submitBatchOperationSpec = {
isXML: true,
contentType: "application/xml; charset=utf-8",
mediaType: "xml",
serializer: xmlSerializer
serializer: xmlSerializer$5
};
const filterBlobsOperationSpec = {
const filterBlobsOperationSpec$1 = {
path: "/",
httpMethod: "GET",
responses: {
@@ -19861,7 +19975,7 @@ const filterBlobsOperationSpec = {
accept1
],
isXML: true,
serializer: xmlSerializer
serializer: xmlSerializer$5
};
/*
@@ -19887,9 +20001,9 @@ class Container {
*/
create(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, createOperationSpec);
return this.client.sendOperationRequest(operationArguments, createOperationSpec$2);
}
/**
* returns all user-defined metadata and system properties for the specified container. The data
@@ -19898,7 +20012,7 @@ class Container {
*/
getProperties(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec$1);
}
@@ -19909,9 +20023,9 @@ class Container {
*/
delete(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, deleteOperationSpec);
return this.client.sendOperationRequest(operationArguments, deleteOperationSpec$1);
}
/**
* operation sets one or more user-defined name-value pairs for the specified container.
@@ -19919,9 +20033,9 @@ class Container {
*/
setMetadata(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, setMetadataOperationSpec);
return this.client.sendOperationRequest(operationArguments, setMetadataOperationSpec$1);
}
/**
* gets the permissions for the specified container. The permissions indicate whether container data
@@ -19930,7 +20044,7 @@ class Container {
*/
getAccessPolicy(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getAccessPolicyOperationSpec);
}
@@ -19941,7 +20055,7 @@ class Container {
*/
setAccessPolicy(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, setAccessPolicyOperationSpec);
}
@@ -19951,7 +20065,7 @@ class Container {
*/
restore(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, restoreOperationSpec);
}
@@ -19963,7 +20077,7 @@ class Container {
rename(sourceContainerName, options) {
const operationArguments = {
sourceContainerName,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, renameOperationSpec);
}
@@ -19980,9 +20094,20 @@ class Container {
contentLength,
multipartContentType,
body,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, submitBatchOperationSpec$1);
return this.client.sendOperationRequest(operationArguments, submitBatchOperationSpec);
}
/**
* The Filter Blobs operation enables callers to list blobs in a container whose tags match a given
* search expression. Filter blobs searches within the given container.
* @param options The options parameters.
*/
filterBlobs(options) {
const operationArguments = {
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, filterBlobsOperationSpec);
}
/**
* [Update] establishes and manages a lock on a container for delete operations. The lock duration can
@@ -19991,9 +20116,9 @@ class Container {
*/
acquireLease(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, acquireLeaseOperationSpec);
return this.client.sendOperationRequest(operationArguments, acquireLeaseOperationSpec$1);
}
/**
* [Update] establishes and manages a lock on a container for delete operations. The lock duration can
@@ -20004,9 +20129,9 @@ class Container {
releaseLease(leaseId, options) {
const operationArguments = {
leaseId,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, releaseLeaseOperationSpec);
return this.client.sendOperationRequest(operationArguments, releaseLeaseOperationSpec$1);
}
/**
* [Update] establishes and manages a lock on a container for delete operations. The lock duration can
@@ -20017,9 +20142,9 @@ class Container {
renewLease(leaseId, options) {
const operationArguments = {
leaseId,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, renewLeaseOperationSpec);
return this.client.sendOperationRequest(operationArguments, renewLeaseOperationSpec$1);
}
/**
* [Update] establishes and manages a lock on a container for delete operations. The lock duration can
@@ -20028,9 +20153,9 @@ class Container {
*/
breakLease(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, breakLeaseOperationSpec);
return this.client.sendOperationRequest(operationArguments, breakLeaseOperationSpec$1);
}
/**
* [Update] establishes and manages a lock on a container for delete operations. The lock duration can
@@ -20045,9 +20170,9 @@ class Container {
const operationArguments = {
leaseId,
proposedLeaseId,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, changeLeaseOperationSpec);
return this.client.sendOperationRequest(operationArguments, changeLeaseOperationSpec$1);
}
/**
* [Update] The List Blobs operation returns a list of the blobs under the specified container
@@ -20055,7 +20180,7 @@ class Container {
*/
listBlobFlatSegment(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, listBlobFlatSegmentOperationSpec);
}
@@ -20070,7 +20195,7 @@ class Container {
listBlobHierarchySegment(delimiter, options) {
const operationArguments = {
delimiter,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, listBlobHierarchySegmentOperationSpec);
}
@@ -20080,14 +20205,14 @@ class Container {
*/
getAccountInfo(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec$1);
}
}
// Operation Specifications
const xmlSerializer$1 = new coreHttp.Serializer(Mappers, /* isXml */ true);
const createOperationSpec = {
const xmlSerializer$4 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true);
const createOperationSpec$2 = {
path: "/{containerName}",
httpMethod: "PUT",
responses: {
@@ -20111,7 +20236,7 @@ const createOperationSpec = {
preventEncryptionScopeOverride
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const getPropertiesOperationSpec$1 = {
path: "/{containerName}",
@@ -20134,9 +20259,9 @@ const getPropertiesOperationSpec$1 = {
leaseId
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const deleteOperationSpec = {
const deleteOperationSpec$1 = {
path: "/{containerName}",
httpMethod: "DELETE",
responses: {
@@ -20159,9 +20284,9 @@ const deleteOperationSpec = {
ifUnmodifiedSince
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const setMetadataOperationSpec = {
const setMetadataOperationSpec$1 = {
path: "/{containerName}",
httpMethod: "PUT",
responses: {
@@ -20188,7 +20313,7 @@ const setMetadataOperationSpec = {
ifModifiedSince
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const getAccessPolicyOperationSpec = {
path: "/{containerName}",
@@ -20227,7 +20352,7 @@ const getAccessPolicyOperationSpec = {
leaseId
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const setAccessPolicyOperationSpec = {
path: "/{containerName}",
@@ -20261,7 +20386,7 @@ const setAccessPolicyOperationSpec = {
isXML: true,
contentType: "application/xml; charset=utf-8",
mediaType: "xml",
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const restoreOperationSpec = {
path: "/{containerName}",
@@ -20289,7 +20414,7 @@ const restoreOperationSpec = {
deletedContainerVersion
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const renameOperationSpec = {
path: "/{containerName}",
@@ -20317,9 +20442,9 @@ const renameOperationSpec = {
sourceLeaseId
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const submitBatchOperationSpec$1 = {
const submitBatchOperationSpec = {
path: "/{containerName}",
httpMethod: "POST",
responses: {
@@ -20353,9 +20478,39 @@ const submitBatchOperationSpec$1 = {
isXML: true,
contentType: "application/xml; charset=utf-8",
mediaType: "xml",
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const acquireLeaseOperationSpec = {
const filterBlobsOperationSpec = {
path: "/{containerName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: FilterBlobSegment,
headersMapper: ContainerFilterBlobsHeaders
},
default: {
bodyMapper: StorageError,
headersMapper: ContainerFilterBlobsExceptionHeaders
}
},
queryParameters: [
timeoutInSeconds,
marker,
maxPageSize,
comp5,
where,
restype2
],
urlParameters: [url],
headerParameters: [
version,
requestId,
accept1
],
isXML: true,
serializer: xmlSerializer$4
};
const acquireLeaseOperationSpec$1 = {
path: "/{containerName}",
httpMethod: "PUT",
responses: {
@@ -20384,9 +20539,9 @@ const acquireLeaseOperationSpec = {
proposedLeaseId
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const releaseLeaseOperationSpec = {
const releaseLeaseOperationSpec$1 = {
path: "/{containerName}",
httpMethod: "PUT",
responses: {
@@ -20414,9 +20569,9 @@ const releaseLeaseOperationSpec = {
leaseId1
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const renewLeaseOperationSpec = {
const renewLeaseOperationSpec$1 = {
path: "/{containerName}",
httpMethod: "PUT",
responses: {
@@ -20444,9 +20599,9 @@ const renewLeaseOperationSpec = {
action2
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const breakLeaseOperationSpec = {
const breakLeaseOperationSpec$1 = {
path: "/{containerName}",
httpMethod: "PUT",
responses: {
@@ -20474,9 +20629,9 @@ const breakLeaseOperationSpec = {
breakPeriod
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const changeLeaseOperationSpec = {
const changeLeaseOperationSpec$1 = {
path: "/{containerName}",
httpMethod: "PUT",
responses: {
@@ -20505,7 +20660,7 @@ const changeLeaseOperationSpec = {
proposedLeaseId1
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const listBlobFlatSegmentOperationSpec = {
path: "/{containerName}",
@@ -20536,7 +20691,7 @@ const listBlobFlatSegmentOperationSpec = {
accept1
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const listBlobHierarchySegmentOperationSpec = {
path: "/{containerName}",
@@ -20568,7 +20723,7 @@ const listBlobHierarchySegmentOperationSpec = {
accept1
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const getAccountInfoOperationSpec$1 = {
path: "/{containerName}",
@@ -20586,7 +20741,7 @@ const getAccountInfoOperationSpec$1 = {
urlParameters: [url],
headerParameters: [version, accept1],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
/*
@@ -20612,7 +20767,7 @@ class Blob$1 {
*/
download(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, downloadOperationSpec);
}
@@ -20623,9 +20778,9 @@ class Blob$1 {
*/
getProperties(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec$2);
return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec);
}
/**
* If the storage account's soft delete feature is disabled then, when a blob is deleted, it is
@@ -20644,9 +20799,9 @@ class Blob$1 {
*/
delete(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, deleteOperationSpec$1);
return this.client.sendOperationRequest(operationArguments, deleteOperationSpec);
}
/**
* Undelete a blob that was previously soft deleted
@@ -20654,7 +20809,7 @@ class Blob$1 {
*/
undelete(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, undeleteOperationSpec);
}
@@ -20666,7 +20821,7 @@ class Blob$1 {
setExpiry(expiryOptions, options) {
const operationArguments = {
expiryOptions,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, setExpiryOperationSpec);
}
@@ -20676,7 +20831,7 @@ class Blob$1 {
*/
setHttpHeaders(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, setHttpHeadersOperationSpec);
}
@@ -20686,7 +20841,7 @@ class Blob$1 {
*/
setImmutabilityPolicy(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, setImmutabilityPolicyOperationSpec);
}
@@ -20696,7 +20851,7 @@ class Blob$1 {
*/
deleteImmutabilityPolicy(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, deleteImmutabilityPolicyOperationSpec);
}
@@ -20708,7 +20863,7 @@ class Blob$1 {
setLegalHold(legalHold, options) {
const operationArguments = {
legalHold,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, setLegalHoldOperationSpec);
}
@@ -20719,9 +20874,9 @@ class Blob$1 {
*/
setMetadata(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, setMetadataOperationSpec$1);
return this.client.sendOperationRequest(operationArguments, setMetadataOperationSpec);
}
/**
* [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
@@ -20730,9 +20885,9 @@ class Blob$1 {
*/
acquireLease(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, acquireLeaseOperationSpec$1);
return this.client.sendOperationRequest(operationArguments, acquireLeaseOperationSpec);
}
/**
* [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
@@ -20743,9 +20898,9 @@ class Blob$1 {
releaseLease(leaseId, options) {
const operationArguments = {
leaseId,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, releaseLeaseOperationSpec$1);
return this.client.sendOperationRequest(operationArguments, releaseLeaseOperationSpec);
}
/**
* [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
@@ -20756,9 +20911,9 @@ class Blob$1 {
renewLease(leaseId, options) {
const operationArguments = {
leaseId,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, renewLeaseOperationSpec$1);
return this.client.sendOperationRequest(operationArguments, renewLeaseOperationSpec);
}
/**
* [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
@@ -20773,9 +20928,9 @@ class Blob$1 {
const operationArguments = {
leaseId,
proposedLeaseId,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, changeLeaseOperationSpec$1);
return this.client.sendOperationRequest(operationArguments, changeLeaseOperationSpec);
}
/**
* [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
@@ -20784,9 +20939,9 @@ class Blob$1 {
*/
breakLease(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, breakLeaseOperationSpec$1);
return this.client.sendOperationRequest(operationArguments, breakLeaseOperationSpec);
}
/**
* The Create Snapshot operation creates a read-only snapshot of a blob
@@ -20794,7 +20949,7 @@ class Blob$1 {
*/
createSnapshot(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, createSnapshotOperationSpec);
}
@@ -20809,7 +20964,7 @@ class Blob$1 {
startCopyFromURL(copySource, options) {
const operationArguments = {
copySource,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, startCopyFromURLOperationSpec);
}
@@ -20825,7 +20980,7 @@ class Blob$1 {
copyFromURL(copySource, options) {
const operationArguments = {
copySource,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, copyFromURLOperationSpec);
}
@@ -20839,7 +20994,7 @@ class Blob$1 {
abortCopyFromURL(copyId, options) {
const operationArguments = {
copyId,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, abortCopyFromURLOperationSpec);
}
@@ -20855,7 +21010,7 @@ class Blob$1 {
setTier(tier, options) {
const operationArguments = {
tier,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, setTierOperationSpec);
}
@@ -20865,9 +21020,9 @@ class Blob$1 {
*/
getAccountInfo(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec$2);
return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec);
}
/**
* The Query operation enables users to select/project on blob data by providing simple query
@@ -20876,7 +21031,7 @@ class Blob$1 {
*/
query(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, queryOperationSpec);
}
@@ -20886,7 +21041,7 @@ class Blob$1 {
*/
getTags(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getTagsOperationSpec);
}
@@ -20896,13 +21051,13 @@ class Blob$1 {
*/
setTags(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, setTagsOperationSpec);
}
}
// Operation Specifications
const xmlSerializer$2 = new coreHttp.Serializer(Mappers, /* isXml */ true);
const xmlSerializer$3 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true);
const downloadOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "GET",
@@ -20950,9 +21105,9 @@ const downloadOperationSpec = {
ifTags
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const getPropertiesOperationSpec$2 = {
const getPropertiesOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "HEAD",
responses: {
@@ -20985,9 +21140,9 @@ const getPropertiesOperationSpec$2 = {
ifTags
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const deleteOperationSpec$1 = {
const deleteOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "DELETE",
responses: {
@@ -21019,7 +21174,7 @@ const deleteOperationSpec$1 = {
deleteSnapshots
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const undeleteOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21041,7 +21196,7 @@ const undeleteOperationSpec = {
accept1
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const setExpiryOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21065,7 +21220,7 @@ const setExpiryOperationSpec = {
expiresOn
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const setHttpHeadersOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21099,7 +21254,7 @@ const setHttpHeadersOperationSpec = {
blobContentDisposition
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const setImmutabilityPolicyOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21124,7 +21279,7 @@ const setImmutabilityPolicyOperationSpec = {
immutabilityPolicyMode
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const deleteImmutabilityPolicyOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21146,7 +21301,7 @@ const deleteImmutabilityPolicyOperationSpec = {
accept1
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const setLegalHoldOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21169,9 +21324,9 @@ const setLegalHoldOperationSpec = {
legalHold
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const setMetadataOperationSpec$1 = {
const setMetadataOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "PUT",
responses: {
@@ -21202,9 +21357,9 @@ const setMetadataOperationSpec$1 = {
encryptionScope
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const acquireLeaseOperationSpec$1 = {
const acquireLeaseOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "PUT",
responses: {
@@ -21232,9 +21387,9 @@ const acquireLeaseOperationSpec$1 = {
ifTags
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const releaseLeaseOperationSpec$1 = {
const releaseLeaseOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "PUT",
responses: {
@@ -21261,9 +21416,9 @@ const releaseLeaseOperationSpec$1 = {
ifTags
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const renewLeaseOperationSpec$1 = {
const renewLeaseOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "PUT",
responses: {
@@ -21290,9 +21445,9 @@ const renewLeaseOperationSpec$1 = {
ifTags
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const changeLeaseOperationSpec$1 = {
const changeLeaseOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "PUT",
responses: {
@@ -21320,9 +21475,9 @@ const changeLeaseOperationSpec$1 = {
ifTags
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const breakLeaseOperationSpec$1 = {
const breakLeaseOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "PUT",
responses: {
@@ -21349,7 +21504,7 @@ const breakLeaseOperationSpec$1 = {
ifTags
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const createSnapshotOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21382,7 +21537,7 @@ const createSnapshotOperationSpec = {
encryptionScope
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const startCopyFromURLOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21424,7 +21579,7 @@ const startCopyFromURLOperationSpec = {
legalHold1
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const copyFromURLOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21453,6 +21608,7 @@ const copyFromURLOperationSpec = {
ifTags,
immutabilityPolicyExpiry,
immutabilityPolicyMode,
encryptionScope,
tier,
sourceIfModifiedSince,
sourceIfUnmodifiedSince,
@@ -21466,7 +21622,7 @@ const copyFromURLOperationSpec = {
copySourceAuthorization
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const abortCopyFromURLOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21494,7 +21650,7 @@ const abortCopyFromURLOperationSpec = {
copyActionAbortConstant
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const setTierOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21528,9 +21684,9 @@ const setTierOperationSpec = {
tier1
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const getAccountInfoOperationSpec$2 = {
const getAccountInfoOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "GET",
responses: {
@@ -21546,7 +21702,7 @@ const getAccountInfoOperationSpec$2 = {
urlParameters: [url],
headerParameters: [version, accept1],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const queryOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21596,7 +21752,7 @@ const queryOperationSpec = {
isXML: true,
contentType: "application/xml; charset=utf-8",
mediaType: "xml",
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const getTagsOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21626,7 +21782,7 @@ const getTagsOperationSpec = {
ifTags
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const setTagsOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21660,7 +21816,7 @@ const setTagsOperationSpec = {
isXML: true,
contentType: "application/xml; charset=utf-8",
mediaType: "xml",
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
/*
@@ -21690,7 +21846,7 @@ class PageBlob {
const operationArguments = {
contentLength,
blobContentLength,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, createOperationSpec$1);
}
@@ -21704,7 +21860,7 @@ class PageBlob {
const operationArguments = {
contentLength,
body,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, uploadPagesOperationSpec);
}
@@ -21716,7 +21872,7 @@ class PageBlob {
clearPages(contentLength, options) {
const operationArguments = {
contentLength,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, clearPagesOperationSpec);
}
@@ -21737,7 +21893,7 @@ class PageBlob {
sourceRange,
contentLength,
range,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, uploadPagesFromURLOperationSpec);
}
@@ -21748,7 +21904,7 @@ class PageBlob {
*/
getPageRanges(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getPageRangesOperationSpec);
}
@@ -21759,7 +21915,7 @@ class PageBlob {
*/
getPageRangesDiff(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getPageRangesDiffOperationSpec);
}
@@ -21772,7 +21928,7 @@ class PageBlob {
resize(blobContentLength, options) {
const operationArguments = {
blobContentLength,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, resizeOperationSpec);
}
@@ -21786,7 +21942,7 @@ class PageBlob {
updateSequenceNumber(sequenceNumberAction, options) {
const operationArguments = {
sequenceNumberAction,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, updateSequenceNumberOperationSpec);
}
@@ -21805,14 +21961,14 @@ class PageBlob {
copyIncremental(copySource, options) {
const operationArguments = {
copySource,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, copyIncrementalOperationSpec);
}
}
// Operation Specifications
const xmlSerializer$3 = new coreHttp.Serializer(Mappers, /* isXml */ true);
const serializer = new coreHttp.Serializer(Mappers, /* isXml */ false);
const xmlSerializer$2 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true);
const serializer$2 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ false);
const createOperationSpec$1 = {
path: "/{containerName}/{blob}",
httpMethod: "PUT",
@@ -21859,7 +22015,7 @@ const createOperationSpec$1 = {
blobSequenceNumber
],
isXML: true,
serializer: xmlSerializer$3
serializer: xmlSerializer$2
};
const uploadPagesOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21901,7 +22057,7 @@ const uploadPagesOperationSpec = {
ifSequenceNumberEqualTo
],
mediaType: "binary",
serializer
serializer: serializer$2
};
const clearPagesOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21939,7 +22095,7 @@ const clearPagesOperationSpec = {
pageWrite1
],
isXML: true,
serializer: xmlSerializer$3
serializer: xmlSerializer$2
};
const uploadPagesFromURLOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21986,7 +22142,7 @@ const uploadPagesFromURLOperationSpec = {
range1
],
isXML: true,
serializer: xmlSerializer$3
serializer: xmlSerializer$2
};
const getPageRangesOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22020,7 +22176,7 @@ const getPageRangesOperationSpec = {
ifTags
],
isXML: true,
serializer: xmlSerializer$3
serializer: xmlSerializer$2
};
const getPageRangesDiffOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22056,7 +22212,7 @@ const getPageRangesDiffOperationSpec = {
prevSnapshotUrl
],
isXML: true,
serializer: xmlSerializer$3
serializer: xmlSerializer$2
};
const resizeOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22089,7 +22245,7 @@ const resizeOperationSpec = {
blobContentLength
],
isXML: true,
serializer: xmlSerializer$3
serializer: xmlSerializer$2
};
const updateSequenceNumberOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22119,7 +22275,7 @@ const updateSequenceNumberOperationSpec = {
sequenceNumberAction
],
isXML: true,
serializer: xmlSerializer$3
serializer: xmlSerializer$2
};
const copyIncrementalOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22147,7 +22303,7 @@ const copyIncrementalOperationSpec = {
copySource
],
isXML: true,
serializer: xmlSerializer$3
serializer: xmlSerializer$2
};
/*
@@ -22174,9 +22330,9 @@ class AppendBlob {
create(contentLength, options) {
const operationArguments = {
contentLength,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, createOperationSpec$2);
return this.client.sendOperationRequest(operationArguments, createOperationSpec);
}
/**
* The Append Block operation commits a new block of data to the end of an existing append blob. The
@@ -22190,7 +22346,7 @@ class AppendBlob {
const operationArguments = {
contentLength,
body,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, appendBlockOperationSpec);
}
@@ -22207,7 +22363,7 @@ class AppendBlob {
const operationArguments = {
sourceUrl,
contentLength,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, appendBlockFromUrlOperationSpec);
}
@@ -22218,15 +22374,15 @@ class AppendBlob {
*/
seal(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, sealOperationSpec);
}
}
// Operation Specifications
const xmlSerializer$4 = new coreHttp.Serializer(Mappers, /* isXml */ true);
const serializer$1 = new coreHttp.Serializer(Mappers, /* isXml */ false);
const createOperationSpec$2 = {
const xmlSerializer$1 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true);
const serializer$1 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ false);
const createOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "PUT",
responses: {
@@ -22269,7 +22425,7 @@ const createOperationSpec$2 = {
blobType1
],
isXML: true,
serializer: xmlSerializer$4
serializer: xmlSerializer$1
};
const appendBlockOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22353,7 +22509,7 @@ const appendBlockFromUrlOperationSpec = {
sourceRange1
],
isXML: true,
serializer: xmlSerializer$4
serializer: xmlSerializer$1
};
const sealOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22381,7 +22537,7 @@ const sealOperationSpec = {
appendPosition
],
isXML: true,
serializer: xmlSerializer$4
serializer: xmlSerializer$1
};
/*
@@ -22413,7 +22569,7 @@ class BlockBlob {
const operationArguments = {
contentLength,
body,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, uploadOperationSpec);
}
@@ -22434,7 +22590,7 @@ class BlockBlob {
const operationArguments = {
contentLength,
copySource,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, putBlobFromUrlOperationSpec);
}
@@ -22452,7 +22608,7 @@ class BlockBlob {
blockId,
contentLength,
body,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, stageBlockOperationSpec);
}
@@ -22471,7 +22627,7 @@ class BlockBlob {
blockId,
contentLength,
sourceUrl,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, stageBlockFromURLOperationSpec);
}
@@ -22489,7 +22645,7 @@ class BlockBlob {
commitBlockList(blocks, options) {
const operationArguments = {
blocks,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, commitBlockListOperationSpec);
}
@@ -22503,14 +22659,14 @@ class BlockBlob {
getBlockList(listType, options) {
const operationArguments = {
listType,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getBlockListOperationSpec);
}
}
// Operation Specifications
const xmlSerializer$5 = new coreHttp.Serializer(Mappers, /* isXml */ true);
const serializer$2 = new coreHttp.Serializer(Mappers, /* isXml */ false);
const xmlSerializer = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true);
const serializer = new coreHttp__namespace.Serializer(Mappers, /* isXml */ false);
const uploadOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "PUT",
@@ -22558,7 +22714,7 @@ const uploadOperationSpec = {
blobType2
],
mediaType: "binary",
serializer: serializer$2
serializer
};
const putBlobFromUrlOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22611,7 +22767,7 @@ const putBlobFromUrlOperationSpec = {
copySourceBlobProperties
],
isXML: true,
serializer: xmlSerializer$5
serializer: xmlSerializer
};
const stageBlockOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22647,7 +22803,7 @@ const stageBlockOperationSpec = {
accept2
],
mediaType: "binary",
serializer: serializer$2
serializer
};
const stageBlockFromURLOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22688,7 +22844,7 @@ const stageBlockFromURLOperationSpec = {
sourceRange1
],
isXML: true,
serializer: xmlSerializer$5
serializer: xmlSerializer
};
const commitBlockListOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22738,7 +22894,7 @@ const commitBlockListOperationSpec = {
isXML: true,
contentType: "application/xml; charset=utf-8",
mediaType: "xml",
serializer: xmlSerializer$5
serializer: xmlSerializer
};
const getBlockListOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22768,7 +22924,7 @@ const getBlockListOperationSpec = {
ifTags
],
isXML: true,
serializer: xmlSerializer$5
serializer: xmlSerializer
};
// Copyright (c) Microsoft Corporation.
@@ -22779,8 +22935,8 @@ const logger = logger$1.createClientLogger("storage-blob");
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
const SDK_VERSION = "12.8.0";
const SERVICE_VERSION = "2020-10-02";
const SDK_VERSION = "12.9.0";
const SERVICE_VERSION = "2021-04-10";
const BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB
const BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB
const BLOCK_BLOB_MAX_BLOCKS = 50000;
@@ -22797,15 +22953,15 @@ const URLConstants = {
SIGNATURE: "sig",
SNAPSHOT: "snapshot",
VERSIONID: "versionid",
TIMEOUT: "timeout"
}
TIMEOUT: "timeout",
},
};
const HTTPURLConnection = {
HTTP_ACCEPTED: 202,
HTTP_CONFLICT: 409,
HTTP_NOT_FOUND: 404,
HTTP_PRECON_FAILED: 412,
HTTP_RANGE_NOT_SATISFIABLE: 416
HTTP_RANGE_NOT_SATISFIABLE: 416,
};
const HeaderConstants = {
AUTHORIZATION: "Authorization",
@@ -22830,7 +22986,7 @@ const HeaderConstants = {
X_MS_COPY_SOURCE: "x-ms-copy-source",
X_MS_DATE: "x-ms-date",
X_MS_ERROR_CODE: "x-ms-error-code",
X_MS_VERSION: "x-ms-version"
X_MS_VERSION: "x-ms-version",
};
const ETagNone = "";
const ETagAny = "*";
@@ -22935,7 +23091,7 @@ const StorageBlobLoggingAllowedHeaderNames = [
"x-ms-tag-count",
"x-ms-encryption-key-sha256",
"x-ms-if-tags",
"x-ms-source-if-tags"
"x-ms-source-if-tags",
];
const StorageBlobLoggingAllowedQueryParameters = [
"comp",
@@ -22970,8 +23126,9 @@ const StorageBlobLoggingAllowedQueryParameters = [
"skt",
"sktid",
"skv",
"snapshot"
"snapshot",
];
const BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption";
// Copyright (c) Microsoft Corporation.
/**
@@ -23111,7 +23268,7 @@ function extractConnectionStringParts(connectionString) {
url: blobEndpoint,
accountName,
accountKey,
proxyUri
proxyUri,
};
}
else {
@@ -23443,14 +23600,14 @@ function toBlobTags(tags) {
return undefined;
}
const res = {
blobTagSet: []
blobTagSet: [],
};
for (const key in tags) {
if (Object.prototype.hasOwnProperty.call(tags, key)) {
const value = tags[key];
res.blobTagSet.push({
key,
value
value,
});
}
}
@@ -23490,33 +23647,33 @@ function toQuerySerialization(textConfiguration) {
fieldQuote: textConfiguration.fieldQuote || "",
recordSeparator: textConfiguration.recordSeparator,
escapeChar: textConfiguration.escapeCharacter || "",
headersPresent: textConfiguration.hasHeaders || false
}
}
headersPresent: textConfiguration.hasHeaders || false,
},
},
};
case "json":
return {
format: {
type: "json",
jsonTextConfiguration: {
recordSeparator: textConfiguration.recordSeparator
}
}
recordSeparator: textConfiguration.recordSeparator,
},
},
};
case "arrow":
return {
format: {
type: "arrow",
arrowConfiguration: {
schema: textConfiguration.schema
}
}
schema: textConfiguration.schema,
},
},
};
case "parquet":
return {
format: {
type: "parquet"
}
type: "parquet",
},
};
default:
throw Error("Invalid BlobQueryTextConfiguration.");
@@ -23540,7 +23697,7 @@ function parseObjectReplicationRecord(objectReplicationRecord) {
}
const rule = {
ruleId: ids[1],
replicationStatus: objectReplicationRecord[key]
replicationStatus: objectReplicationRecord[key],
};
const policyIndex = orProperties.findIndex((policy) => policy.policyId === ids[0]);
if (policyIndex > -1) {
@@ -23549,7 +23706,7 @@ function parseObjectReplicationRecord(objectReplicationRecord) {
else {
orProperties.push({
policyId: ids[0],
rules: [rule]
rules: [rule],
});
}
}
@@ -23568,6 +23725,202 @@ function attachCredential(thing, credential) {
function httpAuthorizationToString(httpAuthorization) {
return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : undefined;
}
function BlobNameToString(name) {
if (name.encoded) {
return decodeURIComponent(name.content);
}
else {
return name.content;
}
}
function ConvertInternalResponseOfListBlobFlat(internalResponse) {
return Object.assign(Object.assign({}, internalResponse), { segment: {
blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => {
const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) });
return blobItem;
}),
} });
}
function ConvertInternalResponseOfListBlobHierarchy(internalResponse) {
var _a;
return Object.assign(Object.assign({}, internalResponse), { segment: {
blobPrefixes: (_a = internalResponse.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => {
const blobPrefix = {
name: BlobNameToString(blobPrefixInternal.name),
};
return blobPrefix;
}),
blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => {
const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) });
return blobItem;
}),
} });
}
function decodeBase64String(value) {
if (coreHttp.isNode) {
return Buffer.from(value, "base64");
}
else {
const byteString = atob(value);
const arr = new Uint8Array(byteString.length);
for (let i = 0; i < byteString.length; i++) {
arr[i] = byteString.charCodeAt(i);
}
return arr;
}
}
function ParseBoolean(content) {
if (content === undefined)
return undefined;
if (content === "true")
return true;
if (content === "false")
return false;
return undefined;
}
function ParseBlobName(blobNameInXML) {
if (blobNameInXML["$"] !== undefined && blobNameInXML["#"] !== undefined) {
return {
encoded: ParseBoolean(blobNameInXML["$"]["Encoded"]),
content: blobNameInXML["#"],
};
}
else {
return {
encoded: false,
content: blobNameInXML,
};
}
}
function ParseBlobItem(blobInXML) {
const blobPropertiesInXML = blobInXML["Properties"];
const blobProperties = {
createdOn: new Date(blobPropertiesInXML["Creation-Time"]),
lastModified: new Date(blobPropertiesInXML["Last-Modified"]),
etag: blobPropertiesInXML["Etag"],
contentLength: blobPropertiesInXML["Content-Length"] === undefined
? undefined
: parseFloat(blobPropertiesInXML["Content-Length"]),
contentType: blobPropertiesInXML["Content-Type"],
contentEncoding: blobPropertiesInXML["Content-Encoding"],
contentLanguage: blobPropertiesInXML["Content-Language"],
contentMD5: decodeBase64String(blobPropertiesInXML["Content-MD5"]),
contentDisposition: blobPropertiesInXML["Content-Disposition"],
cacheControl: blobPropertiesInXML["Cache-Control"],
blobSequenceNumber: blobPropertiesInXML["x-ms-blob-sequence-number"] === undefined
? undefined
: parseFloat(blobPropertiesInXML["x-ms-blob-sequence-number"]),
blobType: blobPropertiesInXML["BlobType"],
leaseStatus: blobPropertiesInXML["LeaseStatus"],
leaseState: blobPropertiesInXML["LeaseState"],
leaseDuration: blobPropertiesInXML["LeaseDuration"],
copyId: blobPropertiesInXML["CopyId"],
copyStatus: blobPropertiesInXML["CopyStatus"],
copySource: blobPropertiesInXML["CopySource"],
copyProgress: blobPropertiesInXML["CopyProgress"],
copyCompletedOn: blobPropertiesInXML["CopyCompletionTime"] === undefined
? undefined
: new Date(blobPropertiesInXML["CopyCompletionTime"]),
copyStatusDescription: blobPropertiesInXML["CopyStatusDescription"],
serverEncrypted: ParseBoolean(blobPropertiesInXML["ServerEncrypted"]),
incrementalCopy: ParseBoolean(blobPropertiesInXML["IncrementalCopy"]),
destinationSnapshot: blobPropertiesInXML["DestinationSnapshot"],
deletedOn: blobPropertiesInXML["DeletedTime"] === undefined
? undefined
: new Date(blobPropertiesInXML["DeletedTime"]),
remainingRetentionDays: blobPropertiesInXML["RemainingRetentionDays"] === undefined
? undefined
: parseFloat(blobPropertiesInXML["RemainingRetentionDays"]),
accessTier: blobPropertiesInXML["AccessTier"],
accessTierInferred: ParseBoolean(blobPropertiesInXML["AccessTierInferred"]),
archiveStatus: blobPropertiesInXML["ArchiveStatus"],
customerProvidedKeySha256: blobPropertiesInXML["CustomerProvidedKeySha256"],
encryptionScope: blobPropertiesInXML["EncryptionScope"],
accessTierChangedOn: blobPropertiesInXML["AccessTierChangeTime"] === undefined
? undefined
: new Date(blobPropertiesInXML["AccessTierChangeTime"]),
tagCount: blobPropertiesInXML["TagCount"] === undefined
? undefined
: parseFloat(blobPropertiesInXML["TagCount"]),
expiresOn: blobPropertiesInXML["Expiry-Time"] === undefined
? undefined
: new Date(blobPropertiesInXML["Expiry-Time"]),
isSealed: ParseBoolean(blobPropertiesInXML["Sealed"]),
rehydratePriority: blobPropertiesInXML["RehydratePriority"],
lastAccessedOn: blobPropertiesInXML["LastAccessTime"] === undefined
? undefined
: new Date(blobPropertiesInXML["LastAccessTime"]),
immutabilityPolicyExpiresOn: blobPropertiesInXML["ImmutabilityPolicyUntilDate"] === undefined
? undefined
: new Date(blobPropertiesInXML["ImmutabilityPolicyUntilDate"]),
immutabilityPolicyMode: blobPropertiesInXML["ImmutabilityPolicyMode"],
legalHold: ParseBoolean(blobPropertiesInXML["LegalHold"]),
};
return {
name: ParseBlobName(blobInXML["Name"]),
deleted: ParseBoolean(blobInXML["Deleted"]),
snapshot: blobInXML["Snapshot"],
versionId: blobInXML["VersionId"],
isCurrentVersion: ParseBoolean(blobInXML["IsCurrentVersion"]),
properties: blobProperties,
metadata: blobInXML["Metadata"],
blobTags: ParseBlobTags(blobInXML["Tags"]),
objectReplicationMetadata: blobInXML["OrMetadata"],
hasVersionsOnly: ParseBoolean(blobInXML["HasVersionsOnly"]),
};
}
function ParseBlobPrefix(blobPrefixInXML) {
return {
name: ParseBlobName(blobPrefixInXML["Name"]),
};
}
function ParseBlobTag(blobTagInXML) {
return {
key: blobTagInXML["Key"],
value: blobTagInXML["Value"],
};
}
function ParseBlobTags(blobTagsInXML) {
if (blobTagsInXML === undefined ||
blobTagsInXML["TagSet"] === undefined ||
blobTagsInXML["TagSet"]["Tag"] === undefined) {
return undefined;
}
const blobTagSet = [];
if (blobTagsInXML["TagSet"]["Tag"] instanceof Array) {
blobTagsInXML["TagSet"]["Tag"].forEach((blobTagInXML) => {
blobTagSet.push(ParseBlobTag(blobTagInXML));
});
}
else {
blobTagSet.push(ParseBlobTag(blobTagsInXML["TagSet"]["Tag"]));
}
return { blobTagSet: blobTagSet };
}
function ProcessBlobItems(blobArrayInXML) {
const blobItems = [];
if (blobArrayInXML instanceof Array) {
blobArrayInXML.forEach((blobInXML) => {
blobItems.push(ParseBlobItem(blobInXML));
});
}
else {
blobItems.push(ParseBlobItem(blobArrayInXML));
}
return blobItems;
}
function ProcessBlobPrefixes(blobPrefixesInXML) {
const blobPrefixes = [];
if (blobPrefixesInXML instanceof Array) {
blobPrefixesInXML.forEach((blobPrefixInXML) => {
blobPrefixes.push(ParseBlobPrefix(blobPrefixInXML));
});
}
else {
blobPrefixes.push(ParseBlobPrefix(blobPrefixesInXML));
}
return blobPrefixes;
}
// Copyright (c) Microsoft Corporation.
/**
@@ -23598,9 +23951,16 @@ class StorageBrowserPolicy extends coreHttp.BaseRequestPolicy {
* @param request -
*/
async sendRequest(request) {
{
if (coreHttp.isNode) {
return this._nextPolicy.sendRequest(request);
}
if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") {
request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, new Date().getTime().toString());
}
request.headers.remove(HeaderConstants.COOKIE);
// According to XHR standards, content-length should be fully controlled by browsers
request.headers.remove(HeaderConstants.CONTENT_LENGTH);
return this._nextPolicy.sendRequest(request);
}
}
@@ -23621,6 +23981,10 @@ class StorageBrowserPolicyFactory {
}
// Copyright (c) Microsoft Corporation.
/**
* RetryPolicy types.
*/
exports.StorageRetryPolicyType = void 0;
(function (StorageRetryPolicyType) {
/**
* Exponential retry. Retry time delay grows exponentially.
@@ -23638,7 +24002,7 @@ const DEFAULT_RETRY_OPTIONS = {
retryDelayInMs: 4 * 1000,
retryPolicyType: exports.StorageRetryPolicyType.EXPONENTIAL,
secondaryHost: "",
tryTimeoutInMs: undefined // Use server side default timeout strategy
tryTimeoutInMs: undefined, // Use server side default timeout strategy
};
const RETRY_ABORT_ERROR = new abortController.AbortError("The operation was aborted.");
/**
@@ -23675,7 +24039,7 @@ class StorageRetryPolicy extends coreHttp.BaseRequestPolicy {
: DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs,
secondaryHost: retryOptions.secondaryHost
? retryOptions.secondaryHost
: DEFAULT_RETRY_OPTIONS.secondaryHost
: DEFAULT_RETRY_OPTIONS.secondaryHost,
};
}
/**
@@ -23752,7 +24116,7 @@ class StorageRetryPolicy extends coreHttp.BaseRequestPolicy {
"ENOTFOUND",
"TIMEOUT",
"EPIPE",
"REQUEST_SEND_ERROR" // For default xhr based http client provided in ms-rest-js
"REQUEST_SEND_ERROR", // For default xhr based http client provided in ms-rest-js
];
if (err) {
for (const retriableError of retriableErrors) {
@@ -23938,7 +24302,7 @@ class TelemetryPolicy extends coreHttp.BaseRequestPolicy {
* @param request -
*/
async sendRequest(request) {
{
if (coreHttp.isNode) {
if (!request.headers) {
request.headers = new coreHttp.HttpHeaders();
}
@@ -23961,7 +24325,7 @@ class TelemetryPolicyFactory {
*/
constructor(telemetry) {
const userAgentInfo = [];
{
if (coreHttp.isNode) {
if (telemetry) {
const telemetryString = telemetry.userAgentPrefix || "";
if (telemetryString.length > 0 && userAgentInfo.indexOf(telemetryString) === -1) {
@@ -23974,7 +24338,7 @@ class TelemetryPolicyFactory {
userAgentInfo.push(libInfo);
}
// e.g. (NODE-VERSION 4.9.1; Windows_NT 10.0.16299)
const runtimeInfo = `(NODE-VERSION ${process.version}; ${os.type()} ${os.release()})`;
const runtimeInfo = `(NODE-VERSION ${process.version}; ${os__namespace.type()} ${os__namespace.release()})`;
if (userAgentInfo.indexOf(runtimeInfo) === -1) {
userAgentInfo.push(runtimeInfo);
}
@@ -23998,6 +24362,247 @@ function getCachedDefaultHttpClient() {
return _defaultHttpClient;
}
// Copyright (c) Microsoft Corporation.
/**
* A set of constants used internally when processing requests.
*/
const Constants = {
DefaultScope: "/.default",
/**
* Defines constants for use with HTTP headers.
*/
HeaderConstants: {
/**
* The Authorization header.
*/
AUTHORIZATION: "authorization",
},
};
// Default options for the cycler if none are provided
const DEFAULT_CYCLER_OPTIONS = {
forcedRefreshWindowInMs: 1000,
retryIntervalInMs: 3000,
refreshWindowInMs: 1000 * 60 * 2, // Start refreshing 2m before expiry
};
/**
* Converts an an unreliable access token getter (which may resolve with null)
* into an AccessTokenGetter by retrying the unreliable getter in a regular
* interval.
*
* @param getAccessToken - a function that produces a promise of an access
* token that may fail by returning null
* @param retryIntervalInMs - the time (in milliseconds) to wait between retry
* attempts
* @param timeoutInMs - the timestamp after which the refresh attempt will fail,
* throwing an exception
* @returns - a promise that, if it resolves, will resolve with an access token
*/
async function beginRefresh(getAccessToken, retryIntervalInMs, timeoutInMs) {
// This wrapper handles exceptions gracefully as long as we haven't exceeded
// the timeout.
async function tryGetAccessToken() {
if (Date.now() < timeoutInMs) {
try {
return await getAccessToken();
}
catch (_a) {
return null;
}
}
else {
const finalToken = await getAccessToken();
// Timeout is up, so throw if it's still null
if (finalToken === null) {
throw new Error("Failed to refresh access token.");
}
return finalToken;
}
}
let token = await tryGetAccessToken();
while (token === null) {
await coreHttp.delay(retryIntervalInMs);
token = await tryGetAccessToken();
}
return token;
}
/**
* Creates a token cycler from a credential, scopes, and optional settings.
*
* A token cycler represents a way to reliably retrieve a valid access token
* from a TokenCredential. It will handle initializing the token, refreshing it
* when it nears expiration, and synchronizes refresh attempts to avoid
* concurrency hazards.
*
* @param credential - the underlying TokenCredential that provides the access
* token
* @param scopes - the scopes to request authorization for
* @param tokenCyclerOptions - optionally override default settings for the cycler
*
* @returns - a function that reliably produces a valid access token
*/
function createTokenCycler(credential, scopes, tokenCyclerOptions) {
let refreshWorker = null;
let token = null;
const options = Object.assign(Object.assign({}, DEFAULT_CYCLER_OPTIONS), tokenCyclerOptions);
/**
* This little holder defines several predicates that we use to construct
* the rules of refreshing the token.
*/
const cycler = {
/**
* Produces true if a refresh job is currently in progress.
*/
get isRefreshing() {
return refreshWorker !== null;
},
/**
* Produces true if the cycler SHOULD refresh (we are within the refresh
* window and not already refreshing)
*/
get shouldRefresh() {
var _a;
return (!cycler.isRefreshing &&
((_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 0) - options.refreshWindowInMs < Date.now());
},
/**
* Produces true if the cycler MUST refresh (null or nearly-expired
* token).
*/
get mustRefresh() {
return (token === null || token.expiresOnTimestamp - options.forcedRefreshWindowInMs < Date.now());
},
};
/**
* Starts a refresh job or returns the existing job if one is already
* running.
*/
function refresh(getTokenOptions) {
var _a;
if (!cycler.isRefreshing) {
// We bind `scopes` here to avoid passing it around a lot
const tryGetAccessToken = () => credential.getToken(scopes, getTokenOptions);
// Take advantage of promise chaining to insert an assignment to `token`
// before the refresh can be considered done.
refreshWorker = beginRefresh(tryGetAccessToken, options.retryIntervalInMs,
// If we don't have a token, then we should timeout immediately
(_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : Date.now())
.then((_token) => {
refreshWorker = null;
token = _token;
return token;
})
.catch((reason) => {
// We also should reset the refresher if we enter a failed state. All
// existing awaiters will throw, but subsequent requests will start a
// new retry chain.
refreshWorker = null;
token = null;
throw reason;
});
}
return refreshWorker;
}
return async (tokenOptions) => {
//
// Simple rules:
// - If we MUST refresh, then return the refresh task, blocking
// the pipeline until a token is available.
// - If we SHOULD refresh, then run refresh but don't return it
// (we can still use the cached token).
// - Return the token, since it's fine if we didn't return in
// step 1.
//
if (cycler.mustRefresh)
return refresh(tokenOptions);
if (cycler.shouldRefresh) {
refresh(tokenOptions);
}
return token;
};
}
/**
* We will retrieve the challenge only if the response status code was 401,
* and if the response contained the header "WWW-Authenticate" with a non-empty value.
*/
function getChallenge(response) {
const challenge = response.headers.get("WWW-Authenticate");
if (response.status === 401 && challenge) {
return challenge;
}
return;
}
/**
* Converts: `Bearer a="b" c="d"`.
* Into: `[ { a: 'b', c: 'd' }]`.
*
* @internal
*/
function parseChallenge(challenge) {
const bearerChallenge = challenge.slice("Bearer ".length);
const challengeParts = `${bearerChallenge.trim()} `.split(" ").filter((x) => x);
const keyValuePairs = challengeParts.map((keyValue) => (([key, value]) => ({ [key]: value }))(keyValue.trim().split("=")));
// Key-value pairs to plain object:
return keyValuePairs.reduce((a, b) => (Object.assign(Object.assign({}, a), b)), {});
}
// #endregion
/**
* Creates a new factory for a RequestPolicy that applies a bearer token to
* the requests' `Authorization` headers.
*
* @param credential - The TokenCredential implementation that can supply the bearer token.
* @param scopes - The scopes for which the bearer token applies.
*/
function storageBearerTokenChallengeAuthenticationPolicy(credential, scopes) {
// This simple function encapsulates the entire process of reliably retrieving the token
let getToken = createTokenCycler(credential, scopes);
class StorageBearerTokenChallengeAuthenticationPolicy extends coreHttp.BaseRequestPolicy {
constructor(nextPolicy, options) {
super(nextPolicy, options);
}
async sendRequest(webResource) {
if (!webResource.url.toLowerCase().startsWith("https://")) {
throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.");
}
const getTokenInternal = getToken;
const token = (await getTokenInternal({
abortSignal: webResource.abortSignal,
tracingOptions: {
tracingContext: webResource.tracingContext,
},
})).token;
webResource.headers.set(Constants.HeaderConstants.AUTHORIZATION, `Bearer ${token}`);
const response = await this._nextPolicy.sendRequest(webResource);
if ((response === null || response === void 0 ? void 0 : response.status) === 401) {
const challenge = getChallenge(response);
if (challenge) {
const challengeInfo = parseChallenge(challenge);
const challengeScopes = challengeInfo.resource_id + Constants.DefaultScope;
const parsedAuthUri = coreHttp.URLBuilder.parse(challengeInfo.authorization_uri);
const pathSegments = parsedAuthUri.getPath().split("/");
const tenantId = pathSegments[1];
const getTokenForChallenge = createTokenCycler(credential, challengeScopes);
const tokenForChallenge = (await getTokenForChallenge({
abortSignal: webResource.abortSignal,
tracingOptions: {
tracingContext: webResource.tracingContext,
},
tenantId: tenantId,
})).token;
getToken = getTokenForChallenge;
webResource.headers.set(Constants.HeaderConstants.AUTHORIZATION, `Bearer ${tokenForChallenge}`);
return this._nextPolicy.sendRequest(webResource);
}
}
return response;
}
}
return {
create: (nextPolicy, options) => {
return new StorageBearerTokenChallengeAuthenticationPolicy(nextPolicy, options);
},
};
}
// Copyright (c) Microsoft Corporation.
/**
* A helper to decide if a given argument satisfies the Pipeline contract
@@ -24043,7 +24648,7 @@ class Pipeline {
toServiceClientOptions() {
return {
httpClient: this.options.httpClient,
requestPolicyFactories: this.factories
requestPolicyFactories: this.factories,
};
}
}
@@ -24055,6 +24660,7 @@ class Pipeline {
* @returns A new Pipeline object.
*/
function newPipeline(credential, pipelineOptions = {}) {
var _a;
if (credential === undefined) {
credential = new AnonymousCredential();
}
@@ -24076,16 +24682,16 @@ function newPipeline(credential, pipelineOptions = {}) {
coreHttp.logPolicy({
logger: logger.info,
allowedHeaderNames: StorageBlobLoggingAllowedHeaderNames,
allowedQueryParameters: StorageBlobLoggingAllowedQueryParameters
})
allowedQueryParameters: StorageBlobLoggingAllowedQueryParameters,
}),
];
{
if (coreHttp.isNode) {
// policies only available in Node.js runtime, not in browsers
factories.push(coreHttp.proxyPolicy(pipelineOptions.proxyOptions));
factories.push(coreHttp.disableResponseDecompressionPolicy());
}
factories.push(coreHttp.isTokenCredential(credential)
? attachCredential(coreHttp.bearerTokenAuthenticationPolicy(credential, StorageOAuthScopes), credential)
? attachCredential(storageBearerTokenChallengeAuthenticationPolicy(credential, (_a = pipelineOptions.audience) !== null && _a !== void 0 ? _a : StorageOAuthScopes), credential)
: credential);
return new Pipeline(factories, pipelineOptions);
}
@@ -24112,7 +24718,9 @@ class StorageSharedKeyCredentialPolicy extends CredentialPolicy {
*/
signRequest(request) {
request.headers.set(HeaderConstants.X_MS_DATE, new Date().toUTCString());
if (request.body && typeof request.body === "string" && request.body.length > 0) {
if (request.body &&
(typeof request.body === "string" || request.body !== undefined) &&
request.body.length > 0) {
request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body));
}
const stringToSign = [
@@ -24127,7 +24735,7 @@ class StorageSharedKeyCredentialPolicy extends CredentialPolicy {
this.getHeaderValueToSign(request, HeaderConstants.IF_MATCH),
this.getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH),
this.getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE),
this.getHeaderValueToSign(request, HeaderConstants.RANGE)
this.getHeaderValueToSign(request, HeaderConstants.RANGE),
].join("\n") +
"\n" +
this.getCanonicalizedHeadersString(request) +
@@ -24256,9 +24864,7 @@ class StorageSharedKeyCredential extends Credential {
* @param stringToSign -
*/
computeHMACSHA256(stringToSign) {
return crypto.createHmac("sha256", this.accountKey)
.update(stringToSign, "utf8")
.digest("base64");
return crypto.createHmac("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64");
}
}
@@ -24270,8 +24876,8 @@ class StorageSharedKeyCredential extends Credential {
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
const packageName = "azure-storage-blob";
const packageVersion = "12.8.0";
class StorageClientContext extends coreHttp.ServiceClient {
const packageVersion = "12.9.0";
class StorageClientContext extends coreHttp__namespace.ServiceClient {
/**
* Initializes a new instance of the StorageClientContext class.
* @param url The URL of the service account, container, or blob that is the target of the desired
@@ -24287,7 +24893,7 @@ class StorageClientContext extends coreHttp.ServiceClient {
options = {};
}
if (!options.userAgent) {
const defaultUserAgent = coreHttp.getDefaultUserAgentValue();
const defaultUserAgent = coreHttp__namespace.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}
super(undefined, options);
@@ -24296,7 +24902,7 @@ class StorageClientContext extends coreHttp.ServiceClient {
// Parameter assignments
this.url = url;
// Assigning values to Constant parameters
this.version = options.version || "2020-10-02";
this.version = options.version || "2021-04-10";
}
}
@@ -24343,7 +24949,7 @@ class StorageClient {
*/
const createSpan = coreTracing.createSpanFunction({
packagePrefix: "Azure.Storage.Blob",
namespace: "Microsoft.Storage"
namespace: "Microsoft.Storage",
});
/**
* @internal
@@ -24357,7 +24963,7 @@ function convertTracingToRequestOptionsBase(options) {
return {
// By passing spanOptions if they exist at runtime, we're backwards compatible with @azure/core-tracing@preview.13 and earlier.
spanOptions: (_a = options === null || options === void 0 ? void 0 : options.tracingOptions) === null || _a === void 0 ? void 0 : _a.spanOptions,
tracingContext: (_b = options === null || options === void 0 ? void 0 : options.tracingOptions) === null || _b === void 0 ? void 0 : _b.tracingContext
tracingContext: (_b = options === null || options === void 0 ? void 0 : options.tracingOptions) === null || _b === void 0 ? void 0 : _b.tracingContext,
};
}
@@ -24414,6 +25020,10 @@ class BlobSASPermissions {
* Specifies SetImmutabilityPolicy access granted.
*/
this.setImmutabilityPolicy = false;
/**
* Specifies that Permanent Delete is permitted.
*/
this.permanentDelete = false;
}
/**
* Creates a {@link BlobSASPermissions} from the specified permissions string. This method will throw an
@@ -24455,6 +25065,9 @@ class BlobSASPermissions {
case "i":
blobSASPermissions.setImmutabilityPolicy = true;
break;
case "y":
blobSASPermissions.permanentDelete = true;
break;
default:
throw new RangeError(`Invalid permission: ${char}`);
}
@@ -24499,6 +25112,9 @@ class BlobSASPermissions {
if (permissionLike.setImmutabilityPolicy) {
blobSASPermissions.setImmutabilityPolicy = true;
}
if (permissionLike.permanentDelete) {
blobSASPermissions.permanentDelete = true;
}
return blobSASPermissions;
}
/**
@@ -24539,6 +25155,9 @@ class BlobSASPermissions {
if (this.setImmutabilityPolicy) {
permissions.push("i");
}
if (this.permanentDelete) {
permissions.push("y");
}
return permissions.join("");
}
}
@@ -24598,6 +25217,14 @@ class ContainerSASPermissions {
* Specifies SetImmutabilityPolicy access granted.
*/
this.setImmutabilityPolicy = false;
/**
* Specifies that Permanent Delete is permitted.
*/
this.permanentDelete = false;
/**
* Specifies that Filter Blobs by Tags is permitted.
*/
this.filterByTags = false;
}
/**
* Creates an {@link ContainerSASPermissions} from the specified permissions string. This method will throw an
@@ -24642,6 +25269,12 @@ class ContainerSASPermissions {
case "i":
containerSASPermissions.setImmutabilityPolicy = true;
break;
case "y":
containerSASPermissions.permanentDelete = true;
break;
case "f":
containerSASPermissions.filterByTags = true;
break;
default:
throw new RangeError(`Invalid permission ${char}`);
}
@@ -24689,6 +25322,12 @@ class ContainerSASPermissions {
if (permissionLike.setImmutabilityPolicy) {
containerSASPermissions.setImmutabilityPolicy = true;
}
if (permissionLike.permanentDelete) {
containerSASPermissions.permanentDelete = true;
}
if (permissionLike.filterByTags) {
containerSASPermissions.filterByTags = true;
}
return containerSASPermissions;
}
/**
@@ -24734,6 +25373,12 @@ class ContainerSASPermissions {
if (this.setImmutabilityPolicy) {
permissions.push("i");
}
if (this.permanentDelete) {
permissions.push("y");
}
if (this.filterByTags) {
permissions.push("f");
}
return permissions.join("");
}
}
@@ -24763,9 +25408,7 @@ class UserDelegationKeyCredential {
*/
computeHMACSHA256(stringToSign) {
// console.log(`stringToSign: ${JSON.stringify(stringToSign)}`);
return crypto.createHmac("sha256", this.key)
.update(stringToSign, "utf8")
.digest("base64");
return crypto.createHmac("sha256", this.key).update(stringToSign, "utf8").digest("base64");
}
}
@@ -24783,6 +25426,10 @@ function ipRangeToString(ipRange) {
}
// Copyright (c) Microsoft Corporation.
/**
* Protocols for generated SAS.
*/
exports.SASProtocol = void 0;
(function (SASProtocol) {
/**
* Protocol that allows HTTPS only
@@ -24803,7 +25450,7 @@ function ipRangeToString(ipRange) {
* NOTE: Instances of this class are immutable.
*/
class SASQueryParameters {
constructor(version, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, userDelegationKey, preauthorizedAgentObjectId, correlationId) {
constructor(version, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope) {
this.version = version;
this.signature = signature;
if (permissionsOrOptions !== undefined && typeof permissionsOrOptions !== "string") {
@@ -24816,6 +25463,7 @@ class SASQueryParameters {
this.expiresOn = permissionsOrOptions.expiresOn;
this.ipRangeInner = permissionsOrOptions.ipRange;
this.identifier = permissionsOrOptions.identifier;
this.encryptionScope = permissionsOrOptions.encryptionScope;
this.resource = permissionsOrOptions.resource;
this.cacheControl = permissionsOrOptions.cacheControl;
this.contentDisposition = permissionsOrOptions.contentDisposition;
@@ -24841,6 +25489,7 @@ class SASQueryParameters {
this.protocol = protocol;
this.startsOn = startsOn;
this.ipRangeInner = ipRange;
this.encryptionScope = encryptionScope;
this.identifier = identifier;
this.resource = resource;
this.cacheControl = cacheControl;
@@ -24869,7 +25518,7 @@ class SASQueryParameters {
if (this.ipRangeInner) {
return {
end: this.ipRangeInner.end,
start: this.ipRangeInner.start
start: this.ipRangeInner.start,
};
}
return undefined;
@@ -24888,6 +25537,7 @@ class SASQueryParameters {
"se",
"sip",
"si",
"ses",
"skoid",
"sktid",
"skt",
@@ -24903,7 +25553,7 @@ class SASQueryParameters {
"rscl",
"rsct",
"saoid",
"scid"
"scid",
];
const queries = [];
for (const param of params) {
@@ -24932,6 +25582,9 @@ class SASQueryParameters {
case "si":
this.tryAppendQueryParameter(queries, param, this.identifier);
break;
case "ses":
this.tryAppendQueryParameter(queries, param, this.encryptionScope);
break;
case "skoid": // Signed object ID
this.tryAppendQueryParameter(queries, param, this.signedOid);
break;
@@ -25016,6 +25669,15 @@ function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredent
if (sharedKeyCredential === undefined && userDelegationKeyCredential === undefined) {
throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName.");
}
// Version 2020-12-06 adds support for encryptionscope in SAS.
if (version >= "2020-12-06") {
if (sharedKeyCredential !== undefined) {
return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential);
}
else {
return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential);
}
}
// Version 2019-12-12 adds support for the blob tags permission.
// Version 2018-11-09 adds support for the signed resource and signed blob snapshot time fields.
// https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas#constructing-the-signature-string
@@ -25097,7 +25759,7 @@ function generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKe
blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "",
blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "",
blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "",
blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : ""
blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : "",
].join("\n");
const 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);
@@ -25166,11 +25828,81 @@ function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKe
blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "",
blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "",
blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "",
blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : ""
blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : "",
].join("\n");
const 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);
}
/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
* IMPLEMENTATION FOR API VERSION FROM 2020-12-06.
*
* 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 and identifier.
*
* WARNING: When identifier is not provided, permissions and expiresOn are required.
* You MUST assign value to identifier or expiresOn & permissions manually if you initial with
* this constructor.
*
* @param blobSASSignatureValues -
* @param sharedKeyCredential -
*/
function generateBlobSASQueryParameters20201206(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.");
}
let resource = "c";
let 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.
let 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.
const stringToSign = [
verifiedPermissions ? verifiedPermissions : "",
blobSASSignatureValues.startsOn
? truncatedISO8061Date(blobSASSignatureValues.startsOn, false)
: "",
blobSASSignatureValues.expiresOn
? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)
: "",
getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),
blobSASSignatureValues.identifier,
blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "",
blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
blobSASSignatureValues.version,
resource,
timestamp,
blobSASSignatureValues.encryptionScope,
blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "",
blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "",
blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "",
blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "",
blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : "",
].join("\n");
const 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, undefined, undefined, undefined, blobSASSignatureValues.encryptionScope);
}
/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
* IMPLEMENTATION FOR API VERSION FROM 2018-11-09.
@@ -25242,7 +25974,7 @@ function generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userD
blobSASSignatureValues.contentDisposition,
blobSASSignatureValues.contentEncoding,
blobSASSignatureValues.contentLanguage,
blobSASSignatureValues.contentType
blobSASSignatureValues.contentType,
].join("\n");
const 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);
@@ -25321,11 +26053,91 @@ function generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userD
blobSASSignatureValues.contentDisposition,
blobSASSignatureValues.contentEncoding,
blobSASSignatureValues.contentLanguage,
blobSASSignatureValues.contentType
blobSASSignatureValues.contentType,
].join("\n");
const 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);
}
/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
* IMPLEMENTATION FOR API VERSION FROM 2020-12-06.
*
* 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 -
* @param userDelegationKeyCredential -
*/
function generateBlobSASQueryParametersUDK20201206(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.");
}
let resource = "c";
let 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.
let 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.
const 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.encryptionScope,
blobSASSignatureValues.cacheControl,
blobSASSignatureValues.contentDisposition,
blobSASSignatureValues.contentEncoding,
blobSASSignatureValues.contentLanguage,
blobSASSignatureValues.contentType,
].join("\n");
const 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, blobSASSignatureValues.encryptionScope);
}
function getCanonicalName(accountName, containerName, blobName) {
// Container: "/blob/account/containerName"
// Blob: "/blob/account/containerName/blobName"
@@ -25359,6 +26171,11 @@ function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) {
version < "2019-10-10") {
throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission.");
}
if (blobSASSignatureValues.permissions &&
blobSASSignatureValues.permissions.permanentDelete &&
version < "2019-10-10") {
throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission.");
}
if (blobSASSignatureValues.permissions &&
blobSASSignatureValues.permissions.tag &&
version < "2019-12-12") {
@@ -25369,10 +26186,18 @@ function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) {
(blobSASSignatureValues.permissions.move || blobSASSignatureValues.permissions.execute)) {
throw RangeError("'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission.");
}
if (version < "2021-04-10" &&
blobSASSignatureValues.permissions &&
blobSASSignatureValues.permissions.filterByTags) {
throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission.");
}
if (version < "2020-02-10" &&
(blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) {
throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'.");
}
if (blobSASSignatureValues.encryptionScope && version < "2020-12-06") {
throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS.");
}
blobSASSignatureValues.version = version;
return blobSASSignatureValues;
}
@@ -25446,7 +26271,7 @@ class BlobLeaseClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -25481,7 +26306,7 @@ class BlobLeaseClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -25514,7 +26339,7 @@ class BlobLeaseClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -25546,7 +26371,7 @@ class BlobLeaseClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -25581,7 +26406,7 @@ class BlobLeaseClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -25661,8 +26486,7 @@ class RetriableReadableStream extends stream.Readable {
});
}
else {
this.destroy(new Error(`Data corruption failure: received less data than required and reached maxRetires limitation. Received data offset: ${this
.offset - 1}, data needed offset: ${this.end}, retries: ${this.retries}, max retries: ${this.maxRetryRequests}`));
this.destroy(new Error(`Data corruption failure: received less data than required and reached maxRetires limitation. Received data offset: ${this.offset - 1}, data needed offset: ${this.end}, retries: ${this.retries}, max retries: ${this.maxRetryRequests}`));
}
}
else {
@@ -26507,7 +27331,7 @@ class AvroReader {
}
async initialize(options = {}) {
const header = await AvroParser.readFixedBytes(this._headerStream, AVRO_INIT_BYTES.length, {
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
});
if (!arraysEqual(header, AVRO_INIT_BYTES)) {
throw new Error("Stream is not an Avro file.");
@@ -26515,7 +27339,7 @@ class AvroReader {
// File metadata is written as if defined by the following map schema:
// { "type": "map", "values": "bytes"}
this._metadata = await AvroParser.readMap(this._headerStream, AvroParser.readString, {
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
});
// Validate codec
const codec = this._metadata[AVRO_CODEC_KEY];
@@ -26524,7 +27348,7 @@ class AvroReader {
}
// The 16-byte, randomly-generated sync marker for this file.
this._syncMarker = await AvroParser.readFixedBytes(this._headerStream, AVRO_SYNC_MARKER_SIZE, {
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
});
// Parse the schema
const schema = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]);
@@ -26533,7 +27357,7 @@ class AvroReader {
this._blockOffset = this._initialBlockOffset + this._dataStream.position;
}
this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, {
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
});
// skip block length
await AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal });
@@ -26555,13 +27379,13 @@ class AvroReader {
}
while (this.hasNext()) {
const result = yield tslib.__await(this._itemType.read(this._dataStream, {
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
}));
this._itemsRemainingInBlock--;
this._objectIndex++;
if (this._itemsRemainingInBlock == 0) {
const marker = yield tslib.__await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, {
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
}));
this._blockOffset = this._initialBlockOffset + this._dataStream.position;
this._objectIndex = 0;
@@ -26570,7 +27394,7 @@ class AvroReader {
}
try {
this._itemsRemainingInBlock = yield tslib.__await(AvroParser.readLong(this._dataStream, {
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
}));
}
catch (err) {
@@ -26769,7 +27593,7 @@ class BlobQuickQueryStream extends stream.Readable {
position,
name,
isFatal: fatal,
description
description,
});
}
break;
@@ -27145,6 +27969,11 @@ class BlobQueryResponse {
}
// Copyright (c) Microsoft Corporation.
/**
* Represents the access tier on a blob.
* For detailed information about block blob level tiering see {@link https://docs.microsoft.com/azure/storage/blobs/storage-blob-storage-tiers|Hot, cool and archive storage tiers.}
*/
exports.BlockBlobTier = void 0;
(function (BlockBlobTier) {
/**
* Optimized for storing data that is accessed frequently.
@@ -27160,6 +27989,12 @@ class BlobQueryResponse {
*/
BlockBlobTier["Archive"] = "Archive";
})(exports.BlockBlobTier || (exports.BlockBlobTier = {}));
/**
* Specifies the page blob tier to set the blob to. This is only applicable to page blobs on premium storage accounts.
* Please see {@link https://docs.microsoft.com/azure/storage/storage-premium-storage#scalability-and-performance-targets|here}
* for detailed information on the corresponding IOPS and throughput per PageBlobTier.
*/
exports.PremiumPageBlobTier = void 0;
(function (PremiumPageBlobTier) {
/**
* P4 Tier.
@@ -27220,6 +28055,20 @@ function ensureCpkIfSpecified(cpk, isHttps) {
cpk.encryptionAlgorithm = EncryptionAlgorithmAES25;
}
}
/**
* Defines the known cloud audiences for Storage.
*/
exports.StorageBlobAudience = void 0;
(function (StorageBlobAudience) {
/**
* The OAuth scope to use to retrieve an AAD token for Azure Storage.
*/
StorageBlobAudience["StorageOAuthScopes"] = "https://storage.azure.com/.default";
/**
* The OAuth scope to use to retrieve an AAD token for Azure Disk.
*/
StorageBlobAudience["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default";
})(exports.StorageBlobAudience || (exports.StorageBlobAudience = {}));
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
@@ -27232,16 +28081,16 @@ function ensureCpkIfSpecified(cpk, isHttps) {
function rangeResponseFromModel(response) {
const pageRange = (response._response.parsedBody.pageRange || []).map((x) => ({
offset: x.start,
count: x.end - x.start
count: x.end - x.start,
}));
const clearRange = (response._response.parsedBody.clearRange || []).map((x) => ({
offset: x.start,
count: x.end - x.start
count: x.end - x.start,
}));
return Object.assign(Object.assign({}, response), { pageRange,
clearRange, _response: Object.assign(Object.assign({}, response._response), { parsedBody: {
pageRange,
clearRange
clearRange,
} }) });
}
@@ -27254,7 +28103,7 @@ function rangeResponseFromModel(response) {
*/
class BlobBeginCopyFromUrlPoller extends coreLro.Poller {
constructor(options) {
const { blobClient, copySource, intervalInMs = 15000, onProgress, resumeFrom, startCopyFromURLOptions } = options;
const { blobClient, copySource, intervalInMs = 15000, onProgress, resumeFrom, startCopyFromURLOptions, } = options;
let state;
if (resumeFrom) {
state = JSON.parse(resumeFrom).state;
@@ -27290,7 +28139,7 @@ const cancel = async function cancel(options = {}) {
}
// if abortCopyFromURL throws, it will bubble up to user's poller.cancelOperation call
await state.blobClient.abortCopyFromURL(copyId, {
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
});
state.isCancelled = true;
return makeBlobBeginCopyFromURLPollOperation(state);
@@ -27368,7 +28217,7 @@ function makeBlobBeginCopyFromURLPollOperation(state) {
state: Object.assign({}, state),
cancel,
toString,
update
update,
};
}
@@ -28010,7 +28859,7 @@ async function streamToBuffer2(stream, buffer, encoding) {
*/
async function readStreamToLocalFile(rs, file) {
return new Promise((resolve, reject) => {
const ws = fs.createWriteStream(file);
const ws = fs__namespace.createWriteStream(file);
rs.on("error", (err) => {
reject(err);
});
@@ -28026,8 +28875,8 @@ async function readStreamToLocalFile(rs, file) {
*
* Promisified version of fs.stat().
*/
const fsStat = util.promisify(fs.stat);
const fsCreateReadStream = fs.createReadStream;
const fsStat = util__namespace.promisify(fs__namespace.stat);
const fsCreateReadStream = fs__namespace.createReadStream;
/**
* A BlobClient represents a URL to an Azure Storage blob; the blob may be a block blob,
@@ -28070,12 +28919,17 @@ class BlobClient extends StorageClient {
const blobName = blobNameOrOptions;
const extractedCreds = extractConnectionStringParts(urlOrConnectionString);
if (extractedCreds.kind === "AccountConnString") {
{
if (coreHttp.isNode) {
const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
url = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
if (!options.proxyOptions) {
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
}
pipeline = newPipeline(sharedKeyCredential, options);
}
else {
throw new Error("Account connection string is only supported in Node.js environment");
}
}
else if (extractedCreds.kind === "SASConnString") {
url =
@@ -28092,10 +28946,8 @@ class BlobClient extends StorageClient {
throw new Error("Expecting non-empty strings for containerName and blobName parameters");
}
super(url, pipeline);
({
blobName: this._name,
containerName: this._containerName
} = this.getBlobAndContainerNamesFromUrl());
({ blobName: this._name, containerName: this._containerName } =
this.getBlobAndContainerNamesFromUrl());
this.blobContext = new Blob$1(this.storageClientContext);
this._snapshot = getURLParameter(this.url, URLConstants.Parameters.SNAPSHOT);
this._versionId = getURLParameter(this.url, URLConstants.Parameters.VERSIONID);
@@ -28220,11 +29072,13 @@ class BlobClient extends StorageClient {
const { span, updatedOptions } = createSpan("BlobClient-download", options);
try {
const res = await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: {
onDownloadProgress: coreHttp.isNode ? undefined : options.onProgress // for Node.js, progress is reported by RetriableReadableStream
onDownloadProgress: coreHttp.isNode ? undefined : options.onProgress, // for Node.js, progress is reported by RetriableReadableStream
}, range: offset === 0 && !count ? undefined : rangeToString({ offset, count }), rangeGetContentMD5: options.rangeGetContentMD5, rangeGetContentCRC64: options.rangeGetContentCrc64, snapshot: options.snapshot, cpkInfo: options.customerProvidedKey }, convertTracingToRequestOptionsBase(updatedOptions)));
const wrappedRes = Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) });
// Return browser response immediately
if (false) {}
if (!coreHttp.isNode) {
return wrappedRes;
}
// We support retrying when download stream unexpected ends in Node.js runtime
// Following code shouldn't be bundled into browser build, however some
// bundlers may try to bundle following code and "FileReadResponse.ts".
@@ -28249,16 +29103,16 @@ class BlobClient extends StorageClient {
ifModifiedSince: options.conditions.ifModifiedSince,
ifNoneMatch: options.conditions.ifNoneMatch,
ifUnmodifiedSince: options.conditions.ifUnmodifiedSince,
ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions
ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions,
},
range: rangeToString({
count: offset + res.contentLength - start,
offset: start
offset: start,
}),
rangeGetContentMD5: options.rangeGetContentMD5,
rangeGetContentCRC64: options.rangeGetContentCrc64,
snapshot: options.snapshot,
cpkInfo: options.customerProvidedKey
cpkInfo: options.customerProvidedKey,
};
// Debug purpose only
// console.log(
@@ -28269,13 +29123,13 @@ class BlobClient extends StorageClient {
return (await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal }, updatedDownloadOptions))).readableStreamBody;
}, offset, res.contentLength, {
maxRetryRequests: options.maxRetryRequests,
onProgress: options.onProgress
onProgress: options.onProgress,
});
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28300,21 +29154,23 @@ class BlobClient extends StorageClient {
abortSignal: options.abortSignal,
customerProvidedKey: options.customerProvidedKey,
conditions: options.conditions,
tracingOptions: updatedOptions.tracingOptions
tracingOptions: updatedOptions.tracingOptions,
});
return true;
}
catch (e) {
if (e.statusCode === 404) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: "Expected exception when checking blob existence"
});
// Expected exception when checking blob existence
return false;
}
else if (e.statusCode === 409 &&
e.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg) {
// Expected exception when checking blob existence
return true;
}
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28346,7 +29202,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28373,7 +29229,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28395,20 +29251,19 @@ class BlobClient extends StorageClient {
const { span, updatedOptions } = createSpan("BlobClient-deleteIfExists", options);
try {
const res = await this.delete(updatedOptions);
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable
});
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });
}
catch (e) {
if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobNotFound") {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: "Expected exception when deleting a blob or snapshot only if it exists."
message: "Expected exception when deleting a blob or snapshot only if it exists.",
});
return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
}
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28432,7 +29287,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28466,7 +29321,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28496,7 +29351,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28522,7 +29377,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28546,7 +29401,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28580,7 +29435,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28664,7 +29519,7 @@ class BlobClient extends StorageClient {
const client = {
abortCopyFromURL: (...args) => this.abortCopyFromURL(...args),
getProperties: (...args) => this.getProperties(...args),
startCopyFromURL: (...args) => this.startCopyFromURL(...args)
startCopyFromURL: (...args) => this.startCopyFromURL(...args),
};
const poller = new BlobBeginCopyFromUrlPoller({
blobClient: client,
@@ -28672,7 +29527,7 @@ class BlobClient extends StorageClient {
intervalInMs: options.intervalInMs,
onProgress: options.onProgress,
resumeFrom: options.resumeFrom,
startCopyFromURLOptions: options
startCopyFromURLOptions: options,
});
// Trigger the startCopyFromURL call by calling poll.
// Any errors from this method should be surfaced to the user.
@@ -28695,7 +29550,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28721,13 +29576,13 @@ class BlobClient extends StorageClient {
sourceIfMatch: options.sourceConditions.ifMatch,
sourceIfModifiedSince: options.sourceConditions.ifModifiedSince,
sourceIfNoneMatch: options.sourceConditions.ifNoneMatch,
sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince
}, sourceContentMD5: options.sourceContentMD5, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), blobTagsString: toBlobTagsString(options.tags), immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold }, convertTracingToRequestOptionsBase(updatedOptions)));
sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince,
}, sourceContentMD5: options.sourceContentMD5, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), blobTagsString: toBlobTagsString(options.tags), immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)));
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28755,7 +29610,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28832,7 +29687,7 @@ class BlobClient extends StorageClient {
conditions: options.conditions,
maxRetryRequests: options.maxRetryRequestsPerBlock,
customerProvidedKey: options.customerProvidedKey,
tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions))
tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)),
});
const stream = response.readableStreamBody;
await streamToBuffer(stream, buffer, off - offset, chunkEnd - offset);
@@ -28851,7 +29706,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28889,7 +29744,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28970,13 +29825,13 @@ class BlobClient extends StorageClient {
sourceIfModifiedSince: options.sourceConditions.ifModifiedSince,
sourceIfNoneMatch: options.sourceConditions.ifNoneMatch,
sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince,
sourceIfTags: options.sourceConditions.tagConditions
sourceIfTags: options.sourceConditions.tagConditions,
}, immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold, rehydratePriority: options.rehydratePriority, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), sealBlob: options.sealBlob }, convertTracingToRequestOptionsBase(updatedOptions)));
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29017,7 +29872,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29038,7 +29893,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29059,7 +29914,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29110,12 +29965,17 @@ class AppendBlobClient extends BlobClient {
const blobName = blobNameOrOptions;
const extractedCreds = extractConnectionStringParts(urlOrConnectionString);
if (extractedCreds.kind === "AccountConnString") {
{
if (coreHttp.isNode) {
const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
url = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
if (!options.proxyOptions) {
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
}
pipeline = newPipeline(sharedKeyCredential, options);
}
else {
throw new Error("Account connection string is only supported in Node.js environment");
}
}
else if (extractedCreds.kind === "SASConnString") {
url =
@@ -29170,7 +30030,7 @@ class AppendBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29191,20 +30051,19 @@ class AppendBlobClient extends BlobClient {
const conditions = { ifNoneMatch: ETagAny };
try {
const res = await this.create(Object.assign(Object.assign({}, updatedOptions), { conditions }));
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable
});
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });
}
catch (e) {
if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: "Expected exception when creating a blob only if it does not already exist."
message: "Expected exception when creating a blob only if it does not already exist.",
});
return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
}
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29227,7 +30086,7 @@ class AppendBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29266,13 +30125,13 @@ class AppendBlobClient extends BlobClient {
try {
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
return await this.appendBlobContext.appendBlock(contentLength, body, Object.assign({ abortSignal: options.abortSignal, appendPositionAccessConditions: options.conditions, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: {
onUploadProgress: options.onProgress
onUploadProgress: options.onProgress,
}, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)));
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29305,13 +30164,13 @@ class AppendBlobClient extends BlobClient {
sourceIfMatch: options.sourceConditions.ifMatch,
sourceIfModifiedSince: options.sourceConditions.ifModifiedSince,
sourceIfNoneMatch: options.sourceConditions.ifNoneMatch,
sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince
sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince,
}, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)));
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29362,12 +30221,17 @@ class BlockBlobClient extends BlobClient {
const blobName = blobNameOrOptions;
const extractedCreds = extractConnectionStringParts(urlOrConnectionString);
if (extractedCreds.kind === "AccountConnString") {
{
if (coreHttp.isNode) {
const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
url = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
if (!options.proxyOptions) {
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
}
pipeline = newPipeline(sharedKeyCredential, options);
}
else {
throw new Error("Account connection string is only supported in Node.js environment");
}
}
else if (extractedCreds.kind === "SASConnString") {
url =
@@ -29433,23 +30297,25 @@ class BlockBlobClient extends BlobClient {
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
const { span, updatedOptions } = createSpan("BlockBlobClient-query", options);
try {
if (false) {}
if (!coreHttp.isNode) {
throw new Error("This operation currently is only supported in Node.js.");
}
const response = await this._blobContext.query(Object.assign({ abortSignal: options.abortSignal, queryRequest: {
queryType: "SQL",
expression: query,
inputSerialization: toQuerySerialization(options.inputTextConfiguration),
outputSerialization: toQuerySerialization(options.outputTextConfiguration)
outputSerialization: toQuerySerialization(options.outputTextConfiguration),
}, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)));
return new BlobQueryResponse(response, {
abortSignal: options.abortSignal,
onProgress: options.onProgress,
onError: options.onError
onError: options.onError,
});
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29491,13 +30357,13 @@ class BlockBlobClient extends BlobClient {
try {
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
return await this.blockBlobContext.upload(contentLength, body, Object.assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: {
onUploadProgress: options.onProgress
onUploadProgress: options.onProgress,
}, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions)));
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29534,13 +30400,13 @@ class BlockBlobClient extends BlobClient {
sourceIfModifiedSince: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifModifiedSince,
sourceIfNoneMatch: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch,
sourceIfUnmodifiedSince: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifUnmodifiedSince,
sourceIfTags: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.tagConditions
sourceIfTags: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.tagConditions,
}, cpkInfo: options.customerProvidedKey, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }), convertTracingToRequestOptionsBase(updatedOptions)));
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29564,13 +30430,13 @@ class BlockBlobClient extends BlobClient {
try {
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
return await this.blockBlobContext.stageBlock(blockId, contentLength, body, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, requestOptions: {
onUploadProgress: options.onProgress
onUploadProgress: options.onProgress,
}, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)));
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29608,7 +30474,7 @@ class BlockBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29639,7 +30505,7 @@ class BlockBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29673,7 +30539,7 @@ class BlockBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29700,7 +30566,7 @@ class BlockBlobClient extends BlobClient {
async uploadData(data, options = {}) {
const { span, updatedOptions } = createSpan("BlockBlobClient-uploadData", options);
try {
if (true) {
if (coreHttp.isNode) {
let buffer;
if (data instanceof Buffer) {
buffer = data;
@@ -29714,12 +30580,15 @@ class BlockBlobClient extends BlobClient {
}
return this.uploadSeekableInternal((offset, size) => buffer.slice(offset, offset + size), buffer.byteLength, updatedOptions);
}
else {}
else {
const browserBlob = new Blob([data]);
return this.uploadSeekableInternal((offset, size) => browserBlob.slice(offset, offset + size), browserBlob.size, updatedOptions);
}
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29755,7 +30624,7 @@ class BlockBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29768,7 +30637,7 @@ class BlockBlobClient extends BlobClient {
* 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.
*
* When data length is no more than the specifiled {@link BlockBlobParallelUploadOptions.maxSingleShotSize} (default is
* When data length is no more than the specified {@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.
@@ -29834,14 +30703,14 @@ class BlockBlobClient extends BlobClient {
abortSignal: options.abortSignal,
conditions: options.conditions,
encryptionScope: options.encryptionScope,
tracingOptions: updatedOptions.tracingOptions
tracingOptions: updatedOptions.tracingOptions,
});
// Update progress after block is successfully uploaded to server, in case of block trying
// TODO: Hook with convenience layer progress event in finer level
transferProgress += contentLength;
if (options.onProgress) {
options.onProgress({
loadedBytes: transferProgress
loadedBytes: transferProgress,
});
}
});
@@ -29852,7 +30721,7 @@ class BlockBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29881,14 +30750,14 @@ class BlockBlobClient extends BlobClient {
return () => fsCreateReadStream(filePath, {
autoClose: true,
end: count ? offset + count - 1 : Infinity,
start: offset
start: offset,
});
}, size, Object.assign(Object.assign({}, options), { tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)) }));
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29932,7 +30801,7 @@ class BlockBlobClient extends BlobClient {
await this.stageBlock(blockID, body, length, {
conditions: options.conditions,
encryptionScope: options.encryptionScope,
tracingOptions: updatedOptions.tracingOptions
tracingOptions: updatedOptions.tracingOptions,
});
// Update progress after block is successfully uploaded to server, in case of block trying
transferProgress += length;
@@ -29951,7 +30820,7 @@ class BlockBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30002,12 +30871,17 @@ class PageBlobClient extends BlobClient {
const blobName = blobNameOrOptions;
const extractedCreds = extractConnectionStringParts(urlOrConnectionString);
if (extractedCreds.kind === "AccountConnString") {
{
if (coreHttp.isNode) {
const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
url = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
if (!options.proxyOptions) {
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
}
pipeline = newPipeline(sharedKeyCredential, options);
}
else {
throw new Error("Account connection string is only supported in Node.js environment");
}
}
else if (extractedCreds.kind === "SASConnString") {
url =
@@ -30057,7 +30931,7 @@ class PageBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30080,20 +30954,19 @@ class PageBlobClient extends BlobClient {
try {
const conditions = { ifNoneMatch: ETagAny };
const res = await this.create(size, Object.assign(Object.assign({}, options), { conditions, tracingOptions: updatedOptions.tracingOptions }));
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable
});
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });
}
catch (e) {
if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: "Expected exception when creating a blob only if it does not already exist."
message: "Expected exception when creating a blob only if it does not already exist.",
});
return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
}
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30118,13 +30991,13 @@ class PageBlobClient extends BlobClient {
try {
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
return await this.pageBlobContext.uploadPages(count, body, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: {
onUploadProgress: options.onProgress
onUploadProgress: options.onProgress,
}, range: rangeToString({ offset, count }), sequenceNumberAccessConditions: options.conditions, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)));
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30154,13 +31027,13 @@ class PageBlobClient extends BlobClient {
sourceIfMatch: options.sourceConditions.ifMatch,
sourceIfModifiedSince: options.sourceConditions.ifModifiedSince,
sourceIfNoneMatch: options.sourceConditions.ifNoneMatch,
sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince
sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince,
}, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization) }, convertTracingToRequestOptionsBase(updatedOptions)));
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30187,7 +31060,7 @@ class PageBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30216,7 +31089,7 @@ class PageBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30246,7 +31119,7 @@ class PageBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30276,7 +31149,7 @@ class PageBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30302,7 +31175,7 @@ class PageBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30329,7 +31202,7 @@ class PageBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30359,7 +31232,7 @@ class PageBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30507,7 +31380,7 @@ class BatchResponseParser {
return {
subResponses: deserializedSubResponses,
subResponsesSucceededCount: subResponsesSucceededCount,
subResponsesFailedCount: subResponsesFailedCount
subResponsesFailedCount: subResponsesFailedCount,
};
}
}
@@ -30654,7 +31527,7 @@ class BlobBatch {
this.setBatchType("delete");
await this.addSubRequestInternal({
url: url,
credential: credential
credential: credential,
}, async () => {
await new BlobClient(url, this.batchRequest.createPipeline(credential)).delete(updatedOptions);
});
@@ -30662,7 +31535,7 @@ class BlobBatch {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30701,7 +31574,7 @@ class BlobBatch {
this.setBatchType("setAccessTier");
await this.addSubRequestInternal({
url: url,
credential: credential
credential: credential,
}, async () => {
await new BlobClient(url, this.batchRequest.createPipeline(credential)).setAccessTier(tier, updatedOptions);
});
@@ -30709,7 +31582,7 @@ class BlobBatch {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30766,7 +31639,7 @@ class InnerBatchRequest {
this.subRequestPrefix,
`${HeaderConstants.CONTENT_ID}: ${this.operationCount}`,
"",
`${request.method.toString()} ${getURLPathAndQuery(request.url)} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}` // sub request start line with method
`${request.method.toString()} ${getURLPathAndQuery(request.url)} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}`, // sub request start line with method
].join(HTTP_LINE_ENDING);
for (const header of request.headers.headersArray()) {
this.body += `${header.name}: ${header.value}${HTTP_LINE_ENDING}`;
@@ -30806,7 +31679,7 @@ class BatchRequestAssemblePolicy extends coreHttp.BaseRequestPolicy {
this.dummyResponse = {
request: new coreHttp.WebResource(),
status: 200,
headers: new coreHttp.HttpHeaders()
headers: new coreHttp.HttpHeaders(),
};
this.batchRequest = batchRequest;
}
@@ -30973,14 +31846,14 @@ class BlobBatchClient {
version: rawBatchResponse.version,
subResponses: responseSummary.subResponses,
subResponsesSucceededCount: responseSummary.subResponsesSucceededCount,
subResponsesFailedCount: responseSummary.subResponsesFailedCount
subResponsesFailedCount: responseSummary.subResponsesFailedCount,
};
return res;
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31026,12 +31899,17 @@ class ContainerClient extends StorageClient {
const containerName = credentialOrPipelineOrContainerName;
const extractedCreds = extractConnectionStringParts(urlOrConnectionString);
if (extractedCreds.kind === "AccountConnString") {
{
if (coreHttp.isNode) {
const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
url = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName));
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
if (!options.proxyOptions) {
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
}
pipeline = newPipeline(sharedKeyCredential, options);
}
else {
throw new Error("Account connection string is only supported in Node.js environment");
}
}
else if (extractedCreds.kind === "SASConnString") {
url =
@@ -31083,7 +31961,7 @@ class ContainerClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31103,20 +31981,19 @@ class ContainerClient extends StorageClient {
const { span, updatedOptions } = createSpan("ContainerClient-createIfNotExists", options);
try {
const res = await this.create(updatedOptions);
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable
});
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });
}
catch (e) {
if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: "Expected exception when creating a container only if it does not already exist."
message: "Expected exception when creating a container only if it does not already exist.",
});
return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
}
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31138,7 +32015,7 @@ class ContainerClient extends StorageClient {
try {
await this.getProperties({
abortSignal: options.abortSignal,
tracingOptions: updatedOptions.tracingOptions
tracingOptions: updatedOptions.tracingOptions,
});
return true;
}
@@ -31146,13 +32023,13 @@ class ContainerClient extends StorageClient {
if (e.statusCode === 404) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: "Expected exception when checking container existence"
message: "Expected exception when checking container existence",
});
return false;
}
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31226,7 +32103,7 @@ class ContainerClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31252,7 +32129,7 @@ class ContainerClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31272,20 +32149,19 @@ class ContainerClient extends StorageClient {
const { span, updatedOptions } = createSpan("ContainerClient-deleteIfExists", options);
try {
const res = await this.delete(updatedOptions);
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable
});
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });
}
catch (e) {
if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: "Expected exception when deleting a container only if it exists."
message: "Expected exception when deleting a container only if it exists.",
});
return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
}
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31319,7 +32195,7 @@ class ContainerClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31355,13 +32231,13 @@ class ContainerClient extends StorageClient {
requestId: response.requestId,
clientRequestId: response.clientRequestId,
signedIdentifiers: [],
version: response.version
version: response.version,
};
for (const identifier of response) {
let accessPolicy = undefined;
if (identifier.accessPolicy) {
accessPolicy = {
permissions: identifier.accessPolicy.permissions
permissions: identifier.accessPolicy.permissions,
};
if (identifier.accessPolicy.expiresOn) {
accessPolicy.expiresOn = new Date(identifier.accessPolicy.expiresOn);
@@ -31372,7 +32248,7 @@ class ContainerClient extends StorageClient {
}
res.signedIdentifiers.push({
accessPolicy,
id: identifier.id
id: identifier.id,
});
}
return res;
@@ -31380,7 +32256,7 @@ class ContainerClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31419,9 +32295,9 @@ class ContainerClient extends StorageClient {
permissions: identifier.accessPolicy.permissions,
startsOn: identifier.accessPolicy.startsOn
? truncatedISO8061Date(identifier.accessPolicy.startsOn)
: ""
: "",
},
id: identifier.id
id: identifier.id,
});
}
return await this.containerContext.setAccessPolicy(Object.assign({ abortSignal: options.abortSignal, access, containerAcl: acl, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions)));
@@ -31429,7 +32305,7 @@ class ContainerClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31475,13 +32351,13 @@ class ContainerClient extends StorageClient {
const response = await blockBlobClient.upload(body, contentLength, updatedOptions);
return {
blockBlobClient,
response
response,
};
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31512,7 +32388,7 @@ class ContainerClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31534,8 +32410,12 @@ class ContainerClient extends StorageClient {
const { span, updatedOptions } = createSpan("ContainerClient-listBlobFlatSegment", options);
try {
const response = await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));
const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInteral) => {
const blobItem = Object.assign(Object.assign({}, blobItemInteral), { tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) });
response.segment.blobItems = [];
if (response.segment["Blob"] !== undefined) {
response.segment.blobItems = ProcessBlobItems(response.segment["Blob"]);
}
const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInteral) => {
const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name), tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) });
return blobItem;
}) }) });
return wrappedResponse;
@@ -31543,7 +32423,7 @@ class ContainerClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31563,19 +32443,33 @@ class ContainerClient extends StorageClient {
* @param options - Options to Container List Blob Hierarchy Segment operation.
*/
async listBlobHierarchySegment(delimiter, marker, options = {}) {
var _a;
const { span, updatedOptions } = createSpan("ContainerClient-listBlobHierarchySegment", options);
try {
const response = await this.containerContext.listBlobHierarchySegment(delimiter, Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));
const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInteral) => {
const blobItem = Object.assign(Object.assign({}, blobItemInteral), { tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) });
response.segment.blobItems = [];
if (response.segment["Blob"] !== undefined) {
response.segment.blobItems = ProcessBlobItems(response.segment["Blob"]);
}
response.segment.blobPrefixes = [];
if (response.segment["BlobPrefix"] !== undefined) {
response.segment.blobPrefixes = ProcessBlobPrefixes(response.segment["BlobPrefix"]);
}
const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobHierarchy(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInteral) => {
const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name), tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) });
return blobItem;
}), blobPrefixes: (_a = response.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => {
const blobPrefix = {
name: BlobNameToString(blobPrefixInternal.name),
};
return blobPrefix;
}) }) });
return wrappedResponse;
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31757,7 +32651,7 @@ class ContainerClient extends StorageClient {
*/
byPage: (settings = {}) => {
return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions));
}
},
};
}
/**
@@ -31831,7 +32725,7 @@ class ContainerClient extends StorageClient {
* if (item.kind === "prefix") {
* console.log(`\tBlobPrefix: ${item.name}`);
* } else {
* console.log(`\tBlobItem: name - ${item.name}, last modified - ${item.properties.lastModified}`);
* console.log(`\tBlobItem: name - ${item.name}`);
* }
* }
* ```
@@ -31846,7 +32740,7 @@ class ContainerClient extends StorageClient {
* if (item.kind === "prefix") {
* console.log(`\tBlobPrefix: ${item.name}`);
* } else {
* console.log(`\tBlobItem: name - ${item.name}, last modified - ${item.properties.lastModified}`);
* console.log(`\tBlobItem: name - ${item.name}`);
* }
* entity = await iter.next();
* }
@@ -31864,7 +32758,7 @@ class ContainerClient extends StorageClient {
* }
* }
* for (const blob of response.segment.blobItems) {
* console.log(`\tBlobItem: name - ${blob.name}, last modified - ${blob.properties.lastModified}`);
* console.log(`\tBlobItem: name - ${blob.name}`);
* }
* }
* ```
@@ -31875,7 +32769,9 @@ class ContainerClient extends StorageClient {
* console.log("Listing blobs by hierarchy by page, specifying a prefix and a max page size");
*
* let i = 1;
* for await (const response of containerClient.listBlobsByHierarchy("/", { prefix: "prefix2/sub1/"}).byPage({ maxPageSize: 2 })) {
* for await (const response of containerClient
* .listBlobsByHierarchy("/", { prefix: "prefix2/sub1/" })
* .byPage({ maxPageSize: 2 })) {
* console.log(`Page ${i++}`);
* const segment = response.segment;
*
@@ -31886,7 +32782,7 @@ class ContainerClient extends StorageClient {
* }
*
* for (const blob of response.segment.blobItems) {
* console.log(`\tBlobItem: name - ${blob.name}, last modified - ${blob.properties.lastModified}`);
* console.log(`\tBlobItem: name - ${blob.name}`);
* }
* }
* ```
@@ -31953,7 +32849,208 @@ class ContainerClient extends StorageClient {
*/
byPage: (settings = {}) => {
return this.listHierarchySegments(delimiter, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions));
},
};
}
/**
* The Filter Blobs operation enables callers to list blobs in the container whose tags
* match a given search expression.
*
* @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
* The given expression must evaluate to true for a blob to be returned in the results.
* The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
* however, only a subset of the OData filter syntax is supported in the Blob service.
* @param 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
* 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
* the marker parameter in a subsequent call to request the next page of list
* items. The marker value is opaque to the client.
* @param options - Options to find blobs by tags.
*/
async findBlobsByTagsSegment(tagFilterSqlExpression, marker, options = {}) {
const { span, updatedOptions } = createSpan("ContainerClient-findBlobsByTagsSegment", options);
try {
const response = await this.containerContext.filterBlobs(Object.assign({ abortSignal: options.abortSignal, where: tagFilterSqlExpression, marker, maxPageSize: options.maxPageSize }, convertTracingToRequestOptionsBase(updatedOptions)));
const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => {
var _a;
let tagValue = "";
if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) {
tagValue = blob.tags.blobTagSet[0].value;
}
return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue });
}) });
return wrappedResponse;
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message,
});
throw e;
}
finally {
span.end();
}
}
/**
* Returns an AsyncIterableIterator for ContainerFindBlobsByTagsSegmentResponse.
*
* @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
* The given expression must evaluate to true for a blob to be returned in the results.
* The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
* however, only a subset of the OData filter syntax is supported in the Blob service.
* @param 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
* 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
* the marker parameter in a subsequent call to request the next page of list
* items. The marker value is opaque to the client.
* @param options - Options to find blobs by tags.
*/
findBlobsByTagsSegments(tagFilterSqlExpression, marker, options = {}) {
return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1() {
let response;
if (!!marker || marker === undefined) {
do {
response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options));
response.blobs = response.blobs || [];
marker = response.continuationToken;
yield yield tslib.__await(response);
} while (marker);
}
});
}
/**
* Returns an AsyncIterableIterator for blobs.
*
* @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
* The given expression must evaluate to true for a blob to be returned in the results.
* The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
* however, only a subset of the OData filter syntax is supported in the Blob service.
* @param options - Options to findBlobsByTagsItems.
*/
findBlobsByTagsItems(tagFilterSqlExpression, options = {}) {
return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1() {
var e_3, _a;
let marker;
try {
for (var _b = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
const segment = _c.value;
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs)));
}
}
catch (e_3_1) { e_3 = { error: e_3_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
}
finally { if (e_3) throw e_3.error; }
}
});
}
/**
* Returns an async iterable iterator to find all blobs with specified tag
* under the specified container.
*
* .byPage() returns an async iterable iterator to list the blobs in pages.
*
* Example using `for await` syntax:
*
* ```js
* let i = 1;
* for await (const blob of containerClient.findBlobsByTags("tagkey='tagvalue'")) {
* console.log(`Blob ${i++}: ${blob.name}`);
* }
* ```
*
* Example using `iter.next()`:
*
* ```js
* let i = 1;
* const iter = containerClient.findBlobsByTags("tagkey='tagvalue'");
* let blobItem = await iter.next();
* while (!blobItem.done) {
* console.log(`Blob ${i++}: ${blobItem.value.name}`);
* blobItem = await iter.next();
* }
* ```
*
* Example using `byPage()`:
*
* ```js
* // passing optional maxPageSize in the page settings
* let i = 1;
* for await (const response of containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) {
* if (response.blobs) {
* for (const blob of response.blobs) {
* console.log(`Blob ${i++}: ${blob.name}`);
* }
* }
* }
* ```
*
* Example using paging with a marker:
*
* ```js
* let i = 1;
* let iterator = containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 });
* let response = (await iterator.next()).value;
*
* // Prints 2 blob names
* if (response.blobs) {
* for (const blob of response.blobs) {
* console.log(`Blob ${i++}: ${blob.name}`);
* }
* }
*
* // Gets next marker
* let marker = response.continuationToken;
* // Passing next marker as continuationToken
* iterator = containerClient
* .findBlobsByTags("tagkey='tagvalue'")
* .byPage({ continuationToken: marker, maxPageSize: 10 });
* response = (await iterator.next()).value;
*
* // Prints blob names
* if (response.blobs) {
* for (const blob of response.blobs) {
* console.log(`Blob ${i++}: ${blob.name}`);
* }
* }
* ```
*
* @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
* The given expression must evaluate to true for a blob to be returned in the results.
* The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
* however, only a subset of the OData filter syntax is supported in the Blob service.
* @param options - Options to find blobs by tags.
*/
findBlobsByTags(tagFilterSqlExpression, options = {}) {
// AsyncIterableIterator to iterate over blobs
const listSegmentOptions = Object.assign({}, options);
const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions);
return {
/**
* The next method, part of the iteration protocol
*/
next() {
return iter.next();
},
/**
* The connection to the async iterator, part of the iteration protocol
*/
[Symbol.asyncIterator]() {
return this;
},
/**
* Return an AsyncIterableIterator that works a page at a time
*/
byPage: (settings = {}) => {
return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions));
},
};
}
getContainerNameFromUrl() {
@@ -32086,6 +33183,10 @@ class AccountSASPermissions {
* Permission to set immutability policy.
*/
this.setImmutabilityPolicy = false;
/**
* Specifies that Permanent Delete is permitted.
*/
this.permanentDelete = false;
}
/**
* Parse initializes the AccountSASPermissions fields from a string.
@@ -32132,6 +33233,9 @@ class AccountSASPermissions {
case "i":
accountSASPermissions.setImmutabilityPolicy = true;
break;
case "y":
accountSASPermissions.permanentDelete = true;
break;
default:
throw new RangeError(`Invalid permission character: ${c}`);
}
@@ -32182,6 +33286,9 @@ class AccountSASPermissions {
if (permissionLike.setImmutabilityPolicy) {
accountSASPermissions.setImmutabilityPolicy = true;
}
if (permissionLike.permanentDelete) {
accountSASPermissions.permanentDelete = true;
}
return accountSASPermissions;
}
/**
@@ -32235,6 +33342,9 @@ class AccountSASPermissions {
if (this.setImmutabilityPolicy) {
permissions.push("i");
}
if (this.permanentDelete) {
permissions.push("y");
}
return permissions.join("");
}
}
@@ -32417,6 +33527,11 @@ function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyC
version < "2019-10-10") {
throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission.");
}
if (accountSASSignatureValues.permissions &&
accountSASSignatureValues.permissions.permanentDelete &&
version < "2019-10-10") {
throw RangeError("'version' must be >= '2019-10-10' when provided 'y' permission.");
}
if (accountSASSignatureValues.permissions &&
accountSASSignatureValues.permissions.tag &&
version < "2019-12-12") {
@@ -32427,25 +33542,48 @@ function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyC
version < "2019-12-12") {
throw RangeError("'version' must be >= '2019-12-12' when provided 'f' permission.");
}
if (accountSASSignatureValues.encryptionScope && version < "2020-12-06") {
throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS.");
}
const parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString());
const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString();
const parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString();
const stringToSign = [
sharedKeyCredential.accountName,
parsedPermissions,
parsedServices,
parsedResourceTypes,
accountSASSignatureValues.startsOn
? truncatedISO8061Date(accountSASSignatureValues.startsOn, false)
: "",
truncatedISO8061Date(accountSASSignatureValues.expiresOn, false),
accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "",
accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "",
version,
"" // Account SAS requires an additional newline character
].join("\n");
let stringToSign;
if (version >= "2020-12-06") {
stringToSign = [
sharedKeyCredential.accountName,
parsedPermissions,
parsedServices,
parsedResourceTypes,
accountSASSignatureValues.startsOn
? truncatedISO8061Date(accountSASSignatureValues.startsOn, false)
: "",
truncatedISO8061Date(accountSASSignatureValues.expiresOn, false),
accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "",
accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "",
version,
accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : "",
"", // Account SAS requires an additional newline character
].join("\n");
}
else {
stringToSign = [
sharedKeyCredential.accountName,
parsedPermissions,
parsedServices,
parsedResourceTypes,
accountSASSignatureValues.startsOn
? truncatedISO8061Date(accountSASSignatureValues.startsOn, false)
: "",
truncatedISO8061Date(accountSASSignatureValues.expiresOn, false),
accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "",
accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "",
version,
"", // Account SAS requires an additional newline character
].join("\n");
}
const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);
return new SASQueryParameters(version, signature, parsedPermissions.toString(), parsedServices, parsedResourceTypes, accountSASSignatureValues.protocol, accountSASSignatureValues.startsOn, accountSASSignatureValues.expiresOn, accountSASSignatureValues.ipRange);
return new SASQueryParameters(version, signature, parsedPermissions.toString(), parsedServices, parsedResourceTypes, accountSASSignatureValues.protocol, accountSASSignatureValues.startsOn, accountSASSignatureValues.expiresOn, accountSASSignatureValues.ipRange, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, accountSASSignatureValues.encryptionScope);
}
/**
@@ -32492,12 +33630,17 @@ class BlobServiceClient extends StorageClient {
options = options || {};
const extractedCreds = extractConnectionStringParts(connectionString);
if (extractedCreds.kind === "AccountConnString") {
{
if (coreHttp.isNode) {
const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
if (!options.proxyOptions) {
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
}
const pipeline = newPipeline(sharedKeyCredential, options);
return new BlobServiceClient(extractedCreds.url, pipeline);
}
else {
throw new Error("Account connection string is only supported in Node.js environment");
}
}
else if (extractedCreds.kind === "SASConnString") {
const pipeline = newPipeline(new AnonymousCredential(), options);
@@ -32536,13 +33679,13 @@ class BlobServiceClient extends StorageClient {
const containerCreateResponse = await containerClient.create(updatedOptions);
return {
containerClient,
containerCreateResponse
containerCreateResponse,
};
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -32566,7 +33709,7 @@ class BlobServiceClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -32596,7 +33739,7 @@ class BlobServiceClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -32626,7 +33769,7 @@ class BlobServiceClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -32650,7 +33793,7 @@ class BlobServiceClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -32675,7 +33818,7 @@ class BlobServiceClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -32700,7 +33843,7 @@ class BlobServiceClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -32726,7 +33869,7 @@ class BlobServiceClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -32756,7 +33899,7 @@ class BlobServiceClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -32799,7 +33942,7 @@ class BlobServiceClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -32965,7 +34108,7 @@ class BlobServiceClient extends StorageClient {
*/
byPage: (settings = {}) => {
return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions));
}
},
};
}
/**
@@ -33103,6 +34246,9 @@ class BlobServiceClient extends StorageClient {
if (options.includeMetadata) {
include.push("metadata");
}
if (options.includeSystem) {
include.push("system");
}
// AsyncIterableIterator to iterate over containers
const listSegmentOptions = Object.assign(Object.assign({}, options), (include.length > 0 ? { include } : {}));
const iter = this.listItems(listSegmentOptions);
@@ -33124,7 +34270,7 @@ class BlobServiceClient extends StorageClient {
*/
byPage: (settings = {}) => {
return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions));
}
},
};
}
/**
@@ -33143,7 +34289,7 @@ class BlobServiceClient extends StorageClient {
try {
const response = await this.serviceContext.getUserDelegationKey({
startsOn: truncatedISO8061Date(startsOn, false),
expiresOn: truncatedISO8061Date(expiresOn, false)
expiresOn: truncatedISO8061Date(expiresOn, false),
}, Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));
const userDelegationKey = {
signedObjectId: response.signedObjectId,
@@ -33152,7 +34298,7 @@ class BlobServiceClient extends StorageClient {
signedExpiresOn: new Date(response.signedExpiresOn),
signedService: response.signedService,
signedVersion: response.signedVersion,
value: response.value
value: response.value,
};
const res = Object.assign({ _response: response._response, requestId: response.requestId, clientRequestId: response.clientRequestId, version: response.version, date: response.date, errorCode: response.errorCode }, userDelegationKey);
return res;
@@ -33160,7 +34306,7 @@ class BlobServiceClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -33209,39 +34355,27 @@ class BlobServiceClient extends StorageClient {
Object.defineProperty(exports, 'BaseRequestPolicy', {
enumerable: true,
get: function () {
return coreHttp.BaseRequestPolicy;
}
get: function () { return coreHttp.BaseRequestPolicy; }
});
Object.defineProperty(exports, 'HttpHeaders', {
enumerable: true,
get: function () {
return coreHttp.HttpHeaders;
}
get: function () { return coreHttp.HttpHeaders; }
});
Object.defineProperty(exports, 'RequestPolicyOptions', {
enumerable: true,
get: function () {
return coreHttp.RequestPolicyOptions;
}
get: function () { return coreHttp.RequestPolicyOptions; }
});
Object.defineProperty(exports, 'RestError', {
enumerable: true,
get: function () {
return coreHttp.RestError;
}
get: function () { return coreHttp.RestError; }
});
Object.defineProperty(exports, 'WebResource', {
enumerable: true,
get: function () {
return coreHttp.WebResource;
}
get: function () { return coreHttp.WebResource; }
});
Object.defineProperty(exports, 'deserializationPolicy', {
enumerable: true,
get: function () {
return coreHttp.deserializationPolicy;
}
get: function () { return coreHttp.deserializationPolicy; }
});
exports.AccountSASPermissions = AccountSASPermissions;
exports.AccountSASResourceTypes = AccountSASResourceTypes;
@@ -36294,7 +37428,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getInputAsInt = exports.getInputAsArray = exports.isValidEvent = exports.logWarning = exports.getCacheState = exports.setOutputAndState = exports.setCacheHitOutput = exports.setCacheState = exports.isExactKeyMatch = exports.isGhes = void 0;
exports.isCacheFeatureAvailable = exports.getInputAsInt = exports.getInputAsArray = exports.isValidEvent = exports.logWarning = exports.getCacheState = exports.setOutputAndState = exports.setCacheHitOutput = exports.setCacheState = exports.isExactKeyMatch = exports.isGhes = void 0;
const cache = __importStar(__webpack_require__(692));
const core = __importStar(__webpack_require__(470));
const constants_1 = __webpack_require__(196);
function isGhes() {
@@ -36359,6 +37494,19 @@ function getInputAsInt(name, options) {
return value;
}
exports.getInputAsInt = getInputAsInt;
function isCacheFeatureAvailable() {
if (!cache.isFeatureAvailable()) {
if (isGhes()) {
logWarning("Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not.");
}
else {
logWarning("An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions.");
}
return false;
}
return true;
}
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
/***/ }),
@@ -39151,7 +40299,7 @@ function defer(fn)
Object.defineProperty(exports, '__esModule', { value: true });
__webpack_require__(71);
__webpack_require__(97);
var tslib = __webpack_require__(671);
// Copyright (c) Microsoft Corporation.
@@ -45223,6 +46371,15 @@ function checkKey(key) {
throw new ValidationError(`Key Validation Error: ${key} cannot contain commas.`);
}
}
/**
* isFeatureAvailable to check the presence of Actions cache service
*
* @returns boolean return true if Actions cache service feature is available, otherwise false
*/
function isFeatureAvailable() {
return !!process.env['ACTIONS_CACHE_URL'];
}
exports.isFeatureAvailable = isFeatureAvailable;
/**
* Restores cache from keys
*
@@ -45289,18 +46446,12 @@ exports.restoreCache = restoreCache;
* @returns number returns cacheId if the cache was saved successfully and throws an error if save fails
*/
function saveCache(paths, key, options) {
var _a, _b, _c, _d, _e;
return __awaiter(this, void 0, void 0, function* () {
checkPaths(paths);
checkKey(key);
const compressionMethod = yield utils.getCompressionMethod();
core.debug('Reserving Cache');
const cacheId = yield cacheHttpClient.reserveCache(key, paths, {
compressionMethod
});
if (cacheId === -1) {
throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`);
}
core.debug(`Cache ID: ${cacheId}`);
let cacheId = null;
const cachePaths = yield utils.resolvePaths(paths);
core.debug('Cache Paths:');
core.debug(`${JSON.stringify(cachePaths)}`);
@@ -45315,9 +46466,24 @@ function saveCache(paths, key, options) {
const fileSizeLimit = 10 * 1024 * 1024 * 1024; // 10GB per repo limit
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
core.debug(`File Size: ${archiveFileSize}`);
if (archiveFileSize > fileSizeLimit) {
// For GHES, this check will take place in ReserveCache API with enterprise file size limit
if (archiveFileSize > fileSizeLimit && !utils.isGhes()) {
throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`);
}
core.debug('Reserving Cache');
const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, {
compressionMethod,
cacheSize: archiveFileSize
});
if ((_a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a === void 0 ? void 0 : _a.cacheId) {
cacheId = (_b = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _b === void 0 ? void 0 : _b.cacheId;
}
else if ((reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.statusCode) === 400) {
throw new ReserveCacheError((_d = (_c = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : `Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the data cap limit, not saving cache.`);
}
else {
throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`);
}
core.debug(`Saving Cache (ID: ${cacheId})`);
yield cacheHttpClient.saveCache(cacheId, archivePath, options);
}
@@ -46751,8 +47917,7 @@ const utils = __importStar(__webpack_require__(443));
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
if (utils.isGhes()) {
utils.logWarning("Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details");
if (!utils.isCacheFeatureAvailable()) {
utils.setCacheHitOutput(false);
return;
}
@@ -49576,7 +50741,6 @@ class Poller {
});
}
/**
* @internal
* Starts a loop that will break only if the poller is done
* or if the poller is stopped.
*/
@@ -49590,7 +50754,6 @@ class Poller {
}
}
/**
* @internal
* pollOnce does one polling, by calling to the update method of the underlying
* poll operation to make any relevant change effective.
*
@@ -49624,7 +50787,6 @@ class Poller {
}
}
/**
* @internal
* fireProgress calls the functions passed in via onProgress the method of the poller.
*
* It loops over all of the callbacks received from onProgress, and executes them, sending them
@@ -49638,7 +50800,6 @@ class Poller {
}
}
/**
* @internal
* Invokes the underlying operation's cancel method, and rejects the
* pollUntilDone promise.
*/
@@ -49812,7 +50973,7 @@ class Poller {
*/
function getPollingUrl(rawResponse, defaultPath) {
var _a, _b, _c;
return ((_c = (_b = (_a = getAzureAsyncOperation(rawResponse)) !== null && _a !== void 0 ? _a : getLocation(rawResponse)) !== null && _b !== void 0 ? _b : getOperationLocation(rawResponse)) !== null && _c !== void 0 ? _c : defaultPath);
return ((_c = (_b = (_a = getAzureAsyncOperation(rawResponse)) !== null && _a !== void 0 ? _a : getOperationLocation(rawResponse)) !== null && _b !== void 0 ? _b : getLocation(rawResponse)) !== null && _c !== void 0 ? _c : defaultPath);
}
function getLocation(rawResponse) {
return rawResponse.headers["location"];
@@ -49823,19 +50984,29 @@ function getOperationLocation(rawResponse) {
function getAzureAsyncOperation(rawResponse) {
return rawResponse.headers["azure-asyncoperation"];
}
function findResourceLocation(requestMethod, rawResponse, requestPath) {
switch (requestMethod) {
case "PUT": {
return requestPath;
}
case "POST":
case "PATCH": {
return getLocation(rawResponse);
}
default: {
return undefined;
}
}
}
function inferLroMode(requestPath, requestMethod, rawResponse) {
if (getAzureAsyncOperation(rawResponse) !== undefined) {
if (getAzureAsyncOperation(rawResponse) !== undefined ||
getOperationLocation(rawResponse) !== undefined) {
return {
mode: "AzureAsync",
resourceLocation: requestMethod === "PUT"
? requestPath
: requestMethod === "POST" || requestMethod === "PATCH"
? getLocation(rawResponse)
: undefined,
mode: "Location",
resourceLocation: findResourceLocation(requestMethod, rawResponse, requestPath),
};
}
else if (getLocation(rawResponse) !== undefined ||
getOperationLocation(rawResponse) !== undefined) {
else if (getLocation(rawResponse) !== undefined) {
return {
mode: "Location",
};
@@ -49905,13 +51076,13 @@ function processBodyPollingOperationResult(response) {
const logger = logger$1.createClientLogger("core-lro");
// Copyright (c) Microsoft Corporation.
function getResponseStatus(rawResponse) {
function isPollingDone(rawResponse) {
var _a;
if (isUnexpectedPollingResponse(rawResponse) || rawResponse.statusCode === 202) {
return false;
}
const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {};
return typeof status === "string" ? status.toLowerCase() : "succeeded";
}
function isAzureAsyncPollingDone(rawResponse) {
const state = getResponseStatus(rawResponse);
const state = typeof status === "string" ? status.toLowerCase() : "succeeded";
if (isUnexpectedPollingResponse(rawResponse) || failureStates.includes(state)) {
throw new Error(`The long running operation has failed. The provisioning state: ${state}.`);
}
@@ -49931,9 +51102,9 @@ async function sendFinalRequest(lro, resourceLocation, lroResourceLocationConfig
return lro.sendPollRequest(resourceLocation !== null && resourceLocation !== void 0 ? resourceLocation : lro.requestPath);
}
}
function processAzureAsyncOperationResult(lro, resourceLocation, lroResourceLocationConfig) {
function processLocationPollingOperationResult(lro, resourceLocation, lroResourceLocationConfig) {
return (response) => {
if (isAzureAsyncPollingDone(response.rawResponse)) {
if (isPollingDone(response.rawResponse)) {
if (resourceLocation === undefined) {
return Object.assign(Object.assign({}, response), { done: true });
}
@@ -49948,14 +51119,6 @@ function processAzureAsyncOperationResult(lro, resourceLocation, lroResourceLoca
};
}
// Copyright (c) Microsoft Corporation.
function isLocationPollingDone(rawResponse) {
return !isUnexpectedPollingResponse(rawResponse) && rawResponse.statusCode !== 202;
}
function processLocationPollingOperationResult(response) {
return Object.assign(Object.assign({}, response), { done: isLocationPollingDone(response.rawResponse) });
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
function processPassthroughOperationResult(response) {
@@ -49968,11 +51131,8 @@ function processPassthroughOperationResult(response) {
*/
function createGetLroStatusFromResponse(lroPrimitives, config, lroResourceLocationConfig) {
switch (config.mode) {
case "AzureAsync": {
return processAzureAsyncOperationResult(lroPrimitives, config.resourceLocation, lroResourceLocationConfig);
}
case "Location": {
return processLocationPollingOperationResult;
return processLocationPollingOperationResult(lroPrimitives, config.resourceLocation, lroResourceLocationConfig);
}
case "Body": {
return processBodyPollingOperationResult;
@@ -50422,7 +51582,8 @@ function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetry
return {
statusCode: error.statusCode,
result: null,
headers: {}
headers: {},
error
};
}
else {
@@ -53428,7 +54589,7 @@ var FormData = __webpack_require__(790);
var node_fetch = __webpack_require__(454);
var coreTracing = __webpack_require__(263);
var url = __webpack_require__(835);
__webpack_require__(71);
__webpack_require__(97);
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
+1711 -550
View File
@@ -1199,6 +1199,11 @@ function assertDefined(name, value) {
return value;
}
exports.assertDefined = assertDefined;
function isGhes() {
const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
}
exports.isGhes = isGhes;
//# sourceMappingURL=cacheUtils.js.map
/***/ }),
@@ -1473,17 +1478,7 @@ exports.parseURL = __webpack_require__(936).parseURL;
/***/ }),
/* 71 */
/***/ (function() {
"use strict";
if (typeof Symbol === undefined || !Symbol.asyncIterator) {
Symbol.asyncIterator = Symbol.for("Symbol.asyncIterator");
}
//# sourceMappingURL=index.js.map
/***/ }),
/* 71 */,
/* 72 */,
/* 73 */,
/* 74 */,
@@ -2743,7 +2738,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
/***/ }),
/* 96 */,
/* 97 */,
/* 97 */
/***/ (function() {
"use strict";
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
if (typeof Symbol === undefined || !Symbol.asyncIterator) {
Symbol.asyncIterator = Symbol.for("Symbol.asyncIterator");
}
//# sourceMappingURL=index.js.map
/***/ }),
/* 98 */,
/* 99 */,
/* 100 */,
@@ -3190,10 +3197,7 @@ const options_1 = __webpack_require__(538);
const requestUtils_1 = __webpack_require__(899);
const versionSalt = '1.0';
function getCacheApiUrl(resource) {
// Ideally we just use ACTIONS_CACHE_URL
const baseUrl = (process.env['ACTIONS_CACHE_URL'] ||
process.env['ACTIONS_RUNTIME_URL'] ||
'').replace('pipelines', 'artifactcache');
const baseUrl = process.env['ACTIONS_CACHE_URL'] || '';
if (!baseUrl) {
throw new Error('Cache Service Url not found, unable to restore cache.');
}
@@ -3271,18 +3275,18 @@ function downloadCache(archiveLocation, archivePath, options) {
exports.downloadCache = downloadCache;
// Reserve Cache
function reserveCache(key, paths, options) {
var _a, _b;
return __awaiter(this, void 0, void 0, function* () {
const httpClient = createHttpClient();
const version = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod);
const reserveCacheRequest = {
key,
version
version,
cacheSize: options === null || options === void 0 ? void 0 : options.cacheSize
};
const response = yield requestUtils_1.retryTypedResponse('reserveCache', () => __awaiter(this, void 0, void 0, function* () {
return httpClient.postJson(getCacheApiUrl('caches'), reserveCacheRequest);
}));
return (_b = (_a = response === null || response === void 0 ? void 0 : response.result) === null || _a === void 0 ? void 0 : _a.cacheId) !== null && _b !== void 0 ? _b : -1;
return response;
});
}
exports.reserveCache = reserveCache;
@@ -5488,7 +5492,8 @@ function downloadCacheStorageSDK(archiveLocation, archivePath, options) {
//
// If the file exceeds the buffer maximum length (~1 GB on 32-bit systems and ~2 GB
// on 64-bit systems), split the download into multiple segments
const maxSegmentSize = buffer.constants.MAX_LENGTH;
// ~2 GB = 2147483647, beyond this, we start getting out of range error. So, capping it accordingly.
const maxSegmentSize = Math.min(2147483647, buffer.constants.MAX_LENGTH);
const downloadProgress = new DownloadProgress(contentLength);
const fd = fs.openSync(archivePath, 'w');
try {
@@ -9645,6 +9650,29 @@ var events = __webpack_require__(614);
var fs = __webpack_require__(747);
var util = __webpack_require__(669);
function _interopNamespace(e) {
if (e && e.__esModule) return e;
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n["default"] = e;
return Object.freeze(n);
}
var coreHttp__namespace = /*#__PURE__*/_interopNamespace(coreHttp);
var os__namespace = /*#__PURE__*/_interopNamespace(os);
var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
var util__namespace = /*#__PURE__*/_interopNamespace(util);
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
@@ -10599,10 +10627,10 @@ const BlobItemInternal = {
modelProperties: {
name: {
serializedName: "Name",
required: true,
xmlName: "Name",
type: {
name: "String"
name: "Composite",
className: "BlobName"
}
},
deleted: {
@@ -10677,6 +10705,30 @@ const BlobItemInternal = {
}
}
};
const BlobName = {
serializedName: "BlobName",
type: {
name: "Composite",
className: "BlobName",
modelProperties: {
encoded: {
serializedName: "Encoded",
xmlName: "Encoded",
xmlIsAttribute: true,
type: {
name: "Boolean"
}
},
content: {
serializedName: "content",
xmlName: "content",
type: {
name: "String"
}
}
}
}
};
const BlobPropertiesInternal = {
serializedName: "BlobPropertiesInternal",
xmlName: "Properties",
@@ -11120,10 +11172,10 @@ const BlobPrefix = {
modelProperties: {
name: {
serializedName: "Name",
required: true,
xmlName: "Name",
type: {
name: "String"
name: "Composite",
className: "BlobName"
}
}
}
@@ -12746,6 +12798,59 @@ const ContainerSubmitBatchExceptionHeaders = {
}
}
};
const ContainerFilterBlobsHeaders = {
serializedName: "Container_filterBlobsHeaders",
type: {
name: "Composite",
className: "ContainerFilterBlobsHeaders",
modelProperties: {
clientRequestId: {
serializedName: "x-ms-client-request-id",
xmlName: "x-ms-client-request-id",
type: {
name: "String"
}
},
requestId: {
serializedName: "x-ms-request-id",
xmlName: "x-ms-request-id",
type: {
name: "String"
}
},
version: {
serializedName: "x-ms-version",
xmlName: "x-ms-version",
type: {
name: "String"
}
},
date: {
serializedName: "date",
xmlName: "date",
type: {
name: "DateTimeRfc1123"
}
}
}
}
};
const ContainerFilterBlobsExceptionHeaders = {
serializedName: "Container_filterBlobsExceptionHeaders",
type: {
name: "Composite",
className: "ContainerFilterBlobsExceptionHeaders",
modelProperties: {
errorCode: {
serializedName: "x-ms-error-code",
xmlName: "x-ms-error-code",
type: {
name: "String"
}
}
}
}
};
const ContainerAcquireLeaseHeaders = {
serializedName: "Container_acquireLeaseHeaders",
type: {
@@ -15254,6 +15359,13 @@ const BlobCopyFromURLHeaders = {
name: "ByteArray"
}
},
encryptionScope: {
serializedName: "x-ms-encryption-scope",
xmlName: "x-ms-encryption-scope",
type: {
name: "String"
}
},
errorCode: {
serializedName: "x-ms-error-code",
xmlName: "x-ms-error-code",
@@ -17771,6 +17883,7 @@ var Mappers = /*#__PURE__*/Object.freeze({
ListBlobsFlatSegmentResponse: ListBlobsFlatSegmentResponse,
BlobFlatListSegment: BlobFlatListSegment,
BlobItemInternal: BlobItemInternal,
BlobName: BlobName,
BlobPropertiesInternal: BlobPropertiesInternal,
ListBlobsHierarchySegmentResponse: ListBlobsHierarchySegmentResponse,
BlobHierarchyListSegment: BlobHierarchyListSegment,
@@ -17822,6 +17935,8 @@ var Mappers = /*#__PURE__*/Object.freeze({
ContainerRenameExceptionHeaders: ContainerRenameExceptionHeaders,
ContainerSubmitBatchHeaders: ContainerSubmitBatchHeaders,
ContainerSubmitBatchExceptionHeaders: ContainerSubmitBatchExceptionHeaders,
ContainerFilterBlobsHeaders: ContainerFilterBlobsHeaders,
ContainerFilterBlobsExceptionHeaders: ContainerFilterBlobsExceptionHeaders,
ContainerAcquireLeaseHeaders: ContainerAcquireLeaseHeaders,
ContainerAcquireLeaseExceptionHeaders: ContainerAcquireLeaseExceptionHeaders,
ContainerReleaseLeaseHeaders: ContainerReleaseLeaseHeaders,
@@ -18009,7 +18124,7 @@ const timeoutInSeconds = {
const version = {
parameterPath: "version",
mapper: {
defaultValue: "2020-10-02",
defaultValue: "2021-04-10",
isConstant: true,
serializedName: "x-ms-version",
type: {
@@ -18104,7 +18219,7 @@ const include = {
element: {
type: {
name: "Enum",
allowedValues: ["metadata", "deleted"]
allowedValues: ["metadata", "deleted", "system"]
}
}
}
@@ -18626,11 +18741,10 @@ const encryptionKeySha256 = {
}
};
const encryptionAlgorithm = {
parameterPath: ["options", "encryptionAlgorithm"],
parameterPath: ["options", "cpkInfo", "encryptionAlgorithm"],
mapper: {
defaultValue: "AES256",
isConstant: true,
serializedName: "x-ms-encryption-algorithm",
xmlName: "x-ms-encryption-algorithm",
type: {
name: "String"
}
@@ -19547,7 +19661,7 @@ class Service {
setProperties(blobServiceProperties, options) {
const operationArguments = {
blobServiceProperties,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, setPropertiesOperationSpec);
}
@@ -19558,9 +19672,9 @@ class Service {
*/
getProperties(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec);
return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec$2);
}
/**
* Retrieves statistics related to replication for the Blob service. It is only available on the
@@ -19570,7 +19684,7 @@ class Service {
*/
getStatistics(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getStatisticsOperationSpec);
}
@@ -19580,7 +19694,7 @@ class Service {
*/
listContainersSegment(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, listContainersSegmentOperationSpec);
}
@@ -19593,7 +19707,7 @@ class Service {
getUserDelegationKey(keyInfo, options) {
const operationArguments = {
keyInfo,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getUserDelegationKeyOperationSpec);
}
@@ -19603,9 +19717,9 @@ class Service {
*/
getAccountInfo(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec);
return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec$2);
}
/**
* The Batch operation allows multiple API calls to be embedded into a single HTTP request.
@@ -19620,9 +19734,9 @@ class Service {
contentLength,
multipartContentType,
body,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, submitBatchOperationSpec);
return this.client.sendOperationRequest(operationArguments, submitBatchOperationSpec$1);
}
/**
* The Filter Blobs operation enables callers to list blobs across all containers whose tags match a
@@ -19632,13 +19746,13 @@ class Service {
*/
filterBlobs(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, filterBlobsOperationSpec);
return this.client.sendOperationRequest(operationArguments, filterBlobsOperationSpec$1);
}
}
// Operation Specifications
const xmlSerializer = new coreHttp.Serializer(Mappers, /* isXml */ true);
const xmlSerializer$5 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true);
const setPropertiesOperationSpec = {
path: "/",
httpMethod: "PUT",
@@ -19667,9 +19781,9 @@ const setPropertiesOperationSpec = {
isXML: true,
contentType: "application/xml; charset=utf-8",
mediaType: "xml",
serializer: xmlSerializer
serializer: xmlSerializer$5
};
const getPropertiesOperationSpec = {
const getPropertiesOperationSpec$2 = {
path: "/",
httpMethod: "GET",
responses: {
@@ -19694,7 +19808,7 @@ const getPropertiesOperationSpec = {
accept1
],
isXML: true,
serializer: xmlSerializer
serializer: xmlSerializer$5
};
const getStatisticsOperationSpec = {
path: "/",
@@ -19721,7 +19835,7 @@ const getStatisticsOperationSpec = {
accept1
],
isXML: true,
serializer: xmlSerializer
serializer: xmlSerializer$5
};
const listContainersSegmentOperationSpec = {
path: "/",
@@ -19751,7 +19865,7 @@ const listContainersSegmentOperationSpec = {
accept1
],
isXML: true,
serializer: xmlSerializer
serializer: xmlSerializer$5
};
const getUserDelegationKeyOperationSpec = {
path: "/",
@@ -19782,9 +19896,9 @@ const getUserDelegationKeyOperationSpec = {
isXML: true,
contentType: "application/xml; charset=utf-8",
mediaType: "xml",
serializer: xmlSerializer
serializer: xmlSerializer$5
};
const getAccountInfoOperationSpec = {
const getAccountInfoOperationSpec$2 = {
path: "/",
httpMethod: "GET",
responses: {
@@ -19800,9 +19914,9 @@ const getAccountInfoOperationSpec = {
urlParameters: [url],
headerParameters: [version, accept1],
isXML: true,
serializer: xmlSerializer
serializer: xmlSerializer$5
};
const submitBatchOperationSpec = {
const submitBatchOperationSpec$1 = {
path: "/",
httpMethod: "POST",
responses: {
@@ -19832,9 +19946,9 @@ const submitBatchOperationSpec = {
isXML: true,
contentType: "application/xml; charset=utf-8",
mediaType: "xml",
serializer: xmlSerializer
serializer: xmlSerializer$5
};
const filterBlobsOperationSpec = {
const filterBlobsOperationSpec$1 = {
path: "/",
httpMethod: "GET",
responses: {
@@ -19861,7 +19975,7 @@ const filterBlobsOperationSpec = {
accept1
],
isXML: true,
serializer: xmlSerializer
serializer: xmlSerializer$5
};
/*
@@ -19887,9 +20001,9 @@ class Container {
*/
create(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, createOperationSpec);
return this.client.sendOperationRequest(operationArguments, createOperationSpec$2);
}
/**
* returns all user-defined metadata and system properties for the specified container. The data
@@ -19898,7 +20012,7 @@ class Container {
*/
getProperties(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec$1);
}
@@ -19909,9 +20023,9 @@ class Container {
*/
delete(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, deleteOperationSpec);
return this.client.sendOperationRequest(operationArguments, deleteOperationSpec$1);
}
/**
* operation sets one or more user-defined name-value pairs for the specified container.
@@ -19919,9 +20033,9 @@ class Container {
*/
setMetadata(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, setMetadataOperationSpec);
return this.client.sendOperationRequest(operationArguments, setMetadataOperationSpec$1);
}
/**
* gets the permissions for the specified container. The permissions indicate whether container data
@@ -19930,7 +20044,7 @@ class Container {
*/
getAccessPolicy(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getAccessPolicyOperationSpec);
}
@@ -19941,7 +20055,7 @@ class Container {
*/
setAccessPolicy(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, setAccessPolicyOperationSpec);
}
@@ -19951,7 +20065,7 @@ class Container {
*/
restore(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, restoreOperationSpec);
}
@@ -19963,7 +20077,7 @@ class Container {
rename(sourceContainerName, options) {
const operationArguments = {
sourceContainerName,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, renameOperationSpec);
}
@@ -19980,9 +20094,20 @@ class Container {
contentLength,
multipartContentType,
body,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, submitBatchOperationSpec$1);
return this.client.sendOperationRequest(operationArguments, submitBatchOperationSpec);
}
/**
* The Filter Blobs operation enables callers to list blobs in a container whose tags match a given
* search expression. Filter blobs searches within the given container.
* @param options The options parameters.
*/
filterBlobs(options) {
const operationArguments = {
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, filterBlobsOperationSpec);
}
/**
* [Update] establishes and manages a lock on a container for delete operations. The lock duration can
@@ -19991,9 +20116,9 @@ class Container {
*/
acquireLease(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, acquireLeaseOperationSpec);
return this.client.sendOperationRequest(operationArguments, acquireLeaseOperationSpec$1);
}
/**
* [Update] establishes and manages a lock on a container for delete operations. The lock duration can
@@ -20004,9 +20129,9 @@ class Container {
releaseLease(leaseId, options) {
const operationArguments = {
leaseId,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, releaseLeaseOperationSpec);
return this.client.sendOperationRequest(operationArguments, releaseLeaseOperationSpec$1);
}
/**
* [Update] establishes and manages a lock on a container for delete operations. The lock duration can
@@ -20017,9 +20142,9 @@ class Container {
renewLease(leaseId, options) {
const operationArguments = {
leaseId,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, renewLeaseOperationSpec);
return this.client.sendOperationRequest(operationArguments, renewLeaseOperationSpec$1);
}
/**
* [Update] establishes and manages a lock on a container for delete operations. The lock duration can
@@ -20028,9 +20153,9 @@ class Container {
*/
breakLease(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, breakLeaseOperationSpec);
return this.client.sendOperationRequest(operationArguments, breakLeaseOperationSpec$1);
}
/**
* [Update] establishes and manages a lock on a container for delete operations. The lock duration can
@@ -20045,9 +20170,9 @@ class Container {
const operationArguments = {
leaseId,
proposedLeaseId,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, changeLeaseOperationSpec);
return this.client.sendOperationRequest(operationArguments, changeLeaseOperationSpec$1);
}
/**
* [Update] The List Blobs operation returns a list of the blobs under the specified container
@@ -20055,7 +20180,7 @@ class Container {
*/
listBlobFlatSegment(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, listBlobFlatSegmentOperationSpec);
}
@@ -20070,7 +20195,7 @@ class Container {
listBlobHierarchySegment(delimiter, options) {
const operationArguments = {
delimiter,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, listBlobHierarchySegmentOperationSpec);
}
@@ -20080,14 +20205,14 @@ class Container {
*/
getAccountInfo(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec$1);
}
}
// Operation Specifications
const xmlSerializer$1 = new coreHttp.Serializer(Mappers, /* isXml */ true);
const createOperationSpec = {
const xmlSerializer$4 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true);
const createOperationSpec$2 = {
path: "/{containerName}",
httpMethod: "PUT",
responses: {
@@ -20111,7 +20236,7 @@ const createOperationSpec = {
preventEncryptionScopeOverride
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const getPropertiesOperationSpec$1 = {
path: "/{containerName}",
@@ -20134,9 +20259,9 @@ const getPropertiesOperationSpec$1 = {
leaseId
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const deleteOperationSpec = {
const deleteOperationSpec$1 = {
path: "/{containerName}",
httpMethod: "DELETE",
responses: {
@@ -20159,9 +20284,9 @@ const deleteOperationSpec = {
ifUnmodifiedSince
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const setMetadataOperationSpec = {
const setMetadataOperationSpec$1 = {
path: "/{containerName}",
httpMethod: "PUT",
responses: {
@@ -20188,7 +20313,7 @@ const setMetadataOperationSpec = {
ifModifiedSince
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const getAccessPolicyOperationSpec = {
path: "/{containerName}",
@@ -20227,7 +20352,7 @@ const getAccessPolicyOperationSpec = {
leaseId
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const setAccessPolicyOperationSpec = {
path: "/{containerName}",
@@ -20261,7 +20386,7 @@ const setAccessPolicyOperationSpec = {
isXML: true,
contentType: "application/xml; charset=utf-8",
mediaType: "xml",
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const restoreOperationSpec = {
path: "/{containerName}",
@@ -20289,7 +20414,7 @@ const restoreOperationSpec = {
deletedContainerVersion
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const renameOperationSpec = {
path: "/{containerName}",
@@ -20317,9 +20442,9 @@ const renameOperationSpec = {
sourceLeaseId
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const submitBatchOperationSpec$1 = {
const submitBatchOperationSpec = {
path: "/{containerName}",
httpMethod: "POST",
responses: {
@@ -20353,9 +20478,39 @@ const submitBatchOperationSpec$1 = {
isXML: true,
contentType: "application/xml; charset=utf-8",
mediaType: "xml",
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const acquireLeaseOperationSpec = {
const filterBlobsOperationSpec = {
path: "/{containerName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: FilterBlobSegment,
headersMapper: ContainerFilterBlobsHeaders
},
default: {
bodyMapper: StorageError,
headersMapper: ContainerFilterBlobsExceptionHeaders
}
},
queryParameters: [
timeoutInSeconds,
marker,
maxPageSize,
comp5,
where,
restype2
],
urlParameters: [url],
headerParameters: [
version,
requestId,
accept1
],
isXML: true,
serializer: xmlSerializer$4
};
const acquireLeaseOperationSpec$1 = {
path: "/{containerName}",
httpMethod: "PUT",
responses: {
@@ -20384,9 +20539,9 @@ const acquireLeaseOperationSpec = {
proposedLeaseId
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const releaseLeaseOperationSpec = {
const releaseLeaseOperationSpec$1 = {
path: "/{containerName}",
httpMethod: "PUT",
responses: {
@@ -20414,9 +20569,9 @@ const releaseLeaseOperationSpec = {
leaseId1
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const renewLeaseOperationSpec = {
const renewLeaseOperationSpec$1 = {
path: "/{containerName}",
httpMethod: "PUT",
responses: {
@@ -20444,9 +20599,9 @@ const renewLeaseOperationSpec = {
action2
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const breakLeaseOperationSpec = {
const breakLeaseOperationSpec$1 = {
path: "/{containerName}",
httpMethod: "PUT",
responses: {
@@ -20474,9 +20629,9 @@ const breakLeaseOperationSpec = {
breakPeriod
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const changeLeaseOperationSpec = {
const changeLeaseOperationSpec$1 = {
path: "/{containerName}",
httpMethod: "PUT",
responses: {
@@ -20505,7 +20660,7 @@ const changeLeaseOperationSpec = {
proposedLeaseId1
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const listBlobFlatSegmentOperationSpec = {
path: "/{containerName}",
@@ -20536,7 +20691,7 @@ const listBlobFlatSegmentOperationSpec = {
accept1
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const listBlobHierarchySegmentOperationSpec = {
path: "/{containerName}",
@@ -20568,7 +20723,7 @@ const listBlobHierarchySegmentOperationSpec = {
accept1
],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
const getAccountInfoOperationSpec$1 = {
path: "/{containerName}",
@@ -20586,7 +20741,7 @@ const getAccountInfoOperationSpec$1 = {
urlParameters: [url],
headerParameters: [version, accept1],
isXML: true,
serializer: xmlSerializer$1
serializer: xmlSerializer$4
};
/*
@@ -20612,7 +20767,7 @@ class Blob$1 {
*/
download(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, downloadOperationSpec);
}
@@ -20623,9 +20778,9 @@ class Blob$1 {
*/
getProperties(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec$2);
return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec);
}
/**
* If the storage account's soft delete feature is disabled then, when a blob is deleted, it is
@@ -20644,9 +20799,9 @@ class Blob$1 {
*/
delete(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, deleteOperationSpec$1);
return this.client.sendOperationRequest(operationArguments, deleteOperationSpec);
}
/**
* Undelete a blob that was previously soft deleted
@@ -20654,7 +20809,7 @@ class Blob$1 {
*/
undelete(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, undeleteOperationSpec);
}
@@ -20666,7 +20821,7 @@ class Blob$1 {
setExpiry(expiryOptions, options) {
const operationArguments = {
expiryOptions,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, setExpiryOperationSpec);
}
@@ -20676,7 +20831,7 @@ class Blob$1 {
*/
setHttpHeaders(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, setHttpHeadersOperationSpec);
}
@@ -20686,7 +20841,7 @@ class Blob$1 {
*/
setImmutabilityPolicy(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, setImmutabilityPolicyOperationSpec);
}
@@ -20696,7 +20851,7 @@ class Blob$1 {
*/
deleteImmutabilityPolicy(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, deleteImmutabilityPolicyOperationSpec);
}
@@ -20708,7 +20863,7 @@ class Blob$1 {
setLegalHold(legalHold, options) {
const operationArguments = {
legalHold,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, setLegalHoldOperationSpec);
}
@@ -20719,9 +20874,9 @@ class Blob$1 {
*/
setMetadata(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, setMetadataOperationSpec$1);
return this.client.sendOperationRequest(operationArguments, setMetadataOperationSpec);
}
/**
* [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
@@ -20730,9 +20885,9 @@ class Blob$1 {
*/
acquireLease(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, acquireLeaseOperationSpec$1);
return this.client.sendOperationRequest(operationArguments, acquireLeaseOperationSpec);
}
/**
* [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
@@ -20743,9 +20898,9 @@ class Blob$1 {
releaseLease(leaseId, options) {
const operationArguments = {
leaseId,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, releaseLeaseOperationSpec$1);
return this.client.sendOperationRequest(operationArguments, releaseLeaseOperationSpec);
}
/**
* [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
@@ -20756,9 +20911,9 @@ class Blob$1 {
renewLease(leaseId, options) {
const operationArguments = {
leaseId,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, renewLeaseOperationSpec$1);
return this.client.sendOperationRequest(operationArguments, renewLeaseOperationSpec);
}
/**
* [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
@@ -20773,9 +20928,9 @@ class Blob$1 {
const operationArguments = {
leaseId,
proposedLeaseId,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, changeLeaseOperationSpec$1);
return this.client.sendOperationRequest(operationArguments, changeLeaseOperationSpec);
}
/**
* [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete
@@ -20784,9 +20939,9 @@ class Blob$1 {
*/
breakLease(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, breakLeaseOperationSpec$1);
return this.client.sendOperationRequest(operationArguments, breakLeaseOperationSpec);
}
/**
* The Create Snapshot operation creates a read-only snapshot of a blob
@@ -20794,7 +20949,7 @@ class Blob$1 {
*/
createSnapshot(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, createSnapshotOperationSpec);
}
@@ -20809,7 +20964,7 @@ class Blob$1 {
startCopyFromURL(copySource, options) {
const operationArguments = {
copySource,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, startCopyFromURLOperationSpec);
}
@@ -20825,7 +20980,7 @@ class Blob$1 {
copyFromURL(copySource, options) {
const operationArguments = {
copySource,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, copyFromURLOperationSpec);
}
@@ -20839,7 +20994,7 @@ class Blob$1 {
abortCopyFromURL(copyId, options) {
const operationArguments = {
copyId,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, abortCopyFromURLOperationSpec);
}
@@ -20855,7 +21010,7 @@ class Blob$1 {
setTier(tier, options) {
const operationArguments = {
tier,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, setTierOperationSpec);
}
@@ -20865,9 +21020,9 @@ class Blob$1 {
*/
getAccountInfo(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec$2);
return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec);
}
/**
* The Query operation enables users to select/project on blob data by providing simple query
@@ -20876,7 +21031,7 @@ class Blob$1 {
*/
query(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, queryOperationSpec);
}
@@ -20886,7 +21041,7 @@ class Blob$1 {
*/
getTags(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getTagsOperationSpec);
}
@@ -20896,13 +21051,13 @@ class Blob$1 {
*/
setTags(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, setTagsOperationSpec);
}
}
// Operation Specifications
const xmlSerializer$2 = new coreHttp.Serializer(Mappers, /* isXml */ true);
const xmlSerializer$3 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true);
const downloadOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "GET",
@@ -20950,9 +21105,9 @@ const downloadOperationSpec = {
ifTags
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const getPropertiesOperationSpec$2 = {
const getPropertiesOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "HEAD",
responses: {
@@ -20985,9 +21140,9 @@ const getPropertiesOperationSpec$2 = {
ifTags
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const deleteOperationSpec$1 = {
const deleteOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "DELETE",
responses: {
@@ -21019,7 +21174,7 @@ const deleteOperationSpec$1 = {
deleteSnapshots
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const undeleteOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21041,7 +21196,7 @@ const undeleteOperationSpec = {
accept1
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const setExpiryOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21065,7 +21220,7 @@ const setExpiryOperationSpec = {
expiresOn
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const setHttpHeadersOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21099,7 +21254,7 @@ const setHttpHeadersOperationSpec = {
blobContentDisposition
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const setImmutabilityPolicyOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21124,7 +21279,7 @@ const setImmutabilityPolicyOperationSpec = {
immutabilityPolicyMode
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const deleteImmutabilityPolicyOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21146,7 +21301,7 @@ const deleteImmutabilityPolicyOperationSpec = {
accept1
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const setLegalHoldOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21169,9 +21324,9 @@ const setLegalHoldOperationSpec = {
legalHold
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const setMetadataOperationSpec$1 = {
const setMetadataOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "PUT",
responses: {
@@ -21202,9 +21357,9 @@ const setMetadataOperationSpec$1 = {
encryptionScope
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const acquireLeaseOperationSpec$1 = {
const acquireLeaseOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "PUT",
responses: {
@@ -21232,9 +21387,9 @@ const acquireLeaseOperationSpec$1 = {
ifTags
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const releaseLeaseOperationSpec$1 = {
const releaseLeaseOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "PUT",
responses: {
@@ -21261,9 +21416,9 @@ const releaseLeaseOperationSpec$1 = {
ifTags
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const renewLeaseOperationSpec$1 = {
const renewLeaseOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "PUT",
responses: {
@@ -21290,9 +21445,9 @@ const renewLeaseOperationSpec$1 = {
ifTags
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const changeLeaseOperationSpec$1 = {
const changeLeaseOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "PUT",
responses: {
@@ -21320,9 +21475,9 @@ const changeLeaseOperationSpec$1 = {
ifTags
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const breakLeaseOperationSpec$1 = {
const breakLeaseOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "PUT",
responses: {
@@ -21349,7 +21504,7 @@ const breakLeaseOperationSpec$1 = {
ifTags
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const createSnapshotOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21382,7 +21537,7 @@ const createSnapshotOperationSpec = {
encryptionScope
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const startCopyFromURLOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21424,7 +21579,7 @@ const startCopyFromURLOperationSpec = {
legalHold1
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const copyFromURLOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21453,6 +21608,7 @@ const copyFromURLOperationSpec = {
ifTags,
immutabilityPolicyExpiry,
immutabilityPolicyMode,
encryptionScope,
tier,
sourceIfModifiedSince,
sourceIfUnmodifiedSince,
@@ -21466,7 +21622,7 @@ const copyFromURLOperationSpec = {
copySourceAuthorization
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const abortCopyFromURLOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21494,7 +21650,7 @@ const abortCopyFromURLOperationSpec = {
copyActionAbortConstant
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const setTierOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21528,9 +21684,9 @@ const setTierOperationSpec = {
tier1
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const getAccountInfoOperationSpec$2 = {
const getAccountInfoOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "GET",
responses: {
@@ -21546,7 +21702,7 @@ const getAccountInfoOperationSpec$2 = {
urlParameters: [url],
headerParameters: [version, accept1],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const queryOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21596,7 +21752,7 @@ const queryOperationSpec = {
isXML: true,
contentType: "application/xml; charset=utf-8",
mediaType: "xml",
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const getTagsOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21626,7 +21782,7 @@ const getTagsOperationSpec = {
ifTags
],
isXML: true,
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
const setTagsOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21660,7 +21816,7 @@ const setTagsOperationSpec = {
isXML: true,
contentType: "application/xml; charset=utf-8",
mediaType: "xml",
serializer: xmlSerializer$2
serializer: xmlSerializer$3
};
/*
@@ -21690,7 +21846,7 @@ class PageBlob {
const operationArguments = {
contentLength,
blobContentLength,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, createOperationSpec$1);
}
@@ -21704,7 +21860,7 @@ class PageBlob {
const operationArguments = {
contentLength,
body,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, uploadPagesOperationSpec);
}
@@ -21716,7 +21872,7 @@ class PageBlob {
clearPages(contentLength, options) {
const operationArguments = {
contentLength,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, clearPagesOperationSpec);
}
@@ -21737,7 +21893,7 @@ class PageBlob {
sourceRange,
contentLength,
range,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, uploadPagesFromURLOperationSpec);
}
@@ -21748,7 +21904,7 @@ class PageBlob {
*/
getPageRanges(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getPageRangesOperationSpec);
}
@@ -21759,7 +21915,7 @@ class PageBlob {
*/
getPageRangesDiff(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getPageRangesDiffOperationSpec);
}
@@ -21772,7 +21928,7 @@ class PageBlob {
resize(blobContentLength, options) {
const operationArguments = {
blobContentLength,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, resizeOperationSpec);
}
@@ -21786,7 +21942,7 @@ class PageBlob {
updateSequenceNumber(sequenceNumberAction, options) {
const operationArguments = {
sequenceNumberAction,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, updateSequenceNumberOperationSpec);
}
@@ -21805,14 +21961,14 @@ class PageBlob {
copyIncremental(copySource, options) {
const operationArguments = {
copySource,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, copyIncrementalOperationSpec);
}
}
// Operation Specifications
const xmlSerializer$3 = new coreHttp.Serializer(Mappers, /* isXml */ true);
const serializer = new coreHttp.Serializer(Mappers, /* isXml */ false);
const xmlSerializer$2 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true);
const serializer$2 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ false);
const createOperationSpec$1 = {
path: "/{containerName}/{blob}",
httpMethod: "PUT",
@@ -21859,7 +22015,7 @@ const createOperationSpec$1 = {
blobSequenceNumber
],
isXML: true,
serializer: xmlSerializer$3
serializer: xmlSerializer$2
};
const uploadPagesOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21901,7 +22057,7 @@ const uploadPagesOperationSpec = {
ifSequenceNumberEqualTo
],
mediaType: "binary",
serializer
serializer: serializer$2
};
const clearPagesOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21939,7 +22095,7 @@ const clearPagesOperationSpec = {
pageWrite1
],
isXML: true,
serializer: xmlSerializer$3
serializer: xmlSerializer$2
};
const uploadPagesFromURLOperationSpec = {
path: "/{containerName}/{blob}",
@@ -21986,7 +22142,7 @@ const uploadPagesFromURLOperationSpec = {
range1
],
isXML: true,
serializer: xmlSerializer$3
serializer: xmlSerializer$2
};
const getPageRangesOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22020,7 +22176,7 @@ const getPageRangesOperationSpec = {
ifTags
],
isXML: true,
serializer: xmlSerializer$3
serializer: xmlSerializer$2
};
const getPageRangesDiffOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22056,7 +22212,7 @@ const getPageRangesDiffOperationSpec = {
prevSnapshotUrl
],
isXML: true,
serializer: xmlSerializer$3
serializer: xmlSerializer$2
};
const resizeOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22089,7 +22245,7 @@ const resizeOperationSpec = {
blobContentLength
],
isXML: true,
serializer: xmlSerializer$3
serializer: xmlSerializer$2
};
const updateSequenceNumberOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22119,7 +22275,7 @@ const updateSequenceNumberOperationSpec = {
sequenceNumberAction
],
isXML: true,
serializer: xmlSerializer$3
serializer: xmlSerializer$2
};
const copyIncrementalOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22147,7 +22303,7 @@ const copyIncrementalOperationSpec = {
copySource
],
isXML: true,
serializer: xmlSerializer$3
serializer: xmlSerializer$2
};
/*
@@ -22174,9 +22330,9 @@ class AppendBlob {
create(contentLength, options) {
const operationArguments = {
contentLength,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, createOperationSpec$2);
return this.client.sendOperationRequest(operationArguments, createOperationSpec);
}
/**
* The Append Block operation commits a new block of data to the end of an existing append blob. The
@@ -22190,7 +22346,7 @@ class AppendBlob {
const operationArguments = {
contentLength,
body,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, appendBlockOperationSpec);
}
@@ -22207,7 +22363,7 @@ class AppendBlob {
const operationArguments = {
sourceUrl,
contentLength,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, appendBlockFromUrlOperationSpec);
}
@@ -22218,15 +22374,15 @@ class AppendBlob {
*/
seal(options) {
const operationArguments = {
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, sealOperationSpec);
}
}
// Operation Specifications
const xmlSerializer$4 = new coreHttp.Serializer(Mappers, /* isXml */ true);
const serializer$1 = new coreHttp.Serializer(Mappers, /* isXml */ false);
const createOperationSpec$2 = {
const xmlSerializer$1 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true);
const serializer$1 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ false);
const createOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "PUT",
responses: {
@@ -22269,7 +22425,7 @@ const createOperationSpec$2 = {
blobType1
],
isXML: true,
serializer: xmlSerializer$4
serializer: xmlSerializer$1
};
const appendBlockOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22353,7 +22509,7 @@ const appendBlockFromUrlOperationSpec = {
sourceRange1
],
isXML: true,
serializer: xmlSerializer$4
serializer: xmlSerializer$1
};
const sealOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22381,7 +22537,7 @@ const sealOperationSpec = {
appendPosition
],
isXML: true,
serializer: xmlSerializer$4
serializer: xmlSerializer$1
};
/*
@@ -22413,7 +22569,7 @@ class BlockBlob {
const operationArguments = {
contentLength,
body,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, uploadOperationSpec);
}
@@ -22434,7 +22590,7 @@ class BlockBlob {
const operationArguments = {
contentLength,
copySource,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, putBlobFromUrlOperationSpec);
}
@@ -22452,7 +22608,7 @@ class BlockBlob {
blockId,
contentLength,
body,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, stageBlockOperationSpec);
}
@@ -22471,7 +22627,7 @@ class BlockBlob {
blockId,
contentLength,
sourceUrl,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, stageBlockFromURLOperationSpec);
}
@@ -22489,7 +22645,7 @@ class BlockBlob {
commitBlockList(blocks, options) {
const operationArguments = {
blocks,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, commitBlockListOperationSpec);
}
@@ -22503,14 +22659,14 @@ class BlockBlob {
getBlockList(listType, options) {
const operationArguments = {
listType,
options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
};
return this.client.sendOperationRequest(operationArguments, getBlockListOperationSpec);
}
}
// Operation Specifications
const xmlSerializer$5 = new coreHttp.Serializer(Mappers, /* isXml */ true);
const serializer$2 = new coreHttp.Serializer(Mappers, /* isXml */ false);
const xmlSerializer = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true);
const serializer = new coreHttp__namespace.Serializer(Mappers, /* isXml */ false);
const uploadOperationSpec = {
path: "/{containerName}/{blob}",
httpMethod: "PUT",
@@ -22558,7 +22714,7 @@ const uploadOperationSpec = {
blobType2
],
mediaType: "binary",
serializer: serializer$2
serializer
};
const putBlobFromUrlOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22611,7 +22767,7 @@ const putBlobFromUrlOperationSpec = {
copySourceBlobProperties
],
isXML: true,
serializer: xmlSerializer$5
serializer: xmlSerializer
};
const stageBlockOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22647,7 +22803,7 @@ const stageBlockOperationSpec = {
accept2
],
mediaType: "binary",
serializer: serializer$2
serializer
};
const stageBlockFromURLOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22688,7 +22844,7 @@ const stageBlockFromURLOperationSpec = {
sourceRange1
],
isXML: true,
serializer: xmlSerializer$5
serializer: xmlSerializer
};
const commitBlockListOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22738,7 +22894,7 @@ const commitBlockListOperationSpec = {
isXML: true,
contentType: "application/xml; charset=utf-8",
mediaType: "xml",
serializer: xmlSerializer$5
serializer: xmlSerializer
};
const getBlockListOperationSpec = {
path: "/{containerName}/{blob}",
@@ -22768,7 +22924,7 @@ const getBlockListOperationSpec = {
ifTags
],
isXML: true,
serializer: xmlSerializer$5
serializer: xmlSerializer
};
// Copyright (c) Microsoft Corporation.
@@ -22779,8 +22935,8 @@ const logger = logger$1.createClientLogger("storage-blob");
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
const SDK_VERSION = "12.8.0";
const SERVICE_VERSION = "2020-10-02";
const SDK_VERSION = "12.9.0";
const SERVICE_VERSION = "2021-04-10";
const BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB
const BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB
const BLOCK_BLOB_MAX_BLOCKS = 50000;
@@ -22797,15 +22953,15 @@ const URLConstants = {
SIGNATURE: "sig",
SNAPSHOT: "snapshot",
VERSIONID: "versionid",
TIMEOUT: "timeout"
}
TIMEOUT: "timeout",
},
};
const HTTPURLConnection = {
HTTP_ACCEPTED: 202,
HTTP_CONFLICT: 409,
HTTP_NOT_FOUND: 404,
HTTP_PRECON_FAILED: 412,
HTTP_RANGE_NOT_SATISFIABLE: 416
HTTP_RANGE_NOT_SATISFIABLE: 416,
};
const HeaderConstants = {
AUTHORIZATION: "Authorization",
@@ -22830,7 +22986,7 @@ const HeaderConstants = {
X_MS_COPY_SOURCE: "x-ms-copy-source",
X_MS_DATE: "x-ms-date",
X_MS_ERROR_CODE: "x-ms-error-code",
X_MS_VERSION: "x-ms-version"
X_MS_VERSION: "x-ms-version",
};
const ETagNone = "";
const ETagAny = "*";
@@ -22935,7 +23091,7 @@ const StorageBlobLoggingAllowedHeaderNames = [
"x-ms-tag-count",
"x-ms-encryption-key-sha256",
"x-ms-if-tags",
"x-ms-source-if-tags"
"x-ms-source-if-tags",
];
const StorageBlobLoggingAllowedQueryParameters = [
"comp",
@@ -22970,8 +23126,9 @@ const StorageBlobLoggingAllowedQueryParameters = [
"skt",
"sktid",
"skv",
"snapshot"
"snapshot",
];
const BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption";
// Copyright (c) Microsoft Corporation.
/**
@@ -23111,7 +23268,7 @@ function extractConnectionStringParts(connectionString) {
url: blobEndpoint,
accountName,
accountKey,
proxyUri
proxyUri,
};
}
else {
@@ -23443,14 +23600,14 @@ function toBlobTags(tags) {
return undefined;
}
const res = {
blobTagSet: []
blobTagSet: [],
};
for (const key in tags) {
if (Object.prototype.hasOwnProperty.call(tags, key)) {
const value = tags[key];
res.blobTagSet.push({
key,
value
value,
});
}
}
@@ -23490,33 +23647,33 @@ function toQuerySerialization(textConfiguration) {
fieldQuote: textConfiguration.fieldQuote || "",
recordSeparator: textConfiguration.recordSeparator,
escapeChar: textConfiguration.escapeCharacter || "",
headersPresent: textConfiguration.hasHeaders || false
}
}
headersPresent: textConfiguration.hasHeaders || false,
},
},
};
case "json":
return {
format: {
type: "json",
jsonTextConfiguration: {
recordSeparator: textConfiguration.recordSeparator
}
}
recordSeparator: textConfiguration.recordSeparator,
},
},
};
case "arrow":
return {
format: {
type: "arrow",
arrowConfiguration: {
schema: textConfiguration.schema
}
}
schema: textConfiguration.schema,
},
},
};
case "parquet":
return {
format: {
type: "parquet"
}
type: "parquet",
},
};
default:
throw Error("Invalid BlobQueryTextConfiguration.");
@@ -23540,7 +23697,7 @@ function parseObjectReplicationRecord(objectReplicationRecord) {
}
const rule = {
ruleId: ids[1],
replicationStatus: objectReplicationRecord[key]
replicationStatus: objectReplicationRecord[key],
};
const policyIndex = orProperties.findIndex((policy) => policy.policyId === ids[0]);
if (policyIndex > -1) {
@@ -23549,7 +23706,7 @@ function parseObjectReplicationRecord(objectReplicationRecord) {
else {
orProperties.push({
policyId: ids[0],
rules: [rule]
rules: [rule],
});
}
}
@@ -23568,6 +23725,202 @@ function attachCredential(thing, credential) {
function httpAuthorizationToString(httpAuthorization) {
return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : undefined;
}
function BlobNameToString(name) {
if (name.encoded) {
return decodeURIComponent(name.content);
}
else {
return name.content;
}
}
function ConvertInternalResponseOfListBlobFlat(internalResponse) {
return Object.assign(Object.assign({}, internalResponse), { segment: {
blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => {
const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) });
return blobItem;
}),
} });
}
function ConvertInternalResponseOfListBlobHierarchy(internalResponse) {
var _a;
return Object.assign(Object.assign({}, internalResponse), { segment: {
blobPrefixes: (_a = internalResponse.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => {
const blobPrefix = {
name: BlobNameToString(blobPrefixInternal.name),
};
return blobPrefix;
}),
blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => {
const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) });
return blobItem;
}),
} });
}
function decodeBase64String(value) {
if (coreHttp.isNode) {
return Buffer.from(value, "base64");
}
else {
const byteString = atob(value);
const arr = new Uint8Array(byteString.length);
for (let i = 0; i < byteString.length; i++) {
arr[i] = byteString.charCodeAt(i);
}
return arr;
}
}
function ParseBoolean(content) {
if (content === undefined)
return undefined;
if (content === "true")
return true;
if (content === "false")
return false;
return undefined;
}
function ParseBlobName(blobNameInXML) {
if (blobNameInXML["$"] !== undefined && blobNameInXML["#"] !== undefined) {
return {
encoded: ParseBoolean(blobNameInXML["$"]["Encoded"]),
content: blobNameInXML["#"],
};
}
else {
return {
encoded: false,
content: blobNameInXML,
};
}
}
function ParseBlobItem(blobInXML) {
const blobPropertiesInXML = blobInXML["Properties"];
const blobProperties = {
createdOn: new Date(blobPropertiesInXML["Creation-Time"]),
lastModified: new Date(blobPropertiesInXML["Last-Modified"]),
etag: blobPropertiesInXML["Etag"],
contentLength: blobPropertiesInXML["Content-Length"] === undefined
? undefined
: parseFloat(blobPropertiesInXML["Content-Length"]),
contentType: blobPropertiesInXML["Content-Type"],
contentEncoding: blobPropertiesInXML["Content-Encoding"],
contentLanguage: blobPropertiesInXML["Content-Language"],
contentMD5: decodeBase64String(blobPropertiesInXML["Content-MD5"]),
contentDisposition: blobPropertiesInXML["Content-Disposition"],
cacheControl: blobPropertiesInXML["Cache-Control"],
blobSequenceNumber: blobPropertiesInXML["x-ms-blob-sequence-number"] === undefined
? undefined
: parseFloat(blobPropertiesInXML["x-ms-blob-sequence-number"]),
blobType: blobPropertiesInXML["BlobType"],
leaseStatus: blobPropertiesInXML["LeaseStatus"],
leaseState: blobPropertiesInXML["LeaseState"],
leaseDuration: blobPropertiesInXML["LeaseDuration"],
copyId: blobPropertiesInXML["CopyId"],
copyStatus: blobPropertiesInXML["CopyStatus"],
copySource: blobPropertiesInXML["CopySource"],
copyProgress: blobPropertiesInXML["CopyProgress"],
copyCompletedOn: blobPropertiesInXML["CopyCompletionTime"] === undefined
? undefined
: new Date(blobPropertiesInXML["CopyCompletionTime"]),
copyStatusDescription: blobPropertiesInXML["CopyStatusDescription"],
serverEncrypted: ParseBoolean(blobPropertiesInXML["ServerEncrypted"]),
incrementalCopy: ParseBoolean(blobPropertiesInXML["IncrementalCopy"]),
destinationSnapshot: blobPropertiesInXML["DestinationSnapshot"],
deletedOn: blobPropertiesInXML["DeletedTime"] === undefined
? undefined
: new Date(blobPropertiesInXML["DeletedTime"]),
remainingRetentionDays: blobPropertiesInXML["RemainingRetentionDays"] === undefined
? undefined
: parseFloat(blobPropertiesInXML["RemainingRetentionDays"]),
accessTier: blobPropertiesInXML["AccessTier"],
accessTierInferred: ParseBoolean(blobPropertiesInXML["AccessTierInferred"]),
archiveStatus: blobPropertiesInXML["ArchiveStatus"],
customerProvidedKeySha256: blobPropertiesInXML["CustomerProvidedKeySha256"],
encryptionScope: blobPropertiesInXML["EncryptionScope"],
accessTierChangedOn: blobPropertiesInXML["AccessTierChangeTime"] === undefined
? undefined
: new Date(blobPropertiesInXML["AccessTierChangeTime"]),
tagCount: blobPropertiesInXML["TagCount"] === undefined
? undefined
: parseFloat(blobPropertiesInXML["TagCount"]),
expiresOn: blobPropertiesInXML["Expiry-Time"] === undefined
? undefined
: new Date(blobPropertiesInXML["Expiry-Time"]),
isSealed: ParseBoolean(blobPropertiesInXML["Sealed"]),
rehydratePriority: blobPropertiesInXML["RehydratePriority"],
lastAccessedOn: blobPropertiesInXML["LastAccessTime"] === undefined
? undefined
: new Date(blobPropertiesInXML["LastAccessTime"]),
immutabilityPolicyExpiresOn: blobPropertiesInXML["ImmutabilityPolicyUntilDate"] === undefined
? undefined
: new Date(blobPropertiesInXML["ImmutabilityPolicyUntilDate"]),
immutabilityPolicyMode: blobPropertiesInXML["ImmutabilityPolicyMode"],
legalHold: ParseBoolean(blobPropertiesInXML["LegalHold"]),
};
return {
name: ParseBlobName(blobInXML["Name"]),
deleted: ParseBoolean(blobInXML["Deleted"]),
snapshot: blobInXML["Snapshot"],
versionId: blobInXML["VersionId"],
isCurrentVersion: ParseBoolean(blobInXML["IsCurrentVersion"]),
properties: blobProperties,
metadata: blobInXML["Metadata"],
blobTags: ParseBlobTags(blobInXML["Tags"]),
objectReplicationMetadata: blobInXML["OrMetadata"],
hasVersionsOnly: ParseBoolean(blobInXML["HasVersionsOnly"]),
};
}
function ParseBlobPrefix(blobPrefixInXML) {
return {
name: ParseBlobName(blobPrefixInXML["Name"]),
};
}
function ParseBlobTag(blobTagInXML) {
return {
key: blobTagInXML["Key"],
value: blobTagInXML["Value"],
};
}
function ParseBlobTags(blobTagsInXML) {
if (blobTagsInXML === undefined ||
blobTagsInXML["TagSet"] === undefined ||
blobTagsInXML["TagSet"]["Tag"] === undefined) {
return undefined;
}
const blobTagSet = [];
if (blobTagsInXML["TagSet"]["Tag"] instanceof Array) {
blobTagsInXML["TagSet"]["Tag"].forEach((blobTagInXML) => {
blobTagSet.push(ParseBlobTag(blobTagInXML));
});
}
else {
blobTagSet.push(ParseBlobTag(blobTagsInXML["TagSet"]["Tag"]));
}
return { blobTagSet: blobTagSet };
}
function ProcessBlobItems(blobArrayInXML) {
const blobItems = [];
if (blobArrayInXML instanceof Array) {
blobArrayInXML.forEach((blobInXML) => {
blobItems.push(ParseBlobItem(blobInXML));
});
}
else {
blobItems.push(ParseBlobItem(blobArrayInXML));
}
return blobItems;
}
function ProcessBlobPrefixes(blobPrefixesInXML) {
const blobPrefixes = [];
if (blobPrefixesInXML instanceof Array) {
blobPrefixesInXML.forEach((blobPrefixInXML) => {
blobPrefixes.push(ParseBlobPrefix(blobPrefixInXML));
});
}
else {
blobPrefixes.push(ParseBlobPrefix(blobPrefixesInXML));
}
return blobPrefixes;
}
// Copyright (c) Microsoft Corporation.
/**
@@ -23598,9 +23951,16 @@ class StorageBrowserPolicy extends coreHttp.BaseRequestPolicy {
* @param request -
*/
async sendRequest(request) {
{
if (coreHttp.isNode) {
return this._nextPolicy.sendRequest(request);
}
if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") {
request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, new Date().getTime().toString());
}
request.headers.remove(HeaderConstants.COOKIE);
// According to XHR standards, content-length should be fully controlled by browsers
request.headers.remove(HeaderConstants.CONTENT_LENGTH);
return this._nextPolicy.sendRequest(request);
}
}
@@ -23621,6 +23981,10 @@ class StorageBrowserPolicyFactory {
}
// Copyright (c) Microsoft Corporation.
/**
* RetryPolicy types.
*/
exports.StorageRetryPolicyType = void 0;
(function (StorageRetryPolicyType) {
/**
* Exponential retry. Retry time delay grows exponentially.
@@ -23638,7 +24002,7 @@ const DEFAULT_RETRY_OPTIONS = {
retryDelayInMs: 4 * 1000,
retryPolicyType: exports.StorageRetryPolicyType.EXPONENTIAL,
secondaryHost: "",
tryTimeoutInMs: undefined // Use server side default timeout strategy
tryTimeoutInMs: undefined, // Use server side default timeout strategy
};
const RETRY_ABORT_ERROR = new abortController.AbortError("The operation was aborted.");
/**
@@ -23675,7 +24039,7 @@ class StorageRetryPolicy extends coreHttp.BaseRequestPolicy {
: DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs,
secondaryHost: retryOptions.secondaryHost
? retryOptions.secondaryHost
: DEFAULT_RETRY_OPTIONS.secondaryHost
: DEFAULT_RETRY_OPTIONS.secondaryHost,
};
}
/**
@@ -23752,7 +24116,7 @@ class StorageRetryPolicy extends coreHttp.BaseRequestPolicy {
"ENOTFOUND",
"TIMEOUT",
"EPIPE",
"REQUEST_SEND_ERROR" // For default xhr based http client provided in ms-rest-js
"REQUEST_SEND_ERROR", // For default xhr based http client provided in ms-rest-js
];
if (err) {
for (const retriableError of retriableErrors) {
@@ -23938,7 +24302,7 @@ class TelemetryPolicy extends coreHttp.BaseRequestPolicy {
* @param request -
*/
async sendRequest(request) {
{
if (coreHttp.isNode) {
if (!request.headers) {
request.headers = new coreHttp.HttpHeaders();
}
@@ -23961,7 +24325,7 @@ class TelemetryPolicyFactory {
*/
constructor(telemetry) {
const userAgentInfo = [];
{
if (coreHttp.isNode) {
if (telemetry) {
const telemetryString = telemetry.userAgentPrefix || "";
if (telemetryString.length > 0 && userAgentInfo.indexOf(telemetryString) === -1) {
@@ -23974,7 +24338,7 @@ class TelemetryPolicyFactory {
userAgentInfo.push(libInfo);
}
// e.g. (NODE-VERSION 4.9.1; Windows_NT 10.0.16299)
const runtimeInfo = `(NODE-VERSION ${process.version}; ${os.type()} ${os.release()})`;
const runtimeInfo = `(NODE-VERSION ${process.version}; ${os__namespace.type()} ${os__namespace.release()})`;
if (userAgentInfo.indexOf(runtimeInfo) === -1) {
userAgentInfo.push(runtimeInfo);
}
@@ -23998,6 +24362,247 @@ function getCachedDefaultHttpClient() {
return _defaultHttpClient;
}
// Copyright (c) Microsoft Corporation.
/**
* A set of constants used internally when processing requests.
*/
const Constants = {
DefaultScope: "/.default",
/**
* Defines constants for use with HTTP headers.
*/
HeaderConstants: {
/**
* The Authorization header.
*/
AUTHORIZATION: "authorization",
},
};
// Default options for the cycler if none are provided
const DEFAULT_CYCLER_OPTIONS = {
forcedRefreshWindowInMs: 1000,
retryIntervalInMs: 3000,
refreshWindowInMs: 1000 * 60 * 2, // Start refreshing 2m before expiry
};
/**
* Converts an an unreliable access token getter (which may resolve with null)
* into an AccessTokenGetter by retrying the unreliable getter in a regular
* interval.
*
* @param getAccessToken - a function that produces a promise of an access
* token that may fail by returning null
* @param retryIntervalInMs - the time (in milliseconds) to wait between retry
* attempts
* @param timeoutInMs - the timestamp after which the refresh attempt will fail,
* throwing an exception
* @returns - a promise that, if it resolves, will resolve with an access token
*/
async function beginRefresh(getAccessToken, retryIntervalInMs, timeoutInMs) {
// This wrapper handles exceptions gracefully as long as we haven't exceeded
// the timeout.
async function tryGetAccessToken() {
if (Date.now() < timeoutInMs) {
try {
return await getAccessToken();
}
catch (_a) {
return null;
}
}
else {
const finalToken = await getAccessToken();
// Timeout is up, so throw if it's still null
if (finalToken === null) {
throw new Error("Failed to refresh access token.");
}
return finalToken;
}
}
let token = await tryGetAccessToken();
while (token === null) {
await coreHttp.delay(retryIntervalInMs);
token = await tryGetAccessToken();
}
return token;
}
/**
* Creates a token cycler from a credential, scopes, and optional settings.
*
* A token cycler represents a way to reliably retrieve a valid access token
* from a TokenCredential. It will handle initializing the token, refreshing it
* when it nears expiration, and synchronizes refresh attempts to avoid
* concurrency hazards.
*
* @param credential - the underlying TokenCredential that provides the access
* token
* @param scopes - the scopes to request authorization for
* @param tokenCyclerOptions - optionally override default settings for the cycler
*
* @returns - a function that reliably produces a valid access token
*/
function createTokenCycler(credential, scopes, tokenCyclerOptions) {
let refreshWorker = null;
let token = null;
const options = Object.assign(Object.assign({}, DEFAULT_CYCLER_OPTIONS), tokenCyclerOptions);
/**
* This little holder defines several predicates that we use to construct
* the rules of refreshing the token.
*/
const cycler = {
/**
* Produces true if a refresh job is currently in progress.
*/
get isRefreshing() {
return refreshWorker !== null;
},
/**
* Produces true if the cycler SHOULD refresh (we are within the refresh
* window and not already refreshing)
*/
get shouldRefresh() {
var _a;
return (!cycler.isRefreshing &&
((_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 0) - options.refreshWindowInMs < Date.now());
},
/**
* Produces true if the cycler MUST refresh (null or nearly-expired
* token).
*/
get mustRefresh() {
return (token === null || token.expiresOnTimestamp - options.forcedRefreshWindowInMs < Date.now());
},
};
/**
* Starts a refresh job or returns the existing job if one is already
* running.
*/
function refresh(getTokenOptions) {
var _a;
if (!cycler.isRefreshing) {
// We bind `scopes` here to avoid passing it around a lot
const tryGetAccessToken = () => credential.getToken(scopes, getTokenOptions);
// Take advantage of promise chaining to insert an assignment to `token`
// before the refresh can be considered done.
refreshWorker = beginRefresh(tryGetAccessToken, options.retryIntervalInMs,
// If we don't have a token, then we should timeout immediately
(_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : Date.now())
.then((_token) => {
refreshWorker = null;
token = _token;
return token;
})
.catch((reason) => {
// We also should reset the refresher if we enter a failed state. All
// existing awaiters will throw, but subsequent requests will start a
// new retry chain.
refreshWorker = null;
token = null;
throw reason;
});
}
return refreshWorker;
}
return async (tokenOptions) => {
//
// Simple rules:
// - If we MUST refresh, then return the refresh task, blocking
// the pipeline until a token is available.
// - If we SHOULD refresh, then run refresh but don't return it
// (we can still use the cached token).
// - Return the token, since it's fine if we didn't return in
// step 1.
//
if (cycler.mustRefresh)
return refresh(tokenOptions);
if (cycler.shouldRefresh) {
refresh(tokenOptions);
}
return token;
};
}
/**
* We will retrieve the challenge only if the response status code was 401,
* and if the response contained the header "WWW-Authenticate" with a non-empty value.
*/
function getChallenge(response) {
const challenge = response.headers.get("WWW-Authenticate");
if (response.status === 401 && challenge) {
return challenge;
}
return;
}
/**
* Converts: `Bearer a="b" c="d"`.
* Into: `[ { a: 'b', c: 'd' }]`.
*
* @internal
*/
function parseChallenge(challenge) {
const bearerChallenge = challenge.slice("Bearer ".length);
const challengeParts = `${bearerChallenge.trim()} `.split(" ").filter((x) => x);
const keyValuePairs = challengeParts.map((keyValue) => (([key, value]) => ({ [key]: value }))(keyValue.trim().split("=")));
// Key-value pairs to plain object:
return keyValuePairs.reduce((a, b) => (Object.assign(Object.assign({}, a), b)), {});
}
// #endregion
/**
* Creates a new factory for a RequestPolicy that applies a bearer token to
* the requests' `Authorization` headers.
*
* @param credential - The TokenCredential implementation that can supply the bearer token.
* @param scopes - The scopes for which the bearer token applies.
*/
function storageBearerTokenChallengeAuthenticationPolicy(credential, scopes) {
// This simple function encapsulates the entire process of reliably retrieving the token
let getToken = createTokenCycler(credential, scopes);
class StorageBearerTokenChallengeAuthenticationPolicy extends coreHttp.BaseRequestPolicy {
constructor(nextPolicy, options) {
super(nextPolicy, options);
}
async sendRequest(webResource) {
if (!webResource.url.toLowerCase().startsWith("https://")) {
throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.");
}
const getTokenInternal = getToken;
const token = (await getTokenInternal({
abortSignal: webResource.abortSignal,
tracingOptions: {
tracingContext: webResource.tracingContext,
},
})).token;
webResource.headers.set(Constants.HeaderConstants.AUTHORIZATION, `Bearer ${token}`);
const response = await this._nextPolicy.sendRequest(webResource);
if ((response === null || response === void 0 ? void 0 : response.status) === 401) {
const challenge = getChallenge(response);
if (challenge) {
const challengeInfo = parseChallenge(challenge);
const challengeScopes = challengeInfo.resource_id + Constants.DefaultScope;
const parsedAuthUri = coreHttp.URLBuilder.parse(challengeInfo.authorization_uri);
const pathSegments = parsedAuthUri.getPath().split("/");
const tenantId = pathSegments[1];
const getTokenForChallenge = createTokenCycler(credential, challengeScopes);
const tokenForChallenge = (await getTokenForChallenge({
abortSignal: webResource.abortSignal,
tracingOptions: {
tracingContext: webResource.tracingContext,
},
tenantId: tenantId,
})).token;
getToken = getTokenForChallenge;
webResource.headers.set(Constants.HeaderConstants.AUTHORIZATION, `Bearer ${tokenForChallenge}`);
return this._nextPolicy.sendRequest(webResource);
}
}
return response;
}
}
return {
create: (nextPolicy, options) => {
return new StorageBearerTokenChallengeAuthenticationPolicy(nextPolicy, options);
},
};
}
// Copyright (c) Microsoft Corporation.
/**
* A helper to decide if a given argument satisfies the Pipeline contract
@@ -24043,7 +24648,7 @@ class Pipeline {
toServiceClientOptions() {
return {
httpClient: this.options.httpClient,
requestPolicyFactories: this.factories
requestPolicyFactories: this.factories,
};
}
}
@@ -24055,6 +24660,7 @@ class Pipeline {
* @returns A new Pipeline object.
*/
function newPipeline(credential, pipelineOptions = {}) {
var _a;
if (credential === undefined) {
credential = new AnonymousCredential();
}
@@ -24076,16 +24682,16 @@ function newPipeline(credential, pipelineOptions = {}) {
coreHttp.logPolicy({
logger: logger.info,
allowedHeaderNames: StorageBlobLoggingAllowedHeaderNames,
allowedQueryParameters: StorageBlobLoggingAllowedQueryParameters
})
allowedQueryParameters: StorageBlobLoggingAllowedQueryParameters,
}),
];
{
if (coreHttp.isNode) {
// policies only available in Node.js runtime, not in browsers
factories.push(coreHttp.proxyPolicy(pipelineOptions.proxyOptions));
factories.push(coreHttp.disableResponseDecompressionPolicy());
}
factories.push(coreHttp.isTokenCredential(credential)
? attachCredential(coreHttp.bearerTokenAuthenticationPolicy(credential, StorageOAuthScopes), credential)
? attachCredential(storageBearerTokenChallengeAuthenticationPolicy(credential, (_a = pipelineOptions.audience) !== null && _a !== void 0 ? _a : StorageOAuthScopes), credential)
: credential);
return new Pipeline(factories, pipelineOptions);
}
@@ -24112,7 +24718,9 @@ class StorageSharedKeyCredentialPolicy extends CredentialPolicy {
*/
signRequest(request) {
request.headers.set(HeaderConstants.X_MS_DATE, new Date().toUTCString());
if (request.body && typeof request.body === "string" && request.body.length > 0) {
if (request.body &&
(typeof request.body === "string" || request.body !== undefined) &&
request.body.length > 0) {
request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body));
}
const stringToSign = [
@@ -24127,7 +24735,7 @@ class StorageSharedKeyCredentialPolicy extends CredentialPolicy {
this.getHeaderValueToSign(request, HeaderConstants.IF_MATCH),
this.getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH),
this.getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE),
this.getHeaderValueToSign(request, HeaderConstants.RANGE)
this.getHeaderValueToSign(request, HeaderConstants.RANGE),
].join("\n") +
"\n" +
this.getCanonicalizedHeadersString(request) +
@@ -24256,9 +24864,7 @@ class StorageSharedKeyCredential extends Credential {
* @param stringToSign -
*/
computeHMACSHA256(stringToSign) {
return crypto.createHmac("sha256", this.accountKey)
.update(stringToSign, "utf8")
.digest("base64");
return crypto.createHmac("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64");
}
}
@@ -24270,8 +24876,8 @@ class StorageSharedKeyCredential extends Credential {
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
const packageName = "azure-storage-blob";
const packageVersion = "12.8.0";
class StorageClientContext extends coreHttp.ServiceClient {
const packageVersion = "12.9.0";
class StorageClientContext extends coreHttp__namespace.ServiceClient {
/**
* Initializes a new instance of the StorageClientContext class.
* @param url The URL of the service account, container, or blob that is the target of the desired
@@ -24287,7 +24893,7 @@ class StorageClientContext extends coreHttp.ServiceClient {
options = {};
}
if (!options.userAgent) {
const defaultUserAgent = coreHttp.getDefaultUserAgentValue();
const defaultUserAgent = coreHttp__namespace.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}
super(undefined, options);
@@ -24296,7 +24902,7 @@ class StorageClientContext extends coreHttp.ServiceClient {
// Parameter assignments
this.url = url;
// Assigning values to Constant parameters
this.version = options.version || "2020-10-02";
this.version = options.version || "2021-04-10";
}
}
@@ -24343,7 +24949,7 @@ class StorageClient {
*/
const createSpan = coreTracing.createSpanFunction({
packagePrefix: "Azure.Storage.Blob",
namespace: "Microsoft.Storage"
namespace: "Microsoft.Storage",
});
/**
* @internal
@@ -24357,7 +24963,7 @@ function convertTracingToRequestOptionsBase(options) {
return {
// By passing spanOptions if they exist at runtime, we're backwards compatible with @azure/core-tracing@preview.13 and earlier.
spanOptions: (_a = options === null || options === void 0 ? void 0 : options.tracingOptions) === null || _a === void 0 ? void 0 : _a.spanOptions,
tracingContext: (_b = options === null || options === void 0 ? void 0 : options.tracingOptions) === null || _b === void 0 ? void 0 : _b.tracingContext
tracingContext: (_b = options === null || options === void 0 ? void 0 : options.tracingOptions) === null || _b === void 0 ? void 0 : _b.tracingContext,
};
}
@@ -24414,6 +25020,10 @@ class BlobSASPermissions {
* Specifies SetImmutabilityPolicy access granted.
*/
this.setImmutabilityPolicy = false;
/**
* Specifies that Permanent Delete is permitted.
*/
this.permanentDelete = false;
}
/**
* Creates a {@link BlobSASPermissions} from the specified permissions string. This method will throw an
@@ -24455,6 +25065,9 @@ class BlobSASPermissions {
case "i":
blobSASPermissions.setImmutabilityPolicy = true;
break;
case "y":
blobSASPermissions.permanentDelete = true;
break;
default:
throw new RangeError(`Invalid permission: ${char}`);
}
@@ -24499,6 +25112,9 @@ class BlobSASPermissions {
if (permissionLike.setImmutabilityPolicy) {
blobSASPermissions.setImmutabilityPolicy = true;
}
if (permissionLike.permanentDelete) {
blobSASPermissions.permanentDelete = true;
}
return blobSASPermissions;
}
/**
@@ -24539,6 +25155,9 @@ class BlobSASPermissions {
if (this.setImmutabilityPolicy) {
permissions.push("i");
}
if (this.permanentDelete) {
permissions.push("y");
}
return permissions.join("");
}
}
@@ -24598,6 +25217,14 @@ class ContainerSASPermissions {
* Specifies SetImmutabilityPolicy access granted.
*/
this.setImmutabilityPolicy = false;
/**
* Specifies that Permanent Delete is permitted.
*/
this.permanentDelete = false;
/**
* Specifies that Filter Blobs by Tags is permitted.
*/
this.filterByTags = false;
}
/**
* Creates an {@link ContainerSASPermissions} from the specified permissions string. This method will throw an
@@ -24642,6 +25269,12 @@ class ContainerSASPermissions {
case "i":
containerSASPermissions.setImmutabilityPolicy = true;
break;
case "y":
containerSASPermissions.permanentDelete = true;
break;
case "f":
containerSASPermissions.filterByTags = true;
break;
default:
throw new RangeError(`Invalid permission ${char}`);
}
@@ -24689,6 +25322,12 @@ class ContainerSASPermissions {
if (permissionLike.setImmutabilityPolicy) {
containerSASPermissions.setImmutabilityPolicy = true;
}
if (permissionLike.permanentDelete) {
containerSASPermissions.permanentDelete = true;
}
if (permissionLike.filterByTags) {
containerSASPermissions.filterByTags = true;
}
return containerSASPermissions;
}
/**
@@ -24734,6 +25373,12 @@ class ContainerSASPermissions {
if (this.setImmutabilityPolicy) {
permissions.push("i");
}
if (this.permanentDelete) {
permissions.push("y");
}
if (this.filterByTags) {
permissions.push("f");
}
return permissions.join("");
}
}
@@ -24763,9 +25408,7 @@ class UserDelegationKeyCredential {
*/
computeHMACSHA256(stringToSign) {
// console.log(`stringToSign: ${JSON.stringify(stringToSign)}`);
return crypto.createHmac("sha256", this.key)
.update(stringToSign, "utf8")
.digest("base64");
return crypto.createHmac("sha256", this.key).update(stringToSign, "utf8").digest("base64");
}
}
@@ -24783,6 +25426,10 @@ function ipRangeToString(ipRange) {
}
// Copyright (c) Microsoft Corporation.
/**
* Protocols for generated SAS.
*/
exports.SASProtocol = void 0;
(function (SASProtocol) {
/**
* Protocol that allows HTTPS only
@@ -24803,7 +25450,7 @@ function ipRangeToString(ipRange) {
* NOTE: Instances of this class are immutable.
*/
class SASQueryParameters {
constructor(version, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, userDelegationKey, preauthorizedAgentObjectId, correlationId) {
constructor(version, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope) {
this.version = version;
this.signature = signature;
if (permissionsOrOptions !== undefined && typeof permissionsOrOptions !== "string") {
@@ -24816,6 +25463,7 @@ class SASQueryParameters {
this.expiresOn = permissionsOrOptions.expiresOn;
this.ipRangeInner = permissionsOrOptions.ipRange;
this.identifier = permissionsOrOptions.identifier;
this.encryptionScope = permissionsOrOptions.encryptionScope;
this.resource = permissionsOrOptions.resource;
this.cacheControl = permissionsOrOptions.cacheControl;
this.contentDisposition = permissionsOrOptions.contentDisposition;
@@ -24841,6 +25489,7 @@ class SASQueryParameters {
this.protocol = protocol;
this.startsOn = startsOn;
this.ipRangeInner = ipRange;
this.encryptionScope = encryptionScope;
this.identifier = identifier;
this.resource = resource;
this.cacheControl = cacheControl;
@@ -24869,7 +25518,7 @@ class SASQueryParameters {
if (this.ipRangeInner) {
return {
end: this.ipRangeInner.end,
start: this.ipRangeInner.start
start: this.ipRangeInner.start,
};
}
return undefined;
@@ -24888,6 +25537,7 @@ class SASQueryParameters {
"se",
"sip",
"si",
"ses",
"skoid",
"sktid",
"skt",
@@ -24903,7 +25553,7 @@ class SASQueryParameters {
"rscl",
"rsct",
"saoid",
"scid"
"scid",
];
const queries = [];
for (const param of params) {
@@ -24932,6 +25582,9 @@ class SASQueryParameters {
case "si":
this.tryAppendQueryParameter(queries, param, this.identifier);
break;
case "ses":
this.tryAppendQueryParameter(queries, param, this.encryptionScope);
break;
case "skoid": // Signed object ID
this.tryAppendQueryParameter(queries, param, this.signedOid);
break;
@@ -25016,6 +25669,15 @@ function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredent
if (sharedKeyCredential === undefined && userDelegationKeyCredential === undefined) {
throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName.");
}
// Version 2020-12-06 adds support for encryptionscope in SAS.
if (version >= "2020-12-06") {
if (sharedKeyCredential !== undefined) {
return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential);
}
else {
return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential);
}
}
// Version 2019-12-12 adds support for the blob tags permission.
// Version 2018-11-09 adds support for the signed resource and signed blob snapshot time fields.
// https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas#constructing-the-signature-string
@@ -25097,7 +25759,7 @@ function generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKe
blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "",
blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "",
blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "",
blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : ""
blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : "",
].join("\n");
const 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);
@@ -25166,11 +25828,81 @@ function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKe
blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "",
blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "",
blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "",
blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : ""
blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : "",
].join("\n");
const 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);
}
/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
* IMPLEMENTATION FOR API VERSION FROM 2020-12-06.
*
* 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 and identifier.
*
* WARNING: When identifier is not provided, permissions and expiresOn are required.
* You MUST assign value to identifier or expiresOn & permissions manually if you initial with
* this constructor.
*
* @param blobSASSignatureValues -
* @param sharedKeyCredential -
*/
function generateBlobSASQueryParameters20201206(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.");
}
let resource = "c";
let 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.
let 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.
const stringToSign = [
verifiedPermissions ? verifiedPermissions : "",
blobSASSignatureValues.startsOn
? truncatedISO8061Date(blobSASSignatureValues.startsOn, false)
: "",
blobSASSignatureValues.expiresOn
? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)
: "",
getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),
blobSASSignatureValues.identifier,
blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "",
blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "",
blobSASSignatureValues.version,
resource,
timestamp,
blobSASSignatureValues.encryptionScope,
blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : "",
blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : "",
blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : "",
blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : "",
blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : "",
].join("\n");
const 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, undefined, undefined, undefined, blobSASSignatureValues.encryptionScope);
}
/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
* IMPLEMENTATION FOR API VERSION FROM 2018-11-09.
@@ -25242,7 +25974,7 @@ function generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userD
blobSASSignatureValues.contentDisposition,
blobSASSignatureValues.contentEncoding,
blobSASSignatureValues.contentLanguage,
blobSASSignatureValues.contentType
blobSASSignatureValues.contentType,
].join("\n");
const 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);
@@ -25321,11 +26053,91 @@ function generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userD
blobSASSignatureValues.contentDisposition,
blobSASSignatureValues.contentEncoding,
blobSASSignatureValues.contentLanguage,
blobSASSignatureValues.contentType
blobSASSignatureValues.contentType,
].join("\n");
const 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);
}
/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
* IMPLEMENTATION FOR API VERSION FROM 2020-12-06.
*
* 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 -
* @param userDelegationKeyCredential -
*/
function generateBlobSASQueryParametersUDK20201206(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.");
}
let resource = "c";
let 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.
let 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.
const 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.encryptionScope,
blobSASSignatureValues.cacheControl,
blobSASSignatureValues.contentDisposition,
blobSASSignatureValues.contentEncoding,
blobSASSignatureValues.contentLanguage,
blobSASSignatureValues.contentType,
].join("\n");
const 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, blobSASSignatureValues.encryptionScope);
}
function getCanonicalName(accountName, containerName, blobName) {
// Container: "/blob/account/containerName"
// Blob: "/blob/account/containerName/blobName"
@@ -25359,6 +26171,11 @@ function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) {
version < "2019-10-10") {
throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission.");
}
if (blobSASSignatureValues.permissions &&
blobSASSignatureValues.permissions.permanentDelete &&
version < "2019-10-10") {
throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission.");
}
if (blobSASSignatureValues.permissions &&
blobSASSignatureValues.permissions.tag &&
version < "2019-12-12") {
@@ -25369,10 +26186,18 @@ function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) {
(blobSASSignatureValues.permissions.move || blobSASSignatureValues.permissions.execute)) {
throw RangeError("'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission.");
}
if (version < "2021-04-10" &&
blobSASSignatureValues.permissions &&
blobSASSignatureValues.permissions.filterByTags) {
throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission.");
}
if (version < "2020-02-10" &&
(blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) {
throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'.");
}
if (blobSASSignatureValues.encryptionScope && version < "2020-12-06") {
throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS.");
}
blobSASSignatureValues.version = version;
return blobSASSignatureValues;
}
@@ -25446,7 +26271,7 @@ class BlobLeaseClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -25481,7 +26306,7 @@ class BlobLeaseClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -25514,7 +26339,7 @@ class BlobLeaseClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -25546,7 +26371,7 @@ class BlobLeaseClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -25581,7 +26406,7 @@ class BlobLeaseClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -25661,8 +26486,7 @@ class RetriableReadableStream extends stream.Readable {
});
}
else {
this.destroy(new Error(`Data corruption failure: received less data than required and reached maxRetires limitation. Received data offset: ${this
.offset - 1}, data needed offset: ${this.end}, retries: ${this.retries}, max retries: ${this.maxRetryRequests}`));
this.destroy(new Error(`Data corruption failure: received less data than required and reached maxRetires limitation. Received data offset: ${this.offset - 1}, data needed offset: ${this.end}, retries: ${this.retries}, max retries: ${this.maxRetryRequests}`));
}
}
else {
@@ -26507,7 +27331,7 @@ class AvroReader {
}
async initialize(options = {}) {
const header = await AvroParser.readFixedBytes(this._headerStream, AVRO_INIT_BYTES.length, {
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
});
if (!arraysEqual(header, AVRO_INIT_BYTES)) {
throw new Error("Stream is not an Avro file.");
@@ -26515,7 +27339,7 @@ class AvroReader {
// File metadata is written as if defined by the following map schema:
// { "type": "map", "values": "bytes"}
this._metadata = await AvroParser.readMap(this._headerStream, AvroParser.readString, {
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
});
// Validate codec
const codec = this._metadata[AVRO_CODEC_KEY];
@@ -26524,7 +27348,7 @@ class AvroReader {
}
// The 16-byte, randomly-generated sync marker for this file.
this._syncMarker = await AvroParser.readFixedBytes(this._headerStream, AVRO_SYNC_MARKER_SIZE, {
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
});
// Parse the schema
const schema = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]);
@@ -26533,7 +27357,7 @@ class AvroReader {
this._blockOffset = this._initialBlockOffset + this._dataStream.position;
}
this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, {
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
});
// skip block length
await AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal });
@@ -26555,13 +27379,13 @@ class AvroReader {
}
while (this.hasNext()) {
const result = yield tslib.__await(this._itemType.read(this._dataStream, {
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
}));
this._itemsRemainingInBlock--;
this._objectIndex++;
if (this._itemsRemainingInBlock == 0) {
const marker = yield tslib.__await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, {
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
}));
this._blockOffset = this._initialBlockOffset + this._dataStream.position;
this._objectIndex = 0;
@@ -26570,7 +27394,7 @@ class AvroReader {
}
try {
this._itemsRemainingInBlock = yield tslib.__await(AvroParser.readLong(this._dataStream, {
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
}));
}
catch (err) {
@@ -26769,7 +27593,7 @@ class BlobQuickQueryStream extends stream.Readable {
position,
name,
isFatal: fatal,
description
description,
});
}
break;
@@ -27145,6 +27969,11 @@ class BlobQueryResponse {
}
// Copyright (c) Microsoft Corporation.
/**
* Represents the access tier on a blob.
* For detailed information about block blob level tiering see {@link https://docs.microsoft.com/azure/storage/blobs/storage-blob-storage-tiers|Hot, cool and archive storage tiers.}
*/
exports.BlockBlobTier = void 0;
(function (BlockBlobTier) {
/**
* Optimized for storing data that is accessed frequently.
@@ -27160,6 +27989,12 @@ class BlobQueryResponse {
*/
BlockBlobTier["Archive"] = "Archive";
})(exports.BlockBlobTier || (exports.BlockBlobTier = {}));
/**
* Specifies the page blob tier to set the blob to. This is only applicable to page blobs on premium storage accounts.
* Please see {@link https://docs.microsoft.com/azure/storage/storage-premium-storage#scalability-and-performance-targets|here}
* for detailed information on the corresponding IOPS and throughput per PageBlobTier.
*/
exports.PremiumPageBlobTier = void 0;
(function (PremiumPageBlobTier) {
/**
* P4 Tier.
@@ -27220,6 +28055,20 @@ function ensureCpkIfSpecified(cpk, isHttps) {
cpk.encryptionAlgorithm = EncryptionAlgorithmAES25;
}
}
/**
* Defines the known cloud audiences for Storage.
*/
exports.StorageBlobAudience = void 0;
(function (StorageBlobAudience) {
/**
* The OAuth scope to use to retrieve an AAD token for Azure Storage.
*/
StorageBlobAudience["StorageOAuthScopes"] = "https://storage.azure.com/.default";
/**
* The OAuth scope to use to retrieve an AAD token for Azure Disk.
*/
StorageBlobAudience["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default";
})(exports.StorageBlobAudience || (exports.StorageBlobAudience = {}));
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
@@ -27232,16 +28081,16 @@ function ensureCpkIfSpecified(cpk, isHttps) {
function rangeResponseFromModel(response) {
const pageRange = (response._response.parsedBody.pageRange || []).map((x) => ({
offset: x.start,
count: x.end - x.start
count: x.end - x.start,
}));
const clearRange = (response._response.parsedBody.clearRange || []).map((x) => ({
offset: x.start,
count: x.end - x.start
count: x.end - x.start,
}));
return Object.assign(Object.assign({}, response), { pageRange,
clearRange, _response: Object.assign(Object.assign({}, response._response), { parsedBody: {
pageRange,
clearRange
clearRange,
} }) });
}
@@ -27254,7 +28103,7 @@ function rangeResponseFromModel(response) {
*/
class BlobBeginCopyFromUrlPoller extends coreLro.Poller {
constructor(options) {
const { blobClient, copySource, intervalInMs = 15000, onProgress, resumeFrom, startCopyFromURLOptions } = options;
const { blobClient, copySource, intervalInMs = 15000, onProgress, resumeFrom, startCopyFromURLOptions, } = options;
let state;
if (resumeFrom) {
state = JSON.parse(resumeFrom).state;
@@ -27290,7 +28139,7 @@ const cancel = async function cancel(options = {}) {
}
// if abortCopyFromURL throws, it will bubble up to user's poller.cancelOperation call
await state.blobClient.abortCopyFromURL(copyId, {
abortSignal: options.abortSignal
abortSignal: options.abortSignal,
});
state.isCancelled = true;
return makeBlobBeginCopyFromURLPollOperation(state);
@@ -27368,7 +28217,7 @@ function makeBlobBeginCopyFromURLPollOperation(state) {
state: Object.assign({}, state),
cancel,
toString,
update
update,
};
}
@@ -28010,7 +28859,7 @@ async function streamToBuffer2(stream, buffer, encoding) {
*/
async function readStreamToLocalFile(rs, file) {
return new Promise((resolve, reject) => {
const ws = fs.createWriteStream(file);
const ws = fs__namespace.createWriteStream(file);
rs.on("error", (err) => {
reject(err);
});
@@ -28026,8 +28875,8 @@ async function readStreamToLocalFile(rs, file) {
*
* Promisified version of fs.stat().
*/
const fsStat = util.promisify(fs.stat);
const fsCreateReadStream = fs.createReadStream;
const fsStat = util__namespace.promisify(fs__namespace.stat);
const fsCreateReadStream = fs__namespace.createReadStream;
/**
* A BlobClient represents a URL to an Azure Storage blob; the blob may be a block blob,
@@ -28070,12 +28919,17 @@ class BlobClient extends StorageClient {
const blobName = blobNameOrOptions;
const extractedCreds = extractConnectionStringParts(urlOrConnectionString);
if (extractedCreds.kind === "AccountConnString") {
{
if (coreHttp.isNode) {
const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
url = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
if (!options.proxyOptions) {
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
}
pipeline = newPipeline(sharedKeyCredential, options);
}
else {
throw new Error("Account connection string is only supported in Node.js environment");
}
}
else if (extractedCreds.kind === "SASConnString") {
url =
@@ -28092,10 +28946,8 @@ class BlobClient extends StorageClient {
throw new Error("Expecting non-empty strings for containerName and blobName parameters");
}
super(url, pipeline);
({
blobName: this._name,
containerName: this._containerName
} = this.getBlobAndContainerNamesFromUrl());
({ blobName: this._name, containerName: this._containerName } =
this.getBlobAndContainerNamesFromUrl());
this.blobContext = new Blob$1(this.storageClientContext);
this._snapshot = getURLParameter(this.url, URLConstants.Parameters.SNAPSHOT);
this._versionId = getURLParameter(this.url, URLConstants.Parameters.VERSIONID);
@@ -28220,11 +29072,13 @@ class BlobClient extends StorageClient {
const { span, updatedOptions } = createSpan("BlobClient-download", options);
try {
const res = await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: {
onDownloadProgress: coreHttp.isNode ? undefined : options.onProgress // for Node.js, progress is reported by RetriableReadableStream
onDownloadProgress: coreHttp.isNode ? undefined : options.onProgress, // for Node.js, progress is reported by RetriableReadableStream
}, range: offset === 0 && !count ? undefined : rangeToString({ offset, count }), rangeGetContentMD5: options.rangeGetContentMD5, rangeGetContentCRC64: options.rangeGetContentCrc64, snapshot: options.snapshot, cpkInfo: options.customerProvidedKey }, convertTracingToRequestOptionsBase(updatedOptions)));
const wrappedRes = Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) });
// Return browser response immediately
if (false) {}
if (!coreHttp.isNode) {
return wrappedRes;
}
// We support retrying when download stream unexpected ends in Node.js runtime
// Following code shouldn't be bundled into browser build, however some
// bundlers may try to bundle following code and "FileReadResponse.ts".
@@ -28249,16 +29103,16 @@ class BlobClient extends StorageClient {
ifModifiedSince: options.conditions.ifModifiedSince,
ifNoneMatch: options.conditions.ifNoneMatch,
ifUnmodifiedSince: options.conditions.ifUnmodifiedSince,
ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions
ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions,
},
range: rangeToString({
count: offset + res.contentLength - start,
offset: start
offset: start,
}),
rangeGetContentMD5: options.rangeGetContentMD5,
rangeGetContentCRC64: options.rangeGetContentCrc64,
snapshot: options.snapshot,
cpkInfo: options.customerProvidedKey
cpkInfo: options.customerProvidedKey,
};
// Debug purpose only
// console.log(
@@ -28269,13 +29123,13 @@ class BlobClient extends StorageClient {
return (await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal }, updatedDownloadOptions))).readableStreamBody;
}, offset, res.contentLength, {
maxRetryRequests: options.maxRetryRequests,
onProgress: options.onProgress
onProgress: options.onProgress,
});
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28300,21 +29154,23 @@ class BlobClient extends StorageClient {
abortSignal: options.abortSignal,
customerProvidedKey: options.customerProvidedKey,
conditions: options.conditions,
tracingOptions: updatedOptions.tracingOptions
tracingOptions: updatedOptions.tracingOptions,
});
return true;
}
catch (e) {
if (e.statusCode === 404) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: "Expected exception when checking blob existence"
});
// Expected exception when checking blob existence
return false;
}
else if (e.statusCode === 409 &&
e.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg) {
// Expected exception when checking blob existence
return true;
}
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28346,7 +29202,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28373,7 +29229,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28395,20 +29251,19 @@ class BlobClient extends StorageClient {
const { span, updatedOptions } = createSpan("BlobClient-deleteIfExists", options);
try {
const res = await this.delete(updatedOptions);
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable
});
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });
}
catch (e) {
if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobNotFound") {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: "Expected exception when deleting a blob or snapshot only if it exists."
message: "Expected exception when deleting a blob or snapshot only if it exists.",
});
return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
}
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28432,7 +29287,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28466,7 +29321,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28496,7 +29351,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28522,7 +29377,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28546,7 +29401,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28580,7 +29435,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28664,7 +29519,7 @@ class BlobClient extends StorageClient {
const client = {
abortCopyFromURL: (...args) => this.abortCopyFromURL(...args),
getProperties: (...args) => this.getProperties(...args),
startCopyFromURL: (...args) => this.startCopyFromURL(...args)
startCopyFromURL: (...args) => this.startCopyFromURL(...args),
};
const poller = new BlobBeginCopyFromUrlPoller({
blobClient: client,
@@ -28672,7 +29527,7 @@ class BlobClient extends StorageClient {
intervalInMs: options.intervalInMs,
onProgress: options.onProgress,
resumeFrom: options.resumeFrom,
startCopyFromURLOptions: options
startCopyFromURLOptions: options,
});
// Trigger the startCopyFromURL call by calling poll.
// Any errors from this method should be surfaced to the user.
@@ -28695,7 +29550,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28721,13 +29576,13 @@ class BlobClient extends StorageClient {
sourceIfMatch: options.sourceConditions.ifMatch,
sourceIfModifiedSince: options.sourceConditions.ifModifiedSince,
sourceIfNoneMatch: options.sourceConditions.ifNoneMatch,
sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince
}, sourceContentMD5: options.sourceContentMD5, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), blobTagsString: toBlobTagsString(options.tags), immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold }, convertTracingToRequestOptionsBase(updatedOptions)));
sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince,
}, sourceContentMD5: options.sourceContentMD5, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), blobTagsString: toBlobTagsString(options.tags), immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)));
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28755,7 +29610,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28832,7 +29687,7 @@ class BlobClient extends StorageClient {
conditions: options.conditions,
maxRetryRequests: options.maxRetryRequestsPerBlock,
customerProvidedKey: options.customerProvidedKey,
tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions))
tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)),
});
const stream = response.readableStreamBody;
await streamToBuffer(stream, buffer, off - offset, chunkEnd - offset);
@@ -28851,7 +29706,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28889,7 +29744,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -28970,13 +29825,13 @@ class BlobClient extends StorageClient {
sourceIfModifiedSince: options.sourceConditions.ifModifiedSince,
sourceIfNoneMatch: options.sourceConditions.ifNoneMatch,
sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince,
sourceIfTags: options.sourceConditions.tagConditions
sourceIfTags: options.sourceConditions.tagConditions,
}, immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold, rehydratePriority: options.rehydratePriority, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), sealBlob: options.sealBlob }, convertTracingToRequestOptionsBase(updatedOptions)));
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29017,7 +29872,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29038,7 +29893,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29059,7 +29914,7 @@ class BlobClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29110,12 +29965,17 @@ class AppendBlobClient extends BlobClient {
const blobName = blobNameOrOptions;
const extractedCreds = extractConnectionStringParts(urlOrConnectionString);
if (extractedCreds.kind === "AccountConnString") {
{
if (coreHttp.isNode) {
const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
url = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
if (!options.proxyOptions) {
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
}
pipeline = newPipeline(sharedKeyCredential, options);
}
else {
throw new Error("Account connection string is only supported in Node.js environment");
}
}
else if (extractedCreds.kind === "SASConnString") {
url =
@@ -29170,7 +30030,7 @@ class AppendBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29191,20 +30051,19 @@ class AppendBlobClient extends BlobClient {
const conditions = { ifNoneMatch: ETagAny };
try {
const res = await this.create(Object.assign(Object.assign({}, updatedOptions), { conditions }));
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable
});
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });
}
catch (e) {
if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: "Expected exception when creating a blob only if it does not already exist."
message: "Expected exception when creating a blob only if it does not already exist.",
});
return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
}
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29227,7 +30086,7 @@ class AppendBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29266,13 +30125,13 @@ class AppendBlobClient extends BlobClient {
try {
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
return await this.appendBlobContext.appendBlock(contentLength, body, Object.assign({ abortSignal: options.abortSignal, appendPositionAccessConditions: options.conditions, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: {
onUploadProgress: options.onProgress
onUploadProgress: options.onProgress,
}, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)));
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29305,13 +30164,13 @@ class AppendBlobClient extends BlobClient {
sourceIfMatch: options.sourceConditions.ifMatch,
sourceIfModifiedSince: options.sourceConditions.ifModifiedSince,
sourceIfNoneMatch: options.sourceConditions.ifNoneMatch,
sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince
sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince,
}, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)));
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29362,12 +30221,17 @@ class BlockBlobClient extends BlobClient {
const blobName = blobNameOrOptions;
const extractedCreds = extractConnectionStringParts(urlOrConnectionString);
if (extractedCreds.kind === "AccountConnString") {
{
if (coreHttp.isNode) {
const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
url = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
if (!options.proxyOptions) {
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
}
pipeline = newPipeline(sharedKeyCredential, options);
}
else {
throw new Error("Account connection string is only supported in Node.js environment");
}
}
else if (extractedCreds.kind === "SASConnString") {
url =
@@ -29433,23 +30297,25 @@ class BlockBlobClient extends BlobClient {
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
const { span, updatedOptions } = createSpan("BlockBlobClient-query", options);
try {
if (false) {}
if (!coreHttp.isNode) {
throw new Error("This operation currently is only supported in Node.js.");
}
const response = await this._blobContext.query(Object.assign({ abortSignal: options.abortSignal, queryRequest: {
queryType: "SQL",
expression: query,
inputSerialization: toQuerySerialization(options.inputTextConfiguration),
outputSerialization: toQuerySerialization(options.outputTextConfiguration)
outputSerialization: toQuerySerialization(options.outputTextConfiguration),
}, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)));
return new BlobQueryResponse(response, {
abortSignal: options.abortSignal,
onProgress: options.onProgress,
onError: options.onError
onError: options.onError,
});
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29491,13 +30357,13 @@ class BlockBlobClient extends BlobClient {
try {
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
return await this.blockBlobContext.upload(contentLength, body, Object.assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: {
onUploadProgress: options.onProgress
onUploadProgress: options.onProgress,
}, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, legalHold: options.legalHold, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions)));
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29534,13 +30400,13 @@ class BlockBlobClient extends BlobClient {
sourceIfModifiedSince: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifModifiedSince,
sourceIfNoneMatch: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch,
sourceIfUnmodifiedSince: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifUnmodifiedSince,
sourceIfTags: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.tagConditions
sourceIfTags: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.tagConditions,
}, cpkInfo: options.customerProvidedKey, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }), convertTracingToRequestOptionsBase(updatedOptions)));
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29564,13 +30430,13 @@ class BlockBlobClient extends BlobClient {
try {
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
return await this.blockBlobContext.stageBlock(blockId, contentLength, body, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, requestOptions: {
onUploadProgress: options.onProgress
onUploadProgress: options.onProgress,
}, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)));
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29608,7 +30474,7 @@ class BlockBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29639,7 +30505,7 @@ class BlockBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29673,7 +30539,7 @@ class BlockBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29700,7 +30566,7 @@ class BlockBlobClient extends BlobClient {
async uploadData(data, options = {}) {
const { span, updatedOptions } = createSpan("BlockBlobClient-uploadData", options);
try {
if (true) {
if (coreHttp.isNode) {
let buffer;
if (data instanceof Buffer) {
buffer = data;
@@ -29714,12 +30580,15 @@ class BlockBlobClient extends BlobClient {
}
return this.uploadSeekableInternal((offset, size) => buffer.slice(offset, offset + size), buffer.byteLength, updatedOptions);
}
else {}
else {
const browserBlob = new Blob([data]);
return this.uploadSeekableInternal((offset, size) => browserBlob.slice(offset, offset + size), browserBlob.size, updatedOptions);
}
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29755,7 +30624,7 @@ class BlockBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29768,7 +30637,7 @@ class BlockBlobClient extends BlobClient {
* 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.
*
* When data length is no more than the specifiled {@link BlockBlobParallelUploadOptions.maxSingleShotSize} (default is
* When data length is no more than the specified {@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.
@@ -29834,14 +30703,14 @@ class BlockBlobClient extends BlobClient {
abortSignal: options.abortSignal,
conditions: options.conditions,
encryptionScope: options.encryptionScope,
tracingOptions: updatedOptions.tracingOptions
tracingOptions: updatedOptions.tracingOptions,
});
// Update progress after block is successfully uploaded to server, in case of block trying
// TODO: Hook with convenience layer progress event in finer level
transferProgress += contentLength;
if (options.onProgress) {
options.onProgress({
loadedBytes: transferProgress
loadedBytes: transferProgress,
});
}
});
@@ -29852,7 +30721,7 @@ class BlockBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29881,14 +30750,14 @@ class BlockBlobClient extends BlobClient {
return () => fsCreateReadStream(filePath, {
autoClose: true,
end: count ? offset + count - 1 : Infinity,
start: offset
start: offset,
});
}, size, Object.assign(Object.assign({}, options), { tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)) }));
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -29932,7 +30801,7 @@ class BlockBlobClient extends BlobClient {
await this.stageBlock(blockID, body, length, {
conditions: options.conditions,
encryptionScope: options.encryptionScope,
tracingOptions: updatedOptions.tracingOptions
tracingOptions: updatedOptions.tracingOptions,
});
// Update progress after block is successfully uploaded to server, in case of block trying
transferProgress += length;
@@ -29951,7 +30820,7 @@ class BlockBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30002,12 +30871,17 @@ class PageBlobClient extends BlobClient {
const blobName = blobNameOrOptions;
const extractedCreds = extractConnectionStringParts(urlOrConnectionString);
if (extractedCreds.kind === "AccountConnString") {
{
if (coreHttp.isNode) {
const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
url = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
if (!options.proxyOptions) {
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
}
pipeline = newPipeline(sharedKeyCredential, options);
}
else {
throw new Error("Account connection string is only supported in Node.js environment");
}
}
else if (extractedCreds.kind === "SASConnString") {
url =
@@ -30057,7 +30931,7 @@ class PageBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30080,20 +30954,19 @@ class PageBlobClient extends BlobClient {
try {
const conditions = { ifNoneMatch: ETagAny };
const res = await this.create(size, Object.assign(Object.assign({}, options), { conditions, tracingOptions: updatedOptions.tracingOptions }));
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable
});
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });
}
catch (e) {
if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: "Expected exception when creating a blob only if it does not already exist."
message: "Expected exception when creating a blob only if it does not already exist.",
});
return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
}
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30118,13 +30991,13 @@ class PageBlobClient extends BlobClient {
try {
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
return await this.pageBlobContext.uploadPages(count, body, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: {
onUploadProgress: options.onProgress
onUploadProgress: options.onProgress,
}, range: rangeToString({ offset, count }), sequenceNumberAccessConditions: options.conditions, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)));
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30154,13 +31027,13 @@ class PageBlobClient extends BlobClient {
sourceIfMatch: options.sourceConditions.ifMatch,
sourceIfModifiedSince: options.sourceConditions.ifModifiedSince,
sourceIfNoneMatch: options.sourceConditions.ifNoneMatch,
sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince
sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince,
}, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization) }, convertTracingToRequestOptionsBase(updatedOptions)));
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30187,7 +31060,7 @@ class PageBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30216,7 +31089,7 @@ class PageBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30246,7 +31119,7 @@ class PageBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30276,7 +31149,7 @@ class PageBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30302,7 +31175,7 @@ class PageBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30329,7 +31202,7 @@ class PageBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30359,7 +31232,7 @@ class PageBlobClient extends BlobClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30507,7 +31380,7 @@ class BatchResponseParser {
return {
subResponses: deserializedSubResponses,
subResponsesSucceededCount: subResponsesSucceededCount,
subResponsesFailedCount: subResponsesFailedCount
subResponsesFailedCount: subResponsesFailedCount,
};
}
}
@@ -30654,7 +31527,7 @@ class BlobBatch {
this.setBatchType("delete");
await this.addSubRequestInternal({
url: url,
credential: credential
credential: credential,
}, async () => {
await new BlobClient(url, this.batchRequest.createPipeline(credential)).delete(updatedOptions);
});
@@ -30662,7 +31535,7 @@ class BlobBatch {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30701,7 +31574,7 @@ class BlobBatch {
this.setBatchType("setAccessTier");
await this.addSubRequestInternal({
url: url,
credential: credential
credential: credential,
}, async () => {
await new BlobClient(url, this.batchRequest.createPipeline(credential)).setAccessTier(tier, updatedOptions);
});
@@ -30709,7 +31582,7 @@ class BlobBatch {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -30766,7 +31639,7 @@ class InnerBatchRequest {
this.subRequestPrefix,
`${HeaderConstants.CONTENT_ID}: ${this.operationCount}`,
"",
`${request.method.toString()} ${getURLPathAndQuery(request.url)} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}` // sub request start line with method
`${request.method.toString()} ${getURLPathAndQuery(request.url)} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}`, // sub request start line with method
].join(HTTP_LINE_ENDING);
for (const header of request.headers.headersArray()) {
this.body += `${header.name}: ${header.value}${HTTP_LINE_ENDING}`;
@@ -30806,7 +31679,7 @@ class BatchRequestAssemblePolicy extends coreHttp.BaseRequestPolicy {
this.dummyResponse = {
request: new coreHttp.WebResource(),
status: 200,
headers: new coreHttp.HttpHeaders()
headers: new coreHttp.HttpHeaders(),
};
this.batchRequest = batchRequest;
}
@@ -30973,14 +31846,14 @@ class BlobBatchClient {
version: rawBatchResponse.version,
subResponses: responseSummary.subResponses,
subResponsesSucceededCount: responseSummary.subResponsesSucceededCount,
subResponsesFailedCount: responseSummary.subResponsesFailedCount
subResponsesFailedCount: responseSummary.subResponsesFailedCount,
};
return res;
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31026,12 +31899,17 @@ class ContainerClient extends StorageClient {
const containerName = credentialOrPipelineOrContainerName;
const extractedCreds = extractConnectionStringParts(urlOrConnectionString);
if (extractedCreds.kind === "AccountConnString") {
{
if (coreHttp.isNode) {
const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
url = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName));
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
if (!options.proxyOptions) {
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
}
pipeline = newPipeline(sharedKeyCredential, options);
}
else {
throw new Error("Account connection string is only supported in Node.js environment");
}
}
else if (extractedCreds.kind === "SASConnString") {
url =
@@ -31083,7 +31961,7 @@ class ContainerClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31103,20 +31981,19 @@ class ContainerClient extends StorageClient {
const { span, updatedOptions } = createSpan("ContainerClient-createIfNotExists", options);
try {
const res = await this.create(updatedOptions);
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable
});
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });
}
catch (e) {
if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: "Expected exception when creating a container only if it does not already exist."
message: "Expected exception when creating a container only if it does not already exist.",
});
return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
}
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31138,7 +32015,7 @@ class ContainerClient extends StorageClient {
try {
await this.getProperties({
abortSignal: options.abortSignal,
tracingOptions: updatedOptions.tracingOptions
tracingOptions: updatedOptions.tracingOptions,
});
return true;
}
@@ -31146,13 +32023,13 @@ class ContainerClient extends StorageClient {
if (e.statusCode === 404) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: "Expected exception when checking container existence"
message: "Expected exception when checking container existence",
});
return false;
}
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31226,7 +32103,7 @@ class ContainerClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31252,7 +32129,7 @@ class ContainerClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31272,20 +32149,19 @@ class ContainerClient extends StorageClient {
const { span, updatedOptions } = createSpan("ContainerClient-deleteIfExists", options);
try {
const res = await this.delete(updatedOptions);
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response // _response is made non-enumerable
});
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });
}
catch (e) {
if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: "Expected exception when deleting a container only if it exists."
message: "Expected exception when deleting a container only if it exists.",
});
return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
}
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31319,7 +32195,7 @@ class ContainerClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31355,13 +32231,13 @@ class ContainerClient extends StorageClient {
requestId: response.requestId,
clientRequestId: response.clientRequestId,
signedIdentifiers: [],
version: response.version
version: response.version,
};
for (const identifier of response) {
let accessPolicy = undefined;
if (identifier.accessPolicy) {
accessPolicy = {
permissions: identifier.accessPolicy.permissions
permissions: identifier.accessPolicy.permissions,
};
if (identifier.accessPolicy.expiresOn) {
accessPolicy.expiresOn = new Date(identifier.accessPolicy.expiresOn);
@@ -31372,7 +32248,7 @@ class ContainerClient extends StorageClient {
}
res.signedIdentifiers.push({
accessPolicy,
id: identifier.id
id: identifier.id,
});
}
return res;
@@ -31380,7 +32256,7 @@ class ContainerClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31419,9 +32295,9 @@ class ContainerClient extends StorageClient {
permissions: identifier.accessPolicy.permissions,
startsOn: identifier.accessPolicy.startsOn
? truncatedISO8061Date(identifier.accessPolicy.startsOn)
: ""
: "",
},
id: identifier.id
id: identifier.id,
});
}
return await this.containerContext.setAccessPolicy(Object.assign({ abortSignal: options.abortSignal, access, containerAcl: acl, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions)));
@@ -31429,7 +32305,7 @@ class ContainerClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31475,13 +32351,13 @@ class ContainerClient extends StorageClient {
const response = await blockBlobClient.upload(body, contentLength, updatedOptions);
return {
blockBlobClient,
response
response,
};
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31512,7 +32388,7 @@ class ContainerClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31534,8 +32410,12 @@ class ContainerClient extends StorageClient {
const { span, updatedOptions } = createSpan("ContainerClient-listBlobFlatSegment", options);
try {
const response = await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));
const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInteral) => {
const blobItem = Object.assign(Object.assign({}, blobItemInteral), { tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) });
response.segment.blobItems = [];
if (response.segment["Blob"] !== undefined) {
response.segment.blobItems = ProcessBlobItems(response.segment["Blob"]);
}
const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInteral) => {
const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name), tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) });
return blobItem;
}) }) });
return wrappedResponse;
@@ -31543,7 +32423,7 @@ class ContainerClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31563,19 +32443,33 @@ class ContainerClient extends StorageClient {
* @param options - Options to Container List Blob Hierarchy Segment operation.
*/
async listBlobHierarchySegment(delimiter, marker, options = {}) {
var _a;
const { span, updatedOptions } = createSpan("ContainerClient-listBlobHierarchySegment", options);
try {
const response = await this.containerContext.listBlobHierarchySegment(delimiter, Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));
const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInteral) => {
const blobItem = Object.assign(Object.assign({}, blobItemInteral), { tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) });
response.segment.blobItems = [];
if (response.segment["Blob"] !== undefined) {
response.segment.blobItems = ProcessBlobItems(response.segment["Blob"]);
}
response.segment.blobPrefixes = [];
if (response.segment["BlobPrefix"] !== undefined) {
response.segment.blobPrefixes = ProcessBlobPrefixes(response.segment["BlobPrefix"]);
}
const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobHierarchy(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInteral) => {
const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name), tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) });
return blobItem;
}), blobPrefixes: (_a = response.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => {
const blobPrefix = {
name: BlobNameToString(blobPrefixInternal.name),
};
return blobPrefix;
}) }) });
return wrappedResponse;
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -31757,7 +32651,7 @@ class ContainerClient extends StorageClient {
*/
byPage: (settings = {}) => {
return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions));
}
},
};
}
/**
@@ -31831,7 +32725,7 @@ class ContainerClient extends StorageClient {
* if (item.kind === "prefix") {
* console.log(`\tBlobPrefix: ${item.name}`);
* } else {
* console.log(`\tBlobItem: name - ${item.name}, last modified - ${item.properties.lastModified}`);
* console.log(`\tBlobItem: name - ${item.name}`);
* }
* }
* ```
@@ -31846,7 +32740,7 @@ class ContainerClient extends StorageClient {
* if (item.kind === "prefix") {
* console.log(`\tBlobPrefix: ${item.name}`);
* } else {
* console.log(`\tBlobItem: name - ${item.name}, last modified - ${item.properties.lastModified}`);
* console.log(`\tBlobItem: name - ${item.name}`);
* }
* entity = await iter.next();
* }
@@ -31864,7 +32758,7 @@ class ContainerClient extends StorageClient {
* }
* }
* for (const blob of response.segment.blobItems) {
* console.log(`\tBlobItem: name - ${blob.name}, last modified - ${blob.properties.lastModified}`);
* console.log(`\tBlobItem: name - ${blob.name}`);
* }
* }
* ```
@@ -31875,7 +32769,9 @@ class ContainerClient extends StorageClient {
* console.log("Listing blobs by hierarchy by page, specifying a prefix and a max page size");
*
* let i = 1;
* for await (const response of containerClient.listBlobsByHierarchy("/", { prefix: "prefix2/sub1/"}).byPage({ maxPageSize: 2 })) {
* for await (const response of containerClient
* .listBlobsByHierarchy("/", { prefix: "prefix2/sub1/" })
* .byPage({ maxPageSize: 2 })) {
* console.log(`Page ${i++}`);
* const segment = response.segment;
*
@@ -31886,7 +32782,7 @@ class ContainerClient extends StorageClient {
* }
*
* for (const blob of response.segment.blobItems) {
* console.log(`\tBlobItem: name - ${blob.name}, last modified - ${blob.properties.lastModified}`);
* console.log(`\tBlobItem: name - ${blob.name}`);
* }
* }
* ```
@@ -31953,7 +32849,208 @@ class ContainerClient extends StorageClient {
*/
byPage: (settings = {}) => {
return this.listHierarchySegments(delimiter, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions));
},
};
}
/**
* The Filter Blobs operation enables callers to list blobs in the container whose tags
* match a given search expression.
*
* @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
* The given expression must evaluate to true for a blob to be returned in the results.
* The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
* however, only a subset of the OData filter syntax is supported in the Blob service.
* @param 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
* 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
* the marker parameter in a subsequent call to request the next page of list
* items. The marker value is opaque to the client.
* @param options - Options to find blobs by tags.
*/
async findBlobsByTagsSegment(tagFilterSqlExpression, marker, options = {}) {
const { span, updatedOptions } = createSpan("ContainerClient-findBlobsByTagsSegment", options);
try {
const response = await this.containerContext.filterBlobs(Object.assign({ abortSignal: options.abortSignal, where: tagFilterSqlExpression, marker, maxPageSize: options.maxPageSize }, convertTracingToRequestOptionsBase(updatedOptions)));
const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => {
var _a;
let tagValue = "";
if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) {
tagValue = blob.tags.blobTagSet[0].value;
}
return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue });
}) });
return wrappedResponse;
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message,
});
throw e;
}
finally {
span.end();
}
}
/**
* Returns an AsyncIterableIterator for ContainerFindBlobsByTagsSegmentResponse.
*
* @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
* The given expression must evaluate to true for a blob to be returned in the results.
* The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
* however, only a subset of the OData filter syntax is supported in the Blob service.
* @param 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
* 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
* the marker parameter in a subsequent call to request the next page of list
* items. The marker value is opaque to the client.
* @param options - Options to find blobs by tags.
*/
findBlobsByTagsSegments(tagFilterSqlExpression, marker, options = {}) {
return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1() {
let response;
if (!!marker || marker === undefined) {
do {
response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options));
response.blobs = response.blobs || [];
marker = response.continuationToken;
yield yield tslib.__await(response);
} while (marker);
}
});
}
/**
* Returns an AsyncIterableIterator for blobs.
*
* @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
* The given expression must evaluate to true for a blob to be returned in the results.
* The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
* however, only a subset of the OData filter syntax is supported in the Blob service.
* @param options - Options to findBlobsByTagsItems.
*/
findBlobsByTagsItems(tagFilterSqlExpression, options = {}) {
return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1() {
var e_3, _a;
let marker;
try {
for (var _b = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
const segment = _c.value;
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs)));
}
}
catch (e_3_1) { e_3 = { error: e_3_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
}
finally { if (e_3) throw e_3.error; }
}
});
}
/**
* Returns an async iterable iterator to find all blobs with specified tag
* under the specified container.
*
* .byPage() returns an async iterable iterator to list the blobs in pages.
*
* Example using `for await` syntax:
*
* ```js
* let i = 1;
* for await (const blob of containerClient.findBlobsByTags("tagkey='tagvalue'")) {
* console.log(`Blob ${i++}: ${blob.name}`);
* }
* ```
*
* Example using `iter.next()`:
*
* ```js
* let i = 1;
* const iter = containerClient.findBlobsByTags("tagkey='tagvalue'");
* let blobItem = await iter.next();
* while (!blobItem.done) {
* console.log(`Blob ${i++}: ${blobItem.value.name}`);
* blobItem = await iter.next();
* }
* ```
*
* Example using `byPage()`:
*
* ```js
* // passing optional maxPageSize in the page settings
* let i = 1;
* for await (const response of containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) {
* if (response.blobs) {
* for (const blob of response.blobs) {
* console.log(`Blob ${i++}: ${blob.name}`);
* }
* }
* }
* ```
*
* Example using paging with a marker:
*
* ```js
* let i = 1;
* let iterator = containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 });
* let response = (await iterator.next()).value;
*
* // Prints 2 blob names
* if (response.blobs) {
* for (const blob of response.blobs) {
* console.log(`Blob ${i++}: ${blob.name}`);
* }
* }
*
* // Gets next marker
* let marker = response.continuationToken;
* // Passing next marker as continuationToken
* iterator = containerClient
* .findBlobsByTags("tagkey='tagvalue'")
* .byPage({ continuationToken: marker, maxPageSize: 10 });
* response = (await iterator.next()).value;
*
* // Prints blob names
* if (response.blobs) {
* for (const blob of response.blobs) {
* console.log(`Blob ${i++}: ${blob.name}`);
* }
* }
* ```
*
* @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
* The given expression must evaluate to true for a blob to be returned in the results.
* The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
* however, only a subset of the OData filter syntax is supported in the Blob service.
* @param options - Options to find blobs by tags.
*/
findBlobsByTags(tagFilterSqlExpression, options = {}) {
// AsyncIterableIterator to iterate over blobs
const listSegmentOptions = Object.assign({}, options);
const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions);
return {
/**
* The next method, part of the iteration protocol
*/
next() {
return iter.next();
},
/**
* The connection to the async iterator, part of the iteration protocol
*/
[Symbol.asyncIterator]() {
return this;
},
/**
* Return an AsyncIterableIterator that works a page at a time
*/
byPage: (settings = {}) => {
return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions));
},
};
}
getContainerNameFromUrl() {
@@ -32086,6 +33183,10 @@ class AccountSASPermissions {
* Permission to set immutability policy.
*/
this.setImmutabilityPolicy = false;
/**
* Specifies that Permanent Delete is permitted.
*/
this.permanentDelete = false;
}
/**
* Parse initializes the AccountSASPermissions fields from a string.
@@ -32132,6 +33233,9 @@ class AccountSASPermissions {
case "i":
accountSASPermissions.setImmutabilityPolicy = true;
break;
case "y":
accountSASPermissions.permanentDelete = true;
break;
default:
throw new RangeError(`Invalid permission character: ${c}`);
}
@@ -32182,6 +33286,9 @@ class AccountSASPermissions {
if (permissionLike.setImmutabilityPolicy) {
accountSASPermissions.setImmutabilityPolicy = true;
}
if (permissionLike.permanentDelete) {
accountSASPermissions.permanentDelete = true;
}
return accountSASPermissions;
}
/**
@@ -32235,6 +33342,9 @@ class AccountSASPermissions {
if (this.setImmutabilityPolicy) {
permissions.push("i");
}
if (this.permanentDelete) {
permissions.push("y");
}
return permissions.join("");
}
}
@@ -32417,6 +33527,11 @@ function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyC
version < "2019-10-10") {
throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission.");
}
if (accountSASSignatureValues.permissions &&
accountSASSignatureValues.permissions.permanentDelete &&
version < "2019-10-10") {
throw RangeError("'version' must be >= '2019-10-10' when provided 'y' permission.");
}
if (accountSASSignatureValues.permissions &&
accountSASSignatureValues.permissions.tag &&
version < "2019-12-12") {
@@ -32427,25 +33542,48 @@ function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyC
version < "2019-12-12") {
throw RangeError("'version' must be >= '2019-12-12' when provided 'f' permission.");
}
if (accountSASSignatureValues.encryptionScope && version < "2020-12-06") {
throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS.");
}
const parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString());
const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString();
const parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString();
const stringToSign = [
sharedKeyCredential.accountName,
parsedPermissions,
parsedServices,
parsedResourceTypes,
accountSASSignatureValues.startsOn
? truncatedISO8061Date(accountSASSignatureValues.startsOn, false)
: "",
truncatedISO8061Date(accountSASSignatureValues.expiresOn, false),
accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "",
accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "",
version,
"" // Account SAS requires an additional newline character
].join("\n");
let stringToSign;
if (version >= "2020-12-06") {
stringToSign = [
sharedKeyCredential.accountName,
parsedPermissions,
parsedServices,
parsedResourceTypes,
accountSASSignatureValues.startsOn
? truncatedISO8061Date(accountSASSignatureValues.startsOn, false)
: "",
truncatedISO8061Date(accountSASSignatureValues.expiresOn, false),
accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "",
accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "",
version,
accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : "",
"", // Account SAS requires an additional newline character
].join("\n");
}
else {
stringToSign = [
sharedKeyCredential.accountName,
parsedPermissions,
parsedServices,
parsedResourceTypes,
accountSASSignatureValues.startsOn
? truncatedISO8061Date(accountSASSignatureValues.startsOn, false)
: "",
truncatedISO8061Date(accountSASSignatureValues.expiresOn, false),
accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "",
accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "",
version,
"", // Account SAS requires an additional newline character
].join("\n");
}
const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);
return new SASQueryParameters(version, signature, parsedPermissions.toString(), parsedServices, parsedResourceTypes, accountSASSignatureValues.protocol, accountSASSignatureValues.startsOn, accountSASSignatureValues.expiresOn, accountSASSignatureValues.ipRange);
return new SASQueryParameters(version, signature, parsedPermissions.toString(), parsedServices, parsedResourceTypes, accountSASSignatureValues.protocol, accountSASSignatureValues.startsOn, accountSASSignatureValues.expiresOn, accountSASSignatureValues.ipRange, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, accountSASSignatureValues.encryptionScope);
}
/**
@@ -32492,12 +33630,17 @@ class BlobServiceClient extends StorageClient {
options = options || {};
const extractedCreds = extractConnectionStringParts(connectionString);
if (extractedCreds.kind === "AccountConnString") {
{
if (coreHttp.isNode) {
const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
if (!options.proxyOptions) {
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
}
const pipeline = newPipeline(sharedKeyCredential, options);
return new BlobServiceClient(extractedCreds.url, pipeline);
}
else {
throw new Error("Account connection string is only supported in Node.js environment");
}
}
else if (extractedCreds.kind === "SASConnString") {
const pipeline = newPipeline(new AnonymousCredential(), options);
@@ -32536,13 +33679,13 @@ class BlobServiceClient extends StorageClient {
const containerCreateResponse = await containerClient.create(updatedOptions);
return {
containerClient,
containerCreateResponse
containerCreateResponse,
};
}
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -32566,7 +33709,7 @@ class BlobServiceClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -32596,7 +33739,7 @@ class BlobServiceClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -32626,7 +33769,7 @@ class BlobServiceClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -32650,7 +33793,7 @@ class BlobServiceClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -32675,7 +33818,7 @@ class BlobServiceClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -32700,7 +33843,7 @@ class BlobServiceClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -32726,7 +33869,7 @@ class BlobServiceClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -32756,7 +33899,7 @@ class BlobServiceClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -32799,7 +33942,7 @@ class BlobServiceClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -32965,7 +34108,7 @@ class BlobServiceClient extends StorageClient {
*/
byPage: (settings = {}) => {
return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions));
}
},
};
}
/**
@@ -33103,6 +34246,9 @@ class BlobServiceClient extends StorageClient {
if (options.includeMetadata) {
include.push("metadata");
}
if (options.includeSystem) {
include.push("system");
}
// AsyncIterableIterator to iterate over containers
const listSegmentOptions = Object.assign(Object.assign({}, options), (include.length > 0 ? { include } : {}));
const iter = this.listItems(listSegmentOptions);
@@ -33124,7 +34270,7 @@ class BlobServiceClient extends StorageClient {
*/
byPage: (settings = {}) => {
return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions));
}
},
};
}
/**
@@ -33143,7 +34289,7 @@ class BlobServiceClient extends StorageClient {
try {
const response = await this.serviceContext.getUserDelegationKey({
startsOn: truncatedISO8061Date(startsOn, false),
expiresOn: truncatedISO8061Date(expiresOn, false)
expiresOn: truncatedISO8061Date(expiresOn, false),
}, Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));
const userDelegationKey = {
signedObjectId: response.signedObjectId,
@@ -33152,7 +34298,7 @@ class BlobServiceClient extends StorageClient {
signedExpiresOn: new Date(response.signedExpiresOn),
signedService: response.signedService,
signedVersion: response.signedVersion,
value: response.value
value: response.value,
};
const res = Object.assign({ _response: response._response, requestId: response.requestId, clientRequestId: response.clientRequestId, version: response.version, date: response.date, errorCode: response.errorCode }, userDelegationKey);
return res;
@@ -33160,7 +34306,7 @@ class BlobServiceClient extends StorageClient {
catch (e) {
span.setStatus({
code: coreTracing.SpanStatusCode.ERROR,
message: e.message
message: e.message,
});
throw e;
}
@@ -33209,39 +34355,27 @@ class BlobServiceClient extends StorageClient {
Object.defineProperty(exports, 'BaseRequestPolicy', {
enumerable: true,
get: function () {
return coreHttp.BaseRequestPolicy;
}
get: function () { return coreHttp.BaseRequestPolicy; }
});
Object.defineProperty(exports, 'HttpHeaders', {
enumerable: true,
get: function () {
return coreHttp.HttpHeaders;
}
get: function () { return coreHttp.HttpHeaders; }
});
Object.defineProperty(exports, 'RequestPolicyOptions', {
enumerable: true,
get: function () {
return coreHttp.RequestPolicyOptions;
}
get: function () { return coreHttp.RequestPolicyOptions; }
});
Object.defineProperty(exports, 'RestError', {
enumerable: true,
get: function () {
return coreHttp.RestError;
}
get: function () { return coreHttp.RestError; }
});
Object.defineProperty(exports, 'WebResource', {
enumerable: true,
get: function () {
return coreHttp.WebResource;
}
get: function () { return coreHttp.WebResource; }
});
Object.defineProperty(exports, 'deserializationPolicy', {
enumerable: true,
get: function () {
return coreHttp.deserializationPolicy;
}
get: function () { return coreHttp.deserializationPolicy; }
});
exports.AccountSASPermissions = AccountSASPermissions;
exports.AccountSASResourceTypes = AccountSASResourceTypes;
@@ -36294,7 +37428,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getInputAsInt = exports.getInputAsArray = exports.isValidEvent = exports.logWarning = exports.getCacheState = exports.setOutputAndState = exports.setCacheHitOutput = exports.setCacheState = exports.isExactKeyMatch = exports.isGhes = void 0;
exports.isCacheFeatureAvailable = exports.getInputAsInt = exports.getInputAsArray = exports.isValidEvent = exports.logWarning = exports.getCacheState = exports.setOutputAndState = exports.setCacheHitOutput = exports.setCacheState = exports.isExactKeyMatch = exports.isGhes = void 0;
const cache = __importStar(__webpack_require__(692));
const core = __importStar(__webpack_require__(470));
const constants_1 = __webpack_require__(196);
function isGhes() {
@@ -36359,6 +37494,19 @@ function getInputAsInt(name, options) {
return value;
}
exports.getInputAsInt = getInputAsInt;
function isCacheFeatureAvailable() {
if (!cache.isFeatureAvailable()) {
if (isGhes()) {
logWarning("Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not.");
}
else {
logWarning("An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions.");
}
return false;
}
return true;
}
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
/***/ }),
@@ -39151,7 +40299,7 @@ function defer(fn)
Object.defineProperty(exports, '__esModule', { value: true });
__webpack_require__(71);
__webpack_require__(97);
var tslib = __webpack_require__(671);
// Copyright (c) Microsoft Corporation.
@@ -45172,8 +46320,7 @@ process.on("uncaughtException", e => utils.logWarning(e.message));
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
if (utils.isGhes()) {
utils.logWarning("Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details");
if (!utils.isCacheFeatureAvailable()) {
return;
}
if (!utils.isValidEvent()) {
@@ -45317,6 +46464,15 @@ function checkKey(key) {
throw new ValidationError(`Key Validation Error: ${key} cannot contain commas.`);
}
}
/**
* isFeatureAvailable to check the presence of Actions cache service
*
* @returns boolean return true if Actions cache service feature is available, otherwise false
*/
function isFeatureAvailable() {
return !!process.env['ACTIONS_CACHE_URL'];
}
exports.isFeatureAvailable = isFeatureAvailable;
/**
* Restores cache from keys
*
@@ -45383,18 +46539,12 @@ exports.restoreCache = restoreCache;
* @returns number returns cacheId if the cache was saved successfully and throws an error if save fails
*/
function saveCache(paths, key, options) {
var _a, _b, _c, _d, _e;
return __awaiter(this, void 0, void 0, function* () {
checkPaths(paths);
checkKey(key);
const compressionMethod = yield utils.getCompressionMethod();
core.debug('Reserving Cache');
const cacheId = yield cacheHttpClient.reserveCache(key, paths, {
compressionMethod
});
if (cacheId === -1) {
throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`);
}
core.debug(`Cache ID: ${cacheId}`);
let cacheId = null;
const cachePaths = yield utils.resolvePaths(paths);
core.debug('Cache Paths:');
core.debug(`${JSON.stringify(cachePaths)}`);
@@ -45409,9 +46559,24 @@ function saveCache(paths, key, options) {
const fileSizeLimit = 10 * 1024 * 1024 * 1024; // 10GB per repo limit
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
core.debug(`File Size: ${archiveFileSize}`);
if (archiveFileSize > fileSizeLimit) {
// For GHES, this check will take place in ReserveCache API with enterprise file size limit
if (archiveFileSize > fileSizeLimit && !utils.isGhes()) {
throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`);
}
core.debug('Reserving Cache');
const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, {
compressionMethod,
cacheSize: archiveFileSize
});
if ((_a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a === void 0 ? void 0 : _a.cacheId) {
cacheId = (_b = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _b === void 0 ? void 0 : _b.cacheId;
}
else if ((reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.statusCode) === 400) {
throw new ReserveCacheError((_d = (_c = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : `Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the data cap limit, not saving cache.`);
}
else {
throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`);
}
core.debug(`Saving Cache (ID: ${cacheId})`);
yield cacheHttpClient.saveCache(cacheId, archivePath, options);
}
@@ -49579,7 +50744,6 @@ class Poller {
});
}
/**
* @internal
* Starts a loop that will break only if the poller is done
* or if the poller is stopped.
*/
@@ -49593,7 +50757,6 @@ class Poller {
}
}
/**
* @internal
* pollOnce does one polling, by calling to the update method of the underlying
* poll operation to make any relevant change effective.
*
@@ -49627,7 +50790,6 @@ class Poller {
}
}
/**
* @internal
* fireProgress calls the functions passed in via onProgress the method of the poller.
*
* It loops over all of the callbacks received from onProgress, and executes them, sending them
@@ -49641,7 +50803,6 @@ class Poller {
}
}
/**
* @internal
* Invokes the underlying operation's cancel method, and rejects the
* pollUntilDone promise.
*/
@@ -49815,7 +50976,7 @@ class Poller {
*/
function getPollingUrl(rawResponse, defaultPath) {
var _a, _b, _c;
return ((_c = (_b = (_a = getAzureAsyncOperation(rawResponse)) !== null && _a !== void 0 ? _a : getLocation(rawResponse)) !== null && _b !== void 0 ? _b : getOperationLocation(rawResponse)) !== null && _c !== void 0 ? _c : defaultPath);
return ((_c = (_b = (_a = getAzureAsyncOperation(rawResponse)) !== null && _a !== void 0 ? _a : getOperationLocation(rawResponse)) !== null && _b !== void 0 ? _b : getLocation(rawResponse)) !== null && _c !== void 0 ? _c : defaultPath);
}
function getLocation(rawResponse) {
return rawResponse.headers["location"];
@@ -49826,19 +50987,29 @@ function getOperationLocation(rawResponse) {
function getAzureAsyncOperation(rawResponse) {
return rawResponse.headers["azure-asyncoperation"];
}
function findResourceLocation(requestMethod, rawResponse, requestPath) {
switch (requestMethod) {
case "PUT": {
return requestPath;
}
case "POST":
case "PATCH": {
return getLocation(rawResponse);
}
default: {
return undefined;
}
}
}
function inferLroMode(requestPath, requestMethod, rawResponse) {
if (getAzureAsyncOperation(rawResponse) !== undefined) {
if (getAzureAsyncOperation(rawResponse) !== undefined ||
getOperationLocation(rawResponse) !== undefined) {
return {
mode: "AzureAsync",
resourceLocation: requestMethod === "PUT"
? requestPath
: requestMethod === "POST" || requestMethod === "PATCH"
? getLocation(rawResponse)
: undefined,
mode: "Location",
resourceLocation: findResourceLocation(requestMethod, rawResponse, requestPath),
};
}
else if (getLocation(rawResponse) !== undefined ||
getOperationLocation(rawResponse) !== undefined) {
else if (getLocation(rawResponse) !== undefined) {
return {
mode: "Location",
};
@@ -49908,13 +51079,13 @@ function processBodyPollingOperationResult(response) {
const logger = logger$1.createClientLogger("core-lro");
// Copyright (c) Microsoft Corporation.
function getResponseStatus(rawResponse) {
function isPollingDone(rawResponse) {
var _a;
if (isUnexpectedPollingResponse(rawResponse) || rawResponse.statusCode === 202) {
return false;
}
const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {};
return typeof status === "string" ? status.toLowerCase() : "succeeded";
}
function isAzureAsyncPollingDone(rawResponse) {
const state = getResponseStatus(rawResponse);
const state = typeof status === "string" ? status.toLowerCase() : "succeeded";
if (isUnexpectedPollingResponse(rawResponse) || failureStates.includes(state)) {
throw new Error(`The long running operation has failed. The provisioning state: ${state}.`);
}
@@ -49934,9 +51105,9 @@ async function sendFinalRequest(lro, resourceLocation, lroResourceLocationConfig
return lro.sendPollRequest(resourceLocation !== null && resourceLocation !== void 0 ? resourceLocation : lro.requestPath);
}
}
function processAzureAsyncOperationResult(lro, resourceLocation, lroResourceLocationConfig) {
function processLocationPollingOperationResult(lro, resourceLocation, lroResourceLocationConfig) {
return (response) => {
if (isAzureAsyncPollingDone(response.rawResponse)) {
if (isPollingDone(response.rawResponse)) {
if (resourceLocation === undefined) {
return Object.assign(Object.assign({}, response), { done: true });
}
@@ -49951,14 +51122,6 @@ function processAzureAsyncOperationResult(lro, resourceLocation, lroResourceLoca
};
}
// Copyright (c) Microsoft Corporation.
function isLocationPollingDone(rawResponse) {
return !isUnexpectedPollingResponse(rawResponse) && rawResponse.statusCode !== 202;
}
function processLocationPollingOperationResult(response) {
return Object.assign(Object.assign({}, response), { done: isLocationPollingDone(response.rawResponse) });
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
function processPassthroughOperationResult(response) {
@@ -49971,11 +51134,8 @@ function processPassthroughOperationResult(response) {
*/
function createGetLroStatusFromResponse(lroPrimitives, config, lroResourceLocationConfig) {
switch (config.mode) {
case "AzureAsync": {
return processAzureAsyncOperationResult(lroPrimitives, config.resourceLocation, lroResourceLocationConfig);
}
case "Location": {
return processLocationPollingOperationResult;
return processLocationPollingOperationResult(lroPrimitives, config.resourceLocation, lroResourceLocationConfig);
}
case "Body": {
return processBodyPollingOperationResult;
@@ -50425,7 +51585,8 @@ function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetry
return {
statusCode: error.statusCode,
result: null,
headers: {}
headers: {},
error
};
}
else {
@@ -53431,7 +54592,7 @@ var FormData = __webpack_require__(790);
var node_fetch = __webpack_require__(454);
var coreTracing = __webpack_require__(263);
var url = __webpack_require__(835);
__webpack_require__(71);
__webpack_require__(97);
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
+101 -44
View File
@@ -4,17 +4,22 @@
- [D - DUB](#d---dub)
- [POSIX](#posix)
- [Windows](#windows)
- [Elixir - Mix](#elixir---mix)
- [Go - Modules](#go---modules)
- [Deno](#deno)
- [Linux](#linux)
- [macOS](#macos)
- [Windows](#windows-1)
- [Elixir - Mix](#elixir---mix)
- [Go - Modules](#go---modules)
- [Linux](#linux-1)
- [macOS](#macos-1)
- [Windows](#windows-2)
- [Haskell - Cabal](#haskell---cabal)
- [Haskell - Stack](#haskell---stack)
- [Java - Gradle](#java---gradle)
- [Java - Maven](#java---maven)
- [Node - npm](#node---npm)
- [macOS and Ubuntu](#macos-and-ubuntu)
- [Windows](#windows-2)
- [Windows](#windows-3)
- [Using multiple systems and `npm config`](#using-multiple-systems-and-npm-config)
- [Node - Lerna](#node---lerna)
- [Node - Yarn](#node---yarn)
@@ -28,8 +33,6 @@
- [Using pip to get cache location](#using-pip-to-get-cache-location)
- [Python - pipenv](#python---pipenv)
- [R - renv](#r---renv)
- [Simple example](#simple-example-1)
- [Multiple OS's in a workflow](#multiple-oss-in-a-workflow-1)
- [Ruby - Bundler](#ruby---bundler)
- [Rust - Cargo](#rust---cargo)
- [Scala - SBT](#scala---sbt)
@@ -42,7 +45,7 @@
Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/package-references-in-project-files#locking-dependencies):
```yaml
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
@@ -51,10 +54,10 @@ Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/packa
```
Depending on the environment, huge packages might be pre-installed in the global cache folder.
With `actions/cache@v2` you can now exclude unwanted packages with [exclude pattern](https://github.com/actions/toolkit/tree/main/packages/glob#exclude-patterns)
With `actions/cache@v3` you can now exclude unwanted packages with [exclude pattern](https://github.com/actions/toolkit/tree/main/packages/glob#exclude-patterns)
```yaml
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
~/.nuget/packages
@@ -66,11 +69,12 @@ With `actions/cache@v2` you can now exclude unwanted packages with [exclude patt
Or you could move the cache folder like below.
>Note: This workflow does not work for projects that require files to be placed in user profile package folder
```yaml
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
steps:
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
@@ -83,7 +87,7 @@ steps:
### POSIX
```yaml
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ~/.dub
key: ${{ runner.os }}-dub-${{ hashFiles('**/dub.json') }}
@@ -94,7 +98,7 @@ steps:
### Windows
```yaml
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ~\AppData\Local\dub
key: ${{ runner.os }}-dub-${{ hashFiles('**/dub.json') }}
@@ -102,10 +106,46 @@ steps:
${{ runner.os }}-dub-
```
## Deno
### Linux
```yaml
- uses: actions/cache@v3
with:
path: |
~/.deno
~/.cache/deno
key: ${{ runner.os }}-deno-${{ hashFiles('**/deps.ts') }}
```
### macOS
```yaml
- uses: actions/cache@v3
with:
path: |
~/.deno
~/Library/Caches/deno
key: ${{ runner.os }}-deno-${{ hashFiles('**/deps.ts') }}
```
### Windows
```yaml
- uses: actions/cache@v3
with:
path: |
~\.deno
%LocalAppData%\deno
key: ${{ runner.os }}-deno-${{ hashFiles('**/deps.ts') }}
```
## Elixir - Mix
```yaml
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
deps
@@ -120,7 +160,7 @@ steps:
### Linux
```yaml
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
@@ -133,7 +173,7 @@ steps:
### macOS
```yaml
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
~/Library/Caches/go-build
@@ -146,11 +186,11 @@ steps:
### Windows
```yaml
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
%LocalAppData%\go-build
~/go/pkg/mod
~\AppData\Local\go-build
~\go\pkg\mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
@@ -162,7 +202,7 @@ We cache the elements of the Cabal store separately, as the entirety of `~/.caba
```yaml
- name: Cache ~/.cabal/packages, ~/.cabal/store and dist-newstyle
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.cabal/packages
@@ -172,12 +212,31 @@ We cache the elements of the Cabal store separately, as the entirety of `~/.caba
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
```
## Haskell - Stack
```yaml
- uses: actions/cache@v3
name: Cache ~/.stack
with:
path: ~/.stack
key: ${{ runner.os }}-stack-global-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}
restore-keys: |
${{ runner.os }}-stack-global-
- uses: actions/cache@v3
name: Cache .stack-work
with:
path: .stack-work
key: ${{ runner.os }}-stack-work-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}-${{ hashFiles('**/*.hs') }}
restore-keys: |
${{ runner.os }}-stack-work-
```
## Java - Gradle
>Note: Ensure no Gradle daemons are running anymore when your workflow completes. Creating the cache package might fail due to locks being held by Gradle. Refer to the [Gradle Daemon documentation](https://docs.gradle.org/current/userguide/gradle_daemon.html) on how to disable or stop the Gradle Daemons.
```yaml
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
@@ -191,7 +250,7 @@ We cache the elements of the Cabal store separately, as the entirety of `~/.caba
```yaml
- name: Cache local Maven repository
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
@@ -210,7 +269,7 @@ If using `npm config` to retrieve the cache directory, ensure you run [actions/s
### macOS and Ubuntu
```yaml
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@@ -225,7 +284,7 @@ If using `npm config` to retrieve the cache directory, ensure you run [actions/s
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@@ -240,7 +299,7 @@ If using `npm config` to retrieve the cache directory, ensure you run [actions/s
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v2
- uses: actions/cache@v3
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
@@ -253,11 +312,9 @@ If using `npm config` to retrieve the cache directory, ensure you run [actions/s
```yaml
- name: restore lerna
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
node_modules
*/*/node_modules
path: **/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
```
@@ -269,7 +326,7 @@ The yarn cache directory will depend on your operating system and version of `ya
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -287,7 +344,7 @@ The yarn 2 cache directory will depend on your config. See https://yarnpkg.com/c
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- uses: actions/cache@v2
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -302,7 +359,7 @@ Esy allows you to export built dependencies and import pre-built dependencies.
```yaml
- name: Restore Cache
id: restore-cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: _export
key: ${{ runner.os }}-esy-${{ hashFiles('esy.lock/index.json') }}
@@ -331,7 +388,7 @@ Esy allows you to export built dependencies and import pre-built dependencies.
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -352,7 +409,7 @@ Locations:
### Simple example
```yaml
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
@@ -365,7 +422,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
### Multiple OS's in a workflow
```yaml
- uses: actions/cache@v2
- uses: actions/cache@v3
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
@@ -373,7 +430,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v2
- uses: actions/cache@v3
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/pip
@@ -381,7 +438,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v2
- uses: actions/cache@v3
if: startsWith(runner.os, 'Windows')
with:
path: ~\AppData\Local\pip\Cache
@@ -407,7 +464,7 @@ jobs:
- os: windows-latest
path: ~\AppData\Local\pip\Cache
steps:
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ matrix.path }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
@@ -425,7 +482,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: pip cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
@@ -443,7 +500,7 @@ jobs:
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipenv-${{ hashFiles('Pipfile.lock') }}
@@ -470,7 +527,7 @@ For renv, the cache directory will vary by OS. The `RENV_PATHS_ROOT` environment
cat("##[set-output name=r-version;]", R.Version()$version.string, sep = "")
shell: Rscript {0}
- name: Restore Renv package cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ env.RENV_PATHS_ROOT }}
key: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-${{ inputs.cache-version }}-${{ hashFiles('renv.lock') }}
@@ -496,7 +553,7 @@ whenever possible:
## Rust - Cargo
```yaml
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
@@ -511,7 +568,7 @@ whenever possible:
```yaml
- name: Cache SBT
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.ivy2/cache
@@ -522,7 +579,7 @@ whenever possible:
## Swift, Objective-C - Carthage
```yaml
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: Carthage
key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
@@ -533,7 +590,7 @@ whenever possible:
## Swift, Objective-C - CocoaPods
```yaml
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
@@ -544,7 +601,7 @@ whenever possible:
## Swift - Swift Package Manager
```yaml
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
+104 -187
View File
@@ -1,13 +1,13 @@
{
"name": "cache",
"version": "2.1.7",
"version": "3.0.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@actions/cache": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-1.0.9.tgz",
"integrity": "sha512-VzqeDyW3kIDdARNQphd1FrzZCiJRuv98aXwM3R+BLe2UvdZXdRqjC/rrytSm4Nv4OJuI8NA1pbhkXIf+a4LFtw==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-2.0.1.tgz",
"integrity": "sha512-GoxSLZFMLpAeHeE7hXqbOz81j+Mpvgs2o8HL2UlFQppXrrNcIsofFGyoH76htcZZPB/876f6NedFr2AS8Xd2Vw==",
"requires": {
"@actions/core": "^1.2.6",
"@actions/exec": "^1.0.1",
@@ -29,9 +29,9 @@
}
},
"@actions/exec": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.0.tgz",
"integrity": "sha512-LImpN9AY0J1R1mEYJjVJfSZWU4zYOlEcwSTgPve1rFQqK5AwrEs6uWW5Rv70gbDIQIAUwI86z6B+9mPK4w9Sbg==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz",
"integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==",
"requires": {
"@actions/io": "^1.0.1"
}
@@ -54,9 +54,9 @@
}
},
"@actions/io": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.1.tgz",
"integrity": "sha512-Qi4JoKXjmE0O67wAOH6y0n26QXhMKMFo7GD/4IXNVcrtLjUlGjGuVys6pQgwF3ArfGTQu0XpqaNr0YhED2RaRA=="
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.2.tgz",
"integrity": "sha512-d+RwPlMp+2qmBfeLYPLXuSRykDIFEwdTA0MMxzS9kh4kvP1ftrc/9fzy6pX6qAjthdXruHQ6/6kjT/DNo5ALuw=="
},
"@ampproject/remapping": {
"version": "2.1.1",
@@ -83,9 +83,9 @@
}
},
"@azure/core-asynciterator-polyfill": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@azure/core-asynciterator-polyfill/-/core-asynciterator-polyfill-1.0.0.tgz",
"integrity": "sha512-kmv8CGrPfN9SwMwrkiBK9VTQYxdFQEGe0BmQk+M8io56P9KNzpAxcWE/1fxJj7uouwN4kXF0BHW8DNlgx+wtCg=="
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@azure/core-asynciterator-polyfill/-/core-asynciterator-polyfill-1.0.2.tgz",
"integrity": "sha512-3rkP4LnnlWawl0LZptJOdXNrT/fHp2eQMadoasa6afspXdpGrtPZuAQc2PD0cpgyuoXtUWyC3tv7xfntjGS5Dw=="
},
"@azure/core-auth": {
"version": "1.3.2",
@@ -158,9 +158,9 @@
}
},
"@azure/core-lro": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.2.3.tgz",
"integrity": "sha512-UMdlR9NsqDCLTba3EUbRjfMF4gDmWvld196JmUjbz9WWhJ2XT00OR5MXeWiR+vmGT+ETiO4hHFCi2/eGO5YVtg==",
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.2.4.tgz",
"integrity": "sha512-e1I2v2CZM0mQo8+RSix0x091Av493e4bnT22ds2fcQGslTHzM2oTbswkB65nP4iEpCxBrFxOSDPKExmTmjCVtQ==",
"requires": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-tracing": "1.0.0-preview.13",
@@ -223,14 +223,14 @@
}
},
"@azure/ms-rest-js": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.6.0.tgz",
"integrity": "sha512-4C5FCtvEzWudblB+h92/TYYPiq7tuElX8icVYToxOdggnYqeec4Se14mjse5miInKtZahiFHdl8lZA/jziEc5g==",
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.6.1.tgz",
"integrity": "sha512-LLi4jRe/qy5IM8U2CkoDgSZp2OH+MgDe2wePmhz8uY84Svc53EhHaamVyoU6BjjHBxvCRh1vcD1urJDccrxqIw==",
"requires": {
"@azure/core-auth": "^1.1.4",
"abort-controller": "^3.0.0",
"form-data": "^2.5.0",
"node-fetch": "^2.6.0",
"node-fetch": "^2.6.7",
"tough-cookie": "^3.0.1",
"tslib": "^1.10.0",
"tunnel": "0.0.6",
@@ -246,9 +246,9 @@
}
},
"@azure/storage-blob": {
"version": "12.8.0",
"resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.8.0.tgz",
"integrity": "sha512-c8+Wz19xauW0bGkTCoqZH4dYfbtBniPiGiRQOn1ca6G5jsjr4azwaTk9gwjVY8r3vY2Taf95eivLzipfIfiS4A==",
"version": "12.9.0",
"resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.9.0.tgz",
"integrity": "sha512-ank38FdCLfJ+EoeMzCz3hkYJuZAd63ARvDKkxZYRDb+beBYf+/+gx8jNTqkq/hfyUl4dJQ/a7tECU0Y0F98CHg==",
"requires": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-http": "^2.0.0",
@@ -692,34 +692,26 @@
"dev": true
},
"@eslint/eslintrc": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.1.0.tgz",
"integrity": "sha512-C1DfL7XX4nPqGd6jcP01W9pVM1HYCuUkFk1432D7F0v3JSlUIeOYn9oCoi3eoLZ+iwBSb29BMFxxny0YrrEZqg==",
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.1.tgz",
"integrity": "sha512-bxvbYnBPN1Gibwyp6NrpnFzA3YtRL3BBAyEAFVIpNTm2Rn4Vy87GA5M4aSn3InRrlsbX5N0GW7XIx+U4SAEKdQ==",
"dev": true,
"requires": {
"ajv": "^6.12.4",
"debug": "^4.3.2",
"espree": "^9.3.1",
"globals": "^13.9.0",
"ignore": "^4.0.6",
"ignore": "^5.2.0",
"import-fresh": "^3.2.1",
"js-yaml": "^4.1.0",
"minimatch": "^3.0.4",
"strip-json-comments": "^3.1.1"
},
"dependencies": {
"ignore": {
"version": "4.0.6",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
"integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
"dev": true
}
}
},
"@humanwhocodes/config-array": {
"version": "0.9.3",
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.3.tgz",
"integrity": "sha512-3xSMlXHh03hCcCmFc0rbKp3Ivt2PFEJnQUJDDMTJQ2wkECZWdq4GePs2ctc5H8zV+cHPaq8k2vU8mrQjA6iHdQ==",
"version": "0.9.5",
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz",
"integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==",
"dev": true,
"requires": {
"@humanwhocodes/object-schema": "^1.2.1",
@@ -1297,19 +1289,19 @@
}
},
"@types/jest": {
"version": "27.4.0",
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-27.4.0.tgz",
"integrity": "sha512-gHl8XuC1RZ8H2j5sHv/JqsaxXkDDM9iDOgu0Wp8sjs4u/snb2PVehyWXJPr+ORA0RPpgw231mnutWI1+0hgjIQ==",
"version": "27.4.1",
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-27.4.1.tgz",
"integrity": "sha512-23iPJADSmicDVrWk+HT58LMJtzLAnB2AgIzplQuq/bSrGaxCrlvRFjGbXmamnnk/mAmCdLStiGqggu28ocUyiw==",
"dev": true,
"requires": {
"jest-diff": "^27.0.0",
"jest-matcher-utils": "^27.0.0",
"pretty-format": "^27.0.0"
}
},
"@types/json-schema": {
"version": "7.0.9",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz",
"integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==",
"version": "7.0.10",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.10.tgz",
"integrity": "sha512-BLO9bBq59vW3fxCpD4o0N4U+DXsvwvIcl+jofw0frQo/GrBFC+/jRZj1E7kgp6dvTyNmA4y6JCV5Id/r3mNP5A==",
"dev": true
},
"@types/json5": {
@@ -1328,14 +1320,14 @@
}
},
"@types/node": {
"version": "16.11.25",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.25.tgz",
"integrity": "sha512-NrTwfD7L1RTc2qrHQD4RTTy4p0CO2LatKBEKEds3CaVuhoM/+DJzmWZl5f+ikR8cm8F5mfJxK+9rQq07gRiSjQ=="
"version": "16.11.26",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.26.tgz",
"integrity": "sha512-GZ7bu5A6+4DtG7q9GsoHXy3ALcgeIHP4NnL0Vv2wu0uUB/yQex26v0tf6/na1mm0+bS9Uw+0DFex7aaKr2qawQ=="
},
"@types/node-fetch": {
"version": "2.5.12",
"resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.12.tgz",
"integrity": "sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw==",
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.1.tgz",
"integrity": "sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==",
"requires": {
"@types/node": "*",
"form-data": "^3.0.0"
@@ -1389,14 +1381,14 @@
"dev": true
},
"@typescript-eslint/eslint-plugin": {
"version": "5.12.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.12.0.tgz",
"integrity": "sha512-fwCMkDimwHVeIOKeBHiZhRUfJXU8n6xW1FL9diDxAyGAFvKcH4csy0v7twivOQdQdA0KC8TDr7GGRd3L4Lv0rQ==",
"version": "5.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.17.0.tgz",
"integrity": "sha512-qVstvQilEd89HJk3qcbKt/zZrfBZ+9h2ynpAGlWjWiizA7m/MtLT9RoX6gjtpE500vfIg8jogAkDzdCxbsFASQ==",
"dev": true,
"requires": {
"@typescript-eslint/scope-manager": "5.12.0",
"@typescript-eslint/type-utils": "5.12.0",
"@typescript-eslint/utils": "5.12.0",
"@typescript-eslint/scope-manager": "5.17.0",
"@typescript-eslint/type-utils": "5.17.0",
"@typescript-eslint/utils": "5.17.0",
"debug": "^4.3.2",
"functional-red-black-tree": "^1.0.1",
"ignore": "^5.1.8",
@@ -1417,52 +1409,52 @@
}
},
"@typescript-eslint/parser": {
"version": "5.12.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.12.0.tgz",
"integrity": "sha512-MfSwg9JMBojMUoGjUmX+D2stoQj1CBYTCP0qnnVtu9A+YQXVKNtLjasYh+jozOcrb/wau8TCfWOkQTiOAruBog==",
"version": "5.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.17.0.tgz",
"integrity": "sha512-aRzW9Jg5Rlj2t2/crzhA2f23SIYFlF9mchGudyP0uiD6SenIxzKoLjwzHbafgHn39dNV/TV7xwQkLfFTZlJ4ig==",
"dev": true,
"requires": {
"@typescript-eslint/scope-manager": "5.12.0",
"@typescript-eslint/types": "5.12.0",
"@typescript-eslint/typescript-estree": "5.12.0",
"@typescript-eslint/scope-manager": "5.17.0",
"@typescript-eslint/types": "5.17.0",
"@typescript-eslint/typescript-estree": "5.17.0",
"debug": "^4.3.2"
}
},
"@typescript-eslint/scope-manager": {
"version": "5.12.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.12.0.tgz",
"integrity": "sha512-GAMobtIJI8FGf1sLlUWNUm2IOkIjvn7laFWyRx7CLrv6nLBI7su+B7lbStqVlK5NdLvHRFiJo2HhiDF7Ki01WQ==",
"version": "5.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.17.0.tgz",
"integrity": "sha512-062iCYQF/doQ9T2WWfJohQKKN1zmmXVfAcS3xaiialiw8ZUGy05Em6QVNYJGO34/sU1a7a+90U3dUNfqUDHr3w==",
"dev": true,
"requires": {
"@typescript-eslint/types": "5.12.0",
"@typescript-eslint/visitor-keys": "5.12.0"
"@typescript-eslint/types": "5.17.0",
"@typescript-eslint/visitor-keys": "5.17.0"
}
},
"@typescript-eslint/type-utils": {
"version": "5.12.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.12.0.tgz",
"integrity": "sha512-9j9rli3zEBV+ae7rlbBOotJcI6zfc6SHFMdKI9M3Nc0sy458LJ79Os+TPWeBBL96J9/e36rdJOfCuyRSgFAA0Q==",
"version": "5.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.17.0.tgz",
"integrity": "sha512-3hU0RynUIlEuqMJA7dragb0/75gZmwNwFf/QJokWzPehTZousP/MNifVSgjxNcDCkM5HI2K22TjQWUmmHUINSg==",
"dev": true,
"requires": {
"@typescript-eslint/utils": "5.12.0",
"@typescript-eslint/utils": "5.17.0",
"debug": "^4.3.2",
"tsutils": "^3.21.0"
}
},
"@typescript-eslint/types": {
"version": "5.12.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.12.0.tgz",
"integrity": "sha512-JowqbwPf93nvf8fZn5XrPGFBdIK8+yx5UEGs2QFAYFI8IWYfrzz+6zqlurGr2ctShMaJxqwsqmra3WXWjH1nRQ==",
"version": "5.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.17.0.tgz",
"integrity": "sha512-AgQ4rWzmCxOZLioFEjlzOI3Ch8giDWx8aUDxyNw9iOeCvD3GEYAB7dxWGQy4T/rPVe8iPmu73jPHuaSqcjKvxw==",
"dev": true
},
"@typescript-eslint/typescript-estree": {
"version": "5.12.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.12.0.tgz",
"integrity": "sha512-Dd9gVeOqt38QHR0BEA8oRaT65WYqPYbIc5tRFQPkfLquVEFPD1HAtbZT98TLBkEcCkvwDYOAvuSvAD9DnQhMfQ==",
"version": "5.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.17.0.tgz",
"integrity": "sha512-X1gtjEcmM7Je+qJRhq7ZAAaNXYhTgqMkR10euC4Si6PIjb+kwEQHSxGazXUQXFyqfEXdkGf6JijUu5R0uceQzg==",
"dev": true,
"requires": {
"@typescript-eslint/types": "5.12.0",
"@typescript-eslint/visitor-keys": "5.12.0",
"@typescript-eslint/types": "5.17.0",
"@typescript-eslint/visitor-keys": "5.17.0",
"debug": "^4.3.2",
"globby": "^11.0.4",
"is-glob": "^4.0.3",
@@ -1482,26 +1474,26 @@
}
},
"@typescript-eslint/utils": {
"version": "5.12.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.12.0.tgz",
"integrity": "sha512-k4J2WovnMPGI4PzKgDtQdNrCnmBHpMUFy21qjX2CoPdoBcSBIMvVBr9P2YDP8jOqZOeK3ThOL6VO/sy6jtnvzw==",
"version": "5.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.17.0.tgz",
"integrity": "sha512-DVvndq1QoxQH+hFv+MUQHrrWZ7gQ5KcJzyjhzcqB1Y2Xes1UQQkTRPUfRpqhS8mhTWsSb2+iyvDW1Lef5DD7vA==",
"dev": true,
"requires": {
"@types/json-schema": "^7.0.9",
"@typescript-eslint/scope-manager": "5.12.0",
"@typescript-eslint/types": "5.12.0",
"@typescript-eslint/typescript-estree": "5.12.0",
"@typescript-eslint/scope-manager": "5.17.0",
"@typescript-eslint/types": "5.17.0",
"@typescript-eslint/typescript-estree": "5.17.0",
"eslint-scope": "^5.1.1",
"eslint-utils": "^3.0.0"
}
},
"@typescript-eslint/visitor-keys": {
"version": "5.12.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.12.0.tgz",
"integrity": "sha512-cFwTlgnMV6TgezQynx2c/4/tx9Tufbuo9LPzmWqyRC3QC4qTGkAG1C6pBr0/4I10PAI/FlYunI3vJjIcu+ZHMg==",
"version": "5.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.17.0.tgz",
"integrity": "sha512-6K/zlc4OfCagUu7Am/BD5k8PSWQOgh34Nrv9Rxe2tBzlJ7uOeJ/h7ugCGDCeEZHT6k2CJBhbk9IsbkPI0uvUkA==",
"dev": true,
"requires": {
"@typescript-eslint/types": "5.12.0",
"@typescript-eslint/types": "5.17.0",
"eslint-visitor-keys": "^3.0.0"
}
},
@@ -2024,12 +2016,6 @@
"integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==",
"dev": true
},
"diff-sequences": {
"version": "27.4.0",
"resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.4.0.tgz",
"integrity": "sha512-YqiQzkrsmHMH5uuh8OdQFU9/ZpADnwzml8z0O5HvRNda+5UZsaX/xN+AAxfR2hWq1Y7HZnAzO9J5lJXOuDz2Ww==",
"dev": true
},
"dir-glob": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
@@ -2204,12 +2190,12 @@
}
},
"eslint": {
"version": "8.9.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.9.0.tgz",
"integrity": "sha512-PB09IGwv4F4b0/atrbcMFboF/giawbBLVC7fyDamk5Wtey4Jh2K+rYaBhCAbUyEI4QzB1ly09Uglc9iCtFaG2Q==",
"version": "8.11.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.11.0.tgz",
"integrity": "sha512-/KRpd9mIRg2raGxHRGwW9ZywYNAClZrHjdueHcrVDuO3a6bj83eoTirCCk0M0yPwOjWYKHwRVRid+xK4F/GHgA==",
"dev": true,
"requires": {
"@eslint/eslintrc": "^1.1.0",
"@eslint/eslintrc": "^1.2.1",
"@humanwhocodes/config-array": "^0.9.2",
"ajv": "^6.10.0",
"chalk": "^4.0.0",
@@ -2274,9 +2260,9 @@
}
},
"eslint-config-prettier": {
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz",
"integrity": "sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==",
"version": "8.5.0",
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz",
"integrity": "sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==",
"dev": true
},
"eslint-import-resolver-node": {
@@ -2369,9 +2355,9 @@
}
},
"eslint-plugin-jest": {
"version": "26.1.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-26.1.0.tgz",
"integrity": "sha512-vjF6RvcKm4xZSJgCmXb9fXmhzTva+I9jtj9Qv5JeZQTRocU7WT1g3Kx0cZ+00SekPe2DtSWDawHtSj4RaxFhXQ==",
"version": "26.1.3",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-26.1.3.tgz",
"integrity": "sha512-Pju+T7MFpo5VFhFlwrkK/9jRUu18r2iugvgyrWOnnGRaVTFFmFXp+xFJpHyqmjjLmGJPKLeEFLVTAxezkApcpQ==",
"dev": true,
"requires": {
"@typescript-eslint/utils": "^5.10.0"
@@ -2743,9 +2729,9 @@
}
},
"globals": {
"version": "13.12.1",
"resolved": "https://registry.npmjs.org/globals/-/globals-13.12.1.tgz",
"integrity": "sha512-317dFlgY2pdJZ9rspXDks7073GpDmXdfbM3vYYp0HAMKGDh1FfWPleI2ljVNLQX5M5lXcAslTcPTrOrMEFOjyw==",
"version": "13.13.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz",
"integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==",
"dev": true,
"requires": {
"type-fest": "^0.20.2"
@@ -3344,69 +3330,6 @@
}
}
},
"jest-diff": {
"version": "27.4.6",
"resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-27.4.6.tgz",
"integrity": "sha512-zjaB0sh0Lb13VyPsd92V7HkqF6yKRH9vm33rwBt7rPYrpQvS1nCvlIy2pICbKta+ZjWngYLNn4cCK4nyZkjS/w==",
"dev": true,
"requires": {
"chalk": "^4.0.0",
"diff-sequences": "^27.4.0",
"jest-get-type": "^27.4.0",
"pretty-format": "^27.4.6"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"jest-docblock": {
"version": "27.5.1",
"resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-27.5.1.tgz",
@@ -3547,12 +3470,6 @@
}
}
},
"jest-get-type": {
"version": "27.4.0",
"resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.4.0.tgz",
"integrity": "sha512-tk9o+ld5TWq41DkK14L4wox4s2D9MtTpKaAVzXfr5CUKm5ZK2ExcaFE0qls2W71zE/6R2TxxrK9w2r6svAFDBQ==",
"dev": true
},
"jest-haste-map": {
"version": "27.5.1",
"resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-27.5.1.tgz",
@@ -4886,9 +4803,9 @@
"dev": true
},
"prettier": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz",
"integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==",
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.1.tgz",
"integrity": "sha512-8UVbTBYGwN37Bs9LERmxCPjdvPxlEowx2urIL6urHzdb3SDq4B/Z6xLFCblrSnE4iKWcS6ziJ3aOYrc1kz/E2A==",
"dev": true
},
"prettier-linter-helpers": {
@@ -4901,9 +4818,9 @@
}
},
"pretty-format": {
"version": "27.4.6",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.4.6.tgz",
"integrity": "sha512-NblstegA1y/RJW2VyML+3LlpFjzx62cUrtBIKIWDXEDkjNeleA7Od7nrzcs/VLQvAeV4CgSYhrN39DRN88Qi/g==",
"version": "27.5.1",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz",
"integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==",
"dev": true,
"requires": {
"ansi-regex": "^5.0.1",
@@ -5318,9 +5235,9 @@
}
},
"ts-jest": {
"version": "27.1.3",
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-27.1.3.tgz",
"integrity": "sha512-6Nlura7s6uM9BVUAoqLH7JHyMXjz8gluryjpPXxr3IxZdAXnU6FhjvVLHFtfd1vsE1p8zD1OJfskkc0jhTSnkA==",
"version": "27.1.4",
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-27.1.4.tgz",
"integrity": "sha512-qjkZlVPWVctAezwsOD1OPzbZ+k7zA5z3oxII4dGdZo5ggX/PL7kvwTM0pXTr10fAtbiVpJaL3bWd502zAhpgSQ==",
"dev": true,
"requires": {
"bs-logger": "0.x",
+13 -13
View File
@@ -1,6 +1,6 @@
{
"name": "cache",
"version": "2.1.7",
"version": "3.0.2",
"private": true,
"description": "Cache dependencies and build outputs",
"main": "dist/restore/index.js",
@@ -23,29 +23,29 @@
"author": "GitHub",
"license": "MIT",
"dependencies": {
"@actions/cache": "^1.0.9",
"@actions/cache": "^2.0.1",
"@actions/core": "^1.2.6",
"@actions/exec": "^1.0.1",
"@actions/io": "^1.1.0"
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2"
},
"devDependencies": {
"@types/jest": "^27.4.0",
"@types/jest": "^27.4.1",
"@types/nock": "^11.1.0",
"@types/node": "^16.11.25",
"@typescript-eslint/eslint-plugin": "^5.12.0",
"@typescript-eslint/parser": "^5.12.0",
"@types/node": "^16.11.26",
"@typescript-eslint/eslint-plugin": "^5.16.0",
"@typescript-eslint/parser": "^5.16.0",
"@zeit/ncc": "^0.20.5",
"eslint": "^8.9.0",
"eslint-config-prettier": "^8.3.0",
"eslint": "^8.11.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jest": "^26.1.0",
"eslint-plugin-jest": "^26.1.3",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"jest": "^27.5.1",
"jest-circus": "^27.5.1",
"nock": "^11.7.0",
"prettier": "^2.5.1",
"ts-jest": "^27.1.3",
"prettier": "^2.6.1",
"ts-jest": "^27.1.4",
"typescript": "^3.9.9"
}
}
+1 -4
View File
@@ -6,10 +6,7 @@ import * as utils from "./utils/actionUtils";
async function run(): Promise<void> {
try {
if (utils.isGhes()) {
utils.logWarning(
"Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details"
);
if (!utils.isCacheFeatureAvailable()) {
utils.setCacheHitOutput(false);
return;
}
+1 -4
View File
@@ -11,10 +11,7 @@ process.on("uncaughtException", e => utils.logWarning(e.message));
async function run(): Promise<void> {
try {
if (utils.isGhes()) {
utils.logWarning(
"Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details"
);
if (!utils.isCacheFeatureAvailable()) {
return;
}
+18
View File
@@ -1,3 +1,4 @@
import * as cache from "@actions/cache";
import * as core from "@actions/core";
import { Outputs, RefKey, State } from "../constants";
@@ -74,3 +75,20 @@ export function getInputAsInt(
}
return value;
}
export function isCacheFeatureAvailable(): boolean {
if (!cache.isFeatureAvailable()) {
if (isGhes()) {
logWarning(
"Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not."
);
} else {
logWarning(
"An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions."
);
}
return false;
}
return true;
}