@wocker/core 1.0.26-beta.6 → 1.0.26-beta.7
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/lib/core/CoreModule.js +10 -1
- package/lib/core/Factory.d.ts +2 -1
- package/lib/core/Factory.js +1 -1
- package/lib/env.d.ts +5 -4
- package/lib/env.js +6 -5
- package/lib/index.d.ts +1 -1
- package/lib/index.js +3 -1
- package/lib/makes/FileSystem.d.ts +1 -1
- package/lib/makes/index.d.ts +0 -2
- package/lib/makes/index.js +0 -2
- package/lib/modules/docker/index.d.ts +2 -0
- package/lib/modules/docker/index.js +18 -0
- package/lib/{services → modules/docker/services}/DockerService.js +1 -1
- package/lib/{services → modules/docker/services}/ModemService.js +1 -1
- package/lib/modules/index.d.ts +5 -0
- package/lib/modules/index.js +5 -0
- package/lib/modules/keystore/index.d.ts +2 -0
- package/lib/modules/keystore/index.js +18 -0
- package/lib/{services → modules/keystore/services}/KeystoreService.d.ts +1 -1
- package/lib/{services → modules/keystore/services}/KeystoreService.js +1 -1
- package/lib/modules/plugin/index.d.ts +2 -0
- package/lib/modules/plugin/index.js +18 -0
- package/lib/{services → modules/plugin/services}/PluginConfigService.d.ts +5 -3
- package/lib/{services → modules/plugin/services}/PluginConfigService.js +10 -8
- package/lib/modules/plugin/services/PluginFileSystemService.d.ts +5 -0
- package/lib/{services → modules/plugin/services}/PluginFileSystemService.js +7 -6
- package/lib/modules/preset/index.d.ts +2 -0
- package/lib/modules/preset/index.js +18 -0
- package/lib/{makes → modules/preset/makes}/Preset.d.ts +1 -2
- package/lib/{services → modules/preset/services}/PresetService.d.ts +1 -1
- package/lib/modules/proxy/index.d.ts +1 -0
- package/lib/modules/proxy/index.js +17 -0
- package/lib/{services → modules/proxy/services}/ProxyService.js +1 -1
- package/lib/services/AppConfigService.js +5 -5
- package/lib/services/AppFileSystemService.d.ts +2 -1
- package/lib/services/AppFileSystemService.js +4 -3
- package/lib/services/AppService.d.ts +1 -1
- package/lib/services/ProcessService.d.ts +1 -0
- package/lib/services/ProcessService.js +4 -1
- package/lib/services/index.d.ts +0 -7
- package/lib/services/index.js +0 -7
- package/lib/types/FileSystemDriver.d.ts +3 -3
- package/package.json +1 -1
- package/lib/services/PluginFileSystemService.d.ts +0 -4
- /package/lib/{services → modules/docker/services}/DockerService.d.ts +0 -0
- /package/lib/{services → modules/docker/services}/ModemService.d.ts +0 -0
- /package/lib/{makes → modules/keystore/makes}/KeystoreProvider.d.ts +0 -0
- /package/lib/{makes → modules/keystore/makes}/KeystoreProvider.js +0 -0
- /package/lib/{makes → modules/preset/makes}/Preset.js +0 -0
- /package/lib/{services → modules/preset/services}/PresetService.js +0 -0
- /package/lib/{services → modules/proxy/services}/ProxyService.d.ts +0 -0
package/lib/core/CoreModule.js
CHANGED
|
@@ -5,9 +5,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
8
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
12
|
exports.CoreModule = void 0;
|
|
10
13
|
const cli_1 = require("@kearisp/cli");
|
|
14
|
+
const fs_1 = __importDefault(require("fs"));
|
|
11
15
|
const decorators_1 = require("../decorators");
|
|
12
16
|
const AppService_1 = require("../services/AppService");
|
|
13
17
|
const AppConfigService_1 = require("../services/AppConfigService");
|
|
@@ -30,7 +34,11 @@ exports.CoreModule = CoreModule = __decorate([
|
|
|
30
34
|
},
|
|
31
35
|
{
|
|
32
36
|
provide: env_1.WOCKER_DATA_DIR_KEY,
|
|
33
|
-
useValue: env_1.
|
|
37
|
+
useValue: env_1.WOCKER_DATA_DIR
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
provide: env_1.FILE_SYSTEM_DRIVER_KEY,
|
|
41
|
+
useValue: fs_1.default
|
|
34
42
|
},
|
|
35
43
|
AppService_1.AppService,
|
|
36
44
|
AppConfigService_1.AppConfigService,
|
|
@@ -43,6 +51,7 @@ exports.CoreModule = CoreModule = __decorate([
|
|
|
43
51
|
cli_1.Cli,
|
|
44
52
|
env_1.WOCKER_VERSION_KEY,
|
|
45
53
|
env_1.WOCKER_DATA_DIR_KEY,
|
|
54
|
+
env_1.FILE_SYSTEM_DRIVER_KEY,
|
|
46
55
|
AppService_1.AppService,
|
|
47
56
|
AppConfigService_1.AppConfigService,
|
|
48
57
|
AppFileSystemService_1.AppFileSystemService,
|
package/lib/core/Factory.d.ts
CHANGED
package/lib/core/Factory.js
CHANGED
|
@@ -18,7 +18,7 @@ class Factory {
|
|
|
18
18
|
return __awaiter(this, void 0, void 0, function* () {
|
|
19
19
|
const container = new Container_1.Container(), scanner = new Scanner_1.Scanner(container);
|
|
20
20
|
yield scanner.scan(module);
|
|
21
|
-
return new ApplicationContext_1.ApplicationContext(module,
|
|
21
|
+
return new ApplicationContext_1.ApplicationContext(module, container);
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
}
|
package/lib/env.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export declare const WOCKER_VERSION = "1.0.26";
|
|
2
|
+
export declare const WOCKER_VERSION_KEY = "__WOCKER_VERSION__";
|
|
3
|
+
export declare const WOCKER_DATA_DIR: string;
|
|
4
|
+
export declare const WOCKER_DATA_DIR_KEY = "__WOCKER_DATA_DIR__";
|
|
5
|
+
export declare const FILE_SYSTEM_DRIVER_KEY = "__FILE_SYSTEM_DRIVER_";
|
|
6
|
+
export declare const PLUGIN_DIR_KEY = "PLUGIN_DIR";
|
|
2
7
|
export declare const IS_GLOBAL_METADATA = "IS_GLOBAL";
|
|
3
8
|
export declare const IS_MODULE_METADATA = "isModule";
|
|
4
9
|
export declare const INJECTABLE_WATERMARK = "__injectable__";
|
|
@@ -12,7 +17,6 @@ export declare const OPTION_META = "__OPTION_META__";
|
|
|
12
17
|
export declare const PARAMTYPES_METADATA = "design:paramtypes";
|
|
13
18
|
export declare const SELF_DECLARED_DEPS_METADATA = "self:paramtypes";
|
|
14
19
|
export declare const INJECT_TOKEN_METADATA = "INJECT_TOKEN";
|
|
15
|
-
export declare const PLUGIN_DIR_KEY = "PLUGIN_DIR";
|
|
16
20
|
export declare const PLUGIN_NAME_METADATA = "name";
|
|
17
21
|
export declare enum MODULE_METADATA {
|
|
18
22
|
IMPORTS = "imports",
|
|
@@ -20,6 +24,3 @@ export declare enum MODULE_METADATA {
|
|
|
20
24
|
CONTROLLERS = "controllers",
|
|
21
25
|
PROVIDERS = "providers"
|
|
22
26
|
}
|
|
23
|
-
export declare const DATA_DIR: string;
|
|
24
|
-
export declare const WOCKER_VERSION_KEY = "__WOCKER_VERSION__";
|
|
25
|
-
export declare const WOCKER_DATA_DIR_KEY = "__WOCKER_DATA_DIR__";
|
package/lib/env.js
CHANGED
|
@@ -3,10 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.MODULE_METADATA = exports.PLUGIN_NAME_METADATA = exports.INJECT_TOKEN_METADATA = exports.SELF_DECLARED_DEPS_METADATA = exports.PARAMTYPES_METADATA = exports.OPTION_META = exports.ALIAS_METADATA = exports.ARGS_OLD_METADATA = exports.ARGS_METADATA = exports.COMPLETION_METADATA = exports.COMMAND_METADATA = exports.DESCRIPTION_METADATA = exports.INJECTABLE_WATERMARK = exports.IS_MODULE_METADATA = exports.IS_GLOBAL_METADATA = exports.PLUGIN_DIR_KEY = exports.FILE_SYSTEM_DRIVER_KEY = exports.WOCKER_DATA_DIR_KEY = exports.WOCKER_DATA_DIR = exports.WOCKER_VERSION_KEY = exports.WOCKER_VERSION = void 0;
|
|
7
7
|
const os_1 = __importDefault(require("os"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
exports.WOCKER_VERSION = "1.0.26";
|
|
10
|
+
exports.WOCKER_VERSION_KEY = "__WOCKER_VERSION__";
|
|
11
|
+
exports.WOCKER_DATA_DIR = process.env.WS_DIR || path_1.default.join(os_1.default.homedir(), ".workspace");
|
|
12
|
+
exports.WOCKER_DATA_DIR_KEY = "__WOCKER_DATA_DIR__";
|
|
13
|
+
exports.FILE_SYSTEM_DRIVER_KEY = "__FILE_SYSTEM_DRIVER_";
|
|
14
|
+
exports.PLUGIN_DIR_KEY = "PLUGIN_DIR";
|
|
10
15
|
exports.IS_GLOBAL_METADATA = "IS_GLOBAL";
|
|
11
16
|
exports.IS_MODULE_METADATA = "isModule";
|
|
12
17
|
exports.INJECTABLE_WATERMARK = "__injectable__";
|
|
@@ -20,7 +25,6 @@ exports.OPTION_META = "__OPTION_META__";
|
|
|
20
25
|
exports.PARAMTYPES_METADATA = "design:paramtypes";
|
|
21
26
|
exports.SELF_DECLARED_DEPS_METADATA = "self:paramtypes";
|
|
22
27
|
exports.INJECT_TOKEN_METADATA = "INJECT_TOKEN";
|
|
23
|
-
exports.PLUGIN_DIR_KEY = "PLUGIN_DIR";
|
|
24
28
|
exports.PLUGIN_NAME_METADATA = "name";
|
|
25
29
|
var MODULE_METADATA;
|
|
26
30
|
(function (MODULE_METADATA) {
|
|
@@ -29,6 +33,3 @@ var MODULE_METADATA;
|
|
|
29
33
|
MODULE_METADATA["CONTROLLERS"] = "controllers";
|
|
30
34
|
MODULE_METADATA["PROVIDERS"] = "providers";
|
|
31
35
|
})(MODULE_METADATA || (exports.MODULE_METADATA = MODULE_METADATA = {}));
|
|
32
|
-
exports.DATA_DIR = process.env.WS_DIR || path_1.default.join(os_1.default.homedir(), ".workspace");
|
|
33
|
-
exports.WOCKER_VERSION_KEY = "__WOCKER_VERSION__";
|
|
34
|
-
exports.WOCKER_DATA_DIR_KEY = "__WOCKER_DATA_DIR__";
|
package/lib/index.d.ts
CHANGED
|
@@ -14,4 +14,4 @@ export {
|
|
|
14
14
|
*/
|
|
15
15
|
EventService as AppEventsService } from "./services";
|
|
16
16
|
export * from "./types";
|
|
17
|
-
export { IS_MODULE_METADATA, MODULE_METADATA, PLUGIN_NAME_METADATA, PLUGIN_DIR_KEY, WOCKER_VERSION_KEY, WOCKER_DATA_DIR_KEY } from "./env";
|
|
17
|
+
export { IS_MODULE_METADATA, MODULE_METADATA, FILE_SYSTEM_DRIVER_KEY, PLUGIN_NAME_METADATA, PLUGIN_DIR_KEY, WOCKER_VERSION_KEY, WOCKER_VERSION, WOCKER_DATA_DIR_KEY } from "./env";
|
package/lib/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.WOCKER_DATA_DIR_KEY = exports.WOCKER_VERSION_KEY = exports.PLUGIN_DIR_KEY = exports.PLUGIN_NAME_METADATA = exports.MODULE_METADATA = exports.IS_MODULE_METADATA = exports.AppEventsService = exports.CommandNotFoundError = exports.Cli = void 0;
|
|
17
|
+
exports.WOCKER_DATA_DIR_KEY = exports.WOCKER_VERSION = exports.WOCKER_VERSION_KEY = exports.PLUGIN_DIR_KEY = exports.PLUGIN_NAME_METADATA = exports.FILE_SYSTEM_DRIVER_KEY = exports.MODULE_METADATA = exports.IS_MODULE_METADATA = exports.AppEventsService = exports.CommandNotFoundError = exports.Cli = void 0;
|
|
18
18
|
require("reflect-metadata");
|
|
19
19
|
var cli_1 = require("@kearisp/cli");
|
|
20
20
|
Object.defineProperty(exports, "Cli", { enumerable: true, get: function () { return cli_1.Cli; } });
|
|
@@ -36,7 +36,9 @@ __exportStar(require("./types"), exports);
|
|
|
36
36
|
var env_1 = require("./env");
|
|
37
37
|
Object.defineProperty(exports, "IS_MODULE_METADATA", { enumerable: true, get: function () { return env_1.IS_MODULE_METADATA; } });
|
|
38
38
|
Object.defineProperty(exports, "MODULE_METADATA", { enumerable: true, get: function () { return env_1.MODULE_METADATA; } });
|
|
39
|
+
Object.defineProperty(exports, "FILE_SYSTEM_DRIVER_KEY", { enumerable: true, get: function () { return env_1.FILE_SYSTEM_DRIVER_KEY; } });
|
|
39
40
|
Object.defineProperty(exports, "PLUGIN_NAME_METADATA", { enumerable: true, get: function () { return env_1.PLUGIN_NAME_METADATA; } });
|
|
40
41
|
Object.defineProperty(exports, "PLUGIN_DIR_KEY", { enumerable: true, get: function () { return env_1.PLUGIN_DIR_KEY; } });
|
|
41
42
|
Object.defineProperty(exports, "WOCKER_VERSION_KEY", { enumerable: true, get: function () { return env_1.WOCKER_VERSION_KEY; } });
|
|
43
|
+
Object.defineProperty(exports, "WOCKER_VERSION", { enumerable: true, get: function () { return env_1.WOCKER_VERSION; } });
|
|
42
44
|
Object.defineProperty(exports, "WOCKER_DATA_DIR_KEY", { enumerable: true, get: function () { return env_1.WOCKER_DATA_DIR_KEY; } });
|
|
@@ -41,6 +41,6 @@ export declare class FileSystem {
|
|
|
41
41
|
createReadStream(path: string, options?: ReadStreamOptions): FS.ReadStream;
|
|
42
42
|
createReadlineStream(path: string, options?: ReadlineOptions): Readable;
|
|
43
43
|
getLinePosition(path: string, line: number): number;
|
|
44
|
-
watch(path: string, options?: FS.
|
|
44
|
+
watch(path: string, options?: FS.WatchOptionsWithStringEncoding): FS.FSWatcher;
|
|
45
45
|
}
|
|
46
46
|
export {};
|
package/lib/makes/index.d.ts
CHANGED
package/lib/makes/index.js
CHANGED
|
@@ -19,6 +19,4 @@ __exportStar(require("./Config"), exports);
|
|
|
19
19
|
__exportStar(require("./ConfigCollection"), exports);
|
|
20
20
|
__exportStar(require("./FileSystem"), exports);
|
|
21
21
|
__exportStar(require("./FileSystemManager"), exports);
|
|
22
|
-
__exportStar(require("./KeystoreProvider"), exports);
|
|
23
22
|
__exportStar(require("./Logger"), exports);
|
|
24
|
-
__exportStar(require("./Preset"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
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 __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("./services/DockerService"), exports);
|
|
18
|
+
__exportStar(require("./services/ModemService"), exports);
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.DockerService = void 0;
|
|
10
|
-
const decorators_1 = require("
|
|
10
|
+
const decorators_1 = require("../../../decorators");
|
|
11
11
|
let DockerService = class DockerService {
|
|
12
12
|
};
|
|
13
13
|
exports.DockerService = DockerService;
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.ModemService = void 0;
|
|
10
|
-
const decorators_1 = require("
|
|
10
|
+
const decorators_1 = require("../../../decorators");
|
|
11
11
|
let ModemService = class ModemService {
|
|
12
12
|
};
|
|
13
13
|
exports.ModemService = ModemService;
|
package/lib/modules/index.d.ts
CHANGED
package/lib/modules/index.js
CHANGED
|
@@ -14,4 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./docker"), exports);
|
|
18
|
+
__exportStar(require("./keystore"), exports);
|
|
19
|
+
__exportStar(require("./plugin"), exports);
|
|
20
|
+
__exportStar(require("./preset"), exports);
|
|
17
21
|
__exportStar(require("./project"), exports);
|
|
22
|
+
__exportStar(require("./proxy"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
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 __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("./makes/KeystoreProvider"), exports);
|
|
18
|
+
__exportStar(require("./services/KeystoreService"), exports);
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.KeystoreService = void 0;
|
|
10
|
-
const decorators_1 = require("
|
|
10
|
+
const decorators_1 = require("../../../decorators");
|
|
11
11
|
let KeystoreService = class KeystoreService {
|
|
12
12
|
};
|
|
13
13
|
exports.KeystoreService = KeystoreService;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 __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("./services/PluginConfigService"), exports);
|
|
18
|
+
__exportStar(require("./services/PluginFileSystemService"), exports);
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { WriteFileOptions, MakeDirectoryOptions, RmOptions, WriteStream, ReadStream } from "fs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { FileSystemDriver } from "../../../types";
|
|
3
|
+
import { AppConfigService } from "../../../services/AppConfigService";
|
|
4
|
+
import { FileSystem } from "../../../makes";
|
|
4
5
|
export declare class PluginConfigService {
|
|
5
6
|
protected readonly appConfigService: AppConfigService;
|
|
6
7
|
protected readonly pluginDir: string;
|
|
8
|
+
protected readonly driver: FileSystemDriver;
|
|
7
9
|
protected _fs?: FileSystem;
|
|
8
|
-
constructor(appConfigService: AppConfigService, pluginDir: string);
|
|
10
|
+
constructor(appConfigService: AppConfigService, pluginDir: string, driver: FileSystemDriver);
|
|
9
11
|
get fs(): FileSystem;
|
|
10
12
|
isVersionGTE(version: string): boolean;
|
|
11
13
|
/** @deprecated */
|
|
@@ -22,21 +22,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
22
22
|
};
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
24
|
exports.PluginConfigService = void 0;
|
|
25
|
-
const AppConfigService_1 = require("
|
|
26
|
-
const makes_1 = require("
|
|
27
|
-
const decorators_1 = require("
|
|
28
|
-
const env_1 = require("
|
|
25
|
+
const AppConfigService_1 = require("../../../services/AppConfigService");
|
|
26
|
+
const makes_1 = require("../../../makes");
|
|
27
|
+
const decorators_1 = require("../../../decorators");
|
|
28
|
+
const env_1 = require("../../../env");
|
|
29
29
|
let PluginConfigService = class PluginConfigService {
|
|
30
|
-
constructor(appConfigService, pluginDir) {
|
|
30
|
+
constructor(appConfigService, pluginDir, driver) {
|
|
31
31
|
this.appConfigService = appConfigService;
|
|
32
32
|
this.pluginDir = pluginDir;
|
|
33
|
+
this.driver = driver;
|
|
33
34
|
}
|
|
34
35
|
get fs() {
|
|
35
36
|
if (!this._fs) {
|
|
36
37
|
if (!this.pluginDir) {
|
|
37
38
|
throw new Error("Plugin dir missed");
|
|
38
39
|
}
|
|
39
|
-
this._fs = new makes_1.FileSystem(this.pluginDir);
|
|
40
|
+
this._fs = new makes_1.FileSystem(this.pluginDir, this.driver);
|
|
40
41
|
if (!this._fs.exists()) {
|
|
41
42
|
this._fs.mkdir("", {
|
|
42
43
|
recursive: true
|
|
@@ -62,7 +63,7 @@ let PluginConfigService = class PluginConfigService {
|
|
|
62
63
|
/** @deprecated */
|
|
63
64
|
writeFile(path, data, options) {
|
|
64
65
|
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
-
|
|
66
|
+
this.fs.writeFile(path, data, options);
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
69
|
/** @deprecated */
|
|
@@ -102,5 +103,6 @@ exports.PluginConfigService = PluginConfigService;
|
|
|
102
103
|
exports.PluginConfigService = PluginConfigService = __decorate([
|
|
103
104
|
(0, decorators_1.Injectable)(),
|
|
104
105
|
__param(1, (0, decorators_1.Inject)(env_1.PLUGIN_DIR_KEY)),
|
|
105
|
-
|
|
106
|
+
__param(2, (0, decorators_1.Inject)(env_1.FILE_SYSTEM_DRIVER_KEY)),
|
|
107
|
+
__metadata("design:paramtypes", [AppConfigService_1.AppConfigService, String, Object])
|
|
106
108
|
], PluginConfigService);
|
|
@@ -13,17 +13,18 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.PluginFileSystemService = void 0;
|
|
16
|
-
const decorators_1 = require("
|
|
17
|
-
const
|
|
18
|
-
const
|
|
16
|
+
const decorators_1 = require("../../../decorators");
|
|
17
|
+
const makes_1 = require("../../../makes");
|
|
18
|
+
const env_1 = require("../../../env");
|
|
19
19
|
let PluginFileSystemService = class PluginFileSystemService extends makes_1.FileSystem {
|
|
20
|
-
constructor(pluginDir) {
|
|
21
|
-
super(pluginDir);
|
|
20
|
+
constructor(pluginDir, driver) {
|
|
21
|
+
super(pluginDir, driver);
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
exports.PluginFileSystemService = PluginFileSystemService;
|
|
25
25
|
exports.PluginFileSystemService = PluginFileSystemService = __decorate([
|
|
26
26
|
(0, decorators_1.Injectable)(),
|
|
27
27
|
__param(0, (0, decorators_1.Inject)(env_1.PLUGIN_DIR_KEY)),
|
|
28
|
-
|
|
28
|
+
__param(1, (0, decorators_1.Inject)(env_1.FILE_SYSTEM_DRIVER_KEY)),
|
|
29
|
+
__metadata("design:paramtypes", [String, Object])
|
|
29
30
|
], PluginFileSystemService);
|
|
@@ -0,0 +1,18 @@
|
|
|
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 __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("./makes/Preset"), exports);
|
|
18
|
+
__exportStar(require("./services/PresetService"), exports);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { PickProperties } from "
|
|
2
|
-
import { PresetSource } from "../types/PresetSource";
|
|
1
|
+
import { PickProperties, PresetSource } from "../../../types";
|
|
3
2
|
type TextOption = {
|
|
4
3
|
type: "text" | "string" | "number" | "int" | "password";
|
|
5
4
|
message?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./services/ProxyService";
|
|
@@ -0,0 +1,17 @@
|
|
|
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 __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("./services/ProxyService"), exports);
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.ProxyService = void 0;
|
|
10
|
-
const decorators_1 = require("
|
|
10
|
+
const decorators_1 = require("../../../decorators");
|
|
11
11
|
let ProxyService = class ProxyService {
|
|
12
12
|
};
|
|
13
13
|
exports.ProxyService = ProxyService;
|
|
@@ -18,7 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
exports.AppConfigService = void 0;
|
|
19
19
|
const path_1 = __importDefault(require("path"));
|
|
20
20
|
const decorators_1 = require("../decorators");
|
|
21
|
-
const
|
|
21
|
+
const project_1 = require("../modules/project");
|
|
22
22
|
const AppConfig_1 = require("../makes/AppConfig");
|
|
23
23
|
const AppFileSystemService_1 = require("./AppFileSystemService");
|
|
24
24
|
const ProcessService_1 = require("./ProcessService");
|
|
@@ -29,9 +29,9 @@ let AppConfigService = class AppConfigService {
|
|
|
29
29
|
this.processService = processService;
|
|
30
30
|
this.fs = fs;
|
|
31
31
|
this.mapTypes = {
|
|
32
|
-
[
|
|
33
|
-
[
|
|
34
|
-
[
|
|
32
|
+
[project_1.PROJECT_TYPE_PRESET]: "Preset",
|
|
33
|
+
[project_1.PROJECT_TYPE_IMAGE]: "Image",
|
|
34
|
+
[project_1.PROJECT_TYPE_DOCKERFILE]: "Dockerfile"
|
|
35
35
|
};
|
|
36
36
|
this._pwd = (process.cwd() || process.env.PWD);
|
|
37
37
|
}
|
|
@@ -180,7 +180,7 @@ let AppConfigService = class AppConfigService {
|
|
|
180
180
|
}
|
|
181
181
|
getProjectTypes() {
|
|
182
182
|
if (this.isExperimentalEnabled("projectComposeType")) {
|
|
183
|
-
return Object.assign(Object.assign({}, this.mapTypes), { [
|
|
183
|
+
return Object.assign(Object.assign({}, this.mapTypes), { [project_1.PROJECT_TYPE_COMPOSE]: "Docker compose" });
|
|
184
184
|
}
|
|
185
185
|
return this.mapTypes;
|
|
186
186
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { FileSystemDriver } from "../types/FileSystemDriver";
|
|
1
2
|
import { FileSystem } from "../makes/FileSystem";
|
|
2
3
|
export declare class AppFileSystemService extends FileSystem {
|
|
3
|
-
constructor(dataDir: string);
|
|
4
|
+
constructor(dataDir: string, fsDriver: FileSystemDriver);
|
|
4
5
|
}
|
|
@@ -17,13 +17,14 @@ const decorators_1 = require("../decorators");
|
|
|
17
17
|
const FileSystem_1 = require("../makes/FileSystem");
|
|
18
18
|
const env_1 = require("../env");
|
|
19
19
|
let AppFileSystemService = class AppFileSystemService extends FileSystem_1.FileSystem {
|
|
20
|
-
constructor(dataDir) {
|
|
21
|
-
super(dataDir);
|
|
20
|
+
constructor(dataDir, fsDriver) {
|
|
21
|
+
super(dataDir, fsDriver);
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
exports.AppFileSystemService = AppFileSystemService;
|
|
25
25
|
exports.AppFileSystemService = AppFileSystemService = __decorate([
|
|
26
26
|
(0, decorators_1.Injectable)(),
|
|
27
27
|
__param(0, (0, decorators_1.Inject)(env_1.WOCKER_DATA_DIR_KEY)),
|
|
28
|
-
|
|
28
|
+
__param(1, (0, decorators_1.Inject)(env_1.FILE_SYSTEM_DRIVER_KEY)),
|
|
29
|
+
__metadata("design:paramtypes", [String, Object])
|
|
29
30
|
], AppFileSystemService);
|
|
@@ -22,8 +22,11 @@ let ProcessService = class ProcessService {
|
|
|
22
22
|
chdir(path) {
|
|
23
23
|
process.chdir(path);
|
|
24
24
|
}
|
|
25
|
+
write(buffer) {
|
|
26
|
+
process.stdout.write(buffer);
|
|
27
|
+
}
|
|
25
28
|
};
|
|
26
29
|
exports.ProcessService = ProcessService;
|
|
27
30
|
exports.ProcessService = ProcessService = __decorate([
|
|
28
|
-
(0, decorators_1.Injectable)()
|
|
31
|
+
(0, decorators_1.Injectable)("CORE_PROCESS_SERVICE")
|
|
29
32
|
], ProcessService);
|
package/lib/services/index.d.ts
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
export * from "./AppConfigService";
|
|
2
2
|
export * from "./AppFileSystemService";
|
|
3
3
|
export * from "./AppService";
|
|
4
|
-
export * from "./DockerService";
|
|
5
4
|
export * from "./EventService";
|
|
6
|
-
export * from "./KeystoreService";
|
|
7
5
|
export * from "./LogService";
|
|
8
|
-
export * from "./ModemService";
|
|
9
|
-
export * from "./PluginConfigService";
|
|
10
|
-
export * from "./PluginFileSystemService";
|
|
11
|
-
export * from "./PresetService";
|
|
12
6
|
export * from "./ProcessService";
|
|
13
|
-
export * from "./ProxyService";
|
package/lib/services/index.js
CHANGED
|
@@ -17,13 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./AppConfigService"), exports);
|
|
18
18
|
__exportStar(require("./AppFileSystemService"), exports);
|
|
19
19
|
__exportStar(require("./AppService"), exports);
|
|
20
|
-
__exportStar(require("./DockerService"), exports);
|
|
21
20
|
__exportStar(require("./EventService"), exports);
|
|
22
|
-
__exportStar(require("./KeystoreService"), exports);
|
|
23
21
|
__exportStar(require("./LogService"), exports);
|
|
24
|
-
__exportStar(require("./ModemService"), exports);
|
|
25
|
-
__exportStar(require("./PluginConfigService"), exports);
|
|
26
|
-
__exportStar(require("./PluginFileSystemService"), exports);
|
|
27
|
-
__exportStar(require("./PresetService"), exports);
|
|
28
22
|
__exportStar(require("./ProcessService"), exports);
|
|
29
|
-
__exportStar(require("./ProxyService"), exports);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import FS from "fs";
|
|
1
|
+
import FS, { type Dirent } from "fs";
|
|
2
2
|
type StreamOptions = {
|
|
3
3
|
flags?: string;
|
|
4
4
|
fd?: number;
|
|
@@ -25,14 +25,14 @@ export interface FileSystemDriver {
|
|
|
25
25
|
fstatSync(fd: number): FS.Stats;
|
|
26
26
|
mkdirSync(path: string, options?: FS.MakeDirectoryOptions): void;
|
|
27
27
|
readdir(path: string, options: any, callback: (err: NodeJS.ErrnoException | null, files: string[]) => void): void;
|
|
28
|
-
readdirSync(path: string, options?: any): string[];
|
|
28
|
+
readdirSync(path: string, options?: any): (string | Buffer)[] | Dirent[] | Dirent<Buffer>[];
|
|
29
29
|
readFileSync(path: string): string | Buffer;
|
|
30
30
|
writeFileSync(path: string, data: string | Buffer | NodeJS.ArrayBufferView, options?: FS.WriteFileOptions): void;
|
|
31
31
|
appendFileSync(path: FS.PathOrFileDescriptor, data: string | Uint8Array, options?: FS.WriteFileOptions): void;
|
|
32
32
|
rmSync(path: string, options?: FS.RmOptions): void;
|
|
33
33
|
createWriteStream(path: string, options?: WriteStreamOptions): FS.WriteStream;
|
|
34
34
|
createReadStream(path: string, options?: ReadStreamOptions): FS.ReadStream;
|
|
35
|
-
watch(file: string, options: FS.
|
|
35
|
+
watch(file: string, options: FS.WatchOptionsWithStringEncoding, listener?: FS.WatchListener<string | Buffer>): FS.FSWatcher;
|
|
36
36
|
watchFile(path: string, listener: FS.StatsListener): FS.StatWatcher;
|
|
37
37
|
cpSync(source: string, destination: string, opts?: FS.CopySyncOptions): void;
|
|
38
38
|
renameSync(oldPath: string, newPath: string): void;
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|