@azure/storage-file-share 12.11.1-alpha.20220923.1 → 12.12.0
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 +22 -12
- package/dist/index.js.map +1 -1
- package/dist-esm/src/Clients.js +8 -8
- package/dist-esm/src/Clients.js.map +1 -1
- package/dist-esm/src/generated/src/models/parameters.js +1 -1
- package/dist-esm/src/generated/src/models/parameters.js.map +1 -1
- package/dist-esm/src/generated/src/storageClientContext.js +2 -2
- package/dist-esm/src/generated/src/storageClientContext.js.map +1 -1
- package/dist-esm/src/utils/constants.js +2 -2
- package/dist-esm/src/utils/constants.js.map +1 -1
- package/dist-esm/src/utils/utils.common.js +10 -0
- package/dist-esm/src/utils/utils.common.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
@@ -334,8 +334,8 @@ function ipRangeToString(ipRange) {
|
|
334
334
|
|
335
335
|
// Copyright (c) Microsoft Corporation.
|
336
336
|
// Licensed under the MIT license.
|
337
|
-
const SDK_VERSION = "12.
|
338
|
-
const SERVICE_VERSION = "2021-
|
337
|
+
const SDK_VERSION = "12.12.0";
|
338
|
+
const SERVICE_VERSION = "2021-10-04";
|
339
339
|
const FILE_MAX_SIZE_BYTES = 4 * 1024 * 1024 * 1024 * 1024; // 4TB
|
340
340
|
const FILE_RANGE_MAX_SIZE_BYTES = 4 * 1024 * 1024; // 4MB
|
341
341
|
const DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5;
|
@@ -875,6 +875,16 @@ function setURLQueries(url, queryString) {
|
|
875
875
|
urlParsed.setQuery(queryString);
|
876
876
|
return urlParsed.toString();
|
877
877
|
}
|
878
|
+
/**
|
879
|
+
* Escape the file or directory name but keep path separator ('/').
|
880
|
+
*/
|
881
|
+
function EscapePath(pathName) {
|
882
|
+
const split = pathName.split("/");
|
883
|
+
for (let i = 0; i < split.length; i++) {
|
884
|
+
split[i] = encodeURIComponent(split[i]);
|
885
|
+
}
|
886
|
+
return split.join("/");
|
887
|
+
}
|
878
888
|
|
879
889
|
// Copyright (c) Microsoft Corporation.
|
880
890
|
/**
|
@@ -6676,7 +6686,7 @@ const timeoutInSeconds = {
|
|
6676
6686
|
const version = {
|
6677
6687
|
parameterPath: "version",
|
6678
6688
|
mapper: {
|
6679
|
-
defaultValue: "2021-
|
6689
|
+
defaultValue: "2021-10-04",
|
6680
6690
|
isConstant: true,
|
6681
6691
|
serializedName: "x-ms-version",
|
6682
6692
|
type: {
|
@@ -10419,7 +10429,7 @@ function convertTracingToRequestOptionsBase(options) {
|
|
10419
10429
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
10420
10430
|
*/
|
10421
10431
|
const packageName = "azure-storage-file-share";
|
10422
|
-
const packageVersion = "12.
|
10432
|
+
const packageVersion = "12.12.0";
|
10423
10433
|
class StorageClientContext extends coreHttp__namespace.ServiceClient {
|
10424
10434
|
/**
|
10425
10435
|
* Initializes a new instance of the StorageClientContext class.
|
@@ -10445,7 +10455,7 @@ class StorageClientContext extends coreHttp__namespace.ServiceClient {
|
|
10445
10455
|
// Parameter assignments
|
10446
10456
|
this.url = url;
|
10447
10457
|
// Assigning values to Constant parameters
|
10448
|
-
this.version = options.version || "2021-
|
10458
|
+
this.version = options.version || "2021-10-04";
|
10449
10459
|
this.fileRangeWriteFromUrl = options.fileRangeWriteFromUrl || "update";
|
10450
10460
|
}
|
10451
10461
|
}
|
@@ -11807,7 +11817,7 @@ class ShareClient extends StorageClient {
|
|
11807
11817
|
// Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
|
11808
11818
|
/* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */
|
11809
11819
|
getDirectoryClient(directoryName) {
|
11810
|
-
return new ShareDirectoryClient(appendToURLPath(this.url,
|
11820
|
+
return new ShareDirectoryClient(appendToURLPath(this.url, EscapePath(directoryName)), this.pipeline);
|
11811
11821
|
}
|
11812
11822
|
/**
|
11813
11823
|
* Gets the directory client for the root directory of this share.
|
@@ -12507,7 +12517,7 @@ class ShareDirectoryClient extends StorageClient {
|
|
12507
12517
|
* ```
|
12508
12518
|
*/
|
12509
12519
|
getDirectoryClient(subDirectoryName) {
|
12510
|
-
return new ShareDirectoryClient(appendToURLPath(this.url,
|
12520
|
+
return new ShareDirectoryClient(appendToURLPath(this.url, EscapePath(subDirectoryName)), this.pipeline);
|
12511
12521
|
}
|
12512
12522
|
/**
|
12513
12523
|
* Creates a new subdirectory under this directory.
|
@@ -12652,7 +12662,7 @@ class ShareDirectoryClient extends StorageClient {
|
|
12652
12662
|
// Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
|
12653
12663
|
/* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */
|
12654
12664
|
getFileClient(fileName) {
|
12655
|
-
return new ShareFileClient(appendToURLPath(this.url,
|
12665
|
+
return new ShareFileClient(appendToURLPath(this.url, EscapePath(fileName)), this.pipeline);
|
12656
12666
|
}
|
12657
12667
|
/**
|
12658
12668
|
* Returns true if the specified directory exists; false otherwise.
|
@@ -13318,13 +13328,13 @@ class ShareDirectoryClient extends StorageClient {
|
|
13318
13328
|
const split = destinationPath.split("?");
|
13319
13329
|
let destinationUrl;
|
13320
13330
|
if (split.length === 2) {
|
13321
|
-
const pathOnly =
|
13331
|
+
const pathOnly = EscapePath(split[0]);
|
13322
13332
|
const renameDestination = `/${this.shareName}/${pathOnly}`;
|
13323
13333
|
destinationUrl = setURLPath(this.url, renameDestination);
|
13324
13334
|
destinationUrl = setURLQueries(destinationUrl, split[1]);
|
13325
13335
|
}
|
13326
13336
|
else if (split.length === 1) {
|
13327
|
-
const pathOnly =
|
13337
|
+
const pathOnly = EscapePath(destinationPath);
|
13328
13338
|
const renameDestination = `/${this.shareName}/${pathOnly}`;
|
13329
13339
|
destinationUrl = setURLPath(this.url, renameDestination);
|
13330
13340
|
}
|
@@ -14726,13 +14736,13 @@ class ShareFileClient extends StorageClient {
|
|
14726
14736
|
const split = destinationPath.split("?");
|
14727
14737
|
let destinationUrl;
|
14728
14738
|
if (split.length === 2) {
|
14729
|
-
const pathOnly =
|
14739
|
+
const pathOnly = EscapePath(split[0]);
|
14730
14740
|
const renameDestination = `/${this.shareName}/${pathOnly}`;
|
14731
14741
|
destinationUrl = setURLPath(this.url, renameDestination);
|
14732
14742
|
destinationUrl = setURLQueries(destinationUrl, split[1]);
|
14733
14743
|
}
|
14734
14744
|
else if (split.length === 1) {
|
14735
|
-
const pathOnly =
|
14745
|
+
const pathOnly = EscapePath(destinationPath);
|
14736
14746
|
const renameDestination = `/${this.shareName}/${pathOnly}`;
|
14737
14747
|
destinationUrl = setURLPath(this.url, renameDestination);
|
14738
14748
|
}
|