@azure/storage-file-share 12.20.0-alpha.20230607.3 → 12.20.0-alpha.20230619.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 +92 -21
- package/dist/index.js.map +1 -1
- package/dist-esm/storage-file-share/src/Clients.js +8 -4
- package/dist-esm/storage-file-share/src/Clients.js.map +1 -1
- package/dist-esm/storage-file-share/src/StorageClient.js +1 -13
- package/dist-esm/storage-file-share/src/StorageClient.js.map +1 -1
- package/dist-esm/storage-file-share/src/generated/src/models/index.js.map +1 -1
- package/dist-esm/storage-file-share/src/generated/src/models/mappers.js +41 -8
- package/dist-esm/storage-file-share/src/generated/src/models/mappers.js.map +1 -1
- package/dist-esm/storage-file-share/src/generated/src/models/parameters.js +1 -1
- package/dist-esm/storage-file-share/src/generated/src/models/parameters.js.map +1 -1
- package/dist-esm/storage-file-share/src/generated/src/storageClient.js +1 -1
- package/dist-esm/storage-file-share/src/generated/src/storageClient.js.map +1 -1
- package/dist-esm/storage-file-share/src/generatedModels.js.map +1 -1
- package/dist-esm/storage-file-share/src/utils/constants.js +1 -1
- package/dist-esm/storage-file-share/src/utils/constants.js.map +1 -1
- package/dist-esm/storage-file-share/src/utils/utils.common.js +39 -5
- package/dist-esm/storage-file-share/src/utils/utils.common.js.map +1 -1
- package/package.json +8 -9
- package/types/3.1/storage-file-share.d.ts +68 -3
- package/types/latest/storage-file-share.d.ts +75 -3
package/dist/index.js
CHANGED
@@ -340,7 +340,7 @@ function ipRangeToString(ipRange) {
|
|
340
340
|
// Copyright (c) Microsoft Corporation.
|
341
341
|
// Licensed under the MIT license.
|
342
342
|
const SDK_VERSION$1 = "12.20.0";
|
343
|
-
const SERVICE_VERSION = "2021-
|
343
|
+
const SERVICE_VERSION = "2021-12-02";
|
344
344
|
const FILE_MAX_SIZE_BYTES = 4 * 1024 * 1024 * 1024 * 1024; // 4TB
|
345
345
|
const FILE_RANGE_MAX_SIZE_BYTES = 4 * 1024 * 1024; // 4MB
|
346
346
|
const DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5;
|
@@ -502,7 +502,7 @@ function extractConnectionStringParts(connectionString) {
|
|
502
502
|
}
|
503
503
|
else {
|
504
504
|
// SAS connection string
|
505
|
-
|
505
|
+
const accountSas = getValueInConnString(connectionString, "SharedAccessSignature");
|
506
506
|
const accountName = getAccountNameFromUrl(fileEndpoint);
|
507
507
|
if (!fileEndpoint) {
|
508
508
|
throw new Error("Invalid FileEndpoint in the provided SAS Connection String");
|
@@ -510,10 +510,6 @@ function extractConnectionStringParts(connectionString) {
|
|
510
510
|
else if (!accountSas) {
|
511
511
|
throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String");
|
512
512
|
}
|
513
|
-
// remove test SAS
|
514
|
-
if (accountSas === "fakeSasToken") {
|
515
|
-
accountSas = "";
|
516
|
-
}
|
517
513
|
return { kind: "SASConnString", url: fileEndpoint, accountName, accountSas };
|
518
514
|
}
|
519
515
|
}
|
@@ -750,6 +746,44 @@ function assertResponse(response) {
|
|
750
746
|
}
|
751
747
|
throw new TypeError(`Unexpected response object ${response}`);
|
752
748
|
}
|
749
|
+
function StringEncodedToString(name) {
|
750
|
+
if (name.encoded) {
|
751
|
+
return decodeURIComponent(name.content);
|
752
|
+
}
|
753
|
+
else {
|
754
|
+
return name.content;
|
755
|
+
}
|
756
|
+
}
|
757
|
+
function ConvertInternalResponseOfListFiles(internalResponse) {
|
758
|
+
const wrappedResponse = Object.assign(Object.assign({}, internalResponse), { prefix: undefined, directoryPath: StringEncodedToString({
|
759
|
+
encoded: internalResponse.encoded,
|
760
|
+
content: internalResponse.directoryPath,
|
761
|
+
}), segment: {
|
762
|
+
fileItems: internalResponse.segment.fileItems.map((fileItemInternal) => {
|
763
|
+
const fileItem = Object.assign(Object.assign({}, fileItemInternal), { name: StringEncodedToString(fileItemInternal.name) });
|
764
|
+
return fileItem;
|
765
|
+
}),
|
766
|
+
directoryItems: internalResponse.segment.directoryItems.map((directoryItemInternal) => {
|
767
|
+
const directoryItem = Object.assign(Object.assign({}, directoryItemInternal), { name: StringEncodedToString(directoryItemInternal.name) });
|
768
|
+
return directoryItem;
|
769
|
+
}),
|
770
|
+
} });
|
771
|
+
delete wrappedResponse.encoded;
|
772
|
+
const listResponse = wrappedResponse;
|
773
|
+
if (internalResponse.prefix) {
|
774
|
+
listResponse.prefix = StringEncodedToString(internalResponse.prefix);
|
775
|
+
}
|
776
|
+
return listResponse;
|
777
|
+
}
|
778
|
+
function ConvertInternalResponseOfListHandles(internalResponse) {
|
779
|
+
const wrappedResponse = Object.assign(Object.assign({}, internalResponse), { handleList: internalResponse.handleList
|
780
|
+
? internalResponse.handleList.map((handleItemInternal) => {
|
781
|
+
const handleItem = Object.assign(Object.assign({}, handleItemInternal), { path: StringEncodedToString(handleItemInternal.path) });
|
782
|
+
return handleItem;
|
783
|
+
})
|
784
|
+
: undefined });
|
785
|
+
return wrappedResponse;
|
786
|
+
}
|
753
787
|
|
754
788
|
// Copyright (c) Microsoft Corporation.
|
755
789
|
/**
|
@@ -3300,6 +3334,14 @@ const ListFilesAndDirectoriesSegmentResponse = {
|
|
3300
3334
|
name: "String"
|
3301
3335
|
}
|
3302
3336
|
},
|
3337
|
+
encoded: {
|
3338
|
+
serializedName: "Encoded",
|
3339
|
+
xmlName: "Encoded",
|
3340
|
+
xmlIsAttribute: true,
|
3341
|
+
type: {
|
3342
|
+
name: "Boolean"
|
3343
|
+
}
|
3344
|
+
},
|
3303
3345
|
directoryPath: {
|
3304
3346
|
serializedName: "DirectoryPath",
|
3305
3347
|
required: true,
|
@@ -3311,10 +3353,10 @@ const ListFilesAndDirectoriesSegmentResponse = {
|
|
3311
3353
|
},
|
3312
3354
|
prefix: {
|
3313
3355
|
serializedName: "Prefix",
|
3314
|
-
required: true,
|
3315
3356
|
xmlName: "Prefix",
|
3316
3357
|
type: {
|
3317
|
-
name: "
|
3358
|
+
name: "Composite",
|
3359
|
+
className: "StringEncoded"
|
3318
3360
|
}
|
3319
3361
|
},
|
3320
3362
|
marker: {
|
@@ -3357,6 +3399,31 @@ const ListFilesAndDirectoriesSegmentResponse = {
|
|
3357
3399
|
}
|
3358
3400
|
}
|
3359
3401
|
};
|
3402
|
+
const StringEncoded = {
|
3403
|
+
serializedName: "StringEncoded",
|
3404
|
+
type: {
|
3405
|
+
name: "Composite",
|
3406
|
+
className: "StringEncoded",
|
3407
|
+
modelProperties: {
|
3408
|
+
encoded: {
|
3409
|
+
serializedName: "Encoded",
|
3410
|
+
xmlName: "Encoded",
|
3411
|
+
xmlIsAttribute: true,
|
3412
|
+
type: {
|
3413
|
+
name: "Boolean"
|
3414
|
+
}
|
3415
|
+
},
|
3416
|
+
content: {
|
3417
|
+
serializedName: "content",
|
3418
|
+
xmlName: "content",
|
3419
|
+
xmlIsMsText: true,
|
3420
|
+
type: {
|
3421
|
+
name: "String"
|
3422
|
+
}
|
3423
|
+
}
|
3424
|
+
}
|
3425
|
+
}
|
3426
|
+
};
|
3360
3427
|
const FilesAndDirectoriesListSegment = {
|
3361
3428
|
serializedName: "FilesAndDirectoriesListSegment",
|
3362
3429
|
xmlName: "Entries",
|
@@ -3406,10 +3473,10 @@ const DirectoryItem = {
|
|
3406
3473
|
modelProperties: {
|
3407
3474
|
name: {
|
3408
3475
|
serializedName: "Name",
|
3409
|
-
required: true,
|
3410
3476
|
xmlName: "Name",
|
3411
3477
|
type: {
|
3412
|
-
name: "
|
3478
|
+
name: "Composite",
|
3479
|
+
className: "StringEncoded"
|
3413
3480
|
}
|
3414
3481
|
},
|
3415
3482
|
fileId: {
|
@@ -3512,10 +3579,10 @@ const FileItem = {
|
|
3512
3579
|
modelProperties: {
|
3513
3580
|
name: {
|
3514
3581
|
serializedName: "Name",
|
3515
|
-
required: true,
|
3516
3582
|
xmlName: "Name",
|
3517
3583
|
type: {
|
3518
|
-
name: "
|
3584
|
+
name: "Composite",
|
3585
|
+
className: "StringEncoded"
|
3519
3586
|
}
|
3520
3587
|
},
|
3521
3588
|
fileId: {
|
@@ -3600,10 +3667,10 @@ const HandleItem = {
|
|
3600
3667
|
},
|
3601
3668
|
path: {
|
3602
3669
|
serializedName: "Path",
|
3603
|
-
required: true,
|
3604
3670
|
xmlName: "Path",
|
3605
3671
|
type: {
|
3606
|
-
name: "
|
3672
|
+
name: "Composite",
|
3673
|
+
className: "StringEncoded"
|
3607
3674
|
}
|
3608
3675
|
},
|
3609
3676
|
fileId: {
|
@@ -7798,6 +7865,7 @@ var Mappers = /*#__PURE__*/Object.freeze({
|
|
7798
7865
|
AccessPolicy: AccessPolicy,
|
7799
7866
|
ShareStats: ShareStats,
|
7800
7867
|
ListFilesAndDirectoriesSegmentResponse: ListFilesAndDirectoriesSegmentResponse,
|
7868
|
+
StringEncoded: StringEncoded,
|
7801
7869
|
FilesAndDirectoriesListSegment: FilesAndDirectoriesListSegment,
|
7802
7870
|
DirectoryItem: DirectoryItem,
|
7803
7871
|
FileProperty: FileProperty,
|
@@ -7986,7 +8054,7 @@ const timeoutInSeconds = {
|
|
7986
8054
|
const version = {
|
7987
8055
|
parameterPath: "version",
|
7988
8056
|
mapper: {
|
7989
|
-
defaultValue: "2021-
|
8057
|
+
defaultValue: "2021-12-02",
|
7990
8058
|
isConstant: true,
|
7991
8059
|
serializedName: "x-ms-version",
|
7992
8060
|
type: {
|
@@ -10894,7 +10962,7 @@ class StorageClient$1 extends coreHttpCompat__namespace.ExtendedServiceClient {
|
|
10894
10962
|
// Parameter assignments
|
10895
10963
|
this.url = url;
|
10896
10964
|
// Assigning values to Constant parameters
|
10897
|
-
this.version = options.version || "2021-
|
10965
|
+
this.version = options.version || "2021-12-02";
|
10898
10966
|
this.fileRangeWriteFromUrl = options.fileRangeWriteFromUrl || "update";
|
10899
10967
|
this.service = new ServiceImpl(this);
|
10900
10968
|
this.share = new ShareImpl(this);
|
@@ -10934,8 +11002,7 @@ class StorageClient {
|
|
10934
11002
|
this.url = escapeURLPath(url);
|
10935
11003
|
this.accountName = getAccountNameFromUrl(url);
|
10936
11004
|
this.pipeline = pipeline;
|
10937
|
-
|
10938
|
-
this.storageClientContext = new StorageContextClient(this.url, coreOptions);
|
11005
|
+
this.storageClientContext = new StorageContextClient(this.url, getCoreClientOptions(pipeline));
|
10939
11006
|
// Remove the default content-type in generated code of StorageClientContext
|
10940
11007
|
const storageClientContext = this.storageClientContext;
|
10941
11008
|
if (storageClientContext.requestContentType) {
|
@@ -13143,7 +13210,9 @@ class ShareDirectoryClient extends StorageClient {
|
|
13143
13210
|
options.prefix = undefined;
|
13144
13211
|
}
|
13145
13212
|
return tracingClient.withSpan("ShareDirectoryClient-listFilesAndDirectoriesSegment", options, async (updatedOptions) => {
|
13146
|
-
|
13213
|
+
const rawResponse = assertResponse(await this.context.listFilesAndDirectoriesSegment(Object.assign(Object.assign({}, updatedOptions), { marker })));
|
13214
|
+
const wrappedResponse = Object.assign(Object.assign({}, ConvertInternalResponseOfListFiles(rawResponse)), { _response: Object.assign(Object.assign({}, rawResponse._response), { parsedBody: ConvertInternalResponseOfListFiles(rawResponse._response.parsedBody) }) });
|
13215
|
+
return wrappedResponse;
|
13147
13216
|
});
|
13148
13217
|
}
|
13149
13218
|
/**
|
@@ -13323,7 +13392,8 @@ class ShareDirectoryClient extends StorageClient {
|
|
13323
13392
|
if (response.handleList === "") {
|
13324
13393
|
response.handleList = undefined;
|
13325
13394
|
}
|
13326
|
-
|
13395
|
+
const wrappedResponse = Object.assign(Object.assign({}, ConvertInternalResponseOfListHandles(response)), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListHandles(response._response.parsedBody) }) });
|
13396
|
+
return wrappedResponse;
|
13327
13397
|
});
|
13328
13398
|
}
|
13329
13399
|
/**
|
@@ -14290,7 +14360,8 @@ class ShareFileClient extends StorageClient {
|
|
14290
14360
|
if (response.handleList === "") {
|
14291
14361
|
response.handleList = undefined;
|
14292
14362
|
}
|
14293
|
-
|
14363
|
+
const wrappedResponse = Object.assign(Object.assign({}, ConvertInternalResponseOfListHandles(response)), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListHandles(response._response.parsedBody) }) });
|
14364
|
+
return wrappedResponse;
|
14294
14365
|
});
|
14295
14366
|
}
|
14296
14367
|
/**
|