@azure/storage-file-datalake 12.27.0-beta.1 → 12.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/DataLakeFileSystemClient.d.ts +13 -13
- package/dist/browser/DataLakeFileSystemClient.js +136 -93
- package/dist/browser/DataLakeFileSystemClient.js.map +1 -1
- package/dist/browser/DataLakeLeaseClient.js +1 -0
- package/dist/browser/DataLakeLeaseClient.js.map +1 -1
- package/dist/browser/DataLakeServiceClient.d.ts +6 -6
- package/dist/browser/DataLakeServiceClient.js +28 -11
- package/dist/browser/DataLakeServiceClient.js.map +1 -1
- package/dist/browser/Pipeline.js +24 -15
- package/dist/browser/Pipeline.js.map +1 -1
- package/dist/browser/StorageClient.js +43 -3
- package/dist/browser/StorageClient.js.map +1 -1
- package/dist/browser/StorageContextClient.js +2 -3
- package/dist/browser/StorageContextClient.js.map +1 -1
- package/dist/browser/clients.d.ts +33 -33
- package/dist/browser/clients.js +269 -89
- package/dist/browser/clients.js.map +1 -1
- package/dist/browser/generated/src/operations/fileSystemOperations.js +1 -0
- package/dist/browser/generated/src/operations/fileSystemOperations.js.map +1 -1
- package/dist/browser/generated/src/operations/pathOperations.js +1 -0
- package/dist/browser/generated/src/operations/pathOperations.js.map +1 -1
- package/dist/browser/generated/src/operations/service.js +1 -0
- package/dist/browser/generated/src/operations/service.js.map +1 -1
- package/dist/browser/generated/src/storageClient.js +15 -4
- package/dist/browser/generated/src/storageClient.js.map +1 -1
- package/dist/browser/index-browser.d.mts.map +1 -1
- package/dist/browser/index-browser.mjs.map +1 -1
- package/dist/browser/index.d.ts +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/models.d.ts +1 -1
- package/dist/browser/models.js.map +1 -1
- package/dist/browser/sas/AccountSASPermissions.d.ts +1 -1
- package/dist/browser/sas/AccountSASPermissions.js +34 -36
- package/dist/browser/sas/AccountSASPermissions.js.map +1 -1
- package/dist/browser/sas/AccountSASResourceTypes.d.ts +1 -1
- package/dist/browser/sas/AccountSASResourceTypes.js +13 -15
- package/dist/browser/sas/AccountSASResourceTypes.js.map +1 -1
- package/dist/browser/sas/AccountSASServices.js +16 -18
- package/dist/browser/sas/AccountSASServices.js.map +1 -1
- package/dist/browser/sas/AccountSASSignatureValues.d.ts +3 -3
- package/dist/browser/sas/AccountSASSignatureValues.js +1 -1
- package/dist/browser/sas/AccountSASSignatureValues.js.map +1 -1
- package/dist/browser/sas/DataLakeSASPermissions.js +39 -41
- package/dist/browser/sas/DataLakeSASPermissions.js.map +1 -1
- package/dist/browser/sas/DataLakeSASSignatureValues.d.ts +1 -1
- package/dist/browser/sas/DataLakeSASSignatureValues.js +4 -3
- package/dist/browser/sas/DataLakeSASSignatureValues.js.map +1 -1
- package/dist/browser/sas/DirectorySASPermissions.d.ts +1 -1
- package/dist/browser/sas/DirectorySASPermissions.js +44 -46
- package/dist/browser/sas/DirectorySASPermissions.js.map +1 -1
- package/dist/browser/sas/FileSystemSASPermissions.d.ts +1 -1
- package/dist/browser/sas/FileSystemSASPermissions.js +44 -46
- package/dist/browser/sas/FileSystemSASPermissions.js.map +1 -1
- package/dist/browser/sas/SASQueryParameters.d.ts +2 -2
- package/dist/browser/sas/SASQueryParameters.js +131 -2
- package/dist/browser/sas/SASQueryParameters.js.map +1 -1
- package/dist/browser/transforms.js +8 -1
- package/dist/browser/transforms.js.map +1 -1
- package/dist/browser/utils/Batch.js +29 -21
- package/dist/browser/utils/Batch.js.map +1 -1
- package/dist/browser/utils/BufferScheduler.js +70 -44
- package/dist/browser/utils/BufferScheduler.js.map +1 -1
- package/dist/browser/utils/DataLakeAclChangeFailedError.js +8 -0
- package/dist/browser/utils/DataLakeAclChangeFailedError.js.map +1 -1
- package/dist/browser/utils/PathClientInternal.js +4 -0
- package/dist/browser/utils/PathClientInternal.js.map +1 -1
- package/dist/browser/utils/constants.d.ts.map +1 -1
- package/dist/browser/utils/constants.js +1 -1
- package/dist/browser/utils/constants.js.map +1 -1
- package/dist/browser/utils/utils.common.d.ts +2 -2
- package/dist/browser/utils/utils.common.js +5 -7
- package/dist/browser/utils/utils.common.js.map +1 -1
- package/dist/commonjs/DataLakeFileSystemClient.d.ts +13 -13
- package/dist/commonjs/DataLakeFileSystemClient.js +136 -93
- package/dist/commonjs/DataLakeFileSystemClient.js.map +1 -1
- package/dist/commonjs/DataLakeLeaseClient.js +1 -0
- package/dist/commonjs/DataLakeLeaseClient.js.map +1 -1
- package/dist/commonjs/DataLakeServiceClient.d.ts +6 -6
- package/dist/commonjs/DataLakeServiceClient.js +28 -11
- package/dist/commonjs/DataLakeServiceClient.js.map +1 -1
- package/dist/commonjs/Pipeline.js +32 -23
- package/dist/commonjs/Pipeline.js.map +1 -1
- package/dist/commonjs/StorageClient.js +43 -3
- package/dist/commonjs/StorageClient.js.map +1 -1
- package/dist/commonjs/StorageContextClient.js +2 -3
- package/dist/commonjs/StorageContextClient.js.map +1 -1
- package/dist/commonjs/clients.d.ts +33 -33
- package/dist/commonjs/clients.js +269 -89
- package/dist/commonjs/clients.js.map +1 -1
- package/dist/commonjs/credentials/UserDelegationKeyCredential.d.ts +1 -1
- package/dist/commonjs/credentials/UserDelegationKeyCredential.js +13 -1
- package/dist/commonjs/credentials/UserDelegationKeyCredential.js.map +1 -1
- package/dist/commonjs/generated/src/operations/fileSystemOperations.js +1 -0
- package/dist/commonjs/generated/src/operations/fileSystemOperations.js.map +1 -1
- package/dist/commonjs/generated/src/operations/pathOperations.js +1 -0
- package/dist/commonjs/generated/src/operations/pathOperations.js.map +1 -1
- package/dist/commonjs/generated/src/operations/service.js +1 -0
- package/dist/commonjs/generated/src/operations/service.js.map +1 -1
- package/dist/commonjs/generated/src/storageClient.js +15 -4
- package/dist/commonjs/generated/src/storageClient.js.map +1 -1
- package/dist/commonjs/models.d.ts +1 -1
- package/dist/commonjs/models.js.map +1 -1
- package/dist/commonjs/sas/AccountSASPermissions.d.ts +1 -1
- package/dist/commonjs/sas/AccountSASPermissions.js +34 -36
- package/dist/commonjs/sas/AccountSASPermissions.js.map +1 -1
- package/dist/commonjs/sas/AccountSASResourceTypes.d.ts +1 -1
- package/dist/commonjs/sas/AccountSASResourceTypes.js +13 -15
- package/dist/commonjs/sas/AccountSASResourceTypes.js.map +1 -1
- package/dist/commonjs/sas/AccountSASServices.js +16 -18
- package/dist/commonjs/sas/AccountSASServices.js.map +1 -1
- package/dist/commonjs/sas/AccountSASSignatureValues.d.ts +3 -3
- package/dist/commonjs/sas/AccountSASSignatureValues.js +1 -1
- package/dist/commonjs/sas/AccountSASSignatureValues.js.map +1 -1
- package/dist/commonjs/sas/DataLakeSASPermissions.js +39 -41
- package/dist/commonjs/sas/DataLakeSASPermissions.js.map +1 -1
- package/dist/commonjs/sas/DataLakeSASSignatureValues.d.ts +1 -1
- package/dist/commonjs/sas/DataLakeSASSignatureValues.js +4 -3
- package/dist/commonjs/sas/DataLakeSASSignatureValues.js.map +1 -1
- package/dist/commonjs/sas/DirectorySASPermissions.d.ts +1 -1
- package/dist/commonjs/sas/DirectorySASPermissions.js +44 -46
- package/dist/commonjs/sas/DirectorySASPermissions.js.map +1 -1
- package/dist/commonjs/sas/FileSystemSASPermissions.d.ts +1 -1
- package/dist/commonjs/sas/FileSystemSASPermissions.js +44 -46
- package/dist/commonjs/sas/FileSystemSASPermissions.js.map +1 -1
- package/dist/commonjs/sas/SASQueryParameters.d.ts +2 -2
- package/dist/commonjs/sas/SASQueryParameters.js +131 -2
- package/dist/commonjs/sas/SASQueryParameters.js.map +1 -1
- package/dist/commonjs/transforms.js +8 -1
- package/dist/commonjs/transforms.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/commonjs/utils/Batch.js +29 -21
- package/dist/commonjs/utils/Batch.js.map +1 -1
- package/dist/commonjs/utils/BufferScheduler.js +70 -44
- package/dist/commonjs/utils/BufferScheduler.js.map +1 -1
- package/dist/commonjs/utils/DataLakeAclChangeFailedError.js +8 -0
- package/dist/commonjs/utils/DataLakeAclChangeFailedError.js.map +1 -1
- package/dist/commonjs/utils/PathClientInternal.js +4 -0
- package/dist/commonjs/utils/PathClientInternal.js.map +1 -1
- package/dist/commonjs/utils/constants.d.ts.map +1 -1
- package/dist/commonjs/utils/constants.js +1 -1
- package/dist/commonjs/utils/constants.js.map +1 -1
- package/dist/commonjs/utils/utils.common.d.ts +2 -2
- package/dist/commonjs/utils/utils.common.js +5 -7
- package/dist/commonjs/utils/utils.common.js.map +1 -1
- package/dist/commonjs/utils/utils.d.ts +1 -1
- package/dist/commonjs/utils/utils.d.ts.map +1 -1
- package/dist/commonjs/utils/utils.js +4 -4
- package/dist/commonjs/utils/utils.js.map +1 -1
- package/dist/esm/DataLakeFileSystemClient.d.ts +13 -13
- package/dist/esm/DataLakeFileSystemClient.js +136 -93
- package/dist/esm/DataLakeFileSystemClient.js.map +1 -1
- package/dist/esm/DataLakeLeaseClient.js +1 -0
- package/dist/esm/DataLakeLeaseClient.js.map +1 -1
- package/dist/esm/DataLakeServiceClient.d.ts +6 -6
- package/dist/esm/DataLakeServiceClient.js +28 -11
- package/dist/esm/DataLakeServiceClient.js.map +1 -1
- package/dist/esm/Pipeline.js +24 -15
- package/dist/esm/Pipeline.js.map +1 -1
- package/dist/esm/StorageClient.js +43 -3
- package/dist/esm/StorageClient.js.map +1 -1
- package/dist/esm/StorageContextClient.js +2 -3
- package/dist/esm/StorageContextClient.js.map +1 -1
- package/dist/esm/clients.d.ts +33 -33
- package/dist/esm/clients.js +269 -89
- package/dist/esm/clients.js.map +1 -1
- package/dist/esm/credentials/UserDelegationKeyCredential.d.ts +1 -1
- package/dist/esm/credentials/UserDelegationKeyCredential.js +13 -1
- package/dist/esm/credentials/UserDelegationKeyCredential.js.map +1 -1
- package/dist/esm/generated/src/operations/fileSystemOperations.js +1 -0
- package/dist/esm/generated/src/operations/fileSystemOperations.js.map +1 -1
- package/dist/esm/generated/src/operations/pathOperations.js +1 -0
- package/dist/esm/generated/src/operations/pathOperations.js.map +1 -1
- package/dist/esm/generated/src/operations/service.js +1 -0
- package/dist/esm/generated/src/operations/service.js.map +1 -1
- package/dist/esm/generated/src/storageClient.js +15 -4
- package/dist/esm/generated/src/storageClient.js.map +1 -1
- package/dist/esm/models.d.ts +1 -1
- package/dist/esm/models.js.map +1 -1
- package/dist/esm/sas/AccountSASPermissions.d.ts +1 -1
- package/dist/esm/sas/AccountSASPermissions.js +34 -36
- package/dist/esm/sas/AccountSASPermissions.js.map +1 -1
- package/dist/esm/sas/AccountSASResourceTypes.d.ts +1 -1
- package/dist/esm/sas/AccountSASResourceTypes.js +13 -15
- package/dist/esm/sas/AccountSASResourceTypes.js.map +1 -1
- package/dist/esm/sas/AccountSASServices.js +16 -18
- package/dist/esm/sas/AccountSASServices.js.map +1 -1
- package/dist/esm/sas/AccountSASSignatureValues.d.ts +3 -3
- package/dist/esm/sas/AccountSASSignatureValues.js +1 -1
- package/dist/esm/sas/AccountSASSignatureValues.js.map +1 -1
- package/dist/esm/sas/DataLakeSASPermissions.js +39 -41
- package/dist/esm/sas/DataLakeSASPermissions.js.map +1 -1
- package/dist/esm/sas/DataLakeSASSignatureValues.d.ts +1 -1
- package/dist/esm/sas/DataLakeSASSignatureValues.js +4 -3
- package/dist/esm/sas/DataLakeSASSignatureValues.js.map +1 -1
- package/dist/esm/sas/DirectorySASPermissions.d.ts +1 -1
- package/dist/esm/sas/DirectorySASPermissions.js +44 -46
- package/dist/esm/sas/DirectorySASPermissions.js.map +1 -1
- package/dist/esm/sas/FileSystemSASPermissions.d.ts +1 -1
- package/dist/esm/sas/FileSystemSASPermissions.js +44 -46
- package/dist/esm/sas/FileSystemSASPermissions.js.map +1 -1
- package/dist/esm/sas/SASQueryParameters.d.ts +2 -2
- package/dist/esm/sas/SASQueryParameters.js +131 -2
- package/dist/esm/sas/SASQueryParameters.js.map +1 -1
- package/dist/esm/transforms.js +8 -1
- package/dist/esm/transforms.js.map +1 -1
- package/dist/esm/utils/Batch.js +29 -21
- package/dist/esm/utils/Batch.js.map +1 -1
- package/dist/esm/utils/BufferScheduler.js +70 -44
- package/dist/esm/utils/BufferScheduler.js.map +1 -1
- package/dist/esm/utils/DataLakeAclChangeFailedError.js +8 -0
- package/dist/esm/utils/DataLakeAclChangeFailedError.js.map +1 -1
- package/dist/esm/utils/PathClientInternal.js +4 -0
- package/dist/esm/utils/PathClientInternal.js.map +1 -1
- package/dist/esm/utils/constants.d.ts.map +1 -1
- package/dist/esm/utils/constants.js +1 -1
- package/dist/esm/utils/constants.js.map +1 -1
- package/dist/esm/utils/utils.common.d.ts +2 -2
- package/dist/esm/utils/utils.common.js +5 -7
- package/dist/esm/utils/utils.common.js.map +1 -1
- package/dist/esm/utils/utils.d.ts +1 -1
- package/dist/esm/utils/utils.d.ts.map +1 -1
- package/dist/esm/utils/utils.js +2 -2
- package/dist/esm/utils/utils.js.map +1 -1
- package/dist/react-native/DataLakeFileSystemClient.d.ts +13 -13
- package/dist/react-native/DataLakeFileSystemClient.js +136 -93
- package/dist/react-native/DataLakeFileSystemClient.js.map +1 -1
- package/dist/react-native/DataLakeLeaseClient.js +1 -0
- package/dist/react-native/DataLakeLeaseClient.js.map +1 -1
- package/dist/react-native/DataLakeServiceClient.d.ts +6 -6
- package/dist/react-native/DataLakeServiceClient.js +28 -11
- package/dist/react-native/DataLakeServiceClient.js.map +1 -1
- package/dist/react-native/Pipeline.js +24 -15
- package/dist/react-native/Pipeline.js.map +1 -1
- package/dist/react-native/StorageClient.js +43 -3
- package/dist/react-native/StorageClient.js.map +1 -1
- package/dist/react-native/StorageContextClient.js +2 -3
- package/dist/react-native/StorageContextClient.js.map +1 -1
- package/dist/react-native/clients.d.ts +33 -33
- package/dist/react-native/clients.js +269 -89
- package/dist/react-native/clients.js.map +1 -1
- package/dist/react-native/credentials/UserDelegationKeyCredential.d.ts +1 -1
- package/dist/react-native/credentials/UserDelegationKeyCredential.js +13 -1
- package/dist/react-native/credentials/UserDelegationKeyCredential.js.map +1 -1
- package/dist/react-native/generated/src/operations/fileSystemOperations.js +1 -0
- package/dist/react-native/generated/src/operations/fileSystemOperations.js.map +1 -1
- package/dist/react-native/generated/src/operations/pathOperations.js +1 -0
- package/dist/react-native/generated/src/operations/pathOperations.js.map +1 -1
- package/dist/react-native/generated/src/operations/service.js +1 -0
- package/dist/react-native/generated/src/operations/service.js.map +1 -1
- package/dist/react-native/generated/src/storageClient.js +15 -4
- package/dist/react-native/generated/src/storageClient.js.map +1 -1
- package/dist/react-native/models.d.ts +1 -1
- package/dist/react-native/models.js.map +1 -1
- package/dist/react-native/sas/AccountSASPermissions.d.ts +1 -1
- package/dist/react-native/sas/AccountSASPermissions.js +34 -36
- package/dist/react-native/sas/AccountSASPermissions.js.map +1 -1
- package/dist/react-native/sas/AccountSASResourceTypes.d.ts +1 -1
- package/dist/react-native/sas/AccountSASResourceTypes.js +13 -15
- package/dist/react-native/sas/AccountSASResourceTypes.js.map +1 -1
- package/dist/react-native/sas/AccountSASServices.js +16 -18
- package/dist/react-native/sas/AccountSASServices.js.map +1 -1
- package/dist/react-native/sas/AccountSASSignatureValues.d.ts +3 -3
- package/dist/react-native/sas/AccountSASSignatureValues.js +1 -1
- package/dist/react-native/sas/AccountSASSignatureValues.js.map +1 -1
- package/dist/react-native/sas/DataLakeSASPermissions.js +39 -41
- package/dist/react-native/sas/DataLakeSASPermissions.js.map +1 -1
- package/dist/react-native/sas/DataLakeSASSignatureValues.d.ts +1 -1
- package/dist/react-native/sas/DataLakeSASSignatureValues.js +4 -3
- package/dist/react-native/sas/DataLakeSASSignatureValues.js.map +1 -1
- package/dist/react-native/sas/DirectorySASPermissions.d.ts +1 -1
- package/dist/react-native/sas/DirectorySASPermissions.js +44 -46
- package/dist/react-native/sas/DirectorySASPermissions.js.map +1 -1
- package/dist/react-native/sas/FileSystemSASPermissions.d.ts +1 -1
- package/dist/react-native/sas/FileSystemSASPermissions.js +44 -46
- package/dist/react-native/sas/FileSystemSASPermissions.js.map +1 -1
- package/dist/react-native/sas/SASQueryParameters.d.ts +2 -2
- package/dist/react-native/sas/SASQueryParameters.js +131 -2
- package/dist/react-native/sas/SASQueryParameters.js.map +1 -1
- package/dist/react-native/transforms.js +8 -1
- package/dist/react-native/transforms.js.map +1 -1
- package/dist/react-native/utils/Batch.js +29 -21
- package/dist/react-native/utils/Batch.js.map +1 -1
- package/dist/react-native/utils/BufferScheduler.js +70 -44
- package/dist/react-native/utils/BufferScheduler.js.map +1 -1
- package/dist/react-native/utils/DataLakeAclChangeFailedError.js +8 -0
- package/dist/react-native/utils/DataLakeAclChangeFailedError.js.map +1 -1
- package/dist/react-native/utils/PathClientInternal.js +4 -0
- package/dist/react-native/utils/PathClientInternal.js.map +1 -1
- package/dist/react-native/utils/constants.d.ts.map +1 -1
- package/dist/react-native/utils/constants.js +1 -1
- package/dist/react-native/utils/constants.js.map +1 -1
- package/dist/react-native/utils/utils.common.d.ts +2 -2
- package/dist/react-native/utils/utils.common.js +5 -7
- package/dist/react-native/utils/utils.common.js.map +1 -1
- package/dist/react-native/utils/utils.d.ts +1 -1
- package/dist/react-native/utils/utils.d.ts.map +1 -1
- package/dist/react-native/utils/utils.js +2 -2
- package/dist/react-native/utils/utils.js.map +1 -1
- package/package.json +8 -8
package/dist/esm/Pipeline.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import { __rest } from "tslib";
|
|
4
3
|
import { convertHttpClient, createRequestPolicyFactoryPolicy, } from "@azure/core-http-compat";
|
|
5
4
|
import { bearerTokenAuthenticationPolicy, decompressResponsePolicyName, } from "@azure/core-rest-pipeline";
|
|
6
5
|
import { authorizeRequestOnTenantChallenge, createClientPipeline } from "@azure/core-client";
|
|
@@ -12,11 +11,11 @@ import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCreden
|
|
|
12
11
|
import { AnonymousCredential } from "@azure/storage-blob";
|
|
13
12
|
import { StorageOAuthScopes, StorageDataLakeLoggingAllowedHeaderNames, StorageDataLakeLoggingAllowedQueryParameters, SDK_VERSION, } from "./utils/constants.js";
|
|
14
13
|
import { getCachedDefaultHttpClient } from "@azure/storage-common";
|
|
15
|
-
import { storageBrowserPolicy } from "@azure/storage-
|
|
16
|
-
import { StorageBrowserPolicyFactory } from "@azure/storage-
|
|
17
|
-
import { storageCorrectContentLengthPolicy } from "@azure/storage-
|
|
18
|
-
import { storageRetryPolicy } from "@azure/storage-
|
|
19
|
-
import { storageSharedKeyCredentialPolicy } from "@azure/storage-
|
|
14
|
+
import { storageBrowserPolicy } from "@azure/storage-common";
|
|
15
|
+
import { StorageBrowserPolicyFactory } from "@azure/storage-common";
|
|
16
|
+
import { storageCorrectContentLengthPolicy } from "@azure/storage-common";
|
|
17
|
+
import { storageRetryPolicy } from "@azure/storage-common";
|
|
18
|
+
import { storageSharedKeyCredentialPolicy } from "@azure/storage-common";
|
|
20
19
|
import { isPipelineLike, Pipeline, } from "@azure/storage-blob";
|
|
21
20
|
// Export following interfaces and types for customers who want to implement their
|
|
22
21
|
// own RequestPolicy or HTTPClient
|
|
@@ -62,8 +61,7 @@ function processDownlevelPipeline(pipeline) {
|
|
|
62
61
|
return undefined;
|
|
63
62
|
}
|
|
64
63
|
export function getCoreClientOptions(pipeline) {
|
|
65
|
-
|
|
66
|
-
const _b = pipeline.options, { httpClient: v1Client } = _b, restOptions = __rest(_b, ["httpClient"]);
|
|
64
|
+
const { httpClient: v1Client, ...restOptions } = pipeline.options;
|
|
67
65
|
let httpClient = pipeline._coreHttpClient;
|
|
68
66
|
if (!httpClient) {
|
|
69
67
|
httpClient = v1Client ? convertHttpClient(v1Client) : getCachedDefaultHttpClient();
|
|
@@ -75,13 +73,17 @@ export function getCoreClientOptions(pipeline) {
|
|
|
75
73
|
const userAgentPrefix = restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix
|
|
76
74
|
? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
77
75
|
: `${packageDetails}`;
|
|
78
|
-
corePipeline = createClientPipeline(
|
|
76
|
+
corePipeline = createClientPipeline({
|
|
77
|
+
...restOptions,
|
|
78
|
+
loggingOptions: {
|
|
79
79
|
additionalAllowedHeaderNames: StorageDataLakeLoggingAllowedHeaderNames,
|
|
80
80
|
additionalAllowedQueryParameters: StorageDataLakeLoggingAllowedQueryParameters,
|
|
81
81
|
logger: logger.info,
|
|
82
|
-
},
|
|
82
|
+
},
|
|
83
|
+
userAgentOptions: {
|
|
83
84
|
userAgentPrefix,
|
|
84
|
-
},
|
|
85
|
+
},
|
|
86
|
+
serializationOptions: {
|
|
85
87
|
stringifyXML,
|
|
86
88
|
serializerOptions: {
|
|
87
89
|
xml: {
|
|
@@ -90,7 +92,8 @@ export function getCoreClientOptions(pipeline) {
|
|
|
90
92
|
xmlCharKey: "#",
|
|
91
93
|
},
|
|
92
94
|
},
|
|
93
|
-
},
|
|
95
|
+
},
|
|
96
|
+
deserializationOptions: {
|
|
94
97
|
parseXML,
|
|
95
98
|
serializerOptions: {
|
|
96
99
|
xml: {
|
|
@@ -99,7 +102,8 @@ export function getCoreClientOptions(pipeline) {
|
|
|
99
102
|
xmlCharKey: "#",
|
|
100
103
|
},
|
|
101
104
|
},
|
|
102
|
-
}
|
|
105
|
+
},
|
|
106
|
+
});
|
|
103
107
|
corePipeline.removePolicy({ phase: "Retry" });
|
|
104
108
|
corePipeline.removePolicy({ name: decompressResponsePolicyName });
|
|
105
109
|
corePipeline.addPolicy(storageCorrectContentLengthPolicy());
|
|
@@ -113,7 +117,7 @@ export function getCoreClientOptions(pipeline) {
|
|
|
113
117
|
if (isTokenCredential(credential)) {
|
|
114
118
|
corePipeline.addPolicy(bearerTokenAuthenticationPolicy({
|
|
115
119
|
credential,
|
|
116
|
-
scopes:
|
|
120
|
+
scopes: restOptions.audience ?? StorageOAuthScopes,
|
|
117
121
|
challengeCallbacks: { authorizeRequestOnChallenge: authorizeRequestOnTenantChallenge },
|
|
118
122
|
}), { phase: "Sign" });
|
|
119
123
|
}
|
|
@@ -125,7 +129,12 @@ export function getCoreClientOptions(pipeline) {
|
|
|
125
129
|
}
|
|
126
130
|
pipeline._corePipeline = corePipeline;
|
|
127
131
|
}
|
|
128
|
-
return
|
|
132
|
+
return {
|
|
133
|
+
...restOptions,
|
|
134
|
+
allowInsecureConnection: true,
|
|
135
|
+
httpClient,
|
|
136
|
+
pipeline: corePipeline,
|
|
137
|
+
};
|
|
129
138
|
}
|
|
130
139
|
export function getCredentialFromPipeline(pipeline) {
|
|
131
140
|
// see if we squirreled one away on the type itself
|
package/dist/esm/Pipeline.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pipeline.js","sourceRoot":"","sources":["../../src/Pipeline.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAOlC,OAAO,EAQL,iBAAiB,EACjB,gCAAgC,GACjC,MAAM,yBAAyB,CAAC;AAQjC,OAAO,EAEL,+BAA+B,EAC/B,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iCAAiC,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC7F,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EACL,kBAAkB,EAClB,wCAAwC,EACxC,4CAA4C,EAC5C,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3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AE,QAAgB;YACnD,gBAAgB;QAClB,CAAC;QACD,SAAS,CAAC,SAA+B;YACvC,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;IACF,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,wBAAwB,CAAC,CAAC;IAChF,MAAM,UAAU,GAAG,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC;IACnD,6EAA6E;IAC7E,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE;QAC5C,OAAO,UAAU,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n KeepAliveOptions,\n ExtendedServiceClientOptions,\n HttpPipelineLogLevel,\n} from \"@azure/core-http-compat\";\nimport {\n CompatResponse as HttpOperationResponse,\n RequestPolicy as IHttpClient,\n HttpHeadersLike as HttpHeaders,\n RequestPolicy,\n RequestPolicyFactory,\n RequestPolicyOptionsLike as RequestPolicyOptions,\n WebResourceLike as WebResource,\n convertHttpClient,\n createRequestPolicyFactoryPolicy,\n} from \"@azure/core-http-compat\";\nimport type {\n ProxySettings as ProxyOptions,\n UserAgentPolicyOptions as UserAgentOptions,\n Pipeline as CorePipeline,\n PipelinePolicy,\n HttpClient,\n} from \"@azure/core-rest-pipeline\";\nimport {\n RequestBodyType as HttpRequestBody,\n bearerTokenAuthenticationPolicy,\n decompressResponsePolicyName,\n} from \"@azure/core-rest-pipeline\";\nimport { authorizeRequestOnTenantChallenge, createClientPipeline } from \"@azure/core-client\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\n\nimport { logger } from \"./log.js\";\nimport type { StorageRetryOptions } from \"@azure/storage-blob\";\nimport { StorageRetryPolicyFactory } from \"@azure/storage-blob\";\nimport { StorageSharedKeyCredential } from \"./credentials/StorageSharedKeyCredential.js\";\nimport { AnonymousCredential } from \"@azure/storage-blob\";\nimport {\n StorageOAuthScopes,\n StorageDataLakeLoggingAllowedHeaderNames,\n StorageDataLakeLoggingAllowedQueryParameters,\n SDK_VERSION,\n} from \"./utils/constants.js\";\nimport { getCachedDefaultHttpClient } from \"@azure/storage-common\";\nimport { storageBrowserPolicy } from \"@azure/storage-blob\";\nimport { StorageBrowserPolicyFactory } from \"@azure/storage-blob\";\nimport { storageCorrectContentLengthPolicy } from \"@azure/storage-blob\";\nimport { storageRetryPolicy } from \"@azure/storage-blob\";\nimport { storageSharedKeyCredentialPolicy } from \"@azure/storage-blob\";\nimport {\n ServiceClientOptions,\n PipelineOptions,\n PipelineLike,\n isPipelineLike,\n Pipeline,\n} from \"@azure/storage-blob\";\n\n// Export following interfaces and types for customers who want to implement their\n// own RequestPolicy or HTTPClient\nexport {\n StorageOAuthScopes,\n IHttpClient,\n HttpHeaders,\n HttpRequestBody,\n HttpOperationResponse,\n WebResource,\n RequestPolicyFactory,\n RequestPolicy,\n RequestPolicyOptions,\n ServiceClientOptions,\n PipelineOptions,\n PipelineLike,\n Pipeline,\n isPipelineLike,\n};\n\n/**\n * Options interface for the {@link newPipeline} function.\n */\nexport interface StoragePipelineOptions {\n /**\n * Options to configure a proxy for outgoing requests.\n */\n proxyOptions?: ProxyOptions;\n /**\n * Options for adding user agent details to outgoing requests.\n */\n userAgentOptions?: UserAgentOptions;\n /**\n * Configures the built-in retry policy behavior.\n */\n retryOptions?: StorageRetryOptions;\n /**\n * Keep alive configurations. Default keep-alive is enabled.\n */\n keepAliveOptions?: KeepAliveOptions;\n /**\n * Configures the HTTP client to send requests and receive responses.\n */\n httpClient?: IHttpClient;\n /**\n * The audience used to retrieve an AAD token.\n * By default, audience 'https://storage.azure.com/.default' will be used.\n */\n audience?: string;\n}\n\n/**\n * Creates a new Pipeline object with Credential provided.\n *\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param pipelineOptions - Optional. Options.\n * @returns A new Pipeline object.\n */\nexport function newPipeline(\n credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n pipelineOptions: StoragePipelineOptions = {},\n): Pipeline {\n if (!credential) {\n credential = new AnonymousCredential();\n }\n const pipeline = new Pipeline([], pipelineOptions);\n (pipeline as any)._credential = credential;\n return pipeline;\n}\n\nfunction processDownlevelPipeline(\n pipeline: PipelineLike,\n): { wrappedPolicies: PipelinePolicy; afterRetry: boolean } | undefined {\n const knownFactoryFunctions = [\n isAnonymousCredential,\n isStorageSharedKeyCredential,\n isCoreHttpBearerTokenFactory,\n isStorageBrowserPolicyFactory,\n isStorageRetryPolicyFactory,\n isStorageTelemetryPolicyFactory,\n isCoreHttpPolicyFactory,\n ];\n if (pipeline.factories.length) {\n const novelFactories = pipeline.factories.filter((factory) => {\n return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory));\n });\n if (novelFactories.length) {\n const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory));\n // if there are any left over, wrap in a requestPolicyFactoryPolicy\n return {\n wrappedPolicies: createRequestPolicyFactoryPolicy(novelFactories),\n afterRetry: hasInjector,\n };\n }\n }\n return undefined;\n}\n\nexport function getCoreClientOptions(pipeline: PipelineLike): ExtendedServiceClientOptions {\n const { httpClient: v1Client, ...restOptions } = pipeline.options as StoragePipelineOptions;\n\n let httpClient: HttpClient = (pipeline as any)._coreHttpClient;\n if (!httpClient) {\n httpClient = v1Client ? convertHttpClient(v1Client) : getCachedDefaultHttpClient();\n (pipeline as any)._coreHttpClient = httpClient;\n }\n\n let corePipeline: CorePipeline = (pipeline as any)._corePipeline;\n if (!corePipeline) {\n const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`;\n const userAgentPrefix =\n restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix\n ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n corePipeline = createClientPipeline({\n ...restOptions,\n loggingOptions: {\n additionalAllowedHeaderNames: StorageDataLakeLoggingAllowedHeaderNames,\n additionalAllowedQueryParameters: StorageDataLakeLoggingAllowedQueryParameters,\n logger: logger.info,\n },\n userAgentOptions: {\n userAgentPrefix,\n },\n serializationOptions: {\n stringifyXML,\n serializerOptions: {\n xml: {\n // Use customized XML char key of \"#\" so we can deserialize metadata\n // with \"_\" key\n xmlCharKey: \"#\",\n },\n },\n },\n deserializationOptions: {\n parseXML,\n serializerOptions: {\n xml: {\n // Use customized XML char key of \"#\" so we can deserialize metadata\n // with \"_\" key\n xmlCharKey: \"#\",\n },\n },\n },\n });\n corePipeline.removePolicy({ phase: \"Retry\" });\n corePipeline.removePolicy({ name: decompressResponsePolicyName });\n corePipeline.addPolicy(storageCorrectContentLengthPolicy());\n corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: \"Retry\" });\n corePipeline.addPolicy(storageBrowserPolicy());\n const downlevelResults = processDownlevelPipeline(pipeline);\n if (downlevelResults) {\n corePipeline.addPolicy(\n downlevelResults.wrappedPolicies,\n downlevelResults.afterRetry ? { afterPhase: \"Retry\" } : undefined,\n );\n }\n const credential = getCredentialFromPipeline(pipeline);\n if (isTokenCredential(credential)) {\n corePipeline.addPolicy(\n bearerTokenAuthenticationPolicy({\n credential,\n scopes: restOptions.audience ?? StorageOAuthScopes,\n challengeCallbacks: { authorizeRequestOnChallenge: authorizeRequestOnTenantChallenge },\n }),\n { phase: \"Sign\" },\n );\n } else if (credential instanceof StorageSharedKeyCredential) {\n corePipeline.addPolicy(\n storageSharedKeyCredentialPolicy({\n accountName: credential.accountName,\n accountKey: (credential as any).accountKey,\n }),\n { phase: \"Sign\" },\n );\n }\n (pipeline as any)._corePipeline = corePipeline;\n }\n return {\n ...restOptions,\n allowInsecureConnection: true,\n httpClient,\n pipeline: corePipeline,\n };\n}\n\nexport function getCredentialFromPipeline(\n pipeline: PipelineLike,\n): StorageSharedKeyCredential | AnonymousCredential | TokenCredential {\n // see if we squirreled one away on the type itself\n if ((pipeline as any)._credential) {\n return (pipeline as any)._credential;\n }\n // if it came from another package, loop over the factories and look for one like before\n let credential = new AnonymousCredential();\n for (const factory of pipeline.factories) {\n if (isTokenCredential((factory as any).credential)) {\n // Only works if the factory has been attached a \"credential\" property.\n // We do that in newPipeline() when using TokenCredential.\n credential = (factory as any).credential;\n } else if (isStorageSharedKeyCredential(factory)) {\n return factory;\n }\n }\n return credential;\n}\n\nfunction isStorageSharedKeyCredential(\n factory: RequestPolicyFactory,\n): factory is StorageSharedKeyCredential {\n if (factory instanceof StorageSharedKeyCredential) {\n return true;\n }\n return factory.constructor.name === \"StorageSharedKeyCredential\";\n}\n\nfunction isAnonymousCredential(factory: RequestPolicyFactory): factory is AnonymousCredential {\n if (factory instanceof AnonymousCredential) {\n return true;\n }\n return factory.constructor.name === \"AnonymousCredential\";\n}\n\nfunction isCoreHttpBearerTokenFactory(factory: RequestPolicyFactory): boolean {\n return isTokenCredential((factory as any).credential);\n}\n\nfunction isStorageBrowserPolicyFactory(\n factory: RequestPolicyFactory,\n): factory is StorageBrowserPolicyFactory {\n if (factory instanceof StorageBrowserPolicyFactory) {\n return true;\n }\n return factory.constructor.name === \"StorageBrowserPolicyFactory\";\n}\n\nfunction isStorageRetryPolicyFactory(\n factory: RequestPolicyFactory,\n): factory is StorageRetryPolicyFactory {\n if (factory instanceof StorageRetryPolicyFactory) {\n return true;\n }\n return factory.constructor.name === \"StorageRetryPolicyFactory\";\n}\n\nfunction isStorageTelemetryPolicyFactory(factory: RequestPolicyFactory): boolean {\n return factory.constructor.name === \"TelemetryPolicyFactory\";\n}\n\nfunction isInjectorPolicyFactory(factory: RequestPolicyFactory): boolean {\n return factory.constructor.name === \"InjectorPolicyFactory\";\n}\n\nfunction isCoreHttpPolicyFactory(factory: RequestPolicyFactory): boolean {\n const knownPolicies = [\n \"GenerateClientRequestIdPolicy\",\n \"TracingPolicy\",\n \"LogPolicy\",\n \"ProxyPolicy\",\n \"DisableResponseDecompressionPolicy\",\n \"KeepAlivePolicy\",\n \"DeserializationPolicy\",\n ];\n\n const mockHttpClient: IHttpClient = {\n sendRequest: async (request: WebResource) => {\n return {\n request,\n headers: request.headers.clone(),\n status: 500,\n };\n },\n };\n const mockRequestPolicyOptions: RequestPolicyOptions = {\n log(_logLevel: HttpPipelineLogLevel, _message: string): void {\n /* do nothing */\n },\n shouldLog(_logLevel: HttpPipelineLogLevel): boolean {\n return false;\n },\n };\n const policyInstance = factory.create(mockHttpClient, mockRequestPolicyOptions);\n const policyName = policyInstance.constructor.name;\n // bundlers sometimes add a custom suffix to the class name to make it unique\n return knownPolicies.some((knownPolicyName) => {\n return policyName.startsWith(knownPolicyName);\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Pipeline.js","sourceRoot":"","sources":["../../src/Pipeline.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,OAAO,EAQL,iBAAiB,EACjB,gCAAgC,GACjC,MAAM,yBAAyB,CAAC;AAQjC,OAAO,EAEL,+BAA+B,EAC/B,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iCAAiC,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC7F,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EACL,kBAAkB,EAClB,wCAAwC,EACxC,4CAA4C,EAC5C,WAAW,GACZ,MA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AAC,KAAK,EAAE;gBAChC,MAAM,EAAE,GAAG;aACZ,CAAC;QACJ,CAAC;KACF,CAAC;IACF,MAAM,wBAAwB,GAAyB;QACrD,GAAG,CAAC,SAA+B,EAAE,QAAgB;YACnD,gBAAgB;QAClB,CAAC;QACD,SAAS,CAAC,SAA+B;YACvC,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;IACF,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,wBAAwB,CAAC,CAAC;IAChF,MAAM,UAAU,GAAG,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC;IACnD,6EAA6E;IAC7E,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE;QAC5C,OAAO,UAAU,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n KeepAliveOptions,\n ExtendedServiceClientOptions,\n HttpPipelineLogLevel,\n} from \"@azure/core-http-compat\";\nimport {\n CompatResponse as HttpOperationResponse,\n RequestPolicy as IHttpClient,\n HttpHeadersLike as HttpHeaders,\n RequestPolicy,\n RequestPolicyFactory,\n RequestPolicyOptionsLike as RequestPolicyOptions,\n WebResourceLike as WebResource,\n convertHttpClient,\n createRequestPolicyFactoryPolicy,\n} from \"@azure/core-http-compat\";\nimport type {\n ProxySettings as ProxyOptions,\n UserAgentPolicyOptions as UserAgentOptions,\n Pipeline as CorePipeline,\n PipelinePolicy,\n HttpClient,\n} from \"@azure/core-rest-pipeline\";\nimport {\n RequestBodyType as HttpRequestBody,\n bearerTokenAuthenticationPolicy,\n decompressResponsePolicyName,\n} from \"@azure/core-rest-pipeline\";\nimport { authorizeRequestOnTenantChallenge, createClientPipeline } from \"@azure/core-client\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\n\nimport { logger } from \"./log.js\";\nimport type { StorageRetryOptions } from \"@azure/storage-blob\";\nimport { StorageRetryPolicyFactory } from \"@azure/storage-blob\";\nimport { StorageSharedKeyCredential } from \"./credentials/StorageSharedKeyCredential.js\";\nimport { AnonymousCredential } from \"@azure/storage-blob\";\nimport {\n StorageOAuthScopes,\n StorageDataLakeLoggingAllowedHeaderNames,\n StorageDataLakeLoggingAllowedQueryParameters,\n SDK_VERSION,\n} from \"./utils/constants.js\";\nimport { getCachedDefaultHttpClient } from \"@azure/storage-common\";\nimport { storageBrowserPolicy } from \"@azure/storage-common\";\nimport { StorageBrowserPolicyFactory } from \"@azure/storage-common\";\nimport { storageCorrectContentLengthPolicy } from \"@azure/storage-common\";\nimport { storageRetryPolicy } from \"@azure/storage-common\";\nimport { storageSharedKeyCredentialPolicy } from \"@azure/storage-common\";\nimport {\n ServiceClientOptions,\n PipelineOptions,\n PipelineLike,\n isPipelineLike,\n Pipeline,\n} from \"@azure/storage-blob\";\n\n// Export following interfaces and types for customers who want to implement their\n// own RequestPolicy or HTTPClient\nexport {\n StorageOAuthScopes,\n IHttpClient,\n HttpHeaders,\n HttpRequestBody,\n HttpOperationResponse,\n WebResource,\n RequestPolicyFactory,\n RequestPolicy,\n RequestPolicyOptions,\n ServiceClientOptions,\n PipelineOptions,\n PipelineLike,\n Pipeline,\n isPipelineLike,\n};\n\n/**\n * Options interface for the {@link newPipeline} function.\n */\nexport interface StoragePipelineOptions {\n /**\n * Options to configure a proxy for outgoing requests.\n */\n proxyOptions?: ProxyOptions;\n /**\n * Options for adding user agent details to outgoing requests.\n */\n userAgentOptions?: UserAgentOptions;\n /**\n * Configures the built-in retry policy behavior.\n */\n retryOptions?: StorageRetryOptions;\n /**\n * Keep alive configurations. Default keep-alive is enabled.\n */\n keepAliveOptions?: KeepAliveOptions;\n /**\n * Configures the HTTP client to send requests and receive responses.\n */\n httpClient?: IHttpClient;\n /**\n * The audience used to retrieve an AAD token.\n * By default, audience 'https://storage.azure.com/.default' will be used.\n */\n audience?: string;\n}\n\n/**\n * Creates a new Pipeline object with Credential provided.\n *\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param pipelineOptions - Optional. Options.\n * @returns A new Pipeline object.\n */\nexport function newPipeline(\n credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,\n pipelineOptions: StoragePipelineOptions = {},\n): Pipeline {\n if (!credential) {\n credential = new AnonymousCredential();\n }\n const pipeline = new Pipeline([], pipelineOptions);\n (pipeline as any)._credential = credential;\n return pipeline;\n}\n\nfunction processDownlevelPipeline(\n pipeline: PipelineLike,\n): { wrappedPolicies: PipelinePolicy; afterRetry: boolean } | undefined {\n const knownFactoryFunctions = [\n isAnonymousCredential,\n isStorageSharedKeyCredential,\n isCoreHttpBearerTokenFactory,\n isStorageBrowserPolicyFactory,\n isStorageRetryPolicyFactory,\n isStorageTelemetryPolicyFactory,\n isCoreHttpPolicyFactory,\n ];\n if (pipeline.factories.length) {\n const novelFactories = pipeline.factories.filter((factory) => {\n return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory));\n });\n if (novelFactories.length) {\n const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory));\n // if there are any left over, wrap in a requestPolicyFactoryPolicy\n return {\n wrappedPolicies: createRequestPolicyFactoryPolicy(novelFactories),\n afterRetry: hasInjector,\n };\n }\n }\n return undefined;\n}\n\nexport function getCoreClientOptions(pipeline: PipelineLike): ExtendedServiceClientOptions {\n const { httpClient: v1Client, ...restOptions } = pipeline.options as StoragePipelineOptions;\n\n let httpClient: HttpClient = (pipeline as any)._coreHttpClient;\n if (!httpClient) {\n httpClient = v1Client ? convertHttpClient(v1Client) : getCachedDefaultHttpClient();\n (pipeline as any)._coreHttpClient = httpClient;\n }\n\n let corePipeline: CorePipeline = (pipeline as any)._corePipeline;\n if (!corePipeline) {\n const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`;\n const userAgentPrefix =\n restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix\n ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n corePipeline = createClientPipeline({\n ...restOptions,\n loggingOptions: {\n additionalAllowedHeaderNames: StorageDataLakeLoggingAllowedHeaderNames,\n additionalAllowedQueryParameters: StorageDataLakeLoggingAllowedQueryParameters,\n logger: logger.info,\n },\n userAgentOptions: {\n userAgentPrefix,\n },\n serializationOptions: {\n stringifyXML,\n serializerOptions: {\n xml: {\n // Use customized XML char key of \"#\" so we can deserialize metadata\n // with \"_\" key\n xmlCharKey: \"#\",\n },\n },\n },\n deserializationOptions: {\n parseXML,\n serializerOptions: {\n xml: {\n // Use customized XML char key of \"#\" so we can deserialize metadata\n // with \"_\" key\n xmlCharKey: \"#\",\n },\n },\n },\n });\n corePipeline.removePolicy({ phase: \"Retry\" });\n corePipeline.removePolicy({ name: decompressResponsePolicyName });\n corePipeline.addPolicy(storageCorrectContentLengthPolicy());\n corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: \"Retry\" });\n corePipeline.addPolicy(storageBrowserPolicy());\n const downlevelResults = processDownlevelPipeline(pipeline);\n if (downlevelResults) {\n corePipeline.addPolicy(\n downlevelResults.wrappedPolicies,\n downlevelResults.afterRetry ? { afterPhase: \"Retry\" } : undefined,\n );\n }\n const credential = getCredentialFromPipeline(pipeline);\n if (isTokenCredential(credential)) {\n corePipeline.addPolicy(\n bearerTokenAuthenticationPolicy({\n credential,\n scopes: restOptions.audience ?? StorageOAuthScopes,\n challengeCallbacks: { authorizeRequestOnChallenge: authorizeRequestOnTenantChallenge },\n }),\n { phase: \"Sign\" },\n );\n } else if (credential instanceof StorageSharedKeyCredential) {\n corePipeline.addPolicy(\n storageSharedKeyCredentialPolicy({\n accountName: credential.accountName,\n accountKey: (credential as any).accountKey,\n }),\n { phase: \"Sign\" },\n );\n }\n (pipeline as any)._corePipeline = corePipeline;\n }\n return {\n ...restOptions,\n allowInsecureConnection: true,\n httpClient,\n pipeline: corePipeline,\n };\n}\n\nexport function getCredentialFromPipeline(\n pipeline: PipelineLike,\n): StorageSharedKeyCredential | AnonymousCredential | TokenCredential {\n // see if we squirreled one away on the type itself\n if ((pipeline as any)._credential) {\n return (pipeline as any)._credential;\n }\n // if it came from another package, loop over the factories and look for one like before\n let credential = new AnonymousCredential();\n for (const factory of pipeline.factories) {\n if (isTokenCredential((factory as any).credential)) {\n // Only works if the factory has been attached a \"credential\" property.\n // We do that in newPipeline() when using TokenCredential.\n credential = (factory as any).credential;\n } else if (isStorageSharedKeyCredential(factory)) {\n return factory;\n }\n }\n return credential;\n}\n\nfunction isStorageSharedKeyCredential(\n factory: RequestPolicyFactory,\n): factory is StorageSharedKeyCredential {\n if (factory instanceof StorageSharedKeyCredential) {\n return true;\n }\n return factory.constructor.name === \"StorageSharedKeyCredential\";\n}\n\nfunction isAnonymousCredential(factory: RequestPolicyFactory): factory is AnonymousCredential {\n if (factory instanceof AnonymousCredential) {\n return true;\n }\n return factory.constructor.name === \"AnonymousCredential\";\n}\n\nfunction isCoreHttpBearerTokenFactory(factory: RequestPolicyFactory): boolean {\n return isTokenCredential((factory as any).credential);\n}\n\nfunction isStorageBrowserPolicyFactory(\n factory: RequestPolicyFactory,\n): factory is StorageBrowserPolicyFactory {\n if (factory instanceof StorageBrowserPolicyFactory) {\n return true;\n }\n return factory.constructor.name === \"StorageBrowserPolicyFactory\";\n}\n\nfunction isStorageRetryPolicyFactory(\n factory: RequestPolicyFactory,\n): factory is StorageRetryPolicyFactory {\n if (factory instanceof StorageRetryPolicyFactory) {\n return true;\n }\n return factory.constructor.name === \"StorageRetryPolicyFactory\";\n}\n\nfunction isStorageTelemetryPolicyFactory(factory: RequestPolicyFactory): boolean {\n return factory.constructor.name === \"TelemetryPolicyFactory\";\n}\n\nfunction isInjectorPolicyFactory(factory: RequestPolicyFactory): boolean {\n return factory.constructor.name === \"InjectorPolicyFactory\";\n}\n\nfunction isCoreHttpPolicyFactory(factory: RequestPolicyFactory): boolean {\n const knownPolicies = [\n \"GenerateClientRequestIdPolicy\",\n \"TracingPolicy\",\n \"LogPolicy\",\n \"ProxyPolicy\",\n \"DisableResponseDecompressionPolicy\",\n \"KeepAlivePolicy\",\n \"DeserializationPolicy\",\n ];\n\n const mockHttpClient: IHttpClient = {\n sendRequest: async (request: WebResource) => {\n return {\n request,\n headers: request.headers.clone(),\n status: 500,\n };\n },\n };\n const mockRequestPolicyOptions: RequestPolicyOptions = {\n log(_logLevel: HttpPipelineLogLevel, _message: string): void {\n /* do nothing */\n },\n shouldLog(_logLevel: HttpPipelineLogLevel): boolean {\n return false;\n },\n };\n const policyInstance = factory.create(mockHttpClient, mockRequestPolicyOptions);\n const policyName = policyInstance.constructor.name;\n // bundlers sometimes add a custom suffix to the class name to make it unique\n return knownPolicies.some((knownPolicyName) => {\n return policyName.startsWith(knownPolicyName);\n });\n}\n"]}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import { __rest } from "tslib";
|
|
4
3
|
import { StorageContextClient } from "./StorageContextClient.js";
|
|
5
4
|
import { BlobServiceClient } from "@azure/storage-blob";
|
|
6
5
|
import { toBlobEndpointUrl, toDfsEndpointUrl } from "./transforms.js";
|
|
7
6
|
import { escapeURLPath, getAccountNameFromUrl, getURLScheme, iEqual, } from "./utils/utils.common.js";
|
|
8
7
|
// This function relies on the Pipeline already being initialized by a storage-blob client
|
|
9
8
|
function getCoreClientOptions(pipeline) {
|
|
10
|
-
const
|
|
9
|
+
const { httpClient: v1Client, ...restOptions } = pipeline.options;
|
|
11
10
|
const httpClient = pipeline._coreHttpClient;
|
|
12
11
|
if (!httpClient) {
|
|
13
12
|
throw new Error("Pipeline not correctly initialized; missing V2 HttpClient");
|
|
@@ -16,13 +15,54 @@ function getCoreClientOptions(pipeline) {
|
|
|
16
15
|
if (!corePipeline) {
|
|
17
16
|
throw new Error("Pipeline not correctly initialized; missing V2 Pipeline");
|
|
18
17
|
}
|
|
19
|
-
return
|
|
18
|
+
return {
|
|
19
|
+
...restOptions,
|
|
20
|
+
allowInsecureConnection: true,
|
|
21
|
+
httpClient,
|
|
22
|
+
pipeline: corePipeline,
|
|
23
|
+
};
|
|
20
24
|
}
|
|
21
25
|
/**
|
|
22
26
|
* A StorageClient represents a based URL class for {@link BlobServiceClient}, {@link ContainerClient}
|
|
23
27
|
* and etc.
|
|
24
28
|
*/
|
|
25
29
|
export class StorageClient {
|
|
30
|
+
/**
|
|
31
|
+
* Encoded URL string value.
|
|
32
|
+
*/
|
|
33
|
+
url;
|
|
34
|
+
accountName;
|
|
35
|
+
/**
|
|
36
|
+
* Encoded URL string value for corresponding blob endpoint.
|
|
37
|
+
*/
|
|
38
|
+
blobEndpointUrl;
|
|
39
|
+
/**
|
|
40
|
+
* Encoded URL string value for corresponding dfs endpoint.
|
|
41
|
+
*/
|
|
42
|
+
dfsEndpointUrl;
|
|
43
|
+
/**
|
|
44
|
+
* Request policy pipeline.
|
|
45
|
+
*
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
pipeline;
|
|
49
|
+
/**
|
|
50
|
+
* Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.
|
|
51
|
+
*/
|
|
52
|
+
credential;
|
|
53
|
+
/**
|
|
54
|
+
* StorageClient is a reference to protocol layer operations entry, which is
|
|
55
|
+
* generated by AutoRest generator.
|
|
56
|
+
*/
|
|
57
|
+
storageClientContext;
|
|
58
|
+
/**
|
|
59
|
+
* storageClientContextWithBlobEndpoint is a reference to protocol layer operations entry, which is
|
|
60
|
+
* generated by AutoRest generator, with its url pointing to the Blob endpoint.
|
|
61
|
+
*/
|
|
62
|
+
storageClientContextToBlobEndpoint;
|
|
63
|
+
/**
|
|
64
|
+
*/
|
|
65
|
+
isHttps;
|
|
26
66
|
/**
|
|
27
67
|
* Creates an instance of StorageClient.
|
|
28
68
|
* @param url - url to resource
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageClient.js","sourceRoot":"","sources":["../../src/StorageClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC
|
|
1
|
+
{"version":3,"file":"StorageClient.js","sourceRoot":"","sources":["../../src/StorageClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAIjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,YAAY,EACZ,MAAM,GACP,MAAM,yBAAyB,CAAC;AAYjC,0FAA0F;AAC1F,SAAS,oBAAoB,CAAC,QAAkB;IAC9C,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,WAAW,EAAE,GAAG,QAAQ,CAAC,OAAiC,CAAC;IAC5F,MAAM,UAAU,GAAgB,QAAgB,CAAC,eAAe,CAAC;IACjE,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;IAC/E,CAAC;IAED,MAAM,YAAY,GAAkB,QAAgB,CAAC,aAAa,CAAC;IACnE,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IACD,OAAO;QACL,GAAG,WAAW;QACd,uBAAuB,EAAE,IAAI;QAC7B,UAAU;QACV,QAAQ,EAAE,YAAY;KACvB,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,OAAgB,aAAa;IAC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AA2B,CAAC;QAC9D,oBAAoB,CAAC,kBAAkB,GAAG,SAAS,CAAC;QACpD,MAAM,oCAAoC,GAAG,IAAI,CAAC,kCAAyC,CAAC;QAC5F,oCAAoC,CAAC,kBAAkB,GAAG,SAAS,CAAC;IACtE,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { StorageContextClient } from \"./StorageContextClient.js\";\nimport type { StorageClient as StorageClientContext } from \"./generated/src/index.js\";\nimport type { Pipeline, PipelineLike, StoragePipelineOptions } from \"./Pipeline.js\";\nimport type { AnonymousCredential } from \"@azure/storage-blob\";\nimport { BlobServiceClient } from \"@azure/storage-blob\";\nimport type { StorageSharedKeyCredential } from \"@azure/storage-blob\";\nimport { toBlobEndpointUrl, toDfsEndpointUrl } from \"./transforms.js\";\nimport {\n escapeURLPath,\n getAccountNameFromUrl,\n getURLScheme,\n iEqual,\n} from \"./utils/utils.common.js\";\nimport type { ExtendedServiceClientOptions } from \"@azure/core-http-compat\";\nimport type { HttpClient, Pipeline as CorePipeline } from \"@azure/core-rest-pipeline\";\nimport type { OperationTracingOptions } from \"@azure/core-tracing\";\n\n/**\n * An interface for options common to every remote operation.\n */\nexport interface CommonOptions {\n tracingOptions?: OperationTracingOptions;\n}\n\n// This function relies on the Pipeline already being initialized by a storage-blob client\nfunction getCoreClientOptions(pipeline: Pipeline): ExtendedServiceClientOptions {\n const { httpClient: v1Client, ...restOptions } = pipeline.options as StoragePipelineOptions;\n const httpClient: HttpClient = (pipeline as any)._coreHttpClient;\n if (!httpClient) {\n throw new Error(\"Pipeline not correctly initialized; missing V2 HttpClient\");\n }\n\n const corePipeline: CorePipeline = (pipeline as any)._corePipeline;\n if (!corePipeline) {\n throw new Error(\"Pipeline not correctly initialized; missing V2 Pipeline\");\n }\n return {\n ...restOptions,\n allowInsecureConnection: true,\n httpClient,\n pipeline: corePipeline,\n };\n}\n\n/**\n * A StorageClient represents a based URL class for {@link BlobServiceClient}, {@link ContainerClient}\n * and etc.\n */\nexport abstract class StorageClient {\n /**\n * Encoded URL string value.\n */\n public readonly url: string;\n\n public readonly accountName: string;\n\n /**\n * Encoded URL string value for corresponding blob endpoint.\n */\n protected readonly blobEndpointUrl: string;\n\n /**\n * Encoded URL string value for corresponding dfs endpoint.\n */\n protected readonly dfsEndpointUrl: string;\n\n /**\n * Request policy pipeline.\n *\n * @internal\n */\n protected readonly pipeline: Pipeline;\n\n /**\n * Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n */\n public readonly credential: StorageSharedKeyCredential | AnonymousCredential | TokenCredential;\n\n /**\n * StorageClient is a reference to protocol layer operations entry, which is\n * generated by AutoRest generator.\n */\n protected readonly storageClientContext: StorageClientContext;\n\n /**\n * storageClientContextWithBlobEndpoint is a reference to protocol layer operations entry, which is\n * generated by AutoRest generator, with its url pointing to the Blob endpoint.\n */\n protected readonly storageClientContextToBlobEndpoint: StorageClientContext;\n\n /**\n */\n protected readonly isHttps: boolean;\n\n /**\n * Creates an instance of StorageClient.\n * @param url - url to resource\n * @param pipeline - request policy pipeline.\n */\n protected constructor(url: string, pipeline: PipelineLike) {\n // URL should be encoded and only once, protocol layer shouldn't encode URL again\n this.url = escapeURLPath(url);\n this.blobEndpointUrl = toBlobEndpointUrl(this.url);\n this.dfsEndpointUrl = toDfsEndpointUrl(this.url);\n this.accountName = getAccountNameFromUrl(this.blobEndpointUrl);\n this.pipeline = pipeline;\n // creating this BlobServiceClient allows us to use the converted V2 Pipeline attached to `pipeline`.\n const blobClient = new BlobServiceClient(url, pipeline);\n this.storageClientContext = new StorageContextClient(\n this.dfsEndpointUrl,\n getCoreClientOptions(pipeline),\n );\n\n this.storageClientContextToBlobEndpoint = new StorageContextClient(\n this.blobEndpointUrl,\n getCoreClientOptions(pipeline),\n );\n\n this.isHttps = iEqual(getURLScheme(this.url) || \"\", \"https\");\n\n this.credential = (blobClient as any).credential;\n\n // Override protocol layer's default content-type\n const storageClientContext = this.storageClientContext as any;\n storageClientContext.requestContentType = undefined;\n const storageClientContextWithBlobEndpoint = this.storageClientContextToBlobEndpoint as any;\n storageClientContextWithBlobEndpoint.requestContentType = undefined;\n }\n}\n"]}
|
|
@@ -7,11 +7,10 @@ import { StorageClient } from "./generated/src/index.js";
|
|
|
7
7
|
*/
|
|
8
8
|
export class StorageContextClient extends StorageClient {
|
|
9
9
|
async sendOperationRequest(operationArguments, operationSpec) {
|
|
10
|
-
|
|
11
|
-
const operationSpecToSend = Object.assign({}, operationSpec);
|
|
10
|
+
const operationSpecToSend = { ...operationSpec };
|
|
12
11
|
if (!isNodeLike &&
|
|
13
12
|
!operationSpec.requestBody &&
|
|
14
|
-
|
|
13
|
+
operationSpec.headerParameters?.some((param) => param.mapper.serializedName === "Content-Length")) {
|
|
15
14
|
operationSpecToSend.mediaType = "text";
|
|
16
15
|
operationSpecToSend.requestBody = {
|
|
17
16
|
parameterPath: "body",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageContextClient.js","sourceRoot":"","sources":["../../src/StorageContextClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,aAAa;IACrD,KAAK,CAAC,oBAAoB,CACxB,kBAAsC,EACtC,aAA4B
|
|
1
|
+
{"version":3,"file":"StorageContextClient.js","sourceRoot":"","sources":["../../src/StorageContextClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,aAAa;IACrD,KAAK,CAAC,oBAAoB,CACxB,kBAAsC,EACtC,aAA4B;QAE5B,MAAM,mBAAmB,GAAG,EAAE,GAAG,aAAa,EAAE,CAAC;QAEjD,IACE,CAAC,UAAU;YACX,CAAC,aAAa,CAAC,WAAW;YAC1B,aAAa,CAAC,gBAAgB,EAAE,IAAI,CAClC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,KAAK,gBAAgB,CAC5D,EACD,CAAC;YACD,mBAAmB,CAAC,SAAS,GAAG,MAAM,CAAC;YACvC,mBAAmB,CAAC,WAAW,GAAG;gBAChC,aAAa,EAAE,MAAM;gBACrB,MAAM,EAAE;oBACN,cAAc,EAAE,MAAM;oBACtB,UAAU,EAAE,IAAI;oBAChB,YAAY,EAAE,EAAE;oBAChB,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;qBACf;iBACF;aACF,CAAC;QACJ,CAAC;QAED,IACE,mBAAmB,CAAC,IAAI,KAAK,eAAe;YAC5C,mBAAmB,CAAC,IAAI,KAAK,sBAAsB,EACnD,CAAC;YACD,mBAAmB,CAAC,IAAI,GAAG,EAAE,CAAC;QAChC,CAAC;QACD,OAAO,KAAK,CAAC,oBAAoB,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;IAC7E,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationArguments, OperationSpec } from \"@azure/core-client\";\nimport { isNodeLike } from \"@azure/core-util\";\nimport { StorageClient } from \"./generated/src/index.js\";\n\n/**\n * @internal\n */\nexport class StorageContextClient extends StorageClient {\n async sendOperationRequest<T>(\n operationArguments: OperationArguments,\n operationSpec: OperationSpec,\n ): Promise<T> {\n const operationSpecToSend = { ...operationSpec };\n\n if (\n !isNodeLike &&\n !operationSpec.requestBody &&\n operationSpec.headerParameters?.some(\n (param) => param.mapper.serializedName === \"Content-Length\",\n )\n ) {\n operationSpecToSend.mediaType = \"text\";\n operationSpecToSend.requestBody = {\n parameterPath: \"body\",\n mapper: {\n serializedName: \"body\",\n isConstant: true,\n defaultValue: \"\",\n type: {\n name: \"String\",\n },\n },\n };\n }\n\n if (\n operationSpecToSend.path === \"/{filesystem}\" ||\n operationSpecToSend.path === \"/{filesystem}/{path}\"\n ) {\n operationSpecToSend.path = \"\";\n }\n return super.sendOperationRequest(operationArguments, operationSpecToSend);\n }\n}\n"]}
|
package/dist/esm/clients.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ export declare class DataLakePathClient extends StorageClient {
|
|
|
81
81
|
/**
|
|
82
82
|
* Create a directory or path.
|
|
83
83
|
*
|
|
84
|
-
* @see https://learn.microsoft.com/
|
|
84
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/create
|
|
85
85
|
*
|
|
86
86
|
* @param resourceType - Resource type, "directory" or "file".
|
|
87
87
|
* @param options - Optional. Options when creating path.
|
|
@@ -90,7 +90,7 @@ export declare class DataLakePathClient extends StorageClient {
|
|
|
90
90
|
/**
|
|
91
91
|
* Create a directory or file. If the resource already exists, it is not changed.
|
|
92
92
|
*
|
|
93
|
-
* @see https://learn.microsoft.com/
|
|
93
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/create
|
|
94
94
|
*
|
|
95
95
|
* @param resourceType - Resource type, "directory" or "file".
|
|
96
96
|
* @param options -
|
|
@@ -109,7 +109,7 @@ export declare class DataLakePathClient extends StorageClient {
|
|
|
109
109
|
/**
|
|
110
110
|
* Delete current path (directory or file).
|
|
111
111
|
*
|
|
112
|
-
* @see https://learn.microsoft.com/
|
|
112
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/delete
|
|
113
113
|
*
|
|
114
114
|
* @param recursive - Required and valid only when the resource is a directory. If "true", all paths beneath the directory will be deleted.
|
|
115
115
|
* @param options - Optional. Options when deleting path.
|
|
@@ -118,7 +118,7 @@ export declare class DataLakePathClient extends StorageClient {
|
|
|
118
118
|
/**
|
|
119
119
|
* Delete current path (directory or file) if it exists.
|
|
120
120
|
*
|
|
121
|
-
* @see https://learn.microsoft.com/
|
|
121
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/delete
|
|
122
122
|
*
|
|
123
123
|
* @param recursive - Required and valid only when the resource is a directory. If "true", all paths beneath the directory will be deleted.
|
|
124
124
|
* @param options -
|
|
@@ -127,7 +127,7 @@ export declare class DataLakePathClient extends StorageClient {
|
|
|
127
127
|
/**
|
|
128
128
|
* Returns the access control data for a path (directory of file).
|
|
129
129
|
*
|
|
130
|
-
* @see https://learn.microsoft.com/
|
|
130
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/getproperties
|
|
131
131
|
*
|
|
132
132
|
* @param options - Optional. Options when getting file access control.
|
|
133
133
|
*/
|
|
@@ -135,7 +135,7 @@ export declare class DataLakePathClient extends StorageClient {
|
|
|
135
135
|
/**
|
|
136
136
|
* Set the access control data for a path (directory of file).
|
|
137
137
|
*
|
|
138
|
-
* @see https://learn.microsoft.com/
|
|
138
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/update
|
|
139
139
|
*
|
|
140
140
|
* @param acl - The POSIX access control list for the file or directory.
|
|
141
141
|
* @param options - Optional. Options when setting path access control.
|
|
@@ -144,7 +144,7 @@ export declare class DataLakePathClient extends StorageClient {
|
|
|
144
144
|
/**
|
|
145
145
|
* Sets the Access Control on a path and sub paths.
|
|
146
146
|
*
|
|
147
|
-
* @see https://learn.microsoft.com/
|
|
147
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/update
|
|
148
148
|
*
|
|
149
149
|
* @param acl - The POSIX access control list for the file or directory.
|
|
150
150
|
* @param options - Optional. Options
|
|
@@ -153,7 +153,7 @@ export declare class DataLakePathClient extends StorageClient {
|
|
|
153
153
|
/**
|
|
154
154
|
* Modifies the Access Control on a path and sub paths.
|
|
155
155
|
*
|
|
156
|
-
* @see https://learn.microsoft.com/
|
|
156
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/update
|
|
157
157
|
*
|
|
158
158
|
* @param acl - The POSIX access control list for the file or directory.
|
|
159
159
|
* @param options - Optional. Options
|
|
@@ -162,7 +162,7 @@ export declare class DataLakePathClient extends StorageClient {
|
|
|
162
162
|
/**
|
|
163
163
|
* Removes the Access Control on a path and sub paths.
|
|
164
164
|
*
|
|
165
|
-
* @see https://learn.microsoft.com/
|
|
165
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/update
|
|
166
166
|
*
|
|
167
167
|
* @param acl - The POSIX access control list for the file or directory.
|
|
168
168
|
* @param options - Optional. Options
|
|
@@ -171,7 +171,7 @@ export declare class DataLakePathClient extends StorageClient {
|
|
|
171
171
|
/**
|
|
172
172
|
* Sets the file permissions on a path.
|
|
173
173
|
*
|
|
174
|
-
* @see https://learn.microsoft.com/
|
|
174
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/update
|
|
175
175
|
*
|
|
176
176
|
* @param permissions - The POSIX access permissions for the file owner, the file owning group, and others.
|
|
177
177
|
* @param options - Optional. Options when setting path permissions.
|
|
@@ -186,7 +186,7 @@ export declare class DataLakePathClient extends StorageClient {
|
|
|
186
186
|
* the methods of {@link DataLakeFileSystemClient} that list paths using the `includeMetadata` option, which
|
|
187
187
|
* will retain their original casing.
|
|
188
188
|
*
|
|
189
|
-
* @see https://learn.microsoft.com/
|
|
189
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-blob-properties
|
|
190
190
|
*
|
|
191
191
|
* @param options - Optional. Options when getting path properties.
|
|
192
192
|
*/
|
|
@@ -196,7 +196,7 @@ export declare class DataLakePathClient extends StorageClient {
|
|
|
196
196
|
*
|
|
197
197
|
* If no value provided, or no value provided for the specified blob HTTP headers,
|
|
198
198
|
* these blob HTTP headers without a value will be cleared.
|
|
199
|
-
* @see https://learn.microsoft.com/
|
|
199
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties
|
|
200
200
|
*
|
|
201
201
|
* @param httpHeaders -
|
|
202
202
|
* @param options -
|
|
@@ -208,7 +208,7 @@ export declare class DataLakePathClient extends StorageClient {
|
|
|
208
208
|
* If no option provided, or no metadata defined in the parameter, the path
|
|
209
209
|
* metadata will be removed.
|
|
210
210
|
*
|
|
211
|
-
* @see https://learn.microsoft.com/
|
|
211
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/set-blob-metadata
|
|
212
212
|
*
|
|
213
213
|
* @param metadata - Optional. Replace existing metadata with this value.
|
|
214
214
|
* If no value provided the existing metadata will be removed.
|
|
@@ -218,7 +218,7 @@ export declare class DataLakePathClient extends StorageClient {
|
|
|
218
218
|
/**
|
|
219
219
|
* Move directory or file within same file system.
|
|
220
220
|
*
|
|
221
|
-
* @see https://learn.microsoft.com/
|
|
221
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/create
|
|
222
222
|
*
|
|
223
223
|
* @param destinationPath - Destination directory path like "directory" or file path "directory/file".
|
|
224
224
|
* If the destinationPath is authenticated with SAS, add the SAS to the destination path like "directory/file?sasToken".
|
|
@@ -228,7 +228,7 @@ export declare class DataLakePathClient extends StorageClient {
|
|
|
228
228
|
/**
|
|
229
229
|
* Move directory or file to another file system.
|
|
230
230
|
*
|
|
231
|
-
* @see https://learn.microsoft.com/
|
|
231
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/create
|
|
232
232
|
*
|
|
233
233
|
* @param destinationFileSystem - Destination file system like "filesystem".
|
|
234
234
|
* @param destinationPath - Destination directory path like "directory" or file path "directory/file"
|
|
@@ -244,7 +244,7 @@ export declare class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
244
244
|
/**
|
|
245
245
|
* Create a directory.
|
|
246
246
|
*
|
|
247
|
-
* @see https://learn.microsoft.com/
|
|
247
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/create
|
|
248
248
|
*
|
|
249
249
|
* @param resourceType - Resource type, must be "directory" for DataLakeDirectoryClient.
|
|
250
250
|
* @param options - Optional. Options when creating directory.
|
|
@@ -253,7 +253,7 @@ export declare class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
253
253
|
/**
|
|
254
254
|
* Create a directory.
|
|
255
255
|
*
|
|
256
|
-
* @see https://learn.microsoft.com/
|
|
256
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/create
|
|
257
257
|
*
|
|
258
258
|
* @param options - Optional. Options when creating directory.
|
|
259
259
|
*/
|
|
@@ -261,7 +261,7 @@ export declare class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
261
261
|
/**
|
|
262
262
|
* Create a directory if it doesn't already exists.
|
|
263
263
|
*
|
|
264
|
-
* @see https://learn.microsoft.com/
|
|
264
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/create
|
|
265
265
|
*
|
|
266
266
|
* @param resourceType - Resource type, must be "directory" for DataLakeDirectoryClient.
|
|
267
267
|
* @param options -
|
|
@@ -270,7 +270,7 @@ export declare class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
270
270
|
/**
|
|
271
271
|
* Create a directory if it doesn't already exists.
|
|
272
272
|
*
|
|
273
|
-
* @see https://learn.microsoft.com/
|
|
273
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/create
|
|
274
274
|
*
|
|
275
275
|
* @param options -
|
|
276
276
|
*/
|
|
@@ -293,7 +293,7 @@ export declare class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
293
293
|
* Generates a Service Shared Access Signature (SAS) URI based on the client properties
|
|
294
294
|
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
|
295
295
|
*
|
|
296
|
-
* @see https://learn.microsoft.com/
|
|
296
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
|
|
297
297
|
*
|
|
298
298
|
* @param options - Optional parameters.
|
|
299
299
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
@@ -303,7 +303,7 @@ export declare class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
303
303
|
* Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties
|
|
304
304
|
* and parameters passed in.
|
|
305
305
|
*
|
|
306
|
-
* @see https://learn.microsoft.com/
|
|
306
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
|
|
307
307
|
*
|
|
308
308
|
* @param options - Optional parameters.
|
|
309
309
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
@@ -313,7 +313,7 @@ export declare class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
313
313
|
* Generates a Service Shared Access Signature (SAS) URI based on the client properties
|
|
314
314
|
* and parameters passed in. The SAS is signed by the input user delegation key.
|
|
315
315
|
*
|
|
316
|
-
* @see https://learn.microsoft.com/
|
|
316
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
|
|
317
317
|
*
|
|
318
318
|
* @param options - Optional parameters.
|
|
319
319
|
* @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
|
|
@@ -324,7 +324,7 @@ export declare class DataLakeDirectoryClient extends DataLakePathClient {
|
|
|
324
324
|
* Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties
|
|
325
325
|
* and parameters passed in The SAS is signed by the input user delegation key.
|
|
326
326
|
*
|
|
327
|
-
* @see https://learn.microsoft.com/
|
|
327
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
|
|
328
328
|
*
|
|
329
329
|
* @param options - Optional parameters.
|
|
330
330
|
* @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
|
|
@@ -371,7 +371,7 @@ export declare class DataLakeFileClient extends DataLakePathClient {
|
|
|
371
371
|
/**
|
|
372
372
|
* Create a file.
|
|
373
373
|
*
|
|
374
|
-
* @see https://learn.microsoft.com/
|
|
374
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/create
|
|
375
375
|
*
|
|
376
376
|
* @param resourceType - Resource type, must be "file" for DataLakeFileClient.
|
|
377
377
|
* @param options - Optional. Options when creating file.
|
|
@@ -380,7 +380,7 @@ export declare class DataLakeFileClient extends DataLakePathClient {
|
|
|
380
380
|
/**
|
|
381
381
|
* Create a file.
|
|
382
382
|
*
|
|
383
|
-
* @see https://learn.microsoft.com/
|
|
383
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/create
|
|
384
384
|
*
|
|
385
385
|
* @param options - Optional. Options when creating file.
|
|
386
386
|
*/
|
|
@@ -388,7 +388,7 @@ export declare class DataLakeFileClient extends DataLakePathClient {
|
|
|
388
388
|
/**
|
|
389
389
|
* Create a file if it doesn't already exists.
|
|
390
390
|
*
|
|
391
|
-
* @see https://learn.microsoft.com/
|
|
391
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/create
|
|
392
392
|
*
|
|
393
393
|
* @param resourceType - Resource type, must be "file" for DataLakeFileClient.
|
|
394
394
|
* @param options -
|
|
@@ -397,7 +397,7 @@ export declare class DataLakeFileClient extends DataLakePathClient {
|
|
|
397
397
|
/**
|
|
398
398
|
* Create a file if it doesn't already exists.
|
|
399
399
|
*
|
|
400
|
-
* @see https://learn.microsoft.com/
|
|
400
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/create
|
|
401
401
|
*
|
|
402
402
|
* @param options - Optional. Options when creating file.
|
|
403
403
|
*/
|
|
@@ -408,7 +408,7 @@ export declare class DataLakeFileClient extends DataLakePathClient {
|
|
|
408
408
|
* * In Node.js, data returns in a Readable stream readableStreamBody
|
|
409
409
|
* * In browsers, data returns in a promise contentAsBlob
|
|
410
410
|
*
|
|
411
|
-
* @see https://learn.microsoft.com/
|
|
411
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/get-blob
|
|
412
412
|
*
|
|
413
413
|
* * Example usage (Node.js):
|
|
414
414
|
*
|
|
@@ -485,7 +485,7 @@ export declare class DataLakeFileClient extends DataLakePathClient {
|
|
|
485
485
|
* Uploads data to be appended to a file. Data can only be appended to a file.
|
|
486
486
|
* To apply perviously uploaded data to a file, call flush.
|
|
487
487
|
*
|
|
488
|
-
* @see https://learn.microsoft.com/
|
|
488
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/datalakestoragegen2/path/update
|
|
489
489
|
*
|
|
490
490
|
* @param body - Content to be uploaded.
|
|
491
491
|
* @param offset - Append offset in bytes.
|
|
@@ -645,7 +645,7 @@ export declare class DataLakeFileClient extends DataLakePathClient {
|
|
|
645
645
|
* Generates a Service Shared Access Signature (SAS) URI based on the client properties
|
|
646
646
|
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
|
647
647
|
*
|
|
648
|
-
* @see https://learn.microsoft.com/
|
|
648
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
|
|
649
649
|
*
|
|
650
650
|
* @param options - Optional parameters.
|
|
651
651
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
@@ -657,7 +657,7 @@ export declare class DataLakeFileClient extends DataLakePathClient {
|
|
|
657
657
|
* Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties
|
|
658
658
|
* and parameters passed in. The SAS is signed by the shared key credential of the client.
|
|
659
659
|
*
|
|
660
|
-
* @see https://learn.microsoft.com/
|
|
660
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
|
|
661
661
|
*
|
|
662
662
|
* @param options - Optional parameters.
|
|
663
663
|
* @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
|
|
@@ -667,7 +667,7 @@ export declare class DataLakeFileClient extends DataLakePathClient {
|
|
|
667
667
|
* Generates a Service Shared Access Signature (SAS) URI based on the client properties
|
|
668
668
|
* and parameters passed in. The SAS is signed by the input user delegation key.
|
|
669
669
|
*
|
|
670
|
-
* @see https://learn.microsoft.com/
|
|
670
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
|
|
671
671
|
*
|
|
672
672
|
* @param options - Optional parameters.
|
|
673
673
|
* @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
|
|
@@ -678,7 +678,7 @@ export declare class DataLakeFileClient extends DataLakePathClient {
|
|
|
678
678
|
* Generates string to sign for a Service Shared Access Signature (SAS) URI based on the client properties
|
|
679
679
|
* and parameters passed in. The SAS is signed by the input user delegation key.
|
|
680
680
|
*
|
|
681
|
-
* @see https://learn.microsoft.com/
|
|
681
|
+
* @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
|
|
682
682
|
*
|
|
683
683
|
* @param options - Optional parameters.
|
|
684
684
|
* @param userDelegationKey - Return value of `blobServiceClient.getUserDelegationKey()`
|