@rockcarver/frodo-lib 2.0.0-37 → 2.0.0-39

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/build.zip CHANGED
Binary file
@@ -439,9 +439,9 @@ function _exportJourney() {
439
439
  useStringArrays,
440
440
  deps
441
441
  } = options;
442
- var verbose = state.getDebug();
442
+ var verbose = state.getVerbose();
443
443
  if (verbose) (0, _Console.printMessage)({
444
- message: "\n- ".concat(_treeObject._id, "\n"),
444
+ message: "- ".concat(_treeObject._id),
445
445
  type: 'info',
446
446
  newline: false,
447
447
  state
@@ -449,17 +449,20 @@ function _exportJourney() {
449
449
 
450
450
  // Process tree
451
451
  if (verbose) (0, _Console.printMessage)({
452
- message: ' - Flow',
452
+ message: '\n - Flow',
453
+ newline: false,
453
454
  state
454
455
  });
455
456
  exportData.tree = _treeObject;
456
457
  if (verbose && _treeObject.identityResource) (0, _Console.printMessage)({
457
- message: " - identityResource: ".concat(_treeObject.identityResource),
458
- state,
459
- type: 'info'
458
+ message: "\n - identityResource: ".concat(_treeObject.identityResource),
459
+ type: 'info',
460
+ newline: false,
461
+ state
460
462
  });
461
463
  if (verbose) (0, _Console.printMessage)({
462
- message: " - Done",
464
+ message: "\n - Done",
465
+ newline: false,
463
466
  type: 'info',
464
467
  state
465
468
  });
@@ -489,7 +492,8 @@ function _exportJourney() {
489
492
  }));
490
493
  }
491
494
  if (verbose && nodePromises.length > 0) (0, _Console.printMessage)({
492
- message: ' - Nodes:',
495
+ message: '\n - Nodes:',
496
+ newline: false,
493
497
  state
494
498
  });
495
499
  var nodeObjects = yield Promise.all(nodePromises);
