auth0-deploy-cli 9.0.0-beta.2 → 9.0.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 (126) hide show
  1. package/AGENTS.md +2 -357
  2. package/CHANGELOG.md +158 -10
  3. package/CLAUDE.md +138 -2
  4. package/README.md +1 -1
  5. package/lib/context/defaults.d.ts +7 -0
  6. package/lib/context/defaults.js +74 -30
  7. package/lib/context/directory/handlers/actionModules.js +1 -4
  8. package/lib/context/directory/handlers/actions.js +1 -4
  9. package/lib/context/directory/handlers/attackProtection.js +1 -1
  10. package/lib/context/directory/handlers/branding.js +4 -1
  11. package/lib/context/directory/handlers/clientAuthCredentials.d.ts +5 -0
  12. package/lib/context/directory/handlers/clientAuthCredentials.js +13 -0
  13. package/lib/context/directory/handlers/clientGrants.js +78 -24
  14. package/lib/context/directory/handlers/clients.js +20 -3
  15. package/lib/context/directory/handlers/connections.js +19 -5
  16. package/lib/context/directory/handlers/databases.js +1 -4
  17. package/lib/context/directory/handlers/emailTemplates.js +5 -0
  18. package/lib/context/directory/handlers/guardianEmailFactorSettings.d.ts +5 -0
  19. package/lib/context/directory/handlers/guardianEmailFactorSettings.js +38 -0
  20. package/lib/context/directory/handlers/guardianPhoneFactorSettings.d.ts +5 -0
  21. package/lib/context/directory/handlers/guardianPhoneFactorSettings.js +38 -0
  22. package/lib/context/directory/handlers/guardianSettings.d.ts +5 -0
  23. package/lib/context/directory/handlers/guardianSettings.js +38 -0
  24. package/lib/context/directory/handlers/hooks.js +1 -4
  25. package/lib/context/directory/handlers/index.js +12 -0
  26. package/lib/context/directory/handlers/networkACLKeys.d.ts +6 -0
  27. package/lib/context/directory/handlers/networkACLKeys.js +54 -0
  28. package/lib/context/directory/handlers/prompts.js +7 -3
  29. package/lib/context/directory/handlers/rateLimitPolicies.d.ts +6 -0
  30. package/lib/context/directory/handlers/rateLimitPolicies.js +53 -0
  31. package/lib/context/directory/handlers/rules.js +1 -4
  32. package/lib/context/directory/index.js +1 -4
  33. package/lib/context/index.js +31 -31
  34. package/lib/context/yaml/handlers/attackProtection.js +1 -1
  35. package/lib/context/yaml/handlers/branding.js +4 -1
  36. package/lib/context/yaml/handlers/clientAuthCredentials.d.ts +5 -0
  37. package/lib/context/yaml/handlers/clientAuthCredentials.js +13 -0
  38. package/lib/context/yaml/handlers/clients.js +19 -1
  39. package/lib/context/yaml/handlers/connections.js +8 -1
  40. package/lib/context/yaml/handlers/flows.js +3 -0
  41. package/lib/context/yaml/handlers/forms.js +3 -0
  42. package/lib/context/yaml/handlers/guardianEmailFactorSettings.d.ts +5 -0
  43. package/lib/context/yaml/handlers/guardianEmailFactorSettings.js +15 -0
  44. package/lib/context/yaml/handlers/guardianPhoneFactorSettings.d.ts +5 -0
  45. package/lib/context/yaml/handlers/guardianPhoneFactorSettings.js +15 -0
  46. package/lib/context/yaml/handlers/guardianSettings.d.ts +5 -0
  47. package/lib/context/yaml/handlers/guardianSettings.js +15 -0
  48. package/lib/context/yaml/handlers/index.js +12 -0
  49. package/lib/context/yaml/handlers/networkACLKeys.d.ts +6 -0
  50. package/lib/context/yaml/handlers/networkACLKeys.js +42 -0
  51. package/lib/context/yaml/handlers/prompts.js +3 -1
  52. package/lib/context/yaml/handlers/rateLimitPolicies.d.ts +6 -0
  53. package/lib/context/yaml/handlers/rateLimitPolicies.js +27 -0
  54. package/lib/context/yaml/index.js +1 -4
  55. package/lib/keywordPreservation.d.ts +1 -1
  56. package/lib/keywordPreservation.js +2 -1
  57. package/lib/readonly.js +5 -0
  58. package/lib/tools/auth0/handlers/attackProtection.js +19 -6
  59. package/lib/tools/auth0/handlers/clientAuthCredentials.d.ts +27 -0
  60. package/lib/tools/auth0/handlers/clientAuthCredentials.js +234 -0
  61. package/lib/tools/auth0/handlers/clientAuthCredentialsPre.d.ts +38 -0
  62. package/lib/tools/auth0/handlers/clientAuthCredentialsPre.js +123 -0
  63. package/lib/tools/auth0/handlers/clientGrants.d.ts +1 -1
  64. package/lib/tools/auth0/handlers/clients.d.ts +106 -0
  65. package/lib/tools/auth0/handlers/clients.js +206 -2
  66. package/lib/tools/auth0/handlers/connectionProfiles.d.ts +27 -0
  67. package/lib/tools/auth0/handlers/connectionProfiles.js +30 -0
  68. package/lib/tools/auth0/handlers/connections.d.ts +32 -6
  69. package/lib/tools/auth0/handlers/connections.js +49 -7
  70. package/lib/tools/auth0/handlers/databases.d.ts +28 -0
  71. package/lib/tools/auth0/handlers/databases.js +58 -24
  72. package/lib/tools/auth0/handlers/default.d.ts +23 -0
  73. package/lib/tools/auth0/handlers/default.js +47 -29
  74. package/lib/tools/auth0/handlers/eventStreams.js +10 -2
  75. package/lib/tools/auth0/handlers/guardianEmailFactorSettings.d.ts +22 -0
  76. package/lib/tools/auth0/handlers/guardianEmailFactorSettings.js +77 -0
  77. package/lib/tools/auth0/handlers/guardianFactorTemplates.js +13 -4
  78. package/lib/tools/auth0/handlers/guardianPhoneFactorMessageTypes.js +11 -9
  79. package/lib/tools/auth0/handlers/guardianPhoneFactorSelectedProvider.js +11 -9
  80. package/lib/tools/auth0/handlers/guardianPhoneFactorSettings.d.ts +22 -0
  81. package/lib/tools/auth0/handlers/guardianPhoneFactorSettings.js +77 -0
  82. package/lib/tools/auth0/handlers/guardianPolicies.js +11 -1
  83. package/lib/tools/auth0/handlers/guardianSettings.d.ts +30 -0
  84. package/lib/tools/auth0/handlers/guardianSettings.js +85 -0
  85. package/lib/tools/auth0/handlers/hooks.js +1 -1
  86. package/lib/tools/auth0/handlers/index.js +16 -0
  87. package/lib/tools/auth0/handlers/networkACLKeys.d.ts +45 -0
  88. package/lib/tools/auth0/handlers/networkACLKeys.js +177 -0
  89. package/lib/tools/auth0/handlers/networkACLs.d.ts +132 -2
  90. package/lib/tools/auth0/handlers/networkACLs.js +100 -16
  91. package/lib/tools/auth0/handlers/organizations.d.ts +33 -1
  92. package/lib/tools/auth0/handlers/organizations.js +177 -19
  93. package/lib/tools/auth0/handlers/phoneProvider.js +10 -2
  94. package/lib/tools/auth0/handlers/phoneTemplates.d.ts +4 -1
  95. package/lib/tools/auth0/handlers/phoneTemplates.js +67 -10
  96. package/lib/tools/auth0/handlers/prompts.js +1 -1
  97. package/lib/tools/auth0/handlers/rateLimitPolicies.d.ts +81 -0
  98. package/lib/tools/auth0/handlers/rateLimitPolicies.js +203 -0
  99. package/lib/tools/auth0/handlers/resourceServers.d.ts +44 -0
  100. package/lib/tools/auth0/handlers/resourceServers.js +44 -0
  101. package/lib/tools/auth0/handlers/riskAssessment.d.ts +1 -1
  102. package/lib/tools/auth0/handlers/riskAssessment.js +19 -1
  103. package/lib/tools/auth0/handlers/roles.d.ts +4 -0
  104. package/lib/tools/auth0/handlers/roles.js +10 -0
  105. package/lib/tools/auth0/handlers/rules.js +19 -7
  106. package/lib/tools/auth0/handlers/tenant.d.ts +45 -0
  107. package/lib/tools/auth0/handlers/tenant.js +48 -0
  108. package/lib/tools/auth0/handlers/themes.d.ts +37 -1
  109. package/lib/tools/auth0/handlers/themes.js +64 -0
  110. package/lib/tools/auth0/handlers/tokenExchangeProfiles.js +3 -1
  111. package/lib/tools/auth0/index.js +12 -6
  112. package/lib/tools/calculateDryRunChanges.js +12 -8
  113. package/lib/tools/constants.d.ts +2 -0
  114. package/lib/tools/constants.js +3 -0
  115. package/lib/tools/utils.d.ts +3 -0
  116. package/lib/tools/utils.js +41 -2
  117. package/lib/types.d.ts +9 -1
  118. package/lib/utils.d.ts +6 -0
  119. package/lib/utils.js +17 -2
  120. package/package.json +2 -2
  121. package/references/code-style.md +133 -0
  122. package/references/commands.md +98 -0
  123. package/references/docs-update.md +34 -0
  124. package/references/git-workflow.md +135 -0
  125. package/references/pitfalls.md +62 -0
  126. package/references/testing.md +118 -0
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.schema = void 0;
7
+ const default_1 = __importDefault(require("./default"));
8
+ const utils_1 = require("../../utils");
9
+ exports.schema = {
10
+ type: 'object',
11
+ properties: {
12
+ otp_length: {
13
+ type: 'number',
14
+ description: 'The length of the OTP code.',
15
+ },
16
+ otp_expiration_time: {
17
+ type: 'number',
18
+ description: 'The OTP expiration time in seconds.',
19
+ },
20
+ },
21
+ additionalProperties: false,
22
+ };
23
+ class GuardianEmailFactorSettingsHandler extends default_1.default {
24
+ constructor(options) {
25
+ super({
26
+ ...options,
27
+ type: 'guardianEmailFactorSettings',
28
+ });
29
+ }
30
+ async getType() {
31
+ if (this.existing)
32
+ return this.existing;
33
+ try {
34
+ const data = await this.client.guardian.factors.email.get();
35
+ this.existing = data;
36
+ }
37
+ catch (err) {
38
+ if ((0, utils_1.isFeatureUnavailableError)(err)) {
39
+ // Gracefully skip processing this configuration value.
40
+ return null;
41
+ }
42
+ if ((0, utils_1.isForbiddenFeatureError)(err, this.type)) {
43
+ return null;
44
+ }
45
+ throw err;
46
+ }
47
+ return this.existing;
48
+ }
49
+ async processChanges(assets) {
50
+ // No API to delete or create guardianEmailFactorSettings, we can only update.
51
+ const { guardianEmailFactorSettings } = assets;
52
+ // Do nothing if not set
53
+ if (!guardianEmailFactorSettings) {
54
+ return;
55
+ }
56
+ if ((0, utils_1.isDryRun)(this.config)) {
57
+ const { del, update, create } = await this.calcChanges(assets);
58
+ if (create.length === 0 && update.length === 0 && del.length === 0) {
59
+ return;
60
+ }
61
+ }
62
+ try {
63
+ await this.client.guardian.factors.email.set(guardianEmailFactorSettings);
64
+ }
65
+ catch (err) {
66
+ if ((0, utils_1.isFeatureUnavailableError)(err) || (0, utils_1.isForbiddenFeatureError)(err, this.type)) {
67
+ // Feature is unavailable (404) or disabled (403) on this tenant; skip instead of failing
68
+ // the import. The 403 path logs a warning via isForbiddenFeatureError; the 404 path is silent.
69
+ return;
70
+ }
71
+ throw err;
72
+ }
73
+ this.updated += 1;
74
+ this.didUpdate(guardianEmailFactorSettings);
75
+ }
76
+ }
77
+ exports.default = GuardianEmailFactorSettingsHandler;
@@ -60,11 +60,20 @@ class GuardianFactorTemplatesHandler extends default_1.default {
60
60
  await Promise.all(guardianFactorTemplates.map(async (fatorTemplates) => {
61
61
  const { name, ...data } = fatorTemplates;
62
62
  const params = { name: fatorTemplates.name };
63
- if (name === 'sms') {
64
- await this.client.guardian.factors.sms.setTemplates(data);
63
+ try {
64
+ if (name === 'sms') {
65
+ await this.client.guardian.factors.sms.setTemplates(data);
66
+ }
67
+ else if (name === 'phone') {
68
+ await this.client.guardian.factors.phone.setTemplates(data);
69
+ }
65
70
  }
66
- else if (name === 'phone') {
67
- await this.client.guardian.factors.phone.setTemplates(data);
71
+ catch (err) {
72
+ if ((0, utils_1.isForbiddenFeatureError)(err, this.type)) {
73
+ // Feature is deprecated/disabled on this tenant; warn and skip instead of failing the import.
74
+ return;
75
+ }
76
+ throw err;
68
77
  }
69
78
  this.didUpdate(params);
70
79
  this.updated += 1;
@@ -25,14 +25,7 @@ const isFeatureUnavailableError = (err) => {
25
25
  // Older Management API version where the endpoint is not available.
26
26
  return true;
27
27
  }
28
- if (err.statusCode === 403 &&
29
- err.originalError &&
30
- err.originalError.response &&
31
- err.originalError.response.body &&
32
- err.originalError.response.body.errorCode === 'voice_mfa_not_allowed') {
33
- // Recent Management API version, but with feature explicitly disabled.
34
- return true;
35
- }
28
+ // 403s (feature explicitly disabled) are handled by isForbiddenFeatureError.
36
29
  return false;
37
30
  };
38
31
  class GuardianPhoneMessageTypesHandler extends default_1.default {
@@ -75,7 +68,16 @@ class GuardianPhoneMessageTypesHandler extends default_1.default {
75
68
  }
76
69
  }
77
70
  const data = guardianPhoneFactorMessageTypes;
78
- await this.client.guardian.factors.phone.setMessageTypes(data);
71
+ try {
72
+ await this.client.guardian.factors.phone.setMessageTypes(data);
73
+ }
74
+ catch (err) {
75
+ if (isFeatureUnavailableError(err) || (0, utils_1.isForbiddenFeatureError)(err, this.type)) {
76
+ // Feature is deprecated/disabled on this tenant; warn and skip instead of failing the import.
77
+ return;
78
+ }
79
+ throw err;
80
+ }
79
81
  this.updated += 1;
80
82
  this.didUpdate(guardianPhoneFactorMessageTypes);
81
83
  }
@@ -22,14 +22,7 @@ const isFeatureUnavailableError = (err) => {
22
22
  // Older Management API version where the endpoint is not available.
23
23
  return true;
24
24
  }
25
- if (err.statusCode === 403 &&
26
- err.originalError &&
27
- err.originalError.response &&
28
- err.originalError.response.body &&
29
- err.originalError.response.body.errorCode === 'hooks_not_allowed') {
30
- // Recent Management API version, but with feature explicitly disabled.
31
- return true;
32
- }
25
+ // 403s (feature explicitly disabled) are handled by isForbiddenFeatureError.
33
26
  return false;
34
27
  };
35
28
  class GuardianPhoneSelectedProviderHandler extends default_1.default {
@@ -72,7 +65,16 @@ class GuardianPhoneSelectedProviderHandler extends default_1.default {
72
65
  }
73
66
  }
74
67
  const data = guardianPhoneFactorSelectedProvider;
75
- await this.client.guardian.factors.phone.setProvider(data);
68
+ try {
69
+ await this.client.guardian.factors.phone.setProvider(data);
70
+ }
71
+ catch (err) {
72
+ if (isFeatureUnavailableError(err) || (0, utils_1.isForbiddenFeatureError)(err, this.type)) {
73
+ // Feature is deprecated/disabled on this tenant; warn and skip instead of failing the import.
74
+ return;
75
+ }
76
+ throw err;
77
+ }
76
78
  this.updated += 1;
77
79
  this.didUpdate(guardianPhoneFactorSelectedProvider);
78
80
  }
@@ -0,0 +1,22 @@
1
+ import DefaultHandler from './default';
2
+ import { Asset, Assets } from '../../../types';
3
+ export declare const schema: {
4
+ type: string;
5
+ properties: {
6
+ otp_length: {
7
+ type: string;
8
+ description: string;
9
+ };
10
+ otp_expiration_time: {
11
+ type: string;
12
+ description: string;
13
+ };
14
+ };
15
+ additionalProperties: boolean;
16
+ };
17
+ export default class GuardianPhoneFactorSettingsHandler extends DefaultHandler {
18
+ existing: Asset;
19
+ constructor(options: any);
20
+ getType(): Promise<Asset | null>;
21
+ processChanges(assets: Assets): Promise<void>;
22
+ }
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.schema = void 0;
7
+ const default_1 = __importDefault(require("./default"));
8
+ const utils_1 = require("../../utils");
9
+ exports.schema = {
10
+ type: 'object',
11
+ properties: {
12
+ otp_length: {
13
+ type: 'number',
14
+ description: 'The length of the OTP code.',
15
+ },
16
+ otp_expiration_time: {
17
+ type: 'number',
18
+ description: 'The OTP expiration time in seconds.',
19
+ },
20
+ },
21
+ additionalProperties: false,
22
+ };
23
+ class GuardianPhoneFactorSettingsHandler extends default_1.default {
24
+ constructor(options) {
25
+ super({
26
+ ...options,
27
+ type: 'guardianPhoneFactorSettings',
28
+ });
29
+ }
30
+ async getType() {
31
+ if (this.existing)
32
+ return this.existing;
33
+ try {
34
+ const data = await this.client.guardian.factors.phone.get();
35
+ this.existing = data;
36
+ }
37
+ catch (err) {
38
+ if ((0, utils_1.isFeatureUnavailableError)(err)) {
39
+ // Gracefully skip processing this configuration value.
40
+ return null;
41
+ }
42
+ if ((0, utils_1.isForbiddenFeatureError)(err, this.type)) {
43
+ return null;
44
+ }
45
+ throw err;
46
+ }
47
+ return this.existing;
48
+ }
49
+ async processChanges(assets) {
50
+ // No API to delete or create guardianPhoneFactorSettings, we can only update.
51
+ const { guardianPhoneFactorSettings } = assets;
52
+ // Do nothing if not set
53
+ if (!guardianPhoneFactorSettings) {
54
+ return;
55
+ }
56
+ if ((0, utils_1.isDryRun)(this.config)) {
57
+ const { del, update, create } = await this.calcChanges(assets);
58
+ if (create.length === 0 && update.length === 0 && del.length === 0) {
59
+ return;
60
+ }
61
+ }
62
+ try {
63
+ await this.client.guardian.factors.phone.set(guardianPhoneFactorSettings);
64
+ }
65
+ catch (err) {
66
+ if ((0, utils_1.isFeatureUnavailableError)(err) || (0, utils_1.isForbiddenFeatureError)(err, this.type)) {
67
+ // Feature is unavailable (404) or disabled (403) on this tenant; skip instead of failing
68
+ // the import. The 403 path logs a warning via isForbiddenFeatureError; the 404 path is silent.
69
+ return;
70
+ }
71
+ throw err;
72
+ }
73
+ this.updated += 1;
74
+ this.didUpdate(guardianPhoneFactorSettings);
75
+ }
76
+ }
77
+ exports.default = GuardianPhoneFactorSettingsHandler;
@@ -7,6 +7,7 @@ exports.schema = void 0;
7
7
  const default_1 = __importDefault(require("./default"));
8
8
  const constants_1 = __importDefault(require("../../constants"));
9
9
  const utils_1 = require("../../utils");
10
+ const logger_1 = __importDefault(require("../../../logger"));
10
11
  exports.schema = {
11
12
  type: 'object',
12
13
  properties: {
@@ -48,7 +49,16 @@ class GuardianPoliciesHandler extends default_1.default {
48
49
  }
49
50
  }
50
51
  const data = guardianPolicies.policies;
51
- await this.client.guardian.policies.set(data);
52
+ try {
53
+ await this.client.guardian.policies.set(data);
54
+ }
55
+ catch (err) {
56
+ if ((0, utils_1.isInsufficientEntitlementError)(err)) {
57
+ logger_1.default.warn('Skipping guardianPolicies deploy: tenant does not have Adaptive MFA entitlement (confidence-score requires an Enterprise add-on)');
58
+ return;
59
+ }
60
+ throw err;
61
+ }
52
62
  this.updated += 1;
53
63
  this.didUpdate(guardianPolicies);
54
64
  }
@@ -0,0 +1,30 @@
1
+ import DefaultHandler from './default';
2
+ import { Asset, Assets } from '../../../types';
3
+ export declare const schema: {
4
+ type: string;
5
+ properties: {
6
+ display_remember_me_checkbox: {
7
+ type: string;
8
+ description: string;
9
+ };
10
+ remember_me_default_value: {
11
+ type: string;
12
+ description: string;
13
+ };
14
+ mfa_session_inactivity_timeout: {
15
+ type: string;
16
+ description: string;
17
+ };
18
+ mfa_session_overall_timeout: {
19
+ type: string;
20
+ description: string;
21
+ };
22
+ };
23
+ additionalProperties: boolean;
24
+ };
25
+ export default class GuardianSettingsHandler extends DefaultHandler {
26
+ existing: Asset;
27
+ constructor(options: any);
28
+ getType(): Promise<Asset | null>;
29
+ processChanges(assets: Assets): Promise<void>;
30
+ }
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.schema = void 0;
7
+ const default_1 = __importDefault(require("./default"));
8
+ const utils_1 = require("../../utils");
9
+ exports.schema = {
10
+ type: 'object',
11
+ properties: {
12
+ display_remember_me_checkbox: {
13
+ type: 'boolean',
14
+ description: 'Determines whether to display the "Remember Me" checkbox on the MFA prompt in Universal Login.',
15
+ },
16
+ remember_me_default_value: {
17
+ type: 'boolean',
18
+ description: 'Determines the default state of the "Remember Me" checkbox on the MFA prompt in Universal Login.',
19
+ },
20
+ mfa_session_inactivity_timeout: {
21
+ type: 'number',
22
+ description: 'Duration of inactivity (seconds) after which the user will be prompted for MFA. Cannot exceed the overall timeout.',
23
+ },
24
+ mfa_session_overall_timeout: {
25
+ type: 'number',
26
+ description: 'Maximum duration (seconds) after which the user will be prompted for MFA regardless of activity.',
27
+ },
28
+ },
29
+ additionalProperties: false,
30
+ };
31
+ class GuardianSettingsHandler extends default_1.default {
32
+ constructor(options) {
33
+ super({
34
+ ...options,
35
+ type: 'guardianSettings',
36
+ });
37
+ }
38
+ async getType() {
39
+ if (this.existing)
40
+ return this.existing;
41
+ try {
42
+ const data = await this.client.guardian.get();
43
+ this.existing = data;
44
+ }
45
+ catch (err) {
46
+ if ((0, utils_1.isFeatureUnavailableError)(err)) {
47
+ // Gracefully skip processing this configuration value.
48
+ return null;
49
+ }
50
+ if ((0, utils_1.isForbiddenFeatureError)(err, this.type)) {
51
+ return null;
52
+ }
53
+ throw err;
54
+ }
55
+ return this.existing;
56
+ }
57
+ async processChanges(assets) {
58
+ // No API to delete or create guardianSettings, we can only update.
59
+ const { guardianSettings } = assets;
60
+ // Do nothing if not set
61
+ if (!guardianSettings) {
62
+ return;
63
+ }
64
+ if ((0, utils_1.isDryRun)(this.config)) {
65
+ const { del, update, create } = await this.calcChanges(assets);
66
+ if (create.length === 0 && update.length === 0 && del.length === 0) {
67
+ return;
68
+ }
69
+ }
70
+ try {
71
+ await this.client.guardian.set(guardianSettings);
72
+ }
73
+ catch (err) {
74
+ if ((0, utils_1.isFeatureUnavailableError)(err) || (0, utils_1.isForbiddenFeatureError)(err, this.type)) {
75
+ // Feature is unavailable (404) or disabled (403) on this tenant; skip instead of failing
76
+ // the import. The 403 path logs a warning via isForbiddenFeatureError; the 404 path is silent.
77
+ return;
78
+ }
79
+ throw err;
80
+ }
81
+ this.updated += 1;
82
+ this.didUpdate(guardianSettings);
83
+ }
84
+ }
85
+ exports.default = GuardianSettingsHandler;
@@ -151,7 +151,7 @@ class HooksHandler extends default_1.default {
151
151
  .get(hook.id)
152
152
  .then((hookWithCode) => this.client.hooks.secrets
153
153
  .get(hook.id)
154
- .then(({ data: secrets }) => ({ ...hookWithCode, secrets })))));
154
+ .then((secrets) => ({ ...hookWithCode, secrets })))));
155
155
  return this.existing;
