@azure/storage-queue 12.30.0-beta.1 → 12.31.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/browser/generated/src/storageClient.js +2 -2
- package/dist/browser/generated/src/storageClient.js.map +1 -1
- package/dist/browser/utils/constants.js +2 -2
- package/dist/browser/utils/constants.js.map +1 -1
- package/dist/browser/utils/utils.common.d.ts.map +1 -1
- package/dist/browser/utils/utils.common.js +14 -0
- package/dist/browser/utils/utils.common.js.map +1 -1
- package/dist/commonjs/AccountSASPermissions.js +1 -0
- package/dist/commonjs/AccountSASPermissions.js.map +1 -1
- package/dist/commonjs/AccountSASResourceTypes.js +1 -0
- package/dist/commonjs/AccountSASResourceTypes.js.map +1 -1
- package/dist/commonjs/AccountSASServices.js +1 -0
- package/dist/commonjs/AccountSASServices.js.map +1 -1
- package/dist/commonjs/AccountSASSignatureValues.js +1 -0
- package/dist/commonjs/AccountSASSignatureValues.js.map +1 -1
- package/dist/commonjs/Pipeline.js +1 -0
- package/dist/commonjs/Pipeline.js.map +1 -1
- package/dist/commonjs/QueueClient.js +1 -0
- package/dist/commonjs/QueueClient.js.map +1 -1
- package/dist/commonjs/QueueSASPermissions.js +1 -0
- package/dist/commonjs/QueueSASPermissions.js.map +1 -1
- package/dist/commonjs/QueueSASSignatureValues.js +1 -0
- package/dist/commonjs/QueueSASSignatureValues.js.map +1 -1
- package/dist/commonjs/QueueServiceClient.js +1 -0
- package/dist/commonjs/QueueServiceClient.js.map +1 -1
- package/dist/commonjs/SASQueryParameters.js +1 -0
- package/dist/commonjs/SASQueryParameters.js.map +1 -1
- package/dist/commonjs/SasIPRange.js +1 -0
- package/dist/commonjs/SasIPRange.js.map +1 -1
- package/dist/commonjs/StorageClient.js +1 -0
- package/dist/commonjs/StorageClient.js.map +1 -1
- package/dist/commonjs/StorageContextClient.js +1 -0
- package/dist/commonjs/StorageContextClient.js.map +1 -1
- package/dist/commonjs/generated/src/index.js +1 -0
- package/dist/commonjs/generated/src/index.js.map +1 -1
- package/dist/commonjs/generated/src/models/index.js +1 -0
- package/dist/commonjs/generated/src/models/index.js.map +1 -1
- package/dist/commonjs/generated/src/models/mappers.js +1 -0
- package/dist/commonjs/generated/src/models/mappers.js.map +1 -1
- package/dist/commonjs/generated/src/models/parameters.js +1 -0
- package/dist/commonjs/generated/src/models/parameters.js.map +1 -1
- package/dist/commonjs/generated/src/operations/index.js +1 -0
- package/dist/commonjs/generated/src/operations/index.js.map +1 -1
- package/dist/commonjs/generated/src/operations/messageId.js +1 -0
- package/dist/commonjs/generated/src/operations/messageId.js.map +1 -1
- package/dist/commonjs/generated/src/operations/messages.js +1 -0
- package/dist/commonjs/generated/src/operations/messages.js.map +1 -1
- package/dist/commonjs/generated/src/operations/queue.js +1 -0
- package/dist/commonjs/generated/src/operations/queue.js.map +1 -1
- package/dist/commonjs/generated/src/operations/service.js +1 -0
- package/dist/commonjs/generated/src/operations/service.js.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/index.js +1 -0
- package/dist/commonjs/generated/src/operationsInterfaces/index.js.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/messageId.js +1 -0
- package/dist/commonjs/generated/src/operationsInterfaces/messageId.js.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/messages.js +1 -0
- package/dist/commonjs/generated/src/operationsInterfaces/messages.js.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/queue.js +1 -0
- package/dist/commonjs/generated/src/operationsInterfaces/queue.js.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/service.js +1 -0
- package/dist/commonjs/generated/src/operationsInterfaces/service.js.map +1 -1
- package/dist/commonjs/generated/src/storageClient.js +3 -2
- package/dist/commonjs/generated/src/storageClient.js.map +2 -2
- package/dist/commonjs/generatedModels.js +1 -0
- package/dist/commonjs/generatedModels.js.map +1 -1
- package/dist/commonjs/index.js +1 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/log.js +1 -0
- package/dist/commonjs/log.js.map +1 -1
- package/dist/commonjs/models.js +1 -0
- package/dist/commonjs/models.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/commonjs/utils/constants.js +3 -2
- package/dist/commonjs/utils/constants.js.map +2 -2
- package/dist/commonjs/utils/tracing.js +1 -0
- package/dist/commonjs/utils/tracing.js.map +1 -1
- package/dist/commonjs/utils/utils.common.d.ts.map +1 -1
- package/dist/commonjs/utils/utils.common.js +14 -0
- package/dist/commonjs/utils/utils.common.js.map +3 -3
- package/dist/esm/AccountSASPermissions.js +123 -111
- package/dist/esm/AccountSASPermissions.js.map +1 -7
- package/dist/esm/AccountSASResourceTypes.js +67 -58
- package/dist/esm/AccountSASResourceTypes.js.map +1 -7
- package/dist/esm/AccountSASServices.js +75 -66
- package/dist/esm/AccountSASServices.js.map +1 -7
- package/dist/esm/AccountSASSignatureValues.js +63 -62
- package/dist/esm/AccountSASSignatureValues.js.map +1 -7
- package/dist/esm/Pipeline.js +239 -239
- package/dist/esm/Pipeline.js.map +1 -7
- package/dist/esm/QueueClient.js +671 -689
- package/dist/esm/QueueClient.js.map +1 -7
- package/dist/esm/QueueSASPermissions.js +77 -68
- package/dist/esm/QueueSASPermissions.js.map +1 -7
- package/dist/esm/QueueSASSignatureValues.js +103 -123
- package/dist/esm/QueueSASSignatureValues.js.map +1 -7
- package/dist/esm/QueueServiceClient.js +463 -505
- package/dist/esm/QueueServiceClient.js.map +1 -7
- package/dist/esm/SASQueryParameters.js +272 -283
- package/dist/esm/SASQueryParameters.js.map +1 -7
- package/dist/esm/SasIPRange.js +12 -5
- package/dist/esm/SasIPRange.js.map +1 -7
- package/dist/esm/StorageClient.js +59 -50
- package/dist/esm/StorageClient.js.map +1 -7
- package/dist/esm/StorageContextClient.js +15 -10
- package/dist/esm/StorageContextClient.js.map +1 -7
- package/dist/esm/generated/src/index.js +9 -4
- package/dist/esm/generated/src/index.js.map +1 -7
- package/dist/esm/generated/src/models/index.js +126 -63
- package/dist/esm/generated/src/models/index.js.map +1 -7
- package/dist/esm/generated/src/models/mappers.js +1827 -1873
- package/dist/esm/generated/src/models/mappers.js.map +1 -7
- package/dist/esm/generated/src/models/parameters.js +302 -330
- package/dist/esm/generated/src/models/parameters.js.map +1 -7
- package/dist/esm/generated/src/operations/index.js +8 -0
- package/dist/esm/generated/src/operations/index.js.map +1 -7
- package/dist/esm/generated/src/operations/messageId.js +92 -95
- package/dist/esm/generated/src/operations/messageId.js.map +1 -7
- package/dist/esm/generated/src/operations/messages.js +178 -178
- package/dist/esm/generated/src/operations/messages.js.map +1 -7
- package/dist/esm/generated/src/operations/queue.js +199 -208
- package/dist/esm/generated/src/operations/queue.js.map +1 -7
- package/dist/esm/generated/src/operations/service.js +192 -204
- package/dist/esm/generated/src/operations/service.js.map +1 -7
- package/dist/esm/generated/src/operationsInterfaces/index.js +8 -0
- package/dist/esm/generated/src/operationsInterfaces/index.js.map +1 -7
- package/dist/esm/generated/src/operationsInterfaces/messageId.js +9 -0
- package/dist/esm/generated/src/operationsInterfaces/messageId.js.map +1 -7
- package/dist/esm/generated/src/operationsInterfaces/messages.js +9 -0
- package/dist/esm/generated/src/operationsInterfaces/messages.js.map +1 -7
- package/dist/esm/generated/src/operationsInterfaces/queue.js +9 -0
- package/dist/esm/generated/src/operationsInterfaces/queue.js.map +1 -7
- package/dist/esm/generated/src/operationsInterfaces/service.js +9 -0
- package/dist/esm/generated/src/operationsInterfaces/service.js.map +1 -7
- package/dist/esm/generated/src/storageClient.js +54 -49
- package/dist/esm/generated/src/storageClient.js.map +1 -7
- package/dist/esm/generatedModels.js +4 -0
- package/dist/esm/generatedModels.js.map +1 -7
- package/dist/esm/index.js +10 -50
- package/dist/esm/index.js.map +1 -7
- package/dist/esm/log.js +7 -4
- package/dist/esm/log.js.map +1 -7
- package/dist/esm/models.js +18 -10
- package/dist/esm/models.js.map +1 -7
- package/dist/esm/utils/constants.js +111 -117
- package/dist/esm/utils/constants.js.map +1 -7
- package/dist/esm/utils/tracing.js +11 -7
- package/dist/esm/utils/tracing.js.map +1 -7
- package/dist/esm/utils/utils.common.d.ts.map +1 -1
- package/dist/esm/utils/utils.common.js +372 -247
- package/dist/esm/utils/utils.common.js.map +1 -7
- package/dist/react-native/generated/src/storageClient.js +2 -2
- package/dist/react-native/generated/src/storageClient.js.map +1 -1
- package/dist/react-native/utils/constants.js +2 -2
- package/dist/react-native/utils/constants.js.map +1 -1
- package/dist/react-native/utils/utils.common.d.ts.map +1 -1
- package/dist/react-native/utils/utils.common.js +14 -0
- package/dist/react-native/utils/utils.common.js.map +1 -1
- package/package.json +13 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.common.d.ts","sourceRoot":"","sources":["../../../src/utils/utils.common.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAQ7D,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEhF;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAQjE;AACD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAwBjF;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAGxF;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAI5D;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG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,EAAE,OAAO,CAAC;QACvB;;WAEG;QACH,UAAU,EAAE,MAAM,CAAC;QACnB;;WAEG;QACH,UAAU,EAAE,IAAI,CAAC;KAClB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,SAAS,EAAE,YAAY,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,OAAO,GAAG,SAAS,EAAE,IAAI,GAAG,SAAS,IAAI,CAAC,GACpE,CAAC,IAAI,SAAS,MAAM,GAChB,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,GAC/B,OAAO,SAAS,MAAM,GACpB,mBAAmB,CAAC,OAAO,CAAC,GAC5B,YAAY,CAAC,CAAC;AAEtB;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,GAAG,SAAS,EAAE,IAAI,GAAG,SAAS,EACpF,QAAQ,EAAE,CAAC,GACV,YAAY,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,CAMhC"}
|
|
@@ -1,251 +1,376 @@
|
|
|
1
1
|
import { createHttpHeaders } from "@azure/core-rest-pipeline";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
urlParsed.pathname = path;
|
|
13
|
-
return urlParsed.toString();
|
|
14
|
-
}
|
|
15
|
-
function setURLParameter(url, name, value) {
|
|
16
|
-
const urlParsed = new URL(url);
|
|
17
|
-
const encodedName = encodeURIComponent(name);
|
|
18
|
-
const encodedValue = value ? encodeURIComponent(value) : void 0;
|
|
19
|
-
const searchString = urlParsed.search === "" ? "?" : urlParsed.search;
|
|
20
|
-
const searchPieces = [];
|
|
21
|
-
for (const pair of searchString.slice(1).split("&")) {
|
|
22
|
-
if (pair) {
|
|
23
|
-
const [key] = pair.split("=", 2);
|
|
24
|
-
if (key !== encodedName) {
|
|
25
|
-
searchPieces.push(pair);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
if (encodedValue) {
|
|
30
|
-
searchPieces.push(`${encodedName}=${encodedValue}`);
|
|
31
|
-
}
|
|
32
|
-
urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : "";
|
|
33
|
-
return urlParsed.toString();
|
|
34
|
-
}
|
|
35
|
-
function getURLParameter(url, name) {
|
|
36
|
-
const urlParsed = new URL(url);
|
|
37
|
-
return urlParsed.searchParams.get(name) ?? void 0;
|
|
38
|
-
}
|
|
39
|
-
function setURLHost(url, host) {
|
|
40
|
-
const urlParsed = new URL(url);
|
|
41
|
-
urlParsed.hostname = host;
|
|
42
|
-
return urlParsed.toString();
|
|
43
|
-
}
|
|
44
|
-
function getURLPath(url) {
|
|
45
|
-
try {
|
|
2
|
+
import { HeaderConstants, URLConstants, DevelopmentConnectionString, PathStylePorts, } from "./constants.js";
|
|
3
|
+
/**
|
|
4
|
+
* Append a string to URL path. Will remove duplicated "/" in front of the string
|
|
5
|
+
* when URL path ends with a "/".
|
|
6
|
+
*
|
|
7
|
+
* @param url - Source URL string
|
|
8
|
+
* @param name - String to be appended to URL
|
|
9
|
+
* @returns An updated URL string
|
|
10
|
+
*/
|
|
11
|
+
export function appendToURLPath(url, name) {
|
|
46
12
|
const urlParsed = new URL(url);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
13
|
+
let path = urlParsed.pathname;
|
|
14
|
+
path = path ? (path.endsWith("/") ? `${path}${name}` : `${path}/${name}`) : name;
|
|
15
|
+
urlParsed.pathname = path;
|
|
16
|
+
return urlParsed.toString();
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Set URL parameter name and value. If name exists in URL parameters, old value
|
|
20
|
+
* will be replaced by name key. If not provide value, the parameter will be deleted.
|
|
21
|
+
*
|
|
22
|
+
* @param url - Source URL string
|
|
23
|
+
* @param name - Parameter name
|
|
24
|
+
* @param value - Parameter value
|
|
25
|
+
* @returns An updated URL string
|
|
26
|
+
*/
|
|
27
|
+
export function setURLParameter(url, name, value) {
|
|
28
|
+
const urlParsed = new URL(url);
|
|
29
|
+
const encodedName = encodeURIComponent(name);
|
|
30
|
+
const encodedValue = value ? encodeURIComponent(value) : undefined;
|
|
31
|
+
// mutating searchParams will change the encoding, so we have to do this ourselves
|
|
32
|
+
const searchString = urlParsed.search === "" ? "?" : urlParsed.search;
|
|
33
|
+
const searchPieces = [];
|
|
34
|
+
for (const pair of searchString.slice(1).split("&")) {
|
|
35
|
+
if (pair) {
|
|
36
|
+
const [key] = pair.split("=", 2);
|
|
37
|
+
if (key !== encodedName) {
|
|
38
|
+
searchPieces.push(pair);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (encodedValue) {
|
|
43
|
+
searchPieces.push(`${encodedName}=${encodedValue}`);
|
|
44
|
+
}
|
|
45
|
+
urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : "";
|
|
46
|
+
return urlParsed.toString();
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Get URL parameter by name.
|
|
50
|
+
*
|
|
51
|
+
* @param url - URL string
|
|
52
|
+
* @param name - Parameter name
|
|
53
|
+
* @returns Parameter value(s) for the given parameter name.
|
|
54
|
+
*/
|
|
55
|
+
export function getURLParameter(url, name) {
|
|
56
|
+
const urlParsed = new URL(url);
|
|
57
|
+
return urlParsed.searchParams.get(name) ?? undefined;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Set URL host.
|
|
61
|
+
*
|
|
62
|
+
* @param url - Source URL string
|
|
63
|
+
* @param host - New host string
|
|
64
|
+
* @returns An updated URL string
|
|
65
|
+
*/
|
|
66
|
+
export function setURLHost(url, host) {
|
|
67
|
+
const urlParsed = new URL(url);
|
|
68
|
+
urlParsed.hostname = host;
|
|
69
|
+
return urlParsed.toString();
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Gets URL path from an URL string.
|
|
73
|
+
*
|
|
74
|
+
* @param url - Source URL string
|
|
75
|
+
* @returns The path part of the given URL string.
|
|
76
|
+
*/
|
|
77
|
+
export function getURLPath(url) {
|
|
78
|
+
try {
|
|
79
|
+
const urlParsed = new URL(url);
|
|
80
|
+
return urlParsed.pathname;
|
|
81
|
+
}
|
|
82
|
+
catch (e) {
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Gets URL query key value pairs from an URL string.
|
|
88
|
+
*
|
|
89
|
+
* @param url -
|
|
90
|
+
* @returns query key value string pairs from the given URL string.
|
|
91
|
+
*/
|
|
92
|
+
export function getURLQueries(url) {
|
|
93
|
+
let queryString = new URL(url).search;
|
|
94
|
+
if (!queryString) {
|
|
95
|
+
return {};
|
|
96
|
+
}
|
|
97
|
+
queryString = queryString.trim();
|
|
98
|
+
queryString = queryString.startsWith("?") ? queryString.substring(1) : queryString;
|
|
99
|
+
let querySubStrings = queryString.split("&");
|
|
100
|
+
querySubStrings = querySubStrings.filter((value) => {
|
|
101
|
+
const indexOfEqual = value.indexOf("=");
|
|
102
|
+
const lastIndexOfEqual = value.lastIndexOf("=");
|
|
103
|
+
return (indexOfEqual > 0 && indexOfEqual === lastIndexOfEqual && lastIndexOfEqual < value.length - 1);
|
|
104
|
+
});
|
|
105
|
+
const queries = {};
|
|
106
|
+
for (const querySubString of querySubStrings) {
|
|
107
|
+
const splitResults = querySubString.split("=");
|
|
108
|
+
const key = splitResults[0];
|
|
109
|
+
const value = splitResults[1];
|
|
110
|
+
queries[key] = value;
|
|
111
|
+
}
|
|
112
|
+
return queries;
|
|
73
113
|
}
|
|
74
114
|
function getProxyUriFromDevConnString(connectionString) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
function
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
115
|
+
// Development Connection String
|
|
116
|
+
// https://learn.microsoft.com/azure/storage/common/storage-configure-connection-string#connect-to-the-emulator-account-using-the-well-known-account-name-and-key
|
|
117
|
+
let proxyUri = "";
|
|
118
|
+
if (connectionString.search("DevelopmentStorageProxyUri=") !== -1) {
|
|
119
|
+
// CONNECTION_STRING=UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://myProxyUri
|
|
120
|
+
const matchCredentials = connectionString.split(";");
|
|
121
|
+
for (const element of matchCredentials) {
|
|
122
|
+
if (element.trim().startsWith("DevelopmentStorageProxyUri=")) {
|
|
123
|
+
proxyUri = element.trim().match("DevelopmentStorageProxyUri=(.*)")[1];
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return proxyUri;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
*
|
|
131
|
+
* @param connectionString - Account connection string.
|
|
132
|
+
* @param argument - property to get value from the connection string.
|
|
133
|
+
* @returns Value of the property specified in argument.
|
|
134
|
+
*/
|
|
135
|
+
export function getValueInConnString(connectionString, argument) {
|
|
136
|
+
const elements = connectionString.split(";");
|
|
137
|
+
for (const element of elements) {
|
|
138
|
+
if (element.trim().startsWith(argument)) {
|
|
139
|
+
return element.trim().match(argument + "=(.*)")[1];
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return "";
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Extracts the parts of an Azure Storage account connection string.
|
|
146
|
+
*
|
|
147
|
+
* @param connectionString - Connection string.
|
|
148
|
+
* @returns String key value pairs of the storage account's url and credentials.
|
|
149
|
+
*/
|
|
150
|
+
export function extractConnectionStringParts(connectionString) {
|
|
151
|
+
let proxyUri = "";
|
|
152
|
+
if (connectionString.startsWith("UseDevelopmentStorage=true")) {
|
|
153
|
+
// Development connection string
|
|
154
|
+
proxyUri = getProxyUriFromDevConnString(connectionString);
|
|
155
|
+
connectionString = DevelopmentConnectionString;
|
|
156
|
+
}
|
|
157
|
+
// Matching QueueEndpoint in the Account connection string
|
|
158
|
+
let queueEndpoint = getValueInConnString(connectionString, "QueueEndpoint");
|
|
159
|
+
// Slicing off '/' at the end if exists
|
|
160
|
+
// (The methods that use `extractConnectionStringParts` expect the url to not have `/` at the end)
|
|
161
|
+
queueEndpoint = queueEndpoint.endsWith("/") ? queueEndpoint.slice(0, -1) : queueEndpoint;
|
|
162
|
+
if (connectionString.search("DefaultEndpointsProtocol=") !== -1 &&
|
|
163
|
+
connectionString.search("AccountKey=") !== -1) {
|
|
164
|
+
// Account connection string
|
|
165
|
+
let defaultEndpointsProtocol = "";
|
|
166
|
+
let accountName = "";
|
|
167
|
+
let accountKey = Buffer.from("accountKey", "base64");
|
|
168
|
+
let endpointSuffix = "";
|
|
169
|
+
// Get account name and key
|
|
170
|
+
accountName = getValueInConnString(connectionString, "AccountName");
|
|
171
|
+
accountKey = Buffer.from(getValueInConnString(connectionString, "AccountKey"), "base64");
|
|
172
|
+
if (!queueEndpoint) {
|
|
173
|
+
// QueueEndpoint is not present in the Account connection string
|
|
174
|
+
// Can be obtained from `${defaultEndpointsProtocol}://${accountName}.queue.${endpointSuffix}`
|
|
175
|
+
defaultEndpointsProtocol = getValueInConnString(connectionString, "DefaultEndpointsProtocol");
|
|
176
|
+
const protocol = defaultEndpointsProtocol.toLowerCase();
|
|
177
|
+
if (protocol !== "https" && protocol !== "http") {
|
|
178
|
+
throw new Error("Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'");
|
|
179
|
+
}
|
|
180
|
+
endpointSuffix = getValueInConnString(connectionString, "EndpointSuffix");
|
|
181
|
+
if (!endpointSuffix) {
|
|
182
|
+
throw new Error("Invalid EndpointSuffix in the provided Connection String");
|
|
183
|
+
}
|
|
184
|
+
queueEndpoint = `${defaultEndpointsProtocol}://${accountName}.queue.${endpointSuffix}`;
|
|
185
|
+
}
|
|
186
|
+
if (!accountName) {
|
|
187
|
+
throw new Error("Invalid AccountName in the provided Connection String");
|
|
188
|
+
}
|
|
189
|
+
else if (accountKey.length === 0) {
|
|
190
|
+
throw new Error("Invalid AccountKey in the provided Connection String");
|
|
191
|
+
}
|
|
192
|
+
return {
|
|
193
|
+
kind: "AccountConnString",
|
|
194
|
+
url: queueEndpoint,
|
|
195
|
+
accountName,
|
|
196
|
+
accountKey,
|
|
197
|
+
proxyUri,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
// SAS connection string
|
|
202
|
+
const accountSas = getValueInConnString(connectionString, "SharedAccessSignature");
|
|
203
|
+
let accountName = getValueInConnString(connectionString, "AccountName");
|
|
204
|
+
// if accountName is empty, try to read it from BlobEndpoint
|
|
205
|
+
if (!accountName) {
|
|
206
|
+
accountName = getAccountNameFromUrl(queueEndpoint);
|
|
207
|
+
}
|
|
208
|
+
if (!queueEndpoint) {
|
|
209
|
+
throw new Error("Invalid QueueEndpoint in the provided SAS Connection String");
|
|
210
|
+
}
|
|
211
|
+
else if (!accountSas) {
|
|
212
|
+
throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String");
|
|
213
|
+
}
|
|
214
|
+
return { kind: "SASConnString", url: queueEndpoint, accountName, accountSas };
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Rounds a date off to seconds.
|
|
219
|
+
*
|
|
220
|
+
* @param date -
|
|
221
|
+
* @param withMilliseconds - If true, YYYY-MM-DDThh:mm:ss.fffffffZ will be returned;
|
|
222
|
+
* If false, YYYY-MM-DDThh:mm:ssZ will be returned.
|
|
223
|
+
* @returns Date string in ISO8061 format, with or without 7 milliseconds component
|
|
224
|
+
*/
|
|
225
|
+
export function truncatedISO8061Date(date, withMilliseconds = true) {
|
|
226
|
+
// Date.toISOString() will return like "2018-10-29T06:34:36.139Z"
|
|
227
|
+
const dateString = date.toISOString();
|
|
228
|
+
return withMilliseconds
|
|
229
|
+
? dateString.substring(0, dateString.length - 1) + "0000" + "Z"
|
|
230
|
+
: dateString.substring(0, dateString.length - 5) + "Z";
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Delay specified time interval.
|
|
234
|
+
*
|
|
235
|
+
* @param timeInMs -
|
|
236
|
+
* @param aborter -
|
|
237
|
+
* @param abortError -
|
|
238
|
+
*/
|
|
239
|
+
export async function delay(timeInMs, aborter, abortError) {
|
|
240
|
+
return new Promise((resolve, reject) => {
|
|
241
|
+
/* eslint-disable-next-line prefer-const*/
|
|
242
|
+
let timeout;
|
|
243
|
+
const abortHandler = () => {
|
|
244
|
+
if (timeout !== undefined) {
|
|
245
|
+
clearTimeout(timeout);
|
|
246
|
+
}
|
|
247
|
+
reject(abortError);
|
|
248
|
+
};
|
|
249
|
+
const resolveHandler = () => {
|
|
250
|
+
if (aborter !== undefined) {
|
|
251
|
+
aborter.removeEventListener("abort", abortHandler);
|
|
252
|
+
}
|
|
253
|
+
resolve();
|
|
254
|
+
};
|
|
255
|
+
timeout = setTimeout(resolveHandler, timeInMs);
|
|
256
|
+
if (aborter !== undefined) {
|
|
257
|
+
aborter.addEventListener("abort", abortHandler);
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Sanitizes a url by removing the Signature parameter
|
|
263
|
+
* @param url - to sanitize
|
|
264
|
+
* @returns sanitized string
|
|
265
|
+
*/
|
|
266
|
+
export function sanitizeURL(url) {
|
|
267
|
+
let safeURL = url;
|
|
268
|
+
if (getURLParameter(safeURL, URLConstants.Parameters.SIGNATURE)) {
|
|
269
|
+
safeURL = setURLParameter(safeURL, URLConstants.Parameters.SIGNATURE, "*****");
|
|
270
|
+
}
|
|
271
|
+
return safeURL;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Sanitize headers by removing sensitive values such as AUTHORIZATION and X_MS_COPY_SOURCE
|
|
275
|
+
* @param originalHeader - original headers
|
|
276
|
+
* @returns sanitized headers
|
|
277
|
+
*/
|
|
278
|
+
export function sanitizeHeaders(originalHeader) {
|
|
279
|
+
const headers = createHttpHeaders();
|
|
280
|
+
for (const [name, value] of originalHeader) {
|
|
281
|
+
if (name.toLowerCase() === HeaderConstants.AUTHORIZATION) {
|
|
282
|
+
headers.set(name, "*****");
|
|
283
|
+
}
|
|
284
|
+
else if (name.toLowerCase() === HeaderConstants.X_MS_COPY_SOURCE) {
|
|
285
|
+
headers.set(name, sanitizeURL(value));
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
headers.set(name, value);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return headers;
|
|
292
|
+
}
|
|
293
|
+
const accountNameSuffixes = [
|
|
294
|
+
"-secondary-ipv6",
|
|
295
|
+
"-secondary-dualstack",
|
|
296
|
+
"-ipv6",
|
|
297
|
+
"-dualstack",
|
|
298
|
+
"-secondary",
|
|
299
|
+
];
|
|
300
|
+
/**
|
|
301
|
+
* Extracts account name from the url
|
|
302
|
+
* @param url - url to extract the account name from
|
|
303
|
+
* @returns with the account name
|
|
304
|
+
*/
|
|
305
|
+
export function getAccountNameFromUrl(url) {
|
|
306
|
+
const parsedUrl = new URL(url);
|
|
307
|
+
let accountName;
|
|
308
|
+
try {
|
|
309
|
+
if (parsedUrl.hostname.split(".")[1] === "queue") {
|
|
310
|
+
// `${defaultEndpointsProtocol}://${accountName}.queue.${endpointSuffix}`;
|
|
311
|
+
// `${defaultEndpointsProtocol}://${accountName}-suffix.queue.${endpointSuffix}`;
|
|
312
|
+
accountName = parsedUrl.hostname.split(".")[0];
|
|
313
|
+
for (let i = 0; i < accountNameSuffixes.length; ++i) {
|
|
314
|
+
const suffix = accountNameSuffixes[i];
|
|
315
|
+
if (accountName.endsWith(suffix)) {
|
|
316
|
+
accountName = accountName.substring(0, accountName.length - suffix.length);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
else if (isIpEndpointStyle(parsedUrl)) {
|
|
321
|
+
// IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/
|
|
322
|
+
// Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/
|
|
323
|
+
// .getPath() -> /devstoreaccount1/
|
|
324
|
+
accountName = parsedUrl.pathname.split("/")[1];
|
|
325
|
+
}
|
|
326
|
+
else {
|
|
327
|
+
// Custom domain case: "https://customdomain.com/containername/blob".
|
|
328
|
+
accountName = "";
|
|
329
|
+
}
|
|
330
|
+
return accountName;
|
|
331
|
+
}
|
|
332
|
+
catch (error) {
|
|
333
|
+
throw new Error("Unable to extract accountName with provided information.");
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
export function isIpEndpointStyle(parsedUrl) {
|
|
337
|
+
const host = parsedUrl.host;
|
|
338
|
+
// Case 1: Ipv6, use a broad regex to find out candidates whose host contains two ':'.
|
|
339
|
+
// Case 2: localhost(:port) or host.docker.internal, use broad regex to match port part.
|
|
340
|
+
// Case 3: Ipv4, use broad regex which just check if host contains Ipv4.
|
|
341
|
+
// For valid host please refer to https://man7.org/linux/man-pages/man7/hostname.7.html.
|
|
342
|
+
return (/^.*:.*:.*$|^(localhost|host.docker.internal)(:[0-9]+)?$|^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])){3}(:[0-9]+)?$/.test(host) ||
|
|
343
|
+
(Boolean(parsedUrl.port) && PathStylePorts.includes(parsedUrl.port)));
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Append a string to URL query.
|
|
347
|
+
*
|
|
348
|
+
* @param url - Source URL string.
|
|
349
|
+
* @param queryParts - String to be appended to the URL query.
|
|
350
|
+
* @returns An updated URL string.
|
|
351
|
+
*/
|
|
352
|
+
export function appendToURLQuery(url, queryParts) {
|
|
353
|
+
const urlParsed = new URL(url);
|
|
354
|
+
let query = urlParsed.search;
|
|
355
|
+
if (query) {
|
|
356
|
+
query += "&" + queryParts;
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
query = queryParts;
|
|
360
|
+
}
|
|
361
|
+
urlParsed.search = query;
|
|
362
|
+
return urlParsed.toString();
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* A typesafe helper for ensuring that a given response object has
|
|
366
|
+
* the original _response attached.
|
|
367
|
+
* @param response - A response object from calling a client operation
|
|
368
|
+
* @returns The same object, but with known _response property
|
|
369
|
+
*/
|
|
370
|
+
export function assertResponse(response) {
|
|
371
|
+
if (`_response` in response) {
|
|
372
|
+
return response;
|
|
373
|
+
}
|
|
374
|
+
throw new TypeError(`Unexpected response object ${response}`);
|
|
375
|
+
}
|
|
376
|
+
//# sourceMappingURL=utils.common.js.map
|