@contrail/cli 3.5.2 → 3.5.3-alpha.0e9434c

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.
Files changed (67) hide show
  1. package/README.md +11 -29
  2. package/dist/api/types.d.ts +0 -5
  3. package/dist/api/types.js +1 -36
  4. package/dist/commands/types/getAll.js +0 -18
  5. package/dist/commands/types/loadAll.js +0 -2
  6. package/dist/commands/types/mergeTypeProperties.js +0 -5
  7. package/dist/commands/types/uploadOptionSetHierarchies.js +0 -117
  8. package/dist/commands/types/uploadOptionSets.js +1 -1
  9. package/dist/commands/types/uploadRuleSets.js +2 -85
  10. package/dist/commands/types/uploadTypeOverrides.js +10 -2
  11. package/dist/commands/types/uploadTypePolicies.js +2 -86
  12. package/dist/commands/types/uploadTypePropertyPolicies.d.ts +0 -1
  13. package/dist/commands/types/uploadTypePropertyPolicies.js +3 -139
  14. package/dist/commands/workflow-templates/export.d.ts +3 -1
  15. package/dist/commands/workflow-templates/export.js +105 -28
  16. package/dist/helpers/types/type-uploader.js +1 -1
  17. package/dist/helpers/workflow-templates/helper.d.ts +1 -0
  18. package/dist/helpers/workflow-templates/helper.js +27 -6
  19. package/dist/interfaces.d.ts +0 -25
  20. package/dist/templates/typescript/tsup.config.ts +0 -0
  21. package/node_modules/@contrail/org-config-migration/.github/workflows/publish-to-npm.yml +117 -0
  22. package/node_modules/@contrail/org-config-migration/.husky/pre-commit +0 -0
  23. package/node_modules/@contrail/org-config-migration/lib/index.d.ts +3 -3
  24. package/node_modules/@contrail/org-config-migration/lib/index.js +19 -19
  25. package/node_modules/@contrail/org-config-migration/lib/interfaces.d.ts +87 -97
  26. package/node_modules/@contrail/org-config-migration/lib/interfaces.js +2 -2
  27. package/node_modules/@contrail/org-config-migration/lib/services/index.d.ts +1 -1
  28. package/node_modules/@contrail/org-config-migration/lib/services/index.js +17 -17
  29. package/node_modules/@contrail/org-config-migration/lib/services/types.d.ts +12 -17
  30. package/node_modules/@contrail/org-config-migration/lib/services/types.js +115 -155
  31. package/node_modules/@contrail/org-config-migration/lib/types/exportAll.d.ts +2 -2
  32. package/node_modules/@contrail/org-config-migration/lib/types/exportAll.js +34 -40
  33. package/node_modules/@contrail/org-config-migration/lib/types/exportOptionSet.d.ts +2 -2
  34. package/node_modules/@contrail/org-config-migration/lib/types/exportOptionSet.js +20 -20
  35. package/node_modules/@contrail/org-config-migration/lib/types/exportOptionSetHierarchies.d.ts +2 -3
  36. package/node_modules/@contrail/org-config-migration/lib/types/exportOptionSetHierarchies.js +16 -47
  37. package/node_modules/@contrail/org-config-migration/lib/types/exportOverrides.d.ts +2 -2
  38. package/node_modules/@contrail/org-config-migration/lib/types/exportOverrides.js +8 -8
  39. package/node_modules/@contrail/org-config-migration/lib/types/exportRuleSets.d.ts +2 -3
  40. package/node_modules/@contrail/org-config-migration/lib/types/exportRuleSets.js +14 -39
  41. package/node_modules/@contrail/org-config-migration/lib/types/exportTypePolicies.d.ts +2 -3
  42. package/node_modules/@contrail/org-config-migration/lib/types/exportTypePolicies.js +44 -56
  43. package/node_modules/@contrail/org-config-migration/lib/types/exportTypePropertyPolicies.d.ts +2 -3
  44. package/node_modules/@contrail/org-config-migration/lib/types/exportTypePropertyPolicies.js +44 -71
  45. package/node_modules/@contrail/org-config-migration/lib/types/exportTypes.d.ts +2 -2
  46. package/node_modules/@contrail/org-config-migration/lib/types/exportTypes.js +85 -85
  47. package/node_modules/@contrail/org-config-migration/lib/types/importAll.d.ts +2 -2
  48. package/node_modules/@contrail/org-config-migration/lib/types/importAll.js +386 -451
  49. package/node_modules/@contrail/org-config-migration/lib/types/index.d.ts +8 -9
  50. package/node_modules/@contrail/org-config-migration/lib/types/index.js +24 -25
  51. package/node_modules/@contrail/org-config-migration/lib/types/parseOptionSetHierarchy.d.ts +3 -3
  52. package/node_modules/@contrail/org-config-migration/lib/types/parseOptionSetHierarchy.js +210 -210
  53. package/node_modules/@contrail/org-config-migration/lib/users/export.d.ts +2 -2
  54. package/node_modules/@contrail/org-config-migration/lib/users/export.js +40 -40
  55. package/node_modules/@contrail/org-config-migration/lib/users/import.d.ts +2 -2
  56. package/node_modules/@contrail/org-config-migration/lib/users/import.js +41 -41
  57. package/node_modules/@contrail/org-config-migration/lib/users/index.d.ts +2 -2
  58. package/node_modules/@contrail/org-config-migration/lib/users/index.js +18 -18
  59. package/node_modules/@contrail/org-config-migration/package.json +1 -1
  60. package/oclif.manifest.json +15 -56
  61. package/package.json +2 -2
  62. package/dist/commands/types/uploadUsageInfo.d.ts +0 -15
  63. package/dist/commands/types/uploadUsageInfo.js +0 -180
  64. package/dist/commands/types/uploadUsageInfo.spec.d.ts +0 -1
  65. package/dist/commands/types/uploadUsageInfo.spec.js +0 -249
  66. package/node_modules/@contrail/org-config-migration/lib/types/exportUsageInfo.d.ts +0 -2
  67. package/node_modules/@contrail/org-config-migration/lib/types/exportUsageInfo.js +0 -39
