@azure/storage-file-datalake 12.28.0-beta.1 → 12.28.0

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 (236) hide show
  1. package/dist/browser/DataLakeFileSystemClient.js +123 -80
  2. package/dist/browser/DataLakeFileSystemClient.js.map +1 -1
  3. package/dist/browser/DataLakeLeaseClient.js +1 -0
  4. package/dist/browser/DataLakeLeaseClient.js.map +1 -1
  5. package/dist/browser/DataLakeServiceClient.js +22 -5
  6. package/dist/browser/DataLakeServiceClient.js.map +1 -1
  7. package/dist/browser/Pipeline.js +24 -15
  8. package/dist/browser/Pipeline.js.map +1 -1
  9. package/dist/browser/StorageClient.js +43 -3
  10. package/dist/browser/StorageClient.js.map +1 -1
  11. package/dist/browser/StorageContextClient.js +2 -3
  12. package/dist/browser/StorageContextClient.js.map +1 -1
  13. package/dist/browser/clients.js +246 -66
  14. package/dist/browser/clients.js.map +1 -1
  15. package/dist/browser/generated/src/operations/fileSystemOperations.js +1 -0
  16. package/dist/browser/generated/src/operations/fileSystemOperations.js.map +1 -1
  17. package/dist/browser/generated/src/operations/pathOperations.js +1 -0
  18. package/dist/browser/generated/src/operations/pathOperations.js.map +1 -1
  19. package/dist/browser/generated/src/operations/service.js +1 -0
  20. package/dist/browser/generated/src/operations/service.js.map +1 -1
  21. package/dist/browser/generated/src/storageClient.js +15 -4
  22. package/dist/browser/generated/src/storageClient.js.map +1 -1
  23. package/dist/browser/index-browser.d.mts.map +1 -1
  24. package/dist/browser/index-browser.mjs.map +1 -1
  25. package/dist/browser/index.d.ts +1 -1
  26. package/dist/browser/index.js +1 -1
  27. package/dist/browser/sas/AccountSASPermissions.js +32 -34
  28. package/dist/browser/sas/AccountSASPermissions.js.map +1 -1
  29. package/dist/browser/sas/AccountSASResourceTypes.js +12 -14
  30. package/dist/browser/sas/AccountSASResourceTypes.js.map +1 -1
  31. package/dist/browser/sas/AccountSASServices.js +16 -18
  32. package/dist/browser/sas/AccountSASServices.js.map +1 -1
  33. package/dist/browser/sas/DataLakeSASPermissions.js +39 -41
  34. package/dist/browser/sas/DataLakeSASPermissions.js.map +1 -1
  35. package/dist/browser/sas/DataLakeSASSignatureValues.js +3 -2
  36. package/dist/browser/sas/DataLakeSASSignatureValues.js.map +1 -1
  37. package/dist/browser/sas/DirectorySASPermissions.js +43 -45
  38. package/dist/browser/sas/DirectorySASPermissions.js.map +1 -1
  39. package/dist/browser/sas/FileSystemSASPermissions.js +43 -45
  40. package/dist/browser/sas/FileSystemSASPermissions.js.map +1 -1
  41. package/dist/browser/sas/SASQueryParameters.js +131 -2
  42. package/dist/browser/sas/SASQueryParameters.js.map +1 -1
  43. package/dist/browser/transforms.js +8 -1
  44. package/dist/browser/transforms.js.map +1 -1
  45. package/dist/browser/utils/Batch.js +29 -21
  46. package/dist/browser/utils/Batch.js.map +1 -1
  47. package/dist/browser/utils/BufferScheduler.js +70 -44
  48. package/dist/browser/utils/BufferScheduler.js.map +1 -1
  49. package/dist/browser/utils/DataLakeAclChangeFailedError.js +8 -0
  50. package/dist/browser/utils/DataLakeAclChangeFailedError.js.map +1 -1
  51. package/dist/browser/utils/PathClientInternal.js +4 -0
  52. package/dist/browser/utils/PathClientInternal.js.map +1 -1
  53. package/dist/browser/utils/constants.d.ts.map +1 -1
  54. package/dist/browser/utils/constants.js +1 -1
  55. package/dist/browser/utils/constants.js.map +1 -1
  56. package/dist/browser/utils/utils.common.js +2 -4
  57. package/dist/browser/utils/utils.common.js.map +1 -1
  58. package/dist/commonjs/DataLakeFileSystemClient.js +123 -80
  59. package/dist/commonjs/DataLakeFileSystemClient.js.map +1 -1
  60. package/dist/commonjs/DataLakeLeaseClient.js +1 -0
  61. package/dist/commonjs/DataLakeLeaseClient.js.map +1 -1
  62. package/dist/commonjs/DataLakeServiceClient.js +22 -5
  63. package/dist/commonjs/DataLakeServiceClient.js.map +1 -1
  64. package/dist/commonjs/Pipeline.js +32 -23
  65. package/dist/commonjs/Pipeline.js.map +1 -1
  66. package/dist/commonjs/StorageClient.js +43 -3
  67. package/dist/commonjs/StorageClient.js.map +1 -1
  68. package/dist/commonjs/StorageContextClient.js +2 -3
  69. package/dist/commonjs/StorageContextClient.js.map +1 -1
  70. package/dist/commonjs/clients.js +246 -66
  71. package/dist/commonjs/clients.js.map +1 -1
  72. package/dist/commonjs/credentials/UserDelegationKeyCredential.js +12 -0
  73. package/dist/commonjs/credentials/UserDelegationKeyCredential.js.map +1 -1
  74. package/dist/commonjs/generated/src/operations/fileSystemOperations.js +1 -0
  75. package/dist/commonjs/generated/src/operations/fileSystemOperations.js.map +1 -1
  76. package/dist/commonjs/generated/src/operations/pathOperations.js +1 -0
  77. package/dist/commonjs/generated/src/operations/pathOperations.js.map +1 -1
  78. package/dist/commonjs/generated/src/operations/service.js +1 -0
  79. package/dist/commonjs/generated/src/operations/service.js.map +1 -1
  80. package/dist/commonjs/generated/src/storageClient.js +15 -4
  81. package/dist/commonjs/generated/src/storageClient.js.map +1 -1
  82. package/dist/commonjs/sas/AccountSASPermissions.js +32 -34
  83. package/dist/commonjs/sas/AccountSASPermissions.js.map +1 -1
  84. package/dist/commonjs/sas/AccountSASResourceTypes.js +12 -14
  85. package/dist/commonjs/sas/AccountSASResourceTypes.js.map +1 -1
  86. package/dist/commonjs/sas/AccountSASServices.js +16 -18
  87. package/dist/commonjs/sas/AccountSASServices.js.map +1 -1
  88. package/dist/commonjs/sas/DataLakeSASPermissions.js +39 -41
  89. package/dist/commonjs/sas/DataLakeSASPermissions.js.map +1 -1
  90. package/dist/commonjs/sas/DataLakeSASSignatureValues.js +3 -2
  91. package/dist/commonjs/sas/DataLakeSASSignatureValues.js.map +1 -1
  92. package/dist/commonjs/sas/DirectorySASPermissions.js +43 -45
  93. package/dist/commonjs/sas/DirectorySASPermissions.js.map +1 -1
  94. package/dist/commonjs/sas/FileSystemSASPermissions.js +43 -45
  95. package/dist/commonjs/sas/FileSystemSASPermissions.js.map +1 -1
  96. package/dist/commonjs/sas/SASQueryParameters.js +131 -2
  97. package/dist/commonjs/sas/SASQueryParameters.js.map +1 -1
  98. package/dist/commonjs/transforms.js +8 -1
  99. package/dist/commonjs/transforms.js.map +1 -1
  100. package/dist/commonjs/tsdoc-metadata.json +11 -11
  101. package/dist/commonjs/utils/Batch.js +29 -21
  102. package/dist/commonjs/utils/Batch.js.map +1 -1
  103. package/dist/commonjs/utils/BufferScheduler.js +70 -44
  104. package/dist/commonjs/utils/BufferScheduler.js.map +1 -1
  105. package/dist/commonjs/utils/DataLakeAclChangeFailedError.js +8 -0
  106. package/dist/commonjs/utils/DataLakeAclChangeFailedError.js.map +1 -1
  107. package/dist/commonjs/utils/PathClientInternal.js +4 -0
  108. package/dist/commonjs/utils/PathClientInternal.js.map +1 -1
  109. package/dist/commonjs/utils/constants.d.ts.map +1 -1
  110. package/dist/commonjs/utils/constants.js +1 -1
  111. package/dist/commonjs/utils/constants.js.map +1 -1
  112. package/dist/commonjs/utils/utils.common.js +2 -4
  113. package/dist/commonjs/utils/utils.common.js.map +1 -1
  114. package/dist/commonjs/utils/utils.d.ts +1 -1
  115. package/dist/commonjs/utils/utils.d.ts.map +1 -1
  116. package/dist/commonjs/utils/utils.js +4 -4
  117. package/dist/commonjs/utils/utils.js.map +1 -1
  118. package/dist/esm/DataLakeFileSystemClient.js +123 -80
  119. package/dist/esm/DataLakeFileSystemClient.js.map +1 -1
  120. package/dist/esm/DataLakeLeaseClient.js +1 -0
  121. package/dist/esm/DataLakeLeaseClient.js.map +1 -1
  122. package/dist/esm/DataLakeServiceClient.js +22 -5
  123. package/dist/esm/DataLakeServiceClient.js.map +1 -1
  124. package/dist/esm/Pipeline.js +24 -15
  125. package/dist/esm/Pipeline.js.map +1 -1
  126. package/dist/esm/StorageClient.js +43 -3
  127. package/dist/esm/StorageClient.js.map +1 -1
  128. package/dist/esm/StorageContextClient.js +2 -3
  129. package/dist/esm/StorageContextClient.js.map +1 -1
  130. package/dist/esm/clients.js +246 -66
  131. package/dist/esm/clients.js.map +1 -1
  132. package/dist/esm/credentials/UserDelegationKeyCredential.js +12 -0
  133. package/dist/esm/credentials/UserDelegationKeyCredential.js.map +1 -1
  134. package/dist/esm/generated/src/operations/fileSystemOperations.js +1 -0
  135. package/dist/esm/generated/src/operations/fileSystemOperations.js.map +1 -1
  136. package/dist/esm/generated/src/operations/pathOperations.js +1 -0
  137. package/dist/esm/generated/src/operations/pathOperations.js.map +1 -1
  138. package/dist/esm/generated/src/operations/service.js +1 -0
  139. package/dist/esm/generated/src/operations/service.js.map +1 -1
  140. package/dist/esm/generated/src/storageClient.js +15 -4
  141. package/dist/esm/generated/src/storageClient.js.map +1 -1
  142. package/dist/esm/sas/AccountSASPermissions.js +32 -34
  143. package/dist/esm/sas/AccountSASPermissions.js.map +1 -1
  144. package/dist/esm/sas/AccountSASResourceTypes.js +12 -14
  145. package/dist/esm/sas/AccountSASResourceTypes.js.map +1 -1
  146. package/dist/esm/sas/AccountSASServices.js +16 -18
  147. package/dist/esm/sas/AccountSASServices.js.map +1 -1
  148. package/dist/esm/sas/DataLakeSASPermissions.js +39 -41
  149. package/dist/esm/sas/DataLakeSASPermissions.js.map +1 -1
  150. package/dist/esm/sas/DataLakeSASSignatureValues.js +3 -2
  151. package/dist/esm/sas/DataLakeSASSignatureValues.js.map +1 -1
  152. package/dist/esm/sas/DirectorySASPermissions.js +43 -45
  153. package/dist/esm/sas/DirectorySASPermissions.js.map +1 -1
  154. package/dist/esm/sas/FileSystemSASPermissions.js +43 -45
  155. package/dist/esm/sas/FileSystemSASPermissions.js.map +1 -1
  156. package/dist/esm/sas/SASQueryParameters.js +131 -2
  157. package/dist/esm/sas/SASQueryParameters.js.map +1 -1
  158. package/dist/esm/transforms.js +8 -1
  159. package/dist/esm/transforms.js.map +1 -1
  160. package/dist/esm/utils/Batch.js +29 -21
  161. package/dist/esm/utils/Batch.js.map +1 -1
  162. package/dist/esm/utils/BufferScheduler.js +70 -44
  163. package/dist/esm/utils/BufferScheduler.js.map +1 -1
  164. package/dist/esm/utils/DataLakeAclChangeFailedError.js +8 -0
  165. package/dist/esm/utils/DataLakeAclChangeFailedError.js.map +1 -1
  166. package/dist/esm/utils/PathClientInternal.js +4 -0
  167. package/dist/esm/utils/PathClientInternal.js.map +1 -1
  168. package/dist/esm/utils/constants.d.ts.map +1 -1
  169. package/dist/esm/utils/constants.js +1 -1
  170. package/dist/esm/utils/constants.js.map +1 -1
  171. package/dist/esm/utils/utils.common.js +2 -4
  172. package/dist/esm/utils/utils.common.js.map +1 -1
  173. package/dist/esm/utils/utils.d.ts +1 -1
  174. package/dist/esm/utils/utils.d.ts.map +1 -1
  175. package/dist/esm/utils/utils.js +2 -2
  176. package/dist/esm/utils/utils.js.map +1 -1
  177. package/dist/react-native/DataLakeFileSystemClient.js +123 -80
  178. package/dist/react-native/DataLakeFileSystemClient.js.map +1 -1
  179. package/dist/react-native/DataLakeLeaseClient.js +1 -0
  180. package/dist/react-native/DataLakeLeaseClient.js.map +1 -1
  181. package/dist/react-native/DataLakeServiceClient.js +22 -5
  182. package/dist/react-native/DataLakeServiceClient.js.map +1 -1
  183. package/dist/react-native/Pipeline.js +24 -15
  184. package/dist/react-native/Pipeline.js.map +1 -1
  185. package/dist/react-native/StorageClient.js +43 -3
  186. package/dist/react-native/StorageClient.js.map +1 -1
  187. package/dist/react-native/StorageContextClient.js +2 -3
  188. package/dist/react-native/StorageContextClient.js.map +1 -1
  189. package/dist/react-native/clients.js +246 -66
  190. package/dist/react-native/clients.js.map +1 -1
  191. package/dist/react-native/credentials/UserDelegationKeyCredential.js +12 -0
  192. package/dist/react-native/credentials/UserDelegationKeyCredential.js.map +1 -1
  193. package/dist/react-native/generated/src/operations/fileSystemOperations.js +1 -0
  194. package/dist/react-native/generated/src/operations/fileSystemOperations.js.map +1 -1
  195. package/dist/react-native/generated/src/operations/pathOperations.js +1 -0
  196. package/dist/react-native/generated/src/operations/pathOperations.js.map +1 -1
  197. package/dist/react-native/generated/src/operations/service.js +1 -0
  198. package/dist/react-native/generated/src/operations/service.js.map +1 -1
  199. package/dist/react-native/generated/src/storageClient.js +15 -4
  200. package/dist/react-native/generated/src/storageClient.js.map +1 -1
  201. package/dist/react-native/sas/AccountSASPermissions.js +32 -34
  202. package/dist/react-native/sas/AccountSASPermissions.js.map +1 -1
  203. package/dist/react-native/sas/AccountSASResourceTypes.js +12 -14
  204. package/dist/react-native/sas/AccountSASResourceTypes.js.map +1 -1
  205. package/dist/react-native/sas/AccountSASServices.js +16 -18
  206. package/dist/react-native/sas/AccountSASServices.js.map +1 -1
  207. package/dist/react-native/sas/DataLakeSASPermissions.js +39 -41
  208. package/dist/react-native/sas/DataLakeSASPermissions.js.map +1 -1
  209. package/dist/react-native/sas/DataLakeSASSignatureValues.js +3 -2
  210. package/dist/react-native/sas/DataLakeSASSignatureValues.js.map +1 -1
  211. package/dist/react-native/sas/DirectorySASPermissions.js +43 -45
  212. package/dist/react-native/sas/DirectorySASPermissions.js.map +1 -1
  213. package/dist/react-native/sas/FileSystemSASPermissions.js +43 -45
  214. package/dist/react-native/sas/FileSystemSASPermissions.js.map +1 -1
  215. package/dist/react-native/sas/SASQueryParameters.js +131 -2
  216. package/dist/react-native/sas/SASQueryParameters.js.map +1 -1
  217. package/dist/react-native/transforms.js +8 -1
  218. package/dist/react-native/transforms.js.map +1 -1
  219. package/dist/react-native/utils/Batch.js +29 -21
  220. package/dist/react-native/utils/Batch.js.map +1 -1
  221. package/dist/react-native/utils/BufferScheduler.js +70 -44
  222. package/dist/react-native/utils/BufferScheduler.js.map +1 -1
  223. package/dist/react-native/utils/DataLakeAclChangeFailedError.js +8 -0
  224. package/dist/react-native/utils/DataLakeAclChangeFailedError.js.map +1 -1
  225. package/dist/react-native/utils/PathClientInternal.js +4 -0
  226. package/dist/react-native/utils/PathClientInternal.js.map +1 -1
  227. package/dist/react-native/utils/constants.d.ts.map +1 -1
  228. package/dist/react-native/utils/constants.js +1 -1
  229. package/dist/react-native/utils/constants.js.map +1 -1
  230. package/dist/react-native/utils/utils.common.js +2 -4
  231. package/dist/react-native/utils/utils.common.js.map +1 -1
  232. package/dist/react-native/utils/utils.d.ts +1 -1
  233. package/dist/react-native/utils/utils.d.ts.map +1 -1
  234. package/dist/react-native/utils/utils.js +2 -2
  235. package/dist/react-native/utils/utils.js.map +1 -1
  236. package/package.json +36 -36
