auth0-deploy-cli 8.20.4-beta.0 → 8.21.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 (318) hide show
  1. package/.circleci/config.yml +5 -46
  2. package/.eslintignore +5 -0
  3. package/.eslintrc +69 -0
  4. package/CHANGELOG.md +15 -6
  5. package/lib/args.js +1 -0
  6. package/lib/args.js.map +1 -0
  7. package/lib/commands/export.js +49 -41
  8. package/lib/commands/export.js.map +1 -0
  9. package/lib/commands/import.js +43 -36
  10. package/lib/commands/import.js.map +1 -0
  11. package/lib/commands/index.js +1 -0
  12. package/lib/commands/index.js.map +1 -0
  13. package/lib/configFactory.js +1 -0
  14. package/lib/configFactory.js.map +1 -0
  15. package/lib/context/defaults.js +10 -38
  16. package/lib/context/defaults.js.map +1 -0
  17. package/lib/context/directory/handlers/actions.js +39 -40
  18. package/lib/context/directory/handlers/actions.js.map +1 -0
  19. package/lib/context/directory/handlers/attackProtection.js +34 -22
  20. package/lib/context/directory/handlers/attackProtection.js.map +1 -0
  21. package/lib/context/directory/handlers/branding.js +21 -12
  22. package/lib/context/directory/handlers/branding.js.map +1 -0
  23. package/lib/context/directory/handlers/clientGrants.js +62 -52
  24. package/lib/context/directory/handlers/clientGrants.js.map +1 -0
  25. package/lib/context/directory/handlers/clients.js +60 -17
  26. package/lib/context/directory/handlers/clients.js.map +1 -0
  27. package/lib/context/directory/handlers/connectionProfiles.d.ts +11 -0
  28. package/lib/context/directory/handlers/connectionProfiles.js +59 -0
  29. package/lib/context/directory/handlers/connectionProfiles.js.map +1 -0
  30. package/lib/context/directory/handlers/connections.js +41 -32
  31. package/lib/context/directory/handlers/connections.js.map +1 -0
  32. package/lib/context/directory/handlers/customDomains.js +21 -9
  33. package/lib/context/directory/handlers/customDomains.js.map +1 -0
  34. package/lib/context/directory/handlers/databases.js +35 -37
  35. package/lib/context/directory/handlers/databases.js.map +1 -0
  36. package/lib/context/directory/handlers/emailProvider.js +36 -22
  37. package/lib/context/directory/handlers/emailProvider.js.map +1 -0
  38. package/lib/context/directory/handlers/emailTemplates.js +29 -20
  39. package/lib/context/directory/handlers/emailTemplates.js.map +1 -0
  40. package/lib/context/directory/handlers/flowVaultConnections.js +49 -39
  41. package/lib/context/directory/handlers/flowVaultConnections.js.map +1 -0
  42. package/lib/context/directory/handlers/flows.js +48 -38
  43. package/lib/context/directory/handlers/flows.js.map +1 -0
  44. package/lib/context/directory/handlers/forms.js +48 -38
  45. package/lib/context/directory/handlers/forms.js.map +1 -0
  46. package/lib/context/directory/handlers/guardianFactorProviders.js +21 -9
  47. package/lib/context/directory/handlers/guardianFactorProviders.js.map +1 -0
  48. package/lib/context/directory/handlers/guardianFactorTemplates.js +21 -9
  49. package/lib/context/directory/handlers/guardianFactorTemplates.js.map +1 -0
  50. package/lib/context/directory/handlers/guardianFactors.js +21 -9
  51. package/lib/context/directory/handlers/guardianFactors.js.map +1 -0
  52. package/lib/context/directory/handlers/guardianPhoneFactorMessageTypes.js +20 -8
  53. package/lib/context/directory/handlers/guardianPhoneFactorMessageTypes.js.map +1 -0
  54. package/lib/context/directory/handlers/guardianPhoneFactorSelectedProvider.js +20 -8
  55. package/lib/context/directory/handlers/guardianPhoneFactorSelectedProvider.js.map +1 -0
  56. package/lib/context/directory/handlers/guardianPolicies.js +20 -8
  57. package/lib/context/directory/handlers/guardianPolicies.js.map +1 -0
  58. package/lib/context/directory/handlers/hooks.js +34 -24
  59. package/lib/context/directory/handlers/hooks.js.map +1 -0
  60. package/lib/context/directory/handlers/index.js +3 -0
  61. package/lib/context/directory/handlers/index.js.map +1 -0
  62. package/lib/context/directory/handlers/logStreams.js +24 -12
  63. package/lib/context/directory/handlers/logStreams.js.map +1 -0
  64. package/lib/context/directory/handlers/networkACLs.js +34 -22
  65. package/lib/context/directory/handlers/networkACLs.js.map +1 -0
  66. package/lib/context/directory/handlers/organizations.js +44 -39
  67. package/lib/context/directory/handlers/organizations.js.map +1 -0
  68. package/lib/context/directory/handlers/pages.js +37 -31
  69. package/lib/context/directory/handlers/pages.js.map +1 -0
  70. package/lib/context/directory/handlers/phoneProvider.js +24 -12
  71. package/lib/context/directory/handlers/phoneProvider.js.map +1 -0
  72. package/lib/context/directory/handlers/prompts.js +76 -58
  73. package/lib/context/directory/handlers/prompts.js.map +1 -0
  74. package/lib/context/directory/handlers/resourceServers.d.ts +1 -1
  75. package/lib/context/directory/handlers/resourceServers.js +30 -18
  76. package/lib/context/directory/handlers/resourceServers.js.map +1 -0
  77. package/lib/context/directory/handlers/roles.js +31 -21
  78. package/lib/context/directory/handlers/roles.js.map +1 -0
  79. package/lib/context/directory/handlers/rules.js +32 -22
  80. package/lib/context/directory/handlers/rules.js.map +1 -0
  81. package/lib/context/directory/handlers/rulesConfigs.js +15 -3
  82. package/lib/context/directory/handlers/rulesConfigs.js.map +1 -0
  83. package/lib/context/directory/handlers/selfServiceProfiles.js +40 -28
  84. package/lib/context/directory/handlers/selfServiceProfiles.js.map +1 -0
  85. package/lib/context/directory/handlers/tenant.js +34 -14
  86. package/lib/context/directory/handlers/tenant.js.map +1 -0
  87. package/lib/context/directory/handlers/themes.js +21 -9
  88. package/lib/context/directory/handlers/themes.js.map +1 -0
  89. package/lib/context/directory/handlers/triggers.d.ts +1 -1
  90. package/lib/context/directory/handlers/triggers.js +26 -16
  91. package/lib/context/directory/handlers/triggers.js.map +1 -0
  92. package/lib/context/directory/handlers/userAttributeProfiles.d.ts +1 -1
  93. package/lib/context/directory/handlers/userAttributeProfiles.js +26 -16
  94. package/lib/context/directory/handlers/userAttributeProfiles.js.map +1 -0
  95. package/lib/context/directory/index.js +80 -66
  96. package/lib/context/directory/index.js.map +1 -0
  97. package/lib/context/index.js +20 -9
  98. package/lib/context/index.js.map +1 -0
  99. package/lib/context/yaml/handlers/actions.js +41 -39
  100. package/lib/context/yaml/handlers/actions.js.map +1 -0
  101. package/lib/context/yaml/handlers/attackProtection.js +41 -27
  102. package/lib/context/yaml/handlers/attackProtection.js.map +1 -0
  103. package/lib/context/yaml/handlers/branding.js +69 -47
  104. package/lib/context/yaml/handlers/branding.js.map +1 -0
  105. package/lib/context/yaml/handlers/clientGrants.js +40 -26
  106. package/lib/context/yaml/handlers/clientGrants.js.map +1 -0
  107. package/lib/context/yaml/handlers/clients.js +85 -41
  108. package/lib/context/yaml/handlers/clients.js.map +1 -0
  109. package/lib/context/yaml/handlers/connectionProfiles.d.ts +11 -0
  110. package/lib/context/yaml/handlers/connectionProfiles.js +44 -0
  111. package/lib/context/yaml/handlers/connectionProfiles.js.map +1 -0
  112. package/lib/context/yaml/handlers/connections.js +67 -63
  113. package/lib/context/yaml/handlers/connections.js.map +1 -0
  114. package/lib/context/yaml/handlers/customDomains.js +19 -7
  115. package/lib/context/yaml/handlers/customDomains.js.map +1 -0
  116. package/lib/context/yaml/handlers/databases.js +65 -63
  117. package/lib/context/yaml/handlers/databases.js.map +1 -0
  118. package/lib/context/yaml/handlers/emailProvider.js +37 -22
  119. package/lib/context/yaml/handlers/emailProvider.js.map +1 -0
  120. package/lib/context/yaml/handlers/emailTemplates.js +39 -28
  121. package/lib/context/yaml/handlers/emailTemplates.js.map +1 -0
  122. package/lib/context/yaml/handlers/flowVaultConnections.js +50 -36
  123. package/lib/context/yaml/handlers/flowVaultConnections.js.map +1 -0
  124. package/lib/context/yaml/handlers/flows.js +66 -55
  125. package/lib/context/yaml/handlers/flows.js.map +1 -0
  126. package/lib/context/yaml/handlers/forms.js +66 -55
  127. package/lib/context/yaml/handlers/forms.js.map +1 -0
  128. package/lib/context/yaml/handlers/guardianFactorProviders.js +19 -7
  129. package/lib/context/yaml/handlers/guardianFactorProviders.js.map +1 -0
  130. package/lib/context/yaml/handlers/guardianFactorTemplates.js +19 -7
  131. package/lib/context/yaml/handlers/guardianFactorTemplates.js.map +1 -0
  132. package/lib/context/yaml/handlers/guardianFactors.js +19 -7
  133. package/lib/context/yaml/handlers/guardianFactors.js.map +1 -0
  134. package/lib/context/yaml/handlers/guardianPhoneFactorMessageTypes.js +19 -7
  135. package/lib/context/yaml/handlers/guardianPhoneFactorMessageTypes.js.map +1 -0
  136. package/lib/context/yaml/handlers/guardianPhoneFactorSelectedProvider.js +19 -7
  137. package/lib/context/yaml/handlers/guardianPhoneFactorSelectedProvider.js.map +1 -0
  138. package/lib/context/yaml/handlers/guardianPolicies.js +19 -7
  139. package/lib/context/yaml/handlers/guardianPolicies.js.map +1 -0
  140. package/lib/context/yaml/handlers/hooks.js +48 -34
  141. package/lib/context/yaml/handlers/hooks.js.map +1 -0
  142. package/lib/context/yaml/handlers/index.js +3 -0
  143. package/lib/context/yaml/handlers/index.js.map +1 -0
  144. package/lib/context/yaml/handlers/logStreams.js +30 -16
  145. package/lib/context/yaml/handlers/logStreams.js.map +1 -0
  146. package/lib/context/yaml/handlers/networkACLs.js +39 -25
  147. package/lib/context/yaml/handlers/networkACLs.js.map +1 -0
  148. package/lib/context/yaml/handlers/organizations.js +46 -37
  149. package/lib/context/yaml/handlers/organizations.js.map +1 -0
  150. package/lib/context/yaml/handlers/pages.js +39 -31
  151. package/lib/context/yaml/handlers/pages.js.map +1 -0
  152. package/lib/context/yaml/handlers/phoneProvider.js +31 -17
  153. package/lib/context/yaml/handlers/phoneProvider.js.map +1 -0
  154. package/lib/context/yaml/handlers/prompts.js +47 -22
  155. package/lib/context/yaml/handlers/prompts.js.map +1 -0
  156. package/lib/context/yaml/handlers/resourceServers.d.ts +1 -1
  157. package/lib/context/yaml/handlers/resourceServers.js +33 -21
  158. package/lib/context/yaml/handlers/resourceServers.js.map +1 -0
  159. package/lib/context/yaml/handlers/roles.js +33 -19
  160. package/lib/context/yaml/handlers/roles.js.map +1 -0
  161. package/lib/context/yaml/handlers/rules.js +39 -28
  162. package/lib/context/yaml/handlers/rules.js.map +1 -0
  163. package/lib/context/yaml/handlers/rulesConfigs.js +28 -14
  164. package/lib/context/yaml/handlers/rulesConfigs.js.map +1 -0
  165. package/lib/context/yaml/handlers/selfServiceProfiles.js +43 -29
  166. package/lib/context/yaml/handlers/selfServiceProfiles.js.map +1 -0
  167. package/lib/context/yaml/handlers/tenant.js +41 -19
  168. package/lib/context/yaml/handlers/tenant.js.map +1 -0
  169. package/lib/context/yaml/handlers/themes.js +19 -7
  170. package/lib/context/yaml/handlers/themes.js.map +1 -0
  171. package/lib/context/yaml/handlers/triggers.d.ts +1 -1
  172. package/lib/context/yaml/handlers/triggers.js +29 -15
  173. package/lib/context/yaml/handlers/triggers.js.map +1 -0
  174. package/lib/context/yaml/handlers/userAttributeProfiles.d.ts +1 -1
  175. package/lib/context/yaml/handlers/userAttributeProfiles.js +19 -7
  176. package/lib/context/yaml/handlers/userAttributeProfiles.js.map +1 -0
  177. package/lib/context/yaml/index.js +128 -120
  178. package/lib/context/yaml/index.js.map +1 -0
  179. package/lib/index.d.ts +96 -4
  180. package/lib/index.js +34 -24
  181. package/lib/index.js.map +1 -0
  182. package/lib/keywordPreservation.d.ts +1 -1
  183. package/lib/keywordPreservation.js +6 -10
  184. package/lib/keywordPreservation.js.map +1 -0
  185. package/lib/logger.js +1 -0
  186. package/lib/logger.js.map +1 -0
  187. package/lib/readonly.js +4 -3
  188. package/lib/readonly.js.map +1 -0
  189. package/lib/sessionDurationsToMinutes.js +1 -0
  190. package/lib/sessionDurationsToMinutes.js.map +1 -0
  191. package/lib/tools/auth0/client.js +127 -108
  192. package/lib/tools/auth0/client.js.map +1 -0
  193. package/lib/tools/auth0/handlers/actions.d.ts +26 -8
  194. package/lib/tools/auth0/handlers/actions.js +149 -138
  195. package/lib/tools/auth0/handlers/actions.js.map +1 -0
  196. package/lib/tools/auth0/handlers/attackProtection.js +92 -80
  197. package/lib/tools/auth0/handlers/attackProtection.js.map +1 -0
  198. package/lib/tools/auth0/handlers/branding.js +99 -75
  199. package/lib/tools/auth0/handlers/branding.js.map +1 -0
  200. package/lib/tools/auth0/handlers/clientGrants.d.ts +9 -2
  201. package/lib/tools/auth0/handlers/clientGrants.js +72 -65
  202. package/lib/tools/auth0/handlers/clientGrants.js.map +1 -0
  203. package/lib/tools/auth0/handlers/clients.d.ts +85 -7
  204. package/lib/tools/auth0/handlers/clients.js +187 -66
  205. package/lib/tools/auth0/handlers/clients.js.map +1 -0
  206. package/lib/tools/auth0/handlers/connectionProfiles.d.ts +182 -0
  207. package/lib/tools/auth0/handlers/connectionProfiles.js +239 -0
  208. package/lib/tools/auth0/handlers/connectionProfiles.js.map +1 -0
  209. package/lib/tools/auth0/handlers/connections.d.ts +1 -3
  210. package/lib/tools/auth0/handlers/connections.js +135 -130
  211. package/lib/tools/auth0/handlers/connections.js.map +1 -0
  212. package/lib/tools/auth0/handlers/customDomains.d.ts +1 -4
  213. package/lib/tools/auth0/handlers/customDomains.js +53 -43
  214. package/lib/tools/auth0/handlers/customDomains.js.map +1 -0
  215. package/lib/tools/auth0/handlers/databases.js +114 -94
  216. package/lib/tools/auth0/handlers/databases.js.map +1 -0
  217. package/lib/tools/auth0/handlers/default.d.ts +2 -2
  218. package/lib/tools/auth0/handlers/default.js +171 -210
  219. package/lib/tools/auth0/handlers/default.js.map +1 -0
  220. package/lib/tools/auth0/handlers/emailProvider.js +52 -41
  221. package/lib/tools/auth0/handlers/emailProvider.js.map +1 -0
  222. package/lib/tools/auth0/handlers/emailTemplates.js +71 -49
  223. package/lib/tools/auth0/handlers/emailTemplates.js.map +1 -0
  224. package/lib/tools/auth0/handlers/flowVaultConnections.d.ts +12 -5
  225. package/lib/tools/auth0/handlers/flowVaultConnections.js +143 -108
  226. package/lib/tools/auth0/handlers/flowVaultConnections.js.map +1 -0
  227. package/lib/tools/auth0/handlers/flows.d.ts +3 -2
  228. package/lib/tools/auth0/handlers/flows.js +129 -92
  229. package/lib/tools/auth0/handlers/flows.js.map +1 -0
  230. package/lib/tools/auth0/handlers/forms.d.ts +3 -3
  231. package/lib/tools/auth0/handlers/forms.js +112 -98
  232. package/lib/tools/auth0/handlers/forms.js.map +1 -0
  233. package/lib/tools/auth0/handlers/guardianFactorProviders.js +84 -61
  234. package/lib/tools/auth0/handlers/guardianFactorProviders.js.map +1 -0
  235. package/lib/tools/auth0/handlers/guardianFactorTemplates.js +68 -46
  236. package/lib/tools/auth0/handlers/guardianFactorTemplates.js.map +1 -0
  237. package/lib/tools/auth0/handlers/guardianFactors.js +45 -35
  238. package/lib/tools/auth0/handlers/guardianFactors.js.map +1 -0
  239. package/lib/tools/auth0/handlers/guardianPhoneFactorMessageTypes.js +45 -29
  240. package/lib/tools/auth0/handlers/guardianPhoneFactorMessageTypes.js.map +1 -0
  241. package/lib/tools/auth0/handlers/guardianPhoneFactorSelectedProvider.js +45 -29
  242. package/lib/tools/auth0/handlers/guardianPhoneFactorSelectedProvider.js.map +1 -0
  243. package/lib/tools/auth0/handlers/guardianPolicies.js +35 -20
  244. package/lib/tools/auth0/handlers/guardianPolicies.js.map +1 -0
  245. package/lib/tools/auth0/handlers/hooks.js +153 -123
  246. package/lib/tools/auth0/handlers/hooks.js.map +1 -0
  247. package/lib/tools/auth0/handlers/index.js +3 -0
  248. package/lib/tools/auth0/handlers/index.js.map +1 -0
  249. package/lib/tools/auth0/handlers/logStreams.js +47 -42
  250. package/lib/tools/auth0/handlers/logStreams.js.map +1 -0
  251. package/lib/tools/auth0/handlers/networkACLs.d.ts +4 -5
  252. package/lib/tools/auth0/handlers/networkACLs.js +133 -115
  253. package/lib/tools/auth0/handlers/networkACLs.js.map +1 -0
  254. package/lib/tools/auth0/handlers/organizations.d.ts +9 -10
  255. package/lib/tools/auth0/handlers/organizations.js +429 -360
  256. package/lib/tools/auth0/handlers/organizations.js.map +1 -0
  257. package/lib/tools/auth0/handlers/pages.js +83 -74
  258. package/lib/tools/auth0/handlers/pages.js.map +1 -0
  259. package/lib/tools/auth0/handlers/phoneProvider.d.ts +2 -2
  260. package/lib/tools/auth0/handlers/phoneProvider.js +82 -69
  261. package/lib/tools/auth0/handlers/phoneProvider.js.map +1 -0
  262. package/lib/tools/auth0/handlers/prompts.d.ts +5 -5
  263. package/lib/tools/auth0/handlers/prompts.js +235 -240
  264. package/lib/tools/auth0/handlers/prompts.js.map +1 -0
  265. package/lib/tools/auth0/handlers/resourceServers.d.ts +1 -3
  266. package/lib/tools/auth0/handlers/resourceServers.js +60 -59
  267. package/lib/tools/auth0/handlers/resourceServers.js.map +1 -0
  268. package/lib/tools/auth0/handlers/roles.js +178 -162
  269. package/lib/tools/auth0/handlers/roles.js.map +1 -0
  270. package/lib/tools/auth0/handlers/rules.js +162 -144
  271. package/lib/tools/auth0/handlers/rules.js.map +1 -0
  272. package/lib/tools/auth0/handlers/rulesConfigs.js +39 -30
  273. package/lib/tools/auth0/handlers/rulesConfigs.js.map +1 -0
  274. package/lib/tools/auth0/handlers/scimHandler.d.ts +3 -4
  275. package/lib/tools/auth0/handlers/scimHandler.js +132 -110
  276. package/lib/tools/auth0/handlers/scimHandler.js.map +1 -0
  277. package/lib/tools/auth0/handlers/selfServiceProfiles.d.ts +5 -13
  278. package/lib/tools/auth0/handlers/selfServiceProfiles.js +204 -170
  279. package/lib/tools/auth0/handlers/selfServiceProfiles.js.map +1 -0
  280. package/lib/tools/auth0/handlers/tenant.d.ts +3 -5
  281. package/lib/tools/auth0/handlers/tenant.js +52 -45
  282. package/lib/tools/auth0/handlers/tenant.js.map +1 -0
  283. package/lib/tools/auth0/handlers/themes.d.ts +12 -12
  284. package/lib/tools/auth0/handlers/themes.js +102 -86
  285. package/lib/tools/auth0/handlers/themes.js.map +1 -0
  286. package/lib/tools/auth0/handlers/triggers.js +75 -59
  287. package/lib/tools/auth0/handlers/triggers.js.map +1 -0
  288. package/lib/tools/auth0/handlers/userAttributeProfiles.d.ts +4 -4
  289. package/lib/tools/auth0/handlers/userAttributeProfiles.js +63 -56
  290. package/lib/tools/auth0/handlers/userAttributeProfiles.js.map +1 -0
  291. package/lib/tools/auth0/index.js +48 -35
  292. package/lib/tools/auth0/index.js.map +1 -0
  293. package/lib/tools/auth0/schema.js +4 -6
  294. package/lib/tools/auth0/schema.js.map +1 -0
  295. package/lib/tools/calculateChanges.js +15 -24
  296. package/lib/tools/calculateChanges.js.map +1 -0
  297. package/lib/tools/constants.d.ts +3 -2
  298. package/lib/tools/constants.js +2 -0
  299. package/lib/tools/constants.js.map +1 -0
  300. package/lib/tools/deploy.js +29 -17
  301. package/lib/tools/deploy.js.map +1 -0
  302. package/lib/tools/index.d.ts +89 -3
  303. package/lib/tools/index.js +2 -3
  304. package/lib/tools/index.js.map +1 -0
  305. package/lib/tools/utils.d.ts +1 -1
  306. package/lib/tools/utils.js +22 -12
  307. package/lib/tools/utils.js.map +1 -0
  308. package/lib/tools/validationError.js +1 -0
  309. package/lib/tools/validationError.js.map +1 -0
  310. package/lib/types.d.ts +6 -9
  311. package/lib/types.js +1 -0
  312. package/lib/types.js.map +1 -0
  313. package/lib/utils.d.ts +58 -3
  314. package/lib/utils.js +5 -8
  315. package/lib/utils.js.map +1 -0
  316. package/package.json +10 -11
  317. package/tsconfig.json +3 -4
  318. package/eslint.config.js +0 -130
