From a12b15e5d5ed47d2b4886f0ca7b6626edbacb5c0 Mon Sep 17 00:00:00 2001 From: stgum <14935595+stevengum@users.noreply.github.com> Date: Tue, 29 Oct 2019 10:18:41 -0700 Subject: [PATCH] move streamingAdapter into folder in botbuilder --- .gitignore | 1 - libraries/botbuilder/package.json | 1 + libraries/botbuilder/src/index.ts | 1 + .../src/streaming}/index.ts | 2 +- .../src/streaming}/streamingAdapter.ts | 20 ++++++++++++------- .../src/streaming}/streamingHttpClient.ts | 8 +++----- .../src/streaming}/tokenResolver.ts | 4 ++-- .../tests/streamingAdatper.test.js | 5 ++--- .../tests/tokenResolver.test.js | 0 libraries/botframework-streaming/package.json | 3 --- libraries/botframework-streaming/src/index.ts | 1 - 11 files changed, 23 insertions(+), 23 deletions(-) rename libraries/{botframework-streaming/src/adapters => botbuilder/src/streaming}/index.ts (83%) rename libraries/{botframework-streaming/src/adapters => botbuilder/src/streaming}/streamingAdapter.ts (95%) rename libraries/{botframework-streaming/src/adapters => botbuilder/src/streaming}/streamingHttpClient.ts (89%) rename libraries/{botframework-streaming/src/adapters => botbuilder/src/streaming}/tokenResolver.ts (96%) rename libraries/{botframework-streaming => botbuilder}/tests/streamingAdatper.test.js (96%) rename libraries/{botframework-streaming => botbuilder}/tests/tokenResolver.test.js (100%) diff --git a/.gitignore b/.gitignore index 8b376c079a..91c534385c 100644 --- a/.gitignore +++ b/.gitignore @@ -309,4 +309,3 @@ package-lock.json *.tsbuildinfo *.map -*.js diff --git a/libraries/botbuilder/package.json b/libraries/botbuilder/package.json index 6262b2d440..95a195e650 100644 --- a/libraries/botbuilder/package.json +++ b/libraries/botbuilder/package.json @@ -23,6 +23,7 @@ "@types/node": "^10.12.18", "botbuilder-core": "4.1.6", "botframework-connector": "4.1.6", + "botframework-streaming": "4.1.6", "filenamify": "^4.1.0", "fs-extra": "^7.0.1" }, diff --git a/libraries/botbuilder/src/index.ts b/libraries/botbuilder/src/index.ts index a8c9204aea..c132051b6d 100644 --- a/libraries/botbuilder/src/index.ts +++ b/libraries/botbuilder/src/index.ts @@ -9,6 +9,7 @@ export * from './botFrameworkAdapter'; export * from './fileTranscriptStore'; export * from './inspectionMiddleware'; +export { StreamingAdapter, StreamingHttpClient, TokenResolver } from './streaming'; export * from './teamsActivityHandler'; export * from './teamsActivityHelpers'; export * from './teamsInfo'; diff --git a/libraries/botframework-streaming/src/adapters/index.ts b/libraries/botbuilder/src/streaming/index.ts similarity index 83% rename from libraries/botframework-streaming/src/adapters/index.ts rename to libraries/botbuilder/src/streaming/index.ts index a1913a5c47..eb0324586c 100644 --- a/libraries/botframework-streaming/src/adapters/index.ts +++ b/libraries/botbuilder/src/streaming/index.ts @@ -1,5 +1,5 @@ /** - * @module botframework-streaming + * @module botbuilder */ /** * Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/libraries/botframework-streaming/src/adapters/streamingAdapter.ts b/libraries/botbuilder/src/streaming/streamingAdapter.ts similarity index 95% rename from libraries/botframework-streaming/src/adapters/streamingAdapter.ts rename to libraries/botbuilder/src/streaming/streamingAdapter.ts index cd8ae5597e..cbe683e676 100644 --- a/libraries/botframework-streaming/src/adapters/streamingAdapter.ts +++ b/libraries/botbuilder/src/streaming/streamingAdapter.ts @@ -1,5 +1,5 @@ /** - * @module botframework-streaming + * @module botbuilder */ /** * Copyright (c) Microsoft Corporation. All rights reserved. @@ -14,21 +14,27 @@ import { StatusCodes, WebRequest, WebResponse -} from 'botbuilder'; +} from '../botFrameworkAdapter'; import { Activity, ActivityTypes, BotCallbackHandlerKey, IUserTokenProvider, ResourceResponse, TurnContext } from 'botbuilder-core'; -import { AuthenticationConstants, ChannelValidation, ConnectorClient, GovernmentConstants, GovernmentChannelValidation, JwtTokenValidation, MicrosoftAppCredentials, SimpleCredentialProvider } from 'botbuilder/node_modules/botframework-connector'; +import { + AuthenticationConstants, + ChannelValidation, + ConnectorClient, + GovernmentConstants, + GovernmentChannelValidation, + JwtTokenValidation, + MicrosoftAppCredentials, + SimpleCredentialProvider +} from 'botframework-connector'; import { IncomingMessage } from 'http'; import * as os from 'os'; import { StreamingHttpClient } from './streamingHttpClient'; import { TokenResolver } from './tokenResolver'; -import { IReceiveRequest, ISocket, IStreamingTransportServer } from '../interfaces'; -import { NamedPipeServer } from '../namedPipe'; -import { StreamingResponse } from '../streamingResponse'; -import { NodeWebSocketFactory, NodeWebSocketFactoryBase, WebSocketServer } from '../webSocket'; +import { IReceiveRequest, ISocket, IStreamingTransportServer, NamedPipeServer, NodeWebSocketFactory, NodeWebSocketFactoryBase, StreamingResponse, WebSocketServer } from 'botframework-streaming'; // Retrieve additional information, i.e., host operating system, host OS release, architecture, Node.js version const ARCHITECTURE: any = os.arch(); diff --git a/libraries/botframework-streaming/src/adapters/streamingHttpClient.ts b/libraries/botbuilder/src/streaming/streamingHttpClient.ts similarity index 89% rename from libraries/botframework-streaming/src/adapters/streamingHttpClient.ts rename to libraries/botbuilder/src/streaming/streamingHttpClient.ts index 1f7847fd02..e289a7bfc3 100644 --- a/libraries/botframework-streaming/src/adapters/streamingHttpClient.ts +++ b/libraries/botbuilder/src/streaming/streamingHttpClient.ts @@ -1,15 +1,13 @@ /** - * @module botframework-streaming + * @module botbuilder */ /** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ -import { WebResource, HttpOperationResponse, HttpClient } from '@azure/ms-rest-js'; - -import { IStreamingTransportServer } from '../interfaces'; -import { StreamingRequest } from '../streamingRequest'; +import { WebResource, HttpOperationResponse, HttpClient } from 'botframework-connector/node_modules/@azure/ms-rest-js'; +import { IStreamingTransportServer, StreamingRequest } from 'botframework-streaming'; export class StreamingHttpClient implements HttpClient { private readonly server: IStreamingTransportServer; diff --git a/libraries/botframework-streaming/src/adapters/tokenResolver.ts b/libraries/botbuilder/src/streaming/tokenResolver.ts similarity index 96% rename from libraries/botframework-streaming/src/adapters/tokenResolver.ts rename to libraries/botbuilder/src/streaming/tokenResolver.ts index 4f5546706f..9db3fce193 100644 --- a/libraries/botframework-streaming/src/adapters/tokenResolver.ts +++ b/libraries/botbuilder/src/streaming/tokenResolver.ts @@ -1,12 +1,12 @@ /** - * @module botframework-streaming + * @module botbuilder */ /** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ -import { BotFrameworkAdapter } from 'botbuilder'; +import { BotFrameworkAdapter } from '../botFrameworkAdapter'; import { Activity, ActivityTypes, diff --git a/libraries/botframework-streaming/tests/streamingAdatper.test.js b/libraries/botbuilder/tests/streamingAdatper.test.js similarity index 96% rename from libraries/botframework-streaming/tests/streamingAdatper.test.js rename to libraries/botbuilder/tests/streamingAdatper.test.js index 1386e475b9..6c6c4c0b5a 100644 --- a/libraries/botframework-streaming/tests/streamingAdatper.test.js +++ b/libraries/botbuilder/tests/streamingAdatper.test.js @@ -1,8 +1,7 @@ -const { StreamingAdapter } = require('../'); -const { StatusCodes } = require('botbuilder'); +const { StatusCodes, StreamingAdapter } = require('../'); const { ActivityHandler } = require('botbuilder-core'); const chai = require('chai'); -var expect = chai.expect; +const expect = chai.expect; class FauxSock { constructor(contentString) { diff --git a/libraries/botframework-streaming/tests/tokenResolver.test.js b/libraries/botbuilder/tests/tokenResolver.test.js similarity index 100% rename from libraries/botframework-streaming/tests/tokenResolver.test.js rename to libraries/botbuilder/tests/tokenResolver.test.js diff --git a/libraries/botframework-streaming/package.json b/libraries/botframework-streaming/package.json index d7f712e5c9..103828d6b7 100644 --- a/libraries/botframework-streaming/package.json +++ b/libraries/botframework-streaming/package.json @@ -22,9 +22,6 @@ "main": "lib/index.js", "typings": "lib/index.d.js", "dependencies": { - "@azure/ms-rest-js": "1.2.6", - "botbuilder": "4.1.6", - "botbuilder-core": "4.1.6", "uuid": "^3.3.2", "watershed": "^0.4.0", "ws": "^7.1.2" diff --git a/libraries/botframework-streaming/src/index.ts b/libraries/botframework-streaming/src/index.ts index e6253ae2fe..b73bd95dfd 100644 --- a/libraries/botframework-streaming/src/index.ts +++ b/libraries/botframework-streaming/src/index.ts @@ -6,7 +6,6 @@ * Licensed under the MIT License. */ -export { StreamingAdapter, StreamingHttpClient, TokenResolver } from './adapters'; export { ContentStream } from './contentStream'; export { HttpContent } from './httpContentStream'; export {