@rockcarver/frodo-lib 2.0.0-3 → 2.0.0-4

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 (149) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/cjs/api/AgentApi.js +64 -16
  3. package/cjs/api/AgentApi.js.map +1 -1
  4. package/cjs/api/ApiTypes.js +0 -55
  5. package/cjs/api/ApiTypes.js.map +1 -1
  6. package/cjs/api/BaseApi.js +21 -11
  7. package/cjs/api/BaseApi.js.map +1 -1
  8. package/cjs/api/cloud/SecretsApi.js +7 -14
  9. package/cjs/api/cloud/SecretsApi.js.map +1 -1
  10. package/cjs/api/cloud/SecretsApi.test.js.map +1 -1
  11. package/cjs/ops/AdminOps.js +254 -60
  12. package/cjs/ops/AdminOps.js.map +1 -1
  13. package/cjs/ops/AgentOps.js +352 -108
  14. package/cjs/ops/AgentOps.js.map +1 -1
  15. package/cjs/ops/AuthenticateOps.js +253 -60
  16. package/cjs/ops/AuthenticateOps.js.map +1 -1
  17. package/cjs/ops/CirclesOfTrustOps.js +16 -4
  18. package/cjs/ops/CirclesOfTrustOps.js.map +1 -1
  19. package/cjs/ops/ConnectionProfileOps.js +163 -40
  20. package/cjs/ops/ConnectionProfileOps.js.map +1 -1
  21. package/cjs/ops/EmailTemplateOps.js +7 -1
  22. package/cjs/ops/EmailTemplateOps.js.map +1 -1
  23. package/cjs/ops/IdpOps.js +55 -12
  24. package/cjs/ops/IdpOps.js.map +1 -1
  25. package/cjs/ops/JourneyOps.js +645 -136
  26. package/cjs/ops/JourneyOps.js.map +1 -1
  27. package/cjs/ops/NodeOps.js +96 -24
  28. package/cjs/ops/NodeOps.js.map +1 -1
  29. package/cjs/ops/OAuth2ClientOps.js +45 -11
  30. package/cjs/ops/OAuth2ClientOps.js.map +1 -1
  31. package/cjs/ops/OpsTypes.js +0 -23
  32. package/cjs/ops/OpsTypes.js.map +1 -1
  33. package/cjs/ops/OrganizationOps.js +44 -10
  34. package/cjs/ops/OrganizationOps.js.map +1 -1
  35. package/cjs/ops/PolicyOps.js +86 -24
  36. package/cjs/ops/PolicyOps.js.map +1 -1
  37. package/cjs/ops/PolicySetOps.js +72 -18
  38. package/cjs/ops/PolicySetOps.js.map +1 -1
  39. package/cjs/ops/ResourceTypeOps.js +24 -6
  40. package/cjs/ops/ResourceTypeOps.js.map +1 -1
  41. package/cjs/ops/Saml2Ops.js +120 -33
  42. package/cjs/ops/Saml2Ops.js.map +1 -1
  43. package/cjs/ops/Saml2Ops.test.js.map +1 -1
  44. package/cjs/ops/ScriptOps.js +73 -17
  45. package/cjs/ops/ScriptOps.js.map +1 -1
  46. package/cjs/ops/ServiceOps.js +152 -35
  47. package/cjs/ops/ServiceOps.js.map +1 -1
  48. package/cjs/ops/ThemeOps.js +20 -5
  49. package/cjs/ops/ThemeOps.js.map +1 -1
  50. package/cjs/ops/cloud/FeatureOps.js +4 -1
  51. package/cjs/ops/cloud/FeatureOps.js.map +1 -1
  52. package/cjs/ops/cloud/SecretsOps.js.map +1 -1
  53. package/cjs/ops/cloud/ServiceAccountOps.js +24 -6
  54. package/cjs/ops/cloud/ServiceAccountOps.js.map +1 -1
  55. package/cjs/ops/cloud/StartupOps.js +55 -11
  56. package/cjs/ops/cloud/StartupOps.js.map +1 -1
  57. package/cjs/ops/utils/Console.js +47 -22
  58. package/cjs/ops/utils/Console.js.map +1 -1
  59. package/cjs/ops/utils/DataProtection.js +12 -5
  60. package/cjs/ops/utils/DataProtection.js.map +1 -1
  61. package/cjs/ops/utils/DataProtection.test.js.map +1 -1
  62. package/cjs/ops/utils/ExportImportUtils.js +15 -8
  63. package/cjs/ops/utils/ExportImportUtils.js.map +1 -1
  64. package/cjs/ops/utils/ScriptValidationUtils.js +33 -8
  65. package/cjs/ops/utils/ScriptValidationUtils.js.map +1 -1
  66. package/cjs/ops/utils/ScriptValidationUtils.test.js.map +1 -1
  67. package/cjs/utils/SetupPollyForFrodoLib.js +67 -19
  68. package/cjs/utils/SetupPollyForFrodoLib.js.map +1 -1
  69. package/esm/api/AgentApi.mjs +64 -16
  70. package/esm/api/ApiTypes.mjs +1 -50
  71. package/esm/api/BaseApi.mjs +21 -11
  72. package/esm/api/cloud/SecretsApi.mjs +0 -5
  73. package/esm/api/cloud/SecretsApi.test.mjs +3 -3
  74. package/esm/ops/AdminOps.mjs +254 -60
  75. package/esm/ops/AgentOps.mjs +352 -104
  76. package/esm/ops/AuthenticateOps.mjs +253 -60
  77. package/esm/ops/CirclesOfTrustOps.mjs +16 -4
  78. package/esm/ops/ConnectionProfileOps.mjs +163 -40
  79. package/esm/ops/EmailTemplateOps.mjs +5 -0
  80. package/esm/ops/IdpOps.mjs +55 -12
  81. package/esm/ops/JourneyOps.mjs +639 -132
  82. package/esm/ops/NodeOps.mjs +90 -19
  83. package/esm/ops/OAuth2ClientOps.mjs +45 -11
  84. package/esm/ops/OpsTypes.mjs +1 -22
  85. package/esm/ops/OrganizationOps.mjs +44 -10
  86. package/esm/ops/PolicyOps.mjs +86 -24
  87. package/esm/ops/PolicySetOps.mjs +72 -18
  88. package/esm/ops/ResourceTypeOps.mjs +24 -6
  89. package/esm/ops/Saml2Ops.mjs +120 -33
  90. package/esm/ops/Saml2Ops.test.mjs +10 -11
  91. package/esm/ops/ScriptOps.mjs +73 -17
  92. package/esm/ops/ServiceOps.mjs +152 -35
  93. package/esm/ops/ThemeOps.mjs +20 -5
  94. package/esm/ops/cloud/FeatureOps.mjs +4 -1
  95. package/esm/ops/cloud/ServiceAccountOps.mjs +24 -6
  96. package/esm/ops/cloud/StartupOps.mjs +55 -11
  97. package/esm/ops/utils/Console.mjs +33 -9
  98. package/esm/ops/utils/DataProtection.mjs +9 -2
  99. package/esm/ops/utils/DataProtection.test.mjs +8 -2
  100. package/esm/ops/utils/ExportImportUtils.mjs +15 -8
  101. package/esm/ops/utils/ScriptValidationUtils.mjs +30 -8
  102. package/esm/ops/utils/ScriptValidationUtils.test.mjs +14 -3
  103. package/esm/utils/SetupPollyForFrodoLib.mjs +64 -18
  104. package/package.json +1 -1
  105. package/types/api/AgentApi.d.ts +6 -6
  106. package/types/api/AgentApi.d.ts.map +1 -1
  107. package/types/api/ApiTypes.d.ts +12 -49
  108. package/types/api/ApiTypes.d.ts.map +1 -1
  109. package/types/api/BaseApi.d.ts.map +1 -1
  110. package/types/api/cloud/SecretsApi.d.ts +1 -4
  111. package/types/api/cloud/SecretsApi.d.ts.map +1 -1
  112. package/types/ops/AdminOps.d.ts.map +1 -1
  113. package/types/ops/AgentOps.d.ts +3 -6
  114. package/types/ops/AgentOps.d.ts.map +1 -1
  115. package/types/ops/AuthenticateOps.d.ts.map +1 -1
  116. package/types/ops/CirclesOfTrustOps.d.ts.map +1 -1
  117. package/types/ops/ConnectionProfileOps.d.ts.map +1 -1
  118. package/types/ops/EmailTemplateOps.d.ts +4 -0
  119. package/types/ops/EmailTemplateOps.d.ts.map +1 -1
  120. package/types/ops/IdpOps.d.ts.map +1 -1
  121. package/types/ops/JourneyOps.d.ts +10 -4
  122. package/types/ops/JourneyOps.d.ts.map +1 -1
  123. package/types/ops/NodeOps.d.ts +10 -4
  124. package/types/ops/NodeOps.d.ts.map +1 -1
  125. package/types/ops/OAuth2ClientOps.d.ts.map +1 -1
  126. package/types/ops/OpsTypes.d.ts +2 -12
  127. package/types/ops/OpsTypes.d.ts.map +1 -1
  128. package/types/ops/OrganizationOps.d.ts.map +1 -1
  129. package/types/ops/PolicyOps.d.ts.map +1 -1
  130. package/types/ops/PolicySetOps.d.ts.map +1 -1
  131. package/types/ops/ResourceTypeOps.d.ts.map +1 -1
  132. package/types/ops/Saml2Ops.d.ts.map +1 -1
  133. package/types/ops/ScriptOps.d.ts.map +1 -1
  134. package/types/ops/ServiceOps.d.ts.map +1 -1
  135. package/types/ops/ThemeOps.d.ts.map +1 -1
  136. package/types/ops/cloud/FeatureOps.d.ts.map +1 -1
  137. package/types/ops/cloud/SecretsOps.d.ts +1 -1
  138. package/types/ops/cloud/SecretsOps.d.ts.map +1 -1
  139. package/types/ops/cloud/ServiceAccountOps.d.ts.map +1 -1
  140. package/types/ops/cloud/StartupOps.d.ts.map +1 -1
  141. package/types/ops/utils/Console.d.ts +34 -7
  142. package/types/ops/utils/Console.d.ts.map +1 -1
  143. package/types/ops/utils/DataProtection.d.ts +5 -1
  144. package/types/ops/utils/DataProtection.d.ts.map +1 -1
  145. package/types/ops/utils/ExportImportUtils.d.ts.map +1 -1
  146. package/types/ops/utils/ScriptValidationUtils.d.ts +14 -4
  147. package/types/ops/utils/ScriptValidationUtils.d.ts.map +1 -1
  148. package/types/utils/SetupPollyForFrodoLib.d.ts +5 -1
  149. package/types/utils/SetupPollyForFrodoLib.d.ts.map +1 -1
