@azure/storage-queue 12.22.0 → 12.23.0-alpha.20240612.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/index.js +118 -7
  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-queue/src/generated/src/models/index.js.map +1 -1
  34. package/dist-esm/storage-queue/src/generated/src/models/mappers.js +7 -0
  35. package/dist-esm/storage-queue/src/generated/src/models/mappers.js.map +1 -1
  36. package/dist-esm/storage-queue/src/generated/src/models/parameters.js +1 -1
  37. package/dist-esm/storage-queue/src/generated/src/models/parameters.js.map +1 -1
  38. package/dist-esm/storage-queue/src/generated/src/storageClient.js +2 -2
  39. package/dist-esm/storage-queue/src/generated/src/storageClient.js.map +1 -1
  40. package/dist-esm/storage-queue/src/utils/constants.js +2 -2
  41. package/dist-esm/storage-queue/src/utils/constants.js.map +1 -1
  42. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -329,8 +329,8 @@ function ipRangeToString(ipRange) {
329
329
 
330
330
  // Copyright (c) Microsoft Corporation.
331
331
  // Licensed under the MIT license.
332
- const SDK_VERSION = "12.22.0";
333
- const SERVICE_VERSION = "2024-05-04";
332
+ const SDK_VERSION = "12.23.0-beta.1";
333
+ const SERVICE_VERSION = "2024-08-04";
334
334
  /**
335
335
  * The OAuth scope to use with Azure Storage.
336
336
  */
@@ -964,6 +964,7 @@ const HeaderConstants = {
964
964
  X_MS_DATE: "x-ms-date",
965
965
  X_MS_ERROR_CODE: "x-ms-error-code",
966
966
  X_MS_VERSION: "x-ms-version",
967
+ X_MS_CopySourceErrorCode: "x-ms-copy-source-error-code",
967
968
  };
968
969
 
969
970
  // Copyright (c) Microsoft Corporation.
@@ -1081,6 +1082,79 @@ async function delay(timeInMs, aborter, abortError) {
1081
1082
  });
1082
1083
  }
1083
1084
 
1085
+ // Copyright (c) Microsoft Corporation.
1086
+ // Licensed under the MIT license.
1087
+ /*
1088
+ * We need to imitate .Net culture-aware sorting, which is used in storage service.
1089
+ * Below tables contain sort-keys for en-US culture.
1090
+ */
1091
+ const table_lv0 = new Uint32Array([
1092
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1093
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x71c, 0x0, 0x71f, 0x721,
1094
+ 0x723, 0x725, 0x0, 0x0, 0x0, 0x72d, 0x803, 0x0, 0x0, 0x733, 0x0, 0xd03, 0xd1a, 0xd1c, 0xd1e,
1095
+ 0xd20, 0xd22, 0xd24, 0xd26, 0xd28, 0xd2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe02, 0xe09, 0xe0a,
1096
+ 0xe1a, 0xe21, 0xe23, 0xe25, 0xe2c, 0xe32, 0xe35, 0xe36, 0xe48, 0xe51, 0xe70, 0xe7c, 0xe7e, 0xe89,
1097
+ 0xe8a, 0xe91, 0xe99, 0xe9f, 0xea2, 0xea4, 0xea6, 0xea7, 0xea9, 0x0, 0x0, 0x0, 0x743, 0x744, 0x748,
1098
+ 0xe02, 0xe09, 0xe0a, 0xe1a, 0xe21, 0xe23, 0xe25, 0xe2c, 0xe32, 0xe35, 0xe36, 0xe48, 0xe51, 0xe70,
1099
+ 0xe7c, 0xe7e, 0xe89, 0xe8a, 0xe91, 0xe99, 0xe9f, 0xea2, 0xea4, 0xea6, 0xea7, 0xea9, 0x0, 0x74c,
1100
+ 0x0, 0x750, 0x0,
1101
+ ]);
1102
+ const table_lv2 = new Uint32Array([
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0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1116
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1117
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1118
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1119
+ ]);
1120
+ function compareHeader(lhs, rhs) {
1121
+ if (isLessThan(lhs, rhs))
1122
+ return -1;
1123
+ return 1;
1124
+ }
1125
+ function isLessThan(lhs, rhs) {
1126
+ const tables = [table_lv0, table_lv2, table_lv4];
1127
+ let curr_level = 0;
1128
+ let i = 0;
1129
+ let j = 0;
1130
+ while (curr_level < tables.length) {
1131
+ if (curr_level === tables.length - 1 && i !== j) {
1132
+ return i > j;
1133
+ }
1134
+ const weight1 = i < lhs.length ? tables[curr_level][lhs[i].charCodeAt(0)] : 0x1;
1135
+ const weight2 = j < rhs.length ? tables[curr_level][rhs[j].charCodeAt(0)] : 0x1;
1136
+ if (weight1 === 0x1 && weight2 === 0x1) {
1137
+ i = 0;
1138
+ j = 0;
1139
+ ++curr_level;
1140
+ }
1141
+ else if (weight1 === weight2) {
1142
+ ++i;
1143
+ ++j;
1144
+ }
1145
+ else if (weight1 === 0) {
1146
+ ++i;
1147
+ }
1148
+ else if (weight2 === 0) {
1149
+ ++j;
1150
+ }
1151
+ else {
1152
+ return weight1 < weight2;
1153
+ }
1154
+ }
1155
+ return false;
1156
+ }
1157
+
1084
1158
  // Copyright (c) Microsoft Corporation.
