@azure/storage-blob 12.20.0-alpha.20230306.3 → 12.20.0-alpha.20230410.3
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 +17 -29
- package/dist/index.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobBatch.js +0 -2
- package/dist-esm/storage-blob/src/BlobBatch.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobBatchClient.js +2 -2
- package/dist-esm/storage-blob/src/BlobBatchClient.js.map +1 -1
- package/dist-esm/storage-blob/src/Pipeline.js +0 -2
- package/dist-esm/storage-blob/src/Pipeline.js.map +1 -1
- package/dist-esm/storage-blob/src/StorageClient.js +2 -2
- package/dist-esm/storage-blob/src/StorageClient.js.map +1 -1
- package/dist-esm/storage-blob/src/StorageContextClient.js +17 -0
- package/dist-esm/storage-blob/src/StorageContextClient.js.map +1 -0
- package/package.json +2 -2
- 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/index.js
CHANGED
@@ -1817,31 +1817,6 @@ function storageSharedKeyCredentialPolicy(options) {
|
|
1817
1817
|
};
|
1818
1818
|
}
|
1819
1819
|
|
1820
|
-
// Copyright (c) Microsoft Corporation.
|
1821
|
-
// Licensed under the MIT license.
|
1822
|
-
/**
|
1823
|
-
* The programmatic identifier of the pathParameterWorkaroundPolicy.
|
1824
|
-
*/
|
1825
|
-
const pathParameterWorkaroundPolicyName = "pathParameterWorkaroundPolicy";
|
1826
|
-
/**
|
1827
|
-
* pathParameterWorkaroundPolicy works around a generator issue with path parameters being
|
1828
|
-
* left in the URL.
|
1829
|
-
*/
|
1830
|
-
function pathParameterWorkaroundPolicy() {
|
1831
|
-
return {
|
1832
|
-
name: pathParameterWorkaroundPolicyName,
|
1833
|
-
async sendRequest(request, next) {
|
1834
|
-
if (request.url.includes("/%7BcontainerName%7D/%7Bblob%7D")) {
|
1835
|
-
request.url = request.url.replace("/%7BcontainerName%7D/%7Bblob%7D", "");
|
1836
|
-
}
|
1837
|
-
else if (request.url.includes("/%7BcontainerName%7D")) {
|
1838
|
-
request.url = request.url.replace("/%7BcontainerName%7D", "");
|
1839
|
-
}
|
1840
|
-
return next(request);
|
1841
|
-
},
|
1842
|
-
};
|
1843
|
-
}
|
1844
|
-
|
1845
1820
|
// Copyright (c) Microsoft Corporation.
|
1846
1821
|
/**
|
1847
1822
|
* StorageBrowserPolicy will handle differences between Node.js and browser runtime, including:
|
@@ -2028,7 +2003,6 @@ function getCoreClientOptions(pipeline) {
|
|
2028
2003
|
} }));
|
2029
2004
|
corePipeline.removePolicy({ phase: "Retry" });
|
2030
2005
|
corePipeline.removePolicy({ name: coreRestPipeline.decompressResponsePolicyName });
|
2031
|
-
corePipeline.addPolicy(pathParameterWorkaroundPolicy());
|
2032
2006
|
corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: "Retry" });
|
2033
2007
|
corePipeline.addPolicy(storageBrowserPolicy());
|
2034
2008
|
const downlevelResults = processDownlevelPipeline(pipeline);
|
@@ -15216,6 +15190,21 @@ class StorageClient$1 extends coreHttpCompat__namespace.ExtendedServiceClient {
|
|
15216
15190
|
}
|
15217
15191
|
}
|
15218
15192
|
|
15193
|
+
// Copyright (c) Microsoft Corporation.
|
15194
|
+
/**
|
15195
|
+
* @internal
|
15196
|
+
*/
|
15197
|
+
class StorageContextClient extends StorageClient$1 {
|
15198
|
+
async sendOperationRequest(operationArguments, operationSpec) {
|
15199
|
+
const operationSpecToSend = Object.assign({}, operationSpec);
|
15200
|
+
if (operationSpecToSend.path === "/{containerName}" ||
|
15201
|
+
operationSpecToSend.path === "/{containerName}/{blob}") {
|
15202
|
+
operationSpecToSend.path = "";
|
15203
|
+
}
|
15204
|
+
return super.sendOperationRequest(operationArguments, operationSpecToSend);
|
15205
|
+
}
|
15206
|
+
}
|
15207
|
+
|
15219
15208
|
// Copyright (c) Microsoft Corporation.
|
15220
15209
|
/**
|
15221
15210
|
* A StorageClient represents a based URL class for {@link BlobServiceClient}, {@link ContainerClient}
|
@@ -15232,7 +15221,7 @@ class StorageClient {
|
|
15232
15221
|
this.url = escapeURLPath(url);
|
15233
15222
|
this.accountName = getAccountNameFromUrl(url);
|
15234
15223
|
this.pipeline = pipeline;
|
15235
|
-
this.storageClientContext = new
|
15224
|
+
this.storageClientContext = new StorageContextClient(this.url, getCoreClientOptions(pipeline));
|
15236
15225
|
this.isHttps = iEqual(getURLScheme(this.url) || "", "https");
|
15237
15226
|
this.credential = getCredentialFromPipeline(pipeline);
|
15238
15227
|
// Override protocol layer's default content-type
|
@@ -22010,7 +21999,6 @@ class InnerBatchRequest {
|
|
22010
21999
|
},
|
22011
22000
|
},
|
22012
22001
|
}), { phase: "Serialize" });
|
22013
|
-
corePipeline.addPolicy(pathParameterWorkaroundPolicy());
|
22014
22002
|
// Use batch header filter policy to exclude unnecessary headers
|
22015
22003
|
corePipeline.addPolicy(batchHeaderFilterPolicy());
|
22016
22004
|
// Use batch assemble policy to assemble request and intercept request from going to wire
|
@@ -22127,7 +22115,7 @@ class BlobBatchClient {
|
|
22127
22115
|
else {
|
22128
22116
|
pipeline = newPipeline(credentialOrPipeline, options);
|
22129
22117
|
}
|
22130
|
-
const storageClientContext = new
|
22118
|
+
const storageClientContext = new StorageContextClient(url, getCoreClientOptions(pipeline));
|
22131
22119
|
const path = getURLPath(url);
|
22132
22120
|
if (path && path !== "/") {
|
22133
22121
|
// Container scoped.
|