@azure/storage-blob 12.20.0-alpha.20230622.3 → 12.20.0-alpha.20230801.3

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.
package/dist/index.js CHANGED
@@ -93,7 +93,7 @@ class BaseRequestPolicy {
93
93
  // Copyright (c) Microsoft Corporation.
94
94
  // Licensed under the MIT license.
95
95
  const SDK_VERSION = "12.20.0";
96
- const SERVICE_VERSION = "2021-10-04";
96
+ const SERVICE_VERSION = "2023-01-03";
97
97
  const BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB
98
98
  const BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB
99
99
  const BLOCK_BLOB_MAX_BLOCKS = 50000;
@@ -457,7 +457,11 @@ function extractConnectionStringParts(connectionString) {
457
457
  else {
458
458
  // SAS connection string
459
459
  let accountSas = getValueInConnString(connectionString, "SharedAccessSignature");
460
- const accountName = getAccountNameFromUrl(blobEndpoint);
460
+ let accountName = getValueInConnString(connectionString, "AccountName");
461
+ // if accountName is empty, try to read it from BlobEndpoint
462
+ if (!accountName) {
463
+ accountName = getAccountNameFromUrl(blobEndpoint);
464
+ }
461
465
  if (!blobEndpoint) {
462
466
  throw new Error("Invalid BlobEndpoint in the provided SAS Connection String");
463
467
  }
@@ -778,10 +782,10 @@ function getAccountNameFromUrl(url) {
778
782
  function isIpEndpointStyle(parsedUrl) {
779
783
  const host = parsedUrl.host;
780
784
  // Case 1: Ipv6, use a broad regex to find out candidates whose host contains two ':'.
781
- // Case 2: localhost(:port), use broad regex to match port part.
785
+ // Case 2: localhost(:port) or host.docker.internal, use broad regex to match port part.
782
786
  // Case 3: Ipv4, use broad regex which just check if host contains Ipv4.
783
787
  // For valid host please refer to https://man7.org/linux/man-pages/man7/hostname.7.html.
784
- return (/^.*:.*:.*$|^localhost(:[0-9]+)?$|^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])){3}(:[0-9]+)?$/.test(host) ||
788
+ return (/^.*:.*:.*$|^(localhost|host.docker.internal)(:[0-9]+)?$|^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])){3}(:[0-9]+)?$/.test(host) ||
785
789
  (Boolean(parsedUrl.port) && PathStylePorts.includes(parsedUrl.port)));
786
790
  }
787
791
  /**
@@ -947,9 +951,7 @@ function ConvertInternalResponseOfListBlobHierarchy(internalResponse) {
947
951
  var _a;
948
952
  return Object.assign(Object.assign({}, internalResponse), { segment: {
949
953
  blobPrefixes: (_a = internalResponse.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => {
950
- const blobPrefix = {
951
- name: BlobNameToString(blobPrefixInternal.name),
952
- };
954
+ const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) });
953
955
  return blobPrefix;
954
956
  }),
955
957
  blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => {
@@ -10583,7 +10585,7 @@ const timeoutInSeconds = {
10583
10585
  const version = {
10584
10586
  parameterPath: "version",
10585
10587
  mapper: {
10586
- defaultValue: "2021-12-02",
10588
+ defaultValue: "2023-01-03",
10587
10589
  isConstant: true,
10588
10590
  serializedName: "x-ms-version",
10589
10591
  type: {
@@ -15187,7 +15189,7 @@ class StorageClient$1 extends coreHttpCompat__namespace.ExtendedServiceClient {
15187
15189
  // Parameter assignments
15188
15190
  this.url = url;
15189
15191
  // Assigning values to Constant parameters
15190
- this.version = options.version || "2021-12-02";
15192
+ this.version = options.version || "2023-01-03";
15191
15193
  this.service = new ServiceImpl(this);
15192
15194
  this.container = new ContainerImpl(this);
15193
15195
  this.blob = new BlobImpl(this);
@@ -19201,6 +19203,9 @@ class BlobClient extends StorageClient {
19201
19203
  // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
19202
19204
  // The second parameter is undefined. Use anonymous credential.
19203
19205
  url = urlOrConnectionString;
19206
+ if (blobNameOrOptions && typeof blobNameOrOptions !== "string") {
19207
+ options = blobNameOrOptions;
19208
+ }
19204
19209
  pipeline = newPipeline(new AnonymousCredential(), options);
19205
19210
  }
19206
19211
  else if (credentialOrPipelineOrContainerName &&
@@ -20374,6 +20379,9 @@ class BlockBlobClient extends BlobClient {
20374
20379
  // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
20375
20380
  // The second parameter is undefined. Use anonymous credential.
20376
20381
  url = urlOrConnectionString;
20382
+ if (blobNameOrOptions && typeof blobNameOrOptions !== "string") {
20383
+ options = blobNameOrOptions;
20384
+ }
20377
20385
  pipeline = newPipeline(new AnonymousCredential(), options);
20378
20386
  }
20379
20387
  else if (credentialOrPipelineOrContainerName &&
@@ -22731,9 +22739,7 @@ class ContainerClient extends StorageClient {
22731
22739
  const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) });
22732
22740
  return blobItem;
22733
22741
  }), blobPrefixes: (_a = response.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => {
22734
- const blobPrefix = {
22735
- name: BlobNameToString(blobPrefixInternal.name),
22736
- };
22742
+ const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) });
22737
22743
  return blobPrefix;
22738
22744
  }) }) });
22739
22745
  return wrappedResponse;