@azure/storage-blob 12.13.0-alpha.20230202.2 → 12.13.0-beta.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/index.js +5893 -5338
- package/dist/index.js.map +1 -1
- package/dist-esm/storage-blob/src/BatchResponse.js.map +1 -1
- package/dist-esm/storage-blob/src/BatchResponseParser.js +2 -3
- package/dist-esm/storage-blob/src/BatchResponseParser.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobBatch.js +87 -74
- package/dist-esm/storage-blob/src/BlobBatch.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobBatchClient.js +23 -10
- package/dist-esm/storage-blob/src/BlobBatchClient.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobDownloadResponse.js +1 -1
- package/dist-esm/storage-blob/src/BlobDownloadResponse.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobLeaseClient.js +83 -54
- package/dist-esm/storage-blob/src/BlobLeaseClient.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobQueryResponse.browser.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobQueryResponse.js +1 -1
- package/dist-esm/storage-blob/src/BlobQueryResponse.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobServiceClient.js +165 -67
- package/dist-esm/storage-blob/src/BlobServiceClient.js.map +1 -1
- package/dist-esm/storage-blob/src/Clients.js +889 -651
- package/dist-esm/storage-blob/src/Clients.js.map +1 -1
- package/dist-esm/storage-blob/src/ContainerClient.js +238 -115
- package/dist-esm/storage-blob/src/ContainerClient.js.map +1 -1
- package/dist-esm/storage-blob/src/PageBlobRangeResponse.js.map +1 -1
- package/dist-esm/storage-blob/src/Pipeline.js +40 -194
- package/dist-esm/storage-blob/src/Pipeline.js.map +1 -1
- package/dist-esm/storage-blob/src/StorageBrowserPolicyFactory.js.map +1 -1
- package/dist-esm/storage-blob/src/StorageClient.js +17 -4
- package/dist-esm/storage-blob/src/StorageClient.js.map +1 -1
- package/dist-esm/storage-blob/src/StorageRetryPolicyFactory.js.map +1 -1
- package/dist-esm/storage-blob/src/TelemetryPolicyFactory.js +50 -0
- package/dist-esm/storage-blob/src/TelemetryPolicyFactory.js.map +1 -0
- package/dist-esm/storage-blob/src/credentials/AnonymousCredential.js.map +1 -1
- package/dist-esm/storage-blob/src/credentials/Credential.js.map +1 -1
- package/dist-esm/storage-blob/src/credentials/StorageSharedKeyCredential.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/index.js +1 -1
- package/dist-esm/storage-blob/src/generated/src/index.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/models/index.js +1 -248
- package/dist-esm/storage-blob/src/generated/src/models/index.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/models/mappers.js +11 -13
- package/dist-esm/storage-blob/src/generated/src/models/mappers.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/models/parameters.js +5 -5
- package/dist-esm/storage-blob/src/generated/src/models/parameters.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/operations/appendBlob.js +27 -11
- package/dist-esm/storage-blob/src/generated/src/operations/appendBlob.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/operations/blob.js +110 -28
- package/dist-esm/storage-blob/src/generated/src/operations/blob.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/operations/blockBlob.js +43 -16
- package/dist-esm/storage-blob/src/generated/src/operations/blockBlob.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/operations/container.js +86 -22
- package/dist-esm/storage-blob/src/generated/src/operations/container.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/operations/pageBlob.js +54 -16
- package/dist-esm/storage-blob/src/generated/src/operations/pageBlob.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/operations/service.js +42 -12
- package/dist-esm/storage-blob/src/generated/src/operations/service.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/storageClient.js +10 -32
- package/dist-esm/storage-blob/src/generated/src/storageClient.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/storageClientContext.js +39 -0
- package/dist-esm/storage-blob/src/generated/src/storageClientContext.js.map +1 -0
- package/dist-esm/storage-blob/src/generatedModels.js.map +1 -1
- package/dist-esm/storage-blob/src/index.browser.js +2 -3
- package/dist-esm/storage-blob/src/index.browser.js.map +1 -1
- package/dist-esm/storage-blob/src/index.js +2 -3
- package/dist-esm/storage-blob/src/index.js.map +1 -1
- package/dist-esm/storage-blob/src/policies/AnonymousCredentialPolicy.js.map +1 -1
- package/dist-esm/storage-blob/src/policies/CredentialPolicy.js +1 -1
- package/dist-esm/storage-blob/src/policies/CredentialPolicy.js.map +1 -1
- package/dist-esm/storage-blob/src/policies/StorageBearerTokenChallengeAuthenticationPolicy.js +245 -0
- package/dist-esm/storage-blob/src/policies/StorageBearerTokenChallengeAuthenticationPolicy.js.map +1 -0
- package/dist-esm/storage-blob/src/policies/StorageBrowserPolicy.js +1 -2
- package/dist-esm/storage-blob/src/policies/StorageBrowserPolicy.js.map +1 -1
- package/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js +1 -1
- package/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js.map +1 -1
- package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.js.map +1 -1
- package/dist-esm/storage-blob/src/policies/TelemetryPolicy.js +36 -0
- package/dist-esm/storage-blob/src/policies/TelemetryPolicy.js.map +1 -0
- package/dist-esm/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.js +1 -1
- package/dist-esm/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/BlobQuickQueryStream.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/RetriableReadableStream.js +2 -10
- package/dist-esm/storage-blob/src/utils/RetriableReadableStream.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/cache.js +2 -5
- package/dist-esm/storage-blob/src/utils/cache.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/constants.js +2 -2
- package/dist-esm/storage-blob/src/utils/constants.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/tracing.js +18 -5
- package/dist-esm/storage-blob/src/utils/tracing.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/utils.common.js +42 -83
- package/dist-esm/storage-blob/src/utils/utils.common.js.map +1 -1
- package/package.json +15 -22
- package/types/3.1/storage-blob.d.ts +625 -2332
- package/types/latest/storage-blob.d.ts +606 -2493
- package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/appendBlob.js +0 -9
- package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/appendBlob.js.map +0 -1
- package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/blob.js +0 -9
- package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/blob.js.map +0 -1
- package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/blockBlob.js +0 -9
- package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/blockBlob.js.map +0 -1
- package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/container.js +0 -9
- package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/container.js.map +0 -1
- package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/index.js +0 -14
- package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/index.js.map +0 -1
- package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/pageBlob.js +0 -9
- package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/pageBlob.js.map +0 -1
- package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/service.js +0 -9
- package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/service.js.map +0 -1
- package/dist-esm/storage-blob/src/policies/PathParameterWorkaroundPolicy.js +0 -25
- package/dist-esm/storage-blob/src/policies/PathParameterWorkaroundPolicy.js.map +0 -1
- package/dist-esm/storage-blob/src/policies/RequestPolicy.js +0 -40
- package/dist-esm/storage-blob/src/policies/RequestPolicy.js.map +0 -1
- package/dist-esm/storage-blob/src/policies/StorageBrowserPolicyV2.js +0 -31
- package/dist-esm/storage-blob/src/policies/StorageBrowserPolicyV2.js.map +0 -1
- package/dist-esm/storage-blob/src/policies/StorageRetryPolicyV2.js +0 -165
- package/dist-esm/storage-blob/src/policies/StorageRetryPolicyV2.js.map +0 -1
- package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.browser.js +0 -18
- package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.browser.js.map +0 -1
- package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.js +0 -131
- package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.js.map +0 -1
@@ -1,13 +1,13 @@
|
|
1
1
|
import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
|
2
|
-
import { getDefaultProxySettings, } from "@azure/core-
|
3
|
-
import {
|
4
|
-
import { isTokenCredential } from "@azure/core-auth";
|
2
|
+
import { getDefaultProxySettings, isNode, isTokenCredential, URLBuilder, } from "@azure/core-http";
|
3
|
+
import { SpanStatusCode } from "@azure/core-tracing";
|
5
4
|
import { AnonymousCredential } from "./credentials/AnonymousCredential";
|
6
5
|
import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential";
|
6
|
+
import { Container } from "./generated/src/operations";
|
7
7
|
import { newPipeline, isPipelineLike } from "./Pipeline";
|
8
8
|
import { StorageClient } from "./StorageClient";
|
9
|
-
import {
|
10
|
-
import { appendToURLPath, appendToURLQuery,
|
9
|
+
import { convertTracingToRequestOptionsBase, createSpan } from "./utils/tracing";
|
10
|
+
import { appendToURLPath, appendToURLQuery, BlobNameToString, ConvertInternalResponseOfListBlobFlat, ConvertInternalResponseOfListBlobHierarchy, EscapePath, extractConnectionStringParts, isIpEndpointStyle, parseObjectReplicationRecord, toTags, truncatedISO8061Date, } from "./utils/utils.common";
|
11
11
|
import { generateBlobSASQueryParameters } from "./sas/BlobSASSignatureValues";
|
12
12
|
import { BlobLeaseClient } from "./BlobLeaseClient";
|
13
13
|
import { AppendBlobClient, BlobClient, BlockBlobClient, PageBlobClient, } from "./Clients";
|
@@ -76,7 +76,7 @@ export class ContainerClient extends StorageClient {
|
|
76
76
|
}
|
77
77
|
super(url, pipeline);
|
78
78
|
this._containerName = this.getContainerNameFromUrl();
|
79
|
-
this.containerContext = this.storageClientContext
|
79
|
+
this.containerContext = new Container(this.storageClientContext);
|
80
80
|
}
|
81
81
|
/**
|
82
82
|
* The name of the container.
|
@@ -102,9 +102,22 @@ export class ContainerClient extends StorageClient {
|
|
102
102
|
* ```
|
103
103
|
*/
|
104
104
|
async create(options = {}) {
|
105
|
-
|
106
|
-
|
107
|
-
|
105
|
+
const { span, updatedOptions } = createSpan("ContainerClient-create", options);
|
106
|
+
try {
|
107
|
+
// Spread operator in destructuring assignments,
|
108
|
+
// this will filter out unwanted properties from the response object into result object
|
109
|
+
return await this.containerContext.create(Object.assign(Object.assign({}, options), convertTracingToRequestOptionsBase(updatedOptions)));
|
110
|
+
}
|
111
|
+
catch (e) {
|
112
|
+
span.setStatus({
|
113
|
+
code: SpanStatusCode.ERROR,
|
114
|
+
message: e.message,
|
115
|
+
});
|
116
|
+
throw e;
|
117
|
+
}
|
118
|
+
finally {
|
119
|
+
span.end();
|
120
|
+
}
|
108
121
|
}
|
109
122
|
/**
|
110
123
|
* Creates a new container under the specified account. If the container with
|
@@ -115,21 +128,29 @@ export class ContainerClient extends StorageClient {
|
|
115
128
|
* @param options -
|
116
129
|
*/
|
117
130
|
async createIfNotExists(options = {}) {
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
}
|
131
|
+
var _a, _b;
|
132
|
+
const { span, updatedOptions } = createSpan("ContainerClient-createIfNotExists", options);
|
133
|
+
try {
|
134
|
+
const res = await this.create(updatedOptions);
|
135
|
+
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });
|
136
|
+
}
|
137
|
+
catch (e) {
|
138
|
+
if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") {
|
139
|
+
span.setStatus({
|
140
|
+
code: SpanStatusCode.ERROR,
|
141
|
+
message: "Expected exception when creating a container only if it does not already exist.",
|
142
|
+
});
|
143
|
+
return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
|
131
144
|
}
|
132
|
-
|
145
|
+
span.setStatus({
|
146
|
+
code: SpanStatusCode.ERROR,
|
147
|
+
message: e.message,
|
148
|
+
});
|
149
|
+
throw e;
|
150
|
+
}
|
151
|
+
finally {
|
152
|
+
span.end();
|
153
|
+
}
|
133
154
|
}
|
134
155
|
/**
|
135
156
|
* Returns true if the Azure container resource represented by this client exists; false otherwise.
|
@@ -141,21 +162,31 @@ export class ContainerClient extends StorageClient {
|
|
141
162
|
* @param options -
|
142
163
|
*/
|
143
164
|
async exists(options = {}) {
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
165
|
+
const { span, updatedOptions } = createSpan("ContainerClient-exists", options);
|
166
|
+
try {
|
167
|
+
await this.getProperties({
|
168
|
+
abortSignal: options.abortSignal,
|
169
|
+
tracingOptions: updatedOptions.tracingOptions,
|
170
|
+
});
|
171
|
+
return true;
|
172
|
+
}
|
173
|
+
catch (e) {
|
174
|
+
if (e.statusCode === 404) {
|
175
|
+
span.setStatus({
|
176
|
+
code: SpanStatusCode.ERROR,
|
177
|
+
message: "Expected exception when checking container existence",
|
149
178
|
});
|
150
|
-
return
|
179
|
+
return false;
|
151
180
|
}
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
181
|
+
span.setStatus({
|
182
|
+
code: SpanStatusCode.ERROR,
|
183
|
+
message: e.message,
|
184
|
+
});
|
185
|
+
throw e;
|
186
|
+
}
|
187
|
+
finally {
|
188
|
+
span.end();
|
189
|
+
}
|
159
190
|
}
|
160
191
|
/**
|
161
192
|
* Creates a {@link BlobClient}
|
@@ -216,9 +247,20 @@ export class ContainerClient extends StorageClient {
|
|
216
247
|
if (!options.conditions) {
|
217
248
|
options.conditions = {};
|
218
249
|
}
|
219
|
-
|
220
|
-
|
221
|
-
|
250
|
+
const { span, updatedOptions } = createSpan("ContainerClient-getProperties", options);
|
251
|
+
try {
|
252
|
+
return await this.containerContext.getProperties(Object.assign(Object.assign({ abortSignal: options.abortSignal }, options.conditions), convertTracingToRequestOptionsBase(updatedOptions)));
|
253
|
+
}
|
254
|
+
catch (e) {
|
255
|
+
span.setStatus({
|
256
|
+
code: SpanStatusCode.ERROR,
|
257
|
+
message: e.message,
|
258
|
+
});
|
259
|
+
throw e;
|
260
|
+
}
|
261
|
+
finally {
|
262
|
+
span.end();
|
263
|
+
}
|
222
264
|
}
|
223
265
|
/**
|
224
266
|
* Marks the specified container for deletion. The container and any blobs
|
@@ -231,14 +273,20 @@ export class ContainerClient extends StorageClient {
|
|
231
273
|
if (!options.conditions) {
|
232
274
|
options.conditions = {};
|
233
275
|
}
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
276
|
+
const { span, updatedOptions } = createSpan("ContainerClient-delete", options);
|
277
|
+
try {
|
278
|
+
return await this.containerContext.delete(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions)));
|
279
|
+
}
|
280
|
+
catch (e) {
|
281
|
+
span.setStatus({
|
282
|
+
code: SpanStatusCode.ERROR,
|
283
|
+
message: e.message,
|
284
|
+
});
|
285
|
+
throw e;
|
286
|
+
}
|
287
|
+
finally {
|
288
|
+
span.end();
|
289
|
+
}
|
242
290
|
}
|
243
291
|
/**
|
244
292
|
* Marks the specified container for deletion if it exists. The container and any blobs
|
@@ -248,19 +296,29 @@ export class ContainerClient extends StorageClient {
|
|
248
296
|
* @param options - Options to Container Delete operation.
|
249
297
|
*/
|
250
298
|
async deleteIfExists(options = {}) {
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
299
|
+
var _a, _b;
|
300
|
+
const { span, updatedOptions } = createSpan("ContainerClient-deleteIfExists", options);
|
301
|
+
try {
|
302
|
+
const res = await this.delete(updatedOptions);
|
303
|
+
return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });
|
304
|
+
}
|
305
|
+
catch (e) {
|
306
|
+
if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") {
|
307
|
+
span.setStatus({
|
308
|
+
code: SpanStatusCode.ERROR,
|
309
|
+
message: "Expected exception when deleting a container only if it exists.",
|
310
|
+
});
|
311
|
+
return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
|
262
312
|
}
|
263
|
-
|
313
|
+
span.setStatus({
|
314
|
+
code: SpanStatusCode.ERROR,
|
315
|
+
message: e.message,
|
316
|
+
});
|
317
|
+
throw e;
|
318
|
+
}
|
319
|
+
finally {
|
320
|
+
span.end();
|
321
|
+
}
|
264
322
|
}
|
265
323
|
/**
|
266
324
|
* Sets one or more user-defined name-value pairs for the specified container.
|
@@ -281,15 +339,20 @@ export class ContainerClient extends StorageClient {
|
|
281
339
|
if (options.conditions.ifUnmodifiedSince) {
|
282
340
|
throw new RangeError("the IfUnmodifiedSince must have their default values because they are ignored by the blob service");
|
283
341
|
}
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
342
|
+
const { span, updatedOptions } = createSpan("ContainerClient-setMetadata", options);
|
343
|
+
try {
|
344
|
+
return await this.containerContext.setMetadata(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata, modifiedAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions)));
|
345
|
+
}
|
346
|
+
catch (e) {
|
347
|
+
span.setStatus({
|
348
|
+
code: SpanStatusCode.ERROR,
|
349
|
+
message: e.message,
|
350
|
+
});
|
351
|
+
throw e;
|
352
|
+
}
|
353
|
+
finally {
|
354
|
+
span.end();
|
355
|
+
}
|
293
356
|
}
|
294
357
|
/**
|
295
358
|
* Gets the permissions for the specified container. The permissions indicate
|
@@ -306,12 +369,9 @@ export class ContainerClient extends StorageClient {
|
|
306
369
|
if (!options.conditions) {
|
307
370
|
options.conditions = {};
|
308
371
|
}
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
leaseAccessConditions: options.conditions,
|
313
|
-
tracingOptions: updatedOptions.tracingOptions,
|
314
|
-
}));
|
372
|
+
const { span, updatedOptions } = createSpan("ContainerClient-getAccessPolicy", options);
|
373
|
+
try {
|
374
|
+
const response = await this.containerContext.getAccessPolicy(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions)));
|
315
375
|
const res = {
|
316
376
|
_response: response._response,
|
317
377
|
blobPublicAccess: response.blobPublicAccess,
|
@@ -343,7 +403,17 @@ export class ContainerClient extends StorageClient {
|
|
343
403
|
});
|
344
404
|
}
|
345
405
|
return res;
|
346
|
-
}
|
406
|
+
}
|
407
|
+
catch (e) {
|
408
|
+
span.setStatus({
|
409
|
+
code: SpanStatusCode.ERROR,
|
410
|
+
message: e.message,
|
411
|
+
});
|
412
|
+
throw e;
|
413
|
+
}
|
414
|
+
finally {
|
415
|
+
span.end();
|
416
|
+
}
|
347
417
|
}
|
348
418
|
/**
|
349
419
|
* Sets the permissions for the specified container. The permissions indicate
|
@@ -364,7 +434,8 @@ export class ContainerClient extends StorageClient {
|
|
364
434
|
*/
|
365
435
|
async setAccessPolicy(access, containerAcl, options = {}) {
|
366
436
|
options.conditions = options.conditions || {};
|
367
|
-
|
437
|
+
const { span, updatedOptions } = createSpan("ContainerClient-setAccessPolicy", options);
|
438
|
+
try {
|
368
439
|
const acl = [];
|
369
440
|
for (const identifier of containerAcl || []) {
|
370
441
|
acl.push({
|
@@ -380,15 +451,18 @@ export class ContainerClient extends StorageClient {
|
|
380
451
|
id: identifier.id,
|
381
452
|
});
|
382
453
|
}
|
383
|
-
return
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
}
|
454
|
+
return await this.containerContext.setAccessPolicy(Object.assign({ abortSignal: options.abortSignal, access, containerAcl: acl, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions)));
|
455
|
+
}
|
456
|
+
catch (e) {
|
457
|
+
span.setStatus({
|
458
|
+
code: SpanStatusCode.ERROR,
|
459
|
+
message: e.message,
|
460
|
+
});
|
461
|
+
throw e;
|
462
|
+
}
|
463
|
+
finally {
|
464
|
+
span.end();
|
465
|
+
}
|
392
466
|
}
|
393
467
|
/**
|
394
468
|
* Get a {@link BlobLeaseClient} that manages leases on the container.
|
@@ -422,14 +496,25 @@ export class ContainerClient extends StorageClient {
|
|
422
496
|
* @returns Block Blob upload response data and the corresponding BlockBlobClient instance.
|
423
497
|
*/
|
424
498
|
async uploadBlockBlob(blobName, body, contentLength, options = {}) {
|
425
|
-
|
499
|
+
const { span, updatedOptions } = createSpan("ContainerClient-uploadBlockBlob", options);
|
500
|
+
try {
|
426
501
|
const blockBlobClient = this.getBlockBlobClient(blobName);
|
427
502
|
const response = await blockBlobClient.upload(body, contentLength, updatedOptions);
|
428
503
|
return {
|
429
504
|
blockBlobClient,
|
430
505
|
response,
|
431
506
|
};
|
432
|
-
}
|
507
|
+
}
|
508
|
+
catch (e) {
|
509
|
+
span.setStatus({
|
510
|
+
code: SpanStatusCode.ERROR,
|
511
|
+
message: e.message,
|
512
|
+
});
|
513
|
+
throw e;
|
514
|
+
}
|
515
|
+
finally {
|
516
|
+
span.end();
|
517
|
+
}
|
433
518
|
}
|
434
519
|
/**
|
435
520
|
* Marks the specified blob or snapshot for deletion. The blob is later deleted
|
@@ -443,13 +528,24 @@ export class ContainerClient extends StorageClient {
|
|
443
528
|
* @returns Block blob deletion response data.
|
444
529
|
*/
|
445
530
|
async deleteBlob(blobName, options = {}) {
|
446
|
-
|
531
|
+
const { span, updatedOptions } = createSpan("ContainerClient-deleteBlob", options);
|
532
|
+
try {
|
447
533
|
let blobClient = this.getBlobClient(blobName);
|
448
534
|
if (options.versionId) {
|
449
535
|
blobClient = blobClient.withVersion(options.versionId);
|
450
536
|
}
|
451
|
-
return blobClient.delete(updatedOptions);
|
452
|
-
}
|
537
|
+
return await blobClient.delete(updatedOptions);
|
538
|
+
}
|
539
|
+
catch (e) {
|
540
|
+
span.setStatus({
|
541
|
+
code: SpanStatusCode.ERROR,
|
542
|
+
message: e.message,
|
543
|
+
});
|
544
|
+
throw e;
|
545
|
+
}
|
546
|
+
finally {
|
547
|
+
span.end();
|
548
|
+
}
|
453
549
|
}
|
454
550
|
/**
|
455
551
|
* listBlobFlatSegment returns a single segment of blobs starting from the
|
@@ -462,14 +558,25 @@ export class ContainerClient extends StorageClient {
|
|
462
558
|
* @param options - Options to Container List Blob Flat Segment operation.
|
463
559
|
*/
|
464
560
|
async listBlobFlatSegment(marker, options = {}) {
|
465
|
-
|
466
|
-
|
467
|
-
const
|
468
|
-
|
561
|
+
const { span, updatedOptions } = createSpan("ContainerClient-listBlobFlatSegment", options);
|
562
|
+
try {
|
563
|
+
const response = await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));
|
564
|
+
const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInteral) => {
|
565
|
+
const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name), tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) });
|
469
566
|
return blobItem;
|
470
567
|
}) }) });
|
471
568
|
return wrappedResponse;
|
472
|
-
}
|
569
|
+
}
|
570
|
+
catch (e) {
|
571
|
+
span.setStatus({
|
572
|
+
code: SpanStatusCode.ERROR,
|
573
|
+
message: e.message,
|
574
|
+
});
|
575
|
+
throw e;
|
576
|
+
}
|
577
|
+
finally {
|
578
|
+
span.end();
|
579
|
+
}
|
473
580
|
}
|
474
581
|
/**
|
475
582
|
* listBlobHierarchySegment returns a single segment of blobs starting from
|
@@ -483,11 +590,12 @@ export class ContainerClient extends StorageClient {
|
|
483
590
|
* @param options - Options to Container List Blob Hierarchy Segment operation.
|
484
591
|
*/
|
485
592
|
async listBlobHierarchySegment(delimiter, marker, options = {}) {
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
const
|
490
|
-
|
593
|
+
var _a;
|
594
|
+
const { span, updatedOptions } = createSpan("ContainerClient-listBlobHierarchySegment", options);
|
595
|
+
try {
|
596
|
+
const response = await this.containerContext.listBlobHierarchySegment(delimiter, Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));
|
597
|
+
const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobHierarchy(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInteral) => {
|
598
|
+
const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name), tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) });
|
491
599
|
return blobItem;
|
492
600
|
}), blobPrefixes: (_a = response.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => {
|
493
601
|
const blobPrefix = {
|
@@ -496,7 +604,17 @@ export class ContainerClient extends StorageClient {
|
|
496
604
|
return blobPrefix;
|
497
605
|
}) }) });
|
498
606
|
return wrappedResponse;
|
499
|
-
}
|
607
|
+
}
|
608
|
+
catch (e) {
|
609
|
+
span.setStatus({
|
610
|
+
code: SpanStatusCode.ERROR,
|
611
|
+
message: e.message,
|
612
|
+
});
|
613
|
+
throw e;
|
614
|
+
}
|
615
|
+
finally {
|
616
|
+
span.end();
|
617
|
+
}
|
500
618
|
}
|
501
619
|
/**
|
502
620
|
* Returns an AsyncIterableIterator for ContainerListBlobFlatSegmentResponse
|
@@ -891,14 +1009,9 @@ export class ContainerClient extends StorageClient {
|
|
891
1009
|
* @param options - Options to find blobs by tags.
|
892
1010
|
*/
|
893
1011
|
async findBlobsByTagsSegment(tagFilterSqlExpression, marker, options = {}) {
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
where: tagFilterSqlExpression,
|
898
|
-
marker,
|
899
|
-
maxPageSize: options.maxPageSize,
|
900
|
-
tracingOptions: updatedOptions.tracingOptions,
|
901
|
-
}));
|
1012
|
+
const { span, updatedOptions } = createSpan("ContainerClient-findBlobsByTagsSegment", options);
|
1013
|
+
try {
|
1014
|
+
const response = await this.containerContext.filterBlobs(Object.assign({ abortSignal: options.abortSignal, where: tagFilterSqlExpression, marker, maxPageSize: options.maxPageSize }, convertTracingToRequestOptionsBase(updatedOptions)));
|
902
1015
|
const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => {
|
903
1016
|
var _a;
|
904
1017
|
let tagValue = "";
|
@@ -908,7 +1021,17 @@ export class ContainerClient extends StorageClient {
|
|
908
1021
|
return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue });
|
909
1022
|
}) });
|
910
1023
|
return wrappedResponse;
|
911
|
-
}
|
1024
|
+
}
|
1025
|
+
catch (e) {
|
1026
|
+
span.setStatus({
|
1027
|
+
code: SpanStatusCode.ERROR,
|
1028
|
+
message: e.message,
|
1029
|
+
});
|
1030
|
+
throw e;
|
1031
|
+
}
|
1032
|
+
finally {
|
1033
|
+
span.end();
|
1034
|
+
}
|
912
1035
|
}
|
913
1036
|
/**
|
914
1037
|
* Returns an AsyncIterableIterator for ContainerFindBlobsByTagsSegmentResponse.
|
@@ -1077,23 +1200,23 @@ export class ContainerClient extends StorageClient {
|
|
1077
1200
|
// "https://myaccount.blob.core.windows.net/mycontainer";
|
1078
1201
|
// IPv4/IPv6 address hosts, Endpoints - `http://127.0.0.1:10000/devstoreaccount1/containername`
|
1079
1202
|
// http://localhost:10001/devstoreaccount1/containername
|
1080
|
-
const parsedUrl =
|
1081
|
-
if (parsedUrl.
|
1203
|
+
const parsedUrl = URLBuilder.parse(this.url);
|
1204
|
+
if (parsedUrl.getHost().split(".")[1] === "blob") {
|
1082
1205
|
// "https://myaccount.blob.core.windows.net/containername".
|
1083
1206
|
// "https://customdomain.com/containername".
|
1084
1207
|
// .getPath() -> /containername
|
1085
|
-
containerName = parsedUrl.
|
1208
|
+
containerName = parsedUrl.getPath().split("/")[1];
|
1086
1209
|
}
|
1087
1210
|
else if (isIpEndpointStyle(parsedUrl)) {
|
1088
1211
|
// IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/containername
|
1089
1212
|
// Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/containername
|
1090
1213
|
// .getPath() -> /devstoreaccount1/containername
|
1091
|
-
containerName = parsedUrl.
|
1214
|
+
containerName = parsedUrl.getPath().split("/")[2];
|
1092
1215
|
}
|
1093
1216
|
else {
|
1094
1217
|
// "https://customdomain.com/containername".
|
1095
1218
|
// .getPath() -> /containername
|
1096
|
-
containerName = parsedUrl.
|
1219
|
+
containerName = parsedUrl.getPath().split("/")[1];
|
1097
1220
|
}
|
1098
1221
|
// decode the encoded containerName - to get all the special characters that might be present in it
|
1099
1222
|
containerName = decodeURIComponent(containerName);
|