@azure/storage-file-share 12.23.0-alpha.20240527.1 → 12.23.0-alpha.20240529.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. package/dist/index.js +305 -354
  2. package/dist/index.js.map +1 -1
  3. package/dist-esm/storage-blob/src/Pipeline.js.map +1 -1
  4. package/dist-esm/storage-blob/src/generated/src/models/index.js.map +1 -1
  5. package/dist-esm/storage-blob/src/generated/src/models/mappers.js +2356 -2356
  6. package/dist-esm/storage-blob/src/generated/src/models/mappers.js.map +1 -1
  7. package/dist-esm/storage-blob/src/generated/src/models/parameters.js +444 -444
  8. package/dist-esm/storage-blob/src/generated/src/models/parameters.js.map +1 -1
  9. package/dist-esm/storage-blob/src/generated/src/operations/appendBlob.js +20 -20
  10. package/dist-esm/storage-blob/src/generated/src/operations/appendBlob.js.map +1 -1
  11. package/dist-esm/storage-blob/src/generated/src/operations/blob.js +134 -134
  12. package/dist-esm/storage-blob/src/generated/src/operations/blob.js.map +1 -1
  13. package/dist-esm/storage-blob/src/generated/src/operations/blockBlob.js +33 -33
  14. package/dist-esm/storage-blob/src/generated/src/operations/blockBlob.js.map +1 -1
  15. package/dist-esm/storage-blob/src/generated/src/operations/container.js +107 -107
  16. package/dist-esm/storage-blob/src/generated/src/operations/container.js.map +1 -1
  17. package/dist-esm/storage-blob/src/generated/src/operations/pageBlob.js +47 -47
  18. package/dist-esm/storage-blob/src/generated/src/operations/pageBlob.js.map +1 -1
  19. package/dist-esm/storage-blob/src/generated/src/operations/service.js +46 -46
  20. package/dist-esm/storage-blob/src/generated/src/operations/service.js.map +1 -1
  21. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/appendBlob.js.map +1 -1
  22. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/blob.js.map +1 -1
  23. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/blockBlob.js.map +1 -1
  24. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/container.js.map +1 -1
  25. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/pageBlob.js.map +1 -1
  26. package/dist-esm/storage-blob/src/generated/src/operationsInterfaces/service.js.map +1 -1
  27. package/dist-esm/storage-blob/src/generated/src/storageClient.js +4 -4
  28. package/dist-esm/storage-blob/src/generated/src/storageClient.js.map +1 -1
  29. package/dist-esm/storage-blob/src/generatedModels.js.map +1 -1
  30. package/dist-esm/storage-blob/src/index.js +1 -1
  31. package/dist-esm/storage-blob/src/index.js.map +1 -1
  32. package/dist-esm/storage-blob/src/models.js +7 -0
  33. package/dist-esm/storage-blob/src/models.js.map +1 -1
  34. package/dist-esm/storage-blob/src/utils/constants.js +1 -1
  35. package/dist-esm/storage-blob/src/utils/constants.js.map +1 -1
  36. package/dist-esm/storage-file-share/src/Clients.js +5 -5
  37. package/dist-esm/storage-file-share/src/Clients.js.map +1 -1
  38. package/dist-esm/storage-file-share/src/Pipeline.js +259 -0
  39. package/dist-esm/storage-file-share/src/Pipeline.js.map +1 -0
  40. package/dist-esm/storage-file-share/src/ShareClientInternal.js.map +1 -1
  41. package/dist-esm/storage-file-share/src/ShareServiceClient.js +2 -2
  42. package/dist-esm/storage-file-share/src/ShareServiceClient.js.map +1 -1
  43. package/dist-esm/storage-file-share/src/StorageClient.js +1 -1
  44. package/dist-esm/storage-file-share/src/StorageClient.js.map +1 -1
  45. package/dist-esm/storage-file-share/src/StorageRetryPolicyFactory.js +26 -0
  46. package/dist-esm/storage-file-share/src/StorageRetryPolicyFactory.js.map +1 -0
  47. package/dist-esm/storage-file-share/src/generated/src/models/index.js +2 -0
  48. package/dist-esm/storage-file-share/src/generated/src/models/index.js.map +1 -1
  49. package/dist-esm/storage-file-share/src/generated/src/models/mappers.js +8 -0
  50. package/dist-esm/storage-file-share/src/generated/src/models/mappers.js.map +1 -1
  51. package/dist-esm/storage-file-share/src/generated/src/models/parameters.js +11 -1
  52. package/dist-esm/storage-file-share/src/generated/src/models/parameters.js.map +1 -1
  53. package/dist-esm/storage-file-share/src/generated/src/operations/file.js +3 -1
  54. package/dist-esm/storage-file-share/src/generated/src/operations/file.js.map +1 -1
  55. package/dist-esm/storage-file-share/src/generated/src/storageClient.js +1 -1
  56. package/dist-esm/storage-file-share/src/generated/src/storageClient.js.map +1 -1
  57. package/dist-esm/storage-file-share/src/generatedModels.js.map +1 -1
  58. package/dist-esm/storage-file-share/src/index.browser.js +2 -2
  59. package/dist-esm/storage-file-share/src/index.browser.js.map +1 -1
  60. package/dist-esm/storage-file-share/src/index.js +3 -2
  61. package/dist-esm/storage-file-share/src/index.js.map +1 -1
  62. package/dist-esm/storage-file-share/src/models.js +16 -0
  63. package/dist-esm/storage-file-share/src/models.js.map +1 -1
  64. package/dist-esm/storage-file-share/src/policies/StorageRetryPolicy.js +204 -0
  65. package/dist-esm/storage-file-share/src/policies/StorageRetryPolicy.js.map +1 -0
  66. package/dist-esm/storage-file-share/src/policies/StorageRetryPolicyV2.js +160 -0
  67. package/dist-esm/storage-file-share/src/policies/StorageRetryPolicyV2.js.map +1 -0
  68. package/dist-esm/storage-file-share/src/utils/constants.js +5 -1
  69. package/dist-esm/storage-file-share/src/utils/constants.js.map +1 -1
  70. package/package.json +2 -2
  71. package/types/latest/storage-file-share.d.ts +42 -17
  72. package/dist-esm/storage-blob/src/BatchUtils.browser.js +0 -11
  73. package/dist-esm/storage-blob/src/BatchUtils.browser.js.map +0 -1
  74. package/dist-esm/storage-blob/src/BlobDownloadResponse.browser.js +0 -7
  75. package/dist-esm/storage-blob/src/BlobDownloadResponse.browser.js.map +0 -1
  76. package/dist-esm/storage-blob/src/BlobQueryResponse.browser.js +0 -362
  77. package/dist-esm/storage-blob/src/BlobQueryResponse.browser.js.map +0 -1
  78. package/dist-esm/storage-blob/src/index.browser.js +0 -23
  79. package/dist-esm/storage-blob/src/index.browser.js.map +0 -1
  80. package/dist-esm/storage-blob/src/utils/utils.browser.js +0 -48
  81. package/dist-esm/storage-blob/src/utils/utils.browser.js.map +0 -1
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ var coreAuth = require('@azure/core-auth');
9
9
  var coreHttpCompat = require('@azure/core-http-compat');
