auth0-deploy-cli 8.22.0 → 8.23.1

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 (333) hide show
  1. package/.circleci/config.yml +57 -5
  2. package/CHANGELOG.md +41 -2
  3. package/README.md +1 -1
  4. package/eslint.config.js +131 -0
  5. package/lib/args.js +0 -1
  6. package/lib/commands/export.js +41 -49
  7. package/lib/commands/import.js +36 -43
  8. package/lib/commands/index.js +0 -1
  9. package/lib/configFactory.js +0 -1
  10. package/lib/context/defaults.d.ts +1 -0
  11. package/lib/context/defaults.js +57 -10
  12. package/lib/context/directory/handlers/actions.js +40 -39
  13. package/lib/context/directory/handlers/attackProtection.js +22 -34
  14. package/lib/context/directory/handlers/branding.js +12 -21
  15. package/lib/context/directory/handlers/clientGrants.js +52 -62
  16. package/lib/context/directory/handlers/clients.js +44 -57
  17. package/lib/context/directory/handlers/connectionProfiles.d.ts +1 -1
  18. package/lib/context/directory/handlers/connectionProfiles.js +20 -30
  19. package/lib/context/directory/handlers/connections.js +32 -41
  20. package/lib/context/directory/handlers/customDomains.js +9 -21
  21. package/lib/context/directory/handlers/databases.js +37 -35
  22. package/lib/context/directory/handlers/emailProvider.js +22 -36
  23. package/lib/context/directory/handlers/emailTemplates.js +20 -29
  24. package/lib/context/directory/handlers/flowVaultConnections.js +40 -49
  25. package/lib/context/directory/handlers/flows.js +38 -48
  26. package/lib/context/directory/handlers/forms.js +38 -48
  27. package/lib/context/directory/handlers/guardianFactorProviders.js +9 -21
  28. package/lib/context/directory/handlers/guardianFactorTemplates.js +9 -21
  29. package/lib/context/directory/handlers/guardianFactors.js +9 -21
  30. package/lib/context/directory/handlers/guardianPhoneFactorMessageTypes.js +8 -20
  31. package/lib/context/directory/handlers/guardianPhoneFactorSelectedProvider.js +8 -20
  32. package/lib/context/directory/handlers/guardianPolicies.js +8 -20
  33. package/lib/context/directory/handlers/hooks.js +24 -34
  34. package/lib/context/directory/handlers/index.js +4 -1
  35. package/lib/context/directory/handlers/logStreams.js +12 -24
  36. package/lib/context/directory/handlers/networkACLs.js +22 -34
  37. package/lib/context/directory/handlers/organizations.js +39 -44
  38. package/lib/context/directory/handlers/pages.js +31 -37
  39. package/lib/context/directory/handlers/phoneProvider.js +12 -24
  40. package/lib/context/directory/handlers/phoneTemplates.d.ts +6 -0
  41. package/lib/context/directory/handlers/phoneTemplates.js +39 -0
  42. package/lib/context/directory/handlers/prompts.js +58 -76
  43. package/lib/context/directory/handlers/resourceServers.d.ts +1 -1
  44. package/lib/context/directory/handlers/resourceServers.js +18 -30
  45. package/lib/context/directory/handlers/roles.js +21 -31
  46. package/lib/context/directory/handlers/rules.js +22 -32
  47. package/lib/context/directory/handlers/rulesConfigs.js +3 -15
  48. package/lib/context/directory/handlers/selfServiceProfiles.js +28 -40
  49. package/lib/context/directory/handlers/tenant.js +14 -34
  50. package/lib/context/directory/handlers/themes.js +9 -21
  51. package/lib/context/directory/handlers/tokenExchangeProfiles.d.ts +5 -0
  52. package/lib/context/directory/handlers/tokenExchangeProfiles.js +41 -0
  53. package/lib/context/directory/handlers/triggers.d.ts +1 -1
  54. package/lib/context/directory/handlers/triggers.js +16 -26
  55. package/lib/context/directory/handlers/userAttributeProfiles.d.ts +1 -1
  56. package/lib/context/directory/handlers/userAttributeProfiles.js +16 -26
  57. package/lib/context/directory/index.js +66 -80
  58. package/lib/context/index.js +7 -18
  59. package/lib/context/yaml/handlers/actions.js +39 -41
  60. package/lib/context/yaml/handlers/attackProtection.js +27 -41
  61. package/lib/context/yaml/handlers/branding.js +47 -69
  62. package/lib/context/yaml/handlers/clientGrants.js +26 -40
  63. package/lib/context/yaml/handlers/clients.js +69 -84
  64. package/lib/context/yaml/handlers/connectionProfiles.d.ts +1 -1
  65. package/lib/context/yaml/handlers/connectionProfiles.js +20 -34
  66. package/lib/context/yaml/handlers/connections.js +63 -67
  67. package/lib/context/yaml/handlers/customDomains.js +7 -19
  68. package/lib/context/yaml/handlers/databases.js +63 -65
  69. package/lib/context/yaml/handlers/emailProvider.js +22 -37
  70. package/lib/context/yaml/handlers/emailTemplates.js +28 -39
  71. package/lib/context/yaml/handlers/flowVaultConnections.js +37 -50
  72. package/lib/context/yaml/handlers/flows.js +55 -66
  73. package/lib/context/yaml/handlers/forms.js +55 -66
  74. package/lib/context/yaml/handlers/guardianFactorProviders.js +7 -19
  75. package/lib/context/yaml/handlers/guardianFactorTemplates.js +7 -19
  76. package/lib/context/yaml/handlers/guardianFactors.js +7 -19
  77. package/lib/context/yaml/handlers/guardianPhoneFactorMessageTypes.js +7 -19
  78. package/lib/context/yaml/handlers/guardianPhoneFactorSelectedProvider.js +7 -19
  79. package/lib/context/yaml/handlers/guardianPolicies.js +7 -19
  80. package/lib/context/yaml/handlers/hooks.js +34 -48
  81. package/lib/context/yaml/handlers/index.js +4 -1
  82. package/lib/context/yaml/handlers/logStreams.js +16 -30
  83. package/lib/context/yaml/handlers/networkACLs.js +25 -39
  84. package/lib/context/yaml/handlers/organizations.js +37 -46
  85. package/lib/context/yaml/handlers/pages.js +31 -39
  86. package/lib/context/yaml/handlers/phoneProvider.js +17 -31
  87. package/lib/context/yaml/handlers/phoneTemplates.d.ts +6 -0
  88. package/lib/context/yaml/handlers/phoneTemplates.js +25 -0
  89. package/lib/context/yaml/handlers/prompts.js +22 -47
  90. package/lib/context/yaml/handlers/resourceServers.d.ts +1 -1
  91. package/lib/context/yaml/handlers/resourceServers.js +21 -33
  92. package/lib/context/yaml/handlers/roles.js +19 -33
  93. package/lib/context/yaml/handlers/rules.js +28 -39
  94. package/lib/context/yaml/handlers/rulesConfigs.js +14 -28
  95. package/lib/context/yaml/handlers/selfServiceProfiles.js +29 -43
  96. package/lib/context/yaml/handlers/tenant.js +19 -41
  97. package/lib/context/yaml/handlers/themes.js +7 -19
  98. package/lib/context/yaml/handlers/tokenExchangeProfiles.d.ts +5 -0
  99. package/lib/context/yaml/handlers/tokenExchangeProfiles.js +27 -0
  100. package/lib/context/yaml/handlers/triggers.d.ts +1 -1
  101. package/lib/context/yaml/handlers/triggers.js +15 -29
  102. package/lib/context/yaml/handlers/userAttributeProfiles.d.ts +1 -1
  103. package/lib/context/yaml/handlers/userAttributeProfiles.js +7 -19
  104. package/lib/context/yaml/index.js +120 -128
  105. package/lib/index.d.ts +4 -96
  106. package/lib/index.js +24 -34
  107. package/lib/keywordPreservation.d.ts +1 -1
  108. package/lib/keywordPreservation.js +11 -6
  109. package/lib/logger.js +0 -1
  110. package/lib/readonly.js +3 -4
  111. package/lib/sessionDurationsToMinutes.js +0 -1
  112. package/lib/tools/auth0/client.js +108 -127
  113. package/lib/tools/auth0/handlers/actions.d.ts +8 -26
  114. package/lib/tools/auth0/handlers/actions.js +138 -149
  115. package/lib/tools/auth0/handlers/attackProtection.js +80 -92
  116. package/lib/tools/auth0/handlers/branding.js +75 -99
  117. package/lib/tools/auth0/handlers/clientGrants.d.ts +2 -9
  118. package/lib/tools/auth0/handlers/clientGrants.js +68 -73
  119. package/lib/tools/auth0/handlers/clients.d.ts +17 -16
  120. package/lib/tools/auth0/handlers/clients.js +120 -106
  121. package/lib/tools/auth0/handlers/connectionProfiles.d.ts +3 -1
  122. package/lib/tools/auth0/handlers/connectionProfiles.js +36 -32
  123. package/lib/tools/auth0/handlers/connections.d.ts +3 -1
  124. package/lib/tools/auth0/handlers/connections.js +130 -135
  125. package/lib/tools/auth0/handlers/customDomains.d.ts +4 -1
  126. package/lib/tools/auth0/handlers/customDomains.js +43 -53
  127. package/lib/tools/auth0/handlers/databases.js +94 -114
  128. package/lib/tools/auth0/handlers/default.d.ts +2 -2
  129. package/lib/tools/auth0/handlers/default.js +210 -171
  130. package/lib/tools/auth0/handlers/emailProvider.js +41 -52
  131. package/lib/tools/auth0/handlers/emailTemplates.d.ts +1 -0
  132. package/lib/tools/auth0/handlers/emailTemplates.js +54 -70
  133. package/lib/tools/auth0/handlers/flowVaultConnections.d.ts +5 -12
  134. package/lib/tools/auth0/handlers/flowVaultConnections.js +102 -145
  135. package/lib/tools/auth0/handlers/flows.d.ts +2 -3
  136. package/lib/tools/auth0/handlers/flows.js +92 -129
  137. package/lib/tools/auth0/handlers/forms.d.ts +3 -3
  138. package/lib/tools/auth0/handlers/forms.js +98 -112
  139. package/lib/tools/auth0/handlers/guardianFactorProviders.js +61 -84
  140. package/lib/tools/auth0/handlers/guardianFactorTemplates.js +46 -68
  141. package/lib/tools/auth0/handlers/guardianFactors.js +35 -45
  142. package/lib/tools/auth0/handlers/guardianPhoneFactorMessageTypes.js +29 -45
  143. package/lib/tools/auth0/handlers/guardianPhoneFactorSelectedProvider.js +29 -45
  144. package/lib/tools/auth0/handlers/guardianPolicies.js +20 -35
  145. package/lib/tools/auth0/handlers/hooks.js +123 -153
  146. package/lib/tools/auth0/handlers/index.js +4 -1
  147. package/lib/tools/auth0/handlers/logStreams.js +42 -47
  148. package/lib/tools/auth0/handlers/networkACLs.d.ts +5 -4
  149. package/lib/tools/auth0/handlers/networkACLs.js +115 -133
  150. package/lib/tools/auth0/handlers/organizations.d.ts +10 -9
  151. package/lib/tools/auth0/handlers/organizations.js +350 -431
  152. package/lib/tools/auth0/handlers/pages.js +74 -83
  153. package/lib/tools/auth0/handlers/phoneProvider.d.ts +2 -2
  154. package/lib/tools/auth0/handlers/phoneProvider.js +69 -82
  155. package/lib/tools/auth0/handlers/phoneTemplates.d.ts +63 -0
  156. package/lib/tools/auth0/handlers/phoneTemplates.js +221 -0
  157. package/lib/tools/auth0/handlers/prompts.d.ts +7 -7
  158. package/lib/tools/auth0/handlers/prompts.js +246 -240
  159. package/lib/tools/auth0/handlers/resourceServers.d.ts +6 -2
  160. package/lib/tools/auth0/handlers/resourceServers.js +94 -105
  161. package/lib/tools/auth0/handlers/roles.js +149 -178
  162. package/lib/tools/auth0/handlers/rules.js +144 -162
  163. package/lib/tools/auth0/handlers/rulesConfigs.js +30 -39
  164. package/lib/tools/auth0/handlers/scimHandler.d.ts +4 -3
  165. package/lib/tools/auth0/handlers/scimHandler.js +110 -132
  166. package/lib/tools/auth0/handlers/selfServiceProfiles.d.ts +12 -3
  167. package/lib/tools/auth0/handlers/selfServiceProfiles.js +173 -203
  168. package/lib/tools/auth0/handlers/tenant.d.ts +5 -3
  169. package/lib/tools/auth0/handlers/tenant.js +46 -52
  170. package/lib/tools/auth0/handlers/themes.d.ts +12 -12
  171. package/lib/tools/auth0/handlers/themes.js +86 -102
  172. package/lib/tools/auth0/handlers/tokenExchangeProfiles.d.ts +60 -0
  173. package/lib/tools/auth0/handlers/tokenExchangeProfiles.js +263 -0
  174. package/lib/tools/auth0/handlers/triggers.js +59 -75
  175. package/lib/tools/auth0/handlers/userAttributeProfiles.d.ts +3 -2
  176. package/lib/tools/auth0/handlers/userAttributeProfiles.js +41 -43
  177. package/lib/tools/auth0/index.js +35 -48
  178. package/lib/tools/auth0/schema.js +6 -4
  179. package/lib/tools/calculateChanges.js +24 -15
  180. package/lib/tools/constants.d.ts +4 -2
  181. package/lib/tools/constants.js +3 -1
  182. package/lib/tools/deploy.js +17 -29
  183. package/lib/tools/index.d.ts +3 -89
  184. package/lib/tools/index.js +3 -2
  185. package/lib/tools/utils.d.ts +1 -1
  186. package/lib/tools/utils.js +12 -22
  187. package/lib/tools/validationError.js +0 -1
  188. package/lib/types.d.ts +13 -5
  189. package/lib/types.js +0 -1
  190. package/lib/utils.d.ts +3 -58
  191. package/lib/utils.js +8 -5
  192. package/package.json +11 -10
  193. package/tsconfig.json +4 -3
  194. package/.eslintignore +0 -5
  195. package/.eslintrc +0 -69
  196. package/lib/args.js.map +0 -1
  197. package/lib/commands/export.js.map +0 -1
  198. package/lib/commands/import.js.map +0 -1
  199. package/lib/commands/index.js.map +0 -1
  200. package/lib/configFactory.js.map +0 -1
  201. package/lib/context/defaults.js.map +0 -1
  202. package/lib/context/directory/handlers/actions.js.map +0 -1
  203. package/lib/context/directory/handlers/attackProtection.js.map +0 -1
  204. package/lib/context/directory/handlers/branding.js.map +0 -1
  205. package/lib/context/directory/handlers/clientGrants.js.map +0 -1
  206. package/lib/context/directory/handlers/clients.js.map +0 -1
  207. package/lib/context/directory/handlers/connectionProfiles.js.map +0 -1
  208. package/lib/context/directory/handlers/connections.js.map +0 -1
  209. package/lib/context/directory/handlers/customDomains.js.map +0 -1
  210. package/lib/context/directory/handlers/databases.js.map +0 -1
  211. package/lib/context/directory/handlers/emailProvider.js.map +0 -1
  212. package/lib/context/directory/handlers/emailTemplates.js.map +0 -1
  213. package/lib/context/directory/handlers/flowVaultConnections.js.map +0 -1
  214. package/lib/context/directory/handlers/flows.js.map +0 -1
  215. package/lib/context/directory/handlers/forms.js.map +0 -1
  216. package/lib/context/directory/handlers/guardianFactorProviders.js.map +0 -1
  217. package/lib/context/directory/handlers/guardianFactorTemplates.js.map +0 -1
  218. package/lib/context/directory/handlers/guardianFactors.js.map +0 -1
  219. package/lib/context/directory/handlers/guardianPhoneFactorMessageTypes.js.map +0 -1
  220. package/lib/context/directory/handlers/guardianPhoneFactorSelectedProvider.js.map +0 -1
  221. package/lib/context/directory/handlers/guardianPolicies.js.map +0 -1
  222. package/lib/context/directory/handlers/hooks.js.map +0 -1
  223. package/lib/context/directory/handlers/index.js.map +0 -1
  224. package/lib/context/directory/handlers/logStreams.js.map +0 -1
  225. package/lib/context/directory/handlers/networkACLs.js.map +0 -1
  226. package/lib/context/directory/handlers/organizations.js.map +0 -1
  227. package/lib/context/directory/handlers/pages.js.map +0 -1
  228. package/lib/context/directory/handlers/phoneProvider.js.map +0 -1
  229. package/lib/context/directory/handlers/prompts.js.map +0 -1
  230. package/lib/context/directory/handlers/resourceServers.js.map +0 -1
  231. package/lib/context/directory/handlers/roles.js.map +0 -1
  232. package/lib/context/directory/handlers/rules.js.map +0 -1
  233. package/lib/context/directory/handlers/rulesConfigs.js.map +0 -1
  234. package/lib/context/directory/handlers/selfServiceProfiles.js.map +0 -1
  235. package/lib/context/directory/handlers/tenant.js.map +0 -1
  236. package/lib/context/directory/handlers/themes.js.map +0 -1
  237. package/lib/context/directory/handlers/triggers.js.map +0 -1
  238. package/lib/context/directory/handlers/userAttributeProfiles.js.map +0 -1
  239. package/lib/context/directory/index.js.map +0 -1
  240. package/lib/context/index.js.map +0 -1
  241. package/lib/context/yaml/handlers/actions.js.map +0 -1
  242. package/lib/context/yaml/handlers/attackProtection.js.map +0 -1
  243. package/lib/context/yaml/handlers/branding.js.map +0 -1
  244. package/lib/context/yaml/handlers/clientGrants.js.map +0 -1
  245. package/lib/context/yaml/handlers/clients.js.map +0 -1
  246. package/lib/context/yaml/handlers/connectionProfiles.js.map +0 -1
  247. package/lib/context/yaml/handlers/connections.js.map +0 -1
  248. package/lib/context/yaml/handlers/customDomains.js.map +0 -1
  249. package/lib/context/yaml/handlers/databases.js.map +0 -1
  250. package/lib/context/yaml/handlers/emailProvider.js.map +0 -1
  251. package/lib/context/yaml/handlers/emailTemplates.js.map +0 -1
  252. package/lib/context/yaml/handlers/flowVaultConnections.js.map +0 -1
  253. package/lib/context/yaml/handlers/flows.js.map +0 -1
  254. package/lib/context/yaml/handlers/forms.js.map +0 -1
  255. package/lib/context/yaml/handlers/guardianFactorProviders.js.map +0 -1
  256. package/lib/context/yaml/handlers/guardianFactorTemplates.js.map +0 -1
  257. package/lib/context/yaml/handlers/guardianFactors.js.map +0 -1
  258. package/lib/context/yaml/handlers/guardianPhoneFactorMessageTypes.js.map +0 -1
  259. package/lib/context/yaml/handlers/guardianPhoneFactorSelectedProvider.js.map +0 -1
  260. package/lib/context/yaml/handlers/guardianPolicies.js.map +0 -1
  261. package/lib/context/yaml/handlers/hooks.js.map +0 -1
  262. package/lib/context/yaml/handlers/index.js.map +0 -1
  263. package/lib/context/yaml/handlers/logStreams.js.map +0 -1
  264. package/lib/context/yaml/handlers/networkACLs.js.map +0 -1
  265. package/lib/context/yaml/handlers/organizations.js.map +0 -1
  266. package/lib/context/yaml/handlers/pages.js.map +0 -1
  267. package/lib/context/yaml/handlers/phoneProvider.js.map +0 -1
  268. package/lib/context/yaml/handlers/prompts.js.map +0 -1
  269. package/lib/context/yaml/handlers/resourceServers.js.map +0 -1
  270. package/lib/context/yaml/handlers/roles.js.map +0 -1
  271. package/lib/context/yaml/handlers/rules.js.map +0 -1
  272. package/lib/context/yaml/handlers/rulesConfigs.js.map +0 -1
  273. package/lib/context/yaml/handlers/selfServiceProfiles.js.map +0 -1
  274. package/lib/context/yaml/handlers/tenant.js.map +0 -1
  275. package/lib/context/yaml/handlers/themes.js.map +0 -1
  276. package/lib/context/yaml/handlers/triggers.js.map +0 -1
  277. package/lib/context/yaml/handlers/userAttributeProfiles.js.map +0 -1
  278. package/lib/context/yaml/index.js.map +0 -1
  279. package/lib/index.js.map +0 -1
  280. package/lib/keywordPreservation.js.map +0 -1
  281. package/lib/logger.js.map +0 -1
  282. package/lib/readonly.js.map +0 -1
  283. package/lib/sessionDurationsToMinutes.js.map +0 -1
  284. package/lib/tools/auth0/client.js.map +0 -1
  285. package/lib/tools/auth0/handlers/actions.js.map +0 -1
  286. package/lib/tools/auth0/handlers/attackProtection.js.map +0 -1
  287. package/lib/tools/auth0/handlers/branding.js.map +0 -1
  288. package/lib/tools/auth0/handlers/clientGrants.js.map +0 -1
  289. package/lib/tools/auth0/handlers/clients.js.map +0 -1
  290. package/lib/tools/auth0/handlers/connectionProfiles.js.map +0 -1
  291. package/lib/tools/auth0/handlers/connections.js.map +0 -1
  292. package/lib/tools/auth0/handlers/customDomains.js.map +0 -1
  293. package/lib/tools/auth0/handlers/databases.js.map +0 -1
  294. package/lib/tools/auth0/handlers/default.js.map +0 -1
  295. package/lib/tools/auth0/handlers/emailProvider.js.map +0 -1
  296. package/lib/tools/auth0/handlers/emailTemplates.js.map +0 -1
  297. package/lib/tools/auth0/handlers/flowVaultConnections.js.map +0 -1
  298. package/lib/tools/auth0/handlers/flows.js.map +0 -1
  299. package/lib/tools/auth0/handlers/forms.js.map +0 -1
  300. package/lib/tools/auth0/handlers/guardianFactorProviders.js.map +0 -1
  301. package/lib/tools/auth0/handlers/guardianFactorTemplates.js.map +0 -1
  302. package/lib/tools/auth0/handlers/guardianFactors.js.map +0 -1
  303. package/lib/tools/auth0/handlers/guardianPhoneFactorMessageTypes.js.map +0 -1
  304. package/lib/tools/auth0/handlers/guardianPhoneFactorSelectedProvider.js.map +0 -1
  305. package/lib/tools/auth0/handlers/guardianPolicies.js.map +0 -1
  306. package/lib/tools/auth0/handlers/hooks.js.map +0 -1
  307. package/lib/tools/auth0/handlers/index.js.map +0 -1
  308. package/lib/tools/auth0/handlers/logStreams.js.map +0 -1
  309. package/lib/tools/auth0/handlers/networkACLs.js.map +0 -1
  310. package/lib/tools/auth0/handlers/organizations.js.map +0 -1
  311. package/lib/tools/auth0/handlers/pages.js.map +0 -1
  312. package/lib/tools/auth0/handlers/phoneProvider.js.map +0 -1
  313. package/lib/tools/auth0/handlers/prompts.js.map +0 -1
  314. package/lib/tools/auth0/handlers/resourceServers.js.map +0 -1
  315. package/lib/tools/auth0/handlers/roles.js.map +0 -1
  316. package/lib/tools/auth0/handlers/rules.js.map +0 -1
  317. package/lib/tools/auth0/handlers/rulesConfigs.js.map +0 -1
  318. package/lib/tools/auth0/handlers/scimHandler.js.map +0 -1
  319. package/lib/tools/auth0/handlers/selfServiceProfiles.js.map +0 -1
  320. package/lib/tools/auth0/handlers/tenant.js.map +0 -1
  321. package/lib/tools/auth0/handlers/themes.js.map +0 -1
  322. package/lib/tools/auth0/handlers/triggers.js.map +0 -1
  323. package/lib/tools/auth0/handlers/userAttributeProfiles.js.map +0 -1
  324. package/lib/tools/auth0/index.js.map +0 -1
  325. package/lib/tools/auth0/schema.js.map +0 -1
  326. package/lib/tools/calculateChanges.js.map +0 -1
  327. package/lib/tools/constants.js.map +0 -1
  328. package/lib/tools/deploy.js.map +0 -1
  329. package/lib/tools/index.js.map +0 -1
  330. package/lib/tools/utils.js.map +0 -1
  331. package/lib/tools/validationError.js.map +0 -1
  332. package/lib/types.js.map +0 -1
  333. package/lib/utils.js.map +0 -1
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
4
  };