@@ -499,9 +503,9 @@ function _exportJourney() {
499
503
  var _nodeId = nodeObject._id;
500
504
  var nodeType = nodeObject._type._id;
501
505
  if (verbose) (0, _Console.printMessage)({
502
- message: " - ".concat(_nodeId, " (").concat(nodeType, ")"),
506
+ message: "\n - ".concat(_nodeId, " (").concat(nodeType, ")"),
503
507
  type: 'info',
504
- newline: true,
508
+ newline: false,
505
509
  state
506
510
  });
507
511
  exportData.nodes[nodeObject._id] = nodeObject;
@@ -609,7 +613,8 @@ function _exportJourney() {
609
613
 
610
614
  // Process inner nodes
611
615
  if (verbose && innerNodePromises.length > 0) (0, _Console.printMessage)({
612
- message: ' - Inner nodes:',
616
+ message: '\n - Inner nodes:',
617
+ newline: false,
613
618
  state
614
619
  });
615
620
  try {
@@ -620,9 +625,9 @@ function _exportJourney() {
620
625
  var innerNodeId = innerNodeObject._id;
621
626
  var innerNodeType = innerNodeObject._type._id;
622
627
  if (verbose) (0, _Console.printMessage)({
623
- message: " - ".concat(innerNodeId, " (").concat(innerNodeType, ")"),
628
+ message: "\n - ".concat(innerNodeId, " (").concat(innerNodeType, ")"),
624
629
  type: 'info',
625
- newline: true,
630
+ newline: false,
626
631
  state
627
632
  });
628
633
  exportData.innerNodes[innerNodeId] = innerNodeObject;
@@ -707,7 +712,8 @@ function _exportJourney() {
707
712
 
708
713
  // Process email templates
709
714
  if (verbose && emailTemplatePromises.length > 0) (0, _Console.printMessage)({
710
- message: ' - Email templates:',
715
+ message: '\n - Email templates:',
716
+ newline: false,
711
717
  state
712
718
  });
713
719
  try {
@@ -715,9 +721,9 @@ function _exportJourney() {
715
721
  for (var _settledPromise of settledEmailTemplatePromises) {
716
722
  if (_settledPromise.status === 'fulfilled' && _settledPromise.value) {
717
723
  if (verbose) (0, _Console.printMessage)({
718
- message: " - ".concat(_settledPromise.value._id.split('/')[1]).concat(_settledPromise.value.displayName ? " (".concat(_settledPromise.value.displayName, ")") : ''),
724
+ message: "\n - ".concat(_settledPromise.value._id.split('/')[1]).concat(_settledPromise.value.displayName ? " (".concat(_settledPromise.value.displayName, ")") : ''),
719
725
  type: 'info',
720
- newline: true,
726
+ newline: false,
721
727
  state
722
728
  });
723
729
  exportData.emailTemplates[_settledPromise.value._id.split('/')[1]] = _settledPromise.value;
@@ -735,25 +741,29 @@ function _exportJourney() {
735
741
  for (var saml2NodeDependency of saml2NodeDependencies) {
736
742
  if (saml2NodeDependency) {
737
743
  if (verbose) (0, _Console.printMessage)({
738
- message: ' - SAML2 entity providers:',
744
+ message: '\n - SAML2 entity providers:',
745
+ newline: false,
739
746
  state
740
747
  });
741
748
  for (var saml2Entity of saml2NodeDependency.saml2Entities) {
742
749
  if (verbose) (0, _Console.printMessage)({
743
- message: " - ".concat(saml2Entity.entityLocation, " ").concat(saml2Entity.entityId),
750
+ message: "\n - ".concat(saml2Entity.entityLocation, " ").concat(saml2Entity.entityId),
744
751
  type: 'info',
752
+ newline: false,
745
753
  state
746
754
  });
747
755
  exportData.saml2Entities[saml2Entity._id] = saml2Entity;
748
756
  }
749
757
  if (verbose) (0, _Console.printMessage)({
750
- message: ' - SAML2 circles of trust:',
758
+ message: '\n - SAML2 circles of trust:',
759
+ newline: false,
751
760
  state
752
761
  });
753
762
  for (var circleOfTrust of saml2NodeDependency.circlesOfTrust) {
754
763
  if (verbose) (0, _Console.printMessage)({
755
- message: " - ".concat(circleOfTrust._id),
764
+ message: "\n - ".concat(circleOfTrust._id),
756
765
  type: 'info',
766
+ newline: false,
757
767
  state
758
768
  });
759
769
  exportData.circlesOfTrust[circleOfTrust._id] = circleOfTrust;
@@ -771,7 +781,8 @@ function _exportJourney() {
771
781
  var socialProviders = yield Promise.resolve(socialProviderPromise);
772
782
  if (socialProviders) {
773
783
  if (verbose) (0, _Console.printMessage)({
774
- message: ' - OAuth2/OIDC (social) identity providers:',
784
+ message: '\n - OAuth2/OIDC (social) identity providers:',
785
+ newline: false,
775
786
  state
776
787
  });
777
788
  for (var socialProvider of socialProviders.result) {
@@ -779,8 +790,9 @@ function _exportJourney() {
779
790
  // filteredProviders property of a SelectIdPNode do it here.
780
791
  if (socialProvider && (!filteredSocialProviders || filteredSocialProviders.length === 0 || filteredSocialProviders.includes(socialProvider._id))) {
781
792
  if (verbose) (0, _Console.printMessage)({
782
- message: " - ".concat(socialProvider._id),
793
+ message: "\n - ".concat(socialProvider._id),
783
794
  type: 'info',
795
+ newline: false,
784
796
  state
785
797
  });
786
798
  scriptPromises.push((0, _ScriptApi.getScript)({
@@ -799,7 +811,8 @@ function _exportJourney() {
799
811
 
800
812
  // Process scripts
801
813
  if (verbose && scriptPromises.length > 0) (0, _Console.printMessage)({
802
- message: ' - Scripts:',
814
+ message: '\n - Scripts:',
815
+ newline: false,
803
816
  state
804
817
  });
805
818
  try {
@@ -807,9 +820,9 @@ function _exportJourney() {
807
820
  for (var scriptObject of scriptObjects) {
808
821
  if (scriptObject) {
809
822
  if (verbose) (0, _Console.printMessage)({
810
- message: " - ".concat(scriptObject._id, " (").concat(scriptObject.name, ")"),
823
+ message: "\n - ".concat(scriptObject._id, " (").concat(scriptObject.name, ")"),
811
824
  type: 'info',
812
- newline: true,
825
+ newline: false,
813
826
  state
814
827
  });
815
828
  scriptObject.script = useStringArrays ? (0, _ExportImportUtils.convertBase64TextToArray)(scriptObject.script) : JSON.stringify((0, _Base64Utils.decode)(scriptObject.script));
@@ -825,7 +838,8 @@ function _exportJourney() {
825
838
  // Process themes
826
839
  if (themePromise) {
827
840
  if (verbose) (0, _Console.printMessage)({
828
- message: ' - Themes:',
841
+ message: '\n - Themes:',
842
+ newline: false,
829
843
  state
830
844
  });
831
845
  try {
@@ -837,8 +851,9 @@ function _exportJourney() {
837
851
  themes.includes(themeObject._id) || themes.includes(themeObject.name) || // has this journey been linked to a theme?
838
852
  (_themeObject$linkedTr = themeObject.linkedTrees) !== null && _themeObject$linkedTr !== void 0 && _themeObject$linkedTr.includes(_treeObject._id))) {
839
853
  if (verbose) (0, _Console.printMessage)({
840
- message: " - ".concat(themeObject._id, " (").concat(themeObject.name, ")"),
854
+ message: "\n - ".concat(themeObject._id, " (").concat(themeObject.name, ")"),
841
855
  type: 'info',
856
+ newline: false,
842
857
  state
843
858
  });
844
859
  exportData.themes.push(themeObject);
@@ -850,6 +865,12 @@ function _exportJourney() {
850
865
  errors.push(error);
851
866
  }
852
867
  }
868
+ if (verbose) (0, _Console.printMessage)({
869
+ message: "\n",
870
+ type: 'info',
871
+ newline: false,
872
+ state
873
+ });
853
874
  } catch (error) {
854
875
  var _error$response15;
855
876
  error.message = "Error exporting journey ".concat(journeyId, ": ").concat(((_error$response15 = error.response) === null || _error$response15 === void 0 || (_error$response15 = _error$response15.data) === null || _error$response15 === void 0 ? void 0 : _error$response15.message) || error.message);
@@ -1003,9 +1024,9 @@ function _importJourney() {
1003
1024
  reUuid,
1004
1025
  deps
1005
1026
  } = options;
1006
- var verbose = state.getDebug();
1027
+ var verbose = state.getVerbose();
1007
1028
  if (verbose) (0, _Console.printMessage)({
1008
- message: "\n- ".concat(importData.tree._id, "\n"),
1029
+ message: "- ".concat(importData.tree._id, "\n"),
1009
1030
  type: 'info',
1010
1031
  newline: false,
1011
1032
  state
@@ -1018,11 +1039,12 @@ function _importJourney() {
1018
1039
  if (deps && importData.scripts && Object.entries(importData.scripts).length > 0) {
1019
1040
  if (verbose) (0, _Console.printMessage)({
1020
1041
  message: ' - Scripts:',
1042
+ newline: false,
1021
1043
  state
1022
1044
  });
1023
1045
  for (var [scriptId, scriptObject] of Object.entries(importData.scripts)) {
1024
1046
  if (verbose) (0, _Console.printMessage)({
1025
- message: " - ".concat(scriptId, " (").concat(scriptObject['name'], ")"),
1047
+ message: "\n - ".concat(scriptId, " (").concat(scriptObject['name'], ")"),
1026
1048
  type: 'info',
1027
1049
  newline: false,
1028
1050
  state
@@ -1054,12 +1076,13 @@ function _importJourney() {
1054
1076
  // Process email templates
1055
1077
  if (deps && importData.emailTemplates && Object.entries(importData.emailTemplates).length > 0) {
1056
1078
  if (verbose) (0, _Console.printMessage)({
1057
- message: ' - Email templates:',
1079
+ message: '\n - Email templates:',
1080
+ newline: false,
1058
1081
  state
1059
1082
  });
1060
1083
  for (var [templateId, templateData] of Object.entries(importData.emailTemplates)) {
1061
1084
  if (verbose) (0, _Console.printMessage)({
1062
- message: " - ".concat(templateId),
1085
+ message: "\n - ".concat(templateId),
1063
1086
  type: 'info',
1064
1087
  newline: false,
1065
1088
  state
@@ -1085,14 +1108,16 @@ function _importJourney() {
1085
1108
  // Process themes
1086
1109
  if (deps && importData.themes && importData.themes.length > 0) {
1087
1110
  if (verbose) (0, _Console.printMessage)({
1088
- message: ' - Themes:',
1111
+ message: '\n - Themes:',
1112
+ newline: false,
1089
1113
  state
1090
1114
  });
1091
1115
  var themes = new Map();
1092
1116
  for (var theme of importData.themes) {
1093
1117
  if (verbose) (0, _Console.printMessage)({
1094
- message: " - ".concat(theme['_id'], " (").concat(theme['name'], ")"),
1118
+ message: "\n - ".concat(theme['_id'], " (").concat(theme['name'], ")"),
1095
1119
  type: 'info',
1120
+ newline: false,
1096
1121
  state
1097
1122
  });
1098
1123
  themes[theme['_id']] = theme;
@@ -1112,13 +1137,15 @@ function _importJourney() {
1112
1137
  // Process social providers
1113
1138
  if (deps && importData.socialIdentityProviders && Object.entries(importData.socialIdentityProviders).length > 0) {
1114
1139
  if (verbose) (0, _Console.printMessage)({
1115
- message: ' - OAuth2/OIDC (social) identity providers:',
1140
+ message: '\n - OAuth2/OIDC (social) identity providers:',
1141
+ newline: false,
1116
1142
  state
1117
1143
  });
1118
1144
  for (var [providerId, providerData] of Object.entries(importData.socialIdentityProviders)) {
1119
1145
  if (verbose) (0, _Console.printMessage)({
1120
- message: " - ".concat(providerId),
1146
+ message: "\n - ".concat(providerId),
1121
1147
  type: 'info',
1148
+ newline: false,
1122
1149
  state
1123
1150
  });
1124
1151
  try {
@@ -1160,7 +1187,8 @@ function _importJourney() {
1160
1187
  // Process saml providers
1161
1188
  if (deps && importData.saml2Entities && Object.entries(importData.saml2Entities).length > 0) {
1162
1189
  if (verbose) (0, _Console.printMessage)({
1163
- message: ' - SAML2 entity providers:',
1190
+ message: '\n - SAML2 entity providers:',
1191
+ newline: false,
1164
1192
  state
1165
1193
  });
1166
1194
  for (var [, _providerData] of Object.entries(importData.saml2Entities)) {
@@ -1168,8 +1196,9 @@ function _importJourney() {
1168
1196
  var entityId = _providerData['entityId'];
1169
1197
  var entityLocation = _providerData['entityLocation'];
1170
1198
  if (verbose) (0, _Console.printMessage)({
1171
- message: " - ".concat(entityLocation, " ").concat(entityId),
1199
+ message: "\n - ".concat(entityLocation, " ").concat(entityId),
1172
1200
  type: 'info',
1201
+ newline: false,
1173
1202
  state
1174
1203
  });
1175
1204
  var metaData = null;
@@ -1219,14 +1248,16 @@ function _importJourney() {
1219
1248
  // Process circles of trust
1220
1249
  if (deps && importData.circlesOfTrust && Object.entries(importData.circlesOfTrust).length > 0) {
1221
1250
  if (verbose) (0, _Console.printMessage)({
1222
- message: ' - SAML2 circles of trust:',
1251
+ message: '\n - SAML2 circles of trust:',
1252
+ newline: false,
1223
1253
  state
1224
1254
  });
1225
1255
  for (var [cotId, cotData] of Object.entries(importData.circlesOfTrust)) {
1226
1256
  delete cotData['_rev'];
1227
1257
  if (verbose) (0, _Console.printMessage)({
1228
- message: " - ".concat(cotId),
1258
+ message: "\n - ".concat(cotId),
1229
1259
  type: 'info',
1260
+ newline: false,
1230
1261
  state
1231
1262
  });
1232
1263
  try {
@@ -1277,9 +1308,9 @@ function _importJourney() {
1277
1308
  }
1278
1309
  if (Object.entries(innerNodes).length > 0) {
1279
1310
  if (verbose) (0, _Console.printMessage)({
1280
- message: ' - Inner nodes:',
1311
+ message: '\n - Inner nodes:',
1281
1312
  type: 'text',
1282
- newline: true,
1313
+ newline: false,
1283
1314
  state
1284
1315
  });
1285
1316
  for (var [innerNodeId, innerNodeData] of Object.entries(innerNodes)) {
@@ -1293,7 +1324,7 @@ function _importJourney() {
1293
1324
  }
1294
1325
  innerNodeData['_id'] = newUuid;
1295
1326
  if (verbose) (0, _Console.printMessage)({
1296
- message: " - ".concat(newUuid).concat(reUuid ? '*' : '', " (").concat(nodeType, ")"),
1327
+ message: "\n - ".concat(newUuid).concat(reUuid ? '*' : '', " (").concat(nodeType, ")"),
1297
1328
  type: 'info',
1298
1329
  newline: false,
1299
1330
  state
@@ -1375,7 +1406,8 @@ function _importJourney() {
1375
1406
  // Process nodes
1376
1407
  if (importData.nodes && Object.entries(importData.nodes).length > 0) {
1377
1408
  if (verbose) (0, _Console.printMessage)({
1378
- message: ' - Nodes:',
1409
+ message: '\n - Nodes:',
1410
+ newline: false,
1379
1411
  state
1380
1412
  });
1381
1413
  // eslint-disable-next-line prefer-const
@@ -1396,7 +1428,7 @@ function _importJourney() {
1396
1428
  }
1397
1429
  }
1398
1430
  if (verbose) (0, _Console.printMessage)({
1399
- message: " - ".concat(newUuid).concat(reUuid ? '*' : '', " (").concat(_nodeType, ")"),
1431
+ message: "\n - ".concat(newUuid).concat(reUuid ? '*' : '', " (").concat(_nodeType, ")"),
1400
1432
  type: 'info',
1401
1433
  newline: false,
1402
1434
  state
@@ -1471,7 +1503,8 @@ function _importJourney() {
1471
1503
 
1472
1504
  // Process tree
1473
1505
  if (verbose) (0, _Console.printMessage)({
1474
- message: ' - Flow',
1506
+ message: '\n - Flow',
1507
+ newline: false,
1475
1508
  state
1476
1509
  });
1477
1510
  if (reUuid) {
@@ -1490,7 +1523,7 @@ function _importJourney() {
1490
1523
  state
1491
1524
  }));
1492
1525
  if (verbose) (0, _Console.printMessage)({
1493
- message: " - identityResource: ".concat(importData.tree.identityResource),
1526
+ message: "\n - identityResource: ".concat(importData.tree.identityResource),
1494
1527
  type: 'info',
1495
1528
  newline: false,
1496
1529
  state