auth0-deploy-cli 7.7.1 → 7.10.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 (134) hide show
  1. package/CHANGELOG.md +40 -1
  2. package/README.md +2 -2
  3. package/lib/args.d.ts +29 -0
  4. package/lib/commands/export.d.ts +2 -0
  5. package/lib/commands/import.d.ts +2 -0
  6. package/lib/commands/index.d.ts +9 -0
  7. package/lib/configFactory.d.ts +7 -0
  8. package/lib/context/defaults.d.ts +1 -0
  9. package/lib/context/directory/handlers/actions.d.ts +6 -0
  10. package/lib/context/directory/handlers/attackProtection.d.ts +10 -0
  11. package/lib/context/directory/handlers/branding.d.ts +6 -0
  12. package/lib/context/directory/handlers/branding.js +55 -21
  13. package/lib/context/directory/handlers/clientGrants.d.ts +6 -0
  14. package/lib/context/directory/handlers/clients.d.ts +6 -0
  15. package/lib/context/directory/handlers/connections.d.ts +6 -0
  16. package/lib/context/directory/handlers/databases.d.ts +6 -0
  17. package/lib/context/directory/handlers/emailProvider.d.ts +6 -0
  18. package/lib/context/directory/handlers/emailTemplates.d.ts +6 -0
  19. package/lib/context/directory/handlers/guardianFactorProviders.d.ts +6 -0
  20. package/lib/context/directory/handlers/guardianFactorTemplates.d.ts +6 -0
  21. package/lib/context/directory/handlers/guardianFactors.d.ts +6 -0
  22. package/lib/context/directory/handlers/guardianPhoneFactorMessageTypes.d.ts +6 -0
  23. package/lib/context/directory/handlers/guardianPhoneFactorSelectedProvider.d.ts +6 -0
  24. package/lib/context/directory/handlers/guardianPolicies.d.ts +6 -0
  25. package/lib/context/directory/handlers/hooks.d.ts +6 -0
  26. package/lib/context/directory/handlers/index.d.ts +12 -0
  27. package/lib/context/directory/handlers/index.js +2 -0
  28. package/lib/context/directory/handlers/logStreams.d.ts +7 -0
  29. package/lib/context/directory/handlers/logStreams.js +49 -0
  30. package/lib/context/directory/handlers/migrations.d.ts +6 -0
  31. package/lib/context/directory/handlers/organizations.d.ts +6 -0
  32. package/lib/context/directory/handlers/pages.d.ts +6 -0
  33. package/lib/context/directory/handlers/resourceServers.d.ts +6 -0
  34. package/lib/context/directory/handlers/roles.d.ts +6 -0
  35. package/lib/context/directory/handlers/rules.d.ts +6 -0
  36. package/lib/context/directory/handlers/rulesConfigs.d.ts +6 -0
  37. package/lib/context/directory/handlers/tenant.d.ts +10 -0
  38. package/lib/context/directory/handlers/triggers.d.ts +6 -0
  39. package/lib/context/directory/index.d.ts +17 -0
  40. package/lib/context/index.d.ts +4 -0
  41. package/lib/context/yaml/handlers/actions.d.ts +6 -0
  42. package/lib/context/yaml/handlers/attackProtection.d.ts +6 -0
  43. package/lib/context/yaml/handlers/branding.d.ts +13 -0
  44. package/lib/context/yaml/handlers/branding.js +23 -6
  45. package/lib/context/yaml/handlers/clientGrants.d.ts +6 -0
  46. package/lib/context/yaml/handlers/clients.d.ts +6 -0
  47. package/lib/context/yaml/handlers/connections.d.ts +6 -0
  48. package/lib/context/yaml/handlers/databases.d.ts +6 -0
  49. package/lib/context/yaml/handlers/emailProvider.d.ts +6 -0
  50. package/lib/context/yaml/handlers/emailTemplates.d.ts +6 -0
  51. package/lib/context/yaml/handlers/guardianFactorProviders.d.ts +6 -0
  52. package/lib/context/yaml/handlers/guardianFactorTemplates.d.ts +6 -0
  53. package/lib/context/yaml/handlers/guardianFactors.d.ts +6 -0
  54. package/lib/context/yaml/handlers/guardianPhoneFactorMessageTypes.d.ts +6 -0
  55. package/lib/context/yaml/handlers/guardianPhoneFactorSelectedProvider.d.ts +6 -0
  56. package/lib/context/yaml/handlers/guardianPolicies.d.ts +6 -0
  57. package/lib/context/yaml/handlers/hooks.d.ts +6 -0
  58. package/lib/context/yaml/handlers/index.d.ts +12 -0
  59. package/lib/context/yaml/handlers/index.js +2 -0
  60. package/lib/context/yaml/handlers/logStreams.d.ts +7 -0
  61. package/lib/context/yaml/handlers/logStreams.js +23 -0
  62. package/lib/context/yaml/handlers/migrations.d.ts +6 -0
  63. package/lib/context/yaml/handlers/organizations.d.ts +6 -0
  64. package/lib/context/yaml/handlers/pages.d.ts +6 -0
  65. package/lib/context/yaml/handlers/resourceServers.d.ts +6 -0
  66. package/lib/context/yaml/handlers/roles.d.ts +6 -0
  67. package/lib/context/yaml/handlers/rules.d.ts +6 -0
  68. package/lib/context/yaml/handlers/rulesConfigs.d.ts +6 -0
  69. package/lib/context/yaml/handlers/tenant.d.ts +6 -0
  70. package/lib/context/yaml/handlers/triggers.d.ts +6 -0
  71. package/lib/context/yaml/index.d.ts +13 -0
  72. package/lib/index.d.ts +89 -0
  73. package/lib/index.js +5 -2
  74. package/lib/logger.d.ts +2 -0
  75. package/lib/logger.js +7 -17
  76. package/lib/readonly.d.ts +2 -0
  77. package/lib/sessionDurationsToMinutes.d.ts +7 -0
  78. package/lib/tools/auth0/client.d.ts +2 -0
  79. package/lib/tools/auth0/handlers/actions.d.ts +95 -0
  80. package/lib/tools/auth0/handlers/actions.js +1 -1
  81. package/lib/tools/auth0/handlers/attackProtection.d.ts +28 -0
  82. package/lib/tools/auth0/handlers/branding.d.ts +27 -0
  83. package/lib/tools/auth0/handlers/clientGrants.d.ts +32 -0
  84. package/lib/tools/auth0/handlers/clients.d.ts +23 -0
  85. package/lib/tools/auth0/handlers/connections.d.ts +54 -0
  86. package/lib/tools/auth0/handlers/databases.d.ts +36 -0
  87. package/lib/tools/auth0/handlers/default.d.ts +54 -0
  88. package/lib/tools/auth0/handlers/default.js +23 -8
  89. package/lib/tools/auth0/handlers/emailProvider.d.ts +11 -0
  90. package/lib/tools/auth0/handlers/emailTemplates.d.ts +26 -0
  91. package/lib/tools/auth0/handlers/guardianFactorProviders.d.ts +25 -0
  92. package/lib/tools/auth0/handlers/guardianFactorTemplates.d.ts +21 -0
  93. package/lib/tools/auth0/handlers/guardianFactors.d.ts +21 -0
  94. package/lib/tools/auth0/handlers/guardianPhoneFactorMessageTypes.d.ts +21 -0
  95. package/lib/tools/auth0/handlers/guardianPhoneFactorSelectedProvider.d.ts +18 -0
  96. package/lib/tools/auth0/handlers/guardianPolicies.d.ts +23 -0
  97. package/lib/tools/auth0/handlers/hooks.d.ts +58 -0
  98. package/lib/tools/auth0/handlers/index.d.ts +134 -0
  99. package/lib/tools/auth0/handlers/index.js +2 -0
  100. package/lib/tools/auth0/handlers/logStreams.d.ts +40 -0
  101. package/lib/tools/auth0/handlers/logStreams.js +77 -0
  102. package/lib/tools/auth0/handlers/migrations.d.ts +15 -0
  103. package/lib/tools/auth0/handlers/migrations.js +1 -1
  104. package/lib/tools/auth0/handlers/organizations.d.ts +51 -0
  105. package/lib/tools/auth0/handlers/organizations.js +2 -2
  106. package/lib/tools/auth0/handlers/pages.d.ts +42 -0
  107. package/lib/tools/auth0/handlers/prompts.d.ts +11 -0
  108. package/lib/tools/auth0/handlers/resourceServers.d.ts +51 -0
  109. package/lib/tools/auth0/handlers/resourceServers.js +1 -1
  110. package/lib/tools/auth0/handlers/roles.d.ts +48 -0
  111. package/lib/tools/auth0/handlers/roles.js +2 -2
  112. package/lib/tools/auth0/handlers/rules.d.ts +55 -0
  113. package/lib/tools/auth0/handlers/rules.js +2 -2
  114. package/lib/tools/auth0/handlers/rulesConfigs.d.ts +25 -0
  115. package/lib/tools/auth0/handlers/tenant.d.ts +11 -0
  116. package/lib/tools/auth0/handlers/triggers.d.ts +35 -0
  117. package/lib/tools/auth0/handlers/triggers.js +1 -1
  118. package/lib/tools/auth0/index.d.ts +15 -0
  119. package/lib/tools/auth0/schema.d.ts +15 -0
  120. package/lib/tools/calculateChanges.d.ts +26 -0
  121. package/lib/tools/calculateChanges.js +3 -3
  122. package/lib/tools/constants.d.ts +72 -0
  123. package/lib/tools/constants.js +4 -1
  124. package/lib/tools/deploy.d.ts +3 -0
  125. package/lib/tools/deploy.js +2 -2
  126. package/lib/tools/index.d.ts +83 -0
  127. package/lib/tools/utils.d.ts +18 -0
  128. package/lib/tools/utils.js +36 -3
  129. package/lib/tools/validationError.d.ts +5 -0
  130. package/lib/types.d.ts +257 -0
  131. package/lib/utils.d.ts +67 -0
  132. package/package.json +10 -10
  133. package/tsconfig.json +2 -1
  134. package/lib/tools/logger.js +0 -21