10
10
  var coreClient = require('@azure/core-client');
11
11
  var coreXml = require('@azure/core-xml');
12
- var logger$2 = require('@azure/logger');
12
+ var logger$1 = require('@azure/logger');
13
13
  var abortController = require('@azure/abort-controller');
14
14
  var crypto = require('crypto');
15
15
  var coreTracing = require('@azure/core-tracing');
@@ -336,13 +336,17 @@ function ipRangeToString(ipRange) {
336
336
 
337
337
  // Copyright (c) Microsoft Corporation.
338
338
  // Licensed under the MIT license.
339
- const SDK_VERSION$1 = "12.23.0-beta.2";
340
- const SERVICE_VERSION = "2023-01-03";
339
+ const SDK_VERSION = "12.23.0-beta.2";
340
+ const SERVICE_VERSION = "2024-05-04";
341
341
  const FILE_MAX_SIZE_BYTES = 4 * 1024 * 1024 * 1024 * 1024; // 4TB
342
342
  const FILE_RANGE_MAX_SIZE_BYTES = 4 * 1024 * 1024; // 4MB
343
343
  const DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5;
344
344
  const DEFAULT_HIGH_LEVEL_CONCURRENCY = 5;
345
345
  const REQUEST_TIMEOUT = 100 * 1000; // In ms
346
+ /**
347
+ * The OAuth scope to use with Azure Storage.
348
+ */
349
+ const StorageOAuthScopes = "https://storage.azure.com/.default";
346
350
  const URLConstants$1 = {
347
351
  Parameters: {
348
352
  FORCE_BROWSER_NO_CACHE: "_",
@@ -353,6 +357,88 @@ const URLConstants$1 = {
353
357
  };
354
358
  const FileAttributesPreserve = "Preserve";
355
359
  const FileAttributesNone = "None";
360
+ const StorageFileLoggingAllowedHeaderNames = [
361
+ "Access-Control-Allow-Origin",
362
+ "Cache-Control",
363
+ "Content-Length",
364
+ "Content-Type",
365
+ "Date",
366
+ "Request-Id",
367
+ "traceparent",
368
+ "Transfer-Encoding",
369
+ "User-Agent",
370
+ "x-ms-client-request-id",
371
+ "x-ms-date",
372
+ "x-ms-error-code",
373
+ "x-ms-request-id",
374
+ "x-ms-return-client-request-id",
375
+ "x-ms-version",
376
+ "Accept-Ranges",
377
+ "Content-Disposition",
378
+ "Content-Encoding",
379
+ "Content-Language",
380
+ "Content-MD5",
381
+ "Content-Range",
382
+ "ETag",
383
+ "Last-Modified",
384
+ "Server",
385
+ "Vary",
386
+ "x-ms-content-crc64",
387
+ "x-ms-copy-action",
388
+ "x-ms-copy-completion-time",
389
+ "x-ms-copy-id",
390
+ "x-ms-copy-progress",
391
+ "x-ms-copy-status",
392
+ "x-ms-has-immutability-policy",
393
+ "x-ms-has-legal-hold",
394
+ "x-ms-lease-state",
395
+ "x-ms-lease-status",
396
+ "x-ms-range",
397
+ "x-ms-request-server-encrypted",
398
+ "x-ms-server-encrypted",
399
+ "x-ms-snapshot",
400
+ "x-ms-source-range",
401
+ "x-ms-cache-control",
402
+ "x-ms-content-disposition",
403
+ "x-ms-content-encoding",
404
+ "x-ms-content-language",
405
+ "x-ms-content-length",
406
+ "x-ms-content-md5",
407
+ "x-ms-content-type",
408
+ "x-ms-file-attributes",
409
+ "x-ms-file-change-time",
410
+ "x-ms-file-creation-time",
411
+ "x-ms-file-id",
412
+ "x-ms-file-last-write-time",
413
+ "x-ms-file-parent-id",
414
+ "x-ms-handle-id",
415
+ "x-ms-number-of-handles-closed",
416
+ "x-ms-recursive",
417
+ "x-ms-share-quota",
418
+ "x-ms-type",
419
+ "x-ms-write",
420
+ ];
421
+ const StorageFileLoggingAllowedQueryParameters = [
422
+ "comp",
423
+ "maxresults",
424
+ "rscc",
425
+ "rscd",
426
+ "rsce",
427
+ "rscl",
428
+ "rsct",
429
+ "se",
430
+ "si",
431
+ "sip",
432
+ "sp",
433
+ "spr",
434
+ "sr",
435
+ "srt",
436
+ "ss",
437
+ "st",
438
+ "sv",
439
+ "copyid",
440
+ "restype",
441
+ ];
356
442
  /// List of ports used for path style addressing.
357
443
  /// Path style addressing means that storage account is put in URI's Path segment in instead of in host.
358
444
  const PathStylePorts = [
@@ -606,6 +692,36 @@ function truncatedISO8061Date(date, withMilliseconds = true) {
606
692
  ? dateString.substring(0, dateString.length - 1) + "0000" + "Z"
607
693
  : dateString.substring(0, dateString.length - 5) + "Z";
608
694
  }
695
+ /**
696
+ * Delay specified time interval.
697
+ *
698
+ * @param timeInMs -
699
+ * @param aborter -
700
+ * @param abortError -
701
+ */
702
+ async function delay(timeInMs, aborter, abortError) {
703
+ return new Promise((resolve, reject) => {
704
+ /* eslint-disable-next-line prefer-const */
705
+ let timeout;
706
+ const abortHandler = () => {
707
+ if (timeout !== undefined) {
708
+ clearTimeout(timeout);
709
+ }
710
+ reject(abortError);
711
+ };
712
+ const resolveHandler = () => {
713
+ if (aborter !== undefined) {
714
+ aborter.removeEventListener("abort", abortHandler);
715
+ }
716
+ resolve();
717
+ };
718
+ /* eslint-disable-next-line prefer-const */
719
+ timeout = setTimeout(resolveHandler, timeInMs);
720
+ if (aborter !== undefined) {
721
+ aborter.addEventListener("abort", abortHandler);
722
+ }
723
+ });
724
+ }
609
725
  /**
610
726
  * Extracts account name from the url
611
727
  * @param url - url to extract the account name from
@@ -1279,7 +1395,7 @@ function getCanonicalName(accountName, shareName, filePath) {
1279
1395
  /**
1280
1396
  * The `@azure/logger` configuration for this package.
1281
1397
  */
1282
- const logger$1 = logger$2.createClientLogger("storage-blob");
1398
+ const logger = logger$1.createClientLogger("storage-file-share");
1283
1399
 
1284
1400
  // Copyright (c) Microsoft Corporation.
1285
1401
  // Licensed under the MIT license.
@@ -1321,294 +1437,6 @@ class BaseRequestPolicy {
1321
1437
  }
1322
1438
  }
1323
1439
 
1324
- // Copyright (c) Microsoft Corporation.
1325
- // Licensed under the MIT license.
1326
- const SDK_VERSION = "12.23.0-beta.2";
1327
- /**
1328
- * The OAuth scope to use with Azure Storage.
1329
- */
1330
- const StorageOAuthScopes = "https://storage.azure.com/.default";
1331
- const URLConstants = {
1332
- Parameters: {
1333
- FORCE_BROWSER_NO_CACHE: "_",
1334
- SIGNATURE: "sig",
1335
- SNAPSHOT: "snapshot",
1336
- VERSIONID: "versionid",
1337
- TIMEOUT: "timeout",
1338
- },
1339
- };
1340
- const HeaderConstants = {
1341
- AUTHORIZATION: "Authorization",
1342
- AUTHORIZATION_SCHEME: "Bearer",
1343
- CONTENT_ENCODING: "Content-Encoding",
1344
- CONTENT_ID: "Content-ID",
1345
- CONTENT_LANGUAGE: "Content-Language",
1346
- CONTENT_LENGTH: "Content-Length",
1347
- CONTENT_MD5: "Content-Md5",
1348
- CONTENT_TRANSFER_ENCODING: "Content-Transfer-Encoding",
1349
- CONTENT_TYPE: "Content-Type",
1350
- COOKIE: "Cookie",
1351
- DATE: "date",
1352
- IF_MATCH: "if-match",
1353
- IF_MODIFIED_SINCE: "if-modified-since",
1354
- IF_NONE_MATCH: "if-none-match",
1355
- IF_UNMODIFIED_SINCE: "if-unmodified-since",
1356
- PREFIX_FOR_STORAGE: "x-ms-",
1357
- RANGE: "Range",
1358
- USER_AGENT: "User-Agent",
1359
- X_MS_CLIENT_REQUEST_ID: "x-ms-client-request-id",
1360
- X_MS_COPY_SOURCE: "x-ms-copy-source",
1361
- X_MS_DATE: "x-ms-date",
1362
- X_MS_ERROR_CODE: "x-ms-error-code",
1363
- X_MS_VERSION: "x-ms-version",
1364
- };
1365
- const StorageBlobLoggingAllowedHeaderNames = [
1366
- "Access-Control-Allow-Origin",
1367
- "Cache-Control",
1368
- "Content-Length",
1369
- "Content-Type",
1370
- "Date",
1371
- "Request-Id",
1372
- "traceparent",
1373
- "Transfer-Encoding",
1374
- "User-Agent",
1375
- "x-ms-client-request-id",
1376
- "x-ms-date",
1377
- "x-ms-error-code",
1378
- "x-ms-request-id",
1379
- "x-ms-return-client-request-id",
1380
- "x-ms-version",
1381
- "Accept-Ranges",
1382
- "Content-Disposition",
1383
- "Content-Encoding",
1384
- "Content-Language",
1385
- "Content-MD5",
1386
- "Content-Range",
1387
- "ETag",
1388
- "Last-Modified",
1389
- "Server",
1390
- "Vary",
1391
- "x-ms-content-crc64",
1392
- "x-ms-copy-action",
1393
- "x-ms-copy-completion-time",
1394
- "x-ms-copy-id",
1395
- "x-ms-copy-progress",
1396
- "x-ms-copy-status",
1397
- "x-ms-has-immutability-policy",
1398
- "x-ms-has-legal-hold",
1399
- "x-ms-lease-state",
1400
- "x-ms-lease-status",
1401
- "x-ms-range",
1402
- "x-ms-request-server-encrypted",
1403
- "x-ms-server-encrypted",
1404
- "x-ms-snapshot",
1405
- "x-ms-source-range",
1406
- "If-Match",
1407
- "If-Modified-Since",
1408
- "If-None-Match",
1409
- "If-Unmodified-Since",
1410
- "x-ms-access-tier",
1411
- "x-ms-access-tier-change-time",
1412
- "x-ms-access-tier-inferred",
1413
- "x-ms-account-kind",
1414
- "x-ms-archive-status",
1415
- "x-ms-blob-append-offset",
1416
- "x-ms-blob-cache-control",
1417
- "x-ms-blob-committed-block-count",
1418
- "x-ms-blob-condition-appendpos",
1419
- "x-ms-blob-condition-maxsize",
1420
- "x-ms-blob-content-disposition",
1421
- "x-ms-blob-content-encoding",
1422
- "x-ms-blob-content-language",
1423
- "x-ms-blob-content-length",
1424
- "x-ms-blob-content-md5",
1425
- "x-ms-blob-content-type",
1426
- "x-ms-blob-public-access",
1427
- "x-ms-blob-sequence-number",
1428
- "x-ms-blob-type",
1429
- "x-ms-copy-destination-snapshot",
1430
- "x-ms-creation-time",
1431
- "x-ms-default-encryption-scope",
1432
- "x-ms-delete-snapshots",
1433
- "x-ms-delete-type-permanent",
1434
- "x-ms-deny-encryption-scope-override",
1435
- "x-ms-encryption-algorithm",
1436
- "x-ms-if-sequence-number-eq",
1437
- "x-ms-if-sequence-number-le",
1438
- "x-ms-if-sequence-number-lt",
1439
- "x-ms-incremental-copy",
1440
- "x-ms-lease-action",
1441
- "x-ms-lease-break-period",
1442
- "x-ms-lease-duration",
1443
- "x-ms-lease-id",
1444
- "x-ms-lease-time",
1445
- "x-ms-page-write",
1446
- "x-ms-proposed-lease-id",
1447
- "x-ms-range-get-content-md5",
1448
- "x-ms-rehydrate-priority",
1449
- "x-ms-sequence-number-action",
1450
- "x-ms-sku-name",
1451
- "x-ms-source-content-md5",
1452
- "x-ms-source-if-match",
1453
- "x-ms-source-if-modified-since",
1454
- "x-ms-source-if-none-match",
1455
- "x-ms-source-if-unmodified-since",
1456
- "x-ms-tag-count",
1457
- "x-ms-encryption-key-sha256",
1458
- "x-ms-if-tags",
1459
- "x-ms-source-if-tags",
1460
- ];
1461
- const StorageBlobLoggingAllowedQueryParameters = [
1462
- "comp",
1463
- "maxresults",
1464
- "rscc",
1465
- "rscd",
1466
- "rsce",
1467
- "rscl",
1468
- "rsct",
1469
- "se",
1470
- "si",
1471
- "sip",
1472
- "sp",
1473
- "spr",
1474
- "sr",
1475
- "srt",
1476
- "ss",
1477
- "st",
1478
- "sv",
1479
- "include",
1480
- "marker",
1481
- "prefix",
1482
- "copyid",
1483
- "restype",
1484
- "blockid",
1485
- "blocklisttype",
1486
- "delimiter",
1487
- "prevsnapshot",
1488
- "ske",
1489
- "skoid",
1490
- "sks",
1491
- "skt",
1492
- "sktid",
1493
- "skv",
1494
- "snapshot",
1495
- ];
1496
-
1497
- // Copyright (c) Microsoft Corporation.
1498
- // Licensed under the MIT license.
1499
- /**
1500
- * Set URL parameter name and value. If name exists in URL parameters, old value
1501
- * will be replaced by name key. If not provide value, the parameter will be deleted.
1502
- *
1503
- * @param url - Source URL string
1504
- * @param name - Parameter name
1505
- * @param value - Parameter value
1506
- * @returns An updated URL string
1507
- */
1508
- function setURLParameter(url, name, value) {
1509
- const urlParsed = new URL(url);
1510
- const encodedName = encodeURIComponent(name);
1511
- const encodedValue = value ? encodeURIComponent(value) : undefined;
1512
- // mutating searchParams will change the encoding, so we have to do this ourselves
1513
- const searchString = urlParsed.search === "" ? "?" : urlParsed.search;
1514
- const searchPieces = [];
1515
- for (const pair of searchString.slice(1).split("&")) {
1516
- if (pair) {
1517
- const [key] = pair.split("=", 2);
1518
- if (key !== encodedName) {
1519
- searchPieces.push(pair);
1520
- }
1521
- }
1522
- }
1523
- if (encodedValue) {
1524
- searchPieces.push(`${encodedName}=${encodedValue}`);
1525
- }
1526
- urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : "";
1527
- return urlParsed.toString();
1528
- }
1529
- /**
1530
- * Set URL host.
1531
- *
1532
- * @param url - Source URL string
1533
- * @param host - New host string
1534
- * @returns An updated URL string
1535
- */
1536
- function setURLHost(url, host) {
1537
- const urlParsed = new URL(url);
1538
- urlParsed.hostname = host;
1539
- return urlParsed.toString();
1540
- }
1541
- /**
1542
- * Get URL path from an URL string.
1543
- *
1544
- * @param url - Source URL string
1545
- */
1546
- function getURLPath(url) {
1547
- try {
1548
- const urlParsed = new URL(url);
1549
- return urlParsed.pathname;
1550
- }
1551
- catch (e) {
1552
- return undefined;
1553
- }
1554
- }
1555
- /**
1556
- * Get URL query key value pairs from an URL string.
1557
- *
1558
- * @param url -
1559
- */
1560
- function getURLQueries(url) {
1561
- let queryString = new URL(url).search;
1562
- if (!queryString) {
1563
- return {};
1564
- }
1565
- queryString = queryString.trim();
1566
- queryString = queryString.startsWith("?") ? queryString.substring(1) : queryString;
1567
- let querySubStrings = queryString.split("&");
1568
- querySubStrings = querySubStrings.filter((value) => {
1569
- const indexOfEqual = value.indexOf("=");
1570
- const lastIndexOfEqual = value.lastIndexOf("=");
1571
- return (indexOfEqual > 0 && indexOfEqual === lastIndexOfEqual && lastIndexOfEqual < value.length - 1);
1572
- });
1573
- const queries = {};
1574
- for (const querySubString of querySubStrings) {
1575
- const splitResults = querySubString.split("=");
1576
- const key = splitResults[0];
1577
- const value = splitResults[1];
1578
- queries[key] = value;
1579
- }
1580
- return queries;
1581
- }
1582
- /**
1583
- * Delay specified time interval.
1584
- *
1585
- * @param timeInMs -
1586
- * @param aborter -
1587
- * @param abortError -
1588
- */
1589
- async function delay(timeInMs, aborter, abortError) {
1590
- return new Promise((resolve, reject) => {
1591
- /* eslint-disable-next-line prefer-const */
1592
- let timeout;
1593
- const abortHandler = () => {
1594
- if (timeout !== undefined) {
1595
- clearTimeout(timeout);
1596
- }
1597
- reject(abortError);
1598
- };
1599
- const resolveHandler = () => {
1600
- if (aborter !== undefined) {
1601
- aborter.removeEventListener("abort", abortHandler);
1602
- }
1603
- resolve();
1604
- };
1605
- timeout = setTimeout(resolveHandler, timeInMs);
1606
- if (aborter !== undefined) {
1607
- aborter.addEventListener("abort", abortHandler);
1608
- }
1609
- });
1610
- }
1611
-
1612
1440
  // Copyright (c) Microsoft Corporation.
1613
1441
  // Licensed under the MIT license.
1614
1442
  /**
@@ -1631,7 +1459,6 @@ const DEFAULT_RETRY_OPTIONS$1 = {
1631
1459
  maxTries: 4,
1632
1460
  retryDelayInMs: 4 * 1000,
1633
1461
  retryPolicyType: exports.StorageRetryPolicyType.EXPONENTIAL,
1634
- secondaryHost: "",
1635
1462
  tryTimeoutInMs: undefined, // Use server side default timeout strategy
1636
1463
  };
1637
1464
  const RETRY_ABORT_ERROR$1 = new abortController.AbortError("The operation was aborted.");
@@ -1667,9 +1494,6 @@ class StorageRetryPolicy extends BaseRequestPolicy {
1667
1494
  maxRetryDelayInMs: retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0
1668
1495
  ? retryOptions.maxRetryDelayInMs
1669
1496
  : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs,
1670
- secondaryHost: retryOptions.secondaryHost
1671
- ? retryOptions.secondaryHost
1672
- : DEFAULT_RETRY_OPTIONS$1.secondaryHost,
1673
1497
  };
1674
1498
  }
1675
1499
  /**
@@ -1692,20 +1516,14 @@ class StorageRetryPolicy extends BaseRequestPolicy {
1692
1516
  */
1693
1517
  async attemptSendRequest(request, secondaryHas404, attempt) {
1694
1518
  const newRequest = request.clone();
1695
- const isPrimaryRetry = secondaryHas404 ||
1696
- !this.retryOptions.secondaryHost ||
1697
- !(request.method === "GET" || request.method === "HEAD" || request.method === "OPTIONS") ||
1698
- attempt % 2 === 1;
1699
- if (!isPrimaryRetry) {
1700
- newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost);
1701
- }
1519
+ const isPrimaryRetry = true;
1702
1520
  // Set the server-side timeout query parameter "timeout=[seconds]"
1703
1521
  if (this.retryOptions.tryTimeoutInMs) {
1704
- newRequest.url = setURLParameter(newRequest.url, URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1000).toString());
1522
+ newRequest.url = setURLParameter$1(newRequest.url, URLConstants$1.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1000).toString());
1705
1523
  }
1706
1524
  let response;
1707
1525
  try {
1708
- logger$1.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`);
1526
+ logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`);
1709
1527
  response = await this._nextPolicy.sendRequest(newRequest);
1710
1528
  if (!this.shouldRetry(isPrimaryRetry, attempt, response)) {
1711
1529
  return response;
@@ -1713,7 +1531,7 @@ class StorageRetryPolicy extends BaseRequestPolicy {
1713
1531
  secondaryHas404 = secondaryHas404 || (!isPrimaryRetry && response.status === 404);
1714
1532
  }
1715
1533
  catch (err) {
1716
- logger$1.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`);
1534
+ logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`);
1717
1535
  if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) {
1718
1536
  throw err;
1719
1537
  }
@@ -1731,7 +1549,7 @@ class StorageRetryPolicy extends BaseRequestPolicy {
1731
1549
  */
1732
1550
  shouldRetry(isPrimaryRetry, attempt, response, err) {
1733
1551
  if (attempt >= this.retryOptions.maxTries) {
1734
- logger$1.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions
1552
+ logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions
1735
1553
  .maxTries}, no further try.`);
1736
1554
  return false;
1737
1555
  }
@@ -1753,7 +1571,7 @@ class StorageRetryPolicy extends BaseRequestPolicy {
1753
1571
  if (err.name.toUpperCase().includes(retriableError) ||
1754
1572
  err.message.toUpperCase().includes(retriableError) ||
1755
1573
  (err.code && err.code.toString().toUpperCase() === retriableError)) {
1756
- logger$1.info(`RetryPolicy: Network error ${retriableError} found, will retry.`);
1574
+ logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`);
1757
1575
  return true;
1758
1576
  }
1759
1577
  }
