Skip to content

Commit

Permalink
migrate methods of azure/core-http
Browse files Browse the repository at this point in the history
  • Loading branch information
JhontSouth committed Nov 13, 2024
1 parent 006bcf0 commit 2b01751
Show file tree
Hide file tree
Showing 16 changed files with 26 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Licensed under the MIT License.
*/

import { OperationURLParameter, OperationQueryParameter } from '@azure/core-http';
import { OperationURLParameter, OperationQueryParameter } from '@azure/core-client';

export const appId: OperationURLParameter = {
parameterPath: 'appId',
Expand Down
3 changes: 2 additions & 1 deletion libraries/botbuilder-ai/src/luisV2-models/luisPrediction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* Licensed under the MIT License.
*/

import { ServiceCallback, OperationSpec, Serializer } from '@azure/core-http';
import { ServiceCallback, Serializer } from '@azure/core-http';
import { OperationSpec } from '@azure/core-client';
import { LUISRuntimeClientContext } from '../luisRuntimeClientContext';
import { LuisResult, PredictionResolveOptionalParams, PredictionResolveResponse } from './luisResult';
import * as Parameters from './luisParameters';
Expand Down
5 changes: 3 additions & 2 deletions libraries/botbuilder-ai/src/luisV2-models/luisResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
*/

import { Sentiment } from './luisModels';
import { HttpResponse, RequestOptionsBase } from '@azure/core-http';
import { RequestOptionsBase } from '@azure/core-http';
import { PipelineResponse } from '@azure/core-rest-pipeline';

/**
* Prediction, based on the input query, containing intent(s) and entities.
Expand Down Expand Up @@ -156,7 +157,7 @@ export type PredictionResolveResponse = LuisResult & {
/**
* The underlying HTTP response.
*/
_response: HttpResponse & {
_response: PipelineResponse & {
/**
* The response body as text (string format)
*/
Expand Down
2 changes: 1 addition & 1 deletion libraries/botbuilder-azure-blobs/src/blobsStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import { Storage, StoreItems } from 'botbuilder-core';
import { ignoreError, isStatusCodeError } from './ignoreError';
import { sanitizeBlobKey } from './sanitizeBlobKey';
import { TokenCredential, isTokenCredential } from '@azure/core-http';
import { TokenCredential, isTokenCredential } from '@azure/core-auth';

/**
* Optional settings for BlobsStorage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
StoragePipelineOptions,
StorageSharedKeyCredential,
} from '@azure/storage-blob';
import { isTokenCredential, TokenCredential } from '@azure/core-http';
import { isTokenCredential, TokenCredential } from '@azure/core-auth';

// Formats a timestamp in a way that is consistent with the C# SDK
function formatTicks(timestamp: Date): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { EndorsementsValidator } from './endorsementsValidator';
import { OpenIdMetadata } from './openIdMetadata';
import { AuthenticationError } from './authenticationError';
import { StatusCodes } from 'botframework-schema';
import { ProxySettings } from '@azure/core-http';
import { ProxySettings } from '@azure/core-rest-pipeline';

/**
* A JWT token processing class that gets identity information and performs security token validation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import fetch from 'node-fetch';
import { HttpsProxyAgent } from 'https-proxy-agent';
import { AuthenticationError } from './authenticationError';
import { StatusCodes } from 'botframework-schema';
import { ProxySettings } from '@azure/core-http';
import { ProxySettings } from '@azure/core-rest-pipeline';

/**
* Class in charge of manage OpenId metadata.
Expand Down
6 changes: 3 additions & 3 deletions libraries/botframework-connector/src/auth/tokenCredentials.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

import { HttpHeaders, Constants, WebResourceLike, ServiceClientCredentials } from '@azure/core-http';
import { HttpHeaders, WebResourceLike, ServiceClientCredentials } from '@azure/core-http';

const HeaderConstants = Constants.HeaderConstants;
const AuthorizationHeader = "Authorization";
const DEFAULT_AUTHORIZATION_SCHEME = 'Bearer';

/**
Expand Down Expand Up @@ -36,7 +36,7 @@ export class TokenCredentials implements ServiceClientCredentials {
*/
signRequest(webResource: WebResourceLike) {
if (!webResource.headers) webResource.headers = new HttpHeaders();
webResource.headers.set(HeaderConstants.AUTHORIZATION, `${this.authorizationScheme} ${this.token}`);
webResource.headers.set(AuthorizationHeader, `${this.authorizationScheme} ${this.token}`);
return Promise.resolve(webResource);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License.
*/

import { OperationURLParameter, OperationQueryParameter } from "@azure/core-http"
import { OperationURLParameter, OperationQueryParameter } from "@azure/core-client"

export const activityId: OperationURLParameter = {
parameterPath: "activityId",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
* Licensed under the MIT License.
*/

import { RequestOptionsBase, ServiceCallback, OperationSpec, Serializer } from "@azure/core-http";
import { RequestOptionsBase, ServiceCallback, Serializer } from "@azure/core-http";
import { OperationSpec } from "@azure/core-client";
import { ConnectorClientContext } from "../connectorClientContext";
import * as Models from "../models";
import * as Mappers from "../models/attachmentsMappers";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import * as Mappers from "../models/conversationsMappers";
import * as Models from "../models";
import * as Parameters from "../models/parameters";
import { ServiceCallback, RequestOptionsBase, RestResponse, Serializer, OperationSpec } from "@azure/core-http"
import { ServiceCallback, RequestOptionsBase, RestResponse, Serializer} from "@azure/core-http";
import { OperationSpec } from "@azure/core-client";
import { ConnectorClientContext } from "../connectorClientContext";
import { ConversationIdHttpHeaderName } from "../../conversationConstants";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License.
*/

import { OperationURLParameter, OperationQueryParameter } from '@azure/core-http';
import { OperationURLParameter, OperationQueryParameter } from '@azure/core-client';

export const teamId: OperationURLParameter = {
parameterPath: 'teamId',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
* Licensed under the MIT License.
*/

import { ServiceCallback, RequestOptionsBase, Serializer, OperationSpec } from '@azure/core-http'
import { ServiceCallback, RequestOptionsBase, Serializer } from '@azure/core-http';
import { OperationSpec } from '@azure/core-client';
import * as Models from '../models';
import * as Mappers from '../models/teamsMappers';
import * as Parameters from '../models/parameters';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License.
*/

import { OperationQueryParameter } from "@azure/core-http"
import { OperationQueryParameter } from "@azure/core-client"

export const channelId0: OperationQueryParameter = {
parameterPath: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
* Licensed under the MIT License.
*/

import { ServiceCallback, Serializer, OperationSpec } from "@azure/core-http";
import { ServiceCallback, Serializer} from "@azure/core-http";
import { OperationSpec } from "@azure/core-client";
import * as Models from "../models";
import * as Mappers from "../models/botSignInMappers";
import * as Parameters from "../models/parameters";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
* Licensed under the MIT License.
*/

import { ServiceCallback, RequestOptionsBase, Serializer, OperationSpec } from '@azure/core-http';
import { ServiceCallback, RequestOptionsBase, Serializer } from '@azure/core-http';
import { OperationSpec } from '@azure/core-client';
import * as Models from '../models';
import * as Mappers from '../models/userTokenMappers';
import * as Parameters from '../models/parameters';
Expand Down

0 comments on commit 2b01751

Please sign in to comment.