Socket
Socket
Sign inDemoInstall

botframework-connector

Package Overview
Dependencies
Maintainers
1
Versions
545
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

botframework-connector - npm Package Compare versions

Comparing version 4.8.0-preview-109324 to 4.8.0

7

lib/auth/appCredentials.d.ts

@@ -18,9 +18,12 @@ /**

appId: string;
oAuthEndpoint: string;
private _oAuthEndpoint;
private _oAuthScope;
private _tenant;
tokenCacheKey: string;
protected refreshingToken: Promise<adal.TokenResponse> | null;
protected readonly authenticationContext: adal.AuthenticationContext;
protected authenticationContext: adal.AuthenticationContext;
constructor(appId: string, channelAuthTenant?: string, oAuthScope?: string);
private tenant;
oAuthScope: string;
oAuthEndpoint: string;
/**

@@ -27,0 +30,0 @@ * Adds the host of service url to trusted hosts.

@@ -30,11 +30,14 @@ "use strict";

this.appId = appId;
const tenant = channelAuthTenant && channelAuthTenant.length > 0
? channelAuthTenant
: authenticationConstants_1.AuthenticationConstants.DefaultChannelAuthTenant;
this.oAuthEndpoint = authenticationConstants_1.AuthenticationConstants.ToChannelFromBotLoginUrlPrefix + tenant;
this.tenant = channelAuthTenant;
this.oAuthEndpoint = authenticationConstants_1.AuthenticationConstants.ToChannelFromBotLoginUrlPrefix + this.tenant;
this.oAuthScope = oAuthScope;
// aadApiVersion is set to '1.5' to avoid the "spn:" concatenation on the audience claim
// For more info, see https://github.com/AzureAD/azure-activedirectory-library-for-nodejs/issues/128
this.authenticationContext = new adal.AuthenticationContext(this.oAuthEndpoint, true, undefined, '1.5');
}
get tenant() {
return this._tenant;
}
set tenant(value) {
this._tenant = value && value.length > 0
? value
: authenticationConstants_1.AuthenticationConstants.DefaultChannelAuthTenant;
}
get oAuthScope() {

@@ -47,2 +50,11 @@ return this._oAuthScope;

}
get oAuthEndpoint() {
return this._oAuthEndpoint;
}
set oAuthEndpoint(value) {
// aadApiVersion is set to '1.5' to avoid the "spn:" concatenation on the audience claim
// For more info, see https://github.com/AzureAD/azure-activedirectory-library-for-nodejs/issues/128
this._oAuthEndpoint = value;
this.authenticationContext = new adal.AuthenticationContext(value, true, undefined, '1.5');
}
/**

@@ -49,0 +61,0 @@ * Adds the host of service url to trusted hosts.

@@ -14,3 +14,3 @@ /**

*/
const ToChannelFromBotLoginUrl = "https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token";
const ToChannelFromBotLoginUrl = "https://login.microsoftonline.com/botframework.com";
/**

@@ -31,3 +31,3 @@ * TO CHANNEL FROM BOT: Login URL prefix

*/
const ToChannelFromBotOAuthScope = "https://api.botframework.com/.default";
const ToChannelFromBotOAuthScope = "https://api.botframework.com";
/**

@@ -34,0 +34,0 @@ * TO BOT FROM CHANNEL: Token issuer

@@ -17,3 +17,3 @@ "use strict";

*/
AuthenticationConstants.ToChannelFromBotLoginUrl = 'https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token';
AuthenticationConstants.ToChannelFromBotLoginUrl = 'https://login.microsoftonline.com/botframework.com';
/**

@@ -34,3 +34,3 @@ * TO CHANNEL FROM BOT: Login URL prefix

*/
AuthenticationConstants.ToChannelFromBotOAuthScope = 'https://api.botframework.com/.default';
AuthenticationConstants.ToChannelFromBotOAuthScope = 'https://api.botframework.com';
/**

@@ -37,0 +37,0 @@ * TO BOT FROM CHANNEL: Token issuer

@@ -16,7 +16,7 @@ /**

*/
const ToChannelFromBotLoginUrl = "https://login.microsoftonline.us/cab8a31a-1906-4287-a0d8-4eef66b95f6e/oauth2/v2.0/token";
const ToChannelFromBotLoginUrl = "https://login.microsoftonline.us/cab8a31a-1906-4287-a0d8-4eef66b95f6e";
/**
* TO CHANNEL FROM BOT: OAuth scope to request
*/
const ToChannelFromBotOAuthScope = "https://api.botframework.us/.default";
const ToChannelFromBotOAuthScope = "https://api.botframework.us";
/**

@@ -23,0 +23,0 @@ * TO BOT FROM CHANNEL: Token issuer

@@ -19,7 +19,7 @@ "use strict";

*/
GovernmentConstants.ToChannelFromBotLoginUrl = 'https://login.microsoftonline.us/cab8a31a-1906-4287-a0d8-4eef66b95f6e/oauth2/v2.0/token';
GovernmentConstants.ToChannelFromBotLoginUrl = 'https://login.microsoftonline.us/cab8a31a-1906-4287-a0d8-4eef66b95f6e';
/**
* TO CHANNEL FROM BOT: OAuth scope to request
*/
GovernmentConstants.ToChannelFromBotOAuthScope = 'https://api.botframework.us/.default';
GovernmentConstants.ToChannelFromBotOAuthScope = 'https://api.botframework.us';
/**

@@ -26,0 +26,0 @@ * TO BOT FROM CHANNEL: Token issuer

@@ -202,2 +202,20 @@ /// <reference types="node" />

/**
* Contains response data for the getConversationMember operation.
*/
export declare type ConversationsGetConversationMemberResponse = ChannelAccount & {
/**
* The underlying HTTP response.
*/
_response: msRest.HttpResponse & {
/**
* The response body as text (string format)
*/
bodyAsText: string;
/**
* The response body as parsed JSON or XML
*/
parsedBody: ChannelAccount;
};
};
/**
* Contains response data for the getConversationPagedMembers operation.

@@ -204,0 +222,0 @@ */

