@azure/storage-queue 12.23.1-alpha.20240807.2 → 12.24.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/index.js +65 -7
- package/dist/index.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobServiceClient.js +27 -1
- package/dist-esm/storage-blob/src/BlobServiceClient.js.map +1 -1
- package/dist-esm/storage-blob/src/Clients.js +19 -1
- package/dist-esm/storage-blob/src/Clients.js.map +1 -1
- package/dist-esm/storage-blob/src/ContainerClient.js +19 -1
- package/dist-esm/storage-blob/src/ContainerClient.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/models/parameters.js +1 -1
- package/dist-esm/storage-blob/src/generated/src/models/parameters.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/storageClient.js +2 -2
- package/dist-esm/storage-blob/src/generated/src/storageClient.js.map +1 -1
- package/dist-esm/storage-blob/src/index.js +2 -2
- package/dist-esm/storage-blob/src/index.js.map +1 -1
- package/dist-esm/storage-blob/src/sas/AccountSASSignatureValues.js +8 -1
- package/dist-esm/storage-blob/src/sas/AccountSASSignatureValues.js.map +1 -1
- package/dist-esm/storage-blob/src/sas/BlobSASSignatureValues.js +27 -6
- package/dist-esm/storage-blob/src/sas/BlobSASSignatureValues.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/constants.js +2 -2
- package/dist-esm/storage-blob/src/utils/constants.js.map +1 -1
- package/dist-esm/storage-queue/src/AccountSASSignatureValues.js +8 -1
- package/dist-esm/storage-queue/src/AccountSASSignatureValues.js.map +1 -1
- package/dist-esm/storage-queue/src/QueueClient.js +19 -1
- package/dist-esm/storage-queue/src/QueueClient.js.map +1 -1
- package/dist-esm/storage-queue/src/QueueSASSignatureValues.js +8 -1
- package/dist-esm/storage-queue/src/QueueSASSignatureValues.js.map +1 -1
- package/dist-esm/storage-queue/src/QueueServiceClient.js +27 -1
- package/dist-esm/storage-queue/src/QueueServiceClient.js.map +1 -1
- package/dist-esm/storage-queue/src/generated/src/models/parameters.js +1 -1
- package/dist-esm/storage-queue/src/generated/src/models/parameters.js.map +1 -1
- package/dist-esm/storage-queue/src/generated/src/storageClient.js +2 -2
- package/dist-esm/storage-queue/src/generated/src/storageClient.js.map +1 -1
- package/dist-esm/storage-queue/src/index.js +2 -2
- package/dist-esm/storage-queue/src/index.js.map +1 -1
- package/dist-esm/storage-queue/src/utils/constants.js +2 -2
- package/dist-esm/storage-queue/src/utils/constants.js.map +1 -1
- package/package.json +3 -3
- package/types/latest/storage-queue.d.ts +27 -0
package/dist/index.js
CHANGED
|
@@ -329,8 +329,8 @@ function ipRangeToString(ipRange) {
|
|
|
329
329
|
|
|
330
330
|
// Copyright (c) Microsoft Corporation.
|
|
331
331
|
// Licensed under the MIT license.
|
|
332
|
-
const SDK_VERSION = "12.
|
|
333
|
-
const SERVICE_VERSION = "2024-
|
|
332
|
+
const SDK_VERSION = "12.24.0-beta.1";
|
|
333
|
+
const SERVICE_VERSION = "2024-11-04";
|
|
334
334
|
/**
|
|
335
335
|
* The OAuth scope to use with Azure Storage.
|
|
336
336
|
*/
|
|
@@ -760,6 +760,10 @@ class SASQueryParameters {
|
|
|
760
760
|
* @param sharedKeyCredential - Shared key credential.
|
|
761
761
|
*/
|
|
762
762
|
function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyCredential) {
|
|
763
|
+
return generateAccountSASQueryParametersInternal(accountSASSignatureValues, sharedKeyCredential)
|
|
764
|
+
.sasQueryParameters;
|
|
765
|
+
}
|
|
766
|
+
function generateAccountSASQueryParametersInternal(accountSASSignatureValues, sharedKeyCredential) {
|
|
763
767
|
const version = accountSASSignatureValues.version
|
|
764
768
|
? accountSASSignatureValues.version
|
|
765
769
|
: SERVICE_VERSION;
|
|
@@ -801,7 +805,10 @@ function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyC
|
|
|
801
805
|
].join("\n");
|
|
802
806
|
}
|
|
803
807
|
const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);
|
|
804
|
-
return
|
|
808
|
+
return {
|
|
809
|
+
sasQueryParameters: new SASQueryParameters(version, signature, parsedPermissions, parsedServices, parsedResourceTypes, accountSASSignatureValues.protocol, accountSASSignatureValues.startsOn, accountSASSignatureValues.expiresOn, accountSASSignatureValues.ipRange),
|
|
810
|
+
stringToSign: stringToSign,
|
|
811
|
+
};
|
|
805
812
|
}
|
|
806
813
|
|
|
807
814
|
// Copyright (c) Microsoft Corporation.
|
|
@@ -4118,7 +4125,7 @@ const timeoutInSeconds = {
|
|
|
4118
4125
|
const version = {
|
|
4119
4126
|
parameterPath: "version",
|
|
4120
4127
|
mapper: {
|
|
4121
|
-
defaultValue: "2024-
|
|
4128
|
+
defaultValue: "2024-11-04",
|
|
4122
4129
|
isConstant: true,
|
|
4123
4130
|
serializedName: "x-ms-version",
|
|
4124
4131
|
type: {
|
|
@@ -5059,7 +5066,7 @@ let StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.Exte
|
|
|
5059
5066
|
const defaults = {
|
|
5060
5067
|
requestContentType: "application/json; charset=utf-8"
|
|
5061
5068
|
};
|
|
5062
|
-
const packageDetails = `azsdk-js-azure-storage-queue/12.
|
|
5069
|
+
const packageDetails = `azsdk-js-azure-storage-queue/12.24.0-beta.1`;
|
|
5063
5070
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
5064
5071
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
5065
5072
|
: `${packageDetails}`;
|
|
@@ -5070,7 +5077,7 @@ let StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.Exte
|
|
|
5070
5077
|
// Parameter assignments
|
|
5071
5078
|
this.url = url;
|
|
5072
5079
|
// Assigning values to Constant parameters
|
|
5073
|
-
this.version = options.version || "2024-
|
|
5080
|
+
this.version = options.version || "2024-11-04";
|
|
5074
5081
|
this.service = new ServiceImpl(this);
|
|
5075
5082
|
this.queue = new QueueImpl(this);
|
|
5076
5083
|
this.messages = new MessagesImpl(this);
|
|
@@ -5245,6 +5252,10 @@ class QueueSASPermissions {
|
|
|
5245
5252
|
* @param sharedKeyCredential -
|
|
5246
5253
|
*/
|
|
5247
5254
|
function generateQueueSASQueryParameters(queueSASSignatureValues, sharedKeyCredential) {
|
|
5255
|
+
return generateQueueSASQueryParametersInternal(queueSASSignatureValues, sharedKeyCredential)
|
|
5256
|
+
.sasQueryParameters;
|
|
5257
|
+
}
|
|
5258
|
+
function generateQueueSASQueryParametersInternal(queueSASSignatureValues, sharedKeyCredential) {
|
|
5248
5259
|
if (!queueSASSignatureValues.identifier &&
|
|
5249
5260
|
!(queueSASSignatureValues.permissions && queueSASSignatureValues.expiresOn)) {
|
|
5250
5261
|
throw new RangeError("Must provide 'permissions' and 'expiresOn' for Queue SAS generation when 'identifier' is not provided.");
|
|
@@ -5273,7 +5284,10 @@ function generateQueueSASQueryParameters(queueSASSignatureValues, sharedKeyCrede
|
|
|
5273
5284
|
version,
|
|
5274
5285
|
].join("\n");
|
|
5275
5286
|
const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);
|
|
5276
|
-
return
|
|
5287
|
+
return {
|
|
5288
|
+
sasQueryParameters: new SASQueryParameters(version, signature, verifiedPermissions, undefined, undefined, queueSASSignatureValues.protocol, queueSASSignatureValues.startsOn, queueSASSignatureValues.expiresOn, queueSASSignatureValues.ipRange, queueSASSignatureValues.identifier),
|
|
5289
|
+
stringToSign: stringToSign,
|
|
5290
|
+
};
|
|
5277
5291
|
}
|
|
5278
5292
|
function getCanonicalName(accountName, queueName) {
|
|
5279
5293
|
// Queue: "/queue/account/queueName"
|
|
@@ -5816,6 +5830,24 @@ class QueueClient extends StorageClient {
|
|
|
5816
5830
|
const sas = generateQueueSASQueryParameters(Object.assign({ queueName: this.name }, options), this.credential).toString();
|
|
5817
5831
|
return appendToURLQuery(this.url, sas);
|
|
5818
5832
|
}
|
|
5833
|
+
/**
|
|
5834
|
+
* Only available for QueueClient constructed with a shared key credential.
|
|
5835
|
+
*
|
|
5836
|
+
* Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties
|
|
5837
|
+
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
|
5838
|
+
*
|
|
5839
|
+
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
|
|
5840
|
+
*
|
|
5841
|
+
* @param options - Optional parameters.
|
|
5842
|
+
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
5843
|
+
*/
|
|
5844
|
+
/* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/
|
|
5845
|
+
generateSasStringToSign(options) {
|
|
5846
|
+
if (!(this.credential instanceof StorageSharedKeyCredential)) {
|
|
5847
|
+
throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
|
|
5848
|
+
}
|
|
5849
|
+
return generateQueueSASQueryParametersInternal(Object.assign({ queueName: this.name }, options), this.credential).stringToSign;
|
|
5850
|
+
}
|
|
5819
5851
|
}
|
|
5820
5852
|
|
|
5821
5853
|
// Copyright (c) Microsoft Corporation.
|
|
@@ -6177,6 +6209,32 @@ class QueueServiceClient extends StorageClient {
|
|
|
6177
6209
|
resourceTypes, services: AccountSASServices.parse("q").toString() }, options), this.credential).toString();
|
|
6178
6210
|
return appendToURLQuery(this.url, sas);
|
|
6179
6211
|
}
|
|
6212
|
+
/**
|
|
6213
|
+
* Only available for QueueServiceClient constructed with a shared key credential.
|
|
6214
|
+
*
|
|
6215
|
+
* Generates string to sign for an account Shared Access Signature (SAS) URI based on the client properties
|
|
6216
|
+
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
|
6217
|
+
*
|
|
6218
|
+
* @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas
|
|
6219
|
+
*
|
|
6220
|
+
* @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not specified.
|
|
6221
|
+
* @param permissions - Specifies the list of permissions to be associated with the SAS.
|
|
6222
|
+
* @param resourceTypes - Specifies the resource types associated with the shared access signature.
|
|
6223
|
+
* @param options - Optional parameters.
|
|
6224
|
+
* @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
6225
|
+
*/
|
|
6226
|
+
generateSasStringToSign(expiresOn, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) {
|
|
6227
|
+
if (!(this.credential instanceof StorageSharedKeyCredential)) {
|
|
6228
|
+
throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential");
|
|
6229
|
+
}
|
|
6230
|
+
if (expiresOn === undefined) {
|
|
6231
|
+
const now = new Date();
|
|
6232
|
+
expiresOn = new Date(now.getTime() + 3600 * 1000);
|
|
6233
|
+
}
|
|
6234
|
+
return generateAccountSASQueryParametersInternal(Object.assign({ permissions,
|
|
6235
|
+
expiresOn,
|
|
6236
|
+
resourceTypes, services: AccountSASServices.parse("q").toString() }, options), this.credential).stringToSign;
|
|
6237
|
+
}
|
|
6180
6238
|
}
|
|
6181
6239
|
|
|
6182
6240
|
Object.defineProperty(exports, "RestError", {
|