@azure/storage-queue 12.8.0-alpha.20211217.2 → 12.8.0-alpha.20220113.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -2
- package/README.md +4 -3
- package/dist/index.js +85 -74
- package/dist/index.js.map +1 -1
- package/dist-esm/src/AccountSASSignatureValues.js +2 -2
- package/dist-esm/src/AccountSASSignatureValues.js.map +1 -1
- package/dist-esm/src/Pipeline.js +6 -6
- package/dist-esm/src/Pipeline.js.map +1 -1
- package/dist-esm/src/QueueClient.js +38 -38
- package/dist-esm/src/QueueClient.js.map +1 -1
- package/dist-esm/src/QueueSASSignatureValues.js +1 -1
- package/dist-esm/src/QueueSASSignatureValues.js.map +1 -1
- package/dist-esm/src/QueueServiceClient.js +13 -13
- package/dist-esm/src/QueueServiceClient.js.map +1 -1
- package/dist-esm/src/SASQueryParameters.js +1 -1
- package/dist-esm/src/SASQueryParameters.js.map +1 -1
- package/dist-esm/src/TelemetryPolicyFactory.js +1 -1
- package/dist-esm/src/TelemetryPolicyFactory.js.map +1 -1
- package/dist-esm/src/credentials/StorageSharedKeyCredential.js +1 -3
- package/dist-esm/src/credentials/StorageSharedKeyCredential.js.map +1 -1
- package/dist-esm/src/generatedModels.js.map +1 -1
- package/dist-esm/src/policies/StorageBrowserPolicy.js +1 -1
- package/dist-esm/src/policies/StorageBrowserPolicy.js.map +1 -1
- package/dist-esm/src/policies/StorageRetryPolicy.js +5 -5
- package/dist-esm/src/policies/StorageRetryPolicy.js.map +1 -1
- package/dist-esm/src/policies/StorageSharedKeyCredentialPolicy.js +1 -1
- package/dist-esm/src/policies/StorageSharedKeyCredentialPolicy.js.map +1 -1
- package/dist-esm/src/policies/TelemetryPolicy.js +1 -1
- package/dist-esm/src/policies/TelemetryPolicy.js.map +1 -1
- package/dist-esm/src/utils/constants.js +6 -6
- package/dist-esm/src/utils/constants.js.map +1 -1
- package/dist-esm/src/utils/tracing.js +2 -2
- package/dist-esm/src/utils/tracing.js.map +1 -1
- package/dist-esm/src/utils/utils.common.js +1 -1
- package/dist-esm/src/utils/utils.common.js.map +1 -1
- package/package.json +31 -24
- package/{typings → types}/3.1/storage-queue.d.ts +8 -0
- /package/{typings → types}/latest/storage-queue.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
- Updated HTTP client from axios to node-fetch in Node.js runtime.
|
|
190
190
|
- A new option `keepAliveOptions` added to parameter of `newPipeline()` which controls keep-alive configurations. Keep-alive is enabled by default.
|
|
191
191
|
- Pass through `options.abortSignal` to the optional `abortSignal` attribute in option bags instead of using `AbortSignal.none` as the default value when `options.abortSignal` is not specified.
|
|
192
|
-
- Basic HTTP proxy authentication support is added. Proxy settings can be passed in the options while creating a new client. Example - [typescript/proxyAuth.ts](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storage/storage-queue/samples/typescript/src/proxyAuth.ts)
|
|
192
|
+
- Basic HTTP proxy authentication support is added. Proxy settings can be passed in the options while creating a new client. Example - [typescript/proxyAuth.ts](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storage/storage-queue/samples/v12/typescript/src/proxyAuth.ts)
|
|
193
193
|
- Connection strings for explicit storage endpoints are supported. - [Configure Azure Storage connection strings](https://docs.microsoft.com/azure/storage/common/storage-configure-connection-string#create-a-connection-string-for-an-explicit-storage-endpoint)
|
|
194
194
|
|
|
195
195
|
## 10.3.0 (2019-09-09)
|
|
@@ -246,7 +246,7 @@
|
|
|
246
246
|
- Connection string method is supported only in Node.js (not browsers).
|
|
247
247
|
- Creation/Deletion of child resources are duplicated to parent client type.
|
|
248
248
|
- HTTP proxy support is added (Node.js only).
|
|
249
|
-
- Please refer to the `proxyAuth.ts` sample in the `samples/typescript` folder.
|
|
249
|
+
- Please refer to the `proxyAuth.ts` sample in the `samples/v12/typescript` folder.
|
|
250
250
|
- Request and response headers are now logged at INFO level, with sensitive data redacted.
|
|
251
251
|
|
|
252
252
|
For release notes and more information please visit https://aka.ms/azsdk/releases/july2019preview
|
package/README.md
CHANGED
|
@@ -11,6 +11,7 @@ Use the client libraries in this package to:
|
|
|
11
11
|
- Send/Receive/Peek/Clear/Update/Delete Queue Messages
|
|
12
12
|
|
|
13
13
|
Key links:
|
|
14
|
+
|
|
14
15
|
- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storage/storage-queue)
|
|
15
16
|
- [Package (npm)](https://www.npmjs.com/package/@azure/storage-queue)
|
|
16
17
|
- [API Reference Documentation](https://docs.microsoft.com/javascript/api/@azure/storage-queue)
|
|
@@ -29,7 +30,7 @@ See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUP
|
|
|
29
30
|
|
|
30
31
|
### Prerequisites
|
|
31
32
|
|
|
32
|
-
- An [Azure subscription](https://azure.microsoft.com/free/)
|
|
33
|
+
- An [Azure subscription](https://azure.microsoft.com/free/)
|
|
33
34
|
- A [Storage Account](https://docs.microsoft.com/azure/storage/common/storage-account-create)
|
|
34
35
|
|
|
35
36
|
### Install the package
|
|
@@ -270,7 +271,7 @@ async function main() {
|
|
|
270
271
|
main();
|
|
271
272
|
```
|
|
272
273
|
|
|
273
|
-
For a complete sample on iterating queues please see [samples/typescript/
|
|
274
|
+
For a complete sample on iterating queues please see [samples/v12/typescript/listQueues.ts](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storage/storage-queue/samples/v12/typescript/src/listQueues.ts).
|
|
274
275
|
|
|
275
276
|
### Create a new queue
|
|
276
277
|
|
|
@@ -428,7 +429,7 @@ async function main() {
|
|
|
428
429
|
main();
|
|
429
430
|
```
|
|
430
431
|
|
|
431
|
-
A complete example of
|
|
432
|
+
A complete example of simple `QueueServiceClient` scenarios is at [samples/v12/typescript/src/queueClient.ts](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storage/storage-queue/samples/v12/typescript/src/queueClient.ts).
|
|
432
433
|
|
|
433
434
|
## Troubleshooting
|
|
434
435
|
|
package/dist/index.js
CHANGED
|
@@ -316,8 +316,8 @@ const URLConstants = {
|
|
|
316
316
|
Parameters: {
|
|
317
317
|
FORCE_BROWSER_NO_CACHE: "_",
|
|
318
318
|
SIGNATURE: "sig",
|
|
319
|
-
TIMEOUT: "timeout"
|
|
320
|
-
}
|
|
319
|
+
TIMEOUT: "timeout",
|
|
320
|
+
},
|
|
321
321
|
};
|
|
322
322
|
const HeaderConstants = {
|
|
323
323
|
AUTHORIZATION: "authorization",
|
|
@@ -338,7 +338,7 @@ const HeaderConstants = {
|
|
|
338
338
|
USER_AGENT: "User-Agent",
|
|
339
339
|
X_MS_CLIENT_REQUEST_ID: "x-ms-client-request-id",
|
|
340
340
|
X_MS_COPY_SOURCE: "x-ms-copy-source",
|
|
341
|
-
X_MS_DATE: "x-ms-date"
|
|
341
|
+
X_MS_DATE: "x-ms-date",
|
|
342
342
|
};
|
|
343
343
|
const DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;
|
|
344
344
|
AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;
|
|
@@ -361,7 +361,7 @@ const StorageQueueLoggingAllowedHeaderNames = [
|
|
|
361
361
|
"x-ms-version",
|
|
362
362
|
"x-ms-approximate-messages-count",
|
|
363
363
|
"x-ms-popreceipt",
|
|
364
|
-
"x-ms-time-next-visible"
|
|
364
|
+
"x-ms-time-next-visible",
|
|
365
365
|
];
|
|
366
366
|
const StorageQueueLoggingAllowedQueryParameters = [
|
|
367
367
|
"comp",
|
|
@@ -388,7 +388,7 @@ const StorageQueueLoggingAllowedQueryParameters = [
|
|
|
388
388
|
"numofmessages",
|
|
389
389
|
"peekonly",
|
|
390
390
|
"popreceipt",
|
|
391
|
-
"visibilitytimeout"
|
|
391
|
+
"visibilitytimeout",
|
|
392
392
|
];
|
|
393
393
|
|
|
394
394
|
/*
|
|
@@ -591,7 +591,7 @@ function extractConnectionStringParts(connectionString) {
|
|
|
591
591
|
url: queueEndpoint,
|
|
592
592
|
accountName,
|
|
593
593
|
accountKey,
|
|
594
|
-
proxyUri
|
|
594
|
+
proxyUri,
|
|
595
595
|
};
|
|
596
596
|
}
|
|
597
597
|
else {
|
|
@@ -781,7 +781,7 @@ class SASQueryParameters {
|
|
|
781
781
|
if (this.ipRangeInner) {
|
|
782
782
|
return {
|
|
783
783
|
end: this.ipRangeInner.end,
|
|
784
|
-
start: this.ipRangeInner.start
|
|
784
|
+
start: this.ipRangeInner.start,
|
|
785
785
|
};
|
|
786
786
|
}
|
|
787
787
|
return undefined;
|
|
@@ -885,7 +885,7 @@ function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyC
|
|
|
885
885
|
accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "",
|
|
886
886
|
version,
|
|
887
887
|
"",
|
|
888
|
-
"" // Account SAS requires an additional newline character
|
|
888
|
+
"", // Account SAS requires an additional newline character
|
|
889
889
|
].join("\n");
|
|
890
890
|
}
|
|
891
891
|
else {
|
|
@@ -901,7 +901,7 @@ function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyC
|
|
|
901
901
|
accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "",
|
|
902
902
|
accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "",
|
|
903
903
|
version,
|
|
904
|
-
"" // Account SAS requires an additional newline character
|
|
904
|
+
"", // Account SAS requires an additional newline character
|
|
905
905
|
].join("\n");
|
|
906
906
|
}
|
|
907
907
|
const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);
|
|
@@ -1027,7 +1027,7 @@ class StorageSharedKeyCredentialPolicy extends CredentialPolicy {
|
|
|
1027
1027
|
this.getHeaderValueToSign(request, HeaderConstants.IF_MATCH),
|
|
1028
1028
|
this.getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH),
|
|
1029
1029
|
this.getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE),
|
|
1030
|
-
this.getHeaderValueToSign(request, HeaderConstants.RANGE)
|
|
1030
|
+
this.getHeaderValueToSign(request, HeaderConstants.RANGE),
|
|
1031
1031
|
].join("\n") +
|
|
1032
1032
|
"\n" +
|
|
1033
1033
|
this.getCanonicalizedHeadersString(request) +
|
|
@@ -1156,9 +1156,7 @@ class StorageSharedKeyCredential extends Credential {
|
|
|
1156
1156
|
* @param stringToSign -
|
|
1157
1157
|
*/
|
|
1158
1158
|
computeHMACSHA256(stringToSign) {
|
|
1159
|
-
return crypto.createHmac("sha256", this.accountKey)
|
|
1160
|
-
.update(stringToSign, "utf8")
|
|
1161
|
-
.digest("base64");
|
|
1159
|
+
return crypto.createHmac("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64");
|
|
1162
1160
|
}
|
|
1163
1161
|
}
|
|
1164
1162
|
|
|
@@ -1197,9 +1195,16 @@ class StorageBrowserPolicy extends coreHttp.BaseRequestPolicy {
|
|
|
1197
1195
|
* @param request -
|
|
1198
1196
|
*/
|
|
1199
1197
|
async sendRequest(request) {
|
|
1200
|
-
{
|
|
1198
|
+
if (coreHttp.isNode) {
|
|
1201
1199
|
return this._nextPolicy.sendRequest(request);
|
|
1202
1200
|
}
|
|
1201
|
+
if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") {
|
|
1202
|
+
request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, new Date().getTime().toString());
|
|
1203
|
+
}
|
|
1204
|
+
request.headers.remove(HeaderConstants.COOKIE);
|
|
1205
|
+
// According to XHR standards, content-length should be fully controlled by browsers
|
|
1206
|
+
request.headers.remove(HeaderConstants.CONTENT_LENGTH);
|
|
1207
|
+
return this._nextPolicy.sendRequest(request);
|
|
1203
1208
|
}
|
|
1204
1209
|
}
|
|
1205
1210
|
|
|
@@ -1237,7 +1242,7 @@ const DEFAULT_RETRY_OPTIONS = {
|
|
|
1237
1242
|
retryDelayInMs: 4 * 1000,
|
|
1238
1243
|
retryPolicyType: exports.StorageRetryPolicyType.EXPONENTIAL,
|
|
1239
1244
|
secondaryHost: "",
|
|
1240
|
-
tryTimeoutInMs: 30 * 1000 // https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations
|
|
1245
|
+
tryTimeoutInMs: 30 * 1000, // https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations
|
|
1241
1246
|
};
|
|
1242
1247
|
const RETRY_ABORT_ERROR = new abortController.AbortError("The operation was aborted.");
|
|
1243
1248
|
/**
|
|
@@ -1274,7 +1279,7 @@ class StorageRetryPolicy extends coreHttp.BaseRequestPolicy {
|
|
|
1274
1279
|
: DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs,
|
|
1275
1280
|
secondaryHost: retryOptions.secondaryHost
|
|
1276
1281
|
? retryOptions.secondaryHost
|
|
1277
|
-
: DEFAULT_RETRY_OPTIONS.secondaryHost
|
|
1282
|
+
: DEFAULT_RETRY_OPTIONS.secondaryHost,
|
|
1278
1283
|
};
|
|
1279
1284
|
}
|
|
1280
1285
|
/**
|
|
@@ -1350,7 +1355,7 @@ class StorageRetryPolicy extends coreHttp.BaseRequestPolicy {
|
|
|
1350
1355
|
"ENOTFOUND",
|
|
1351
1356
|
"TIMEOUT",
|
|
1352
1357
|
"EPIPE",
|
|
1353
|
-
"REQUEST_SEND_ERROR" // For default xhr based http client provided in ms-rest-js
|
|
1358
|
+
"REQUEST_SEND_ERROR", // For default xhr based http client provided in ms-rest-js
|
|
1354
1359
|
];
|
|
1355
1360
|
if (err) {
|
|
1356
1361
|
for (const retriableError of retriableErrors) {
|
|
@@ -1454,7 +1459,7 @@ class TelemetryPolicy extends coreHttp.BaseRequestPolicy {
|
|
|
1454
1459
|
* @param request -
|
|
1455
1460
|
*/
|
|
1456
1461
|
async sendRequest(request) {
|
|
1457
|
-
{
|
|
1462
|
+
if (coreHttp.isNode) {
|
|
1458
1463
|
if (!request.headers) {
|
|
1459
1464
|
request.headers = new coreHttp.HttpHeaders();
|
|
1460
1465
|
}
|
|
@@ -1477,7 +1482,7 @@ class TelemetryPolicyFactory {
|
|
|
1477
1482
|
*/
|
|
1478
1483
|
constructor(telemetry) {
|
|
1479
1484
|
const userAgentInfo = [];
|
|
1480
|
-
{
|
|
1485
|
+
if (coreHttp.isNode) {
|
|
1481
1486
|
if (telemetry) {
|
|
1482
1487
|
const telemetryString = telemetry.userAgentPrefix || "";
|
|
1483
1488
|
if (telemetryString.length > 0 && userAgentInfo.indexOf(telemetryString) === -1) {
|
|
@@ -1544,7 +1549,7 @@ class Pipeline {
|
|
|
1544
1549
|
toServiceClientOptions() {
|
|
1545
1550
|
return {
|
|
1546
1551
|
httpClient: this.options.httpClient,
|
|
1547
|
-
requestPolicyFactories: this.factories
|
|
1552
|
+
requestPolicyFactories: this.factories,
|
|
1548
1553
|
};
|
|
1549
1554
|
}
|
|
1550
1555
|
}
|
|
@@ -1574,10 +1579,10 @@ function newPipeline(credential, pipelineOptions = {}) {
|
|
|
1574
1579
|
coreHttp.logPolicy({
|
|
1575
1580
|
logger: logger.info,
|
|
1576
1581
|
allowedHeaderNames: StorageQueueLoggingAllowedHeaderNames,
|
|
1577
|
-
allowedQueryParameters: StorageQueueLoggingAllowedQueryParameters
|
|
1578
|
-
})
|
|
1582
|
+
allowedQueryParameters: StorageQueueLoggingAllowedQueryParameters,
|
|
1583
|
+
}),
|
|
1579
1584
|
];
|
|
1580
|
-
{
|
|
1585
|
+
if (coreHttp.isNode) {
|
|
1581
1586
|
// ProxyPolicy is only available in Node.js runtime, not in browsers
|
|
1582
1587
|
factories.push(coreHttp.proxyPolicy(pipelineOptions.proxyOptions));
|
|
1583
1588
|
}
|
|
@@ -4447,7 +4452,7 @@ class StorageClient {
|
|
|
4447
4452
|
*/
|
|
4448
4453
|
const createSpan = coreTracing.createSpanFunction({
|
|
4449
4454
|
packagePrefix: "Azure.Storage.Queue",
|
|
4450
|
-
namespace: "Microsoft.Storage"
|
|
4455
|
+
namespace: "Microsoft.Storage",
|
|
4451
4456
|
});
|
|
4452
4457
|
|
|
4453
4458
|
// Copyright (c) Microsoft Corporation.
|
|
@@ -4574,7 +4579,7 @@ function generateQueueSASQueryParameters(queueSASSignatureValues, sharedKeyCrede
|
|
|
4574
4579
|
queueSASSignatureValues.identifier,
|
|
4575
4580
|
queueSASSignatureValues.ipRange ? ipRangeToString(queueSASSignatureValues.ipRange) : "",
|
|
4576
4581
|
queueSASSignatureValues.protocol ? queueSASSignatureValues.protocol : "",
|
|
4577
|
-
version
|
|
4582
|
+
version,
|
|
4578
4583
|
].join("\n");
|
|
4579
4584
|
const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);
|
|
4580
4585
|
return new SASQueryParameters(version, signature, verifiedPermissions, undefined, undefined, queueSASSignatureValues.protocol, queueSASSignatureValues.startsOn, queueSASSignatureValues.expiresOn, queueSASSignatureValues.ipRange, queueSASSignatureValues.identifier);
|
|
@@ -4620,13 +4625,16 @@ class QueueClient extends StorageClient {
|
|
|
4620
4625
|
// (connectionString: string, containerName: string, queueName: string, options?: StoragePipelineOptions)
|
|
4621
4626
|
const extractedCreds = extractConnectionStringParts(urlOrConnectionString);
|
|
4622
4627
|
if (extractedCreds.kind === "AccountConnString") {
|
|
4623
|
-
{
|
|
4628
|
+
if (coreHttp.isNode) {
|
|
4624
4629
|
const queueName = credentialOrPipelineOrQueueName;
|
|
4625
4630
|
const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
|
|
4626
4631
|
url = appendToURLPath(extractedCreds.url, queueName);
|
|
4627
4632
|
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
|
|
4628
4633
|
pipeline = newPipeline(sharedKeyCredential, options);
|
|
4629
4634
|
}
|
|
4635
|
+
else {
|
|
4636
|
+
throw new Error("Account connection string is only supported in Node.js environment");
|
|
4637
|
+
}
|
|
4630
4638
|
}
|
|
4631
4639
|
else if (extractedCreds.kind === "SASConnString") {
|
|
4632
4640
|
const queueName = credentialOrPipelineOrQueueName;
|
|
@@ -4687,7 +4695,7 @@ class QueueClient extends StorageClient {
|
|
|
4687
4695
|
catch (e) {
|
|
4688
4696
|
span.setStatus({
|
|
4689
4697
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
4690
|
-
message: e.message
|
|
4698
|
+
message: e.message,
|
|
4691
4699
|
});
|
|
4692
4700
|
throw e;
|
|
4693
4701
|
}
|
|
@@ -4719,13 +4727,13 @@ class QueueClient extends StorageClient {
|
|
|
4719
4727
|
if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "QueueAlreadyExists") {
|
|
4720
4728
|
span.setStatus({
|
|
4721
4729
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
4722
|
-
message: "Expected exception when creating a queue only if it does not already exist."
|
|
4730
|
+
message: "Expected exception when creating a queue only if it does not already exist.",
|
|
4723
4731
|
});
|
|
4724
4732
|
return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
|
|
4725
4733
|
}
|
|
4726
4734
|
span.setStatus({
|
|
4727
4735
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
4728
|
-
message: e.message
|
|
4736
|
+
message: e.message,
|
|
4729
4737
|
});
|
|
4730
4738
|
throw e;
|
|
4731
4739
|
}
|
|
@@ -4750,13 +4758,13 @@ class QueueClient extends StorageClient {
|
|
|
4750
4758
|
if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "QueueNotFound") {
|
|
4751
4759
|
span.setStatus({
|
|
4752
4760
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
4753
|
-
message: "Expected exception when deleting a queue only if it exists."
|
|
4761
|
+
message: "Expected exception when deleting a queue only if it exists.",
|
|
4754
4762
|
});
|
|
4755
4763
|
return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
|
|
4756
4764
|
}
|
|
4757
4765
|
span.setStatus({
|
|
4758
4766
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
4759
|
-
message: e.message
|
|
4767
|
+
message: e.message,
|
|
4760
4768
|
});
|
|
4761
4769
|
throw e;
|
|
4762
4770
|
}
|
|
@@ -4785,13 +4793,13 @@ class QueueClient extends StorageClient {
|
|
|
4785
4793
|
try {
|
|
4786
4794
|
return await this.queueContext.delete({
|
|
4787
4795
|
abortSignal: options.abortSignal,
|
|
4788
|
-
tracingOptions: updatedOptions.tracingOptions
|
|
4796
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
4789
4797
|
});
|
|
4790
4798
|
}
|
|
4791
4799
|
catch (e) {
|
|
4792
4800
|
span.setStatus({
|
|
4793
4801
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
4794
|
-
message: e.message
|
|
4802
|
+
message: e.message,
|
|
4795
4803
|
});
|
|
4796
4804
|
throw e;
|
|
4797
4805
|
}
|
|
@@ -4813,7 +4821,7 @@ class QueueClient extends StorageClient {
|
|
|
4813
4821
|
try {
|
|
4814
4822
|
await this.getProperties({
|
|
4815
4823
|
abortSignal: options.abortSignal,
|
|
4816
|
-
tracingOptions: updatedOptions.tracingOptions
|
|
4824
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
4817
4825
|
});
|
|
4818
4826
|
return true;
|
|
4819
4827
|
}
|
|
@@ -4821,13 +4829,13 @@ class QueueClient extends StorageClient {
|
|
|
4821
4829
|
if (e.statusCode === 404) {
|
|
4822
4830
|
span.setStatus({
|
|
4823
4831
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
4824
|
-
message: "Expected exception when checking queue existence"
|
|
4832
|
+
message: "Expected exception when checking queue existence",
|
|
4825
4833
|
});
|
|
4826
4834
|
return false;
|
|
4827
4835
|
}
|
|
4828
4836
|
span.setStatus({
|
|
4829
4837
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
4830
|
-
message: e.message
|
|
4838
|
+
message: e.message,
|
|
4831
4839
|
});
|
|
4832
4840
|
throw e;
|
|
4833
4841
|
}
|
|
@@ -4853,13 +4861,13 @@ class QueueClient extends StorageClient {
|
|
|
4853
4861
|
try {
|
|
4854
4862
|
return await this.queueContext.getProperties({
|
|
4855
4863
|
abortSignal: options.abortSignal,
|
|
4856
|
-
tracingOptions: updatedOptions.tracingOptions
|
|
4864
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
4857
4865
|
});
|
|
4858
4866
|
}
|
|
4859
4867
|
catch (e) {
|
|
4860
4868
|
span.setStatus({
|
|
4861
4869
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
4862
|
-
message: e.message
|
|
4870
|
+
message: e.message,
|
|
4863
4871
|
});
|
|
4864
4872
|
throw e;
|
|
4865
4873
|
}
|
|
@@ -4884,13 +4892,13 @@ class QueueClient extends StorageClient {
|
|
|
4884
4892
|
return await this.queueContext.setMetadata({
|
|
4885
4893
|
abortSignal: options.abortSignal,
|
|
4886
4894
|
metadata,
|
|
4887
|
-
tracingOptions: updatedOptions.tracingOptions
|
|
4895
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
4888
4896
|
});
|
|
4889
4897
|
}
|
|
4890
4898
|
catch (e) {
|
|
4891
4899
|
span.setStatus({
|
|
4892
4900
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
4893
|
-
message: e.message
|
|
4901
|
+
message: e.message,
|
|
4894
4902
|
});
|
|
4895
4903
|
throw e;
|
|
4896
4904
|
}
|
|
@@ -4914,7 +4922,7 @@ class QueueClient extends StorageClient {
|
|
|
4914
4922
|
try {
|
|
4915
4923
|
const response = await this.queueContext.getAccessPolicy({
|
|
4916
4924
|
abortSignal: options.abortSignal,
|
|
4917
|
-
tracingOptions: updatedOptions.tracingOptions
|
|
4925
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
4918
4926
|
});
|
|
4919
4927
|
const res = {
|
|
4920
4928
|
_response: response._response,
|
|
@@ -4923,13 +4931,13 @@ class QueueClient extends StorageClient {
|
|
|
4923
4931
|
clientRequestId: response.clientRequestId,
|
|
4924
4932
|
signedIdentifiers: [],
|
|
4925
4933
|
version: response.version,
|
|
4926
|
-
errorCode: response.errorCode
|
|
4934
|
+
errorCode: response.errorCode,
|
|
4927
4935
|
};
|
|
4928
4936
|
for (const identifier of response) {
|
|
4929
4937
|
let accessPolicy = undefined;
|
|
4930
4938
|
if (identifier.accessPolicy) {
|
|
4931
4939
|
accessPolicy = {
|
|
4932
|
-
permissions: identifier.accessPolicy.permissions
|
|
4940
|
+
permissions: identifier.accessPolicy.permissions,
|
|
4933
4941
|
};
|
|
4934
4942
|
if (identifier.accessPolicy.expiresOn) {
|
|
4935
4943
|
accessPolicy.expiresOn = new Date(identifier.accessPolicy.expiresOn);
|
|
@@ -4940,7 +4948,7 @@ class QueueClient extends StorageClient {
|
|
|
4940
4948
|
}
|
|
4941
4949
|
res.signedIdentifiers.push({
|
|
4942
4950
|
accessPolicy,
|
|
4943
|
-
id: identifier.id
|
|
4951
|
+
id: identifier.id,
|
|
4944
4952
|
});
|
|
4945
4953
|
}
|
|
4946
4954
|
return res;
|
|
@@ -4948,7 +4956,7 @@ class QueueClient extends StorageClient {
|
|
|
4948
4956
|
catch (e) {
|
|
4949
4957
|
span.setStatus({
|
|
4950
4958
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
4951
|
-
message: e.message
|
|
4959
|
+
message: e.message,
|
|
4952
4960
|
});
|
|
4953
4961
|
throw e;
|
|
4954
4962
|
}
|
|
@@ -4977,21 +4985,21 @@ class QueueClient extends StorageClient {
|
|
|
4977
4985
|
permissions: identifier.accessPolicy.permissions,
|
|
4978
4986
|
startsOn: identifier.accessPolicy.startsOn
|
|
4979
4987
|
? truncatedISO8061Date(identifier.accessPolicy.startsOn)
|
|
4980
|
-
: undefined
|
|
4988
|
+
: undefined,
|
|
4981
4989
|
},
|
|
4982
|
-
id: identifier.id
|
|
4990
|
+
id: identifier.id,
|
|
4983
4991
|
});
|
|
4984
4992
|
}
|
|
4985
4993
|
return await this.queueContext.setAccessPolicy({
|
|
4986
4994
|
abortSignal: options.abortSignal,
|
|
4987
4995
|
queueAcl: acl,
|
|
4988
|
-
tracingOptions: updatedOptions.tracingOptions
|
|
4996
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
4989
4997
|
});
|
|
4990
4998
|
}
|
|
4991
4999
|
catch (e) {
|
|
4992
5000
|
span.setStatus({
|
|
4993
5001
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
4994
|
-
message: e.message
|
|
5002
|
+
message: e.message,
|
|
4995
5003
|
});
|
|
4996
5004
|
throw e;
|
|
4997
5005
|
}
|
|
@@ -5011,13 +5019,13 @@ class QueueClient extends StorageClient {
|
|
|
5011
5019
|
try {
|
|
5012
5020
|
return await this.messagesContext.clear({
|
|
5013
5021
|
abortSignal: options.abortSignal,
|
|
5014
|
-
tracingOptions: updatedOptions.tracingOptions
|
|
5022
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
5015
5023
|
});
|
|
5016
5024
|
}
|
|
5017
5025
|
catch (e) {
|
|
5018
5026
|
span.setStatus({
|
|
5019
5027
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5020
|
-
message: e.message
|
|
5028
|
+
message: e.message,
|
|
5021
5029
|
});
|
|
5022
5030
|
throw e;
|
|
5023
5031
|
}
|
|
@@ -5050,7 +5058,7 @@ class QueueClient extends StorageClient {
|
|
|
5050
5058
|
const { span, updatedOptions } = createSpan("QueueClient-sendMessage", options);
|
|
5051
5059
|
try {
|
|
5052
5060
|
const response = await this.messagesContext.enqueue({
|
|
5053
|
-
messageText: messageText
|
|
5061
|
+
messageText: messageText,
|
|
5054
5062
|
}, updatedOptions);
|
|
5055
5063
|
const item = response[0];
|
|
5056
5064
|
return {
|
|
@@ -5064,13 +5072,13 @@ class QueueClient extends StorageClient {
|
|
|
5064
5072
|
popReceipt: item.popReceipt,
|
|
5065
5073
|
nextVisibleOn: item.nextVisibleOn,
|
|
5066
5074
|
insertedOn: item.insertedOn,
|
|
5067
|
-
expiresOn: item.expiresOn
|
|
5075
|
+
expiresOn: item.expiresOn,
|
|
5068
5076
|
};
|
|
5069
5077
|
}
|
|
5070
5078
|
catch (e) {
|
|
5071
5079
|
span.setStatus({
|
|
5072
5080
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5073
|
-
message: e.message
|
|
5081
|
+
message: e.message,
|
|
5074
5082
|
});
|
|
5075
5083
|
throw e;
|
|
5076
5084
|
}
|
|
@@ -5114,7 +5122,7 @@ class QueueClient extends StorageClient {
|
|
|
5114
5122
|
clientRequestId: response.clientRequestId,
|
|
5115
5123
|
receivedMessageItems: [],
|
|
5116
5124
|
version: response.version,
|
|
5117
|
-
errorCode: response.errorCode
|
|
5125
|
+
errorCode: response.errorCode,
|
|
5118
5126
|
};
|
|
5119
5127
|
for (const item of response) {
|
|
5120
5128
|
res.receivedMessageItems.push(item);
|
|
@@ -5124,7 +5132,7 @@ class QueueClient extends StorageClient {
|
|
|
5124
5132
|
catch (e) {
|
|
5125
5133
|
span.setStatus({
|
|
5126
5134
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5127
|
-
message: e.message
|
|
5135
|
+
message: e.message,
|
|
5128
5136
|
});
|
|
5129
5137
|
throw e;
|
|
5130
5138
|
}
|
|
@@ -5157,7 +5165,7 @@ class QueueClient extends StorageClient {
|
|
|
5157
5165
|
clientRequestId: response.clientRequestId,
|
|
5158
5166
|
peekedMessageItems: [],
|
|
5159
5167
|
version: response.version,
|
|
5160
|
-
errorCode: response.errorCode
|
|
5168
|
+
errorCode: response.errorCode,
|
|
5161
5169
|
};
|
|
5162
5170
|
for (const item of response) {
|
|
5163
5171
|
res.peekedMessageItems.push(item);
|
|
@@ -5167,7 +5175,7 @@ class QueueClient extends StorageClient {
|
|
|
5167
5175
|
catch (e) {
|
|
5168
5176
|
span.setStatus({
|
|
5169
5177
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5170
|
-
message: e.message
|
|
5178
|
+
message: e.message,
|
|
5171
5179
|
});
|
|
5172
5180
|
throw e;
|
|
5173
5181
|
}
|
|
@@ -5189,13 +5197,13 @@ class QueueClient extends StorageClient {
|
|
|
5189
5197
|
try {
|
|
5190
5198
|
return await this.getMessageIdContext(messageId).delete(popReceipt, {
|
|
5191
5199
|
abortSignal: options.abortSignal,
|
|
5192
|
-
tracingOptions: updatedOptions.tracingOptions
|
|
5200
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
5193
5201
|
});
|
|
5194
5202
|
}
|
|
5195
5203
|
catch (e) {
|
|
5196
5204
|
span.setStatus({
|
|
5197
5205
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5198
|
-
message: e.message
|
|
5206
|
+
message: e.message,
|
|
5199
5207
|
});
|
|
5200
5208
|
throw e;
|
|
5201
5209
|
}
|
|
@@ -5230,13 +5238,13 @@ class QueueClient extends StorageClient {
|
|
|
5230
5238
|
return await this.getMessageIdContext(messageId).update(popReceipt, visibilityTimeout || 0, {
|
|
5231
5239
|
abortSignal: options.abortSignal,
|
|
5232
5240
|
tracingOptions: updatedOptions.tracingOptions,
|
|
5233
|
-
queueMessage
|
|
5241
|
+
queueMessage,
|
|
5234
5242
|
});
|
|
5235
5243
|
}
|
|
5236
5244
|
catch (e) {
|
|
5237
5245
|
span.setStatus({
|
|
5238
5246
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5239
|
-
message: e.message
|
|
5247
|
+
message: e.message,
|
|
5240
5248
|
});
|
|
5241
5249
|
throw e;
|
|
5242
5250
|
}
|
|
@@ -5343,12 +5351,15 @@ class QueueServiceClient extends StorageClient {
|
|
|
5343
5351
|
options = options || {};
|
|
5344
5352
|
const extractedCreds = extractConnectionStringParts(connectionString);
|
|
5345
5353
|
if (extractedCreds.kind === "AccountConnString") {
|
|
5346
|
-
{
|
|
5354
|
+
if (coreHttp.isNode) {
|
|
5347
5355
|
const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
|
|
5348
5356
|
options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);
|
|
5349
5357
|
const pipeline = newPipeline(sharedKeyCredential, options);
|
|
5350
5358
|
return new QueueServiceClient(extractedCreds.url, pipeline);
|
|
5351
5359
|
}
|
|
5360
|
+
else {
|
|
5361
|
+
throw new Error("Account connection string is only supported in Node.js environment");
|
|
5362
|
+
}
|
|
5352
5363
|
}
|
|
5353
5364
|
else if (extractedCreds.kind === "SASConnString") {
|
|
5354
5365
|
const pipeline = newPipeline(new AnonymousCredential(), options);
|
|
@@ -5400,13 +5411,13 @@ class QueueServiceClient extends StorageClient {
|
|
|
5400
5411
|
maxPageSize: options.maxPageSize,
|
|
5401
5412
|
prefix: options.prefix,
|
|
5402
5413
|
include: options.include === undefined ? undefined : [options.include],
|
|
5403
|
-
tracingOptions: updatedOptions.tracingOptions
|
|
5414
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
5404
5415
|
});
|
|
5405
5416
|
}
|
|
5406
5417
|
catch (e) {
|
|
5407
5418
|
span.setStatus({
|
|
5408
5419
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5409
|
-
message: e.message
|
|
5420
|
+
message: e.message,
|
|
5410
5421
|
});
|
|
5411
5422
|
throw e;
|
|
5412
5423
|
}
|
|
@@ -5570,7 +5581,7 @@ class QueueServiceClient extends StorageClient {
|
|
|
5570
5581
|
*/
|
|
5571
5582
|
byPage: (settings = {}) => {
|
|
5572
5583
|
return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions));
|
|
5573
|
-
}
|
|
5584
|
+
},
|
|
5574
5585
|
};
|
|
5575
5586
|
}
|
|
5576
5587
|
/**
|
|
@@ -5586,13 +5597,13 @@ class QueueServiceClient extends StorageClient {
|
|
|
5586
5597
|
try {
|
|
5587
5598
|
return await this.serviceContext.getProperties({
|
|
5588
5599
|
abortSignal: options.abortSignal,
|
|
5589
|
-
tracingOptions: updatedOptions.tracingOptions
|
|
5600
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
5590
5601
|
});
|
|
5591
5602
|
}
|
|
5592
5603
|
catch (e) {
|
|
5593
5604
|
span.setStatus({
|
|
5594
5605
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5595
|
-
message: e.message
|
|
5606
|
+
message: e.message,
|
|
5596
5607
|
});
|
|
5597
5608
|
throw e;
|
|
5598
5609
|
}
|
|
@@ -5614,13 +5625,13 @@ class QueueServiceClient extends StorageClient {
|
|
|
5614
5625
|
try {
|
|
5615
5626
|
return await this.serviceContext.setProperties(properties, {
|
|
5616
5627
|
abortSignal: options.abortSignal,
|
|
5617
|
-
tracingOptions: updatedOptions.tracingOptions
|
|
5628
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
5618
5629
|
});
|
|
5619
5630
|
}
|
|
5620
5631
|
catch (e) {
|
|
5621
5632
|
span.setStatus({
|
|
5622
5633
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5623
|
-
message: e.message
|
|
5634
|
+
message: e.message,
|
|
5624
5635
|
});
|
|
5625
5636
|
throw e;
|
|
5626
5637
|
}
|
|
@@ -5642,13 +5653,13 @@ class QueueServiceClient extends StorageClient {
|
|
|
5642
5653
|
try {
|
|
5643
5654
|
return await this.serviceContext.getStatistics({
|
|
5644
5655
|
abortSignal: options.abortSignal,
|
|
5645
|
-
tracingOptions: updatedOptions.tracingOptions
|
|
5656
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
5646
5657
|
});
|
|
5647
5658
|
}
|
|
5648
5659
|
catch (e) {
|
|
5649
5660
|
span.setStatus({
|
|
5650
5661
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5651
|
-
message: e.message
|
|
5662
|
+
message: e.message,
|
|
5652
5663
|
});
|
|
5653
5664
|
throw e;
|
|
5654
5665
|
}
|
|
@@ -5672,7 +5683,7 @@ class QueueServiceClient extends StorageClient {
|
|
|
5672
5683
|
catch (e) {
|
|
5673
5684
|
span.setStatus({
|
|
5674
5685
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5675
|
-
message: e.message
|
|
5686
|
+
message: e.message,
|
|
5676
5687
|
});
|
|
5677
5688
|
throw e;
|
|
5678
5689
|
}
|
|
@@ -5696,7 +5707,7 @@ class QueueServiceClient extends StorageClient {
|
|
|
5696
5707
|
catch (e) {
|
|
5697
5708
|
span.setStatus({
|
|
5698
5709
|
code: coreTracing.SpanStatusCode.ERROR,
|
|
5699
|
-
message: e.message
|
|
5710
|
+
message: e.message,
|
|
5700
5711
|
});
|
|
5701
5712
|
throw e;
|
|
5702
5713
|
}
|