{"_id":"@elmabot/botium-connector-directline3","name":"@elmabot/botium-connector-directline3","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.2":{"name":"@elmabot/botium-connector-directline3","version":"0.1.2","description":"Botium Connector for Bot Framework Direct Line 3 API","main":"dist/botium-connector-directline3-cjs.js","module":"dist/botium-connector-directline3-es.js","scripts":{"build":"npm run eslint && rollup -c","eslint":"eslint index.js","eslint-fix":"eslint --fix index.js","update-dependencies":"npm-check-updates --reject node-fetch -u --timeout 120000"},"repository":{"type":"git","url":"git+https://github.com/codeforequity-at/botium-connector-directline3.git"},"author":{"name":"Botium GmbH"},"license":"MIT","bugs":{"url":"https://github.com/codeforequity-at/botium-connector-directline3/issues"},"homepage":"https://www.botium.ai","devDependencies":{"@babel/core":"^7.17.9","@babel/node":"^7.16.8","@babel/plugin-transform-runtime":"^7.17.0","@babel/preset-env":"^7.16.11","eslint":"^8.13.0","eslint-config-standard":"^16.0.3","eslint-plugin-import":"^2.26.0","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^6.0.0","eslint-plugin-standard":"^4.1.0","npm-check-updates":"^12.5.9","rollup":"^2.70.2","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-resolve":"^5.2.0"},"dependencies":{"@babel/runtime":"^7.17.9","better-queue":"^3.8.10","botframework-directlinejs":"^0.15.1","debug":"^4.3.4","form-data":"^4.0.0","lodash":"^4.17.21","mime-types":"^2.1.35","node-fetch":"2.6.7","uuid":"^8.3.2","ws":"^8.5.0","xhr2":"^0.2.1"},"peerDependencies":{"botium-core":">= 1.9.0"},"gitHead":"4c466eef2cceeb7dce3ca31f974c1b38a5f9dc42","_id":"@elmabot/botium-connector-directline3@0.1.2","_nodeVersion":"14.21.3","_npmVersion":"8.12.1","dist":{"integrity":"sha512-/WHnJC4MfLQTakJ5NpcA8ple9GvFoD+IreeMSmC1SpQy3sVSNKQr/E7L+36jgL6xfyUoAaQuBy7mpdB13Ns1Ag==","shasum":"6f99097976ccf8990d00cc4ff5c4cbdb38e8f03f","tarball":"https://registry.npmjs.org/@elmabot/botium-connector-directline3/-/botium-connector-directline3-0.1.2.tgz","fileCount":33,"unpackedSize":194650,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE2OhUvJz2SB0hU66yF44heU8jVnTEe6Nl1jvD4oK95eAiEA55bb/MYVblhO4I+xJogzreKSGjoIVaEkpKE7uswxfKY="}]},"_npmUser":{"name":"impaxel","email":"impaxel@outlook.com"},"directories":{},"maintainers":[{"name":"impaxel","email":"impaxel@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/botium-connector-directline3_0.1.2_1686834233592_0.5017159289707385"},"_hasShrinkwrap":false}},"time":{"created":"2023-06-15T13:03:53.525Z","0.1.2":"2023-06-15T13:03:53.810Z","modified":"2023-06-15T13:03:53.978Z"},"maintainers":[{"name":"impaxel","email":"impaxel@outlook.com"}],"description":"Botium Connector for Bot Framework Direct Line 3 API","homepage":"https://www.botium.ai","repository":{"type":"git","url":"git+https://github.com/codeforequity-at/botium-connector-directline3.git"},"author":{"name":"Botium GmbH"},"bugs":{"url":"https://github.com/codeforequity-at/botium-connector-directline3/issues"},"license":"MIT","readme":"# Botium Connector for Bot Framework Direct Line 3 API\r\n\r\n[![NPM](https://nodei.co/npm/botium-connector-directline3.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/botium-connector-directline3/)\r\n\r\n[ ![Codeship Status for codeforequity-at/botium-connector-directline3](https://app.codeship.com/projects/b55f7630-3017-0136-d8f8-0a3261184ed0/status?branch=master)](https://app.codeship.com/projects/288502)\r\n[![npm version](https://badge.fury.io/js/botium-connector-directline3.svg)](https://badge.fury.io/js/botium-connector-directline3)\r\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg)]()\r\n\r\nThis is a [Botium](https://github.com/codeforequity-at/botium-core) connector for testing your Microsoft Bot Framework chatbots.\r\n\r\n__Did you read the [Botium in a Nutshell](https://medium.com/@floriantreml/botium-in-a-nutshell-part-1-overview-f8d0ceaf8fb4) articles ? Be warned, without prior knowledge of Botium you won't be able to properly use this library!__\r\n\r\n## How it works?\r\nThe Direct Line API 3.0, part of the Microsoft Bot Framework, enables Botium to talk to a chatbot deployed and running with the Microsoft Bot Framework.\r\n\r\nThe Direct Line version number does not correspond to the Microsoft Bot Framework version number. So this connector actually supports  __Microsoft Bot Framework v3 as well as v4__.\r\n\r\nIt can be used as any other Botium connector with all Botium Stack components:\r\n* [Botium CLI](https://github.com/codeforequity-at/botium-cli/)\r\n* [Botium Bindings](https://github.com/codeforequity-at/botium-bindings/)\r\n* [Botium Box](https://www.botium.ai)\r\n\r\n\r\n## Features\r\n* Button, Media, Card, Form extraction.\r\n* Adaptive Card support. \r\n\r\n## Requirements\r\n\r\n* __Node.js and NPM__\r\n* a __Microsoft Bot Framework__ chatbot, and user account with administrative rights\r\n* a __project directory__ on your workstation to hold test cases and Botium configuration\r\n\r\n## Install Botium and Directline3 Connector\r\n\r\nWhen using __Botium CLI__:\r\n\r\n```\r\n> npm install -g botium-cli\r\n> npm install -g botium-connector-directline3\r\n> botium-cli init\r\n> botium-cli run\r\n```\r\n\r\nWhen using __Botium Bindings__:\r\n\r\n```\r\n> npm install -g botium-bindings\r\n> npm install -g botium-connector-directline3\r\n> botium-bindings init mocha\r\n> npm install && npm run mocha\r\n```\r\n\r\nWhen using __Botium Box__:\r\n\r\n_Already integrated into Botium Box, no setup required_\r\n\r\n## Connecting Microsoft Bot Framework to Botium\r\n\r\nYou have to connect the Direct Line channel (with version 3.0) in Azure Portal and obtain the secret - see [here](https://docs.microsoft.com/en-us/azure/bot-service/bot-service-channel-connect-directline) for instructions.\r\n\r\nOpen the file _botium.json_ in your working directory and add the secret:\r\n\r\n```\r\n{\r\n  \"botium\": {\r\n    \"Capabilities\": {\r\n      \"PROJECTNAME\": \"<whatever>\",\r\n      \"CONTAINERMODE\": \"directline3\",\r\n      \"DIRECTLINE3_SECRET\": \"<directline secret>\"\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nTo check the configuration, run the emulator (Botium CLI required) to bring up a chat interface in your terminal window:\r\n\r\n```\r\n> botium-cli emulator\r\n```\r\n\r\nBotium setup is ready, you can begin to write your [BotiumScript](https://botium-docs.readthedocs.io/en/latest/05_botiumscript/index.html) files.\r\n\r\n## Finetuning Directline3 Activity\r\n\r\nFor finetuning the [Activity object](https://docs.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-api-reference?view=azure-bot-service-4.0#activity-object) sent to your bot, you can use the [UPDATE_CUSTOM logic hook](https://botium-docs.readthedocs.io/en/latest/05_botiumscript/index.html#update-custom). This example will add some custom values to the [channelData](https://docs.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-channeldata?view=azure-bot-service-4.0):\r\n\r\n    #me\r\n    do some channel specific thingy ...\r\n    UPDATE_CUSTOM SET_ACTIVITY_VALUE|channelData|{\"channelData1\": \"botium\", \"channelData2\": \"something else\"}\r\n\r\nThe parameters are:\r\n1. SET_ACTIVITY_VALUE\r\n2. The path to the activity field\r\n3. The value of the activity field\r\n\r\nAnother option for having full control over the activity is to use the **DIRECTLINE3_ACTIVITY_TEMPLATE** capability. It is a JSON structure used as a template when sending an activity to the bot.\r\n\r\n```\r\n    ...\r\n    \"DIRECTLINE3_ACTIVITY_TEMPLATE\": {\r\n      \"channelData\": {\r\n        \"my-special-channel-data\": \"...\"\r\n      }\r\n    }\r\n    ...\r\n```\r\n\r\n\r\n## Supported Capabilities\r\n\r\nSet the capability __CONTAINERMODE__ to __directline3__ to activate this connector.\r\n\r\n### DIRECTLINE3_SECRET *\r\nThe secret for accessing your chatbot from the Azure Portal.\r\n\r\n_Note: it is advised to not add this secret to a configuration file but hand it over by environment variable BOTIUM_DIRECTLINE3_SECRET_\r\n\r\n### DIRECTLINE3_DOMAIN\r\nIf not using the default Direct Line endpoint, e.g. if you are using a region-specific endpoint, put its full URL here\r\n\r\n### DIRECTLINE3_WEBSOCKET\r\n_true or false_\r\nWether to use Websocket connection or HTTP polling. Usually, using Websockets is prefered, but sometimes this is not possible (maybe with blocking proxies).\r\n\r\n### DIRECTLINE3_POLLINGINTERVAL\r\n_in milliseconds_\r\nHTTP Polling interval\r\n\r\n### DIRECTLINE3_BUTTON_TYPE and DIRECTLINE3_BUTTON_VALUE_FIELD\r\n_Default type: event_\r\n\r\n_Default field: name_\r\n\r\nActivity fields to use for simulating button clicks by the user. Depending on your implementation, you maybe have to change the activity type or the field to use - see [here](https://docs.microsoft.com/en-us/azure/bot-service/nodejs/bot-builder-nodejs-backchannel) for some ideas.\r\n\r\nUsually, the activity type is _event_, and the button value is submitted in the _name_ field, but using those capabilities you can adapt it to your implementation.\r\n\r\n_Note: if you want to disable this, then set DIRECTLINE3_BUTTON_TYPE to \"message\" and DIRECTLINE3_BUTTON_VALUE_FIELD to \"text\", to make the button clicks appear as normal user text input_\r\n\r\n### DIRECTLINE3_GENERATE_USERNAME\r\n_Default: false_\r\n\r\nBotium simulates conversations with username _me_. Depending on your implementation, running multiple conversations with the same username could make them fail (for example, session handling).\r\n\r\nSetting this capability to _true_ will generate a new username (uuid) for each conversation.\r\n\r\n### DIRECTLINE3_HANDLE_ACTIVITY_TYPES\r\n_Default: \"message\"_\r\n\r\nActivity types to handle (either JSON array or comma separated list). All other activity types will be ignored.\r\n\r\nExample: set to \"message,event\" (or [ \"message\", \"event\" ]) to also handle Bot Framework event activities with Botium\r\n\r\n### DIRECTLINE3_ACTIVITY_VALUE_MAP\r\n_default: { 'event': 'name' }_\r\n\r\nWhen using activity types other than _message_, this capability maps the activity type to the activity attribute to use as message text for Botium.\r\n\r\nBy default, for _event_ activities the _name_ attribute is used as message text, for other activity types the activity type itself.\r\n\r\n### DIRECTLINE3_ACTIVITY_TEMPLATE\r\n_default: {}_\r\n\r\nJSON object holding the activity template used for sending activities to the bot. Can be used to hold for example channelData:\r\n\r\n    ...\r\n    \"DIRECTLINE3_ACTIVITY_TEMPLATE\": {\r\n      \"channelData\": {\r\n        \"kb\": \"demo\"\r\n      }\r\n    },\r\n    ...\r\n\r\n### DIRECTLINE3_ACTIVITY_VALIDATION\r\n_default: 'error'_\r\n\r\nSet to 'warning' if you want to suppress activity validation errors.\r\n\r\n### DIRECTLINE3_WELCOME_ACTIVITY\r\n_default: empty_\r\n\r\nSend some activity upfront to start a session. Can be used to simulate the webchat/join event.\r\n\r\n    ...\r\n    \"DIRECTLINE3_WELCOME_ACTIVITY\": {\r\n      \"type\": \"event\",\r\n      \"name\": \"webchat/join\",\r\n      \"value\": {\r\n        \"language\": \"de-DE\"\r\n      },\r\n      \"channelData\": {\r\n        \"kb\": \"demo\"\r\n      }\r\n    },\r\n    ...\r\n","readmeFilename":"README.md"}