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
@@ -0,0 +1,15 @@
1
+ import DefaultHandler from './default';
2
+ import { Asset, Assets } from '../../../types';
3
+ export declare const schema: {
4
+ type: string;
5
+ additionalProperties: {
6
+ type: string;
7
+ };
8
+ };
9
+ export default class MigrationsHandler extends DefaultHandler {
10
+ constructor(options: DefaultHandler);
11
+ getType(): Promise<Asset[] | {}>;
12
+ processChanges(assets: Assets): Promise<void>;
13
+ logUnavailableMigrations(ignoreUnavailableMigrations: boolean, ignoredMigrations: string[]): void;
14
+ removeUnavailableMigrations(migrations: Asset[]): Promise<Asset[]>;
15
+ }
@@ -43,7 +43,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
43
43
  Object.defineProperty(exports, "__esModule", { value: true });
44
44
  exports.schema = void 0;
45
45
  const default_1 = __importStar(require("./default"));
46
- const logger_1 = __importDefault(require("../../logger"));
46
+ const logger_1 = __importDefault(require("../../../logger"));
47
47
  exports.schema = {
48
48
  type: 'object',
49
49
  additionalProperties: { type: 'boolean' },
@@ -0,0 +1,51 @@
1
+ import DefaultHandler from './default';
2
+ import { Asset, Assets, CalculatedChanges } from '../../../types';
3
+ export declare const schema: {
4
+ type: string;
5
+ items: {
6
+ type: string;
7
+ properties: {
8
+ name: {
9
+ type: string;
10
+ };
11
+ display_name: {
12
+ type: string;
13
+ };
14
+ branding: {
15
+ type: string;
16
+ };
17
+ metadata: {
18
+ type: string;
19
+ };
20
+ connections: {
21
+ type: string;
22
+ items: {
23
+ type: string;
24
+ properties: {
25
+ connection_id: {
26
+ type: string;
27
+ };
28
+ assign_membership_on_login: {
29
+ type: string;
30
+ };
31
+ };
32
+ };
33
+ };
34
+ };
35
+ required: string[];
36
+ };
37
+ };
38
+ export default class OrganizationsHandler extends DefaultHandler {
39
+ existing: Asset[];
40
+ constructor(config: DefaultHandler);
41
+ deleteOrganization(org: any): Promise<void>;
42
+ deleteOrganizations(data: any): Promise<void>;
43
+ createOrganization(org: any): Promise<Asset>;
44
+ createOrganizations(creates: CalculatedChanges['create']): Promise<void>;
45
+ updateOrganization(org: any, organizations: any): Promise<{
46
+ id: any;
47
+ }>;
48
+ updateOrganizations(updates: CalculatedChanges['update'], orgs: Asset[]): Promise<void>;
49
+ getType(): Promise<Asset[]>;
50
+ processChanges(assets: Assets): Promise<void>;
51
+ }
@@ -45,7 +45,7 @@ exports.schema = void 0;
45
45
  const lodash_1 = __importDefault(require("lodash"));
46
46
  const default_1 = __importStar(require("./default"));
47
47
  const calculateChanges_1 = require("../../calculateChanges");
48
- const logger_1 = __importDefault(require("../../logger"));
48
+ const logger_1 = __importDefault(require("../../../logger"));
49
49
  exports.schema = {
50
50
  type: 'array',
51
51
  items: {
@@ -0,0 +1,42 @@
1
+ import DefaultHandler from './default';
2
+ import { Asset, Assets } from '../../../types';
3
+ export declare const supportedPages: string[];
4
+ export declare const pageNameMap: {
5
+ guardian_multifactor: string;
6
+ password_reset: string;
7
+ error_page: string;
8
+ };
9
+ export declare const schema: {
10
+ type: string;
11
+ items: {
12
+ type: string;
13
+ properties: {
14
+ name: {
15
+ type: string;
16
+ enum: string[];
17
+ };
18
+ html: {
19
+ type: string;
20
+ default: string;
21
+ };
22
+ url: {
23
+ type: string;
24
+ };
25
+ show_log_link: {
26
+ type: string;
27
+ };
28
+ enabled: {
29
+ type: string;
30
+ };
31
+ };
32
+ required: string[];
33
+ };
34
+ };
35
+ export default class PagesHandler extends DefaultHandler {
36
+ constructor(options: DefaultHandler);
37
+ objString(page: any): string;
38
+ updateLoginPage(page: any): Promise<void>;
39
+ updatePages(pages: Asset[]): Promise<void>;
40
+ getType(): Promise<Asset[]>;
41
+ processChanges(assets: Assets): Promise<void>;
42
+ }
@@ -0,0 +1,11 @@
1
+ import DefaultHandler from './default';
2
+ import { Asset, Assets } from '../../../types';
3
+ export declare const schema: {
4
+ type: string;
5
+ };
6
+ export default class PromptsHandler extends DefaultHandler {
7
+ existing: Asset[];
8
+ constructor(options: DefaultHandler);
9
+ getType(): Promise<Asset[]>;
10
+ processChanges(assets: Assets): Promise<void>;
11
+ }
@@ -0,0 +1,51 @@
1
+ import DefaultHandler from './default';
2
+ import { Asset, Assets, CalculatedChanges } from '../../../types';
3
+ export declare const excludeSchema: {
4
+ type: string;
5
+ items: {
6
+ type: string;
7
+ };
8
+ };
9
+ export declare const schema: {
10
+ type: string;
11
+ items: {
12
+ type: string;
13
+ properties: {
14
+ name: {
15
+ type: string;
16
+ };
17
+ identifier: {
18
+ type: string;
19
+ };
20
+ scopes: {
21
+ type: string;
22
+ items: {
23
+ type: string;
24
+ properties: {
25
+ name: {
26
+ type: string;
27
+ };
28
+ description: {
29
+ type: string;
30
+ };
31
+ };
32
+ };
33
+ };
34
+ enforce_policies: {
35
+ type: string;
36
+ };
37
+ token_dialect: {
38
+ type: string;
39
+ };
40
+ };
41
+ required: string[];
42
+ };
43
+ };
44
+ export default class ResourceServersHandler extends DefaultHandler {
45
+ existing: Asset[];
46
+ constructor(options: DefaultHandler);
47
+ objString(resourceServer: any): string;
48
+ getType(): Promise<Asset[]>;
49
+ calcChanges(assets: Assets): Promise<CalculatedChanges>;
50
+ validate(assets: Assets): Promise<void>;
51
+ }
@@ -0,0 +1,48 @@
1
+ import DefaultHandler from './default';
2
+ import { Asset, Assets, CalculatedChanges } from '../../../types';
3
+ export declare const schema: {
4
+ type: string;
5
+ items: {
6
+ type: string;
7
+ properties: {
8
+ name: {
9
+ type: string;
10
+ };
11
+ id: {
12
+ type: string;
13
+ };
14
+ description: {
15
+ type: string;
16
+ };
17
+ permissions: {
18
+ type: string;
19
+ items: {
20
+ type: string;
21
+ properties: {
22
+ permission_name: {
23
+ type: string;
24
+ };
25
+ resource_server_identifier: {
26
+ type: string;
27
+ };
28
+ };
29
+ };
30
+ };
31
+ };
32
+ required: string[];
33
+ };
34
+ };
35
+ export default class RolesHandler extends DefaultHandler {
36
+ existing: Asset[];
37
+ constructor(config: DefaultHandler);
38
+ createRole(data: any): Promise<Asset>;
39
+ createRoles(creates: CalculatedChanges['create']): Promise<void>;
40
+ deleteRole(data: any): Promise<void>;
41
+ deleteRoles(dels: CalculatedChanges['del']): Promise<void>;
42
+ updateRole(data: any, roles: any): Promise<{
43
+ id: any;
44
+ }>;
45
+ updateRoles(updates: CalculatedChanges['update'], roles: any): Promise<void>;
46
+ getType(): Promise<Asset[]>;
47
+ processChanges(assets: Assets): Promise<void>;
48
+ }
@@ -44,7 +44,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
44
44
  exports.schema = void 0;
45
45
  const default_1 = __importStar(require("./default"));
46
46
  const calculateChanges_1 = require("../../calculateChanges");
47
- const logger_1 = __importDefault(require("../../logger"));
47
+ const logger_1 = __importDefault(require("../../../logger"));
48
48
  exports.schema = {
49
49
  type: 'array',
50
50
  items: {
@@ -0,0 +1,55 @@
1
+ import DefaultHandler from './default';
2
+ import { Asset, Assets, CalculatedChanges } from '../../../types';
3
+ export declare const excludeSchema: {
4
+ type: string;
5
+ items: {
6
+ type: string;
7
+ };
8
+ };
9
+ export declare const schema: {
10
+ type: string;
11
+ items: {
12
+ type: string;
13
+ default: never[];
14
+ properties: {
15
+ script: {
16
+ type: string;
17
+ description: string;
18
+ default: string;
19
+ };
20
+ name: {
21
+ type: string;
22
+ description: string;
23
+ pattern: string;
24
+ };
25
+ order: {
26
+ type: string[];
27
+ description: string;
28
+ default: null;
29
+ };
30
+ enabled: {
31
+ type: string;
32
+ description: string;
33
+ default: boolean;
34
+ };
35
+ stage: {
36
+ type: string;
37
+ description: string;
38
+ default: string;
39
+ enum: string[];
40
+ };
41
+ };
42
+ required: string[];
43
+ };
44
+ };
45
+ export default class RulesHandler extends DefaultHandler {
46
+ existing: Asset[];
47
+ constructor(options: DefaultHandler);
48
+ getType(): Promise<Asset[]>;
49
+ objString(rule: any): string;
50
+ calcChanges(assets: any, includeExcluded?: boolean): Promise<CalculatedChanges & {
51
+ reOrder: Asset[];
52
+ }>;
53
+ validate(assets: Assets): Promise<void>;
54
+ processChanges(assets: Assets): Promise<void>;
55
+ }
@@ -16,7 +16,7 @@ exports.schema = exports.excludeSchema = void 0;
16
16
  const validationError_1 = __importDefault(require("../../validationError"));
17
17
  const utils_1 = require("../../utils");
18
18
  const default_1 = __importDefault(require("./default"));
19
- const logger_1 = __importDefault(require("../../logger"));
19
+ const logger_1 = __importDefault(require("../../../logger"));
20
20
  const calculateChanges_1 = require("../../calculateChanges");
21
21
  exports.excludeSchema = {
22
22
  type: 'array',
@@ -141,7 +141,7 @@ class RulesHandler extends default_1.default {
141
141
  if (rulesSameOrder.length > 0) {
142
142
  const formatted = rulesSameOrder.map((dups) => dups.map((d) => `${d.name}`));
143
143
  throw new validationError_1.default(`There are multiple rules for the following stage-order combinations
144
- ${(0, utils_1.dumpJSON)(formatted)}.
144
+ ${(0, utils_1.convertJsonToString)(formatted)}.
145
145
  Only one rule must be defined for the same order number in a stage.`);
146
146
  }
147
147
  // Detect Rules that are changing stage as it's not allowed.
@@ -154,7 +154,7 @@ class RulesHandler extends default_1.default {
154
154
  .map((r) => r.name);
155
155
  if (stateChanged.length > 0) {
156
156
  throw new validationError_1.default(`The following rules changed stage which is not allowed:
157
- ${(0, utils_1.dumpJSON)(stateChanged)}.
157
+ ${(0, utils_1.convertJsonToString)(stateChanged)}.
158
158
  Rename the rules to recreate them and avoid this error.`);
159
159
  }
160
160
  yield _super.validate.call(this, assets);
@@ -184,7 +184,7 @@ class RulesHandler extends default_1.default {
184
184
  order: rule.order,
185
185
  id: rule.id,
186
186
  };
187
- logger_1.default.info(`Temporally re-order Rule ${(0, utils_1.dumpJSON)(updated)}`);
187
+ logger_1.default.info(`Temporally re-order Rule ${(0, utils_1.convertJsonToString)(updated)}`);
188
188
  }),
189
189
  })
190
190
  .promise();
@@ -0,0 +1,25 @@
1
+ import { Assets, Asset, CalculatedChanges } from '../../../types';
2
+ import DefaultHandler from './default';
3
+ export declare const schema: {
4
+ type: string;
5
+ items: {
6
+ type: string;
7
+ properties: {
8
+ key: {
9
+ type: string;
10
+ pattern: string;
11
+ };
12
+ value: {
13
+ type: string;
14
+ };
15
+ };
16
+ required: string[];
17
+ };
18
+ additionalProperties: boolean;
19
+ };
20
+ export default class RulesConfigsHandler extends DefaultHandler {
21
+ constructor(options: DefaultHandler);
22
+ getType(): Promise<Asset[]>;
23
+ objString(item: any): string;
24
+ calcChanges(assets: Assets): Promise<CalculatedChanges>;
25
+ }
@@ -0,0 +1,11 @@
1
+ import DefaultHandler from './default';
2
+ import { Asset, Assets } from '../../../types';
3
+ export declare const schema: {
4
+ type: string;
5
+ };
6
+ export default class TenantHandler extends DefaultHandler {
7
+ constructor(options: DefaultHandler);
8
+ getType(): Promise<Asset>;
9
+ validate(assets: Assets): Promise<void>;
10
+ processChanges(assets: Assets): Promise<void>;
11
+ }
@@ -76,7 +76,7 @@ class TenantHandler extends default_1.default {
76
76
  return;
77
77
  const pageKeys = Object.keys(tenant).filter((k) => blockPageKeys.includes(k));
78
78
  if (pageKeys.length > 0) {
79
- throw new validationError_1.default(`The following pages ${(0, utils_1.dumpJSON)(pageKeys)} were found in tenant settings. Pages should be set separately. Please refer to the documentation.`);
79
+ throw new validationError_1.default(`The following pages ${(0, utils_1.convertJsonToString)(pageKeys)} were found in tenant settings. Pages should be set separately. Please refer to the documentation.`);
80
80
  }
81
81
  });
82
82
  }
@@ -0,0 +1,35 @@
1
+ import DefaultHandler from './default';
2
+ import { Assets } from '../../../types';
3
+ export declare const schema: {
4
+ type: string;
5
+ items: {
6
+ type: string;
7
+ additionalProperties: boolean;
8
+ properties: {
9
+ trigger_id: {
10
+ type: string;
11
+ properties: {
12
+ action_name: {
13
+ type: string;
14
+ enum: string[];
15
+ };
16
+ display_name: {
17
+ type: string;
18
+ default: string;
19
+ };
20
+ };
21
+ };
22
+ };
23
+ };
24
+ };
25
+ export default class TriggersHandler extends DefaultHandler {
26
+ existing: {
27
+ [key: string]: {
28
+ action_name: string;
29
+ display_name: string;
30
+ };
31
+ };
32
+ constructor(options: DefaultHandler);
33
+ getType(): Promise<DefaultHandler['existing']>;
34
+ processChanges(assets: Assets): Promise<void>;
35
+ }
@@ -45,7 +45,7 @@ exports.schema = void 0;
45
45
  const lodash_1 = __importDefault(require("lodash"));
46
46
  const default_1 = __importStar(require("./default"));
47
47
  const constants_1 = __importDefault(require("../../constants"));
48
- const logger_1 = __importDefault(require("../../logger"));
48
+ const logger_1 = __importDefault(require("../../../logger"));
49
49
  exports.schema = {
50
50
  type: 'object',
51
51
  items: {
@@ -0,0 +1,15 @@
1
+ import { Assets, Auth0APIClient, BaseAuth0APIClient } from '../../types';
2
+ import APIHandler from './handlers/default';
3
+ import { ConfigFunction } from '../../configFactory';
4
+ export declare type Stage = 'load' | 'validate' | 'processChanges';
5
+ export default class Auth0 {
6
+ client: Auth0APIClient;
7
+ config: ConfigFunction;
8
+ assets: Assets;
9
+ handlers: APIHandler[];
10
+ constructor(client: BaseAuth0APIClient, assets: Assets, config: ConfigFunction);
11
+ runStage(stage: Stage): Promise<void>;
12
+ validate(): Promise<void>;
13
+ loadAll(): Promise<void>;
14
+ processChanges(): Promise<void>;
15
+ }
@@ -0,0 +1,15 @@
1
+ declare const _default: {
2
+ type: string;
3
+ $schema: string;
4
+ properties: {
5
+ exclude: {
6
+ type: string;
7
+ properties: {
8
+ [x: string]: Object;
9
+ };
10
+ default: {};
11
+ };
12
+ };
13
+ additionalProperties: boolean;
14
+ };
15
+ export default _default;
@@ -0,0 +1,26 @@
1
+ import APIHandler from '../tools/auth0/handlers/default';
2
+ import { Asset, CalculatedChanges } from '../types';
3
+ /**
4
+ * @template T
5
+ * @param {typeof import('./auth0/handlers/default').default} handler
6
+ * @param {T} desiredAssetState
7
+ * @param {T} currentAssetState
8
+ * @param {string[]} [objectFields=[]]
9
+ * @param {boolean} [allowDelete=false]
10
+ * @returns T
11
+ */
12
+ export declare function processChangedObjectFields({ handler, desiredAssetState, currentAssetState, allowDelete, }: {
13
+ handler: APIHandler;
14
+ desiredAssetState: Asset;
15
+ currentAssetState: Asset;
16
+ allowDelete?: boolean;
17
+ }): {
18
+ [x: string]: any;
19
+ };
20
+ export declare function calculateChanges({ handler, assets, existing, identifiers, allowDelete, }: {
21
+ handler: APIHandler;
22
+ assets: Asset[];
23
+ existing: Asset[];
24
+ identifiers: string[];
25
+ allowDelete: boolean;
26
+ }): CalculatedChanges;
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.calculateChanges = exports.processChangedObjectFields = void 0;
7
- const logger_1 = __importDefault(require("./logger"));
7
+ const logger_1 = __importDefault(require("../logger"));
8
8
  /**
9
9
  * @template T
10
10
  * @param {typeof import('./auth0/handlers/default').default} handler
@@ -0,0 +1,72 @@
1
+ declare const constants: {
2
+ CONCURRENT_CALLS: number;
3
+ RULES_DIRECTORY: string;
4
+ RULES_STAGES: string[];
5
+ DEFAULT_RULE_STAGE: string;
6
+ HOOKS_HIDDEN_SECRET_VALUE: string;
7
+ OBFUSCATED_SECRET_VALUE: string;
8
+ HOOKS_DIRECTORY: string;
9
+ ACTIONS_DIRECTORY: string;
10
+ TRIGGERS_DIRECTORY: string;
11
+ RULES_CONFIGS_DIRECTORY: string;
12
+ PAGES_DIRECTORY: string;
13
+ PAGE_LOGIN: string;
14
+ PAGE_GUARDIAN_MULTIFACTOR: string;
15
+ PAGE_PASSWORD_RESET: string;
16
+ PAGE_ERROR: string;
17
+ DATABASE_CONNECTIONS_DIRECTORY: string;
18
+ DATABASE_SCRIPTS_CHANGE_EMAIL: string;
19
+ DATABASE_SCRIPTS_GET_USER: string;
20
+ EMAIL_TEMPLATES_TYPES: string[];
21
+ ACTIONS_TRIGGERS: string[];
22
+ EMAIL_TEMPLATES_DIRECTORY: string;
23
+ EMAIL_VERIFY: string;
24
+ EMAIL_VERIFY_BY_CODE: string;
25
+ EMAIL_RESET: string;
26
+ EMAIL_WELCOME: string;
27
+ EMAIL_BLOCKED: string;
28
+ EMAIL_STOLEN_CREDENTIALS: string;
29
+ EMAIL_ENROLLMENT: string;
30
+ EMAIL_CHANGE_PASSWORD: string;
31
+ EMAIL_PASSWORD_RESET: string;
32
+ EMAIL_MFA_OOB_CODE: string;
33
+ EMAIL_USER_INVITATION: string;
34
+ GUARDIAN_DIRECTORY: string;
35
+ GUARDIAN_FACTORS_DIRECTORY: string;
36
+ GUARDIAN_PROVIDERS_DIRECTORY: string;
37
+ GUARDIAN_TEMPLATES_DIRECTORY: string;
38
+ UNIVERSAL_LOGIN_TEMPLATE: string;
39
+ RESOURCE_SERVERS_DIRECTORY: string;
40
+ RESOURCE_SERVERS_CLIENT_NAME: string;
41
+ RESOURCE_SERVERS_MANAGEMENT_API_NAME: string;
42
+ RESOURCE_SERVERS_ID_NAME: string;
43
+ CLIENTS_DIRECTORY: string;
44
+ CLIENTS_GRANTS_DIRECTORY: string;
45
+ BRANDING_DIRECTORY: string;
46
+ BRANDING_TEMPLATES_DIRECTORY: string;
47
+ BRANDING_TEMPLATES_YAML_DIRECTORY: string;
48
+ CLIENTS_CLIENT_NAME: string;
49
+ CLIENTS_CLIENT_ID_NAME: string;
50
+ CONNECTIONS_DIRECTORY: string;
51
+ CONNECTIONS_CLIENT_NAME: string;
52
+ CONNECTIONS_ID_NAME: string;
53
+ ROLES_DIRECTORY: string;
54
+ ATTACK_PROTECTION_DIRECTORY: string;
55
+ GUARDIAN_FACTORS: string[];
56
+ GUARDIAN_POLICIES: string[];
57
+ GUARDIAN_PHONE_PROVIDERS: string[];
58
+ GUARDIAN_PHONE_MESSAGE_TYPES: string[];
59
+ GUARDIAN_FACTOR_TEMPLATES: string[];
60
+ GUARDIAN_FACTOR_PROVIDERS: {
61
+ sms: string[];
62
+ 'push-notification': string[];
63
+ };
64
+ PAGE_NAMES: string[];
65
+ DATABASE_SCRIPTS: string[];
66
+ DATABASE_SCRIPTS_NO_IMPORT: string[];
67
+ DATABASE_SCRIPTS_IMPORT: string[];
68
+ EMAIL_TEMPLATES_NAMES: string[];
69
+ SUPPORTED_BRANDING_TEMPLATES: string[];
70
+ LOG_STREAMS_DIRECTORY: string;
71
+ };
72
+ export default constants;
@@ -19,12 +19,14 @@ const EMAIL_PASSWORD_RESET = 'password_reset';
19
19
  const EMAIL_MFA_OOB_CODE = 'mfa_oob_code';
20
20
  const EMAIL_USER_INVITATION = 'user_invitation';
21
21
  const UNIVERSAL_LOGIN_TEMPLATE = 'universal_login';
22
+ const OBFUSCATED_SECRET_VALUE = '_VALUE_NOT_SHOWN_';
22
23
  const constants = {
23
24
  CONCURRENT_CALLS: 5,
24
25
  RULES_DIRECTORY: 'rules',
25
26
  RULES_STAGES,
26
27
  DEFAULT_RULE_STAGE: RULES_STAGES[0],
27
- HOOKS_HIDDEN_SECRET_VALUE: '_VALUE_NOT_SHOWN_',
28
+ HOOKS_HIDDEN_SECRET_VALUE: OBFUSCATED_SECRET_VALUE,
29
+ OBFUSCATED_SECRET_VALUE,
28
30
  HOOKS_DIRECTORY: 'hooks',
29
31
  ACTIONS_DIRECTORY: 'actions',
30
32
  TRIGGERS_DIRECTORY: 'triggers',
@@ -162,5 +164,6 @@ const constants = {
162
164
  `${EMAIL_USER_INVITATION}.html`,
163
165
  ],
164
166
  SUPPORTED_BRANDING_TEMPLATES: [UNIVERSAL_LOGIN_TEMPLATE],
167
+ LOG_STREAMS_DIRECTORY: 'log-streams',
165
168
  };
166
169
  exports.default = constants;
@@ -0,0 +1,3 @@
1
+ import { ConfigFunction } from '../configFactory';
2
+ import { Assets, Auth0APIClient } from '../types';
3
+ export default function deploy(assets: Assets, client: Auth0APIClient, config: ConfigFunction): Promise<{}>;
@@ -13,11 +13,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const auth0_1 = __importDefault(require("./auth0"));
16
- const logger_1 = __importDefault(require("./logger"));
16
+ const logger_1 = __importDefault(require("../logger"));
17
17
  function deploy(assets, client, config) {
18
18
  return __awaiter(this, void 0, void 0, function* () {
19
19
  // Setup log level
20
- logger_1.default.transports.console.level = process.env.AUTH0_DEBUG === 'true' ? 'debug' : 'info';
20
+ logger_1.default.level = process.env.AUTH0_DEBUG === 'true' ? 'debug' : 'info';
21
21
  logger_1.default.info('Getting access token for ' + config('AUTH0_CLIENT_ID') + '/' + config('AUTH0_DOMAIN'));
22
22
  const auth0 = new auth0_1.default(client, assets, config);
23
23
  // Validate Assets