auth0-deploy-cli 7.12.1 → 7.13.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.
@@ -0,0 +1,500 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.schema = void 0;
16
+ const logger_1 = __importDefault(require("../../../logger"));
17
+ const default_1 = __importDefault(require("./default"));
18
+ class ThemesHandler extends default_1.default {
19
+ constructor(options) {
20
+ super(Object.assign(Object.assign({}, options), { type: 'themes', id: 'themeId' }));
21
+ }
22
+ objString(theme) {
23
+ return theme.displayName || JSON.stringify(theme);
24
+ }
25
+ getType() {
26
+ return __awaiter(this, void 0, void 0, function* () {
27
+ if (!this.existing) {
28
+ this.existing = yield this.getThemes();
29
+ }
30
+ return this.existing;
31
+ });
32
+ }
33
+ processChanges(assets) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ const { themes } = assets;
36
+ // Non existing section means themes doesn't need to be processed
37
+ if (!themes) {
38
+ return;
39
+ }
40
+ // Empty array means themes should be deleted
41
+ if (themes.length === 0) {
42
+ return this.deleteThemes();
43
+ }
44
+ return this.updateThemes(themes);
45
+ });
46
+ }
47
+ deleteThemes() {
48
+ return __awaiter(this, void 0, void 0, function* () {
49
+ if (!this.config('AUTH0_ALLOW_DELETE')) {
50
+ return;
51
+ }
52
+ // if theme exists we need to delete it
53
+ const currentThemes = yield this.getThemes();
54
+ if (currentThemes === null || currentThemes.length === 0) {
55
+ return;
56
+ }
57
+ const currentTheme = currentThemes[0];
58
+ yield this.client.branding.deleteTheme({ id: currentTheme.themeId });
59
+ this.deleted += 1;
60
+ this.didDelete(currentTheme);
61
+ });
62
+ }
63
+ updateThemes(themes) {
64
+ return __awaiter(this, void 0, void 0, function* () {
65
+ if (themes.length > 1) {
66
+ logger_1.default.warn('Only one theme is supported per tenant');
67
+ }
68
+ const currentThemes = yield this.getThemes();
69
+ if (currentThemes === null || currentThemes.length === 0) {
70
+ yield this.client.branding.createTheme(themes[0]);
71
+ }
72
+ else {
73
+ const currentTheme = currentThemes[0];
74
+ // if theme exists, overwrite it otherwise create it
75
+ yield this.client.branding.updateTheme({ id: currentTheme.themeId }, themes[0]);
76
+ }
77
+ this.updated += 1;
78
+ this.didUpdate(themes[0]);
79
+ });
80
+ }
81
+ getThemes() {
82
+ return __awaiter(this, void 0, void 0, function* () {
83
+ try {
84
+ const theme = yield this.client.branding.getDefaultTheme();
85
+ return [theme];
86
+ }
87
+ catch (err) {
88
+ if (err.statusCode === 404)
89
+ return [];
90
+ if (err.statusCode === 400)
91
+ return null;
92
+ // Errors other than 404 (theme doesn't exist) or 400 (no-code not enabled) shouldn't be expected
93
+ throw err;
94
+ }
95
+ });
96
+ }
97
+ }
98
+ exports.default = ThemesHandler;
99
+ /**
100
+ * Schema
101
+ */
102
+ exports.schema = {
103
+ type: 'array',
104
+ items: {
105
+ additionalProperties: false,
106
+ properties: {
107
+ borders: {
108
+ additionalProperties: false,
109
+ properties: {
110
+ button_border_radius: {
111
+ description: 'Button border radius',
112
+ maximum: 10,
113
+ minimum: 1,
114
+ type: 'number',
115
+ },
116
+ button_border_weight: {
117
+ description: 'Button border weight',
118
+ maximum: 10,
119
+ minimum: 0,
120
+ type: 'number',
121
+ },
122
+ buttons_style: {
123
+ description: 'Buttons style',
124
+ enum: ['pill', 'rounded', 'sharp'],
125
+ type: 'string',
126
+ },
127
+ input_border_radius: {
128
+ description: 'Input border radius',
129
+ maximum: 10,
130
+ minimum: 0,
131
+ type: 'number',
132
+ },
133
+ input_border_weight: {
134
+ description: 'Input border weight',
135
+ maximum: 3,
136
+ minimum: 0,
137
+ type: 'number',
138
+ },
139
+ inputs_style: {
140
+ description: 'Inputs style',
141
+ enum: ['pill', 'rounded', 'sharp'],
142
+ type: 'string',
143
+ },
144
+ show_widget_shadow: {
145
+ description: 'Show widget shadow',
146
+ type: 'boolean',
147
+ },
148
+ widget_border_weight: {
149
+ description: 'Widget border weight',
150
+ maximum: 10,
151
+ minimum: 0,
152
+ type: 'number',
153
+ },
154
+ widget_corner_radius: {
155
+ description: 'Widget corner radius',
156
+ maximum: 50,
157
+ minimum: 0,
158
+ type: 'number',
159
+ },
160
+ },
161
+ required: [
162
+ 'button_border_radius',
163
+ 'button_border_weight',
164
+ 'buttons_style',
165
+ 'input_border_radius',
166
+ 'input_border_weight',
167
+ 'inputs_style',
168
+ 'show_widget_shadow',
169
+ 'widget_border_weight',
170
+ 'widget_corner_radius',
171
+ ],
172
+ type: 'object',
173
+ },
174
+ colors: {
175
+ additionalProperties: false,
176
+ properties: {
177
+ base_focus_color: {
178
+ description: 'Base Focus Color',
179
+ pattern: '^#(([0-9a-fA-F]{3}){1,2}|([0-9a-fA-F]{4}){1,2})$',
180
+ type: 'string',
181
+ },
182
+ base_hover_color: {
183
+ description: 'Base Hover Color',
184
+ pattern: '^#(([0-9a-fA-F]{3}){1,2}|([0-9a-fA-F]{4}){1,2})$',
185
+ type: 'string',
186
+ },
187
+ body_text: {
188
+ description: 'Body text',
189
+ pattern: '^#(([0-9a-fA-F]{3}){1,2}|([0-9a-fA-F]{4}){1,2})$',
190
+ type: 'string',
191
+ },
192
+ error: {
193
+ description: 'Error',
194
+ pattern: '^#(([0-9a-fA-F]{3}){1,2}|([0-9a-fA-F]{4}){1,2})$',
195
+ type: 'string',
196
+ },
197
+ header: {
198
+ description: 'Header',
199
+ pattern: '^#(([0-9a-fA-F]{3}){1,2}|([0-9a-fA-F]{4}){1,2})$',
200
+ type: 'string',
201
+ },
202
+ icons: {
203
+ description: 'Icons',
204
+ pattern: '^#(([0-9a-fA-F]{3}){1,2}|([0-9a-fA-F]{4}){1,2})$',
205
+ type: 'string',
206
+ },
207
+ input_background: {
208
+ description: 'Input background',
209
+ pattern: '^#(([0-9a-fA-F]{3}){1,2}|([0-9a-fA-F]{4}){1,2})$',
210
+ type: 'string',
211
+ },
212
+ input_border: {
213
+ description: 'Input border',
214
+ pattern: '^#(([0-9a-fA-F]{3}){1,2}|([0-9a-fA-F]{4}){1,2})$',
215
+ type: 'string',
216
+ },
217
+ input_filled_text: {
218
+ description: 'Input filled text',
219
+ pattern: '^#(([0-9a-fA-F]{3}){1,2}|([0-9a-fA-F]{4}){1,2})$',
220
+ type: 'string',
221
+ },
222
+ input_labels_placeholders: {
223
+ description: 'Input labels & placeholders',
224
+ pattern: '^#(([0-9a-fA-F]{3}){1,2}|([0-9a-fA-F]{4}){1,2})$',
225
+ type: 'string',
226
+ },
227
+ links_focused_components: {
228
+ description: 'Links & focused components',
229
+ pattern: '^#(([0-9a-fA-F]{3}){1,2}|([0-9a-fA-F]{4}){1,2})$',
230
+ type: 'string',
231
+ },
232
+ primary_button: {
233
+ description: 'Primary button',
234
+ pattern: '^#(([0-9a-fA-F]{3}){1,2}|([0-9a-fA-F]{4}){1,2})$',
235
+ type: 'string',
236
+ },
237
+ primary_button_label: {
238
+ description: 'Primary button label',
239
+ pattern: '^#(([0-9a-fA-F]{3}){1,2}|([0-9a-fA-F]{4}){1,2})$',
240
+ type: 'string',
241
+ },
242
+ secondary_button_border: {
243
+ description: 'Secondary button border',
244
+ pattern: '^#(([0-9a-fA-F]{3}){1,2}|([0-9a-fA-F]{4}){1,2})$',
245
+ type: 'string',
246
+ },
247
+ secondary_button_label: {
248
+ description: 'Secondary button label',
249
+ pattern: '^#(([0-9a-fA-F]{3}){1,2}|([0-9a-fA-F]{4}){1,2})$',
250
+ type: 'string',
251
+ },
252
+ success: {
253
+ description: 'Success',
254
+ pattern: '^#(([0-9a-fA-F]{3}){1,2}|([0-9a-fA-F]{4}){1,2})$',
255
+ type: 'string',
256
+ },
257
+ widget_background: {
258
+ description: 'Widget background',
259
+ pattern: '^#(([0-9a-fA-F]{3}){1,2}|([0-9a-fA-F]{4}){1,2})$',
260
+ type: 'string',
261
+ },
262
+ widget_border: {
263
+ description: 'Widget border',
264
+ pattern: '^#(([0-9a-fA-F]{3}){1,2}|([0-9a-fA-F]{4}){1,2})$',
265
+ type: 'string',
266
+ },
267
+ },
268
+ required: [
269
+ 'body_text',
270
+ 'error',
271
+ 'header',
272
+ 'icons',
273
+ 'input_background',
274
+ 'input_border',
275
+ 'input_filled_text',
276
+ 'input_labels_placeholders',
277
+ 'links_focused_components',
278
+ 'primary_button',
279
+ 'primary_button_label',
280
+ 'secondary_button_border',
281
+ 'secondary_button_label',
282
+ 'success',
283
+ 'widget_background',
284
+ 'widget_border',
285
+ ],
286
+ type: 'object',
287
+ },
288
+ displayName: {
289
+ description: 'Display Name',
290
+ maxLength: 2048,
291
+ pattern: '^[^<>]*$',
292
+ type: 'string',
293
+ },
294
+ fonts: {
295
+ additionalProperties: false,
296
+ properties: {
297
+ body_text: {
298
+ additionalProperties: false,
299
+ description: 'Body text',
300
+ properties: {
301
+ bold: {
302
+ description: 'Body text bold',
303
+ type: 'boolean',
304
+ },
305
+ size: {
306
+ description: 'Body text size',
307
+ maximum: 150,
308
+ minimum: 0,
309
+ type: 'number',
310
+ },
311
+ },
312
+ required: ['bold', 'size'],
313
+ type: 'object',
314
+ },
315
+ buttons_text: {
316
+ additionalProperties: false,
317
+ description: 'Buttons text',
318
+ properties: {
319
+ bold: {
320
+ description: 'Buttons text bold',
321
+ type: 'boolean',
322
+ },
323
+ size: {
324
+ description: 'Buttons text size',
325
+ maximum: 150,
326
+ minimum: 0,
327
+ type: 'number',
328
+ },
329
+ },
330
+ required: ['bold', 'size'],
331
+ type: 'object',
332
+ },
333
+ font_url: {
334
+ description: 'Font URL',
335
+ pattern: "^$|^(?=.)(?!https?:\\/(?:$|[^/]))(?!https?:\\/\\/\\/)(?!https?:[^/])(?:(?:https):(?:(?:\\/\\/(?:[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:]*@)?(?:\\[(?:(?:(?:[\\dA-Fa-f]{1,4}:){6}(?:[\\dA-Fa-f]{1,4}:[\\dA-Fa-f]{1,4}|(?:(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|::(?:[\\dA-Fa-f]{1,4}:){5}(?:[\\dA-Fa-f]{1,4}:[\\dA-Fa-f]{1,4}|(?:(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|(?:[\\dA-Fa-f]{1,4})?::(?:[\\dA-Fa-f]{1,4}:){4}(?:[\\dA-Fa-f]{1,4}:[\\dA-Fa-f]{1,4}|(?:(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|(?:(?:[\\dA-Fa-f]{1,4}:){0,1}[\\dA-Fa-f]{1,4})?::(?:[\\dA-Fa-f]{1,4}:){3}(?:[\\dA-Fa-f]{1,4}:[\\dA-Fa-f]{1,4}|(?:(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|(?:(?:[\\dA-Fa-f]{1,4}:){0,2}[\\dA-Fa-f]{1,4})?::(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-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*)?|[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]+(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*|(?:\\/\\/\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*)))(?:\\?[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@\\/\\?]*(?=#|$))?(?:#[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@\\/\\?]*)?$",
336
+ type: 'string',
337
+ },
338
+ input_labels: {
339
+ additionalProperties: false,
340
+ description: 'Input Labels',
341
+ properties: {
342
+ bold: {
343
+ description: 'Input Labels bold',
344
+ type: 'boolean',
345
+ },
346
+ size: {
347
+ description: 'Input Labels size',
348
+ maximum: 150,
349
+ minimum: 0,
350
+ type: 'number',
351
+ },
352
+ },
353
+ required: ['bold', 'size'],
354
+ type: 'object',
355
+ },
356
+ links: {
357
+ additionalProperties: false,
358
+ description: 'Links',
359
+ properties: {
360
+ bold: {
361
+ description: 'Links bold',
362
+ type: 'boolean',
363
+ },
364
+ size: {
365
+ description: 'Links size',
366
+ maximum: 150,
367
+ minimum: 0,
368
+ type: 'number',
369
+ },
370
+ },
371
+ required: ['bold', 'size'],
372
+ type: 'object',
373
+ },
374
+ links_style: {
375
+ description: 'Links style',
376
+ enum: ['normal', 'underlined'],
377
+ type: 'string',
378
+ },
379
+ reference_text_size: {
380
+ description: 'Reference text size',
381
+ maximum: 24,
382
+ minimum: 12,
383
+ type: 'number',
384
+ },
385
+ subtitle: {
386
+ additionalProperties: false,
387
+ description: 'Subtitle',
388
+ properties: {
389
+ bold: {
390
+ description: 'Subtitle bold',
391
+ type: 'boolean',
392
+ },
393
+ size: {
394
+ description: 'Subtitle size',
395
+ maximum: 150,
396
+ minimum: 0,
397
+ type: 'number',
398
+ },
399
+ },
400
+ required: ['bold', 'size'],
401
+ type: 'object',
402
+ },
403
+ title: {
404
+ additionalProperties: false,
405
+ description: 'Title',
406
+ properties: {
407
+ bold: {
408
+ description: 'Title bold',
409
+ type: 'boolean',
410
+ },
411
+ size: {
412
+ description: 'Title size',
413
+ maximum: 150,
414
+ minimum: 75,
415
+ type: 'number',
416
+ },
417
+ },
418
+ required: ['bold', 'size'],
419
+ type: 'object',
420
+ },
421
+ },
422
+ required: [
423
+ 'body_text',
424
+ 'buttons_text',
425
+ 'font_url',
426
+ 'input_labels',
427
+ 'links',
428
+ 'links_style',
429
+ 'reference_text_size',
430
+ 'subtitle',
431
+ 'title',
432
+ ],
433
+ type: 'object',
434
+ },
435
+ page_background: {
436
+ additionalProperties: false,
437
+ properties: {
438
+ background_color: {
439
+ description: 'Background color',
440
+ pattern: '^#(([0-9a-fA-F]{3}){1,2}|([0-9a-fA-F]{4}){1,2})$',
441
+ type: 'string',
442
+ },
443
+ background_image_url: {
444
+ description: 'Background image url',
445
+ pattern: "^$|^(?=.)(?!https?:\\/(?:$|[^/]))(?!https?:\\/\\/\\/)(?!https?:[^/])(?:(?:https):(?:(?:\\/\\/(?:[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:]*@)?(?:\\[(?:(?:(?:[\\dA-Fa-f]{1,4}:){6}(?:[\\dA-Fa-f]{1,4}:[\\dA-Fa-f]{1,4}|(?:(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|::(?:[\\dA-Fa-f]{1,4}:){5}(?:[\\dA-Fa-f]{1,4}:[\\dA-Fa-f]{1,4}|(?:(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:0{0,2}\\d|0?[1-9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\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|(?:(?:[\\dA-Fa-f]{1,4}:){0,5}[\\dA-Fa-f]{1,4})?::[\\dA-Fa-f]{1,4}|(?:(?:[\\dA-Fa-f]{1,4}:){0,6}[\\dA-Fa-f]{1,4})?::)|v[\\dA-Fa-f]+\\.[\\w-\\.~!\\$&'\\(\\)\\*\\+,;=:]+)\\]|(?:(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])|[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=]{1,255})(?::\\d*)?(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*)|\\/(?:[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]+(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*)?|[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]+(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*|(?:\\/\\/\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*)))(?:\\?[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@\\/\\?]*(?=#|$))?(?:#[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@\\/\\?]*)?$",
446
+ type: 'string',
447
+ },
448
+ page_layout: {
449
+ description: 'Page Layout',
450
+ enum: ['center', 'left', 'right'],
451
+ type: 'string',
452
+ },
453
+ },
454
+ required: ['background_color', 'background_image_url', 'page_layout'],
455
+ type: 'object',
456
+ },
457
+ widget: {
458
+ additionalProperties: false,
459
+ properties: {
460
+ header_text_alignment: {
461
+ description: 'Header text alignment',
462
+ enum: ['center', 'left', 'right'],
463
+ type: 'string',
464
+ },
465
+ logo_height: {
466
+ description: 'Logo height',
467
+ maximum: 100,
468
+ minimum: 1,
469
+ type: 'number',
470
+ },
471
+ logo_position: {
472
+ description: 'Logo position',
473
+ enum: ['center', 'left', 'none', 'right'],
474
+ type: 'string',
475
+ },
476
+ logo_url: {
477
+ description: 'Logo url',
478
+ pattern: "^$|^(?=.)(?!https?:\\/(?:$|[^/]))(?!https?:\\/\\/\\/)(?!https?:[^/])(?:(?:https):(?:(?:\\/\\/(?:[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:]*@)?(?:\\[(?:(?:(?:[\\dA-Fa-f]{1,4}:){6}(?:[\\dA-Fa-f]{1,4}:[\\dA-Fa-f]{1,4}|(?:(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|::(?:[\\dA-Fa-f]{1,4}:){5}(?:[\\dA-Fa-f]{1,4}:[\\dA-Fa-f]{1,4}|(?:(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|(?:[\\dA-Fa-f]{1,4})?::(?:[\\dA-Fa-f]{1,4}:){4}(?:[\\dA-Fa-f]{1,4}:[\\dA-Fa-f]{1,4}|(?:(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|(?:(?:[\\dA-Fa-f]{1,4}:){0,1}[\\dA-Fa-f]{1,4})?::(?:[\\dA-Fa-f]{1,4}:){3}(?:[\\dA-Fa-f]{1,4}:[\\dA-Fa-f]{1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dA-Fa-f!\\$&'\\(\\)\\*\\+,;=]{1,255})(?::\\d*)?(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*)|\\/(?:[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]+(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*)?|[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]+(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*|(?:\\/\\/\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*)))(?:\\?[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@\\/\\?]*(?=#|$))?(?:#[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@\\/\\?]*)?$",
479
+ type: 'string',
480
+ },
481
+ social_buttons_layout: {
482
+ description: 'Social buttons layout',
483
+ enum: ['bottom', 'top'],
484
+ type: 'string',
485
+ },
486
+ },
487
+ required: [
488
+ 'header_text_alignment',
489
+ 'logo_height',
490
+ 'logo_position',
491
+ 'logo_url',
492
+ 'social_buttons_layout',
493
+ ],
494
+ type: 'object',
495
+ },
496
+ },
497
+ required: ['borders', 'colors', 'fonts', 'page_background', 'widget'],
498
+ type: 'object',
499
+ },
500
+ };
@@ -70,5 +70,6 @@ declare const constants: {
70
70
  LOG_STREAMS_DIRECTORY: string;
71
71
  PROMPTS_DIRECTORY: string;
72
72
  CUSTOM_DOMAINS_DIRECTORY: string;
73
+ THEMES_DIRECTORY: string;
73
74
  };
