contensis-cli 1.3.1-beta.1 → 1.3.1-beta.3
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/copy.js +1 -1
- package/dist/commands/copy.js.map +2 -2
- package/dist/commands/globalOptions.js +10 -2
- package/dist/commands/globalOptions.js.map +2 -2
- package/dist/commands/import.js +1 -1
- package/dist/commands/import.js.map +2 -2
- package/dist/services/ContensisCliService.js +26 -22
- package/dist/services/ContensisCliService.js.map +2 -2
- package/dist/shell.js +16 -8
- 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/copy.ts +2 -0
- package/src/commands/globalOptions.ts +7 -1
- package/src/commands/import.ts +2 -0
- package/src/services/ContensisCliService.ts +107 -84
- package/src/shell.ts +16 -8
- package/src/version.ts +1 -1
package/src/shell.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { LIB_VERSION } from './version';
|
|
|
14
14
|
class ContensisShell {
|
|
15
15
|
private currentEnvironment!: string;
|
|
16
16
|
private emptyInputCounter: number = 0;
|
|
17
|
+
private cache!: SessionCache;
|
|
17
18
|
private env!: EnvironmentCache;
|
|
18
19
|
private firstStart = true;
|
|
19
20
|
private userId: string = '';
|
|
@@ -22,12 +23,12 @@ class ContensisShell {
|
|
|
22
23
|
|
|
23
24
|
private refreshEnvironment = () => {
|
|
24
25
|
// Reload any persisted changes from the disk cache
|
|
25
|
-
const {
|
|
26
|
-
|
|
27
|
-
} = new ContensisCli([]);
|
|
26
|
+
const { cache } = new ContensisCli([]);
|
|
27
|
+
this.cache = cache; // read the cache to pre-load suggestions
|
|
28
28
|
// console.log(`refreshing env w/${currentEnvironment}`);
|
|
29
|
-
this.currentEnvironment = currentEnvironment;
|
|
30
|
-
|
|
29
|
+
this.currentEnvironment = cache.currentEnvironment || '';
|
|
30
|
+
const environments = cache.environments || {};
|
|
31
|
+
this.env = environments[this.currentEnvironment];
|
|
31
32
|
|
|
32
33
|
// Reload logging here to support changing language
|
|
33
34
|
Logging('en-GB').then(({ messages, Log }) => {
|
|
@@ -128,12 +129,20 @@ class ContensisShell {
|
|
|
128
129
|
},
|
|
129
130
|
},
|
|
130
131
|
'connect',
|
|
132
|
+
...Object.keys(this.cache.environments || {}).map(
|
|
133
|
+
alias => `connect ${alias}`
|
|
134
|
+
),
|
|
131
135
|
'list envs',
|
|
132
136
|
'quit',
|
|
133
137
|
];
|
|
134
138
|
|
|
135
139
|
if (currentEnvironment)
|
|
136
|
-
availableCommands.push(
|
|
140
|
+
availableCommands.push(
|
|
141
|
+
'login',
|
|
142
|
+
'list projects',
|
|
143
|
+
'set project',
|
|
144
|
+
...(this.env.projects || []).map(project => `set project ${project}`)
|
|
145
|
+
);
|
|
137
146
|
if (userId)
|
|
138
147
|
availableCommands.push(
|
|
139
148
|
'copy field',
|
|
@@ -243,9 +252,8 @@ class ContensisShell {
|
|
|
243
252
|
: JSON.stringify(ex, null, 2)
|
|
244
253
|
}`
|
|
245
254
|
);
|
|
246
|
-
} finally {
|
|
247
|
-
return this.contensisPrompt();
|
|
248
255
|
}
|
|
256
|
+
return this.contensisPrompt();
|
|
249
257
|
}
|
|
250
258
|
})
|
|
251
259
|
.catch((err: Error) => {
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION = "1.3.1-beta.
|
|
1
|
+
export const LIB_VERSION = "1.3.1-beta.3";
|