@@ -22,2 +22,3 @@ import * as msRest from "@azure/ms-rest-js";

export declare const ConversationsResult: msRest.CompositeMapper;
export declare const ExpectedReplies: msRest.CompositeMapper;
export declare const ResourceResponse: msRest.CompositeMapper;

@@ -24,0 +25,0 @@ export declare const Transcript: msRest.CompositeMapper;

@@ -249,2 +249,9 @@ import * as msRest from "@azure/ms-rest-js";

/**
* @param conversationId Conversation ID
* @param memberId MemberId for the user
* @param options The optional parameters
* @param callback The callback
*/
getConversationMember(conversationId: string, memberId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ChannelAccount[]>, callback?: msRest.ServiceCallback<Models.ChannelAccount[]>): Promise<Models.ConversationsGetConversationMemberResponse>;
/**
* Enumerate the members of a conversation one page at a time.

@@ -251,0 +258,0 @@ *

@@ -74,2 +74,15 @@ "use strict";

}
/**
* @param conversationId Conversation ID
* @param memberId MemberId for the user
* @param options The optional parameters
* @param callback The callback
*/
getConversationMember(conversationId, memberId, options, callback) {
return this.client.sendOperationRequest({
conversationId,
memberId,
options
}, getConversationMemberOperationSpec, callback);
}
getConversationPagedMembers(conversationId, options, callback) {

@@ -294,2 +307,19 @@ return this.client.sendOperationRequest({

};
const getConversationMemberOperationSpec = {
httpMethod: "GET",
path: "v3/conversations/{conversationId}/members/{memberId}",
urlParameters: [
Parameters.conversationId,
Parameters.memberId
],
responses: {
200: {
bodyMapper: Mappers.ChannelAccount,
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
serializer
};
const getConversationPagedMembersOperationSpec = {

@@ -296,0 +326,0 @@ httpMethod: "GET",

@@ -18,2 +18,3 @@ /**

export * from './teams';
export { SignInUrlResponse, TokenExchangeRequest } from 'botframework-schema';
//# sourceMappingURL=index.d.ts.map

@@ -1,2 +0,2 @@

import { HttpResponse, ServiceClientOptions } from '@azure/ms-rest-js';
import { HttpResponse, ServiceClientOptions, RequestOptionsBase } from '@azure/ms-rest-js';
import { ConversationList, TeamDetails } from 'botframework-schema';

@@ -50,2 +50,12 @@ /**

};
export interface ConversationsGetConversationPagedMembersOptionalParams extends RequestOptionsBase {
/**
* Suggested page size
*/
pageSize: number;
/**
* Continuation Token
*/
continuationToken: string;
}
//# sourceMappingURL=index.d.ts.map

@@ -1,2 +0,2 @@

export {} from "../models/mappers";
export { SignInUrlResponse, TokenExchangeResource } from "../models/mappers";
//# sourceMappingURL=botSignInMappers.d.ts.map
"use strict";
/*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
Object.defineProperty(exports, "__esModule", { value: true });
var mappers_1 = require("../models/mappers");
exports.SignInUrlResponse = mappers_1.SignInUrlResponse;
exports.TokenExchangeResource = mappers_1.TokenExchangeResource;
//# sourceMappingURL=botSignInMappers.js.map
import { ServiceClientOptions } from "@azure/ms-rest-js";
import * as msRest from "@azure/ms-rest-js";
import { SignInUrlResponse } from "botframework-schema";
/**
* @interface
* An interface representing TokenResponse.

@@ -15,34 +17,68 @@ */

connectionName?: string;
/**
* @member {string} [token]
*/
token?: string;
/**
* @member {string} [expiration]
*/
expiration?: string;
}
/**
* @interface
* An interface representing InnerHttpError.
*/
export interface InnerHttpError {
/**
* @member {number} [statusCode]
*/
statusCode?: number;
/**
* @member {any} [body]
*/
body?: any;
}
/**
* @interface
* An interface representing ErrorModel.
*/
export interface ErrorModel {
/**
* @member {string} [code]
*/
code?: string;
/**
* @member {string} [message]
*/
message?: string;
/**
* @member {InnerHttpError} [innerHttpError]
*/
innerHttpError?: InnerHttpError;
}
/**
* @interface
* An interface representing ErrorResponse.
*/
export interface ErrorResponse {
/**
* @member {ErrorModel} [error]
*/
error?: ErrorModel;
}
/**
* @interface
* An interface representing AadResourceUrls.
*/
export interface AadResourceUrls {
/**
* @member {string[]} [resourceUrls]
*/
resourceUrls?: string[];
}
/**
* @interface
* An interface representing TokenStatus.
* The status of a particular token
*
*/

@@ -60,7 +96,9 @@ export interface TokenStatus {

/**
* True if a token is stored for this ConnectionName
* @member {boolean} [hasToken] True if a token is stored for this
* ConnectionName
*/
hasToken?: boolean;
/**
* The display name of the service provider for which this Token belongs to
* @member {string} [serviceProviderDisplayName] The display name of the
* service provider for which this Token belongs to
*/

@@ -70,18 +108,61 @@ serviceProviderDisplayName?: string;

/**
* @interface
* An interface representing TokenApiClientOptions.
* @extends ServiceClientOptions
*/
export interface TokenApiClientOptions extends ServiceClientOptions {
/**
* @member {string} [baseUri]
*/
baseUri?: string;
}
/**
* @interface
* An interface representing BotSignInGetSignInUrlOptionalParams.
* Optional Parameters.
*
* @extends RequestOptionsBase
*/
export interface BotSignInGetSignInUrlOptionalParams extends msRest.RequestOptionsBase {
/**
* @member {string} [codeChallenge]
*/
codeChallenge?: string;
/**
* @member {string} [emulatorUrl]
*/
emulatorUrl?: string;
/**
* @member {string} [finalRedirect]
*/
finalRedirect?: string;
}
/**
* @interface
* An interface representing BotSignInGetSignInResourceOptionalParams.
* Optional Parameters.
*
* @extends RequestOptionsBase
*/
export interface BotSignInGetSignInResourceOptionalParams extends msRest.RequestOptionsBase {
/**
* @member {string} [codeChallenge]
*/
codeChallenge?: string;
/**
* @member {string} [emulatorUrl]
*/
emulatorUrl?: string;
/**
* @member {string} [finalRedirect]
*/
finalRedirect?: string;
}
/**
* @interface
* An interface representing UserTokenGetTokenOptionalParams.
* Optional Parameters.
*
* @extends RequestOptionsBase
*/
export interface UserTokenGetTokenOptionalParams extends msRest.RequestOptionsBase {

@@ -114,4 +195,9 @@ /**

* Optional Parameters.
*
* @extends RequestOptionsBase
*/
export interface UserTokenSignOutOptionalParams extends msRest.RequestOptionsBase {
/**
* @member {string} [connectionName]
*/
connectionName?: string;

@@ -124,3 +210,7 @@ /**

/**
* @interface
* An interface representing UserTokenGetTokenStatusOptionalParams.
* Optional Parameters.
*
* @extends RequestOptionsBase
*/

@@ -160,2 +250,20 @@ export interface UserTokenGetTokenStatusOptionalParams extends msRest.RequestOptionsBase {

/**
* Contains response data for the getSignInResource operation.
*/
export declare type BotSignInGetSignInResourceResponse = SignInUrlResponse & {
/**
* The underlying HTTP response.
*/
_response: msRest.HttpResponse & {
/**
* The response body as text (string format)
*/
bodyAsText: string;
/**
* The response body as parsed JSON or XML
*/
parsedBody: SignInUrlResponse;
};
};
/**
* Contains response data for the getToken operation.

@@ -243,2 +351,24 @@ */

};
/**
* Contains response data for the exchangeAsync operation.
*/
export declare type UserTokenExchangeAsyncResponse = {
/**
* The parsed response body.
*/
body: any;
/**
* The underlying HTTP response.
*/
_response: msRest.HttpResponse & {
/**
* The response body as text (string format)
*/
bodyAsText: string;
/**
* The response body as parsed JSON or XML
*/
parsedBody: any;
};
};
//# sourceMappingURL=index.d.ts.map
"use strict";
/*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=index.js.map
import * as msRest from "@azure/ms-rest-js";
export declare const TokenExchangeResource: msRest.CompositeMapper;
export declare const SignInUrlResponse: msRest.CompositeMapper;
export declare const TokenResponse: msRest.CompositeMapper;

@@ -8,2 +10,3 @@ export declare const InnerHttpError: msRest.CompositeMapper;

export declare const TokenStatus: msRest.CompositeMapper;
export declare const TokenExchangeRequest: msRest.CompositeMapper;
//# sourceMappingURL=mappers.d.ts.map
"use strict";
/*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.TokenExchangeResource = {
serializedName: "TokenExchangeResource",
type: {
name: "Composite",
className: "TokenExchangeResource",
modelProperties: {
id: {
serializedName: "id",
type: {
name: "String"
}
},
uri: {
serializedName: "uri",
type: {
name: "String"
}
},
providerId: {
serializedName: "providerId",
type: {
name: "String"
}
}
}
}
};
exports.SignInUrlResponse = {
serializedName: "SignInUrlResponse",
type: {
name: "Composite",
className: "SignInUrlResponse",
modelProperties: {
signInLink: {
serializedName: "signInLink",
type: {
name: "String"
}
},
tokenExchangeResource: {
serializedName: "tokenExchangeResource",
type: {
name: "Composite",
className: "TokenExchangeResource"
}
}
}
}
};
exports.TokenResponse = {

@@ -158,2 +208,23 @@ serializedName: "TokenResponse",

};
exports.TokenExchangeRequest = {
serializedName: "TokenExchangeRequest",
type: {
name: "Composite",
className: "TokenExchangeRequest",
modelProperties: {
uri: {
serializedName: "uri",
type: {
name: "String"
}
},
token: {
serializedName: "token",
type: {
name: "String"
}
}
}
}
};
//# sourceMappingURL=mappers.js.map
import * as msRest from "@azure/ms-rest-js";
export declare const channelId: msRest.OperationQueryParameter;
export declare const channelId0: msRest.OperationQueryParameter;
export declare const channelId1: msRest.OperationQueryParameter;
export declare const code: msRest.OperationQueryParameter;

@@ -4,0 +5,0 @@ export declare const codeChallenge: msRest.OperationQueryParameter;

@@ -8,3 +8,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.channelId = {
exports.channelId0 = {
parameterPath: [

@@ -21,2 +21,12 @@ "options",

};
exports.channelId1 = {
parameterPath: "channelId",
mapper: {
required: true,
serializedName: "channelId",
type: {
name: "String"
}
}
};
exports.code = {

@@ -23,0 +33,0 @@ parameterPath: [

@@ -1,2 +0,2 @@

export { AadResourceUrls, ErrorModel, ErrorResponse, InnerHttpError, TokenResponse, TokenStatus } from "../models/mappers";
export { TokenResponse, ErrorResponse, ErrorModel, InnerHttpError, AadResourceUrls, TokenStatus, TokenExchangeRequest } from "../models/mappers";
//# sourceMappingURL=userTokenMappers.d.ts.map
"use strict";
/*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
Object.defineProperty(exports, "__esModule", { value: true });
var mappers_1 = require("../models/mappers");
exports.AadResourceUrls = mappers_1.AadResourceUrls;
exports.TokenResponse = mappers_1.TokenResponse;
exports.ErrorResponse = mappers_1.ErrorResponse;
exports.ErrorModel = mappers_1.ErrorModel;
exports.ErrorResponse = mappers_1.ErrorResponse;
exports.InnerHttpError = mappers_1.InnerHttpError;
exports.TokenResponse = mappers_1.TokenResponse;
exports.AadResourceUrls = mappers_1.AadResourceUrls;
exports.TokenStatus = mappers_1.TokenStatus;
exports.TokenExchangeRequest = mappers_1.TokenExchangeRequest;
//# sourceMappingURL=userTokenMappers.js.map
import * as msRest from "@azure/ms-rest-js";
import * as Models from "../models";
import { TokenApiClientContext } from "../tokenApiClientContext";
import { SignInUrlResponse } from "botframework-schema";
/** Class representing a BotSignIn. */

@@ -29,3 +30,20 @@ export declare class BotSignIn {

getSignInUrl(state: string, options: Models.BotSignInGetSignInUrlOptionalParams, callback: msRest.ServiceCallback<string>): void;
/**
* @param state
* @param [options] The optional parameters
* @returns Promise<Models.BotSignInGetSignInResourceResponse>
*/
getSignInResource(state: string, options?: Models.BotSignInGetSignInResourceOptionalParams): Promise<Models.BotSignInGetSignInResourceResponse>;
/**
* @param state
* @param callback The callback
*/
getSignInResource(state: string, callback: msRest.ServiceCallback<SignInUrlResponse>): void;
/**
* @param state
* @param options The optional parameters
* @param callback The callback
*/
getSignInResource(state: string, options: Models.BotSignInGetSignInResourceOptionalParams, callback: msRest.ServiceCallback<SignInUrlResponse>): void;
}
//# sourceMappingURL=botSignIn.d.ts.map

@@ -26,2 +26,8 @@ "use strict";

}
getSignInResource(state, options, callback) {
return this.client.sendOperationRequest({
state,
options
}, getSignInResourceOperationSpec, callback);
}
}

@@ -53,2 +59,19 @@ exports.BotSignIn = BotSignIn;

};
const getSignInResourceOperationSpec = {
httpMethod: "GET",
path: "api/botsignin/GetSignInResource",
queryParameters: [
Parameters.state,
Parameters.codeChallenge,
Parameters.emulatorUrl,
Parameters.finalRedirect
],
responses: {
200: {
bodyMapper: Mappers.SignInUrlResponse
},
default: {}
},
serializer
};
//# sourceMappingURL=botSignIn.js.map
import * as msRest from "@azure/ms-rest-js";
import * as Models from "../models";
import { TokenApiClientContext } from "../tokenApiClientContext";
import { TokenExchangeRequest } from "botframework-schema";
/** Class representing a UserToken. */

@@ -93,3 +94,29 @@ export declare class UserToken {

getTokenStatus(userId: string, options: Models.UserTokenGetTokenStatusOptionalParams, callback: msRest.ServiceCallback<Models.TokenStatus[]>): void;
/**
* @param userId
* @param connectionName
* @param channelId
* @param exchangeRequest
* @param [options] The optional parameters
* @returns Promise<Models.UserTokenExchangeAsyncResponse>
*/
exchangeAsync(userId: string, connectionName: string, channelId: string, exchangeRequest: TokenExchangeRequest, options?: msRest.RequestOptionsBase): Promise<Models.UserTokenExchangeAsyncResponse>;
/**
* @param userId
* @param connectionName
* @param channelId
* @param exchangeRequest
* @param callback The callback
*/
exchangeAsync(userId: string, connectionName: string, channelId: string, exchangeRequest: TokenExchangeRequest, callback: msRest.ServiceCallback<any>): void;
/**
* @param userId
* @param connectionName
* @param channelId
* @param exchangeRequest
* @param options The optional parameters
* @param callback The callback
*/
exchangeAsync(userId: string, connectionName: string, channelId: string, exchangeRequest: TokenExchangeRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<any>): void;
}
//# sourceMappingURL=userToken.d.ts.map

@@ -47,2 +47,11 @@ "use strict";

}
exchangeAsync(userId, connectionName, channelId, exchangeRequest, options, callback) {
return this.client.sendOperationRequest({
userId,
connectionName,
channelId,
exchangeRequest,
options
}, exchangeAsyncOperationSpec, callback);
}
}

@@ -58,3 +67,3 @@ exports.UserToken = UserToken;

Parameters.connectionName0,
Parameters.channelId,
Parameters.channelId0,
Parameters.code

@@ -81,3 +90,3 @@ ],