@@ -513,13 +513,22 @@ function _addAdminScopes() {
513
513
  addDefaultScope = true;
514
514
  modClient.coreOAuth2ClientConfig.defaultScopes.value = adminDefaultScopes;
515
515
  } else {
516
- (0, _Console.printMessage)("Client \"".concat(clientId, "\" already has default scopes configured, not adding admin default scope."));
516
+ (0, _Console.printMessage)({
517
+ message: "Client \"".concat(clientId, "\" already has default scopes configured, not adding admin default scope."),
518
+ state
519
+ });
517
520
  }
518
521
  }
519
522
  if (addScopes.length > 0 || addDefaultScope) {
520
- (0, _Console.printMessage)("Adding admin scopes to client \"".concat(clientId, "\"..."));
523
+ (0, _Console.printMessage)({
524
+ message: "Adding admin scopes to client \"".concat(clientId, "\"..."),
525
+ state
526
+ });
521
527
  } else {
522
- (0, _Console.printMessage)("Client \"".concat(clientId, "\" already has admin scopes."));
528
+ (0, _Console.printMessage)({
529
+ message: "Client \"".concat(clientId, "\" already has admin scopes."),
530
+ state
531
+ });
523
532
  }
524
533
  return modClient;
525
534
  });
@@ -528,7 +537,8 @@ function _addAdminScopes() {
528
537
  function addClientCredentialsGrantType(_ref6) {
529
538
  var {
530
539
  clientId,
531
- client
540
+ client,
541
+ state
532
542
  } = _ref6;
533
543
  var modClient = client;
534
544
  var modified = false;
@@ -542,9 +552,15 @@ function addClientCredentialsGrantType(_ref6) {
542
552
  }
543
553
  modClient.advancedOAuth2ClientConfig.grantTypes.inherited = false;
544
554
  if (modified) {
545
- (0, _Console.printMessage)("Adding client credentials grant type to client \"".concat(clientId, "\"..."));
555
+ (0, _Console.printMessage)({
556
+ message: "Adding client credentials grant type to client \"".concat(clientId, "\"..."),
557
+ state
558
+ });
546
559
  } else {
547
- (0, _Console.printMessage)("Client \"".concat(clientId, "\" already has client credentials grant type."));
560
+ (0, _Console.printMessage)({
561
+ message: "Client \"".concat(clientId, "\" already has client credentials grant type."),
562
+ state
563
+ });
548
564
  }
549
565
  return modClient;
550
566
  }
@@ -585,7 +601,11 @@ function _addAdminStaticUserMapping() {
585
601
  state
586
602
  });
