@contrail/cli 2.2.7 → 2.3.0
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/README.md +135 -367
- package/dist/api/apps.js +1 -2
- package/dist/auth/auth.js +1 -0
- package/dist/basecommand.js +16 -19
- package/dist/commands/app/create.js +5 -5
- package/dist/commands/app/delete.js +7 -7
- package/dist/commands/app/getApiKey.js +8 -8
- package/dist/commands/app/init.js +5 -5
- package/dist/commands/app/install.js +24 -24
- package/dist/commands/app/publish.js +24 -24
- package/dist/commands/app/uninstall.js +14 -14
- package/dist/commands/app/upgrade.js +19 -19
- package/dist/commands/app/version/major.js +6 -9
- package/dist/commands/app/version/minor.js +6 -9
- package/dist/commands/app/version/patch.js +6 -9
- package/dist/commands/colors/deleteAll.js +5 -5
- package/dist/commands/colors/load.js +5 -5
- package/dist/commands/config/environments/list.js +6 -9
- package/dist/commands/config/environments/remove.js +12 -15
- package/dist/commands/config/environments/set.js +11 -14
- package/dist/commands/config/list.js +6 -9
- package/dist/commands/config/remove.js +16 -19
- package/dist/commands/config/set.js +22 -25
- package/dist/commands/groups/export.js +21 -22
- package/dist/commands/groups/upload.js +10 -11
- package/dist/commands/instance/export.js +19 -19
- package/dist/commands/instance/import.js +13 -13
- package/dist/commands/loader-process/load.js +12 -12
- package/dist/commands/loader-process/upload-and-load.js +17 -17
- package/dist/commands/projects/export.js +9 -9
- package/dist/commands/projects/list.js +5 -5
- package/dist/commands/projects/load.js +16 -17
- package/dist/commands/types/exportOptionSetHierarchies.js +5 -5
- package/dist/commands/types/getAll.js +73 -72
- package/dist/commands/types/loadAll.js +13 -13
- package/dist/commands/types/mergeOptionSets.js +9 -10
- package/dist/commands/types/mergeTypeProperties.js +11 -11
- package/dist/commands/types/parseOptionSetsHierarchyLocalFile.js +9 -9
- package/dist/commands/types/parseOptionSetsHierarchyValuesToKeysLocalFile.js +9 -9
- package/dist/commands/types/parseOptionSetsLocalFiles.d.ts +21 -0
- package/dist/commands/types/parseOptionSetsLocalFiles.js +95 -17
- package/dist/commands/types/parseOptionSetsToFolderStructure.d.ts +0 -1
- package/dist/commands/types/parseOptionSetsToFolderStructure.js +5 -41
- package/dist/commands/types/parseTypesFromFiles.js +13 -13
- package/dist/commands/types/parseTypesFromLocalFiles.js +10 -10
- package/dist/commands/types/parseTypesFromTemplateAndDataFromLocalFiles.js +10 -10
- package/dist/commands/types/parseTypesFromTemplateFromLocalFiles.js +9 -9
- package/dist/commands/types/uploadOptionSetHierarchies.js +15 -16
- package/dist/commands/types/uploadOptionSets.js +15 -13
- package/dist/commands/types/uploadOptionSetsHierarchyLocalFile.js +13 -13
- package/dist/commands/types/uploadRuleSets.js +13 -13
- package/dist/commands/types/uploadTypePolicies.js +16 -16
- package/dist/commands/types/uploadTypePropertyPolicies.js +16 -16
- package/dist/commands/types/uploadTypes.js +13 -13
- package/dist/commands/types/uploadUsageInfo.js +13 -13
- package/dist/commands/users/export.js +19 -20
- package/dist/commands/users/upload.js +8 -8
- package/dist/commands/webhooks/create.js +5 -5
- package/dist/commands/webhooks/delete.js +11 -11
- package/dist/commands/webhooks/getWebhookTrigger.js +5 -5
- package/dist/commands/webhooks/list.js +11 -11
- package/dist/commands/workflow-template-definitions/install.js +5 -5
- package/dist/commands/workflow-template-definitions/list.js +5 -5
- package/dist/commands/workflow-templates/delete.js +5 -5
- package/dist/commands/workflow-templates/export.js +19 -20
- package/dist/commands/workflow-templates/list.js +5 -5
- package/dist/commands/workflow-templates/load.js +11 -11
- package/dist/helpers/app/actions-deployer.js +4 -4
- package/dist/helpers/app/app-deployer.js +9 -9
- package/dist/helpers/app/app-template-parsers.js +1 -1
- package/dist/helpers/app/extensions-deployer.js +5 -6
- package/dist/helpers/app/load-app-config.js +1 -1
- package/dist/helpers/loader-process/helpers.js +3 -3
- package/dist/helpers/projects/helpers.js +5 -5
- package/dist/helpers/types/type-parser.js +8 -8
- package/dist/helpers/types/type-uploader.d.ts +17 -0
- package/dist/helpers/types/type-uploader.js +139 -92
- package/dist/helpers/types/type-uploader.spec.d.ts +1 -0
- package/dist/helpers/types/type-uploader.spec.js +119 -0
- package/dist/helpers/workflow-template-definitions/workflow-template-definition-deployer.js +3 -4
- package/dist/helpers/workflow-templates/helper.js +11 -16
- package/dist/interface-converters.js +1 -2
- package/dist/interfaces.js +79 -0
- package/dist/logger.js +7 -6
- package/oclif.manifest.json +60 -1422
- package/package.json +1 -1
|
@@ -56,15 +56,14 @@ class LocalWorkflowTemplateDeployer {
|
|
|
56
56
|
return newWorkflowTemplate;
|
|
57
57
|
}
|
|
58
58
|
async populateActionIds(workflowTemplate, workflowKey, appIdentifier) {
|
|
59
|
-
var _a;
|
|
60
59
|
const installedApps = await (0, apps_1.getInstalledApps)();
|
|
61
60
|
const appOrg = installedApps.find((x) => x.app.identifier === appIdentifier);
|
|
62
61
|
logger_1.default.info('workflow template:', JSON.stringify(workflowTemplate, null, 2));
|
|
63
|
-
if (!
|
|
62
|
+
if (!workflowTemplate?.workflowDefinition?.paths) {
|
|
64
63
|
return;
|
|
65
64
|
}
|
|
66
65
|
for (const path of workflowTemplate.workflowDefinition.paths) {
|
|
67
|
-
if (!
|
|
66
|
+
if (!path?.actionDefinitionConfigs) {
|
|
68
67
|
continue;
|
|
69
68
|
}
|
|
70
69
|
for (const actionConfiguration of path.actionDefinitionConfigs) {
|
|
@@ -89,8 +88,7 @@ class LocalWorkflowTemplateDeployer {
|
|
|
89
88
|
}
|
|
90
89
|
}
|
|
91
90
|
async createWorkflowSchedule(workflowTemplate, workflowId) {
|
|
92
|
-
|
|
93
|
-
if (!((_a = workflowTemplate === null || workflowTemplate === void 0 ? void 0 : workflowTemplate.crons) === null || _a === void 0 ? void 0 : _a.length) || !workflowTemplate.id) {
|
|
91
|
+
if (!workflowTemplate?.crons?.length || !workflowTemplate.id) {
|
|
94
92
|
return;
|
|
95
93
|
}
|
|
96
94
|
const crons = [];
|
|
@@ -111,11 +109,10 @@ class LocalWorkflowTemplateDeployer {
|
|
|
111
109
|
return crons;
|
|
112
110
|
}
|
|
113
111
|
async updateWorkflowSchedule(workflowTemplate, workflowId) {
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
const
|
|
117
|
-
const
|
|
118
|
-
const newCronNames = (_d = newSchedules.map((x) => x.name)) !== null && _d !== void 0 ? _d : [];
|
|
112
|
+
const existingSchedules = (await (0, schedules_1.getExistingSchedules)()).filter((x) => x?.ownerReference === `event-workflow-template:${workflowId}`) ?? [];
|
|
113
|
+
const newSchedules = workflowTemplate?.crons ?? [];
|
|
114
|
+
const existingCronNames = existingSchedules.map((x) => x.name) ?? [];
|
|
115
|
+
const newCronNames = newSchedules.map((x) => x.name) ?? [];
|
|
119
116
|
const cronsToAdd = newSchedules.filter((x) => !existingCronNames.includes(x.name));
|
|
120
117
|
const cronsToRemove = existingSchedules.filter((x) => !newCronNames.includes(x.name));
|
|
121
118
|
const cronsToEdit = existingSchedules.filter((x) => newCronNames.includes(x.name));
|
|
@@ -157,15 +154,14 @@ class LocalWorkflowTemplateDeployer {
|
|
|
157
154
|
}
|
|
158
155
|
}
|
|
159
156
|
async updateWorkflowTemplate(workflowKey, existingWorkflowTemplate, workflowTemplate, appIdentifier) {
|
|
160
|
-
var _a, _b;
|
|
161
157
|
await this.populateActionIds(workflowTemplate, workflowKey, appIdentifier);
|
|
162
158
|
const updates = Object.assign(new Object(), {
|
|
163
159
|
name: workflowTemplate.name,
|
|
164
160
|
triggerKey: workflowTemplate.triggerKey,
|
|
165
161
|
builtIn: workflowTemplate.builtIn,
|
|
166
162
|
workflowDefinition: workflowTemplate.workflowDefinition,
|
|
167
|
-
messageGroupId:
|
|
168
|
-
parallelWorkerCount:
|
|
163
|
+
messageGroupId: workflowTemplate.messageGroupId ?? existingWorkflowTemplate.messageGroupId,
|
|
164
|
+
parallelWorkerCount: workflowTemplate.parallelWorkerCount ?? existingWorkflowTemplate.parallelWorkerCount,
|
|
169
165
|
});
|
|
170
166
|
const updatedWorkflowTemplate = await (0, event_workflow_templates_1.updateWorkflowTemplate)({
|
|
171
167
|
id: existingWorkflowTemplate.id,
|
|
@@ -265,12 +261,11 @@ function loadTemplateConfig(saveFile) {
|
|
|
265
261
|
}
|
|
266
262
|
}
|
|
267
263
|
async function populateActionIdentifiers(workflowTemplate) {
|
|
268
|
-
|
|
269
|
-
if (!((_a = workflowTemplate === null || workflowTemplate === void 0 ? void 0 : workflowTemplate.workflowDefinition) === null || _a === void 0 ? void 0 : _a.paths)) {
|
|
264
|
+
if (!workflowTemplate?.workflowDefinition?.paths) {
|
|
270
265
|
return;
|
|
271
266
|
}
|
|
272
267
|
for (const path of workflowTemplate.workflowDefinition.paths) {
|
|
273
|
-
if (!
|
|
268
|
+
if (!path?.actionDefinitionConfigs) {
|
|
274
269
|
continue;
|
|
275
270
|
}
|
|
276
271
|
for (const actionConfiguration of path.actionDefinitionConfigs) {
|
|
@@ -4,8 +4,7 @@ exports.convertWorkflow = exports.DEFAULT_WORKFLOW_PARALLELISM = void 0;
|
|
|
4
4
|
exports.DEFAULT_WORKFLOW_PARALLELISM = 1;
|
|
5
5
|
// parses the user-facing interface of the workflow and converts it to the cloud-facing format in-place.
|
|
6
6
|
function convertWorkflow(workflow) {
|
|
7
|
-
|
|
8
|
-
workflow.parallelWorkerCount = (_a = workflow.parallelism) !== null && _a !== void 0 ? _a : exports.DEFAULT_WORKFLOW_PARALLELISM;
|
|
7
|
+
workflow.parallelWorkerCount = workflow.parallelism ?? exports.DEFAULT_WORKFLOW_PARALLELISM;
|
|
9
8
|
workflow.messageGroupId = workflow.groupId;
|
|
10
9
|
}
|
|
11
10
|
exports.convertWorkflow = convertWorkflow;
|
package/dist/interfaces.js
CHANGED
|
@@ -24,15 +24,52 @@ var AppRuntime;
|
|
|
24
24
|
AppRuntime["NODE"] = "NODE";
|
|
25
25
|
})(AppRuntime = exports.AppRuntime || (exports.AppRuntime = {}));
|
|
26
26
|
class AppVersion {
|
|
27
|
+
id;
|
|
28
|
+
createdOn;
|
|
29
|
+
updatedOn;
|
|
30
|
+
createdById;
|
|
31
|
+
updatedById;
|
|
32
|
+
createdBy;
|
|
33
|
+
updatedBy;
|
|
34
|
+
orgId;
|
|
35
|
+
appId;
|
|
36
|
+
app;
|
|
37
|
+
appOrgs;
|
|
38
|
+
versionNumber;
|
|
39
|
+
status;
|
|
40
|
+
eventWorkflowTriggerKeyMapping;
|
|
41
|
+
configProperties;
|
|
42
|
+
triggerKeyDefinitions;
|
|
43
|
+
dockerImageRef;
|
|
44
|
+
appRuntime;
|
|
27
45
|
}
|
|
28
46
|
exports.AppVersion = AppVersion;
|
|
29
47
|
class AppApiKey {
|
|
48
|
+
id;
|
|
49
|
+
createdOn;
|
|
50
|
+
updatedOn;
|
|
51
|
+
createdById;
|
|
52
|
+
updatedById;
|
|
53
|
+
createdBy;
|
|
54
|
+
updatedBy;
|
|
55
|
+
orgId;
|
|
56
|
+
appOrgId;
|
|
57
|
+
appOrg;
|
|
58
|
+
apiKey;
|
|
30
59
|
}
|
|
31
60
|
exports.AppApiKey = AppApiKey;
|
|
32
61
|
class ConfigProperty {
|
|
62
|
+
slug;
|
|
63
|
+
propertyType;
|
|
64
|
+
options;
|
|
65
|
+
label;
|
|
33
66
|
}
|
|
34
67
|
exports.ConfigProperty = ConfigProperty;
|
|
35
68
|
class TriggerKeyDefinition {
|
|
69
|
+
name;
|
|
70
|
+
description;
|
|
71
|
+
triggerKey;
|
|
72
|
+
external;
|
|
36
73
|
}
|
|
37
74
|
exports.TriggerKeyDefinition = TriggerKeyDefinition;
|
|
38
75
|
class CommonConfiguration {
|
|
@@ -46,23 +83,65 @@ var AssortmentType;
|
|
|
46
83
|
AssortmentType["SHOWCASE"] = "SHOWCASE";
|
|
47
84
|
})(AssortmentType = exports.AssortmentType || (exports.AssortmentType = {}));
|
|
48
85
|
class AssortmentConfiguration {
|
|
86
|
+
identifier;
|
|
87
|
+
name;
|
|
88
|
+
type;
|
|
89
|
+
sourceAssortmentIdentifier;
|
|
90
|
+
composedFromAssortmentIdentifiers;
|
|
91
|
+
ownerAtts;
|
|
92
|
+
assortmentAtts;
|
|
49
93
|
}
|
|
50
94
|
exports.AssortmentConfiguration = AssortmentConfiguration;
|
|
51
95
|
class Folder {
|
|
96
|
+
identifier;
|
|
97
|
+
name;
|
|
98
|
+
principals;
|
|
99
|
+
assortments;
|
|
100
|
+
subFolders;
|
|
52
101
|
}
|
|
53
102
|
exports.Folder = Folder;
|
|
54
103
|
class ProjectConfiguration {
|
|
104
|
+
projectName;
|
|
105
|
+
identifier;
|
|
106
|
+
commonConfig;
|
|
107
|
+
principals;
|
|
108
|
+
assortments;
|
|
109
|
+
subFolders;
|
|
55
110
|
}
|
|
56
111
|
exports.ProjectConfiguration = ProjectConfiguration;
|
|
57
112
|
class ProjectConfigurationTemplate {
|
|
113
|
+
projectName;
|
|
114
|
+
identifier;
|
|
115
|
+
commonConfig;
|
|
116
|
+
principals;
|
|
117
|
+
allFolders;
|
|
118
|
+
allAssortments;
|
|
119
|
+
allAssortmentRelationships;
|
|
58
120
|
}
|
|
59
121
|
exports.ProjectConfigurationTemplate = ProjectConfigurationTemplate;
|
|
60
122
|
class FolderSlim {
|
|
123
|
+
identifier;
|
|
124
|
+
name;
|
|
125
|
+
principals;
|
|
126
|
+
folderIdentifier;
|
|
61
127
|
}
|
|
62
128
|
exports.FolderSlim = FolderSlim;
|
|
63
129
|
class AssortmentConfigurationSlim {
|
|
130
|
+
identifier;
|
|
131
|
+
name;
|
|
132
|
+
type;
|
|
133
|
+
folderIdentifier;
|
|
134
|
+
sourceAssortmentIdentifier;
|
|
135
|
+
composedFromAssortmentIdentifiers;
|
|
136
|
+
ownerAtts;
|
|
137
|
+
assortmentAtts;
|
|
64
138
|
}
|
|
65
139
|
exports.AssortmentConfigurationSlim = AssortmentConfigurationSlim;
|
|
66
140
|
class AssortmentConfigurationRelationships {
|
|
141
|
+
identifier;
|
|
142
|
+
sourceAssortmentIdentifier;
|
|
143
|
+
composedFromAssortmentIdentifiers;
|
|
144
|
+
ownerAtts;
|
|
145
|
+
assortmentAtts;
|
|
67
146
|
}
|
|
68
147
|
exports.AssortmentConfigurationRelationships = AssortmentConfigurationRelationships;
|
package/dist/logger.js
CHANGED
|
@@ -4,13 +4,14 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const winston_1 = tslib_1.__importStar(require("winston"));
|
|
5
5
|
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
6
6
|
class Logger {
|
|
7
|
+
logger;
|
|
8
|
+
colors = {
|
|
9
|
+
error: 'red',
|
|
10
|
+
warn: 'yellow',
|
|
11
|
+
info: 'green',
|
|
12
|
+
debug: 'blue',
|
|
13
|
+
};
|
|
7
14
|
constructor() {
|
|
8
|
-
this.colors = {
|
|
9
|
-
error: 'red',
|
|
10
|
-
warn: 'yellow',
|
|
11
|
-
info: 'green',
|
|
12
|
-
debug: 'blue',
|
|
13
|
-
};
|
|
14
15
|
const transport = new winston_1.transports.Console();
|
|
15
16
|
winston_1.default.addColors(this.colors);
|
|
16
17
|
this.logger = (0, winston_1.createLogger)({
|