@azure/storage-blob 12.11.1-alpha.20220722.1 → 12.12.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.
- package/dist/index.js +39 -7
- package/dist/index.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/models/parameters.js +1 -1
- package/dist-esm/storage-blob/src/generated/src/models/parameters.js.map +1 -1
- package/dist-esm/storage-blob/src/generated/src/storageClientContext.js +2 -2
- package/dist-esm/storage-blob/src/generated/src/storageClientContext.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/constants.js +27 -2
- package/dist-esm/storage-blob/src/utils/constants.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/utils.common.js +3 -2
- package/dist-esm/storage-blob/src/utils/utils.common.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/utils.node.js +8 -1
- package/dist-esm/storage-blob/src/utils/utils.node.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
@@ -8497,7 +8497,7 @@ const timeoutInSeconds = {
|
|
8497
8497
|
const version = {
|
8498
8498
|
parameterPath: "version",
|
8499
8499
|
mapper: {
|
8500
|
-
defaultValue: "2021-
|
8500
|
+
defaultValue: "2021-10-04",
|
8501
8501
|
isConstant: true,
|
8502
8502
|
serializedName: "x-ms-version",
|
8503
8503
|
type: {
|
@@ -13325,14 +13325,15 @@ const logger = logger$1.createClientLogger("storage-blob");
|
|
13325
13325
|
|
13326
13326
|
// Copyright (c) Microsoft Corporation.
|
13327
13327
|
// Licensed under the MIT license.
|
13328
|
-
const SDK_VERSION = "12.
|
13329
|
-
const SERVICE_VERSION = "2021-
|
13328
|
+
const SDK_VERSION = "12.12.0-beta.1";
|
13329
|
+
const SERVICE_VERSION = "2021-10-04";
|
13330
13330
|
const BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB
|
13331
13331
|
const BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB
|
13332
13332
|
const BLOCK_BLOB_MAX_BLOCKS = 50000;
|
13333
13333
|
const DEFAULT_BLOCK_BUFFER_SIZE_BYTES = 8 * 1024 * 1024; // 8MB
|
13334
13334
|
const DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; // 4MB
|
13335
13335
|
const DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5;
|
13336
|
+
const REQUEST_TIMEOUT = 100 * 1000; // In ms
|
13336
13337
|
/**
|
13337
13338
|
* The OAuth scope to use with Azure Storage.
|
13338
13339
|
*/
|
@@ -13520,6 +13521,30 @@ const StorageBlobLoggingAllowedQueryParameters = [
|
|
13520
13521
|
];
|
13521
13522
|
const BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption";
|
13522
13523
|
const BlobDoesNotUseCustomerSpecifiedEncryption = "BlobDoesNotUseCustomerSpecifiedEncryption";
|
13524
|
+
/// List of ports used for path style addressing.
|
13525
|
+
/// Path style addressing means that storage account is put in URI's Path segment in instead of in host.
|
13526
|
+
const PathStylePorts = [
|
13527
|
+
"10000",
|
13528
|
+
"10001",
|
13529
|
+
"10002",
|
13530
|
+
"10003",
|
13531
|
+
"10004",
|
13532
|
+
"10100",
|
13533
|
+
"10101",
|
13534
|
+
"10102",
|
13535
|
+
"10103",
|
13536
|
+
"10104",
|
13537
|
+
"11000",
|
13538
|
+
"11001",
|
13539
|
+
"11002",
|
13540
|
+
"11003",
|
13541
|
+
"11004",
|
13542
|
+
"11100",
|
13543
|
+
"11101",
|
13544
|
+
"11102",
|
13545
|
+
"11103",
|
13546
|
+
"11104",
|
13547
|
+
];
|
13523
13548
|
|
13524
13549
|
// Copyright (c) Microsoft Corporation.
|
13525
13550
|
/**
|
@@ -13961,7 +13986,8 @@ function isIpEndpointStyle(parsedUrl) {
|
|
13961
13986
|
// Case 2: localhost(:port), use broad regex to match port part.
|
13962
13987
|
// Case 3: Ipv4, use broad regex which just check if host contains Ipv4.
|
13963
13988
|
// For valid host please refer to https://man7.org/linux/man-pages/man7/hostname.7.html.
|
13964
|
-
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)
|
13989
|
+
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) ||
|
13990
|
+
(parsedUrl.getPort() !== undefined && PathStylePorts.includes(parsedUrl.getPort())));
|
13965
13991
|
}
|
13966
13992
|
/**
|
13967
13993
|
* Convert Tags to encoded string.
|
@@ -15437,7 +15463,7 @@ class StorageSharedKeyCredential extends Credential {
|
|
15437
15463
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
15438
15464
|
*/
|
15439
15465
|
const packageName = "azure-storage-blob";
|
15440
|
-
const packageVersion = "12.
|
15466
|
+
const packageVersion = "12.12.0-beta.1";
|
15441
15467
|
class StorageClientContext extends coreHttp__namespace.ServiceClient {
|
15442
15468
|
/**
|
15443
15469
|
* Initializes a new instance of the StorageClientContext class.
|
@@ -15463,7 +15489,7 @@ class StorageClientContext extends coreHttp__namespace.ServiceClient {
|
|
15463
15489
|
// Parameter assignments
|
15464
15490
|
this.url = url;
|
15465
15491
|
// Assigning values to Constant parameters
|
15466
|
-
this.version = options.version || "2021-
|
15492
|
+
this.version = options.version || "2021-10-04";
|
15467
15493
|
}
|
15468
15494
|
}
|
15469
15495
|
|
@@ -19351,8 +19377,10 @@ async function streamToBuffer(stream, buffer, offset, end, encoding) {
|
|
19351
19377
|
let pos = 0; // Position in stream
|
19352
19378
|
const count = end - offset; // Total amount of data needed in stream
|
19353
19379
|
return new Promise((resolve, reject) => {
|
19380
|
+
const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), REQUEST_TIMEOUT);
|
19354
19381
|
stream.on("readable", () => {
|
19355
19382
|
if (pos >= count) {
|
19383
|
+
clearTimeout(timeout);
|
19356
19384
|
resolve();
|
19357
19385
|
return;
|
19358
19386
|
}
|
@@ -19369,12 +19397,16 @@ async function streamToBuffer(stream, buffer, offset, end, encoding) {
|
|
19369
19397
|
pos += chunkLength;
|
19370
19398
|
});
|
19371
19399
|
stream.on("end", () => {
|
19400
|
+
clearTimeout(timeout);
|
19372
19401
|
if (pos < count) {
|
19373
19402
|
reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`));
|
19374
19403
|
}
|
19375
19404
|
resolve();
|
19376
19405
|
});
|
19377
|
-
stream.on("error",
|
19406
|
+
stream.on("error", (msg) => {
|
19407
|
+
clearTimeout(timeout);
|
19408
|
+
reject(msg);
|
19409
|
+
});
|
19378
19410
|
});
|
19379
19411
|
}
|
19380
19412
|
/**
|