@@ -1764,17 +1582,17 @@ class StorageRetryPolicy extends BaseRequestPolicy {
1764
1582
  if (response || err) {
1765
1583
  const statusCode = response ? response.status : err ? err.statusCode : 0;
1766
1584
  if (!isPrimaryRetry && statusCode === 404) {
1767
- logger$1.info(`RetryPolicy: Secondary access with 404, will retry.`);
1585
+ logger.info(`RetryPolicy: Secondary access with 404, will retry.`);
1768
1586
  return true;
1769
1587
  }
1770
1588
  // Server internal error or server timeout
1771
1589
  if (statusCode === 503 || statusCode === 500) {
1772
- logger$1.info(`RetryPolicy: Will retry for status code ${statusCode}.`);
1590
+ logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`);
1773
1591
  return true;
1774
1592
  }
1775
1593
  }
1776
1594
  if ((err === null || err === void 0 ? void 0 : err.code) === "PARSE_ERROR" && (err === null || err === void 0 ? void 0 : err.message.startsWith(`Error "Error: Unclosed root tag`))) {
1777
- logger$1.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry.");
1595
+ logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry.");
1778
1596
  return true;
1779
1597
  }
1780
1598
  return false;
@@ -1801,7 +1619,7 @@ class StorageRetryPolicy extends BaseRequestPolicy {
1801
1619
  else {
1802
1620
  delayTimeInMs = Math.random() * 1000;
1803
1621
  }
1804
- logger$1.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`);
1622
+ logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`);
1805
1623
  return delay(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR$1);
1806
1624
  }
1807
1625
  }