587
603
  } catch (error) {
588
- (0, _Console.printMessage)("Error reading IDM authentication configuration: ".concat(error.message), 'error');
604
+ (0, _Console.printMessage)({
605
+ message: "Error reading IDM authentication configuration: ".concat(error.message),
606
+ type: 'error',
607
+ state
608
+ });
589
609
  }
590
610
  var needsAdminMapping = true;
591
611
  var addRoles = [];
@@ -607,7 +627,10 @@ function _addAdminStaticUserMapping() {
607
627
  return newMapping;
608
628
  });
609
629
  if (needsAdminMapping) {
610
- (0, _Console.printMessage)("Creating static user mapping for client \"".concat(name, "\"..."));
630
+ (0, _Console.printMessage)({
631
+ message: "Creating static user mapping for client \"".concat(name, "\"..."),
632
+ state
633
+ });
611
634
  mappings.push({
612
635
  subject: name,
613
636
  localUser: 'internal/user/openidm-admin',
@@ -617,7 +640,10 @@ function _addAdminStaticUserMapping() {
617
640
  }
618
641
  authentication['rsFilter']['staticUserMapping'] = mappings;
619
642
  if (addRoles.length > 0 || needsAdminMapping) {
620
- (0, _Console.printMessage)("Adding admin roles to static user mapping for client \"".concat(name, "\"..."));
643
+ (0, _Console.printMessage)({
644
+ message: "Adding admin roles to static user mapping for client \"".concat(name, "\"..."),
645
+ state
646
+ });
621
647
  try {
622
648
  yield (0, _IdmConfigApi.putConfigEntity)({
623
649
  entityId: 'authentication',
@@ -625,11 +651,22 @@ function _addAdminStaticUserMapping() {
625
651
  state
626
652
  });
627
653
  } catch (putConfigEntityError) {
628
- (0, _Console.printMessage)(putConfigEntityError, 'error');
629
- (0, _Console.printMessage)("Error: ".concat(putConfigEntityError), 'error');
654
+ (0, _Console.printMessage)({
655
+ message: putConfigEntityError,
656
+ type: 'error',
657
+ state
658
+ });
659
+ (0, _Console.printMessage)({
660
+ message: "Error: ".concat(putConfigEntityError),
661
+ type: 'error',
662
+ state
663
+ });
630
664
  }
631
665
  } else {
632
- (0, _Console.printMessage)("Static user mapping for client \"".concat(name, "\" already has admin roles."));
666
+ (0, _Console.printMessage)({
667
+ message: "Static user mapping for client \"".concat(name, "\" already has admin roles."),
668
+ state
669
+ });
633
670
  }
634
671
  });
635
672
  return _addAdminStaticUserMapping.apply(this, arguments);
@@ -667,7 +704,10 @@ function _addAutoIdStaticUserMapping() {
667
704
  return newMapping;
668
705
  });
669
706
  if (needsAdminMapping) {
670
- (0, _Console.printMessage)("Creating static user mapping for AutoId client \"".concat(name, "\"..."));
707
+ (0, _Console.printMessage)({
708
+ message: "Creating static user mapping for AutoId client \"".concat(name, "\"..."),
709
+ state
710
+ });
671
711
  mappings.push({
672
712
  subject: name,
673
713
  localUser: 'internal/user/idm-provisioning',
@@ -677,7 +717,10 @@ function _addAutoIdStaticUserMapping() {
677
717
  }
678
718
  authentication.rsFilter.staticUserMapping = mappings;
679
719
  if (addRoles.length > 0 || needsAdminMapping) {
680
- (0, _Console.printMessage)("Adding required roles to static user mapping for AutoId client \"".concat(name, "\"..."));
720
+ (0, _Console.printMessage)({
721
+ message: "Adding required roles to static user mapping for AutoId client \"".concat(name, "\"..."),
722
+ state
723
+ });
681
724
  try {
682
725
  yield (0, _IdmConfigApi.putConfigEntity)({
683
726
  entityId: 'authentication',
@@ -685,11 +728,22 @@ function _addAutoIdStaticUserMapping() {
685
728
  state
686
729
  });
687
730
  } catch (putConfigEntityError) {
688
- (0, _Console.printMessage)(putConfigEntityError, 'error');
689
- (0, _Console.printMessage)("Error: ".concat(putConfigEntityError), 'error');
731
+ (0, _Console.printMessage)({
732
+ message: putConfigEntityError,
733
+ type: 'error',
734
+ state
735
+ });
736
+ (0, _Console.printMessage)({
737
+ message: "Error: ".concat(putConfigEntityError),
738
+ type: 'error',
739
+ state
740
+ });
690
741
  }
691
742
  } else {
692
- (0, _Console.printMessage)("Static user mapping for AutoId client \"".concat(name, "\" already has all required roles."));
743
+ (0, _Console.printMessage)({
744
+ message: "Static user mapping for AutoId client \"".concat(name, "\" already has all required roles."),
745
+ state
746
+ });
693
747
  }
694
748
  });
695
749
  return _addAutoIdStaticUserMapping.apply(this, arguments);
@@ -720,7 +774,8 @@ function _grantOAuth2ClientAdminPrivileges() {
720
774
  });
721
775
  client = addClientCredentialsGrantType({
722
776
  clientId,
723
- client
777
+ client,
778
+ state
724
779
  });
725
780
  yield (0, _OAuth2ClientOps.putOAuth2Client)({
726
781
  clientId,
@@ -753,20 +808,32 @@ function _removeAdminScopes() {
753
808
  finalScopes = modClient.coreOAuth2ClientConfig.scopes.value.filter(scope => !allAdminScopes.includes(scope));
754
809
  }
755
810
  if (modClient.coreOAuth2ClientConfig.scopes.value.length > finalScopes.length) {
756
- (0, _Console.printMessage)("Removing admin scopes from client \"".concat(name, "\"..."));
811
+ (0, _Console.printMessage)({
812
+ message: "Removing admin scopes from client \"".concat(name, "\"..."),
813
+ state
814
+ });
757
815
  modClient.coreOAuth2ClientConfig.scopes.value = finalScopes;
758
816
  } else {
759
- (0, _Console.printMessage)("Client \"".concat(name, "\" has no admin scopes."));
817
+ (0, _Console.printMessage)({
818
+ message: "Client \"".concat(name, "\" has no admin scopes."),
819
+ state
820
+ });
760
821
  }
761
822
  var finalDefaultScopes = [];
762
823
  if (modClient.coreOAuth2ClientConfig.defaultScopes && modClient.coreOAuth2ClientConfig.defaultScopes.value) {
763
824
  finalDefaultScopes = modClient.coreOAuth2ClientConfig.defaultScopes.value.filter(scope => !adminDefaultScopes.includes(scope));
764
825
  }
765
826
  if (modClient.coreOAuth2ClientConfig.defaultScopes.value.length > finalDefaultScopes.length) {
766
- (0, _Console.printMessage)("Removing admin default scopes from client \"".concat(name, "\"..."));
827
+ (0, _Console.printMessage)({
828
+ message: "Removing admin default scopes from client \"".concat(name, "\"..."),
829
+ state
830
+ });
767
831
  modClient.coreOAuth2ClientConfig.defaultScopes.value = finalDefaultScopes;
768
832
  } else {
769
- (0, _Console.printMessage)("Client \"".concat(name, "\" has no admin default scopes."));
833
+ (0, _Console.printMessage)({
834
+ message: "Client \"".concat(name, "\" has no admin default scopes."),
835
+ state
836
+ });
770
837
  }
771
838
  return modClient;
772
839
  });
@@ -775,7 +842,8 @@ function _removeAdminScopes() {
775
842
  function removeClientCredentialsGrantType(_ref11) {
776
843
  var {
777
844
  clientId,
778
- client
845
+ client,
846
+ state
779
847
  } = _ref11;
780
848
  var modClient = client;
781
849
  var modified = false;
@@ -785,10 +853,16 @@ function removeClientCredentialsGrantType(_ref11) {
785
853
  modified = modClient.advancedOAuth2ClientConfig.grantTypes.value.length > finalGrantTypes.length;
786
854
  }
787
855
  if (modified) {
788
- (0, _Console.printMessage)("Removing client credentials grant type from client \"".concat(clientId, "\"..."));
856
+ (0, _Console.printMessage)({
857
+ message: "Removing client credentials grant type from client \"".concat(clientId, "\"..."),
858
+ state
859
+ });
789
860
  modClient.advancedOAuth2ClientConfig.grantTypes.value = finalGrantTypes;
790
861
  } else {
791
- (0, _Console.printMessage)("Client \"".concat(clientId, "\" does not allow client credentials grant type."));
862
+ (0, _Console.printMessage)({
863
+ message: "Client \"".concat(clientId, "\" does not allow client credentials grant type."),
864
+ state
865
+ });
792
866
  }
793
867
  return modClient;
794
868
  }
@@ -823,9 +897,15 @@ function _removeAdminStaticUserMapping() {
823
897
  authentication.rsFilter.staticUserMapping = mappings;
824
898
  if (modified || removeMapping) {
825
899
  if (removeMapping) {
826
- (0, _Console.printMessage)("Removing static user mapping for client \"".concat(name, "\"..."));
900
+ (0, _Console.printMessage)({
901
+ message: "Removing static user mapping for client \"".concat(name, "\"..."),
902
+ state
903
+ });
827
904
  } else {
828
- (0, _Console.printMessage)("Removing admin roles from static user mapping for client \"".concat(name, "\"..."));
905
+ (0, _Console.printMessage)({
906
+ message: "Removing admin roles from static user mapping for client \"".concat(name, "\"..."),
907
+ state
908
+ });
829
909
  }
830
910
  try {
831
911
  yield (0, _IdmConfigApi.putConfigEntity)({
@@ -834,11 +914,22 @@ function _removeAdminStaticUserMapping() {
834
914
  state
835
915
  });
836
916
  } catch (putConfigEntityError) {
837
- (0, _Console.printMessage)(putConfigEntityError, 'error');
838
- (0, _Console.printMessage)("Error: ".concat(putConfigEntityError), 'error');
917
+ (0, _Console.printMessage)({
918
+ message: putConfigEntityError,
919
+ type: 'error',
920
+ state
921
+ });
922
+ (0, _Console.printMessage)({
923
+ message: "Error: ".concat(putConfigEntityError),
924
+ type: 'error',
925
+ state
926
+ });
839
927
  }
840
928
  } else {
841
- (0, _Console.printMessage)("Static user mapping for client \"".concat(name, "\" has no admin roles."));
929
+ (0, _Console.printMessage)({
930
+ message: "Static user mapping for client \"".concat(name, "\" has no admin roles."),
931
+ state
932
+ });
842
933
  }
843
934
  });
844
935
  return _removeAdminStaticUserMapping.apply(this, arguments);
@@ -869,7 +960,8 @@ function _revokeOAuth2ClientAdminPrivileges() {
869
960
  });
870
961
  client = removeClientCredentialsGrantType({
871
962
  clientId,
872
- client
963
+ client,
964
+ state
873
965
  });
874
966
  yield (0, _OAuth2ClientOps.putOAuth2Client)({
875
967
  clientId,
@@ -913,7 +1005,11 @@ function _createOAuth2ClientWithAdminPrivileges() {
913
1005
  state
914
1006
  });
915
1007
  } catch (error) {
916
- (0, _Console.printMessage)("Error creating oauth2 client: ".concat(error.message), 'error');
1008
+ (0, _Console.printMessage)({
1009
+ message: "Error creating oauth2 client: ".concat(error.message),
1010
+ state,
1011
+ type: 'error'
1012
+ });
917
1013
  }
918
1014
  });
919
1015
  return _createOAuth2ClientWithAdminPrivileges.apply(this, arguments);
@@ -976,7 +1072,11 @@ function _createLongLivedToken() {
976
1072
  } catch (error) {
977
1073
  if (_lodash.default.get(error, 'response.data.code') === 400 && _lodash.default.get(error, 'response.data.message') === 'Failed to create secret, the secret already exists') {
978
1074
  var newSecret = "".concat(secret, "-").concat(expires);
979
- (0, _Console.printMessage)("esv '".concat(secret, "' already exists, using ").concat(newSecret), 'warn');
1075
+ (0, _Console.printMessage)({
1076
+ message: "esv '".concat(secret, "' already exists, using ").concat(newSecret),
1077
+ type: 'warn',
1078
+ state
1079
+ });
980
1080
  yield (0, _SecretsApi.putSecret)({
981
1081
  secretId: newSecret,
982
1082
  value: response.access_token,
@@ -1016,7 +1116,10 @@ function _removeStaticUserMapping() {
1016
1116
  });
1017
1117
  authentication.rsFilter.staticUserMapping = mappings;
1018
1118
  if (removeMapping) {
1019
- (0, _Console.printMessage)("Removing static user mapping for subject \"".concat(subject, "\"..."));
1119
+ (0, _Console.printMessage)({
1120
+ message: "Removing static user mapping for subject \"".concat(subject, "\"..."),
1121
+ state
1122
+ });
1020
1123
  try {
1021
1124
  yield (0, _IdmConfigApi.putConfigEntity)({
1022
1125
  entityId: 'authentication',
@@ -1024,11 +1127,22 @@ function _removeStaticUserMapping() {
1024
1127
  state
1025
1128
  });
1026
1129
  } catch (putConfigEntityError) {
1027
- (0, _Console.printMessage)(putConfigEntityError, 'error');
1028
- (0, _Console.printMessage)("Error: ".concat(putConfigEntityError), 'error');
1130
+ (0, _Console.printMessage)({
1131
+ message: putConfigEntityError,
1132
+ type: 'error',
1133
+ state
1134
+ });
1135
+ (0, _Console.printMessage)({
1136
+ message: "Error: ".concat(putConfigEntityError),
1137
+ type: 'error',
1138
+ state
1139
+ });
1029
1140
  }
1030
1141
  } else {
1031
- (0, _Console.printMessage)("No static user mapping for subject \"".concat(subject, "\" found."));
1142
+ (0, _Console.printMessage)({
1143
+ message: "No static user mapping for subject \"".concat(subject, "\" found."),
1144
+ state
1145
+ });
1032
1146
  }
1033
1147
  });
1034
1148
  return _removeStaticUserMapping.apply(this, arguments);
@@ -1058,21 +1172,33 @@ function _hideGenericExtensionAttributes() {
1058
1172
  propertyNames.forEach(name => {
1059
1173
  if ((0, _OpsUtils.isEqualJson)(GENERIC_EXTENSION_ATTRIBUTES[name], object.schema.properties[name], ['viewable', 'usageDescription']) || includeCustomized) {
1060
1174
  if (object.schema.properties[name].viewable) {
1061
- (0, _Console.printMessage)("".concat(name, ": hide"));
1175
+ (0, _Console.printMessage)({
1176
+ message: "".concat(name, ": hide"),
1177
+ state
1178
+ });
1062
1179
  // eslint-disable-next-line no-param-reassign
1063
1180
  object.schema.properties[name].viewable = false;
1064
1181
  } else {
1065
- (0, _Console.printMessage)("".concat(name, ": ignore (already hidden)"));
1182
+ (0, _Console.printMessage)({
1183
+ message: "".concat(name, ": ignore (already hidden)"),
1184
+ state
1185
+ });
1066
1186
  }
1067
1187
  } else {
1068
- (0, _Console.printMessage)("".concat(name, ": skip (customized)"));
1188
+ (0, _Console.printMessage)({
1189
+ message: "".concat(name, ": skip (customized)"),
1190
+ state
1191
+ });
1069
1192
  }
1070
1193
  });
1071
1194
  return object;
1072
1195
  });
1073
1196
  managed.objects = updatedObjects;
1074
1197
  if (dryRun) {
1075
- (0, _Console.printMessage)('Dry-run only. Changes are not saved.');
1198
+ (0, _Console.printMessage)({
1199
+ message: 'Dry-run only. Changes are not saved.',
1200
+ state
1201
+ });
1076
1202
  } else {
1077
1203
  try {
1078
1204
  yield (0, _IdmConfigApi.putConfigEntity)({
@@ -1081,8 +1207,16 @@ function _hideGenericExtensionAttributes() {
1081
1207
  state
1082
1208
  });
1083
1209
  } catch (putConfigEntityError) {
1084
- (0, _Console.printMessage)(putConfigEntityError, 'error');
1085
- (0, _Console.printMessage)("Error: ".concat(putConfigEntityError), 'error');
1210
+ (0, _Console.printMessage)({
1211
+ message: putConfigEntityError,
1212
+ type: 'error',
1213
+ state
1214
+ });
1215
+ (0, _Console.printMessage)({
1216
+ message: "Error: ".concat(putConfigEntityError),
1217
+ type: 'error',
1218
+ state
1219
+ });
1086
1220
  }
1087
1221
  }
1088
1222
  });
