auth0-deploy-cli 7.7.0 → 7.9.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 (137) hide show
  1. package/CHANGELOG.md +42 -1
  2. package/README.md +1 -1
  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/attackProtection.js +3 -3
  12. package/lib/context/directory/handlers/branding.d.ts +6 -0
  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/index.js +18 -0
  42. package/lib/context/yaml/handlers/actions.d.ts +6 -0
  43. package/lib/context/yaml/handlers/attackProtection.d.ts +6 -0
  44. package/lib/context/yaml/handlers/branding.d.ts +6 -0
  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/client.js +7 -7
  80. package/lib/tools/auth0/handlers/actions.d.ts +95 -0
  81. package/lib/tools/auth0/handlers/actions.js +1 -1
  82. package/lib/tools/auth0/handlers/attackProtection.d.ts +28 -0
  83. package/lib/tools/auth0/handlers/branding.d.ts +27 -0
  84. package/lib/tools/auth0/handlers/clientGrants.d.ts +32 -0
  85. package/lib/tools/auth0/handlers/clients.d.ts +23 -0
  86. package/lib/tools/auth0/handlers/connections.d.ts +54 -0
  87. package/lib/tools/auth0/handlers/databases.d.ts +36 -0
  88. package/lib/tools/auth0/handlers/databases.js +2 -2
  89. package/lib/tools/auth0/handlers/default.d.ts +54 -0
  90. package/lib/tools/auth0/handlers/default.js +29 -15
  91. package/lib/tools/auth0/handlers/emailProvider.d.ts +11 -0
  92. package/lib/tools/auth0/handlers/emailTemplates.d.ts +26 -0
  93. package/lib/tools/auth0/handlers/guardianFactorProviders.d.ts +25 -0
  94. package/lib/tools/auth0/handlers/guardianFactorTemplates.d.ts +21 -0
  95. package/lib/tools/auth0/handlers/guardianFactors.d.ts +21 -0
  96. package/lib/tools/auth0/handlers/guardianPhoneFactorMessageTypes.d.ts +21 -0
  97. package/lib/tools/auth0/handlers/guardianPhoneFactorSelectedProvider.d.ts +18 -0
  98. package/lib/tools/auth0/handlers/guardianPolicies.d.ts +23 -0
  99. package/lib/tools/auth0/handlers/hooks.d.ts +58 -0
  100. package/lib/tools/auth0/handlers/index.d.ts +134 -0
  101. package/lib/tools/auth0/handlers/index.js +2 -0
  102. package/lib/tools/auth0/handlers/logStreams.d.ts +40 -0
  103. package/lib/tools/auth0/handlers/logStreams.js +77 -0
  104. package/lib/tools/auth0/handlers/migrations.d.ts +15 -0
  105. package/lib/tools/auth0/handlers/migrations.js +1 -1
  106. package/lib/tools/auth0/handlers/organizations.d.ts +51 -0
  107. package/lib/tools/auth0/handlers/organizations.js +1 -1
  108. package/lib/tools/auth0/handlers/pages.d.ts +42 -0
  109. package/lib/tools/auth0/handlers/prompts.d.ts +11 -0
  110. package/lib/tools/auth0/handlers/resourceServers.d.ts +51 -0
  111. package/lib/tools/auth0/handlers/roles.d.ts +48 -0
  112. package/lib/tools/auth0/handlers/roles.js +1 -1
  113. package/lib/tools/auth0/handlers/rules.d.ts +55 -0
  114. package/lib/tools/auth0/handlers/rules.js +4 -4
  115. package/lib/tools/auth0/handlers/rulesConfigs.d.ts +25 -0
  116. package/lib/tools/auth0/handlers/tenant.d.ts +11 -0
  117. package/lib/tools/auth0/handlers/tenant.js +1 -1
  118. package/lib/tools/auth0/handlers/triggers.d.ts +35 -0
  119. package/lib/tools/auth0/handlers/triggers.js +1 -1
  120. package/lib/tools/auth0/index.d.ts +15 -0
  121. package/lib/tools/auth0/schema.d.ts +15 -0
  122. package/lib/tools/calculateChanges.d.ts +26 -0
  123. package/lib/tools/calculateChanges.js +1 -1
  124. package/lib/tools/constants.d.ts +72 -0
  125. package/lib/tools/constants.js +4 -1
  126. package/lib/tools/deploy.d.ts +3 -0
  127. package/lib/tools/deploy.js +2 -2
  128. package/lib/tools/index.d.ts +83 -0
  129. package/lib/tools/utils.d.ts +18 -0
  130. package/lib/tools/utils.js +67 -9
  131. package/lib/tools/validationError.d.ts +5 -0
  132. package/lib/types.d.ts +257 -0
  133. package/lib/utils.d.ts +67 -0
  134. package/lib/utils.js +8 -5
  135. package/package.json +11 -9
  136. package/tsconfig.json +2 -1
  137. package/lib/tools/logger.js +0 -21