@@ -1,4 +1,13 @@
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
+ };
2
11
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
13
  };
@@ -37,39 +46,34 @@ class ScimHandler {
37
46
  * So, we need this map to perform `create`, `update` or `delete` actions on SCIM.
38
47
  * @param connections
39
48
  */
40
- async createIdMap(connections) {
41
- this.idMap.clear();
42
- logger_1.default.info('Reviewing connections for SCIM support. This may take a while...');
43
- await this.poolClient
44
- .addEachTask({
45
- data: connections || [],
46
- generator: (connection) => {
47
- if (!this.scimScopes.read)
48
- return Promise.resolve(null);
49
- if (!this.isScimStrategy(connection.strategy))
50
- return Promise.resolve(null);
51
- this.idMap.set(connection.id, { strategy: connection.strategy });
52
- return this.getScimConfiguration({ id: connection.id })
53
- .then((response) => {
54
- const scimConfiguration = response;
55
- if (scimConfiguration) {
56
- // eslint-disable-next-line camelcase
57
- const { mapping, user_id_attribute, connection_id } = scimConfiguration;
58
- // eslint-disable-next-line camelcase
59
- if (connection_id) {
60
- this.idMap.set(connection_id, {
61
- ...this.idMap.get(connection_id),
62
- scimConfiguration: { mapping, user_id_attribute },
63
- });
49
+ createIdMap(connections) {
50
+ return __awaiter(this, void 0, void 0, function* () {
51
+ this.idMap.clear();
52
+ logger_1.default.info('Reviewing connections for SCIM support. This may take a while...');
53
+ yield this.poolClient
54
+ .addEachTask({
55
+ data: connections || [],
56
+ generator: (connection) => {
57
+ if (!this.scimScopes.read)
58
+ return Promise.resolve(null);
59
+ if (!this.isScimStrategy(connection.strategy))
60
+ return Promise.resolve(null);
61
+ this.idMap.set(connection.id, { strategy: connection.strategy });
62
+ return this.getScimConfiguration({ id: connection.id })
63
+ .then((response) => {
64
+ const scimConfiguration = response === null || response === void 0 ? void 0 : response.data;
65
+ if (scimConfiguration) {
66
+ const { mapping, user_id_attribute, connection_id } = scimConfiguration;
67
+ this.idMap.set(connection_id, Object.assign(Object.assign({}, this.idMap.get(connection_id)), { scimConfiguration: { mapping, user_id_attribute } }));
64
68
  }
65
- }
66
- })
67
- .catch((error) => {
68
- throw new Error(`Problem fetching SCIM configurations while running \"createIdMap\".\n${error}`);
69
- });
70
- },
71
- })
72
- .promise();
69
+ })
70
+ .catch((error) => {
71
+ throw new Error(`Problem fetching SCIM configurations while running \"createIdMap\".\n${error}`);
72
+ });
73
+ },
74
+ })
75
+ .promise();
76
+ });
73
77
  }
74
78
  /**
75
79
  * Iterate through all the connections and add property `scim_configuration` to only `SCIM` connections.
@@ -79,20 +83,22 @@ class ScimHandler {
79
83
  *
80
84
  * This method mutates the incoming `connections`.
81
85
  */
82
- async applyScimConfiguration(connections) {
83
- // If `this.idMap` is empty, it means we haven't created the idMap yet. Create it.
84
- // If `this.scimScopes.read` is false, it means we don't have `read:scim_config` scope. Return connections as is.
85
- if (this.idMap.size === 0) {
86
- if (!this.scimScopes.read)
87
- return connections;
88
- await this.createIdMap(connections);
89
- }
90
- for (const connection of connections) {
91
- const { scimConfiguration } = this.idMap.get(connection.id) || {};
92
- if (scimConfiguration) {
93
- connection.scim_configuration = scimConfiguration;
86
+ applyScimConfiguration(connections) {
87
+ return __awaiter(this, void 0, void 0, function* () {
88
+ // If `this.idMap` is empty, it means we haven't created the idMap yet. Create it.
89
+ // If `this.scimScopes.read` is false, it means we don't have `read:scim_config` scope. Return connections as is.
90
+ if (this.idMap.size === 0) {
91
+ if (!this.scimScopes.read)
92
+ return connections;
93
+ yield this.createIdMap(connections);
94
94
  }
95
- }
95
+ for (const connection of connections) {
96
+ const { scimConfiguration } = this.idMap.get(connection.id) || {};
97
+ if (scimConfiguration) {
98
+ connection.scim_configuration = scimConfiguration;
99
+ }
100
+ }
101
+ });
96
102
  }
97
103
  /**
98
104
  * Wrapper over scimClient methods.
@@ -114,18 +120,21 @@ class ScimHandler {
114
120
  /**
115
121
  * Error handler wrapper.
116
122
  */
117
- async withErrorHandling(callback, method, connectionId) {
118
- try {
119
- return await callback();
120
- }
121
- catch (error) {
122
- return this.handleExpectedErrors(error, method, connectionId);
123
- }
123
+ withErrorHandling(callback, method, connectionId) {
124
+ return __awaiter(this, void 0, void 0, function* () {
125
+ try {
126
+ return yield callback();
127
+ }
128
+ catch (error) {
129
+ return this.handleExpectedErrors(error, method, connectionId);
130
+ }
131
+ });
124
132
  }
125
133
  /**
126
134
  * Handle expected errors.
127
135
  */
128
136
  handleExpectedErrors(error, method, connectionId) {
137
+ var _a;
129
138
  // Skip the connection if it returns 404. This can happen if `SCIM` is not enabled on a `SCIM` connection.
130
139
  if (error && error.statusCode === 404) {
131
140
  logger_1.default.debug(`SCIM configuration is not enabled on connection \"${connectionId}\".`);
@@ -141,7 +150,7 @@ class ScimHandler {
141
150
  return null;
142
151
  }
143
152
  // Skip the connection if it returns 400. This can happen if `SCIM` configuration already exists on a `SCIM` connection.
144
- if (error && error.statusCode === 400 && error.message?.includes('already exists')) {
153
+ if (error && error.statusCode === 400 && ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('already exists'))) {
145
154
  logger_1.default.warn(`SCIM configuration already exists on connection \"${connectionId}\".`);
146
155
  return null;
147
156
  }
@@ -156,81 +165,94 @@ class ScimHandler {
156
165
  /**
157
166
  * Creates a new `SCIM` configuration.
158
167
  */
159
- async createScimConfiguration({ id },
160
- // eslint-disable-next-line camelcase
161
- { user_id_attribute, mapping }) {
162
- logger_1.default.debug(`Creating SCIM configuration on connection ${id}`);
163
- return this.withErrorHandling(async () => this.connectionsManager.scimConfiguration.create(id, { user_id_attribute, mapping }), 'create', id);
168
+ createScimConfiguration(_a, _b) {
169
+ return __awaiter(this, arguments, void 0, function* ({ id },
170
+ // eslint-disable-next-line camelcase
171
+ { user_id_attribute, mapping }) {
172
+ logger_1.default.debug(`Creating SCIM configuration on connection ${id}`);
173
+ return this.withErrorHandling(() => __awaiter(this, void 0, void 0, function* () { return this.connectionsManager.createScimConfiguration({ id }, { user_id_attribute, mapping }); }), 'create', id);
174
+ });
164
175
  }
165
176
  /**
166
177
  * Retrieves `SCIM` configuration of an enterprise connection.
167
178
  */
168
- async getScimConfiguration({ id, }) {
169
- logger_1.default.debug(`Getting SCIM configuration from connection ${id}`);
170
- return this.withErrorHandling(async () => this.connectionsManager.scimConfiguration.get(id), 'get', id);
179
+ getScimConfiguration(_a) {
180
+ return __awaiter(this, arguments, void 0, function* ({ id }) {
181
+ logger_1.default.debug(`Getting SCIM configuration from connection ${id}`);
182
+ return this.withErrorHandling(() => __awaiter(this, void 0, void 0, function* () { return this.connectionsManager.getScimConfiguration({ id }); }), 'get', id);
183
+ });
171
184
  }
172
185
  /**
173
186
  * Updates an existing `SCIM` configuration.
174
187
  */
175
- async updateScimConfiguration({ id },
176
- // eslint-disable-next-line camelcase
177
- { user_id_attribute, mapping }) {
178
- logger_1.default.debug(`Updating SCIM configuration on connection ${id}`);
179
- return this.withErrorHandling(async () => this.connectionsManager.scimConfiguration.update(id, { user_id_attribute, mapping }), 'patch', id);
188
+ updateScimConfiguration(_a, _b) {
189
+ return __awaiter(this, arguments, void 0, function* ({ id },
190
+ // eslint-disable-next-line camelcase
191
+ { user_id_attribute, mapping }) {
192
+ logger_1.default.debug(`Updating SCIM configuration on connection ${id}`);
193
+ return this.withErrorHandling(() => __awaiter(this, void 0, void 0, function* () { return this.connectionsManager.updateScimConfiguration({ id }, { user_id_attribute, mapping }); }), 'patch', id);
194
+ });
180
195
  }
181
196
  /**
182
197
  * Deletes an existing `SCIM` configuration.
183
198
  */
184
- async deleteScimConfiguration({ id }) {
185
- logger_1.default.debug(`Deleting SCIM configuration on connection ${id}`);
186
- return this.withErrorHandling(async () => this.connectionsManager.scimConfiguration.delete(id), 'delete', id);
199
+ deleteScimConfiguration(_a) {
200
+ return __awaiter(this, arguments, void 0, function* ({ id }) {
201
+ logger_1.default.debug(`Deleting SCIM configuration on connection ${id}`);
202
+ return this.withErrorHandling(() => __awaiter(this, void 0, void 0, function* () { return this.connectionsManager.deleteScimConfiguration({ id }); }), 'delete', id);
203
+ });
187
204
  }
188
- async updateOverride(requestParams, bodyParams) {
189
- // Extract `scim_configuration` from `bodyParams`.
190
- // Remove `scim_configuration` from `bodyParams`, because `connections.update` doesn't accept it.
191
- const { scim_configuration: scimBodyParams } = bodyParams;
192
- delete bodyParams.scim_configuration;
193
- // First, update `connections`.
194
- const updated = await this.connectionsManager.update(requestParams.id, bodyParams);
195
- const idMapEntry = this.idMap.get(requestParams.id);
196
- // Now, update `scim_configuration` inside the updated connection.
197
- // If `scim_configuration` exists in both local and remote -> updateScimConfiguration(...)
198
- // If `scim_configuration` exists in remote but local -> deleteScimConfiguration(...)
199
- // If `scim_configuration` exists in local but remote -> createScimConfiguration(...)
200
- if (idMapEntry?.scimConfiguration) {
201
- if (scimBodyParams) {
202
- if (this.scimScopes.update) {
203
- await this.updateScimConfiguration(requestParams, scimBodyParams);
205
+ updateOverride(requestParams, bodyParams) {
206
+ return __awaiter(this, void 0, void 0, function* () {
207
+ // Extract `scim_configuration` from `bodyParams`.
208
+ // Remove `scim_configuration` from `bodyParams`, because `connections.update` doesn't accept it.
209
+ const { scim_configuration: scimBodyParams } = bodyParams;
210
+ delete bodyParams.scim_configuration;
211
+ // First, update `connections`.
212
+ const updated = yield this.connectionsManager.update(requestParams, bodyParams);
213
+ const idMapEntry = this.idMap.get(requestParams.id);
214
+ // Now, update `scim_configuration` inside the updated connection.
215
+ // If `scim_configuration` exists in both local and remote -> updateScimConfiguration(...)
216
+ // If `scim_configuration` exists in remote but local -> deleteScimConfiguration(...)
217
+ // If `scim_configuration` exists in local but remote -> createScimConfiguration(...)
218
+ if (idMapEntry === null || idMapEntry === void 0 ? void 0 : idMapEntry.scimConfiguration) {
219
+ if (scimBodyParams) {
220
+ if (this.scimScopes.update) {
221
+ yield this.updateScimConfiguration(requestParams, scimBodyParams);
222
+ }
204
223
  }
205
- }
206
- else if (this.config('AUTH0_ALLOW_DELETE')) {
207
- if (this.scimScopes.delete) {
208
- await this.deleteScimConfiguration(requestParams);
224
+ else if (this.config('AUTH0_ALLOW_DELETE')) {
225
+ if (this.scimScopes.delete) {
226
+ yield this.deleteScimConfiguration(requestParams);
227
+ }
228
+ }
229
+ else {
230
+ logger_1.default.warn(`Skipping DELETE scim_configuration on \"${requestParams.id}\". Enable deletes by setting \"AUTH0_ALLOW_DELETE\" to true in your config.`);
209
231
  }
210
232
  }
211
- else {
212
- logger_1.default.warn(`Skipping DELETE scim_configuration on \"${requestParams.id}\". Enable deletes by setting \"AUTH0_ALLOW_DELETE\" to true in your config.`);
233
+ else if (scimBodyParams && this.scimScopes.create) {
234
+ yield this.createScimConfiguration(requestParams, scimBodyParams);
213
235
  }
214
- }
215
- else if (scimBodyParams && this.scimScopes.create) {
216
- await this.createScimConfiguration(requestParams, scimBodyParams);
217
- }
218
- // Return response from connections.update(...).
219
- return updated;
236
+ // Return response from connections.update(...).
237
+ return updated;
238
+ });
220
239
  }
221
- async createOverride(bodyParams) {
222
- // Extract `scim_configuration` from `bodyParams`.
223
- // Remove `scim_configuration` from `bodyParams`, because `connections.create` doesn't accept it.
224
- const { scim_configuration: scimBodyParams } = bodyParams;
225
- delete bodyParams.scim_configuration;
226
- // First, create the new `connection`.
227
- const data = await this.connectionsManager.create(bodyParams);
228
- if (data?.id && scimBodyParams && this.scimScopes.create) {
229
- // Now, create the `scim_configuration` for newly created `connection`.
230
- await this.createScimConfiguration({ id: data.id }, scimBodyParams);
231
- }
232
- // Return response from connections.create(...).
233
- return data;
240
+ createOverride(bodyParams) {
241
+ return __awaiter(this, void 0, void 0, function* () {
242
+ // Extract `scim_configuration` from `bodyParams`.
243
+ // Remove `scim_configuration` from `bodyParams`, because `connections.create` doesn't accept it.
244
+ const { scim_configuration: scimBodyParams } = bodyParams;
245
+ delete bodyParams.scim_configuration;
246
+ // First, create the new `connection`.
247
+ const { data } = yield this.connectionsManager.create(bodyParams);
248
+ if (scimBodyParams && this.scimScopes.create) {
249
+ // Now, create the `scim_configuration` for newly created `connection`.
250
+ yield this.createScimConfiguration({ id: data.id }, scimBodyParams);
251
+ }
252
+ // Return response from connections.create(...).
253
+ return data;
254
+ });
234
255
  }
235
256
  }
236
257
  exports.default = ScimHandler;
258
+ //# sourceMappingURL=scimHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scimHandler.js","sourceRoot":"","sources":["../../../../src/tools/auth0/handlers/scimHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAGA,6DAAkC;AA+BlC;;;GAGG;AACH,MAAqB,WAAW;IAsB9B,YAAY,MAAM,EAAE,kBAAkB,EAAE,UAA+B;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1,11 @@
1
- import { Management } from 'auth0';
2
- import { Asset, Assets, CalculatedChanges } from '../../../types';
1
+ import { GetSelfServiceProfileCustomTextLanguageEnum, GetSelfServiceProfileCustomTextPageEnum, SsProfile, UserAttributeProfile } from 'auth0';
2
+ import { Asset, Assets, Auth0APIClient, CalculatedChanges } from '../../../types';
3
3
  import DefaultAPIHandler from './default';
4
- import { UserAttributeProfile } from './userAttributeProfiles';
5
- declare const SelfServiceProfileCustomTextLanguageEnum: {
6
- readonly en: "en";
7
- };
8
- declare const SelfServiceProfileCustomTextPageEnum: {
9
- readonly getStarted: "get-started";
10
- };
11
4
  type customTextType = {
12
- [SelfServiceProfileCustomTextLanguageEnum.en]: {
13
- [SelfServiceProfileCustomTextPageEnum.getStarted]: Object;
5
+ [GetSelfServiceProfileCustomTextLanguageEnum.en]: {
6
+ [GetSelfServiceProfileCustomTextPageEnum.get_started]: Object;
14
7
  };
15
8
  };
16
- type SsProfile = Management.SelfServiceProfile;
17
9
  export type SsProfileWithCustomText = Omit<SsProfile, 'created_at' | 'updated_at'> & {
18
10
  customText?: customTextType;
19
11
  };
@@ -97,7 +89,7 @@ export default class SelfServiceProfileHandler extends DefaultAPIHandler {
97
89
  updateSelfServiceProfile(profile: SsProfileWithCustomText): Promise<Asset>;
98
90
  deleteSelfServiceProfiles(deletes: CalculatedChanges['del']): Promise<void>;
99
91
  deleteSelfServiceProfile(profile: SsProfileWithCustomText): Promise<void>;
100
- getUserAttributeProfiles(selfServiceProfiles: SsProfileWithCustomText[]): Promise<UserAttributeProfile[]>;
92
+ getUserAttributeProfiles(auth0Client: Auth0APIClient, selfServiceProfiles: SsProfileWithCustomText[]): Promise<UserAttributeProfile[]>;
101
93
  hasConflictingUserAttribute(profile: SsProfileWithCustomText): boolean;
102
94
  }
103
95
  export {};