@azure/storage-file-share 12.20.0-alpha.20230622.3 → 12.20.0-alpha.20230721.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/index.js +186 -74
  2. package/dist/index.js.map +1 -1
  3. package/dist-esm/storage-blob/src/Clients.js +6 -0
  4. package/dist-esm/storage-blob/src/Clients.js.map +1 -1
  5. package/dist-esm/storage-blob/src/ContainerClient.js +1 -3
  6. package/dist-esm/storage-blob/src/ContainerClient.js.map +1 -1
  7. package/dist-esm/storage-blob/src/generated/src/models/parameters.js +1 -1
  8. package/dist-esm/storage-blob/src/generated/src/models/parameters.js.map +1 -1
  9. package/dist-esm/storage-blob/src/generated/src/storageClient.js +1 -1
  10. package/dist-esm/storage-blob/src/generated/src/storageClient.js.map +1 -1
  11. package/dist-esm/storage-blob/src/utils/constants.js +1 -1
  12. package/dist-esm/storage-blob/src/utils/constants.js.map +1 -1
  13. package/dist-esm/storage-blob/src/utils/utils.common.js +1 -3
  14. package/dist-esm/storage-blob/src/utils/utils.common.js.map +1 -1
  15. package/dist-esm/storage-file-share/src/Clients.js +58 -51
  16. package/dist-esm/storage-file-share/src/Clients.js.map +1 -1
  17. package/dist-esm/storage-file-share/src/ShareServiceClient.js +7 -4
  18. package/dist-esm/storage-file-share/src/ShareServiceClient.js.map +1 -1
  19. package/dist-esm/storage-file-share/src/StorageClient.js +0 -4
  20. package/dist-esm/storage-file-share/src/StorageClient.js.map +1 -1
  21. package/dist-esm/storage-file-share/src/generated/src/models/index.js +6 -0
  22. package/dist-esm/storage-file-share/src/generated/src/models/index.js.map +1 -1
  23. package/dist-esm/storage-file-share/src/generated/src/models/parameters.js +31 -1
  24. package/dist-esm/storage-file-share/src/generated/src/models/parameters.js.map +1 -1
  25. package/dist-esm/storage-file-share/src/generated/src/operations/directory.js +29 -4
  26. package/dist-esm/storage-file-share/src/generated/src/operations/directory.js.map +1 -1
  27. package/dist-esm/storage-file-share/src/generated/src/operations/file.js +49 -8
  28. package/dist-esm/storage-file-share/src/generated/src/operations/file.js.map +1 -1
  29. package/dist-esm/storage-file-share/src/generated/src/operations/share.js +3 -1
  30. package/dist-esm/storage-file-share/src/generated/src/operations/share.js.map +1 -1
  31. package/dist-esm/storage-file-share/src/generated/src/storageClient.js +1 -1
  32. package/dist-esm/storage-file-share/src/generated/src/storageClient.js.map +1 -1
  33. package/dist-esm/storage-file-share/src/generatedModels.js +5 -1
  34. package/dist-esm/storage-file-share/src/generatedModels.js.map +1 -1
  35. package/dist-esm/storage-file-share/src/index.js +1 -1
  36. package/dist-esm/storage-file-share/src/index.js.map +1 -1
  37. package/dist-esm/storage-file-share/src/models.js.map +1 -1
  38. package/dist-esm/storage-file-share/src/utils/constants.js +1 -1
  39. package/dist-esm/storage-file-share/src/utils/constants.js.map +1 -1
  40. package/package.json +2 -1
  41. package/types/3.1/storage-file-share.d.ts +206 -40
  42. package/types/latest/storage-file-share.d.ts +218 -40
package/dist/index.js CHANGED
@@ -5,10 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var coreRestPipeline = require('@azure/core-rest-pipeline');
6
6
  var coreUtil = require('@azure/core-util');
7
7
  var tslib = require('tslib');
8
+ var coreAuth = require('@azure/core-auth');
8
9
  var coreHttpCompat = require('@azure/core-http-compat');
9
10
  var coreClient = require('@azure/core-client');
10
11
  var coreXml = require('@azure/core-xml');
11
- var coreAuth = require('@azure/core-auth');
12
12
  var logger$2 = require('@azure/logger');
13
13
  var abortController = require('@azure/abort-controller');
14
14
  var crypto = require('crypto');
