auth0-deploy-cli 8.20.2 → 8.20.4-beta.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 (309) hide show
  1. package/.circleci/config.yml +46 -5
  2. package/CHANGELOG.md +17 -1
  3. package/eslint.config.js +130 -0
  4. package/lib/args.js +0 -1
  5. package/lib/commands/export.js +41 -49
  6. package/lib/commands/import.js +36 -43
  7. package/lib/commands/index.js +0 -1
  8. package/lib/configFactory.js +0 -1
  9. package/lib/context/defaults.js +38 -10
  10. package/lib/context/directory/handlers/actions.js +40 -39
  11. package/lib/context/directory/handlers/attackProtection.js +22 -34
  12. package/lib/context/directory/handlers/branding.js +12 -21
  13. package/lib/context/directory/handlers/clientGrants.js +52 -62
  14. package/lib/context/directory/handlers/clients.js +17 -29
  15. package/lib/context/directory/handlers/connections.js +32 -41
  16. package/lib/context/directory/handlers/customDomains.js +9 -21
  17. package/lib/context/directory/handlers/databases.js +37 -35
  18. package/lib/context/directory/handlers/emailProvider.js +22 -36
  19. package/lib/context/directory/handlers/emailTemplates.js +20 -29
  20. package/lib/context/directory/handlers/flowVaultConnections.js +39 -49
  21. package/lib/context/directory/handlers/flows.js +38 -48
  22. package/lib/context/directory/handlers/forms.js +38 -48
  23. package/lib/context/directory/handlers/guardianFactorProviders.js +9 -21
  24. package/lib/context/directory/handlers/guardianFactorTemplates.js +9 -21
  25. package/lib/context/directory/handlers/guardianFactors.js +9 -21
  26. package/lib/context/directory/handlers/guardianPhoneFactorMessageTypes.js +8 -20
  27. package/lib/context/directory/handlers/guardianPhoneFactorSelectedProvider.js +8 -20
  28. package/lib/context/directory/handlers/guardianPolicies.js +8 -20
  29. package/lib/context/directory/handlers/hooks.js +24 -34
  30. package/lib/context/directory/handlers/index.js +0 -1
  31. package/lib/context/directory/handlers/logStreams.js +12 -24
  32. package/lib/context/directory/handlers/networkACLs.js +22 -34
  33. package/lib/context/directory/handlers/organizations.js +39 -44
  34. package/lib/context/directory/handlers/pages.js +31 -37
  35. package/lib/context/directory/handlers/phoneProvider.js +12 -24
  36. package/lib/context/directory/handlers/prompts.js +58 -76
  37. package/lib/context/directory/handlers/resourceServers.d.ts +1 -1
  38. package/lib/context/directory/handlers/resourceServers.js +18 -30
  39. package/lib/context/directory/handlers/roles.js +21 -31
  40. package/lib/context/directory/handlers/rules.js +22 -32
  41. package/lib/context/directory/handlers/rulesConfigs.js +3 -15
  42. package/lib/context/directory/handlers/selfServiceProfiles.js +28 -40
  43. package/lib/context/directory/handlers/tenant.js +14 -34
  44. package/lib/context/directory/handlers/themes.js +9 -21
  45. package/lib/context/directory/handlers/triggers.d.ts +1 -1
  46. package/lib/context/directory/handlers/triggers.js +16 -26
  47. package/lib/context/directory/handlers/userAttributeProfiles.d.ts +1 -1
  48. package/lib/context/directory/handlers/userAttributeProfiles.js +16 -26
  49. package/lib/context/directory/index.js +66 -80
  50. package/lib/context/index.js +7 -18
  51. package/lib/context/yaml/handlers/actions.js +39 -41
  52. package/lib/context/yaml/handlers/attackProtection.js +27 -41
  53. package/lib/context/yaml/handlers/branding.js +47 -69
  54. package/lib/context/yaml/handlers/clientGrants.js +26 -40
  55. package/lib/context/yaml/handlers/clients.js +41 -55
  56. package/lib/context/yaml/handlers/connections.js +63 -67
  57. package/lib/context/yaml/handlers/customDomains.js +7 -19
  58. package/lib/context/yaml/handlers/databases.js +63 -65
  59. package/lib/context/yaml/handlers/emailProvider.js +22 -37
  60. package/lib/context/yaml/handlers/emailTemplates.js +28 -39
  61. package/lib/context/yaml/handlers/flowVaultConnections.js +36 -50
  62. package/lib/context/yaml/handlers/flows.js +55 -66
  63. package/lib/context/yaml/handlers/forms.js +55 -66
  64. package/lib/context/yaml/handlers/guardianFactorProviders.js +7 -19
  65. package/lib/context/yaml/handlers/guardianFactorTemplates.js +7 -19
  66. package/lib/context/yaml/handlers/guardianFactors.js +7 -19
  67. package/lib/context/yaml/handlers/guardianPhoneFactorMessageTypes.js +7 -19
  68. package/lib/context/yaml/handlers/guardianPhoneFactorSelectedProvider.js +7 -19
  69. package/lib/context/yaml/handlers/guardianPolicies.js +7 -19
  70. package/lib/context/yaml/handlers/hooks.js +34 -48
  71. package/lib/context/yaml/handlers/index.js +0 -1
  72. package/lib/context/yaml/handlers/logStreams.js +16 -30
  73. package/lib/context/yaml/handlers/networkACLs.js +25 -39
  74. package/lib/context/yaml/handlers/organizations.js +37 -46
  75. package/lib/context/yaml/handlers/pages.js +31 -39
  76. package/lib/context/yaml/handlers/phoneProvider.js +17 -31
  77. package/lib/context/yaml/handlers/prompts.js +22 -47
  78. package/lib/context/yaml/handlers/resourceServers.d.ts +1 -1
  79. package/lib/context/yaml/handlers/resourceServers.js +21 -33
  80. package/lib/context/yaml/handlers/roles.js +19 -33
  81. package/lib/context/yaml/handlers/rules.js +28 -39
  82. package/lib/context/yaml/handlers/rulesConfigs.js +14 -28
  83. package/lib/context/yaml/handlers/selfServiceProfiles.js +29 -43
  84. package/lib/context/yaml/handlers/tenant.js +19 -41
  85. package/lib/context/yaml/handlers/themes.js +7 -19
  86. package/lib/context/yaml/handlers/triggers.d.ts +1 -1
  87. package/lib/context/yaml/handlers/triggers.js +15 -29
  88. package/lib/context/yaml/handlers/userAttributeProfiles.d.ts +1 -1
  89. package/lib/context/yaml/handlers/userAttributeProfiles.js +7 -19
  90. package/lib/context/yaml/index.js +120 -128
  91. package/lib/index.d.ts +4 -95
  92. package/lib/index.js +24 -34
  93. package/lib/keywordPreservation.d.ts +1 -1
  94. package/lib/keywordPreservation.js +10 -6
  95. package/lib/logger.js +0 -1
  96. package/lib/readonly.js +3 -4
  97. package/lib/sessionDurationsToMinutes.js +0 -1
  98. package/lib/tools/auth0/client.js +111 -120
  99. package/lib/tools/auth0/handlers/actions.d.ts +8 -26
  100. package/lib/tools/auth0/handlers/actions.js +138 -149
  101. package/lib/tools/auth0/handlers/attackProtection.js +80 -92
  102. package/lib/tools/auth0/handlers/branding.js +75 -99
  103. package/lib/tools/auth0/handlers/clientGrants.d.ts +2 -8
  104. package/lib/tools/auth0/handlers/clientGrants.js +65 -70
  105. package/lib/tools/auth0/handlers/clients.d.ts +3 -9
  106. package/lib/tools/auth0/handlers/clients.js +59 -63
  107. package/lib/tools/auth0/handlers/connections.d.ts +3 -1
  108. package/lib/tools/auth0/handlers/connections.js +130 -135
  109. package/lib/tools/auth0/handlers/customDomains.d.ts +4 -1
  110. package/lib/tools/auth0/handlers/customDomains.js +43 -53
  111. package/lib/tools/auth0/handlers/databases.js +94 -114
  112. package/lib/tools/auth0/handlers/default.d.ts +2 -2
  113. package/lib/tools/auth0/handlers/default.js +210 -171
  114. package/lib/tools/auth0/handlers/emailProvider.js +41 -52
  115. package/lib/tools/auth0/handlers/emailTemplates.js +49 -71
  116. package/lib/tools/auth0/handlers/flowVaultConnections.d.ts +5 -12
  117. package/lib/tools/auth0/handlers/flowVaultConnections.js +108 -143
  118. package/lib/tools/auth0/handlers/flows.d.ts +2 -3
  119. package/lib/tools/auth0/handlers/flows.js +92 -129
  120. package/lib/tools/auth0/handlers/forms.d.ts +3 -3
  121. package/lib/tools/auth0/handlers/forms.js +98 -112
  122. package/lib/tools/auth0/handlers/guardianFactorProviders.js +61 -84
  123. package/lib/tools/auth0/handlers/guardianFactorTemplates.js +46 -68
  124. package/lib/tools/auth0/handlers/guardianFactors.js +35 -45
  125. package/lib/tools/auth0/handlers/guardianPhoneFactorMessageTypes.js +29 -45
  126. package/lib/tools/auth0/handlers/guardianPhoneFactorSelectedProvider.js +29 -45
  127. package/lib/tools/auth0/handlers/guardianPolicies.js +20 -35
  128. package/lib/tools/auth0/handlers/hooks.js +123 -153
  129. package/lib/tools/auth0/handlers/index.js +0 -1
  130. package/lib/tools/auth0/handlers/logStreams.js +42 -47
  131. package/lib/tools/auth0/handlers/networkACLs.d.ts +5 -4
  132. package/lib/tools/auth0/handlers/networkACLs.js +115 -133
  133. package/lib/tools/auth0/handlers/organizations.d.ts +10 -9
  134. package/lib/tools/auth0/handlers/organizations.js +360 -429
  135. package/lib/tools/auth0/handlers/pages.js +74 -83
  136. package/lib/tools/auth0/handlers/phoneProvider.d.ts +2 -2
  137. package/lib/tools/auth0/handlers/phoneProvider.js +69 -82
  138. package/lib/tools/auth0/handlers/prompts.d.ts +5 -5
  139. package/lib/tools/auth0/handlers/prompts.js +242 -249
  140. package/lib/tools/auth0/handlers/resourceServers.d.ts +3 -1
  141. package/lib/tools/auth0/handlers/resourceServers.js +59 -60
  142. package/lib/tools/auth0/handlers/roles.js +162 -178
  143. package/lib/tools/auth0/handlers/rules.js +144 -162
  144. package/lib/tools/auth0/handlers/rulesConfigs.js +30 -39
  145. package/lib/tools/auth0/handlers/scimHandler.d.ts +4 -3
  146. package/lib/tools/auth0/handlers/scimHandler.js +110 -132
  147. package/lib/tools/auth0/handlers/selfServiceProfiles.d.ts +11 -3
  148. package/lib/tools/auth0/handlers/selfServiceProfiles.js +170 -208
  149. package/lib/tools/auth0/handlers/tenant.d.ts +5 -3
  150. package/lib/tools/auth0/handlers/tenant.js +45 -52
  151. package/lib/tools/auth0/handlers/themes.d.ts +12 -12
  152. package/lib/tools/auth0/handlers/themes.js +86 -102
  153. package/lib/tools/auth0/handlers/triggers.js +59 -75
  154. package/lib/tools/auth0/handlers/userAttributeProfiles.d.ts +3 -2
  155. package/lib/tools/auth0/handlers/userAttributeProfiles.js +54 -56
  156. package/lib/tools/auth0/index.js +35 -48
  157. package/lib/tools/auth0/schema.js +6 -4
  158. package/lib/tools/calculateChanges.js +24 -15
  159. package/lib/tools/constants.d.ts +2 -2
  160. package/lib/tools/constants.js +0 -1
  161. package/lib/tools/deploy.js +17 -29
  162. package/lib/tools/index.d.ts +3 -88
  163. package/lib/tools/index.js +3 -2
  164. package/lib/tools/utils.d.ts +1 -1
  165. package/lib/tools/utils.js +12 -22
  166. package/lib/tools/validationError.js +0 -1
  167. package/lib/types.d.ts +8 -4
  168. package/lib/types.js +0 -1
  169. package/lib/utils.d.ts +3 -57
  170. package/lib/utils.js +8 -5
  171. package/package.json +12 -11
  172. package/tsconfig.json +4 -3
  173. package/.eslintignore +0 -5
  174. package/.eslintrc +0 -69
  175. package/lib/args.js.map +0 -1
  176. package/lib/commands/export.js.map +0 -1
  177. package/lib/commands/import.js.map +0 -1
  178. package/lib/commands/index.js.map +0 -1
  179. package/lib/configFactory.js.map +0 -1
  180. package/lib/context/defaults.js.map +0 -1
  181. package/lib/context/directory/handlers/actions.js.map +0 -1
  182. package/lib/context/directory/handlers/attackProtection.js.map +0 -1
  183. package/lib/context/directory/handlers/branding.js.map +0 -1
  184. package/lib/context/directory/handlers/clientGrants.js.map +0 -1
  185. package/lib/context/directory/handlers/clients.js.map +0 -1
  186. package/lib/context/directory/handlers/connections.js.map +0 -1
  187. package/lib/context/directory/handlers/customDomains.js.map +0 -1
  188. package/lib/context/directory/handlers/databases.js.map +0 -1
  189. package/lib/context/directory/handlers/emailProvider.js.map +0 -1
  190. package/lib/context/directory/handlers/emailTemplates.js.map +0 -1
  191. package/lib/context/directory/handlers/flowVaultConnections.js.map +0 -1
  192. package/lib/context/directory/handlers/flows.js.map +0 -1
  193. package/lib/context/directory/handlers/forms.js.map +0 -1
  194. package/lib/context/directory/handlers/guardianFactorProviders.js.map +0 -1
  195. package/lib/context/directory/handlers/guardianFactorTemplates.js.map +0 -1
  196. package/lib/context/directory/handlers/guardianFactors.js.map +0 -1
  197. package/lib/context/directory/handlers/guardianPhoneFactorMessageTypes.js.map +0 -1
  198. package/lib/context/directory/handlers/guardianPhoneFactorSelectedProvider.js.map +0 -1
  199. package/lib/context/directory/handlers/guardianPolicies.js.map +0 -1
  200. package/lib/context/directory/handlers/hooks.js.map +0 -1
  201. package/lib/context/directory/handlers/index.js.map +0 -1
  202. package/lib/context/directory/handlers/logStreams.js.map +0 -1
  203. package/lib/context/directory/handlers/networkACLs.js.map +0 -1
  204. package/lib/context/directory/handlers/organizations.js.map +0 -1
  205. package/lib/context/directory/handlers/pages.js.map +0 -1
  206. package/lib/context/directory/handlers/phoneProvider.js.map +0 -1
  207. package/lib/context/directory/handlers/prompts.js.map +0 -1
  208. package/lib/context/directory/handlers/resourceServers.js.map +0 -1
  209. package/lib/context/directory/handlers/roles.js.map +0 -1
  210. package/lib/context/directory/handlers/rules.js.map +0 -1
  211. package/lib/context/directory/handlers/rulesConfigs.js.map +0 -1
  212. package/lib/context/directory/handlers/selfServiceProfiles.js.map +0 -1
  213. package/lib/context/directory/handlers/tenant.js.map +0 -1
  214. package/lib/context/directory/handlers/themes.js.map +0 -1
  215. package/lib/context/directory/handlers/triggers.js.map +0 -1
  216. package/lib/context/directory/handlers/userAttributeProfiles.js.map +0 -1
  217. package/lib/context/directory/index.js.map +0 -1
  218. package/lib/context/index.js.map +0 -1
  219. package/lib/context/yaml/handlers/actions.js.map +0 -1
  220. package/lib/context/yaml/handlers/attackProtection.js.map +0 -1
  221. package/lib/context/yaml/handlers/branding.js.map +0 -1
  222. package/lib/context/yaml/handlers/clientGrants.js.map +0 -1
  223. package/lib/context/yaml/handlers/clients.js.map +0 -1
  224. package/lib/context/yaml/handlers/connections.js.map +0 -1
  225. package/lib/context/yaml/handlers/customDomains.js.map +0 -1
  226. package/lib/context/yaml/handlers/databases.js.map +0 -1
  227. package/lib/context/yaml/handlers/emailProvider.js.map +0 -1
  228. package/lib/context/yaml/handlers/emailTemplates.js.map +0 -1
  229. package/lib/context/yaml/handlers/flowVaultConnections.js.map +0 -1
  230. package/lib/context/yaml/handlers/flows.js.map +0 -1
  231. package/lib/context/yaml/handlers/forms.js.map +0 -1
  232. package/lib/context/yaml/handlers/guardianFactorProviders.js.map +0 -1
  233. package/lib/context/yaml/handlers/guardianFactorTemplates.js.map +0 -1
  234. package/lib/context/yaml/handlers/guardianFactors.js.map +0 -1
  235. package/lib/context/yaml/handlers/guardianPhoneFactorMessageTypes.js.map +0 -1
  236. package/lib/context/yaml/handlers/guardianPhoneFactorSelectedProvider.js.map +0 -1
  237. package/lib/context/yaml/handlers/guardianPolicies.js.map +0 -1
  238. package/lib/context/yaml/handlers/hooks.js.map +0 -1
  239. package/lib/context/yaml/handlers/index.js.map +0 -1
  240. package/lib/context/yaml/handlers/logStreams.js.map +0 -1
  241. package/lib/context/yaml/handlers/networkACLs.js.map +0 -1
  242. package/lib/context/yaml/handlers/organizations.js.map +0 -1
  243. package/lib/context/yaml/handlers/pages.js.map +0 -1
  244. package/lib/context/yaml/handlers/phoneProvider.js.map +0 -1
  245. package/lib/context/yaml/handlers/prompts.js.map +0 -1
  246. package/lib/context/yaml/handlers/resourceServers.js.map +0 -1
  247. package/lib/context/yaml/handlers/roles.js.map +0 -1
  248. package/lib/context/yaml/handlers/rules.js.map +0 -1
  249. package/lib/context/yaml/handlers/rulesConfigs.js.map +0 -1
  250. package/lib/context/yaml/handlers/selfServiceProfiles.js.map +0 -1
  251. package/lib/context/yaml/handlers/tenant.js.map +0 -1
  252. package/lib/context/yaml/handlers/themes.js.map +0 -1
  253. package/lib/context/yaml/handlers/triggers.js.map +0 -1
  254. package/lib/context/yaml/handlers/userAttributeProfiles.js.map +0 -1
  255. package/lib/context/yaml/index.js.map +0 -1
  256. package/lib/index.js.map +0 -1
  257. package/lib/keywordPreservation.js.map +0 -1
  258. package/lib/logger.js.map +0 -1
  259. package/lib/readonly.js.map +0 -1
  260. package/lib/sessionDurationsToMinutes.js.map +0 -1
  261. package/lib/tools/auth0/client.js.map +0 -1
  262. package/lib/tools/auth0/handlers/actions.js.map +0 -1
  263. package/lib/tools/auth0/handlers/attackProtection.js.map +0 -1
  264. package/lib/tools/auth0/handlers/branding.js.map +0 -1
  265. package/lib/tools/auth0/handlers/clientGrants.js.map +0 -1
  266. package/lib/tools/auth0/handlers/clients.js.map +0 -1
  267. package/lib/tools/auth0/handlers/connections.js.map +0 -1
  268. package/lib/tools/auth0/handlers/customDomains.js.map +0 -1
  269. package/lib/tools/auth0/handlers/databases.js.map +0 -1
  270. package/lib/tools/auth0/handlers/default.js.map +0 -1
  271. package/lib/tools/auth0/handlers/emailProvider.js.map +0 -1
  272. package/lib/tools/auth0/handlers/emailTemplates.js.map +0 -1
  273. package/lib/tools/auth0/handlers/flowVaultConnections.js.map +0 -1
  274. package/lib/tools/auth0/handlers/flows.js.map +0 -1
  275. package/lib/tools/auth0/handlers/forms.js.map +0 -1
  276. package/lib/tools/auth0/handlers/guardianFactorProviders.js.map +0 -1
  277. package/lib/tools/auth0/handlers/guardianFactorTemplates.js.map +0 -1
  278. package/lib/tools/auth0/handlers/guardianFactors.js.map +0 -1
  279. package/lib/tools/auth0/handlers/guardianPhoneFactorMessageTypes.js.map +0 -1
  280. package/lib/tools/auth0/handlers/guardianPhoneFactorSelectedProvider.js.map +0 -1
  281. package/lib/tools/auth0/handlers/guardianPolicies.js.map +0 -1
  282. package/lib/tools/auth0/handlers/hooks.js.map +0 -1
  283. package/lib/tools/auth0/handlers/index.js.map +0 -1
  284. package/lib/tools/auth0/handlers/logStreams.js.map +0 -1
  285. package/lib/tools/auth0/handlers/networkACLs.js.map +0 -1
  286. package/lib/tools/auth0/handlers/organizations.js.map +0 -1
  287. package/lib/tools/auth0/handlers/pages.js.map +0 -1
  288. package/lib/tools/auth0/handlers/phoneProvider.js.map +0 -1
  289. package/lib/tools/auth0/handlers/prompts.js.map +0 -1
  290. package/lib/tools/auth0/handlers/resourceServers.js.map +0 -1
  291. package/lib/tools/auth0/handlers/roles.js.map +0 -1
  292. package/lib/tools/auth0/handlers/rules.js.map +0 -1
  293. package/lib/tools/auth0/handlers/rulesConfigs.js.map +0 -1
  294. package/lib/tools/auth0/handlers/scimHandler.js.map +0 -1
  295. package/lib/tools/auth0/handlers/selfServiceProfiles.js.map +0 -1
  296. package/lib/tools/auth0/handlers/tenant.js.map +0 -1
  297. package/lib/tools/auth0/handlers/themes.js.map +0 -1
  298. package/lib/tools/auth0/handlers/triggers.js.map +0 -1
  299. package/lib/tools/auth0/handlers/userAttributeProfiles.js.map +0 -1
  300. package/lib/tools/auth0/index.js.map +0 -1
  301. package/lib/tools/auth0/schema.js.map +0 -1
  302. package/lib/tools/calculateChanges.js.map +0 -1
  303. package/lib/tools/constants.js.map +0 -1
  304. package/lib/tools/deploy.js.map +0 -1
  305. package/lib/tools/index.js.map +0 -1
  306. package/lib/tools/utils.js.map +0 -1
  307. package/lib/tools/validationError.js.map +0 -1
  308. package/lib/types.js.map +0 -1
  309. package/lib/utils.js.map +0 -1
