-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate deprecated core-http to new libraries
- Loading branch information
1 parent
3b8fcab
commit e38c7a3
Showing
74 changed files
with
895 additions
and
472 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
export * from './azureCoreHttpCompat/compat'; | ||
export * from './azureCoreHttpCompat/serviceClientContext'; |
58 changes: 58 additions & 0 deletions
58
libraries/botbuilder-stdlib/src/azureCoreHttpCompat/compat.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
export * from './interfaces'; | ||
|
||
// Re-export only ProxySettings as it is the same as the deprecated core-http library. | ||
export { ProxySettings } from '@azure/core-rest-pipeline'; | ||
|
||
// Re-export only WebResourceLike, CompatResponse, RequestPolicy as they are the same as the deprecated core-http library. | ||
export { | ||
WebResourceLike, | ||
CompatResponse as HttpOperationResponse, | ||
RequestPolicy as HttpClient, | ||
} from '@azure/core-http-compat'; | ||
|
||
// Re-export. Can't access the HttpHeaders directly from the @azure/core-http-compat package because it is not defined in the package.json 'exports' property. | ||
export { HttpHeaders } from '../../node_modules/@azure/core-http-compat/dist/commonjs/util'; | ||
|
||
// Re-export only TokenCredential, isTokenCredential as they are the same as the deprecated core-http library. | ||
export { TokenCredential, isTokenCredential } from '@azure/core-auth'; | ||
|
||
// Re-export these as they are the same as the deprecated core-http library. | ||
export { | ||
createSerializer, | ||
OperationURLParameter, | ||
OperationQueryParameter, | ||
OperationSpec, | ||
CompositeMapper, | ||
} from '@azure/core-client'; | ||
|
||
import { WebResourceLike } from '@azure/core-http-compat'; | ||
import { PipelineRequestOptions, createPipelineRequest } from '@azure/core-rest-pipeline'; | ||
import { toWebResourceLike } from '../../node_modules/@azure/core-http-compat/dist/commonjs/util'; | ||
|
||
/** | ||
* Creates a new WebResourceLike object from the provided resource. | ||
* @param resource The resource to convert to a WebResourceLike object. | ||
* @returns A new WebResourceLike object. | ||
*/ | ||
export function createWebResource(resource?: PipelineRequestOptions): WebResourceLike { | ||
return toWebResourceLike(createPipelineRequest(resource ?? { url: ''})); | ||
} | ||
|
||
/** | ||
* A set of constants used internally when processing requests. | ||
*/ | ||
export const Constants = { | ||
/** | ||
* Defines constants for use with HTTP headers. | ||
*/ | ||
HeaderConstants: { | ||
/** | ||
* The Authorization header. | ||
*/ | ||
AUTHORIZATION: 'Authorization', | ||
AUTHORIZATION_SCHEME: 'Bearer', | ||
}, | ||
}; |
Oops, something went wrong.