@azure/storage-file-share 12.28.0-alpha.20250717.2 → 12.28.0-alpha.20250718.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/dist/browser/AccountSASPermissions.js +32 -34
  2. package/dist/browser/AccountSASPermissions.js.map +1 -1
  3. package/dist/browser/AccountSASResourceTypes.js +12 -14
  4. package/dist/browser/AccountSASResourceTypes.js.map +1 -1
  5. package/dist/browser/AccountSASServices.js +16 -18
  6. package/dist/browser/AccountSASServices.js.map +1 -1
  7. package/dist/browser/Clients.js +551 -238
  8. package/dist/browser/Clients.js.map +1 -1
  9. package/dist/browser/FileSASPermissions.js +16 -18
  10. package/dist/browser/FileSASPermissions.js.map +1 -1
  11. package/dist/browser/FileSystemAttributes.js +43 -45
  12. package/dist/browser/FileSystemAttributes.js.map +1 -1
  13. package/dist/browser/Pipeline.js +27 -10
  14. package/dist/browser/Pipeline.js.map +1 -1
  15. package/dist/browser/SASQueryParameters.js +70 -0
  16. package/dist/browser/SASQueryParameters.js.map +1 -1
  17. package/dist/browser/ShareClientInternal.js +1 -0
  18. package/dist/browser/ShareClientInternal.js.map +1 -1
  19. package/dist/browser/ShareSASPermissions.js +20 -22
  20. package/dist/browser/ShareSASPermissions.js.map +1 -1
  21. package/dist/browser/ShareServiceClient.js +63 -47
  22. package/dist/browser/ShareServiceClient.js.map +1 -1
  23. package/dist/browser/StorageClient.js +23 -0
  24. package/dist/browser/StorageClient.js.map +1 -1
  25. package/dist/browser/StorageContextClient.js +1 -1
  26. package/dist/browser/StorageContextClient.js.map +1 -1
  27. package/dist/browser/generated/src/operations/directory.js +1 -0
  28. package/dist/browser/generated/src/operations/directory.js.map +1 -1
  29. package/dist/browser/generated/src/operations/file.js +1 -0
  30. package/dist/browser/generated/src/operations/file.js.map +1 -1
  31. package/dist/browser/generated/src/operations/service.js +1 -0
  32. package/dist/browser/generated/src/operations/service.js.map +1 -1
  33. package/dist/browser/generated/src/operations/share.js +1 -0
  34. package/dist/browser/generated/src/operations/share.js.map +1 -1
  35. package/dist/browser/generated/src/storageClient.js +14 -3
  36. package/dist/browser/generated/src/storageClient.js.map +1 -1
  37. package/dist/browser/utils/Batch.js +29 -21
  38. package/dist/browser/utils/Batch.js.map +1 -1
  39. package/dist/browser/utils/BufferScheduler.js +70 -44
  40. package/dist/browser/utils/BufferScheduler.js.map +1 -1
  41. package/dist/browser/utils/RetriableReadableStream.js +70 -62
  42. package/dist/browser/utils/RetriableReadableStream.js.map +1 -1
  43. package/dist/browser/utils/utils.common.js +31 -15
  44. package/dist/browser/utils/utils.common.js.map +1 -1
  45. package/dist/commonjs/AccountSASPermissions.js +32 -34
  46. package/dist/commonjs/AccountSASPermissions.js.map +1 -1
  47. package/dist/commonjs/AccountSASResourceTypes.js +12 -14
  48. package/dist/commonjs/AccountSASResourceTypes.js.map +1 -1
  49. package/dist/commonjs/AccountSASServices.js +16 -18
  50. package/dist/commonjs/AccountSASServices.js.map +1 -1
  51. package/dist/commonjs/Clients.js +551 -238
  52. package/dist/commonjs/Clients.js.map +1 -1
  53. package/dist/commonjs/FileDownloadResponse.js +2 -0
  54. package/dist/commonjs/FileDownloadResponse.js.map +1 -1
  55. package/dist/commonjs/FileSASPermissions.js +16 -18
  56. package/dist/commonjs/FileSASPermissions.js.map +1 -1
  57. package/dist/commonjs/FileSystemAttributes.js +43 -45
  58. package/dist/commonjs/FileSystemAttributes.js.map +1 -1
  59. package/dist/commonjs/Pipeline.js +27 -10
  60. package/dist/commonjs/Pipeline.js.map +1 -1
  61. package/dist/commonjs/SASQueryParameters.js +70 -0
  62. package/dist/commonjs/SASQueryParameters.js.map +1 -1
  63. package/dist/commonjs/ShareClientInternal.js +1 -0
  64. package/dist/commonjs/ShareClientInternal.js.map +1 -1
  65. package/dist/commonjs/ShareSASPermissions.js +20 -22
  66. package/dist/commonjs/ShareSASPermissions.js.map +1 -1
  67. package/dist/commonjs/ShareServiceClient.js +63 -47
  68. package/dist/commonjs/ShareServiceClient.js.map +1 -1
  69. package/dist/commonjs/StorageClient.js +23 -0
  70. package/dist/commonjs/StorageClient.js.map +1 -1
  71. package/dist/commonjs/StorageContextClient.js +1 -1
  72. package/dist/commonjs/StorageContextClient.js.map +1 -1
  73. package/dist/commonjs/generated/src/operations/directory.js +1 -0
  74. package/dist/commonjs/generated/src/operations/directory.js.map +1 -1
  75. package/dist/commonjs/generated/src/operations/file.js +1 -0
  76. package/dist/commonjs/generated/src/operations/file.js.map +1 -1
  77. package/dist/commonjs/generated/src/operations/service.js +1 -0
  78. package/dist/commonjs/generated/src/operations/service.js.map +1 -1
  79. package/dist/commonjs/generated/src/operations/share.js +1 -0
  80. package/dist/commonjs/generated/src/operations/share.js.map +1 -1
  81. package/dist/commonjs/generated/src/storageClient.js +14 -3
  82. package/dist/commonjs/generated/src/storageClient.js.map +1 -1
  83. package/dist/commonjs/tsdoc-metadata.json +11 -11
  84. package/dist/commonjs/utils/Batch.js +29 -21
  85. package/dist/commonjs/utils/Batch.js.map +1 -1
  86. package/dist/commonjs/utils/BufferScheduler.js +70 -44
  87. package/dist/commonjs/utils/BufferScheduler.js.map +1 -1
  88. package/dist/commonjs/utils/RetriableReadableStream.js +70 -62
  89. package/dist/commonjs/utils/RetriableReadableStream.js.map +1 -1
  90. package/dist/commonjs/utils/utils.common.js +31 -15
  91. package/dist/commonjs/utils/utils.common.js.map +1 -1
  92. package/dist/esm/AccountSASPermissions.js +32 -34
  93. package/dist/esm/AccountSASPermissions.js.map +1 -1
  94. package/dist/esm/AccountSASResourceTypes.js +12 -14
  95. package/dist/esm/AccountSASResourceTypes.js.map +1 -1
  96. package/dist/esm/AccountSASServices.js +16 -18
  97. package/dist/esm/AccountSASServices.js.map +1 -1
  98. package/dist/esm/Clients.js +551 -238
  99. package/dist/esm/Clients.js.map +1 -1
  100. package/dist/esm/FileDownloadResponse.js +2 -0
  101. package/dist/esm/FileDownloadResponse.js.map +1 -1
  102. package/dist/esm/FileSASPermissions.js +16 -18
  103. package/dist/esm/FileSASPermissions.js.map +1 -1
  104. package/dist/esm/FileSystemAttributes.js +43 -45
  105. package/dist/esm/FileSystemAttributes.js.map +1 -1
  106. package/dist/esm/Pipeline.js +27 -10
  107. package/dist/esm/Pipeline.js.map +1 -1
  108. package/dist/esm/SASQueryParameters.js +70 -0
  109. package/dist/esm/SASQueryParameters.js.map +1 -1
  110. package/dist/esm/ShareClientInternal.js +1 -0
  111. package/dist/esm/ShareClientInternal.js.map +1 -1
  112. package/dist/esm/ShareSASPermissions.js +20 -22
  113. package/dist/esm/ShareSASPermissions.js.map +1 -1
  114. package/dist/esm/ShareServiceClient.js +63 -47
  115. package/dist/esm/ShareServiceClient.js.map +1 -1
  116. package/dist/esm/StorageClient.js +23 -0
  117. package/dist/esm/StorageClient.js.map +1 -1
  118. package/dist/esm/StorageContextClient.js +1 -1
  119. package/dist/esm/StorageContextClient.js.map +1 -1
  120. package/dist/esm/generated/src/operations/directory.js +1 -0
  121. package/dist/esm/generated/src/operations/directory.js.map +1 -1
  122. package/dist/esm/generated/src/operations/file.js +1 -0
  123. package/dist/esm/generated/src/operations/file.js.map +1 -1
  124. package/dist/esm/generated/src/operations/service.js +1 -0
  125. package/dist/esm/generated/src/operations/service.js.map +1 -1
  126. package/dist/esm/generated/src/operations/share.js +1 -0
  127. package/dist/esm/generated/src/operations/share.js.map +1 -1
  128. package/dist/esm/generated/src/storageClient.js +14 -3
  129. package/dist/esm/generated/src/storageClient.js.map +1 -1
  130. package/dist/esm/utils/Batch.js +29 -21
  131. package/dist/esm/utils/Batch.js.map +1 -1
  132. package/dist/esm/utils/BufferScheduler.js +70 -44
  133. package/dist/esm/utils/BufferScheduler.js.map +1 -1
  134. package/dist/esm/utils/RetriableReadableStream.js +70 -62
  135. package/dist/esm/utils/RetriableReadableStream.js.map +1 -1
  136. package/dist/esm/utils/utils.common.js +31 -15
  137. package/dist/esm/utils/utils.common.js.map +1 -1
  138. package/dist/react-native/AccountSASPermissions.js +32 -34
  139. package/dist/react-native/AccountSASPermissions.js.map +1 -1
  140. package/dist/react-native/AccountSASResourceTypes.js +12 -14
  141. package/dist/react-native/AccountSASResourceTypes.js.map +1 -1
  142. package/dist/react-native/AccountSASServices.js +16 -18
  143. package/dist/react-native/AccountSASServices.js.map +1 -1
  144. package/dist/react-native/Clients.js +551 -238
  145. package/dist/react-native/Clients.js.map +1 -1
  146. package/dist/react-native/FileDownloadResponse.js +2 -0
  147. package/dist/react-native/FileDownloadResponse.js.map +1 -1
  148. package/dist/react-native/FileSASPermissions.js +16 -18
  149. package/dist/react-native/FileSASPermissions.js.map +1 -1
  150. package/dist/react-native/FileSystemAttributes.js +43 -45
  151. package/dist/react-native/FileSystemAttributes.js.map +1 -1
  152. package/dist/react-native/Pipeline.js +27 -10
  153. package/dist/react-native/Pipeline.js.map +1 -1
  154. package/dist/react-native/SASQueryParameters.js +70 -0
  155. package/dist/react-native/SASQueryParameters.js.map +1 -1
  156. package/dist/react-native/ShareClientInternal.js +1 -0
  157. package/dist/react-native/ShareClientInternal.js.map +1 -1
  158. package/dist/react-native/ShareSASPermissions.js +20 -22
  159. package/dist/react-native/ShareSASPermissions.js.map +1 -1
  160. package/dist/react-native/ShareServiceClient.js +63 -47
  161. package/dist/react-native/ShareServiceClient.js.map +1 -1
  162. package/dist/react-native/StorageClient.js +23 -0
  163. package/dist/react-native/StorageClient.js.map +1 -1
  164. package/dist/react-native/StorageContextClient.js +1 -1
  165. package/dist/react-native/StorageContextClient.js.map +1 -1
  166. package/dist/react-native/generated/src/operations/directory.js +1 -0
  167. package/dist/react-native/generated/src/operations/directory.js.map +1 -1
  168. package/dist/react-native/generated/src/operations/file.js +1 -0
  169. package/dist/react-native/generated/src/operations/file.js.map +1 -1
  170. package/dist/react-native/generated/src/operations/service.js +1 -0
  171. package/dist/react-native/generated/src/operations/service.js.map +1 -1
  172. package/dist/react-native/generated/src/operations/share.js +1 -0
  173. package/dist/react-native/generated/src/operations/share.js.map +1 -1
  174. package/dist/react-native/generated/src/storageClient.js +14 -3
  175. package/dist/react-native/generated/src/storageClient.js.map +1 -1
  176. package/dist/react-native/utils/Batch.js +29 -21
  177. package/dist/react-native/utils/Batch.js.map +1 -1
  178. package/dist/react-native/utils/BufferScheduler.js +70 -44
  179. package/dist/react-native/utils/BufferScheduler.js.map +1 -1
  180. package/dist/react-native/utils/RetriableReadableStream.js +70 -62
  181. package/dist/react-native/utils/RetriableReadableStream.js.map +1 -1
  182. package/dist/react-native/utils/utils.common.js +31 -15
  183. package/dist/react-native/utils/utils.common.js.map +1 -1
  184. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"SASQueryParameters.js","sourceRoot":"","sources":["../../src/SASQueryParameters.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAGlC,mDAAkD;AAClD,6DAA+D;AAE/D;;GAEG;AACH,IAAY,WAUX;AAVD,WAAY,WAAW;IACrB;;OAEG;IACH,8BAAe,CAAA;IAEf;;OAEG;IACH,0CAA2B,CAAA;AAC7B,CAAC,EAVW,WAAW,2BAAX,WAAW,QAUtB;AAED;;;;;;;;GAQG;AACH,MAAa,kBAAkB;IAuF7B;;;;OAIG;IACH,IAAW,OAAO;QAChB,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,OAAO;gBACL,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG;gBAC1B,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK;aAC/B,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,YACE,OAAe,EACf,SAAiB,EACjB,WAAoB,EACpB,QAAiB,EACjB,aAAsB,EACtB,QAAsB,EACtB,QAAe,EACf,SAAgB,EAChB,OAAoB,EACpB,UAAmB,EACnB,QAAiB,EACjB,YAAqB,EACrB,kBAA2B,EAC3B,eAAwB,EACxB,eAAwB,EACxB,WAAoB;QAEpB,IAAI,CAAC,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AC,CAAC;QAClC,CAAC;IACH,CAAC;CACF;AA5QD,gDA4QC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { SasIPRange } from \"./SasIPRange.js\";\nimport { ipRangeToString } from \"./SasIPRange.js\";\nimport { truncatedISO8061Date } from \"./utils/utils.common.js\";\n\n/**\n * Protocols for generated SAS.\n */\nexport enum SASProtocol {\n /**\n * Protocol that allows HTTPS only\n */\n Https = \"https\",\n\n /**\n * Protocol that allows both HTTPS and HTTP\n */\n HttpsAndHttp = \"https,http\",\n}\n\n/**\n * Represents the components that make up an Azure Storage SAS' query parameters. This type is not constructed directly\n * by the user; it is only generated by the {@link AccountSASSignatureValues} and {@link FileSASSignatureValues}\n * types. Once generated, it can be encoded into a {@link String} and appended to a URL directly (though caution should\n * be taken here in case there are existing query parameters, which might affect the appropriate means of appending\n * these query parameters).\n *\n * NOTE: Instances of this class are immutable.\n */\nexport class SASQueryParameters {\n /**\n * The storage API version.\n */\n public readonly version: string;\n\n /**\n * Optional. The allowed HTTP protocol(s).\n */\n public readonly protocol?: SASProtocol;\n\n /**\n * Optional. The start time for this SAS token.\n */\n public readonly startsOn?: Date;\n\n /**\n * Optional only when identifier is provided. The expiry time for this SAS token.\n */\n public readonly expiresOn?: Date;\n\n /**\n * Optional only when identifier is provided.\n * Please refer to {@link AccountSASPermissions}, {@link FileSASPermissions}, or {@link ShareSASPermissions} for\n * more details.\n */\n public readonly permissions?: string;\n\n /**\n * Optional. The storage services being accessed (only for Account SAS). Please refer to {@link AccountSASServices}\n * for more details.\n */\n public readonly services?: string;\n\n /**\n * Optional. The storage resource types being accessed (only for Account SAS). Please refer to\n * {@link AccountSASResourceTypes} for more details.\n */\n public readonly resourceTypes?: string;\n\n /**\n * Optional. The signed identifier (only for {@link FileSASSignatureValues}).\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy\n */\n public readonly identifier?: string;\n\n /**\n * Optional. The storage share or file path (only for {@link FileSASSignatureValues}).\n */\n public readonly resource?: string;\n\n /**\n * The signature for the SAS token.\n */\n public readonly signature: string;\n\n /**\n * Value for cache-control header in Blob/File Service SAS.\n */\n public readonly cacheControl?: string;\n\n /**\n * Value for content-disposition header in Blob/File Service SAS.\n */\n public readonly contentDisposition?: string;\n\n /**\n * Value for content-encoding header in Blob/File Service SAS.\n */\n public readonly contentEncoding?: string;\n\n /**\n * Value for content-length header in Blob/File Service SAS.\n */\n public readonly contentLanguage?: string;\n\n /**\n * Value for content-type header in Blob/File Service SAS.\n */\n public readonly contentType?: string;\n\n /**\n * Inner value of getter ipRange.\n */\n private readonly ipRangeInner?: SasIPRange;\n\n /**\n * Optional. IP range allowed for this SAS.\n *\n * @readonly\n */\n public get ipRange(): SasIPRange | undefined {\n if (this.ipRangeInner) {\n return {\n end: this.ipRangeInner.end,\n start: this.ipRangeInner.start,\n };\n }\n return undefined;\n }\n\n /**\n * Creates an instance of SASQueryParameters.\n *\n * @param version - Representing the storage version\n * @param signature - Representing the signature for the SAS token\n * @param permissions - Representing the storage permissions\n * @param services - Representing the storage services being accessed (only for Account SAS)\n * @param resourceTypes - Representing the storage resource types being accessed (only for Account SAS)\n * @param protocol - Representing the allowed HTTP protocol(s)\n * @param startsOn - Representing the start time for this SAS token\n * @param expiresOn - Representing the expiry time for this SAS token\n * @param ipRange - Representing the range of valid IP addresses for this SAS token\n * @param identifier - Representing the signed identifier (only for Service SAS)\n * @param resource - Representing the storage container or blob (only for Service SAS)\n * @param cacheControl - Representing the cache-control header (only for Blob/File Service SAS)\n * @param contentDisposition - Representing the content-disposition header (only for Blob/File Service SAS)\n * @param contentEncoding - Representing the content-encoding header (only for Blob/File Service SAS)\n * @param contentLanguage - Representing the content-language header (only for Blob/File Service SAS)\n * @param contentType - Representing the content-type header (only for Blob/File Service SAS)\n */\n constructor(\n version: string,\n signature: string,\n permissions?: string,\n services?: string,\n resourceTypes?: string,\n protocol?: SASProtocol,\n startsOn?: Date,\n expiresOn?: Date,\n ipRange?: SasIPRange,\n identifier?: string,\n resource?: string,\n cacheControl?: string,\n contentDisposition?: string,\n contentEncoding?: string,\n contentLanguage?: string,\n contentType?: string,\n ) {\n this.version = version;\n this.services = services;\n this.resourceTypes = resourceTypes;\n this.expiresOn = expiresOn;\n this.permissions = permissions;\n this.protocol = protocol;\n this.startsOn = startsOn;\n this.ipRangeInner = ipRange;\n this.identifier = identifier;\n this.resource = resource;\n this.signature = signature;\n this.cacheControl = cacheControl;\n this.contentDisposition = contentDisposition;\n this.contentEncoding = contentEncoding;\n this.contentLanguage = contentLanguage;\n this.contentType = contentType;\n }\n\n /**\n * Encodes all SAS query parameters into a string that can be appended to a URL.\n *\n */\n public toString(): string {\n const params: string[] = [\n \"sv\",\n \"ss\",\n \"srt\",\n \"spr\",\n \"st\",\n \"se\",\n \"sip\",\n \"si\",\n \"sr\",\n \"sp\",\n \"sig\",\n \"rscc\",\n \"rscd\",\n \"rsce\",\n \"rscl\",\n \"rsct\",\n ];\n const queries: string[] = [];\n\n for (const param of params) {\n switch (param) {\n case \"sv\":\n this.tryAppendQueryParameter(queries, param, this.version);\n break;\n case \"ss\":\n this.tryAppendQueryParameter(queries, param, this.services);\n break;\n case \"srt\":\n this.tryAppendQueryParameter(queries, param, this.resourceTypes);\n break;\n case \"spr\":\n this.tryAppendQueryParameter(queries, param, this.protocol);\n break;\n case \"st\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.startsOn ? truncatedISO8061Date(this.startsOn, false) : undefined,\n );\n break;\n case \"se\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : undefined,\n );\n break;\n case \"sip\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.ipRange ? ipRangeToString(this.ipRange) : undefined,\n );\n break;\n case \"si\":\n this.tryAppendQueryParameter(queries, param, this.identifier);\n break;\n case \"sr\":\n this.tryAppendQueryParameter(queries, param, this.resource);\n break;\n case \"sp\":\n this.tryAppendQueryParameter(queries, param, this.permissions);\n break;\n case \"sig\":\n this.tryAppendQueryParameter(queries, param, this.signature);\n break;\n case \"rscc\":\n this.tryAppendQueryParameter(queries, param, this.cacheControl);\n break;\n case \"rscd\":\n this.tryAppendQueryParameter(queries, param, this.contentDisposition);\n break;\n case \"rsce\":\n this.tryAppendQueryParameter(queries, param, this.contentEncoding);\n break;\n case \"rscl\":\n this.tryAppendQueryParameter(queries, param, this.contentLanguage);\n break;\n case \"rsct\":\n this.tryAppendQueryParameter(queries, param, this.contentType);\n break;\n }\n }\n return queries.join(\"&\");\n }\n\n /**\n * A private helper method used to filter and append query key/value pairs into an array.\n *\n * @param queries -\n * @param key -\n * @param value -\n */\n private tryAppendQueryParameter(queries: string[], key: string, value?: string): void {\n if (!value) {\n return;\n }\n\n key = encodeURIComponent(key);\n value = encodeURIComponent(value);\n if (key.length > 0 && value.length > 0) {\n queries.push(`${key}=${value}`);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"SASQueryParameters.js","sourceRoot":"","sources":["../../src/SASQueryParameters.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAGlC,mDAAkD;AAClD,6DAA+D;AAE/D;;GAEG;AACH,IAAY,WAUX;AAVD,WAAY,WAAW;IACrB;;OAEG;IACH,8BAAe,CAAA;IAEf;;OAEG;IACH,0CAA2B,CAAA;AAC7B,CAAC,EAVW,WAAW,2BAAX,WAAW,QAUtB;AAED;;;;;;;;GAQG;AACH,MAAa,kBAAkB;IAC7B;;OAEG;IACa,OAAO,CAAS;IAEhC;;OAEG;IACa,QAAQ,CAAe;IAEvC;;OAEG;IACa,QAAQ,CAAQ;IAEhC;;OAEG;IACa,SAAS,CAAQ;IAEjC;;;;OAIG;IACa,WAAW,CAAU;IAErC;;;OAGG;IACa,QAAQ,CAAU;IAElC;;;OAGG;IACa,aAAa,CAAU;IAEvC;;;;OAIG;IACa,UAAU,CAAU;IAEpC;;OAEG;IACa,QAAQ,CAAU;IAElC;;OAEG;IACa,SAAS,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;gBACR,KAAK,MAAM;oBACT,IAAI,CAAC,uBAAuB,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;oBACnE,MAAM;gBACR,KAAK,MAAM;oBACT,IAAI,CAAC,uBAAuB,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;oBAC/D,MAAM;YACV,CAAC;QACH,CAAC;QACD,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAED;;;;;;OAMG;IACK,uBAAuB,CAAC,OAAiB,EAAE,GAAW,EAAE,KAAc;QAC5E,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO;QACT,CAAC;QAED,GAAG,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAC9B,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvC,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;CACF;AA5QD,gDA4QC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { SasIPRange } from \"./SasIPRange.js\";\nimport { ipRangeToString } from \"./SasIPRange.js\";\nimport { truncatedISO8061Date } from \"./utils/utils.common.js\";\n\n/**\n * Protocols for generated SAS.\n */\nexport enum SASProtocol {\n /**\n * Protocol that allows HTTPS only\n */\n Https = \"https\",\n\n /**\n * Protocol that allows both HTTPS and HTTP\n */\n HttpsAndHttp = \"https,http\",\n}\n\n/**\n * Represents the components that make up an Azure Storage SAS' query parameters. This type is not constructed directly\n * by the user; it is only generated by the {@link AccountSASSignatureValues} and {@link FileSASSignatureValues}\n * types. Once generated, it can be encoded into a {@link String} and appended to a URL directly (though caution should\n * be taken here in case there are existing query parameters, which might affect the appropriate means of appending\n * these query parameters).\n *\n * NOTE: Instances of this class are immutable.\n */\nexport class SASQueryParameters {\n /**\n * The storage API version.\n */\n public readonly version: string;\n\n /**\n * Optional. The allowed HTTP protocol(s).\n */\n public readonly protocol?: SASProtocol;\n\n /**\n * Optional. The start time for this SAS token.\n */\n public readonly startsOn?: Date;\n\n /**\n * Optional only when identifier is provided. The expiry time for this SAS token.\n */\n public readonly expiresOn?: Date;\n\n /**\n * Optional only when identifier is provided.\n * Please refer to {@link AccountSASPermissions}, {@link FileSASPermissions}, or {@link ShareSASPermissions} for\n * more details.\n */\n public readonly permissions?: string;\n\n /**\n * Optional. The storage services being accessed (only for Account SAS). Please refer to {@link AccountSASServices}\n * for more details.\n */\n public readonly services?: string;\n\n /**\n * Optional. The storage resource types being accessed (only for Account SAS). Please refer to\n * {@link AccountSASResourceTypes} for more details.\n */\n public readonly resourceTypes?: string;\n\n /**\n * Optional. The signed identifier (only for {@link FileSASSignatureValues}).\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy\n */\n public readonly identifier?: string;\n\n /**\n * Optional. The storage share or file path (only for {@link FileSASSignatureValues}).\n */\n public readonly resource?: string;\n\n /**\n * The signature for the SAS token.\n */\n public readonly signature: string;\n\n /**\n * Value for cache-control header in Blob/File Service SAS.\n */\n public readonly cacheControl?: string;\n\n /**\n * Value for content-disposition header in Blob/File Service SAS.\n */\n public readonly contentDisposition?: string;\n\n /**\n * Value for content-encoding header in Blob/File Service SAS.\n */\n public readonly contentEncoding?: string;\n\n /**\n * Value for content-length header in Blob/File Service SAS.\n */\n public readonly contentLanguage?: string;\n\n /**\n * Value for content-type header in Blob/File Service SAS.\n */\n public readonly contentType?: string;\n\n /**\n * Inner value of getter ipRange.\n */\n private readonly ipRangeInner?: SasIPRange;\n\n /**\n * Optional. IP range allowed for this SAS.\n *\n * @readonly\n */\n public get ipRange(): SasIPRange | undefined {\n if (this.ipRangeInner) {\n return {\n end: this.ipRangeInner.end,\n start: this.ipRangeInner.start,\n };\n }\n return undefined;\n }\n\n /**\n * Creates an instance of SASQueryParameters.\n *\n * @param version - Representing the storage version\n * @param signature - Representing the signature for the SAS token\n * @param permissions - Representing the storage permissions\n * @param services - Representing the storage services being accessed (only for Account SAS)\n * @param resourceTypes - Representing the storage resource types being accessed (only for Account SAS)\n * @param protocol - Representing the allowed HTTP protocol(s)\n * @param startsOn - Representing the start time for this SAS token\n * @param expiresOn - Representing the expiry time for this SAS token\n * @param ipRange - Representing the range of valid IP addresses for this SAS token\n * @param identifier - Representing the signed identifier (only for Service SAS)\n * @param resource - Representing the storage container or blob (only for Service SAS)\n * @param cacheControl - Representing the cache-control header (only for Blob/File Service SAS)\n * @param contentDisposition - Representing the content-disposition header (only for Blob/File Service SAS)\n * @param contentEncoding - Representing the content-encoding header (only for Blob/File Service SAS)\n * @param contentLanguage - Representing the content-language header (only for Blob/File Service SAS)\n * @param contentType - Representing the content-type header (only for Blob/File Service SAS)\n */\n constructor(\n version: string,\n signature: string,\n permissions?: string,\n services?: string,\n resourceTypes?: string,\n protocol?: SASProtocol,\n startsOn?: Date,\n expiresOn?: Date,\n ipRange?: SasIPRange,\n identifier?: string,\n resource?: string,\n cacheControl?: string,\n contentDisposition?: string,\n contentEncoding?: string,\n contentLanguage?: string,\n contentType?: string,\n ) {\n this.version = version;\n this.services = services;\n this.resourceTypes = resourceTypes;\n this.expiresOn = expiresOn;\n this.permissions = permissions;\n this.protocol = protocol;\n this.startsOn = startsOn;\n this.ipRangeInner = ipRange;\n this.identifier = identifier;\n this.resource = resource;\n this.signature = signature;\n this.cacheControl = cacheControl;\n this.contentDisposition = contentDisposition;\n this.contentEncoding = contentEncoding;\n this.contentLanguage = contentLanguage;\n this.contentType = contentType;\n }\n\n /**\n * Encodes all SAS query parameters into a string that can be appended to a URL.\n *\n */\n public toString(): string {\n const params: string[] = [\n \"sv\",\n \"ss\",\n \"srt\",\n \"spr\",\n \"st\",\n \"se\",\n \"sip\",\n \"si\",\n \"sr\",\n \"sp\",\n \"sig\",\n \"rscc\",\n \"rscd\",\n \"rsce\",\n \"rscl\",\n \"rsct\",\n ];\n const queries: string[] = [];\n\n for (const param of params) {\n switch (param) {\n case \"sv\":\n this.tryAppendQueryParameter(queries, param, this.version);\n break;\n case \"ss\":\n this.tryAppendQueryParameter(queries, param, this.services);\n break;\n case \"srt\":\n this.tryAppendQueryParameter(queries, param, this.resourceTypes);\n break;\n case \"spr\":\n this.tryAppendQueryParameter(queries, param, this.protocol);\n break;\n case \"st\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.startsOn ? truncatedISO8061Date(this.startsOn, false) : undefined,\n );\n break;\n case \"se\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : undefined,\n );\n break;\n case \"sip\":\n this.tryAppendQueryParameter(\n queries,\n param,\n this.ipRange ? ipRangeToString(this.ipRange) : undefined,\n );\n break;\n case \"si\":\n this.tryAppendQueryParameter(queries, param, this.identifier);\n break;\n case \"sr\":\n this.tryAppendQueryParameter(queries, param, this.resource);\n break;\n case \"sp\":\n this.tryAppendQueryParameter(queries, param, this.permissions);\n break;\n case \"sig\":\n this.tryAppendQueryParameter(queries, param, this.signature);\n break;\n case \"rscc\":\n this.tryAppendQueryParameter(queries, param, this.cacheControl);\n break;\n case \"rscd\":\n this.tryAppendQueryParameter(queries, param, this.contentDisposition);\n break;\n case \"rsce\":\n this.tryAppendQueryParameter(queries, param, this.contentEncoding);\n break;\n case \"rscl\":\n this.tryAppendQueryParameter(queries, param, this.contentLanguage);\n break;\n case \"rsct\":\n this.tryAppendQueryParameter(queries, param, this.contentType);\n break;\n }\n }\n return queries.join(\"&\");\n }\n\n /**\n * A private helper method used to filter and append query key/value pairs into an array.\n *\n * @param queries -\n * @param key -\n * @param value -\n */\n private tryAppendQueryParameter(queries: string[], key: string, value?: string): void {\n if (!value) {\n return;\n }\n\n key = encodeURIComponent(key);\n value = encodeURIComponent(value);\n if (key.length > 0 && value.length > 0) {\n queries.push(`${key}=${value}`);\n }\n }\n}\n"]}
