contensis-cli 1.0.0-beta.47 → 1.0.0-beta.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/diff.js +2 -2
- package/dist/commands/diff.js.map +2 -2
- package/dist/commands/get.js +18 -7
- package/dist/commands/get.js.map +2 -2
- package/dist/commands/list.js +8 -8
- package/dist/commands/list.js.map +2 -2
- package/dist/commands/push.js +2 -2
- package/dist/commands/push.js.map +2 -2
- package/dist/commands/release.js +2 -2
- package/dist/commands/release.js.map +2 -2
- package/dist/commands/remove.js +5 -5
- package/dist/commands/remove.js.map +2 -2
- package/dist/commands/set.js +11 -6
- package/dist/commands/set.js.map +2 -2
- package/dist/services/ContensisCliService.js +20 -0
- package/dist/services/ContensisCliService.js.map +2 -2
- package/dist/shell.js +1 -0
- package/dist/shell.js.map +2 -2
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/diff.ts +2 -0
- package/src/commands/get.ts +24 -7
- package/src/commands/list.ts +8 -7
- package/src/commands/push.ts +2 -0
- package/src/commands/release.ts +2 -0
- package/src/commands/remove.ts +7 -1
- package/src/commands/set.ts +11 -1
- package/src/services/ContensisCliService.ts +26 -0
- package/src/shell.ts +1 -0
- package/src/version.ts +1 -1
package/src/commands/get.ts
CHANGED
|
@@ -11,7 +11,7 @@ export const makeGetCommand = () => {
|
|
|
11
11
|
|
|
12
12
|
program
|
|
13
13
|
.command('version')
|
|
14
|
-
.description('
|
|
14
|
+
.description('get current Contensis version')
|
|
15
15
|
.addHelpText(
|
|
16
16
|
'after',
|
|
17
17
|
`
|
|
@@ -23,9 +23,26 @@ Example call:
|
|
|
23
23
|
await cliCommand(['get', 'version'], opts).PrintContensisVersion();
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
+
program
|
|
27
|
+
.command('project')
|
|
28
|
+
.description('get a project')
|
|
29
|
+
.argument('[projectId]', 'id of the project to get (default: current)')
|
|
30
|
+
.addHelpText(
|
|
31
|
+
'after',
|
|
32
|
+
`
|
|
33
|
+
Example call:
|
|
34
|
+
> get project website
|
|
35
|
+
`
|
|
36
|
+
)
|
|
37
|
+
.action(async (projectId: string, opts) => {
|
|
38
|
+
await cliCommand(['get', 'project', projectId], opts).PrintProject(
|
|
39
|
+
projectId
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
|
|
26
43
|
program
|
|
27
44
|
.command('model')
|
|
28
|
-
.description('
|
|
45
|
+
.description('get a content model')
|
|
29
46
|
.argument('<contentTypeId...>', 'ids of the content models to get')
|
|
30
47
|
.addHelpText(
|
|
31
48
|
'after',
|
|
@@ -43,7 +60,7 @@ Example call:
|
|
|
43
60
|
|
|
44
61
|
program
|
|
45
62
|
.command('contenttype')
|
|
46
|
-
.description('
|
|
63
|
+
.description('get a content type')
|
|
47
64
|
.argument('<contentTypeId>', 'the API id of the content type to get')
|
|
48
65
|
.addHelpText(
|
|
49
66
|
'after',
|
|
@@ -61,7 +78,7 @@ Example call:
|
|
|
61
78
|
|
|
62
79
|
program
|
|
63
80
|
.command('component')
|
|
64
|
-
.description('
|
|
81
|
+
.description('get a component')
|
|
65
82
|
.argument('<componentId>', 'the API id of the component to get')
|
|
66
83
|
.addHelpText(
|
|
67
84
|
'after',
|
|
@@ -78,7 +95,7 @@ Example call:
|
|
|
78
95
|
|
|
79
96
|
program
|
|
80
97
|
.command('entries')
|
|
81
|
-
.description('
|
|
98
|
+
.description('get entries')
|
|
82
99
|
.argument(
|
|
83
100
|
'[search phrase]',
|
|
84
101
|
'get entries with the search phrase, use quotes for multiple words'
|
|
@@ -117,7 +134,7 @@ Example call:
|
|
|
117
134
|
|
|
118
135
|
const block = program
|
|
119
136
|
.command('block')
|
|
120
|
-
.description('
|
|
137
|
+
.description('get a block or block version')
|
|
121
138
|
.argument('[blockId]', 'the block to get version details for')
|
|
122
139
|
.argument(
|
|
123
140
|
'[branch]',
|
|
@@ -152,7 +169,7 @@ Example call:
|
|
|
152
169
|
|
|
153
170
|
block
|
|
154
171
|
.command('logs')
|
|
155
|
-
.description('
|
|
172
|
+
.description('get logs for a block')
|
|
156
173
|
.argument('[blockId]', 'the block to get version logs for')
|
|
157
174
|
.argument(
|
|
158
175
|
'[branch]',
|
package/src/commands/list.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { cliCommand } from '~/services/ContensisCliService';
|
|
|
4
4
|
export const makeListCommand = () => {
|
|
5
5
|
const list = new Command()
|
|
6
6
|
.command('list')
|
|
7
|
+
.description('list command')
|
|
7
8
|
.addHelpText('after', `\n`)
|
|
8
9
|
.showHelpAfterError(true)
|
|
9
10
|
.exitOverride();
|
|
@@ -24,14 +25,14 @@ Example call:
|
|
|
24
25
|
|
|
25
26
|
list
|
|
26
27
|
.command('projects')
|
|
27
|
-
.description('
|
|
28
|
+
.description('print list of projects')
|
|
28
29
|
.action(async opts => {
|
|
29
30
|
await cliCommand(['list', 'projects'], opts).PrintProjects();
|
|
30
31
|
});
|
|
31
32
|
|
|
32
33
|
list
|
|
33
34
|
.command('models')
|
|
34
|
-
.description('
|
|
35
|
+
.description('print list of content models')
|
|
35
36
|
.addHelpText(
|
|
36
37
|
'after',
|
|
37
38
|
`
|
|
@@ -45,7 +46,7 @@ Example call:
|
|
|
45
46
|
|
|
46
47
|
list
|
|
47
48
|
.command('contenttypes')
|
|
48
|
-
.description('
|
|
49
|
+
.description('print list of content types')
|
|
49
50
|
.addHelpText(
|
|
50
51
|
'after',
|
|
51
52
|
`
|
|
@@ -59,7 +60,7 @@ Example call:
|
|
|
59
60
|
|
|
60
61
|
list
|
|
61
62
|
.command('components')
|
|
62
|
-
.description('
|
|
63
|
+
.description('print list of components')
|
|
63
64
|
.addHelpText(
|
|
64
65
|
'after',
|
|
65
66
|
`
|
|
@@ -73,7 +74,7 @@ Example call:
|
|
|
73
74
|
|
|
74
75
|
list
|
|
75
76
|
.command('blocks')
|
|
76
|
-
.description('
|
|
77
|
+
.description('print list of content blocks')
|
|
77
78
|
.addHelpText(
|
|
78
79
|
'after',
|
|
79
80
|
`
|
|
@@ -87,7 +88,7 @@ Example call:
|
|
|
87
88
|
|
|
88
89
|
list
|
|
89
90
|
.command('keys')
|
|
90
|
-
.description('
|
|
91
|
+
.description('print list of API keys')
|
|
91
92
|
.addHelpText(
|
|
92
93
|
'after',
|
|
93
94
|
`
|
|
@@ -101,7 +102,7 @@ Example call:
|
|
|
101
102
|
|
|
102
103
|
list
|
|
103
104
|
.command('webhooks')
|
|
104
|
-
.description('
|
|
105
|
+
.description('print list of webhooks')
|
|
105
106
|
.argument('[name]', 'find webhooks matching the supplied name')
|
|
106
107
|
.option('-i --id <id...>', 'the subscription id(s) to get')
|
|
107
108
|
.addHelpText('after', `\n`)
|
package/src/commands/push.ts
CHANGED
|
@@ -6,12 +6,14 @@ import { cliCommand } from '~/services/ContensisCliService';
|
|
|
6
6
|
export const makePushCommand = () => {
|
|
7
7
|
const push = new Command()
|
|
8
8
|
.command('push')
|
|
9
|
+
.description('push command')
|
|
9
10
|
.addHelpText('after', `\n`)
|
|
10
11
|
.showHelpAfterError(true)
|
|
11
12
|
.exitOverride();
|
|
12
13
|
|
|
13
14
|
push
|
|
14
15
|
.command('block')
|
|
16
|
+
.description('push a block')
|
|
15
17
|
.argument('<block-id>', 'the name of the block to push to')
|
|
16
18
|
.argument(
|
|
17
19
|
'<image uri:tag>',
|
package/src/commands/release.ts
CHANGED
|
@@ -4,12 +4,14 @@ import { cliCommand } from '~/services/ContensisCliService';
|
|
|
4
4
|
export const makeReleaseCommand = () => {
|
|
5
5
|
const release = new Command()
|
|
6
6
|
.command('release')
|
|
7
|
+
.description('release command')
|
|
7
8
|
.addHelpText('after', `\n`)
|
|
8
9
|
.showHelpAfterError(true)
|
|
9
10
|
.exitOverride();
|
|
10
11
|
|
|
11
12
|
release
|
|
12
13
|
.command('block')
|
|
14
|
+
.description('release a block version')
|
|
13
15
|
.argument('<block-id>', 'the name of the block to release')
|
|
14
16
|
.argument('<version>', 'the block version to release')
|
|
15
17
|
.usage('<block-id> <version>')
|
package/src/commands/remove.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { cliCommand } from '~/services/ContensisCliService';
|
|
3
3
|
import { shell } from '~/shell';
|
|
4
|
-
import { commit, mapContensisOpts } from './globalOptions';
|
|
4
|
+
import { commit, mapContensisOpts, zenql } from './globalOptions';
|
|
5
5
|
|
|
6
6
|
export const makeRemoveCommand = () => {
|
|
7
7
|
const remove = new Command()
|
|
8
8
|
.command('remove')
|
|
9
|
+
.description('remove command')
|
|
9
10
|
.addHelpText('after', `\n`)
|
|
10
11
|
.showHelpAfterError(true)
|
|
11
12
|
.exitOverride();
|
|
12
13
|
|
|
13
14
|
remove
|
|
14
15
|
.command('project')
|
|
16
|
+
.description('remove an entire project')
|
|
15
17
|
.argument('<projectId>', 'the project id to delete')
|
|
16
18
|
.usage('<projectId>')
|
|
17
19
|
.addHelpText('after', `\n`)
|
|
@@ -22,8 +24,10 @@ export const makeRemoveCommand = () => {
|
|
|
22
24
|
).SetProject(projectId);
|
|
23
25
|
if (project) await shell().restart();
|
|
24
26
|
});
|
|
27
|
+
|
|
25
28
|
remove
|
|
26
29
|
.command('key')
|
|
30
|
+
.description('remove api key')
|
|
27
31
|
.argument('<id>', 'the id of the API key to delete')
|
|
28
32
|
.usage('<id>')
|
|
29
33
|
.addHelpText(
|
|
@@ -39,6 +43,7 @@ Example call:
|
|
|
39
43
|
|
|
40
44
|
remove
|
|
41
45
|
.command('components')
|
|
46
|
+
.description('delete components')
|
|
42
47
|
.argument('<id...>', 'the id(s) of the components to delete')
|
|
43
48
|
.addOption(commit)
|
|
44
49
|
.usage('<id> [--commit]')
|
|
@@ -58,6 +63,7 @@ Example call:
|
|
|
58
63
|
|
|
59
64
|
remove
|
|
60
65
|
.command('contenttypes')
|
|
66
|
+
.description('delete content types')
|
|
61
67
|
.argument('<id...>', 'the id(s) of the content types to delete')
|
|
62
68
|
.addOption(commit)
|
|
63
69
|
.usage('<id> [--commit]')
|
package/src/commands/set.ts
CHANGED
|
@@ -5,15 +5,22 @@ import { shell } from '~/shell';
|
|
|
5
5
|
export const makeSetCommand = () => {
|
|
6
6
|
const set = new Command()
|
|
7
7
|
.command('set')
|
|
8
|
+
.description('set command')
|
|
8
9
|
.addHelpText('after', `\n`)
|
|
9
10
|
.showHelpAfterError(true)
|
|
10
11
|
.exitOverride();
|
|
11
12
|
|
|
12
13
|
const project = set
|
|
13
14
|
.command('project')
|
|
15
|
+
.description('set current working project')
|
|
14
16
|
.argument('<projectId>', 'the project id to work with')
|
|
15
17
|
.usage('<projectId>')
|
|
16
|
-
.addHelpText(
|
|
18
|
+
.addHelpText(
|
|
19
|
+
'after',
|
|
20
|
+
`
|
|
21
|
+
Example call:
|
|
22
|
+
> set project website\n`
|
|
23
|
+
)
|
|
17
24
|
.action(async projectId => {
|
|
18
25
|
const nextProjectId = cliCommand([
|
|
19
26
|
'set',
|
|
@@ -25,6 +32,7 @@ export const makeSetCommand = () => {
|
|
|
25
32
|
|
|
26
33
|
project
|
|
27
34
|
.command('name')
|
|
35
|
+
.description('update project name')
|
|
28
36
|
.argument('<"Project name">', 'update the current project name')
|
|
29
37
|
.usage('<"Project name">')
|
|
30
38
|
.addHelpText(
|
|
@@ -45,6 +53,7 @@ Example call:
|
|
|
45
53
|
|
|
46
54
|
project
|
|
47
55
|
.command('description')
|
|
56
|
+
.description('update project description')
|
|
48
57
|
.argument(
|
|
49
58
|
'<"Project description">',
|
|
50
59
|
'update the current project description'
|
|
@@ -68,6 +77,7 @@ Example call:
|
|
|
68
77
|
|
|
69
78
|
set
|
|
70
79
|
.command('version')
|
|
80
|
+
.description('set content version')
|
|
71
81
|
.addArgument(
|
|
72
82
|
new Argument('<versionStatus>', 'content version status')
|
|
73
83
|
.choices(['latest', 'published'])
|
|
@@ -643,6 +643,32 @@ class ContensisCli {
|
|
|
643
643
|
}
|
|
644
644
|
};
|
|
645
645
|
|
|
646
|
+
PrintProject = async (projectId = this.currentProject) => {
|
|
647
|
+
const { log, messages, session } = this;
|
|
648
|
+
const contensis = await this.ConnectContensis();
|
|
649
|
+
|
|
650
|
+
if (contensis) {
|
|
651
|
+
// Retrieve projects list for env
|
|
652
|
+
const [projectsErr, projects] = await to(
|
|
653
|
+
contensis.projects.GetSourceProjects()
|
|
654
|
+
);
|
|
655
|
+
|
|
656
|
+
const foundProject = projects?.find(
|
|
657
|
+
p => p.id.toLowerCase() === projectId.toLowerCase()
|
|
658
|
+
);
|
|
659
|
+
|
|
660
|
+
if (foundProject) {
|
|
661
|
+
log.raw('');
|
|
662
|
+
this.HandleFormattingAndOutput(foundProject, log.object);
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
if (projectsErr) {
|
|
666
|
+
log.error(messages.projects.noList());
|
|
667
|
+
log.error(projectsErr.message);
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
};
|
|
671
|
+
|
|
646
672
|
SetProject = (projectId = 'website') => {
|
|
647
673
|
const { env, log, messages, session } = this;
|
|
648
674
|
let nextProjectId: string | undefined;
|
package/src/shell.ts
CHANGED
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION = "1.0.0-beta.
|
|
1
|
+
export const LIB_VERSION = "1.0.0-beta.48";
|