@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
|
@@ -20,32 +20,40 @@ var BatchStates;
|
|
|
20
20
|
* But Batch cannot cancel ongoing operations, you need to cancel them by yourself.
|
|
21
21
|
*/
|
|
22
22
|
class Batch {
|
|
23
|
+
/**
|
|
24
|
+
* Concurrency. Must be lager than 0.
|
|
25
|
+
*/
|
|
26
|
+
concurrency;
|
|
27
|
+
/**
|
|
28
|
+
* Number of active operations under execution.
|
|
29
|
+
*/
|
|
30
|
+
actives = 0;
|
|
31
|
+
/**
|
|
32
|
+
* Number of completed operations under execution.
|
|
33
|
+
*/
|
|
34
|
+
completed = 0;
|
|
35
|
+
/**
|
|
36
|
+
* Offset of next operation to be executed.
|
|
37
|
+
*/
|
|
38
|
+
offset = 0;
|
|
39
|
+
/**
|
|
40
|
+
* Operation array to be executed.
|
|
41
|
+
*/
|
|
42
|
+
operations = [];
|
|
43
|
+
/**
|
|
44
|
+
* States of Batch. When an error happens, state will turn into error.
|
|
45
|
+
* Batch will stop execute left operations.
|
|
46
|
+
*/
|
|
47
|
+
state = BatchStates.Good;
|
|
48
|
+
/**
|
|
49
|
+
* A private emitter used to pass events inside this class.
|
|
50
|
+
*/
|
|
51
|
+
emitter;
|
|
23
52
|
/**
|
|
24
53
|
* Creates an instance of Batch.
|
|
25
54
|
* @param concurrency -
|
|
26
55
|
*/
|
|
27
56
|
constructor(concurrency = 5) {
|
|
28
|
-
/**
|
|
29
|
-
* Number of active operations under execution.
|
|
30
|
-
*/
|
|
31
|
-
this.actives = 0;
|
|
32
|
-
/**
|
|
33
|
-
* Number of completed operations under execution.
|
|
34
|
-
*/
|
|
35
|
-
this.completed = 0;
|
|
36
|
-
/**
|
|
37
|
-
* Offset of next operation to be executed.
|
|
38
|
-
*/
|
|
39
|
-
this.offset = 0;
|
|
40
|
-
/**
|
|
41
|
-
* Operation array to be executed.
|
|
42
|
-
*/
|
|
43
|
-
this.operations = [];
|
|
44
|
-
/**
|
|
45
|
-
* States of Batch. When an error happens, state will turn into error.
|
|
46
|
-
* Batch will stop execute left operations.
|
|
47
|
-
*/
|
|
48
|
-
this.state = BatchStates.Good;
|
|
49
57
|
if (concurrency < 1) {
|
|
50
58
|
throw new RangeError("concurrency must be larger than 0");
|
|
51
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Batch.js","sourceRoot":"","sources":["../../../src/utils/Batch.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,8FAA8F;AAC9F,mCAAmC;AACnC,mCAAsC;AAOtC;;GAEG;AACH,IAAK,WAGJ;AAHD,WAAK,WAAW;IACd,6CAAI,CAAA;IACJ,+CAAK,CAAA;AACP,CAAC,EAHI,WAAW,KAAX,WAAW,QAGf;AAED;;;;GAIG;AACH,MAAa,KAAK;
|
|
1
|
+
{"version":3,"file":"Batch.js","s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AAC;YACvC,IAAI,SAAS,EAAE,CAAC;gBACd,SAAS,EAAE,CAAC;YACd,CAAC;iBAAM,CAAC;gBACN,OAAO;YACT,CAAC;QACH,CAAC;IACH,CAAC;CACF;AA3HD,sBA2HC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// In browser, during webpack or browserify bundling, this module will be replaced by 'events'\n// https://github.com/Gozala/events\nimport { EventEmitter } from \"events\";\n\n/**\n * Operation is an async function to be executed and managed by Batch.\n */\nexport declare type Operation = () => Promise<any>;\n\n/**\n * States for Batch.\n */\nenum BatchStates {\n Good,\n Error,\n}\n\n/**\n * Batch provides basic parallel execution with concurrency limits.\n * Will stop execute left operations when one of the executed operation throws an error.\n * But Batch cannot cancel ongoing operations, you need to cancel them by yourself.\n */\nexport class Batch {\n /**\n * Concurrency. Must be lager than 0.\n */\n private concurrency: number;\n\n /**\n * Number of active operations under execution.\n */\n private actives: number = 0;\n\n /**\n * Number of completed operations under execution.\n */\n private completed: number = 0;\n\n /**\n * Offset of next operation to be executed.\n */\n private offset: number = 0;\n\n /**\n * Operation array to be executed.\n */\n private operations: Operation[] = [];\n\n /**\n * States of Batch. When an error happens, state will turn into error.\n * Batch will stop execute left operations.\n */\n private state: BatchStates = BatchStates.Good;\n\n /**\n * A private emitter used to pass events inside this class.\n */\n private emitter: EventEmitter;\n\n /**\n * Creates an instance of Batch.\n * @param concurrency -\n */\n public constructor(concurrency: number = 5) {\n if (concurrency < 1) {\n throw new RangeError(\"concurrency must be larger than 0\");\n }\n this.concurrency = concurrency;\n this.emitter = new EventEmitter();\n }\n\n /**\n * Add a operation into queue.\n *\n * @param operation -\n */\n public addOperation(operation: Operation): void {\n this.operations.push(async () => {\n try {\n this.actives++;\n await operation();\n this.actives--;\n this.completed++;\n this.parallelExecute();\n } catch (error: any) {\n this.emitter.emit(\"error\", error);\n }\n });\n }\n\n /**\n * Start execute operations in the queue.\n *\n */\n public async do(): Promise<void> {\n if (this.operations.length === 0) {\n return Promise.resolve();\n }\n this.parallelExecute();\n\n return new Promise<void>((resolve, reject) => {\n this.emitter.on(\"finish\", resolve);\n\n this.emitter.on(\"error\", (error) => {\n this.state = BatchStates.Error;\n reject(error);\n });\n });\n }\n\n /**\n * Get next operation to be executed. Return null when reaching ends.\n *\n */\n private nextOperation(): Operation | null {\n if (this.offset < this.operations.length) {\n return this.operations[this.offset++];\n }\n return null;\n }\n\n /**\n * Start execute operations. One one the most important difference between\n * this method with do() is that do() wraps as an sync method.\n *\n */\n private parallelExecute(): void {\n if (this.state === BatchStates.Error) {\n return;\n }\n\n if (this.completed >= this.operations.length) {\n this.emitter.emit(\"finish\");\n return;\n }\n\n while (this.actives < this.concurrency) {\n const operation = this.nextOperation();\n if (operation) {\n operation();\n } else {\n return;\n }\n }\n }\n}\n"]}
|
|
@@ -27,6 +27,76 @@ const node_events_1 = require("node:events");
|
|
|
27
27
|
* Outgoing queue shouldn't be empty.
|
|
28
28
|
*/
|
|
29
29
|
class BufferScheduler {
|
|
30
|
+
/**
|
|
31
|
+
* Size of buffers in incoming and outgoing queues. This class will try to align
|
|
32
|
+
* data read from Readable stream into buffer chunks with bufferSize defined.
|
|
33
|
+
*/
|
|
34
|
+
bufferSize;
|
|
35
|
+
/**
|
|
36
|
+
* How many buffers can be created or maintained.
|
|
37
|
+
*/
|
|
38
|
+
maxBuffers;
|
|
39
|
+
/**
|
|
40
|
+
* A Node.js Readable stream.
|
|
41
|
+
*/
|
|
42
|
+
readable;
|
|
43
|
+
/**
|
|
44
|
+
* OutgoingHandler is an async function triggered by BufferScheduler when there
|
|
45
|
+
* are available buffers in outgoing array.
|
|
46
|
+
*/
|
|
47
|
+
outgoingHandler;
|
|
48
|
+
/**
|
|
49
|
+
* An internal event emitter.
|
|
50
|
+
*/
|
|
51
|
+
emitter = new node_events_1.EventEmitter();
|
|
52
|
+
/**
|
|
53
|
+
* Concurrency of executing outgoingHandlers. (0 lesser than concurrency lesser than or equal to maxBuffers)
|
|
54
|
+
*/
|
|
55
|
+
concurrency;
|
|
56
|
+
/**
|
|
57
|
+
* An internal offset marker to track data offset in bytes of next outgoingHandler.
|
|
58
|
+
*/
|
|
59
|
+
offset = 0;
|
|
60
|
+
/**
|
|
61
|
+
* An internal marker to track whether stream is end.
|
|
62
|
+
*/
|
|
63
|
+
isStreamEnd = false;
|
|
64
|
+
/**
|
|
65
|
+
* An internal marker to track whether stream or outgoingHandler returns error.
|
|
66
|
+
*/
|
|
67
|
+
isError = false;
|
|
68
|
+
/**
|
|
69
|
+
* How many handlers are executing.
|
|
70
|
+
*/
|
|
71
|
+
executingOutgoingHandlers = 0;
|
|
72
|
+
/**
|
|
73
|
+
* Encoding of the input Readable stream which has string data type instead of Buffer.
|
|
74
|
+
*/
|
|
75
|
+
encoding;
|
|
76
|
+
/**
|
|
77
|
+
* How many buffers have been allocated.
|
|
78
|
+
*/
|
|
79
|
+
numBuffers = 0;
|
|
80
|
+
/**
|
|
81
|
+
* Because this class doesn't know how much data every time stream pops, which
|
|
82
|
+
* is defined by highWaterMarker of the stream. So BufferScheduler will cache
|
|
83
|
+
* data received from the stream, when data in unresolvedDataArray exceeds the
|
|
84
|
+
* blockSize defined, it will try to concat a blockSize of buffer, fill into available
|
|
85
|
+
* buffers from incoming and push to outgoing array.
|
|
86
|
+
*/
|
|
87
|
+
unresolvedDataArray = [];
|
|
88
|
+
/**
|
|
89
|
+
* How much data consisted in unresolvedDataArray.
|
|
90
|
+
*/
|
|
91
|
+
unresolvedLength = 0;
|
|
92
|
+
/**
|
|
93
|
+
* The array includes all the available buffers can be used to fill data from stream.
|
|
94
|
+
*/
|
|
95
|
+
incoming = [];
|
|
96
|
+
/**
|
|
97
|
+
* The array (queue) includes all the buffers filled from stream data.
|
|
98
|
+
*/
|
|
99
|
+
outgoing = [];
|
|
30
100
|
/**
|
|
31
101
|
* Creates an instance of BufferScheduler.
|
|
32
102
|
*
|
|
@@ -40,50 +110,6 @@ class BufferScheduler {
|
|
|
40
110
|
* @param encoding - [Optional] Encoding of Readable stream when it's a string stream
|
|
41
111
|
*/
|
|
42
112
|
constructor(readable, bufferSize, maxBuffers, outgoingHandler, concurrency, encoding) {
|
|
43
|
-
/**
|
|
44
|
-
* An internal event emitter.
|
|
45
|
-
*/
|
|
46
|
-
this.emitter = new node_events_1.EventEmitter();
|
|
47
|
-
/**
|
|
48
|
-
* An internal offset marker to track data offset in bytes of next outgoingHandler.
|
|
49
|
-
*/
|
|
50
|
-
this.offset = 0;
|
|
51
|
-
/**
|
|
52
|
-
* An internal marker to track whether stream is end.
|
|
53
|
-
*/
|
|
54
|
-
this.isStreamEnd = false;
|
|
55
|
-
/**
|
|
56
|
-
* An internal marker to track whether stream or outgoingHandler returns error.
|
|
57
|
-
*/
|
|
58
|
-
this.isError = false;
|
|
59
|
-
/**
|
|
60
|
-
* How many handlers are executing.
|
|
61
|
-
*/
|
|
62
|
-
this.executingOutgoingHandlers = 0;
|
|
63
|
-
/**
|
|
64
|
-
* How many buffers have been allocated.
|
|
65
|
-
*/
|
|
66
|
-
this.numBuffers = 0;
|
|
67
|
-
/**
|
|
68
|
-
* Because this class doesn't know how much data every time stream pops, which
|
|
69
|
-
* is defined by highWaterMarker of the stream. So BufferScheduler will cache
|
|
70
|
-
* data received from the stream, when data in unresolvedDataArray exceeds the
|
|
71
|
-
* blockSize defined, it will try to concat a blockSize of buffer, fill into available
|
|
72
|
-
* buffers from incoming and push to outgoing array.
|
|
73
|
-
*/
|
|
74
|
-
this.unresolvedDataArray = [];
|
|
75
|
-
/**
|
|
76
|
-
* How much data consisted in unresolvedDataArray.
|
|
77
|
-
*/
|
|
78
|
-
this.unresolvedLength = 0;
|
|
79
|
-
/**
|
|
80
|
-
* The array includes all the available buffers can be used to fill data from stream.
|
|
81
|
-
*/
|
|
82
|
-
this.incoming = [];
|
|
83
|
-
/**
|
|
84
|
-
* The array (queue) includes all the buffers filled from stream data.
|
|
85
|
-
*/
|
|
86
|
-
this.outgoing = [];
|
|
87
113
|
if (bufferSize <= 0) {
|
|
88
114
|
throw new RangeError(`bufferSize must be larger than 0, current is ${bufferSize}`);
|
|
89
115
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BufferScheduler.js","sourceRoot":"","sources":["../../../src/utils/BufferScheduler.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,6CAA2C;AAQ3C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAa,eAAe;IAuF1B;;;;;;;;;;;OAWG;IACH,YACE,QAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,eAAgC,EAChC,WAAmB,EACnB,QAAyB;QAlF3B;;WAEG;QACc,YAAO,GAAiB,IAAI,0BAAY,EAAE,CAAC;QAO5D;;WAEG;QACK,WAAM,GAAW,CAAC,CAAC;QAE3B;;WAEG;QACK,gBAAW,GAAY,KAAK,CAAC;QAErC;;WAEG;QACK,YAAO,GAAY,KAAK,CAAC;QAEjC;;WAEG;QACK,8BAAyB,GAAW,CAAC,CAAC;QAO9C;;WAEG;QACK,eAAU,GAAW,CAAC,CAAC;QAE/B;;;;;;WAMG;QACK,wBAAmB,GAAa,EAAE,CAAC;QAE3C;;WAEG;QACK,qBAAgB,GAAW,CAAC,CAAC;QAErC;;WAEG;QACK,aAAQ,GAAa,EAAE,CAAC;QAEhC;;WAEG;QACK,aAAQ,GAAa,EAAE,CAAC;QAsB9B,IAAI,UAAU,IAAI,CAAC,EAAE,CAAC;YACpB,MAAM,IAAI,UAAU,CAAC,gDAAgD,UAAU,EAAE,CAAC,CAAC;QACrF,CAAC;QAED,IAAI,UAAU,IAAI,CAAC,EAAE,CAAC;YACpB,MAAM,IAAI,UAAU,CAAC,gDAAgD,UAAU,EAAE,CAAC,CAAC;QACrF,CAAC;QAED,IAAI,WAAW,IAAI,CAAC,EAAE,CAAC;YACrB,MAAM,IAAI,UAAU,CAAC,iDAAiD,WAAW,EAAE,CAAC,CAAC;QACvF,CAAC;QAED,IAAI,CAAC,UAAU,GAA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,EAAE,CAAC;YAClB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;YAChC,OAAO;QACT,CAAC;QAED,IAAI,CAAC,yBAAyB,EAAE,CAAC;QACjC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QACzB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACK,WAAW,CAAC,MAAc;QAChC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3B,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YAC7D,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACzB,CAAC;IACH,CAAC;CACF;AA9SD,0CA8SC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { EventEmitter } from \"node:events\";\nimport type { Readable } from \"node:stream\";\n\n/**\n * OutgoingHandler is an async function triggered by BufferScheduler.\n */\nexport declare type OutgoingHandler = (buffer: Buffer, offset?: number) => Promise<any>;\n\n/**\n * This class accepts a Node.js Readable stream as input, and keeps reading data\n * from the stream into the internal buffer structure, until it reaches maxBuffers.\n * Every available buffer will try to trigger outgoingHandler.\n *\n * The internal buffer structure includes an incoming buffer array, and a outgoing\n * buffer array. The incoming buffer array includes the \"empty\" buffers can be filled\n * with new incoming data. The outgoing array includes the filled buffers to be\n * handled by outgoingHandler. Every above buffer size is defined by parameter bufferSize.\n *\n * NUM_OF_ALL_BUFFERS = BUFFERS_IN_INCOMING + BUFFERS_IN_OUTGOING + BUFFERS_UNDER_HANDLING\n *\n * NUM_OF_ALL_BUFFERS lesser than or equal to maxBuffers\n *\n * PERFORMANCE IMPROVEMENT TIPS:\n * 1. Input stream highWaterMark is better to set a same value with bufferSize\n * parameter, which will avoid Buffer.concat() operations.\n * 2. concurrency should set a smaller value than maxBuffers, which is helpful to\n * reduce the possibility when a outgoing handler waits for the stream data.\n * in this situation, outgoing handlers are blocked.\n * Outgoing queue shouldn't be empty.\n */\nexport class BufferScheduler {\n /**\n * Size of buffers in incoming and outgoing queues. This class will try to align\n * data read from Readable stream into buffer chunks with bufferSize defined.\n */\n private readonly bufferSize: number;\n\n /**\n * How many buffers can be created or maintained.\n */\n private readonly maxBuffers: number;\n\n /**\n * A Node.js Readable stream.\n */\n private readonly readable: Readable;\n\n /**\n * OutgoingHandler is an async function triggered by BufferScheduler when there\n * are available buffers in outgoing array.\n */\n private readonly outgoingHandler: OutgoingHandler;\n\n /**\n * An internal event emitter.\n */\n private readonly emitter: EventEmitter = new EventEmitter();\n\n /**\n * Concurrency of executing outgoingHandlers. (0 lesser than concurrency lesser than or equal to maxBuffers)\n */\n private readonly concurrency: number;\n\n /**\n * An internal offset marker to track data offset in bytes of next outgoingHandler.\n */\n private offset: number = 0;\n\n /**\n * An internal marker to track whether stream is end.\n */\n private isStreamEnd: boolean = false;\n\n /**\n * An internal marker to track whether stream or outgoingHandler returns error.\n */\n private isError: boolean = false;\n\n /**\n * How many handlers are executing.\n */\n private executingOutgoingHandlers: number = 0;\n\n /**\n * Encoding of the input Readable stream which has string data type instead of Buffer.\n */\n private encoding?: BufferEncoding;\n\n /**\n * How many buffers have been allocated.\n */\n private numBuffers: number = 0;\n\n /**\n * Because this class doesn't know how much data every time stream pops, which\n * is defined by highWaterMarker of the stream. So BufferScheduler will cache\n * data received from the stream, when data in unresolvedDataArray exceeds the\n * blockSize defined, it will try to concat a blockSize of buffer, fill into available\n * buffers from incoming and push to outgoing array.\n */\n private unresolvedDataArray: Buffer[] = [];\n\n /**\n * How much data consisted in unresolvedDataArray.\n */\n private unresolvedLength: number = 0;\n\n /**\n * The array includes all the available buffers can be used to fill data from stream.\n */\n private incoming: Buffer[] = [];\n\n /**\n * The array (queue) includes all the buffers filled from stream data.\n */\n private outgoing: Buffer[] = [];\n\n /**\n * Creates an instance of BufferScheduler.\n *\n * @param readable - A Node.js Readable stream\n * @param bufferSize - Buffer size of every maintained buffer\n * @param maxBuffers - How many buffers can be allocated\n * @param outgoingHandler - An async function scheduled to be\n * triggered when a buffer fully filled\n * with stream data\n * @param concurrency - Concurrency of executing outgoingHandlers (greater than 0)\n * @param encoding - [Optional] Encoding of Readable stream when it's a string stream\n */\n constructor(\n readable: Readable,\n bufferSize: number,\n maxBuffers: number,\n outgoingHandler: OutgoingHandler,\n concurrency: number,\n encoding?: BufferEncoding,\n ) {\n if (bufferSize <= 0) {\n throw new RangeError(`bufferSize must be larger than 0, current is ${bufferSize}`);\n }\n\n if (maxBuffers <= 0) {\n throw new RangeError(`maxBuffers must be larger than 0, current is ${maxBuffers}`);\n }\n\n if (concurrency <= 0) {\n throw new RangeError(`concurrency must be larger than 0, current is ${concurrency}`);\n }\n\n this.bufferSize = bufferSize;\n this.maxBuffers = maxBuffers;\n this.readable = readable;\n this.outgoingHandler = outgoingHandler;\n this.concurrency = concurrency;\n this.encoding = encoding;\n }\n\n /**\n * Start the scheduler, will return error when stream of any of the outgoingHandlers\n * returns error.\n *\n */\n public async do(): Promise<void> {\n return new Promise<void>((resolve, reject) => {\n this.readable.on(\"data\", (data) => {\n data = typeof data === \"string\" ? Buffer.from(data, this.encoding) : data;\n this.appendUnresolvedData(data);\n\n if (!this.resolveData()) {\n this.readable.pause();\n }\n });\n\n this.readable.on(\"error\", (err) => {\n this.emitter.emit(\"error\", err);\n });\n\n this.readable.on(\"end\", () => {\n this.isStreamEnd = true;\n this.emitter.emit(\"checkEnd\");\n });\n\n this.emitter.on(\"error\", (err) => {\n this.isError = true;\n this.readable.pause();\n reject(err);\n });\n\n this.emitter.on(\"checkEnd\", () => {\n if (this.outgoing.length > 0) {\n this.triggerOutgoingHandlers();\n return;\n }\n\n if (this.isStreamEnd && this.executingOutgoingHandlers === 0) {\n if (this.unresolvedLength > 0 && this.unresolvedLength < this.bufferSize) {\n this.outgoingHandler(this.shiftBufferFromUnresolvedDataArray(), this.offset)\n .then(resolve)\n .catch(reject);\n } else if (this.unresolvedLength >= this.bufferSize) {\n return;\n } else {\n resolve();\n }\n }\n });\n });\n }\n\n /**\n * Insert a new data into unresolved array.\n *\n * @param data -\n */\n private appendUnresolvedData(data: Buffer) {\n this.unresolvedDataArray.push(data);\n this.unresolvedLength += data.length;\n }\n\n /**\n * Try to shift a buffer with size in blockSize. The buffer returned may be less\n * than blockSize when data in unresolvedDataArray is less than bufferSize.\n *\n */\n private shiftBufferFromUnresolvedDataArray(): Buffer {\n if (this.unresolvedLength >= this.bufferSize) {\n if (this.bufferSize === this.unresolvedDataArray[0].length) {\n this.unresolvedLength -= this.bufferSize;\n return this.unresolvedDataArray.shift()!;\n }\n\n // Lazy concat because Buffer.concat highly drops performance\n let merged = Buffer.concat(this.unresolvedDataArray, this.unresolvedLength);\n const buffer = merged.slice(0, this.bufferSize);\n merged = merged.slice(this.bufferSize);\n this.unresolvedDataArray = [merged];\n this.unresolvedLength -= buffer.length;\n return buffer;\n } else if (this.unresolvedLength > 0) {\n const merged = Buffer.concat(this.unresolvedDataArray, this.unresolvedLength);\n this.unresolvedDataArray = [];\n this.unresolvedLength = 0;\n return merged;\n } else {\n return Buffer.allocUnsafe(0);\n }\n }\n\n /**\n * Resolve data in unresolvedDataArray. For every buffer with size in blockSize\n * shifted, it will try to get (or allocate a buffer) from incoming, and fill it,\n * then push it into outgoing to be handled by outgoing handler.\n *\n * Return false when available buffers in incoming are not enough, else true.\n *\n * @returns Return false when buffers in incoming are not enough, else true.\n */\n private resolveData(): boolean {\n while (this.unresolvedLength >= this.bufferSize) {\n let buffer: Buffer;\n\n if (this.incoming.length > 0) {\n buffer = this.incoming.shift()!;\n } else {\n if (this.numBuffers < this.maxBuffers) {\n buffer = Buffer.allocUnsafe(this.bufferSize);\n this.numBuffers++;\n } else {\n // No available buffer, wait for buffer returned\n return false;\n }\n }\n\n buffer.fill(this.shiftBufferFromUnresolvedDataArray());\n this.outgoing.push(buffer);\n this.triggerOutgoingHandlers();\n }\n return true;\n }\n\n /**\n * Try to trigger a outgoing handler for every buffer in outgoing. Stop when\n * concurrency reaches.\n */\n private async triggerOutgoingHandlers() {\n let buffer: Buffer | undefined;\n do {\n if (this.executingOutgoingHandlers >= this.concurrency) {\n return;\n }\n\n buffer = this.outgoing.shift();\n if (buffer) {\n this.triggerOutgoingHandler(buffer);\n }\n } while (buffer);\n }\n\n /**\n * Trigger a outgoing handler for a buffer shifted from outgoing.\n *\n * @param buffer -\n */\n private async triggerOutgoingHandler(buffer: Buffer): Promise<any> {\n const bufferLength = buffer.length;\n\n this.executingOutgoingHandlers++;\n this.offset += bufferLength;\n\n try {\n await this.outgoingHandler(buffer, this.offset - bufferLength);\n } catch (err: any) {\n this.emitter.emit(\"error\", err);\n return;\n }\n\n this.executingOutgoingHandlers--;\n this.reuseBuffer(buffer);\n this.emitter.emit(\"checkEnd\");\n }\n\n /**\n * Return buffer used by outgoing handler into incoming.\n *\n * @param buffer -\n */\n private reuseBuffer(buffer: Buffer) {\n this.incoming.push(buffer);\n if (!this.isError && this.resolveData() && !this.isStreamEnd) {\n this.readable.resume();\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"BufferScheduler.js","sourceRoot":"","sources":["../../../src/utils/BufferScheduler.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,6CAA2C;AAQ3C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAa,eAAe;IAC1B;;;OAGG;IACc,UAAU,CAAS;IAEpC;;OAEG;IACc,UAAU,CAAS;IAEpC;;OAEG;IACc,QAAQ,CAAW;IAEpC;;;OAGG;IACc,eAAe,CAAkB;IAElD;;OAEG;IACc,OAAO,GAAiB,IAAI,0BAAY,EAAE,CAAC;IAE5D;;OAEG;IACc,WAAW,CAAS;IAErC;;OAEG;IACK,MAAM,GAAW,CAAC,CAAC;IAE3B;;OAEG;IACK,WAAW,GAAY,KA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AAC,OAAO,IAAI,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YAC7D,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACzB,CAAC;IACH,CAAC;CACF;AA9SD,0CA8SC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { EventEmitter } from \"node:events\";\nimport type { Readable } from \"node:stream\";\n\n/**\n * OutgoingHandler is an async function triggered by BufferScheduler.\n */\nexport declare type OutgoingHandler = (buffer: Buffer, offset?: number) => Promise<any>;\n\n/**\n * This class accepts a Node.js Readable stream as input, and keeps reading data\n * from the stream into the internal buffer structure, until it reaches maxBuffers.\n * Every available buffer will try to trigger outgoingHandler.\n *\n * The internal buffer structure includes an incoming buffer array, and a outgoing\n * buffer array. The incoming buffer array includes the \"empty\" buffers can be filled\n * with new incoming data. The outgoing array includes the filled buffers to be\n * handled by outgoingHandler. Every above buffer size is defined by parameter bufferSize.\n *\n * NUM_OF_ALL_BUFFERS = BUFFERS_IN_INCOMING + BUFFERS_IN_OUTGOING + BUFFERS_UNDER_HANDLING\n *\n * NUM_OF_ALL_BUFFERS lesser than or equal to maxBuffers\n *\n * PERFORMANCE IMPROVEMENT TIPS:\n * 1. Input stream highWaterMark is better to set a same value with bufferSize\n * parameter, which will avoid Buffer.concat() operations.\n * 2. concurrency should set a smaller value than maxBuffers, which is helpful to\n * reduce the possibility when a outgoing handler waits for the stream data.\n * in this situation, outgoing handlers are blocked.\n * Outgoing queue shouldn't be empty.\n */\nexport class BufferScheduler {\n /**\n * Size of buffers in incoming and outgoing queues. This class will try to align\n * data read from Readable stream into buffer chunks with bufferSize defined.\n */\n private readonly bufferSize: number;\n\n /**\n * How many buffers can be created or maintained.\n */\n private readonly maxBuffers: number;\n\n /**\n * A Node.js Readable stream.\n */\n private readonly readable: Readable;\n\n /**\n * OutgoingHandler is an async function triggered by BufferScheduler when there\n * are available buffers in outgoing array.\n */\n private readonly outgoingHandler: OutgoingHandler;\n\n /**\n * An internal event emitter.\n */\n private readonly emitter: EventEmitter = new EventEmitter();\n\n /**\n * Concurrency of executing outgoingHandlers. (0 lesser than concurrency lesser than or equal to maxBuffers)\n */\n private readonly concurrency: number;\n\n /**\n * An internal offset marker to track data offset in bytes of next outgoingHandler.\n */\n private offset: number = 0;\n\n /**\n * An internal marker to track whether stream is end.\n */\n private isStreamEnd: boolean = false;\n\n /**\n * An internal marker to track whether stream or outgoingHandler returns error.\n */\n private isError: boolean = false;\n\n /**\n * How many handlers are executing.\n */\n private executingOutgoingHandlers: number = 0;\n\n /**\n * Encoding of the input Readable stream which has string data type instead of Buffer.\n */\n private encoding?: BufferEncoding;\n\n /**\n * How many buffers have been allocated.\n */\n private numBuffers: number = 0;\n\n /**\n * Because this class doesn't know how much data every time stream pops, which\n * is defined by highWaterMarker of the stream. So BufferScheduler will cache\n * data received from the stream, when data in unresolvedDataArray exceeds the\n * blockSize defined, it will try to concat a blockSize of buffer, fill into available\n * buffers from incoming and push to outgoing array.\n */\n private unresolvedDataArray: Buffer[] = [];\n\n /**\n * How much data consisted in unresolvedDataArray.\n */\n private unresolvedLength: number = 0;\n\n /**\n * The array includes all the available buffers can be used to fill data from stream.\n */\n private incoming: Buffer[] = [];\n\n /**\n * The array (queue) includes all the buffers filled from stream data.\n */\n private outgoing: Buffer[] = [];\n\n /**\n * Creates an instance of BufferScheduler.\n *\n * @param readable - A Node.js Readable stream\n * @param bufferSize - Buffer size of every maintained buffer\n * @param maxBuffers - How many buffers can be allocated\n * @param outgoingHandler - An async function scheduled to be\n * triggered when a buffer fully filled\n * with stream data\n * @param concurrency - Concurrency of executing outgoingHandlers (greater than 0)\n * @param encoding - [Optional] Encoding of Readable stream when it's a string stream\n */\n constructor(\n readable: Readable,\n bufferSize: number,\n maxBuffers: number,\n outgoingHandler: OutgoingHandler,\n concurrency: number,\n encoding?: BufferEncoding,\n ) {\n if (bufferSize <= 0) {\n throw new RangeError(`bufferSize must be larger than 0, current is ${bufferSize}`);\n }\n\n if (maxBuffers <= 0) {\n throw new RangeError(`maxBuffers must be larger than 0, current is ${maxBuffers}`);\n }\n\n if (concurrency <= 0) {\n throw new RangeError(`concurrency must be larger than 0, current is ${concurrency}`);\n }\n\n this.bufferSize = bufferSize;\n this.maxBuffers = maxBuffers;\n this.readable = readable;\n this.outgoingHandler = outgoingHandler;\n this.concurrency = concurrency;\n this.encoding = encoding;\n }\n\n /**\n * Start the scheduler, will return error when stream of any of the outgoingHandlers\n * returns error.\n *\n */\n public async do(): Promise<void> {\n return new Promise<void>((resolve, reject) => {\n this.readable.on(\"data\", (data) => {\n data = typeof data === \"string\" ? Buffer.from(data, this.encoding) : data;\n this.appendUnresolvedData(data);\n\n if (!this.resolveData()) {\n this.readable.pause();\n }\n });\n\n this.readable.on(\"error\", (err) => {\n this.emitter.emit(\"error\", err);\n });\n\n this.readable.on(\"end\", () => {\n this.isStreamEnd = true;\n this.emitter.emit(\"checkEnd\");\n });\n\n this.emitter.on(\"error\", (err) => {\n this.isError = true;\n this.readable.pause();\n reject(err);\n });\n\n this.emitter.on(\"checkEnd\", () => {\n if (this.outgoing.length > 0) {\n this.triggerOutgoingHandlers();\n return;\n }\n\n if (this.isStreamEnd && this.executingOutgoingHandlers === 0) {\n if (this.unresolvedLength > 0 && this.unresolvedLength < this.bufferSize) {\n this.outgoingHandler(this.shiftBufferFromUnresolvedDataArray(), this.offset)\n .then(resolve)\n .catch(reject);\n } else if (this.unresolvedLength >= this.bufferSize) {\n return;\n } else {\n resolve();\n }\n }\n });\n });\n }\n\n /**\n * Insert a new data into unresolved array.\n *\n * @param data -\n */\n private appendUnresolvedData(data: Buffer) {\n this.unresolvedDataArray.push(data);\n this.unresolvedLength += data.length;\n }\n\n /**\n * Try to shift a buffer with size in blockSize. The buffer returned may be less\n * than blockSize when data in unresolvedDataArray is less than bufferSize.\n *\n */\n private shiftBufferFromUnresolvedDataArray(): Buffer {\n if (this.unresolvedLength >= this.bufferSize) {\n if (this.bufferSize === this.unresolvedDataArray[0].length) {\n this.unresolvedLength -= this.bufferSize;\n return this.unresolvedDataArray.shift()!;\n }\n\n // Lazy concat because Buffer.concat highly drops performance\n let merged = Buffer.concat(this.unresolvedDataArray, this.unresolvedLength);\n const buffer = merged.slice(0, this.bufferSize);\n merged = merged.slice(this.bufferSize);\n this.unresolvedDataArray = [merged];\n this.unresolvedLength -= buffer.length;\n return buffer;\n } else if (this.unresolvedLength > 0) {\n const merged = Buffer.concat(this.unresolvedDataArray, this.unresolvedLength);\n this.unresolvedDataArray = [];\n this.unresolvedLength = 0;\n return merged;\n } else {\n return Buffer.allocUnsafe(0);\n }\n }\n\n /**\n * Resolve data in unresolvedDataArray. For every buffer with size in blockSize\n * shifted, it will try to get (or allocate a buffer) from incoming, and fill it,\n * then push it into outgoing to be handled by outgoing handler.\n *\n * Return false when available buffers in incoming are not enough, else true.\n *\n * @returns Return false when buffers in incoming are not enough, else true.\n */\n private resolveData(): boolean {\n while (this.unresolvedLength >= this.bufferSize) {\n let buffer: Buffer;\n\n if (this.incoming.length > 0) {\n buffer = this.incoming.shift()!;\n } else {\n if (this.numBuffers < this.maxBuffers) {\n buffer = Buffer.allocUnsafe(this.bufferSize);\n this.numBuffers++;\n } else {\n // No available buffer, wait for buffer returned\n return false;\n }\n }\n\n buffer.fill(this.shiftBufferFromUnresolvedDataArray());\n this.outgoing.push(buffer);\n this.triggerOutgoingHandlers();\n }\n return true;\n }\n\n /**\n * Try to trigger a outgoing handler for every buffer in outgoing. Stop when\n * concurrency reaches.\n */\n private async triggerOutgoingHandlers() {\n let buffer: Buffer | undefined;\n do {\n if (this.executingOutgoingHandlers >= this.concurrency) {\n return;\n }\n\n buffer = this.outgoing.shift();\n if (buffer) {\n this.triggerOutgoingHandler(buffer);\n }\n } while (buffer);\n }\n\n /**\n * Trigger a outgoing handler for a buffer shifted from outgoing.\n *\n * @param buffer -\n */\n private async triggerOutgoingHandler(buffer: Buffer): Promise<any> {\n const bufferLength = buffer.length;\n\n this.executingOutgoingHandlers++;\n this.offset += bufferLength;\n\n try {\n await this.outgoingHandler(buffer, this.offset - bufferLength);\n } catch (err: any) {\n this.emitter.emit(\"error\", err);\n return;\n }\n\n this.executingOutgoingHandlers--;\n this.reuseBuffer(buffer);\n this.emitter.emit(\"checkEnd\");\n }\n\n /**\n * Return buffer used by outgoing handler into incoming.\n *\n * @param buffer -\n */\n private reuseBuffer(buffer: Buffer) {\n this.incoming.push(buffer);\n if (!this.isError && this.resolveData() && !this.isStreamEnd) {\n this.readable.resume();\n }\n }\n}\n"]}
|
|
@@ -5,6 +5,14 @@ exports.DataLakeAclChangeFailedError = void 0;
|
|
|
5
5
|
* An error thrown when an operation is interrupted and can be continued later on.
|
|
6
6
|
*/
|
|
7
7
|
class DataLakeAclChangeFailedError extends Error {
|
|
8
|
+
/**
|
|
9
|
+
* Continuation token to continue next batch of operations.
|
|
10
|
+
*/
|
|
11
|
+
continuationToken;
|
|
12
|
+
/**
|
|
13
|
+
* Internal error.
|
|
14
|
+
*/
|
|
15
|
+
innerError;
|
|
8
16
|
constructor(error, continuationToken) {
|
|
9
17
|
super(error.message);
|
|
10
18
|
this.name = "DataLakeAclChangeFailedError";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataLakeAclChangeFailedError.js","sourceRoot":"","sources":["../../../src/utils/DataLakeAclChangeFailedError.ts"],"names":[],"mappings":";;;AAIA;;GAEG;AACH,MAAa,4BAA6B,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"DataLakeAclChangeFailedError.js","sourceRoot":"","sources":["../../../src/utils/DataLakeAclChangeFailedError.ts"],"names":[],"mappings":";;;AAIA;;GAEG;AACH,MAAa,4BAA6B,SAAQ,KAAK;IACrD;;OAEG;IACI,iBAAiB,CAAU;IAElC;;OAEG;IACI,UAAU,CAAoB;IAErC,YAAY,KAAwB,EAAE,iBAA0B;QAC9D,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC;QAC3C,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,4BAA4B,CAAC,SAAS,CAAC,CAAC;IACtE,CAAC;CACF;AAlBD,oEAkBC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { RestError } from \"@azure/core-rest-pipeline\";\n\n/**\n * An error thrown when an operation is interrupted and can be continued later on.\n */\nexport class DataLakeAclChangeFailedError extends Error {\n /**\n * Continuation token to continue next batch of operations.\n */\n public continuationToken?: string;\n\n /**\n * Internal error.\n */\n public innerError: RestError | Error;\n\n constructor(error: RestError | Error, continuationToken?: string) {\n super(error.message);\n this.name = \"DataLakeAclChangeFailedError\";\n this.innerError = error;\n this.continuationToken = continuationToken;\n Object.setPrototypeOf(this, DataLakeAclChangeFailedError.prototype);\n }\n}\n"]}
|
|
@@ -10,6 +10,10 @@ const index_js_1 = require("../generated/src/operations/index.js");
|
|
|
10
10
|
* help to construct a path client to expose Path context with blob endpoint.
|
|
11
11
|
*/
|
|
12
12
|
class PathClientInternal extends clients_js_1.DataLakePathClient {
|
|
13
|
+
/**
|
|
14
|
+
* Path context with blob endpoint.
|
|
15
|
+
*/
|
|
16
|
+
blobPathContext;
|
|
13
17
|
/**
|
|
14
18
|
* Creates an instance of DataLakePathClient from url and pipeline.
|
|
15
19
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PathClientInternal.js","sourceRoot":"","sources":["../../../src/utils/PathClientInternal.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AACvC,kCAAkC;AAClC,8CAAmD;AACnD,mEAAkF;AAGlF;;;GAGG;AACH,MAAa,kBAAmB,SAAQ,+BAAkB;
|
|
1
|
+
{"version":3,"file":"PathClientInternal.js","sourceRoot":"","sources":["../../../src/utils/PathClientInternal.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AACvC,kCAAkC;AAClC,8CAAmD;AACnD,mEAAkF;AAGlF;;;GAGG;AACH,MAAa,kBAAmB,SAAQ,+BAAkB;IACxD;;OAEG;IACI,eAAe,CAAO;IAE7B;;;;;;;;OAQG;IACH,YAAmB,GAAW,EAAE,QAAkB;QAChD,KAAK,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACrB,IAAI,CAAC,eAAe,GAAG,IAAI,6BAAI,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;IAC3E,CAAC;CACF;AAnBD,gDAmBC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { DataLakePathClient } from \"../clients.js\";\nimport { PathOperationsImpl as Path } from \"../generated/src/operations/index.js\";\nimport type { Pipeline } from \"@azure/storage-blob\";\n\n/**\n * A PathClientInternal represents a URL to the Azure Storage path (directory or file) to\n * help to construct a path client to expose Path context with blob endpoint.\n */\nexport class PathClientInternal extends DataLakePathClient {\n /**\n * Path context with blob endpoint.\n */\n public blobPathContext: Path;\n\n /**\n * Creates an instance of DataLakePathClient from url and pipeline.\n *\n * @param url - A Client string pointing to Azure Storage data lake path (directory or file), such as\n * \"https://myaccount.dfs.core.windows.net/filesystem/directory\" or \"https://myaccount.dfs.core.windows.net/filesystem/file\".\n * You can append a SAS if using AnonymousCredential, such as \"https://myaccount.dfs.core.windows.net/filesystem/directory?sasString\".\n * @param pipeline - Call newPipeline() to create a default\n * pipeline, or provide a customized pipeline.\n */\n public constructor(url: string, pipeline: Pipeline) {\n super(url, pipeline);\n this.blobPathContext = new Path(this.storageClientContextToBlobEndpoint);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/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Licensed under the MIT License.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.PathStylePorts = exports.PathResultTypeConstants = exports.EncryptionAlgorithmAES25 = exports.DeletionIdKey = exports.ETagAny = exports.ToDfsEndpointHostMappings = exports.ToBlobEndpointHostMappings = exports.DevelopmentConnectionString = exports.HeaderConstants = exports.HttpUrlConnection = exports.UrlConstants = exports.StorageDataLakeLoggingAllowedQueryParameters = exports.StorageDataLakeLoggingAllowedHeaderNames = exports.StorageOAuthScopes = exports.FILE_MAX_SIZE_BYTES = exports.BLOCK_BLOB_MAX_BLOCKS = exports.FILE_UPLOAD_DEFAULT_CHUNK_SIZE = exports.FILE_UPLOAD_MAX_CHUNK_SIZE = exports.FILE_MAX_SINGLE_UPLOAD_THRESHOLD = exports.DEFAULT_HIGH_LEVEL_CONCURRENCY = exports.TB = exports.GB = exports.MB = exports.KB = exports.SERVICE_VERSION = exports.SDK_VERSION = void 0;
|
|
6
|
-
exports.SDK_VERSION = "12.27.0
|
|
6
|
+
exports.SDK_VERSION = "12.27.0";
|
|
7
7
|
exports.SERVICE_VERSION = "2025-07-05";
|
|
8
8
|
exports.KB = 1024;
|
|
9
9
|
exports.MB = exports.KB * 1024;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAErB,QAAA,WAAW,GAAW,gBAAgB,CAAC;AACvC,QAAA,eAAe,GAAW,YAAY,CAAC;AAEvC,QAAA,EAAE,GAAW,IAAI,CAAC;AAClB,QAAA,EAAE,GAAW,UAAE,GAAG,IAAI,CAAC;AACvB,QAAA,EAAE,GAAW,UAAE,GAAG,IAAI,CAAC;AACvB,QAAA,EAAE,GAAW,UAAE,GAAG,IAAI,CAAC;AAEvB,QAAA,8BAA8B,GAAW,CAAC,CAAC;AAC3C,QAAA,gCAAgC,GAAW,GAAG,GAAG,U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2BAA2B,CAAC;IAC3D,CAAC,yBAAyB,EAAE,wBAAwB,CAAC;IACrD,CAAC,wBAAwB,EAAE,uBAAuB,CAAC;CACpD,CAAC;AAEW,QAAA,OAAO,GAAG,GAAG,CAAC;AAEd,QAAA,aAAa,GAAG,YAAY,CAAC;AAC7B,QAAA,wBAAwB,GAAG,QAAQ,CAAC;AAEpC,QAAA,uBAAuB,GAAG;IACrC,gBAAgB,EAAE,MAAM;IACxB,qBAAqB,EAAE,WAAW;CACnC,CAAC;AAEF,iDAAiD;AACjD,wGAAwG;AAC3F,QAAA,cAAc,GAAG;IAC5B,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;CACR,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const SDK_VERSION: string = \"12.27.0-beta.1\";\nexport const SERVICE_VERSION: string = \"2025-07-05\";\n\nexport const KB: number = 1024;\nexport const MB: number = KB * 1024;\nexport const GB: number = MB * 1024;\nexport const TB: number = GB * 1024;\n\nexport const DEFAULT_HIGH_LEVEL_CONCURRENCY: number = 5;\nexport const FILE_MAX_SINGLE_UPLOAD_THRESHOLD: number = 100 * MB;\nexport const FILE_UPLOAD_MAX_CHUNK_SIZE: number = 4000 * MB;\nexport const FILE_UPLOAD_DEFAULT_CHUNK_SIZE: number = 8 * MB;\nexport const BLOCK_BLOB_MAX_BLOCKS: number = 50000;\nexport const FILE_MAX_SIZE_BYTES: number = BLOCK_BLOB_MAX_BLOCKS * FILE_UPLOAD_MAX_CHUNK_SIZE;\n\n/**\n * The OAuth scope to use with Azure Storage.\n */\nexport const StorageOAuthScopes: string | string[] = \"https://storage.azure.com/.default\";\n\nexport const StorageDataLakeLoggingAllowedHeaderNames = [\n \"Access-Control-Allow-Origin\",\n \"Cache-Control\",\n \"Content-Length\",\n \"Content-Type\",\n \"Date\",\n \"Request-Id\",\n \"traceparent\",\n \"Transfer-Encoding\",\n \"User-Agent\",\n \"x-ms-client-request-id\",\n \"x-ms-date\",\n \"x-ms-error-code\",\n \"x-ms-request-id\",\n \"x-ms-return-client-request-id\",\n \"x-ms-version\",\n \"Accept-Ranges\",\n \"Content-Disposition\",\n \"Content-Encoding\",\n \"Content-Language\",\n \"Content-MD5\",\n \"Content-Range\",\n \"ETag\",\n \"Last-Modified\",\n \"Server\",\n \"Vary\",\n \"x-ms-content-crc64\",\n \"x-ms-copy-action\",\n \"x-ms-copy-completion-time\",\n \"x-ms-copy-id\",\n \"x-ms-copy-progress\",\n \"x-ms-copy-status\",\n \"x-ms-has-immutability-policy\",\n \"x-ms-has-legal-hold\",\n \"x-ms-lease-state\",\n \"x-ms-lease-status\",\n \"x-ms-range\",\n \"x-ms-request-server-encrypted\",\n \"x-ms-server-encrypted\",\n \"x-ms-snapshot\",\n \"x-ms-source-range\",\n \"If-Match\",\n \"If-Modified-Since\",\n \"If-None-Match\",\n \"If-Unmodified-Since\",\n \"x-ms-access-tier\",\n \"x-ms-access-tier-change-time\",\n \"x-ms-access-tier-inferred\",\n \"x-ms-account-kind\",\n \"x-ms-archive-status\",\n \"x-ms-blob-append-offset\",\n \"x-ms-blob-cache-control\",\n \"x-ms-blob-committed-block-count\",\n \"x-ms-blob-condition-appendpos\",\n \"x-ms-blob-condition-maxsize\",\n \"x-ms-blob-content-disposition\",\n \"x-ms-blob-content-encoding\",\n \"x-ms-blob-content-language\",\n \"x-ms-blob-content-length\",\n \"x-ms-blob-content-md5\",\n \"x-ms-blob-content-type\",\n \"x-ms-blob-public-access\",\n \"x-ms-blob-sequence-number\",\n \"x-ms-blob-type\",\n \"x-ms-copy-destination-snapshot\",\n \"x-ms-creation-time\",\n \"x-ms-default-encryption-scope\",\n \"x-ms-delete-snapshots\",\n \"x-ms-delete-type-permanent\",\n \"x-ms-deny-encryption-scope-override\",\n \"x-ms-encryption-algorithm\",\n \"x-ms-if-sequence-number-eq\",\n \"x-ms-if-sequence-number-le\",\n \"x-ms-if-sequence-number-lt\",\n \"x-ms-incremental-copy\",\n \"x-ms-lease-action\",\n \"x-ms-lease-break-period\",\n \"x-ms-lease-duration\",\n \"x-ms-lease-id\",\n \"x-ms-lease-time\",\n \"x-ms-page-write\",\n \"x-ms-proposed-lease-id\",\n \"x-ms-range-get-content-md5\",\n \"x-ms-rehydrate-priority\",\n \"x-ms-sequence-number-action\",\n \"x-ms-sku-name\",\n \"x-ms-source-content-md5\",\n \"x-ms-source-if-match\",\n \"x-ms-source-if-modified-since\",\n \"x-ms-source-if-none-match\",\n \"x-ms-source-if-unmodified-since\",\n \"x-ms-tag-count\",\n \"x-ms-encryption-key-sha256\",\n];\n\nexport const StorageDataLakeLoggingAllowedQueryParameters = [\n \"comp\",\n \"maxresults\",\n \"rscc\",\n \"rscd\",\n \"rsce\",\n \"rscl\",\n \"rsct\",\n \"se\",\n \"si\",\n \"sip\",\n \"sp\",\n \"spr\",\n \"sr\",\n \"srt\",\n \"ss\",\n \"st\",\n \"sv\",\n \"include\",\n \"marker\",\n \"prefix\",\n \"copyid\",\n \"restype\",\n \"blockid\",\n \"blocklisttype\",\n \"delimiter\",\n \"prevsnapshot\",\n \"ske\",\n \"skoid\",\n \"sks\",\n \"skt\",\n \"sktid\",\n \"skv\",\n \"snapshot\",\n];\n\nexport const UrlConstants = {\n Parameters: {\n FORCE_BROWSER_NO_CACHE: \"_\",\n SIGNATURE: \"sig\",\n SNAPSHOT: \"snapshot\",\n TIMEOUT: \"timeout\",\n },\n};\n\nexport const HttpUrlConnection = {\n HTTP_ACCEPTED: 202,\n HTTP_CONFLICT: 409,\n HTTP_NOT_FOUND: 404,\n HTTP_PRECON_FAILED: 412,\n HTTP_RANGE_NOT_SATISFIABLE: 416,\n};\n\nexport const HeaderConstants = {\n AUTHORIZATION: \"Authorization\",\n AUTHORIZATION_SCHEME: \"Bearer\",\n CONTENT_ENCODING: \"Content-Encoding\",\n CONTENT_ID: \"Content-ID\",\n CONTENT_LANGUAGE: \"Content-Language\",\n CONTENT_LENGTH: \"Content-Length\",\n CONTENT_MD5: \"Content-Md5\",\n CONTENT_TRANSFER_ENCODING: \"Content-Transfer-Encoding\",\n CONTENT_TYPE: \"Content-Type\",\n COOKIE: \"Cookie\",\n DATE: \"date\",\n IF_MATCH: \"if-match\",\n IF_MODIFIED_SINCE: \"if-modified-since\",\n IF_NONE_MATCH: \"if-none-match\",\n IF_UNMODIFIED_SINCE: \"if-unmodified-since\",\n PREFIX_FOR_STORAGE: \"x-ms-\",\n RANGE: \"Range\",\n USER_AGENT: \"User-Agent\",\n X_MS_CLIENT_REQUEST_ID: \"x-ms-client-request-id\",\n X_MS_COPY_SOURCE: \"x-ms-copy-source\",\n X_MS_DATE: \"x-ms-date\",\n X_MS_ERROR_CODE: \"x-ms-error-code\",\n X_MS_VERSION: \"x-ms-version\",\n};\n\nexport const DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`;\n\n// Mapping pairs to transform url from dfs endpoint to blob endpoint\n// Customize this value to add more mapping patterns\nexport const ToBlobEndpointHostMappings = [\n [\"dfs.preprod.core.windows.net\", \"blob.preprod.core.windows.net\"],\n [\"dfs.core.windows.net\", \"blob.core.windows.net\"],\n [\"dfs.core.chinacloudapi.cn\", \"blob.core.chinacloudapi.cn\"],\n [\"dfs.core.usgovcloudapi.net\", \"blob.core.usgovcloudapi.net\"],\n [\"dfs.core.cloudapi.de\", \"blob.core.cloudapi.de\"],\n [\"dfs.core.microsoft.scloud\", \"blob.core.microsoft.scloud\"],\n [\"dfs.core.eaglex.ic.gov\", \"blob.core.eaglex.ic.gov\"],\n [\"dfs.storage.azure.net\", \"blob.storage.azure.net\"],\n];\n\n// Mapping pairs to transform url from blob endpoint to dfs endpoint\n// Customize this value to add more mapping patterns\nexport const ToDfsEndpointHostMappings = [\n [\"blob.preprod.core.windows.net\", \"dfs.preprod.core.windows.net\"],\n [\"blob.core.windows.net\", \"dfs.core.windows.net\"],\n [\"blob.core.chinacloudapi.cn\", \"dfs.core.chinacloudapi.cn\"],\n [\"blob.core.usgovcloudapi.net\", \"dfs.core.usgovcloudapi.net\"],\n [\"blob.core.cloudapi.de\", \"dfs.core.cloudapi.de\"],\n [\"blob.core.microsoft.scloud\", \"dfs.core.microsoft.scloud\"],\n [\"blob.core.eaglex.ic.gov\", \"dfs.core.eaglex.ic.gov\"],\n [\"blob.storage.azure.net\", \"dfs.storage.azure.net\"],\n];\n\nexport const ETagAny = \"*\";\n\nexport const DeletionIdKey = \"deletionid\";\nexport const EncryptionAlgorithmAES25 = \"AES256\";\n\nexport const PathResultTypeConstants = {\n FileResourceType: \"file\",\n DirectoryResourceType: \"directory\",\n};\n\n/// List of ports used for path style addressing.\n/// Path style addressing means that storage account is put in URI's Path segment in instead of in host.\nexport const PathStylePorts = [\n \"10000\",\n \"10001\",\n \"10002\",\n \"10003\",\n \"10004\",\n \"10100\",\n \"10101\",\n \"10102\",\n \"10103\",\n \"10104\",\n \"11000\",\n \"11001\",\n \"11002\",\n \"11003\",\n \"11004\",\n \"11100\",\n \"11101\",\n \"11102\",\n \"11103\",\n \"11104\",\n];\n"]}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAErB,QAAA,WAAW,GAAW,SAAS,CAAC;AAChC,QAAA,eAAe,GAAW,YAAY,CAAC;AAEvC,QAAA,EAAE,GAAW,IAAI,CAAC;AAClB,QAAA,EAAE,GAAW,UAAE,GAAG,IAAI,CAAC;AACvB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EAAE,sBAAsB,CAAC;IACjD,CAAC,4BAA4B,EAAE,2BAA2B,CAAC;IAC3D,CAAC,6BAA6B,EAAE,4BAA4B,CAAC;IAC7D,CAAC,uBAAuB,EAAE,sBAAsB,CAAC;IACjD,CAAC,4BAA4B,EAAE,2BAA2B,CAAC;IAC3D,CAAC,yBAAyB,EAAE,wBAAwB,CAAC;IACrD,CAAC,wBAAwB,EAAE,uBAAuB,CAAC;CACpD,CAAC;AAEW,QAAA,OAAO,GAAG,GAAG,CAAC;AAEd,QAAA,aAAa,GAAG,YAAY,CAAC;AAC7B,QAAA,wBAAwB,GAAG,QAAQ,CAAC;AAEpC,QAAA,uBAAuB,GAAG;IACrC,gBAAgB,EAAE,MAAM;IACxB,qBAAqB,EAAE,WAAW;CACnC,CAAC;AAEF,iDAAiD;AACjD,wGAAwG;AAC3F,QAAA,cAAc,GAAG;IAC5B,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;CACR,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const SDK_VERSION: string = \"12.27.0\";\nexport const SERVICE_VERSION: string = \"2025-07-05\";\n\nexport const KB: number = 1024;\nexport const MB: number = KB * 1024;\nexport const GB: number = MB * 1024;\nexport const TB: number = GB * 1024;\n\nexport const DEFAULT_HIGH_LEVEL_CONCURRENCY: number = 5;\nexport const FILE_MAX_SINGLE_UPLOAD_THRESHOLD: number = 100 * MB;\nexport const FILE_UPLOAD_MAX_CHUNK_SIZE: number = 4000 * MB;\nexport const FILE_UPLOAD_DEFAULT_CHUNK_SIZE: number = 8 * MB;\nexport const BLOCK_BLOB_MAX_BLOCKS: number = 50000;\nexport const FILE_MAX_SIZE_BYTES: number = BLOCK_BLOB_MAX_BLOCKS * FILE_UPLOAD_MAX_CHUNK_SIZE;\n\n/**\n * The OAuth scope to use with Azure Storage.\n */\nexport const StorageOAuthScopes: string | string[] = \"https://storage.azure.com/.default\";\n\nexport const StorageDataLakeLoggingAllowedHeaderNames = [\n \"Access-Control-Allow-Origin\",\n \"Cache-Control\",\n \"Content-Length\",\n \"Content-Type\",\n \"Date\",\n \"Request-Id\",\n \"traceparent\",\n \"Transfer-Encoding\",\n \"User-Agent\",\n \"x-ms-client-request-id\",\n \"x-ms-date\",\n \"x-ms-error-code\",\n \"x-ms-request-id\",\n \"x-ms-return-client-request-id\",\n \"x-ms-version\",\n \"Accept-Ranges\",\n \"Content-Disposition\",\n \"Content-Encoding\",\n \"Content-Language\",\n \"Content-MD5\",\n \"Content-Range\",\n \"ETag\",\n \"Last-Modified\",\n \"Server\",\n \"Vary\",\n \"x-ms-content-crc64\",\n \"x-ms-copy-action\",\n \"x-ms-copy-completion-time\",\n \"x-ms-copy-id\",\n \"x-ms-copy-progress\",\n \"x-ms-copy-status\",\n \"x-ms-has-immutability-policy\",\n \"x-ms-has-legal-hold\",\n \"x-ms-lease-state\",\n \"x-ms-lease-status\",\n \"x-ms-range\",\n \"x-ms-request-server-encrypted\",\n \"x-ms-server-encrypted\",\n \"x-ms-snapshot\",\n \"x-ms-source-range\",\n \"If-Match\",\n \"If-Modified-Since\",\n \"If-None-Match\",\n \"If-Unmodified-Since\",\n \"x-ms-access-tier\",\n \"x-ms-access-tier-change-time\",\n \"x-ms-access-tier-inferred\",\n \"x-ms-account-kind\",\n \"x-ms-archive-status\",\n \"x-ms-blob-append-offset\",\n \"x-ms-blob-cache-control\",\n \"x-ms-blob-committed-block-count\",\n \"x-ms-blob-condition-appendpos\",\n \"x-ms-blob-condition-maxsize\",\n \"x-ms-blob-content-disposition\",\n \"x-ms-blob-content-encoding\",\n \"x-ms-blob-content-language\",\n \"x-ms-blob-content-length\",\n \"x-ms-blob-content-md5\",\n \"x-ms-blob-content-type\",\n \"x-ms-blob-public-access\",\n \"x-ms-blob-sequence-number\",\n \"x-ms-blob-type\",\n \"x-ms-copy-destination-snapshot\",\n \"x-ms-creation-time\",\n \"x-ms-default-encryption-scope\",\n \"x-ms-delete-snapshots\",\n \"x-ms-delete-type-permanent\",\n \"x-ms-deny-encryption-scope-override\",\n \"x-ms-encryption-algorithm\",\n \"x-ms-if-sequence-number-eq\",\n \"x-ms-if-sequence-number-le\",\n \"x-ms-if-sequence-number-lt\",\n \"x-ms-incremental-copy\",\n \"x-ms-lease-action\",\n \"x-ms-lease-break-period\",\n \"x-ms-lease-duration\",\n \"x-ms-lease-id\",\n \"x-ms-lease-time\",\n \"x-ms-page-write\",\n \"x-ms-proposed-lease-id\",\n \"x-ms-range-get-content-md5\",\n \"x-ms-rehydrate-priority\",\n \"x-ms-sequence-number-action\",\n \"x-ms-sku-name\",\n \"x-ms-source-content-md5\",\n \"x-ms-source-if-match\",\n \"x-ms-source-if-modified-since\",\n \"x-ms-source-if-none-match\",\n \"x-ms-source-if-unmodified-since\",\n \"x-ms-tag-count\",\n \"x-ms-encryption-key-sha256\",\n];\n\nexport const StorageDataLakeLoggingAllowedQueryParameters = [\n \"comp\",\n \"maxresults\",\n \"rscc\",\n \"rscd\",\n \"rsce\",\n \"rscl\",\n \"rsct\",\n \"se\",\n \"si\",\n \"sip\",\n \"sp\",\n \"spr\",\n \"sr\",\n \"srt\",\n \"ss\",\n \"st\",\n \"sv\",\n \"include\",\n \"marker\",\n \"prefix\",\n \"copyid\",\n \"restype\",\n \"blockid\",\n \"blocklisttype\",\n \"delimiter\",\n \"prevsnapshot\",\n \"ske\",\n \"skoid\",\n \"sks\",\n \"skt\",\n \"sktid\",\n \"skv\",\n \"snapshot\",\n];\n\nexport const UrlConstants = {\n Parameters: {\n FORCE_BROWSER_NO_CACHE: \"_\",\n SIGNATURE: \"sig\",\n SNAPSHOT: \"snapshot\",\n TIMEOUT: \"timeout\",\n },\n};\n\nexport const HttpUrlConnection = {\n HTTP_ACCEPTED: 202,\n HTTP_CONFLICT: 409,\n HTTP_NOT_FOUND: 404,\n HTTP_PRECON_FAILED: 412,\n HTTP_RANGE_NOT_SATISFIABLE: 416,\n};\n\nexport const HeaderConstants = {\n AUTHORIZATION: \"Authorization\",\n AUTHORIZATION_SCHEME: \"Bearer\",\n CONTENT_ENCODING: \"Content-Encoding\",\n CONTENT_ID: \"Content-ID\",\n CONTENT_LANGUAGE: \"Content-Language\",\n CONTENT_LENGTH: \"Content-Length\",\n CONTENT_MD5: \"Content-Md5\",\n CONTENT_TRANSFER_ENCODING: \"Content-Transfer-Encoding\",\n CONTENT_TYPE: \"Content-Type\",\n COOKIE: \"Cookie\",\n DATE: \"date\",\n IF_MATCH: \"if-match\",\n IF_MODIFIED_SINCE: \"if-modified-since\",\n IF_NONE_MATCH: \"if-none-match\",\n IF_UNMODIFIED_SINCE: \"if-unmodified-since\",\n PREFIX_FOR_STORAGE: \"x-ms-\",\n RANGE: \"Range\",\n USER_AGENT: \"User-Agent\",\n X_MS_CLIENT_REQUEST_ID: \"x-ms-client-request-id\",\n X_MS_COPY_SOURCE: \"x-ms-copy-source\",\n X_MS_DATE: \"x-ms-date\",\n X_MS_ERROR_CODE: \"x-ms-error-code\",\n X_MS_VERSION: \"x-ms-version\",\n};\n\nexport const DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`;\n\n// Mapping pairs to transform url from dfs endpoint to blob endpoint\n// Customize this value to add more mapping patterns\nexport const ToBlobEndpointHostMappings = [\n [\"dfs.preprod.core.windows.net\", \"blob.preprod.core.windows.net\"],\n [\"dfs.core.windows.net\", \"blob.core.windows.net\"],\n [\"dfs.core.chinacloudapi.cn\", \"blob.core.chinacloudapi.cn\"],\n [\"dfs.core.usgovcloudapi.net\", \"blob.core.usgovcloudapi.net\"],\n [\"dfs.core.cloudapi.de\", \"blob.core.cloudapi.de\"],\n [\"dfs.core.microsoft.scloud\", \"blob.core.microsoft.scloud\"],\n [\"dfs.core.eaglex.ic.gov\", \"blob.core.eaglex.ic.gov\"],\n [\"dfs.storage.azure.net\", \"blob.storage.azure.net\"],\n];\n\n// Mapping pairs to transform url from blob endpoint to dfs endpoint\n// Customize this value to add more mapping patterns\nexport const ToDfsEndpointHostMappings = [\n [\"blob.preprod.core.windows.net\", \"dfs.preprod.core.windows.net\"],\n [\"blob.core.windows.net\", \"dfs.core.windows.net\"],\n [\"blob.core.chinacloudapi.cn\", \"dfs.core.chinacloudapi.cn\"],\n [\"blob.core.usgovcloudapi.net\", \"dfs.core.usgovcloudapi.net\"],\n [\"blob.core.cloudapi.de\", \"dfs.core.cloudapi.de\"],\n [\"blob.core.microsoft.scloud\", \"dfs.core.microsoft.scloud\"],\n [\"blob.core.eaglex.ic.gov\", \"dfs.core.eaglex.ic.gov\"],\n [\"blob.storage.azure.net\", \"dfs.storage.azure.net\"],\n];\n\nexport const ETagAny = \"*\";\n\nexport const DeletionIdKey = \"deletionid\";\nexport const EncryptionAlgorithmAES25 = \"AES256\";\n\nexport const PathResultTypeConstants = {\n FileResourceType: \"file\",\n DirectoryResourceType: \"directory\",\n};\n\n/// List of ports used for path style addressing.\n/// Path style addressing means that storage account is put in URI's Path segment in instead of in host.\nexport const PathStylePorts = [\n \"10000\",\n \"10001\",\n \"10002\",\n \"10003\",\n \"10004\",\n \"10100\",\n \"10101\",\n \"10102\",\n \"10103\",\n \"10104\",\n \"11000\",\n \"11001\",\n \"11002\",\n \"11003\",\n \"11004\",\n \"11100\",\n \"11101\",\n \"11102\",\n \"11103\",\n \"11104\",\n];\n"]}
|
|
@@ -49,8 +49,8 @@ import type { HttpResponse } from "@azure/storage-blob";
|
|
|
49
49
|
*
|
|
50
50
|
* We will apply strategy one, and call encodeURIComponent for these parameters like blobName. Because what customers passes in is a plain name instead of a URL.
|
|
51
51
|
*
|
|
52
|
-
* @see https://learn.microsoft.com/
|
|
53
|
-
* @see https://learn.microsoft.com/
|
|
52
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata
|
|
53
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-shares--directories--files--and-metadata
|
|
54
54
|
*
|
|
55
55
|
* @param url -
|
|
56
56
|
*/
|
|
@@ -80,8 +80,8 @@ const transforms_js_1 = require("../transforms.js");
|
|
|
80
80
|
*
|
|
81
81
|
* We will apply strategy one, and call encodeURIComponent for these parameters like blobName. Because what customers passes in is a plain name instead of a URL.
|
|
82
82
|
*
|
|
83
|
-
* @see https://learn.microsoft.com/
|
|
84
|
-
* @see https://learn.microsoft.com/
|
|
83
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata
|
|
84
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-shares--directories--files--and-metadata
|
|
85
85
|
*
|
|
86
86
|
* @param url -
|
|
87
87
|
*/
|
|
@@ -95,7 +95,7 @@ function escapeURLPath(url) {
|
|
|
95
95
|
}
|
|
96
96
|
function getProxyUriFromDevConnString(connectionString) {
|
|
97
97
|
// Development Connection String
|
|
98
|
-
// https://learn.microsoft.com/
|
|
98
|
+
// https://learn.microsoft.com/azure/storage/common/storage-configure-connection-string#connect-to-the-emulator-account-using-the-well-known-account-name-and-key
|
|
99
99
|
let proxyUri = "";
|
|
100
100
|
if (connectionString.search("DevelopmentStorageProxyUri=") !== -1) {
|
|
101
101
|
// CONNECTION_STRING=UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://myProxyUri
|
|
@@ -274,9 +274,8 @@ function setURLParameter(url, name, value) {
|
|
|
274
274
|
* @param name -
|
|
275
275
|
*/
|
|
276
276
|
function getURLParameter(url, name) {
|
|
277
|
-
var _a;
|
|
278
277
|
const urlParsed = new URL(url);
|
|
279
|
-
return
|
|
278
|
+
return urlParsed.searchParams.get(name) ?? undefined;
|
|
280
279
|
}
|
|
281
280
|
/**
|
|
282
281
|
* Set URL host.
|
|
@@ -576,14 +575,13 @@ function ParseHeaderValue(rawResponse, headerName) {
|
|
|
576
575
|
* Parse extra properties values from headers in raw response.
|
|
577
576
|
*/
|
|
578
577
|
function ParsePathGetPropertiesExtraHeaderValues(rawResponse) {
|
|
579
|
-
var _a;
|
|
580
578
|
const response = rawResponse;
|
|
581
579
|
response.encryptionContext = ParseHeaderValue(rawResponse, "x-ms-encryption-context");
|
|
582
580
|
response.owner = ParseHeaderValue(rawResponse, "x-ms-owner");
|
|
583
581
|
response.group = ParseHeaderValue(rawResponse, "x-ms-group");
|
|
584
582
|
response.permissions = (0, transforms_js_1.toPermissions)(ParseHeaderValue(rawResponse, "x-ms-permissions"));
|
|
585
583
|
response.acl = (0, transforms_js_1.toAcl)(ParseHeaderValue(rawResponse, "x-ms-acl"));
|
|
586
|
-
if (
|
|
584
|
+
if (response._response?.parsedHeaders) {
|
|
587
585
|
response._response.parsedHeaders.encryptionContext = response.encryptionContext;
|
|
588
586
|
response._response.parsedHeaders.owner = response.owner;
|
|
589
587
|
response._response.parsedHeaders.group = response.group;
|