@@ -8,6 +8,7 @@ const StorageClient_js_1 = require("./StorageClient.js");
8
8
  * ShareClientInternal is the thin wrapper for Share which contains internal helper methods.
9
9
  */
10
10
  class ShareClientInternal extends StorageClient_js_1.StorageClient {
11
+ context;
11
12
  constructor(url, pipeline) {
12
13
  super(url, pipeline);
13
14
  this.context = this.storageClientContext.share;
@@ -1 +1 @@
1
- {"version":3,"file":"ShareClientInternal.js","sourceRoot":"","sources":["../../src/ShareClientInternal.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAGlC,yDAAmD;AAOnD;;GAEG;AACH,MAAa,mBAAoB,SAAQ,gCAAa;IAGpD,YAAY,GAAW,EAAE,QAAkB;QACzC,KAAK,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC;IACjD,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,UAAsC,EAAE;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;CACF;AAXD,kDAWC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Pipeline } from \"./Pipeline.js\";\nimport { StorageClient } from \"./StorageClient.js\";\nimport type {\n ShareRestoreOptionalParams,\n ShareRestoreResponse,\n} from \"./generated/src/models/index.js\";\nimport type { Share } from \"./generated/src/operationsInterfaces/index.js\";\n\n/**\n * ShareClientInternal is the thin wrapper for Share which contains internal helper methods.\n */\nexport class ShareClientInternal extends StorageClient {\n private context: Share;\n\n constructor(url: string, pipeline: Pipeline) {\n super(url, pipeline);\n this.context = this.storageClientContext.share;\n }\n\n public async restore(options: ShareRestoreOptionalParams = {}): Promise<ShareRestoreResponse> {\n return this.context.restore(options);\n }\n}\n"]}
1
+ {"version":3,"file":"ShareClientInternal.js","sourceRoot":"","sources":["../../src/ShareClientInternal.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAGlC,yDAAmD;AAOnD;;GAEG;AACH,MAAa,mBAAoB,SAAQ,gCAAa;IAC5C,OAAO,CAAQ;IAEvB,YAAY,GAAW,EAAE,QAAkB;QACzC,KAAK,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC;IACjD,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,UAAsC,EAAE;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;CACF;AAXD,kDAWC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Pipeline } from \"./Pipeline.js\";\nimport { StorageClient } from \"./StorageClient.js\";\nimport type {\n ShareRestoreOptionalParams,\n ShareRestoreResponse,\n} from \"./generated/src/models/index.js\";\nimport type { Share } from \"./generated/src/operationsInterfaces/index.js\";\n\n/**\n * ShareClientInternal is the thin wrapper for Share which contains internal helper methods.\n */\nexport class ShareClientInternal extends StorageClient {\n private context: Share;\n\n constructor(url: string, pipeline: Pipeline) {\n super(url, pipeline);\n this.context = this.storageClientContext.share;\n }\n\n public async restore(options: ShareRestoreOptionalParams = {}): Promise<ShareRestoreResponse> {\n return this.context.restore(options);\n }\n}\n"]}
@@ -11,28 +11,6 @@ exports.ShareSASPermissions = void 0;
11
11
  * the order of the permissions is particular and this class guarantees correctness.
12
12
  */
13
13
  class ShareSASPermissions {
14
- constructor() {
15
- /**
16
- * Specifies Read access granted.
17
- */
18
- this.read = false;
19
- /**
20
- * Specifies Create access granted.
21
- */
22
- this.create = false;
23
- /**
24
- * Specifies Write access granted.
25
- */
26
- this.write = false;
27
- /**
28
- * Specifies Delete access granted.
29
- */
30
- this.delete = false;
31
- /**
32
- * Specifies List access granted.
33
- */
34
- this.list = false;
35
- }
36
14
  /**
37
15
  * Creates an {@link ShareSASPermissions} from the specified permissions string. This method will throw an
38
16
  * Error if it encounters a character that does not correspond to a valid permission.
@@ -64,6 +42,26 @@ class ShareSASPermissions {
64
42
  }
65
43
  return shareSASPermissions;
66
44
  }
45
+ /**
46
+ * Specifies Read access granted.
47
+ */
48
+ read = false;
49
+ /**
50
+ * Specifies Create access granted.
51
+ */
52
+ create = false;
53
+ /**
54
+ * Specifies Write access granted.
55
+ */
56
+ write = false;
57
+ /**
58
+ * Specifies Delete access granted.
59
+ */
60
+ delete = false;
61
+ /**
62
+ * Specifies List access granted.
63
+ */
64
+ list = false;
67
65
  /**
68
66
  * Converts the given permissions to a string. Using this method will guarantee the permissions are in an
69
67
  * order accepted by the service.
@@ -1 +1 @@
1
- {"version":3,"file":"ShareSASPermissions.js","sourceRoot":"","sources":["../../src/ShareSASPermissions.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC;;;;;;GAMG;AACH,MAAa,mBAAmB;IAAhC;QAmCE;;WAEG;QACI,SAAI,GAAY,KAAK,CAAC;QAE7B;;WAEG;QACI,WAAM,GAAY,KAAK,CAAC;QAE/B;;WAEG;QACI,UAAK,GAAY,KAAK,CAAC;QAE9B;;WAEG;QACI,WAAM,GAAY,KAAK,CAAC;QAE/B;;WAEG;QACI,SAAI,GAAY,KAAK,CAAC;IA6B/B,CAAC;IAtFC;;;;;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,MAAM,GAAG,IAAI,CAAC;oBAClC,MAAM;gBACR,KAAK,GAAG;oBACN,mBAAmB,CAAC,KAAK,GAAG,IAAI,CAAC;oBACjC,MAAM;gBACR,KAAK,GAAG;oBACN,mBAAmB,CAAC,MAAM,GAAG,IAAI,CAAC;oBAClC,MAAM;gBACR,KAAK,GAAG;oBACN,mBAAmB,CAAC,IAAI,GAAG,IAAI,CAAC;oBAChC,MAAM;gBACR;oBACE,MAAM,IAAI,UAAU,CAAC,sBAAsB,IAAI,EAAE,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;QAED,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IA2BD;;;;;;;OAOG;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,MAAM,EAAE,CAAC;YAChB,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,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,IAAI,EAAE,CAAC;YACd,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,OAAO,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC;CACF;AAvFD,kDAuFC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a share.\n * Setting a value to true means that any SAS which uses these permissions will grant permissions for that operation.\n * Once all the values are set, this should be serialized with toString and set as the permissions field on a\n * {@link FileSASSignatureValues} 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 ShareSASPermissions {\n /**\n * Creates an {@link ShareSASPermissions} 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): ShareSASPermissions {\n const shareSASPermissions = new ShareSASPermissions();\n\n for (const char of permissions) {\n switch (char) {\n case \"r\":\n shareSASPermissions.read = true;\n break;\n case \"c\":\n shareSASPermissions.create = true;\n break;\n case \"w\":\n shareSASPermissions.write = true;\n break;\n case \"d\":\n shareSASPermissions.delete = true;\n break;\n case \"l\":\n shareSASPermissions.list = true;\n break;\n default:\n throw new RangeError(`Invalid permission ${char}`);\n }\n }\n\n return shareSASPermissions;\n }\n\n /**\n * Specifies Read access granted.\n */\n public read: boolean = false;\n\n /**\n * Specifies Create access granted.\n */\n public create: boolean = false;\n\n /**\n * Specifies Write access granted.\n */\n public write: boolean = false;\n\n /**\n * Specifies Delete access granted.\n */\n public delete: boolean = false;\n\n /**\n * Specifies List access granted.\n */\n public list: 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 * The order of the characters should be as specified here to ensure correctness.\n * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas\n *\n */\n public toString(): string {\n const permissions: string[] = [];\n if (this.read) {\n permissions.push(\"r\");\n }\n if (this.create) {\n permissions.push(\"c\");\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 return permissions.join(\"\");\n }\n}\n"]}
1
+ {"version":3,"file":"ShareSASPermissions.js","sourceRoot":"","sources":["../../src/ShareSASPermissions.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC;;;;;;GAMG;AACH,MAAa,mBAAmB;IAC9B;;;;;OAKG;IACI,MAAM,CAAC,KAAK,CAAC,WAAmB;QACrC,MAAM,mBAAmB,GAAG,IAAI,mBAAmB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B,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,OAAO,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC;CACF;AAvFD,kDAuFC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a share.\n * Setting a value to true means that any SAS which uses these permissions will grant permissions for that operation.\n * Once all the values are set, this should be serialized with toString and set as the permissions field on a\n * {@link FileSASSignatureValues} 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 ShareSASPermissions {\n /**\n * Creates an {@link ShareSASPermissions} 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): ShareSASPermissions {\n const shareSASPermissions = new ShareSASPermissions();\n\n for (const char of permissions) {\n switch (char) {\n case \"r\":\n shareSASPermissions.read = true;\n break;\n case \"c\":\n shareSASPermissions.create = true;\n break;\n case \"w\":\n shareSASPermissions.write = true;\n break;\n case \"d\":\n shareSASPermissions.delete = true;\n break;\n case \"l\":\n shareSASPermissions.list = true;\n break;\n default:\n throw new RangeError(`Invalid permission ${char}`);\n }\n }\n\n return shareSASPermissions;\n }\n\n /**\n * Specifies Read access granted.\n */\n public read: boolean = false;\n\n /**\n * Specifies Create access granted.\n */\n public create: boolean = false;\n\n /**\n * Specifies Write access granted.\n */\n public write: boolean = false;\n\n /**\n * Specifies Delete access granted.\n */\n public delete: boolean = false;\n\n /**\n * Specifies List access granted.\n */\n public list: 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 * The order of the characters should be as specified here to ensure correctness.\n * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas\n *\n */\n public toString(): string {\n const permissions: string[] = [];\n if (this.read) {\n permissions.push(\"r\");\n }\n if (this.create) {\n permissions.push(\"c\");\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 return permissions.join(\"\");\n }\n}\n"]}
@@ -3,7 +3,6 @@
3
3
  // Licensed under the MIT License.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.ShareServiceClient = void 0;
6
- const tslib_1 = require("tslib");
7
6
  const Pipeline_js_1 = require("./Pipeline.js");
8
7
  const StorageClient_js_1 = require("./StorageClient.js");
9
8
  const ShareClientInternal_js_1 = require("./ShareClientInternal.js");
@@ -25,6 +24,11 @@ const core_auth_1 = require("@azure/core-auth");
25
24
  * to manipulate file shares.
26
25
  */
27
26
  class ShareServiceClient extends StorageClient_js_1.StorageClient {
27
+ /**
28
+ * serviceContext provided by protocol layer.
29
+ */
30
+ serviceContext;
31
+ shareClientConfig;
28
32
  /**
29
33
  *
30
34
  * Creates an instance of ShareServiceClient from connection string.
@@ -153,7 +157,10 @@ class ShareServiceClient extends StorageClient_js_1.StorageClient {
153
157
  */
154
158
  async getProperties(options = {}) {
155
159
  return tracing_js_1.tracingClient.withSpan("ShareServiceClient-getProperties", options, async (updatedOptions) => {
156
- return (0, utils_common_js_1.assertResponse)(await this.serviceContext.getProperties(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
160
+ return (0, utils_common_js_1.assertResponse)(await this.serviceContext.getProperties({
161
+ ...updatedOptions,
162
+ ...this.shareClientConfig,
163
+ }));
157
164
  });
158
165
  }
159
166
  /**
@@ -167,7 +174,10 @@ class ShareServiceClient extends StorageClient_js_1.StorageClient {
167
174
  */
168
175
  async setProperties(properties, options = {}) {
169
176
  return tracing_js_1.tracingClient.withSpan("ShareServiceClient-setProperties", options, async (updatedOptions) => {
170
- return (0, utils_common_js_1.assertResponse)(await this.serviceContext.setProperties(properties, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
177
+ return (0, utils_common_js_1.assertResponse)(await this.serviceContext.setProperties(properties, {
178
+ ...updatedOptions,
179
+ ...this.shareClientConfig,
180
+ }));
171
181
  });
172
182
  }
173
183
  /**
@@ -182,49 +192,32 @@ class ShareServiceClient extends StorageClient_js_1.StorageClient {
182
192
  * items. The marker value is opaque to the client.
183
193
  * @param options - Options to list shares operation.
184
194
  */
185
- listSegments(marker_1) {
186
- return tslib_1.__asyncGenerator(this, arguments, function* listSegments_1(marker, options = {}) {
187
- if (options.prefix === "") {
188
- options.prefix = undefined;
189
- }
190
- let listSharesSegmentResponse;
191
- do {
192
- listSharesSegmentResponse = yield tslib_1.__await(this.listSharesSegment(marker, options));
193
- marker = listSharesSegmentResponse.continuationToken;
194
- yield yield tslib_1.__await(yield tslib_1.__await(listSharesSegmentResponse));
195
- } while (marker);
196
- });
195
+ async *listSegments(marker, options = {}) {
196
+ if (options.prefix === "") {
197
+ options.prefix = undefined;
198
+ }
199
+ let listSharesSegmentResponse;
200
+ do {
201
+ listSharesSegmentResponse = await this.listSharesSegment(marker, options);
202
+ marker = listSharesSegmentResponse.continuationToken;
203
+ yield await listSharesSegmentResponse;
204
+ } while (marker);
197
205
  }
198
206
  /**
199
207
  * Returns an AsyncIterableIterator for share items
200
208
  *
201
209
  * @param options - Options to list shares operation.
202
210
  */
203
- listItems() {
204
- return tslib_1.__asyncGenerator(this, arguments, function* listItems_1(options = {}) {
205
- var _a, e_1, _b, _c;
206
- if (options.prefix === "") {
207
- options.prefix = undefined;
208
- }
209
- let marker;
210
- try {
211
- for (var _d = true, _e = tslib_1.__asyncValues(this.listSegments(marker, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
212
- _c = _f.value;
213
- _d = false;
214
- const segment = _c;
215
- if (segment.shareItems) {
216
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(segment.shareItems)));
217
- }
218
- }
219
- }
220
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
221
- finally {
222
- try {
223
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
224
- }
225
- finally { if (e_1) throw e_1.error; }
211
+ async *listItems(options = {}) {
212
+ if (options.prefix === "") {
213
+ options.prefix = undefined;
214
+ }
215
+ let marker;
216
+ for await (const segment of this.listSegments(marker, options)) {
217
+ if (segment.shareItems) {
218
+ yield* segment.shareItems;
226
219
  }
227
- });
220
+ }
228
221
  }
229
222
  /**
230
223
  * Returns an async iterable iterator to list all the shares
@@ -349,7 +342,10 @@ class ShareServiceClient extends StorageClient_js_1.StorageClient {
349
342
  if (options.includeDeleted) {
350
343
  include.push("deleted");
351
344
  }
352
- const updatedOptions = Object.assign(Object.assign({}, options), (include.length > 0 ? { include: include } : {}));
345
+ const updatedOptions = {
346
+ ...options,
347
+ ...(include.length > 0 ? { include: include } : {}),
348
+ };
353
349
  // AsyncIterableIterator to iterate over queues
354
350
  const iter = this.listItems(updatedOptions);
355
351
  return {
@@ -369,7 +365,10 @@ class ShareServiceClient extends StorageClient_js_1.StorageClient {
369
365
  * Return an AsyncIterableIterator that works a page at a time
370
366
  */
371
367
  byPage: (settings = {}) => {
372
- return this.listSegments((0, utils_common_js_1.removeEmptyString)(settings.continuationToken), Object.assign({ maxResults: settings.maxPageSize }, updatedOptions));
368
+ return this.listSegments((0, utils_common_js_1.removeEmptyString)(settings.continuationToken), {
369
+ maxResults: settings.maxPageSize,
370
+ ...updatedOptions,
371
+ });
373
372
  },
374
373
  };
375
374
  }
@@ -391,7 +390,11 @@ class ShareServiceClient extends StorageClient_js_1.StorageClient {
391
390
  options.prefix = undefined;
392
391
  }
393
392
  return tracing_js_1.tracingClient.withSpan("ShareServiceClient-listSharesSegment", options, async (updatedOptions) => {
394
- const res = (0, utils_common_js_1.assertResponse)(await this.serviceContext.listSharesSegment(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { marker })));
393
+ const res = (0, utils_common_js_1.assertResponse)(await this.serviceContext.listSharesSegment({
394
+ ...updatedOptions,
395
+ ...this.shareClientConfig,
396
+ marker,
397
+ }));
395
398
  // parse protocols
396
399
  if (res.shareItems) {
397
400
  for (let i = 0; i < res.shareItems.length; i++) {
@@ -415,7 +418,12 @@ class ShareServiceClient extends StorageClient_js_1.StorageClient {
415
418
  async undeleteShare(deletedShareName, deletedShareVersion, options = {}) {
416
419
  return tracing_js_1.tracingClient.withSpan("ShareServiceClient-undeleteShare", options, async (updatedOptions) => {
417
420
  const shareClient = this.getShareClient(deletedShareName);
418
- await new ShareClientInternal_js_1.ShareClientInternal(shareClient.url, this.pipeline).restore(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { deletedShareName: deletedShareName, deletedShareVersion: deletedShareVersion }));
421
+ await new ShareClientInternal_js_1.ShareClientInternal(shareClient.url, this.pipeline).restore({
422
+ ...updatedOptions,
423
+ ...this.shareClientConfig,
424
+ deletedShareName: deletedShareName,
425
+ deletedShareVersion: deletedShareVersion,
426
+ });
419
427
  return shareClient;
420
428
  });
421
429
  }
@@ -441,9 +449,13 @@ class ShareServiceClient extends StorageClient_js_1.StorageClient {
441
449
  const now = new Date();
442
450
  expiresOn = new Date(now.getTime() + 3600 * 1000);
443
451
  }
444
- const sas = (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParameters)(Object.assign({ permissions,
452
+ const sas = (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParameters)({
453
+ permissions,
445
454
  expiresOn,
446
- resourceTypes, services: AccountSASServices_js_1.AccountSASServices.parse("f").toString() }, options), this.credential).toString();
455
+ resourceTypes,
456
+ services: AccountSASServices_js_1.AccountSASServices.parse("f").toString(),
457
+ ...options,
458
+ }, this.credential).toString();
447
459
  return (0, utils_common_js_2.appendToURLQuery)(this.url, sas);
448
460
  }
449
461
  /**
@@ -470,9 +482,13 @@ class ShareServiceClient extends StorageClient_js_1.StorageClient {
470
482
  const now = new Date();
471
483
  expiresOn = new Date(now.getTime() + 3600 * 1000);
472
484
  }
473
- return (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParametersInternal)(Object.assign({ permissions,
485
+ return (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParametersInternal)({
486
+ permissions,
474
487
  expiresOn,
475
- resourceTypes, services: AccountSASServices_js_1.AccountSASServices.parse("f").toString() }, options), this.credential).stringToSign;
488
+ resourceTypes,
489
+ services: AccountSASServices_js_1.AccountSASServices.parse("f").toString(),
490
+ ...options,
491
+ }, this.credential).stringToSign;
476
492
  }
477
493
  }
478
494
  exports.ShareServiceClient = ShareServiceClient;
@@ -1 +1 @@
1
- {"version":3,"file":"ShareServiceClient.js","sourceRoot":"","sources":["../../src/ShareServiceClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAkBlC,+CAA4D;AAE5D,yDAAmD;AACnD,qEAA+D;AAE/D,6CAA2C;AAE3C,6DAKiC;AACjC,0DAAmD;AACnD,0DAAmE;AACnE,0DAA4D;AAE5D,gDAA8C;AAC9C,mDAAmD;AAEnD,2CAA+C;AAC/C,yEAAmE;AACnE,iFAGwC;AACxC,mEAA6D;AAG7D,6DAA2D;AAE3D,gDAAqD;AAuKrD;;;GAGG;AACH,MAAa,kBAAmB,SAAQ,gCAAa;IAQnD;;;;;;;;;;;;OAYG;IACI,MAAM,CAAC,oBAAoB,CAChC,gBAAwB;IACxB,2FAA2F;IAC3F,iEAAiE;IACjE,OAA4B;QAE5B,MAAM,cAAc,GAAG,IAAA,8CAA4B,EAAC,gBAAgB,CAAC,CAAC;QACtE,IAAI,cAAc,CAAC,IAAI,KAAK,mBAAmB,EAAE,CAAC;YAChD,IAAI,sBAAU,EAAE,CAAC;gBACf,MAAM,mBAAmB,GAAG,IAAI,2CAA0B,CACxD,cAAc,CAAC,WAAY,EAC3B,cAAc,CAAC,UAAU,CAC1B,CAAC;gBACF,MAAM,QAAQ,GAAG,IAAA,yBAAW,EAAC,mBAAmB,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;IACI,uBAAuB,CAC5B,SAAgB,EAChB,cAAqC,gDAAqB,CAAC,KAAK,CAAC,GAAG,CAAC,EACrE,gBAAwB,KAAK;IAC7B,8DAA8D;IAC9D,UAA+C,EAAE;QAEjD,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,YAAY,2CAA0B,CAAC,EAAE,CAAC;YAC7D,MAAM,UAAU,CACd,+FAA+F,CAChG,CAAC;QACJ,CAAC;QAED,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,SAAS,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;QACpD,CAAC;QAED,OAAO,IAAA,wEAAyC,kBAE5C,WAAW;YACX,SAAS;YACT,aAAa,EACb,QAAQ,EAAE,0CAAkB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,IAC/C,OAAO,GAEZ,IAAI,CAAC,UAAU,CAChB,CAAC,YAAY,CAAC;IACjB,CAAC;CACF;AA5mBD,gDA4mBC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type {\n FileServiceProperties,\n ListSharesIncludeType,\n ShareCreateResponse,\n ShareDeleteResponse,\n ServiceGetPropertiesResponse,\n ServiceSetPropertiesResponse,\n ServiceListSharesSegmentHeaders,\n ListSharesResponseModel,\n SharePropertiesInternal,\n ServiceSetPropertiesHeaders,\n ServiceGetPropertiesHeaders,\n} from \"./generatedModels.js\";\nimport type { Service } from \"./generated/src/operationsInterfaces/index.js\";\nimport type { Pipeline } from \"./Pipeline.js\";\nimport { isPipelineLike, newPipeline } from \"./Pipeline.js\";\nimport type { CommonOptions } from \"./StorageClient.js\";\nimport { StorageClient } from \"./StorageClient.js\";\nimport { ShareClientInternal } from \"./ShareClientInternal.js\";\nimport type { ShareCreateOptions, ShareDeleteMethodOptions } from \"./Clients.js\";\nimport { ShareClient } from \"./Clients.js\";\nimport type { WithResponse } from \"./utils/utils.common.js\";\nimport {\n appendToURLPath,\n extractConnectionStringParts,\n assertResponse,\n removeEmptyString,\n} from \"./utils/utils.common.js\";\nimport { Credential } from \"@azure/storage-common\";\nimport { StorageSharedKeyCredential } from \"@azure/storage-common\";\nimport { AnonymousCredential } from \"@azure/storage-common\";\nimport type { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { isNodeLike } from \"@azure/core-util\";\nimport { tracingClient } from \"./utils/tracing.js\";\nimport type { ShareClientConfig, ShareClientOptions, ShareProtocols } from \"./models.js\";\nimport { toShareProtocols } from \"./models.js\";\nimport { AccountSASPermissions } from \"./AccountSASPermissions.js\";\nimport {\n generateAccountSASQueryParameters,\n generateAccountSASQueryParametersInternal,\n} from \"./AccountSASSignatureValues.js\";\nimport { AccountSASServices } from \"./AccountSASServices.js\";\nimport type { SASProtocol } from \"./SASQueryParameters.js\";\nimport type { SasIPRange } from \"./SasIPRange.js\";\nimport { appendToURLQuery } from \"./utils/utils.common.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\n\n/**\n * Options to configure Share - List Shares Segment operations.\n *\n * See:\n * - {@link ShareServiceClient.listSegments}\n * - {@link ShareServiceClient.listItems}\n * - {@link ShareServiceClient.listSharesSegment}\n */\ninterface ServiceListSharesSegmentOptions 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 * Filters the results to return only entries whose\n * name begins with the specified prefix.\n */\n prefix?: string;\n /**\n * Specifies the maximum number of entries to\n * return. If the request does not specify maxResults, or specifies a value\n * greater than 5,000, the server will return up to 5,000 items.\n */\n maxResults?: number;\n\n /**\n * Include this parameter to\n * specify one or more datasets to include in the response.\n */\n include?: ListSharesIncludeType[];\n}\n\n/**\n * Options to configure the {@link ShareServiceClient.listShares} operation.\n */\nexport interface ServiceListSharesOptions 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 * Filters the results to return only entries whose\n * name begins with the specified prefix.\n */\n prefix?: string;\n\n /**\n * Specifies that share snapshots should be included in the enumeration. Share Snapshots are listed from oldest to newest in the response.\n */\n includeMetadata?: boolean;\n\n /**\n * Specifies that share snapshot should be returned in the response.\n */\n includeSnapshots?: boolean;\n\n /**\n * Specifies that share soft deleted should be returned in the response.\n */\n includeDeleted?: boolean;\n}\n\n/**\n * Options to configure the {@link ShareServiceClient.getProperties} operation.\n */\nexport interface ServiceGetPropertiesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure the {@link ShareServiceClient.setProperties} operation.\n */\nexport interface ServiceSetPropertiesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure the {@link ShareServiceClient.undelete} operation.\n */\nexport interface ServiceUndeleteShareOptions 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 * Properties of a share.\n */\nexport type ShareProperties = SharePropertiesInternal & {\n /**\n * The protocols that have been enabled on the share.\n */\n protocols?: ShareProtocols;\n};\n\n/**\n * A listed Azure Storage share item.\n */\nexport interface ShareItem {\n name: string;\n snapshot?: string;\n deleted?: boolean;\n version?: string;\n properties: ShareProperties;\n metadata?: { [propertyName: string]: string };\n}\n\n/**\n * An enumeration of shares.\n */\nexport interface ListSharesResponse {\n serviceEndpoint: string;\n prefix?: string;\n marker?: string;\n maxResults?: number;\n shareItems?: ShareItem[];\n continuationToken: string;\n}\n\n/**\n * Contains response data for the {@link ShareServiceClient.listShares} operation.\n */\nexport type ServiceListSharesSegmentResponse = WithResponse<\n ListSharesResponse & ServiceListSharesSegmentHeaders,\n ServiceListSharesSegmentHeaders,\n ListSharesResponseModel\n>;\n\n/**\n * Options to configure {@link ShareServiceClient.generateAccountSasUrl} operation.\n */\nexport interface ServiceGenerateAccountSasUrlOptions {\n /**\n * The version of the service this SAS will target. If not specified, it will default to the version targeted by the\n * library.\n */\n version?: string;\n\n /**\n * Optional. SAS protocols allowed.\n */\n protocol?: SASProtocol;\n\n /**\n * Optional. When the SAS will take effect.\n */\n startsOn?: Date;\n /**\n * Optional. IP range allowed.\n */\n ipRange?: SasIPRange;\n}\n\n/**\n * A ShareServiceClient represents a URL to the Azure Storage File service allowing you\n * to manipulate file shares.\n */\nexport class ShareServiceClient extends StorageClient {\n /**\n * serviceContext provided by protocol layer.\n */\n private serviceContext: Service;\n\n private shareClientConfig?: ShareClientConfig;\n\n /**\n *\n * Creates an instance of ShareServiceClient from connection string.\n *\n * @param connectionString - Account connection string or a SAS connection string of an Azure storage account.\n * [ Note - Account connection string can only be used in NODE.JS runtime. ]\n * Account connection string example -\n * `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`\n * SAS connection string example -\n * `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString`\n * @param options - Options to configure the HTTP pipeline.\n * @returns A new ShareServiceClient from the given connection string.\n */\n public static fromConnectionString(\n connectionString: string,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: ShareClientOptions,\n ): ShareServiceClient {\n const extractedCreds = extractConnectionStringParts(connectionString);\n if (extractedCreds.kind === \"AccountConnString\") {\n if (isNodeLike) {\n const sharedKeyCredential = new StorageSharedKeyCredential(\n extractedCreds.accountName!,\n extractedCreds.accountKey,\n );\n const pipeline = newPipeline(sharedKeyCredential, options);\n return new ShareServiceClient(extractedCreds.url, pipeline, 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 pipeline = newPipeline(new AnonymousCredential(), options);\n return new ShareServiceClient(\n extractedCreds.url + \"?\" + extractedCreds.accountSas,\n pipeline,\n options,\n );\n } else {\n throw new Error(\n \"Connection string must be either an Account connection string or a SAS connection string\",\n );\n }\n }\n\n /**\n * Creates an instance of ShareServiceClient.\n *\n * @param url - A URL string pointing to Azure Storage file service, such as\n * \"https://myaccount.file.core.windows.net\". You can Append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.file.core.windows.net?sasString\".\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential, or TokenCredential,\n * If not specified, AnonymousCredential is used.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n\n constructor(\n url: string,\n credential?: Credential | 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?: ShareClientOptions,\n );\n /**\n * Creates an instance of ShareServiceClient.\n *\n * @param url - A URL string pointing to Azure Storage file service, such as\n * \"https://myaccount.file.core.windows.net\". You can Append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.file.core.windows.net?sasString\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n * @param options - Optional. 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 constructor(url: string, pipeline: Pipeline, options?: ShareClientConfig);\n constructor(\n url: string,\n credentialOrPipeline?: Credential | TokenCredential | Pipeline,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: ShareClientOptions,\n ) {\n let pipeline: Pipeline;\n if (isPipelineLike(credentialOrPipeline)) {\n pipeline = credentialOrPipeline;\n } else if (\n credentialOrPipeline instanceof Credential ||\n isTokenCredential(credentialOrPipeline)\n ) {\n pipeline = newPipeline(credentialOrPipeline, options);\n } else {\n // The second parameter is undefined. Use anonymous credential.\n pipeline = newPipeline(new AnonymousCredential(), options);\n }\n\n super(url, pipeline);\n this.shareClientConfig = options;\n this.serviceContext = this.storageClientContext.service;\n }\n\n /**\n * Creates a ShareClient object.\n *\n * @param shareName - Name of a share.\n * @returns The ShareClient object for the given share name.\n *\n * Example usage:\n *\n * ```ts snippet:ReadmeSampleCreateShareClient\n * import { StorageSharedKeyCredential, ShareServiceClient } from \"@azure/storage-file-share\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n *\n * const credential = new StorageSharedKeyCredential(account, accountKey);\n * const serviceClient = new ShareServiceClient(\n * `https://${account}.file.core.windows.net`,\n * credential,\n * );\n *\n * const shareName = \"<share name>\";\n * const shareClient = serviceClient.getShareClient(shareName);\n * await shareClient.create();\n * ```\n */\n public getShareClient(shareName: string): ShareClient {\n return new ShareClient(\n appendToURLPath(this.url, shareName),\n this.pipeline,\n this.shareClientConfig,\n );\n }\n\n /**\n * Creates a Share.\n *\n * @param shareName -\n * @param options -\n * @returns Share creation response and the corresponding share client.\n */\n public async createShare(\n shareName: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: ShareCreateOptions = {},\n ): Promise<{ shareCreateResponse: ShareCreateResponse; shareClient: ShareClient }> {\n return tracingClient.withSpan(\n \"ShareServiceClient-createShare\",\n options,\n async (updatedOptions) => {\n const shareClient = this.getShareClient(shareName);\n const shareCreateResponse = await shareClient.create(updatedOptions);\n return {\n shareCreateResponse,\n shareClient,\n };\n },\n );\n }\n\n /**\n * Deletes a Share.\n *\n * @param shareName -\n * @param options -\n * @returns Share deletion response and the corresponding share client.\n */\n public async deleteShare(\n shareName: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: ShareDeleteMethodOptions = {},\n ): Promise<ShareDeleteResponse> {\n return tracingClient.withSpan(\n \"ShareServiceClient-deleteShare\",\n options,\n async (updatedOptions) => {\n const shareClient = this.getShareClient(shareName);\n return shareClient.delete(updatedOptions);\n },\n );\n }\n\n /**\n * Gets the properties of a storage account’s file service, including properties\n * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.\n * @see https://learn.microsoft.com/rest/api/storageservices/get-file-service-properties\n *\n * @param options - Options to Get Properties operation.\n * @returns Response data for the Get Properties operation.\n */\n public async getProperties(\n options: ServiceGetPropertiesOptions = {},\n ): Promise<ServiceGetPropertiesResponse> {\n return tracingClient.withSpan(\n \"ShareServiceClient-getProperties\",\n options,\n async (updatedOptions) => {\n return assertResponse<\n ServiceGetPropertiesHeaders & FileServiceProperties,\n ServiceGetPropertiesHeaders,\n FileServiceProperties\n >(\n await this.serviceContext.getProperties({\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n },\n );\n }\n\n /**\n * Sets properties for a storage account’s file service endpoint, including properties\n * for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings.\n * @see https://learn.microsoft.com/rest/api/storageservices/set-file-service-properties\n *\n * @param properties -\n * @param options - Options to Set Properties operation.\n * @returns Response data for the Set Properties operation.\n */\n public async setProperties(\n properties: FileServiceProperties,\n options: ServiceSetPropertiesOptions = {},\n ): Promise<ServiceSetPropertiesResponse> {\n return tracingClient.withSpan(\n \"ShareServiceClient-setProperties\",\n options,\n async (updatedOptions) => {\n return assertResponse<ServiceSetPropertiesHeaders, ServiceSetPropertiesHeaders>(\n await this.serviceContext.setProperties(properties, {\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n },\n );\n }\n\n /**\n * Returns an AsyncIterableIterator for {@link ServiceListSharesSegmentResponse} objects\n *\n * @param marker - A string value that identifies the portion of\n * the list of shares to be returned with the next listing operation. The\n * operation returns the ContinuationToken value within the response body if the\n * listing operation did not return all shares remaining to be listed\n * with the current page. The ContinuationToken value can be used as the value for\n * the marker parameter in a subsequent call to request the next page of list\n * items. The marker value is opaque to the client.\n * @param options - Options to list shares operation.\n */\n private async *listSegments(\n marker?: string,\n options: ServiceListSharesSegmentOptions = {},\n ): AsyncIterableIterator<ServiceListSharesSegmentResponse> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n let listSharesSegmentResponse;\n do {\n listSharesSegmentResponse = await this.listSharesSegment(marker, options);\n marker = listSharesSegmentResponse.continuationToken;\n yield await listSharesSegmentResponse;\n } while (marker);\n }\n\n /**\n * Returns an AsyncIterableIterator for share items\n *\n * @param options - Options to list shares operation.\n */\n private async *listItems(\n options: ServiceListSharesSegmentOptions = {},\n ): AsyncIterableIterator<ShareItem> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n let marker: string | undefined;\n for await (const segment of this.listSegments(marker, options)) {\n if (segment.shareItems) {\n yield* segment.shareItems;\n }\n }\n }\n\n /**\n * Returns an async iterable iterator to list all the shares\n * under the specified account.\n *\n * .byPage() returns an async iterable iterator to list the shares in pages.\n *\n * Example using `for await` syntax:\n *\n * ```ts snippet:ReadmeSampleListShares\n * import { StorageSharedKeyCredential, ShareServiceClient } from \"@azure/storage-file-share\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n *\n * const credential = new StorageSharedKeyCredential(account, accountKey);\n * const serviceClient = new ShareServiceClient(\n * `https://${account}.file.core.windows.net`,\n * credential,\n * );\n *\n * let i = 1;\n * for await (const share of serviceClient.listShares()) {\n * console.log(`Share${i++}: ${share.name}`);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```ts snippet:ReadmeSampleListShares_Iterator\n * import { StorageSharedKeyCredential, ShareServiceClient } from \"@azure/storage-file-share\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n *\n * const credential = new StorageSharedKeyCredential(account, accountKey);\n * const serviceClient = new ShareServiceClient(\n * `https://${account}.file.core.windows.net`,\n * credential,\n * );\n *\n * const shareIter = serviceClient.listShares();\n * let i = 1;\n * let { value, done } = await shareIter.next();\n * while (!done) {\n * console.log(`Share ${i++}: ${value.name}`);\n * ({ value, done } = await shareIter.next());\n * }\n * ```\n *\n * Example using `byPage()`:\n *\n * ```ts snippet:ReadmeSampleListShares_ByPage\n * import { StorageSharedKeyCredential, ShareServiceClient } from \"@azure/storage-file-share\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n *\n * const credential = new StorageSharedKeyCredential(account, accountKey);\n * const serviceClient = new ShareServiceClient(\n * `https://${account}.file.core.windows.net`,\n * credential,\n * );\n *\n * let i = 1;\n * for await (const response of serviceClient.listShares().byPage({ maxPageSize: 20 })) {\n * console.log(`Page ${i++}:`);\n * for (const share of response.shareItems || []) {\n * console.log(`\\tShare: ${share.name}`);\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```ts snippet:ReadmeSampleListShares_Continuation\n * import { StorageSharedKeyCredential, ShareServiceClient } from \"@azure/storage-file-share\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n *\n * const credential = new StorageSharedKeyCredential(account, accountKey);\n * const serviceClient = new ShareServiceClient(\n * `https://${account}.file.core.windows.net`,\n * credential,\n * );\n *\n * let iterator = serviceClient.listShares().byPage({ maxPageSize: 2 });\n * let response = (await iterator.next()).value;\n *\n * for await (const share of response.shareItems || []) {\n * console.log(`\\tShare: ${share.name}`);\n * }\n *\n * // Gets next marker\n * let marker = response.continuationToken;\n *\n * // Passing next marker as continuationToken\n * iterator = serviceClient.listShares().byPage({ continuationToken: marker, maxPageSize: 10 });\n * response = (await iterator.next()).value;\n *\n * for await (const share of response.shareItems || []) {\n * console.log(`\\tShare: ${share.name}`);\n * }\n * ```\n *\n * @param options - Options to list shares operation.\n *\n * An asyncIterableIterator that supports paging.\n */\n public listShares(\n options: ServiceListSharesOptions = {},\n ): PagedAsyncIterableIterator<ShareItem, ServiceListSharesSegmentResponse> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n const include: ListSharesIncludeType[] = [];\n if (options.includeMetadata) {\n include.push(\"metadata\");\n }\n if (options.includeSnapshots) {\n include.push(\"snapshots\");\n }\n if (options.includeDeleted) {\n include.push(\"deleted\");\n }\n\n const updatedOptions: ServiceListSharesSegmentOptions = {\n ...options,\n ...(include.length > 0 ? { include: include } : {}),\n };\n\n // AsyncIterableIterator to iterate over queues\n const iter = this.listItems(updatedOptions);\n return {\n /**\n * The next method, part of the iteration protocol\n */\n next() {\n return iter.next();\n },\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator]() {\n return this;\n },\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings: PageSettings = {}) => {\n return this.listSegments(removeEmptyString(settings.continuationToken), {\n maxResults: settings.maxPageSize,\n ...updatedOptions,\n });\n },\n };\n }\n\n /**\n * Gets the properties of a storage account's File service, including properties for Storage\n * Analytics metrics and CORS (Cross-Origin Resource Sharing) rules.\n *\n * @param marker - A string value that identifies the portion of\n * the list to be returned with the next list operation. The operation\n * returns a marker value within the response body if the list returned was\n * not complete. The marker value may then be used in a subsequent call to\n * request the next set of list items. The marker value is opaque to the\n * client.\n * @param options - Options to List Shares Segment operation.\n * @returns Response data for the List Shares Segment operation.\n */\n private async listSharesSegment(\n marker?: string,\n options: ServiceListSharesSegmentOptions = {},\n ): Promise<ServiceListSharesSegmentResponse> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n return tracingClient.withSpan(\n \"ShareServiceClient-listSharesSegment\",\n options,\n async (updatedOptions) => {\n const res = assertResponse<\n ServiceListSharesSegmentHeaders & ListSharesResponseModel,\n ServiceListSharesSegmentHeaders,\n ListSharesResponseModel\n >(\n await this.serviceContext.listSharesSegment({\n ...updatedOptions,\n ...this.shareClientConfig,\n marker,\n }),\n );\n\n // parse protocols\n if (res.shareItems) {\n for (let i = 0; i < res.shareItems.length; i++) {\n const protocolsStr = res.shareItems[i].properties.enabledProtocols;\n (res.shareItems[i].properties as any).protocols = toShareProtocols(protocolsStr);\n }\n }\n\n return res;\n },\n );\n }\n\n /**\n * Restores a previously deleted share.\n * This API is only functional if Share Soft Delete is enabled\n * for the storage account associated with the share.\n *\n * @param deletedShareName - The name of the previously deleted share.\n * @param deletedShareVersion - The version of the previously deleted share.\n * @param options - Options to Share undelete operation.\n * @returns Restored share.\n */\n public async undeleteShare(\n deletedShareName: string,\n deletedShareVersion: string,\n options: ServiceUndeleteShareOptions = {},\n ): Promise<ShareClient> {\n return tracingClient.withSpan(\n \"ShareServiceClient-undeleteShare\",\n options,\n async (updatedOptions) => {\n const shareClient = this.getShareClient(deletedShareName);\n await new ShareClientInternal(shareClient.url, this.pipeline).restore({\n ...updatedOptions,\n ...this.shareClientConfig,\n deletedShareName: deletedShareName,\n deletedShareVersion: deletedShareVersion,\n });\n return shareClient;\n },\n );\n }\n\n /**\n * Only available for ShareServiceClient constructed with a shared key credential.\n *\n * Generates an account Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas\n *\n * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not specified.\n * @param permissions - Specifies the list of permissions to be associated with the SAS.\n * @param resourceTypes - Specifies the resource types associated with the shared access signature.\n * @param options - Optional parameters.\n * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n public generateAccountSasUrl(\n expiresOn?: Date,\n permissions: AccountSASPermissions = AccountSASPermissions.parse(\"r\"),\n resourceTypes: string = \"sco\",\n options: ServiceGenerateAccountSasUrlOptions = {},\n ): string {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the account SAS when the client is initialized with a shared key credential\",\n );\n }\n\n if (expiresOn === undefined) {\n const now = new Date();\n expiresOn = new Date(now.getTime() + 3600 * 1000);\n }\n\n const sas = generateAccountSASQueryParameters(\n {\n permissions,\n expiresOn,\n resourceTypes,\n services: AccountSASServices.parse(\"f\").toString(),\n ...options,\n },\n this.credential,\n ).toString();\n\n return appendToURLQuery(this.url, sas);\n }\n\n /**\n * Only available for ShareServiceClient constructed with a shared key credential.\n *\n * Generates string to sign for an account Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas\n *\n * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not specified.\n * @param permissions - Specifies the list of permissions to be associated with the SAS.\n * @param resourceTypes - Specifies the resource types associated with the shared access signature.\n * @param options - Optional parameters.\n * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n public generateSasStringToSign(\n expiresOn?: Date,\n permissions: AccountSASPermissions = AccountSASPermissions.parse(\"r\"),\n resourceTypes: string = \"sco\",\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: ServiceGenerateAccountSasUrlOptions = {},\n ): string {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the account SAS when the client is initialized with a shared key credential\",\n );\n }\n\n if (expiresOn === undefined) {\n const now = new Date();\n expiresOn = new Date(now.getTime() + 3600 * 1000);\n }\n\n return generateAccountSASQueryParametersInternal(\n {\n permissions,\n expiresOn,\n resourceTypes,\n services: AccountSASServices.parse(\"f\").toString(),\n ...options,\n },\n this.credential,\n ).stringToSign;\n }\n}\n"]}
1
+ {"version":3,"file":"ShareServiceClient.js","sourceRoot":"","sources":["../../src/ShareServiceClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAkBlC,+CAA4D;AAE5D,yDAAmD;AACnD,qEAA+D;AAE/D,6CAA2C;AAE3C,6DAKi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AW;YACX,SAAS;YACT,aAAa;YACb,QAAQ,EAAE,0CAAkB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;YAClD,GAAG,OAAO;SACX,EACD,IAAI,CAAC,UAAU,CAChB,CAAC,YAAY,CAAC;IACjB,CAAC;CACF;AA5mBD,gDA4mBC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type {\n FileServiceProperties,\n ListSharesIncludeType,\n ShareCreateResponse,\n ShareDeleteResponse,\n ServiceGetPropertiesResponse,\n ServiceSetPropertiesResponse,\n ServiceListSharesSegmentHeaders,\n ListSharesResponseModel,\n SharePropertiesInternal,\n ServiceSetPropertiesHeaders,\n ServiceGetPropertiesHeaders,\n} from \"./generatedModels.js\";\nimport type { Service } from \"./generated/src/operationsInterfaces/index.js\";\nimport type { Pipeline } from \"./Pipeline.js\";\nimport { isPipelineLike, newPipeline } from \"./Pipeline.js\";\nimport type { CommonOptions } from \"./StorageClient.js\";\nimport { StorageClient } from \"./StorageClient.js\";\nimport { ShareClientInternal } from \"./ShareClientInternal.js\";\nimport type { ShareCreateOptions, ShareDeleteMethodOptions } from \"./Clients.js\";\nimport { ShareClient } from \"./Clients.js\";\nimport type { WithResponse } from \"./utils/utils.common.js\";\nimport {\n appendToURLPath,\n extractConnectionStringParts,\n assertResponse,\n removeEmptyString,\n} from \"./utils/utils.common.js\";\nimport { Credential } from \"@azure/storage-common\";\nimport { StorageSharedKeyCredential } from \"@azure/storage-common\";\nimport { AnonymousCredential } from \"@azure/storage-common\";\nimport type { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { isNodeLike } from \"@azure/core-util\";\nimport { tracingClient } from \"./utils/tracing.js\";\nimport type { ShareClientConfig, ShareClientOptions, ShareProtocols } from \"./models.js\";\nimport { toShareProtocols } from \"./models.js\";\nimport { AccountSASPermissions } from \"./AccountSASPermissions.js\";\nimport {\n generateAccountSASQueryParameters,\n generateAccountSASQueryParametersInternal,\n} from \"./AccountSASSignatureValues.js\";\nimport { AccountSASServices } from \"./AccountSASServices.js\";\nimport type { SASProtocol } from \"./SASQueryParameters.js\";\nimport type { SasIPRange } from \"./SasIPRange.js\";\nimport { appendToURLQuery } from \"./utils/utils.common.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\n\n/**\n * Options to configure Share - List Shares Segment operations.\n *\n * See:\n * - {@link ShareServiceClient.listSegments}\n * - {@link ShareServiceClient.listItems}\n * - {@link ShareServiceClient.listSharesSegment}\n */\ninterface ServiceListSharesSegmentOptions 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 * Filters the results to return only entries whose\n * name begins with the specified prefix.\n */\n prefix?: string;\n /**\n * Specifies the maximum number of entries to\n * return. If the request does not specify maxResults, or specifies a value\n * greater than 5,000, the server will return up to 5,000 items.\n */\n maxResults?: number;\n\n /**\n * Include this parameter to\n * specify one or more datasets to include in the response.\n */\n include?: ListSharesIncludeType[];\n}\n\n/**\n * Options to configure the {@link ShareServiceClient.listShares} operation.\n */\nexport interface ServiceListSharesOptions 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 * Filters the results to return only entries whose\n * name begins with the specified prefix.\n */\n prefix?: string;\n\n /**\n * Specifies that share snapshots should be included in the enumeration. Share Snapshots are listed from oldest to newest in the response.\n */\n includeMetadata?: boolean;\n\n /**\n * Specifies that share snapshot should be returned in the response.\n */\n includeSnapshots?: boolean;\n\n /**\n * Specifies that share soft deleted should be returned in the response.\n */\n includeDeleted?: boolean;\n}\n\n/**\n * Options to configure the {@link ShareServiceClient.getProperties} operation.\n */\nexport interface ServiceGetPropertiesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure the {@link ShareServiceClient.setProperties} operation.\n */\nexport interface ServiceSetPropertiesOptions extends CommonOptions {\n /**\n * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.\n * For example, use the &commat;azure/abort-controller to create an `AbortSignal`.\n */\n abortSignal?: AbortSignalLike;\n}\n\n/**\n * Options to configure the {@link ShareServiceClient.undelete} operation.\n */\nexport interface ServiceUndeleteShareOptions 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 * Properties of a share.\n */\nexport type ShareProperties = SharePropertiesInternal & {\n /**\n * The protocols that have been enabled on the share.\n */\n protocols?: ShareProtocols;\n};\n\n/**\n * A listed Azure Storage share item.\n */\nexport interface ShareItem {\n name: string;\n snapshot?: string;\n deleted?: boolean;\n version?: string;\n properties: ShareProperties;\n metadata?: { [propertyName: string]: string };\n}\n\n/**\n * An enumeration of shares.\n */\nexport interface ListSharesResponse {\n serviceEndpoint: string;\n prefix?: string;\n marker?: string;\n maxResults?: number;\n shareItems?: ShareItem[];\n continuationToken: string;\n}\n\n/**\n * Contains response data for the {@link ShareServiceClient.listShares} operation.\n */\nexport type ServiceListSharesSegmentResponse = WithResponse<\n ListSharesResponse & ServiceListSharesSegmentHeaders,\n ServiceListSharesSegmentHeaders,\n ListSharesResponseModel\n>;\n\n/**\n * Options to configure {@link ShareServiceClient.generateAccountSasUrl} operation.\n */\nexport interface ServiceGenerateAccountSasUrlOptions {\n /**\n * The version of the service this SAS will target. If not specified, it will default to the version targeted by the\n * library.\n */\n version?: string;\n\n /**\n * Optional. SAS protocols allowed.\n */\n protocol?: SASProtocol;\n\n /**\n * Optional. When the SAS will take effect.\n */\n startsOn?: Date;\n /**\n * Optional. IP range allowed.\n */\n ipRange?: SasIPRange;\n}\n\n/**\n * A ShareServiceClient represents a URL to the Azure Storage File service allowing you\n * to manipulate file shares.\n */\nexport class ShareServiceClient extends StorageClient {\n /**\n * serviceContext provided by protocol layer.\n */\n private serviceContext: Service;\n\n private shareClientConfig?: ShareClientConfig;\n\n /**\n *\n * Creates an instance of ShareServiceClient from connection string.\n *\n * @param connectionString - Account connection string or a SAS connection string of an Azure storage account.\n * [ Note - Account connection string can only be used in NODE.JS runtime. ]\n * Account connection string example -\n * `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`\n * SAS connection string example -\n * `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString`\n * @param options - Options to configure the HTTP pipeline.\n * @returns A new ShareServiceClient from the given connection string.\n */\n public static fromConnectionString(\n connectionString: string,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: ShareClientOptions,\n ): ShareServiceClient {\n const extractedCreds = extractConnectionStringParts(connectionString);\n if (extractedCreds.kind === \"AccountConnString\") {\n if (isNodeLike) {\n const sharedKeyCredential = new StorageSharedKeyCredential(\n extractedCreds.accountName!,\n extractedCreds.accountKey,\n );\n const pipeline = newPipeline(sharedKeyCredential, options);\n return new ShareServiceClient(extractedCreds.url, pipeline, 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 pipeline = newPipeline(new AnonymousCredential(), options);\n return new ShareServiceClient(\n extractedCreds.url + \"?\" + extractedCreds.accountSas,\n pipeline,\n options,\n );\n } else {\n throw new Error(\n \"Connection string must be either an Account connection string or a SAS connection string\",\n );\n }\n }\n\n /**\n * Creates an instance of ShareServiceClient.\n *\n * @param url - A URL string pointing to Azure Storage file service, such as\n * \"https://myaccount.file.core.windows.net\". You can Append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.file.core.windows.net?sasString\".\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential, or TokenCredential,\n * If not specified, AnonymousCredential is used.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n\n constructor(\n url: string,\n credential?: Credential | 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?: ShareClientOptions,\n );\n /**\n * Creates an instance of ShareServiceClient.\n *\n * @param url - A URL string pointing to Azure Storage file service, such as\n * \"https://myaccount.file.core.windows.net\". You can Append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.file.core.windows.net?sasString\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n * @param options - Optional. 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 constructor(url: string, pipeline: Pipeline, options?: ShareClientConfig);\n constructor(\n url: string,\n credentialOrPipeline?: Credential | TokenCredential | Pipeline,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: ShareClientOptions,\n ) {\n let pipeline: Pipeline;\n if (isPipelineLike(credentialOrPipeline)) {\n pipeline = credentialOrPipeline;\n } else if (\n credentialOrPipeline instanceof Credential ||\n isTokenCredential(credentialOrPipeline)\n ) {\n pipeline = newPipeline(credentialOrPipeline, options);\n } else {\n // The second parameter is undefined. Use anonymous credential.\n pipeline = newPipeline(new AnonymousCredential(), options);\n }\n\n super(url, pipeline);\n this.shareClientConfig = options;\n this.serviceContext = this.storageClientContext.service;\n }\n\n /**\n * Creates a ShareClient object.\n *\n * @param shareName - Name of a share.\n * @returns The ShareClient object for the given share name.\n *\n * Example usage:\n *\n * ```ts snippet:ReadmeSampleCreateShareClient\n * import { StorageSharedKeyCredential, ShareServiceClient } from \"@azure/storage-file-share\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n *\n * const credential = new StorageSharedKeyCredential(account, accountKey);\n * const serviceClient = new ShareServiceClient(\n * `https://${account}.file.core.windows.net`,\n * credential,\n * );\n *\n * const shareName = \"<share name>\";\n * const shareClient = serviceClient.getShareClient(shareName);\n * await shareClient.create();\n * ```\n */\n public getShareClient(shareName: string): ShareClient {\n return new ShareClient(\n appendToURLPath(this.url, shareName),\n this.pipeline,\n this.shareClientConfig,\n );\n }\n\n /**\n * Creates a Share.\n *\n * @param shareName -\n * @param options -\n * @returns Share creation response and the corresponding share client.\n */\n public async createShare(\n shareName: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: ShareCreateOptions = {},\n ): Promise<{ shareCreateResponse: ShareCreateResponse; shareClient: ShareClient }> {\n return tracingClient.withSpan(\n \"ShareServiceClient-createShare\",\n options,\n async (updatedOptions) => {\n const shareClient = this.getShareClient(shareName);\n const shareCreateResponse = await shareClient.create(updatedOptions);\n return {\n shareCreateResponse,\n shareClient,\n };\n },\n );\n }\n\n /**\n * Deletes a Share.\n *\n * @param shareName -\n * @param options -\n * @returns Share deletion response and the corresponding share client.\n */\n public async deleteShare(\n shareName: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: ShareDeleteMethodOptions = {},\n ): Promise<ShareDeleteResponse> {\n return tracingClient.withSpan(\n \"ShareServiceClient-deleteShare\",\n options,\n async (updatedOptions) => {\n const shareClient = this.getShareClient(shareName);\n return shareClient.delete(updatedOptions);\n },\n );\n }\n\n /**\n * Gets the properties of a storage account’s file service, including properties\n * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.\n * @see https://learn.microsoft.com/rest/api/storageservices/get-file-service-properties\n *\n * @param options - Options to Get Properties operation.\n * @returns Response data for the Get Properties operation.\n */\n public async getProperties(\n options: ServiceGetPropertiesOptions = {},\n ): Promise<ServiceGetPropertiesResponse> {\n return tracingClient.withSpan(\n \"ShareServiceClient-getProperties\",\n options,\n async (updatedOptions) => {\n return assertResponse<\n ServiceGetPropertiesHeaders & FileServiceProperties,\n ServiceGetPropertiesHeaders,\n FileServiceProperties\n >(\n await this.serviceContext.getProperties({\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n },\n );\n }\n\n /**\n * Sets properties for a storage account’s file service endpoint, including properties\n * for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings.\n * @see https://learn.microsoft.com/rest/api/storageservices/set-file-service-properties\n *\n * @param properties -\n * @param options - Options to Set Properties operation.\n * @returns Response data for the Set Properties operation.\n */\n public async setProperties(\n properties: FileServiceProperties,\n options: ServiceSetPropertiesOptions = {},\n ): Promise<ServiceSetPropertiesResponse> {\n return tracingClient.withSpan(\n \"ShareServiceClient-setProperties\",\n options,\n async (updatedOptions) => {\n return assertResponse<ServiceSetPropertiesHeaders, ServiceSetPropertiesHeaders>(\n await this.serviceContext.setProperties(properties, {\n ...updatedOptions,\n ...this.shareClientConfig,\n }),\n );\n },\n );\n }\n\n /**\n * Returns an AsyncIterableIterator for {@link ServiceListSharesSegmentResponse} objects\n *\n * @param marker - A string value that identifies the portion of\n * the list of shares to be returned with the next listing operation. The\n * operation returns the ContinuationToken value within the response body if the\n * listing operation did not return all shares remaining to be listed\n * with the current page. The ContinuationToken value can be used as the value for\n * the marker parameter in a subsequent call to request the next page of list\n * items. The marker value is opaque to the client.\n * @param options - Options to list shares operation.\n */\n private async *listSegments(\n marker?: string,\n options: ServiceListSharesSegmentOptions = {},\n ): AsyncIterableIterator<ServiceListSharesSegmentResponse> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n let listSharesSegmentResponse;\n do {\n listSharesSegmentResponse = await this.listSharesSegment(marker, options);\n marker = listSharesSegmentResponse.continuationToken;\n yield await listSharesSegmentResponse;\n } while (marker);\n }\n\n /**\n * Returns an AsyncIterableIterator for share items\n *\n * @param options - Options to list shares operation.\n */\n private async *listItems(\n options: ServiceListSharesSegmentOptions = {},\n ): AsyncIterableIterator<ShareItem> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n let marker: string | undefined;\n for await (const segment of this.listSegments(marker, options)) {\n if (segment.shareItems) {\n yield* segment.shareItems;\n }\n }\n }\n\n /**\n * Returns an async iterable iterator to list all the shares\n * under the specified account.\n *\n * .byPage() returns an async iterable iterator to list the shares in pages.\n *\n * Example using `for await` syntax:\n *\n * ```ts snippet:ReadmeSampleListShares\n * import { StorageSharedKeyCredential, ShareServiceClient } from \"@azure/storage-file-share\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n *\n * const credential = new StorageSharedKeyCredential(account, accountKey);\n * const serviceClient = new ShareServiceClient(\n * `https://${account}.file.core.windows.net`,\n * credential,\n * );\n *\n * let i = 1;\n * for await (const share of serviceClient.listShares()) {\n * console.log(`Share${i++}: ${share.name}`);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```ts snippet:ReadmeSampleListShares_Iterator\n * import { StorageSharedKeyCredential, ShareServiceClient } from \"@azure/storage-file-share\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n *\n * const credential = new StorageSharedKeyCredential(account, accountKey);\n * const serviceClient = new ShareServiceClient(\n * `https://${account}.file.core.windows.net`,\n * credential,\n * );\n *\n * const shareIter = serviceClient.listShares();\n * let i = 1;\n * let { value, done } = await shareIter.next();\n * while (!done) {\n * console.log(`Share ${i++}: ${value.name}`);\n * ({ value, done } = await shareIter.next());\n * }\n * ```\n *\n * Example using `byPage()`:\n *\n * ```ts snippet:ReadmeSampleListShares_ByPage\n * import { StorageSharedKeyCredential, ShareServiceClient } from \"@azure/storage-file-share\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n *\n * const credential = new StorageSharedKeyCredential(account, accountKey);\n * const serviceClient = new ShareServiceClient(\n * `https://${account}.file.core.windows.net`,\n * credential,\n * );\n *\n * let i = 1;\n * for await (const response of serviceClient.listShares().byPage({ maxPageSize: 20 })) {\n * console.log(`Page ${i++}:`);\n * for (const share of response.shareItems || []) {\n * console.log(`\\tShare: ${share.name}`);\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```ts snippet:ReadmeSampleListShares_Continuation\n * import { StorageSharedKeyCredential, ShareServiceClient } from \"@azure/storage-file-share\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n *\n * const credential = new StorageSharedKeyCredential(account, accountKey);\n * const serviceClient = new ShareServiceClient(\n * `https://${account}.file.core.windows.net`,\n * credential,\n * );\n *\n * let iterator = serviceClient.listShares().byPage({ maxPageSize: 2 });\n * let response = (await iterator.next()).value;\n *\n * for await (const share of response.shareItems || []) {\n * console.log(`\\tShare: ${share.name}`);\n * }\n *\n * // Gets next marker\n * let marker = response.continuationToken;\n *\n * // Passing next marker as continuationToken\n * iterator = serviceClient.listShares().byPage({ continuationToken: marker, maxPageSize: 10 });\n * response = (await iterator.next()).value;\n *\n * for await (const share of response.shareItems || []) {\n * console.log(`\\tShare: ${share.name}`);\n * }\n * ```\n *\n * @param options - Options to list shares operation.\n *\n * An asyncIterableIterator that supports paging.\n */\n public listShares(\n options: ServiceListSharesOptions = {},\n ): PagedAsyncIterableIterator<ShareItem, ServiceListSharesSegmentResponse> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n\n const include: ListSharesIncludeType[] = [];\n if (options.includeMetadata) {\n include.push(\"metadata\");\n }\n if (options.includeSnapshots) {\n include.push(\"snapshots\");\n }\n if (options.includeDeleted) {\n include.push(\"deleted\");\n }\n\n const updatedOptions: ServiceListSharesSegmentOptions = {\n ...options,\n ...(include.length > 0 ? { include: include } : {}),\n };\n\n // AsyncIterableIterator to iterate over queues\n const iter = this.listItems(updatedOptions);\n return {\n /**\n * The next method, part of the iteration protocol\n */\n next() {\n return iter.next();\n },\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator]() {\n return this;\n },\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings: PageSettings = {}) => {\n return this.listSegments(removeEmptyString(settings.continuationToken), {\n maxResults: settings.maxPageSize,\n ...updatedOptions,\n });\n },\n };\n }\n\n /**\n * Gets the properties of a storage account's File service, including properties for Storage\n * Analytics metrics and CORS (Cross-Origin Resource Sharing) rules.\n *\n * @param marker - A string value that identifies the portion of\n * the list to be returned with the next list operation. The operation\n * returns a marker value within the response body if the list returned was\n * not complete. The marker value may then be used in a subsequent call to\n * request the next set of list items. The marker value is opaque to the\n * client.\n * @param options - Options to List Shares Segment operation.\n * @returns Response data for the List Shares Segment operation.\n */\n private async listSharesSegment(\n marker?: string,\n options: ServiceListSharesSegmentOptions = {},\n ): Promise<ServiceListSharesSegmentResponse> {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n return tracingClient.withSpan(\n \"ShareServiceClient-listSharesSegment\",\n options,\n async (updatedOptions) => {\n const res = assertResponse<\n ServiceListSharesSegmentHeaders & ListSharesResponseModel,\n ServiceListSharesSegmentHeaders,\n ListSharesResponseModel\n >(\n await this.serviceContext.listSharesSegment({\n ...updatedOptions,\n ...this.shareClientConfig,\n marker,\n }),\n );\n\n // parse protocols\n if (res.shareItems) {\n for (let i = 0; i < res.shareItems.length; i++) {\n const protocolsStr = res.shareItems[i].properties.enabledProtocols;\n (res.shareItems[i].properties as any).protocols = toShareProtocols(protocolsStr);\n }\n }\n\n return res;\n },\n );\n }\n\n /**\n * Restores a previously deleted share.\n * This API is only functional if Share Soft Delete is enabled\n * for the storage account associated with the share.\n *\n * @param deletedShareName - The name of the previously deleted share.\n * @param deletedShareVersion - The version of the previously deleted share.\n * @param options - Options to Share undelete operation.\n * @returns Restored share.\n */\n public async undeleteShare(\n deletedShareName: string,\n deletedShareVersion: string,\n options: ServiceUndeleteShareOptions = {},\n ): Promise<ShareClient> {\n return tracingClient.withSpan(\n \"ShareServiceClient-undeleteShare\",\n options,\n async (updatedOptions) => {\n const shareClient = this.getShareClient(deletedShareName);\n await new ShareClientInternal(shareClient.url, this.pipeline).restore({\n ...updatedOptions,\n ...this.shareClientConfig,\n deletedShareName: deletedShareName,\n deletedShareVersion: deletedShareVersion,\n });\n return shareClient;\n },\n );\n }\n\n /**\n * Only available for ShareServiceClient constructed with a shared key credential.\n *\n * Generates an account Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas\n *\n * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not specified.\n * @param permissions - Specifies the list of permissions to be associated with the SAS.\n * @param resourceTypes - Specifies the resource types associated with the shared access signature.\n * @param options - Optional parameters.\n * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n public generateAccountSasUrl(\n expiresOn?: Date,\n permissions: AccountSASPermissions = AccountSASPermissions.parse(\"r\"),\n resourceTypes: string = \"sco\",\n options: ServiceGenerateAccountSasUrlOptions = {},\n ): string {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the account SAS when the client is initialized with a shared key credential\",\n );\n }\n\n if (expiresOn === undefined) {\n const now = new Date();\n expiresOn = new Date(now.getTime() + 3600 * 1000);\n }\n\n const sas = generateAccountSASQueryParameters(\n {\n permissions,\n expiresOn,\n resourceTypes,\n services: AccountSASServices.parse(\"f\").toString(),\n ...options,\n },\n this.credential,\n ).toString();\n\n return appendToURLQuery(this.url, sas);\n }\n\n /**\n * Only available for ShareServiceClient constructed with a shared key credential.\n *\n * Generates string to sign for an account Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas\n *\n * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not specified.\n * @param permissions - Specifies the list of permissions to be associated with the SAS.\n * @param resourceTypes - Specifies the resource types associated with the shared access signature.\n * @param options - Optional parameters.\n * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n public generateSasStringToSign(\n expiresOn?: Date,\n permissions: AccountSASPermissions = AccountSASPermissions.parse(\"r\"),\n resourceTypes: string = \"sco\",\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: ServiceGenerateAccountSasUrlOptions = {},\n ): string {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the account SAS when the client is initialized with a shared key credential\",\n );\n }\n\n if (expiresOn === undefined) {\n const now = new Date();\n expiresOn = new Date(now.getTime() + 3600 * 1000);\n }\n\n return generateAccountSASQueryParametersInternal(\n {\n permissions,\n expiresOn,\n resourceTypes,\n services: AccountSASServices.parse(\"f\").toString(),\n ...options,\n },\n this.credential,\n ).stringToSign;\n }\n}\n"]}
@@ -10,6 +10,29 @@ const utils_common_js_1 = require("./utils/utils.common.js");
10
10
  * A StorageClient represents a base client class for ServiceClient, ContainerClient and etc.
11
11
  */
12
12
  class StorageClient {
13
+ /**
14
+ * URL string value.
15
+ */
16
+ url;
17
+ accountName;
18
+ /**
19
+ * Request policy pipeline.
20
+ *
21
+ * @internal
22
+ */
23
+ pipeline;
24
+ /**
25
+ * Credential in the pipeline to authenticate requests to the service, such as AnonymousCredential, StorageSharedKeyCredential.
26
+ * Initialized to an AnonymousCredential if not able to retrieve it from the pipeline.
27
+ *
28
+ * @internal
29
+ */
30
+ credential;
31
+ /**
32
+ * StorageClient is a reference to protocol layer operations entry, which is
33
+ * generated by AutoRest generator.
34
+ */
35
+ storageClientContext;
13
36
  /**
14
37
  * Creates an instance of StorageClient.
15
38
  * @param url -
@@ -1 +1 @@
1
- {"version":3,"file":"StorageClient.js","sourceRoot":"","sources":["../../src/StorageClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAGlC,uEAAiE;AAEjE,+CAAgF;AAChF,6DAA+E;AAa/E;;GAEG;AACH,MAAsB,aAAa;IA4BjC;;;;OAIG;IACH,YAAsB,GAAW,EAAE,QAAkB;QACnD,iFAAiF;QACjF,IAAI,CAAC,GAAG,GAAG,IAAA,+BAAa,EAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,CAAC,WAAW,GAAG,IAAA,uCAAqB,EAAC,GAAG,CAAC,CAAC;QAE9C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,oBAAoB,GAAG,IAAI,8CAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAA,kCAAoB,EAAC,QAAQ,CAAC,CAAC,CAAC;QAC/F,4EAA4E;QAC5E,MAAM,oBAAoB,GAAG,IAAI,CAAC,oBAA2B,CAAC;QAC9D,IAAI,oBAAoB,CAAC,kBAAkB,EAAE,CAAC;YAC5C,oBAAoB,CAAC,kBAAkB,GAAG,SAAS,CAAC;QACtD,CAAC;QAED,MAAM,UAAU,GAAG,IAAA,uCAAyB,EAAC,QAAQ,CAAC,CAAC;QACvD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CACF;AAjDD,sCAiDC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { StorageClient as StorageClientContext } from \"./generated/src/index.js\";\nimport { StorageContextClient } from \"./StorageContextClient.js\";\nimport type { Pipeline } from \"./Pipeline.js\";\nimport { getCoreClientOptions, getCredentialFromPipeline } from \"./Pipeline.js\";\nimport { escapeURLPath, getAccountNameFromUrl } from \"./utils/utils.common.js\";\nimport type { OperationTracingOptions } from \"@azure/core-tracing\";\nimport type { AnonymousCredential } from \"@azure/storage-common\";\nimport type { StorageSharedKeyCredential } from \"@azure/storage-common\";\nimport type { TokenCredential } from \"@azure/core-auth\";\n\n/**\n * An interface for options common to every remote operation.\n */\nexport interface CommonOptions {\n tracingOptions?: OperationTracingOptions;\n}\n\n/**\n * A StorageClient represents a base client class for ServiceClient, ContainerClient and etc.\n */\nexport abstract class StorageClient {\n /**\n * URL string value.\n */\n public readonly url: string;\n public readonly accountName: string;\n\n /**\n * Request policy pipeline.\n *\n * @internal\n */\n protected readonly pipeline: Pipeline;\n\n /**\n * Credential in the pipeline to authenticate requests to the service, such as AnonymousCredential, StorageSharedKeyCredential.\n * Initialized to an AnonymousCredential if not able to retrieve it from the pipeline.\n *\n * @internal\n */\n protected readonly credential: StorageSharedKeyCredential | AnonymousCredential | TokenCredential;\n\n /**\n * StorageClient is a reference to protocol layer operations entry, which is\n * generated by AutoRest generator.\n */\n protected readonly storageClientContext: StorageClientContext;\n\n /**\n * Creates an instance of StorageClient.\n * @param url -\n * @param pipeline -\n */\n protected constructor(url: string, pipeline: Pipeline) {\n // URL should be encoded and only once, protocol layer shouldn't encode URL again\n this.url = escapeURLPath(url);\n this.accountName = getAccountNameFromUrl(url);\n\n this.pipeline = pipeline;\n this.storageClientContext = new StorageContextClient(this.url, getCoreClientOptions(pipeline));\n // Remove the default content-type in generated code of StorageClientContext\n const storageClientContext = this.storageClientContext as any;\n if (storageClientContext.requestContentType) {\n storageClientContext.requestContentType = undefined;\n }\n\n const credential = getCredentialFromPipeline(pipeline);\n this.credential = credential;\n }\n}\n"]}
1
+ {"version":3,"file":"StorageClient.js","sourceRoot":"","sources":["../../src/StorageClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAGlC,uEAAiE;AAEjE,+CAAgF;AAChF,6DAA+E;AAa/E;;GAEG;AACH,MAAsB,aAAa;IACjC;;OAEG;IACa,GAAG,CAAS;IACZ,WAAW,CAAS;IAEpC;;;;OAIG;IACgB,QAAQ,CAAW;IAEtC;;;;;OAKG;IACgB,UAAU,CAAqE;IAElG;;;OAGG;IACgB,oBAAoB,CAAuB;IAE9D;;;;OAIG;IACH,YAAsB,GAAW,EAAE,QAAkB;QACnD,iFAAiF;QACjF,IAAI,CAAC,GAAG,GAAG,IAAA,+BAAa,EAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,CAAC,WAAW,GAAG,IAAA,uCAAqB,EAAC,GAAG,CAAC,CAAC;QAE9C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,oBAAoB,GAAG,IAAI,8CAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAA,kCAAoB,EAAC,QAAQ,CAAC,CAAC,CAAC;QAC/F,4EAA4E;QAC5E,MAAM,oBAAoB,GAAG,IAAI,CAAC,oBAA2B,CAAC;QAC9D,IAAI,oBAAoB,CAAC,kBAAkB,EAAE,CAAC;YAC5C,oBAAoB,CAAC,kBAAkB,GAAG,SAAS,CAAC;QACtD,CAAC;QAED,MAAM,UAAU,GAAG,IAAA,uCAAyB,EAAC,QAAQ,CAAC,CAAC;QACvD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CACF;AAjDD,sCAiDC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { StorageClient as StorageClientContext } from \"./generated/src/index.js\";\nimport { StorageContextClient } from \"./StorageContextClient.js\";\nimport type { Pipeline } from \"./Pipeline.js\";\nimport { getCoreClientOptions, getCredentialFromPipeline } from \"./Pipeline.js\";\nimport { escapeURLPath, getAccountNameFromUrl } from \"./utils/utils.common.js\";\nimport type { OperationTracingOptions } from \"@azure/core-tracing\";\nimport type { AnonymousCredential } from \"@azure/storage-common\";\nimport type { StorageSharedKeyCredential } from \"@azure/storage-common\";\nimport type { TokenCredential } from \"@azure/core-auth\";\n\n/**\n * An interface for options common to every remote operation.\n */\nexport interface CommonOptions {\n tracingOptions?: OperationTracingOptions;\n}\n\n/**\n * A StorageClient represents a base client class for ServiceClient, ContainerClient and etc.\n */\nexport abstract class StorageClient {\n /**\n * URL string value.\n */\n public readonly url: string;\n public readonly accountName: string;\n\n /**\n * Request policy pipeline.\n *\n * @internal\n */\n protected readonly pipeline: Pipeline;\n\n /**\n * Credential in the pipeline to authenticate requests to the service, such as AnonymousCredential, StorageSharedKeyCredential.\n * Initialized to an AnonymousCredential if not able to retrieve it from the pipeline.\n *\n * @internal\n */\n protected readonly credential: StorageSharedKeyCredential | AnonymousCredential | TokenCredential;\n\n /**\n * StorageClient is a reference to protocol layer operations entry, which is\n * generated by AutoRest generator.\n */\n protected readonly storageClientContext: StorageClientContext;\n\n /**\n * Creates an instance of StorageClient.\n * @param url -\n * @param pipeline -\n */\n protected constructor(url: string, pipeline: Pipeline) {\n // URL should be encoded and only once, protocol layer shouldn't encode URL again\n this.url = escapeURLPath(url);\n this.accountName = getAccountNameFromUrl(url);\n\n this.pipeline = pipeline;\n this.storageClientContext = new StorageContextClient(this.url, getCoreClientOptions(pipeline));\n // Remove the default content-type in generated code of StorageClientContext\n const storageClientContext = this.storageClientContext as any;\n if (storageClientContext.requestContentType) {\n storageClientContext.requestContentType = undefined;\n }\n\n const credential = getCredentialFromPipeline(pipeline);\n this.credential = credential;\n }\n}\n"]}
@@ -9,7 +9,7 @@ const index_js_1 = require("./generated/src/index.js");
9
9
  */
10
10
  class StorageContextClient extends index_js_1.StorageClient {
11
11
  async sendOperationRequest(operationArguments, operationSpec) {
12
- const operationSpecToSend = Object.assign({}, operationSpec);
12
+ const operationSpecToSend = { ...operationSpec };
13
13
  if (operationSpecToSend.path === "/{shareName}" ||
14
14
  operationSpecToSend.path === "/{shareName}/{directory}" ||
15
15
  operationSpecToSend.path === "/{shareName}/{directory}/{fileName}") {