@azure/storage-file-share 12.23.0 → 12.24.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 (50) hide show
  1. package/dist/index.js +149 -8
  2. package/dist/index.js.map +1 -1
  3. package/dist-esm/storage-blob/src/Clients.js +18 -0
  4. package/dist-esm/storage-blob/src/Clients.js.map +1 -1
  5. package/dist-esm/storage-blob/src/ContainerClient.js +18 -0
  6. package/dist-esm/storage-blob/src/ContainerClient.js.map +1 -1
  7. package/dist-esm/storage-blob/src/generated/src/models/index.js.map +1 -1
  8. package/dist-esm/storage-blob/src/generated/src/models/mappers.js +21 -0
  9. package/dist-esm/storage-blob/src/generated/src/models/mappers.js.map +1 -1
  10. package/dist-esm/storage-blob/src/generated/src/models/parameters.js +1 -1
  11. package/dist-esm/storage-blob/src/generated/src/models/parameters.js.map +1 -1
  12. package/dist-esm/storage-blob/src/generated/src/operations/blob.js +10 -2
  13. package/dist-esm/storage-blob/src/generated/src/operations/blob.js.map +1 -1
  14. package/dist-esm/storage-blob/src/generated/src/operations/container.js +10 -2
  15. package/dist-esm/storage-blob/src/generated/src/operations/container.js.map +1 -1
  16. package/dist-esm/storage-blob/src/generated/src/operations/service.js +10 -2
  17. package/dist-esm/storage-blob/src/generated/src/operations/service.js.map +1 -1
  18. package/dist-esm/storage-blob/src/generated/src/storageClient.js +2 -2
  19. package/dist-esm/storage-blob/src/generated/src/storageClient.js.map +1 -1
  20. package/dist-esm/storage-blob/src/generatedModels.js.map +1 -1
  21. package/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js +15 -0
  22. package/dist-esm/storage-blob/src/policies/StorageRetryPolicy.js.map +1 -1
  23. package/dist-esm/storage-blob/src/policies/StorageRetryPolicyV2.js +15 -0
  24. package/dist-esm/storage-blob/src/policies/StorageRetryPolicyV2.js.map +1 -1
  25. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.js +2 -1
  26. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.js.map +1 -1
  27. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.js +2 -1
  28. package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.js.map +1 -1
  29. package/dist-esm/storage-blob/src/utils/SharedKeyComparator.js +73 -0
  30. package/dist-esm/storage-blob/src/utils/SharedKeyComparator.js.map +1 -0
  31. package/dist-esm/storage-blob/src/utils/constants.js +4 -1
  32. package/dist-esm/storage-blob/src/utils/constants.js.map +1 -1
  33. package/dist-esm/storage-file-share/src/Clients.js.map +1 -1
  34. package/dist-esm/storage-file-share/src/generated/src/models/index.js.map +1 -1
  35. package/dist-esm/storage-file-share/src/generated/src/models/mappers.js +21 -0
  36. package/dist-esm/storage-file-share/src/generated/src/models/mappers.js.map +1 -1
  37. package/dist-esm/storage-file-share/src/generated/src/models/parameters.js +11 -1
  38. package/dist-esm/storage-file-share/src/generated/src/models/parameters.js.map +1 -1
  39. package/dist-esm/storage-file-share/src/generated/src/operations/share.js +3 -1
  40. package/dist-esm/storage-file-share/src/generated/src/operations/share.js.map +1 -1
  41. package/dist-esm/storage-file-share/src/generated/src/storageClient.js +2 -2
  42. package/dist-esm/storage-file-share/src/generated/src/storageClient.js.map +1 -1
  43. package/dist-esm/storage-file-share/src/policies/StorageRetryPolicy.js +16 -0
  44. package/dist-esm/storage-file-share/src/policies/StorageRetryPolicy.js.map +1 -1
  45. package/dist-esm/storage-file-share/src/policies/StorageRetryPolicyV2.js +16 -0
  46. package/dist-esm/storage-file-share/src/policies/StorageRetryPolicyV2.js.map +1 -1
  47. package/dist-esm/storage-file-share/src/utils/constants.js +5 -2
  48. package/dist-esm/storage-file-share/src/utils/constants.js.map +1 -1
  49. package/package.json +2 -2
  50. package/types/latest/storage-file-share.d.ts +10 -0