Parameters.connectionName0,
Parameters.channelId
Parameters.channelId0
],

@@ -115,3 +124,3 @@ requestBody: {

Parameters.connectionName1,
Parameters.channelId
Parameters.channelId0
],

@@ -139,3 +148,3 @@ responses: {

Parameters.userId,
Parameters.channelId,
Parameters.channelId0,
Parameters.include

@@ -164,2 +173,30 @@ ],

};
const exchangeAsyncOperationSpec = {
httpMethod: "POST",
path: "api/usertoken/exchange",
queryParameters: [
Parameters.userId,
Parameters.connectionName0,
Parameters.channelId1
],
requestBody: {
parameterPath: "exchangeRequest",
mapper: Object.assign({}, Mappers.TokenExchangeRequest, { required: true })
},
responses: {
200: {
bodyMapper: Mappers.TokenResponse
},
400: {
bodyMapper: Mappers.ErrorResponse
},
404: {
bodyMapper: Mappers.TokenResponse
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
serializer
};
//# sourceMappingURL=userToken.js.map

@@ -5,3 +5,3 @@ {

"description": "Bot Connector is autorest generated connector client.",
"version": "4.8.0-preview-109324",
"version": "4.8.0",
"license": "MIT",

@@ -28,3 +28,3 @@ "keywords": [

"base64url": "^3.0.0",
"botframework-schema": "4.8.0-preview-109324",
"botframework-schema": "4.8.0",
"form-data": "^2.3.3",

@@ -41,3 +41,3 @@ "jsonwebtoken": "8.0.1",

"nock": "^10.0.3",
"nyc": "^11.4.1",
"nyc": "^15.0.0",
"should": "^13.2.3",

@@ -52,3 +52,3 @@ "source-map-support": "^0.5.3",

"clean": "erase /q /s .\\lib",
"set-version": "npm version --allow-same-version 4.8.0-preview-109324"
"set-version": "npm version --allow-same-version 4.8.0"
},

@@ -55,0 +55,0 @@ "files": [

@@ -32,22 +32,28 @@ /**

public oAuthEndpoint: string;
private _oAuthEndpoint: string;
private _oAuthScope: string;
private _tenant: string;
public tokenCacheKey: string;
protected refreshingToken: Promise<adal.TokenResponse> | null = null;
protected readonly authenticationContext: adal.AuthenticationContext;
protected authenticationContext: adal.AuthenticationContext;
constructor(appId: string, channelAuthTenant?: string, oAuthScope: string = AuthenticationConstants.ToBotFromChannelTokenIssuer) {
public constructor(appId: string, channelAuthTenant?: string, oAuthScope: string = AuthenticationConstants.ToBotFromChannelTokenIssuer) {
this.appId = appId;
const tenant = channelAuthTenant && channelAuthTenant.length > 0
? channelAuthTenant
: AuthenticationConstants.DefaultChannelAuthTenant;
this.oAuthEndpoint = AuthenticationConstants.ToChannelFromBotLoginUrlPrefix + tenant;
this.tenant = channelAuthTenant;
this.oAuthEndpoint = AuthenticationConstants.ToChannelFromBotLoginUrlPrefix + this.tenant;
this.oAuthScope = oAuthScope;
// aadApiVersion is set to '1.5' to avoid the "spn:" concatenation on the audience claim
// For more info, see https://github.com/AzureAD/azure-activedirectory-library-for-nodejs/issues/128
this.authenticationContext = new adal.AuthenticationContext(this.oAuthEndpoint, true, undefined, '1.5');
}
private get tenant(): string {
return this._tenant;
}
private set tenant(value: string) {
this._tenant = value && value.length > 0
? value
: AuthenticationConstants.DefaultChannelAuthTenant;
}
public get oAuthScope(): string {
return this._oAuthScope
return this._oAuthScope;
}

@@ -60,2 +66,13 @@

public get oAuthEndpoint(): string {
return this._oAuthEndpoint;
}
public set oAuthEndpoint(value: string) {
// aadApiVersion is set to '1.5' to avoid the "spn:" concatenation on the audience claim
// For more info, see https://github.com/AzureAD/azure-activedirectory-library-for-nodejs/issues/128
this._oAuthEndpoint = value;
this.authenticationContext = new adal.AuthenticationContext(value, true, undefined, '1.5');
}
/**

@@ -62,0 +79,0 @@ * Adds the host of service url to trusted hosts.

@@ -14,3 +14,3 @@ /**

*/
export const ToChannelFromBotLoginUrl = 'https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token';
export const ToChannelFromBotLoginUrl = 'https://login.microsoftonline.com/botframework.com';

@@ -35,3 +35,3 @@ /**

*/
export const ToChannelFromBotOAuthScope = 'https://api.botframework.com/.default';
export const ToChannelFromBotOAuthScope = 'https://api.botframework.com';

@@ -38,0 +38,0 @@ /**

@@ -17,3 +17,3 @@ /**

*/
export const ToChannelFromBotLoginUrl = 'https://login.microsoftonline.us/cab8a31a-1906-4287-a0d8-4eef66b95f6e/oauth2/v2.0/token';
export const ToChannelFromBotLoginUrl = 'https://login.microsoftonline.us/cab8a31a-1906-4287-a0d8-4eef66b95f6e';

@@ -23,3 +23,3 @@ /**

*/
export const ToChannelFromBotOAuthScope = 'https://api.botframework.us/.default';
export const ToChannelFromBotOAuthScope = 'https://api.botframework.us';

@@ -26,0 +26,0 @@ /**

@@ -9,3 +9,3 @@ /**

import * as adal from 'adal-node'
import * as adal from 'adal-node';
import { AppCredentials } from './appCredentials';

@@ -19,3 +19,3 @@

constructor(appId: string, appPassword: string, channelAuthTenant?: string, oAuthScope?: string) {
public constructor(appId: string, appPassword: string, channelAuthTenant?: string, oAuthScope?: string) {
super(appId, channelAuthTenant, oAuthScope);

@@ -27,4 +27,4 @@ this.appPassword = appPassword;

if (!this.refreshingToken) {
this.refreshingToken = new Promise<adal.TokenResponse>((resolve, reject) => {
this.authenticationContext.acquireTokenWithClientCredentials(this.oAuthScope, this.appId, this.appPassword, function(err, tokenResponse) {
this.refreshingToken = new Promise<adal.TokenResponse>((resolve, reject): void => {
this.authenticationContext.acquireTokenWithClientCredentials(this.oAuthScope, this.appId, this.appPassword, function(err, tokenResponse): void {
if (err) {

@@ -35,3 +35,3 @@ reject(err);

}
});
});

@@ -38,0 +38,0 @@ });

@@ -224,2 +224,22 @@ import * as msRest from "@azure/ms-rest-js";

/**
* Contains response data for the getConversationMember operation.
*/
export type ConversationsGetConversationMemberResponse = ChannelAccount & {
/**
* The underlying HTTP response.
*/
_response: msRest.HttpResponse & {
/**
* The response body as text (string format)
*/
bodyAsText: string;
/**
* The response body as parsed JSON or XML
*/
parsedBody: ChannelAccount;
};
};
/**
* Contains response data for the getConversationPagedMembers operation.

@@ -226,0 +246,0 @@ */

@@ -959,2 +959,24 @@ /*

export const ExpectedReplies: msRest.CompositeMapper = {
serializedName: "ExpectedReplies",
type: {
name: "Composite",
className: "ExpectedReplies",
modelProperties: {
activities: {
serializedName: "activities",
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "Activity"
}
}
}
}
}
}
};
export const ResourceResponse: msRest.CompositeMapper = {

@@ -961,0 +983,0 @@ serializedName: "ResourceResponse",

@@ -348,2 +348,19 @@ /*

/**
* @param conversationId Conversation ID
* @param memberId MemberId for the user
* @param options The optional parameters
* @param callback The callback
*/
getConversationMember(conversationId: string, memberId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ChannelAccount[]>, callback?: msRest.ServiceCallback<Models.ChannelAccount[]>): Promise<Models.ConversationsGetConversationMemberResponse> {
return this.client.sendOperationRequest(
{
conversationId,
memberId,
options
},
getConversationMemberOperationSpec,
callback) as Promise<Models.ConversationsGetConversationMemberResponse>;
}
/**
* Enumerate the members of a conversation one page at a time.

@@ -700,9 +717,9 @@ *

type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ChannelAccount"
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ChannelAccount"
}
}
}
}

@@ -718,2 +735,20 @@ }

const getConversationMemberOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "v3/conversations/{conversationId}/members/{memberId}",
urlParameters: [
Parameters.conversationId,
Parameters.memberId
],
responses: {
200: {
bodyMapper: Mappers.ChannelAccount,
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
serializer
};
const getConversationPagedMembersOperationSpec: msRest.OperationSpec = {

@@ -720,0 +755,0 @@ httpMethod: "GET",

@@ -20,2 +20,3 @@ /**

export * from './tokenApi/models'
export * from './teams';
export * from './teams';
export { SignInUrlResponse, TokenExchangeRequest } from 'botframework-schema';

@@ -0,1 +1,3 @@

/*

@@ -9,3 +11,3 @@ * Code generated by Microsoft (R) AutoRest Code Generator.

import { HttpResponse, ServiceClientOptions } from '@azure/ms-rest-js';
import { HttpResponse, ServiceClientOptions, RequestOptionsBase } from '@azure/ms-rest-js';
import { ConversationList, TeamDetails } from 'botframework-schema';

@@ -61,2 +63,13 @@

};
};
};
export interface ConversationsGetConversationPagedMembersOptionalParams extends RequestOptionsBase {
/**
* Suggested page size
*/
pageSize: number;
/**
* Continuation Token
*/
continuationToken: string;
}
/*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
export {
} from "../models/mappers";
SignInUrlResponse,
TokenExchangeResource
} from "../models/mappers";
/*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

@@ -8,4 +9,6 @@

import * as msRest from "@azure/ms-rest-js";
import { SignInUrlResponse } from "botframework-schema";
/**
* @interface
* An interface representing TokenResponse.

@@ -22,3 +25,9 @@ */

connectionName?: string;
/**
* @member {string} [token]
*/
token?: string;
/**
* @member {string} [expiration]
*/
expiration?: string;

@@ -28,6 +37,13 @@ }

/**
* @interface
* An interface representing InnerHttpError.
*/
export interface InnerHttpError {
/**
* @member {number} [statusCode]
*/
statusCode?: number;
/**
* @member {any} [body]
*/
body?: any;

@@ -37,7 +53,17 @@ }

/**
* @interface
* An interface representing ErrorModel.
*/
export interface ErrorModel {
/**
* @member {string} [code]
*/
code?: string;
/**
* @member {string} [message]
*/
message?: string;
/**
* @member {InnerHttpError} [innerHttpError]
*/
innerHttpError?: InnerHttpError;

@@ -47,5 +73,9 @@ }

/**
* @interface
* An interface representing ErrorResponse.
*/
export interface ErrorResponse {
/**
* @member {ErrorModel} [error]
*/
error?: ErrorModel;

@@ -55,5 +85,9 @@ }

/**
* @interface
* An interface representing AadResourceUrls.
*/
export interface AadResourceUrls {
/**
* @member {string[]} [resourceUrls]
*/
resourceUrls?: string[];

@@ -63,3 +97,6 @@ }

/**
* @interface
* An interface representing TokenStatus.
* The status of a particular token
*
*/

@@ -77,7 +114,9 @@ export interface TokenStatus {

/**
* True if a token is stored for this ConnectionName
* @member {boolean} [hasToken] True if a token is stored for this
* ConnectionName
*/
hasToken?: boolean;
/**
* The display name of the service provider for which this Token belongs to
* @member {string} [serviceProviderDisplayName] The display name of the
* service provider for which this Token belongs to
*/

@@ -88,5 +127,10 @@ serviceProviderDisplayName?: string;

/**
* @interface
* An interface representing TokenApiClientOptions.
* @extends ServiceClientOptions
*/
export interface TokenApiClientOptions extends ServiceClientOptions {
/**
* @member {string} [baseUri]
*/
baseUri?: string;

@@ -96,7 +140,20 @@ }

/**
* @interface
* An interface representing BotSignInGetSignInUrlOptionalParams.
* Optional Parameters.
*
* @extends RequestOptionsBase
*/
export interface BotSignInGetSignInUrlOptionalParams extends msRest.RequestOptionsBase {
/**
* @member {string} [codeChallenge]
*/
codeChallenge?: string;
/**
* @member {string} [emulatorUrl]
*/
emulatorUrl?: string;
/**
* @member {string} [finalRedirect]
*/
finalRedirect?: string;

@@ -106,4 +163,30 @@ }

/**
* @interface
* An interface representing BotSignInGetSignInResourceOptionalParams.
* Optional Parameters.
*
* @extends RequestOptionsBase
*/
export interface BotSignInGetSignInResourceOptionalParams extends msRest.RequestOptionsBase {
/**
* @member {string} [codeChallenge]
*/
codeChallenge?: string;
/**
* @member {string} [emulatorUrl]
*/
emulatorUrl?: string;
/**
* @member {string} [finalRedirect]
*/
finalRedirect?: string;
}
/**
* @interface
* An interface representing UserTokenGetTokenOptionalParams.
* Optional Parameters.
*
* @extends RequestOptionsBase
*/
export interface UserTokenGetTokenOptionalParams extends msRest.RequestOptionsBase {

@@ -138,4 +221,9 @@ /**

* Optional Parameters.
*
* @extends RequestOptionsBase
*/
export interface UserTokenSignOutOptionalParams extends msRest.RequestOptionsBase {
/**
* @member {string} [connectionName]
*/
connectionName?: string;

@@ -149,3 +237,7 @@ /**

/**
* @interface
* An interface representing UserTokenGetTokenStatusOptionalParams.
* Optional Parameters.
*
* @extends RequestOptionsBase
*/

@@ -171,3 +263,2 @@ export interface UserTokenGetTokenStatusOptionalParams extends msRest.RequestOptionsBase {

body: string;
/**

@@ -181,3 +272,2 @@ * The underlying HTTP response.

bodyAsText: string;
/**

@@ -191,2 +281,21 @@ * The response body as parsed JSON or XML

/**
* Contains response data for the getSignInResource operation.
*/
export type BotSignInGetSignInResourceResponse = SignInUrlResponse & {
/**
* The underlying HTTP response.
*/
_response: msRest.HttpResponse & {
/**
* The response body as text (string format)
*/
bodyAsText: string;
/**
* The response body as parsed JSON or XML
*/
parsedBody: SignInUrlResponse;
};
};
/**
* Contains response data for the getToken operation.

@@ -203,3 +312,2 @@ */

bodyAsText: string;
/**

@@ -229,3 +337,2 @@ * The response body as parsed JSON or XML

bodyAsText: string;
/**

@@ -246,3 +353,2 @@ * The response body as parsed JSON or XML

body: any;
/**

@@ -256,3 +362,2 @@ * The underlying HTTP response.

bodyAsText: string;
/**

@@ -277,3 +382,2 @@ * The response body as parsed JSON or XML

bodyAsText: string;
/**

@@ -285,1 +389,24 @@ * The response body as parsed JSON or XML

};
/**
* Contains response data for the exchangeAsync operation.
*/
export type UserTokenExchangeAsyncResponse = {
/**
* The parsed response body.
*/
body: any;
/**
* The underlying HTTP response.
*/
_response: msRest.HttpResponse & {
/**
* The response body as text (string format)
*/
bodyAsText: string;
/**
* The response body as parsed JSON or XML
*/
parsedBody: any;
};
};
/*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

@@ -9,2 +10,53 @@

export const TokenExchangeResource: msRest.CompositeMapper = {
serializedName: "TokenExchangeResource",
type: {
name: "Composite",
className: "TokenExchangeResource",
modelProperties: {
id: {
serializedName: "id",
type: {
name: "String"
}
},
uri: {
serializedName: "uri",
type: {
name: "String"
}
},
providerId: {
serializedName: "providerId",
type: {
name: "String"
}
}
}
}
};
export const SignInUrlResponse: msRest.CompositeMapper = {
serializedName: "SignInUrlResponse",
type: {
name: "Composite",
className: "SignInUrlResponse",
modelProperties: {
signInLink: {
serializedName: "signInLink",
type: {
name: "String"
}
},
tokenExchangeResource: {
serializedName: "tokenExchangeResource",
type: {
name: "Composite",
className: "TokenExchangeResource"
}
}
}
}
};
export const TokenResponse: msRest.CompositeMapper = {

@@ -166,1 +218,23 @@ serializedName: "TokenResponse",

};
export const TokenExchangeRequest: msRest.CompositeMapper = {
serializedName: "TokenExchangeRequest",
type: {
name: "Composite",
className: "TokenExchangeRequest",
modelProperties: {
uri: {
serializedName: "uri",
type: {
name: "String"
}
},
token: {
serializedName: "token",
type: {
name: "String"
}
}
}
}
};

@@ -9,3 +9,3 @@ /*

export const channelId: msRest.OperationQueryParameter = {
export const channelId0: msRest.OperationQueryParameter = {
parameterPath: [

@@ -22,2 +22,12 @@ "options",

};
export const channelId1: msRest.OperationQueryParameter = {
parameterPath: "channelId",
mapper: {
required: true,
serializedName: "channelId",
type: {
name: "String"
}
}
};
export const code: msRest.OperationQueryParameter = {

@@ -24,0 +34,0 @@ parameterPath: [

/*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
export {
AadResourceUrls,
TokenResponse,
ErrorResponse,
ErrorModel,
ErrorResponse,
InnerHttpError,
TokenResponse,
TokenStatus
AadResourceUrls,
TokenStatus,
TokenExchangeRequest
} from "../models/mappers";

@@ -12,2 +12,3 @@ /*

import { TokenApiClientContext } from "../tokenApiClientContext";
import { SignInUrlResponse } from "botframework-schema";

@@ -52,2 +53,29 @@ /** Class representing a BotSignIn. */

}
/**
* @param state
* @param [options] The optional parameters
* @returns Promise<Models.BotSignInGetSignInResourceResponse>
*/
getSignInResource(state: string, options?: Models.BotSignInGetSignInResourceOptionalParams): Promise<Models.BotSignInGetSignInResourceResponse>;
/**
* @param state
* @param callback The callback
*/
getSignInResource(state: string, callback: msRest.ServiceCallback<SignInUrlResponse>): void;
/**
* @param state
* @param options The optional parameters
* @param callback The callback
*/
getSignInResource(state: string, options: Models.BotSignInGetSignInResourceOptionalParams, callback: msRest.ServiceCallback<SignInUrlResponse>): void;
getSignInResource(state: string, options?: Models.BotSignInGetSignInResourceOptionalParams | msRest.ServiceCallback<SignInUrlResponse>, callback?: msRest.ServiceCallback<SignInUrlResponse>): Promise<Models.BotSignInGetSignInResourceResponse> {
return this.client.sendOperationRequest(
{
state,
options
},
getSignInResourceOperationSpec,
callback) as Promise<Models.BotSignInGetSignInResourceResponse>;
}
}

@@ -79,1 +107,19 @@

};
const getSignInResourceOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "api/botsignin/GetSignInResource",
queryParameters: [
Parameters.state,
Parameters.codeChallenge,
Parameters.emulatorUrl,
Parameters.finalRedirect
],
responses: {
200: {
bodyMapper: Mappers.SignInUrlResponse
},
default: {}
},
serializer
};

@@ -12,2 +12,3 @@ /*

import { TokenApiClientContext } from "../tokenApiClientContext";
import { TokenExchangeRequest } from "botframework-schema";

@@ -80,3 +81,3 @@ /** Class representing a UserToken. */

getAadTokens(userId: string, connectionName: string, aadResourceUrls: Models.AadResourceUrls, options: Models.UserTokenGetAadTokensOptionalParams, callback: msRest.ServiceCallback<{ [propertyName: string]: Models.TokenResponse }>): void;
getAadTokens(userId: string, connectionName: string, aadResourceUrls: Models.AadResourceUrls, options?: Models.UserTokenGetAadTokensOptionalParams, callback?: msRest.ServiceCallback<{ [propertyName: string]: Models.TokenResponse }>): Promise<Models.UserTokenGetAadTokensResponse> {
getAadTokens(userId: string, connectionName: string, aadResourceUrls: Models.AadResourceUrls, options?: Models.UserTokenGetAadTokensOptionalParams | msRest.ServiceCallback<{ [propertyName: string]: Models.TokenResponse }>, callback?: msRest.ServiceCallback<{ [propertyName: string]: Models.TokenResponse }>): Promise<Models.UserTokenGetAadTokensResponse> {
return this.client.sendOperationRequest(

@@ -146,2 +147,41 @@ {

}
/**
* @param userId
* @param connectionName
* @param channelId
* @param exchangeRequest
* @param [options] The optional parameters
* @returns Promise<Models.UserTokenExchangeAsyncResponse>
*/
exchangeAsync(userId: string, connectionName: string, channelId: string, exchangeRequest: TokenExchangeRequest, options?: msRest.RequestOptionsBase): Promise<Models.UserTokenExchangeAsyncResponse>;
/**
* @param userId
* @param connectionName
* @param channelId
* @param exchangeRequest
* @param callback The callback
*/
exchangeAsync(userId: string, connectionName: string, channelId: string, exchangeRequest: TokenExchangeRequest, callback: msRest.ServiceCallback<any>): void;
/**
* @param userId
* @param connectionName
* @param channelId
* @param exchangeRequest
* @param options The optional parameters
* @param callback The callback
*/
exchangeAsync(userId: string, connectionName: string, channelId: string, exchangeRequest: TokenExchangeRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<any>): void;
exchangeAsync(userId: string, connectionName: string, channelId: string, exchangeRequest: TokenExchangeRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<any>, callback?: msRest.ServiceCallback<any>): Promise<Models.UserTokenExchangeAsyncResponse> {
return this.client.sendOperationRequest(
{
userId,
connectionName,
channelId,
exchangeRequest,
options
},
exchangeAsyncOperationSpec,
callback) as Promise<Models.UserTokenExchangeAsyncResponse>;
}
}

@@ -157,3 +197,3 @@

Parameters.connectionName0,
Parameters.channelId,
Parameters.channelId0,
Parameters.code

@@ -181,3 +221,3 @@ ],

Parameters.connectionName0,
Parameters.channelId
Parameters.channelId0
],

@@ -219,3 +259,3 @@ requestBody: {

Parameters.connectionName1,
Parameters.channelId
Parameters.channelId0
],

@@ -244,3 +284,3 @@ responses: {

Parameters.userId,
Parameters.channelId,
Parameters.channelId0,
Parameters.include

@@ -269,1 +309,33 @@ ],

};
const exchangeAsyncOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "api/usertoken/exchange",
queryParameters: [
Parameters.userId,
Parameters.connectionName0,
Parameters.channelId1
],
requestBody: {
parameterPath: "exchangeRequest",
mapper: {
...Mappers.TokenExchangeRequest,
required: true
}
},
responses: {
200: {
bodyMapper: Mappers.TokenResponse
},
400: {
bodyMapper: Mappers.ErrorResponse
},
404: {
bodyMapper: Mappers.TokenResponse
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
serializer
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc