-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathpromote.js
38 lines (31 loc) · 1 KB
/
promote.js
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
26
27
28
29
30
31
32
33
34
35
36
37
38
'use strict';
const { Args } = require('@oclif/core');
const BoxCommand = require('../../../box-command');
class FilesPromoteVersionsCommand extends BoxCommand {
async run() {
const { args } = await this.parse(FilesPromoteVersionsCommand);
let version = await this.client.files.promoteVersion(args.fileID, args.fileVersionID);
await this.output(version);
}
}
FilesPromoteVersionsCommand.description = 'Promote a file version';
FilesPromoteVersionsCommand.examples = ['box files:versions:promote 11111 55555'];
FilesPromoteVersionsCommand._endpoint = 'post_files_id_versions_current';
FilesPromoteVersionsCommand.flags = {
...BoxCommand.flags
};
FilesPromoteVersionsCommand.args = {
fileID: Args.string({
name: 'fileID',
required: true,
hidden: false,
description: 'ID of the file to get versions for'
}),
fileVersionID: Args.string({
name: 'fileVersionID',
required: true,
hidden: false,
description: 'ID of the file version to delete'
}),
};
module.exports = FilesPromoteVersionsCommand;