@azure/storage-blob 12.9.0-alpha.20220128.2 → 12.9.0-alpha.20220302.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -2
- package/dist/index.js +333 -14
- package/dist/index.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobServiceClient.js.map +1 -1
- package/dist-esm/storage-blob/src/Clients.js +7 -5
- package/dist-esm/storage-blob/src/Clients.js.map +1 -1
- package/dist-esm/storage-blob/src/ContainerClient.js +201 -0
- package/dist-esm/storage-blob/src/ContainerClient.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/models/index.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/models/mappers.js +53 -0
- package/dist-esm/storage-blob/src/generated/src/models/mappers.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/models/parameters.js +2 -3
- package/dist-esm/storage-blob/src/generated/src/models/parameters.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/operations/container.js +41 -0
- package/dist-esm/storage-blob/src/generated/src/operations/container.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/storageClientContext.js +2 -2
- package/dist-esm/storage-blob/src/generated/src/storageClientContext.js.map +1 -1
- package/dist-esm/storage-blob/src/generatedModels.js.map +1 -1
- package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.js +3 -1
- package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.js.map +1 -1
- package/dist-esm/storage-blob/src/sas/BlobSASSignatureValues.js +5 -0
- package/dist-esm/storage-blob/src/sas/BlobSASSignatureValues.js.map +1 -1
- package/dist-esm/storage-blob/src/sas/ContainerSASPermissions.js +13 -0
- package/dist-esm/storage-blob/src/sas/ContainerSASPermissions.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/constants.js +3 -2
- package/dist-esm/storage-blob/src/utils/constants.js.map +1 -1
- package/package.json +1 -1
- package/types/3.1/storage-blob.d.ts +174 -0
- package/types/latest/storage-blob.d.ts +177 -0
package/CHANGELOG.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Release History
|
2
2
|
|
3
|
-
## 12.9.0-beta.
|
3
|
+
## 12.9.0-beta.4 (Unreleased)
|
4
4
|
|
5
5
|
### Features Added
|
6
6
|
|
@@ -8,10 +8,21 @@
|
|
8
8
|
|
9
9
|
### Bugs Fixed
|
10
10
|
|
11
|
-
-
|
11
|
+
- Set correct content length in requests for uploading operations to avoid unexpected failure if customized content length is incorrect.
|
12
12
|
|
13
13
|
### Other Changes
|
14
14
|
|
15
|
+
## 12.9.0-beta.3 (2022-02-11)
|
16
|
+
|
17
|
+
### Features Added
|
18
|
+
|
19
|
+
- Added support for service version 2021-04-10.
|
20
|
+
- Added support for finding blobs by tags in a container.
|
21
|
+
|
22
|
+
### Bugs Fixed
|
23
|
+
|
24
|
+
- Fixed a bug where customized `ProxyOptions` is overwrited by a default one when initializing `BlobServiceClient`, `BlobClient`, `AppendBlobClient`, `BlockBlobClient`, `PageBlobClient` or `ContainerClient` with connection string.
|
25
|
+
|
15
26
|
## 12.9.0-beta.2 (2021-12-03)
|
16
27
|
|
17
28
|
### Features Added
|
package/dist/index.js
CHANGED
@@ -3164,6 +3164,59 @@ const ContainerSubmitBatchExceptionHeaders = {
|
|
3164
3164
|
}
|
3165
3165
|
}
|
3166
3166
|
};
|
3167
|
+
const ContainerFilterBlobsHeaders = {
|
3168
|
+
serializedName: "Container_filterBlobsHeaders",
|
3169
|
+
type: {
|
3170
|
+
name: "Composite",
|
3171
|
+
className: "ContainerFilterBlobsHeaders",
|
3172
|
+
modelProperties: {
|
3173
|
+
clientRequestId: {
|
3174
|
+
serializedName: "x-ms-client-request-id",
|
3175
|
+
xmlName: "x-ms-client-request-id",
|
3176
|
+
type: {
|
3177
|
+
name: "String"
|
3178
|
+
}
|
3179
|
+
},
|
3180
|
+
requestId: {
|
3181
|
+
serializedName: "x-ms-request-id",
|
3182
|
+
xmlName: "x-ms-request-id",
|
3183
|
+
type: {
|
3184
|
+
name: "String"
|
3185
|
+
}
|
3186
|
+
},
|
3187
|
+
version: {
|
3188
|
+
serializedName: "x-ms-version",
|
3189
|
+
xmlName: "x-ms-version",
|
3190
|
+
type: {
|
3191
|
+
name: "String"
|
3192
|
+
}
|
3193
|
+
},
|
3194
|
+
date: {
|
3195
|
+
serializedName: "date",
|
3196
|
+
xmlName: "date",
|
3197
|
+
type: {
|
3198
|
+
name: "DateTimeRfc1123"
|
3199
|
+
}
|
3200
|
+
}
|
3201
|
+
}
|
3202
|
+
}
|
3203
|
+
};
|
3204
|
+
const ContainerFilterBlobsExceptionHeaders = {
|
3205
|
+
serializedName: "Container_filterBlobsExceptionHeaders",
|
3206
|
+
type: {
|
3207
|
+
name: "Composite",
|
3208
|
+
className: "ContainerFilterBlobsExceptionHeaders",
|
3209
|
+
modelProperties: {
|
3210
|
+
errorCode: {
|
3211
|
+
serializedName: "x-ms-error-code",
|
3212
|
+
xmlName: "x-ms-error-code",
|
3213
|
+
type: {
|
3214
|
+
name: "String"
|
3215
|
+
}
|
3216
|
+
}
|
3217
|
+
}
|
3218
|
+
}
|
3219
|
+
};
|
3167
3220
|
const ContainerAcquireLeaseHeaders = {
|
3168
3221
|
serializedName: "Container_acquireLeaseHeaders",
|
3169
3222
|
type: {
|
@@ -8248,6 +8301,8 @@ var Mappers = /*#__PURE__*/Object.freeze({
|
|
8248
8301
|
ContainerRenameExceptionHeaders: ContainerRenameExceptionHeaders,
|
8249
8302
|
ContainerSubmitBatchHeaders: ContainerSubmitBatchHeaders,
|
8250
8303
|
ContainerSubmitBatchExceptionHeaders: ContainerSubmitBatchExceptionHeaders,
|
8304
|
+
ContainerFilterBlobsHeaders: ContainerFilterBlobsHeaders,
|
8305
|
+
ContainerFilterBlobsExceptionHeaders: ContainerFilterBlobsExceptionHeaders,
|
8251
8306
|
ContainerAcquireLeaseHeaders: ContainerAcquireLeaseHeaders,
|
8252
8307
|
ContainerAcquireLeaseExceptionHeaders: ContainerAcquireLeaseExceptionHeaders,
|
8253
8308
|
ContainerReleaseLeaseHeaders: ContainerReleaseLeaseHeaders,
|
@@ -8435,7 +8490,7 @@ const timeoutInSeconds = {
|
|
8435
8490
|
const version = {
|
8436
8491
|
parameterPath: "version",
|
8437
8492
|
mapper: {
|
8438
|
-
defaultValue: "2021-
|
8493
|
+
defaultValue: "2021-04-10",
|
8439
8494
|
isConstant: true,
|
8440
8495
|
serializedName: "x-ms-version",
|
8441
8496
|
type: {
|
@@ -9054,8 +9109,7 @@ const encryptionKeySha256 = {
|
|
9054
9109
|
const encryptionAlgorithm = {
|
9055
9110
|
parameterPath: ["options", "encryptionAlgorithm"],
|
9056
9111
|
mapper: {
|
9057
|
-
|
9058
|
-
isConstant: true,
|
9112
|
+
isConstant: false,
|
9059
9113
|
serializedName: "x-ms-encryption-algorithm",
|
9060
9114
|
type: {
|
9061
9115
|
name: "String"
|
@@ -10060,7 +10114,7 @@ class Service {
|
|
10060
10114
|
const operationArguments = {
|
10061
10115
|
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
|
10062
10116
|
};
|
10063
|
-
return this.client.sendOperationRequest(operationArguments, filterBlobsOperationSpec);
|
10117
|
+
return this.client.sendOperationRequest(operationArguments, filterBlobsOperationSpec$1);
|
10064
10118
|
}
|
10065
10119
|
}
|
10066
10120
|
// Operation Specifications
|
@@ -10260,7 +10314,7 @@ const submitBatchOperationSpec$1 = {
|
|
10260
10314
|
mediaType: "xml",
|
10261
10315
|
serializer: xmlSerializer$5
|
10262
10316
|
};
|
10263
|
-
const filterBlobsOperationSpec = {
|
10317
|
+
const filterBlobsOperationSpec$1 = {
|
10264
10318
|
path: "/",
|
10265
10319
|
httpMethod: "GET",
|
10266
10320
|
responses: {
|
@@ -10410,6 +10464,17 @@ class Container {
|
|
10410
10464
|
};
|
10411
10465
|
return this.client.sendOperationRequest(operationArguments, submitBatchOperationSpec);
|
10412
10466
|
}
|
10467
|
+
/**
|
10468
|
+
* The Filter Blobs operation enables callers to list blobs in a container whose tags match a given
|
10469
|
+
* search expression. Filter blobs searches within the given container.
|
10470
|
+
* @param options The options parameters.
|
10471
|
+
*/
|
10472
|
+
filterBlobs(options) {
|
10473
|
+
const operationArguments = {
|
10474
|
+
options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})
|
10475
|
+
};
|
10476
|
+
return this.client.sendOperationRequest(operationArguments, filterBlobsOperationSpec);
|
10477
|
+
}
|
10413
10478
|
/**
|
10414
10479
|
* [Update] establishes and manages a lock on a container for delete operations. The lock duration can
|
10415
10480
|
* be 15 to 60 seconds, or can be infinite
|
@@ -10781,6 +10846,36 @@ const submitBatchOperationSpec = {
|
|
10781
10846
|
mediaType: "xml",
|
10782
10847
|
serializer: xmlSerializer$4
|
10783
10848
|
};
|
10849
|
+
const filterBlobsOperationSpec = {
|
10850
|
+
path: "/{containerName}",
|
10851
|
+
httpMethod: "GET",
|
10852
|
+
responses: {
|
10853
|
+
200: {
|
10854
|
+
bodyMapper: FilterBlobSegment,
|
10855
|
+
headersMapper: ContainerFilterBlobsHeaders
|
10856
|
+
},
|
10857
|
+
default: {
|
10858
|
+
bodyMapper: StorageError,
|
10859
|
+
headersMapper: ContainerFilterBlobsExceptionHeaders
|
10860
|
+
}
|
10861
|
+
},
|
10862
|
+
queryParameters: [
|
10863
|
+
timeoutInSeconds,
|
10864
|
+
marker,
|
10865
|
+
maxPageSize,
|
10866
|
+
comp5,
|
10867
|
+
where,
|
10868
|
+
restype2
|
10869
|
+
],
|
10870
|
+
urlParameters: [url],
|
10871
|
+
headerParameters: [
|
10872
|
+
version,
|
10873
|
+
requestId,
|
10874
|
+
accept1
|
10875
|
+
],
|
10876
|
+
isXML: true,
|
10877
|
+
serializer: xmlSerializer$4
|
10878
|
+
};
|
10784
10879
|
const acquireLeaseOperationSpec$1 = {
|
10785
10880
|
path: "/{containerName}",
|
10786
10881
|
httpMethod: "PUT",
|
@@ -13206,8 +13301,8 @@ const logger = logger$1.createClientLogger("storage-blob");
|
|
13206
13301
|
|
13207
13302
|
// Copyright (c) Microsoft Corporation.
|
13208
13303
|
// Licensed under the MIT license.
|
13209
|
-
const SDK_VERSION = "12.9.0-beta.
|
13210
|
-
const SERVICE_VERSION = "2021-
|
13304
|
+
const SDK_VERSION = "12.9.0-beta.4";
|
13305
|
+
const SERVICE_VERSION = "2021-04-10";
|
13211
13306
|
const BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB
|
13212
13307
|
const BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB
|
13213
13308
|
const BLOCK_BLOB_MAX_BLOCKS = 50000;
|
@@ -13399,6 +13494,7 @@ const StorageBlobLoggingAllowedQueryParameters = [
|
|
13399
13494
|
"skv",
|
13400
13495
|
"snapshot",
|
13401
13496
|
];
|
13497
|
+
const BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption";
|
13402
13498
|
|
13403
13499
|
// Copyright (c) Microsoft Corporation.
|
13404
13500
|
/**
|
@@ -14746,7 +14842,9 @@ class StorageSharedKeyCredentialPolicy extends CredentialPolicy {
|
|
14746
14842
|
*/
|
14747
14843
|
signRequest(request) {
|
14748
14844
|
request.headers.set(HeaderConstants.X_MS_DATE, new Date().toUTCString());
|
14749
|
-
if (request.body &&
|
14845
|
+
if (request.body &&
|
14846
|
+
(typeof request.body === "string" || request.body !== undefined) &&
|
14847
|
+
request.body.length > 0) {
|
14750
14848
|
request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body));
|
14751
14849
|
}
|
14752
14850
|
const stringToSign = [
|
@@ -14902,7 +15000,7 @@ class StorageSharedKeyCredential extends Credential {
|
|
14902
15000
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
14903
15001
|
*/
|
14904
15002
|
const packageName = "azure-storage-blob";
|
14905
|
-
const packageVersion = "12.9.0-beta.
|
15003
|
+
const packageVersion = "12.9.0-beta.4";
|
14906
15004
|
class StorageClientContext extends coreHttp__namespace.ServiceClient {
|
14907
15005
|
/**
|
14908
15006
|
* Initializes a new instance of the StorageClientContext class.
|
@@ -14928,7 +15026,7 @@ class StorageClientContext extends coreHttp__namespace.ServiceClient {
|
|
14928
15026
|
// Parameter assignments
|
14929
15027
|
this.url = url;
|
14930
15028
|
// Assigning values to Constant parameters
|
14931
|
-
this.version = options.version || "2021-
|
15029
|
+
this.version = options.version || "2021-04-10";
|
14932
15030
|
}
|
14933
15031
|
}
|
14934
15032
|
|
@@ -15247,6 +15345,10 @@ class ContainerSASPermissions {
|
|
15247
15345
|
* Specifies that Permanent Delete is permitted.
|
15248
15346
|
*/
|
15249
15347
|
this.permanentDelete = false;
|
15348
|
+
/**
|
15349
|
+
* Specifies that Filter Blobs by Tags is permitted.
|
15350
|
+
*/
|
15351
|
+
this.filterByTags = false;
|
15250
15352
|
}
|
15251
15353
|
/**
|
15252
15354
|
* Creates an {@link ContainerSASPermissions} from the specified permissions string. This method will throw an
|
@@ -15294,6 +15396,9 @@ class ContainerSASPermissions {
|
|
15294
15396
|
case "y":
|
15295
15397
|
containerSASPermissions.permanentDelete = true;
|
15296
15398
|
break;
|
15399
|
+
case "f":
|
15400
|
+
containerSASPermissions.filterByTags = true;
|
15401
|
+
break;
|
15297
15402
|
default:
|
15298
15403
|
throw new RangeError(`Invalid permission ${char}`);
|
15299
15404
|
}
|
@@ -15344,6 +15449,9 @@ class ContainerSASPermissions {
|
|
15344
15449
|
if (permissionLike.permanentDelete) {
|
15345
15450
|
containerSASPermissions.permanentDelete = true;
|
15346
15451
|
}
|
15452
|
+
if (permissionLike.filterByTags) {
|
15453
|
+
containerSASPermissions.filterByTags = true;
|
15454
|
+
}
|
15347
15455
|
return containerSASPermissions;
|
15348
15456
|
}
|
15349
15457
|
/**
|
@@ -15392,6 +15500,9 @@ class ContainerSASPermissions {
|
|
15392
15500
|
if (this.permanentDelete) {
|
15393
15501
|
permissions.push("y");
|
15394
15502
|
}
|
15503
|
+
if (this.filterByTags) {
|
15504
|
+
permissions.push("f");
|
15505
|
+
}
|
15395
15506
|
return permissions.join("");
|
15396
15507
|
}
|
15397
15508
|
}
|
@@ -16199,6 +16310,11 @@ function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) {
|
|
16199
16310
|
(blobSASSignatureValues.permissions.move || blobSASSignatureValues.permissions.execute)) {
|
16200
16311
|
throw RangeError("'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission.");
|
16201
16312
|
}
|
16313
|
+
if (version < "2021-04-10" &&
|
16314
|
+
blobSASSignatureValues.permissions &&
|
16315
|
+
blobSASSignatureValues.permissions.filterByTags) {
|
16316
|
+
throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission.");
|
16317
|
+
}
|
16202
16318
|
if (version < "2020-02-10" &&
|
16203
16319
|
(blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) {
|
16204
16320
|
throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'.");
|
@@ -19154,12 +19270,14 @@ class BlobClient extends StorageClient {
|
|
19154
19270
|
}
|
19155
19271
|
catch (e) {
|
19156
19272
|
if (e.statusCode === 404) {
|
19157
|
-
|
19158
|
-
code: coreTracing.SpanStatusCode.ERROR,
|
19159
|
-
message: "Expected exception when checking blob existence",
|
19160
|
-
});
|
19273
|
+
// Expected exception when checking blob existence
|
19161
19274
|
return false;
|
19162
19275
|
}
|
19276
|
+
else if (e.statusCode === 409 &&
|
19277
|
+
e.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg) {
|
19278
|
+
// Expected exception when checking blob existence
|
19279
|
+
return true;
|
19280
|
+
}
|
19163
19281
|
span.setStatus({
|
19164
19282
|
code: coreTracing.SpanStatusCode.ERROR,
|
19165
19283
|
message: e.message,
|
@@ -22844,6 +22962,207 @@ class ContainerClient extends StorageClient {
|
|
22844
22962
|
},
|
22845
22963
|
};
|
22846
22964
|
}
|
22965
|
+
/**
|
22966
|
+
* The Filter Blobs operation enables callers to list blobs in the container whose tags
|
22967
|
+
* match a given search expression.
|
22968
|
+
*
|
22969
|
+
* @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
|
22970
|
+
* The given expression must evaluate to true for a blob to be returned in the results.
|
22971
|
+
* The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
|
22972
|
+
* however, only a subset of the OData filter syntax is supported in the Blob service.
|
22973
|
+
* @param marker - A string value that identifies the portion of
|
22974
|
+
* the list of blobs to be returned with the next listing operation. The
|
22975
|
+
* operation returns the continuationToken value within the response body if the
|
22976
|
+
* listing operation did not return all blobs remaining to be listed
|
22977
|
+
* with the current page. The continuationToken value can be used as the value for
|
22978
|
+
* the marker parameter in a subsequent call to request the next page of list
|
22979
|
+
* items. The marker value is opaque to the client.
|
22980
|
+
* @param options - Options to find blobs by tags.
|
22981
|
+
*/
|
22982
|
+
async findBlobsByTagsSegment(tagFilterSqlExpression, marker, options = {}) {
|
22983
|
+
const { span, updatedOptions } = createSpan("ContainerClient-findBlobsByTagsSegment", options);
|
22984
|
+
try {
|
22985
|
+
const response = await this.containerContext.filterBlobs(Object.assign({ abortSignal: options.abortSignal, where: tagFilterSqlExpression, marker, maxPageSize: options.maxPageSize }, convertTracingToRequestOptionsBase(updatedOptions)));
|
22986
|
+
const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => {
|
22987
|
+
var _a;
|
22988
|
+
let tagValue = "";
|
22989
|
+
if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) {
|
22990
|
+
tagValue = blob.tags.blobTagSet[0].value;
|
22991
|
+
}
|
22992
|
+
return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue });
|
22993
|
+
}) });
|
22994
|
+
return wrappedResponse;
|
22995
|
+
}
|
22996
|
+
catch (e) {
|
22997
|
+
span.setStatus({
|
22998
|
+
code: coreTracing.SpanStatusCode.ERROR,
|
22999
|
+
message: e.message,
|
23000
|
+
});
|
23001
|
+
throw e;
|
23002
|
+
}
|
23003
|
+
finally {
|
23004
|
+
span.end();
|
23005
|
+
}
|
23006
|
+
}
|
23007
|
+
/**
|
23008
|
+
* Returns an AsyncIterableIterator for ContainerFindBlobsByTagsSegmentResponse.
|
23009
|
+
*
|
23010
|
+
* @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
|
23011
|
+
* The given expression must evaluate to true for a blob to be returned in the results.
|
23012
|
+
* The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
|
23013
|
+
* however, only a subset of the OData filter syntax is supported in the Blob service.
|
23014
|
+
* @param marker - A string value that identifies the portion of
|
23015
|
+
* the list of blobs to be returned with the next listing operation. The
|
23016
|
+
* operation returns the continuationToken value within the response body if the
|
23017
|
+
* listing operation did not return all blobs remaining to be listed
|
23018
|
+
* with the current page. The continuationToken value can be used as the value for
|
23019
|
+
* the marker parameter in a subsequent call to request the next page of list
|
23020
|
+
* items. The marker value is opaque to the client.
|
23021
|
+
* @param options - Options to find blobs by tags.
|
23022
|
+
*/
|
23023
|
+
findBlobsByTagsSegments(tagFilterSqlExpression, marker, options = {}) {
|
23024
|
+
return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1() {
|
23025
|
+
let response;
|
23026
|
+
if (!!marker || marker === undefined) {
|
23027
|
+
do {
|
23028
|
+
response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options));
|
23029
|
+
response.blobs = response.blobs || [];
|
23030
|
+
marker = response.continuationToken;
|
23031
|
+
yield yield tslib.__await(response);
|
23032
|
+
} while (marker);
|
23033
|
+
}
|
23034
|
+
});
|
23035
|
+
}
|
23036
|
+
/**
|
23037
|
+
* Returns an AsyncIterableIterator for blobs.
|
23038
|
+
*
|
23039
|
+
* @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
|
23040
|
+
* The given expression must evaluate to true for a blob to be returned in the results.
|
23041
|
+
* The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
|
23042
|
+
* however, only a subset of the OData filter syntax is supported in the Blob service.
|
23043
|
+
* @param options - Options to findBlobsByTagsItems.
|
23044
|
+
*/
|
23045
|
+
findBlobsByTagsItems(tagFilterSqlExpression, options = {}) {
|
23046
|
+
return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1() {
|
23047
|
+
var e_3, _a;
|
23048
|
+
let marker;
|
23049
|
+
try {
|
23050
|
+
for (var _b = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
|
23051
|
+
const segment = _c.value;
|
23052
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs)));
|
23053
|
+
}
|
23054
|
+
}
|
23055
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
23056
|
+
finally {
|
23057
|
+
try {
|
23058
|
+
if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
|
23059
|
+
}
|
23060
|
+
finally { if (e_3) throw e_3.error; }
|
23061
|
+
}
|
23062
|
+
});
|
23063
|
+
}
|
23064
|
+
/**
|
23065
|
+
* Returns an async iterable iterator to find all blobs with specified tag
|
23066
|
+
* under the specified container.
|
23067
|
+
*
|
23068
|
+
* .byPage() returns an async iterable iterator to list the blobs in pages.
|
23069
|
+
*
|
23070
|
+
* Example using `for await` syntax:
|
23071
|
+
*
|
23072
|
+
* ```js
|
23073
|
+
* let i = 1;
|
23074
|
+
* for await (const blob of containerClient.findBlobsByTags("tagkey='tagvalue'")) {
|
23075
|
+
* console.log(`Blob ${i++}: ${blob.name}`);
|
23076
|
+
* }
|
23077
|
+
* ```
|
23078
|
+
*
|
23079
|
+
* Example using `iter.next()`:
|
23080
|
+
*
|
23081
|
+
* ```js
|
23082
|
+
* let i = 1;
|
23083
|
+
* const iter = containerClient.findBlobsByTags("tagkey='tagvalue'");
|
23084
|
+
* let blobItem = await iter.next();
|
23085
|
+
* while (!blobItem.done) {
|
23086
|
+
* console.log(`Blob ${i++}: ${blobItem.value.name}`);
|
23087
|
+
* blobItem = await iter.next();
|
23088
|
+
* }
|
23089
|
+
* ```
|
23090
|
+
*
|
23091
|
+
* Example using `byPage()`:
|
23092
|
+
*
|
23093
|
+
* ```js
|
23094
|
+
* // passing optional maxPageSize in the page settings
|
23095
|
+
* let i = 1;
|
23096
|
+
* for await (const response of containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) {
|
23097
|
+
* if (response.blobs) {
|
23098
|
+
* for (const blob of response.blobs) {
|
23099
|
+
* console.log(`Blob ${i++}: ${blob.name}`);
|
23100
|
+
* }
|
23101
|
+
* }
|
23102
|
+
* }
|
23103
|
+
* ```
|
23104
|
+
*
|
23105
|
+
* Example using paging with a marker:
|
23106
|
+
*
|
23107
|
+
* ```js
|
23108
|
+
* let i = 1;
|
23109
|
+
* let iterator = containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 });
|
23110
|
+
* let response = (await iterator.next()).value;
|
23111
|
+
*
|
23112
|
+
* // Prints 2 blob names
|
23113
|
+
* if (response.blobs) {
|
23114
|
+
* for (const blob of response.blobs) {
|
23115
|
+
* console.log(`Blob ${i++}: ${blob.name}`);
|
23116
|
+
* }
|
23117
|
+
* }
|
23118
|
+
*
|
23119
|
+
* // Gets next marker
|
23120
|
+
* let marker = response.continuationToken;
|
23121
|
+
* // Passing next marker as continuationToken
|
23122
|
+
* iterator = containerClient
|
23123
|
+
* .findBlobsByTags("tagkey='tagvalue'")
|
23124
|
+
* .byPage({ continuationToken: marker, maxPageSize: 10 });
|
23125
|
+
* response = (await iterator.next()).value;
|
23126
|
+
*
|
23127
|
+
* // Prints blob names
|
23128
|
+
* if (response.blobs) {
|
23129
|
+
* for (const blob of response.blobs) {
|
23130
|
+
* console.log(`Blob ${i++}: ${blob.name}`);
|
23131
|
+
* }
|
23132
|
+
* }
|
23133
|
+
* ```
|
23134
|
+
*
|
23135
|
+
* @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.
|
23136
|
+
* The given expression must evaluate to true for a blob to be returned in the results.
|
23137
|
+
* The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;
|
23138
|
+
* however, only a subset of the OData filter syntax is supported in the Blob service.
|
23139
|
+
* @param options - Options to find blobs by tags.
|
23140
|
+
*/
|
23141
|
+
findBlobsByTags(tagFilterSqlExpression, options = {}) {
|
23142
|
+
// AsyncIterableIterator to iterate over blobs
|
23143
|
+
const listSegmentOptions = Object.assign({}, options);
|
23144
|
+
const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions);
|
23145
|
+
return {
|
23146
|
+
/**
|
23147
|
+
* The next method, part of the iteration protocol
|
23148
|
+
*/
|
23149
|
+
next() {
|
23150
|
+
return iter.next();
|
23151
|
+
},
|
23152
|
+
/**
|
23153
|
+
* The connection to the async iterator, part of the iteration protocol
|
23154
|
+
*/
|
23155
|
+
[Symbol.asyncIterator]() {
|
23156
|
+
return this;
|
23157
|
+
},
|
23158
|
+
/**
|
23159
|
+
* Return an AsyncIterableIterator that works a page at a time
|
23160
|
+
*/
|
23161
|
+
byPage: (settings = {}) => {
|
23162
|
+
return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions));
|
23163
|
+
},
|
23164
|
+
};
|
23165
|
+
}
|
22847
23166
|
getContainerNameFromUrl() {
|
22848
23167
|
let containerName;
|
22849
23168
|
try {
|