@azure/storage-blob
Advanced tools
Comparing version 12.4.0-beta.1 to 12.4.0
# Release History | ||
## 12.4.0 (2021-01-12) | ||
- Added a new `from(permissionLike)` function to `AccountSASPermissions`, `BlobSASPermissions` and `ContainerSASPermissions` for creating such a permission from a raw permission-like object. Addressed issue [9714](https://github.com/Azure/azure-sdk-for-js/issues/9714). | ||
## 12.4.0-beta.1 (2020-12-09) | ||
@@ -4,0 +8,0 @@ |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=BatchResponse.js.map |
@@ -470,3 +470,3 @@ import { __assign, __asyncDelegator, __asyncGenerator, __asyncValues, __await, __awaiter, __extends, __generator, __values } from "tslib"; | ||
var _a; | ||
var tagValue = undefined; | ||
var tagValue = ""; | ||
if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { | ||
@@ -473,0 +473,0 @@ tagValue = blob.tags.blobTagSet[0].value; |
@@ -8,2 +8,3 @@ /* | ||
*/ | ||
export {}; | ||
//# sourceMappingURL=index.js.map |
@@ -13,3 +13,3 @@ /* | ||
var packageName = "azure-storage-blob"; | ||
var packageVersion = "12.4.0-beta.1"; | ||
var packageVersion = "12.4.0"; | ||
var StorageClientContext = /** @class */ (function (_super) { | ||
@@ -16,0 +16,0 @@ __extends(StorageClientContext, _super); |
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
export {}; | ||
//# sourceMappingURL=generatedModels.js.map |
@@ -14,3 +14,2 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
* @param {StorageRetryOptions} retryOptions | ||
* @returns | ||
*/ | ||
@@ -17,0 +16,0 @@ export function NewRetryPolicyFactory(retryOptions) { |
@@ -10,3 +10,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
* | ||
* @ignore | ||
* @hidden | ||
*/ | ||
@@ -42,3 +42,3 @@ var BlobBeginCopyFromUrlPoller = /** @class */ (function (_super) { | ||
* This affects what `this` refers to. | ||
* @ignore | ||
* @hidden | ||
*/ | ||
@@ -78,3 +78,3 @@ var cancel = function cancel(options) { | ||
* This affects what `this` refers to. | ||
* @ignore | ||
* @hidden | ||
*/ | ||
@@ -144,3 +144,3 @@ var update = function update(options) { | ||
* This affects what `this` refers to. | ||
* @ignore | ||
* @hidden | ||
*/ | ||
@@ -158,3 +158,3 @@ var toString = function toString() { | ||
* Creates a poll operation given the provided state. | ||
* @ignore | ||
* @hidden | ||
*/ | ||
@@ -161,0 +161,0 @@ function makeBlobBeginCopyFromURLPollOperation(state) { |
@@ -148,2 +148,48 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
/** | ||
* Creates a {@link AccountSASPermissions} from a raw object which contains same keys as it | ||
* and boolean values for them. | ||
* | ||
* @static | ||
* @param {AccountSASPermissionsLike} permissionLike | ||
* @returns {AccountSASPermissions} | ||
* @memberof AccountSASPermissions | ||
*/ | ||
AccountSASPermissions.from = function (permissionLike) { | ||
var accountSASPermissions = new AccountSASPermissions(); | ||
if (permissionLike.read) { | ||
accountSASPermissions.read = true; | ||
} | ||
if (permissionLike.write) { | ||
accountSASPermissions.write = true; | ||
} | ||
if (permissionLike.delete) { | ||
accountSASPermissions.delete = true; | ||
} | ||
if (permissionLike.deleteVersion) { | ||
accountSASPermissions.deleteVersion = true; | ||
} | ||
if (permissionLike.filter) { | ||
accountSASPermissions.filter = true; | ||
} | ||
if (permissionLike.tag) { | ||
accountSASPermissions.tag = true; | ||
} | ||
if (permissionLike.list) { | ||
accountSASPermissions.list = true; | ||
} | ||
if (permissionLike.add) { | ||
accountSASPermissions.add = true; | ||
} | ||
if (permissionLike.create) { | ||
accountSASPermissions.create = true; | ||
} | ||
if (permissionLike.update) { | ||
accountSASPermissions.update = true; | ||
} | ||
if (permissionLike.process) { | ||
accountSASPermissions.process = true; | ||
} | ||
return accountSASPermissions; | ||
}; | ||
/** | ||
* Produces the SAS permissions string for an Azure Storage account. | ||
@@ -150,0 +196,0 @@ * Call this method to set AccountSASSignatureValues Permissions field. |
@@ -129,2 +129,42 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
/** | ||
* Creates a {@link BlobSASPermissions} from a raw object which contains same keys as it | ||
* and boolean values for them. | ||
* | ||
* @static | ||
* @param {BlobSASPermissionsLike} permissionLike | ||
* @returns {BlobSASPermissions} | ||
* @memberof BlobSASPermissions | ||
*/ | ||
BlobSASPermissions.from = function (permissionLike) { | ||
var blobSASPermissions = new BlobSASPermissions(); | ||
if (permissionLike.read) { | ||
blobSASPermissions.read = true; | ||
} | ||
if (permissionLike.add) { | ||
blobSASPermissions.add = true; | ||
} | ||
if (permissionLike.create) { | ||
blobSASPermissions.create = true; | ||
} | ||
if (permissionLike.write) { | ||
blobSASPermissions.write = true; | ||
} | ||
if (permissionLike.delete) { | ||
blobSASPermissions.delete = true; | ||
} | ||
if (permissionLike.deleteVersion) { | ||
blobSASPermissions.deleteVersion = true; | ||
} | ||
if (permissionLike.tag) { | ||
blobSASPermissions.tag = true; | ||
} | ||
if (permissionLike.move) { | ||
blobSASPermissions.move = true; | ||
} | ||
if (permissionLike.execute) { | ||
blobSASPermissions.execute = true; | ||
} | ||
return blobSASPermissions; | ||
}; | ||
/** | ||
* Converts the given permissions to a string. Using this method will guarantee the permissions are in an | ||
@@ -131,0 +171,0 @@ * order accepted by the service. |
@@ -70,4 +70,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
if (!blobSASSignatureValues.identifier && | ||
!blobSASSignatureValues.permissions && | ||
!blobSASSignatureValues.expiresOn) { | ||
!(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) { | ||
throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided."); | ||
@@ -132,4 +131,3 @@ } | ||
if (!blobSASSignatureValues.identifier && | ||
!blobSASSignatureValues.permissions && | ||
!blobSASSignatureValues.expiresOn) { | ||
!(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) { | ||
throw new RangeError("Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided."); | ||
@@ -136,0 +134,0 @@ } |
@@ -137,2 +137,45 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
/** | ||
* Creates a {@link ContainerSASPermissions} from a raw object which contains same keys as it | ||
* and boolean values for them. | ||
* | ||
* @static | ||
* @param {ContainerSASPermissionsLike} permissionLike | ||
* @returns {ContainerSASPermissions} | ||
* @memberof ContainerSASPermissions | ||
*/ | ||
ContainerSASPermissions.from = function (permissionLike) { | ||
var containerSASPermissions = new ContainerSASPermissions(); | ||
if (permissionLike.read) { | ||
containerSASPermissions.read = true; | ||
} | ||
if (permissionLike.add) { | ||
containerSASPermissions.add = true; | ||
} | ||
if (permissionLike.create) { | ||
containerSASPermissions.create = true; | ||
} | ||
if (permissionLike.write) { | ||
containerSASPermissions.write = true; | ||
} | ||
if (permissionLike.delete) { | ||
containerSASPermissions.delete = true; | ||
} | ||
if (permissionLike.list) { | ||
containerSASPermissions.list = true; | ||
} | ||
if (permissionLike.deleteVersion) { | ||
containerSASPermissions.deleteVersion = true; | ||
} | ||
if (permissionLike.tag) { | ||
containerSASPermissions.tag = true; | ||
} | ||
if (permissionLike.move) { | ||
containerSASPermissions.move = true; | ||
} | ||
if (permissionLike.execute) { | ||
containerSASPermissions.execute = true; | ||
} | ||
return containerSASPermissions; | ||
}; | ||
/** | ||
* Converts the given permissions to a string. Using this method will guarantee the permissions are in an | ||
@@ -139,0 +182,0 @@ * order accepted by the service. |
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
import { __asyncValues, __awaiter, __extends, __generator } from "tslib"; | ||
import { __awaiter, __extends, __generator } from "tslib"; | ||
import { Readable } from "stream"; | ||
@@ -26,2 +26,3 @@ import { AvroReadableFromStream, AvroReader } from "../../../storage-internal-avro/src"; | ||
var _this = _super.call(this) || this; | ||
_this.avroPaused = true; | ||
_this.source = source; | ||
@@ -36,20 +37,23 @@ _this.onProgress = options.onProgress; | ||
var _this = this; | ||
this.readInternal().catch(function (err) { | ||
_this.emit("error", err); | ||
}); | ||
if (this.avroPaused) { | ||
this.readInternal().catch(function (err) { | ||
_this.emit("error", err); | ||
}); | ||
} | ||
}; | ||
BlobQuickQueryStream.prototype.readInternal = function () { | ||
var e_1, _a; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _b, _c, obj, schema, exit, data, bytesScanned, totalBytes, fatal, name_1, description, position, e_1_1; | ||
return __generator(this, function (_d) { | ||
switch (_d.label) { | ||
var avroNext, obj, schema, data, bytesScanned, totalBytes, fatal, name_1, description, position; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
_d.trys.push([0, 5, 6, 11]); | ||
_b = __asyncValues(this.avroIter); | ||
_d.label = 1; | ||
case 1: return [4 /*yield*/, _b.next()]; | ||
this.avroPaused = false; | ||
_a.label = 1; | ||
case 1: return [4 /*yield*/, this.avroIter.next()]; | ||
case 2: | ||
if (!(_c = _d.sent(), !_c.done)) return [3 /*break*/, 4]; | ||
obj = _c.value; | ||
avroNext = _a.sent(); | ||
if (avroNext.done) { | ||
return [3 /*break*/, 4]; | ||
} | ||
obj = avroNext.value; | ||
schema = obj.$schema; | ||
@@ -59,3 +63,2 @@ if (typeof schema !== "string") { | ||
} | ||
exit = false; | ||
switch (schema) { | ||
@@ -68,3 +71,3 @@ case "com.microsoft.azure.storage.queryBlobContents.resultData": | ||
if (!this.push(Buffer.from(data))) { | ||
exit = true; | ||
this.avroPaused = true; | ||
} | ||
@@ -120,25 +123,7 @@ break; | ||
} | ||
if (exit) { | ||
return [3 /*break*/, 4]; | ||
} | ||
_d.label = 3; | ||
case 3: return [3 /*break*/, 1]; | ||
case 4: return [3 /*break*/, 11]; | ||
case 5: | ||
e_1_1 = _d.sent(); | ||
e_1 = { error: e_1_1 }; | ||
return [3 /*break*/, 11]; | ||
case 6: | ||
_d.trys.push([6, , 9, 10]); | ||
if (!(_c && !_c.done && (_a = _b.return))) return [3 /*break*/, 8]; | ||
return [4 /*yield*/, _a.call(_b)]; | ||
case 7: | ||
_d.sent(); | ||
_d.label = 8; | ||
case 8: return [3 /*break*/, 10]; | ||
case 9: | ||
if (e_1) throw e_1.error; | ||
return [7 /*endfinally*/]; | ||
case 10: return [7 /*endfinally*/]; | ||
case 11: return [2 /*return*/]; | ||
_a.label = 3; | ||
case 3: | ||
if (!avroNext.done && !this.avroPaused) return [3 /*break*/, 1]; | ||
_a.label = 4; | ||
case 4: return [2 /*return*/]; | ||
} | ||
@@ -145,0 +130,0 @@ }); |
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
export var SDK_VERSION = "12.4.0-beta.1"; | ||
export var SDK_VERSION = "12.4.0"; | ||
export var SERVICE_VERSION = "2020-04-08"; | ||
@@ -5,0 +5,0 @@ export var BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB |
{ | ||
"name": "@azure/storage-blob", | ||
"sdk-type": "client", | ||
"version": "12.4.0-beta.1", | ||
"version": "12.4.0", | ||
"description": "Microsoft Azure Storage SDK for JavaScript - Blob", | ||
@@ -30,3 +30,3 @@ "main": "./dist/index.js", | ||
}, | ||
"engine": { | ||
"engines": { | ||
"node": ">=8.0.0" | ||
@@ -36,6 +36,6 @@ }, | ||
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", | ||
"build:autorest": "autorest ./swagger/README.md --typescript --package-version=12.4.0-beta.1 --use=@microsoft.azure/autorest.typescript@5.0.1", | ||
"build:autorest": "autorest ./swagger/README.md --typescript --package-version=12.4.0 --use=@microsoft.azure/autorest.typescript@5.0.1", | ||
"build:es6": "tsc -p tsconfig.json", | ||
"build:nodebrowser": "rollup -c 2>&1", | ||
"build:samples": "npm run clean && npm run build:es6 && cross-env ONLY_NODE=true rollup -c 2>&1 && npm run build:prep-samples", | ||
"build:samples": "npm run clean && cross-env ONLY_NODE=true npm run build && npm run build:prep-samples", | ||
"build:prep-samples": "dev-tool samples prep && cd dist-samples && tsc", | ||
@@ -64,3 +64,4 @@ "build:test": "npm run build:es6 && rollup -c rollup.test.config.js 2>&1", | ||
"unit-test": "npm run unit-test:node && npm run unit-test:browser", | ||
"emulator-tests": "cross-env STORAGE_CONNECTION_STRING=UseDevelopmentStorage=true && npm run test:node" | ||
"emulator-tests": "cross-env STORAGE_CONNECTION_STRING=UseDevelopmentStorage=true && npm run test:node", | ||
"docs": "typedoc --excludePrivate --excludeNotExported --excludeExternals --mode file --out ./dist/docs ./src" | ||
}, | ||
@@ -78,10 +79,8 @@ "files": [ | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/Azure/azure-sdk-for-js.git" | ||
}, | ||
"repository": "github:Azure/azure-sdk-for-js", | ||
"keywords": [ | ||
"azure", | ||
"atorage", | ||
"alob", | ||
"storage", | ||
"blob", | ||
"cloud", | ||
"node.js", | ||
@@ -97,3 +96,3 @@ "typescript", | ||
}, | ||
"homepage": "https://github.com/Azure/azure-sdk-for-js#readme", | ||
"homepage": "https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/storage/storage-blob/", | ||
"sideEffects": false, | ||
@@ -151,3 +150,3 @@ "//metadata": { | ||
"es6-promise": "^4.2.5", | ||
"eslint": "^6.1.0", | ||
"eslint": "^7.15.0", | ||
"esm": "^3.2.18", | ||
@@ -183,5 +182,6 @@ "inherits": "^2.0.3", | ||
"ts-node": "^8.3.0", | ||
"typescript": "~3.9.3", | ||
"util": "^0.12.1" | ||
"typescript": "4.1.2", | ||
"util": "^0.12.1", | ||
"typedoc": "0.15.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
6296767
77153
0
7
7
5
166
49
3