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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/dist/browser/AccountSASPermissions.js +32 -34
  2. package/dist/browser/AccountSASPermissions.js.map +1 -1
  3. package/dist/browser/AccountSASResourceTypes.js +12 -14
  4. package/dist/browser/AccountSASResourceTypes.js.map +1 -1
  5. package/dist/browser/AccountSASServices.js +16 -18
  6. package/dist/browser/AccountSASServices.js.map +1 -1
  7. package/dist/browser/Clients.js +551 -238
  8. package/dist/browser/Clients.js.map +1 -1
  9. package/dist/browser/FileSASPermissions.js +16 -18
  10. package/dist/browser/FileSASPermissions.js.map +1 -1
  11. package/dist/browser/FileSystemAttributes.js +43 -45
  12. package/dist/browser/FileSystemAttributes.js.map +1 -1
  13. package/dist/browser/Pipeline.js +27 -10
  14. package/dist/browser/Pipeline.js.map +1 -1
  15. package/dist/browser/SASQueryParameters.js +70 -0
  16. package/dist/browser/SASQueryParameters.js.map +1 -1
  17. package/dist/browser/ShareClientInternal.js +1 -0
  18. package/dist/browser/ShareClientInternal.js.map +1 -1
  19. package/dist/browser/ShareSASPermissions.js +20 -22
  20. package/dist/browser/ShareSASPermissions.js.map +1 -1
  21. package/dist/browser/ShareServiceClient.js +63 -47
  22. package/dist/browser/ShareServiceClient.js.map +1 -1
  23. package/dist/browser/StorageClient.js +23 -0
  24. package/dist/browser/StorageClient.js.map +1 -1
  25. package/dist/browser/StorageContextClient.js +1 -1
  26. package/dist/browser/StorageContextClient.js.map +1 -1
  27. package/dist/browser/generated/src/operations/directory.js +1 -0
  28. package/dist/browser/generated/src/operations/directory.js.map +1 -1
  29. package/dist/browser/generated/src/operations/file.js +1 -0
  30. package/dist/browser/generated/src/operations/file.js.map +1 -1
  31. package/dist/browser/generated/src/operations/service.js +1 -0
  32. package/dist/browser/generated/src/operations/service.js.map +1 -1
  33. package/dist/browser/generated/src/operations/share.js +1 -0
  34. package/dist/browser/generated/src/operations/share.js.map +1 -1
  35. package/dist/browser/generated/src/storageClient.js +14 -3
  36. package/dist/browser/generated/src/storageClient.js.map +1 -1
  37. package/dist/browser/utils/Batch.js +29 -21
  38. package/dist/browser/utils/Batch.js.map +1 -1
  39. package/dist/browser/utils/BufferScheduler.js +70 -44
  40. package/dist/browser/utils/BufferScheduler.js.map +1 -1
  41. package/dist/browser/utils/RetriableReadableStream.js +70 -62
  42. package/dist/browser/utils/RetriableReadableStream.js.map +1 -1
  43. package/dist/browser/utils/utils.common.js +31 -15
  44. package/dist/browser/utils/utils.common.js.map +1 -1
  45. package/dist/commonjs/AccountSASPermissions.js +32 -34
  46. package/dist/commonjs/AccountSASPermissions.js.map +1 -1
  47. package/dist/commonjs/AccountSASResourceTypes.js +12 -14
  48. package/dist/commonjs/AccountSASResourceTypes.js.map +1 -1
  49. package/dist/commonjs/AccountSASServices.js +16 -18
  50. package/dist/commonjs/AccountSASServices.js.map +1 -1
  51. package/dist/commonjs/Clients.js +551 -238
  52. package/dist/commonjs/Clients.js.map +1 -1
  53. package/dist/commonjs/FileDownloadResponse.js +2 -0
  54. package/dist/commonjs/FileDownloadResponse.js.map +1 -1
  55. package/dist/commonjs/FileSASPermissions.js +16 -18
  56. package/dist/commonjs/FileSASPermissions.js.map +1 -1
  57. package/dist/commonjs/FileSystemAttributes.js +43 -45
  58. package/dist/commonjs/FileSystemAttributes.js.map +1 -1
  59. package/dist/commonjs/Pipeline.js +27 -10
  60. package/dist/commonjs/Pipeline.js.map +1 -1
  61. package/dist/commonjs/SASQueryParameters.js +70 -0
  62. package/dist/commonjs/SASQueryParameters.js.map +1 -1
  63. package/dist/commonjs/ShareClientInternal.js +1 -0
  64. package/dist/commonjs/ShareClientInternal.js.map +1 -1
  65. package/dist/commonjs/ShareSASPermissions.js +20 -22
  66. package/dist/commonjs/ShareSASPermissions.js.map +1 -1
  67. package/dist/commonjs/ShareServiceClient.js +63 -47
  68. package/dist/commonjs/ShareServiceClient.js.map +1 -1
  69. package/dist/commonjs/StorageClient.js +23 -0
  70. package/dist/commonjs/StorageClient.js.map +1 -1
  71. package/dist/commonjs/StorageContextClient.js +1 -1
  72. package/dist/commonjs/StorageContextClient.js.map +1 -1
  73. package/dist/commonjs/generated/src/operations/directory.js +1 -0
  74. package/dist/commonjs/generated/src/operations/directory.js.map +1 -1
  75. package/dist/commonjs/generated/src/operations/file.js +1 -0
  76. package/dist/commonjs/generated/src/operations/file.js.map +1 -1
  77. package/dist/commonjs/generated/src/operations/service.js +1 -0
  78. package/dist/commonjs/generated/src/operations/service.js.map +1 -1
  79. package/dist/commonjs/generated/src/operations/share.js +1 -0
  80. package/dist/commonjs/generated/src/operations/share.js.map +1 -1
  81. package/dist/commonjs/generated/src/storageClient.js +14 -3
  82. package/dist/commonjs/generated/src/storageClient.js.map +1 -1
  83. package/dist/commonjs/tsdoc-metadata.json +11 -11
  84. package/dist/commonjs/utils/Batch.js +29 -21
  85. package/dist/commonjs/utils/Batch.js.map +1 -1
  86. package/dist/commonjs/utils/BufferScheduler.js +70 -44
  87. package/dist/commonjs/utils/BufferScheduler.js.map +1 -1
  88. package/dist/commonjs/utils/RetriableReadableStream.js +70 -62
  89. package/dist/commonjs/utils/RetriableReadableStream.js.map +1 -1
  90. package/dist/commonjs/utils/utils.common.js +31 -15
  91. package/dist/commonjs/utils/utils.common.js.map +1 -1
  92. package/dist/esm/AccountSASPermissions.js +32 -34
  93. package/dist/esm/AccountSASPermissions.js.map +1 -1
  94. package/dist/esm/AccountSASResourceTypes.js +12 -14
  95. package/dist/esm/AccountSASResourceTypes.js.map +1 -1
  96. package/dist/esm/AccountSASServices.js +16 -18
  97. package/dist/esm/AccountSASServices.js.map +1 -1
  98. package/dist/esm/Clients.js +551 -238
  99. package/dist/esm/Clients.js.map +1 -1
  100. package/dist/esm/FileDownloadResponse.js +2 -0
  101. package/dist/esm/FileDownloadResponse.js.map +1 -1
  102. package/dist/esm/FileSASPermissions.js +16 -18
  103. package/dist/esm/FileSASPermissions.js.map +1 -1
  104. package/dist/esm/FileSystemAttributes.js +43 -45
  105. package/dist/esm/FileSystemAttributes.js.map +1 -1
  106. package/dist/esm/Pipeline.js +27 -10
  107. package/dist/esm/Pipeline.js.map +1 -1
  108. package/dist/esm/SASQueryParameters.js +70 -0
  109. package/dist/esm/SASQueryParameters.js.map +1 -1
  110. package/dist/esm/ShareClientInternal.js +1 -0
  111. package/dist/esm/ShareClientInternal.js.map +1 -1
  112. package/dist/esm/ShareSASPermissions.js +20 -22
  113. package/dist/esm/ShareSASPermissions.js.map +1 -1
  114. package/dist/esm/ShareServiceClient.js +63 -47
  115. package/dist/esm/ShareServiceClient.js.map +1 -1
  116. package/dist/esm/StorageClient.js +23 -0
  117. package/dist/esm/StorageClient.js.map +1 -1
  118. package/dist/esm/StorageContextClient.js +1 -1
  119. package/dist/esm/StorageContextClient.js.map +1 -1
  120. package/dist/esm/generated/src/operations/directory.js +1 -0
  121. package/dist/esm/generated/src/operations/directory.js.map +1 -1
  122. package/dist/esm/generated/src/operations/file.js +1 -0
  123. package/dist/esm/generated/src/operations/file.js.map +1 -1
  124. package/dist/esm/generated/src/operations/service.js +1 -0
  125. package/dist/esm/generated/src/operations/service.js.map +1 -1
  126. package/dist/esm/generated/src/operations/share.js +1 -0
  127. package/dist/esm/generated/src/operations/share.js.map +1 -1
  128. package/dist/esm/generated/src/storageClient.js +14 -3
  129. package/dist/esm/generated/src/storageClient.js.map +1 -1
  130. package/dist/esm/utils/Batch.js +29 -21
  131. package/dist/esm/utils/Batch.js.map +1 -1
  132. package/dist/esm/utils/BufferScheduler.js +70 -44
  133. package/dist/esm/utils/BufferScheduler.js.map +1 -1
  134. package/dist/esm/utils/RetriableReadableStream.js +70 -62
  135. package/dist/esm/utils/RetriableReadableStream.js.map +1 -1
  136. package/dist/esm/utils/utils.common.js +31 -15
  137. package/dist/esm/utils/utils.common.js.map +1 -1
  138. package/dist/react-native/AccountSASPermissions.js +32 -34
  139. package/dist/react-native/AccountSASPermissions.js.map +1 -1
  140. package/dist/react-native/AccountSASResourceTypes.js +12 -14
  141. package/dist/react-native/AccountSASResourceTypes.js.map +1 -1
  142. package/dist/react-native/AccountSASServices.js +16 -18
  143. package/dist/react-native/AccountSASServices.js.map +1 -1
  144. package/dist/react-native/Clients.js +551 -238
  145. package/dist/react-native/Clients.js.map +1 -1
  146. package/dist/react-native/FileDownloadResponse.js +2 -0
  147. package/dist/react-native/FileDownloadResponse.js.map +1 -1
  148. package/dist/react-native/FileSASPermissions.js +16 -18
  149. package/dist/react-native/FileSASPermissions.js.map +1 -1
  150. package/dist/react-native/FileSystemAttributes.js +43 -45
  151. package/dist/react-native/FileSystemAttributes.js.map +1 -1
  152. package/dist/react-native/Pipeline.js +27 -10
  153. package/dist/react-native/Pipeline.js.map +1 -1
  154. package/dist/react-native/SASQueryParameters.js +70 -0
  155. package/dist/react-native/SASQueryParameters.js.map +1 -1
  156. package/dist/react-native/ShareClientInternal.js +1 -0
  157. package/dist/react-native/ShareClientInternal.js.map +1 -1
  158. package/dist/react-native/ShareSASPermissions.js +20 -22
  159. package/dist/react-native/ShareSASPermissions.js.map +1 -1
  160. package/dist/react-native/ShareServiceClient.js +63 -47
  161. package/dist/react-native/ShareServiceClient.js.map +1 -1
  162. package/dist/react-native/StorageClient.js +23 -0
  163. package/dist/react-native/StorageClient.js.map +1 -1
  164. package/dist/react-native/StorageContextClient.js +1 -1
  165. package/dist/react-native/StorageContextClient.js.map +1 -1
  166. package/dist/react-native/generated/src/operations/directory.js +1 -0
  167. package/dist/react-native/generated/src/operations/directory.js.map +1 -1
  168. package/dist/react-native/generated/src/operations/file.js +1 -0
  169. package/dist/react-native/generated/src/operations/file.js.map +1 -1
  170. package/dist/react-native/generated/src/operations/service.js +1 -0
  171. package/dist/react-native/generated/src/operations/service.js.map +1 -1
  172. package/dist/react-native/generated/src/operations/share.js +1 -0
  173. package/dist/react-native/generated/src/operations/share.js.map +1 -1
  174. package/dist/react-native/generated/src/storageClient.js +14 -3
  175. package/dist/react-native/generated/src/storageClient.js.map +1 -1
  176. package/dist/react-native/utils/Batch.js +29 -21
  177. package/dist/react-native/utils/Batch.js.map +1 -1
  178. package/dist/react-native/utils/BufferScheduler.js +70 -44
  179. package/dist/react-native/utils/BufferScheduler.js.map +1 -1
  180. package/dist/react-native/utils/RetriableReadableStream.js +70 -62
  181. package/dist/react-native/utils/RetriableReadableStream.js.map +1 -1
  182. package/dist/react-native/utils/utils.common.js +31 -15
  183. package/dist/react-native/utils/utils.common.js.map +1 -1
  184. package/package.json +2 -2
