@rockcarver/frodo-lib 1.0.0 → 2.0.0-2

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 (415) hide show
  1. package/CHANGELOG.md +6 -6
  2. package/cjs/api/AgentApi.js +91 -37
  3. package/cjs/api/AgentApi.js.map +1 -1
  4. package/cjs/api/AgentApi.test.js.map +1 -1
  5. package/cjs/api/ApiTypes.js.map +1 -1
  6. package/cjs/api/AuthenticateApi.js +18 -11
  7. package/cjs/api/AuthenticateApi.js.map +1 -1
  8. package/cjs/api/AuthenticateApi.test.js.map +1 -1
  9. package/cjs/api/BaseApi.js +50 -26
  10. package/cjs/api/BaseApi.js.map +1 -1
  11. package/cjs/api/CirclesOfTrustApi.js +47 -23
  12. package/cjs/api/CirclesOfTrustApi.js.map +1 -1
  13. package/cjs/api/IdmConfigApi.js +54 -21
  14. package/cjs/api/IdmConfigApi.js.map +1 -1
  15. package/cjs/api/IdmSystemApi.js +9 -6
  16. package/cjs/api/IdmSystemApi.js.map +1 -1
  17. package/cjs/api/ManagedObjectApi.js +49 -27
  18. package/cjs/api/ManagedObjectApi.js.map +1 -1
  19. package/cjs/api/NodeApi.js +71 -32
  20. package/cjs/api/NodeApi.js.map +1 -1
  21. package/cjs/api/NodeApi.test.js.map +1 -1
  22. package/cjs/api/OAuth2ClientApi.js +43 -20
  23. package/cjs/api/OAuth2ClientApi.js.map +1 -1
  24. package/cjs/api/OAuth2OIDCApi.js +74 -27
  25. package/cjs/api/OAuth2OIDCApi.js.map +1 -1
  26. package/cjs/api/OAuth2OIDCApi.test.js.map +1 -1
  27. package/cjs/api/OAuth2ProviderApi.js +10 -9
  28. package/cjs/api/OAuth2ProviderApi.js.map +1 -1
  29. package/cjs/api/PoliciesApi.js +54 -22
  30. package/cjs/api/PoliciesApi.js.map +1 -1
  31. package/cjs/api/PoliciesApi.test.js.map +1 -1
  32. package/cjs/api/PolicySetApi.js +54 -23
  33. package/cjs/api/PolicySetApi.js.map +1 -1
  34. package/cjs/api/PolicySetApi.test.js.map +1 -1
  35. package/cjs/api/RealmApi.js +73 -29
  36. package/cjs/api/RealmApi.js.map +1 -1
  37. package/cjs/api/ResourceTypesApi.js +67 -28
  38. package/cjs/api/ResourceTypesApi.js.map +1 -1
  39. package/cjs/api/ResourceTypesApi.test.js.map +1 -1
  40. package/cjs/api/Saml2Api.js +90 -122
  41. package/cjs/api/Saml2Api.js.map +1 -1
  42. package/cjs/api/ScriptApi.js +54 -23
  43. package/cjs/api/ScriptApi.js.map +1 -1
  44. package/cjs/api/ServerInfoApi.js +23 -10
  45. package/cjs/api/ServerInfoApi.js.map +1 -1
  46. package/cjs/api/ServiceApi.js +91 -42
  47. package/cjs/api/ServiceApi.js.map +1 -1
  48. package/cjs/api/SocialIdentityProvidersApi.js +70 -31
  49. package/cjs/api/SocialIdentityProvidersApi.js.map +1 -1
  50. package/cjs/api/TreeApi.js +43 -20
  51. package/cjs/api/TreeApi.js.map +1 -1
  52. package/cjs/api/TreeApi.test.js.map +1 -1
  53. package/cjs/api/cloud/EnvInfoApi.js +10 -6
  54. package/cjs/api/cloud/EnvInfoApi.js.map +1 -1
  55. package/cjs/api/cloud/FeatureApi.js +9 -6
  56. package/cjs/api/cloud/FeatureApi.js.map +1 -1
  57. package/cjs/api/cloud/LogApi.js +48 -18
  58. package/cjs/api/cloud/LogApi.js.map +1 -1
  59. package/cjs/api/cloud/SecretsApi.js +109 -35
  60. package/cjs/api/cloud/SecretsApi.js.map +1 -1
  61. package/cjs/api/cloud/SecretsApi.test.js.map +1 -1
  62. package/cjs/api/cloud/StartupApi.js +21 -10
  63. package/cjs/api/cloud/StartupApi.js.map +1 -1
  64. package/cjs/api/cloud/StartupApi.test.js.map +1 -1
  65. package/cjs/api/cloud/VariablesApi.js +52 -20
  66. package/cjs/api/cloud/VariablesApi.js.map +1 -1
  67. package/cjs/api/cloud/VariablesApi.test.js.map +1 -1
  68. package/cjs/api/utils/ApiUtils.js +2 -5
  69. package/cjs/api/utils/ApiUtils.js.map +1 -1
  70. package/cjs/api/utils/ApiUtils.test.js.map +1 -1
  71. package/cjs/index.js +13 -112
  72. package/cjs/index.js.map +1 -1
  73. package/cjs/lib/FrodoLib.js +142 -0
  74. package/cjs/lib/FrodoLib.js.map +1 -0
  75. package/cjs/ops/AdminOps.js +578 -90
  76. package/cjs/ops/AdminOps.js.map +1 -1
  77. package/cjs/ops/AgentOps.js +964 -118
  78. package/cjs/ops/AgentOps.js.map +1 -1
  79. package/cjs/ops/AgentOps.test.js.map +1 -1
  80. package/cjs/ops/AuthenticateOps.js +182 -87
  81. package/cjs/ops/AuthenticateOps.js.map +1 -1
  82. package/cjs/ops/AuthenticateOps.test.js.map +1 -1
  83. package/cjs/ops/CirclesOfTrustOps.js +360 -291
  84. package/cjs/ops/CirclesOfTrustOps.js.map +1 -1
  85. package/cjs/ops/ConnectionProfileOps.js +221 -139
  86. package/cjs/ops/ConnectionProfileOps.js.map +1 -1
  87. package/cjs/ops/ConnectionProfileOps.test.js.map +1 -1
  88. package/cjs/ops/EmailTemplateOps.js +84 -10
  89. package/cjs/ops/EmailTemplateOps.js.map +1 -1
  90. package/cjs/ops/EmailTemplateOps.test.js.map +1 -1
  91. package/cjs/ops/IdmOps.js +97 -81
  92. package/cjs/ops/IdmOps.js.map +1 -1
  93. package/cjs/ops/IdmOps.test.js.map +1 -1
  94. package/cjs/ops/IdpOps.js +275 -42
  95. package/cjs/ops/IdpOps.js.map +1 -1
  96. package/cjs/ops/IdpOps.test.js.map +1 -1
  97. package/cjs/ops/InfoOps.js +42 -27
  98. package/cjs/ops/InfoOps.js.map +1 -1
  99. package/cjs/ops/JoseOps.test.js.map +1 -1
  100. package/cjs/ops/JourneyOps.js +721 -126
  101. package/cjs/ops/JourneyOps.js.map +1 -1
  102. package/cjs/ops/JourneyOps.test.js.map +1 -1
  103. package/cjs/ops/ManagedObjectOps.js +79 -12
  104. package/cjs/ops/ManagedObjectOps.js.map +1 -1
  105. package/cjs/ops/NodeOps.js +127 -100
  106. package/cjs/ops/NodeOps.js.map +1 -1
  107. package/cjs/ops/OAuth2ClientOps.js +323 -65
  108. package/cjs/ops/OAuth2ClientOps.js.map +1 -1
  109. package/cjs/ops/OAuth2ClientOps.test.js.map +1 -1
  110. package/cjs/ops/OAuth2OidcOps.js +84 -0
  111. package/cjs/ops/OAuth2OidcOps.js.map +1 -0
  112. package/cjs/ops/OAuth2ProviderOps.js +20 -13
  113. package/cjs/ops/OAuth2ProviderOps.js.map +1 -1
  114. package/cjs/ops/OpsTypes.js.map +1 -1
  115. package/cjs/ops/OrganizationOps.js +67 -12
  116. package/cjs/ops/OrganizationOps.js.map +1 -1
  117. package/cjs/ops/PolicyOps.js +476 -136
  118. package/cjs/ops/PolicyOps.js.map +1 -1
  119. package/cjs/ops/PolicyOps.test.js.map +1 -1
  120. package/cjs/ops/PolicySetOps.js +402 -132
  121. package/cjs/ops/PolicySetOps.js.map +1 -1
  122. package/cjs/ops/PolicySetOps.test.js.map +1 -1
  123. package/cjs/ops/RealmOps.js +119 -84
  124. package/cjs/ops/RealmOps.js.map +1 -1
  125. package/cjs/ops/ResourceTypeOps.js +364 -95
  126. package/cjs/ops/ResourceTypeOps.js.map +1 -1
  127. package/cjs/ops/ResourceTypeOps.test.js.map +1 -1
  128. package/cjs/ops/Saml2Ops.js +407 -145
  129. package/cjs/ops/Saml2Ops.js.map +1 -1
  130. package/cjs/ops/Saml2Ops.test.js.map +1 -1
  131. package/cjs/ops/ScriptOps.js +256 -79
  132. package/cjs/ops/ScriptOps.js.map +1 -1
  133. package/cjs/ops/ScriptOps.test.js.map +1 -1
  134. package/cjs/ops/ServiceOps.js +331 -55
  135. package/cjs/ops/ServiceOps.js.map +1 -1
  136. package/cjs/ops/ThemeOps.js +363 -54
  137. package/cjs/ops/ThemeOps.js.map +1 -1
  138. package/cjs/ops/ThemeOps.test.js.map +1 -1
  139. package/cjs/ops/cloud/FeatureOps.js +57 -12
  140. package/cjs/ops/cloud/FeatureOps.js.map +1 -1
  141. package/cjs/ops/cloud/LogOps.js +126 -6
  142. package/cjs/ops/cloud/LogOps.js.map +1 -1
  143. package/cjs/ops/cloud/SecretsOps.js +230 -289
  144. package/cjs/ops/cloud/SecretsOps.js.map +1 -1
  145. package/cjs/ops/cloud/ServiceAccountOps.js +101 -18
  146. package/cjs/ops/cloud/ServiceAccountOps.js.map +1 -1
  147. package/cjs/ops/cloud/ServiceAccountOps.test.js.map +1 -1
  148. package/cjs/ops/cloud/StartupOps.js +64 -9
  149. package/cjs/ops/cloud/StartupOps.js.map +1 -1
  150. package/cjs/ops/cloud/VariablesOps.js +100 -175
  151. package/cjs/ops/cloud/VariablesOps.js.map +1 -1
  152. package/cjs/ops/utils/Console.js +9 -10
  153. package/cjs/ops/utils/Console.js.map +1 -1
  154. package/cjs/ops/utils/DataProtection.js +2 -2
  155. package/cjs/ops/utils/DataProtection.js.map +1 -1
  156. package/cjs/ops/utils/ExportImportUtils.js +144 -13
  157. package/cjs/ops/utils/ExportImportUtils.js.map +1 -1
  158. package/cjs/ops/utils/ExportImportUtils.test.js.map +1 -1
  159. package/cjs/ops/utils/OpsUtils.js +7 -5
  160. package/cjs/ops/utils/OpsUtils.js.map +1 -1
  161. package/cjs/ops/utils/OpsUtils.test.js.map +1 -1
  162. package/cjs/ops/utils/{ValidationUtils.js → ScriptValidationUtils.js} +1 -1
  163. package/cjs/ops/utils/ScriptValidationUtils.js.map +1 -0
  164. package/cjs/ops/utils/ScriptValidationUtils.test.js.map +1 -0
  165. package/cjs/ops/utils/Version.js +36 -6
  166. package/cjs/ops/utils/Version.js.map +1 -1
  167. package/cjs/ops/utils/Version.test.js.map +1 -1
  168. package/cjs/shared/State.js +453 -210
  169. package/cjs/shared/State.js.map +1 -1
  170. package/cjs/shared/State.test.js.map +1 -1
  171. package/cjs/utils/AutoSetupPolly.js +4 -1
  172. package/cjs/utils/AutoSetupPolly.js.map +1 -1
  173. package/esm/api/AgentApi.mjs +75 -27
  174. package/esm/api/AgentApi.test.mjs +319 -71
  175. package/esm/api/AuthenticateApi.mjs +15 -4
  176. package/esm/api/AuthenticateApi.test.mjs +27 -8
  177. package/esm/api/BaseApi.mjs +43 -19
  178. package/esm/api/CirclesOfTrustApi.mjs +39 -17
  179. package/esm/api/IdmConfigApi.mjs +44 -13
  180. package/esm/api/IdmSystemApi.mjs +7 -3
  181. package/esm/api/ManagedObjectApi.mjs +44 -20
  182. package/esm/api/NodeApi.mjs +59 -24
  183. package/esm/api/NodeApi.test.mjs +158 -40
  184. package/esm/api/OAuth2ClientApi.mjs +36 -15
  185. package/esm/api/OAuth2OIDCApi.mjs +69 -20
  186. package/esm/api/OAuth2OIDCApi.test.mjs +21 -3
  187. package/esm/api/OAuth2ProviderApi.mjs +8 -6
  188. package/esm/api/PoliciesApi.mjs +45 -16
  189. package/esm/api/PoliciesApi.test.mjs +63 -15
  190. package/esm/api/PolicySetApi.mjs +44 -16
  191. package/esm/api/PolicySetApi.test.mjs +48 -12
  192. package/esm/api/RealmApi.mjs +65 -24
  193. package/esm/api/ResourceTypesApi.mjs +56 -21
  194. package/esm/api/ResourceTypesApi.test.mjs +58 -14
  195. package/esm/api/Saml2Api.mjs +75 -89
  196. package/esm/api/ScriptApi.mjs +45 -17
  197. package/esm/api/ServerInfoApi.mjs +19 -6
  198. package/esm/api/ServiceApi.mjs +77 -26
  199. package/esm/api/SocialIdentityProvidersApi.mjs +58 -23
  200. package/esm/api/TreeApi.mjs +36 -15
  201. package/esm/api/TreeApi.test.mjs +129 -34
  202. package/esm/api/cloud/EnvInfoApi.mjs +8 -3
  203. package/esm/api/cloud/FeatureApi.mjs +7 -3
  204. package/esm/api/cloud/LogApi.mjs +38 -11
  205. package/esm/api/cloud/SecretsApi.mjs +89 -21
  206. package/esm/api/cloud/SecretsApi.test.mjs +193 -50
  207. package/esm/api/cloud/StartupApi.mjs +17 -6
  208. package/esm/api/cloud/StartupApi.test.mjs +28 -11
  209. package/esm/api/cloud/VariablesApi.mjs +43 -14
  210. package/esm/api/cloud/VariablesApi.test.mjs +124 -33
  211. package/esm/api/utils/ApiUtils.mjs +2 -4
  212. package/esm/api/utils/ApiUtils.test.mjs +14 -6
  213. package/esm/index.mjs +1 -60
  214. package/esm/lib/FrodoLib.mjs +128 -0
  215. package/esm/ops/AdminOps.mjs +500 -71
  216. package/esm/ops/AgentOps.mjs +781 -81
  217. package/esm/ops/AgentOps.test.mjs +296 -113
  218. package/esm/ops/AuthenticateOps.mjs +156 -64
  219. package/esm/ops/AuthenticateOps.test.mjs +7 -4
  220. package/esm/ops/CirclesOfTrustOps.mjs +294 -229
  221. package/esm/ops/ConnectionProfileOps.mjs +190 -123
  222. package/esm/ops/ConnectionProfileOps.test.mjs +25 -5
  223. package/esm/ops/EmailTemplateOps.mjs +66 -6
  224. package/esm/ops/EmailTemplateOps.test.mjs +32 -11
  225. package/esm/ops/IdmOps.mjs +60 -47
  226. package/esm/ops/IdmOps.test.mjs +54 -18
  227. package/esm/ops/IdpOps.mjs +227 -31
  228. package/esm/ops/IdpOps.test.mjs +57 -20
  229. package/esm/ops/InfoOps.mjs +36 -23
  230. package/esm/ops/JoseOps.test.mjs +8 -0
  231. package/esm/ops/JourneyOps.mjs +634 -96
  232. package/esm/ops/JourneyOps.test.mjs +73 -31
  233. package/esm/ops/ManagedObjectOps.mjs +66 -10
  234. package/esm/ops/NodeOps.mjs +108 -85
  235. package/esm/ops/OAuth2ClientOps.mjs +258 -42
  236. package/esm/ops/OAuth2ClientOps.test.mjs +80 -29
  237. package/esm/ops/OAuth2OidcOps.mjs +40 -0
  238. package/esm/ops/OAuth2ProviderOps.mjs +11 -8
  239. package/esm/ops/OrganizationOps.mjs +56 -8
  240. package/esm/ops/PolicyOps.mjs +379 -93
  241. package/esm/ops/PolicyOps.test.mjs +180 -65
  242. package/esm/ops/PolicySetOps.mjs +311 -88
  243. package/esm/ops/PolicySetOps.test.mjs +108 -39
  244. package/esm/ops/RealmOps.mjs +85 -65
  245. package/esm/ops/ResourceTypeOps.mjs +278 -61
  246. package/esm/ops/ResourceTypeOps.test.mjs +113 -27
  247. package/esm/ops/Saml2Ops.mjs +346 -106
  248. package/esm/ops/Saml2Ops.test.mjs +117 -81
  249. package/esm/ops/ScriptOps.mjs +202 -56
  250. package/esm/ops/ScriptOps.test.mjs +64 -23
  251. package/esm/ops/ServiceOps.mjs +261 -27
  252. package/esm/ops/ThemeOps.mjs +300 -33
  253. package/esm/ops/ThemeOps.test.mjs +197 -47
  254. package/esm/ops/cloud/FeatureOps.mjs +45 -10
  255. package/esm/ops/cloud/LogOps.mjs +107 -4
  256. package/esm/ops/cloud/SecretsOps.mjs +123 -204
  257. package/esm/ops/cloud/ServiceAccountOps.mjs +85 -15
  258. package/esm/ops/cloud/ServiceAccountOps.test.mjs +16 -6
  259. package/esm/ops/cloud/StartupOps.mjs +49 -6
  260. package/esm/ops/cloud/VariablesOps.mjs +58 -120
  261. package/esm/ops/utils/Console.mjs +2 -1
  262. package/esm/ops/utils/DataProtection.mjs +2 -3
  263. package/esm/ops/utils/ExportImportUtils.mjs +129 -8
  264. package/esm/ops/utils/ExportImportUtils.test.mjs +15 -2
  265. package/esm/ops/utils/OpsUtils.mjs +4 -3
  266. package/esm/ops/utils/OpsUtils.test.mjs +21 -5
  267. package/esm/ops/utils/{ValidationUtils.mjs → ScriptValidationUtils.mjs} +1 -1
  268. package/esm/ops/utils/{ValidationUtils.test.mjs → ScriptValidationUtils.test.mjs} +2 -2
  269. package/esm/ops/utils/Version.mjs +29 -6
  270. package/esm/ops/utils/Version.test.mjs +4 -1
  271. package/esm/shared/State.mjs +457 -145
  272. package/esm/shared/State.test.mjs +8 -0
  273. package/esm/utils/AutoSetupPolly.mjs +4 -1
  274. package/package.json +1 -1
  275. package/types/api/AgentApi.d.ts +37 -8
  276. package/types/api/AgentApi.d.ts.map +1 -1
  277. package/types/api/ApiTypes.d.ts +20 -8
  278. package/types/api/ApiTypes.d.ts.map +1 -1
  279. package/types/api/AuthenticateApi.d.ts +13 -3
  280. package/types/api/AuthenticateApi.d.ts.map +1 -1
  281. package/types/api/BaseApi.d.ts +36 -7
  282. package/types/api/BaseApi.d.ts.map +1 -1
  283. package/types/api/CirclesOfTrustApi.d.ts +21 -7
  284. package/types/api/CirclesOfTrustApi.d.ts.map +1 -1
  285. package/types/api/IdmConfigApi.d.ts +28 -13
  286. package/types/api/IdmConfigApi.d.ts.map +1 -1
  287. package/types/api/IdmSystemApi.d.ts +4 -1
  288. package/types/api/IdmSystemApi.d.ts.map +1 -1
  289. package/types/api/ManagedObjectApi.d.ts +25 -10
  290. package/types/api/ManagedObjectApi.d.ts.map +1 -1
  291. package/types/api/NodeApi.d.ts +31 -9
  292. package/types/api/NodeApi.d.ts.map +1 -1
  293. package/types/api/OAuth2ClientApi.d.ts +18 -5
  294. package/types/api/OAuth2ClientApi.d.ts.map +1 -1
  295. package/types/api/OAuth2OIDCApi.d.ts +45 -11
  296. package/types/api/OAuth2OIDCApi.d.ts.map +1 -1
  297. package/types/api/OAuth2ProviderApi.d.ts +4 -1
  298. package/types/api/OAuth2ProviderApi.d.ts.map +1 -1
  299. package/types/api/PoliciesApi.d.ts +21 -5
  300. package/types/api/PoliciesApi.d.ts.map +1 -1
  301. package/types/api/PolicySetApi.d.ts +20 -5
  302. package/types/api/PolicySetApi.d.ts.map +1 -1
  303. package/types/api/RealmApi.d.ts +26 -10
  304. package/types/api/RealmApi.d.ts.map +1 -1
  305. package/types/api/ResourceTypesApi.d.ts +27 -8
  306. package/types/api/ResourceTypesApi.d.ts.map +1 -1
  307. package/types/api/Saml2Api.d.ts +39 -32
  308. package/types/api/Saml2Api.d.ts.map +1 -1
  309. package/types/api/ScriptApi.d.ts +21 -5
  310. package/types/api/ScriptApi.d.ts.map +1 -1
  311. package/types/api/ServerInfoApi.d.ts +9 -2
  312. package/types/api/ServerInfoApi.d.ts.map +1 -1
  313. package/types/api/ServiceApi.d.ts +41 -7
  314. package/types/api/ServiceApi.d.ts.map +1 -1
  315. package/types/api/SocialIdentityProvidersApi.d.ts +30 -8
  316. package/types/api/SocialIdentityProvidersApi.d.ts.map +1 -1
  317. package/types/api/TreeApi.d.ts +18 -4
  318. package/types/api/TreeApi.d.ts.map +1 -1
  319. package/types/api/cloud/EnvInfoApi.d.ts +4 -1
  320. package/types/api/cloud/EnvInfoApi.d.ts.map +1 -1
  321. package/types/api/cloud/FeatureApi.d.ts +4 -1
  322. package/types/api/cloud/FeatureApi.d.ts.map +1 -1
  323. package/types/api/cloud/LogApi.d.ts +24 -6
  324. package/types/api/cloud/LogApi.d.ts.map +1 -1
  325. package/types/api/cloud/SecretsApi.d.ts +50 -10
  326. package/types/api/cloud/SecretsApi.d.ts.map +1 -1
  327. package/types/api/cloud/StartupApi.d.ts +7 -2
  328. package/types/api/cloud/StartupApi.d.ts.map +1 -1
  329. package/types/api/cloud/VariablesApi.d.ts +23 -5
  330. package/types/api/cloud/VariablesApi.d.ts.map +1 -1
  331. package/types/api/utils/ApiUtils.d.ts +3 -2
  332. package/types/api/utils/ApiUtils.d.ts.map +1 -1
  333. package/types/index.d.ts +1 -48
  334. package/types/index.d.ts.map +1 -1
  335. package/types/lib/FrodoLib.d.ts +99 -0
  336. package/types/lib/FrodoLib.d.ts.map +1 -0
  337. package/types/ops/AdminOps.d.ts +71 -12
  338. package/types/ops/AdminOps.d.ts.map +1 -1
  339. package/types/ops/AgentOps.d.ts +350 -36
  340. package/types/ops/AgentOps.d.ts.map +1 -1
  341. package/types/ops/AuthenticateOps.d.ts +27 -4
  342. package/types/ops/AuthenticateOps.d.ts.map +1 -1
  343. package/types/ops/CirclesOfTrustOps.d.ts +88 -24
  344. package/types/ops/CirclesOfTrustOps.d.ts.map +1 -1
  345. package/types/ops/ConnectionProfileOps.d.ts +78 -18
  346. package/types/ops/ConnectionProfileOps.d.ts.map +1 -1
  347. package/types/ops/EmailTemplateOps.d.ts +36 -3
  348. package/types/ops/EmailTemplateOps.d.ts.map +1 -1
  349. package/types/ops/IdmOps.d.ts +28 -40
  350. package/types/ops/IdmOps.d.ts.map +1 -1
  351. package/types/ops/IdpOps.d.ts +88 -10
  352. package/types/ops/IdpOps.d.ts.map +1 -1
  353. package/types/ops/InfoOps.d.ts +12 -1
  354. package/types/ops/InfoOps.d.ts.map +1 -1
  355. package/types/ops/JourneyOps.d.ts +237 -34
  356. package/types/ops/JourneyOps.d.ts.map +1 -1
  357. package/types/ops/ManagedObjectOps.d.ts +37 -8
  358. package/types/ops/ManagedObjectOps.d.ts.map +1 -1
  359. package/types/ops/NodeOps.d.ts +61 -6
  360. package/types/ops/NodeOps.d.ts.map +1 -1
  361. package/types/ops/OAuth2ClientOps.d.ts +104 -10
  362. package/types/ops/OAuth2ClientOps.d.ts.map +1 -1
  363. package/types/ops/OAuth2OidcOps.d.ts +11 -0
  364. package/types/ops/OAuth2OidcOps.d.ts.map +1 -0
  365. package/types/ops/OAuth2ProviderOps.d.ts +8 -5
  366. package/types/ops/OAuth2ProviderOps.d.ts.map +1 -1
  367. package/types/ops/OpsTypes.d.ts +12 -1
  368. package/types/ops/OpsTypes.d.ts.map +1 -1
  369. package/types/ops/OrganizationOps.d.ts +24 -3
  370. package/types/ops/OrganizationOps.d.ts.map +1 -1
  371. package/types/ops/PolicyOps.d.ts +103 -28
  372. package/types/ops/PolicyOps.d.ts.map +1 -1
  373. package/types/ops/PolicySetOps.d.ts +76 -30
  374. package/types/ops/PolicySetOps.d.ts.map +1 -1
  375. package/types/ops/RealmOps.d.ts +34 -14
  376. package/types/ops/RealmOps.d.ts.map +1 -1
  377. package/types/ops/ResourceTypeOps.d.ts +116 -29
  378. package/types/ops/ResourceTypeOps.d.ts.map +1 -1
  379. package/types/ops/Saml2Ops.d.ts +124 -41
  380. package/types/ops/Saml2Ops.d.ts.map +1 -1
  381. package/types/ops/ScriptOps.d.ts +88 -23
  382. package/types/ops/ScriptOps.d.ts.map +1 -1
  383. package/types/ops/ServiceOps.d.ts +95 -8
  384. package/types/ops/ServiceOps.d.ts.map +1 -1
  385. package/types/ops/ThemeOps.d.ts +113 -9
  386. package/types/ops/ThemeOps.d.ts.map +1 -1
  387. package/types/ops/cloud/FeatureOps.d.ts +23 -2
  388. package/types/ops/cloud/FeatureOps.d.ts.map +1 -1
  389. package/types/ops/cloud/LogOps.d.ts +61 -3
  390. package/types/ops/cloud/LogOps.d.ts.map +1 -1
  391. package/types/ops/cloud/SecretsOps.d.ts +77 -63
  392. package/types/ops/cloud/SecretsOps.d.ts.map +1 -1
  393. package/types/ops/cloud/ServiceAccountOps.d.ts +48 -3
  394. package/types/ops/cloud/ServiceAccountOps.d.ts.map +1 -1
  395. package/types/ops/cloud/StartupOps.d.ts +25 -2
  396. package/types/ops/cloud/StartupOps.d.ts.map +1 -1
  397. package/types/ops/cloud/VariablesOps.d.ts +39 -39
  398. package/types/ops/cloud/VariablesOps.d.ts.map +1 -1
  399. package/types/ops/utils/Console.d.ts.map +1 -1
  400. package/types/ops/utils/DataProtection.d.ts +1 -1
  401. package/types/ops/utils/DataProtection.d.ts.map +1 -1
  402. package/types/ops/utils/ExportImportUtils.d.ts +72 -11
  403. package/types/ops/utils/ExportImportUtils.d.ts.map +1 -1
  404. package/types/ops/utils/OpsUtils.d.ts +4 -1
  405. package/types/ops/utils/OpsUtils.d.ts.map +1 -1
  406. package/types/ops/utils/ScriptValidationUtils.d.ts.map +1 -0
  407. package/types/ops/utils/Version.d.ts +20 -2
  408. package/types/ops/utils/Version.d.ts.map +1 -1
  409. package/types/shared/State.d.ts +80 -177
  410. package/types/shared/State.d.ts.map +1 -1
  411. package/types/utils/AutoSetupPolly.d.ts.map +1 -1
  412. package/cjs/ops/utils/ValidationUtils.js.map +0 -1
  413. package/cjs/ops/utils/ValidationUtils.test.js.map +0 -1
  414. package/types/ops/utils/ValidationUtils.d.ts.map +0 -1
  415. /package/types/ops/utils/{ValidationUtils.d.ts → ScriptValidationUtils.d.ts} +0 -0
