auth0-deploy-cli 7.4.0 → 7.5.2
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/.circleci/config.yml +15 -0
- package/.eslintrc +66 -17
- package/.github/CODEOWNERS +1 -0
- package/.husky/pre-commit +2 -0
- package/CHANGELOG.md +27 -2
- package/lib/args.js +94 -81
- package/lib/commands/export.js +54 -78
- package/lib/commands/import.js +46 -70
- package/lib/commands/index.js +11 -20
- package/lib/configFactory.js +19 -27
- package/lib/context/defaults.js +18 -41
- package/lib/context/directory/handlers/actions.js +77 -107
- package/lib/context/directory/handlers/attackProtection.js +59 -0
- package/lib/context/directory/handlers/clientGrants.js +45 -54
- package/lib/context/directory/handlers/clients.js +60 -79
- package/lib/context/directory/handlers/connections.js +65 -89
- package/lib/context/directory/handlers/databases.js +91 -123
- package/lib/context/directory/handlers/emailProvider.js +46 -57
- package/lib/context/directory/handlers/emailTemplates.js +67 -80
- package/lib/context/directory/handlers/guardianFactorProviders.js +41 -49
- package/lib/context/directory/handlers/guardianFactorTemplates.js +41 -49
- package/lib/context/directory/handlers/guardianFactors.js +41 -49
- package/lib/context/directory/handlers/guardianPhoneFactorMessageTypes.js +40 -50
- package/lib/context/directory/handlers/guardianPhoneFactorSelectedProvider.js +40 -50
- package/lib/context/directory/handlers/guardianPolicies.js +40 -50
- package/lib/context/directory/handlers/hooks.js +55 -70
- package/lib/context/directory/handlers/index.js +53 -123
- package/lib/context/directory/handlers/migrations.js +36 -41
- package/lib/context/directory/handlers/organizations.js +54 -69
- package/lib/context/directory/handlers/pages.js +72 -86
- package/lib/context/directory/handlers/resourceServers.js +41 -49
- package/lib/context/directory/handlers/roles.js +49 -62
- package/lib/context/directory/handlers/rules.js +52 -68
- package/lib/context/directory/handlers/rulesConfigs.js +33 -32
- package/lib/context/directory/handlers/tenant.js +52 -47
- package/lib/context/directory/handlers/triggers.js +39 -54
- package/lib/context/directory/index.js +113 -101
- package/lib/context/index.js +96 -105
- package/lib/context/yaml/handlers/actions.js +71 -88
- package/lib/context/yaml/handlers/attackProtection.js +29 -0
- package/lib/context/yaml/handlers/clientGrants.js +36 -29
- package/lib/context/yaml/handlers/clients.js +61 -76
- package/lib/context/yaml/handlers/connections.js +76 -103
- package/lib/context/yaml/handlers/databases.js +64 -79
- package/lib/context/yaml/handlers/emailProvider.js +33 -30
- package/lib/context/yaml/handlers/emailTemplates.js +45 -54
- package/lib/context/yaml/handlers/guardianFactorProviders.js +27 -18
- package/lib/context/yaml/handlers/guardianFactorTemplates.js +27 -18
- package/lib/context/yaml/handlers/guardianFactors.js +27 -18
- package/lib/context/yaml/handlers/guardianPhoneFactorMessageTypes.js +27 -20
- package/lib/context/yaml/handlers/guardianPhoneFactorSelectedProvider.js +27 -20
- package/lib/context/yaml/handlers/guardianPolicies.js +27 -20
- package/lib/context/yaml/handlers/hooks.js +57 -67
- package/lib/context/yaml/handlers/index.js +53 -123
- package/lib/context/yaml/handlers/migrations.js +23 -24
- package/lib/context/yaml/handlers/organizations.js +40 -38
- package/lib/context/yaml/handlers/pages.js +49 -58
- package/lib/context/yaml/handlers/resourceServers.js +27 -18
- package/lib/context/yaml/handlers/roles.js +34 -24
- package/lib/context/yaml/handlers/rules.js +48 -58
- package/lib/context/yaml/handlers/rulesConfigs.js +27 -18
- package/lib/context/yaml/handlers/tenant.js +44 -30
- package/lib/context/yaml/handlers/triggers.js +32 -23
- package/lib/context/yaml/index.js +127 -142
- package/lib/index.js +73 -79
- package/lib/logger.js +18 -22
- package/lib/readonly.js +74 -66
- package/lib/tools/ValidationError.js +8 -13
- package/lib/tools/auth0/client.js +143 -133
- package/lib/tools/auth0/handlers/actions.js +231 -243
- package/lib/tools/auth0/handlers/attackProtection.js +86 -0
- package/lib/tools/auth0/handlers/branding.js +47 -46
- package/lib/tools/auth0/handlers/clientGrants.js +118 -116
- package/lib/tools/auth0/handlers/clients.js +72 -90
- package/lib/tools/auth0/handlers/connections.js +150 -118
- package/lib/tools/auth0/handlers/databases.js +127 -124
- package/lib/tools/auth0/handlers/default.js +186 -189
- package/lib/tools/auth0/handlers/emailProvider.js +67 -78
- package/lib/tools/auth0/handlers/emailTemplates.js +116 -92
- package/lib/tools/auth0/handlers/guardianFactorProviders.js +66 -81
- package/lib/tools/auth0/handlers/guardianFactorTemplates.js +60 -71
- package/lib/tools/auth0/handlers/guardianFactors.js +56 -63
- package/lib/tools/auth0/handlers/guardianPhoneFactorMessageTypes.js +80 -79
- package/lib/tools/auth0/handlers/guardianPhoneFactorSelectedProvider.js +77 -76
- package/lib/tools/auth0/handlers/guardianPolicies.js +59 -62
- package/lib/tools/auth0/handlers/hooks.js +201 -227
- package/lib/tools/auth0/handlers/index.js +53 -111
- package/lib/tools/auth0/handlers/migrations.js +99 -79
- package/lib/tools/auth0/handlers/organizations.js +225 -247
- package/lib/tools/auth0/handlers/pages.js +116 -154
- package/lib/tools/auth0/handlers/prompts.js +47 -46
- package/lib/tools/auth0/handlers/resourceServers.js +88 -112
- package/lib/tools/auth0/handlers/roles.js +203 -220
- package/lib/tools/auth0/handlers/rules.js +168 -189
- package/lib/tools/auth0/handlers/rulesConfigs.js +54 -63
- package/lib/tools/auth0/handlers/tenant.js +88 -64
- package/lib/tools/auth0/handlers/triggers.js +126 -126
- package/lib/tools/auth0/index.js +92 -85
- package/lib/tools/auth0/schema.js +39 -31
- package/lib/tools/constants.js +111 -21
- package/lib/tools/deploy.js +35 -32
- package/lib/tools/index.js +19 -32
- package/lib/tools/logger.js +11 -12
- package/lib/tools/utils.js +255 -282
- package/lib/utils.js +167 -190
- package/package.json +10 -16
- package/tsconfig.json +17 -0
- package/typescript-migration-progress.sh +22 -0
- package/.babelrc +0 -17
- package/.nyc_output/597f412e-a239-4319-ad5b-ddb87fc39e67.json +0 -1
- package/.nyc_output/processinfo/597f412e-a239-4319-ad5b-ddb87fc39e67.json +0 -1
- package/.nyc_output/processinfo/index.json +0 -1
|
@@ -1,72 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
})
|
|
37
|
-
};
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const path_1 = __importDefault(require("path"));
|
|
16
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
17
|
+
const tools_1 = require("../../../tools");
|
|
18
|
+
const utils_1 = require("../../../utils");
|
|
19
|
+
const logger_1 = __importDefault(require("../../../logger"));
|
|
20
|
+
function parse(context) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
// Load the script file for each hook
|
|
23
|
+
if (!context.assets.hooks)
|
|
24
|
+
return {};
|
|
25
|
+
return {
|
|
26
|
+
hooks: [
|
|
27
|
+
...context.assets.hooks.map((hook) => {
|
|
28
|
+
if (hook.script) {
|
|
29
|
+
hook.script = context.loadFile(hook.script, tools_1.constants.HOOKS_DIRECTORY);
|
|
30
|
+
}
|
|
31
|
+
hook.name = hook.name.toLowerCase().replace(/\s/g, '-');
|
|
32
|
+
return Object.assign({}, hook);
|
|
33
|
+
})
|
|
34
|
+
]
|
|
35
|
+
};
|
|
36
|
+
});
|
|
38
37
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return { ...hook,
|
|
59
|
-
script: `./hooks/${codeName}`
|
|
60
|
-
};
|
|
38
|
+
function dump(context) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
let hooks = [...context.assets.hooks || []];
|
|
41
|
+
if (hooks.length > 0) {
|
|
42
|
+
// Create hooks folder
|
|
43
|
+
const hooksFolder = path_1.default.join(context.basePath, 'hooks');
|
|
44
|
+
fs_extra_1.default.ensureDirSync(hooksFolder);
|
|
45
|
+
hooks = hooks.map((hook) => {
|
|
46
|
+
// Dump hook code to file
|
|
47
|
+
// For cases when hook does not have `meta['hook-name']`
|
|
48
|
+
hook.name = hook.name || hook.id;
|
|
49
|
+
const codeName = (0, utils_1.sanitize)(`${hook.name}.js`);
|
|
50
|
+
const codeFile = path_1.default.join(hooksFolder, codeName);
|
|
51
|
+
logger_1.default.info(`Writing ${codeFile}`);
|
|
52
|
+
fs_extra_1.default.writeFileSync(codeFile, hook.script);
|
|
53
|
+
return Object.assign(Object.assign({}, hook), { script: `./hooks/${codeName}` });
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return { hooks };
|
|
61
57
|
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return {
|
|
65
|
-
hooks
|
|
66
|
-
};
|
|
67
58
|
}
|
|
68
|
-
|
|
69
59
|
exports.default = {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
};
|
|
60
|
+
parse,
|
|
61
|
+
dump
|
|
62
|
+
};
|
|
@@ -1,125 +1,55 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var _connections = require("./connections");
|
|
32
|
-
|
|
33
|
-
var _connections2 = _interopRequireDefault(_connections);
|
|
34
|
-
|
|
35
|
-
var _databases = require("./databases");
|
|
36
|
-
|
|
37
|
-
var _databases2 = _interopRequireDefault(_databases);
|
|
38
|
-
|
|
39
|
-
var _emailTemplates = require("./emailTemplates");
|
|
40
|
-
|
|
41
|
-
var _emailTemplates2 = _interopRequireDefault(_emailTemplates);
|
|
42
|
-
|
|
43
|
-
var _clientGrants = require("./clientGrants");
|
|
44
|
-
|
|
45
|
-
var _clientGrants2 = _interopRequireDefault(_clientGrants);
|
|
46
|
-
|
|
47
|
-
var _rulesConfigs = require("./rulesConfigs");
|
|
48
|
-
|
|
49
|
-
var _rulesConfigs2 = _interopRequireDefault(_rulesConfigs);
|
|
50
|
-
|
|
51
|
-
var _resourceServers = require("./resourceServers");
|
|
52
|
-
|
|
53
|
-
var _resourceServers2 = _interopRequireDefault(_resourceServers);
|
|
54
|
-
|
|
55
|
-
var _guardianFactors = require("./guardianFactors");
|
|
56
|
-
|
|
57
|
-
var _guardianFactors2 = _interopRequireDefault(_guardianFactors);
|
|
58
|
-
|
|
59
|
-
var _guardianFactorProviders = require("./guardianFactorProviders");
|
|
60
|
-
|
|
61
|
-
var _guardianFactorProviders2 = _interopRequireDefault(_guardianFactorProviders);
|
|
62
|
-
|
|
63
|
-
var _guardianFactorTemplates = require("./guardianFactorTemplates");
|
|
64
|
-
|
|
65
|
-
var _guardianFactorTemplates2 = _interopRequireDefault(_guardianFactorTemplates);
|
|
66
|
-
|
|
67
|
-
var _guardianPhoneFactorMessageTypes = require("./guardianPhoneFactorMessageTypes");
|
|
68
|
-
|
|
69
|
-
var _guardianPhoneFactorMessageTypes2 = _interopRequireDefault(_guardianPhoneFactorMessageTypes);
|
|
70
|
-
|
|
71
|
-
var _guardianPhoneFactorSelectedProvider = require("./guardianPhoneFactorSelectedProvider");
|
|
72
|
-
|
|
73
|
-
var _guardianPhoneFactorSelectedProvider2 = _interopRequireDefault(_guardianPhoneFactorSelectedProvider);
|
|
74
|
-
|
|
75
|
-
var _guardianPolicies = require("./guardianPolicies");
|
|
76
|
-
|
|
77
|
-
var _guardianPolicies2 = _interopRequireDefault(_guardianPolicies);
|
|
78
|
-
|
|
79
|
-
var _roles = require("./roles");
|
|
80
|
-
|
|
81
|
-
var _roles2 = _interopRequireDefault(_roles);
|
|
82
|
-
|
|
83
|
-
var _organizations = require("./organizations");
|
|
84
|
-
|
|
85
|
-
var _organizations2 = _interopRequireDefault(_organizations);
|
|
86
|
-
|
|
87
|
-
var _migrations = require("./migrations");
|
|
88
|
-
|
|
89
|
-
var _migrations2 = _interopRequireDefault(_migrations);
|
|
90
|
-
|
|
91
|
-
var _actions = require("./actions");
|
|
92
|
-
|
|
93
|
-
var _actions2 = _interopRequireDefault(_actions);
|
|
94
|
-
|
|
95
|
-
var _triggers = require("./triggers");
|
|
96
|
-
|
|
97
|
-
var _triggers2 = _interopRequireDefault(_triggers);
|
|
98
|
-
|
|
99
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
100
|
-
|
|
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 pages_1 = __importDefault(require("./pages"));
|
|
7
|
+
const rules_1 = __importDefault(require("./rules"));
|
|
8
|
+
const hooks_1 = __importDefault(require("./hooks"));
|
|
9
|
+
const clients_1 = __importDefault(require("./clients"));
|
|
10
|
+
const tenant_1 = __importDefault(require("./tenant"));
|
|
11
|
+
const emailProvider_1 = __importDefault(require("./emailProvider"));
|
|
12
|
+
const connections_1 = __importDefault(require("./connections"));
|
|
13
|
+
const databases_1 = __importDefault(require("./databases"));
|
|
14
|
+
const emailTemplates_1 = __importDefault(require("./emailTemplates"));
|
|
15
|
+
const clientGrants_1 = __importDefault(require("./clientGrants"));
|
|
16
|
+
const rulesConfigs_1 = __importDefault(require("./rulesConfigs"));
|
|
17
|
+
const resourceServers_1 = __importDefault(require("./resourceServers"));
|
|
18
|
+
const guardianFactors_1 = __importDefault(require("./guardianFactors"));
|
|
19
|
+
const guardianFactorProviders_1 = __importDefault(require("./guardianFactorProviders"));
|
|
20
|
+
const guardianFactorTemplates_1 = __importDefault(require("./guardianFactorTemplates"));
|
|
21
|
+
const guardianPhoneFactorMessageTypes_1 = __importDefault(require("./guardianPhoneFactorMessageTypes"));
|
|
22
|
+
const guardianPhoneFactorSelectedProvider_1 = __importDefault(require("./guardianPhoneFactorSelectedProvider"));
|
|
23
|
+
const guardianPolicies_1 = __importDefault(require("./guardianPolicies"));
|
|
24
|
+
const roles_1 = __importDefault(require("./roles"));
|
|
25
|
+
const organizations_1 = __importDefault(require("./organizations"));
|
|
26
|
+
const migrations_1 = __importDefault(require("./migrations"));
|
|
27
|
+
const actions_1 = __importDefault(require("./actions"));
|
|
28
|
+
const triggers_1 = __importDefault(require("./triggers"));
|
|
29
|
+
const attackProtection_1 = __importDefault(require("./attackProtection"));
|
|
101
30
|
exports.default = {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
31
|
+
rules: rules_1.default,
|
|
32
|
+
hooks: hooks_1.default,
|
|
33
|
+
rulesConfigs: rulesConfigs_1.default,
|
|
34
|
+
pages: pages_1.default,
|
|
35
|
+
databases: databases_1.default,
|
|
36
|
+
clientGrants: clientGrants_1.default,
|
|
37
|
+
resourceServers: resourceServers_1.default,
|
|
38
|
+
clients: clients_1.default,
|
|
39
|
+
connections: connections_1.default,
|
|
40
|
+
tenant: tenant_1.default,
|
|
41
|
+
emailProvider: emailProvider_1.default,
|
|
42
|
+
emailTemplates: emailTemplates_1.default,
|
|
43
|
+
guardianFactors: guardianFactors_1.default,
|
|
44
|
+
guardianFactorProviders: guardianFactorProviders_1.default,
|
|
45
|
+
guardianFactorTemplates: guardianFactorTemplates_1.default,
|
|
46
|
+
roles: roles_1.default,
|
|
47
|
+
migrations: migrations_1.default,
|
|
48
|
+
guardianPhoneFactorMessageTypes: guardianPhoneFactorMessageTypes_1.default,
|
|
49
|
+
guardianPhoneFactorSelectedProvider: guardianPhoneFactorSelectedProvider_1.default,
|
|
50
|
+
guardianPolicies: guardianPolicies_1.default,
|
|
51
|
+
actions: actions_1.default,
|
|
52
|
+
organizations: organizations_1.default,
|
|
53
|
+
triggers: triggers_1.default,
|
|
54
|
+
attackProtection: attackProtection_1.default
|
|
55
|
+
};
|
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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 parse(context) {
|
|
13
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
+
const { migrations } = context.assets;
|
|
15
|
+
return { migrations };
|
|
16
|
+
});
|
|
14
17
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return {
|
|
21
|
-
migrations: migrations || {}
|
|
22
|
-
};
|
|
18
|
+
function dump(context) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
const { migrations } = context.assets;
|
|
21
|
+
return { migrations: migrations || {} };
|
|
22
|
+
});
|
|
23
23
|
}
|
|
24
|
-
|
|
25
24
|
exports.default = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
25
|
+
parse,
|
|
26
|
+
dump
|
|
27
|
+
};
|
|
@@ -1,42 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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 parse(context) {
|
|
13
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
+
const { organizations } = context.assets;
|
|
15
|
+
return {
|
|
16
|
+
organizations: organizations
|
|
17
|
+
};
|
|
18
|
+
});
|
|
14
19
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
})]
|
|
36
|
-
};
|
|
20
|
+
function dump(context) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const { organizations } = context.assets;
|
|
23
|
+
return {
|
|
24
|
+
organizations: [
|
|
25
|
+
...(organizations || []).map((org) => {
|
|
26
|
+
if (org.connections.length > 0) {
|
|
27
|
+
org.connections = org.connections.map((c) => {
|
|
28
|
+
// connection is a computed field
|
|
29
|
+
const name = c.connection && c.connection.name;
|
|
30
|
+
delete c.connection_id;
|
|
31
|
+
delete c.connection;
|
|
32
|
+
return Object.assign({ name }, c);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return org;
|
|
36
|
+
})
|
|
37
|
+
]
|
|
38
|
+
};
|
|
39
|
+
});
|
|
37
40
|
}
|
|
38
|
-
|
|
39
41
|
exports.default = {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
};
|
|
42
|
+
parse,
|
|
43
|
+
dump
|
|
44
|
+
};
|
|
@@ -1,63 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const path_1 = __importDefault(require("path"));
|
|
16
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
17
|
+
const logger_1 = __importDefault(require("../../../logger"));
|
|
18
|
+
function parse(context) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
// Load the HTML file for each page
|
|
21
|
+
if (!context.assets.pages)
|
|
22
|
+
return {};
|
|
23
|
+
return {
|
|
24
|
+
pages: [
|
|
25
|
+
...context.assets.pages.map((page) => (Object.assign(Object.assign({}, page), { html: page.html ? context.loadFile(page.html) : '' })))
|
|
26
|
+
]
|
|
27
|
+
};
|
|
28
|
+
});
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return { ...page,
|
|
50
|
-
html: `./pages/${page.name}.html`
|
|
51
|
-
};
|
|
30
|
+
function dump(context) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
let pages = [...context.assets.pages || []];
|
|
33
|
+
if (pages.length > 0) {
|
|
34
|
+
// Create Pages folder
|
|
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
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return { pages };
|
|
52
49
|
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return {
|
|
56
|
-
pages
|
|
57
|
-
};
|
|
58
50
|
}
|
|
59
|
-
|
|
60
51
|
exports.default = {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
};
|
|
52
|
+
parse,
|
|
53
|
+
dump
|
|
54
|
+
};
|
|
@@ -1,22 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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 parse(context) {
|
|
13
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
+
// nothing to do, set default if empty
|
|
15
|
+
return {
|
|
16
|
+
resourceServers: context.assets.resourceServers
|
|
17
|
+
};
|
|
18
|
+
});
|
|
11
19
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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 || []]
|
|
25
|
+
};
|
|
26
|
+
});
|
|
17
27
|
}
|
|
18
|
-
|
|
19
28
|
exports.default = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
29
|
+
parse,
|
|
30
|
+
dump
|
|
31
|
+
};
|