@@ -3,7 +3,6 @@
3
3
  // Licensed under the MIT License.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.ShareLeaseClient = exports.ShareFileClient = exports.ShareDirectoryClient = exports.ShareClient = void 0;
6
- const tslib_1 = require("tslib");
7
6
  const core_auth_1 = require("@azure/core-auth");
8
7
  const core_util_1 = require("@azure/core-util");
9
8
  const Pipeline_js_1 = require("./Pipeline.js");
@@ -26,6 +25,12 @@ const FileSASSignatureValues_js_1 = require("./FileSASSignatureValues.js");
26
25
  * A ShareClient represents a URL to the Azure Storage share allowing you to manipulate its directories and files.
27
26
  */
28
27
  class ShareClient extends StorageClient_js_1.StorageClient {
28
+ /**
29
+ * Share operation context provided by protocol layer.
30
+ */
31
+ context;
32
+ _name;
33
+ shareClientConfig;
29
34
  /**
30
35
  * The name of the share
31
36
  */
@@ -106,7 +111,11 @@ class ShareClient extends StorageClient_js_1.StorageClient {
106
111
  */
107
112
  async create(options = {}) {
108
113
  return tracing_js_1.tracingClient.withSpan("ShareClient-create", options, async (updatedOptions) => {
109
- return (0, utils_common_js_1.assertResponse)(await this.context.create(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { enabledProtocols: (0, models_js_1.toShareProtocolsString)(updatedOptions.protocols) })));
114
+ return (0, utils_common_js_1.assertResponse)(await this.context.create({
115
+ ...updatedOptions,
116
+ ...this.shareClientConfig,
117
+ enabledProtocols: (0, models_js_1.toShareProtocolsString)(updatedOptions.protocols),
118
+ }));
110
119
  });
111
120
  }
112
121
  /**
@@ -118,14 +127,20 @@ class ShareClient extends StorageClient_js_1.StorageClient {
118
127
  */
119
128
  async createIfNotExists(options = {}) {
120
129
  return tracing_js_1.tracingClient.withSpan("ShareClient-createIfNotExists", options, async (updatedOptions) => {
121
- var _a, _b;
122
130
  try {
123
131
  const res = await this.create(updatedOptions);
124
- return Object.assign({ succeeded: true }, res);
132
+ return {
133
+ succeeded: true,
134
+ ...res,
135
+ };
125
136
  }
126
137
  catch (e) {
127
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ShareAlreadyExists") {
128
- return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
138
+ if (e.details?.errorCode === "ShareAlreadyExists") {
139
+ return {
140
+ succeeded: false,
141
+ ...e.response?.parsedHeaders,
142
+ _response: e.response,
143
+ };
129
144
  }
130
145
  throw e;
131
146
  }
@@ -272,7 +287,11 @@ class ShareClient extends StorageClient_js_1.StorageClient {
272
287
  async getProperties(options = {}) {
273
288
  return tracing_js_1.tracingClient.withSpan("ShareClient-getProperties", options, async (updatedOptions) => {
274
289
  const res = (0, utils_common_js_1.assertResponse)(await this.context.getProperties(updatedOptions));
275
- return Object.assign(Object.assign(Object.assign({}, res), this.shareClientConfig), { protocols: (0, models_js_1.toShareProtocols)(res.enabledProtocols) });
290
+ return {
291
+ ...res,
292
+ ...this.shareClientConfig,
293
+ protocols: (0, models_js_1.toShareProtocols)(res.enabledProtocols),
294
+ };
276
295
  });
277
296
  }
278
297
  /**
@@ -285,7 +304,10 @@ class ShareClient extends StorageClient_js_1.StorageClient {
285
304
  */
286
305
  async delete(options = {}) {
287
306
  return tracing_js_1.tracingClient.withSpan("ShareClient-delete", options, async (updatedOptions) => {
288
- return (0, utils_common_js_1.assertResponse)(await this.context.delete(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
307
+ return (0, utils_common_js_1.assertResponse)(await this.context.delete({
308
+ ...updatedOptions,
309
+ ...this.shareClientConfig,
310
+ }));
289
311
  });
290
312
  }
291
313
  /**
@@ -297,14 +319,20 @@ class ShareClient extends StorageClient_js_1.StorageClient {
297
319
  */
298
320
  async deleteIfExists(options = {}) {
299
321
  return tracing_js_1.tracingClient.withSpan("ShareClient-deleteIfExists", options, async (updatedOptions) => {
300
- var _a, _b;
301
322
  try {
302
323
  const res = await this.delete(updatedOptions);
303
- return Object.assign({ succeeded: true }, res);
324
+ return {
325
+ succeeded: true,
326
+ ...res,
327
+ };
304
328
  }
305
329
  catch (e) {
306
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ShareNotFound") {
307
- return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
330
+ if (e.details?.errorCode === "ShareNotFound") {
331
+ return {
332
+ succeeded: false,
333
+ ...e.response?.parsedHeaders,
334
+ _response: e.response,
335
+ };
308
336
  }
309
337
  throw e;
310
338
  }
@@ -323,7 +351,11 @@ class ShareClient extends StorageClient_js_1.StorageClient {
323
351
  */
324
352
  async setMetadata(metadata, options = {}) {
325
353
  return tracing_js_1.tracingClient.withSpan("ShareClient-setMetadata", options, async (updatedOptions) => {
326
- return (0, utils_common_js_1.assertResponse)(await this.context.setMetadata(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { metadata })));
354
+ return (0, utils_common_js_1.assertResponse)(await this.context.setMetadata({
355
+ ...updatedOptions,
356
+ ...this.shareClientConfig,
357
+ metadata,
358
+ }));
327
359
  });
328
360
  }
329
361
  /**
@@ -340,7 +372,10 @@ class ShareClient extends StorageClient_js_1.StorageClient {
340
372
  */
341
373
  async getAccessPolicy(options = {}) {
342
374
  return tracing_js_1.tracingClient.withSpan("ShareClient-getAccessPolicy", options, async (updatedOptions) => {
343
- const response = (0, utils_common_js_1.assertResponse)(await this.context.getAccessPolicy(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
375
+ const response = (0, utils_common_js_1.assertResponse)(await this.context.getAccessPolicy({
376
+ ...updatedOptions,
377
+ ...this.shareClientConfig,
378
+ }));
344
379
  const res = {
345
380
  _response: response._response,
346
381
  date: response.date,
@@ -390,23 +425,26 @@ class ShareClient extends StorageClient_js_1.StorageClient {
390
425
  */
391
426
  async setAccessPolicy(shareAcl, options = {}) {
392
427
  return tracing_js_1.tracingClient.withSpan("ShareClient-setAccessPolicy", options, async (updatedOptions) => {
393
- var _a, _b, _c;
394
428
  const acl = [];
395
429
  for (const identifier of shareAcl || []) {
396
430
  acl.push({
397
431
  accessPolicy: {
398
- expiresOn: ((_a = identifier.accessPolicy) === null || _a === void 0 ? void 0 : _a.expiresOn)
432
+ expiresOn: identifier.accessPolicy?.expiresOn
399
433
  ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.expiresOn)
400
434
  : undefined,
401
- permissions: (_b = identifier.accessPolicy) === null || _b === void 0 ? void 0 : _b.permissions,
402
- startsOn: ((_c = identifier.accessPolicy) === null || _c === void 0 ? void 0 : _c.startsOn)
435
+ permissions: identifier.accessPolicy?.permissions,
436
+ startsOn: identifier.accessPolicy?.startsOn
403
437
  ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.startsOn)
404
438
  : undefined,
405
439
  },
406
440
  id: identifier.id,
407
441
  });
408
442
  }
409
- return (0, utils_common_js_1.assertResponse)(await this.context.setAccessPolicy(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { shareAcl: acl })));
443
+ return (0, utils_common_js_1.assertResponse)(await this.context.setAccessPolicy({
444
+ ...updatedOptions,
445
+ ...this.shareClientConfig,
446
+ shareAcl: acl,
447
+ }));
410
448
  });
411
449
  }
412
450
  /**
@@ -417,7 +455,10 @@ class ShareClient extends StorageClient_js_1.StorageClient {
417
455
  */
418
456
  async createSnapshot(options = {}) {
419
457
  return tracing_js_1.tracingClient.withSpan("ShareClient-createSnapshot", options, async (updatedOptions) => {
420
- return (0, utils_common_js_1.assertResponse)(await this.context.createSnapshot(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
458
+ return (0, utils_common_js_1.assertResponse)(await this.context.createSnapshot({
459
+ ...updatedOptions,
460
+ ...this.shareClientConfig,
461
+ }));
421
462
  });
422
463
  }
423
464
  /**
@@ -431,7 +472,11 @@ class ShareClient extends StorageClient_js_1.StorageClient {
431
472
  */
432
473
  async setQuota(quotaInGB, options = {}) {
433
474
  return tracing_js_1.tracingClient.withSpan("ShareClient-setQuota", options, async (updatedOptions) => {
434
- return (0, utils_common_js_1.assertResponse)(await this.context.setProperties(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { quota: quotaInGB })));
475
+ return (0, utils_common_js_1.assertResponse)(await this.context.setProperties({
476
+ ...updatedOptions,
477
+ ...this.shareClientConfig,
478
+ quota: quotaInGB,
479
+ }));
435
480
  });
436
481
  }
437
482
  /**
@@ -442,7 +487,12 @@ class ShareClient extends StorageClient_js_1.StorageClient {
442
487
  */
443
488
  async setProperties(options = {}) {
444
489
  return tracing_js_1.tracingClient.withSpan("ShareClient-setProperties", options, async (updatedOptions) => {
445
- return (0, utils_common_js_1.assertResponse)(await this.context.setProperties(Object.assign(Object.assign(Object.assign({}, options), this.shareClientConfig), { quota: options.quotaInGB, tracingOptions: updatedOptions.tracingOptions })));
490
+ return (0, utils_common_js_1.assertResponse)(await this.context.setProperties({
491
+ ...options,
492
+ ...this.shareClientConfig,
493
+ quota: options.quotaInGB,
494
+ tracingOptions: updatedOptions.tracingOptions,
495
+ }));
446
496
  });
447
497
  }
448
498
  /**
@@ -453,9 +503,12 @@ class ShareClient extends StorageClient_js_1.StorageClient {
453
503
  */
454
504
  async getStatistics(options = {}) {
455
505
  return tracing_js_1.tracingClient.withSpan("ShareClient-getStatistics", options, async (updatedOptions) => {
456
- const response = (0, utils_common_js_1.assertResponse)(await this.context.getStatistics(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
506
+ const response = (0, utils_common_js_1.assertResponse)(await this.context.getStatistics({
507
+ ...updatedOptions,
508
+ ...this.shareClientConfig,
509
+ }));
457
510
  const GBBytes = 1024 * 1024 * 1024;
458
- return Object.assign(Object.assign({}, response), { shareUsage: Math.ceil(response.shareUsageBytes / GBBytes) });
511
+ return { ...response, shareUsage: Math.ceil(response.shareUsageBytes / GBBytes) };
459
512
  });
460
513
  }
461
514
  /**
@@ -468,7 +521,10 @@ class ShareClient extends StorageClient_js_1.StorageClient {
468
521
  */
469
522
  async createPermission(filePermission, options = {}) {
470
523
  return tracing_js_1.tracingClient.withSpan("ShareClient-createPermission", options, async (updatedOptions) => {
471
- return (0, utils_common_js_1.assertResponse)(await this.context.createPermission((0, utils_common_js_1.asSharePermission)(filePermission), Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
524
+ return (0, utils_common_js_1.assertResponse)(await this.context.createPermission((0, utils_common_js_1.asSharePermission)(filePermission), {
525
+ ...updatedOptions,
526
+ ...this.shareClientConfig,
527
+ }));
472
528
  });
473
529
  }
474
530
  /**
@@ -481,7 +537,10 @@ class ShareClient extends StorageClient_js_1.StorageClient {
481
537
  */
482
538
  async getPermission(filePermissionKey, options = {}) {
483
539
  return tracing_js_1.tracingClient.withSpan("ShareClient-getPermission", options, async (updatedOptions) => {
484
- return (0, utils_common_js_1.assertResponse)(await this.context.getPermission(filePermissionKey, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
540
+ return (0, utils_common_js_1.assertResponse)(await this.context.getPermission(filePermissionKey, {
541
+ ...updatedOptions,
542
+ ...this.shareClientConfig,
543
+ }));
485
544
  });
486
545
  }
487
546
  /**
@@ -508,7 +567,10 @@ class ShareClient extends StorageClient_js_1.StorageClient {
508
567
  if (!(this.credential instanceof storage_common_2.StorageSharedKeyCredential)) {
509
568
  throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
510
569
  }
511
- const sas = (0, FileSASSignatureValues_js_1.generateFileSASQueryParameters)(Object.assign({ shareName: this.name }, options), this.credential).toString();
570
+ const sas = (0, FileSASSignatureValues_js_1.generateFileSASQueryParameters)({
571
+ shareName: this.name,
572
+ ...options,
573
+ }, this.credential).toString();
512
574
  return (0, utils_common_js_1.appendToURLQuery)(this.url, sas);
513
575
  }
514
576
  /**
@@ -527,7 +589,10 @@ class ShareClient extends StorageClient_js_1.StorageClient {
527
589
  if (!(this.credential instanceof storage_common_2.StorageSharedKeyCredential)) {
528
590
  throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
529
591
  }
530
- return (0, FileSASSignatureValues_js_1.generateFileSASQueryParametersInternal)(Object.assign({ shareName: this.name }, options), this.credential).stringToSign;
592
+ return (0, FileSASSignatureValues_js_1.generateFileSASQueryParametersInternal)({
593
+ shareName: this.name,
594
+ ...options,
595
+ }, this.credential).stringToSign;
531
596
  }
532
597
  }
533
598
  exports.ShareClient = ShareClient;
@@ -535,6 +600,14 @@ exports.ShareClient = ShareClient;
535
600
  * A ShareDirectoryClient represents a URL to the Azure Storage directory allowing you to manipulate its files and directories.
536
601
  */
537
602
  class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
603
+ /**
604
+ * context provided by protocol layer.
605
+ */
606
+ context;
607
+ _shareName;
608
+ _path;
609
+ _name;
610
+ shareClientConfig;
538
611
  /**
539
612
  * The share name corresponding to this directory client
540
613
  */
@@ -590,16 +663,29 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
590
663
  options = (0, models_js_1.validateAndSetDefaultsForFileAndDirectoryCreateCommonOptions)(options);
591
664
  }
592
665
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-create", options, async (updatedOptions) => {
593
- var _a, _b, _c;
594
- const rawResponse = await this.context.create(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: (0, models_js_1.fileChangeTimeToString)(updatedOptions.changeTime), fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(updatedOptions.creationTime), fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
666
+ const rawResponse = await this.context.create({
667
+ ...updatedOptions,
668
+ fileChangeOn: (0, models_js_1.fileChangeTimeToString)(updatedOptions.changeTime),
669
+ fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(updatedOptions.creationTime),
670
+ fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(updatedOptions.lastWriteTime),
671
+ fileAttributes: updatedOptions.fileAttributes
595
672
  ? (0, models_js_1.fileAttributesToString)(updatedOptions.fileAttributes)
596
- : undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: (0, utils_common_js_1.toOctalFileMode)((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
597
- const wrappedRes = Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
673
+ : undefined,
674
+ owner: updatedOptions.posixProperties?.owner,
675
+ group: updatedOptions.posixProperties?.group,
676
+ fileMode: (0, utils_common_js_1.toOctalFileMode)(updatedOptions.posixProperties?.fileMode),
677
+ ...this.shareClientConfig,
678
+ });
679
+ const wrappedRes = {
680
+ ...rawResponse,
681
+ _response: rawResponse._response, // _response is made non-enumerable,
682
+ posixProperties: {
598
683
  fileMode: (0, utils_common_js_1.parseOctalFileMode)(rawResponse.fileMode),
599
684
  fileType: rawResponse.nfsFileType,
600
685
  owner: rawResponse.owner,
601
686
  group: rawResponse.group,
602
- } });
687
+ },
688
+ };
603
689
  return (0, utils_common_js_1.assertResponse)(wrappedRes);
604
690
  });
605
691
  }
@@ -612,14 +698,20 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
612
698
  */
613
699
  async createIfNotExists(options = {}) {
614
700
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-createIfNotExists", options, async (updatedOptions) => {
615
- var _a, _b;
616
701
  try {
617
702
  const res = await this.create(updatedOptions);
618
- return Object.assign({ succeeded: true }, res);
703
+ return {
704
+ succeeded: true,
705
+ ...res,
706
+ };
619
707
  }
620
708
  catch (e) {
621
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ResourceAlreadyExists") {
622
- return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
709
+ if (e.details?.errorCode === "ResourceAlreadyExists") {
710
+ return {
711
+ succeeded: false,
712
+ ...e.response?.parsedHeaders,
713
+ _response: e.response,
714
+ };
623
715
  }
624
716
  throw e;
625
717
  }
@@ -635,15 +727,28 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
635
727
  async setProperties(properties = {}) {
636
728
  properties = (0, models_js_1.validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions)(properties);
637
729
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-setProperties", properties, async (updatedOptions) => {
638
- var _a, _b, _c;
639
- const rawResponse = await this.context.setProperties(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: (0, models_js_1.fileChangeTimeToString)(updatedOptions.changeTime), fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(updatedOptions.creationTime), fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
730
+ const rawResponse = await this.context.setProperties({
731
+ ...updatedOptions,
732
+ fileChangeOn: (0, models_js_1.fileChangeTimeToString)(updatedOptions.changeTime),
733
+ fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(updatedOptions.creationTime),
734
+ fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(updatedOptions.lastWriteTime),
735
+ fileAttributes: updatedOptions.fileAttributes
640
736
  ? (0, models_js_1.fileAttributesToString)(updatedOptions.fileAttributes)
641
- : undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: (0, utils_common_js_1.toOctalFileMode)((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
642
- return (0, utils_common_js_1.assertResponse)(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
737
+ : undefined,
738
+ owner: updatedOptions.posixProperties?.owner,
739
+ group: updatedOptions.posixProperties?.group,
740
+ fileMode: (0, utils_common_js_1.toOctalFileMode)(updatedOptions.posixProperties?.fileMode),
741
+ ...this.shareClientConfig,
742
+ });
743
+ return (0, utils_common_js_1.assertResponse)({
744
+ ...rawResponse,
745
+ _response: rawResponse._response,
746
+ posixProperties: {
643
747
  fileMode: (0, utils_common_js_1.parseOctalFileMode)(rawResponse.fileMode),
644
748
  owner: rawResponse.owner,
645
749
  group: rawResponse.group,
646
- } }));
750
+ },
751
+ });
647
752
  });
648
753
  }
649
754
  /**
@@ -804,7 +909,7 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
804
909
  async exists(options = {}) {
805
910
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-exists", options, async (updatedOptions) => {
806
911
  try {
807
- await this.getProperties(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
912
+ await this.getProperties({ ...updatedOptions, ...this.shareClientConfig });
808
913
  return true;
809
914
  }
810
915
  catch (e) {
@@ -826,13 +931,20 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
826
931
  */
827
932
  async getProperties(options = {}) {
828
933
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-getProperties", options, async (updatedOptions) => {
829
- const rawResponse = await this.context.getProperties(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
830
- return (0, utils_common_js_1.assertResponse)(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
934
+ const rawResponse = await this.context.getProperties({
935
+ ...updatedOptions,
936
+ ...this.shareClientConfig,
937
+ });
938
+ return (0, utils_common_js_1.assertResponse)({
939
+ ...rawResponse,
940
+ _response: rawResponse._response,
941
+ posixProperties: {
831
942
  fileMode: (0, utils_common_js_1.parseOctalFileMode)(rawResponse.fileMode),
832
943
  owner: rawResponse.owner,
833
944
  group: rawResponse.group,
834
945
  fileType: rawResponse.nfsFileType,
835
- } }));
946
+ },
947
+ });
836
948
  });
837
949
  }
838
950
  /**
@@ -845,7 +957,7 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
845
957
  */
846
958
  async delete(options = {}) {
847
959
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-delete", options, async (updatedOptions) => {
848
- return (0, utils_common_js_1.assertResponse)(await this.context.delete(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
960
+ return (0, utils_common_js_1.assertResponse)(await this.context.delete({ ...updatedOptions, ...this.shareClientConfig }));
849
961
  });
850
962
  }
851
963
  /**
@@ -857,15 +969,21 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
857
969
  */
858
970
  async deleteIfExists(options = {}) {
859
971
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-deleteIfExists", options, async (updatedOptions) => {
860
- var _a, _b, _c;
861
972
  try {
862
973
  const res = await this.delete(updatedOptions);
863
- return Object.assign({ succeeded: true }, res);
974
+ return {
975
+ succeeded: true,
976
+ ...res,
977
+ };
864
978
  }
865
979
  catch (e) {
866
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ResourceNotFound" ||
867
- ((_b = e.details) === null || _b === void 0 ? void 0 : _b.errorCode) === "ParentNotFound") {
868
- return Object.assign(Object.assign({ succeeded: false }, (_c = e.response) === null || _c === void 0 ? void 0 : _c.parsedHeaders), { _response: e.response });
980
+ if (e.details?.errorCode === "ResourceNotFound" ||
981
+ e.details?.errorCode === "ParentNotFound") {
982
+ return {
983
+ succeeded: false,
984
+ ...e.response?.parsedHeaders,
985
+ _response: e.response,
986
+ };
869
987
  }
870
988
  throw e;
871
989
  }
@@ -881,7 +999,11 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
881
999
  */
882
1000
  async setMetadata(metadata, options = {}) {
883
1001
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-setMetadata", options, async (updatedOptions) => {
884
- return (0, utils_common_js_1.assertResponse)(await this.context.setMetadata(Object.assign(Object.assign(Object.assign({}, updatedOptions), { metadata }), this.shareClientConfig)));
1002
+ return (0, utils_common_js_1.assertResponse)(await this.context.setMetadata({
1003
+ ...updatedOptions,
1004
+ metadata,
1005
+ ...this.shareClientConfig,
1006
+ }));
885
1007
  });
886
1008
  }
887
1009
  /**
@@ -896,52 +1018,35 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
896
1018
  * items. The marker value is opaque to the client.
897
1019
  * @param options - Options to list files and directories operation.
898
1020
  */
899
- iterateFilesAndDirectoriesSegments(marker_1) {
900
- return tslib_1.__asyncGenerator(this, arguments, function* iterateFilesAndDirectoriesSegments_1(marker, options = {}) {
901
- if (options.prefix === "") {
902
- options.prefix = undefined;
903
- }
904
- let listFilesAndDirectoriesResponse;
905
- do {
906
- listFilesAndDirectoriesResponse = yield tslib_1.__await(this.listFilesAndDirectoriesSegment(marker, options));
907
- marker = listFilesAndDirectoriesResponse.continuationToken;
908
- yield yield tslib_1.__await(yield tslib_1.__await(listFilesAndDirectoriesResponse));
909
- } while (marker);
910
- });
1021
+ async *iterateFilesAndDirectoriesSegments(marker, options = {}) {
1022
+ if (options.prefix === "") {
1023
+ options.prefix = undefined;
1024
+ }
1025
+ let listFilesAndDirectoriesResponse;
1026
+ do {
1027
+ listFilesAndDirectoriesResponse = await this.listFilesAndDirectoriesSegment(marker, options);
1028
+ marker = listFilesAndDirectoriesResponse.continuationToken;
1029
+ yield await listFilesAndDirectoriesResponse;
1030
+ } while (marker);
911
1031
  }
912
1032
  /**
913
1033
  * Returns an AsyncIterableIterator for file and directory items
914
1034
  *
915
1035
  * @param options - Options to list files and directories operation.
916
1036
  */
917
- listFilesAndDirectoriesItems() {
918
- return tslib_1.__asyncGenerator(this, arguments, function* listFilesAndDirectoriesItems_1(options = {}) {
919
- var _a, e_1, _b, _c;
920
- if (options.prefix === "") {
921
- options.prefix = undefined;
922
- }
923
- let marker;
924
- try {
925
- for (var _d = true, _e = tslib_1.__asyncValues(this.iterateFilesAndDirectoriesSegments(marker, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
926
- _c = _f.value;
927
- _d = false;
928
- const listFilesAndDirectoriesResponse = _c;
929
- for (const file of listFilesAndDirectoriesResponse.segment.fileItems) {
930
- yield yield tslib_1.__await(Object.assign({ kind: "file" }, file));
931
- }
932
- for (const directory of listFilesAndDirectoriesResponse.segment.directoryItems) {
933
- yield yield tslib_1.__await(Object.assign({ kind: "directory" }, directory));
934
- }
935
- }
1037
+ async *listFilesAndDirectoriesItems(options = {}) {
1038
+ if (options.prefix === "") {
1039
+ options.prefix = undefined;
1040
+ }
1041
+ let marker;
1042
+ for await (const listFilesAndDirectoriesResponse of this.iterateFilesAndDirectoriesSegments(marker, options)) {
1043
+ for (const file of listFilesAndDirectoriesResponse.segment.fileItems) {
1044
+ yield { kind: "file", ...file };
936
1045
  }
937
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
938
- finally {
939
- try {
940
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
941
- }
942
- finally { if (e_1) throw e_1.error; }
1046
+ for (const directory of listFilesAndDirectoriesResponse.segment.directoryItems) {
1047
+ yield { kind: "directory", ...directory };
943
1048
  }
944
- });
1049
+ }
945
1050
  }
946
1051
  /**
947
1052
  * Returns an async iterable iterator to list all the files and directories
@@ -1109,7 +1214,10 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
1109
1214
  if (options.prefix === "") {
1110
1215
  options.prefix = undefined;
1111
1216
  }
1112
- const updatedOptions = Object.assign(Object.assign({}, options), (include.length > 0 ? { include: include } : {}));
1217
+ const updatedOptions = {
1218
+ ...options,
1219
+ ...(include.length > 0 ? { include: include } : {}),
1220
+ };
1113
1221
  // AsyncIterableIterator to iterate over files and directories
1114
1222
  const iter = this.listFilesAndDirectoriesItems(updatedOptions);
1115
1223
  return {
@@ -1129,7 +1237,10 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
1129
1237
  * Return an AsyncIterableIterator that works a page at a time
1130
1238
  */
1131
1239
  byPage: (settings = {}) => {
1132
- return this.iterateFilesAndDirectoriesSegments((0, utils_common_js_1.removeEmptyString)(settings.continuationToken), Object.assign({ maxResults: settings.maxPageSize }, updatedOptions));
1240
+ return this.iterateFilesAndDirectoriesSegments((0, utils_common_js_1.removeEmptyString)(settings.continuationToken), {
1241
+ maxResults: settings.maxPageSize,
1242
+ ...updatedOptions,
1243
+ });
1133
1244
  },
1134
1245
  };
1135
1246
  }
@@ -1147,8 +1258,18 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
1147
1258
  options.prefix = undefined;
1148
1259
  }
1149
1260
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-listFilesAndDirectoriesSegment", options, async (updatedOptions) => {
1150
- const rawResponse = (0, utils_common_js_1.assertResponse)(await this.context.listFilesAndDirectoriesSegment(Object.assign(Object.assign(Object.assign({}, updatedOptions), { marker }), this.shareClientConfig)));
1151
- const wrappedResponse = Object.assign(Object.assign({}, (0, utils_common_js_1.ConvertInternalResponseOfListFiles)(rawResponse)), { _response: Object.assign(Object.assign({}, rawResponse._response), { parsedBody: (0, utils_common_js_1.ConvertInternalResponseOfListFiles)(rawResponse._response.parsedBody) }) });
1261
+ const rawResponse = (0, utils_common_js_1.assertResponse)(await this.context.listFilesAndDirectoriesSegment({
1262
+ ...updatedOptions,
1263
+ marker,
1264
+ ...this.shareClientConfig,
1265
+ }));
1266
+ const wrappedResponse = {
1267
+ ...(0, utils_common_js_1.ConvertInternalResponseOfListFiles)(rawResponse),
1268
+ _response: {
1269
+ ...rawResponse._response,
1270
+ parsedBody: (0, utils_common_js_1.ConvertInternalResponseOfListFiles)(rawResponse._response.parsedBody),
1271
+ }, // _response is made non-enumerable
1272
+ };
1152
1273
  return wrappedResponse;
1153
1274
  });
1154
1275
  }
@@ -1162,47 +1283,30 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
1162
1283
  * set of list items.
1163
1284
  * @param options - Options to list handles operation.
1164
1285
  */
1165
- iterateHandleSegments(marker_1) {
1166
- return tslib_1.__asyncGenerator(this, arguments, function* iterateHandleSegments_1(marker, options = {}) {
1167
- let listHandlesResponse;
1168
- if (!!marker || marker === undefined) {
1169
- do {
1170
- listHandlesResponse = yield tslib_1.__await(this.listHandlesSegment(marker, options));
1171
- marker = listHandlesResponse.continuationToken;
1172
- yield yield tslib_1.__await(yield tslib_1.__await(listHandlesResponse));
1173
- } while (marker);
1174
- }
1175
- });
1286
+ async *iterateHandleSegments(marker, options = {}) {
1287
+ let listHandlesResponse;
1288
+ if (!!marker || marker === undefined) {
1289
+ do {
1290
+ listHandlesResponse = await this.listHandlesSegment(marker, options);
1291
+ marker = listHandlesResponse.continuationToken;
1292
+ yield await listHandlesResponse;
1293
+ } while (marker);
1294
+ }
1176
1295
  }
1177
1296
  /**
1178
1297
  * Returns an AsyncIterableIterator for handles
1179
1298
  *
1180
1299
  * @param options - Options to list handles operation.
1181
1300
  */
1182
- listHandleItems() {
1183
- return tslib_1.__asyncGenerator(this, arguments, function* listHandleItems_1(options = {}) {
1184
- var _a, e_2, _b, _c;
1185
- let marker;
1186
- try {
1187
- for (var _d = true, _e = tslib_1.__asyncValues(this.iterateHandleSegments(marker, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
1188
- _c = _f.value;
1189
- _d = false;
1190
- const listHandlesResponse = _c;
1191
- if (listHandlesResponse.handleList) {
1192
- for (const handle of listHandlesResponse.handleList) {
1193
- yield yield tslib_1.__await(handle);
1194
- }
1195
- }
1301
+ async *listHandleItems(options = {}) {
1302
+ let marker;
1303
+ for await (const listHandlesResponse of this.iterateHandleSegments(marker, options)) {
1304
+ if (listHandlesResponse.handleList) {
1305
+ for (const handle of listHandlesResponse.handleList) {
1306
+ yield handle;
1196
1307
  }
1197
1308
  }
1198
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
1199
- finally {
1200
- try {
1201
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
1202
- }
1203
- finally { if (e_2) throw e_2.error; }
1204
- }
1205
- });
1309
+ }
1206
1310
  }
1207
1311
  /**
1208
1312
  * Returns an async iterable iterator to list all the handles.
@@ -1347,7 +1451,10 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
1347
1451
  * Return an AsyncIterableIterator that works a page at a time
1348
1452
  */
1349
1453
  byPage: (settings = {}) => {
1350
- return this.iterateHandleSegments((0, utils_common_js_1.removeEmptyString)(settings.continuationToken), Object.assign({ maxResults: settings.maxPageSize }, options));
1454
+ return this.iterateHandleSegments((0, utils_common_js_1.removeEmptyString)(settings.continuationToken), {
1455
+ maxResults: settings.maxPageSize,
1456
+ ...options,
1457
+ });
1351
1458
  },
1352
1459
  };
1353
1460
  }
@@ -1365,13 +1472,23 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
1365
1472
  async listHandlesSegment(marker, options = {}) {
1366
1473
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-listHandlesSegment", options, async (updatedOptions) => {
1367
1474
  marker = marker === "" ? undefined : marker;
1368
- const response = (0, utils_common_js_1.assertResponse)(await this.context.listHandles(Object.assign(Object.assign(Object.assign({}, updatedOptions), { marker }), this.shareClientConfig)));
1475
+ const response = (0, utils_common_js_1.assertResponse)(await this.context.listHandles({
1476
+ ...updatedOptions,
1477
+ marker,
1478
+ ...this.shareClientConfig,
1479
+ }));
1369
1480
  // TODO: Protocol layer issue that when handle list is in returned XML
1370
1481
  // response.handleList is an empty string
1371
1482
  if (response.handleList === "") {
1372
1483
  response.handleList = undefined;
1373
1484
  }
1374
- const wrappedResponse = Object.assign(Object.assign({}, (0, utils_common_js_1.ConvertInternalResponseOfListHandles)(response)), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: (0, utils_common_js_1.ConvertInternalResponseOfListHandles)(response._response.parsedBody) }) });
1485
+ const wrappedResponse = {
1486
+ ...(0, utils_common_js_1.ConvertInternalResponseOfListHandles)(response),
1487
+ _response: {
1488
+ ...response._response,
1489
+ parsedBody: (0, utils_common_js_1.ConvertInternalResponseOfListHandles)(response._response.parsedBody),
1490
+ },
1491
+ };
1375
1492
  return wrappedResponse;
1376
1493
  });
1377
1494
  }
@@ -1388,12 +1505,19 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
1388
1505
  */
1389
1506
  async forceCloseHandlesSegment(marker, options = {}) {
1390
1507
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-forceCloseHandlesSegment", options, async (updatedOptions) => {
1391
- var _a, _b;
1392
1508
  if (marker === "") {
1393
1509
  marker = undefined;
1394
1510
  }
1395
- const rawResponse = (0, utils_common_js_1.assertResponse)(await this.context.forceCloseHandles("*", Object.assign(Object.assign(Object.assign({}, updatedOptions), { marker }), this.shareClientConfig)));
1396
- return Object.assign(Object.assign({}, rawResponse), { closedHandlesCount: (_a = rawResponse.numberOfHandlesClosed) !== null && _a !== void 0 ? _a : 0, closeFailureCount: (_b = rawResponse.numberOfHandlesFailedToClose) !== null && _b !== void 0 ? _b : 0 });
1511
+ const rawResponse = (0, utils_common_js_1.assertResponse)(await this.context.forceCloseHandles("*", {
1512
+ ...updatedOptions,
1513
+ marker,
1514
+ ...this.shareClientConfig,
1515
+ }));
1516
+ return {
1517
+ ...rawResponse,
1518
+ closedHandlesCount: rawResponse.numberOfHandlesClosed ?? 0,
1519
+ closeFailureCount: rawResponse.numberOfHandlesFailedToClose ?? 0,
1520
+ };
1397
1521
  });
1398
1522
  }
1399
1523
  /**
@@ -1438,7 +1562,10 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
1438
1562
  if (handleId === "*") {
1439
1563
  throw new RangeError(`Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`);
1440
1564
  }
1441
- const rawResponse = await this.context.forceCloseHandles(handleId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
1565
+ const rawResponse = await this.context.forceCloseHandles(handleId, {
1566
+ ...updatedOptions,
1567
+ ...this.shareClientConfig,
1568
+ });
1442
1569
  const response = rawResponse;
1443
1570
  response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
1444
1571
  response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
@@ -1494,15 +1621,20 @@ class ShareDirectoryClient extends StorageClient_js_1.StorageClient {
1494
1621
  }
1495
1622
  const destDirectory = new ShareDirectoryClient(destinationUrl, this.pipeline, this.shareClientConfig);
1496
1623
  return tracing_js_1.tracingClient.withSpan("ShareDirectoryClient-rename", options, async (updatedOptions) => {
1497
- const response = (0, utils_common_js_1.assertResponse)(await destDirectory.context.rename(this.url, Object.assign(Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
1624
+ const response = (0, utils_common_js_1.assertResponse)(await destDirectory.context.rename(this.url, {
1625
+ ...updatedOptions,
1626
+ sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
1498
1627
  ? {
1499
1628
  sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,
1500
1629
  }
1501
- : undefined, destinationLeaseAccessConditions: updatedOptions.destinationLeaseAccessConditions
1630
+ : undefined,
1631
+ destinationLeaseAccessConditions: updatedOptions.destinationLeaseAccessConditions
1502
1632
  ? {
1503
1633
  destinationLeaseId: updatedOptions.destinationLeaseAccessConditions.leaseId,
1504
1634
  }
1505
- : undefined }), this.shareClientConfig)));
1635
+ : undefined,
1636
+ ...this.shareClientConfig,
1637
+ }));
1506
1638
  return {
1507
1639
  destinationDirectoryClient: destDirectory,
1508
1640
  directoryRenameResponse: response,
@@ -1515,6 +1647,14 @@ exports.ShareDirectoryClient = ShareDirectoryClient;
1515
1647
  * A ShareFileClient represents a URL to an Azure Storage file.
1516
1648
  */
1517
1649
  class ShareFileClient extends StorageClient_js_1.StorageClient {
1650
+ /**
1651
+ * context provided by protocol layer.
1652
+ */
1653
+ context;
1654
+ _shareName;
1655
+ _path;
1656
+ _name;
1657
+ shareClientConfig;
1518
1658
  /**
1519
1659
  * The share name corresponding to this file client
1520
1660
  */
@@ -1612,16 +1752,30 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
1612
1752
  options = (0, models_js_1.validateAndSetDefaultsForFileAndDirectoryCreateCommonOptions)(options);
1613
1753
  options.fileHttpHeaders = options.fileHttpHeaders || {};
1614
1754
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-create", options, async (updatedOptions) => {
1615
- var _a, _b, _c, _d;
1616
- const rawResponse = await this.context.create(size, Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: (0, models_js_1.fileChangeTimeToString)(updatedOptions.changeTime), fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(updatedOptions.creationTime), fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
1755
+ const rawResponse = await this.context.create(size, {
1756
+ ...updatedOptions,
1757
+ fileChangeOn: (0, models_js_1.fileChangeTimeToString)(updatedOptions.changeTime),
1758
+ fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(updatedOptions.creationTime),
1759
+ fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(updatedOptions.lastWriteTime),
1760
+ fileAttributes: updatedOptions.fileAttributes
1617
1761
  ? (0, models_js_1.fileAttributesToString)(updatedOptions.fileAttributes)
1618
- : undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: (0, utils_common_js_1.toOctalFileMode)((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode), nfsFileType: (_d = updatedOptions.posixProperties) === null || _d === void 0 ? void 0 : _d.fileType }), this.shareClientConfig));
1619
- const wrappedRes = Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
1762
+ : undefined,
1763
+ owner: updatedOptions.posixProperties?.owner,
1764
+ group: updatedOptions.posixProperties?.group,
1765
+ fileMode: (0, utils_common_js_1.toOctalFileMode)(updatedOptions.posixProperties?.fileMode),
1766
+ nfsFileType: updatedOptions.posixProperties?.fileType,
1767
+ ...this.shareClientConfig,
1768
+ });
1769
+ const wrappedRes = {
1770
+ ...rawResponse,
1771
+ _response: rawResponse._response, // _response is made non-enumerable,
1772
+ posixProperties: {
1620
1773
  fileMode: (0, utils_common_js_1.parseOctalFileMode)(rawResponse.fileMode),
1621
1774
  fileType: rawResponse.nfsFileType,
1622
1775
  owner: rawResponse.owner,
1623
1776
  group: rawResponse.group,
1624
- } });
1777
+ },
1778
+ };
1625
1779
  return (0, utils_common_js_1.assertResponse)(wrappedRes);
1626
1780
  });
1627
1781
  }
@@ -1711,15 +1865,24 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
1711
1865
  throw new RangeError(`rangeGetContentMD5 only works with partial data downloading`);
1712
1866
  }
