auth0-deploy-cli 7.7.1 → 7.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -1
- package/README.md +2 -2
- package/lib/args.d.ts +29 -0
- package/lib/commands/export.d.ts +2 -0
- package/lib/commands/import.d.ts +2 -0
- package/lib/commands/index.d.ts +9 -0
- package/lib/configFactory.d.ts +7 -0
- package/lib/context/defaults.d.ts +1 -0
- package/lib/context/directory/handlers/actions.d.ts +6 -0
- package/lib/context/directory/handlers/attackProtection.d.ts +10 -0
- package/lib/context/directory/handlers/branding.d.ts +6 -0
- package/lib/context/directory/handlers/branding.js +55 -21
- package/lib/context/directory/handlers/clientGrants.d.ts +6 -0
- package/lib/context/directory/handlers/clients.d.ts +6 -0
- package/lib/context/directory/handlers/connections.d.ts +6 -0
- package/lib/context/directory/handlers/databases.d.ts +6 -0
- package/lib/context/directory/handlers/emailProvider.d.ts +6 -0
- package/lib/context/directory/handlers/emailTemplates.d.ts +6 -0
- package/lib/context/directory/handlers/guardianFactorProviders.d.ts +6 -0
- package/lib/context/directory/handlers/guardianFactorTemplates.d.ts +6 -0
- package/lib/context/directory/handlers/guardianFactors.d.ts +6 -0
- package/lib/context/directory/handlers/guardianPhoneFactorMessageTypes.d.ts +6 -0
- package/lib/context/directory/handlers/guardianPhoneFactorSelectedProvider.d.ts +6 -0
- package/lib/context/directory/handlers/guardianPolicies.d.ts +6 -0
- package/lib/context/directory/handlers/hooks.d.ts +6 -0
- package/lib/context/directory/handlers/index.d.ts +12 -0
- package/lib/context/directory/handlers/index.js +2 -0
- package/lib/context/directory/handlers/logStreams.d.ts +7 -0
- package/lib/context/directory/handlers/logStreams.js +49 -0
- package/lib/context/directory/handlers/migrations.d.ts +6 -0
- package/lib/context/directory/handlers/organizations.d.ts +6 -0
- package/lib/context/directory/handlers/pages.d.ts +6 -0
- package/lib/context/directory/handlers/resourceServers.d.ts +6 -0
- package/lib/context/directory/handlers/roles.d.ts +6 -0
- package/lib/context/directory/handlers/rules.d.ts +6 -0
- package/lib/context/directory/handlers/rulesConfigs.d.ts +6 -0
- package/lib/context/directory/handlers/tenant.d.ts +10 -0
- package/lib/context/directory/handlers/triggers.d.ts +6 -0
- package/lib/context/directory/index.d.ts +17 -0
- package/lib/context/index.d.ts +4 -0
- package/lib/context/yaml/handlers/actions.d.ts +6 -0
- package/lib/context/yaml/handlers/attackProtection.d.ts +6 -0
- package/lib/context/yaml/handlers/branding.d.ts +13 -0
- package/lib/context/yaml/handlers/branding.js +23 -6
- package/lib/context/yaml/handlers/clientGrants.d.ts +6 -0
- package/lib/context/yaml/handlers/clients.d.ts +6 -0
- package/lib/context/yaml/handlers/connections.d.ts +6 -0
- package/lib/context/yaml/handlers/databases.d.ts +6 -0
- package/lib/context/yaml/handlers/emailProvider.d.ts +6 -0
- package/lib/context/yaml/handlers/emailTemplates.d.ts +6 -0
- package/lib/context/yaml/handlers/guardianFactorProviders.d.ts +6 -0
- package/lib/context/yaml/handlers/guardianFactorTemplates.d.ts +6 -0
- package/lib/context/yaml/handlers/guardianFactors.d.ts +6 -0
- package/lib/context/yaml/handlers/guardianPhoneFactorMessageTypes.d.ts +6 -0
- package/lib/context/yaml/handlers/guardianPhoneFactorSelectedProvider.d.ts +6 -0
- package/lib/context/yaml/handlers/guardianPolicies.d.ts +6 -0
- package/lib/context/yaml/handlers/hooks.d.ts +6 -0
- package/lib/context/yaml/handlers/index.d.ts +12 -0
- package/lib/context/yaml/handlers/index.js +2 -0
- package/lib/context/yaml/handlers/logStreams.d.ts +7 -0
- package/lib/context/yaml/handlers/logStreams.js +23 -0
- package/lib/context/yaml/handlers/migrations.d.ts +6 -0
- package/lib/context/yaml/handlers/organizations.d.ts +6 -0
- package/lib/context/yaml/handlers/pages.d.ts +6 -0
- package/lib/context/yaml/handlers/resourceServers.d.ts +6 -0
- package/lib/context/yaml/handlers/roles.d.ts +6 -0
- package/lib/context/yaml/handlers/rules.d.ts +6 -0
- package/lib/context/yaml/handlers/rulesConfigs.d.ts +6 -0
- package/lib/context/yaml/handlers/tenant.d.ts +6 -0
- package/lib/context/yaml/handlers/triggers.d.ts +6 -0
- package/lib/context/yaml/index.d.ts +13 -0
- package/lib/index.d.ts +89 -0
- package/lib/index.js +5 -2
- package/lib/logger.d.ts +2 -0
- package/lib/logger.js +7 -17
- package/lib/readonly.d.ts +2 -0
- package/lib/sessionDurationsToMinutes.d.ts +7 -0
- package/lib/tools/auth0/client.d.ts +2 -0
- package/lib/tools/auth0/handlers/actions.d.ts +95 -0
- package/lib/tools/auth0/handlers/actions.js +1 -1
- package/lib/tools/auth0/handlers/attackProtection.d.ts +28 -0
- package/lib/tools/auth0/handlers/branding.d.ts +27 -0
- package/lib/tools/auth0/handlers/clientGrants.d.ts +32 -0
- package/lib/tools/auth0/handlers/clients.d.ts +23 -0
- package/lib/tools/auth0/handlers/connections.d.ts +54 -0
- package/lib/tools/auth0/handlers/databases.d.ts +36 -0
- package/lib/tools/auth0/handlers/default.d.ts +54 -0
- package/lib/tools/auth0/handlers/default.js +23 -8
- package/lib/tools/auth0/handlers/emailProvider.d.ts +11 -0
- package/lib/tools/auth0/handlers/emailTemplates.d.ts +26 -0
- package/lib/tools/auth0/handlers/guardianFactorProviders.d.ts +25 -0
- package/lib/tools/auth0/handlers/guardianFactorTemplates.d.ts +21 -0
- package/lib/tools/auth0/handlers/guardianFactors.d.ts +21 -0
- package/lib/tools/auth0/handlers/guardianPhoneFactorMessageTypes.d.ts +21 -0
- package/lib/tools/auth0/handlers/guardianPhoneFactorSelectedProvider.d.ts +18 -0
- package/lib/tools/auth0/handlers/guardianPolicies.d.ts +23 -0
- package/lib/tools/auth0/handlers/hooks.d.ts +58 -0
- package/lib/tools/auth0/handlers/index.d.ts +134 -0
- package/lib/tools/auth0/handlers/index.js +2 -0
- package/lib/tools/auth0/handlers/logStreams.d.ts +40 -0
- package/lib/tools/auth0/handlers/logStreams.js +77 -0
- package/lib/tools/auth0/handlers/migrations.d.ts +15 -0
- package/lib/tools/auth0/handlers/migrations.js +1 -1
- package/lib/tools/auth0/handlers/organizations.d.ts +51 -0
- package/lib/tools/auth0/handlers/organizations.js +2 -2
- package/lib/tools/auth0/handlers/pages.d.ts +42 -0
- package/lib/tools/auth0/handlers/prompts.d.ts +11 -0
- package/lib/tools/auth0/handlers/resourceServers.d.ts +51 -0
- package/lib/tools/auth0/handlers/resourceServers.js +1 -1
- package/lib/tools/auth0/handlers/roles.d.ts +48 -0
- package/lib/tools/auth0/handlers/roles.js +2 -2
- package/lib/tools/auth0/handlers/rules.d.ts +55 -0
- package/lib/tools/auth0/handlers/rules.js +2 -2
- package/lib/tools/auth0/handlers/rulesConfigs.d.ts +25 -0
- package/lib/tools/auth0/handlers/tenant.d.ts +11 -0
- package/lib/tools/auth0/handlers/triggers.d.ts +35 -0
- package/lib/tools/auth0/handlers/triggers.js +1 -1
- package/lib/tools/auth0/index.d.ts +15 -0
- package/lib/tools/auth0/schema.d.ts +15 -0
- package/lib/tools/calculateChanges.d.ts +26 -0
- package/lib/tools/calculateChanges.js +3 -3
- package/lib/tools/constants.d.ts +72 -0
- package/lib/tools/constants.js +4 -1
- package/lib/tools/deploy.d.ts +3 -0
- package/lib/tools/deploy.js +2 -2
- package/lib/tools/index.d.ts +83 -0
- package/lib/tools/utils.d.ts +18 -0
- package/lib/tools/utils.js +36 -3
- package/lib/tools/validationError.d.ts +5 -0
- package/lib/types.d.ts +257 -0
- package/lib/utils.d.ts +67 -0
- package/package.json +10 -10
- package/tsconfig.json +2 -1
- package/lib/tools/logger.js +0 -21
|
@@ -8,6 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
11
22
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
23
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
24
|
};
|
|
@@ -18,24 +29,30 @@ const tools_1 = require("../../../tools");
|
|
|
18
29
|
function parse(context) {
|
|
19
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
31
|
// Load the HTML file for each page
|
|
21
|
-
|
|
22
|
-
|
|
32
|
+
if (!context.assets.branding)
|
|
33
|
+
return {
|
|
34
|
+
branding: {
|
|
35
|
+
templates: [],
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
const _a = context.assets.branding, { templates } = _a, branding = __rest(_a, ["templates"]);
|
|
39
|
+
if (!branding && !branding['templates'])
|
|
23
40
|
return { branding };
|
|
24
|
-
const
|
|
25
|
-
const markupFile = path_1.default.join(templateDefinition.body);
|
|
41
|
+
const parsedTemplates = templates.map((templateDefinition) => {
|
|
42
|
+
const markupFile = path_1.default.join(context.basePath, templateDefinition.body);
|
|
26
43
|
return {
|
|
27
44
|
template: templateDefinition.template,
|
|
28
45
|
body: (0, tools_1.loadFileAndReplaceKeywords)(markupFile, context.mappings),
|
|
29
46
|
};
|
|
30
47
|
});
|
|
31
48
|
return {
|
|
32
|
-
branding: Object.assign(Object.assign({}, branding), { templates }),
|
|
49
|
+
branding: Object.assign(Object.assign({}, branding), { templates: parsedTemplates }),
|
|
33
50
|
};
|
|
34
51
|
});
|
|
35
52
|
}
|
|
36
53
|
function dump(context) {
|
|
37
54
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
const { branding } = context.assets
|
|
55
|
+
const { branding } = context.assets;
|
|
39
56
|
branding.templates = branding.templates || [];
|
|
40
57
|
// create templates folder
|
|
41
58
|
if (branding.templates.length) {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { YAMLHandler } from '.';
|
|
2
|
+
declare type 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,12 @@
|
|
|
1
|
+
import YAMLContext from '..';
|
|
2
|
+
import { AssetTypes } from '../../../types';
|
|
3
|
+
export declare type YAMLHandler<T> = {
|
|
4
|
+
dump: (context: YAMLContext) => Promise<T | {}>;
|
|
5
|
+
parse: (context: YAMLContext) => Promise<T>;
|
|
6
|
+
};
|
|
7
|
+
declare const yamlHandlers: {
|
|
8
|
+
[key in AssetTypes]: YAMLHandler<{
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
12
|
+
export default yamlHandlers;
|
|
@@ -28,6 +28,7 @@ const actions_1 = __importDefault(require("./actions"));
|
|
|
28
28
|
const triggers_1 = __importDefault(require("./triggers"));
|
|
29
29
|
const attackProtection_1 = __importDefault(require("./attackProtection"));
|
|
30
30
|
const branding_1 = __importDefault(require("./branding"));
|
|
31
|
+
const logStreams_1 = __importDefault(require("./logStreams"));
|
|
31
32
|
const yamlHandlers = {
|
|
32
33
|
rules: rules_1.default,
|
|
33
34
|
hooks: hooks_1.default,
|
|
@@ -54,5 +55,6 @@ const yamlHandlers = {
|
|
|
54
55
|
triggers: triggers_1.default,
|
|
55
56
|
attackProtection: attackProtection_1.default,
|
|
56
57
|
branding: branding_1.default,
|
|
58
|
+
logStreams: logStreams_1.default,
|
|
57
59
|
};
|
|
58
60
|
exports.default = yamlHandlers;
|
|
@@ -0,0 +1,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,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.
|
|
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
|
-
|
|
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;
|
package/lib/logger.d.ts
ADDED
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 =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 =
|
|
11
|
+
exports.default = logger;
|
|
@@ -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,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("
|
|
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
|
+
}
|