From fdc3ff0fbf59a2ed0197d277d189e14e577b3bbe Mon Sep 17 00:00:00 2001 From: Vishwac Sena Kannan Date: Tue, 5 May 2020 10:17:43 -0700 Subject: [PATCH 1/2] update package.json (#750) --- packages/cli/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index d08c9ec6b..ebcee2637 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -31,7 +31,8 @@ "@microsoft/bf-cli-config", "@microsoft/bf-qnamaker", "@microsoft/bf-luis-cli", - "@microsoft/bf-cli-plugins" + "@microsoft/bf-cli-plugins", + "@microsoft/bf-lg-cli" ], "hooks": { "init": "./lib/hooks/init/inithook" @@ -59,6 +60,7 @@ "@microsoft/bf-luis-cli": "1.0.0", "@microsoft/bf-qnamaker": "1.0.0", "@microsoft/bf-cli-plugins": "1.0.0", + "@microsoft/bf-lg-cli": "1.0.0", "@oclif/command": "~1.5.19", "@oclif/config": "~1.13.3", "@oclif/errors": "~1.2.2", From 0c9d38c456d1703942e687e8141f54a4cee7674d Mon Sep 17 00:00:00 2001 From: Emilio Munoz Date: Tue, 5 May 2020 17:57:48 -0400 Subject: [PATCH 2/2] Adding Dialog to CLI core --- packages/cli/README.md | 333 +++++++++++++++++++- packages/cli/package.json | 4 +- packages/config/README.md | 24 +- packages/dialog/README.md | 27 +- packages/dialog/src/commands/index.ts | 18 -- packages/dialog/src/library/schemaMerger.ts | 2 +- packages/luis/README.md | 181 +++++++---- packages/qnamaker/README.md | 98 ++++-- scripts/fixurls.js | 2 +- 9 files changed, 523 insertions(+), 166 deletions(-) delete mode 100644 packages/dialog/src/commands/index.ts diff --git a/packages/cli/README.md b/packages/cli/README.md index 5baba30e9..0b10e1e2a 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -26,8 +26,16 @@ $ npm install -g @microsoft/botframework-cli * [`bf config:show:luis`](#bf-configshowluis) * [`bf config:show:qnamaker`](#bf-configshowqnamaker) * [`bf config:show:telemetry`](#bf-configshowtelemetry) +* [`bf dialog`](#bf-dialog) +* [`bf dialog:merge PATTERNS`](#bf-dialogmerge-patterns) +* [`bf dialog:verify PATTERNS`](#bf-dialogverify-patterns) * [`bf help [COMMAND]`](#bf-help-command) +* [`bf lg`](#bf-lg) +* [`bf lg:expand`](#bf-lgexpand) +* [`bf lg:translate`](#bf-lgtranslate) +* [`bf lg:verify`](#bf-lgverify) * [`bf luis`](#bf-luis) +* [`bf luis:application:assignazureaccount`](#bf-luisapplicationassignazureaccount) * [`bf luis:application:create`](#bf-luisapplicationcreate) * [`bf luis:application:delete`](#bf-luisapplicationdelete) * [`bf luis:application:import`](#bf-luisapplicationimport) @@ -38,9 +46,11 @@ $ npm install -g @microsoft/botframework-cli * [`bf luis:application:show`](#bf-luisapplicationshow) * [`bf luis:build`](#bf-luisbuild) * [`bf luis:convert`](#bf-luisconvert) +* [`bf luis:cross-train`](#bf-luiscross-train) * [`bf luis:endpoints:list`](#bf-luisendpointslist) * [`bf luis:generate:cs`](#bf-luisgeneratecs) * [`bf luis:generate:ts`](#bf-luisgeneratets) +* [`bf luis:test`](#bf-luistest) * [`bf luis:train:run`](#bf-luistrainrun) * [`bf luis:train:show`](#bf-luistrainshow) * [`bf luis:translate`](#bf-luistranslate) @@ -58,7 +68,9 @@ $ npm install -g @microsoft/botframework-cli * [`bf qnamaker:alterations`](#bf-qnamakeralterations) * [`bf qnamaker:alterations:list`](#bf-qnamakeralterationslist) * [`bf qnamaker:alterations:replace`](#bf-qnamakeralterationsreplace) +* [`bf qnamaker:build`](#bf-qnamakerbuild) * [`bf qnamaker:convert`](#bf-qnamakerconvert) +* [`bf qnamaker:cross-train`](#bf-qnamakercross-train) * [`bf qnamaker:endpointkeys`](#bf-qnamakerendpointkeys) * [`bf qnamaker:endpointkeys:list`](#bf-qnamakerendpointkeyslist) * [`bf qnamaker:endpointkeys:refresh`](#bf-qnamakerendpointkeysrefresh) @@ -168,14 +180,15 @@ USAGE OPTIONS -h, --help show CLI help --appId=appId LUIS application Id + --authoringKey=authoringKey LUIS cognitive services authoring key (aka Ocp-Apim-Subscription-Key). --endpoint=endpoint LUIS application endpoint hostname, ex: .api.cognitive.microsoft.com --subscriptionKey=subscriptionKey LUIS cognitive services subscription key (aka Ocp-Apim-Subscription-Key) --versionId=versionId LUIS version Id EXAMPLE - $ bf config:set:luis --appId {APPLICATION_ID} --subscriptionKey {SUBSCRIPTION_KEY} --versionId {VERSION_ID} - --endpoint {ENDPOINT} + $ bf config:set:luis --appId {APPLICATION_ID} --authoringKey {AUTHORING_KEY} --subscriptionKey {SUBSCRIPTION_KEY} + --versionId {VERSION_ID} --endpoint {ENDPOINT} ``` _See code: [@microsoft/bf-cli-config](https://github.com/microsoft/botframework-cli/tree/master/packages/config/src/commands/config/set/luis.ts)_ @@ -280,6 +293,61 @@ OPTIONS _See code: [@microsoft/bf-cli-config](https://github.com/microsoft/botframework-cli/tree/master/packages/config/src/commands/config/show/telemetry.ts)_ +## `bf dialog` + +Dialog related commands for working with .schema and .dialog files. + +``` +USAGE + $ bf dialog + +OPTIONS + -h, --help Dialog command help +``` + +_See code: [@microsoft/bf-dialog](https://github.com/microsoft/botframework-cli/tree/master/packages/dialog/src/commands/dialog/index.ts)_ + +## `bf dialog:merge PATTERNS` + +Merge component .schema files into an app.schema. + +``` +USAGE + $ bf dialog:merge PATTERNS + +ARGUMENTS + PATTERNS Any number of glob regex patterns to match .schema, .csproj, or package.json files. + +OPTIONS + -h, --help show CLI help + -o, --output=output [default: app.schema] Output path and filename for merged schema. + -v, --verbose Show verbose logging of files as they are processed. + +EXAMPLES + $ bf dialog:merge *.csproj + $ bf dialog:merge libraries/**/*.schema **/*.csproj -o app.schema +``` + +_See code: [@microsoft/bf-dialog](https://github.com/microsoft/botframework-cli/tree/master/packages/dialog/src/commands/dialog/merge.ts)_ + +## `bf dialog:verify PATTERNS` + +Verify .dialog files match their app.schema. + +``` +USAGE + $ bf dialog:verify PATTERNS + +ARGUMENTS + PATTERNS Any number of glob regex patterns to match .dialog files. + +OPTIONS + -h, --help show CLI help + -v, --verbose Show verbose output +``` + +_See code: [@microsoft/bf-dialog](https://github.com/microsoft/botframework-cli/tree/master/packages/dialog/src/commands/dialog/verify.ts)_ + ## `bf help [COMMAND]` display help for bf @@ -297,6 +365,84 @@ OPTIONS _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v2.1.6/src/commands/help.ts)_ +## `bf lg` + +Parse, collate, expand and translate lg files. + +``` +USAGE + $ bf lg + +OPTIONS + -h, --help lg command help +``` + +_See code: [@microsoft/bf-lg-cli](https://github.com/microsoft/botframework-cli/tree/master/packages/lg/src/commands/lg/index.ts)_ + +## `bf lg:expand` + +Expand one or all templates in .lg file(s). Expand an inline expression. + +``` +USAGE + $ bf lg:expand + +OPTIONS + -f, --force If --out flag is provided with the path to an existing file, overwrites that file + -h, --help lg:expand help + -i, --in=in (required) .lg file or folder that contains .lg file. + -o, --out=out Output file or folder name. If not specified stdout will be used as output + -r, --recurse Consider sub-folders to find .lg file(s) + --all When set, all templates in the .lg file be expanded. + --expression=expression Inline expression provided as a string to evaluate. + --interactive Interactively prompt for all missing entity value references required for expansion. + --template=template Name of the template to expand. Template names with spaces must be enclosed in quotes. + --testInput=testInput Path to a JSON file containing test input for all variable references. +``` + +_See code: [@microsoft/bf-lg-cli](https://github.com/microsoft/botframework-cli/tree/master/packages/lg/src/commands/lg/expand.ts)_ + +## `bf lg:translate` + +Machine translate .lg files using Microsoft Translator Text API. + +``` +USAGE + $ bf lg:translate + +OPTIONS + -f, --force If --out flag is provided with the path to an existing file, overwrites that file + -h, --help lg:translate help + -i, --in=in (required) .lg file or folder that contains .lg file. + -o, --out=out Output file or folder name. If not specified stdout will be used as output + -r, --recurse Consider sub-folders to find .lg file(s) + --srclang=srclang Source lang code. Auto detect if missing. + --tgtlang=tgtlang (required) Comma separated list of target languages. + --translate_comments Machine translate all comments found in .lg file + --translate_link_text Machine translate link description in .lg file + --translatekey=translatekey (required) Machine translation endpoint key. +``` + +_See code: [@microsoft/bf-lg-cli](https://github.com/microsoft/botframework-cli/tree/master/packages/lg/src/commands/lg/translate.ts)_ + +## `bf lg:verify` + +Verify .lg file(s) and collate them into a single file. + +``` +USAGE + $ bf lg:verify + +OPTIONS + -f, --force If --out flag is provided with the path to an existing file, overwrites that file + -h, --help lg:verify help + -i, --in=in (required) .lg file or folder that contains .lg file. + -o, --out=out Output file or folder name. If not specified stdout will be used as output + -r, --recurse Considere sub-folders to find .lg file(s) +``` + +_See code: [@microsoft/bf-lg-cli](https://github.com/microsoft/botframework-cli/tree/master/packages/lg/src/commands/lg/verify.ts)_ + ## `bf luis` Manages LUIS assets on service and/or locally. @@ -311,6 +457,36 @@ OPTIONS _See code: [@microsoft/bf-luis-cli](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/index.ts)_ +## `bf luis:application:assignazureaccount` + +Assign a LUIS azure accounts to an application + +``` +USAGE + $ bf luis:application:assignazureaccount + +OPTIONS + -h, --help show CLI help + --accountName=accountName (required) Account name + --appId=appId (required) LUIS application Id (defaults to config:LUIS:appId) + + --armToken=armToken (required) The bearer authorization header to use; containing the user`s + ARM token used to validate azure accounts information + + --azureSubscriptionId=azureSubscriptionId (required) Azure Subscription Id + + --endpoint=endpoint LUIS endpoint hostname + + --json Display output as JSON + + --resourceGroup=resourceGroup (required) Resource Group + + --subscriptionKey=subscriptionKey (required) LUIS cognitive services subscription key (default: + config:LUIS:subscriptionKey) +``` + +_See code: [@microsoft/bf-luis-cli](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/application/assignazureaccount.ts)_ + ## `bf luis:application:create` Creates a new LUIS application @@ -560,36 +736,40 @@ USAGE $ bf luis:build OPTIONS - -f, --force If --dialog flag is provided, overwirtes relevant dialog file + -f, --force If --dialog flag is provided, overwrites relevant dialog file -h, --help show CLI help -i, --in=in Lu file or folder -o, --out=out Output file or folder name. If not specified, current directory will be used as output - --authoringKey=authoringKey (required) LUIS authoring key + --authoringKey=authoringKey LUIS authoring key --botName=botName Bot name --defaultCulture=defaultCulture Culture code for the content. Infer from .lu if available. Defaults to en-us - --dialog Write out .dialog files + --deleteOldVersion Delete old version of LUIS application after building new one. + + --dialog=dialog [default: multiLanguage] Write out .dialog files whose recognizer type + [multiLanguage|crosstrained] is specified by --dialog --fallbackLocale=fallbackLocale Locale to be used at the fallback if no locale specific recognizer is found. Only valid if --dialog is set --log write out log messages to console - --luConfig=luConfig Path to config for lu build + --luConfig=luConfig Path to config for lu build which can contain switches for arguments --region=region [default: westus] LUIS authoring region [westus|westeurope|australiaeast] --suffix=suffix Environment name as a suffix identifier to include in LUIS app name. Defaults to - current logged in useralias + current logged in user alias EXAMPLE - $ bf luis:build --in {INPUT_FILE_OR_FOLDER} --authoringKey {AUTHORING_KEY} --botName {BOT_NAME} --dialog {true} + $ bf luis:build --in {INPUT_FILE_OR_FOLDER} --authoringKey {AUTHORING_KEY} --botName {BOT_NAME} --dialog + multiLanguage ``` _See code: [@microsoft/bf-luis-cli](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/build.ts)_ @@ -619,6 +799,33 @@ OPTIONS _See code: [@microsoft/bf-luis-cli](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/convert.ts)_ +## `bf luis:cross-train` + +Lu and Qna cross train tool + +``` +USAGE + $ bf luis:cross-train + +OPTIONS + -h, --help luis:cross-train help + -i, --in=in source lu and qna files folder + + -o, --out=out output folder name. If not specified, the cross trained files will be wrote to cross-trained + folder under folder of current command + + --config=config path to config file of mapping rules which is relative to folder specified by --in. If not + specified, it will read default config.json from the folder specified by --in + + --intentName=intentName [default: _Interruption] Interruption intent name + + --rootDialog=rootDialog rootDialog file path which is relative to folder specified by --in. If --config not + specified, cross-trian will automatically construct the config from file system based on root + dialog file +``` + +_See code: [@microsoft/bf-luis-cli](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/cross-train.ts)_ + ## `bf luis:endpoints:list` Returns available deployment endpoints @@ -685,6 +892,37 @@ OPTIONS _See code: [@microsoft/bf-luis-cli](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/generate/ts.ts)_ +## `bf luis:test` + +Test a .lu file or LUIS application JSON model against a published LUIS model + +``` +USAGE + $ bf luis:test + +OPTIONS + -a, --appId=appId (required) LUIS application Id + -h, --help luis:test help + -i, --in=in Source .lu file or LUIS application JSON model for testing + -o, --out=out Output file or folder name. If not specified stdout will be used as output + -s, --subscriptionKey=subscriptionKey (required) LUIS cognitive services subscription key + + --allowIntentsCount=allowIntentsCount [default: 1] Top-scoring intent or top n Intent with score to show in the + result + + --endpoint=endpoint [default: https://westus.api.cognitive.microsoft.com] LUIS endpoint hostname + + --force If --out flag is provided with the path to an existing file, overwrites that + file + + --intentOnly Only test intent + + --staging Presence of flag targets the staging app, if no flag passed defaults to + production +``` + +_See code: [@microsoft/bf-luis-cli](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/test.ts)_ + ## `bf luis:train:run` Issues asynchronous training request for LUIS application @@ -1089,6 +1327,50 @@ OPTIONS _See code: [@microsoft/bf-qnamaker](https://github.com/microsoft/botframework-cli/tree/master/packages/qnamaker/src/commands/qnamaker/alterations/replace.ts)_ +## `bf qnamaker:build` + +Build .qna files to create or update qnamaker knowledge bases and qnamaker alterations + +``` +USAGE + $ bf qnamaker:build + +OPTIONS + -b, --botName=botName (required) Bot name + -f, --force If --dialog flag is provided, overwirtes relevant dialog file + -h, --help show CLI help + -i, --in=in Source .qna file or folder + + -o, --out=out Output file or folder name. If not specified, current directory will be used as + output + + -s, --subscriptionKey=subscriptionKey (required) QnA maker subscription key + + --defaultCulture=defaultCulture Culture code for the content. Infer from .qna if available. Defaults to en-us + if not set + + --dialog=dialog [default: multiLanguage] Write out .dialog files whose recognizer type + [multiLanguage|crosstrained] is specified by --dialog + + --fallbackLocale=fallbackLocale Locale to be used at the fallback if no locale specific recognizer is found. + Only valid if --dialog is set + + --log write out log messages to console + + --region=region [default: westus] Overrides public endpoint + https://.api.cognitive.microsoft.com/qnamaker/v4.0/ + + --suffix=suffix Environment name as a suffix identifier to include in qnamaker kb name. + Defaults to current logged in user alias + +EXAMPLE + + $ bf qnamaker:build --in {INPUT_FILE_OR_FOLDER} --subscriptionKey {SUBSCRIPTION_KEY} --botName {BOT_NAME} + --dialog +``` + +_See code: [@microsoft/bf-qnamaker](https://github.com/microsoft/botframework-cli/tree/master/packages/qnamaker/src/commands/qnamaker/build.ts)_ + ## `bf qnamaker:convert` Converts .qna file(s) to QnA application JSON models or vice versa. @@ -1111,6 +1393,33 @@ OPTIONS _See code: [@microsoft/bf-qnamaker](https://github.com/microsoft/botframework-cli/tree/master/packages/qnamaker/src/commands/qnamaker/convert.ts)_ +## `bf qnamaker:cross-train` + +Lu and Qna cross train tool + +``` +USAGE + $ bf qnamaker:cross-train + +OPTIONS + -h, --help luis:cross-train help + -i, --in=in source lu and qna files folder + + -o, --out=out output folder name. If not specified, the cross trained files will be wrote to cross-trained + folder under folder of current command + + --config=config path to config file of mapping rules which is relative to folder specified by --in. If not + specified, it will read default config.json from the folder specified by --in + + --intentName=intentName [default: _Interruption] Interruption intent name + + --rootDialog=rootDialog rootDialog file path which is relative to folder specified by --in. If --config not + specified, cross-trian will automatically construct the config from file system based on root + dialog file +``` + +_See code: [@microsoft/bf-qnamaker](https://github.com/microsoft/botframework-cli/tree/master/packages/qnamaker/src/commands/qnamaker/cross-train.ts)_ + ## `bf qnamaker:endpointkeys` Commands to refresh and list keys @@ -1311,6 +1620,8 @@ OPTIONS --kbId=kbId Knowledgebase id to be exported. Overrides the knowledge base id present in the config + --qnaFormat Specifies if the content should be exported to .qna format. + --subscriptionKey=subscriptionKey Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource Management section for your Qna Maker cognitive service). Overrides the subscriptionkey value present in the config @@ -1389,8 +1700,12 @@ USAGE OPTIONS -h, --help qnamaker:kb:replace command help - -i, --in=in File path to the ReplaceKbDTO object to send in the body of the request + + -i, --in=in File path to the ReplaceKbDTO object to send in the body of the request. + Alternately this can be path to a .qna file + --endpoint=endpoint Overrides public endpoint https://westus.api.cognitive.microsoft.com/qnamaker/v4.0/ + --kbId=kbId Knowledgebase id. Overrides the knowledge base id present in the config --subscriptionKey=subscriptionKey Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource diff --git a/packages/cli/package.json b/packages/cli/package.json index ebcee2637..93569739c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -32,7 +32,8 @@ "@microsoft/bf-qnamaker", "@microsoft/bf-luis-cli", "@microsoft/bf-cli-plugins", - "@microsoft/bf-lg-cli" + "@microsoft/bf-lg-cli", + "@microsoft/bf-dialog" ], "hooks": { "init": "./lib/hooks/init/inithook" @@ -61,6 +62,7 @@ "@microsoft/bf-qnamaker": "1.0.0", "@microsoft/bf-cli-plugins": "1.0.0", "@microsoft/bf-lg-cli": "1.0.0", + "@microsoft/bf-dialog": "1.0.0", "@oclif/command": "~1.5.19", "@oclif/config": "~1.13.3", "@oclif/errors": "~1.2.2", diff --git a/packages/config/README.md b/packages/config/README.md index d8208ac29..5b7dadcd1 100644 --- a/packages/config/README.md +++ b/packages/config/README.md @@ -8,17 +8,15 @@ This package is intended for Microsoft use only and should be consumed through @ # Commands -- [@microsoft/bf-cli-config](#microsoftbf-cli-config) -- [Commands](#commands) - - [`bf config`](#bf-config) - - [`bf config:set`](#bf-configset) - - [`bf config:set:luis`](#bf-configsetluis) - - [`bf config:set:qnamaker`](#bf-configsetqnamaker) - - [`bf config:set:telemetry`](#bf-configsettelemetry) - - [`bf config:show`](#bf-configshow) - - [`bf config:show:luis`](#bf-configshowluis) - - [`bf config:show:qnamaker`](#bf-configshowqnamaker) - - [`bf config:show:telemetry`](#bf-configshowtelemetry) +* [`bf config`](#bf-config) +* [`bf config:set`](#bf-configset) +* [`bf config:set:luis`](#bf-configsetluis) +* [`bf config:set:qnamaker`](#bf-configsetqnamaker) +* [`bf config:set:telemetry`](#bf-configsettelemetry) +* [`bf config:show`](#bf-configshow) +* [`bf config:show:luis`](#bf-configshowluis) +* [`bf config:show:qnamaker`](#bf-configshowqnamaker) +* [`bf config:show:telemetry`](#bf-configshowtelemetry) ## `bf config` @@ -68,8 +66,8 @@ OPTIONS EXAMPLE - $ bf config:set:luis --appId {APPLICATION_ID} --authoringKey {AUTHORING_KEY} --subscriptionKey {SUBSCRIPTION_KEY} --versionId {VERSION_ID} - --endpoint {ENDPOINT} + $ bf config:set:luis --appId {APPLICATION_ID} --authoringKey {AUTHORING_KEY} --subscriptionKey {SUBSCRIPTION_KEY} + --versionId {VERSION_ID} --endpoint {ENDPOINT} ``` _See code: [src/commands/config/set/luis.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/config/src/commands/config/set/luis.ts)_ diff --git a/packages/dialog/README.md b/packages/dialog/README.md index 9c2285316..0b80f9b95 100644 --- a/packages/dialog/README.md +++ b/packages/dialog/README.md @@ -10,26 +10,9 @@ This package is intended for Microsoft use only and should be consumed through @ # Commands -- [@microsoft/bf-dialog](#microsoftbf-dialog) -- [Commands](#commands) - - [`bf `](#bf) - - [`bf dialog`](#bf-dialog) - - [`bf dialog:merge PATTERNS`](#bf-dialogmerge-patterns) - - [`bf dialog:verify PATTERNS`](#bf-dialogverify-patterns) - -## `bf ` - -The dialog commands allow you to work with dialog schema. - -``` -USAGE - $ bf - -OPTIONS - -h, --help show CLI help -``` - -_See code: [src/commands/index.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/dialog/src/commands/index.ts)_ +* [`bf dialog`](#bf-dialog) +* [`bf dialog:merge PATTERNS`](#bf-dialogmerge-patterns) +* [`bf dialog:verify PATTERNS`](#bf-dialogverify-patterns) ## `bf dialog` @@ -80,8 +63,8 @@ ARGUMENTS PATTERNS Any number of glob regex patterns to match .dialog files. OPTIONS - -h, --help show CLI help - --verbose Show verbose output + -h, --help show CLI help + -v, --verbose Show verbose output ``` _See code: [src/commands/dialog/verify.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/dialog/src/commands/dialog/verify.ts)_ diff --git a/packages/dialog/src/commands/index.ts b/packages/dialog/src/commands/index.ts deleted file mode 100644 index e2a04cb7d..000000000 --- a/packages/dialog/src/commands/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. - */ - -import { Command, flags } from '@microsoft/bf-cli-command'; - -export default class Index extends Command { - static description = 'The dialog commands allow you to work with dialog schema.' - - static flags: flags.Input = { - help: flags.help({ char: 'h' }), - } - - async run() { - this._help() - } -} diff --git a/packages/dialog/src/library/schemaMerger.ts b/packages/dialog/src/library/schemaMerger.ts index c60ccb9a5..e7dbe2756 100644 --- a/packages/dialog/src/library/schemaMerger.ts +++ b/packages/dialog/src/library/schemaMerger.ts @@ -817,7 +817,7 @@ export default class SchemaMerger { if (val.$schema && path) { return true } - if (val.properties && !path?.endsWith('properties')) { + if (val.properties && (!path || !path.endsWith('properties'))) { for (let propName in val.properties) { verifyProperty(val.properties[propName], pathName(path, propName)) } diff --git a/packages/luis/README.md b/packages/luis/README.md index cba635dc7..d01474325 100644 --- a/packages/luis/README.md +++ b/packages/luis/README.md @@ -19,34 +19,32 @@ This package is intended for Microsoft use only and should be consumed through @ # Commands -- [@microsoft/bf-luis-cli](#microsoftbf-luis-cli) -- [Relevant docs](#relevant-docs) -- [Commands](#commands) - - [`bf luis`](#bf-luis) - - [`bf luis:application:create`](#bf-luisapplicationcreate) - - [`bf luis:application:delete`](#bf-luisapplicationdelete) - - [`bf luis:application:import`](#bf-luisapplicationimport) - - [`bf luis:application:list`](#bf-luisapplicationlist) - - [`bf luis:application:publish`](#bf-luisapplicationpublish) - - [`bf luis:application:query`](#bf-luisapplicationquery) - - [`bf luis:application:rename`](#bf-luisapplicationrename) - - [`bf luis:application:show`](#bf-luisapplicationshow) - - [`bf luis:build`](#bf-luisbuild) - - [`bf luis:convert`](#bf-luisconvert) - - [`bf luis:cross-train`](#bf-luiscross-train) - - [`bf luis:endpoints:list`](#bf-luisendpointslist) - - [`bf luis:test`](#bf-luistest) - - [`bf luis:generate:cs`](#bf-luisgeneratecs) - - [`bf luis:generate:ts`](#bf-luisgeneratets) - - [`bf luis:train:run`](#bf-luistrainrun) - - [`bf luis:train:show`](#bf-luistrainshow) - - [`bf luis:translate`](#bf-luistranslate) - - [`bf luis:version:clone`](#bf-luisversionclone) - - [`bf luis:version:delete`](#bf-luisversiondelete) - - [`bf luis:version:export`](#bf-luisversionexport) - - [`bf luis:version:import`](#bf-luisversionimport) - - [`bf luis:version:list`](#bf-luisversionlist) - - [`bf luis:version:rename`](#bf-luisversionrename) +* [`bf luis`](#bf-luis) +* [`bf luis:application:assignazureaccount`](#bf-luisapplicationassignazureaccount) +* [`bf luis:application:create`](#bf-luisapplicationcreate) +* [`bf luis:application:delete`](#bf-luisapplicationdelete) +* [`bf luis:application:import`](#bf-luisapplicationimport) +* [`bf luis:application:list`](#bf-luisapplicationlist) +* [`bf luis:application:publish`](#bf-luisapplicationpublish) +* [`bf luis:application:query`](#bf-luisapplicationquery) +* [`bf luis:application:rename`](#bf-luisapplicationrename) +* [`bf luis:application:show`](#bf-luisapplicationshow) +* [`bf luis:build`](#bf-luisbuild) +* [`bf luis:convert`](#bf-luisconvert) +* [`bf luis:cross-train`](#bf-luiscross-train) +* [`bf luis:endpoints:list`](#bf-luisendpointslist) +* [`bf luis:generate:cs`](#bf-luisgeneratecs) +* [`bf luis:generate:ts`](#bf-luisgeneratets) +* [`bf luis:test`](#bf-luistest) +* [`bf luis:train:run`](#bf-luistrainrun) +* [`bf luis:train:show`](#bf-luistrainshow) +* [`bf luis:translate`](#bf-luistranslate) +* [`bf luis:version:clone`](#bf-luisversionclone) +* [`bf luis:version:delete`](#bf-luisversiondelete) +* [`bf luis:version:export`](#bf-luisversionexport) +* [`bf luis:version:import`](#bf-luisversionimport) +* [`bf luis:version:list`](#bf-luisversionlist) +* [`bf luis:version:rename`](#bf-luisversionrename) ## `bf luis` @@ -62,6 +60,36 @@ OPTIONS _See code: [src/commands/luis/index.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/index.ts)_ +## `bf luis:application:assignazureaccount` + +Assign a LUIS azure accounts to an application + +``` +USAGE + $ bf luis:application:assignazureaccount + +OPTIONS + -h, --help show CLI help + --accountName=accountName (required) Account name + --appId=appId (required) LUIS application Id (defaults to config:LUIS:appId) + + --armToken=armToken (required) The bearer authorization header to use; containing the user`s + ARM token used to validate azure accounts information + + --azureSubscriptionId=azureSubscriptionId (required) Azure Subscription Id + + --endpoint=endpoint LUIS endpoint hostname + + --json Display output as JSON + + --resourceGroup=resourceGroup (required) Resource Group + + --subscriptionKey=subscriptionKey (required) LUIS cognitive services subscription key (default: + config:LUIS:subscriptionKey) +``` + +_See code: [src/commands/luis/application/assignazureaccount.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/application/assignazureaccount.ts)_ + ## `bf luis:application:create` Creates a new LUIS application @@ -311,38 +339,40 @@ USAGE $ bf luis:build OPTIONS - -f, --force If --dialog flag is provided, overwirtes relevant dialog file + -f, --force If --dialog flag is provided, overwrites relevant dialog file -h, --help show CLI help -i, --in=in Lu file or folder -o, --out=out Output file or folder name. If not specified, current directory will be used as output - --authoringKey=authoringKey (required) LUIS authoring key + --authoringKey=authoringKey LUIS authoring key --botName=botName Bot name --defaultCulture=defaultCulture Culture code for the content. Infer from .lu if available. Defaults to en-us - --deleteOldVersion Delete old version of LUIS application after building new one. - - --dialog [default: multiLanguage]Write out .dialog files whose recognizer type [multiLanguage|crosstrained] is specified by --dialog + --deleteOldVersion Delete old version of LUIS application after building new one. + + --dialog=dialog [default: multiLanguage] Write out .dialog files whose recognizer type + [multiLanguage|crosstrained] is specified by --dialog --fallbackLocale=fallbackLocale Locale to be used at the fallback if no locale specific recognizer is found. Only valid if --dialog is set --log write out log messages to console - --luConfig=luConfig Path to config for lu build + --luConfig=luConfig Path to config for lu build which can contain switches for arguments --region=region [default: westus] LUIS authoring region [westus|westeurope|australiaeast] --suffix=suffix Environment name as a suffix identifier to include in LUIS app name. Defaults to - current logged in useralias + current logged in user alias EXAMPLE - $ bf luis:build --in {INPUT_FILE_OR_FOLDER} --authoringKey {AUTHORING_KEY} --botName {BOT_NAME} --dialog multiLanguage + $ bf luis:build --in {INPUT_FILE_OR_FOLDER} --authoringKey {AUTHORING_KEY} --botName {BOT_NAME} --dialog + multiLanguage ``` _See code: [src/commands/luis/build.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/build.ts)_ @@ -381,14 +411,23 @@ USAGE $ bf luis:cross-train OPTIONS - -h, --help cross-train command help - -i, --in source lu and qna files folder - -o, --out output folder name. If not specified, the cross trained files will be wrote to cross-trained folder under folder of current command - --config path to config file of mapping rules which is relative to folder specified by --in. If not specified, it will read default config.json from the folder specified by --in - --intentName Interruption intent name. Default: _Interruption + -h, --help luis:cross-train help + -i, --in=in source lu and qna files folder + + -o, --out=out output folder name. If not specified, the cross trained files will be wrote to cross-trained + folder under folder of current command + + --config=config path to config file of mapping rules which is relative to folder specified by --in. If not + specified, it will read default config.json from the folder specified by --in + + --intentName=intentName [default: _Interruption] Interruption intent name + + --rootDialog=rootDialog rootDialog file path which is relative to folder specified by --in. If --config not + specified, cross-trian will automatically construct the config from file system based on root + dialog file ``` -_See code: [src/commands/luis/cross-train.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/qnamaker/src/commands/luis/cross-train.ts)_ +_See code: [src/commands/luis/cross-train.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/cross-train.ts)_ ## `bf luis:endpoints:list` @@ -420,33 +459,6 @@ EXAMPLE _See code: [src/commands/luis/endpoints/list.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/endpoints/list.ts)_ -## `bf luis:test` - -Test a .lu file or LUIS application JSON model against a published LUIS model - -``` -USAGE - $ bf luis:test - -OPTIONS - -a, --appId=appId (required) LUIS application Id - -h, --help luis:test help - -i, --in=in Source .lu file or LUIS application JSON model for testing - -o, --out=out Output file or folder name. If not specified stdout will be used as output - -s, --subscriptionKey=subscriptionKey (required) LUIS cognitive services subscription key - --allowIntentsCount=allowIntentsCount [default: 1] Top-scoring intent or top n Intent with score to show in the result - --endpoint=endpoint [default: https://westus.api.cognitive.microsoft.com] LUIS endpoint hostname - --force If --out flag is provided with the path to an existing file, overwrites that file - --intentOnly Only test intent - --staging Presence of flag targets the staging app, if no flag passed defaults to production - -EXAMPLE - - $ bf luis:test -i {TESTDATA.lu} -o {RESULT.lu} --endpoint {ENDPOINT} --subscriptionKey {SUBSCRIPTION_KEY} --appId {APP_ID} -``` - -_See code: [src/commands/luis/test.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/test.ts)_ - ## `bf luis:generate:cs` Generate:cs generates a strongly typed C# source code from an exported (json) LUIS model. @@ -483,6 +495,37 @@ OPTIONS _See code: [src/commands/luis/generate/ts.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/generate/ts.ts)_ +## `bf luis:test` + +Test a .lu file or LUIS application JSON model against a published LUIS model + +``` +USAGE + $ bf luis:test + +OPTIONS + -a, --appId=appId (required) LUIS application Id + -h, --help luis:test help + -i, --in=in Source .lu file or LUIS application JSON model for testing + -o, --out=out Output file or folder name. If not specified stdout will be used as output + -s, --subscriptionKey=subscriptionKey (required) LUIS cognitive services subscription key + + --allowIntentsCount=allowIntentsCount [default: 1] Top-scoring intent or top n Intent with score to show in the + result + + --endpoint=endpoint [default: https://westus.api.cognitive.microsoft.com] LUIS endpoint hostname + + --force If --out flag is provided with the path to an existing file, overwrites that + file + + --intentOnly Only test intent + + --staging Presence of flag targets the staging app, if no flag passed defaults to + production +``` + +_See code: [src/commands/luis/test.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/luis/src/commands/luis/test.ts)_ + ## `bf luis:train:run` Issues asynchronous training request for LUIS application diff --git a/packages/qnamaker/README.md b/packages/qnamaker/README.md index 5d7f59c10..ca80b040c 100644 --- a/packages/qnamaker/README.md +++ b/packages/qnamaker/README.md @@ -19,6 +19,7 @@ This package is intended for Microsoft use only and should be consumed through @ * [`bf qnamaker:alterations`](#bf-qnamakeralterations) * [`bf qnamaker:alterations:list`](#bf-qnamakeralterationslist) * [`bf qnamaker:alterations:replace`](#bf-qnamakeralterationsreplace) +* [`bf qnamaker:build`](#bf-qnamakerbuild) * [`bf qnamaker:convert`](#bf-qnamakerconvert) * [`bf qnamaker:cross-train`](#bf-qnamakercross-train) * [`bf qnamaker:endpointkeys`](#bf-qnamakerendpointkeys) @@ -42,7 +43,6 @@ This package is intended for Microsoft use only and should be consumed through @ * [`bf qnamaker:query`](#bf-qnamakerquery) * [`bf qnamaker:train`](#bf-qnamakertrain) * [`bf qnamaker:translate`](#bf-qnamakertranslate) -* [`bf qnamaker:build`](#bf-qnamakerbuild) ## `bf qnamaker` @@ -111,6 +111,50 @@ OPTIONS _See code: [src/commands/qnamaker/alterations/replace.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/qnamaker/src/commands/qnamaker/alterations/replace.ts)_ +## `bf qnamaker:build` + +Build .qna files to create or update qnamaker knowledge bases and qnamaker alterations + +``` +USAGE + $ bf qnamaker:build + +OPTIONS + -b, --botName=botName (required) Bot name + -f, --force If --dialog flag is provided, overwirtes relevant dialog file + -h, --help show CLI help + -i, --in=in Source .qna file or folder + + -o, --out=out Output file or folder name. If not specified, current directory will be used as + output + + -s, --subscriptionKey=subscriptionKey (required) QnA maker subscription key + + --defaultCulture=defaultCulture Culture code for the content. Infer from .qna if available. Defaults to en-us + if not set + + --dialog=dialog [default: multiLanguage] Write out .dialog files whose recognizer type + [multiLanguage|crosstrained] is specified by --dialog + + --fallbackLocale=fallbackLocale Locale to be used at the fallback if no locale specific recognizer is found. + Only valid if --dialog is set + + --log write out log messages to console + + --region=region [default: westus] Overrides public endpoint + https://.api.cognitive.microsoft.com/qnamaker/v4.0/ + + --suffix=suffix Environment name as a suffix identifier to include in qnamaker kb name. + Defaults to current logged in user alias + +EXAMPLE + + $ bf qnamaker:build --in {INPUT_FILE_OR_FOLDER} --subscriptionKey {SUBSCRIPTION_KEY} --botName {BOT_NAME} + --dialog +``` + +_See code: [src/commands/qnamaker/build.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/qnamaker/src/commands/qnamaker/build.ts)_ + ## `bf qnamaker:convert` Converts .qna file(s) to QnA application JSON models or vice versa. @@ -142,11 +186,20 @@ USAGE $ bf qnamaker:cross-train OPTIONS - -h, --help cross-train command help - -i, --in source lu and qna files folder - -o, --out output folder name. If not specified, the cross trained files will be wrote to cross-trained folder under folder of current command - --config path to config file of mapping rules which is relative to folder specified by --in. If not specified, it will read default config.json from the folder specified by --in - --intentName Interruption intent name. Default: _Interruption + -h, --help luis:cross-train help + -i, --in=in source lu and qna files folder + + -o, --out=out output folder name. If not specified, the cross trained files will be wrote to cross-trained + folder under folder of current command + + --config=config path to config file of mapping rules which is relative to folder specified by --in. If not + specified, it will read default config.json from the folder specified by --in + + --intentName=intentName [default: _Interruption] Interruption intent name + + --rootDialog=rootDialog rootDialog file path which is relative to folder specified by --in. If --config not + specified, cross-trian will automatically construct the config from file system based on root + dialog file ``` _See code: [src/commands/qnamaker/cross-train.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/qnamaker/src/commands/qnamaker/cross-train.ts)_ @@ -351,6 +404,8 @@ OPTIONS --kbId=kbId Knowledgebase id to be exported. Overrides the knowledge base id present in the config + --qnaFormat Specifies if the content should be exported to .qna format. + --subscriptionKey=subscriptionKey Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource Management section for your Qna Maker cognitive service). Overrides the subscriptionkey value present in the config @@ -429,8 +484,12 @@ USAGE OPTIONS -h, --help qnamaker:kb:replace command help - -i, --in=in File path to the ReplaceKbDTO object to send in the body of the request + + -i, --in=in File path to the ReplaceKbDTO object to send in the body of the request. + Alternately this can be path to a .qna file + --endpoint=endpoint Overrides public endpoint https://westus.api.cognitive.microsoft.com/qnamaker/v4.0/ + --kbId=kbId Knowledgebase id. Overrides the knowledge base id present in the config --subscriptionKey=subscriptionKey Specifies the qnamaker Ocp-Apim-Subscription Key (found in Keys under Resource @@ -587,31 +646,6 @@ OPTIONS ``` _See code: [src/commands/qnamaker/translate.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/qnamaker/src/commands/qnamaker/translate.ts)_ - -## `bf qnamaker:build` - -Build .qna files to create or update qnamaker knowledge bases and qnamaker alterations - -``` -USAGE - $ bf qnamaker:build - -OPTIONS - -f, --force If --dialog flag is provided, overwirtes relevant dialog file - -h, --help qnamaker:build help - -i, --in=in Source .qna file or folder - -o, --out=out Output file or folder name. If not specified, current directory will be used as output - -b, --botName=botName (required) Bot name - --subscriptionKey=subscriptionKey (required) QnA maker subscription key - --defaultCulture=defaultCulture Culture code for the content. Infer from .qna if available. Defaults to en-us if not set - --fallbackLocale=fallbackLocale Locale to be used at the fallback if no locale specific recognizer is found. Only valid if --dialog is set - --region=region [default: westus] QnA maker api endpoint region [westus|westeurope|australiaeast] - --suffix=suffix Environment name as a suffix identifier to include in qnamaker kb name. Defaults to current logged in useralias - --dialog [default: multiLanguage]Write out .dialog files whose recognizer type [multiLanguage|crosstrained] is specified by --dialog - --log write out log messages to console -``` - -_See code: [src/commands/qnamaker/build.ts](https://github.com/microsoft/botframework-cli/tree/master/packages/qnamaker/src/commands/qnamaker/build.ts)_ [1]:./docs/qna-file-format.md diff --git a/scripts/fixurls.js b/scripts/fixurls.js index 3fa318b48..32a68205b 100644 --- a/scripts/fixurls.js +++ b/scripts/fixurls.js @@ -2,7 +2,7 @@ const path = require('path') const fs = require('fs-extra') const updateUrls = async () => { - let plugins = ['config', 'chatdown', 'dialog', 'qnamaker', 'luis', 'plugins', 'cli'] + let plugins = ['config', 'chatdown', 'dialog', 'qnamaker', 'luis', 'plugins', 'lg', 'cli'] for (let i = 0; i < plugins.length; i++) { await cleanUrls(plugins[i]) }