@@ -20,6 +20,11 @@ import { AccountSASServices } from "./sas/AccountSASServices.js";
20
20
  * the top-level namespace for the Data Lake service.
21
21
  */
22
22
  export class DataLakeServiceClient extends StorageClient {
23
+ // private serviceContext: Service;
24
+ /**
25
+ * blobServiceClient provided by `@azure/storage-blob` package.
26
+ */
27
+ blobServiceClient;
23
28
  /**
24
29
  *
25
30
  * Creates an instance of DataLakeServiceClient from connection string.
@@ -282,9 +287,13 @@ export class DataLakeServiceClient extends StorageClient {
282
287
  const now = new Date();
283
288
  expiresOn = new Date(now.getTime() + 3600 * 1000);
284
289
  }
285
- const sas = generateAccountSASQueryParameters(Object.assign({ permissions,
290
+ const sas = generateAccountSASQueryParameters({
291
+ permissions,
286
292
  expiresOn,
287
- resourceTypes, services: AccountSASServices.parse("b").toString() }, options), this.credential).toString();
293
+ resourceTypes,
294
+ services: AccountSASServices.parse("b").toString(),
295
+ ...options,
296
+ }, this.credential).toString();
288
297
  return appendToURLQuery(this.url, sas);
289
298
  }
290
299
  /**
@@ -309,9 +318,13 @@ export class DataLakeServiceClient extends StorageClient {
309
318
  const now = new Date();
310
319
  expiresOn = new Date(now.getTime() + 3600 * 1000);
311
320
  }
312
- return generateAccountSASQueryParametersInternal(Object.assign({ permissions,
321
+ return generateAccountSASQueryParametersInternal({
322
+ permissions,
313
323
  expiresOn,
314
- resourceTypes, services: AccountSASServices.parse("b").toString() }, options), this.credential).stringToSign;
324
+ resourceTypes,
325
+ services: AccountSASServices.parse("b").toString(),
326
+ ...options,
327
+ }, this.credential).stringToSign;
315
328
  }
316
329
  /**
317
330
  * Restore a previously deleted File System.
@@ -323,7 +336,11 @@ export class DataLakeServiceClient extends StorageClient {
323
336
  */
324
337
  async undeleteFileSystem(deletedFileSystemName, deleteFileSystemVersion, options = {}) {
325
338
  return tracingClient.withSpan("DataLakeServiceClient-undeleteFileSystem", options, async (updatedOptions) => {
326
- const res = await this.blobServiceClient.undeleteContainer(deletedFileSystemName, deleteFileSystemVersion, Object.assign(Object.assign({}, options), { destinationContainerName: options.destinationFileSystemName, tracingOptions: updatedOptions.tracingOptions }));
339
+ const res = await this.blobServiceClient.undeleteContainer(deletedFileSystemName, deleteFileSystemVersion, {
340
+ ...options,
341
+ destinationContainerName: options.destinationFileSystemName,
342
+ tracingOptions: updatedOptions.tracingOptions,
343
+ });
327
344
  const fileSystemClient = this.getFileSystemClient(options.destinationFileSystemName || deletedFileSystemName);
328
345
  return {
329
346
  fileSystemClient,
@@ -1 +1 @@
1
- {"version":3,"file":"DataLakeServiceClient.js","sourceRoot":"","sources":["../../src/DataLakeServiceClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAM9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AACzF,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AASzE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,sCAAsC,EAAE,MAAM,iBAAiB,CAAC;AAK3F,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;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AqB,CAC3D,CAAC;YACF,OAAO;gBACL,gBAAgB;gBAChB,0BAA0B,EAAE,GAAG,CAAC,yBAAyB;aAC1D,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,aAAa,CACxB,UAAuC,EAAE;QAEzC,OAAO,aAAa,CAAC,QAAQ,CAC3B,qCAAqC,EACrC,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC;gBAC1C,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,cAAc,EAAE,cAAc,CAAC,cAAc;aAC9C,CAAC,CAAC;QACL,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,aAAa,CACxB,UAAqC,EACrC,UAAuC,EAAE;QAEzC,OAAO,aAAa,CAAC,QAAQ,CAC3B,qCAAqC,EACrC,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,UAAU,EAAE;gBACtD,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,cAAc,EAAE,cAAc,CAAC,cAAc;aAC9C,CAAC,CAAC;QACL,CAAC,CACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { getDefaultProxySettings } from \"@azure/core-rest-pipeline\";\nimport { isNodeLike } from \"@azure/core-util\";\nimport type {\n ServiceGetPropertiesOptions,\n ServiceSetPropertiesOptions,\n ServiceSetPropertiesResponse,\n} from \"@azure/storage-blob\";\nimport { BlobServiceClient } from \"@azure/storage-blob\";\nimport type { Pipeline, StoragePipelineOptions } from \"./Pipeline.js\";\nimport { isPipelineLike, newPipeline } from \"./Pipeline.js\";\nimport { AnonymousCredential } from \"@azure/storage-blob\";\nimport { StorageSharedKeyCredential } from \"./credentials/StorageSharedKeyCredential.js\";\nimport { DataLakeFileSystemClient } from \"./DataLakeFileSystemClient.js\";\nimport type {\n FileSystemItem,\n ServiceGenerateAccountSasUrlOptions,\n ServiceListFileSystemsOptions,\n ServiceListFileSystemsSegmentResponse,\n ServiceUndeleteFileSystemOptions,\n FileSystemUndeleteResponse,\n} from \"./models.js\";\nimport { StorageClient } from \"./StorageClient.js\";\nimport {\n appendToURLPath,\n appendToURLQuery,\n extractConnectionStringParts,\n} from \"./utils/utils.common.js\";\nimport { toDfsEndpointUrl, toFileSystemPagedAsyncIterableIterator } from \"./transforms.js\";\nimport type {\n ServiceGetUserDelegationKeyOptions,\n ServiceGetUserDelegationKeyResponse,\n} from \"./models.js\";\nimport { tracingClient } from \"./utils/tracing.js\";\nimport { AccountSASPermissions } from \"./sas/AccountSASPermissions.js\";\nimport {\n generateAccountSASQueryParameters,\n generateAccountSASQueryParametersInternal,\n} from \"./sas/AccountSASSignatureValues.js\";\nimport { AccountSASServices } from \"./sas/AccountSASServices.js\";\nimport type { DataLakeServiceGetPropertiesResponse, DataLakeServiceProperties } from \"./index.js\";\n\n/**\n * DataLakeServiceClient allows you to manipulate Azure\n * Data Lake service resources and file systems. The storage account provides\n * the top-level namespace for the Data Lake service.\n */\nexport class DataLakeServiceClient extends StorageClient {\n // private serviceContext: Service;\n\n /**\n * blobServiceClient provided by `@azure/storage-blob` package.\n */\n private blobServiceClient: BlobServiceClient;\n\n /**\n *\n * Creates an instance of DataLakeServiceClient 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 - 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\n public static fromConnectionString(\n connectionString: string,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: StoragePipelineOptions,\n ): DataLakeServiceClient {\n options = options || {};\n const extractedCreds = extractConnectionStringParts(connectionString);\n if (extractedCreds.kind === \"AccountConnString\") {\n if (isNodeLike) {\n const sharedKeyCredential = new StorageSharedKeyCredential(\n extractedCreds.accountName!,\n extractedCreds.accountKey,\n );\n if (!options.proxyOptions) {\n options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri);\n }\n const pipeline = newPipeline(sharedKeyCredential, options);\n return new DataLakeServiceClient(toDfsEndpointUrl(extractedCreds.url), pipeline);\n } else {\n throw new Error(\"Account connection string is only supported in Node.js environment\");\n }\n } else if (extractedCreds.kind === \"SASConnString\") {\n const pipeline = newPipeline(new AnonymousCredential(), options);\n return new DataLakeServiceClient(\n toDfsEndpointUrl(extractedCreds.url) + \"?\" + extractedCreds.accountSas,\n pipeline,\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 DataLakeServiceClient from url.\n *\n * @param url - A Client string pointing to Azure Storage data lake service, such as\n * \"https://myaccount.dfs.core.windows.net\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.dfs.core.windows.net?sasString\".\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(\n url: string,\n credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: StoragePipelineOptions,\n );\n\n /**\n * Creates an instance of DataLakeServiceClient from url and pipeline.\n *\n * @param url - A Client string pointing to Azure Storage data lake service, such as\n * \"https://myaccount.dfs.core.windows.net\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.dfs.core.windows.net?sasString\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n */\n public constructor(url: string, pipeline: Pipeline);\n\n public constructor(\n url: string,\n credentialOrPipeline?:\n | StorageSharedKeyCredential\n | AnonymousCredential\n | TokenCredential\n | Pipeline,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: StoragePipelineOptions,\n ) {\n if (isPipelineLike(credentialOrPipeline)) {\n super(url, credentialOrPipeline);\n } else {\n let credential;\n if (credentialOrPipeline === undefined) {\n credential = new AnonymousCredential();\n } else {\n credential = credentialOrPipeline;\n }\n\n const pipeline = newPipeline(credential, options);\n super(url, pipeline);\n }\n\n // this.serviceContext = new Service(this.storageClientContext);\n this.blobServiceClient = new BlobServiceClient(this.blobEndpointUrl, this.pipeline);\n }\n\n /**\n * Creates a {@link DataLakeFileSystemClient} object.\n *\n * @param fileSystemName - File system name.\n */\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */\n public getFileSystemClient(fileSystemName: string): DataLakeFileSystemClient {\n return new DataLakeFileSystemClient(\n appendToURLPath(this.url, encodeURIComponent(fileSystemName)),\n this.pipeline,\n );\n }\n\n /**\n * ONLY AVAILABLE WHEN USING BEARER TOKEN AUTHENTICATION (TokenCredential).\n *\n * Retrieves a user delegation key for the Data Lake service. This is only a valid operation when using\n * bearer token authentication.\n *\n * @example\n * ```ts snippet:DatalakeServiceClientGetUserDelegationKey\n * import {\n * DataLakeServiceClient,\n * generateDataLakeSASQueryParameters,\n * FileSystemSASPermissions,\n * SASProtocol,\n * } from \"@azure/storage-file-datalake\";\n *\n * const account = \"<account>\";\n * const sas = \"<sas token>\";\n * const datalakeServiceClient = new DataLakeServiceClient(\n * `https://${account}.dfs.core.windows.net${sas}`,\n * );\n *\n * const fileSystemName = \"<file system name>\";\n * const accountName = \"<account name>\";\n * const startsOn = new Date();\n * const expiresOn = new Date(+new Date() + 86400 * 1000);\n * // Generate user delegation SAS for a file system\n * const userDelegationKey = await datalakeServiceClient.getUserDelegationKey(startsOn, expiresOn);\n * const fileSystemSAS = generateDataLakeSASQueryParameters(\n * {\n * fileSystemName, // Required\n * permissions: FileSystemSASPermissions.parse(\"racwdl\"), // Required\n * startsOn, // Required. Date type\n * expiresOn, // Optional. Date type\n * ipRange: { start: \"0.0.0.0\", end: \"255.255.255.255\" }, // Optional\n * protocol: SASProtocol.HttpsAndHttp, // Optional\n * version: \"2018-11-09\", // Must greater than or equal to 2018-11-09 to generate user delegation SAS\n * },\n * userDelegationKey, // UserDelegationKey\n * accountName,\n * ).toString();\n * ```\n * @see https://learn.microsoft.com/rest/api/storageservices/get-user-delegation-key\n *\n * @param startsOn - The start time for the user delegation SAS. Must be within 7 days of the current time.\n * @param expiresOn - The end time for the user delegation SAS. Must be within 7 days of the current time.\n * @param options -\n */\n public async getUserDelegationKey(\n startsOn: Date,\n expiresOn: Date,\n options: ServiceGetUserDelegationKeyOptions = {},\n ): Promise<ServiceGetUserDelegationKeyResponse> {\n return tracingClient.withSpan(\n \"DataLakeServiceClient-getUserDelegationKey\",\n options,\n async (updatedOptions) => {\n return this.blobServiceClient.getUserDelegationKey(startsOn, expiresOn, updatedOptions);\n },\n );\n }\n\n /**\n * Returns an async iterable iterator to list all the file systems\n * under the specified account.\n *\n * .byPage() returns an async iterable iterator to list the file systems in pages.\n *\n * Example using `for await` syntax:\n *\n * ```ts snippet:ReadmeSampleListFileSystems\n * import { DataLakeServiceClient } from \"@azure/storage-file-datalake\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const account = \"<account>\";\n * const datalakeServiceClient = new DataLakeServiceClient(\n * `https://${account}.dfs.core.windows.net`,\n * new DefaultAzureCredential(),\n * );\n *\n * let i = 1;\n * const fileSystems = datalakeServiceClient.listFileSystems();\n * for await (const fileSystem of fileSystems) {\n * console.log(`File system ${i++}: ${fileSystem.name}`);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```ts snippet:ReadmeSampleListFileSystems_Iterator\n * import { DataLakeServiceClient } from \"@azure/storage-file-datalake\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const account = \"<account>\";\n * const datalakeServiceClient = new DataLakeServiceClient(\n * `https://${account}.dfs.core.windows.net`,\n * new DefaultAzureCredential(),\n * );\n *\n * let i = 1;\n * const fileSystems = datalakeServiceClient.listFileSystems();\n * let { value, done } = await fileSystems.next();\n * while (!done) {\n * console.log(`File system ${i++}: ${value.name}`);\n * ({ value, done } = await fileSystems.next());\n * }\n * ```\n *\n * Example using `byPage()`:\n *\n * ```ts snippet:ReadmeSampleListFileSystems_ByPage\n * import { DataLakeServiceClient } from \"@azure/storage-file-datalake\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const account = \"<account>\";\n * const datalakeServiceClient = new DataLakeServiceClient(\n * `https://${account}.dfs.core.windows.net`,\n * new DefaultAzureCredential(),\n * );\n *\n * let i = 1;\n * for await (const response of datalakeServiceClient.listFileSystems().byPage({ maxPageSize: 20 })) {\n * if (response.fileSystemItems) {\n * for (const fileSystem of response.fileSystemItems) {\n * console.log(`File System ${i++}: ${fileSystem.name}`);\n * }\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```ts snippet:ReadmeSampleListFileSystems_Continuation\n * import { DataLakeServiceClient } from \"@azure/storage-file-datalake\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const account = \"<account>\";\n * const datalakeServiceClient = new DataLakeServiceClient(\n * `https://${account}.dfs.core.windows.net`,\n * new DefaultAzureCredential(),\n * );\n *\n * let i = 1;\n * let fileSystems = datalakeServiceClient.listFileSystems().byPage({ maxPageSize: 2 });\n * let response = (await fileSystems.next()).value;\n * // Prints 2 file systems\n * if (response.fileSystemItems) {\n * for (const fileSystem of response.fileSystemItems) {\n * console.log(`File system ${i++}: ${fileSystem.name}`);\n * }\n * }\n * // Gets next marker\n * let marker = response.continuationToken;\n * // Passing next marker as continuationToken\n * fileSystems = datalakeServiceClient\n * .listFileSystems()\n * .byPage({ continuationToken: marker, maxPageSize: 10 });\n * response = (await fileSystems.next()).value;\n * // Prints 10 file systems\n * if (response.fileSystemItems) {\n * for (const fileSystem of response.fileSystemItems) {\n * console.log(`File system ${i++}: ${fileSystem.name}`);\n * }\n * }\n * ```\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/list-containers2\n *\n * @param options -\n */\n public listFileSystems(\n options: ServiceListFileSystemsOptions = {},\n ): PagedAsyncIterableIterator<FileSystemItem, ServiceListFileSystemsSegmentResponse> {\n return toFileSystemPagedAsyncIterableIterator(this.blobServiceClient.listContainers(options));\n }\n\n // public async createFileSystem(): Promise<DataLakeFileSystemClient> {\n // throw Error(\"NotImplemented\");\n // }\n\n // public async deleteFileSystem(fileSystem: string): Promise<ServiceDeleteFileSystemResponse> {\n // throw Error(\"NotImplemented\");\n // }\n\n /**\n * Only available for DataLakeServiceClient 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(\"b\").toString(),\n ...options,\n },\n this.credential,\n ).toString();\n\n return appendToURLQuery(this.url, sas);\n }\n\n /**\n * Only available for DataLakeServiceClient constructed with a shared key credential.\n *\n * Generates string to sign for an account Shared Access Signature (SAS) based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas\n *\n * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not specified.\n * @param permissions - Specifies the list of permissions to be associated with the SAS.\n * @param resourceTypes - Specifies the resource types associated with the shared access signature.\n * @param options - Optional parameters.\n * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n public generateSasStringToSign(\n expiresOn?: Date,\n permissions: AccountSASPermissions = AccountSASPermissions.parse(\"r\"),\n resourceTypes: string = \"sco\",\n options: ServiceGenerateAccountSasUrlOptions = {},\n ): string {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the account SAS when the client is initialized with a shared key credential\",\n );\n }\n\n if (expiresOn === undefined) {\n const now = new Date();\n expiresOn = new Date(now.getTime() + 3600 * 1000);\n }\n\n return generateAccountSASQueryParametersInternal(\n {\n permissions,\n expiresOn,\n resourceTypes,\n services: AccountSASServices.parse(\"b\").toString(),\n ...options,\n },\n this.credential,\n ).stringToSign;\n }\n\n /**\n * Restore a previously deleted File System.\n * This API is only functional if Container Soft Delete is enabled for the storage account.\n *\n * @param deletedFileSystemName - The name of the source File System.\n * @param deleteFileSystemVersion - The new name of the File System.\n * @param options - Options to configure File System Restore operation.\n */\n public async undeleteFileSystem(\n deletedFileSystemName: string,\n deleteFileSystemVersion: string,\n options: ServiceUndeleteFileSystemOptions = {},\n ): Promise<{\n fileSystemClient: DataLakeFileSystemClient;\n fileSystemUndeleteResponse: FileSystemUndeleteResponse;\n }> {\n return tracingClient.withSpan(\n \"DataLakeServiceClient-undeleteFileSystem\",\n options,\n async (updatedOptions) => {\n const res = await this.blobServiceClient.undeleteContainer(\n deletedFileSystemName,\n deleteFileSystemVersion,\n {\n ...options,\n destinationContainerName: options.destinationFileSystemName,\n tracingOptions: updatedOptions.tracingOptions,\n },\n );\n\n const fileSystemClient = this.getFileSystemClient(\n options.destinationFileSystemName || deletedFileSystemName,\n );\n return {\n fileSystemClient,\n fileSystemUndeleteResponse: res.containerUndeleteResponse,\n };\n },\n );\n }\n\n /**\n * Gets the properties of a storage account’s Blob service endpoint, including properties\n * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.\n * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties\n *\n * @param options - Options to the Service Get Properties operation.\n * @returns Response data for the Service Get Properties operation.\n */\n public async getProperties(\n options: ServiceGetPropertiesOptions = {},\n ): Promise<DataLakeServiceGetPropertiesResponse> {\n return tracingClient.withSpan(\n \"DataLakeServiceClient-getProperties\",\n options,\n async (updatedOptions) => {\n return this.blobServiceClient.getProperties({\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n });\n },\n );\n }\n\n /**\n * Sets properties for a storage account’s Blob 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-blob-service-properties\n *\n * @param properties -\n * @param options - Options to the Service Set Properties operation.\n * @returns Response data for the Service Set Properties operation.\n */\n public async setProperties(\n properties: DataLakeServiceProperties,\n options: ServiceSetPropertiesOptions = {},\n ): Promise<ServiceSetPropertiesResponse> {\n return tracingClient.withSpan(\n \"DataLakeServiceClient-setProperties\",\n options,\n async (updatedOptions) => {\n return this.blobServiceClient.setProperties(properties, {\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n });\n },\n );\n }\n}\n"]}
1
+ {"version":3,"file":"DataLakeServiceClient.js","sourceRoot":"","sources":["../../src/DataLakeServiceClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAM9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AACzF,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AASzE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,sCAAsC,EAAE,MAAM,iBAAiB,CAAC;AAK3F,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EACL,iCAAiC,EACjC,yCAAyC,GAC1C,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAGjE;;;;GAIG;AACH,MAAM,OAAO,qBAAsB,SAAQ,aAAa;IACtD,mCAAmC;IAEnC;;OAEG;IACK,iBAAiB,CAAoB;IAE7C;;;;;;;;;;;OAWG;IACH,2FAA2F;IAEpF,MAAM,CAAC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,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC;gBAC1C,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,cAAc,EAAE,cAAc,CAAC,cAAc;aAC9C,CAAC,CAAC;QACL,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,aAAa,CACxB,UAAqC,EACrC,UAAuC,EAAE;QAEzC,OAAO,aAAa,CAAC,QAAQ,CAC3B,qCAAqC,EACrC,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,OAAO,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,UAAU,EAAE;gBACtD,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,cAAc,EAAE,cAAc,CAAC,cAAc;aAC9C,CAAC,CAAC;QACL,CAAC,CACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { getDefaultProxySettings } from \"@azure/core-rest-pipeline\";\nimport { isNodeLike } from \"@azure/core-util\";\nimport type {\n ServiceGetPropertiesOptions,\n ServiceSetPropertiesOptions,\n ServiceSetPropertiesResponse,\n} from \"@azure/storage-blob\";\nimport { BlobServiceClient } from \"@azure/storage-blob\";\nimport type { Pipeline, StoragePipelineOptions } from \"./Pipeline.js\";\nimport { isPipelineLike, newPipeline } from \"./Pipeline.js\";\nimport { AnonymousCredential } from \"@azure/storage-blob\";\nimport { StorageSharedKeyCredential } from \"./credentials/StorageSharedKeyCredential.js\";\nimport { DataLakeFileSystemClient } from \"./DataLakeFileSystemClient.js\";\nimport type {\n FileSystemItem,\n ServiceGenerateAccountSasUrlOptions,\n ServiceListFileSystemsOptions,\n ServiceListFileSystemsSegmentResponse,\n ServiceUndeleteFileSystemOptions,\n FileSystemUndeleteResponse,\n} from \"./models.js\";\nimport { StorageClient } from \"./StorageClient.js\";\nimport {\n appendToURLPath,\n appendToURLQuery,\n extractConnectionStringParts,\n} from \"./utils/utils.common.js\";\nimport { toDfsEndpointUrl, toFileSystemPagedAsyncIterableIterator } from \"./transforms.js\";\nimport type {\n ServiceGetUserDelegationKeyOptions,\n ServiceGetUserDelegationKeyResponse,\n} from \"./models.js\";\nimport { tracingClient } from \"./utils/tracing.js\";\nimport { AccountSASPermissions } from \"./sas/AccountSASPermissions.js\";\nimport {\n generateAccountSASQueryParameters,\n generateAccountSASQueryParametersInternal,\n} from \"./sas/AccountSASSignatureValues.js\";\nimport { AccountSASServices } from \"./sas/AccountSASServices.js\";\nimport type { DataLakeServiceGetPropertiesResponse, DataLakeServiceProperties } from \"./index.js\";\n\n/**\n * DataLakeServiceClient allows you to manipulate Azure\n * Data Lake service resources and file systems. The storage account provides\n * the top-level namespace for the Data Lake service.\n */\nexport class DataLakeServiceClient extends StorageClient {\n // private serviceContext: Service;\n\n /**\n * blobServiceClient provided by `@azure/storage-blob` package.\n */\n private blobServiceClient: BlobServiceClient;\n\n /**\n *\n * Creates an instance of DataLakeServiceClient 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 - 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\n public static fromConnectionString(\n connectionString: string,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: StoragePipelineOptions,\n ): DataLakeServiceClient {\n options = options || {};\n const extractedCreds = extractConnectionStringParts(connectionString);\n if (extractedCreds.kind === \"AccountConnString\") {\n if (isNodeLike) {\n const sharedKeyCredential = new StorageSharedKeyCredential(\n extractedCreds.accountName!,\n extractedCreds.accountKey,\n );\n if (!options.proxyOptions) {\n options.proxyOptions = getDefaultProxySettings(extractedCreds.proxyUri);\n }\n const pipeline = newPipeline(sharedKeyCredential, options);\n return new DataLakeServiceClient(toDfsEndpointUrl(extractedCreds.url), pipeline);\n } else {\n throw new Error(\"Account connection string is only supported in Node.js environment\");\n }\n } else if (extractedCreds.kind === \"SASConnString\") {\n const pipeline = newPipeline(new AnonymousCredential(), options);\n return new DataLakeServiceClient(\n toDfsEndpointUrl(extractedCreds.url) + \"?\" + extractedCreds.accountSas,\n pipeline,\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 DataLakeServiceClient from url.\n *\n * @param url - A Client string pointing to Azure Storage data lake service, such as\n * \"https://myaccount.dfs.core.windows.net\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.dfs.core.windows.net?sasString\".\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(\n url: string,\n credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: StoragePipelineOptions,\n );\n\n /**\n * Creates an instance of DataLakeServiceClient from url and pipeline.\n *\n * @param url - A Client string pointing to Azure Storage data lake service, such as\n * \"https://myaccount.dfs.core.windows.net\". You can append a SAS\n * if using AnonymousCredential, such as \"https://myaccount.dfs.core.windows.net?sasString\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n */\n public constructor(url: string, pipeline: Pipeline);\n\n public constructor(\n url: string,\n credentialOrPipeline?:\n | StorageSharedKeyCredential\n | AnonymousCredential\n | TokenCredential\n | Pipeline,\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options?: StoragePipelineOptions,\n ) {\n if (isPipelineLike(credentialOrPipeline)) {\n super(url, credentialOrPipeline);\n } else {\n let credential;\n if (credentialOrPipeline === undefined) {\n credential = new AnonymousCredential();\n } else {\n credential = credentialOrPipeline;\n }\n\n const pipeline = newPipeline(credential, options);\n super(url, pipeline);\n }\n\n // this.serviceContext = new Service(this.storageClientContext);\n this.blobServiceClient = new BlobServiceClient(this.blobEndpointUrl, this.pipeline);\n }\n\n /**\n * Creates a {@link DataLakeFileSystemClient} object.\n *\n * @param fileSystemName - File system name.\n */\n // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */\n public getFileSystemClient(fileSystemName: string): DataLakeFileSystemClient {\n return new DataLakeFileSystemClient(\n appendToURLPath(this.url, encodeURIComponent(fileSystemName)),\n this.pipeline,\n );\n }\n\n /**\n * ONLY AVAILABLE WHEN USING BEARER TOKEN AUTHENTICATION (TokenCredential).\n *\n * Retrieves a user delegation key for the Data Lake service. This is only a valid operation when using\n * bearer token authentication.\n *\n * @example\n * ```ts snippet:DatalakeServiceClientGetUserDelegationKey\n * import {\n * DataLakeServiceClient,\n * generateDataLakeSASQueryParameters,\n * FileSystemSASPermissions,\n * SASProtocol,\n * } from \"@azure/storage-file-datalake\";\n *\n * const account = \"<account>\";\n * const sas = \"<sas token>\";\n * const datalakeServiceClient = new DataLakeServiceClient(\n * `https://${account}.dfs.core.windows.net${sas}`,\n * );\n *\n * const fileSystemName = \"<file system name>\";\n * const accountName = \"<account name>\";\n * const startsOn = new Date();\n * const expiresOn = new Date(+new Date() + 86400 * 1000);\n * // Generate user delegation SAS for a file system\n * const userDelegationKey = await datalakeServiceClient.getUserDelegationKey(startsOn, expiresOn);\n * const fileSystemSAS = generateDataLakeSASQueryParameters(\n * {\n * fileSystemName, // Required\n * permissions: FileSystemSASPermissions.parse(\"racwdl\"), // Required\n * startsOn, // Required. Date type\n * expiresOn, // Optional. Date type\n * ipRange: { start: \"0.0.0.0\", end: \"255.255.255.255\" }, // Optional\n * protocol: SASProtocol.HttpsAndHttp, // Optional\n * version: \"2018-11-09\", // Must greater than or equal to 2018-11-09 to generate user delegation SAS\n * },\n * userDelegationKey, // UserDelegationKey\n * accountName,\n * ).toString();\n * ```\n * @see https://learn.microsoft.com/rest/api/storageservices/get-user-delegation-key\n *\n * @param startsOn - The start time for the user delegation SAS. Must be within 7 days of the current time.\n * @param expiresOn - The end time for the user delegation SAS. Must be within 7 days of the current time.\n * @param options -\n */\n public async getUserDelegationKey(\n startsOn: Date,\n expiresOn: Date,\n options: ServiceGetUserDelegationKeyOptions = {},\n ): Promise<ServiceGetUserDelegationKeyResponse> {\n return tracingClient.withSpan(\n \"DataLakeServiceClient-getUserDelegationKey\",\n options,\n async (updatedOptions) => {\n return this.blobServiceClient.getUserDelegationKey(startsOn, expiresOn, updatedOptions);\n },\n );\n }\n\n /**\n * Returns an async iterable iterator to list all the file systems\n * under the specified account.\n *\n * .byPage() returns an async iterable iterator to list the file systems in pages.\n *\n * Example using `for await` syntax:\n *\n * ```ts snippet:ReadmeSampleListFileSystems\n * import { DataLakeServiceClient } from \"@azure/storage-file-datalake\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const account = \"<account>\";\n * const datalakeServiceClient = new DataLakeServiceClient(\n * `https://${account}.dfs.core.windows.net`,\n * new DefaultAzureCredential(),\n * );\n *\n * let i = 1;\n * const fileSystems = datalakeServiceClient.listFileSystems();\n * for await (const fileSystem of fileSystems) {\n * console.log(`File system ${i++}: ${fileSystem.name}`);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```ts snippet:ReadmeSampleListFileSystems_Iterator\n * import { DataLakeServiceClient } from \"@azure/storage-file-datalake\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const account = \"<account>\";\n * const datalakeServiceClient = new DataLakeServiceClient(\n * `https://${account}.dfs.core.windows.net`,\n * new DefaultAzureCredential(),\n * );\n *\n * let i = 1;\n * const fileSystems = datalakeServiceClient.listFileSystems();\n * let { value, done } = await fileSystems.next();\n * while (!done) {\n * console.log(`File system ${i++}: ${value.name}`);\n * ({ value, done } = await fileSystems.next());\n * }\n * ```\n *\n * Example using `byPage()`:\n *\n * ```ts snippet:ReadmeSampleListFileSystems_ByPage\n * import { DataLakeServiceClient } from \"@azure/storage-file-datalake\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const account = \"<account>\";\n * const datalakeServiceClient = new DataLakeServiceClient(\n * `https://${account}.dfs.core.windows.net`,\n * new DefaultAzureCredential(),\n * );\n *\n * let i = 1;\n * for await (const response of datalakeServiceClient.listFileSystems().byPage({ maxPageSize: 20 })) {\n * if (response.fileSystemItems) {\n * for (const fileSystem of response.fileSystemItems) {\n * console.log(`File System ${i++}: ${fileSystem.name}`);\n * }\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```ts snippet:ReadmeSampleListFileSystems_Continuation\n * import { DataLakeServiceClient } from \"@azure/storage-file-datalake\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const account = \"<account>\";\n * const datalakeServiceClient = new DataLakeServiceClient(\n * `https://${account}.dfs.core.windows.net`,\n * new DefaultAzureCredential(),\n * );\n *\n * let i = 1;\n * let fileSystems = datalakeServiceClient.listFileSystems().byPage({ maxPageSize: 2 });\n * let response = (await fileSystems.next()).value;\n * // Prints 2 file systems\n * if (response.fileSystemItems) {\n * for (const fileSystem of response.fileSystemItems) {\n * console.log(`File system ${i++}: ${fileSystem.name}`);\n * }\n * }\n * // Gets next marker\n * let marker = response.continuationToken;\n * // Passing next marker as continuationToken\n * fileSystems = datalakeServiceClient\n * .listFileSystems()\n * .byPage({ continuationToken: marker, maxPageSize: 10 });\n * response = (await fileSystems.next()).value;\n * // Prints 10 file systems\n * if (response.fileSystemItems) {\n * for (const fileSystem of response.fileSystemItems) {\n * console.log(`File system ${i++}: ${fileSystem.name}`);\n * }\n * }\n * ```\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/list-containers2\n *\n * @param options -\n */\n public listFileSystems(\n options: ServiceListFileSystemsOptions = {},\n ): PagedAsyncIterableIterator<FileSystemItem, ServiceListFileSystemsSegmentResponse> {\n return toFileSystemPagedAsyncIterableIterator(this.blobServiceClient.listContainers(options));\n }\n\n // public async createFileSystem(): Promise<DataLakeFileSystemClient> {\n // throw Error(\"NotImplemented\");\n // }\n\n // public async deleteFileSystem(fileSystem: string): Promise<ServiceDeleteFileSystemResponse> {\n // throw Error(\"NotImplemented\");\n // }\n\n /**\n * Only available for DataLakeServiceClient 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(\"b\").toString(),\n ...options,\n },\n this.credential,\n ).toString();\n\n return appendToURLQuery(this.url, sas);\n }\n\n /**\n * Only available for DataLakeServiceClient constructed with a shared key credential.\n *\n * Generates string to sign for an account Shared Access Signature (SAS) based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/create-account-sas\n *\n * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not specified.\n * @param permissions - Specifies the list of permissions to be associated with the SAS.\n * @param resourceTypes - Specifies the resource types associated with the shared access signature.\n * @param options - Optional parameters.\n * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n public generateSasStringToSign(\n expiresOn?: Date,\n permissions: AccountSASPermissions = AccountSASPermissions.parse(\"r\"),\n resourceTypes: string = \"sco\",\n options: ServiceGenerateAccountSasUrlOptions = {},\n ): string {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\n \"Can only generate the account SAS when the client is initialized with a shared key credential\",\n );\n }\n\n if (expiresOn === undefined) {\n const now = new Date();\n expiresOn = new Date(now.getTime() + 3600 * 1000);\n }\n\n return generateAccountSASQueryParametersInternal(\n {\n permissions,\n expiresOn,\n resourceTypes,\n services: AccountSASServices.parse(\"b\").toString(),\n ...options,\n },\n this.credential,\n ).stringToSign;\n }\n\n /**\n * Restore a previously deleted File System.\n * This API is only functional if Container Soft Delete is enabled for the storage account.\n *\n * @param deletedFileSystemName - The name of the source File System.\n * @param deleteFileSystemVersion - The new name of the File System.\n * @param options - Options to configure File System Restore operation.\n */\n public async undeleteFileSystem(\n deletedFileSystemName: string,\n deleteFileSystemVersion: string,\n options: ServiceUndeleteFileSystemOptions = {},\n ): Promise<{\n fileSystemClient: DataLakeFileSystemClient;\n fileSystemUndeleteResponse: FileSystemUndeleteResponse;\n }> {\n return tracingClient.withSpan(\n \"DataLakeServiceClient-undeleteFileSystem\",\n options,\n async (updatedOptions) => {\n const res = await this.blobServiceClient.undeleteContainer(\n deletedFileSystemName,\n deleteFileSystemVersion,\n {\n ...options,\n destinationContainerName: options.destinationFileSystemName,\n tracingOptions: updatedOptions.tracingOptions,\n },\n );\n\n const fileSystemClient = this.getFileSystemClient(\n options.destinationFileSystemName || deletedFileSystemName,\n );\n return {\n fileSystemClient,\n fileSystemUndeleteResponse: res.containerUndeleteResponse,\n };\n },\n );\n }\n\n /**\n * Gets the properties of a storage account’s Blob service endpoint, including properties\n * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.\n * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties\n *\n * @param options - Options to the Service Get Properties operation.\n * @returns Response data for the Service Get Properties operation.\n */\n public async getProperties(\n options: ServiceGetPropertiesOptions = {},\n ): Promise<DataLakeServiceGetPropertiesResponse> {\n return tracingClient.withSpan(\n \"DataLakeServiceClient-getProperties\",\n options,\n async (updatedOptions) => {\n return this.blobServiceClient.getProperties({\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n });\n },\n );\n }\n\n /**\n * Sets properties for a storage account’s Blob 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-blob-service-properties\n *\n * @param properties -\n * @param options - Options to the Service Set Properties operation.\n * @returns Response data for the Service Set Properties operation.\n */\n public async setProperties(\n properties: DataLakeServiceProperties,\n options: ServiceSetPropertiesOptions = {},\n ): Promise<ServiceSetPropertiesResponse> {\n return tracingClient.withSpan(\n \"DataLakeServiceClient-setProperties\",\n options,\n async (updatedOptions) => {\n return this.blobServiceClient.setProperties(properties, {\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n });\n },\n );\n }\n}\n"]}
@@ -1,6 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { __rest } from "tslib";
4
3
  import { convertHttpClient, createRequestPolicyFactoryPolicy, } from "@azure/core-http-compat";
5
4
  import { bearerTokenAuthenticationPolicy, decompressResponsePolicyName, } from "@azure/core-rest-pipeline";
6
5
  import { authorizeRequestOnTenantChallenge, createClientPipeline } from "@azure/core-client";
@@ -12,11 +11,11 @@ import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCreden
12
11
  import { AnonymousCredential } from "@azure/storage-blob";
13
12
  import { StorageOAuthScopes, StorageDataLakeLoggingAllowedHeaderNames, StorageDataLakeLoggingAllowedQueryParameters, SDK_VERSION, } from "./utils/constants.js";
14
13
  import { getCachedDefaultHttpClient, storageRequestFailureDetailsParserPolicy, } from "@azure/storage-common";
15
- import { storageBrowserPolicy } from "@azure/storage-blob";
16
- import { StorageBrowserPolicyFactory } from "@azure/storage-blob";
17
- import { storageCorrectContentLengthPolicy } from "@azure/storage-blob";
18
- import { storageRetryPolicy } from "@azure/storage-blob";
19
- import { storageSharedKeyCredentialPolicy } from "@azure/storage-blob";
14
+ import { storageBrowserPolicy } from "@azure/storage-common";
15
+ import { StorageBrowserPolicyFactory } from "@azure/storage-common";
16
+ import { storageCorrectContentLengthPolicy } from "@azure/storage-common";
17
+ import { storageRetryPolicy } from "@azure/storage-common";
18
+ import { storageSharedKeyCredentialPolicy } from "@azure/storage-common";
20
19
  import { isPipelineLike, Pipeline, } from "@azure/storage-blob";
21
20
  // Export following interfaces and types for customers who want to implement their
22
21
  // own RequestPolicy or HTTPClient
@@ -62,8 +61,7 @@ function processDownlevelPipeline(pipeline) {
62
61
  return undefined;
63
62
  }
64
63
  export function getCoreClientOptions(pipeline) {
65
- var _a;
66
- const _b = pipeline.options, { httpClient: v1Client } = _b, restOptions = __rest(_b, ["httpClient"]);
64
+ const { httpClient: v1Client, ...restOptions } = pipeline.options;
67
65
  let httpClient = pipeline._coreHttpClient;
68
66
  if (!httpClient) {
69
67
  httpClient = v1Client ? convertHttpClient(v1Client) : getCachedDefaultHttpClient();
@@ -75,13 +73,17 @@ export function getCoreClientOptions(pipeline) {
75
73
  const userAgentPrefix = restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix
76
74
  ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}`
77
75
  : `${packageDetails}`;
78
- corePipeline = createClientPipeline(Object.assign(Object.assign({}, restOptions), { loggingOptions: {
76
+ corePipeline = createClientPipeline({
77
+ ...restOptions,
78
+ loggingOptions: {
79
79
  additionalAllowedHeaderNames: StorageDataLakeLoggingAllowedHeaderNames,
80
80
  additionalAllowedQueryParameters: StorageDataLakeLoggingAllowedQueryParameters,
81
81
  logger: logger.info,
82
- }, userAgentOptions: {
82
+ },
83
+ userAgentOptions: {
83
84
  userAgentPrefix,
84
- }, serializationOptions: {
85
+ },
86
+ serializationOptions: {
85
87
  stringifyXML,
86
88
  serializerOptions: {
87
89
  xml: {
@@ -90,7 +92,8 @@ export function getCoreClientOptions(pipeline) {
90
92
  xmlCharKey: "#",
91
93
  },
92
94
  },
93
- }, deserializationOptions: {
95
+ },
96
+ deserializationOptions: {
94
97
  parseXML,
95
98
  serializerOptions: {
96
99
  xml: {
@@ -99,7 +102,8 @@ export function getCoreClientOptions(pipeline) {
99
102
  xmlCharKey: "#",
100
103
  },
101
104
  },
102
- } }));
105
+ },
106
+ });
103
107
  corePipeline.removePolicy({ phase: "Retry" });
104
108
  corePipeline.removePolicy({ name: decompressResponsePolicyName });
105
109
  corePipeline.addPolicy(storageCorrectContentLengthPolicy());
@@ -114,7 +118,7 @@ export function getCoreClientOptions(pipeline) {
114
118
  if (isTokenCredential(credential)) {
115
119
  corePipeline.addPolicy(bearerTokenAuthenticationPolicy({
116
120
  credential,
117
- scopes: (_a = restOptions.audience) !== null && _a !== void 0 ? _a : StorageOAuthScopes,
121
+ scopes: restOptions.audience ?? StorageOAuthScopes,
118
122
  challengeCallbacks: { authorizeRequestOnChallenge: authorizeRequestOnTenantChallenge },
119
123
  }), { phase: "Sign" });
120
124
  }
@@ -126,7 +130,12 @@ export function getCoreClientOptions(pipeline) {
126
130
  }
127
131
  pipeline._corePipeline = corePipeline;
128
132
  }
129
- return Object.assign(Object.assign({}, restOptions), { allowInsecureConnection: true, httpClient, pipeline: corePipeline });
133
+ return {
134
+ ...restOptions,
135
+ allowInsecureConnection: true,
136
+ httpClient,
137
+ pipeline: corePipeline,
138
+ };
130
139
  }
131
140
  export function getCredentialFromPipeline(pipeline) {
132
141
  // see if we squirreled one away on the type itself
@@ -1 +1 @@
1
- {"version":3,"file":"Pipeline.js","sourceRoot":"","sources":["../../src/Pipeline.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAOlC,OAAO,EAQL,iBAAiB,EACjB,gCAAgC,GACjC,MAAM,yBAAyB,CAAC;AAQjC,OAAO,EAEL,+BAA+B,EAC/B,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iCAAiC,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC7F,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EACL,kBAAkB,EAClB,wCAAwC,EACxC,4CAA4C,EAC5C,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,0BAA0B,EAC1B,wCAAwC,GACzC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,iCAAiC,EAAE,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QAClB,CAAC;QACD,SAAS,CAAC,SAA+B;YACvC,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;IACF,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,wBAAwB,CAAC,CAAC;IAChF,MAAM,UAAU,GAAG,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC;IACnD,6EAA6E;IAC7E,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE;QAC5C,OAAO,UAAU,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n KeepAliveOptions,\n ExtendedServiceClientOptions,\n HttpPipelineLogLevel,\n} from \"@azure/core-http-compat\";\nimport {\n CompatResponse as HttpOperationResponse,\n RequestPolicy as IHttpClient,\n HttpHeadersLike as HttpHeaders,\n RequestPolicy,\n RequestPolicyFactory,\n RequestPolicyOptionsLike as RequestPolicyOptions,\n WebResourceLike as WebResource,\n convertHttpClient,\n createRequestPolicyFactoryPolicy,\n} from \"@azure/core-http-compat\";\nimport type {\n ProxySettings as ProxyOptions,\n UserAgentPolicyOptions as UserAgentOptions,\n Pipeline as CorePipeline,\n PipelinePolicy,\n HttpClient,\n} from \"@azure/core-rest-pipeline\";\nimport {\n RequestBodyType as HttpRequestBody,\n bearerTokenAuthenticationPolicy,\n decompressResponsePolicyName,\n} from \"@azure/core-rest-pipeline\";\nimport { authorizeRequestOnTenantChallenge, createClientPipeline } from \"@azure/core-client\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\n\nimport { logger } from \"./log.js\";\nimport type { StorageRetryOptions } from \"@azure/storage-blob\";\nimport { StorageRetryPolicyFactory } from \"@azure/storage-blob\";\nimport { StorageSharedKeyCredential } from \"./credentials/StorageSharedKeyCredential.js\";\nimport { AnonymousCredential } from \"@azure/storage-blob\";\nimport {\n StorageOAuthScopes,\n StorageDataLakeLoggingAllowedHeaderNames,\n StorageDataLakeLoggingAllowedQueryParameters,\n SDK_VERSION,\n} from \"./utils/constants.js\";\nimport {\n getCachedDefaultHttpClient,\n storageRequestFailureDetailsParserPolicy,\n} from \"@azure/storage-common\";\nimport { storageBrowserPolicy } from \"@azure/storage-blob\";\nimport { StorageBrowserPolicyFactory } from \"@azure/storage-blob\";\nimport { storageCorrectContentLengthPolicy } from \"@azure/storage-blob\";\nimport { storageRetryPolicy } from \"@azure/storage-blob\";\nimport { storageSharedKeyCredentialPolicy } from \"@azure/storage-blob\";\nimport {\n ServiceClientOptions,\n PipelineOptions,\n PipelineLike,\n isPipelineLike,\n Pipeline,\n} from \"@azure/storage-blob\";\n\n// Export following interfaces and types for customers who want to implement their\n// own RequestPolicy or HTTPClient\nexport {\n StorageOAuthScopes,\n IHttpClient,\n HttpHeaders,\n HttpRequestBody,\n HttpOperationResponse,\n WebResource,\n RequestPolicyFactory,\n RequestPolicy,\n RequestPolicyOptions,\n ServiceClientOptions,\n PipelineOptions,\n PipelineLike,\n Pipeline,\n isPipelineLike,\n};\n\n/**\n * Options interface for the {@link newPipeline} function.\n */\nexport interface StoragePipelineOptions {\n /**\n * Options to configure a proxy for outgoing requests.\n */\n proxyOptions?: ProxyOptions;\n /**\n * Options for adding user agent details to outgoing requests.\n */\n userAgentOptions?: UserAgentOptions;\n /**\n * Configures the built-in retry policy behavior.\n */\n retryOptions?: StorageRetryOptions;\n /**\n * Keep alive configurations. Default keep-alive is enabled.\n */\n keepAliveOptions?: KeepAliveOptions;\n /**\n * Configures the HTTP client to send requests and receive responses.\n */\n httpClient?: IHttpClient;\n /**\n * The audience used to retrieve an AAD token.\n * By default, audience 'https://storage.azure.com/.default' will be used.\n */\n audience?: string;\n}\n\n/**\n * Creates a new Pipeline object with Credential provided.\n *\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param pipelineOptions - Optional. Options.\n * @returns A new Pipeline object.\n */\nexport function newPipeline(\n credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n pipelineOptions: StoragePipelineOptions = {},\n): Pipeline {\n if (!credential) {\n credential = new AnonymousCredential();\n }\n const pipeline = new Pipeline([], pipelineOptions);\n (pipeline as any)._credential = credential;\n return pipeline;\n}\n\nfunction processDownlevelPipeline(\n pipeline: PipelineLike,\n): { wrappedPolicies: PipelinePolicy; afterRetry: boolean } | undefined {\n const knownFactoryFunctions = [\n isAnonymousCredential,\n isStorageSharedKeyCredential,\n isCoreHttpBearerTokenFactory,\n isStorageBrowserPolicyFactory,\n isStorageRetryPolicyFactory,\n isStorageTelemetryPolicyFactory,\n isCoreHttpPolicyFactory,\n ];\n if (pipeline.factories.length) {\n const novelFactories = pipeline.factories.filter((factory) => {\n return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory));\n });\n if (novelFactories.length) {\n const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory));\n // if there are any left over, wrap in a requestPolicyFactoryPolicy\n return {\n wrappedPolicies: createRequestPolicyFactoryPolicy(novelFactories),\n afterRetry: hasInjector,\n };\n }\n }\n return undefined;\n}\n\nexport function getCoreClientOptions(pipeline: PipelineLike): ExtendedServiceClientOptions {\n const { httpClient: v1Client, ...restOptions } = pipeline.options as StoragePipelineOptions;\n\n let httpClient: HttpClient = (pipeline as any)._coreHttpClient;\n if (!httpClient) {\n httpClient = v1Client ? convertHttpClient(v1Client) : getCachedDefaultHttpClient();\n (pipeline as any)._coreHttpClient = httpClient;\n }\n\n let corePipeline: CorePipeline = (pipeline as any)._corePipeline;\n if (!corePipeline) {\n const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`;\n const userAgentPrefix =\n restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix\n ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n corePipeline = createClientPipeline({\n ...restOptions,\n loggingOptions: {\n additionalAllowedHeaderNames: StorageDataLakeLoggingAllowedHeaderNames,\n additionalAllowedQueryParameters: StorageDataLakeLoggingAllowedQueryParameters,\n logger: logger.info,\n },\n userAgentOptions: {\n userAgentPrefix,\n },\n serializationOptions: {\n stringifyXML,\n serializerOptions: {\n xml: {\n // Use customized XML char key of \"#\" so we can deserialize metadata\n // with \"_\" key\n xmlCharKey: \"#\",\n },\n },\n },\n deserializationOptions: {\n parseXML,\n serializerOptions: {\n xml: {\n // Use customized XML char key of \"#\" so we can deserialize metadata\n // with \"_\" key\n xmlCharKey: \"#\",\n },\n },\n },\n });\n corePipeline.removePolicy({ phase: \"Retry\" });\n corePipeline.removePolicy({ name: decompressResponsePolicyName });\n corePipeline.addPolicy(storageCorrectContentLengthPolicy());\n corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: \"Retry\" });\n corePipeline.addPolicy(storageRequestFailureDetailsParserPolicy());\n corePipeline.addPolicy(storageBrowserPolicy());\n const downlevelResults = processDownlevelPipeline(pipeline);\n if (downlevelResults) {\n corePipeline.addPolicy(\n downlevelResults.wrappedPolicies,\n downlevelResults.afterRetry ? { afterPhase: \"Retry\" } : undefined,\n );\n }\n const credential = getCredentialFromPipeline(pipeline);\n if (isTokenCredential(credential)) {\n corePipeline.addPolicy(\n bearerTokenAuthenticationPolicy({\n credential,\n scopes: restOptions.audience ?? StorageOAuthScopes,\n challengeCallbacks: { authorizeRequestOnChallenge: authorizeRequestOnTenantChallenge },\n }),\n { phase: \"Sign\" },\n );\n } else if (credential instanceof StorageSharedKeyCredential) {\n corePipeline.addPolicy(\n storageSharedKeyCredentialPolicy({\n accountName: credential.accountName,\n accountKey: (credential as any).accountKey,\n }),\n { phase: \"Sign\" },\n );\n }\n (pipeline as any)._corePipeline = corePipeline;\n }\n return {\n ...restOptions,\n allowInsecureConnection: true,\n httpClient,\n pipeline: corePipeline,\n };\n}\n\nexport function getCredentialFromPipeline(\n pipeline: PipelineLike,\n): StorageSharedKeyCredential | AnonymousCredential | TokenCredential {\n // see if we squirreled one away on the type itself\n if ((pipeline as any)._credential) {\n return (pipeline as any)._credential;\n }\n // if it came from another package, loop over the factories and look for one like before\n let credential = new AnonymousCredential();\n for (const factory of pipeline.factories) {\n if (isTokenCredential((factory as any).credential)) {\n // Only works if the factory has been attached a \"credential\" property.\n // We do that in newPipeline() when using TokenCredential.\n credential = (factory as any).credential;\n } else if (isStorageSharedKeyCredential(factory)) {\n return factory;\n }\n }\n return credential;\n}\n\nfunction isStorageSharedKeyCredential(\n factory: RequestPolicyFactory,\n): factory is StorageSharedKeyCredential {\n if (factory instanceof StorageSharedKeyCredential) {\n return true;\n }\n return factory.constructor.name === \"StorageSharedKeyCredential\";\n}\n\nfunction isAnonymousCredential(factory: RequestPolicyFactory): factory is AnonymousCredential {\n if (factory instanceof AnonymousCredential) {\n return true;\n }\n return factory.constructor.name === \"AnonymousCredential\";\n}\n\nfunction isCoreHttpBearerTokenFactory(factory: RequestPolicyFactory): boolean {\n return isTokenCredential((factory as any).credential);\n}\n\nfunction isStorageBrowserPolicyFactory(\n factory: RequestPolicyFactory,\n): factory is StorageBrowserPolicyFactory {\n if (factory instanceof StorageBrowserPolicyFactory) {\n return true;\n }\n return factory.constructor.name === \"StorageBrowserPolicyFactory\";\n}\n\nfunction isStorageRetryPolicyFactory(\n factory: RequestPolicyFactory,\n): factory is StorageRetryPolicyFactory {\n if (factory instanceof StorageRetryPolicyFactory) {\n return true;\n }\n return factory.constructor.name === \"StorageRetryPolicyFactory\";\n}\n\nfunction isStorageTelemetryPolicyFactory(factory: RequestPolicyFactory): boolean {\n return factory.constructor.name === \"TelemetryPolicyFactory\";\n}\n\nfunction isInjectorPolicyFactory(factory: RequestPolicyFactory): boolean {\n return factory.constructor.name === \"InjectorPolicyFactory\";\n}\n\nfunction isCoreHttpPolicyFactory(factory: RequestPolicyFactory): boolean {\n const knownPolicies = [\n \"GenerateClientRequestIdPolicy\",\n \"TracingPolicy\",\n \"LogPolicy\",\n \"ProxyPolicy\",\n \"DisableResponseDecompressionPolicy\",\n \"KeepAlivePolicy\",\n \"DeserializationPolicy\",\n ];\n\n const mockHttpClient: IHttpClient = {\n sendRequest: async (request: WebResource) => {\n return {\n request,\n headers: request.headers.clone(),\n status: 500,\n };\n },\n };\n const mockRequestPolicyOptions: RequestPolicyOptions = {\n log(_logLevel: HttpPipelineLogLevel, _message: string): void {\n /* do nothing */\n },\n shouldLog(_logLevel: HttpPipelineLogLevel): boolean {\n return false;\n },\n };\n const policyInstance = factory.create(mockHttpClient, mockRequestPolicyOptions);\n const policyName = policyInstance.constructor.name;\n // bundlers sometimes add a custom suffix to the class name to make it unique\n return knownPolicies.some((knownPolicyName) => {\n return policyName.startsWith(knownPolicyName);\n });\n}\n"]}
1
+ {"version":3,"file":"Pipeline.js","sourceRoot":"","sources":["../../src/Pipeline.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAQL,iBAAiB,EACjB,gCAAgC,GACjC,MAAM,yBAAyB,CAAC;AAQjC,OAAO,EAEL,+BAA+B,EAC/B,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iCAAiC,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC7F,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EACL,kBAAkB,EAClB,wCAAw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AClC,WAAW,EAAE,KAAK,EAAE,OAAoB,EAAE,EAAE;YAC1C,OAAO;gBACL,OAAO;gBACP,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE;gBAChC,MAAM,EAAE,GAAG;aACZ,CAAC;QACJ,CAAC;KACF,CAAC;IACF,MAAM,wBAAwB,GAAyB;QACrD,GAAG,CAAC,SAA+B,EAAE,QAAgB;YACnD,gBAAgB;QAClB,CAAC;QACD,SAAS,CAAC,SAA+B;YACvC,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;IACF,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,wBAAwB,CAAC,CAAC;IAChF,MAAM,UAAU,GAAG,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC;IACnD,6EAA6E;IAC7E,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE;QAC5C,OAAO,UAAU,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n KeepAliveOptions,\n ExtendedServiceClientOptions,\n HttpPipelineLogLevel,\n} from \"@azure/core-http-compat\";\nimport {\n CompatResponse as HttpOperationResponse,\n RequestPolicy as IHttpClient,\n HttpHeadersLike as HttpHeaders,\n RequestPolicy,\n RequestPolicyFactory,\n RequestPolicyOptionsLike as RequestPolicyOptions,\n WebResourceLike as WebResource,\n convertHttpClient,\n createRequestPolicyFactoryPolicy,\n} from \"@azure/core-http-compat\";\nimport type {\n ProxySettings as ProxyOptions,\n UserAgentPolicyOptions as UserAgentOptions,\n Pipeline as CorePipeline,\n PipelinePolicy,\n HttpClient,\n} from \"@azure/core-rest-pipeline\";\nimport {\n RequestBodyType as HttpRequestBody,\n bearerTokenAuthenticationPolicy,\n decompressResponsePolicyName,\n} from \"@azure/core-rest-pipeline\";\nimport { authorizeRequestOnTenantChallenge, createClientPipeline } from \"@azure/core-client\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\n\nimport { logger } from \"./log.js\";\nimport type { StorageRetryOptions } from \"@azure/storage-blob\";\nimport { StorageRetryPolicyFactory } from \"@azure/storage-blob\";\nimport { StorageSharedKeyCredential } from \"./credentials/StorageSharedKeyCredential.js\";\nimport { AnonymousCredential } from \"@azure/storage-blob\";\nimport {\n StorageOAuthScopes,\n StorageDataLakeLoggingAllowedHeaderNames,\n StorageDataLakeLoggingAllowedQueryParameters,\n SDK_VERSION,\n} from \"./utils/constants.js\";\nimport {\n getCachedDefaultHttpClient,\n storageRequestFailureDetailsParserPolicy,\n} from \"@azure/storage-common\";\nimport { storageBrowserPolicy } from \"@azure/storage-common\";\nimport { StorageBrowserPolicyFactory } from \"@azure/storage-common\";\nimport { storageCorrectContentLengthPolicy } from \"@azure/storage-common\";\nimport { storageRetryPolicy } from \"@azure/storage-common\";\nimport { storageSharedKeyCredentialPolicy } from \"@azure/storage-common\";\nimport {\n ServiceClientOptions,\n PipelineOptions,\n PipelineLike,\n isPipelineLike,\n Pipeline,\n} from \"@azure/storage-blob\";\n\n// Export following interfaces and types for customers who want to implement their\n// own RequestPolicy or HTTPClient\nexport {\n StorageOAuthScopes,\n IHttpClient,\n HttpHeaders,\n HttpRequestBody,\n HttpOperationResponse,\n WebResource,\n RequestPolicyFactory,\n RequestPolicy,\n RequestPolicyOptions,\n ServiceClientOptions,\n PipelineOptions,\n PipelineLike,\n Pipeline,\n isPipelineLike,\n};\n\n/**\n * Options interface for the {@link newPipeline} function.\n */\nexport interface StoragePipelineOptions {\n /**\n * Options to configure a proxy for outgoing requests.\n */\n proxyOptions?: ProxyOptions;\n /**\n * Options for adding user agent details to outgoing requests.\n */\n userAgentOptions?: UserAgentOptions;\n /**\n * Configures the built-in retry policy behavior.\n */\n retryOptions?: StorageRetryOptions;\n /**\n * Keep alive configurations. Default keep-alive is enabled.\n */\n keepAliveOptions?: KeepAliveOptions;\n /**\n * Configures the HTTP client to send requests and receive responses.\n */\n httpClient?: IHttpClient;\n /**\n * The audience used to retrieve an AAD token.\n * By default, audience 'https://storage.azure.com/.default' will be used.\n */\n audience?: string;\n}\n\n/**\n * Creates a new Pipeline object with Credential provided.\n *\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param pipelineOptions - Optional. Options.\n * @returns A new Pipeline object.\n */\nexport function newPipeline(\n credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n pipelineOptions: StoragePipelineOptions = {},\n): Pipeline {\n if (!credential) {\n credential = new AnonymousCredential();\n }\n const pipeline = new Pipeline([], pipelineOptions);\n (pipeline as any)._credential = credential;\n return pipeline;\n}\n\nfunction processDownlevelPipeline(\n pipeline: PipelineLike,\n): { wrappedPolicies: PipelinePolicy; afterRetry: boolean } | undefined {\n const knownFactoryFunctions = [\n isAnonymousCredential,\n isStorageSharedKeyCredential,\n isCoreHttpBearerTokenFactory,\n isStorageBrowserPolicyFactory,\n isStorageRetryPolicyFactory,\n isStorageTelemetryPolicyFactory,\n isCoreHttpPolicyFactory,\n ];\n if (pipeline.factories.length) {\n const novelFactories = pipeline.factories.filter((factory) => {\n return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory));\n });\n if (novelFactories.length) {\n const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory));\n // if there are any left over, wrap in a requestPolicyFactoryPolicy\n return {\n wrappedPolicies: createRequestPolicyFactoryPolicy(novelFactories),\n afterRetry: hasInjector,\n };\n }\n }\n return undefined;\n}\n\nexport function getCoreClientOptions(pipeline: PipelineLike): ExtendedServiceClientOptions {\n const { httpClient: v1Client, ...restOptions } = pipeline.options as StoragePipelineOptions;\n\n let httpClient: HttpClient = (pipeline as any)._coreHttpClient;\n if (!httpClient) {\n httpClient = v1Client ? convertHttpClient(v1Client) : getCachedDefaultHttpClient();\n (pipeline as any)._coreHttpClient = httpClient;\n }\n\n let corePipeline: CorePipeline = (pipeline as any)._corePipeline;\n if (!corePipeline) {\n const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`;\n const userAgentPrefix =\n restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix\n ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n corePipeline = createClientPipeline({\n ...restOptions,\n loggingOptions: {\n additionalAllowedHeaderNames: StorageDataLakeLoggingAllowedHeaderNames,\n additionalAllowedQueryParameters: StorageDataLakeLoggingAllowedQueryParameters,\n logger: logger.info,\n },\n userAgentOptions: {\n userAgentPrefix,\n },\n serializationOptions: {\n stringifyXML,\n serializerOptions: {\n xml: {\n // Use customized XML char key of \"#\" so we can deserialize metadata\n // with \"_\" key\n xmlCharKey: \"#\",\n },\n },\n },\n deserializationOptions: {\n parseXML,\n serializerOptions: {\n xml: {\n // Use customized XML char key of \"#\" so we can deserialize metadata\n // with \"_\" key\n xmlCharKey: \"#\",\n },\n },\n },\n });\n corePipeline.removePolicy({ phase: \"Retry\" });\n corePipeline.removePolicy({ name: decompressResponsePolicyName });\n corePipeline.addPolicy(storageCorrectContentLengthPolicy());\n corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: \"Retry\" });\n corePipeline.addPolicy(storageRequestFailureDetailsParserPolicy());\n corePipeline.addPolicy(storageBrowserPolicy());\n const downlevelResults = processDownlevelPipeline(pipeline);\n if (downlevelResults) {\n corePipeline.addPolicy(\n downlevelResults.wrappedPolicies,\n downlevelResults.afterRetry ? { afterPhase: \"Retry\" } : undefined,\n );\n }\n const credential = getCredentialFromPipeline(pipeline);\n if (isTokenCredential(credential)) {\n corePipeline.addPolicy(\n bearerTokenAuthenticationPolicy({\n credential,\n scopes: restOptions.audience ?? StorageOAuthScopes,\n challengeCallbacks: { authorizeRequestOnChallenge: authorizeRequestOnTenantChallenge },\n }),\n { phase: \"Sign\" },\n );\n } else if (credential instanceof StorageSharedKeyCredential) {\n corePipeline.addPolicy(\n storageSharedKeyCredentialPolicy({\n accountName: credential.accountName,\n accountKey: (credential as any).accountKey,\n }),\n { phase: \"Sign\" },\n );\n }\n (pipeline as any)._corePipeline = corePipeline;\n }\n return {\n ...restOptions,\n allowInsecureConnection: true,\n httpClient,\n pipeline: corePipeline,\n };\n}\n\nexport function getCredentialFromPipeline(\n pipeline: PipelineLike,\n): StorageSharedKeyCredential | AnonymousCredential | TokenCredential {\n // see if we squirreled one away on the type itself\n if ((pipeline as any)._credential) {\n return (pipeline as any)._credential;\n }\n // if it came from another package, loop over the factories and look for one like before\n let credential = new AnonymousCredential();\n for (const factory of pipeline.factories) {\n if (isTokenCredential((factory as any).credential)) {\n // Only works if the factory has been attached a \"credential\" property.\n // We do that in newPipeline() when using TokenCredential.\n credential = (factory as any).credential;\n } else if (isStorageSharedKeyCredential(factory)) {\n return factory;\n }\n }\n return credential;\n}\n\nfunction isStorageSharedKeyCredential(\n factory: RequestPolicyFactory,\n): factory is StorageSharedKeyCredential {\n if (factory instanceof StorageSharedKeyCredential) {\n return true;\n }\n return factory.constructor.name === \"StorageSharedKeyCredential\";\n}\n\nfunction isAnonymousCredential(factory: RequestPolicyFactory): factory is AnonymousCredential {\n if (factory instanceof AnonymousCredential) {\n return true;\n }\n return factory.constructor.name === \"AnonymousCredential\";\n}\n\nfunction isCoreHttpBearerTokenFactory(factory: RequestPolicyFactory): boolean {\n return isTokenCredential((factory as any).credential);\n}\n\nfunction isStorageBrowserPolicyFactory(\n factory: RequestPolicyFactory,\n): factory is StorageBrowserPolicyFactory {\n if (factory instanceof StorageBrowserPolicyFactory) {\n return true;\n }\n return factory.constructor.name === \"StorageBrowserPolicyFactory\";\n}\n\nfunction isStorageRetryPolicyFactory(\n factory: RequestPolicyFactory,\n): factory is StorageRetryPolicyFactory {\n if (factory instanceof StorageRetryPolicyFactory) {\n return true;\n }\n return factory.constructor.name === \"StorageRetryPolicyFactory\";\n}\n\nfunction isStorageTelemetryPolicyFactory(factory: RequestPolicyFactory): boolean {\n return factory.constructor.name === \"TelemetryPolicyFactory\";\n}\n\nfunction isInjectorPolicyFactory(factory: RequestPolicyFactory): boolean {\n return factory.constructor.name === \"InjectorPolicyFactory\";\n}\n\nfunction isCoreHttpPolicyFactory(factory: RequestPolicyFactory): boolean {\n const knownPolicies = [\n \"GenerateClientRequestIdPolicy\",\n \"TracingPolicy\",\n \"LogPolicy\",\n \"ProxyPolicy\",\n \"DisableResponseDecompressionPolicy\",\n \"KeepAlivePolicy\",\n \"DeserializationPolicy\",\n ];\n\n const mockHttpClient: IHttpClient = {\n sendRequest: async (request: WebResource) => {\n return {\n request,\n headers: request.headers.clone(),\n status: 500,\n };\n },\n };\n const mockRequestPolicyOptions: RequestPolicyOptions = {\n log(_logLevel: HttpPipelineLogLevel, _message: string): void {\n /* do nothing */\n },\n shouldLog(_logLevel: HttpPipelineLogLevel): boolean {\n return false;\n },\n };\n const policyInstance = factory.create(mockHttpClient, mockRequestPolicyOptions);\n const policyName = policyInstance.constructor.name;\n // bundlers sometimes add a custom suffix to the class name to make it unique\n return knownPolicies.some((knownPolicyName) => {\n return policyName.startsWith(knownPolicyName);\n });\n}\n"]}
@@ -1,13 +1,12 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { __rest } from "tslib";
4
3
  import { StorageContextClient } from "./StorageContextClient.js";
5
4
  import { BlobServiceClient } from "@azure/storage-blob";
6
5
  import { toBlobEndpointUrl, toDfsEndpointUrl } from "./transforms.js";
7
6
  import { escapeURLPath, getAccountNameFromUrl, getURLScheme, iEqual, } from "./utils/utils.common.js";
8
7
  // This function relies on the Pipeline already being initialized by a storage-blob client
9
8
  function getCoreClientOptions(pipeline) {
10
- const _a = pipeline.options, { httpClient: v1Client } = _a, restOptions = __rest(_a, ["httpClient"]);
9
+ const { httpClient: v1Client, ...restOptions } = pipeline.options;
11
10
  const httpClient = pipeline._coreHttpClient;
12
11
  if (!httpClient) {
13
12
  throw new Error("Pipeline not correctly initialized; missing V2 HttpClient");
@@ -16,13 +15,54 @@ function getCoreClientOptions(pipeline) {
16
15
  if (!corePipeline) {
17
16
  throw new Error("Pipeline not correctly initialized; missing V2 Pipeline");
18
17
  }
19
- return Object.assign(Object.assign({}, restOptions), { allowInsecureConnection: true, httpClient, pipeline: corePipeline });
18
+ return {
19
+ ...restOptions,
20
+ allowInsecureConnection: true,
21
+ httpClient,
22
+ pipeline: corePipeline,
23
+ };
20
24
  }
21
25
  /**
22
26
  * A StorageClient represents a based URL class for {@link BlobServiceClient}, {@link ContainerClient}
23
27
  * and etc.
24
28
  */
25
29
  export class StorageClient {
30
+ /**
31
+ * Encoded URL string value.
32
+ */
33
+ url;
34
+ accountName;
35
+ /**
36
+ * Encoded URL string value for corresponding blob endpoint.
37
+ */
38
+ blobEndpointUrl;
39
+ /**
40
+ * Encoded URL string value for corresponding dfs endpoint.
41
+ */
42
+ dfsEndpointUrl;
43
+ /**
44
+ * Request policy pipeline.
45
+ *
46
+ * @internal
47
+ */
48
+ pipeline;
49
+ /**
50
+ * Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.
51
+ */
52
+ credential;
53
+ /**
54
+ * StorageClient is a reference to protocol layer operations entry, which is
55
+ * generated by AutoRest generator.
56
+ */
57
+ storageClientContext;
58
+ /**
59
+ * storageClientContextWithBlobEndpoint is a reference to protocol layer operations entry, which is
60
+ * generated by AutoRest generator, with its url pointing to the Blob endpoint.
61
+ */
62
+ storageClientContextToBlobEndpoint;
63
+ /**
64
+ */
65
+ isHttps;
26
66
  /**
27
67
  * Creates an instance of StorageClient.
28
68
  * @param url - url to resource
@@ -1 +1 @@
1
- {"version":3,"file":"StorageClient.js","sourceRoot":"","sources":["../../src/StorageClient.ts"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AAI,CAAC,eAAe,CAAC,CAAC;QAC/D,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,qGAAqG;QACrG,MAAM,UAAU,GAAG,IAAI,iBAAiB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACxD,IAAI,CAAC,oBAAoB,GAAG,IAAI,oBAAoB,CAClD,IAAI,CAAC,cAAc,EACnB,oBAAoB,CAAC,QAAQ,CAAC,CAC/B,CAAC;QAEF,IAAI,CAAC,kCAAkC,GAAG,IAAI,oBAAoB,CAChE,IAAI,CAAC,eAAe,EACpB,oBAAoB,CAAC,QAAQ,CAAC,CAC/B,CAAC;QAEF,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;QAE7D,IAAI,CAAC,UAAU,GAAI,UAAkB,CAAC,UAAU,CAAC;QAEjD,iDAAiD;QACjD,MAAM,oBAAoB,GAAG,IAAI,CAAC,oBAA2B,CAAC;QAC9D,oBAAoB,CAAC,kBAAkB,GAAG,SAAS,CAAC;QACpD,MAAM,oCAAoC,GAAG,IAAI,CAAC,kCAAyC,CAAC;QAC5F,oCAAoC,CAAC,kBAAkB,GAAG,SAAS,CAAC;IACtE,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { StorageContextClient } from \"./StorageContextClient.js\";\nimport type { StorageClient as StorageClientContext } from \"./generated/src/index.js\";\nimport type { Pipeline, PipelineLike, StoragePipelineOptions } from \"./Pipeline.js\";\nimport type { AnonymousCredential } from \"@azure/storage-blob\";\nimport { BlobServiceClient } from \"@azure/storage-blob\";\nimport type { StorageSharedKeyCredential } from \"@azure/storage-blob\";\nimport { toBlobEndpointUrl, toDfsEndpointUrl } from \"./transforms.js\";\nimport {\n escapeURLPath,\n getAccountNameFromUrl,\n getURLScheme,\n iEqual,\n} from \"./utils/utils.common.js\";\nimport type { ExtendedServiceClientOptions } from \"@azure/core-http-compat\";\nimport type { HttpClient, Pipeline as CorePipeline } from \"@azure/core-rest-pipeline\";\nimport type { OperationTracingOptions } from \"@azure/core-tracing\";\n\n/**\n * An interface for options common to every remote operation.\n */\nexport interface CommonOptions {\n tracingOptions?: OperationTracingOptions;\n}\n\n// This function relies on the Pipeline already being initialized by a storage-blob client\nfunction getCoreClientOptions(pipeline: Pipeline): ExtendedServiceClientOptions {\n const { httpClient: v1Client, ...restOptions } = pipeline.options as StoragePipelineOptions;\n const httpClient: HttpClient = (pipeline as any)._coreHttpClient;\n if (!httpClient) {\n throw new Error(\"Pipeline not correctly initialized; missing V2 HttpClient\");\n }\n\n const corePipeline: CorePipeline = (pipeline as any)._corePipeline;\n if (!corePipeline) {\n throw new Error(\"Pipeline not correctly initialized; missing V2 Pipeline\");\n }\n return {\n ...restOptions,\n allowInsecureConnection: true,\n httpClient,\n pipeline: corePipeline,\n };\n}\n\n/**\n * A StorageClient represents a based URL class for {@link BlobServiceClient}, {@link ContainerClient}\n * and etc.\n */\nexport abstract class StorageClient {\n /**\n * Encoded URL string value.\n */\n public readonly url: string;\n\n public readonly accountName: string;\n\n /**\n * Encoded URL string value for corresponding blob endpoint.\n */\n protected readonly blobEndpointUrl: string;\n\n /**\n * Encoded URL string value for corresponding dfs endpoint.\n */\n protected readonly dfsEndpointUrl: string;\n\n /**\n * Request policy pipeline.\n *\n * @internal\n */\n protected readonly pipeline: Pipeline;\n\n /**\n * Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n */\n public 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 * storageClientContextWithBlobEndpoint is a reference to protocol layer operations entry, which is\n * generated by AutoRest generator, with its url pointing to the Blob endpoint.\n */\n protected readonly storageClientContextToBlobEndpoint: StorageClientContext;\n\n /**\n */\n protected readonly isHttps: boolean;\n\n /**\n * Creates an instance of StorageClient.\n * @param url - url to resource\n * @param pipeline - request policy pipeline.\n */\n protected constructor(url: string, pipeline: PipelineLike) {\n // URL should be encoded and only once, protocol layer shouldn't encode URL again\n this.url = escapeURLPath(url);\n this.blobEndpointUrl = toBlobEndpointUrl(this.url);\n this.dfsEndpointUrl = toDfsEndpointUrl(this.url);\n this.accountName = getAccountNameFromUrl(this.blobEndpointUrl);\n this.pipeline = pipeline;\n // creating this BlobServiceClient allows us to use the converted V2 Pipeline attached to `pipeline`.\n const blobClient = new BlobServiceClient(url, pipeline);\n this.storageClientContext = new StorageContextClient(\n this.dfsEndpointUrl,\n getCoreClientOptions(pipeline),\n );\n\n this.storageClientContextToBlobEndpoint = new StorageContextClient(\n this.blobEndpointUrl,\n getCoreClientOptions(pipeline),\n );\n\n this.isHttps = iEqual(getURLScheme(this.url) || \"\", \"https\");\n\n this.credential = (blobClient as any).credential;\n\n // Override protocol layer's default content-type\n const storageClientContext = this.storageClientContext as any;\n storageClientContext.requestContentType = undefined;\n const storageClientContextWithBlobEndpoint = this.storageClientContextToBlobEndpoint as any;\n storageClientContextWithBlobEndpoint.requestContentType = undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"StorageClient.js","sourceRoot":"","sources":["../../src/StorageClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAIjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,YAAY,EACZ,MAAM,GACP,MAAM,yBAAyB,CAAC;AAYjC,0FAA0F;AAC1F,SAAS,oBAA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QAAQ,CAAC;QACzB,qGAAqG;QACrG,MAAM,UAAU,GAAG,IAAI,iBAAiB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACxD,IAAI,CAAC,oBAAoB,GAAG,IAAI,oBAAoB,CAClD,IAAI,CAAC,cAAc,EACnB,oBAAoB,CAAC,QAAQ,CAAC,CAC/B,CAAC;QAEF,IAAI,CAAC,kCAAkC,GAAG,IAAI,oBAAoB,CAChE,IAAI,CAAC,eAAe,EACpB,oBAAoB,CAAC,QAAQ,CAAC,CAC/B,CAAC;QAEF,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;QAE7D,IAAI,CAAC,UAAU,GAAI,UAAkB,CAAC,UAAU,CAAC;QAEjD,iDAAiD;QACjD,MAAM,oBAAoB,GAAG,IAAI,CAAC,oBAA2B,CAAC;QAC9D,oBAAoB,CAAC,kBAAkB,GAAG,SAAS,CAAC;QACpD,MAAM,oCAAoC,GAAG,IAAI,CAAC,kCAAyC,CAAC;QAC5F,oCAAoC,CAAC,kBAAkB,GAAG,SAAS,CAAC;IACtE,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { StorageContextClient } from \"./StorageContextClient.js\";\nimport type { StorageClient as StorageClientContext } from \"./generated/src/index.js\";\nimport type { Pipeline, PipelineLike, StoragePipelineOptions } from \"./Pipeline.js\";\nimport type { AnonymousCredential } from \"@azure/storage-blob\";\nimport { BlobServiceClient } from \"@azure/storage-blob\";\nimport type { StorageSharedKeyCredential } from \"@azure/storage-blob\";\nimport { toBlobEndpointUrl, toDfsEndpointUrl } from \"./transforms.js\";\nimport {\n escapeURLPath,\n getAccountNameFromUrl,\n getURLScheme,\n iEqual,\n} from \"./utils/utils.common.js\";\nimport type { ExtendedServiceClientOptions } from \"@azure/core-http-compat\";\nimport type { HttpClient, Pipeline as CorePipeline } from \"@azure/core-rest-pipeline\";\nimport type { OperationTracingOptions } from \"@azure/core-tracing\";\n\n/**\n * An interface for options common to every remote operation.\n */\nexport interface CommonOptions {\n tracingOptions?: OperationTracingOptions;\n}\n\n// This function relies on the Pipeline already being initialized by a storage-blob client\nfunction getCoreClientOptions(pipeline: Pipeline): ExtendedServiceClientOptions {\n const { httpClient: v1Client, ...restOptions } = pipeline.options as StoragePipelineOptions;\n const httpClient: HttpClient = (pipeline as any)._coreHttpClient;\n if (!httpClient) {\n throw new Error(\"Pipeline not correctly initialized; missing V2 HttpClient\");\n }\n\n const corePipeline: CorePipeline = (pipeline as any)._corePipeline;\n if (!corePipeline) {\n throw new Error(\"Pipeline not correctly initialized; missing V2 Pipeline\");\n }\n return {\n ...restOptions,\n allowInsecureConnection: true,\n httpClient,\n pipeline: corePipeline,\n };\n}\n\n/**\n * A StorageClient represents a based URL class for {@link BlobServiceClient}, {@link ContainerClient}\n * and etc.\n */\nexport abstract class StorageClient {\n /**\n * Encoded URL string value.\n */\n public readonly url: string;\n\n public readonly accountName: string;\n\n /**\n * Encoded URL string value for corresponding blob endpoint.\n */\n protected readonly blobEndpointUrl: string;\n\n /**\n * Encoded URL string value for corresponding dfs endpoint.\n */\n protected readonly dfsEndpointUrl: string;\n\n /**\n * Request policy pipeline.\n *\n * @internal\n */\n protected readonly pipeline: Pipeline;\n\n /**\n * Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n */\n public 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 * storageClientContextWithBlobEndpoint is a reference to protocol layer operations entry, which is\n * generated by AutoRest generator, with its url pointing to the Blob endpoint.\n */\n protected readonly storageClientContextToBlobEndpoint: StorageClientContext;\n\n /**\n */\n protected readonly isHttps: boolean;\n\n /**\n * Creates an instance of StorageClient.\n * @param url - url to resource\n * @param pipeline - request policy pipeline.\n */\n protected constructor(url: string, pipeline: PipelineLike) {\n // URL should be encoded and only once, protocol layer shouldn't encode URL again\n this.url = escapeURLPath(url);\n this.blobEndpointUrl = toBlobEndpointUrl(this.url);\n this.dfsEndpointUrl = toDfsEndpointUrl(this.url);\n this.accountName = getAccountNameFromUrl(this.blobEndpointUrl);\n this.pipeline = pipeline;\n // creating this BlobServiceClient allows us to use the converted V2 Pipeline attached to `pipeline`.\n const blobClient = new BlobServiceClient(url, pipeline);\n this.storageClientContext = new StorageContextClient(\n this.dfsEndpointUrl,\n getCoreClientOptions(pipeline),\n );\n\n this.storageClientContextToBlobEndpoint = new StorageContextClient(\n this.blobEndpointUrl,\n getCoreClientOptions(pipeline),\n );\n\n this.isHttps = iEqual(getURLScheme(this.url) || \"\", \"https\");\n\n this.credential = (blobClient as any).credential;\n\n // Override protocol layer's default content-type\n const storageClientContext = this.storageClientContext as any;\n storageClientContext.requestContentType = undefined;\n const storageClientContextWithBlobEndpoint = this.storageClientContextToBlobEndpoint as any;\n storageClientContextWithBlobEndpoint.requestContentType = undefined;\n }\n}\n"]}
@@ -7,11 +7,10 @@ import { StorageClient } from "./generated/src/index.js";
7
7
  */
8
8
  export class StorageContextClient extends StorageClient {
9
9
  async sendOperationRequest(operationArguments, operationSpec) {
10
- var _a;
11
- const operationSpecToSend = Object.assign({}, operationSpec);
10
+ const operationSpecToSend = { ...operationSpec };
12
11
  if (!isNodeLike &&
13
12
  !operationSpec.requestBody &&
14
- ((_a = operationSpec.headerParameters) === null || _a === void 0 ? void 0 : _a.some((param) => param.mapper.serializedName === "Content-Length"))) {
13
+ operationSpec.headerParameters?.some((param) => param.mapper.serializedName === "Content-Length")) {
15
14
  operationSpecToSend.mediaType = "text";
16
15
  operationSpecToSend.requestBody = {
17
16
  parameterPath: "body",
@@ -1 +1 @@
1
- {"version":3,"file":"StorageContextClient.js","sourceRoot":"","sources":["../../src/StorageContextClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,aAAa;IACrD,KAAK,CAAC,oBAAoB,CACxB,kBAAsC,EACtC,aAA4B;;QAE5B,MAAM,mBAAmB,qBAAQ,aAAa,CAAE,CAAC;QAEjD,IACE,CAAC,UAAU;YACX,CAAC,aAAa,CAAC,WAAW;aAC1B,MAAA,aAAa,CAAC,gBAAgB,0CAAE,IAAI,CAClC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,KAAK,gBAAgB,CAC5D,CAAA,EACD,CAAC;YACD,mBAAmB,CAAC,SAAS,GAAG,MAAM,CAAC;YACvC,mBAAmB,CAAC,WAAW,GAAG;gBAChC,aAAa,EAAE,MAAM;gBACrB,MAAM,EAAE;oBACN,cAAc,EAAE,MAAM;oBACtB,UAAU,EAAE,IAAI;oBAChB,YAAY,EAAE,EAAE;oBAChB,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;qBACf;iBACF;aACF,CAAC;QACJ,CAAC;QAED,IACE,mBAAmB,CAAC,IAAI,KAAK,eAAe;YAC5C,mBAAmB,CAAC,IAAI,KAAK,sBAAsB,EACnD,CAAC;YACD,mBAAmB,CAAC,IAAI,GAAG,EAAE,CAAC;QAChC,CAAC;QACD,OAAO,KAAK,CAAC,oBAAoB,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;IAC7E,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationArguments, OperationSpec } from \"@azure/core-client\";\nimport { isNodeLike } from \"@azure/core-util\";\nimport { StorageClient } from \"./generated/src/index.js\";\n\n/**\n * @internal\n */\nexport class StorageContextClient extends StorageClient {\n async sendOperationRequest<T>(\n operationArguments: OperationArguments,\n operationSpec: OperationSpec,\n ): Promise<T> {\n const operationSpecToSend = { ...operationSpec };\n\n if (\n !isNodeLike &&\n !operationSpec.requestBody &&\n operationSpec.headerParameters?.some(\n (param) => param.mapper.serializedName === \"Content-Length\",\n )\n ) {\n operationSpecToSend.mediaType = \"text\";\n operationSpecToSend.requestBody = {\n parameterPath: \"body\",\n mapper: {\n serializedName: \"body\",\n isConstant: true,\n defaultValue: \"\",\n type: {\n name: \"String\",\n },\n },\n };\n }\n\n if (\n operationSpecToSend.path === \"/{filesystem}\" ||\n operationSpecToSend.path === \"/{filesystem}/{path}\"\n ) {\n operationSpecToSend.path = \"\";\n }\n return super.sendOperationRequest(operationArguments, operationSpecToSend);\n }\n}\n"]}
1
+ {"version":3,"file":"StorageContextClient.js","sourceRoot":"","sources":["../../src/StorageContextClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,aAAa;IACrD,KAAK,CAAC,oBAAoB,CACxB,kBAAsC,EACtC,aAA4B;QAE5B,MAAM,mBAAmB,GAAG,EAAE,GAAG,aAAa,EAAE,CAAC;QAEjD,IACE,CAAC,UAAU;YACX,CAAC,aAAa,CAAC,WAAW;YAC1B,aAAa,CAAC,gBAAgB,EAAE,IAAI,CAClC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,KAAK,gBAAgB,CAC5D,EACD,CAAC;YACD,mBAAmB,CAAC,SAAS,GAAG,MAAM,CAAC;YACvC,mBAAmB,CAAC,WAAW,GAAG;gBAChC,aAAa,EAAE,MAAM;gBACrB,MAAM,EAAE;oBACN,cAAc,EAAE,MAAM;oBACtB,UAAU,EAAE,IAAI;oBAChB,YAAY,EAAE,EAAE;oBAChB,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;qBACf;iBACF;aACF,CAAC;QACJ,CAAC;QAED,IACE,mBAAmB,CAAC,IAAI,KAAK,eAAe;YAC5C,mBAAmB,CAAC,IAAI,KAAK,sBAAsB,EACnD,CAAC;YACD,mBAAmB,CAAC,IAAI,GAAG,EAAE,CAAC;QAChC,CAAC;QACD,OAAO,KAAK,CAAC,oBAAoB,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;IAC7E,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationArguments, OperationSpec } from \"@azure/core-client\";\nimport { isNodeLike } from \"@azure/core-util\";\nimport { StorageClient } from \"./generated/src/index.js\";\n\n/**\n * @internal\n */\nexport class StorageContextClient extends StorageClient {\n async sendOperationRequest<T>(\n operationArguments: OperationArguments,\n operationSpec: OperationSpec,\n ): Promise<T> {\n const operationSpecToSend = { ...operationSpec };\n\n if (\n !isNodeLike &&\n !operationSpec.requestBody &&\n operationSpec.headerParameters?.some(\n (param) => param.mapper.serializedName === \"Content-Length\",\n )\n ) {\n operationSpecToSend.mediaType = \"text\";\n operationSpecToSend.requestBody = {\n parameterPath: \"body\",\n mapper: {\n serializedName: \"body\",\n isConstant: true,\n defaultValue: \"\",\n type: {\n name: \"String\",\n },\n },\n };\n }\n\n if (\n operationSpecToSend.path === \"/{filesystem}\" ||\n operationSpecToSend.path === \"/{filesystem}/{path}\"\n ) {\n operationSpecToSend.path = \"\";\n }\n return super.sendOperationRequest(operationArguments, operationSpecToSend);\n }\n}\n"]}