@contrail/cli 3.6.0-alpha-8-alpha.19e980d → 3.6.0-alpha-8-alpha.2a57edb
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
CHANGED
|
@@ -17,7 +17,7 @@ $ npm install -g @contrail/cli
|
|
|
17
17
|
$ contrail COMMAND
|
|
18
18
|
running command...
|
|
19
19
|
$ contrail (--version)
|
|
20
|
-
@contrail/cli/3.6.0-alpha-8-alpha.
|
|
20
|
+
@contrail/cli/3.6.0-alpha-8-alpha.2a57edb linux-x64 node-v24.21.0
|
|
21
21
|
$ contrail --help [COMMAND]
|
|
22
22
|
USAGE
|
|
23
23
|
$ contrail COMMAND
|
|
@@ -696,10 +696,10 @@ ARGUMENTS
|
|
|
696
696
|
FLAGS
|
|
697
697
|
-F, --force Force update without validation. Internal use only
|
|
698
698
|
-S, --skipHydrateRelationships Skip hydrating relationships when updating the entity
|
|
699
|
-
-d, --dryRun If true, does not
|
|
699
|
+
-d, --dryRun If true, does not update the entities but simulates the update
|
|
700
700
|
-e, --alwaysConfirmEnv=<option> [default: true] The Environment variables
|
|
701
701
|
<options: true|false>
|
|
702
|
-
-i, --inputFile=<value>
|
|
702
|
+
-i, --inputFile=<value> A file with a JSON array of {id, ...} objects; each object is one entity to update.
|
|
703
703
|
-l, --logLevel=<option> The Log Level
|
|
704
704
|
<options: error|warn|info|debug>
|
|
705
705
|
--apiVersion=<option> Api-Version header to send; selects the V1 or V2 variant of the endpoint
|
|
@@ -27,13 +27,13 @@ class UpdateEntity extends basecommand_1.BaseCommand {
|
|
|
27
27
|
}),
|
|
28
28
|
dryRun: core_1.Flags.boolean({
|
|
29
29
|
char: 'd',
|
|
30
|
-
description: 'If true, does not
|
|
30
|
+
description: 'If true, does not update the entities but simulates the update',
|
|
31
31
|
required: false,
|
|
32
32
|
default: false,
|
|
33
33
|
}),
|
|
34
34
|
inputFile: core_1.Flags.string({
|
|
35
35
|
char: 'i',
|
|
36
|
-
description: '
|
|
36
|
+
description: 'A file with a JSON array of {id, ...} objects; each object is one entity to update.',
|
|
37
37
|
required: false,
|
|
38
38
|
}),
|
|
39
39
|
force: core_1.Flags.boolean({
|
|
@@ -68,7 +68,8 @@ function parsePropertySpecificationsIntoMap(propertySpecifications) {
|
|
|
68
68
|
// ids is the one comma-split exception: it is a list of ids by definition
|
|
69
69
|
// and ids never contain commas.
|
|
70
70
|
const idsArray = value.split(',').map((id) => id.trim());
|
|
71
|
-
propertySpecBySlug.
|
|
71
|
+
const existingIds = propertySpecBySlug.get(slug);
|
|
72
|
+
propertySpecBySlug.set(slug, Array.isArray(existingIds) ? [...existingIds, ...idsArray] : idsArray);
|
|
72
73
|
continue;
|
|
73
74
|
}
|
|
74
75
|
const existing = propertySpecBySlug.get(slug);
|
|
@@ -190,6 +190,11 @@ describe('parsePropertySpecificationsIntoMap', () => {
|
|
|
190
190
|
expect(result.get('ids')).toEqual(['1', '2', '3']);
|
|
191
191
|
expect(result.get('name')).toBe('Test');
|
|
192
192
|
});
|
|
193
|
+
it('should accumulate repeated ids keys', () => {
|
|
194
|
+
const specs = ['ids=1,2', 'ids=3'];
|
|
195
|
+
const result = (0, propertySpecifications_1.parsePropertySpecificationsIntoMap)(specs);
|
|
196
|
+
expect(result.get('ids')).toEqual(['1', '2', '3']);
|
|
197
|
+
});
|
|
193
198
|
it('should handle ids as single value', () => {
|
|
194
199
|
const specs = ['ids=123'];
|
|
195
200
|
const result = (0, propertySpecifications_1.parsePropertySpecificationsIntoMap)(specs);
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.6.0-alpha-8-alpha.
|
|
2
|
+
"version": "3.6.0-alpha-8-alpha.2a57edb",
|
|
3
3
|
"commands": {
|
|
4
4
|
"app:create": {
|
|
5
5
|
"id": "app:create",
|
|
@@ -1077,7 +1077,7 @@
|
|
|
1077
1077
|
"name": "dryRun",
|
|
1078
1078
|
"type": "boolean",
|
|
1079
1079
|
"char": "d",
|
|
1080
|
-
"description": "If true, does not
|
|
1080
|
+
"description": "If true, does not update the entities but simulates the update",
|
|
1081
1081
|
"required": false,
|
|
1082
1082
|
"allowNo": false
|
|
1083
1083
|
},
|
|
@@ -1085,7 +1085,7 @@
|
|
|
1085
1085
|
"name": "inputFile",
|
|
1086
1086
|
"type": "option",
|
|
1087
1087
|
"char": "i",
|
|
1088
|
-
"description": "
|
|
1088
|
+
"description": "A file with a JSON array of {id, ...} objects; each object is one entity to update.",
|
|
1089
1089
|
"required": false,
|
|
1090
1090
|
"multiple": false
|
|
1091
1091
|
},
|