@azure/storage-file-share 12.20.0-alpha.20230720.6 → 12.20.0-alpha.20230724.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 (30) hide show
  1. package/dist/index.js +200 -74
  2. package/dist/index.js.map +1 -1
  3. package/dist-esm/storage-file-share/src/Clients.js +58 -51
  4. package/dist-esm/storage-file-share/src/Clients.js.map +1 -1
  5. package/dist-esm/storage-file-share/src/ShareServiceClient.js +7 -4
  6. package/dist-esm/storage-file-share/src/ShareServiceClient.js.map +1 -1
  7. package/dist-esm/storage-file-share/src/StorageClient.js +0 -4
  8. package/dist-esm/storage-file-share/src/StorageClient.js.map +1 -1
  9. package/dist-esm/storage-file-share/src/generated/src/models/index.js +6 -0
  10. package/dist-esm/storage-file-share/src/generated/src/models/index.js.map +1 -1
  11. package/dist-esm/storage-file-share/src/generated/src/models/mappers.js +15 -0
  12. package/dist-esm/storage-file-share/src/generated/src/models/mappers.js.map +1 -1
  13. package/dist-esm/storage-file-share/src/generated/src/models/parameters.js +31 -1
  14. package/dist-esm/storage-file-share/src/generated/src/models/parameters.js.map +1 -1
  15. package/dist-esm/storage-file-share/src/generated/src/operations/directory.js +29 -4
  16. package/dist-esm/storage-file-share/src/generated/src/operations/directory.js.map +1 -1
  17. package/dist-esm/storage-file-share/src/generated/src/operations/file.js +49 -8
  18. package/dist-esm/storage-file-share/src/generated/src/operations/file.js.map +1 -1
  19. package/dist-esm/storage-file-share/src/generated/src/operations/share.js +3 -1
  20. package/dist-esm/storage-file-share/src/generated/src/operations/share.js.map +1 -1
  21. package/dist-esm/storage-file-share/src/generated/src/storageClient.js +1 -1
  22. package/dist-esm/storage-file-share/src/generated/src/storageClient.js.map +1 -1
  23. package/dist-esm/storage-file-share/src/generatedModels.js +5 -1
  24. package/dist-esm/storage-file-share/src/generatedModels.js.map +1 -1
  25. package/dist-esm/storage-file-share/src/models.js.map +1 -1
  26. package/dist-esm/storage-file-share/src/utils/constants.js +1 -1
  27. package/dist-esm/storage-file-share/src/utils/constants.js.map +1 -1
  28. package/package.json +2 -1
  29. package/types/3.1/storage-file-share.d.ts +172 -12
  30. package/types/latest/storage-file-share.d.ts +178 -12
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;
@@ -3718,6 +3718,21 @@ const HandleItem = {
3718
3718
  type: {
3719
3719
  name: "DateTimeRfc1123"
3720
3720
  }
3721
+ },
3722
+ accessRightList: {
3723
+ serializedName: "AccessRightList",
3724
+ xmlName: "AccessRightList",
3725
+ xmlIsWrapped: true,
3726
+ xmlElementName: "AccessRight",
3727
+ type: {
3728
+ name: "Sequence",
3729
+ element: {
3730
+ type: {
3731
+ name: "Enum",
3732
+ allowedValues: ["Read", "Write", "Delete"]
3733
+ }
3734
+ }
3735
+ }
3721
3736
  }
3722
3737
  }
3723
3738
  }
