Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streaming: refactor streaming into adapter. General improvements and quality. #1306

Merged
merged 39 commits into from
Oct 17, 2019
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
2274a3f
Streaming: Rename botframework-streaming-extensions -> botframework-s…
carlosscastro Oct 12, 2019
17cce26
Streaming: Move BotFrameworkStreamingAdapter to botbuilder module
carlosscastro Oct 13, 2019
59a1da3
Streaming: integrate streaming into botFrameworkAdapter though useWeb…
carlosscastro Oct 14, 2019
fe6d846
Streaming: temporary move for lower case folders
carlosscastro Oct 14, 2019
f71af75
Streaming: directory casing rename part 2
carlosscastro Oct 14, 2019
a658a8e
Streaming: directory renaming last part
carlosscastro Oct 14, 2019
c66a0ce
Streaming: rename all files and references to proper casing
carlosscastro Oct 14, 2019
797ce57
Streaming: reference streaming without the 'lib' postfix
carlosscastro Oct 14, 2019
e350bdb
Streaming: Javascript style comments and documentation
carlosscastro Oct 15, 2019
84eae25
Streaming: Remove unnecessary logger, use http response and body to r…
carlosscastro Oct 15, 2019
bd5b6cf
Streaming: fix quotes
carlosscastro Oct 15, 2019
967bc45
Streaming: Improve comments and error messages
carlosscastro Oct 15, 2019
65adbc2
Streaming: refactor StreamingHttpClient to a separate file
carlosscastro Oct 15, 2019
6ba6c18
Streaming: update tests to richer error messages
carlosscastro Oct 15, 2019
992923e
Merge master-> ccastro/streaming-refactor
carlosscastro Oct 15, 2019
face819
Streaming: add more validations and test fixes
carlosscastro Oct 15, 2019
ecab28b
Merge branch 'master' into ccastro/streaming-refactor
carlosscastro Oct 15, 2019
7294321
Streaming: remove obsolete package from lerna.json and fix documentat…
carlosscastro Oct 15, 2019
486d3ce
Merge master -> ccastro/adapter-refactor
carlosscastro Oct 15, 2019
8de0e19
Hide WebSocket connection behind ProcessActivity
DDEfromOR Oct 16, 2019
b004775
Change ProcessActivity to accept Union Types and introduce Type Guard…
DDEfromOR Oct 16, 2019
74343b5
Better name. Maybe.
DDEfromOR Oct 16, 2019
dcc1857
Streaming: remove isFromStreamingConnection out of TurnContext since …
carlosscastro Oct 16, 2019
f20ab32
Merge branch 'ccastro/streaming-refactor' of https://github.com/micro…
carlosscastro Oct 16, 2019
6fef457
Import directly from library instead of third hand
DDEfromOR Oct 16, 2019
4867dfe
fix WebSocketServer.onConnectionDisconnected, fix in StreamingAdapter…
stevengum Oct 17, 2019
7ae544c
move isFromStreamingConnection() tests to BFStreamingAdapter tests
stevengum Oct 17, 2019
f940dbb
fix bug in processRequest()
stevengum Oct 17, 2019
7526100
Remove library specific implementation of websocket handling
DDEfromOR Oct 17, 2019
7a351fd
Merge branch 'ccastro/streaming-refactor' of https://github.com/micro…
DDEfromOR Oct 17, 2019
2989994
revert changing protecteds to privates
DDEfromOR Oct 17, 2019
52c625d
Further cleanup websocket connection
DDEfromOR Oct 17, 2019
2f7fda9
Update tests
DDEfromOR Oct 17, 2019
5ecceaa
Remove no longer used import
DDEfromOR Oct 17, 2019
126c04e
Merge branch 'master' into ccastro/streaming-refactor
DDEfromOR Oct 17, 2019
7720537
Use const GET instead of string GET
DDEfromOR Oct 17, 2019
0401bbc
Merge branch 'ccastro/streaming-refactor' of https://github.com/micro…
DDEfromOR Oct 17, 2019
8c8f93e
fix removed internal export
stevengum Oct 17, 2019
41d2103
Final fixes to websocket connection for DLS compatibility.
DDEfromOR Oct 17, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"libraries/botframework-schema",
"libraries/functional-tests",
"libraries/testbot",
"libraries/botframework-streaming-extensions",
"libraries/botbuilder-streaming-extensions",
"libraries/botframework-streaming",
"transcripts"
],
"version": "independent",
Expand Down
2 changes: 1 addition & 1 deletion libraries/botbuilder-core/src/botAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { TurnContext } from './turnContext';
* of channels.
*/
export abstract class BotAdapter {
private middleware: MiddlewareSet = new MiddlewareSet();
protected middleware: MiddlewareSet = new MiddlewareSet();
private turnError: (context: TurnContext, error: Error) => Promise<void>;

/**
Expand Down
11 changes: 0 additions & 11 deletions libraries/botbuilder-core/src/turnContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -538,15 +538,4 @@ export class TurnContext {

return emitNext(0);
}

/**
* Determine if the Activity was sent via an Http/Https connection or Streaming
* This can be determined by looking at the ServiceUrl property:
* (1) All channels that send messages via http/https are not streaming
* (2) Channels that send messages via streaming have a ServiceUrl that does not begin with http/https.
* @param activity
*/
public static isFromStreamingConnection(activity: Activity): boolean {
return activity && activity.serviceUrl && !activity.serviceUrl.toLowerCase().startsWith('http');
}
}
8 changes: 7 additions & 1 deletion libraries/botbuilder-dialogs/src/prompts/oauthPrompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export class OAuthPrompt extends Dialog {
const cards: Attachment[] = msg.attachments.filter((a: Attachment) => a.contentType === CardFactory.contentTypes.oauthCard);
if (cards.length === 0) {
let link: string = undefined;
if (TurnContext.isFromStreamingConnection(context.activity)) {
if (OAuthPrompt.isFromStreamingConnection(context.activity)) {
link = await (context.adapter as any).getSignInLink(context, this.settings.connectionName);
}
// Append oauth card
Expand Down Expand Up @@ -312,12 +312,18 @@ export class OAuthPrompt extends Dialog {
return token !== undefined ? { succeeded: true, value: token } : { succeeded: false };
}

private static isFromStreamingConnection(activity: Activity): boolean {
return activity && activity.serviceUrl && !activity.serviceUrl.toLowerCase().startsWith('http');
}

private isTokenResponseEvent(context: TurnContext): boolean {
const activity: Activity = context.activity;

return activity.type === ActivityTypes.Event && activity.name === 'tokens/response';
}



private isTeamsVerificationInvoke(context: TurnContext): boolean {
const activity: Activity = context.activity;

Expand Down
25 changes: 0 additions & 25 deletions libraries/botbuilder-streaming-extensions/README.md

This file was deleted.

44 changes: 0 additions & 44 deletions libraries/botbuilder-streaming-extensions/package.json

This file was deleted.

Loading