auth0-deploy-cli 8.42.0 → 9.0.0-beta.2

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 (56) hide show
  1. package/CHANGELOG.md +10 -50
  2. package/lib/context/directory/handlers/actionModules.js +10 -12
  3. package/lib/context/directory/handlers/actions.js +10 -13
  4. package/lib/context/directory/handlers/clients.js +0 -15
  5. package/lib/context/directory/handlers/databases.js +3 -4
  6. package/lib/context/directory/handlers/hooks.js +11 -1
  7. package/lib/context/directory/handlers/index.js +0 -4
  8. package/lib/context/directory/handlers/rules.js +11 -1
  9. package/lib/context/directory/index.js +6 -8
  10. package/lib/context/yaml/handlers/clients.js +0 -15
  11. package/lib/context/yaml/handlers/index.js +0 -4
  12. package/lib/context/yaml/index.js +6 -8
  13. package/lib/tools/auth0/handlers/attackProtection.js +5 -16
  14. package/lib/tools/auth0/handlers/clientGrants.d.ts +1 -1
  15. package/lib/tools/auth0/handlers/clients.d.ts +0 -46
  16. package/lib/tools/auth0/handlers/clients.js +1 -128
  17. package/lib/tools/auth0/handlers/connections.d.ts +0 -21
  18. package/lib/tools/auth0/handlers/connections.js +0 -16
  19. package/lib/tools/auth0/handlers/default.js +6 -6
  20. package/lib/tools/auth0/handlers/eventStreams.js +2 -10
  21. package/lib/tools/auth0/handlers/guardianFactorTemplates.js +4 -13
  22. package/lib/tools/auth0/handlers/guardianPhoneFactorMessageTypes.js +9 -11
  23. package/lib/tools/auth0/handlers/guardianPhoneFactorSelectedProvider.js +9 -11
  24. package/lib/tools/auth0/handlers/hooks.js +1 -1
  25. package/lib/tools/auth0/handlers/index.js +0 -8
  26. package/lib/tools/auth0/handlers/networkACLs.d.ts +0 -18
  27. package/lib/tools/auth0/handlers/networkACLs.js +0 -9
  28. package/lib/tools/auth0/handlers/organizations.d.ts +0 -4
  29. package/lib/tools/auth0/handlers/organizations.js +0 -4
  30. package/lib/tools/auth0/handlers/prompts.js +1 -1
  31. package/lib/tools/auth0/handlers/rules.js +7 -19
  32. package/lib/tools/auth0/handlers/tenant.d.ts +0 -23
  33. package/lib/tools/auth0/handlers/tenant.js +0 -24
  34. package/lib/tools/auth0/handlers/themes.d.ts +1 -37
  35. package/lib/tools/auth0/handlers/themes.js +0 -64
  36. package/lib/tools/auth0/index.js +6 -12
  37. package/lib/tools/constants.d.ts +0 -1
  38. package/lib/tools/constants.js +0 -1
  39. package/lib/tools/utils.d.ts +0 -1
  40. package/lib/tools/utils.js +2 -25
  41. package/lib/types.d.ts +1 -3
  42. package/package.json +2 -2
  43. package/lib/context/directory/handlers/clientAuthCredentials.d.ts +0 -5
  44. package/lib/context/directory/handlers/clientAuthCredentials.js +0 -13
  45. package/lib/context/directory/handlers/rateLimitPolicies.d.ts +0 -6
  46. package/lib/context/directory/handlers/rateLimitPolicies.js +0 -53
  47. package/lib/context/yaml/handlers/clientAuthCredentials.d.ts +0 -5
  48. package/lib/context/yaml/handlers/clientAuthCredentials.js +0 -13
  49. package/lib/context/yaml/handlers/rateLimitPolicies.d.ts +0 -6
  50. package/lib/context/yaml/handlers/rateLimitPolicies.js +0 -27
  51. package/lib/tools/auth0/handlers/clientAuthCredentials.d.ts +0 -27
  52. package/lib/tools/auth0/handlers/clientAuthCredentials.js +0 -223
  53. package/lib/tools/auth0/handlers/clientAuthCredentialsPre.d.ts +0 -38
  54. package/lib/tools/auth0/handlers/clientAuthCredentialsPre.js +0 -123
  55. package/lib/tools/auth0/handlers/rateLimitPolicies.d.ts +0 -81
  56. package/lib/tools/auth0/handlers/rateLimitPolicies.js +0 -203
