botbuilder
Advanced tools
Comparing version 4.0.0-m4.1 to 4.0.0-m4.2
@@ -162,8 +162,8 @@ /** | ||
* that can be used to fetch the next page of results from the server. | ||
* @param serviceUrl The URL of the channel server to query. This can be retrieved from `context.activity.serviceUrl`. | ||
* @param contextOrServiceUrl The URL of the channel server to query or a TurnContext. This can be retrieved from `context.activity.serviceUrl`. | ||
* @param continuationToken (Optional) token used to fetch the next page of results from the channel server. This should be left as `undefined` to retrieve the first page of results. | ||
*/ | ||
getConversations(serviceUrl: string, continuationToken?: string): Promise<ConversationsResult>; | ||
getConversations(contextOrServiceUrl: TurnContext | string, continuationToken?: string): Promise<ConversationsResult>; | ||
/** | ||
* Attempts to retrieve the token for a user that's in a logging flow. | ||
* Attempts to retrieve the token for a user that's in a signin flow. | ||
* @param context Context for the current turn of conversation with the user. | ||
@@ -178,6 +178,17 @@ * @param connectionName Name of the auth connection to use. | ||
* @param connectionName Name of the auth connection to use. | ||
* @param magicCode (Optional) Optional user entered code to validate. | ||
*/ | ||
signOutUser(context: TurnContext, connectionName: string): Promise<void>; | ||
/** | ||
* Gets a signin link from the token server that can be sent as part of a SigninCard. | ||
* @param context Context for the current turn of conversation with the user. | ||
* @param connectionName Name of the auth connection to use. | ||
*/ | ||
getSignInLink(context: TurnContext, connectionName: string): Promise<string>; | ||
/** | ||
* Tells the token service to emulate the sending of OAuthCards for a channel. | ||
* @param contextOrServiceUrl The URL of the channel server to query or a TurnContext. This can be retrieved from `context.activity.serviceUrl`. | ||
* @param emulate If `true` the token service will emulate the sending of OAuthCards. | ||
*/ | ||
emulateOAuthCards(contextOrServiceUrl: TurnContext | string, emulate: boolean): Promise<void>; | ||
/** | ||
* Processes an activity received by the bots web server. This includes any messages sent from a | ||
@@ -184,0 +195,0 @@ * user and is the method that drives what's often referred to as the bots "Reactive Messaging" |
@@ -230,11 +230,12 @@ "use strict"; | ||
* that can be used to fetch the next page of results from the server. | ||
* @param serviceUrl The URL of the channel server to query. This can be retrieved from `context.activity.serviceUrl`. | ||
* @param contextOrServiceUrl The URL of the channel server to query or a TurnContext. This can be retrieved from `context.activity.serviceUrl`. | ||
* @param continuationToken (Optional) token used to fetch the next page of results from the channel server. This should be left as `undefined` to retrieve the first page of results. | ||
*/ | ||
getConversations(serviceUrl, continuationToken) { | ||
const client = this.createConnectorClient(serviceUrl); | ||
getConversations(contextOrServiceUrl, continuationToken) { | ||
const url = typeof contextOrServiceUrl === 'object' ? contextOrServiceUrl.activity.serviceUrl : contextOrServiceUrl; | ||
const client = this.createConnectorClient(url); | ||
return client.conversations.getConversations(continuationToken ? { continuationToken: continuationToken } : undefined); | ||
} | ||
/** | ||
* Attempts to retrieve the token for a user that's in a logging flow. | ||
* Attempts to retrieve the token for a user that's in a signin flow. | ||
* @param context Context for the current turn of conversation with the user. | ||
@@ -265,3 +266,2 @@ * @param connectionName Name of the auth connection to use. | ||
* @param connectionName Name of the auth connection to use. | ||
* @param magicCode (Optional) Optional user entered code to validate. | ||
*/ | ||
@@ -286,2 +286,31 @@ signOutUser(context, connectionName) { | ||
/** | ||
* Gets a signin link from the token server that can be sent as part of a SigninCard. | ||
* @param context Context for the current turn of conversation with the user. | ||
* @param connectionName Name of the auth connection to use. | ||
*/ | ||
getSignInLink(context, connectionName) { | ||
try { | ||
if (!context.activity.serviceUrl) { | ||
throw new Error(`BotFrameworkAdapter.getSignInLink(): missing serviceUrl`); | ||
} | ||
const conversation = botbuilder_core_1.TurnContext.getConversationReference(context.activity); | ||
const serviceUrl = context.activity.serviceUrl; | ||
const client = this.createOAuthApiClient(serviceUrl); | ||
return client.getSignInLink(conversation, connectionName); | ||
} | ||
catch (err) { | ||
return Promise.reject(err); | ||
} | ||
} | ||
/** | ||
* Tells the token service to emulate the sending of OAuthCards for a channel. | ||
* @param contextOrServiceUrl The URL of the channel server to query or a TurnContext. This can be retrieved from `context.activity.serviceUrl`. | ||
* @param emulate If `true` the token service will emulate the sending of OAuthCards. | ||
*/ | ||
emulateOAuthCards(contextOrServiceUrl, emulate) { | ||
const url = typeof contextOrServiceUrl === 'object' ? contextOrServiceUrl.activity.serviceUrl : contextOrServiceUrl; | ||
const client = this.createOAuthApiClient(url); | ||
return client.emulateOAuthCards(emulate); | ||
} | ||
/** | ||
* Processes an activity received by the bots web server. This includes any messages sent from a | ||
@@ -288,0 +317,0 @@ * user and is the method that drives what's often referred to as the bots "Reactive Messaging" |
@@ -5,3 +5,3 @@ { | ||
"description": "Services for Microsoft BotBuilder.", | ||
"version": "4.0.0-m4.1", | ||
"version": "4.0.0-m4.2", | ||
"license": "MIT", | ||
@@ -27,5 +27,5 @@ "keywords": [ | ||
"async-file": "^2.0.2", | ||
"botbuilder-core": "4.0.0-m4.1", | ||
"botbuilder-core-extensions": "4.0.0-m4.1", | ||
"botframework-connector": "4.0.0-m4.1", | ||
"botbuilder-core": "4.0.0-m4.2", | ||
"botbuilder-core-extensions": "4.0.0-m4.2", | ||
"botframework-connector": "4.0.0-m4.2", | ||
"filenamify": "^2.0.0", | ||
@@ -32,0 +32,0 @@ "readline": "^1.3.0" |
@@ -259,7 +259,8 @@ /** | ||
* that can be used to fetch the next page of results from the server. | ||
* @param serviceUrl The URL of the channel server to query. This can be retrieved from `context.activity.serviceUrl`. | ||
* @param contextOrServiceUrl The URL of the channel server to query or a TurnContext. This can be retrieved from `context.activity.serviceUrl`. | ||
* @param continuationToken (Optional) token used to fetch the next page of results from the channel server. This should be left as `undefined` to retrieve the first page of results. | ||
*/ | ||
public getConversations(serviceUrl: string, continuationToken?: string): Promise<ConversationsResult> { | ||
const client = this.createConnectorClient(serviceUrl); | ||
public getConversations(contextOrServiceUrl: TurnContext|string, continuationToken?: string): Promise<ConversationsResult> { | ||
const url = typeof contextOrServiceUrl === 'object' ? contextOrServiceUrl.activity.serviceUrl : contextOrServiceUrl; | ||
const client = this.createConnectorClient(url); | ||
return client.conversations.getConversations(continuationToken ? { continuationToken: continuationToken } : undefined); | ||
@@ -269,3 +270,3 @@ } | ||
/** | ||
* Attempts to retrieve the token for a user that's in a logging flow. | ||
* Attempts to retrieve the token for a user that's in a signin flow. | ||
* @param context Context for the current turn of conversation with the user. | ||
@@ -292,3 +293,2 @@ * @param connectionName Name of the auth connection to use. | ||
* @param connectionName Name of the auth connection to use. | ||
* @param magicCode (Optional) Optional user entered code to validate. | ||
*/ | ||
@@ -307,2 +307,31 @@ public signOutUser(context: TurnContext, connectionName: string): Promise<void> { | ||
} | ||
/** | ||
* Gets a signin link from the token server that can be sent as part of a SigninCard. | ||
* @param context Context for the current turn of conversation with the user. | ||
* @param connectionName Name of the auth connection to use. | ||
*/ | ||
public getSignInLink(context: TurnContext, connectionName: string): Promise<string> { | ||
try { | ||
if (!context.activity.serviceUrl) { throw new Error(`BotFrameworkAdapter.getSignInLink(): missing serviceUrl`) } | ||
const conversation = TurnContext.getConversationReference(context.activity); | ||
const serviceUrl = context.activity.serviceUrl; | ||
const client = this.createOAuthApiClient(serviceUrl); | ||
return client.getSignInLink(conversation as ConversationReference, connectionName); | ||
} catch (err) { | ||
return Promise.reject(err); | ||
} | ||
} | ||
/** | ||
* Tells the token service to emulate the sending of OAuthCards for a channel. | ||
* @param contextOrServiceUrl The URL of the channel server to query or a TurnContext. This can be retrieved from `context.activity.serviceUrl`. | ||
* @param emulate If `true` the token service will emulate the sending of OAuthCards. | ||
*/ | ||
public emulateOAuthCards(contextOrServiceUrl: TurnContext|string, emulate: boolean): Promise<void> { | ||
const url = typeof contextOrServiceUrl === 'object' ? contextOrServiceUrl.activity.serviceUrl : contextOrServiceUrl; | ||
const client = this.createOAuthApiClient(url); | ||
return client.emulateOAuthCards(emulate); | ||
} | ||
@@ -309,0 +338,0 @@ /** |
Sorry, the diff of this file is not supported yet
168119
3090
+ Addedbotbuilder-core@4.0.0-m4.2(transitive)
+ Addedbotbuilder-core-extensions@4.0.0-m4.2(transitive)
+ Addedbotframework-connector@4.0.0-m4.2(transitive)
+ Addedbotframework-schema@4.0.0-m4.2(transitive)
- Removedbotbuilder-core@4.0.0-m4.1(transitive)
- Removedbotbuilder-core-extensions@4.0.0-m4.1(transitive)
- Removedbotframework-connector@4.0.0-m4.1(transitive)
- Removedbotframework-schema@4.0.0-m4.1(transitive)
Updatedbotbuilder-core@4.0.0-m4.2