@@ -48,40 +39,41 @@ function parse(context) {
48
39
  connections,
49
40
  };
50
41
  }
51
- function dump(context) {
52
- return __awaiter(this, void 0, void 0, function* () {
53
- const { connections, clientsOrig } = context.assets;
54
- if (!connections)
55
- return; // Skip, nothing to dump
56
- const connectionsFolder = path_1.default.join(context.filePath, tools_1.constants.CONNECTIONS_DIRECTORY);
57
- fs_extra_1.default.ensureDirSync(connectionsFolder);
58
- // Convert enabled_clients from id to name
59
- connections.forEach((connection) => {
60
- let dumpedConnection = Object.assign(Object.assign({}, connection), (connection.enabled_clients && {
42
+ async function dump(context) {
43
+ const { connections, clientsOrig } = context.assets;
44
+ if (!connections)
45
+ return; // Skip, nothing to dump
46
+ const connectionsFolder = path_1.default.join(context.filePath, tools_1.constants.CONNECTIONS_DIRECTORY);
47
+ fs_extra_1.default.ensureDirSync(connectionsFolder);
48
+ // Convert enabled_clients from id to name
49
+ connections.forEach((connection) => {
50
+ let dumpedConnection = {
51
+ ...connection,
52
+ ...(connection.enabled_clients && {
61
53
  enabled_clients: (0, utils_1.mapClientID2NameSorted)(connection.enabled_clients, clientsOrig || []),
62
- }));
63
- const connectionName = (0, utils_1.sanitize)(dumpedConnection.name);
64
- // Mask secrets
65
- dumpedConnection = (0, defaults_1.connectionDefaults)(dumpedConnection);
66
- if (dumpedConnection.strategy === 'email') {
67
- (0, utils_1.ensureProp)(dumpedConnection, 'options.email.body');
68
- const html = dumpedConnection.options.email.body;
69
- const emailConnectionHtml = path_1.default.join(connectionsFolder, `${connectionName}.html`);
70
- logger_1.default.info(`Writing ${emailConnectionHtml}`);
71
- fs_extra_1.default.writeFileSync(emailConnectionHtml, html);
72
- dumpedConnection.options.email.body = `./${connectionName}.html`;
54
+ }),
55
+ };
56
+ const connectionName = (0, utils_1.sanitize)(dumpedConnection.name);
57
+ // Mask secrets
58
+ dumpedConnection = (0, defaults_1.connectionDefaults)(dumpedConnection);
59
+ if (dumpedConnection.strategy === 'email') {
60
+ (0, utils_1.ensureProp)(dumpedConnection, 'options.email.body');
61
+ const html = dumpedConnection.options.email.body;
62
+ const emailConnectionHtml = path_1.default.join(connectionsFolder, `${connectionName}.html`);
63
+ logger_1.default.info(`Writing ${emailConnectionHtml}`);
64
+ fs_extra_1.default.writeFileSync(emailConnectionHtml, html);
65
+ dumpedConnection.options.email.body = `./${connectionName}.html`;
66
+ }
67
+ if (dumpedConnection.strategy === 'samlp' && dumpedConnection.options) {
68
+ if ('cert' in dumpedConnection.options) {
69
+ dumpedConnection.options.cert = (0, utils_1.encodeCertStringToBase64)(dumpedConnection.options.cert);
73
70
  }
74
- if (dumpedConnection.strategy === 'samlp' && dumpedConnection.options) {
75
- if ('cert' in dumpedConnection.options) {
76
- dumpedConnection.options.cert = (0, utils_1.encodeCertStringToBase64)(dumpedConnection.options.cert);
77
- }
78
- if ('signingCert' in dumpedConnection.options) {
79
- dumpedConnection.options.signingCert = (0, utils_1.encodeCertStringToBase64)(dumpedConnection.options.signingCert);
80
- }
71
+ if ('signingCert' in dumpedConnection.options) {
72
+ dumpedConnection.options.signingCert = (0, utils_1.encodeCertStringToBase64)(dumpedConnection.options.signingCert);
81
73
  }
82
- const connectionFile = path_1.default.join(connectionsFolder, `${connectionName}.json`);
83
- (0, utils_1.dumpJSON)(connectionFile, dumpedConnection);
84
- });
74
+ }
75
+ const connectionFile = path_1.default.join(connectionsFolder, `${connectionName}.json`);
76
+ (0, utils_1.dumpJSON)(connectionFile, dumpedConnection);
85
77
  });
86
78
  }
87
79
  const connectionsHandler = {
@@ -89,4 +81,3 @@ const connectionsHandler = {
89
81
  dump,
90
82
  };
91
83
  exports.default = connectionsHandler;
92
- //# sourceMappingURL=connections.js.map
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
4
  };
@@ -30,21 +21,18 @@ function parse(context) {
30
21
  }),
31
22
  };
32
23
  }
33
- function dump(context) {
34
- return __awaiter(this, void 0, void 0, function* () {
35
- const { customDomains } = context.assets;
36
- if (!customDomains)
37
- return; // Skip, nothing to dump
38
- // Create Rules folder
39
- const customDomainsDirectory = getCustomDomainsDirectory(context.filePath);
40
- fs_extra_1.default.ensureDirSync(customDomainsDirectory);
41
- const customDomainsFile = getCustomDomainsFile(context.filePath);
42
- (0, utils_1.dumpJSON)(customDomainsFile, customDomains);
43
- });
24
+ async function dump(context) {
25
+ const { customDomains } = context.assets;
26
+ if (!customDomains)
27
+ return; // Skip, nothing to dump
28
+ // Create Rules folder
29
+ const customDomainsDirectory = getCustomDomainsDirectory(context.filePath);
30
+ fs_extra_1.default.ensureDirSync(customDomainsDirectory);
31
+ const customDomainsFile = getCustomDomainsFile(context.filePath);
32
+ (0, utils_1.dumpJSON)(customDomainsFile, customDomains);
44
33
  }
45
34
  const customDomainsHandler = {
46
35
  parse,
47
36
  dump,
48
37
  };
49
38
  exports.default = customDomainsHandler;
50
- //# sourceMappingURL=customDomains.js.map
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
4
  };
@@ -18,7 +9,6 @@ const tools_1 = require("../../../tools");
18
9
  const logger_1 = __importDefault(require("../../../logger"));
19
10
  const utils_1 = require("../../../utils");
20
11
  function getDatabase(folder, mappingOpts) {
21
- var _a;
22
12
  const metaFile = path_1.default.join(folder, 'database.json');
23
13
  const metaData = (() => {
24
14
  try {
@@ -33,9 +23,17 @@ function getDatabase(folder, mappingOpts) {
33
23
  logger_1.default.warn(`Skipping database folder ${folder} as ${metaFile} is empty`);
34
24
  return {};
35
25
  }
36
- const database = Object.assign(Object.assign({}, metaData), { options: Object.assign(Object.assign({}, (metaData.options || {})), ((metaData === null || metaData === void 0 ? void 0 : metaData.customScripts) && { customScripts: metaData === null || metaData === void 0 ? void 0 : metaData.customScripts })) });
26
+ const database = {
27
+ ...metaData,
28
+ options: {
29
+ // @ts-ignore because this code exists currently, but still needs to be understood if it is correct or not
30
+ ...(metaData.options || {}),
31
+ // @ts-ignore because this code exists currently, but still needs to be understood if it is correct or not
32
+ ...(metaData?.customScripts && { customScripts: metaData?.customScripts }),
33
+ },
34
+ };
37
35
  // If any customScripts configured then load content of files
38
- if ((_a = database.options) === null || _a === void 0 ? void 0 : _a.customScripts) {
36
+ if (database.options?.customScripts) {
39
37
  Object.entries(database.options.customScripts).forEach(([name, script]) => {
40
38
  if (!tools_1.constants.DATABASE_SCRIPTS.includes(name)) {
41
39
  // skip invalid keys in customScripts object
@@ -66,25 +64,29 @@ function parse(context) {
66
64
  databases,
67
65
  };
68
66
  }
69
- function dump(context) {
70
- return __awaiter(this, void 0, void 0, function* () {
71
- const { databases } = context.assets;
72
- if (!databases)
73
- return; // Skip, nothing to dump
74
- const databasesFolder = path_1.default.join(context.filePath, tools_1.constants.DATABASE_CONNECTIONS_DIRECTORY);
75
- fs_extra_1.default.ensureDirSync(databasesFolder);
76
- databases.forEach((database) => {
77
- var _a;
78
- const dbFolder = path_1.default.join(databasesFolder, (0, utils_1.sanitize)(database.name));
79
- fs_extra_1.default.ensureDirSync(dbFolder);
80
- const sortCustomScripts = (name1, name2) => {
81
- if (name1 === name2)
82
- return 0;
83
- return name1 > name2 ? 1 : -1;
84
- };
85
- const formatted = Object.assign(Object.assign(Object.assign({}, database), (database.enabled_clients && {
67
+ async function dump(context) {
68
+ const { databases } = context.assets;
69
+ if (!databases)
70
+ return; // Skip, nothing to dump
71
+ const databasesFolder = path_1.default.join(context.filePath, tools_1.constants.DATABASE_CONNECTIONS_DIRECTORY);
72
+ fs_extra_1.default.ensureDirSync(databasesFolder);
73
+ databases.forEach((database) => {
74
+ const dbFolder = path_1.default.join(databasesFolder, (0, utils_1.sanitize)(database.name));
75
+ fs_extra_1.default.ensureDirSync(dbFolder);
76
+ const sortCustomScripts = (name1, name2) => {
77
+ if (name1 === name2)
78
+ return 0;
79
+ return name1 > name2 ? 1 : -1;
80
+ };
81
+ const formatted = {
82
+ ...database,
83
+ ...(database.enabled_clients && {
86
84
  enabled_clients: (0, utils_1.mapClientID2NameSorted)(database.enabled_clients, context.assets.clientsOrig || []),
87
- })), { options: Object.assign(Object.assign({}, (database.options || {})), (((_a = database.options) === null || _a === void 0 ? void 0 : _a.customScripts) && {
85
+ }),
86
+ options: {
87
+ ...(database.options || {}),
88
+ // customScripts option only written if there are scripts
89
+ ...(database.options?.customScripts && {
88
90
  customScripts: Object.entries(database.options.customScripts)
89
91
  // @ts-ignore because we'll fix this in subsequent PR
90
92
  .sort(sortCustomScripts)
@@ -98,10 +100,11 @@ function dump(context) {
98
100
  scripts[name] = `./${scriptName}`;
99
101
  return scripts;
100
102
  }, {}),
101
- })) });
102
- const databaseFile = path_1.default.join(dbFolder, 'database.json');
103
- (0, utils_1.dumpJSON)(databaseFile, formatted);
104
- });
103
+ }),
104
+ },
105
+ };
106
+ const databaseFile = path_1.default.join(dbFolder, 'database.json');
107
+ (0, utils_1.dumpJSON)(databaseFile, formatted);
105
108
  });
106
109
  }
107
110
  const databasesHandler = {
@@ -109,4 +112,3 @@ const databasesHandler = {
109
112
  dump,
110
113
  };
111
114
  exports.default = databasesHandler;
112
- //# sourceMappingURL=databases.js.map
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
4
  };
@@ -33,37 +24,32 @@ function parse(context) {
33
24
  }
34
25
  return { emailProvider: null };
35
26
  }
36
- function dump(context) {
37
- return __awaiter(this, void 0, void 0, function* () {
38
- var _a;
39
- if (!context.assets.emailProvider)
40
- return; // Skip, nothing to dump
41
- let emailProvider = (() => {
42
- var _a;
43
- const excludedDefaults = ((_a = context.assets.exclude) === null || _a === void 0 ? void 0 : _a.defaults) || [];
44
- if (!excludedDefaults.includes('emailProvider')) {
45
- // Add placeholder for credentials as they cannot be exported
46
- return (0, defaults_1.emailProviderDefaults)(context.assets.emailProvider);
47
- }
48
- return context.assets.emailProvider;
49
- })();
50
- // Apply EXCLUDED_PROPS after emailProviderDefaults to remove any re-added fields
51
- const excludedFields = ((_a = context.config.EXCLUDED_PROPS) === null || _a === void 0 ? void 0 : _a.emailProvider) || [];
52
- if (excludedFields.length > 0) {
53
- emailProvider = Object.assign({}, emailProvider);
54
- excludedFields.forEach((field) => {
55
- dot_prop_1.default.delete(emailProvider, field);
56
- });
27
+ async function dump(context) {
28
+ if (!context.assets.emailProvider)
29
+ return; // Skip, nothing to dump
30
+ let emailProvider = (() => {
31
+ const excludedDefaults = context.assets.exclude?.defaults || [];
32
+ if (!excludedDefaults.includes('emailProvider')) {
33
+ // Add placeholder for credentials as they cannot be exported
34
+ return (0, defaults_1.emailProviderDefaults)(context.assets.emailProvider);
57
35
  }
58
- const emailsFolder = path_1.default.join(context.filePath, tools_1.constants.EMAIL_TEMPLATES_DIRECTORY);
59
- fs_extra_1.default.ensureDirSync(emailsFolder);
60
- const emailProviderFile = path_1.default.join(emailsFolder, 'provider.json');
61
- (0, utils_1.dumpJSON)(emailProviderFile, emailProvider);
62
- });
36
+ return context.assets.emailProvider;
37
+ })();
38
+ // Apply EXCLUDED_PROPS after emailProviderDefaults to remove any re-added fields
39
+ const excludedFields = context.config.EXCLUDED_PROPS?.emailProvider || [];
40
+ if (excludedFields.length > 0) {
41
+ emailProvider = { ...emailProvider };
42
+ excludedFields.forEach((field) => {
43
+ dot_prop_1.default.delete(emailProvider, field);
44
+ });
45
+ }
46
+ const emailsFolder = path_1.default.join(context.filePath, tools_1.constants.EMAIL_TEMPLATES_DIRECTORY);
47
+ fs_extra_1.default.ensureDirSync(emailsFolder);
48
+ const emailProviderFile = path_1.default.join(emailsFolder, 'provider.json');
49
+ (0, utils_1.dumpJSON)(emailProviderFile, emailProvider);
63
50
  }
64
51
  const emailProviderHandler = {
65
52
  parse,
66
53
  dump,
67
54
  };
68
55
  exports.default = emailProviderHandler;
69
- //# sourceMappingURL=emailProvider.js.map
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
4
  };
@@ -43,32 +34,33 @@ function parse(context) {
43
34
  logger_1.default.warn(`Skipping email template file ${meta.body} as missing the corresponding '.json' file`);
44
35
  return [];
45
36
  }
46
- return Object.assign(Object.assign({}, meta), { body: (0, tools_1.loadFileAndReplaceKeywords)(templateFilePath, {
37
+ return {
38
+ ...meta,
39
+ body: (0, tools_1.loadFileAndReplaceKeywords)(templateFilePath, {
47
40
  mappings: context.mappings,
48
41
  disableKeywordReplacement: context.disableKeywordReplacement,
49
- }) });
42
+ }),
43
+ };
50
44
  });
51
45
  return {
52
46
  emailTemplates,
53
47
  };
54
48
  }
55
- function dump(context) {
56
- return __awaiter(this, void 0, void 0, function* () {
57
- const { emailTemplates } = context.assets;
58
- if (!emailTemplates)
59
- return; // Skip, nothing to dump
60
- // Create Templates folder
61
- const templatesFolder = path_1.default.join(context.filePath, tools_1.constants.EMAIL_TEMPLATES_DIRECTORY);
62
- fs_extra_1.default.ensureDirSync(templatesFolder);
63
- emailTemplates.forEach((template) => {
64
- // Dump template html to file
65
- const templateHtml = path_1.default.join(templatesFolder, `${template.template}.html`);
66
- logger_1.default.info(`Writing ${templateHtml}`);
67
- fs_extra_1.default.writeFileSync(templateHtml, template.body);
68
- // Dump template metadata
69
- const templateFile = path_1.default.join(templatesFolder, `${template.template}.json`);
70
- (0, utils_1.dumpJSON)(templateFile, Object.assign(Object.assign({}, template), { body: `./${template.template}.html` }));
71
- });
49
+ async function dump(context) {
50
+ const { emailTemplates } = context.assets;
51
+ if (!emailTemplates)
52
+ return; // Skip, nothing to dump
53
+ // Create Templates folder
54
+ const templatesFolder = path_1.default.join(context.filePath, tools_1.constants.EMAIL_TEMPLATES_DIRECTORY);
55
+ fs_extra_1.default.ensureDirSync(templatesFolder);
56
+ emailTemplates.forEach((template) => {
57
+ // Dump template html to file
58
+ const templateHtml = path_1.default.join(templatesFolder, `${template.template}.html`);
59
+ logger_1.default.info(`Writing ${templateHtml}`);
60
+ fs_extra_1.default.writeFileSync(templateHtml, template.body);
61
+ // Dump template metadata
62
+ const templateFile = path_1.default.join(templatesFolder, `${template.template}.json`);
63
+ (0, utils_1.dumpJSON)(templateFile, { ...template, body: `./${template.template}.html` });
72
64
  });
73
65
  }
74
66
  const emailTemplatesHandler = {
@@ -76,4 +68,3 @@ const emailTemplatesHandler = {
76
68
  dump,
77
69
  };
78
70
  exports.default = emailTemplatesHandler;
79
- //# sourceMappingURL=emailTemplates.js.map
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
4
  };
@@ -24,58 +15,58 @@ function parse(context) {
24
15
  return { flowVaultConnections: null }; // Skip
25
16
  const files = (0, utils_1.getFiles)(flowVaultsFolder, ['.json']);
26
17
  const flowVaultConnections = files.map((f) => {
27
- const connection = Object.assign({}, (0, utils_1.loadJSON)(f, {
28
- mappings: context.mappings,
29
- disableKeywordReplacement: context.disableKeywordReplacement,
30
- }));
18
+ const connection = {
19
+ ...(0, utils_1.loadJSON)(f, {
20
+ mappings: context.mappings,
21
+ disableKeywordReplacement: context.disableKeywordReplacement,
22
+ }),
23
+ };
31
24
  return connection;
32
25
  });
33
26
  return {
34
27
  flowVaultConnections,
35
28
  };
36
29
  }
37
- function dump(context) {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- const { flowVaultConnections } = context.assets;
40
- if (!flowVaultConnections || (0, lodash_1.isEmpty)(flowVaultConnections))
41
- return; // Skip, nothing to dump
42
- // Check if there is any duplicate form name
43
- const vaultConnectionsNamesSet = new Set();
44
- const duplicateVaultConnectionsNames = new Set();
45
- flowVaultConnections.forEach((form) => {
46
- if (vaultConnectionsNamesSet.has(form.name)) {
47
- duplicateVaultConnectionsNames.add(form.name);
48
- }
49
- else {
50
- vaultConnectionsNamesSet.add(form.name);
51
- }
52
- });
53
- if (duplicateVaultConnectionsNames.size > 0) {
54
- const duplicatesArray = Array.from(duplicateVaultConnectionsNames);
55
- logger_1.default.error(`Duplicate flow vault connections names found: [${duplicatesArray}] , make sure to rename them to avoid conflicts`);
56
- throw new Error(`Duplicate flow vault connections names found: ${duplicatesArray}`);
30
+ async function dump(context) {
31
+ const { flowVaultConnections } = context.assets;
32
+ if (!flowVaultConnections || (0, lodash_1.isEmpty)(flowVaultConnections))
33
+ return; // Skip, nothing to dump
34
+ // Check if there is any duplicate form name
35
+ const vaultConnectionsNamesSet = new Set();
36
+ const duplicateVaultConnectionsNames = new Set();
37
+ flowVaultConnections.forEach((form) => {
38
+ if (vaultConnectionsNamesSet.has(form.name)) {
39
+ duplicateVaultConnectionsNames.add(form.name);
57
40
  }
58
- const flowVaultsFolder = path_1.default.join(context.filePath, tools_1.constants.FLOWS_VAULT_DIRECTORY);
59
- fs_extra_1.default.ensureDirSync(flowVaultsFolder);
60
- const removeKeysFromOutput = ['id', 'created_at', 'updated_at', 'refreshed_at', 'fingerprint'];
61
- flowVaultConnections.forEach((connection) => {
62
- removeKeysFromOutput.forEach((key) => {
63
- if (key in connection) {
64
- delete connection[key];
65
- }
66
- });
67
- });
68
- console.warn('WARNING! Flow vault connections `setup` key does not support keyword preservation, `export` or `dump` commmand will not preserve `setup` key in local configuration file.');
69
- flowVaultConnections.forEach((connection) => {
70
- const connectionFile = path_1.default.join(flowVaultsFolder, (0, utils_1.sanitize)(`${connection.name}.json`));
71
- logger_1.default.info(`Writing ${connectionFile}`);
72
- (0, utils_1.dumpJSON)(connectionFile, connection);
41
+ else {
42
+ vaultConnectionsNamesSet.add(form.name);
43
+ }
44
+ });
45
+ if (duplicateVaultConnectionsNames.size > 0) {
46
+ const duplicatesArray = Array.from(duplicateVaultConnectionsNames);
47
+ logger_1.default.error(`Duplicate flow vault connections names found: [${duplicatesArray}] , make sure to rename them to avoid conflicts`);
48
+ throw new Error(`Duplicate flow vault connections names found: ${duplicatesArray}`);
49
+ }
50
+ const flowVaultsFolder = path_1.default.join(context.filePath, tools_1.constants.FLOWS_VAULT_DIRECTORY);
51
+ fs_extra_1.default.ensureDirSync(flowVaultsFolder);
52
+ const removeKeysFromOutput = ['id', 'created_at', 'updated_at', 'refreshed_at', 'fingerprint'];
53
+ flowVaultConnections.forEach((connection) => {
54
+ removeKeysFromOutput.forEach((key) => {
55
+ if (key in connection) {
56
+ delete connection[key];
57
+ }
73
58
  });
74
59
  });
60
+ // eslint-disable-next-line no-console
61
+ console.warn('WARNING! Flow vault connections `setup` key does not support keyword preservation, `export` or `dump` commmand will not preserve `setup` key in local configuration file.');
62
+ flowVaultConnections.forEach((connection) => {
63
+ const connectionFile = path_1.default.join(flowVaultsFolder, (0, utils_1.sanitize)(`${connection.name}.json`));
64
+ logger_1.default.info(`Writing ${connectionFile}`);
65
+ (0, utils_1.dumpJSON)(connectionFile, connection);
66
+ });
75
67
  }
76
68
  const flowVaultsHandler = {
77
69
  parse,
78
70
  dump,
79
71
  };
80
72
  exports.default = flowVaultsHandler;
81
- //# sourceMappingURL=flowVaultConnections.js.map
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
4
  };
@@ -23,53 +14,53 @@ function parse(context) {
23
14
  return { flows: null }; // Skip
24
15
  const files = (0, utils_1.getFiles)(flowsFolder, ['.json']);
25
16
  const flows = files.map((f) => {
26
- const flow = Object.assign({}, (0, utils_1.loadJSON)(f, {
27
- mappings: context.mappings,
28
- disableKeywordReplacement: context.disableKeywordReplacement,
29
- }));
17
+ const flow = {
18
+ ...(0, utils_1.loadJSON)(f, {
19
+ mappings: context.mappings,
20
+ disableKeywordReplacement: context.disableKeywordReplacement,
21
+ }),
22
+ };
30
23
  return flow;
31
24
  });
32
25
  return {
33
26
  flows,
34
27
  };
35
28
  }
36
- function dump(context) {
37
- return __awaiter(this, void 0, void 0, function* () {
38
- const { flows } = context.assets;
39
- if (!flows)
40
- return; // Skip, nothing to dump
41
- const flowsFolder = path_1.default.join(context.filePath, tools_1.constants.FLOWS_DIRECTORY);
42
- fs_extra_1.default.ensureDirSync(flowsFolder);
43
- // Check if there is any duplicate flow name
44
- const flowNameSet = new Set();
45
- const duplicateFlowNames = new Set();
46
- flows.forEach((flow) => {
47
- if (flowNameSet.has(flow.name)) {
48
- duplicateFlowNames.add(flow.name);
49
- }
50
- else {
51
- flowNameSet.add(flow.name);
52
- }
53
- });
54
- if (duplicateFlowNames.size > 0) {
55
- const duplicateNamesArray = Array.from(duplicateFlowNames).join(', ');
56
- logger_1.default.error(`Duplicate flow names found: [${duplicateNamesArray}] , make sure to rename them to avoid conflicts`);
57
- throw new Error(`Duplicate flow names found: ${duplicateNamesArray}`);
29
+ async function dump(context) {
30
+ const { flows } = context.assets;
31
+ if (!flows)
32
+ return; // Skip, nothing to dump
33
+ const flowsFolder = path_1.default.join(context.filePath, tools_1.constants.FLOWS_DIRECTORY);
34
+ fs_extra_1.default.ensureDirSync(flowsFolder);
35
+ // Check if there is any duplicate flow name
36
+ const flowNameSet = new Set();
37
+ const duplicateFlowNames = new Set();
38
+ flows.forEach((flow) => {
39
+ if (flowNameSet.has(flow.name)) {
40
+ duplicateFlowNames.add(flow.name);
41
+ }
42
+ else {
43
+ flowNameSet.add(flow.name);
44
+ }
45
+ });
46
+ if (duplicateFlowNames.size > 0) {
47
+ const duplicateNamesArray = Array.from(duplicateFlowNames).join(', ');
48
+ logger_1.default.error(`Duplicate flow names found: [${duplicateNamesArray}] , make sure to rename them to avoid conflicts`);
49
+ throw new Error(`Duplicate flow names found: ${duplicateNamesArray}`);
50
+ }
51
+ flows.forEach((flow) => {
52
+ if (flow.name === undefined) {
53
+ return;
58
54
  }
59
- flows.forEach((flow) => {
60
- if (flow.name === undefined) {
61
- return;
55
+ const flowFile = path_1.default.join(flowsFolder, (0, utils_1.sanitize)(`${flow.name}.json`));
56
+ logger_1.default.info(`Writing ${flowFile}`);
57
+ const removeKeysFromOutput = ['id', 'created_at', 'updated_at', 'submitted_at', 'embedded_at'];
58
+ removeKeysFromOutput.forEach((key) => {
59
+ if (key in flow) {
60
+ delete flow[key];
62
61
  }
63
- const flowFile = path_1.default.join(flowsFolder, (0, utils_1.sanitize)(`${flow.name}.json`));
64
- logger_1.default.info(`Writing ${flowFile}`);
65
- const removeKeysFromOutput = ['id', 'created_at', 'updated_at', 'submitted_at', 'embedded_at'];
66
- removeKeysFromOutput.forEach((key) => {
67
- if (key in flow) {
68
- delete flow[key];
69
- }
70
- });
71
- (0, utils_1.dumpJSON)(flowFile, flow);
72
62
  });
63
+ (0, utils_1.dumpJSON)(flowFile, flow);
73
64
  });
74
65
  }
75
66
  const flowsHandler = {
@@ -77,4 +68,3 @@ const flowsHandler = {
77
68
  dump,
78
69
  };
79
70
  exports.default = flowsHandler;
80
- //# sourceMappingURL=flows.js.map