@@ -129,22 +129,6 @@ exports.schema = {
129
129
  required: ['active'],
130
130
  additionalProperties: false,
131
131
  },
132
- cross_app_access_requesting_app: {
133
- type: 'object',
134
- properties: {
135
- active: { type: 'boolean' },
136
- },
137
- required: ['active'],
138
- additionalProperties: false,
139
- },
140
- cross_app_access_resource_app: {
141
- type: 'object',
142
- properties: {
143
- status: { type: 'string', enum: ['enabled', 'disabled'] },
144
- },
145
- required: ['status'],
146
- additionalProperties: false,
147
- },
148
132
  directory_provisioning_configuration: {
149
133
  type: 'object',
150
134
  properties: {
@@ -328,8 +328,8 @@ class APIHandler {
328
328
  const updateFN = this.getClientFN(this.functions.update);
329
329
  const updatePayload = (() => {
330
330
  const data = (0, utils_1.stripFields)({ ...updateItem }, this.stripUpdateFields);
331
- const obfuscatedStripped = (0, utils_1.stripObfuscatedFieldsFromPayload)(data, this.sensitiveFieldsToObfuscate);
332
- return (0, utils_1.stripUnresolvedPlaceholders)(obfuscatedStripped, this.type, this.objString(updateItem));
331
+ const stripped = (0, utils_1.stripObfuscatedFieldsFromPayload)(data, this.sensitiveFieldsToObfuscate);
332
+ return (0, utils_1.validateNoUnresolvedPlaceholders)(stripped, this.type, this.objString(updateItem));
333
333
  })();
334
334
  return updateFN(updateItem[this.id], updatePayload);
335
335
  }, retryConfig)
@@ -347,8 +347,8 @@ class APIHandler {
347
347
  const createFunction = this.getClientFN(this.functions.create);
348
348
  const createPayload = (() => {
349
349
  const strippedPayload = (0, utils_1.stripFields)(createItem, this.stripCreateFields);
350
- const obfuscatedStripped = (0, utils_1.stripObfuscatedFieldsFromPayload)(strippedPayload, this.sensitiveFieldsToObfuscate);
351
- return (0, utils_1.stripUnresolvedPlaceholders)(obfuscatedStripped, this.type, this.objString(createItem));
350
+ const stripped = (0, utils_1.stripObfuscatedFieldsFromPayload)(strippedPayload, this.sensitiveFieldsToObfuscate);
351
+ return (0, utils_1.validateNoUnresolvedPlaceholders)(stripped, this.type, this.objString(createItem));
352
352
  })();
353
353
  return createFunction(createPayload);
354
354
  }, retryConfig)
@@ -369,8 +369,8 @@ class APIHandler {
369
369
  const updateFN = this.getClientFN(this.functions.update);
370
370
  const updatePayload = (() => {
371
371
  const data = (0, utils_1.stripFields)({ ...updateItem }, this.stripUpdateFields);
372
- const obfuscatedStripped = (0, utils_1.stripObfuscatedFieldsFromPayload)(data, this.sensitiveFieldsToObfuscate);
373
- return (0, utils_1.stripUnresolvedPlaceholders)(obfuscatedStripped, this.type, this.objString(updateItem));
372
+ const stripped = (0, utils_1.stripObfuscatedFieldsFromPayload)(data, this.sensitiveFieldsToObfuscate);
373
+ return (0, utils_1.validateNoUnresolvedPlaceholders)(stripped, this.type, this.objString(updateItem));
374
374
  })();
375
375
  return updateFN(updateItem[this.id], updatePayload);
376
376
  }, retryConfig)
@@ -38,14 +38,10 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  return result;
39
39
  };
40
40
  })();
41
- var __importDefault = (this && this.__importDefault) || function (mod) {
42
- return (mod && mod.__esModule) ? mod : { "default": mod };
43
- };
44
41
  Object.defineProperty(exports, "__esModule", { value: true });
45
42
  exports.schema = void 0;
46
43
  const default_1 = __importStar(require("./default"));
47
44
  const client_1 = require("../client");