1713
1867
  const downloadFullFile = offset === 0 && !count;
1714
- const rawResponse = await this.context.download(Object.assign(Object.assign(Object.assign({}, updatedOptions), { requestOptions: {
1868
+ const rawResponse = await this.context.download({
1869
+ ...updatedOptions,
1870
+ requestOptions: {
1715
1871
  onDownloadProgress: core_util_1.isNodeLike ? undefined : updatedOptions.onProgress, // for Node.js, progress is reported by RetriableReadableStream
1716
- }, range: downloadFullFile ? undefined : (0, Range_js_1.rangeToString)({ offset, count }) }), this.shareClientConfig));
1717
- const res = (0, utils_common_js_1.assertResponse)(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
1872
+ },
1873
+ range: downloadFullFile ? undefined : (0, Range_js_1.rangeToString)({ offset, count }),
1874
+ ...this.shareClientConfig,
1875
+ });
1876
+ const res = (0, utils_common_js_1.assertResponse)({
1877
+ ...rawResponse,
1878
+ _response: rawResponse._response, // _response is made non-enumerable,
1879
+ posixProperties: {
1718
1880
  fileMode: (0, utils_common_js_1.parseOctalFileMode)(rawResponse.fileMode),
1719
1881
  owner: rawResponse.owner,
1720
1882
  group: rawResponse.group,
1721
1883
  linkCount: rawResponse.linkCount,
1722
- } }));
1884
+ },
1885
+ });
1723
1886
  // Return browser response immediately
