@wocker/core 1.0.1 → 1.0.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.
@@ -1,4 +1,4 @@
1
1
  import { DI } from "../makes/DI";
2
- export declare const Injectable: (ddi?: DI) => <T extends new (...rest: any[]) => {}>(Target: T) => {
2
+ export declare const Injectable: () => <T extends new (...rest: any[]) => {}>(Target: T) => {
3
3
  new (di: DI): {};
4
4
  } & T;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Injectable = void 0;
4
- const Injectable = (ddi) => {
4
+ const Injectable = () => {
5
5
  return (Target) => {
6
6
  // @ts-ignore
7
7
  return class extends Target {
package/lib/index.d.ts CHANGED
@@ -3,10 +3,15 @@ export * from "./decorators/Inject";
3
3
  export * from "./decorators/Injectable";
4
4
  export * from "./makes/Controller";
5
5
  export * from "./makes/DI";
6
+ export * from "./makes/Logger";
6
7
  export * from "./makes/Plugin";
8
+ export * from "./models/Preset";
7
9
  export * from "./models/Project";
8
10
  export * from "./services/AppConfigService";
9
11
  export * from "./services/AppEventsService";
12
+ export * from "./services/DockerService";
13
+ export * from "./services/LogService";
14
+ export * from "./services/PresetService";
10
15
  export * from "./services/ProjectService";
11
- export * from "./services/ProjectServiceInterface";
12
16
  export * from "./types/AppConfig";
17
+ export * from "./types/EnvConfig";
package/lib/index.js CHANGED
@@ -21,10 +21,15 @@ __exportStar(require("./decorators/Inject"), exports);
21
21
  __exportStar(require("./decorators/Injectable"), exports);
22
22
  __exportStar(require("./makes/Controller"), exports);
23
23
  __exportStar(require("./makes/DI"), exports);
24
+ __exportStar(require("./makes/Logger"), exports);
24
25
  __exportStar(require("./makes/Plugin"), exports);
26
+ __exportStar(require("./models/Preset"), exports);
25
27
  __exportStar(require("./models/Project"), exports);
26
28
  __exportStar(require("./services/AppConfigService"), exports);
27
29
  __exportStar(require("./services/AppEventsService"), exports);
30
+ __exportStar(require("./services/DockerService"), exports);
31
+ __exportStar(require("./services/LogService"), exports);
32
+ __exportStar(require("./services/PresetService"), exports);
28
33
  __exportStar(require("./services/ProjectService"), exports);
29
- __exportStar(require("./services/ProjectServiceInterface"), exports);
30
34
  __exportStar(require("./types/AppConfig"), exports);
35
+ __exportStar(require("./types/EnvConfig"), exports);
package/lib/makes/DI.d.ts CHANGED
@@ -3,6 +3,5 @@ declare class DI {
3
3
  private services;
4
4
  resolveService<T>(key: any): T;
5
5
  registerService(key: any, service: any): void;
6
- use(): void;
7
6
  }
8
7
  export { DI };
package/lib/makes/DI.js CHANGED
@@ -10,9 +10,11 @@ class DI {
10
10
  let res = this.services.get(key);
11
11
  if (!res) {
12
12
  const types = Reflect.getMetadata("design:paramtypes", key);
13
- const params = types ? types.map((type) => {
14
- return this.resolveService(type);
15
- }) : [];
13
+ if (types && types.length > 0) {
14
+ types.forEach((type) => {
15
+ this.resolveService(type);
16
+ });
17
+ }
16
18
  res = new key(this);
17
19
  this.services.set(key, res);
18
20
  }
@@ -21,7 +23,5 @@ class DI {
21
23
  registerService(key, service) {
22
24
  this.services.set(key, service);
23
25
  }
24
- use() {
25
- }
26
26
  }
27
27
  exports.DI = DI;
@@ -0,0 +1,9 @@
1
+ import { DI } from "./DI";
2
+ declare class Logger {
3
+ static install(di: DI): void;
4
+ static log(...data: any[]): void;
5
+ static info(...data: any[]): void;
6
+ static warning(...data: any[]): void;
7
+ static error(...data: any[]): void;
8
+ }
9
+ export { Logger };
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Logger = void 0;
4
+ const LogService_1 = require("../services/LogService");
5
+ let _di;
6
+ class Logger {
7
+ static install(di) {
8
+ _di = di;
9
+ }
10
+ static log(...data) {
11
+ _di.resolveService(LogService_1.LogService).log(...data);
12
+ }
13
+ static info(...data) {
14
+ _di.resolveService(LogService_1.LogService).info(...data);
15
+ }
16
+ static warning(...data) {
17
+ _di.resolveService(LogService_1.LogService).warning(...data);
18
+ }
19
+ static error(...data) {
20
+ _di.resolveService(LogService_1.LogService).error(...data);
21
+ }
22
+ }
23
+ exports.Logger = Logger;
@@ -0,0 +1,46 @@
1
+ import { DI } from "../makes/DI";
2
+ import { PresetServiceSearchOptions as SearchOptions } from "../services/PresetService";
3
+ import { EnvConfig } from "../types/EnvConfig";
4
+ type TextOption = {
5
+ type: "string" | "number" | "int";
6
+ message?: string;
7
+ default?: string | number;
8
+ };
9
+ type ConfirmOption = {
10
+ type: "boolean";
11
+ message?: string;
12
+ default?: boolean;
13
+ };
14
+ type SelectOption = {
15
+ type: "select";
16
+ options: string[] | {
17
+ label?: string;
18
+ value: string;
19
+ }[] | {
20
+ [name: string]: string;
21
+ };
22
+ message?: string;
23
+ default?: string;
24
+ };
25
+ type AnyOption = TextOption | ConfirmOption | SelectOption;
26
+ declare class Preset {
27
+ id: string;
28
+ name: string;
29
+ version: string;
30
+ dockerfile?: string;
31
+ buildArgsOptions?: {
32
+ [name: string]: AnyOption;
33
+ };
34
+ envOptions?: {
35
+ [name: string]: AnyOption;
36
+ };
37
+ volumes?: string[];
38
+ volumeOptions?: string[];
39
+ constructor(data: any);
40
+ save(): Promise<void>;
41
+ getImageName(buildArgs?: EnvConfig): string;
42
+ static install(di: DI): void;
43
+ static search(options: SearchOptions): Promise<Preset[]>;
44
+ static searchOne(options: SearchOptions): Promise<Preset | null | undefined>;
45
+ }
46
+ export { Preset };
@@ -0,0 +1,44 @@
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
+ exports.Preset = void 0;
13
+ const PresetService_1 = require("../services/PresetService");
14
+ let _di;
15
+ class Preset {
16
+ constructor(data) {
17
+ this.id = data.id;
18
+ this.name = data.name;
19
+ this.version = data.version;
20
+ this.dockerfile = data.dockerfile;
21
+ this.buildArgsOptions = data.buildArgsOptions;
22
+ this.envOptions = data.envOptions;
23
+ this.volumes = data.volumes;
24
+ this.volumeOptions = data.volumeOptions;
25
+ }
26
+ save() {
27
+ return __awaiter(this, void 0, void 0, function* () {
28
+ return _di.resolveService(PresetService_1.PresetService).save(this);
29
+ });
30
+ }
31
+ getImageName(buildArgs) {
32
+ return _di.resolveService(PresetService_1.PresetService).getImageName(this, buildArgs);
33
+ }
34
+ static install(di) {
35
+ _di = di;
36
+ }
37
+ static search(options) {
38
+ return _di.resolveService(PresetService_1.PresetService).search(options);
39
+ }
40
+ static searchOne(options) {
41
+ return _di.resolveService(PresetService_1.PresetService).searchOne(options);
42
+ }
43
+ }
44
+ exports.Preset = Preset;
@@ -11,13 +11,16 @@ declare class Project {
11
11
  name: string;
12
12
  type: string;
13
13
  path: string;
14
+ preset?: string;
14
15
  imageName?: string;
15
16
  dockerfile?: string;
16
17
  env: EnvConfig;
17
18
  buildArgs?: EnvConfig;
18
19
  volumes?: string[];
20
+ ports?: string[];
19
21
  static di?: DI;
20
22
  constructor(data: any);
23
+ hasEnv(name: string): boolean;
21
24
  getEnv(name: string, defaultValue?: string): string | undefined;
22
25
  setEnv(name: string, value: string | boolean): void;
23
26
  unsetEnv(name: string): void;
@@ -22,9 +22,19 @@ class Project {
22
22
  this.name = data.name;
23
23
  this.type = data.type;
24
24
  this.path = data.path;
25
+ this.preset = data.preset;
26
+ this.dockerfile = data.dockerfile;
25
27
  this.imageName = data.imageName;
26
- this.env = data.env || {};
27
28
  this.buildArgs = data.buildArgs;
29
+ this.env = data.env || {};
30
+ this.ports = data.ports;
31
+ this.volumes = data.volumes;
32
+ }
33
+ hasEnv(name) {
34
+ if (!this.env) {
35
+ return false;
36
+ }
37
+ return this.env.hasOwnProperty(name);
28
38
  }
29
39
  getEnv(name, defaultValue) {
30
40
  const { [name]: value = defaultValue } = this.env;
@@ -2,23 +2,18 @@ import { AppConfig } from "../types/AppConfig";
2
2
  type TypeMap = {
3
3
  [type: string]: string;
4
4
  };
5
- declare class AppConfigService {
6
- protected DATA_DIR: string;
7
- protected PLUGINS_DIR: string;
8
- protected MAP_PATH: string;
9
- protected pwd: string;
10
- protected mapTypes: TypeMap;
11
- constructor(DATA_DIR: string, PLUGINS_DIR: string, MAP_PATH: string);
12
- dataPath(...args: string[]): string;
13
- pluginsPath(...args: string[]): string;
14
- getData(): string;
15
- getPWD(): string;
16
- setPWD(pwd: string): void;
17
- getAppConfig(): Promise<AppConfig>;
18
- setProject(): Promise<void>;
19
- getAllEnvVariables(): Promise<AppConfig["env"]>;
20
- getEnvVariable(name: string, defaultValue?: string): Promise<string | undefined>;
21
- setProjectConfig(id: string, path: string): Promise<void>;
22
- getProjectTypes(): TypeMap;
5
+ declare abstract class AppConfigService {
6
+ abstract dataPath(...args: string[]): string;
7
+ abstract pluginsPath(...args: string[]): string;
8
+ abstract getPWD(): string;
9
+ abstract setPWD(pwd: string): void;
10
+ abstract getAppConfig(): Promise<AppConfig>;
11
+ abstract getAllEnvVariables(): Promise<AppConfig["env"]>;
12
+ abstract getEnvVariable(name: string, defaultValue?: string): Promise<string | undefined>;
13
+ abstract setEnvVariable(name: string, value: string | number): Promise<void>;
14
+ abstract setProjectConfig(id: string, path: string): Promise<void>;
15
+ abstract getProjectTypes(): TypeMap;
16
+ abstract registerProjectType(name: string, title?: string): void;
17
+ abstract activatePlugin(name: string): Promise<void>;
23
18
  }
24
19
  export { AppConfigService };
@@ -1,94 +1,6 @@
1
1
  "use strict";
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;
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
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
2
  Object.defineProperty(exports, "__esModule", { value: true });
35
3
  exports.AppConfigService = void 0;
36
- const Path = __importStar(require("path"));
37
- const FS = __importStar(require("fs"));
38
4
  class AppConfigService {
39
- constructor(DATA_DIR, PLUGINS_DIR, MAP_PATH) {
40
- this.DATA_DIR = DATA_DIR;
41
- this.PLUGINS_DIR = PLUGINS_DIR;
42
- this.MAP_PATH = MAP_PATH;
43
- this.mapTypes = {
44
- image: "Image",
45
- dockerfile: "Dockerfile"
46
- };
47
- this.pwd = (process.cwd() || process.env.PWD);
48
- }
49
- dataPath(...args) {
50
- return Path.join(this.DATA_DIR, ...args);
51
- }
52
- pluginsPath(...args) {
53
- return Path.join(this.PLUGINS_DIR, ...args);
54
- }
55
- getData() {
56
- return "Test";
57
- }
58
- getPWD() {
59
- return this.pwd;
60
- }
61
- setPWD(pwd) {
62
- this.pwd = pwd;
63
- }
64
- getAppConfig() {
65
- return __awaiter(this, void 0, void 0, function* () {
66
- const content = yield FS.promises.readFile(this.MAP_PATH);
67
- return JSON.parse(content.toString());
68
- });
69
- }
70
- setProject() {
71
- return __awaiter(this, void 0, void 0, function* () {
72
- //
73
- });
74
- }
75
- getAllEnvVariables() {
76
- return __awaiter(this, void 0, void 0, function* () {
77
- return {};
78
- });
79
- }
80
- getEnvVariable(name, defaultValue) {
81
- return __awaiter(this, void 0, void 0, function* () {
82
- return undefined;
83
- });
84
- }
85
- setProjectConfig(id, path) {
86
- return __awaiter(this, void 0, void 0, function* () {
87
- throw new Error("");
88
- });
89
- }
90
- getProjectTypes() {
91
- return this.mapTypes;
92
- }
93
5
  }
94
6
  exports.AppConfigService = AppConfigService;
@@ -1,10 +1,7 @@
1
1
  type EventHandle = (...args: any[]) => Promise<void> | void;
2
- declare class AppEventsService {
3
- protected handles: ({
4
- [event: string]: EventHandle[];
5
- });
6
- on(event: string, handle: EventHandle): () => void;
7
- off(event: string, handle: EventHandle): void;
8
- emit(event: string, ...args: any[]): Promise<void>;
2
+ declare abstract class AppEventsService {
3
+ abstract on(event: string, handle: EventHandle): void;
4
+ abstract off(event: string, handle: EventHandle): void;
5
+ abstract emit(event: string, ...args: any[]): Promise<void>;
9
6
  }
10
- export { EventHandle as AppEventHandle, AppEventsService };
7
+ export { AppEventsService, EventHandle as AppEventHandle };
@@ -1,40 +1,6 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.AppEventsService = void 0;
13
4
  class AppEventsService {
14
- constructor() {
15
- this.handles = {};
16
- }
17
- on(event, handle) {
18
- this.handles[event] = [
19
- ...this.handles[event] || [],
20
- handle
21
- ];
22
- return () => {
23
- this.handles[event] = this.handles[event].filter((filterHandle) => {
24
- return filterHandle !== handle;
25
- });
26
- };
27
- }
28
- off(event, handle) {
29
- //
30
- }
31
- emit(event, ...args) {
32
- return __awaiter(this, void 0, void 0, function* () {
33
- const handles = this.handles[event] || [];
34
- for (const i in handles) {
35
- yield handles[i](...args);
36
- }
37
- });
38
- }
39
5
  }
40
6
  exports.AppEventsService = AppEventsService;
@@ -0,0 +1,42 @@
1
+ /// <reference types="node" />
2
+ import { Container } from "dockerode";
3
+ declare namespace DockerServiceParams {
4
+ type CreateContainer = {
5
+ name: string;
6
+ image: string;
7
+ restart?: "always";
8
+ projectId?: string;
9
+ tty?: boolean;
10
+ links?: string[];
11
+ env?: {
12
+ [key: string]: string;
13
+ };
14
+ networkMode?: string;
15
+ extraHosts?: any;
16
+ volumes?: string[];
17
+ ports?: string[];
18
+ cmd?: string[];
19
+ };
20
+ type BuildImage = {
21
+ tag: string;
22
+ buildArgs?: {
23
+ [key: string]: string;
24
+ };
25
+ labels?: {
26
+ [key: string]: string;
27
+ };
28
+ context: string;
29
+ src: string;
30
+ };
31
+ }
32
+ declare abstract class DockerService {
33
+ abstract createContainer(params: DockerServiceParams.CreateContainer): Promise<Container>;
34
+ abstract getContainer(name: string): Promise<Container | null>;
35
+ abstract removeContainer(name: string): Promise<void>;
36
+ abstract buildImage(params: DockerServiceParams.BuildImage): Promise<any>;
37
+ abstract imageExists(tag: string): Promise<boolean>;
38
+ abstract imageRm(tag: string): Promise<void>;
39
+ abstract pullImage(tag: string): Promise<void>;
40
+ abstract attachStream(stream: NodeJS.ReadWriteStream): Promise<void>;
41
+ }
42
+ export { DockerService, DockerServiceParams };
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DockerService = void 0;
4
+ class DockerService {
5
+ }
6
+ exports.DockerService = DockerService;
@@ -0,0 +1,7 @@
1
+ declare abstract class LogService {
2
+ abstract log(...data: any[]): void;
3
+ abstract info(...data: any[]): void;
4
+ abstract warning(...data: any[]): void;
5
+ abstract error(...data: any[]): void;
6
+ }
7
+ export { LogService };
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LogService = void 0;
4
+ class LogService {
5
+ }
6
+ exports.LogService = LogService;
@@ -0,0 +1,13 @@
1
+ import { Preset } from "../models/Preset";
2
+ import { EnvConfig } from "../types/EnvConfig";
3
+ type SearchOptions = Partial<{
4
+ name: string;
5
+ }>;
6
+ declare abstract class PresetService {
7
+ abstract getImageName(preset: Preset, buildArgs?: EnvConfig): string;
8
+ abstract save(preset: Preset): Promise<void>;
9
+ abstract get(name: string): Promise<Preset | null>;
10
+ abstract search(options?: SearchOptions): Promise<Preset[]>;
11
+ searchOne(options?: SearchOptions): Promise<Preset | null | undefined>;
12
+ }
13
+ export { PresetService, SearchOptions as PresetServiceSearchOptions };
@@ -9,27 +9,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ProjectServiceInterface = void 0;
13
- class ProjectServiceInterface {
14
- cdProject(name) {
12
+ exports.PresetService = void 0;
13
+ class PresetService {
14
+ searchOne(options) {
15
15
  return __awaiter(this, void 0, void 0, function* () {
16
- throw new Error("Project not found");
17
- });
18
- }
19
- get() {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- throw new Error("Project not found");
22
- });
23
- }
24
- start(project) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- throw new Error("Project not found");
27
- });
28
- }
29
- stop(project) {
30
- return __awaiter(this, void 0, void 0, function* () {
31
- throw new Error("Project not found");
16
+ const [preset] = yield this.search(options);
17
+ return preset || null;
32
18
  });
33
19
  }
34
20
  }
35
- exports.ProjectServiceInterface = ProjectServiceInterface;
21
+ exports.PresetService = PresetService;
@@ -1,15 +1,16 @@
1
1
  import { Project } from "../models/Project";
2
- type SearchParams = {
2
+ type SearchParams = Partial<{
3
3
  id: string;
4
4
  name: string;
5
5
  path: string;
6
- };
7
- declare class ProjectService {
8
- cdProject(name: string): Promise<void>;
9
- get(): Promise<Project>;
10
- start(project: Project): Promise<void>;
11
- stop(project: Project): Promise<void>;
12
- save(project: Project): Promise<void>;
13
- search(params?: Partial<SearchParams>): Promise<Project[]>;
6
+ }>;
7
+ declare abstract class ProjectService {
8
+ abstract cdProject(name: string): Promise<void>;
9
+ abstract get(): Promise<Project>;
10
+ abstract start(project: Project): Promise<void>;
11
+ abstract stop(project: Project): Promise<void>;
12
+ abstract save(project: Project): Promise<void>;
13
+ abstract search(params: SearchParams): Promise<Project[]>;
14
+ searchOne(params?: SearchParams): Promise<Project | null>;
14
15
  }
15
16
  export { ProjectService, SearchParams as ProjectServiceSearchParams };
@@ -11,34 +11,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ProjectService = void 0;
13
13
  class ProjectService {
14
- cdProject(name) {
14
+ searchOne(params = {}) {
15
15
  return __awaiter(this, void 0, void 0, function* () {
16
- throw new Error("Project not found");
17
- });
18
- }
19
- get() {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- throw new Error("Project not found");
22
- });
23
- }
24
- start(project) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- throw new Error("Project not found");
27
- });
28
- }
29
- stop(project) {
30
- return __awaiter(this, void 0, void 0, function* () {
31
- throw new Error("Project not found");
32
- });
33
- }
34
- save(project) {
35
- return __awaiter(this, void 0, void 0, function* () {
36
- throw new Error("Dependency is missing");
37
- });
38
- }
39
- search(params = {}) {
40
- return __awaiter(this, void 0, void 0, function* () {
41
- throw new Error("Dependency is missing");
16
+ const [project] = yield this.search(params);
17
+ return project || null;
42
18
  });
43
19
  }
44
20
  }
@@ -2,6 +2,7 @@ import { EnvConfig } from "./EnvConfig";
2
2
  export type AppConfig = {
3
3
  debug?: boolean;
4
4
  env: EnvConfig;
5
+ plugins: string[];
5
6
  projects: {
6
7
  id: string;
7
8
  name?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wocker/core",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Wocker Core",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -19,6 +19,7 @@
19
19
  "reflect-metadata": "^0.1.13"
20
20
  },
21
21
  "devDependencies": {
22
+ "@types/dockerode": "^3.3.23",
22
23
  "@types/node": "^20.8.9",
23
24
  "typescript": "^5.2.2"
24
25
  }
@@ -1,2 +0,0 @@
1
- declare class DockerInterface {
2
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- class DockerInterface {
3
- }
@@ -1,8 +0,0 @@
1
- import { Project } from "../models/Project";
2
- declare class ProjectServiceInterface {
3
- cdProject(name: string): Promise<void>;
4
- get(): Promise<Project>;
5
- start(project: Project): Promise<void>;
6
- stop(project: Project): Promise<void>;
7
- }
8
- export { ProjectServiceInterface };