auth0-deploy-cli 7.7.1 → 7.8.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 (121) hide show
  1. package/CHANGELOG.md +14 -1
  2. package/lib/args.d.ts +29 -0
  3. package/lib/commands/export.d.ts +2 -0
  4. package/lib/commands/import.d.ts +2 -0
  5. package/lib/commands/index.d.ts +9 -0
  6. package/lib/configFactory.d.ts +7 -0
  7. package/lib/context/defaults.d.ts +1 -0
  8. package/lib/context/directory/handlers/actions.d.ts +6 -0
  9. package/lib/context/directory/handlers/attackProtection.d.ts +10 -0
  10. package/lib/context/directory/handlers/branding.d.ts +6 -0
  11. package/lib/context/directory/handlers/clientGrants.d.ts +6 -0
  12. package/lib/context/directory/handlers/clients.d.ts +6 -0
  13. package/lib/context/directory/handlers/connections.d.ts +6 -0
  14. package/lib/context/directory/handlers/databases.d.ts +6 -0
  15. package/lib/context/directory/handlers/emailProvider.d.ts +6 -0
  16. package/lib/context/directory/handlers/emailTemplates.d.ts +6 -0
  17. package/lib/context/directory/handlers/guardianFactorProviders.d.ts +6 -0
  18. package/lib/context/directory/handlers/guardianFactorTemplates.d.ts +6 -0
  19. package/lib/context/directory/handlers/guardianFactors.d.ts +6 -0
  20. package/lib/context/directory/handlers/guardianPhoneFactorMessageTypes.d.ts +6 -0
  21. package/lib/context/directory/handlers/guardianPhoneFactorSelectedProvider.d.ts +6 -0
  22. package/lib/context/directory/handlers/guardianPolicies.d.ts +6 -0
  23. package/lib/context/directory/handlers/hooks.d.ts +6 -0
  24. package/lib/context/directory/handlers/index.d.ts +12 -0
  25. package/lib/context/directory/handlers/migrations.d.ts +6 -0
  26. package/lib/context/directory/handlers/organizations.d.ts +6 -0
  27. package/lib/context/directory/handlers/pages.d.ts +6 -0
  28. package/lib/context/directory/handlers/resourceServers.d.ts +6 -0
  29. package/lib/context/directory/handlers/roles.d.ts +6 -0
  30. package/lib/context/directory/handlers/rules.d.ts +6 -0
  31. package/lib/context/directory/handlers/rulesConfigs.d.ts +6 -0
  32. package/lib/context/directory/handlers/tenant.d.ts +10 -0
  33. package/lib/context/directory/handlers/triggers.d.ts +6 -0
  34. package/lib/context/directory/index.d.ts +17 -0
  35. package/lib/context/index.d.ts +4 -0
  36. package/lib/context/yaml/handlers/actions.d.ts +6 -0
  37. package/lib/context/yaml/handlers/attackProtection.d.ts +6 -0
  38. package/lib/context/yaml/handlers/branding.d.ts +6 -0
  39. package/lib/context/yaml/handlers/clientGrants.d.ts +6 -0
  40. package/lib/context/yaml/handlers/clients.d.ts +6 -0
  41. package/lib/context/yaml/handlers/connections.d.ts +6 -0
  42. package/lib/context/yaml/handlers/databases.d.ts +6 -0
  43. package/lib/context/yaml/handlers/emailProvider.d.ts +6 -0
  44. package/lib/context/yaml/handlers/emailTemplates.d.ts +6 -0
  45. package/lib/context/yaml/handlers/guardianFactorProviders.d.ts +6 -0
  46. package/lib/context/yaml/handlers/guardianFactorTemplates.d.ts +6 -0
  47. package/lib/context/yaml/handlers/guardianFactors.d.ts +6 -0
  48. package/lib/context/yaml/handlers/guardianPhoneFactorMessageTypes.d.ts +6 -0
  49. package/lib/context/yaml/handlers/guardianPhoneFactorSelectedProvider.d.ts +6 -0
  50. package/lib/context/yaml/handlers/guardianPolicies.d.ts +6 -0
  51. package/lib/context/yaml/handlers/hooks.d.ts +6 -0
  52. package/lib/context/yaml/handlers/index.d.ts +12 -0
  53. package/lib/context/yaml/handlers/migrations.d.ts +6 -0
  54. package/lib/context/yaml/handlers/organizations.d.ts +6 -0
  55. package/lib/context/yaml/handlers/pages.d.ts +6 -0
  56. package/lib/context/yaml/handlers/resourceServers.d.ts +6 -0
  57. package/lib/context/yaml/handlers/roles.d.ts +6 -0
  58. package/lib/context/yaml/handlers/rules.d.ts +6 -0
  59. package/lib/context/yaml/handlers/rulesConfigs.d.ts +6 -0
  60. package/lib/context/yaml/handlers/tenant.d.ts +6 -0
  61. package/lib/context/yaml/handlers/triggers.d.ts +6 -0
  62. package/lib/context/yaml/index.d.ts +13 -0
  63. package/lib/index.d.ts +88 -0
  64. package/lib/index.js +5 -2
  65. package/lib/logger.d.ts +2 -0
  66. package/lib/logger.js +7 -17
  67. package/lib/readonly.d.ts +2 -0
  68. package/lib/sessionDurationsToMinutes.d.ts +7 -0
  69. package/lib/tools/auth0/client.d.ts +2 -0
  70. package/lib/tools/auth0/handlers/actions.d.ts +95 -0
  71. package/lib/tools/auth0/handlers/actions.js +1 -1
  72. package/lib/tools/auth0/handlers/attackProtection.d.ts +28 -0
  73. package/lib/tools/auth0/handlers/branding.d.ts +27 -0
  74. package/lib/tools/auth0/handlers/clientGrants.d.ts +32 -0
  75. package/lib/tools/auth0/handlers/clients.d.ts +23 -0
  76. package/lib/tools/auth0/handlers/connections.d.ts +54 -0
  77. package/lib/tools/auth0/handlers/databases.d.ts +36 -0
  78. package/lib/tools/auth0/handlers/default.d.ts +54 -0
  79. package/lib/tools/auth0/handlers/default.js +22 -8
  80. package/lib/tools/auth0/handlers/emailProvider.d.ts +11 -0
  81. package/lib/tools/auth0/handlers/emailTemplates.d.ts +26 -0
  82. package/lib/tools/auth0/handlers/guardianFactorProviders.d.ts +25 -0
  83. package/lib/tools/auth0/handlers/guardianFactorTemplates.d.ts +21 -0
  84. package/lib/tools/auth0/handlers/guardianFactors.d.ts +21 -0
  85. package/lib/tools/auth0/handlers/guardianPhoneFactorMessageTypes.d.ts +21 -0
  86. package/lib/tools/auth0/handlers/guardianPhoneFactorSelectedProvider.d.ts +18 -0
  87. package/lib/tools/auth0/handlers/guardianPolicies.d.ts +23 -0
  88. package/lib/tools/auth0/handlers/hooks.d.ts +58 -0
  89. package/lib/tools/auth0/handlers/index.d.ts +129 -0
  90. package/lib/tools/auth0/handlers/migrations.d.ts +15 -0
  91. package/lib/tools/auth0/handlers/migrations.js +1 -1
  92. package/lib/tools/auth0/handlers/organizations.d.ts +51 -0
  93. package/lib/tools/auth0/handlers/organizations.js +1 -1
  94. package/lib/tools/auth0/handlers/pages.d.ts +42 -0
  95. package/lib/tools/auth0/handlers/prompts.d.ts +11 -0
  96. package/lib/tools/auth0/handlers/resourceServers.d.ts +51 -0
  97. package/lib/tools/auth0/handlers/roles.d.ts +48 -0
  98. package/lib/tools/auth0/handlers/roles.js +1 -1
  99. package/lib/tools/auth0/handlers/rules.d.ts +55 -0
  100. package/lib/tools/auth0/handlers/rules.js +1 -1
  101. package/lib/tools/auth0/handlers/rulesConfigs.d.ts +25 -0
  102. package/lib/tools/auth0/handlers/tenant.d.ts +11 -0
  103. package/lib/tools/auth0/handlers/triggers.d.ts +35 -0
  104. package/lib/tools/auth0/handlers/triggers.js +1 -1
  105. package/lib/tools/auth0/index.d.ts +15 -0
  106. package/lib/tools/auth0/schema.d.ts +15 -0
  107. package/lib/tools/calculateChanges.d.ts +26 -0
  108. package/lib/tools/calculateChanges.js +1 -1
  109. package/lib/tools/constants.d.ts +71 -0
  110. package/lib/tools/constants.js +3 -1
  111. package/lib/tools/deploy.d.ts +3 -0
  112. package/lib/tools/deploy.js +2 -2
  113. package/lib/tools/index.d.ts +82 -0
  114. package/lib/tools/utils.d.ts +18 -0
  115. package/lib/tools/utils.js +35 -2
  116. package/lib/tools/validationError.d.ts +5 -0
  117. package/lib/types.d.ts +255 -0
  118. package/lib/utils.d.ts +66 -0
  119. package/package.json +7 -7
  120. package/tsconfig.json +2 -1
  121. package/lib/tools/logger.js +0 -21
