@azure/storage-file-datalake 12.27.0-alpha.20250619.1 → 12.27.0-alpha.20250718.2
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.js +123 -80
- 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.js +22 -5
- package/dist/browser/DataLakeServiceClient.js.map +1 -1
- package/dist/browser/Pipeline.js +19 -10
- 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.js +246 -66
- 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 +14 -3
- 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/sas/AccountSASPermissions.js +32 -34
- package/dist/browser/sas/AccountSASPermissions.js.map +1 -1
- package/dist/browser/sas/AccountSASResourceTypes.js +12 -14
- 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/DataLakeSASPermissions.js +39 -41
- package/dist/browser/sas/DataLakeSASPermissions.js.map +1 -1
- package/dist/browser/sas/DataLakeSASSignatureValues.js +3 -2
- package/dist/browser/sas/DataLakeSASSignatureValues.js.map +1 -1
- package/dist/browser/sas/DirectorySASPermissions.js +43 -45
- package/dist/browser/sas/DirectorySASPermissions.js.map +1 -1
- package/dist/browser/sas/FileSystemSASPermissions.js +43 -45
- package/dist/browser/sas/FileSystemSASPermissions.js.map +1 -1
- 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/utils.common.js +2 -4
- package/dist/browser/utils/utils.common.js.map +1 -1
- package/dist/commonjs/DataLakeFileSystemClient.js +123 -80
- 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.js +22 -5
- package/dist/commonjs/DataLakeServiceClient.js.map +1 -1
- package/dist/commonjs/Pipeline.js +19 -10
- 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.js +246 -66
- package/dist/commonjs/clients.js.map +1 -1
- package/dist/commonjs/credentials/UserDelegationKeyCredential.js +12 -0
- 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 +14 -3
- package/dist/commonjs/generated/src/storageClient.js.map +1 -1
- package/dist/commonjs/sas/AccountSASPermissions.js +32 -34
- package/dist/commonjs/sas/AccountSASPermissions.js.map +1 -1
- package/dist/commonjs/sas/AccountSASResourceTypes.js +12 -14
- 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/DataLakeSASPermissions.js +39 -41
- package/dist/commonjs/sas/DataLakeSASPermissions.js.map +1 -1
- package/dist/commonjs/sas/DataLakeSASSignatureValues.js +3 -2
- package/dist/commonjs/sas/DataLakeSASSignatureValues.js.map +1 -1
- package/dist/commonjs/sas/DirectorySASPermissions.js +43 -45
- package/dist/commonjs/sas/DirectorySASPermissions.js.map +1 -1
- package/dist/commonjs/sas/FileSystemSASPermissions.js +43 -45
- package/dist/commonjs/sas/FileSystemSASPermissions.js.map +1 -1
- 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/utils.common.js +2 -4
- 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.js +123 -80
- 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.js +22 -5
- package/dist/esm/DataLakeServiceClient.js.map +1 -1
- package/dist/esm/Pipeline.js +19 -10
- 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.js +246 -66
- package/dist/esm/clients.js.map +1 -1
- package/dist/esm/credentials/UserDelegationKeyCredential.js +12 -0
- 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 +14 -3
- package/dist/esm/generated/src/storageClient.js.map +1 -1
- package/dist/esm/sas/AccountSASPermissions.js +32 -34
- package/dist/esm/sas/AccountSASPermissions.js.map +1 -1
- package/dist/esm/sas/AccountSASResourceTypes.js +12 -14
- 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/DataLakeSASPermissions.js +39 -41
- package/dist/esm/sas/DataLakeSASPermissions.js.map +1 -1
- package/dist/esm/sas/DataLakeSASSignatureValues.js +3 -2
- package/dist/esm/sas/DataLakeSASSignatureValues.js.map +1 -1
- package/dist/esm/sas/DirectorySASPermissions.js +43 -45
- package/dist/esm/sas/DirectorySASPermissions.js.map +1 -1
- package/dist/esm/sas/FileSystemSASPermissions.js +43 -45
- package/dist/esm/sas/FileSystemSASPermissions.js.map +1 -1
- 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/utils.common.js +2 -4
- 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.js +123 -80
- 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.js +22 -5
- package/dist/react-native/DataLakeServiceClient.js.map +1 -1
- package/dist/react-native/Pipeline.js +19 -10
- 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.js +246 -66
- package/dist/react-native/clients.js.map +1 -1
- package/dist/react-native/credentials/UserDelegationKeyCredential.js +12 -0
- 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 +14 -3
- package/dist/react-native/generated/src/storageClient.js.map +1 -1
- package/dist/react-native/sas/AccountSASPermissions.js +32 -34
- package/dist/react-native/sas/AccountSASPermissions.js.map +1 -1
- package/dist/react-native/sas/AccountSASResourceTypes.js +12 -14
- 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/DataLakeSASPermissions.js +39 -41
- package/dist/react-native/sas/DataLakeSASPermissions.js.map +1 -1
- package/dist/react-native/sas/DataLakeSASSignatureValues.js +3 -2
- package/dist/react-native/sas/DataLakeSASSignatureValues.js.map +1 -1
- package/dist/react-native/sas/DirectorySASPermissions.js +43 -45
- package/dist/react-native/sas/DirectorySASPermissions.js.map +1 -1
- package/dist/react-native/sas/FileSystemSASPermissions.js +43 -45
- package/dist/react-native/sas/FileSystemSASPermissions.js.map +1 -1
- 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/utils.common.js +2 -4
- 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 +2 -2
package/dist/commonjs/clients.js
CHANGED
|
@@ -25,6 +25,15 @@ const utils_js_1 = require("./utils/utils.js");
|
|
|
25
25
|
* A DataLakePathClient represents a URL to the Azure Storage path (directory or file).
|
|
26
26
|
*/
|
|
27
27
|
class DataLakePathClient extends StorageClient_js_1.StorageClient {
|
|
28
|
+
/**
|
|
29
|
+
* pathContext provided by protocol layer.
|
|
30
|
+
*/
|
|
31
|
+
pathContext;
|
|
32
|
+
/**
|
|
33
|
+
* blobClient provided by `@azure/storage-blob` package.
|
|
34
|
+
*/
|
|
35
|
+
blobClient;
|
|
36
|
+
isTokenCredential;
|
|
28
37
|
/**
|
|
29
38
|
* SetAccessControlRecursiveInternal operation sets the Access Control on a path and sub paths.
|
|
30
39
|
*
|
|
@@ -50,14 +59,19 @@ class DataLakePathClient extends StorageClient_js_1.StorageClient {
|
|
|
50
59
|
continuationToken: undefined,
|
|
51
60
|
};
|
|
52
61
|
return tracing_js_1.tracingClient.withSpan("DataLakePathClient-setAccessControlRecursiveInternal", options, async (updatedOptions) => {
|
|
53
|
-
var _a, _b, _c, _d, _e, _f;
|
|
54
62
|
let continuationToken = options.continuationToken;
|
|
55
63
|
let batchCounter = 0;
|
|
56
64
|
let reachMaxBatches = false;
|
|
57
65
|
do {
|
|
58
66
|
let response;
|
|
59
67
|
try {
|
|
60
|
-
response = await this.pathContext.setAccessControlRecursive(mode,
|
|
68
|
+
response = await this.pathContext.setAccessControlRecursive(mode, {
|
|
69
|
+
...updatedOptions,
|
|
70
|
+
acl: (0, transforms_js_1.toAclString)(acl),
|
|
71
|
+
maxRecords: options.batchSize,
|
|
72
|
+
continuation: continuationToken,
|
|
73
|
+
forceFlag: options.continueOnFailure,
|
|
74
|
+
});
|
|
61
75
|
}
|
|
62
76
|
catch (e) {
|
|
63
77
|
throw new DataLakeAclChangeFailedError_js_1.DataLakeAclChangeFailedError(e, continuationToken);
|
|
@@ -66,17 +80,17 @@ class DataLakePathClient extends StorageClient_js_1.StorageClient {
|
|
|
66
80
|
continuationToken = response.continuation;
|
|
67
81
|
// Update result
|
|
68
82
|
result.continuationToken = continuationToken;
|
|
69
|
-
result.counters.failedChangesCount +=
|
|
70
|
-
result.counters.changedDirectoriesCount +=
|
|
71
|
-
result.counters.changedFilesCount +=
|
|
83
|
+
result.counters.failedChangesCount += response.failureCount ?? 0;
|
|
84
|
+
result.counters.changedDirectoriesCount += response.directoriesSuccessful ?? 0;
|
|
85
|
+
result.counters.changedFilesCount += response.filesSuccessful ?? 0;
|
|
72
86
|
// Progress event call back
|
|
73
87
|
if (options.onProgress) {
|
|
74
88
|
const progress = {
|
|
75
89
|
batchFailures: (0, transforms_js_1.toAccessControlChangeFailureArray)(response.failedEntries),
|
|
76
90
|
batchCounters: {
|
|
77
|
-
failedChangesCount:
|
|
78
|
-
changedDirectoriesCount:
|
|
79
|
-
changedFilesCount:
|
|
91
|
+
failedChangesCount: response.failureCount ?? 0,
|
|
92
|
+
changedDirectoriesCount: response.directoriesSuccessful ?? 0,
|
|
93
|
+
changedFilesCount: response.filesSuccessful ?? 0,
|
|
80
94
|
},
|
|
81
95
|
aggregateCounters: result.counters,
|
|
82
96
|
continuationToken: continuationToken,
|
|
@@ -177,8 +191,17 @@ class DataLakePathClient extends StorageClient_js_1.StorageClient {
|
|
|
177
191
|
else if (options.expiresOn) {
|
|
178
192
|
throw new Error(`Value for expiresOn is invalid: ${options.expiresOn}`);
|
|
179
193
|
}
|
|
180
|
-
return (0, utils_common_js_1.assertResponse)(await this.pathContext.create(
|
|
181
|
-
|
|
194
|
+
return (0, utils_common_js_1.assertResponse)(await this.pathContext.create({
|
|
195
|
+
...updatedOptions,
|
|
196
|
+
resource: resourceType,
|
|
197
|
+
leaseAccessConditions: options.conditions,
|
|
198
|
+
modifiedAccessConditions: options.conditions,
|
|
199
|
+
properties: (0, transforms_js_1.toProperties)(options.metadata),
|
|
200
|
+
cpkInfo: options.customerProvidedKey,
|
|
201
|
+
acl: options.acl ? (0, transforms_js_1.toAclString)(options.acl) : undefined,
|
|
202
|
+
expiryOptions,
|
|
203
|
+
expiresOn,
|
|
204
|
+
}));
|
|
182
205
|
});
|
|
183
206
|
}
|
|
184
207
|
/**
|
|
@@ -191,15 +214,25 @@ class DataLakePathClient extends StorageClient_js_1.StorageClient {
|
|
|
191
214
|
*/
|
|
192
215
|
async createIfNotExists(resourceType, options = {}) {
|
|
193
216
|
return tracing_js_1.tracingClient.withSpan("DataLakePathClient-createIfNotExists", options, async (updatedOptions) => {
|
|
194
|
-
var _a, _b;
|
|
195
217
|
try {
|
|
196
218
|
const conditions = { ifNoneMatch: constants_js_1.ETagAny };
|
|
197
|
-
const res = await this.create(resourceType,
|
|
198
|
-
|
|
219
|
+
const res = await this.create(resourceType, {
|
|
220
|
+
...options,
|
|
221
|
+
conditions,
|
|
222
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
223
|
+
});
|
|
224
|
+
return {
|
|
225
|
+
succeeded: true,
|
|
226
|
+
...res,
|
|
227
|
+
};
|
|
199
228
|
}
|
|
200
229
|
catch (e) {
|
|
201
|
-
if (
|
|
202
|
-
return
|
|
230
|
+
if (e.details?.errorCode === "PathAlreadyExists") {
|
|
231
|
+
return {
|
|
232
|
+
succeeded: false,
|
|
233
|
+
...e.response?.parsedHeaders,
|
|
234
|
+
_response: e.response,
|
|
235
|
+
};
|
|
203
236
|
}
|
|
204
237
|
throw e;
|
|
205
238
|
}
|
|
@@ -216,7 +249,10 @@ class DataLakePathClient extends StorageClient_js_1.StorageClient {
|
|
|
216
249
|
*/
|
|
217
250
|
async exists(options = {}) {
|
|
218
251
|
return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-exists", options, async (updatedOptions) => {
|
|
219
|
-
return this.blobClient.exists(
|
|
252
|
+
return this.blobClient.exists({
|
|
253
|
+
...updatedOptions,
|
|
254
|
+
customerProvidedKey: (0, transforms_js_1.toBlobCpkInfo)(updatedOptions.customerProvidedKey),
|
|
255
|
+
});
|
|
220
256
|
});
|
|
221
257
|
}
|
|
222
258
|
/**
|
|
@@ -246,8 +282,15 @@ class DataLakePathClient extends StorageClient_js_1.StorageClient {
|
|
|
246
282
|
let response;
|
|
247
283
|
// How to handle long delete loop?
|
|
248
284
|
do {
|
|
249
|
-
response = (0, utils_common_js_1.assertResponse)(await this.pathContext.delete(
|
|
250
|
-
|
|
285
|
+
response = (0, utils_common_js_1.assertResponse)(await this.pathContext.delete({
|
|
286
|
+
...updatedOptions,
|
|
287
|
+
continuation,
|
|
288
|
+
recursive,
|
|
289
|
+
leaseAccessConditions: options.conditions,
|
|
290
|
+
modifiedAccessConditions: options.conditions,
|
|
291
|
+
abortSignal: options.abortSignal,
|
|
292
|
+
paginated,
|
|
293
|
+
}));
|
|
251
294
|
continuation = response.continuation;
|
|
252
295
|
} while (continuation);
|
|
253
296
|
return response;
|
|
@@ -264,14 +307,20 @@ class DataLakePathClient extends StorageClient_js_1.StorageClient {
|
|
|
264
307
|
async deleteIfExists(recursive, options = {}) {
|
|
265
308
|
options.conditions = options.conditions || {};
|
|
266
309
|
return tracing_js_1.tracingClient.withSpan("DataLakePathClient-deleteIfExists", options, async (updatedOptions) => {
|
|
267
|
-
var _a, _b;
|
|
268
310
|
try {
|
|
269
311
|
const res = await this.delete(recursive, updatedOptions);
|
|
270
|
-
return
|
|
312
|
+
return {
|
|
313
|
+
succeeded: true,
|
|
314
|
+
...res,
|
|
315
|
+
};
|
|
271
316
|
}
|
|
272
317
|
catch (e) {
|
|
273
|
-
if (
|
|
274
|
-
return
|
|
318
|
+
if (e.details?.errorCode === "PathNotFound") {
|
|
319
|
+
return {
|
|
320
|
+
succeeded: false,
|
|
321
|
+
...e.response?.parsedHeaders,
|
|
322
|
+
_response: e.response,
|
|
323
|
+
};
|
|
275
324
|
}
|
|
276
325
|
throw e;
|
|
277
326
|
}
|
|
@@ -287,8 +336,20 @@ class DataLakePathClient extends StorageClient_js_1.StorageClient {
|
|
|
287
336
|
async getAccessControl(options = {}) {
|
|
288
337
|
options.conditions = options.conditions || {};
|
|
289
338
|
return tracing_js_1.tracingClient.withSpan("DataLakePathClient-getAccessControl", options, async (updatedOptions) => {
|
|
290
|
-
const response = (0, utils_common_js_1.assertResponse)(await this.pathContext.getProperties(
|
|
291
|
-
|
|
339
|
+
const response = (0, utils_common_js_1.assertResponse)(await this.pathContext.getProperties({
|
|
340
|
+
...updatedOptions,
|
|
341
|
+
action: "getAccessControl",
|
|
342
|
+
upn: options.userPrincipalName,
|
|
343
|
+
leaseAccessConditions: options.conditions,
|
|
344
|
+
modifiedAccessConditions: options.conditions,
|
|
345
|
+
abortSignal: options.abortSignal,
|
|
346
|
+
}));
|
|
347
|
+
return {
|
|
348
|
+
...response,
|
|
349
|
+
_response: response._response,
|
|
350
|
+
permissions: (0, transforms_js_1.toPermissions)(response.permissions),
|
|
351
|
+
acl: (0, transforms_js_1.toAcl)(response.acl),
|
|
352
|
+
};
|
|
292
353
|
});
|
|
293
354
|
}
|
|
294
355
|
/**
|
|
@@ -302,7 +363,12 @@ class DataLakePathClient extends StorageClient_js_1.StorageClient {
|
|
|
302
363
|
async setAccessControl(acl, options = {}) {
|
|
303
364
|
options.conditions = options.conditions || {};
|
|
304
365
|
return tracing_js_1.tracingClient.withSpan("DataLakePathClient-setAccessControl", options, async (updatedOptions) => {
|
|
305
|
-
return (0, utils_common_js_1.assertResponse)(await this.pathContext.setAccessControl(
|
|
366
|
+
return (0, utils_common_js_1.assertResponse)(await this.pathContext.setAccessControl({
|
|
367
|
+
...updatedOptions,
|
|
368
|
+
acl: (0, transforms_js_1.toAclString)(acl),
|
|
369
|
+
leaseAccessConditions: options.conditions,
|
|
370
|
+
modifiedAccessConditions: options.conditions,
|
|
371
|
+
}));
|
|
306
372
|
});
|
|
307
373
|
}
|
|
308
374
|
/**
|
|
@@ -355,7 +421,12 @@ class DataLakePathClient extends StorageClient_js_1.StorageClient {
|
|
|
355
421
|
async setPermissions(permissions, options = {}) {
|
|
356
422
|
options.conditions = options.conditions || {};
|
|
357
423
|
return tracing_js_1.tracingClient.withSpan("DataLakePathClient-setPermissions", options, async (updatedOptions) => {
|
|
358
|
-
return (0, utils_common_js_1.assertResponse)(await this.pathContext.setAccessControl(
|
|
424
|
+
return (0, utils_common_js_1.assertResponse)(await this.pathContext.setAccessControl({
|
|
425
|
+
...updatedOptions,
|
|
426
|
+
permissions: (0, transforms_js_1.toPermissionsString)(permissions),
|
|
427
|
+
leaseAccessConditions: options.conditions,
|
|
428
|
+
modifiedAccessConditions: options.conditions,
|
|
429
|
+
}));
|
|
359
430
|
});
|
|
360
431
|
}
|
|
361
432
|
/**
|
|
@@ -373,7 +444,11 @@ class DataLakePathClient extends StorageClient_js_1.StorageClient {
|
|
|
373
444
|
*/
|
|
374
445
|
async getProperties(options = {}) {
|
|
375
446
|
return tracing_js_1.tracingClient.withSpan("DataLakePathClient-getProperties", options, async (updatedOptions) => {
|
|
376
|
-
const response = await this.blobClient.getProperties(
|
|
447
|
+
const response = await this.blobClient.getProperties({
|
|
448
|
+
...options,
|
|
449
|
+
customerProvidedKey: (0, transforms_js_1.toBlobCpkInfo)(options.customerProvidedKey),
|
|
450
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
451
|
+
});
|
|
377
452
|
return (0, utils_common_js_1.ParsePathGetPropertiesExtraHeaderValues)(response);
|
|
378
453
|
});
|
|
379
454
|
}
|
|
@@ -413,7 +488,11 @@ class DataLakePathClient extends StorageClient_js_1.StorageClient {
|
|
|
413
488
|
*/
|
|
414
489
|
async setMetadata(metadata, options = {}) {
|
|
415
490
|
return tracing_js_1.tracingClient.withSpan("DataLakePathClient-setMetadata", options, async (updatedOptions) => {
|
|
416
|
-
return this.blobClient.setMetadata(metadata,
|
|
491
|
+
return this.blobClient.setMetadata(metadata, {
|
|
492
|
+
...options,
|
|
493
|
+
customerProvidedKey: (0, transforms_js_1.toBlobCpkInfo)(options.customerProvidedKey),
|
|
494
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
495
|
+
});
|
|
417
496
|
});
|
|
418
497
|
}
|
|
419
498
|
async move(destinationPathOrFileSystem, destinationPathOrOptions, options) {
|
|
@@ -423,10 +502,10 @@ class DataLakePathClient extends StorageClient_js_1.StorageClient {
|
|
|
423
502
|
if (typeof destinationPathOrOptions === "string") {
|
|
424
503
|
destinationFileSystem = destinationPathOrFileSystem;
|
|
425
504
|
destinationPath = destinationPathOrOptions;
|
|
426
|
-
pathMoveOptions = options
|
|
505
|
+
pathMoveOptions = options ?? {};
|
|
427
506
|
}
|
|
428
507
|
else {
|
|
429
|
-
pathMoveOptions = destinationPathOrOptions
|
|
508
|
+
pathMoveOptions = destinationPathOrOptions ?? {};
|
|
430
509
|
}
|
|
431
510
|
const renameSource = (0, utils_common_js_1.getURLPathAndQuery)(this.dfsEndpointUrl);
|
|
432
511
|
const split = destinationPath.split("?");
|
|
@@ -445,14 +524,21 @@ class DataLakePathClient extends StorageClient_js_1.StorageClient {
|
|
|
445
524
|
}
|
|
446
525
|
const destPathClient = new DataLakePathClient(destinationUrl, this.pipeline);
|
|
447
526
|
return tracing_js_1.tracingClient.withSpan("DataLakePathClient-move", pathMoveOptions, async (updatedOptions) => {
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
527
|
+
return (0, utils_common_js_1.assertResponse)(await destPathClient.pathContext.create({
|
|
528
|
+
...updatedOptions,
|
|
529
|
+
mode: "legacy", // By default
|
|
530
|
+
renameSource,
|
|
531
|
+
sourceLeaseId: pathMoveOptions.conditions?.leaseId,
|
|
532
|
+
leaseAccessConditions: pathMoveOptions.destinationConditions,
|
|
533
|
+
sourceModifiedAccessConditions: {
|
|
534
|
+
sourceIfMatch: pathMoveOptions.conditions?.ifMatch,
|
|
535
|
+
sourceIfNoneMatch: pathMoveOptions.conditions?.ifNoneMatch,
|
|
536
|
+
sourceIfModifiedSince: pathMoveOptions.conditions?.ifModifiedSince,
|
|
537
|
+
sourceIfUnmodifiedSince: pathMoveOptions.conditions?.ifUnmodifiedSince,
|
|
538
|
+
},
|
|
539
|
+
modifiedAccessConditions: pathMoveOptions.destinationConditions,
|
|
540
|
+
abortSignal: pathMoveOptions.abortSignal,
|
|
541
|
+
}));
|
|
456
542
|
});
|
|
457
543
|
}
|
|
458
544
|
}
|
|
@@ -470,7 +556,7 @@ class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
470
556
|
pathCreateOptions = options;
|
|
471
557
|
}
|
|
472
558
|
else {
|
|
473
|
-
pathCreateOptions = resourceTypeOrOptions
|
|
559
|
+
pathCreateOptions = resourceTypeOrOptions ?? {};
|
|
474
560
|
}
|
|
475
561
|
return tracing_js_1.tracingClient.withSpan("DataLakeDirectoryClient-create", pathCreateOptions, async (updatedOptions) => {
|
|
476
562
|
return super.create("directory", updatedOptions);
|
|
@@ -484,7 +570,9 @@ class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
484
570
|
options = resourceTypeOrOptions || {};
|
|
485
571
|
}
|
|
486
572
|
return tracing_js_1.tracingClient.withSpan("DataLakeDirectoryClient-createIfNotExists", options, async (updatedOptions) => {
|
|
487
|
-
return super.createIfNotExists("directory",
|
|
573
|
+
return super.createIfNotExists("directory", {
|
|
574
|
+
...updatedOptions,
|
|
575
|
+
});
|
|
488
576
|
});
|
|
489
577
|
}
|
|
490
578
|
/**
|
|
@@ -521,7 +609,12 @@ class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
521
609
|
if (!(this.credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential)) {
|
|
522
610
|
throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
|
|
523
611
|
}
|
|
524
|
-
const sas = (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParameters)(
|
|
612
|
+
const sas = (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParameters)({
|
|
613
|
+
fileSystemName: this.fileSystemName,
|
|
614
|
+
pathName: this.name,
|
|
615
|
+
isDirectory: true,
|
|
616
|
+
...options,
|
|
617
|
+
}, this.credential).toString();
|
|
525
618
|
resolve((0, utils_common_js_1.appendToURLQuery)(this.url, sas));
|
|
526
619
|
});
|
|
527
620
|
}
|
|
@@ -539,7 +632,12 @@ class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
539
632
|
if (!(this.credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential)) {
|
|
540
633
|
throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
|
|
541
634
|
}
|
|
542
|
-
return (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParametersInternal)(
|
|
635
|
+
return (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParametersInternal)({
|
|
636
|
+
fileSystemName: this.fileSystemName,
|
|
637
|
+
pathName: this.name,
|
|
638
|
+
isDirectory: true,
|
|
639
|
+
...options,
|
|
640
|
+
}, this.credential).stringToSign;
|
|
543
641
|
}
|
|
544
642
|
/**
|
|
545
643
|
* Generates a Service Shared Access Signature (SAS) URI based on the client properties
|
|
@@ -553,7 +651,12 @@ class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
553
651
|
*/
|
|
554
652
|
generateUserDelegationSasUrl(options, userDelegationKey) {
|
|
555
653
|
return new Promise((resolve) => {
|
|
556
|
-
const sas = (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParameters)(
|
|
654
|
+
const sas = (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParameters)({
|
|
655
|
+
fileSystemName: this.fileSystemName,
|
|
656
|
+
pathName: this.name,
|
|
657
|
+
isDirectory: true,
|
|
658
|
+
...options,
|
|
659
|
+
}, userDelegationKey, this.accountName).toString();
|
|
557
660
|
resolve((0, utils_common_js_1.appendToURLQuery)(this.url, sas));
|
|
558
661
|
});
|
|
559
662
|
}
|
|
@@ -568,7 +671,12 @@ class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
568
671
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
569
672
|
*/
|
|
570
673
|
generateUserDelegationSasStringToSign(options, userDelegationKey) {
|
|
571
|
-
return (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParametersInternal)(
|
|
674
|
+
return (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParametersInternal)({
|
|
675
|
+
fileSystemName: this.fileSystemName,
|
|
676
|
+
pathName: this.name,
|
|
677
|
+
isDirectory: true,
|
|
678
|
+
...options,
|
|
679
|
+
}, userDelegationKey, this.accountName).stringToSign;
|
|
572
680
|
}
|
|
573
681
|
}
|
|
574
682
|
exports.DataLakeDirectoryClient = DataLakeDirectoryClient;
|
|
@@ -576,6 +684,18 @@ exports.DataLakeDirectoryClient = DataLakeDirectoryClient;
|
|
|
576
684
|
* A DataLakeFileClient represents a URL to the Azure Storage file.
|
|
577
685
|
*/
|
|
578
686
|
class DataLakeFileClient extends DataLakePathClient {
|
|
687
|
+
/**
|
|
688
|
+
* pathContextInternal provided by protocol layer.
|
|
689
|
+
*/
|
|
690
|
+
pathContextInternal;
|
|
691
|
+
/**
|
|
692
|
+
* pathContextInternal provided by protocol layer, with its url pointing to the Blob endpoint.
|
|
693
|
+
*/
|
|
694
|
+
pathContextInternalToBlobEndpoint;
|
|
695
|
+
/**
|
|
696
|
+
* blockBlobClientInternal provided by `@azure/storage-blob` package.
|
|
697
|
+
*/
|
|
698
|
+
blockBlobClientInternal;
|
|
579
699
|
constructor(url, credentialOrPipeline,
|
|
580
700
|
// Legacy, no way to fix the eslint error without breaking. Disable the rule for this line.
|
|
581
701
|
/* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */
|
|
@@ -607,7 +727,7 @@ class DataLakeFileClient extends DataLakePathClient {
|
|
|
607
727
|
pathCreateOptions = options;
|
|
608
728
|
}
|
|
609
729
|
else {
|
|
610
|
-
pathCreateOptions = resourceTypeOrOptions
|
|
730
|
+
pathCreateOptions = resourceTypeOrOptions ?? {};
|
|
611
731
|
}
|
|
612
732
|
return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-create", pathCreateOptions, async (updatedOptions) => {
|
|
613
733
|
return super.create("file", updatedOptions);
|
|
@@ -704,7 +824,10 @@ class DataLakeFileClient extends DataLakePathClient {
|
|
|
704
824
|
*/
|
|
705
825
|
async read(offset = 0, count, options = {}) {
|
|
706
826
|
return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-read", options, async (updatedOptions) => {
|
|
707
|
-
const rawResponse = await this.blockBlobClientInternal.download(offset, count,
|
|
827
|
+
const rawResponse = await this.blockBlobClientInternal.download(offset, count, {
|
|
828
|
+
...updatedOptions,
|
|
829
|
+
customerProvidedKey: (0, transforms_js_1.toBlobCpkInfo)(updatedOptions.customerProvidedKey),
|
|
830
|
+
});
|
|
708
831
|
const response = (0, utils_common_js_1.ParsePathGetPropertiesExtraHeaderValues)(rawResponse);
|
|
709
832
|
if (!core_util_1.isNodeLike && !response.contentAsBlob) {
|
|
710
833
|
response.contentAsBlob = rawResponse.blobBody;
|
|
@@ -732,11 +855,24 @@ class DataLakeFileClient extends DataLakePathClient {
|
|
|
732
855
|
options.conditions = options.conditions || {};
|
|
733
856
|
return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-append", options, async (updatedOptions) => {
|
|
734
857
|
(0, utils_common_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps);
|
|
735
|
-
return (0, utils_common_js_1.assertResponse)(await this.pathContextInternal.appendData(body,
|
|
858
|
+
return (0, utils_common_js_1.assertResponse)(await this.pathContextInternal.appendData(body, {
|
|
859
|
+
...updatedOptions,
|
|
860
|
+
pathHttpHeaders: {
|
|
736
861
|
contentMD5: options.transactionalContentMD5,
|
|
737
|
-
},
|
|
862
|
+
},
|
|
863
|
+
abortSignal: options.abortSignal,
|
|
864
|
+
position: offset,
|
|
865
|
+
contentLength: length,
|
|
866
|
+
leaseAccessConditions: options.conditions,
|
|
867
|
+
requestOptions: {
|
|
738
868
|
onUploadProgress: options.onProgress,
|
|
739
|
-
},
|
|
869
|
+
},
|
|
870
|
+
cpkInfo: options.customerProvidedKey,
|
|
871
|
+
flush: options.flush,
|
|
872
|
+
proposedLeaseId: options.proposedLeaseId,
|
|
873
|
+
leaseDuration: options.leaseDurationInSeconds,
|
|
874
|
+
leaseAction: options.leaseAction,
|
|
875
|
+
}));
|
|
740
876
|
});
|
|
741
877
|
}
|
|
742
878
|
/**
|
|
@@ -755,7 +891,17 @@ class DataLakeFileClient extends DataLakePathClient {
|
|
|
755
891
|
options.conditions = options.conditions || {};
|
|
756
892
|
return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-flush", options, async (updatedOptions) => {
|
|
757
893
|
(0, utils_common_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps);
|
|
758
|
-
return (0, utils_common_js_1.assertResponse)(await this.pathContextInternal.flushData(
|
|
894
|
+
return (0, utils_common_js_1.assertResponse)(await this.pathContextInternal.flushData({
|
|
895
|
+
...updatedOptions,
|
|
896
|
+
position,
|
|
897
|
+
contentLength: 0,
|
|
898
|
+
leaseAccessConditions: options.conditions,
|
|
899
|
+
modifiedAccessConditions: options.conditions,
|
|
900
|
+
cpkInfo: options.customerProvidedKey,
|
|
901
|
+
proposedLeaseId: options.proposedLeaseId,
|
|
902
|
+
leaseDuration: options.leaseDurationInSeconds,
|
|
903
|
+
leaseAction: options.leaseAction,
|
|
904
|
+
}));
|
|
759
905
|
});
|
|
760
906
|
}
|
|
761
907
|
// high level functions
|
|
@@ -812,7 +958,6 @@ class DataLakeFileClient extends DataLakePathClient {
|
|
|
812
958
|
}
|
|
813
959
|
async uploadSeekableInternal(bodyFactory, size, options = {}) {
|
|
814
960
|
return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-uploadData", options, async (updatedOptions) => {
|
|
815
|
-
var _a;
|
|
816
961
|
if (size > constants_js_1.FILE_MAX_SIZE_BYTES) {
|
|
817
962
|
throw new RangeError(`size must be <= ${constants_js_1.FILE_MAX_SIZE_BYTES}.`);
|
|
818
963
|
}
|
|
@@ -836,7 +981,7 @@ class DataLakeFileClient extends DataLakePathClient {
|
|
|
836
981
|
await createRes;
|
|
837
982
|
}
|
|
838
983
|
// After the File is Create, Lease ID is the only valid request parameter.
|
|
839
|
-
options.conditions = { leaseId:
|
|
984
|
+
options.conditions = { leaseId: options.conditions?.leaseId };
|
|
840
985
|
if (!options.chunkSize) {
|
|
841
986
|
options.chunkSize = Math.ceil(size / constants_js_1.BLOCK_BLOB_MAX_BLOCKS);
|
|
842
987
|
if (options.chunkSize < constants_js_1.FILE_UPLOAD_DEFAULT_CHUNK_SIZE) {
|
|
@@ -929,7 +1074,6 @@ class DataLakeFileClient extends DataLakePathClient {
|
|
|
929
1074
|
*/
|
|
930
1075
|
async uploadStream(stream, options = {}) {
|
|
931
1076
|
return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-uploadStream", options, async (updatedOptions) => {
|
|
932
|
-
var _a;
|
|
933
1077
|
// Create the file
|
|
934
1078
|
await this.create({
|
|
935
1079
|
abortSignal: options.abortSignal,
|
|
@@ -943,7 +1087,7 @@ class DataLakeFileClient extends DataLakePathClient {
|
|
|
943
1087
|
encryptionContext: updatedOptions.encryptionContext,
|
|
944
1088
|
});
|
|
945
1089
|
// After the File is Create, Lease ID is the only valid request parameter.
|
|
946
|
-
options.conditions = { leaseId:
|
|
1090
|
+
options.conditions = { leaseId: options.conditions?.leaseId };
|
|
947
1091
|
if (!options.chunkSize) {
|
|
948
1092
|
options.chunkSize = constants_js_1.FILE_UPLOAD_DEFAULT_CHUNK_SIZE;
|
|
949
1093
|
}
|
|
@@ -1003,10 +1147,22 @@ class DataLakeFileClient extends DataLakePathClient {
|
|
|
1003
1147
|
}
|
|
1004
1148
|
return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-readToBuffer", options, async (updatedOptions) => {
|
|
1005
1149
|
if (buffer) {
|
|
1006
|
-
return this.blockBlobClientInternal.downloadToBuffer(buffer, offset, count,
|
|
1150
|
+
return this.blockBlobClientInternal.downloadToBuffer(buffer, offset, count, {
|
|
1151
|
+
...options,
|
|
1152
|
+
maxRetryRequestsPerBlock: options.maxRetryRequestsPerChunk,
|
|
1153
|
+
blockSize: options.chunkSize,
|
|
1154
|
+
customerProvidedKey: (0, transforms_js_1.toBlobCpkInfo)(options.customerProvidedKey),
|
|
1155
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
1156
|
+
});
|
|
1007
1157
|
}
|
|
1008
1158
|
else {
|
|
1009
|
-
return this.blockBlobClientInternal.downloadToBuffer(offset, count,
|
|
1159
|
+
return this.blockBlobClientInternal.downloadToBuffer(offset, count, {
|
|
1160
|
+
...options,
|
|
1161
|
+
maxRetryRequestsPerBlock: options.maxRetryRequestsPerChunk,
|
|
1162
|
+
blockSize: options.chunkSize,
|
|
1163
|
+
customerProvidedKey: (0, transforms_js_1.toBlobCpkInfo)(options.customerProvidedKey),
|
|
1164
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
1165
|
+
});
|
|
1010
1166
|
}
|
|
1011
1167
|
});
|
|
1012
1168
|
}
|
|
@@ -1028,7 +1184,10 @@ class DataLakeFileClient extends DataLakePathClient {
|
|
|
1028
1184
|
*/
|
|
1029
1185
|
async readToFile(filePath, offset = 0, count, options = {}) {
|
|
1030
1186
|
return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-readToFile", options, async (updatedOptions) => {
|
|
1031
|
-
const rawResposne = await this.blockBlobClientInternal.downloadToFile(filePath, offset, count,
|
|
1187
|
+
const rawResposne = await this.blockBlobClientInternal.downloadToFile(filePath, offset, count, {
|
|
1188
|
+
...updatedOptions,
|
|
1189
|
+
customerProvidedKey: (0, transforms_js_1.toBlobCpkInfo)(options.customerProvidedKey),
|
|
1190
|
+
});
|
|
1032
1191
|
const response = (0, utils_common_js_1.ParsePathGetPropertiesExtraHeaderValues)(rawResposne);
|
|
1033
1192
|
return response;
|
|
1034
1193
|
});
|
|
@@ -1079,7 +1238,10 @@ class DataLakeFileClient extends DataLakePathClient {
|
|
|
1079
1238
|
*/
|
|
1080
1239
|
async query(query, options = {}) {
|
|
1081
1240
|
return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-query", options, async (updatedOptions) => {
|
|
1082
|
-
const rawResponse = await this.blockBlobClientInternal.query(query,
|
|
1241
|
+
const rawResponse = await this.blockBlobClientInternal.query(query, {
|
|
1242
|
+
...updatedOptions,
|
|
1243
|
+
customerProvidedKey: (0, transforms_js_1.toBlobCpkInfo)(options.customerProvidedKey),
|
|
1244
|
+
});
|
|
1083
1245
|
const response = rawResponse;
|
|
1084
1246
|
if (!core_util_1.isNodeLike && !response.contentAsBlob) {
|
|
1085
1247
|
response.contentAsBlob = rawResponse.blobBody;
|
|
@@ -1100,7 +1262,6 @@ class DataLakeFileClient extends DataLakePathClient {
|
|
|
1100
1262
|
*/
|
|
1101
1263
|
async setExpiry(mode, options = {}) {
|
|
1102
1264
|
return tracing_js_1.tracingClient.withSpan("DataLakeFileClient-setExpiry", options, async (updatedOptions) => {
|
|
1103
|
-
var _a;
|
|
1104
1265
|
let expiresOn = undefined;
|
|
1105
1266
|
if (mode === "RelativeToNow" || mode === "RelativeToCreation") {
|
|
1106
1267
|
if (!options.timeToExpireInMs) {
|
|
@@ -1115,12 +1276,15 @@ class DataLakeFileClient extends DataLakePathClient {
|
|
|
1115
1276
|
}
|
|
1116
1277
|
const now = new Date();
|
|
1117
1278
|
if (!(options.expiresOn.getTime() > now.getTime())) {
|
|
1118
|
-
throw new Error(`options.expiresOn should be later than now: ${now.toUTCString()} when using mode ${mode}, but is ${
|
|
1279
|
+
throw new Error(`options.expiresOn should be later than now: ${now.toUTCString()} when using mode ${mode}, but is ${options.expiresOn?.toUTCString()}`);
|
|
1119
1280
|
}
|
|
1120
1281
|
expiresOn = options.expiresOn.toUTCString();
|
|
1121
1282
|
}
|
|
1122
|
-
const adaptedOptions =
|
|
1123
|
-
return (0, utils_common_js_1.assertResponse)(await this.pathContextInternalToBlobEndpoint.setExpiry(mode,
|
|
1283
|
+
const adaptedOptions = { ...options, expiresOn };
|
|
1284
|
+
return (0, utils_common_js_1.assertResponse)(await this.pathContextInternalToBlobEndpoint.setExpiry(mode, {
|
|
1285
|
+
...adaptedOptions,
|
|
1286
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
1287
|
+
}));
|
|
1124
1288
|
});
|
|
1125
1289
|
}
|
|
1126
1290
|
/**
|
|
@@ -1139,7 +1303,11 @@ class DataLakeFileClient extends DataLakePathClient {
|
|
|
1139
1303
|
if (!(this.credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential)) {
|
|
1140
1304
|
throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
|
|
1141
1305
|
}
|
|
1142
|
-
const sas = (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParameters)(
|
|
1306
|
+
const sas = (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParameters)({
|
|
1307
|
+
fileSystemName: this.fileSystemName,
|
|
1308
|
+
pathName: this.name,
|
|
1309
|
+
...options,
|
|
1310
|
+
}, this.credential).toString();
|
|
1143
1311
|
resolve((0, utils_common_js_1.appendToURLQuery)(this.url, sas));
|
|
1144
1312
|
});
|
|
1145
1313
|
}
|
|
@@ -1159,7 +1327,11 @@ class DataLakeFileClient extends DataLakePathClient {
|
|
|
1159
1327
|
if (!(this.credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential)) {
|
|
1160
1328
|
throw RangeError("Can only generate the SAS when the client is initialized with a shared key credential");
|
|
1161
1329
|
}
|
|
1162
|
-
return (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParametersInternal)(
|
|
1330
|
+
return (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParametersInternal)({
|
|
1331
|
+
fileSystemName: this.fileSystemName,
|
|
1332
|
+
pathName: this.name,
|
|
1333
|
+
...options,
|
|
1334
|
+
}, this.credential).stringToSign;
|
|
1163
1335
|
}
|
|
1164
1336
|
/**
|
|
1165
1337
|
* Generates a Service Shared Access Signature (SAS) URI based on the client properties
|
|
@@ -1173,7 +1345,11 @@ class DataLakeFileClient extends DataLakePathClient {
|
|
|
1173
1345
|
*/
|
|
1174
1346
|
generateUserDelegationSasUrl(options, userDelegationKey) {
|
|
1175
1347
|
return new Promise((resolve) => {
|
|
1176
|
-
const sas = (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParameters)(
|
|
1348
|
+
const sas = (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParameters)({
|
|
1349
|
+
fileSystemName: this.fileSystemName,
|
|
1350
|
+
pathName: this.name,
|
|
1351
|
+
...options,
|
|
1352
|
+
}, userDelegationKey, this.accountName).toString();
|
|
1177
1353
|
resolve((0, utils_common_js_1.appendToURLQuery)(this.url, sas));
|
|
1178
1354
|
});
|
|
1179
1355
|
}
|
|
@@ -1188,7 +1364,11 @@ class DataLakeFileClient extends DataLakePathClient {
|
|
|
1188
1364
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
1189
1365
|
*/
|
|
1190
1366
|
generateUserDelegationSasStringToSign(options, userDelegationKey) {
|
|
1191
|
-
return (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParametersInternal)(
|
|
1367
|
+
return (0, DataLakeSASSignatureValues_js_1.generateDataLakeSASQueryParametersInternal)({
|
|
1368
|
+
fileSystemName: this.fileSystemName,
|
|
1369
|
+
pathName: this.name,
|
|
1370
|
+
...options,
|
|
1371
|
+
}, userDelegationKey, this.accountName).stringToSign;
|
|
1192
1372
|
}
|
|
1193
1373
|
}
|
|
1194
1374
|
exports.DataLakeFileClient = DataLakeFileClient;
|