Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/botframework-cli-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pr:
jobs:
- job: CLI
variables:
buildVersion: '4.9.0-RC4'
buildVersion: '4.9.0-RC5'
_version: ${{coalesce(variables.version, variables.buildVersion)}}

steps:
Expand Down
2 changes: 1 addition & 1 deletion build/botframework-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pr:
jobs:
- job: CLI
variables:
buildVersion: '4.9.0-RC4'
buildVersion: '4.9.0-RC5'
_version: ${{coalesce(variables.version, variables.buildVersion)}}

steps:
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ USAGE
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.
-i, --in=in (required) 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.
Expand All @@ -413,7 +413,7 @@ USAGE
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.
-i, --in=in (required) 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.
Expand All @@ -436,7 +436,7 @@ USAGE
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.
-i, --in=in (required) 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)
```
Expand Down
6 changes: 3 additions & 3 deletions packages/lg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ USAGE
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.
-i, --in=in (required) 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.
Expand All @@ -66,7 +66,7 @@ USAGE
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.
-i, --in=in (required) 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.
Expand All @@ -89,7 +89,7 @@ USAGE
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.
-i, --in=in (required) 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)
```
Expand Down
2 changes: 1 addition & 1 deletion packages/lg/src/commands/lg/expand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class ExpandCommand extends Command {
private readonly TempTemplateName = '__temp__'

static flags: flags.Input<any> = {
in: flags.string({char: 'i', description: '.lg file or folder that contains .lg file.', required: true}),
in: flags.string({char: 'i', description: 'Folder that contains .lg file.', required: true}),
recurse: flags.boolean({char: 'r', description: 'Consider sub-folders to find .lg file(s)'}),
out: flags.string({char: 'o', description: 'Output file or folder name. If not specified stdout will be used as output'}),
force: flags.boolean({char: 'f', description: 'If --out flag is provided with the path to an existing file, overwrites that file'}),
Expand Down
2 changes: 1 addition & 1 deletion packages/lg/src/commands/lg/translate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class TranslateCommand extends Command {
private readonly ExpressionRegex = /(?<!\\)\$\{(('[^'\r\n]*')|("[^"\r\n]*")|(`(\\`|[^`])*`)|([^\r\n{}'"`]))+\}?/g

static flags: flags.Input<any> = {
in: flags.string({char: 'i', description: '.lg file or folder that contains .lg file.', required: true}),
in: flags.string({char: 'i', description: 'Folder that contains .lg file.', required: true}),
tgtlang: flags.string({description: 'Comma separated list of target languages.', required: true}),
translatekey: flags.string({description: 'Machine translation endpoint key.', required: true}),
recurse: flags.boolean({char: 'r', description: 'Consider sub-folders to find .lg file(s)'}),
Expand Down
2 changes: 1 addition & 1 deletion packages/lg/src/commands/lg/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class VerifyCommand extends Command {
static description = 'Verify .lg file(s) and collate them into a single file.'

static flags: flags.Input<any> = {
in: flags.string({char: 'i', description: '.lg file or folder that contains .lg file.', required: true}),
in: flags.string({char: 'i', description: 'Folder that contains .lg file.', required: true}),
recurse: flags.boolean({char: 'r', description: 'Considere sub-folders to find .lg file(s)'}),
out: flags.string({char: 'o', description: 'Output file or folder name. If not specified stdout will be used as output'}),
force: flags.boolean({char: 'f', description: 'If --out flag is provided with the path to an existing file, overwrites that file'}),
Expand Down
26 changes: 18 additions & 8 deletions packages/luis/src/commands/luis/version/clone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import {CLIError, Command, flags} from '@microsoft/bf-cli-command'
import fetch from 'node-fetch'

const utils = require('../../../utils/index')

Expand Down Expand Up @@ -34,16 +35,25 @@ export default class LuisVersionClone extends Command {
const requiredProps = {appId, endpoint, subscriptionKey, versionId, targetVersionId}
utils.validateRequiredProps(requiredProps)

const client = utils.getLUISClient(subscriptionKey, endpoint)
const options = {
versionCloneObject: {
version: targetVersionId
try {
let url = endpoint + '/luis/authoring/v3.0-preview/apps/' + appId + '/versions/' + flags.versionId + '/clone'
const headers = {
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': subscriptionKey
}
}

try {
const latestVersion = await client.versions.clone(appId, versionId, options)
const output = flags.json ? JSON.stringify({Status: 'Success', version: latestVersion}, null, 2) : `App successfully cloned. Latest version is now: ${latestVersion}`
const data = {
version: flags.targetVersionId
}

const response = await fetch(url, {method: 'POST', headers, body: JSON.stringify(data)})
const messageData = await response.json()

if (messageData.error) {
throw new CLIError(messageData.error.message)
}

const output = flags.json ? JSON.stringify({Status: 'Success', version: messageData}, null, 2) : `App successfully cloned. Latest version is now: ${messageData}`
this.log(output)
} catch (err) {
throw new CLIError(`Failed to clone app: ${err}`)
Expand Down