@@ -1113,21 +1247,33 @@ function _showGenericExtensionAttributes() {
1113
1247
  propertyNames.forEach(name => {
1114
1248
  if ((0, _OpsUtils.isEqualJson)(GENERIC_EXTENSION_ATTRIBUTES[name], object.schema.properties[name], ['viewable', 'usageDescription']) || includeCustomized) {
1115
1249
  if (!object.schema.properties[name].viewable) {
1116
- (0, _Console.printMessage)("".concat(name, ": show"));
1250
+ (0, _Console.printMessage)({
1251
+ message: "".concat(name, ": show"),
1252
+ state
1253
+ });
1117
1254
  // eslint-disable-next-line no-param-reassign
1118
1255
  object.schema.properties[name].viewable = true;
1119
1256
  } else {
1120
- (0, _Console.printMessage)("".concat(name, ": ignore (already showing)"));
1257
+ (0, _Console.printMessage)({
1258
+ message: "".concat(name, ": ignore (already showing)"),
1259
+ state
1260
+ });
1121
1261
  }
1122
1262
  } else {
1123
- (0, _Console.printMessage)("".concat(name, ": skip (customized)"));
1263
+ (0, _Console.printMessage)({
1264
+ message: "".concat(name, ": skip (customized)"),
1265
+ state
1266
+ });
1124
1267
  }
1125
1268
  });
1126
1269
  return object;
1127
1270
  });