package/lib/utils.d.ts ADDED
@@ -0,0 +1,66 @@
1
+ import { Auth0 } from './tools';
2
+ import { Asset, Assets, Config, KeywordMappings } from './types';
3
+ export declare function isDirectory(filePath: string): boolean;
4
+ export declare function isFile(filePath: string): boolean;
5
+ export declare function getFiles(folder: string, exts: string[]): string[];
6
+ export declare function loadJSON(file: string, mappings: KeywordMappings): any;
7
+ export declare function dumpJSON(file: string, mappings: {
8
+ [key: string]: any;
9
+ }): void;
10
+ export declare function existsMustBeDir(folder: string): boolean;
11
+ export declare function toConfigFn(data: Config): (arg0: keyof Config) => any;
12
+ export declare function stripIdentifiers(auth0: Auth0, assets: Assets): {
13
+ actions: Asset[];
14
+ attackProtection: Asset;
15
+ branding: Asset;
16
+ clients: Asset[];
17
+ clientGrants: Asset[];
18
+ connections: Asset[];
19
+ databases: Asset[];
20
+ emailProvider: Asset;
21
+ emailTemplates: Asset[];
22
+ guardianFactorProviders: Asset[];
23
+ guardianFactors: Asset[];
24
+ guardianFactorTemplates: Asset[];
25
+ guardianPhoneFactorMessageTypes: {
26
+ message_types: Asset[];
27
+ };
28
+ guardianPhoneFactorSelectedProvider: Asset;
29
+ guardianPolicies: {
30
+ policies: Asset[];
31
+ };
32
+ hooks: Asset[];
33
+ migrations: Asset[];
34
+ organizations: Asset[];
35
+ pages: Asset[];
36
+ resourceServers: Asset[];
37
+ roles: Asset[];
38
+ rules: Asset[];
39
+ rulesConfigs: Asset[];
40
+ tenant: Asset;
41
+ triggers: Asset[];
42
+ exclude?: {
43
+ [key: string]: string[];
44
+ } | undefined;
45
+ clientsOrig: Asset[];
46
+ };
47
+ export declare function sanitize(str: string): string;
48
+ declare type ImportantFields = {
49
+ name: string | null;
50
+ client_id: string | null;
51
+ audience: string | null;
52
+ template: string | null;
53
+ identifier: string | null;
54
+ strategy: string | null;
55
+ script: string | null;
56
+ stage: string | null;
57
+ id: string | null;
58
+ };
59
+ export declare function formatResults(item: any): Partial<ImportantFields>;
60
+ export declare function recordsSorter(a: Partial<ImportantFields>, b: Partial<ImportantFields>): number;
61
+ export declare function clearTenantFlags(tenant: Asset): void;
62
+ export declare function ensureProp(obj: Asset, props: string): void;
63
+ export declare function clearClientArrays(client: Asset): Asset;
64
+ export declare function convertClientIdToName(clientId: string, knownClients?: Asset[]): string;
65
+ export declare function mapClientID2NameSorted(enabledClients: string[], knownClients: Asset[]): string[];
66
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auth0-deploy-cli",
3
- "version": "7.7.1",
3
+ "version": "7.8.0",
4
4
  "description": "A command line tool for deploying updates to your Auth0 tenant",