48
- const logger_1 = __importDefault(require("../../../logger"));
49
45
  exports.schema = {
50
46
  type: 'array',
51
47
  items: {
@@ -165,12 +161,8 @@ class EventStreamsHandler extends default_1.default {
165
161
  create: changesResponse.create.map((stream) => this.resolveActionId(stream)),
166
162
  update: changesResponse.update.map((stream) => {
167
163
  const resolved = this.resolveActionId(stream);
168
- // A destination's type cannot be changed once an event stream is created. The API
169
- // rejects the destination on PATCH for eventbridge and action streams, so strip it
170
- // from the update payload and only apply the other mutable fields.
171
- if (resolved.destination?.type === 'eventbridge' ||
172
- resolved.destination?.type === 'action') {
173
- logger_1.default.info(`Skipping destination update for event stream "${resolved.name}": ${resolved.destination.type} destinations cannot be changed after creation.`);
164
+ // EventBridge destinations cannot be patched — the API rejects destination on PATCH
165
+ if (resolved.destination?.type === 'eventbridge') {
174
166
  const { destination: _dest, ...rest } = resolved;
175
167
  return rest;
176
168
  }
@@ -60,20 +60,11 @@ 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
- 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
- }
63
+ if (name === 'sms') {
64
+ await this.client.guardian.factors.sms.setTemplates(data);
70
65
  }
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;
66
+ else if (name === 'phone') {
67
+ await this.client.guardian.factors.phone.setTemplates(data);
77
68
  }
78
69
  this.didUpdate(params);
79
70
  this.updated += 1;
@@ -25,7 +25,14 @@ const isFeatureUnavailableError = (err) => {
25
25
  // Older Management API version where the endpoint is not available.
26
26
  return true;
27
27
  }
28
- // 403s (feature explicitly disabled) are handled by isForbiddenFeatureError.
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
+ }
29
36
  return false;
30
37
  };
31
38
  class GuardianPhoneMessageTypesHandler extends default_1.default {
@@ -68,16 +75,7 @@ class GuardianPhoneMessageTypesHandler extends default_1.default {
68
75
  }
69
76
  }
70
77
  const data = guardianPhoneFactorMessageTypes;
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
- }
78
+ await this.client.guardian.factors.phone.setMessageTypes(data);
81
79
  this.updated += 1;
82
80
  this.didUpdate(guardianPhoneFactorMessageTypes);
83
81
  }
@@ -22,7 +22,14 @@ const isFeatureUnavailableError = (err) => {
22
22
  // Older Management API version where the endpoint is not available.
23
23
  return true;
24
24
  }
25
- // 403s (feature explicitly disabled) are handled by isForbiddenFeatureError.
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
+ }
26
33
  return false;
27
34
  };
28
35
  class GuardianPhoneSelectedProviderHandler extends default_1.default {
@@ -65,16 +72,7 @@ class GuardianPhoneSelectedProviderHandler extends default_1.default {
65
72
  }
66
73
  }
67
74
  const data = guardianPhoneFactorSelectedProvider;
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
- }
75
+ await this.client.guardian.factors.phone.setProvider(data);
78
76
  this.updated += 1;
79
77
  this.didUpdate(guardianPhoneFactorSelectedProvider);
80
78
  }
@@ -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((secrets) => ({ ...hookWithCode, secrets })))));
154
+ .then(({ data: secrets }) => ({ ...hookWithCode, secrets })))));
155
155
  return this.existing;
156
156
  }