74
75
  export default constants;
@@ -167,5 +167,6 @@ const constants = {
167
167
  LOG_STREAMS_DIRECTORY: 'log-streams',
168
168
  PROMPTS_DIRECTORY: 'prompts',
169
169
  CUSTOM_DOMAINS_DIRECTORY: 'custom-domains',
170
+ THEMES_DIRECTORY: 'themes',
170
171
  };
171
172
  exports.default = constants;
@@ -75,6 +75,7 @@ declare const _default: {
75
75
  LOG_STREAMS_DIRECTORY: string;
76
76
  PROMPTS_DIRECTORY: string;
77
77
  CUSTOM_DOMAINS_DIRECTORY: string;
78
+ THEMES_DIRECTORY: string;
78
79
  };
79
80
  deploy: typeof deploy;
80
81
  keywordReplace: typeof keywordReplace;
@@ -10,7 +10,7 @@ export declare function convertJsonToString(obj: {
10
10
  [key: string]: any;
11
11
  }, spacing?: number): string;
12
12
  export declare function stripFields(obj: Asset, fields: string[]): Asset;
13
- export declare function getEnabledClients(assets: Assets, connection: Asset, existing: Asset[], clients: Asset[]): string[];
13
+ export declare function getEnabledClients(assets: Assets, connection: Asset, existing: Asset[], clients: Asset[]): string[] | undefined;
14
14
  export declare function duplicateItems(arr: Asset[], key: string): Asset[];
