@wocker/ws 1.0.2 → 1.0.4
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/README.md +1 -1
- package/lib/App.d.ts +4 -3
- package/lib/App.js +98 -77
- package/lib/controllers/ImageController.d.ts +2 -2
- package/lib/controllers/ImageController.js +27 -27
- package/lib/controllers/PluginController.d.ts +2 -2
- package/lib/controllers/PluginController.js +78 -56
- package/lib/controllers/PresetController.d.ts +3 -1
- package/lib/controllers/PresetController.js +155 -136
- package/lib/controllers/ProjectController.d.ts +5 -5
- package/lib/controllers/ProjectController.js +653 -603
- package/lib/controllers/ProxyController.d.ts +4 -1
- package/lib/controllers/ProxyController.js +269 -245
- package/lib/controllers/index.js +19 -58
- package/lib/decorators/Inject.d.ts +1 -0
- package/lib/decorators/Inject.js +8 -0
- package/lib/decorators/Injectable.d.ts +4 -0
- package/lib/decorators/Injectable.js +17 -0
- package/lib/decorators/index.d.ts +1 -0
- package/lib/decorators/index.js +17 -0
- package/lib/env.js +33 -15
- package/lib/index.d.ts +3 -0
- package/lib/index.js +31 -16
- package/lib/makes/Controller.js +4 -8
- package/lib/makes/DI.d.ts +7 -0
- package/lib/makes/DI.js +27 -0
- package/lib/makes/Docker.js +298 -382
- package/lib/makes/FS.d.ts +3 -9
- package/lib/makes/FS.js +277 -305
- package/lib/makes/LineConvertStream.js +37 -40
- package/lib/makes/Logger.d.ts +9 -1
- package/lib/makes/Logger.js +22 -11
- package/lib/makes/Model.js +8 -12
- package/lib/makes/MySQL.js +6 -27
- package/lib/makes/Plugin.d.ts +1 -1
- package/lib/makes/Plugin.js +55 -37
- package/lib/makes/Preset.d.ts +46 -0
- package/lib/makes/Preset.js +33 -0
- package/lib/makes/Project.d.ts +45 -0
- package/lib/makes/Project.js +127 -0
- package/lib/makes/Repository.js +18 -21
- package/lib/makes/index.d.ts +3 -0
- package/lib/makes/index.js +23 -69
- package/lib/plugins/ElasticSearchPlugin.d.ts +3 -1
- package/lib/plugins/ElasticSearchPlugin.js +66 -66
- package/lib/plugins/LocaltunnelPlugin.d.ts +2 -2
- package/lib/plugins/LocaltunnelPlugin.js +256 -257
- package/lib/plugins/MaildevPlugin.d.ts +2 -2
- package/lib/plugins/MaildevPlugin.js +45 -44
- package/lib/plugins/MongodbPlugin.d.ts +2 -2
- package/lib/plugins/MongodbPlugin.js +303 -248
- package/lib/plugins/NgrokPlugin.d.ts +2 -2
- package/lib/plugins/NgrokPlugin.js +221 -231
- package/lib/plugins/PageKitePlugin.d.ts +2 -2
- package/lib/plugins/PageKitePlugin.js +150 -149
- package/lib/plugins/PostgresPlugin.d.ts +1 -1
- package/lib/plugins/PostgresPlugin.js +115 -89
- package/lib/plugins/ProxmoxPlugin.d.ts +1 -1
- package/lib/plugins/ProxmoxPlugin.js +50 -38
- package/lib/plugins/RedisPlugin.d.ts +3 -1
- package/lib/plugins/RedisPlugin.js +73 -72
- package/lib/plugins/index.js +25 -103
- package/lib/services/AppConfigService.d.ts +3 -3
- package/lib/services/AppConfigService.js +162 -157
- package/lib/services/AppEventsService.js +26 -24
- package/lib/services/DockerService.d.ts +37 -2
- package/lib/services/DockerService.js +185 -205
- package/lib/services/LogService.d.ts +3 -2
- package/lib/services/LogService.js +33 -34
- package/lib/services/PluginService.d.ts +2 -1
- package/lib/services/PluginService.js +11 -14
- package/lib/services/PresetService.d.ts +8 -3
- package/lib/services/PresetService.js +60 -59
- package/lib/services/ProjectService.d.ts +11 -4
- package/lib/services/ProjectService.js +140 -129
- package/lib/services/index.js +21 -80
- package/lib/types/Config.d.ts +4 -3
- package/lib/types/Config.js +1 -4
- package/lib/types/EnvConfig.js +1 -4
- package/lib/types/index.js +16 -25
- package/lib/utils/buildOptions.js +5 -8
- package/lib/utils/demuxOutput.js +16 -20
- package/lib/utils/escapeRegExp.js +4 -7
- package/lib/utils/exec.js +38 -39
- package/lib/utils/fetch.js +46 -30
- package/lib/utils/followProgress.js +66 -77
- package/lib/utils/format-size-units.js +16 -16
- package/lib/utils/get-config.d.ts +1 -1
- package/lib/utils/get-config.js +13 -16
- package/lib/utils/get-cursor-position.js +22 -29
- package/lib/utils/image-build.js +35 -23
- package/lib/utils/index.js +32 -191
- package/lib/utils/injectVariables.js +10 -13
- package/lib/utils/parse-table.js +20 -23
- package/lib/utils/set-config.d.ts +1 -1
- package/lib/utils/set-config.js +12 -15
- package/lib/utils/spawn.js +17 -20
- package/lib/utils/tty.js +2 -6
- package/lib/utils/volumeFormat.js +5 -12
- package/lib/utils/volumeParse.js +10 -13
- package/package.json +13 -39
- package/presets/bun/Dockerfile +11 -0
- package/presets/bun/config.json +3 -0
- package/presets/node/Dockerfile +4 -2
- package/presets/php-apache/Dockerfile +3 -2
- package/.github/workflows/publish.yml +0 -31
- package/plugins/mariadb/admin/conf/config.user.inc.php +0 -9
|
@@ -1,63 +1,64 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
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
6
|
exports.PresetService = void 0;
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
7
|
+
const md5_1 = __importDefault(require("md5"));
|
|
8
|
+
const env_1 = require("../env");
|
|
9
|
+
const makes_1 = require("../makes");
|
|
10
|
+
class PresetService {
|
|
11
|
+
constructor(di) { }
|
|
12
|
+
getImageName(preset, buildArgs = {}) {
|
|
13
|
+
const rawValues = [];
|
|
14
|
+
const hashValues = [];
|
|
15
|
+
Object.keys(preset.buildArgsOptions || {}).forEach((key) => {
|
|
16
|
+
const hash = (preset.buildArgsOptions[key] || {}).hash || true;
|
|
17
|
+
const value = buildArgs[key];
|
|
18
|
+
if (hash) {
|
|
19
|
+
hashValues.push(value);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
rawValues.push(value);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
const version = [
|
|
26
|
+
...rawValues,
|
|
27
|
+
(0, md5_1.default)(hashValues.join(",")).substr(0, 6)
|
|
28
|
+
].filter((value) => {
|
|
29
|
+
return !!value;
|
|
30
|
+
}).join("-");
|
|
31
|
+
return `ws-preset-${preset.name}:${version}`;
|
|
32
|
+
}
|
|
33
|
+
async save(preset) {
|
|
34
|
+
}
|
|
35
|
+
async get(name) {
|
|
36
|
+
const config = await makes_1.FS.readJSON(env_1.PRESETS_DIR, name, "config.json");
|
|
37
|
+
return new makes_1.Preset({
|
|
38
|
+
name,
|
|
39
|
+
...config
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
async search(options = {}) {
|
|
43
|
+
const { name } = options;
|
|
44
|
+
const presets = [];
|
|
45
|
+
const dirs = await makes_1.FS.readdir(env_1.PRESETS_DIR);
|
|
46
|
+
for (const dir of dirs) {
|
|
47
|
+
if (name && name !== dir) {
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
const config = await makes_1.FS.readJSON(env_1.PRESETS_DIR, dir, "config.json");
|
|
51
|
+
const preset = new makes_1.Preset({
|
|
52
|
+
name: dir,
|
|
53
|
+
...config
|
|
54
|
+
});
|
|
55
|
+
presets.push(preset);
|
|
56
|
+
}
|
|
57
|
+
return presets;
|
|
58
|
+
}
|
|
59
|
+
async searchOne(options = {}) {
|
|
60
|
+
const [preset] = await this.search(options);
|
|
61
|
+
return preset || null;
|
|
59
62
|
}
|
|
60
|
-
return presets;
|
|
61
|
-
}
|
|
62
63
|
}
|
|
63
|
-
exports.PresetService = PresetService;
|
|
64
|
+
exports.PresetService = PresetService;
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import { DI,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { DI, Project } from "../makes";
|
|
2
|
+
import { DockerService, AppConfigService, AppEventsService } from "../services";
|
|
3
|
+
type SearchParams = Partial<{
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
path: string;
|
|
7
|
+
}>;
|
|
8
|
+
declare class ProjectService {
|
|
9
|
+
protected appConfigService: AppConfigService;
|
|
10
|
+
protected appEventsService: AppEventsService;
|
|
5
11
|
protected dockerService: DockerService;
|
|
6
12
|
constructor(di: DI);
|
|
7
13
|
cdProject(name: string): Promise<void>;
|
|
8
14
|
get(): Promise<Project>;
|
|
15
|
+
getContainer(): Promise<import("dockerode").Container>;
|
|
9
16
|
start(): Promise<void>;
|
|
10
17
|
stop(): Promise<void>;
|
|
11
18
|
save(project: Project): Promise<void>;
|
|
@@ -1,143 +1,154 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
5
17
|
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
26
|
exports.ProjectService = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
this.appConfigService = di.resolveService(_core.AppConfigService);
|
|
16
|
-
this.appEventsService = di.resolveService(_core.AppEventsService);
|
|
17
|
-
this.dockerService = di.resolveService(_core.DockerService);
|
|
18
|
-
}
|
|
19
|
-
async cdProject(name) {
|
|
20
|
-
const project = await _core.Project.searchOne({
|
|
21
|
-
name
|
|
22
|
-
});
|
|
23
|
-
if (!project) {
|
|
24
|
-
throw new Error("Project not found");
|
|
25
|
-
}
|
|
26
|
-
this.appConfigService.setPWD(project.path);
|
|
27
|
-
}
|
|
28
|
-
async get() {
|
|
29
|
-
const project = await _core.Project.searchOne({
|
|
30
|
-
path: this.appConfigService.getPWD()
|
|
31
|
-
});
|
|
32
|
-
if (!project) {
|
|
33
|
-
throw new Error("Project not found");
|
|
27
|
+
const Path = __importStar(require("path"));
|
|
28
|
+
const makes_1 = require("../makes");
|
|
29
|
+
const services_1 = require("../services");
|
|
30
|
+
class ProjectService {
|
|
31
|
+
constructor(di) {
|
|
32
|
+
this.appConfigService = di.resolveService(services_1.AppConfigService);
|
|
33
|
+
this.appEventsService = di.resolveService(services_1.AppEventsService);
|
|
34
|
+
this.dockerService = di.resolveService(services_1.DockerService);
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const project = await this.get();
|
|
39
|
-
if (project.type === "dockerfile") {
|
|
40
|
-
project.imageName = `project-${project.name}:develop`;
|
|
41
|
-
const images = await _makes.Docker.imageLs({
|
|
42
|
-
tag: project.imageName
|
|
43
|
-
});
|
|
44
|
-
if (images.length === 0) {
|
|
45
|
-
await _makes.Docker.imageBuild2({
|
|
46
|
-
tag: project.imageName,
|
|
47
|
-
context: this.appConfigService.getPWD(),
|
|
48
|
-
src: project.dockerfile
|
|
36
|
+
async cdProject(name) {
|
|
37
|
+
const project = await makes_1.Project.searchOne({
|
|
38
|
+
name
|
|
49
39
|
});
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
await this.appEventsService.emit("project:beforeStart", project);
|
|
53
|
-
const containerName = `${project.name}.workspace`;
|
|
54
|
-
let container = await this.dockerService.getContainer(containerName);
|
|
55
|
-
if (!container) {
|
|
56
|
-
container = await _makes.Docker.createContainer({
|
|
57
|
-
name: containerName,
|
|
58
|
-
image: project.imageName,
|
|
59
|
-
env: {
|
|
60
|
-
...(await this.appConfigService.getAllEnvVariables()),
|
|
61
|
-
...(project.env || {})
|
|
62
|
-
},
|
|
63
|
-
volumes: (project.volumes || []).map(volume => {
|
|
64
|
-
const regVolume = /^([^:]+):([^:]+)(?::([^:]+))?$/;
|
|
65
|
-
const [, source, destination, options] = regVolume.exec(volume);
|
|
66
|
-
return `${Path.join(this.appConfigService.getPWD(), source)}:${destination}` + (options ? `:${options}` : "");
|
|
67
|
-
}),
|
|
68
|
-
ports: project.ports || []
|
|
69
|
-
});
|
|
70
|
-
} else {
|
|
71
|
-
process.stdout.write("Container already exists\n");
|
|
72
|
-
}
|
|
73
|
-
if (container) {
|
|
74
|
-
const {
|
|
75
|
-
State: {
|
|
76
|
-
Status
|
|
40
|
+
if (!project) {
|
|
41
|
+
throw new Error("Project not found");
|
|
77
42
|
}
|
|
78
|
-
|
|
79
|
-
if (Status === "created" || Status === "exited") {
|
|
80
|
-
await container.start();
|
|
81
|
-
await this.appEventsService.emit("project:start", project);
|
|
82
|
-
}
|
|
43
|
+
this.appConfigService.setPWD(project.path);
|
|
83
44
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
45
|
+
async get() {
|
|
46
|
+
const project = await makes_1.Project.searchOne({
|
|
47
|
+
path: this.appConfigService.getPWD()
|
|
48
|
+
});
|
|
49
|
+
if (!project) {
|
|
50
|
+
throw new Error("Project not found");
|
|
51
|
+
}
|
|
52
|
+
return project;
|
|
91
53
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
throw new Error("Project should has a name");
|
|
54
|
+
async getContainer() {
|
|
55
|
+
const project = await this.get();
|
|
56
|
+
return this.dockerService.getContainer(project.containerName);
|
|
96
57
|
}
|
|
97
|
-
|
|
98
|
-
|
|
58
|
+
async start() {
|
|
59
|
+
const project = await this.get();
|
|
60
|
+
if (project.type === "dockerfile") {
|
|
61
|
+
project.imageName = `project-${project.name}:develop`;
|
|
62
|
+
const images = await makes_1.Docker.imageLs({
|
|
63
|
+
tag: project.imageName
|
|
64
|
+
});
|
|
65
|
+
if (images.length === 0) {
|
|
66
|
+
await makes_1.Docker.imageBuild2({
|
|
67
|
+
tag: project.imageName,
|
|
68
|
+
context: this.appConfigService.getPWD(),
|
|
69
|
+
src: project.dockerfile
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
await this.appEventsService.emit("project:beforeStart", project);
|
|
74
|
+
let container = await this.dockerService.getContainer(project.containerName);
|
|
75
|
+
if (!container) {
|
|
76
|
+
container = await makes_1.Docker.createContainer({
|
|
77
|
+
name: project.containerName,
|
|
78
|
+
image: project.imageName,
|
|
79
|
+
env: {
|
|
80
|
+
...await this.appConfigService.getAllEnvVariables(),
|
|
81
|
+
...project.env || {}
|
|
82
|
+
},
|
|
83
|
+
volumes: (project.volumes || []).map((volume) => {
|
|
84
|
+
const regVolume = /^([^:]+):([^:]+)(?::([^:]+))?$/;
|
|
85
|
+
const [, source, destination, options] = regVolume.exec(volume);
|
|
86
|
+
return `${Path.join(this.appConfigService.getPWD(), source)}:${destination}` + (options ? `:${options}` : "");
|
|
87
|
+
}),
|
|
88
|
+
ports: project.ports || []
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
process.stdout.write("Container already exists\n");
|
|
93
|
+
}
|
|
94
|
+
if (container) {
|
|
95
|
+
const { State: { Status } } = await container.inspect();
|
|
96
|
+
if (Status === "created" || Status === "exited") {
|
|
97
|
+
await container.start();
|
|
98
|
+
await this.appEventsService.emit("project:start", project);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
99
101
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
+
async stop() {
|
|
103
|
+
const project = await this.get();
|
|
104
|
+
const container = await makes_1.Docker.getContainer(project.containerName);
|
|
105
|
+
if (container) {
|
|
106
|
+
await this.appEventsService.emit("project:stop", project);
|
|
107
|
+
await makes_1.Docker.removeContainer(`${project.name}.workspace`);
|
|
108
|
+
}
|
|
102
109
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
async save(project) {
|
|
111
|
+
if (!project.name) {
|
|
112
|
+
throw new Error("Project should has a name");
|
|
113
|
+
}
|
|
114
|
+
if (!project.path) {
|
|
115
|
+
throw new Error("Project should has a path");
|
|
116
|
+
}
|
|
117
|
+
if (!project.id) {
|
|
118
|
+
project.id = project.name;
|
|
119
|
+
}
|
|
120
|
+
const projectDirPath = this.appConfigService.dataPath("projects", project.id);
|
|
121
|
+
const configPath = this.appConfigService.dataPath("projects", project.id, "config.json");
|
|
122
|
+
if (!makes_1.FS.existsSync(projectDirPath)) {
|
|
123
|
+
await makes_1.FS.mkdir(projectDirPath, {
|
|
124
|
+
recursive: true
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
await this.appConfigService.setProjectConfig(project.id, project.path);
|
|
128
|
+
await makes_1.FS.writeJSON(configPath, project);
|
|
109
129
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
continue;
|
|
133
|
-
}
|
|
134
|
-
const project = _core.Project.fromObject({
|
|
135
|
-
id: config.id,
|
|
136
|
-
...projectData
|
|
137
|
-
});
|
|
138
|
-
projects.push(project);
|
|
130
|
+
async search(params = {}) {
|
|
131
|
+
const { id, name, path } = params;
|
|
132
|
+
const { projects: configs } = await this.appConfigService.getAppConfig();
|
|
133
|
+
const projects = [];
|
|
134
|
+
for (const config of configs) {
|
|
135
|
+
if (id && config.id !== id) {
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
if (path && config.src !== path) {
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
const projectData = await makes_1.FS.readJSON(this.appConfigService.dataPath("projects", config.id, "config.json"));
|
|
142
|
+
if (name && projectData.name !== name) {
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
const project = makes_1.Project.fromObject({
|
|
146
|
+
id: config.id,
|
|
147
|
+
...projectData
|
|
148
|
+
});
|
|
149
|
+
projects.push(project);
|
|
150
|
+
}
|
|
151
|
+
return projects;
|
|
139
152
|
}
|
|
140
|
-
return projects;
|
|
141
|
-
}
|
|
142
153
|
}
|
|
143
|
-
exports.ProjectService = ProjectService;
|
|
154
|
+
exports.ProjectService = ProjectService;
|
package/lib/services/index.js
CHANGED
|
@@ -1,82 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.keys(_AppConfigService).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _AppConfigService[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _AppConfigService[key];
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
7
|
}
|
|
15
|
-
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (key in exports && exports[key] === _DockerService[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return _DockerService[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var _LogService = require("./LogService");
|
|
40
|
-
Object.keys(_LogService).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (key in exports && exports[key] === _LogService[key]) return;
|
|
43
|
-
Object.defineProperty(exports, key, {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return _LogService[key];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
var _PluginService = require("./PluginService");
|
|
51
|
-
Object.keys(_PluginService).forEach(function (key) {
|
|
52
|
-
if (key === "default" || key === "__esModule") return;
|
|
53
|
-
if (key in exports && exports[key] === _PluginService[key]) return;
|
|
54
|
-
Object.defineProperty(exports, key, {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function () {
|
|
57
|
-
return _PluginService[key];
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
var _PresetService = require("./PresetService");
|
|
62
|
-
Object.keys(_PresetService).forEach(function (key) {
|
|
63
|
-
if (key === "default" || key === "__esModule") return;
|
|
64
|
-
if (key in exports && exports[key] === _PresetService[key]) return;
|
|
65
|
-
Object.defineProperty(exports, key, {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
get: function () {
|
|
68
|
-
return _PresetService[key];
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
var _ProjectService = require("./ProjectService");
|
|
73
|
-
Object.keys(_ProjectService).forEach(function (key) {
|
|
74
|
-
if (key === "default" || key === "__esModule") return;
|
|
75
|
-
if (key in exports && exports[key] === _ProjectService[key]) return;
|
|
76
|
-
Object.defineProperty(exports, key, {
|
|
77
|
-
enumerable: true,
|
|
78
|
-
get: function () {
|
|
79
|
-
return _ProjectService[key];
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
});
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./AppConfigService"), exports);
|
|
18
|
+
__exportStar(require("./AppEventsService"), exports);
|
|
19
|
+
__exportStar(require("./DockerService"), exports);
|
|
20
|
+
__exportStar(require("./LogService"), exports);
|
|
21
|
+
__exportStar(require("./PluginService"), exports);
|
|
22
|
+
__exportStar(require("./PresetService"), exports);
|
|
23
|
+
__exportStar(require("./ProjectService"), exports);
|
package/lib/types/Config.d.ts
CHANGED
package/lib/types/Config.js
CHANGED
package/lib/types/EnvConfig.js
CHANGED
package/lib/types/index.js
CHANGED
|
@@ -1,27 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.keys(_Config).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _Config[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _Config[key];
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
7
|
}
|
|
15
|
-
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
});
|
|
27
|
-
});
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Config"), exports);
|
|
18
|
+
__exportStar(require("./EnvConfig"), exports);
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.buildOptions = void 0;
|
|
7
4
|
const buildOptions = (name, options) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
return Object.keys(options).map((key) => {
|
|
6
|
+
return `--${name} ${key}=${options[key]}`;
|
|
7
|
+
}).join(" ");
|
|
11
8
|
};
|
|
12
|
-
exports.buildOptions = buildOptions;
|
|
9
|
+
exports.buildOptions = buildOptions;
|