1724
1887
  if (!core_util_1.isNodeLike) {
1725
1888
  return res;
@@ -1749,7 +1912,11 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
1749
1912
  // chunkDownloadOptions.range
1750
1913
  // }, options: ${JSON.stringify(chunkDownloadOptions)}`
1751
1914
  // );
1752
- const downloadRes = await this.context.download(Object.assign(Object.assign(Object.assign({}, updatedOptions), updatedDownloadOptions), this.shareClientConfig));
1915
+ const downloadRes = await this.context.download({
1916
+ ...updatedOptions,
1917
+ ...updatedDownloadOptions,
1918
+ ...this.shareClientConfig, // TODO: confirm whether this is needed
1919
+ });
1753
1920
  if (!(downloadRes.etag === res.etag)) {
1754
1921
  throw new Error("File has been modified concurrently");
1755
1922
  }
@@ -1793,14 +1960,21 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
1793
1960
  */
1794
1961
  async getProperties(options = {}) {
1795
1962
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-getProperties", options, async (updatedOptions) => {
1796
- const rawResponse = await this.context.getProperties(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
1797
- return (0, utils_common_js_1.assertResponse)(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
1963
+ const rawResponse = await this.context.getProperties({
1964
+ ...updatedOptions,
1965
+ ...this.shareClientConfig,
1966
+ });
1967
+ return (0, utils_common_js_1.assertResponse)({
1968
+ ...rawResponse,
1969
+ _response: rawResponse._response, // _response is made non-enumerable,
1970
+ posixProperties: {
1798
1971
  fileMode: (0, utils_common_js_1.parseOctalFileMode)(rawResponse.fileMode),
1799
1972
  fileType: rawResponse.nfsFileType,
1800
1973
  owner: rawResponse.owner,
1801
1974
  group: rawResponse.group,
1802
1975
  linkCount: rawResponse.linkCount,
1803
- } }));
1976
+ },
1977
+ });
1804
1978
  });
