@azure/storage-queue 12.22.0-alpha.20240124.2 → 12.22.0-alpha.20240202.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/index.js.map +1 -1
  3. package/dist-esm/storage-blob/src/BatchResponseParser.js.map +1 -1
  4. package/dist-esm/storage-blob/src/BlobBatch.js +3 -3
  5. package/dist-esm/storage-blob/src/BlobBatch.js.map +1 -1
  6. package/dist-esm/storage-blob/src/BlobBatchClient.js.map +1 -1
  7. package/dist-esm/storage-blob/src/BlobLeaseClient.js.map +1 -1
  8. package/dist-esm/storage-blob/src/BlobServiceClient.js.map +1 -1
  9. package/dist-esm/storage-blob/src/Clients.js.map +1 -1
  10. package/dist-esm/storage-blob/src/ContainerClient.js.map +1 -1
  11. package/dist-esm/storage-blob/src/Pipeline.js.map +1 -1
  12. package/dist-esm/storage-blob/src/Range.js.map +1 -1
  13. package/dist-esm/storage-blob/src/StorageContextClient.js.map +1 -1
  14. package/dist-esm/storage-blob/src/generated/src/storageClient.js.map +1 -1
  15. package/dist-esm/storage-blob/src/models.js.map +1 -1
  16. package/dist-esm/storage-blob/src/policies/StorageBrowserPolicy.js.map +1 -1
  17. package/dist-esm/storage-blob/src/policies/StorageBrowserPolicyV2.js.map +1 -1
  18. package/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js.map +1 -1
  19. package/dist-esm/storage-blob/src/policies/StorageRetryPolicyV2.js.map +1 -1
  20. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.js.map +1 -1
  21. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.js.map +1 -1
  22. package/dist-esm/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.js.map +1 -1
  23. package/dist-esm/storage-blob/src/sas/AccountSASPermissions.js.map +1 -1
  24. package/dist-esm/storage-blob/src/sas/AccountSASResourceTypes.js.map +1 -1
  25. package/dist-esm/storage-blob/src/sas/AccountSASServices.js.map +1 -1
  26. package/dist-esm/storage-blob/src/sas/AccountSASSignatureValues.js.map +1 -1
  27. package/dist-esm/storage-blob/src/sas/BlobSASPermissions.js.map +1 -1
  28. package/dist-esm/storage-blob/src/sas/BlobSASSignatureValues.js +2 -2
  29. package/dist-esm/storage-blob/src/sas/BlobSASSignatureValues.js.map +1 -1
  30. package/dist-esm/storage-blob/src/sas/ContainerSASPermissions.js.map +1 -1
  31. package/dist-esm/storage-blob/src/sas/SASQueryParameters.js +6 -6
  32. package/dist-esm/storage-blob/src/sas/SASQueryParameters.js.map +1 -1
  33. package/dist-esm/storage-blob/src/utils/Batch.js.map +1 -1
  34. package/dist-esm/storage-blob/src/utils/BlobQuickQueryStream.js.map +1 -1
  35. package/dist-esm/storage-blob/src/utils/Mutex.js.map +1 -1
  36. package/dist-esm/storage-blob/src/utils/RetriableReadableStream.js.map +1 -1
  37. package/dist-esm/storage-blob/src/utils/cache.js.map +1 -1
  38. package/dist-esm/storage-blob/src/utils/utils.common.js.map +1 -1
  39. package/dist-esm/storage-blob/src/utils/utils.node.js.map +1 -1
  40. package/dist-esm/storage-queue/src/AccountSASPermissions.js.map +1 -1
  41. package/dist-esm/storage-queue/src/AccountSASResourceTypes.js.map +1 -1
  42. package/dist-esm/storage-queue/src/AccountSASServices.js.map +1 -1
  43. package/dist-esm/storage-queue/src/AccountSASSignatureValues.js +1 -1
  44. package/dist-esm/storage-queue/src/AccountSASSignatureValues.js.map +1 -1
  45. package/dist-esm/storage-queue/src/QueueClient.js.map +1 -1
  46. package/dist-esm/storage-queue/src/QueueSASPermissions.js.map +1 -1
  47. package/dist-esm/storage-queue/src/QueueSASSignatureValues.js.map +1 -1
  48. package/dist-esm/storage-queue/src/QueueServiceClient.js.map +1 -1
  49. package/dist-esm/storage-queue/src/SASQueryParameters.js.map +1 -1
  50. package/dist-esm/storage-queue/src/StorageClient.js.map +1 -1
  51. package/dist-esm/storage-queue/src/StorageContextClient.js.map +1 -1
  52. package/dist-esm/storage-queue/src/generated/src/storageClient.js.map +1 -1
  53. package/dist-esm/storage-queue/src/utils/utils.common.js.map +1 -1
  54. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"utils.node.js","sourceRoot":"","sources":["../../../../../storage-blob/src/utils/utils.node.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAA6B,EAC7B,MAAc,EACd,MAAc,EACd,GAAW,EACX,QAAyB;IAEzB,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,qBAAqB;IAClC,MAAM,KAAK,GAAG,GAAG,GAAG,MAAM,CAAC,CAAC,wCAAwC;IAEpE,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,MAAM,OAAO,GAAG,UAAU,CACxB,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC,EACxE,eAAe,CAChB,CAAC;QAEF,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE;YACzB,IAAI,GAAG,IAAI,KAAK,EAAE;gBAChB,YAAY,CAAC,OAAO,CAAC,CAAC;gBACtB,OAAO,EAAE,CAAC;gBACV,OAAO;aACR;YAED,IAAI,KAAK,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;YAC1B,IAAI,CAAC,KAAK,EAAE;gBACV,OAAO;aACR;YACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBAC7B,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;aACtC;YAED,qCAAqC;YACrC,MAAM,WAAW,GA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EAAE,MAAM,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,EAAyB,EACzB,IAAY;IAEZ,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,MAAM,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAEtC,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAU,EAAE,EAAE;YAC5B,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAU,EAAE,EAAE;YAC5B,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAExB,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AAE9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC,gBAAgB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport * as fs from \"fs\";\nimport * as util from \"util\";\nimport { REQUEST_TIMEOUT } from \"./constants\";\n\n/**\n * Reads a readable stream into buffer. Fill the buffer from offset to end.\n *\n * @param stream - A Node.js Readable stream\n * @param buffer - Buffer to be filled, length must greater than or equal to offset\n * @param offset - From which position in the buffer to be filled, inclusive\n * @param end - To which position in the buffer to be filled, exclusive\n * @param encoding - Encoding of the Readable stream\n */\nexport async function streamToBuffer(\n stream: NodeJS.ReadableStream,\n buffer: Buffer,\n offset: number,\n end: number,\n encoding?: BufferEncoding,\n): Promise<void> {\n let pos = 0; // Position in stream\n const count = end - offset; // Total amount of data needed in stream\n\n return new Promise<void>((resolve, reject) => {\n const timeout = setTimeout(\n () => reject(new Error(`The operation cannot be completed in timeout.`)),\n REQUEST_TIMEOUT,\n );\n\n stream.on(\"readable\", () => {\n if (pos >= count) {\n clearTimeout(timeout);\n resolve();\n return;\n }\n\n let chunk = stream.read();\n if (!chunk) {\n return;\n }\n if (typeof chunk === \"string\") {\n chunk = Buffer.from(chunk, encoding);\n }\n\n // How much data needed in this chunk\n const chunkLength = pos + chunk.length > count ? count - pos : chunk.length;\n\n buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength);\n pos += chunkLength;\n });\n\n stream.on(\"end\", () => {\n clearTimeout(timeout);\n if (pos < count) {\n reject(\n new Error(\n `Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`,\n ),\n );\n }\n resolve();\n });\n\n stream.on(\"error\", (msg) => {\n clearTimeout(timeout);\n reject(msg);\n });\n });\n}\n\n/**\n * Reads a readable stream into buffer entirely.\n *\n * @param stream - A Node.js Readable stream\n * @param buffer - Buffer to be filled, length must greater than or equal to offset\n * @param encoding - Encoding of the Readable stream\n * @returns with the count of bytes read.\n * @throws `RangeError` If buffer size is not big enough.\n */\nexport async function streamToBuffer2(\n stream: NodeJS.ReadableStream,\n buffer: Buffer,\n encoding?: BufferEncoding,\n): Promise<number> {\n let pos = 0; // Position in stream\n const bufferSize = buffer.length;\n\n return new Promise<number>((resolve, reject) => {\n stream.on(\"readable\", () => {\n let chunk = stream.read();\n if (!chunk) {\n return;\n }\n if (typeof chunk === \"string\") {\n chunk = Buffer.from(chunk, encoding);\n }\n\n if (pos + chunk.length > bufferSize) {\n reject(new Error(`Stream exceeds buffer size. Buffer size: ${bufferSize}`));\n return;\n }\n\n buffer.fill(chunk, pos, pos + chunk.length);\n pos += chunk.length;\n });\n\n stream.on(\"end\", () => {\n resolve(pos);\n });\n\n stream.on(\"error\", reject);\n });\n}\n\n/**\n * Reads a readable stream into a buffer.\n *\n * @param stream - A Node.js Readable stream\n * @param encoding - Encoding of the Readable stream\n * @returns with the count of bytes read.\n */\nexport async function streamToBuffer3(\n readableStream: NodeJS.ReadableStream,\n encoding?: BufferEncoding,\n): Promise<Buffer> {\n return new Promise((resolve, reject) => {\n const chunks: Buffer[] = [];\n readableStream.on(\"data\", (data: Buffer | string) => {\n chunks.push(data instanceof Buffer ? data : Buffer.from(data, encoding));\n });\n readableStream.on(\"end\", () => {\n resolve(Buffer.concat(chunks));\n });\n readableStream.on(\"error\", reject);\n });\n}\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Writes the content of a readstream to a local file. Returns a Promise which is completed after the file handle is closed.\n *\n * @param rs - The read stream.\n * @param file - Destination file path.\n */\nexport async function readStreamToLocalFile(\n rs: NodeJS.ReadableStream,\n file: string,\n): Promise<void> {\n return new Promise<void>((resolve, reject) => {\n const ws = fs.createWriteStream(file);\n\n rs.on(\"error\", (err: Error) => {\n reject(err);\n });\n\n ws.on(\"error\", (err: Error) => {\n reject(err);\n });\n\n ws.on(\"close\", resolve);\n\n rs.pipe(ws);\n });\n}\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Promisified version of fs.stat().\n */\nexport const fsStat = util.promisify(fs.stat);\n\nexport const fsCreateReadStream = fs.createReadStream;\n"]}
