@azure/storage-file-datalake 12.27.0-beta.1 → 12.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/DataLakeFileSystemClient.d.ts +13 -13
- package/dist/browser/DataLakeFileSystemClient.js +136 -93
- package/dist/browser/DataLakeFileSystemClient.js.map +1 -1
- package/dist/browser/DataLakeLeaseClient.js +1 -0
- package/dist/browser/DataLakeLeaseClient.js.map +1 -1
- package/dist/browser/DataLakeServiceClient.d.ts +6 -6
- package/dist/browser/DataLakeServiceClient.js +28 -11
- package/dist/browser/DataLakeServiceClient.js.map +1 -1
- package/dist/browser/Pipeline.js +24 -15
- package/dist/browser/Pipeline.js.map +1 -1
- package/dist/browser/StorageClient.js +43 -3
- package/dist/browser/StorageClient.js.map +1 -1
- package/dist/browser/StorageContextClient.js +2 -3
- package/dist/browser/StorageContextClient.js.map +1 -1
- package/dist/browser/clients.d.ts +33 -33
- package/dist/browser/clients.js +269 -89
- package/dist/browser/clients.js.map +1 -1
- package/dist/browser/generated/src/operations/fileSystemOperations.js +1 -0
- package/dist/browser/generated/src/operations/fileSystemOperations.js.map +1 -1
- package/dist/browser/generated/src/operations/pathOperations.js +1 -0
- package/dist/browser/generated/src/operations/pathOperations.js.map +1 -1
- package/dist/browser/generated/src/operations/service.js +1 -0
- package/dist/browser/generated/src/operations/service.js.map +1 -1
- package/dist/browser/generated/src/storageClient.js +15 -4
- package/dist/browser/generated/src/storageClient.js.map +1 -1
- package/dist/browser/index-browser.d.mts.map +1 -1
- package/dist/browser/index-browser.mjs.map +1 -1
- package/dist/browser/index.d.ts +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/models.d.ts +1 -1
- package/dist/browser/models.js.map +1 -1
- package/dist/browser/sas/AccountSASPermissions.d.ts +1 -1
- package/dist/browser/sas/AccountSASPermissions.js +34 -36
- package/dist/browser/sas/AccountSASPermissions.js.map +1 -1
- package/dist/browser/sas/AccountSASResourceTypes.d.ts +1 -1
- package/dist/browser/sas/AccountSASResourceTypes.js +13 -15
- package/dist/browser/sas/AccountSASResourceTypes.js.map +1 -1
- package/dist/browser/sas/AccountSASServices.js +16 -18
- package/dist/browser/sas/AccountSASServices.js.map +1 -1
- package/dist/browser/sas/AccountSASSignatureValues.d.ts +3 -3
- package/dist/browser/sas/AccountSASSignatureValues.js +1 -1
- package/dist/browser/sas/AccountSASSignatureValues.js.map +1 -1
- package/dist/browser/sas/DataLakeSASPermissions.js +39 -41
- package/dist/browser/sas/DataLakeSASPermissions.js.map +1 -1
- package/dist/browser/sas/DataLakeSASSignatureValues.d.ts +1 -1
- package/dist/browser/sas/DataLakeSASSignatureValues.js +4 -3
- package/dist/browser/sas/DataLakeSASSignatureValues.js.map +1 -1
- package/dist/browser/sas/DirectorySASPermissions.d.ts +1 -1
- package/dist/browser/sas/DirectorySASPermissions.js +44 -46
- package/dist/browser/sas/DirectorySASPermissions.js.map +1 -1
- package/dist/browser/sas/FileSystemSASPermissions.d.ts +1 -1
- package/dist/browser/sas/FileSystemSASPermissions.js +44 -46
- package/dist/browser/sas/FileSystemSASPermissions.js.map +1 -1
- package/dist/browser/sas/SASQueryParameters.d.ts +2 -2
- package/dist/browser/sas/SASQueryParameters.js +131 -2
- package/dist/browser/sas/SASQueryParameters.js.map +1 -1
- package/dist/browser/transforms.js +8 -1
- package/dist/browser/transforms.js.map +1 -1
- package/dist/browser/utils/Batch.js +29 -21
- package/dist/browser/utils/Batch.js.map +1 -1
- package/dist/browser/utils/BufferScheduler.js +70 -44
- package/dist/browser/utils/BufferScheduler.js.map +1 -1
- package/dist/browser/utils/DataLakeAclChangeFailedError.js +8 -0
- package/dist/browser/utils/DataLakeAclChangeFailedError.js.map +1 -1
- package/dist/browser/utils/PathClientInternal.js +4 -0
- package/dist/browser/utils/PathClientInternal.js.map +1 -1
- package/dist/browser/utils/constants.d.ts.map +1 -1
- package/dist/browser/utils/constants.js +1 -1
- package/dist/browser/utils/constants.js.map +1 -1
- package/dist/browser/utils/utils.common.d.ts +2 -2
- package/dist/browser/utils/utils.common.js +5 -7
- package/dist/browser/utils/utils.common.js.map +1 -1
- package/dist/commonjs/DataLakeFileSystemClient.d.ts +13 -13
- package/dist/commonjs/DataLakeFileSystemClient.js +136 -93
- package/dist/commonjs/DataLakeFileSystemClient.js.map +1 -1
- package/dist/commonjs/DataLakeLeaseClient.js +1 -0
- package/dist/commonjs/DataLakeLeaseClient.js.map +1 -1
- package/dist/commonjs/DataLakeServiceClient.d.ts +6 -6
- package/dist/commonjs/DataLakeServiceClient.js +28 -11
- package/dist/commonjs/DataLakeServiceClient.js.map +1 -1
- package/dist/commonjs/Pipeline.js +32 -23
- package/dist/commonjs/Pipeline.js.map +1 -1
- package/dist/commonjs/StorageClient.js +43 -3
- package/dist/commonjs/StorageClient.js.map +1 -1
- package/dist/commonjs/StorageContextClient.js +2 -3
- package/dist/commonjs/StorageContextClient.js.map +1 -1
- package/dist/commonjs/clients.d.ts +33 -33
- package/dist/commonjs/clients.js +269 -89
- package/dist/commonjs/clients.js.map +1 -1
- package/dist/commonjs/credentials/UserDelegationKeyCredential.d.ts +1 -1
- package/dist/commonjs/credentials/UserDelegationKeyCredential.js +13 -1
- package/dist/commonjs/credentials/UserDelegationKeyCredential.js.map +1 -1
- package/dist/commonjs/generated/src/operations/fileSystemOperations.js +1 -0
- package/dist/commonjs/generated/src/operations/fileSystemOperations.js.map +1 -1
- package/dist/commonjs/generated/src/operations/pathOperations.js +1 -0
- package/dist/commonjs/generated/src/operations/pathOperations.js.map +1 -1
- package/dist/commonjs/generated/src/operations/service.js +1 -0
- package/dist/commonjs/generated/src/operations/service.js.map +1 -1
- package/dist/commonjs/generated/src/storageClient.js +15 -4
- package/dist/commonjs/generated/src/storageClient.js.map +1 -1
- package/dist/commonjs/models.d.ts +1 -1
- package/dist/commonjs/models.js.map +1 -1
- package/dist/commonjs/sas/AccountSASPermissions.d.ts +1 -1
- package/dist/commonjs/sas/AccountSASPermissions.js +34 -36
- package/dist/commonjs/sas/AccountSASPermissions.js.map +1 -1
- package/dist/commonjs/sas/AccountSASResourceTypes.d.ts +1 -1
- package/dist/commonjs/sas/AccountSASResourceTypes.js +13 -15
- package/dist/commonjs/sas/AccountSASResourceTypes.js.map +1 -1
- package/dist/commonjs/sas/AccountSASServices.js +16 -18
- package/dist/commonjs/sas/AccountSASServices.js.map +1 -1
- package/dist/commonjs/sas/AccountSASSignatureValues.d.ts +3 -3
- package/dist/commonjs/sas/AccountSASSignatureValues.js +1 -1
- package/dist/commonjs/sas/AccountSASSignatureValues.js.map +1 -1
- package/dist/commonjs/sas/DataLakeSASPermissions.js +39 -41
- package/dist/commonjs/sas/DataLakeSASPermissions.js.map +1 -1
- package/dist/commonjs/sas/DataLakeSASSignatureValues.d.ts +1 -1
- package/dist/commonjs/sas/DataLakeSASSignatureValues.js +4 -3
- package/dist/commonjs/sas/DataLakeSASSignatureValues.js.map +1 -1
- package/dist/commonjs/sas/DirectorySASPermissions.d.ts +1 -1
- package/dist/commonjs/sas/DirectorySASPermissions.js +44 -46
- package/dist/commonjs/sas/DirectorySASPermissions.js.map +1 -1
- package/dist/commonjs/sas/FileSystemSASPermissions.d.ts +1 -1
- package/dist/commonjs/sas/FileSystemSASPermissions.js +44 -46
- package/dist/commonjs/sas/FileSystemSASPermissions.js.map +1 -1
- package/dist/commonjs/sas/SASQueryParameters.d.ts +2 -2
- package/dist/commonjs/sas/SASQueryParameters.js +131 -2
- package/dist/commonjs/sas/SASQueryParameters.js.map +1 -1
- package/dist/commonjs/transforms.js +8 -1
- package/dist/commonjs/transforms.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/commonjs/utils/Batch.js +29 -21
- package/dist/commonjs/utils/Batch.js.map +1 -1
- package/dist/commonjs/utils/BufferScheduler.js +70 -44
- package/dist/commonjs/utils/BufferScheduler.js.map +1 -1
- package/dist/commonjs/utils/DataLakeAclChangeFailedError.js +8 -0
- package/dist/commonjs/utils/DataLakeAclChangeFailedError.js.map +1 -1
- package/dist/commonjs/utils/PathClientInternal.js +4 -0
- package/dist/commonjs/utils/PathClientInternal.js.map +1 -1
- package/dist/commonjs/utils/constants.d.ts.map +1 -1
- package/dist/commonjs/utils/constants.js +1 -1
- package/dist/commonjs/utils/constants.js.map +1 -1
- package/dist/commonjs/utils/utils.common.d.ts +2 -2
- package/dist/commonjs/utils/utils.common.js +5 -7
- package/dist/commonjs/utils/utils.common.js.map +1 -1
- package/dist/commonjs/utils/utils.d.ts +1 -1
- package/dist/commonjs/utils/utils.d.ts.map +1 -1
- package/dist/commonjs/utils/utils.js +4 -4
- package/dist/commonjs/utils/utils.js.map +1 -1
- package/dist/esm/DataLakeFileSystemClient.d.ts +13 -13
- package/dist/esm/DataLakeFileSystemClient.js +136 -93
- package/dist/esm/DataLakeFileSystemClient.js.map +1 -1
- package/dist/esm/DataLakeLeaseClient.js +1 -0
- package/dist/esm/DataLakeLeaseClient.js.map +1 -1
- package/dist/esm/DataLakeServiceClient.d.ts +6 -6
- package/dist/esm/DataLakeServiceClient.js +28 -11
- package/dist/esm/DataLakeServiceClient.js.map +1 -1
- package/dist/esm/Pipeline.js +24 -15
- package/dist/esm/Pipeline.js.map +1 -1
- package/dist/esm/StorageClient.js +43 -3
- package/dist/esm/StorageClient.js.map +1 -1
- package/dist/esm/StorageContextClient.js +2 -3
- package/dist/esm/StorageContextClient.js.map +1 -1
- package/dist/esm/clients.d.ts +33 -33
- package/dist/esm/clients.js +269 -89
- package/dist/esm/clients.js.map +1 -1
- package/dist/esm/credentials/UserDelegationKeyCredential.d.ts +1 -1
- package/dist/esm/credentials/UserDelegationKeyCredential.js +13 -1
- package/dist/esm/credentials/UserDelegationKeyCredential.js.map +1 -1
- package/dist/esm/generated/src/operations/fileSystemOperations.js +1 -0
- package/dist/esm/generated/src/operations/fileSystemOperations.js.map +1 -1
- package/dist/esm/generated/src/operations/pathOperations.js +1 -0
- package/dist/esm/generated/src/operations/pathOperations.js.map +1 -1
- package/dist/esm/generated/src/operations/service.js +1 -0
- package/dist/esm/generated/src/operations/service.js.map +1 -1
- package/dist/esm/generated/src/storageClient.js +15 -4
- package/dist/esm/generated/src/storageClient.js.map +1 -1
- package/dist/esm/models.d.ts +1 -1
- package/dist/esm/models.js.map +1 -1
- package/dist/esm/sas/AccountSASPermissions.d.ts +1 -1
- package/dist/esm/sas/AccountSASPermissions.js +34 -36
- package/dist/esm/sas/AccountSASPermissions.js.map +1 -1
- package/dist/esm/sas/AccountSASResourceTypes.d.ts +1 -1
- package/dist/esm/sas/AccountSASResourceTypes.js +13 -15
- package/dist/esm/sas/AccountSASResourceTypes.js.map +1 -1
- package/dist/esm/sas/AccountSASServices.js +16 -18
- package/dist/esm/sas/AccountSASServices.js.map +1 -1
- package/dist/esm/sas/AccountSASSignatureValues.d.ts +3 -3
- package/dist/esm/sas/AccountSASSignatureValues.js +1 -1
- package/dist/esm/sas/AccountSASSignatureValues.js.map +1 -1
- package/dist/esm/sas/DataLakeSASPermissions.js +39 -41
- package/dist/esm/sas/DataLakeSASPermissions.js.map +1 -1
- package/dist/esm/sas/DataLakeSASSignatureValues.d.ts +1 -1
- package/dist/esm/sas/DataLakeSASSignatureValues.js +4 -3
- package/dist/esm/sas/DataLakeSASSignatureValues.js.map +1 -1
- package/dist/esm/sas/DirectorySASPermissions.d.ts +1 -1
- package/dist/esm/sas/DirectorySASPermissions.js +44 -46
- package/dist/esm/sas/DirectorySASPermissions.js.map +1 -1
- package/dist/esm/sas/FileSystemSASPermissions.d.ts +1 -1
- package/dist/esm/sas/FileSystemSASPermissions.js +44 -46
- package/dist/esm/sas/FileSystemSASPermissions.js.map +1 -1
- package/dist/esm/sas/SASQueryParameters.d.ts +2 -2
- package/dist/esm/sas/SASQueryParameters.js +131 -2
- package/dist/esm/sas/SASQueryParameters.js.map +1 -1
- package/dist/esm/transforms.js +8 -1
- package/dist/esm/transforms.js.map +1 -1
- package/dist/esm/utils/Batch.js +29 -21
- package/dist/esm/utils/Batch.js.map +1 -1
- package/dist/esm/utils/BufferScheduler.js +70 -44
- package/dist/esm/utils/BufferScheduler.js.map +1 -1
- package/dist/esm/utils/DataLakeAclChangeFailedError.js +8 -0
- package/dist/esm/utils/DataLakeAclChangeFailedError.js.map +1 -1
- package/dist/esm/utils/PathClientInternal.js +4 -0
- package/dist/esm/utils/PathClientInternal.js.map +1 -1
- package/dist/esm/utils/constants.d.ts.map +1 -1
- package/dist/esm/utils/constants.js +1 -1
- package/dist/esm/utils/constants.js.map +1 -1
- package/dist/esm/utils/utils.common.d.ts +2 -2
- package/dist/esm/utils/utils.common.js +5 -7
- package/dist/esm/utils/utils.common.js.map +1 -1
- package/dist/esm/utils/utils.d.ts +1 -1
- package/dist/esm/utils/utils.d.ts.map +1 -1
- package/dist/esm/utils/utils.js +2 -2
- package/dist/esm/utils/utils.js.map +1 -1
- package/dist/react-native/DataLakeFileSystemClient.d.ts +13 -13
- package/dist/react-native/DataLakeFileSystemClient.js +136 -93
- package/dist/react-native/DataLakeFileSystemClient.js.map +1 -1
- package/dist/react-native/DataLakeLeaseClient.js +1 -0
- package/dist/react-native/DataLakeLeaseClient.js.map +1 -1
- package/dist/react-native/DataLakeServiceClient.d.ts +6 -6
- package/dist/react-native/DataLakeServiceClient.js +28 -11
- package/dist/react-native/DataLakeServiceClient.js.map +1 -1
- package/dist/react-native/Pipeline.js +24 -15
- package/dist/react-native/Pipeline.js.map +1 -1
- package/dist/react-native/StorageClient.js +43 -3
- package/dist/react-native/StorageClient.js.map +1 -1
- package/dist/react-native/StorageContextClient.js +2 -3
- package/dist/react-native/StorageContextClient.js.map +1 -1
- package/dist/react-native/clients.d.ts +33 -33
- package/dist/react-native/clients.js +269 -89
- package/dist/react-native/clients.js.map +1 -1
- package/dist/react-native/credentials/UserDelegationKeyCredential.d.ts +1 -1
- package/dist/react-native/credentials/UserDelegationKeyCredential.js +13 -1
- package/dist/react-native/credentials/UserDelegationKeyCredential.js.map +1 -1
- package/dist/react-native/generated/src/operations/fileSystemOperations.js +1 -0
- package/dist/react-native/generated/src/operations/fileSystemOperations.js.map +1 -1
- package/dist/react-native/generated/src/operations/pathOperations.js +1 -0
- package/dist/react-native/generated/src/operations/pathOperations.js.map +1 -1
- package/dist/react-native/generated/src/operations/service.js +1 -0
- package/dist/react-native/generated/src/operations/service.js.map +1 -1
- package/dist/react-native/generated/src/storageClient.js +15 -4
- package/dist/react-native/generated/src/storageClient.js.map +1 -1
- package/dist/react-native/models.d.ts +1 -1
- package/dist/react-native/models.js.map +1 -1
- package/dist/react-native/sas/AccountSASPermissions.d.ts +1 -1
- package/dist/react-native/sas/AccountSASPermissions.js +34 -36
- package/dist/react-native/sas/AccountSASPermissions.js.map +1 -1
- package/dist/react-native/sas/AccountSASResourceTypes.d.ts +1 -1
- package/dist/react-native/sas/AccountSASResourceTypes.js +13 -15
- package/dist/react-native/sas/AccountSASResourceTypes.js.map +1 -1
- package/dist/react-native/sas/AccountSASServices.js +16 -18
- package/dist/react-native/sas/AccountSASServices.js.map +1 -1
- package/dist/react-native/sas/AccountSASSignatureValues.d.ts +3 -3
- package/dist/react-native/sas/AccountSASSignatureValues.js +1 -1
- package/dist/react-native/sas/AccountSASSignatureValues.js.map +1 -1
- package/dist/react-native/sas/DataLakeSASPermissions.js +39 -41
- package/dist/react-native/sas/DataLakeSASPermissions.js.map +1 -1
- package/dist/react-native/sas/DataLakeSASSignatureValues.d.ts +1 -1
- package/dist/react-native/sas/DataLakeSASSignatureValues.js +4 -3
- package/dist/react-native/sas/DataLakeSASSignatureValues.js.map +1 -1
- package/dist/react-native/sas/DirectorySASPermissions.d.ts +1 -1
- package/dist/react-native/sas/DirectorySASPermissions.js +44 -46
- package/dist/react-native/sas/DirectorySASPermissions.js.map +1 -1
- package/dist/react-native/sas/FileSystemSASPermissions.d.ts +1 -1
- package/dist/react-native/sas/FileSystemSASPermissions.js +44 -46
- package/dist/react-native/sas/FileSystemSASPermissions.js.map +1 -1
- package/dist/react-native/sas/SASQueryParameters.d.ts +2 -2
- package/dist/react-native/sas/SASQueryParameters.js +131 -2
- package/dist/react-native/sas/SASQueryParameters.js.map +1 -1
- package/dist/react-native/transforms.js +8 -1
- package/dist/react-native/transforms.js.map +1 -1
- package/dist/react-native/utils/Batch.js +29 -21
- package/dist/react-native/utils/Batch.js.map +1 -1
- package/dist/react-native/utils/BufferScheduler.js +70 -44
- package/dist/react-native/utils/BufferScheduler.js.map +1 -1
- package/dist/react-native/utils/DataLakeAclChangeFailedError.js +8 -0
- package/dist/react-native/utils/DataLakeAclChangeFailedError.js.map +1 -1
- package/dist/react-native/utils/PathClientInternal.js +4 -0
- package/dist/react-native/utils/PathClientInternal.js.map +1 -1
- package/dist/react-native/utils/constants.d.ts.map +1 -1
- package/dist/react-native/utils/constants.js +1 -1
- package/dist/react-native/utils/constants.js.map +1 -1
- package/dist/react-native/utils/utils.common.d.ts +2 -2
- package/dist/react-native/utils/utils.common.js +5 -7
- package/dist/react-native/utils/utils.common.js.map +1 -1
- package/dist/react-native/utils/utils.d.ts +1 -1
- package/dist/react-native/utils/utils.d.ts.map +1 -1
- package/dist/react-native/utils/utils.js +2 -2
- package/dist/react-native/utils/utils.js.map +1 -1
- package/package.json +8 -8
package/dist/esm/clients.js
CHANGED
|
@@ -22,6 +22,15 @@ import { fsCreateReadStream, fsStat } from "./utils/utils.js";
|
|
|
22
22
|
* A DataLakePathClient represents a URL to the Azure Storage path (directory or file).
|
|
23
23
|
*/
|
|
24
24
|
export class DataLakePathClient extends StorageClient {
|
|
25
|
+
/**
|
|
26
|
+
* pathContext provided by protocol layer.
|
|
27
|
+
*/
|
|
28
|
+
pathContext;
|
|
29
|
+
/**
|
|
30
|
+
* blobClient provided by `@azure/storage-blob` package.
|
|
31
|
+
*/
|
|
32
|
+
blobClient;
|
|
33
|
+
isTokenCredential;
|
|
25
34
|
/**
|
|
26
35
|
* SetAccessControlRecursiveInternal operation sets the Access Control on a path and sub paths.
|
|
27
36
|
*
|
|
@@ -47,14 +56,19 @@ export class DataLakePathClient extends StorageClient {
|
|
|
47
56
|
continuationToken: undefined,
|
|
48
57
|
};
|
|
49
58
|
return tracingClient.withSpan("DataLakePathClient-setAccessControlRecursiveInternal", options, async (updatedOptions) => {
|
|
50
|
-
var _a, _b, _c, _d, _e, _f;
|
|
51
59
|
let continuationToken = options.continuationToken;
|
|
52
60
|
let batchCounter = 0;
|
|
53
61
|
let reachMaxBatches = false;
|
|
54
62
|
do {
|
|
55
63
|
let response;
|
|
56
64
|
try {
|
|
57
|
-
response = await this.pathContext.setAccessControlRecursive(mode,
|
|
65
|
+
response = await this.pathContext.setAccessControlRecursive(mode, {
|
|
66
|
+
...updatedOptions,
|
|
67
|
+
acl: toAclString(acl),
|
|
68
|
+
maxRecords: options.batchSize,
|
|
69
|
+
continuation: continuationToken,
|
|
70
|
+
forceFlag: options.continueOnFailure,
|
|
71
|
+
});
|
|
58
72
|
}
|
|
59
73
|
catch (e) {
|
|
60
74
|
throw new DataLakeAclChangeFailedError(e, continuationToken);
|
|
@@ -63,17 +77,17 @@ export class DataLakePathClient extends StorageClient {
|
|
|
63
77
|
continuationToken = response.continuation;
|
|
64
78
|
// Update result
|
|
65
79
|
result.continuationToken = continuationToken;
|
|
66
|
-
result.counters.failedChangesCount +=
|
|
67
|
-
result.counters.changedDirectoriesCount +=
|
|
68
|
-
result.counters.changedFilesCount +=
|
|
80
|
+
result.counters.failedChangesCount += response.failureCount ?? 0;
|
|
81
|
+
result.counters.changedDirectoriesCount += response.directoriesSuccessful ?? 0;
|
|
82
|
+
result.counters.changedFilesCount += response.filesSuccessful ?? 0;
|
|
69
83
|
// Progress event call back
|
|
70
84
|
if (options.onProgress) {
|
|
71
85
|
const progress = {
|
|
72
86
|
batchFailures: toAccessControlChangeFailureArray(response.failedEntries),
|
|
73
87
|
batchCounters: {
|
|
74
|
-
failedChangesCount:
|
|
75
|
-
changedDirectoriesCount:
|
|
76
|
-
changedFilesCount:
|
|
88
|
+
failedChangesCount: response.failureCount ?? 0,
|
|
89
|
+
changedDirectoriesCount: response.directoriesSuccessful ?? 0,
|
|
90
|
+
changedFilesCount: response.filesSuccessful ?? 0,
|
|
77
91
|
},
|
|
78
92
|
aggregateCounters: result.counters,
|
|
79
93
|
continuationToken: continuationToken,
|
|
@@ -152,7 +166,7 @@ export class DataLakePathClient extends StorageClient {
|
|
|
152
166
|
/**
|
|
153
167
|
* Create a directory or path.
|
|
154
168
|
*
|
|
155
|
-
* @see https://learn.microsoft.com/
|
|
169
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/create
|
|
156
170
|
*
|
|
157
171
|
* @param resourceType - Resource type, "directory" or "file".
|
|
158
172
|
* @param options - Optional. Options when creating path.
|
|
@@ -174,29 +188,48 @@ export class DataLakePathClient extends StorageClient {
|
|
|
174
188
|
else if (options.expiresOn) {
|
|
175
189
|
throw new Error(`Value for expiresOn is invalid: ${options.expiresOn}`);
|
|
176
190
|
}
|
|
177
|
-
return assertResponse(await this.pathContext.create(
|
|
178
|
-
|
|
191
|
+
return assertResponse(await this.pathContext.create({
|
|
192
|
+
...updatedOptions,
|
|
193
|
+
resource: resourceType,
|
|
194
|
+
leaseAccessConditions: options.conditions,
|
|
195
|
+
modifiedAccessConditions: options.conditions,
|
|
196
|
+
properties: toProperties(options.metadata),
|
|
197
|
+
cpkInfo: options.customerProvidedKey,
|
|
198
|
+
acl: options.acl ? toAclString(options.acl) : undefined,
|
|
199
|
+
expiryOptions,
|
|
200
|
+
expiresOn,
|
|
201
|
+
}));
|
|
179
202
|
});
|
|
180
203
|
}
|
|
181
204
|
/**
|
|
182
205
|
* Create a directory or file. If the resource already exists, it is not changed.
|
|
183
206
|
*
|
|
184
|
-
* @see https://learn.microsoft.com/
|
|
207
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/create
|
|
185
208
|
*
|
|
186
209
|
* @param resourceType - Resource type, "directory" or "file".
|
|
187
210
|
* @param options -
|
|
188
211
|
*/
|
|
189
212
|
async createIfNotExists(resourceType, options = {}) {
|
|
190
213
|
return tracingClient.withSpan("DataLakePathClient-createIfNotExists", options, async (updatedOptions) => {
|
|
191
|
-
var _a, _b;
|
|
192
214
|
try {
|
|
193
215
|
const conditions = { ifNoneMatch: ETagAny };
|
|
194
|
-
const res = await this.create(resourceType,
|
|
195
|
-
|
|
216
|
+
const res = await this.create(resourceType, {
|
|
217
|
+
...options,
|
|
218
|
+
conditions,
|
|
219
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
220
|
+
});
|
|
221
|
+
return {
|
|
222
|
+
succeeded: true,
|
|
223
|
+
...res,
|
|
224
|
+
};
|
|
196
225
|
}
|
|
197
226
|
catch (e) {
|
|
198
|
-
if (
|
|
199
|
-
return
|
|
227
|
+
if (e.details?.errorCode === "PathAlreadyExists") {
|
|
228
|
+
return {
|
|
229
|
+
succeeded: false,
|
|
230
|
+
...e.response?.parsedHeaders,
|
|
231
|
+
_response: e.response,
|
|
232
|
+
};
|
|
200
233
|
}
|
|
201
234
|
throw e;
|
|
202
235
|
}
|
|
@@ -213,13 +246,16 @@ export class DataLakePathClient extends StorageClient {
|
|
|
213
246
|
*/
|
|
214
247
|
async exists(options = {}) {
|
|
215
248
|
return tracingClient.withSpan("DataLakeFileClient-exists", options, async (updatedOptions) => {
|
|
216
|
-
return this.blobClient.exists(
|
|
249
|
+
return this.blobClient.exists({
|
|
250
|
+
...updatedOptions,
|
|
251
|
+
customerProvidedKey: toBlobCpkInfo(updatedOptions.customerProvidedKey),
|
|
252
|
+
});
|
|
217
253
|
});
|
|
218
254
|
}
|
|
219
255
|
/**
|
|
220
256
|
* Delete current path (directory or file).
|
|
221
257
|
*
|
|
222
|
-
* @see https://learn.microsoft.com/
|
|
258
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/delete
|
|
223
259
|
*
|
|
224
260
|
* @param recursive - Required and valid only when the resource is a directory. If "true", all paths beneath the directory will be deleted.
|
|
225
261
|
* @param options - Optional. Options when deleting path.
|
|
@@ -243,8 +279,15 @@ export class DataLakePathClient extends StorageClient {
|
|
|
243
279
|
let response;
|
|
244
280
|
// How to handle long delete loop?
|
|
245
281
|
do {
|
|
246
|
-
response = assertResponse(await this.pathContext.delete(
|
|
247
|
-
|
|
282
|
+
response = assertResponse(await this.pathContext.delete({
|
|
283
|
+
...updatedOptions,
|
|
284
|
+
continuation,
|
|
285
|
+
recursive,
|
|
286
|
+
leaseAccessConditions: options.conditions,
|
|
287
|
+
modifiedAccessConditions: options.conditions,
|
|
288
|
+
abortSignal: options.abortSignal,
|
|
289
|
+
paginated,
|
|
290
|
+
}));
|
|
248
291
|
continuation = response.continuation;
|
|
249
292
|
} while (continuation);
|
|
250
293
|
return response;
|
|
@@ -253,7 +296,7 @@ export class DataLakePathClient extends StorageClient {
|
|
|
253
296
|
/**
|
|
254
297
|
* Delete current path (directory or file) if it exists.
|
|
255
298
|
*
|
|
256
|
-
* @see https://learn.microsoft.com/
|
|
299
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/delete
|
|
257
300
|
*
|
|
258
301
|
* @param recursive - Required and valid only when the resource is a directory. If "true", all paths beneath the directory will be deleted.
|
|
259
302
|
* @param options -
|
|
@@ -261,14 +304,20 @@ export class DataLakePathClient extends StorageClient {
|
|
|
261
304
|
async deleteIfExists(recursive, options = {}) {
|
|
262
305
|
options.conditions = options.conditions || {};
|
|
263
306
|
return tracingClient.withSpan("DataLakePathClient-deleteIfExists", options, async (updatedOptions) => {
|
|
264
|
-
var _a, _b;
|
|
265
307
|
try {
|
|
266
308
|
const res = await this.delete(recursive, updatedOptions);
|
|
267
|
-
return
|
|
309
|
+
return {
|
|
310
|
+
succeeded: true,
|
|
311
|
+
...res,
|
|
312
|
+
};
|
|
268
313
|
}
|
|
269
314
|
catch (e) {
|
|
270
|
-
if (
|
|
271
|
-
return
|
|
315
|
+
if (e.details?.errorCode === "PathNotFound") {
|
|
316
|
+
return {
|
|
317
|
+
succeeded: false,
|
|
318
|
+
...e.response?.parsedHeaders,
|
|
319
|
+
_response: e.response,
|
|
320
|
+
};
|
|
272
321
|
}
|
|
273
322
|
throw e;
|
|
274
323
|
}
|
|
@@ -277,21 +326,33 @@ export class DataLakePathClient extends StorageClient {
|
|
|
277
326
|
/**
|
|
278
327
|
* Returns the access control data for a path (directory of file).
|
|
279
328
|
*
|
|
280
|
-
* @see https://learn.microsoft.com/
|
|
329
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/getproperties
|
|
281
330
|
*
|
|
282
331
|
* @param options - Optional. Options when getting file access control.
|
|
283
332
|
*/
|
|
284
333
|
async getAccessControl(options = {}) {
|
|
285
334
|
options.conditions = options.conditions || {};
|
|
286
335
|
return tracingClient.withSpan("DataLakePathClient-getAccessControl", options, async (updatedOptions) => {
|
|
287
|
-
const response = assertResponse(await this.pathContext.getProperties(
|
|
288
|
-
|
|
336
|
+
const response = assertResponse(await this.pathContext.getProperties({
|
|
337
|
+
...updatedOptions,
|
|
338
|
+
action: "getAccessControl",
|
|
339
|
+
upn: options.userPrincipalName,
|
|
340
|
+
leaseAccessConditions: options.conditions,
|
|
341
|
+
modifiedAccessConditions: options.conditions,
|
|
342
|
+
abortSignal: options.abortSignal,
|
|
343
|
+
}));
|
|
344
|
+
return {
|
|
345
|
+
...response,
|
|
346
|
+
_response: response._response,
|
|
347
|
+
permissions: toPermissions(response.permissions),
|
|
348
|
+
acl: toAcl(response.acl),
|
|
349
|
+
};
|
|
289
350
|
});
|
|
290
351
|
}
|
|
291
352
|
/**
|
|
292
353
|
* Set the access control data for a path (directory of file).
|
|
293
354
|
*
|
|
294
|
-
* @see https://learn.microsoft.com/
|
|
355
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/update
|
|
295
356
|
*
|
|
296
357
|
* @param acl - The POSIX access control list for the file or directory.
|
|
297
358
|
* @param options - Optional. Options when setting path access control.
|
|
@@ -299,13 +360,18 @@ export class DataLakePathClient extends StorageClient {
|
|
|
299
360
|
async setAccessControl(acl, options = {}) {
|
|
300
361
|
options.conditions = options.conditions || {};
|
|
301
362
|
return tracingClient.withSpan("DataLakePathClient-setAccessControl", options, async (updatedOptions) => {
|
|
302
|
-
return assertResponse(await this.pathContext.setAccessControl(
|
|
363
|
+
return assertResponse(await this.pathContext.setAccessControl({
|
|
364
|
+
...updatedOptions,
|
|
365
|
+
acl: toAclString(acl),
|
|
366
|
+
leaseAccessConditions: options.conditions,
|
|
367
|
+
modifiedAccessConditions: options.conditions,
|
|
368
|
+
}));
|
|
303
369
|
});
|
|
304
370
|
}
|
|
305
371
|
/**
|
|
306
372
|
* Sets the Access Control on a path and sub paths.
|
|
307
373
|
*
|
|
308
|
-
* @see https://learn.microsoft.com/
|
|
374
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/update
|
|
309
375
|
*
|
|
310
376
|
* @param acl - The POSIX access control list for the file or directory.
|
|
311
377
|
* @param options - Optional. Options
|
|
@@ -318,7 +384,7 @@ export class DataLakePathClient extends StorageClient {
|
|
|
318
384
|
/**
|
|
319
385
|
* Modifies the Access Control on a path and sub paths.
|
|
320
386
|
*
|
|
321
|
-
* @see https://learn.microsoft.com/
|
|
387
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/update
|
|
322
388
|
*
|
|
323
389
|
* @param acl - The POSIX access control list for the file or directory.
|
|
324
390
|
* @param options - Optional. Options
|
|
@@ -331,7 +397,7 @@ export class DataLakePathClient extends StorageClient {
|
|
|
331
397
|
/**
|
|
332
398
|
* Removes the Access Control on a path and sub paths.
|
|
333
399
|
*
|
|
334
|
-
* @see https://learn.microsoft.com/
|
|
400
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/update
|
|
335
401
|
*
|
|
336
402
|
* @param acl - The POSIX access control list for the file or directory.
|
|
337
403
|
* @param options - Optional. Options
|
|
@@ -344,7 +410,7 @@ export class DataLakePathClient extends StorageClient {
|
|
|
344
410
|
/**
|
|
345
411
|
* Sets the file permissions on a path.
|
|
346
412
|
*
|
|
347
|
-
* @see https://learn.microsoft.com/
|
|
413
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/update
|
|
348
414
|
*
|
|
349
415
|
* @param permissions - The POSIX access permissions for the file owner, the file owning group, and others.
|
|
350
416
|
* @param options - Optional. Options when setting path permissions.
|
|
@@ -352,7 +418,12 @@ export class DataLakePathClient extends StorageClient {
|
|
|
352
418
|
async setPermissions(permissions, options = {}) {
|
|
353
419
|
options.conditions = options.conditions || {};
|
|
354
420
|
return tracingClient.withSpan("DataLakePathClient-setPermissions", options, async (updatedOptions) => {
|
|
355
|
-
return assertResponse(await this.pathContext.setAccessControl(
|
|
421
|
+
return assertResponse(await this.pathContext.setAccessControl({
|
|
422
|
+
...updatedOptions,
|
|
423
|
+
permissions: toPermissionsString(permissions),
|
|
424
|
+
leaseAccessConditions: options.conditions,
|
|
425
|
+
modifiedAccessConditions: options.conditions,
|
|
426
|
+
}));
|
|
356
427
|
});
|
|
357
428
|
}
|
|
358
429
|
/**
|
|
@@ -364,13 +435,17 @@ export class DataLakePathClient extends StorageClient {
|
|
|
364
435
|
* the methods of {@link DataLakeFileSystemClient} that list paths using the `includeMetadata` option, which
|
|
365
436
|
* will retain their original casing.
|
|
366
437
|
*
|
|
367
|
-
* @see https://learn.microsoft.com/
|
|
438
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-blob-properties
|
|
368
439
|
*
|
|
369
440
|
* @param options - Optional. Options when getting path properties.
|
|
370
441
|
*/
|
|
371
442
|
async getProperties(options = {}) {
|
|
372
443
|
return tracingClient.withSpan("DataLakePathClient-getProperties", options, async (updatedOptions) => {
|
|
373
|
-
const response = await this.blobClient.getProperties(
|
|
444
|
+
const response = await this.blobClient.getProperties({
|
|
445
|
+
...options,
|
|
446
|
+
customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey),
|
|
447
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
448
|
+
});
|
|
374
449
|
return ParsePathGetPropertiesExtraHeaderValues(response);
|
|
375
450
|
});
|
|
376
451
|
}
|
|
@@ -379,7 +454,7 @@ export class DataLakePathClient extends StorageClient {
|
|
|
379
454
|
*
|
|
380
455
|
* If no value provided, or no value provided for the specified blob HTTP headers,
|
|
381
456
|
* these blob HTTP headers without a value will be cleared.
|
|
382
|
-
* @see https://learn.microsoft.com/
|
|
457
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties
|
|
383
458
|
*
|
|
384
459
|
* @param httpHeaders -
|
|
385
460
|
* @param options -
|
|
@@ -402,7 +477,7 @@ export class DataLakePathClient extends StorageClient {
|
|
|
402
477
|
* If no option provided, or no metadata defined in the parameter, the path
|
|
403
478
|
* metadata will be removed.
|
|
404
479
|
*
|
|
405
|
-
* @see https://learn.microsoft.com/
|
|
480
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/set-blob-metadata
|
|
406
481
|
*
|
|
407
482
|
* @param metadata - Optional. Replace existing metadata with this value.
|
|
408
483
|
* If no value provided the existing metadata will be removed.
|
|
@@ -410,7 +485,11 @@ export class DataLakePathClient extends StorageClient {
|
|
|
410
485
|
*/
|
|
411
486
|
async setMetadata(metadata, options = {}) {
|
|
412
487
|
return tracingClient.withSpan("DataLakePathClient-setMetadata", options, async (updatedOptions) => {
|
|
413
|
-
return this.blobClient.setMetadata(metadata,
|
|
488
|
+
return this.blobClient.setMetadata(metadata, {
|
|
489
|
+
...options,
|
|
490
|
+
customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey),
|
|
491
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
492
|
+
});
|
|
414
493
|
});
|
|
415
494
|
}
|
|
416
495
|
async move(destinationPathOrFileSystem, destinationPathOrOptions, options) {
|
|
@@ -420,10 +499,10 @@ export class DataLakePathClient extends StorageClient {
|
|
|
420
499
|
if (typeof destinationPathOrOptions === "string") {
|
|
421
500
|
destinationFileSystem = destinationPathOrFileSystem;
|
|
422
501
|
destinationPath = destinationPathOrOptions;
|
|
423
|
-
pathMoveOptions = options
|
|
502
|
+
pathMoveOptions = options ?? {};
|
|
424
503
|
}
|
|
425
504
|
else {
|
|
426
|
-
pathMoveOptions = destinationPathOrOptions
|
|
505
|
+
pathMoveOptions = destinationPathOrOptions ?? {};
|
|
427
506
|
}
|
|
428
507
|
const renameSource = getURLPathAndQuery(this.dfsEndpointUrl);
|
|
429
508
|
const split = destinationPath.split("?");
|
|
@@ -442,14 +521,21 @@ export class DataLakePathClient extends StorageClient {
|
|
|
442
521
|
}
|
|
443
522
|
const destPathClient = new DataLakePathClient(destinationUrl, this.pipeline);
|
|
444
523
|
return tracingClient.withSpan("DataLakePathClient-move", pathMoveOptions, async (updatedOptions) => {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
524
|
+
return assertResponse(await destPathClient.pathContext.create({
|
|
525
|
+
...updatedOptions,
|
|
526
|
+
mode: "legacy", // By default
|
|
527
|
+
renameSource,
|
|
528
|
+
sourceLeaseId: pathMoveOptions.conditions?.leaseId,
|
|
529
|
+
leaseAccessConditions: pathMoveOptions.destinationConditions,
|
|
530
|
+
sourceModifiedAccessConditions: {
|
|
531
|
+
sourceIfMatch: pathMoveOptions.conditions?.ifMatch,
|
|
532
|
+
sourceIfNoneMatch: pathMoveOptions.conditions?.ifNoneMatch,
|
|
533
|
+
sourceIfModifiedSince: pathMoveOptions.conditions?.ifModifiedSince,
|
|
534
|
+
sourceIfUnmodifiedSince: pathMoveOptions.conditions?.ifUnmodifiedSince,
|
|
535
|
+
},
|
|
536
|
+
modifiedAccessConditions: pathMoveOptions.destinationConditions,
|
|
537
|
+
abortSignal: pathMoveOptions.abortSignal,
|
|
538
|
+
}));
|
|
453
539
|
});
|
|
454
540
|
}
|
|
455
541
|
}
|
|
@@ -466,7 +552,7 @@ export class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
466
552
|
pathCreateOptions = options;
|
|
467
553
|
}
|
|
468
554
|
else {
|
|
469
|
-
pathCreateOptions = resourceTypeOrOptions
|
|
555
|
+
pathCreateOptions = resourceTypeOrOptions ?? {};
|
|
470
556
|
}
|
|
471
557
|
return tracingClient.withSpan("DataLakeDirectoryClient-create", pathCreateOptions, async (updatedOptions) => {
|
|
472
558
|
return super.create("directory", updatedOptions);
|
|
@@ -480,7 +566,9 @@ export class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
480
566
|
options = resourceTypeOrOptions || {};
|
|
481
567
|
}
|
|
482
568
|
return tracingClient.withSpan("DataLakeDirectoryClient-createIfNotExists", options, async (updatedOptions) => {
|
|
483
|
-
return super.createIfNotExists("directory",
|
|
569
|
+
return super.createIfNotExists("directory", {
|
|
570
|
+
...updatedOptions,
|
|
571
|
+
});
|
|
484
572
|
});
|
|
485
573
|
}
|
|
486
574
|
/**
|
|
@@ -507,7 +595,7 @@ export class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
507
595
|
* Generates a Service Shared Access Signature (SAS) URI based on the client properties
|
|
508
596
|
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
|
509
597
|
*
|
|
510
|
-
* @see https://learn.microsoft.com/
|
|
598
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
|
|
511
599
|
*
|
|
512
600
|
* @param options - Optional parameters.
|
|
513
601
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
@@ -517,7 +605,12 @@ export class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
517
605
|
if (!(this.credential instanceof StorageSharedKeyCredential)) {
|
|
518
606
|
throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
|
|
519
607
|
}
|
|
520
|
-
const sas = generateDataLakeSASQueryParameters(
|
|
608
|
+
const sas = generateDataLakeSASQueryParameters({
|
|
609
|
+
fileSystemName: this.fileSystemName,
|
|
610
|
+
pathName: this.name,
|
|
611
|
+
isDirectory: true,
|
|
612
|
+
...options,
|
|
613
|
+
}, this.credential).toString();
|
|
521
614
|
resolve(appendToURLQuery(this.url, sas));
|
|
522
615
|
});
|
|
523
616
|
}
|
|
@@ -525,7 +618,7 @@ export class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
525
618
|
* Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties
|
|
526
619
|
* and parameters passed in.
|
|
527
620
|
*
|
|
528
|
-
* @see https://learn.microsoft.com/
|
|
621
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
|
|
529
622
|
*
|
|
530
623
|
* @param options - Optional parameters.
|
|
531
624
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
@@ -535,13 +628,18 @@ export class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
535
628
|
if (!(this.credential instanceof StorageSharedKeyCredential)) {
|
|
536
629
|
throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
|
|
537
630
|
}
|
|
538
|
-
return generateDataLakeSASQueryParametersInternal(
|
|
631
|
+
return generateDataLakeSASQueryParametersInternal({
|
|
632
|
+
fileSystemName: this.fileSystemName,
|
|
633
|
+
pathName: this.name,
|
|
634
|
+
isDirectory: true,
|
|
635
|
+
...options,
|
|
636
|
+
}, this.credential).stringToSign;
|
|
539
637
|
}
|
|
540
638
|
/**
|
|
541
639
|
* Generates a Service Shared Access Signature (SAS) URI based on the client properties
|
|
542
640
|
* and parameters passed in. The SAS is signed by the input user delegation key.
|
|
543
641
|
*
|
|
544
|
-
* @see https://learn.microsoft.com/
|
|
642
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
|
|
545
643
|
*
|
|
546
644
|
* @param options - Optional parameters.
|
|
547
645
|
* @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
|
|
@@ -549,7 +647,12 @@ export class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
549
647
|
*/
|
|
550
648
|
generateUserDelegationSasUrl(options, userDelegationKey) {
|
|
551
649
|
return new Promise((resolve) => {
|
|
552
|
-
const sas = generateDataLakeSASQueryParameters(
|
|
650
|
+
const sas = generateDataLakeSASQueryParameters({
|
|
651
|
+
fileSystemName: this.fileSystemName,
|
|
652
|
+
pathName: this.name,
|
|
653
|
+
isDirectory: true,
|
|
654
|
+
...options,
|
|
655
|
+
}, userDelegationKey, this.accountName).toString();
|
|
553
656
|
resolve(appendToURLQuery(this.url, sas));
|
|
554
657
|
});
|
|
555
658
|
}
|
|
@@ -557,20 +660,37 @@ export class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
557
660
|
* Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties
|
|
558
661
|
* and parameters passed in The SAS is signed by the input user delegation key.
|
|
559
662
|
*
|
|
560
|
-
* @see https://learn.microsoft.com/
|
|
663
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
|
|
561
664
|
*
|
|
562
665
|
* @param options - Optional parameters.
|
|
563
666
|
* @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
|
|
564
667
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
565
668
|
*/
|
|
566
669
|
generateUserDelegationSasStringToSign(options, userDelegationKey) {
|
|
567
|
-
return generateDataLakeSASQueryParametersInternal(
|
|
670
|
+
return generateDataLakeSASQueryParametersInternal({
|
|
671
|
+
fileSystemName: this.fileSystemName,
|
|
672
|
+
pathName: this.name,
|
|
673
|
+
isDirectory: true,
|
|
674
|
+
...options,
|
|
675
|
+
}, userDelegationKey, this.accountName).stringToSign;
|
|
568
676
|
}
|
|
569
677
|
}
|
|
570
678
|
/**
|
|
571
679
|
* A DataLakeFileClient represents a URL to the Azure Storage file.
|
|
572
680
|
*/
|
|
573
681
|
export class DataLakeFileClient extends DataLakePathClient {
|
|
682
|
+
/**
|
|
683
|
+
* pathContextInternal provided by protocol layer.
|
|
684
|
+
*/
|
|
685
|
+
pathContextInternal;
|
|
686
|
+
/**
|
|
687
|
+
* pathContextInternal provided by protocol layer, with its url pointing to the Blob endpoint.
|
|
688
|
+
*/
|
|
689
|
+
pathContextInternalToBlobEndpoint;
|
|
690
|
+
/**
|
|
691
|
+
* blockBlobClientInternal provided by `@azure/storage-blob` package.
|
|
692
|
+
*/
|
|
693
|
+
blockBlobClientInternal;
|
|
574
694
|
constructor(url, credentialOrPipeline,
|
|
575
695
|
// Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
|
|
576
696
|
/* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */
|
|
@@ -602,7 +722,7 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
602
722
|
pathCreateOptions = options;
|
|
603
723
|
}
|
|
604
724
|
else {
|
|
605
|
-
pathCreateOptions = resourceTypeOrOptions
|
|
725
|
+
pathCreateOptions = resourceTypeOrOptions ?? {};
|
|
606
726
|
}
|
|
607
727
|
return tracingClient.withSpan("DataLakeFileClient-create", pathCreateOptions, async (updatedOptions) => {
|
|
608
728
|
return super.create("file", updatedOptions);
|
|
@@ -625,7 +745,7 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
625
745
|
* * In Node.js, data returns in a Readable stream readableStreamBody
|
|
626
746
|
* * In browsers, data returns in a promise contentAsBlob
|
|
627
747
|
*
|
|
628
|
-
* @see https://learn.microsoft.com/
|
|
748
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-blob
|
|
629
749
|
*
|
|
630
750
|
* * Example usage (Node.js):
|
|
631
751
|
*
|
|
@@ -699,7 +819,10 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
699
819
|
*/
|
|
700
820
|
async read(offset = 0, count, options = {}) {
|
|
701
821
|
return tracingClient.withSpan("DataLakeFileClient-read", options, async (updatedOptions) => {
|
|
702
|
-
const rawResponse = await this.blockBlobClientInternal.download(offset, count,
|
|
822
|
+
const rawResponse = await this.blockBlobClientInternal.download(offset, count, {
|
|
823
|
+
...updatedOptions,
|
|
824
|
+
customerProvidedKey: toBlobCpkInfo(updatedOptions.customerProvidedKey),
|
|
825
|
+
});
|
|
703
826
|
const response = ParsePathGetPropertiesExtraHeaderValues(rawResponse);
|
|
704
827
|
if (!isNodeLike && !response.contentAsBlob) {
|
|
705
828
|
response.contentAsBlob = rawResponse.blobBody;
|
|
@@ -716,7 +839,7 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
716
839
|
* Uploads data to be appended to a file. Data can only be appended to a file.
|
|
717
840
|
* To apply perviously uploaded data to a file, call flush.
|
|
718
841
|
*
|
|
719
|
-
* @see https://learn.microsoft.com/
|
|
842
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/update
|
|
720
843
|
*
|
|
721
844
|
* @param body - Content to be uploaded.
|
|
722
845
|
* @param offset - Append offset in bytes.
|
|
@@ -727,11 +850,24 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
727
850
|
options.conditions = options.conditions || {};
|
|
728
851
|
return tracingClient.withSpan("DataLakeFileClient-append", options, async (updatedOptions) => {
|
|
729
852
|
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
|
|
730
|
-
return assertResponse(await this.pathContextInternal.appendData(body,
|
|
853
|
+
return assertResponse(await this.pathContextInternal.appendData(body, {
|
|
854
|
+
...updatedOptions,
|
|
855
|
+
pathHttpHeaders: {
|
|
731
856
|
contentMD5: options.transactionalContentMD5,
|
|
732
|
-
},
|
|
857
|
+
},
|
|
858
|
+
abortSignal: options.abortSignal,
|
|
859
|
+
position: offset,
|
|
860
|
+
contentLength: length,
|
|
861
|
+
leaseAccessConditions: options.conditions,
|
|
862
|
+
requestOptions: {
|
|
733
863
|
onUploadProgress: options.onProgress,
|
|
734
|
-
},
|
|
864
|
+
},
|
|
865
|
+
cpkInfo: options.customerProvidedKey,
|
|
866
|
+
flush: options.flush,
|
|
867
|
+
proposedLeaseId: options.proposedLeaseId,
|
|
868
|
+
leaseDuration: options.leaseDurationInSeconds,
|
|
869
|
+
leaseAction: options.leaseAction,
|
|
870
|
+
}));
|
|
735
871
|
});
|
|
736
872
|
}
|
|
737
873
|
/**
|
|
@@ -750,7 +886,17 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
750
886
|
options.conditions = options.conditions || {};
|
|
751
887
|
return tracingClient.withSpan("DataLakeFileClient-flush", options, async (updatedOptions) => {
|
|
752
888
|
ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);
|
|
753
|
-
return assertResponse(await this.pathContextInternal.flushData(
|
|
889
|
+
return assertResponse(await this.pathContextInternal.flushData({
|
|
890
|
+
...updatedOptions,
|
|
891
|
+
position,
|
|
892
|
+
contentLength: 0,
|
|
893
|
+
leaseAccessConditions: options.conditions,
|
|
894
|
+
modifiedAccessConditions: options.conditions,
|
|
895
|
+
cpkInfo: options.customerProvidedKey,
|
|
896
|
+
proposedLeaseId: options.proposedLeaseId,
|
|
897
|
+
leaseDuration: options.leaseDurationInSeconds,
|
|
898
|
+
leaseAction: options.leaseAction,
|
|
899
|
+
}));
|
|
754
900
|
});
|
|
755
901
|
}
|
|
756
902
|
// high level functions
|
|
@@ -807,7 +953,6 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
807
953
|
}
|
|
808
954
|
async uploadSeekableInternal(bodyFactory, size, options = {}) {
|
|
809
955
|
return tracingClient.withSpan("DataLakeFileClient-uploadData", options, async (updatedOptions) => {
|
|
810
|
-
var _a;
|
|
811
956
|
if (size > FILE_MAX_SIZE_BYTES) {
|
|
812
957
|
throw new RangeError(`size must be <= ${FILE_MAX_SIZE_BYTES}.`);
|
|
813
958
|
}
|
|
@@ -831,7 +976,7 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
831
976
|
await createRes;
|
|
832
977
|
}
|
|
833
978
|
// After the File is Create, Lease ID is the only valid request parameter.
|
|
834
|
-
options.conditions = { leaseId:
|
|
979
|
+
options.conditions = { leaseId: options.conditions?.leaseId };
|
|
835
980
|
if (!options.chunkSize) {
|
|
836
981
|
options.chunkSize = Math.ceil(size / BLOCK_BLOB_MAX_BLOCKS);
|
|
837
982
|
if (options.chunkSize < FILE_UPLOAD_DEFAULT_CHUNK_SIZE) {
|
|
@@ -924,7 +1069,6 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
924
1069
|
*/
|
|
925
1070
|
async uploadStream(stream, options = {}) {
|
|
926
1071
|
return tracingClient.withSpan("DataLakeFileClient-uploadStream", options, async (updatedOptions) => {
|
|
927
|
-
var _a;
|
|
928
1072
|
// Create the file
|
|
929
1073
|
await this.create({
|
|
930
1074
|
abortSignal: options.abortSignal,
|
|
@@ -938,7 +1082,7 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
938
1082
|
encryptionContext: updatedOptions.encryptionContext,
|
|
939
1083
|
});
|
|
940
1084
|
// After the File is Create, Lease ID is the only valid request parameter.
|
|
941
|
-
options.conditions = { leaseId:
|
|
1085
|
+
options.conditions = { leaseId: options.conditions?.leaseId };
|
|
942
1086
|
if (!options.chunkSize) {
|
|
943
1087
|
options.chunkSize = FILE_UPLOAD_DEFAULT_CHUNK_SIZE;
|
|
944
1088
|
}
|
|
@@ -998,10 +1142,22 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
998
1142
|
}
|
|
999
1143
|
return tracingClient.withSpan("DataLakeFileClient-readToBuffer", options, async (updatedOptions) => {
|
|
1000
1144
|
if (buffer) {
|
|
1001
|
-
return this.blockBlobClientInternal.downloadToBuffer(buffer, offset, count,
|
|
1145
|
+
return this.blockBlobClientInternal.downloadToBuffer(buffer, offset, count, {
|
|
1146
|
+
...options,
|
|
1147
|
+
maxRetryRequestsPerBlock: options.maxRetryRequestsPerChunk,
|
|
1148
|
+
blockSize: options.chunkSize,
|
|
1149
|
+
customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey),
|
|
1150
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
1151
|
+
});
|
|
1002
1152
|
}
|
|
1003
1153
|
else {
|
|
1004
|
-
return this.blockBlobClientInternal.downloadToBuffer(offset, count,
|
|
1154
|
+
return this.blockBlobClientInternal.downloadToBuffer(offset, count, {
|
|
1155
|
+
...options,
|
|
1156
|
+
maxRetryRequestsPerBlock: options.maxRetryRequestsPerChunk,
|
|
1157
|
+
blockSize: options.chunkSize,
|
|
1158
|
+
customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey),
|
|
1159
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
1160
|
+
});
|
|
1005
1161
|
}
|
|
1006
1162
|
});
|
|
1007
1163
|
}
|
|
@@ -1023,7 +1179,10 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
1023
1179
|
*/
|
|
1024
1180
|
async readToFile(filePath, offset = 0, count, options = {}) {
|
|
1025
1181
|
return tracingClient.withSpan("DataLakeFileClient-readToFile", options, async (updatedOptions) => {
|
|
1026
|
-
const rawResposne = await this.blockBlobClientInternal.downloadToFile(filePath, offset, count,
|
|
1182
|
+
const rawResposne = await this.blockBlobClientInternal.downloadToFile(filePath, offset, count, {
|
|
1183
|
+
...updatedOptions,
|
|
1184
|
+
customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey),
|
|
1185
|
+
});
|
|
1027
1186
|
const response = ParsePathGetPropertiesExtraHeaderValues(rawResposne);
|
|
1028
1187
|
return response;
|
|
1029
1188
|
});
|
|
@@ -1074,7 +1233,10 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
1074
1233
|
*/
|
|
1075
1234
|
async query(query, options = {}) {
|
|
1076
1235
|
return tracingClient.withSpan("DataLakeFileClient-query", options, async (updatedOptions) => {
|
|
1077
|
-
const rawResponse = await this.blockBlobClientInternal.query(query,
|
|
1236
|
+
const rawResponse = await this.blockBlobClientInternal.query(query, {
|
|
1237
|
+
...updatedOptions,
|
|
1238
|
+
customerProvidedKey: toBlobCpkInfo(options.customerProvidedKey),
|
|
1239
|
+
});
|
|
1078
1240
|
const response = rawResponse;
|
|
1079
1241
|
if (!isNodeLike && !response.contentAsBlob) {
|
|
1080
1242
|
response.contentAsBlob = rawResponse.blobBody;
|
|
@@ -1095,7 +1257,6 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
1095
1257
|
*/
|
|
1096
1258
|
async setExpiry(mode, options = {}) {
|
|
1097
1259
|
return tracingClient.withSpan("DataLakeFileClient-setExpiry", options, async (updatedOptions) => {
|
|
1098
|
-
var _a;
|
|
1099
1260
|
let expiresOn = undefined;
|
|
1100
1261
|
if (mode === "RelativeToNow" || mode === "RelativeToCreation") {
|
|
1101
1262
|
if (!options.timeToExpireInMs) {
|
|
@@ -1110,12 +1271,15 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
1110
1271
|
}
|
|
1111
1272
|
const now = new Date();
|
|
1112
1273
|
if (!(options.expiresOn.getTime() > now.getTime())) {
|
|
1113
|
-
throw new Error(`options.expiresOn should be later than now: ${now.toUTCString()} when using mode ${mode}, but is ${
|
|
1274
|
+
throw new Error(`options.expiresOn should be later than now: ${now.toUTCString()} when using mode ${mode}, but is ${options.expiresOn?.toUTCString()}`);
|
|
1114
1275
|
}
|
|
1115
1276
|
expiresOn = options.expiresOn.toUTCString();
|
|
1116
1277
|
}
|
|
1117
|
-
const adaptedOptions =
|
|
1118
|
-
return assertResponse(await this.pathContextInternalToBlobEndpoint.setExpiry(mode,
|
|
1278
|
+
const adaptedOptions = { ...options, expiresOn };
|
|
1279
|
+
return assertResponse(await this.pathContextInternalToBlobEndpoint.setExpiry(mode, {
|
|
1280
|
+
...adaptedOptions,
|
|
1281
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
1282
|
+
}));
|
|
1119
1283
|
});
|
|
1120
1284
|
}
|
|
1121
1285
|
/**
|
|
@@ -1124,7 +1288,7 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
1124
1288
|
* Generates a Service Shared Access Signature (SAS) URI based on the client properties
|
|
1125
1289
|
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
|
1126
1290
|
*
|
|
1127
|
-
* @see https://learn.microsoft.com/
|
|
1291
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
|
|
1128
1292
|
*
|
|
1129
1293
|
* @param options - Optional parameters.
|
|
1130
1294
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
@@ -1134,7 +1298,11 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
1134
1298
|
if (!(this.credential instanceof StorageSharedKeyCredential)) {
|
|
1135
1299
|
throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
|
|
1136
1300
|
}
|
|
1137
|
-
const sas = generateDataLakeSASQueryParameters(
|
|
1301
|
+
const sas = generateDataLakeSASQueryParameters({
|
|
1302
|
+
fileSystemName: this.fileSystemName,
|
|
1303
|
+
pathName: this.name,
|
|
1304
|
+
...options,
|
|
1305
|
+
}, this.credential).toString();
|
|
1138
1306
|
resolve(appendToURLQuery(this.url, sas));
|
|
1139
1307
|
});
|
|
1140
1308
|
}
|
|
@@ -1144,7 +1312,7 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
1144
1312
|
* Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties
|
|
1145
1313
|
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
|
1146
1314
|
*
|
|
1147
|
-
* @see https://learn.microsoft.com/
|
|
1315
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
|
|
1148
1316
|
*
|
|
1149
1317
|
* @param options - Optional parameters.
|
|
1150
1318
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
@@ -1154,13 +1322,17 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
1154
1322
|
if (!(this.credential instanceof StorageSharedKeyCredential)) {
|
|
1155
1323
|
throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
|
|
1156
1324
|
}
|
|
1157
|
-
return generateDataLakeSASQueryParametersInternal(
|
|
1325
|
+
return generateDataLakeSASQueryParametersInternal({
|
|
1326
|
+
fileSystemName: this.fileSystemName,
|
|
1327
|
+
pathName: this.name,
|
|
1328
|
+
...options,
|
|
1329
|
+
}, this.credential).stringToSign;
|
|
1158
1330
|
}
|
|
1159
1331
|
/**
|
|
1160
1332
|
* Generates a Service Shared Access Signature (SAS) URI based on the client properties
|
|
1161
1333
|
* and parameters passed in. The SAS is signed by the input user delegation key.
|
|
1162
1334
|
*
|
|
1163
|
-
* @see https://learn.microsoft.com/
|
|
1335
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
|
|
1164
1336
|
*
|
|
1165
1337
|
* @param options - Optional parameters.
|
|
1166
1338
|
* @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
|
|
@@ -1168,7 +1340,11 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
1168
1340
|
*/
|
|
1169
1341
|
generateUserDelegationSasUrl(options, userDelegationKey) {
|
|
1170
1342
|
return new Promise((resolve) => {
|
|
1171
|
-
const sas = generateDataLakeSASQueryParameters(
|
|
1343
|
+
const sas = generateDataLakeSASQueryParameters({
|
|
1344
|
+
fileSystemName: this.fileSystemName,
|
|
1345
|
+
pathName: this.name,
|
|
1346
|
+
...options,
|
|
1347
|
+
}, userDelegationKey, this.accountName).toString();
|
|
1172
1348
|
resolve(appendToURLQuery(this.url, sas));
|
|
1173
1349
|
});
|
|
1174
1350
|
}
|
|
@@ -1176,14 +1352,18 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
1176
1352
|
* Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties
|
|
1177
1353
|
* and parameters passed in. The SAS is signed by the input user delegation key.
|
|
1178
1354
|
*
|
|
1179
|
-
* @see https://learn.microsoft.com/
|
|
1355
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
|
|
1180
1356
|
*
|
|
1181
1357
|
* @param options - Optional parameters.
|
|
1182
1358
|
* @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
|
|
1183
1359
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
1184
1360
|
*/
|
|
1185
1361
|
generateUserDelegationSasStringToSign(options, userDelegationKey) {
|
|
1186
|
-
return generateDataLakeSASQueryParametersInternal(
|
|
1362
|
+
return generateDataLakeSASQueryParametersInternal({
|
|
1363
|
+
fileSystemName: this.fileSystemName,
|
|
1364
|
+
pathName: this.name,
|
|
1365
|
+
...options,
|
|
1366
|
+
}, userDelegationKey, this.accountName).stringToSign;
|
|
1187
1367
|
}
|
|
1188
1368
|
}
|
|
1189
1369
|
//# sourceMappingURL=clients.js.map
|