Skip to content

Commit

Permalink
merge master into 4.future (#1964)
Browse files Browse the repository at this point in the history
* Fix validation for post.

* Add channel add and delete events.  Add more comments to nock-helper

* Add member add-remove from groupchat, more cleanup for nock-helper

* More updates

* [Streaming] Add working ws websocket implementation for Node environment (#1334)

* add working ws websocket impl

* remove unused constants

* More scenarios

* Update typeDoc comments for ActivityHandler and ActivityHandlerBase

* More updates

* minor refactoring fileupload bot and added file handler for integration bot

* removed console.log

* Update README.md

* updated readme/manifest

* Update manifest.json

* Updating all libraries to output es6

* copy edits

* QnaMaker: Rename Prompt -> QnAMakerPrompt

* added task module invocation, updated readme

* added promptCultureModels - parity w/ dotnet

* fixed tests

* added tests for custom defaultChoices

* removed unnecessary overrides

* update root package.json, streaming package.json

* [Streaming] Auth and browser compatibility fixes, linting, refactoring (#1338)

* patch auth in streaming to send token to channel

* apply PR feedback for BotFrameworkAdapter

* move ws server construction to wsNodeWebSocket constructor for browser compat

* cleanup and cache serviceUrl in authenticateConnection

* drop teams specific send

* Finish updating typeDoc comments for dialogContext.ts

* expand ChannelAccount to TeamsChannelAccount

* [Streaming] Pull out streaming bits from botbuilder and move to botframework-streaming (#1348)

* cleanup bf-streaming package.json

* move streaming code and tests to botframework-streaming

* remove @azure/ms-rest-js dependency from botbuilder

* Update cardFactory.ts

Update hero card helper to add optional tap parameter

* cr fk

* updated searchbased scenario to match c# (with tap/select handler)

* final update

updated integrationbot with searchbasedmessaging extension handlers and updated manifest for file upload bot (works only in personal chat)

* Update README.md

* set bot id to empty guid per andrew's request

* helper to send a trace activity (#1355)

* added local teamsCreateConversation helper (#1357)

* [QnAMaker] Active learning low score variation multiplier value (#1359)

Active learning low score variation multiplier value
- PreviousLowScoreVariationMultiplier to 0.7
- MaxLowScoreVariationMultiplier to 1.0

* Fixed passing of CosmosClientOptions

* add random to transcript generated ids and set sent activity.id (#1344)

* add random to transcript generated ids and set sent activity.id

* cleanup and add test

* always set activity.id to resourceResponse.id in logger when present

* added test for CosmosClientOptions

* updated test recordings

* remove .js and .ts from .gitignore, change *.map to *.js.map (#1365)

* Fix integrationBot to match C# (#1379)

* remove typescript devDependency and engine from bf-streaming (#1392)

* [Teams] Call defaultNextEvent after .invoke activity is processed (#1390)

* call defaultNextEvent after .invoke activity is processed

* call the method returned from defaultNextEvent, and add unit test

* Add LG/Expression library (#1381)

* init lg library

* refine code

* fix deploy error

* fix test coverage

* remove xPath and xml functions (#1385)

* [expression] add capability of handling null in string related built-in functions (#1395)

* handling null in string related builtin functions

* remove redundent character

* remove tslint

* fix errors and warnings with eslint

* fix ChoicePrompt none style when set via options (#1373)

* Add Botbuilder-lg to version update command

* Update package.json

* Update package.json

* Update package.json

* Parity ChoicePrompt fix with dotnet (#1400)

* parity ChoicePrompt fix with dotnet

* added confirmPrompt test for null locale

* Stevenic/4.6 dialog parity (#1384)

* Added new DialogStateManager

* Added defaultValue to getValue

* Added state manager tests

* Latest changes

* Ported DialogStateManager from C3

* More robust path parsing...

* Added event emitting support

Also implemented logic to cascade cancel to parent dialogs

* Updated dialog set to support auto id's and dependencies

also replaced "null" with "undefined" htroughout code

* Updated unit tests

* Added unit test for scopes and path resolvers

Fixed issues as detected.

* Added a bunch of dialog state tests

* Added additional unit tests

- Increased code coverage for DialogStateManager
- Fixed issue detected from unit tests.

* Tweaked settings test

* Made DialogContainer.dialogs public

* Fixed code review comment.

* update package.json (#1402)

* [Functional-test] Add chrome browser functional tests (#1389)

* Add browser-functional-tests
- Add browser echo-bot sample
- Setup Nightwatch to run with Chrome
- Add script to run the tests

* Add copyright headers

* Add missing async

* add Activityfactory (#1401)

* add activityfactory

* retrigger CI

* fix comments

* remove unused code

* modify text

* add some comments

* fix param type

* fix template additional newline bug (#1419)

* Add BotFramework-schema license (#1407)

* Fixed several typos (#1422)

* Fixed the wrong function name (#1420)

* [R7, Cherry-pick] Cherry-pick TypeScript 3.5.3 pin from 4.6 branch (#1442)

* [4.6.x] Pin TypeScript devDependency in each library. (Fixes #1436) (#1437)

* move pinned typescript@3.5.2 devDependency into each package

* pin transcripts/ botbuilder dependencies, fix import in Skype Middleware

* bump to typescript@3.5.3

* [4.6.x] Fix set-dependency-versions script (#1438)

* change set-dependency-versions script to use ~ not ^, update changed libs

* use pinned versions for intra-dependencies per @cleemullins feedback

* add typescript@3.5.3 as devDependency to bb-lg & bf-expressions packages

* Fixed a small issue in var name (#1421)

* [R7] Authentication: Use ADAL to acquire tokens + support certificate auth (#1337)

* Authentication: Use ADAL to acquire tokens + support certificate auth

* Auth: missing piece for cert credentials

* Certificate auth: default to password if no settings are provided

* Cert auth: PR details, remove unused internal interface and shorten if statement

* Cert auth: remove properties after merge

* address PR feedback, add tests for AppCredentials

* refactor in auth stack, pin adal-node@0.2.1, add tests

* BotFrameworkAdapter updates:
* remove useCertificateAuthentication flag in BFAdapter
* cleanup credentialsProvider instantiation
* add & refactor BFAdapter tests
* skip already-silently-failing getTokenStatus() test

* refactor: remove direct cldr-data dep (#1444)

* refactor: remove direct cldr-data dep

* fix: missing path

* LG/Expression parity with C# (till Nov 25) (#1453)

* init

* finisn expression sync

* init lg

* forward

* fix test errors

* forward

* rename test file

* fix comments

* refine

* allows Inspection to attach anywhere within a Teams Team (#1434)

* allows Inspection to attach anywhere within a Teams Team

* additional unit test for inspection of a Teams Team

* fix typo re-introduced with rebase

* [Skills] Add BFHttpClient, ChannelServiceHandler & necessary Auth pieces for Skills (#1448)

* initial commit on BFHttpClient, add @azure/ms-rest-js to botbuilder

* add ChannelServiceHandler

* clean up comments & property in ChannelServiceHandler

* update NotImplemented Errors in ChannelServiceHandler

* add AuthenticationConfiguration

* fix truthy check in JwtTokenValidation

* fix bugs in JwtTokenValidation.getAppIdFromClaims

* slgiht refactor, add initial tests for ChannelServiceHandler

* fix streaming test, cleanup in ChannelServiceHandler.test.js

* Update README.MD (#1463)

* [Skills] Add SkillValidation class (#1461)

* add SkillValidation class

* add SkillValidation.isSkillToken() tests

* add more tests for SkillValidation

* cleanup bf-connector, duplicate necessary auth code in bb-dialogs

* add oAuthScope param to MicrosoftAppCredentials ctor & test

* SkillValidation changes & tests
  * export validateIdentity for testing
  * validateIdentity is not documented as to be "internal"
  * change signature on isSkillClaim to take Claim[]
  * isSkillClaim returns false if audience value is GovernmentConstants.ToBotFromChannelTokenIssuer
  * JwtTokenValidation.getAppIdFromClaims() now takes Claim[]

* [Streaming] Merge streaming branch into master (#1464)

* streaming cleanup, remove *.ts from .gitignore

* move streamingAdapter into folder in botbuilder (#1374)

* cleanup, refactor & merge StreamingAdapter into BotFrameworkAdapter (#1376)

* Don't await for the duration of websocket sessions. (#1412)

* Revert "Don't await for the duration of websocket sessions. (#1412)" (#1417)

This reverts commit 3aea9c0.

* [Streaming, Preview] Update 4.6-preview-streaming branch with 4.6.1 release (#1424)

* [QnAMaker] Active learning low score variation multiplier value (#1359) (#1361)

Active learning low score variation multiplier value
- PreviousLowScoreVariationMultiplier to 0.7
- MaxLowScoreVariationMultiplier to 1.0

* [4.6] cherry-pick #1363 CosmosClientOptions fix (#1367)

* cherry-pick #1363 CosmosClientOptions fix

* Fixed passing of CosmosClientOptions

* added test for CosmosClientOptions

* remove .js and .ts from .gitignore, change *.map to *.js.map (#1364)

* [4.6.1] Manually Cherry-pick #1392 & #1390 to 4.6 branch (#1397)

* manually cherry-pick #1390 to 4.6 branch

* manually cherry-pick #1392 to 4.6

* [Fix #1404, Transcripts] Fix for TranscriptLoggerMiddleware not checking responses type (#1409)

* add test to reproduce issue #1404

* add test or Transcripts where SendActivitiesHandler is not properly implemented

* add bug fix for #1404, more tests

* apply PR feedback and refactor code

* Choice prompt null locale fix [Cherry-pick against 4.6] (#1411)

* parity ChoicePrompt fix with dotnet

(cherry picked from commit 3985a06)

* added confirmPrompt test for null locale

(cherry picked from commit ea2652a)

* typo fix

* [Streaming, Preview] Remove `watershed`, use `ws` in NodeWebSocket (#1425)

* remove watershed socket impl, work on tests

* clean-up bf-streaming package.json, add eslint config

* cleanup BFAdapter streaming tests

* clean up casing on relative imports

* apply PR feedback to NodeWebSocket class

* [Streaming, Preview] rewrite useWebSocket for low-level usage, remove from processActivity (#1433)

* rewrite useWebSocket for low-level usage, remove from processActivity

* [4.6.x] Fix set-dependency-versions script (#1438)

* change set-dependency-versions script to use ~ not ^, update changed libs

* use pinned versions for intra-dependencies per @cleemullins feedback

* [4.6.x] Pin TypeScript devDependency in each library. (Fixes #1436) (#1437)

* move pinned typescript@3.5.2 devDependency into each package
* pin transcripts/ botbuilder dependencies, fix import in Skype Middleware
* bump to typescript@3.5.3

* remove unnecessary enableWebSockets flag, cleanup useWebSocket()

* create Node Interfaces for PR feedback

* revert changes in TranscriptLoggerMiddleware, fix test

* address PR feedback

* [Browser-Functional-Tests] Add browser test build YAML file (#1469)

* Add build yaml file to run browser tests

* Add step by step guide to configure pipeline

* Update yaml file name to browser-tests-build-ci

* Update browser functional test readme local steps

* Johtaylo/skills protocol (#1472)

* init commit

* controller equivalent in typescript

* plumb through authConfig in bf-connector/auth (#1470)

* [Skills] add skill support in BotFrameworkAdapter (#1473)

* add skill support in BotFrameworkAdapter

* address PR feedback

* better exception handling and typing (#1474)

* [QnA Maker] Support for IsTest and RankerType in GetAnswerAsync call in QnAMaker (#1478)

* Add KeySuffix and CompatibilityMode to CosmosDbPartitionedStorage (#1468)

* add compatibility mode and backward compat

* remove semaphore and use promises, fix tests

* Update libraries/botbuilder-azure/src/cosmosDbPartitionedStorage.ts

Co-Authored-By: Michael Richardson <40401643+mdrichardson@users.noreply.github.com>

* Fix attemptCount (#1459)

* Create failing tests

* Fix OAuthPrompt test

* Increment attempt count correctly in all prompts

* Fix Cosmos test data to account for new attemptCount implementation

* refactor BFAdapter for Skills with Auth (#1481)

* Update README.md with the Browser Functional Tests (#1471)

* Remove dead links to unexisting AppInsights sample (#1487)

* Deprecate Payments (#1462)

* change isConnected() to a getter (#1488)

* [Skills] add SkillHandler & SkillConversationIdFactoryBase classes (#1482)

* add SkillHandler & SkillConversationIdFactoryBase classes

* add OAuthPrompt tests for current implementation

* fix bug in SkillHandler, add tests

* more tests

* cache connectorClient in SkillHandler.processActivity(), more tests

* add Skills support to OAuthPrompt, refactor skillHelpers, add tests

* add SkillHttpClient

* update botbuilder HttpClients, add tests

* add BotFrameworkSkill interface

* apply PR Feedback, turn SkillConversationReferenceKey into Symbol

* LuisRecognizer refactor and addition of V3 endpoint (#1479)

* LuisRecognizer refactor and addition of V3 endpoint

* Fixing PR feedback

* Adding missing file header

* Adding tests to V3 scenarios

* Bump version to 4.8

* build: add preview package support (#1490)

* build: add preview package support

* build: tweak logging

* build: get preview version from argv

* build: handle previewVersion not being set

* build: streaming is GA now

* Cherry-pick commits from 4.7 branch to master (#1502)

* add vendor/ to botbuilder-dialogs incl. files (#1493)

* fix casing on relative import references for NamedPipeTransport (#1494)

* fix casing in WebSocketServer (#1495)

* fix more casing issues (#1496)

* fix auth bug, streaming dependencies, add tests (#1498)

* add more js functions (#1505)

* Make IMemory interface follow the convention instead of returning tup… (#1526)

* Make IMemory interface follow the convention instead of returning tuple (#1525)

* retrigger ci

* Fix the value of typings (#1547)

* move @types/lru-cache from devdependency to dependency (#1576)

* remove "dom" from bf-streaming tsconfig and refactor code (#1575) (#1579)

* remove "dom" from bf-streaming tsconfig and refactor code

* remove isBrowser, look for global members instead

* [Cherry-pick] TrustServiceUrl from original conversationReference in SkillHandler (#1590)

* add declarationMap to tsconfig.json in libraries (#1613)

* Cleanup in botbuilder (#1508)

* move InvokeResponse, WebRequest, WebResponse interfaces into separate files

* move streaming constants into streaming/

* Declare return types in waterfallDialog.ts (#1578)

* Declare return types in waterfallDialog.ts

* Fix waterfall-cancel-telemetry-step-name bug

* Roll back bug fix

* Fix Browser Functional Test Build Pipeline (#1600)

* Update chrome driver

* Add caret to chrome driver dependency

* init (#1573)

Co-authored-by: johnataylor <johtaylo@microsoft.com>

* Fix browser bot functional tests (#1648)

* Put Chrome tests last

* Add continueOnError: true

* TWeak message-handling-tests.js

* Typo fix.

* Tweak message-handling-tests.js some more

* Restore chrome test order to first.

* Kyled/waterfall cancel telemetry (#1639)

* Create failing test for #1619

* Fix #1619

* Improve #1619 test

Co-authored-by: Steven Ickman <stevenic@microsoft.com>

* Fix Expression mishandles day formats and extends the ability of datetime formating (#1593)

* fix datetime converter

* add test cases

* fix issues

* add a new test

* fix formatDateTime test cases

* add convert for standard datetime format

* fix comments and add more tests

* add a test

* Parity of split function with C# in Expression (#1661)

* parity of split function

* retrigger

* retrigger

* retrigger

* fix a test case

* expand max/min functions (#1674)

* Update sample in Connector readme from v3 to v4 (#1657)

Fixes #1653

* Port  nested foreach\where\select in Expression from C# (#1688)

* port  nested foreach\where\select in Expression

* undo comments

* fix stackedMemory

* fix export and update unit test import (#1693)

* fix export and update unit test import

* further refine import in test code

* add EndOfConversation and Typing activities (#1706)

* Port refactor Structure LG and Analyzer (#1713)

* port refactor Structure LG and Analyzer

* fix lexer and parser

* fix bugs

* fix extractor

* remove comments

* parity test cases and fix bugs

* undo comments in ActivityFactoryTest

* retrigger

* retrigger

* ${} instead of @{} as bounding syntax. (#1717)

* port refactor Structure LG and Analyzer

* fix lexer and parser

* fix bugs

* fix extractor

* remove comments

* parity test cases and fix bugs

* init

* undo comments in ActivityFactoryTest

* retrigger

* retrigger

Co-authored-by: Shuai Wang <shuwan@microsoft.com>

* add deprecate comment to CosmosDbStorage (#1715)

* [Streaming] add generic socket closure handling (#1627) (#1664)

* add generic socket closure handling
* add isConnected to WebSocketServer
* expose new property via BotFrameworkAdapter
* add check to verify socket connection is open in sendActivities

* add optional isConnected to IStreamingTransportServer

* add server.isConnected check to StreamingHttpClient

* apply @christopheranderson PR feedback

Co-authored-by: Christopher Anderson <chrande@microsoft.com>

Co-authored-by: Christopher Anderson <chrande@microsoft.com>
Co-authored-by: johnataylor <johtaylo@microsoft.com>

* [Docs] Add Bot Functional Test Guide (#1587)

* Add bot functional test blog post
- Add media content of the blog post

* Add Bot deployment task from marketplace
- Update images

Co-authored-by: Billy Delgado <37461749+Bill7zz@users.noreply.github.com>

* rename botframework-expressions to adaptive-expressions (#1718)

* Update typeDoc comments in dialog.ts (#1356)

* WIP

* Update typeDoc comments

Co-authored-by: Steven Ickman <stevenic@microsoft.com>

* Update activityHandler.ts (#1620)

Per changes to best practices. re: Samples [PR 1964](microsoft/BotBuilder-Samples#1964).

Co-authored-by: johnataylor <johtaylo@microsoft.com>
Co-authored-by: Chris Mullins <cleemullins@users.noreply.github.com>

* ReferenceError: status is not defined (#1456)

Looks like it's copied from the `processActivity` method and the `status` mistakenly left  there

Co-authored-by: Steven Ickman <stevenic@microsoft.com>

* Create new TurnContext using function so that derived classes can override the default TurnContext (#1513)

Like happens in the regular adapter, use helper function to create new instance of the TurnContext so  so that derived classes can override the default TurnContext

Co-authored-by: Chris Mullins <cleemullins@users.noreply.github.com>
Co-authored-by: Steven Ickman <stevenic@microsoft.com>

* parity indicesAndValues builtIn function (#1731)

* parity extend foreach and where work with object (#1733)

* support constant [] and {} expression (#1734)

* add isTemplate function (#1735)

* treat everything after first '=' as value for the property (#1737)

* Hash conversationId for App Insights sessionID to keep within max length (#1642)

Co-authored-by: Chris Mullins <cleemullins@users.noreply.github.com>
Co-authored-by: Steven Ickman <stevenic@microsoft.com>

* Port: Refactor LG Api (#1740)

* init

* parity

* fix some bugs

* fix test cases

* fix test cases

* fix test cases

* fix comments and conflicts

* remove redundent import

* fix comments

* Enhance the functionality of the + operator (#1749)

* init

* modify + operator

* remove test.ts

* init

* retrigger

* Port: Optimize LG performace (#1752)

* init

* fix test cases

* add doc for function

* fix comments

* fix

* add comments (#1751)

* return http state (#1755)

* [Expression]add string interpolation feature (#1759)

* [Port] Add tests around memory access path (#1760)

* Updated ShowTypingMiddleware to re throw errors (#1761)

* Updated ShowTypingMiddleware to re throw errors

* use finally

Co-authored-by: johnataylor <johtaylo@microsoft.com>

* Add Italian Support for Confirm/Choice Prompts (#1500)

* - added Italian support
- Added PromptCultureModels tests

* remove carat from recognizers

Co-authored-by: johnataylor <johtaylo@microsoft.com>

* [Port] Forced re-execution expression within template (#1762)

* Forced re-execution expression within template

* retrigger ci

* create browser (es5) output in botframework-streaming (#1764)

* create browser (es5) output in botframework-streaming

* include new browser folder in packed files

* apply PR feedback around exports

* Plumb custom functions throughout. (#1784)

* Added Channels enum in botbuilder-schema for ChannelIds constants (#1757)

* Added Channels enum in botbuilder-schema for ChannelIds constants

* removed commented out code

* add botframework-schema as a bb-dialogs dependency, but hardcoded path, since new bits aren't published

* Removed relative path; added reference to botframework-schema module directly in imports

* changed path in package.json

* Reduce import to only point to only botbuilder-core, as core rquires and exports schema

* OAuthPrompt & OAuthPrompt tests now only reference bb-core, not schema directly

* Added error messages to abortWebSocketUpgrade() (#1741)

* Added error messages to abortWebSocketUpgrade()

* changed unit tests to use trycatch blocks

* changed to error message thrown

Co-authored-by: johnataylor <johtaylo@microsoft.com>
Co-authored-by: Chris Mullins <cleemullins@users.noreply.github.com>

* Port: LG error related changes (#1785)

* port LG error centralization

* merge changes

* parity code

* fix lg test bugs

* fix bugs

* fix

* fix test cases

* fix assert throw to verify error message

* modify staticChecker

* fix bugs

* fix import

* remove comments

* add signature

* remove unused file

* retrigger

Co-authored-by: Hongyang Du (hond) <hond@microsoft.com>

* Treat '@{' an error instead of text in LG (#1768)

* Hond/indexof (#1797)

* Treat '@{' an error instead of text in LG

* modify indexOf and lastIndexOf function

* Storage base tests (#1371)

* - converted CosmosPartitioned tests
- Cleaned up mockHelper

* added CosmosClientOptions test

* - converted cosmosDbStorage tests

* converted BlobStorage tests

* converted MemoryStorage

* - fixed cosmosPartitioned test
- re-recorded tests

* uncommented test

* moved newItem.eTag check to outer if

* moved empty keys/changes checks under the Promise

* *actually* moved throw under the promise. whoops

* minor typo fix

* fixed tests

* fixed tests failing due to doOnce
re-recorded tests

* restore expectedCalls

Co-authored-by: Steven Ickman <stevenic@microsoft.com>

* Port QnAMakerDialog from C# (#1769)

* Added initial work on QnAMakerDialog

* Ported most of the dialog logic.  Needs card factories.

* Add QnACardBuilder

* Complete dialog and card builder

* Updates following code review

* Added unit tests

Co-authored-by: Steven Ickman <stevenic@microsoft.com>

* Updating Teams Types (#1789)

* fixes #1398

* adding type

* updating documentation

* updating typing references

Co-authored-by: Steven Ickman <stevenic@microsoft.com>

* Add gitpod config (#1786)

this commit adds support for Gitpod.io, a free automated
dev environment that makes contributing and generally working on GitHub
projects much easier. It allows anyone to start a ready-to-code dev
environment for any branch, issue and pull request with a single click.

Co-authored-by: Steven Ickman <stevenic@microsoft.com>

* [Expression] Fix result when the second arg is null in lastIndexOf function (#1805)

* fix lastIndexOf behavior parity with c#

* add a test case

* refactor

* [Webpack][ISSUE#818][BotBuilder-AI][BF-Connector] Fix webpack dependency warning (#1540)

* Add getFetch function and tests to botbuilder-ai

* Add setGlobals function and tests to bf-connector

* Update getFetch function

* Update set globals apis from bf-connector

* Add Copyright header to BF-Connector index file

* Update global functions to set fetch and formData

* Remove dom from botbuilder-ai tsconfig

* Add Copyright header

Co-authored-by: Steven Ickman <stevenic@microsoft.com>
Co-authored-by: Steven Gum <14935595+stevengum@users.noreply.github.com>

* Initial check-in of flatten, unique and (#1813)

indicesAndValues working over objects.

* migrate c# change in for adding oauth app credentials as a parameter (#1697)

* migrate .net change in for adding oauth app credentials as a parameter

* rename variable

* change turn state key name

* fix use ternary operator

* use CredentialTokenProvider interface that extends UserTokenProvider interface

* remove unused comments

* correct the credentialTokenProvider interface path

* fix import

* fix the dependency chain

* fix parameter name

* fix comments

* fix tests

* fix token resolve test

* fix test

* make webResource interface

* cleanup new interface names

* rename AppCredentialsProvider to AppCredentials

* add back newline

Co-authored-by: Steven Ickman <stevenic@microsoft.com>
Co-authored-by: Steven Gum <14935595+stevengum@users.noreply.github.com>

* Marked config classes as deprecated (#1819)

* Add null check for from (#1807)

Co-authored-by: Steven Ickman <stevenic@microsoft.com>

* ci: add auto tagging (#1823)

Co-authored-by: Tom Laird-McConnell <tomlm@microsoft.com>

* Updated the QnAMakerOptions doc on scoreThreshold option to be more explicit on what is a valid number range (#1822)

* added getSignInLink overload (#1803)

* migrate .net change in for adding oauth app credentials as a parameter

* rename variable

* change turn state key name

* fix use ternary operator

* use CredentialTokenProvider interface that extends UserTokenProvider interface

* remove unused comments

* correct the credentialTokenProvider interface path

* fix import

* fix the dependency chain

* fix parameter name

* fix comments

* fix tests

* fix token resolve test

* fix test

* added getSignInLink overload

* - Merge branch 'master' into oauthOverloads
- dropped unnecessary overloads
- added param docstrings

* remove accidental merge file

Co-authored-by: Ted <tedlee@microsoft.com>

* Added buffered delivery mode support. (#1783)

* Added buffered delivery mode support.

* Renamed buffered to bufferedReplies

* Fixed some test issues

* Disabled date tests that don't work in the Pacific Time Zone

* tested end to end plus some fixes

Co-authored-by: johnataylor <johtaylo@microsoft.com>

* Fix expression built-in function errors and test errors (#1824)

* fix test error

* replace flat function

* fix typo

* Ensure that ABS OAuth cards are not sent by the Bot when (#1812)

a community adapters is in use.

Co-authored-by: ckkMicrosoft <30480427+ckkMicrosoft@users.noreply.github.com>
Co-authored-by: Steven Ickman <stevenic@microsoft.com>

* add overridable method to allow injection of cert (#1830)

* Move BotIdentityKey to BotAdapter from BotFrameworkAdapter (#1763)

* Move BotIdentityKey to BotAdapter from BotFrameworkAdapter, makign it available to derived adapters
This is part of skills support
Related to #1523

* Add overload on ContinueConversation to support skills

* allow 3 or more params to continueconversation

* manually revert continueConversation changes

Co-authored-by: johnataylor <johtaylo@microsoft.com>
Co-authored-by: Steven Ickman <stevenic@microsoft.com>
Co-authored-by: Steven Gum <14935595+stevengum@users.noreply.github.com>

* Added null check for activity.text in ConfirmPrompt (#1826)

Co-authored-by: Eric Dahlvang <v-eridah@microsoft.com>

* Support Skills in Azure Government (#1835)

* fix import in testbot

* fix lint errors

* * refactor AppCredentials
* fix more lint errors
* remove ".default" for dotnet parity

* fix gov auth, update govConstants

* refactor to enable gov skills

* Added flags to disable recognizing choices by number or ordinal. (#1820)

Co-authored-by: Eric Dahlvang <v-eridah@microsoft.com>

* add getMember and getPagedMember to teamsInfo (#1833)

* add getMember and getPagedMember to teamsInfo

* abstract options object

* examples

* fix test

* add missing awaits

Co-authored-by: Steven Ickman <stevenic@microsoft.com>

* updated NYC dev dependency (#1828)

Co-authored-by: Steven Ickman <stevenic@microsoft.com>

* Port some LG and Expression from BotBuilder-Dotnet (#1834)

* init

* port some changes in LG and Expression

* change filePath to lowercase

* revert substring change

* fix

* fix extra tabs

* retrigger

* retrigger

Co-authored-by: Steven Ickman <stevenic@microsoft.com>

* Remove @types node dev dependency from botframework-streaming (#1795)

* replaced new Server with createNodeServer(); created test INodeSocket2 for type hint

* removed new Func unit test

* consolidated server-creation into 1 utils module; added unit tests

* removed await from Promise.all, as it was originally

* Update libraries/botframework-streaming/tests/NamedPipe.test.js

Co-Authored-By: Christopher Anderson <chrande@microsoft.com>

* replaced references to @types/node classes with bf-streaming interfaces, minus for the static methods on Buffer and nodeWebSocket.create()

* added more signatures to INodeSocket to remove Socket type dependency from WebSocketTransport

* cleaned up comment

* changed INodeSocket.connect() to return any, as the nested types on signature made it unsuitable to be a Socket (we are not creating interfaces for the multiple layers of node types

* changed Buffer to INodeBuffer type hint

* added type guards to ensure we're getting an INodeServer back from createNodeServer

* added unit test

* added duck typing checks for server methods

* Added methods to INodeSocket to remove dependency on node stream.Duplex type

* put server-creation in trycatch block, as we don't know if node 'net' module might change their Server ctor overloads

* removed space from top of imports in tests

* added false path to checks (whoops, forgot them)

* moved imort below comment

Co-authored-by: Christopher Anderson <chrande@microsoft.com>
Co-authored-by: Steven Ickman <stevenic@microsoft.com>

* add skillDialog and associated classes (#1771)

* add skillDialog and associated classes

* move non-impl Skill code to core for use in dialogs

* scaffold dialogRootBot and dialogSkillBot

* apply SkillDialog updates from microsoft/botbuilder-dotnet#3474

* rename SkillDialogArgs to BeginSkillDialogOptions

Co-authored-by: Steven Ickman <stevenic@microsoft.com>

* add BFAdapter tests for bufferedReplies and invokeResponses (#1842)

Co-authored-by: johnataylor <johtaylo@microsoft.com>

* Fix bug where custom functions were not passed to (#1845)

included .lg files.

* Update LG template content range (#1849)

* adjust template range

* update

* add memberCount and channelCount to TeamDetails (#1858)

* BotFrameworkAdapter and Skills classes OAuthScope changes (#1852)

* move StatusCodeError out of botFrameworkAdapter.ts

* add OAuthScope key, parity AuthConstants change

* add oAuthScope to continueConversation

* InvokeResponse changes, plumbing through OAuthScope, Skills updates

* add bufferedReplies support to SkillDialog

Co-authored-by: johnataylor <johtaylo@microsoft.com>

* Adding helper for starting thread in teams (#1847)

* adding helper for sending to channel

* removing package file

* updating tests

* updating names, fixing tests

Co-authored-by: Steven Gum <14935595+stevengum@users.noreply.github.com>

* add SkillDialog unit tests, fix postToSkill bug (#1861)

* Port:  API naming for Expression (#1853)

* port expression naming

* retrigger

* fix

* fix

* remove unnecessary test

* delete extra whitespace

* add test case

* changes

* fix test cases

* port toString (#1862)

* Port SSO changes from C# to JS (#1738)

* initial commit for sso (most changes)

* add documentation comments

* added null checks. hooked up teams

* started adding tests

* test case passes

* mostly final changes before pr

* merge with master

* address comments

* fix merge conflicts

* addressed comments

* fix some broken tests (2 remaining)

* bugs during e2e testing.Also remove invalid testcase.

* add accidentally reverted change. fix tests. merge with another c# pr

* address merge conflicts

* apply PR feedback and minor cleanup

Co-authored-by: Swagat Mishra <swagatm@microsoft.com>
Co-authored-by: stevengum <14935595+stevengum@users.noreply.github.com>

* Add interruption support to SkillDialog and runDialog helper method (#1867)

* add resume and reprompt to SkillDialog
* add basic tests

* add runDialog

* Add ephemeral option to deliver mode (#1856)

Co-authored-by: bothosting.runtime@bf.ai <bothosting.runtime@bf.ai>
Co-authored-by: Steven Gum <14935595+stevengum@users.noreply.github.com>

* [SSO] [Port] support for SSO to parent and child bot projects   for manual testing (#1870)

* [SSO] [Port] support for SSO to parent and child bot projects ofr manual testing

* add a readme that links to the c# readme

Co-authored-by: Swagat Mishra <swagatm@microsoft.com>
Co-authored-by: Carlos Castro <carlosscastro@users.noreply.github.com>

* DONOTMERGE: Change DeliveryMode bufferedReplies to expectReplies (#1869)

* change DeliveryMode bufferedReplies to expectsReply

* expectsReply to expectReplies

* spelling

* spelling

* Add expectedReplies, update skillDialog (#1876)

* Clean LG/Expression (#1873)

* init

* update

* clean LG/Expression

* revert ts-node version

* clean up activityhandler invoke path (#1872)

* clean up activityhandler invoke path

* apply PR feedback

* cr feedback

Co-authored-by: stevengum <14935595+stevengum@users.noreply.github.com>

* BufferedReplies to ExpectReplies in skill test parentBot (#1882)

* API naming for LG (#1883)

* rename lg

* rename templates property to items

* rename

* rename

* Updated Templates to look like a collection

* Fixed unit tests

Co-authored-by: Steven Ickman <stevenic@microsoft.com>

* apply PayloadSender fix from #1886 and add unit test (#1887)

* Update preview build to 4.9 (#1888)

* Update comments (#1881)

Co-authored-by: Chris Mullins <cleemullins@users.noreply.github.com>

* [master, cherry-pick] fix runDialog helper, fix callerId (#1898)

* fix runDialog helper, fix callerId (#1896)

* fix private isEocComingFromParent in dialogHelper.ts

Manually cherry pick 70e7b94

* make WebRequest.on optional (#1899)

* trust reference.serviceUrl if credentials.appId is truthy (#1889)

* trust reference.serviceUrl if credentials.appId is truthy

* address @stevengum's PR feedback

how meta

* Cherry-picks #1902 and #1894 to master (#1906)

* Revert breaking changes around BotFrameworkClient implementations (#1894)

* change BotFrameworkClient to interface
* postActivity property is now a Union type

* fix breaking change in SkillHttpClient

* fix private isEocComingFromParent in dialogHelper.ts

* Fix AppCredentials compilation error in BotFrameworkAdapter (#1902)

* implement different fixes for #1901

* loosen credentials reqs in BFHttpClient

* rev on BotFrameworkAdapter AppCredentials fix

* fix breaking change in createTokenApiClient

* rename CoreAppCredentials

* make appCredentials optional in oAuthPromptSettings

* test: add typescript consumer test (#1904)

Co-authored-by: stevengum <14935595+stevengum@users.noreply.github.com>

Co-authored-by: Christopher Anderson <chrande@microsoft.com>

Co-authored-by: Christopher Anderson <chrande@microsoft.com>

* do not set signInLink to empty when OAuthAppCredentials is set (#1907)

* update lg tsconfig and comments (#1910)

* update lg tsconfig

* migrate C# format comments to js comments

* re-trigger ci

* Improve Expression with adding type checking functions (#1911)

* remove array function, support multiline expr

* adding type checking related functions

* ensure more operators support multi line exprs

* revert ExpressionAntlrParser

* add more tests

* fix some format and add a test for createArray

* remove multiline

* remove test

* revert change

* revert

* port dotnet DialogTestClient DialogContext changes (#1914)

* fix index bug (#1919)

* [PORT] [activityfactory] Improve missing type error (#1922)

* Support multiple lines Expression in LG file (#1921)

* init

* add support for multi line expr in LG

* fix test case

* remove only in test

* undo comment

* move botbuilder/tests/teams to libraries/teams-scenarios (#1915)

* Move deepEquals and deferences from extensions to Expression class (#1927)

* Move DeepEquals and References from extensions to Expression class

* revert package.json

* revert package.json

* revert package.json

* retrigger ci

* [PORT]Disambiguation of “!” mark in expression (#1933)

* [PORT][Expression] Support escape in regex (#1938)

* Add method for create an array by square bracket expression (#1926)

* create Array via [...]

* add more tests

* more test on array create and index access

* fix a typo

* [PORT]update expression escape (#1940)

* Remove unnecessary restrication on memory path (#1941)

* [PORT] remove dynamic (#1942)

* port C# remove dynamic

* update

* retrigger ci

* update

* [PORT]update LG escape (#1944)

* lf escape

* add more tests

* Two small test fixes (#1947)

- increased timeout of expressionParser test

Co-authored-by: Steven Gum <14935595+stevengum@users.noreply.github.com>

* added LUIS error handling (#1949)

* [PORT] Make the CRUD of the template consistent (#1952)

* [PORT]cache Antlr parse result (#1956)

* replace ExpressionEngine with ExpressionParser in adaptive dialogs

* Expression.references() in adaptive dialogs

* use ActivityFactory/MessageFactory in ActivityTemplate

* replace LGFile with Templates in adaptive dialogs

* export DialogManager to let AdaptiveDialog work

* let adative dialog tests pass

* fix test cases in multi lang LG Generator

Co-authored-by: Dave Taniguchi <daveta@microsoft.com>
Co-authored-by: Steven Gum <14935595+stevengum@users.noreply.github.com>
Co-authored-by: Jonathan Fingold <35047199+JonathanFingold@users.noreply.github.com>
Co-authored-by: JSpru <v-jonspr@microsoft.com>
Co-authored-by: Tien Suwandy <tiens@microsoft.com>
Co-authored-by: Steven Ickman <stevenic@microsoft.com>
Co-authored-by: Carlos Castro <ccastro@microsoft.com>
Co-authored-by: Carlos Castro <carlosscastro@users.noreply.github.com>
Co-authored-by: mdrichardson <v-micric@microsoft.com>
Co-authored-by: johnataylor <johtaylo@microsoft.com>
Co-authored-by: trojenguri <gurvsing@microsoft.com>
Co-authored-by: Eric Dahlvang <v-eridah@microsoft.com>
Co-authored-by: Michael Richardson <40401643+mdrichardson@users.noreply.github.com>
Co-authored-by: daveta <6182197+daveta@users.noreply.github.com>
Co-authored-by: Hongyang Du (hond) <hond@microsoft.com>
Co-authored-by: Chris Mullins <cleemullins@users.noreply.github.com>
Co-authored-by: Billy Delgado <37461749+Bill7zz@users.noreply.github.com>
Co-authored-by: Tony Xia <xia_tony@hotmail.com>
Co-authored-by: Christopher Anderson <anderson.chris.john@gmail.com>
Co-authored-by: Kyle Delaney <v-kydela@microsoft.com>
Co-authored-by: Ali <mica.andini@gmail.com>
Co-authored-by: Emilio Munoz <emmunozp@microsoft.com>
Co-authored-by: Christopher Anderson <chrande@microsoft.com>
Co-authored-by: qinezh <qinezh@users.noreply.github.com>
Co-authored-by: Kyle Delaney <kyled@aditiconsulting.com>
Co-authored-by: BruceHaley <v-bruhal@microsoft.com>
Co-authored-by: Kyle Delaney <tharosthedragon@gmail.com>
Co-authored-by: Shuai Wang <shuwan@microsoft.com>
Co-authored-by: Denise Scollo <dens.scollo@gmail.com>
Co-authored-by: Jonathan Fingold <jonathan.m.fingold@gmail.com>
Co-authored-by: shmuelgutman <sh.gutman83@gmail.com>
Co-authored-by: Gary Pretty <gary@garypretty.co.uk>
Co-authored-by: Chris McConnell <chrimc@microsoft.com>
Co-authored-by: Ashley Finafrock <35248895+Zerryth@users.noreply.github.com>
Co-authored-by: Josh <50158775+Virtual-Josh@users.noreply.github.com>
Co-authored-by: Diogo Barros <diogocbarros@hotmail.com>
Co-authored-by: Ted <tedlee@microsoft.com>
Co-authored-by: Tom Laird-McConnell <tomlm@microsoft.com>
Co-authored-by: Kashyap <ckkashyap@gmail.com>
Co-authored-by: ckkMicrosoft <30480427+ckkMicrosoft@users.noreply.github.com>
Co-authored-by: Ben Brown <benbro@microsoft.com>
Co-authored-by: Andrew Clear <1139814+clearab@users.noreply.github.com>
Co-authored-by: swagat mishra <swagatmishra2007@gmail.com>
Co-authored-by: Swagat Mishra <swagatm@microsoft.com>
Co-authored-by: Jeff Derstadt <Jeffders@users.noreply.github.com>
Co-authored-by: bothosting.runtime@bf.ai <bothosting.runtime@bf.ai>
Co-authored-by: Dong Lei <donglei@microsoft.com>
  • Loading branch information
Show file tree
Hide file tree
Showing 382 changed files with 21,324 additions and 10,227 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -313,3 +313,6 @@ package-lock.json

*.tsbuildinfo
*.js.map

consumer-test/**.js
consumer-test/**.json
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This repo is part the [Microsoft Bot Framework](https://github.com/microsoft/bot

| Branch | Description | Build Status | Coverage Status | Windows Bot Test Status | Linux Bot Test Status |Browser Functional Tests
|----|---------------|--------------|-----------------|--|--|--|
|Master | 4.8.* Preview Builds |[![Build status](https://fuselabs.visualstudio.com/SDK_v4/_apis/build/status/JS/BotBuilder-JS-master-daily)](https://fuselabs.visualstudio.com/SDK_v4/_build/latest?definitionId=460)|[![Coverage Status](https://coveralls.io/repos/github/microsoft/botbuilder-js/badge.svg?branch=master)](https://coveralls.io/github/microsoft/botbuilder-js?branch=master)|[![Build Status](https://fuselabs.visualstudio.com/SDK_v4/_apis/build/status/JS/Run-JS-Functional-Tests-Windows?branchName=master)](https://fuselabs.visualstudio.com/SDK_v4/_build/latest?definitionId=548&branchName=master)|[![Build Status](https://fuselabs.visualstudio.com/SDK_v4/_apis/build/status/JS/Run-JS-Functional-Tests-Linux?branchName=master)](https://fuselabs.visualstudio.com/SDK_v4/_build/latest?definitionId=549&branchName=master)|[![Build Status](https://fuselabs.visualstudio.com/SDK_v4/_apis/build/status/SDK_v4-CI?branchName=master)](https://fuselabs.visualstudio.com/SDK_v4/_build/latest?definitionId=731&branchName=master)
|Master | 4.9.* Preview Builds |[![Build status](https://fuselabs.visualstudio.com/SDK_v4/_apis/build/status/JS/BotBuilder-JS-master-daily)](https://fuselabs.visualstudio.com/SDK_v4/_build/latest?definitionId=460)|[![Coverage Status](https://coveralls.io/repos/github/microsoft/botbuilder-js/badge.svg?branch=master)](https://coveralls.io/github/microsoft/botbuilder-js?branch=master)|[![Build Status](https://fuselabs.visualstudio.com/SDK_v4/_apis/build/status/JS/Run-JS-Functional-Tests-Windows?branchName=master)](https://fuselabs.visualstudio.com/SDK_v4/_build/latest?definitionId=548&branchName=master)|[![Build Status](https://fuselabs.visualstudio.com/SDK_v4/_apis/build/status/JS/Run-JS-Functional-Tests-Linux?branchName=master)](https://fuselabs.visualstudio.com/SDK_v4/_build/latest?definitionId=549&branchName=master)|[![Build Status](https://fuselabs.visualstudio.com/SDK_v4/_apis/build/status/SDK_v4-CI?branchName=master)](https://fuselabs.visualstudio.com/SDK_v4/_build/latest?definitionId=731&branchName=master)

[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Microsoft/botbuilder-js/blob/master/LICENSE)
[![Gitter](https://img.shields.io/gitter/room/Microsoft/BotBuilder.svg)](https://gitter.im/Microsoft/BotBuilder)
Expand Down
27 changes: 27 additions & 0 deletions consumer-test/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import * as l1 from '../libraries/adaptive-expressions';
import * as l2 from '../libraries/botbuilder';
import * as l3 from '../libraries/botbuilder-ai';
import * as l4 from '../libraries/botbuilder-applicationinsights';
import * as l5 from '../libraries/botbuilder-azure';
import * as l6 from '../libraries/botbuilder-core';
import * as l7 from '../libraries/botbuilder-dialogs';
import * as l8 from '../libraries/botbuilder-lg';
import * as l9 from '../libraries/botbuilder-testing';
import * as l10 from '../libraries/botframework-config';
import * as l11 from '../libraries/botframework-connector';
import * as l13 from '../libraries/botframework-schema';
import * as l14 from '../libraries/botframework-streaming';

console.log(Object.keys(l1));
console.log(Object.keys(l2));
console.log(Object.keys(l3));
console.log(Object.keys(l4));
console.log(Object.keys(l5));
console.log(Object.keys(l6));
console.log(Object.keys(l7));
console.log(Object.keys(l8));
console.log(Object.keys(l9));
console.log(Object.keys(l10));
console.log(Object.keys(l11));
console.log(Object.keys(l13));
console.log(Object.keys(l14));
3 changes: 2 additions & 1 deletion libraries/adaptive-expressions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"@types/node": "^10.12.18",
"nyc": "^15.0.0",
"ts-node": "^4.1.0",
"typescript": "3.5.3"
"typescript": "3.5.3",
"mocha": "^5.2.0"
},
"scripts": {
"build": "tsc",
Expand Down
9 changes: 9 additions & 0 deletions libraries/adaptive-expressions/src/CommonRegex.g4
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ option_flag
| 's'
;

// QUOTING
//
// \x where x is non-alphanumeric is a literal x
// \Q...\E treat enclosed characters as literal
Quoted : '\\' NonAlphaNumeric;
BlockQuoted : '\\Q' .*? '\\E';

atom
: shared_atom
| literal
Expand Down Expand Up @@ -152,6 +159,8 @@ shared_literal
| CarriageReturn
| Tab
| HexChar
| Quoted
| BlockQuoted
| OpenBrace
| CloseBrace
| Comma
Expand Down
2 changes: 1 addition & 1 deletion libraries/adaptive-expressions/src/commonRegex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class CommonRegex {
result = this.regexCache.get(pattern);
} else {
if (!pattern || !this.isCommonRegex(pattern)) {
throw new Error(`A regular expression parsing error occurred.`);
throw new Error(`'${ pattern }' is not a valid regex.`);
}

result = this.getRegExpFromString(pattern);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { ExpressionEvaluator } from './expressionEvaluator';

/**
* Interface for adding custom functions to the expression engine.
* Interface for adding custom functions to the expression parser.
*/
export interface ComponentExpressionFunctionsInteerface {

Expand Down
36 changes: 33 additions & 3 deletions libraries/adaptive-expressions/src/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import { ExpressionType } from './expressionType';
*/
export class Constant extends Expression {

// original regex: (?<!\\)'
private readonly singleQuotRegex: RegExp = new RegExp(/'(?!\\)/g);
/**
* Constant value.
*/
Expand Down Expand Up @@ -41,15 +43,43 @@ export class Constant extends Expression {
this.value = value;
}


public deepEquals(other: Expression): boolean {
let eq: boolean;
if (!other || other.type !== this.type) {
eq = false;
} else {
let otherVal = (other as Constant).value;
eq = this.value === otherVal;
}

return eq;
}

public toString(): string {

if (this.value === undefined) {
return 'null';
} else if (typeof this.value === 'string') {
let result = this.value;

result = result.replace(/\\/g, '\\\\');
result = this.reverseString(this.reverseString(result).replace(this.singleQuotRegex, (): any => '\'\\'));
return `'${ result }'`;
} else if (typeof this.value === 'number') {
return this.value.toString();
} else if(typeof this.value === 'object') {
return JSON.stringify(this.value);
}

if (typeof this.value === 'string') {
return `'${ this.value }'`;
return this.value.toString();
}

private reverseString(str: string | undefined): string {
if (!str) {
return str;
}

return !this.value ? undefined : this.value.toString();
return str.split('').reverse().join('');
}
}
Loading

0 comments on commit 96372a9

Please sign in to comment.