@@ -8,6 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __rest = (this && this.__rest) || function (s, e) {
12
+ var t = {};
13
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
+ t[p] = s[p];
15
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
+ t[p[i]] = s[p[i]];
19
+ }
20
+ return t;
21
+ };
11
22
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
23
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
24
  };
@@ -18,24 +29,30 @@ const tools_1 = require("../../../tools");
18
29
  function parse(context) {
19
30
  return __awaiter(this, void 0, void 0, function* () {
20
31
  // Load the HTML file for each page
21
- const { branding } = context.assets;
22
- if (!branding || !branding.templates)
32
+ if (!context.assets.branding)
33
+ return {
34
+ branding: {
35
+ templates: [],
36
+ },
37
+ };
38
+ const _a = context.assets.branding, { templates } = _a, branding = __rest(_a, ["templates"]);
39
+ if (!branding && !branding['templates'])
23
40
  return { branding };
24
- const templates = branding.templates.map((templateDefinition) => {
25
- const markupFile = path_1.default.join(templateDefinition.body);
41
+ const parsedTemplates = templates.map((templateDefinition) => {
42
+ const markupFile = path_1.default.join(context.basePath, templateDefinition.body);
26
43
  return {
27
44
  template: templateDefinition.template,
28
45
  body: (0, tools_1.loadFileAndReplaceKeywords)(markupFile, context.mappings),
29
46
  };
30
47
  });
31
48
  return {
32
- branding: Object.assign(Object.assign({}, branding), { templates }),
49
+ branding: Object.assign(Object.assign({}, branding), { templates: parsedTemplates }),
33
50
  };
34
51
  });
35
52
  }
36
53
  function dump(context) {
37
54
  return __awaiter(this, void 0, void 0, function* () {
38
- const { branding } = context.assets || { branding: undefined };
55
+ const { branding } = context.assets;
39
56
  branding.templates = branding.templates || [];
40
57
  // create templates folder
41
58
  if (branding.templates.length) {
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedClientGrants = {
3
+ clientGrants: unknown[];
4
+ };
5
+ declare const clientGrantsHandler: YAMLHandler<ParsedClientGrants>;
6
+ export default clientGrantsHandler;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedClients = {
3
+ clients: unknown[];
4
+ };
5
+ declare const clientsHandler: YAMLHandler<ParsedClients>;
6
+ export default clientsHandler;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedConnections = {
3
+ connections: unknown[];
4
+ };
5
+ declare const connectionsHandler: YAMLHandler<ParsedConnections>;
6
+ export default connectionsHandler;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedDatabases = {
3
+ databases: unknown[];
4
+ };
5
+ declare const databasesHandler: YAMLHandler<ParsedDatabases | {}>;
6
+ export default databasesHandler;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedEmailProvider = {
3
+ emailProvider: unknown;
4
+ };
5
+ declare const emailProviderHandler: YAMLHandler<ParsedEmailProvider>;
6
+ export default emailProviderHandler;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedEmailTemplates = {
3
+ emailTemplates: unknown[];
4
+ };
5
+ declare const emailTemplatesHandler: YAMLHandler<ParsedEmailTemplates>;
6
+ export default emailTemplatesHandler;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedGuardianFactorProviders = {
3
+ guardianFactorProviders: unknown[];
4
+ };
5
+ declare const guardianFactorProvidersHandler: YAMLHandler<ParsedGuardianFactorProviders>;
6
+ export default guardianFactorProvidersHandler;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedGuardianFactorTemplates = {
3
+ guardianFactorTemplates: unknown[];
4
+ };
5
+ declare const guardianFactorTemplatesHandler: YAMLHandler<ParsedGuardianFactorTemplates>;
6
+ export default guardianFactorTemplatesHandler;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedGuardianFactors = {
3
+ guardianFactors: unknown[];
4
+ };
5
+ declare const guardianFactorsHandler: YAMLHandler<ParsedGuardianFactors>;
6
+ export default guardianFactorsHandler;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedGuardianFactorMessageTypes = {
3
+ guardianPhoneFactorMessageTypes: unknown;
4
+ };
5
+ declare const guardianPhoneFactorMessageTypesHandler: YAMLHandler<ParsedGuardianFactorMessageTypes>;
6
+ export default guardianPhoneFactorMessageTypesHandler;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedGuardianPhoneFactorSelectedProvider = {
3
+ guardianPhoneFactorSelectedProvider: unknown;
4
+ };
5
+ declare const guardianPhoneFactorSelectedProviderHandler: YAMLHandler<ParsedGuardianPhoneFactorSelectedProvider>;
6
+ export default guardianPhoneFactorSelectedProviderHandler;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedGuardianPolicies = {
3
+ guardianPolicies: unknown;
4
+ };
5
+ declare const guardianPoliciesHandler: YAMLHandler<ParsedGuardianPolicies>;
6
+ export default guardianPoliciesHandler;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedHooks = {
3
+ hooks: unknown[];
4
+ } | {};
5
+ declare const hooksHandler: YAMLHandler<ParsedHooks>;
6
+ export default hooksHandler;
@@ -0,0 +1,12 @@
1
+ import YAMLContext from '..';
2
+ import { AssetTypes } from '../../../types';
3
+ export declare type YAMLHandler<T> = {
4
+ dump: (context: YAMLContext) => Promise<T | {}>;
5
+ parse: (context: YAMLContext) => Promise<T>;
6
+ };
7
+ declare const yamlHandlers: {
8
+ [key in AssetTypes]: YAMLHandler<{
9
+ [key: string]: unknown;
10
+ }>;
11
+ };
12
+ export default yamlHandlers;
@@ -28,6 +28,7 @@ const actions_1 = __importDefault(require("./actions"));
28
28
  const triggers_1 = __importDefault(require("./triggers"));
29
29
  const attackProtection_1 = __importDefault(require("./attackProtection"));
30
30
  const branding_1 = __importDefault(require("./branding"));
31
+ const logStreams_1 = __importDefault(require("./logStreams"));
31
32
  const yamlHandlers = {
32
33
  rules: rules_1.default,
33
34
  hooks: hooks_1.default,
@@ -54,5 +55,6 @@ const yamlHandlers = {
54
55
  triggers: triggers_1.default,
55
56
  attackProtection: attackProtection_1.default,
56
57
  branding: branding_1.default,
58
+ logStreams: logStreams_1.default,
57
59
  };
58
60
  exports.default = yamlHandlers;
@@ -0,0 +1,7 @@
1
+ import { YAMLHandler } from '.';
2
+ import { Asset } from '../../../types';
3
+ declare type ParsedLogStreams = {
4
+ logStreams: Asset[] | null;
5
+ };
6
+ declare const logStreamsHandler: YAMLHandler<ParsedLogStreams>;
7
+ export default logStreamsHandler;
@@ -0,0 +1,23 @@
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
+ return {
15
+ logStreams: context.assets.logStreams || [],
16
+ };
17
+ });
18
+ }
19
+ const logStreamsHandler = {
20
+ parse: parseAndDump,
21
+ dump: parseAndDump,
22
+ };
23
+ exports.default = logStreamsHandler;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedMigrations = {
3
+ migrations: unknown[];
4
+ };
5
+ declare const migrationsHandler: YAMLHandler<ParsedMigrations>;
6
+ export default migrationsHandler;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedOrganizations = {
3
+ organizations: unknown[];
4
+ };
5
+ declare const organizationsHandler: YAMLHandler<ParsedOrganizations>;
6
+ export default organizationsHandler;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedPages = {
3
+ pages: unknown[];
4
+ } | {};
5
+ declare const pagesHandler: YAMLHandler<ParsedPages>;
6
+ export default pagesHandler;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedResourceServers = {
3
+ resourceServers: unknown[];
4
+ };
5
+ declare const resourceServersHandler: YAMLHandler<ParsedResourceServers>;
6
+ export default resourceServersHandler;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedRoles = {
3
+ roles: unknown[];
4
+ };
5
+ declare const rolesHandler: YAMLHandler<ParsedRoles>;
6
+ export default rolesHandler;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedRules = {
3
+ rules: unknown[];
4
+ } | {};
5
+ declare const rulesHandler: YAMLHandler<ParsedRules>;
6
+ export default rulesHandler;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedRulesConfigs = {
3
+ rulesConfigs: unknown[];
4
+ } | {};
5
+ declare const rulesConfigsHandler: YAMLHandler<ParsedRulesConfigs>;
6
+ export default rulesConfigsHandler;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedTenant = {
3
+ tenant: unknown[];
4
+ } | {};
5
+ declare const tenantHandler: YAMLHandler<ParsedTenant>;
6
+ export default tenantHandler;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedTriggers = {
3
+ triggers: unknown[];
4
+ } | {};
5
+ declare const triggersHandler: YAMLHandler<ParsedTriggers>;
6
+ export default triggersHandler;
@@ -0,0 +1,13 @@
1
+ import { Assets, Config, Auth0APIClient, KeywordMappings } from '../../types';
2
+ export default class YAMLContext {
3
+ basePath: string;
4
+ configFile: string;
5
+ config: Config;
6
+ mappings: KeywordMappings;
7
+ mgmtClient: Auth0APIClient;
8
+ assets: Assets;
9
+ constructor(config: Config, mgmtClient: any);
10
+ loadFile(f: any): string;
11
+ load(): Promise<void>;
12
+ dump(): Promise<void>;
13
+ }
package/lib/index.d.ts ADDED
@@ -0,0 +1,89 @@
1
+ #!/usr/bin/env node
2
+ import importCMD from './commands/import';
3
+ import exportCMD from './commands/export';
4
+ declare const _default: {
5
+ deploy: typeof importCMD;
6
+ dump: typeof exportCMD;
7
+ import: typeof importCMD;
8
+ export: typeof exportCMD;
9
+ tools: {
10
+ constants: {
11
+ CONCURRENT_CALLS: number;
12
+ RULES_DIRECTORY: string;
13
+ RULES_STAGES: string[];
14
+ DEFAULT_RULE_STAGE: string;
15
+ HOOKS_HIDDEN_SECRET_VALUE: string;
16
+ OBFUSCATED_SECRET_VALUE: string;
17
+ HOOKS_DIRECTORY: string;
18
+ ACTIONS_DIRECTORY: string;
19
+ TRIGGERS_DIRECTORY: string;
20
+ RULES_CONFIGS_DIRECTORY: string;
21
+ PAGES_DIRECTORY: string;
22
+ PAGE_LOGIN: string;
23
+ PAGE_GUARDIAN_MULTIFACTOR: string;
24
+ PAGE_PASSWORD_RESET: string;
25
+ PAGE_ERROR: string;
26
+ DATABASE_CONNECTIONS_DIRECTORY: string;
27
+ DATABASE_SCRIPTS_CHANGE_EMAIL: string;
28
+ DATABASE_SCRIPTS_GET_USER: string;
29
+ EMAIL_TEMPLATES_TYPES: string[];
30
+ ACTIONS_TRIGGERS: string[];
31
+ EMAIL_TEMPLATES_DIRECTORY: string;
32
+ EMAIL_VERIFY: string;
33
+ EMAIL_VERIFY_BY_CODE: string;
34
+ EMAIL_RESET: string;
35
+ EMAIL_WELCOME: string;
36
+ EMAIL_BLOCKED: string;
37
+ EMAIL_STOLEN_CREDENTIALS: string;
38
+ EMAIL_ENROLLMENT: string;
39
+ EMAIL_CHANGE_PASSWORD: string;
40
+ EMAIL_PASSWORD_RESET: string;
41
+ EMAIL_MFA_OOB_CODE: string;
42
+ EMAIL_USER_INVITATION: string;
43
+ GUARDIAN_DIRECTORY: string;
44
+ GUARDIAN_FACTORS_DIRECTORY: string;
45
+ GUARDIAN_PROVIDERS_DIRECTORY: string;
46
+ GUARDIAN_TEMPLATES_DIRECTORY: string;
47
+ UNIVERSAL_LOGIN_TEMPLATE: string;
48
+ RESOURCE_SERVERS_DIRECTORY: string;
49
+ RESOURCE_SERVERS_CLIENT_NAME: string;
50
+ RESOURCE_SERVERS_MANAGEMENT_API_NAME: string;
51
+ RESOURCE_SERVERS_ID_NAME: string;
52
+ CLIENTS_DIRECTORY: string;
53
+ CLIENTS_GRANTS_DIRECTORY: string;
54
+ BRANDING_DIRECTORY: string;
55
+ BRANDING_TEMPLATES_DIRECTORY: string;
56
+ BRANDING_TEMPLATES_YAML_DIRECTORY: string;
57
+ CLIENTS_CLIENT_NAME: string;
58
+ CLIENTS_CLIENT_ID_NAME: string;
59
+ CONNECTIONS_DIRECTORY: string;
60
+ CONNECTIONS_CLIENT_NAME: string;
61
+ CONNECTIONS_ID_NAME: string;
62
+ ROLES_DIRECTORY: string;
63
+ ATTACK_PROTECTION_DIRECTORY: string;
64
+ GUARDIAN_FACTORS: string[];
65
+ GUARDIAN_POLICIES: string[];
66
+ GUARDIAN_PHONE_PROVIDERS: string[];
67
+ GUARDIAN_PHONE_MESSAGE_TYPES: string[];
68
+ GUARDIAN_FACTOR_TEMPLATES: string[];
69
+ GUARDIAN_FACTOR_PROVIDERS: {
70
+ sms: string[];
71
+ 'push-notification': string[];
72
+ };
73
+ PAGE_NAMES: string[];
74
+ DATABASE_SCRIPTS: string[];
75
+ DATABASE_SCRIPTS_NO_IMPORT: string[];
76
+ DATABASE_SCRIPTS_IMPORT: string[];
77
+ EMAIL_TEMPLATES_NAMES: string[];
78
+ SUPPORTED_BRANDING_TEMPLATES: string[];
79
+ LOG_STREAMS_DIRECTORY: string;
80
+ };
81
+ deploy: typeof import("./tools").deploy;
82
+ keywordReplace: typeof import("./tools").keywordReplace;
83
+ loadFileAndReplaceKeywords: typeof import("./tools").loadFileAndReplaceKeywords;
84
+ Auth0: typeof import("./tools").Auth0;
85
+ };
86
+ };
87
+ export default _default;
88
+ export declare const dump: typeof exportCMD;
89
+ export declare const deploy: typeof importCMD;
package/lib/index.js CHANGED
@@ -13,6 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  return (mod && mod.__esModule) ? mod : { "default": mod };
14
14
  };
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.deploy = exports.dump = void 0;
16
17
  const global_agent_1 = require("global-agent");
17
18
  const args_1 = require("./args");
18
19
  const logger_1 = __importDefault(require("./logger"));
@@ -49,7 +50,7 @@ if (require.main === module) {
49
50
  const params = (0, args_1.getParams)();
50
51
  logger_1.default.debug('Starting Auth0 Deploy CLI Tool');
51
52
  if (params.debug) {
52
- logger_1.default.transports.console.level = 'debug';
53
+ logger_1.default.level = 'debug';
53
54
  // Set for tools
54
55
  process.env.AUTH0_DEBUG = 'true';
55
56
  process.env.AUTH0_LOG = 'debug';
@@ -76,10 +77,12 @@ if (require.main === module) {
76
77
  });
77
78
  }
78
79
  // Export commands to be used programmatically
79
- module.exports = {
80
+ exports.default = {
80
81
  deploy: import_1.default,
81
82
  dump: export_1.default,
82
83
  import: import_1.default,
83
84
  export: export_1.default,
84
85
  tools: tools_1.default,
85
86
  };
87
+ exports.dump = export_1.default;
88
+ exports.deploy = import_1.default;
@@ -0,0 +1,2 @@
1
+ declare const logger: import("winston").Logger;
2
+ export default logger;
package/lib/logger.js CHANGED
@@ -1,21 +1,11 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const winston_1 = __importDefault(require("winston"));
7
- //@ts-ignore because used version of Winston still supports emitErrs property
8
- winston_1.default.emitErrs = true;
9
- const log = new winston_1.default.Logger({
10
- transports: [
11
- new winston_1.default.transports.Console({
12
- timestamp: true,
13
- level: process.env.AUTH0_LOG || 'info',
14
- handleExceptions: true,
15
- json: false,
16
- colorize: true,
17
- }),
18
- ],
3
+ const winston_1 = require("winston");
4
+ const { combine, timestamp, colorize } = winston_1.format;
5
+ const logger = (0, winston_1.createLogger)({
6
+ level: process.env.AUTH0_LOG || 'info',
7
+ format: combine(colorize(), timestamp(), winston_1.format.printf((info) => `${info.timestamp} - ${info.level}: ${info.message}`)),
8
+ transports: [new winston_1.transports.Console()],
19
9
  exitOnError: false,
20
10
  });
21
- exports.default = log;
11
+ exports.default = logger;
@@ -0,0 +1,2 @@
1
+ import { Assets, Config } from './types';
2
+ export default function cleanAssets(assets: Assets, config: Config): Assets;
@@ -0,0 +1,7 @@
1
+ export declare const sessionDurationsToMinutes: ({ session_lifetime, idle_session_lifetime, }: {
2
+ session_lifetime?: number | undefined;
3
+ idle_session_lifetime?: number | undefined;
4
+ }) => {
5
+ session_lifetime_in_minutes?: number;
6
+ idle_session_lifetime_in_minutes?: number;
7
+ };
@@ -0,0 +1,2 @@
1
+ import { Auth0APIClient, BaseAuth0APIClient } from '../../types';
2
+ export default function pagedClient(client: BaseAuth0APIClient): Auth0APIClient;
@@ -0,0 +1,95 @@
1
+ import DefaultAPIHandler from './default';
2
+ import { Asset } from '../../../types';
3
+ export declare const schema: {
4
+ type: string;
5
+ items: {
6
+ type: string;
7
+ required: string[];
8
+ additionalProperties: boolean;
9
+ properties: {
10
+ code: {
11
+ type: string;
12
+ default: string;
13
+ };
14
+ runtime: {
15
+ type: string;
16
+ };
17
+ dependencies: {
18
+ type: string;
19
+ items: {
20
+ type: string;
21
+ additionalProperties: boolean;
22
+ properties: {
23
+ name: {
24
+ type: string;
25
+ };
26
+ version: {
27
+ type: string;
28
+ };
29
+ registry_url: {
30
+ type: string;
31
+ };
32
+ };
33
+ };
34
+ };
35
+ secrets: {
36
+ type: string;
37
+ items: {
38
+ type: string;
39
+ properties: {
40
+ name: {
41
+ type: string;
42
+ };
43
+ value: {
44
+ type: string;
45
+ };
46
+ updated_at: {
47
+ type: string;
48
+ format: string;
49
+ };
50
+ };
51
+ };
52
+ };
53
+ name: {
54
+ type: string;
55
+ default: string;
56
+ };
57
+ supported_triggers: {
58
+ type: string;
59
+ items: {
60
+ type: string;
61
+ properties: {
62
+ id: {
63
+ type: string;
64
+ default: string;
65
+ };
66
+ version: {
67
+ type: string;
68
+ };
69
+ url: {
70
+ type: string;
71
+ };
72
+ };
73
+ };
74
+ };
75
+ deployed: {
76
+ type: string;
77
+ };
78
+ status: {
79
+ type: string;
80
+ };
81
+ };
82
+ };
83
+ };
84
+ export default class ActionHandler extends DefaultAPIHandler {
85
+ existing: Asset[] | null;
86
+ constructor(options: any);
87
+ createAction(action: any): Promise<Asset>;
88
+ deleteAction(action: any): Promise<void | never[]>;
89
+ objString(action: any): string;
90
+ deployActions(actions: any): Promise<void>;
91
+ deployAction(action: any): Promise<void>;
92
+ actionChanges(action: any, found: any): Promise<Asset>;
93
+ getType(): Promise<Asset[] | null>;
94
+ processChanges(assets: any): Promise<void>;
95
+ }
@@ -44,7 +44,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
44
44
  exports.schema = void 0;
45
45
  const lodash_1 = __importDefault(require("lodash"));
46
46
  const default_1 = __importStar(require("./default"));
47
- const logger_1 = __importDefault(require("../../logger"));
47
+ const logger_1 = __importDefault(require("../../../logger"));
48
48
  const utils_1 = require("../../utils");
49
49
  const MAX_ACTION_DEPLOY_RETRY = 60;
50
50
  // With this schema, we can only validate property types but not valid properties on per type basis
@@ -0,0 +1,28 @@
1
+ import DefaultAPIHandler from './default';
2
+ import { Asset, Assets } from '../../../types';
3
+ export declare const schema: {
4
+ type: string;
5
+ properties: {
6
+ breachedPasswordDetection: {
7
+ type: string;
8
+ };
9
+ bruteForceProtection: {
10
+ type: string;
11
+ };
12
+ suspiciousIpThrottling: {
13
+ type: string;
14
+ };
15
+ };
16
+ additionalProperties: boolean;
17
+ };
18
+ export default class AttackProtectionHandler extends DefaultAPIHandler {
19
+ existing: {
20
+ breachedPasswordDetection: any;
21
+ bruteForceProtection: any;
22
+ suspiciousIpThrottling: any;
23
+ } | null;
24
+ constructor(config: DefaultAPIHandler);
25
+ objString(item: Asset): string;
26
+ getType(): Promise<Asset>;
27
+ processChanges(assets: Assets): Promise<void>;
28
+ }
@@ -0,0 +1,27 @@
1
+ import DefaultHandler from './default';
2
+ import { Asset } from '../../../types';
3
+ export declare const schema: {
4
+ type: string;
5
+ properties: {
6
+ templates: {
7
+ type: string;
8
+ items: {
9
+ type: string;
10
+ properties: {
11
+ template: {
12
+ type: string;
13
+ };
14
+ body: {
15
+ type: string;
16
+ };
17
+ };
18
+ };
19
+ };
20
+ };
21
+ };
22
+ export default class BrandingHandler extends DefaultHandler {
23
+ existing: Asset;
24
+ constructor(options: DefaultHandler);
25
+ getType(): Promise<Asset>;
26
+ processChanges(assets: any): Promise<void>;
27
+ }