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.
@@ -47,16 +47,6 @@ jobs:
47
47
  - run:
48
48
  name: Publish package
49
49
  command: npm publish
50
-
51
- ts_migration_progress:
52
- machine:
53
- image: ubuntu-2004:202111-02
54
- steps:
55
- - checkout
56
- - run :
57
- name: Typescript Migration Progress
58
- command: sh typescript-migration-progress.sh
59
-
60
50
  workflows:
61
51
  version: 2
62
52
  test:
@@ -86,9 +76,3 @@ workflows:
86
76
  ignore: /.*/
87
77
  tags:
88
78
  only: /^v.*/
89
- ts_migration:
90
- jobs:
91
- - ts_migration_progress:
92
- filters:
93
- tags:
94
- ignore: /.*/
@@ -0,0 +1,11 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "npm"
9
+ directory: "/"
10
+ schedule:
11
+ interval: "daily"
package/.husky/pre-commit CHANGED
@@ -6,5 +6,3 @@ npm run lint:fix
6
6
  npx pretty-quick --staged
7
7
 
8
8
  npx tsc --noEmit # Ensure that code compiles
9
-
10
- /bin/bash ./typescript-migration-progress.sh
package/CHANGELOG.md CHANGED
@@ -7,6 +7,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [7.13.0] - 2022-06-06
11
+
12
+ ### Added
13
+
14
+ - Themes support (if supported by tenant) [#554]
15
+
16
+ ### Fixed
17
+
18
+ - Omit `enabled_clients` from connection payload if not defined in resource configuration files [#563]
19
+
20
+ ## [7.12.3] - 2022-05-24
21
+
22
+ ### Fixed
23
+
24
+ - Resource exclusion respected during import even if resource configuration exists [#545]
25
+ - Environment variables ingested by default [#553]
26
+
27
+ ## [7.12.2] - 2022-05-17
28
+
29
+ ### Fixed
30
+
31
+ - Properly handle all screen types within a prompt grouping [#541]
32
+ - Gracefully ignoring custom domains if not supported by tenant [#542]
33
+
10
34
  ## [7.12.1] - 2022-05-11
11
35
 
12
36
  ### Fixed
@@ -739,7 +763,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
739
763
  [#527]: https://github.com/auth0/auth0-deploy-cli/issues/527
740
764
  [#530]: https://github.com/auth0/auth0-deploy-cli/issues/530
741
765
  [#532]: https://github.com/auth0/auth0-deploy-cli/issues/532
742
- [unreleased]: https://github.com/auth0/auth0-deploy-cli/compare/v7.12.1...HEAD
766
+ [#541]: https://github.com/auth0/auth0-deploy-cli/issues/541
767
+ [#542]: https://github.com/auth0/auth0-deploy-cli/issues/542
768
+ [#545]: https://github.com/auth0/auth0-deploy-cli/issues/545
769
+ [#553]: https://github.com/auth0/auth0-deploy-cli/issues/553
770
+ [#554]: https://github.com/auth0/auth0-deploy-cli/issues/554
771
+ [#563]: https://github.com/auth0/auth0-deploy-cli/issues/563
772
+ [unreleased]: https://github.com/auth0/auth0-deploy-cli/compare/v7.13.0...HEAD
773
+ [7.13.0]: https://github.com/auth0/auth0-deploy-cli/compare/v7.12.3...v7.13.0
774
+ [7.12.3]: https://github.com/auth0/auth0-deploy-cli/compare/v7.12.2...v7.12.3
775
+ [7.12.2]: https://github.com/auth0/auth0-deploy-cli/compare/v7.12.1...v7.12.2
743
776
  [7.12.1]: https://github.com/auth0/auth0-deploy-cli/compare/v7.12.0...v7.12.1
744
777
  [7.12.0]: https://github.com/auth0/auth0-deploy-cli/compare/v7.11.1...v7.12.0
745
778
  [7.11.1]: https://github.com/auth0/auth0-deploy-cli/compare/v7.11.0...v7.11.1
package/README.md CHANGED
@@ -19,7 +19,7 @@ Supported Auth0 Management API resources
19
19
  - [x] [Log Streams](https://auth0.com/docs/api/management/v2#!/Log_Streams/get_log_streams)
20
20
  - [ ] [Logs](https://auth0.com/docs/api/management/v2#!/Logs/get_logs)
21
21
  - [x] [Organizations](https://auth0.com/docs/api/management/v2#!/Organizations/get_organizations)
22
- - [ ] [Prompts](https://auth0.com/docs/api/management/v2#!/Prompts/get_prompts)
22
+ - [x] [Prompts](https://auth0.com/docs/api/management/v2#!/Prompts/get_prompts)
23
23
  - [x] [Resource Servers (APIs)](https://auth0.com/docs/api/management/v2#!/Resource_Servers/get_resource_servers)
24
24
  - [x] [Roles](https://auth0.com/docs/api/management/v2#!/Roles)
25
25
  - [x] [Rules](https://auth0.com/docs/api/management/v2#!/Rules/get_rules)
package/lib/args.js CHANGED
@@ -70,7 +70,7 @@ function getParams() {
70
70
  env: {
71
71
  describe: 'Override the mappings in config with environment variables.',
72
72
  boolean: true,
73
- default: false,
73
+ default: true,
74
74
  },
75
75
  export_ids: {
76
76
  alias: 'e',
@@ -31,6 +31,7 @@ const branding_1 = __importDefault(require("./branding"));
31
31
  const logStreams_1 = __importDefault(require("./logStreams"));
32
32
  const prompts_1 = __importDefault(require("./prompts"));
33
33
  const customDomains_1 = __importDefault(require("./customDomains"));
34
+ const themes_1 = __importDefault(require("./themes"));
34
35
  const directoryHandlers = {
35
36
  rules: rules_1.default,
36
37
  rulesConfigs: rulesConfigs_1.default,
@@ -60,5 +61,6 @@ const directoryHandlers = {
60
61
  logStreams: logStreams_1.default,
61
62
  prompts: prompts_1.default,
62
63
  customDomains: customDomains_1.default,
64
+ themes: themes_1.default,
63
65
  };
64
66
  exports.default = directoryHandlers;
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from '.';
2
+ import { ParsedAsset } from '../../../types';
3
+ import { Theme } from '../../../tools/auth0/handlers/themes';
4
+ declare type ParsedThemes = ParsedAsset<'themes', Theme[]>;
5
+ declare const themesHandler: DirectoryHandler<ParsedThemes>;
6
+ export default themesHandler;
@@ -0,0 +1,48 @@
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
+ const path_1 = __importDefault(require("path"));
16
+ const fs_extra_1 = require("fs-extra");
17
+ const utils_1 = require("../../../utils");
18
+ const tools_1 = require("../../../tools");
19
+ function parse(context) {
20
+ const baseFolder = path_1.default.join(context.filePath, tools_1.constants.THEMES_DIRECTORY);
21
+ if (!(0, utils_1.existsMustBeDir)(baseFolder)) {
22
+ return { themes: null };
23
+ }
24
+ const themeDefinitionsFiles = (0, utils_1.getFiles)(baseFolder, ['.json']);
25
+ if (!themeDefinitionsFiles.length) {
26
+ return { themes: [] };
27
+ }
28
+ const themes = themeDefinitionsFiles.map((themeDefinitionsFile) => (0, utils_1.loadJSON)(themeDefinitionsFile, context.mappings));
29
+ return { themes };
30
+ }
31
+ function dump(context) {
32
+ return __awaiter(this, void 0, void 0, function* () {
33
+ const { themes } = context.assets;
34
+ if (!themes) {
35
+ return;
36
+ }
37
+ const baseFolder = path_1.default.join(context.filePath, tools_1.constants.THEMES_DIRECTORY);
38
+ (0, fs_extra_1.ensureDirSync)(baseFolder);
39
+ themes.forEach((themeDefinition, i) => {
40
+ (0, utils_1.dumpJSON)(path_1.default.join(baseFolder, `theme${i ? i : ''}.json`), themeDefinition);
41
+ });
42
+ });
43
+ }
44
+ const themesHandler = {
45
+ parse,
46
+ dump,
47
+ };
48
+ exports.default = themesHandler;
@@ -73,7 +73,12 @@ class DirectoryContext {
73
73
  if ((0, utils_1.isDirectory)(this.filePath)) {
74
74
  /* If this is a directory, look for each file in the directory */
75
75
  logger_1.default.info(`Processing directory ${this.filePath}`);
76
- Object.values(handlers_1.default).forEach((handler) => {
76
+ Object.entries(handlers_1.default)
77
+ .filter(([handlerName]) => {
78
+ const excludedAssetTypes = this.config.AUTH0_EXCLUDED || [];
79
+ return !excludedAssetTypes.includes(handlerName);
80
+ })
81
+ .forEach(([_name, handler]) => {
77
82
  const parsed = handler.parse(this);
78
83
  Object.entries(parsed).forEach(([k, v]) => {
79
84
  this.assets[k] = v;
@@ -31,6 +31,7 @@ const branding_1 = __importDefault(require("./branding"));
31
31
  const logStreams_1 = __importDefault(require("./logStreams"));
32
32
  const prompts_1 = __importDefault(require("./prompts"));
33
33
  const customDomains_1 = __importDefault(require("./customDomains"));
34
+ const themes_1 = __importDefault(require("./themes"));
34
35
  const yamlHandlers = {
35
36
  rules: rules_1.default,
36
37
  hooks: hooks_1.default,
@@ -60,5 +61,6 @@ const yamlHandlers = {
60
61
  logStreams: logStreams_1.default,
61
62
  prompts: prompts_1.default,
62
63
  customDomains: customDomains_1.default,
64
+ themes: themes_1.default,
63
65
  };
64
66
  exports.default = yamlHandlers;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ import { ParsedAsset } from '../../../types';
3
+ import { Theme } from '../../../tools/auth0/handlers/themes';
4
+ declare type ParsedThemes = ParsedAsset<'themes', Theme[]>;
5
+ declare const themesHandler: YAMLHandler<ParsedThemes>;
6
+ export default themesHandler;
@@ -0,0 +1,26 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ function parseAndDump(context) {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ const { themes } = context.assets;
15
+ if (!themes)
16
+ return { themes: null };
17
+ return {
18
+ themes,
19
+ };
20
+ });
21
+ }
22
+ const themesHandler = {
23
+ parse: parseAndDump,
24
+ dump: parseAndDump,
25
+ };
26
+ exports.default = themesHandler;
@@ -69,6 +69,13 @@ class YAMLContext {
69
69
  throw new Error(`Problem loading ${this.configFile}\n${err}`);
70
70
  }
71
71
  }
72
+ const excludedAssetsFiltered = Object.keys(this.assets).reduce((acc, key) => {
73
+ const excludedAssetTypes = this.config.AUTH0_EXCLUDED || [];
74
+ if (excludedAssetTypes.includes(key))
75
+ return acc;
76
+ return Object.assign(Object.assign({}, acc), { [key]: this.assets[key] });
77
+ }, {});
78
+ this.assets = excludedAssetsFiltered;
72
79
  // Run initial schema check to ensure valid YAML
73
80
  const auth0 = new tools_1.Auth0(this.mgmtClient, this.assets, (0, utils_1.toConfigFn)(this.config));
74
81
  yield auth0.validate();
package/lib/index.d.ts CHANGED
@@ -79,6 +79,7 @@ declare const _default: {
79
79
  LOG_STREAMS_DIRECTORY: string;
80
80
  PROMPTS_DIRECTORY: string;
81
81
  CUSTOM_DOMAINS_DIRECTORY: string;
82
+ THEMES_DIRECTORY: string;
82
83
  };
83
84
  deploy: typeof import("./tools").deploy;
84
85
  keywordReplace: typeof import("./tools").keywordReplace;
@@ -83,7 +83,7 @@ export declare const schema: {
83
83
  };
84
84
  export default class ActionHandler extends DefaultAPIHandler {
85
85
  existing: Asset[] | null;
86
- constructor(options: any);
86
+ constructor(options: DefaultAPIHandler);
87
87
  createAction(action: any): Promise<Asset>;
88
88
  deleteAction(action: any): Promise<void | never[]>;
89
89
  objString(action: any): string;
@@ -38,6 +38,6 @@ export default class CustomDomainsHadnler extends DefaultAPIHandler {
38
38
  existing: Asset[] | null;
39
39
  constructor(config: DefaultAPIHandler);
40
40
  objString(item: Asset): string;
41
- getType(): Promise<Asset>;
41
+ getType(): Promise<Asset | null>;
42
42
  processChanges(assets: Assets): Promise<void>;
43
43
  }
@@ -37,10 +37,7 @@ exports.schema = {
37
37
  class CustomDomainsHadnler extends default_1.default {
38
38
  constructor(config) {
39
39
  super(Object.assign(Object.assign({}, config), { type: 'customDomains', id: 'custom_domain_id', identifiers: ['domain'], stripCreateFields: ['status', 'primary', 'verification'], functions: {
40
- //@ts-ignore
41
- delete: (args) => {
42
- return this.client.customDomains.delete({ id: args.custom_domain_id });
43
- },
40
+ delete: (args) => this.client.customDomains.delete({ id: args.custom_domain_id }),
44
41
  } }));
45
42
  }
46
43
  objString(item) {
@@ -48,12 +45,22 @@ class CustomDomainsHadnler extends default_1.default {
48
45
  }
49
46
  getType() {
50
47
  return __awaiter(this, void 0, void 0, function* () {
51
- if (this.existing) {
52
- return this.existing;
48
+ try {
49
+ if (this.existing) {
50
+ return this.existing;
51
+ }
52
+ const customDomains = yield this.client.customDomains.getAll({ paginate: false });
53
+ this.existing = customDomains;
54
+ return customDomains;
55
+ }
56
+ catch (err) {
57
+ if (err.statusCode === 403 &&
58
+ err.message ===
59
+ 'The account is not allowed to perform this operation, please contact our support team') {
60
+ return null;
61
+ }
62
+ throw err;
53
63
  }
54
- const customDomains = yield this.client.customDomains.getAll({ paginate: false });
55
- this.existing = customDomains;
56
- return customDomains;
57
64
  });
58
65
  }
59
66
  processChanges(assets) {
@@ -1,6 +1,7 @@
1
1
  import { Asset, Assets, Auth0APIClient, CalculatedChanges } from '../../../types';
2
2
  import { ConfigFunction } from '../../../configFactory';
3
3
  export declare function order(value: any): (t: any, n: any, descriptor: any) => any;
4
+ declare type ApiMethodOverride = string | Function;
4
5
  export default class APIHandler {
5
6
  config: ConfigFunction;
6
7
  id: string;
@@ -17,10 +18,10 @@ export default class APIHandler {
17
18
  stripCreateFields: string[];
18
19
  name?: string;
19
20
  functions: {
20
- getAll: string;
21
- update: string;
22
- create: string;
23
- delete: string;
21
+ getAll: ApiMethodOverride;
22
+ update: ApiMethodOverride;
23
+ create: ApiMethodOverride;
24
+ delete: ApiMethodOverride;
24
25
  };
25
26
  constructor(options: {
26
27
  id?: APIHandler['id'];
@@ -33,13 +34,13 @@ export default class APIHandler {
33
34
  sensitiveFieldsToObfuscate?: APIHandler['sensitiveFieldsToObfuscate'];
34
35
  stripCreateFields?: APIHandler['stripCreateFields'];
35
36
  functions: {
36
- getAll?: string;
37
- update?: string;
38
- create?: string;
39
- delete?: string;
37
+ getAll?: ApiMethodOverride;
38
+ update?: ApiMethodOverride;
39
+ create?: ApiMethodOverride;
40
+ delete?: ApiMethodOverride;
40
41
  };
41
42
  });
42
- getClientFN(fn: string | Function): Function;
43
+ getClientFN(fn: ApiMethodOverride): Function;
43
44
  didDelete(item: Asset): void;
44
45
  didCreate(item: Asset): void;
45
46
  didUpdate(item: Asset): void;
@@ -52,3 +53,4 @@ export default class APIHandler {
52
53
  validate(assets: Assets): Promise<void>;
53
54
  processChanges(assets: Assets, changes: CalculatedChanges): Promise<void>;
54
55
  }
56
+ export {};
@@ -55,6 +55,11 @@ declare const _default: {
55
55
  excludeSchema?: any;
56
56
  schema: any;
57
57
  };
58
+ themes: {
59
+ default: typeof APIHandler;
60
+ excludeSchema?: any;
61
+ schema: any;
62
+ };
58
63
  attackProtection: {
59
64
  default: typeof APIHandler;
60
65
  excludeSchema?: any;
@@ -52,6 +52,7 @@ const organizations = __importStar(require("./organizations"));
52
52
  const attackProtection = __importStar(require("./attackProtection"));
53
53
  const logStreams = __importStar(require("./logStreams"));
54
54
  const customDomains = __importStar(require("./customDomains"));
55
+ const themes = __importStar(require("./themes"));
55
56
  const auth0ApiHandlers = {
56
57
  rules,
57
58
  rulesConfigs,
@@ -82,5 +83,6 @@ const auth0ApiHandlers = {
82
83
  attackProtection,
83
84
  logStreams,
84
85
  customDomains,
86
+ themes,
85
87
  };
86
88
  exports.default = auth0ApiHandlers; // TODO: apply stronger types to schema properties
@@ -1,6 +1,9 @@
1
1
  import DefaultHandler from './default';
2
2
  import { Assets, Language } from '../../../types';
3
- declare const promptScreenTypes: readonly ["login", "login-id", "login-password", "login-email-verification", "signup", "signup-id", "signup-password", "reset-password", "consent", "mfa-push", "mfa-otp", "mfa-voice", "mfa-phone", "mfa-webauthn", "mfa-sms", "mfa-email", "mfa-recovery-code", "mfa", "status", "device-flow", "email-verification", "email-otp-challenge", "organizations", "invitation", "common"];
3
+ declare const promptTypes: readonly ["login", "login-id", "login-password", "login-email-verification", "signup", "signup-id", "signup-password", "reset-password", "consent", "mfa-push", "mfa-otp", "mfa-voice", "mfa-phone", "mfa-webauthn", "mfa-sms", "mfa-email", "mfa-recovery-code", "mfa", "status", "device-flow", "email-verification", "email-otp-challenge", "organizations", "invitation", "common"];
4
+ export declare type PromptTypes = typeof promptTypes[number];
5
+ declare const screenTypes: readonly ["login", "login-id", "login-password", "login-email-verification", "signup", "signup-id", "signup-password", "reset-password-request", "reset-password-email", "reset-password", "reset-password-success", "reset-password-error", "consent", "status", "mfa-detect-browser-capabilities", "mfa-enroll-result", "mfa-login-options", "mfa-begin-enroll-options", "mfa-otp-enrollment-qr", "mfa-otp-enrollment-code", "mfa-otp-challenge", "mfa-voice-challenge", "mfa-sms-challenge", "mfa-recovery-code-enrollment", "mfa-recovery-code-challenge", "mfa-country-codes", "mfa-sms-enrollment", "mfa-voice-enrollment", "mfa-phone-challenge", "mfa-phone-enrollment", "mfa-webauthn-roaming-enrollment", "mfa-webauthn-platform-enrollment", "mfa-webauthn-platform-challenge", "mfa-webauthn-roaming-challenge", "mfa-webauthn-change-key-nickname", "mfa-webauthn-enrollment-success", "mfa-webauthn-error", "mfa-webauthn-not-available-error", "mfa-sms-list", "mfa-email-challenge", "mfa-email-list", "mfa-push-welcome", "mfa-push-list", "mfa-push-enrollment-qr", "mfa-push-enrollment-code", "mfa-push-success", "mfa-push-challenge-push", "device-code-activation", "device-code-activation-allowed", "device-code-activation-denied", "device-code-confirmation", "email-verification-result", "email-otp-challenge", "redeem-ticket", "organization-selection", "accept-invitation"];
6
+ export declare type ScreenTypes = typeof screenTypes[number];
4
7
  export declare const schema: {
5
8
  type: string;
6
9
  properties: {
@@ -20,16 +23,17 @@ export declare const schema: {
20
23
  };
21
24
  };
22
25
  };
23
- export declare type PromptScreenTypes = typeof promptScreenTypes[number];
24
26
  export declare type PromptSettings = {
25
27
  universal_login_experience?: 'new' | 'classic';
26
28
  webauthn_platform_first_factor?: boolean;
27
29
  identifier_first?: boolean;
28
30
  };
29
31
  export declare type PromptsCustomText = {
30
- [key in PromptScreenTypes]: {
31
- [key: string]: string;
32
- };
32
+ [key in PromptTypes]: Partial<{
33
+ [key in ScreenTypes]: {
34
+ [key: string]: string;
35
+ };
36
+ }>;
33
37
  };
34
38
  export declare type Prompts = Partial<PromptSettings & {
35
39
  customText: AllPromptsByLanguage;
@@ -27,7 +27,7 @@ exports.schema = void 0;
27
27
  const default_1 = __importDefault(require("./default"));
28
28
  const types_1 = require("../../../types");
29
29
  const lodash_1 = require("lodash");
30
- const promptScreenTypes = [
30
+ const promptTypes = [
31
31
  'login',
32
32
  'login-id',
33
33
  'login-password',
@@ -54,6 +54,64 @@ const promptScreenTypes = [
54
54
  'invitation',
55
55
  'common',
56
56
  ];
57
+ const screenTypes = [
58
+ 'login',
59
+ 'login-id',
60
+ 'login-password',
61
+ 'login-email-verification',
62
+ 'signup',
63
+ 'signup-id',
64
+ 'signup-password',
65
+ 'reset-password-request',
66
+ 'reset-password-email',
67
+ 'reset-password',
68
+ 'reset-password-success',
69
+ 'reset-password-error',
70
+ 'consent',
71
+ 'status',
72
+ 'mfa-detect-browser-capabilities',
73
+ 'mfa-enroll-result',
74
+ 'mfa-login-options',
75
+ 'mfa-begin-enroll-options',
76
+ 'mfa-otp-enrollment-qr',
77
+ 'mfa-otp-enrollment-code',
78
+ 'mfa-otp-challenge',
79
+ 'mfa-voice-challenge',
80
+ 'mfa-sms-challenge',
81
+ 'mfa-recovery-code-enrollment',
82
+ 'mfa-recovery-code-challenge',
83
+ 'mfa-country-codes',
84
+ 'mfa-sms-enrollment',
85
+ 'mfa-voice-enrollment',
86
+ 'mfa-phone-challenge',
87
+ 'mfa-phone-enrollment',
88
+ 'mfa-webauthn-roaming-enrollment',
89
+ 'mfa-webauthn-platform-enrollment',
90
+ 'mfa-webauthn-platform-challenge',
91
+ 'mfa-webauthn-roaming-challenge',
92
+ 'mfa-webauthn-change-key-nickname',
93
+ 'mfa-webauthn-enrollment-success',
94
+ 'mfa-webauthn-error',
95
+ 'mfa-webauthn-not-available-error',
96
+ 'mfa-sms-list',
97
+ 'mfa-email-challenge',
98
+ 'mfa-email-list',
99
+ 'mfa-push-welcome',
100
+ 'mfa-push-list',
101
+ 'mfa-push-enrollment-qr',
102
+ 'mfa-push-enrollment-code',
103
+ 'mfa-push-success',
104
+ 'mfa-push-challenge-push',
105
+ 'device-code-activation',
106
+ 'device-code-activation-allowed',
107
+ 'device-code-activation-denied',
108
+ 'device-code-confirmation',
109
+ 'email-verification-result',
110
+ 'email-otp-challenge',
111
+ 'redeem-ticket',
112
+ 'organization-selection',
113
+ 'accept-invitation',
114
+ ];
57
115
  exports.schema = {
58
116
  type: 'object',
59
117
  properties: {
@@ -72,9 +130,14 @@ exports.schema = {
72
130
  properties: types_1.languages.reduce((acc, language) => {
73
131
  return Object.assign(Object.assign({}, acc), { [language]: {
74
132
  type: 'object',
75
- properties: promptScreenTypes.reduce((acc, screenType) => {
76
- return Object.assign(Object.assign({}, acc), { [screenType]: {
133
+ properties: promptTypes.reduce((acc, promptTypes) => {
134
+ return Object.assign(Object.assign({}, acc), { [promptTypes]: {
77
135
  type: 'object',
136
+ properties: screenTypes.reduce((acc, screenTypes) => {
137
+ return Object.assign(Object.assign({}, acc), { [screenTypes]: {
138
+ type: 'object',
139
+ } });
140
+ }, {}),
78
141
  } });
79
142
  }, {}),
80
143
  } });
@@ -102,16 +165,19 @@ class PromptsHandler extends default_1.default {
102
165
  .getSettings()
103
166
  .then(({ enabled_locales }) => enabled_locales);
104
167
  const data = yield Promise.all(supportedLanguages.flatMap((language) => {
105
- return promptScreenTypes.map((screenType) => {
168
+ return promptTypes.map((promptType) => {
106
169
  return this.client.prompts
107
170
  .getCustomTextByLanguage({
108
- prompt: screenType,
171
+ prompt: promptType,
109
172
  language,
110
173
  })
111
174
  .then((customTextData) => {
112
175
  if ((0, lodash_1.isEmpty)(customTextData))
113
176
  return null;
114
- return Object.assign({ language }, customTextData);
177
+ return {
178
+ language,
179
+ [promptType]: Object.assign({}, customTextData),
180
+ };
115
181
  });
116
182
  });
117
183
  })).then((customTextData) => {
@@ -156,14 +222,11 @@ class PromptsHandler extends default_1.default {
156
222
  if (!languageScreenTypes)
157
223
  return [];
158
224
  return Object.keys(languageScreenTypes).map((prompt) => {
159
- const body = languageScreenTypes[prompt];
225
+ const body = languageScreenTypes[prompt] || {};
160
226
  return this.client.prompts.updateCustomTextByLanguage({
161
227
  prompt,
162
228
  language,
163
- //@ts-ignore
164
- body: {
165
- [prompt]: languageScreenTypes[prompt],
166
- } || {},
229
+ body,
167
230
  });
168
231
  });
169
232
  }));