1805
1979
  }
1806
1980
  /**
@@ -1816,16 +1990,29 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
1816
1990
  properties = (0, models_js_1.validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions)(properties);
1817
1991
  properties.fileHttpHeaders = properties.fileHttpHeaders || {};
1818
1992
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-setProperties", properties, async (updatedOptions) => {
1819
- var _a, _b, _c;
1820
- const rawResponse = await this.context.setHttpHeaders(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: (0, models_js_1.fileChangeTimeToString)(updatedOptions.changeTime), fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(updatedOptions.creationTime), fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
1993
+ const rawResponse = await this.context.setHttpHeaders({
1994
+ ...updatedOptions,
1995
+ fileChangeOn: (0, models_js_1.fileChangeTimeToString)(updatedOptions.changeTime),
1996
+ fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(updatedOptions.creationTime),
1997
+ fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(updatedOptions.lastWriteTime),
1998
+ fileAttributes: updatedOptions.fileAttributes
1821
1999
  ? (0, models_js_1.fileAttributesToString)(updatedOptions.fileAttributes)
1822
- : undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: (0, utils_common_js_1.toOctalFileMode)((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
1823
- return (0, utils_common_js_1.assertResponse)(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
2000
+ : undefined,
2001
+ owner: updatedOptions.posixProperties?.owner,
2002
+ group: updatedOptions.posixProperties?.group,
2003
+ fileMode: (0, utils_common_js_1.toOctalFileMode)(updatedOptions.posixProperties?.fileMode),
2004
+ ...this.shareClientConfig,
2005
+ });
2006
+ return (0, utils_common_js_1.assertResponse)({
2007
+ ...rawResponse,
2008
+ _response: rawResponse._response, // _response is made non-enumerable,
2009
+ posixProperties: {
1824
2010
  fileMode: (0, utils_common_js_1.parseOctalFileMode)(rawResponse.fileMode),
1825
2011
  owner: rawResponse.owner,
1826
2012
  group: rawResponse.group,
1827
2013
  linkCount: rawResponse.linkCount,
1828
- } }));
2014
+ },
2015
+ });
1829
2016
  });
1830
2017
  }
1831
2018
  /**
@@ -1847,7 +2034,7 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
1847
2034
  */
