@contrail/cli 3.5.2 → 3.5.3-alpha.cc8f6c0
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 +1 -25
- package/dist/api/types.d.ts +0 -5
- package/dist/api/types.js +1 -36
- package/dist/commands/types/getAll.js +0 -18
- package/dist/commands/types/loadAll.js +0 -2
- package/dist/commands/types/mergeTypeProperties.js +0 -5
- package/dist/commands/types/uploadOptionSetHierarchies.js +0 -117
- package/dist/commands/types/uploadOptionSets.js +1 -1
- package/dist/commands/types/uploadRuleSets.js +2 -85
- package/dist/commands/types/uploadTypeOverrides.js +10 -2
- package/dist/commands/types/uploadTypePolicies.js +2 -86
- package/dist/commands/types/uploadTypePropertyPolicies.d.ts +0 -1
- package/dist/commands/types/uploadTypePropertyPolicies.js +3 -139
- package/dist/helpers/types/type-uploader.js +1 -1
- package/dist/interfaces.d.ts +0 -25
- package/dist/templates/typescript/tsup.config.ts +0 -0
- package/node_modules/@contrail/org-config-migration/.github/workflows/publish-to-npm.yml +117 -0
- package/node_modules/@contrail/org-config-migration/.husky/pre-commit +0 -0
- package/node_modules/@contrail/org-config-migration/lib/index.d.ts +3 -3
- package/node_modules/@contrail/org-config-migration/lib/index.js +19 -19
- package/node_modules/@contrail/org-config-migration/lib/interfaces.d.ts +87 -97
- package/node_modules/@contrail/org-config-migration/lib/interfaces.js +2 -2
- package/node_modules/@contrail/org-config-migration/lib/services/index.d.ts +1 -1
- package/node_modules/@contrail/org-config-migration/lib/services/index.js +17 -17
- package/node_modules/@contrail/org-config-migration/lib/services/types.d.ts +12 -17
- package/node_modules/@contrail/org-config-migration/lib/services/types.js +115 -155
- package/node_modules/@contrail/org-config-migration/lib/types/exportAll.d.ts +2 -2
- package/node_modules/@contrail/org-config-migration/lib/types/exportAll.js +34 -40
- package/node_modules/@contrail/org-config-migration/lib/types/exportOptionSet.d.ts +2 -2
- package/node_modules/@contrail/org-config-migration/lib/types/exportOptionSet.js +20 -20
- package/node_modules/@contrail/org-config-migration/lib/types/exportOptionSetHierarchies.d.ts +2 -3
- package/node_modules/@contrail/org-config-migration/lib/types/exportOptionSetHierarchies.js +16 -47
- package/node_modules/@contrail/org-config-migration/lib/types/exportOverrides.d.ts +2 -2
- package/node_modules/@contrail/org-config-migration/lib/types/exportOverrides.js +8 -8
- package/node_modules/@contrail/org-config-migration/lib/types/exportRuleSets.d.ts +2 -3
- package/node_modules/@contrail/org-config-migration/lib/types/exportRuleSets.js +14 -39
- package/node_modules/@contrail/org-config-migration/lib/types/exportTypePolicies.d.ts +2 -3
- package/node_modules/@contrail/org-config-migration/lib/types/exportTypePolicies.js +44 -56
- package/node_modules/@contrail/org-config-migration/lib/types/exportTypePropertyPolicies.d.ts +2 -3
- package/node_modules/@contrail/org-config-migration/lib/types/exportTypePropertyPolicies.js +44 -71
- package/node_modules/@contrail/org-config-migration/lib/types/exportTypes.d.ts +2 -2
- package/node_modules/@contrail/org-config-migration/lib/types/exportTypes.js +85 -85
- package/node_modules/@contrail/org-config-migration/lib/types/importAll.d.ts +2 -2
- package/node_modules/@contrail/org-config-migration/lib/types/importAll.js +386 -451
- package/node_modules/@contrail/org-config-migration/lib/types/index.d.ts +8 -9
- package/node_modules/@contrail/org-config-migration/lib/types/index.js +24 -25
- package/node_modules/@contrail/org-config-migration/lib/types/parseOptionSetHierarchy.d.ts +3 -3
- package/node_modules/@contrail/org-config-migration/lib/types/parseOptionSetHierarchy.js +210 -210
- package/node_modules/@contrail/org-config-migration/lib/users/export.d.ts +2 -2
- package/node_modules/@contrail/org-config-migration/lib/users/export.js +40 -40
- package/node_modules/@contrail/org-config-migration/lib/users/import.d.ts +2 -2
- package/node_modules/@contrail/org-config-migration/lib/users/import.js +41 -41
- package/node_modules/@contrail/org-config-migration/lib/users/index.d.ts +2 -2
- package/node_modules/@contrail/org-config-migration/lib/users/index.js +18 -18
- package/node_modules/@contrail/org-config-migration/package.json +1 -1
- package/oclif.manifest.json +1 -52
- package/package.json +2 -2
- package/dist/commands/types/uploadUsageInfo.d.ts +0 -15
- package/dist/commands/types/uploadUsageInfo.js +0 -180
- package/dist/commands/types/uploadUsageInfo.spec.d.ts +0 -1
- package/dist/commands/types/uploadUsageInfo.spec.js +0 -249
- package/node_modules/@contrail/org-config-migration/lib/types/exportUsageInfo.d.ts +0 -2
- package/node_modules/@contrail/org-config-migration/lib/types/exportUsageInfo.js +0 -39
|
@@ -1,155 +1,115 @@
|
|
|
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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.getGroups = exports.getOrgUsers = exports.getUserLists = exports.getOverrideCopies = exports.getOverrides = exports.
|
|
16
|
-
const p_limit_1 = __importDefault(require("p-limit"));
|
|
17
|
-
const limit = (0, p_limit_1.default)(30);
|
|
18
|
-
function getTypes(client, withTypeProperties = true) {
|
|
19
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
const types = yield client.get({
|
|
21
|
-
entityName: 'type',
|
|
22
|
-
});
|
|
23
|
-
if (!withTypeProperties) {
|
|
24
|
-
return types;
|
|
25
|
-
}
|
|
26
|
-
const typesWithProperties = [];
|
|
27
|
-
const promises = [];
|
|
28
|
-
for (const type of types) {
|
|
29
|
-
const promise = limit(() => __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
const t = yield client.get({ entityName: 'type', id: type.id, relations: ['typeProperties'] });
|
|
31
|
-
typesWithProperties.push(t);
|
|
32
|
-
}));
|
|
33
|
-
promises.push(promise);
|
|
34
|
-
}
|
|
35
|
-
yield Promise.all(promises);
|
|
36
|
-
return typesWithProperties;
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
exports.getTypes = getTypes;
|
|
40
|
-
function getOptionSets(client) {
|
|
41
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
return yield client.get({
|
|
43
|
-
entityName: 'type-property-option-set',
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
exports.getOptionSets = getOptionSets;
|
|
48
|
-
function getOptionSetHierarchies(client) {
|
|
49
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
-
return yield client.get({
|
|
51
|
-
entityName: 'option-set-hierarchy',
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
exports.getOptionSetHierarchies = getOptionSetHierarchies;
|
|
56
|
-
function
|
|
57
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
-
return yield client.get({
|
|
59
|
-
entityName: 'type-
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
exports.
|
|
64
|
-
function
|
|
65
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
-
return yield client.get({
|
|
67
|
-
entityName: 'type-
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
exports.
|
|
72
|
-
function
|
|
73
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
-
return yield client.get({
|
|
75
|
-
entityName: 'type-
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
exports.
|
|
80
|
-
function
|
|
81
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
-
return yield client.get({
|
|
83
|
-
entityName: 'type-
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
exports.
|
|
88
|
-
function
|
|
89
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
-
return yield client.get({
|
|
91
|
-
entityName: 'type-
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
exports.
|
|
96
|
-
function
|
|
97
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
-
return yield client.get({
|
|
99
|
-
entityName: '
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
exports.
|
|
104
|
-
function
|
|
105
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
-
return yield client.get({
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
exports.getTypePolicyLinks = getTypePolicyLinks;
|
|
120
|
-
function getOverrides(client) {
|
|
121
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
-
return yield client.get({
|
|
123
|
-
entityName: 'type-override',
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
exports.getOverrides = getOverrides;
|
|
128
|
-
function getOverrideCopies(client) {
|
|
129
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
-
return yield client.get({
|
|
131
|
-
entityName: 'type-override-copy',
|
|
132
|
-
});
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
exports.getOverrideCopies = getOverrideCopies;
|
|
136
|
-
function getUserLists(client) {
|
|
137
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
138
|
-
return yield client.get({
|
|
139
|
-
entityName: 'user-list',
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
exports.getUserLists = getUserLists;
|
|
144
|
-
function getOrgUsers(client, options) {
|
|
145
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
146
|
-
return yield client.get(Object.assign({ entityName: 'user-org' }, options));
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
exports.getOrgUsers = getOrgUsers;
|
|
150
|
-
function getGroups(client, options) {
|
|
151
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
152
|
-
return yield client.get(Object.assign({ entityName: 'group' }, options));
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
exports.getGroups = getGroups;
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.getGroups = exports.getOrgUsers = exports.getUserLists = exports.getOverrideCopies = exports.getOverrides = exports.getTypePolicies = exports.getTypePropertyPolicies = exports.getRuleSets = exports.getOptionSetHierarchies = exports.getOptionSets = exports.getTypes = void 0;
|
|
16
|
+
const p_limit_1 = __importDefault(require("p-limit"));
|
|
17
|
+
const limit = (0, p_limit_1.default)(30);
|
|
18
|
+
function getTypes(client, withTypeProperties = true) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
const types = yield client.get({
|
|
21
|
+
entityName: 'type',
|
|
22
|
+
});
|
|
23
|
+
if (!withTypeProperties) {
|
|
24
|
+
return types;
|
|
25
|
+
}
|
|
26
|
+
const typesWithProperties = [];
|
|
27
|
+
const promises = [];
|
|
28
|
+
for (const type of types) {
|
|
29
|
+
const promise = limit(() => __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
const t = yield client.get({ entityName: 'type', id: type.id, relations: ['typeProperties'] });
|
|
31
|
+
typesWithProperties.push(t);
|
|
32
|
+
}));
|
|
33
|
+
promises.push(promise);
|
|
34
|
+
}
|
|
35
|
+
yield Promise.all(promises);
|
|
36
|
+
return typesWithProperties;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
exports.getTypes = getTypes;
|
|
40
|
+
function getOptionSets(client) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
return yield client.get({
|
|
43
|
+
entityName: 'type-property-option-set',
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
exports.getOptionSets = getOptionSets;
|
|
48
|
+
function getOptionSetHierarchies(client) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
return yield client.get({
|
|
51
|
+
entityName: 'option-set-hierarchy',
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
exports.getOptionSetHierarchies = getOptionSetHierarchies;
|
|
56
|
+
function getRuleSets(client) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
return yield client.get({
|
|
59
|
+
entityName: 'type-rule-set',
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
exports.getRuleSets = getRuleSets;
|
|
64
|
+
function getTypePropertyPolicies(client) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
return yield client.get({
|
|
67
|
+
entityName: 'type-property-policy',
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
exports.getTypePropertyPolicies = getTypePropertyPolicies;
|
|
72
|
+
function getTypePolicies(client) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
return yield client.get({
|
|
75
|
+
entityName: 'type-policy',
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
exports.getTypePolicies = getTypePolicies;
|
|
80
|
+
function getOverrides(client) {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
return yield client.get({
|
|
83
|
+
entityName: 'type-override',
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
exports.getOverrides = getOverrides;
|
|
88
|
+
function getOverrideCopies(client) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
return yield client.get({
|
|
91
|
+
entityName: 'type-override-copy',
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
exports.getOverrideCopies = getOverrideCopies;
|
|
96
|
+
function getUserLists(client) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
return yield client.get({
|
|
99
|
+
entityName: 'user-list',
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
exports.getUserLists = getUserLists;
|
|
104
|
+
function getOrgUsers(client, options) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
return yield client.get(Object.assign({ entityName: 'user-org' }, options));
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
exports.getOrgUsers = getOrgUsers;
|
|
110
|
+
function getGroups(client, options) {
|
|
111
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
112
|
+
return yield client.get(Object.assign({ entityName: 'group' }, options));
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
exports.getGroups = getGroups;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DataHolder, ReducedDataHolder } from '../interfaces';
|
|
2
|
-
export declare function getAllReducedTypes(data: DataHolder): Promise<ReducedDataHolder>;
|
|
1
|
+
import { DataHolder, ReducedDataHolder } from '../interfaces';
|
|
2
|
+
export declare function getAllReducedTypes(data: DataHolder): Promise<ReducedDataHolder>;
|
|
@@ -1,40 +1,34 @@
|
|
|
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.getAllReducedTypes = void 0;
|
|
13
|
-
const exportTypes_1 = require("./exportTypes");
|
|
14
|
-
const exportOptionSet_1 = require("./exportOptionSet");
|
|
15
|
-
const exportOptionSetHierarchies_1 = require("./exportOptionSetHierarchies");
|
|
16
|
-
const exportRuleSets_1 = require("./exportRuleSets");
|
|
17
|
-
const exportTypePropertyPolicies_1 = require("./exportTypePropertyPolicies");
|
|
18
|
-
const exportTypePolicies_1 = require("./exportTypePolicies");
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
reducedTypePolicyLinks: (0, exportTypePolicies_1.getReducedTypePolicyLinks)(data),
|
|
36
|
-
};
|
|
37
|
-
return reducedData;
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
exports.getAllReducedTypes = getAllReducedTypes;
|
|
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.getAllReducedTypes = void 0;
|
|
13
|
+
const exportTypes_1 = require("./exportTypes");
|
|
14
|
+
const exportOptionSet_1 = require("./exportOptionSet");
|
|
15
|
+
const exportOptionSetHierarchies_1 = require("./exportOptionSetHierarchies");
|
|
16
|
+
const exportRuleSets_1 = require("./exportRuleSets");
|
|
17
|
+
const exportTypePropertyPolicies_1 = require("./exportTypePropertyPolicies");
|
|
18
|
+
const exportTypePolicies_1 = require("./exportTypePolicies");
|
|
19
|
+
const exportOverrides_1 = require("./exportOverrides");
|
|
20
|
+
function getAllReducedTypes(data) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const reducedData = {
|
|
23
|
+
reducedTypes: yield (0, exportTypes_1.getReducedTypes)(data),
|
|
24
|
+
reducedOptionSets: (0, exportOptionSet_1.getReducedOptionSets)(data),
|
|
25
|
+
reducedOptionSetHierarchies: (0, exportOptionSetHierarchies_1.getReducedOptionSetHierarchies)(data),
|
|
26
|
+
reducedOverrides: (0, exportOverrides_1.getReducedOverrides)(data),
|
|
27
|
+
reducedRuleSets: (0, exportRuleSets_1.getReducedRuleSets)(data),
|
|
28
|
+
reducedTypePropertyPolicies: (0, exportTypePropertyPolicies_1.getReducedTypePropertyPolicies)(data),
|
|
29
|
+
reducedTypePolicies: (0, exportTypePolicies_1.getReducedTypePolicies)(data),
|
|
30
|
+
};
|
|
31
|
+
return reducedData;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
exports.getAllReducedTypes = getAllReducedTypes;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DataHolder } from '../interfaces';
|
|
2
|
-
export declare function getReducedOptionSets(data: DataHolder): any[];
|
|
1
|
+
import { DataHolder } from '../interfaces';
|
|
2
|
+
export declare function getReducedOptionSets(data: DataHolder): any[];
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getReducedOptionSets = void 0;
|
|
4
|
-
function getReducedOptionSets(data) {
|
|
5
|
-
var _a;
|
|
6
|
-
return (_a = data.optionSets) === null || _a === void 0 ? void 0 : _a.map((optionSet) => {
|
|
7
|
-
var _a, _b;
|
|
8
|
-
return {
|
|
9
|
-
name: optionSet.name,
|
|
10
|
-
slug: optionSet.slug,
|
|
11
|
-
isArchived: optionSet.isArchived,
|
|
12
|
-
optionSet: (_a = optionSet.optionSet) === null || _a === void 0 ? void 0 : _a.map((x) => {
|
|
13
|
-
var _a;
|
|
14
|
-
return Object.assign(Object.assign({}, x), { disabled: typeof x.disabled === 'string' ? x.disabled === 'true' : Boolean((_a = x.disabled) !== null && _a !== void 0 ? _a : false) });
|
|
15
|
-
}),
|
|
16
|
-
disabled: typeof optionSet.disabled === 'string' ? optionSet.disabled === 'true' : Boolean((_b = optionSet.disabled) !== null && _b !== void 0 ? _b : false),
|
|
17
|
-
};
|
|
18
|
-
}).sort((one, two) => (one.name < two.name ? -1 : 1));
|
|
19
|
-
}
|
|
20
|
-
exports.getReducedOptionSets = getReducedOptionSets;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReducedOptionSets = void 0;
|
|
4
|
+
function getReducedOptionSets(data) {
|
|
5
|
+
var _a;
|
|
6
|
+
return (_a = data.optionSets) === null || _a === void 0 ? void 0 : _a.map((optionSet) => {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
return {
|
|
9
|
+
name: optionSet.name,
|
|
10
|
+
slug: optionSet.slug,
|
|
11
|
+
isArchived: optionSet.isArchived,
|
|
12
|
+
optionSet: (_a = optionSet.optionSet) === null || _a === void 0 ? void 0 : _a.map((x) => {
|
|
13
|
+
var _a;
|
|
14
|
+
return Object.assign(Object.assign({}, x), { disabled: typeof x.disabled === 'string' ? x.disabled === 'true' : Boolean((_a = x.disabled) !== null && _a !== void 0 ? _a : false) });
|
|
15
|
+
}),
|
|
16
|
+
disabled: typeof optionSet.disabled === 'string' ? optionSet.disabled === 'true' : Boolean((_b = optionSet.disabled) !== null && _b !== void 0 ? _b : false),
|
|
17
|
+
};
|
|
18
|
+
}).sort((one, two) => (one.name < two.name ? -1 : 1));
|
|
19
|
+
}
|
|
20
|
+
exports.getReducedOptionSets = getReducedOptionSets;
|
package/node_modules/@contrail/org-config-migration/lib/types/exportOptionSetHierarchies.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { DataHolder } from '../interfaces';
|
|
2
|
-
export declare function getReducedOptionSetHierarchies(data: DataHolder): any[];
|
|
3
|
-
export declare function getReducedOptionSetHierarchyLinks(data: DataHolder): any[];
|
|
1
|
+
import { DataHolder } from '../interfaces';
|
|
2
|
+
export declare function getReducedOptionSetHierarchies(data: DataHolder): any[];
|
|
@@ -1,47 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
function getReducedOptionSetHierarchies(data) {
|
|
5
|
-
var _a;
|
|
6
|
-
return (_a = data.optionSetHierarchies) === null || _a === void 0 ? void 0 : _a.map((x) => {
|
|
7
|
-
const hierarchyBySlug = x.hierarchy.map((optionSetId) => { var _a, _b; return (_b = (_a = data.optionSets) === null || _a === void 0 ? void 0 : _a.find((x) => x.id === optionSetId)) === null || _b === void 0 ? void 0 : _b.slug; });
|
|
8
|
-
return {
|
|
9
|
-
hierarchy: hierarchyBySlug,
|
|
10
|
-
options: x.options,
|
|
11
|
-
name: x.name,
|
|
12
|
-
identifier: x.identifier,
|
|
13
|
-
};
|
|
14
|
-
}).sort((one, two) => (one.name < two.name ? -1 : 1));
|
|
15
|
-
}
|
|
16
|
-
exports.getReducedOptionSetHierarchies = getReducedOptionSetHierarchies;
|
|
17
|
-
function getReducedOptionSetHierarchyLinks(data) {
|
|
18
|
-
var _a;
|
|
19
|
-
return (_a = data.optionSetHierarchyLinks) === null || _a === void 0 ? void 0 : _a.map((x) => {
|
|
20
|
-
var _a, _b, _c, _d;
|
|
21
|
-
const osh = (_a = data.optionSetHierarchies) === null || _a === void 0 ? void 0 : _a.find((y) => y.id === x.optionSetHierarchyId);
|
|
22
|
-
if (!osh) {
|
|
23
|
-
console.log(`OSH Link: could not find option set hierarchy ${x.optionSetHierarchyId} skipping...`);
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
const type = (_b = data.types) === null || _b === void 0 ? void 0 : _b.find((y) => y.id === x.typeId);
|
|
27
|
-
if (!type) {
|
|
28
|
-
console.log(`OSH Link: could not find type ${x.typeId} skipping...`);
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
const typePropertySlugs = [];
|
|
32
|
-
for (const tpId of x.hierarchyTypePropertyIds) {
|
|
33
|
-
const typePropertySlug = (_d = (_c = type.typeProperties) === null || _c === void 0 ? void 0 : _c.find((y) => y.id === tpId)) === null || _d === void 0 ? void 0 : _d.slug;
|
|
34
|
-
if (!typePropertySlug) {
|
|
35
|
-
console.log(`OSH Link: could not find type property ${tpId} skipping...`);
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
typePropertySlugs.push(typePropertySlug);
|
|
39
|
-
}
|
|
40
|
-
return {
|
|
41
|
-
optionSetHierarchyIdentifier: osh.identifier,
|
|
42
|
-
typeSlug: type.slug,
|
|
43
|
-
typePropertySlugs,
|
|
44
|
-
};
|
|
45
|
-
}).filter((x) => !!x).sort((one, two) => (one.typeSlug < two.typeSlug ? -1 : 1));
|
|
46
|
-
}
|
|
47
|
-
exports.getReducedOptionSetHierarchyLinks = getReducedOptionSetHierarchyLinks;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReducedOptionSetHierarchies = void 0;
|
|
4
|
+
function getReducedOptionSetHierarchies(data) {
|
|
5
|
+
var _a;
|
|
6
|
+
return (_a = data.optionSetHierarchies) === null || _a === void 0 ? void 0 : _a.map((x) => {
|
|
7
|
+
const hierarchyBySlug = x.hierarchy.map((optionSetId) => { var _a, _b; return (_b = (_a = data.optionSets) === null || _a === void 0 ? void 0 : _a.find((x) => x.id === optionSetId)) === null || _b === void 0 ? void 0 : _b.slug; });
|
|
8
|
+
return {
|
|
9
|
+
hierarchy: hierarchyBySlug,
|
|
10
|
+
options: x.options,
|
|
11
|
+
name: x.name,
|
|
12
|
+
identifier: x.identifier,
|
|
13
|
+
};
|
|
14
|
+
}).sort((one, two) => (one.name < two.name ? -1 : 1));
|
|
15
|
+
}
|
|
16
|
+
exports.getReducedOptionSetHierarchies = getReducedOptionSetHierarchies;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DataHolder } from '../interfaces';
|
|
2
|
-
export declare function getReducedOverrides(data: DataHolder): any[];
|
|
1
|
+
import { DataHolder } from '../interfaces';
|
|
2
|
+
export declare function getReducedOverrides(data: DataHolder): any[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getReducedOverrides = void 0;
|
|
4
|
-
function getReducedOverrides(data) {
|
|
5
|
-
var _a;
|
|
6
|
-
return (_a = data === null || data === void 0 ? void 0 : data.typeOverrides) !== null && _a !== void 0 ? _a : [];
|
|
7
|
-
}
|
|
8
|
-
exports.getReducedOverrides = getReducedOverrides;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReducedOverrides = void 0;
|
|
4
|
+
function getReducedOverrides(data) {
|
|
5
|
+
var _a;
|
|
6
|
+
return (_a = data === null || data === void 0 ? void 0 : data.typeOverrides) !== null && _a !== void 0 ? _a : [];
|
|
7
|
+
}
|
|
8
|
+
exports.getReducedOverrides = getReducedOverrides;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { DataHolder } from '../interfaces';
|
|
2
|
-
export declare function getReducedRuleSets(data: DataHolder): any[];
|
|
3
|
-
export declare function getReducedRuleSetLinks(data: DataHolder): any[];
|
|
1
|
+
import { DataHolder } from '../interfaces';
|
|
2
|
+
export declare function getReducedRuleSets(data: DataHolder): any[];
|
|
@@ -1,39 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
function getReducedRuleSets(data) {
|
|
5
|
-
var _a;
|
|
6
|
-
return (_a = data === null || data === void 0 ? void 0 : data.ruleSets) === null || _a === void 0 ? void 0 : _a.map((x) => {
|
|
7
|
-
return {
|
|
8
|
-
ruleSet: x.ruleSet,
|
|
9
|
-
name: x.name,
|
|
10
|
-
identifier: x.identifier,
|
|
11
|
-
};
|
|
12
|
-
}).sort((one, two) => (one.name < two.name ? -1 : 1));
|
|
13
|
-
}
|
|
14
|
-
exports.getReducedRuleSets = getReducedRuleSets;
|
|
15
|
-
function getReducedRuleSetLinks(data) {
|
|
16
|
-
var _a, _b;
|
|
17
|
-
const reducedRuleSetLinks = [];
|
|
18
|
-
if (!(data === null || data === void 0 ? void 0 : data.ruleSetLinks.length)) {
|
|
19
|
-
return [];
|
|
20
|
-
}
|
|
21
|
-
for (const ruleSetLink of data.ruleSetLinks) {
|
|
22
|
-
const ruleSet = (_a = data === null || data === void 0 ? void 0 : data.ruleSets) === null || _a === void 0 ? void 0 : _a.find((x) => x.id === ruleSetLink.typeRuleSetId);
|
|
23
|
-
const type = (_b = data === null || data === void 0 ? void 0 : data.types) === null || _b === void 0 ? void 0 : _b.find((x) => x.id === ruleSetLink.typeId);
|
|
24
|
-
if (!ruleSet || !type) {
|
|
25
|
-
console.log(`Skipping bad rule set link ${ruleSetLink.id}`);
|
|
26
|
-
}
|
|
27
|
-
reducedRuleSetLinks.push({
|
|
28
|
-
ruleSet: ruleSet.identifier,
|
|
29
|
-
type: type.slug,
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
return reducedRuleSetLinks.sort((one, two) => {
|
|
33
|
-
if (one.type === two.type) {
|
|
34
|
-
return one.ruleSet > two.ruleSet ? -1 : 1;
|
|
35
|
-
}
|
|
36
|
-
return one.type > two.type ? -1 : 1;
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
exports.getReducedRuleSetLinks = getReducedRuleSetLinks;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReducedRuleSets = void 0;
|
|
4
|
+
function getReducedRuleSets(data) {
|
|
5
|
+
var _a;
|
|
6
|
+
return (_a = data === null || data === void 0 ? void 0 : data.ruleSets) === null || _a === void 0 ? void 0 : _a.map((x) => {
|
|
7
|
+
return {
|
|
8
|
+
ruleSet: x.ruleSet,
|
|
9
|
+
name: x.name,
|
|
10
|
+
identifier: x.identifier,
|
|
11
|
+
};
|
|
12
|
+
}).sort((one, two) => (one.name < two.name ? -1 : 1));
|
|
13
|
+
}
|
|
14
|
+
exports.getReducedRuleSets = getReducedRuleSets;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { DataHolder } from '../interfaces';
|
|
2
|
-
export declare function getReducedTypePolicies(data: DataHolder): any[];
|
|
3
|
-
export declare function getReducedTypePolicyLinks(data: DataHolder): any[];
|
|
1
|
+
import { DataHolder } from '../interfaces';
|
|
2
|
+
export declare function getReducedTypePolicies(data: DataHolder): any[];
|