@@ -4,18 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.addNewServiceAccount = addNewServiceAccount;
7
+ exports.default = void 0;
7
8
  exports.deleteConnectionProfile = deleteConnectionProfile;
8
- exports.describeConnectionProfile = describeConnectionProfile;
9
9
  exports.getConnectionProfile = getConnectionProfile;
10
10
  exports.getConnectionProfileByHost = getConnectionProfileByHost;
11
11
  exports.getConnectionProfilesPath = getConnectionProfilesPath;
12
12
  exports.initConnectionProfiles = initConnectionProfiles;
13
- exports.listConnectionProfiles = listConnectionProfiles;
14
13
  exports.saveConnectionProfile = saveConnectionProfile;
15
14
  var _fs = _interopRequireDefault(require("fs"));
16
15
  var _os = _interopRequireDefault(require("os"));
17
16
  var _path = _interopRequireDefault(require("path"));
18
- var state = _interopRequireWildcard(require("../shared/State"));
19
17
  var _DataProtection = _interopRequireDefault(require("./utils/DataProtection"));
20
18
  var _Console = require("./utils/Console");
21
19
  var _StaticStorage = require("../storage/StaticStorage");
@@ -23,17 +21,125 @@ var _JoseOps = require("./JoseOps");
23
21
  var _ServiceAccountOps = require("./cloud/ServiceAccountOps");