5
5
  "main": "lib/index.js",
6
6
  "bin": {
@@ -41,28 +41,28 @@
41
41
  "js-yaml": "^4.1.0",
42
42
  "lodash": "^4.17.20",
43
43
  "mkdirp": "^0.5.1",
44
- "nconf": "^0.11.0",
44
+ "nconf": "^0.11.4",
45
45
  "promise-pool-executor": "^1.1.1",
46
46
  "sanitize-filename": "^1.6.1",
47
47
  "sinon": "^13.0.1",
48
48
  "sinon-chai": "^3.7.0",
49
- "winston": "^2.3.0",
49
+ "winston": "^3.3.0",
50
50
  "yargs": "^15.3.1"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/expect": "^24.3.0",
54
54
  "@types/mocha": "^9.1.0",
55
- "@typescript-eslint/parser": "^5.14.0",
56
- "chai": "^4.1.2",
55
+ "chai": "^4.3.6",
56
+ "@typescript-eslint/parser": "^5.16.0",
57
57
  "chai-as-promised": "^7.1.1",
58
58
  "cross-env": "^3.1.4",
59
59
  "eslint": "^7.28.0",
60
60
  "eslint-config-airbnb-base": "^14.2.1",
61
61
  "eslint-config-prettier": "^8.5.0",
62
- "eslint-plugin-import": "^2.20.2",
62
+ "eslint-plugin-import": "^2.25.4",
63
63
  "husky": "^7.0.4",
64
64
  "kacl": "^1.1.1",
65
- "mocha": "^9.1.3",
65
+ "mocha": "^9.2.2",
66
66
  "nyc": "^15.0.1",
67
67
  "prettier": "^2.6.1",
68
68
  "pretty-quick": "^3.1.3",
package/tsconfig.json CHANGED
@@ -10,7 +10,8 @@
10
10
  "forceConsistentCasingInFileNames": true,
11
11
  "strict": false,
12
12
  "strictNullChecks": true,
13
- "skipLibCheck": true
13
+ "skipLibCheck": true,
14
+ "declaration": true
14
15
  },
15
16
  "include": ["src/**/*"]
16
17
  }
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const winston_1 = __importDefault(require("winston"));
7
- //@ts-ignore because emitErrs is still supported
8
- winston_1.default.emitErrs = true;
9
- const logger = new winston_1.default.Logger({
10
- transports: [
11
- new winston_1.default.transports.Console({
12
- timestamp: true,
13
- level: 'info',
14
- handleExceptions: true,
15
- json: false,
16
- colorize: true,
17
- }),
18
- ],
19
- exitOnError: false,
20
- });
21
- exports.default = logger;