@contrail/cli 3.5.3-alpha.73bd011 → 3.5.3-alpha.818a5c0

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 (52) hide show
  1. package/README.md +50 -1
  2. package/dist/api/org-config.d.ts +3 -0
  3. package/dist/api/org-config.js +26 -0
  4. package/dist/commands/instance/export.js +2 -0
  5. package/dist/commands/instance/import.js +2 -0
  6. package/dist/commands/org-config/export.d.ts +14 -0
  7. package/dist/commands/org-config/export.js +80 -0
  8. package/dist/commands/org-config/import.d.ts +14 -0
  9. package/dist/commands/org-config/import.js +73 -0
  10. package/node_modules/@contrail/org-config-migration/.github/workflows/publish-to-npm.yml +117 -0
  11. package/node_modules/@contrail/org-config-migration/.husky/pre-commit +0 -0
  12. package/node_modules/@contrail/org-config-migration/lib/index.d.ts +3 -3
  13. package/node_modules/@contrail/org-config-migration/lib/index.js +19 -19
  14. package/node_modules/@contrail/org-config-migration/lib/interfaces.d.ts +87 -97
  15. package/node_modules/@contrail/org-config-migration/lib/interfaces.js +2 -2
  16. package/node_modules/@contrail/org-config-migration/lib/services/index.d.ts +1 -1
  17. package/node_modules/@contrail/org-config-migration/lib/services/index.js +17 -17
  18. package/node_modules/@contrail/org-config-migration/lib/services/types.d.ts +12 -17
  19. package/node_modules/@contrail/org-config-migration/lib/services/types.js +115 -155
  20. package/node_modules/@contrail/org-config-migration/lib/types/exportAll.d.ts +2 -2
  21. package/node_modules/@contrail/org-config-migration/lib/types/exportAll.js +34 -40
  22. package/node_modules/@contrail/org-config-migration/lib/types/exportOptionSet.d.ts +2 -2
  23. package/node_modules/@contrail/org-config-migration/lib/types/exportOptionSet.js +20 -20
  24. package/node_modules/@contrail/org-config-migration/lib/types/exportOptionSetHierarchies.d.ts +2 -3
  25. package/node_modules/@contrail/org-config-migration/lib/types/exportOptionSetHierarchies.js +16 -47
  26. package/node_modules/@contrail/org-config-migration/lib/types/exportOverrides.d.ts +2 -2
  27. package/node_modules/@contrail/org-config-migration/lib/types/exportOverrides.js +8 -8
  28. package/node_modules/@contrail/org-config-migration/lib/types/exportRuleSets.d.ts +2 -3
  29. package/node_modules/@contrail/org-config-migration/lib/types/exportRuleSets.js +14 -39
  30. package/node_modules/@contrail/org-config-migration/lib/types/exportTypePolicies.d.ts +2 -3
  31. package/node_modules/@contrail/org-config-migration/lib/types/exportTypePolicies.js +44 -56
  32. package/node_modules/@contrail/org-config-migration/lib/types/exportTypePropertyPolicies.d.ts +2 -3
  33. package/node_modules/@contrail/org-config-migration/lib/types/exportTypePropertyPolicies.js +44 -71
  34. package/node_modules/@contrail/org-config-migration/lib/types/exportTypes.d.ts +2 -2
  35. package/node_modules/@contrail/org-config-migration/lib/types/exportTypes.js +85 -85
  36. package/node_modules/@contrail/org-config-migration/lib/types/importAll.d.ts +2 -2
  37. package/node_modules/@contrail/org-config-migration/lib/types/importAll.js +386 -451
  38. package/node_modules/@contrail/org-config-migration/lib/types/index.d.ts +8 -9
  39. package/node_modules/@contrail/org-config-migration/lib/types/index.js +24 -25
  40. package/node_modules/@contrail/org-config-migration/lib/types/parseOptionSetHierarchy.d.ts +3 -3
  41. package/node_modules/@contrail/org-config-migration/lib/types/parseOptionSetHierarchy.js +210 -210
  42. package/node_modules/@contrail/org-config-migration/lib/users/export.d.ts +2 -2
  43. package/node_modules/@contrail/org-config-migration/lib/users/export.js +40 -40
  44. package/node_modules/@contrail/org-config-migration/lib/users/import.d.ts +2 -2
  45. package/node_modules/@contrail/org-config-migration/lib/users/import.js +41 -41
  46. package/node_modules/@contrail/org-config-migration/lib/users/index.d.ts +2 -2
  47. package/node_modules/@contrail/org-config-migration/lib/users/index.js +18 -18
  48. package/node_modules/@contrail/org-config-migration/package.json +1 -1
  49. package/oclif.manifest.json +107 -1
  50. package/package.json +2 -2
  51. package/node_modules/@contrail/org-config-migration/lib/types/exportUsageInfo.d.ts +0 -2
  52. package/node_modules/@contrail/org-config-migration/lib/types/exportUsageInfo.js +0 -39