1848
2035
  async delete(options = {}) {
1849
2036
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-delete", options, async (updatedOptions) => {
1850
- return (0, utils_common_js_1.assertResponse)(await this.context.delete(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
2037
+ return (0, utils_common_js_1.assertResponse)(await this.context.delete({ ...updatedOptions, ...this.shareClientConfig }));
1851
2038
  });
1852
2039
  }
1853
2040
  /**
@@ -1868,15 +2055,21 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
1868
2055
  */
1869
2056
  async deleteIfExists(options = {}) {
1870
2057
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-deleteIfExists", options, async (updatedOptions) => {
1871
- var _a, _b, _c;
1872
2058
  try {
1873
2059
  const res = await this.delete(updatedOptions);
1874
- return Object.assign({ succeeded: true }, res);
2060
+ return {
2061
+ succeeded: true,
2062
+ ...res,
2063
+ };
1875
2064
  }
1876
2065
  catch (e) {
1877
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ResourceNotFound" ||
1878
- ((_b = e.details) === null || _b === void 0 ? void 0 : _b.errorCode) === "ParentNotFound") {
1879
- return Object.assign(Object.assign({ succeeded: false }, (_c = e.response) === null || _c === void 0 ? void 0 : _c.parsedHeaders), { _response: e.response });
2066
+ if (e.details?.errorCode === "ResourceNotFound" ||
2067
+ e.details?.errorCode === "ParentNotFound") {
2068
+ return {
2069
+ succeeded: false,
2070
+ ...e.response?.parsedHeaders,
2071
+ _response: e.response,
2072
+ };
1880
2073
  }
1881
2074
  throw e;
1882
2075
  }
@@ -1898,16 +2091,30 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
1898
2091
  // FileAttributes, filePermission, createTime, lastWriteTime will all be preserved
1899
2092
  options = (0, models_js_1.validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions)(options);
1900
2093
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-setHTTPHeaders", options, async (updatedOptions) => {
1901
- var _a, _b, _c;
1902
- const rawResponse = await this.context.setHttpHeaders(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileHttpHeaders, fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(updatedOptions.creationTime), fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(updatedOptions.lastWriteTime), fileChangeOn: (0, models_js_1.fileChangeTimeToString)(updatedOptions.changeTime), fileAttributes: updatedOptions.fileAttributes
2094
+ const rawResponse = await this.context.setHttpHeaders({
2095
+ ...updatedOptions,
2096
+ fileHttpHeaders,
2097
+ fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(updatedOptions.creationTime),
2098
+ fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(updatedOptions.lastWriteTime),
2099
+ fileChangeOn: (0, models_js_1.fileChangeTimeToString)(updatedOptions.changeTime),
2100
+ fileAttributes: updatedOptions.fileAttributes
1903
2101
  ? (0, models_js_1.fileAttributesToString)(updatedOptions.fileAttributes)
1904
- : undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: (0, utils_common_js_1.toOctalFileMode)((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
1905
- return (0, utils_common_js_1.assertResponse)(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
2102
+ : undefined,
2103
+ owner: updatedOptions.posixProperties?.owner,
2104
+ group: updatedOptions.posixProperties?.group,
2105
+ fileMode: (0, utils_common_js_1.toOctalFileMode)(updatedOptions.posixProperties?.fileMode),
2106
+ ...this.shareClientConfig,
2107
+ });
2108
+ return (0, utils_common_js_1.assertResponse)({
2109
+ ...rawResponse,
2110
+ _response: rawResponse._response, // _response is made non-enumerable,
2111
+ posixProperties: {
1906
2112
  fileMode: (0, utils_common_js_1.parseOctalFileMode)(rawResponse.fileMode),
1907
2113
  owner: rawResponse.owner,
1908
2114
  group: rawResponse.group,
1909
2115
  linkCount: rawResponse.linkCount,
1910
- } }));
2116
+ },
2117
+ });
1911
2118
  });
1912
2119
  }
1913
2120
  /**
@@ -1928,14 +2135,28 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
1928
2135
  // FileAttributes, filePermission, createTime, lastWriteTime will all be preserved.
1929
2136
  options = (0, models_js_1.validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions)(options);
1930
2137
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-resize", options, async (updatedOptions) => {
1931
- var _a, _b, _c;
1932
- const rawResponse = await this.context.setHttpHeaders(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileContentLength: length, fileChangeOn: (0, models_js_1.fileChangeTimeToString)(options.changeTime), fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(options.creationTime), fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(options.lastWriteTime), fileAttributes: (0, models_js_1.fileAttributesToString)(updatedOptions.fileAttributes), owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: (0, utils_common_js_1.toOctalFileMode)((_c = options.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
1933
- return (0, utils_common_js_1.assertResponse)(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
2138
+ const rawResponse = await this.context.setHttpHeaders({
2139
+ ...updatedOptions,
2140
+ fileContentLength: length,
2141
+ fileChangeOn: (0, models_js_1.fileChangeTimeToString)(options.changeTime),
2142
+ fileCreatedOn: (0, models_js_1.fileCreationTimeToString)(options.creationTime),
2143
+ fileLastWriteOn: (0, models_js_1.fileLastWriteTimeToString)(options.lastWriteTime),
2144
+ fileAttributes: (0, models_js_1.fileAttributesToString)(updatedOptions.fileAttributes),
2145
+ owner: updatedOptions.posixProperties?.owner,
2146
+ group: updatedOptions.posixProperties?.group,
2147
+ fileMode: (0, utils_common_js_1.toOctalFileMode)(options.posixProperties?.fileMode),
2148
+ ...this.shareClientConfig,
2149
+ });
2150
+ return (0, utils_common_js_1.assertResponse)({
2151
+ ...rawResponse,
2152
+ _response: rawResponse._response,
2153
+ posixProperties: {
1934
2154
  fileMode: (0, utils_common_js_1.parseOctalFileMode)(rawResponse.fileMode),
1935
2155
  owner: rawResponse.owner,
1936
2156
  group: rawResponse.group,
1937
2157
  linkCount: rawResponse.linkCount,
1938
- } }));
2158
+ },
2159
+ });
1939
2160
  });
1940
2161
  }
1941
2162
  /**
@@ -1951,7 +2172,11 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
1951
2172
  */
1952
2173
  async setMetadata(metadata = {}, options = {}) {
1953
2174
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-setMetadata", options, async (updatedOptions) => {
1954
- return (0, utils_common_js_1.assertResponse)(await this.context.setMetadata(Object.assign(Object.assign(Object.assign({}, updatedOptions), { metadata }), this.shareClientConfig)));
2175
+ return (0, utils_common_js_1.assertResponse)(await this.context.setMetadata({
2176
+ ...updatedOptions,
2177
+ metadata,
2178
+ ...this.shareClientConfig,
2179
+ }));
1955
2180
  });
1956
2181
  }
