@azure/storage-file-share 12.26.0 → 12.27.0-alpha.20250218.1
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +3 -3
- package/README.md +16 -18
- package/dist/index.js +1430 -431
- package/dist/index.js.map +1 -1
- package/dist-esm/storage-blob/src/BatchResponseParser.js +1 -1
- package/dist-esm/storage-blob/src/BatchResponseParser.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobBatch.js +1 -1
- package/dist-esm/storage-blob/src/BlobBatch.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobBatchClient.js +2 -2
- package/dist-esm/storage-blob/src/BlobBatchClient.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobLeaseClient.js +10 -10
- package/dist-esm/storage-blob/src/BlobLeaseClient.js.map +1 -1
- package/dist-esm/storage-blob/src/BlobServiceClient.js +11 -11
- package/dist-esm/storage-blob/src/BlobServiceClient.js.map +1 -1
- package/dist-esm/storage-blob/src/Clients.js +43 -43
- package/dist-esm/storage-blob/src/Clients.js.map +1 -1
- package/dist-esm/storage-blob/src/ContainerClient.js +18 -18
- package/dist-esm/storage-blob/src/ContainerClient.js.map +1 -1
- package/dist-esm/storage-blob/src/Range.js.map +1 -1
- package/dist-esm/storage-blob/src/StorageRetryPolicyFactory.js.map +1 -1
- package/dist-esm/storage-blob/src/credentials/UserDelegationKeyCredential.js +1 -1
- package/dist-esm/storage-blob/src/credentials/UserDelegationKeyCredential.js.map +1 -1
- package/dist-esm/storage-blob/src/models.js +2 -2
- package/dist-esm/storage-blob/src/models.js.map +1 -1
- package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.js +2 -2
- package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicy.js.map +1 -1
- package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.js +2 -2
- package/dist-esm/storage-blob/src/policies/StorageSharedKeyCredentialPolicyV2.js.map +1 -1
- package/dist-esm/storage-blob/src/sas/AccountSASPermissions.js +2 -2
- package/dist-esm/storage-blob/src/sas/AccountSASPermissions.js.map +1 -1
- package/dist-esm/storage-blob/src/sas/AccountSASResourceTypes.js +1 -1
- package/dist-esm/storage-blob/src/sas/AccountSASResourceTypes.js.map +1 -1
- package/dist-esm/storage-blob/src/sas/AccountSASSignatureValues.js +1 -1
- package/dist-esm/storage-blob/src/sas/AccountSASSignatureValues.js.map +1 -1
- package/dist-esm/storage-blob/src/sas/BlobSASSignatureValues.js +1 -1
- package/dist-esm/storage-blob/src/sas/BlobSASSignatureValues.js.map +1 -1
- package/dist-esm/storage-blob/src/sas/ContainerSASPermissions.js +1 -1
- package/dist-esm/storage-blob/src/sas/ContainerSASPermissions.js.map +1 -1
- package/dist-esm/storage-blob/src/sas/SASQueryParameters.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/utils.common.js +3 -3
- package/dist-esm/storage-blob/src/utils/utils.common.js.map +1 -1
- package/dist-esm/storage-blob/src/utils/utils.node.js +1 -1
- package/dist-esm/storage-blob/src/utils/utils.node.js.map +1 -1
- package/dist-esm/storage-file-share/src/AccountSASPermissions.js +2 -2
- package/dist-esm/storage-file-share/src/AccountSASPermissions.js.map +1 -1
- package/dist-esm/storage-file-share/src/AccountSASResourceTypes.js +1 -1
- package/dist-esm/storage-file-share/src/AccountSASResourceTypes.js.map +1 -1
- package/dist-esm/storage-file-share/src/AccountSASSignatureValues.js +1 -1
- package/dist-esm/storage-file-share/src/AccountSASSignatureValues.js.map +1 -1
- package/dist-esm/storage-file-share/src/Clients.js +103 -78
- package/dist-esm/storage-file-share/src/Clients.js.map +1 -1
- package/dist-esm/storage-file-share/src/FileDownloadResponse.js +24 -0
- package/dist-esm/storage-file-share/src/FileDownloadResponse.js.map +1 -1
- package/dist-esm/storage-file-share/src/FileSASSignatureValues.js.map +1 -1
- package/dist-esm/storage-file-share/src/FileSystemAttributes.js +1 -1
- package/dist-esm/storage-file-share/src/FileSystemAttributes.js.map +1 -1
- package/dist-esm/storage-file-share/src/Range.js.map +1 -1
- package/dist-esm/storage-file-share/src/SASQueryParameters.js.map +1 -1
- package/dist-esm/storage-file-share/src/ShareSASPermissions.js +1 -1
- package/dist-esm/storage-file-share/src/ShareSASPermissions.js.map +1 -1
- package/dist-esm/storage-file-share/src/ShareServiceClient.js +13 -7
- package/dist-esm/storage-file-share/src/ShareServiceClient.js.map +1 -1
- package/dist-esm/storage-file-share/src/StorageRetryPolicyFactory.js.map +1 -1
- package/dist-esm/storage-file-share/src/generated/src/models/index.js +10 -0
- 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 +544 -0
- 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 +108 -3
- package/dist-esm/storage-file-share/src/generated/src/models/parameters.js.map +1 -1
- package/dist-esm/storage-file-share/src/generated/src/operations/directory.js +12 -10
- package/dist-esm/storage-file-share/src/generated/src/operations/directory.js.map +1 -1
- package/dist-esm/storage-file-share/src/generated/src/operations/file.js +125 -10
- package/dist-esm/storage-file-share/src/generated/src/operations/file.js.map +1 -1
- package/dist-esm/storage-file-share/src/generated/src/operationsInterfaces/directory.js.map +1 -1
- package/dist-esm/storage-file-share/src/generated/src/operationsInterfaces/file.js.map +1 -1
- package/dist-esm/storage-file-share/src/generated/src/storageClient.js +2 -2
- 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/index.browser.js +1 -0
- package/dist-esm/storage-file-share/src/index.browser.js.map +1 -1
- package/dist-esm/storage-file-share/src/index.js +1 -0
- package/dist-esm/storage-file-share/src/index.js.map +1 -1
- package/dist-esm/storage-file-share/src/models.js +0 -21
- package/dist-esm/storage-file-share/src/models.js.map +1 -1
- package/dist-esm/storage-file-share/src/utils/constants.js +2 -2
- package/dist-esm/storage-file-share/src/utils/constants.js.map +1 -1
- package/dist-esm/storage-file-share/src/utils/utils.common.js +214 -2
- package/dist-esm/storage-file-share/src/utils/utils.common.js.map +1 -1
- package/package.json +9 -9
- package/types/latest/storage-file-share.d.ts +968 -134
@@ -4,14 +4,13 @@ import { __asyncGenerator, __asyncValues, __await } from "tslib";
|
|
4
4
|
import { isTokenCredential } from "@azure/core-auth";
|
5
5
|
import { isNode } from "@azure/core-util";
|
6
6
|
import { isPipelineLike, newPipeline } from "./Pipeline";
|
7
|
-
import { DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS, DEFAULT_HIGH_LEVEL_CONCURRENCY, FILE_MAX_SIZE_BYTES, FILE_RANGE_MAX_SIZE_BYTES, URLConstants,
|
8
|
-
import { appendToURLPath, setURLParameter, truncatedISO8061Date, extractConnectionStringParts, getShareNameAndPathFromUrl, appendToURLQuery, httpAuthorizationToString, setURLPath, setURLQueries, EscapePath, ConvertInternalResponseOfListFiles, ConvertInternalResponseOfListHandles, assertResponse, removeEmptyString, asSharePermission, } from "./utils/utils.common";
|
7
|
+
import { DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS, DEFAULT_HIGH_LEVEL_CONCURRENCY, FILE_MAX_SIZE_BYTES, FILE_RANGE_MAX_SIZE_BYTES, URLConstants, } from "./utils/constants";
|
8
|
+
import { appendToURLPath, setURLParameter, truncatedISO8061Date, extractConnectionStringParts, getShareNameAndPathFromUrl, appendToURLQuery, httpAuthorizationToString, setURLPath, setURLQueries, EscapePath, ConvertInternalResponseOfListFiles, ConvertInternalResponseOfListHandles, assertResponse, removeEmptyString, asSharePermission, parseOctalFileMode, toOctalFileMode, } from "./utils/utils.common";
|
9
9
|
import { Credential } from "../../storage-blob/src/credentials/Credential";
|
10
10
|
import { StorageSharedKeyCredential } from "../../storage-blob/src/credentials/StorageSharedKeyCredential";
|
11
11
|
import { AnonymousCredential } from "../../storage-blob/src/credentials/AnonymousCredential";
|
12
12
|
import { tracingClient } from "./utils/tracing";
|
13
13
|
import { StorageClient } from "./StorageClient";
|
14
|
-
import { FileSystemAttributes } from "./FileSystemAttributes";
|
15
14
|
import { FileDownloadResponse } from "./FileDownloadResponse";
|
16
15
|
import { rangeToString } from "./Range";
|
17
16
|
import { fileAttributesToString, fileCreationTimeToString, fileLastWriteTimeToString, validateAndSetDefaultsForFileAndDirectoryCreateCommonOptions, validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions, toShareProtocolsString, toShareProtocols, fileChangeTimeToString, } from "./models";
|
@@ -97,7 +96,7 @@ export class ShareClient extends StorageClient {
|
|
97
96
|
/**
|
98
97
|
* Creates a new share under the specified account. If the share with
|
99
98
|
* the same name already exists, the operation fails.
|
100
|
-
* @see https://
|
99
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/create-share
|
101
100
|
*
|
102
101
|
* @param options - Options to Share Create operation.
|
103
102
|
* @returns Response data for the Share Create operation.
|
@@ -110,7 +109,7 @@ export class ShareClient extends StorageClient {
|
|
110
109
|
/**
|
111
110
|
* Creates a new share under the specified account. If the share with
|
112
111
|
* the same name already exists, it is not changed.
|
113
|
-
* @see https://
|
112
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/create-share
|
114
113
|
*
|
115
114
|
* @param options -
|
116
115
|
*/
|
@@ -153,7 +152,7 @@ export class ShareClient extends StorageClient {
|
|
153
152
|
}
|
154
153
|
/**
|
155
154
|
* Creates a new subdirectory under this share.
|
156
|
-
* @see https://
|
155
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/create-directory
|
157
156
|
*
|
158
157
|
* @param directoryName -
|
159
158
|
* @param options - Options to Directory Create operation.
|
@@ -172,7 +171,7 @@ export class ShareClient extends StorageClient {
|
|
172
171
|
/**
|
173
172
|
* Removes the specified empty sub directory under this share.
|
174
173
|
* Note that the directory must be empty before it can be deleted.
|
175
|
-
* @see https://
|
174
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-directory
|
176
175
|
*
|
177
176
|
* @param directoryName -
|
178
177
|
* @param options - Options to Directory Delete operation.
|
@@ -187,7 +186,7 @@ export class ShareClient extends StorageClient {
|
|
187
186
|
/**
|
188
187
|
* Creates a new file or replaces a file under the root directory of this share.
|
189
188
|
* Note it only initializes the file with no content.
|
190
|
-
* @see https://
|
189
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/create-file
|
191
190
|
*
|
192
191
|
* @param fileName -
|
193
192
|
* @param size - Specifies the maximum size in bytes for the file, up to 4 TB.
|
@@ -218,7 +217,7 @@ export class ShareClient extends StorageClient {
|
|
218
217
|
* a share. An attempt to perform this operation on a share snapshot will fail with 400
|
219
218
|
* (`InvalidQueryParameterValue`)
|
220
219
|
*
|
221
|
-
* @see https://
|
220
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-file2
|
222
221
|
*
|
223
222
|
* @param directoryName -
|
224
223
|
* @param fileName -
|
@@ -258,7 +257,7 @@ export class ShareClient extends StorageClient {
|
|
258
257
|
/**
|
259
258
|
* Returns all user-defined metadata and system properties for the specified
|
260
259
|
* share.
|
261
|
-
* @see https://
|
260
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/get-share-properties
|
262
261
|
*
|
263
262
|
* WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if
|
264
263
|
* they originally contained uppercase characters. This differs from the metadata keys returned by
|
@@ -276,7 +275,7 @@ export class ShareClient extends StorageClient {
|
|
276
275
|
/**
|
277
276
|
* Marks the specified share for deletion. The share and any directories or files
|
278
277
|
* contained within it are later deleted during garbage collection.
|
279
|
-
* @see https://
|
278
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-share
|
280
279
|
*
|
281
280
|
* @param options - Options to Share Delete operation.
|
282
281
|
* @returns Response data for the Share Delete operation.
|
@@ -289,7 +288,7 @@ export class ShareClient extends StorageClient {
|
|
289
288
|
/**
|
290
289
|
* Marks the specified share for deletion if it exists. The share and any directories or files
|
291
290
|
* contained within it are later deleted during garbage collection.
|
292
|
-
* @see https://
|
291
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-share
|
293
292
|
*
|
294
293
|
* @param options -
|
295
294
|
*/
|
@@ -313,7 +312,7 @@ export class ShareClient extends StorageClient {
|
|
313
312
|
*
|
314
313
|
* If no option provided, or no metadata defined in the option parameter, the share
|
315
314
|
* metadata will be removed.
|
316
|
-
* @see https://
|
315
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/set-share-metadata
|
317
316
|
*
|
318
317
|
* @param metadata - If no metadata provided, all existing directory metadata will be removed.
|
319
318
|
* @param option - Options to Share Set Metadata operation.
|
@@ -331,7 +330,7 @@ export class ShareClient extends StorageClient {
|
|
331
330
|
* WARNING: JavaScript Date will potential lost precision when parsing start and expiry string.
|
332
331
|
* For example, new Date("2018-12-31T03:44:23.8827891Z").toISOString() will get "2018-12-31T03:44:23.882Z".
|
333
332
|
*
|
334
|
-
* @see https://
|
333
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/get-share-acl
|
335
334
|
*
|
336
335
|
* @param option - Options to Share Get Access Policy operation.
|
337
336
|
* @returns Response data for the Share Get Access Policy operation.
|
@@ -380,7 +379,7 @@ export class ShareClient extends StorageClient {
|
|
380
379
|
* When you establish a stored access policy on a share, it may take up to 30 seconds to take effect.
|
381
380
|
* During this interval, a shared access signature that is associated with the stored access policy will
|
382
381
|
* fail with status code 403 (Forbidden), until the access policy becomes active.
|
383
|
-
* @see https://
|
382
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/set-share-acl
|
384
383
|
*
|
385
384
|
* @param shareAcl - Array of signed identifiers, each having a unique Id and details of access policy.
|
386
385
|
* @param option - Options to Share Set Access Policy operation.
|
@@ -459,7 +458,7 @@ export class ShareClient extends StorageClient {
|
|
459
458
|
/**
|
460
459
|
* Creates a file permission (a security descriptor) at the share level.
|
461
460
|
* The created security descriptor can be used for the files/directories in the share.
|
462
|
-
* @see https://
|
461
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/create-permission
|
463
462
|
*
|
464
463
|
* @param options - Options to Share Create Permission operation.
|
465
464
|
* @param filePermission - File permission described in the SDDL
|
@@ -472,7 +471,7 @@ export class ShareClient extends StorageClient {
|
|
472
471
|
/**
|
473
472
|
* Gets the Security Descriptor Definition Language (SDDL) for a given file permission key
|
474
473
|
* which indicates a security descriptor.
|
475
|
-
* @see https://
|
474
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/get-permission
|
476
475
|
*
|
477
476
|
* @param options - Options to Share Create Permission operation.
|
478
477
|
* @param filePermissionKey - File permission key which indicates the security descriptor of the permission.
|
@@ -497,7 +496,7 @@ export class ShareClient extends StorageClient {
|
|
497
496
|
* Generates a Service Shared Access Signature (SAS) URI based on the client properties
|
498
497
|
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
499
498
|
*
|
500
|
-
* @see https://
|
499
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
|
501
500
|
*
|
502
501
|
* @param options - Optional parameters.
|
503
502
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
@@ -515,7 +514,7 @@ export class ShareClient extends StorageClient {
|
|
515
514
|
* Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties
|
516
515
|
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
517
516
|
*
|
518
|
-
* @see https://
|
517
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
|
519
518
|
*
|
520
519
|
* @param options - Optional parameters.
|
521
520
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
@@ -577,7 +576,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
577
576
|
}
|
578
577
|
/**
|
579
578
|
* Creates a new directory under the specified share or parent directory.
|
580
|
-
* @see https://
|
579
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/create-directory
|
581
580
|
*
|
582
581
|
* @param options - Options to Directory Create operation.
|
583
582
|
* @returns Response data for the Directory operation.
|
@@ -585,21 +584,20 @@ export class ShareDirectoryClient extends StorageClient {
|
|
585
584
|
async create(options = {}) {
|
586
585
|
if (!options.fileAttributes) {
|
587
586
|
options = validateAndSetDefaultsForFileAndDirectoryCreateCommonOptions(options);
|
588
|
-
// By default set it as a directory.
|
589
|
-
const attributes = new FileSystemAttributes();
|
590
|
-
attributes.directory = true;
|
591
|
-
options.fileAttributes = attributes;
|
592
587
|
}
|
593
588
|
return tracingClient.withSpan("ShareDirectoryClient-create", options, async (updatedOptions) => {
|
594
|
-
|
595
|
-
|
596
|
-
|
589
|
+
var _a, _b, _c;
|
590
|
+
const rawResponse = await this.context.create(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
|
591
|
+
? fileAttributesToString(updatedOptions.fileAttributes)
|
592
|
+
: undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
|
593
|
+
const wrappedRes = Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, fileMode: parseOctalFileMode(rawResponse.fileMode) });
|
594
|
+
return assertResponse(wrappedRes);
|
597
595
|
});
|
598
596
|
}
|
599
597
|
/**
|
600
598
|
* Creates a new directory under the specified share or parent directory if it does not already exists.
|
601
599
|
* If the directory already exists, it is not modified.
|
602
|
-
* @see https://
|
600
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/create-directory
|
603
601
|
*
|
604
602
|
* @param options -
|
605
603
|
*/
|
@@ -620,7 +618,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
620
618
|
}
|
621
619
|
/**
|
622
620
|
* Sets properties on the directory.
|
623
|
-
* @see https://
|
621
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/set-directory-properties
|
624
622
|
*
|
625
623
|
* @param DirectoryProperties - Directory properties. If no values are provided,
|
626
624
|
* existing values will be preserved.
|
@@ -628,9 +626,11 @@ export class ShareDirectoryClient extends StorageClient {
|
|
628
626
|
async setProperties(properties = {}) {
|
629
627
|
properties = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(properties);
|
630
628
|
return tracingClient.withSpan("ShareDirectoryClient-setProperties", properties, async (updatedOptions) => {
|
631
|
-
|
632
|
-
|
633
|
-
|
629
|
+
var _a, _b, _c;
|
630
|
+
const rawResponse = await this.context.setProperties(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
|
631
|
+
? fileAttributesToString(updatedOptions.fileAttributes)
|
632
|
+
: undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
|
633
|
+
return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, fileMode: parseOctalFileMode(rawResponse.fileMode) }));
|
634
634
|
});
|
635
635
|
}
|
636
636
|
/**
|
@@ -652,7 +652,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
652
652
|
}
|
653
653
|
/**
|
654
654
|
* Creates a new subdirectory under this directory.
|
655
|
-
* @see https://
|
655
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/create-directory
|
656
656
|
*
|
657
657
|
* @param directoryName -
|
658
658
|
* @param options - Options to Directory Create operation.
|
@@ -671,7 +671,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
671
671
|
/**
|
672
672
|
* Removes the specified empty sub directory under this directory.
|
673
673
|
* Note that the directory must be empty before it can be deleted.
|
674
|
-
* @see https://
|
674
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-directory
|
675
675
|
*
|
676
676
|
* @param directoryName -
|
677
677
|
* @param options - Options to Directory Delete operation.
|
@@ -685,7 +685,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
685
685
|
}
|
686
686
|
/**
|
687
687
|
* Creates a new file or replaces a file under this directory. Note it only initializes the file with no content.
|
688
|
-
* @see https://
|
688
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/create-file
|
689
689
|
*
|
690
690
|
* @param fileName -
|
691
691
|
* @param size - Specifies the maximum size in bytes for the file, up to 4 TB.
|
@@ -714,7 +714,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
714
714
|
* Delete File is not supported on a share snapshot, which is a read-only copy of
|
715
715
|
* a share. An attempt to perform this operation on a share snapshot will fail with 400 (InvalidQueryParameterValue)
|
716
716
|
*
|
717
|
-
* @see https://
|
717
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-file2
|
718
718
|
*
|
719
719
|
* @param fileName - Name of the file to delete
|
720
720
|
* @param options - Options to File Delete operation.
|
@@ -778,20 +778,21 @@ export class ShareDirectoryClient extends StorageClient {
|
|
778
778
|
* Returns all system properties for the specified directory, and can also be used to check the
|
779
779
|
* existence of a directory. The data returned does not include the files in the directory or any
|
780
780
|
* subdirectories.
|
781
|
-
* @see https://
|
781
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/get-directory-properties
|
782
782
|
*
|
783
783
|
* @param options - Options to Directory Get Properties operation.
|
784
784
|
* @returns Response data for the Directory Get Properties operation.
|
785
785
|
*/
|
786
786
|
async getProperties(options = {}) {
|
787
787
|
return tracingClient.withSpan("ShareDirectoryClient-getProperties", options, async (updatedOptions) => {
|
788
|
-
|
788
|
+
const rawResponse = await this.context.getProperties(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
|
789
|
+
return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, fileMode: parseOctalFileMode(rawResponse.fileMode) }));
|
789
790
|
});
|
790
791
|
}
|
791
792
|
/**
|
792
793
|
* Removes the specified empty directory. Note that the directory must be empty before it can be
|
793
794
|
* deleted.
|
794
|
-
* @see https://
|
795
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-directory
|
795
796
|
*
|
796
797
|
* @param options - Options to Directory Delete operation.
|
797
798
|
* @returns Response data for the Directory Delete operation.
|
@@ -804,7 +805,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
804
805
|
/**
|
805
806
|
* Removes the specified empty directory if it exists. Note that the directory must be empty before it can be
|
806
807
|
* deleted.
|
807
|
-
* @see https://
|
808
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-directory
|
808
809
|
*
|
809
810
|
* @param options -
|
810
811
|
*/
|
@@ -826,7 +827,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
826
827
|
}
|
827
828
|
/**
|
828
829
|
* Updates user defined metadata for the specified directory.
|
829
|
-
* @see https://
|
830
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/set-directory-metadata
|
830
831
|
*
|
831
832
|
* @param metadata - If no metadata provided, all existing directory metadata will be removed
|
832
833
|
* @param options - Options to Directory Set Metadata operation.
|
@@ -1030,7 +1031,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1030
1031
|
/**
|
1031
1032
|
* Returns a list of files or directories under the specified share or directory. It lists the
|
1032
1033
|
* contents only for a single level of the directory hierarchy.
|
1033
|
-
* @see https://
|
1034
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/list-directories-and-files
|
1034
1035
|
*
|
1035
1036
|
* @param marker - A string value that identifies the portion of the list to be returned with the next list operation.
|
1036
1037
|
* @param options - Options to Directory List Files and Directories Segment operation.
|
@@ -1200,7 +1201,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1200
1201
|
}
|
1201
1202
|
/**
|
1202
1203
|
* Lists handles for a directory.
|
1203
|
-
* @see https://
|
1204
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/list-handles
|
1204
1205
|
*
|
1205
1206
|
* @param marker - Optional. A string value that identifies the portion of the list to be
|
1206
1207
|
* returned with the next list handles operation. The operation returns a
|
@@ -1224,7 +1225,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1224
1225
|
}
|
1225
1226
|
/**
|
1226
1227
|
* Force close all handles for a directory.
|
1227
|
-
* @see https://
|
1228
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/force-close-handles
|
1228
1229
|
*
|
1229
1230
|
* @param marker - Optional. A string value that identifies the position of handles that will
|
1230
1231
|
* be closed with the next force close handles operation.
|
@@ -1245,7 +1246,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1245
1246
|
}
|
1246
1247
|
/**
|
1247
1248
|
* Force close all handles for a directory.
|
1248
|
-
* @see https://
|
1249
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/force-close-handles
|
1249
1250
|
*
|
1250
1251
|
* @param options -
|
1251
1252
|
*/
|
@@ -1272,7 +1273,7 @@ export class ShareDirectoryClient extends StorageClient {
|
|
1272
1273
|
}
|
1273
1274
|
/**
|
1274
1275
|
* Force close a specific handle for a directory.
|
1275
|
-
* @see https://
|
1276
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/force-close-handles
|
1276
1277
|
*
|
1277
1278
|
* @param aborter - Create a new Aborter instance with Aborter.none or Aborter.timeout(),
|
1278
1279
|
* goto documents of Aborter for more examples about request cancellation
|
@@ -1403,7 +1404,7 @@ export class ShareFileClient extends StorageClient {
|
|
1403
1404
|
}
|
1404
1405
|
/**
|
1405
1406
|
* Creates a new file or replaces a file. Note it only initializes the file with no content.
|
1406
|
-
* @see https://
|
1407
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/create-file
|
1407
1408
|
*
|
1408
1409
|
* @param size - Specifies the maximum size in bytes for the file, up to 4 TB.
|
1409
1410
|
* @param options - Options to File Create operation.
|
@@ -1430,9 +1431,12 @@ export class ShareFileClient extends StorageClient {
|
|
1430
1431
|
options = validateAndSetDefaultsForFileAndDirectoryCreateCommonOptions(options);
|
1431
1432
|
options.fileHttpHeaders = options.fileHttpHeaders || {};
|
1432
1433
|
return tracingClient.withSpan("ShareFileClient-create", options, async (updatedOptions) => {
|
1433
|
-
|
1434
|
-
|
1435
|
-
|
1434
|
+
var _a, _b, _c, _d;
|
1435
|
+
const rawResponse = await this.context.create(size, Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
|
1436
|
+
? fileAttributesToString(updatedOptions.fileAttributes)
|
1437
|
+
: undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode), nfsFileType: (_d = updatedOptions.posixProperties) === null || _d === void 0 ? void 0 : _d.fileType }), this.shareClientConfig));
|
1438
|
+
const wrappedRes = Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, fileMode: parseOctalFileMode(rawResponse.fileMode) });
|
1439
|
+
return assertResponse(wrappedRes);
|
1436
1440
|
});
|
1437
1441
|
}
|
1438
1442
|
/**
|
@@ -1441,7 +1445,7 @@ export class ShareFileClient extends StorageClient {
|
|
1441
1445
|
* * In Node.js, data returns in a Readable stream `readableStreamBody`
|
1442
1446
|
* * In browsers, data returns in a promise `contentAsBlob`
|
1443
1447
|
*
|
1444
|
-
* @see https://
|
1448
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/get-file
|
1445
1449
|
*
|
1446
1450
|
* @param offset - From which position of the file to download, greater than or equal to 0
|
1447
1451
|
* @param count - How much data to be downloaded, greater than 0. Will download to the end when undefined
|
@@ -1502,9 +1506,10 @@ export class ShareFileClient extends StorageClient {
|
|
1502
1506
|
throw new RangeError(`rangeGetContentMD5 only works with partial data downloading`);
|
1503
1507
|
}
|
1504
1508
|
const downloadFullFile = offset === 0 && !count;
|
1505
|
-
const
|
1509
|
+
const rawResponse = await this.context.download(Object.assign(Object.assign(Object.assign({}, updatedOptions), { requestOptions: {
|
1506
1510
|
onDownloadProgress: isNode ? undefined : updatedOptions.onProgress, // for Node.js, progress is reported by RetriableReadableStream
|
1507
|
-
}, range: downloadFullFile ? undefined : rangeToString({ offset, count }) }), this.shareClientConfig))
|
1511
|
+
}, range: downloadFullFile ? undefined : rangeToString({ offset, count }) }), this.shareClientConfig));
|
1512
|
+
const res = assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, fileMode: parseOctalFileMode(rawResponse.fileMode) }));
|
1508
1513
|
// Return browser response immediately
|
1509
1514
|
if (!isNode) {
|
1510
1515
|
return res;
|
@@ -1571,19 +1576,20 @@ export class ShareFileClient extends StorageClient {
|
|
1571
1576
|
/**
|
1572
1577
|
* Returns all user-defined metadata, standard HTTP properties, and system properties
|
1573
1578
|
* for the file. It does not return the content of the file.
|
1574
|
-
* @see https://
|
1579
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/get-file-properties
|
1575
1580
|
*
|
1576
1581
|
* @param options - Options to File Get Properties operation.
|
1577
1582
|
* @returns Response data for the File Get Properties operation.
|
1578
1583
|
*/
|
1579
1584
|
async getProperties(options = {}) {
|
1580
1585
|
return tracingClient.withSpan("ShareFileClient-getProperties", options, async (updatedOptions) => {
|
1581
|
-
|
1586
|
+
const rawResponse = await this.context.getProperties(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
|
1587
|
+
return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, fileMode: parseOctalFileMode(rawResponse.fileMode) }));
|
1582
1588
|
});
|
1583
1589
|
}
|
1584
1590
|
/**
|
1585
1591
|
* Sets properties on the file.
|
1586
|
-
* @see https://
|
1592
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/set-file-properties
|
1587
1593
|
*
|
1588
1594
|
* @param properties - File properties. For file HTTP headers(e.g. Content-Type),
|
1589
1595
|
* if no values are provided, existing HTTP headers will be removed.
|
@@ -1594,9 +1600,11 @@ export class ShareFileClient extends StorageClient {
|
|
1594
1600
|
properties = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(properties);
|
1595
1601
|
properties.fileHttpHeaders = properties.fileHttpHeaders || {};
|
1596
1602
|
return tracingClient.withSpan("ShareFileClient-setProperties", properties, async (updatedOptions) => {
|
1597
|
-
|
1598
|
-
|
1599
|
-
|
1603
|
+
var _a, _b, _c;
|
1604
|
+
const rawResponse = await this.context.setHttpHeaders(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileAttributes: updatedOptions.fileAttributes
|
1605
|
+
? fileAttributesToString(updatedOptions.fileAttributes)
|
1606
|
+
: undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
|
1607
|
+
return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, fileMode: parseOctalFileMode(rawResponse.fileMode) }));
|
1600
1608
|
});
|
1601
1609
|
}
|
1602
1610
|
/**
|
@@ -1611,7 +1619,7 @@ export class ShareFileClient extends StorageClient {
|
|
1611
1619
|
* Delete File is not supported on a share snapshot, which is a read-only copy of
|
1612
1620
|
* a share. An attempt to perform this operation on a share snapshot will fail with 400 (InvalidQueryParameterValue)
|
1613
1621
|
*
|
1614
|
-
* @see https://
|
1622
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-file2
|
1615
1623
|
*
|
1616
1624
|
* @param options - Options to File Delete operation.
|
1617
1625
|
* @returns Response data for the File Delete operation.
|
@@ -1633,7 +1641,7 @@ export class ShareFileClient extends StorageClient {
|
|
1633
1641
|
* Delete File is not supported on a share snapshot, which is a read-only copy of
|
1634
1642
|
* a share. An attempt to perform this operation on a share snapshot will fail with 400 (InvalidQueryParameterValue)
|
1635
1643
|
*
|
1636
|
-
* @see https://
|
1644
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-file2
|
1637
1645
|
*
|
1638
1646
|
* @param options -
|
1639
1647
|
*/
|
@@ -1658,7 +1666,7 @@ export class ShareFileClient extends StorageClient {
|
|
1658
1666
|
*
|
1659
1667
|
* If no option provided, or no value provided for the file HTTP headers in the options,
|
1660
1668
|
* these file HTTP headers without a value will be cleared.
|
1661
|
-
* @see https://
|
1669
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/set-file-properties
|
1662
1670
|
*
|
1663
1671
|
* @param FileHttpHeaders - File HTTP headers like Content-Type.
|
1664
1672
|
* Provide undefined will remove existing HTTP headers.
|
@@ -1669,15 +1677,17 @@ export class ShareFileClient extends StorageClient {
|
|
1669
1677
|
// FileAttributes, filePermission, createTime, lastWriteTime will all be preserved
|
1670
1678
|
options = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(options);
|
1671
1679
|
return tracingClient.withSpan("ShareFileClient-setHTTPHeaders", options, async (updatedOptions) => {
|
1672
|
-
|
1673
|
-
|
1674
|
-
|
1680
|
+
var _a, _b, _c;
|
1681
|
+
const rawResponse = await this.context.setHttpHeaders(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileHttpHeaders, fileCreatedOn: fileCreationTimeToString(updatedOptions.creationTime), fileLastWriteOn: fileLastWriteTimeToString(updatedOptions.lastWriteTime), fileChangeOn: fileChangeTimeToString(updatedOptions.changeTime), fileAttributes: updatedOptions.fileAttributes
|
1682
|
+
? fileAttributesToString(updatedOptions.fileAttributes)
|
1683
|
+
: undefined, owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
|
1684
|
+
return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, fileMode: parseOctalFileMode(rawResponse.fileMode) }));
|
1675
1685
|
});
|
1676
1686
|
}
|
1677
1687
|
/**
|
1678
1688
|
* Resize file.
|
1679
1689
|
*
|
1680
|
-
* @see https://
|
1690
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/set-file-properties
|
1681
1691
|
*
|
1682
1692
|
* @param length - Resizes a file to the specified size in bytes.
|
1683
1693
|
* If the specified byte value is less than the current size of the file,
|
@@ -1692,7 +1702,9 @@ export class ShareFileClient extends StorageClient {
|
|
1692
1702
|
// FileAttributes, filePermission, createTime, lastWriteTime will all be preserved.
|
1693
1703
|
options = validateAndSetDefaultsForFileAndDirectorySetPropertiesCommonOptions(options);
|
1694
1704
|
return tracingClient.withSpan("ShareFileClient-resize", options, async (updatedOptions) => {
|
1695
|
-
|
1705
|
+
var _a, _b, _c;
|
1706
|
+
const rawResponse = await this.context.setHttpHeaders(Object.assign(Object.assign(Object.assign({}, updatedOptions), { fileContentLength: length, fileChangeOn: fileChangeTimeToString(options.changeTime), fileCreatedOn: fileCreationTimeToString(options.creationTime), fileLastWriteOn: fileLastWriteTimeToString(options.lastWriteTime), fileAttributes: fileAttributesToString(updatedOptions.fileAttributes), owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = options.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode) }), this.shareClientConfig));
|
1707
|
+
return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, fileMode: parseOctalFileMode(rawResponse.fileMode) }));
|
1696
1708
|
});
|
1697
1709
|
}
|
1698
1710
|
/**
|
@@ -1700,7 +1712,7 @@ export class ShareFileClient extends StorageClient {
|
|
1700
1712
|
*
|
1701
1713
|
* If no metadata defined in the option parameter, the file
|
1702
1714
|
* metadata will be removed.
|
1703
|
-
* @see https://
|
1715
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/set-file-metadata
|
1704
1716
|
*
|
1705
1717
|
* @param metadata - If no metadata provided, all existing directory metadata will be removed
|
1706
1718
|
* @param options - Options to File Set Metadata operation.
|
@@ -1831,13 +1843,14 @@ export class ShareFileClient extends StorageClient {
|
|
1831
1843
|
*/
|
1832
1844
|
async startCopyFromURL(copySource, options = {}) {
|
1833
1845
|
return tracingClient.withSpan("ShareFileClient-startCopyFromURL", options, async (updatedOptions) => {
|
1834
|
-
|
1846
|
+
var _a, _b, _c;
|
1847
|
+
return assertResponse(await this.context.startCopy(copySource, Object.assign(Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig), { owner: (_a = updatedOptions.posixProperties) === null || _a === void 0 ? void 0 : _a.owner, group: (_b = updatedOptions.posixProperties) === null || _b === void 0 ? void 0 : _b.group, fileMode: toOctalFileMode((_c = updatedOptions.posixProperties) === null || _c === void 0 ? void 0 : _c.fileMode), fileModeCopyMode: updatedOptions.fileModeCopyMode, fileOwnerCopyMode: updatedOptions.fileOwnerCopyMode })));
|
1835
1848
|
});
|
1836
1849
|
}
|
1837
1850
|
/**
|
1838
1851
|
* Aborts a pending Copy File operation, and leaves a destination file with zero length and full
|
1839
1852
|
* metadata.
|
1840
|
-
* @see https://
|
1853
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/abort-copy-file
|
1841
1854
|
*
|
1842
1855
|
* @param copyId - Id of the Copy File operation to abort.
|
1843
1856
|
* @param options - Options to File Abort Copy From URL operation.
|
@@ -2170,7 +2183,7 @@ export class ShareFileClient extends StorageClient {
|
|
2170
2183
|
}
|
2171
2184
|
/**
|
2172
2185
|
* Lists handles for a file.
|
2173
|
-
* @see https://
|
2186
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/list-handles
|
2174
2187
|
*
|
2175
2188
|
* @param marker - Optional. A string value that identifies the portion of the list to be
|
2176
2189
|
* returned with the next list handles operation. The operation returns a
|
@@ -2280,7 +2293,7 @@ export class ShareFileClient extends StorageClient {
|
|
2280
2293
|
}
|
2281
2294
|
/**
|
2282
2295
|
* Force close all handles for a file.
|
2283
|
-
* @see https://
|
2296
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/force-close-handles
|
2284
2297
|
*
|
2285
2298
|
* @param marker - Optional. A string value that identifies the position of handles that will
|
2286
2299
|
* be closed with the next force close handles operation.
|
@@ -2301,7 +2314,7 @@ export class ShareFileClient extends StorageClient {
|
|
2301
2314
|
}
|
2302
2315
|
/**
|
2303
2316
|
* Force close all handles for a file.
|
2304
|
-
* @see https://
|
2317
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/force-close-handles
|
2305
2318
|
*
|
2306
2319
|
* @param options - Options to force close handles operation.
|
2307
2320
|
*/
|
@@ -2328,7 +2341,7 @@ export class ShareFileClient extends StorageClient {
|
|
2328
2341
|
}
|
2329
2342
|
/**
|
2330
2343
|
* Force close a specific handle for a file.
|
2331
|
-
* @see https://
|
2344
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/force-close-handles
|
2332
2345
|
*
|
2333
2346
|
* @param handleId - Specific handle ID, cannot be asterisk "*".
|
2334
2347
|
* Use forceCloseAllHandles() to close all handles.
|
@@ -2346,6 +2359,18 @@ export class ShareFileClient extends StorageClient {
|
|
2346
2359
|
return response;
|
2347
2360
|
});
|
2348
2361
|
}
|
2362
|
+
/**
|
2363
|
+
* NFS only. Creates a hard link to the file file specified by path.
|
2364
|
+
* @param targetFile - Path of the file to create the hard link to, not including the share.
|
2365
|
+
* For example: "targetDirectory/targetSubDirectory/.../targetFile"
|
2366
|
+
* @param options - Options to create hard link operation.
|
2367
|
+
*/
|
2368
|
+
async createHardLink(targetFile, options = {}) {
|
2369
|
+
return tracingClient.withSpan("ShareFileClient-createHardLink", options, async (updatedOptions) => {
|
2370
|
+
const rawResponse = await this.context.createHardLink(targetFile, Object.assign(Object.assign({}, updatedOptions), this.shareClientConfig));
|
2371
|
+
return assertResponse(Object.assign(Object.assign({}, rawResponse), { _response: rawResponse._response, fileMode: parseOctalFileMode(rawResponse.fileMode) }));
|
2372
|
+
});
|
2373
|
+
}
|
2349
2374
|
/**
|
2350
2375
|
* Get a {@link ShareLeaseClient} that manages leases on the file.
|
2351
2376
|
*
|
@@ -2361,7 +2386,7 @@ export class ShareFileClient extends StorageClient {
|
|
2361
2386
|
* Generates a Service Shared Access Signature (SAS) URI based on the client properties
|
2362
2387
|
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
2363
2388
|
*
|
2364
|
-
* @see https://
|
2389
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
|
2365
2390
|
*
|
2366
2391
|
* @param options - Optional parameters.
|
2367
2392
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
@@ -2379,7 +2404,7 @@ export class ShareFileClient extends StorageClient {
|
|
2379
2404
|
* Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties
|
2380
2405
|
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
2381
2406
|
*
|
2382
|
-
* @see https://
|
2407
|
+
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas
|
2383
2408
|
*
|
2384
2409
|
* @param options - Optional parameters.
|
2385
2410
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
@@ -2449,9 +2474,9 @@ export class ShareFileClient extends StorageClient {
|
|
2449
2474
|
}
|
2450
2475
|
/**
|
2451
2476
|
* A client that manages leases for a {@link ShareFileClient} or {@link ShareClient}.
|
2452
|
-
* @see https://
|
2477
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/lease-file
|
2453
2478
|
* and
|
2454
|
-
* @see https://
|
2479
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/lease-share
|
2455
2480
|
*/
|
2456
2481
|
export class ShareLeaseClient {
|
2457
2482
|
/**
|