@rockcarver/frodo-lib 0.12.6 → 0.12.7
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/CHANGELOG.md +10 -1
- package/cjs/api/ApiTypes.js.map +1 -1
- package/cjs/index.js +9 -1
- package/cjs/index.js.map +1 -1
- package/cjs/ops/CirclesOfTrustOps.js +1 -12
- package/cjs/ops/CirclesOfTrustOps.js.map +1 -1
- package/cjs/ops/EmailTemplateOps.js +0 -12
- package/cjs/ops/EmailTemplateOps.js.map +1 -1
- package/cjs/ops/IdpOps.js +1 -12
- package/cjs/ops/IdpOps.js.map +1 -1
- package/cjs/ops/JourneyOps.js +76 -193
- package/cjs/ops/JourneyOps.js.map +1 -1
- package/cjs/ops/NodeOps.js +31 -28
- package/cjs/ops/NodeOps.js.map +1 -1
- package/cjs/ops/OpsTypes.js +28 -0
- package/cjs/ops/OpsTypes.js.map +1 -1
- package/cjs/ops/Saml2Ops.js +1 -21
- package/cjs/ops/Saml2Ops.js.map +1 -1
- package/cjs/ops/ScriptOps.js +0 -12
- package/cjs/ops/ScriptOps.js.map +1 -1
- package/cjs/ops/ThemeOps.js +0 -12
- package/cjs/ops/ThemeOps.js.map +1 -1
- package/esm/index.mjs +3 -0
- package/esm/ops/CirclesOfTrustOps.mjs +1 -11
- package/esm/ops/EmailTemplateOps.mjs +1 -11
- package/esm/ops/IdpOps.mjs +1 -11
- package/esm/ops/JourneyOps.mjs +50 -148
- package/esm/ops/NodeOps.mjs +28 -26
- package/esm/ops/OpsTypes.mjs +24 -1
- package/esm/ops/Saml2Ops.mjs +1 -19
- package/esm/ops/ScriptOps.mjs +0 -10
- package/esm/ops/ThemeOps.mjs +0 -10
- package/package.json +3 -2
- package/types/api/ApiTypes.d.ts +1 -1
- package/types/api/ApiTypes.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/ops/CirclesOfTrustOps.d.ts +0 -7
- package/types/ops/CirclesOfTrustOps.d.ts.map +1 -1
- package/types/ops/EmailTemplateOps.d.ts +0 -7
- package/types/ops/EmailTemplateOps.d.ts.map +1 -1
- package/types/ops/IdpOps.d.ts +0 -7
- package/types/ops/IdpOps.d.ts.map +1 -1
- package/types/ops/JourneyOps.d.ts +4 -26
- package/types/ops/JourneyOps.d.ts.map +1 -1
- package/types/ops/NodeOps.d.ts +10 -8
- package/types/ops/NodeOps.d.ts.map +1 -1
- package/types/ops/OpsTypes.d.ts +12 -0
- package/types/ops/OpsTypes.d.ts.map +1 -1
- package/types/ops/Saml2Ops.d.ts +0 -7
- package/types/ops/Saml2Ops.d.ts.map +1 -1
- package/types/ops/ScriptOps.d.ts +0 -7
- package/types/ops/ScriptOps.d.ts.map +1 -1
- package/types/ops/ThemeOps.d.ts +0 -7
- package/types/ops/ThemeOps.d.ts.map +1 -1
package/cjs/ops/JourneyOps.js
CHANGED
|
@@ -8,7 +8,6 @@ exports.createMultiTreeExportTemplate = createMultiTreeExportTemplate;
|
|
|
8
8
|
exports.createSingleTreeExportTemplate = createSingleTreeExportTemplate;
|
|
9
9
|
exports.deleteJourney = deleteJourney;
|
|
10
10
|
exports.deleteJourneys = deleteJourneys;
|
|
11
|
-
exports.describeJourney = describeJourney;
|
|
12
11
|
exports.exportJourney = exportJourney;
|
|
13
12
|
exports.exportJourneyToFile = exportJourneyToFile;
|
|
14
13
|
exports.exportJourneysToFile = exportJourneysToFile;
|
|
@@ -18,7 +17,6 @@ exports.findOrphanedNodes = findOrphanedNodes;
|
|
|
18
17
|
exports.getJourneyClassification = getJourneyClassification;
|
|
19
18
|
exports.getJourneys = getJourneys;
|
|
20
19
|
exports.getNodeRef = getNodeRef;
|
|
21
|
-
exports.getOneLineDescription = getOneLineDescription;
|
|
22
20
|
exports.getTreeDescendents = getTreeDescendents;
|
|
23
21
|
exports.importFirstJourneyFromFile = importFirstJourneyFromFile;
|
|
24
22
|
exports.importJourney = importJourney;
|
|
@@ -46,19 +44,7 @@ var _SessionStorage = _interopRequireDefault(require("../storage/SessionStorage"
|
|
|
46
44
|
|
|
47
45
|
var _NodeApi = require("../api/NodeApi");
|
|
48
46
|
|
|
49
|
-
var
|
|
50
|
-
|
|
51
|
-
var EmailTemplate = _interopRequireWildcard(require("./EmailTemplateOps"));
|
|
52
|
-
|
|
53
|
-
var Script = _interopRequireWildcard(require("./ScriptOps"));
|
|
54
|
-
|
|
55
|
-
var Theme = _interopRequireWildcard(require("./ThemeOps"));
|
|
56
|
-
|
|
57
|
-
var Idp = _interopRequireWildcard(require("./IdpOps"));
|
|
58
|
-
|
|
59
|
-
var Saml2 = _interopRequireWildcard(require("./Saml2Ops"));
|
|
60
|
-
|
|
61
|
-
var CirclesOfTrust = _interopRequireWildcard(require("./CirclesOfTrustOps"));
|
|
47
|
+
var _NodeOps = require("./NodeOps");
|
|
62
48
|
|
|
63
49
|
var _TreeApi = require("../api/TreeApi");
|
|
64
50
|
|
|
@@ -82,18 +68,16 @@ var _SocialIdentityProvidersApi = require("../api/SocialIdentityProvidersApi");
|
|
|
82
68
|
|
|
83
69
|
var _ThemeApi = require("../api/ThemeApi");
|
|
84
70
|
|
|
71
|
+
var _ScriptOps = require("./ScriptOps");
|
|
72
|
+
|
|
73
|
+
var _OpsTypes = require("./OpsTypes");
|
|
74
|
+
|
|
85
75
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
86
76
|
|
|
87
77
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
88
78
|
|
|
89
79
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
90
80
|
|
|
91
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
92
|
-
|
|
93
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
94
|
-
|
|
95
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
96
|
-
|
|
97
81
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
98
82
|
|
|
99
83
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
@@ -102,22 +86,11 @@ var containerNodes = ['PageNode', 'CustomPageNode'];
|
|
|
102
86
|
var scriptedNodes = ['ConfigProviderNode', 'ScriptedDecisionNode', 'ClientScriptNode', 'SocialProviderHandlerNode', 'CustomScriptNode'];
|
|
103
87
|
var emailTemplateNodes = ['EmailSuspendNode', 'EmailTemplateNode'];
|
|
104
88
|
var emptyScriptPlaceholder = '[Empty]';
|
|
105
|
-
/**
|
|
106
|
-
* Get a one-line description of the tree object
|
|
107
|
-
* @param {TreeSkeleton} treeObj circle of trust object to describe
|
|
108
|
-
* @returns {string} a one-line description
|
|
109
|
-
*/
|
|
110
|
-
|
|
111
|
-
function getOneLineDescription(treeObj) {
|
|
112
|
-
var description = "[".concat(treeObj._id['brightCyan'], "]");
|
|
113
|
-
return description;
|
|
114
|
-
}
|
|
115
89
|
/**
|
|
116
90
|
* Create an empty single tree export template
|
|
117
91
|
* @returns {SingleTreeExportInterface} an empty single tree export template
|
|
118
92
|
*/
|
|
119
93
|
|
|
120
|
-
|
|
121
94
|
function createSingleTreeExportTemplate() {
|
|
122
95
|
return {
|
|
123
96
|
meta: {},
|
|
@@ -716,7 +689,7 @@ function _importJourney() {
|
|
|
716
689
|
scriptObject['script'] = (0, _Base.encode)(JSON.parse(scriptObject['script']));
|
|
717
690
|
}
|
|
718
691
|
|
|
719
|
-
if ((yield (0,
|
|
692
|
+
if ((yield (0, _ScriptOps.createOrUpdateScript)(scriptId, scriptObject)) == null) {
|
|
720
693
|
throw new Error("Error importing script ".concat(scriptObject['name'], " (").concat(scriptId, ") in journey ").concat(treeId));
|
|
721
694
|
}
|
|
722
695
|
|
|
@@ -907,8 +880,29 @@ function _importJourney() {
|
|
|
907
880
|
try {
|
|
908
881
|
yield (0, _NodeApi.putNode)(newUuid, nodeType, innerNodeData);
|
|
909
882
|
} catch (nodeImportError) {
|
|
883
|
+
var _nodeImportError$resp, _nodeImportError$resp2, _nodeImportError$resp3;
|
|
884
|
+
|
|
910
885
|
if (nodeImportError.response.status === 400 && nodeImportError.response.data.message === 'Data validation failed for the attribute, Script') {
|
|
911
886
|
throw new Error("Missing script ".concat(innerNodeData['script'], " referenced by inner node ").concat(innerNodeId).concat(innerNodeId === newUuid ? '' : " [".concat(newUuid, "]"), " (").concat(innerNodeData['_type']['_id'], ") in journey ").concat(treeId, "."));
|
|
887
|
+
} else if (((_nodeImportError$resp = nodeImportError.response) === null || _nodeImportError$resp === void 0 ? void 0 : _nodeImportError$resp.status) === 400 && ((_nodeImportError$resp2 = nodeImportError.response) === null || _nodeImportError$resp2 === void 0 ? void 0 : (_nodeImportError$resp3 = _nodeImportError$resp2.data) === null || _nodeImportError$resp3 === void 0 ? void 0 : _nodeImportError$resp3.message) === 'Invalid attribute specified.') {
|
|
888
|
+
var {
|
|
889
|
+
validAttributes
|
|
890
|
+
} = nodeImportError.response.data.detail;
|
|
891
|
+
validAttributes.push('_id');
|
|
892
|
+
|
|
893
|
+
for (var attribute of Object.keys(innerNodeData)) {
|
|
894
|
+
if (!validAttributes.includes(attribute)) {
|
|
895
|
+
if (verbose) (0, _Console.printMessage)("\n - Removing invalid attribute: ".concat(attribute), 'warn', false);
|
|
896
|
+
delete innerNodeData[attribute];
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
try {
|
|
901
|
+
yield (0, _NodeApi.putNode)(newUuid, nodeType, innerNodeData);
|
|
902
|
+
} catch (nodeImportError2) {
|
|
903
|
+
(0, _Console.printMessage)(nodeImportError2.response.data, 'error');
|
|
904
|
+
throw new Error("Error importing node ".concat(innerNodeId).concat(innerNodeId === newUuid ? '' : " [".concat(newUuid, "]"), " in journey ").concat(treeId));
|
|
905
|
+
}
|
|
912
906
|
} else {
|
|
913
907
|
(0, _Console.printMessage)(nodeImportError.response.data, 'error');
|
|
914
908
|
throw new Error("Error importing inner node ".concat(innerNodeId).concat(innerNodeId === newUuid ? '' : " [".concat(newUuid, "]"), " in journey ").concat(treeId));
|
|
@@ -956,8 +950,30 @@ function _importJourney() {
|
|
|
956
950
|
try {
|
|
957
951
|
yield (0, _NodeApi.putNode)(newUuid, _nodeType, nodeData);
|
|
958
952
|
} catch (nodeImportError) {
|
|
953
|
+
var _nodeImportError$resp4, _nodeImportError$resp5, _nodeImportError$resp6;
|
|
954
|
+
|
|
959
955
|
if (nodeImportError.response.status === 400 && nodeImportError.response.data.message === 'Data validation failed for the attribute, Script') {
|
|
960
956
|
throw new Error("Missing script ".concat(nodeData['script'], " referenced by node ").concat(nodeId).concat(nodeId === newUuid ? '' : " [".concat(newUuid, "]"), " (").concat(nodeData['_type']['_id'], ") in journey ").concat(treeId, "."));
|
|
957
|
+
} else if (((_nodeImportError$resp4 = nodeImportError.response) === null || _nodeImportError$resp4 === void 0 ? void 0 : _nodeImportError$resp4.status) === 400 && ((_nodeImportError$resp5 = nodeImportError.response) === null || _nodeImportError$resp5 === void 0 ? void 0 : (_nodeImportError$resp6 = _nodeImportError$resp5.data) === null || _nodeImportError$resp6 === void 0 ? void 0 : _nodeImportError$resp6.message) === 'Invalid attribute specified.') {
|
|
958
|
+
var {
|
|
959
|
+
validAttributes: _validAttributes
|
|
960
|
+
} = nodeImportError.response.data.detail;
|
|
961
|
+
|
|
962
|
+
_validAttributes.push('_id');
|
|
963
|
+
|
|
964
|
+
for (var _attribute of Object.keys(nodeData)) {
|
|
965
|
+
if (!_validAttributes.includes(_attribute)) {
|
|
966
|
+
if (verbose) (0, _Console.printMessage)("\n - Removing invalid attribute: ".concat(_attribute), 'warn', false);
|
|
967
|
+
delete nodeData[_attribute];
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
try {
|
|
972
|
+
yield (0, _NodeApi.putNode)(newUuid, _nodeType, nodeData);
|
|
973
|
+
} catch (nodeImportError2) {
|
|
974
|
+
(0, _Console.printMessage)(nodeImportError2.response.data, 'error');
|
|
975
|
+
throw new Error("Error importing node ".concat(nodeId).concat(nodeId === newUuid ? '' : " [".concat(newUuid, "]"), " in journey ").concat(treeId));
|
|
976
|
+
}
|
|
961
977
|
} else {
|
|
962
978
|
(0, _Console.printMessage)(nodeImportError.response.data, 'error');
|
|
963
979
|
throw new Error("Error importing node ".concat(nodeId).concat(nodeId === newUuid ? '' : " [".concat(newUuid, "]"), " in journey ").concat(treeId));
|
|
@@ -984,7 +1000,7 @@ function _importJourney() {
|
|
|
984
1000
|
// Set the identityResource for the tree to the selected resource.
|
|
985
1001
|
|
|
986
1002
|
|
|
987
|
-
if (treeObject.tree.identityResource && treeObject.tree['identityResource'].endsWith('user')) {
|
|
1003
|
+
if (treeObject.tree.identityResource && treeObject.tree['identityResource'].endsWith('user') || _SessionStorage.default.session.getDeploymentType() === global.CLOUD_DEPLOYMENT_TYPE_KEY || _SessionStorage.default.session.getDeploymentType() === global.FORGEOPS_DEPLOYMENT_TYPE_KEY) {
|
|
988
1004
|
treeObject.tree.identityResource = "managed/".concat((0, _OpsUtils.getRealmManagedUser)());
|
|
989
1005
|
if (verbose) (0, _Console.printMessage)(" - identityResource: ".concat(treeObject.tree.identityResource), 'info', false);
|
|
990
1006
|
}
|
|
@@ -999,14 +1015,15 @@ function _importJourney() {
|
|
|
999
1015
|
|
|
1000
1016
|
if (((_importError$response6 = importError.response) === null || _importError$response6 === void 0 ? void 0 : _importError$response6.status) === 400 && ((_importError$response7 = importError.response) === null || _importError$response7 === void 0 ? void 0 : (_importError$response8 = _importError$response7.data) === null || _importError$response8 === void 0 ? void 0 : _importError$response8.message) === 'Invalid attribute specified.') {
|
|
1001
1017
|
var {
|
|
1002
|
-
validAttributes
|
|
1018
|
+
validAttributes: _validAttributes2
|
|
1003
1019
|
} = importError.response.data.detail;
|
|
1004
|
-
validAttributes.push('_id');
|
|
1005
1020
|
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1021
|
+
_validAttributes2.push('_id');
|
|
1022
|
+
|
|
1023
|
+
for (var _attribute2 of Object.keys(treeObject.tree)) {
|
|
1024
|
+
if (!_validAttributes2.includes(_attribute2)) {
|
|
1025
|
+
if (verbose) (0, _Console.printMessage)("\n - Removing invalid attribute: ".concat(_attribute2), 'warn', false);
|
|
1026
|
+
delete treeObject.tree[_attribute2];
|
|
1010
1027
|
}
|
|
1011
1028
|
}
|
|
1012
1029
|
|
|
@@ -1161,7 +1178,7 @@ function _importJourneyFromFile() {
|
|
|
1161
1178
|
}
|
|
1162
1179
|
});
|
|
1163
1180
|
|
|
1164
|
-
return function (
|
|
1181
|
+
return function (_x34, _x35) {
|
|
1165
1182
|
return _ref4.apply(this, arguments);
|
|
1166
1183
|
};
|
|
1167
1184
|
}());
|
|
@@ -1241,7 +1258,7 @@ function _importFirstJourneyFromFile() {
|
|
|
1241
1258
|
|
|
1242
1259
|
});
|
|
1243
1260
|
|
|
1244
|
-
return function (
|
|
1261
|
+
return function (_x36, _x37) {
|
|
1245
1262
|
return _ref5.apply(this, arguments);
|
|
1246
1263
|
};
|
|
1247
1264
|
}());
|
|
@@ -1484,6 +1501,11 @@ function createFileParamTreeExportResolver(file) {
|
|
|
1484
1501
|
function getTreeDescendents(_x29) {
|
|
1485
1502
|
return _getTreeDescendents.apply(this, arguments);
|
|
1486
1503
|
}
|
|
1504
|
+
/**
|
|
1505
|
+
* Find all node configuration objects that are no longer referenced by any tree
|
|
1506
|
+
* @returns {Promise<unknown[]>} a promise that resolves to an array of orphaned nodes
|
|
1507
|
+
*/
|
|
1508
|
+
|
|
1487
1509
|
|
|
1488
1510
|
function _getTreeDescendents() {
|
|
1489
1511
|
_getTreeDescendents = _asyncToGenerator(function* (treeExport) {
|
|
@@ -1517,145 +1539,6 @@ function _getTreeDescendents() {
|
|
|
1517
1539
|
return _getTreeDescendents.apply(this, arguments);
|
|
1518
1540
|
}
|
|
1519
1541
|
|
|
1520
|
-
function describeTreeDescendents(descendents) {
|
|
1521
|
-
var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1522
|
-
|
|
1523
|
-
if ([Object.values(descendents)].length) {
|
|
1524
|
-
// heading
|
|
1525
|
-
if (depth === 0) {
|
|
1526
|
-
(0, _Console.printMessage)("\nInner Tree Dependencies (".concat(Object.values(descendents)[0].length, "):"), 'data');
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1529
|
-
var indent = Array(depth * 2).fill(' ').join('');
|
|
1530
|
-
var [tree] = Object.keys(descendents);
|
|
1531
|
-
(0, _Console.printMessage)("".concat(indent, "- ").concat(tree), 'data');
|
|
1532
|
-
|
|
1533
|
-
for (var descendent of descendents[tree]) {
|
|
1534
|
-
describeTreeDescendents(descendent, depth + 1);
|
|
1535
|
-
}
|
|
1536
|
-
}
|
|
1537
|
-
}
|
|
1538
|
-
/**
|
|
1539
|
-
* Describe a journey:
|
|
1540
|
-
* - Properties, tags, description, name, metadata
|
|
1541
|
-
* - Inner tree dependency tree
|
|
1542
|
-
* - Node type summary
|
|
1543
|
-
* - Nodes
|
|
1544
|
-
* - Themes
|
|
1545
|
-
* - Scripts
|
|
1546
|
-
* - Email templates
|
|
1547
|
-
* - Social identity providers
|
|
1548
|
-
* - SAML2 entity providers
|
|
1549
|
-
* - SAML2 circles of trust
|
|
1550
|
-
* @param {SingleTreeExportInterface} journeyData journey export object
|
|
1551
|
-
* @param {TreeExportResolverInterface} resolveTreeExport tree export resolver callback function
|
|
1552
|
-
*/
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
function describeJourney(_x30) {
|
|
1556
|
-
return _describeJourney.apply(this, arguments);
|
|
1557
|
-
}
|
|
1558
|
-
/**
|
|
1559
|
-
* Find all node configuration objects that are no longer referenced by any tree
|
|
1560
|
-
* @returns {Promise<unknown[]>} a promise that resolves to an array of orphaned nodes
|
|
1561
|
-
*/
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
function _describeJourney() {
|
|
1565
|
-
_describeJourney = _asyncToGenerator(function* (journeyData) {
|
|
1566
|
-
var _journeyData$themes;
|
|
1567
|
-
|
|
1568
|
-
var resolveTreeExport = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : onlineTreeExportResolver;
|
|
1569
|
-
|
|
1570
|
-
var allNodes = _objectSpread(_objectSpread({}, journeyData.nodes), journeyData.innerNodes);
|
|
1571
|
-
|
|
1572
|
-
var nodeTypeMap = {};
|
|
1573
|
-
|
|
1574
|
-
for (var nodeData of Object.values(allNodes)) {
|
|
1575
|
-
if (nodeTypeMap[nodeData._type._id]) {
|
|
1576
|
-
nodeTypeMap[nodeData._type._id] += 1;
|
|
1577
|
-
} else {
|
|
1578
|
-
nodeTypeMap[nodeData._type._id] = 1;
|
|
1579
|
-
}
|
|
1580
|
-
}
|
|
1581
|
-
|
|
1582
|
-
(0, _Console.printMessage)("".concat(getOneLineDescription(journeyData.tree)), 'data');
|
|
1583
|
-
(0, _Console.printMessage)(Array("[".concat(journeyData.tree._id, "]")['length']).fill('=').join(''));
|
|
1584
|
-
|
|
1585
|
-
if (journeyData.tree.description) {
|
|
1586
|
-
(0, _Console.printMessage)("\n".concat(journeyData.tree.description['brightYellow']), 'data');
|
|
1587
|
-
}
|
|
1588
|
-
|
|
1589
|
-
var descendents = yield getTreeDescendents(journeyData, resolveTreeExport);
|
|
1590
|
-
describeTreeDescendents(descendents);
|
|
1591
|
-
|
|
1592
|
-
if (Object.entries(nodeTypeMap).length) {
|
|
1593
|
-
(0, _Console.printMessage)("\nNode Types (".concat(Object.entries(nodeTypeMap).length, "):"), 'data');
|
|
1594
|
-
|
|
1595
|
-
for (var [name, count] of Object.entries(nodeTypeMap)) {
|
|
1596
|
-
(0, _Console.printMessage)("- ".concat(String(count), " [").concat(name['brightCyan'], "]"), 'data');
|
|
1597
|
-
}
|
|
1598
|
-
}
|
|
1599
|
-
|
|
1600
|
-
if (Object.entries(allNodes).length) {
|
|
1601
|
-
(0, _Console.printMessage)("\nNodes (".concat(Object.entries(allNodes).length, "):"), 'data');
|
|
1602
|
-
|
|
1603
|
-
for (var nodeObj of Object.values(allNodes)) {
|
|
1604
|
-
(0, _Console.printMessage)("- ".concat(Node.getOneLineDescription(nodeObj, getNodeRef(nodeObj, journeyData))), 'data');
|
|
1605
|
-
}
|
|
1606
|
-
}
|
|
1607
|
-
|
|
1608
|
-
if ((_journeyData$themes = journeyData.themes) !== null && _journeyData$themes !== void 0 && _journeyData$themes.length) {
|
|
1609
|
-
(0, _Console.printMessage)("\nThemes (".concat(journeyData.themes.length, "):"), 'data');
|
|
1610
|
-
|
|
1611
|
-
for (var themeData of journeyData.themes) {
|
|
1612
|
-
(0, _Console.printMessage)("- ".concat(Theme.getOneLineDescription(themeData)), 'data');
|
|
1613
|
-
}
|
|
1614
|
-
}
|
|
1615
|
-
|
|
1616
|
-
if (Object.entries(journeyData.scripts).length) {
|
|
1617
|
-
(0, _Console.printMessage)("\nScripts (".concat(Object.entries(journeyData.scripts).length, "):"), 'data');
|
|
1618
|
-
|
|
1619
|
-
for (var scriptData of Object.values(journeyData.scripts)) {
|
|
1620
|
-
(0, _Console.printMessage)("- ".concat(Script.getOneLineDescription(scriptData)), 'data');
|
|
1621
|
-
}
|
|
1622
|
-
}
|
|
1623
|
-
|
|
1624
|
-
if (Object.entries(journeyData.emailTemplates).length) {
|
|
1625
|
-
(0, _Console.printMessage)("\nEmail Templates (".concat(Object.entries(journeyData.emailTemplates).length, "):"), 'data');
|
|
1626
|
-
|
|
1627
|
-
for (var templateData of Object.values(journeyData.emailTemplates)) {
|
|
1628
|
-
(0, _Console.printMessage)("- ".concat(EmailTemplate.getOneLineDescription(templateData)), 'data');
|
|
1629
|
-
}
|
|
1630
|
-
}
|
|
1631
|
-
|
|
1632
|
-
if (Object.entries(journeyData.socialIdentityProviders).length) {
|
|
1633
|
-
(0, _Console.printMessage)("\nSocial Identity Providers (".concat(Object.entries(journeyData.socialIdentityProviders).length, "):"), 'data');
|
|
1634
|
-
|
|
1635
|
-
for (var socialIdpData of Object.values(journeyData.socialIdentityProviders)) {
|
|
1636
|
-
(0, _Console.printMessage)("- ".concat(Idp.getOneLineDescription(socialIdpData)), 'data');
|
|
1637
|
-
}
|
|
1638
|
-
}
|
|
1639
|
-
|
|
1640
|
-
if (Object.entries(journeyData.saml2Entities).length) {
|
|
1641
|
-
(0, _Console.printMessage)("\nSAML2 Entity Providers (".concat(Object.entries(journeyData.saml2Entities).length, "):"), 'data');
|
|
1642
|
-
|
|
1643
|
-
for (var entityProviderData of Object.values(journeyData.saml2Entities)) {
|
|
1644
|
-
(0, _Console.printMessage)("- ".concat(Saml2.getOneLineDescription(entityProviderData)), 'data');
|
|
1645
|
-
}
|
|
1646
|
-
}
|
|
1647
|
-
|
|
1648
|
-
if (Object.entries(journeyData.circlesOfTrust).length) {
|
|
1649
|
-
(0, _Console.printMessage)("\nSAML2 Circles Of Trust (".concat(Object.entries(journeyData.circlesOfTrust).length, "):"), 'data');
|
|
1650
|
-
|
|
1651
|
-
for (var cotData of Object.values(journeyData.circlesOfTrust)) {
|
|
1652
|
-
(0, _Console.printMessage)("- ".concat(CirclesOfTrust.getOneLineDescription(cotData)), 'data');
|
|
1653
|
-
}
|
|
1654
|
-
}
|
|
1655
|
-
});
|
|
1656
|
-
return _describeJourney.apply(this, arguments);
|
|
1657
|
-
}
|
|
1658
|
-
|
|
1659
1542
|
function findOrphanedNodes() {
|
|
1660
1543
|
return _findOrphanedNodes.apply(this, arguments);
|
|
1661
1544
|
}
|
|
@@ -1742,7 +1625,7 @@ function _findOrphanedNodes() {
|
|
|
1742
1625
|
return _findOrphanedNodes.apply(this, arguments);
|
|
1743
1626
|
}
|
|
1744
1627
|
|
|
1745
|
-
function removeOrphanedNodes(
|
|
1628
|
+
function removeOrphanedNodes(_x30) {
|
|
1746
1629
|
return _removeOrphanedNodes.apply(this, arguments);
|
|
1747
1630
|
}
|
|
1748
1631
|
/**
|
|
@@ -1779,7 +1662,7 @@ function isCustomJourney(journey) {
|
|
|
1779
1662
|
var nodeList = Object.values(journey.nodes).concat(Object.values(journey.innerNodes));
|
|
1780
1663
|
|
|
1781
1664
|
for (var node of nodeList) {
|
|
1782
|
-
if ((0,
|
|
1665
|
+
if ((0, _NodeOps.isCustomNode)(node['_type']['_id'])) {
|
|
1783
1666
|
return true;
|
|
1784
1667
|
}
|
|
1785
1668
|
}
|
|
@@ -1797,7 +1680,7 @@ function isPremiumJourney(journey) {
|
|
|
1797
1680
|
var nodeList = Object.values(journey.nodes).concat(Object.values(journey.innerNodes));
|
|
1798
1681
|
|
|
1799
1682
|
for (var node of nodeList) {
|
|
1800
|
-
if ((0,
|
|
1683
|
+
if ((0, _NodeOps.isPremiumNode)(node['_type']['_id'])) {
|
|
1801
1684
|
return true;
|
|
1802
1685
|
}
|
|
1803
1686
|
}
|
|
@@ -1815,7 +1698,7 @@ function isCloudOnlyJourney(journey) {
|
|
|
1815
1698
|
var nodeList = Object.values(journey.nodes).concat(Object.values(journey.innerNodes));
|
|
1816
1699
|
|
|
1817
1700
|
for (var node of nodeList) {
|
|
1818
|
-
if ((0,
|
|
1701
|
+
if ((0, _NodeOps.isCloudOnlyNode)(node['_type']['_id'])) {
|
|
1819
1702
|
return true;
|
|
1820
1703
|
}
|
|
1821
1704
|
}
|
|
@@ -1828,7 +1711,7 @@ function isCloudOnlyJourney(journey) {
|
|
|
1828
1711
|
* - cloud: utilize nodes, which are exclusively available in the ForgeRock Identity Cloud
|
|
1829
1712
|
* - premium: utilizes nodes, which come at a premium
|
|
1830
1713
|
* @param {SingleTreeExportInterface} journey journey export data
|
|
1831
|
-
* @returns {
|
|
1714
|
+
* @returns {JourneyClassification[]} an array of one or multiple classifications
|
|
1832
1715
|
*/
|
|
1833
1716
|
|
|
1834
1717
|
|
|
@@ -1839,14 +1722,14 @@ function getJourneyClassification(journey) {
|
|
|
1839
1722
|
var cloud = isCloudOnlyJourney(journey);
|
|
1840
1723
|
|
|
1841
1724
|
if (custom) {
|
|
1842
|
-
classifications.push(
|
|
1725
|
+
classifications.push(_OpsTypes.JourneyClassification.CUSTOM);
|
|
1843
1726
|
} else if (cloud) {
|
|
1844
|
-
classifications.push(
|
|
1727
|
+
classifications.push(_OpsTypes.JourneyClassification.CLOUD);
|
|
1845
1728
|
} else {
|
|
1846
|
-
classifications.push(
|
|
1729
|
+
classifications.push(_OpsTypes.JourneyClassification.STANDARD);
|
|
1847
1730
|
}
|
|
1848
1731
|
|
|
1849
|
-
if (premium) classifications.push(
|
|
1732
|
+
if (premium) classifications.push(_OpsTypes.JourneyClassification.PREMIUM);
|
|
1850
1733
|
return classifications;
|
|
1851
1734
|
}
|
|
1852
1735
|
/**
|
|
@@ -1921,7 +1804,7 @@ function _listJourneys() {
|
|
|
1921
1804
|
return _listJourneys.apply(this, arguments);
|
|
1922
1805
|
}
|
|
1923
1806
|
|
|
1924
|
-
function deleteJourney(
|
|
1807
|
+
function deleteJourney(_x31, _x32) {
|
|
1925
1808
|
return _deleteJourney.apply(this, arguments);
|
|
1926
1809
|
}
|
|
1927
1810
|
/**
|
|
@@ -2050,7 +1933,7 @@ function _deleteJourney() {
|
|
|
2050
1933
|
return status;
|
|
2051
1934
|
});
|
|
2052
1935
|
|
|
2053
|
-
return function (
|
|
1936
|
+
return function (_x38) {
|
|
2054
1937
|
return _ref6.apply(this, arguments);
|
|
2055
1938
|
};
|
|
2056
1939
|
}()).catch(error => {
|
|
@@ -2064,7 +1947,7 @@ function _deleteJourney() {
|
|
|
2064
1947
|
return _deleteJourney.apply(this, arguments);
|
|
2065
1948
|
}
|
|
2066
1949
|
|
|
2067
|
-
function deleteJourneys(
|
|
1950
|
+
function deleteJourneys(_x33) {
|
|
2068
1951
|
return _deleteJourneys.apply(this, arguments);
|
|
2069
1952
|
}
|
|
2070
1953
|
|