@@ -1,85 +1,85 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getReducedTypes = void 0;
13
- function getReducedTypes(dataHolder) {
14
- return __awaiter(this, void 0, void 0, function* () {
15
- console.log(`Found types: ${dataHolder.types.length}`);
16
- let reducedTypes = [];
17
- const optionSetSlugById = {};
18
- const userLists = dataHolder === null || dataHolder === void 0 ? void 0 : dataHolder.userList;
19
- for (const optionSet of dataHolder.optionSets) {
20
- optionSetSlugById[optionSet.id] = optionSet.slug;
21
- }
22
- console.log(`option set and their ids: ${JSON.stringify(optionSetSlugById, null, 2)}`);
23
- for (const type of dataHolder.types) {
24
- const reducedTypeProperties = [];
25
- for (const typeProperty of type.typeProperties) {
26
- if (typeProperty.inherited) {
27
- continue;
28
- }
29
- let userListName = '';
30
- if (typeProperty.typePropertyUserListId) {
31
- const userData = userLists.find((s) => s.id === typeProperty.typePropertyUserListId);
32
- if (userData) {
33
- userListName = userData.name;
34
- }
35
- }
36
- const reducedTypeProperty = {
37
- slug: typeProperty.slug,
38
- id: typeProperty.id,
39
- isArchived: typeProperty.isArchived,
40
- propertyType: typeProperty.propertyType,
41
- label: typeProperty.label,
42
- editable: typeProperty.editable,
43
- searchable: typeProperty.searchable,
44
- core: typeProperty.core,
45
- typePropertyOptionSetSlug: optionSetSlugById[typeProperty.typePropertyOptionSetId],
46
- formula: typeProperty.formula,
47
- referencedTypePath: typeProperty.referencedTypePath,
48
- referencedTypeRootSlug: typeProperty.referencedTypeRootSlug,
49
- typePropertyUserListId: typeProperty.typePropertyUserListId,
50
- typePropertyUserListName: userListName,
51
- referencedTypeRole: typeProperty.referencedTypeRole,
52
- defaultValue: typeProperty.defaultValue,
53
- propertyLevel: typeProperty.propertyLevel,
54
- carryOverBehavior: typeProperty.carryOverBehavior,
55
- carryOverDefault: typeProperty.carryOverDefault,
56
- isUniqueProperty: typeProperty.isUniqueProperty,
57
- isUniquePropertyInFamily: typeProperty.isUniquePropertyInFamily,
58
- inherited: typeProperty.inherited,
59
- formulaFunction: typeProperty.formulaFunction,
60
- validationFunction: typeProperty.validationFunction,
61
- numberFormat: typeProperty.numberFormat,
62
- sequenceSeedValue: typeProperty.sequenceSeedValue,
63
- copyBehavior: typeProperty.copyBehavior,
64
- };
65
- reducedTypeProperties.push(reducedTypeProperty);
66
- }
67
- const reducedType = {
68
- typePath: type.typePath,
69
- slug: type.slug,
70
- label: type.label,
71
- isArchived: type.isArchived,
72
- typeProperties: reducedTypeProperties
73
- .map((x) => {
74
- delete x['id'];
75
- return Object.assign({}, x);
76
- })
77
- .sort((one, two) => (one.slug < two.slug ? -1 : 1)),
78
- };
79
- reducedTypes.push(reducedType);
80
- }
81
- reducedTypes = reducedTypes.sort((one, two) => (one.typePath < two.typePath ? -1 : 1));
82
- return reducedTypes;
83
- });
84
- }
85
- exports.getReducedTypes = getReducedTypes;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.getReducedTypes = void 0;
13
+ function getReducedTypes(dataHolder) {
14
+ return __awaiter(this, void 0, void 0, function* () {
15
+ console.log(`Found types: ${dataHolder.types.length}`);
16
+ let reducedTypes = [];
17
+ const optionSetSlugById = {};
18
+ const userLists = dataHolder === null || dataHolder === void 0 ? void 0 : dataHolder.userList;
19
+ for (const optionSet of dataHolder.optionSets) {
20
+ optionSetSlugById[optionSet.id] = optionSet.slug;
21
+ }
22
+ console.log(`option set and their ids: ${JSON.stringify(optionSetSlugById, null, 2)}`);
23
+ for (const type of dataHolder.types) {
24
+ const reducedTypeProperties = [];
25
+ for (const typeProperty of type.typeProperties) {
26
+ if (typeProperty.inherited) {
27
+ continue;
28
+ }
29
+ let userListName = '';
30
+ if (typeProperty.typePropertyUserListId) {
31
+ const userData = userLists.find((s) => s.id === typeProperty.typePropertyUserListId);
32
+ if (userData) {
33
+ userListName = userData.name;
34
+ }
35
+ }
36
+ const reducedTypeProperty = {
37
+ slug: typeProperty.slug,
38
+ id: typeProperty.id,
39
+ isArchived: typeProperty.isArchived,
40
+ propertyType: typeProperty.propertyType,
41
+ label: typeProperty.label,
42
+ editable: typeProperty.editable,
43
+ searchable: typeProperty.searchable,
44
+ core: typeProperty.core,
45
+ typePropertyOptionSetSlug: optionSetSlugById[typeProperty.typePropertyOptionSetId],
46
+ formula: typeProperty.formula,
47
+ referencedTypePath: typeProperty.referencedTypePath,
48
+ referencedTypeRootSlug: typeProperty.referencedTypeRootSlug,
49
+ typePropertyUserListId: typeProperty.typePropertyUserListId,
50
+ typePropertyUserListName: userListName,
51
+ referencedTypeRole: typeProperty.referencedTypeRole,
52
+ defaultValue: typeProperty.defaultValue,
53
+ propertyLevel: typeProperty.propertyLevel,
54
+ carryOverBehavior: typeProperty.carryOverBehavior,
55
+ carryOverDefault: typeProperty.carryOverDefault,
56
+ isUniqueProperty: typeProperty.isUniqueProperty,
57
+ isUniquePropertyInFamily: typeProperty.isUniquePropertyInFamily,
58
+ inherited: typeProperty.inherited,
59
+ formulaFunction: typeProperty.formulaFunction,
60
+ validationFunction: typeProperty.validationFunction,
61
+ numberFormat: typeProperty.numberFormat,
62
+ sequenceSeedValue: typeProperty.sequenceSeedValue,
63
+ copyBehavior: typeProperty.copyBehavior,
64
+ };
65
+ reducedTypeProperties.push(reducedTypeProperty);
66
+ }
67
+ const reducedType = {
68
+ typePath: type.typePath,
69
+ slug: type.slug,
70
+ label: type.label,
71
+ isArchived: type.isArchived,
72
+ typeProperties: reducedTypeProperties
73
+ .map((x) => {
74
+ delete x['id'];
75
+ return Object.assign({}, x);
76
+ })
77
+ .sort((one, two) => (one.slug < two.slug ? -1 : 1)),
78
+ };
79
+ reducedTypes.push(reducedType);
80
+ }
81
+ reducedTypes = reducedTypes.sort((one, two) => (one.typePath < two.typePath ? -1 : 1));
82
+ return reducedTypes;
83
+ });
84
+ }
85
+ exports.getReducedTypes = getReducedTypes;
@@ -1,2 +1,2 @@
1
- import { ReducedDataHolder } from '../interfaces';
2
- export declare function importReducedData(reducedData: ReducedDataHolder, skipPolicies?: boolean): Promise<void>;
1
+ import { ReducedDataHolder } from '../interfaces';
2
+ export declare function importReducedData(reducedData: ReducedDataHolder, skipPolicies?: boolean): Promise<void>;