@@ -340,7 +340,7 @@ function ipRangeToString(ipRange) {
340
340
  // Copyright (c) Microsoft Corporation.
341
341
  // Licensed under the MIT license.
342
342
  const SDK_VERSION$1 = "12.20.0";
343
- const SERVICE_VERSION = "2021-12-02";
343
+ const SERVICE_VERSION = "2022-11-02";
344
344
  const FILE_MAX_SIZE_BYTES = 4 * 1024 * 1024 * 1024 * 1024; // 4TB
345
345
  const FILE_RANGE_MAX_SIZE_BYTES = 4 * 1024 * 1024; // 4MB
346
346
  const DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5;
@@ -8054,7 +8054,7 @@ const timeoutInSeconds = {
8054
8054
  const version = {
8055
8055
  parameterPath: "version",
8056
8056
  mapper: {
8057
- defaultValue: "2021-12-02",
8057
+ defaultValue: "2022-11-02",
8058
8058
  isConstant: true,
8059
8059
  serializedName: "x-ms-version",
8060
8060
  type: {
@@ -8388,6 +8388,16 @@ const comp4 = {
8388
8388
  }
8389
8389
  }
8390
8390
  };
8391
+ const fileRequestIntent = {
8392
+ parameterPath: ["options", "fileRequestIntent"],
8393
+ mapper: {
8394
+ serializedName: "x-ms-file-request-intent",
8395
+ xmlName: "x-ms-file-request-intent",
8396
+ type: {
8397
+ name: "String"
8398
+ }
8399
+ }
8400
+ };
8391
8401
  const accept2 = {
8392
8402
  parameterPath: "accept",
8393
8403
  mapper: {
@@ -8503,6 +8513,16 @@ const restype2 = {
8503
8513
  }
8504
8514
  }
8505
8515
  };
8516
+ const allowTrailingDot = {
8517
+ parameterPath: ["options", "allowTrailingDot"],
8518
+ mapper: {
8519
+ serializedName: "x-ms-allow-trailing-dot",
8520
+ xmlName: "x-ms-allow-trailing-dot",
8521
+ type: {
8522
+ name: "Boolean"
8523
+ }
8524
+ }
8525
+ };
8506
8526
  const filePermission = {
8507
8527
  parameterPath: ["options", "filePermission"],
8508
8528
  mapper: {
@@ -8741,6 +8761,16 @@ const fileChangeTime = {
8741
8761
  }
8742
8762
  }
8743
8763
  };
8764
+ const allowSourceTrailingDot = {
8765
+ parameterPath: ["options", "allowSourceTrailingDot"],
8766
+ mapper: {
8767
+ serializedName: "x-ms-source-allow-trailing-dot",
8768
+ xmlName: "x-ms-source-allow-trailing-dot",
8769
+ type: {
8770
+ name: "Boolean"
8771
+ }
8772
+ }
8773
+ };
8744
8774
  const fileContentLength = {
8745
8775
  parameterPath: "fileContentLength",
8746
8776
  mapper: {
@@ -9668,7 +9698,8 @@ const createPermissionOperationSpec = {
9668
9698
  headerParameters: [
9669
9699
  version,
9670
9700
  accept1,
9671
- contentType1
9701
+ contentType1,
9702
+ fileRequestIntent
9672
9703
  ],
9673
9704
  mediaType: "json",
9674
9705
  serializer
@@ -9694,6 +9725,7 @@ const getPermissionOperationSpec = {
9694
9725
  urlParameters: [url],
9695
9726
  headerParameters: [
9696
9727
  version,
9728
+ fileRequestIntent,
9697
9729
  accept2,
9698
9730
  filePermissionKey
9699
9731
  ],
@@ -9990,6 +10022,8 @@ const createOperationSpec$1 = {
9990
10022
  version,
9991
10023
  accept1,
9992
10024
  metadata,
10025
+ fileRequestIntent,
10026
+ allowTrailingDot,
9993
10027
  filePermission,
9994
10028
  filePermissionKey1,
9995
10029
  fileAttributes,
@@ -10018,7 +10052,12 @@ const getPropertiesOperationSpec$1 = {
10018
10052
  restype2
10019
10053
  ],
10020
10054
  urlParameters: [url],
10021
- headerParameters: [version, accept1],
10055
+ headerParameters: [
10056
+ version,
10057
+ accept1,
10058
+ fileRequestIntent,
10059
+ allowTrailingDot
10060
+ ],
10022
10061
  isXML: true,
10023
10062
  serializer: xmlSerializer$1
10024
10063
  };
@@ -10036,7 +10075,12 @@ const deleteOperationSpec$1 = {
10036
10075
  },
10037
10076
  queryParameters: [timeoutInSeconds, restype2],
10038
10077
  urlParameters: [url],
10039
- headerParameters: [version, accept1],
10078
+ headerParameters: [
10079
+ version,
10080
+ accept1,
10081
+ fileRequestIntent,
10082
+ allowTrailingDot
10083
+ ],
10040
10084
  isXML: true,
10041
10085
  serializer: xmlSerializer$1
10042
10086
  };
@@ -10061,6 +10105,8 @@ const setPropertiesOperationSpec = {
10061
10105
  headerParameters: [
10062
10106
  version,
10063
10107
  accept1,
10108
+ fileRequestIntent,
10109
+ allowTrailingDot,
10064
10110
  filePermission,
10065
10111
  filePermissionKey1,
10066
10112
  fileAttributes,
@@ -10092,7 +10138,9 @@ const setMetadataOperationSpec$1 = {
10092
10138
  headerParameters: [
10093
10139
  version,
10094
10140
  accept1,
10095
- metadata
10141
+ metadata,
10142
+ fileRequestIntent,
10143
+ allowTrailingDot
10096
10144
  ],
10097
10145
  isXML: true,
10098
10146
  serializer: xmlSerializer$1
@@ -10124,6 +10172,8 @@ const listFilesAndDirectoriesSegmentOperationSpec = {
10124
10172
  headerParameters: [
10125
10173
  version,
10126
10174
  accept1,
10175
+ fileRequestIntent,
10176
+ allowTrailingDot,
10127
10177
  includeExtendedInfo
10128
10178
  ],
10129
10179
  isXML: true,
@@ -10153,6 +10203,8 @@ const listHandlesOperationSpec$1 = {
10153
10203
  headerParameters: [
10154
10204
  version,
10155
10205
  accept1,
10206
+ fileRequestIntent,
10207
+ allowTrailingDot,
10156
10208
  recursive
10157
10209
  ],
10158
10210
  isXML: true,
@@ -10180,6 +10232,8 @@ const forceCloseHandlesOperationSpec$1 = {
10180
10232
  headerParameters: [
10181
10233
  version,
10182
10234
  accept1,
10235
+ fileRequestIntent,
10236
+ allowTrailingDot,
10183
10237
  recursive,
10184
10238
  handleId
10185
10239
  ],
@@ -10208,6 +10262,8 @@ const renameOperationSpec$1 = {
10208
10262
  version,
10209
10263
  accept1,
10210
10264
  metadata,
10265
+ fileRequestIntent,
10266
+ allowTrailingDot,
10211
10267
  filePermission,
10212
10268
  filePermissionKey1,
10213
10269
  renameSource,
@@ -10218,7 +10274,8 @@ const renameOperationSpec$1 = {
10218
10274
  fileAttributes1,
10219
10275
  fileCreationTime,
10220
10276
  fileLastWriteTime,
10221
- fileChangeTime
10277
+ fileChangeTime,
10278
+ allowSourceTrailingDot
10222
10279
  ],
10223
10280
  isXML: true,
10224
10281
  serializer: xmlSerializer$1
@@ -10433,6 +10490,8 @@ const createOperationSpec = {
10433
10490
  accept1,
10434
10491
  metadata,
10435
10492
  leaseId,
10493
+ fileRequestIntent,
10494
+ allowTrailingDot,
10436
10495
  filePermission,
10437
10496
  filePermissionKey1,
10438
10497
  fileAttributes,
@@ -10480,6 +10539,8 @@ const downloadOperationSpec = {
10480
10539
  version,
10481
10540
  accept1,
10482
10541
  leaseId,
10542
+ fileRequestIntent,
10543
+ allowTrailingDot,
10483
10544
  range,
10484
10545
  rangeGetContentMD5
10485
10546
  ],
@@ -10503,7 +10564,9 @@ const getPropertiesOperationSpec = {
10503
10564
  headerParameters: [
10504
10565
  version,
10505
10566
  accept1,
10506
- leaseId
10567
+ leaseId,
10568
+ fileRequestIntent,
10569
+ allowTrailingDot
10507
10570
  ],
10508
10571
  isXML: true,
10509
10572
  serializer: xmlSerializer
@@ -10525,7 +10588,9 @@ const deleteOperationSpec = {
10525
10588
  headerParameters: [
10526
10589
  version,
10527
10590
  accept1,
10528
- leaseId
10591
+ leaseId,
10592
+ fileRequestIntent,
10593
+ allowTrailingDot
10529
10594
  ],
10530
10595
  isXML: true,
10531
10596
  serializer: xmlSerializer
@@ -10548,6 +10613,8 @@ const setHttpHeadersOperationSpec = {
10548
10613
  version,
10549
10614
  accept1,
10550
10615
  leaseId,
10616
+ fileRequestIntent,
10617
+ allowTrailingDot,
10551
10618
  filePermission,
10552
10619
  filePermissionKey1,
10553
10620
  fileAttributes,
@@ -10583,7 +10650,9 @@ const setMetadataOperationSpec = {
10583
10650
  version,
10584
10651
  accept1,
10585
10652
  metadata,
10586
- leaseId
10653
+ leaseId,
10654
+ fileRequestIntent,
10655
+ allowTrailingDot
10587
10656
  ],
10588
10657
  isXML: true,
10589
10658
  serializer: xmlSerializer
@@ -10608,7 +10677,9 @@ const acquireLeaseOperationSpec = {
10608
10677
  action,
10609
10678
  duration,
10610
10679
  proposedLeaseId,
10611
- requestId
10680
+ requestId,
10681
+ fileRequestIntent,
10682
+ allowTrailingDot
10612
10683
  ],
10613
10684
  isXML: true,
10614
10685
  serializer: xmlSerializer
@@ -10632,7 +10703,9 @@ const releaseLeaseOperationSpec = {
10632
10703
  accept1,
10633
10704
  requestId,
10634
10705
  action1,
10635
- leaseId1
10706
+ leaseId1,
10707
+ fileRequestIntent,
10708
+ allowTrailingDot
10636
10709
  ],
10637
10710
  isXML: true,
10638
10711
  serializer: xmlSerializer
@@ -10657,7 +10730,9 @@ const changeLeaseOperationSpec = {
10657
10730
  proposedLeaseId,
10658
10731
  requestId,
10659
10732
  leaseId1,
10660
- action2
10733
+ action2,
10734
+ fileRequestIntent,
10735
+ allowTrailingDot
10661
10736
  ],
10662
10737
  isXML: true,
10663
10738
  serializer: xmlSerializer
@@ -10681,7 +10756,9 @@ const breakLeaseOperationSpec = {
10681
10756
  accept1,
10682
10757
  leaseId,
10683
10758
  requestId,
10684
- action4
10759
+ action4,
10760
+ fileRequestIntent,
10761
+ allowTrailingDot
10685
10762
  ],
10686
10763
  isXML: true,
10687
10764
  serializer: xmlSerializer
@@ -10704,6 +10781,8 @@ const uploadRangeOperationSpec = {
10704
10781
  headerParameters: [
10705
10782
  version,
10706
10783
  leaseId,
10784
+ fileRequestIntent,
10785
+ allowTrailingDot,
10707
10786
  contentType2,
10708
10787
  accept3,
10709
10788
  range1,
@@ -10735,6 +10814,8 @@ const uploadRangeFromURLOperationSpec = {
10735
10814
  version,
10736
10815
  accept1,
10737
10816
  leaseId,
10817
+ allowTrailingDot,
10818
+ allowSourceTrailingDot,
10738
10819
  range1,
10739
10820
  contentLength,
10740
10821
  fileLastWrittenMode,
@@ -10773,6 +10854,8 @@ const getRangeListOperationSpec = {
10773
10854
  version,
10774
10855
  accept1,
10775
10856
  leaseId,
10857
+ fileRequestIntent,
10858
+ allowTrailingDot,
10776
10859
  range
10777
10860
  ],
10778
10861
  isXML: true,
@@ -10797,12 +10880,15 @@ const startCopyOperationSpec = {
10797
10880
  accept1,
10798
10881
  metadata,
10799
10882
  leaseId,
10883
+ fileRequestIntent,
10884
+ allowTrailingDot,
10800
10885
  filePermission,
10801
10886
  filePermissionKey1,
10802
10887
  fileAttributes1,
10803
10888
  fileCreationTime,
10804
10889
  fileLastWriteTime,
10805
10890
  fileChangeTime,
10891
+ allowSourceTrailingDot,
10806
10892
  copySource,
10807
10893
  filePermissionCopyMode,
10808
10894
  ignoreReadOnly1,
@@ -10833,6 +10919,8 @@ const abortCopyOperationSpec = {
10833
10919
  version,
10834
10920
  accept1,
10835
10921
  leaseId,
10922
+ fileRequestIntent,
10923
+ allowTrailingDot,
10836
10924
  copyActionAbortConstant
10837
10925
  ],
10838
10926
  isXML: true,
@@ -10859,7 +10947,12 @@ const listHandlesOperationSpec = {
10859
10947
  comp9
10860
10948
  ],
10861
10949
  urlParameters: [url],
10862
- headerParameters: [version, accept1],
10950
+ headerParameters: [
10951
+ version,
10952
+ accept1,
10953
+ fileRequestIntent,
10954
+ allowTrailingDot
10955
+ ],
10863
10956
  isXML: true,
10864
10957
  serializer: xmlSerializer
10865
10958
  };
@@ -10885,6 +10978,8 @@ const forceCloseHandlesOperationSpec = {
10885
10978
  headerParameters: [
10886
10979
  version,
10887
10980
  accept1,
10981
+ fileRequestIntent,
10982
+ allowTrailingDot,
10888
10983
  handleId
10889
10984
  ],
10890
10985
  isXML: true,
@@ -10908,6 +11003,8 @@ const renameOperationSpec = {
10908
11003
  version,
10909
11004
  accept1,
10910
11005
  metadata,
11006
+ fileRequestIntent,
11007
+ allowTrailingDot,
10911
11008
  filePermission,
10912
11009
  filePermissionKey1,
10913
11010
  renameSource,
@@ -10919,6 +11016,7 @@ const renameOperationSpec = {
10919
11016
  fileCreationTime,
10920
11017
  fileLastWriteTime,
10921
11018
  fileChangeTime,
11019
+ allowSourceTrailingDot,
10922
11020
  fileContentType
10923
11021
  ],
10924
11022
  isXML: true,
@@ -10962,7 +11060,7 @@ class StorageClient$1 extends coreHttpCompat__namespace.ExtendedServiceClient {
10962
11060
  // Parameter assignments
10963
11061
  this.url = url;
10964
11062
  // Assigning values to Constant parameters
10965
- this.version = options.version || "2021-12-02";
11063
+ this.version = options.version || "2022-11-02";
10966
11064
  this.fileRangeWriteFromUrl = options.fileRangeWriteFromUrl || "update";
10967
11065
  this.service = new ServiceImpl(this);
10968
11066
  this.share = new ShareImpl(this);
@@ -11009,9 +11107,6 @@ class StorageClient {
11009
11107
  storageClientContext.requestContentType = undefined;
11010
11108
  }
11011
11109
  const credential = getCredentialFromPipeline(pipeline);
11012
- if (coreAuth.isTokenCredential(credential)) {
11013
- throw new Error("Unsupported TokenCredential type found in pipeline.");
11014
- }
11015
11110
  this.credential = credential;
11016
11111
  }
11017
11112
  }
@@ -12233,21 +12328,22 @@ class ShareClient extends StorageClient {
12233
12328
  url = urlOrConnectionString;
12234
12329
  pipeline = credentialOrPipelineOrShareName;
12235
12330
  }
12236
- else if (credentialOrPipelineOrShareName instanceof Credential) {
12237
- // (url: string, credential?: Credential, options?: StoragePipelineOptions)
12331
+ else if (credentialOrPipelineOrShareName instanceof Credential ||
12332
+ coreAuth.isTokenCredential(credentialOrPipelineOrShareName)) {
12333
+ // (url: string, credential?: Credential, options?: ShareClientOptions)
12238
12334
  url = urlOrConnectionString;
12239
12335
  pipeline = newPipeline(credentialOrPipelineOrShareName, options);
12240
12336
  }
12241
12337
  else if (!credentialOrPipelineOrShareName &&
12242
12338
  typeof credentialOrPipelineOrShareName !== "string") {
12243
- // (url: string, credential?: Credential, options?: StoragePipelineOptions)
12339
+ // (url: string, credential?: Credential, options?: ShareClientOptions)
12244
12340
  // The second parameter is undefined. Use anonymous credential.
12245
12341
  url = urlOrConnectionString;
12246
12342
  pipeline = newPipeline(new AnonymousCredential(), options);
12247
12343
  }
12248
12344
  else if (credentialOrPipelineOrShareName &&
12249
12345
  typeof credentialOrPipelineOrShareName === "string") {
12250
- // (connectionString: string, name: string, options?: StoragePipelineOptions)
12346
+ // (connectionString: string, name: string, options?: ShareClientOptions)
12251
12347
  const extractedCreds = extractConnectionStringParts(urlOrConnectionString);
12252
12348
  const name = credentialOrPipelineOrShareName;
12253
12349
  if (extractedCreds.kind === "AccountConnString") {
@@ -12273,6 +12369,7 @@ class ShareClient extends StorageClient {
12273
12369
  }
12274
12370
  super(url, pipeline);
12275
12371
  this._name = getShareNameAndPathFromUrl(this.url).shareName;
12372
+ this.shareClientConfig = options;
12276
12373
  this.context = this.storageClientContext.share;
12277
12374
  }
12278
12375
  /**
@@ -12283,7 +12380,7 @@ class ShareClient extends StorageClient {
12283
12380
  * @returns A new ShareClient object identical to the source but with the specified snapshot timestamp
12284
12381
  */
12285
12382
  withSnapshot(snapshot) {
12286
- return new ShareClient(setURLParameter$1(this.url, URLConstants$1.Parameters.SHARE_SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline);
12383
+ return new ShareClient(setURLParameter$1(this.url, URLConstants$1.Parameters.SHARE_SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline, this.shareClientConfig);
12287
12384
  }
12288
12385
  /**
12289
12386
  * Creates a new share under the specified account. If the share with
@@ -12329,7 +12426,7 @@ class ShareClient extends StorageClient {
12329
12426
  // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
12330
12427
  /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */
12331
12428
  getDirectoryClient(directoryName) {
12332
- return new ShareDirectoryClient(appendToURLPath(this.url, EscapePath(directoryName)), this.pipeline);
12429
+ return new ShareDirectoryClient(appendToURLPath(this.url, EscapePath(directoryName)), this.pipeline, this.shareClientConfig);
12333
12430
  }
12334
12431
  /**
12335
12432
  * Gets the directory client for the root directory of this share.
@@ -12659,7 +12756,7 @@ class ShareClient extends StorageClient {
12659
12756
  return tracingClient.withSpan("ShareClient-createPermission", options, async (updatedOptions) => {
12660
12757
  return assertResponse(await this.context.createPermission({
12661
12758
  permission: filePermission,
12662
- }, updatedOptions));
12759
+ }, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
12663
12760
  });
12664
12761
  }
12665
12762
  /**
@@ -12672,7 +12769,7 @@ class ShareClient extends StorageClient {
12672
12769
  */
12673
12770
  async getPermission(filePermissionKey, options = {}) {
12674
12771
  return tracingClient.withSpan("ShareClient-getPermission", options, async (updatedOptions) => {
12675
- return assertResponse(await this.context.getPermission(filePermissionKey, updatedOptions));
12772
+ return assertResponse(await this.context.getPermission(filePermissionKey, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
12676
12773
  });
12677
12774
  }
12678
12775
  /**
@@ -12724,7 +12821,8 @@ class ShareDirectoryClient extends StorageClient {
12724
12821
  if (credentialOrPipeline instanceof Pipeline) {
12725
12822
  pipeline = credentialOrPipeline;
12726
12823
  }
12727
- else if (credentialOrPipeline instanceof Credential) {
12824
+ else if (credentialOrPipeline instanceof Credential ||
12825
+ coreAuth.isTokenCredential(credentialOrPipeline)) {
12728
12826
  pipeline = newPipeline(credentialOrPipeline, options);
12729
12827
  }
12730
12828
  else {
@@ -12737,6 +12835,7 @@ class ShareDirectoryClient extends StorageClient {
12737
12835
  shareName: this._shareName,
12738
12836
  path: this._path,
12739
12837
  } = getShareNameAndPathFromUrl(this.url));
12838
+ this.shareClientConfig = options;
12740
12839
  this.context = this.storageClientContext.directory;
12741
12840
  }
12742
12841
  /**
@@ -12757,7 +12856,7 @@ class ShareDirectoryClient extends StorageClient {
12757
12856
  return tracingClient.withSpan("ShareDirectoryClient-create", options, async (updatedOptions) => {
12758
12857
  return assertResponse(await this.context.create(updatedOptions.fileAttributes
12759
12858
  ? fileAttributesToString(updatedOptions.fileAttributes)
12760
- : FileAttributesNone, Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime) })));
12859
+ : FileAttributesNone, Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime) }), this.shareClientConfig)));
12761
12860
  });
12762
12861
  }
12763
12862
  /**
@@ -12794,7 +12893,7 @@ class ShareDirectoryClient extends StorageClient {
12794
12893
  return tracingClient.withSpan("ShareDirectoryClient-setProperties", properties, async (updatedOptions) => {
12795
12894
  return assertResponse(await this.context.setProperties(updatedOptions.fileAttributes
12796
12895
  ? fileAttributesToString(updatedOptions.fileAttributes)
12797
- : FileAttributesPreserve, Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime) })));
12896
+ : FileAttributesPreserve, Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime) }), this.shareClientConfig)));
12798
12897
  });
12799
12898
  }
12800
12899
  /**
@@ -12812,7 +12911,7 @@ class ShareDirectoryClient extends StorageClient {
12812
12911
  * ```
12813
12912
  */
12814
12913
  getDirectoryClient(subDirectoryName) {
12815
- return new ShareDirectoryClient(appendToURLPath(this.url, EscapePath(subDirectoryName)), this.pipeline);
12914
+ return new ShareDirectoryClient(appendToURLPath(this.url, EscapePath(subDirectoryName)), this.pipeline, this.shareClientConfig);
12816
12915
  }
12817
12916
  /**
12818
12917
  * Creates a new subdirectory under this directory.
@@ -12913,7 +13012,7 @@ class ShareDirectoryClient extends StorageClient {
12913
13012
  // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
12914
13013
  /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */
12915
13014
  getFileClient(fileName) {
12916
- return new ShareFileClient(appendToURLPath(this.url, EscapePath(fileName)), this.pipeline);
13015
+ return new ShareFileClient(appendToURLPath(this.url, EscapePath(fileName)), this.pipeline, this.shareClientConfig);
12917
13016
  }
12918
13017
  /**
12919
13018
  * Returns true if the specified directory exists; false otherwise.
@@ -12927,7 +13026,7 @@ class ShareDirectoryClient extends StorageClient {
12927
13026
  async exists(options = {}) {
12928
13027
  return tracingClient.withSpan("ShareDirectoryClient-exists", options, async (updatedOptions) => {
12929
13028
  try {
12930
- await this.getProperties(updatedOptions);
13029
+ await this.getProperties(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
12931
13030
  return true;
12932
13031
  }
12933
13032
  catch (e) {
@@ -12949,7 +13048,7 @@ class ShareDirectoryClient extends StorageClient {
12949
13048
  */
12950
13049
  async getProperties(options = {}) {
12951
13050
  return tracingClient.withSpan("ShareDirectoryClient-getProperties", options, async (updatedOptions) => {
12952
- return assertResponse(await this.context.getProperties(updatedOptions));
13051
+ return assertResponse(await this.context.getProperties(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
12953
13052
  });
12954
13053
  }
12955
13054
  /**
@@ -12962,7 +13061,7 @@ class ShareDirectoryClient extends StorageClient {
12962
13061
  */
12963
13062
  async delete(options = {}) {
12964
13063
  return tracingClient.withSpan("ShareDirectoryClient-delete", options, async (updatedOptions) => {
12965
- return assertResponse(await this.context.delete(updatedOptions));
13064
+ return assertResponse(await this.context.delete(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
12966
13065
  });
12967
13066
  }
12968
13067
  /**
@@ -12998,7 +13097,7 @@ class ShareDirectoryClient extends StorageClient {
12998
13097
  */
12999
13098
  async setMetadata(metadata, options = {}) {
13000
13099
  return tracingClient.withSpan("ShareDirectoryClient-setMetadata", options, async (updatedOptions) => {
13001
- return assertResponse(await this.context.setMetadata(Object.assign(Object.assign({}, updatedOptions), { metadata })));
13100
+ return assertResponse(await this.context.setMetadata(Object.assign(Object.assign(Object.assign({}, updatedOptions), { metadata }), this.shareClientConfig)));
13002
13101
  });
13003
13102
  }
13004
13103
  /**
@@ -13210,7 +13309,7 @@ class ShareDirectoryClient extends StorageClient {
13210
13309
  options.prefix = undefined;
13211
13310
  }
13212
13311
  return tracingClient.withSpan("ShareDirectoryClient-listFilesAndDirectoriesSegment", options, async (updatedOptions) => {
13213
- const rawResponse = assertResponse(await this.context.listFilesAndDirectoriesSegment(Object.assign(Object.assign({}, updatedOptions), { marker })));
13312
+ const rawResponse = assertResponse(await this.context.listFilesAndDirectoriesSegment(Object.assign(Object.assign(Object.assign({}, updatedOptions), { marker }), this.shareClientConfig)));
13214
13313
  const wrappedResponse = Object.assign(Object.assign({}, ConvertInternalResponseOfListFiles(rawResponse)), { _response: Object.assign(Object.assign({}, rawResponse._response), { parsedBody: ConvertInternalResponseOfListFiles(rawResponse._response.parsedBody) }) });
13215
13314
  return wrappedResponse;
13216
13315
  });
@@ -13386,7 +13485,7 @@ class ShareDirectoryClient extends StorageClient {
13386
13485
  async listHandlesSegment(marker, options = {}) {
13387
13486
  return tracingClient.withSpan("ShareDirectoryClient-listHandlesSegment", options, async (updatedOptions) => {
13388
13487
  marker = marker === "" ? undefined : marker;
13389
- const response = assertResponse(await this.context.listHandles(Object.assign(Object.assign({}, updatedOptions), { marker })));
13488
+ const response = assertResponse(await this.context.listHandles(Object.assign(Object.assign(Object.assign({}, updatedOptions), { marker }), this.shareClientConfig)));
13390
13489
  // TODO: Protocol layer issue that when handle list is in returned XML
13391
13490
  // response.handleList is an empty string
13392
13491
  if (response.handleList === "") {
@@ -13413,7 +13512,7 @@ class ShareDirectoryClient extends StorageClient {
13413
13512
  if (marker === "") {
13414
13513
  marker = undefined;
13415
13514
  }
13416
- const rawResponse = assertResponse(await this.context.forceCloseHandles("*", Object.assign(Object.assign({}, updatedOptions), { marker })));
13515
+ const rawResponse = assertResponse(await this.context.forceCloseHandles("*", Object.assign(Object.assign(Object.assign({}, updatedOptions), { marker }), this.shareClientConfig)));
13417
13516
  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 });
13418
13517
  });
13419
13518
  }
@@ -13459,7 +13558,7 @@ class ShareDirectoryClient extends StorageClient {
13459
13558
  if (handleId === "*") {
13460
13559
  throw new RangeError(`Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`);
13461
13560
  }
13462
- const rawResponse = await this.context.forceCloseHandles(handleId, updatedOptions);
13561
+ const rawResponse = await this.context.forceCloseHandles(handleId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
13463
13562
  const response = rawResponse;
13464
13563
  response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
13465
13564
  response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
@@ -13500,9 +13599,9 @@ class ShareDirectoryClient extends StorageClient {
13500
13599
  else {
13501
13600
  throw new RangeError("Destination path should not contain more than one query string");
13502
13601
  }
13503
- const destDirectory = new ShareDirectoryClient(destinationUrl, this.pipeline);
13602
+ const destDirectory = new ShareDirectoryClient(destinationUrl, this.pipeline, this.shareClientConfig);
13504
13603
  return tracingClient.withSpan("ShareDirectoryClient-rename", options, async (updatedOptions) => {
13505
- const response = assertResponse(await destDirectory.context.rename(this.url, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
13604
+ const response = assertResponse(await destDirectory.context.rename(this.url, Object.assign(Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
13506
13605
  ? {
13507
13606
  sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,
13508
13607
  }
@@ -13510,7 +13609,7 @@ class ShareDirectoryClient extends StorageClient {
13510
13609
  ? {
13511
13610
  destinationLeaseId: updatedOptions.destinationLeaseAccessConditions.leaseId,
13512
13611
  }
13513
- : undefined })));
13612
+ : undefined }), this.shareClientConfig)));
13514
13613
  return {
13515
13614
  destinationDirectoryClient: destDirectory,
13516
13615
  directoryRenameResponse: response,
@@ -13548,7 +13647,8 @@ class ShareFileClient extends StorageClient {
13548
13647
  if (credentialOrPipeline instanceof Pipeline) {
13549
13648
  pipeline = credentialOrPipeline;
13550
13649
  }
13551
- else if (credentialOrPipeline instanceof Credential) {
13650
+ else if (credentialOrPipeline instanceof Credential ||
13651
+ coreAuth.isTokenCredential(credentialOrPipeline)) {
13552
13652
  pipeline = newPipeline(credentialOrPipeline, options);
13553
13653
  }
13554
13654
  else {
@@ -13561,6 +13661,7 @@ class ShareFileClient extends StorageClient {
13561
13661
  shareName: this._shareName,
13562
13662
  path: this._path,
13563
13663
  } = getShareNameAndPathFromUrl(this.url));
13664
+ this.shareClientConfig = options;
13564
13665
  this.context = this.storageClientContext.file;
13565
13666
  }
13566
13667
  /**
@@ -13571,7 +13672,7 @@ class ShareFileClient extends StorageClient {
13571
13672
  * @returns A new ShareFileClient object identical to the source but with the specified share snapshot timestamp.
13572
13673
  */
13573
13674
  withShareSnapshot(shareSnapshot) {
13574
- return new ShareFileClient(setURLParameter$1(this.url, URLConstants$1.Parameters.SHARE_SNAPSHOT, shareSnapshot.length === 0 ? undefined : shareSnapshot), this.pipeline);
13675
+ return new ShareFileClient(setURLParameter$1(this.url, URLConstants$1.Parameters.SHARE_SNAPSHOT, shareSnapshot.length === 0 ? undefined : shareSnapshot), this.pipeline, this.shareClientConfig);
13575
13676
  }
13576
13677
  /**
13577
13678
  * Creates a new file or replaces a file. Note it only initializes the file with no content.
@@ -13604,7 +13705,7 @@ class ShareFileClient extends StorageClient {
13604
13705
  return tracingClient.withSpan("ShareFileClient-create", options, async (updatedOptions) => {
13605
13706
  return assertResponse(await this.context.create(size, updatedOptions.fileAttributes
13606
13707
  ? fileAttributesToString(updatedOptions.fileAttributes)
13607
- : FileAttributesNone, Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime) })));
13708
+ : FileAttributesNone, Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime) }), this.shareClientConfig)));
13608
13709
  });
13609
13710
  }
13610
13711
  /**
@@ -13674,9 +13775,9 @@ class ShareFileClient extends StorageClient {
13674
13775
  throw new RangeError(`rangeGetContentMD5 only works with partial data downloading`);
13675
13776
  }
13676
13777
  const downloadFullFile = offset === 0 && !count;
13677
- const res = assertResponse(await this.context.download(Object.assign(Object.assign({}, updatedOptions), { requestOptions: {
13778
+ const res = assertResponse(await this.context.download(Object.assign(Object.assign(Object.assign({}, updatedOptions), { requestOptions: {
13678
13779
  onDownloadProgress: coreUtil.isNode ? undefined : updatedOptions.onProgress, // for Node.js, progress is reported by RetriableReadableStream
13679
- }, range: downloadFullFile ? undefined : rangeToString({ offset, count }) })));
13780
+ }, range: downloadFullFile ? undefined : rangeToString({ offset, count }) }), this.shareClientConfig)));
13680
13781
  // Return browser response immediately
13681
13782
  if (!coreUtil.isNode) {
13682
13783
  return res;
@@ -13706,7 +13807,7 @@ class ShareFileClient extends StorageClient {
13706
13807
  // chunkDownloadOptions.range
13707
13808
  // }, options: ${JSON.stringify(chunkDownloadOptions)}`
13708
13809
  // );
13709
- const downloadRes = await this.context.download(Object.assign(Object.assign({}, updatedOptions), updatedDownloadOptions));
13810
+ const downloadRes = await this.context.download(Object.assign(Object.assign(Object.assign({}, updatedOptions), updatedDownloadOptions), this.shareClientConfig));
13710
13811
  if (!(downloadRes.etag === res.etag)) {
13711
13812
  throw new Error("File has been modified concurrently");
13712
13813
  }
@@ -13750,7 +13851,7 @@ class ShareFileClient extends StorageClient {
13750
13851
  */
13751
13852
  async getProperties(options = {}) {
13752
13853
  return tracingClient.withSpan("ShareFileClient-getProperties", options, async (updatedOptions) => {
13753
- return assertResponse(await this.context.getProperties(updatedOptions));
13854
+ return assertResponse(await this.context.getProperties(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
13754
13855
  });
13755
13856
  }
13756
13857
  /**
@@ -13768,7 +13869,7 @@ class ShareFileClient extends StorageClient {
13768
13869
  return tracingClient.withSpan("ShareFileClient-setProperties", properties, async (updatedOptions) => {
13769
13870
  return assertResponse(await this.context.setHttpHeaders(updatedOptions.fileAttributes
13770
13871
  ? fileAttributesToString(updatedOptions.fileAttributes)
13771
- : FileAttributesPreserve, Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime) })));
13872
+ : FileAttributesPreserve, Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime) }), this.shareClientConfig)));
13772
13873
  });
13773
13874
  }
13774
13875
  /**
@@ -13790,7 +13891,7 @@ class ShareFileClient extends StorageClient {
13790
13891
  */
13791
13892
  async delete(options = {}) {
13792
13893
  return tracingClient.withSpan("ShareFileClient-delete", options, async (updatedOptions) => {
13793
- return assertResponse(await this.context.delete(updatedOptions));
13894
+ return assertResponse(await this.context.delete(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
13794
13895
  });
13795
13896
  }
13796
13897
  /**
@@ -13843,7 +13944,7 @@ class ShareFileClient extends StorageClient {
13843
13944
  return tracingClient.withSpan("ShareFileClient-setHTTPHeaders", options, async (updatedOptions) => {
13844
13945
  return assertResponse(await this.context.setHttpHeaders(updatedOptions.fileAttributes
13845
13946
  ? fileAttributesToString(updatedOptions.fileAttributes)
13846
- : FileAttributesPreserve, Object.assign(Object.assign({}, updatedOptions), { fileHttpHeaders, fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime) })));
13947
+ : FileAttributesPreserve, Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileHttpHeaders, fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime) }), this.shareClientConfig)));
13847
13948
  });
13848
13949
  }
13849
13950
  /**
@@ -13864,7 +13965,7 @@ class ShareFileClient extends StorageClient {
13864
13965
  // FileAttributes, filePermission, createTime, lastWriteTime will all be preserved.
13865
13966
  options = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(options);
13866
13967
  return tracingClient.withSpan("ShareFileClient-resize", options, async (updatedOptions) => {
13867
- return assertResponse(await this.context.setHttpHeaders(fileAttributesToString(updatedOptions.fileAttributes), Object.assign(Object.assign({}, updatedOptions), { fileContentLength: length, fileChangeOn: fileChangeTimeToString(options.changeTime), fileCreatedOn: fileCreationTimeToString(options.creationTime), fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime) })));
13968
+ return assertResponse(await this.context.setHttpHeaders(fileAttributesToString(updatedOptions.fileAttributes), Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileContentLength: length, fileChangeOn: fileChangeTimeToString(options.changeTime), fileCreatedOn: fileCreationTimeToString(options.creationTime), fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime) }), this.shareClientConfig)));
13868
13969
  });
13869
13970
  }
13870
13971
  /**
@@ -13880,7 +13981,7 @@ class ShareFileClient extends StorageClient {
13880
13981
  */
13881
13982
  async setMetadata(metadata = {}, options = {}) {
13882
13983
  return tracingClient.withSpan("ShareFileClient-setMetadata", options, async (updatedOptions) => {
13883
- return assertResponse(await this.context.setMetadata(Object.assign(Object.assign({}, updatedOptions), { metadata })));
13984
+ return assertResponse(await this.context.setMetadata(Object.assign(Object.assign(Object.assign({}, updatedOptions), { metadata }), this.shareClientConfig)));
13884
13985
  });
13885
13986
  }
13886
13987
  /**
@@ -13921,9 +14022,9 @@ class ShareFileClient extends StorageClient {
13921
14022
  if (contentLength > FILE_RANGE_MAX_SIZE_BYTES) {
13922
14023
  throw new RangeError(`offset must be < ${FILE_RANGE_MAX_SIZE_BYTES} bytes`);
13923
14024
  }
13924
- return assertResponse(await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "update", contentLength, Object.assign(Object.assign({}, updatedOptions), { requestOptions: {
14025
+ return assertResponse(await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "update", contentLength, Object.assign(Object.assign(Object.assign({}, updatedOptions), { requestOptions: {
13925
14026
  onUploadProgress: updatedOptions.onProgress,
13926
- }, body })));
14027
+ }, body }), this.shareClientConfig)));
13927
14028
  });
13928
14029
  }
13929
14030
  /**
@@ -13944,7 +14045,7 @@ class ShareFileClient extends StorageClient {
13944
14045
  if (count <= 0 || count > FILE_RANGE_MAX_SIZE_BYTES) {
13945
14046
  throw new RangeError(`count must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES} bytes`);
13946
14047
  }
13947
- return assertResponse(await this.context.uploadRangeFromURL(rangeToString({ offset: destOffset, count }), sourceURL, 0, Object.assign(Object.assign({}, updatedOptions), { sourceRange: rangeToString({ offset: sourceOffset, count }), sourceModifiedAccessConditions: updatedOptions.sourceConditions, copySourceAuthorization: httpAuthorizationToString(updatedOptions.sourceAuthorization) })));
14048
+ return assertResponse(await this.context.uploadRangeFromURL(rangeToString({ offset: destOffset, count }), sourceURL, 0, Object.assign(Object.assign(Object.assign({}, updatedOptions), { sourceRange: rangeToString({ offset: sourceOffset, count }), sourceModifiedAccessConditions: updatedOptions.sourceConditions, copySourceAuthorization: httpAuthorizationToString(updatedOptions.sourceAuthorization) }), this.shareClientConfig)));
13948
14049
  });
13949
14050
  }
13950
14051
  /**
@@ -13960,7 +14061,7 @@ class ShareFileClient extends StorageClient {
13960
14061
  if (offset < 0 || contentLength <= 0) {
13961
14062
  throw new RangeError(`offset must >= 0 and contentLength must be > 0`);
13962
14063
  }
13963
- return assertResponse(await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "clear", 0, updatedOptions));
14064
+ return assertResponse(await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "clear", 0, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
13964
14065
  });
13965
14066
  }
13966
14067
  /**
@@ -13970,7 +14071,7 @@ class ShareFileClient extends StorageClient {
13970
14071
  */
13971
14072
  async getRangeList(options = {}) {
13972
14073
  return tracingClient.withSpan("ShareFileClient-getRangeList", options, async (updatedOptions) => {
13973
- const originalResponse = assertResponse(await this.context.getRangeList(Object.assign(Object.assign({}, updatedOptions), { range: updatedOptions.range ? rangeToString(updatedOptions.range) : undefined })));
14074
+ const originalResponse = assertResponse(await this.context.getRangeList(Object.assign(Object.assign(Object.assign({}, updatedOptions), { range: updatedOptions.range ? rangeToString(updatedOptions.range) : undefined }), this.shareClientConfig)));
13974
14075
  // Only returns ranges, ignoring clearRanges.
13975
14076
  const parsedBody = originalResponse._response.parsedBody.ranges
13976
14077
  ? originalResponse._response.parsedBody.ranges
@@ -13986,7 +14087,7 @@ class ShareFileClient extends StorageClient {
13986
14087
  */
13987
14088
  async getRangeListDiff(prevShareSnapshot, options = {}) {
13988
14089
  return tracingClient.withSpan("ShareFileClient-getRangeListDiff", options, async (updatedOptions) => {
13989
- return assertResponse(await this.context.getRangeList(Object.assign(Object.assign({}, updatedOptions), { prevsharesnapshot: prevShareSnapshot, range: updatedOptions.range ? rangeToString(updatedOptions.range) : undefined })));
14090
+ return assertResponse(await this.context.getRangeList(Object.assign(Object.assign(Object.assign({}, updatedOptions), { prevsharesnapshot: prevShareSnapshot, range: updatedOptions.range ? rangeToString(updatedOptions.range) : undefined }), this.shareClientConfig)));
13990
14091
  });
13991
14092
  }
13992
14093
  /**
@@ -14003,7 +14104,7 @@ class ShareFileClient extends StorageClient {
14003
14104
  */
14004
14105
  async startCopyFromURL(copySource, options = {}) {
14005
14106
  return tracingClient.withSpan("ShareFileClient-startCopyFromURL", options, async (updatedOptions) => {
14006
- return assertResponse(await this.context.startCopy(copySource, updatedOptions));
14107
+ return assertResponse(await this.context.startCopy(copySource, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
14007
14108
  });
14008
14109
  }
14009
14110
  /**
@@ -14016,7 +14117,7 @@ class ShareFileClient extends StorageClient {
14016
14117
  */
14017
14118
  async abortCopyFromURL(copyId, options = {}) {
14018
14119
  return tracingClient.withSpan("ShareFileClient-abortCopyFromURL", options, async (updatedOptions) => {
14019
- return assertResponse(await this.context.abortCopy(copyId, updatedOptions));
14120
+ return assertResponse(await this.context.abortCopy(copyId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
14020
14121
  });
14021
14122
  }
14022
14123
  // High Level functions
@@ -14354,7 +14455,7 @@ class ShareFileClient extends StorageClient {
14354
14455
  async listHandlesSegment(marker, options = {}) {
14355
14456
  return tracingClient.withSpan("ShareFileClient-listHandlesSegment", options, async (updatedOptions) => {
14356
14457
  marker = marker === "" ? undefined : marker;
14357
- const response = assertResponse(await this.context.listHandles(Object.assign(Object.assign({}, updatedOptions), { marker })));
14458
+ const response = assertResponse(await this.context.listHandles(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { marker })));
14358
14459
  // TODO: Protocol layer issue that when handle list is in returned XML
14359
14460
  // response.handleList is an empty string
14360
14461
  if (response.handleList === "") {
@@ -14469,7 +14570,7 @@ class ShareFileClient extends StorageClient {
14469
14570
  async forceCloseHandlesSegment(marker, options = {}) {
14470
14571
  return tracingClient.withSpan("ShareFileClient-forceCloseHandlesSegment", options, async (updatedOptions) => {
14471
14572
  marker = marker === "" ? undefined : marker;
14472
- const rawResponse = await this.context.forceCloseHandles("*", Object.assign(Object.assign({}, updatedOptions), { marker }));
14573
+ const rawResponse = await this.context.forceCloseHandles("*", Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { marker }));
14473
14574
  const response = rawResponse;
14474
14575
  response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
14475
14576
  response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
@@ -14516,7 +14617,7 @@ class ShareFileClient extends StorageClient {
14516
14617
  if (handleId === "*") {
14517
14618
  throw new RangeError(`Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`);
14518
14619
  }
14519
- const rawResponse = await this.context.forceCloseHandles(handleId, updatedOptions);
14620
+ const rawResponse = await this.context.forceCloseHandles(handleId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
14520
14621
  const response = rawResponse;
14521
14622
  response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
14522
14623
  response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
@@ -14584,9 +14685,9 @@ class ShareFileClient extends StorageClient {
14584
14685
  else {
14585
14686
  throw new RangeError("Destination path should not contain more than one query string");
14586
14687
  }
14587
- const destFile = new ShareFileClient(destinationUrl, this.pipeline);
14688
+ const destFile = new ShareFileClient(destinationUrl, this.pipeline, this.shareClientConfig);
14588
14689
  return tracingClient.withSpan("ShareFileClient-rename", options, async (updatedOptions) => {
14589
- const response = assertResponse(await destFile.context.rename(this.url, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
14690
+ const response = assertResponse(await destFile.context.rename(this.url, Object.assign(Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
14590
14691
  ? {
14591
14692
  sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,
14592
14693
  }
@@ -14598,7 +14699,7 @@ class ShareFileClient extends StorageClient {
14598
14699
  ? {
14599
14700
  fileContentType: options.contentType,
14600
14701
  }
14601
- : undefined })));
14702
+ : undefined }), this.shareClientConfig)));
14602
14703
  return {
14603
14704
  destinationFileClient: destFile,
14604
14705
  fileRenameResponse: response,
@@ -14763,7 +14864,7 @@ class ShareServiceClient extends StorageClient {
14763
14864
  if (coreUtil.isNode) {
14764
14865
  const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
14765
14866
  const pipeline = newPipeline(sharedKeyCredential, options);
14766
- return new ShareServiceClient(extractedCreds.url, pipeline);
14867
+ return new ShareServiceClient(extractedCreds.url, pipeline, options);
14767
14868
  }
14768
14869
  else {
14769
14870
  throw new Error("Account connection string is only supported in Node.js environment");
@@ -14771,7 +14872,7 @@ class ShareServiceClient extends StorageClient {
14771
14872
  }
14772
14873
  else if (extractedCreds.kind === "SASConnString") {
14773
14874
  const pipeline = newPipeline(new AnonymousCredential(), options);
14774
- return new ShareServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline);
14875
+ return new ShareServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline, options);
14775
14876
  }
14776
14877
  else {
14777
14878
  throw new Error("Connection string must be either an Account connection string or a SAS connection string");
@@ -14785,7 +14886,8 @@ class ShareServiceClient extends StorageClient {
14785
14886
  if (credentialOrPipeline instanceof Pipeline) {
14786
14887
  pipeline = credentialOrPipeline;
14787
14888
  }
14788
- else if (credentialOrPipeline instanceof Credential) {
14889
+ else if (credentialOrPipeline instanceof Credential ||
14890
+ coreAuth.isTokenCredential(credentialOrPipeline)) {
14789
14891
  pipeline = newPipeline(credentialOrPipeline, options);
14790
14892
  }
14791
14893
  else {
@@ -14793,6 +14895,7 @@ class ShareServiceClient extends StorageClient {
14793
14895
  pipeline = newPipeline(new AnonymousCredential(), options);
14794
14896
  }
14795
14897
  super(url, pipeline);
14898
+ this.shareClientConfig = options;
14796
14899
  this.serviceContext = this.storageClientContext.service;
14797
14900
  }
14798
14901
  /**
@@ -14810,7 +14913,7 @@ class ShareServiceClient extends StorageClient {
14810
14913
  * ```
14811
14914
  */
14812
14915
  getShareClient(shareName) {
14813
- return new ShareClient(appendToURLPath(this.url, shareName), this.pipeline);
14916
+ return new ShareClient(appendToURLPath(this.url, shareName), this.pipeline, this.shareClientConfig);
14814
14917
  }
14815
14918
  /**
14816
14919
  * Creates a Share.
@@ -15117,6 +15220,14 @@ class ShareServiceClient extends StorageClient {
15117
15220
  }
15118
15221
  }
15119
15222
 
15223
+ // Copyright (c) Microsoft Corporation.
15224
+ // Licensed under the MIT license.
15225
+ /** Known values of {@link ShareTokenIntent} that the service accepts. */
15226
+ exports.KnownShareTokenIntent = void 0;
15227
+ (function (KnownShareTokenIntent) {
15228
+ KnownShareTokenIntent["Backup"] = "backup";
15229
+ })(exports.KnownShareTokenIntent || (exports.KnownShareTokenIntent = {}));
15230
+
15120
15231
  Object.defineProperty(exports, 'RestError', {
15121
15232
  enumerable: true,
15122
15233
  get: function () { return coreRestPipeline.RestError; }
@@ -15141,6 +15252,7 @@ exports.ShareSASPermissions = ShareSASPermissions;
15141
15252
  exports.ShareServiceClient = ShareServiceClient;
15142
15253
  exports.StorageBrowserPolicy = StorageBrowserPolicy;
15143
15254
  exports.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory;
15255
+ exports.StorageOAuthScopes = StorageOAuthScopes;
15144
15256
  exports.StorageRetryPolicy = StorageRetryPolicy;
15145
15257
  exports.StorageRetryPolicyFactory = StorageRetryPolicyFactory;
15146
15258
  exports.StorageSharedKeyCredential = StorageSharedKeyCredential;