package/dist/index.js CHANGED
@@ -336,8 +336,8 @@ function ipRangeToString(ipRange) {
336
336
 
337
337
  // Copyright (c) Microsoft Corporation.
338
338
  // Licensed under the MIT license.
339
- const SDK_VERSION = "12.23.0";
340
- const SERVICE_VERSION = "2024-05-04";
339
+ const SDK_VERSION = "12.24.0-beta.1";
340
+ const SERVICE_VERSION = "2024-08-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;
@@ -405,6 +405,8 @@ const StorageFileLoggingAllowedHeaderNames = [
405
405
  "x-ms-content-length",
406
406
  "x-ms-content-md5",
407
407
  "x-ms-content-type",
408
+ "x-ms-copy-source-error-code",
409
+ "x-ms-copy-source-status-code",
408
410
  "x-ms-file-attributes",
409
411
  "x-ms-file-change-time",
410
412
  "x-ms-file-creation-time",
@@ -1591,6 +1593,22 @@ class StorageRetryPolicy extends BaseRequestPolicy {
1591
1593
  return true;
1592
1594
  }
1593
1595
  }
1596
+ // [Copy source error code] Feature is pending on service side, skip retry on copy source error for now.
1597
+ // if (response) {
1598
+ // // Retry select Copy Source Error Codes.
1599
+ // if (response?.status >= 400) {
1600
+ // const copySourceError = response.headers.get(HeaderConstants.X_MS_CopySourceErrorCode);
1601
+ // if (copySourceError !== undefined) {
1602
+ // switch (copySourceError)
1603
+ // {
1604
+ // case "InternalError":
1605
+ // case "OperationTimedOut":
1606
+ // case "ServerBusy":
1607
+ // return true;
1608
+ // }
1609
+ // }
1610
+ // }
1611
+ // }
1594
1612
  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`))) {
1595
1613
  logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry.");
1596
1614
  return true;
@@ -1683,6 +1701,7 @@ const HeaderConstants = {
1683
1701
  X_MS_DATE: "x-ms-date",
1684
1702
  X_MS_ERROR_CODE: "x-ms-error-code",
1685
1703
  X_MS_VERSION: "x-ms-version",
1704
+ X_MS_CopySourceErrorCode: "x-ms-copy-source-error-code",
1686
1705
  };
1687
1706
 
1688
1707
  // Copyright (c) Microsoft Corporation.
@@ -1787,6 +1806,79 @@ class CredentialPolicy extends BaseRequestPolicy {
1787
1806
  }
1788
1807
  }
1789
1808
 
1809
+ // Copyright (c) Microsoft Corporation.
1810
+ // Licensed under the MIT license.
1811
+ /*
1812
+ * We need to imitate .Net culture-aware sorting, which is used in storage service.
1813
+ * Below tables contain sort-keys for en-US culture.
1814
+ */
1815
+ const table_lv0 = new Uint32Array([
1816
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1817
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x71c, 0x0, 0x71f, 0x721,
1818
+ 0x723, 0x725, 0x0, 0x0, 0x0, 0x72d, 0x803, 0x0, 0x0, 0x733, 0x0, 0xd03, 0xd1a, 0xd1c, 0xd1e,
1819
+ 0xd20, 0xd22, 0xd24, 0xd26, 0xd28, 0xd2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe02, 0xe09, 0xe0a,
1820
+ 0xe1a, 0xe21, 0xe23, 0xe25, 0xe2c, 0xe32, 0xe35, 0xe36, 0xe48, 0xe51, 0xe70, 0xe7c, 0xe7e, 0xe89,
1821
+ 0xe8a, 0xe91, 0xe99, 0xe9f, 0xea2, 0xea4, 0xea6, 0xea7, 0xea9, 0x0, 0x0, 0x0, 0x743, 0x744, 0x748,
1822
+ 0xe02, 0xe09, 0xe0a, 0xe1a, 0xe21, 0xe23, 0xe25, 0xe2c, 0xe32, 0xe35, 0xe36, 0xe48, 0xe51, 0xe70,
1823
+ 0xe7c, 0xe7e, 0xe89, 0xe8a, 0xe91, 0xe99, 0xe9f, 0xea2, 0xea4, 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x0, 0x0, 0x0, 0x8212, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1839
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1840
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1841
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1842
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1843
+ ]);
1844
+ function compareHeader(lhs, rhs) {
1845
+ if (isLessThan(lhs, rhs))
1846
+ return -1;
1847
+ return 1;
1848
+ }
1849
+ function isLessThan(lhs, rhs) {
1850
+ const tables = [table_lv0, table_lv2, table_lv4];
1851
+ let curr_level = 0;
1852
+ let i = 0;
1853
+ let j = 0;
1854
+ while (curr_level < tables.length) {
1855
+ if (curr_level === tables.length - 1 && i !== j) {
1856
+ return i > j;
1857
+ }
1858
+ const weight1 = i < lhs.length ? tables[curr_level][lhs[i].charCodeAt(0)] : 0x1;
1859
+ const weight2 = j < rhs.length ? tables[curr_level][rhs[j].charCodeAt(0)] : 0x1;
1860
+ if (weight1 === 0x1 && weight2 === 0x1) {
1861
+ i = 0;
1862
+ j = 0;
1863
+ ++curr_level;
1864
+ }
1865
+ else if (weight1 === weight2) {
1866
+ ++i;
1867
+ ++j;
1868
+ }
1869
+ else if (weight1 === 0) {
1870
+ ++i;
1871
+ }
1872
+ else if (weight2 === 0) {
1873
+ ++j;
1874
+ }
1875
+ else {
1876
+ return weight1 < weight2;
1877
+ }
1878
+ }
1879
+ return false;
1880
+ }
1881
+
1790
1882
  // Copyright (c) Microsoft Corporation.
1791
1883
  // Licensed under the MIT license.
1792
1884
  /**
@@ -1878,7 +1970,7 @@ class StorageSharedKeyCredentialPolicy extends CredentialPolicy {
1878
1970
  return value.name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE);
1879
1971
  });
1880
1972
  headersArray.sort((a, b) => {
1881
- return a.name.toLowerCase().localeCompare(b.name.toLowerCase());
1973
+ return compareHeader(a.name.toLowerCase(), b.name.toLowerCase());
1882
1974
  });
1883
1975
  // Remove duplicate headers
1884
1976
  headersArray = headersArray.filter((value, index, array) => {
@@ -2143,6 +2235,22 @@ function storageRetryPolicy(options = {}) {
2143
2235
  return true;
2144
2236
  }
2145
2237
  }
2238
+ // [Copy source error code] Feature is pending on service side, skip retry on copy source error for now.
2239
+ // if (response) {
2240
+ // // Retry select Copy Source Error Codes.
2241
+ // if (response?.status >= 400) {
2242
+ // const copySourceError = response.headers.get(HeaderConstants.X_MS_CopySourceErrorCode);
2243
+ // if (copySourceError !== undefined) {
2244
+ // switch (copySourceError)
2245
+ // {
2246
+ // case "InternalError":
2247
+ // case "OperationTimedOut":
2248
+ // case "ServerBusy":
2249
+ // return true;
2250
+ // }
2251
+ // }
2252
+ // }
2253
+ // }
2146
2254
  return false;
2147
2255
  }
2148
2256
  function calculateDelay(isPrimaryRetry, attempt) {
@@ -2287,7 +2395,7 @@ function storageSharedKeyCredentialPolicy(options) {
2287
2395
  }
2288
2396
  }
2289
2397
  headersArray.sort((a, b) => {
2290
- return a.name.toLowerCase().localeCompare(b.name.toLowerCase());
2398
+ return compareHeader(a.name.toLowerCase(), b.name.toLowerCase());
2291
2399
  });
2292
2400
  // Remove duplicate headers
2293
2401
  headersArray = headersArray.filter((value, index, array) => {
@@ -2889,6 +2997,13 @@ const StorageError = {
2889
2997
  name: "String"
2890
2998
  }
2891
2999
  },
3000
+ authenticationErrorDetail: {
3001
+ serializedName: "AuthenticationErrorDetail",
3002
+ xmlName: "AuthenticationErrorDetail",
3003
+ type: {
3004
+ name: "String"
3005
+ }
3006
+ },
2892
3007
  code: {
2893
3008
  serializedName: "Code",
2894
3009
  xmlName: "Code",
@@ -3161,6 +3276,13 @@ const SharePropertiesInternal = {
3161
3276
  name: "Enum",
3162
3277
  allowedValues: ["NoRootSquash", "RootSquash", "AllSquash"]
3163
3278
  }
3279
+ },
3280
+ enableSnapshotVirtualDirectoryAccess: {
3281
+ serializedName: "EnableSnapshotVirtualDirectoryAccess",
3282
+ xmlName: "EnableSnapshotVirtualDirectoryAccess",
3283
+ type: {
3284
+ name: "Boolean"
3285
+ }
3164
3286
  }
3165
3287
  }
3166
3288
  }
@@ -4150,6 +4272,13 @@ const ShareGetPropertiesHeaders = {
4150
4272
  allowedValues: ["NoRootSquash", "RootSquash", "AllSquash"]
4151
4273
  }
4152
4274
  },
4275
+ enableSnapshotVirtualDirectoryAccess: {
4276
+ serializedName: "x-ms-enable-snapshot-virtual-directory-access",
4277
+ xmlName: "x-ms-enable-snapshot-virtual-directory-access",
4278
+ type: {
4279
+ name: "Boolean"
4280
+ }
4281
+ },
4153
4282
  errorCode: {
4154
4283
  serializedName: "x-ms-error-code",
4155
4284
  xmlName: "x-ms-error-code",
@@ -8030,7 +8159,7 @@ const timeoutInSeconds = {
8030
8159
  const version = {
8031
8160
  parameterPath: "version",
8032
8161
  mapper: {
8033
- defaultValue: "2024-05-04",
8162
+ defaultValue: "2024-08-04",
8034
8163
  isConstant: true,
8035
8164
  serializedName: "x-ms-version",
8036
8165
  type: {
@@ -8179,6 +8308,16 @@ const rootSquash = {
8179
8308
  }
8180
8309
  }
8181
8310
  };
8311
+ const enableSnapshotVirtualDirectoryAccess = {
8312
+ parameterPath: ["options", "enableSnapshotVirtualDirectoryAccess"],
8313
+ mapper: {
8314
+ serializedName: "x-ms-enable-snapshot-virtual-directory-access",
8315
+ xmlName: "x-ms-enable-snapshot-virtual-directory-access",
8316
+ type: {
8317
+ name: "Boolean"
8318
+ }
8319
+ }
8320
+ };
8182
8321
  const shareSnapshot = {
8183
8322
  parameterPath: ["options", "shareSnapshot"],
8184
8323
  mapper: {
@@ -9430,7 +9569,8 @@ const createOperationSpec$2 = {
9430
9569
  quota,
9431
9570
  accessTier,
9432
9571
  enabledProtocols,
9433
- rootSquash
9572
+ rootSquash,
9573
+ enableSnapshotVirtualDirectoryAccess
9434
9574
  ],
9435
9575
  isXML: true,
9436
9576
  serializer: xmlSerializer$2
@@ -9741,6 +9881,7 @@ const setPropertiesOperationSpec$1 = {
9741
9881
  quota,
9742
9882
  accessTier,
9743
9883
  rootSquash,
9884
+ enableSnapshotVirtualDirectoryAccess,
9744
9885
  leaseId
9745
9886
  ],
9746
9887
  isXML: true,
@@ -11037,7 +11178,7 @@ let StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.Exte
11037
11178
  const defaults = {
11038
11179
  requestContentType: "application/json; charset=utf-8"
11039
11180
  };
11040
- const packageDetails = `azsdk-js-azure-storage-file-share/12.23.0`;
11181
+ const packageDetails = `azsdk-js-azure-storage-file-share/12.24.0-beta.1`;
11041
11182
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
11042
11183
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
11043
11184
  : `${packageDetails}`;
@@ -11048,7 +11189,7 @@ let StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.Exte
11048
11189
  // Parameter assignments
11049
11190
  this.url = url;
11050
11191
  // Assigning values to Constant parameters
11051
- this.version = options.version || "2024-05-04";
11192
+ this.version = options.version || "2024-08-04";
11052
11193
  this.fileRangeWriteFromUrl = options.fileRangeWriteFromUrl || "update";
11053
11194
  this.service = new ServiceImpl(this);
11054
11195
  this.share = new ShareImpl(this);