@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,487 +1,547 @@
|
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
constructor(url, credentialOrPipeline,
|
|
68
|
-
// Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
|
|
69
|
-
/* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */
|
|
70
|
-
options) {
|
|
71
|
-
let pipeline;
|
|
72
|
-
if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) {
|
|
73
|
-
pipeline = credentialOrPipeline;
|
|
74
|
-
}
|
|
75
|
-
else if ((core_util_1.isNodeLike && credentialOrPipeline instanceof storage_common_1.StorageSharedKeyCredential) ||
|
|
76
|
-
credentialOrPipeline instanceof storage_common_2.AnonymousCredential ||
|
|
77
|
-
(0, core_auth_1.isTokenCredential)(credentialOrPipeline)) {
|
|
78
|
-
pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options);
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
// The second parameter is undefined. Use anonymous credential.
|
|
82
|
-
pipeline = (0, Pipeline_js_1.newPipeline)(new storage_common_2.AnonymousCredential(), options);
|
|
83
|
-
}
|
|
84
|
-
super(url, pipeline);
|
|
85
|
-
this.serviceContext = this.storageClientContext.service;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Creates a {@link QueueClient} object.
|
|
89
|
-
*
|
|
90
|
-
* @param queueName -
|
|
91
|
-
* @returns a new QueueClient
|
|
92
|
-
*
|
|
93
|
-
* Example usage:
|
|
94
|
-
*
|
|
95
|
-
* ```ts snippet:ReadmeSampleCreateQueue
|
|
96
|
-
* import { QueueServiceClient } from "@azure/storage-queue";
|
|
97
|
-
* import { DefaultAzureCredential } from "@azure/identity";
|
|
98
|
-
*
|
|
99
|
-
* const account = "<account>";
|
|
100
|
-
* const queueServiceClient = new QueueServiceClient(
|
|
101
|
-
* `https://${account}.queue.core.windows.net`,
|
|
102
|
-
* new DefaultAzureCredential(),
|
|
103
|
-
* );
|
|
104
|
-
*
|
|
105
|
-
* const queueName = "<valid queue name>";
|
|
106
|
-
* const queueClient = queueServiceClient.getQueueClient(queueName);
|
|
107
|
-
* const createQueueResponse = await queueClient.create();
|
|
108
|
-
* console.log(
|
|
109
|
-
* `Created queue ${queueName} successfully, service assigned request Id: ${createQueueResponse.requestId}`,
|
|
110
|
-
* );
|
|
111
|
-
* ```
|
|
112
|
-
*/
|
|
113
|
-
getQueueClient(queueName) {
|
|
114
|
-
return new QueueClient_js_1.QueueClient((0, utils_common_js_1.appendToURLPath)(this.url, queueName), this.pipeline);
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Returns a list of the queues under the specified account.
|
|
118
|
-
* @see https://learn.microsoft.com/rest/api/storageservices/list-queues1
|
|
119
|
-
*
|
|
120
|
-
* @param marker - A string value that identifies the portion of
|
|
121
|
-
* the list of queues to be returned with the next listing operation. The
|
|
122
|
-
* operation returns the continuationToken value within the response body if the
|
|
123
|
-
* listing operation did not return all queues remaining to be listed
|
|
124
|
-
* with the current page. The continuationToken value can be used as the value for
|
|
125
|
-
* the marker parameter in a subsequent call to request the next page of list
|
|
126
|
-
* items. The marker value is opaque to the client.
|
|
127
|
-
* @param options - Options to list queues operation.
|
|
128
|
-
* @returns Response data for the list queues segment operation.
|
|
129
|
-
*/
|
|
130
|
-
async listQueuesSegment(marker, options = {}) {
|
|
131
|
-
if (options.prefix === "") {
|
|
132
|
-
options.prefix = undefined;
|
|
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 QueueServiceClient_exports = {};
|
|
19
|
+
__export(QueueServiceClient_exports, {
|
|
20
|
+
QueueServiceClient: () => QueueServiceClient
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(QueueServiceClient_exports);
|
|
23
|
+
var import_core_auth = require("@azure/core-auth");
|
|
24
|
+
var import_core_util = require("@azure/core-util");
|
|
25
|
+
var import_Pipeline = require("./Pipeline.js");
|
|
26
|
+
var import_StorageClient = require("./StorageClient.js");
|
|
27
|
+
var import_utils_common = require("./utils/utils.common.js");
|
|
28
|
+
var import_storage_common = require("@azure/storage-common");
|
|
29
|
+
var import_storage_common2 = require("@azure/storage-common");
|
|
30
|
+
var import_tracing = require("./utils/tracing.js");
|
|
31
|
+
var import_QueueClient = require("./QueueClient.js");
|
|
32
|
+
var import_AccountSASPermissions = require("./AccountSASPermissions.js");
|
|
33
|
+
var import_AccountSASSignatureValues = require("./AccountSASSignatureValues.js");
|
|
34
|
+
var import_AccountSASServices = require("./AccountSASServices.js");
|
|
35
|
+
var import_core_rest_pipeline = require("@azure/core-rest-pipeline");
|
|
36
|
+
function isQueueGetUserDelegationKeyParameters(parameter) {
|
|
37
|
+
if (!parameter || typeof parameter !== "object") {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
const castParameter = parameter;
|
|
41
|
+
return castParameter.expiresOn instanceof Date;
|
|
42
|
+
}
|
|
43
|
+
class QueueServiceClient extends import_StorageClient.StorageClient {
|
|
44
|
+
/**
|
|
45
|
+
* Creates an instance of QueueServiceClient.
|
|
46
|
+
*
|
|
47
|
+
* @param connectionString - Account connection string or a SAS connection string of an Azure storage account.
|
|
48
|
+
* [ Note - Account connection string can only be used in NODE.JS runtime. ]
|
|
49
|
+
* Account connection string example -
|
|
50
|
+
* `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`
|
|
51
|
+
* SAS connection string example -
|
|
52
|
+
* `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString`
|
|
53
|
+
* @param options - Options to configure the HTTP pipeline.
|
|
54
|
+
* @returns A new QueueServiceClient object from the given connection string.
|
|
55
|
+
*/
|
|
56
|
+
static fromConnectionString(connectionString, options) {
|
|
57
|
+
options = options || {};
|
|
58
|
+
const extractedCreds = (0, import_utils_common.extractConnectionStringParts)(connectionString);
|
|
59
|
+
if (extractedCreds.kind === "AccountConnString") {
|
|
60
|
+
if (import_core_util.isNodeLike) {
|
|
61
|
+
const sharedKeyCredential = new import_storage_common.StorageSharedKeyCredential(
|
|
62
|
+
extractedCreds.accountName,
|
|
63
|
+
extractedCreds.accountKey
|
|
64
|
+
);
|
|
65
|
+
if (!options.proxyOptions) {
|
|
66
|
+
options.proxyOptions = (0, import_core_rest_pipeline.getDefaultProxySettings)(extractedCreds.proxyUri);
|
|
133
67
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
68
|
+
const pipeline = (0, import_Pipeline.newPipeline)(sharedKeyCredential, options);
|
|
69
|
+
return new QueueServiceClient(extractedCreds.url, pipeline);
|
|
70
|
+
} else {
|
|
71
|
+
throw new Error("Account connection string is only supported in Node.js environment");
|
|
72
|
+
}
|
|
73
|
+
} else if (extractedCreds.kind === "SASConnString") {
|
|
74
|
+
const pipeline = (0, import_Pipeline.newPipeline)(new import_storage_common2.AnonymousCredential(), options);
|
|
75
|
+
return new QueueServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline);
|
|
76
|
+
} else {
|
|
77
|
+
throw new Error(
|
|
78
|
+
"Connection string must be either an Account connection string or a SAS connection string"
|
|
79
|
+
);
|
|
141
80
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
if (options.prefix === "") {
|
|
156
|
-
options.prefix = undefined;
|
|
157
|
-
}
|
|
158
|
-
let listQueuesResponse;
|
|
159
|
-
do {
|
|
160
|
-
listQueuesResponse = await this.listQueuesSegment(marker, options);
|
|
161
|
-
marker = listQueuesResponse.continuationToken;
|
|
162
|
-
yield await listQueuesResponse;
|
|
163
|
-
} while (marker);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* serviceContext provided by protocol layer.
|
|
84
|
+
*/
|
|
85
|
+
serviceContext;
|
|
86
|
+
constructor(url, credentialOrPipeline, options) {
|
|
87
|
+
let pipeline;
|
|
88
|
+
if ((0, import_Pipeline.isPipelineLike)(credentialOrPipeline)) {
|
|
89
|
+
pipeline = credentialOrPipeline;
|
|
90
|
+
} else if (import_core_util.isNodeLike && credentialOrPipeline instanceof import_storage_common.StorageSharedKeyCredential || credentialOrPipeline instanceof import_storage_common2.AnonymousCredential || (0, import_core_auth.isTokenCredential)(credentialOrPipeline)) {
|
|
91
|
+
pipeline = (0, import_Pipeline.newPipeline)(credentialOrPipeline, options);
|
|
92
|
+
} else {
|
|
93
|
+
pipeline = (0, import_Pipeline.newPipeline)(new import_storage_common2.AnonymousCredential(), options);
|
|
164
94
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
95
|
+
super(url, pipeline);
|
|
96
|
+
this.serviceContext = this.storageClientContext.service;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Creates a {@link QueueClient} object.
|
|
100
|
+
*
|
|
101
|
+
* @param queueName -
|
|
102
|
+
* @returns a new QueueClient
|
|
103
|
+
*
|
|
104
|
+
* Example usage:
|
|
105
|
+
*
|
|
106
|
+
* ```ts snippet:ReadmeSampleCreateQueue
|
|
107
|
+
* import { QueueServiceClient } from "@azure/storage-queue";
|
|
108
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
109
|
+
*
|
|
110
|
+
* const account = "<account>";
|
|
111
|
+
* const queueServiceClient = new QueueServiceClient(
|
|
112
|
+
* `https://${account}.queue.core.windows.net`,
|
|
113
|
+
* new DefaultAzureCredential(),
|
|
114
|
+
* );
|
|
115
|
+
*
|
|
116
|
+
* const queueName = "<valid queue name>";
|
|
117
|
+
* const queueClient = queueServiceClient.getQueueClient(queueName);
|
|
118
|
+
* const createQueueResponse = await queueClient.create();
|
|
119
|
+
* console.log(
|
|
120
|
+
* `Created queue ${queueName} successfully, service assigned request Id: ${createQueueResponse.requestId}`,
|
|
121
|
+
* );
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
getQueueClient(queueName) {
|
|
125
|
+
return new import_QueueClient.QueueClient((0, import_utils_common.appendToURLPath)(this.url, queueName), this.pipeline);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Returns a list of the queues under the specified account.
|
|
129
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/list-queues1
|
|
130
|
+
*
|
|
131
|
+
* @param marker - A string value that identifies the portion of
|
|
132
|
+
* the list of queues to be returned with the next listing operation. The
|
|
133
|
+
* operation returns the continuationToken value within the response body if the
|
|
134
|
+
* listing operation did not return all queues remaining to be listed
|
|
135
|
+
* with the current page. The continuationToken value can be used as the value for
|
|
136
|
+
* the marker parameter in a subsequent call to request the next page of list
|
|
137
|
+
* items. The marker value is opaque to the client.
|
|
138
|
+
* @param options - Options to list queues operation.
|
|
139
|
+
* @returns Response data for the list queues segment operation.
|
|
140
|
+
*/
|
|
141
|
+
async listQueuesSegment(marker, options = {}) {
|
|
142
|
+
if (options.prefix === "") {
|
|
143
|
+
options.prefix = void 0;
|
|
180
144
|
}
|
|
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
|
-
* const account = "<account>";
|
|
212
|
-
* const queueServiceClient = new QueueServiceClient(
|
|
213
|
-
* `https://${account}.queue.core.windows.net`,
|
|
214
|
-
* new DefaultAzureCredential(),
|
|
215
|
-
* );
|
|
216
|
-
*
|
|
217
|
-
* let i = 1;
|
|
218
|
-
* const iterator = queueServiceClient.listQueues();
|
|
219
|
-
* let { done, value } = await iterator.next();
|
|
220
|
-
* while (!done) {
|
|
221
|
-
* console.log(`Queue${i++}: ${value.name}`);
|
|
222
|
-
* ({ done, value } = await iterator.next());
|
|
223
|
-
* }
|
|
224
|
-
* ```
|
|
225
|
-
*
|
|
226
|
-
* Example using `byPage()`:
|
|
227
|
-
*
|
|
228
|
-
* ```ts snippet:ReadmeSampleListQueues_ByPage
|
|
229
|
-
* import { QueueServiceClient } from "@azure/storage-queue";
|
|
230
|
-
* import { DefaultAzureCredential } from "@azure/identity";
|
|
231
|
-
*
|
|
232
|
-
* const account = "<account>";
|
|
233
|
-
* const queueServiceClient = new QueueServiceClient(
|
|
234
|
-
* `https://${account}.queue.core.windows.net`,
|
|
235
|
-
* new DefaultAzureCredential(),
|
|
236
|
-
* );
|
|
237
|
-
*
|
|
238
|
-
* let i = 1;
|
|
239
|
-
* for await (const page of queueServiceClient.listQueues().byPage({ maxPageSize: 20 })) {
|
|
240
|
-
* for (const item of page.queueItems || []) {
|
|
241
|
-
* console.log(`Queue${i++}: ${item.name}`);
|
|
242
|
-
* }
|
|
243
|
-
* }
|
|
244
|
-
* ```
|
|
245
|
-
*
|
|
246
|
-
* Example using paging with a marker:
|
|
247
|
-
*
|
|
248
|
-
* ```ts snippet:ReadmeSampleListQueues_Continuation
|
|
249
|
-
* import { QueueServiceClient } from "@azure/storage-queue";
|
|
250
|
-
* import { DefaultAzureCredential } from "@azure/identity";
|
|
251
|
-
*
|
|
252
|
-
* const account = "<account>";
|
|
253
|
-
* const queueServiceClient = new QueueServiceClient(
|
|
254
|
-
* `https://${account}.queue.core.windows.net`,
|
|
255
|
-
* new DefaultAzureCredential(),
|
|
256
|
-
* );
|
|
257
|
-
*
|
|
258
|
-
* let i = 1;
|
|
259
|
-
* let iterator = queueServiceClient.listQueues().byPage({ maxPageSize: 2 });
|
|
260
|
-
* let response = (await iterator.next()).value;
|
|
261
|
-
* // Prints 2 queues
|
|
262
|
-
* if (response.queueItems) {
|
|
263
|
-
* for (const item of response.queueItems) {
|
|
264
|
-
* console.log(`Queue${i++}: ${item.name}`);
|
|
265
|
-
* }
|
|
266
|
-
* }
|
|
267
|
-
* // Gets next marker
|
|
268
|
-
* let marker = response.continuationToken;
|
|
269
|
-
* // Passing next marker as continuationToken
|
|
270
|
-
* iterator = queueServiceClient.listQueues().byPage({ continuationToken: marker, maxPageSize: 10 });
|
|
271
|
-
* response = (await iterator.next()).value;
|
|
272
|
-
* // Prints 10 queues
|
|
273
|
-
* if (response.queueItems) {
|
|
274
|
-
* for (const item of response.queueItems) {
|
|
275
|
-
* console.log(`Queue${i++}: ${item.name}`);
|
|
276
|
-
* }
|
|
277
|
-
* }
|
|
278
|
-
* ```
|
|
279
|
-
*
|
|
280
|
-
* @param options - Options to list queues operation.
|
|
281
|
-
* @returns An asyncIterableIterator that supports paging.
|
|
282
|
-
*/
|
|
283
|
-
listQueues(options = {}) {
|
|
284
|
-
if (options.prefix === "") {
|
|
285
|
-
options.prefix = undefined;
|
|
286
|
-
}
|
|
287
|
-
const updatedOptions = {
|
|
288
|
-
...options,
|
|
289
|
-
...(options.includeMetadata ? { include: "metadata" } : {}),
|
|
290
|
-
};
|
|
291
|
-
// AsyncIterableIterator to iterate over queues
|
|
292
|
-
const iter = this.listItems(updatedOptions);
|
|
293
|
-
return {
|
|
294
|
-
/**
|
|
295
|
-
* The next method, part of the iteration protocol
|
|
296
|
-
*/
|
|
297
|
-
next() {
|
|
298
|
-
return iter.next();
|
|
299
|
-
},
|
|
300
|
-
/**
|
|
301
|
-
* The connection to the async iterator, part of the iteration protocol
|
|
302
|
-
*/
|
|
303
|
-
[Symbol.asyncIterator]() {
|
|
304
|
-
return this;
|
|
305
|
-
},
|
|
306
|
-
/**
|
|
307
|
-
* Return an AsyncIterableIterator that works a page at a time
|
|
308
|
-
*/
|
|
309
|
-
byPage: (settings = {}) => {
|
|
310
|
-
return this.listSegments(settings.continuationToken, {
|
|
311
|
-
maxPageSize: settings.maxPageSize,
|
|
312
|
-
...updatedOptions,
|
|
313
|
-
});
|
|
314
|
-
},
|
|
315
|
-
};
|
|
145
|
+
return import_tracing.tracingClient.withSpan(
|
|
146
|
+
"QueueServiceClient-listQueuesSegment",
|
|
147
|
+
options,
|
|
148
|
+
async (updatedOptions) => {
|
|
149
|
+
return (0, import_utils_common.assertResponse)(
|
|
150
|
+
await this.serviceContext.listQueuesSegment({
|
|
151
|
+
...updatedOptions,
|
|
152
|
+
marker,
|
|
153
|
+
include: options.include === void 0 ? void 0 : [options.include]
|
|
154
|
+
})
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Returns an AsyncIterableIterator for {@link ServiceListQueuesSegmentResponse} objects
|
|
161
|
+
*
|
|
162
|
+
* @param marker - A string value that identifies the portion of
|
|
163
|
+
* the list of queues to be returned with the next listing operation. The
|
|
164
|
+
* operation returns the continuationToken value within the response body if the
|
|
165
|
+
* listing operation did not return all queues remaining to be listed
|
|
166
|
+
* with the current page. The continuationToken value can be used as the value for
|
|
167
|
+
* the marker parameter in a subsequent call to request the next page of list
|
|
168
|
+
* items. The marker value is opaque to the client.
|
|
169
|
+
* @param options - Options to list queues operation.
|
|
170
|
+
*/
|
|
171
|
+
async *listSegments(marker, options = {}) {
|
|
172
|
+
if (options.prefix === "") {
|
|
173
|
+
options.prefix = void 0;
|
|
316
174
|
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
175
|
+
let listQueuesResponse;
|
|
176
|
+
do {
|
|
177
|
+
listQueuesResponse = await this.listQueuesSegment(marker, options);
|
|
178
|
+
marker = listQueuesResponse.continuationToken;
|
|
179
|
+
yield await listQueuesResponse;
|
|
180
|
+
} while (marker);
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Returns an AsyncIterableIterator for {@link QueueItem} objects
|
|
184
|
+
*
|
|
185
|
+
* @param options - Options to list queues operation.
|
|
186
|
+
*/
|
|
187
|
+
async *listItems(options = {}) {
|
|
188
|
+
if (options.prefix === "") {
|
|
189
|
+
options.prefix = void 0;
|
|
329
190
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
* @param properties -
|
|
336
|
-
* @param options - Options to set properties operation.
|
|
337
|
-
* @returns Response data for the Set Properties operation.
|
|
338
|
-
*/
|
|
339
|
-
async setProperties(properties, options = {}) {
|
|
340
|
-
return tracing_js_1.tracingClient.withSpan("QueueServiceClient-setProperties", options, async (updatedOptions) => {
|
|
341
|
-
return (0, utils_common_js_1.assertResponse)(await this.serviceContext.setProperties(properties, updatedOptions));
|
|
342
|
-
});
|
|
191
|
+
let marker;
|
|
192
|
+
for await (const segment of this.listSegments(marker, options)) {
|
|
193
|
+
if (segment.queueItems) {
|
|
194
|
+
yield* segment.queueItems;
|
|
195
|
+
}
|
|
343
196
|
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Returns an async iterable iterator to list all the queues
|
|
200
|
+
* under the specified account.
|
|
201
|
+
*
|
|
202
|
+
* .byPage() returns an async iterable iterator to list the queues in pages.
|
|
203
|
+
*
|
|
204
|
+
* Example using `for await` syntax:
|
|
205
|
+
*
|
|
206
|
+
* ```ts snippet:ReadmeSampleListQueues
|
|
207
|
+
* import { QueueServiceClient } from "@azure/storage-queue";
|
|
208
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
209
|
+
*
|
|
210
|
+
* const account = "<account>";
|
|
211
|
+
* const queueServiceClient = new QueueServiceClient(
|
|
212
|
+
* `https://${account}.queue.core.windows.net`,
|
|
213
|
+
* new DefaultAzureCredential(),
|
|
214
|
+
* );
|
|
215
|
+
*
|
|
216
|
+
* let i = 1;
|
|
217
|
+
* for await (const item of queueServiceClient.listQueues()) {
|
|
218
|
+
* console.log(`Queue${i++}: ${item.name}`);
|
|
219
|
+
* }
|
|
220
|
+
* ```
|
|
221
|
+
*
|
|
222
|
+
* Example using `iter.next()`:
|
|
223
|
+
*
|
|
224
|
+
* ```ts snippet:ReadmeSampleListQueues_Iterator
|
|
225
|
+
* import { QueueServiceClient } from "@azure/storage-queue";
|
|
226
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
227
|
+
*
|
|
228
|
+
* const account = "<account>";
|
|
229
|
+
* const queueServiceClient = new QueueServiceClient(
|
|
230
|
+
* `https://${account}.queue.core.windows.net`,
|
|
231
|
+
* new DefaultAzureCredential(),
|
|
232
|
+
* );
|
|
233
|
+
*
|
|
234
|
+
* let i = 1;
|
|
235
|
+
* const iterator = queueServiceClient.listQueues();
|
|
236
|
+
* let { done, value } = await iterator.next();
|
|
237
|
+
* while (!done) {
|
|
238
|
+
* console.log(`Queue${i++}: ${value.name}`);
|
|
239
|
+
* ({ done, value } = await iterator.next());
|
|
240
|
+
* }
|
|
241
|
+
* ```
|
|
242
|
+
*
|
|
243
|
+
* Example using `byPage()`:
|
|
244
|
+
*
|
|
245
|
+
* ```ts snippet:ReadmeSampleListQueues_ByPage
|
|
246
|
+
* import { QueueServiceClient } from "@azure/storage-queue";
|
|
247
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
248
|
+
*
|
|
249
|
+
* const account = "<account>";
|
|
250
|
+
* const queueServiceClient = new QueueServiceClient(
|
|
251
|
+
* `https://${account}.queue.core.windows.net`,
|
|
252
|
+
* new DefaultAzureCredential(),
|
|
253
|
+
* );
|
|
254
|
+
*
|
|
255
|
+
* let i = 1;
|
|
256
|
+
* for await (const page of queueServiceClient.listQueues().byPage({ maxPageSize: 20 })) {
|
|
257
|
+
* for (const item of page.queueItems || []) {
|
|
258
|
+
* console.log(`Queue${i++}: ${item.name}`);
|
|
259
|
+
* }
|
|
260
|
+
* }
|
|
261
|
+
* ```
|
|
262
|
+
*
|
|
263
|
+
* Example using paging with a marker:
|
|
264
|
+
*
|
|
265
|
+
* ```ts snippet:ReadmeSampleListQueues_Continuation
|
|
266
|
+
* import { QueueServiceClient } from "@azure/storage-queue";
|
|
267
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
268
|
+
*
|
|
269
|
+
* const account = "<account>";
|
|
270
|
+
* const queueServiceClient = new QueueServiceClient(
|
|
271
|
+
* `https://${account}.queue.core.windows.net`,
|
|
272
|
+
* new DefaultAzureCredential(),
|
|
273
|
+
* );
|
|
274
|
+
*
|
|
275
|
+
* let i = 1;
|
|
276
|
+
* let iterator = queueServiceClient.listQueues().byPage({ maxPageSize: 2 });
|
|
277
|
+
* let response = (await iterator.next()).value;
|
|
278
|
+
* // Prints 2 queues
|
|
279
|
+
* if (response.queueItems) {
|
|
280
|
+
* for (const item of response.queueItems) {
|
|
281
|
+
* console.log(`Queue${i++}: ${item.name}`);
|
|
282
|
+
* }
|
|
283
|
+
* }
|
|
284
|
+
* // Gets next marker
|
|
285
|
+
* let marker = response.continuationToken;
|
|
286
|
+
* // Passing next marker as continuationToken
|
|
287
|
+
* iterator = queueServiceClient.listQueues().byPage({ continuationToken: marker, maxPageSize: 10 });
|
|
288
|
+
* response = (await iterator.next()).value;
|
|
289
|
+
* // Prints 10 queues
|
|
290
|
+
* if (response.queueItems) {
|
|
291
|
+
* for (const item of response.queueItems) {
|
|
292
|
+
* console.log(`Queue${i++}: ${item.name}`);
|
|
293
|
+
* }
|
|
294
|
+
* }
|
|
295
|
+
* ```
|
|
296
|
+
*
|
|
297
|
+
* @param options - Options to list queues operation.
|
|
298
|
+
* @returns An asyncIterableIterator that supports paging.
|
|
299
|
+
*/
|
|
300
|
+
listQueues(options = {}) {
|
|
301
|
+
if (options.prefix === "") {
|
|
302
|
+
options.prefix = void 0;
|
|
357
303
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
304
|
+
const updatedOptions = {
|
|
305
|
+
...options,
|
|
306
|
+
...options.includeMetadata ? { include: "metadata" } : {}
|
|
307
|
+
};
|
|
308
|
+
const iter = this.listItems(updatedOptions);
|
|
309
|
+
return {
|
|
310
|
+
/**
|
|
311
|
+
* The next method, part of the iteration protocol
|
|
312
|
+
*/
|
|
313
|
+
next() {
|
|
314
|
+
return iter.next();
|
|
315
|
+
},
|
|
316
|
+
/**
|
|
317
|
+
* The connection to the async iterator, part of the iteration protocol
|
|
318
|
+
*/
|
|
319
|
+
[Symbol.asyncIterator]() {
|
|
320
|
+
return this;
|
|
321
|
+
},
|
|
322
|
+
/**
|
|
323
|
+
* Return an AsyncIterableIterator that works a page at a time
|
|
324
|
+
*/
|
|
325
|
+
byPage: (settings = {}) => {
|
|
326
|
+
return this.listSegments(settings.continuationToken, {
|
|
327
|
+
maxPageSize: settings.maxPageSize,
|
|
328
|
+
...updatedOptions
|
|
369
329
|
});
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Gets the properties of a storage account’s Queue service, including properties
|
|
335
|
+
* for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
|
|
336
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-queue-service-properties
|
|
337
|
+
*
|
|
338
|
+
* @param options - Options to get properties operation.
|
|
339
|
+
* @returns Response data including the queue service properties.
|
|
340
|
+
*/
|
|
341
|
+
async getProperties(options = {}) {
|
|
342
|
+
return import_tracing.tracingClient.withSpan(
|
|
343
|
+
"QueueServiceClient-getProperties",
|
|
344
|
+
options,
|
|
345
|
+
async (updatedOptions) => {
|
|
346
|
+
return (0, import_utils_common.assertResponse)(await this.serviceContext.getProperties(updatedOptions));
|
|
347
|
+
}
|
|
348
|
+
);
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Sets properties for a storage account’s Queue service endpoint, including properties
|
|
352
|
+
* for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings.
|
|
353
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/set-queue-service-properties
|
|
354
|
+
*
|
|
355
|
+
* @param properties -
|
|
356
|
+
* @param options - Options to set properties operation.
|
|
357
|
+
* @returns Response data for the Set Properties operation.
|
|
358
|
+
*/
|
|
359
|
+
async setProperties(properties, options = {}) {
|
|
360
|
+
return import_tracing.tracingClient.withSpan(
|
|
361
|
+
"QueueServiceClient-setProperties",
|
|
362
|
+
options,
|
|
363
|
+
async (updatedOptions) => {
|
|
364
|
+
return (0, import_utils_common.assertResponse)(
|
|
365
|
+
await this.serviceContext.setProperties(properties, updatedOptions)
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Retrieves statistics related to replication for the Queue service. It is only
|
|
372
|
+
* available on the secondary location endpoint when read-access geo-redundant
|
|
373
|
+
* replication is enabled for the storage account.
|
|
374
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-queue-service-stats
|
|
375
|
+
*
|
|
376
|
+
* @param options - Options to get statistics operation.
|
|
377
|
+
* @returns Response data for get statistics the operation.
|
|
378
|
+
*/
|
|
379
|
+
async getStatistics(options = {}) {
|
|
380
|
+
return import_tracing.tracingClient.withSpan(
|
|
381
|
+
"QueueServiceClient-getStatistics",
|
|
382
|
+
options,
|
|
383
|
+
async (updatedOptions) => {
|
|
384
|
+
return (0, import_utils_common.assertResponse)(await this.serviceContext.getStatistics(updatedOptions));
|
|
385
|
+
}
|
|
386
|
+
);
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Creates a new queue under the specified account.
|
|
390
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/create-queue4
|
|
391
|
+
*
|
|
392
|
+
* @param queueName - name of the queue to create
|
|
393
|
+
* @param options - Options to Queue create operation.
|
|
394
|
+
* @returns Response data for the Queue create operation.
|
|
395
|
+
*/
|
|
396
|
+
async createQueue(queueName, options = {}) {
|
|
397
|
+
return import_tracing.tracingClient.withSpan(
|
|
398
|
+
"QueueServiceClient-createQueue",
|
|
399
|
+
options,
|
|
400
|
+
async (updatedOptions) => {
|
|
401
|
+
return this.getQueueClient(queueName).create(updatedOptions);
|
|
402
|
+
}
|
|
403
|
+
);
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Deletes the specified queue permanently.
|
|
407
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/delete-queue3
|
|
408
|
+
*
|
|
409
|
+
* @param queueName - name of the queue to delete.
|
|
410
|
+
* @param options - Options to Queue delete operation.
|
|
411
|
+
* @returns Response data for the Queue delete operation.
|
|
412
|
+
*/
|
|
413
|
+
async deleteQueue(queueName, options = {}) {
|
|
414
|
+
return import_tracing.tracingClient.withSpan(
|
|
415
|
+
"QueueServiceClient-deleteQueue",
|
|
416
|
+
options,
|
|
417
|
+
async (updatedOptions) => {
|
|
418
|
+
return this.getQueueClient(queueName).delete(updatedOptions);
|
|
419
|
+
}
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Only available for QueueServiceClient constructed with a shared key credential.
|
|
424
|
+
*
|
|
425
|
+
* Generates an account Shared Access Signature (SAS) URI based on the client properties
|
|
426
|
+
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
|
427
|
+
*
|
|
428
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas
|
|
429
|
+
*
|
|
430
|
+
* @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not specified.
|
|
431
|
+
* @param permissions - Specifies the list of permissions to be associated with the SAS.
|
|
432
|
+
* @param resourceTypes - Specifies the resource types associated with the shared access signature.
|
|
433
|
+
* @param options - Optional parameters.
|
|
434
|
+
* @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
435
|
+
*/
|
|
436
|
+
generateAccountSasUrl(expiresOn, permissions = import_AccountSASPermissions.AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) {
|
|
437
|
+
if (!(this.credential instanceof import_storage_common.StorageSharedKeyCredential)) {
|
|
438
|
+
throw RangeError(
|
|
439
|
+
"Can only generate the account SAS when the client is initialized with a shared key credential"
|
|
440
|
+
);
|
|
370
441
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
*
|
|
375
|
-
* @param queueName - name of the queue to delete.
|
|
376
|
-
* @param options - Options to Queue delete operation.
|
|
377
|
-
* @returns Response data for the Queue delete operation.
|
|
378
|
-
*/
|
|
379
|
-
async deleteQueue(queueName, options = {}) {
|
|
380
|
-
return tracing_js_1.tracingClient.withSpan("QueueServiceClient-deleteQueue", options, async (updatedOptions) => {
|
|
381
|
-
return this.getQueueClient(queueName).delete(updatedOptions);
|
|
382
|
-
});
|
|
442
|
+
if (expiresOn === void 0) {
|
|
443
|
+
const now = /* @__PURE__ */ new Date();
|
|
444
|
+
expiresOn = new Date(now.getTime() + 3600 * 1e3);
|
|
383
445
|
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
446
|
+
const sas = (0, import_AccountSASSignatureValues.generateAccountSASQueryParameters)(
|
|
447
|
+
{
|
|
448
|
+
permissions,
|
|
449
|
+
expiresOn,
|
|
450
|
+
resourceTypes,
|
|
451
|
+
services: import_AccountSASServices.AccountSASServices.parse("q").toString(),
|
|
452
|
+
...options
|
|
453
|
+
},
|
|
454
|
+
this.credential
|
|
455
|
+
).toString();
|
|
456
|
+
return (0, import_utils_common.appendToURLQuery)(this.url, sas);
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Only available for QueueServiceClient constructed with a shared key credential.
|
|
460
|
+
*
|
|
461
|
+
* Generates string to sign for an account Shared Access Signature (SAS) URI based on the client properties
|
|
462
|
+
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
|
463
|
+
*
|
|
464
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas
|
|
465
|
+
*
|
|
466
|
+
* @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not specified.
|
|
467
|
+
* @param permissions - Specifies the list of permissions to be associated with the SAS.
|
|
468
|
+
* @param resourceTypes - Specifies the resource types associated with the shared access signature.
|
|
469
|
+
* @param options - Optional parameters.
|
|
470
|
+
* @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
471
|
+
*/
|
|
472
|
+
generateSasStringToSign(expiresOn, permissions = import_AccountSASPermissions.AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) {
|
|
473
|
+
if (!(this.credential instanceof import_storage_common.StorageSharedKeyCredential)) {
|
|
474
|
+
throw RangeError(
|
|
475
|
+
"Can only generate the account SAS when the client is initialized with a shared key credential"
|
|
476
|
+
);
|
|
414
477
|
}
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
* Generates string to sign for an account Shared Access Signature (SAS) URI based on the client properties
|
|
419
|
-
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
|
420
|
-
*
|
|
421
|
-
* @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas
|
|
422
|
-
*
|
|
423
|
-
* @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not specified.
|
|
424
|
-
* @param permissions - Specifies the list of permissions to be associated with the SAS.
|
|
425
|
-
* @param resourceTypes - Specifies the resource types associated with the shared access signature.
|
|
426
|
-
* @param options - Optional parameters.
|
|
427
|
-
* @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
428
|
-
*/
|
|
429
|
-
generateSasStringToSign(expiresOn, permissions = AccountSASPermissions_js_1.AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) {
|
|
430
|
-
if (!(this.credential instanceof storage_common_1.StorageSharedKeyCredential)) {
|
|
431
|
-
throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential");
|
|
432
|
-
}
|
|
433
|
-
if (expiresOn === undefined) {
|
|
434
|
-
const now = new Date();
|
|
435
|
-
expiresOn = new Date(now.getTime() + 3600 * 1000);
|
|
436
|
-
}
|
|
437
|
-
return (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParametersInternal)({
|
|
438
|
-
permissions,
|
|
439
|
-
expiresOn,
|
|
440
|
-
resourceTypes,
|
|
441
|
-
services: AccountSASServices_js_1.AccountSASServices.parse("q").toString(),
|
|
442
|
-
...options,
|
|
443
|
-
}, this.credential).stringToSign;
|
|
478
|
+
if (expiresOn === void 0) {
|
|
479
|
+
const now = /* @__PURE__ */ new Date();
|
|
480
|
+
expiresOn = new Date(now.getTime() + 3600 * 1e3);
|
|
444
481
|
}
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
signedObjectId: response.signedObjectId,
|
|
467
|
-
signedTenantId: response.signedTenantId,
|
|
468
|
-
signedStartsOn: new Date(response.signedStartsOn),
|
|
469
|
-
signedExpiresOn: new Date(response.signedExpiresOn),
|
|
470
|
-
signedService: response.signedService,
|
|
471
|
-
signedVersion: response.signedVersion,
|
|
472
|
-
value: response.value,
|
|
473
|
-
};
|
|
474
|
-
const res = {
|
|
475
|
-
_response: response._response,
|
|
476
|
-
requestId: response.requestId,
|
|
477
|
-
clientRequestId: response.clientRequestId,
|
|
478
|
-
version: response.version,
|
|
479
|
-
date: response.date,
|
|
480
|
-
...userDelegationKey,
|
|
481
|
-
};
|
|
482
|
-
return res;
|
|
483
|
-
});
|
|
482
|
+
return (0, import_AccountSASSignatureValues.generateAccountSASQueryParametersInternal)(
|
|
483
|
+
{
|
|
484
|
+
permissions,
|
|
485
|
+
expiresOn,
|
|
486
|
+
resourceTypes,
|
|
487
|
+
services: import_AccountSASServices.AccountSASServices.parse("q").toString(),
|
|
488
|
+
...options
|
|
489
|
+
},
|
|
490
|
+
this.credential
|
|
491
|
+
).stringToSign;
|
|
492
|
+
}
|
|
493
|
+
async getUserDelegationKey(startsOnOrParam, expiresOnOrOption, options = {}) {
|
|
494
|
+
let startsOn = startsOnOrParam;
|
|
495
|
+
let expiresOn = expiresOnOrOption;
|
|
496
|
+
let userDelegationTid = void 0;
|
|
497
|
+
let getUserDelegationKeyOptions = options;
|
|
498
|
+
if (isQueueGetUserDelegationKeyParameters(startsOnOrParam)) {
|
|
499
|
+
startsOn = startsOnOrParam.startsOn;
|
|
500
|
+
expiresOn = startsOnOrParam.expiresOn;
|
|
501
|
+
userDelegationTid = startsOnOrParam.delegatedUserTenantId;
|
|
502
|
+
getUserDelegationKeyOptions = expiresOnOrOption;
|
|
484
503
|
}
|
|
504
|
+
return import_tracing.tracingClient.withSpan(
|
|
505
|
+
"QueueServiceClient-getUserDelegationKey",
|
|
506
|
+
getUserDelegationKeyOptions,
|
|
507
|
+
async (updatedOptions) => {
|
|
508
|
+
const response = (0, import_utils_common.assertResponse)(
|
|
509
|
+
await this.serviceContext.getUserDelegationKey(
|
|
510
|
+
{
|
|
511
|
+
start: (0, import_utils_common.truncatedISO8061Date)(startsOn, false),
|
|
512
|
+
expiry: (0, import_utils_common.truncatedISO8061Date)(expiresOn, false),
|
|
513
|
+
delegatedUserTid: userDelegationTid
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
abortSignal: options.abortSignal,
|
|
517
|
+
tracingOptions: updatedOptions.tracingOptions
|
|
518
|
+
}
|
|
519
|
+
)
|
|
520
|
+
);
|
|
521
|
+
const userDelegationKey = {
|
|
522
|
+
signedObjectId: response.signedObjectId,
|
|
523
|
+
signedTenantId: response.signedTenantId,
|
|
524
|
+
signedStartsOn: new Date(response.signedStartsOn),
|
|
525
|
+
signedExpiresOn: new Date(response.signedExpiresOn),
|
|
526
|
+
signedService: response.signedService,
|
|
527
|
+
signedVersion: response.signedVersion,
|
|
528
|
+
signedDelegatedUserTenantId: response.signedDelegatedUserTenantId,
|
|
529
|
+
value: response.value
|
|
530
|
+
};
|
|
531
|
+
const res = {
|
|
532
|
+
_response: response._response,
|
|
533
|
+
requestId: response.requestId,
|
|
534
|
+
clientRequestId: response.clientRequestId,
|
|
535
|
+
version: response.version,
|
|
536
|
+
date: response.date,
|
|
537
|
+
...userDelegationKey
|
|
538
|
+
};
|
|
539
|
+
return res;
|
|
540
|
+
}
|
|
541
|
+
);
|
|
542
|
+
}
|
|
485
543
|
}
|
|
486
|
-
|
|
487
|
-
|
|
544
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
545
|
+
0 && (module.exports = {
|
|
546
|
+
QueueServiceClient
|
|
547
|
+
});
|