@azure/storage-file-datalake 12.28.0-beta.1 → 12.28.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.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 +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.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 +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/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/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.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 +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.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 +15 -4
- 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/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.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 +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.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 +15 -4
- 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/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.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 +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.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 +15 -4
- 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/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.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 +36 -36
package/dist/browser/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,
|
|
@@ -174,8 +188,17 @@ 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
|
/**
|
|
@@ -188,15 +211,25 @@ export class DataLakePathClient extends StorageClient {
|
|
|
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,7 +246,10 @@ 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
|
/**
|
|
@@ -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;
|
|
@@ -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
|
}
|
|
@@ -284,8 +333,20 @@ export class DataLakePathClient extends StorageClient {
|
|
|
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
|
/**
|
|
@@ -299,7 +360,12 @@ 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
|
/**
|
|
@@ -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
|
/**
|
|
@@ -370,7 +441,11 @@ export class DataLakePathClient extends StorageClient {
|
|
|
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
|
}
|
|
@@ -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
|
/**
|
|
@@ -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
|
}
|
|
@@ -535,7 +628,12 @@ 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
|
|
@@ -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
|
}
|
|
@@ -564,13 +667,30 @@ export class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
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);
|
|
@@ -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;
|
|
@@ -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
|
/**
|
|
@@ -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
|
}
|
|
@@ -1154,7 +1322,11 @@ 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
|
|
@@ -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
|
}
|
|
@@ -1183,7 +1359,11 @@ export class DataLakeFileClient extends DataLakePathClient {
|
|
|
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
|