@azure/storage-file-share 12.13.0-beta.1 → 12.14.0-beta.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 (29) hide show
  1. package/dist/index.js +201 -70
  2. package/dist/index.js.map +1 -1
  3. package/dist-esm/src/Clients.js +52 -46
  4. package/dist-esm/src/Clients.js.map +1 -1
  5. package/dist-esm/src/Pipeline.js +7 -4
  6. package/dist-esm/src/Pipeline.js.map +1 -1
  7. package/dist-esm/src/ShareServiceClient.js +7 -5
  8. package/dist-esm/src/ShareServiceClient.js.map +1 -1
  9. package/dist-esm/src/generated/src/models/index.js.map +1 -1
  10. package/dist-esm/src/generated/src/models/parameters.js +31 -1
  11. package/dist-esm/src/generated/src/models/parameters.js.map +1 -1
  12. package/dist-esm/src/generated/src/operations/directory.js +29 -4
  13. package/dist-esm/src/generated/src/operations/directory.js.map +1 -1
  14. package/dist-esm/src/generated/src/operations/file.js +49 -8
  15. package/dist-esm/src/generated/src/operations/file.js.map +1 -1
  16. package/dist-esm/src/generated/src/operations/share.js +3 -1
  17. package/dist-esm/src/generated/src/operations/share.js.map +1 -1
  18. package/dist-esm/src/generated/src/storageClientContext.js +2 -2
  19. package/dist-esm/src/generated/src/storageClientContext.js.map +1 -1
  20. package/dist-esm/src/generatedModels.js +5 -1
  21. package/dist-esm/src/generatedModels.js.map +1 -1
  22. package/dist-esm/src/models.js.map +1 -1
  23. package/dist-esm/src/utils/constants.js +6 -2
  24. package/dist-esm/src/utils/constants.js.map +1 -1
  25. package/dist-esm/src/utils/utils.common.js +12 -1
  26. package/dist-esm/src/utils/utils.common.js.map +1 -1
  27. package/package.json +3 -2
  28. package/types/3.1/storage-file-share.d.ts +61 -12
  29. package/types/latest/storage-file-share.d.ts +65 -12