1957
2182
  /**
@@ -2007,9 +2232,14 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2007
2232
  if (contentLength > constants_js_1.FILE_RANGE_MAX_SIZE_BYTES) {
2008
2233
  throw new RangeError(`offset must be < ${constants_js_1.FILE_RANGE_MAX_SIZE_BYTES} bytes`);
2009
2234
  }
2010
- return (0, utils_common_js_1.assertResponse)(await this.context.uploadRange((0, Range_js_1.rangeToString)({ count: contentLength, offset }), "update", contentLength, Object.assign(Object.assign(Object.assign({}, updatedOptions), { requestOptions: {
2235
+ return (0, utils_common_js_1.assertResponse)(await this.context.uploadRange((0, Range_js_1.rangeToString)({ count: contentLength, offset }), "update", contentLength, {
2236
+ ...updatedOptions,
2237
+ requestOptions: {
2011
2238
  onUploadProgress: updatedOptions.onProgress,
2012
- }, body }), this.shareClientConfig)));
2239
+ },
2240
+ body,
2241
+ ...this.shareClientConfig,
2242
+ }));
2013
2243
  });
2014
2244
  }
2015
2245
  /**
@@ -2030,7 +2260,13 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2030
2260
  if (count <= 0 || count > constants_js_1.FILE_RANGE_MAX_SIZE_BYTES) {
2031
2261
  throw new RangeError(`count must be > 0 and <= ${constants_js_1.FILE_RANGE_MAX_SIZE_BYTES} bytes`);
2032
2262
  }
2033
- return (0, utils_common_js_1.assertResponse)(await this.context.uploadRangeFromURL((0, Range_js_1.rangeToString)({ offset: destOffset, count }), sourceURL, 0, Object.assign(Object.assign(Object.assign({}, updatedOptions), { sourceRange: (0, Range_js_1.rangeToString)({ offset: sourceOffset, count }), sourceModifiedAccessConditions: updatedOptions.sourceConditions, copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(updatedOptions.sourceAuthorization) }), this.shareClientConfig)));
2263
+ return (0, utils_common_js_1.assertResponse)(await this.context.uploadRangeFromURL((0, Range_js_1.rangeToString)({ offset: destOffset, count }), sourceURL, 0, {
2264
+ ...updatedOptions,
2265
+ sourceRange: (0, Range_js_1.rangeToString)({ offset: sourceOffset, count }),
2266
+ sourceModifiedAccessConditions: updatedOptions.sourceConditions,
2267
+ copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(updatedOptions.sourceAuthorization),
2268
+ ...this.shareClientConfig,
2269
+ }));
2034
2270
  });
2035
2271
  }
2036
2272
  /**
@@ -2046,7 +2282,7 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2046
2282
  if (offset < 0 || contentLength <= 0) {
2047
2283
  throw new RangeError(`offset must >= 0 and contentLength must be > 0`);
2048
2284
  }
2049
- return (0, utils_common_js_1.assertResponse)(await this.context.uploadRange((0, Range_js_1.rangeToString)({ count: contentLength, offset }), "clear", 0, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
2285
+ return (0, utils_common_js_1.assertResponse)(await this.context.uploadRange((0, Range_js_1.rangeToString)({ count: contentLength, offset }), "clear", 0, { ...updatedOptions, ...this.shareClientConfig }));
2050
2286
  });
2051
2287
  }
2052
2288
  /**
@@ -2056,12 +2292,20 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2056
2292
  */
2057
2293
  async getRangeList(options = {}) {
2058
2294
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-getRangeList", options, async (updatedOptions) => {
2059
- const originalResponse = (0, utils_common_js_1.assertResponse)(await this.context.getRangeList(Object.assign(Object.assign(Object.assign({}, updatedOptions), { range: updatedOptions.range ? (0, Range_js_1.rangeToString)(updatedOptions.range) : undefined }), this.shareClientConfig)));
2295
+ const originalResponse = (0, utils_common_js_1.assertResponse)(await this.context.getRangeList({
2296
+ ...updatedOptions,
2297
+ range: updatedOptions.range ? (0, Range_js_1.rangeToString)(updatedOptions.range) : undefined,
2298
+ ...this.shareClientConfig,
2299
+ }));
2060
2300
  // Only returns ranges, ignoring clearRanges.
2061
2301
  const parsedBody = originalResponse._response.parsedBody.ranges
2062
2302
  ? originalResponse._response.parsedBody.ranges
2063
2303
  : [];
2064
- return Object.assign(Object.assign({}, originalResponse), { _response: Object.assign(Object.assign({}, originalResponse._response), { parsedBody }), rangeList: originalResponse.ranges ? originalResponse.ranges : [] });
2304
+ return {
2305
+ ...originalResponse,
2306
+ _response: { ...originalResponse._response, parsedBody },
2307
+ rangeList: originalResponse.ranges ? originalResponse.ranges : [],
2308
+ };
2065
2309
  });
2066
2310
  }
2067
2311
  /**
@@ -2072,7 +2316,13 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2072
2316
  */
2073
2317
  async getRangeListDiff(prevShareSnapshot, options = {}) {
2074
2318
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-getRangeListDiff", options, async (updatedOptions) => {
2075
- return (0, utils_common_js_1.assertResponse)(await this.context.getRangeList(Object.assign(Object.assign(Object.assign({}, updatedOptions), { prevsharesnapshot: prevShareSnapshot, supportRename: options.includeRenames, range: updatedOptions.range ? (0, Range_js_1.rangeToString)(updatedOptions.range) : undefined }), this.shareClientConfig)));
2319
+ return (0, utils_common_js_1.assertResponse)(await this.context.getRangeList({
2320
+ ...updatedOptions,
2321
+ prevsharesnapshot: prevShareSnapshot,
2322
+ supportRename: options.includeRenames,
2323
+ range: updatedOptions.range ? (0, Range_js_1.rangeToString)(updatedOptions.range) : undefined,
2324
+ ...this.shareClientConfig,
2325
+ }));
2076
2326
  });
2077
2327
  }
2078
2328
  /**
@@ -2089,8 +2339,15 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2089
2339
  */
2090
2340
  async startCopyFromURL(copySource, options = {}) {
2091
2341
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-startCopyFromURL", options, async (updatedOptions) => {
2092
- var _a, _b, _c;
2093
- return (0, utils_common_js_1.assertResponse)(await this.context.startCopy(copySource, Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: (0, utils_common_js_1.toOctalFileMode)((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode), fileModeCopyMode: updatedOptions.fileModeCopyMode, fileOwnerCopyMode: updatedOptions.fileOwnerCopyMode })));
2342
+ return (0, utils_common_js_1.assertResponse)(await this.context.startCopy(copySource, {
2343
+ ...updatedOptions,
2344
+ ...this.shareClientConfig,
2345
+ owner: updatedOptions.posixProperties?.owner,
2346
+ group: updatedOptions.posixProperties?.group,
2347
+ fileMode: (0, utils_common_js_1.toOctalFileMode)(updatedOptions.posixProperties?.fileMode),
2348
+ fileModeCopyMode: updatedOptions.fileModeCopyMode,
2349
+ fileOwnerCopyMode: updatedOptions.fileOwnerCopyMode,
2350
+ }));
2094
2351
  });
2095
2352
  }
2096
2353
  /**
@@ -2103,7 +2360,7 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2103
2360
  */
2104
2361
  async abortCopyFromURL(copyId, options = {}) {
2105
2362
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-abortCopyFromURL", options, async (updatedOptions) => {
2106
- return (0, utils_common_js_1.assertResponse)(await this.context.abortCopy(copyId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
2363
+ return (0, utils_common_js_1.assertResponse)(await this.context.abortCopy(copyId, { ...updatedOptions, ...this.shareClientConfig }));
2107
2364
  });
2108
2365
  }
2109
2366
  // High Level functions
@@ -2441,13 +2698,23 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2441
2698
  async listHandlesSegment(marker, options = {}) {
2442
2699
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-listHandlesSegment", options, async (updatedOptions) => {
2443
2700
  marker = marker === "" ? undefined : marker;
2444
- const response = (0, utils_common_js_1.assertResponse)(await this.context.listHandles(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { marker })));
2701
+ const response = (0, utils_common_js_1.assertResponse)(await this.context.listHandles({
2702
+ ...updatedOptions,
2703
+ ...this.shareClientConfig,
2704
+ marker,
2705
+ }));
2445
2706
  // TODO: Protocol layer issue that when handle list is in returned XML
2446
2707
  // response.handleList is an empty string
2447
2708
  if (response.handleList === "") {
2448
2709
  response.handleList = undefined;
2449
2710
  }
2450
- const wrappedResponse = Object.assign(Object.assign({}, (0, utils_common_js_1.ConvertInternalResponseOfListHandles)(response)), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: (0, utils_common_js_1.ConvertInternalResponseOfListHandles)(response._response.parsedBody) }) });
2711
+ const wrappedResponse = {
2712
+ ...(0, utils_common_js_1.ConvertInternalResponseOfListHandles)(response),
2713
+ _response: {
2714
+ ...response._response,
2715
+ parsedBody: (0, utils_common_js_1.ConvertInternalResponseOfListHandles)(response._response.parsedBody),
2716
+ },
2717
+ };
2451
2718
  return wrappedResponse;
2452
2719
  });
2453
2720
  }
@@ -2461,47 +2728,30 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2461
2728
  * set of list items.
2462
2729
  * @param options - Options to list handles operation.
2463
2730
  */
