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
package/CHANGELOG.md CHANGED
@@ -7,6 +7,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [7.9.0] - 2022-04-19
11
+
12
+ ### Added
13
+
14
+ - Log streams support [#495]
15
+
16
+ ### Fixed
17
+
18
+ - `##` String keyword replacements now work when nested inside `@@` array replacements [#504]
19
+
20
+ ## [7.8.0] - 2022-04-14
21
+
22
+ ### Added
23
+
24
+ - Type declarations for more seamless integration into Typescript projects when used as a module [#485]
25
+
26
+ ### Security
27
+
28
+ - Updated Winston from 2.3.x to 3.3.0 which applies fix for theoretical prototype pollution vulnerability [#497]
29
+
30
+ ## [7.7.1] - 2022-04-07
31
+
32
+ ### Added
33
+
34
+ - Deprecation warnings for now deprecated asset-specific exclusion configuration properties: `AUTH0_EXCLUDED_RULES`, `AUTH0_EXCLUDED_CLIENTS`, `AUTH0_EXCLUDED_DATABASES`, `AUTH0_EXCLUDED_CONNECTIONS`, `AUTH0_EXCLUDED_RESOURCE_SERVERS`, `AUTH0_EXCLUDED_DEFAULTS`. See [Resource Exclusion Proposal](https://github.com/auth0/auth0-deploy-cli/issues/451#user-content-deprecated-exclusion-props) for details. [#481]
35
+
36
+ ### Fixed
37
+
38
+ - Rules configs failing to update after regression prevented asset-specific overrides of Node Auth0 SDK methods [#482]
39
+ - Attack protection not replacing keywords [#478]
40
+
10
41
  ## [7.7.0] - 2022-04-06
11
42
 
12
43
  ### Added
@@ -652,7 +683,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
652
683
  [#453]: https://github.com/auth0/auth0-deploy-cli/issues/453
653
684
  [#468]: https://github.com/auth0/auth0-deploy-cli/issues/468
654
685
  [#471]: https://github.com/auth0/auth0-deploy-cli/issues/471
655
- [unreleased]: https://github.com/auth0/auth0-deploy-cli/compare/v7.7.0...HEAD
686
+ [#478]: https://github.com/auth0/auth0-deploy-cli/issues/478
687
+ [#481]: https://github.com/auth0/auth0-deploy-cli/issues/481
688
+ [#482]: https://github.com/auth0/auth0-deploy-cli/issues/482
689
+ [#485]: https://github.com/auth0/auth0-deploy-cli/issues/485
690
+ [#495]: https://github.com/auth0/auth0-deploy-cli/issues/495
691
+ [#497]: https://github.com/auth0/auth0-deploy-cli/issues/497
692
+ [#504]: https://github.com/auth0/auth0-deploy-cli/issues/504
693
+ [unreleased]: https://github.com/auth0/auth0-deploy-cli/compare/v7.9.0...HEAD
694
+ [7.9.0]: https://github.com/auth0/auth0-deploy-cli/compare/v7.8.0...v7.9.0
695
+ [7.8.0]: https://github.com/auth0/auth0-deploy-cli/compare/v7.7.1...v7.8.0
696
+ [7.7.1]: https://github.com/auth0/auth0-deploy-cli/compare/v7.7.0...v7.7.1
656
697
  [7.7.0]: https://github.com/auth0/auth0-deploy-cli/compare/v7.6.0...v7.7.0
657
698
  [7.6.0]: https://github.com/auth0/auth0-deploy-cli/compare/v7.5.2...v7.6.0
658
699
  [7.5.2]: https://github.com/auth0/auth0-deploy-cli/compare/v7.5.1...v7.5.2
package/README.md CHANGED
@@ -16,7 +16,7 @@ Supported Auth0 Management API resources
16
16
  - [x] [Grants](https://auth0.com/docs/api/management/v2#!/Grants/get_grants)
17
17
  - [x] [Hooks](https://auth0.com/docs/api/management/v2#!/Hooks/get_hooks)
18
18
  - [x] [Hook Secrets](https://auth0.com/docs/api/management/v2/#!/Hooks/get_secrets)
19
- - [ ] [Log Streams](https://auth0.com/docs/api/management/v2#!/Log_Streams/get_log_streams)
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
22
  - [ ] [Prompts](https://auth0.com/docs/api/management/v2#!/Prompts/get_prompts)
package/lib/args.d.ts ADDED
@@ -0,0 +1,29 @@
1
+ import { Config } from './types';
2
+ declare type SharedParams = {
3
+ proxy_url?: string;
4
+ debug?: boolean;
5
+ config_file?: string;
6
+ env?: boolean;
7
+ secret?: string;
8
+ base_path?: string;
9
+ config?: Partial<Config>;
10
+ };
11
+ declare type ImportSpecificParams = {
12
+ input_file: string;
13
+ };
14
+ declare type ExportSpecificParams = {
15
+ format: 'yaml' | 'directory';
16
+ output_folder: string;
17
+ export_ids?: boolean;
18
+ };
19
+ export declare type ExportParams = ExportSpecificParams & SharedParams;
20
+ export declare type ImportParams = ImportSpecificParams & SharedParams;
21
+ export declare type CliParams = (ExportParams | ImportParams) & {
22
+ _: ['export' | 'import' | 'deploy' | 'dump'];
23
+ };
24
+ declare function getParams(): CliParams;
25
+ declare const _default: {
26
+ getParams: typeof getParams;
27
+ };
28
+ export default _default;
29
+ export { getParams };
@@ -0,0 +1,2 @@
1
+ import { ExportParams } from '../args';
2
+ export default function exportCMD(params: ExportParams): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import { ImportParams } from '../args';
2
+ export default function importCMD(params: ImportParams): Promise<void>;
@@ -0,0 +1,9 @@
1
+ import importCMD from './import';
2
+ import exportCMD from './export';
3
+ declare const _default: {
4
+ import: typeof importCMD;
5
+ export: typeof exportCMD;
6
+ deploy: typeof importCMD;
7
+ dump: typeof exportCMD;
8
+ };
9
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import { Config } from './types';
2
+ export declare type ConfigFunction = (arg0: keyof Config) => any;
3
+ export declare const configFactory: () => {
4
+ (key: keyof Config): any;
5
+ setProvider(providerFunction: ConfigFunction): void;
6
+ setValue(key: keyof Config, value: any): void;
7
+ };
@@ -0,0 +1 @@
1
+ export declare function emailProviderDefaults(emailProvider: any): any;
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedActions = {
3
+ actions: unknown[] | undefined;
4
+ };
5
+ declare const actionsHandler: DirectoryHandler<ParsedActions>;
6
+ export default actionsHandler;
@@ -0,0 +1,10 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedAttackProtection = {
3
+ attackProtection: {
4
+ breachedPasswordDetection: unknown;
5
+ bruteForceProtection: unknown;
6
+ suspiciousIpThrottling: unknown;
7
+ } | undefined;
8
+ };
9
+ declare const attackProtectionHandler: DirectoryHandler<ParsedAttackProtection>;
10
+ export default attackProtectionHandler;
@@ -32,9 +32,9 @@ function parse(context) {
32
32
  attackProtection: undefined,
33
33
  };
34
34
  }
35
- const breachedPasswordDetection = (0, utils_1.loadJSON)(files.breachedPasswordDetection);
36
- const bruteForceProtection = (0, utils_1.loadJSON)(files.bruteForceProtection);
37
- const suspiciousIpThrottling = (0, utils_1.loadJSON)(files.suspiciousIpThrottling);
35
+ const breachedPasswordDetection = (0, utils_1.loadJSON)(files.breachedPasswordDetection, context.mappings);
36
+ const bruteForceProtection = (0, utils_1.loadJSON)(files.bruteForceProtection, context.mappings);
37
+ const suspiciousIpThrottling = (0, utils_1.loadJSON)(files.suspiciousIpThrottling, context.mappings);
38
38
  return {
39
39
  attackProtection: {
40
40
  breachedPasswordDetection,
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedBranding = {
3
+ branding: unknown | undefined;
4
+ };
5
+ declare const brandingHandler: DirectoryHandler<ParsedBranding>;
6
+ export default brandingHandler;
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedClientGrants = {
3
+ clientGrants: unknown[] | undefined;
4
+ };
5
+ declare const clientGrantsHandler: DirectoryHandler<ParsedClientGrants>;
6
+ export default clientGrantsHandler;
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedClients = {
3
+ clients: unknown | undefined;
4
+ };
5
+ declare const clientsHandler: DirectoryHandler<ParsedClients>;
6
+ export default clientsHandler;
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedConnections = {
3
+ connections: unknown[] | undefined;
4
+ };
5
+ declare const connectionsHandler: DirectoryHandler<ParsedConnections>;
6
+ export default connectionsHandler;
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedDatabases = {
3
+ databases: unknown[] | undefined;
4
+ };
5
+ declare const databasesHandler: DirectoryHandler<ParsedDatabases>;
6
+ export default databasesHandler;
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedEmailProvider = {
3
+ emailProvider: unknown;
4
+ } | {};
5
+ declare const emailProviderHandler: DirectoryHandler<ParsedEmailProvider>;
6
+ export default emailProviderHandler;
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedEmailTemplates = {
3
+ emailTemplates: unknown | undefined;
4
+ };
5
+ declare const emailTemplatesHandler: DirectoryHandler<ParsedEmailTemplates>;
6
+ export default emailTemplatesHandler;
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedGuardianFactorProviders = {
3
+ guardianFactorProviders: unknown[] | undefined;
4
+ };
5
+ declare const guardianFactorProvidersHandler: DirectoryHandler<ParsedGuardianFactorProviders>;
6
+ export default guardianFactorProvidersHandler;
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedGuardianFactorTemplates = {
3
+ guardianFactorTemplates: unknown[] | undefined;
4
+ };
5
+ declare const guardianFactorTemplatesHandler: DirectoryHandler<ParsedGuardianFactorTemplates>;
6
+ export default guardianFactorTemplatesHandler;
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedGuardianFactors = {
3
+ guardianFactors: unknown[] | undefined;
4
+ };
5
+ declare const guardianFactorsHandler: DirectoryHandler<ParsedGuardianFactors>;
6
+ export default guardianFactorsHandler;
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedGuardianFactorMessageTypes = {
3
+ guardianPhoneFactorMessageTypes: unknown;
4
+ } | {};
5
+ declare const guardianFactorMessageTypesHandler: DirectoryHandler<ParsedGuardianFactorMessageTypes>;
6
+ export default guardianFactorMessageTypesHandler;
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedGuardianFactorSelectedProvider = {
3
+ guardianPhoneFactorSelectedProvider: unknown;
4
+ } | {};
5
+ declare const guardianFactorSelectedProviderHandler: DirectoryHandler<ParsedGuardianFactorSelectedProvider>;
6
+ export default guardianFactorSelectedProviderHandler;
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedGuardianPolicies = {
3
+ guardianPolicies: unknown[];
4
+ } | {};
5
+ declare const guardianPoliciesHandler: DirectoryHandler<ParsedGuardianPolicies>;
6
+ export default guardianPoliciesHandler;
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedHooks = {
3
+ hooks: unknown[] | undefined;
4
+ };
5
+ declare const hooksHandler: DirectoryHandler<ParsedHooks>;
6
+ export default hooksHandler;
@@ -0,0 +1,12 @@
1
+ import DirectoryContext from '..';
2
+ import { AssetTypes } from '../../../types';
3
+ export declare type DirectoryHandler<T> = {
4
+ dump: (context: DirectoryContext) => void;
5
+ parse: (context: DirectoryContext) => T;
6
+ };
7
+ declare const directoryHandlers: {
8
+ [key in AssetTypes]: DirectoryHandler<{
9
+ [key: string]: unknown;
10
+ }>;
11
+ };
12
+ export default directoryHandlers;
@@ -28,6 +28,7 @@ const organizations_1 = __importDefault(require("./organizations"));
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 directoryHandlers = {
32
33
  rules: rules_1.default,
33
34
  rulesConfigs: rulesConfigs_1.default,
@@ -54,5 +55,6 @@ const directoryHandlers = {
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 = directoryHandlers;
@@ -0,0 +1,7 @@
1
+ import { DirectoryHandler } from '.';
2
+ import { Asset } from '../../../types';
3
+ declare type ParsedLogStreams = {
4
+ logStreams: Asset[] | undefined;
5
+ };
6
+ declare const logStreamsHandler: DirectoryHandler<ParsedLogStreams>;
7
+ export default logStreamsHandler;
@@ -0,0 +1,49 @@
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 fs_extra_1 = __importDefault(require("fs-extra"));
16
+ const path_1 = __importDefault(require("path"));
17
+ const tools_1 = require("../../../tools");
18
+ const utils_1 = require("../../../utils");
19
+ function parse(context) {
20
+ const logStreamsDirectory = path_1.default.join(context.filePath, tools_1.constants.LOG_STREAMS_DIRECTORY);
21
+ if (!(0, utils_1.existsMustBeDir)(logStreamsDirectory))
22
+ return { logStreams: undefined }; // Skip
23
+ const foundFiles = (0, utils_1.getFiles)(logStreamsDirectory, ['.json']);
24
+ const logStreams = foundFiles
25
+ .map((f) => (0, utils_1.loadJSON)(f, context.mappings))
26
+ .filter((p) => Object.keys(p).length > 0); // Filter out empty rulesConfigs
27
+ return {
28
+ logStreams,
29
+ };
30
+ }
31
+ function dump(context) {
32
+ return __awaiter(this, void 0, void 0, function* () {
33
+ const logStreams = context.assets.logStreams || [];
34
+ if (!logStreams)
35
+ return; // Skip, nothing to dump
36
+ // Create Rules folder
37
+ const logStreamsDirectory = path_1.default.join(context.filePath, tools_1.constants.LOG_STREAMS_DIRECTORY);
38
+ fs_extra_1.default.ensureDirSync(logStreamsDirectory);
39
+ logStreams.forEach((logStream) => {
40
+ const ruleFile = path_1.default.join(logStreamsDirectory, `${(0, utils_1.sanitize)(logStream.name)}.json`);
41
+ (0, utils_1.dumpJSON)(ruleFile, logStream);
42
+ });
43
+ });
44
+ }
45
+ const logStreamsHandler = {
46
+ parse,
47
+ dump,
48
+ };
49
+ exports.default = logStreamsHandler;
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedMigrations = {
3
+ migrations: unknown[];
4
+ } | {};
5
+ declare const migrationsHandler: DirectoryHandler<ParsedMigrations>;
6
+ export default migrationsHandler;
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedOrganizations = {
3
+ organizations: unknown[] | undefined;
4
+ };
5
+ declare const organizationsHandler: DirectoryHandler<ParsedOrganizations>;
6
+ export default organizationsHandler;
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedPages = {
3
+ pages: unknown[] | undefined;
4
+ };
5
+ declare const pagesHandler: DirectoryHandler<ParsedPages>;
6
+ export default pagesHandler;
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedResourceServers = {
3
+ resourceServers: unknown[] | undefined;
4
+ };
5
+ declare const resourceServersHandler: DirectoryHandler<ParsedResourceServers>;
6
+ export default resourceServersHandler;
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedRoles = {
3
+ roles: unknown[] | undefined;
4
+ };
5
+ declare const rolesHandler: DirectoryHandler<ParsedRoles>;
6
+ export default rolesHandler;
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from './index';
2
+ declare type ParsedRules = {
3
+ rules: unknown[] | undefined;
4
+ };
5
+ declare const rulesHandler: DirectoryHandler<ParsedRules>;
6
+ export default rulesHandler;
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedRulesConfigs = {
3
+ rulesConfigs: unknown[] | undefined;
4
+ };
5
+ declare const rulesConfigsHandler: DirectoryHandler<ParsedRulesConfigs>;
6
+ export default rulesConfigsHandler;
@@ -0,0 +1,10 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedTenant = {
3
+ tenant: {
4
+ session_lifetime: number;
5
+ idle_session_lifetime: number;
6
+ [key: string]: unknown;
7
+ };
8
+ } | {};
9
+ declare const tenantHandler: DirectoryHandler<ParsedTenant>;
10
+ export default tenantHandler;
@@ -0,0 +1,6 @@
1
+ import { DirectoryHandler } from '.';
2
+ declare type ParsedTriggers = {
3
+ triggers: unknown[] | undefined;
4
+ };
5
+ declare const triggersHandler: DirectoryHandler<ParsedTriggers>;
6
+ export default triggersHandler;
@@ -0,0 +1,17 @@
1
+ import { Assets, Auth0APIClient, Config } from '../../types';
2
+ declare type KeywordMappings = {
3
+ [key: string]: (string | number)[] | string | number;
4
+ };
5
+ export default class DirectoryContext {
6
+ basePath: string;
7
+ filePath: string;
8
+ config: Config;
9
+ mappings: KeywordMappings;
10
+ mgmtClient: Auth0APIClient;
11
+ assets: Assets;
12
+ constructor(config: Config, mgmtClient: Auth0APIClient);
13
+ loadFile(f: string, folder: string): string;
14
+ load(): Promise<void>;
15
+ dump(): Promise<void>;
16
+ }
17
+ export {};
@@ -0,0 +1,4 @@
1
+ import YAMLContext from './yaml';
2
+ import DirectoryContext from './directory';
3
+ import { Config } from '../types';
4
+ export declare const setupContext: (config: Config) => Promise<DirectoryContext | YAMLContext>;
@@ -46,6 +46,24 @@ const setupContext = (config) => __awaiter(void 0, void 0, void 0, function* ()
46
46
  if (missingParams.length > 0) {
47
47
  throw new Error(`The following parameters were missing. Please add them to your config.json or as an environment variable. ${JSON.stringify(missingParams)}`);
48
48
  }
49
+ ((config) => {
50
+ // Detect and warn on usage of deprecated exclusion params. See: https://github.com/auth0/auth0-deploy-cli/issues/451#user-content-deprecated-exclusion-props
51
+ const deprecatedExclusionParams = [
52
+ 'AUTH0_EXCLUDED_RULES',
53
+ 'AUTH0_EXCLUDED_CLIENTS',
54
+ 'AUTH0_EXCLUDED_DATABASES',
55
+ 'AUTH0_EXCLUDED_CONNECTIONS',
56
+ 'AUTH0_EXCLUDED_RESOURCE_SERVERS',
57
+ 'AUTH0_EXCLUDED_DEFAULTS',
58
+ ];
59
+ const usedDeprecatedParams = deprecatedExclusionParams.filter((deprecatedParam) => {
60
+ const deprecatedConfigValue = config[deprecatedParam];
61
+ return !!deprecatedConfigValue && deprecatedConfigValue.length > 0;
62
+ });
63
+ if (usedDeprecatedParams.length > 0) {
64
+ logger_1.default.warn(`Usage of the ${usedDeprecatedParams.join(', ')} exclusion ${usedDeprecatedParams.length > 1 ? 'params are' : 'param is'} deprecated and may be removed from future major versions. See: https://github.com/auth0/auth0-deploy-cli/issues/451#user-content-deprecated-exclusion-props for details.`);
65
+ }
66
+ })(config);
49
67
  const accessToken = yield (() => __awaiter(void 0, void 0, void 0, function* () {
50
68
  if (!!config.AUTH0_ACCESS_TOKEN)
51
69
  return config.AUTH0_ACCESS_TOKEN;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedActions = {
3
+ actions: unknown[] | undefined;
4
+ };
5
+ declare const ActionsHandler: YAMLHandler<ParsedActions>;
6
+ export default ActionsHandler;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedAttackProtection = {
3
+ attackProtection: unknown;
4
+ };
5
+ declare const attackProtectionHandler: YAMLHandler<ParsedAttackProtection>;
6
+ export default attackProtectionHandler;
@@ -0,0 +1,6 @@
1
+ import { YAMLHandler } from '.';
2
+ declare type ParsedBranding = {
3
+ branding: unknown;
4
+ };
5
+ declare const brandingHandler: YAMLHandler<ParsedBranding>;
6
+ export default brandingHandler;
@@ -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;