157
157
  catch (err) {
@@ -74,10 +74,7 @@ const userAttributeProfiles = __importStar(require("./userAttributeProfiles"));
74
74
  const connectionProfiles = __importStar(require("./connectionProfiles"));
75
75
  const tokenExchangeProfiles = __importStar(require("./tokenExchangeProfiles"));
76
76
  const supplementalSignals = __importStar(require("./supplementalSignals"));
77
- const rateLimitPolicies = __importStar(require("./rateLimitPolicies"));
78
77
  const eventStreams = __importStar(require("./eventStreams"));
79
- const clientAuthCredentials = __importStar(require("./clientAuthCredentials"));
80
- const clientAuthCredentialsPre = __importStar(require("./clientAuthCredentialsPre"));
81
78
  const auth0ApiHandlers = {
82
79
  rules,
83
80
  rulesConfigs,
@@ -121,11 +118,6 @@ const auth0ApiHandlers = {
121
118
  connectionProfiles,
122
119
  tokenExchangeProfiles,
123
120
  supplementalSignals,
124
- rateLimitPolicies,
125
121
  eventStreams,
126
- clientAuthCredentials,
127
- // clientAuthCredentialsPre is a deploy-only pre-pass handler (order 40) — not a user-facing
128
- // asset type so it is not in AssetTypes, but must be registered here to run during deploy.
129
- ...{ clientAuthCredentialsPre },
130
122
  };
131
123
  exports.default = auth0ApiHandlers; // TODO: apply stronger types to schema properties
@@ -85,15 +85,6 @@ export declare const schema: {
85
85
  uniqueItems: boolean;
86
86
  minItems: number;
87
87
  };
88
- auth0_managed: {
89
- type: string;
90
- items: {
91
- type: string;
92
- pattern: string;
93
- };
94
- uniqueItems: boolean;
95
- minItems: number;
96
- };
97
88
  geo_country_codes: {
98
89
  type: string;
99
90
  items: {
@@ -185,15 +176,6 @@ export declare const schema: {
185
176
  uniqueItems: boolean;
186
177
  minItems: number;
187
178
  };
188
- auth0_managed: {
189
- type: string;
190
- items: {
191
- type: string;
192
- pattern: string;
193
- };
194
- uniqueItems: boolean;
195
- minItems: number;
196
- };
197
179
  geo_country_codes: {
198
180
  type: string;
199
181
  items: {
@@ -69,15 +69,6 @@ const MatchSchema = {
69
69
  uniqueItems: true,
70
70
  minItems: 1,
71
71
  },
72
- auth0_managed: {
73
- type: 'array',
74
- items: {
75
- type: 'string',
76
- pattern: '^auth0\\.[^.\\s]+$',
77
- },
78
- uniqueItems: true,
79
- minItems: 1,
80
- },
81
72
  geo_country_codes: {
82
73
  type: 'array',
83
74
  items: {
@@ -104,10 +104,6 @@ export declare const schema: {
104
104
  required: string[];
105
105
  };
106
106
  };
107
- third_party_client_access: {
108
- type: string;
109
- enum: ("allow" | "block")[];
110
- };
111
107
  };
112
108
  required: string[];
113
109
  };
@@ -127,10 +127,6 @@ exports.schema = {
127
127
  required: ['domain', 'status'],
128
128
  },
129
129
  },
130
- third_party_client_access: {
131
- type: 'string',
132
- enum: Object.values(auth0_1.Management.OrganizationThirdPartyClientAccessEnum),
133
- },
134
130
  },
135
131
  required: ['name'],
136
132
  },
@@ -496,7 +496,7 @@ class PromptsHandler extends default_1.default {
496
496
  updatePayload = {
497
497
  ...updatePrams,
498
498
  rendering_mode: auth0_1.Management.AculRenderingModeEnum.Advanced,
499
- default_head_tags_disabled: screenRenderer.default_head_tags_disabled ?? undefined,
499
+ default_head_tags_disabled: screenRenderer.default_head_tags_disabled || undefined,
500
500
  head_tags: screenRenderer.head_tags,
501
501
  };
502
502
  }
@@ -9,7 +9,6 @@ const utils_1 = require("../../utils");
9
9
  const default_1 = __importDefault(require("./default"));
10
10
  const logger_1 = __importDefault(require("../../../logger"));
11
11
  const calculateChanges_1 = require("../../calculateChanges");
12
- const calculateDryRunChanges_1 = require("../../calculateDryRunChanges");
13
12
  const client_1 = require("../client");
14
13
  exports.excludeSchema = {
15
14
  type: 'array',
@@ -136,24 +135,13 @@ class RulesHandler extends default_1.default {
136
135
  };
137
136
  }
138
137
  async dryRunChanges(assets) {
139
- let { rules } = assets;
140
- if (!rules) {
141
- return { del: [], create: [], conflicts: [], update: [] };
142
- }
143
- const excludedRules = (assets.exclude && assets.exclude.rules) || [];
144
- rules = rules.filter((r) => !excludedRules.includes(r.name));
145
- let existing = await this.getType();
146
- if (existing === null) {
147
- return { del: [], create: [], conflicts: [], update: [] };
148
- }
149
- existing = existing.filter((r) => !excludedRules.includes(r.name));
150
- return (0, calculateDryRunChanges_1.calculateDryRunChanges)({
151
- type: this.type,
152
- assets: rules,
153
- existing,
154
- identifiers: this.identifiers,
155
- ignoreDryRunFields: this.getEffectiveIgnoreDryRunFields(),
156
- });
138
+ const { del, update, create, conflicts } = await this.calcChanges(assets);
139
+ return {
140
+ del,
141
+ update,
142
+ create,
143
+ conflicts,
144
+ };
157
145
  }
158
146
  async validate(assets) {
159
147
  const { rules } = assets;
@@ -79,29 +79,6 @@ export declare const schema: {
79
79
  enum: string[];
80
80
  description: string;
81
81
  };
82
- country_codes: {
83
- type: string[];
84
- description: string;
85
- properties: {
86
- list: {
87
- type: string;
88
- description: string;
89
- items: {
90
- type: string;
91
- pattern: string;
92
- };
93
- minItems: number;
94
- uniqueItems: boolean;
95
- };
96
- mode: {
97
- type: string;
98
- enum: string[];
99
- description: string;
100
- };
101
- };
102
- required: string[];
103
- additionalProperties: boolean;
104
- };
105
82
  };
106
83
  };
107
84
  export interface Tenant extends Management.GetTenantSettingsResponseContent {
@@ -106,29 +106,6 @@ exports.schema = {
106
106
  enum: ['strict', 'permissive'],
107
107
  description: 'Indicates the security mode for new clients created through the Dynamic Client Registration endpoint.',
108
108
  },
109
- country_codes: {
110
- type: ['object', 'null'],
111
- description: 'Phone country code configuration for identifier input. Set to `null` to remove filtering (allow all countries). Requires the `tenant_country_codes_filtering` feature flag to be enabled on the tenant.',
112
- properties: {
113
- list: {
114
- type: 'array',
115
- description: 'ISO 3166-1 alpha-2 country codes (e.g. `US`, `GB`).',
116
- items: {
117
- type: 'string',
118
- pattern: '^[A-Z]{2}$',
119
- },
120
- minItems: 1,
121
- uniqueItems: true,
122
- },
123
- mode: {
124
- type: 'string',
125
- enum: ['allow', 'deny'],
126
- description: 'Whether the list is an allowlist or denylist.',
127
- },
128
- },
129
- required: ['list', 'mode'],
130
- additionalProperties: false,
131
- },
132
109
  },
133
110
  };
