auth0-deploy-cli 7.8.0 → 7.11.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/context/directory/handlers/actions.d.ts +2 -3
- package/lib/context/directory/handlers/actions.js +4 -4
- package/lib/context/directory/handlers/attackProtection.d.ts +6 -7
- package/lib/context/directory/handlers/attackProtection.js +3 -1
- package/lib/context/directory/handlers/branding.d.ts +2 -3
- package/lib/context/directory/handlers/branding.js +45 -21
- package/lib/context/directory/handlers/clientGrants.d.ts +2 -3
- package/lib/context/directory/handlers/clientGrants.js +3 -2
- package/lib/context/directory/handlers/clients.d.ts +2 -3
- package/lib/context/directory/handlers/clients.js +1 -1
- package/lib/context/directory/handlers/connections.d.ts +2 -3
- package/lib/context/directory/handlers/connections.js +3 -3
- package/lib/context/directory/handlers/databases.d.ts +2 -3
- package/lib/context/directory/handlers/databases.js +2 -2
- package/lib/context/directory/handlers/emailProvider.d.ts +2 -3
- package/lib/context/directory/handlers/emailProvider.js +12 -10
- package/lib/context/directory/handlers/emailTemplates.d.ts +2 -3
- package/lib/context/directory/handlers/emailTemplates.js +2 -2
- package/lib/context/directory/handlers/guardianFactorProviders.d.ts +2 -3
- package/lib/context/directory/handlers/guardianFactorProviders.js +1 -1
- package/lib/context/directory/handlers/guardianFactorTemplates.d.ts +2 -3
- package/lib/context/directory/handlers/guardianFactorTemplates.js +1 -1
- package/lib/context/directory/handlers/guardianFactors.d.ts +2 -3
- package/lib/context/directory/handlers/guardianFactors.js +1 -1
- package/lib/context/directory/handlers/guardianPhoneFactorMessageTypes.d.ts +2 -3
- package/lib/context/directory/handlers/guardianPhoneFactorMessageTypes.js +6 -6
- package/lib/context/directory/handlers/guardianPhoneFactorSelectedProvider.d.ts +2 -3
- package/lib/context/directory/handlers/guardianPhoneFactorSelectedProvider.js +6 -6
- package/lib/context/directory/handlers/guardianPolicies.d.ts +2 -3
- package/lib/context/directory/handlers/guardianPolicies.js +6 -6
- package/lib/context/directory/handlers/hooks.d.ts +2 -3
- package/lib/context/directory/handlers/hooks.js +3 -3
- package/lib/context/directory/handlers/index.d.ts +2 -2
- package/lib/context/directory/handlers/index.js +2 -0
- package/lib/context/directory/handlers/logStreams.d.ts +5 -0
- package/lib/context/directory/handlers/logStreams.js +49 -0
- package/lib/context/directory/handlers/migrations.d.ts +2 -3
- package/lib/context/directory/handlers/migrations.js +2 -2
- package/lib/context/directory/handlers/organizations.d.ts +2 -3
- package/lib/context/directory/handlers/organizations.js +1 -1
- package/lib/context/directory/handlers/pages.d.ts +2 -3
- package/lib/context/directory/handlers/pages.js +2 -2
- package/lib/context/directory/handlers/resourceServers.d.ts +2 -3
- package/lib/context/directory/handlers/resourceServers.js +1 -1
- package/lib/context/directory/handlers/roles.d.ts +2 -3
- package/lib/context/directory/handlers/roles.js +1 -1
- package/lib/context/directory/handlers/rules.d.ts +2 -3
- package/lib/context/directory/handlers/rules.js +2 -2
- package/lib/context/directory/handlers/rulesConfigs.d.ts +2 -3
- package/lib/context/directory/handlers/rulesConfigs.js +1 -1
- package/lib/context/directory/handlers/tenant.d.ts +7 -7
- package/lib/context/directory/handlers/tenant.js +11 -10
- package/lib/context/directory/handlers/triggers.d.ts +2 -3
- package/lib/context/directory/handlers/triggers.js +1 -1
- package/lib/context/yaml/handlers/actions.d.ts +2 -3
- package/lib/context/yaml/handlers/actions.js +6 -8
- package/lib/context/yaml/handlers/attackProtection.d.ts +6 -3
- package/lib/context/yaml/handlers/attackProtection.js +9 -1
- package/lib/context/yaml/handlers/branding.d.ts +9 -2
- package/lib/context/yaml/handlers/branding.js +33 -11
- package/lib/context/yaml/handlers/clientGrants.d.ts +2 -3
- package/lib/context/yaml/handlers/clientGrants.js +7 -6
- package/lib/context/yaml/handlers/clients.d.ts +2 -3
- package/lib/context/yaml/handlers/clients.js +6 -3
- package/lib/context/yaml/handlers/connections.d.ts +2 -3
- package/lib/context/yaml/handlers/connections.js +6 -9
- package/lib/context/yaml/handlers/databases.d.ts +3 -4
- package/lib/context/yaml/handlers/databases.js +7 -7
- package/lib/context/yaml/handlers/emailProvider.d.ts +2 -3
- package/lib/context/yaml/handlers/emailProvider.js +17 -10
- package/lib/context/yaml/handlers/emailTemplates.d.ts +2 -3
- package/lib/context/yaml/handlers/emailTemplates.js +16 -13
- package/lib/context/yaml/handlers/guardianFactorProviders.d.ts +2 -3
- package/lib/context/yaml/handlers/guardianFactorProviders.js +4 -2
- package/lib/context/yaml/handlers/guardianFactorTemplates.d.ts +2 -3
- package/lib/context/yaml/handlers/guardianFactorTemplates.js +4 -2
- package/lib/context/yaml/handlers/guardianFactors.d.ts +2 -3
- package/lib/context/yaml/handlers/guardianFactors.js +4 -2
- package/lib/context/yaml/handlers/guardianPhoneFactorMessageTypes.d.ts +2 -3
- package/lib/context/yaml/handlers/guardianPhoneFactorMessageTypes.js +4 -2
- package/lib/context/yaml/handlers/guardianPhoneFactorSelectedProvider.d.ts +2 -3
- package/lib/context/yaml/handlers/guardianPhoneFactorSelectedProvider.js +4 -2
- package/lib/context/yaml/handlers/guardianPolicies.d.ts +4 -3
- package/lib/context/yaml/handlers/guardianPolicies.js +4 -2
- package/lib/context/yaml/handlers/hooks.d.ts +2 -3
- package/lib/context/yaml/handlers/hooks.js +20 -19
- package/lib/context/yaml/handlers/index.d.ts +1 -1
- package/lib/context/yaml/handlers/index.js +2 -0
- package/lib/context/yaml/handlers/logStreams.d.ts +5 -0
- package/lib/context/yaml/handlers/logStreams.js +26 -0
- package/lib/context/yaml/handlers/migrations.d.ts +2 -3
- package/lib/context/yaml/handlers/migrations.js +5 -9
- package/lib/context/yaml/handlers/organizations.d.ts +2 -1
- package/lib/context/yaml/handlers/organizations.js +17 -15
- package/lib/context/yaml/handlers/pages.d.ts +2 -3
- package/lib/context/yaml/handlers/pages.js +20 -18
- package/lib/context/yaml/handlers/resourceServers.d.ts +2 -3
- package/lib/context/yaml/handlers/resourceServers.js +8 -13
- package/lib/context/yaml/handlers/roles.d.ts +2 -3
- package/lib/context/yaml/handlers/roles.js +13 -11
- package/lib/context/yaml/handlers/rules.d.ts +2 -3
- package/lib/context/yaml/handlers/rules.js +18 -17
- package/lib/context/yaml/handlers/rulesConfigs.d.ts +2 -3
- package/lib/context/yaml/handlers/rulesConfigs.js +9 -5
- package/lib/context/yaml/handlers/tenant.d.ts +2 -3
- package/lib/context/yaml/handlers/tenant.js +4 -3
- package/lib/context/yaml/handlers/triggers.d.ts +2 -3
- package/lib/context/yaml/handlers/triggers.js +2 -2
- package/lib/context/yaml/index.js +2 -1
- package/lib/index.d.ts +1 -0
- package/lib/tools/auth0/handlers/actions.js +3 -3
- package/lib/tools/auth0/handlers/branding.d.ts +2 -2
- package/lib/tools/auth0/handlers/clientGrants.js +1 -1
- package/lib/tools/auth0/handlers/connections.js +1 -1
- package/lib/tools/auth0/handlers/default.js +10 -2
- package/lib/tools/auth0/handlers/index.d.ts +5 -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/organizations.js +1 -1
- package/lib/tools/auth0/handlers/resourceServers.js +1 -1
- package/lib/tools/auth0/handlers/roles.js +1 -1
- package/lib/tools/auth0/handlers/rules.js +1 -1
- package/lib/tools/auth0/index.js +5 -2
- package/lib/tools/calculateChanges.d.ts +2 -2
- package/lib/tools/calculateChanges.js +2 -2
- package/lib/tools/constants.d.ts +1 -0
- package/lib/tools/constants.js +1 -0
- package/lib/tools/index.d.ts +1 -0
- package/lib/tools/utils.d.ts +9 -0
- package/lib/tools/utils.js +34 -2
- package/lib/types.d.ts +39 -29
- package/lib/utils.d.ts +34 -28
- package/lib/utils.js +1 -1
- package/package.json +11 -8
|
@@ -19,11 +19,10 @@ const logger_1 = __importDefault(require("../../../logger"));
|
|
|
19
19
|
const utils_1 = require("../../../utils");
|
|
20
20
|
function parse(context) {
|
|
21
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
// Load the HTML file for email connections
|
|
23
22
|
const { connections } = context.assets;
|
|
24
23
|
const connectionsFolder = path_1.default.join(context.basePath, tools_1.constants.CONNECTIONS_DIRECTORY);
|
|
25
|
-
if (!connections
|
|
26
|
-
return { connections:
|
|
24
|
+
if (!connections) {
|
|
25
|
+
return { connections: null };
|
|
27
26
|
}
|
|
28
27
|
return {
|
|
29
28
|
connections: [
|
|
@@ -53,15 +52,13 @@ const getFormattedOptions = (connection, clients) => {
|
|
|
53
52
|
};
|
|
54
53
|
function dump(context) {
|
|
55
54
|
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
-
const { connections } = context.assets;
|
|
57
|
-
// Nothing to do
|
|
55
|
+
const { connections, clients } = context.assets;
|
|
58
56
|
if (!connections)
|
|
59
|
-
return {};
|
|
60
|
-
// nothing to do, set default if empty
|
|
57
|
+
return { connections: null };
|
|
61
58
|
return {
|
|
62
59
|
connections: connections.map((connection) => {
|
|
63
|
-
const dumpedConnection = Object.assign(Object.assign(Object.assign({}, connection), getFormattedOptions(connection,
|
|
64
|
-
enabled_clients: (0, utils_1.mapClientID2NameSorted)(connection.enabled_clients,
|
|
60
|
+
const dumpedConnection = Object.assign(Object.assign(Object.assign({}, connection), getFormattedOptions(connection, clients)), (connection.enabled_clients && {
|
|
61
|
+
enabled_clients: (0, utils_1.mapClientID2NameSorted)(connection.enabled_clients, clients || []),
|
|
65
62
|
}));
|
|
66
63
|
if (dumpedConnection.strategy === 'email') {
|
|
67
64
|
(0, utils_1.ensureProp)(connection, 'options.email.body');
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { YAMLHandler } from '.';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare const databasesHandler: YAMLHandler<ParsedDatabases | {}>;
|
|
2
|
+
import { Asset, ParsedAsset } from '../../../types';
|
|
3
|
+
declare type ParsedDatabases = ParsedAsset<'databases', Asset[]>;
|
|
4
|
+
declare const databasesHandler: YAMLHandler<ParsedDatabases>;
|
|
6
5
|
export default databasesHandler;
|
|
@@ -19,11 +19,12 @@ const logger_1 = __importDefault(require("../../../logger"));
|
|
|
19
19
|
function parse(context) {
|
|
20
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21
21
|
// Load the script file for custom db
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
const { databases } = context.assets;
|
|
23
|
+
if (!databases)
|
|
24
|
+
return { databases: null };
|
|
24
25
|
return {
|
|
25
26
|
databases: [
|
|
26
|
-
...
|
|
27
|
+
...databases.map((database) => (Object.assign(Object.assign({}, database), { options: Object.assign(Object.assign({}, database.options), (database.options.customScripts && {
|
|
27
28
|
customScripts: Object.entries(database.options.customScripts).reduce((scripts, [name, script]) => (Object.assign(Object.assign({}, scripts), { [name]: context.loadFile(script) })), {}),
|
|
28
29
|
})) }))),
|
|
29
30
|
],
|
|
@@ -32,10 +33,9 @@ function parse(context) {
|
|
|
32
33
|
}
|
|
33
34
|
function dump(context) {
|
|
34
35
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
const { databases } = context.assets;
|
|
36
|
-
// Nothing to do
|
|
36
|
+
const { databases, clients } = context.assets;
|
|
37
37
|
if (!databases)
|
|
38
|
-
return {};
|
|
38
|
+
return { databases: null };
|
|
39
39
|
const sortCustomScripts = ([name1], [name2]) => {
|
|
40
40
|
if (name1 === name2)
|
|
41
41
|
return 0;
|
|
@@ -44,7 +44,7 @@ function dump(context) {
|
|
|
44
44
|
return {
|
|
45
45
|
databases: [
|
|
46
46
|
...databases.map((database) => (Object.assign(Object.assign(Object.assign({}, database), (database.enabled_clients && {
|
|
47
|
-
enabled_clients: (0, utils_1.mapClientID2NameSorted)(database.enabled_clients,
|
|
47
|
+
enabled_clients: (0, utils_1.mapClientID2NameSorted)(database.enabled_clients, clients || []),
|
|
48
48
|
})), { options: Object.assign(Object.assign({}, database.options), (database.options.customScripts && {
|
|
49
49
|
customScripts: Object.entries(database.options.customScripts)
|
|
50
50
|
.sort(sortCustomScripts)
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { YAMLHandler } from '.';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
2
|
+
import { Asset, ParsedAsset } from '../../../types';
|
|
3
|
+
declare type ParsedEmailProvider = ParsedAsset<'emailProvider', Asset>;
|
|
5
4
|
declare const emailProviderHandler: YAMLHandler<ParsedEmailProvider>;
|
|
6
5
|
export default emailProviderHandler;
|
|
@@ -12,23 +12,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
const defaults_1 = require("../../defaults");
|
|
13
13
|
function parse(context) {
|
|
14
14
|
return __awaiter(this, void 0, void 0, function* () {
|
|
15
|
-
|
|
15
|
+
const { emailProvider } = context.assets;
|
|
16
|
+
if (!emailProvider)
|
|
17
|
+
return { emailProvider: null };
|
|
16
18
|
return {
|
|
17
|
-
emailProvider
|
|
19
|
+
emailProvider,
|
|
18
20
|
};
|
|
19
21
|
});
|
|
20
22
|
}
|
|
21
23
|
function dump(context) {
|
|
22
|
-
var _a;
|
|
23
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
emailProvider =
|
|
29
|
-
|
|
25
|
+
if (!context.assets.emailProvider)
|
|
26
|
+
return { emailProvider: null };
|
|
27
|
+
const emailProvider = (() => {
|
|
28
|
+
var _a;
|
|
29
|
+
const { emailProvider } = context.assets;
|
|
30
|
+
const excludedDefaults = ((_a = context.assets.exclude) === null || _a === void 0 ? void 0 : _a.defaults) || [];
|
|
31
|
+
if (emailProvider && !excludedDefaults.includes('emailProvider')) {
|
|
32
|
+
// Add placeholder for credentials as they cannot be exported
|
|
33
|
+
return (0, defaults_1.emailProviderDefaults)(emailProvider);
|
|
34
|
+
}
|
|
35
|
+
return emailProvider;
|
|
36
|
+
})();
|
|
30
37
|
return {
|
|
31
|
-
emailProvider
|
|
38
|
+
emailProvider,
|
|
32
39
|
};
|
|
33
40
|
});
|
|
34
41
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { YAMLHandler } from '.';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
2
|
+
import { Asset, ParsedAsset } from '../../../types';
|
|
3
|
+
declare type ParsedEmailTemplates = ParsedAsset<'emailTemplates', Asset[]>;
|
|
5
4
|
declare const emailTemplatesHandler: YAMLHandler<ParsedEmailTemplates>;
|
|
6
5
|
export default emailTemplatesHandler;
|
|
@@ -18,7 +18,9 @@ const logger_1 = __importDefault(require("../../../logger"));
|
|
|
18
18
|
function parse(context) {
|
|
19
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
20
|
// Load the HTML file for each page
|
|
21
|
-
const emailTemplates = context.assets
|
|
21
|
+
const { emailTemplates } = context.assets;
|
|
22
|
+
if (!emailTemplates)
|
|
23
|
+
return { emailTemplates: null };
|
|
22
24
|
return {
|
|
23
25
|
emailTemplates: [
|
|
24
26
|
...emailTemplates.map((et) => (Object.assign(Object.assign({}, et), { body: context.loadFile(et.body) }))),
|
|
@@ -28,19 +30,20 @@ function parse(context) {
|
|
|
28
30
|
}
|
|
29
31
|
function dump(context) {
|
|
30
32
|
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
let emailTemplates =
|
|
32
|
-
if (emailTemplates
|
|
33
|
-
|
|
34
|
-
const templatesFolder = path_1.default.join(context.basePath, 'emailTemplates');
|
|
35
|
-
fs_extra_1.default.ensureDirSync(templatesFolder);
|
|
36
|
-
emailTemplates = emailTemplates.map((template) => {
|
|
37
|
-
// Dump template to file
|
|
38
|
-
const templateFile = path_1.default.join(templatesFolder, `${template.template}.html`);
|
|
39
|
-
logger_1.default.info(`Writing ${templateFile}`);
|
|
40
|
-
fs_extra_1.default.writeFileSync(templateFile, template.body);
|
|
41
|
-
return Object.assign(Object.assign({}, template), { body: `./emailTemplates/${template.template}.html` });
|
|
42
|
-
});
|
|
33
|
+
let emailTemplates = context.assets.emailTemplates;
|
|
34
|
+
if (!emailTemplates) {
|
|
35
|
+
return { emailTemplates: null };
|
|
43
36
|
}
|
|
37
|
+
// Create Templates folder
|
|
38
|
+
const templatesFolder = path_1.default.join(context.basePath, 'emailTemplates');
|
|
39
|
+
fs_extra_1.default.ensureDirSync(templatesFolder);
|
|
40
|
+
emailTemplates = emailTemplates.map((template) => {
|
|
41
|
+
// Dump template to file
|
|
42
|
+
const templateFile = path_1.default.join(templatesFolder, `${template.template}.html`);
|
|
43
|
+
logger_1.default.info(`Writing ${templateFile}`);
|
|
44
|
+
fs_extra_1.default.writeFileSync(templateFile, template.body);
|
|
45
|
+
return Object.assign(Object.assign({}, template), { body: `./emailTemplates/${template.template}.html` });
|
|
46
|
+
});
|
|
44
47
|
return { emailTemplates };
|
|
45
48
|
});
|
|
46
49
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { YAMLHandler } from '.';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
2
|
+
import { Asset, ParsedAsset } from '../../../types';
|
|
3
|
+
declare type ParsedGuardianFactorProviders = ParsedAsset<'guardianFactorProviders', Asset[]>;
|
|
5
4
|
declare const guardianFactorProvidersHandler: YAMLHandler<ParsedGuardianFactorProviders>;
|
|
6
5
|
export default guardianFactorProvidersHandler;
|
|
@@ -11,9 +11,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
function parseAndDump(context) {
|
|
13
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
-
|
|
14
|
+
const { guardianFactorProviders } = context.assets;
|
|
15
|
+
if (!guardianFactorProviders)
|
|
16
|
+
return { guardianFactorProviders: null };
|
|
15
17
|
return {
|
|
16
|
-
guardianFactorProviders
|
|
18
|
+
guardianFactorProviders,
|
|
17
19
|
};
|
|
18
20
|
});
|
|
19
21
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { YAMLHandler } from '.';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
2
|
+
import { Asset, ParsedAsset } from '../../../types';
|
|
3
|
+
declare type ParsedGuardianFactorTemplates = ParsedAsset<'guardianFactorTemplates', Asset[]>;
|
|
5
4
|
declare const guardianFactorTemplatesHandler: YAMLHandler<ParsedGuardianFactorTemplates>;
|
|
6
5
|
export default guardianFactorTemplatesHandler;
|
|
@@ -11,9 +11,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
function parseAndDump(context) {
|
|
13
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
-
|
|
14
|
+
const { guardianFactorTemplates } = context.assets;
|
|
15
|
+
if (!guardianFactorTemplates)
|
|
16
|
+
return { guardianFactorTemplates: null };
|
|
15
17
|
return {
|
|
16
|
-
guardianFactorTemplates
|
|
18
|
+
guardianFactorTemplates,
|
|
17
19
|
};
|
|
18
20
|
});
|
|
19
21
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { YAMLHandler } from '.';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
2
|
+
import { Asset, ParsedAsset } from '../../../types';
|
|
3
|
+
declare type ParsedGuardianFactors = ParsedAsset<'guardianFactors', Asset[]>;
|
|
5
4
|
declare const guardianFactorsHandler: YAMLHandler<ParsedGuardianFactors>;
|
|
6
5
|
export default guardianFactorsHandler;
|
|
@@ -11,9 +11,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
function parseAndDump(context) {
|
|
13
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
-
|
|
14
|
+
const { guardianFactors } = context.assets;
|
|
15
|
+
if (!guardianFactors)
|
|
16
|
+
return { guardianFactors: null };
|
|
15
17
|
return {
|
|
16
|
-
guardianFactors
|
|
18
|
+
guardianFactors,
|
|
17
19
|
};
|
|
18
20
|
});
|
|
19
21
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { YAMLHandler } from '.';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
2
|
+
import { Asset, ParsedAsset } from '../../../types';
|
|
3
|
+
declare type ParsedGuardianFactorMessageTypes = ParsedAsset<'guardianPhoneFactorMessageTypes', Asset>;
|
|
5
4
|
declare const guardianPhoneFactorMessageTypesHandler: YAMLHandler<ParsedGuardianFactorMessageTypes>;
|
|
6
5
|
export default guardianPhoneFactorMessageTypesHandler;
|
|
@@ -11,9 +11,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
function parseAndDump(context) {
|
|
13
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
-
|
|
14
|
+
const { guardianPhoneFactorMessageTypes } = context.assets;
|
|
15
|
+
if (!guardianPhoneFactorMessageTypes)
|
|
16
|
+
return { guardianPhoneFactorMessageTypes: null };
|
|
15
17
|
return {
|
|
16
|
-
guardianPhoneFactorMessageTypes
|
|
18
|
+
guardianPhoneFactorMessageTypes,
|
|
17
19
|
};
|
|
18
20
|
});
|
|
19
21
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { YAMLHandler } from '.';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
2
|
+
import { Asset, ParsedAsset } from '../../../types';
|
|
3
|
+
declare type ParsedGuardianPhoneFactorSelectedProvider = ParsedAsset<'guardianPhoneFactorSelectedProvider', Asset>;
|
|
5
4
|
declare const guardianPhoneFactorSelectedProviderHandler: YAMLHandler<ParsedGuardianPhoneFactorSelectedProvider>;
|
|
6
5
|
export default guardianPhoneFactorSelectedProviderHandler;
|
|
@@ -11,9 +11,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
function parseAndDump(context) {
|
|
13
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
-
|
|
14
|
+
const { guardianPhoneFactorSelectedProvider } = context.assets;
|
|
15
|
+
if (!guardianPhoneFactorSelectedProvider)
|
|
16
|
+
return { guardianPhoneFactorSelectedProvider: null };
|
|
15
17
|
return {
|
|
16
|
-
guardianPhoneFactorSelectedProvider
|
|
18
|
+
guardianPhoneFactorSelectedProvider,
|
|
17
19
|
};
|
|
18
20
|
});
|
|
19
21
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { YAMLHandler } from '.';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { Asset, ParsedAsset } from '../../../types';
|
|
3
|
+
declare type ParsedGuardianPolicies = ParsedAsset<'guardianPolicies', {
|
|
4
|
+
policies: Asset[];
|
|
5
|
+
}>;
|
|
5
6
|
declare const guardianPoliciesHandler: YAMLHandler<ParsedGuardianPolicies>;
|
|
6
7
|
export default guardianPoliciesHandler;
|
|
@@ -11,9 +11,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
function parseAndDump(context) {
|
|
13
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
-
|
|
14
|
+
const { guardianPolicies } = context.assets;
|
|
15
|
+
if (!guardianPolicies)
|
|
16
|
+
return { guardianPolicies: null };
|
|
15
17
|
return {
|
|
16
|
-
guardianPolicies
|
|
18
|
+
guardianPolicies,
|
|
17
19
|
};
|
|
18
20
|
});
|
|
19
21
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { YAMLHandler } from '.';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} | {};
|
|
2
|
+
import { Asset, ParsedAsset } from '../../../types';
|
|
3
|
+
declare type ParsedHooks = ParsedAsset<'hooks', Asset[]>;
|
|
5
4
|
declare const hooksHandler: YAMLHandler<ParsedHooks>;
|
|
6
5
|
export default hooksHandler;
|
|
@@ -19,12 +19,12 @@ const utils_1 = require("../../../utils");
|
|
|
19
19
|
const logger_1 = __importDefault(require("../../../logger"));
|
|
20
20
|
function parse(context) {
|
|
21
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
|
|
23
|
-
if (!
|
|
24
|
-
return {};
|
|
22
|
+
const { hooks } = context.assets;
|
|
23
|
+
if (!hooks)
|
|
24
|
+
return { hooks: null };
|
|
25
25
|
return {
|
|
26
26
|
hooks: [
|
|
27
|
-
...
|
|
27
|
+
...hooks.map((hook) => {
|
|
28
28
|
if (hook.script) {
|
|
29
29
|
//@ts-ignore TODO: understand why two arguments are passed when context.loadFile only accepts one
|
|
30
30
|
hook.script = context.loadFile(hook.script, tools_1.constants.HOOKS_DIRECTORY);
|
|
@@ -38,22 +38,23 @@ function parse(context) {
|
|
|
38
38
|
}
|
|
39
39
|
function dump(context) {
|
|
40
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
let hooks =
|
|
42
|
-
if (hooks
|
|
43
|
-
|
|
44
|
-
const hooksFolder = path_1.default.join(context.basePath, 'hooks');
|
|
45
|
-
fs_extra_1.default.ensureDirSync(hooksFolder);
|
|
46
|
-
hooks = hooks.map((hook) => {
|
|
47
|
-
// Dump hook code to file
|
|
48
|
-
// For cases when hook does not have `meta['hook-name']`
|
|
49
|
-
hook.name = hook.name || hook.id;
|
|
50
|
-
const codeName = (0, utils_1.sanitize)(`${hook.name}.js`);
|
|
51
|
-
const codeFile = path_1.default.join(hooksFolder, codeName);
|
|
52
|
-
logger_1.default.info(`Writing ${codeFile}`);
|
|
53
|
-
fs_extra_1.default.writeFileSync(codeFile, hook.script);
|
|
54
|
-
return Object.assign(Object.assign({}, hook), { script: `./hooks/${codeName}` });
|
|
55
|
-
});
|
|
41
|
+
let hooks = context.assets.hooks;
|
|
42
|
+
if (!hooks) {
|
|
43
|
+
return { hooks: null };
|
|
56
44
|
}
|
|
45
|
+
// Create hooks folder
|
|
46
|
+
const hooksFolder = path_1.default.join(context.basePath, 'hooks');
|
|
47
|
+
fs_extra_1.default.ensureDirSync(hooksFolder);
|
|
48
|
+
hooks = hooks.map((hook) => {
|
|
49
|
+
// Dump hook code to file
|
|
50
|
+
// For cases when hook does not have `meta['hook-name']`
|
|
51
|
+
hook.name = hook.name || hook.id;
|
|
52
|
+
const codeName = (0, utils_1.sanitize)(`${hook.name}.js`);
|
|
53
|
+
const codeFile = path_1.default.join(hooksFolder, codeName);
|
|
54
|
+
logger_1.default.info(`Writing ${codeFile}`);
|
|
55
|
+
fs_extra_1.default.writeFileSync(codeFile, hook.script);
|
|
56
|
+
return Object.assign(Object.assign({}, hook), { script: `./hooks/${codeName}` });
|
|
57
|
+
});
|
|
57
58
|
return { hooks };
|
|
58
59
|
});
|
|
59
60
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import YAMLContext from '..';
|
|
2
2
|
import { AssetTypes } from '../../../types';
|
|
3
3
|
export declare type YAMLHandler<T> = {
|
|
4
|
-
dump: (context: YAMLContext) => Promise<T
|
|
4
|
+
dump: (context: YAMLContext) => Promise<T>;
|
|
5
5
|
parse: (context: YAMLContext) => Promise<T>;
|
|
6
6
|
};
|
|
7
7
|
declare const 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,26 @@
|
|
|
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
|
+
const { logStreams } = context.assets;
|
|
15
|
+
if (!logStreams)
|
|
16
|
+
return { logStreams: null };
|
|
17
|
+
return {
|
|
18
|
+
logStreams,
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
const logStreamsHandler = {
|
|
23
|
+
parse: parseAndDump,
|
|
24
|
+
dump: parseAndDump,
|
|
25
|
+
};
|
|
26
|
+
exports.default = logStreamsHandler;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { YAMLHandler } from '.';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
2
|
+
import { Asset, ParsedAsset } from '../../../types';
|
|
3
|
+
declare type ParsedMigrations = ParsedAsset<'migrations', Asset[]>;
|
|
5
4
|
declare const migrationsHandler: YAMLHandler<ParsedMigrations>;
|
|
6
5
|
export default migrationsHandler;
|
|
@@ -9,20 +9,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
function
|
|
12
|
+
function parseAndDump(context) {
|
|
13
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
14
|
const { migrations } = context.assets;
|
|
15
|
+
if (!migrations)
|
|
16
|
+
return { migrations: null };
|
|
15
17
|
return { migrations };
|
|
16
18
|
});
|
|
17
19
|
}
|
|
18
|
-
function dump(context) {
|
|
19
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
const { migrations } = context.assets;
|
|
21
|
-
return { migrations: migrations || {} };
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
20
|
const migrationsHandler = {
|
|
25
|
-
parse,
|
|
26
|
-
dump,
|
|
21
|
+
parse: parseAndDump,
|
|
22
|
+
dump: parseAndDump,
|
|
27
23
|
};
|
|
28
24
|
exports.default = migrationsHandler;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { YAMLHandler } from '.';
|
|
2
|
+
import { Asset } from '../../../types';
|
|
2
3
|
declare type ParsedOrganizations = {
|
|
3
|
-
organizations:
|
|
4
|
+
organizations: Asset[] | null;
|
|
4
5
|
};
|
|
5
6
|
declare const organizationsHandler: YAMLHandler<ParsedOrganizations>;
|
|
6
7
|
export default organizationsHandler;
|
|
@@ -12,29 +12,31 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
function parse(context) {
|
|
13
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
14
|
const { organizations } = context.assets;
|
|
15
|
+
if (!organizations)
|
|
16
|
+
return { organizations: null };
|
|
15
17
|
return {
|
|
16
|
-
organizations
|
|
18
|
+
organizations,
|
|
17
19
|
};
|
|
18
20
|
});
|
|
19
21
|
}
|
|
20
22
|
function dump(context) {
|
|
21
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
24
|
const { organizations } = context.assets;
|
|
25
|
+
if (!organizations)
|
|
26
|
+
return { organizations: null };
|
|
23
27
|
return {
|
|
24
|
-
organizations:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}),
|
|
37
|
-
],
|
|
28
|
+
organizations: organizations.map((org) => {
|
|
29
|
+
if (org.connections.length > 0) {
|
|
30
|
+
org.connections = org.connections.map((c) => {
|
|
31
|
+
// connection is a computed field
|
|
32
|
+
const name = c.connection && c.connection.name;
|
|
33
|
+
delete c.connection_id;
|
|
34
|
+
delete c.connection;
|
|
35
|
+
return Object.assign({ name }, c);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return org;
|
|
39
|
+
}),
|
|
38
40
|
};
|
|
39
41
|
});
|
|
40
42
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { YAMLHandler } from '.';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} | {};
|
|
2
|
+
import { Asset, ParsedAsset } from '../../../types';
|
|
3
|
+
declare type ParsedPages = ParsedAsset<'pages', Asset[]>;
|
|
5
4
|
declare const pagesHandler: YAMLHandler<ParsedPages>;
|
|
6
5
|
export default pagesHandler;
|
|
@@ -18,33 +18,35 @@ const logger_1 = __importDefault(require("../../../logger"));
|
|
|
18
18
|
function parse(context) {
|
|
19
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
20
|
// Load the HTML file for each page
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const { pages } = context.assets;
|
|
22
|
+
if (!pages)
|
|
23
|
+
return { pages: null };
|
|
23
24
|
return {
|
|
24
25
|
pages: [
|
|
25
|
-
...
|
|
26
|
+
...pages.map((page) => (Object.assign(Object.assign({}, page), { html: page.html ? context.loadFile(page.html) : '' }))),
|
|
26
27
|
],
|
|
27
28
|
};
|
|
28
29
|
});
|
|
29
30
|
}
|
|
30
31
|
function dump(context) {
|
|
31
32
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
let pages =
|
|
33
|
-
if (pages
|
|
34
|
-
|
|
35
|
-
const pagesFolder = path_1.default.join(context.basePath, 'pages');
|
|
36
|
-
fs_extra_1.default.ensureDirSync(pagesFolder);
|
|
37
|
-
pages = pages.map((page) => {
|
|
38
|
-
if (page.name === 'error_page' && page.html === undefined) {
|
|
39
|
-
return page;
|
|
40
|
-
}
|
|
41
|
-
// Dump html to file
|
|
42
|
-
const htmlFile = path_1.default.join(pagesFolder, `${page.name}.html`);
|
|
43
|
-
logger_1.default.info(`Writing ${htmlFile}`);
|
|
44
|
-
fs_extra_1.default.writeFileSync(htmlFile, page.html);
|
|
45
|
-
return Object.assign(Object.assign({}, page), { html: `./pages/${page.name}.html` });
|
|
46
|
-
});
|
|
33
|
+
let pages = context.assets.pages;
|
|
34
|
+
if (!pages) {
|
|
35
|
+
return { pages: null };
|
|
47
36
|
}
|
|
37
|
+
// Create Pages folder
|
|
38
|
+
const pagesFolder = path_1.default.join(context.basePath, 'pages');
|
|
39
|
+
fs_extra_1.default.ensureDirSync(pagesFolder);
|
|
40
|
+
pages = pages.map((page) => {
|
|
41
|
+
if (page.name === 'error_page' && page.html === undefined) {
|
|
42
|
+
return page;
|
|
43
|
+
}
|
|
44
|
+
// Dump html to file
|
|
45
|
+
const htmlFile = path_1.default.join(pagesFolder, `${page.name}.html`);
|
|
46
|
+
logger_1.default.info(`Writing ${htmlFile}`);
|
|
47
|
+
fs_extra_1.default.writeFileSync(htmlFile, page.html);
|
|
48
|
+
return Object.assign(Object.assign({}, page), { html: `./pages/${page.name}.html` });
|
|
49
|
+
});
|
|
48
50
|
return { pages };
|
|
49
51
|
});
|
|
50
52
|
}
|