@azure/storage-blob 12.28.0-alpha.20250530.1 → 12.28.0-alpha.20250613.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/dist/browser/BatchResponseParser.js +1 -1
- package/dist/browser/BatchResponseParser.js.map +1 -1
- package/dist/browser/BlobBatch.d.ts +8 -8
- package/dist/browser/BlobBatch.js +1 -1
- package/dist/browser/BlobBatch.js.map +1 -1
- package/dist/browser/BlobBatchClient.d.ts +10 -10
- package/dist/browser/BlobBatchClient.js +2 -2
- package/dist/browser/BlobBatchClient.js.map +1 -1
- package/dist/browser/BlobLeaseClient.d.ts +10 -10
- package/dist/browser/BlobLeaseClient.js +10 -10
- package/dist/browser/BlobLeaseClient.js.map +1 -1
- package/dist/browser/BlobServiceClient.d.ts +11 -11
- package/dist/browser/BlobServiceClient.js +11 -11
- package/dist/browser/BlobServiceClient.js.map +1 -1
- package/dist/browser/Clients.d.ts +36 -36
- package/dist/browser/Clients.js +23 -23
- package/dist/browser/Clients.js.map +1 -1
- package/dist/browser/ContainerClient.d.ts +16 -16
- package/dist/browser/ContainerClient.js +15 -15
- package/dist/browser/ContainerClient.js.map +1 -1
- package/dist/browser/Range.d.ts +1 -1
- package/dist/browser/Range.js.map +1 -1
- package/dist/browser/StorageRetryPolicyFactory.d.ts +2 -2
- package/dist/browser/StorageRetryPolicyFactory.js.map +1 -1
- package/dist/browser/policies/StorageSharedKeyCredentialPolicy.d.ts +1 -1
- package/dist/browser/policies/StorageSharedKeyCredentialPolicy.js +2 -2
- package/dist/browser/policies/StorageSharedKeyCredentialPolicy.js.map +1 -1
- package/dist/browser/sas/AccountSASPermissions.d.ts +1 -1
- package/dist/browser/sas/AccountSASPermissions.js +2 -2
- package/dist/browser/sas/AccountSASPermissions.js.map +1 -1
- package/dist/browser/sas/AccountSASResourceTypes.d.ts +1 -1
- package/dist/browser/sas/AccountSASResourceTypes.js +1 -1
- package/dist/browser/sas/AccountSASResourceTypes.js.map +1 -1
- package/dist/browser/sas/AccountSASSignatureValues.d.ts +3 -3
- package/dist/browser/sas/AccountSASSignatureValues.js +1 -1
- package/dist/browser/sas/AccountSASSignatureValues.js.map +1 -1
- package/dist/browser/sas/BlobSASSignatureValues.d.ts +1 -1
- package/dist/browser/sas/BlobSASSignatureValues.js +1 -1
- package/dist/browser/sas/BlobSASSignatureValues.js.map +1 -1
- package/dist/browser/sas/ContainerSASPermissions.d.ts +1 -1
- package/dist/browser/sas/ContainerSASPermissions.js +1 -1
- package/dist/browser/sas/ContainerSASPermissions.js.map +1 -1
- package/dist/browser/sas/SASQueryParameters.d.ts +2 -2
- package/dist/browser/sas/SASQueryParameters.js.map +1 -1
- package/dist/browser/utils/utils.common.d.ts +2 -2
- package/dist/browser/utils/utils.common.js +3 -3
- package/dist/browser/utils/utils.common.js.map +1 -1
- package/dist/commonjs/BatchResponseParser.js +1 -1
- package/dist/commonjs/BatchResponseParser.js.map +1 -1
- package/dist/commonjs/BlobBatch.d.ts +8 -8
- package/dist/commonjs/BlobBatch.js +1 -1
- package/dist/commonjs/BlobBatch.js.map +1 -1
- package/dist/commonjs/BlobBatchClient.d.ts +10 -10
- package/dist/commonjs/BlobBatchClient.js +2 -2
- package/dist/commonjs/BlobBatchClient.js.map +1 -1
- package/dist/commonjs/BlobLeaseClient.d.ts +10 -10
- package/dist/commonjs/BlobLeaseClient.js +10 -10
- package/dist/commonjs/BlobLeaseClient.js.map +1 -1
- package/dist/commonjs/BlobServiceClient.d.ts +11 -11
- package/dist/commonjs/BlobServiceClient.js +11 -11
- package/dist/commonjs/BlobServiceClient.js.map +1 -1
- package/dist/commonjs/Clients.d.ts +36 -36
- package/dist/commonjs/Clients.js +23 -23
- package/dist/commonjs/Clients.js.map +1 -1
- package/dist/commonjs/ContainerClient.d.ts +16 -16
- package/dist/commonjs/ContainerClient.js +15 -15
- package/dist/commonjs/ContainerClient.js.map +1 -1
- package/dist/commonjs/Range.d.ts +1 -1
- package/dist/commonjs/Range.js.map +1 -1
- package/dist/commonjs/StorageRetryPolicyFactory.d.ts +2 -2
- package/dist/commonjs/StorageRetryPolicyFactory.js.map +1 -1
- package/dist/commonjs/credentials/UserDelegationKeyCredential.d.ts +1 -1
- package/dist/commonjs/credentials/UserDelegationKeyCredential.js +1 -1
- package/dist/commonjs/credentials/UserDelegationKeyCredential.js.map +1 -1
- package/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.d.ts +1 -1
- package/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.js +2 -2
- package/dist/commonjs/policies/StorageSharedKeyCredentialPolicy.js.map +1 -1
- package/dist/commonjs/policies/StorageSharedKeyCredentialPolicyV2.js +2 -2
- package/dist/commonjs/policies/StorageSharedKeyCredentialPolicyV2.js.map +1 -1
- package/dist/commonjs/sas/AccountSASPermissions.d.ts +1 -1
- package/dist/commonjs/sas/AccountSASPermissions.js +2 -2
- package/dist/commonjs/sas/AccountSASPermissions.js.map +1 -1
- package/dist/commonjs/sas/AccountSASResourceTypes.d.ts +1 -1
- package/dist/commonjs/sas/AccountSASResourceTypes.js +1 -1
- package/dist/commonjs/sas/AccountSASResourceTypes.js.map +1 -1
- package/dist/commonjs/sas/AccountSASSignatureValues.d.ts +3 -3
- package/dist/commonjs/sas/AccountSASSignatureValues.js +1 -1
- package/dist/commonjs/sas/AccountSASSignatureValues.js.map +1 -1
- package/dist/commonjs/sas/BlobSASSignatureValues.d.ts +1 -1
- package/dist/commonjs/sas/BlobSASSignatureValues.js +1 -1
- package/dist/commonjs/sas/BlobSASSignatureValues.js.map +1 -1
- package/dist/commonjs/sas/ContainerSASPermissions.d.ts +1 -1
- package/dist/commonjs/sas/ContainerSASPermissions.js +1 -1
- package/dist/commonjs/sas/ContainerSASPermissions.js.map +1 -1
- package/dist/commonjs/sas/SASQueryParameters.d.ts +2 -2
- package/dist/commonjs/sas/SASQueryParameters.js.map +1 -1
- package/dist/commonjs/utils/utils.common.d.ts +2 -2
- package/dist/commonjs/utils/utils.common.js +3 -3
- package/dist/commonjs/utils/utils.common.js.map +1 -1
- package/dist/esm/BatchResponseParser.js +1 -1
- package/dist/esm/BatchResponseParser.js.map +1 -1
- package/dist/esm/BlobBatch.d.ts +8 -8
- package/dist/esm/BlobBatch.js +1 -1
- package/dist/esm/BlobBatch.js.map +1 -1
- package/dist/esm/BlobBatchClient.d.ts +10 -10
- package/dist/esm/BlobBatchClient.js +2 -2
- package/dist/esm/BlobBatchClient.js.map +1 -1
- package/dist/esm/BlobLeaseClient.d.ts +10 -10
- package/dist/esm/BlobLeaseClient.js +10 -10
- package/dist/esm/BlobLeaseClient.js.map +1 -1
- package/dist/esm/BlobServiceClient.d.ts +11 -11
- package/dist/esm/BlobServiceClient.js +11 -11
- package/dist/esm/BlobServiceClient.js.map +1 -1
- package/dist/esm/Clients.d.ts +36 -36
- package/dist/esm/Clients.js +23 -23
- package/dist/esm/Clients.js.map +1 -1
- package/dist/esm/ContainerClient.d.ts +16 -16
- package/dist/esm/ContainerClient.js +15 -15
- package/dist/esm/ContainerClient.js.map +1 -1
- package/dist/esm/Range.d.ts +1 -1
- package/dist/esm/Range.js.map +1 -1
- package/dist/esm/StorageRetryPolicyFactory.d.ts +2 -2
- package/dist/esm/StorageRetryPolicyFactory.js.map +1 -1
- package/dist/esm/credentials/UserDelegationKeyCredential.d.ts +1 -1
- package/dist/esm/credentials/UserDelegationKeyCredential.js +1 -1
- package/dist/esm/credentials/UserDelegationKeyCredential.js.map +1 -1
- package/dist/esm/policies/StorageSharedKeyCredentialPolicy.d.ts +1 -1
- package/dist/esm/policies/StorageSharedKeyCredentialPolicy.js +2 -2
- package/dist/esm/policies/StorageSharedKeyCredentialPolicy.js.map +1 -1
- package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2.js +2 -2
- package/dist/esm/policies/StorageSharedKeyCredentialPolicyV2.js.map +1 -1
- package/dist/esm/sas/AccountSASPermissions.d.ts +1 -1
- package/dist/esm/sas/AccountSASPermissions.js +2 -2
- package/dist/esm/sas/AccountSASPermissions.js.map +1 -1
- package/dist/esm/sas/AccountSASResourceTypes.d.ts +1 -1
- package/dist/esm/sas/AccountSASResourceTypes.js +1 -1
- package/dist/esm/sas/AccountSASResourceTypes.js.map +1 -1
- package/dist/esm/sas/AccountSASSignatureValues.d.ts +3 -3
- package/dist/esm/sas/AccountSASSignatureValues.js +1 -1
- package/dist/esm/sas/AccountSASSignatureValues.js.map +1 -1
- package/dist/esm/sas/BlobSASSignatureValues.d.ts +1 -1
- package/dist/esm/sas/BlobSASSignatureValues.js +1 -1
- package/dist/esm/sas/BlobSASSignatureValues.js.map +1 -1
- package/dist/esm/sas/ContainerSASPermissions.d.ts +1 -1
- package/dist/esm/sas/ContainerSASPermissions.js +1 -1
- package/dist/esm/sas/ContainerSASPermissions.js.map +1 -1
- package/dist/esm/sas/SASQueryParameters.d.ts +2 -2
- package/dist/esm/sas/SASQueryParameters.js.map +1 -1
- package/dist/esm/utils/utils.common.d.ts +2 -2
- package/dist/esm/utils/utils.common.js +3 -3
- package/dist/esm/utils/utils.common.js.map +1 -1
- package/dist/react-native/BatchResponseParser.js +1 -1
- package/dist/react-native/BatchResponseParser.js.map +1 -1
- package/dist/react-native/BlobBatch.d.ts +8 -8
- package/dist/react-native/BlobBatch.js +1 -1
- package/dist/react-native/BlobBatch.js.map +1 -1
- package/dist/react-native/BlobBatchClient.d.ts +10 -10
- package/dist/react-native/BlobBatchClient.js +2 -2
- package/dist/react-native/BlobBatchClient.js.map +1 -1
- package/dist/react-native/BlobLeaseClient.d.ts +10 -10
- package/dist/react-native/BlobLeaseClient.js +10 -10
- package/dist/react-native/BlobLeaseClient.js.map +1 -1
- package/dist/react-native/BlobServiceClient.d.ts +11 -11
- package/dist/react-native/BlobServiceClient.js +11 -11
- package/dist/react-native/BlobServiceClient.js.map +1 -1
- package/dist/react-native/Clients.d.ts +36 -36
- package/dist/react-native/Clients.js +23 -23
- package/dist/react-native/Clients.js.map +1 -1
- package/dist/react-native/ContainerClient.d.ts +16 -16
- package/dist/react-native/ContainerClient.js +15 -15
- package/dist/react-native/ContainerClient.js.map +1 -1
- package/dist/react-native/Range.d.ts +1 -1
- package/dist/react-native/Range.js.map +1 -1
- package/dist/react-native/StorageRetryPolicyFactory.d.ts +2 -2
- package/dist/react-native/StorageRetryPolicyFactory.js.map +1 -1
- package/dist/react-native/credentials/UserDelegationKeyCredential.d.ts +1 -1
- package/dist/react-native/credentials/UserDelegationKeyCredential.js +1 -1
- package/dist/react-native/credentials/UserDelegationKeyCredential.js.map +1 -1
- package/dist/react-native/policies/StorageSharedKeyCredentialPolicy.d.ts +1 -1
- package/dist/react-native/policies/StorageSharedKeyCredentialPolicy.js +2 -2
- package/dist/react-native/policies/StorageSharedKeyCredentialPolicy.js.map +1 -1
- package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2.js +2 -2
- package/dist/react-native/policies/StorageSharedKeyCredentialPolicyV2.js.map +1 -1
- package/dist/react-native/sas/AccountSASPermissions.d.ts +1 -1
- package/dist/react-native/sas/AccountSASPermissions.js +2 -2
- package/dist/react-native/sas/AccountSASPermissions.js.map +1 -1
- package/dist/react-native/sas/AccountSASResourceTypes.d.ts +1 -1
- package/dist/react-native/sas/AccountSASResourceTypes.js +1 -1
- package/dist/react-native/sas/AccountSASResourceTypes.js.map +1 -1
- package/dist/react-native/sas/AccountSASSignatureValues.d.ts +3 -3
- package/dist/react-native/sas/AccountSASSignatureValues.js +1 -1
- package/dist/react-native/sas/AccountSASSignatureValues.js.map +1 -1
- package/dist/react-native/sas/BlobSASSignatureValues.d.ts +1 -1
- package/dist/react-native/sas/BlobSASSignatureValues.js +1 -1
- package/dist/react-native/sas/BlobSASSignatureValues.js.map +1 -1
- package/dist/react-native/sas/ContainerSASPermissions.d.ts +1 -1
- package/dist/react-native/sas/ContainerSASPermissions.js +1 -1
- package/dist/react-native/sas/ContainerSASPermissions.js.map +1 -1
- package/dist/react-native/sas/SASQueryParameters.d.ts +2 -2
- package/dist/react-native/sas/SASQueryParameters.js.map +1 -1
- package/dist/react-native/utils/utils.common.d.ts +2 -2
- package/dist/react-native/utils/utils.common.js +3 -3
- package/dist/react-native/utils/utils.common.js.map +1 -1
- package/package.json +1 -1
@@ -27,7 +27,7 @@ export declare type BlobBatchSetBlobsAccessTierResponse = BlobBatchSubmitBatchRe
|
|
27
27
|
/**
|
28
28
|
* A BlobBatchClient allows you to make batched requests to the Azure Storage Blob service.
|
29
29
|
*
|
30
|
-
* @see https://learn.microsoft.com/
|
30
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/blob-batch
|
31
31
|
*/
|
32
32
|
export declare class BlobBatchClient {
|
33
33
|
private serviceOrContainerContext;
|
@@ -59,9 +59,9 @@ export declare class BlobBatchClient {
|
|
59
59
|
/**
|
60
60
|
* Create multiple delete operations to mark the specified blobs or snapshots for deletion.
|
61
61
|
* Note that in order to delete a blob, you must delete all of its snapshots.
|
62
|
-
* You can delete both at the same time. See [delete operation details](https://learn.microsoft.com/
|
62
|
+
* You can delete both at the same time. See [delete operation details](https://learn.microsoft.com/rest/api/storageservices/delete-blob).
|
63
63
|
* The operations will be authenticated and authorized with specified credential.
|
64
|
-
* See [blob batch authorization details](https://learn.microsoft.com/
|
64
|
+
* See [blob batch authorization details](https://learn.microsoft.com/rest/api/storageservices/blob-batch#authorization).
|
65
65
|
*
|
66
66
|
* @param urls - The urls of the blob resources to delete.
|
67
67
|
* @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.
|
@@ -71,9 +71,9 @@ export declare class BlobBatchClient {
|
|
71
71
|
/**
|
72
72
|
* Create multiple delete operations to mark the specified blobs or snapshots for deletion.
|
73
73
|
* Note that in order to delete a blob, you must delete all of its snapshots.
|
74
|
-
* You can delete both at the same time. See [delete operation details](https://learn.microsoft.com/
|
74
|
+
* You can delete both at the same time. See [delete operation details](https://learn.microsoft.com/rest/api/storageservices/delete-blob).
|
75
75
|
* The operation(subrequest) will be authenticated and authorized with specified credential.
|
76
|
-
* See [blob batch authorization details](https://learn.microsoft.com/
|
76
|
+
* See [blob batch authorization details](https://learn.microsoft.com/rest/api/storageservices/blob-batch#authorization).
|
77
77
|
*
|
78
78
|
* @param blobClients - The BlobClients for the blobs to delete.
|
79
79
|
* @param options -
|
@@ -86,9 +86,9 @@ export declare class BlobBatchClient {
|
|
86
86
|
* storage only). A premium page blob's tier determines the allowed size, IOPS,
|
87
87
|
* and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive
|
88
88
|
* storage type. This operation does not update the blob's ETag.
|
89
|
-
* See [set blob tier details](https://learn.microsoft.com/
|
89
|
+
* See [set blob tier details](https://learn.microsoft.com/rest/api/storageservices/set-blob-tier).
|
90
90
|
* The operation(subrequest) will be authenticated and authorized
|
91
|
-
* with specified credential.See [blob batch authorization details](https://learn.microsoft.com/
|
91
|
+
* with specified credential.See [blob batch authorization details](https://learn.microsoft.com/rest/api/storageservices/blob-batch#authorization).
|
92
92
|
*
|
93
93
|
* @param urls - The urls of the blob resource to delete.
|
94
94
|
* @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.
|
@@ -103,9 +103,9 @@ export declare class BlobBatchClient {
|
|
103
103
|
* storage only). A premium page blob's tier determines the allowed size, IOPS,
|
104
104
|
* and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive
|
105
105
|
* storage type. This operation does not update the blob's ETag.
|
106
|
-
* See [set blob tier details](https://learn.microsoft.com/
|
106
|
+
* See [set blob tier details](https://learn.microsoft.com/rest/api/storageservices/set-blob-tier).
|
107
107
|
* The operation(subrequest) will be authenticated and authorized
|
108
|
-
* with specified credential.See [blob batch authorization details](https://learn.microsoft.com/
|
108
|
+
* with specified credential.See [blob batch authorization details](https://learn.microsoft.com/rest/api/storageservices/blob-batch#authorization).
|
109
109
|
*
|
110
110
|
* @param blobClients - The BlobClients for the blobs which should have a new tier set.
|
111
111
|
* @param tier -
|
@@ -171,7 +171,7 @@ export declare class BlobBatchClient {
|
|
171
171
|
* console.log(batchResp.subResponsesSucceededCount);
|
172
172
|
* ```
|
173
173
|
*
|
174
|
-
* @see https://learn.microsoft.com/
|
174
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/blob-batch
|
175
175
|
*
|
176
176
|
* @param batchRequest - A set of Delete or SetTier operations.
|
177
177
|
* @param options -
|
@@ -14,7 +14,7 @@ const utils_common_js_1 = require("./utils/utils.common.js");
|
|
14
14
|
/**
|
15
15
|
* A BlobBatchClient allows you to make batched requests to the Azure Storage Blob service.
|
16
16
|
*
|
17
|
-
* @see https://learn.microsoft.com/
|
17
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/blob-batch
|
18
18
|
*/
|
19
19
|
class BlobBatchClient {
|
20
20
|
constructor(url, credentialOrPipeline,
|
@@ -138,7 +138,7 @@ class BlobBatchClient {
|
|
138
138
|
* console.log(batchResp.subResponsesSucceededCount);
|
139
139
|
* ```
|
140
140
|
*
|
141
|
-
* @see https://learn.microsoft.com/
|
141
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/blob-batch
|
142
142
|
*
|
143
143
|
* @param batchRequest - A set of Delete or SetTier operations.
|
144
144
|
* @param options -
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"BlobBatchClient.js","sourceRoot":"","sources":["../../src/BlobBatchClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AASlC,qEAA+D;AAC/D,mDAAiD;AACjD,iDAA2C;AAC3C,mDAAmD;AAInD,iFAA2E;AAE3E,uEAAiE;AAEjE,+CAAkF;AAElF,6DAAqE;AAyBrE;;;;GAIG;AACH,MAAa,eAAe;IA8B1B,YACE,GAAW,EACX,oBAIgB;IAChB,mFAAmF;IACnF,gEAAgE;IAChE,OAAgC;QAEhC,IAAI,QAAsB,CAAC;QAC3B,IAAI,IAAA,4BAAc,EAAC,oBAAo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C,uBAAuB,EAAE,EACtC,gBAAgB,oBAEX,cAAc,EAEpB,CACF,CAAC;YAEF,gHAAgH;YAChH,MAAM,mBAAmB,GAAG,IAAI,4CAAmB,CACjD,gBAAgB,EAChB,YAAY,CAAC,cAAc,EAAE,CAC9B,CAAC;YACF,MAAM,eAAe,GAAG,MAAM,mBAAmB,CAAC,kBAAkB,EAAE,CAAC;YAEvE,MAAM,GAAG,GAAiC;gBACxC,SAAS,EAAE,gBAAgB,CAAC,SAAS;gBACrC,WAAW,EAAE,gBAAgB,CAAC,WAAW;gBACzC,SAAS,EAAE,gBAAgB,CAAC,SAAS;gBACrC,SAAS,EAAE,gBAAgB,CAAC,SAAS;gBACrC,eAAe,EAAE,gBAAgB,CAAC,eAAe;gBACjD,OAAO,EAAE,gBAAgB,CAAC,OAAO;gBACjC,YAAY,EAAE,eAAe,CAAC,YAAY;gBAC1C,0BAA0B,EAAE,eAAe,CAAC,0BAA0B;gBACtE,uBAAuB,EAAE,eAAe,CAAC,uBAAuB;aACjE,CAAC;YAEF,OAAO,GAAG,CAAC;QACb,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AAlUD,0CAkUC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n AccessTier,\n ServiceSubmitBatchHeaders,\n ServiceSubmitBatchOptionalParamsModel,\n ServiceSubmitBatchResponseModel,\n} from \"./generatedModels.js\";\nimport type { ParsedBatchResponse } from \"./BatchResponse.js\";\nimport { BatchResponseParser } from \"./BatchResponseParser.js\";\nimport { utf8ByteLength } from \"./BatchUtils.js\";\nimport { BlobBatch } from \"./BlobBatch.js\";\nimport { tracingClient } from \"./utils/tracing.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { Service, Container } from \"./generated/src/operationsInterfaces/index.js\";\nimport type { StorageSharedKeyCredential } from \"./credentials/StorageSharedKeyCredential.js\";\nimport { AnonymousCredential } from \"./credentials/AnonymousCredential.js\";\nimport type { BlobDeleteOptions, BlobClient, BlobSetTierOptions } from \"./Clients.js\";\nimport { StorageContextClient } from \"./StorageContextClient.js\";\nimport type { PipelineLike, StoragePipelineOptions } from \"./Pipeline.js\";\nimport { newPipeline, isPipelineLike, getCoreClientOptions } from \"./Pipeline.js\";\nimport type { WithResponse } from \"./utils/utils.common.js\";\nimport { assertResponse, getURLPath } from \"./utils/utils.common.js\";\n\n/**\n * Options to configure the Service - Submit Batch Optional Params.\n */\nexport interface BlobBatchSubmitBatchOptionalParams extends ServiceSubmitBatchOptionalParamsModel {}\n\n/**\n * Contains response data for blob batch operations.\n */\nexport declare type BlobBatchSubmitBatchResponse = WithResponse<\n ParsedBatchResponse & ServiceSubmitBatchHeaders,\n ServiceSubmitBatchHeaders\n>;\n\n/**\n * Contains response data for the {@link deleteBlobs} operation.\n */\nexport declare type BlobBatchDeleteBlobsResponse = BlobBatchSubmitBatchResponse;\n\n/**\n * Contains response data for the {@link setBlobsAccessTier} operation.\n */\nexport declare type BlobBatchSetBlobsAccessTierResponse = BlobBatchSubmitBatchResponse;\n\n/**\n * A BlobBatchClient allows you to make batched requests to the Azure Storage Blob service.\n *\n * @see https://learn.microsoft.com/en-us/rest/api/storageservices/blob-batch\n */\nexport class BlobBatchClient {\n private serviceOrContainerContext: Service | Container;\n\n /**\n * Creates an instance of BlobBatchClient.\n *\n * @param url - A url pointing to Azure Storage blob service, such as\n * \"https://myaccount.blob.core.windows.net\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.blob.core.windows.net?sasString\".\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param options - Options to configure the HTTP pipeline.\n */\n constructor(\n url: string,\n credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: StoragePipelineOptions,\n );\n\n /**\n * Creates an instance of BlobBatchClient.\n *\n * @param url - A url pointing to Azure Storage blob service, such as\n * \"https://myaccount.blob.core.windows.net\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.blob.core.windows.net?sasString\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n */\n constructor(url: string, pipeline: PipelineLike);\n constructor(\n url: string,\n credentialOrPipeline?:\n | StorageSharedKeyCredential\n | AnonymousCredential\n | TokenCredential\n | PipelineLike,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: StoragePipelineOptions,\n ) {\n let pipeline: PipelineLike;\n if (isPipelineLike(credentialOrPipeline)) {\n pipeline = credentialOrPipeline;\n } else if (!credentialOrPipeline) {\n // no credential provided\n pipeline = newPipeline(new AnonymousCredential(), options);\n } else {\n pipeline = newPipeline(credentialOrPipeline, options);\n }\n\n const storageClientContext = new StorageContextClient(url, getCoreClientOptions(pipeline));\n\n const path = getURLPath(url);\n if (path && path !== \"/\") {\n // Container scoped.\n this.serviceOrContainerContext = storageClientContext.container;\n } else {\n this.serviceOrContainerContext = storageClientContext.service;\n }\n }\n\n /**\n * Creates a {@link BlobBatch}.\n * A BlobBatch represents an aggregated set of operations on blobs.\n */\n public createBatch(): BlobBatch {\n return new BlobBatch();\n }\n\n /**\n * Create multiple delete operations to mark the specified blobs or snapshots for deletion.\n * Note that in order to delete a blob, you must delete all of its snapshots.\n * You can delete both at the same time. See [delete operation details](https://learn.microsoft.com/en-us/rest/api/storageservices/delete-blob).\n * The operations will be authenticated and authorized with specified credential.\n * See [blob batch authorization details](https://learn.microsoft.com/en-us/rest/api/storageservices/blob-batch#authorization).\n *\n * @param urls - The urls of the blob resources to delete.\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param options -\n */\n public async deleteBlobs(\n urls: string[],\n credential: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobDeleteOptions,\n ): Promise<BlobBatchDeleteBlobsResponse>;\n\n /**\n * Create multiple delete operations to mark the specified blobs or snapshots for deletion.\n * Note that in order to delete a blob, you must delete all of its snapshots.\n * You can delete both at the same time. See [delete operation details](https://learn.microsoft.com/en-us/rest/api/storageservices/delete-blob).\n * The operation(subrequest) will be authenticated and authorized with specified credential.\n * See [blob batch authorization details](https://learn.microsoft.com/en-us/rest/api/storageservices/blob-batch#authorization).\n *\n * @param blobClients - The BlobClients for the blobs to delete.\n * @param options -\n */\n public async deleteBlobs(\n blobClients: BlobClient[],\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobDeleteOptions,\n ): Promise<BlobBatchDeleteBlobsResponse>;\n\n public async deleteBlobs(\n urlsOrBlobClients: string[] | BlobClient[],\n credentialOrOptions:\n | StorageSharedKeyCredential\n | AnonymousCredential\n | TokenCredential\n | BlobDeleteOptions\n | undefined,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobDeleteOptions,\n ): Promise<BlobBatchDeleteBlobsResponse> {\n const batch = new BlobBatch();\n for (const urlOrBlobClient of urlsOrBlobClients) {\n if (typeof urlOrBlobClient === \"string\") {\n await batch.deleteBlob(urlOrBlobClient, credentialOrOptions as TokenCredential, options);\n } else {\n await batch.deleteBlob(urlOrBlobClient, credentialOrOptions as BlobDeleteOptions);\n }\n }\n return this.submitBatch(batch);\n }\n\n /**\n * Create multiple set tier operations to set the tier on a blob.\n * The operation is allowed on a page blob in a premium\n * storage account and on a block blob in a blob storage account (locally redundant\n * storage only). A premium page blob's tier determines the allowed size, IOPS,\n * and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive\n * storage type. This operation does not update the blob's ETag.\n * See [set blob tier details](https://learn.microsoft.com/en-us/rest/api/storageservices/set-blob-tier).\n * The operation(subrequest) will be authenticated and authorized\n * with specified credential.See [blob batch authorization details](https://learn.microsoft.com/en-us/rest/api/storageservices/blob-batch#authorization).\n *\n * @param urls - The urls of the blob resource to delete.\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param tier -\n * @param options -\n */\n public async setBlobsAccessTier(\n urls: string[],\n credential: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n tier: AccessTier,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobSetTierOptions,\n ): Promise<BlobBatchSetBlobsAccessTierResponse>;\n\n /**\n * Create multiple set tier operations to set the tier on a blob.\n * The operation is allowed on a page blob in a premium\n * storage account and on a block blob in a blob storage account (locally redundant\n * storage only). A premium page blob's tier determines the allowed size, IOPS,\n * and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive\n * storage type. This operation does not update the blob's ETag.\n * See [set blob tier details](https://learn.microsoft.com/en-us/rest/api/storageservices/set-blob-tier).\n * The operation(subrequest) will be authenticated and authorized\n * with specified credential.See [blob batch authorization details](https://learn.microsoft.com/en-us/rest/api/storageservices/blob-batch#authorization).\n *\n * @param blobClients - The BlobClients for the blobs which should have a new tier set.\n * @param tier -\n * @param options -\n */\n public async setBlobsAccessTier(\n blobClients: BlobClient[],\n tier: AccessTier,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobSetTierOptions,\n ): Promise<BlobBatchSetBlobsAccessTierResponse>;\n\n public async setBlobsAccessTier(\n urlsOrBlobClients: string[] | BlobClient[],\n credentialOrTier:\n | StorageSharedKeyCredential\n | AnonymousCredential\n | TokenCredential\n | AccessTier,\n tierOrOptions?: AccessTier | BlobSetTierOptions,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobSetTierOptions,\n ): Promise<BlobBatchSetBlobsAccessTierResponse> {\n const batch = new BlobBatch();\n for (const urlOrBlobClient of urlsOrBlobClients) {\n if (typeof urlOrBlobClient === \"string\") {\n await batch.setBlobAccessTier(\n urlOrBlobClient,\n credentialOrTier as TokenCredential,\n tierOrOptions as AccessTier,\n options,\n );\n } else {\n await batch.setBlobAccessTier(\n urlOrBlobClient,\n credentialOrTier as AccessTier,\n tierOrOptions as BlobSetTierOptions,\n );\n }\n }\n return this.submitBatch(batch);\n }\n\n /**\n * Submit batch request which consists of multiple subrequests.\n *\n * Get `blobBatchClient` and other details before running the snippets.\n * `blobServiceClient.getBlobBatchClient()` gives the `blobBatchClient`\n *\n * Example usage:\n *\n * ```ts snippet:BlobBatchClientSubmitBatch\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { BlobServiceClient, BlobBatch } from \"@azure/storage-blob\";\n *\n * const account = \"<account>\";\n * const credential = new DefaultAzureCredential();\n * const blobServiceClient = new BlobServiceClient(\n * `https://${account}.blob.core.windows.net`,\n * credential,\n * );\n *\n * const containerName = \"<container name>\";\n * const containerClient = blobServiceClient.getContainerClient(containerName);\n * const blobBatchClient = containerClient.getBlobBatchClient();\n *\n * const batchRequest = new BlobBatch();\n * await batchRequest.deleteBlob(\"<blob-url-1>\", credential);\n * await batchRequest.deleteBlob(\"<blob-url-2>\", credential, {\n * deleteSnapshots: \"include\",\n * });\n * const batchResp = await blobBatchClient.submitBatch(batchRequest);\n * console.log(batchResp.subResponsesSucceededCount);\n * ```\n *\n * Example using a lease:\n *\n * ```ts snippet:BlobBatchClientSubmitBatchWithLease\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { BlobServiceClient, BlobBatch } from \"@azure/storage-blob\";\n *\n * const account = \"<account>\";\n * const credential = new DefaultAzureCredential();\n * const blobServiceClient = new BlobServiceClient(\n * `https://${account}.blob.core.windows.net`,\n * credential,\n * );\n *\n * const containerName = \"<container name>\";\n * const containerClient = blobServiceClient.getContainerClient(containerName);\n * const blobBatchClient = containerClient.getBlobBatchClient();\n * const blobClient = containerClient.getBlobClient(\"<blob name>\");\n *\n * const batchRequest = new BlobBatch();\n * await batchRequest.setBlobAccessTier(blobClient, \"Cool\");\n * await batchRequest.setBlobAccessTier(blobClient, \"Cool\", {\n * conditions: { leaseId: \"<lease-id>\" },\n * });\n * const batchResp = await blobBatchClient.submitBatch(batchRequest);\n * console.log(batchResp.subResponsesSucceededCount);\n * ```\n *\n * @see https://learn.microsoft.com/en-us/rest/api/storageservices/blob-batch\n *\n * @param batchRequest - A set of Delete or SetTier operations.\n * @param options -\n */\n public async submitBatch(\n batchRequest: BlobBatch,\n options: BlobBatchSubmitBatchOptionalParams = {},\n ): Promise<BlobBatchSubmitBatchResponse> {\n if (!batchRequest || batchRequest.getSubRequests().size === 0) {\n throw new RangeError(\"Batch request should contain one or more sub requests.\");\n }\n\n return tracingClient.withSpan(\n \"BlobBatchClient-submitBatch\",\n options,\n async (updatedOptions) => {\n const batchRequestBody = batchRequest.getHttpRequestBody();\n\n // ServiceSubmitBatchResponseModel and ContainerSubmitBatchResponse are compatible for now.\n const rawBatchResponse: ServiceSubmitBatchResponseModel = assertResponse(\n await this.serviceOrContainerContext.submitBatch(\n utf8ByteLength(batchRequestBody),\n batchRequest.getMultiPartContentType(),\n batchRequestBody,\n {\n ...updatedOptions,\n },\n ),\n );\n\n // Parse the sub responses result, if logic reaches here(i.e. the batch request succeeded with status code 202).\n const batchResponseParser = new BatchResponseParser(\n rawBatchResponse,\n batchRequest.getSubRequests(),\n );\n const responseSummary = await batchResponseParser.parseBatchResponse();\n\n const res: BlobBatchSubmitBatchResponse = {\n _response: rawBatchResponse._response,\n contentType: rawBatchResponse.contentType,\n errorCode: rawBatchResponse.errorCode,\n requestId: rawBatchResponse.requestId,\n clientRequestId: rawBatchResponse.clientRequestId,\n version: rawBatchResponse.version,\n subResponses: responseSummary.subResponses,\n subResponsesSucceededCount: responseSummary.subResponsesSucceededCount,\n subResponsesFailedCount: responseSummary.subResponsesFailedCount,\n };\n\n return res;\n },\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"BlobBatchClient.js","sourceRoot":"","sources":["../../src/BlobBatchClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AASlC,qEAA+D;AAC/D,mDAAiD;AACjD,iDAA2C;AAC3C,mDAAmD;AAInD,iFAA2E;AAE3E,uEAAiE;AAEjE,+CAAkF;AAElF,6DAAqE;AAyBrE;;;;GAIG;AACH,MAAa,eAAe;IA8B1B,YACE,GAAW,EACX,oBAIgB;IAChB,mFAAmF;IACnF,gEAAgE;IAChE,OAAgC;QAEhC,IAAI,QAAsB,CAAC;QAC3B,IAAI,IAAA,4BAAc,EAAC,oBAAoB,CAAC,EAAE,CAAC;YACzC,QAAQ,GAAG,oBAAoB,CAAC;QAClC,CAAC;aAAM,IAAI,CAAC,oBAAoB,EAAE,CAAC;YACjC,yBAAyB;YACzB,QAAQ,GAAG,IAAA,yBAAW,EAAC,IAAI,4CAAmB,EAAE,EAAE,OAAO,CAAC,CAAC;QAC7D,CAAC;aAAM,CAAC;YACN,QAAQ,GAAG,IAAA,yBAAW,EAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;QACxD,CAAC;QAED,MAAM,oBAAoB,GAAG,IAAI,8CAAoB,CAAC,GAAG,EAAE,IAAA,kCAAoB,EAAC,QAAQ,CAAC,CAAC,CAAC;QAE3F,MAAM,IAAI,GAAG,IAAA,4BAAU,EAAC,GAAG,CAAC,CAAC;QAC7B,IAAI,IAAI,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACzB,oBAAoB;YACpB,IAAI,CAAC,yBAAyB,GAAG,oBAAoB,CAAC,SAAS,CAAC;Q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,eAAe,CAAC,uBAAuB;aACjE,CAAC;YAEF,OAAO,GAAG,CAAC;QACb,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AAlUD,0CAkUC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n AccessTier,\n ServiceSubmitBatchHeaders,\n ServiceSubmitBatchOptionalParamsModel,\n ServiceSubmitBatchResponseModel,\n} from \"./generatedModels.js\";\nimport type { ParsedBatchResponse } from \"./BatchResponse.js\";\nimport { BatchResponseParser } from \"./BatchResponseParser.js\";\nimport { utf8ByteLength } from \"./BatchUtils.js\";\nimport { BlobBatch } from \"./BlobBatch.js\";\nimport { tracingClient } from \"./utils/tracing.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { Service, Container } from \"./generated/src/operationsInterfaces/index.js\";\nimport type { StorageSharedKeyCredential } from \"./credentials/StorageSharedKeyCredential.js\";\nimport { AnonymousCredential } from \"./credentials/AnonymousCredential.js\";\nimport type { BlobDeleteOptions, BlobClient, BlobSetTierOptions } from \"./Clients.js\";\nimport { StorageContextClient } from \"./StorageContextClient.js\";\nimport type { PipelineLike, StoragePipelineOptions } from \"./Pipeline.js\";\nimport { newPipeline, isPipelineLike, getCoreClientOptions } from \"./Pipeline.js\";\nimport type { WithResponse } from \"./utils/utils.common.js\";\nimport { assertResponse, getURLPath } from \"./utils/utils.common.js\";\n\n/**\n * Options to configure the Service - Submit Batch Optional Params.\n */\nexport interface BlobBatchSubmitBatchOptionalParams extends ServiceSubmitBatchOptionalParamsModel {}\n\n/**\n * Contains response data for blob batch operations.\n */\nexport declare type BlobBatchSubmitBatchResponse = WithResponse<\n ParsedBatchResponse & ServiceSubmitBatchHeaders,\n ServiceSubmitBatchHeaders\n>;\n\n/**\n * Contains response data for the {@link deleteBlobs} operation.\n */\nexport declare type BlobBatchDeleteBlobsResponse = BlobBatchSubmitBatchResponse;\n\n/**\n * Contains response data for the {@link setBlobsAccessTier} operation.\n */\nexport declare type BlobBatchSetBlobsAccessTierResponse = BlobBatchSubmitBatchResponse;\n\n/**\n * A BlobBatchClient allows you to make batched requests to the Azure Storage Blob service.\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch\n */\nexport class BlobBatchClient {\n private serviceOrContainerContext: Service | Container;\n\n /**\n * Creates an instance of BlobBatchClient.\n *\n * @param url - A url pointing to Azure Storage blob service, such as\n * \"https://myaccount.blob.core.windows.net\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.blob.core.windows.net?sasString\".\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param options - Options to configure the HTTP pipeline.\n */\n constructor(\n url: string,\n credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: StoragePipelineOptions,\n );\n\n /**\n * Creates an instance of BlobBatchClient.\n *\n * @param url - A url pointing to Azure Storage blob service, such as\n * \"https://myaccount.blob.core.windows.net\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.blob.core.windows.net?sasString\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n */\n constructor(url: string, pipeline: PipelineLike);\n constructor(\n url: string,\n credentialOrPipeline?:\n | StorageSharedKeyCredential\n | AnonymousCredential\n | TokenCredential\n | PipelineLike,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: StoragePipelineOptions,\n ) {\n let pipeline: PipelineLike;\n if (isPipelineLike(credentialOrPipeline)) {\n pipeline = credentialOrPipeline;\n } else if (!credentialOrPipeline) {\n // no credential provided\n pipeline = newPipeline(new AnonymousCredential(), options);\n } else {\n pipeline = newPipeline(credentialOrPipeline, options);\n }\n\n const storageClientContext = new StorageContextClient(url, getCoreClientOptions(pipeline));\n\n const path = getURLPath(url);\n if (path && path !== \"/\") {\n // Container scoped.\n this.serviceOrContainerContext = storageClientContext.container;\n } else {\n this.serviceOrContainerContext = storageClientContext.service;\n }\n }\n\n /**\n * Creates a {@link BlobBatch}.\n * A BlobBatch represents an aggregated set of operations on blobs.\n */\n public createBatch(): BlobBatch {\n return new BlobBatch();\n }\n\n /**\n * Create multiple delete operations to mark the specified blobs or snapshots for deletion.\n * Note that in order to delete a blob, you must delete all of its snapshots.\n * You can delete both at the same time. See [delete operation details](https://learn.microsoft.com/rest/api/storageservices/delete-blob).\n * The operations will be authenticated and authorized with specified credential.\n * See [blob batch authorization details](https://learn.microsoft.com/rest/api/storageservices/blob-batch#authorization).\n *\n * @param urls - The urls of the blob resources to delete.\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param options -\n */\n public async deleteBlobs(\n urls: string[],\n credential: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobDeleteOptions,\n ): Promise<BlobBatchDeleteBlobsResponse>;\n\n /**\n * Create multiple delete operations to mark the specified blobs or snapshots for deletion.\n * Note that in order to delete a blob, you must delete all of its snapshots.\n * You can delete both at the same time. See [delete operation details](https://learn.microsoft.com/rest/api/storageservices/delete-blob).\n * The operation(subrequest) will be authenticated and authorized with specified credential.\n * See [blob batch authorization details](https://learn.microsoft.com/rest/api/storageservices/blob-batch#authorization).\n *\n * @param blobClients - The BlobClients for the blobs to delete.\n * @param options -\n */\n public async deleteBlobs(\n blobClients: BlobClient[],\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobDeleteOptions,\n ): Promise<BlobBatchDeleteBlobsResponse>;\n\n public async deleteBlobs(\n urlsOrBlobClients: string[] | BlobClient[],\n credentialOrOptions:\n | StorageSharedKeyCredential\n | AnonymousCredential\n | TokenCredential\n | BlobDeleteOptions\n | undefined,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobDeleteOptions,\n ): Promise<BlobBatchDeleteBlobsResponse> {\n const batch = new BlobBatch();\n for (const urlOrBlobClient of urlsOrBlobClients) {\n if (typeof urlOrBlobClient === \"string\") {\n await batch.deleteBlob(urlOrBlobClient, credentialOrOptions as TokenCredential, options);\n } else {\n await batch.deleteBlob(urlOrBlobClient, credentialOrOptions as BlobDeleteOptions);\n }\n }\n return this.submitBatch(batch);\n }\n\n /**\n * Create multiple set tier operations to set the tier on a blob.\n * The operation is allowed on a page blob in a premium\n * storage account and on a block blob in a blob storage account (locally redundant\n * storage only). A premium page blob's tier determines the allowed size, IOPS,\n * and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive\n * storage type. This operation does not update the blob's ETag.\n * See [set blob tier details](https://learn.microsoft.com/rest/api/storageservices/set-blob-tier).\n * The operation(subrequest) will be authenticated and authorized\n * with specified credential.See [blob batch authorization details](https://learn.microsoft.com/rest/api/storageservices/blob-batch#authorization).\n *\n * @param urls - The urls of the blob resource to delete.\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param tier -\n * @param options -\n */\n public async setBlobsAccessTier(\n urls: string[],\n credential: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n tier: AccessTier,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobSetTierOptions,\n ): Promise<BlobBatchSetBlobsAccessTierResponse>;\n\n /**\n * Create multiple set tier operations to set the tier on a blob.\n * The operation is allowed on a page blob in a premium\n * storage account and on a block blob in a blob storage account (locally redundant\n * storage only). A premium page blob's tier determines the allowed size, IOPS,\n * and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive\n * storage type. This operation does not update the blob's ETag.\n * See [set blob tier details](https://learn.microsoft.com/rest/api/storageservices/set-blob-tier).\n * The operation(subrequest) will be authenticated and authorized\n * with specified credential.See [blob batch authorization details](https://learn.microsoft.com/rest/api/storageservices/blob-batch#authorization).\n *\n * @param blobClients - The BlobClients for the blobs which should have a new tier set.\n * @param tier -\n * @param options -\n */\n public async setBlobsAccessTier(\n blobClients: BlobClient[],\n tier: AccessTier,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobSetTierOptions,\n ): Promise<BlobBatchSetBlobsAccessTierResponse>;\n\n public async setBlobsAccessTier(\n urlsOrBlobClients: string[] | BlobClient[],\n credentialOrTier:\n | StorageSharedKeyCredential\n | AnonymousCredential\n | TokenCredential\n | AccessTier,\n tierOrOptions?: AccessTier | BlobSetTierOptions,\n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options?: BlobSetTierOptions,\n ): Promise<BlobBatchSetBlobsAccessTierResponse> {\n const batch = new BlobBatch();\n for (const urlOrBlobClient of urlsOrBlobClients) {\n if (typeof urlOrBlobClient === \"string\") {\n await batch.setBlobAccessTier(\n urlOrBlobClient,\n credentialOrTier as TokenCredential,\n tierOrOptions as AccessTier,\n options,\n );\n } else {\n await batch.setBlobAccessTier(\n urlOrBlobClient,\n credentialOrTier as AccessTier,\n tierOrOptions as BlobSetTierOptions,\n );\n }\n }\n return this.submitBatch(batch);\n }\n\n /**\n * Submit batch request which consists of multiple subrequests.\n *\n * Get `blobBatchClient` and other details before running the snippets.\n * `blobServiceClient.getBlobBatchClient()` gives the `blobBatchClient`\n *\n * Example usage:\n *\n * ```ts snippet:BlobBatchClientSubmitBatch\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { BlobServiceClient, BlobBatch } from \"@azure/storage-blob\";\n *\n * const account = \"<account>\";\n * const credential = new DefaultAzureCredential();\n * const blobServiceClient = new BlobServiceClient(\n * `https://${account}.blob.core.windows.net`,\n * credential,\n * );\n *\n * const containerName = \"<container name>\";\n * const containerClient = blobServiceClient.getContainerClient(containerName);\n * const blobBatchClient = containerClient.getBlobBatchClient();\n *\n * const batchRequest = new BlobBatch();\n * await batchRequest.deleteBlob(\"<blob-url-1>\", credential);\n * await batchRequest.deleteBlob(\"<blob-url-2>\", credential, {\n * deleteSnapshots: \"include\",\n * });\n * const batchResp = await blobBatchClient.submitBatch(batchRequest);\n * console.log(batchResp.subResponsesSucceededCount);\n * ```\n *\n * Example using a lease:\n *\n * ```ts snippet:BlobBatchClientSubmitBatchWithLease\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { BlobServiceClient, BlobBatch } from \"@azure/storage-blob\";\n *\n * const account = \"<account>\";\n * const credential = new DefaultAzureCredential();\n * const blobServiceClient = new BlobServiceClient(\n * `https://${account}.blob.core.windows.net`,\n * credential,\n * );\n *\n * const containerName = \"<container name>\";\n * const containerClient = blobServiceClient.getContainerClient(containerName);\n * const blobBatchClient = containerClient.getBlobBatchClient();\n * const blobClient = containerClient.getBlobClient(\"<blob name>\");\n *\n * const batchRequest = new BlobBatch();\n * await batchRequest.setBlobAccessTier(blobClient, \"Cool\");\n * await batchRequest.setBlobAccessTier(blobClient, \"Cool\", {\n * conditions: { leaseId: \"<lease-id>\" },\n * });\n * const batchResp = await blobBatchClient.submitBatch(batchRequest);\n * console.log(batchResp.subResponsesSucceededCount);\n * ```\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch\n *\n * @param batchRequest - A set of Delete or SetTier operations.\n * @param options -\n */\n public async submitBatch(\n batchRequest: BlobBatch,\n options: BlobBatchSubmitBatchOptionalParams = {},\n ): Promise<BlobBatchSubmitBatchResponse> {\n if (!batchRequest || batchRequest.getSubRequests().size === 0) {\n throw new RangeError(\"Batch request should contain one or more sub requests.\");\n }\n\n return tracingClient.withSpan(\n \"BlobBatchClient-submitBatch\",\n options,\n async (updatedOptions) => {\n const batchRequestBody = batchRequest.getHttpRequestBody();\n\n // ServiceSubmitBatchResponseModel and ContainerSubmitBatchResponse are compatible for now.\n const rawBatchResponse: ServiceSubmitBatchResponseModel = assertResponse(\n await this.serviceOrContainerContext.submitBatch(\n utf8ByteLength(batchRequestBody),\n batchRequest.getMultiPartContentType(),\n batchRequestBody,\n {\n ...updatedOptions,\n },\n ),\n );\n\n // Parse the sub responses result, if logic reaches here(i.e. the batch request succeeded with status code 202).\n const batchResponseParser = new BatchResponseParser(\n rawBatchResponse,\n batchRequest.getSubRequests(),\n );\n const responseSummary = await batchResponseParser.parseBatchResponse();\n\n const res: BlobBatchSubmitBatchResponse = {\n _response: rawBatchResponse._response,\n contentType: rawBatchResponse.contentType,\n errorCode: rawBatchResponse.errorCode,\n requestId: rawBatchResponse.requestId,\n clientRequestId: rawBatchResponse.clientRequestId,\n version: rawBatchResponse.version,\n subResponses: responseSummary.subResponses,\n subResponsesSucceededCount: responseSummary.subResponsesSucceededCount,\n subResponsesFailedCount: responseSummary.subResponsesFailedCount,\n };\n\n return res;\n },\n );\n }\n}\n"]}
|
@@ -102,9 +102,9 @@ export declare class BlobLeaseClient {
|
|
102
102
|
* Establishes and manages a lock on a container for delete operations, or on a blob
|
103
103
|
* for write and delete operations.
|
104
104
|
* The lock duration can be 15 to 60 seconds, or can be infinite.
|
105
|
-
* @see https://learn.microsoft.com/
|
105
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/lease-container
|
106
106
|
* and
|
107
|
-
* @see https://learn.microsoft.com/
|
107
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
|
108
108
|
*
|
109
109
|
* @param duration - Must be between 15 to 60 seconds, or infinite (-1)
|
110
110
|
* @param options - option to configure lease management operations.
|
@@ -113,9 +113,9 @@ export declare class BlobLeaseClient {
|
|
113
113
|
acquireLease(duration: number, options?: LeaseOperationOptions): Promise<LeaseOperationResponse>;
|
114
114
|
/**
|
115
115
|
* To change the ID of the lease.
|
116
|
-
* @see https://learn.microsoft.com/
|
116
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/lease-container
|
117
117
|
* and
|
118
|
-
* @see https://learn.microsoft.com/
|
118
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
|
119
119
|
*
|
120
120
|
* @param proposedLeaseId - the proposed new lease Id.
|
121
121
|
* @param options - option to configure lease management operations.
|
@@ -125,9 +125,9 @@ export declare class BlobLeaseClient {
|
|
125
125
|
/**
|
126
126
|
* To free the lease if it is no longer needed so that another client may
|
127
127
|
* immediately acquire a lease against the container or the blob.
|
128
|
-
* @see https://learn.microsoft.com/
|
128
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/lease-container
|
129
129
|
* and
|
130
|
-
* @see https://learn.microsoft.com/
|
130
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
|
131
131
|
*
|
132
132
|
* @param options - option to configure lease management operations.
|
133
133
|
* @returns Response data for release lease operation.
|
@@ -135,9 +135,9 @@ export declare class BlobLeaseClient {
|
|
135
135
|
releaseLease(options?: LeaseOperationOptions): Promise<LeaseOperationResponse>;
|
136
136
|
/**
|
137
137
|
* To renew the lease.
|
138
|
-
* @see https://learn.microsoft.com/
|
138
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/lease-container
|
139
139
|
* and
|
140
|
-
* @see https://learn.microsoft.com/
|
140
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
|
141
141
|
*
|
142
142
|
* @param options - Optional option to configure lease management operations.
|
143
143
|
* @returns Response data for renew lease operation.
|
@@ -146,9 +146,9 @@ export declare class BlobLeaseClient {
|
|
146
146
|
/**
|
147
147
|
* To end the lease but ensure that another client cannot acquire a new lease
|
148
148
|
* until the current lease period has expired.
|
149
|
-
* @see https://learn.microsoft.com/
|
149
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/lease-container
|
150
150
|
* and
|
151
|
-
* @see https://learn.microsoft.com/
|
151
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
|
152
152
|
*
|
153
153
|
* @param breakPeriod - Break period
|
154
154
|
* @param options - Optional options to configure lease management operations.
|
@@ -52,9 +52,9 @@ class BlobLeaseClient {
|
|
52
52
|
* Establishes and manages a lock on a container for delete operations, or on a blob
|
53
53
|
* for write and delete operations.
|
54
54
|
* The lock duration can be 15 to 60 seconds, or can be infinite.
|
55
|
-
* @see https://learn.microsoft.com/
|
55
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/lease-container
|
56
56
|
* and
|
57
|
-
* @see https://learn.microsoft.com/
|
57
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
|
58
58
|
*
|
59
59
|
* @param duration - Must be between 15 to 60 seconds, or infinite (-1)
|
60
60
|
* @param options - option to configure lease management operations.
|
@@ -81,9 +81,9 @@ class BlobLeaseClient {
|
|
81
81
|
}
|
82
82
|
/**
|
83
83
|
* To change the ID of the lease.
|
84
|
-
* @see https://learn.microsoft.com/
|
84
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/lease-container
|
85
85
|
* and
|
86
|
-
* @see https://learn.microsoft.com/
|
86
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
|
87
87
|
*
|
88
88
|
* @param proposedLeaseId - the proposed new lease Id.
|
89
89
|
* @param options - option to configure lease management operations.
|
@@ -111,9 +111,9 @@ class BlobLeaseClient {
|
|
111
111
|
/**
|
112
112
|
* To free the lease if it is no longer needed so that another client may
|
113
113
|
* immediately acquire a lease against the container or the blob.
|
114
|
-
* @see https://learn.microsoft.com/
|
114
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/lease-container
|
115
115
|
* and
|
116
|
-
* @see https://learn.microsoft.com/
|
116
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
|
117
117
|
*
|
118
118
|
* @param options - option to configure lease management operations.
|
119
119
|
* @returns Response data for release lease operation.
|
@@ -137,9 +137,9 @@ class BlobLeaseClient {
|
|
137
137
|
}
|
138
138
|
/**
|
139
139
|
* To renew the lease.
|
140
|
-
* @see https://learn.microsoft.com/
|
140
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/lease-container
|
141
141
|
* and
|
142
|
-
* @see https://learn.microsoft.com/
|
142
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
|
143
143
|
*
|
144
144
|
* @param options - Optional option to configure lease management operations.
|
145
145
|
* @returns Response data for renew lease operation.
|
@@ -164,9 +164,9 @@ class BlobLeaseClient {
|
|
164
164
|
/**
|
165
165
|
* To end the lease but ensure that another client cannot acquire a new lease
|
166
166
|
* until the current lease period has expired.
|
167
|
-
* @see https://learn.microsoft.com/
|
167
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/lease-container
|
168
168
|
* and
|
169
|
-
* @see https://learn.microsoft.com/
|
169
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/lease-blob
|
170
170
|
*
|
171
171
|
* @param breakPeriod - Break period
|
172
172
|
* @param options - Optional options to configure lease management operations.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"BlobLeaseClient.js","sourceRoot":"","sources":["../../src/BlobLeaseClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,gDAA8C;AAM9C,uDAAgD;AAChD,mDAAmD;AAInD,6DAAyD;AA8EzD;;GAEG;AACH,MAAa,eAAe;IAM1B;;;;OAIG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,IAAW,GAAG;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACH,YAAY,MAAoC,EAAE,OAAgB;QAChE,MAAM,aAAa,GAAI,MAAc,CAAC,oBAAoB,CAAC;QAC3D,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,C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CAAC,UAAU,KACrB,MAAM,EAAE,MAAA,OAAO,CAAC,UAAU,0CAAE,aAAa,GAC1C;gBACD,cAAc,EAAE,cAAc,CAAC,cAAc;aAC9C,CAAC;YACF,OAAO,IAAA,gCAAc,EACnB,MAAM,IAAI,CAAC,yBAAyB,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAClE,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA1PD,0CA0PC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { randomUUID } from \"@azure/core-util\";\nimport type { ContainerBreakLeaseOptionalParams } from \"./generatedModels.js\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { Blob as StorageBlob, Container } from \"./generated/src/operationsInterfaces/index.js\";\nimport type { ModifiedAccessConditions } from \"./models.js\";\nimport type { CommonOptions } from \"./StorageClient.js\";\nimport { ETagNone } from \"./utils/constants.js\";\nimport { tracingClient } from \"./utils/tracing.js\";\nimport type { BlobClient } from \"./Clients.js\";\nimport type { ContainerClient } from \"./ContainerClient.js\";\nimport type { WithResponse } from \"./utils/utils.common.js\";\nimport { assertResponse } from \"./utils/utils.common.js\";\nimport type {\n ContainerAcquireLeaseHeaders,\n ContainerBreakLeaseHeaders,\n ContainerReleaseLeaseHeaders,\n} from \"./generated/src/index.js\";\n\n/**\n * The details for a specific lease.\n */\nexport interface Lease {\n /**\n * The ETag contains a value that you can use to\n * perform operations conditionally. If the request version is 2011-08-18 or\n * newer, the ETag value will be in quotes.\n */\n etag?: string;\n /**\n * Returns the date and time the container was\n * last modified. Any operation that modifies the blob, including an update\n * of the blob's metadata or properties, changes the last-modified time of\n * the blob.\n */\n lastModified?: Date;\n /**\n * Uniquely identifies a container's lease\n */\n leaseId?: string;\n /**\n * Approximate time remaining in the lease\n * period, in seconds.\n */\n leaseTime?: number;\n /**\n * This header uniquely identifies the request\n * that was made and can be used for troubleshooting the request.\n */\n requestId?: string;\n /**\n * Indicates the version of the Blob service used\n * to execute the request. This header is returned for requests made against\n * version 2009-09-19 and above.\n */\n version?: string;\n /**\n * UTC date/time value generated by the service that\n * indicates the time at which the response was initiated\n */\n date?: Date;\n /**\n * Error code if any associated with the response that returned\n * the Lease information.\n */\n errorCode?: string;\n}\n\n/**\n * Contains the response data for operations that create, modify, or delete a lease.\n *\n * See {@link BlobLeaseClient}.\n */\nexport type LeaseOperationResponse = WithResponse<Lease, Lease>;\n\n/**\n * Configures lease operations.\n */\nexport interface LeaseOperationOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Conditions to meet when changing the lease.\n */\n conditions?: ModifiedAccessConditions;\n}\n\n/**\n * A client that manages leases for a {@link ContainerClient} or a {@link BlobClient}.\n */\nexport class BlobLeaseClient {\n private _leaseId: string;\n private _url: string;\n private _containerOrBlobOperation: Container | StorageBlob;\n private _isContainer: boolean;\n\n /**\n * Gets the lease Id.\n *\n * @readonly\n */\n public get leaseId(): string {\n return this._leaseId;\n }\n\n /**\n * Gets the url.\n *\n * @readonly\n */\n public get url(): string {\n return this._url;\n }\n\n /**\n * Creates an instance of BlobLeaseClient.\n * @param client - The client to make the lease operation requests.\n * @param leaseId - Initial proposed lease id.\n */\n constructor(client: ContainerClient | BlobClient, leaseId?: string) {\n const clientContext = (client as any).storageClientContext;\n this._url = client.url;\n\n if ((client as BlobClient).name === undefined) {\n this._isContainer = true;\n this._containerOrBlobOperation = clientContext.container;\n } else {\n this._isContainer = false;\n this._containerOrBlobOperation = clientContext.blob;\n }\n\n if (!leaseId) {\n leaseId = randomUUID();\n }\n this._leaseId = leaseId;\n }\n\n /**\n * Establishes and manages a lock on a container for delete operations, or on a blob\n * for write and delete operations.\n * The lock duration can be 15 to 60 seconds, or can be infinite.\n * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-container\n * and\n * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-blob\n *\n * @param duration - Must be between 15 to 60 seconds, or infinite (-1)\n * @param options - option to configure lease management operations.\n * @returns Response data for acquire lease operation.\n */\n public async acquireLease(\n duration: number,\n options: LeaseOperationOptions = {},\n ): Promise<LeaseOperationResponse> {\n if (\n this._isContainer &&\n ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||\n (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||\n options.conditions?.tagConditions)\n ) {\n throw new RangeError(\n \"The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.\",\n );\n }\n return tracingClient.withSpan(\n \"BlobLeaseClient-acquireLease\",\n options,\n async (updatedOptions) => {\n return assertResponse<ContainerAcquireLeaseHeaders, ContainerAcquireLeaseHeaders>(\n await this._containerOrBlobOperation.acquireLease({\n abortSignal: options.abortSignal,\n duration,\n modifiedAccessConditions: {\n ...options.conditions,\n ifTags: options.conditions?.tagConditions,\n },\n proposedLeaseId: this._leaseId,\n tracingOptions: updatedOptions.tracingOptions,\n }),\n );\n },\n );\n }\n\n /**\n * To change the ID of the lease.\n * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-container\n * and\n * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-blob\n *\n * @param proposedLeaseId - the proposed new lease Id.\n * @param options - option to configure lease management operations.\n * @returns Response data for change lease operation.\n */\n public async changeLease(\n proposedLeaseId: string,\n options: LeaseOperationOptions = {},\n ): Promise<LeaseOperationResponse> {\n if (\n this._isContainer &&\n ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||\n (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||\n options.conditions?.tagConditions)\n ) {\n throw new RangeError(\n \"The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.\",\n );\n }\n\n return tracingClient.withSpan(\n \"BlobLeaseClient-changeLease\",\n options,\n async (updatedOptions) => {\n const response = assertResponse<Lease, Lease>(\n await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId, {\n abortSignal: options.abortSignal,\n modifiedAccessConditions: {\n ...options.conditions,\n ifTags: options.conditions?.tagConditions,\n },\n tracingOptions: updatedOptions.tracingOptions,\n }),\n );\n this._leaseId = proposedLeaseId;\n return response;\n },\n );\n }\n\n /**\n * To free the lease if it is no longer needed so that another client may\n * immediately acquire a lease against the container or the blob.\n * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-container\n * and\n * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-blob\n *\n * @param options - option to configure lease management operations.\n * @returns Response data for release lease operation.\n */\n public async releaseLease(options: LeaseOperationOptions = {}): Promise<LeaseOperationResponse> {\n if (\n this._isContainer &&\n ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||\n (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||\n options.conditions?.tagConditions)\n ) {\n throw new RangeError(\n \"The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.\",\n );\n }\n return tracingClient.withSpan(\n \"BlobLeaseClient-releaseLease\",\n options,\n async (updatedOptions) => {\n return assertResponse<ContainerReleaseLeaseHeaders, ContainerReleaseLeaseHeaders>(\n await this._containerOrBlobOperation.releaseLease(this._leaseId, {\n abortSignal: options.abortSignal,\n modifiedAccessConditions: {\n ...options.conditions,\n ifTags: options.conditions?.tagConditions,\n },\n tracingOptions: updatedOptions.tracingOptions,\n }),\n );\n },\n );\n }\n\n /**\n * To renew the lease.\n * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-container\n * and\n * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-blob\n *\n * @param options - Optional option to configure lease management operations.\n * @returns Response data for renew lease operation.\n */\n public async renewLease(options: LeaseOperationOptions = {}): Promise<Lease> {\n if (\n this._isContainer &&\n ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||\n (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||\n options.conditions?.tagConditions)\n ) {\n throw new RangeError(\n \"The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.\",\n );\n }\n return tracingClient.withSpan(\"BlobLeaseClient-renewLease\", options, async (updatedOptions) => {\n return this._containerOrBlobOperation.renewLease(this._leaseId, {\n abortSignal: options.abortSignal,\n modifiedAccessConditions: {\n ...options.conditions,\n ifTags: options.conditions?.tagConditions,\n },\n tracingOptions: updatedOptions.tracingOptions,\n });\n });\n }\n\n /**\n * To end the lease but ensure that another client cannot acquire a new lease\n * until the current lease period has expired.\n * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-container\n * and\n * @see https://learn.microsoft.com/en-us/rest/api/storageservices/lease-blob\n *\n * @param breakPeriod - Break period\n * @param options - Optional options to configure lease management operations.\n * @returns Response data for break lease operation.\n */\n public async breakLease(\n breakPeriod: number,\n options: LeaseOperationOptions = {},\n ): Promise<LeaseOperationResponse> {\n if (\n this._isContainer &&\n ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||\n (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||\n options.conditions?.tagConditions)\n ) {\n throw new RangeError(\n \"The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.\",\n );\n }\n\n return tracingClient.withSpan(\"BlobLeaseClient-breakLease\", options, async (updatedOptions) => {\n const operationOptions: ContainerBreakLeaseOptionalParams = {\n abortSignal: options.abortSignal,\n breakPeriod,\n modifiedAccessConditions: {\n ...options.conditions,\n ifTags: options.conditions?.tagConditions,\n },\n tracingOptions: updatedOptions.tracingOptions,\n };\n return assertResponse<ContainerBreakLeaseHeaders, ContainerBreakLeaseHeaders>(\n await this._containerOrBlobOperation.breakLease(operationOptions),\n );\n });\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"BlobLeaseClient.js","sourceRoot":"","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Q,CAAC;gBACxE,CAAC,CAAA,MAAA,OAAO,CAAC,UAAU,0CAAE,WAAW,KAAI,CAAA,MAAA,OAAO,CAAC,UAAU,0CAAE,WAAW,MAAK,uBAAQ,CAAC;iBACjF,MAAA,OAAO,CAAC,UAAU,0CAAE,aAAa,CAAA,CAAC,EACpC,CAAC;YACD,MAAM,IAAI,UAAU,CAClB,yJAAyJ,CAC1J,CAAC;QACJ,CAAC;QAED,OAAO,0BAAa,CAAC,QAAQ,CAAC,4BAA4B,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;;YAC5F,MAAM,gBAAgB,GAAsC;gBAC1D,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,WAAW;gBACX,wBAAwB,kCACnB,OAAO,CAAC,UAAU,KACrB,MAAM,EAAE,MAAA,OAAO,CAAC,UAAU,0CAAE,aAAa,GAC1C;gBACD,cAAc,EAAE,cAAc,CAAC,cAAc;aAC9C,CAAC;YACF,OAAO,IAAA,gCAAc,EACnB,MAAM,IAAI,CAAC,yBAAyB,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAClE,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA1PD,0CA0PC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { randomUUID } from \"@azure/core-util\";\nimport type { ContainerBreakLeaseOptionalParams } from \"./generatedModels.js\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { Blob as StorageBlob, Container } from \"./generated/src/operationsInterfaces/index.js\";\nimport type { ModifiedAccessConditions } from \"./models.js\";\nimport type { CommonOptions } from \"./StorageClient.js\";\nimport { ETagNone } from \"./utils/constants.js\";\nimport { tracingClient } from \"./utils/tracing.js\";\nimport type { BlobClient } from \"./Clients.js\";\nimport type { ContainerClient } from \"./ContainerClient.js\";\nimport type { WithResponse } from \"./utils/utils.common.js\";\nimport { assertResponse } from \"./utils/utils.common.js\";\nimport type {\n ContainerAcquireLeaseHeaders,\n ContainerBreakLeaseHeaders,\n ContainerReleaseLeaseHeaders,\n} from \"./generated/src/index.js\";\n\n/**\n * The details for a specific lease.\n */\nexport interface Lease {\n /**\n * The ETag contains a value that you can use to\n * perform operations conditionally. If the request version is 2011-08-18 or\n * newer, the ETag value will be in quotes.\n */\n etag?: string;\n /**\n * Returns the date and time the container was\n * last modified. Any operation that modifies the blob, including an update\n * of the blob's metadata or properties, changes the last-modified time of\n * the blob.\n */\n lastModified?: Date;\n /**\n * Uniquely identifies a container's lease\n */\n leaseId?: string;\n /**\n * Approximate time remaining in the lease\n * period, in seconds.\n */\n leaseTime?: number;\n /**\n * This header uniquely identifies the request\n * that was made and can be used for troubleshooting the request.\n */\n requestId?: string;\n /**\n * Indicates the version of the Blob service used\n * to execute the request. This header is returned for requests made against\n * version 2009-09-19 and above.\n */\n version?: string;\n /**\n * UTC date/time value generated by the service that\n * indicates the time at which the response was initiated\n */\n date?: Date;\n /**\n * Error code if any associated with the response that returned\n * the Lease information.\n */\n errorCode?: string;\n}\n\n/**\n * Contains the response data for operations that create, modify, or delete a lease.\n *\n * See {@link BlobLeaseClient}.\n */\nexport type LeaseOperationResponse = WithResponse<Lease, Lease>;\n\n/**\n * Configures lease operations.\n */\nexport interface LeaseOperationOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Conditions to meet when changing the lease.\n */\n conditions?: ModifiedAccessConditions;\n}\n\n/**\n * A client that manages leases for a {@link ContainerClient} or a {@link BlobClient}.\n */\nexport class BlobLeaseClient {\n private _leaseId: string;\n private _url: string;\n private _containerOrBlobOperation: Container | StorageBlob;\n private _isContainer: boolean;\n\n /**\n * Gets the lease Id.\n *\n * @readonly\n */\n public get leaseId(): string {\n return this._leaseId;\n }\n\n /**\n * Gets the url.\n *\n * @readonly\n */\n public get url(): string {\n return this._url;\n }\n\n /**\n * Creates an instance of BlobLeaseClient.\n * @param client - The client to make the lease operation requests.\n * @param leaseId - Initial proposed lease id.\n */\n constructor(client: ContainerClient | BlobClient, leaseId?: string) {\n const clientContext = (client as any).storageClientContext;\n this._url = client.url;\n\n if ((client as BlobClient).name === undefined) {\n this._isContainer = true;\n this._containerOrBlobOperation = clientContext.container;\n } else {\n this._isContainer = false;\n this._containerOrBlobOperation = clientContext.blob;\n }\n\n if (!leaseId) {\n leaseId = randomUUID();\n }\n this._leaseId = leaseId;\n }\n\n /**\n * Establishes and manages a lock on a container for delete operations, or on a blob\n * for write and delete operations.\n * The lock duration can be 15 to 60 seconds, or can be infinite.\n * @see https://learn.microsoft.com/rest/api/storageservices/lease-container\n * and\n * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob\n *\n * @param duration - Must be between 15 to 60 seconds, or infinite (-1)\n * @param options - option to configure lease management operations.\n * @returns Response data for acquire lease operation.\n */\n public async acquireLease(\n duration: number,\n options: LeaseOperationOptions = {},\n ): Promise<LeaseOperationResponse> {\n if (\n this._isContainer &&\n ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||\n (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||\n options.conditions?.tagConditions)\n ) {\n throw new RangeError(\n \"The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.\",\n );\n }\n return tracingClient.withSpan(\n \"BlobLeaseClient-acquireLease\",\n options,\n async (updatedOptions) => {\n return assertResponse<ContainerAcquireLeaseHeaders, ContainerAcquireLeaseHeaders>(\n await this._containerOrBlobOperation.acquireLease({\n abortSignal: options.abortSignal,\n duration,\n modifiedAccessConditions: {\n ...options.conditions,\n ifTags: options.conditions?.tagConditions,\n },\n proposedLeaseId: this._leaseId,\n tracingOptions: updatedOptions.tracingOptions,\n }),\n );\n },\n );\n }\n\n /**\n * To change the ID of the lease.\n * @see https://learn.microsoft.com/rest/api/storageservices/lease-container\n * and\n * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob\n *\n * @param proposedLeaseId - the proposed new lease Id.\n * @param options - option to configure lease management operations.\n * @returns Response data for change lease operation.\n */\n public async changeLease(\n proposedLeaseId: string,\n options: LeaseOperationOptions = {},\n ): Promise<LeaseOperationResponse> {\n if (\n this._isContainer &&\n ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||\n (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||\n options.conditions?.tagConditions)\n ) {\n throw new RangeError(\n \"The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.\",\n );\n }\n\n return tracingClient.withSpan(\n \"BlobLeaseClient-changeLease\",\n options,\n async (updatedOptions) => {\n const response = assertResponse<Lease, Lease>(\n await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId, {\n abortSignal: options.abortSignal,\n modifiedAccessConditions: {\n ...options.conditions,\n ifTags: options.conditions?.tagConditions,\n },\n tracingOptions: updatedOptions.tracingOptions,\n }),\n );\n this._leaseId = proposedLeaseId;\n return response;\n },\n );\n }\n\n /**\n * To free the lease if it is no longer needed so that another client may\n * immediately acquire a lease against the container or the blob.\n * @see https://learn.microsoft.com/rest/api/storageservices/lease-container\n * and\n * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob\n *\n * @param options - option to configure lease management operations.\n * @returns Response data for release lease operation.\n */\n public async releaseLease(options: LeaseOperationOptions = {}): Promise<LeaseOperationResponse> {\n if (\n this._isContainer &&\n ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||\n (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||\n options.conditions?.tagConditions)\n ) {\n throw new RangeError(\n \"The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.\",\n );\n }\n return tracingClient.withSpan(\n \"BlobLeaseClient-releaseLease\",\n options,\n async (updatedOptions) => {\n return assertResponse<ContainerReleaseLeaseHeaders, ContainerReleaseLeaseHeaders>(\n await this._containerOrBlobOperation.releaseLease(this._leaseId, {\n abortSignal: options.abortSignal,\n modifiedAccessConditions: {\n ...options.conditions,\n ifTags: options.conditions?.tagConditions,\n },\n tracingOptions: updatedOptions.tracingOptions,\n }),\n );\n },\n );\n }\n\n /**\n * To renew the lease.\n * @see https://learn.microsoft.com/rest/api/storageservices/lease-container\n * and\n * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob\n *\n * @param options - Optional option to configure lease management operations.\n * @returns Response data for renew lease operation.\n */\n public async renewLease(options: LeaseOperationOptions = {}): Promise<Lease> {\n if (\n this._isContainer &&\n ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||\n (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||\n options.conditions?.tagConditions)\n ) {\n throw new RangeError(\n \"The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.\",\n );\n }\n return tracingClient.withSpan(\"BlobLeaseClient-renewLease\", options, async (updatedOptions) => {\n return this._containerOrBlobOperation.renewLease(this._leaseId, {\n abortSignal: options.abortSignal,\n modifiedAccessConditions: {\n ...options.conditions,\n ifTags: options.conditions?.tagConditions,\n },\n tracingOptions: updatedOptions.tracingOptions,\n });\n });\n }\n\n /**\n * To end the lease but ensure that another client cannot acquire a new lease\n * until the current lease period has expired.\n * @see https://learn.microsoft.com/rest/api/storageservices/lease-container\n * and\n * @see https://learn.microsoft.com/rest/api/storageservices/lease-blob\n *\n * @param breakPeriod - Break period\n * @param options - Optional options to configure lease management operations.\n * @returns Response data for break lease operation.\n */\n public async breakLease(\n breakPeriod: number,\n options: LeaseOperationOptions = {},\n ): Promise<LeaseOperationResponse> {\n if (\n this._isContainer &&\n ((options.conditions?.ifMatch && options.conditions?.ifMatch !== ETagNone) ||\n (options.conditions?.ifNoneMatch && options.conditions?.ifNoneMatch !== ETagNone) ||\n options.conditions?.tagConditions)\n ) {\n throw new RangeError(\n \"The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.\",\n );\n }\n\n return tracingClient.withSpan(\"BlobLeaseClient-breakLease\", options, async (updatedOptions) => {\n const operationOptions: ContainerBreakLeaseOptionalParams = {\n abortSignal: options.abortSignal,\n breakPeriod,\n modifiedAccessConditions: {\n ...options.conditions,\n ifTags: options.conditions?.tagConditions,\n },\n tracingOptions: updatedOptions.tracingOptions,\n };\n return assertResponse<ContainerBreakLeaseHeaders, ContainerBreakLeaseHeaders>(\n await this._containerOrBlobOperation.breakLease(operationOptions),\n );\n });\n }\n}\n"]}
|
@@ -297,7 +297,7 @@ export declare class BlobServiceClient extends StorageClient {
|
|
297
297
|
*/
|
298
298
|
getContainerClient(containerName: string): ContainerClient;
|
299
299
|
/**
|
300
|
-
* Create a Blob container. @see https://learn.microsoft.com/
|
300
|
+
* Create a Blob container. @see https://learn.microsoft.com/rest/api/storageservices/create-container
|
301
301
|
*
|
302
302
|
* @param containerName - Name of the container to create.
|
303
303
|
* @param options - Options to configure Container Create operation.
|
@@ -331,7 +331,7 @@ export declare class BlobServiceClient extends StorageClient {
|
|
331
331
|
/**
|
332
332
|
* Gets the properties of a storage account’s Blob service, including properties
|
333
333
|
* for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
|
334
|
-
* @see https://learn.microsoft.com/
|
334
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties
|
335
335
|
*
|
336
336
|
* @param options - Options to the Service Get Properties operation.
|
337
337
|
* @returns Response data for the Service Get Properties operation.
|
@@ -340,7 +340,7 @@ export declare class BlobServiceClient extends StorageClient {
|
|
340
340
|
/**
|
341
341
|
* Sets properties for a storage account’s Blob service endpoint, including properties
|
342
342
|
* for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings.
|
343
|
-
* @see https://learn.microsoft.com/
|
343
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/set-blob-service-properties
|
344
344
|
*
|
345
345
|
* @param properties -
|
346
346
|
* @param options - Options to the Service Set Properties operation.
|
@@ -351,7 +351,7 @@ export declare class BlobServiceClient extends StorageClient {
|
|
351
351
|
* Retrieves statistics related to replication for the Blob service. It is only
|
352
352
|
* available on the secondary location endpoint when read-access geo-redundant
|
353
353
|
* replication is enabled for the storage account.
|
354
|
-
* @see https://learn.microsoft.com/
|
354
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-stats
|
355
355
|
*
|
356
356
|
* @param options - Options to the Service Get Statistics operation.
|
357
357
|
* @returns Response data for the Service Get Statistics operation.
|
@@ -362,7 +362,7 @@ export declare class BlobServiceClient extends StorageClient {
|
|
362
362
|
* for the specified account.
|
363
363
|
* The Get Account Information operation is available on service versions beginning
|
364
364
|
* with version 2018-03-28.
|
365
|
-
* @see https://learn.microsoft.com/
|
365
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-account-information
|
366
366
|
*
|
367
367
|
* @param options - Options to the Service Get Account Info operation.
|
368
368
|
* @returns Response data for the Service Get Account Info operation.
|
@@ -370,7 +370,7 @@ export declare class BlobServiceClient extends StorageClient {
|
|
370
370
|
getAccountInfo(options?: ServiceGetAccountInfoOptions): Promise<ServiceGetAccountInfoResponse>;
|
371
371
|
/**
|
372
372
|
* Returns a list of the containers under the specified account.
|
373
|
-
* @see https://learn.microsoft.com/
|
373
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/list-containers2
|
374
374
|
*
|
375
375
|
* @param marker - A string value that identifies the portion of
|
376
376
|
* the list of containers to be returned with the next listing operation. The
|
@@ -435,7 +435,7 @@ export declare class BlobServiceClient extends StorageClient {
|
|
435
435
|
*
|
436
436
|
* .byPage() returns an async iterable iterator to list the blobs in pages.
|
437
437
|
*
|
438
|
-
* @see https://learn.microsoft.com/
|
438
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties
|
439
439
|
*
|
440
440
|
* ```ts snippet:BlobServiceClientFindBlobsByTags
|
441
441
|
* import { BlobServiceClient } from "@azure/storage-blob";
|
@@ -601,7 +601,7 @@ export declare class BlobServiceClient extends StorageClient {
|
|
601
601
|
* Retrieves a user delegation key for the Blob service. This is only a valid operation when using
|
602
602
|
* bearer token authentication.
|
603
603
|
*
|
604
|
-
* @see https://learn.microsoft.com/
|
604
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-user-delegation-key
|
605
605
|
*
|
606
606
|
* @param startsOn - The start time for the user delegation SAS. Must be within 7 days of the current time
|
607
607
|
* @param expiresOn - The end time for the user delegation SAS. Must be within 7 days of the current time
|
@@ -610,7 +610,7 @@ export declare class BlobServiceClient extends StorageClient {
|
|
610
610
|
/**
|
611
611
|
* Creates a BlobBatchClient object to conduct batch operations.
|
612
612
|
*
|
613
|
-
* @see https://learn.microsoft.com/
|
613
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/blob-batch
|
614
614
|
*
|
615
615
|
* @returns A new BlobBatchClient object for this service.
|
616
616
|
*/
|
@@ -621,7 +621,7 @@ export declare class BlobServiceClient extends StorageClient {
|
|
621
621
|
* Generates a Blob account Shared Access Signature (SAS) URI based on the client properties
|
622
622
|
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
623
623
|
*
|
624
|
-
* @see https://learn.microsoft.com/
|
624
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas
|
625
625
|
*
|
626
626
|
* @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not provided.
|
627
627
|
* @param permissions - Specifies the list of permissions to be associated with the SAS.
|
@@ -636,7 +636,7 @@ export declare class BlobServiceClient extends StorageClient {
|
|
636
636
|
* Generates string to sign for a Blob account Shared Access Signature (SAS) URI based on
|
637
637
|
* the client properties and parameters passed in. The SAS is signed by the shared key credential of the client.
|
638
638
|
*
|
639
|
-
* @see https://learn.microsoft.com/
|
639
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas
|
640
640
|
*
|
641
641
|
* @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not provided.
|
642
642
|
* @param permissions - Specifies the list of permissions to be associated with the SAS.
|
@@ -106,7 +106,7 @@ class BlobServiceClient extends StorageClient_js_1.StorageClient {
|
|
106
106
|
return new ContainerClient_js_1.ContainerClient((0, utils_common_js_1.appendToURLPath)(this.url, encodeURIComponent(containerName)), this.pipeline);
|
107
107
|
}
|
108
108
|
/**
|
109
|
-
* Create a Blob container. @see https://learn.microsoft.com/
|
109
|
+
* Create a Blob container. @see https://learn.microsoft.com/rest/api/storageservices/create-container
|
110
110
|
*
|
111
111
|
* @param containerName - Name of the container to create.
|
112
112
|
* @param options - Options to configure Container Create operation.
|
@@ -160,7 +160,7 @@ class BlobServiceClient extends StorageClient_js_1.StorageClient {
|
|
160
160
|
/**
|
161
161
|
* Gets the properties of a storage account’s Blob service, including properties
|
162
162
|
* for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
|
163
|
-
* @see https://learn.microsoft.com/
|
163
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties
|
164
164
|
*
|
165
165
|
* @param options - Options to the Service Get Properties operation.
|
166
166
|
* @returns Response data for the Service Get Properties operation.
|
@@ -176,7 +176,7 @@ class BlobServiceClient extends StorageClient_js_1.StorageClient {
|
|
176
176
|
/**
|
177
177
|
* Sets properties for a storage account’s Blob service endpoint, including properties
|
178
178
|
* for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings.
|
179
|
-
* @see https://learn.microsoft.com/
|
179
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/set-blob-service-properties
|
180
180
|
*
|
181
181
|
* @param properties -
|
182
182
|
* @param options - Options to the Service Set Properties operation.
|
@@ -194,7 +194,7 @@ class BlobServiceClient extends StorageClient_js_1.StorageClient {
|
|
194
194
|
* Retrieves statistics related to replication for the Blob service. It is only
|
195
195
|
* available on the secondary location endpoint when read-access geo-redundant
|
196
196
|
* replication is enabled for the storage account.
|
197
|
-
* @see https://learn.microsoft.com/
|
197
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-stats
|
198
198
|
*
|
199
199
|
* @param options - Options to the Service Get Statistics operation.
|
200
200
|
* @returns Response data for the Service Get Statistics operation.
|
@@ -212,7 +212,7 @@ class BlobServiceClient extends StorageClient_js_1.StorageClient {
|
|
212
212
|
* for the specified account.
|
213
213
|
* The Get Account Information operation is available on service versions beginning
|
214
214
|
* with version 2018-03-28.
|
215
|
-
* @see https://learn.microsoft.com/
|
215
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-account-information
|
216
216
|
*
|
217
217
|
* @param options - Options to the Service Get Account Info operation.
|
218
218
|
* @returns Response data for the Service Get Account Info operation.
|
@@ -227,7 +227,7 @@ class BlobServiceClient extends StorageClient_js_1.StorageClient {
|
|
227
227
|
}
|
228
228
|
/**
|
229
229
|
* Returns a list of the containers under the specified account.
|
230
|
-
* @see https://learn.microsoft.com/
|
230
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/list-containers2
|
231
231
|
*
|
232
232
|
* @param marker - A string value that identifies the portion of
|
233
233
|
* the list of containers to be returned with the next listing operation. The
|
@@ -347,7 +347,7 @@ class BlobServiceClient extends StorageClient_js_1.StorageClient {
|
|
347
347
|
*
|
348
348
|
* .byPage() returns an async iterable iterator to list the blobs in pages.
|
349
349
|
*
|
350
|
-
* @see https://learn.microsoft.com/
|
350
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties
|
351
351
|
*
|
352
352
|
* ```ts snippet:BlobServiceClientFindBlobsByTags
|
353
353
|
* import { BlobServiceClient } from "@azure/storage-blob";
|
@@ -607,7 +607,7 @@ class BlobServiceClient extends StorageClient_js_1.StorageClient {
|
|
607
607
|
* Retrieves a user delegation key for the Blob service. This is only a valid operation when using
|
608
608
|
* bearer token authentication.
|
609
609
|
*
|
610
|
-
* @see https://learn.microsoft.com/
|
610
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-user-delegation-key
|
611
611
|
*
|
612
612
|
* @param startsOn - The start time for the user delegation SAS. Must be within 7 days of the current time
|
613
613
|
* @param expiresOn - The end time for the user delegation SAS. Must be within 7 days of the current time
|
@@ -637,7 +637,7 @@ class BlobServiceClient extends StorageClient_js_1.StorageClient {
|
|
637
637
|
/**
|
638
638
|
* Creates a BlobBatchClient object to conduct batch operations.
|
639
639
|
*
|
640
|
-
* @see https://learn.microsoft.com/
|
640
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/blob-batch
|
641
641
|
*
|
642
642
|
* @returns A new BlobBatchClient object for this service.
|
643
643
|
*/
|
@@ -650,7 +650,7 @@ class BlobServiceClient extends StorageClient_js_1.StorageClient {
|
|
650
650
|
* Generates a Blob account Shared Access Signature (SAS) URI based on the client properties
|
651
651
|
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
652
652
|
*
|
653
|
-
* @see https://learn.microsoft.com/
|
653
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas
|
654
654
|
*
|
655
655
|
* @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not provided.
|
656
656
|
* @param permissions - Specifies the list of permissions to be associated with the SAS.
|
@@ -677,7 +677,7 @@ class BlobServiceClient extends StorageClient_js_1.StorageClient {
|
|
677
677
|
* Generates string to sign for a Blob account Shared Access Signature (SAS) URI based on
|
678
678
|
* the client properties and parameters passed in. The SAS is signed by the shared key credential of the client.
|
679
679
|
*
|
680
|
-
* @see https://learn.microsoft.com/
|
680
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas
|
681
681
|
*
|
682
682
|
* @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not provided.
|
683
683
|
* @param permissions - Specifies the list of permissions to be associated with the SAS.
|