@azure/storage-queue 12.28.1 → 12.29.0-alpha.20251128.2
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/QueueClient.d.ts +25 -1
- package/dist/browser/QueueClient.d.ts.map +1 -1
- package/dist/browser/QueueClient.js +35 -0
- package/dist/browser/QueueClient.js.map +1 -1
- package/dist/browser/QueueSASSignatureValues.d.ts +9 -2
- package/dist/browser/QueueSASSignatureValues.d.ts.map +1 -1
- package/dist/browser/QueueSASSignatureValues.js +72 -19
- package/dist/browser/QueueSASSignatureValues.js.map +1 -1
- package/dist/browser/QueueServiceClient.d.ts +23 -1
- package/dist/browser/QueueServiceClient.d.ts.map +1 -1
- package/dist/browser/QueueServiceClient.js +41 -1
- package/dist/browser/QueueServiceClient.js.map +1 -1
- package/dist/browser/SASQueryParameters.d.ts +38 -1
- package/dist/browser/SASQueryParameters.d.ts.map +1 -1
- package/dist/browser/SASQueryParameters.js +87 -2
- package/dist/browser/SASQueryParameters.js.map +1 -1
- package/dist/browser/generated/src/models/index.d.ts +66 -16
- 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 +4 -0
- package/dist/browser/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/browser/generated/src/models/mappers.js +641 -492
- package/dist/browser/generated/src/models/mappers.js.map +1 -1
- package/dist/browser/generated/src/models/parameters.d.ts +3 -1
- package/dist/browser/generated/src/models/parameters.d.ts.map +1 -1
- package/dist/browser/generated/src/models/parameters.js +107 -92
- package/dist/browser/generated/src/models/parameters.js.map +1 -1
- package/dist/browser/generated/src/operations/messageId.js +11 -11
- package/dist/browser/generated/src/operations/messageId.js.map +1 -1
- package/dist/browser/generated/src/operations/messages.js +33 -31
- package/dist/browser/generated/src/operations/messages.js.map +1 -1
- package/dist/browser/generated/src/operations/queue.js +38 -38
- package/dist/browser/generated/src/operations/queue.js.map +1 -1
- package/dist/browser/generated/src/operations/service.d.ts +8 -1
- package/dist/browser/generated/src/operations/service.d.ts.map +1 -1
- package/dist/browser/generated/src/operations/service.js +65 -25
- package/dist/browser/generated/src/operations/service.js.map +1 -1
- package/dist/browser/generated/src/operationsInterfaces/messageId.js.map +1 -1
- package/dist/browser/generated/src/operationsInterfaces/messages.js.map +1 -1
- package/dist/browser/generated/src/operationsInterfaces/queue.js.map +1 -1
- package/dist/browser/generated/src/operationsInterfaces/service.d.ts +8 -1
- package/dist/browser/generated/src/operationsInterfaces/service.d.ts.map +1 -1
- package/dist/browser/generated/src/operationsInterfaces/service.js.map +1 -1
- package/dist/browser/generated/src/storageClient.d.ts.map +1 -1
- package/dist/browser/generated/src/storageClient.js +6 -6
- package/dist/browser/generated/src/storageClient.js.map +1 -1
- package/dist/browser/generatedModels.d.ts +7 -2
- package/dist/browser/generatedModels.d.ts.map +1 -1
- package/dist/browser/generatedModels.js.map +1 -1
- package/dist/browser/index-browser.d.mts.map +1 -1
- package/dist/browser/index-browser.mjs.map +1 -1
- package/dist/browser/index.d.ts +1 -1
- 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/QueueClient.d.ts +25 -1
- package/dist/commonjs/QueueClient.d.ts.map +1 -1
- package/dist/commonjs/QueueClient.js +35 -0
- package/dist/commonjs/QueueClient.js.map +1 -1
- package/dist/commonjs/QueueSASSignatureValues.d.ts +9 -2
- package/dist/commonjs/QueueSASSignatureValues.d.ts.map +1 -1
- package/dist/commonjs/QueueSASSignatureValues.js +72 -19
- package/dist/commonjs/QueueSASSignatureValues.js.map +1 -1
- package/dist/commonjs/QueueServiceClient.d.ts +23 -1
- package/dist/commonjs/QueueServiceClient.d.ts.map +1 -1
- package/dist/commonjs/QueueServiceClient.js +40 -0
- package/dist/commonjs/QueueServiceClient.js.map +1 -1
- package/dist/commonjs/SASQueryParameters.d.ts +38 -1
- package/dist/commonjs/SASQueryParameters.d.ts.map +1 -1
- package/dist/commonjs/SASQueryParameters.js +87 -2
- package/dist/commonjs/SASQueryParameters.js.map +1 -1
- package/dist/commonjs/generated/src/models/index.d.ts +66 -16
- package/dist/commonjs/generated/src/models/index.d.ts.map +1 -1
- package/dist/commonjs/generated/src/models/index.js.map +1 -1
- package/dist/commonjs/generated/src/models/mappers.d.ts +4 -0
- package/dist/commonjs/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/commonjs/generated/src/models/mappers.js +643 -493
- package/dist/commonjs/generated/src/models/mappers.js.map +1 -1
- package/dist/commonjs/generated/src/models/parameters.d.ts +3 -1
- package/dist/commonjs/generated/src/models/parameters.d.ts.map +1 -1
- package/dist/commonjs/generated/src/models/parameters.js +107 -92
- package/dist/commonjs/generated/src/models/parameters.js.map +1 -1
- package/dist/commonjs/generated/src/operations/messageId.js +11 -11
- package/dist/commonjs/generated/src/operations/messageId.js.map +1 -1
- package/dist/commonjs/generated/src/operations/messages.js +33 -31
- package/dist/commonjs/generated/src/operations/messages.js.map +1 -1
- package/dist/commonjs/generated/src/operations/queue.js +38 -38
- package/dist/commonjs/generated/src/operations/queue.js.map +1 -1
- package/dist/commonjs/generated/src/operations/service.d.ts +8 -1
- package/dist/commonjs/generated/src/operations/service.d.ts.map +1 -1
- package/dist/commonjs/generated/src/operations/service.js +65 -25
- package/dist/commonjs/generated/src/operations/service.js.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/messageId.js.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/messages.js.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/queue.js.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/service.d.ts +8 -1
- package/dist/commonjs/generated/src/operationsInterfaces/service.d.ts.map +1 -1
- package/dist/commonjs/generated/src/operationsInterfaces/service.js.map +1 -1
- package/dist/commonjs/generated/src/storageClient.d.ts.map +1 -1
- package/dist/commonjs/generated/src/storageClient.js +5 -5
- package/dist/commonjs/generated/src/storageClient.js.map +1 -1
- package/dist/commonjs/generatedModels.d.ts +7 -2
- package/dist/commonjs/generatedModels.d.ts.map +1 -1
- package/dist/commonjs/generatedModels.js.map +1 -1
- package/dist/commonjs/index.d.ts +1 -1
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js.map +1 -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 +2 -2
- package/dist/commonjs/utils/constants.js.map +1 -1
- package/dist/esm/QueueClient.d.ts +25 -1
- package/dist/esm/QueueClient.d.ts.map +1 -1
- package/dist/esm/QueueClient.js +35 -0
- package/dist/esm/QueueClient.js.map +1 -1
- package/dist/esm/QueueSASSignatureValues.d.ts +9 -2
- package/dist/esm/QueueSASSignatureValues.d.ts.map +1 -1
- package/dist/esm/QueueSASSignatureValues.js +72 -19
- package/dist/esm/QueueSASSignatureValues.js.map +1 -1
- package/dist/esm/QueueServiceClient.d.ts +23 -1
- package/dist/esm/QueueServiceClient.d.ts.map +1 -1
- package/dist/esm/QueueServiceClient.js +41 -1
- package/dist/esm/QueueServiceClient.js.map +1 -1
- package/dist/esm/SASQueryParameters.d.ts +38 -1
- package/dist/esm/SASQueryParameters.d.ts.map +1 -1
- package/dist/esm/SASQueryParameters.js +87 -2
- package/dist/esm/SASQueryParameters.js.map +1 -1
- package/dist/esm/generated/src/models/index.d.ts +66 -16
- package/dist/esm/generated/src/models/index.d.ts.map +1 -1
- package/dist/esm/generated/src/models/index.js.map +1 -1
- package/dist/esm/generated/src/models/mappers.d.ts +4 -0
- package/dist/esm/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/esm/generated/src/models/mappers.js +641 -492
- package/dist/esm/generated/src/models/mappers.js.map +1 -1
- package/dist/esm/generated/src/models/parameters.d.ts +3 -1
- package/dist/esm/generated/src/models/parameters.d.ts.map +1 -1
- package/dist/esm/generated/src/models/parameters.js +107 -92
- package/dist/esm/generated/src/models/parameters.js.map +1 -1
- package/dist/esm/generated/src/operations/messageId.js +11 -11
- package/dist/esm/generated/src/operations/messageId.js.map +1 -1
- package/dist/esm/generated/src/operations/messages.js +33 -31
- package/dist/esm/generated/src/operations/messages.js.map +1 -1
- package/dist/esm/generated/src/operations/queue.js +38 -38
- package/dist/esm/generated/src/operations/queue.js.map +1 -1
- package/dist/esm/generated/src/operations/service.d.ts +8 -1
- package/dist/esm/generated/src/operations/service.d.ts.map +1 -1
- package/dist/esm/generated/src/operations/service.js +65 -25
- package/dist/esm/generated/src/operations/service.js.map +1 -1
- package/dist/esm/generated/src/operationsInterfaces/messageId.js.map +1 -1
- package/dist/esm/generated/src/operationsInterfaces/messages.js.map +1 -1
- package/dist/esm/generated/src/operationsInterfaces/queue.js.map +1 -1
- package/dist/esm/generated/src/operationsInterfaces/service.d.ts +8 -1
- package/dist/esm/generated/src/operationsInterfaces/service.d.ts.map +1 -1
- package/dist/esm/generated/src/operationsInterfaces/service.js.map +1 -1
- package/dist/esm/generated/src/storageClient.d.ts.map +1 -1
- package/dist/esm/generated/src/storageClient.js +6 -6
- package/dist/esm/generated/src/storageClient.js.map +1 -1
- package/dist/esm/generatedModels.d.ts +7 -2
- package/dist/esm/generatedModels.d.ts.map +1 -1
- package/dist/esm/generatedModels.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/constants.d.ts.map +1 -1
- package/dist/esm/utils/constants.js +2 -2
- package/dist/esm/utils/constants.js.map +1 -1
- package/dist/react-native/QueueClient.d.ts +25 -1
- package/dist/react-native/QueueClient.d.ts.map +1 -1
- package/dist/react-native/QueueClient.js +35 -0
- package/dist/react-native/QueueClient.js.map +1 -1
- package/dist/react-native/QueueSASSignatureValues.d.ts +9 -2
- package/dist/react-native/QueueSASSignatureValues.d.ts.map +1 -1
- package/dist/react-native/QueueSASSignatureValues.js +72 -19
- package/dist/react-native/QueueSASSignatureValues.js.map +1 -1
- package/dist/react-native/QueueServiceClient.d.ts +23 -1
- package/dist/react-native/QueueServiceClient.d.ts.map +1 -1
- package/dist/react-native/QueueServiceClient.js +41 -1
- package/dist/react-native/QueueServiceClient.js.map +1 -1
- package/dist/react-native/SASQueryParameters.d.ts +38 -1
- package/dist/react-native/SASQueryParameters.d.ts.map +1 -1
- package/dist/react-native/SASQueryParameters.js +87 -2
- package/dist/react-native/SASQueryParameters.js.map +1 -1
- package/dist/react-native/generated/src/models/index.d.ts +66 -16
- 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 +4 -0
- package/dist/react-native/generated/src/models/mappers.d.ts.map +1 -1
- package/dist/react-native/generated/src/models/mappers.js +641 -492
- package/dist/react-native/generated/src/models/mappers.js.map +1 -1
- package/dist/react-native/generated/src/models/parameters.d.ts +3 -1
- package/dist/react-native/generated/src/models/parameters.d.ts.map +1 -1
- package/dist/react-native/generated/src/models/parameters.js +107 -92
- package/dist/react-native/generated/src/models/parameters.js.map +1 -1
- package/dist/react-native/generated/src/operations/messageId.js +11 -11
- package/dist/react-native/generated/src/operations/messageId.js.map +1 -1
- package/dist/react-native/generated/src/operations/messages.js +33 -31
- package/dist/react-native/generated/src/operations/messages.js.map +1 -1
- package/dist/react-native/generated/src/operations/queue.js +38 -38
- package/dist/react-native/generated/src/operations/queue.js.map +1 -1
- package/dist/react-native/generated/src/operations/service.d.ts +8 -1
- package/dist/react-native/generated/src/operations/service.d.ts.map +1 -1
- package/dist/react-native/generated/src/operations/service.js +65 -25
- package/dist/react-native/generated/src/operations/service.js.map +1 -1
- package/dist/react-native/generated/src/operationsInterfaces/messageId.js.map +1 -1
- package/dist/react-native/generated/src/operationsInterfaces/messages.js.map +1 -1
- package/dist/react-native/generated/src/operationsInterfaces/queue.js.map +1 -1
- package/dist/react-native/generated/src/operationsInterfaces/service.d.ts +8 -1
- package/dist/react-native/generated/src/operationsInterfaces/service.d.ts.map +1 -1
- package/dist/react-native/generated/src/operationsInterfaces/service.js.map +1 -1
- package/dist/react-native/generated/src/storageClient.d.ts.map +1 -1
- package/dist/react-native/generated/src/storageClient.js +6 -6
- package/dist/react-native/generated/src/storageClient.js.map +1 -1
- package/dist/react-native/generatedModels.d.ts +7 -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 +1 -1
- package/dist/react-native/index.d.ts.map +1 -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 +24 -24
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TokenCredential } from "@azure/core-auth";
|
|
2
|
-
import type { QueueCreateResponse, QueueDeleteResponse, QueueItem, QueueServiceProperties, ServiceGetPropertiesResponse, ServiceGetStatisticsResponse, ServiceListQueuesSegmentResponse, ServiceSetPropertiesResponse } from "./generatedModels.js";
|
|
2
|
+
import type { QueueCreateResponse, QueueDeleteResponse, QueueItem, QueueServiceProperties, ServiceGetPropertiesResponse, ServiceGetStatisticsResponse, ServiceListQueuesSegmentResponse, ServiceSetPropertiesResponse, ServiceGetUserDelegationKeyResponse } from "./generatedModels.js";
|
|
3
3
|
import type { AbortSignalLike } from "@azure/abort-controller";
|
|
4
4
|
import type { StoragePipelineOptions, Pipeline } from "./Pipeline.js";
|
|
5
5
|
import type { CommonOptions } from "./StorageClient.js";
|
|
@@ -84,6 +84,16 @@ export interface ServiceGenerateAccountSasUrlOptions {
|
|
|
84
84
|
*/
|
|
85
85
|
ipRange?: SasIPRange;
|
|
86
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Options to configure the Service - Get User Delegation Key.
|
|
89
|
+
*/
|
|
90
|
+
export interface ServiceGetUserDelegationKeyOptions extends CommonOptions {
|
|
91
|
+
/**
|
|
92
|
+
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
|
|
93
|
+
* For example, use the @azure/abort-controller to create an `AbortSignal`.
|
|
94
|
+
*/
|
|
95
|
+
abortSignal?: AbortSignalLike;
|
|
96
|
+
}
|
|
87
97
|
/**
|
|
88
98
|
* A QueueServiceClient represents a URL to the Azure Storage Queue service allowing you
|
|
89
99
|
* to manipulate queues.
|
|
@@ -407,5 +417,17 @@ export declare class QueueServiceClient extends StorageClient {
|
|
|
407
417
|
* @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
408
418
|
*/
|
|
409
419
|
generateSasStringToSign(expiresOn?: Date, permissions?: AccountSASPermissions, resourceTypes?: string, options?: ServiceGenerateAccountSasUrlOptions): string;
|
|
420
|
+
/**
|
|
421
|
+
* ONLY AVAILABLE WHEN USING BEARER TOKEN AUTHENTICATION (TokenCredential).
|
|
422
|
+
*
|
|
423
|
+
* Retrieves a user delegation key for the Queue service. This is only a valid operation when using
|
|
424
|
+
* bearer token authentication.
|
|
425
|
+
*
|
|
426
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-user-delegation-key
|
|
427
|
+
*
|
|
428
|
+
* @param startsOn - The start time for the user delegation SAS. Must be within 7 days of the current time
|
|
429
|
+
* @param expiresOn - The end time for the user delegation SAS. Must be within 7 days of the current time
|
|
430
|
+
*/
|
|
431
|
+
getUserDelegationKey(startsOn: Date, expiresOn: Date, options?: ServiceGetUserDelegationKeyOptions): Promise<ServiceGetUserDelegationKeyResponse>;
|
|
410
432
|
}
|
|
411
433
|
//# sourceMappingURL=QueueServiceClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueueServiceClient.d.ts","sourceRoot":"","sources":["../../src/QueueServiceClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGxD,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB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AAE,mCAAwC,GAChD,MAAM;IAwBT;;;;;;;;;;OAUG;IACU,oBAAoB,CAC/B,QAAQ,EAAE,IAAI,EACd,SAAS,EAAE,IAAI,EACf,OAAO,GAAE,kCAAuC,GAC/C,OAAO,CAAC,mCAAmC,CAAC;CA6ChD"}
|
|
@@ -442,6 +442,46 @@ class QueueServiceClient extends StorageClient_js_1.StorageClient {
|
|
|
442
442
|
...options,
|
|
443
443
|
}, this.credential).stringToSign;
|
|
444
444
|
}
|
|
445
|
+
/**
|
|
446
|
+
* ONLY AVAILABLE WHEN USING BEARER TOKEN AUTHENTICATION (TokenCredential).
|
|
447
|
+
*
|
|
448
|
+
* Retrieves a user delegation key for the Queue service. This is only a valid operation when using
|
|
449
|
+
* bearer token authentication.
|
|
450
|
+
*
|
|
451
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-user-delegation-key
|
|
452
|
+
*
|
|
453
|
+
* @param startsOn - The start time for the user delegation SAS. Must be within 7 days of the current time
|
|
454
|
+
* @param expiresOn - The end time for the user delegation SAS. Must be within 7 days of the current time
|
|
455
|
+
*/
|
|
456
|
+
async getUserDelegationKey(startsOn, expiresOn, options = {}) {
|
|
457
|
+
return tracing_js_1.tracingClient.withSpan("QueueServiceClient-getUserDelegationKey", options, async (updatedOptions) => {
|
|
458
|
+
const response = (0, utils_common_js_1.assertResponse)(await this.serviceContext.getUserDelegationKey({
|
|
459
|
+
start: (0, utils_common_js_1.truncatedISO8061Date)(startsOn, false),
|
|
460
|
+
expiry: (0, utils_common_js_1.truncatedISO8061Date)(expiresOn, false),
|
|
461
|
+
}, {
|
|
462
|
+
abortSignal: options.abortSignal,
|
|
463
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
464
|
+
}));
|
|
465
|
+
const userDelegationKey = {
|
|
466
|
+
signedObjectId: response.signedOid,
|
|
467
|
+
signedTenantId: response.signedTid,
|
|
468
|
+
signedStartsOn: new Date(response.signedStart),
|
|
469
|
+
signedExpiresOn: new Date(response.signedExpiry),
|
|
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
|
+
});
|
|
484
|
+
}
|
|
445
485
|
}
|
|
446
486
|
exports.QueueServiceClient = QueueServiceClient;
|
|
447
487
|
//# sourceMappingURL=QueueServiceClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueueServiceClient.js","sourceRoot":"","sources":["../../src/QueueServiceClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAGlC,gDAAqD;AACrD,gDAA8C;AAoB9C,+CAA4D;AAE5D,yDAAmD;AAEnD,6DAKiC;AACjC,0DAAmE;AACnE,0DAA4D;AAC5D,mDAAmD;AAEnD,qDAA+C;AAC/C,yEAAmE;AACnE,iFAGwC;AACxC,mEAA6D;AAG7D,kEAAoE;AAsHpE;;;GAGG;AACH,MAAa,kBAAmB,SAAQ,gCAAa;IACnD;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,oBAAoB,CAChC,gBAAwB;IACxB,2FAA2F;IAC3F,iEAAiE;IACjE,OAAgC;QAEhC,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;QACxB,MAAM,cAAc,GAAG,IAAA,8CAA4B,EAAC,gBAAgB,CAAC,CAAC;QACtE,IAAI,cAAc,CAAC,IAAI,KAAK,mBAAmB,EAAE,CAAC;YAChD,IAAI,sBAAU,EAAE,CAAC;gBACf,MAAM,mBAAmB,GAAG,IAAI,2CAA0B,CACxD,cAAc,CAAC,WAAY,EAC3B,cAAc,CAAC,UAAU,CAC1B,CAAC;gBACF,IAAI,CAAC,OAAO,CAAC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C,UAAU,CAChB,CAAC,QAAQ,EAAE,CAAC;QAEb,OAAO,IAAA,kCAAgB,EAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;IAED;;;;;;;;;;;;;OAaG;IACI,uBAAuB,CAC5B,SAAgB,EAChB,cAAqC,gDAAqB,CAAC,KAAK,CAAC,GAAG,CAAC,EACrE,gBAAwB,KAAK,EAC7B,UAA+C,EAAE;QAEjD,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,YAAY,2CAA0B,CAAC,EAAE,CAAC;YAC7D,MAAM,UAAU,CACd,+FAA+F,CAChG,CAAC;QACJ,CAAC;QAED,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,SAAS,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;QACpD,CAAC;QAED,OAAO,IAAA,wEAAyC,EAC9C;YACE,WAAW;YACX,SAAS;YACT,aAAa;YACb,QAAQ,EAAE,0CAAkB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;YAClD,GAAG,OAAO;SACX,EACD,IAAI,CAAC,UAAU,CAChB,CAAC,YAAY,CAAC;IACjB,CAAC;CACF;AA9lBD,gDA8lBC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport { isNodeLike } from \"@azure/core-util\";\nimport type {\n QueueCreateResponse,\n QueueDeleteResponse,\n QueueItem,\n QueueServiceProperties,\n ServiceGetPropertiesResponse,\n ServiceGetPropertiesHeaders,\n ServiceGetStatisticsResponse,\n ServiceListQueuesSegmentResponse,\n ServiceSetPropertiesResponse,\n ServiceListQueuesSegmentHeaders,\n ListQueuesSegmentResponse,\n ServiceSetPropertiesHeaders,\n ServiceGetStatisticsHeaders,\n QueueServiceStatistics,\n} from \"./generatedModels.js\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { Service } from \"./generated/src/operationsInterfaces/index.js\";\nimport type { StoragePipelineOptions, Pipeline } from \"./Pipeline.js\";\nimport { newPipeline, isPipelineLike } from \"./Pipeline.js\";\nimport type { CommonOptions } from \"./StorageClient.js\";\nimport { StorageClient } from \"./StorageClient.js\";\nimport type { PageSettings, PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport {\n appendToURLPath,\n appendToURLQuery,\n extractConnectionStringParts,\n assertResponse,\n} from \"./utils/utils.common.js\";\nimport { StorageSharedKeyCredential } from \"@azure/storage-common\";\nimport { AnonymousCredential } from \"@azure/storage-common\";\nimport { tracingClient } from \"./utils/tracing.js\";\nimport type { QueueCreateOptions, QueueDeleteOptions } from \"./QueueClient.js\";\nimport { QueueClient } from \"./QueueClient.js\";\nimport { AccountSASPermissions } from \"./AccountSASPermissions.js\";\nimport {\n generateAccountSASQueryParameters,\n generateAccountSASQueryParametersInternal,\n} from \"./AccountSASSignatureValues.js\";\nimport { AccountSASServices } from \"./AccountSASServices.js\";\nimport type { SASProtocol } from \"./SASQueryParameters.js\";\nimport type { SasIPRange } from \"./SasIPRange.js\";\nimport { getDefaultProxySettings } from \"@azure/core-rest-pipeline\";\n\n/**\n * Options to configure {@link QueueServiceClient.getProperties} operation\n */\nexport interface ServiceGetPropertiesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure {@link QueueServiceClient.setProperties} operation\n */\nexport interface ServiceSetPropertiesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure {@link QueueServiceClient.getStatistics} operation\n */\nexport interface ServiceGetStatisticsOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure Queue Service - List Queues Segment operation\n *\n * See:\n * - {@link QueueServiceClient.listSegments}\n * - {@link QueueServiceClient.listQueuesSegment}\n * - {@link QueueServiceClient.listItems}\n */\ninterface ServiceListQueuesSegmentOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Filters the results to return only queues\n * whose name begins with the specified prefix.\n */\n prefix?: string;\n /**\n * Specifies the maximum number of queues\n * to return. If the request does not specify maxPageSize, or specifies a\n * value greater than 5000, the server will return up to 5000 items. Note\n * that if the listing operation crosses a partition boundary, then the\n * service will return a continuation token for retrieving the remainder of\n * the results. For this reason, it is possible that the service will return\n * fewer results than specified by maxPageSize, or than the default of 5000.\n */\n maxPageSize?: number;\n /**\n * Include this parameter to\n * specify that the queue's metadata be returned as part of the response\n * body. Possible values include: 'metadata'\n */\n include?: string;\n}\n\n/**\n * Options to configure {@link QueueServiceClient.listQueues} operation\n */\nexport interface ServiceListQueuesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Filters the results to return only queues\n * whose name begins with the specified prefix.\n */\n prefix?: string;\n /**\n * Specifies whether the queue's metadata be returned as part of the response\n * body.\n */\n includeMetadata?: boolean;\n}\n\n/**\n * Options to configure {@link QueueServiceClient.generateAccountSasUrl} operation.\n */\nexport interface ServiceGenerateAccountSasUrlOptions {\n /**\n * The version of the service this SAS will target. If not specified, it will default to the version targeted by the\n * library.\n */\n version?: string;\n\n /**\n * Optional. SAS protocols allowed.\n */\n protocol?: SASProtocol;\n\n /**\n * Optional. When the SAS will take effect.\n */\n startsOn?: Date;\n /**\n * Optional. IP range allowed.\n */\n ipRange?: SasIPRange;\n}\n\n/**\n * A QueueServiceClient represents a URL to the Azure Storage Queue service allowing you\n * to manipulate queues.\n */\nexport class QueueServiceClient extends StorageClient {\n /**\n * Creates an instance of QueueServiceClient.\n *\n * @param connectionString - Account connection string or a SAS connection string of an Azure storage account.\n * [ Note - Account connection string can only be used in NODE.JS runtime. ]\n * Account connection string example -\n * `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`\n * SAS connection string example -\n * `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`\n * @param options - Options to configure the HTTP pipeline.\n * @returns A new QueueServiceClient object from the given connection string.\n */\n public static fromConnectionString(\n connectionString: string,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: StoragePipelineOptions,\n ): QueueServiceClient {\n options = options || {};\n const extractedCreds = extractConnectionStringParts(connectionString);\n if (extractedCreds.kind === \"AccountConnString\") {\n if (isNodeLike) {\n const sharedKeyCredential = new StorageSharedKeyCredential(\n extractedCreds.accountName!,\n extractedCreds.accountKey,\n );\n if (!options.proxyOptions) {\n options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri);\n }\n const pipeline = newPipeline(sharedKeyCredential, options);\n return new QueueServiceClient(extractedCreds.url, pipeline);\n } else {\n throw new Error(\"Account connection string is only supported in Node.js environment\");\n }\n } else if (extractedCreds.kind === \"SASConnString\") {\n const pipeline = newPipeline(new AnonymousCredential(), options);\n return new QueueServiceClient(extractedCreds.url + \"?\" + extractedCreds.accountSas, pipeline);\n } else {\n throw new Error(\n \"Connection string must be either an Account connection string or a SAS connection string\",\n );\n }\n }\n\n /**\n * serviceContext provided by protocol layer.\n */\n private serviceContext: Service;\n\n /**\n * Creates an instance of QueueServiceClient.\n *\n * @param url - A URL string pointing to Azure Storage queue service, such as\n * \"https://myaccount.queue.core.windows.net\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.queue.core.windows.net?sasString\".\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param options - Options to configure the HTTP pipeline.\n *\n * Example using DefaultAzureCredential from `@azure/identity`:\n *\n * ```ts snippet:ReadmeSampleCreateClient_DefaultAzureCredential\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { QueueServiceClient } from \"@azure/storage-queue\";\n *\n * const account = \"<account>\";\n * const credential = new DefaultAzureCredential();\n *\n * const queueServiceClient = new QueueServiceClient(\n * `https://${account}.queue.core.windows.net`,\n * credential,\n * );\n * ```\n *\n * Example using an account name/key:\n *\n * ```ts snippet:ReadmeSampleCreateClient_StorageSharedKeyCredential\n * import { StorageSharedKeyCredential, QueueServiceClient } from \"@azure/storage-queue\";\n *\n * // Enter your storage account name and shared key\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n *\n * // Use StorageSharedKeyCredential with storage account and account key\n * // StorageSharedKeyCredential is only available in Node.js runtime, not in browsers\n * const sharedKeyCredential = new StorageSharedKeyCredential(account, accountKey);\n *\n * const queueServiceClient = new QueueServiceClient(\n * `https://${account}.queue.core.windows.net`,\n * sharedKeyCredential,\n * {\n * retryOptions: { maxTries: 4 }, // Retry options\n * userAgentOptions: {\n * userAgentPrefix: \"BasicSample V10.0.0\",\n * }, // Customized telemetry string\n * },\n * );\n * ```\n */\n constructor(\n url: string,\n credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: StoragePipelineOptions,\n );\n /**\n * Creates an instance of QueueServiceClient.\n *\n * @param url - A URL string pointing to Azure Storage queue service, such as\n * \"https://myaccount.queue.core.windows.net\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.queue.core.windows.net?sasString\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n */\n constructor(url: string, pipeline: Pipeline);\n constructor(\n url: string,\n credentialOrPipeline?:\n | StorageSharedKeyCredential\n | AnonymousCredential\n | TokenCredential\n | Pipeline,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: StoragePipelineOptions,\n ) {\n let pipeline: Pipeline;\n if (isPipelineLike(credentialOrPipeline)) {\n pipeline = credentialOrPipeline;\n } else if (\n (isNodeLike && credentialOrPipeline instanceof StorageSharedKeyCredential) ||\n credentialOrPipeline instanceof AnonymousCredential ||\n isTokenCredential(credentialOrPipeline)\n ) {\n pipeline = newPipeline(credentialOrPipeline, options);\n } else {\n // The second parameter is undefined. Use anonymous credential.\n pipeline = newPipeline(new AnonymousCredential(), options);\n }\n super(url, pipeline);\n this.serviceContext = this.storageClientContext.service;\n }\n\n /**\n * Creates a {@link QueueClient} object.\n *\n * @param queueName -\n * @returns a new QueueClient\n *\n * Example usage:\n *\n * ```ts snippet:ReadmeSampleCreateQueue\n * import { QueueServiceClient } from \"@azure/storage-queue\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const account = \"<account>\";\n * const queueServiceClient = new QueueServiceClient(\n * `https://${account}.queue.core.windows.net`,\n * new DefaultAzureCredential(),\n * );\n *\n * const queueName = \"<valid queue name>\";\n * const queueClient = queueServiceClient.getQueueClient(queueName);\n * const createQueueResponse = await queueClient.create();\n * console.log(\n * `Created queue ${queueName} successfully, service assigned request Id: ${createQueueResponse.requestId}`,\n * );\n * ```\n */\n public getQueueClient(queueName: string): QueueClient {\n return new QueueClient(appendToURLPath(this.url, queueName), this.pipeline);\n }\n\n /**\n * Returns a list of the queues under the specified account.\n * @see https://learn.microsoft.com/rest/api/storageservices/list-queues1\n *\n * @param marker - A string value that identifies the portion of\n * the list of queues to be returned with the next listing operation. The\n * operation returns the continuationToken value within the response body if the\n * listing operation did not return all queues remaining to be listed\n * with the current page. The continuationToken value can be used as the value for\n * the marker parameter in a subsequent call to request the next page of list\n * items. The marker value is opaque to the client.\n * @param options - Options to list queues operation.\n * @returns Response data for the list queues segment operation.\n */\n private async listQueuesSegment(\n marker?: string,\n options: ServiceListQueuesSegmentOptions = {},\n ): Promise<ServiceListQueuesSegmentResponse> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n return tracingClient.withSpan(\n \"QueueServiceClient-listQueuesSegment\",\n options,\n async (updatedOptions) => {\n return assertResponse<\n ServiceListQueuesSegmentHeaders & ListQueuesSegmentResponse,\n ServiceListQueuesSegmentHeaders,\n ListQueuesSegmentResponse\n >(\n await this.serviceContext.listQueuesSegment({\n ...updatedOptions,\n marker,\n include: options.include === undefined ? undefined : [options.include],\n }),\n );\n },\n );\n }\n\n /**\n * Returns an AsyncIterableIterator for {@link ServiceListQueuesSegmentResponse} objects\n *\n * @param marker - A string value that identifies the portion of\n * the list of queues to be returned with the next listing operation. The\n * operation returns the continuationToken value within the response body if the\n * listing operation did not return all queues remaining to be listed\n * with the current page. The continuationToken value can be used as the value for\n * the marker parameter in a subsequent call to request the next page of list\n * items. The marker value is opaque to the client.\n * @param options - Options to list queues operation.\n */\n private async *listSegments(\n marker?: string,\n options: ServiceListQueuesSegmentOptions = {},\n ): AsyncIterableIterator<ServiceListQueuesSegmentResponse> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n let listQueuesResponse;\n do {\n listQueuesResponse = await this.listQueuesSegment(marker, options);\n marker = listQueuesResponse.continuationToken;\n yield await listQueuesResponse;\n } while (marker);\n }\n\n /**\n * Returns an AsyncIterableIterator for {@link QueueItem} objects\n *\n * @param options - Options to list queues operation.\n */\n private async *listItems(\n options: ServiceListQueuesSegmentOptions = {},\n ): AsyncIterableIterator<QueueItem> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n let marker: string | undefined;\n for await (const segment of this.listSegments(marker, options)) {\n if (segment.queueItems) {\n yield* segment.queueItems;\n }\n }\n }\n\n /**\n * Returns an async iterable iterator to list all the queues\n * under the specified account.\n *\n * .byPage() returns an async iterable iterator to list the queues in pages.\n *\n * Example using `for await` syntax:\n *\n * ```ts snippet:ReadmeSampleListQueues\n * import { QueueServiceClient } from \"@azure/storage-queue\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const account = \"<account>\";\n * const queueServiceClient = new QueueServiceClient(\n * `https://${account}.queue.core.windows.net`,\n * new DefaultAzureCredential(),\n * );\n *\n * let i = 1;\n * for await (const item of queueServiceClient.listQueues()) {\n * console.log(`Queue${i++}: ${item.name}`);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```ts snippet:ReadmeSampleListQueues_Iterator\n * import { QueueServiceClient } from \"@azure/storage-queue\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const account = \"<account>\";\n * const queueServiceClient = new QueueServiceClient(\n * `https://${account}.queue.core.windows.net`,\n * new DefaultAzureCredential(),\n * );\n *\n * let i = 1;\n * const iterator = queueServiceClient.listQueues();\n * let { done, value } = await iterator.next();\n * while (!done) {\n * console.log(`Queue${i++}: ${value.name}`);\n * ({ done, value } = await iterator.next());\n * }\n * ```\n *\n * Example using `byPage()`:\n *\n * ```ts snippet:ReadmeSampleListQueues_ByPage\n * import { QueueServiceClient } from \"@azure/storage-queue\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const account = \"<account>\";\n * const queueServiceClient = new QueueServiceClient(\n * `https://${account}.queue.core.windows.net`,\n * new DefaultAzureCredential(),\n * );\n *\n * let i = 1;\n * for await (const page of queueServiceClient.listQueues().byPage({ maxPageSize: 20 })) {\n * for (const item of page.queueItems || []) {\n * console.log(`Queue${i++}: ${item.name}`);\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```ts snippet:ReadmeSampleListQueues_Continuation\n * import { QueueServiceClient } from \"@azure/storage-queue\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const account = \"<account>\";\n * const queueServiceClient = new QueueServiceClient(\n * `https://${account}.queue.core.windows.net`,\n * new DefaultAzureCredential(),\n * );\n *\n * let i = 1;\n * let iterator = queueServiceClient.listQueues().byPage({ maxPageSize: 2 });\n * let response = (await iterator.next()).value;\n * // Prints 2 queues\n * if (response.queueItems) {\n * for (const item of response.queueItems) {\n * console.log(`Queue${i++}: ${item.name}`);\n * }\n * }\n * // Gets next marker\n * let marker = response.continuationToken;\n * // Passing next marker as continuationToken\n * iterator = queueServiceClient.listQueues().byPage({ continuationToken: marker, maxPageSize: 10 });\n * response = (await iterator.next()).value;\n * // Prints 10 queues\n * if (response.queueItems) {\n * for (const item of response.queueItems) {\n * console.log(`Queue${i++}: ${item.name}`);\n * }\n * }\n * ```\n *\n * @param options - Options to list queues operation.\n * @returns An asyncIterableIterator that supports paging.\n */\n public listQueues(\n options: ServiceListQueuesOptions = {},\n ): PagedAsyncIterableIterator<QueueItem, ServiceListQueuesSegmentResponse> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n const updatedOptions: ServiceListQueuesSegmentOptions = {\n ...options,\n ...(options.includeMetadata ? { include: \"metadata\" } : {}),\n };\n\n // AsyncIterableIterator to iterate over queues\n const iter = this.listItems(updatedOptions);\n return {\n /**\n * The next method, part of the iteration protocol\n */\n next() {\n return iter.next();\n },\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator]() {\n return this;\n },\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings: PageSettings = {}) => {\n return this.listSegments(settings.continuationToken, {\n maxPageSize: settings.maxPageSize,\n ...updatedOptions,\n });\n },\n };\n }\n\n /**\n * Gets the properties of a storage account’s Queue service, including properties\n * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.\n * @see https://learn.microsoft.com/rest/api/storageservices/get-queue-service-properties\n *\n * @param options - Options to get properties operation.\n * @returns Response data including the queue service properties.\n */\n public async getProperties(\n options: ServiceGetPropertiesOptions = {},\n ): Promise<ServiceGetPropertiesResponse> {\n return tracingClient.withSpan(\n \"QueueServiceClient-getProperties\",\n options,\n async (updatedOptions) => {\n return assertResponse<\n ServiceGetPropertiesHeaders & QueueServiceProperties,\n ServiceGetPropertiesHeaders,\n QueueServiceProperties\n >(await this.serviceContext.getProperties(updatedOptions));\n },\n );\n }\n\n /**\n * Sets properties for a storage account’s Queue service endpoint, including properties\n * for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings.\n * @see https://learn.microsoft.com/rest/api/storageservices/set-queue-service-properties\n *\n * @param properties -\n * @param options - Options to set properties operation.\n * @returns Response data for the Set Properties operation.\n */\n public async setProperties(\n properties: QueueServiceProperties,\n options: ServiceGetPropertiesOptions = {},\n ): Promise<ServiceSetPropertiesResponse> {\n return tracingClient.withSpan(\n \"QueueServiceClient-setProperties\",\n options,\n async (updatedOptions) => {\n return assertResponse<ServiceSetPropertiesHeaders, ServiceSetPropertiesHeaders>(\n await this.serviceContext.setProperties(properties, updatedOptions),\n );\n },\n );\n }\n\n /**\n * Retrieves statistics related to replication for the Queue service. It is only\n * available on the secondary location endpoint when read-access geo-redundant\n * replication is enabled for the storage account.\n * @see https://learn.microsoft.com/rest/api/storageservices/get-queue-service-stats\n *\n * @param options - Options to get statistics operation.\n * @returns Response data for get statistics the operation.\n */\n public async getStatistics(\n options: ServiceGetStatisticsOptions = {},\n ): Promise<ServiceGetStatisticsResponse> {\n return tracingClient.withSpan(\n \"QueueServiceClient-getStatistics\",\n options,\n async (updatedOptions) => {\n return assertResponse<\n ServiceGetStatisticsHeaders & QueueServiceStatistics,\n ServiceGetStatisticsHeaders,\n QueueServiceStatistics\n >(await this.serviceContext.getStatistics(updatedOptions));\n },\n );\n }\n\n /**\n * Creates a new queue under the specified account.\n * @see https://learn.microsoft.com/rest/api/storageservices/create-queue4\n *\n * @param queueName - name of the queue to create\n * @param options - Options to Queue create operation.\n * @returns Response data for the Queue create operation.\n */\n public async createQueue(\n queueName: string,\n options: QueueCreateOptions = {},\n ): Promise<QueueCreateResponse> {\n return tracingClient.withSpan(\n \"QueueServiceClient-createQueue\",\n options,\n async (updatedOptions) => {\n return this.getQueueClient(queueName).create(updatedOptions);\n },\n );\n }\n\n /**\n * Deletes the specified queue permanently.\n * @see https://learn.microsoft.com/rest/api/storageservices/delete-queue3\n *\n * @param queueName - name of the queue to delete.\n * @param options - Options to Queue delete operation.\n * @returns Response data for the Queue delete operation.\n */\n public async deleteQueue(\n queueName: string,\n options: QueueDeleteOptions = {},\n ): Promise<QueueDeleteResponse> {\n return tracingClient.withSpan(\n \"QueueServiceClient-deleteQueue\",\n options,\n async (updatedOptions) => {\n return this.getQueueClient(queueName).delete(updatedOptions);\n },\n );\n }\n\n /**\n * Only available for QueueServiceClient constructed with a shared key credential.\n *\n * Generates an account Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas\n *\n * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not specified.\n * @param permissions - Specifies the list of permissions to be associated with the SAS.\n * @param resourceTypes - Specifies the resource types associated with the shared access signature.\n * @param options - Optional parameters.\n * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n public generateAccountSasUrl(\n expiresOn?: Date,\n permissions: AccountSASPermissions = AccountSASPermissions.parse(\"r\"),\n resourceTypes: string = \"sco\",\n options: ServiceGenerateAccountSasUrlOptions = {},\n ): string {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the account SAS when the client is initialized with a shared key credential\",\n );\n }\n\n if (expiresOn === undefined) {\n const now = new Date();\n expiresOn = new Date(now.getTime() + 3600 * 1000);\n }\n\n const sas = generateAccountSASQueryParameters(\n {\n permissions,\n expiresOn,\n resourceTypes,\n services: AccountSASServices.parse(\"q\").toString(),\n ...options,\n },\n this.credential,\n ).toString();\n\n return appendToURLQuery(this.url, sas);\n }\n\n /**\n * Only available for QueueServiceClient constructed with a shared key credential.\n *\n * Generates string to sign for an account Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas\n *\n * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not specified.\n * @param permissions - Specifies the list of permissions to be associated with the SAS.\n * @param resourceTypes - Specifies the resource types associated with the shared access signature.\n * @param options - Optional parameters.\n * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n public generateSasStringToSign(\n expiresOn?: Date,\n permissions: AccountSASPermissions = AccountSASPermissions.parse(\"r\"),\n resourceTypes: string = \"sco\",\n options: ServiceGenerateAccountSasUrlOptions = {},\n ): string {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the account SAS when the client is initialized with a shared key credential\",\n );\n }\n\n if (expiresOn === undefined) {\n const now = new Date();\n expiresOn = new Date(now.getTime() + 3600 * 1000);\n }\n\n return generateAccountSASQueryParametersInternal(\n {\n permissions,\n expiresOn,\n resourceTypes,\n services: AccountSASServices.parse(\"q\").toString(),\n ...options,\n },\n this.credential,\n ).stringToSign;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"QueueServiceClient.js","sourceRoot":"","sources":["../../src/QueueServiceClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAGlC,gDAAqD;AACrD,gDAA8C;AAwB9C,+CAA4D;AAE5D,yDAAmD;AAEnD,6DAMiC;AACjC,0DAAmE;AACnE,0DAA4D;AAC5D,mDAAmD;AAEnD,qDAA+C;AAC/C,yEAAmE;AACnE,iFAGwC;AACx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YAEF,OAAO,GAAG,CAAC;QACb,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AA3pBD,gDA2pBC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport { isNodeLike } from \"@azure/core-util\";\nimport type {\n QueueCreateResponse,\n QueueDeleteResponse,\n QueueItem,\n QueueServiceProperties,\n ServiceGetPropertiesResponse,\n ServiceGetPropertiesHeaders,\n ServiceGetStatisticsResponse,\n ServiceListQueuesSegmentResponse,\n ServiceSetPropertiesResponse,\n ServiceListQueuesSegmentHeaders,\n ListQueuesSegmentResponse,\n ServiceSetPropertiesHeaders,\n ServiceGetStatisticsHeaders,\n QueueServiceStatistics,\n ServiceGetUserDelegationKeyResponse,\n ServiceGetUserDelegationKeyResponseModel,\n ServiceGetUserDelegationKeyHeaders,\n UserDelegationKeyModel,\n} from \"./generatedModels.js\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { Service } from \"./generated/src/operationsInterfaces/index.js\";\nimport type { StoragePipelineOptions, Pipeline } from \"./Pipeline.js\";\nimport { newPipeline, isPipelineLike } from \"./Pipeline.js\";\nimport type { CommonOptions } from \"./StorageClient.js\";\nimport { StorageClient } from \"./StorageClient.js\";\nimport type { PageSettings, PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport {\n appendToURLPath,\n appendToURLQuery,\n extractConnectionStringParts,\n assertResponse,\n truncatedISO8061Date,\n} from \"./utils/utils.common.js\";\nimport { StorageSharedKeyCredential } from \"@azure/storage-common\";\nimport { AnonymousCredential } from \"@azure/storage-common\";\nimport { tracingClient } from \"./utils/tracing.js\";\nimport type { QueueCreateOptions, QueueDeleteOptions } from \"./QueueClient.js\";\nimport { QueueClient } from \"./QueueClient.js\";\nimport { AccountSASPermissions } from \"./AccountSASPermissions.js\";\nimport {\n generateAccountSASQueryParameters,\n generateAccountSASQueryParametersInternal,\n} from \"./AccountSASSignatureValues.js\";\nimport { AccountSASServices } from \"./AccountSASServices.js\";\nimport type { SASProtocol } from \"./SASQueryParameters.js\";\nimport type { SasIPRange } from \"./SasIPRange.js\";\nimport { getDefaultProxySettings } from \"@azure/core-rest-pipeline\";\n\n/**\n * Options to configure {@link QueueServiceClient.getProperties} operation\n */\nexport interface ServiceGetPropertiesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure {@link QueueServiceClient.setProperties} operation\n */\nexport interface ServiceSetPropertiesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure {@link QueueServiceClient.getStatistics} operation\n */\nexport interface ServiceGetStatisticsOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure Queue Service - List Queues Segment operation\n *\n * See:\n * - {@link QueueServiceClient.listSegments}\n * - {@link QueueServiceClient.listQueuesSegment}\n * - {@link QueueServiceClient.listItems}\n */\ninterface ServiceListQueuesSegmentOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Filters the results to return only queues\n * whose name begins with the specified prefix.\n */\n prefix?: string;\n /**\n * Specifies the maximum number of queues\n * to return. If the request does not specify maxPageSize, or specifies a\n * value greater than 5000, the server will return up to 5000 items. Note\n * that if the listing operation crosses a partition boundary, then the\n * service will return a continuation token for retrieving the remainder of\n * the results. For this reason, it is possible that the service will return\n * fewer results than specified by maxPageSize, or than the default of 5000.\n */\n maxPageSize?: number;\n /**\n * Include this parameter to\n * specify that the queue's metadata be returned as part of the response\n * body. Possible values include: 'metadata'\n */\n include?: string;\n}\n\n/**\n * Options to configure {@link QueueServiceClient.listQueues} operation\n */\nexport interface ServiceListQueuesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Filters the results to return only queues\n * whose name begins with the specified prefix.\n */\n prefix?: string;\n /**\n * Specifies whether the queue's metadata be returned as part of the response\n * body.\n */\n includeMetadata?: boolean;\n}\n\n/**\n * Options to configure {@link QueueServiceClient.generateAccountSasUrl} operation.\n */\nexport interface ServiceGenerateAccountSasUrlOptions {\n /**\n * The version of the service this SAS will target. If not specified, it will default to the version targeted by the\n * library.\n */\n version?: string;\n\n /**\n * Optional. SAS protocols allowed.\n */\n protocol?: SASProtocol;\n\n /**\n * Optional. When the SAS will take effect.\n */\n startsOn?: Date;\n /**\n * Optional. IP range allowed.\n */\n ipRange?: SasIPRange;\n}\n\n/**\n * Options to configure the Service - Get User Delegation Key.\n */\nexport interface ServiceGetUserDelegationKeyOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the @azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * A QueueServiceClient represents a URL to the Azure Storage Queue service allowing you\n * to manipulate queues.\n */\nexport class QueueServiceClient extends StorageClient {\n /**\n * Creates an instance of QueueServiceClient.\n *\n * @param connectionString - Account connection string or a SAS connection string of an Azure storage account.\n * [ Note - Account connection string can only be used in NODE.JS runtime. ]\n * Account connection string example -\n * `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`\n * SAS connection string example -\n * `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`\n * @param options - Options to configure the HTTP pipeline.\n * @returns A new QueueServiceClient object from the given connection string.\n */\n public static fromConnectionString(\n connectionString: string,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: StoragePipelineOptions,\n ): QueueServiceClient {\n options = options || {};\n const extractedCreds = extractConnectionStringParts(connectionString);\n if (extractedCreds.kind === \"AccountConnString\") {\n if (isNodeLike) {\n const sharedKeyCredential = new StorageSharedKeyCredential(\n extractedCreds.accountName!,\n extractedCreds.accountKey,\n );\n if (!options.proxyOptions) {\n options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri);\n }\n const pipeline = newPipeline(sharedKeyCredential, options);\n return new QueueServiceClient(extractedCreds.url, pipeline);\n } else {\n throw new Error(\"Account connection string is only supported in Node.js environment\");\n }\n } else if (extractedCreds.kind === \"SASConnString\") {\n const pipeline = newPipeline(new AnonymousCredential(), options);\n return new QueueServiceClient(extractedCreds.url + \"?\" + extractedCreds.accountSas, pipeline);\n } else {\n throw new Error(\n \"Connection string must be either an Account connection string or a SAS connection string\",\n );\n }\n }\n\n /**\n * serviceContext provided by protocol layer.\n */\n private serviceContext: Service;\n\n /**\n * Creates an instance of QueueServiceClient.\n *\n * @param url - A URL string pointing to Azure Storage queue service, such as\n * \"https://myaccount.queue.core.windows.net\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.queue.core.windows.net?sasString\".\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param options - Options to configure the HTTP pipeline.\n *\n * Example using DefaultAzureCredential from `@azure/identity`:\n *\n * ```ts snippet:ReadmeSampleCreateClient_DefaultAzureCredential\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { QueueServiceClient } from \"@azure/storage-queue\";\n *\n * const account = \"<account>\";\n * const credential = new DefaultAzureCredential();\n *\n * const queueServiceClient = new QueueServiceClient(\n * `https://${account}.queue.core.windows.net`,\n * credential,\n * );\n * ```\n *\n * Example using an account name/key:\n *\n * ```ts snippet:ReadmeSampleCreateClient_StorageSharedKeyCredential\n * import { StorageSharedKeyCredential, QueueServiceClient } from \"@azure/storage-queue\";\n *\n * // Enter your storage account name and shared key\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n *\n * // Use StorageSharedKeyCredential with storage account and account key\n * // StorageSharedKeyCredential is only available in Node.js runtime, not in browsers\n * const sharedKeyCredential = new StorageSharedKeyCredential(account, accountKey);\n *\n * const queueServiceClient = new QueueServiceClient(\n * `https://${account}.queue.core.windows.net`,\n * sharedKeyCredential,\n * {\n * retryOptions: { maxTries: 4 }, // Retry options\n * userAgentOptions: {\n * userAgentPrefix: \"BasicSample V10.0.0\",\n * }, // Customized telemetry string\n * },\n * );\n * ```\n */\n constructor(\n url: string,\n credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: StoragePipelineOptions,\n );\n /**\n * Creates an instance of QueueServiceClient.\n *\n * @param url - A URL string pointing to Azure Storage queue service, such as\n * \"https://myaccount.queue.core.windows.net\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.queue.core.windows.net?sasString\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n */\n constructor(url: string, pipeline: Pipeline);\n constructor(\n url: string,\n credentialOrPipeline?:\n | StorageSharedKeyCredential\n | AnonymousCredential\n | TokenCredential\n | Pipeline,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: StoragePipelineOptions,\n ) {\n let pipeline: Pipeline;\n if (isPipelineLike(credentialOrPipeline)) {\n pipeline = credentialOrPipeline;\n } else if (\n (isNodeLike && credentialOrPipeline instanceof StorageSharedKeyCredential) ||\n credentialOrPipeline instanceof AnonymousCredential ||\n isTokenCredential(credentialOrPipeline)\n ) {\n pipeline = newPipeline(credentialOrPipeline, options);\n } else {\n // The second parameter is undefined. Use anonymous credential.\n pipeline = newPipeline(new AnonymousCredential(), options);\n }\n super(url, pipeline);\n this.serviceContext = this.storageClientContext.service;\n }\n\n /**\n * Creates a {@link QueueClient} object.\n *\n * @param queueName -\n * @returns a new QueueClient\n *\n * Example usage:\n *\n * ```ts snippet:ReadmeSampleCreateQueue\n * import { QueueServiceClient } from \"@azure/storage-queue\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const account = \"<account>\";\n * const queueServiceClient = new QueueServiceClient(\n * `https://${account}.queue.core.windows.net`,\n * new DefaultAzureCredential(),\n * );\n *\n * const queueName = \"<valid queue name>\";\n * const queueClient = queueServiceClient.getQueueClient(queueName);\n * const createQueueResponse = await queueClient.create();\n * console.log(\n * `Created queue ${queueName} successfully, service assigned request Id: ${createQueueResponse.requestId}`,\n * );\n * ```\n */\n public getQueueClient(queueName: string): QueueClient {\n return new QueueClient(appendToURLPath(this.url, queueName), this.pipeline);\n }\n\n /**\n * Returns a list of the queues under the specified account.\n * @see https://learn.microsoft.com/rest/api/storageservices/list-queues1\n *\n * @param marker - A string value that identifies the portion of\n * the list of queues to be returned with the next listing operation. The\n * operation returns the continuationToken value within the response body if the\n * listing operation did not return all queues remaining to be listed\n * with the current page. The continuationToken value can be used as the value for\n * the marker parameter in a subsequent call to request the next page of list\n * items. The marker value is opaque to the client.\n * @param options - Options to list queues operation.\n * @returns Response data for the list queues segment operation.\n */\n private async listQueuesSegment(\n marker?: string,\n options: ServiceListQueuesSegmentOptions = {},\n ): Promise<ServiceListQueuesSegmentResponse> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n return tracingClient.withSpan(\n \"QueueServiceClient-listQueuesSegment\",\n options,\n async (updatedOptions) => {\n return assertResponse<\n ServiceListQueuesSegmentHeaders & ListQueuesSegmentResponse,\n ServiceListQueuesSegmentHeaders,\n ListQueuesSegmentResponse\n >(\n await this.serviceContext.listQueuesSegment({\n ...updatedOptions,\n marker,\n include: options.include === undefined ? undefined : [options.include],\n }),\n );\n },\n );\n }\n\n /**\n * Returns an AsyncIterableIterator for {@link ServiceListQueuesSegmentResponse} objects\n *\n * @param marker - A string value that identifies the portion of\n * the list of queues to be returned with the next listing operation. The\n * operation returns the continuationToken value within the response body if the\n * listing operation did not return all queues remaining to be listed\n * with the current page. The continuationToken value can be used as the value for\n * the marker parameter in a subsequent call to request the next page of list\n * items. The marker value is opaque to the client.\n * @param options - Options to list queues operation.\n */\n private async *listSegments(\n marker?: string,\n options: ServiceListQueuesSegmentOptions = {},\n ): AsyncIterableIterator<ServiceListQueuesSegmentResponse> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n let listQueuesResponse;\n do {\n listQueuesResponse = await this.listQueuesSegment(marker, options);\n marker = listQueuesResponse.continuationToken;\n yield await listQueuesResponse;\n } while (marker);\n }\n\n /**\n * Returns an AsyncIterableIterator for {@link QueueItem} objects\n *\n * @param options - Options to list queues operation.\n */\n private async *listItems(\n options: ServiceListQueuesSegmentOptions = {},\n ): AsyncIterableIterator<QueueItem> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n let marker: string | undefined;\n for await (const segment of this.listSegments(marker, options)) {\n if (segment.queueItems) {\n yield* segment.queueItems;\n }\n }\n }\n\n /**\n * Returns an async iterable iterator to list all the queues\n * under the specified account.\n *\n * .byPage() returns an async iterable iterator to list the queues in pages.\n *\n * Example using `for await` syntax:\n *\n * ```ts snippet:ReadmeSampleListQueues\n * import { QueueServiceClient } from \"@azure/storage-queue\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const account = \"<account>\";\n * const queueServiceClient = new QueueServiceClient(\n * `https://${account}.queue.core.windows.net`,\n * new DefaultAzureCredential(),\n * );\n *\n * let i = 1;\n * for await (const item of queueServiceClient.listQueues()) {\n * console.log(`Queue${i++}: ${item.name}`);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```ts snippet:ReadmeSampleListQueues_Iterator\n * import { QueueServiceClient } from \"@azure/storage-queue\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const account = \"<account>\";\n * const queueServiceClient = new QueueServiceClient(\n * `https://${account}.queue.core.windows.net`,\n * new DefaultAzureCredential(),\n * );\n *\n * let i = 1;\n * const iterator = queueServiceClient.listQueues();\n * let { done, value } = await iterator.next();\n * while (!done) {\n * console.log(`Queue${i++}: ${value.name}`);\n * ({ done, value } = await iterator.next());\n * }\n * ```\n *\n * Example using `byPage()`:\n *\n * ```ts snippet:ReadmeSampleListQueues_ByPage\n * import { QueueServiceClient } from \"@azure/storage-queue\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const account = \"<account>\";\n * const queueServiceClient = new QueueServiceClient(\n * `https://${account}.queue.core.windows.net`,\n * new DefaultAzureCredential(),\n * );\n *\n * let i = 1;\n * for await (const page of queueServiceClient.listQueues().byPage({ maxPageSize: 20 })) {\n * for (const item of page.queueItems || []) {\n * console.log(`Queue${i++}: ${item.name}`);\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```ts snippet:ReadmeSampleListQueues_Continuation\n * import { QueueServiceClient } from \"@azure/storage-queue\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const account = \"<account>\";\n * const queueServiceClient = new QueueServiceClient(\n * `https://${account}.queue.core.windows.net`,\n * new DefaultAzureCredential(),\n * );\n *\n * let i = 1;\n * let iterator = queueServiceClient.listQueues().byPage({ maxPageSize: 2 });\n * let response = (await iterator.next()).value;\n * // Prints 2 queues\n * if (response.queueItems) {\n * for (const item of response.queueItems) {\n * console.log(`Queue${i++}: ${item.name}`);\n * }\n * }\n * // Gets next marker\n * let marker = response.continuationToken;\n * // Passing next marker as continuationToken\n * iterator = queueServiceClient.listQueues().byPage({ continuationToken: marker, maxPageSize: 10 });\n * response = (await iterator.next()).value;\n * // Prints 10 queues\n * if (response.queueItems) {\n * for (const item of response.queueItems) {\n * console.log(`Queue${i++}: ${item.name}`);\n * }\n * }\n * ```\n *\n * @param options - Options to list queues operation.\n * @returns An asyncIterableIterator that supports paging.\n */\n public listQueues(\n options: ServiceListQueuesOptions = {},\n ): PagedAsyncIterableIterator<QueueItem, ServiceListQueuesSegmentResponse> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n const updatedOptions: ServiceListQueuesSegmentOptions = {\n ...options,\n ...(options.includeMetadata ? { include: \"metadata\" } : {}),\n };\n\n // AsyncIterableIterator to iterate over queues\n const iter = this.listItems(updatedOptions);\n return {\n /**\n * The next method, part of the iteration protocol\n */\n next() {\n return iter.next();\n },\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator]() {\n return this;\n },\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings: PageSettings = {}) => {\n return this.listSegments(settings.continuationToken, {\n maxPageSize: settings.maxPageSize,\n ...updatedOptions,\n });\n },\n };\n }\n\n /**\n * Gets the properties of a storage account’s Queue service, including properties\n * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.\n * @see https://learn.microsoft.com/rest/api/storageservices/get-queue-service-properties\n *\n * @param options - Options to get properties operation.\n * @returns Response data including the queue service properties.\n */\n public async getProperties(\n options: ServiceGetPropertiesOptions = {},\n ): Promise<ServiceGetPropertiesResponse> {\n return tracingClient.withSpan(\n \"QueueServiceClient-getProperties\",\n options,\n async (updatedOptions) => {\n return assertResponse<\n ServiceGetPropertiesHeaders & QueueServiceProperties,\n ServiceGetPropertiesHeaders,\n QueueServiceProperties\n >(await this.serviceContext.getProperties(updatedOptions));\n },\n );\n }\n\n /**\n * Sets properties for a storage account’s Queue service endpoint, including properties\n * for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings.\n * @see https://learn.microsoft.com/rest/api/storageservices/set-queue-service-properties\n *\n * @param properties -\n * @param options - Options to set properties operation.\n * @returns Response data for the Set Properties operation.\n */\n public async setProperties(\n properties: QueueServiceProperties,\n options: ServiceGetPropertiesOptions = {},\n ): Promise<ServiceSetPropertiesResponse> {\n return tracingClient.withSpan(\n \"QueueServiceClient-setProperties\",\n options,\n async (updatedOptions) => {\n return assertResponse<ServiceSetPropertiesHeaders, ServiceSetPropertiesHeaders>(\n await this.serviceContext.setProperties(properties, updatedOptions),\n );\n },\n );\n }\n\n /**\n * Retrieves statistics related to replication for the Queue service. It is only\n * available on the secondary location endpoint when read-access geo-redundant\n * replication is enabled for the storage account.\n * @see https://learn.microsoft.com/rest/api/storageservices/get-queue-service-stats\n *\n * @param options - Options to get statistics operation.\n * @returns Response data for get statistics the operation.\n */\n public async getStatistics(\n options: ServiceGetStatisticsOptions = {},\n ): Promise<ServiceGetStatisticsResponse> {\n return tracingClient.withSpan(\n \"QueueServiceClient-getStatistics\",\n options,\n async (updatedOptions) => {\n return assertResponse<\n ServiceGetStatisticsHeaders & QueueServiceStatistics,\n ServiceGetStatisticsHeaders,\n QueueServiceStatistics\n >(await this.serviceContext.getStatistics(updatedOptions));\n },\n );\n }\n\n /**\n * Creates a new queue under the specified account.\n * @see https://learn.microsoft.com/rest/api/storageservices/create-queue4\n *\n * @param queueName - name of the queue to create\n * @param options - Options to Queue create operation.\n * @returns Response data for the Queue create operation.\n */\n public async createQueue(\n queueName: string,\n options: QueueCreateOptions = {},\n ): Promise<QueueCreateResponse> {\n return tracingClient.withSpan(\n \"QueueServiceClient-createQueue\",\n options,\n async (updatedOptions) => {\n return this.getQueueClient(queueName).create(updatedOptions);\n },\n );\n }\n\n /**\n * Deletes the specified queue permanently.\n * @see https://learn.microsoft.com/rest/api/storageservices/delete-queue3\n *\n * @param queueName - name of the queue to delete.\n * @param options - Options to Queue delete operation.\n * @returns Response data for the Queue delete operation.\n */\n public async deleteQueue(\n queueName: string,\n options: QueueDeleteOptions = {},\n ): Promise<QueueDeleteResponse> {\n return tracingClient.withSpan(\n \"QueueServiceClient-deleteQueue\",\n options,\n async (updatedOptions) => {\n return this.getQueueClient(queueName).delete(updatedOptions);\n },\n );\n }\n\n /**\n * Only available for QueueServiceClient constructed with a shared key credential.\n *\n * Generates an account Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas\n *\n * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not specified.\n * @param permissions - Specifies the list of permissions to be associated with the SAS.\n * @param resourceTypes - Specifies the resource types associated with the shared access signature.\n * @param options - Optional parameters.\n * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n public generateAccountSasUrl(\n expiresOn?: Date,\n permissions: AccountSASPermissions = AccountSASPermissions.parse(\"r\"),\n resourceTypes: string = \"sco\",\n options: ServiceGenerateAccountSasUrlOptions = {},\n ): string {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the account SAS when the client is initialized with a shared key credential\",\n );\n }\n\n if (expiresOn === undefined) {\n const now = new Date();\n expiresOn = new Date(now.getTime() + 3600 * 1000);\n }\n\n const sas = generateAccountSASQueryParameters(\n {\n permissions,\n expiresOn,\n resourceTypes,\n services: AccountSASServices.parse(\"q\").toString(),\n ...options,\n },\n this.credential,\n ).toString();\n\n return appendToURLQuery(this.url, sas);\n }\n\n /**\n * Only available for QueueServiceClient constructed with a shared key credential.\n *\n * Generates string to sign for an account Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas\n *\n * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not specified.\n * @param permissions - Specifies the list of permissions to be associated with the SAS.\n * @param resourceTypes - Specifies the resource types associated with the shared access signature.\n * @param options - Optional parameters.\n * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n public generateSasStringToSign(\n expiresOn?: Date,\n permissions: AccountSASPermissions = AccountSASPermissions.parse(\"r\"),\n resourceTypes: string = \"sco\",\n options: ServiceGenerateAccountSasUrlOptions = {},\n ): string {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the account SAS when the client is initialized with a shared key credential\",\n );\n }\n\n if (expiresOn === undefined) {\n const now = new Date();\n expiresOn = new Date(now.getTime() + 3600 * 1000);\n }\n\n return generateAccountSASQueryParametersInternal(\n {\n permissions,\n expiresOn,\n resourceTypes,\n services: AccountSASServices.parse(\"q\").toString(),\n ...options,\n },\n this.credential,\n ).stringToSign;\n }\n\n /**\n * ONLY AVAILABLE WHEN USING BEARER TOKEN AUTHENTICATION (TokenCredential).\n *\n * Retrieves a user delegation key for the Queue service. This is only a valid operation when using\n * bearer token authentication.\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/get-user-delegation-key\n *\n * @param startsOn - The start time for the user delegation SAS. Must be within 7 days of the current time\n * @param expiresOn - The end time for the user delegation SAS. Must be within 7 days of the current time\n */\n public async getUserDelegationKey(\n startsOn: Date,\n expiresOn: Date,\n options: ServiceGetUserDelegationKeyOptions = {},\n ): Promise<ServiceGetUserDelegationKeyResponse> {\n return tracingClient.withSpan(\n \"QueueServiceClient-getUserDelegationKey\",\n options,\n async (updatedOptions) => {\n const response = assertResponse<\n ServiceGetUserDelegationKeyResponseModel,\n ServiceGetUserDelegationKeyHeaders,\n UserDelegationKeyModel\n >(\n await this.serviceContext.getUserDelegationKey(\n {\n start: truncatedISO8061Date(startsOn, false),\n expiry: truncatedISO8061Date(expiresOn, false),\n },\n {\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n },\n ),\n );\n\n const userDelegationKey = {\n signedObjectId: response.signedOid,\n signedTenantId: response.signedTid,\n signedStartsOn: new Date(response.signedStart),\n signedExpiresOn: new Date(response.signedExpiry),\n signedService: response.signedService,\n signedVersion: response.signedVersion,\n value: response.value,\n };\n\n const res: ServiceGetUserDelegationKeyResponse = {\n _response: response._response,\n requestId: response.requestId,\n clientRequestId: response.clientRequestId,\n version: response.version,\n date: response.date,\n ...userDelegationKey,\n };\n\n return res;\n },\n );\n }\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UserDelegationKey } from "@azure/storage-common";
|
|
1
2
|
import type { SasIPRange } from "./SasIPRange.js";
|
|
2
3
|
/**
|
|
3
4
|
* Protocols for generated SAS.
|
|
@@ -71,6 +72,42 @@ export declare class SASQueryParameters {
|
|
|
71
72
|
* Inner value of getter ipRange.
|
|
72
73
|
*/
|
|
73
74
|
private readonly ipRangeInner?;
|
|
75
|
+
/**
|
|
76
|
+
* The Azure Active Directory object ID in GUID format.
|
|
77
|
+
* Property of user delegation key.
|
|
78
|
+
*/
|
|
79
|
+
private readonly signedOid?;
|
|
80
|
+
/**
|
|
81
|
+
* The Azure Active Directory tenant ID in GUID format.
|
|
82
|
+
* Property of user delegation key.
|
|
83
|
+
*/
|
|
84
|
+
private readonly signedTenantId?;
|
|
85
|
+
/**
|
|
86
|
+
* The date-time the key is active.
|
|
87
|
+
* Property of user delegation key.
|
|
88
|
+
*/
|
|
89
|
+
private readonly signedStartsOn?;
|
|
90
|
+
/**
|
|
91
|
+
* The date-time the key expires.
|
|
92
|
+
* Property of user delegation key.
|
|
93
|
+
*/
|
|
94
|
+
private readonly signedExpiresOn?;
|
|
95
|
+
/**
|
|
96
|
+
* Abbreviation of the Azure Storage service that accepts the user delegation key.
|
|
97
|
+
* Property of user delegation key.
|
|
98
|
+
*/
|
|
99
|
+
private readonly signedService?;
|
|
100
|
+
/**
|
|
101
|
+
* The service version that created the user delegation key.
|
|
102
|
+
* Property of user delegation key.
|
|
103
|
+
*/
|
|
104
|
+
private readonly signedVersion?;
|
|
105
|
+
/**
|
|
106
|
+
* Optional. Beginning in version 2025-07-05, this value specifies the Entra ID of the user who is authorized to
|
|
107
|
+
* use the resulting SAS URL. The resulting SAS URL must be used in conjunction with an Entra ID token that has been
|
|
108
|
+
* issued to the user specified in this value.
|
|
109
|
+
*/
|
|
110
|
+
readonly delegatedUserObjectId?: string;
|
|
74
111
|
/**
|
|
75
112
|
* Optional. IP range allowed for this SAS.
|
|
76
113
|
*
|
|
@@ -92,7 +129,7 @@ export declare class SASQueryParameters {
|
|
|
92
129
|
* @param identifier - Representing the signed identifier (only for Service SAS)
|
|
93
130
|
* @param resource - Representing the storage queue (only for Service SAS)
|
|
94
131
|
*/
|
|
95
|
-
constructor(version: string, signature: string, permissions?: string, services?: string, resourceTypes?: string, protocol?: SASProtocol, startsOn?: Date, expiresOn?: Date, ipRange?: SasIPRange, identifier?: string, resource?: string);
|
|
132
|
+
constructor(version: string, signature: string, permissions?: string, services?: string, resourceTypes?: string, protocol?: SASProtocol, startsOn?: Date, expiresOn?: Date, ipRange?: SasIPRange, identifier?: string, resource?: string, userDelegationKey?: UserDelegationKey, delegatedUserObjectId?: string);
|
|
96
133
|
/**
|
|
97
134
|
* Encodes all SAS query parameters into a string that can be appended to a URL.
|
|
98
135
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SASQueryParameters.d.ts","sourceRoot":"","sources":["../../src/SASQueryParameters.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAIlD;;GAEG;AACH,oBAAY,WAAW;IACrB;;OAEG;IACH,KAAK,UAAU;IAEf;;OAEG;IACH,YAAY,eAAe;CAC5B;AAED;;;;;;;;GAQG;AACH,qBAAa,kBAAkB;IAC7B;;OAEG;IACH,SAAgB,OAAO,EAAE,MAAM,CAAC;IAEhC;;OAEG;IACH,SAAgB,QAAQ,CAAC,EAAE,WAAW,CAAC;IAEvC;;OAEG;IACH,SAAgB,QAAQ,CAAC,EAAE,IAAI,CAAC;IAEhC;;OAEG;IACH,SAAgB,SAAS,CAAC,E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,EACtB,QAAQ,CAAC,EAAE,WAAW,EACtB,QAAQ,CAAC,EAAE,IAAI,EACf,SAAS,CAAC,EAAE,IAAI,EAChB,OAAO,CAAC,EAAE,UAAU,EACpB,UAAU,CAAC,EAAE,MAAM,EACnB,QAAQ,CAAC,EAAE,MAAM,EACjB,iBAAiB,CAAC,EAAE,iBAAiB,EACrC,qBAAqB,CAAC,EAAE,MAAM;IAwBhC;;;OAGG;IACI,QAAQ,IAAI,MAAM;IAwGzB;;;;;;OAMG;IACH,OAAO,CAAC,uBAAuB;CAWhC"}
|
|
@@ -78,6 +78,42 @@ class SASQueryParameters {
|
|
|
78
78
|
* Inner value of getter ipRange.
|
|
79
79
|
*/
|
|
80
80
|
ipRangeInner;
|
|
81
|
+
/**
|
|
82
|
+
* The Azure Active Directory object ID in GUID format.
|
|
83
|
+
* Property of user delegation key.
|
|
84
|
+
*/
|
|
85
|
+
signedOid;
|
|
86
|
+
/**
|
|
87
|
+
* The Azure Active Directory tenant ID in GUID format.
|
|
88
|
+
* Property of user delegation key.
|
|
89
|
+
*/
|
|
90
|
+
signedTenantId;
|
|
91
|
+
/**
|
|
92
|
+
* The date-time the key is active.
|
|
93
|
+
* Property of user delegation key.
|
|
94
|
+
*/
|
|
95
|
+
signedStartsOn;
|
|
96
|
+
/**
|
|
97
|
+
* The date-time the key expires.
|
|
98
|
+
* Property of user delegation key.
|
|
99
|
+
*/
|
|
100
|
+
signedExpiresOn;
|
|
101
|
+
/**
|
|
102
|
+
* Abbreviation of the Azure Storage service that accepts the user delegation key.
|
|
103
|
+
* Property of user delegation key.
|
|
104
|
+
*/
|
|
105
|
+
signedService;
|
|
106
|
+
/**
|
|
107
|
+
* The service version that created the user delegation key.
|
|
108
|
+
* Property of user delegation key.
|
|
109
|
+
*/
|
|
110
|
+
signedVersion;
|
|
111
|
+
/**
|
|
112
|
+
* Optional. Beginning in version 2025-07-05, this value specifies the Entra ID of the user who is authorized to
|
|
113
|
+
* use the resulting SAS URL. The resulting SAS URL must be used in conjunction with an Entra ID token that has been
|
|
114
|
+
* issued to the user specified in this value.
|
|
115
|
+
*/
|
|
116
|
+
delegatedUserObjectId;
|
|
81
117
|
/**
|
|
82
118
|
* Optional. IP range allowed for this SAS.
|
|
83
119
|
*
|
|
@@ -107,7 +143,7 @@ class SASQueryParameters {
|
|
|
107
143
|
* @param identifier - Representing the signed identifier (only for Service SAS)
|
|
108
144
|
* @param resource - Representing the storage queue (only for Service SAS)
|
|
109
145
|
*/
|
|
110
|
-
constructor(version, signature, permissions, services, resourceTypes, protocol, startsOn, expiresOn, ipRange, identifier, resource) {
|
|
146
|
+
constructor(version, signature, permissions, services, resourceTypes, protocol, startsOn, expiresOn, ipRange, identifier, resource, userDelegationKey, delegatedUserObjectId) {
|
|
111
147
|
this.version = version;
|
|
112
148
|
this.services = services;
|
|
113
149
|
this.resourceTypes = resourceTypes;
|
|
@@ -119,13 +155,41 @@ class SASQueryParameters {
|
|
|
119
155
|
this.identifier = identifier;
|
|
120
156
|
this.resource = resource;
|
|
121
157
|
this.signature = signature;
|
|
158
|
+
if (userDelegationKey) {
|
|
159
|
+
this.signedOid = userDelegationKey.signedObjectId;
|
|
160
|
+
this.signedTenantId = userDelegationKey.signedTenantId;
|
|
161
|
+
this.signedStartsOn = userDelegationKey.signedStartsOn;
|
|
162
|
+
this.signedExpiresOn = userDelegationKey.signedExpiresOn;
|
|
163
|
+
this.signedService = userDelegationKey.signedService;
|
|
164
|
+
this.signedVersion = userDelegationKey.signedVersion;
|
|
165
|
+
this.delegatedUserObjectId = delegatedUserObjectId;
|
|
166
|
+
}
|
|
122
167
|
}
|
|
123
168
|
/**
|
|
124
169
|
* Encodes all SAS query parameters into a string that can be appended to a URL.
|
|
125
170
|
*
|
|
126
171
|
*/
|
|
127
172
|
toString() {
|
|
128
|
-
const params = [
|
|
173
|
+
const params = [
|
|
174
|
+
"sv",
|
|
175
|
+
"ss",
|
|
176
|
+
"srt",
|
|
177
|
+
"spr",
|
|
178
|
+
"st",
|
|
179
|
+
"se",
|
|
180
|
+
"sip",
|
|
181
|
+
"si",
|
|
182
|
+
"sr",
|
|
183
|
+
"sp",
|
|
184
|
+
"sig",
|
|
185
|
+
"skoid", // Signed object ID
|
|
186
|
+
"sktid", // Signed tenant ID
|
|
187
|
+
"skt", // Signed key start time
|
|
188
|
+
"ske", // Signed key expiry time
|
|
189
|
+
"sks", // Signed key service
|
|
190
|
+
"skv", // Signed key version
|
|
191
|
+
"sduoid", // Signed key user delegation object ID
|
|
192
|
+
];
|
|
129
193
|
const queries = [];
|
|
130
194
|
for (const param of params) {
|
|
131
195
|
switch (param) {
|
|
@@ -162,6 +226,27 @@ class SASQueryParameters {
|
|
|
162
226
|
case "sig":
|
|
163
227
|
this.tryAppendQueryParameter(queries, param, this.signature);
|
|
164
228
|
break;
|
|
229
|
+
case "skoid":
|
|
230
|
+
this.tryAppendQueryParameter(queries, param, this.signedOid);
|
|
231
|
+
break;
|
|
232
|
+
case "sktid": // Signed tenant ID
|
|
233
|
+
this.tryAppendQueryParameter(queries, param, this.signedTenantId);
|
|
234
|
+
break;
|
|
235
|
+
case "skt": // Signed key start time
|
|
236
|
+
this.tryAppendQueryParameter(queries, param, this.signedStartsOn ? (0, utils_common_js_1.truncatedISO8061Date)(this.signedStartsOn, false) : undefined);
|
|
237
|
+
break;
|
|
238
|
+
case "ske": // Signed key expiry time
|
|
239
|
+
this.tryAppendQueryParameter(queries, param, this.signedExpiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(this.signedExpiresOn, false) : undefined);
|
|
240
|
+
break;
|
|
241
|
+
case "sks": // Signed key service
|
|
242
|
+
this.tryAppendQueryParameter(queries, param, this.signedService);
|
|
243
|
+
break;
|
|
244
|
+
case "skv": // Signed key version
|
|
245
|
+
this.tryAppendQueryParameter(queries, param, this.signedVersion);
|
|
246
|
+
break;
|
|
247
|
+
case "sduoid": // Signed key user delegation object ID
|
|
248
|
+
this.tryAppendQueryParameter(queries, param, this.delegatedUserObjectId);
|
|
249
|
+
break;
|
|
165
250
|
}
|
|
166
251
|
}
|
|
167
252
|
return queries.join("&");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SASQueryParameters.js","sourceRoot":"","sources":["../../src/SASQueryParameters.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAGlC,mDAAkD;AAClD,6DAA+D;AAE/D;;GAEG;AACH,IAAY,WAUX;AAVD,WAAY,WAAW;IACrB;;OAEG;IACH,8BAAe,CAAA;IAEf;;OAEG;IACH,0CAA2B,CAAA;AAC7B,CAAC,EAVW,WAAW,2BAAX,WAAW,QAUtB;AAED;;;;;;;;GAQG;AACH,MAAa,kBAAkB;IAC7B;;OAEG;IACa,OAAO,CAAS;IAEhC;;OAEG;IACa,QAAQ,CAAe;IAEvC;;OAEG;IACa,QAAQ,CAAQ;IAEhC;;OAEG;IACa,SAAS,CAAQ;IAEjC;;;OAGG;IACa,WAAW,CAAU;IAErC;;;OAGG;IACa,QAAQ,CAAU;IAElC;;;OAGG;IACa,aAAa,CAAU;IAEvC;;;;OAIG;IACa,UAAU,CAAU;IAEpC;;OAEG;IACa,QAAQ,CAAU;IAElC;;OAEG;IACa,SAAS,CAAS;IAElC;;OAEG;IACc,YAAY,CAAc;IAE3C;;;;OAIG;IACH,IAAW,OAAO;QAChB,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,OAAO;gBACL,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG;gBAC1B,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK;aAC/B,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,YACE,OAAe,EACf,SAAiB,EACjB,WAAoB,EACpB,QAAiB,EACjB,aAAsB,EACtB,QAAsB,EACtB,QAAe,EACf,SAAgB,EAChB,OAAoB,EACpB,UAAmB,EACnB,QAAiB;QAEjB,IAAI,CAAC,OAAO,GAAG,OAAO,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AAuB,CAAC,OAAiB,EAAE,GAAW,EAAE,KAAc;QAC5E,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO;QACT,CAAC;QAED,GAAG,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAC9B,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvC,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;CACF;AAnMD,gDAmMC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { SasIPRange } from \"./SasIPRange.js\";\nimport { ipRangeToString } from \"./SasIPRange.js\";\nimport { truncatedISO8061Date } from \"./utils/utils.common.js\";\n\n/**\n * Protocols for generated SAS.\n */\nexport enum SASProtocol {\n /**\n * Protocol that allows HTTPS only\n */\n Https = \"https\",\n\n /**\n * Protocol that allows both HTTPS and HTTP\n */\n HttpsAndHttp = \"https,http\",\n}\n\n/**\n * Represents the components that make up an Azure Storage SAS' query parameters. This type is not constructed directly\n * by the user; it is only generated by the {@link AccountSASSignatureValues} and {@link QueueSASSignatureValues}\n * types. Once generated, it can be encoded into a {@link String} and appended to a URL directly (though caution should\n * be taken here in case there are existing query parameters, which might affect the appropriate means of appending\n * these query parameters).\n *\n * NOTE: Instances of this class are immutable.\n */\nexport class SASQueryParameters {\n /**\n * The storage API version.\n */\n public readonly version: string;\n\n /**\n * Optional. The allowed HTTP protocol(s).\n */\n public readonly protocol?: SASProtocol;\n\n /**\n * Optional. The start time for this SAS token.\n */\n public readonly startsOn?: Date;\n\n /**\n * Optional only when identifier is provided. The expiry time for this SAS token.\n */\n public readonly expiresOn?: Date;\n\n /**\n * Optional only when identifier is provided.\n * Please refer to {@link AccountSASPermissions}, {@link QueueSASPermissions} for more details.\n */\n public readonly permissions?: string;\n\n /**\n * Optional. The storage services being accessed (only for Account SAS). Please refer to {@link AccountSASServices}\n * for more details.\n */\n public readonly services?: string;\n\n /**\n * Optional. The storage resource types being accessed (only for Account SAS). Please refer to\n * {@link AccountSASResourceTypes} for more details.\n */\n public readonly resourceTypes?: string;\n\n /**\n * Optional. The signed identifier (only for {@link QueueSASSignatureValues}).\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy\n */\n public readonly identifier?: string;\n\n /**\n * Optional. The storage queue (only for {@link QueueSASSignatureValues}).\n */\n public readonly resource?: string;\n\n /**\n * The signature for the SAS token.\n */\n public readonly signature: string;\n\n /**\n * Inner value of getter ipRange.\n */\n private readonly ipRangeInner?: SasIPRange;\n\n /**\n * Optional. IP range allowed for this SAS.\n *\n * @readonly\n */\n public get ipRange(): SasIPRange | undefined {\n if (this.ipRangeInner) {\n return {\n end: this.ipRangeInner.end,\n start: this.ipRangeInner.start,\n };\n }\n return undefined;\n }\n\n /**\n * Creates an instance of SASQueryParameters.\n *\n * @param version - Representing the storage version\n * @param signature - Representing the signature for the SAS token\n * @param permissions - Representing the storage permissions\n * @param services - Representing the storage services being accessed (only for Account SAS)\n * @param resourceTypes - Representing the storage resource types being accessed (only for Account SAS)\n * @param protocol - Representing the allowed HTTP protocol(s)\n * @param startsOn - Representing the start time for this SAS token\n * @param expiresOn - Representing the expiry time for this SAS token\n * @param ipRange - Representing the range of valid IP addresses for this SAS token\n * @param identifier - Representing the signed identifier (only for Service SAS)\n * @param resource - Representing the storage queue (only for Service SAS)\n */\n constructor(\n version: string,\n signature: string,\n permissions?: string,\n services?: string,\n resourceTypes?: string,\n protocol?: SASProtocol,\n startsOn?: Date,\n expiresOn?: Date,\n ipRange?: SasIPRange,\n identifier?: string,\n resource?: string,\n ) {\n this.version = version;\n this.services = services;\n this.resourceTypes = resourceTypes;\n this.expiresOn = expiresOn;\n this.permissions = permissions;\n this.protocol = protocol;\n this.startsOn = startsOn;\n this.ipRangeInner = ipRange;\n this.identifier = identifier;\n this.resource = resource;\n this.signature = signature;\n }\n\n /**\n * Encodes all SAS query parameters into a string that can be appended to a URL.\n *\n */\n public toString(): string {\n const params: string[] = [\"sv\", \"ss\", \"srt\", \"spr\", \"st\", \"se\", \"sip\", \"si\", \"sr\", \"sp\", \"sig\"];\n const queries: string[] = [];\n\n for (const param of params) {\n switch (param) {\n case \"sv\":\n this.tryAppendQueryParameter(queries, param, this.version);\n break;\n case \"ss\":\n this.tryAppendQueryParameter(queries, param, this.services);\n break;\n case \"srt\":\n this.tryAppendQueryParameter(queries, param, this.resourceTypes);\n break;\n case \"spr\":\n this.tryAppendQueryParameter(queries, param, this.protocol);\n break;\n case \"st\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.startsOn ? truncatedISO8061Date(this.startsOn, false) : undefined,\n );\n break;\n case \"se\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : undefined,\n );\n break;\n case \"sip\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.ipRange ? ipRangeToString(this.ipRange) : undefined,\n );\n break;\n case \"si\":\n this.tryAppendQueryParameter(queries, param, this.identifier);\n break;\n case \"sr\":\n this.tryAppendQueryParameter(queries, param, this.resource);\n break;\n case \"sp\":\n this.tryAppendQueryParameter(queries, param, this.permissions);\n break;\n case \"sig\":\n this.tryAppendQueryParameter(queries, param, this.signature);\n break;\n }\n }\n return queries.join(\"&\");\n }\n\n /**\n * A private helper method used to filter and append query key/value pairs into an array.\n *\n * @param queries -\n * @param key -\n * @param value -\n */\n private tryAppendQueryParameter(queries: string[], key: string, value?: string): void {\n if (!value) {\n return;\n }\n\n key = encodeURIComponent(key);\n value = encodeURIComponent(value);\n if (key.length > 0 && value.length > 0) {\n queries.push(`${key}=${value}`);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SASQueryParameters.js","sourceRoot":"","sources":["../../src/SASQueryParameters.ts"],"names":[],"mappings":";AA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AC,eAAe,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CACrF,CAAC;oBACF,MAAM;gBACR,KAAK,KAAK,EAAE,qBAAqB;oBAC/B,IAAI,CAAC,uBAAuB,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;oBACjE,MAAM;gBACR,KAAK,KAAK,EAAE,qBAAqB;oBAC/B,IAAI,CAAC,uBAAuB,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;oBACjE,MAAM;gBACR,KAAK,QAAQ,EAAE,uCAAuC;oBACpD,IAAI,CAAC,uBAAuB,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;oBACzE,MAAM;YACV,CAAC;QACH,CAAC;QACD,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAED;;;;;;OAMG;IACK,uBAAuB,CAAC,OAAiB,EAAE,GAAW,EAAE,KAAc;QAC5E,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO;QACT,CAAC;QAED,GAAG,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAC9B,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvC,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;CACF;AAzSD,gDAySC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { UserDelegationKey } from \"@azure/storage-common\";\nimport type { SasIPRange } from \"./SasIPRange.js\";\nimport { ipRangeToString } from \"./SasIPRange.js\";\nimport { truncatedISO8061Date } from \"./utils/utils.common.js\";\n\n/**\n * Protocols for generated SAS.\n */\nexport enum SASProtocol {\n /**\n * Protocol that allows HTTPS only\n */\n Https = \"https\",\n\n /**\n * Protocol that allows both HTTPS and HTTP\n */\n HttpsAndHttp = \"https,http\",\n}\n\n/**\n * Represents the components that make up an Azure Storage SAS' query parameters. This type is not constructed directly\n * by the user; it is only generated by the {@link AccountSASSignatureValues} and {@link QueueSASSignatureValues}\n * types. Once generated, it can be encoded into a {@link String} and appended to a URL directly (though caution should\n * be taken here in case there are existing query parameters, which might affect the appropriate means of appending\n * these query parameters).\n *\n * NOTE: Instances of this class are immutable.\n */\nexport class SASQueryParameters {\n /**\n * The storage API version.\n */\n public readonly version: string;\n\n /**\n * Optional. The allowed HTTP protocol(s).\n */\n public readonly protocol?: SASProtocol;\n\n /**\n * Optional. The start time for this SAS token.\n */\n public readonly startsOn?: Date;\n\n /**\n * Optional only when identifier is provided. The expiry time for this SAS token.\n */\n public readonly expiresOn?: Date;\n\n /**\n * Optional only when identifier is provided.\n * Please refer to {@link AccountSASPermissions}, {@link QueueSASPermissions} for more details.\n */\n public readonly permissions?: string;\n\n /**\n * Optional. The storage services being accessed (only for Account SAS). Please refer to {@link AccountSASServices}\n * for more details.\n */\n public readonly services?: string;\n\n /**\n * Optional. The storage resource types being accessed (only for Account SAS). Please refer to\n * {@link AccountSASResourceTypes} for more details.\n */\n public readonly resourceTypes?: string;\n\n /**\n * Optional. The signed identifier (only for {@link QueueSASSignatureValues}).\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy\n */\n public readonly identifier?: string;\n\n /**\n * Optional. The storage queue (only for {@link QueueSASSignatureValues}).\n */\n public readonly resource?: string;\n\n /**\n * The signature for the SAS token.\n */\n public readonly signature: string;\n\n /**\n * Inner value of getter ipRange.\n */\n private readonly ipRangeInner?: SasIPRange;\n\n /**\n * The Azure Active Directory object ID in GUID format.\n * Property of user delegation key.\n */\n private readonly signedOid?: string;\n\n /**\n * The Azure Active Directory tenant ID in GUID format.\n * Property of user delegation key.\n */\n private readonly signedTenantId?: string;\n\n /**\n * The date-time the key is active.\n * Property of user delegation key.\n */\n private readonly signedStartsOn?: Date;\n\n /**\n * The date-time the key expires.\n * Property of user delegation key.\n */\n private readonly signedExpiresOn?: Date;\n\n /**\n * Abbreviation of the Azure Storage service that accepts the user delegation key.\n * Property of user delegation key.\n */\n private readonly signedService?: string;\n\n /**\n * The service version that created the user delegation key.\n * Property of user delegation key.\n */\n private readonly signedVersion?: string;\n\n /**\n * Optional. Beginning in version 2025-07-05, this value specifies the Entra ID of the user who is authorized to\n * use the resulting SAS URL. The resulting SAS URL must be used in conjunction with an Entra ID token that has been\n * issued to the user specified in this value.\n */\n public readonly delegatedUserObjectId?: string;\n\n /**\n * Optional. IP range allowed for this SAS.\n *\n * @readonly\n */\n public get ipRange(): SasIPRange | undefined {\n if (this.ipRangeInner) {\n return {\n end: this.ipRangeInner.end,\n start: this.ipRangeInner.start,\n };\n }\n return undefined;\n }\n\n /**\n * Creates an instance of SASQueryParameters.\n *\n * @param version - Representing the storage version\n * @param signature - Representing the signature for the SAS token\n * @param permissions - Representing the storage permissions\n * @param services - Representing the storage services being accessed (only for Account SAS)\n * @param resourceTypes - Representing the storage resource types being accessed (only for Account SAS)\n * @param protocol - Representing the allowed HTTP protocol(s)\n * @param startsOn - Representing the start time for this SAS token\n * @param expiresOn - Representing the expiry time for this SAS token\n * @param ipRange - Representing the range of valid IP addresses for this SAS token\n * @param identifier - Representing the signed identifier (only for Service SAS)\n * @param resource - Representing the storage queue (only for Service SAS)\n */\n constructor(\n version: string,\n signature: string,\n permissions?: string,\n services?: string,\n resourceTypes?: string,\n protocol?: SASProtocol,\n startsOn?: Date,\n expiresOn?: Date,\n ipRange?: SasIPRange,\n identifier?: string,\n resource?: string,\n userDelegationKey?: UserDelegationKey,\n delegatedUserObjectId?: string,\n ) {\n this.version = version;\n this.services = services;\n this.resourceTypes = resourceTypes;\n this.expiresOn = expiresOn;\n this.permissions = permissions;\n this.protocol = protocol;\n this.startsOn = startsOn;\n this.ipRangeInner = ipRange;\n this.identifier = identifier;\n this.resource = resource;\n this.signature = signature;\n if (userDelegationKey) {\n this.signedOid = userDelegationKey.signedObjectId;\n this.signedTenantId = userDelegationKey.signedTenantId;\n this.signedStartsOn = userDelegationKey.signedStartsOn;\n this.signedExpiresOn = userDelegationKey.signedExpiresOn;\n this.signedService = userDelegationKey.signedService;\n this.signedVersion = userDelegationKey.signedVersion;\n this.delegatedUserObjectId = delegatedUserObjectId;\n }\n }\n\n /**\n * Encodes all SAS query parameters into a string that can be appended to a URL.\n *\n */\n public toString(): string {\n const params: string[] = [\n \"sv\",\n \"ss\",\n \"srt\",\n \"spr\",\n \"st\",\n \"se\",\n \"sip\",\n \"si\",\n \"sr\",\n \"sp\",\n \"sig\",\n \"skoid\", // Signed object ID\n \"sktid\", // Signed tenant ID\n \"skt\", // Signed key start time\n \"ske\", // Signed key expiry time\n \"sks\", // Signed key service\n \"skv\", // Signed key version\n \"sduoid\", // Signed key user delegation object ID\n ];\n const queries: string[] = [];\n\n for (const param of params) {\n switch (param) {\n case \"sv\":\n this.tryAppendQueryParameter(queries, param, this.version);\n break;\n case \"ss\":\n this.tryAppendQueryParameter(queries, param, this.services);\n break;\n case \"srt\":\n this.tryAppendQueryParameter(queries, param, this.resourceTypes);\n break;\n case \"spr\":\n this.tryAppendQueryParameter(queries, param, this.protocol);\n break;\n case \"st\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.startsOn ? truncatedISO8061Date(this.startsOn, false) : undefined,\n );\n break;\n case \"se\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : undefined,\n );\n break;\n case \"sip\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.ipRange ? ipRangeToString(this.ipRange) : undefined,\n );\n break;\n case \"si\":\n this.tryAppendQueryParameter(queries, param, this.identifier);\n break;\n case \"sr\":\n this.tryAppendQueryParameter(queries, param, this.resource);\n break;\n case \"sp\":\n this.tryAppendQueryParameter(queries, param, this.permissions);\n break;\n case \"sig\":\n this.tryAppendQueryParameter(queries, param, this.signature);\n break;\n case \"skoid\":\n this.tryAppendQueryParameter(queries, param, this.signedOid);\n break;\n case \"sktid\": // Signed tenant ID\n this.tryAppendQueryParameter(queries, param, this.signedTenantId);\n break;\n case \"skt\": // Signed key start time\n this.tryAppendQueryParameter(\n queries,\n param,\n this.signedStartsOn ? truncatedISO8061Date(this.signedStartsOn, false) : undefined,\n );\n break;\n case \"ske\": // Signed key expiry time\n this.tryAppendQueryParameter(\n queries,\n param,\n this.signedExpiresOn ? truncatedISO8061Date(this.signedExpiresOn, false) : undefined,\n );\n break;\n case \"sks\": // Signed key service\n this.tryAppendQueryParameter(queries, param, this.signedService);\n break;\n case \"skv\": // Signed key version\n this.tryAppendQueryParameter(queries, param, this.signedVersion);\n break;\n case \"sduoid\": // Signed key user delegation object ID\n this.tryAppendQueryParameter(queries, param, this.delegatedUserObjectId);\n break;\n }\n }\n return queries.join(\"&\");\n }\n\n /**\n * A private helper method used to filter and append query key/value pairs into an array.\n *\n * @param queries -\n * @param key -\n * @param value -\n */\n private tryAppendQueryParameter(queries: string[], key: string, value?: string): void {\n if (!value) {\n return;\n }\n\n key = encodeURIComponent(key);\n value = encodeURIComponent(value);\n if (key.length > 0 && value.length > 0) {\n queries.push(`${key}=${value}`);\n }\n }\n}\n"]}
|