auth0-deploy-cli 8.22.0 → 8.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (333) hide show
  1. package/.circleci/config.yml +57 -5
  2. package/CHANGELOG.md +31 -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 +108 -143
  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 +360 -429
  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 +229 -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 +162 -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 +271 -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,27 +1,15 @@
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
  Object.defineProperty(exports, "__esModule", { value: true });
12
- function parseAndDump(context) {
13
- return __awaiter(this, void 0, void 0, function* () {
14
- const { themes } = context.assets;
15
- if (!themes)
16
- return { themes: null };
17
- return {
18
- themes,
19
- };
20
- });
3
+ async function parseAndDump(context) {
4
+ const { themes } = context.assets;
5
+ if (!themes)
6
+ return { themes: null };
7
+ return {
8
+ themes,
9
+ };
21
10
  }
22
11
  const themesHandler = {
23
12
  parse: parseAndDump,
24
13
  dump: parseAndDump,
25
14
  };
26
15
  exports.default = themesHandler;
27
- //# sourceMappingURL=themes.js.map
@@ -0,0 +1,5 @@
1
+ import { YAMLHandler } from '.';
2
+ import { Asset, ParsedAsset } from '../../../types';
3
+ type ParsedTokenExchangeProfiles = ParsedAsset<'tokenExchangeProfiles', Asset[]>;
4
+ declare const handler: YAMLHandler<ParsedTokenExchangeProfiles>;
5
+ export default handler;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ async function parse(context) {
4
+ const { tokenExchangeProfiles } = context.assets;
5
+ if (!tokenExchangeProfiles)
6
+ return { tokenExchangeProfiles: null };
7
+ return {
8
+ tokenExchangeProfiles,
9
+ };
10
+ }
11
+ async function dump(context) {
12
+ const { tokenExchangeProfiles } = context.assets;
13
+ if (!tokenExchangeProfiles)
14
+ return { tokenExchangeProfiles: null };
15
+ return {
16
+ tokenExchangeProfiles: tokenExchangeProfiles.map((profile) => {
17
+ // Strip server-generated fields
18
+ const { id, created_at, updated_at, ...cleanProfile } = profile;
19
+ return cleanProfile;
20
+ }),
21
+ };
22
+ }
23
+ const handler = {
24
+ parse,
25
+ dump,
26
+ };
27
+ exports.default = handler;
@@ -1,5 +1,5 @@
1
1
  import { YAMLHandler } from '.';
2
2
  import { Asset, ParsedAsset } from '../../../types';
3
- type ParsedTriggers = ParsedAsset<'triggers', Asset[]>;
3
+ type ParsedTriggers = ParsedAsset<'triggers', Asset>;
4
4
  declare const triggersHandler: YAMLHandler<ParsedTriggers>;
5
5
  export default triggersHandler;
@@ -1,38 +1,24 @@
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
  Object.defineProperty(exports, "__esModule", { value: true });
12
- function parse(context) {
13
- return __awaiter(this, void 0, void 0, function* () {
14
- // Load the script file for each action
15
- if (!context.assets.triggers)
16
- return { triggers: null };
17
- return {
18
- triggers: context.assets.triggers,
19
- };
20
- });
3
+ async function parse(context) {
4
+ // Load the script file for each action
5
+ if (!context.assets.triggers)
6
+ return { triggers: null };
7
+ return {
8
+ triggers: context.assets.triggers,
9
+ };
21
10
  }
22
- function dump(context) {
23
- return __awaiter(this, void 0, void 0, function* () {
24
- const { triggers } = context.assets;
25
- // Nothing to do
26
- if (!triggers)
27
- return { triggers: null };
28
- return {
29
- triggers: triggers,
30
- };
31
- });
11
+ async function dump(context) {
12
+ const { triggers } = context.assets;
13
+ // Nothing to do
14
+ if (!triggers)
15
+ return { triggers: null };
16
+ return {
17
+ triggers: triggers,
18
+ };
32
19
  }
33
20
  const triggersHandler = {
34
21
  parse,
35
22
  dump,
36
23
  };
37
24
  exports.default = triggersHandler;
38
- //# sourceMappingURL=triggers.js.map
@@ -1,5 +1,5 @@
1
- import { UserAttributeProfile } from 'auth0';
2
1
  import { YAMLHandler } from '.';
2
+ import { UserAttributeProfile } from '../../../tools/auth0/handlers/userAttributeProfiles';
3
3
  import { ParsedAsset } from '../../../types';
4
4
  type ParsedUserAttributeProfiles = ParsedAsset<'userAttributeProfiles', Partial<UserAttributeProfile>[]>;
5
5
  declare const selfServiceProfileHandler: YAMLHandler<ParsedUserAttributeProfiles>;
@@ -1,27 +1,15 @@
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
  Object.defineProperty(exports, "__esModule", { value: true });
12
- function parseAndDump(context) {
13
- return __awaiter(this, void 0, void 0, function* () {
14
- const { userAttributeProfiles } = context.assets;
15
- if (!userAttributeProfiles)
16
- return { userAttributeProfiles: null };
17
- return {
18
- userAttributeProfiles,
19
- };
20
- });
3
+ async function parseAndDump(context) {
4
+ const { userAttributeProfiles } = context.assets;
5
+ if (!userAttributeProfiles)
6
+ return { userAttributeProfiles: null };
7
+ return {
8
+ userAttributeProfiles,
9
+ };
21
10
  }
22
11
  const selfServiceProfileHandler = {
23
12
  parse: parseAndDump,
24
13
  dump: parseAndDump,
25
14
  };
26
15
  exports.default = selfServiceProfileHandler;
27
- //# sourceMappingURL=userAttributeProfiles.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
  };
@@ -59,136 +50,137 @@ class YAMLContext {
59
50
  disableKeywordReplacement: this.disableKeywordReplacement,
60
51
  });
61
52
  }
62
- loadAssetsFromLocal() {
63
- return __awaiter(this, arguments, void 0, function* (opts = { disableKeywordReplacement: false }) {
64
- // Allow to send object/json directly
65
- this.disableKeywordReplacement = opts.disableKeywordReplacement;
66
- if (typeof this.configFile === 'object') {
67
- this.assets = this.configFile;
53
+ async loadAssetsFromLocal(opts = { disableKeywordReplacement: false }) {
54
+ // Allow to send object/json directly
55
+ this.disableKeywordReplacement = opts.disableKeywordReplacement;
56
+ if (typeof this.configFile === 'object') {
57
+ this.assets = this.configFile;
58
+ }
59
+ else {
60
+ try {
61
+ const fPath = path_1.default.resolve(this.configFile);
62
+ logger_1.default.debug(`Loading YAML from ${fPath}`);
63
+ Object.assign(this.assets, js_yaml_1.default.load(opts.disableKeywordReplacement
64
+ ? (0, tools_1.wrapArrayReplaceMarkersInQuotes)(fs_extra_1.default.readFileSync(fPath, 'utf8'), this.mappings)
65
+ : (0, tools_1.keywordReplace)(fs_extra_1.default.readFileSync(fPath, 'utf8'), this.mappings)) || {});
68
66
  }
69
- else {
70
- try {
71
- const fPath = path_1.default.resolve(this.configFile);
72
- logger_1.default.debug(`Loading YAML from ${fPath}`);
73
- Object.assign(this.assets, js_yaml_1.default.load(opts.disableKeywordReplacement
74
- ? (0, tools_1.wrapArrayReplaceMarkersInQuotes)(fs_extra_1.default.readFileSync(fPath, 'utf8'), this.mappings)
75
- : (0, tools_1.keywordReplace)(fs_extra_1.default.readFileSync(fPath, 'utf8'), this.mappings)) || {});
76
- }
77
- catch (err) {
78
- logger_1.default.debug(err.stack);
79
- throw new Error(`Problem loading ${this.configFile}\n${err}`);
80
- }
67
+ catch (err) {
68
+ logger_1.default.debug(err.stack);
69
+ throw new Error(`Problem loading ${this.configFile}\n${err}`);
81
70
  }
82
- this.assets = Object.keys(this.assets).reduce((acc, key) => {
83
- const excludedAssetTypes = this.config.AUTH0_EXCLUDED || [];
84
- if (excludedAssetTypes.includes(key))
85
- return acc;
86
- return Object.assign(Object.assign({}, acc), { [key]: this.assets[key] });
87
- }, {});
88
- const initialAssets = {
89
- exclude: this.assets.exclude, // Keep the exclude rules in result assets
71
+ }
72
+ this.assets = Object.keys(this.assets).reduce((acc, key) => {
73
+ const excludedAssetTypes = this.config.AUTH0_EXCLUDED || [];
74
+ if (excludedAssetTypes.includes(key))
75
+ return acc;
76
+ return {
77
+ ...acc,
78
+ [key]: this.assets[key],
90
79
  };
91
- this.assets = Object.keys(this.assets).reduce((acc, key) => {
92
- // Get the list of asset types to include
93
- const includedAssetTypes = this.config.AUTH0_INCLUDED_ONLY;
94
- // If includedAssetTypes is defined and this asset type (key) is not in the list, exclude it
95
- if (includedAssetTypes !== undefined && !includedAssetTypes.includes(key))
96
- return acc;
97
- // Otherwise, include the asset type in the result
98
- return Object.assign(Object.assign({}, acc), { [key]: this.assets[key] });
99
- }, initialAssets);
100
- // Run initial schema check to ensure valid YAML
101
- const auth0 = new tools_1.Auth0(this.mgmtClient, this.assets, (0, utils_1.toConfigFn)(this.config));
102
- if (!opts.disableKeywordReplacement) {
103
- // The schema validation needs to be disabled during keyword-preserved export because a field may be enforced as an array but will be expressed with an array replace marker (string).
104
- yield auth0.validate();
80
+ }, {});
81
+ const initialAssets = {
82
+ exclude: this.assets.exclude, // Keep the exclude rules in result assets
83
+ };
84
+ this.assets = Object.keys(this.assets).reduce((acc, key) => {
85
+ // Get the list of asset types to include
86
+ const includedAssetTypes = this.config.AUTH0_INCLUDED_ONLY;
87
+ // If includedAssetTypes is defined and this asset type (key) is not in the list, exclude it
88
+ if (includedAssetTypes !== undefined && !includedAssetTypes.includes(key))
89
+ return acc;
90
+ // Otherwise, include the asset type in the result
91
+ return {
92
+ ...acc,
93
+ [key]: this.assets[key],
94
+ };
95
+ }, initialAssets);
96
+ // Run initial schema check to ensure valid YAML
97
+ const auth0 = new tools_1.Auth0(this.mgmtClient, this.assets, (0, utils_1.toConfigFn)(this.config));
98
+ if (!opts.disableKeywordReplacement) {
99
+ // The schema validation needs to be disabled during keyword-preserved export because a field may be enforced as an array but will be expressed with an array replace marker (string).
100
+ await auth0.validate();
101
+ }
102
+ // Allow handlers to process the assets such as loading files etc
103
+ await Promise.all(Object.entries(handlers_1.default).map(async ([name, handler]) => {
104
+ try {
105
+ const parsed = await handler.parse(this);
106
+ Object.entries(parsed).forEach(([k, v]) => {
107
+ this.assets[k] = v;
108
+ });
105
109
  }
106
- // Allow handlers to process the assets such as loading files etc
107
- yield Promise.all(Object.entries(handlers_1.default).map((_a) => __awaiter(this, [_a], void 0, function* ([name, handler]) {
108
- try {
109
- const parsed = yield handler.parse(this);
110
- Object.entries(parsed).forEach(([k, v]) => {
111
- this.assets[k] = v;
112
- });
113
- }
114
- catch (err) {
115
- logger_1.default.debug(err.stack);
116
- throw new Error(`Problem deploying ${name}, ${err}`);
117
- }
118
- })));
119
- });
110
+ catch (err) {
111
+ logger_1.default.debug(err.stack);
112
+ throw new Error(`Problem deploying ${name}, ${err}`);
113
+ }
114
+ }));
120
115
  }
121
- dump() {
122
- return __awaiter(this, void 0, void 0, function* () {
123
- const auth0 = new tools_1.Auth0(this.mgmtClient, this.assets, (0, utils_1.toConfigFn)(this.config));
124
- logger_1.default.info('Loading Auth0 Tenant Data');
116
+ async dump() {
117
+ const auth0 = new tools_1.Auth0(this.mgmtClient, this.assets, (0, utils_1.toConfigFn)(this.config));
118
+ logger_1.default.info('Loading Auth0 Tenant Data');
119
+ try {
120
+ await auth0.loadAssetsFromAuth0();
121
+ const shouldPreserveKeywords =
122
+ //@ts-ignore because the string=>boolean conversion may not have happened if passed-in as env var
123
+ this.config.AUTH0_PRESERVE_KEYWORDS === 'true' ||
124
+ this.config.AUTH0_PRESERVE_KEYWORDS === true;
125
+ if (shouldPreserveKeywords) {
126
+ await this.loadAssetsFromLocal({ disableKeywordReplacement: true }); //Need to disable keyword replacement to retrieve the raw keyword markers (ex: ##KEYWORD##)
127
+ const localAssets = { ...this.assets };
128
+ //@ts-ignore
129
+ delete this['assets'];
130
+ this.assets = (0, keywordPreservation_1.preserveKeywords)({
131
+ localAssets,
132
+ remoteAssets: auth0.assets,
133
+ keywordMappings: this.config.AUTH0_KEYWORD_REPLACE_MAPPINGS || {},
134
+ auth0Handlers: auth0.handlers,
135
+ });
136
+ }
137
+ else {
138
+ this.assets = auth0.assets;
139
+ }
140
+ }
141
+ catch (err) {
142
+ const docUrl = 'https://auth0.com/docs/deploy/deploy-cli-tool/create-and-configure-the-deploy-cli-application#modify-deploy-cli-application-scopes';
143
+ const extraMessage = err.message.startsWith('Insufficient scope')
144
+ ? `\nSee ${docUrl} for more information`
145
+ : '';
146
+ throw new Error(`Problem loading tenant data from Auth0 ${err}${extraMessage}`);
147
+ }
148
+ await Promise.all(Object.entries(handlers_1.default)
149
+ .filter(([handlerName]) => {
150
+ const excludedAssetTypes = this.config.AUTH0_EXCLUDED || [];
151
+ return !excludedAssetTypes.includes(handlerName);
152
+ })
153
+ .filter((0, __1.filterOnlyIncludedResourceTypes)(this.config.AUTH0_INCLUDED_ONLY))
154
+ .map(async ([name, handler]) => {
125
155
  try {
126
- yield auth0.loadAssetsFromAuth0();
127
- const shouldPreserveKeywords =
128
- //@ts-ignore because the string=>boolean conversion may not have happened if passed-in as env var
129
- this.config.AUTH0_PRESERVE_KEYWORDS === 'true' ||
130
- this.config.AUTH0_PRESERVE_KEYWORDS === true;
131
- if (shouldPreserveKeywords) {
132
- yield this.loadAssetsFromLocal({ disableKeywordReplacement: true }); //Need to disable keyword replacement to retrieve the raw keyword markers (ex: ##KEYWORD##)
133
- const localAssets = Object.assign({}, this.assets);
134
- //@ts-ignore
135
- delete this['assets'];
136
- this.assets = (0, keywordPreservation_1.preserveKeywords)({
137
- localAssets,
138
- remoteAssets: auth0.assets,
139
- keywordMappings: this.config.AUTH0_KEYWORD_REPLACE_MAPPINGS || {},
140
- auth0Handlers: auth0.handlers,
156
+ const data = await handler.dump(this);
157
+ if (data) {
158
+ if (data[name] !== null)
159
+ logger_1.default.info(`Exporting ${name}`);
160
+ Object.entries(data).forEach(([k, v]) => {
161
+ this.assets[k] = Array.isArray(v)
162
+ ? v.map(utils_1.formatResults).sort(utils_1.recordsSorter)
163
+ : (0, utils_1.formatResults)(v);
141
164
  });
142
165
  }
143
- else {
144
- this.assets = auth0.assets;
145
- }
146
166
  }
147
167
  catch (err) {
148
- const docUrl = 'https://auth0.com/docs/deploy/deploy-cli-tool/create-and-configure-the-deploy-cli-application#modify-deploy-cli-application-scopes';
149
- const extraMessage = err.message.startsWith('Insufficient scope')
150
- ? `\nSee ${docUrl} for more information`
151
- : '';
152
- throw new Error(`Problem loading tenant data from Auth0 ${err}${extraMessage}`);
168
+ logger_1.default.debug(err.stack);
169
+ throw new Error(`Problem exporting ${name}`);
153
170
  }
154
- yield Promise.all(Object.entries(handlers_1.default)
155
- .filter(([handlerName]) => {
156
- const excludedAssetTypes = this.config.AUTH0_EXCLUDED || [];
157
- return !excludedAssetTypes.includes(handlerName);
158
- })
159
- .filter((0, __1.filterOnlyIncludedResourceTypes)(this.config.AUTH0_INCLUDED_ONLY))
160
- .map((_a) => __awaiter(this, [_a], void 0, function* ([name, handler]) {
161
- try {
162
- const data = yield handler.dump(this);
163
- if (data) {
164
- if (data[name] !== null)
165
- logger_1.default.info(`Exporting ${name}`);
166
- Object.entries(data).forEach(([k, v]) => {
167
- this.assets[k] = Array.isArray(v)
168
- ? v.map(utils_1.formatResults).sort(utils_1.recordsSorter)
169
- : (0, utils_1.formatResults)(v);
170
- });
171
- }
172
- }
173
- catch (err) {
174
- logger_1.default.debug(err.stack);
175
- throw new Error(`Problem exporting ${name}`);
176
- }
177
- })));
178
- // Clean known read only fields
179
- let cleaned = (0, readonly_1.default)(this.assets, this.config);
180
- // Delete exclude as it's not part of the auth0 tenant config
181
- delete cleaned.exclude;
182
- // Optionally Strip identifiers
183
- if (!this.config.AUTH0_EXPORT_IDENTIFIERS) {
184
- cleaned = (0, utils_1.stripIdentifiers)(auth0, cleaned);
185
- }
186
- // Write YAML File
187
- const raw = js_yaml_1.default.dump(cleaned);
188
- logger_1.default.info(`Writing ${this.configFile}`);
189
- fs_extra_1.default.writeFileSync(this.configFile, raw);
190
- });
171
+ }));
172
+ // Clean known read only fields
173
+ let cleaned = (0, readonly_1.default)(this.assets, this.config);
174
+ // Delete exclude as it's not part of the auth0 tenant config
175
+ delete cleaned.exclude;
176
+ // Optionally Strip identifiers
177
+ if (!this.config.AUTH0_EXPORT_IDENTIFIERS) {
178
+ cleaned = (0, utils_1.stripIdentifiers)(auth0, cleaned);
179
+ }
180
+ // Write YAML File
181
+ const raw = js_yaml_1.default.dump(cleaned);
182
+ logger_1.default.info(`Writing ${this.configFile}`);
183
+ fs_extra_1.default.writeFileSync(this.configFile, raw);
191
184
  }
192
185
  }
193
186
  exports.default = YAMLContext;
194
- //# sourceMappingURL=index.js.map
package/lib/index.d.ts CHANGED
@@ -1,106 +1,14 @@
1
1
  #!/usr/bin/env node
2
+ import tools from './tools';
2
3
  import importCMD from './commands/import';
3
4
  import exportCMD from './commands/export';
4
- declare const _default: {
5
+ declare const cliCommands: {
5
6
  deploy: typeof importCMD;
6
7
  dump: typeof exportCMD;
7
8
  import: typeof importCMD;
8
9
  export: typeof exportCMD;
9
- tools: {
10
- constants: {
11
- CONCURRENT_CALLS: number;
12
- RULES_DIRECTORY: string;
13
- RULES_STAGES: string[];
14
- DEFAULT_RULE_STAGE: string;
15
- HOOKS_HIDDEN_SECRET_VALUE: string;
16
- OBFUSCATED_SECRET_VALUE: string;
17
- HOOKS_DIRECTORY: string;
18
- ACTIONS_DIRECTORY: string;
19
- TRIGGERS_DIRECTORY: string;
20
- RULES_CONFIGS_DIRECTORY: string;
21
- PAGES_DIRECTORY: string;
22
- PAGE_LOGIN: string;
23
- PAGE_GUARDIAN_MULTIFACTOR: string;
24
- PAGE_PASSWORD_RESET: string;
25
- PAGE_ERROR: string;
26
- DATABASE_CONNECTIONS_DIRECTORY: string;
27
- DATABASE_SCRIPTS_CHANGE_EMAIL: string;
28
- DATABASE_SCRIPTS_GET_USER: string;
29
- EMAIL_TEMPLATES_TYPES: import("auth0").GetEmailTemplatesByTemplateNameTemplateNameEnum[];
30
- ACTIONS_TRIGGERS: string[];
31
- EMAIL_TEMPLATES_DIRECTORY: string;
32
- EMAIL_VERIFY: string;
33
- EMAIL_VERIFY_BY_CODE: string;
34
- EMAIL_RESET: string;
35
- EMAIL_RESET_BY_CODE: string;
36
- EMAIL_WELCOME: string;
37
- EMAIL_BLOCKED: string;
38
- EMAIL_STOLEN_CREDENTIALS: string;
39
- EMAIL_ENROLLMENT: string;
40
- EMAIL_CHANGE_PASSWORD: string;
41
- EMAIL_PASSWORD_RESET: string;
42
- EMAIL_MFA_OOB_CODE: string;
43
- EMAIL_USER_INVITATION: string;
44
- EMAIL_ASYNC_APPROVAL: string;
45
- GUARDIAN_DIRECTORY: string;
46
- GUARDIAN_FACTORS_DIRECTORY: string;
47
- GUARDIAN_PROVIDERS_DIRECTORY: string;
48
- GUARDIAN_TEMPLATES_DIRECTORY: string;
49
- UNIVERSAL_LOGIN_TEMPLATE: string;
50
- RESOURCE_SERVERS_DIRECTORY: string;
51
- RESOURCE_SERVERS_CLIENT_NAME: string;
52
- RESOURCE_SERVERS_MANAGEMENT_API_NAME: string;
53
- RESOURCE_SERVERS_ID_NAME: string;
54
- CLIENTS_DIRECTORY: string;
55
- CLIENTS_GRANTS_DIRECTORY: string;
56
- BRANDING_DIRECTORY: string;
57
- PHONE_PROVIDER_DIRECTORY: string;
58
- BRANDING_TEMPLATES_DIRECTORY: string;
59
- BRANDING_TEMPLATES_YAML_DIRECTORY: string;
60
- CLIENTS_CLIENT_NAME: string;
61
- CLIENTS_CLIENT_ID_NAME: string;
62
- CONNECTIONS_DIRECTORY: string;
63
- CONNECTIONS_CLIENT_NAME: string;
64
- CONNECTIONS_ID_NAME: string;
65
- ROLES_DIRECTORY: string;
66
- ATTACK_PROTECTION_DIRECTORY: string;
67
- GUARDIAN_FACTORS: string[];
68
- GUARDIAN_POLICIES: string[];
69
- GUARDIAN_PHONE_PROVIDERS: string[];
70
- GUARDIAN_PHONE_MESSAGE_TYPES: string[];
71
- GUARDIAN_FACTOR_TEMPLATES: string[];
72
- GUARDIAN_FACTOR_PROVIDERS: {
73
- sms: string[];
74
- 'push-notification': string[];
75
- };
76
- PAGE_NAMES: string[];
77
- DATABASE_SCRIPTS: string[];
78
- DATABASE_SCRIPTS_NO_IMPORT: string[];
79
- DATABASE_SCRIPTS_IMPORT: string[];
80
- EMAIL_TEMPLATES_NAMES: string[];
81
- SUPPORTED_BRANDING_TEMPLATES: string[];
82
- LOG_STREAMS_DIRECTORY: string;
83
- PROMPTS_DIRECTORY: string;
84
- PROMPTS_SCREEN_RENDER_DIRECTORY: string;
85
- PARTIALS_DIRECTORY: string;
86
- CUSTOM_DOMAINS_DIRECTORY: string;
87
- THEMES_DIRECTORY: string;
88
- CONNECTION_APP_ID: string[];
89
- FORMS_DIRECTORY: string;
90
- FLOWS_DIRECTORY: string;
91
- FLOWS_VAULT_DIRECTORY: string;
92
- SELF_SERVICE_PROFILE_DIRECTORY: string;
93
- NETWORK_ACLS_DIRECTORY: string;
94
- USER_ATTRIBUTE_PROFILES_DIRECTORY: string;
95
- CONNECTION_PROFILES_DIRECTORY: string;
96
- };
97
- deploy: typeof import("./tools").deploy;
98
- keywordReplace: typeof import("./tools").keywordReplace;
99
- loadFileAndReplaceKeywords: typeof import("./tools").loadFileAndReplaceKeywords;
100
- wrapArrayReplaceMarkersInQuotes: typeof import("./tools").wrapArrayReplaceMarkersInQuotes;
101
- Auth0: typeof import("./tools").Auth0;
102
- };
10
+ tools: typeof tools;
103
11
  };
104
- export default _default;
12
+ export default cliCommands;
105
13
  export declare const dump: typeof exportCMD;
106
14
  export declare const deploy: typeof importCMD;
package/lib/index.js CHANGED
@@ -1,14 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
- return new (P || (P = Promise))(function (resolve, reject) {
6
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
- step((generator = generator.apply(thisArg, _arguments || [])).next());
10
- });
11
- };
12
3
  var __importDefault = (this && this.__importDefault) || function (mod) {
13
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
14
5
  };
@@ -21,30 +12,28 @@ const logger_1 = __importDefault(require("./logger"));
21
12
  const tools_1 = __importDefault(require("./tools"));
22
13
  const import_1 = __importDefault(require("./commands/import"));
23
14
  const export_1 = __importDefault(require("./commands/export"));
24
- function run(params) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- // Run command
27
- const command = params._[0];
28
- const proxy = params.proxy_url;
29
- if (proxy) {
30
- const MAJOR_NODEJS_VERSION = parseInt(process.version.slice(1).split('.')[0], 10);
31
- if (MAJOR_NODEJS_VERSION < 10) {
32
- throw new Error('The --proxy_url option is only supported on Node >= 10');
33
- }
34
- process.env.HTTP_PROXY = proxy;
35
- logger_1.default.debug(`Setting proxy to ${proxy}`);
36
- // moving from `global-agent` to undici due to update on SDK 4.x.x
37
- (0, undici_1.setGlobalDispatcher)(new undici_1.ProxyAgent(process.env.HTTP_PROXY));
38
- }
39
- logger_1.default.debug(`Start command ${command}`);
40
- if (['deploy', 'import'].includes(command) && 'input_file' in params) {
41
- yield (0, import_1.default)(params);
42
- }
43
- if (['dump', 'export'].includes(command) && 'output_folder' in params) {
44
- yield (0, export_1.default)(params);
15
+ async function run(params) {
16
+ // Run command
17
+ const command = params._[0];
18
+ const proxy = params.proxy_url;
19
+ if (proxy) {
20
+ const MAJOR_NODEJS_VERSION = parseInt(process.version.slice(1).split('.')[0], 10);
21
+ if (MAJOR_NODEJS_VERSION < 10) {
22
+ throw new Error('The --proxy_url option is only supported on Node >= 10');
45
23
  }
46
- logger_1.default.debug(`Finished command ${command}`);
47
- });
24
+ process.env.HTTP_PROXY = proxy;
25
+ logger_1.default.debug(`Setting proxy to ${proxy}`);
26
+ // moving from `global-agent` to undici due to update on SDK 4.x.x
27
+ (0, undici_1.setGlobalDispatcher)(new undici_1.ProxyAgent(process.env.HTTP_PROXY));
28
+ }
29
+ logger_1.default.debug(`Start command ${command}`);
30
+ if (['deploy', 'import'].includes(command) && 'input_file' in params) {
31
+ await (0, import_1.default)(params);
32
+ }
33
+ if (['dump', 'export'].includes(command) && 'output_folder' in params) {
34
+ await (0, export_1.default)(params);
35
+ }
36
+ logger_1.default.debug(`Finished command ${command}`);
48
37
  }
49
38
  // Only run if from command line
50
39
  if (require.main === module) {
@@ -79,13 +68,14 @@ if (require.main === module) {
79
68
  });
80
69
  }
81
70
  // Export commands to be used programmatically
82
- exports.default = {
71
+ // Explicit type to avoid non-portable type inference
72
+ const cliCommands = {
83
73
  deploy: import_1.default,
84
74
  dump: export_1.default,
85
75
  import: import_1.default,
86
76
  export: export_1.default,
87
77
  tools: tools_1.default,
88
78
  };
79
+ exports.default = cliCommands;
89
80
  exports.dump = export_1.default;
90
81
  exports.deploy = import_1.default;
91
- //# sourceMappingURL=index.js.map