auth0-deploy-cli 7.9.0 → 7.11.1
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 +37 -1
- package/README.md +1 -1
- 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/logStreams.d.ts +2 -4
- package/lib/context/directory/handlers/logStreams.js +2 -2
- 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/logStreams.d.ts +2 -4
- package/lib/context/yaml/handlers/logStreams.js +4 -1
- 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/tools/auth0/handlers/actions.js +23 -7
- 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/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 +3 -3
- 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/utils.d.ts +9 -0
- package/lib/tools/utils.js +33 -1
- package/lib/types.d.ts +37 -32
- package/lib/utils.d.ts +34 -29
- package/lib/utils.js +1 -1
- package/package.json +9 -6
|
@@ -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: {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { YAMLHandler } from '.';
|
|
2
|
-
import { Asset } from '../../../types';
|
|
3
|
-
declare type ParsedLogStreams =
|
|
4
|
-
logStreams: Asset[] | null;
|
|
5
|
-
};
|
|
2
|
+
import { Asset, ParsedAsset } from '../../../types';
|
|
3
|
+
declare type ParsedLogStreams = ParsedAsset<'logStreams', Asset[]>;
|
|
6
4
|
declare const logStreamsHandler: YAMLHandler<ParsedLogStreams>;
|
|
7
5
|
export default logStreamsHandler;
|
|
@@ -11,8 +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
|
+
const { logStreams } = context.assets;
|
|
15
|
+
if (!logStreams)
|
|
16
|
+
return { logStreams: null };
|
|
14
17
|
return {
|
|
15
|
-
logStreams
|
|
18
|
+
logStreams,
|
|
16
19
|
};
|
|
17
20
|
});
|
|
18
21
|
}
|
|
@@ -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
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { YAMLHandler } from '.';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
2
|
+
import { Asset, ParsedAsset } from '../../../types';
|
|
3
|
+
declare type ParsedResourceServers = ParsedAsset<'resourceServers', Asset[]>;
|
|
5
4
|
declare const resourceServersHandler: YAMLHandler<ParsedResourceServers>;
|
|
6
5
|
export default resourceServersHandler;
|
|
@@ -9,24 +9,19 @@ 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 dumpAndParse(context) {
|
|
13
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
-
|
|
14
|
+
const { resourceServers } = context.assets;
|
|
15
|
+
if (!resourceServers) {
|
|
16
|
+
return { resourceServers: null };
|
|
17
|
+
}
|
|
15
18
|
return {
|
|
16
|
-
resourceServers
|
|
17
|
-
};
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
function dump(context) {
|
|
21
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
// nothing to do, set default if empty
|
|
23
|
-
return {
|
|
24
|
-
resourceServers: [...(context.assets.resourceServers || [])],
|
|
19
|
+
resourceServers,
|
|
25
20
|
};
|
|
26
21
|
});
|
|
27
22
|
}
|
|
28
23
|
const resourceServersHandler = {
|
|
29
|
-
parse,
|
|
30
|
-
dump,
|
|
24
|
+
parse: dumpAndParse,
|
|
25
|
+
dump: dumpAndParse,
|
|
31
26
|
};
|
|
32
27
|
exports.default = resourceServersHandler;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { YAMLHandler } from '.';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
2
|
+
import { Asset, ParsedAsset } from '../../../types';
|
|
3
|
+
declare type ParsedRoles = ParsedAsset<'roles', Asset[]>;
|
|
5
4
|
declare const rolesHandler: YAMLHandler<ParsedRoles>;
|
|
6
5
|
export default rolesHandler;
|
|
@@ -11,24 +11,26 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
function parse(context) {
|
|
13
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
-
|
|
14
|
+
const { roles } = context.assets;
|
|
15
|
+
if (!roles)
|
|
16
|
+
return { roles: null };
|
|
15
17
|
return {
|
|
16
|
-
roles
|
|
18
|
+
roles,
|
|
17
19
|
};
|
|
18
20
|
});
|
|
19
21
|
}
|
|
20
22
|
function dump(context) {
|
|
21
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
|
|
24
|
+
const { roles } = context.assets;
|
|
25
|
+
if (!roles)
|
|
26
|
+
return { roles: null };
|
|
23
27
|
return {
|
|
24
|
-
roles:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}),
|
|
31
|
-
],
|
|
28
|
+
roles: roles.map((role) => {
|
|
29
|
+
if (role.description === null) {
|
|
30
|
+
delete role.description;
|
|
31
|
+
}
|
|
32
|
+
return role;
|
|
33
|
+
}),
|
|
32
34
|
};
|
|
33
35
|
});
|
|
34
36
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { YAMLHandler } from '.';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} | {};
|
|
2
|
+
import { Asset, ParsedAsset } from '../../../types';
|
|
3
|
+
declare type ParsedRules = ParsedAsset<'rules', Asset[]>;
|
|
5
4
|
declare const rulesHandler: YAMLHandler<ParsedRules>;
|
|
6
5
|
export default rulesHandler;
|