1085
1159
  // Licensed under the MIT license.
1086
1160
  /**
@@ -1172,7 +1246,7 @@ class StorageSharedKeyCredentialPolicy extends CredentialPolicy {
1172
1246
  return value.name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE);
1173
1247
  });
1174
1248
  headersArray.sort((a, b) => {
1175
- return a.name.toLowerCase().localeCompare(b.name.toLowerCase());
1249
+ return compareHeader(a.name.toLowerCase(), b.name.toLowerCase());
1176
1250
  });
1177
1251
  // Remove duplicate headers
1178
1252
  headersArray = headersArray.filter((value, index, array) => {
@@ -1433,6 +1507,21 @@ class StorageRetryPolicy extends BaseRequestPolicy {
1433
1507
  return true;
1434
1508
  }
1435
1509
  }
1510
+ // [Copy source error code] Feature is pending on service side, skip retry on copy source error for now.
1511
+ // if (response) {
1512
+ // // Retry select Copy Source Error Codes.
1513
+ // if (response?.status >= 400) {
1514
+ // const copySourceError = response.headers.get(HeaderConstants.X_MS_CopySourceErrorCode);
1515
+ // if (copySourceError !== undefined) {
1516
+ // switch (copySourceError) {
1517
+ // case "InternalError":
1518
+ // case "OperationTimedOut":
1519
+ // case "ServerBusy":
1520
+ // return true;
1521
+ // }
1522
+ // }
1523
+ // }
1524
+ // }
1436
1525
  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`))) {
1437
1526
  logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry.");
1438
1527
  return true;
@@ -1616,6 +1705,21 @@ function storageRetryPolicy(options = {}) {
1616
1705
  return true;
1617
1706
  }
1618
1707
  }
1708
+ // [Copy source error code] Feature is pending on service side, skip retry on copy source error for now.
1709
+ // if (response) {
1710
+ // // Retry select Copy Source Error Codes.
1711
+ // if (response?.status >= 400) {
1712
+ // const copySourceError = response.headers.get(HeaderConstants.X_MS_CopySourceErrorCode);
1713
+ // if (copySourceError !== undefined) {
1714
+ // switch (copySourceError) {
1715
+ // case "InternalError":
1716
+ // case "OperationTimedOut":
1717
+ // case "ServerBusy":
1718
+ // return true;
1719
+ // }
1720
+ // }
1721
+ // }
1722
+ // }
1619
1723
  return false;
1620
1724
  }
1621
1725
  function calculateDelay(isPrimaryRetry, attempt) {
@@ -1767,7 +1871,7 @@ function storageSharedKeyCredentialPolicy(options) {
1767
1871
  }
1768
1872
  }
1769
1873
  headersArray.sort((a, b) => {
1770
- return a.name.toLowerCase().localeCompare(b.name.toLowerCase());
1874
+ return compareHeader(a.name.toLowerCase(), b.name.toLowerCase());
1771
1875
  });
1772
1876
  // Remove duplicate headers
1773
1877
  headersArray = headersArray.filter((value, index, array) => {
@@ -2376,6 +2480,13 @@ const StorageError = {
2376
2480
  type: {
2377
2481
  name: "String"
2378
2482
  }
2483
+ },
2484
+ authenticationErrorDetail: {
2485
+ serializedName: "AuthenticationErrorDetail",
2486
+ xmlName: "AuthenticationErrorDetail",
2487
+ type: {
2488
+ name: "String"
2489
+ }
2379
2490
  }
2380
2491
  }
2381
2492
  }
@@ -3980,7 +4091,7 @@ const timeoutInSeconds = {
3980
4091
  const version = {
3981
4092
  parameterPath: "version",
3982
4093
  mapper: {
3983
- defaultValue: "2024-05-04",
4094
+ defaultValue: "2024-08-04",
3984
4095
  isConstant: true,
3985
4096
  serializedName: "x-ms-version",
3986
4097
  type: {
@@ -4921,7 +5032,7 @@ let StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.Exte
4921
5032
  const defaults = {
4922
5033
  requestContentType: "application/json; charset=utf-8"
4923
5034
  };
4924
- const packageDetails = `azsdk-js-azure-storage-queue/12.22.0`;
5035
+ const packageDetails = `azsdk-js-azure-storage-queue/12.23.0-beta.1`;
4925
5036
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
4926
5037
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
4927
5038
  : `${packageDetails}`;
@@ -4932,7 +5043,7 @@ let StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.Exte
4932
5043
  // Parameter assignments
4933
5044
  this.url = url;
4934
5045
  // Assigning values to Constant parameters
4935
- this.version = options.version || "2024-05-04";
5046
+ this.version = options.version || "2024-08-04";
4936
5047
  this.service = new ServiceImpl(this);
4937
5048
  this.queue = new QueueImpl(this);
4938
5049
  this.messages = new MessagesImpl(this);