1
+ {"version":3,"file":"utils.node.js","sourceRoot":"","sources":["../../../../../storage-blob/src/utils/utils.node.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAA6B,EAC7B,MAAc,EACd,MAAc,EACd,GAAW,EACX,QAAyB;IAEzB,IAAI,GA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,EAAE,CAAC,OAAO,EAAE,CAAC,GAAU,EAAE,EAAE;YAC5B,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAExB,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AAE9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC,gBAAgB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport * as fs from \"fs\";\nimport * as util from \"util\";\nimport { REQUEST_TIMEOUT } from \"./constants\";\n\n/**\n * Reads a readable stream into buffer. Fill the buffer from offset to end.\n *\n * @param stream - A Node.js Readable stream\n * @param buffer - Buffer to be filled, length must greater than or equal to offset\n * @param offset - From which position in the buffer to be filled, inclusive\n * @param end - To which position in the buffer to be filled, exclusive\n * @param encoding - Encoding of the Readable stream\n */\nexport async function streamToBuffer(\n stream: NodeJS.ReadableStream,\n buffer: Buffer,\n offset: number,\n end: number,\n encoding?: BufferEncoding,\n): Promise<void> {\n let pos = 0; // Position in stream\n const count = end - offset; // Total amount of data needed in stream\n\n return new Promise<void>((resolve, reject) => {\n const timeout = setTimeout(\n () => reject(new Error(`The operation cannot be completed in timeout.`)),\n REQUEST_TIMEOUT,\n );\n\n stream.on(\"readable\", () => {\n if (pos >= count) {\n clearTimeout(timeout);\n resolve();\n return;\n }\n\n let chunk = stream.read();\n if (!chunk) {\n return;\n }\n if (typeof chunk === \"string\") {\n chunk = Buffer.from(chunk, encoding);\n }\n\n // How much data needed in this chunk\n const chunkLength = pos + chunk.length > count ? count - pos : chunk.length;\n\n buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength);\n pos += chunkLength;\n });\n\n stream.on(\"end\", () => {\n clearTimeout(timeout);\n if (pos < count) {\n reject(\n new Error(\n `Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`,\n ),\n );\n }\n resolve();\n });\n\n stream.on(\"error\", (msg) => {\n clearTimeout(timeout);\n reject(msg);\n });\n });\n}\n\n/**\n * Reads a readable stream into buffer entirely.\n *\n * @param stream - A Node.js Readable stream\n * @param buffer - Buffer to be filled, length must greater than or equal to offset\n * @param encoding - Encoding of the Readable stream\n * @returns with the count of bytes read.\n * @throws `RangeError` If buffer size is not big enough.\n */\nexport async function streamToBuffer2(\n stream: NodeJS.ReadableStream,\n buffer: Buffer,\n encoding?: BufferEncoding,\n): Promise<number> {\n let pos = 0; // Position in stream\n const bufferSize = buffer.length;\n\n return new Promise<number>((resolve, reject) => {\n stream.on(\"readable\", () => {\n let chunk = stream.read();\n if (!chunk) {\n return;\n }\n if (typeof chunk === \"string\") {\n chunk = Buffer.from(chunk, encoding);\n }\n\n if (pos + chunk.length > bufferSize) {\n reject(new Error(`Stream exceeds buffer size. Buffer size: ${bufferSize}`));\n return;\n }\n\n buffer.fill(chunk, pos, pos + chunk.length);\n pos += chunk.length;\n });\n\n stream.on(\"end\", () => {\n resolve(pos);\n });\n\n stream.on(\"error\", reject);\n });\n}\n\n/**\n * Reads a readable stream into a buffer.\n *\n * @param stream - A Node.js Readable stream\n * @param encoding - Encoding of the Readable stream\n * @returns with the count of bytes read.\n */\nexport async function streamToBuffer3(\n readableStream: NodeJS.ReadableStream,\n encoding?: BufferEncoding,\n): Promise<Buffer> {\n return new Promise((resolve, reject) => {\n const chunks: Buffer[] = [];\n readableStream.on(\"data\", (data: Buffer | string) => {\n chunks.push(data instanceof Buffer ? data : Buffer.from(data, encoding));\n });\n readableStream.on(\"end\", () => {\n resolve(Buffer.concat(chunks));\n });\n readableStream.on(\"error\", reject);\n });\n}\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Writes the content of a readstream to a local file. Returns a Promise which is completed after the file handle is closed.\n *\n * @param rs - The read stream.\n * @param file - Destination file path.\n */\nexport async function readStreamToLocalFile(\n rs: NodeJS.ReadableStream,\n file: string,\n): Promise<void> {\n return new Promise<void>((resolve, reject) => {\n const ws = fs.createWriteStream(file);\n\n rs.on(\"error\", (err: Error) => {\n reject(err);\n });\n\n ws.on(\"error\", (err: Error) => {\n reject(err);\n });\n\n ws.on(\"close\", resolve);\n\n rs.pipe(ws);\n });\n}\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Promisified version of fs.stat().\n */\nexport const fsStat = util.promisify(fs.stat);\n\nexport const fsCreateReadStream = fs.createReadStream;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AccountSASPermissions.js","sourceRoot":"","sources":["../../../src/AccountSASPermissions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;;;GAQG;AACH,MAAM,OAAO,qBAAqB;IAAlC;QA2CE;;WAEG;QACI,SAAI,GAAY,KAAK,CAAC;QAE7B;;WAEG;QACI,UAAK,GAAY,KAAK,CAAC;QAE9B;;WAEG;QACI,WAAM,GAAY,KAAK,CAAC;QAE/B;;WAEG;QACI,SAAI,GAAY,KAAK,CAAC;QAE7B;;WAEG;QACI,QAAG,GAAY,KAAK,CAAC;QAE5B;;WAEG;QACI,WAAM,GAAY,KAAK,CAAC;QAE/B;;WAEG;QACI,WAAM,GAAY,KAAK,CAAC;QAE/B;;WAEG;QACI,YAAO,GAAY,KAAK,CAAC;IA2ClC,CAAC;IA3HC;;;;OAIG;IACI,MAAM,CAAC,KAAK,CAAC,WAAmB;QACrC,MAAM,qBAAqB,GAAG,IAAI,qBAAqB,EAAE,CAAC;QAE1D,KAAK,MAAM,CAAC,IAAI,WAAW,EAAE;YAC3B,QAAQ,CAAC,EAAE;gBACT,KAAK,GAAG;oBACN,qBAAqB,CAAC,IAAI,GAAG,IAAI,CAAC;oBAClC,MAAM;gBACR,KAA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,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACvB;QACD,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACvB;QACD,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACvB;QACD,OAAO,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * This is a helper class to construct a string representing the permissions granted by an AccountSAS. Setting a value\n * to true means that any SAS which uses these permissions will grant permissions for that operation. Once all the\n * values are set, this should be serialized with toString and set as the permissions field on an\n * {@link AccountSASSignatureValues} object. It is possible to construct the permissions string without this class, but\n * the order of the permissions is particular and this class guarantees correctness.\n */\nexport class AccountSASPermissions {\n /**\n * Parse initializes the AccountSASPermissions fields from a string.\n *\n * @param permissions -\n */\n public static parse(permissions: string): AccountSASPermissions {\n const accountSASPermissions = new AccountSASPermissions();\n\n for (const c of permissions) {\n switch (c) {\n case \"r\":\n accountSASPermissions.read = true;\n break;\n case \"w\":\n accountSASPermissions.write = true;\n break;\n case \"d\":\n accountSASPermissions.delete = true;\n break;\n case \"l\":\n accountSASPermissions.list = true;\n break;\n case \"a\":\n accountSASPermissions.add = true;\n break;\n case \"c\":\n accountSASPermissions.create = true;\n break;\n case \"u\":\n accountSASPermissions.update = true;\n break;\n case \"p\":\n accountSASPermissions.process = true;\n break;\n default:\n throw new RangeError(`Invalid permission character: ${c}`);\n }\n }\n\n return accountSASPermissions;\n }\n\n /**\n * Permission to read resources granted.\n */\n public read: boolean = false;\n\n /**\n * Permission to write resources granted.\n */\n public write: boolean = false;\n\n /**\n * Permission to delete queues and messages granted.\n */\n public delete: boolean = false;\n\n /**\n * Permission to list queues granted.\n */\n public list: boolean = false;\n\n /**\n * Permission to add messages, table entities, and append to blobs granted.\n */\n public add: boolean = false;\n\n /**\n * Permission to create queues, blobs and files granted.\n */\n public create: boolean = false;\n\n /**\n * Permissions to update messages and table entities granted.\n */\n public update: boolean = false;\n\n /**\n * Permission to get and delete messages granted.\n */\n public process: boolean = false;\n\n /**\n * Produces the SAS permissions string for an Azure Storage account.\n * Call this method to set AccountSASSignatureValues Permissions field.\n *\n * Using this method will guarantee the resource types are in\n * an order accepted by the service.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas\n *\n */\n public toString(): string {\n // The order of the characters should be as specified here to ensure correctness:\n // https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas\n // Use a string array instead of string concatenating += operator for performance\n const permissions: string[] = [];\n if (this.read) {\n permissions.push(\"r\");\n }\n if (this.write) {\n permissions.push(\"w\");\n }\n if (this.delete) {\n permissions.push(\"d\");\n }\n if (this.list) {\n permissions.push(\"l\");\n }\n if (this.add) {\n permissions.push(\"a\");\n }\n if (this.create) {\n permissions.push(\"c\");\n }\n if (this.update) {\n permissions.push(\"u\");\n }\n if (this.process) {\n permissions.push(\"p\");\n }\n return permissions.join(\"\");\n }\n}\n"]}
1
+ {"version":3,"file":"AccountSASPermissions.js","sourceRoot":"","sources":["../../../src/AccountSASPermissions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;;;GAQG;AACH,MAAM,OAAO,qBAAqB;IAAlC;QA2CE;;WAEG;QACI,SAAI,GAAY,KAAK,CAAC;QAE7B;;WAEG;QACI,UAAK,GAAY,KAAK,CAAC;QAE9B;;WAEG;QACI,WAAM,GAAY,KAAK,CAAC;QAE/B;;WAEG;QACI,SAAI,GAAY,KAAK,CAAC;QAE7B;;WAEG;QACI,QAAG,GAAY,KAAK,CAAC;QAE5B;;WAEG;QACI,WAAM,GAAY,KAAK,CAAC;QAE/B;;WAEG;QACI,WAAM,GAAY,KAAK,CAAC;QAE/B;;WAEG;QAC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AAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,OAAO,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * This is a helper class to construct a string representing the permissions granted by an AccountSAS. Setting a value\n * to true means that any SAS which uses these permissions will grant permissions for that operation. Once all the\n * values are set, this should be serialized with toString and set as the permissions field on an\n * {@link AccountSASSignatureValues} object. It is possible to construct the permissions string without this class, but\n * the order of the permissions is particular and this class guarantees correctness.\n */\nexport class AccountSASPermissions {\n /**\n * Parse initializes the AccountSASPermissions fields from a string.\n *\n * @param permissions -\n */\n public static parse(permissions: string): AccountSASPermissions {\n const accountSASPermissions = new AccountSASPermissions();\n\n for (const c of permissions) {\n switch (c) {\n case \"r\":\n accountSASPermissions.read = true;\n break;\n case \"w\":\n accountSASPermissions.write = true;\n break;\n case \"d\":\n accountSASPermissions.delete = true;\n break;\n case \"l\":\n accountSASPermissions.list = true;\n break;\n case \"a\":\n accountSASPermissions.add = true;\n break;\n case \"c\":\n accountSASPermissions.create = true;\n break;\n case \"u\":\n accountSASPermissions.update = true;\n break;\n case \"p\":\n accountSASPermissions.process = true;\n break;\n default:\n throw new RangeError(`Invalid permission character: ${c}`);\n }\n }\n\n return accountSASPermissions;\n }\n\n /**\n * Permission to read resources granted.\n */\n public read: boolean = false;\n\n /**\n * Permission to write resources granted.\n */\n public write: boolean = false;\n\n /**\n * Permission to delete queues and messages granted.\n */\n public delete: boolean = false;\n\n /**\n * Permission to list queues granted.\n */\n public list: boolean = false;\n\n /**\n * Permission to add messages, table entities, and append to blobs granted.\n */\n public add: boolean = false;\n\n /**\n * Permission to create queues, blobs and files granted.\n */\n public create: boolean = false;\n\n /**\n * Permissions to update messages and table entities granted.\n */\n public update: boolean = false;\n\n /**\n * Permission to get and delete messages granted.\n */\n public process: boolean = false;\n\n /**\n * Produces the SAS permissions string for an Azure Storage account.\n * Call this method to set AccountSASSignatureValues Permissions field.\n *\n * Using this method will guarantee the resource types are in\n * an order accepted by the service.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas\n *\n */\n public toString(): string {\n // The order of the characters should be as specified here to ensure correctness:\n // https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas\n // Use a string array instead of string concatenating += operator for performance\n const permissions: string[] = [];\n if (this.read) {\n permissions.push(\"r\");\n }\n if (this.write) {\n permissions.push(\"w\");\n }\n if (this.delete) {\n permissions.push(\"d\");\n }\n if (this.list) {\n permissions.push(\"l\");\n }\n if (this.add) {\n permissions.push(\"a\");\n }\n if (this.create) {\n permissions.push(\"c\");\n }\n if (this.update) {\n permissions.push(\"u\");\n }\n if (this.process) {\n permissions.push(\"p\");\n }\n return permissions.join(\"\");\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AccountSASResourceTypes.js","sourceRoot":"","sources":["../../../src/AccountSASResourceTypes.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;;;GAQG;AACH,MAAM,OAAO,uBAAuB;IAApC;QA6BE;;WAEG;QACI,YAAO,GAAY,KAAK,CAAC;QAEhC;;WAEG;QACI,cAAS,GAAY,KAAK,CAAC;QAElC;;WAEG;QACI,WAAM,GAAY,KAAK,CAAC;IAqBjC,CAAC;IA9DC;;;;;OAKG;IACI,MAAM,CAAC,KAAK,CAAC,aAAqB;QACvC,MAAM,uBAAuB,GAAG,IAAI,uBAAuB,EAAE,CAAC;QAE9D,KAAK,MAAM,CAAC,IAAI,aAAa,EAAE;YAC7B,QAAQ,CAAC,EAAE;gBACT,KAAK,GAAG;oBACN,uBAAuB,CAAC,OAAO,GAAG,IAAI,CAAC;oBACvC,MAAM;gBACR,KAAK,GAAG;oBACN,uBAAuB,CAAC,SAAS,GAAG,IAAI,CAAC;oBACzC,MAAM;gBACR,KAAK,GAAG;oBACN,uBAAuB,CAAC,MAAM,GAAG,IAAI,CAAC;oBACtC,MAAM;gBACR;oBACE,MAAM,IAAI,UAAU,CAAC,0BAA0B,CAAC,EAAE,CAAC,CAAC;aACvD;SACF;QAED,OAAO,uBAAuB,CAAC;IACjC,CAAC;IAiBD;;;;;OAKG;IACI,QAAQ;QACb,MAAM,aAAa,GAAa,EAAE,CAAC;QACnC,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACzB;QACD,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACzB;QACD,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACzB;QACD,OAAO,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * This is a helper class to construct a string representing the resources accessible by an AccountSAS. Setting a value\n * to true means that any SAS which uses these permissions will grant access to that resource type. Once all the\n * values are set, this should be serialized with toString and set as the resources field on an\n * {@link AccountSASSignatureValues} object. It is possible to construct the resources string without this class, but\n * the order of the resources is particular and this class guarantees correctness.\n */\nexport class AccountSASResourceTypes {\n /**\n * Creates an {@link AccountSASResourceTypes} from the specified resource types string. This method will throw an\n * Error if it encounters a character that does not correspond to a valid resource type.\n *\n * @param resourceTypes -\n */\n public static parse(resourceTypes: string): AccountSASResourceTypes {\n const accountSASResourceTypes = new AccountSASResourceTypes();\n\n for (const c of resourceTypes) {\n switch (c) {\n case \"s\":\n accountSASResourceTypes.service = true;\n break;\n case \"c\":\n accountSASResourceTypes.container = true;\n break;\n case \"o\":\n accountSASResourceTypes.object = true;\n break;\n default:\n throw new RangeError(`Invalid resource type: ${c}`);\n }\n }\n\n return accountSASResourceTypes;\n }\n\n /**\n * Permission to access service level APIs granted.\n */\n public service: boolean = false;\n\n /**\n * Permission to access container level APIs (Blob Containers, Tables, Queues, File Shares) granted.\n */\n public container: boolean = false;\n\n /**\n * Permission to access object level APIs (Blobs, Table Entities, Queue Messages, Files) granted.\n */\n public object: boolean = false;\n\n /**\n * Converts the given resource types to a string.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas\n *\n */\n public toString(): string {\n const resourceTypes: string[] = [];\n if (this.service) {\n resourceTypes.push(\"s\");\n }\n if (this.container) {\n resourceTypes.push(\"c\");\n }\n if (this.object) {\n resourceTypes.push(\"o\");\n }\n return resourceTypes.join(\"\");\n }\n}\n"]}
1
+ {"version":3,"file":"AccountSASResourceTypes.js","sourceRoot":"","sources":["../../../src/AccountSASResourceTypes.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;;;GAQG;AACH,MAAM,OAAO,uBAAuB;IAApC;QA6BE;;WAEG;QACI,YAAO,GAAY,KAAK,CAAC;QAEhC;;WAEG;QACI,cAAS,GAAY,KAAK,CAAC;QAElC;;WAEG;QACI,WAAM,GAAY,KAAK,CAAC;IAqBjC,CAAC;IA9DC;;;;;OAKG;IACI,MAAM,CAAC,KAAK,CAAC,aAAqB;QACvC,MAAM,uBAAuB,GAAG,IAAI,uBAAuB,EAAE,CAAC;QAE9D,KAAK,MAAM,CAAC,IAAI,aAAa,EAAE,CAAC;YAC9B,QAAQ,CAAC,EAAE,CAAC;gBACV,KAAK,GAAG;oBACN,uBAAuB,CAAC,OAAO,GAAG,IAAI,CAAC;oBACvC,MAAM;gBACR,KAAK,GAAG;oBACN,uBAAuB,CAAC,SAAS,GAAG,IAAI,CAAC;oBACzC,MAAM;gBACR,KAAK,GAAG;oBACN,uBAAuB,CAAC,MAAM,GAAG,IAAI,CAAC;oBACtC,MAAM;gBACR;oBACE,MAAM,IAAI,UAAU,CAAC,0BAA0B,CAAC,EAAE,CAAC,CAAC;YACxD,CAAC;QACH,CAAC;QAED,OAAO,uBAAuB,CAAC;IACjC,CAAC;IAiBD;;;;;OAKG;IACI,QAAQ;QACb,MAAM,aAAa,GAAa,EAAE,CAAC;QACnC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1B,CAAC;QACD,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1B,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1B,CAAC;QACD,OAAO,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * This is a helper class to construct a string representing the resources accessible by an AccountSAS. Setting a value\n * to true means that any SAS which uses these permissions will grant access to that resource type. Once all the\n * values are set, this should be serialized with toString and set as the resources field on an\n * {@link AccountSASSignatureValues} object. It is possible to construct the resources string without this class, but\n * the order of the resources is particular and this class guarantees correctness.\n */\nexport class AccountSASResourceTypes {\n /**\n * Creates an {@link AccountSASResourceTypes} from the specified resource types string. This method will throw an\n * Error if it encounters a character that does not correspond to a valid resource type.\n *\n * @param resourceTypes -\n */\n public static parse(resourceTypes: string): AccountSASResourceTypes {\n const accountSASResourceTypes = new AccountSASResourceTypes();\n\n for (const c of resourceTypes) {\n switch (c) {\n case \"s\":\n accountSASResourceTypes.service = true;\n break;\n case \"c\":\n accountSASResourceTypes.container = true;\n break;\n case \"o\":\n accountSASResourceTypes.object = true;\n break;\n default:\n throw new RangeError(`Invalid resource type: ${c}`);\n }\n }\n\n return accountSASResourceTypes;\n }\n\n /**\n * Permission to access service level APIs granted.\n */\n public service: boolean = false;\n\n /**\n * Permission to access container level APIs (Blob Containers, Tables, Queues, File Shares) granted.\n */\n public container: boolean = false;\n\n /**\n * Permission to access object level APIs (Blobs, Table Entities, Queue Messages, Files) granted.\n */\n public object: boolean = false;\n\n /**\n * Converts the given resource types to a string.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas\n *\n */\n public toString(): string {\n const resourceTypes: string[] = [];\n if (this.service) {\n resourceTypes.push(\"s\");\n }\n if (this.container) {\n resourceTypes.push(\"c\");\n }\n if (this.object) {\n resourceTypes.push(\"o\");\n }\n return resourceTypes.join(\"\");\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AccountSASServices.js","sourceRoot":"","sources":["../../../src/AccountSASServices.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;;;GAQG;AACH,MAAM,OAAO,kBAAkB;IAA/B;QAgCE;;WAEG;QACI,SAAI,GAAY,KAAK,CAAC;QAE7B;;WAEG;QACI,SAA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right (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * This is a helper class to construct a string representing the services accessible by an AccountSAS. Setting a value\n * to true means that any SAS which uses these permissions will grant access to that service. Once all the\n * values are set, this should be serialized with toString and set as the services field on an\n * {@link AccountSASSignatureValues} object. It is possible to construct the services string without this class, but\n * the order of the services is particular and this class guarantees correctness.\n */\nexport class AccountSASServices {\n /**\n * Creates an {@link AccountSASServices} from the specified services string. This method will throw an\n * Error if it encounters a character that does not correspond to a valid service.\n *\n * @param services -\n */\n public static parse(services: string): AccountSASServices {\n const accountSASServices = new AccountSASServices();\n\n for (const c of services) {\n switch (c) {\n case \"b\":\n accountSASServices.blob = true;\n break;\n case \"f\":\n accountSASServices.file = true;\n break;\n case \"q\":\n accountSASServices.queue = true;\n break;\n case \"t\":\n accountSASServices.table = true;\n break;\n default:\n throw new RangeError(`Invalid service character: ${c}`);\n }\n }\n\n return accountSASServices;\n }\n\n /**\n * Permission to access blob resources granted.\n */\n public blob: boolean = false;\n\n /**\n * Permission to access file resources granted.\n */\n public file: boolean = false;\n\n /**\n * Permission to access queue resources granted.\n */\n public queue: boolean = false;\n\n /**\n * Permission to access table resources granted.\n */\n public table: boolean = false;\n\n /**\n * Converts the given services to a string.\n *\n */\n public toString(): string {\n const services: string[] = [];\n if (this.blob) {\n services.push(\"b\");\n }\n if (this.table) {\n services.push(\"t\");\n }\n if (this.queue) {\n services.push(\"q\");\n }\n if (this.file) {\n services.push(\"f\");\n }\n return services.join(\"\");\n }\n}\n"]}
1
+ {"version":3,"file":"AccountSASServices.js","sourceRoot":"","sources":["../../../src/AccountSASServices.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;;;GAQG;AACH,MAAM,OAAO,kBAAkB;IAA/B;QAgCE;;WAEG;QACI,SAAI,GAAY,KAAK,CAAC;QAE7B;;WAEG;QACI,SAAI,GAAY,KAAK,CAAC;QAE7B;;W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AC,CAAC;IAC3B,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * This is a helper class to construct a string representing the services accessible by an AccountSAS. Setting a value\n * to true means that any SAS which uses these permissions will grant access to that service. Once all the\n * values are set, this should be serialized with toString and set as the services field on an\n * {@link AccountSASSignatureValues} object. It is possible to construct the services string without this class, but\n * the order of the services is particular and this class guarantees correctness.\n */\nexport class AccountSASServices {\n /**\n * Creates an {@link AccountSASServices} from the specified services string. This method will throw an\n * Error if it encounters a character that does not correspond to a valid service.\n *\n * @param services -\n */\n public static parse(services: string): AccountSASServices {\n const accountSASServices = new AccountSASServices();\n\n for (const c of services) {\n switch (c) {\n case \"b\":\n accountSASServices.blob = true;\n break;\n case \"f\":\n accountSASServices.file = true;\n break;\n case \"q\":\n accountSASServices.queue = true;\n break;\n case \"t\":\n accountSASServices.table = true;\n break;\n default:\n throw new RangeError(`Invalid service character: ${c}`);\n }\n }\n\n return accountSASServices;\n }\n\n /**\n * Permission to access blob resources granted.\n */\n public blob: boolean = false;\n\n /**\n * Permission to access file resources granted.\n */\n public file: boolean = false;\n\n /**\n * Permission to access queue resources granted.\n */\n public queue: boolean = false;\n\n /**\n * Permission to access table resources granted.\n */\n public table: boolean = false;\n\n /**\n * Converts the given services to a string.\n *\n */\n public toString(): string {\n const services: string[] = [];\n if (this.blob) {\n services.push(\"b\");\n }\n if (this.table) {\n services.push(\"t\");\n }\n if (this.queue) {\n services.push(\"q\");\n }\n if (this.file) {\n services.push(\"f\");\n }\n return services.join(\"\");\n }\n}\n"]}
@@ -39,7 +39,7 @@ export function generateAccountSASQueryParameters(accountSASSignatureValues, sha
39
39
  accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "",
40
40
  accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "",
41
41
  version,
42
- "",
42
+ "", // Reserved for encryption scope
43
43
  "", // Account SAS requires an additional newline character
44
44
  ].join("\n");
45
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AccountSASSignatureValues.js","sourceRoot":"","sources":["../../../src/AccountSASSignatureValues.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAe,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AA8D5D;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iCAAiC,CAC/C,yBAAoD,EACpD,mBAA+C;IAE/C,MAAM,OAAO,GAAG,yBAAyB,CAAC,OAAO;QAC/C,CAAC,CAAC,yBAAyB,CAAC,OAAO;QACnC,CAAC,CAAC,eAAe,CAAC;IAEpB,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,KAAK,CACnD,yBAAyB,CAAC,WAAW,CAAC,QAAQ,EAAE,CACjD,CAAC,QAAQ,EAAE,CAAC;IACb,MAAM,cAAc,GAAG,kBAAkB,CAAC,KAAK,CAAC,yBAAyB,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC/F,MAAM,mBAAmB,GAAG,uBAAuB,CAAC,KAAK,CACvD,yBAAyB,CAAC,aAAa,CACxC,CAAC,QAAQ,EAAE,CAAC;IAEb,IAAI,YAAoB,CAAC;IAEzB,IAAI,OAAO,IAAI,YAAY,EAAE;QAC3B,YAAY,GAAG;YACb,mBAAmB,CAAC,WAAW;YAC/B,iBAAiB;YACjB,cAAc;YACd,mBAAmB;YACnB,yBAAyB,CAAC,Q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,EAClC,yBAAyB,CAAC,SAAS,EACnC,yBAAyB,CAAC,OAAO,CAClC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AccountSASPermissions } from \"./AccountSASPermissions\";\nimport { AccountSASResourceTypes } from \"./AccountSASResourceTypes\";\nimport { AccountSASServices } from \"./AccountSASServices\";\nimport { StorageSharedKeyCredential } from \"../../storage-blob/src/credentials/StorageSharedKeyCredential\";\nimport { SasIPRange, ipRangeToString } from \"./SasIPRange\";\nimport { SASProtocol, SASQueryParameters } from \"./SASQueryParameters\";\nimport { SERVICE_VERSION } from \"./utils/constants\";\nimport { truncatedISO8061Date } from \"./utils/utils.common\";\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * AccountSASSignatureValues is used to generate a Shared Access Signature (SAS) for an Azure Storage account. Once\n * all the values here are set appropriately, call generateSASQueryParameters() to obtain a representation of the SAS\n * which can actually be applied to queue urls. Note: that both this class and {@link SASQueryParameters} exist because\n * the former is mutable and a logical representation while the latter is immutable and used to generate actual REST\n * requests.\n *\n * @see https://docs.microsoft.com/en-us/azure/storage/common/storage-dotnet-shared-access-signature-part-1\n * for more conceptual information on SAS\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas\n * for descriptions of the parameters, including which are required\n */\nexport interface AccountSASSignatureValues {\n /**\n * If not provided, this defaults to the service version targeted by this version of the 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 /**\n * The time after which the SAS will no longer work.\n */\n expiresOn: Date;\n\n /**\n * Specifies which operations the SAS user may perform. Please refer to {@link AccountSASPermissions} for help\n * constructing the permissions string.\n */\n permissions: AccountSASPermissions;\n\n /**\n * Optional. IP range allowed.\n */\n ipRange?: SasIPRange;\n\n /**\n * The values that indicate the services accessible with this SAS. Please refer to {@link AccountSASServices} to\n * construct this value.\n */\n services: string;\n\n /**\n * The values that indicate the resource types accessible with this SAS. Please refer\n * to {@link AccountSASResourceTypes} to construct this value.\n */\n resourceTypes: string;\n}\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Generates a {@link SASQueryParameters} object which contains all SAS query parameters needed to make an actual\n * REST request.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas\n *\n * @param accountSASSignatureValues - SAS Signature values of the account\n * @param sharedKeyCredential - Shared key credential.\n */\nexport function generateAccountSASQueryParameters(\n accountSASSignatureValues: AccountSASSignatureValues,\n sharedKeyCredential: StorageSharedKeyCredential,\n): SASQueryParameters {\n const version = accountSASSignatureValues.version\n ? accountSASSignatureValues.version\n : SERVICE_VERSION;\n\n const parsedPermissions = AccountSASPermissions.parse(\n accountSASSignatureValues.permissions.toString(),\n ).toString();\n const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString();\n const parsedResourceTypes = AccountSASResourceTypes.parse(\n accountSASSignatureValues.resourceTypes,\n ).toString();\n\n let stringToSign: string;\n\n if (version >= \"2020-12-06\") {\n stringToSign = [\n sharedKeyCredential.accountName,\n parsedPermissions,\n parsedServices,\n parsedResourceTypes,\n accountSASSignatureValues.startsOn\n ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false)\n : \"\",\n truncatedISO8061Date(accountSASSignatureValues.expiresOn, false),\n accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : \"\",\n accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : \"\",\n version,\n \"\", // Reserved for encryption scope\n \"\", // Account SAS requires an additional newline character\n ].join(\"\\n\");\n } else {\n stringToSign = [\n sharedKeyCredential.accountName,\n parsedPermissions,\n parsedServices,\n parsedResourceTypes,\n accountSASSignatureValues.startsOn\n ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false)\n : \"\",\n truncatedISO8061Date(accountSASSignatureValues.expiresOn, false),\n accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : \"\",\n accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : \"\",\n version,\n \"\", // Account SAS requires an additional newline character\n ].join(\"\\n\");\n }\n\n const signature: string = sharedKeyCredential.computeHMACSHA256(stringToSign);\n\n return new SASQueryParameters(\n version,\n signature,\n parsedPermissions,\n parsedServices,\n parsedResourceTypes,\n accountSASSignatureValues.protocol,\n accountSASSignatureValues.startsOn,\n accountSASSignatureValues.expiresOn,\n accountSASSignatureValues.ipRange,\n );\n}\n"]}
1
+ {"version":3,"file":"AccountSASSignatureValues.js","sourceRoot":"","sources":["../../../src/AccountSASSignatureValues.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAe,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AA8D5D;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iCAAiC,CAC/C,yBAAoD,EACpD,mBAA+C;IAE/C,MAAM,OAAO,GAAG,yBAAyB,CAAC,OAAO;QAC/C,CAAC,CAAC,yBAAyB,CAAC,OAAO;QACnC,CAAC,CAAC,eAAe,CAAC;IAEpB,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,KAAK,CACnD,yBAAyB,CAAC,WAAW,CAAC,QAAQ,EAAE,CACjD,CAAC,QAAQ,EAAE,CAAC;IACb,MAAM,cAAc,GAAG,kBAAkB,CAAC,KAAK,CAAC,yBAAyB,CAAC,QAAQ,CAAC,CAAC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AAQ,CAAC,CAAC,CAAC,EAAE;YAC5E,OAAO;YACP,EAAE,EAAE,uDAAuD;SAC5D,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC;IAED,MAAM,SAAS,GAAW,mBAAmB,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAE9E,OAAO,IAAI,kBAAkB,CAC3B,OAAO,EACP,SAAS,EACT,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,yBAAyB,CAAC,QAAQ,EAClC,yBAAyB,CAAC,QAAQ,EAClC,yBAAyB,CAAC,SAAS,EACnC,yBAAyB,CAAC,OAAO,CAClC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AccountSASPermissions } from \"./AccountSASPermissions\";\nimport { AccountSASResourceTypes } from \"./AccountSASResourceTypes\";\nimport { AccountSASServices } from \"./AccountSASServices\";\nimport { StorageSharedKeyCredential } from \"../../storage-blob/src/credentials/StorageSharedKeyCredential\";\nimport { SasIPRange, ipRangeToString } from \"./SasIPRange\";\nimport { SASProtocol, SASQueryParameters } from \"./SASQueryParameters\";\nimport { SERVICE_VERSION } from \"./utils/constants\";\nimport { truncatedISO8061Date } from \"./utils/utils.common\";\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * AccountSASSignatureValues is used to generate a Shared Access Signature (SAS) for an Azure Storage account. Once\n * all the values here are set appropriately, call generateSASQueryParameters() to obtain a representation of the SAS\n * which can actually be applied to queue urls. Note: that both this class and {@link SASQueryParameters} exist because\n * the former is mutable and a logical representation while the latter is immutable and used to generate actual REST\n * requests.\n *\n * @see https://docs.microsoft.com/en-us/azure/storage/common/storage-dotnet-shared-access-signature-part-1\n * for more conceptual information on SAS\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas\n * for descriptions of the parameters, including which are required\n */\nexport interface AccountSASSignatureValues {\n /**\n * If not provided, this defaults to the service version targeted by this version of the 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 /**\n * The time after which the SAS will no longer work.\n */\n expiresOn: Date;\n\n /**\n * Specifies which operations the SAS user may perform. Please refer to {@link AccountSASPermissions} for help\n * constructing the permissions string.\n */\n permissions: AccountSASPermissions;\n\n /**\n * Optional. IP range allowed.\n */\n ipRange?: SasIPRange;\n\n /**\n * The values that indicate the services accessible with this SAS. Please refer to {@link AccountSASServices} to\n * construct this value.\n */\n services: string;\n\n /**\n * The values that indicate the resource types accessible with this SAS. Please refer\n * to {@link AccountSASResourceTypes} to construct this value.\n */\n resourceTypes: string;\n}\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Generates a {@link SASQueryParameters} object which contains all SAS query parameters needed to make an actual\n * REST request.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas\n *\n * @param accountSASSignatureValues - SAS Signature values of the account\n * @param sharedKeyCredential - Shared key credential.\n */\nexport function generateAccountSASQueryParameters(\n accountSASSignatureValues: AccountSASSignatureValues,\n sharedKeyCredential: StorageSharedKeyCredential,\n): SASQueryParameters {\n const version = accountSASSignatureValues.version\n ? accountSASSignatureValues.version\n : SERVICE_VERSION;\n\n const parsedPermissions = AccountSASPermissions.parse(\n accountSASSignatureValues.permissions.toString(),\n ).toString();\n const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString();\n const parsedResourceTypes = AccountSASResourceTypes.parse(\n accountSASSignatureValues.resourceTypes,\n ).toString();\n\n let stringToSign: string;\n\n if (version >= \"2020-12-06\") {\n stringToSign = [\n sharedKeyCredential.accountName,\n parsedPermissions,\n parsedServices,\n parsedResourceTypes,\n accountSASSignatureValues.startsOn\n ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false)\n : \"\",\n truncatedISO8061Date(accountSASSignatureValues.expiresOn, false),\n accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : \"\",\n accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : \"\",\n version,\n \"\", // Reserved for encryption scope\n \"\", // Account SAS requires an additional newline character\n ].join(\"\\n\");\n } else {\n stringToSign = [\n sharedKeyCredential.accountName,\n parsedPermissions,\n parsedServices,\n parsedResourceTypes,\n accountSASSignatureValues.startsOn\n ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false)\n : \"\",\n truncatedISO8061Date(accountSASSignatureValues.expiresOn, false),\n accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : \"\",\n accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : \"\",\n version,\n \"\", // Account SAS requires an additional newline character\n ].join(\"\\n\");\n }\n\n const signature: string = sharedKeyCredential.computeHMACSHA256(stringToSign);\n\n return new SASQueryParameters(\n version,\n signature,\n parsedPermissions,\n parsedServices,\n parsedResourceTypes,\n accountSASSignatureValues.protocol,\n accountSASSignatureValues.startsOn,\n accountSASSignatureValues.expiresOn,\n accountSASSignatureValues.ipRange,\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"QueueClient.js","sourceRoot":"","sources":["../../../src/QueueClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAmB,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AA6B1C,OAAO,EAAE,WAAW,EAA0B,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAChG,OAAO,EAAE,aAAa,EAAiB,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AACxF,OAAO,EACL,eAAe,EACf,4BAA4B,EAC5B,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAEhB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,0BAA0B,EAAE,MAAM,+DAA+D,CAAC;AAC3G,OAAO,EAAE,mBA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C,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE;gBAChD,wDAAwD;gBACxD,2BAA2B;gBAC3B,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;aAC9C;iBAAM,IAAI,iBAAiB,CAAC,SAAS,CAAC,EAAE;gBACvC,0FAA0F;gBAC1F,oHAAoH;gBACpH,4CAA4C;gBAC5C,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;aAC9C;iBAAM;gBACL,wCAAwC;gBACxC,2BAA2B;gBAC3B,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;aAC9C;YAED,IAAI,CAAC,SAAS,EAAE;gBACd,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;aACnD;YAED,OAAO,SAAS,CAAC;SAClB;QAAC,OAAO,KAAU,EAAE;YACnB,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;SAC3E;IACH,CAAC;IAED;;;;;;;;;;OAUG;IACI,cAAc,CAAC,OAAmC;QACvD,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,YAAY,0BAA0B,CAAC,EAAE;YAC5D,MAAM,UAAU,CACd,uFAAuF,CACxF,CAAC;SACH;QAED,MAAM,GAAG,GAAG,+BAA+B,iBAEvC,SAAS,EAAE,IAAI,CAAC,IAAI,IACjB,OAAO,GAEZ,IAAI,CAAC,UAAU,CAChB,CAAC,QAAQ,EAAE,CAAC;QAEb,OAAO,gBAAgB,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { TokenCredential, isTokenCredential } from \"@azure/core-auth\";\nimport { isNode } from \"@azure/core-util\";\nimport {\n EnqueuedMessage,\n DequeuedMessageItem,\n MessagesDequeueHeaders,\n MessagesEnqueueHeaders,\n MessagesPeekHeaders,\n MessageIdUpdateResponse,\n MessageIdDeleteResponse,\n MessagesClearResponse,\n PeekedMessageItem,\n QueueCreateHeaders,\n QueueDeleteResponse,\n QueueGetAccessPolicyHeaders,\n QueueGetPropertiesResponse,\n QueueSetAccessPolicyResponse,\n QueueSetMetadataResponse,\n SignedIdentifierModel,\n QueueCreateResponse,\n QueueDeleteHeaders,\n QueueSetMetadataHeaders,\n QueueGetPropertiesHeaders,\n QueueSetAccessPolicyHeaders,\n MessagesClearHeaders,\n MessageIdDeleteHeaders,\n MessageIdUpdateHeaders,\n} from \"./generatedModels\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { Messages, MessageId, Queue } from \"./generated/src/operationsInterfaces\";\nimport { newPipeline, StoragePipelineOptions, Pipeline } from \"../../storage-blob/src/Pipeline\";\nimport { StorageClient, CommonOptions, getStorageClientContext } from \"./StorageClient\";\nimport {\n appendToURLPath,\n extractConnectionStringParts,\n isIpEndpointStyle,\n truncatedISO8061Date,\n appendToURLQuery,\n WithResponse,\n assertResponse,\n} from \"./utils/utils.common\";\nimport { StorageSharedKeyCredential } from \"../../storage-blob/src/credentials/StorageSharedKeyCredential\";\nimport { AnonymousCredential } from \"../../storage-blob/src/credentials/AnonymousCredential\";\nimport { tracingClient } from \"./utils/tracing\";\nimport { Metadata } from \"./models\";\nimport { generateQueueSASQueryParameters } from \"./QueueSASSignatureValues\";\nimport { SasIPRange } from \"./SasIPRange\";\nimport { QueueSASPermissions } from \"./QueueSASPermissions\";\nimport { SASProtocol } from \"./SASQueryParameters\";\nimport { getDefaultProxySettings } from \"@azure/core-rest-pipeline\";\n\n/**\n * Options to configure {@link QueueClient.create} operation\n */\nexport interface QueueCreateOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * A collection of key-value string pair to associate with the queue object.\n * The keys need to be lower-case.\n */\n metadata?: Metadata;\n}\n\n/**\n * Options to configure {@link QueueClient.exists} operation\n */\nexport interface QueueExistsOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure {@link QueueClient.getProperties} operation\n */\nexport interface QueueGetPropertiesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure {@link QueueClient.delete} operation\n */\nexport interface QueueDeleteOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure {@link QueueClient.getAccessPolicy} operation\n */\nexport interface QueueGetAccessPolicyOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure {@link QueueClient.setAccessPolicy} operation\n */\nexport interface QueueSetAccessPolicyOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure {@link QueueClient.setMetadata} operation\n */\nexport interface QueueSetMetadataOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Signed identifier.\n */\nexport interface SignedIdentifier {\n /**\n * a unique id\n */\n id: string;\n /**\n * Access Policy\n */\n accessPolicy: {\n /**\n * the date-time the policy is active.\n */\n startsOn?: Date;\n /**\n * the date-time the policy expires.\n */\n expiresOn?: Date;\n /**\n * the permissions for the acl policy\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-queue-acl\n */\n permissions?: string;\n };\n}\n\n/**\n * Contains response data for the {@link QueueClient.getAccessPolicy} operation.\n */\nexport declare type QueueGetAccessPolicyResponse = WithResponse<\n {\n signedIdentifiers: SignedIdentifier[];\n } & QueueGetAccessPolicyHeaders,\n QueueGetAccessPolicyHeaders,\n SignedIdentifierModel[]\n>;\n\n/**\n * Options to configure {@link QueueClient.clearMessages} operation\n */\nexport interface QueueClearMessagesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/** Optional parameters. */\nexport interface MessagesEnqueueOptionalParams extends CommonOptions {\n /** The The timeout parameter is expressed in seconds. For more information, see <a href=\"https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations\">Setting Timeouts for Queue Service Operations.</a> */\n timeoutInSeconds?: number;\n /** Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. */\n requestId?: string;\n /** Optional. If specified, the request must be made using an x-ms-version of 2011-08-18 or later. If not specified, the default value is 0. Specifies the new visibility timeout value, in seconds, relative to server time. The new value must be larger than or equal to 0, and cannot be larger than 7 days. The visibility timeout of a message cannot be set to a value later than the expiry time. visibilitytimeout should be set to a value smaller than the time-to-live value. */\n visibilityTimeout?: number;\n /** Optional. Specifies the time-to-live interval for the message, in seconds. Prior to version 2017-07-29, the maximum time-to-live allowed is 7 days. For version 2017-07-29 or later, the maximum time-to-live can be any positive number, as well as -1 indicating that the message does not expire. If this parameter is omitted, the default time-to-live is 7 days. */\n messageTimeToLive?: number;\n}\n\n/**\n * Options to configure {@link QueueClient.sendMessage} operation\n */\nexport interface QueueSendMessageOptions extends MessagesEnqueueOptionalParams, CommonOptions {}\n\n/** Optional parameters. */\nexport interface MessagesDequeueOptionalParams extends CommonOptions {\n /** The The timeout parameter is expressed in seconds. For more information, see <a href=\"https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations\">Setting Timeouts for Queue Service Operations.</a> */\n timeoutInSeconds?: number;\n /** Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. */\n requestId?: string;\n /** Optional. A nonzero integer value that specifies the number of messages to retrieve from the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single message is retrieved from the queue with this operation. */\n numberOfMessages?: number;\n /** Optional. Specifies the new visibility timeout value, in seconds, relative to server time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility timeout of a message can be set to a value later than the expiry time. */\n visibilityTimeout?: number;\n}\n\n/**\n * Options to configure {@link QueueClient.receiveMessages} operation\n */\nexport interface QueueReceiveMessageOptions extends MessagesDequeueOptionalParams, CommonOptions {}\n\n/** Optional parameters. */\nexport interface MessagesPeekOptionalParams extends CommonOptions {\n /** The The timeout parameter is expressed in seconds. For more information, see <a href=\"https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations\">Setting Timeouts for Queue Service Operations.</a> */\n timeoutInSeconds?: number;\n /** Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. */\n requestId?: string;\n /** Optional. A nonzero integer value that specifies the number of messages to retrieve from the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single message is retrieved from the queue with this operation. */\n numberOfMessages?: number;\n}\n\n/**\n * Options to configure {@link QueueClient.peekMessages} operation\n */\nexport interface QueuePeekMessagesOptions extends MessagesPeekOptionalParams, CommonOptions {}\n\n/**\n * Contains the response data for the {@link QueueClient.sendMessage} operation.\n */\nexport declare type QueueSendMessageResponse = WithResponse<\n {\n /**\n * The ID of the sent Message.\n */\n messageId: string;\n /**\n * This value is required to delete the Message.\n * If deletion fails using this popreceipt then the message has been received\n * by another client.\n */\n popReceipt: string;\n /**\n * The time that the message was inserted into the\n * Queue.\n */\n insertedOn: Date;\n /**\n * The time that the message will expire and be\n * automatically deleted.\n */\n expiresOn: Date;\n /**\n * The time that the message will again become\n * visible in the Queue.\n */\n nextVisibleOn: Date;\n } & MessagesEnqueueHeaders,\n MessagesEnqueueHeaders,\n EnqueuedMessage[]\n>;\n\n/**\n * The object returned in the `receivedMessageItems` array when calling {@link QueueClient.receiveMessages}.\n *\n * See: {@link QueueReceiveMessageResponse}\n */\nexport declare type ReceivedMessageItem = DequeuedMessageItem;\n\n/**\n * Contains the response data for the {@link QueueClient.receiveMessages} operation.\n */\nexport declare type QueueReceiveMessageResponse = WithResponse<\n {\n receivedMessageItems: ReceivedMessageItem[];\n } & MessagesDequeueHeaders,\n MessagesDequeueHeaders,\n ReceivedMessageItem[]\n>;\n\n/**\n * Contains the response data for the {@link QueueClient.peekMessages} operation.\n */\nexport declare type QueuePeekMessagesResponse = WithResponse<\n {\n peekedMessageItems: PeekedMessageItem[];\n } & MessagesPeekHeaders,\n MessagesPeekHeaders,\n PeekedMessageItem[]\n>;\n\n/**\n * Options to configure the {@link QueueClient.deleteMessage} operation\n */\nexport interface QueueDeleteMessageOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Contains response data for the {@link QueueClient.updateMessage} operation.\n */\nexport declare type QueueUpdateMessageResponse = MessageIdUpdateResponse;\n\n/**\n * Contains response data for the {@link QueueClient.deleteMessage} operation.\n */\nexport declare type QueueDeleteMessageResponse = MessageIdDeleteResponse;\n\n/**\n * Contains response data for the {@link QueueClient.clearMessages} operation.\n */\nexport declare type QueueClearMessagesResponse = MessagesClearResponse;\n\n/**\n * Options to configure {@link QueueClient.updateMessage} operation\n */\nexport interface QueueUpdateMessageOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Contains response data for the {@link QueueClient.createIfNotExists} operation.\n */\nexport interface QueueCreateIfNotExistsResponse extends QueueCreateResponse {\n /**\n * Indicate whether the queue is successfully created. Is false when the queue is not changed as it already exists.\n */\n succeeded: boolean;\n}\n\n/**\n * Contains response data for the {@link QueueClient.deleteIfExists} operation.\n */\nexport interface QueueDeleteIfExistsResponse extends QueueDeleteResponse {\n /**\n * Indicate whether the queue is successfully deleted. Is false if the queue does not exist in the first place.\n */\n succeeded: boolean;\n}\n\n/**\n * Options to configure {@link QueueClient.generateSasUrl} operation.\n */\nexport interface QueueGenerateSasUrlOptions {\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, HTTPS only or HTTPSandHTTP\n */\n protocol?: SASProtocol;\n\n /**\n * Optional. When the SAS will take effect.\n */\n startsOn?: Date;\n\n /**\n * Optional only when identifier is provided. The time after which the SAS will no longer work.\n */\n expiresOn?: Date;\n\n /**\n * Optional only when identifier is provided.\n * Please refer to {@link QueueSASPermissions} for help constructing the permissions string.\n */\n permissions?: QueueSASPermissions;\n\n /**\n * Optional. IP ranges allowed in this SAS.\n */\n ipRange?: SasIPRange;\n\n /**\n * Optional. The name of the access policy on the queue this SAS references if any.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy\n */\n identifier?: string;\n}\n\n/**\n * A QueueClient represents a URL to an Azure Storage Queue's messages allowing you to manipulate its messages.\n */\nexport class QueueClient extends StorageClient {\n /**\n * messagesContext provided by protocol layer.\n */\n private messagesContext: Messages;\n /**\n * queueContext provided by protocol layer.\n */\n private queueContext: Queue;\n private _name: string;\n private _messagesUrl: string;\n\n /**\n * The name of the queue.\n */\n public get name(): string {\n return this._name;\n }\n\n /**\n * Creates an instance of QueueClient.\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 queueName - Queue name.\n * @param options - Options to configure the HTTP pipeline.\n */\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 constructor(connectionString: string, queueName: string, options?: StoragePipelineOptions);\n /**\n * Creates an instance of QueueClient.\n *\n * @param url - A URL string pointing to Azure Storage queue, such as\n * \"https://myaccount.queue.core.windows.net/myqueue\". You can\n * append a SAS if using AnonymousCredential, such as\n * \"https://myaccount.queue.core.windows.net/myqueue?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 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 QueueClient.\n *\n * @param url - A URL string pointing to Azure Storage queue, such as\n * \"https://myaccount.queue.core.windows.net/myqueue\". You can\n * append a SAS if using AnonymousCredential, such as\n * \"https://myaccount.queue.core.windows.net/myqueue?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 urlOrConnectionString: string,\n credentialOrPipelineOrQueueName?:\n | StorageSharedKeyCredential\n | AnonymousCredential\n | TokenCredential\n | Pipeline\n | 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 ) {\n options = options || {};\n let pipeline: Pipeline;\n let url: string;\n if (credentialOrPipelineOrQueueName instanceof Pipeline) {\n // (url: string, pipeline: Pipeline)\n url = urlOrConnectionString;\n pipeline = credentialOrPipelineOrQueueName;\n } else if (\n (isNode && credentialOrPipelineOrQueueName instanceof StorageSharedKeyCredential) ||\n credentialOrPipelineOrQueueName instanceof AnonymousCredential ||\n isTokenCredential(credentialOrPipelineOrQueueName)\n ) {\n // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)\n url = urlOrConnectionString;\n pipeline = newPipeline(credentialOrPipelineOrQueueName, options);\n } else if (\n !credentialOrPipelineOrQueueName &&\n typeof credentialOrPipelineOrQueueName !== \"string\"\n ) {\n // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)\n // The second parameter is undefined. Use anonymous credential.\n url = urlOrConnectionString;\n pipeline = newPipeline(new AnonymousCredential(), options);\n } else if (\n credentialOrPipelineOrQueueName &&\n typeof credentialOrPipelineOrQueueName === \"string\"\n ) {\n // (connectionString: string, containerName: string, queueName: string, options?: StoragePipelineOptions)\n const extractedCreds = extractConnectionStringParts(urlOrConnectionString);\n if (extractedCreds.kind === \"AccountConnString\") {\n if (isNode) {\n const queueName = credentialOrPipelineOrQueueName;\n const sharedKeyCredential = new StorageSharedKeyCredential(\n extractedCreds.accountName,\n extractedCreds.accountKey,\n );\n url = appendToURLPath(extractedCreds.url, queueName);\n\n if (!options.proxyOptions) {\n options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri);\n }\n\n pipeline = newPipeline(sharedKeyCredential, options);\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 queueName = credentialOrPipelineOrQueueName;\n url = appendToURLPath(extractedCreds.url, queueName) + \"?\" + extractedCreds.accountSas;\n pipeline = newPipeline(new AnonymousCredential(), options);\n } else {\n throw new Error(\n \"Connection string must be either an Account connection string or a SAS connection string\",\n );\n }\n } else {\n throw new Error(\"Expecting non-empty strings for queueName parameter\");\n }\n super(url, pipeline);\n this._name = this.getQueueNameFromUrl();\n this.queueContext = this.storageClientContext.queue;\n\n // MessagesContext\n // Build the url with \"messages\"\n const partsOfUrl = this.url.split(\"?\");\n this._messagesUrl = partsOfUrl[1]\n ? appendToURLPath(partsOfUrl[0], \"messages\") + \"?\" + partsOfUrl[1]\n : appendToURLPath(partsOfUrl[0], \"messages\");\n\n this.messagesContext = getStorageClientContext(this._messagesUrl, this.pipeline).messages;\n }\n\n private getMessageIdContext(messageId: string): MessageId {\n // Build the url with messageId\n const partsOfUrl = this._messagesUrl.split(\"?\");\n const urlWithMessageId = partsOfUrl[1]\n ? appendToURLPath(partsOfUrl[0], messageId) + \"?\" + partsOfUrl[1]\n : appendToURLPath(partsOfUrl[0], messageId);\n\n return getStorageClientContext(urlWithMessageId, this.pipeline).messageId;\n }\n\n /**\n * Creates a new queue under the specified account.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-queue4\n *\n * @param options - Options to Queue create operation.\n * @returns Response data for the Queue create operation.\n *\n * Example usage:\n *\n * ```js\n * const queueClient = queueServiceClient.getQueueClient(\"<new queue name>\");\n * const createQueueResponse = await queueClient.create();\n * ```\n */\n public async create(options: QueueCreateOptions = {}): Promise<QueueCreateResponse> {\n return tracingClient.withSpan(\"QueueClient-create\", options, async (updatedOptions) => {\n return assertResponse<QueueCreateHeaders, QueueCreateHeaders>(\n await this.queueContext.create(updatedOptions),\n );\n });\n }\n\n /**\n * Creates a new queue under the specified account if it doesn't already exist.\n * If the queue already exists, it is not changed.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-queue4\n *\n * @param options -\n */\n public async createIfNotExists(\n options: QueueCreateOptions = {},\n ): Promise<QueueCreateIfNotExistsResponse> {\n return tracingClient.withSpan(\n \"QueueClient-createIfNotExists\",\n options,\n async (updatedOptions) => {\n try {\n const response = await this.create(updatedOptions);\n\n // When a queue with the specified name already exists, the Queue service checks the metadata associated with the existing queue.\n // If the existing metadata is identical to the metadata specified on the Create Queue request, status code 204 (No Content) is returned.\n // If the existing metadata does not match, the operation fails and status code 409 (Conflict) is returned.\n if (response._response.status === 204) {\n return {\n succeeded: false,\n ...response,\n };\n }\n return {\n succeeded: true,\n ...response,\n };\n } catch (e: any) {\n if (e.details?.errorCode === \"QueueAlreadyExists\") {\n return {\n succeeded: false,\n ...e.response?.parsedHeaders,\n _response: e.response,\n };\n }\n\n throw e;\n }\n },\n );\n }\n\n /**\n * Deletes the specified queue permanently if it exists.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-queue3\n *\n * @param options -\n */\n public async deleteIfExists(\n options: QueueDeleteOptions = {},\n ): Promise<QueueDeleteIfExistsResponse> {\n return tracingClient.withSpan(\"QueueClient-deleteIfExists\", options, async (updatedOptions) => {\n try {\n const res = await this.delete(updatedOptions);\n return {\n succeeded: true,\n ...res,\n };\n } catch (e: any) {\n if (e.details?.errorCode === \"QueueNotFound\") {\n return {\n succeeded: false,\n ...e.response?.parsedHeaders,\n _response: e.response,\n };\n }\n throw e;\n }\n });\n }\n\n /**\n * Deletes the specified queue permanently.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-queue3\n *\n * @param options - Options to Queue delete operation.\n * @returns Response data for the Queue delete operation.\n *\n * Example usage:\n *\n * ```js\n * const deleteQueueResponse = await queueClient.delete();\n * console.log(\n * \"Delete queue successfully, service assigned request Id:\", deleteQueueResponse.requestId\n * );\n * ```\n */\n public async delete(options: QueueDeleteOptions = {}): Promise<QueueDeleteResponse> {\n return tracingClient.withSpan(\"QueueClient-delete\", options, async (updatedOptions) => {\n return assertResponse<QueueDeleteHeaders, QueueDeleteHeaders>(\n await this.queueContext.delete({\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n }),\n );\n });\n }\n\n /**\n * Returns true if the specified queue exists; false otherwise.\n *\n * NOTE: use this function with care since an existing queue might be deleted by other clients or\n * applications. Vice versa new queues might be added by other clients or applications after this\n * function completes.\n *\n * @param options - options to Exists operation.\n */\n public async exists(options: QueueExistsOptions = {}): Promise<boolean> {\n return tracingClient.withSpan(\"QueueClient-exists\", options, async (updatedOptions) => {\n try {\n await this.getProperties(updatedOptions);\n return true;\n } catch (e: any) {\n if (e.statusCode === 404) {\n return false;\n }\n throw e;\n }\n });\n }\n\n /**\n * Gets all user-defined metadata and system properties for the specified\n * queue. Metadata is associated with the queue as name-values pairs.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-queue-metadata\n *\n * WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if\n * they originally contained uppercase characters. This differs from the metadata keys returned by\n * the `listQueues` method of {@link QueueServiceClient} using the `includeMetadata` option, which\n * will retain their original casing.\n *\n * @param options - Options to Queue get properties operation.\n * @returns Response data for the Queue get properties operation.\n */\n public async getProperties(\n options: QueueGetPropertiesOptions = {},\n ): Promise<QueueGetPropertiesResponse> {\n return tracingClient.withSpan(\"QueueClient-getProperties\", options, async (updatedOptions) => {\n return assertResponse<QueueGetPropertiesHeaders, QueueGetPropertiesHeaders>(\n await this.queueContext.getProperties(updatedOptions),\n );\n });\n }\n\n /**\n * Sets one or more user-defined name-value pairs for the specified queue.\n *\n * If no option provided, or no metadata defined in the option parameter, the queue\n * metadata will be removed.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-queue-metadata\n *\n * @param metadata - If no metadata provided, all existing metadata will be removed.\n * @param options - Options to Queue set metadata operation.\n * @returns Response data for the Queue set metadata operation.\n */\n public async setMetadata(\n metadata?: Metadata,\n options: QueueSetMetadataOptions = {},\n ): Promise<QueueSetMetadataResponse> {\n return tracingClient.withSpan(\"QueueClient-setMetadata\", options, async (updatedOptions) => {\n return assertResponse<QueueSetMetadataHeaders, QueueSetMetadataHeaders>(\n await this.queueContext.setMetadata({\n ...updatedOptions,\n metadata,\n }),\n );\n });\n }\n\n /**\n * Gets details about any stored access policies specified on the queue that may be used with Shared Access Signatures.\n *\n * WARNING: JavaScript Date will potential lost precision when parsing start and expiry string.\n * For example, new Date(\"2018-12-31T03:44:23.8827891Z\").toISOString() will get \"2018-12-31T03:44:23.882Z\".\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-queue-acl\n *\n * @param options - Options to Queue get access policy operation.\n * @returns Response data for the Queue get access policy operation.\n */\n public async getAccessPolicy(\n options: QueueGetAccessPolicyOptions = {},\n ): Promise<QueueGetAccessPolicyResponse> {\n return tracingClient.withSpan(\n \"QueueClient-getAccessPolicy\",\n options,\n async (updatedOptions) => {\n const response = assertResponse<\n QueueGetAccessPolicyHeaders & SignedIdentifierModel[],\n QueueGetAccessPolicyHeaders,\n SignedIdentifierModel[]\n >(\n await this.queueContext.getAccessPolicy({\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n }),\n );\n\n const res: QueueGetAccessPolicyResponse = {\n _response: response._response,\n date: response.date,\n requestId: response.requestId,\n clientRequestId: response.clientRequestId,\n signedIdentifiers: [],\n version: response.version,\n errorCode: response.errorCode,\n };\n\n for (const identifier of response) {\n let accessPolicy: any = undefined;\n if (identifier.accessPolicy) {\n accessPolicy = {\n permissions: identifier.accessPolicy.permissions,\n };\n\n if (identifier.accessPolicy.expiresOn) {\n accessPolicy.expiresOn = new Date(identifier.accessPolicy.expiresOn);\n }\n\n if (identifier.accessPolicy.startsOn) {\n accessPolicy.startsOn = new Date(identifier.accessPolicy.startsOn);\n }\n }\n\n res.signedIdentifiers.push({\n accessPolicy,\n id: identifier.id,\n });\n }\n\n return res;\n },\n );\n }\n\n /**\n * Sets stored access policies for the queue that may be used with Shared Access Signatures.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-queue-acl\n *\n * @param queueAcl -\n * @param options - Options to Queue set access policy operation.\n * @returns Response data for the Queue set access policy operation.\n */\n public async setAccessPolicy(\n queueAcl?: SignedIdentifier[],\n options: QueueSetAccessPolicyOptions = {},\n ): Promise<QueueSetAccessPolicyResponse> {\n return tracingClient.withSpan(\n \"QueueClient-setAccessPolicy\",\n options,\n async (updatedOptions) => {\n const acl: SignedIdentifierModel[] = [];\n for (const identifier of queueAcl || []) {\n acl.push({\n accessPolicy: {\n expiresOn: identifier.accessPolicy.expiresOn\n ? truncatedISO8061Date(identifier.accessPolicy.expiresOn)\n : undefined,\n permissions: identifier.accessPolicy.permissions,\n startsOn: identifier.accessPolicy.startsOn\n ? truncatedISO8061Date(identifier.accessPolicy.startsOn)\n : undefined,\n },\n id: identifier.id,\n });\n }\n\n return assertResponse<QueueSetAccessPolicyHeaders, QueueSetAccessPolicyHeaders>(\n await this.queueContext.setAccessPolicy({\n ...updatedOptions,\n queueAcl: acl,\n }),\n );\n },\n );\n }\n\n /**\n * Clear deletes all messages from a queue.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/clear-messages\n *\n * @param options - Options to clear messages operation.\n * @returns Response data for the clear messages operation.\n */\n public async clearMessages(\n options: QueueClearMessagesOptions = {},\n ): Promise<QueueClearMessagesResponse> {\n return tracingClient.withSpan(\"QueueClient-clearMessages\", options, async (updatedOptions) => {\n return assertResponse<MessagesClearHeaders, MessagesClearHeaders>(\n await this.messagesContext.clear(updatedOptions),\n );\n });\n }\n\n /**\n * sendMessage adds a new message to the back of a queue. The visibility timeout specifies how long\n * the message should be invisible to Dequeue and Peek operations.\n * The message content is up to 64KB in size, and must be in a format that can be included in an XML request with UTF-8 encoding.\n * To include markup in the message, the contents of the message must either be XML-escaped or Base64-encode.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-message\n *\n * @param messageText - Text of the message to send\n * @param options - Options to send messages operation.\n * @returns Response data for the send messages operation.\n *\n * Example usage:\n *\n * ```js\n * const sendMessageResponse = await queueClient.sendMessage(\"Hello World!\");\n * console.log(\n * \"Sent message successfully, service assigned message Id:\", sendMessageResponse.messageId,\n * \"service assigned request Id:\", sendMessageResponse.requestId\n * );\n * ```\n */\n public async sendMessage(\n messageText: string,\n options: QueueSendMessageOptions = {},\n ): Promise<QueueSendMessageResponse> {\n return tracingClient.withSpan(\"QueueClient-sendMessage\", options, async (updatedOptions) => {\n const response = assertResponse<\n MessagesEnqueueHeaders & EnqueuedMessage[],\n MessagesEnqueueHeaders,\n EnqueuedMessage[]\n >(\n await this.messagesContext.enqueue(\n {\n messageText: messageText,\n },\n updatedOptions,\n ),\n );\n const item = response[0];\n return {\n _response: response._response,\n date: response.date,\n requestId: response.requestId,\n clientRequestId: response.clientRequestId,\n version: response.version,\n errorCode: response.errorCode,\n messageId: item.messageId,\n popReceipt: item.popReceipt,\n nextVisibleOn: item.nextVisibleOn,\n insertedOn: item.insertedOn,\n expiresOn: item.expiresOn,\n };\n });\n }\n\n /**\n * receiveMessages retrieves one or more messages from the front of the queue.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-messages\n *\n * @param options - Options to receive messages operation.\n * @returns Response data for the receive messages operation.\n *\n * Example usage:\n *\n * ```js\n * const response = await queueClient.receiveMessages();\n * if (response.receivedMessageItems.length == 1) {\n * const receivedMessageItem = response.receivedMessageItems[0];\n * console.log(\"Processing & deleting message with content:\", receivedMessageItem.messageText);\n * const deleteMessageResponse = await queueClient.deleteMessage(\n * receivedMessageItem.messageId,\n * receivedMessageItem.popReceipt\n * );\n * console.log(\n * \"Delete message successfully, service assigned request Id:\",\n * deleteMessageResponse.requestId\n * );\n * }\n * ```\n */\n public async receiveMessages(\n options: QueueReceiveMessageOptions = {},\n ): Promise<QueueReceiveMessageResponse> {\n return tracingClient.withSpan(\n \"QueueClient-receiveMessages\",\n options,\n async (updatedOptions) => {\n const response = assertResponse<\n MessagesDequeueHeaders & DequeuedMessageItem[],\n MessagesDequeueHeaders,\n DequeuedMessageItem[]\n >(await this.messagesContext.dequeue(updatedOptions));\n\n const res: QueueReceiveMessageResponse = {\n _response: response._response,\n date: response.date,\n requestId: response.requestId,\n clientRequestId: response.clientRequestId,\n receivedMessageItems: [],\n version: response.version,\n errorCode: response.errorCode,\n };\n\n for (const item of response) {\n res.receivedMessageItems.push(item);\n }\n\n return res;\n },\n );\n }\n\n /**\n * peekMessages retrieves one or more messages from the front of the queue but does not alter the visibility of the message.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/peek-messages\n *\n * @param options - Options to peek messages operation.\n * @returns Response data for the peek messages operation.\n *\n * Example usage:\n *\n * ```js\n * const peekMessagesResponse = await queueClient.peekMessages();\n * console.log(\"The peeked message is:\", peekMessagesResponse.peekedMessageItems[0].messageText);\n * ```\n */\n public async peekMessages(\n options: QueuePeekMessagesOptions = {},\n ): Promise<QueuePeekMessagesResponse> {\n return tracingClient.withSpan(\"QueueClient-peekMessages\", options, async (updatedOptions) => {\n const response = assertResponse<\n MessagesPeekHeaders & PeekedMessageItem[],\n MessagesPeekHeaders,\n PeekedMessageItem[]\n >(await this.messagesContext.peek(updatedOptions));\n\n const res: QueuePeekMessagesResponse = {\n _response: response._response,\n date: response.date,\n requestId: response.requestId,\n clientRequestId: response.clientRequestId,\n peekedMessageItems: [],\n version: response.version,\n errorCode: response.errorCode,\n };\n\n for (const item of response) {\n res.peekedMessageItems.push(item);\n }\n\n return res;\n });\n }\n\n /**\n * deleteMessage permanently removes the specified message from its queue.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-message2\n *\n * @param messageId - Id of the message.\n * @param popReceipt - A valid pop receipt value returned from an earlier call to the receive messages or update message operation.\n * @param options - Options to delete message operation.\n * @returns Response data for the delete message operation.\n */\n public async deleteMessage(\n messageId: string,\n popReceipt: string,\n options: QueueDeleteMessageOptions = {},\n ): Promise<QueueDeleteMessageResponse> {\n return tracingClient.withSpan(\"QueueClient-deleteMessage\", options, async (updatedOptions) => {\n return assertResponse<MessageIdDeleteHeaders, MessageIdDeleteHeaders>(\n await this.getMessageIdContext(messageId).delete(popReceipt, updatedOptions),\n );\n });\n }\n\n /**\n * Update changes a message's visibility timeout and contents.\n * The message content is up to 64KB in size, and must be in a format that can be included in an XML request with UTF-8 encoding.\n * To include markup in the message, the contents of the message must either be XML-escaped or Base64-encode.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/update-message\n *\n * @param messageId - Id of the message\n * @param popReceipt - A valid pop receipt value returned from an earlier call to the receive messages or update message operation.\n * @param message - Message to update. If this parameter is undefined, then the content of the message won't be updated.\n * @param visibilityTimeout - Specifies the new visibility timeout value, in seconds,\n * relative to server time. The new value must be larger than or equal to 0,\n * and cannot be larger than 7 days. The visibility timeout of a message cannot\n * be set to a value later than the expiry time.\n * A message can be updated until it has been deleted or has expired.\n * @param options - Options to update message operation.\n * @returns Response data for the update message operation.\n */\n public async updateMessage(\n messageId: string,\n popReceipt: string,\n message?: string,\n visibilityTimeout?: number,\n options: QueueUpdateMessageOptions = {},\n ): Promise<QueueUpdateMessageResponse> {\n return tracingClient.withSpan(\"QueueClient-updateMessage\", options, async (updatedOptions) => {\n let queueMessage = undefined;\n if (message !== undefined) {\n queueMessage = { messageText: message };\n }\n return assertResponse<MessageIdUpdateHeaders, MessageIdUpdateHeaders>(\n await this.getMessageIdContext(messageId).update(popReceipt, visibilityTimeout || 0, {\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n queueMessage,\n }),\n );\n });\n }\n\n private getQueueNameFromUrl(): string {\n let queueName;\n try {\n // URL may look like the following\n // \"https://myaccount.queue.core.windows.net/myqueue?sasString\".\n // \"https://myaccount.queue.core.windows.net/myqueue\".\n // IPv4/IPv6 address hosts, Endpoints - `http://127.0.0.1:10001/devstoreaccount1/myqueue`\n // http://localhost:10001/devstoreaccount1/queuename\n\n const parsedUrl = new URL(this.url);\n\n if (parsedUrl.hostname.split(\".\")[1] === \"queue\") {\n // \"https://myaccount.queue.core.windows.net/queuename\".\n // .getPath() -> /queuename\n queueName = parsedUrl.pathname.split(\"/\")[1];\n } else if (isIpEndpointStyle(parsedUrl)) {\n // IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/queuename\n // Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/queuename\n // .getPath() -> /devstoreaccount1/queuename\n queueName = parsedUrl.pathname.split(\"/\")[2];\n } else {\n // \"https://customdomain.com/queuename\".\n // .getPath() -> /queuename\n queueName = parsedUrl.pathname.split(\"/\")[1];\n }\n\n if (!queueName) {\n throw new Error(\"Provided queueName is invalid.\");\n }\n\n return queueName;\n } catch (error: any) {\n throw new Error(\"Unable to extract queueName with provided information.\");\n }\n }\n\n /**\n * Only available for QueueClient constructed with a shared key credential.\n *\n * Generates a Service 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas\n *\n * @param options - Optional parameters.\n * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n public generateSasUrl(options: QueueGenerateSasUrlOptions): string {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the SAS when the client is initialized with a shared key credential\",\n );\n }\n\n const sas = generateQueueSASQueryParameters(\n {\n queueName: this.name,\n ...options,\n },\n this.credential,\n ).toString();\n\n return appendToURLQuery(this.url, sas);\n }\n}\n"]}
1
+ {"version":3,"file":"QueueClient.js","sourceRoot":"","sources":["../../../src/QueueClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAmB,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OA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AS,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YAC/C,CAAC;YAED,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;YACpD,CAAC;YAED,OAAO,SAAS,CAAC;QACnB,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;IAED;;;;;;;;;;OAUG;IACI,cAAc,CAAC,OAAmC;QACvD,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,YAAY,0BAA0B,CAAC,EAAE,CAAC;YAC7D,MAAM,UAAU,CACd,uFAAuF,CACxF,CAAC;QACJ,CAAC;QAED,MAAM,GAAG,GAAG,+BAA+B,iBAEvC,SAAS,EAAE,IAAI,CAAC,IAAI,IACjB,OAAO,GAEZ,IAAI,CAAC,UAAU,CAChB,CAAC,QAAQ,EAAE,CAAC;QAEb,OAAO,gBAAgB,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { TokenCredential, isTokenCredential } from \"@azure/core-auth\";\nimport { isNode } from \"@azure/core-util\";\nimport {\n EnqueuedMessage,\n DequeuedMessageItem,\n MessagesDequeueHeaders,\n MessagesEnqueueHeaders,\n MessagesPeekHeaders,\n MessageIdUpdateResponse,\n MessageIdDeleteResponse,\n MessagesClearResponse,\n PeekedMessageItem,\n QueueCreateHeaders,\n QueueDeleteResponse,\n QueueGetAccessPolicyHeaders,\n QueueGetPropertiesResponse,\n QueueSetAccessPolicyResponse,\n QueueSetMetadataResponse,\n SignedIdentifierModel,\n QueueCreateResponse,\n QueueDeleteHeaders,\n QueueSetMetadataHeaders,\n QueueGetPropertiesHeaders,\n QueueSetAccessPolicyHeaders,\n MessagesClearHeaders,\n MessageIdDeleteHeaders,\n MessageIdUpdateHeaders,\n} from \"./generatedModels\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { Messages, MessageId, Queue } from \"./generated/src/operationsInterfaces\";\nimport { newPipeline, StoragePipelineOptions, Pipeline } from \"../../storage-blob/src/Pipeline\";\nimport { StorageClient, CommonOptions, getStorageClientContext } from \"./StorageClient\";\nimport {\n appendToURLPath,\n extractConnectionStringParts,\n isIpEndpointStyle,\n truncatedISO8061Date,\n appendToURLQuery,\n WithResponse,\n assertResponse,\n} from \"./utils/utils.common\";\nimport { StorageSharedKeyCredential } from \"../../storage-blob/src/credentials/StorageSharedKeyCredential\";\nimport { AnonymousCredential } from \"../../storage-blob/src/credentials/AnonymousCredential\";\nimport { tracingClient } from \"./utils/tracing\";\nimport { Metadata } from \"./models\";\nimport { generateQueueSASQueryParameters } from \"./QueueSASSignatureValues\";\nimport { SasIPRange } from \"./SasIPRange\";\nimport { QueueSASPermissions } from \"./QueueSASPermissions\";\nimport { SASProtocol } from \"./SASQueryParameters\";\nimport { getDefaultProxySettings } from \"@azure/core-rest-pipeline\";\n\n/**\n * Options to configure {@link QueueClient.create} operation\n */\nexport interface QueueCreateOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n /**\n * A collection of key-value string pair to associate with the queue object.\n * The keys need to be lower-case.\n */\n metadata?: Metadata;\n}\n\n/**\n * Options to configure {@link QueueClient.exists} operation\n */\nexport interface QueueExistsOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure {@link QueueClient.getProperties} operation\n */\nexport interface QueueGetPropertiesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure {@link QueueClient.delete} operation\n */\nexport interface QueueDeleteOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure {@link QueueClient.getAccessPolicy} operation\n */\nexport interface QueueGetAccessPolicyOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure {@link QueueClient.setAccessPolicy} operation\n */\nexport interface QueueSetAccessPolicyOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure {@link QueueClient.setMetadata} operation\n */\nexport interface QueueSetMetadataOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Signed identifier.\n */\nexport interface SignedIdentifier {\n /**\n * a unique id\n */\n id: string;\n /**\n * Access Policy\n */\n accessPolicy: {\n /**\n * the date-time the policy is active.\n */\n startsOn?: Date;\n /**\n * the date-time the policy expires.\n */\n expiresOn?: Date;\n /**\n * the permissions for the acl policy\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-queue-acl\n */\n permissions?: string;\n };\n}\n\n/**\n * Contains response data for the {@link QueueClient.getAccessPolicy} operation.\n */\nexport declare type QueueGetAccessPolicyResponse = WithResponse<\n {\n signedIdentifiers: SignedIdentifier[];\n } & QueueGetAccessPolicyHeaders,\n QueueGetAccessPolicyHeaders,\n SignedIdentifierModel[]\n>;\n\n/**\n * Options to configure {@link QueueClient.clearMessages} operation\n */\nexport interface QueueClearMessagesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/** Optional parameters. */\nexport interface MessagesEnqueueOptionalParams extends CommonOptions {\n /** The The timeout parameter is expressed in seconds. For more information, see <a href=\"https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations\">Setting Timeouts for Queue Service Operations.</a> */\n timeoutInSeconds?: number;\n /** Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. */\n requestId?: string;\n /** Optional. If specified, the request must be made using an x-ms-version of 2011-08-18 or later. If not specified, the default value is 0. Specifies the new visibility timeout value, in seconds, relative to server time. The new value must be larger than or equal to 0, and cannot be larger than 7 days. The visibility timeout of a message cannot be set to a value later than the expiry time. visibilitytimeout should be set to a value smaller than the time-to-live value. */\n visibilityTimeout?: number;\n /** Optional. Specifies the time-to-live interval for the message, in seconds. Prior to version 2017-07-29, the maximum time-to-live allowed is 7 days. For version 2017-07-29 or later, the maximum time-to-live can be any positive number, as well as -1 indicating that the message does not expire. If this parameter is omitted, the default time-to-live is 7 days. */\n messageTimeToLive?: number;\n}\n\n/**\n * Options to configure {@link QueueClient.sendMessage} operation\n */\nexport interface QueueSendMessageOptions extends MessagesEnqueueOptionalParams, CommonOptions {}\n\n/** Optional parameters. */\nexport interface MessagesDequeueOptionalParams extends CommonOptions {\n /** The The timeout parameter is expressed in seconds. For more information, see <a href=\"https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations\">Setting Timeouts for Queue Service Operations.</a> */\n timeoutInSeconds?: number;\n /** Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. */\n requestId?: string;\n /** Optional. A nonzero integer value that specifies the number of messages to retrieve from the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single message is retrieved from the queue with this operation. */\n numberOfMessages?: number;\n /** Optional. Specifies the new visibility timeout value, in seconds, relative to server time. The default value is 30 seconds. A specified value must be larger than or equal to 1 second, and cannot be larger than 7 days, or larger than 2 hours on REST protocol versions prior to version 2011-08-18. The visibility timeout of a message can be set to a value later than the expiry time. */\n visibilityTimeout?: number;\n}\n\n/**\n * Options to configure {@link QueueClient.receiveMessages} operation\n */\nexport interface QueueReceiveMessageOptions extends MessagesDequeueOptionalParams, CommonOptions {}\n\n/** Optional parameters. */\nexport interface MessagesPeekOptionalParams extends CommonOptions {\n /** The The timeout parameter is expressed in seconds. For more information, see <a href=\"https://docs.microsoft.com/en-us/rest/api/storageservices/setting-timeouts-for-queue-service-operations\">Setting Timeouts for Queue Service Operations.</a> */\n timeoutInSeconds?: number;\n /** Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. */\n requestId?: string;\n /** Optional. A nonzero integer value that specifies the number of messages to retrieve from the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single message is retrieved from the queue with this operation. */\n numberOfMessages?: number;\n}\n\n/**\n * Options to configure {@link QueueClient.peekMessages} operation\n */\nexport interface QueuePeekMessagesOptions extends MessagesPeekOptionalParams, CommonOptions {}\n\n/**\n * Contains the response data for the {@link QueueClient.sendMessage} operation.\n */\nexport declare type QueueSendMessageResponse = WithResponse<\n {\n /**\n * The ID of the sent Message.\n */\n messageId: string;\n /**\n * This value is required to delete the Message.\n * If deletion fails using this popreceipt then the message has been received\n * by another client.\n */\n popReceipt: string;\n /**\n * The time that the message was inserted into the\n * Queue.\n */\n insertedOn: Date;\n /**\n * The time that the message will expire and be\n * automatically deleted.\n */\n expiresOn: Date;\n /**\n * The time that the message will again become\n * visible in the Queue.\n */\n nextVisibleOn: Date;\n } & MessagesEnqueueHeaders,\n MessagesEnqueueHeaders,\n EnqueuedMessage[]\n>;\n\n/**\n * The object returned in the `receivedMessageItems` array when calling {@link QueueClient.receiveMessages}.\n *\n * See: {@link QueueReceiveMessageResponse}\n */\nexport declare type ReceivedMessageItem = DequeuedMessageItem;\n\n/**\n * Contains the response data for the {@link QueueClient.receiveMessages} operation.\n */\nexport declare type QueueReceiveMessageResponse = WithResponse<\n {\n receivedMessageItems: ReceivedMessageItem[];\n } & MessagesDequeueHeaders,\n MessagesDequeueHeaders,\n ReceivedMessageItem[]\n>;\n\n/**\n * Contains the response data for the {@link QueueClient.peekMessages} operation.\n */\nexport declare type QueuePeekMessagesResponse = WithResponse<\n {\n peekedMessageItems: PeekedMessageItem[];\n } & MessagesPeekHeaders,\n MessagesPeekHeaders,\n PeekedMessageItem[]\n>;\n\n/**\n * Options to configure the {@link QueueClient.deleteMessage} operation\n */\nexport interface QueueDeleteMessageOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Contains response data for the {@link QueueClient.updateMessage} operation.\n */\nexport declare type QueueUpdateMessageResponse = MessageIdUpdateResponse;\n\n/**\n * Contains response data for the {@link QueueClient.deleteMessage} operation.\n */\nexport declare type QueueDeleteMessageResponse = MessageIdDeleteResponse;\n\n/**\n * Contains response data for the {@link QueueClient.clearMessages} operation.\n */\nexport declare type QueueClearMessagesResponse = MessagesClearResponse;\n\n/**\n * Options to configure {@link QueueClient.updateMessage} operation\n */\nexport interface QueueUpdateMessageOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Contains response data for the {@link QueueClient.createIfNotExists} operation.\n */\nexport interface QueueCreateIfNotExistsResponse extends QueueCreateResponse {\n /**\n * Indicate whether the queue is successfully created. Is false when the queue is not changed as it already exists.\n */\n succeeded: boolean;\n}\n\n/**\n * Contains response data for the {@link QueueClient.deleteIfExists} operation.\n */\nexport interface QueueDeleteIfExistsResponse extends QueueDeleteResponse {\n /**\n * Indicate whether the queue is successfully deleted. Is false if the queue does not exist in the first place.\n */\n succeeded: boolean;\n}\n\n/**\n * Options to configure {@link QueueClient.generateSasUrl} operation.\n */\nexport interface QueueGenerateSasUrlOptions {\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, HTTPS only or HTTPSandHTTP\n */\n protocol?: SASProtocol;\n\n /**\n * Optional. When the SAS will take effect.\n */\n startsOn?: Date;\n\n /**\n * Optional only when identifier is provided. The time after which the SAS will no longer work.\n */\n expiresOn?: Date;\n\n /**\n * Optional only when identifier is provided.\n * Please refer to {@link QueueSASPermissions} for help constructing the permissions string.\n */\n permissions?: QueueSASPermissions;\n\n /**\n * Optional. IP ranges allowed in this SAS.\n */\n ipRange?: SasIPRange;\n\n /**\n * Optional. The name of the access policy on the queue this SAS references if any.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy\n */\n identifier?: string;\n}\n\n/**\n * A QueueClient represents a URL to an Azure Storage Queue's messages allowing you to manipulate its messages.\n */\nexport class QueueClient extends StorageClient {\n /**\n * messagesContext provided by protocol layer.\n */\n private messagesContext: Messages;\n /**\n * queueContext provided by protocol layer.\n */\n private queueContext: Queue;\n private _name: string;\n private _messagesUrl: string;\n\n /**\n * The name of the queue.\n */\n public get name(): string {\n return this._name;\n }\n\n /**\n * Creates an instance of QueueClient.\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 queueName - Queue name.\n * @param options - Options to configure the HTTP pipeline.\n */\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 constructor(connectionString: string, queueName: string, options?: StoragePipelineOptions);\n /**\n * Creates an instance of QueueClient.\n *\n * @param url - A URL string pointing to Azure Storage queue, such as\n * \"https://myaccount.queue.core.windows.net/myqueue\". You can\n * append a SAS if using AnonymousCredential, such as\n * \"https://myaccount.queue.core.windows.net/myqueue?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 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 QueueClient.\n *\n * @param url - A URL string pointing to Azure Storage queue, such as\n * \"https://myaccount.queue.core.windows.net/myqueue\". You can\n * append a SAS if using AnonymousCredential, such as\n * \"https://myaccount.queue.core.windows.net/myqueue?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 urlOrConnectionString: string,\n credentialOrPipelineOrQueueName?:\n | StorageSharedKeyCredential\n | AnonymousCredential\n | TokenCredential\n | Pipeline\n | 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 ) {\n options = options || {};\n let pipeline: Pipeline;\n let url: string;\n if (credentialOrPipelineOrQueueName instanceof Pipeline) {\n // (url: string, pipeline: Pipeline)\n url = urlOrConnectionString;\n pipeline = credentialOrPipelineOrQueueName;\n } else if (\n (isNode && credentialOrPipelineOrQueueName instanceof StorageSharedKeyCredential) ||\n credentialOrPipelineOrQueueName instanceof AnonymousCredential ||\n isTokenCredential(credentialOrPipelineOrQueueName)\n ) {\n // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)\n url = urlOrConnectionString;\n pipeline = newPipeline(credentialOrPipelineOrQueueName, options);\n } else if (\n !credentialOrPipelineOrQueueName &&\n typeof credentialOrPipelineOrQueueName !== \"string\"\n ) {\n // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)\n // The second parameter is undefined. Use anonymous credential.\n url = urlOrConnectionString;\n pipeline = newPipeline(new AnonymousCredential(), options);\n } else if (\n credentialOrPipelineOrQueueName &&\n typeof credentialOrPipelineOrQueueName === \"string\"\n ) {\n // (connectionString: string, containerName: string, queueName: string, options?: StoragePipelineOptions)\n const extractedCreds = extractConnectionStringParts(urlOrConnectionString);\n if (extractedCreds.kind === \"AccountConnString\") {\n if (isNode) {\n const queueName = credentialOrPipelineOrQueueName;\n const sharedKeyCredential = new StorageSharedKeyCredential(\n extractedCreds.accountName,\n extractedCreds.accountKey,\n );\n url = appendToURLPath(extractedCreds.url, queueName);\n\n if (!options.proxyOptions) {\n options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri);\n }\n\n pipeline = newPipeline(sharedKeyCredential, options);\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 queueName = credentialOrPipelineOrQueueName;\n url = appendToURLPath(extractedCreds.url, queueName) + \"?\" + extractedCreds.accountSas;\n pipeline = newPipeline(new AnonymousCredential(), options);\n } else {\n throw new Error(\n \"Connection string must be either an Account connection string or a SAS connection string\",\n );\n }\n } else {\n throw new Error(\"Expecting non-empty strings for queueName parameter\");\n }\n super(url, pipeline);\n this._name = this.getQueueNameFromUrl();\n this.queueContext = this.storageClientContext.queue;\n\n // MessagesContext\n // Build the url with \"messages\"\n const partsOfUrl = this.url.split(\"?\");\n this._messagesUrl = partsOfUrl[1]\n ? appendToURLPath(partsOfUrl[0], \"messages\") + \"?\" + partsOfUrl[1]\n : appendToURLPath(partsOfUrl[0], \"messages\");\n\n this.messagesContext = getStorageClientContext(this._messagesUrl, this.pipeline).messages;\n }\n\n private getMessageIdContext(messageId: string): MessageId {\n // Build the url with messageId\n const partsOfUrl = this._messagesUrl.split(\"?\");\n const urlWithMessageId = partsOfUrl[1]\n ? appendToURLPath(partsOfUrl[0], messageId) + \"?\" + partsOfUrl[1]\n : appendToURLPath(partsOfUrl[0], messageId);\n\n return getStorageClientContext(urlWithMessageId, this.pipeline).messageId;\n }\n\n /**\n * Creates a new queue under the specified account.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-queue4\n *\n * @param options - Options to Queue create operation.\n * @returns Response data for the Queue create operation.\n *\n * Example usage:\n *\n * ```js\n * const queueClient = queueServiceClient.getQueueClient(\"<new queue name>\");\n * const createQueueResponse = await queueClient.create();\n * ```\n */\n public async create(options: QueueCreateOptions = {}): Promise<QueueCreateResponse> {\n return tracingClient.withSpan(\"QueueClient-create\", options, async (updatedOptions) => {\n return assertResponse<QueueCreateHeaders, QueueCreateHeaders>(\n await this.queueContext.create(updatedOptions),\n );\n });\n }\n\n /**\n * Creates a new queue under the specified account if it doesn't already exist.\n * If the queue already exists, it is not changed.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-queue4\n *\n * @param options -\n */\n public async createIfNotExists(\n options: QueueCreateOptions = {},\n ): Promise<QueueCreateIfNotExistsResponse> {\n return tracingClient.withSpan(\n \"QueueClient-createIfNotExists\",\n options,\n async (updatedOptions) => {\n try {\n const response = await this.create(updatedOptions);\n\n // When a queue with the specified name already exists, the Queue service checks the metadata associated with the existing queue.\n // If the existing metadata is identical to the metadata specified on the Create Queue request, status code 204 (No Content) is returned.\n // If the existing metadata does not match, the operation fails and status code 409 (Conflict) is returned.\n if (response._response.status === 204) {\n return {\n succeeded: false,\n ...response,\n };\n }\n return {\n succeeded: true,\n ...response,\n };\n } catch (e: any) {\n if (e.details?.errorCode === \"QueueAlreadyExists\") {\n return {\n succeeded: false,\n ...e.response?.parsedHeaders,\n _response: e.response,\n };\n }\n\n throw e;\n }\n },\n );\n }\n\n /**\n * Deletes the specified queue permanently if it exists.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-queue3\n *\n * @param options -\n */\n public async deleteIfExists(\n options: QueueDeleteOptions = {},\n ): Promise<QueueDeleteIfExistsResponse> {\n return tracingClient.withSpan(\"QueueClient-deleteIfExists\", options, async (updatedOptions) => {\n try {\n const res = await this.delete(updatedOptions);\n return {\n succeeded: true,\n ...res,\n };\n } catch (e: any) {\n if (e.details?.errorCode === \"QueueNotFound\") {\n return {\n succeeded: false,\n ...e.response?.parsedHeaders,\n _response: e.response,\n };\n }\n throw e;\n }\n });\n }\n\n /**\n * Deletes the specified queue permanently.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-queue3\n *\n * @param options - Options to Queue delete operation.\n * @returns Response data for the Queue delete operation.\n *\n * Example usage:\n *\n * ```js\n * const deleteQueueResponse = await queueClient.delete();\n * console.log(\n * \"Delete queue successfully, service assigned request Id:\", deleteQueueResponse.requestId\n * );\n * ```\n */\n public async delete(options: QueueDeleteOptions = {}): Promise<QueueDeleteResponse> {\n return tracingClient.withSpan(\"QueueClient-delete\", options, async (updatedOptions) => {\n return assertResponse<QueueDeleteHeaders, QueueDeleteHeaders>(\n await this.queueContext.delete({\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n }),\n );\n });\n }\n\n /**\n * Returns true if the specified queue exists; false otherwise.\n *\n * NOTE: use this function with care since an existing queue might be deleted by other clients or\n * applications. Vice versa new queues might be added by other clients or applications after this\n * function completes.\n *\n * @param options - options to Exists operation.\n */\n public async exists(options: QueueExistsOptions = {}): Promise<boolean> {\n return tracingClient.withSpan(\"QueueClient-exists\", options, async (updatedOptions) => {\n try {\n await this.getProperties(updatedOptions);\n return true;\n } catch (e: any) {\n if (e.statusCode === 404) {\n return false;\n }\n throw e;\n }\n });\n }\n\n /**\n * Gets all user-defined metadata and system properties for the specified\n * queue. Metadata is associated with the queue as name-values pairs.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-queue-metadata\n *\n * WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if\n * they originally contained uppercase characters. This differs from the metadata keys returned by\n * the `listQueues` method of {@link QueueServiceClient} using the `includeMetadata` option, which\n * will retain their original casing.\n *\n * @param options - Options to Queue get properties operation.\n * @returns Response data for the Queue get properties operation.\n */\n public async getProperties(\n options: QueueGetPropertiesOptions = {},\n ): Promise<QueueGetPropertiesResponse> {\n return tracingClient.withSpan(\"QueueClient-getProperties\", options, async (updatedOptions) => {\n return assertResponse<QueueGetPropertiesHeaders, QueueGetPropertiesHeaders>(\n await this.queueContext.getProperties(updatedOptions),\n );\n });\n }\n\n /**\n * Sets one or more user-defined name-value pairs for the specified queue.\n *\n * If no option provided, or no metadata defined in the option parameter, the queue\n * metadata will be removed.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-queue-metadata\n *\n * @param metadata - If no metadata provided, all existing metadata will be removed.\n * @param options - Options to Queue set metadata operation.\n * @returns Response data for the Queue set metadata operation.\n */\n public async setMetadata(\n metadata?: Metadata,\n options: QueueSetMetadataOptions = {},\n ): Promise<QueueSetMetadataResponse> {\n return tracingClient.withSpan(\"QueueClient-setMetadata\", options, async (updatedOptions) => {\n return assertResponse<QueueSetMetadataHeaders, QueueSetMetadataHeaders>(\n await this.queueContext.setMetadata({\n ...updatedOptions,\n metadata,\n }),\n );\n });\n }\n\n /**\n * Gets details about any stored access policies specified on the queue that may be used with Shared Access Signatures.\n *\n * WARNING: JavaScript Date will potential lost precision when parsing start and expiry string.\n * For example, new Date(\"2018-12-31T03:44:23.8827891Z\").toISOString() will get \"2018-12-31T03:44:23.882Z\".\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-queue-acl\n *\n * @param options - Options to Queue get access policy operation.\n * @returns Response data for the Queue get access policy operation.\n */\n public async getAccessPolicy(\n options: QueueGetAccessPolicyOptions = {},\n ): Promise<QueueGetAccessPolicyResponse> {\n return tracingClient.withSpan(\n \"QueueClient-getAccessPolicy\",\n options,\n async (updatedOptions) => {\n const response = assertResponse<\n QueueGetAccessPolicyHeaders & SignedIdentifierModel[],\n QueueGetAccessPolicyHeaders,\n SignedIdentifierModel[]\n >(\n await this.queueContext.getAccessPolicy({\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n }),\n );\n\n const res: QueueGetAccessPolicyResponse = {\n _response: response._response,\n date: response.date,\n requestId: response.requestId,\n clientRequestId: response.clientRequestId,\n signedIdentifiers: [],\n version: response.version,\n errorCode: response.errorCode,\n };\n\n for (const identifier of response) {\n let accessPolicy: any = undefined;\n if (identifier.accessPolicy) {\n accessPolicy = {\n permissions: identifier.accessPolicy.permissions,\n };\n\n if (identifier.accessPolicy.expiresOn) {\n accessPolicy.expiresOn = new Date(identifier.accessPolicy.expiresOn);\n }\n\n if (identifier.accessPolicy.startsOn) {\n accessPolicy.startsOn = new Date(identifier.accessPolicy.startsOn);\n }\n }\n\n res.signedIdentifiers.push({\n accessPolicy,\n id: identifier.id,\n });\n }\n\n return res;\n },\n );\n }\n\n /**\n * Sets stored access policies for the queue that may be used with Shared Access Signatures.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-queue-acl\n *\n * @param queueAcl -\n * @param options - Options to Queue set access policy operation.\n * @returns Response data for the Queue set access policy operation.\n */\n public async setAccessPolicy(\n queueAcl?: SignedIdentifier[],\n options: QueueSetAccessPolicyOptions = {},\n ): Promise<QueueSetAccessPolicyResponse> {\n return tracingClient.withSpan(\n \"QueueClient-setAccessPolicy\",\n options,\n async (updatedOptions) => {\n const acl: SignedIdentifierModel[] = [];\n for (const identifier of queueAcl || []) {\n acl.push({\n accessPolicy: {\n expiresOn: identifier.accessPolicy.expiresOn\n ? truncatedISO8061Date(identifier.accessPolicy.expiresOn)\n : undefined,\n permissions: identifier.accessPolicy.permissions,\n startsOn: identifier.accessPolicy.startsOn\n ? truncatedISO8061Date(identifier.accessPolicy.startsOn)\n : undefined,\n },\n id: identifier.id,\n });\n }\n\n return assertResponse<QueueSetAccessPolicyHeaders, QueueSetAccessPolicyHeaders>(\n await this.queueContext.setAccessPolicy({\n ...updatedOptions,\n queueAcl: acl,\n }),\n );\n },\n );\n }\n\n /**\n * Clear deletes all messages from a queue.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/clear-messages\n *\n * @param options - Options to clear messages operation.\n * @returns Response data for the clear messages operation.\n */\n public async clearMessages(\n options: QueueClearMessagesOptions = {},\n ): Promise<QueueClearMessagesResponse> {\n return tracingClient.withSpan(\"QueueClient-clearMessages\", options, async (updatedOptions) => {\n return assertResponse<MessagesClearHeaders, MessagesClearHeaders>(\n await this.messagesContext.clear(updatedOptions),\n );\n });\n }\n\n /**\n * sendMessage adds a new message to the back of a queue. The visibility timeout specifies how long\n * the message should be invisible to Dequeue and Peek operations.\n * The message content is up to 64KB in size, and must be in a format that can be included in an XML request with UTF-8 encoding.\n * To include markup in the message, the contents of the message must either be XML-escaped or Base64-encode.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-message\n *\n * @param messageText - Text of the message to send\n * @param options - Options to send messages operation.\n * @returns Response data for the send messages operation.\n *\n * Example usage:\n *\n * ```js\n * const sendMessageResponse = await queueClient.sendMessage(\"Hello World!\");\n * console.log(\n * \"Sent message successfully, service assigned message Id:\", sendMessageResponse.messageId,\n * \"service assigned request Id:\", sendMessageResponse.requestId\n * );\n * ```\n */\n public async sendMessage(\n messageText: string,\n options: QueueSendMessageOptions = {},\n ): Promise<QueueSendMessageResponse> {\n return tracingClient.withSpan(\"QueueClient-sendMessage\", options, async (updatedOptions) => {\n const response = assertResponse<\n MessagesEnqueueHeaders & EnqueuedMessage[],\n MessagesEnqueueHeaders,\n EnqueuedMessage[]\n >(\n await this.messagesContext.enqueue(\n {\n messageText: messageText,\n },\n updatedOptions,\n ),\n );\n const item = response[0];\n return {\n _response: response._response,\n date: response.date,\n requestId: response.requestId,\n clientRequestId: response.clientRequestId,\n version: response.version,\n errorCode: response.errorCode,\n messageId: item.messageId,\n popReceipt: item.popReceipt,\n nextVisibleOn: item.nextVisibleOn,\n insertedOn: item.insertedOn,\n expiresOn: item.expiresOn,\n };\n });\n }\n\n /**\n * receiveMessages retrieves one or more messages from the front of the queue.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-messages\n *\n * @param options - Options to receive messages operation.\n * @returns Response data for the receive messages operation.\n *\n * Example usage:\n *\n * ```js\n * const response = await queueClient.receiveMessages();\n * if (response.receivedMessageItems.length == 1) {\n * const receivedMessageItem = response.receivedMessageItems[0];\n * console.log(\"Processing & deleting message with content:\", receivedMessageItem.messageText);\n * const deleteMessageResponse = await queueClient.deleteMessage(\n * receivedMessageItem.messageId,\n * receivedMessageItem.popReceipt\n * );\n * console.log(\n * \"Delete message successfully, service assigned request Id:\",\n * deleteMessageResponse.requestId\n * );\n * }\n * ```\n */\n public async receiveMessages(\n options: QueueReceiveMessageOptions = {},\n ): Promise<QueueReceiveMessageResponse> {\n return tracingClient.withSpan(\n \"QueueClient-receiveMessages\",\n options,\n async (updatedOptions) => {\n const response = assertResponse<\n MessagesDequeueHeaders & DequeuedMessageItem[],\n MessagesDequeueHeaders,\n DequeuedMessageItem[]\n >(await this.messagesContext.dequeue(updatedOptions));\n\n const res: QueueReceiveMessageResponse = {\n _response: response._response,\n date: response.date,\n requestId: response.requestId,\n clientRequestId: response.clientRequestId,\n receivedMessageItems: [],\n version: response.version,\n errorCode: response.errorCode,\n };\n\n for (const item of response) {\n res.receivedMessageItems.push(item);\n }\n\n return res;\n },\n );\n }\n\n /**\n * peekMessages retrieves one or more messages from the front of the queue but does not alter the visibility of the message.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/peek-messages\n *\n * @param options - Options to peek messages operation.\n * @returns Response data for the peek messages operation.\n *\n * Example usage:\n *\n * ```js\n * const peekMessagesResponse = await queueClient.peekMessages();\n * console.log(\"The peeked message is:\", peekMessagesResponse.peekedMessageItems[0].messageText);\n * ```\n */\n public async peekMessages(\n options: QueuePeekMessagesOptions = {},\n ): Promise<QueuePeekMessagesResponse> {\n return tracingClient.withSpan(\"QueueClient-peekMessages\", options, async (updatedOptions) => {\n const response = assertResponse<\n MessagesPeekHeaders & PeekedMessageItem[],\n MessagesPeekHeaders,\n PeekedMessageItem[]\n >(await this.messagesContext.peek(updatedOptions));\n\n const res: QueuePeekMessagesResponse = {\n _response: response._response,\n date: response.date,\n requestId: response.requestId,\n clientRequestId: response.clientRequestId,\n peekedMessageItems: [],\n version: response.version,\n errorCode: response.errorCode,\n };\n\n for (const item of response) {\n res.peekedMessageItems.push(item);\n }\n\n return res;\n });\n }\n\n /**\n * deleteMessage permanently removes the specified message from its queue.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-message2\n *\n * @param messageId - Id of the message.\n * @param popReceipt - A valid pop receipt value returned from an earlier call to the receive messages or update message operation.\n * @param options - Options to delete message operation.\n * @returns Response data for the delete message operation.\n */\n public async deleteMessage(\n messageId: string,\n popReceipt: string,\n options: QueueDeleteMessageOptions = {},\n ): Promise<QueueDeleteMessageResponse> {\n return tracingClient.withSpan(\"QueueClient-deleteMessage\", options, async (updatedOptions) => {\n return assertResponse<MessageIdDeleteHeaders, MessageIdDeleteHeaders>(\n await this.getMessageIdContext(messageId).delete(popReceipt, updatedOptions),\n );\n });\n }\n\n /**\n * Update changes a message's visibility timeout and contents.\n * The message content is up to 64KB in size, and must be in a format that can be included in an XML request with UTF-8 encoding.\n * To include markup in the message, the contents of the message must either be XML-escaped or Base64-encode.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/update-message\n *\n * @param messageId - Id of the message\n * @param popReceipt - A valid pop receipt value returned from an earlier call to the receive messages or update message operation.\n * @param message - Message to update. If this parameter is undefined, then the content of the message won't be updated.\n * @param visibilityTimeout - Specifies the new visibility timeout value, in seconds,\n * relative to server time. The new value must be larger than or equal to 0,\n * and cannot be larger than 7 days. The visibility timeout of a message cannot\n * be set to a value later than the expiry time.\n * A message can be updated until it has been deleted or has expired.\n * @param options - Options to update message operation.\n * @returns Response data for the update message operation.\n */\n public async updateMessage(\n messageId: string,\n popReceipt: string,\n message?: string,\n visibilityTimeout?: number,\n options: QueueUpdateMessageOptions = {},\n ): Promise<QueueUpdateMessageResponse> {\n return tracingClient.withSpan(\"QueueClient-updateMessage\", options, async (updatedOptions) => {\n let queueMessage = undefined;\n if (message !== undefined) {\n queueMessage = { messageText: message };\n }\n return assertResponse<MessageIdUpdateHeaders, MessageIdUpdateHeaders>(\n await this.getMessageIdContext(messageId).update(popReceipt, visibilityTimeout || 0, {\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n queueMessage,\n }),\n );\n });\n }\n\n private getQueueNameFromUrl(): string {\n let queueName;\n try {\n // URL may look like the following\n // \"https://myaccount.queue.core.windows.net/myqueue?sasString\".\n // \"https://myaccount.queue.core.windows.net/myqueue\".\n // IPv4/IPv6 address hosts, Endpoints - `http://127.0.0.1:10001/devstoreaccount1/myqueue`\n // http://localhost:10001/devstoreaccount1/queuename\n\n const parsedUrl = new URL(this.url);\n\n if (parsedUrl.hostname.split(\".\")[1] === \"queue\") {\n // \"https://myaccount.queue.core.windows.net/queuename\".\n // .getPath() -> /queuename\n queueName = parsedUrl.pathname.split(\"/\")[1];\n } else if (isIpEndpointStyle(parsedUrl)) {\n // IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/queuename\n // Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/queuename\n // .getPath() -> /devstoreaccount1/queuename\n queueName = parsedUrl.pathname.split(\"/\")[2];\n } else {\n // \"https://customdomain.com/queuename\".\n // .getPath() -> /queuename\n queueName = parsedUrl.pathname.split(\"/\")[1];\n }\n\n if (!queueName) {\n throw new Error(\"Provided queueName is invalid.\");\n }\n\n return queueName;\n } catch (error: any) {\n throw new Error(\"Unable to extract queueName with provided information.\");\n }\n }\n\n /**\n * Only available for QueueClient constructed with a shared key credential.\n *\n * Generates a Service 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas\n *\n * @param options - Optional parameters.\n * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n public generateSasUrl(options: QueueGenerateSasUrlOptions): string {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the SAS when the client is initialized with a shared key credential\",\n );\n }\n\n const sas = generateQueueSASQueryParameters(\n {\n queueName: this.name,\n ...options,\n },\n this.credential,\n ).toString();\n\n return appendToURLQuery(this.url, sas);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"QueueSASPermissions.js","sourceRoot":"","sources":["../../../src/QueueSASPermissions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;;;GAQG;AACH,MAAM,OAAO,mBAAmB;IAAhC;QAgCE;;WAEG;QACI,SAAI,GAAY,KAAK,CAAC;QAE7B;;WAEG;QACI,QAAG,GAAY,KAAK,CAAC;QAE5B;;WAEG;QACI,WAAM,GAAY,KAAK,CAAC;QAE/B;;WAEG;QACI,YAAO,GAAY,KAAK,CAAC;IAwBlC,CAAC;IAzEC;;;;;OAKG;IACI,MAAM,CAAC,KAAK,CAAC,WAAmB;QACrC,MAAM,mBAAmB,GAAG,IAAI,mBAAmB,EAAE,CAAC;QAEtD,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE;YAC9B,QAAQ,IAAI,EAAE;gBACZ,KAAK,GAAG;oBACN,mBAAmB,CAAC,IAAI,GAAG,IAAI,CAAC;oBAChC,MAAM;gBACR,KAAK,GAAG;oBACN,mBAAmB,CAAC,GAAG,GAAG,IAAI,CAAC;oBAC/B,MAAM;gBACR,KAAK,GAAG;oBACN,mBAAmB,CAAC,MAAM,GAAG,IAAI,CAAC;oBAClC,MAAM;gBACR,KAAK,GAAG;oBACN,mBAAmB,CAAC,OAAO,GAAG,IAAI,CAAC;oBACnC,MAAM;gBACR;oBACE,MAAM,IAAI,UAAU,CAAC,uBAAuB,IAAI,EAAE,CAAC,CAAC;aACvD;SACF;QAED,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IAsBD;;;;;OAKG;IACI,QAAQ;QACb,MAAM,WAAW,GAAa,EAAE,CAAC;QACjC,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACvB;QACD,IAAI,IAAI,CAAC,GAAG,EAAE;YACZ,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACvB;QACD,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACvB;QACD,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACvB;QACD,OAAO,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a Queue. Setting\n * a value to true means that any SAS which uses these permissions will grant permissions for that operation. Once all\n * the values are set, this should be serialized with toString and set as the permissions field on a\n * {@link QueueSASSignatureValues} object. It is possible to construct the permissions string without this class, but\n * the order of the permissions is particular and this class guarantees correctness.\n */\nexport class QueueSASPermissions {\n /**\n * Creates a {@link QueueSASPermissions} from the specified permissions string. This method will throw an\n * Error if it encounters a character that does not correspond to a valid permission.\n *\n * @param permissions -\n */\n public static parse(permissions: string): QueueSASPermissions {\n const queueSASPermissions = new QueueSASPermissions();\n\n for (const char of permissions) {\n switch (char) {\n case \"r\":\n queueSASPermissions.read = true;\n break;\n case \"a\":\n queueSASPermissions.add = true;\n break;\n case \"u\":\n queueSASPermissions.update = true;\n break;\n case \"p\":\n queueSASPermissions.process = true;\n break;\n default:\n throw new RangeError(`Invalid permission: ${char}`);\n }\n }\n\n return queueSASPermissions;\n }\n\n /**\n * Specifies Read access granted.\n */\n public read: boolean = false;\n\n /**\n * Specifies Add access granted.\n */\n public add: boolean = false;\n\n /**\n * Specifies Update access granted.\n */\n public update: boolean = false;\n\n /**\n * Specifies Process access granted.\n */\n public process: boolean = false;\n\n /**\n * Converts the given permissions to a string. Using this method will guarantee the permissions are in an\n * order accepted by the service.\n *\n * @returns A string which represents the QueueSASPermissions\n */\n public toString(): string {\n const permissions: string[] = [];\n if (this.read) {\n permissions.push(\"r\");\n }\n if (this.add) {\n permissions.push(\"a\");\n }\n if (this.update) {\n permissions.push(\"u\");\n }\n if (this.process) {\n permissions.push(\"p\");\n }\n return permissions.join(\"\");\n }\n}\n"]}
1
+ {"version":3,"file":"QueueSASPermissions.js","sourceRoot":"","sources":["../../../src/QueueSASPermissions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;;;GAQG;AACH,MAAM,OAAO,mBAAmB;IAAhC;QAgCE;;WAEG;QACI,SAAI,GAAY,KAAK,CAAC;QAE7B;;WAEG;QACI,QAAG,GAAY,KAAK,CAAC;QAE5B;;WAEG;QACI,WAAM,GAAY,KAAK,CAAC;QAE/B;;WAEG;QACI,YAAO,GAAY,KAAK,CAAC;IAwBlC,CAAC;IAzEC;;;;;OAKG;IACI,MAAM,CAAC,KAAK,CAAC,WAAmB;QACrC,MAAM,mBAAmB,GAAG,IAAI,mBAAmB,EAAE,CAAC;QAEtD,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE,CAAC;YAC/B,QAAQ,IAAI,EAAE,CAAC;gBACb,KAAK,GAAG;oBACN,mBAAmB,CAAC,IAAI,GAAG,IAAI,CAAC;oBAChC,MAAM;gBACR,KAAK,GAAG;oBACN,mBAAmB,CAAC,GAAG,GAAG,IAAI,CAAC;oBAC/B,MAAM;gBACR,KAAK,GAAG;oBACN,mBAAmB,CAAC,MAAM,GAAG,IAAI,CAAC;oBAClC,MAAM;gBACR,KAAK,GAAG;oBACN,mBAAmB,CAAC,OAAO,GAAG,IAAI,CAAC;oBACnC,MAAM;gBACR;oBACE,MAAM,IAAI,UAAU,CAAC,uBAAuB,IAAI,EAAE,CAAC,CAAC;YACxD,CAAC;QACH,CAAC;QAED,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IAsBD;;;;;OAKG;IACI,QAAQ;QACb,MAAM,WAAW,GAAa,EAAE,CAAC;QACjC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,OAAO,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a Queue. Setting\n * a value to true means that any SAS which uses these permissions will grant permissions for that operation. Once all\n * the values are set, this should be serialized with toString and set as the permissions field on a\n * {@link QueueSASSignatureValues} object. It is possible to construct the permissions string without this class, but\n * the order of the permissions is particular and this class guarantees correctness.\n */\nexport class QueueSASPermissions {\n /**\n * Creates a {@link QueueSASPermissions} from the specified permissions string. This method will throw an\n * Error if it encounters a character that does not correspond to a valid permission.\n *\n * @param permissions -\n */\n public static parse(permissions: string): QueueSASPermissions {\n const queueSASPermissions = new QueueSASPermissions();\n\n for (const char of permissions) {\n switch (char) {\n case \"r\":\n queueSASPermissions.read = true;\n break;\n case \"a\":\n queueSASPermissions.add = true;\n break;\n case \"u\":\n queueSASPermissions.update = true;\n break;\n case \"p\":\n queueSASPermissions.process = true;\n break;\n default:\n throw new RangeError(`Invalid permission: ${char}`);\n }\n }\n\n return queueSASPermissions;\n }\n\n /**\n * Specifies Read access granted.\n */\n public read: boolean = false;\n\n /**\n * Specifies Add access granted.\n */\n public add: boolean = false;\n\n /**\n * Specifies Update access granted.\n */\n public update: boolean = false;\n\n /**\n * Specifies Process access granted.\n */\n public process: boolean = false;\n\n /**\n * Converts the given permissions to a string. Using this method will guarantee the permissions are in an\n * order accepted by the service.\n *\n * @returns A string which represents the QueueSASPermissions\n */\n public toString(): string {\n const permissions: string[] = [];\n if (this.read) {\n permissions.push(\"r\");\n }\n if (this.add) {\n permissions.push(\"a\");\n }\n if (this.update) {\n permissions.push(\"u\");\n }\n if (this.process) {\n permissions.push(\"p\");\n }\n return permissions.join(\"\");\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"QueueSASSignatureValues.js","sourceRoot":"","sources":["../../../src/QueueSASSignatureValues.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mB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CAAC,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;QACxE,OAAO;KACR,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,MAAM,SAAS,GAAG,mBAAmB,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAEtE,OAAO,IAAI,kBAAkB,CAC3B,OAAO,EACP,SAAS,EACT,mBAAmB,EACnB,SAAS,EACT,SAAS,EACT,uBAAuB,CAAC,QAAQ,EAChC,uBAAuB,CAAC,QAAQ,EAChC,uBAAuB,CAAC,SAAS,EACjC,uBAAuB,CAAC,OAAO,EAC/B,uBAAuB,CAAC,UAAU,CACnC,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAAC,WAAmB,EAAE,SAAiB;IAC9D,oCAAoC;IACpC,OAAO,UAAU,WAAW,IAAI,SAAS,EAAE,CAAC;AAC9C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { QueueSASPermissions } from \"./QueueSASPermissions\";\nimport { StorageSharedKeyCredential } from \"../../storage-blob/src/credentials/StorageSharedKeyCredential\";\nimport { SasIPRange, ipRangeToString } from \"./SasIPRange\";\nimport { SASProtocol } from \"./SASQueryParameters\";\nimport { SASQueryParameters } from \"./SASQueryParameters\";\nimport { SERVICE_VERSION } from \"./utils/constants\";\nimport { truncatedISO8061Date } from \"./utils/utils.common\";\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * QueueSASSignatureValues is used to help generating Queue service SAS tokens for queues.\n */\nexport interface QueueSASSignatureValues {\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, HTTPS only or HTTPSandHTTP\n */\n protocol?: SASProtocol;\n\n /**\n * Optional. When the SAS will take effect.\n */\n startsOn?: Date;\n\n /**\n * Optional only when identifier is provided. The time after which the SAS will no longer work.\n */\n expiresOn?: Date;\n\n /**\n * Optional only when identifier is provided.\n * Please refer to {@link QueueSASPermissions}\n * being accessed for help constructing the permissions string.\n */\n permissions?: QueueSASPermissions;\n\n /**\n * Optional. IP ranges allowed in this SAS.\n */\n ipRange?: SasIPRange;\n\n /**\n * The name of the queue the SAS user may access.\n */\n queueName: string;\n\n /**\n * Optional. The name of the access policy on the queue this SAS references if any.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy\n */\n identifier?: string;\n}\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Creates an instance of SASQueryParameters.\n *\n * Only accepts required settings needed to create a SAS. For optional settings please\n * set corresponding properties directly, such as permissions, startsOn and identifier.\n *\n * WARNING: When identifier is not provided, permissions and expiresOn are required.\n * You MUST assign value to identifier or expiresOn & permissions manually if you initial with\n * this constructor.\n *\n * @param queueSASSignatureValues -\n * @param sharedKeyCredential -\n */\nexport function generateQueueSASQueryParameters(\n queueSASSignatureValues: QueueSASSignatureValues,\n sharedKeyCredential: StorageSharedKeyCredential,\n): SASQueryParameters {\n if (\n !queueSASSignatureValues.identifier &&\n !(queueSASSignatureValues.permissions && queueSASSignatureValues.expiresOn)\n ) {\n throw new RangeError(\n \"Must provide 'permissions' and 'expiresOn' for Queue SAS generation when 'identifier' is not provided.\",\n );\n }\n\n const version = queueSASSignatureValues.version\n ? queueSASSignatureValues.version\n : SERVICE_VERSION;\n let verifiedPermissions: string | undefined;\n\n // Calling parse and toString guarantees the proper ordering and throws on invalid characters.\n if (queueSASSignatureValues.permissions) {\n verifiedPermissions = QueueSASPermissions.parse(\n queueSASSignatureValues.permissions.toString(),\n ).toString();\n }\n\n // Signature is generated on the un-url-encoded values.\n const stringToSign = [\n verifiedPermissions ? verifiedPermissions : \"\",\n queueSASSignatureValues.startsOn\n ? truncatedISO8061Date(queueSASSignatureValues.startsOn, false)\n : \"\",\n queueSASSignatureValues.expiresOn\n ? truncatedISO8061Date(queueSASSignatureValues.expiresOn, false)\n : \"\",\n getCanonicalName(sharedKeyCredential.accountName, queueSASSignatureValues.queueName),\n queueSASSignatureValues.identifier,\n queueSASSignatureValues.ipRange ? ipRangeToString(queueSASSignatureValues.ipRange) : \"\",\n queueSASSignatureValues.protocol ? queueSASSignatureValues.protocol : \"\",\n version,\n ].join(\"\\n\");\n\n const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);\n\n return new SASQueryParameters(\n version,\n signature,\n verifiedPermissions,\n undefined,\n undefined,\n queueSASSignatureValues.protocol,\n queueSASSignatureValues.startsOn,\n queueSASSignatureValues.expiresOn,\n queueSASSignatureValues.ipRange,\n queueSASSignatureValues.identifier,\n );\n}\n\nfunction getCanonicalName(accountName: string, queueName: string): string {\n // Queue: \"/queue/account/queueName\"\n return `/queue/${accountName}/${queueName}`;\n}\n"]}
1
+ {"version":3,"file":"QueueSASSignatureValues.js","sourceRoot":"","sources":["../../../src/QueueSASSignatureValues.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAsD5D;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,+BAA+B,CAC7C,uBAAgD,EAChD,mBAA+C;IAE/C,IACE,CAAC,uBAAuB,CAAC,UAAU;QACnC,CAAC,CAAC,uBAAuB,CAAC,WAAW,IAAI,uBAAuB,CAAC,SAAS,CAAC,EAC3E,CAAC;QACD,MAAM,IAAI,UAAU,CAClB,wGAAwG,CACzG,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,uBAAuB,CAAC,OAAO;QAC7C,CAAC,CAAC,uBAAuB,CAAC,OAAO;QACjC,CAAC,CAAC,eA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AC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAAC,WAAmB,EAAE,SAAiB;IAC9D,oCAAoC;IACpC,OAAO,UAAU,WAAW,IAAI,SAAS,EAAE,CAAC;AAC9C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { QueueSASPermissions } from \"./QueueSASPermissions\";\nimport { StorageSharedKeyCredential } from \"../../storage-blob/src/credentials/StorageSharedKeyCredential\";\nimport { SasIPRange, ipRangeToString } from \"./SasIPRange\";\nimport { SASProtocol } from \"./SASQueryParameters\";\nimport { SASQueryParameters } from \"./SASQueryParameters\";\nimport { SERVICE_VERSION } from \"./utils/constants\";\nimport { truncatedISO8061Date } from \"./utils/utils.common\";\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * QueueSASSignatureValues is used to help generating Queue service SAS tokens for queues.\n */\nexport interface QueueSASSignatureValues {\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, HTTPS only or HTTPSandHTTP\n */\n protocol?: SASProtocol;\n\n /**\n * Optional. When the SAS will take effect.\n */\n startsOn?: Date;\n\n /**\n * Optional only when identifier is provided. The time after which the SAS will no longer work.\n */\n expiresOn?: Date;\n\n /**\n * Optional only when identifier is provided.\n * Please refer to {@link QueueSASPermissions}\n * being accessed for help constructing the permissions string.\n */\n permissions?: QueueSASPermissions;\n\n /**\n * Optional. IP ranges allowed in this SAS.\n */\n ipRange?: SasIPRange;\n\n /**\n * The name of the queue the SAS user may access.\n */\n queueName: string;\n\n /**\n * Optional. The name of the access policy on the queue this SAS references if any.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy\n */\n identifier?: string;\n}\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Creates an instance of SASQueryParameters.\n *\n * Only accepts required settings needed to create a SAS. For optional settings please\n * set corresponding properties directly, such as permissions, startsOn and identifier.\n *\n * WARNING: When identifier is not provided, permissions and expiresOn are required.\n * You MUST assign value to identifier or expiresOn & permissions manually if you initial with\n * this constructor.\n *\n * @param queueSASSignatureValues -\n * @param sharedKeyCredential -\n */\nexport function generateQueueSASQueryParameters(\n queueSASSignatureValues: QueueSASSignatureValues,\n sharedKeyCredential: StorageSharedKeyCredential,\n): SASQueryParameters {\n if (\n !queueSASSignatureValues.identifier &&\n !(queueSASSignatureValues.permissions && queueSASSignatureValues.expiresOn)\n ) {\n throw new RangeError(\n \"Must provide 'permissions' and 'expiresOn' for Queue SAS generation when 'identifier' is not provided.\",\n );\n }\n\n const version = queueSASSignatureValues.version\n ? queueSASSignatureValues.version\n : SERVICE_VERSION;\n let verifiedPermissions: string | undefined;\n\n // Calling parse and toString guarantees the proper ordering and throws on invalid characters.\n if (queueSASSignatureValues.permissions) {\n verifiedPermissions = QueueSASPermissions.parse(\n queueSASSignatureValues.permissions.toString(),\n ).toString();\n }\n\n // Signature is generated on the un-url-encoded values.\n const stringToSign = [\n verifiedPermissions ? verifiedPermissions : \"\",\n queueSASSignatureValues.startsOn\n ? truncatedISO8061Date(queueSASSignatureValues.startsOn, false)\n : \"\",\n queueSASSignatureValues.expiresOn\n ? truncatedISO8061Date(queueSASSignatureValues.expiresOn, false)\n : \"\",\n getCanonicalName(sharedKeyCredential.accountName, queueSASSignatureValues.queueName),\n queueSASSignatureValues.identifier,\n queueSASSignatureValues.ipRange ? ipRangeToString(queueSASSignatureValues.ipRange) : \"\",\n queueSASSignatureValues.protocol ? queueSASSignatureValues.protocol : \"\",\n version,\n ].join(\"\\n\");\n\n const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);\n\n return new SASQueryParameters(\n version,\n signature,\n verifiedPermissions,\n undefined,\n undefined,\n queueSASSignatureValues.protocol,\n queueSASSignatureValues.startsOn,\n queueSASSignatureValues.expiresOn,\n queueSASSignatureValues.ipRange,\n queueSASSignatureValues.identifier,\n );\n}\n\nfunction getCanonicalName(accountName: string, queueName: string): string {\n // Queue: \"/queue/account/queueName\"\n return `/queue/${accountName}/${queueName}`;\n}\n"]}