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
@@ -38,22 +38,13 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  return result;
39
39
  };
40
40
  })();
41
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
42
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
43
- return new (P || (P = Promise))(function (resolve, reject) {
44
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
45
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
46
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
47
- step((generator = generator.apply(thisArg, _arguments || [])).next());
48
- });
49
- };
50
41
  var __importDefault = (this && this.__importDefault) || function (mod) {
51
42
  return (mod && mod.__esModule) ? mod : { "default": mod };
52
43
  };
53
44
  Object.defineProperty(exports, "__esModule", { value: true });
54
45
  exports.processConnectionEnabledClients = exports.updateConnectionEnabledClients = exports.getConnectionEnabledClients = exports.addExcludedConnectionPropertiesToChanges = exports.schema = void 0;
55
46
  const dot_prop_1 = __importDefault(require("dot-prop"));
56
- const lodash_1 = __importDefault(require("lodash"));
47
+ const lodash_1 = require("lodash");
57
48
  const auth0_1 = require("auth0");
58
49
  const default_1 = __importStar(require("./default"));
59
50
  const utils_1 = require("../../utils");
@@ -111,14 +102,13 @@ exports.schema = {
111
102
  // This use case is common because organizations may not want to expose sensitive connection details, but want to preserve them in the tenant.
112
103
  // exported only for unit testing purposes
113
104
  const addExcludedConnectionPropertiesToChanges = ({ proposedChanges, existingConnections, config, }) => {
114
- var _a, _b;
115
105
  if (proposedChanges.update.length === 0)
116
106
  return proposedChanges;
117
- //@ts-ignore because this expects a parameter to be passed
118
- const excludedFields = ((_b = (_a = config()) === null || _a === void 0 ? void 0 : _a.EXCLUDED_PROPS) === null || _b === void 0 ? void 0 : _b.connections) || [];
107
+ // @ts-ignore because this expects a parameter to be passed
108
+ const excludedFields = config()?.EXCLUDED_PROPS?.connections || [];
119
109
  if (excludedFields.length === 0)
120
110
  return proposedChanges;
121
- const existingConnectionsMap = lodash_1.default.keyBy(existingConnections, 'id');
111
+ const existingConnectionsMap = (0, lodash_1.keyBy)(existingConnections, 'id');
122
112
  const excludedOptions = excludedFields.filter(
123
113
  // Only include fields that pertain to options
124
114
  (excludedField) => excludedField.startsWith('options'));
@@ -133,9 +123,18 @@ const addExcludedConnectionPropertiesToChanges = ({ proposedChanges, existingCon
133
123
  }, {
134
124
  options: {},
135
125
  });
136
- return Object.assign(Object.assign({}, proposedConnection), { options: Object.assign(Object.assign({}, proposedConnection.options), currentExcludedPropertyValues.options) });
126
+ return {
127
+ ...proposedConnection,
128
+ options: {
129
+ ...proposedConnection.options,
130
+ ...currentExcludedPropertyValues.options,
131
+ },
132
+ };
137
133
  });
138
- return Object.assign(Object.assign({}, proposedChanges), { update: newProposedUpdates });
134
+ return {
135
+ ...proposedChanges,
136
+ update: newProposedUpdates,
137
+ };
139
138
  };
140
139
  exports.addExcludedConnectionPropertiesToChanges = addExcludedConnectionPropertiesToChanges;
141
140
  /**
@@ -144,32 +143,28 @@ exports.addExcludedConnectionPropertiesToChanges = addExcludedConnectionProperti
144
143
  * @param connectionId - The unique identifier of the connection to fetch enabled clients for
145
144
  * @returns A promise that resolves to an array of client IDs, or null if connectionId is empty or an error occurs
146
145
  */