2464
- iterateHandleSegments(marker_1) {
2465
- return tslib_1.__asyncGenerator(this, arguments, function* iterateHandleSegments_2(marker, options = {}) {
2466
- let listHandlesResponse;
2467
- if (!!marker || marker === undefined) {
2468
- do {
2469
- listHandlesResponse = yield tslib_1.__await(this.listHandlesSegment(marker, options));
2470
- marker = listHandlesResponse.continuationToken;
2471
- yield yield tslib_1.__await(listHandlesResponse);
2472
- } while (marker);
2473
- }
2474
- });
2731
+ async *iterateHandleSegments(marker, options = {}) {
2732
+ let listHandlesResponse;
2733
+ if (!!marker || marker === undefined) {
2734
+ do {
2735
+ listHandlesResponse = await this.listHandlesSegment(marker, options);
2736
+ marker = listHandlesResponse.continuationToken;
2737
+ yield listHandlesResponse;
2738
+ } while (marker);
2739
+ }
2475
2740
  }
2476
2741
  /**
2477
2742
  * Returns an AsyncIterableIterator for handles
2478
2743
  *
2479
2744
  * @param options - Options to list handles operation.
2480
2745
  */
2481
- listHandleItems() {
2482
- return tslib_1.__asyncGenerator(this, arguments, function* listHandleItems_2(options = {}) {
2483
- var _a, e_3, _b, _c;
2484
- let marker;
2485
- try {
2486
- for (var _d = true, _e = tslib_1.__asyncValues(this.iterateHandleSegments(marker, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
2487
- _c = _f.value;
2488
- _d = false;
2489
- const listHandlesResponse = _c;
2490
- if (listHandlesResponse.handleList) {
2491
- for (const handle of listHandlesResponse.handleList) {
2492
- yield yield tslib_1.__await(handle);
2493
- }
2494
- }
2746
+ async *listHandleItems(options = {}) {
2747
+ let marker;
2748
+ for await (const listHandlesResponse of this.iterateHandleSegments(marker, options)) {
2749
+ if (listHandlesResponse.handleList) {
2750
+ for (const handle of listHandlesResponse.handleList) {
2751
+ yield handle;
2495
2752
  }
2496
2753
  }
2497
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
2498
- finally {
2499
- try {
2500
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
2501
- }
2502
- finally { if (e_3) throw e_3.error; }
2503
- }
2504
- });
2754
+ }
2505
2755
  }
2506
2756
  /**
2507
2757
  * Returns an async iterable iterator to list all the handles.
@@ -2533,7 +2783,10 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2533
2783
  * Return an AsyncIterableIterator that works a page at a time
2534
2784
  */
2535
2785
  byPage: (settings = {}) => {
2536
- return this.iterateHandleSegments((0, utils_common_js_1.removeEmptyString)(settings.continuationToken), Object.assign({ maxPageSize: settings.maxPageSize }, options));
2786
+ return this.iterateHandleSegments((0, utils_common_js_1.removeEmptyString)(settings.continuationToken), {
2787
+ maxPageSize: settings.maxPageSize,
2788
+ ...options,
2789
+ });
2537
2790
  },
2538
2791
  };
2539
2792
  }
@@ -2551,7 +2804,11 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2551
2804
  async forceCloseHandlesSegment(marker, options = {}) {
2552
2805
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-forceCloseHandlesSegment", options, async (updatedOptions) => {
2553
2806
  marker = marker === "" ? undefined : marker;
2554
- const rawResponse = await this.context.forceCloseHandles("*", Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { marker }));
2807
+ const rawResponse = await this.context.forceCloseHandles("*", {
2808
+ ...updatedOptions,
2809
+ ...this.shareClientConfig,
2810
+ marker,
2811
+ });
2555
2812
  const response = rawResponse;
2556
2813
  response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
2557
2814
  response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
@@ -2598,7 +2855,10 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2598
2855
  if (handleId === "*") {
2599
2856
  throw new RangeError(`Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`);
2600
2857
  }
2601
- const rawResponse = await this.context.forceCloseHandles(handleId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
2858
+ const rawResponse = await this.context.forceCloseHandles(handleId, {
2859
+ ...updatedOptions,
2860
+ ...this.shareClientConfig,
2861
+ });
2602
2862
  const response = rawResponse;
2603
2863
  response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
2604
2864
  response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
@@ -2613,14 +2873,21 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2613
2873
  */
2614
2874
  async createHardLink(targetFile, options = {}) {
2615
2875
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-createHardLink", options, async (updatedOptions) => {
2616
- const rawResponse = await this.context.createHardLink(targetFile, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
2617
- return (0, utils_common_js_1.assertResponse)(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
2876
+ const rawResponse = await this.context.createHardLink(targetFile, {
2877
+ ...updatedOptions,
2878
+ ...this.shareClientConfig,
2879
+ });
2880
+ return (0, utils_common_js_1.assertResponse)({
2881
+ ...rawResponse,
2882
+ _response: rawResponse._response, // _response is made non-enumerable,
2883
+ posixProperties: {
2618
2884
  fileMode: (0, utils_common_js_1.parseOctalFileMode)(rawResponse.fileMode),
2619
2885
  fileType: rawResponse.nfsFileType,
2620
2886
  owner: rawResponse.owner,
2621
2887
  group: rawResponse.group,
2622
2888
  linkCount: rawResponse.linkCount,
2623
- } }));
2889
+ },
2890
+ });
2624
2891
  });
2625
2892
  }
2626
2893
  /**
@@ -2632,13 +2899,20 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2632
2899
  */
2633
2900
  async createSymbolicLink(linkText, options = {}) {
2634
2901
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-createSymbolicLink", options, async (updatedOptions) => {
2635
- const rawResponse = await this.context.createSymbolicLink(linkText, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
2636
- return (0, utils_common_js_1.assertResponse)(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, posixProperties: {
2902
+ const rawResponse = await this.context.createSymbolicLink(linkText, {
2903
+ ...updatedOptions,
2904
+ ...this.shareClientConfig,
2905
+ });
2906
+ return (0, utils_common_js_1.assertResponse)({
2907
+ ...rawResponse,
2908
+ _response: rawResponse._response, // _response is made non-enumerable,
2909
+ posixProperties: {
2637
2910
  fileMode: (0, utils_common_js_1.parseOctalFileMode)(rawResponse.fileMode),
2638
2911
  owner: rawResponse.owner,
2639
2912
  group: rawResponse.group,
2640
2913
  fileType: rawResponse.nfsFileType,
2641
- } }));
2914
+ },
2915
+ });
2642
2916
  });
2643
2917
  }
2644
2918
  /**
@@ -2647,7 +2921,10 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2647
2921
  */
2648
2922
  async getSymbolicLink(options = {}) {
2649
2923
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-getSymbolicLink", options, async (updatedOptions) => {
2650
- return (0, utils_common_js_1.assertResponse)(await this.context.getSymbolicLink(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
2924
+ return (0, utils_common_js_1.assertResponse)(await this.context.getSymbolicLink({
2925
+ ...updatedOptions,
2926
+ ...this.shareClientConfig,
2927
+ }));
2651
2928
  });
2652
2929
  }
2653
2930
  /**
@@ -2674,7 +2951,11 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2674
2951
  if (!(this.credential instanceof storage_common_2.StorageSharedKeyCredential)) {
2675
2952
  throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
2676
2953
  }
2677
- const sas = (0, FileSASSignatureValues_js_1.generateFileSASQueryParameters)(Object.assign({ shareName: this.shareName, filePath: this.path }, options), this.credential).toString();
2954
+ const sas = (0, FileSASSignatureValues_js_1.generateFileSASQueryParameters)({
2955
+ shareName: this.shareName,
2956
+ filePath: this.path,
2957
+ ...options,
2958
+ }, this.credential).toString();
2678
2959
  return (0, utils_common_js_1.appendToURLQuery)(this.url, sas);
2679
2960
  }
2680
2961
  /**
@@ -2693,7 +2974,11 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2693
2974
  if (!(this.credential instanceof storage_common_2.StorageSharedKeyCredential)) {
2694
2975
  throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
2695
2976
  }
2696
- return (0, FileSASSignatureValues_js_1.generateFileSASQueryParametersInternal)(Object.assign({ shareName: this.shareName, filePath: this.path }, options), this.credential).stringToSign;
2977
+ return (0, FileSASSignatureValues_js_1.generateFileSASQueryParametersInternal)({
2978
+ shareName: this.shareName,
2979
+ filePath: this.path,
2980
+ ...options,
2981
+ }, this.credential).stringToSign;
2697
2982
  }
2698
2983
  /**
2699
2984
  * Renames a file.
@@ -2748,19 +3033,25 @@ class ShareFileClient extends StorageClient_js_1.StorageClient {
2748
3033
  }
2749
3034
  const destFile = new ShareFileClient(destinationUrl, this.pipeline, this.shareClientConfig);
2750
3035
  return tracing_js_1.tracingClient.withSpan("ShareFileClient-rename", options, async (updatedOptions) => {
2751
- const response = (0, utils_common_js_1.assertResponse)(await destFile.context.rename(this.url, Object.assign(Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
3036
+ const response = (0, utils_common_js_1.assertResponse)(await destFile.context.rename(this.url, {
3037
+ ...updatedOptions,
3038
+ sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
2752
3039
  ? {
2753
3040
  sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,
2754
3041
  }
2755
- : undefined, destinationLeaseAccessConditions: updatedOptions.destinationLeaseAccessConditions
3042
+ : undefined,
3043
+ destinationLeaseAccessConditions: updatedOptions.destinationLeaseAccessConditions
2756
3044
  ? {
2757
3045
  destinationLeaseId: updatedOptions.destinationLeaseAccessConditions.leaseId,
2758
3046
  }
2759
- : undefined, fileHttpHeaders: options.contentType
3047
+ : undefined,
3048
+ fileHttpHeaders: options.contentType
2760
3049
  ? {
2761
3050
  fileContentType: options.contentType,
2762
3051
  }
2763
- : undefined }), this.shareClientConfig)));
3052
+ : undefined,
3053
+ ...this.shareClientConfig,
3054
+ }));
2764
3055
  return {
2765
3056
  destinationFileClient: destFile,
2766
3057
  fileRenameResponse: response,
@@ -2776,6 +3067,10 @@ exports.ShareFileClient = ShareFileClient;
2776
3067
  * @see https://learn.microsoft.com/rest/api/storageservices/lease-share
2777
3068
  */
2778
3069
  class ShareLeaseClient {
3070
+ _leaseId;
3071
+ _url;
3072
+ fileOrShare;
3073
+ shareClientConfig;
2779
3074
  /**
2780
3075
  * Gets the lease Id.
2781
3076
  *
@@ -2822,7 +3117,12 @@ class ShareLeaseClient {
2822
3117
  */
2823
3118
  async acquireLease(duration = -1, options = {}) {
2824
3119
  return tracing_js_1.tracingClient.withSpan("ShareLeaseClient-acquireLease", options, async (updatedOptions) => {
2825
- return (0, utils_common_js_1.assertResponse)(await this.fileOrShare.acquireLease(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { duration, proposedLeaseId: this._leaseId })));
3120
+ return (0, utils_common_js_1.assertResponse)(await this.fileOrShare.acquireLease({
3121
+ ...updatedOptions,
3122
+ ...this.shareClientConfig,
3123
+ duration,
3124
+ proposedLeaseId: this._leaseId,
3125
+ }));
2826
3126
  });
2827
3127
  }
2828
3128
  /**
@@ -2834,7 +3134,11 @@ class ShareLeaseClient {
2834
3134
  */
2835
3135
  async changeLease(proposedLeaseId, options = {}) {
2836
3136
  return tracing_js_1.tracingClient.withSpan("ShareLeaseClient-changeLease", options, async (updatedOptions) => {
2837
- const response = (0, utils_common_js_1.assertResponse)(await this.fileOrShare.changeLease(this._leaseId, Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { proposedLeaseId })));
3137
+ const response = (0, utils_common_js_1.assertResponse)(await this.fileOrShare.changeLease(this._leaseId, {
3138
+ ...updatedOptions,
3139
+ ...this.shareClientConfig,
3140
+ proposedLeaseId,
3141
+ }));
2838
3142
  this._leaseId = proposedLeaseId;
2839
3143
  return response;
2840
3144
  });
@@ -2848,7 +3152,10 @@ class ShareLeaseClient {
2848
3152
  */
2849
3153
  async releaseLease(options = {}) {
2850
3154
  return tracing_js_1.tracingClient.withSpan("ShareLeaseClient-releaseLease", options, async (updatedOptions) => {
2851
- return (0, utils_common_js_1.assertResponse)(await this.fileOrShare.releaseLease(this._leaseId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
3155
+ return (0, utils_common_js_1.assertResponse)(await this.fileOrShare.releaseLease(this._leaseId, {
3156
+ ...updatedOptions,
3157
+ ...this.shareClientConfig,
3158
+ }));
2852
3159
  });
2853
3160
  }
2854
3161
  /**
@@ -2859,7 +3166,10 @@ class ShareLeaseClient {
2859
3166
  */
2860
3167
  async breakLease(options = {}) {
2861
3168
  return tracing_js_1.tracingClient.withSpan("ShareLeaseClient-breakLease", options, async (updatedOptions) => {
2862
- return (0, utils_common_js_1.assertResponse)(await this.fileOrShare.breakLease(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
3169
+ return (0, utils_common_js_1.assertResponse)(await this.fileOrShare.breakLease({
3170
+ ...updatedOptions,
3171
+ ...this.shareClientConfig,
3172
+ }));
2863
3173
  });
2864
3174
  }
2865
3175
  /**
@@ -2875,7 +3185,10 @@ class ShareLeaseClient {
2875
3185
  if (isFile(this.fileOrShare)) {
2876
3186
  throw new RangeError("The renewLease operation is not available for lease on file.");
2877
3187
  }
2878
- return (0, utils_common_js_1.assertResponse)(await this.fileOrShare.renewLease(this._leaseId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
3188
+ return (0, utils_common_js_1.assertResponse)(await this.fileOrShare.renewLease(this._leaseId, {
3189
+ ...updatedOptions,
3190
+ ...this.shareClientConfig,
3191
+ }));
2879
3192
  });
2880
3193
  }
2881
3194
  }