@contrail/cli 2.1.5 → 2.1.6

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
@@ -15,7 +15,7 @@ $ npm install -g @contrail/cli
15
15
  $ contrail COMMAND
16
16
  running command...
17
17
  $ contrail (--version)
18
- @contrail/cli/2.1.5 darwin-arm64 node-v18.13.0
18
+ @contrail/cli/2.1.6 darwin-arm64 node-v18.13.0
19
19
  $ contrail --help [COMMAND]
20
20
  USAGE
21
21
  $ contrail COMMAND
@@ -41,7 +41,7 @@ ExportGroups.flags = {
41
41
  async function exportGroups(fileLocation, overwrite) {
42
42
  const allGroups = await (0, users_1.getGroups)({ relations: ['groupPrincipals'] });
43
43
  const allUsersInOrg = await (0, users_1.getUserOrgs)();
44
- const groups = [];
44
+ let groups = [];
45
45
  for (const group of allGroups) {
46
46
  const groupPrincipals = getGroupPrincipals(group, allGroups, allUsersInOrg);
47
47
  groups.push({
@@ -49,6 +49,7 @@ async function exportGroups(fileLocation, overwrite) {
49
49
  groupPrincipals,
50
50
  });
51
51
  }
52
+ groups = groups.sort((one, two) => (one.name < two.name ? -1 : 1));
52
53
  await saveData(groups, fileLocation, overwrite);
53
54
  }
54
55
  exports.exportGroups = exportGroups;
@@ -88,5 +89,5 @@ function getGroupPrincipals(group, allGroups, orgUsers) {
88
89
  });
89
90
  }
90
91
  }
91
- return principals;
92
+ return principals.sort((one, two) => { var _a, _b; return (((_b = (_a = one.email) !== null && _a !== void 0 ? _a : one.name < two.email) !== null && _b !== void 0 ? _b : two.name) ? -1 : 1); });
92
93
  }
@@ -99,7 +99,7 @@ async function reduceTypePropertyPolicies(data) {
99
99
  statements: x.policy.statements.map(x => reducePrincipal(x)),
100
100
  }
101
101
  };
102
- });
102
+ }).sort((one, two) => (one.label < two.label ? -1 : 1));
103
103
  }
104
104
  function reduceTypePropertyPolicyLinks(data) {
105
105
  var _a, _b;
@@ -168,7 +168,7 @@ async function reduceTypePolicies(data) {
168
168
  statements: x.policy.statements.map(x => reducePrincipal(x)),
169
169
  }
170
170
  };
171
- });
171
+ }).sort((one, two) => (one.label < two.label ? -1 : 1));
172
172
  }
173
173
  function reduceTypePolicyLinks(data) {
174
174
  var _a;
@@ -197,7 +197,7 @@ function reduceUsageInfo(data) {
197
197
  typeSlug: (_a = data.types.find(y => y.id === x.typeId)) === null || _a === void 0 ? void 0 : _a.slug,
198
198
  typePropertySlug: (_b = typeProperties.find(y => y.id === x.typePropertyId)) === null || _b === void 0 ? void 0 : _b.slug,
199
199
  };
200
- });
200
+ }).sort((one, two) => (one.label < two.label ? -1 : 1));
201
201
  }
202
202
  function reduceRuleSetLinks(data) {
203
203
  var _a, _b;
@@ -225,7 +225,7 @@ function reduceRuleSets(data) {
225
225
  ruleSet: x.ruleSet,
226
226
  name: x.name,
227
227
  };
228
- });
228
+ }).sort((one, two) => (one.name < two.name ? -1 : 1));
229
229
  }
230
230
  function reduceOptionSets(data) {
231
231
  var _a;
@@ -235,7 +235,7 @@ function reduceOptionSets(data) {
235
235
  isArchived: optionSet.isArchived,
236
236
  optionSet: optionSet.optionSet,
237
237
  };
238
- });
238
+ }).sort((one, two) => (one.name < two.name ? -1 : 1));
239
239
  }
240
240
  function reduceOptionSetHierarchies(data) {
241
241
  var _a;
@@ -246,7 +246,7 @@ function reduceOptionSetHierarchies(data) {
246
246
  options: x.options,
247
247
  name: x.name
248
248
  };
249
- });
249
+ }).sort((one, two) => (one.name < two.name ? -1 : 1));
250
250
  }
251
251
  function reduceOptionSetHierarchyLinks(data) {
252
252
  var _a;
@@ -276,7 +276,7 @@ function reduceOptionSetHierarchyLinks(data) {
276
276
  typeSlug: type.slug,
277
277
  typePropertySlugs,
278
278
  };
279
- }).filter(x => !!x);
279
+ }).filter(x => !!x).sort((one, two) => (one.typeSlug < two.typeSlug ? -1 : 1));
280
280
  }
281
281
  function reduceTypes(dataHolder) {
282
282
  console.log('Found types: ', dataHolder.types.length);
@@ -320,7 +320,7 @@ function reduceTypes(dataHolder) {
320
320
  return {
321
321
  ...x
322
322
  };
323
- }),
323
+ }).sort((one, two) => (one.slug < two.slug ? -1 : 1)),
324
324
  };
325
325
  reducedTypes.push(reducedType);
326
326
  }
@@ -40,7 +40,7 @@ ExportUsers.flags = {
40
40
  };
41
41
  async function exportUsers(fileLocation, overwrite) {
42
42
  const allUsersInOrg = await (0, users_1.getUserOrgs)();
43
- const users = [];
43
+ let users = [];
44
44
  for (const userInOrg of allUsersInOrg) {
45
45
  delete userInOrg.user.id;
46
46
  delete userInOrg.user.updatedBy;
@@ -53,6 +53,7 @@ async function exportUsers(fileLocation, overwrite) {
53
53
  ...userInOrg.user
54
54
  });
55
55
  }
56
+ users = users.sort((one, two) => (one.email < two.email ? -1 : 1));
56
57
  await saveData(users, fileLocation, overwrite);
57
58
  }
58
59
  exports.exportUsers = exportUsers;
@@ -23,7 +23,7 @@
23
23
  "strictPropertyInitialization": false,
24
24
  "target": "ES2020",
25
25
  "types": [
26
- "node"
26
+ "node", "jest"
27
27
  ]
28
28
  },
29
29
  "exclude": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.1.5",
2
+ "version": "2.1.6",
3
3
  "commands": {
4
4
  "app:create": {
5
5
  "id": "app:create",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/cli",
3
- "version": "2.1.5",
3
+ "version": "2.1.6",
4
4
  "description": "VibeIQ's Contrail Platform CLI.",
5
5
  "bin": {
6
6
  "contrail-cli": "./bin/run",