24
22
  var _ExportImportUtils = require("./utils/ExportImportUtils");
25
23
  var _OpsUtils = require("./utils/OpsUtils");
26
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
28
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
30
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
31
25
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
32
26
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
33
27
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
34
28
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
35
29
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
36
- var crypto = new _DataProtection.default();
30
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
31
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
32
+ class ConnectionProfileOps {
33
+ constructor(state) {
34
+ this.state = state;
35
+ }
36
+
37
+ /**
38
+ * Get connection profiles file name
39
+ * @returns {string} connection profiles file name
40
+ */
41
+ getConnectionProfilesPath() {
42
+ return getConnectionProfilesPath({
43
+ state: this.state
44
+ });
45
+ }
46
+
47
+ /**
48
+ * Find connection profiles
49
+ * @param {ConnectionsFileInterface} connectionProfiles connection profile object
50
+ * @param {string} host host url or unique substring
51
+ * @returns {SecureConnectionProfileInterface[]} Array of connection profiles
52
+ */
53
+ findConnectionProfiles(connectionProfiles, host) {
54
+ return findConnectionProfiles({
55
+ connectionProfiles,
56
+ host
57
+ });
58
+ }
59
+
60
+ /**
61
+ * Initialize connection profiles
62
+ *
63
+ * This method is called from app.ts and runs before any of the message handlers are registered.
64
+ * Therefore none of the Console message functions will produce any output.
65
+ */
66
+ initConnectionProfiles() {
67
+ var _this = this;
68
+ return _asyncToGenerator(function* () {
69
+ initConnectionProfiles({
70
+ state: _this.state
71
+ });
72
+ })();
73
+ }
74
+
75
+ /**
76
+ * Get connection profile by host
77
+ * @param {String} host host tenant host url or unique substring
78
+ * @returns {Object} connection profile or null
79
+ */
80
+ getConnectionProfileByHost(host) {
81
+ var _this2 = this;
82
+ return _asyncToGenerator(function* () {
83
+ return getConnectionProfileByHost({
84
+ host,
85
+ state: _this2.state
86
+ });
87
+ })();
88
+ }
89
+
90
+ /**
91
+ * Get connection profile
92
+ * @returns {Object} connection profile or null
93
+ */
94
+ getConnectionProfile() {
95
+ var _this3 = this;
96
+ return _asyncToGenerator(function* () {
97
+ return getConnectionProfile({
98
+ state: _this3.state
99
+ });
100
+ })();
101
+ }
102
+
103
+ /**
104
+ * Save connection profile
105
+ * @param {string} host host url for new profiles or unique substring for existing profiles
106
+ * @returns {Promise<boolean>} true if the operation succeeded, false otherwise
107
+ */
108
+ saveConnectionProfile(host) {
109
+ var _this4 = this;
110
+ return _asyncToGenerator(function* () {
111
+ return saveConnectionProfile({
112
+ host,
113
+ state: _this4.state
114
+ });
115
+ })();
116
+ }
117
+
118
+ /**
119
+ * Delete connection profile
120
+ * @param {string} host host tenant host url or unique substring
121
+ */
122
+ deleteConnectionProfile(host) {
123
+ deleteConnectionProfile({
124
+ host,
125
+ state: this.state
126
+ });
127
+ }
128
+
129
+ /**
130
+ * Create a new service account using auto-generated parameters
131
+ * @returns {Promise<IdObjectSkeletonInterface>} A promise resolving to a service account object
132
+ */
133
+ addNewServiceAccount() {
134
+ var _this5 = this;
135
+ return _asyncToGenerator(function* () {
136
+ return addNewServiceAccount({
137
+ state: _this5.state
138
+ });
139
+ })();
140
+ }
141
+ }
142
+ exports.default = ConnectionProfileOps;
37
143
  var fileOptions = {
38
144
  indentation: 4
39
145
  };
