@rockcarver/frodo-lib 1.1.0 → 1.1.2-0

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 (421) hide show
  1. package/build.zip +0 -0
  2. package/cjs/api/AgentApi.js +4 -4
  3. package/cjs/api/AgentApi.js.map +1 -1
  4. package/cjs/api/AgentApi.test.js +3 -3
  5. package/cjs/api/AgentApi.test.js.map +1 -1
  6. package/cjs/api/AuthenticateApi.js +3 -3
  7. package/cjs/api/AuthenticateApi.js.map +1 -1
  8. package/cjs/api/AuthenticateApi.test.js +2 -2
  9. package/cjs/api/AuthenticateApi.test.js.map +1 -1
  10. package/cjs/api/BaseApi.js +4 -4
  11. package/cjs/api/BaseApi.js.map +1 -1
  12. package/cjs/api/CirclesOfTrustApi.js +3 -3
  13. package/cjs/api/CirclesOfTrustApi.js.map +1 -1
  14. package/cjs/api/IdmConfigApi.js +3 -3
  15. package/cjs/api/IdmConfigApi.js.map +1 -1
  16. package/cjs/api/IdmSystemApi.js +3 -3
  17. package/cjs/api/IdmSystemApi.js.map +1 -1
  18. package/cjs/api/ManagedObjectApi.js +3 -3
  19. package/cjs/api/ManagedObjectApi.js.map +1 -1
  20. package/cjs/api/NodeApi.js +3 -3
  21. package/cjs/api/NodeApi.js.map +1 -1
  22. package/cjs/api/NodeApi.test.js +2 -2
  23. package/cjs/api/NodeApi.test.js.map +1 -1
  24. package/cjs/api/OAuth2ClientApi.js +3 -3
  25. package/cjs/api/OAuth2ClientApi.js.map +1 -1
  26. package/cjs/api/OAuth2OIDCApi.js +4 -4
  27. package/cjs/api/OAuth2OIDCApi.js.map +1 -1
  28. package/cjs/api/OAuth2OIDCApi.test.js +4 -4
  29. package/cjs/api/OAuth2OIDCApi.test.js.map +1 -1
  30. package/cjs/api/OAuth2ProviderApi.js +3 -3
  31. package/cjs/api/OAuth2ProviderApi.js.map +1 -1
  32. package/cjs/api/PoliciesApi.js +3 -3
  33. package/cjs/api/PoliciesApi.js.map +1 -1
  34. package/cjs/api/PoliciesApi.test.js +4 -4
  35. package/cjs/api/PoliciesApi.test.js.map +1 -1
  36. package/cjs/api/PolicySetApi.js +4 -4
  37. package/cjs/api/PolicySetApi.js.map +1 -1
  38. package/cjs/api/PolicySetApi.test.js +3 -3
  39. package/cjs/api/PolicySetApi.test.js.map +1 -1
  40. package/cjs/api/RealmApi.js +3 -3
  41. package/cjs/api/RealmApi.js.map +1 -1
  42. package/cjs/api/ResourceTypesApi.js +3 -3
  43. package/cjs/api/ResourceTypesApi.js.map +1 -1
  44. package/cjs/api/ResourceTypesApi.test.js +2 -2
  45. package/cjs/api/ResourceTypesApi.test.js.map +1 -1
  46. package/cjs/api/Saml2Api.js +3 -3
  47. package/cjs/api/Saml2Api.js.map +1 -1
  48. package/cjs/api/ScriptApi.js +3 -3
  49. package/cjs/api/ScriptApi.js.map +1 -1
  50. package/cjs/api/ServerInfoApi.js +2 -2
  51. package/cjs/api/ServerInfoApi.js.map +1 -1
  52. package/cjs/api/ServiceApi.js +3 -3
  53. package/cjs/api/ServiceApi.js.map +1 -1
  54. package/cjs/api/SocialIdentityProvidersApi.js +3 -3
  55. package/cjs/api/SocialIdentityProvidersApi.js.map +1 -1
  56. package/cjs/api/TreeApi.js +3 -3
  57. package/cjs/api/TreeApi.js.map +1 -1
  58. package/cjs/api/TreeApi.test.js +2 -2
  59. package/cjs/api/TreeApi.test.js.map +1 -1
  60. package/cjs/api/cloud/AdminFederationProvidersApi.js +3 -3
  61. package/cjs/api/cloud/AdminFederationProvidersApi.js.map +1 -1
  62. package/cjs/api/cloud/EnvInfoApi.js +3 -3
  63. package/cjs/api/cloud/EnvInfoApi.js.map +1 -1
  64. package/cjs/api/cloud/FeatureApi.js +3 -3
  65. package/cjs/api/cloud/FeatureApi.js.map +1 -1
  66. package/cjs/api/cloud/LogApi.js +3 -3
  67. package/cjs/api/cloud/LogApi.js.map +1 -1
  68. package/cjs/api/cloud/SecretsApi.js +4 -4
  69. package/cjs/api/cloud/SecretsApi.js.map +1 -1
  70. package/cjs/api/cloud/SecretsApi.test.js +2 -2
  71. package/cjs/api/cloud/SecretsApi.test.js.map +1 -1
  72. package/cjs/api/cloud/StartupApi.js +3 -3
  73. package/cjs/api/cloud/StartupApi.js.map +1 -1
  74. package/cjs/api/cloud/StartupApi.test.js +1 -1
  75. package/cjs/api/cloud/StartupApi.test.js.map +1 -1
  76. package/cjs/api/cloud/VariablesApi.js +4 -4
  77. package/cjs/api/cloud/VariablesApi.js.map +1 -1
  78. package/cjs/api/cloud/VariablesApi.test.js +2 -2
  79. package/cjs/api/cloud/VariablesApi.test.js.map +1 -1
  80. package/cjs/api/utils/ApiUtils.js +1 -1
  81. package/cjs/api/utils/ApiUtils.js.map +1 -1
  82. package/cjs/api/utils/ApiUtils.test.js +2 -2
  83. package/cjs/api/utils/ApiUtils.test.js.map +1 -1
  84. package/cjs/ext/axios-curlirize/curlirize.js +1 -1
  85. package/cjs/ext/axios-curlirize/curlirize.js.map +1 -1
  86. package/cjs/index.js +49 -49
  87. package/cjs/ops/AdminOps.js +8 -8
  88. package/cjs/ops/AdminOps.js.map +1 -1
  89. package/cjs/ops/AgentOps.js +3 -3
  90. package/cjs/ops/AgentOps.js.map +1 -1
  91. package/cjs/ops/AgentOps.test.js +3 -3
  92. package/cjs/ops/AgentOps.test.js.map +1 -1
  93. package/cjs/ops/AuthenticateOps.js +12 -12
  94. package/cjs/ops/AuthenticateOps.js.map +1 -1
  95. package/cjs/ops/AuthenticateOps.test.js +2 -2
  96. package/cjs/ops/AuthenticateOps.test.js.map +1 -1
  97. package/cjs/ops/CirclesOfTrustOps.js +3 -3
  98. package/cjs/ops/CirclesOfTrustOps.js.map +1 -1
  99. package/cjs/ops/ConnectionProfileOps.js +8 -8
  100. package/cjs/ops/ConnectionProfileOps.js.map +1 -1
  101. package/cjs/ops/ConnectionProfileOps.test.js +2 -2
  102. package/cjs/ops/ConnectionProfileOps.test.js.map +1 -1
  103. package/cjs/ops/EmailTemplateOps.js +1 -1
  104. package/cjs/ops/EmailTemplateOps.js.map +1 -1
  105. package/cjs/ops/EmailTemplateOps.test.js +2 -2
  106. package/cjs/ops/EmailTemplateOps.test.js.map +1 -1
  107. package/cjs/ops/IdmOps.js +2 -2
  108. package/cjs/ops/IdmOps.js.map +1 -1
  109. package/cjs/ops/IdmOps.test.js +2 -2
  110. package/cjs/ops/IdmOps.test.js.map +1 -1
  111. package/cjs/ops/IdpOps.js +6 -6
  112. package/cjs/ops/IdpOps.js.map +1 -1
  113. package/cjs/ops/IdpOps.test.js +2 -2
  114. package/cjs/ops/IdpOps.test.js.map +1 -1
  115. package/cjs/ops/InfoOps.js +6 -6
  116. package/cjs/ops/InfoOps.js.map +1 -1
  117. package/cjs/ops/JoseOps.test.js +4 -4
  118. package/cjs/ops/JoseOps.test.js.map +1 -1
  119. package/cjs/ops/JourneyOps.js +17 -17
  120. package/cjs/ops/JourneyOps.js.map +1 -1
  121. package/cjs/ops/JourneyOps.test.js +4 -4
  122. package/cjs/ops/JourneyOps.test.js.map +1 -1
  123. package/cjs/ops/ManagedObjectOps.js +1 -1
  124. package/cjs/ops/ManagedObjectOps.js.map +1 -1
  125. package/cjs/ops/NodeOps.js +7 -7
  126. package/cjs/ops/NodeOps.js.map +1 -1
  127. package/cjs/ops/OAuth2ClientOps.js +6 -6
  128. package/cjs/ops/OAuth2ClientOps.js.map +1 -1
  129. package/cjs/ops/OAuth2ClientOps.test.js +3 -3
  130. package/cjs/ops/OAuth2ClientOps.test.js.map +1 -1
  131. package/cjs/ops/OAuth2ProviderOps.js +1 -1
  132. package/cjs/ops/OAuth2ProviderOps.js.map +1 -1
  133. package/cjs/ops/OrganizationOps.js +3 -3
  134. package/cjs/ops/OrganizationOps.js.map +1 -1
  135. package/cjs/ops/PolicyOps.js +8 -8
  136. package/cjs/ops/PolicyOps.js.map +1 -1
  137. package/cjs/ops/PolicyOps.test.js +6 -6
  138. package/cjs/ops/PolicyOps.test.js.map +1 -1
  139. package/cjs/ops/PolicySetOps.js +6 -6
  140. package/cjs/ops/PolicySetOps.js.map +1 -1
  141. package/cjs/ops/PolicySetOps.test.js +4 -4
  142. package/cjs/ops/PolicySetOps.test.js.map +1 -1
  143. package/cjs/ops/RealmOps.js +2 -2
  144. package/cjs/ops/RealmOps.js.map +1 -1
  145. package/cjs/ops/ResourceTypeOps.js +6 -6
  146. package/cjs/ops/ResourceTypeOps.js.map +1 -1
  147. package/cjs/ops/ResourceTypeOps.test.js +2 -2
  148. package/cjs/ops/ResourceTypeOps.test.js.map +1 -1
  149. package/cjs/ops/Saml2Ops.js +7 -7
  150. package/cjs/ops/Saml2Ops.js.map +1 -1
  151. package/cjs/ops/Saml2Ops.test.js +6 -6
  152. package/cjs/ops/Saml2Ops.test.js.map +1 -1
  153. package/cjs/ops/ScriptOps.js +5 -5
  154. package/cjs/ops/ScriptOps.js.map +1 -1
  155. package/cjs/ops/ScriptOps.test.js +2 -2
  156. package/cjs/ops/ScriptOps.test.js.map +1 -1
  157. package/cjs/ops/ServiceOps.js +2 -2
  158. package/cjs/ops/ServiceOps.js.map +1 -1
  159. package/cjs/ops/ThemeOps.js +3 -3
  160. package/cjs/ops/ThemeOps.js.map +1 -1
  161. package/cjs/ops/ThemeOps.test.js +3 -3
  162. package/cjs/ops/ThemeOps.test.js.map +1 -1
  163. package/cjs/ops/cloud/AdminFederationOps.js +4 -4
  164. package/cjs/ops/cloud/AdminFederationOps.js.map +1 -1
  165. package/cjs/ops/cloud/FeatureOps.js +2 -2
  166. package/cjs/ops/cloud/FeatureOps.js.map +1 -1
  167. package/cjs/ops/cloud/LogOps.js +1 -1
  168. package/cjs/ops/cloud/LogOps.js.map +1 -1
  169. package/cjs/ops/cloud/SecretsOps.js +4 -4
  170. package/cjs/ops/cloud/SecretsOps.js.map +1 -1
  171. package/cjs/ops/cloud/ServiceAccountOps.js +3 -3
  172. package/cjs/ops/cloud/ServiceAccountOps.js.map +1 -1
  173. package/cjs/ops/cloud/ServiceAccountOps.test.js +3 -3
  174. package/cjs/ops/cloud/ServiceAccountOps.test.js.map +1 -1
  175. package/cjs/ops/cloud/StartupOps.js +4 -4
  176. package/cjs/ops/cloud/StartupOps.js.map +1 -1
  177. package/cjs/ops/cloud/VariablesOps.js +5 -5
  178. package/cjs/ops/cloud/VariablesOps.js.map +1 -1
  179. package/cjs/ops/utils/Console.js +1 -1
  180. package/cjs/ops/utils/Console.js.map +1 -1
  181. package/cjs/ops/utils/DataProtection.js +3 -3
  182. package/cjs/ops/utils/DataProtection.js.map +1 -1
  183. package/cjs/ops/utils/DataProtection.test.js +1 -1
  184. package/cjs/ops/utils/DataProtection.test.js.map +1 -1
  185. package/cjs/ops/utils/ExportImportUtils.js +4 -4
  186. package/cjs/ops/utils/ExportImportUtils.js.map +1 -1
  187. package/cjs/ops/utils/ExportImportUtils.test.js +1 -1
  188. package/cjs/ops/utils/ExportImportUtils.test.js.map +1 -1
  189. package/cjs/ops/utils/OpsUtils.js +3 -3
  190. package/cjs/ops/utils/OpsUtils.js.map +1 -1
  191. package/cjs/ops/utils/OpsUtils.test.js +3 -3
  192. package/cjs/ops/utils/OpsUtils.test.js.map +1 -1
  193. package/cjs/ops/utils/ValidationUtils.js +2 -2
  194. package/cjs/ops/utils/ValidationUtils.js.map +1 -1
  195. package/cjs/ops/utils/ValidationUtils.test.js +1 -1
  196. package/cjs/ops/utils/ValidationUtils.test.js.map +1 -1
  197. package/cjs/ops/utils/Version.js +1 -1
  198. package/cjs/ops/utils/Version.js.map +1 -1
  199. package/cjs/ops/utils/Version.test.js +1 -1
  200. package/cjs/ops/utils/Version.test.js.map +1 -1
  201. package/cjs/ops/utils/Wordwrap.test.js +1 -1
  202. package/cjs/ops/utils/Wordwrap.test.js.map +1 -1
  203. package/cjs/shared/State.test.js +1 -1
  204. package/cjs/shared/State.test.js.map +1 -1
  205. package/cjs/test/mocks/ForgeRockApiMockEngine.js +2 -2
  206. package/cjs/test/mocks/ForgeRockApiMockEngine.js.map +1 -1
  207. package/cjs/utils/AutoSetupPolly.js +2 -2
  208. package/cjs/utils/AutoSetupPolly.js.map +1 -1
  209. package/cjs/utils/SetupPollyForFrodoLib.js +1 -1
  210. package/cjs/utils/SetupPollyForFrodoLib.js.map +1 -1
  211. package/esm/api/AgentApi.js +4 -4
  212. package/esm/api/AgentApi.js.map +1 -1
  213. package/esm/api/AgentApi.test.js +3 -3
  214. package/esm/api/AgentApi.test.js.map +1 -1
  215. package/esm/api/AuthenticateApi.js +3 -3
  216. package/esm/api/AuthenticateApi.js.map +1 -1
  217. package/esm/api/AuthenticateApi.test.js +2 -4
  218. package/esm/api/AuthenticateApi.test.js.map +1 -1
  219. package/esm/api/BaseApi.js +4 -4
  220. package/esm/api/BaseApi.js.map +1 -1
  221. package/esm/api/CirclesOfTrustApi.js +3 -3
  222. package/esm/api/CirclesOfTrustApi.js.map +1 -1
  223. package/esm/api/IdmConfigApi.js +3 -3
  224. package/esm/api/IdmConfigApi.js.map +1 -1
  225. package/esm/api/IdmSystemApi.js +3 -3
  226. package/esm/api/IdmSystemApi.js.map +1 -1
  227. package/esm/api/ManagedObjectApi.js +3 -3
  228. package/esm/api/ManagedObjectApi.js.map +1 -1
  229. package/esm/api/NodeApi.js +3 -3
  230. package/esm/api/NodeApi.js.map +1 -1
  231. package/esm/api/NodeApi.test.js +2 -2
  232. package/esm/api/NodeApi.test.js.map +1 -1
  233. package/esm/api/OAuth2ClientApi.js +3 -3
  234. package/esm/api/OAuth2ClientApi.js.map +1 -1
  235. package/esm/api/OAuth2OIDCApi.js +4 -4
  236. package/esm/api/OAuth2OIDCApi.js.map +1 -1
  237. package/esm/api/OAuth2OIDCApi.test.js +4 -4
  238. package/esm/api/OAuth2OIDCApi.test.js.map +1 -1
  239. package/esm/api/OAuth2ProviderApi.js +3 -3
  240. package/esm/api/OAuth2ProviderApi.js.map +1 -1
  241. package/esm/api/PoliciesApi.js +3 -3
  242. package/esm/api/PoliciesApi.js.map +1 -1
  243. package/esm/api/PoliciesApi.test.js +4 -4
  244. package/esm/api/PoliciesApi.test.js.map +1 -1
  245. package/esm/api/PolicySetApi.js +4 -4
  246. package/esm/api/PolicySetApi.js.map +1 -1
  247. package/esm/api/PolicySetApi.test.js +3 -3
  248. package/esm/api/PolicySetApi.test.js.map +1 -1
  249. package/esm/api/RealmApi.js +3 -3
  250. package/esm/api/RealmApi.js.map +1 -1
  251. package/esm/api/ResourceTypesApi.js +3 -3
  252. package/esm/api/ResourceTypesApi.js.map +1 -1
  253. package/esm/api/ResourceTypesApi.test.js +2 -2
  254. package/esm/api/ResourceTypesApi.test.js.map +1 -1
  255. package/esm/api/Saml2Api.js +3 -3
  256. package/esm/api/Saml2Api.js.map +1 -1
  257. package/esm/api/ScriptApi.js +3 -3
  258. package/esm/api/ScriptApi.js.map +1 -1
  259. package/esm/api/ServerInfoApi.js +2 -2
  260. package/esm/api/ServerInfoApi.js.map +1 -1
  261. package/esm/api/ServiceApi.js +3 -3
  262. package/esm/api/ServiceApi.js.map +1 -1
  263. package/esm/api/SocialIdentityProvidersApi.js +3 -3
  264. package/esm/api/SocialIdentityProvidersApi.js.map +1 -1
  265. package/esm/api/TreeApi.js +3 -3
  266. package/esm/api/TreeApi.js.map +1 -1
  267. package/esm/api/TreeApi.test.js +2 -2
  268. package/esm/api/TreeApi.test.js.map +1 -1
  269. package/esm/api/cloud/AdminFederationProvidersApi.js +3 -3
  270. package/esm/api/cloud/AdminFederationProvidersApi.js.map +1 -1
  271. package/esm/api/cloud/EnvInfoApi.js +3 -3
  272. package/esm/api/cloud/EnvInfoApi.js.map +1 -1
  273. package/esm/api/cloud/FeatureApi.js +3 -3
  274. package/esm/api/cloud/FeatureApi.js.map +1 -1
  275. package/esm/api/cloud/LogApi.js +3 -3
  276. package/esm/api/cloud/LogApi.js.map +1 -1
  277. package/esm/api/cloud/SecretsApi.js +4 -4
  278. package/esm/api/cloud/SecretsApi.js.map +1 -1
  279. package/esm/api/cloud/SecretsApi.test.js +2 -2
  280. package/esm/api/cloud/SecretsApi.test.js.map +1 -1
  281. package/esm/api/cloud/StartupApi.js +3 -3
  282. package/esm/api/cloud/StartupApi.js.map +1 -1
  283. package/esm/api/cloud/StartupApi.test.js +1 -1
  284. package/esm/api/cloud/StartupApi.test.js.map +1 -1
  285. package/esm/api/cloud/VariablesApi.js +4 -4
  286. package/esm/api/cloud/VariablesApi.js.map +1 -1
  287. package/esm/api/cloud/VariablesApi.test.js +2 -2
  288. package/esm/api/cloud/VariablesApi.test.js.map +1 -1
  289. package/esm/api/utils/ApiUtils.js +1 -2
  290. package/esm/api/utils/ApiUtils.js.map +1 -1
  291. package/esm/api/utils/ApiUtils.test.js +2 -2
  292. package/esm/api/utils/ApiUtils.test.js.map +1 -1
  293. package/esm/ext/axios-curlirize/curlirize.js +1 -1
  294. package/esm/ext/axios-curlirize/curlirize.js.map +1 -1
  295. package/esm/index.js +49 -54
  296. package/esm/index.js.map +1 -1
  297. package/esm/ops/AdminOps.js +8 -8
  298. package/esm/ops/AdminOps.js.map +1 -1
  299. package/esm/ops/AgentOps.js +3 -3
  300. package/esm/ops/AgentOps.js.map +1 -1
  301. package/esm/ops/AgentOps.test.js +3 -3
  302. package/esm/ops/AgentOps.test.js.map +1 -1
  303. package/esm/ops/AuthenticateOps.js +12 -12
  304. package/esm/ops/AuthenticateOps.js.map +1 -1
  305. package/esm/ops/AuthenticateOps.test.js +2 -4
  306. package/esm/ops/AuthenticateOps.test.js.map +1 -1
  307. package/esm/ops/CirclesOfTrustOps.js +3 -5
  308. package/esm/ops/CirclesOfTrustOps.js.map +1 -1
  309. package/esm/ops/ConnectionProfileOps.js +8 -8
  310. package/esm/ops/ConnectionProfileOps.js.map +1 -1
  311. package/esm/ops/ConnectionProfileOps.test.js +2 -2
  312. package/esm/ops/ConnectionProfileOps.test.js.map +1 -1
  313. package/esm/ops/EmailTemplateOps.js +1 -2
  314. package/esm/ops/EmailTemplateOps.js.map +1 -1
  315. package/esm/ops/EmailTemplateOps.test.js +2 -2
  316. package/esm/ops/EmailTemplateOps.test.js.map +1 -1
  317. package/esm/ops/IdmOps.js +2 -3
  318. package/esm/ops/IdmOps.js.map +1 -1
  319. package/esm/ops/IdmOps.test.js +2 -2
  320. package/esm/ops/IdmOps.test.js.map +1 -1
  321. package/esm/ops/IdpOps.js +8 -8
  322. package/esm/ops/IdpOps.js.map +1 -1
  323. package/esm/ops/IdpOps.test.js +2 -2
  324. package/esm/ops/IdpOps.test.js.map +1 -1
  325. package/esm/ops/InfoOps.js +6 -6
  326. package/esm/ops/InfoOps.js.map +1 -1
  327. package/esm/ops/JoseOps.test.js +4 -4
  328. package/esm/ops/JoseOps.test.js.map +1 -1
  329. package/esm/ops/JourneyOps.js +17 -17
  330. package/esm/ops/JourneyOps.js.map +1 -1
  331. package/esm/ops/JourneyOps.test.js +4 -4
  332. package/esm/ops/JourneyOps.test.js.map +1 -1
  333. package/esm/ops/ManagedObjectOps.js +1 -2
  334. package/esm/ops/ManagedObjectOps.js.map +1 -1
  335. package/esm/ops/NodeOps.js +7 -7
  336. package/esm/ops/NodeOps.js.map +1 -1
  337. package/esm/ops/OAuth2ClientOps.js +7 -10
  338. package/esm/ops/OAuth2ClientOps.js.map +1 -1
  339. package/esm/ops/OAuth2ClientOps.test.js +3 -3
  340. package/esm/ops/OAuth2ClientOps.test.js.map +1 -1
  341. package/esm/ops/OAuth2ProviderOps.js +1 -2
  342. package/esm/ops/OAuth2ProviderOps.js.map +1 -1
  343. package/esm/ops/OrganizationOps.js +3 -4
  344. package/esm/ops/OrganizationOps.js.map +1 -1
  345. package/esm/ops/PolicyOps.js +9 -12
  346. package/esm/ops/PolicyOps.js.map +1 -1
  347. package/esm/ops/PolicyOps.test.js +6 -6
  348. package/esm/ops/PolicyOps.test.js.map +1 -1
  349. package/esm/ops/PolicySetOps.js +7 -10
  350. package/esm/ops/PolicySetOps.js.map +1 -1
  351. package/esm/ops/PolicySetOps.test.js +4 -4
  352. package/esm/ops/PolicySetOps.test.js.map +1 -1
  353. package/esm/ops/RealmOps.js +2 -3
  354. package/esm/ops/RealmOps.js.map +1 -1
  355. package/esm/ops/ResourceTypeOps.js +4 -4
  356. package/esm/ops/ResourceTypeOps.js.map +1 -1
  357. package/esm/ops/ResourceTypeOps.test.js +2 -2
  358. package/esm/ops/ResourceTypeOps.test.js.map +1 -1
  359. package/esm/ops/Saml2Ops.js +7 -7
  360. package/esm/ops/Saml2Ops.js.map +1 -1
  361. package/esm/ops/Saml2Ops.test.js +6 -6
  362. package/esm/ops/Saml2Ops.test.js.map +1 -1
  363. package/esm/ops/ScriptOps.js +5 -5
  364. package/esm/ops/ScriptOps.js.map +1 -1
  365. package/esm/ops/ScriptOps.test.js +2 -2
  366. package/esm/ops/ScriptOps.test.js.map +1 -1
  367. package/esm/ops/ServiceOps.js +2 -2
  368. package/esm/ops/ServiceOps.js.map +1 -1
  369. package/esm/ops/ThemeOps.js +3 -3
  370. package/esm/ops/ThemeOps.js.map +1 -1
  371. package/esm/ops/ThemeOps.test.js +3 -3
  372. package/esm/ops/ThemeOps.test.js.map +1 -1
  373. package/esm/ops/cloud/AdminFederationOps.js +4 -4
  374. package/esm/ops/cloud/AdminFederationOps.js.map +1 -1
  375. package/esm/ops/cloud/FeatureOps.js +2 -2
  376. package/esm/ops/cloud/FeatureOps.js.map +1 -1
  377. package/esm/ops/cloud/LogOps.js +1 -3
  378. package/esm/ops/cloud/LogOps.js.map +1 -1
  379. package/esm/ops/cloud/SecretsOps.js +4 -5
  380. package/esm/ops/cloud/SecretsOps.js.map +1 -1
  381. package/esm/ops/cloud/ServiceAccountOps.js +3 -3
  382. package/esm/ops/cloud/ServiceAccountOps.js.map +1 -1
  383. package/esm/ops/cloud/ServiceAccountOps.test.js +3 -5
  384. package/esm/ops/cloud/ServiceAccountOps.test.js.map +1 -1
  385. package/esm/ops/cloud/StartupOps.js +4 -6
  386. package/esm/ops/cloud/StartupOps.js.map +1 -1
  387. package/esm/ops/cloud/VariablesOps.js +5 -6
  388. package/esm/ops/cloud/VariablesOps.js.map +1 -1
  389. package/esm/ops/utils/Console.js +1 -2
  390. package/esm/ops/utils/Console.js.map +1 -1
  391. package/esm/ops/utils/DataProtection.js +3 -3
  392. package/esm/ops/utils/DataProtection.js.map +1 -1
  393. package/esm/ops/utils/DataProtection.test.js +1 -1
  394. package/esm/ops/utils/DataProtection.test.js.map +1 -1
  395. package/esm/ops/utils/ExportImportUtils.js +4 -4
  396. package/esm/ops/utils/ExportImportUtils.js.map +1 -1
  397. package/esm/ops/utils/ExportImportUtils.test.js +1 -3
  398. package/esm/ops/utils/ExportImportUtils.test.js.map +1 -1
  399. package/esm/ops/utils/OpsUtils.js +3 -3
  400. package/esm/ops/utils/OpsUtils.js.map +1 -1
  401. package/esm/ops/utils/OpsUtils.test.js +3 -3
  402. package/esm/ops/utils/OpsUtils.test.js.map +1 -1
  403. package/esm/ops/utils/ValidationUtils.js +2 -2
  404. package/esm/ops/utils/ValidationUtils.js.map +1 -1
  405. package/esm/ops/utils/ValidationUtils.test.js +1 -1
  406. package/esm/ops/utils/ValidationUtils.test.js.map +1 -1
  407. package/esm/ops/utils/Version.js +1 -1
  408. package/esm/ops/utils/Version.js.map +1 -1
  409. package/esm/ops/utils/Version.test.js +1 -1
  410. package/esm/ops/utils/Version.test.js.map +1 -1
  411. package/esm/ops/utils/Wordwrap.test.js +1 -1
  412. package/esm/ops/utils/Wordwrap.test.js.map +1 -1
  413. package/esm/shared/State.test.js +1 -1
  414. package/esm/shared/State.test.js.map +1 -1
  415. package/esm/test/mocks/ForgeRockApiMockEngine.js +2 -2
  416. package/esm/test/mocks/ForgeRockApiMockEngine.js.map +1 -1
  417. package/esm/utils/AutoSetupPolly.js +2 -2
  418. package/esm/utils/AutoSetupPolly.js.map +1 -1
  419. package/esm/utils/SetupPollyForFrodoLib.js +1 -1
  420. package/esm/utils/SetupPollyForFrodoLib.js.map +1 -1
  421. package/package.json +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"JourneyOps.test.js","names":["Journey","state","getJourney","autoSetupPolly","globalConfig","setDeploymentType","CLOUD_DEPLOYMENT_TYPE_KEY","stageJourney","journey","create","id","deleteJourney","deep","verbose","progress","error","importJourney","reUuid","deps","describe","journey1","journey2","journey3","journey4","journey5","journey6","journey7","journey8","journey9","beforeAll","process","env","FRODO_POLLY_MODE","afterAll","FRODO_RECORD_PHASE","test","expect","getJourneys","toBeDefined","journeys","toMatchSnapshot","exportJourney","response","useStringArrays","meta","any","Object","journeyExport","assertions","toBeTruthy","enableJourney","result","disableJourney"],"sources":["../../src/ops/JourneyOps.test.ts"],"sourcesContent":["/**\n * To record and update snapshots, you must perform 3 steps in order:\n *\n * 1. Record API responses & update ESM snapshots\n *\n * This step breaks down into 4 phases:\n *\n * Phase 1: Record Non-destructive tests\n * Phase 2: Record Group 1 of DESTRUCTIVE tests - Deletes by ID\n * Phase 3: Record Group 2 of DESTRUCTIVE tests - Deletes by tag\n * Phase 4: Record Group 3 of DESTRUCTIVE tests - Delete all\n *\n * Because destructive tests interfere with the recording of non-destructive\n * tests and also interfere among themselves, they have to be run in groups\n * of non-interfering tests.\n *\n * To record and update ESM snapshots, you must call the test:record\n * script and override all the connection state variables required\n * to connect to the env to record from and also indicate the phase:\n *\n * FRODO_DEBUG=1 FRODO_RECORD_PHASE=1 FRODO_HOST=frodo-dev npm run test:record JourneyOps\n *\n * THESE TESTS ARE DESTRUCTIVE!!! DO NOT RUN AGAINST AN ENV WITH ACTIVE JOURNEYS!!!\n *\n * FRODO_DEBUG=1 FRODO_RECORD_PHASE=2 FRODO_HOST=frodo-dev npm run test:record JourneyOps\n * FRODO_DEBUG=1 FRODO_RECORD_PHASE=3 FRODO_HOST=frodo-dev npm run test:record JourneyOps\n * FRODO_DEBUG=1 FRODO_RECORD_PHASE=4 FRODO_HOST=frodo-dev npm run test:record JourneyOps\n *\n * The above command assumes that you have a connection profile for\n * 'frodo-dev' on your development machine.\n *\n * 2. Update CJS snapshots\n *\n * After recording, the ESM snapshots will already be updated as that happens\n * in one go, but you must manually update the CJS snapshots by running:\n *\n * FRODO_DEBUG=1 npm run test:update JourneyOps\n *\n * 3. Test your changes\n *\n * If 1 and 2 didn't produce any errors, you are ready to run the tests in\n * replay mode and make sure they all succeed as well:\n *\n * npm run test:only JourneyOps\n *\n * Note: FRODO_DEBUG=1 is optional and enables debug logging for some output\n * in case things don't function as expected\n */\nimport { Journey, state } from '../index';\nimport { getJourney } from '../test/mocks/ForgeRockApiMockEngine';\nimport { autoSetupPolly } from '../utils/AutoSetupPolly';\nimport * as globalConfig from '../storage/StaticStorage';\n\nautoSetupPolly();\n\nstate.setDeploymentType(globalConfig.CLOUD_DEPLOYMENT_TYPE_KEY);\n\nasync function stageJourney(journey: { id: string }, create = true) {\n // delete if exists, then create\n try {\n await Journey.getJourney(journey.id);\n await Journey.deleteJourney(journey.id, {\n deep: true,\n verbose: false,\n progress: false,\n });\n } catch (error) {\n // ignore\n } finally {\n if (create) {\n await Journey.importJourney(getJourney(journey.id), {\n reUuid: false,\n deps: true,\n });\n }\n }\n}\n\ndescribe('JourneyOps', () => {\n const journey1 = {\n id: 'FrodoTestJourney1',\n };\n const journey2 = {\n id: 'FrodoTestJourney2',\n };\n const journey3 = {\n id: 'FrodoTestJourney3',\n };\n const journey4 = {\n id: 'FrodoTestJourney4',\n };\n const journey5 = {\n id: 'FrodoTestJourney5',\n };\n const journey6 = {\n id: 'FrodoTestJourney6',\n };\n const journey7 = {\n id: 'FrodoTestJourney7',\n };\n const journey8 = {\n id: 'FrodoTestJourney8',\n };\n const journey9 = {\n id: 'FrodoTestJourney9',\n };\n // in recording mode, setup test data before recording\n beforeAll(async () => {\n if (process.env.FRODO_POLLY_MODE === 'record') {\n await stageJourney(journey1);\n await stageJourney(journey2);\n await stageJourney(journey3);\n await stageJourney(journey4, false);\n await stageJourney(journey5, false);\n await stageJourney(journey6);\n await stageJourney(journey7);\n await stageJourney(journey8);\n await stageJourney(journey9);\n }\n });\n // in recording mode, remove test data after recording\n afterAll(async () => {\n if (process.env.FRODO_POLLY_MODE === 'record') {\n await stageJourney(journey1, false);\n await stageJourney(journey2, false);\n await stageJourney(journey3, false);\n await stageJourney(journey4, false);\n await stageJourney(journey5, false);\n await stageJourney(journey6, false);\n await stageJourney(journey7, false);\n await stageJourney(journey8, false);\n await stageJourney(journey9, false);\n }\n });\n // Phase 1\n if (\n !process.env.FRODO_POLLY_MODE ||\n (process.env.FRODO_POLLY_MODE === 'record' &&\n process.env.FRODO_RECORD_PHASE === '1')\n ) {\n describe('getJourneys()', () => {\n test('0: Method is implemented', async () => {\n expect(Journey.getJourneys).toBeDefined();\n });\n\n test('1: Get all journeys', async () => {\n const journeys = await Journey.getJourneys();\n expect(journeys).toMatchSnapshot();\n });\n });\n\n describe('exportJourney()', () => {\n test('0: Method is implemented', async () => {\n expect(Journey.exportJourney).toBeDefined();\n });\n\n test(`1: Export journey '${journey3.id}' w/o dependencies`, async () => {\n const response = await Journey.exportJourney(journey3.id, {\n useStringArrays: false,\n deps: false,\n });\n expect(response).toMatchSnapshot({\n meta: expect.any(Object),\n });\n });\n\n test(`2: Export journey '${journey3.id}' w/ dependencies`, async () => {\n const response = await Journey.exportJourney(journey3.id, {\n useStringArrays: false,\n deps: true,\n });\n expect(response).toMatchSnapshot({\n meta: expect.any(Object),\n });\n });\n });\n\n describe('importJourney()', () => {\n test('0: Method is implemented', async () => {\n expect(Journey.importJourney).toBeDefined();\n });\n\n test(`1: Import journey '${journey4.id}' w/o dependencies`, async () => {\n const journeyExport = getJourney(journey4.id);\n expect.assertions(1);\n const response = await Journey.importJourney(journeyExport, {\n reUuid: false,\n deps: false,\n });\n expect(response).toBeTruthy();\n });\n\n test(`2: Import journey '${journey5.id}' w/ dependencies`, async () => {\n const journeyExport = getJourney(journey5.id);\n expect.assertions(1);\n const response = await Journey.importJourney(journeyExport, {\n reUuid: false,\n deps: true,\n });\n expect(response).toBeTruthy();\n });\n });\n\n describe('enableJourney()', () => {\n test('0: Method is implemented', async () => {\n expect(Journey.enableJourney).toBeDefined();\n });\n\n test(`1: Enable disabled journey '${journey6.id}'`, async () => {\n expect.assertions(1);\n const result = await Journey.enableJourney(journey6.id);\n expect(result).toBeTruthy();\n });\n\n test(`2: Enable already enabled journey '${journey7.id}'`, async () => {\n expect.assertions(1);\n const result = await Journey.enableJourney(journey7.id);\n expect(result).toBeTruthy();\n });\n });\n\n describe('disableJourney()', () => {\n test('0: Method is implemented', async () => {\n expect(Journey.disableJourney).toBeDefined();\n });\n\n test(`1: Disable enabled journey '${journey8.id}'`, async () => {\n expect.assertions(1);\n const result = await Journey.disableJourney(journey8.id);\n expect(result).toBeTruthy();\n });\n\n test(`2: Disable already disabled journey '${journey9.id}'`, async () => {\n expect.assertions(1);\n const result = await Journey.disableJourney(journey9.id);\n expect(result).toBeTruthy();\n });\n });\n }\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,KAAK,QAAQ,UAAU;AACzC,SAASC,UAAU,QAAQ,sCAAsC;AACjE,SAASC,cAAc,QAAQ,yBAAyB;AACxD,OAAO,KAAKC,YAAY,MAAM,0BAA0B;AAExDD,cAAc,CAAC,CAAC;AAEhBF,KAAK,CAACI,iBAAiB,CAACD,YAAY,CAACE,yBAAyB,CAAC;AAE/D,eAAeC,YAAYA,CAACC,OAAuB,EAAEC,MAAM,GAAG,IAAI,EAAE;EAClE;EACA,IAAI;IACF,MAAMT,OAAO,CAACE,UAAU,CAACM,OAAO,CAACE,EAAE,CAAC;IACpC,MAAMV,OAAO,CAACW,aAAa,CAACH,OAAO,CAACE,EAAE,EAAE;MACtCE,IAAI,EAAE,IAAI;MACVC,OAAO,EAAE,KAAK;MACdC,QAAQ,EAAE;IACZ,CAAC,C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AQ,CAAChB,EAAE,CAAC;QACvD0B,MAAM,CAACe,MAAM,CAAC,CAACF,UAAU,CAAC,CAAC;MAC7B,CAAC,CAAC;IACJ,CAAC,CAAC;IAEF9B,QAAQ,CAAC,kBAAkB,EAAE,MAAM;MACjCgB,IAAI,CAAC,0BAA0B,EAAE,YAAY;QAC3CC,MAAM,CAACpC,OAAO,CAACoD,cAAc,CAAC,CAACd,WAAW,CAAC,CAAC;MAC9C,CAAC,CAAC;MAEFH,IAAI,CAAE,+BAA8BR,QAAQ,CAACjB,EAAG,GAAE,EAAE,YAAY;QAC9D0B,MAAM,CAACY,UAAU,CAAC,CAAC,CAAC;QACpB,MAAMG,MAAM,GAAG,MAAMnD,OAAO,CAACoD,cAAc,CAACzB,QAAQ,CAACjB,EAAE,CAAC;QACxD0B,MAAM,CAACe,MAAM,CAAC,CAACF,UAAU,CAAC,CAAC;MAC7B,CAAC,CAAC;MAEFd,IAAI,CAAE,wCAAuCP,QAAQ,CAAClB,EAAG,GAAE,EAAE,YAAY;QACvE0B,MAAM,CAACY,UAAU,CAAC,CAAC,CAAC;QACpB,MAAMG,MAAM,GAAG,MAAMnD,OAAO,CAACoD,cAAc,CAACxB,QAAQ,CAAClB,EAAE,CAAC;QACxD0B,MAAM,CAACe,MAAM,CAAC,CAACF,UAAU,CAAC,CAAC;MAC7B,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;AACF,CAAC,CAAC"}