@@ -1,41 +1,41 @@
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 __rest = (this && this.__rest) || function (s, e) {
12
- var t = {};
13
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
- t[p] = s[p];
15
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
- t[p[i]] = s[p[i]];
19
- }
20
- return t;
21
- };
22
- var __importDefault = (this && this.__importDefault) || function (mod) {
23
- return (mod && mod.__esModule) ? mod : { "default": mod };
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.uploadUsers = void 0;
27
- const sdk_1 = require("@contrail/sdk");
28
- const p_limit_1 = __importDefault(require("p-limit"));
29
- const limit = (0, p_limit_1.default)(5);
30
- function uploadUsers(users, entitiesInstance = new sdk_1.Entities()) {
31
- return __awaiter(this, void 0, void 0, function* () {
32
- yield Promise.all(users.map((user) => limit(() => __awaiter(this, void 0, void 0, function* () {
33
- const { email } = user, rest = __rest(user, ["email"]);
34
- yield entitiesInstance.create({
35
- entityName: 'user-org',
36
- object: Object.assign({ userEmail: email }, rest),
37
- });
38
- }))));
39
- });
40
- }
41
- exports.uploadUsers = uploadUsers;
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 __rest = (this && this.__rest) || function (s, e) {
12
+ var t = {};
13
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
+ t[p] = s[p];
15
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
+ t[p[i]] = s[p[i]];
19
+ }
20
+ return t;
21
+ };
22
+ var __importDefault = (this && this.__importDefault) || function (mod) {
23
+ return (mod && mod.__esModule) ? mod : { "default": mod };
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.uploadUsers = void 0;
27
+ const sdk_1 = require("@contrail/sdk");
28
+ const p_limit_1 = __importDefault(require("p-limit"));
29
+ const limit = (0, p_limit_1.default)(5);
30
+ function uploadUsers(users, entitiesInstance = new sdk_1.Entities()) {
31
+ return __awaiter(this, void 0, void 0, function* () {
32
+ yield Promise.all(users.map((user) => limit(() => __awaiter(this, void 0, void 0, function* () {
33
+ const { email } = user, rest = __rest(user, ["email"]);
34
+ yield entitiesInstance.create({
35
+ entityName: 'user-org',
36
+ object: Object.assign({ userEmail: email }, rest),
37
+ });
38
+ }))));
39
+ });
40
+ }
41
+ exports.uploadUsers = uploadUsers;
@@ -1,2 +1,2 @@
1
- export * from './export';
2
- export * from './import';
1
+ export * from './export';
2
+ export * from './import';
@@ -1,18 +1,18 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./export"), exports);
18
- __exportStar(require("./import"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./export"), exports);
18
+ __exportStar(require("./import"), exports);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/org-config-migration",
3
- "version": "1.1.13",
3
+ "version": "1.2.0",
4
4
  "description": "A collection of utilities that helps with importing and exporting of types, users, groups, and workflows.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.5.3-alpha.73bd011",
2
+ "version": "3.5.3-alpha.818a5c0",
3
3
  "commands": {
4
4
  "app:create": {
5
5
  "id": "app:create",
@@ -1239,6 +1239,112 @@
1239
1239
  }
1240
1240
  }
1241
1241
  },
1242
+ "org-config:export": {
1243
+ "id": "org-config:export",
1244
+ "description": "Export the org config (branding, sorting, and other org-level settings).",
1245
+ "strict": true,
1246
+ "pluginName": "@contrail/cli",
1247
+ "pluginAlias": "@contrail/cli",
1248
+ "pluginType": "core",
1249
+ "aliases": [],
1250
+ "examples": [
1251
+ "$ contrail org-config export\n"
1252
+ ],
1253
+ "flags": {
1254
+ "logLevel": {
1255
+ "name": "logLevel",
1256
+ "type": "option",
1257
+ "char": "l",
1258
+ "description": "The Log Level",
1259
+ "required": false,
1260
+ "multiple": false,
1261
+ "options": [
1262
+ "error",
1263
+ "warn",
1264
+ "info",
1265
+ "debug"
1266
+ ]
1267
+ },
1268
+ "alwaysConfirmEnv": {
1269
+ "name": "alwaysConfirmEnv",
1270
+ "type": "option",
1271
+ "char": "e",
1272
+ "description": "The Environment variables",
1273
+ "required": false,
1274
+ "multiple": false,
1275
+ "options": [
1276
+ "true",
1277
+ "false"
1278
+ ],
1279
+ "default": "true"
1280
+ },
1281
+ "outFile": {
1282
+ "name": "outFile",
1283
+ "type": "option",
1284
+ "char": "f",
1285
+ "description": "The location for the file to be saved",
1286
+ "required": false,
1287
+ "multiple": false,
1288
+ "default": "org-config.yml"
1289
+ },
1290
+ "overwrite": {
1291
+ "name": "overwrite",
1292
+ "type": "boolean",
1293
+ "description": "Replaces existing files if they exist",
1294
+ "required": false,
1295
+ "allowNo": false
1296
+ }
1297
+ },
1298
+ "args": {}
1299
+ },
1300
+ "org-config:import": {
1301
+ "id": "org-config:import",
1302
+ "description": "Import the org config from an org-config.yml file",
1303
+ "strict": true,
1304
+ "pluginName": "@contrail/cli",
1305
+ "pluginAlias": "@contrail/cli",
1306
+ "pluginType": "core",
1307
+ "aliases": [],
1308
+ "examples": [
1309
+ "$ contrail org-config import <ORG_CONFIG_FILE>\n"
1310
+ ],
1311
+ "flags": {
1312
+ "logLevel": {
1313
+ "name": "logLevel",
1314
+ "type": "option",
1315
+ "char": "l",
1316
+ "description": "The Log Level",
1317
+ "required": false,
1318
+ "multiple": false,
1319
+ "options": [
1320
+ "error",
1321
+ "warn",
1322
+ "info",
1323
+ "debug"
1324
+ ]
1325
+ },
1326
+ "alwaysConfirmEnv": {
1327
+ "name": "alwaysConfirmEnv",
1328
+ "type": "option",
1329
+ "char": "e",
1330
+ "description": "The Environment variables",
1331
+ "required": false,
1332
+ "multiple": false,
1333
+ "options": [
1334
+ "true",
1335
+ "false"
1336
+ ],
1337
+ "default": "true"
1338
+ }
1339
+ },
1340
+ "args": {
1341
+ "orgConfigFile": {
1342
+ "name": "orgConfigFile",
1343
+ "description": "The .yml file containing the org config",
1344
+ "required": true
1345
+ }
1346
+ }
1347
+ },
1242
1348
  "projects:export": {
1243
1349
  "id": "projects:export",
1244
1350
  "description": "Export a project.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/cli",
3
- "version": "3.5.3-alpha.73bd011",
3
+ "version": "3.5.3-alpha.818a5c0",
4
4
  "description": "VibeIQ's Contrail Platform CLI.",
5
5
  "bin": {
6
6
  "contrail-cli": "./bin/run",
@@ -32,7 +32,7 @@
32
32
  "dependencies": {
33
33
  "@contrail/entity-types": "^1.6.1",
34
34
  "@contrail/loader": "^2.0.9",
35
- "@contrail/org-config-migration": "^1.1.13",
35
+ "@contrail/org-config-migration": "^1.2.0",
36
36
  "@contrail/sdk": "^1.5.13",
37
37
  "@contrail/types": "^3.1.5",
38
38
  "@contrail/util": "^1.2.0",
@@ -1,2 +0,0 @@
1
- import { DataHolder } from '../interfaces';
2
- export declare function getReducedUsageInfo(data: DataHolder): any[];
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getReducedUsageInfo = void 0;
4
- function getReducedUsageInfo(data) {
5
- var _a, _b;
6
- if (!(data === null || data === void 0 ? void 0 : data.usageInfo) || !(data === null || data === void 0 ? void 0 : data.types)) {
7
- return [];
8
- }
9
- const typeProperties = ((_a = data.types) !== null && _a !== void 0 ? _a : []).flatMap((type) => { var _a; return (_a = type.typeProperties) !== null && _a !== void 0 ? _a : []; });
10
- return (_b = data === null || data === void 0 ? void 0 : data.usageInfo) === null || _b === void 0 ? void 0 : _b.map((x) => {
11
- const type = data.types.find((y) => y.id === x.typeId);
12
- const typeProperty = typeProperties.find((y) => y.id === x.typePropertyId);
13
- const typePropertySlug = typeProperty === null || typeProperty === void 0 ? void 0 : typeProperty.slug;
14
- return {
15
- used: x.used,
16
- editable: x.editable,
17
- formulaFunction: x.formulaFunction,
18
- validationFunction: x.validationFunction,
19
- numberFormat: x.numberFormat,
20
- defaultValue: x.defaultValue,
21
- label: x.label,
22
- typeSlug: type === null || type === void 0 ? void 0 : type.slug,
23
- typePath: type === null || type === void 0 ? void 0 : type.typePath,
24
- typePropertySlug,
25
- required: x.required,
26
- searchable: x.searchable,
27
- isUniqueProperty: x.isUniqueProperty,
28
- isUniquePropertyInFamily: x.isUniquePropertyInFamily,
29
- copyBehavior: x.copyBehavior,
30
- copyDefault: x.copyDefault,
31
- propertyLevel: x.propertyLevel,
32
- isArchived: x.isArchived,
33
- isFederationProperty: x.isFederationProperty,
34
- carryOverBehavior: x.carryOverBehavior,
35
- carryOverDefault: x.carryOverDefault,
36
- };
37
- }).sort((one, two) => (one.typePath < two.typePath ? -1 : 1));
38
- }
39
- exports.getReducedUsageInfo = getReducedUsageInfo;