-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathupdate.ts
More file actions
25 lines (20 loc) · 837 Bytes
/
update.ts
File metadata and controls
25 lines (20 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { AppSettingsRequest, AppSettingsResponse } from '@smartthings/core-sdk'
import { APICommand, inputAndOutputItem } from '@smartthings/cli-lib'
import { buildTableOutput, chooseApp } from '../../../lib/commands/apps-util'
export default class AppSettingsUpdateCommand extends APICommand<typeof AppSettingsUpdateCommand.flags> {
static description = 'update the settings of the app'
static flags = {
...APICommand.flags,
...inputAndOutputItem.flags,
}
static args = [{
name: 'id',
description: 'the app id',
}]
async run(): Promise<void> {
const appId = await chooseApp(this, this.args.id)
await inputAndOutputItem(this,
{ buildTableOutput: (data: AppSettingsResponse) => buildTableOutput(this.tableGenerator, data) },
(_, data: AppSettingsRequest) => this.client.apps.updateSettings(appId, data))
}
}