@azure/storage-common 12.4.0 → 12.5.0
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/StorageResponseFormat.d.ts +22 -0
- package/dist/browser/StorageResponseFormat.d.ts.map +1 -0
- package/dist/browser/StorageResponseFormat.js +20 -0
- package/dist/browser/StorageResponseFormat.js.map +1 -0
- package/dist/browser/crc64.js +6 -132
- package/dist/browser/indexPlatform-browser.d.mts +2 -0
- package/dist/browser/indexPlatform-browser.d.mts.map +1 -1
- package/dist/browser/indexPlatform-browser.mjs +2 -0
- package/dist/browser/indexPlatform-browser.mjs.map +1 -1
- package/dist/browser/policies/StorageRedirectRangeHeaderPolicy.d.ts +10 -0
- package/dist/browser/policies/StorageRedirectRangeHeaderPolicy.d.ts.map +1 -0
- package/dist/browser/policies/StorageRedirectRangeHeaderPolicy.js +22 -0
- package/dist/browser/policies/StorageRedirectRangeHeaderPolicy.js.map +1 -0
- package/dist/browser/policies/StorageRequestFailureDetailsParserPolicy.d.ts.map +1 -1
- package/dist/browser/policies/StorageRequestFailureDetailsParserPolicy.js +12 -0
- package/dist/browser/policies/StorageRequestFailureDetailsParserPolicy.js.map +1 -1
- package/dist/browser/policies/StorageRetryPolicy.d.ts.map +1 -1
- package/dist/browser/policies/StorageRetryPolicy.js +1 -2
- package/dist/browser/policies/StorageRetryPolicy.js.map +1 -1
- package/dist/browser/utils/constants.js +1 -1
- package/dist/browser/utils/constants.js.map +1 -1
- package/dist/commonjs/StorageResponseFormat.d.ts +22 -0
- package/dist/commonjs/StorageResponseFormat.d.ts.map +1 -0
- package/dist/commonjs/StorageResponseFormat.js +41 -0
- package/dist/commonjs/StorageResponseFormat.js.map +7 -0
- package/dist/commonjs/crc64.js +6 -132
- package/dist/commonjs/indexPlatform.d.ts +2 -0
- package/dist/commonjs/indexPlatform.d.ts.map +1 -1
- package/dist/commonjs/indexPlatform.js +4 -0
- package/dist/commonjs/indexPlatform.js.map +2 -2
- package/dist/commonjs/policies/StorageRedirectRangeHeaderPolicy.d.ts +10 -0
- package/dist/commonjs/policies/StorageRedirectRangeHeaderPolicy.d.ts.map +1 -0
- package/dist/commonjs/policies/StorageRedirectRangeHeaderPolicy.js +42 -0
- package/dist/commonjs/policies/StorageRedirectRangeHeaderPolicy.js.map +7 -0
- package/dist/commonjs/policies/StorageRequestFailureDetailsParserPolicy.d.ts.map +1 -1
- package/dist/commonjs/policies/StorageRequestFailureDetailsParserPolicy.js +6 -0
- package/dist/commonjs/policies/StorageRequestFailureDetailsParserPolicy.js.map +2 -2
- package/dist/commonjs/policies/StorageRetryPolicy.d.ts.map +1 -1
- package/dist/commonjs/policies/StorageRetryPolicy.js.map +2 -2
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/commonjs/utils/constants.js +1 -1
- package/dist/commonjs/utils/constants.js.map +1 -1
- package/dist/esm/StorageResponseFormat.d.ts +22 -0
- package/dist/esm/StorageResponseFormat.d.ts.map +1 -0
- package/dist/esm/StorageResponseFormat.js +20 -0
- package/dist/esm/StorageResponseFormat.js.map +1 -0
- package/dist/esm/crc64.js +6 -154
- package/dist/esm/indexPlatform.d.ts +2 -0
- package/dist/esm/indexPlatform.d.ts.map +1 -1
- package/dist/esm/indexPlatform.js +2 -0
- package/dist/esm/indexPlatform.js.map +1 -1
- package/dist/esm/policies/StorageRedirectRangeHeaderPolicy.d.ts +10 -0
- package/dist/esm/policies/StorageRedirectRangeHeaderPolicy.d.ts.map +1 -0
- package/dist/esm/policies/StorageRedirectRangeHeaderPolicy.js +22 -0
- package/dist/esm/policies/StorageRedirectRangeHeaderPolicy.js.map +1 -0
- package/dist/esm/policies/StorageRequestFailureDetailsParserPolicy.d.ts.map +1 -1
- package/dist/esm/policies/StorageRequestFailureDetailsParserPolicy.js +12 -0
- package/dist/esm/policies/StorageRequestFailureDetailsParserPolicy.js.map +1 -1
- package/dist/esm/policies/StorageRetryPolicy.d.ts.map +1 -1
- package/dist/esm/policies/StorageRetryPolicy.js +1 -2
- package/dist/esm/policies/StorageRetryPolicy.js.map +1 -1
- package/dist/esm/utils/constants.js +1 -1
- package/dist/esm/utils/constants.js.map +1 -1
- package/dist/react-native/StorageResponseFormat.d.ts +22 -0
- package/dist/react-native/StorageResponseFormat.d.ts.map +1 -0
- package/dist/react-native/StorageResponseFormat.js +20 -0
- package/dist/react-native/StorageResponseFormat.js.map +1 -0
- package/dist/react-native/crc64.js +6 -132
- package/dist/react-native/indexPlatform-browser.d.mts +2 -0
- package/dist/react-native/indexPlatform-browser.d.mts.map +1 -1
- package/dist/react-native/indexPlatform-browser.mjs +2 -0
- package/dist/react-native/indexPlatform-browser.mjs.map +1 -1
- package/dist/react-native/policies/StorageRedirectRangeHeaderPolicy.d.ts +10 -0
- package/dist/react-native/policies/StorageRedirectRangeHeaderPolicy.d.ts.map +1 -0
- package/dist/react-native/policies/StorageRedirectRangeHeaderPolicy.js +22 -0
- package/dist/react-native/policies/StorageRedirectRangeHeaderPolicy.js.map +1 -0
- package/dist/react-native/policies/StorageRequestFailureDetailsParserPolicy.d.ts.map +1 -1
- package/dist/react-native/policies/StorageRequestFailureDetailsParserPolicy.js +12 -0
- package/dist/react-native/policies/StorageRequestFailureDetailsParserPolicy.js.map +1 -1
- package/dist/react-native/policies/StorageRetryPolicy.d.ts.map +1 -1
- package/dist/react-native/policies/StorageRetryPolicy.js +1 -2
- package/dist/react-native/policies/StorageRetryPolicy.js.map +1 -1
- package/dist/react-native/utils/constants.js +1 -1
- package/dist/react-native/utils/constants.js.map +1 -1
- package/package.json +9 -9
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
// ESM compatibility block omitted in browsers build as it is NodeJS only.
|
|
5
|
-
|
|
6
4
|
var NativeCRC64 = (() => {
|
|
7
5
|
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
|
8
|
-
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
|
|
9
6
|
return (
|
|
10
7
|
function(NativeCRC64) {
|
|
11
8
|
NativeCRC64 = NativeCRC64 || {};
|
|
@@ -111,50 +108,10 @@ function logExceptionOnExit(e) {
|
|
|
111
108
|
|
|
112
109
|
if (ENVIRONMENT_IS_NODE) {
|
|
113
110
|
if (typeof process == 'undefined' || !process.release || process.release.name !== 'node') throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');
|
|
114
|
-
//
|
|
115
|
-
// the
|
|
116
|
-
//
|
|
117
|
-
//
|
|
118
|
-
// These modules will usually be used on Node.js. Load them eagerly to avoid
|
|
119
|
-
// the complexity of lazy-loading.
|
|
120
|
-
var fs = require('fs');
|
|
121
|
-
var nodePath = require('path');
|
|
122
|
-
|
|
123
|
-
if (ENVIRONMENT_IS_WORKER) {
|
|
124
|
-
scriptDirectory = nodePath.dirname(scriptDirectory) + '/';
|
|
125
|
-
} else {
|
|
126
|
-
scriptDirectory = __dirname + '/';
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// include: node_shell_read.js
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
read_ = (filename, binary) => {
|
|
133
|
-
// We need to re-wrap `file://` strings to URLs. Normalizing isn't
|
|
134
|
-
// necessary in that case, the path should already be absolute.
|
|
135
|
-
filename = isFileURI(filename) ? new URL(filename) : nodePath.normalize(filename);
|
|
136
|
-
return fs.readFileSync(filename, binary ? undefined : 'utf8');
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
readBinary = (filename) => {
|
|
140
|
-
var ret = read_(filename, true);
|
|
141
|
-
if (!ret.buffer) {
|
|
142
|
-
ret = new Uint8Array(ret);
|
|
143
|
-
}
|
|
144
|
-
assert(ret.buffer);
|
|
145
|
-
return ret;
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
readAsync = (filename, onload, onerror) => {
|
|
149
|
-
// See the comment in the `read_` function.
|
|
150
|
-
filename = isFileURI(filename) ? new URL(filename) : nodePath.normalize(filename);
|
|
151
|
-
fs.readFile(filename, function(err, data) {
|
|
152
|
-
if (err) onerror(err);
|
|
153
|
-
else onload(data.buffer);
|
|
154
|
-
});
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
// end include: node_shell_read.js
|
|
111
|
+
// The wasm is base64-embedded (see `binaryInString`) and loaded via `getBinary()`,
|
|
112
|
+
// so the Node fs/path read hooks emitted by Emscripten are never exercised and
|
|
113
|
+
// have been removed. This keeps the file free of Node built-in imports so it can be
|
|
114
|
+
// consumed as-is by web bundlers and by ESM-to-CommonJS bundlers (see issue #39057).
|
|
158
115
|
if (process['argv'].length > 1) {
|
|
159
116
|
thisProgram = process['argv'][1].replace(/\\/g, '/');
|
|
160
117
|
}
|
|
@@ -193,26 +150,6 @@ if (ENVIRONMENT_IS_SHELL) {
|
|
|
193
150
|
|
|
194
151
|
if ((typeof process == 'object' && typeof require === 'function') || typeof window == 'object' || typeof importScripts == 'function') throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');
|
|
195
152
|
|
|
196
|
-
if (typeof read != 'undefined') {
|
|
197
|
-
read_ = function shell_read(f) {
|
|
198
|
-
return read(f);
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
readBinary = function readBinary(f) {
|
|
203
|
-
let data;
|
|
204
|
-
if (typeof readbuffer == 'function') {
|
|
205
|
-
return new Uint8Array(readbuffer(f));
|
|
206
|
-
}
|
|
207
|
-
data = read(f, 'binary');
|
|
208
|
-
assert(typeof data == 'object');
|
|
209
|
-
return data;
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
readAsync = function readAsync(f, onload, onerror) {
|
|
213
|
-
setTimeout(() => onload(readBinary(f)), 0);
|
|
214
|
-
};
|
|
215
|
-
|
|
216
153
|
if (typeof scriptArgs != 'undefined') {
|
|
217
154
|
arguments_ = scriptArgs;
|
|
218
155
|
} else if (typeof arguments != 'undefined') {
|
|
@@ -239,72 +176,9 @@ if (ENVIRONMENT_IS_SHELL) {
|
|
|
239
176
|
// Node.js workers are detected as a combination of ENVIRONMENT_IS_WORKER and
|
|
240
177
|
// ENVIRONMENT_IS_NODE.
|
|
241
178
|
if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
|
|
242
|
-
if (ENVIRONMENT_IS_WORKER) { // Check worker, not web, since window could be polyfilled
|
|
243
|
-
scriptDirectory = self.location.href;
|
|
244
|
-
} else if (typeof document != 'undefined' && document.currentScript) { // web
|
|
245
|
-
scriptDirectory = document.currentScript.src;
|
|
246
|
-
}
|
|
247
|
-
// When MODULARIZE, this JS may be executed later, after document.currentScript
|
|
248
|
-
// is gone, so we saved it, and we use it here instead of any other info.
|
|
249
|
-
if (_scriptDir) {
|
|
250
|
-
scriptDirectory = _scriptDir;
|
|
251
|
-
}
|
|
252
|
-
// blob urls look like blob:http://site.com/etc/etc and we cannot infer anything from them.
|
|
253
|
-
// otherwise, slice off the final part of the url to find the script directory.
|
|
254
|
-
// if scriptDirectory does not contain a slash, lastIndexOf will return -1,
|
|
255
|
-
// and scriptDirectory will correctly be replaced with an empty string.
|
|
256
|
-
// If scriptDirectory contains a query (starting with ?) or a fragment (starting with #),
|
|
257
|
-
// they are removed because they could contain a slash.
|
|
258
|
-
if (scriptDirectory.indexOf('blob:') !== 0) {
|
|
259
|
-
scriptDirectory = scriptDirectory.substr(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf('/')+1);
|
|
260
|
-
} else {
|
|
261
|
-
scriptDirectory = '';
|
|
262
|
-
}
|
|
263
|
-
|
|
264
179
|
if (!(typeof window == 'object' || typeof importScripts == 'function')) throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');
|
|
265
|
-
|
|
266
|
-
//
|
|
267
|
-
// be done differently.
|
|
268
|
-
{
|
|
269
|
-
// include: web_or_worker_shell_read.js
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
read_ = (url) => {
|
|
273
|
-
var xhr = new XMLHttpRequest();
|
|
274
|
-
xhr.open('GET', url, false);
|
|
275
|
-
xhr.send(null);
|
|
276
|
-
return xhr.responseText;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
if (ENVIRONMENT_IS_WORKER) {
|
|
280
|
-
readBinary = (url) => {
|
|
281
|
-
var xhr = new XMLHttpRequest();
|
|
282
|
-
xhr.open('GET', url, false);
|
|
283
|
-
xhr.responseType = 'arraybuffer';
|
|
284
|
-
xhr.send(null);
|
|
285
|
-
return new Uint8Array(/** @type{!ArrayBuffer} */(xhr.response));
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
readAsync = (url, onload, onerror) => {
|
|
290
|
-
var xhr = new XMLHttpRequest();
|
|
291
|
-
xhr.open('GET', url, true);
|
|
292
|
-
xhr.responseType = 'arraybuffer';
|
|
293
|
-
xhr.onload = () => {
|
|
294
|
-
if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0
|
|
295
|
-
onload(xhr.response);
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
onerror();
|
|
299
|
-
};
|
|
300
|
-
xhr.onerror = onerror;
|
|
301
|
-
xhr.send(null);
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
// end include: web_or_worker_shell_read.js
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
setWindowTitle = (title) => document.title = title;
|
|
180
|
+
// The XHR-based read hooks emitted by Emscripten are unused because the wasm is
|
|
181
|
+
// base64-embedded; they have been removed so the file contains no DOM/XHR I/O.
|
|
308
182
|
} else
|
|
309
183
|
{
|
|
310
184
|
throw new Error('environment detection error');
|
|
@@ -6,6 +6,7 @@ export * from "./StructuredMessageDecodingStream-react-native.mjs";
|
|
|
6
6
|
export * from "./StorageCRC64Calculator.js";
|
|
7
7
|
export { getCachedDefaultHttpClient } from "./cache.js";
|
|
8
8
|
export type * from "./interfaces-react-native.mjs";
|
|
9
|
+
export * from "./StorageResponseFormat.js";
|
|
9
10
|
export * from "./StorageBrowserPolicyFactory.js";
|
|
10
11
|
export * from "./credentials/AnonymousCredential.js";
|
|
11
12
|
export * from "./credentials/Credential.js";
|
|
@@ -18,6 +19,7 @@ export * from "./policies/StorageBrowserPolicyV2-react-native.mjs";
|
|
|
18
19
|
export * from "./policies/StorageCorrectContentLengthPolicy-react-native.mjs";
|
|
19
20
|
export * from "./policies/StorageRetryPolicyV2.js";
|
|
20
21
|
export * from "./policies/StorageSharedKeyCredentialPolicyV2-react-native.mjs";
|
|
22
|
+
export * from "./policies/StorageRedirectRangeHeaderPolicy.js";
|
|
21
23
|
export * from "./policies/StorageRequestFailureDetailsParserPolicy.js";
|
|
22
24
|
export * from "./credentials/UserDelegationKeyCredential-react-native.mjs";
|
|
23
25
|
export type { UserDelegationKey } from "./credentials/UserDelegationKey.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexPlatform-browser.d.mts","sourceRoot":"","sources":["../../src/indexPlatform-browser.mts"],"names":[],"mappings":"AAGA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AACxD,mBAAmB,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"indexPlatform-browser.d.mts","sourceRoot":"","sources":["../../src/indexPlatform-browser.mts"],"names":[],"mappings":"AAGA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AACxD,mBAAmB,sBAAsB,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAE3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kDAAkD,CAAC;AAEjE,cAAc,gCAAgC,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,cAAc,yCAAyC,CAAC;AACxD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sDAAsD,CAAC;AACrE,cAAc,oCAAoC,CAAC;AACnD,cAAc,uDAAuD,CAAC;AACtE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,wDAAwD,CAAC;AACvE,cAAc,mDAAmD,CAAC;AAClE,YAAY,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAG5E,MAAM,MAAM,QAAQ,GAAG,KAAK,CAAC"}
|
|
@@ -7,6 +7,7 @@ export * from "./StructuredMessageEncodingStream-react-native.mjs";
|
|
|
7
7
|
export * from "./StructuredMessageDecodingStream-react-native.mjs";
|
|
8
8
|
export * from "./StorageCRC64Calculator.js";
|
|
9
9
|
export { getCachedDefaultHttpClient } from "./cache.js";
|
|
10
|
+
export * from "./StorageResponseFormat.js";
|
|
10
11
|
export * from "./StorageBrowserPolicyFactory.js";
|
|
11
12
|
export * from "./credentials/AnonymousCredential.js";
|
|
12
13
|
export * from "./credentials/Credential.js";
|
|
@@ -19,6 +20,7 @@ export * from "./policies/StorageBrowserPolicyV2-react-native.mjs";
|
|
|
19
20
|
export * from "./policies/StorageCorrectContentLengthPolicy-react-native.mjs";
|
|
20
21
|
export * from "./policies/StorageRetryPolicyV2.js";
|
|
21
22
|
export * from "./policies/StorageSharedKeyCredentialPolicyV2-react-native.mjs";
|
|
23
|
+
export * from "./policies/StorageRedirectRangeHeaderPolicy.js";
|
|
22
24
|
export * from "./policies/StorageRequestFailureDetailsParserPolicy.js";
|
|
23
25
|
export * from "./credentials/UserDelegationKeyCredential-react-native.mjs";
|
|
24
26
|
//# sourceMappingURL=indexPlatform-browser.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexPlatform-browser.mjs","sourceRoot":"","sources":["../../src/indexPlatform-browser.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"indexPlatform-browser.mjs","sourceRoot":"","sources":["../../src/indexPlatform-browser.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAExD,cAAc,4BAA4B,CAAC;AAE3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kDAAkD,CAAC;AAEjE,cAAc,gCAAgC,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,cAAc,yCAAyC,CAAC;AACxD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sDAAsD,CAAC;AACrE,cAAc,oCAAoC,CAAC;AACnD,cAAc,uDAAuD,CAAC;AACtE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,wDAAwD,CAAC;AACvE,cAAc,mDAAmD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport * from \"#platform/BufferScheduler\";\nexport * from \"#platform/bufferHelpers\";\nexport { createBlobFromData } from \"./bufferHelpers.common.js\";\nexport * from \"#platform/StructuredMessageEncodingStream\";\nexport * from \"#platform/StructuredMessageDecodingStream\";\nexport * from \"./StorageCRC64Calculator.js\";\nexport { getCachedDefaultHttpClient } from \"./cache.js\";\nexport type * from \"#platform/interfaces\";\nexport * from \"./StorageResponseFormat.js\";\n\nexport * from \"./StorageBrowserPolicyFactory.js\";\nexport * from \"./credentials/AnonymousCredential.js\";\nexport * from \"./credentials/Credential.js\";\nexport * from \"#platform/credentials/StorageSharedKeyCredential\";\n\nexport * from \"./StorageRetryPolicyFactory.js\";\nexport { BaseRequestPolicy } from \"./policies/RequestPolicy.js\";\nexport * from \"./policies/AnonymousCredentialPolicy.js\";\nexport * from \"./policies/CredentialPolicy.js\";\nexport * from \"#platform/policies/StorageBrowserPolicyV2\";\nexport * from \"#platform/policies/StorageCorrectContentLengthPolicy\";\nexport * from \"./policies/StorageRetryPolicyV2.js\";\nexport * from \"#platform/policies/StorageSharedKeyCredentialPolicyV2\";\nexport * from \"./policies/StorageRedirectRangeHeaderPolicy.js\";\nexport * from \"./policies/StorageRequestFailureDetailsParserPolicy.js\";\nexport * from \"#platform/credentials/UserDelegationKeyCredential\";\nexport type { UserDelegationKey } from \"./credentials/UserDelegationKey.js\";\n\n// Readable is Node.js only - export a never type for browser builds\nexport type Readable = never;\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PipelinePolicy } from "@azure/core-rest-pipeline";
|
|
2
|
+
/**
|
|
3
|
+
* Redirects the "range" header to "x-ms-range" for Azure Storage requests as the latter is preferred.
|
|
4
|
+
*/
|
|
5
|
+
export declare const storageRedirectRangeHeaderPolicyName = "storageRedirectRangeHeaderPolicy";
|
|
6
|
+
/**
|
|
7
|
+
* StorageRedirectRangeHeaderPolicy
|
|
8
|
+
*/
|
|
9
|
+
export declare function storageRedirectRangeHeaderPolicy(): PipelinePolicy;
|
|
10
|
+
//# sourceMappingURL=StorageRedirectRangeHeaderPolicy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorageRedirectRangeHeaderPolicy.d.ts","sourceRoot":"","sources":["../../../src/policies/StorageRedirectRangeHeaderPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAIV,cAAc,EACf,MAAM,2BAA2B,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,oCAAoC,qCAAqC,CAAC;AAEvF;;GAEG;AACH,wBAAgB,gCAAgC,IAAI,cAAc,CAWjE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
/**
|
|
4
|
+
* Redirects the "range" header to "x-ms-range" for Azure Storage requests as the latter is preferred.
|
|
5
|
+
*/
|
|
6
|
+
export const storageRedirectRangeHeaderPolicyName = "storageRedirectRangeHeaderPolicy";
|
|
7
|
+
/**
|
|
8
|
+
* StorageRedirectRangeHeaderPolicy
|
|
9
|
+
*/
|
|
10
|
+
export function storageRedirectRangeHeaderPolicy() {
|
|
11
|
+
return {
|
|
12
|
+
name: storageRedirectRangeHeaderPolicyName,
|
|
13
|
+
async sendRequest(request, next) {
|
|
14
|
+
if (request.headers.has("range")) {
|
|
15
|
+
request.headers.set("x-ms-range", request.headers.get("range"));
|
|
16
|
+
request.headers.delete("range");
|
|
17
|
+
}
|
|
18
|
+
return next(request);
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=StorageRedirectRangeHeaderPolicy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorageRedirectRangeHeaderPolicy.js","sourceRoot":"","sources":["../../../src/policies/StorageRedirectRangeHeaderPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC;;GAEG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,kCAAkC,CAAC;AAEvF;;GAEG;AACH,MAAM,UAAU,gCAAgC;IAC9C,OAAO;QACL,IAAI,EAAE,oCAAoC;QAC1C,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,IAAI,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;gBACjC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAE,CAAC,CAAC;gBACjE,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAClC,CAAC;YACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n PipelinePolicy,\n} from \"@azure/core-rest-pipeline\";\n\n/**\n * Redirects the \"range\" header to \"x-ms-range\" for Azure Storage requests as the latter is preferred.\n */\nexport const storageRedirectRangeHeaderPolicyName = \"storageRedirectRangeHeaderPolicy\";\n\n/**\n * StorageRedirectRangeHeaderPolicy\n */\nexport function storageRedirectRangeHeaderPolicy(): PipelinePolicy {\n return {\n name: storageRedirectRangeHeaderPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n if (request.headers.has(\"range\")) {\n request.headers.set(\"x-ms-range\", request.headers.get(\"range\")!);\n request.headers.delete(\"range\");\n }\n return next(request);\n },\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageRequestFailureDetailsParserPolicy.d.ts","sourceRoot":"","sources":["../../../src/policies/StorageRequestFailureDetailsParserPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAIV,cAAc,EACf,MAAM,2BAA2B,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,4CAA4C,6CACb,CAAC;AAE7C;;GAEG;AACH,wBAAgB,wCAAwC,IAAI,cAAc,
|
|
1
|
+
{"version":3,"file":"StorageRequestFailureDetailsParserPolicy.d.ts","sourceRoot":"","sources":["../../../src/policies/StorageRequestFailureDetailsParserPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAIV,cAAc,EACf,MAAM,2BAA2B,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,4CAA4C,6CACb,CAAC;AAE7C;;GAEG;AACH,wBAAgB,wCAAwC,IAAI,cAAc,CA2CzE"}
|
|
@@ -13,6 +13,18 @@ export function storageRequestFailureDetailsParserPolicy() {
|
|
|
13
13
|
async sendRequest(request, next) {
|
|
14
14
|
try {
|
|
15
15
|
const response = await next(request);
|
|
16
|
+
if (response.status === 400 &&
|
|
17
|
+
response.bodyAsText?.includes("<Error><Code>InvalidHeaderValue</Code>") &&
|
|
18
|
+
response.bodyAsText.includes("<HeaderName>x-ms-version</HeaderName>")) {
|
|
19
|
+
// replace the error message with a more user-friendly one that includes a link to documentation
|
|
20
|
+
/* example response text:
|
|
21
|
+
`<?xml version="1.0" encoding="utf-8"?>
|
|
22
|
+
<Error><Code>InvalidHeaderValue</Code><Message>The value for one of the HTTP headers is not in the correct format.
|
|
23
|
+
RequestId:e5ea566c-101e-001c-1ec4-acf180000000
|
|
24
|
+
Time:2026-03-05T17:24:34.6688015Z</Message><HeaderName>x-ms-version</HeaderName><HeaderValue>3025-01-01</HeaderValue></Error>`
|
|
25
|
+
*/
|
|
26
|
+
response.bodyAsText = response.bodyAsText.replace(/<Message>.*<\/Message>/s, "<Message>The provided service version is not enabled on this storage account. Please see https://learn.microsoft.com/rest/api/storageservices/versioning-for-the-azure-storage-services for additional information.</Message>");
|
|
27
|
+
}
|
|
16
28
|
return response;
|
|
17
29
|
}
|
|
18
30
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageRequestFailureDetailsParserPolicy.js","sourceRoot":"","sources":["../../../src/policies/StorageRequestFailureDetailsParserPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC;;GAEG;AACH,MAAM,CAAC,MAAM,4CAA4C,GACvD,0CAA0C,CAAC;AAE7C;;GAEG;AACH,MAAM,UAAU,wCAAwC;IACtD,OAAO;QACL,IAAI,EAAE,4CAA4C;QAClD,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC;gBACrC,OAAO,QAAQ,CAAC;YAClB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,IACE,OAAO,GAAG,KAAK,QAAQ;oBACvB,GAAG,KAAK,IAAI;oBACX,GAAW,CAAC,QAAQ;oBACpB,GAAW,CAAC,QAAQ,CAAC,UAAU,EAChC,CAAC;oBACD,IACG,GAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,KAAK,oBAAoB;wBAC7D,GAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,UAAU,KAAK,cAAc,EAC9D,CAAC;wBACA,GAAW,CAAC,OAAO;4BAClB,8MAA8M,CAAC;oBACnN,CAAC;gBACH,CAAC;gBACD,MAAM,GAAG,CAAC;YACZ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n PipelinePolicy,\n} from \"@azure/core-rest-pipeline\";\n\n/**\n * The programmatic identifier of the StorageRequestFailureDetailsParserPolicy.\n */\nexport const storageRequestFailureDetailsParserPolicyName =\n \"storageRequestFailureDetailsParserPolicy\";\n\n/**\n * StorageRequestFailureDetailsParserPolicy\n */\nexport function storageRequestFailureDetailsParserPolicy(): PipelinePolicy {\n return {\n name: storageRequestFailureDetailsParserPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n try {\n const response = await next(request);\n return response;\n } catch (err) {\n if (\n typeof err === \"object\" &&\n err !== null &&\n (err as any).response &&\n (err as any).response.parsedBody\n ) {\n if (\n (err as any).response.parsedBody.code === \"InvalidHeaderValue\" &&\n (err as any).response.parsedBody.HeaderName === \"x-ms-version\"\n ) {\n (err as any).message =\n \"The provided service version is not enabled on this storage account. Please see https://learn.microsoft.com/rest/api/storageservices/versioning-for-the-azure-storage-services for additional information.\\n\";\n }\n }\n throw err;\n }\n },\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"StorageRequestFailureDetailsParserPolicy.js","sourceRoot":"","sources":["../../../src/policies/StorageRequestFailureDetailsParserPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC;;GAEG;AACH,MAAM,CAAC,MAAM,4CAA4C,GACvD,0CAA0C,CAAC;AAE7C;;GAEG;AACH,MAAM,UAAU,wCAAwC;IACtD,OAAO;QACL,IAAI,EAAE,4CAA4C;QAClD,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC;gBACrC,IACE,QAAQ,CAAC,MAAM,KAAK,GAAG;oBACvB,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,wCAAwC,CAAC;oBACvE,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,uCAAuC,CAAC,EACrE,CAAC;oBACD,gGAAgG;oBAChG;;;;;sBAKE;oBACF,QAAQ,CAAC,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC,OAAO,CAC/C,yBAAyB,EACzB,+NAA+N,CAChO,CAAC;gBACJ,CAAC;gBACD,OAAO,QAAQ,CAAC;YAClB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,IACE,OAAO,GAAG,KAAK,QAAQ;oBACvB,GAAG,KAAK,IAAI;oBACX,GAAW,CAAC,QAAQ;oBACpB,GAAW,CAAC,QAAQ,CAAC,UAAU,EAChC,CAAC;oBACD,IACG,GAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,KAAK,oBAAoB;wBAC7D,GAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,UAAU,KAAK,cAAc,EAC9D,CAAC;wBACA,GAAW,CAAC,OAAO;4BAClB,8MAA8M,CAAC;oBACnN,CAAC;gBACH,CAAC;gBACD,MAAM,GAAG,CAAC;YACZ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n PipelinePolicy,\n} from \"@azure/core-rest-pipeline\";\n\n/**\n * The programmatic identifier of the StorageRequestFailureDetailsParserPolicy.\n */\nexport const storageRequestFailureDetailsParserPolicyName =\n \"storageRequestFailureDetailsParserPolicy\";\n\n/**\n * StorageRequestFailureDetailsParserPolicy\n */\nexport function storageRequestFailureDetailsParserPolicy(): PipelinePolicy {\n return {\n name: storageRequestFailureDetailsParserPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n try {\n const response = await next(request);\n if (\n response.status === 400 &&\n response.bodyAsText?.includes(\"<Error><Code>InvalidHeaderValue</Code>\") &&\n response.bodyAsText.includes(\"<HeaderName>x-ms-version</HeaderName>\")\n ) {\n // replace the error message with a more user-friendly one that includes a link to documentation\n /* example response text:\n `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Error><Code>InvalidHeaderValue</Code><Message>The value for one of the HTTP headers is not in the correct format.\nRequestId:e5ea566c-101e-001c-1ec4-acf180000000\nTime:2026-03-05T17:24:34.6688015Z</Message><HeaderName>x-ms-version</HeaderName><HeaderValue>3025-01-01</HeaderValue></Error>`\n */\n response.bodyAsText = response.bodyAsText.replace(\n /<Message>.*<\\/Message>/s,\n \"<Message>The provided service version is not enabled on this storage account. Please see https://learn.microsoft.com/rest/api/storageservices/versioning-for-the-azure-storage-services for additional information.</Message>\",\n );\n }\n return response;\n } catch (err) {\n if (\n typeof err === \"object\" &&\n err !== null &&\n (err as any).response &&\n (err as any).response.parsedBody\n ) {\n if (\n (err as any).response.parsedBody.code === \"InvalidHeaderValue\" &&\n (err as any).response.parsedBody.HeaderName === \"x-ms-version\"\n ) {\n (err as any).message =\n \"The provided service version is not enabled on this storage account. Please see https://learn.microsoft.com/rest/api/storageservices/versioning-for-the-azure-storage-services for additional information.\\n\";\n }\n }\n throw err;\n }\n },\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageRetryPolicy.d.ts","sourceRoot":"","sources":["../../../src/policies/StorageRetryPolicy.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,IAAI,oBAAoB,EAChD,oBAAoB,EACpB,eAAe,IAAI,WAAW,EAC9B,cAAc,IAAI,qBAAqB,EACxC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAM3E;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,CAAC,EAAE,mBAAmB,GAAG,oBAAoB,CAM9F;AAcD;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,iBAAiB;IACvD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAsB;IAEnD;;;;;;OAMG;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AAW,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAI9E;;;;;;;;;OASG;cACa,kBAAkB,CAChC,OAAO,EAAE,WAAW,EACpB,eAAe,EAAE,OAAO,EACxB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,qBAAqB,CAAC;IA0CjC;;;;;;;OAOG;IACH,SAAS,CAAC,WAAW,CACnB,cAAc,EAAE,OAAO,EACvB,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,qBAAqB,EAChC,GAAG,CAAC,EAAE,SAAS,GACd,OAAO;IA8EV;;;;;;OAMG;YACW,KAAK;CA0BpB"}
|
|
@@ -128,8 +128,7 @@ export class StorageRetryPolicy extends BaseRequestPolicy {
|
|
|
128
128
|
*/
|
|
129
129
|
shouldRetry(isPrimaryRetry, attempt, response, err) {
|
|
130
130
|
if (attempt >= this.retryOptions.maxTries) {
|
|
131
|
-
logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions
|
|
132
|
-
.maxTries}, no further try.`);
|
|
131
|
+
logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions.maxTries}, no further try.`);
|
|
133
132
|
return false;
|
|
134
133
|
}
|
|
135
134
|
// Handle network failures, you may need to customize the list when you implement
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageRetryPolicy.js","sourceRoot":"","sources":["../../../src/policies/StorageRetryPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAQrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAIvD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,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,YAAY,CAAC,eAAe,EAAE,CAAC;gBAC1C,KAAK,sBAAsB,CAAC,WAAW;oBACrC,aAAa,GAAG,IAAI,CAAC,GAAG,CACtB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,cAAe,EAClE,IAAI,CAAC,YAAY,CAAC,iBAAkB,CACrC,CAAC;oBACF,MAAM;gBACR,KAAK,sBAAsB,CAAC,KAAK;oBAC/B,aAAa,GAAG,IAAI,CAAC,YAAY,CAAC,cAAe,CAAC;oBAClD,MAAM;YACV,CAAC;QACH,CAAC;aAAM,CAAC;YACN,aAAa,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC;QACvC,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,0BAA0B,aAAa,IAAI,CAAC,CAAC;QACzD,OAAO,KAAK,CAAC,aAAa,EAAE,WAAW,EAAE,iBAAiB,CAAC,CAAC;IAC9D,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport { AbortError } from \"@azure/abort-controller\";\nimport type {\n RequestPolicy,\n RequestPolicyOptionsLike as RequestPolicyOptions,\n RequestPolicyFactory,\n WebResourceLike as WebResource,\n CompatResponse as HttpOperationResponse,\n} from \"@azure/core-http-compat\";\nimport { BaseRequestPolicy } from \"./RequestPolicy.js\";\nimport type { RestError } from \"@azure/core-rest-pipeline\";\n\nimport type { StorageRetryOptions } from \"../StorageRetryPolicyFactory.js\";\nimport { HeaderConstants, URLConstants } from \"../utils/constants.js\";\nimport { delay, setURLHost, setURLParameter } from \"../utils/utils.common.js\";\nimport { logger } from \"../log.js\";\nimport { StorageRetryPolicyType } from \"./StorageRetryPolicyType.js\";\n\n/**\n * A factory method used to generated a RetryPolicy factory.\n *\n * @param retryOptions -\n */\nexport function NewRetryPolicyFactory(retryOptions?: StorageRetryOptions): RequestPolicyFactory {\n return {\n create: (nextPolicy: RequestPolicy, options: RequestPolicyOptions): StorageRetryPolicy => {\n return new StorageRetryPolicy(nextPolicy, options, retryOptions);\n },\n };\n}\n\n// Default values of StorageRetryOptions\nconst DEFAULT_RETRY_OPTIONS: StorageRetryOptions = {\n maxRetryDelayInMs: 120 * 1000,\n maxTries: 4,\n retryDelayInMs: 4 * 1000,\n retryPolicyType: StorageRetryPolicyType.EXPONENTIAL,\n secondaryHost: \"\",\n tryTimeoutInMs: undefined, // Use server side default timeout strategy\n};\n\nconst RETRY_ABORT_ERROR = new AbortError(\"The operation was aborted.\");\n\n/**\n * Retry policy with exponential retry and linear retry implemented.\n */\nexport class StorageRetryPolicy extends BaseRequestPolicy {\n /**\n * RetryOptions.\n */\n private readonly retryOptions: StorageRetryOptions;\n\n /**\n * Creates an instance of RetryPolicy.\n *\n * @param nextPolicy -\n * @param options -\n * @param retryOptions -\n */\n constructor(\n nextPolicy: RequestPolicy,\n options: RequestPolicyOptions,\n retryOptions: StorageRetryOptions = DEFAULT_RETRY_OPTIONS,\n ) {\n super(nextPolicy, options);\n\n // Initialize retry options\n this.retryOptions = {\n retryPolicyType: retryOptions.retryPolicyType\n ? retryOptions.retryPolicyType\n : DEFAULT_RETRY_OPTIONS.retryPolicyType,\n\n maxTries:\n retryOptions.maxTries && retryOptions.maxTries >= 1\n ? Math.floor(retryOptions.maxTries)\n : DEFAULT_RETRY_OPTIONS.maxTries,\n\n tryTimeoutInMs:\n retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0\n ? retryOptions.tryTimeoutInMs\n : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs,\n\n retryDelayInMs:\n retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0\n ? Math.min(\n retryOptions.retryDelayInMs,\n retryOptions.maxRetryDelayInMs\n ? retryOptions.maxRetryDelayInMs\n : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs!,\n )\n : DEFAULT_RETRY_OPTIONS.retryDelayInMs,\n\n maxRetryDelayInMs:\n retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0\n ? retryOptions.maxRetryDelayInMs\n : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs,\n\n secondaryHost: retryOptions.secondaryHost\n ? retryOptions.secondaryHost\n : DEFAULT_RETRY_OPTIONS.secondaryHost,\n };\n }\n\n /**\n * Sends request.\n *\n * @param request -\n */\n public async sendRequest(request: WebResource): Promise<HttpOperationResponse> {\n return this.attemptSendRequest(request, false, 1);\n }\n\n /**\n * Decide and perform next retry. Won't mutate request parameter.\n *\n * @param request -\n * @param secondaryHas404 - If attempt was against the secondary & it returned a StatusNotFound (404), then\n * the resource was not found. This may be due to replication delay. So, in this\n * case, we'll never try the secondary again for this operation.\n * @param attempt - How many retries has been attempted to performed, starting from 1, which includes\n * the attempt will be performed by this method call.\n */\n protected async attemptSendRequest(\n request: WebResource,\n secondaryHas404: boolean,\n attempt: number,\n ): Promise<HttpOperationResponse> {\n const newRequest: WebResource = request.clone();\n\n const isPrimaryRetry =\n secondaryHas404 ||\n !this.retryOptions.secondaryHost ||\n !(request.method === \"GET\" || request.method === \"HEAD\" || request.method === \"OPTIONS\") ||\n attempt % 2 === 1;\n\n if (!isPrimaryRetry) {\n newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost!);\n }\n\n // Set the server-side timeout query parameter \"timeout=[seconds]\"\n if (this.retryOptions.tryTimeoutInMs) {\n newRequest.url = setURLParameter(\n newRequest.url,\n URLConstants.Parameters.TIMEOUT,\n Math.floor(this.retryOptions.tryTimeoutInMs! / 1000).toString(),\n );\n }\n\n let response: HttpOperationResponse | undefined;\n try {\n logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? \"Primary\" : \"Secondary\"}`);\n response = await this._nextPolicy.sendRequest(newRequest);\n if (!this.shouldRetry(isPrimaryRetry, attempt, response)) {\n return response;\n }\n\n secondaryHas404 = secondaryHas404 || (!isPrimaryRetry && response.status === 404);\n } catch (err: any) {\n logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`);\n if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) {\n throw err;\n }\n }\n\n await this.delay(isPrimaryRetry, attempt, request.abortSignal);\n return this.attemptSendRequest(request, secondaryHas404, ++attempt);\n }\n\n /**\n * Decide whether to retry according to last HTTP response and retry counters.\n *\n * @param isPrimaryRetry -\n * @param attempt -\n * @param response -\n * @param err -\n */\n protected shouldRetry(\n isPrimaryRetry: boolean,\n attempt: number,\n response?: HttpOperationResponse,\n err?: RestError,\n ): boolean {\n if (attempt >= this.retryOptions.maxTries!) {\n logger.info(\n `RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions\n .maxTries!}, no further try.`,\n );\n return false;\n }\n\n // Handle network failures, you may need to customize the list when you implement\n // your own http client\n const retriableErrors = [\n \"ETIMEDOUT\",\n \"ESOCKETTIMEDOUT\",\n \"ECONNREFUSED\",\n \"ECONNRESET\",\n \"ENOENT\",\n \"ENOTFOUND\",\n \"TIMEOUT\",\n \"EPIPE\",\n \"REQUEST_SEND_ERROR\", // For default xhr based http client provided in ms-rest-js\n ];\n if (err) {\n for (const retriableError of retriableErrors) {\n if (\n err.name.toUpperCase().includes(retriableError) ||\n err.message.toUpperCase().includes(retriableError) ||\n (err.code && err.code.toString().toUpperCase() === retriableError)\n ) {\n logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`);\n return true;\n }\n }\n }\n\n // If attempt was against the secondary & it returned a StatusNotFound (404), then\n // the resource was not found. This may be due to replication delay. So, in this\n // case, we'll never try the secondary again for this operation.\n if (response || err) {\n const statusCode = response ? response.status : err ? err.statusCode : 0;\n if (!isPrimaryRetry && statusCode === 404) {\n logger.info(`RetryPolicy: Secondary access with 404, will retry.`);\n return true;\n }\n\n // Server internal error or server timeout\n if (statusCode === 503 || statusCode === 500) {\n logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`);\n return true;\n }\n }\n\n if (response) {\n // Retry select Copy Source Error Codes.\n if (response?.status >= 400) {\n const copySourceError = response.headers.get(HeaderConstants.X_MS_CopySourceErrorCode);\n if (copySourceError !== undefined) {\n switch (copySourceError) {\n case \"InternalError\":\n case \"OperationTimedOut\":\n case \"ServerBusy\":\n return true;\n }\n }\n }\n }\n\n if (err?.code === \"PARSE_ERROR\" && err?.message.startsWith(`Error \"Error: Unclosed root tag`)) {\n logger.info(\n \"RetryPolicy: Incomplete XML response likely due to service timeout, will retry.\",\n );\n return true;\n }\n\n return false;\n }\n\n /**\n * Delay a calculated time between retries.\n *\n * @param isPrimaryRetry -\n * @param attempt -\n * @param abortSignal -\n */\n private async delay(\n isPrimaryRetry: boolean,\n attempt: number,\n abortSignal?: AbortSignalLike,\n ): Promise<void> {\n let delayTimeInMs: number = 0;\n\n if (isPrimaryRetry) {\n switch (this.retryOptions.retryPolicyType) {\n case StorageRetryPolicyType.EXPONENTIAL:\n delayTimeInMs = Math.min(\n (Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs!,\n this.retryOptions.maxRetryDelayInMs!,\n );\n break;\n case StorageRetryPolicyType.FIXED:\n delayTimeInMs = this.retryOptions.retryDelayInMs!;\n break;\n }\n } else {\n delayTimeInMs = Math.random() * 1000;\n }\n\n logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`);\n return delay(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"StorageRetryPolicy.js","sourceRoot":"","sources":["../../../src/policies/StorageRetryPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAQrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAIvD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,KAAK,EAAE,U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f,WAA6B;QAE7B,IAAI,aAAa,GAAW,CAAC,CAAC;QAE9B,IAAI,cAAc,EAAE,CAAC;YACnB,QAAQ,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE,CAAC;gBAC1C,KAAK,sBAAsB,CAAC,WAAW;oBACrC,aAAa,GAAG,IAAI,CAAC,GAAG,CACtB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,cAAe,EAClE,IAAI,CAAC,YAAY,CAAC,iBAAkB,CACrC,CAAC;oBACF,MAAM;gBACR,KAAK,sBAAsB,CAAC,KAAK;oBAC/B,aAAa,GAAG,IAAI,CAAC,YAAY,CAAC,cAAe,CAAC;oBAClD,MAAM;YACV,CAAC;QACH,CAAC;aAAM,CAAC;YACN,aAAa,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC;QACvC,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,0BAA0B,aAAa,IAAI,CAAC,CAAC;QACzD,OAAO,KAAK,CAAC,aAAa,EAAE,WAAW,EAAE,iBAAiB,CAAC,CAAC;IAC9D,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport { AbortError } from \"@azure/abort-controller\";\nimport type {\n RequestPolicy,\n RequestPolicyOptionsLike as RequestPolicyOptions,\n RequestPolicyFactory,\n WebResourceLike as WebResource,\n CompatResponse as HttpOperationResponse,\n} from \"@azure/core-http-compat\";\nimport { BaseRequestPolicy } from \"./RequestPolicy.js\";\nimport type { RestError } from \"@azure/core-rest-pipeline\";\n\nimport type { StorageRetryOptions } from \"../StorageRetryPolicyFactory.js\";\nimport { HeaderConstants, URLConstants } from \"../utils/constants.js\";\nimport { delay, setURLHost, setURLParameter } from \"../utils/utils.common.js\";\nimport { logger } from \"../log.js\";\nimport { StorageRetryPolicyType } from \"./StorageRetryPolicyType.js\";\n\n/**\n * A factory method used to generated a RetryPolicy factory.\n *\n * @param retryOptions -\n */\nexport function NewRetryPolicyFactory(retryOptions?: StorageRetryOptions): RequestPolicyFactory {\n return {\n create: (nextPolicy: RequestPolicy, options: RequestPolicyOptions): StorageRetryPolicy => {\n return new StorageRetryPolicy(nextPolicy, options, retryOptions);\n },\n };\n}\n\n// Default values of StorageRetryOptions\nconst DEFAULT_RETRY_OPTIONS: StorageRetryOptions = {\n maxRetryDelayInMs: 120 * 1000,\n maxTries: 4,\n retryDelayInMs: 4 * 1000,\n retryPolicyType: StorageRetryPolicyType.EXPONENTIAL,\n secondaryHost: \"\",\n tryTimeoutInMs: undefined, // Use server side default timeout strategy\n};\n\nconst RETRY_ABORT_ERROR = new AbortError(\"The operation was aborted.\");\n\n/**\n * Retry policy with exponential retry and linear retry implemented.\n */\nexport class StorageRetryPolicy extends BaseRequestPolicy {\n /**\n * RetryOptions.\n */\n private readonly retryOptions: StorageRetryOptions;\n\n /**\n * Creates an instance of RetryPolicy.\n *\n * @param nextPolicy -\n * @param options -\n * @param retryOptions -\n */\n constructor(\n nextPolicy: RequestPolicy,\n options: RequestPolicyOptions,\n retryOptions: StorageRetryOptions = DEFAULT_RETRY_OPTIONS,\n ) {\n super(nextPolicy, options);\n\n // Initialize retry options\n this.retryOptions = {\n retryPolicyType: retryOptions.retryPolicyType\n ? retryOptions.retryPolicyType\n : DEFAULT_RETRY_OPTIONS.retryPolicyType,\n\n maxTries:\n retryOptions.maxTries && retryOptions.maxTries >= 1\n ? Math.floor(retryOptions.maxTries)\n : DEFAULT_RETRY_OPTIONS.maxTries,\n\n tryTimeoutInMs:\n retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0\n ? retryOptions.tryTimeoutInMs\n : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs,\n\n retryDelayInMs:\n retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0\n ? Math.min(\n retryOptions.retryDelayInMs,\n retryOptions.maxRetryDelayInMs\n ? retryOptions.maxRetryDelayInMs\n : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs!,\n )\n : DEFAULT_RETRY_OPTIONS.retryDelayInMs,\n\n maxRetryDelayInMs:\n retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0\n ? retryOptions.maxRetryDelayInMs\n : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs,\n\n secondaryHost: retryOptions.secondaryHost\n ? retryOptions.secondaryHost\n : DEFAULT_RETRY_OPTIONS.secondaryHost,\n };\n }\n\n /**\n * Sends request.\n *\n * @param request -\n */\n public async sendRequest(request: WebResource): Promise<HttpOperationResponse> {\n return this.attemptSendRequest(request, false, 1);\n }\n\n /**\n * Decide and perform next retry. Won't mutate request parameter.\n *\n * @param request -\n * @param secondaryHas404 - If attempt was against the secondary & it returned a StatusNotFound (404), then\n * the resource was not found. This may be due to replication delay. So, in this\n * case, we'll never try the secondary again for this operation.\n * @param attempt - How many retries has been attempted to performed, starting from 1, which includes\n * the attempt will be performed by this method call.\n */\n protected async attemptSendRequest(\n request: WebResource,\n secondaryHas404: boolean,\n attempt: number,\n ): Promise<HttpOperationResponse> {\n const newRequest: WebResource = request.clone();\n\n const isPrimaryRetry =\n secondaryHas404 ||\n !this.retryOptions.secondaryHost ||\n !(request.method === \"GET\" || request.method === \"HEAD\" || request.method === \"OPTIONS\") ||\n attempt % 2 === 1;\n\n if (!isPrimaryRetry) {\n newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost!);\n }\n\n // Set the server-side timeout query parameter \"timeout=[seconds]\"\n if (this.retryOptions.tryTimeoutInMs) {\n newRequest.url = setURLParameter(\n newRequest.url,\n URLConstants.Parameters.TIMEOUT,\n Math.floor(this.retryOptions.tryTimeoutInMs! / 1000).toString(),\n );\n }\n\n let response: HttpOperationResponse | undefined;\n try {\n logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? \"Primary\" : \"Secondary\"}`);\n response = await this._nextPolicy.sendRequest(newRequest);\n if (!this.shouldRetry(isPrimaryRetry, attempt, response)) {\n return response;\n }\n\n secondaryHas404 = secondaryHas404 || (!isPrimaryRetry && response.status === 404);\n } catch (err: any) {\n logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`);\n if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) {\n throw err;\n }\n }\n\n await this.delay(isPrimaryRetry, attempt, request.abortSignal);\n return this.attemptSendRequest(request, secondaryHas404, ++attempt);\n }\n\n /**\n * Decide whether to retry according to last HTTP response and retry counters.\n *\n * @param isPrimaryRetry -\n * @param attempt -\n * @param response -\n * @param err -\n */\n protected shouldRetry(\n isPrimaryRetry: boolean,\n attempt: number,\n response?: HttpOperationResponse,\n err?: RestError,\n ): boolean {\n if (attempt >= this.retryOptions.maxTries!) {\n logger.info(\n `RetryPolicy: Attempt(s) ${attempt} >= maxTries ${\n this.retryOptions.maxTries!\n }, no further try.`,\n );\n return false;\n }\n\n // Handle network failures, you may need to customize the list when you implement\n // your own http client\n const retriableErrors = [\n \"ETIMEDOUT\",\n \"ESOCKETTIMEDOUT\",\n \"ECONNREFUSED\",\n \"ECONNRESET\",\n \"ENOENT\",\n \"ENOTFOUND\",\n \"TIMEOUT\",\n \"EPIPE\",\n \"REQUEST_SEND_ERROR\", // For default xhr based http client provided in ms-rest-js\n ];\n if (err) {\n for (const retriableError of retriableErrors) {\n if (\n err.name.toUpperCase().includes(retriableError) ||\n err.message.toUpperCase().includes(retriableError) ||\n (err.code && err.code.toString().toUpperCase() === retriableError)\n ) {\n logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`);\n return true;\n }\n }\n }\n\n // If attempt was against the secondary & it returned a StatusNotFound (404), then\n // the resource was not found. This may be due to replication delay. So, in this\n // case, we'll never try the secondary again for this operation.\n if (response || err) {\n const statusCode = response ? response.status : err ? err.statusCode : 0;\n if (!isPrimaryRetry && statusCode === 404) {\n logger.info(`RetryPolicy: Secondary access with 404, will retry.`);\n return true;\n }\n\n // Server internal error or server timeout\n if (statusCode === 503 || statusCode === 500) {\n logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`);\n return true;\n }\n }\n\n if (response) {\n // Retry select Copy Source Error Codes.\n if (response?.status >= 400) {\n const copySourceError = response.headers.get(HeaderConstants.X_MS_CopySourceErrorCode);\n if (copySourceError !== undefined) {\n switch (copySourceError) {\n case \"InternalError\":\n case \"OperationTimedOut\":\n case \"ServerBusy\":\n return true;\n }\n }\n }\n }\n\n if (err?.code === \"PARSE_ERROR\" && err?.message.startsWith(`Error \"Error: Unclosed root tag`)) {\n logger.info(\n \"RetryPolicy: Incomplete XML response likely due to service timeout, will retry.\",\n );\n return true;\n }\n\n return false;\n }\n\n /**\n * Delay a calculated time between retries.\n *\n * @param isPrimaryRetry -\n * @param attempt -\n * @param abortSignal -\n */\n private async delay(\n isPrimaryRetry: boolean,\n attempt: number,\n abortSignal?: AbortSignalLike,\n ): Promise<void> {\n let delayTimeInMs: number = 0;\n\n if (isPrimaryRetry) {\n switch (this.retryOptions.retryPolicyType) {\n case StorageRetryPolicyType.EXPONENTIAL:\n delayTimeInMs = Math.min(\n (Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs!,\n this.retryOptions.maxRetryDelayInMs!,\n );\n break;\n case StorageRetryPolicyType.FIXED:\n delayTimeInMs = this.retryOptions.retryDelayInMs!;\n break;\n }\n } else {\n delayTimeInMs = Math.random() * 1000;\n }\n\n logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`);\n return delay(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,QAAQ,CAAC;AAE5C,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,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T License.\n\nexport const SDK_VERSION: string = \"12.
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,QAAQ,CAAC;AAE5C,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,UAAU,EAAE;QACV,sBAAsB,EAAE,GAAG;QAC3B,SAAS,EAAE,KAAK;QAChB,QAAQ,EAAE,UAAU;QACpB,SAAS,EAAE,WAAW;QACtB,OAAO,EAAE,SAAS;KACnB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,aAAa,EAAE,eAAe;IAC9B,oBAAoB,EAAE,QAAQ;IAC9B,gBAAgB,EAAE,kBAAkB;IACpC,UAAU,EAAE,YAAY;IACxB,gBAAgB,EAAE,kBAAkB;IACpC,cAAc,EAAE,gBAAgB;IAChC,WAAW,EAAE,aAAa;IAC1B,yBAAyB,EAAE,2BAA2B;IACtD,YAAY,EAAE,cAAc;IAC5B,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;IACpB,iBAAiB,EAAE,mBAAmB;IACtC,aAAa,EAAE,eAAe;IAC9B,mBAAmB,EAAE,qBAAqB;IAC1C,kBAAkB,EAAE,OAAO;IAC3B,KAAK,EAAE,OAAO;IACd,UAAU,EAAE,YAAY;IACxB,sBAAsB,EAAE,wBAAwB;IAChD,gBAAgB,EAAE,kBAAkB;IACpC,SAAS,EAAE,WAAW;IACtB,eAAe,EAAE,iBAAiB;IAClC,YAAY,EAAE,cAAc;IAC5B,wBAAwB,EAAE,6BAA6B;CACxD,CAAC;AACF,MAAM,CAAC,MAAM,2BAA2B,GAAG,sNAAsN,CAAC;AAElQ,iDAAiD;AACjD,wGAAwG;AACxG,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;CACR,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const SDK_VERSION: string = \"12.5.0\";\n\nexport const URLConstants = {\n Parameters: {\n FORCE_BROWSER_NO_CACHE: \"_\",\n SIGNATURE: \"sig\",\n SNAPSHOT: \"snapshot\",\n VERSIONID: \"versionid\",\n TIMEOUT: \"timeout\",\n },\n};\n\nexport const HeaderConstants = {\n AUTHORIZATION: \"Authorization\",\n AUTHORIZATION_SCHEME: \"Bearer\",\n CONTENT_ENCODING: \"Content-Encoding\",\n CONTENT_ID: \"Content-ID\",\n CONTENT_LANGUAGE: \"Content-Language\",\n CONTENT_LENGTH: \"Content-Length\",\n CONTENT_MD5: \"Content-Md5\",\n CONTENT_TRANSFER_ENCODING: \"Content-Transfer-Encoding\",\n CONTENT_TYPE: \"Content-Type\",\n COOKIE: \"Cookie\",\n DATE: \"date\",\n IF_MATCH: \"if-match\",\n IF_MODIFIED_SINCE: \"if-modified-since\",\n IF_NONE_MATCH: \"if-none-match\",\n IF_UNMODIFIED_SINCE: \"if-unmodified-since\",\n PREFIX_FOR_STORAGE: \"x-ms-\",\n RANGE: \"Range\",\n USER_AGENT: \"User-Agent\",\n X_MS_CLIENT_REQUEST_ID: \"x-ms-client-request-id\",\n X_MS_COPY_SOURCE: \"x-ms-copy-source\",\n X_MS_DATE: \"x-ms-date\",\n X_MS_ERROR_CODE: \"x-ms-error-code\",\n X_MS_VERSION: \"x-ms-version\",\n X_MS_CopySourceErrorCode: \"x-ms-copy-source-error-code\",\n};\nexport const DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`;\n\n/// List of ports used for path style addressing.\n/// Path style addressing means that storage account is put in URI's Path segment in instead of in host.\nexport const PathStylePorts = [\n \"10000\",\n \"10001\",\n \"10002\",\n \"10003\",\n \"10004\",\n \"10100\",\n \"10101\",\n \"10102\",\n \"10103\",\n \"10104\",\n \"11000\",\n \"11001\",\n \"11002\",\n \"11003\",\n \"11004\",\n \"11100\",\n \"11101\",\n \"11102\",\n \"11103\",\n \"11104\",\n];\n"]}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"sdk-type": "client",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"author": "Microsoft Corporation",
|
|
6
|
-
"version": "12.
|
|
6
|
+
"version": "12.5.0",
|
|
7
7
|
"description": "Azure Storage Common Client Library for JavaScript",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"repository": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"browser": "./dist/browser/index.js",
|
|
25
25
|
"types": "./dist/commonjs/index.d.ts",
|
|
26
26
|
"engines": {
|
|
27
|
-
"node": ">=
|
|
27
|
+
"node": ">=22.0.0"
|
|
28
28
|
},
|
|
29
29
|
"imports": {
|
|
30
30
|
"#platform/*": {
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@azure/abort-controller": "^2.1.2",
|
|
43
43
|
"@azure/core-auth": "^1.9.0",
|
|
44
|
-
"@azure/core-http-compat": "^2.
|
|
45
|
-
"@azure/core-rest-pipeline": "^1.
|
|
44
|
+
"@azure/core-http-compat": "^2.4.0",
|
|
45
|
+
"@azure/core-rest-pipeline": "^1.24.0",
|
|
46
46
|
"@azure/core-tracing": "^1.2.0",
|
|
47
47
|
"@azure/core-util": "^1.11.0",
|
|
48
48
|
"@azure/logger": "^1.1.4",
|
|
@@ -51,20 +51,20 @@
|
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@azure/logger": "^1.1.4",
|
|
54
|
-
"@types/node": "^
|
|
54
|
+
"@types/node": "^22.0.0",
|
|
55
55
|
"@vitest/browser-playwright": "^4.1.2",
|
|
56
56
|
"@vitest/coverage-istanbul": "^4.1.2",
|
|
57
57
|
"cross-env": "^10.1.0",
|
|
58
|
-
"eslint": "^
|
|
58
|
+
"eslint": "^10.8.0",
|
|
59
59
|
"playwright": "^1.60.0",
|
|
60
|
-
"prettier": "^3.
|
|
60
|
+
"prettier": "^3.9.1",
|
|
61
61
|
"react-native": "^0.84.1",
|
|
62
62
|
"rimraf": "^6.1.0",
|
|
63
63
|
"typescript": "~6.0.2",
|
|
64
64
|
"vitest": "^4.1.2",
|
|
65
|
+
"@azure-tools/test-utils-vitest": "^2.0.1",
|
|
65
66
|
"@azure/dev-tool": "^1.0.0",
|
|
66
|
-
"@azure/eslint-plugin-azure-sdk": "^3.0.0"
|
|
67
|
-
"@azure-tools/test-utils-vitest": "^2.0.1"
|
|
67
|
+
"@azure/eslint-plugin-azure-sdk": "^3.0.0"
|
|
68
68
|
},
|
|
69
69
|
"type": "module",
|
|
70
70
|
"react-native": "./dist/react-native/index.js",
|