15
15
  export declare function filterExcluded(changes: CalculatedChanges, exclude: string[]): CalculatedChanges;
16
16
  export declare function areArraysEquals(x: any[], y: any[]): boolean;
@@ -134,6 +134,8 @@ function stripFields(obj, fields) {
134
134
  exports.stripFields = stripFields;
135
135
  function getEnabledClients(assets, connection, existing, clients) {
136
136
  // Convert enabled_clients by name to the id
137
+ if (connection.enabled_clients === undefined)
138
+ return undefined; // If no enabled clients passed in, explicitly ignore from management, preventing unintentional disabling of connection.
137
139
  const excludedClientsByNames = (assets.exclude && assets.exclude.clients) || [];
138
140
  const excludedClients = convertClientNamesToIds(excludedClientsByNames, clients);
139
141
  const enabledClients = [
package/lib/types.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { PromptScreenTypes, Prompts, PromptsCustomText, PromptSettings } from './tools/auth0/handlers/prompts';
1
+ import { PromptTypes, ScreenTypes, Prompts, PromptsCustomText, PromptSettings } from './tools/auth0/handlers/prompts';
2
+ import { Theme } from './tools/auth0/handlers/themes';
2
3
  declare type SharedPaginationParams = {
3
4
  checkpoint?: boolean;
4
5
  paginate?: boolean;
@@ -65,6 +66,14 @@ export declare type BaseAuth0APIClient = {
65
66
  getUniversalLoginTemplate: () => Promise<Asset>;
66
67
  updateSettings: ({}: {}, Asset: any) => Promise<void>;
67
68
  setUniversalLoginTemplate: ({}: {}, Asset: any) => Promise<void>;
69
+ getDefaultTheme: () => Promise<Theme>;
70
+ updateTheme: (arg0: {
71
+ id: string;
72
+ }, Theme: any) => Promise<Omit<Theme, 'themeId'>>;
73
+ createTheme: (arg0: Theme) => Promise<Omit<Theme, 'themeId'>>;
74
+ deleteTheme: (arg0: {
75
+ id: string;
76
+ }) => Promise<void>;
68
77
  };
69
78
  clients: APIClientBaseFunctions;
70
79
  clientGrants: APIClientBaseFunctions;
@@ -129,14 +138,16 @@ export declare type BaseAuth0APIClient = {
129
138
  };
130
139
  prompts: {
131
140
  updateCustomTextByLanguage: (arg0: {
132
- prompt: PromptScreenTypes;
141
+ prompt: PromptTypes;
133
142
  language: Language;
134
- body: {
135
- [key: string]: string;
136
- };
143
+ body: Partial<{
144
+ [key in ScreenTypes]: {
145
+ [key: string]: string;
146
+ };
147
+ }>;
137
148
  }) => Promise<void>;
138
149
  getCustomTextByLanguage: (arg0: {
139
- prompt: PromptScreenTypes;
150
+ prompt: PromptTypes;
140
151
  language: Language;
141
152
  }) => Promise<Partial<PromptsCustomText>>;
142
153
  getSettings: () => Promise<PromptSettings>;
@@ -261,6 +272,7 @@ export declare type Assets = Partial<{
261
272
  [key: string]: string[];
262
273
  };
263
274
  clientsOrig: Asset[] | null;
275
+ themes: Theme[] | null;
264
276
  }>;
265
277
  export declare type CalculatedChanges = {
266
278
  del: Asset[];
@@ -268,7 +280,7 @@ export declare type CalculatedChanges = {
268
280
  conflicts: Asset[];
269
281
  create: Asset[];
270
282
  };
271
- export declare type AssetTypes = 'rules' | 'rulesConfigs' | 'hooks' | 'pages' | 'databases' | 'clientGrants' | 'resourceServers' | 'clients' | 'connections' | 'tenant' | 'emailProvider' | 'emailTemplates' | 'guardianFactors' | 'guardianFactorProviders' | 'guardianFactorTemplates' | 'migrations' | 'guardianPhoneFactorMessageTypes' | 'guardianPhoneFactorSelectedProvider' | 'guardianPolicies' | 'roles' | 'actions' | 'organizations' | 'triggers' | 'attackProtection' | 'branding' | 'logStreams' | 'prompts' | 'customDomains';
283
+ export declare type AssetTypes = 'rules' | 'rulesConfigs' | 'hooks' | 'pages' | 'databases' | 'clientGrants' | 'resourceServers' | 'clients' | 'connections' | 'tenant' | 'emailProvider' | 'emailTemplates' | 'guardianFactors' | 'guardianFactorProviders' | 'guardianFactorTemplates' | 'migrations' | 'guardianPhoneFactorMessageTypes' | 'guardianPhoneFactorSelectedProvider' | 'guardianPolicies' | 'roles' | 'actions' | 'organizations' | 'triggers' | 'attackProtection' | 'branding' | 'logStreams' | 'prompts' | 'customDomains' | 'themes';
272
284
  export declare type KeywordMappings = {
273
285
  [key: string]: (string | number)[] | string | number;
274
286
  };
package/lib/utils.d.ts CHANGED
@@ -97,6 +97,7 @@ export declare function stripIdentifiers(auth0: Auth0, assets: Assets): {
97
97
  [key: string]: string[];
98
98
  } | undefined;
99
99
  clientsOrig?: Asset[] | null | undefined;
100
+ themes?: import("./tools/auth0/handlers/themes").Theme[] | null | undefined;
100
101
  };
101
102
  export declare function sanitize(str: string): string;
102
103
  declare type ImportantFields = {