@@ -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;
@@ -33,7 +33,7 @@ const API_FREQUENCY_PER_SECOND = 8;
33
33
  const MAX_PAGE_SIZE = 100;
34
34
  function getEntity(rsp) {
35
35
  const found = Object.values(rsp).filter((a) => Array.isArray(a));
36
- if (found.length === 1) {
36
+ if (Array.isArray(found) && found.length === 1) {
37
37
  return found[0];
38
38
  }
39
39
  throw new Error('There was an error trying to find the entity within paginate');
@@ -147,11 +147,11 @@ function pagedManager(client, manager) {
147
147
  }
148
148
  // Warp around the ManagementClient and detect when requesting specific pages to return all
149
149
  function pagedClient(client) {
150
- client.pool = new promise_pool_executor_1.PromisePoolExecutor({
151
- concurrencyLimit: API_CONCURRENCY,
152
- frequencyLimit: API_FREQUENCY_PER_SECOND,
153
- frequencyWindow: 1000, // 1 sec
154
- });
155
- return pagedManager(client, client);
150
+ const clientWithPooling = Object.assign(Object.assign({}, client), { pool: new promise_pool_executor_1.PromisePoolExecutor({
151
+ concurrencyLimit: API_CONCURRENCY,
152
+ frequencyLimit: API_FREQUENCY_PER_SECOND,
153
+ frequencyWindow: 1000, // 1 sec
154
+ }) });
155
+ return pagedManager(clientWithPooling, clientWithPooling);
156
156
  }
157
157
  exports.default = pagedClient;
@@ -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
+ }
@@ -0,0 +1,32 @@
1
+ import DefaultHandler from './default';
2
+ import { Asset, Assets } from '../../../types';
3
+ import DefaultAPIHandler from './default';
4
+ export declare const schema: {
5
+ type: string;
6
+ items: {
7
+ type: string;
8
+ properties: {
9
+ client_id: {
10
+ type: string;
11
+ };
12
+ audience: {
13
+ type: string;
14
+ };
15
+ scope: {
16
+ type: string;
17
+ items: {
18
+ type: string;
19
+ };
20
+ uniqueItems: boolean;
21
+ };
22
+ };
23
+ required: string[];
24
+ };
25
+ };
26
+ export default class ClientGrantsHandler extends DefaultHandler {
27
+ existing: Asset[] | null;
28
+ constructor(config: DefaultAPIHandler);
29
+ objString(item: any): string;
30
+ getType(): Promise<Asset>;
31
+ processChanges(assets: Assets): Promise<void>;
32
+ }
@@ -0,0 +1,23 @@
1
+ import { Asset, Assets } from '../../../types';
2
+ import DefaultAPIHandler from './default';
3
+ export declare const schema: {
4
+ type: string;
5
+ items: {
6
+ type: string;
7
+ properties: {
8
+ name: {
9
+ type: string;
10
+ minLength: number;
11
+ pattern: string;
12
+ };
13
+ };
14
+ required: string[];
15
+ };
16
+ };
17
+ export default class ClientHandler extends DefaultAPIHandler {
18
+ existing: Asset[] | null;
19
+ constructor(config: DefaultAPIHandler);
20
+ objString(item: any): string;
21
+ processChanges(assets: Assets): Promise<void>;
22
+ getType(): Promise<Asset[]>;
23
+ }
@@ -0,0 +1,54 @@
1
+ import DefaultAPIHandler from './default';
2
+ import { CalculatedChanges, Asset, Assets } from '../../../types';
3
+ import { ConfigFunction } from '../../../configFactory';
4
+ export declare const schema: {
5
+ type: string;
6
+ items: {
7
+ type: string;
8
+ properties: {
9
+ name: {
10
+ type: string;
11
+ };
12
+ strategy: {
13
+ type: string;
14
+ };
15
+ options: {
16
+ type: string;
17
+ };
18
+ enabled_clients: {
19
+ type: string;
20
+ items: {
21
+ type: string;
22
+ };
23
+ };
24
+ realms: {
25
+ type: string;
26
+ items: {
27
+ type: string;
28
+ };
29
+ };
30
+ metadata: {
31
+ type: string;
32
+ };
33
+ };
34
+ required: string[];
35
+ };
36
+ };
37
+ export declare const addExcludedConnectionPropertiesToChanges: ({ proposedChanges, existingConnections, config, }: {
38
+ proposedChanges: CalculatedChanges;
39
+ existingConnections: Asset[];
40
+ config: ConfigFunction;
41
+ }) => CalculatedChanges;
42
+ export default class ConnectionsHandler extends DefaultAPIHandler {
43
+ existing: Asset[] | null;
44
+ constructor(config: DefaultAPIHandler);
45
+ objString(connection: any): string;
46
+ getFormattedOptions(connection: any, clients: any): {
47
+ options: any;
48
+ } | {
49
+ options?: undefined;
50
+ };
51
+ getType(): Promise<Asset[] | null>;
52
+ calcChanges(assets: Assets): Promise<CalculatedChanges>;
53
+ processChanges(assets: Assets): Promise<void>;
54
+ }
@@ -0,0 +1,36 @@
1
+ import DefaultAPIHandler from './default';
2
+ import { CalculatedChanges, Assets } from '../../../types';
3
+ export declare const schema: {
4
+ type: string;
5
+ items: {
6
+ type: string;
7
+ properties: {
8
+ strategy: {
9
+ type: string;
10
+ enum: string[];
11
+ default: string;
12
+ };
13
+ name: {
14
+ type: string;
15
+ };
16
+ options: {
17
+ type: string;
18
+ properties: {
19
+ customScripts: {
20
+ type: string;
21
+ properties: {};
22
+ };
23
+ };
24
+ };
25
+ };
26
+ required: string[];
27
+ };
28
+ };
29
+ export default class DatabaseHandler extends DefaultAPIHandler {
30
+ constructor(config: DefaultAPIHandler);
31
+ objString(db: any): string;
32
+ getClientFN(fn: 'create' | 'delete' | 'getAll' | 'update'): Function;
33
+ getType(): Promise<import("../../../types").Asset>;
34
+ calcChanges(assets: Assets): Promise<CalculatedChanges>;
35
+ processChanges(assets: Assets): Promise<void>;
36
+ }
@@ -111,14 +111,14 @@ class DatabaseHandler extends default_1.default {
111
111
  };
112
112
  // Convert enabled_clients by name to the id
113
113
  const clients = yield this.client.clients.getAll({ paginate: true, include_totals: true });
114
- const existingDatabasesConecctions = yield this.client.connections.getAll({
114
+ const existingDatabasesConnections = yield this.client.connections.getAll({
115
115
  strategy: 'auth0',
116
116
  paginate: true,
117
117
  include_totals: true,
118
118
  });
119
119
  const formatted = databases.map((db) => {
120
120
  if (db.enabled_clients) {
121
- return Object.assign(Object.assign({}, db), { enabled_clients: (0, utils_1.getEnabledClients)(assets, db, existingDatabasesConecctions, clients) });
121
+ return Object.assign(Object.assign({}, db), { enabled_clients: (0, utils_1.getEnabledClients)(assets, db, existingDatabasesConnections, clients) });
122
122
  }
123
123
  return db;
124
124
  });