@@ -16,7 +16,7 @@ const logger_1 = __importDefault(require("../logger"));
16
16
  * @returns T
17
17
  */
18
18
  function processChangedObjectFields({ handler, desiredAssetState, currentAssetState, allowDelete, }) {
19
- const desiredAssetStateWithChanges = Object.assign({}, desiredAssetState);
19
+ const desiredAssetStateWithChanges = { ...desiredAssetState };
20
20
  // eslint-disable-next-line no-restricted-syntax
21
21
  for (const fieldName of handler.objectFields) {
22
22
  const areDesiredStateAndCurrentStateEmpty = Object.keys(desiredAssetState[fieldName] || {}).length === 0 &&
@@ -98,18 +98,25 @@ function calculateChanges({ handler, assets, existing, identifiers = ['id', 'nam
98
98
  // Delete from create as it's an update
99
99
  create = create.filter((e) => e !== asset);
100
100
  // Append identifiers to asset
101
- update.push(Object.assign(Object.assign({}, identifiers.reduce((obj, i) => {
102
- if (found[i])
103
- obj[i] = found[i];
104
- return obj;
105
- }, {})), (handler.objectFields.length
106
- ? processChangedObjectFields({
107
- handler,
108
- desiredAssetState: asset,
109
- currentAssetState: found,
110
- allowDelete,
111
- })
112
- : asset)));
101
+ update.push({
102
+ ...identifiers.reduce((obj, i) => {
103
+ if (found[i])
104
+ obj[i] = found[i];
105
+ return obj;
106
+ }, {}),
107
+ // If we have any object fields, we need to make sure that they get
108
+ // special treatment. When different metadata objects are passed to APIv2
109
+ // properties must explicitly be marked for deletion by indicating a `null`
110
+ // value.
111
+ ...(handler.objectFields.length
112
+ ? processChangedObjectFields({
113
+ handler,
114
+ desiredAssetState: asset,
115
+ currentAssetState: found,
116
+ allowDelete,
117
+ })
118
+ : asset),
119
+ });
113
120
  }
114
121
  }
115
122
  });
@@ -134,7 +141,10 @@ function calculateChanges({ handler, assets, existing, identifiers = ['id', 'nam
134
141
  const conflict = (existing || []).filter((e) => e.name === a.name && e[uniqueID] !== a[uniqueID])[0];
135
142
  if (conflict) {
136
143
  const temp = Math.random().toString(36).substr(2, 5);
137
- conflicts.push(Object.assign(Object.assign({}, conflict), { name: `${conflict.name}-${temp}` }));
144
+ conflicts.push({
145
+ ...conflict,
146
+ name: `${conflict.name}-${temp}`,
147
+ });
138
148
  }
139
149
  }
140
150
  });
@@ -146,4 +156,3 @@ function calculateChanges({ handler, assets, existing, identifiers = ['id', 'nam
146
156
  create,
147
157
  };
148
158
  }
149
- //# sourceMappingURL=calculateChanges.js.map
@@ -1,4 +1,4 @@
1
- import { GetEmailTemplatesByTemplateNameTemplateNameEnum } from 'auth0';
1
+ import { Management } from 'auth0';
2
2
  declare const constants: {
3
3
  CONCURRENT_CALLS: number;
4
4
  RULES_DIRECTORY: string;
@@ -18,7 +18,7 @@ declare const constants: {
18
18
  DATABASE_CONNECTIONS_DIRECTORY: string;
19
19
  DATABASE_SCRIPTS_CHANGE_EMAIL: string;
20
20
  DATABASE_SCRIPTS_GET_USER: string;
21
- EMAIL_TEMPLATES_TYPES: GetEmailTemplatesByTemplateNameTemplateNameEnum[];
21
+ EMAIL_TEMPLATES_TYPES: Management.EmailTemplateNameEnum[];
22
22
  ACTIONS_TRIGGERS: string[];
23
23
  EMAIL_TEMPLATES_DIRECTORY: string;
24
24
  EMAIL_VERIFY: string;
@@ -213,4 +213,3 @@ const constants = {
213
213
  USER_ATTRIBUTE_PROFILES_DIRECTORY: 'user-attribute-profiles',
214
214
  };
215
215
  exports.default = constants;
216
- //# sourceMappingURL=constants.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
  };
@@ -15,24 +6,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
6
  exports.default = deploy;
16
7
  const auth0_1 = __importDefault(require("./auth0"));
17
8
  const logger_1 = __importDefault(require("../logger"));
18
- function deploy(assets, client, config) {
19
- return __awaiter(this, void 0, void 0, function* () {
20
- // Setup log level
21
- logger_1.default.level = process.env.AUTH0_DEBUG === 'true' ? 'debug' : 'info';
22
- logger_1.default.info(`Getting access token for ${config('AUTH0_CLIENT_ID') !== undefined ? `${config('AUTH0_CLIENT_ID')}/` : ''}${config('AUTH0_DOMAIN')}`);
23
- const auth0 = new auth0_1.default(client, assets, config);
24
- // Validate Assets
25
- yield auth0.validate();
26
- // Process changes
27
- yield auth0.processChanges();
28
- return auth0.handlers.reduce((accum, h) => {
29
- accum[h.type] = {
30
- deleted: h.deleted,
31
- created: h.created,
32
- updated: h.updated,
33
- };
34
- return accum;
35
- }, {});
36
- });
9
+ async function deploy(assets, client, config) {
10
+ // Setup log level
11
+ logger_1.default.level = process.env.AUTH0_DEBUG === 'true' ? 'debug' : 'info';
12
+ logger_1.default.info(`Getting access token for ${config('AUTH0_CLIENT_ID') !== undefined ? `${config('AUTH0_CLIENT_ID')}/` : ''}${config('AUTH0_DOMAIN')}`);
13
+ const auth0 = new auth0_1.default(client, assets, config);
14
+ // Validate Assets
15
+ await auth0.validate();
16
+ // Process changes
17
+ await auth0.processChanges();
18
+ return auth0.handlers.reduce((accum, h) => {
19
+ accum[h.type] = {
20
+ deleted: h.deleted,
21
+ created: h.created,
22
+ updated: h.updated,
23
+ };
24
+ return accum;
25
+ }, {});
37
26
  }
38
- //# sourceMappingURL=deploy.js.map
@@ -2,98 +2,13 @@ import constants from './constants';
2
2
  import deploy from './deploy';
3
3
  import Auth0 from './auth0';
4
4
  import { keywordReplace, loadFileAndReplaceKeywords, wrapArrayReplaceMarkersInQuotes } from './utils';
5
- declare const _default: {
6
- constants: {
7
- CONCURRENT_CALLS: number;
8
- RULES_DIRECTORY: string;
9
- RULES_STAGES: string[];
10
- DEFAULT_RULE_STAGE: string;
11
- HOOKS_HIDDEN_SECRET_VALUE: string;
12
- OBFUSCATED_SECRET_VALUE: string;
13
- HOOKS_DIRECTORY: string;
14
- ACTIONS_DIRECTORY: string;
15
- TRIGGERS_DIRECTORY: string;
16
- RULES_CONFIGS_DIRECTORY: string;
17
- PAGES_DIRECTORY: string;
18
- PAGE_LOGIN: string;
19
- PAGE_GUARDIAN_MULTIFACTOR: string;
20
- PAGE_PASSWORD_RESET: string;
21
- PAGE_ERROR: string;
22
- DATABASE_CONNECTIONS_DIRECTORY: string;
23
- DATABASE_SCRIPTS_CHANGE_EMAIL: string;
24
- DATABASE_SCRIPTS_GET_USER: string;
25
- EMAIL_TEMPLATES_TYPES: import("auth0").GetEmailTemplatesByTemplateNameTemplateNameEnum[];
26
- ACTIONS_TRIGGERS: string[];
27
- EMAIL_TEMPLATES_DIRECTORY: string;
28
- EMAIL_VERIFY: string;
29
- EMAIL_VERIFY_BY_CODE: string;
30
- EMAIL_RESET: string;
31
- EMAIL_RESET_BY_CODE: string;
32
- EMAIL_WELCOME: string;
33
- EMAIL_BLOCKED: string;
34
- EMAIL_STOLEN_CREDENTIALS: string;
35
- EMAIL_ENROLLMENT: string;
36
- EMAIL_CHANGE_PASSWORD: string;
37
- EMAIL_PASSWORD_RESET: string;
38
- EMAIL_MFA_OOB_CODE: string;
39
- EMAIL_USER_INVITATION: string;
40
- EMAIL_ASYNC_APPROVAL: string;
41
- GUARDIAN_DIRECTORY: string;
42
- GUARDIAN_FACTORS_DIRECTORY: string;
43
- GUARDIAN_PROVIDERS_DIRECTORY: string;
44
- GUARDIAN_TEMPLATES_DIRECTORY: string;
45
- UNIVERSAL_LOGIN_TEMPLATE: string;
46
- RESOURCE_SERVERS_DIRECTORY: string;
47
- RESOURCE_SERVERS_CLIENT_NAME: string;
48
- RESOURCE_SERVERS_MANAGEMENT_API_NAME: string;
49
- RESOURCE_SERVERS_ID_NAME: string;
50
- CLIENTS_DIRECTORY: string;
51
- CLIENTS_GRANTS_DIRECTORY: string;
52
- BRANDING_DIRECTORY: string;
53
- PHONE_PROVIDER_DIRECTORY: string;
54
- BRANDING_TEMPLATES_DIRECTORY: string;
55
- BRANDING_TEMPLATES_YAML_DIRECTORY: string;
56
- CLIENTS_CLIENT_NAME: string;
57
- CLIENTS_CLIENT_ID_NAME: string;
58
- CONNECTIONS_DIRECTORY: string;
59
- CONNECTIONS_CLIENT_NAME: string;
60
- CONNECTIONS_ID_NAME: string;
61
- ROLES_DIRECTORY: string;
62
- ATTACK_PROTECTION_DIRECTORY: string;
63
- GUARDIAN_FACTORS: string[];
64
- GUARDIAN_POLICIES: string[];
65
- GUARDIAN_PHONE_PROVIDERS: string[];
66
- GUARDIAN_PHONE_MESSAGE_TYPES: string[];
67
- GUARDIAN_FACTOR_TEMPLATES: string[];
68
- GUARDIAN_FACTOR_PROVIDERS: {
69
- sms: string[];
70
- 'push-notification': string[];
71
- };
72
- PAGE_NAMES: string[];
73
- DATABASE_SCRIPTS: string[];
74
- DATABASE_SCRIPTS_NO_IMPORT: string[];
75
- DATABASE_SCRIPTS_IMPORT: string[];
76
- EMAIL_TEMPLATES_NAMES: string[];
77
- SUPPORTED_BRANDING_TEMPLATES: string[];
78
- LOG_STREAMS_DIRECTORY: string;
79
- PROMPTS_DIRECTORY: string;
80
- PROMPTS_SCREEN_RENDER_DIRECTORY: string;
81
- PARTIALS_DIRECTORY: string;
82
- CUSTOM_DOMAINS_DIRECTORY: string;
83
- THEMES_DIRECTORY: string;
84
- CONNECTION_APP_ID: string[];
85
- FORMS_DIRECTORY: string;
86
- FLOWS_DIRECTORY: string;
87
- FLOWS_VAULT_DIRECTORY: string;
88
- SELF_SERVICE_PROFILE_DIRECTORY: string;
89
- NETWORK_ACLS_DIRECTORY: string;
90
- USER_ATTRIBUTE_PROFILES_DIRECTORY: string;
91
- };
5
+ declare const tools: {
6
+ constants: typeof constants;
92
7
  deploy: typeof deploy;
93
8
  keywordReplace: typeof keywordReplace;
94
9
  loadFileAndReplaceKeywords: typeof loadFileAndReplaceKeywords;
95
10
  wrapArrayReplaceMarkersInQuotes: typeof wrapArrayReplaceMarkersInQuotes;
96
11
  Auth0: typeof Auth0;
97
12
  };
98
- export default _default;
13
+ export default tools;
99
14
  export { constants, deploy, keywordReplace, loadFileAndReplaceKeywords, wrapArrayReplaceMarkersInQuotes, Auth0, };
@@ -14,7 +14,8 @@ const utils_1 = require("./utils");
14
14
  Object.defineProperty(exports, "keywordReplace", { enumerable: true, get: function () { return utils_1.keywordReplace; } });
15
15
  Object.defineProperty(exports, "loadFileAndReplaceKeywords", { enumerable: true, get: function () { return utils_1.loadFileAndReplaceKeywords; } });
16
16
  Object.defineProperty(exports, "wrapArrayReplaceMarkersInQuotes", { enumerable: true, get: function () { return utils_1.wrapArrayReplaceMarkersInQuotes; } });
17
- exports.default = {
17
+ // Explicit type to avoid non-portable type inference
18
+ const tools = {
18
19
  constants: constants_1.default,
19
20
  deploy: deploy_1.default,
20
21
  keywordReplace: utils_1.keywordReplace,
@@ -22,4 +23,4 @@ exports.default = {
22
23
  wrapArrayReplaceMarkersInQuotes: utils_1.wrapArrayReplaceMarkersInQuotes,
23
24
  Auth0: auth0_1.default,
24
25
  };
25
- //# sourceMappingURL=index.js.map
26
+ exports.default = tools;
@@ -3,7 +3,7 @@ export declare const keywordReplaceArrayRegExp: (key: any) => RegExp;
3
3
  export declare const keywordReplaceStringRegExp: (key: any) => RegExp;
4
4
  export declare function keywordArrayReplace(input: string, mappings: KeywordMappings): string;
5
5
  export declare function keywordStringReplace(input: string, mappings: KeywordMappings): string;
6
- export declare function keywordReplace(input: string, mappings: KeywordMappings): string;
6
+ export declare function keywordReplace(input: string | undefined, mappings: KeywordMappings): string;
7
7
  export declare function wrapArrayReplaceMarkersInQuotes(body: string, mappings: KeywordMappings): string;
8
8
  export declare function convertClientNameToId(name: string, clients: Asset[]): string;
9
9
  export declare function convertClientNamesToIds(names: string[], clients: Asset[]): string[];
@@ -32,15 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
- return new (P || (P = Promise))(function (resolve, reject) {
38
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
- step((generator = generator.apply(thisArg, _arguments || [])).next());
42
- });
43
- };
44
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
45
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
46
37
  };
@@ -100,6 +91,9 @@ function keywordStringReplace(input, mappings) {
100
91
  }
101
92
  function keywordReplace(input, mappings) {
102
93
  // Replace keywords with mappings within input.
94
+ if (input === undefined) {
95
+ return 'undefined';
96
+ }
103
97
  if (mappings && Object.keys(mappings).length > 0) {
104
98
  input = keywordArrayReplace(input, mappings);
105
99
  input = keywordStringReplace(input, mappings);
@@ -158,7 +152,7 @@ function convertJsonToString(obj, spacing = 0) {
158
152
  function stripFields(obj, fields) {
159
153
  // Strip object fields supporting dot notation (ie: a.deep.field)
160
154
  const stripped = [];
161
- const newObj = Object.assign({}, obj);
155
+ const newObj = { ...obj };
162
156
  fields.forEach((f) => {
163
157
  if (dot_prop_1.default.get(newObj, f) !== undefined) {
164
158
  dot_prop_1.default.delete(newObj, f);
@@ -228,7 +222,7 @@ const obfuscateSensitiveValues = (data, sensitiveFieldsToObfuscate) => {
228
222
  if (Array.isArray(data)) {
229
223
  return data.map((asset) => (0, exports.obfuscateSensitiveValues)(asset, sensitiveFieldsToObfuscate));
230
224
  }
231
- const newAsset = Object.assign({}, data);
225
+ const newAsset = { ...data };
232
226
  sensitiveFieldsToObfuscate.forEach((sensitiveField) => {
233
227
  if (dot_prop_1.default.get(newAsset, sensitiveField) !== undefined) {
234
228
  dot_prop_1.default.set(newAsset, sensitiveField, constants_1.default.OBFUSCATED_SECRET_VALUE);
@@ -244,7 +238,7 @@ const stripObfuscatedFieldsFromPayload = (data, obfuscatedFields) => {
244
238
  if (Array.isArray(data)) {
245
239
  return data.map((asset) => (0, exports.stripObfuscatedFieldsFromPayload)(asset, obfuscatedFields));
246
240
  }
247
- const newAsset = Object.assign({}, data);
241
+ const newAsset = { ...data };
248
242
  obfuscatedFields.forEach((sensitiveField) => {
249
243
  const obfuscatedFieldValue = dot_prop_1.default.get(newAsset, sensitiveField);
250
244
  if (obfuscatedFieldValue === constants_1.default.OBFUSCATED_SECRET_VALUE) {
@@ -254,10 +248,9 @@ const stripObfuscatedFieldsFromPayload = (data, obfuscatedFields) => {
254
248
  return newAsset;
255
249
  };
256
250
  exports.stripObfuscatedFieldsFromPayload = stripObfuscatedFieldsFromPayload;
257
- const detectInsufficientScopeError = (fn) => __awaiter(void 0, void 0, void 0, function* () {
258
- var _a, _b;
251
+ const detectInsufficientScopeError = async (fn) => {
259
252
  try {
260
- const data = yield fn();
253
+ const data = await fn();
261
254
  return {
262
255
  hadSufficientScopes: true,
263
256
  data,
@@ -266,7 +259,7 @@ const detectInsufficientScopeError = (fn) => __awaiter(void 0, void 0, void 0, f
266
259
  }
267
260
  catch (err) {
268
261
  if (err.statusCode === 403 && err.message.includes('Insufficient scope')) {
269
- const requiredScopes = (_b = (_a = err.message) === null || _a === void 0 ? void 0 : _a.split('Insufficient scope, expected any of: ')) === null || _b === void 0 ? void 0 : _b.slice(1);
262
+ const requiredScopes = err.message?.split('Insufficient scope, expected any of: ')?.slice(1);
270
263
  return {
271
264
  hadSufficientScopes: false,
272
265
  requiredScopes,
@@ -275,22 +268,20 @@ const detectInsufficientScopeError = (fn) => __awaiter(void 0, void 0, void 0, f
275
268
  }
276
269
  throw err;
277
270
  }
278
- });
271
+ };
279
272
  exports.detectInsufficientScopeError = detectInsufficientScopeError;
280
273
  function sleep(ms) {
281
274
  return new Promise((resolve) => setTimeout(resolve, ms));
282
275
  }
283
276
  const isDeprecatedError = (err) => {
284
- var _a;
285
277
  if (!err)
286
278
  return false;
287
- return !!(err.statusCode === 403 || ((_a = err.message) === null || _a === void 0 ? void 0 : _a.includes('deprecated feature')));
279
+ return !!(err.statusCode === 403 || err.message?.includes('deprecated feature'));
288
280
  };
289
281
  exports.isDeprecatedError = isDeprecatedError;
290
282
  const isForbiddenFeatureError = (err, type) => {
291
- var _a;
292
283
  if (err.statusCode === 403) {
293
- logger_1.default.warn(`${err.message};${(_a = err.errorCode) !== null && _a !== void 0 ? _a : ''} - Skipping ${type}`);
284
+ logger_1.default.warn(`${err.message};${err.errorCode ?? ''} - Skipping ${type}`);
294
285
  return true;
295
286
  }
296
287
  return false;
@@ -306,4 +297,3 @@ function maskSecretAtPath({ resourceTypeName, maskedKeyName, maskOnObj, keyJsonP
306
297
  }
307
298
  return maskOnObj;
308
299
  }
309
- //# sourceMappingURL=utils.js.map
@@ -12,4 +12,3 @@ function ValidationError(message) {
12
12
  ValidationError.prototype = Object.create(Error.prototype);
13
13
  ValidationError.prototype.constructor = ValidationError;
14
14
  exports.default = ValidationError;
15
- //# sourceMappingURL=validationError.js.map
package/lib/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { CustomDomain, GetConnectionsStrategyEnum, ManagementClient, ResourceServer, UserAttributeProfile } from 'auth0';
1
+ import { Management, ManagementClient } from 'auth0';
2
2
  import { PromisePoolExecutor } from 'promise-pool-executor';
3
3
  import { Action } from './tools/auth0/handlers/actions';
4
4
  import { Prompts } from './tools/auth0/handlers/prompts';
@@ -14,6 +14,7 @@ import { FlowVaultConnection } from './tools/auth0/handlers/flowVaultConnections
14
14
  import { SsProfileWithCustomText } from './tools/auth0/handlers/selfServiceProfiles';
15
15
  import { PhoneProvider } from './tools/auth0/handlers/phoneProvider';
16
16
  import { NetworkACL } from './tools/auth0/handlers/networkACLs';
17
+ import { UserAttributeProfile } from './tools/auth0/handlers/userAttributeProfiles';
17
18
  import { AttackProtection } from './tools/auth0/handlers/attackProtection';
18
19
  type SharedPaginationParams = {
19
20
  checkpoint?: boolean;
@@ -21,7 +22,7 @@ type SharedPaginationParams = {
21
22
  is_global?: boolean;
22
23
  include_totals?: boolean;
23
24
  id?: string;
24
- strategy?: GetConnectionsStrategyEnum[];
25
+ strategy?: Management.ConnectionStrategyEnum[];
25
26
  };
26
27
  export type CheckpointPaginationParams = SharedPaginationParams & {
27
28
  from?: string;
@@ -58,6 +59,9 @@ export type Config = {
58
59
  AUTH0_BASE_PATH?: string;
59
60
  AUTH0_AUDIENCE?: string;
60
61
  AUTH0_API_MAX_RETRIES?: number;
62
+ AUTH0_MAX_RETRIES?: number;
63
+ AUTH0_RETRY_INITIAL_DELAY_MS?: number;
64
+ AUTH0_RETRY_MAX_DELAY_MS?: number;
61
65
  AUTH0_KEYWORD_REPLACE_MAPPINGS?: KeywordMappings;
62
66
  AUTH0_EXPORT_IDENTIFIERS?: boolean;
63
67
  AUTH0_CONNECTIONS_DIRECTORY?: string;
@@ -92,7 +96,7 @@ export type Assets = Partial<{
92
96
  clients: Client[] | null;
93
97
  clientGrants: ClientGrant[] | null;
94
98
  connections: Asset[] | null;
95
- customDomains: CustomDomain[] | null;
99
+ customDomains: Management.CustomDomain[] | null;
96
100
  databases: Asset[] | null;
97
101
  emailProvider: Asset | null;
98
102
  emailTemplates: Asset[] | null;
@@ -111,7 +115,7 @@ export type Assets = Partial<{
111
115
  organizations: Asset[] | null;
112
116
  pages: Page[] | null;
113
117
  prompts: Prompts | null;
114
- resourceServers: ResourceServer[] | null;
118
+ resourceServers: Management.ResourceServer[] | null;
115
119
  roles: Asset[] | null;
116
120
  rules: Asset[] | null;
117
121
  rulesConfigs: Asset[] | null;
package/lib/types.js CHANGED
@@ -84,4 +84,3 @@ exports.languages = [
84
84
  'zh-HK',
85
85
  'zh-TW',
86
86
  ];
87
- //# sourceMappingURL=types.js.map
package/lib/utils.d.ts CHANGED
@@ -12,62 +12,8 @@ export declare function dumpJSON(file: string, mappings: {
12
12
  }): void;
13
13
  export declare function existsMustBeDir(folder: string): boolean;
14
14
  export declare function toConfigFn(data: Config): (arg0: keyof Config) => any;
15
- export declare function stripIdentifiers(auth0: Auth0, assets: Assets): {
16
- actions?: import("./tools/auth0/handlers/actions").Action[] | null | undefined;
17
- attackProtection?: import("./tools/auth0/handlers/attackProtection").AttackProtection | null | undefined;
18
- branding?: (Asset & {
19
- templates?: {
20
- template: string;
21
- body: string;
22
- }[] | null;
23
- }) | null | undefined;
24
- phoneProviders?: import("auth0").GetBrandingPhoneProviders200ResponseProvidersInner[] | null | undefined;
25
- clients?: import("./tools/auth0/handlers/clients").Client[] | null | undefined;
26
- clientGrants?: import("./tools/auth0/handlers/clientGrants").ClientGrant[] | null | undefined;
27
- connections?: Asset[] | null | undefined;
28
- customDomains?: import("auth0").CustomDomain[] | null | undefined;
29
- databases?: Asset[] | null | undefined;
30
- emailProvider?: Asset | null | undefined;
31
- emailTemplates?: Asset[] | null | undefined;
32
- guardianFactorProviders?: Asset[] | null | undefined;
33
- guardianFactors?: Asset[] | null | undefined;
34
- guardianFactorTemplates?: Asset[] | null | undefined;
35
- guardianPhoneFactorMessageTypes?: {
36
- message_types: Asset[];
37
- } | null | undefined;
38
- guardianPhoneFactorSelectedProvider?: Asset | null | undefined;
39
- guardianPolicies?: {
40
- policies: string[];
41
- } | null | undefined;
42
- hooks?: Asset[] | null | undefined;
43
- logStreams?: import("./tools/auth0/handlers/logStreams").LogStream[] | null | undefined;
44
- organizations?: Asset[] | null | undefined;
45
- pages?: import("./tools/auth0/handlers/pages").Page[] | null | undefined;
46
- prompts?: Partial<import("./tools/auth0/handlers/prompts").PromptSettings & {
47
- customText: import("./tools/auth0/handlers/prompts").AllPromptsByLanguage;
48
- partials: import("./tools/auth0/handlers/prompts").CustomPromptPartials;
49
- screenRenderers?: import("./tools/auth0/handlers/prompts").ScreenRenderer[];
50
- }> | null | undefined;
51
- resourceServers?: import("auth0").ResourceServer[] | null | undefined;
52
- roles?: Asset[] | null | undefined;
53
- rules?: Asset[] | null | undefined;
54
- rulesConfigs?: Asset[] | null | undefined;
55
- tenant?: import("auth0").TenantSettings | null | undefined;
56
- triggers?: Asset[] | null | undefined;
57
- exclude?: {
58
- [key: string]: string[];
59
- } | undefined;
60
- clientsOrig?: Asset[] | null | undefined;
61
- themes?: import("auth0").PostBrandingTheme200Response[] | null | undefined;
62
- forms?: import("./tools/auth0/handlers/forms").Form[] | null | undefined;
63
- flows?: import("./tools/auth0/handlers/flows").Flow[] | null | undefined;
64
- flowVaultConnections?: import("./tools/auth0/handlers/flowVaultConnections").FlowVaultConnection[] | null | undefined;
65
- selfServiceProfiles?: import("./tools/auth0/handlers/selfServiceProfiles").SsProfileWithCustomText[] | null | undefined;
66
- networkACLs?: import("auth0").GetNetworkAclsById200Response[] | null | undefined;
67
- userAttributeProfiles?: import("auth0").UserAttributeProfile[] | null | undefined;
68
- userAttributeProfilesWithId?: import("auth0").UserAttributeProfile[] | null | undefined;
69
- };
70
- export declare function sanitize(str: string): string;
15
+ export declare function stripIdentifiers(auth0: Auth0, assets: Assets): Assets;
16
+ export declare function sanitize(str: string | undefined): string;
71
17
  type ImportantFields = {
72
18
  name: string | null;
73
19
  client_id: string | null;
@@ -84,7 +30,7 @@ export declare function recordsSorter(a: Partial<ImportantFields>, b: Partial<Im
84
30
  export declare function clearTenantFlags(tenant: Asset): void;
85
31
  export declare function ensureProp(obj: Asset, props: string): void;
86
32
  export declare function clearClientArrays(client: Asset): Asset;
87
- export declare function convertClientIdToName(clientId: string, knownClients?: Asset[]): string;
33
+ export declare function convertClientIdToName(clientId: string | undefined, knownClients?: Asset[]): string;
88
34
  export declare function hasKeywordMarkers(value: any): boolean;
89
35
  export declare function mapClientID2NameSorted(enabledClients: string[] | string, knownClients: Asset[]): string[] | string;
90
36
  export declare function nomalizedYAMLPath(filePath: string): string[];
package/lib/utils.js CHANGED
@@ -92,7 +92,7 @@ function toConfigFn(data) {
92
92
  return (key) => data[key];
93
93
  }
94
94
  function stripIdentifiers(auth0, assets) {
95
- const updated = Object.assign({}, assets);
95
+ const updated = { ...assets };
96
96
  // Some of the object identifiers are required to perform updates.
97
97
  // Don't strip these object id's
98
98
  const ignore = [
@@ -111,7 +111,7 @@ function stripIdentifiers(auth0, assets) {
111
111
  // All objects with the identifier field is an array. This could change in future.
112
112
  if (Array.isArray(exist)) {
113
113
  updated[h.type] = exist.map((o) => {
114
- const newObj = Object.assign({}, o);
114
+ const newObj = { ...o };
115
115
  delete newObj[h.id];
116
116
  return newObj;
117
117
  });
@@ -120,6 +120,8 @@ function stripIdentifiers(auth0, assets) {
120
120
  return updated;
121
121
  }
122
122
  function sanitize(str) {
123
+ if (!str)
124
+ return 'undefined';
123
125
  return (0, sanitize_filename_1.default)(str, { replacement: '-' });
124
126
  }
125
127
  function formatResults(item) {
@@ -137,7 +139,7 @@ function formatResults(item) {
137
139
  stage: null,
138
140
  id: null,
139
141
  };
140
- const result = Object.assign({}, importantFields);
142
+ const result = { ...importantFields };
141
143
  Object.entries(item)
142
144
  .sort()
143
145
  .forEach(([key, value]) => {
@@ -182,6 +184,8 @@ function clearClientArrays(client) {
182
184
  return client;
183
185
  }
184
186
  function convertClientIdToName(clientId, knownClients = []) {
187
+ if (!clientId)
188
+ return 'undefined_clientId';
185
189
  try {
186
190
  const found = knownClients.find((c) => c.client_id === clientId);
187
191
  return (found && found.name) || clientId;
@@ -262,10 +266,9 @@ exports.findKeyPathWithValue = findKeyPathWithValue;
262
266
  * @returns The Base64 encoded certificate string if the input starts with '-----BEGIN CERTIFICATE-----', otherwise returns the original string.
263
267
  */
264
268
  const encodeCertStringToBase64 = (cert) => {
265
- if (cert === null || cert === void 0 ? void 0 : cert.startsWith('-----BEGIN CERTIFICATE-----')) {
269
+ if (cert?.startsWith('-----BEGIN CERTIFICATE-----')) {
266
270
  return Buffer.from(cert).toString('base64');
267
271
  }
268
272
  return cert;
269
273
  };
270
274
  exports.encodeCertStringToBase64 = encodeCertStringToBase64;
271
- //# sourceMappingURL=utils.js.map
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "auth0-deploy-cli",
3
- "version": "8.20.2",
3
+ "version": "8.20.4-beta.0",
4
4
  "description": "A command line tool for deploying updates to your Auth0 tenant",
5
5
  "main": "lib/index.js",
6
6
  "bin": {
7
7
  "a0deploy": "lib/index.js"
8
8
  },
9
9
  "scripts": {
10
- "lint:fix": "eslint --fix --ignore-path .eslintignore --ignore-pattern webpack . && kacl lint",
11
- "lint": "eslint --ignore-path .eslintignore --ignore-pattern webpack . && kacl lint",
10
+ "lint:fix": "eslint --fix . && kacl lint",
11
+ "lint": "eslint . && kacl lint",
12
12
  "format": "npx prettier --write .",
13
13
  "test": "ts-mocha -p tsconfig.json --recursive 'test/**/*.test*' --exclude 'test/e2e/*' --timeout 20000",
14
14
  "test:e2e:node-module": "ts-mocha -p tsconfig.json --recursive 'test/e2e/*.test*' --timeout 120000",
@@ -33,10 +33,10 @@
33
33
  "homepage": "https://github.com/auth0/auth0-deploy-cli#readme",
34
34
  "dependencies": {
35
35
  "ajv": "^6.12.6",
36
- "auth0": "^4.36.0",
36
+ "auth0": "^5.1.0",
37
37
  "dot-prop": "^5.3.0",
38
38
  "fs-extra": "^10.1.0",
39
- "js-yaml": "^4.1.0",
39
+ "js-yaml": "^4.1.1",
40
40
  "lodash": "^4.17.21",
41
41
  "mkdirp": "^1.0.4",
42
42
  "nconf": "^0.13.0",
@@ -51,13 +51,15 @@
51
51
  "@types/lodash": "^4.17.20",
52
52
  "@types/mocha": "^10.0.10",
53
53
  "@types/nconf": "^0.10.7",
54
- "@typescript-eslint/parser": "^5.62.0",
54
+ "@eslint/js": "^9.39.1",
55
+ "@typescript-eslint/eslint-plugin": "^8.47.0",
56
+ "@typescript-eslint/parser": "^8.47.0",
55
57
  "chai": "^4.5.0",
56
58
  "chai-as-promised": "^7.1.2",
57
- "eslint": "^7.32.0",
58
- "eslint-config-airbnb-base": "^15.0.0",
59
+ "eslint": "^9.39.1",
59
60
  "eslint-config-prettier": "^10.1.8",
60
61
  "eslint-plugin-import": "^2.32.0",
62
+ "globals": "^15.12.0",
61
63
  "husky": "^9.1.7",
62
64
  "kacl": "^1.1.1",
63
65
  "mocha": "^10.8.2",
@@ -71,11 +73,10 @@
71
73
  "sinon": "^13.0.2",
72
74
  "sinon-chai": "^3.7.0",
73
75
  "ts-mocha": "^10.1.0",
74
- "typescript": "^5.9.2",
75
- "zlib": "^1.0.5"
76
+ "typescript": "^5.9.3"
76
77
  },
77
78
  "engines": {
78
- "node": ">=20.18.1"
79
+ "node": ">=20.19.0"
79
80
  },
80
81
  "keywords": [
81
82
  "auth0",
package/tsconfig.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "es2016",
3
+ "target": "es2020",
4
4
  "experimentalDecorators": true,
5
- "module": "commonjs",
5
+ "module": "nodenext",
6
+ "moduleResolution": "nodenext",
6
7
  "rootDir": "./src",
7
8
  "allowJs": true,
8
9
  "outDir": "./lib",
9
- "sourceMap": true,
10
+ "sourceMap": false,
10
11
  "esModuleInterop": true,
11
12
  "forceConsistentCasingInFileNames": true,
12
13
  "strict": false,
package/.eslintignore DELETED
@@ -1,5 +0,0 @@
1
- examples/
2
- test/e2e/testdata/**/**
3
- local/
4
- node_modules/
5
- lib/