1128
1271
  managed.objects = updatedObjects;
1129
1272
  if (dryRun) {
1130
- (0, _Console.printMessage)('Dry-run only. Changes are not saved.');
1273
+ (0, _Console.printMessage)({
1274
+ message: 'Dry-run only. Changes are not saved.',
1275
+ state
1276
+ });
1131
1277
  } else {
1132
1278
  try {
1133
1279
  yield (0, _IdmConfigApi.putConfigEntity)({
@@ -1136,8 +1282,16 @@ function _showGenericExtensionAttributes() {
1136
1282
  state
1137
1283
  });
1138
1284
  } catch (putConfigEntityError) {
1139
- (0, _Console.printMessage)(putConfigEntityError, 'error');
1140
- (0, _Console.printMessage)("Error: ".concat(putConfigEntityError), 'error');
1285
+ (0, _Console.printMessage)({
1286
+ message: putConfigEntityError,
1287
+ type: 'error',
1288
+ state
1289
+ });
1290
+ (0, _Console.printMessage)({
1291
+ message: "Error: ".concat(putConfigEntityError),
1292
+ type: 'error',
1293
+ state
1294
+ });
1141
1295
  }
1142
1296
  }
1143
1297
  });
@@ -1165,15 +1319,25 @@ function _repairOrgModelUser() {
1165
1319
  })) {
1166
1320
  return object;
1167
1321
  }