@@ -42,9 +148,13 @@ var newProfileFilename = 'Connections.json';
42
148
 
43
149
  /**
44
150
  * Get connection profiles file name
151
+ * @param {State} state library state
45
152
  * @returns {String} connection profiles file name
46
153
  */
47
- function getConnectionProfilesPath() {
154
+ function getConnectionProfilesPath(_ref) {
155
+ var {
156
+ state
157
+ } = _ref;
48
158
  return state.getConnectionProfilesPath() || process.env[_StaticStorage.FRODO_CONNECTION_PROFILES_PATH_KEY] || "".concat(_os.default.homedir(), "/.frodo/").concat(newProfileFilename);
49
159
  }
50
160
 
@@ -52,9 +162,14 @@ function getConnectionProfilesPath() {
52
162
  * Find connection profiles
53
163
  * @param {ConnectionsFileInterface} connectionProfiles connection profile object
54
164
  * @param {string} host host url or unique substring
165
+ * @param {State} state library state
55
166
  * @returns {SecureConnectionProfileInterface[]} Array of connection profiles
56
167
  */
57
- function findConnectionProfiles(connectionProfiles, host) {
168
+ function findConnectionProfiles(_ref2) {
169
+ var {
170
+ connectionProfiles,
171
+ host
172
+ } = _ref2;
58
173
  var profiles = [];
59
174
  for (var tenant in connectionProfiles) {
60
175
  (0, _Console.debugMessage)("ConnectionProfileOps.findConnectionProfiles: tenant=".concat(tenant));
@@ -68,39 +183,6 @@ function findConnectionProfiles(connectionProfiles, host) {
68
183
  return profiles;
69
184
  }
70
185
 
71
- /**
72
- * List connection profiles
73
- * @param {boolean} long Long list format with details
74
- */
75
- function listConnectionProfiles() {
76
- var long = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
77
- var filename = getConnectionProfilesPath();
78
- try {
79
- var data = _fs.default.readFileSync(filename, 'utf8');
80
- var connectionsData = JSON.parse(data);
81
- if (Object.keys(connectionsData).length < 1) {
82
- (0, _Console.printMessage)("No connections defined yet in ".concat(filename), 'info');
83
- } else {
84
- if (long) {
85
- var table = (0, _Console.createTable)(['Host', 'Service Account', 'Username', 'Log API Key']);
86
- Object.keys(connectionsData).forEach(c => {
87
- table.push([c, connectionsData[c].svcacctName || connectionsData[c].svcacctId, connectionsData[c].username, connectionsData[c].logApiKey]);
88
- });
89
- (0, _Console.printMessage)(table.toString(), 'data');
90
- } else {
91
- Object.keys(connectionsData).forEach(c => {
92
- (0, _Console.printMessage)("".concat(c), 'data');
93
- });
94
- // getUniqueNames(5, Object.keys(connectionsData));
95
- }
96
-
97
- (0, _Console.printMessage)('Any unique substring of a saved host can be used as the value for host parameter in all commands', 'info');
98
- }
99
- } catch (e) {
100
- (0, _Console.printMessage)("No connections found in ".concat(filename, " (").concat(e.message, ")"), 'error');
101
- }
102
- }
103
-
104
186
  /**
105
187
  * Migrate from .frodorc to Connections.json
106
188
  */
@@ -126,19 +208,27 @@ function migrateFromLegacyProfile() {
126
208
  *
127
209
  * This method is called from app.ts and runs before any of the message handlers are registered.
128
210
  * Therefore none of the Console message functions will produce any output.
211
+ * @param {State} state library state
129
212
  */
130
- function initConnectionProfiles() {
213
+ function initConnectionProfiles(_x) {
131
214
  return _initConnectionProfiles.apply(this, arguments);
132
215
  }
133
216
  /**
134
217
  * Get connection profile by host
135
218
  * @param {String} host host tenant host url or unique substring
219
+ * @param {State} state library state
136
220
  * @returns {Object} connection profile or null
137
221
  */
138
222
  function _initConnectionProfiles() {
139
- _initConnectionProfiles = _asyncToGenerator(function* () {
223
+ _initConnectionProfiles = _asyncToGenerator(function* (_ref3) {
224
+ var {
225
+ state
226
+ } = _ref3;
227
+ var dataProtection = new _DataProtection.default(state.getMasterKeyPath());
140
228
  // create connections.json file if it doesn't exist
141
- var filename = getConnectionProfilesPath();
229
+ var filename = getConnectionProfilesPath({
230
+ state
231
+ });
142
232
  var folderName = _path.default.dirname(filename);
143
233
  if (!_fs.default.existsSync(folderName)) {
144
234
  _fs.default.mkdirSync(folderName, {
@@ -157,17 +247,17 @@ function _initConnectionProfiles() {
157
247
  for (var conn of Object.keys(connectionsData)) {
158
248
  if (connectionsData[conn]['password']) {
159
249
  convert = true;
160
- connectionsData[conn].encodedPassword = yield crypto.encrypt(connectionsData[conn]['password']);
250
+ connectionsData[conn].encodedPassword = yield dataProtection.encrypt(connectionsData[conn]['password']);
161
251
  delete connectionsData[conn]['password'];
162
252
  }
163
253
  if (connectionsData[conn]['logApiSecret']) {
164
254
  convert = true;
165
- connectionsData[conn].encodedLogApiSecret = yield crypto.encrypt(connectionsData[conn]['logApiSecret']);
255
+ connectionsData[conn].encodedLogApiSecret = yield dataProtection.encrypt(connectionsData[conn]['logApiSecret']);
166
256
  delete connectionsData[conn]['logApiSecret'];
167
257
  }
168
258
  if (connectionsData[conn]['svcacctJwk']) {
169
259
  convert = true;
170
- connectionsData[conn].encodedSvcacctJwk = yield crypto.encrypt(connectionsData[conn]['svcacctJwk']);
260
+ connectionsData[conn].encodedSvcacctJwk = yield dataProtection.encrypt(connectionsData[conn]['svcacctJwk']);
171
261
  delete connectionsData[conn]['svcacctJwk'];
172
262
  }
173
263
  }
@@ -178,7 +268,7 @@ function _initConnectionProfiles() {
178
268
  });
179
269
  return _initConnectionProfiles.apply(this, arguments);
180
270
  }
181
- function getConnectionProfileByHost(_x) {
271
+ function getConnectionProfileByHost(_x2) {
182
272
  return _getConnectionProfileByHost.apply(this, arguments);
183
273
  }
184
274
  /**
@@ -186,11 +276,21 @@ function getConnectionProfileByHost(_x) {
186
276
  * @returns {Object} connection profile or null
187
277
  */
188
278
  function _getConnectionProfileByHost() {
189
- _getConnectionProfileByHost = _asyncToGenerator(function* (host) {
279
+ _getConnectionProfileByHost = _asyncToGenerator(function* (_ref4) {
280
+ var {
281
+ host,
282
+ state
283
+ } = _ref4;
190
284
  try {
191
- var filename = getConnectionProfilesPath();
285
+ var dataProtection = new _DataProtection.default(state.getMasterKeyPath());
286
+ var filename = getConnectionProfilesPath({
287
+ state
288
+ });
192
289
  var connectionsData = JSON.parse(_fs.default.readFileSync(filename, 'utf8'));
193
- var profiles = findConnectionProfiles(connectionsData, host);
290
+ var profiles = findConnectionProfiles({
291
+ connectionProfiles: connectionsData,
292
+ host
293
+ });
194
294
  if (profiles.length == 0) {
195
295
  (0, _Console.printMessage)("Profile for ".concat(host, " not found. Please specify credentials on command line"), 'error');
196
296
  return null;
@@ -206,14 +306,14 @@ function _getConnectionProfileByHost() {
206
306
  return {
207
307
  tenant: profiles[0].tenant,
208
308
  username: profiles[0].username ? profiles[0].username : null,
209
- password: profiles[0].encodedPassword ? yield crypto.decrypt(profiles[0].encodedPassword) : null,
309
+ password: profiles[0].encodedPassword ? yield dataProtection.decrypt(profiles[0].encodedPassword) : null,
210
310
  logApiKey: profiles[0].logApiKey ? profiles[0].logApiKey : null,
211
- logApiSecret: profiles[0].encodedLogApiSecret ? yield crypto.decrypt(profiles[0].encodedLogApiSecret) : null,
311
+ logApiSecret: profiles[0].encodedLogApiSecret ? yield dataProtection.decrypt(profiles[0].encodedLogApiSecret) : null,
212
312
  authenticationService: profiles[0].authenticationService ? profiles[0].authenticationService : null,
213
313
  authenticationHeaderOverrides: profiles[0].authenticationHeaderOverrides ? profiles[0].authenticationHeaderOverrides : {},
214
314
  svcacctName: profiles[0].svcacctName ? profiles[0].svcacctName : null,
215
315
  svcacctId: profiles[0].svcacctId ? profiles[0].svcacctId : null,
216
- svcacctJwk: profiles[0].encodedSvcacctJwk ? yield crypto.decrypt(profiles[0].encodedSvcacctJwk) : null
316
+ svcacctJwk: profiles[0].encodedSvcacctJwk ? yield dataProtection.decrypt(profiles[0].encodedSvcacctJwk) : null
217
317
  };
218
318
  } catch (e) {
219
319
  (0, _Console.printMessage)("Can not read saved connection info, please specify credentials on command line: ".concat(e), 'error');
@@ -222,7 +322,7 @@ function _getConnectionProfileByHost() {
222
322
  });
223
323
  return _getConnectionProfileByHost.apply(this, arguments);
224
324
  }
225
- function getConnectionProfile() {
325
+ function getConnectionProfile(_x3) {
226
326
  return _getConnectionProfile.apply(this, arguments);
227
327
  }
228
328
  /**
@@ -231,12 +331,18 @@ function getConnectionProfile() {
231
331
  * @returns {Promise<boolean>} true if the operation succeeded, false otherwise
232
332
  */
233
333
  function _getConnectionProfile() {
234
- _getConnectionProfile = _asyncToGenerator(function* () {
235
- return getConnectionProfileByHost(state.getHost());
334
+ _getConnectionProfile = _asyncToGenerator(function* (_ref5) {
335
+ var {
336
+ state
337
+ } = _ref5;
338
+ return getConnectionProfileByHost({
339
+ host: state.getHost(),
340
+ state
341
+ });
236
342
  });
237
343
  return _getConnectionProfile.apply(this, arguments);
238
344
  }
239
- function saveConnectionProfile(_x2) {
345
+ function saveConnectionProfile(_x4) {
240
346
  return _saveConnectionProfile.apply(this, arguments);
241
347
  }
242
348
  /**
@@ -244,9 +350,16 @@ function saveConnectionProfile(_x2) {
244
350
  * @param {String} host host tenant host url or unique substring
245
351
  */
246
352
  function _saveConnectionProfile() {
247
- _saveConnectionProfile = _asyncToGenerator(function* (host) {
353
+ _saveConnectionProfile = _asyncToGenerator(function* (_ref6) {
354
+ var {
355
+ host,
356
+ state
357
+ } = _ref6;
248
358
  (0, _Console.debugMessage)("ConnectionProfileOps.saveConnectionProfile: start");
249
- var filename = getConnectionProfilesPath();
359
+ var dataProtection = new _DataProtection.default(state.getMasterKeyPath());
360
+ var filename = getConnectionProfilesPath({
361
+ state
362
+ });
250
363
  (0, _Console.debugMessage)("Saving connection profile in ".concat(filename));
251
364
  var profiles = {};
252
365
  var profile = {
@@ -258,7 +371,10 @@ function _saveConnectionProfile() {
258
371
  profiles = JSON.parse(data);
259
372
 
260
373
  // find tenant
261
- var found = findConnectionProfiles(profiles, host);
374
+ var found = findConnectionProfiles({
375
+ connectionProfiles: profiles,
376
+ host
377
+ });
262
378
 
263
379
  // replace tenant in session with real tenant url if necessary
264
380
  if (found.length === 1) {
@@ -285,21 +401,27 @@ function _saveConnectionProfile() {
285
401
 
286
402
  // user account
287
403
  if (state.getUsername()) profile.username = state.getUsername();
288
- if (state.getPassword()) profile.encodedPassword = yield crypto.encrypt(state.getPassword());
404
+ if (state.getPassword()) profile.encodedPassword = yield dataProtection.encrypt(state.getPassword());
289
405
 
290
406
  // log API
291
407
  if (state.getLogApiKey()) profile.logApiKey = state.getLogApiKey();
292
- if (state.getLogApiSecret()) profile.encodedLogApiSecret = yield crypto.encrypt(state.getLogApiSecret());
408
+ if (state.getLogApiSecret()) profile.encodedLogApiSecret = yield dataProtection.encrypt(state.getLogApiSecret());
293
409
 
294
410
  // service account
295
411
  if (state.getServiceAccountId()) {
296
412
  profile.svcacctId = state.getServiceAccountId();
297
- profile.svcacctName = (yield (0, _ServiceAccountOps.getServiceAccount)(state.getServiceAccountId())).name;
413
+ profile.svcacctName = (yield (0, _ServiceAccountOps.getServiceAccount)({
414
+ serviceAccountId: state.getServiceAccountId(),
415
+ state
416
+ })).name;
298
417
  }
299
- if (state.getServiceAccountJwk()) profile.encodedSvcacctJwk = yield crypto.encrypt(state.getServiceAccountJwk());
418
+ if (state.getServiceAccountJwk()) profile.encodedSvcacctJwk = yield dataProtection.encrypt(state.getServiceAccountJwk());
300
419
  // update existing service account profile
301
420
  if (profile.svcacctId && !profile.svcacctName) {
302
- profile.svcacctName = (yield (0, _ServiceAccountOps.getServiceAccount)(profile.svcacctId)).name;
421
+ profile.svcacctName = (yield (0, _ServiceAccountOps.getServiceAccount)({
422
+ serviceAccountId: profile.svcacctId,
423
+ state
424
+ })).name;
303
425
  (0, _Console.debugMessage)("ConnectionProfileOps.saveConnectionProfile: added missing service account name");
304
426
  }
305
427
 
@@ -327,21 +449,35 @@ function _saveConnectionProfile() {
327
449
  }, {});
328
450
 
329
451
  // save profiles
330
- (0, _ExportImportUtils.saveJsonToFile)(orderedProfiles, filename, false);
452
+ (0, _ExportImportUtils.saveJsonToFile)({
453
+ data: orderedProfiles,
454
+ filename,
455
+ includeMeta: false,
456
+ state
457
+ });
331
458
  (0, _Console.verboseMessage)("Saved connection profile ".concat(state.getHost(), " in ").concat(filename));
332
459
  (0, _Console.debugMessage)("ConnectionProfileOps.saveConnectionProfile: end [true]");
333
460
  return true;
334
461
  });
335
462
  return _saveConnectionProfile.apply(this, arguments);
336
463
  }
337
- function deleteConnectionProfile(host) {
338
- var filename = getConnectionProfilesPath();
464
+ function deleteConnectionProfile(_ref7) {
465
+ var {
466
+ host,
467
+ state
468
+ } = _ref7;
469
+ var filename = getConnectionProfilesPath({
470
+ state
471
+ });
339
472
  var connectionsData = {};
340
473
  _fs.default.stat(filename, err => {
341
474
  if (err == null) {
342
475
  var data = _fs.default.readFileSync(filename, 'utf8');
343
476
  connectionsData = JSON.parse(data);
344
- var profiles = findConnectionProfiles(connectionsData, host);
477
+ var profiles = findConnectionProfiles({
478
+ connectionProfiles: connectionsData,
479
+ host
480
+ });
345
481
  if (profiles.length == 1) {
346
482
  delete connectionsData[profiles[0].tenant];
347
483
  _fs.default.writeFileSync(filename, JSON.stringify(connectionsData, null, 2));
@@ -366,79 +502,18 @@ function deleteConnectionProfile(host) {
366
502
  });
367
503
  }
368
504
 
369
- /**
370
- * Describe connection profile
371
- * @param {string} host Host URL or unique substring
372
- * @param {boolean} showSecrets Whether secrets should be shown in clear text or not
373
- */
374
- function describeConnectionProfile(_x3, _x4) {
375
- return _describeConnectionProfile.apply(this, arguments);
376
- }
377
505
  /**
378
506
  * Create a new service account using auto-generated parameters
379
507
  * @returns {Promise<IdObjectSkeletonInterface>} A promise resolving to a service account object
380
508
  */
381
- function _describeConnectionProfile() {
382
- _describeConnectionProfile = _asyncToGenerator(function* (host, showSecrets) {
383
- (0, _Console.debugMessage)("ConnectionProfileOps.describeConnectionProfile: start");
384
- var profile = yield getConnectionProfileByHost(host);
385
- if (profile) {
386
- (0, _Console.debugMessage)(profile);
387
- var present = '[present]';
388
- var jwk = profile.svcacctJwk;
389
- if (!showSecrets) {
390
- if (profile.password) profile.password = present;
391
- if (profile.logApiSecret) profile.logApiSecret = present;
392
- if (profile.svcacctJwk) profile['svcacctJwk'] = present;
393
- }
394
- if (!profile.username) {
395
- delete profile.username;
396
- delete profile.password;
397
- }
398
- if (!profile.logApiKey) {
399
- delete profile.logApiKey;
400
- delete profile.logApiSecret;
401
- }
402
- if (!profile.svcacctId) {
403
- delete profile.svcacctId;
404
- delete profile.svcacctJwk;
405
- delete profile.svcacctName;
406
- }
407
- if (showSecrets && jwk) {
408
- profile['svcacctJwk'] = 'see below';
409
- }
410
- if (!profile.authenticationService) {
411
- delete profile.authenticationService;
412
- }
413
- var keyMap = {
414
- tenant: 'Host',
415
- username: 'Username',
416
- password: 'Password',
417
- logApiKey: 'Log API Key',
418
- logApiSecret: 'Log API Secret',
419
- authenticationService: 'Authentication Service',
420
- authenticationHeaderOverrides: 'Authentication Header Overrides',
421
- svcacctName: 'Service Account Name',
422
- svcacctId: 'Service Account Id',
423
- svcacctJwk: 'Service Account JWK'
424
- };
425
- var table = (0, _Console.createObjectTable)(profile, keyMap);
426
- (0, _Console.printMessage)(table.toString(), 'data');
427
- if (showSecrets && jwk) {
428
- (0, _Console.printMessage)(jwk, 'data');
429
- }
430
- } else {
431
- (0, _Console.printMessage)("No connection profile ".concat(host, " found"));
432
- }
433
- (0, _Console.debugMessage)("ConnectionProfileOps.describeConnectionProfile: end");
434
- });
435
- return _describeConnectionProfile.apply(this, arguments);
436
- }
437
- function addNewServiceAccount() {
509
+ function addNewServiceAccount(_x5) {
438
510
  return _addNewServiceAccount.apply(this, arguments);
439
511
  }
440
512
  function _addNewServiceAccount() {
441
- _addNewServiceAccount = _asyncToGenerator(function* () {
513
+ _addNewServiceAccount = _asyncToGenerator(function* (_ref8) {
514
+ var {
515
+ state
516
+ } = _ref8;
442
517
  (0, _Console.debugMessage)("ConnectionProfileOps.addNewServiceAccount: start");
443
518
  var name = "Frodo-SA-".concat(new Date().getTime());
444
519
  (0, _Console.debugMessage)("ConnectionProfileOps.addNewServiceAccount: name=".concat(name, "..."));
@@ -447,7 +522,14 @@ function _addNewServiceAccount() {
447
522
  var jwkPrivate = yield (0, _JoseOps.createJwkRsa)();
448
523
  var jwkPublic = yield (0, _JoseOps.getJwkRsaPublic)(jwkPrivate);
449
524
  var jwks = (0, _JoseOps.createJwks)(jwkPublic);
450
- var sa = yield (0, _ServiceAccountOps.createServiceAccount)(name, description, 'Active', scope, jwks);
525
+ var sa = yield (0, _ServiceAccountOps.createServiceAccount)({
526
+ name,
527
+ description,
528
+ accountStatus: 'Active',
529
+ scopes: scope,
530
+ jwks,
531
+ state
532
+ });
451
533
  (0, _Console.debugMessage)("ConnectionProfileOps.addNewServiceAccount: id=".concat(sa._id));
452
534
  state.setServiceAccountId(sa._id);
453
535
  state.setServiceAccountJwk(jwkPrivate);