@@ -1830,6 +1648,117 @@ class StorageRetryPolicyFactory {
1830
1648
  }
1831
1649
  }
1832
1650
 
1651
+ // Copyright (c) Microsoft Corporation.
1652
+ // Licensed under the MIT license.
1653
+ const URLConstants = {
1654
+ Parameters: {
1655
+ FORCE_BROWSER_NO_CACHE: "_",
1656
+ SIGNATURE: "sig",
1657
+ SNAPSHOT: "snapshot",
1658
+ VERSIONID: "versionid",
1659
+ TIMEOUT: "timeout",
1660
+ },
1661
+ };
1662
+ const HeaderConstants = {
1663
+ AUTHORIZATION: "Authorization",
1664
+ AUTHORIZATION_SCHEME: "Bearer",
1665
+ CONTENT_ENCODING: "Content-Encoding",
1666
+ CONTENT_ID: "Content-ID",
1667
+ CONTENT_LANGUAGE: "Content-Language",
1668
+ CONTENT_LENGTH: "Content-Length",
1669
+ CONTENT_MD5: "Content-Md5",
1670
+ CONTENT_TRANSFER_ENCODING: "Content-Transfer-Encoding",
1671
+ CONTENT_TYPE: "Content-Type",
1672
+ COOKIE: "Cookie",
1673
+ DATE: "date",
1674
+ IF_MATCH: "if-match",
1675
+ IF_MODIFIED_SINCE: "if-modified-since",
1676
+ IF_NONE_MATCH: "if-none-match",
1677
+ IF_UNMODIFIED_SINCE: "if-unmodified-since",
1678
+ PREFIX_FOR_STORAGE: "x-ms-",
1679
+ RANGE: "Range",
1680
+ USER_AGENT: "User-Agent",
1681
+ X_MS_CLIENT_REQUEST_ID: "x-ms-client-request-id",
1682
+ X_MS_COPY_SOURCE: "x-ms-copy-source",
1683
+ X_MS_DATE: "x-ms-date",
1684
+ X_MS_ERROR_CODE: "x-ms-error-code",
1685
+ X_MS_VERSION: "x-ms-version",
1686
+ };
1687
+
1688
+ // Copyright (c) Microsoft Corporation.
1689
+ // Licensed under the MIT license.
1690
+ /**
1691
+ * Set URL parameter name and value. If name exists in URL parameters, old value
1692
+ * will be replaced by name key. If not provide value, the parameter will be deleted.
1693
+ *
1694
+ * @param url - Source URL string
1695
+ * @param name - Parameter name
1696
+ * @param value - Parameter value
1697
+ * @returns An updated URL string
1698
+ */
1699
+ function setURLParameter(url, name, value) {
1700
+ const urlParsed = new URL(url);
1701
+ const encodedName = encodeURIComponent(name);
1702
+ const encodedValue = value ? encodeURIComponent(value) : undefined;
1703
+ // mutating searchParams will change the encoding, so we have to do this ourselves
1704
+ const searchString = urlParsed.search === "" ? "?" : urlParsed.search;
1705
+ const searchPieces = [];
1706
+ for (const pair of searchString.slice(1).split("&")) {
1707
+ if (pair) {
1708
+ const [key] = pair.split("=", 2);
1709
+ if (key !== encodedName) {
1710
+ searchPieces.push(pair);
1711
+ }
1712
+ }
1713
+ }
1714
+ if (encodedValue) {
1715
+ searchPieces.push(`${encodedName}=${encodedValue}`);
1716
+ }
1717
+ urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : "";
1718
+ return urlParsed.toString();
1719
+ }
1720
+ /**
1721
+ * Get URL path from an URL string.
1722
+ *
1723
+ * @param url - Source URL string
1724
+ */
1725
+ function getURLPath(url) {
1726
+ try {
1727
+ const urlParsed = new URL(url);
1728
+ return urlParsed.pathname;
1729
+ }
1730
+ catch (e) {
1731
+ return undefined;
1732
+ }
1733
+ }
1734
+ /**
1735
+ * Get URL query key value pairs from an URL string.
1736
+ *
1737
+ * @param url -
1738
+ */
1739
+ function getURLQueries(url) {
1740
+ let queryString = new URL(url).search;
1741
+ if (!queryString) {
1742
+ return {};
1743
+ }
1744
+ queryString = queryString.trim();
1745
+ queryString = queryString.startsWith("?") ? queryString.substring(1) : queryString;
1746
+ let querySubStrings = queryString.split("&");
1747
+ querySubStrings = querySubStrings.filter((value) => {
1748
+ const indexOfEqual = value.indexOf("=");
1749
+ const lastIndexOfEqual = value.lastIndexOf("=");
1750
+ return (indexOfEqual > 0 && indexOfEqual === lastIndexOfEqual && lastIndexOfEqual < value.length - 1);
1751
+ });
1752
+ const queries = {};
1753
+ for (const querySubString of querySubStrings) {
1754
+ const splitResults = querySubString.split("=");
1755
+ const key = splitResults[0];
1756
+ const value = splitResults[1];
1757
+ queries[key] = value;
1758
+ }
1759
+ return queries;
1760
+ }
1761
+
1833
1762
  // Copyright (c) Microsoft Corporation.
