@azure/storage-file-share 12.13.0-beta.1 → 12.14.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 +201 -70
- package/dist/index.js.map +1 -1
- package/dist-esm/src/Clients.js +52 -46
- package/dist-esm/src/Clients.js.map +1 -1
- package/dist-esm/src/Pipeline.js +7 -4
- package/dist-esm/src/Pipeline.js.map +1 -1
- package/dist-esm/src/ShareServiceClient.js +7 -5
- package/dist-esm/src/ShareServiceClient.js.map +1 -1
- package/dist-esm/src/generated/src/models/index.js.map +1 -1
- package/dist-esm/src/generated/src/models/parameters.js +31 -1
- package/dist-esm/src/generated/src/models/parameters.js.map +1 -1
- package/dist-esm/src/generated/src/operations/directory.js +29 -4
- package/dist-esm/src/generated/src/operations/directory.js.map +1 -1
- package/dist-esm/src/generated/src/operations/file.js +49 -8
- package/dist-esm/src/generated/src/operations/file.js.map +1 -1
- package/dist-esm/src/generated/src/operations/share.js +3 -1
- package/dist-esm/src/generated/src/operations/share.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/generatedModels.js +5 -1
- package/dist-esm/src/generatedModels.js.map +1 -1
- package/dist-esm/src/models.js.map +1 -1
- package/dist-esm/src/utils/constants.js +6 -2
- package/dist-esm/src/utils/constants.js.map +1 -1
- package/dist-esm/src/utils/utils.common.js +12 -1
- package/dist-esm/src/utils/utils.common.js.map +1 -1
- package/package.json +3 -2
- package/types/3.1/storage-file-share.d.ts +61 -12
- package/types/latest/storage-file-share.d.ts +65 -12
package/dist-esm/src/Clients.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
2
2
|
// Licensed under the MIT license.
|
3
3
|
import { __asyncGenerator, __asyncValues, __await } from "tslib";
|
4
|
-
import { isNode } from "@azure/core-http";
|
4
|
+
import { isNode, isTokenCredential, } from "@azure/core-http";
|
5
5
|
import { SpanStatusCode } from "@azure/core-tracing";
|
6
6
|
import { Share, Directory, File } from "./generated/src/operations";
|
7
7
|
import { newPipeline, Pipeline } from "./Pipeline";
|
@@ -39,7 +39,8 @@ export class ShareClient extends StorageClient {
|
|
39
39
|
url = urlOrConnectionString;
|
40
40
|
pipeline = credentialOrPipelineOrShareName;
|
41
41
|
}
|
42
|
-
else if (credentialOrPipelineOrShareName instanceof Credential
|
42
|
+
else if (credentialOrPipelineOrShareName instanceof Credential ||
|
43
|
+
isTokenCredential(credentialOrPipelineOrShareName)) {
|
43
44
|
// (url: string, credential?: Credential, options?: StoragePipelineOptions)
|
44
45
|
url = urlOrConnectionString;
|
45
46
|
pipeline = newPipeline(credentialOrPipelineOrShareName, options);
|
@@ -79,6 +80,7 @@ export class ShareClient extends StorageClient {
|
|
79
80
|
}
|
80
81
|
super(url, pipeline);
|
81
82
|
this._name = getShareNameAndPathFromUrl(this.url).shareName;
|
83
|
+
this.shareClientConfig = options;
|
82
84
|
this.context = new Share(this.storageClientContext);
|
83
85
|
}
|
84
86
|
/**
|
@@ -95,7 +97,7 @@ export class ShareClient extends StorageClient {
|
|
95
97
|
* @returns A new ShareClient object identical to the source but with the specified snapshot timestamp
|
96
98
|
*/
|
97
99
|
withSnapshot(snapshot) {
|
98
|
-
return new ShareClient(setURLParameter(this.url, URLConstants.Parameters.SHARE_SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline);
|
100
|
+
return new ShareClient(setURLParameter(this.url, URLConstants.Parameters.SHARE_SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline, this.shareClientConfig);
|
99
101
|
}
|
100
102
|
/**
|
101
103
|
* Creates a new share under the specified account. If the share with
|
@@ -162,7 +164,7 @@ export class ShareClient extends StorageClient {
|
|
162
164
|
// Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
|
163
165
|
/* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */
|
164
166
|
getDirectoryClient(directoryName) {
|
165
|
-
return new ShareDirectoryClient(appendToURLPath(this.url, EscapePath(directoryName)), this.pipeline);
|
167
|
+
return new ShareDirectoryClient(appendToURLPath(this.url, EscapePath(directoryName)), this.pipeline, this.shareClientConfig);
|
166
168
|
}
|
167
169
|
/**
|
168
170
|
* Gets the directory client for the root directory of this share.
|
@@ -659,7 +661,7 @@ export class ShareClient extends StorageClient {
|
|
659
661
|
try {
|
660
662
|
return await this.context.createPermission({
|
661
663
|
permission: filePermission,
|
662
|
-
}, Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));
|
664
|
+
}, Object.assign(Object.assign({ abortSignal: options.abortSignal }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
|
663
665
|
}
|
664
666
|
catch (e) {
|
665
667
|
span.setStatus({
|
@@ -683,7 +685,7 @@ export class ShareClient extends StorageClient {
|
|
683
685
|
async getPermission(filePermissionKey, options = {}) {
|
684
686
|
const { span, updatedOptions } = createSpan("ShareClient-getPermission", options);
|
685
687
|
try {
|
686
|
-
return await this.context.getPermission(filePermissionKey, Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));
|
688
|
+
return await this.context.getPermission(filePermissionKey, Object.assign(Object.assign({ abortSignal: options.abortSignal }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
|
687
689
|
}
|
688
690
|
catch (e) {
|
689
691
|
span.setStatus({
|
@@ -724,7 +726,8 @@ export class ShareDirectoryClient extends StorageClient {
|
|
724
726
|
if (credentialOrPipeline instanceof Pipeline) {
|
725
727
|
pipeline = credentialOrPipeline;
|
726
728
|
}
|
727
|
-
else if (credentialOrPipeline instanceof Credential
|
729
|
+
else if (credentialOrPipeline instanceof Credential ||
|
730
|
+
isTokenCredential(credentialOrPipeline)) {
|
728
731
|
pipeline = newPipeline(credentialOrPipeline, options);
|
729
732
|
}
|
730
733
|
else {
|
@@ -737,6 +740,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
737
740
|
shareName: this._shareName,
|
738
741
|
path: this._path,
|
739
742
|
} = getShareNameAndPathFromUrl(this.url));
|
743
|
+
this.shareClientConfig = options;
|
740
744
|
this.context = new Directory(this.storageClientContext);
|
741
745
|
}
|
742
746
|
/**
|
@@ -776,7 +780,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
776
780
|
}
|
777
781
|
return await this.context.create(options.fileAttributes
|
778
782
|
? fileAttributesToString(options.fileAttributes)
|
779
|
-
: FileAttributesNone, Object.assign({ abortSignal: options.abortSignal, metadata: options.metadata, filePermission: options.filePermission, filePermissionKey: options.filePermissionKey, fileChangeOn: fileChangeTimeToString(options.changeTime), fileCreatedOn: fileCreationTimeToString(options.creationTime), fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime) }, convertTracingToRequestOptionsBase(updatedOptions)));
|
783
|
+
: FileAttributesNone, Object.assign(Object.assign({ abortSignal: options.abortSignal, metadata: options.metadata, filePermission: options.filePermission, filePermissionKey: options.filePermissionKey, fileChangeOn: fileChangeTimeToString(options.changeTime), fileCreatedOn: fileCreationTimeToString(options.creationTime), fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime) }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
|
780
784
|
}
|
781
785
|
catch (e) {
|
782
786
|
span.setStatus({
|
@@ -834,7 +838,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
834
838
|
properties = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(properties);
|
835
839
|
return await this.context.setProperties(properties.fileAttributes
|
836
840
|
? fileAttributesToString(properties.fileAttributes)
|
837
|
-
: FileAttributesPreserve, Object.assign({ abortSignal: properties.abortSignal, filePermission: properties.filePermission, filePermissionKey: properties.filePermissionKey, fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(properties.creationTime), fileLastWriteOn: fileLastWriteTimeToString(properties.lastWriteTime) }, convertTracingToRequestOptionsBase(updatedOptions)));
|
841
|
+
: FileAttributesPreserve, Object.assign(Object.assign({ abortSignal: properties.abortSignal, filePermission: properties.filePermission, filePermissionKey: properties.filePermissionKey, fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(properties.creationTime), fileLastWriteOn: fileLastWriteTimeToString(properties.lastWriteTime) }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
|
838
842
|
}
|
839
843
|
catch (e) {
|
840
844
|
span.setStatus({
|
@@ -862,7 +866,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
862
866
|
* ```
|
863
867
|
*/
|
864
868
|
getDirectoryClient(subDirectoryName) {
|
865
|
-
return new ShareDirectoryClient(appendToURLPath(this.url, EscapePath(subDirectoryName)), this.pipeline);
|
869
|
+
return new ShareDirectoryClient(appendToURLPath(this.url, EscapePath(subDirectoryName)), this.pipeline, this.shareClientConfig);
|
866
870
|
}
|
867
871
|
/**
|
868
872
|
* Creates a new subdirectory under this directory.
|
@@ -1007,7 +1011,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1007
1011
|
// Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
|
1008
1012
|
/* eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients */
|
1009
1013
|
getFileClient(fileName) {
|
1010
|
-
return new ShareFileClient(appendToURLPath(this.url, EscapePath(fileName)), this.pipeline);
|
1014
|
+
return new ShareFileClient(appendToURLPath(this.url, EscapePath(fileName)), this.pipeline, this.shareClientConfig);
|
1011
1015
|
}
|
1012
1016
|
/**
|
1013
1017
|
* Returns true if the specified directory exists; false otherwise.
|
@@ -1057,7 +1061,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1057
1061
|
async getProperties(options = {}) {
|
1058
1062
|
const { span, updatedOptions } = createSpan("ShareDirectoryClient-getProperties", options);
|
1059
1063
|
try {
|
1060
|
-
return await this.context.getProperties(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));
|
1064
|
+
return await this.context.getProperties(Object.assign(Object.assign({ abortSignal: options.abortSignal }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
|
1061
1065
|
}
|
1062
1066
|
catch (e) {
|
1063
1067
|
span.setStatus({
|
@@ -1081,7 +1085,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1081
1085
|
async delete(options = {}) {
|
1082
1086
|
const { span, updatedOptions } = createSpan("ShareDirectoryClient-delete", options);
|
1083
1087
|
try {
|
1084
|
-
return await this.context.delete(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));
|
1088
|
+
return await this.context.delete(Object.assign(Object.assign({ abortSignal: options.abortSignal }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
|
1085
1089
|
}
|
1086
1090
|
catch (e) {
|
1087
1091
|
span.setStatus({
|
@@ -1138,7 +1142,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1138
1142
|
async setMetadata(metadata, options = {}) {
|
1139
1143
|
const { span, updatedOptions } = createSpan("ShareDirectoryClient-setMetadata", options);
|
1140
1144
|
try {
|
1141
|
-
return await this.context.setMetadata(Object.assign({ abortSignal: options.abortSignal, metadata }, convertTracingToRequestOptionsBase(updatedOptions)));
|
1145
|
+
return await this.context.setMetadata(Object.assign(Object.assign({ abortSignal: options.abortSignal, metadata }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
|
1142
1146
|
}
|
1143
1147
|
catch (e) {
|
1144
1148
|
span.setStatus({
|
@@ -1354,7 +1358,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1354
1358
|
options.prefix = undefined;
|
1355
1359
|
}
|
1356
1360
|
try {
|
1357
|
-
const response = await this.context.listFilesAndDirectoriesSegment(Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));
|
1361
|
+
const response = await this.context.listFilesAndDirectoriesSegment(Object.assign(Object.assign(Object.assign({ marker }, options), this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
|
1358
1362
|
const wrappedResponse = Object.assign(Object.assign({}, ConvertInternalResponseOfListFiles(response)), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListFiles(response._response.parsedBody) }) });
|
1359
1363
|
return wrappedResponse;
|
1360
1364
|
}
|
@@ -1534,7 +1538,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1534
1538
|
const { span, updatedOptions } = createSpan("ShareDirectoryClient-listHandlesSegment", options);
|
1535
1539
|
try {
|
1536
1540
|
marker = marker === "" ? undefined : marker;
|
1537
|
-
const response = await this.context.listHandles(Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));
|
1541
|
+
const response = await this.context.listHandles(Object.assign(Object.assign(Object.assign({ marker }, options), this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
|
1538
1542
|
// TODO: Protocol layer issue that when handle list is in returned XML
|
1539
1543
|
// response.handleList is an empty string
|
1540
1544
|
if (response.handleList === "") {
|
@@ -1569,7 +1573,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1569
1573
|
const { span, updatedOptions } = createSpan("ShareDirectoryClient-forceCloseHandlesSegment", options);
|
1570
1574
|
try {
|
1571
1575
|
marker = marker === "" ? undefined : marker;
|
1572
|
-
const rawResponse = await this.context.forceCloseHandles("*", Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));
|
1576
|
+
const rawResponse = await this.context.forceCloseHandles("*", Object.assign(Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)), this.shareClientConfig));
|
1573
1577
|
const response = rawResponse;
|
1574
1578
|
response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
|
1575
1579
|
response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
|
@@ -1637,7 +1641,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1637
1641
|
if (handleId === "*") {
|
1638
1642
|
throw new RangeError(`Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`);
|
1639
1643
|
}
|
1640
|
-
const rawResponse = await this.context.forceCloseHandles(handleId, Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));
|
1644
|
+
const rawResponse = await this.context.forceCloseHandles(handleId, Object.assign(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)), this.shareClientConfig));
|
1641
1645
|
const response = rawResponse;
|
1642
1646
|
response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
|
1643
1647
|
response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
|
@@ -1689,9 +1693,9 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1689
1693
|
else {
|
1690
1694
|
throw new RangeError("Destination path should not contain more than one query string");
|
1691
1695
|
}
|
1692
|
-
const destDirectory = new ShareDirectoryClient(destinationUrl, this.pipeline);
|
1696
|
+
const destDirectory = new ShareDirectoryClient(destinationUrl, this.pipeline, this.shareClientConfig);
|
1693
1697
|
try {
|
1694
|
-
const response = await destDirectory.context.rename(this.url, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
|
1698
|
+
const response = await destDirectory.context.rename(this.url, Object.assign(Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
|
1695
1699
|
? {
|
1696
1700
|
sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,
|
1697
1701
|
}
|
@@ -1699,7 +1703,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1699
1703
|
? {
|
1700
1704
|
destinationLeaseId: updatedOptions.destinationLeaseAccessConditions.leaseId,
|
1701
1705
|
}
|
1702
|
-
: undefined }));
|
1706
|
+
: undefined }), this.shareClientConfig));
|
1703
1707
|
return {
|
1704
1708
|
destinationDirectoryClient: destDirectory,
|
1705
1709
|
directoryRenameResponse: response,
|
@@ -1729,7 +1733,8 @@ export class ShareFileClient extends StorageClient {
|
|
1729
1733
|
if (credentialOrPipeline instanceof Pipeline) {
|
1730
1734
|
pipeline = credentialOrPipeline;
|
1731
1735
|
}
|
1732
|
-
else if (credentialOrPipeline instanceof Credential
|
1736
|
+
else if (credentialOrPipeline instanceof Credential ||
|
1737
|
+
isTokenCredential(credentialOrPipeline)) {
|
1733
1738
|
pipeline = newPipeline(credentialOrPipeline, options);
|
1734
1739
|
}
|
1735
1740
|
else {
|
@@ -1742,6 +1747,7 @@ export class ShareFileClient extends StorageClient {
|
|
1742
1747
|
shareName: this._shareName,
|
1743
1748
|
path: this._path,
|
1744
1749
|
} = getShareNameAndPathFromUrl(this.url));
|
1750
|
+
this.shareClientConfig = options;
|
1745
1751
|
this.context = new File(this.storageClientContext);
|
1746
1752
|
}
|
1747
1753
|
/**
|
@@ -1770,7 +1776,7 @@ export class ShareFileClient extends StorageClient {
|
|
1770
1776
|
* @returns A new ShareFileClient object identical to the source but with the specified share snapshot timestamp.
|
1771
1777
|
*/
|
1772
1778
|
withShareSnapshot(shareSnapshot) {
|
1773
|
-
return new ShareFileClient(setURLParameter(this.url, URLConstants.Parameters.SHARE_SNAPSHOT, shareSnapshot.length === 0 ? undefined : shareSnapshot), this.pipeline);
|
1779
|
+
return new ShareFileClient(setURLParameter(this.url, URLConstants.Parameters.SHARE_SNAPSHOT, shareSnapshot.length === 0 ? undefined : shareSnapshot), this.pipeline, this.shareClientConfig);
|
1774
1780
|
}
|
1775
1781
|
/**
|
1776
1782
|
* Creates a new file or replaces a file. Note it only initializes the file with no content.
|
@@ -1804,7 +1810,7 @@ export class ShareFileClient extends StorageClient {
|
|
1804
1810
|
options.fileHttpHeaders = options.fileHttpHeaders || {};
|
1805
1811
|
return await this.context.create(size, options.fileAttributes
|
1806
1812
|
? fileAttributesToString(options.fileAttributes)
|
1807
|
-
: FileAttributesNone, Object.assign({ abortSignal: options.abortSignal, fileHttpHeaders: options.fileHttpHeaders, metadata: options.metadata, filePermission: options.filePermission, filePermissionKey: options.filePermissionKey, fileChangeOn: fileChangeTimeToString(options.changeTime), fileCreatedOn: fileCreationTimeToString(options.creationTime), fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime), leaseAccessConditions: options.leaseAccessConditions }, convertTracingToRequestOptionsBase(updatedOptions)));
|
1813
|
+
: FileAttributesNone, Object.assign(Object.assign({ abortSignal: options.abortSignal, fileHttpHeaders: options.fileHttpHeaders, metadata: options.metadata, filePermission: options.filePermission, filePermissionKey: options.filePermissionKey, fileChangeOn: fileChangeTimeToString(options.changeTime), fileCreatedOn: fileCreationTimeToString(options.creationTime), fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime), leaseAccessConditions: options.leaseAccessConditions }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
|
1808
1814
|
}
|
1809
1815
|
catch (e) {
|
1810
1816
|
span.setStatus({
|
@@ -1885,9 +1891,9 @@ export class ShareFileClient extends StorageClient {
|
|
1885
1891
|
throw new RangeError(`rangeGetContentMD5 only works with partial data downloading`);
|
1886
1892
|
}
|
1887
1893
|
const downloadFullFile = offset === 0 && !count;
|
1888
|
-
const res = await this.context.download(Object.assign({ abortSignal: options.abortSignal, requestOptions: {
|
1894
|
+
const res = await this.context.download(Object.assign(Object.assign({ abortSignal: options.abortSignal, requestOptions: {
|
1889
1895
|
onDownloadProgress: isNode ? undefined : options.onProgress, // for Node.js, progress is reported by RetriableReadableStream
|
1890
|
-
}, range: downloadFullFile ? undefined : rangeToString({ offset, count }), rangeGetContentMD5: options.rangeGetContentMD5, leaseAccessConditions: options.leaseAccessConditions }, convertTracingToRequestOptionsBase(updatedOptions)));
|
1896
|
+
}, range: downloadFullFile ? undefined : rangeToString({ offset, count }), rangeGetContentMD5: options.rangeGetContentMD5, leaseAccessConditions: options.leaseAccessConditions }, convertTracingToRequestOptionsBase(updatedOptions)), this.shareClientConfig));
|
1891
1897
|
// Return browser response immediately
|
1892
1898
|
if (!isNode) {
|
1893
1899
|
return res;
|
@@ -1986,7 +1992,7 @@ export class ShareFileClient extends StorageClient {
|
|
1986
1992
|
async getProperties(options = {}) {
|
1987
1993
|
const { span, updatedOptions } = createSpan("ShareFileClient-getProperties", options);
|
1988
1994
|
try {
|
1989
|
-
return this.context.getProperties(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.leaseAccessConditions }, convertTracingToRequestOptionsBase(updatedOptions)));
|
1995
|
+
return this.context.getProperties(Object.assign(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.leaseAccessConditions }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
|
1990
1996
|
}
|
1991
1997
|
catch (e) {
|
1992
1998
|
span.setStatus({
|
@@ -2015,7 +2021,7 @@ export class ShareFileClient extends StorageClient {
|
|
2015
2021
|
properties.fileHttpHeaders = properties.fileHttpHeaders || {};
|
2016
2022
|
return await this.context.setHttpHeaders(properties.fileAttributes
|
2017
2023
|
? fileAttributesToString(properties.fileAttributes)
|
2018
|
-
: FileAttributesPreserve, Object.assign({ abortSignal: properties.abortSignal, fileHttpHeaders: properties.fileHttpHeaders, filePermission: properties.filePermission, filePermissionKey: properties.filePermissionKey, leaseAccessConditions: properties.leaseAccessConditions, fileChangeOn: fileChangeTimeToString(properties.changeTime), fileCreatedOn: fileCreationTimeToString(properties.creationTime), fileLastWriteOn: fileLastWriteTimeToString(properties.lastWriteTime) }, convertTracingToRequestOptionsBase(updatedOptions)));
|
2024
|
+
: FileAttributesPreserve, Object.assign(Object.assign({ abortSignal: properties.abortSignal, fileHttpHeaders: properties.fileHttpHeaders, filePermission: properties.filePermission, filePermissionKey: properties.filePermissionKey, leaseAccessConditions: properties.leaseAccessConditions, fileChangeOn: fileChangeTimeToString(properties.changeTime), fileCreatedOn: fileCreationTimeToString(properties.creationTime), fileLastWriteOn: fileLastWriteTimeToString(properties.lastWriteTime) }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
|
2019
2025
|
}
|
2020
2026
|
catch (e) {
|
2021
2027
|
span.setStatus({
|
@@ -2048,7 +2054,7 @@ export class ShareFileClient extends StorageClient {
|
|
2048
2054
|
async delete(options = {}) {
|
2049
2055
|
const { span, updatedOptions } = createSpan("ShareFileClient-delete", options);
|
2050
2056
|
try {
|
2051
|
-
return await this.context.delete(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.leaseAccessConditions }, convertTracingToRequestOptionsBase(updatedOptions)));
|
2057
|
+
return await this.context.delete(Object.assign(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.leaseAccessConditions }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
|
2052
2058
|
}
|
2053
2059
|
catch (e) {
|
2054
2060
|
span.setStatus({
|
@@ -2122,7 +2128,7 @@ export class ShareFileClient extends StorageClient {
|
|
2122
2128
|
options = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(options);
|
2123
2129
|
return await this.context.setHttpHeaders(options.fileAttributes
|
2124
2130
|
? fileAttributesToString(options.fileAttributes)
|
2125
|
-
: FileAttributesPreserve, Object.assign({ abortSignal: options.abortSignal, fileHttpHeaders, filePermission: options.filePermission, filePermissionKey: options.filePermissionKey, leaseAccessConditions: options.leaseAccessConditions, fileCreatedOn: fileCreationTimeToString(options.creationTime), fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime), fileChangeOn: fileChangeTimeToString(options.changeTime) }, convertTracingToRequestOptionsBase(updatedOptions)));
|
2131
|
+
: FileAttributesPreserve, Object.assign(Object.assign({ abortSignal: options.abortSignal, fileHttpHeaders, filePermission: options.filePermission, filePermissionKey: options.filePermissionKey, leaseAccessConditions: options.leaseAccessConditions, fileCreatedOn: fileCreationTimeToString(options.creationTime), fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime), fileChangeOn: fileChangeTimeToString(options.changeTime) }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
|
2126
2132
|
}
|
2127
2133
|
catch (e) {
|
2128
2134
|
span.setStatus({
|
@@ -2154,7 +2160,7 @@ export class ShareFileClient extends StorageClient {
|
|
2154
2160
|
}
|
2155
2161
|
// FileAttributes, filePermission, createTime, lastWriteTime will all be preserved.
|
2156
2162
|
options = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(options);
|
2157
|
-
return await this.context.setHttpHeaders(fileAttributesToString(options.fileAttributes), Object.assign({ abortSignal: options.abortSignal, fileContentLength: length, filePermission: options.filePermission, filePermissionKey: options.filePermissionKey, leaseAccessConditions: options.leaseAccessConditions, fileChangeOn: fileChangeTimeToString(options.changeTime), fileCreatedOn: fileCreationTimeToString(options.creationTime), fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime) }, convertTracingToRequestOptionsBase(updatedOptions)));
|
2163
|
+
return await this.context.setHttpHeaders(fileAttributesToString(options.fileAttributes), Object.assign(Object.assign({ abortSignal: options.abortSignal, fileContentLength: length, filePermission: options.filePermission, filePermissionKey: options.filePermissionKey, leaseAccessConditions: options.leaseAccessConditions, fileChangeOn: fileChangeTimeToString(options.changeTime), fileCreatedOn: fileCreationTimeToString(options.creationTime), fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime) }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
|
2158
2164
|
}
|
2159
2165
|
catch (e) {
|
2160
2166
|
span.setStatus({
|
@@ -2181,7 +2187,7 @@ export class ShareFileClient extends StorageClient {
|
|
2181
2187
|
async setMetadata(metadata = {}, options = {}) {
|
2182
2188
|
const { span, updatedOptions } = createSpan("ShareFileClient-setMetadata", options);
|
2183
2189
|
try {
|
2184
|
-
return await this.context.setMetadata(Object.assign({ abortSignal: options.abortSignal, metadata, leaseAccessConditions: options.leaseAccessConditions }, convertTracingToRequestOptionsBase(updatedOptions)));
|
2190
|
+
return await this.context.setMetadata(Object.assign(Object.assign({ abortSignal: options.abortSignal, metadata, leaseAccessConditions: options.leaseAccessConditions }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
|
2185
2191
|
}
|
2186
2192
|
catch (e) {
|
2187
2193
|
span.setStatus({
|
@@ -2233,9 +2239,9 @@ export class ShareFileClient extends StorageClient {
|
|
2233
2239
|
if (contentLength > FILE_RANGE_MAX_SIZE_BYTES) {
|
2234
2240
|
throw new RangeError(`offset must be < ${FILE_RANGE_MAX_SIZE_BYTES} bytes`);
|
2235
2241
|
}
|
2236
|
-
return await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "update", contentLength, Object.assign(Object.assign({ abortSignal: options.abortSignal, contentMD5: options.contentMD5, requestOptions: {
|
2242
|
+
return await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "update", contentLength, Object.assign(Object.assign(Object.assign({ abortSignal: options.abortSignal, contentMD5: options.contentMD5, requestOptions: {
|
2237
2243
|
onUploadProgress: options.onProgress,
|
2238
|
-
}, body: body }, convertTracingToRequestOptionsBase(updatedOptions)), { leaseAccessConditions: options.leaseAccessConditions, fileLastWrittenMode: options.fileLastWrittenMode }));
|
2244
|
+
}, body: body }, convertTracingToRequestOptionsBase(updatedOptions)), { leaseAccessConditions: options.leaseAccessConditions, fileLastWrittenMode: options.fileLastWrittenMode }), this.shareClientConfig));
|
2239
2245
|
}
|
2240
2246
|
catch (e) {
|
2241
2247
|
span.setStatus({
|
@@ -2267,7 +2273,7 @@ export class ShareFileClient extends StorageClient {
|
|
2267
2273
|
if (count <= 0 || count > FILE_RANGE_MAX_SIZE_BYTES) {
|
2268
2274
|
throw new RangeError(`count must be > 0 and <= ${FILE_RANGE_MAX_SIZE_BYTES} bytes`);
|
2269
2275
|
}
|
2270
|
-
return await this.context.uploadRangeFromURL(rangeToString({ offset: destOffset, count }), sourceURL, 0, Object.assign(Object.assign({ abortSignal: options.abortSignal, sourceRange: rangeToString({ offset: sourceOffset, count }), sourceModifiedAccessConditions: options.sourceConditions, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), fileLastWrittenMode: options.fileLastWrittenMode }, options), convertTracingToRequestOptionsBase(updatedOptions)));
|
2276
|
+
return await this.context.uploadRangeFromURL(rangeToString({ offset: destOffset, count }), sourceURL, 0, Object.assign(Object.assign(Object.assign({ abortSignal: options.abortSignal, sourceRange: rangeToString({ offset: sourceOffset, count }), sourceModifiedAccessConditions: options.sourceConditions, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), fileLastWrittenMode: options.fileLastWrittenMode }, this.shareClientConfig), options), convertTracingToRequestOptionsBase(updatedOptions)));
|
2271
2277
|
}
|
2272
2278
|
catch (e) {
|
2273
2279
|
span.setStatus({
|
@@ -2294,7 +2300,7 @@ export class ShareFileClient extends StorageClient {
|
|
2294
2300
|
if (offset < 0 || contentLength <= 0) {
|
2295
2301
|
throw new RangeError(`offset must >= 0 and contentLength must be > 0`);
|
2296
2302
|
}
|
2297
|
-
return await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "clear", 0, Object.assign(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)), { leaseAccessConditions: options.leaseAccessConditions, fileLastWrittenMode: options.fileLastWrittenMode }));
|
2303
|
+
return await this.context.uploadRange(rangeToString({ count: contentLength, offset }), "clear", 0, Object.assign(Object.assign(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)), { leaseAccessConditions: options.leaseAccessConditions, fileLastWrittenMode: options.fileLastWrittenMode }), this.shareClientConfig));
|
2298
2304
|
}
|
2299
2305
|
catch (e) {
|
2300
2306
|
span.setStatus({
|
@@ -2315,7 +2321,7 @@ export class ShareFileClient extends StorageClient {
|
|
2315
2321
|
async getRangeList(options = {}) {
|
2316
2322
|
const { span, updatedOptions } = createSpan("ShareFileClient-getRangeList", options);
|
2317
2323
|
try {
|
2318
|
-
const originalResponse = await this.context.getRangeList(Object.assign({ abortSignal: options.abortSignal, range: options.range ? rangeToString(options.range) : undefined, leaseAccessConditions: options.leaseAccessConditions }, convertTracingToRequestOptionsBase(updatedOptions)));
|
2324
|
+
const originalResponse = await this.context.getRangeList(Object.assign(Object.assign({ abortSignal: options.abortSignal, range: options.range ? rangeToString(options.range) : undefined, leaseAccessConditions: options.leaseAccessConditions }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
|
2319
2325
|
// Only returns ranges, ignoring clearRanges.
|
2320
2326
|
const parsedBody = originalResponse._response.parsedBody.ranges
|
2321
2327
|
? originalResponse._response.parsedBody.ranges
|
@@ -2342,7 +2348,7 @@ export class ShareFileClient extends StorageClient {
|
|
2342
2348
|
async getRangeListDiff(prevShareSnapshot, options = {}) {
|
2343
2349
|
const { span, updatedOptions } = createSpan("ShareFileClient-getRangeListDiff", options);
|
2344
2350
|
try {
|
2345
|
-
return await this.context.getRangeList(Object.assign(Object.assign(Object.assign({ prevsharesnapshot: prevShareSnapshot }, options), { range: options.range ? rangeToString(options.range) : undefined }), convertTracingToRequestOptionsBase(updatedOptions)));
|
2351
|
+
return await this.context.getRangeList(Object.assign(Object.assign(Object.assign(Object.assign({ prevsharesnapshot: prevShareSnapshot }, options), { range: options.range ? rangeToString(options.range) : undefined }), this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
|
2346
2352
|
}
|
2347
2353
|
catch (e) {
|
2348
2354
|
span.setStatus({
|
@@ -2370,7 +2376,7 @@ export class ShareFileClient extends StorageClient {
|
|
2370
2376
|
async startCopyFromURL(copySource, options = {}) {
|
2371
2377
|
const { span, updatedOptions } = createSpan("ShareFileClient-startCopyFromURL", options);
|
2372
2378
|
try {
|
2373
|
-
return await this.context.startCopy(copySource, Object.assign({ abortSignal: options.abortSignal, metadata: options.metadata, leaseAccessConditions: options.leaseAccessConditions, filePermission: options.filePermission, filePermissionKey: options.filePermissionKey, copyFileSmbInfo: options.copyFileSmbInfo }, convertTracingToRequestOptionsBase(updatedOptions)));
|
2379
|
+
return await this.context.startCopy(copySource, Object.assign(Object.assign({ abortSignal: options.abortSignal, metadata: options.metadata, leaseAccessConditions: options.leaseAccessConditions, filePermission: options.filePermission, filePermissionKey: options.filePermissionKey, copyFileSmbInfo: options.copyFileSmbInfo }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
|
2374
2380
|
}
|
2375
2381
|
catch (e) {
|
2376
2382
|
span.setStatus({
|
@@ -2394,7 +2400,7 @@ export class ShareFileClient extends StorageClient {
|
|
2394
2400
|
async abortCopyFromURL(copyId, options = {}) {
|
2395
2401
|
const { span, updatedOptions } = createSpan("ShareFileClient-abortCopyFromURL", options);
|
2396
2402
|
try {
|
2397
|
-
return await this.context.abortCopy(copyId, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.leaseAccessConditions }, convertTracingToRequestOptionsBase(updatedOptions)));
|
2403
|
+
return await this.context.abortCopy(copyId, Object.assign(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.leaseAccessConditions }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
|
2398
2404
|
}
|
2399
2405
|
catch (e) {
|
2400
2406
|
span.setStatus({
|
@@ -2831,7 +2837,7 @@ export class ShareFileClient extends StorageClient {
|
|
2831
2837
|
const { span, updatedOptions } = createSpan("ShareFileClient-listHandlesSegment", options);
|
2832
2838
|
try {
|
2833
2839
|
marker = marker === "" ? undefined : marker;
|
2834
|
-
const response = await this.context.listHandles(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));
|
2840
|
+
const response = await this.context.listHandles(Object.assign(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker }, options), convertTracingToRequestOptionsBase(updatedOptions)), this.shareClientConfig));
|
2835
2841
|
// TODO: Protocol layer issue that when handle list is in returned XML
|
2836
2842
|
// response.handleList is an empty string
|
2837
2843
|
if (response.handleList === "") {
|
@@ -2950,7 +2956,7 @@ export class ShareFileClient extends StorageClient {
|
|
2950
2956
|
const { span, updatedOptions } = createSpan("ShareFileClient-forceCloseHandlesSegment", options);
|
2951
2957
|
try {
|
2952
2958
|
marker = marker === "" ? undefined : marker;
|
2953
|
-
const rawResponse = await this.context.forceCloseHandles("*", Object.assign({ abortSignal: options.abortSignal, marker }, convertTracingToRequestOptionsBase(updatedOptions)));
|
2959
|
+
const rawResponse = await this.context.forceCloseHandles("*", Object.assign(Object.assign({ abortSignal: options.abortSignal, marker }, this.shareClientConfig), convertTracingToRequestOptionsBase(updatedOptions)));
|
2954
2960
|
const response = rawResponse;
|
2955
2961
|
response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
|
2956
2962
|
response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
|
@@ -3019,7 +3025,7 @@ export class ShareFileClient extends StorageClient {
|
|
3019
3025
|
if (handleId === "*") {
|
3020
3026
|
throw new RangeError(`Parameter handleID should be a specified handle ID. Use forceCloseHandlesSegment() to close all handles.`);
|
3021
3027
|
}
|
3022
|
-
const rawResponse = await this.context.forceCloseHandles(handleId, Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));
|
3028
|
+
const rawResponse = await this.context.forceCloseHandles(handleId, Object.assign(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)), this.shareClientConfig));
|
3023
3029
|
const response = rawResponse;
|
3024
3030
|
response.closedHandlesCount = rawResponse.numberOfHandlesClosed || 0;
|
3025
3031
|
response.closeFailureCount = rawResponse.numberOfHandlesFailedToClose || 0;
|
@@ -3098,9 +3104,9 @@ export class ShareFileClient extends StorageClient {
|
|
3098
3104
|
else {
|
3099
3105
|
throw new RangeError("Destination path should not contain more than one query string");
|
3100
3106
|
}
|
3101
|
-
const destFile = new ShareFileClient(destinationUrl, this.pipeline);
|
3107
|
+
const destFile = new ShareFileClient(destinationUrl, this.pipeline, this.shareClientConfig);
|
3102
3108
|
try {
|
3103
|
-
const response = await destFile.context.rename(this.url, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
|
3109
|
+
const response = await destFile.context.rename(this.url, Object.assign(Object.assign(Object.assign({}, updatedOptions), { sourceLeaseAccessConditions: updatedOptions.sourceLeaseAccessConditions
|
3104
3110
|
? {
|
3105
3111
|
sourceLeaseId: updatedOptions.sourceLeaseAccessConditions.leaseId,
|
3106
3112
|
}
|
@@ -3112,7 +3118,7 @@ export class ShareFileClient extends StorageClient {
|
|
3112
3118
|
? {
|
3113
3119
|
fileContentType: options.contentType,
|
3114
3120
|
}
|
3115
|
-
: undefined }));
|
3121
|
+
: undefined }), this.shareClientConfig));
|
3116
3122
|
return {
|
3117
3123
|
destinationFileClient: destFile,
|
3118
3124
|
fileRenameResponse: response,
|