1
+ {"version":3,"file":"JourneyOps.test.js","names":["Journey","state","getJourney","autoSetupPolly","globalConfig","setDeploymentType","CLOUD_DEPLOYMENT_TYPE_KEY","stageJourney","journey","create","id","deleteJourney","deep","verbose","progress","error","importJourney","reUuid","deps","describe","journey1","journey2","journey3","journey4","journey5","journey6","journey7","journey8","journey9","beforeAll","process","env","FRODO_POLLY_MODE","afterAll","FRODO_RECORD_PHASE","test","expect","getJourneys","toBeDefined","journeys","toMatchSnapshot","exportJourney","response","useStringArrays","meta","any","Object","journeyExport","assertions","toBeTruthy","enableJourney","result","disableJourney"],"sources":["../../src/ops/JourneyOps.test.ts"],"sourcesContent":["/**\n * To record and update snapshots, you must perform 3 steps in order:\n *\n * 1. Record API responses & update ESM snapshots\n *\n * This step breaks down into 4 phases:\n *\n * Phase 1: Record Non-destructive tests\n * Phase 2: Record Group 1 of DESTRUCTIVE tests - Deletes by ID\n * Phase 3: Record Group 2 of DESTRUCTIVE tests - Deletes by tag\n * Phase 4: Record Group 3 of DESTRUCTIVE tests - Delete all\n *\n * Because destructive tests interfere with the recording of non-destructive\n * tests and also interfere among themselves, they have to be run in groups\n * of non-interfering tests.\n *\n * To record and update ESM snapshots, you must call the test:record\n * script and override all the connection state variables required\n * to connect to the env to record from and also indicate the phase:\n *\n * FRODO_DEBUG=1 FRODO_RECORD_PHASE=1 FRODO_HOST=frodo-dev npm run test:record JourneyOps\n *\n * THESE TESTS ARE DESTRUCTIVE!!! DO NOT RUN AGAINST AN ENV WITH ACTIVE JOURNEYS!!!\n *\n * FRODO_DEBUG=1 FRODO_RECORD_PHASE=2 FRODO_HOST=frodo-dev npm run test:record JourneyOps\n * FRODO_DEBUG=1 FRODO_RECORD_PHASE=3 FRODO_HOST=frodo-dev npm run test:record JourneyOps\n * FRODO_DEBUG=1 FRODO_RECORD_PHASE=4 FRODO_HOST=frodo-dev npm run test:record JourneyOps\n *\n * The above command assumes that you have a connection profile for\n * 'frodo-dev' on your development machine.\n *\n * 2. Update CJS snapshots\n *\n * After recording, the ESM snapshots will already be updated as that happens\n * in one go, but you must manually update the CJS snapshots by running:\n *\n * FRODO_DEBUG=1 npm run test:update JourneyOps\n *\n * 3. Test your changes\n *\n * If 1 and 2 didn't produce any errors, you are ready to run the tests in\n * replay mode and make sure they all succeed as well:\n *\n * npm run test:only JourneyOps\n *\n * Note: FRODO_DEBUG=1 is optional and enables debug logging for some output\n * in case things don't function as expected\n */\nimport { Journey, state } from '../index';\nimport { getJourney } from '../test/mocks/ForgeRockApiMockEngine';\nimport { autoSetupPolly } from '../utils/AutoSetupPolly';\nimport * as globalConfig from '../storage/StaticStorage';\n\nautoSetupPolly();\n\nstate.setDeploymentType(globalConfig.CLOUD_DEPLOYMENT_TYPE_KEY);\n\nasync function stageJourney(journey: { id: string }, create = true) {\n // delete if exists, then create\n try {\n await Journey.getJourney(journey.id);\n await Journey.deleteJourney(journey.id, {\n deep: true,\n verbose: false,\n progress: false,\n });\n } catch (error) {\n // ignore\n } finally {\n if (create) {\n await Journey.importJourney(getJourney(journey.id), {\n reUuid: false,\n deps: true,\n });\n }\n }\n}\n\ndescribe('JourneyOps', () => {\n const journey1 = {\n id: 'FrodoTestJourney1',\n };\n const journey2 = {\n id: 'FrodoTestJourney2',\n };\n const journey3 = {\n id: 'FrodoTestJourney3',\n };\n const journey4 = {\n id: 'FrodoTestJourney4',\n };\n const journey5 = {\n id: 'FrodoTestJourney5',\n };\n const journey6 = {\n id: 'FrodoTestJourney6',\n };\n const journey7 = {\n id: 'FrodoTestJourney7',\n };\n const journey8 = {\n id: 'FrodoTestJourney8',\n };\n const journey9 = {\n id: 'FrodoTestJourney9',\n };\n // in recording mode, setup test data before recording\n beforeAll(async () => {\n if (process.env.FRODO_POLLY_MODE === 'record') {\n await stageJourney(journey1);\n await stageJourney(journey2);\n await stageJourney(journey3);\n await stageJourney(journey4, false);\n await stageJourney(journey5, false);\n await stageJourney(journey6);\n await stageJourney(journey7);\n await stageJourney(journey8);\n await stageJourney(journey9);\n }\n });\n // in recording mode, remove test data after recording\n afterAll(async () => {\n if (process.env.FRODO_POLLY_MODE === 'record') {\n await stageJourney(journey1, false);\n await stageJourney(journey2, false);\n await stageJourney(journey3, false);\n await stageJourney(journey4, false);\n await stageJourney(journey5, false);\n await stageJourney(journey6, false);\n await stageJourney(journey7, false);\n await stageJourney(journey8, false);\n await stageJourney(journey9, false);\n }\n });\n // Phase 1\n if (\n !process.env.FRODO_POLLY_MODE ||\n (process.env.FRODO_POLLY_MODE === 'record' &&\n process.env.FRODO_RECORD_PHASE === '1')\n ) {\n describe('getJourneys()', () => {\n test('0: Method is implemented', async () => {\n expect(Journey.getJourneys).toBeDefined();\n });\n\n test('1: Get all journeys', async () => {\n const journeys = await Journey.getJourneys();\n expect(journeys).toMatchSnapshot();\n });\n });\n\n describe('exportJourney()', () => {\n test('0: Method is implemented', async () => {\n expect(Journey.exportJourney).toBeDefined();\n });\n\n test(`1: Export journey '${journey3.id}' w/o dependencies`, async () => {\n const response = await Journey.exportJourney(journey3.id, {\n useStringArrays: false,\n deps: false,\n });\n expect(response).toMatchSnapshot({\n meta: expect.any(Object),\n });\n });\n\n test(`2: Export journey '${journey3.id}' w/ dependencies`, async () => {\n const response = await Journey.exportJourney(journey3.id, {\n useStringArrays: false,\n deps: true,\n });\n expect(response).toMatchSnapshot({\n meta: expect.any(Object),\n });\n });\n });\n\n describe('importJourney()', () => {\n test('0: Method is implemented', async () => {\n expect(Journey.importJourney).toBeDefined();\n });\n\n test(`1: Import journey '${journey4.id}' w/o dependencies`, async () => {\n const journeyExport = getJourney(journey4.id);\n expect.assertions(1);\n const response = await Journey.importJourney(journeyExport, {\n reUuid: false,\n deps: false,\n });\n expect(response).toBeTruthy();\n });\n\n test(`2: Import journey '${journey5.id}' w/ dependencies`, async () => {\n const journeyExport = getJourney(journey5.id);\n expect.assertions(1);\n const response = await Journey.importJourney(journeyExport, {\n reUuid: false,\n deps: true,\n });\n expect(response).toBeTruthy();\n });\n });\n\n describe('enableJourney()', () => {\n test('0: Method is implemented', async () => {\n expect(Journey.enableJourney).toBeDefined();\n });\n\n test(`1: Enable disabled journey '${journey6.id}'`, async () => {\n expect.assertions(1);\n const result = await Journey.enableJourney(journey6.id);\n expect(result).toBeTruthy();\n });\n\n test(`2: Enable already enabled journey '${journey7.id}'`, async () => {\n expect.assertions(1);\n const result = await Journey.enableJourney(journey7.id);\n expect(result).toBeTruthy();\n });\n });\n\n describe('disableJourney()', () => {\n test('0: Method is implemented', async () => {\n expect(Journey.disableJourney).toBeDefined();\n });\n\n test(`1: Disable enabled journey '${journey8.id}'`, async () => {\n expect.assertions(1);\n const result = await Journey.disableJourney(journey8.id);\n expect(result).toBeTruthy();\n });\n\n test(`2: Disable already disabled journey '${journey9.id}'`, async () => {\n expect.assertions(1);\n const result = await Journey.disableJourney(journey9.id);\n expect(result).toBeTruthy();\n });\n });\n }\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA/CA,SAgDSA,OAAO,EAAEC,KAAK;AAAA,SACdC,UAAU;AAAA,SACVC,cAAc;AAAA,OAChB,KAAKC,YAAY;AAExBD,cAAc,CAAC,CAAC;AAEhBF,KAAK,CAACI,iBAAiB,CAACD,YAAY,CAACE,yBAAyB,CAAC;AAE/D,eAAeC,YAAYA,CAACC,OAAuB,EAAEC,MAAM,GAAG,IAAI,EAAE;EAClE;EACA,IAAI;IACF,MAAMT,OAAO,CAACE,UAAU,CAACM,OAAO,CAACE,EAAE,CAAC;IACpC,MAAMV,OAAO,CAACW,aAAa,CAACH,OAAO,CAACE,EAAE,EAAE;MACtCE,IAAI,EAAE,IAAI;MACVC,OAAO,EAAE,KAAK;MACdC,QAAQ,EAAE;IACZ,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd;EAAA,CACD,SAAS;IACR,IAAIN,MAAM,EAAE;MACV,MAAMT,OAAO,CAACgB,aAAa,CAACd,UAAU,CAACM,OAAO,CAACE,EAAE,CAAC,EAAE;QAClDO,MAAM,EAAE,KAAK;QACbC,IAAI,EAAE;MACR,CAAC,CAAC;IACJ;EACF;AACF;AAEAC,QAAQ,CAAC,YAAY,EAAE,MAAM;EAC3B,MAAMC,QAAQ,GAAG;IACfV,EAAE,EAAE;EAC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ACjB,EAAG,GAAE,EAAE,YAAY;QAC9D0B,MAAM,CAACY,UAAU,CAAC,CAAC,CAAC;QACpB,MAAMG,MAAM,GAAG,MAAMnD,OAAO,CAACoD,cAAc,CAACzB,QAAQ,CAACjB,EAAE,CAAC;QACxD0B,MAAM,CAACe,MAAM,CAAC,CAACF,UAAU,CAAC,CAAC;MAC7B,CAAC,CAAC;MAEFd,IAAI,CAAE,wCAAuCP,QAAQ,CAAClB,EAAG,GAAE,EAAE,YAAY;QACvE0B,MAAM,CAACY,UAAU,CAAC,CAAC,CAAC;QACpB,MAAMG,MAAM,GAAG,MAAMnD,OAAO,CAACoD,cAAc,CAACxB,QAAQ,CAAClB,EAAE,CAAC;QACxD0B,MAAM,CAACe,MAAM,CAAC,CAACF,UAAU,CAAC,CAAC;MAC7B,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;AACF,CAAC,CAAC"}
@@ -1,5 +1,4 @@
1
- import { getManagedObject } from '../api/ManagedObjectApi';
2
-
1
+ import { getManagedObject } from "../api/ManagedObjectApi.js";
3
2
  /**
4
3
  * Resolve a managed object's uuid to a human readable username
5
4
  * @param {String} type managed object type, e.g. teammember or alpha_user
@@ -1 +1 @@
1
- {"version":3,"file":"ManagedObjectOps.js","names":["getManagedObject","resolveUserName","type","id","userName","error","resolveFullName","managedObject","givenName","sn"],"sources":["../../src/ops/ManagedObjectOps.ts"],"sourcesContent":["import { getManagedObject } from '../api/ManagedObjectApi';\n\n/**\n * Resolve a managed object's uuid to a human readable username\n * @param {String} type managed object type, e.g. teammember or alpha_user\n * @param {String} id managed object _id\n * @returns {String} resolved username or uuid if any error occurs during reslution\n */\nexport async function resolveUserName(type, id) {\n try {\n return (await getManagedObject(type, id, ['userName'])).userName;\n } catch (error) {\n // eslint-disable-next-line no-empty\n }\n return id;\n}\n\n/**\n * Resolve a managed object's uuid to a human readable full name\n * @param {String} type managed object type, e.g. teammember or alpha_user\n * @param {String} id managed object _id\n * @returns {String} resolved full name or uuid if any error occurs during reslution\n */\nexport async function resolveFullName(type, id) {\n try {\n const managedObject = await getManagedObject(type, id, ['givenName', 'sn']);\n return `${managedObject.givenName} ${managedObject.sn}`;\n } catch (error) {\n // eslint-disable-next-line no-empty\n }\n return id;\n}\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,yBAAyB;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,eAAeA,CAACC,IAAI,EAAEC,EAAE,EAAE;EAC9C,IAAI;IACF,OAAO,CAAC,MAAMH,gBAAgB,CAACE,IAAI,EAAEC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAEC,QAAQ;EAClE,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd;EAAA;EAEF,OAAOF,EAAE;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeG,eAAeA,CAACJ,IAAI,EAAEC,EAAE,EAAE;EAC9C,IAAI;IACF,MAAMI,aAAa,GAAG,MAAMP,gBAAgB,CAACE,IAAI,EAAEC,EAAE,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IAC3E,OAAQ,GAAEI,aAAa,CAACC,SAAU,IAAGD,aAAa,CAACE,EAAG,EAAC;EACzD,CAAC,CAAC,OAAOJ,KAAK,EAAE;IACd;EAAA;EAEF,OAAOF,EAAE;AACX"}
1
+ {"version":3,"file":"ManagedObjectOps.js","names":["getManagedObject","resolveUserName","type","id","userName","error","resolveFullName","managedObject","givenName","sn"],"sources":["../../src/ops/ManagedObjectOps.ts"],"sourcesContent":["import { getManagedObject } from '../api/ManagedObjectApi';\n\n/**\n * Resolve a managed object's uuid to a human readable username\n * @param {String} type managed object type, e.g. teammember or alpha_user\n * @param {String} id managed object _id\n * @returns {String} resolved username or uuid if any error occurs during reslution\n */\nexport async function resolveUserName(type, id) {\n try {\n return (await getManagedObject(type, id, ['userName'])).userName;\n } catch (error) {\n // eslint-disable-next-line no-empty\n }\n return id;\n}\n\n/**\n * Resolve a managed object's uuid to a human readable full name\n * @param {String} type managed object type, e.g. teammember or alpha_user\n * @param {String} id managed object _id\n * @returns {String} resolved full name or uuid if any error occurs during reslution\n */\nexport async function resolveFullName(type, id) {\n try {\n const managedObject = await getManagedObject(type, id, ['givenName', 'sn']);\n return `${managedObject.givenName} ${managedObject.sn}`;\n } catch (error) {\n // eslint-disable-next-line no-empty\n }\n return id;\n}\n"],"mappings":"SAASA,gBAAgB;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,eAAeA,CAACC,IAAI,EAAEC,EAAE,EAAE;EAC9C,IAAI;IACF,OAAO,CAAC,MAAMH,gBAAgB,CAACE,IAAI,EAAEC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAEC,QAAQ;EAClE,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd;EAAA;EAEF,OAAOF,EAAE;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeG,eAAeA,CAACJ,IAAI,EAAEC,EAAE,EAAE;EAC9C,IAAI;IACF,MAAMI,aAAa,GAAG,MAAMP,gBAAgB,CAACE,IAAI,EAAEC,EAAE,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IAC3E,OAAQ,GAAEI,aAAa,CAACC,SAAU,IAAGD,aAAa,CAACE,EAAG,EAAC;EACzD,CAAC,CAAC,OAAOJ,KAAK,EAAE;IACd;EAAA;EAEF,OAAOF,EAAE;AACX"}
@@ -1,11 +1,11 @@
1
1
  import _ from 'lodash';
2
- import * as state from '../shared/State';
3
- import { getNode, deleteNode, getNodeTypes, getNodesByType } from '../api/NodeApi';
4
- import { getTrees } from '../api/TreeApi';
5
- import { printMessage, createProgressIndicator, updateProgressIndicator, stopProgressIndicator } from './utils/Console';
6
- import { getProviderByLocationAndId, getProviderMetadata } from '../api/Saml2Api';
7
- import { encodeBase64Url } from '../api/utils/Base64';
8
- import { NodeClassification } from './OpsTypes';
2
+ import * as state from "../shared/State.js";
3
+ import { getNode, deleteNode, getNodeTypes, getNodesByType } from "../api/NodeApi.js";
4
+ import { getTrees } from "../api/TreeApi.js";
5
+ import { printMessage, createProgressIndicator, updateProgressIndicator, stopProgressIndicator } from "./utils/Console.js";
6
+ import { getProviderByLocationAndId, getProviderMetadata } from "../api/Saml2Api.js";
7
+ import { encodeBase64Url } from "../api/utils/Base64.js";
8
+ import { NodeClassification } from "./OpsTypes.js";
9
9
  const containerNodes = ['PageNode', 'CustomPageNode'];
10
10
  const scriptedNodes = ['ConfigProviderNode', 'ScriptedDecisionNode', 'ClientScriptNode', 'SocialProviderHandlerNode', 'CustomScriptNode'];
11
11
  const emailTemplateNodes = ['EmailSuspendNode', 'EmailTemplateNode'];
@@ -1 +1 @@
1
- {"version":3,"file":"NodeOps.js","names":["_","state","getNode","deleteNode","getNodeTypes","getNodesByType","getTrees","printMessage","createProgressIndicator","updateProgressIndicator","stopProgressIndicator","getProviderByLocationAndId","getProviderMetadata","encodeBase64Url","NodeClassification","containerNodes","scriptedNodes","emailTemplateNodes","emptyScriptPlaceholder","getSaml2NodeDependencies","nodeObject","allProviders","allCirclesOfTrust","samlProperties","saml2EntityPromises","samlProperty","entityId","last","split","entity","find","providerResponse","location","_id","entityLocation","metaDataResponse","base64EntityXML","push","error","message","saml2EntitiesPromisesResults","Promise","all","saml2Entities","saml2Entity","samlEntityIds","map","saml2EntityConfig","circlesOfTrust","filter","circleOfTrust","hasEntityId","trustedProvider","trustedProviders","includes","saml2NodeDependencies","findOrphanedNodes","allNodes","orphanedNodes","types","allJourneys","result","errorMessage","errorTypes","undefined","response","data","type","nodes","node","length","activeNodes","journey","nodeId","hasOwnProperty","call","nodeType","containerNode","innerNode","diff","x","orphanedNode","removeOrphanedNodes","errorNodes","deleteError","OOTB_NODE_TYPES_7","OOTB_NODE_TYPES_7_1","concat","OOTB_NODE_TYPES_7_2","OOTB_NODE_TYPES_7_3","OOTB_NODE_TYPES_6_5","OOTB_NODE_TYPES_6","CLOUD_ONLY_NODE_TYPES","PREMIUM_NODE_TYPES","isPremiumNode","isCloudOnlyNode","isCustomNode","ootbNodeTypes","getAmVersion","slice","getNodeClassification","classifications","premium","custom","cloud","CUSTOM","CLOUD","STANDARD","PREMIUM"],"sources":["../../src/ops/NodeOps.ts"],"sourcesContent":["import _ from 'lodash';\nimport * as state from '../shared/State';\nimport {\n getNode,\n deleteNode,\n getNodeTypes,\n getNodesByType,\n} from '../api/NodeApi';\nimport { getTrees } from '../api/TreeApi';\nimport {\n printMessage,\n createProgressIndicator,\n updateProgressIndicator,\n stopProgressIndicator,\n} from './utils/Console';\nimport {\n getProviderByLocationAndId,\n getProviderMetadata,\n} from '../api/Saml2Api';\nimport { encodeBase64Url } from '../api/utils/Base64';\nimport { NodeClassification } from './OpsTypes';\n\nconst containerNodes = ['PageNode', 'CustomPageNode'];\n\nconst scriptedNodes = [\n 'ConfigProviderNode',\n 'ScriptedDecisionNode',\n 'ClientScriptNode',\n 'SocialProviderHandlerNode',\n 'CustomScriptNode',\n];\n\nconst emailTemplateNodes = ['EmailSuspendNode', 'EmailTemplateNode'];\n\nconst emptyScriptPlaceholder = '[Empty]';\n\n/**\n * Helper to get all SAML2 dependencies for a given node object\n * @param {Object} nodeObject node object\n * @param {[Object]} allProviders array of all saml2 providers objects\n * @param {[Object]} allCirclesOfTrust array of all circle of trust objects\n * @returns {Promise} a promise that resolves to an object containing a saml2 dependencies\n */\nasync function getSaml2NodeDependencies(\n nodeObject,\n allProviders,\n allCirclesOfTrust\n) {\n const samlProperties = ['metaAlias', 'idpEntityId'];\n const saml2EntityPromises = [];\n for (const samlProperty of samlProperties) {\n // In the following line nodeObject[samlProperty] will look like '/alpha/iSPAzure'.\n const entityId =\n samlProperty === 'metaAlias'\n ? _.last(nodeObject[samlProperty].split('/'))\n : nodeObject[samlProperty];\n const entity = _.find(allProviders, { entityId });\n if (entity) {\n try {\n const providerResponse = await getProviderByLocationAndId(\n entity.location,\n entity._id\n );\n /**\n * Adding entityLocation here to the entityResponse because the import tool\n * needs to know whether the saml2 entity is remote or not (this will be removed\n * from the config before importing see updateSaml2Entity and createSaml2Entity functions).\n * Importing a remote saml2 entity is a slightly different request (see createSaml2Entity).\n */\n providerResponse.entityLocation = entity.location;\n\n if (entity.location === 'remote') {\n // get the xml representation of this entity and add it to the entityResponse;\n const metaDataResponse = await getProviderMetadata(\n providerResponse.entityId\n );\n providerResponse.base64EntityXML = encodeBase64Url(metaDataResponse);\n }\n saml2EntityPromises.push(providerResponse);\n } catch (error) {\n printMessage(error.message, 'error');\n }\n }\n }\n try {\n const saml2EntitiesPromisesResults = await Promise.all(saml2EntityPromises);\n const saml2Entities = [];\n for (const saml2Entity of saml2EntitiesPromisesResults) {\n if (saml2Entity) {\n saml2Entities.push(saml2Entity);\n }\n }\n const samlEntityIds = _.map(\n saml2Entities,\n (saml2EntityConfig) => `${saml2EntityConfig.entityId}|saml2`\n );\n const circlesOfTrust = _.filter(allCirclesOfTrust, (circleOfTrust) => {\n let hasEntityId = false;\n for (const trustedProvider of circleOfTrust.trustedProviders) {\n if (!hasEntityId && samlEntityIds.includes(trustedProvider)) {\n hasEntityId = true;\n }\n }\n return hasEntityId;\n });\n const saml2NodeDependencies = {\n saml2Entities,\n circlesOfTrust,\n };\n return saml2NodeDependencies;\n } catch (error) {\n printMessage(error.message, 'error');\n const saml2NodeDependencies = {\n saml2Entities: [],\n circlesOfTrust: [],\n };\n return saml2NodeDependencies;\n }\n}\n\n/**\n * Find all node configuration objects that are no longer referenced by any tree\n * @returns {Promise<unknown[]>} a promise that resolves to an array of orphaned nodes\n */\nexport async function findOrphanedNodes(): Promise<unknown[]> {\n const allNodes = [];\n const orphanedNodes = [];\n let types = [];\n const allJourneys = (await getTrees()).result;\n let errorMessage = '';\n const errorTypes = [];\n\n createProgressIndicator(\n undefined,\n `Counting total nodes...`,\n 'indeterminate'\n );\n try {\n types = (await getNodeTypes()).result;\n } catch (error) {\n printMessage('Error retrieving all available node types:', 'error');\n printMessage(error.response.data, 'error');\n return [];\n }\n for (const type of types) {\n try {\n // eslint-disable-next-line no-await-in-loop, no-loop-func\n const nodes = (await getNodesByType(type._id)).result;\n for (const node of nodes) {\n allNodes.push(node);\n updateProgressIndicator(\n `${allNodes.length} total nodes${errorMessage}`\n );\n }\n } catch (error) {\n errorTypes.push(type._id);\n errorMessage = ` (Skipped type(s): ${errorTypes})`['yellow'];\n updateProgressIndicator(`${allNodes.length} total nodes${errorMessage}`);\n }\n }\n if (errorTypes.length > 0) {\n stopProgressIndicator(\n `${allNodes.length} total nodes${errorMessage}`,\n 'warn'\n );\n } else {\n stopProgressIndicator(`${allNodes.length} total nodes`, 'success');\n }\n\n createProgressIndicator(\n undefined,\n 'Counting active nodes...',\n 'indeterminate'\n );\n const activeNodes = [];\n for (const journey of allJourneys) {\n for (const nodeId in journey.nodes) {\n if ({}.hasOwnProperty.call(journey.nodes, nodeId)) {\n activeNodes.push(nodeId);\n updateProgressIndicator(`${activeNodes.length} active nodes`);\n const node = journey.nodes[nodeId];\n if (containerNodes.includes(node.nodeType)) {\n const containerNode = await getNode(nodeId, node.nodeType);\n for (const innerNode of containerNode.nodes) {\n activeNodes.push(innerNode._id);\n updateProgressIndicator(`${activeNodes.length} active nodes`);\n }\n }\n }\n }\n }\n stopProgressIndicator(`${activeNodes.length} active nodes`, 'success');\n\n createProgressIndicator(\n undefined,\n 'Calculating orphaned nodes...',\n 'indeterminate'\n );\n const diff = allNodes.filter((x) => !activeNodes.includes(x._id));\n for (const orphanedNode of diff) {\n orphanedNodes.push(orphanedNode);\n }\n stopProgressIndicator(`${orphanedNodes.length} orphaned nodes`, 'success');\n return orphanedNodes;\n}\n\n/**\n * Remove orphaned nodes\n * @param {[Object]} orphanedNodes Pass in an array of orphaned node configuration objects to remove\n * @returns {Promise<unknown[]>} a promise that resolves to an array nodes that encountered errors deleting\n */\nexport async function removeOrphanedNodes(\n orphanedNodes: unknown[]\n): Promise<unknown[]> {\n const errorNodes = [];\n createProgressIndicator(orphanedNodes.length, 'Removing orphaned nodes...');\n for (const node of orphanedNodes) {\n updateProgressIndicator(`Removing ${node['_id']}...`);\n try {\n // eslint-disable-next-line no-await-in-loop\n await deleteNode(node['_id'], node['_type']['_id']);\n } catch (deleteError) {\n errorNodes.push(node);\n printMessage(` ${deleteError}`, 'error');\n }\n }\n stopProgressIndicator(`Removed ${orphanedNodes.length} orphaned nodes.`);\n return errorNodes;\n}\n\nconst OOTB_NODE_TYPES_7 = [\n 'AcceptTermsAndConditionsNode',\n 'AccountActiveDecisionNode',\n 'AccountLockoutNode',\n 'AgentDataStoreDecisionNode',\n 'AnonymousSessionUpgradeNode',\n 'AnonymousUserNode',\n 'AttributeCollectorNode',\n 'AttributePresentDecisionNode',\n 'AttributeValueDecisionNode',\n 'AuthLevelDecisionNode',\n 'ChoiceCollectorNode',\n 'ConsentNode',\n 'CookiePresenceDecisionNode',\n 'CreateObjectNode',\n 'CreatePasswordNode',\n 'DataStoreDecisionNode',\n 'DeviceGeoFencingNode',\n 'DeviceLocationMatchNode',\n 'DeviceMatchNode',\n 'DeviceProfileCollectorNode',\n 'DeviceSaveNode',\n 'DeviceTamperingVerificationNode',\n 'DisplayUserNameNode',\n 'EmailSuspendNode',\n 'EmailTemplateNode',\n 'IdentifyExistingUserNode',\n 'IncrementLoginCountNode',\n 'InnerTreeEvaluatorNode',\n 'IotAuthenticationNode',\n 'IotRegistrationNode',\n 'KbaCreateNode',\n 'KbaDecisionNode',\n 'KbaVerifyNode',\n 'LdapDecisionNode',\n 'LoginCountDecisionNode',\n 'MessageNode',\n 'MetadataNode',\n 'MeterNode',\n 'ModifyAuthLevelNode',\n 'OneTimePasswordCollectorDecisionNode',\n 'OneTimePasswordGeneratorNode',\n 'OneTimePasswordSmsSenderNode',\n 'OneTimePasswordSmtpSenderNode',\n 'PageNode',\n 'PasswordCollectorNode',\n 'PatchObjectNode',\n 'PersistentCookieDecisionNode',\n 'PollingWaitNode',\n 'ProfileCompletenessDecisionNode',\n 'ProvisionDynamicAccountNode',\n 'ProvisionIdmAccountNode',\n 'PushAuthenticationSenderNode',\n 'PushResultVerifierNode',\n 'QueryFilterDecisionNode',\n 'RecoveryCodeCollectorDecisionNode',\n 'RecoveryCodeDisplayNode',\n 'RegisterLogoutWebhookNode',\n 'RemoveSessionPropertiesNode',\n 'RequiredAttributesDecisionNode',\n 'RetryLimitDecisionNode',\n 'ScriptedDecisionNode',\n 'SelectIdPNode',\n 'SessionDataNode',\n 'SetFailureUrlNode',\n 'SetPersistentCookieNode',\n 'SetSessionPropertiesNode',\n 'SetSuccessUrlNode',\n 'SocialFacebookNode',\n 'SocialGoogleNode',\n 'SocialNode',\n 'SocialOAuthIgnoreProfileNode',\n 'SocialOpenIdConnectNode',\n 'SocialProviderHandlerNode',\n 'TermsAndConditionsDecisionNode',\n 'TimeSinceDecisionNode',\n 'TimerStartNode',\n 'TimerStopNode',\n 'UsernameCollectorNode',\n 'ValidatedPasswordNode',\n 'ValidatedUsernameNode',\n 'WebAuthnAuthenticationNode',\n 'WebAuthnDeviceStorageNode',\n 'WebAuthnRegistrationNode',\n 'ZeroPageLoginNode',\n 'product-CertificateCollectorNode',\n 'product-CertificateUserExtractorNode',\n 'product-CertificateValidationNode',\n 'product-KerberosNode',\n 'product-ReCaptchaNode',\n 'product-Saml2Node',\n 'product-WriteFederationInformationNode',\n];\n\nconst OOTB_NODE_TYPES_7_1 = [\n 'PushRegistrationNode',\n 'GetAuthenticatorAppNode',\n 'MultiFactorRegistrationOptionsNode',\n 'OptOutMultiFactorAuthenticationNode',\n].concat(OOTB_NODE_TYPES_7);\n\nconst OOTB_NODE_TYPES_7_2 = [\n 'OathRegistrationNode',\n 'OathTokenVerifierNode',\n 'PassthroughAuthenticationNode',\n 'ConfigProviderNode',\n 'DebugNode',\n].concat(OOTB_NODE_TYPES_7_1);\n\nconst OOTB_NODE_TYPES_7_3 = [].concat(OOTB_NODE_TYPES_7_2);\n\nconst OOTB_NODE_TYPES_6_5 = [\n 'AbstractSocialAuthLoginNode',\n 'AccountLockoutNode',\n 'AgentDataStoreDecisionNode',\n 'AnonymousUserNode',\n 'AuthLevelDecisionNode',\n 'ChoiceCollectorNode',\n 'CookiePresenceDecisionNode',\n 'CreatePasswordNode',\n 'DataStoreDecisionNode',\n 'InnerTreeEvaluatorNode',\n 'LdapDecisionNode',\n 'MessageNode',\n 'MetadataNode',\n 'MeterNode',\n 'ModifyAuthLevelNode',\n 'OneTimePasswordCollectorDecisionNode',\n 'OneTimePasswordGeneratorNode',\n 'OneTimePasswordSmsSenderNode',\n 'OneTimePasswordSmtpSenderNode',\n 'PageNode',\n 'PasswordCollectorNode',\n 'PersistentCookieDecisionNode',\n 'PollingWaitNode',\n 'ProvisionDynamicAccountNode',\n 'ProvisionIdmAccountNode',\n 'PushAuthenticationSenderNode',\n 'PushResultVerifierNode',\n 'RecoveryCodeCollectorDecisionNode',\n 'RecoveryCodeDisplayNode',\n 'RegisterLogoutWebhookNode',\n 'RemoveSessionPropertiesNode',\n 'RetryLimitDecisionNode',\n 'ScriptedDecisionNode',\n 'SessionDataNode',\n 'SetFailureUrlNode',\n 'SetPersistentCookieNode',\n 'SetSessionPropertiesNode',\n 'SetSuccessUrlNode',\n 'SocialFacebookNode',\n 'SocialGoogleNode',\n 'SocialNode',\n 'SocialOAuthIgnoreProfileNode',\n 'SocialOpenIdConnectNode',\n 'TimerStartNode',\n 'TimerStopNode',\n 'UsernameCollectorNode',\n 'WebAuthnAuthenticationNode',\n 'WebAuthnRegistrationNode',\n 'ZeroPageLoginNode',\n];\n\nconst OOTB_NODE_TYPES_6 = [\n 'AbstractSocialAuthLoginNode',\n 'AccountLockoutNode',\n 'AgentDataStoreDecisionNode',\n 'AnonymousUserNode',\n 'AuthLevelDecisionNode',\n 'ChoiceCollectorNode',\n 'CookiePresenceDecisionNode',\n 'CreatePasswordNode',\n 'DataStoreDecisionNode',\n 'InnerTreeEvaluatorNode',\n 'LdapDecisionNode',\n 'MessageNode',\n 'MetadataNode',\n 'MeterNode',\n 'ModifyAuthLevelNode',\n 'OneTimePasswordCollectorDecisionNode',\n 'OneTimePasswordGeneratorNode',\n 'OneTimePasswordSmsSenderNode',\n 'OneTimePasswordSmtpSenderNode',\n 'PageNode',\n 'PasswordCollectorNode',\n 'PersistentCookieDecisionNode',\n 'PollingWaitNode',\n 'ProvisionDynamicAccountNode',\n 'ProvisionIdmAccountNode',\n 'PushAuthenticationSenderNode',\n 'PushResultVerifierNode',\n 'RecoveryCodeCollectorDecisionNode',\n 'RecoveryCodeDisplayNode',\n 'RegisterLogoutWebhookNode',\n 'RemoveSessionPropertiesNode',\n 'RetryLimitDecisionNode',\n 'ScriptedDecisionNode',\n 'SessionDataNode',\n 'SetFailureUrlNode',\n 'SetPersistentCookieNode',\n 'SetSessionPropertiesNode',\n 'SetSuccessUrlNode',\n 'SocialFacebookNode',\n 'SocialGoogleNode',\n 'SocialNode',\n 'SocialOAuthIgnoreProfileNode',\n 'SocialOpenIdConnectNode',\n 'TimerStartNode',\n 'TimerStopNode',\n 'UsernameCollectorNode',\n 'WebAuthnAuthenticationNode',\n 'WebAuthnRegistrationNode',\n 'ZeroPageLoginNode',\n];\n\nconst CLOUD_ONLY_NODE_TYPES = [\n 'IdentityStoreDecisionNode',\n 'AutonomousAccessSignalNode',\n 'AutonomousAccessDecisionNode',\n 'AutonomousAccessResultNode',\n];\n\nconst PREMIUM_NODE_TYPES = [\n 'AutonomousAccessSignalNode',\n 'AutonomousAccessDecisionNode',\n 'AutonomousAccessResultNode',\n];\n\n/**\n * Analyze if a node is a premium node.\n * @param {string} nodeType Node type\n * @returns {boolean} True if the node type is premium, false otherwise.\n */\nexport function isPremiumNode(nodeType: string): boolean {\n return PREMIUM_NODE_TYPES.includes(nodeType);\n}\n\n/**\n * Analyze if a node is a cloud-only node.\n * @param {string} nodeType Node type\n * @returns {boolean} True if the node type is cloud-only, false otherwise.\n */\nexport function isCloudOnlyNode(nodeType: string): boolean {\n return CLOUD_ONLY_NODE_TYPES.includes(nodeType);\n}\n\n/**\n * Analyze if a node is custom.\n * @param {string} nodeType Node type\n * @returns {boolean} True if the node type is custom, false otherwise.\n */\nexport function isCustomNode(nodeType: string): boolean {\n let ootbNodeTypes = [];\n switch (state.getAmVersion()) {\n case '7.1.0':\n ootbNodeTypes = OOTB_NODE_TYPES_7_1.slice(0);\n break;\n case '7.2.0':\n ootbNodeTypes = OOTB_NODE_TYPES_7_2.slice(0);\n break;\n case '7.3.0':\n ootbNodeTypes = OOTB_NODE_TYPES_7_3.slice(0);\n break;\n case '7.0.0':\n case '7.0.1':\n case '7.0.2':\n ootbNodeTypes = OOTB_NODE_TYPES_7.slice(0);\n break;\n case '6.5.3':\n case '6.5.2.3':\n case '6.5.2.2':\n case '6.5.2.1':\n case '6.5.2':\n case '6.5.1':\n case '6.5.0.2':\n case '6.5.0.1':\n ootbNodeTypes = OOTB_NODE_TYPES_6_5.slice(0);\n break;\n case '6.0.0.7':\n case '6.0.0.6':\n case '6.0.0.5':\n case '6.0.0.4':\n case '6.0.0.3':\n case '6.0.0.2':\n case '6.0.0.1':\n case '6.0.0':\n ootbNodeTypes = OOTB_NODE_TYPES_6.slice(0);\n break;\n default:\n return true;\n }\n return (\n !ootbNodeTypes.includes(nodeType) &&\n !isPremiumNode(nodeType) &&\n !isCloudOnlyNode(nodeType)\n );\n}\n\n/**\n * Get a node's classifications, which can be one or multiple of:\n * - standard: can run on any instance of a ForgeRock platform\n * - cloud: utilize nodes, which are exclusively available in the ForgeRock Identity Cloud\n * - premium: utilizes nodes, which come at a premium\n * @param {string} nodeType Node type\n * @returns {NodeClassification[]} an array of one or multiple classifications\n */\nexport function getNodeClassification(nodeType: string): NodeClassification[] {\n const classifications: NodeClassification[] = [];\n const premium = isPremiumNode(nodeType);\n const custom = isCustomNode(nodeType);\n const cloud = isCloudOnlyNode(nodeType);\n if (custom) {\n classifications.push(NodeClassification.CUSTOM);\n } else if (cloud) {\n classifications.push(NodeClassification.CLOUD);\n } else {\n classifications.push(NodeClassification.STANDARD);\n }\n if (premium) classifications.push(NodeClassification.PREM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I2B,MAAM,EAAE;IACVF,eAAe,CAAChE,IAAI,CAACvB,kBAAkB,CAAC2F,MAAM,CAAC;EACjD,CAAC,MAAM,IAAID,KAAK,EAAE;IAChBH,eAAe,CAAChE,IAAI,CAACvB,kBAAkB,CAAC4F,KAAK,CAAC;EAChD,CAAC,MAAM;IACLL,eAAe,CAAChE,IAAI,CAACvB,kBAAkB,CAAC6F,QAAQ,CAAC;EACnD;EACA,IAAIL,OAAO,EAAED,eAAe,CAAChE,IAAI,CAACvB,kBAAkB,CAAC8F,OAAO,CAAC;EAC7D,OAAOP,eAAe;AACxB"}
1
+ {"version":3,"file":"NodeOps.js","names":["_","state","getNode","deleteNode","getNodeTypes","getNodesByType","getTrees","printMessage","createProgressIndicator","updateProgressIndicator","stopProgressIndicator","getProviderByLocationAndId","getProviderMetadata","encodeBase64Url","NodeClassification","containerNodes","scriptedNodes","emailTemplateNodes","emptyScriptPlaceholder","getSaml2NodeDependencies","nodeObject","allProviders","allCirclesOfTrust","samlProperties","saml2EntityPromises","samlProperty","entityId","last","split","entity","find","providerResponse","location","_id","entityLocation","metaDataResponse","base64EntityXML","push","error","message","saml2EntitiesPromisesResults","Promise","all","saml2Entities","saml2Entity","samlEntityIds","map","saml2EntityConfig","circlesOfTrust","filter","circleOfTrust","hasEntityId","trustedProvider","trustedProviders","includes","saml2NodeDependencies","findOrphanedNodes","allNodes","orphanedNodes","types","allJourneys","result","errorMessage","errorTypes","undefined","response","data","type","nodes","node","length","activeNodes","journey","nodeId","hasOwnProperty","call","nodeType","containerNode","innerNode","diff","x","orphanedNode","removeOrphanedNodes","errorNodes","deleteError","OOTB_NODE_TYPES_7","OOTB_NODE_TYPES_7_1","concat","OOTB_NODE_TYPES_7_2","OOTB_NODE_TYPES_7_3","OOTB_NODE_TYPES_6_5","OOTB_NODE_TYPES_6","CLOUD_ONLY_NODE_TYPES","PREMIUM_NODE_TYPES","isPremiumNode","isCloudOnlyNode","isCustomNode","ootbNodeTypes","getAmVersion","slice","getNodeClassification","classifications","premium","custom","cloud","CUSTOM","CLOUD","STANDARD","PREMIUM"],"sources":["../../src/ops/NodeOps.ts"],"sourcesContent":["import _ from 'lodash';\nimport * as state from '../shared/State';\nimport {\n getNode,\n deleteNode,\n getNodeTypes,\n getNodesByType,\n} from '../api/NodeApi';\nimport { getTrees } from '../api/TreeApi';\nimport {\n printMessage,\n createProgressIndicator,\n updateProgressIndicator,\n stopProgressIndicator,\n} from './utils/Console';\nimport {\n getProviderByLocationAndId,\n getProviderMetadata,\n} from '../api/Saml2Api';\nimport { encodeBase64Url } from '../api/utils/Base64';\nimport { NodeClassification } from './OpsTypes';\n\nconst containerNodes = ['PageNode', 'CustomPageNode'];\n\nconst scriptedNodes = [\n 'ConfigProviderNode',\n 'ScriptedDecisionNode',\n 'ClientScriptNode',\n 'SocialProviderHandlerNode',\n 'CustomScriptNode',\n];\n\nconst emailTemplateNodes = ['EmailSuspendNode', 'EmailTemplateNode'];\n\nconst emptyScriptPlaceholder = '[Empty]';\n\n/**\n * Helper to get all SAML2 dependencies for a given node object\n * @param {Object} nodeObject node object\n * @param {[Object]} allProviders array of all saml2 providers objects\n * @param {[Object]} allCirclesOfTrust array of all circle of trust objects\n * @returns {Promise} a promise that resolves to an object containing a saml2 dependencies\n */\nasync function getSaml2NodeDependencies(\n nodeObject,\n allProviders,\n allCirclesOfTrust\n) {\n const samlProperties = ['metaAlias', 'idpEntityId'];\n const saml2EntityPromises = [];\n for (const samlProperty of samlProperties) {\n // In the following line nodeObject[samlProperty] will look like '/alpha/iSPAzure'.\n const entityId =\n samlProperty === 'metaAlias'\n ? _.last(nodeObject[samlProperty].split('/'))\n : nodeObject[samlProperty];\n const entity = _.find(allProviders, { entityId });\n if (entity) {\n try {\n const providerResponse = await getProviderByLocationAndId(\n entity.location,\n entity._id\n );\n /**\n * Adding entityLocation here to the entityResponse because the import tool\n * needs to know whether the saml2 entity is remote or not (this will be removed\n * from the config before importing see updateSaml2Entity and createSaml2Entity functions).\n * Importing a remote saml2 entity is a slightly different request (see createSaml2Entity).\n */\n providerResponse.entityLocation = entity.location;\n\n if (entity.location === 'remote') {\n // get the xml representation of this entity and add it to the entityResponse;\n const metaDataResponse = await getProviderMetadata(\n providerResponse.entityId\n );\n providerResponse.base64EntityXML = encodeBase64Url(metaDataResponse);\n }\n saml2EntityPromises.push(providerResponse);\n } catch (error) {\n printMessage(error.message, 'error');\n }\n }\n }\n try {\n const saml2EntitiesPromisesResults = await Promise.all(saml2EntityPromises);\n const saml2Entities = [];\n for (const saml2Entity of saml2EntitiesPromisesResults) {\n if (saml2Entity) {\n saml2Entities.push(saml2Entity);\n }\n }\n const samlEntityIds = _.map(\n saml2Entities,\n (saml2EntityConfig) => `${saml2EntityConfig.entityId}|saml2`\n );\n const circlesOfTrust = _.filter(allCirclesOfTrust, (circleOfTrust) => {\n let hasEntityId = false;\n for (const trustedProvider of circleOfTrust.trustedProviders) {\n if (!hasEntityId && samlEntityIds.includes(trustedProvider)) {\n hasEntityId = true;\n }\n }\n return hasEntityId;\n });\n const saml2NodeDependencies = {\n saml2Entities,\n circlesOfTrust,\n };\n return saml2NodeDependencies;\n } catch (error) {\n printMessage(error.message, 'error');\n const saml2NodeDependencies = {\n saml2Entities: [],\n circlesOfTrust: [],\n };\n return saml2NodeDependencies;\n }\n}\n\n/**\n * Find all node configuration objects that are no longer referenced by any tree\n * @returns {Promise<unknown[]>} a promise that resolves to an array of orphaned nodes\n */\nexport async function findOrphanedNodes(): Promise<unknown[]> {\n const allNodes = [];\n const orphanedNodes = [];\n let types = [];\n const allJourneys = (await getTrees()).result;\n let errorMessage = '';\n const errorTypes = [];\n\n createProgressIndicator(\n undefined,\n `Counting total nodes...`,\n 'indeterminate'\n );\n try {\n types = (await getNodeTypes()).result;\n } catch (error) {\n printMessage('Error retrieving all available node types:', 'error');\n printMessage(error.response.data, 'error');\n return [];\n }\n for (const type of types) {\n try {\n // eslint-disable-next-line no-await-in-loop, no-loop-func\n const nodes = (await getNodesByType(type._id)).result;\n for (const node of nodes) {\n allNodes.push(node);\n updateProgressIndicator(\n `${allNodes.length} total nodes${errorMessage}`\n );\n }\n } catch (error) {\n errorTypes.push(type._id);\n errorMessage = ` (Skipped type(s): ${errorTypes})`['yellow'];\n updateProgressIndicator(`${allNodes.length} total nodes${errorMessage}`);\n }\n }\n if (errorTypes.length > 0) {\n stopProgressIndicator(\n `${allNodes.length} total nodes${errorMessage}`,\n 'warn'\n );\n } else {\n stopProgressIndicator(`${allNodes.length} total nodes`, 'success');\n }\n\n createProgressIndicator(\n undefined,\n 'Counting active nodes...',\n 'indeterminate'\n );\n const activeNodes = [];\n for (const journey of allJourneys) {\n for (const nodeId in journey.nodes) {\n if ({}.hasOwnProperty.call(journey.nodes, nodeId)) {\n activeNodes.push(nodeId);\n updateProgressIndicator(`${activeNodes.length} active nodes`);\n const node = journey.nodes[nodeId];\n if (containerNodes.includes(node.nodeType)) {\n const containerNode = await getNode(nodeId, node.nodeType);\n for (const innerNode of containerNode.nodes) {\n activeNodes.push(innerNode._id);\n updateProgressIndicator(`${activeNodes.length} active nodes`);\n }\n }\n }\n }\n }\n stopProgressIndicator(`${activeNodes.length} active nodes`, 'success');\n\n createProgressIndicator(\n undefined,\n 'Calculating orphaned nodes...',\n 'indeterminate'\n );\n const diff = allNodes.filter((x) => !activeNodes.includes(x._id));\n for (const orphanedNode of diff) {\n orphanedNodes.push(orphanedNode);\n }\n stopProgressIndicator(`${orphanedNodes.length} orphaned nodes`, 'success');\n return orphanedNodes;\n}\n\n/**\n * Remove orphaned nodes\n * @param {[Object]} orphanedNodes Pass in an array of orphaned node configuration objects to remove\n * @returns {Promise<unknown[]>} a promise that resolves to an array nodes that encountered errors deleting\n */\nexport async function removeOrphanedNodes(\n orphanedNodes: unknown[]\n): Promise<unknown[]> {\n const errorNodes = [];\n createProgressIndicator(orphanedNodes.length, 'Removing orphaned nodes...');\n for (const node of orphanedNodes) {\n updateProgressIndicator(`Removing ${node['_id']}...`);\n try {\n // eslint-disable-next-line no-await-in-loop\n await deleteNode(node['_id'], node['_type']['_id']);\n } catch (deleteError) {\n errorNodes.push(node);\n printMessage(` ${deleteError}`, 'error');\n }\n }\n stopProgressIndicator(`Removed ${orphanedNodes.length} orphaned nodes.`);\n return errorNodes;\n}\n\nconst OOTB_NODE_TYPES_7 = [\n 'AcceptTermsAndConditionsNode',\n 'AccountActiveDecisionNode',\n 'AccountLockoutNode',\n 'AgentDataStoreDecisionNode',\n 'AnonymousSessionUpgradeNode',\n 'AnonymousUserNode',\n 'AttributeCollectorNode',\n 'AttributePresentDecisionNode',\n 'AttributeValueDecisionNode',\n 'AuthLevelDecisionNode',\n 'ChoiceCollectorNode',\n 'ConsentNode',\n 'CookiePresenceDecisionNode',\n 'CreateObjectNode',\n 'CreatePasswordNode',\n 'DataStoreDecisionNode',\n 'DeviceGeoFencingNode',\n 'DeviceLocationMatchNode',\n 'DeviceMatchNode',\n 'DeviceProfileCollectorNode',\n 'DeviceSaveNode',\n 'DeviceTamperingVerificationNode',\n 'DisplayUserNameNode',\n 'EmailSuspendNode',\n 'EmailTemplateNode',\n 'IdentifyExistingUserNode',\n 'IncrementLoginCountNode',\n 'InnerTreeEvaluatorNode',\n 'IotAuthenticationNode',\n 'IotRegistrationNode',\n 'KbaCreateNode',\n 'KbaDecisionNode',\n 'KbaVerifyNode',\n 'LdapDecisionNode',\n 'LoginCountDecisionNode',\n 'MessageNode',\n 'MetadataNode',\n 'MeterNode',\n 'ModifyAuthLevelNode',\n 'OneTimePasswordCollectorDecisionNode',\n 'OneTimePasswordGeneratorNode',\n 'OneTimePasswordSmsSenderNode',\n 'OneTimePasswordSmtpSenderNode',\n 'PageNode',\n 'PasswordCollectorNode',\n 'PatchObjectNode',\n 'PersistentCookieDecisionNode',\n 'PollingWaitNode',\n 'ProfileCompletenessDecisionNode',\n 'ProvisionDynamicAccountNode',\n 'ProvisionIdmAccountNode',\n 'PushAuthenticationSenderNode',\n 'PushResultVerifierNode',\n 'QueryFilterDecisionNode',\n 'RecoveryCodeCollectorDecisionNode',\n 'RecoveryCodeDisplayNode',\n 'RegisterLogoutWebhookNode',\n 'RemoveSessionPropertiesNode',\n 'RequiredAttributesDecisionNode',\n 'RetryLimitDecisionNode',\n 'ScriptedDecisionNode',\n 'SelectIdPNode',\n 'SessionDataNode',\n 'SetFailureUrlNode',\n 'SetPersistentCookieNode',\n 'SetSessionPropertiesNode',\n 'SetSuccessUrlNode',\n 'SocialFacebookNode',\n 'SocialGoogleNode',\n 'SocialNode',\n 'SocialOAuthIgnoreProfileNode',\n 'SocialOpenIdConnectNode',\n 'SocialProviderHandlerNode',\n 'TermsAndConditionsDecisionNode',\n 'TimeSinceDecisionNode',\n 'TimerStartNode',\n 'TimerStopNode',\n 'UsernameCollectorNode',\n 'ValidatedPasswordNode',\n 'ValidatedUsernameNode',\n 'WebAuthnAuthenticationNode',\n 'WebAuthnDeviceStorageNode',\n 'WebAuthnRegistrationNode',\n 'ZeroPageLoginNode',\n 'product-CertificateCollectorNode',\n 'product-CertificateUserExtractorNode',\n 'product-CertificateValidationNode',\n 'product-KerberosNode',\n 'product-ReCaptchaNode',\n 'product-Saml2Node',\n 'product-WriteFederationInformationNode',\n];\n\nconst OOTB_NODE_TYPES_7_1 = [\n 'PushRegistrationNode',\n 'GetAuthenticatorAppNode',\n 'MultiFactorRegistrationOptionsNode',\n 'OptOutMultiFactorAuthenticationNode',\n].concat(OOTB_NODE_TYPES_7);\n\nconst OOTB_NODE_TYPES_7_2 = [\n 'OathRegistrationNode',\n 'OathTokenVerifierNode',\n 'PassthroughAuthenticationNode',\n 'ConfigProviderNode',\n 'DebugNode',\n].concat(OOTB_NODE_TYPES_7_1);\n\nconst OOTB_NODE_TYPES_7_3 = [].concat(OOTB_NODE_TYPES_7_2);\n\nconst OOTB_NODE_TYPES_6_5 = [\n 'AbstractSocialAuthLoginNode',\n 'AccountLockoutNode',\n 'AgentDataStoreDecisionNode',\n 'AnonymousUserNode',\n 'AuthLevelDecisionNode',\n 'ChoiceCollectorNode',\n 'CookiePresenceDecisionNode',\n 'CreatePasswordNode',\n 'DataStoreDecisionNode',\n 'InnerTreeEvaluatorNode',\n 'LdapDecisionNode',\n 'MessageNode',\n 'MetadataNode',\n 'MeterNode',\n 'ModifyAuthLevelNode',\n 'OneTimePasswordCollectorDecisionNode',\n 'OneTimePasswordGeneratorNode',\n 'OneTimePasswordSmsSenderNode',\n 'OneTimePasswordSmtpSenderNode',\n 'PageNode',\n 'PasswordCollectorNode',\n 'PersistentCookieDecisionNode',\n 'PollingWaitNode',\n 'ProvisionDynamicAccountNode',\n 'ProvisionIdmAccountNode',\n 'PushAuthenticationSenderNode',\n 'PushResultVerifierNode',\n 'RecoveryCodeCollectorDecisionNode',\n 'RecoveryCodeDisplayNode',\n 'RegisterLogoutWebhookNode',\n 'RemoveSessionPropertiesNode',\n 'RetryLimitDecisionNode',\n 'ScriptedDecisionNode',\n 'SessionDataNode',\n 'SetFailureUrlNode',\n 'SetPersistentCookieNode',\n 'SetSessionPropertiesNode',\n 'SetSuccessUrlNode',\n 'SocialFacebookNode',\n 'SocialGoogleNode',\n 'SocialNode',\n 'SocialOAuthIgnoreProfileNode',\n 'SocialOpenIdConnectNode',\n 'TimerStartNode',\n 'TimerStopNode',\n 'UsernameCollectorNode',\n 'WebAuthnAuthenticationNode',\n 'WebAuthnRegistrationNode',\n 'ZeroPageLoginNode',\n];\n\nconst OOTB_NODE_TYPES_6 = [\n 'AbstractSocialAuthLoginNode',\n 'AccountLockoutNode',\n 'AgentDataStoreDecisionNode',\n 'AnonymousUserNode',\n 'AuthLevelDecisionNode',\n 'ChoiceCollectorNode',\n 'CookiePresenceDecisionNode',\n 'CreatePasswordNode',\n 'DataStoreDecisionNode',\n 'InnerTreeEvaluatorNode',\n 'LdapDecisionNode',\n 'MessageNode',\n 'MetadataNode',\n 'MeterNode',\n 'ModifyAuthLevelNode',\n 'OneTimePasswordCollectorDecisionNode',\n 'OneTimePasswordGeneratorNode',\n 'OneTimePasswordSmsSenderNode',\n 'OneTimePasswordSmtpSenderNode',\n 'PageNode',\n 'PasswordCollectorNode',\n 'PersistentCookieDecisionNode',\n 'PollingWaitNode',\n 'ProvisionDynamicAccountNode',\n 'ProvisionIdmAccountNode',\n 'PushAuthenticationSenderNode',\n 'PushResultVerifierNode',\n 'RecoveryCodeCollectorDecisionNode',\n 'RecoveryCodeDisplayNode',\n 'RegisterLogoutWebhookNode',\n 'RemoveSessionPropertiesNode',\n 'RetryLimitDecisionNode',\n 'ScriptedDecisionNode',\n 'SessionDataNode',\n 'SetFailureUrlNode',\n 'SetPersistentCookieNode',\n 'SetSessionPropertiesNode',\n 'SetSuccessUrlNode',\n 'SocialFacebookNode',\n 'SocialGoogleNode',\n 'SocialNode',\n 'SocialOAuthIgnoreProfileNode',\n 'SocialOpenIdConnectNode',\n 'TimerStartNode',\n 'TimerStopNode',\n 'UsernameCollectorNode',\n 'WebAuthnAuthenticationNode',\n 'WebAuthnRegistrationNode',\n 'ZeroPageLoginNode',\n];\n\nconst CLOUD_ONLY_NODE_TYPES = [\n 'IdentityStoreDecisionNode',\n 'AutonomousAccessSignalNode',\n 'AutonomousAccessDecisionNode',\n 'AutonomousAccessResultNode',\n];\n\nconst PREMIUM_NODE_TYPES = [\n 'AutonomousAccessSignalNode',\n 'AutonomousAccessDecisionNode',\n 'AutonomousAccessResultNode',\n];\n\n/**\n * Analyze if a node is a premium node.\n * @param {string} nodeType Node type\n * @returns {boolean} True if the node type is premium, false otherwise.\n */\nexport function isPremiumNode(nodeType: string): boolean {\n return PREMIUM_NODE_TYPES.includes(nodeType);\n}\n\n/**\n * Analyze if a node is a cloud-only node.\n * @param {string} nodeType Node type\n * @returns {boolean} True if the node type is cloud-only, false otherwise.\n */\nexport function isCloudOnlyNode(nodeType: string): boolean {\n return CLOUD_ONLY_NODE_TYPES.includes(nodeType);\n}\n\n/**\n * Analyze if a node is custom.\n * @param {string} nodeType Node type\n * @returns {boolean} True if the node type is custom, false otherwise.\n */\nexport function isCustomNode(nodeType: string): boolean {\n let ootbNodeTypes = [];\n switch (state.getAmVersion()) {\n case '7.1.0':\n ootbNodeTypes = OOTB_NODE_TYPES_7_1.slice(0);\n break;\n case '7.2.0':\n ootbNodeTypes = OOTB_NODE_TYPES_7_2.slice(0);\n break;\n case '7.3.0':\n ootbNodeTypes = OOTB_NODE_TYPES_7_3.slice(0);\n break;\n case '7.0.0':\n case '7.0.1':\n case '7.0.2':\n ootbNodeTypes = OOTB_NODE_TYPES_7.slice(0);\n break;\n case '6.5.3':\n case '6.5.2.3':\n case '6.5.2.2':\n case '6.5.2.1':\n case '6.5.2':\n case '6.5.1':\n case '6.5.0.2':\n case '6.5.0.1':\n ootbNodeTypes = OOTB_NODE_TYPES_6_5.slice(0);\n break;\n case '6.0.0.7':\n case '6.0.0.6':\n case '6.0.0.5':\n case '6.0.0.4':\n case '6.0.0.3':\n case '6.0.0.2':\n case '6.0.0.1':\n case '6.0.0':\n ootbNodeTypes = OOTB_NODE_TYPES_6.slice(0);\n break;\n default:\n return true;\n }\n return (\n !ootbNodeTypes.includes(nodeType) &&\n !isPremiumNode(nodeType) &&\n !isCloudOnlyNode(nodeType)\n );\n}\n\n/**\n * Get a node's classifications, which can be one or multiple of:\n * - standard: can run on any instance of a ForgeRock platform\n * - cloud: utilize nodes, which are exclusively available in the ForgeRock Identity Cloud\n * - premium: utilizes nodes, which come at a premium\n * @param {string} nodeType Node type\n * @returns {NodeClassification[]} an array of one or multiple classifications\n */\nexport function getNodeClassification(nodeType: string): NodeClassification[] {\n const classifications: NodeClassification[] = [];\n const premium = isPremiumNode(nodeType);\n const custom = isCustomNode(nodeType);\n const cloud = isCloudOnlyNode(nodeType);\n if (custom) {\n classifications.push(NodeClassification.CUSTOM);\n } else if (cloud) {\n classifications.push(NodeClassification.CLOUD);\n } else {\n classifications.push(NodeClassification.STANDARD);\n }\n if (premium) classifications.push(NodeClassification.PREMIUM);\n return classifications;\n}\n"],"mappings":"AAAA,OAAOA,CAAC,MAAM,QAAQ;AAAC,OACh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,KAAK,CAAC;EAChD,CAAC,MAAM;IACLL,eAAe,CAAChE,IAAI,CAACvB,kBAAkB,CAAC6F,QAAQ,CAAC;EACnD;EACA,IAAIL,OAAO,EAAED,eAAe,CAAChE,IAAI,CAACvB,kBAAkB,CAAC8F,OAAO,CAAC;EAC7D,OAAOP,eAAe;AACxB"}
@@ -1,19 +1,16 @@
1
- import { getOAuth2Client as _getOAuth2Client, getOAuth2Clients as _getOAuth2Clients, putOAuth2Client as _putOAuth2Client, deleteOAuth2Client as _deleteOAuth2Client } from '../api/OAuth2ClientApi';
2
- import { getMetadata } from './utils/ExportImportUtils';
3
- import { debugMessage, printMessage } from './utils/Console';
4
- import { convertBase64TextToArray } from './utils/ExportImportUtils';
5
- import { getOAuth2Provider } from './OAuth2ProviderOps';
6
- import * as state from '../shared/State';
7
- import { getScript, putScript } from './ScriptOps';
8
-
1
+ import { getOAuth2Client as _getOAuth2Client, getOAuth2Clients as _getOAuth2Clients, putOAuth2Client as _putOAuth2Client, deleteOAuth2Client as _deleteOAuth2Client } from "../api/OAuth2ClientApi.js";
2
+ import { getMetadata } from "./utils/ExportImportUtils.js";
3
+ import { debugMessage, printMessage } from "./utils/Console.js";
4
+ import { convertBase64TextToArray } from "./utils/ExportImportUtils.js";
5
+ import { getOAuth2Provider } from "./OAuth2ProviderOps.js";
6
+ import * as state from "../shared/State.js";
7
+ import { getScript, putScript } from "./ScriptOps.js";
9
8
  /**
10
9
  * OAuth2 client export options
11
10
  */
12
-
13
11
  /**
14
12
  * OAuth2 client import options
15
13
  */
16
-
17
14
  /**
18
15
  * Create an empty OAuth2 client export template
19
16
  * @returns {OAuth2ClientExportInterface} an empty OAuth2 client export template
@@ -1 +1 @@
1
- {"version":3,"file":"OAuth2ClientOps.js","names":["getOAuth2Client","_getOAuth2Client","getOAuth2Clients","_getOAuth2Clients","putOAuth2Client","_putOAuth2Client","deleteOAuth2Client","_deleteOAuth2Client","getMetadata","debugMessage","printMessage","convertBase64TextToArray","getOAuth2Provider","state","getScript","putScript","createOAuth2ClientExportTemplate","meta","script","application","clients","result","clientId","clientData","response","error","_error$response","_error$response2","_error$response2$data","status","data","message","validAttributes","detail","push","key","Object","keys","attribute","includes","getVerbose","exportOAuth2ClientDependencies","options","exportData","endsWith","scriptId","scriptData","useStringArrays","_error$response3","_error$response4","_error$response4$data","exportOAuth2Clients","deps","errors","provider","client","_provider","_id","length","errorMessages","map","join","Error","exportOAuth2Client","importOAuth2ClientDependencies","importData","importOAuth2Client","imported","id","_rev","importFirstOAuth2Client","importOAuth2Clients"],"sources":["../../src/ops/OAuth2ClientOps.ts"],"sourcesContent":["import {\n getOAuth2Client as _getOAuth2Client,\n getOAuth2Clients as _getOAuth2Clients,\n putOAuth2Client as _putOAuth2Client,\n deleteOAuth2Client as _deleteOAuth2Client,\n} from '../api/OAuth2ClientApi';\nimport { ExportMetaData } from './OpsTypes';\nimport { OAuth2ClientSkeleton, ScriptSkeleton } from '../api/ApiTypes';\nimport { getMetadata } from './utils/ExportImportUtils';\nimport { debugMessage, printMessage } from './utils/Console';\nimport { convertBase64TextToArray } from './utils/ExportImportUtils';\nimport { getOAuth2Provider } from './OAuth2ProviderOps';\nimport * as state from '../shared/State';\nimport { getScript, putScript } from './ScriptOps';\n\n/**\n * OAuth2 client export options\n */\nexport interface OAuth2ClientExportOptions {\n /**\n * Use string arrays to store multi-line text in scripts.\n */\n useStringArrays: boolean;\n /**\n * Include any dependencies (scripts).\n */\n deps: boolean;\n}\n\n/**\n * OAuth2 client import options\n */\nexport interface OAuth2ClientImportOptions {\n /**\n * Include any dependencies (scripts).\n */\n deps: boolean;\n}\n\nexport interface OAuth2ClientExportInterface {\n meta?: ExportMetaData;\n script: Record<string, ScriptSkeleton>;\n application: Record<string, OAuth2ClientSkeleton>;\n}\n\n/**\n * Create an empty OAuth2 client export template\n * @returns {OAuth2ClientExportInterface} an empty OAuth2 client export template\n */\nfunction createOAuth2ClientExportTemplate(): OAuth2ClientExportInterface {\n return {\n meta: getMetadata(),\n script: {},\n application: {},\n } as OAuth2ClientExportInterface;\n}\n\n/**\n * Get all OAuth2 clients\n * @returns {Promise<any[]>} a promise that resolves to an array of oauth2client objects\n */\nexport async function getOAuth2Clients() {\n const clients = (await _getOAuth2Clients()).result;\n return clients;\n}\n\n/**\n * Get OAuth2 client\n * @param {string} clientId client id\n * @returns {Promise<any>} a promise that resolves to an oauth2client object\n */\nexport async function getOAuth2Client(clientId: string) {\n return _getOAuth2Client(clientId);\n}\n\n/**\n * Put OAuth2 client\n * @param {string} clientId client id\n * @param {any} clientData oauth2client object\n * @returns {Promise<any>} a promise that resolves to an oauth2client object\n */\nexport async function putOAuth2Client(clientId: string, clientData) {\n debugMessage(`OAuth2ClientOps.putOAuth2Client: start`);\n try {\n const response = await _putOAuth2Client(clientId, clientData);\n debugMessage(`OAuth2ClientOps.putOAuth2Client: end`);\n return response;\n } catch (error) {\n if (\n error.response?.status === 400 &&\n error.response?.data?.message === 'Invalid attribute specified.'\n ) {\n const { validAttributes } = error.response.data.detail;\n validAttributes.push('_id');\n for (const key of Object.keys(clientData)) {\n if (typeof clientData[key] === 'object') {\n for (const attribute of Object.keys(clientData[key])) {\n if (!validAttributes.includes(attribute)) {\n if (state.getVerbose())\n printMessage(\n `\\n- Removing invalid attribute: ${key}.${attribute}`,\n 'warn'\n );\n delete clientData[key][attribute];\n }\n }\n }\n }\n const response = await _putOAuth2Client(clientId, clientData);\n debugMessage(`OAuth2ClientOps.putOAuth2Client: end`);\n return response;\n } else {\n throw error;\n }\n }\n}\n\n/**\n * Delete OAuth2 client\n * @param {string} clientId client id\n * @returns {Promise<any>} a promise that resolves to an oauth2client object\n */\nexport async function deleteOAuth2Client(clientId: string) {\n return _deleteOAuth2Client(clientId);\n}\n\n/**\n * Helper function to export dependencies of an OAuth2 Client\n * @param {unknown} clientData oauth2 client data\n * @param {OAuth2ClientExportOptions} options export options\n * @param {OAuth2ClientExportInterface} exportData export data\n */\nasync function exportOAuth2ClientDependencies(\n clientData: unknown,\n options: OAuth2ClientExportOptions,\n exportData: OAuth2ClientExportInterface\n) {\n debugMessage(\n `OAuth2ClientOps.exportOAuth2ClientDependencies: start [client=${clientData['_id']}]`\n );\n if (clientData['overrideOAuth2ClientConfig']) {\n for (const key of Object.keys(clientData['overrideOAuth2ClientConfig'])) {\n if (key.endsWith('Script')) {\n const scriptId = clientData['overrideOAuth2ClientConfig'][key];\n if (scriptId !== '[Empty]' && !exportData.script[scriptId]) {\n try {\n debugMessage(`- ${scriptId} referenced by ${clientData['_id']}`);\n const scriptData = await getScript(scriptId);\n if (options.useStringArrays)\n scriptData.script = convertBase64TextToArray(scriptData.script);\n exportData.script[scriptId] = scriptData;\n } catch (error) {\n if (\n !(\n error.response?.status === 403 &&\n error.response?.data?.message ===\n 'This operation is not available in ForgeRock Identity Cloud.'\n )\n ) {\n error.message = `Error retrieving script ${scriptId} referenced by ${key} key in client ${clientData['_id']}: ${error.message}`;\n throw error;\n }\n }\n }\n }\n }\n }\n debugMessage(`OAuth2ClientOps.exportOAuth2ClientDependencies: end`);\n}\n\n/**\n * Export all OAuth2 clients\n * @param {OAuth2ClientExportOptions} options export options\n * @returns {OAuth2ClientExportInterface} export data\n */\nexport async function exportOAuth2Clients(\n options: OAuth2ClientExportOptions = { useStringArrays: true, deps: true }\n): Promise<OAuth2ClientExportInterface> {\n debugMessage(`OAuth2ClientOps.exportOAuth2Clients: start`);\n const exportData = createOAuth2ClientExportTemplate();\n const errors = [];\n try {\n const provider = await getOAuth2Provider();\n const clients = await getOAuth2Clients();\n for (const client of clients) {\n try {\n client._provider = provider;\n exportData.application[client._id] = client;\n if (options.deps) {\n await exportOAuth2ClientDependencies(client, options, exportData);\n }\n } catch (error) {\n errors.push(error);\n }\n }\n } catch (error) {\n errors.push(error);\n }\n if (errors.length) {\n const errorMessages = errors.map((error) => error.message).join('\\n');\n throw new Error(`Export error:\\n${errorMessages}`);\n }\n debugMessage(`OAuth2ClientOps.exportOAuth2Clients: end`);\n return exportData;\n}\n\n/**\n * Export OAuth2 client by ID\n * @param {string} clientId oauth2 client id\n * @param {OAuth2ClientExportOptions} options export options\n * @returns {OAuth2ClientExportInterface} export data\n */\nexport async function exportOAuth2Client(\n clientId: string,\n options: OAuth2ClientExportOptions = { useStringArrays: true, deps: true }\n): Promise<OAuth2ClientExportInterface> {\n debugMessage(`OAuth2ClientOps.exportOAuth2Client: start`);\n const exportData = createOAuth2ClientExportTemplate();\n const errors = [];\n try {\n const clientData = await getOAuth2Client(clientId);\n clientData._provider = await getOAuth2Provider();\n exportData.application[clientData._id] = clientData;\n if (options.deps) {\n await exportOAuth2ClientDependencies(clientData, options, exportData);\n }\n } catch (error) {\n errors.push(error);\n }\n if (errors.length) {\n const errorMessages = errors.map((error) => error.message).join('\\n');\n throw new Error(`Export error:\\n${errorMessages}`);\n }\n debugMessage(`OAuth2ClientOps.exportOAuth2Client: end`);\n return exportData;\n}\n\n/**\n * Helper function to export dependencies of an OAuth2 Client\n * @param {unknown} clientData oauth2 client data\n * @param {OAuth2ClientExportInterface} importData import data\n */\nasync function importOAuth2ClientDependencies(\n clientData: unknown,\n importData: OAuth2ClientExportInterface\n) {\n for (const key of Object.keys(clientData['overrideOAuth2ClientConfig'])) {\n if (key.endsWith('Script')) {\n const scriptId = clientData['overrideOAuth2ClientConfig'][key];\n if (scriptId !== '[Empty]' && importData.script[scriptId]) {\n const scriptData: ScriptSkeleton = importData.script[scriptId];\n await putScript(scriptId, scriptData);\n }\n }\n }\n}\n\n/**\n * Import OAuth2 Client by ID\n * @param {string} clientId client id\n * @param {OAuth2ClientExportInterface} importData import data\n * @param {OAuth2ClientImportOptions} options import options\n */\nexport async function importOAuth2Client(\n clientId: string,\n importData: OAuth2ClientExportInterface,\n options: OAuth2ClientImportOptions = { deps: true }\n) {\n let response = null;\n const errors = [];\n const imported = [];\n for (const id of Object.keys(importData.application)) {\n if (id === clientId) {\n try {\n const clientData = importData.application[id];\n delete clientData._provider;\n delete clientData._rev;\n if (options.deps) {\n await importOAuth2ClientDependencies(clientData, importData);\n }\n response = await putOAuth2Client(id, clientData);\n imported.push(id);\n } catch (error) {\n errors.push(error);\n }\n }\n }\n if (errors.length) {\n const errorMessages = errors.map((error) => error.message).join('\\n');\n throw new Error(`Import error:\\n${errorMessages}`);\n }\n if (0 === imported.length) {\n throw new Error(`Import error:\\n${clientId} not found in import data!`);\n }\n return response;\n}\n\n/**\n * Import first OAuth2 Client\n * @param {OAuth2ClientExportInterface} importData import data\n * @param {OAuth2ClientImportOptions} options import options\n */\nexport async function importFirstOAuth2Client(\n importData: OAuth2ClientExportInterface,\n options: OAuth2ClientImportOptions = { deps: true }\n) {\n let response = null;\n const errors = [];\n const imported = [];\n for (const id of Object.keys(importData.application)) {\n try {\n const clientData = importData.application[id];\n delete clientData._provider;\n delete clientData._rev;\n if (options.deps) {\n await importOAuth2ClientDependencies(clientData, importData);\n }\n response = await putOAuth2Client(id, clientData);\n imported.push(id);\n } catch (error) {\n errors.push(error);\n }\n break;\n }\n if (errors.length) {\n const errorMessages = errors.map((error) => error.message).join('\\n');\n throw new Error(`Import error:\\n${errorMessages}`);\n }\n if (0 === imported.length) {\n throw new Error(`Import error:\\nNo clients found in import data!`);\n }\n return response;\n}\n\n/**\n * Import OAuth2 Clients\n * @param {OAuth2ClientExportInterface} importData import data\n * @param {OAuth2ClientImportOptions} options import options\n * @returns {Promise<unknown[]>} array of imported oauth2 clients\n */\nexport async function importOAuth2Clients(\n importData: OAuth2ClientExportInterface,\n options: OAuth2ClientImportOptions = { deps: true }\n): Promise<unknown[]> {\n const response = [];\n const errors = [];\n const imported = [];\n for (const id of Object.keys(importData.application)) {\n try {\n const clientData = importData.application[id];\n delete clientData._provider;\n delete clientData._rev;\n if (options.deps) {\n await importOAuth2ClientDependencies(clientData, importData);\n }\n response.push(await putOAuth2Client(id, clientData));\n imported.push(id);\n } catch (error) {\n errors.push(error);\n }\n }\n if (errors.length) {\n const errorMessages = errors.map((error) => error.message).join('\\n');\n throw new Error(`Import error:\\n${errorMessages}`);\n }\n if (0 === imported.length) {\n throw new Error(`Import error:\\nNo clients found in import data!`);\n }\n return response;\n}\n"],"mappings":"AAAA,SACEA,eAAe,IAAIC,gBAAgB,EACnCC,gBAAgB,IAAIC,iBAAiB,EACrCC,eAAe,IAAIC,gBAAgB,EACnCC,kBAAkB,IAAIC,mBAAmB,QACpC,wBAAwB;AAG/B,SAASC,WAAW,QAAQ,2BAA2B;AACvD,SAASC,YAAY,EAAEC,YAAY,QAAQ,iBAAiB;AAC5D,SAASC,wBAAwB,QAAQ,2BAA2B;AACpE,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,OAAO,KAAKC,KAAK,MAAM,iBAAiB;AACxC,SAASC,SAAS,EAAEC,SAAS,QAAQ,aAAa;;AAElD;AACA;AACA;;AAYA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACA,SAASC,gCAAgCA,CAAA,EAAgC;EACvE,OAAO;IACLC,IAAI,EAAET,WAAW,CAAC,CAAC;IACnBU,MAAM,EAAE,CAAC,CAAC;IACVC,WAAW,EAAE,CAAC;EAChB,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA,OAAO,eAAejB,gBAAgBA,CAAA,EAAG;EACvC,MAAMkB,OAAO,GAAG,CAAC,MAAMjB,iBAAiB,CAAC,CAAC,EAAEkB,MAAM;EAClD,OAAOD,OAAO;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAepB,eAAeA,CAACsB,QAAgB,EAAE;EACtD,OAAOrB,gBAAgB,CAACqB,QAAQ,CAAC;AACnC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAelB,eAAeA,CAACkB,QAAgB,EAAEC,UAAU,EAAE;EAClEd,YAAY,CAAE,wCAAuC,CAAC;EACtD,IAAI;IACF,MAAMe,QAAQ,GAAG,MAAMnB,gBAAgB,CAACiB,QAAQ,EAAEC,UAAU,CAAC;IAC7Dd,YAAY,CAAE,sCAAqC,CAAC;IACpD,OAAOe,QAAQ;EACjB,CAAC,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G,CAAEnC,KAAK,IAAKA,KAAK,CAACM,OAAO,CAAC,CAAC8B,IAAI,CAAC,IAAI,CAAC;IACrE,MAAM,IAAIC,KAAK,CAAE,kBAAiBH,aAAc,EAAC,CAAC;EACpD;EACA,IAAI,CAAC,KAAKQ,QAAQ,CAACT,MAAM,EAAE;IACzB,MAAM,IAAII,KAAK,CAAE,iDAAgD,CAAC;EACpE;EACA,OAAOtC,QAAQ;AACjB"}
1
+ {"version":3,"file":"OAuth2ClientOps.js","names":["getOAuth2Client","_getOAuth2Client","getOAuth2Clients","_getOAuth2Clients","putOAuth2Client","_putOAuth2Client","deleteOAuth2Client","_deleteOAuth2Client","getMetadata","debugMessage","printMessage","convertBase64TextToArray","getOAuth2Provider","state","getScript","putScript","createOAuth2ClientExportTemplate","meta","script","application","clients","result","clientId","clientData","response","error","_error$response","_error$response2","_error$response2$data","status","data","message","validAttributes","detail","push","key","Object","keys","attribute","includes","getVerbose","exportOAuth2ClientDependencies","options","exportData","endsWith","scriptId","scriptData","useStringArrays","_error$response3","_error$response4","_error$response4$data","exportOAuth2Clients","deps","errors","provider","client","_provider","_id","length","errorMessages","map","join","Error","exportOAuth2Client","importOAuth2ClientDependencies","importData","importOAuth2Client","imported","id","_rev","importFirstOAuth2Client","importOAuth2Clients"],"sources":["../../src/ops/OAuth2ClientOps.ts"],"sourcesContent":["import {\n getOAuth2Client as _getOAuth2Client,\n getOAuth2Clients as _getOAuth2Clients,\n putOAuth2Client as _putOAuth2Client,\n deleteOAuth2Client as _deleteOAuth2Client,\n} from '../api/OAuth2ClientApi';\nimport { ExportMetaData } from './OpsTypes';\nimport { OAuth2ClientSkeleton, ScriptSkeleton } from '../api/ApiTypes';\nimport { getMetadata } from './utils/ExportImportUtils';\nimport { debugMessage, printMessage } from './utils/Console';\nimport { convertBase64TextToArray } from './utils/ExportImportUtils';\nimport { getOAuth2Provider } from './OAuth2ProviderOps';\nimport * as state from '../shared/State';\nimport { getScript, putScript } from './ScriptOps';\n\n/**\n * OAuth2 client export options\n */\nexport interface OAuth2ClientExportOptions {\n /**\n * Use string arrays to store multi-line text in scripts.\n */\n useStringArrays: boolean;\n /**\n * Include any dependencies (scripts).\n */\n deps: boolean;\n}\n\n/**\n * OAuth2 client import options\n */\nexport interface OAuth2ClientImportOptions {\n /**\n * Include any dependencies (scripts).\n */\n deps: boolean;\n}\n\nexport interface OAuth2ClientExportInterface {\n meta?: ExportMetaData;\n script: Record<string, ScriptSkeleton>;\n application: Record<string, OAuth2ClientSkeleton>;\n}\n\n/**\n * Create an empty OAuth2 client export template\n * @returns {OAuth2ClientExportInterface} an empty OAuth2 client export template\n */\nfunction createOAuth2ClientExportTemplate(): OAuth2ClientExportInterface {\n return {\n meta: getMetadata(),\n script: {},\n application: {},\n } as OAuth2ClientExportInterface;\n}\n\n/**\n * Get all OAuth2 clients\n * @returns {Promise<any[]>} a promise that resolves to an array of oauth2client objects\n */\nexport async function getOAuth2Clients() {\n const clients = (await _getOAuth2Clients()).result;\n return clients;\n}\n\n/**\n * Get OAuth2 client\n * @param {string} clientId client id\n * @returns {Promise<any>} a promise that resolves to an oauth2client object\n */\nexport async function getOAuth2Client(clientId: string) {\n return _getOAuth2Client(clientId);\n}\n\n/**\n * Put OAuth2 client\n * @param {string} clientId client id\n * @param {any} clientData oauth2client object\n * @returns {Promise<any>} a promise that resolves to an oauth2client object\n */\nexport async function putOAuth2Client(clientId: string, clientData) {\n debugMessage(`OAuth2ClientOps.putOAuth2Client: start`);\n try {\n const response = await _putOAuth2Client(clientId, clientData);\n debugMessage(`OAuth2ClientOps.putOAuth2Client: end`);\n return response;\n } catch (error) {\n if (\n error.response?.status === 400 &&\n error.response?.data?.message === 'Invalid attribute specified.'\n ) {\n const { validAttributes } = error.response.data.detail;\n validAttributes.push('_id');\n for (const key of Object.keys(clientData)) {\n if (typeof clientData[key] === 'object') {\n for (const attribute of Object.keys(clientData[key])) {\n if (!validAttributes.includes(attribute)) {\n if (state.getVerbose())\n printMessage(\n `\\n- Removing invalid attribute: ${key}.${attribute}`,\n 'warn'\n );\n delete clientData[key][attribute];\n }\n }\n }\n }\n const response = await _putOAuth2Client(clientId, clientData);\n debugMessage(`OAuth2ClientOps.putOAuth2Client: end`);\n return response;\n } else {\n throw error;\n }\n }\n}\n\n/**\n * Delete OAuth2 client\n * @param {string} clientId client id\n * @returns {Promise<any>} a promise that resolves to an oauth2client object\n */\nexport async function deleteOAuth2Client(clientId: string) {\n return _deleteOAuth2Client(clientId);\n}\n\n/**\n * Helper function to export dependencies of an OAuth2 Client\n * @param {unknown} clientData oauth2 client data\n * @param {OAuth2ClientExportOptions} options export options\n * @param {OAuth2ClientExportInterface} exportData export data\n */\nasync function exportOAuth2ClientDependencies(\n clientData: unknown,\n options: OAuth2ClientExportOptions,\n exportData: OAuth2ClientExportInterface\n) {\n debugMessage(\n `OAuth2ClientOps.exportOAuth2ClientDependencies: start [client=${clientData['_id']}]`\n );\n if (clientData['overrideOAuth2ClientConfig']) {\n for (const key of Object.keys(clientData['overrideOAuth2ClientConfig'])) {\n if (key.endsWith('Script')) {\n const scriptId = clientData['overrideOAuth2ClientConfig'][key];\n if (scriptId !== '[Empty]' && !exportData.script[scriptId]) {\n try {\n debugMessage(`- ${scriptId} referenced by ${clientData['_id']}`);\n const scriptData = await getScript(scriptId);\n if (options.useStringArrays)\n scriptData.script = convertBase64TextToArray(scriptData.script);\n exportData.script[scriptId] = scriptData;\n } catch (error) {\n if (\n !(\n error.response?.status === 403 &&\n error.response?.data?.message ===\n 'This operation is not available in ForgeRock Identity Cloud.'\n )\n ) {\n error.message = `Error retrieving script ${scriptId} referenced by ${key} key in client ${clientData['_id']}: ${error.message}`;\n throw error;\n }\n }\n }\n }\n }\n }\n debugMessage(`OAuth2ClientOps.exportOAuth2ClientDependencies: end`);\n}\n\n/**\n * Export all OAuth2 clients\n * @param {OAuth2ClientExportOptions} options export options\n * @returns {OAuth2ClientExportInterface} export data\n */\nexport async function exportOAuth2Clients(\n options: OAuth2ClientExportOptions = { useStringArrays: true, deps: true }\n): Promise<OAuth2ClientExportInterface> {\n debugMessage(`OAuth2ClientOps.exportOAuth2Clients: start`);\n const exportData = createOAuth2ClientExportTemplate();\n const errors = [];\n try {\n const provider = await getOAuth2Provider();\n const clients = await getOAuth2Clients();\n for (const client of clients) {\n try {\n client._provider = provider;\n exportData.application[client._id] = client;\n if (options.deps) {\n await exportOAuth2ClientDependencies(client, options, exportData);\n }\n } catch (error) {\n errors.push(error);\n }\n }\n } catch (error) {\n errors.push(error);\n }\n if (errors.length) {\n const errorMessages = errors.map((error) => error.message).join('\\n');\n throw new Error(`Export error:\\n${errorMessages}`);\n }\n debugMessage(`OAuth2ClientOps.exportOAuth2Clients: end`);\n return exportData;\n}\n\n/**\n * Export OAuth2 client by ID\n * @param {string} clientId oauth2 client id\n * @param {OAuth2ClientExportOptions} options export options\n * @returns {OAuth2ClientExportInterface} export data\n */\nexport async function exportOAuth2Client(\n clientId: string,\n options: OAuth2ClientExportOptions = { useStringArrays: true, deps: true }\n): Promise<OAuth2ClientExportInterface> {\n debugMessage(`OAuth2ClientOps.exportOAuth2Client: start`);\n const exportData = createOAuth2ClientExportTemplate();\n const errors = [];\n try {\n const clientData = await getOAuth2Client(clientId);\n clientData._provider = await getOAuth2Provider();\n exportData.application[clientData._id] = clientData;\n if (options.deps) {\n await exportOAuth2ClientDependencies(clientData, options, exportData);\n }\n } catch (error) {\n errors.push(error);\n }\n if (errors.length) {\n const errorMessages = errors.map((error) => error.message).join('\\n');\n throw new Error(`Export error:\\n${errorMessages}`);\n }\n debugMessage(`OAuth2ClientOps.exportOAuth2Client: end`);\n return exportData;\n}\n\n/**\n * Helper function to export dependencies of an OAuth2 Client\n * @param {unknown} clientData oauth2 client data\n * @param {OAuth2ClientExportInterface} importData import data\n */\nasync function importOAuth2ClientDependencies(\n clientData: unknown,\n importData: OAuth2ClientExportInterface\n) {\n for (const key of Object.keys(clientData['overrideOAuth2ClientConfig'])) {\n if (key.endsWith('Script')) {\n const scriptId = clientData['overrideOAuth2ClientConfig'][key];\n if (scriptId !== '[Empty]' && importData.script[scriptId]) {\n const scriptData: ScriptSkeleton = importData.script[scriptId];\n await putScript(scriptId, scriptData);\n }\n }\n }\n}\n\n/**\n * Import OAuth2 Client by ID\n * @param {string} clientId client id\n * @param {OAuth2ClientExportInterface} importData import data\n * @param {OAuth2ClientImportOptions} options import options\n */\nexport async function importOAuth2Client(\n clientId: string,\n importData: OAuth2ClientExportInterface,\n options: OAuth2ClientImportOptions = { deps: true }\n) {\n let response = null;\n const errors = [];\n const imported = [];\n for (const id of Object.keys(importData.application)) {\n if (id === clientId) {\n try {\n const clientData = importData.application[id];\n delete clientData._provider;\n delete clientData._rev;\n if (options.deps) {\n await importOAuth2ClientDependencies(clientData, importData);\n }\n response = await putOAuth2Client(id, clientData);\n imported.push(id);\n } catch (error) {\n errors.push(error);\n }\n }\n }\n if (errors.length) {\n const errorMessages = errors.map((error) => error.message).join('\\n');\n throw new Error(`Import error:\\n${errorMessages}`);\n }\n if (0 === imported.length) {\n throw new Error(`Import error:\\n${clientId} not found in import data!`);\n }\n return response;\n}\n\n/**\n * Import first OAuth2 Client\n * @param {OAuth2ClientExportInterface} importData import data\n * @param {OAuth2ClientImportOptions} options import options\n */\nexport async function importFirstOAuth2Client(\n importData: OAuth2ClientExportInterface,\n options: OAuth2ClientImportOptions = { deps: true }\n) {\n let response = null;\n const errors = [];\n const imported = [];\n for (const id of Object.keys(importData.application)) {\n try {\n const clientData = importData.application[id];\n delete clientData._provider;\n delete clientData._rev;\n if (options.deps) {\n await importOAuth2ClientDependencies(clientData, importData);\n }\n response = await putOAuth2Client(id, clientData);\n imported.push(id);\n } catch (error) {\n errors.push(error);\n }\n break;\n }\n if (errors.length) {\n const errorMessages = errors.map((error) => error.message).join('\\n');\n throw new Error(`Import error:\\n${errorMessages}`);\n }\n if (0 === imported.length) {\n throw new Error(`Import error:\\nNo clients found in import data!`);\n }\n return response;\n}\n\n/**\n * Import OAuth2 Clients\n * @param {OAuth2ClientExportInterface} importData import data\n * @param {OAuth2ClientImportOptions} options import options\n * @returns {Promise<unknown[]>} array of imported oauth2 clients\n */\nexport async function importOAuth2Clients(\n importData: OAuth2ClientExportInterface,\n options: OAuth2ClientImportOptions = { deps: true }\n): Promise<unknown[]> {\n const response = [];\n const errors = [];\n const imported = [];\n for (const id of Object.keys(importData.application)) {\n try {\n const clientData = importData.application[id];\n delete clientData._provider;\n delete clientData._rev;\n if (options.deps) {\n await importOAuth2ClientDependencies(clientData, importData);\n }\n response.push(await putOAuth2Client(id, clientData));\n imported.push(id);\n } catch (error) {\n errors.push(error);\n }\n }\n if (errors.length) {\n const errorMessages = errors.map((error) => error.message).join('\\n');\n throw new Error(`Import error:\\n${errorMessages}`);\n }\n if (0 === imported.length) {\n throw new Error(`Import error:\\nNo clients found in import data!`);\n }\n return response;\n}\n"],"mappings":"SACEA,eAAe,IAAIC,gBAAgB,EACnCC,gBAAgB,IAAIC,iBAAiB,EACrCC,eAAe,IAAIC,gBAAgB,EACnCC,kBAAkB,IAAIC,mBAAmB;AAAA,SAIlCC,WAAW;AAAA,SACXC,YAAY,EAAEC,YAAY;AAAA,SAC1BC,wBAAwB;AAAA,SACxBC,iBAAiB;AAAA,OACnB,KAAKC,KAAK;AAAA,SACRC,SAAS,EAAEC,SAAS;AAE7B;AACA;AACA;AAYA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA,SAASC,gCAAgCA,CAAA,EAAgC;EACvE,OAAO;IACLC,IAAI,EAAET,WAAW,CAAC,CAAC;IACnBU,MAAM,EAAE,CAAC,CAAC;IACVC,WAAW,EAAE,CAAC;EAChB,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA,OAAO,eAAejB,gBAAgBA,CAAA,EAAG;EACvC,MAAMkB,OAAO,GAAG,CAAC,MAAMjB,iBAAiB,CAAC,CAAC,EAAEkB,MAAM;EAClD,OAAOD,OAAO;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAepB,eAAeA,CAACsB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C,UAAU,EAAE0C,UAAU,CAAC;MAC9D;MACAzC,QAAQ,CAACU,IAAI,CAAC,MAAM9B,eAAe,CAACgE,EAAE,EAAE7C,UAAU,CAAC,CAAC;MACpD4C,QAAQ,CAACjC,IAAI,CAACkC,EAAE,CAAC;IACnB,CAAC,CAAC,OAAO3C,KAAK,EAAE;MACd4B,MAAM,CAACnB,IAAI,CAACT,KAAK,CAAC;IACpB;EACF;EACA,IAAI4B,MAAM,CAACK,MAAM,EAAE;IACjB,MAAMC,aAAa,GAAGN,MAAM,CAACO,GAAG,CAAEnC,KAAK,IAAKA,KAAK,CAACM,OAAO,CAAC,CAAC8B,IAAI,CAAC,IAAI,CAAC;IACrE,MAAM,IAAIC,KAAK,CAAE,kBAAiBH,aAAc,EAAC,CAAC;EACpD;EACA,IAAI,CAAC,KAAKQ,QAAQ,CAACT,MAAM,EAAE;IACzB,MAAM,IAAII,KAAK,CAAE,iDAAgD,CAAC;EACpE;EACA,OAAOtC,QAAQ;AACjB"}
@@ -29,9 +29,9 @@
29
29
  * Note: FRODO_DEBUG=1 is optional and enables debug logging for some output
30
30
  * in case things don't function as expected
31
31
  */
32
- import { OAuth2Client } from '../index';
33
- import { autoSetupPolly } from '../utils/AutoSetupPolly';
34
- import { cloneDeep } from './utils/OpsUtils';
32
+ import { OAuth2Client } from "../index.js";
33
+ import { autoSetupPolly } from "../utils/AutoSetupPolly.js";
34
+ import { cloneDeep } from "./utils/OpsUtils.js";
35
35
  autoSetupPolly();
36
36
  async function stageOAuth2Client(client, create = true) {
37
37
  // delete if exists, then create