package/dist/index.js CHANGED
@@ -334,13 +334,17 @@ function ipRangeToString(ipRange) {
334
334
 
335
335
  // Copyright (c) Microsoft Corporation.
336
336
  // Licensed under the MIT license.
337
- const SDK_VERSION = "12.13.0-beta.1";
338
- const SERVICE_VERSION = "2021-12-02";
337
+ const SDK_VERSION = "12.14.0-beta.1";
338
+ const SERVICE_VERSION = "2022-11-02";
339
339
  const FILE_MAX_SIZE_BYTES = 4 * 1024 * 1024 * 1024 * 1024; // 4TB
340
340
  const FILE_RANGE_MAX_SIZE_BYTES = 4 * 1024 * 1024; // 4MB
341
341
  const DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5;
342
342
  const DEFAULT_HIGH_LEVEL_CONCURRENCY = 5;
343
343
  const REQUEST_TIMEOUT = 100 * 1000; // In ms
344
+ /**
345
+ * The OAuth scope to use with Azure Storage.
346
+ */
347
+ const StorageOAuthScopes = "https://storage.azure.com/.default";
344
348
  const URLConstants = {
345
349
  Parameters: {
346
350
  FORCE_BROWSER_NO_CACHE: "_",
@@ -636,7 +640,8 @@ function appendToURLPath(url, name) {
636
640
  let path = urlParsed.getPath();
637
641
  path = path ? (path.endsWith("/") ? `${path}${name}` : `${path}/${name}`) : name;
638
642
  urlParsed.setPath(path);
639
- return urlParsed.toString();
643
+ const normalizedUrl = new URL(urlParsed.toString());
644
+ return normalizedUrl.toString();
640
645
  }
641
646
  /**
642
647
  * Append a string to URL query.
@@ -850,6 +855,16 @@ function getShareNameAndPathFromUrl(url) {
850
855
  throw new Error("Unable to extract shareName and filePath/directoryPath with provided information.");
851
856
  }
852
857
  }
858
+ /**
859
+ * Attach a TokenCredential to an object.
860
+ *
861
+ * @param thing -
862
+ * @param credential -
863
+ */
864
+ function attachCredential(thing, credential) {
865
+ thing.credential = credential;
866
+ return thing;
867
+ }
853
868
  function httpAuthorizationToString(httpAuthorization) {
854
869
  return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : undefined;
855
870
  }
@@ -6758,7 +6773,7 @@ const timeoutInSeconds = {
6758
6773
  const version = {
6759
6774
  parameterPath: "version",
6760
6775
  mapper: {
6761
- defaultValue: "2021-12-02",
6776
+ defaultValue: "2022-11-02",
6762
6777
  isConstant: true,
6763
6778
  serializedName: "x-ms-version",
6764
6779
  type: {
@@ -7081,6 +7096,16 @@ const comp4 = {
7081
7096
  }
7082
7097
  }
7083
7098
  };
7099
+ const fileRequestIntent = {
7100
+ parameterPath: ["options", "fileRequestIntent"],
7101
+ mapper: {
7102
+ serializedName: "x-ms-file-request-intent",
7103
+ xmlName: "x-ms-file-request-intent",
7104
+ type: {
7105
+ name: "String"
7106
+ }
7107
+ }
7108
+ };
7084
7109
  const accept2 = {
7085
7110
  parameterPath: "accept",
7086
7111
  mapper: {
@@ -7196,6 +7221,16 @@ const restype2 = {
7196
7221
  }
7197
7222
  }
7198
7223
  };
7224
+ const allowTrailingDot = {
7225
+ parameterPath: ["options", "allowTrailingDot"],
7226
+ mapper: {
7227
+ serializedName: "x-ms-allow-trailing-dot",
7228
+ xmlName: "x-ms-allow-trailing-dot",
7229
+ type: {
7230
+ name: "Boolean"
7231
+ }
7232
+ }
7233
+ };
7199
7234
  const filePermission = {
7200
7235
  parameterPath: ["options", "filePermission"],
7201
7236
  mapper: {
@@ -7434,6 +7469,16 @@ const fileChangeTime = {
7434
7469
  }
7435
7470
  }
7436
7471
  };
7472
+ const allowSourceTrailingDot = {
7473
+ parameterPath: ["options", "allowSourceTrailingDot"],
7474
+ mapper: {
7475
+ serializedName: "x-ms-source-allow-trailing-dot",
7476
+ xmlName: "x-ms-source-allow-trailing-dot",
7477
+ type: {
7478
+ name: "Boolean"
7479
+ }
7480
+ }
7481
+ };
7437
7482
  const fileContentLength = {
7438
7483
  parameterPath: "fileContentLength",
7439
7484
  mapper: {
@@ -8427,7 +8472,8 @@ const createPermissionOperationSpec = {
8427
8472
  headerParameters: [
8428
8473
  contentType,
8429
8474
  accept,
8430
- version
8475
+ version,
8476
+ fileRequestIntent
8431
8477
  ],
8432
8478
  isXML: false,
8433
8479
  contentType: "application/xml; charset=utf-8",
@@ -8454,6 +8500,7 @@ const getPermissionOperationSpec = {
8454
8500
  urlParameters: [url],
8455
8501
  headerParameters: [
8456
8502
  version,
8503
+ fileRequestIntent,
8457
8504
  accept2,
8458
8505
  filePermissionKey
8459
8506
  ],
@@ -8781,6 +8828,8 @@ const createOperationSpec$1 = {
8781
8828
  version,
8782
8829
  accept1,
8783
8830
  metadata,
8831
+ fileRequestIntent,
8832
+ allowTrailingDot,
8784
8833
  filePermission,
8785
8834
  filePermissionKey1,
8786
8835
  fileAttributes,
@@ -8809,7 +8858,12 @@ const getPropertiesOperationSpec$1 = {
8809
8858
  restype2
8810
8859
  ],
8811
8860
  urlParameters: [url],
8812
- headerParameters: [version, accept1],
8861
+ headerParameters: [
8862
+ version,
8863
+ accept1,
8864
+ fileRequestIntent,
8865
+ allowTrailingDot
8866
+ ],
8813
8867
  isXML: true,
8814
8868
  serializer: xmlSerializer$1
8815
8869
  };
@@ -8827,7 +8881,12 @@ const deleteOperationSpec$1 = {
8827
8881
  },
8828
8882
  queryParameters: [timeoutInSeconds, restype2],
8829
8883
  urlParameters: [url],
8830
- headerParameters: [version, accept1],
8884
+ headerParameters: [
8885
+ version,
8886
+ accept1,
8887
+ fileRequestIntent,
8888
+ allowTrailingDot
8889
+ ],
8831
8890
  isXML: true,
8832
8891
  serializer: xmlSerializer$1
8833
8892
  };
@@ -8852,6 +8911,8 @@ const setPropertiesOperationSpec = {
8852
8911
  headerParameters: [
8853
8912
  version,
8854
8913
  accept1,
8914
+ fileRequestIntent,
8915
+ allowTrailingDot,
8855
8916
  filePermission,
8856
8917
  filePermissionKey1,
8857
8918
  fileAttributes,
@@ -8883,7 +8944,9 @@ const setMetadataOperationSpec$1 = {
8883
8944
  headerParameters: [
8884
8945
  version,
8885
8946
  accept1,
8886
- metadata
8947
+ metadata,
8948
+ fileRequestIntent,
8949
+ allowTrailingDot
8887
8950
  ],
8888
8951
  isXML: true,
8889
8952
  serializer: xmlSerializer$1
@@ -8915,6 +8978,8 @@ const listFilesAndDirectoriesSegmentOperationSpec = {
8915
8978
  headerParameters: [
8916
8979
  version,
8917
8980
  accept1,
8981
+ fileRequestIntent,
8982
+ allowTrailingDot,
8918
8983
  includeExtendedInfo
8919
8984
  ],
8920
8985
  isXML: true,
@@ -8944,6 +9009,8 @@ const listHandlesOperationSpec$1 = {
8944
9009
  headerParameters: [
8945
9010
  version,
8946
9011
  accept1,
9012
+ fileRequestIntent,
9013
+ allowTrailingDot,
8947
9014
  recursive
8948
9015
  ],
8949
9016
  isXML: true,
@@ -8971,6 +9038,8 @@ const forceCloseHandlesOperationSpec$1 = {
8971
9038
  headerParameters: [
8972
9039
  version,
8973
9040
  accept1,
9041
+ fileRequestIntent,
9042
+ allowTrailingDot,
8974
9043
  recursive,
8975
9044
  handleId
8976
9045
  ],
@@ -8999,6 +9068,8 @@ const renameOperationSpec$1 = {
8999
9068
  version,
9000
9069
  accept1,
9001
9070
  metadata,
9071
+ fileRequestIntent,
9072
+ allowTrailingDot,
9002
9073
  filePermission,
9003
9074
  filePermissionKey1,
9004
9075
  renameSource,
@@ -9009,7 +9080,8 @@ const renameOperationSpec$1 = {
9009
9080
  fileAttributes1,
9010
9081
  fileCreationTime,
9011
9082
  fileLastWriteTime,
9012
- fileChangeTime
9083
+ fileChangeTime,
9084
+ allowSourceTrailingDot
9013
9085
  ],
9014
9086
  isXML: true,
9015
9087
  serializer: xmlSerializer$1
@@ -9293,6 +9365,8 @@ const createOperationSpec = {
9293
9365
  accept1,
9294
9366
  metadata,
9295
9367
  leaseId,
9368
+ fileRequestIntent,
9369
+ allowTrailingDot,
9296
9370
  filePermission,
9297
9371
  filePermissionKey1,
9298
9372
  fileAttributes,
@@ -9340,6 +9414,8 @@ const downloadOperationSpec = {
9340
9414
  version,
9341
9415
  accept1,
9342
9416
  leaseId,
9417
+ fileRequestIntent,
9418
+ allowTrailingDot,
9343
9419
  range,
9344
9420
  rangeGetContentMD5
9345
9421
  ],
@@ -9363,7 +9439,9 @@ const getPropertiesOperationSpec = {
9363
9439
  headerParameters: [
9364
9440
  version,
9365
9441
  accept1,
9366
- leaseId
9442
+ leaseId,
9443
+ fileRequestIntent,
9444
+ allowTrailingDot
9367
9445
  ],
9368
9446
  isXML: true,
9369
9447
  serializer: xmlSerializer
@@ -9385,7 +9463,9 @@ const deleteOperationSpec = {
9385
9463
  headerParameters: [
9386
9464
  version,
9387
9465
  accept1,
9388
- leaseId
9466
+ leaseId,
9467
+ fileRequestIntent,
9468
+ allowTrailingDot
9389
9469
  ],
9390
9470
  isXML: true,
9391
9471
  serializer: xmlSerializer
@@ -9408,6 +9488,8 @@ const setHttpHeadersOperationSpec = {
9408
9488
  version,
9409
9489
  accept1,
9410
9490
  leaseId,
9491
+ fileRequestIntent,
9492
+ allowTrailingDot,
9411
9493
  filePermission,
9412
9494
  filePermissionKey1,
9413
9495
  fileAttributes,
@@ -9443,7 +9525,9 @@ const setMetadataOperationSpec = {
9443
9525
  version,
9444
9526
  accept1,
9445
9527
  metadata,
9446
- leaseId
9528
+ leaseId,
9529
+ fileRequestIntent,
9530
+ allowTrailingDot
9447
9531
  ],
9448
9532
  isXML: true,
9449
9533
  serializer: xmlSerializer
@@ -9468,7 +9552,9 @@ const acquireLeaseOperationSpec = {
9468
9552
  action,
9469
9553
  duration,
9470
9554
  proposedLeaseId,
9471
- requestId
9555
+ requestId,
9556
+ fileRequestIntent,
9557
+ allowTrailingDot
9472
9558
  ],
9473
9559
  isXML: true,
9474
9560
  serializer: xmlSerializer
@@ -9492,7 +9578,9 @@ const releaseLeaseOperationSpec = {
9492
9578
  accept1,
9493
9579
  requestId,
9494
9580
  action1,
9495
- leaseId1
9581
+ leaseId1,
9582
+ fileRequestIntent,
9583
+ allowTrailingDot
9496
9584
  ],
9497
9585
  isXML: true,
9498
9586
  serializer: xmlSerializer
@@ -9517,7 +9605,9 @@ const changeLeaseOperationSpec = {
9517
9605
  proposedLeaseId,
9518
9606
  requestId,
9519
9607
  leaseId1,
9520
- action2
9608
+ action2,
9609
+ fileRequestIntent,
9610
+ allowTrailingDot
9521
9611
  ],
9522
9612
  isXML: true,
9523
9613
  serializer: xmlSerializer
@@ -9541,7 +9631,9 @@ const breakLeaseOperationSpec = {
9541
9631
  accept1,
9542
9632
  leaseId,
9543
9633
  requestId,
9544
- action4
9634
+ action4,
9635
+ fileRequestIntent,
9636
+ allowTrailingDot
9545
9637
  ],
9546
9638
  isXML: true,
9547
9639
  serializer: xmlSerializer
@@ -9564,6 +9656,8 @@ const uploadRangeOperationSpec = {
9564
9656
  headerParameters: [
9565
9657
  version,
9566
9658
  leaseId,
9659
+ fileRequestIntent,
9660
+ allowTrailingDot,
9567
9661
  contentType1,
9568
9662
  accept3,
9569
9663
  range1,
@@ -9594,6 +9688,8 @@ const uploadRangeFromURLOperationSpec = {
9594
9688
  version,
9595
9689
  accept1,
9596
9690
  leaseId,
9691
+ allowTrailingDot,
9692
+ allowSourceTrailingDot,
9597
9693
  range1,
9598
9694
  contentLength,
9599
9695
  fileLastWrittenMode,
@@ -9632,6 +9728,8 @@ const getRangeListOperationSpec = {
9632
9728
  version,
9633
9729
  accept1,
9634
9730
  leaseId,
9731
+ fileRequestIntent,
9732
+ allowTrailingDot,
9635
9733
  range
9636
9734
  ],
9637
9735
  isXML: true,
@@ -9656,12 +9754,15 @@ const startCopyOperationSpec = {
9656
9754
  accept1,
9657
9755
  metadata,
9658
9756
  leaseId,
9757
+ fileRequestIntent,
9758
+ allowTrailingDot,
9659
9759
  filePermission,
9660
9760
  filePermissionKey1,
9661
9761
  fileAttributes1,
9662
9762
  fileCreationTime,
9663
9763
  fileLastWriteTime,
9664
9764
  fileChangeTime,
9765
+ allowSourceTrailingDot,
9665
9766
  copySource,
9666
9767
  filePermissionCopyMode,
9667
9768
  ignoreReadOnly1,
@@ -9692,6 +9793,8 @@ const abortCopyOperationSpec = {
9692
9793
  version,
9693
9794
  accept1,
9694
9795
  leaseId,
9796
+ fileRequestIntent,
9797
+ allowTrailingDot,
9695
9798
  copyActionAbortConstant
9696
9799
  ],
9697
9800
  isXML: true,
@@ -9718,7 +9821,12 @@ const listHandlesOperationSpec = {
9718
9821
  comp9
9719
9822
  ],
9720
9823
  urlParameters: [url],
9721
- headerParameters: [version, accept1],
9824
+ headerParameters: [
9825
+ version,
9826
+ accept1,
9827
+ fileRequestIntent,
9828
+ allowTrailingDot
9829
+ ],
9722
9830
  isXML: true,
9723
9831
  serializer: xmlSerializer
9724
9832
  };
@@ -9744,6 +9852,8 @@ const forceCloseHandlesOperationSpec = {
9744
9852
  headerParameters: [
9745
9853
  version,
9746
9854
  accept1,
9855
+ fileRequestIntent,
9856
+ allowTrailingDot,
9747
9857
  handleId
9748
9858
  ],
9749
9859
  isXML: true,
@@ -9767,6 +9877,8 @@ const renameOperationSpec = {
9767
9877
  version,
9768
9878
  accept1,
9769
9879
  metadata,
9880
+ fileRequestIntent,
9881
+ allowTrailingDot,
9770
9882
  filePermission,
9771
9883
  filePermissionKey1,
9772
9884
  renameSource,
@@ -9778,6 +9890,7 @@ const renameOperationSpec = {
9778
9890
  fileCreationTime,
9779
9891
  fileLastWriteTime,
9780
9892
  fileChangeTime,
9893
+ allowSourceTrailingDot,
9781
9894
  fileContentType
9782
9895
  ],
9783
9896
  isXML: true,
@@ -10243,7 +10356,7 @@ class Pipeline {
10243
10356
  this.factories = factories;
10244
10357
  // when options.httpClient is not specified, passing in a DefaultHttpClient instance to
10245
10358
  // avoid each client creating its own http client.
10246
- this.options = Object.assign(Object.assign({}, options), { httpClient: options.httpClient || getCachedDefaultHttpClient() });
10359
+ this.options = Object.assign(Object.assign({}, options), { httpClient: options.httpClient || getCachedDefaultHttpClient(), shareTokenIntent: options.shareTokenIntent });
10247
10360
  }
10248
10361
  /**
10249
10362
  * Transfer Pipeline object to ServiceClientOptions object which required by
@@ -10292,7 +10405,9 @@ function newPipeline(credential, pipelineOptions = {}) {
10292
10405
  factories.push(coreHttp.proxyPolicy(pipelineOptions.proxyOptions));
10293
10406
  factories.push(coreHttp.disableResponseDecompressionPolicy());
10294
10407
  }
10295
- factories.push(credential);
10408
+ factories.push(coreHttp.isTokenCredential(credential)
10409
+ ? attachCredential(coreHttp.bearerTokenAuthenticationPolicy(credential, StorageOAuthScopes), credential)
10410
+ : credential);
10296
10411
  return new Pipeline(factories, pipelineOptions);
10297
10412
  }
10298
10413
 
@@ -10501,7 +10616,7 @@ function convertTracingToRequestOptionsBase(options) {
10501
10616
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
10502
10617
  */
10503
10618
  const packageName = "azure-storage-file-share";
10504
- const packageVersion = "12.13.0-beta.1";
10619
+ const packageVersion = "12.14.0-beta.1";
10505
10620
  class StorageClientContext extends coreHttp__namespace.ServiceClient {
10506
10621
  /**
10507
10622
  * Initializes a new instance of the StorageClientContext class.
@@ -10527,7 +10642,7 @@ class StorageClientContext extends coreHttp__namespace.ServiceClient {
10527
10642
  // Parameter assignments
10528
10643
  this.url = url;
10529
10644
  // Assigning values to Constant parameters
10530
- this.version = options.version || "2021-12-02";
10645
+ this.version = options.version || "2022-11-02";
10531
10646
  this.fileRangeWriteFromUrl = options.fileRangeWriteFromUrl || "update";
10532
10647
  }
10533
10648
  }
@@ -11766,7 +11881,8 @@ class ShareClient extends StorageClient {
11766
11881
  url = urlOrConnectionString;
11767
11882
  pipeline = credentialOrPipelineOrShareName;
11768
11883
  }
11769
- else if (credentialOrPipelineOrShareName instanceof Credential) {
11884
+ else if (credentialOrPipelineOrShareName instanceof Credential ||
11885
+ coreHttp.isTokenCredential(credentialOrPipelineOrShareName)) {
11770
11886
  // (url: string, credential?: Credential, options?: StoragePipelineOptions)
11771
11887
  url = urlOrConnectionString;
11772
11888
  pipeline = newPipeline(credentialOrPipelineOrShareName, options);
@@ -11806,6 +11922,7 @@ class ShareClient extends StorageClient {
11806
11922
  }
11807
11923
  super(url, pipeline);
11808
11924
  this._name = getShareNameAndPathFromUrl(this.url).shareName;
11925
+ this.shareClientConfig = options;
11809
11926
  this.context = new Share(this.storageClientContext);
11810
11927
  }
11811
11928
  /**
@@ -11822,7 +11939,7 @@ class ShareClient extends StorageClient {
11822
11939
  * @returns A new ShareClient object identical to the source but with the specified snapshot timestamp
11823
11940
  */
11824
11941
  withSnapshot(snapshot) {
11825
- return new ShareClient(setURLParameter(this.url, URLConstants.Parameters.SHARE_SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline);
11942
+ return new ShareClient(setURLParameter(this.url, URLConstants.Parameters.SHARE_SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline, this.shareClientConfig);
11826
11943
  }
11827
11944
  /**
11828
11945
  * Creates a new share under the specified account. If the share with
@@ -11889,7 +12006,7 @@ class ShareClient extends StorageClient {
11889
12006
  // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
11890
12007
  /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */
11891
12008
  getDirectoryClient(directoryName) {
11892
- return new ShareDirectoryClient(appendToURLPath(this.url, EscapePath(directoryName)), this.pipeline);
12009
+ return new ShareDirectoryClient(appendToURLPath(this.url, EscapePath(directoryName)), this.pipeline, this.shareClientConfig);
11893
12010
  }
11894
12011
  /**
11895
12012
  * Gets the directory client for the root directory of this share.
@@ -12386,7 +12503,7 @@ class ShareClient extends StorageClient {
12386
12503
  try {
12387
12504
  return await this.context.createPermission({
12388
12505
  permission: filePermission,
12389
- }, Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));
12506
+ }, Object.assign(Object.assign({ abortSignal: options.abortSignal }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
12390
12507
  }
12391
12508
  catch (e) {
12392
12509
  span.setStatus({
@@ -12410,7 +12527,7 @@ class ShareClient extends StorageClient {
12410
12527
  async getPermission(filePermissionKey, options = {}) {
12411
12528
  const { span, updatedOptions } = createSpan("ShareClient-getPermission", options);
12412
12529
  try {
12413
- return await this.context.getPermission(filePermissionKey, Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));
12530
+ return await this.context.getPermission(filePermissionKey, Object.assign(Object.assign({ abortSignal: options.abortSignal }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
12414
12531
  }
12415
12532
  catch (e) {
12416
12533
  span.setStatus({
@@ -12451,7 +12568,8 @@ class ShareDirectoryClient extends StorageClient {
12451
12568
  if (credentialOrPipeline instanceof Pipeline) {
12452
12569
  pipeline = credentialOrPipeline;
12453
12570
  }
12454
- else if (credentialOrPipeline instanceof Credential) {
12571
+ else if (credentialOrPipeline instanceof Credential ||
12572
+ coreHttp.isTokenCredential(credentialOrPipeline)) {
12455
12573
  pipeline = newPipeline(credentialOrPipeline, options);
12456
12574
  }
12457
12575
  else {
@@ -12464,6 +12582,7 @@ class ShareDirectoryClient extends StorageClient {
12464
12582
  shareName: this._shareName,
12465
12583
  path: this._path,
12466
12584
  } = getShareNameAndPathFromUrl(this.url));
12585
+ this.shareClientConfig = options;
12467
12586
  this.context = new Directory(this.storageClientContext);
12468
12587
  }
12469
12588
  /**
@@ -12503,7 +12622,7 @@ class ShareDirectoryClient extends StorageClient {
12503
12622
  }
12504
12623
  return await this.context.create(options.fileAttributes
12505
12624
  ? fileAttributesToString(options.fileAttributes)
12506
- : FileAttributesNone, Object.assign({ abortSignal: options.abortSignal, metadata: options.metadata, filePermission: options.filePermission, filePermissionKey: options.filePermissionKey, fileChangeOn: fileChangeTimeToString(options.changeTime), fileCreatedOn: fileCreationTimeToString(options.creationTime), fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime) }, convertTracingToRequestOptionsBase(updatedOptions)));
12625
+ : FileAttributesNone, Object.assign(Object.assign({ abortSignal: options.abortSignal, metadata: options.metadata, filePermission: options.filePermission, filePermissionKey: options.filePermissionKey, fileChangeOn: fileChangeTimeToString(options.changeTime), fileCreatedOn: fileCreationTimeToString(options.creationTime), fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime) }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
12507
12626
  }
12508
12627
  catch (e) {
12509
12628
  span.setStatus({
@@ -12561,7 +12680,7 @@ class ShareDirectoryClient extends StorageClient {
12561
12680
  properties = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(properties);
12562
12681
  return await this.context.setProperties(properties.fileAttributes
12563
12682
  ? fileAttributesToString(properties.fileAttributes)
12564
- : FileAttributesPreserve, Object.assign({ abortSignal: properties.abortSignal, filePermission: properties.filePermission, filePermissionKey: properties.filePermissionKey, fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(properties.creationTime), fileLastWriteOn: fileLastWriteTimeToString(properties.lastWriteTime) }, convertTracingToRequestOptionsBase(updatedOptions)));
12683
+ : FileAttributesPreserve, Object.assign(Object.assign({ abortSignal: properties.abortSignal, filePermission: properties.filePermission, filePermissionKey: properties.filePermissionKey, fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(properties.creationTime), fileLastWriteOn: fileLastWriteTimeToString(properties.lastWriteTime) }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
12565
12684
  }
12566
12685
  catch (e) {
12567
12686
  span.setStatus({
@@ -12589,7 +12708,7 @@ class ShareDirectoryClient extends StorageClient {
12589
12708
  * ```
12590
12709
  */
12591
12710
  getDirectoryClient(subDirectoryName) {
12592
- return new ShareDirectoryClient(appendToURLPath(this.url, EscapePath(subDirectoryName)), this.pipeline);
12711
+ return new ShareDirectoryClient(appendToURLPath(this.url, EscapePath(subDirectoryName)), this.pipeline, this.shareClientConfig);
12593
12712
  }
12594
12713
  /**
12595
12714
  * Creates a new subdirectory under this directory.
@@ -12734,7 +12853,7 @@ class ShareDirectoryClient extends StorageClient {
12734
12853
  // Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
12735
12854
  /* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */
12736
12855
  getFileClient(fileName) {
12737
- return new ShareFileClient(appendToURLPath(this.url, EscapePath(fileName)), this.pipeline);
12856
+ return new ShareFileClient(appendToURLPath(this.url, EscapePath(fileName)), this.pipeline, this.shareClientConfig);
12738
12857
  }
12739
12858
  /**
12740
12859
  * Returns true if the specified directory exists; false otherwise.
@@ -12784,7 +12903,7 @@ class ShareDirectoryClient extends StorageClient {
12784
12903
  async getProperties(options = {}) {
12785
12904
  const { span, updatedOptions } = createSpan("ShareDirectoryClient-getProperties", options);
12786
12905
  try {
12787
- return await this.context.getProperties(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));
12906
+ return await this.context.getProperties(Object.assign(Object.assign({ abortSignal: options.abortSignal }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
12788
12907
  }
12789
12908
  catch (e) {
12790
12909
  span.setStatus({
@@ -12808,7 +12927,7 @@ class ShareDirectoryClient extends StorageClient {
12808
12927
  async delete(options = {}) {
12809
12928
  const { span, updatedOptions } = createSpan("ShareDirectoryClient-delete", options);
12810
12929
  try {
12811
- return await this.context.delete(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));
12930
+ return await this.context.delete(Object.assign(Object.assign({ abortSignal: options.abortSignal }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
12812
12931
  }
12813
12932
  catch (e) {
12814
12933
  span.setStatus({
@@ -12865,7 +12984,7 @@ class ShareDirectoryClient extends StorageClient {
12865
12984
  async setMetadata(metadata, options = {}) {
12866
12985
  const { span, updatedOptions } = createSpan("ShareDirectoryClient-setMetadata", options);
12867
12986
  try {
12868
- return await this.context.setMetadata(Object.assign({ abortSignal: options.abortSignal, metadata }, convertTracingToRequestOptionsBase(updatedOptions)));
12987
+ return await this.context.setMetadata(Object.assign(Object.assign({ abortSignal: options.abortSignal, metadata }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
12869
12988
  }
12870
12989
  catch (e) {
12871
12990
  span.setStatus({
@@ -13081,7 +13200,7 @@ class ShareDirectoryClient extends StorageClient {
13081
13200
  options.prefix = undefined;
13082
13201
  }
13083
13202
  try {
13084
- const response = await this.context.listFilesAndDirectoriesSegment(Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));
13203
+ const response = await this.context.listFilesAndDirectoriesSegment(Object.assign(Object.assign(Object.assign({ marker }, options), this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
13085
13204
  const wrappedResponse = Object.assign(Object.assign({}, ConvertInternalResponseOfListFiles(response)), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListFiles(response._response.parsedBody) }) });
13086
13205
  return wrappedResponse;
13087
13206
  }
@@ -13261,7 +13380,7 @@ class ShareDirectoryClient extends StorageClient {
13261
13380
  const { span, updatedOptions } = createSpan("ShareDirectoryClient-listHandlesSegment", options);
13262
13381
  try {
13263
13382
  marker = marker === "" ? undefined : marker;
13264
- const response = await this.context.listHandles(Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));
13383
+ const response = await this.context.listHandles(Object.assign(Object.assign(Object.assign({ marker }, options), this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
13265
13384
  // TODO: Protocol layer issue that when handle list is in returned XML
13266
13385
  // response.handleList is an empty string
13267
13386
  if (response.handleList === "") {
@@ -13296,7 +13415,7 @@ class ShareDirectoryClient extends StorageClient {
13296
13415
  const { span, updatedOptions } = createSpan("ShareDirectoryClient-forceCloseHandlesSegment", options);
13297
13416
  try {
13298
13417
  marker = marker === "" ? undefined : marker;
13299
- const rawResponse = await this.context.forceCloseHandles("*", Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));
13418
+ const rawResponse = await this.context.forceCloseHandles("*", Object.assign(Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)), this.shareClientConfig));
13300
13419
  const response = rawResponse;
13301
13420
  response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
13302
13421
  response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
@@ -13364,7 +13483,7 @@ class ShareDirectoryClient extends StorageClient {
13364
13483
  if (handleId === "*") {
13365
13484
  throw new RangeError(`Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`);
13366
13485
  }
13367
- const rawResponse = await this.context.forceCloseHandles(handleId, Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));
13486
+ const rawResponse = await this.context.forceCloseHandles(handleId, Object.assign(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)), this.shareClientConfig));
13368
13487
  const response = rawResponse;
13369
13488
  response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
13370
13489
  response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
@@ -13416,9 +13535,9 @@ class ShareDirectoryClient extends StorageClient {
13416
13535
  else {
13417
13536
  throw new RangeError("Destination path should not contain more than one query string");
13418
13537
  }
13419
- const destDirectory = new ShareDirectoryClient(destinationUrl, this.pipeline);
13538
+ const destDirectory = new ShareDirectoryClient(destinationUrl, this.pipeline, this.shareClientConfig);
13420
13539
  try {
13421
- const response = await destDirectory.context.rename(this.url, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
13540
+ const response = await destDirectory.context.rename(this.url, Object.assign(Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
13422
13541
  ? {
13423
13542
  sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,
13424
13543
  }
@@ -13426,7 +13545,7 @@ class ShareDirectoryClient extends StorageClient {
13426
13545
  ? {
13427
13546
  destinationLeaseId: updatedOptions.destinationLeaseAccessConditions.leaseId,
13428
13547
  }
13429
- : undefined }));
13548
+ : undefined }), this.shareClientConfig));
13430
13549
  return {
13431
13550
  destinationDirectoryClient: destDirectory,
13432
13551
  directoryRenameResponse: response,
@@ -13456,7 +13575,8 @@ class ShareFileClient extends StorageClient {
13456
13575
  if (credentialOrPipeline instanceof Pipeline) {
13457
13576
  pipeline = credentialOrPipeline;
13458
13577
  }
13459
- else if (credentialOrPipeline instanceof Credential) {
13578
+ else if (credentialOrPipeline instanceof Credential ||
13579
+ coreHttp.isTokenCredential(credentialOrPipeline)) {
13460
13580
  pipeline = newPipeline(credentialOrPipeline, options);
13461
13581
  }
13462
13582
  else {
@@ -13469,6 +13589,7 @@ class ShareFileClient extends StorageClient {
13469
13589
  shareName: this._shareName,
13470
13590
  path: this._path,
13471
13591
  } = getShareNameAndPathFromUrl(this.url));
13592
+ this.shareClientConfig = options;
13472
13593
  this.context = new File(this.storageClientContext);
13473
13594
  }
13474
13595
  /**
@@ -13497,7 +13618,7 @@ class ShareFileClient extends StorageClient {
13497
13618
  * @returns A new ShareFileClient object identical to the source but with the specified share snapshot timestamp.
13498
13619
  */
13499
13620
  withShareSnapshot(shareSnapshot) {
13500
- return new ShareFileClient(setURLParameter(this.url, URLConstants.Parameters.SHARE_SNAPSHOT, shareSnapshot.length === 0 ? undefined : shareSnapshot), this.pipeline);
13621
+ return new ShareFileClient(setURLParameter(this.url, URLConstants.Parameters.SHARE_SNAPSHOT, shareSnapshot.length === 0 ? undefined : shareSnapshot), this.pipeline, this.shareClientConfig);
13501
13622
  }
13502
13623
  /**
13503
13624
  * Creates a new file or replaces a file. Note it only initializes the file with no content.
@@ -13531,7 +13652,7 @@ class ShareFileClient extends StorageClient {
13531
13652
  options.fileHttpHeaders = options.fileHttpHeaders || {};
13532
13653
  return await this.context.create(size, options.fileAttributes
13533
13654
  ? fileAttributesToString(options.fileAttributes)
13534
- : FileAttributesNone, Object.assign({ abortSignal: options.abortSignal, fileHttpHeaders: options.fileHttpHeaders, metadata: options.metadata, filePermission: options.filePermission, filePermissionKey: options.filePermissionKey, fileChangeOn: fileChangeTimeToString(options.changeTime), fileCreatedOn: fileCreationTimeToString(options.creationTime), fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime), leaseAccessConditions: options.leaseAccessConditions }, convertTracingToRequestOptionsBase(updatedOptions)));
13655
+ : FileAttributesNone, Object.assign(Object.assign({ abortSignal: options.abortSignal, fileHttpHeaders: options.fileHttpHeaders, metadata: options.metadata, filePermission: options.filePermission, filePermissionKey: options.filePermissionKey, fileChangeOn: fileChangeTimeToString(options.changeTime), fileCreatedOn: fileCreationTimeToString(options.creationTime), fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime), leaseAccessConditions: options.leaseAccessConditions }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
13535
13656
  }
13536
13657
  catch (e) {
13537
13658
  span.setStatus({
@@ -13612,9 +13733,9 @@ class ShareFileClient extends StorageClient {
13612
13733
  throw new RangeError(`rangeGetContentMD5 only works with partial data downloading`);
13613
13734
  }
13614
13735
  const downloadFullFile = offset === 0 && !count;
13615
- const res = await this.context.download(Object.assign({ abortSignal: options.abortSignal, requestOptions: {
13736
+ const res = await this.context.download(Object.assign(Object.assign({ abortSignal: options.abortSignal, requestOptions: {
13616
13737
  onDownloadProgress: coreHttp.isNode ? undefined : options.onProgress, // for Node.js, progress is reported by RetriableReadableStream
13617
- }, range: downloadFullFile ? undefined : rangeToString({ offset, count }), rangeGetContentMD5: options.rangeGetContentMD5, leaseAccessConditions: options.leaseAccessConditions }, convertTracingToRequestOptionsBase(updatedOptions)));
13738
+ }, range: downloadFullFile ? undefined : rangeToString({ offset, count }), rangeGetContentMD5: options.rangeGetContentMD5, leaseAccessConditions: options.leaseAccessConditions }, convertTracingToRequestOptionsBase(updatedOptions)), this.shareClientConfig));
13618
13739
  // Return browser response immediately
13619
13740
  if (!coreHttp.isNode) {
13620
13741
  return res;
@@ -13713,7 +13834,7 @@ class ShareFileClient extends StorageClient {
13713
13834
  async getProperties(options = {}) {
13714
13835
  const { span, updatedOptions } = createSpan("ShareFileClient-getProperties", options);
13715
13836
  try {
13716
- return this.context.getProperties(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.leaseAccessConditions }, convertTracingToRequestOptionsBase(updatedOptions)));
13837
+ return this.context.getProperties(Object.assign(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.leaseAccessConditions }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
13717
13838
  }
13718
13839
  catch (e) {
13719
13840
  span.setStatus({
@@ -13742,7 +13863,7 @@ class ShareFileClient extends StorageClient {
13742
13863
  properties.fileHttpHeaders = properties.fileHttpHeaders || {};
13743
13864
  return await this.context.setHttpHeaders(properties.fileAttributes
13744
13865
  ? fileAttributesToString(properties.fileAttributes)
13745
- : FileAttributesPreserve, Object.assign({ abortSignal: properties.abortSignal, fileHttpHeaders: properties.fileHttpHeaders, filePermission: properties.filePermission, filePermissionKey: properties.filePermissionKey, leaseAccessConditions: properties.leaseAccessConditions, fileChangeOn: fileChangeTimeToString(properties.changeTime), fileCreatedOn: fileCreationTimeToString(properties.creationTime), fileLastWriteOn: fileLastWriteTimeToString(properties.lastWriteTime) }, convertTracingToRequestOptionsBase(updatedOptions)));
13866
+ : FileAttributesPreserve, Object.assign(Object.assign({ abortSignal: properties.abortSignal, fileHttpHeaders: properties.fileHttpHeaders, filePermission: properties.filePermission, filePermissionKey: properties.filePermissionKey, leaseAccessConditions: properties.leaseAccessConditions, fileChangeOn: fileChangeTimeToString(properties.changeTime), fileCreatedOn: fileCreationTimeToString(properties.creationTime), fileLastWriteOn: fileLastWriteTimeToString(properties.lastWriteTime) }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
13746
13867
  }
13747
13868
  catch (e) {
13748
13869
  span.setStatus({
@@ -13775,7 +13896,7 @@ class ShareFileClient extends StorageClient {
13775
13896
  async delete(options = {}) {
13776
13897
  const { span, updatedOptions } = createSpan("ShareFileClient-delete", options);
13777
13898
  try {
13778
- return await this.context.delete(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.leaseAccessConditions }, convertTracingToRequestOptionsBase(updatedOptions)));
13899
+ return await this.context.delete(Object.assign(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.leaseAccessConditions }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
13779
13900
  }
13780
13901
  catch (e) {
13781
13902
  span.setStatus({
@@ -13849,7 +13970,7 @@ class ShareFileClient extends StorageClient {
13849
13970
  options = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(options);
13850
13971
  return await this.context.setHttpHeaders(options.fileAttributes
13851
13972
  ? fileAttributesToString(options.fileAttributes)
13852
- : FileAttributesPreserve, Object.assign({ abortSignal: options.abortSignal, fileHttpHeaders, filePermission: options.filePermission, filePermissionKey: options.filePermissionKey, leaseAccessConditions: options.leaseAccessConditions, fileCreatedOn: fileCreationTimeToString(options.creationTime), fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime), fileChangeOn: fileChangeTimeToString(options.changeTime) }, convertTracingToRequestOptionsBase(updatedOptions)));
13973
+ : FileAttributesPreserve, Object.assign(Object.assign({ abortSignal: options.abortSignal, fileHttpHeaders, filePermission: options.filePermission, filePermissionKey: options.filePermissionKey, leaseAccessConditions: options.leaseAccessConditions, fileCreatedOn: fileCreationTimeToString(options.creationTime), fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime), fileChangeOn: fileChangeTimeToString(options.changeTime) }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
13853
13974
  }
13854
13975
  catch (e) {
13855
13976
  span.setStatus({
@@ -13881,7 +14002,7 @@ class ShareFileClient extends StorageClient {
13881
14002
  }
13882
14003
  // FileAttributes, filePermission, createTime, lastWriteTime will all be preserved.
13883
14004
  options = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(options);
13884
- return await this.context.setHttpHeaders(fileAttributesToString(options.fileAttributes), Object.assign({ abortSignal: options.abortSignal, fileContentLength: length, filePermission: options.filePermission, filePermissionKey: options.filePermissionKey, leaseAccessConditions: options.leaseAccessConditions, fileChangeOn: fileChangeTimeToString(options.changeTime), fileCreatedOn: fileCreationTimeToString(options.creationTime), fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime) }, convertTracingToRequestOptionsBase(updatedOptions)));
14005
+ return await this.context.setHttpHeaders(fileAttributesToString(options.fileAttributes), Object.assign(Object.assign({ abortSignal: options.abortSignal, fileContentLength: length, filePermission: options.filePermission, filePermissionKey: options.filePermissionKey, leaseAccessConditions: options.leaseAccessConditions, fileChangeOn: fileChangeTimeToString(options.changeTime), fileCreatedOn: fileCreationTimeToString(options.creationTime), fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime) }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
13885
14006
  }
13886
14007
  catch (e) {
13887
14008
  span.setStatus({
@@ -13908,7 +14029,7 @@ class ShareFileClient extends StorageClient {
13908
14029
  async setMetadata(metadata = {}, options = {}) {
13909
14030
  const { span, updatedOptions } = createSpan("ShareFileClient-setMetadata", options);
13910
14031
  try {
13911
- return await this.context.setMetadata(Object.assign({ abortSignal: options.abortSignal, metadata, leaseAccessConditions: options.leaseAccessConditions }, convertTracingToRequestOptionsBase(updatedOptions)));
14032
+ return await this.context.setMetadata(Object.assign(Object.assign({ abortSignal: options.abortSignal, metadata, leaseAccessConditions: options.leaseAccessConditions }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
13912
14033
  }
13913
14034
  catch (e) {
13914
14035
  span.setStatus({
@@ -13960,9 +14081,9 @@ class ShareFileClient extends StorageClient {
13960
14081
  if (contentLength > FILE_RANGE_MAX_SIZE_BYTES) {
13961
14082
  throw new RangeError(`offset must be < ${FILE_RANGE_MAX_SIZE_BYTES} bytes`);
13962
14083
  }
13963
- return await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "update", contentLength, Object.assign(Object.assign({ abortSignal: options.abortSignal, contentMD5: options.contentMD5, requestOptions: {
14084
+ return await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "update", contentLength, Object.assign(Object.assign(Object.assign({ abortSignal: options.abortSignal, contentMD5: options.contentMD5, requestOptions: {
13964
14085
  onUploadProgress: options.onProgress,
13965
- }, body: body }, convertTracingToRequestOptionsBase(updatedOptions)), { leaseAccessConditions: options.leaseAccessConditions, fileLastWrittenMode: options.fileLastWrittenMode }));
14086
+ }, body: body }, convertTracingToRequestOptionsBase(updatedOptions)), { leaseAccessConditions: options.leaseAccessConditions, fileLastWrittenMode: options.fileLastWrittenMode }), this.shareClientConfig));
13966
14087
  }
13967
14088
  catch (e) {
13968
14089
  span.setStatus({
@@ -13994,7 +14115,7 @@ class ShareFileClient extends StorageClient {
13994
14115
  if (count <= 0 || count > FILE_RANGE_MAX_SIZE_BYTES) {
13995
14116
  throw new RangeError(`count must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES} bytes`);
13996
14117
  }
13997
- return await this.context.uploadRangeFromURL(rangeToString({ offset: destOffset, count }), sourceURL, 0, Object.assign(Object.assign({ abortSignal: options.abortSignal, sourceRange: rangeToString({ offset: sourceOffset, count }), sourceModifiedAccessConditions: options.sourceConditions, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), fileLastWrittenMode: options.fileLastWrittenMode }, options), convertTracingToRequestOptionsBase(updatedOptions)));
14118
+ return await this.context.uploadRangeFromURL(rangeToString({ offset: destOffset, count }), sourceURL, 0, Object.assign(Object.assign(Object.assign({ abortSignal: options.abortSignal, sourceRange: rangeToString({ offset: sourceOffset, count }), sourceModifiedAccessConditions: options.sourceConditions, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), fileLastWrittenMode: options.fileLastWrittenMode }, this.shareClientConfig), options), convertTracingToRequestOptionsBase(updatedOptions)));
13998
14119
  }
13999
14120
  catch (e) {
14000
14121
  span.setStatus({
@@ -14021,7 +14142,7 @@ class ShareFileClient extends StorageClient {
14021
14142
  if (offset < 0 || contentLength <= 0) {
14022
14143
  throw new RangeError(`offset must >= 0 and contentLength must be > 0`);
14023
14144
  }
14024
- return await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "clear", 0, Object.assign(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)), { leaseAccessConditions: options.leaseAccessConditions, fileLastWrittenMode: options.fileLastWrittenMode }));
14145
+ return await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "clear", 0, Object.assign(Object.assign(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)), { leaseAccessConditions: options.leaseAccessConditions, fileLastWrittenMode: options.fileLastWrittenMode }), this.shareClientConfig));
14025
14146
  }
14026
14147
  catch (e) {
14027
14148
  span.setStatus({
@@ -14042,7 +14163,7 @@ class ShareFileClient extends StorageClient {
14042
14163
  async getRangeList(options = {}) {
14043
14164
  const { span, updatedOptions } = createSpan("ShareFileClient-getRangeList", options);
14044
14165
  try {
14045
- const originalResponse = await this.context.getRangeList(Object.assign({ abortSignal: options.abortSignal, range: options.range ? rangeToString(options.range) : undefined, leaseAccessConditions: options.leaseAccessConditions }, convertTracingToRequestOptionsBase(updatedOptions)));
14166
+ const originalResponse = await this.context.getRangeList(Object.assign(Object.assign({ abortSignal: options.abortSignal, range: options.range ? rangeToString(options.range) : undefined, leaseAccessConditions: options.leaseAccessConditions }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
14046
14167
  // Only returns ranges, ignoring clearRanges.
14047
14168
  const parsedBody = originalResponse._response.parsedBody.ranges
14048
14169
  ? originalResponse._response.parsedBody.ranges
@@ -14069,7 +14190,7 @@ class ShareFileClient extends StorageClient {
14069
14190
  async getRangeListDiff(prevShareSnapshot, options = {}) {
14070
14191
  const { span, updatedOptions } = createSpan("ShareFileClient-getRangeListDiff", options);
14071
14192
  try {
14072
- return await this.context.getRangeList(Object.assign(Object.assign(Object.assign({ prevsharesnapshot: prevShareSnapshot }, options), { range: options.range ? rangeToString(options.range) : undefined }), convertTracingToRequestOptionsBase(updatedOptions)));
14193
+ return await this.context.getRangeList(Object.assign(Object.assign(Object.assign(Object.assign({ prevsharesnapshot: prevShareSnapshot }, options), { range: options.range ? rangeToString(options.range) : undefined }), this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
14073
14194
  }
14074
14195
  catch (e) {
14075
14196
  span.setStatus({
@@ -14097,7 +14218,7 @@ class ShareFileClient extends StorageClient {
14097
14218
  async startCopyFromURL(copySource, options = {}) {
14098
14219
  const { span, updatedOptions } = createSpan("ShareFileClient-startCopyFromURL", options);
14099
14220
  try {
14100
- return await this.context.startCopy(copySource, Object.assign({ abortSignal: options.abortSignal, metadata: options.metadata, leaseAccessConditions: options.leaseAccessConditions, filePermission: options.filePermission, filePermissionKey: options.filePermissionKey, copyFileSmbInfo: options.copyFileSmbInfo }, convertTracingToRequestOptionsBase(updatedOptions)));
14221
+ return await this.context.startCopy(copySource, Object.assign(Object.assign({ abortSignal: options.abortSignal, metadata: options.metadata, leaseAccessConditions: options.leaseAccessConditions, filePermission: options.filePermission, filePermissionKey: options.filePermissionKey, copyFileSmbInfo: options.copyFileSmbInfo }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
14101
14222
  }
14102
14223
  catch (e) {
14103
14224
  span.setStatus({
@@ -14121,7 +14242,7 @@ class ShareFileClient extends StorageClient {
14121
14242
  async abortCopyFromURL(copyId, options = {}) {
14122
14243
  const { span, updatedOptions } = createSpan("ShareFileClient-abortCopyFromURL", options);
14123
14244
  try {
14124
- return await this.context.abortCopy(copyId, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.leaseAccessConditions }, convertTracingToRequestOptionsBase(updatedOptions)));
14245
+ return await this.context.abortCopy(copyId, Object.assign(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.leaseAccessConditions }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
14125
14246
  }
14126
14247
  catch (e) {
14127
14248
  span.setStatus({
@@ -14558,7 +14679,7 @@ class ShareFileClient extends StorageClient {
14558
14679
  const { span, updatedOptions } = createSpan("ShareFileClient-listHandlesSegment", options);
14559
14680
  try {
14560
14681
  marker = marker === "" ? undefined : marker;
14561
- const response = await this.context.listHandles(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));
14682
+ const response = await this.context.listHandles(Object.assign(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker }, options), convertTracingToRequestOptionsBase(updatedOptions)), this.shareClientConfig));
14562
14683
  // TODO: Protocol layer issue that when handle list is in returned XML
14563
14684
  // response.handleList is an empty string
14564
14685
  if (response.handleList === "") {
@@ -14677,7 +14798,7 @@ class ShareFileClient extends StorageClient {
14677
14798
  const { span, updatedOptions } = createSpan("ShareFileClient-forceCloseHandlesSegment", options);
14678
14799
  try {
14679
14800
  marker = marker === "" ? undefined : marker;
14680
- const rawResponse = await this.context.forceCloseHandles("*", Object.assign({ abortSignal: options.abortSignal, marker }, convertTracingToRequestOptionsBase(updatedOptions)));
14801
+ const rawResponse = await this.context.forceCloseHandles("*", Object.assign(Object.assign({ abortSignal: options.abortSignal, marker }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
14681
14802
  const response = rawResponse;
14682
14803
  response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
14683
14804
  response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
@@ -14746,7 +14867,7 @@ class ShareFileClient extends StorageClient {
14746
14867
  if (handleId === "*") {
14747
14868
  throw new RangeError(`Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`);
14748
14869
  }
14749
- const rawResponse = await this.context.forceCloseHandles(handleId, Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));
14870
+ const rawResponse = await this.context.forceCloseHandles(handleId, Object.assign(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)), this.shareClientConfig));
14750
14871
  const response = rawResponse;
14751
14872
  response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
14752
14873
  response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
@@ -14825,9 +14946,9 @@ class ShareFileClient extends StorageClient {
14825
14946
  else {
14826
14947
  throw new RangeError("Destination path should not contain more than one query string");
14827
14948
  }
14828
- const destFile = new ShareFileClient(destinationUrl, this.pipeline);
14949
+ const destFile = new ShareFileClient(destinationUrl, this.pipeline, this.shareClientConfig);
14829
14950
  try {
14830
- const response = await destFile.context.rename(this.url, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
14951
+ const response = await destFile.context.rename(this.url, Object.assign(Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
14831
14952
  ? {
14832
14953
  sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,
14833
14954
  }
@@ -14839,7 +14960,7 @@ class ShareFileClient extends StorageClient {
14839
14960
  ? {
14840
14961
  fileContentType: options.contentType,
14841
14962
  }
14842
- : undefined }));
14963
+ : undefined }), this.shareClientConfig));
14843
14964
  return {
14844
14965
  destinationFileClient: destFile,
14845
14966
  fileRenameResponse: response,
@@ -15051,7 +15172,8 @@ class ShareServiceClient extends StorageClient {
15051
15172
  if (credentialOrPipeline instanceof Pipeline) {
15052
15173
  pipeline = credentialOrPipeline;
15053
15174
  }
15054
- else if (credentialOrPipeline instanceof Credential) {
15175
+ else if (credentialOrPipeline instanceof Credential ||
15176
+ coreHttp.isTokenCredential(credentialOrPipeline)) {
15055
15177
  pipeline = newPipeline(credentialOrPipeline, options);
15056
15178
  }
15057
15179
  else {
@@ -15059,6 +15181,7 @@ class ShareServiceClient extends StorageClient {
15059
15181
  pipeline = newPipeline(new AnonymousCredential(), options);
15060
15182
  }
15061
15183
  super(url, pipeline);
15184
+ this.shareClientConfig = options;
15062
15185
  this.serviceContext = new Service(this.storageClientContext);
15063
15186
  }
15064
15187
  /**
@@ -15083,7 +15206,7 @@ class ShareServiceClient extends StorageClient {
15083
15206
  if (coreHttp.isNode) {
15084
15207
  const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
15085
15208
  const pipeline = newPipeline(sharedKeyCredential, options);
15086
- return new ShareServiceClient(extractedCreds.url, pipeline);
15209
+ return new ShareServiceClient(extractedCreds.url, pipeline, options);
15087
15210
  }
15088
15211
  else {
15089
15212
  throw new Error("Account connection string is only supported in Node.js environment");
@@ -15091,7 +15214,7 @@ class ShareServiceClient extends StorageClient {
15091
15214
  }
15092
15215
  else if (extractedCreds.kind === "SASConnString") {
15093
15216
  const pipeline = newPipeline(new AnonymousCredential(), options);
15094
- return new ShareServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline);
15217
+ return new ShareServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline, options);
15095
15218
  }
15096
15219
  else {
15097
15220
  throw new Error("Connection string must be either an Account connection string or a SAS connection string");
@@ -15112,7 +15235,7 @@ class ShareServiceClient extends StorageClient {
15112
15235
  * ```
15113
15236
  */
15114
15237
  getShareClient(shareName) {
15115
- return new ShareClient(appendToURLPath(this.url, shareName), this.pipeline);
15238
+ return new ShareClient(appendToURLPath(this.url, shareName), this.pipeline, this.shareClientConfig);
15116
15239
  }
15117
15240
  /**
15118
15241
  * Creates a Share.
@@ -15478,6 +15601,14 @@ class ShareServiceClient extends StorageClient {
15478
15601
  }
15479
15602
  }
15480
15603
 
15604
+ // Copyright (c) Microsoft Corporation.
15605
+ // Licensed under the MIT license.
15606
+ /** Known values of {@link ShareTokenIntent} that the service accepts. */
15607
+ exports.KnownShareTokenIntent = void 0;
15608
+ (function (KnownShareTokenIntent) {
15609
+ KnownShareTokenIntent["Backup"] = "backup";
15610
+ })(exports.KnownShareTokenIntent || (exports.KnownShareTokenIntent = {}));
15611
+
15481
15612
  Object.defineProperty(exports, 'BaseRequestPolicy', {
15482
15613
  enumerable: true,
15483
15614
  get: function () { return coreHttp.BaseRequestPolicy; }