@azure/storage-queue 12.29.0 → 12.30.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/Pipeline.d.ts +2 -3
- package/dist/browser/Pipeline.d.ts.map +1 -1
- package/dist/browser/Pipeline.js.map +1 -1
- package/dist/browser/QueueClient.d.ts +2 -1
- package/dist/browser/QueueClient.d.ts.map +1 -1
- package/dist/browser/QueueClient.js.map +1 -1
- package/dist/browser/QueueSASSignatureValues.d.ts +2 -1
- package/dist/browser/QueueSASSignatureValues.d.ts.map +1 -1
- package/dist/browser/QueueSASSignatureValues.js +2 -2
- package/dist/browser/QueueSASSignatureValues.js.map +1 -1
- package/dist/browser/QueueServiceClient.d.ts +28 -0
- package/dist/browser/QueueServiceClient.d.ts.map +1 -1
- package/dist/browser/QueueServiceClient.js +21 -13
- package/dist/browser/QueueServiceClient.js.map +1 -1
- package/dist/browser/SASQueryParameters.d.ts +6 -1
- package/dist/browser/SASQueryParameters.d.ts.map +1 -1
- package/dist/browser/SASQueryParameters.js +10 -0
- package/dist/browser/SASQueryParameters.js.map +1 -1
- package/dist/browser/generated/src/models/index.d.ts +4 -0
- package/dist/browser/generated/src/models/index.d.ts.map +1 -1
- package/dist/browser/generated/src/models/index.js.map +1 -1
- package/dist/browser/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/browser/generated/src/models/mappers.js +14 -0
- package/dist/browser/generated/src/models/mappers.js.map +1 -1
- package/dist/browser/generated/src/models/parameters.js +1 -1
- package/dist/browser/generated/src/models/parameters.js.map +1 -1
- package/dist/browser/generated/src/storageClient.js +2 -2
- package/dist/browser/generated/src/storageClient.js.map +1 -1
- package/dist/browser/generatedModels.d.ts +2 -2
- package/dist/browser/generatedModels.d.ts.map +1 -1
- package/dist/browser/generatedModels.js.map +1 -1
- package/dist/browser/index.d.ts +8 -8
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +1 -2
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/utils/constants.d.ts.map +1 -1
- package/dist/browser/utils/constants.js +2 -2
- package/dist/browser/utils/constants.js.map +1 -1
- package/dist/commonjs/AccountSASPermissions.js +133 -126
- package/dist/commonjs/AccountSASPermissions.js.map +7 -1
- package/dist/commonjs/AccountSASResourceTypes.js +80 -70
- package/dist/commonjs/AccountSASResourceTypes.js.map +7 -1
- package/dist/commonjs/AccountSASServices.js +88 -78
- package/dist/commonjs/AccountSASServices.js.map +7 -1
- package/dist/commonjs/AccountSASSignatureValues.js +91 -72
- package/dist/commonjs/AccountSASSignatureValues.js.map +7 -1
- package/dist/commonjs/Pipeline.d.ts +2 -3
- package/dist/commonjs/Pipeline.d.ts.map +1 -1
- package/dist/commonjs/Pipeline.js +244 -244
- package/dist/commonjs/Pipeline.js.map +7 -1
- package/dist/commonjs/QueueClient.d.ts +2 -1
- package/dist/commonjs/QueueClient.d.ts.map +1 -1
- package/dist/commonjs/QueueClient.js +710 -683
- package/dist/commonjs/QueueClient.js.map +7 -1
- package/dist/commonjs/QueueSASPermissions.js +90 -80
- package/dist/commonjs/QueueSASPermissions.js.map +7 -1
- package/dist/commonjs/QueueSASSignatureValues.d.ts +2 -1
- package/dist/commonjs/QueueSASSignatureValues.d.ts.map +1 -1
- package/dist/commonjs/QueueSASSignatureValues.js +151 -111
- package/dist/commonjs/QueueSASSignatureValues.js.map +7 -1
- package/dist/commonjs/QueueServiceClient.d.ts +28 -0
- package/dist/commonjs/QueueServiceClient.d.ts.map +1 -1
- package/dist/commonjs/QueueServiceClient.js +532 -472
- package/dist/commonjs/QueueServiceClient.js.map +7 -1
- package/dist/commonjs/SASQueryParameters.d.ts +6 -1
- package/dist/commonjs/SASQueryParameters.d.ts.map +1 -1
- package/dist/commonjs/SASQueryParameters.js +308 -267
- package/dist/commonjs/SASQueryParameters.js.map +7 -1
- package/dist/commonjs/SasIPRange.js +27 -14
- package/dist/commonjs/SasIPRange.js.map +7 -1
- package/dist/commonjs/StorageClient.js +75 -65
- package/dist/commonjs/StorageClient.js.map +7 -1
- package/dist/commonjs/StorageContextClient.js +34 -20
- package/dist/commonjs/StorageContextClient.js.map +7 -1
- package/dist/commonjs/generated/src/index.js +32 -16
- package/dist/commonjs/generated/src/index.js.map +7 -1
- package/dist/commonjs/generated/src/models/index.d.ts +4 -0
- package/dist/commonjs/generated/src/models/index.d.ts.map +1 -1
- package/dist/commonjs/generated/src/models/index.js +86 -129
- package/dist/commonjs/generated/src/models/index.js.map +7 -1
- package/dist/commonjs/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/commonjs/generated/src/models/mappers.js +1947 -1817
- package/dist/commonjs/generated/src/models/mappers.js.map +7 -1
- package/dist/commonjs/generated/src/models/parameters.js +378 -305
- package/dist/commonjs/generated/src/models/parameters.js.map +7 -1
- package/dist/commonjs/generated/src/operations/index.js +27 -15
- package/dist/commonjs/generated/src/operations/index.js.map +7 -1
- package/dist/commonjs/generated/src/operations/messageId.js +130 -99
- package/dist/commonjs/generated/src/operations/messageId.js.map +7 -1
- package/dist/commonjs/generated/src/operations/messages.js +213 -185
- package/dist/commonjs/generated/src/operations/messages.js.map +7 -1
- package/dist/commonjs/generated/src/operations/queue.js +243 -206
- package/dist/commonjs/generated/src/operations/queue.js.map +7 -1
- package/dist/commonjs/generated/src/operations/service.js +239 -199
- package/dist/commonjs/generated/src/operations/service.js.map +7 -1
- package/dist/commonjs/generated/src/operationsInterfaces/index.js +27 -15
- package/dist/commonjs/generated/src/operationsInterfaces/index.js.map +7 -1
- package/dist/commonjs/generated/src/operationsInterfaces/messageId.js +15 -10
- package/dist/commonjs/generated/src/operationsInterfaces/messageId.js.map +7 -1
- package/dist/commonjs/generated/src/operationsInterfaces/messages.js +15 -10
- package/dist/commonjs/generated/src/operationsInterfaces/messages.js.map +7 -1
- package/dist/commonjs/generated/src/operationsInterfaces/queue.js +15 -10
- package/dist/commonjs/generated/src/operationsInterfaces/queue.js.map +7 -1
- package/dist/commonjs/generated/src/operationsInterfaces/service.js +15 -10
- package/dist/commonjs/generated/src/operationsInterfaces/service.js.map +7 -1
- package/dist/commonjs/generated/src/storageClient.js +77 -59
- package/dist/commonjs/generated/src/storageClient.js.map +7 -1
- package/dist/commonjs/generatedModels.d.ts +2 -2
- package/dist/commonjs/generatedModels.d.ts.map +1 -1
- package/dist/commonjs/generatedModels.js +15 -5
- package/dist/commonjs/generatedModels.js.map +7 -1
- package/dist/commonjs/index.d.ts +9 -9
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +88 -43
- package/dist/commonjs/index.js.map +7 -1
- package/dist/commonjs/log.js +28 -11
- package/dist/commonjs/log.js.map +7 -1
- package/dist/commonjs/models.js +33 -21
- package/dist/commonjs/models.js.map +7 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/commonjs/utils/constants.d.ts.map +1 -1
- package/dist/commonjs/utils/constants.js +151 -114
- package/dist/commonjs/utils/constants.js.map +7 -1
- package/dist/commonjs/utils/tracing.js +32 -16
- package/dist/commonjs/utils/tracing.js.map +7 -1
- package/dist/commonjs/utils/utils.common.js +242 -338
- package/dist/commonjs/utils/utils.common.js.map +7 -1
- package/dist/esm/AccountSASPermissions.js +111 -123
- package/dist/esm/AccountSASPermissions.js.map +7 -1
- package/dist/esm/AccountSASResourceTypes.js +58 -67
- package/dist/esm/AccountSASResourceTypes.js.map +7 -1
- package/dist/esm/AccountSASServices.js +66 -75
- package/dist/esm/AccountSASServices.js.map +7 -1
- package/dist/esm/AccountSASSignatureValues.js +62 -63
- package/dist/esm/AccountSASSignatureValues.js.map +7 -1
- package/dist/esm/Pipeline.d.ts +2 -3
- package/dist/esm/Pipeline.d.ts.map +1 -1
- package/dist/esm/Pipeline.js +239 -239
- package/dist/esm/Pipeline.js.map +7 -1
- package/dist/esm/QueueClient.d.ts +2 -1
- package/dist/esm/QueueClient.d.ts.map +1 -1
- package/dist/esm/QueueClient.js +689 -671
- package/dist/esm/QueueClient.js.map +7 -1
- package/dist/esm/QueueSASPermissions.js +68 -77
- package/dist/esm/QueueSASPermissions.js.map +7 -1
- package/dist/esm/QueueSASSignatureValues.d.ts +2 -1
- package/dist/esm/QueueSASSignatureValues.d.ts.map +1 -1
- package/dist/esm/QueueSASSignatureValues.js +124 -104
- package/dist/esm/QueueSASSignatureValues.js.map +7 -1
- package/dist/esm/QueueServiceClient.d.ts +28 -0
- package/dist/esm/QueueServiceClient.d.ts.map +1 -1
- package/dist/esm/QueueServiceClient.js +507 -457
- package/dist/esm/QueueServiceClient.js.map +7 -1
- package/dist/esm/SASQueryParameters.d.ts +6 -1
- package/dist/esm/SASQueryParameters.d.ts.map +1 -1
- package/dist/esm/SASQueryParameters.js +283 -262
- package/dist/esm/SASQueryParameters.js.map +7 -1
- package/dist/esm/SasIPRange.js +5 -12
- package/dist/esm/SasIPRange.js.map +7 -1
- package/dist/esm/StorageClient.js +50 -59
- package/dist/esm/StorageClient.js.map +7 -1
- package/dist/esm/StorageContextClient.js +10 -15
- package/dist/esm/StorageContextClient.js.map +7 -1
- package/dist/esm/generated/src/index.js +4 -9
- package/dist/esm/generated/src/index.js.map +7 -1
- package/dist/esm/generated/src/models/index.d.ts +4 -0
- package/dist/esm/generated/src/models/index.d.ts.map +1 -1
- package/dist/esm/generated/src/models/index.js +63 -126
- package/dist/esm/generated/src/models/index.js.map +7 -1
- package/dist/esm/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/esm/generated/src/models/mappers.js +1873 -1813
- package/dist/esm/generated/src/models/mappers.js.map +7 -1
- package/dist/esm/generated/src/models/parameters.js +330 -302
- package/dist/esm/generated/src/models/parameters.js.map +7 -1
- package/dist/esm/generated/src/operations/index.js +0 -8
- package/dist/esm/generated/src/operations/index.js.map +7 -1
- package/dist/esm/generated/src/operations/messageId.js +95 -92
- package/dist/esm/generated/src/operations/messageId.js.map +7 -1
- package/dist/esm/generated/src/operations/messages.js +178 -178
- package/dist/esm/generated/src/operations/messages.js.map +7 -1
- package/dist/esm/generated/src/operations/queue.js +208 -199
- package/dist/esm/generated/src/operations/queue.js.map +7 -1
- package/dist/esm/generated/src/operations/service.js +204 -192
- package/dist/esm/generated/src/operations/service.js.map +7 -1
- package/dist/esm/generated/src/operationsInterfaces/index.js +0 -8
- package/dist/esm/generated/src/operationsInterfaces/index.js.map +7 -1
- package/dist/esm/generated/src/operationsInterfaces/messageId.js +0 -9
- package/dist/esm/generated/src/operationsInterfaces/messageId.js.map +7 -1
- package/dist/esm/generated/src/operationsInterfaces/messages.js +0 -9
- package/dist/esm/generated/src/operationsInterfaces/messages.js.map +7 -1
- package/dist/esm/generated/src/operationsInterfaces/queue.js +0 -9
- package/dist/esm/generated/src/operationsInterfaces/queue.js.map +7 -1
- package/dist/esm/generated/src/operationsInterfaces/service.js +0 -9
- package/dist/esm/generated/src/operationsInterfaces/service.js.map +7 -1
- package/dist/esm/generated/src/storageClient.js +49 -54
- package/dist/esm/generated/src/storageClient.js.map +7 -1
- package/dist/esm/generatedModels.d.ts +2 -2
- package/dist/esm/generatedModels.d.ts.map +1 -1
- package/dist/esm/generatedModels.js +0 -4
- package/dist/esm/generatedModels.js.map +7 -1
- package/dist/esm/index.d.ts +9 -9
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +50 -11
- package/dist/esm/index.js.map +7 -1
- package/dist/esm/log.js +4 -7
- package/dist/esm/log.js.map +7 -1
- package/dist/esm/models.js +10 -18
- package/dist/esm/models.js.map +7 -1
- package/dist/esm/utils/constants.d.ts.map +1 -1
- package/dist/esm/utils/constants.js +117 -111
- package/dist/esm/utils/constants.js.map +7 -1
- package/dist/esm/utils/tracing.js +7 -11
- package/dist/esm/utils/tracing.js.map +7 -1
- package/dist/esm/utils/utils.common.js +247 -358
- package/dist/esm/utils/utils.common.js.map +7 -1
- package/dist/react-native/Pipeline.d.ts +2 -3
- package/dist/react-native/Pipeline.d.ts.map +1 -1
- package/dist/react-native/Pipeline.js.map +1 -1
- package/dist/react-native/QueueClient.d.ts +2 -1
- package/dist/react-native/QueueClient.d.ts.map +1 -1
- package/dist/react-native/QueueClient.js.map +1 -1
- package/dist/react-native/QueueSASSignatureValues.d.ts +2 -1
- package/dist/react-native/QueueSASSignatureValues.d.ts.map +1 -1
- package/dist/react-native/QueueSASSignatureValues.js +2 -2
- package/dist/react-native/QueueSASSignatureValues.js.map +1 -1
- package/dist/react-native/QueueServiceClient.d.ts +28 -0
- package/dist/react-native/QueueServiceClient.d.ts.map +1 -1
- package/dist/react-native/QueueServiceClient.js +21 -13
- package/dist/react-native/QueueServiceClient.js.map +1 -1
- package/dist/react-native/SASQueryParameters.d.ts +6 -1
- package/dist/react-native/SASQueryParameters.d.ts.map +1 -1
- package/dist/react-native/SASQueryParameters.js +10 -0
- package/dist/react-native/SASQueryParameters.js.map +1 -1
- package/dist/react-native/generated/src/models/index.d.ts +4 -0
- package/dist/react-native/generated/src/models/index.d.ts.map +1 -1
- package/dist/react-native/generated/src/models/index.js.map +1 -1
- package/dist/react-native/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/react-native/generated/src/models/mappers.js +14 -0
- package/dist/react-native/generated/src/models/mappers.js.map +1 -1
- package/dist/react-native/generated/src/models/parameters.js +1 -1
- package/dist/react-native/generated/src/models/parameters.js.map +1 -1
- 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/generatedModels.d.ts +2 -2
- package/dist/react-native/generatedModels.d.ts.map +1 -1
- package/dist/react-native/generatedModels.js.map +1 -1
- package/dist/react-native/index.d.ts +9 -9
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js +0 -1
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/utils/constants.d.ts.map +1 -1
- package/dist/react-native/utils/constants.js +2 -2
- package/dist/react-native/utils/constants.js.map +1 -1
- package/package.json +2 -19
- package/dist/browser/index-browser.d.mts.map +0 -1
- package/dist/browser/index-browser.mjs.map +0 -1
|
@@ -1,380 +1,284 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var utils_common_exports = {};
|
|
19
|
+
__export(utils_common_exports, {
|
|
20
|
+
appendToURLPath: () => appendToURLPath,
|
|
21
|
+
appendToURLQuery: () => appendToURLQuery,
|
|
22
|
+
assertResponse: () => assertResponse,
|
|
23
|
+
delay: () => delay,
|
|
24
|
+
extractConnectionStringParts: () => extractConnectionStringParts,
|
|
25
|
+
getAccountNameFromUrl: () => getAccountNameFromUrl,
|
|
26
|
+
getURLParameter: () => getURLParameter,
|
|
27
|
+
getURLPath: () => getURLPath,
|
|
28
|
+
getURLQueries: () => getURLQueries,
|
|
29
|
+
getValueInConnString: () => getValueInConnString,
|
|
30
|
+
isIpEndpointStyle: () => isIpEndpointStyle,
|
|
31
|
+
sanitizeHeaders: () => sanitizeHeaders,
|
|
32
|
+
sanitizeURL: () => sanitizeURL,
|
|
33
|
+
setURLHost: () => setURLHost,
|
|
34
|
+
setURLParameter: () => setURLParameter,
|
|
35
|
+
truncatedISO8061Date: () => truncatedISO8061Date
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(utils_common_exports);
|
|
38
|
+
var import_core_rest_pipeline = require("@azure/core-rest-pipeline");
|
|
39
|
+
var import_constants = require("./constants.js");
|
|
29
40
|
function appendToURLPath(url, name) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
41
|
+
const urlParsed = new URL(url);
|
|
42
|
+
let path = urlParsed.pathname;
|
|
43
|
+
path = path ? path.endsWith("/") ? `${path}${name}` : `${path}/${name}` : name;
|
|
44
|
+
urlParsed.pathname = path;
|
|
45
|
+
return urlParsed.toString();
|
|
35
46
|
}
|
|
36
|
-
/**
|
|
37
|
-
* Set URL parameter name and value. If name exists in URL parameters, old value
|
|
38
|
-
* will be replaced by name key. If not provide value, the parameter will be deleted.
|
|
39
|
-
*
|
|
40
|
-
* @param url - Source URL string
|
|
41
|
-
* @param name - Parameter name
|
|
42
|
-
* @param value - Parameter value
|
|
43
|
-
* @returns An updated URL string
|
|
44
|
-
*/
|
|
45
47
|
function setURLParameter(url, name, value) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
if (encodedValue) {
|
|
61
|
-
searchPieces.push(`${encodedName}=${encodedValue}`);
|
|
48
|
+
const urlParsed = new URL(url);
|
|
49
|
+
const encodedName = encodeURIComponent(name);
|
|
50
|
+
const encodedValue = value ? encodeURIComponent(value) : void 0;
|
|
51
|
+
const searchString = urlParsed.search === "" ? "?" : urlParsed.search;
|
|
52
|
+
const searchPieces = [];
|
|
53
|
+
for (const pair of searchString.slice(1).split("&")) {
|
|
54
|
+
if (pair) {
|
|
55
|
+
const [key] = pair.split("=", 2);
|
|
56
|
+
if (key !== encodedName) {
|
|
57
|
+
searchPieces.push(pair);
|
|
58
|
+
}
|
|
62
59
|
}
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
}
|
|
61
|
+
if (encodedValue) {
|
|
62
|
+
searchPieces.push(`${encodedName}=${encodedValue}`);
|
|
63
|
+
}
|
|
64
|
+
urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : "";
|
|
65
|
+
return urlParsed.toString();
|
|
65
66
|
}
|
|
66
|
-
/**
|
|
67
|
-
* Get URL parameter by name.
|
|
68
|
-
*
|
|
69
|
-
* @param url - URL string
|
|
70
|
-
* @param name - Parameter name
|
|
71
|
-
* @returns Parameter value(s) for the given parameter name.
|
|
72
|
-
*/
|
|
73
67
|
function getURLParameter(url, name) {
|
|
74
|
-
|
|
75
|
-
|
|
68
|
+
const urlParsed = new URL(url);
|
|
69
|
+
return urlParsed.searchParams.get(name) ?? void 0;
|
|
76
70
|
}
|
|
77
|
-
/**
|
|
78
|
-
* Set URL host.
|
|
79
|
-
*
|
|
80
|
-
* @param url - Source URL string
|
|
81
|
-
* @param host - New host string
|
|
82
|
-
* @returns An updated URL string
|
|
83
|
-
*/
|
|
84
71
|
function setURLHost(url, host) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
72
|
+
const urlParsed = new URL(url);
|
|
73
|
+
urlParsed.hostname = host;
|
|
74
|
+
return urlParsed.toString();
|
|
88
75
|
}
|
|
89
|
-
/**
|
|
90
|
-
* Gets URL path from an URL string.
|
|
91
|
-
*
|
|
92
|
-
* @param url - Source URL string
|
|
93
|
-
* @returns The path part of the given URL string.
|
|
94
|
-
*/
|
|
95
76
|
function getURLPath(url) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
77
|
+
try {
|
|
78
|
+
const urlParsed = new URL(url);
|
|
79
|
+
return urlParsed.pathname;
|
|
80
|
+
} catch (e) {
|
|
81
|
+
return void 0;
|
|
82
|
+
}
|
|
103
83
|
}
|
|
104
|
-
/**
|
|
105
|
-
* Gets URL query key value pairs from an URL string.
|
|
106
|
-
*
|
|
107
|
-
* @param url -
|
|
108
|
-
* @returns query key value string pairs from the given URL string.
|
|
109
|
-
*/
|
|
110
84
|
function getURLQueries(url) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
85
|
+
let queryString = new URL(url).search;
|
|
86
|
+
if (!queryString) {
|
|
87
|
+
return {};
|
|
88
|
+
}
|
|
89
|
+
queryString = queryString.trim();
|
|
90
|
+
queryString = queryString.startsWith("?") ? queryString.substring(1) : queryString;
|
|
91
|
+
let querySubStrings = queryString.split("&");
|
|
92
|
+
querySubStrings = querySubStrings.filter((value) => {
|
|
93
|
+
const indexOfEqual = value.indexOf("=");
|
|
94
|
+
const lastIndexOfEqual = value.lastIndexOf("=");
|
|
95
|
+
return indexOfEqual > 0 && indexOfEqual === lastIndexOfEqual && lastIndexOfEqual < value.length - 1;
|
|
96
|
+
});
|
|
97
|
+
const queries = {};
|
|
98
|
+
for (const querySubString of querySubStrings) {
|
|
99
|
+
const splitResults = querySubString.split("=");
|
|
100
|
+
const key = splitResults[0];
|
|
101
|
+
const value = splitResults[1];
|
|
102
|
+
queries[key] = value;
|
|
103
|
+
}
|
|
104
|
+
return queries;
|
|
131
105
|
}
|
|
132
106
|
function getProxyUriFromDevConnString(connectionString) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
if (element.trim().startsWith("DevelopmentStorageProxyUri=")) {
|
|
141
|
-
proxyUri = element.trim().match("DevelopmentStorageProxyUri=(.*)")[1];
|
|
142
|
-
}
|
|
143
|
-
}
|
|
107
|
+
let proxyUri = "";
|
|
108
|
+
if (connectionString.search("DevelopmentStorageProxyUri=") !== -1) {
|
|
109
|
+
const matchCredentials = connectionString.split(";");
|
|
110
|
+
for (const element of matchCredentials) {
|
|
111
|
+
if (element.trim().startsWith("DevelopmentStorageProxyUri=")) {
|
|
112
|
+
proxyUri = element.trim().match("DevelopmentStorageProxyUri=(.*)")[1];
|
|
113
|
+
}
|
|
144
114
|
}
|
|
145
|
-
|
|
115
|
+
}
|
|
116
|
+
return proxyUri;
|
|
146
117
|
}
|
|
147
|
-
/**
|
|
148
|
-
*
|
|
149
|
-
* @param connectionString - Account connection string.
|
|
150
|
-
* @param argument - property to get value from the connection string.
|
|
151
|
-
* @returns Value of the property specified in argument.
|
|
152
|
-
*/
|
|
153
118
|
function getValueInConnString(connectionString, argument) {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
119
|
+
const elements = connectionString.split(";");
|
|
120
|
+
for (const element of elements) {
|
|
121
|
+
if (element.trim().startsWith(argument)) {
|
|
122
|
+
return element.trim().match(argument + "=(.*)")[1];
|
|
159
123
|
}
|
|
160
|
-
|
|
124
|
+
}
|
|
125
|
+
return "";
|
|
161
126
|
}
|
|
162
|
-
/**
|
|
163
|
-
* Extracts the parts of an Azure Storage account connection string.
|
|
164
|
-
*
|
|
165
|
-
* @param connectionString - Connection string.
|
|
166
|
-
* @returns String key value pairs of the storage account's url and credentials.
|
|
167
|
-
*/
|
|
168
127
|
function extractConnectionStringParts(connectionString) {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
128
|
+
let proxyUri = "";
|
|
129
|
+
if (connectionString.startsWith("UseDevelopmentStorage=true")) {
|
|
130
|
+
proxyUri = getProxyUriFromDevConnString(connectionString);
|
|
131
|
+
connectionString = import_constants.DevelopmentConnectionString;
|
|
132
|
+
}
|
|
133
|
+
let queueEndpoint = getValueInConnString(connectionString, "QueueEndpoint");
|
|
134
|
+
queueEndpoint = queueEndpoint.endsWith("/") ? queueEndpoint.slice(0, -1) : queueEndpoint;
|
|
135
|
+
if (connectionString.search("DefaultEndpointsProtocol=") !== -1 && connectionString.search("AccountKey=") !== -1) {
|
|
136
|
+
let defaultEndpointsProtocol = "";
|
|
137
|
+
let accountName = "";
|
|
138
|
+
let accountKey = Buffer.from("accountKey", "base64");
|
|
139
|
+
let endpointSuffix = "";
|
|
140
|
+
accountName = getValueInConnString(connectionString, "AccountName");
|
|
141
|
+
accountKey = Buffer.from(getValueInConnString(connectionString, "AccountKey"), "base64");
|
|
142
|
+
if (!queueEndpoint) {
|
|
143
|
+
defaultEndpointsProtocol = getValueInConnString(connectionString, "DefaultEndpointsProtocol");
|
|
144
|
+
const protocol = defaultEndpointsProtocol.toLowerCase();
|
|
145
|
+
if (protocol !== "https" && protocol !== "http") {
|
|
146
|
+
throw new Error(
|
|
147
|
+
"Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'"
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
endpointSuffix = getValueInConnString(connectionString, "EndpointSuffix");
|
|
151
|
+
if (!endpointSuffix) {
|
|
152
|
+
throw new Error("Invalid EndpointSuffix in the provided Connection String");
|
|
153
|
+
}
|
|
154
|
+
queueEndpoint = `${defaultEndpointsProtocol}://${accountName}.queue.${endpointSuffix}`;
|
|
155
|
+
}
|
|
156
|
+
if (!accountName) {
|
|
157
|
+
throw new Error("Invalid AccountName in the provided Connection String");
|
|
158
|
+
} else if (accountKey.length === 0) {
|
|
159
|
+
throw new Error("Invalid AccountKey in the provided Connection String");
|
|
174
160
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
// Get account name and key
|
|
188
|
-
accountName = getValueInConnString(connectionString, "AccountName");
|
|
189
|
-
accountKey = Buffer.from(getValueInConnString(connectionString, "AccountKey"), "base64");
|
|
190
|
-
if (!queueEndpoint) {
|
|
191
|
-
// QueueEndpoint is not present in the Account connection string
|
|
192
|
-
// Can be obtained from `${defaultEndpointsProtocol}://${accountName}.queue.${endpointSuffix}`
|
|
193
|
-
defaultEndpointsProtocol = getValueInConnString(connectionString, "DefaultEndpointsProtocol");
|
|
194
|
-
const protocol = defaultEndpointsProtocol.toLowerCase();
|
|
195
|
-
if (protocol !== "https" && protocol !== "http") {
|
|
196
|
-
throw new Error("Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'");
|
|
197
|
-
}
|
|
198
|
-
endpointSuffix = getValueInConnString(connectionString, "EndpointSuffix");
|
|
199
|
-
if (!endpointSuffix) {
|
|
200
|
-
throw new Error("Invalid EndpointSuffix in the provided Connection String");
|
|
201
|
-
}
|
|
202
|
-
queueEndpoint = `${defaultEndpointsProtocol}://${accountName}.queue.${endpointSuffix}`;
|
|
203
|
-
}
|
|
204
|
-
if (!accountName) {
|
|
205
|
-
throw new Error("Invalid AccountName in the provided Connection String");
|
|
206
|
-
}
|
|
207
|
-
else if (accountKey.length === 0) {
|
|
208
|
-
throw new Error("Invalid AccountKey in the provided Connection String");
|
|
209
|
-
}
|
|
210
|
-
return {
|
|
211
|
-
kind: "AccountConnString",
|
|
212
|
-
url: queueEndpoint,
|
|
213
|
-
accountName,
|
|
214
|
-
accountKey,
|
|
215
|
-
proxyUri,
|
|
216
|
-
};
|
|
161
|
+
return {
|
|
162
|
+
kind: "AccountConnString",
|
|
163
|
+
url: queueEndpoint,
|
|
164
|
+
accountName,
|
|
165
|
+
accountKey,
|
|
166
|
+
proxyUri
|
|
167
|
+
};
|
|
168
|
+
} else {
|
|
169
|
+
const accountSas = getValueInConnString(connectionString, "SharedAccessSignature");
|
|
170
|
+
let accountName = getValueInConnString(connectionString, "AccountName");
|
|
171
|
+
if (!accountName) {
|
|
172
|
+
accountName = getAccountNameFromUrl(queueEndpoint);
|
|
217
173
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
// if accountName is empty, try to read it from BlobEndpoint
|
|
223
|
-
if (!accountName) {
|
|
224
|
-
accountName = getAccountNameFromUrl(queueEndpoint);
|
|
225
|
-
}
|
|
226
|
-
if (!queueEndpoint) {
|
|
227
|
-
throw new Error("Invalid QueueEndpoint in the provided SAS Connection String");
|
|
228
|
-
}
|
|
229
|
-
else if (!accountSas) {
|
|
230
|
-
throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String");
|
|
231
|
-
}
|
|
232
|
-
return { kind: "SASConnString", url: queueEndpoint, accountName, accountSas };
|
|
174
|
+
if (!queueEndpoint) {
|
|
175
|
+
throw new Error("Invalid QueueEndpoint in the provided SAS Connection String");
|
|
176
|
+
} else if (!accountSas) {
|
|
177
|
+
throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String");
|
|
233
178
|
}
|
|
179
|
+
return { kind: "SASConnString", url: queueEndpoint, accountName, accountSas };
|
|
180
|
+
}
|
|
234
181
|
}
|
|
235
|
-
/**
|
|
236
|
-
* Rounds a date off to seconds.
|
|
237
|
-
*
|
|
238
|
-
* @param date -
|
|
239
|
-
* @param withMilliseconds - If true, YYYY-MM-DDThh:mm:ss.fffffffZ will be returned;
|
|
240
|
-
* If false, YYYY-MM-DDThh:mm:ssZ will be returned.
|
|
241
|
-
* @returns Date string in ISO8061 format, with or without 7 milliseconds component
|
|
242
|
-
*/
|
|
243
182
|
function truncatedISO8061Date(date, withMilliseconds = true) {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
return withMilliseconds
|
|
247
|
-
? dateString.substring(0, dateString.length - 1) + "0000" + "Z"
|
|
248
|
-
: dateString.substring(0, dateString.length - 5) + "Z";
|
|
183
|
+
const dateString = date.toISOString();
|
|
184
|
+
return withMilliseconds ? dateString.substring(0, dateString.length - 1) + "0000Z" : dateString.substring(0, dateString.length - 5) + "Z";
|
|
249
185
|
}
|
|
250
|
-
/**
|
|
251
|
-
* Delay specified time interval.
|
|
252
|
-
*
|
|
253
|
-
* @param timeInMs -
|
|
254
|
-
* @param aborter -
|
|
255
|
-
* @param abortError -
|
|
256
|
-
*/
|
|
257
186
|
async function delay(timeInMs, aborter, abortError) {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
});
|
|
187
|
+
return new Promise((resolve, reject) => {
|
|
188
|
+
let timeout;
|
|
189
|
+
const abortHandler = () => {
|
|
190
|
+
if (timeout !== void 0) {
|
|
191
|
+
clearTimeout(timeout);
|
|
192
|
+
}
|
|
193
|
+
reject(abortError);
|
|
194
|
+
};
|
|
195
|
+
const resolveHandler = () => {
|
|
196
|
+
if (aborter !== void 0) {
|
|
197
|
+
aborter.removeEventListener("abort", abortHandler);
|
|
198
|
+
}
|
|
199
|
+
resolve();
|
|
200
|
+
};
|
|
201
|
+
timeout = setTimeout(resolveHandler, timeInMs);
|
|
202
|
+
if (aborter !== void 0) {
|
|
203
|
+
aborter.addEventListener("abort", abortHandler);
|
|
204
|
+
}
|
|
205
|
+
});
|
|
278
206
|
}
|
|
279
|
-
/**
|
|
280
|
-
* Sanitizes a url by removing the Signature parameter
|
|
281
|
-
* @param url - to sanitize
|
|
282
|
-
* @returns sanitized string
|
|
283
|
-
*/
|
|
284
207
|
function sanitizeURL(url) {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
208
|
+
let safeURL = url;
|
|
209
|
+
if (getURLParameter(safeURL, import_constants.URLConstants.Parameters.SIGNATURE)) {
|
|
210
|
+
safeURL = setURLParameter(safeURL, import_constants.URLConstants.Parameters.SIGNATURE, "*****");
|
|
211
|
+
}
|
|
212
|
+
return safeURL;
|
|
290
213
|
}
|
|
291
|
-
/**
|
|
292
|
-
* Sanitize headers by removing sensitive values such as AUTHORIZATION and X_MS_COPY_SOURCE
|
|
293
|
-
* @param originalHeader - original headers
|
|
294
|
-
* @returns sanitized headers
|
|
295
|
-
*/
|
|
296
214
|
function sanitizeHeaders(originalHeader) {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
else {
|
|
306
|
-
headers.set(name, value);
|
|
307
|
-
}
|
|
215
|
+
const headers = (0, import_core_rest_pipeline.createHttpHeaders)();
|
|
216
|
+
for (const [name, value] of originalHeader) {
|
|
217
|
+
if (name.toLowerCase() === import_constants.HeaderConstants.AUTHORIZATION) {
|
|
218
|
+
headers.set(name, "*****");
|
|
219
|
+
} else if (name.toLowerCase() === import_constants.HeaderConstants.X_MS_COPY_SOURCE) {
|
|
220
|
+
headers.set(name, sanitizeURL(value));
|
|
221
|
+
} else {
|
|
222
|
+
headers.set(name, value);
|
|
308
223
|
}
|
|
309
|
-
|
|
224
|
+
}
|
|
225
|
+
return headers;
|
|
310
226
|
}
|
|
311
|
-
/**
|
|
312
|
-
* Extracts account name from the url
|
|
313
|
-
* @param url - url to extract the account name from
|
|
314
|
-
* @returns with the account name
|
|
315
|
-
*/
|
|
316
227
|
function getAccountNameFromUrl(url) {
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
// Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/
|
|
327
|
-
// .getPath() -> /devstoreaccount1/
|
|
328
|
-
accountName = parsedUrl.pathname.split("/")[1];
|
|
329
|
-
}
|
|
330
|
-
else {
|
|
331
|
-
// Custom domain case: "https://customdomain.com/containername/blob".
|
|
332
|
-
accountName = "";
|
|
333
|
-
}
|
|
334
|
-
return accountName;
|
|
335
|
-
}
|
|
336
|
-
catch (error) {
|
|
337
|
-
throw new Error("Unable to extract accountName with provided information.");
|
|
228
|
+
const parsedUrl = new URL(url);
|
|
229
|
+
let accountName;
|
|
230
|
+
try {
|
|
231
|
+
if (parsedUrl.hostname.split(".")[1] === "queue") {
|
|
232
|
+
accountName = parsedUrl.hostname.split(".")[0];
|
|
233
|
+
} else if (isIpEndpointStyle(parsedUrl)) {
|
|
234
|
+
accountName = parsedUrl.pathname.split("/")[1];
|
|
235
|
+
} else {
|
|
236
|
+
accountName = "";
|
|
338
237
|
}
|
|
238
|
+
return accountName;
|
|
239
|
+
} catch (error) {
|
|
240
|
+
throw new Error("Unable to extract accountName with provided information.");
|
|
241
|
+
}
|
|
339
242
|
}
|
|
340
243
|
function isIpEndpointStyle(parsedUrl) {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
// For valid host please refer to https://man7.org/linux/man-pages/man7/hostname.7.html.
|
|
346
|
-
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) ||
|
|
347
|
-
(Boolean(parsedUrl.port) && constants_js_1.PathStylePorts.includes(parsedUrl.port)));
|
|
244
|
+
const host = parsedUrl.host;
|
|
245
|
+
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(
|
|
246
|
+
host
|
|
247
|
+
) || Boolean(parsedUrl.port) && import_constants.PathStylePorts.includes(parsedUrl.port);
|
|
348
248
|
}
|
|
349
|
-
/**
|
|
350
|
-
* Append a string to URL query.
|
|
351
|
-
*
|
|
352
|
-
* @param url - Source URL string.
|
|
353
|
-
* @param queryParts - String to be appended to the URL query.
|
|
354
|
-
* @returns An updated URL string.
|
|
355
|
-
*/
|
|
356
249
|
function appendToURLQuery(url, queryParts) {
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
return urlParsed.toString();
|
|
250
|
+
const urlParsed = new URL(url);
|
|
251
|
+
let query = urlParsed.search;
|
|
252
|
+
if (query) {
|
|
253
|
+
query += "&" + queryParts;
|
|
254
|
+
} else {
|
|
255
|
+
query = queryParts;
|
|
256
|
+
}
|
|
257
|
+
urlParsed.search = query;
|
|
258
|
+
return urlParsed.toString();
|
|
367
259
|
}
|
|
368
|
-
/**
|
|
369
|
-
* A typesafe helper for ensuring that a given response object has
|
|
370
|
-
* the original _response attached.
|
|
371
|
-
* @param response - A response object from calling a client operation
|
|
372
|
-
* @returns The same object, but with known _response property
|
|
373
|
-
*/
|
|
374
260
|
function assertResponse(response) {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
261
|
+
if (`_response` in response) {
|
|
262
|
+
return response;
|
|
263
|
+
}
|
|
264
|
+
throw new TypeError(`Unexpected response object ${response}`);
|
|
379
265
|
}
|
|
380
|
-
|
|
266
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
267
|
+
0 && (module.exports = {
|
|
268
|
+
appendToURLPath,
|
|
269
|
+
appendToURLQuery,
|
|
270
|
+
assertResponse,
|
|
271
|
+
delay,
|
|
272
|
+
extractConnectionStringParts,
|
|
273
|
+
getAccountNameFromUrl,
|
|
274
|
+
getURLParameter,
|
|
275
|
+
getURLPath,
|
|
276
|
+
getURLQueries,
|
|
277
|
+
getValueInConnString,
|
|
278
|
+
isIpEndpointStyle,
|
|
279
|
+
sanitizeHeaders,
|
|
280
|
+
sanitizeURL,
|
|
281
|
+
setURLHost,
|
|
282
|
+
setURLParameter,
|
|
283
|
+
truncatedISO8061Date
|
|
284
|
+
});
|