@@ -8054,7 +8069,7 @@ const timeoutInSeconds = {
8054
8069
  const version = {
8055
8070
  parameterPath: "version",
8056
8071
  mapper: {
8057
- defaultValue: "2021-12-02",
8072
+ defaultValue: "2023-01-03",
8058
8073
  isConstant: true,
8059
8074
  serializedName: "x-ms-version",
8060
8075
  type: {
@@ -8388,6 +8403,16 @@ const comp4 = {
8388
8403
  }
8389
8404
  }
8390
8405
  };
8406
+ const fileRequestIntent = {
8407
+ parameterPath: ["options", "fileRequestIntent"],
8408
+ mapper: {
8409
+ serializedName: "x-ms-file-request-intent",
8410
+ xmlName: "x-ms-file-request-intent",
8411
+ type: {
8412
+ name: "String"
8413
+ }
8414
+ }
8415
+ };
8391
8416
  const accept2 = {
8392
8417
  parameterPath: "accept",
8393
8418
  mapper: {
@@ -8503,6 +8528,16 @@ const restype2 = {
8503
8528
  }
8504
8529
  }
8505
8530
  };
8531
+ const allowTrailingDot = {
8532
+ parameterPath: ["options", "allowTrailingDot"],
8533
+ mapper: {
8534
+ serializedName: "x-ms-allow-trailing-dot",
8535
+ xmlName: "x-ms-allow-trailing-dot",
8536
+ type: {
8537
+ name: "Boolean"
8538
+ }
8539
+ }
8540
+ };
8506
8541
  const filePermission = {
8507
8542
  parameterPath: ["options", "filePermission"],
8508
8543
  mapper: {
@@ -8741,6 +8776,16 @@ const fileChangeTime = {
8741
8776
  }
8742
8777
  }
8743
8778
  };
8779
+ const allowSourceTrailingDot = {
8780
+ parameterPath: ["options", "allowSourceTrailingDot"],
8781
+ mapper: {
8782
+ serializedName: "x-ms-source-allow-trailing-dot",
8783
+ xmlName: "x-ms-source-allow-trailing-dot",
8784
+ type: {
8785
+ name: "Boolean"
8786
+ }
8787
+ }
8788
+ };
8744
8789
  const fileContentLength = {
8745
8790
  parameterPath: "fileContentLength",
8746
8791
  mapper: {
@@ -9668,7 +9713,8 @@ const createPermissionOperationSpec = {
9668
9713
  headerParameters: [
9669
9714
  version,
9670
9715
  accept1,
9671
- contentType1
9716
+ contentType1,
9717
+ fileRequestIntent
9672
9718
  ],
9673
9719
  mediaType: "json",
9674
9720
  serializer
@@ -9694,6 +9740,7 @@ const getPermissionOperationSpec = {
9694
9740
  urlParameters: [url],
9695
9741
  headerParameters: [
9696
9742
  version,
9743
+ fileRequestIntent,
9697
9744
  accept2,
9698
9745
  filePermissionKey
9699
9746
  ],
@@ -9990,6 +10037,8 @@ const createOperationSpec$1 = {
9990
10037
  version,
9991
10038
  accept1,
9992
10039
  metadata,
10040
+ fileRequestIntent,
10041
+ allowTrailingDot,
9993
10042
  filePermission,
9994
10043
  filePermissionKey1,
9995
10044
  fileAttributes,
@@ -10018,7 +10067,12 @@ const getPropertiesOperationSpec$1 = {
10018
10067
  restype2
10019
10068
  ],
10020
10069
  urlParameters: [url],
10021
- headerParameters: [version, accept1],
10070
+ headerParameters: [
10071
+ version,
10072
+ accept1,
10073
+ fileRequestIntent,
10074
+ allowTrailingDot
10075
+ ],
10022
10076
  isXML: true,
10023
10077
  serializer: xmlSerializer$1
10024
10078
  };
@@ -10036,7 +10090,12 @@ const deleteOperationSpec$1 = {
10036
10090
  },
10037
10091
  queryParameters: [timeoutInSeconds, restype2],
10038
10092
  urlParameters: [url],
10039
- headerParameters: [version, accept1],
10093
+ headerParameters: [
10094
+ version,
10095
+ accept1,
10096
+ fileRequestIntent,
10097
+ allowTrailingDot
10098
+ ],
10040
10099
  isXML: true,
10041
10100
  serializer: xmlSerializer$1
10042
10101
  };
@@ -10061,6 +10120,8 @@ const setPropertiesOperationSpec = {
10061
10120
  headerParameters: [
10062
10121
  version,
10063
10122
  accept1,
10123
+ fileRequestIntent,
10124
+ allowTrailingDot,
10064
10125
  filePermission,
10065
10126
  filePermissionKey1,
10066
10127
  fileAttributes,
@@ -10092,7 +10153,9 @@ const setMetadataOperationSpec$1 = {
10092
10153
  headerParameters: [
10093
10154
  version,
10094
10155
  accept1,
10095
- metadata
10156
+ metadata,
10157
+ fileRequestIntent,
10158
+ allowTrailingDot
10096
10159
  ],
10097
10160
  isXML: true,
10098
10161
  serializer: xmlSerializer$1
@@ -10124,6 +10187,8 @@ const listFilesAndDirectoriesSegmentOperationSpec = {
10124
10187
  headerParameters: [
10125
10188
  version,
10126
10189
  accept1,
10190
+ fileRequestIntent,
10191
+ allowTrailingDot,
10127
10192
  includeExtendedInfo
10128
10193
  ],
10129
10194
  isXML: true,
@@ -10153,6 +10218,8 @@ const listHandlesOperationSpec$1 = {
10153
10218
  headerParameters: [
10154
10219
  version,
10155
10220
  accept1,
10221
+ fileRequestIntent,
10222
+ allowTrailingDot,
10156
10223
  recursive
10157
10224
  ],
10158
10225
  isXML: true,
@@ -10180,6 +10247,8 @@ const forceCloseHandlesOperationSpec$1 = {
10180
10247
  headerParameters: [
10181
10248
  version,
10182
10249
  accept1,
10250
+ fileRequestIntent,
10251
+ allowTrailingDot,
10183
10252
  recursive,
10184
10253
  handleId
10185
10254
  ],
@@ -10208,6 +10277,8 @@ const renameOperationSpec$1 = {
10208
10277
  version,
10209
10278
  accept1,
10210
10279
  metadata,
10280
+ fileRequestIntent,
10281
+ allowTrailingDot,
10211
10282
  filePermission,
10212
10283
  filePermissionKey1,
10213
10284
  renameSource,
@@ -10218,7 +10289,8 @@ const renameOperationSpec$1 = {
10218
10289
  fileAttributes1,
10219
10290
  fileCreationTime,
10220
10291
  fileLastWriteTime,
10221
- fileChangeTime
10292
+ fileChangeTime,
10293
+ allowSourceTrailingDot
10222
10294
  ],
10223
10295
  isXML: true,
10224
10296
  serializer: xmlSerializer$1
@@ -10433,6 +10505,8 @@ const createOperationSpec = {
10433
10505
  accept1,
10434
10506
  metadata,
10435
10507
  leaseId,
10508
+ fileRequestIntent,
10509
+ allowTrailingDot,
10436
10510
  filePermission,
10437
10511
  filePermissionKey1,
10438
10512
  fileAttributes,
@@ -10480,6 +10554,8 @@ const downloadOperationSpec = {
10480
10554
  version,
10481
10555
  accept1,
10482
10556
  leaseId,
10557
+ fileRequestIntent,
10558
+ allowTrailingDot,
10483
10559
  range,
10484
10560
  rangeGetContentMD5
10485
10561
  ],
@@ -10503,7 +10579,9 @@ const getPropertiesOperationSpec = {
10503
10579
  headerParameters: [
10504
10580
  version,
10505
10581
  accept1,
10506
- leaseId
10582
+ leaseId,
10583
+ fileRequestIntent,
10584
+ allowTrailingDot
10507
10585
  ],
10508
10586
  isXML: true,
10509
10587
  serializer: xmlSerializer
@@ -10525,7 +10603,9 @@ const deleteOperationSpec = {
10525
10603
  headerParameters: [
10526
10604
  version,
10527
10605
  accept1,
10528
- leaseId
10606
+ leaseId,
10607
+ fileRequestIntent,
10608
+ allowTrailingDot
10529
10609
  ],
10530
10610
  isXML: true,
10531
10611
  serializer: xmlSerializer
@@ -10548,6 +10628,8 @@ const setHttpHeadersOperationSpec = {
10548
10628
  version,
10549
10629
  accept1,
10550
10630
  leaseId,
10631
+ fileRequestIntent,
10632
+ allowTrailingDot,
10551
10633
  filePermission,
10552
10634
  filePermissionKey1,
10553
10635
  fileAttributes,
@@ -10583,7 +10665,9 @@ const setMetadataOperationSpec = {
10583
10665
  version,
10584
10666
  accept1,
10585
10667
  metadata,
10586
- leaseId
10668
+ leaseId,
10669
+ fileRequestIntent,
10670
+ allowTrailingDot
10587
10671
  ],
10588
10672
  isXML: true,
10589
10673
  serializer: xmlSerializer
@@ -10608,7 +10692,9 @@ const acquireLeaseOperationSpec = {
10608
10692
  action,
10609
10693
  duration,
10610
10694
  proposedLeaseId,
10611
- requestId
10695
+ requestId,
10696
+ fileRequestIntent,
10697
+ allowTrailingDot
10612
10698
  ],
10613
10699
  isXML: true,
10614
10700
  serializer: xmlSerializer
@@ -10632,7 +10718,9 @@ const releaseLeaseOperationSpec = {
10632
10718
  accept1,
10633
10719
  requestId,
10634
10720
  action1,
10635
- leaseId1
10721
+ leaseId1,
10722
+ fileRequestIntent,
10723
+ allowTrailingDot
10636
10724
  ],
10637
10725
  isXML: true,
10638
10726
  serializer: xmlSerializer
@@ -10657,7 +10745,9 @@ const changeLeaseOperationSpec = {
10657
10745
  proposedLeaseId,
10658
10746
  requestId,
10659
10747
  leaseId1,
10660
- action2
10748
+ action2,
10749
+ fileRequestIntent,
10750
+ allowTrailingDot
10661
10751
  ],
10662
10752
  isXML: true,
10663
10753
  serializer: xmlSerializer
@@ -10681,7 +10771,9 @@ const breakLeaseOperationSpec = {
10681
10771
  accept1,
10682
10772
  leaseId,
10683
10773
  requestId,
10684
- action4
10774
+ action4,
10775
+ fileRequestIntent,
10776
+ allowTrailingDot
10685
10777
  ],
10686
10778
  isXML: true,
10687
10779
  serializer: xmlSerializer
@@ -10704,6 +10796,8 @@ const uploadRangeOperationSpec = {
10704
10796
  headerParameters: [
10705
10797
  version,
10706
10798
  leaseId,
10799
+ fileRequestIntent,
10800
+ allowTrailingDot,
10707
10801
  contentType2,
10708
10802
  accept3,
10709
10803
  range1,
@@ -10735,6 +10829,8 @@ const uploadRangeFromURLOperationSpec = {
10735
10829
  version,
10736
10830
  accept1,
10737
10831
  leaseId,
10832
+ allowTrailingDot,
10833
+ allowSourceTrailingDot,
10738
10834
  range1,
10739
10835
  contentLength,
10740
10836
  fileLastWrittenMode,
@@ -10773,6 +10869,8 @@ const getRangeListOperationSpec = {
10773
10869
  version,
10774
10870
  accept1,
10775
10871
  leaseId,
10872
+ fileRequestIntent,
10873
+ allowTrailingDot,
10776
10874
  range
10777
10875
  ],
10778
10876
  isXML: true,
@@ -10797,12 +10895,15 @@ const startCopyOperationSpec = {
10797
10895
  accept1,
10798
10896
  metadata,
10799
10897
  leaseId,
10898
+ fileRequestIntent,
10899
+ allowTrailingDot,
10800
10900
  filePermission,
10801
10901
  filePermissionKey1,
10802
10902
  fileAttributes1,
10803
10903
  fileCreationTime,
10804
10904
  fileLastWriteTime,
10805
10905
  fileChangeTime,
10906
+ allowSourceTrailingDot,
10806
10907
  copySource,
10807
10908
  filePermissionCopyMode,
10808
10909
  ignoreReadOnly1,
@@ -10833,6 +10934,8 @@ const abortCopyOperationSpec = {
10833
10934
  version,
10834
10935
  accept1,
10835
10936
  leaseId,
10937
+ fileRequestIntent,
10938
+ allowTrailingDot,
10836
10939
  copyActionAbortConstant
10837
10940
  ],
10838
10941
  isXML: true,
@@ -10859,7 +10962,12 @@ const listHandlesOperationSpec = {
10859
10962
  comp9
10860
10963
  ],
10861
10964
  urlParameters: [url],
10862
- headerParameters: [version, accept1],
10965
+ headerParameters: [
10966
+ version,
10967
+ accept1,
10968
+ fileRequestIntent,
10969
+ allowTrailingDot
10970
+ ],
10863
10971
  isXML: true,
10864
10972
  serializer: xmlSerializer
10865
10973
  };
@@ -10885,6 +10993,8 @@ const forceCloseHandlesOperationSpec = {
10885
10993
  headerParameters: [
10886
10994
  version,
10887
10995
  accept1,
10996
+ fileRequestIntent,
10997
+ allowTrailingDot,
10888
10998
  handleId
10889
10999
  ],
10890
11000
  isXML: true,
@@ -10908,6 +11018,8 @@ const renameOperationSpec = {
10908
11018
  version,
10909
11019
  accept1,
10910
11020
  metadata,
11021
+ fileRequestIntent,
11022
+ allowTrailingDot,
10911
11023
  filePermission,
10912
11024
  filePermissionKey1,
10913
11025
  renameSource,
@@ -10919,6 +11031,7 @@ const renameOperationSpec = {
10919
11031
  fileCreationTime,
10920
11032
  fileLastWriteTime,
10921
11033
  fileChangeTime,
11034
+ allowSourceTrailingDot,
10922
11035
  fileContentType
10923
11036
  ],
10924
11037
  isXML: true,
@@ -10962,7 +11075,7 @@ class StorageClient$1 extends coreHttpCompat__namespace.ExtendedServiceClient {
10962
11075
  // Parameter assignments
10963
11076
  this.url = url;
10964
11077
  // Assigning values to Constant parameters
10965
- this.version = options.version || "2021-12-02";
11078
+ this.version = options.version || "2023-01-03";
10966
11079
  this.fileRangeWriteFromUrl = options.fileRangeWriteFromUrl || "update";
10967
11080
  this.service = new ServiceImpl(this);
10968
11081
  this.share = new ShareImpl(this);
@@ -11009,9 +11122,6 @@ class StorageClient {
11009
11122
  storageClientContext.requestContentType = undefined;
11010
11123
  }
11011
11124
  const credential = getCredentialFromPipeline(pipeline);
11012
- if (coreAuth.isTokenCredential(credential)) {
11013
- throw new Error("Unsupported TokenCredential type found in pipeline.");
11014
- }
11015
11125
  this.credential = credential;
11016
11126
  }
11017
11127
  }
@@ -12233,21 +12343,22 @@ class ShareClient extends StorageClient {
12233
12343
  url = urlOrConnectionString;
12234
12344
  pipeline = credentialOrPipelineOrShareName;
12235
12345
  }
12236
- else if (credentialOrPipelineOrShareName instanceof Credential) {
12237
- // (url: string, credential?: Credential, options?: StoragePipelineOptions)
12346
+ else if (credentialOrPipelineOrShareName instanceof Credential ||
12347
+ coreAuth.isTokenCredential(credentialOrPipelineOrShareName)) {
12348
+ // (url: string, credential?: Credential, options?: ShareClientOptions)
12238
12349
  url = urlOrConnectionString;
12239
12350
  pipeline = newPipeline(credentialOrPipelineOrShareName, options);
12240
12351
  }
12241
12352
  else if (!credentialOrPipelineOrShareName &&
12242
12353
  typeof credentialOrPipelineOrShareName !== "string") {
12243
- // (url: string, credential?: Credential, options?: StoragePipelineOptions)
12354
+ // (url: string, credential?: Credential, options?: ShareClientOptions)
12244
12355
  // The second parameter is undefined. Use anonymous credential.
12245
12356
  url = urlOrConnectionString;
12246
12357
  pipeline = newPipeline(new AnonymousCredential(), options);
12247
12358
  }
12248
12359
  else if (credentialOrPipelineOrShareName &&
12249
12360
  typeof credentialOrPipelineOrShareName === "string") {
12250
- // (connectionString: string, name: string, options?: StoragePipelineOptions)
12361
+ // (connectionString: string, name: string, options?: ShareClientOptions)
12251
12362
  const extractedCreds = extractConnectionStringParts(urlOrConnectionString);
12252
12363
  const name = credentialOrPipelineOrShareName;
12253
12364
  if (extractedCreds.kind === "AccountConnString") {
@@ -12273,6 +12384,7 @@ class ShareClient extends StorageClient {
12273
12384
  }
12274
12385
  super(url, pipeline);
12275
12386
  this._name = getShareNameAndPathFromUrl(this.url).shareName;
12387
+ this.shareClientConfig = options;
12276
12388
  this.context = this.storageClientContext.share;
12277
12389
  }
12278
12390
  /**
@@ -12283,7 +12395,7 @@ class ShareClient extends StorageClient {
12283
12395
  * @returns A new ShareClient object identical to the source but with the specified snapshot timestamp
12284
12396
  */
12285
12397
  withSnapshot(snapshot) {
12286
- return new ShareClient(setURLParameter$1(this.url, URLConstants$1.Parameters.SHARE_SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline);
12398
+ return new ShareClient(setURLParameter$1(this.url, URLConstants$1.Parameters.SHARE_SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline, this.shareClientConfig);
12287
12399
  }
12288
12400
  /**
12289
12401
  * Creates a new share under the specified account. If the share with
@@ -12329,7 +12441,7 @@ class ShareClient extends StorageClient {
12329
12441
  // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
12330
12442
  /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */
12331
12443
  getDirectoryClient(directoryName) {
12332
- return new ShareDirectoryClient(appendToURLPath(this.url, EscapePath(directoryName)), this.pipeline);
12444
+ return new ShareDirectoryClient(appendToURLPath(this.url, EscapePath(directoryName)), this.pipeline, this.shareClientConfig);
12333
12445
  }
12334
12446
  /**
12335
12447
  * Gets the directory client for the root directory of this share.
@@ -12659,7 +12771,7 @@ class ShareClient extends StorageClient {
12659
12771
  return tracingClient.withSpan("ShareClient-createPermission", options, async (updatedOptions) => {
12660
12772
  return assertResponse(await this.context.createPermission({
12661
12773
  permission: filePermission,
12662
- }, updatedOptions));
12774
+ }, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
12663
12775
  });
12664
12776
  }
12665
12777
  /**
@@ -12672,7 +12784,7 @@ class ShareClient extends StorageClient {
12672
12784
  */
12673
12785
  async getPermission(filePermissionKey, options = {}) {
12674
12786
  return tracingClient.withSpan("ShareClient-getPermission", options, async (updatedOptions) => {
12675
- return assertResponse(await this.context.getPermission(filePermissionKey, updatedOptions));
12787
+ return assertResponse(await this.context.getPermission(filePermissionKey, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
12676
12788
  });
12677
12789
  }
12678
12790
  /**
@@ -12724,7 +12836,8 @@ class ShareDirectoryClient extends StorageClient {
12724
12836
  if (credentialOrPipeline instanceof Pipeline) {
12725
12837
  pipeline = credentialOrPipeline;
12726
12838
  }
12727
- else if (credentialOrPipeline instanceof Credential) {
12839
+ else if (credentialOrPipeline instanceof Credential ||
12840
+ coreAuth.isTokenCredential(credentialOrPipeline)) {
12728
12841
  pipeline = newPipeline(credentialOrPipeline, options);
12729
12842
  }
12730
12843
  else {
@@ -12737,6 +12850,7 @@ class ShareDirectoryClient extends StorageClient {
12737
12850
  shareName: this._shareName,
12738
12851
  path: this._path,
12739
12852
  } = getShareNameAndPathFromUrl(this.url));
12853
+ this.shareClientConfig = options;
12740
12854
  this.context = this.storageClientContext.directory;
12741
12855
  }
12742
12856
  /**
@@ -12757,7 +12871,7 @@ class ShareDirectoryClient extends StorageClient {
12757
12871
  return tracingClient.withSpan("ShareDirectoryClient-create", options, async (updatedOptions) => {
12758
12872
  return assertResponse(await this.context.create(updatedOptions.fileAttributes
12759
12873
  ? fileAttributesToString(updatedOptions.fileAttributes)
12760
- : FileAttributesNone, Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime) })));
12874
+ : FileAttributesNone, Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime) }), this.shareClientConfig)));
12761
12875
  });
12762
12876
  }
12763
12877
  /**
@@ -12794,7 +12908,7 @@ class ShareDirectoryClient extends StorageClient {
12794
12908
  return tracingClient.withSpan("ShareDirectoryClient-setProperties", properties, async (updatedOptions) => {
12795
12909
  return assertResponse(await this.context.setProperties(updatedOptions.fileAttributes
12796
12910
  ? fileAttributesToString(updatedOptions.fileAttributes)
12797
- : FileAttributesPreserve, Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime) })));
12911
+ : FileAttributesPreserve, Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime) }), this.shareClientConfig)));
12798
12912
  });
12799
12913
  }
12800
12914
  /**
@@ -12812,7 +12926,7 @@ class ShareDirectoryClient extends StorageClient {
12812
12926
  * ```
12813
12927
  */
12814
12928
  getDirectoryClient(subDirectoryName) {
12815
- return new ShareDirectoryClient(appendToURLPath(this.url, EscapePath(subDirectoryName)), this.pipeline);
12929
+ return new ShareDirectoryClient(appendToURLPath(this.url, EscapePath(subDirectoryName)), this.pipeline, this.shareClientConfig);
12816
12930
  }
12817
12931
  /**
12818
12932
  * Creates a new subdirectory under this directory.
@@ -12913,7 +13027,7 @@ class ShareDirectoryClient extends StorageClient {
12913
13027
  // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
12914
13028
  /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */
12915
13029
  getFileClient(fileName) {
12916
- return new ShareFileClient(appendToURLPath(this.url, EscapePath(fileName)), this.pipeline);
13030
+ return new ShareFileClient(appendToURLPath(this.url, EscapePath(fileName)), this.pipeline, this.shareClientConfig);
12917
13031
  }
12918
13032
  /**
12919
13033
  * Returns true if the specified directory exists; false otherwise.
@@ -12927,7 +13041,7 @@ class ShareDirectoryClient extends StorageClient {
12927
13041
  async exists(options = {}) {
12928
13042
  return tracingClient.withSpan("ShareDirectoryClient-exists", options, async (updatedOptions) => {
12929
13043
  try {
12930
- await this.getProperties(updatedOptions);
13044
+ await this.getProperties(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
12931
13045
  return true;
12932
13046
  }
12933
13047
  catch (e) {
@@ -12949,7 +13063,7 @@ class ShareDirectoryClient extends StorageClient {
12949
13063
  */
12950
13064
  async getProperties(options = {}) {
12951
13065
  return tracingClient.withSpan("ShareDirectoryClient-getProperties", options, async (updatedOptions) => {
12952
- return assertResponse(await this.context.getProperties(updatedOptions));
13066
+ return assertResponse(await this.context.getProperties(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
12953
13067
  });
12954
13068
  }
12955
13069
  /**
@@ -12962,7 +13076,7 @@ class ShareDirectoryClient extends StorageClient {
12962
13076
  */
12963
13077
  async delete(options = {}) {
12964
13078
  return tracingClient.withSpan("ShareDirectoryClient-delete", options, async (updatedOptions) => {
12965
- return assertResponse(await this.context.delete(updatedOptions));
13079
+ return assertResponse(await this.context.delete(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
12966
13080
  });
12967
13081
  }
12968
13082
  /**
@@ -12998,7 +13112,7 @@ class ShareDirectoryClient extends StorageClient {
12998
13112
  */
12999
13113
  async setMetadata(metadata, options = {}) {
13000
13114
  return tracingClient.withSpan("ShareDirectoryClient-setMetadata", options, async (updatedOptions) => {
13001
- return assertResponse(await this.context.setMetadata(Object.assign(Object.assign({}, updatedOptions), { metadata })));
13115
+ return assertResponse(await this.context.setMetadata(Object.assign(Object.assign(Object.assign({}, updatedOptions), { metadata }), this.shareClientConfig)));
13002
13116
  });
13003
13117
  }
13004
13118
  /**
@@ -13210,7 +13324,7 @@ class ShareDirectoryClient extends StorageClient {
13210
13324
  options.prefix = undefined;
13211
13325
  }
13212
13326
  return tracingClient.withSpan("ShareDirectoryClient-listFilesAndDirectoriesSegment", options, async (updatedOptions) => {
13213
- const rawResponse = assertResponse(await this.context.listFilesAndDirectoriesSegment(Object.assign(Object.assign({}, updatedOptions), { marker })));
13327
+ const rawResponse = assertResponse(await this.context.listFilesAndDirectoriesSegment(Object.assign(Object.assign(Object.assign({}, updatedOptions), { marker }), this.shareClientConfig)));
13214
13328
  const wrappedResponse = Object.assign(Object.assign({}, ConvertInternalResponseOfListFiles(rawResponse)), { _response: Object.assign(Object.assign({}, rawResponse._response), { parsedBody: ConvertInternalResponseOfListFiles(rawResponse._response.parsedBody) }) });
13215
13329
  return wrappedResponse;
13216
13330
  });
@@ -13386,7 +13500,7 @@ class ShareDirectoryClient extends StorageClient {
13386
13500
  async listHandlesSegment(marker, options = {}) {
13387
13501
  return tracingClient.withSpan("ShareDirectoryClient-listHandlesSegment", options, async (updatedOptions) => {
13388
13502
  marker = marker === "" ? undefined : marker;
13389
- const response = assertResponse(await this.context.listHandles(Object.assign(Object.assign({}, updatedOptions), { marker })));
13503
+ const response = assertResponse(await this.context.listHandles(Object.assign(Object.assign(Object.assign({}, updatedOptions), { marker }), this.shareClientConfig)));
13390
13504
  // TODO: Protocol layer issue that when handle list is in returned XML
13391
13505
  // response.handleList is an empty string
13392
13506
  if (response.handleList === "") {
@@ -13413,7 +13527,7 @@ class ShareDirectoryClient extends StorageClient {
13413
13527
  if (marker === "") {
13414
13528
  marker = undefined;
13415
13529
  }
13416
- const rawResponse = assertResponse(await this.context.forceCloseHandles("*", Object.assign(Object.assign({}, updatedOptions), { marker })));
13530
+ const rawResponse = assertResponse(await this.context.forceCloseHandles("*", Object.assign(Object.assign(Object.assign({}, updatedOptions), { marker }), this.shareClientConfig)));
13417
13531
  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
13532
  });
13419
13533
  }
@@ -13459,7 +13573,7 @@ class ShareDirectoryClient extends StorageClient {
13459
13573
  if (handleId === "*") {
13460
13574
  throw new RangeError(`Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`);
13461
13575
  }
13462
- const rawResponse = await this.context.forceCloseHandles(handleId, updatedOptions);
13576
+ const rawResponse = await this.context.forceCloseHandles(handleId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
13463
13577
  const response = rawResponse;
13464
13578
  response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
13465
13579
  response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
@@ -13500,9 +13614,9 @@ class ShareDirectoryClient extends StorageClient {
13500
13614
  else {
13501
13615
  throw new RangeError("Destination path should not contain more than one query string");
13502
13616
  }
13503
- const destDirectory = new ShareDirectoryClient(destinationUrl, this.pipeline);
13617
+ const destDirectory = new ShareDirectoryClient(destinationUrl, this.pipeline, this.shareClientConfig);
13504
13618
  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
13619
+ const response = assertResponse(await destDirectory.context.rename(this.url, Object.assign(Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
13506
13620
  ? {
13507
13621
  sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,
13508
13622
  }
@@ -13510,7 +13624,7 @@ class ShareDirectoryClient extends StorageClient {
13510
13624
  ? {
13511
13625
  destinationLeaseId: updatedOptions.destinationLeaseAccessConditions.leaseId,
13512
13626
  }
13513
- : undefined })));
13627
+ : undefined }), this.shareClientConfig)));
13514
13628
  return {
13515
13629
  destinationDirectoryClient: destDirectory,
13516
13630
  directoryRenameResponse: response,
@@ -13548,7 +13662,8 @@ class ShareFileClient extends StorageClient {
13548
13662
  if (credentialOrPipeline instanceof Pipeline) {
13549
13663
  pipeline = credentialOrPipeline;
13550
13664
  }
13551
- else if (credentialOrPipeline instanceof Credential) {
13665
+ else if (credentialOrPipeline instanceof Credential ||
13666
+ coreAuth.isTokenCredential(credentialOrPipeline)) {
13552
13667
  pipeline = newPipeline(credentialOrPipeline, options);
13553
13668
  }
13554
13669
  else {
@@ -13561,6 +13676,7 @@ class ShareFileClient extends StorageClient {
13561
13676
  shareName: this._shareName,
13562
13677
  path: this._path,
13563
13678
  } = getShareNameAndPathFromUrl(this.url));
13679
+ this.shareClientConfig = options;
13564
13680
  this.context = this.storageClientContext.file;
13565
13681
  }
13566
13682
  /**
@@ -13571,7 +13687,7 @@ class ShareFileClient extends StorageClient {
13571
13687
  * @returns A new ShareFileClient object identical to the source but with the specified share snapshot timestamp.
13572
13688
  */
13573
13689
  withShareSnapshot(shareSnapshot) {
13574
- return new ShareFileClient(setURLParameter$1(this.url, URLConstants$1.Parameters.SHARE_SNAPSHOT, shareSnapshot.length === 0 ? undefined : shareSnapshot), this.pipeline);
13690
+ return new ShareFileClient(setURLParameter$1(this.url, URLConstants$1.Parameters.SHARE_SNAPSHOT, shareSnapshot.length === 0 ? undefined : shareSnapshot), this.pipeline, this.shareClientConfig);
13575
13691
  }
13576
13692
  /**
13577
13693
  * Creates a new file or replaces a file. Note it only initializes the file with no content.
@@ -13604,7 +13720,7 @@ class ShareFileClient extends StorageClient {
13604
13720
  return tracingClient.withSpan("ShareFileClient-create", options, async (updatedOptions) => {
13605
13721
  return assertResponse(await this.context.create(size, updatedOptions.fileAttributes
13606
13722
  ? fileAttributesToString(updatedOptions.fileAttributes)
13607
- : FileAttributesNone, Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime) })));
13723
+ : FileAttributesNone, Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime) }), this.shareClientConfig)));
13608
13724
  });
13609
13725
  }
13610
13726
  /**
@@ -13674,9 +13790,9 @@ class ShareFileClient extends StorageClient {
13674
13790
  throw new RangeError(`rangeGetContentMD5 only works with partial data downloading`);
13675
13791
  }
13676
13792
  const downloadFullFile = offset === 0 && !count;
13677
- const res = assertResponse(await this.context.download(Object.assign(Object.assign({}, updatedOptions), { requestOptions: {
13793
+ const res = assertResponse(await this.context.download(Object.assign(Object.assign(Object.assign({}, updatedOptions), { requestOptions: {
13678
13794
  onDownloadProgress: coreUtil.isNode ? undefined : updatedOptions.onProgress, // for Node.js, progress is reported by RetriableReadableStream
13679
- }, range: downloadFullFile ? undefined : rangeToString({ offset, count }) })));
13795
+ }, range: downloadFullFile ? undefined : rangeToString({ offset, count }) }), this.shareClientConfig)));
13680
13796
  // Return browser response immediately
13681
13797
  if (!coreUtil.isNode) {
13682
13798
  return res;
@@ -13706,7 +13822,7 @@ class ShareFileClient extends StorageClient {
13706
13822
  // chunkDownloadOptions.range
13707
13823
  // }, options: ${JSON.stringify(chunkDownloadOptions)}`
13708
13824
  // );
13709
- const downloadRes = await this.context.download(Object.assign(Object.assign({}, updatedOptions), updatedDownloadOptions));
13825
+ const downloadRes = await this.context.download(Object.assign(Object.assign(Object.assign({}, updatedOptions), updatedDownloadOptions), this.shareClientConfig));
13710
13826
  if (!(downloadRes.etag === res.etag)) {
13711
13827
  throw new Error("File has been modified concurrently");
13712
13828
  }
@@ -13750,7 +13866,7 @@ class ShareFileClient extends StorageClient {
13750
13866
  */
13751
13867
  async getProperties(options = {}) {
13752
13868
  return tracingClient.withSpan("ShareFileClient-getProperties", options, async (updatedOptions) => {
13753
- return assertResponse(await this.context.getProperties(updatedOptions));
13869
+ return assertResponse(await this.context.getProperties(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
13754
13870
  });
13755
13871
  }
13756
13872
  /**
@@ -13768,7 +13884,7 @@ class ShareFileClient extends StorageClient {
13768
13884
  return tracingClient.withSpan("ShareFileClient-setProperties", properties, async (updatedOptions) => {
13769
13885
  return assertResponse(await this.context.setHttpHeaders(updatedOptions.fileAttributes
13770
13886
  ? fileAttributesToString(updatedOptions.fileAttributes)
13771
- : FileAttributesPreserve, Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime) })));
13887
+ : FileAttributesPreserve, Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime) }), this.shareClientConfig)));
13772
13888
  });
13773
13889
  }
13774
13890
  /**
@@ -13790,7 +13906,7 @@ class ShareFileClient extends StorageClient {
13790
13906
  */
13791
13907
  async delete(options = {}) {
13792
13908
  return tracingClient.withSpan("ShareFileClient-delete", options, async (updatedOptions) => {
13793
- return assertResponse(await this.context.delete(updatedOptions));
13909
+ return assertResponse(await this.context.delete(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
13794
13910
  });
13795
13911
  }
13796
13912
  /**
@@ -13843,7 +13959,7 @@ class ShareFileClient extends StorageClient {
13843
13959
  return tracingClient.withSpan("ShareFileClient-setHTTPHeaders", options, async (updatedOptions) => {
13844
13960
  return assertResponse(await this.context.setHttpHeaders(updatedOptions.fileAttributes
13845
13961
  ? fileAttributesToString(updatedOptions.fileAttributes)
13846
- : FileAttributesPreserve, Object.assign(Object.assign({}, updatedOptions), { fileHttpHeaders, fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime) })));
13962
+ : FileAttributesPreserve, Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileHttpHeaders, fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime) }), this.shareClientConfig)));
13847
13963
  });
13848
13964
  }
13849
13965
  /**
@@ -13864,7 +13980,7 @@ class ShareFileClient extends StorageClient {
13864
13980
  // FileAttributes, filePermission, createTime, lastWriteTime will all be preserved.
13865
13981
  options = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(options);
13866
13982
  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) })));
13983
+ 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
13984
  });
13869
13985
  }
13870
13986
  /**
@@ -13880,7 +13996,7 @@ class ShareFileClient extends StorageClient {
13880
13996
  */
13881
13997
  async setMetadata(metadata = {}, options = {}) {
13882
13998
  return tracingClient.withSpan("ShareFileClient-setMetadata", options, async (updatedOptions) => {
13883
- return assertResponse(await this.context.setMetadata(Object.assign(Object.assign({}, updatedOptions), { metadata })));
13999
+ return assertResponse(await this.context.setMetadata(Object.assign(Object.assign(Object.assign({}, updatedOptions), { metadata }), this.shareClientConfig)));
13884
14000
  });
13885
14001
  }
13886
14002
  /**
@@ -13921,9 +14037,9 @@ class ShareFileClient extends StorageClient {
13921
14037
  if (contentLength > FILE_RANGE_MAX_SIZE_BYTES) {
13922
14038
  throw new RangeError(`offset must be < ${FILE_RANGE_MAX_SIZE_BYTES} bytes`);
13923
14039
  }
13924
- return assertResponse(await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "update", contentLength, Object.assign(Object.assign({}, updatedOptions), { requestOptions: {
14040
+ return assertResponse(await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "update", contentLength, Object.assign(Object.assign(Object.assign({}, updatedOptions), { requestOptions: {
13925
14041
  onUploadProgress: updatedOptions.onProgress,
13926
- }, body })));
14042
+ }, body }), this.shareClientConfig)));
13927
14043
  });
13928
14044
  }
13929
14045
  /**
@@ -13944,7 +14060,7 @@ class ShareFileClient extends StorageClient {
13944
14060
  if (count <= 0 || count > FILE_RANGE_MAX_SIZE_BYTES) {
13945
14061
  throw new RangeError(`count must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES} bytes`);
13946
14062
  }
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) })));
14063
+ 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
14064
  });
13949
14065
  }
13950
14066
  /**
@@ -13960,7 +14076,7 @@ class ShareFileClient extends StorageClient {
13960
14076
  if (offset < 0 || contentLength <= 0) {
13961
14077
  throw new RangeError(`offset must >= 0 and contentLength must be > 0`);
13962
14078
  }
13963
- return assertResponse(await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "clear", 0, updatedOptions));
14079
+ return assertResponse(await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "clear", 0, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
13964
14080
  });
13965
14081
  }
13966
14082
  /**
@@ -13970,7 +14086,7 @@ class ShareFileClient extends StorageClient {
13970
14086
  */
13971
14087
  async getRangeList(options = {}) {
13972
14088
  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 })));
14089
+ const originalResponse = assertResponse(await this.context.getRangeList(Object.assign(Object.assign(Object.assign({}, updatedOptions), { range: updatedOptions.range ? rangeToString(updatedOptions.range) : undefined }), this.shareClientConfig)));
13974
14090
  // Only returns ranges, ignoring clearRanges.
13975
14091
  const parsedBody = originalResponse._response.parsedBody.ranges
13976
14092
  ? originalResponse._response.parsedBody.ranges
@@ -13986,7 +14102,7 @@ class ShareFileClient extends StorageClient {
13986
14102
  */
13987
14103
  async getRangeListDiff(prevShareSnapshot, options = {}) {
13988
14104
  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 })));
14105
+ 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
14106
  });
13991
14107
  }
13992
14108
  /**
@@ -14003,7 +14119,7 @@ class ShareFileClient extends StorageClient {
14003
14119
  */
14004
14120
  async startCopyFromURL(copySource, options = {}) {
14005
14121
  return tracingClient.withSpan("ShareFileClient-startCopyFromURL", options, async (updatedOptions) => {
14006
- return assertResponse(await this.context.startCopy(copySource, updatedOptions));
14122
+ return assertResponse(await this.context.startCopy(copySource, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
14007
14123
  });
14008
14124
  }
14009
14125
  /**
@@ -14016,7 +14132,7 @@ class ShareFileClient extends StorageClient {
14016
14132
  */
14017
14133
  async abortCopyFromURL(copyId, options = {}) {
14018
14134
  return tracingClient.withSpan("ShareFileClient-abortCopyFromURL", options, async (updatedOptions) => {
14019
- return assertResponse(await this.context.abortCopy(copyId, updatedOptions));
14135
+ return assertResponse(await this.context.abortCopy(copyId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig)));
14020
14136
  });
14021
14137
  }
14022
14138
  // High Level functions
@@ -14354,7 +14470,7 @@ class ShareFileClient extends StorageClient {
14354
14470
  async listHandlesSegment(marker, options = {}) {
14355
14471
  return tracingClient.withSpan("ShareFileClient-listHandlesSegment", options, async (updatedOptions) => {
14356
14472
  marker = marker === "" ? undefined : marker;
14357
- const response = assertResponse(await this.context.listHandles(Object.assign(Object.assign({}, updatedOptions), { marker })));
14473
+ const response = assertResponse(await this.context.listHandles(Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { marker })));
14358
14474
  // TODO: Protocol layer issue that when handle list is in returned XML
14359
14475
  // response.handleList is an empty string
14360
14476
  if (response.handleList === "") {
@@ -14469,7 +14585,7 @@ class ShareFileClient extends StorageClient {
14469
14585
  async forceCloseHandlesSegment(marker, options = {}) {
14470
14586
  return tracingClient.withSpan("ShareFileClient-forceCloseHandlesSegment", options, async (updatedOptions) => {
14471
14587
  marker = marker === "" ? undefined : marker;
14472
- const rawResponse = await this.context.forceCloseHandles("*", Object.assign(Object.assign({}, updatedOptions), { marker }));
14588
+ const rawResponse = await this.context.forceCloseHandles("*", Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { marker }));
14473
14589
  const response = rawResponse;
14474
14590
  response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
14475
14591
  response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
@@ -14516,7 +14632,7 @@ class ShareFileClient extends StorageClient {
14516
14632
  if (handleId === "*") {
14517
14633
  throw new RangeError(`Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`);
14518
14634
  }
14519
- const rawResponse = await this.context.forceCloseHandles(handleId, updatedOptions);
14635
+ const rawResponse = await this.context.forceCloseHandles(handleId, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
14520
14636
  const response = rawResponse;
14521
14637
  response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
14522
14638
  response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
@@ -14584,9 +14700,9 @@ class ShareFileClient extends StorageClient {
14584
14700
  else {
14585
14701
  throw new RangeError("Destination path should not contain more than one query string");
14586
14702
  }
14587
- const destFile = new ShareFileClient(destinationUrl, this.pipeline);
14703
+ const destFile = new ShareFileClient(destinationUrl, this.pipeline, this.shareClientConfig);
14588
14704
  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
14705
+ const response = assertResponse(await destFile.context.rename(this.url, Object.assign(Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
14590
14706
  ? {
14591
14707
  sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,
14592
14708
  }
@@ -14598,7 +14714,7 @@ class ShareFileClient extends StorageClient {
14598
14714
  ? {
14599
14715
  fileContentType: options.contentType,
14600
14716
  }
14601
- : undefined })));
14717
+ : undefined }), this.shareClientConfig)));
14602
14718
  return {
14603
14719
  destinationFileClient: destFile,
14604
14720
  fileRenameResponse: response,
@@ -14763,7 +14879,7 @@ class ShareServiceClient extends StorageClient {
14763
14879
  if (coreUtil.isNode) {
14764
14880
  const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
14765
14881
  const pipeline = newPipeline(sharedKeyCredential, options);
14766
- return new ShareServiceClient(extractedCreds.url, pipeline);
14882
+ return new ShareServiceClient(extractedCreds.url, pipeline, options);
14767
14883
  }
14768
14884
  else {
14769
14885
  throw new Error("Account connection string is only supported in Node.js environment");
@@ -14771,7 +14887,7 @@ class ShareServiceClient extends StorageClient {
14771
14887
  }
14772
14888
  else if (extractedCreds.kind === "SASConnString") {
14773
14889
  const pipeline = newPipeline(new AnonymousCredential(), options);
14774
- return new ShareServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline);
14890
+ return new ShareServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline, options);
14775
14891
  }
14776
14892
  else {
14777
14893
  throw new Error("Connection string must be either an Account connection string or a SAS connection string");
@@ -14785,7 +14901,8 @@ class ShareServiceClient extends StorageClient {
14785
14901
  if (credentialOrPipeline instanceof Pipeline) {
14786
14902
  pipeline = credentialOrPipeline;
14787
14903
  }
14788
- else if (credentialOrPipeline instanceof Credential) {
14904
+ else if (credentialOrPipeline instanceof Credential ||
14905
+ coreAuth.isTokenCredential(credentialOrPipeline)) {
14789
14906
  pipeline = newPipeline(credentialOrPipeline, options);
14790
14907
  }
14791
14908
  else {
@@ -14793,6 +14910,7 @@ class ShareServiceClient extends StorageClient {
14793
14910
  pipeline = newPipeline(new AnonymousCredential(), options);
14794
14911
  }
14795
14912
  super(url, pipeline);
14913
+ this.shareClientConfig = options;
14796
14914
  this.serviceContext = this.storageClientContext.service;
14797
14915
  }
14798
14916
  /**
@@ -14810,7 +14928,7 @@ class ShareServiceClient extends StorageClient {
14810
14928
  * ```
14811
14929
  */
14812
14930
  getShareClient(shareName) {
14813
- return new ShareClient(appendToURLPath(this.url, shareName), this.pipeline);
14931
+ return new ShareClient(appendToURLPath(this.url, shareName), this.pipeline, this.shareClientConfig);
14814
14932
  }
14815
14933
  /**
14816
14934
  * Creates a Share.
@@ -15117,6 +15235,14 @@ class ShareServiceClient extends StorageClient {
15117
15235
  }
15118
15236
  }
15119
15237
 
15238
+ // Copyright (c) Microsoft Corporation.
15239
+ // Licensed under the MIT license.
15240
+ /** Known values of {@link ShareTokenIntent} that the service accepts. */
15241
+ exports.KnownShareTokenIntent = void 0;
15242
+ (function (KnownShareTokenIntent) {
15243
+ KnownShareTokenIntent["Backup"] = "backup";
15244
+ })(exports.KnownShareTokenIntent || (exports.KnownShareTokenIntent = {}));
15245
+
15120
15246
  Object.defineProperty(exports, 'RestError', {
15121
15247
  enumerable: true,
15122
15248
  get: function () { return coreRestPipeline.RestError; }