1168
- (0, _Console.printMessage)("".concat(object.name, ": checking..."));
1322
+ (0, _Console.printMessage)({
1323
+ message: "".concat(object.name, ": checking..."),
1324
+ state
1325
+ });
1169
1326
  RDVPs.forEach(name => {
1170
1327
  if (!object.schema.properties[name].queryConfig.flattenProperties) {
1171
- (0, _Console.printMessage)("- ".concat(name, ": repairing - needs flattening"), 'warn');
1328
+ (0, _Console.printMessage)({
1329
+ message: "- ".concat(name, ": repairing - needs flattening"),
1330
+ type: 'warn',
1331
+ state
1332
+ });
1172
1333
  // eslint-disable-next-line no-param-reassign
1173
1334
  object.schema.properties[name].queryConfig.flattenProperties = true;
1174
1335
  repairData = true;
1175
1336
  } else {
1176
- (0, _Console.printMessage)("- ".concat(name, ": OK"));
1337
+ (0, _Console.printMessage)({
1338
+ message: "- ".concat(name, ": OK"),
1339
+ state
1340
+ });
1177
1341
  }
1178
1342
  });
1179
1343
  return object;
@@ -1187,8 +1351,16 @@ function _repairOrgModelUser() {
1187
1351
  state
1188
1352
  });
