@contrail/cli 3.3.2 → 3.4.0-alpha
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 +150 -1
- package/dist/api/types.d.ts +35 -0
- package/dist/api/types.js +47 -1
- package/dist/basecommand.d.ts +3 -1
- package/dist/basecommand.js +1 -1
- package/dist/commands/entities/create.d.ts +37 -0
- package/dist/commands/entities/create.js +555 -0
- package/dist/commands/entities/create.spec.d.ts +1 -0
- package/dist/commands/entities/create.spec.js +514 -0
- package/dist/commands/entities/delete.d.ts +16 -0
- package/dist/commands/entities/delete.js +118 -0
- package/dist/commands/entities/get.d.ts +20 -0
- package/dist/commands/entities/get.js +204 -0
- package/dist/commands/entities/update.d.ts +18 -0
- package/dist/commands/entities/update.js +116 -0
- package/dist/common.d.ts +1 -1
- package/dist/helpers/app/app-deployer.js +4 -8
- package/dist/helpers/entities/assortment-items.d.ts +10 -0
- package/dist/helpers/entities/assortment-items.js +84 -0
- package/dist/helpers/entities/batchFetch.d.ts +8 -0
- package/dist/helpers/entities/batchFetch.js +41 -0
- package/dist/helpers/entities/index.d.ts +3 -0
- package/dist/helpers/entities/index.js +6 -0
- package/dist/helpers/entities/items.d.ts +10 -0
- package/dist/helpers/entities/items.js +102 -0
- package/dist/helpers/entities/project-items.d.ts +3 -0
- package/dist/helpers/entities/project-items.js +65 -0
- package/dist/helpers/file-helpers.d.ts +1 -0
- package/dist/helpers/file-helpers.js +19 -1
- package/dist/helpers/propertySpecifications/dateRanges.d.ts +38 -0
- package/dist/helpers/propertySpecifications/dateRanges.js +89 -0
- package/dist/helpers/propertySpecifications/dateRanges.spec.d.ts +1 -0
- package/dist/helpers/propertySpecifications/dateRanges.spec.js +95 -0
- package/dist/helpers/propertySpecifications/propertySpecifications.d.ts +27 -0
- package/dist/helpers/propertySpecifications/propertySpecifications.js +70 -0
- package/dist/helpers/propertySpecifications/propertySpecifications.spec.d.ts +1 -0
- package/dist/helpers/propertySpecifications/propertySpecifications.spec.js +266 -0
- package/dist/helpers/types/type-uploader.js +0 -2
- package/dist/interfaces.d.ts +0 -1
- package/oclif.manifest.json +361 -1
- package/package.json +6 -5
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const propertySpecifications_1 = require("./propertySpecifications");
|
|
4
|
+
describe('parsePropertySpecification', () => {
|
|
5
|
+
it('should parse a valid property specification', () => {
|
|
6
|
+
const spec = 'name=john';
|
|
7
|
+
const result = (0, propertySpecifications_1.parsePropertySpecification)(spec);
|
|
8
|
+
expect(result).toEqual({
|
|
9
|
+
slug: 'name',
|
|
10
|
+
value: 'john',
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
it('should parse property specification with numeric value', () => {
|
|
14
|
+
const spec = 'id=123';
|
|
15
|
+
const result = (0, propertySpecifications_1.parsePropertySpecification)(spec);
|
|
16
|
+
expect(result).toEqual({
|
|
17
|
+
slug: 'id',
|
|
18
|
+
value: '123',
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
it('should parse property specification with hex color value', () => {
|
|
22
|
+
const spec = 'hex=000000';
|
|
23
|
+
const result = (0, propertySpecifications_1.parsePropertySpecification)(spec);
|
|
24
|
+
expect(result).toEqual({
|
|
25
|
+
slug: 'hex',
|
|
26
|
+
value: '000000',
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
it('should parse property specification with spaces in value', () => {
|
|
30
|
+
const spec = 'name=john doe';
|
|
31
|
+
const result = (0, propertySpecifications_1.parsePropertySpecification)(spec);
|
|
32
|
+
expect(result).toEqual({
|
|
33
|
+
slug: 'name',
|
|
34
|
+
value: 'john doe',
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
it('should parse property specification with equals sign in value', () => {
|
|
38
|
+
const spec = 'formula=x=y+z';
|
|
39
|
+
const result = (0, propertySpecifications_1.parsePropertySpecification)(spec);
|
|
40
|
+
expect(result).toEqual({
|
|
41
|
+
slug: 'formula',
|
|
42
|
+
value: 'x=y+z', // Now correctly keeps everything after first equals
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
it('should parse property specification with empty value', () => {
|
|
46
|
+
const spec = 'description=';
|
|
47
|
+
// Current implementation throws error for empty values
|
|
48
|
+
expect(() => (0, propertySpecifications_1.parsePropertySpecification)(spec)).toThrow('Invalid property specification: description=');
|
|
49
|
+
});
|
|
50
|
+
it('should throw error for spec without equals sign', () => {
|
|
51
|
+
const spec = 'invalidspec';
|
|
52
|
+
expect(() => (0, propertySpecifications_1.parsePropertySpecification)(spec)).toThrow('Invalid property specification: invalidspec');
|
|
53
|
+
});
|
|
54
|
+
it('should throw error for spec with only equals sign', () => {
|
|
55
|
+
const spec = '=';
|
|
56
|
+
expect(() => (0, propertySpecifications_1.parsePropertySpecification)(spec)).toThrow('Invalid property specification: =');
|
|
57
|
+
});
|
|
58
|
+
it('should throw error for spec with empty slug', () => {
|
|
59
|
+
const spec = '=value';
|
|
60
|
+
expect(() => (0, propertySpecifications_1.parsePropertySpecification)(spec)).toThrow('Invalid property specification: =value');
|
|
61
|
+
});
|
|
62
|
+
it('should parse property specification with special characters in slug', () => {
|
|
63
|
+
const spec = 'property_name=value';
|
|
64
|
+
const result = (0, propertySpecifications_1.parsePropertySpecification)(spec);
|
|
65
|
+
expect(result).toEqual({
|
|
66
|
+
slug: 'property_name',
|
|
67
|
+
value: 'value',
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
it('should parse property specification with hyphenated slug', () => {
|
|
71
|
+
const spec = 'property-name=value';
|
|
72
|
+
const result = (0, propertySpecifications_1.parsePropertySpecification)(spec);
|
|
73
|
+
expect(result).toEqual({
|
|
74
|
+
slug: 'property-name',
|
|
75
|
+
value: 'value',
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
describe('parsePropertySpecificationsIntoMap', () => {
|
|
80
|
+
it('should parse multiple property specifications into a map', () => {
|
|
81
|
+
const specs = ['name=obsidian', 'hex=000000', 'id=123'];
|
|
82
|
+
const result = (0, propertySpecifications_1.parsePropertySpecificationsIntoMap)(specs);
|
|
83
|
+
expect(result).toBeInstanceOf(Map);
|
|
84
|
+
expect(result.get('name')).toBe('obsidian');
|
|
85
|
+
expect(result.get('hex')).toBe('000000');
|
|
86
|
+
expect(result.get('id')).toBe('123');
|
|
87
|
+
expect(result.size).toBe(3);
|
|
88
|
+
});
|
|
89
|
+
it('should handle empty array', () => {
|
|
90
|
+
const specs = [];
|
|
91
|
+
const result = (0, propertySpecifications_1.parsePropertySpecificationsIntoMap)(specs);
|
|
92
|
+
expect(result).toBeInstanceOf(Map);
|
|
93
|
+
expect(result.size).toBe(0);
|
|
94
|
+
});
|
|
95
|
+
it('should handle single property specification', () => {
|
|
96
|
+
const specs = ['name=john'];
|
|
97
|
+
const result = (0, propertySpecifications_1.parsePropertySpecificationsIntoMap)(specs);
|
|
98
|
+
expect(result).toBeInstanceOf(Map);
|
|
99
|
+
expect(result.get('name')).toBe('john');
|
|
100
|
+
expect(result.size).toBe(1);
|
|
101
|
+
});
|
|
102
|
+
it('should handle property specifications with complex values', () => {
|
|
103
|
+
const specs = [
|
|
104
|
+
'description=This is a long description with spaces',
|
|
105
|
+
'formula=x=y+z',
|
|
106
|
+
'url=https://example.com',
|
|
107
|
+
];
|
|
108
|
+
const result = (0, propertySpecifications_1.parsePropertySpecificationsIntoMap)(specs);
|
|
109
|
+
expect(result.get('description')).toBe('This is a long description with spaces');
|
|
110
|
+
expect(result.get('formula')).toBe('x=y+z'); // Now correctly handles multiple equals
|
|
111
|
+
expect(result.get('url')).toBe('https://example.com');
|
|
112
|
+
expect(result.size).toBe(3);
|
|
113
|
+
});
|
|
114
|
+
it('should handle duplicate slugs by overwriting with last value', () => {
|
|
115
|
+
const specs = ['name=first', 'name=second', 'name=third'];
|
|
116
|
+
const result = (0, propertySpecifications_1.parsePropertySpecificationsIntoMap)(specs);
|
|
117
|
+
expect(result.get('name')).toBe('third');
|
|
118
|
+
expect(result.size).toBe(1);
|
|
119
|
+
});
|
|
120
|
+
it('should handle property specifications with empty values', () => {
|
|
121
|
+
const specs = ['name=john', 'description=', 'notes='];
|
|
122
|
+
// Current implementation throws error for empty values
|
|
123
|
+
expect(() => (0, propertySpecifications_1.parsePropertySpecificationsIntoMap)(specs)).toThrow('Invalid property specification: description=');
|
|
124
|
+
});
|
|
125
|
+
it('should throw error for invalid property specifications', () => {
|
|
126
|
+
const specs = [
|
|
127
|
+
'name=john',
|
|
128
|
+
'invalid',
|
|
129
|
+
];
|
|
130
|
+
expect(() => (0, propertySpecifications_1.parsePropertySpecificationsIntoMap)(specs)).toThrow('Invalid property specification: invalid');
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
describe('isValidPropertySpecification', () => {
|
|
134
|
+
it('should return true for valid property specifications', () => {
|
|
135
|
+
expect((0, propertySpecifications_1.isValidPropertySpecification)('name=john')).toBe(true);
|
|
136
|
+
expect((0, propertySpecifications_1.isValidPropertySpecification)('id=123')).toBe(true);
|
|
137
|
+
expect((0, propertySpecifications_1.isValidPropertySpecification)('hex=000000')).toBe(true);
|
|
138
|
+
expect((0, propertySpecifications_1.isValidPropertySpecification)('description=This is a description')).toBe(true);
|
|
139
|
+
expect((0, propertySpecifications_1.isValidPropertySpecification)('formula=x=y+z')).toBe(true);
|
|
140
|
+
expect((0, propertySpecifications_1.isValidPropertySpecification)('property_name=value')).toBe(true);
|
|
141
|
+
expect((0, propertySpecifications_1.isValidPropertySpecification)('property-name=value')).toBe(true);
|
|
142
|
+
});
|
|
143
|
+
it('should return true for property specifications with empty values', () => {
|
|
144
|
+
// Current implementation rejects empty values
|
|
145
|
+
expect((0, propertySpecifications_1.isValidPropertySpecification)('description=')).toBe(false);
|
|
146
|
+
expect((0, propertySpecifications_1.isValidPropertySpecification)('notes=')).toBe(false);
|
|
147
|
+
});
|
|
148
|
+
it('should return false for invalid property specifications', () => {
|
|
149
|
+
expect((0, propertySpecifications_1.isValidPropertySpecification)('invalid')).toBe(false);
|
|
150
|
+
expect((0, propertySpecifications_1.isValidPropertySpecification)('')).toBe(false);
|
|
151
|
+
expect((0, propertySpecifications_1.isValidPropertySpecification)('=')).toBe(false);
|
|
152
|
+
expect((0, propertySpecifications_1.isValidPropertySpecification)('=value')).toBe(false);
|
|
153
|
+
});
|
|
154
|
+
it('should return false for null or undefined', () => {
|
|
155
|
+
expect((0, propertySpecifications_1.isValidPropertySpecification)(null)).toBe(false);
|
|
156
|
+
expect((0, propertySpecifications_1.isValidPropertySpecification)(undefined)).toBe(false);
|
|
157
|
+
});
|
|
158
|
+
it('should return false for non-string values', () => {
|
|
159
|
+
expect((0, propertySpecifications_1.isValidPropertySpecification)(123)).toBe(false);
|
|
160
|
+
expect((0, propertySpecifications_1.isValidPropertySpecification)({})).toBe(false);
|
|
161
|
+
expect((0, propertySpecifications_1.isValidPropertySpecification)([])).toBe(false);
|
|
162
|
+
});
|
|
163
|
+
it('should act as type guard', () => {
|
|
164
|
+
const maybeSpec = 'name=john';
|
|
165
|
+
if ((0, propertySpecifications_1.isValidPropertySpecification)(maybeSpec)) {
|
|
166
|
+
// TypeScript should recognize maybeSpec as PropertySpecificationString
|
|
167
|
+
const parsed = (0, propertySpecifications_1.parsePropertySpecification)(maybeSpec);
|
|
168
|
+
expect(parsed.slug).toBe('name');
|
|
169
|
+
expect(parsed.value).toBe('john');
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
describe('integration tests', () => {
|
|
174
|
+
it('should work with the example from the comments', () => {
|
|
175
|
+
// Example: contrail entities get color -- id=123
|
|
176
|
+
const getSpecs = ['id=123'];
|
|
177
|
+
const getMap = (0, propertySpecifications_1.parsePropertySpecificationsIntoMap)(getSpecs);
|
|
178
|
+
expect(getMap.get('id')).toBe('123');
|
|
179
|
+
expect(getMap.size).toBe(1);
|
|
180
|
+
});
|
|
181
|
+
it('should work with the update example from the comments', () => {
|
|
182
|
+
// Example: contrail entities update color 123 -- name=obsidian hex=000000
|
|
183
|
+
const updateSpecs = ['name=obsidian', 'hex=000000'];
|
|
184
|
+
const updateMap = (0, propertySpecifications_1.parsePropertySpecificationsIntoMap)(updateSpecs);
|
|
185
|
+
expect(updateMap.get('name')).toBe('obsidian');
|
|
186
|
+
expect(updateMap.get('hex')).toBe('000000');
|
|
187
|
+
expect(updateMap.size).toBe(2);
|
|
188
|
+
});
|
|
189
|
+
it('should handle validation before parsing', () => {
|
|
190
|
+
const userInputs = ['name=john', 'invalid', 'id=123', '=empty'];
|
|
191
|
+
const validSpecs = userInputs.filter(propertySpecifications_1.isValidPropertySpecification);
|
|
192
|
+
expect(validSpecs).toEqual(['name=john', 'id=123']);
|
|
193
|
+
const map = (0, propertySpecifications_1.parsePropertySpecificationsIntoMap)(validSpecs);
|
|
194
|
+
expect(map.get('name')).toBe('john');
|
|
195
|
+
expect(map.get('id')).toBe('123');
|
|
196
|
+
expect(map.size).toBe(2);
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
describe('edge cases and limitations', () => {
|
|
200
|
+
it('should handle multiple equals signs correctly', () => {
|
|
201
|
+
// This test shows that multiple equals signs are now handled correctly
|
|
202
|
+
const spec = 'calculation=2+2=4';
|
|
203
|
+
const result = (0, propertySpecifications_1.parsePropertySpecification)(spec);
|
|
204
|
+
expect(result).toEqual({
|
|
205
|
+
slug: 'calculation',
|
|
206
|
+
value: '2+2=4', // now preserves everything after first equals
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
it('should handle the specific example equation=x+z=1', () => {
|
|
210
|
+
const spec = 'equation=x+z=1';
|
|
211
|
+
const result = (0, propertySpecifications_1.parsePropertySpecification)(spec);
|
|
212
|
+
expect(result).toEqual({
|
|
213
|
+
slug: 'equation',
|
|
214
|
+
value: 'x+z=1',
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
it('should handle mathematical expressions with one equals', () => {
|
|
218
|
+
const spec = 'formula=x+y';
|
|
219
|
+
const result = (0, propertySpecifications_1.parsePropertySpecification)(spec);
|
|
220
|
+
expect(result).toEqual({
|
|
221
|
+
slug: 'formula',
|
|
222
|
+
value: 'x+y',
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
it('should handle URLs without equals signs', () => {
|
|
226
|
+
const spec = 'url=https://example.com/path';
|
|
227
|
+
const result = (0, propertySpecifications_1.parsePropertySpecification)(spec);
|
|
228
|
+
expect(result).toEqual({
|
|
229
|
+
slug: 'url',
|
|
230
|
+
value: 'https://example.com/path',
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
it('should handle JSON-like values', () => {
|
|
234
|
+
const spec = 'config={"key":"value"}';
|
|
235
|
+
const result = (0, propertySpecifications_1.parsePropertySpecification)(spec);
|
|
236
|
+
expect(result).toEqual({
|
|
237
|
+
slug: 'config',
|
|
238
|
+
value: '{"key":"value"}',
|
|
239
|
+
});
|
|
240
|
+
});
|
|
241
|
+
it('should handle comma-separated values', () => {
|
|
242
|
+
const spec = 'tags=red,blue,green';
|
|
243
|
+
const result = (0, propertySpecifications_1.parsePropertySpecification)(spec);
|
|
244
|
+
expect(result).toEqual({
|
|
245
|
+
slug: 'tags',
|
|
246
|
+
value: 'red,blue,green',
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
it('should handle escaped characters', () => {
|
|
250
|
+
const spec = 'message=Hello\\nWorld';
|
|
251
|
+
const result = (0, propertySpecifications_1.parsePropertySpecification)(spec);
|
|
252
|
+
expect(result).toEqual({
|
|
253
|
+
slug: 'message',
|
|
254
|
+
value: 'Hello\\nWorld',
|
|
255
|
+
});
|
|
256
|
+
});
|
|
257
|
+
it('should handle whitespace in slugs', () => {
|
|
258
|
+
// This documents current behavior - spaces in slugs are allowed
|
|
259
|
+
const spec = 'property name=value';
|
|
260
|
+
const result = (0, propertySpecifications_1.parsePropertySpecification)(spec);
|
|
261
|
+
expect(result).toEqual({
|
|
262
|
+
slug: 'property name',
|
|
263
|
+
value: 'value',
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
});
|
|
@@ -188,7 +188,6 @@ async function uploadReducedTypeProperties(type, currentPropertyTypes, newProper
|
|
|
188
188
|
validationFunction: newPropertyType.validationFunction,
|
|
189
189
|
numberFormat: newPropertyType.numberFormat,
|
|
190
190
|
sequenceSeedValue: newPropertyType.sequenceSeedValue,
|
|
191
|
-
copyBehavior: newPropertyType?.copyBehavior,
|
|
192
191
|
}),
|
|
193
192
|
headers: {
|
|
194
193
|
Accept: 'application/json',
|
|
@@ -224,7 +223,6 @@ async function uploadReducedTypeProperties(type, currentPropertyTypes, newProper
|
|
|
224
223
|
validationFunction: newPropertyType.validationFunction ?? null,
|
|
225
224
|
numberFormat: newPropertyType.numberFormat ?? null,
|
|
226
225
|
sequenceSeedValue: newPropertyType.sequenceSeedValue ?? null,
|
|
227
|
-
copyBehavior: newPropertyType.copyBehavior ?? null,
|
|
228
226
|
};
|
|
229
227
|
// logger.debug(
|
|
230
228
|
// `found type property option set: ${newPropertyType.typePropertyOptionSetSlug}, ${proposedTP.typePropertyOptionSetId}, `,
|
package/dist/interfaces.d.ts
CHANGED
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.
|
|
2
|
+
"version": "3.4.0-alpha",
|
|
3
3
|
"commands": {
|
|
4
4
|
"app:create": {
|
|
5
5
|
"id": "app:create",
|
|
@@ -672,6 +672,366 @@
|
|
|
672
672
|
}
|
|
673
673
|
}
|
|
674
674
|
},
|
|
675
|
+
"entities:create": {
|
|
676
|
+
"id": "entities:create",
|
|
677
|
+
"description": "(BETA) Create entities",
|
|
678
|
+
"strict": false,
|
|
679
|
+
"pluginName": "@contrail/cli",
|
|
680
|
+
"pluginAlias": "@contrail/cli",
|
|
681
|
+
"pluginType": "core",
|
|
682
|
+
"aliases": [],
|
|
683
|
+
"examples": [
|
|
684
|
+
"contrail entities create color -n=10 # creates 10 random colors",
|
|
685
|
+
"contrail entities create color # creates one item",
|
|
686
|
+
"contrail entities create custom-entities:franchise",
|
|
687
|
+
"contrail entities create project-item -n=1 -- projectId=abc # creates 10 project items within project ABC",
|
|
688
|
+
"contrail entities create color -r # creates a random color with a human readable ID",
|
|
689
|
+
"contrail entities create color -d # simulates the creation of a random color without actually creating it",
|
|
690
|
+
"contrail entities create custom-entity:franchise -s # creates a random color and the response does not contain hydrating relationships",
|
|
691
|
+
"contrail entities create color -p -- name=Electric Blue green=1 red=2 blue=3 # creates a color with specified properties",
|
|
692
|
+
"contrail entities create color -o /tmp/colors.json # creates a random color and saves the output to /tmp/colors.json"
|
|
693
|
+
],
|
|
694
|
+
"flags": {
|
|
695
|
+
"logLevel": {
|
|
696
|
+
"name": "logLevel",
|
|
697
|
+
"type": "option",
|
|
698
|
+
"char": "l",
|
|
699
|
+
"description": "The Log Level",
|
|
700
|
+
"required": false,
|
|
701
|
+
"multiple": false,
|
|
702
|
+
"options": [
|
|
703
|
+
"error",
|
|
704
|
+
"warn",
|
|
705
|
+
"info",
|
|
706
|
+
"debug"
|
|
707
|
+
]
|
|
708
|
+
},
|
|
709
|
+
"alwaysConfirmEnv": {
|
|
710
|
+
"name": "alwaysConfirmEnv",
|
|
711
|
+
"type": "option",
|
|
712
|
+
"char": "e",
|
|
713
|
+
"description": "The Environment variables",
|
|
714
|
+
"required": false,
|
|
715
|
+
"multiple": false,
|
|
716
|
+
"options": [
|
|
717
|
+
"true",
|
|
718
|
+
"false"
|
|
719
|
+
],
|
|
720
|
+
"default": "true"
|
|
721
|
+
},
|
|
722
|
+
"count": {
|
|
723
|
+
"name": "count",
|
|
724
|
+
"type": "option",
|
|
725
|
+
"char": "n",
|
|
726
|
+
"description": "Number of random entities to create",
|
|
727
|
+
"required": false,
|
|
728
|
+
"multiple": false
|
|
729
|
+
},
|
|
730
|
+
"dryRun": {
|
|
731
|
+
"name": "dryRun",
|
|
732
|
+
"type": "boolean",
|
|
733
|
+
"char": "d",
|
|
734
|
+
"description": "If true, does not create the entity but simulates the creation",
|
|
735
|
+
"required": false,
|
|
736
|
+
"allowNo": false
|
|
737
|
+
},
|
|
738
|
+
"inputFile": {
|
|
739
|
+
"name": "inputFile",
|
|
740
|
+
"type": "option",
|
|
741
|
+
"char": "i",
|
|
742
|
+
"description": "A file with a JSON array of objects where each object is one entity to create. Cannot be used with --count. Unless --precise is specified, any missing values will be populated with random values.",
|
|
743
|
+
"required": false,
|
|
744
|
+
"multiple": false
|
|
745
|
+
},
|
|
746
|
+
"outputFile": {
|
|
747
|
+
"name": "outputFile",
|
|
748
|
+
"type": "option",
|
|
749
|
+
"char": "o",
|
|
750
|
+
"description": "File to save the output (optional)",
|
|
751
|
+
"required": false,
|
|
752
|
+
"multiple": false
|
|
753
|
+
},
|
|
754
|
+
"preciseProperties": {
|
|
755
|
+
"name": "preciseProperties",
|
|
756
|
+
"type": "boolean",
|
|
757
|
+
"char": "p",
|
|
758
|
+
"description": "If true, does not generate random values for properties. All values must be specified.",
|
|
759
|
+
"required": false,
|
|
760
|
+
"allowNo": false
|
|
761
|
+
},
|
|
762
|
+
"readableIds": {
|
|
763
|
+
"name": "readableIds",
|
|
764
|
+
"type": "boolean",
|
|
765
|
+
"char": "r",
|
|
766
|
+
"description": "If true, uses readable IDs for the created entities",
|
|
767
|
+
"required": false,
|
|
768
|
+
"allowNo": false
|
|
769
|
+
},
|
|
770
|
+
"skipHydrateRelationships": {
|
|
771
|
+
"name": "skipHydrateRelationships",
|
|
772
|
+
"type": "boolean",
|
|
773
|
+
"char": "s",
|
|
774
|
+
"description": "If true, does not hydrate relationships for the created entities",
|
|
775
|
+
"required": false,
|
|
776
|
+
"allowNo": false
|
|
777
|
+
}
|
|
778
|
+
},
|
|
779
|
+
"args": {
|
|
780
|
+
"path": {
|
|
781
|
+
"name": "path",
|
|
782
|
+
"description": "Path of the entity type to create",
|
|
783
|
+
"required": true
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
},
|
|
787
|
+
"entities:delete": {
|
|
788
|
+
"id": "entities:delete",
|
|
789
|
+
"description": "(BETA) Delete an entity",
|
|
790
|
+
"strict": true,
|
|
791
|
+
"pluginName": "@contrail/cli",
|
|
792
|
+
"pluginAlias": "@contrail/cli",
|
|
793
|
+
"pluginType": "core",
|
|
794
|
+
"aliases": [],
|
|
795
|
+
"examples": [
|
|
796
|
+
"contrail entities delete color 123"
|
|
797
|
+
],
|
|
798
|
+
"flags": {
|
|
799
|
+
"logLevel": {
|
|
800
|
+
"name": "logLevel",
|
|
801
|
+
"type": "option",
|
|
802
|
+
"char": "l",
|
|
803
|
+
"description": "The Log Level",
|
|
804
|
+
"required": false,
|
|
805
|
+
"multiple": false,
|
|
806
|
+
"options": [
|
|
807
|
+
"error",
|
|
808
|
+
"warn",
|
|
809
|
+
"info",
|
|
810
|
+
"debug"
|
|
811
|
+
]
|
|
812
|
+
},
|
|
813
|
+
"alwaysConfirmEnv": {
|
|
814
|
+
"name": "alwaysConfirmEnv",
|
|
815
|
+
"type": "option",
|
|
816
|
+
"char": "e",
|
|
817
|
+
"description": "The Environment variables",
|
|
818
|
+
"required": false,
|
|
819
|
+
"multiple": false,
|
|
820
|
+
"options": [
|
|
821
|
+
"true",
|
|
822
|
+
"false"
|
|
823
|
+
],
|
|
824
|
+
"default": "true"
|
|
825
|
+
},
|
|
826
|
+
"dryRun": {
|
|
827
|
+
"name": "dryRun",
|
|
828
|
+
"type": "boolean",
|
|
829
|
+
"char": "d",
|
|
830
|
+
"description": "If true, does not delete the entity but simulates the deletion",
|
|
831
|
+
"required": false,
|
|
832
|
+
"allowNo": false
|
|
833
|
+
},
|
|
834
|
+
"input": {
|
|
835
|
+
"name": "input",
|
|
836
|
+
"type": "option",
|
|
837
|
+
"char": "i",
|
|
838
|
+
"description": "A JSON array of objects where each object is one entity to create. Cannot be used with --count. Unless --precise is specified, any missing values will be populated with random values.",
|
|
839
|
+
"required": false,
|
|
840
|
+
"multiple": false
|
|
841
|
+
},
|
|
842
|
+
"id": {
|
|
843
|
+
"name": "id",
|
|
844
|
+
"type": "option",
|
|
845
|
+
"description": "The unique identifier of the entity",
|
|
846
|
+
"required": false,
|
|
847
|
+
"multiple": false
|
|
848
|
+
}
|
|
849
|
+
},
|
|
850
|
+
"args": {
|
|
851
|
+
"entityName": {
|
|
852
|
+
"name": "entityName",
|
|
853
|
+
"description": "The name of the entity type to delete",
|
|
854
|
+
"required": true
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
},
|
|
858
|
+
"entities:get": {
|
|
859
|
+
"id": "entities:get",
|
|
860
|
+
"description": "(BETA) Get an entity",
|
|
861
|
+
"strict": false,
|
|
862
|
+
"pluginName": "@contrail/cli",
|
|
863
|
+
"pluginAlias": "@contrail/cli",
|
|
864
|
+
"pluginType": "core",
|
|
865
|
+
"aliases": [],
|
|
866
|
+
"examples": [
|
|
867
|
+
"contrail entities get color -- id=123",
|
|
868
|
+
"contrail entities get loader-processes -- createdOn=2025-09-15..2025-09-16",
|
|
869
|
+
"contrail entities get orders -- updatedAt=2025-09-15T04:00:00Z..",
|
|
870
|
+
"contrail entities get events -- timestamp=..2025-09-16T23:59:59Z"
|
|
871
|
+
],
|
|
872
|
+
"flags": {
|
|
873
|
+
"logLevel": {
|
|
874
|
+
"name": "logLevel",
|
|
875
|
+
"type": "option",
|
|
876
|
+
"char": "l",
|
|
877
|
+
"description": "The Log Level",
|
|
878
|
+
"required": false,
|
|
879
|
+
"multiple": false,
|
|
880
|
+
"options": [
|
|
881
|
+
"error",
|
|
882
|
+
"warn",
|
|
883
|
+
"info",
|
|
884
|
+
"debug"
|
|
885
|
+
]
|
|
886
|
+
},
|
|
887
|
+
"alwaysConfirmEnv": {
|
|
888
|
+
"name": "alwaysConfirmEnv",
|
|
889
|
+
"type": "option",
|
|
890
|
+
"char": "e",
|
|
891
|
+
"description": "The Environment variables",
|
|
892
|
+
"required": false,
|
|
893
|
+
"multiple": false,
|
|
894
|
+
"options": [
|
|
895
|
+
"true",
|
|
896
|
+
"false"
|
|
897
|
+
],
|
|
898
|
+
"default": "true"
|
|
899
|
+
},
|
|
900
|
+
"outputFile": {
|
|
901
|
+
"name": "outputFile",
|
|
902
|
+
"type": "option",
|
|
903
|
+
"char": "o",
|
|
904
|
+
"description": "File to save the output (optional)",
|
|
905
|
+
"required": false,
|
|
906
|
+
"multiple": false
|
|
907
|
+
},
|
|
908
|
+
"skipHydrateRelationships": {
|
|
909
|
+
"name": "skipHydrateRelationships",
|
|
910
|
+
"type": "boolean",
|
|
911
|
+
"char": "s",
|
|
912
|
+
"description": "Skip hydrating relationships when fetching the entity",
|
|
913
|
+
"required": false,
|
|
914
|
+
"allowNo": false
|
|
915
|
+
},
|
|
916
|
+
"relations": {
|
|
917
|
+
"name": "relations",
|
|
918
|
+
"type": "option",
|
|
919
|
+
"char": "r",
|
|
920
|
+
"description": "Comma-separated list of relations to include in the output",
|
|
921
|
+
"required": false,
|
|
922
|
+
"multiple": false
|
|
923
|
+
},
|
|
924
|
+
"propertySlugs": {
|
|
925
|
+
"name": "propertySlugs",
|
|
926
|
+
"type": "option",
|
|
927
|
+
"char": "p",
|
|
928
|
+
"description": "Comma-separated list of property slugs to include in the output",
|
|
929
|
+
"required": false,
|
|
930
|
+
"multiple": false
|
|
931
|
+
},
|
|
932
|
+
"paginated": {
|
|
933
|
+
"name": "paginated",
|
|
934
|
+
"type": "boolean",
|
|
935
|
+
"char": "P",
|
|
936
|
+
"description": "If true, fetches all entities in a paginated manner",
|
|
937
|
+
"required": false,
|
|
938
|
+
"allowNo": false
|
|
939
|
+
},
|
|
940
|
+
"take": {
|
|
941
|
+
"name": "take",
|
|
942
|
+
"type": "option",
|
|
943
|
+
"char": "t",
|
|
944
|
+
"description": "Number of entities to fetch in a single request (default is 100)",
|
|
945
|
+
"required": false,
|
|
946
|
+
"multiple": false,
|
|
947
|
+
"default": 1000
|
|
948
|
+
}
|
|
949
|
+
},
|
|
950
|
+
"args": {
|
|
951
|
+
"typePath": {
|
|
952
|
+
"name": "typePath",
|
|
953
|
+
"description": "The name of the entity type to fetch",
|
|
954
|
+
"required": true
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
},
|
|
958
|
+
"entities:update": {
|
|
959
|
+
"id": "entities:update",
|
|
960
|
+
"description": "(BETA) Update an entity",
|
|
961
|
+
"strict": false,
|
|
962
|
+
"pluginName": "@contrail/cli",
|
|
963
|
+
"pluginAlias": "@contrail/cli",
|
|
964
|
+
"pluginType": "core",
|
|
965
|
+
"aliases": [],
|
|
966
|
+
"examples": [
|
|
967
|
+
"contrail entities update color 123 -- name=obsidian hex=000000"
|
|
968
|
+
],
|
|
969
|
+
"flags": {
|
|
970
|
+
"logLevel": {
|
|
971
|
+
"name": "logLevel",
|
|
972
|
+
"type": "option",
|
|
973
|
+
"char": "l",
|
|
974
|
+
"description": "The Log Level",
|
|
975
|
+
"required": false,
|
|
976
|
+
"multiple": false,
|
|
977
|
+
"options": [
|
|
978
|
+
"error",
|
|
979
|
+
"warn",
|
|
980
|
+
"info",
|
|
981
|
+
"debug"
|
|
982
|
+
]
|
|
983
|
+
},
|
|
984
|
+
"alwaysConfirmEnv": {
|
|
985
|
+
"name": "alwaysConfirmEnv",
|
|
986
|
+
"type": "option",
|
|
987
|
+
"char": "e",
|
|
988
|
+
"description": "The Environment variables",
|
|
989
|
+
"required": false,
|
|
990
|
+
"multiple": false,
|
|
991
|
+
"options": [
|
|
992
|
+
"true",
|
|
993
|
+
"false"
|
|
994
|
+
],
|
|
995
|
+
"default": "true"
|
|
996
|
+
},
|
|
997
|
+
"skipHydrateRelationships": {
|
|
998
|
+
"name": "skipHydrateRelationships",
|
|
999
|
+
"type": "boolean",
|
|
1000
|
+
"char": "s",
|
|
1001
|
+
"description": "Skip hydrating relationships when updating the entity",
|
|
1002
|
+
"required": false,
|
|
1003
|
+
"allowNo": false
|
|
1004
|
+
},
|
|
1005
|
+
"dryRun": {
|
|
1006
|
+
"name": "dryRun",
|
|
1007
|
+
"type": "boolean",
|
|
1008
|
+
"char": "d",
|
|
1009
|
+
"description": "If true, does not create the entity but simulates the creation",
|
|
1010
|
+
"required": false,
|
|
1011
|
+
"allowNo": false
|
|
1012
|
+
},
|
|
1013
|
+
"inputFile": {
|
|
1014
|
+
"name": "inputFile",
|
|
1015
|
+
"type": "option",
|
|
1016
|
+
"char": "i",
|
|
1017
|
+
"description": "File containing properties to update the entity (optional)",
|
|
1018
|
+
"required": false,
|
|
1019
|
+
"multiple": false
|
|
1020
|
+
}
|
|
1021
|
+
},
|
|
1022
|
+
"args": {
|
|
1023
|
+
"entityName": {
|
|
1024
|
+
"name": "entityName",
|
|
1025
|
+
"description": "The name of the entity type to update",
|
|
1026
|
+
"required": true
|
|
1027
|
+
},
|
|
1028
|
+
"id": {
|
|
1029
|
+
"name": "id",
|
|
1030
|
+
"description": "The unique identifier of the entity",
|
|
1031
|
+
"required": true
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
},
|
|
675
1035
|
"file:upload": {
|
|
676
1036
|
"id": "file:upload",
|
|
677
1037
|
"description": "Uploads a file to the VibeIQ platform",
|