156
156
  }
157
157
  catch (err) {
@@ -51,6 +51,9 @@ const guardianFactorTemplates = __importStar(require("./guardianFactorTemplates"
51
51
  const guardianPolicies = __importStar(require("./guardianPolicies"));
52
52
  const guardianPhoneFactorSelectedProvider = __importStar(require("./guardianPhoneFactorSelectedProvider"));
53
53
  const guardianPhoneFactorMessageTypes = __importStar(require("./guardianPhoneFactorMessageTypes"));
54
+ const guardianPhoneFactorSettings = __importStar(require("./guardianPhoneFactorSettings"));
55
+ const guardianEmailFactorSettings = __importStar(require("./guardianEmailFactorSettings"));
56
+ const guardianSettings = __importStar(require("./guardianSettings"));
54
57
  const roles = __importStar(require("./roles"));
55
58
  const branding = __importStar(require("./branding"));
56
59
  const phoneProviders = __importStar(require("./phoneProvider"));
@@ -69,12 +72,16 @@ const forms = __importStar(require("./forms"));
69
72
  const flows = __importStar(require("./flows"));
70
73
  const flowVaultConnections = __importStar(require("./flowVaultConnections"));
71
74
  const selfServiceProfiles = __importStar(require("./selfServiceProfiles"));
75
+ const networkACLKeys = __importStar(require("./networkACLKeys"));
72
76
  const networkACLs = __importStar(require("./networkACLs"));
73
77
  const userAttributeProfiles = __importStar(require("./userAttributeProfiles"));
74
78
  const connectionProfiles = __importStar(require("./connectionProfiles"));
75
79
  const tokenExchangeProfiles = __importStar(require("./tokenExchangeProfiles"));
76
80
  const supplementalSignals = __importStar(require("./supplementalSignals"));
81
+ const rateLimitPolicies = __importStar(require("./rateLimitPolicies"));
77
82
  const eventStreams = __importStar(require("./eventStreams"));
83
+ const clientAuthCredentials = __importStar(require("./clientAuthCredentials"));
84
+ const clientAuthCredentialsPre = __importStar(require("./clientAuthCredentialsPre"));
78
85
  const auth0ApiHandlers = {
79
86
  rules,
80
87
  rulesConfigs,
@@ -94,6 +101,9 @@ const auth0ApiHandlers = {
94
101
  guardianPolicies,
95
102
  guardianPhoneFactorSelectedProvider,
96
103
  guardianPhoneFactorMessageTypes,
104
+ guardianPhoneFactorSettings,
105
+ guardianEmailFactorSettings,
106
+ guardianSettings,
97
107
  roles,
98
108
  branding,
99
109
  phoneProviders,
@@ -113,11 +123,17 @@ const auth0ApiHandlers = {
113
123
  flows,
114
124
  flowVaultConnections,
115
125
  selfServiceProfiles,
126
+ networkACLKeys,
116
127
  networkACLs,
117
128
  userAttributeProfiles,
118
129
  connectionProfiles,
119
130
  tokenExchangeProfiles,
120
131
  supplementalSignals,
132
+ rateLimitPolicies,
121
133
  eventStreams,
134
+ clientAuthCredentials,
135
+ // clientAuthCredentialsPre is a deploy-only pre-pass handler (order 40) — not a user-facing
136
+ // asset type so it is not in AssetTypes, but must be registered here to run during deploy.
137
+ ...{ clientAuthCredentialsPre },
122
138
  };
123
139
  exports.default = auth0ApiHandlers; // TODO: apply stronger types to schema properties
@@ -0,0 +1,45 @@
1
+ import { Management } from 'auth0';
2
+ import DefaultAPIHandler from './default';
3
+ import { Asset, Assets, CalculatedChanges } from '../../../types';
4
+ export type NetworkAclKey = Management.NetworkAclKey & {
5
+ value?: string;
6
+ };
7
+ export declare const schema: {
8
+ type: string;
9
+ description: string;
10
+ items: {
11
+ type: string;
12
+ required: string[];
13
+ properties: {
14
+ id: {
15
+ type: string;
16
+ };
17
+ name: {
18
+ type: string;
19
+ maxLength: number;
20
+ };
21
+ alg: {
22
+ type: string;
23
+ enum: string[];
24
+ };
25
+ value: {
26
+ type: string;
27
+ };
28
+ fingerprint: {
29
+ type: string;
30
+ };
31
+ };
32
+ additionalProperties: boolean;
33
+ };
34
+ };
35
+ export default class NetworkACLKeysHandler extends DefaultAPIHandler {
36
+ existing: NetworkAclKey[] | null;
37
+ constructor(config: DefaultAPIHandler);
38
+ objString(key: NetworkAclKey): string;
39
+ getType(): Promise<Asset | null>;
40
+ processChanges(assets: Assets): Promise<void>;
41
+ createNetworkACLKey(key: NetworkAclKey): Promise<void>;
42
+ createNetworkACLKeys(creates: CalculatedChanges['create']): Promise<void>;
43
+ deleteNetworkACLKey(key: NetworkAclKey): Promise<void>;
44
+ deleteNetworkACLKeys(data: Asset[]): Promise<void>;
45
+ }