1189
1353
  } catch (putConfigEntityError) {
1190
- (0, _Console.printMessage)(putConfigEntityError, 'error');
1191
- (0, _Console.printMessage)("Error: ".concat(putConfigEntityError), 'error');
1354
+ (0, _Console.printMessage)({
1355
+ message: putConfigEntityError,
1356
+ type: 'error',
1357
+ state
1358
+ });
1359
+ (0, _Console.printMessage)({
1360
+ message: "Error: ".concat(putConfigEntityError),
1361
+ type: 'error',
1362
+ state
1363
+ });
1192
1364
  }
1193
1365
  }
1194
1366
  return repairData;
@@ -1217,15 +1389,25 @@ function _repairOrgModelOrg() {
1217
1389
  })) {
1218
1390
  return object;
1219
1391
  }
1220
- (0, _Console.printMessage)("".concat(object.name, ": checking..."));
1392
+ (0, _Console.printMessage)({
1393
+ message: "".concat(object.name, ": checking..."),
1394
+ state
1395
+ });
1221
1396
  RDVPs.forEach(name => {
1222
1397
  if (!object.schema.properties[name].queryConfig.flattenProperties) {
1223
- (0, _Console.printMessage)("- ".concat(name, ": repairing - needs flattening"), 'warn');
1398
+ (0, _Console.printMessage)({
1399
+ message: "- ".concat(name, ": repairing - needs flattening"),
1400
+ type: 'warn',
1401
+ state
1402
+ });
1224
1403
  // eslint-disable-next-line no-param-reassign
1225
1404
  object.schema.properties[name].queryConfig.flattenProperties = true;
1226
1405
  repairData = true;
1227
1406
  } else {
1228
- (0, _Console.printMessage)("- ".concat(name, ": OK"));
1407
+ (0, _Console.printMessage)({
1408
+ message: "- ".concat(name, ": OK"),
1409
+ state
1410
+ });
1229
1411
  }
1230
1412
  });
1231
1413
  return object;
@@ -1239,8 +1421,16 @@ function _repairOrgModelOrg() {
1239
1421
  state
1240
1422
  });
1241
1423
  } catch (putConfigEntityError) {
1242
- (0, _Console.printMessage)(putConfigEntityError, 'error');
1243
- (0, _Console.printMessage)("Error: ".concat(putConfigEntityError), 'error');
1424
+ (0, _Console.printMessage)({
1425
+ message: putConfigEntityError,
1426
+ type: 'error',
1427
+ state
1428
+ });
1429
+ (0, _Console.printMessage)({
1430
+ message: "Error: ".concat(putConfigEntityError),
1431
+ type: 'error',
1432
+ state
1433
+ });
1244
1434
  }
1245
1435
  }
1246
1436
  return repairData;
@@ -1305,7 +1495,11 @@ function _repairOrgModel() {
1305
1495
  yield extendOrgModelPermissins(dryRun);
1306
1496
  }
1307
1497
  if (dryRun) {
1308
- (0, _Console.printMessage)('Dry-run only. Changes are not saved.', 'warn');
1498
+ (0, _Console.printMessage)({
1499
+ message: 'Dry-run only. Changes are not saved.',
1500
+ type: 'warn',
1501
+ state
1502
+ });
1309
1503
  }
1310
1504
  });
1311
1505
  return _repairOrgModel.apply(this, arguments);