147
- const getConnectionEnabledClients = (auth0Client, connectionId) => __awaiter(void 0, void 0, void 0, function* () {
146
+ const getConnectionEnabledClients = async (auth0Client, connectionId) => {
148
147
  if (!connectionId)
149
148
  return null;
150
149
  try {
151
150
  const enabledClientsFormatted = [];
152
- let from;
153
- let hasMore = true;
154
- while (hasMore) {
155
- const response = yield auth0Client.connections.getEnabledClients(Object.assign({ id: connectionId, take: 50 }, (from && { from })));
156
- const { clients: enabledClients, next } = (response === null || response === void 0 ? void 0 : response.data) || {};
157
- if (enabledClients === null || enabledClients === void 0 ? void 0 : enabledClients.length) {
158
- enabledClients.forEach((client) => {
159
- if (client === null || client === void 0 ? void 0 : client.client_id) {
151
+ let enabledClients = await auth0Client.connections.clients.get(connectionId);
152
+ do {
153
+ if (enabledClients && enabledClients.data?.length > 0) {
154
+ enabledClients.data.forEach((client) => {
155
+ if (client?.client_id) {
160
156
  enabledClientsFormatted.push(client.client_id);
161
157
  }
162
158
  });
163
159
  }
164
- hasMore = !!next;
165
- from = next;
166
- }
160
+ enabledClients = await enabledClients.getNextPage();
161
+ } while (enabledClients.hasNextPage());
167
162
  return enabledClientsFormatted;
168
163
  }
169
164
  catch (error) {
170
165
  return null;
171
166
  }
172
- });
167
+ };
173
168
  exports.getConnectionEnabledClients = getConnectionEnabledClients;
174
169
  /**
175
170
  * Updates the enabled clients for a specific Auth0 connection.
@@ -181,18 +176,16 @@ exports.getConnectionEnabledClients = getConnectionEnabledClients;
181
176
  * @returns Promise that resolves to true if the update was successful, false otherwise
182
177
  *
183
178
  */
184
- const updateConnectionEnabledClients = (auth0Client, typeName, connectionId, enabledClientIds) => __awaiter(void 0, void 0, void 0, function* () {
179
+ const updateConnectionEnabledClients = async (auth0Client, typeName, connectionId, enabledClientIds) => {
185
180
  if (!connectionId || !Array.isArray(enabledClientIds) || !enabledClientIds.length)
186
181
  return false;
187
182
  const enabledClientUpdatePayloads = enabledClientIds.map((clientId) => ({
188
183
  client_id: clientId,
189
184
  status: true,
190
185
  }));
191
- const payloadChunks = lodash_1.default.chunk(enabledClientUpdatePayloads, 50);
186
+ const payloadChunks = (0, lodash_1.chunk)(enabledClientUpdatePayloads, 50);
192
187
  try {
193
- yield Promise.all(payloadChunks.map((payload) => auth0Client.connections.updateEnabledClients({
194
- id: connectionId,
195
- }, payload)));
188
+ await Promise.all(payloadChunks.map((payload) => auth0Client.connections.clients.update(connectionId, payload)));
196
189
  logger_1.default.debug(`Updated enabled clients for ${typeName}: ${connectionId}`);
197
190
  return true;
198
191
  }
@@ -200,7 +193,7 @@ const updateConnectionEnabledClients = (auth0Client, typeName, connectionId, ena
200
193
  logger_1.default.error(`Unable to update enabled clients for ${typeName}: ${connectionId}:`, error);
201
194
  return false;
202
195
  }
203
- });
196
+ };
204
197
  exports.updateConnectionEnabledClients = updateConnectionEnabledClients;
205
198
  /**
206
199
  * This function processes enabled clients for create, update, and conflict operations.
@@ -213,60 +206,64 @@ exports.updateConnectionEnabledClients = updateConnectionEnabledClients;
213
206
  *
214
207
  * @returns A Promise that resolves when all enabled client updates are complete
215
208
  */
216
- const processConnectionEnabledClients = (auth0Client_1, typeName_1, changes_1, ...args_1) => __awaiter(void 0, [auth0Client_1, typeName_1, changes_1, ...args_1], void 0, function* (auth0Client, typeName, changes, delayMs = 2500 // Default delay is 2.5 seconds
217
- ) {
209
+ const processConnectionEnabledClients = async (auth0Client, typeName, changes, delayMs = 2500 // Default delay is 2.5 seconds
210
+ ) => {
218
211
  const { create, update, conflicts } = changes;
219
212
  let createWithId = [];
220
213
  if (create.length) {
221
- yield (0, utils_1.sleep)(delayMs); // Wait for the configured duration before fetching new connections
222
- createWithId = yield Promise.all(create.map((conn) => __awaiter(void 0, void 0, void 0, function* () {
223
- var _a;
214
+ await (0, utils_1.sleep)(delayMs); // Wait for the configured duration before fetching new connections
215
+ createWithId = await Promise.all(create.map(async (conn) => {
224
216
  let newConnections;
225
217
  if (typeName === 'database') {
226
- const { data: { connections }, } = yield auth0Client.connections.getAll({
218
+ const { data: connections } = await auth0Client.connections.list({
227
219
  name: conn.name,
228
220
  take: 1,
229
- strategy: [auth0_1.GetConnectionsStrategyEnum.auth0],
230
- include_totals: true,
221
+ strategy: [auth0_1.Management.ConnectionStrategyEnum.Auth0],
222
+ include_fields: true,
231
223
  });
232
224
  newConnections = connections;
233
225
  }
234
226
  else {
235
- const { data: { connections }, } = yield auth0Client.connections.getAll({
227
+ const { data: connections } = await auth0Client.connections.list({
236
228
  name: conn.name,
237
229
  take: 1,
238
- include_totals: true,
230
+ include_fields: true,
239
231
  });
240
232
  newConnections = connections;
241
233
  }
242
234
  if (newConnections && newConnections.length) {
243
- conn.id = (_a = newConnections[0]) === null || _a === void 0 ? void 0 : _a.id;
235
+ conn.id = newConnections[0]?.id;
244
236
  }
245
237
  else {
246
238
  logger_1.default.warn(`Unable to find ID for newly created ${typeName} '${conn.name}' when updating enabled clients`);
247
239
  }
248
240
  return conn;
249
- })));
241
+ }));
250
242
  }
251
243
  // Process enabled clients for each change type
252
244
  // Delete is handled by the `processChanges` method, removed connection completely
253
- yield Promise.all([
245
+ await Promise.all([
254
246
  ...createWithId.map((conn) => (0, exports.updateConnectionEnabledClients)(auth0Client, typeName, conn.id, conn.enabled_clients)),
255
247
  ...update.map((conn) => (0, exports.updateConnectionEnabledClients)(auth0Client, typeName, conn.id, conn.enabled_clients)),
256
248
  ...conflicts.map((conn) => (0, exports.updateConnectionEnabledClients)(auth0Client, typeName, conn.id, conn.enabled_clients)),
257
249
  ]);
258
- });
250
+ };
259
251
  exports.processConnectionEnabledClients = processConnectionEnabledClients;
260
252
  class ConnectionsHandler extends default_1.default {
261
253
  constructor(config) {
262
- super(Object.assign(Object.assign({}, config), { type: 'connections', stripUpdateFields: ['strategy', 'name'], functions: {
254
+ super({
255
+ ...config,
256
+ type: 'connections',
257
+ stripUpdateFields: ['strategy', 'name'],
258
+ functions: {
263
259
  // When `connections` is updated, it can result in `update`,`create` or `delete` action on SCIM.
264
260
  // Because, `scim_configuration` is inside `connections`.
265
- update: (requestParams, bodyParams) => __awaiter(this, void 0, void 0, function* () { return yield this.scimHandler.updateOverride(requestParams, bodyParams); }),
261
+ update: async (requestParams, bodyParams) => this.scimHandler.updateOverride(requestParams, bodyParams),
266
262
  // When a new `connection` is created. We can perform only `create` option on SCIM.
267
263
  // When a connection is `deleted`. `scim_configuration` is also deleted along with it; no action on SCIM is required.
268
- create: (bodyParams) => __awaiter(this, void 0, void 0, function* () { return yield this.scimHandler.createOverride(bodyParams); }),
269
- } }));
264
+ create: async (bodyParams) => this.scimHandler.createOverride(bodyParams),
265
+ },
266
+ });
270
267
  // @ts-ignore
271
268
  this.scimHandler = new scimHandler_1.default(this.config, this.client.connections, this.client.pool);
272
269
  }
@@ -276,104 +273,102 @@ class ConnectionsHandler extends default_1.default {
276
273
  getFormattedOptions(connection, clients) {
277
274
  try {
278
275
  return {
279
- options: Object.assign(Object.assign({}, connection.options), { idpinitiated: Object.assign(Object.assign({}, connection.options.idpinitiated), { client_id: (0, utils_1.convertClientNameToId)(connection.options.idpinitiated.client_id, clients) }) }),
276
+ options: {
277
+ ...connection.options,
278
+ idpinitiated: {
279
+ ...connection.options.idpinitiated,
280
+ client_id: (0, utils_1.convertClientNameToId)(connection.options.idpinitiated.client_id, clients),
281
+ },
282
+ },
280
283
  };
281
284
  }
282
285
  catch (e) {
283
286
  return {};
284
287
  }
285
288
  }
286
- getType() {
287
- return __awaiter(this, void 0, void 0, function* () {
288
- if (this.existing)
289
- return this.existing;
290
- const connections = yield (0, client_1.paginate)(this.client.connections.getAll, {
291
- checkpoint: true,
292
- include_totals: true,
293
- });
294
- // Filter out database connections as we have separate handler for it
295
- const filteredConnections = connections.filter((c) => c.strategy !== 'auth0');
296
- // If options option is empty for all connection, log the missing options scope.
297
- const isOptionExists = filteredConnections.every((c) => c.options && Object.keys(c.options).length > 0);
298
- if (!isOptionExists) {
299
- logger_1.default.warn(`Insufficient scope the read:connections_options scope is required to get ${this.type} options.`);
300
- }
301
- this.existing = filteredConnections;
302
- if (this.existing === null)
303
- return [];
304
- const connectionsWithEnabledClients = yield Promise.all(filteredConnections.map((con) => __awaiter(this, void 0, void 0, function* () {
305
- const enabledClients = yield (0, exports.getConnectionEnabledClients)(this.client, con.id);
306
- if (enabledClients && (enabledClients === null || enabledClients === void 0 ? void 0 : enabledClients.length)) {
307
- return Object.assign(Object.assign({}, con), { enabled_clients: enabledClients });
308
- }
309
- return con;
310
- })));
311
- this.existing = connectionsWithEnabledClients;
312
- // Apply `scim_configuration` to all the relevant `SCIM` connections. This method mutates `this.existing`.
313
- yield this.scimHandler.applyScimConfiguration(this.existing);
289
+ async getType() {
290
+ if (this.existing)
314
291
  return this.existing;
292
+ const connections = await (0, client_1.paginate)(this.client.connections.list, {
293
+ checkpoint: true,
315
294
  });
295
+ // Filter out database connections as we have separate handler for it
296
+ const filteredConnections = connections.filter((c) => c.strategy !== 'auth0');
297
+ // If options option is empty for all connection, log the missing options scope.
298
+ const isOptionExists = filteredConnections.every((c) => c.options && Object.keys(c.options).length > 0);
299
+ if (!isOptionExists) {
300
+ logger_1.default.warn(`Insufficient scope the read:connections_options scope is required to get ${this.type} options.`);
301
+ }
302
+ this.existing = filteredConnections;
303
+ if (this.existing === null)
304
+ return [];
305
+ const connectionsWithEnabledClients = await Promise.all(filteredConnections.map(async (con) => {
306
+ if (!con?.id)
307
+ return con;
308
+ const enabledClients = await (0, exports.getConnectionEnabledClients)(this.client, con.id);
309
+ if (enabledClients && enabledClients?.length) {
310
+ return { ...con, enabled_clients: enabledClients };
311
+ }
312
+ return con;
313
+ }));
314
+ this.existing = connectionsWithEnabledClients;
315
+ // Apply `scim_configuration` to all the relevant `SCIM` connections. This method mutates `this.existing`.
316
+ await this.scimHandler.applyScimConfiguration(this.existing);
317
+ return this.existing;
316
318
  }
317
- calcChanges(assets) {
318
- const _super = Object.create(null, {
319
- calcChanges: { get: () => super.calcChanges }
319
+ async calcChanges(assets) {
320
+ const { connections } = assets;
321
+ // Do nothing if not set
322
+ if (!connections)
323
+ return {
324
+ del: [],
325
+ create: [],
326
+ update: [],
327
+ conflicts: [],
328
+ };
329
+ // Convert enabled_clients by name to the id
330
+ const clients = await (0, client_1.paginate)(this.client.clients.list, {
331
+ paginate: true,
332
+ include_totals: true,
320
333
  });
321
- return __awaiter(this, void 0, void 0, function* () {
322
- const { connections } = assets;
323
- // Do nothing if not set
324
- if (!connections)
325
- return {
326
- del: [],
327
- create: [],
328
- update: [],
329
- conflicts: [],
330
- };
331
- // Convert enabled_clients by name to the id
332
- const clients = yield (0, client_1.paginate)(this.client.clients.getAll, {
333
- paginate: true,
334
- include_totals: true,
335
- });
336
- const existingConnections = yield (0, client_1.paginate)(this.client.connections.getAll, {
337
- checkpoint: true,
338
- include_totals: true,
339
- });
340
- // Prepare an id map. We'll use this map later to get the `strategy` and SCIM enable status of the connections.
341
- yield this.scimHandler.createIdMap(existingConnections);
342
- const formatted = connections.map((connection) => (Object.assign(Object.assign(Object.assign({}, connection), this.getFormattedOptions(connection, clients)), { enabled_clients: (0, utils_1.getEnabledClients)(assets, connection, existingConnections, clients) })));
343
- const proposedChanges = yield _super.calcChanges.call(this, Object.assign(Object.assign({}, assets), { connections: formatted }));
344
- const proposedChangesWithExcludedProperties = (0, exports.addExcludedConnectionPropertiesToChanges)({
345
- proposedChanges,
346
- existingConnections,
347
- config: this.config,
348
- });
349
- return proposedChangesWithExcludedProperties;
334
+ const existingConnections = await (0, client_1.paginate)(this.client.connections.list, {
335
+ checkpoint: true,
336
+ include_totals: true,
350
337
  });
338
+ // Prepare an id map. We'll use this map later to get the `strategy` and SCIM enable status of the connections.
339
+ await this.scimHandler.createIdMap(existingConnections);
340
+ const formatted = connections.map((connection) => ({
341
+ ...connection,
342
+ ...this.getFormattedOptions(connection, clients),
343
+ enabled_clients: (0, utils_1.getEnabledClients)(assets, connection, existingConnections, clients),
344
+ }));
345
+ const proposedChanges = await super.calcChanges({ ...assets, connections: formatted });
346
+ const proposedChangesWithExcludedProperties = (0, exports.addExcludedConnectionPropertiesToChanges)({
347
+ proposedChanges,
348
+ existingConnections,
349
+ config: this.config,
350
+ });
351
+ return proposedChangesWithExcludedProperties;
351
352
  }
352
353
  // Run after clients are updated so we can convert all the enabled_clients names to id's
353
- processChanges(assets) {
354
- const _super = Object.create(null, {
355
- processChanges: { get: () => super.processChanges }
356
- });
357
- return __awaiter(this, void 0, void 0, function* () {
358
- const { connections } = assets;
359
- // Do nothing if not set
360
- if (!connections)
361
- return;
362
- // If options option is empty for all connection, log the missing options scope.
363
- const isOptionExists = connections.every((c) => c.options && Object.keys(c.options).length > 0);
364
- if (!isOptionExists) {
365
- logger_1.default.warn(`Insufficient scope the update:connections_options scope is required to update ${this.type} options.`);
366
- }
367
- const excludedConnections = (assets.exclude && assets.exclude.connections) || [];
368
- const changes = yield this.calcChanges(assets);
369
- yield _super.processChanges.call(this, assets, (0, utils_1.filterExcluded)(changes, excludedConnections));
370
- // process enabled clients
371
- yield (0, exports.processConnectionEnabledClients)(this.client, this.type, (0, utils_1.filterExcluded)(changes, excludedConnections));
372
- });
354
+ async processChanges(assets) {
355
+ const { connections } = assets;
356
+ // Do nothing if not set
357
+ if (!connections)
358
+ return;
359
+ // If options option is empty for all connection, log the missing options scope.
360
+ const isOptionExists = connections.every((c) => c.options && Object.keys(c.options).length > 0);
361
+ if (!isOptionExists) {
362
+ logger_1.default.warn(`Insufficient scope the update:connections_options scope is required to update ${this.type} options.`);
363
+ }
364
+ const excludedConnections = (assets.exclude && assets.exclude.connections) || [];
365
+ const changes = await this.calcChanges(assets);
366
+ await super.processChanges(assets, (0, utils_1.filterExcluded)(changes, excludedConnections));
367
+ // process enabled clients
368
+ await (0, exports.processConnectionEnabledClients)(this.client, this.type, (0, utils_1.filterExcluded)(changes, excludedConnections));
373
369
  }
374
370
  }
375
371
  exports.default = ConnectionsHandler;
376
372
  __decorate([
377
373
  (0, default_1.order)('60')
378
374
  ], ConnectionsHandler.prototype, "processChanges", null);
379
- //# sourceMappingURL=connections.js.map
@@ -1,3 +1,4 @@
1
+ import { Management } from 'auth0';
1
2
  import DefaultAPIHandler from './default';
2
3
  import { Asset, Assets } from '../../../types';
3
4
  export declare const schema: {
@@ -50,10 +51,12 @@ export declare const schema: {
50
51
  required: string[];
51
52
  };
52
53
  };
54
+ type CustomDomain = Management.CustomDomain;
53
55
  export default class CustomDomainsHadnler extends DefaultAPIHandler {
54
- existing: Asset[] | null;
56
+ existing: CustomDomain[] | null;
55
57
  constructor(config: DefaultAPIHandler);
56
58
  objString(item: Asset): string;
57
59
  getType(): Promise<Asset | null>;
58
60
  processChanges(assets: Assets): Promise<void>;
59
61
  }
62
+ export {};
@@ -38,15 +38,6 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  return result;
39
39
  };
40
40
  })();
41
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
42
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
43
- return new (P || (P = Promise))(function (resolve, reject) {
44
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
45
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
46
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
47
- step((generator = generator.apply(thisArg, _arguments || [])).next());
48
- });
49
- };
50
41
  var __importDefault = (this && this.__importDefault) || function (mod) {
51
42
  return (mod && mod.__esModule) ? mod : { "default": mod };
52
43
  };
@@ -93,14 +84,20 @@ exports.schema = {
93
84
  };
94
85
  class CustomDomainsHadnler extends default_1.default {
95
86
  constructor(config) {
96
- super(Object.assign(Object.assign({}, config), { type: 'customDomains', id: 'custom_domain_id', identifiers: ['custom_domain_id', 'domain'], stripCreateFields: [
87
+ super({
88
+ ...config,
89
+ type: 'customDomains',
90
+ id: 'custom_domain_id',
91
+ identifiers: ['custom_domain_id', 'domain'],
92
+ stripCreateFields: [
97
93
  'status',
98
94
  'primary',
99
95
  'verification',
100
96
  'certificate',
101
97
  'created_at',
102
98
  'updated_at',
103
- ], stripUpdateFields: [
99
+ ],
100
+ stripUpdateFields: [
104
101
  'status',
105
102
  'primary',
106
103
  'verification',
@@ -110,58 +107,51 @@ class CustomDomainsHadnler extends default_1.default {
110
107
  'certificate',
111
108
  'created_at',
112
109
  'updated_at',
113
- ], functions: {
114
- delete: (args) => this.client.customDomains.delete({ id: args.custom_domain_id }),
115
- update: (args, data) => this.client.customDomains.update({ id: args.custom_domain_id }, data),
116
- } }));
110
+ ],
111
+ functions: {
112
+ update: (args, data) => this.client.customDomains.update(args.custom_domain_id, data),
113
+ },
114
+ });
117
115
  }
118
116
  objString(item) {
119
117
  return super.objString(item.domain);
120
118
  }
121
- getType() {
122
- return __awaiter(this, void 0, void 0, function* () {
123
- try {
124
- if (this.existing) {
125
- return this.existing;
126
- }
127
- const customDomains = yield (0, client_1.paginate)(this.client.customDomains.getAll, {
128
- checkpoint: true,
129
- });
130
- this.existing = customDomains;
131
- return customDomains;
119
+ async getType() {
120
+ try {
121
+ if (this.existing) {
122
+ return this.existing;
132
123
  }
133
- catch (err) {
134
- if (err.statusCode === 403 &&
135
- err.message ===
136
- 'The account is not allowed to perform this operation, please contact our support team') {
137
- return null;
138
- }
139
- throw err;
124
+ const customDomains = await (0, client_1.paginate)(this.client.customDomains.list, {
125
+ checkpoint: true,
126
+ });
127
+ this.existing = customDomains;
128
+ return customDomains;
129
+ }
130
+ catch (err) {
131
+ if (err.statusCode === 403 &&
132
+ err.message ===
133
+ 'The account is not allowed to perform this operation, please contact our support team') {
134
+ return null;
140
135
  }
141
- });
136
+ throw err;
137
+ }
142
138
  }
143
- processChanges(assets) {
144
- const _super = Object.create(null, {
145
- processChanges: { get: () => super.processChanges }
146
- });
147
- return __awaiter(this, void 0, void 0, function* () {
148
- const { customDomains } = assets;
149
- if (!customDomains)
150
- return;
151
- // Deprecation warnings for custom domains
152
- if (customDomains.some((customDomain) => customDomain.primary != null)) {
153
- logger_1.default.warn('The "primary" field is deprecated and may be removed in future versions for "customDomains"');
154
- }
155
- if (customDomains.some((customDomain) => 'verification_method' in customDomain)) {
156
- logger_1.default.warn('The "verification_method" field is deprecated and may be removed in future versions for "customDomains"');
157
- }
158
- const changes = yield this.calcChanges(assets);
159
- yield _super.processChanges.call(this, assets, changes);
160
- });
139
+ async processChanges(assets) {
140
+ const { customDomains } = assets;
141
+ if (!customDomains)
142
+ return;
143
+ // Deprecation warnings for custom domains
144
+ if (customDomains.some((customDomain) => customDomain.primary != null)) {
145
+ logger_1.default.warn('The "primary" field is deprecated and may be removed in future versions for "customDomains"');
146
+ }
147
+ if (customDomains.some((customDomain) => 'verification_method' in customDomain)) {
148
+ logger_1.default.warn('The "verification_method" field is deprecated and may be removed in future versions for "customDomains"');
149
+ }
150
+ const changes = await this.calcChanges(assets);
151
+ await super.processChanges(assets, changes);
161
152
  }
162
153
  }
163
154
  exports.default = CustomDomainsHadnler;
164
155
  __decorate([
165
156
  (0, default_1.order)('50')
166
157
  ], CustomDomainsHadnler.prototype, "processChanges", null);
167
- //# sourceMappingURL=customDomains.js.map