134
111
  const blockPageKeys = [
@@ -170,7 +147,6 @@ exports.allowedTenantFlags = [
170
147
  'require_pushed_authorization_requests',
171
148
  'mfa_show_factor_list_on_enrollment',
172
149
  'improved_signup_bot_detection_in_classic',
173
- 'use_scope_descriptions_for_consent',
174
150
  ];
175
151
  const removeUnallowedTenantFlags = (proposedFlags) => {
176
152
  if (proposedFlags === undefined)
@@ -1,5 +1,5 @@
1
1
  import { Management } from 'auth0';
2
- import { Assets, CalculatedChanges } from '../../../types';
2
+ import { Assets } from '../../../types';
3
3
  import DefaultHandler from './default';
4
4
  /**
5
5
  * Schema
@@ -179,41 +179,6 @@ export declare const schema: {
179
179
  pattern: string;
180
180
  type: string;
181
181
  };
182
- identifiers: {
183
- additionalProperties: boolean;
184
- description: string;
185
- properties: {
186
- login_display: {
187
- description: string;
188
- enum: string[];
189
- type: string;
190
- };
191
- otp_autocomplete: {
192
- description: string;
193
- type: string;
194
- };
195
- phone_display: {
196
- additionalProperties: boolean;
197
- description: string;
198
- properties: {
199
- formatting: {
200
- description: string;
201
- enum: string[];
202
- type: string;
203
- };
204
- masking: {
205
- description: string;
206
- enum: string[];
207
- type: string;
208
- };
209
- };
210
- required: string[];
211
- type: string;
212
- };
213
- };
214
- required: string[];
215
- type: string;
216
- };
217
182
  fonts: {
218
183
  additionalProperties: boolean;
219
184
  properties: {
@@ -410,7 +375,6 @@ export default class ThemesHandler extends DefaultHandler {
410
375
  existing: Theme[] | null;
411
376
  constructor(options: DefaultHandler);
412
377
  objString(theme: Theme): string;
413
- dryRunChanges(assets: Assets): Promise<CalculatedChanges>;
414
378
  getType(): Promise<Theme[] | null>;
415
379
  processChanges(assets: Assets): Promise<void>;
416
380
  deleteThemes(): Promise<void>;
@@ -46,7 +46,6 @@ exports.schema = void 0;
46
46
  const logger_1 = __importDefault(require("../../../logger"));
47
47
  const default_1 = __importStar(require("./default"));
48
48
  const utils_1 = require("../../utils");
49
- const calculateDryRunChanges_1 = require("../../calculateDryRunChanges");
50
49
  /**
51
50
  * Schema
52
51
  */
@@ -252,41 +251,6 @@ exports.schema = {
252
251
  pattern: '^[^<>]*$',
253
252
  type: 'string',
254
253
  },
255
- identifiers: {
256
- additionalProperties: false,
257
- description: 'Identifier display settings on the theme. Requires the `universal_login_theme_identifiers` feature flag to be enabled on the tenant.',
258
- properties: {
259
- login_display: {
260
- description: 'Login display mode',
261
- enum: ['separate', 'unified'],
262
- type: 'string',
263
- },
264
- otp_autocomplete: {
265
- description: 'Whether OTP autocomplete is enabled',
266
- type: 'boolean',
267
- },
268
- phone_display: {
269
- additionalProperties: false,
270
- description: 'Phone number display settings',
271
- properties: {
272
- formatting: {
273
- description: 'Phone number formatting style',
274
- enum: ['international', 'regional'],
275
- type: 'string',
276
- },
277
- masking: {
278
- description: 'Phone number masking strategy',
279
- enum: ['hide_country_code', 'mask_digits', 'show_all'],
280
- type: 'string',
281
- },
282
- },
283
- required: ['formatting', 'masking'],
284
- type: 'object',
285
- },
286
- },
287
- required: ['login_display', 'otp_autocomplete', 'phone_display'],
288
- type: 'object',
289
- },
290
254
  fonts: {
291
255
  additionalProperties: false,
292
256
  properties: {
@@ -506,34 +470,6 @@ class ThemesHandler extends default_1.default {
506
470
  objString(theme) {
507
471
  return theme.displayName || JSON.stringify(theme);
508
472
  }
509
- async dryRunChanges(assets) {
510
- const { themes } = assets;
511
- if (!themes) {
512
- return { del: [], create: [], conflicts: [], update: [] };
513
- }
514
- const existing = await this.getType();
515
- // getType() returns null when Universal Login customizations are not enabled
516
- // on the tenant (the 400 "no-code not enabled" path in getThemes).
517
- if (existing === null) {
518
- return { del: [], create: [], conflicts: [], update: [] };
519
- }
520
- // Themes are singletons — at most one per tenant. If the local theme has no
521
- // themeId (stripped during export when --export_ids is not set), backfill it
522
- // from the remote so the matcher can find a match without requiring --export_ids.
523
- const normalizedThemes = themes.map((theme) => {
524
- if (!theme.themeId && existing.length > 0 && existing[0].themeId) {
525
- return { ...theme, themeId: existing[0].themeId };
526
- }
527
- return theme;
528
- });
529
- return (0, calculateDryRunChanges_1.calculateDryRunChanges)({
530
- type: this.type,
531
- assets: normalizedThemes,
532
- existing,
533
- identifiers: this.identifiers,
534
- ignoreDryRunFields: this.getEffectiveIgnoreDryRunFields(),
535
- });
536
- }
537
473
  async getType() {
538
474
  if (!this.existing) {
539
475
  this.existing = await this.getThemes();
@@ -11,10 +11,13 @@ const promise_pool_executor_1 = require("promise-pool-executor");
11
11
  const client_1 = __importDefault(require("./client"));
12
12
  const schema_1 = __importDefault(require("./schema"));
13
13
  const handlers_1 = __importDefault(require("./handlers"));
14
+ // Cache the compiled AJV validator to avoid recompiling the schema on every validate() call.
15
+ // Schema compilation is expensive (~5s) due to the complexity of the combined resource schema.
16
+ const ajv = new ajv_1.default({ useDefaults: true, nullable: true });
17
+ const validateSchema = ajv.compile(schema_1.default);
14
18
  const calculateDryRunChanges_1 = require("../calculateDryRunChanges");
15
19
  const utils_1 = require("../../utils");
16
20
  const utils_2 = require("../utils");
17
- const logger_1 = __importDefault(require("../../logger"));
18
21
  /**
19
22
  * Sorts handlers by their @order decorator metadata for a given stage.
20
23
  * Handlers are sorted in ascending order (lower values execute first).
@@ -106,13 +109,12 @@ class Auth0 {
106
109
  }
107
110
  }
108
111
  async validate() {
109
- const ajv = new ajv_1.default({ useDefaults: true, nullable: true });
110
112
  const nonNullAssets = Object.keys(this.assets)
111
113
  .filter((k) => this.assets[k] != null)
112
114
  .reduce((a, k) => ({ ...a, [k]: this.assets[k] }), {});
113
- const valid = ajv.validate(schema_1.default, nonNullAssets);
115
+ const valid = validateSchema(nonNullAssets);
114
116
  if (!valid) {
115
- throw new Error(`Schema validation failed loading ${JSON.stringify(ajv.errors, null, 4)}`);
117
+ throw new Error(`Schema validation failed loading ${JSON.stringify(validateSchema.errors, null, 4)}`);
116
118
  }
117
119
  await this.runStage('validate');
118
120
  }
@@ -146,14 +148,6 @@ class Auth0 {
146
148
  data: this.handlers,
147
149
  generator: (handler) => (async () => {
148
150
  try {
149
- // Every handler in the dry-run loop is expected to implement dryRunChanges.
150
- // Guard against non-conforming handlers (e.g. deploy-only handlers that don't
151
- // extend the base APIHandler) so a missing method skips the handler instead of
152
- // crashing the whole dry run. Logged loudly so an omitted preview is visible.
153
- if (typeof handler.dryRunChanges !== 'function') {
154
- logger_1.default.warn(`Handler "${handler.type}" does not implement dryRunChanges; skipping it in the dry-run preview. Changes for this resource will still be applied during a real import.`);
155
- return;
156
- }
157
151
  const detailedChanges = [];
158
152
  let created = 0;
159
153
  let updated = 0;
@@ -90,7 +90,6 @@ declare const constants: {
90
90
  CONNECTION_PROFILES_DIRECTORY: string;
91
91
  TOKEN_EXCHANGE_PROFILES_DIRECTORY: string;
92
92
  SUPPLEMENTAL_SIGNALS_DIRECTORY: string;
93
- RATE_LIMIT_POLICIES_DIRECTORY: string;
94
93
  EVENT_STREAMS_DIRECTORY: string;
95
94
  };
96
95
  export default constants;
@@ -220,7 +220,6 @@ const constants = {
220
220
  CONNECTION_PROFILES_DIRECTORY: 'connection-profiles',
221
221
  TOKEN_EXCHANGE_PROFILES_DIRECTORY: 'token-exchange-profiles',
222
222
  SUPPLEMENTAL_SIGNALS_DIRECTORY: 'supplemental-signals',
223
- RATE_LIMIT_POLICIES_DIRECTORY: 'rate-limit-policies',
224
223
  EVENT_STREAMS_DIRECTORY: 'event-streams',
225
224
  };
226
225
  exports.default = constants;
@@ -27,7 +27,6 @@ export declare function areArraysEquals(x: any[], y: any[]): boolean;
27
27
  export declare const obfuscateSensitiveValues: (data: Asset | Asset[] | null, sensitiveFieldsToObfuscate: string[]) => Asset | Asset[] | null;
28
28
  export declare const validateNoUnresolvedPlaceholders: (data: Asset | null, resourceType: string, resourceName: string) => Asset | null;
29
29
  export declare const stripObfuscatedFieldsFromPayload: (data: Asset | Asset[] | null, obfuscatedFields: string[]) => Asset | Asset[] | null;
30
- export declare const stripUnresolvedPlaceholders: (data: Asset | null, resourceType: string, resourceName: string) => Asset | null;
31
30
  export declare const detectInsufficientScopeError: <T>(fn: Function) => Promise<{
32
31
  hadSufficientScopes: true;
33
32
  data: T;