1834
1763
  // Licensed under the MIT license.
1835
1764
  /**
@@ -2172,17 +2101,16 @@ const RETRY_ABORT_ERROR = new abortController.AbortError("The operation was abor
2172
2101
  * Retry policy with exponential retry and linear retry implemented.
2173
2102
  */
2174
2103
  function storageRetryPolicy(options = {}) {
2175
- var _a, _b, _c, _d, _e, _f;
2104
+ var _a, _b, _c, _d, _e;
2176
2105
  const retryPolicyType = (_a = options.retryPolicyType) !== null && _a !== void 0 ? _a : DEFAULT_RETRY_OPTIONS.retryPolicyType;
2177
2106
  const maxTries = (_b = options.maxTries) !== null && _b !== void 0 ? _b : DEFAULT_RETRY_OPTIONS.maxTries;
2178
2107
  const retryDelayInMs = (_c = options.retryDelayInMs) !== null && _c !== void 0 ? _c : DEFAULT_RETRY_OPTIONS.retryDelayInMs;
2179
2108
  const maxRetryDelayInMs = (_d = options.maxRetryDelayInMs) !== null && _d !== void 0 ? _d : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs;
2180
- const secondaryHost = (_e = options.secondaryHost) !== null && _e !== void 0 ? _e : DEFAULT_RETRY_OPTIONS.secondaryHost;
2181
- const tryTimeoutInMs = (_f = options.tryTimeoutInMs) !== null && _f !== void 0 ? _f : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs;
2109
+ const tryTimeoutInMs = (_e = options.tryTimeoutInMs) !== null && _e !== void 0 ? _e : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs;
2182
2110
  function shouldRetry({ isPrimaryRetry, attempt, response, error, }) {
2183
2111
  var _a, _b;
2184
2112
  if (attempt >= maxTries) {
2185
- logger$1.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`);
2113
+ logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`);
2186
2114
  return false;
2187
2115
  }
2188
2116
  if (error) {
@@ -2190,13 +2118,13 @@ function storageRetryPolicy(options = {}) {
2190
2118
  if (error.name.toUpperCase().includes(retriableError) ||
2191
2119
  error.message.toUpperCase().includes(retriableError) ||
2192
2120
  (error.code && error.code.toString().toUpperCase() === retriableError)) {
2193
- logger$1.info(`RetryPolicy: Network error ${retriableError} found, will retry.`);
2121
+ logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`);
2194
2122
  return true;
2195
2123
  }
2196
2124
  }
2197
2125
  if ((error === null || error === void 0 ? void 0 : error.code) === "PARSE_ERROR" &&
2198
2126
  (error === null || error === void 0 ? void 0 : error.message.startsWith(`Error "Error: Unclosed root tag`))) {
2199
- logger$1.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry.");
2127
+ logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry.");
2200
2128
  return true;
2201
2129
  }
2202
2130
  }
@@ -2206,12 +2134,12 @@ function storageRetryPolicy(options = {}) {
2206
2134
  if (response || error) {
2207
2135
  const statusCode = (_b = (_a = response === null || response === void 0 ? void 0 : response.status) !== null && _a !== void 0 ? _a : error === null || error === void 0 ? void 0 : error.statusCode) !== null && _b !== void 0 ? _b : 0;
2208
2136
  if (!isPrimaryRetry && statusCode === 404) {
2209
- logger$1.info(`RetryPolicy: Secondary access with 404, will retry.`);
2137
+ logger.info(`RetryPolicy: Secondary access with 404, will retry.`);
2210
2138
  return true;
2211
2139
  }
2212
2140
  // Server internal error or server timeout
2213
2141
  if (statusCode === 503 || statusCode === 500) {
2214
- logger$1.info(`RetryPolicy: Will retry for status code ${statusCode}.`);
2142
+ logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`);
2215
2143
  return true;
2216
2144
  }
2217
2145
  }
@@ -2219,7 +2147,7 @@ function storageRetryPolicy(options = {}) {
2219
2147
  }
2220
2148
  function calculateDelay(isPrimaryRetry, attempt) {
2221
2149
  let delayTimeInMs = 0;
2222
- if (isPrimaryRetry) {
2150
+ {
2223
2151
  switch (retryPolicyType) {
2224
2152
  case StorageRetryPolicyType.EXPONENTIAL:
2225
2153
  delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * retryDelayInMs, maxRetryDelayInMs);
@@ -2229,10 +2157,7 @@ function storageRetryPolicy(options = {}) {
2229
2157
  break;
2230
2158
  }
2231
2159
  }
2232
- else {
2233
- delayTimeInMs = Math.random() * 1000;
2234
- }
2235
- logger$1.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`);
2160
+ logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`);
2236
2161
  return delayTimeInMs;
2237
2162
  }
2238
2163
  return {
@@ -2240,35 +2165,31 @@ function storageRetryPolicy(options = {}) {
2240
2165
  async sendRequest(request, next) {
2241
2166
  // Set the server-side timeout query parameter "timeout=[seconds]"
2242
2167
  if (tryTimeoutInMs) {
2243
- request.url = setURLParameter(request.url, URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1000)));
2168
+ request.url = setURLParameter$1(request.url, URLConstants$1.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1000)));
2244
2169
  }
2245
2170
  const primaryUrl = request.url;
2246
- const secondaryUrl = secondaryHost ? setURLHost(request.url, secondaryHost) : undefined;
2247
2171
  let secondaryHas404 = false;
2248
2172
  let attempt = 1;
2249
2173
  let retryAgain = true;
2250
2174
  let response;
2251
2175
  let error;
2252
2176
  while (retryAgain) {
2253
- const isPrimaryRetry = secondaryHas404 ||
2254
- !secondaryUrl ||
2255
- !["GET", "HEAD", "OPTIONS"].includes(request.method) ||
2256
- attempt % 2 === 1;
2257
- request.url = isPrimaryRetry ? primaryUrl : secondaryUrl;
2177
+ const isPrimaryRetry = true;
2178
+ request.url = primaryUrl;
2258
2179
  response = undefined;
2259
2180
  error = undefined;
2260
2181
  try {
2261
- logger$1.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`);
2182
+ logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`);
2262
2183
  response = await next(request);
2263
2184
  secondaryHas404 = secondaryHas404 || (!isPrimaryRetry && response.status === 404);
2264
2185
  }
2265
2186
  catch (e) {
2266
2187
  if (coreRestPipeline.isRestError(e)) {
2267
- logger$1.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`);
2188
+ logger.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`);
2268
2189
  error = e;
2269
2190
  }
2270
2191
  else {
2271
- logger$1.error(`RetryPolicy: Caught error, message: ${coreUtil.getErrorMessage(e)}`);
2192
+ logger.error(`RetryPolicy: Caught error, message: ${coreUtil.getErrorMessage(e)}`);
2272
2193
  throw e;
2273
2194
  }
2274
2195
  }
@@ -2577,9 +2498,9 @@ function getCoreClientOptions(pipeline) {
2577
2498
  ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}`
2578
2499
  : `${packageDetails}`;
2579
2500
  corePipeline = coreClient.createClientPipeline(Object.assign(Object.assign({}, restOptions), { loggingOptions: {
2580
- additionalAllowedHeaderNames: StorageBlobLoggingAllowedHeaderNames,
2581
- additionalAllowedQueryParameters: StorageBlobLoggingAllowedQueryParameters,
2582
- logger: logger$1.info,
2501
+ additionalAllowedHeaderNames: StorageFileLoggingAllowedHeaderNames,
2502
+ additionalAllowedQueryParameters: StorageFileLoggingAllowedQueryParameters,
2503
+ logger: logger.info,
2583
2504
  }, userAgentOptions: {
2584
2505
  userAgentPrefix,
2585
2506
  }, serializationOptions: {
@@ -2722,7 +2643,7 @@ function isCoreHttpPolicyFactory(factory) {
2722
2643
  */
2723
2644
  const tracingClient = coreTracing.createTracingClient({
2724
2645
  packageName: "@azure/storage-file-share",
2725
- packageVersion: SDK_VERSION$1,
2646
+ packageVersion: SDK_VERSION,
2726
2647
  namespace: "Microsoft.Storage",
2727
2648
  });
2728
2649
 
@@ -3736,6 +3657,14 @@ const HandleItem = {
3736
3657
  name: "String"
3737
3658
  }
3738
3659
  },
3660
+ clientName: {
3661
+ serializedName: "ClientName",
3662
+ required: true,
3663
+ xmlName: "ClientName",
3664
+ type: {
3665
+ name: "String"
3666
+ }
3667
+ },
3739
3668
  openTime: {
3740
3669
  serializedName: "OpenTime",
3741
3670
  required: true,
@@ -8101,7 +8030,7 @@ const timeoutInSeconds = {
8101
8030
  const version = {
8102
8031
  parameterPath: "version",
8103
8032
  mapper: {
8104
- defaultValue: "2023-01-03",
8033
+ defaultValue: "2024-05-04",
8105
8034
  isConstant: true,
8106
8035
  serializedName: "x-ms-version",
8107
8036
  type: {
@@ -9130,6 +9059,16 @@ const prevsharesnapshot = {
9130
9059
  }
9131
9060
  }
9132
9061
  };
9062
+ const supportRename = {
9063
+ parameterPath: ["options", "supportRename"],
9064
+ mapper: {
9065
+ serializedName: "x-ms-file-support-rename",
9066
+ xmlName: "x-ms-file-support-rename",
9067
+ type: {
9068
+ name: "Boolean"
9069
+ }
9070
+ }
9071
+ };
9133
9072
  const filePermissionCopyMode = {
9134
9073
  parameterPath: ["options", "copyFileSmbInfo", "filePermissionCopyMode"],
9135
9074
  mapper: {
@@ -10861,6 +10800,7 @@ const uploadRangeFromURLOperationSpec = {
10861
10800
  version,
10862
10801
  accept1,
10863
10802
  leaseId,
10803
+ fileRequestIntent,
10864
10804
  allowTrailingDot,
10865
10805
  allowSourceTrailingDot,
10866
10806
  range1,
@@ -10903,7 +10843,8 @@ const getRangeListOperationSpec = {
10903
10843
  leaseId,
10904
10844
  fileRequestIntent,
10905
10845
  allowTrailingDot,
10906
- range
10846
+ range,
10847
+ supportRename
10907
10848
  ],
10908
10849
  isXML: true,
10909
10850
  serializer: xmlSerializer
@@ -11107,7 +11048,7 @@ let StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.Exte
11107
11048
  // Parameter assignments
11108
11049
  this.url = url;
11109
11050
  // Assigning values to Constant parameters
11110
- this.version = options.version || "2023-01-03";
11051
+ this.version = options.version || "2024-05-04";
11111
11052
  this.fileRangeWriteFromUrl = options.fileRangeWriteFromUrl || "update";
11112
11053
  this.service = new ServiceImpl(this);
11113
11054
  this.share = new ShareImpl(this);
@@ -11801,13 +11742,6 @@ function rangeToString(range) {
11801
11742
  : `bytes=${range.offset}-`;
11802
11743
  }
11803
11744
 
11804
- // Copyright (c) Microsoft Corporation.
11805
- // Licensed under the MIT license.
11806
- /**
11807
- * The `@azure/logger` configuration for this package.
11808
- */
11809
- const logger = logger$2.createClientLogger("storage-file-share");
11810
-
11811
11745
  // Copyright (c) Microsoft Corporation.
11812
11746
  // Licensed under the MIT license.
11813
11747
  /**
@@ -11903,6 +11837,22 @@ function fileLastWriteTimeToString(time) {
11903
11837
  function fileChangeTimeToString(time) {
11904
11838
  return time instanceof Date ? truncatedISO8061Date(time) : time;
11905
11839
  }
11840
+ /**
11841
+ * Defines the known cloud audiences for Storage.
11842
+ */
11843
+ exports.StorageFileAudience = void 0;
11844
+ (function (StorageFileAudience) {
11845
+ /**
11846
+ * The OAuth scope to use to retrieve an AAD token for Azure Storage.
11847
+ */
11848
+ StorageFileAudience["StorageOAuthScopes"] = "https://storage.azure.com/.default";
11849
+ })(exports.StorageFileAudience || (exports.StorageFileAudience = {}));
11850
+ /**
11851
+ * To get the OAuth audience for a storage account for file service.
11852
+ */
11853
+ function getFileServiceAccountAudience(storageAccountName) {
11854
+ return `https://${storageAccountName}.file.core.windows.net/.default`;
11855
+ }
11906
11856
 
11907
11857
  // Copyright (c) Microsoft Corporation.
11908
11858
  // Licensed under the MIT license.
@@ -12382,7 +12332,7 @@ class ShareClient extends StorageClient {
12382
12332
  options) {
12383
12333
  let pipeline;
12384
12334
  let url;
12385
- if (credentialOrPipelineOrShareName instanceof Pipeline) {
12335
+ if (isPipelineLike(credentialOrPipelineOrShareName)) {
12386
12336
  // (url: string, pipeline: Pipeline)
12387
12337
  url = urlOrConnectionString;
12388
12338
  pipeline = credentialOrPipelineOrShareName;
@@ -12877,7 +12827,7 @@ class ShareDirectoryClient extends StorageClient {
12877
12827
  /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */
12878
12828
  options = {}) {
12879
12829
  let pipeline;
12880
- if (credentialOrPipeline instanceof Pipeline) {
12830
+ if (isPipelineLike(credentialOrPipeline)) {
12881
12831
  pipeline = credentialOrPipeline;
12882
12832
  }
12883
12833
  else if (credentialOrPipeline instanceof Credential ||
@@ -13693,7 +13643,7 @@ class ShareFileClient extends StorageClient {
13693
13643
  /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */
13694
13644
  options) {
13695
13645
  let pipeline;
13696
- if (credentialOrPipeline instanceof Pipeline) {
13646
+ if (isPipelineLike(credentialOrPipeline)) {
13697
13647
  pipeline = credentialOrPipeline;
13698
13648
  }
13699
13649
  else if (credentialOrPipeline instanceof Credential ||
@@ -14136,7 +14086,7 @@ class ShareFileClient extends StorageClient {
14136
14086
  */
14137
14087
  async getRangeListDiff(prevShareSnapshot, options = {}) {
14138
14088
  return tracingClient.withSpan("ShareFileClient-getRangeListDiff", options, async (updatedOptions) => {
14139
- return assertResponse(await this.context.getRangeList(Object.assign(Object.assign(Object.assign({}, updatedOptions), { prevsharesnapshot: prevShareSnapshot, range: updatedOptions.range ? rangeToString(updatedOptions.range) : undefined }), this.shareClientConfig)));
14089
+ return assertResponse(await this.context.getRangeList(Object.assign(Object.assign(Object.assign({}, updatedOptions), { prevsharesnapshot: prevShareSnapshot, supportRename: options.includeRenames, range: updatedOptions.range ? rangeToString(updatedOptions.range) : undefined }), this.shareClientConfig)));
14140
14090
  });
14141
14091
  }
14142
14092
  /**
@@ -14929,7 +14879,7 @@ class ShareServiceClient extends StorageClient {
14929
14879
  /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */
14930
14880
  options) {
14931
14881
  let pipeline;
14932
- if (credentialOrPipeline instanceof Pipeline) {
14882
+ if (isPipelineLike(credentialOrPipeline)) {
14933
14883
  pipeline = credentialOrPipeline;
14934
14884
  }
14935
14885
  else if (credentialOrPipeline instanceof Credential ||
@@ -15300,6 +15250,7 @@ exports.StorageSharedKeyCredential = StorageSharedKeyCredential;
15300
15250
  exports.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy;
15301
15251
  exports.generateAccountSASQueryParameters = generateAccountSASQueryParameters;
15302
15252
  exports.generateFileSASQueryParameters = generateFileSASQueryParameters;
15253
+ exports.getFileServiceAccountAudience = getFileServiceAccountAudience;
15303
15254
  exports.isPipelineLike = isPipelineLike;
15304
15255
  exports.logger = logger;
15305
15256
  exports.newPipeline = newPipeline;