@wocker/core 1.0.18 → 1.0.19-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/makes/Config.d.ts +7 -8
- package/lib/makes/Config.js +9 -8
- package/lib/makes/ConfigCollection.d.ts +14 -0
- package/lib/makes/ConfigCollection.js +46 -0
- package/lib/makes/FileSystem.d.ts +8 -6
- package/lib/makes/FileSystem.js +25 -30
- package/lib/makes/index.d.ts +1 -0
- package/lib/makes/index.js +1 -0
- package/lib/services/AppConfigService.d.ts +2 -0
- package/lib/services/AppConfigService.js +16 -0
- package/lib/services/DockerService.d.ts +3 -2
- package/lib/services/PluginConfigService.d.ts +19 -7
- package/lib/services/PluginConfigService.js +29 -66
- package/package.json +2 -2
package/lib/makes/Config.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
protected constructor(data: ConfigProperties);
|
|
1
|
+
export type ConfigProperties = {
|
|
2
|
+
name: string;
|
|
3
|
+
};
|
|
4
|
+
export declare class Config<T extends ConfigProperties> {
|
|
5
|
+
name: string;
|
|
6
|
+
constructor(data: T);
|
|
7
|
+
toObject(): T;
|
|
9
8
|
}
|
package/lib/makes/Config.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Config = void 0;
|
|
4
|
-
|
|
5
|
-
/* istanbul ignore next */
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated
|
|
8
|
-
* @see AppConfig
|
|
9
|
-
*/
|
|
10
|
-
class Config extends AppConfig_1.AppConfig {
|
|
4
|
+
class Config {
|
|
11
5
|
constructor(data) {
|
|
12
|
-
|
|
6
|
+
this.name = data.name;
|
|
7
|
+
}
|
|
8
|
+
toObject() {
|
|
9
|
+
return Object.keys(this)
|
|
10
|
+
.reduce((res, key) => {
|
|
11
|
+
res[key] = this[key];
|
|
12
|
+
return res;
|
|
13
|
+
}, {});
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
exports.Config = Config;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Config, ConfigProperties } from "./Config";
|
|
2
|
+
interface Constructible<P extends ConfigProperties, C extends Config<P>> {
|
|
3
|
+
new (props: P): C;
|
|
4
|
+
}
|
|
5
|
+
export declare class ConfigCollection<C extends Config<P>, P extends ConfigProperties> {
|
|
6
|
+
protected ConfigClass: Constructible<P, C>;
|
|
7
|
+
items: C[];
|
|
8
|
+
constructor(ConfigClass: Constructible<P, C>, items: P[]);
|
|
9
|
+
setConfig(config: C): void;
|
|
10
|
+
getConfig(name: string): C | undefined;
|
|
11
|
+
removeConfig(name: string): void;
|
|
12
|
+
toArray(): P[];
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConfigCollection = void 0;
|
|
4
|
+
class ConfigCollection {
|
|
5
|
+
constructor(ConfigClass, items) {
|
|
6
|
+
this.ConfigClass = ConfigClass;
|
|
7
|
+
this.items = items.map((props) => {
|
|
8
|
+
return new this.ConfigClass(props);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
setConfig(config) {
|
|
12
|
+
let exists = false;
|
|
13
|
+
for (let i = 0; i < this.items.length; i++) {
|
|
14
|
+
if (this.items[i].name === config.name) {
|
|
15
|
+
exists = true;
|
|
16
|
+
this.items[i] = config;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
if (!exists) {
|
|
20
|
+
this.items.push(config);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
getConfig(name) {
|
|
24
|
+
return this.items.find((config) => {
|
|
25
|
+
return config.name === name;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
removeConfig(name) {
|
|
29
|
+
const index = this.items.findIndex((storage) => {
|
|
30
|
+
return storage.name === name;
|
|
31
|
+
});
|
|
32
|
+
if (index === -1) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
this.items = [
|
|
36
|
+
...this.items.slice(0, index),
|
|
37
|
+
...this.items.slice(index + 1)
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
toArray() {
|
|
41
|
+
return this.items.map((item) => {
|
|
42
|
+
return item.toObject();
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.ConfigCollection = ConfigCollection;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
type ReaddirOptions =
|
|
1
|
+
import fs, { RmOptions, Stats, WriteFileOptions } from "fs";
|
|
2
|
+
type ReaddirOptions = fs.ObjectEncodingOptions & {
|
|
3
3
|
recursive?: boolean | undefined;
|
|
4
4
|
};
|
|
5
5
|
export declare class FileSystem {
|
|
@@ -9,12 +9,14 @@ export declare class FileSystem {
|
|
|
9
9
|
basename(...parts: string[]): string;
|
|
10
10
|
exists(...parts: string[]): boolean;
|
|
11
11
|
stat(...parts: string[]): Stats;
|
|
12
|
-
mkdir(path
|
|
13
|
-
readdir(...parts: string[]): Promise<
|
|
12
|
+
mkdir(path?: string, options?: fs.MakeDirectoryOptions): void;
|
|
13
|
+
readdir(...parts: string[]): Promise<string[]>;
|
|
14
14
|
readdirFiles(path?: string, options?: ReaddirOptions): Promise<string[]>;
|
|
15
15
|
readJSON(...paths: string[]): any;
|
|
16
|
-
writeFile(path: string, data: string | Buffer): Promise<void>;
|
|
17
|
-
writeJSON(path: string, data: any, options?: WriteFileOptions):
|
|
16
|
+
writeFile(path: string, data: string | Buffer | NodeJS.ArrayBufferView, options?: fs.WriteFileOptions): Promise<void>;
|
|
17
|
+
writeJSON(path: string, data: any, options?: WriteFileOptions): void;
|
|
18
18
|
rm(path: string, options?: RmOptions): Promise<void>;
|
|
19
|
+
createWriteStream(path: string): fs.WriteStream;
|
|
20
|
+
createReadStream(path: string): fs.ReadStream;
|
|
19
21
|
}
|
|
20
22
|
export {};
|
package/lib/makes/FileSystem.js
CHANGED
|
@@ -37,7 +37,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
exports.FileSystem = void 0;
|
|
39
39
|
const fs_1 = __importDefault(require("fs"));
|
|
40
|
-
const fs_2 = __importDefault(require("fs"));
|
|
41
40
|
const Path = __importStar(require("path"));
|
|
42
41
|
class FileSystem {
|
|
43
42
|
constructor(source) {
|
|
@@ -51,21 +50,21 @@ class FileSystem {
|
|
|
51
50
|
}
|
|
52
51
|
exists(...parts) {
|
|
53
52
|
const fullPath = this.path(...parts);
|
|
54
|
-
return
|
|
53
|
+
return fs_1.default.existsSync(fullPath);
|
|
55
54
|
}
|
|
56
55
|
stat(...parts) {
|
|
57
56
|
const fullPath = this.path(...parts);
|
|
58
|
-
return
|
|
57
|
+
return fs_1.default.statSync(fullPath);
|
|
59
58
|
}
|
|
60
|
-
mkdir(path, options) {
|
|
59
|
+
mkdir(path = "", options) {
|
|
61
60
|
const fullPath = this.path(path);
|
|
62
|
-
|
|
61
|
+
fs_1.default.mkdirSync(fullPath, options);
|
|
63
62
|
}
|
|
64
63
|
readdir(...parts) {
|
|
65
64
|
return __awaiter(this, void 0, void 0, function* () {
|
|
66
65
|
const fullPath = this.path(...parts);
|
|
67
66
|
return new Promise((resolve, reject) => {
|
|
68
|
-
|
|
67
|
+
fs_1.default.readdir(fullPath, (err, files) => {
|
|
69
68
|
if (err) {
|
|
70
69
|
reject(err);
|
|
71
70
|
return;
|
|
@@ -79,7 +78,7 @@ class FileSystem {
|
|
|
79
78
|
return __awaiter(this, arguments, void 0, function* (path = "", options) {
|
|
80
79
|
const fullPath = this.path(path);
|
|
81
80
|
return new Promise((resolve, reject) => {
|
|
82
|
-
|
|
81
|
+
fs_1.default.readdir(fullPath, options, (err, files) => {
|
|
83
82
|
if (err) {
|
|
84
83
|
reject(err);
|
|
85
84
|
return;
|
|
@@ -95,41 +94,31 @@ class FileSystem {
|
|
|
95
94
|
}
|
|
96
95
|
readJSON(...paths) {
|
|
97
96
|
const filePath = this.path(...paths);
|
|
98
|
-
const res =
|
|
97
|
+
const res = fs_1.default.readFileSync(filePath);
|
|
99
98
|
return JSON.parse(res.toString());
|
|
100
99
|
}
|
|
101
|
-
writeFile(path, data) {
|
|
100
|
+
writeFile(path, data, options) {
|
|
102
101
|
const fullPath = this.path(path);
|
|
103
102
|
return new Promise((resolve, reject) => {
|
|
104
|
-
|
|
103
|
+
const callback = (err) => {
|
|
105
104
|
if (err) {
|
|
106
105
|
reject(err);
|
|
107
106
|
return;
|
|
108
107
|
}
|
|
109
108
|
resolve(undefined);
|
|
110
|
-
}
|
|
109
|
+
};
|
|
110
|
+
if (options) {
|
|
111
|
+
fs_1.default.writeFile(fullPath, data, options, callback);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
fs_1.default.writeFile(fullPath, data, callback);
|
|
115
|
+
}
|
|
111
116
|
});
|
|
112
117
|
}
|
|
113
118
|
writeJSON(path, data, options) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
return new Promise((resolve, reject) => {
|
|
118
|
-
const callback = (err) => {
|
|
119
|
-
if (err) {
|
|
120
|
-
reject(err);
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
resolve(undefined);
|
|
124
|
-
};
|
|
125
|
-
if (options) {
|
|
126
|
-
fs_2.default.writeFile(fullPath, json, options, callback);
|
|
127
|
-
}
|
|
128
|
-
else {
|
|
129
|
-
fs_2.default.writeFile(fullPath, json, callback);
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
});
|
|
119
|
+
const fullPath = this.path(path);
|
|
120
|
+
const json = JSON.stringify(data, null, 4);
|
|
121
|
+
fs_1.default.writeFileSync(fullPath, json, options);
|
|
133
122
|
}
|
|
134
123
|
rm(path, options) {
|
|
135
124
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -151,5 +140,11 @@ class FileSystem {
|
|
|
151
140
|
});
|
|
152
141
|
});
|
|
153
142
|
}
|
|
143
|
+
createWriteStream(path) {
|
|
144
|
+
return fs_1.default.createWriteStream(this.path(path));
|
|
145
|
+
}
|
|
146
|
+
createReadStream(path) {
|
|
147
|
+
return fs_1.default.createReadStream(this.path(path));
|
|
148
|
+
}
|
|
154
149
|
}
|
|
155
150
|
exports.FileSystem = FileSystem;
|
package/lib/makes/index.d.ts
CHANGED
package/lib/makes/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./AppConfig"), exports);
|
|
18
18
|
__exportStar(require("./Config"), exports);
|
|
19
|
+
__exportStar(require("./ConfigCollection"), exports);
|
|
19
20
|
__exportStar(require("./Container"), exports);
|
|
20
21
|
__exportStar(require("./FileSystem"), exports);
|
|
21
22
|
__exportStar(require("./FS"), exports);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { AppConfig } from "../makes";
|
|
2
2
|
export declare abstract class AppConfigService {
|
|
3
3
|
protected config?: AppConfig;
|
|
4
|
+
get version(): string;
|
|
5
|
+
isVersionGTE(version: string): boolean;
|
|
4
6
|
abstract pwd(...parts: string[]): string;
|
|
5
7
|
abstract setPWD(pwd: string): void;
|
|
6
8
|
abstract dataPath(...args: string[]): string;
|
|
@@ -9,6 +9,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.AppConfigService = void 0;
|
|
10
10
|
const decorators_1 = require("../decorators");
|
|
11
11
|
let AppConfigService = class AppConfigService {
|
|
12
|
+
get version() {
|
|
13
|
+
return "0.0.0";
|
|
14
|
+
}
|
|
15
|
+
isVersionGTE(version) {
|
|
16
|
+
const current = this.version.split(".").map(Number);
|
|
17
|
+
const compare = version.split(".").map(Number);
|
|
18
|
+
for (let i = 0; i < 3; i++) {
|
|
19
|
+
if (current[i] > compare[i]) {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
else if (current[i] < compare[i]) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
12
28
|
getConfig() {
|
|
13
29
|
if (!this.config) {
|
|
14
30
|
this.config = this.loadConfig();
|
|
@@ -27,7 +27,7 @@ export declare namespace DockerServiceParams {
|
|
|
27
27
|
};
|
|
28
28
|
type ImageList = {
|
|
29
29
|
tag?: string;
|
|
30
|
-
reference?: string;
|
|
30
|
+
reference?: string[];
|
|
31
31
|
labels?: {
|
|
32
32
|
[key: string]: string;
|
|
33
33
|
};
|
|
@@ -54,9 +54,10 @@ export declare abstract class DockerService {
|
|
|
54
54
|
abstract buildImage(params: DockerServiceParams.BuildImage): Promise<any>;
|
|
55
55
|
abstract imageExists(tag: string): Promise<boolean>;
|
|
56
56
|
abstract imageLs(options?: DockerServiceParams.ImageList): Promise<ImageInfo[]>;
|
|
57
|
-
abstract imageRm(tag: string): Promise<void>;
|
|
57
|
+
abstract imageRm(tag: string, force?: boolean): Promise<void>;
|
|
58
58
|
abstract pullImage(tag: string): Promise<void>;
|
|
59
59
|
abstract attach(name: string | Container): Promise<NodeJS.ReadWriteStream>;
|
|
60
60
|
abstract attachStream(stream: NodeJS.ReadWriteStream): Promise<void>;
|
|
61
61
|
abstract exec(name: string, command?: string[], tty?: boolean): Promise<Duplex>;
|
|
62
|
+
abstract logs(containerOrName: string | Container): Promise<NodeJS.ReadableStream>;
|
|
62
63
|
}
|
|
@@ -1,15 +1,27 @@
|
|
|
1
|
-
import { WriteFileOptions, MakeDirectoryOptions, RmOptions } from "fs";
|
|
1
|
+
import { WriteFileOptions, MakeDirectoryOptions, RmOptions, WriteStream, ReadStream } from "fs";
|
|
2
|
+
import { FileSystem } from "../makes";
|
|
2
3
|
export declare class PluginConfigService {
|
|
3
4
|
protected readonly pluginDir: string;
|
|
4
5
|
constructor(pluginDir: string);
|
|
6
|
+
get fs(): FileSystem;
|
|
7
|
+
/** @deprecated */
|
|
5
8
|
dataPath(...parts: string[]): string;
|
|
6
|
-
|
|
9
|
+
/** @deprecated */
|
|
10
|
+
mkdir(path: string, options?: MakeDirectoryOptions): void;
|
|
11
|
+
/** @deprecated */
|
|
7
12
|
writeFile(path: string, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): Promise<void>;
|
|
8
|
-
|
|
9
|
-
|
|
13
|
+
/** @deprecated */
|
|
14
|
+
writeJSON(path: string, data: any, options?: WriteFileOptions): void;
|
|
15
|
+
/** @deprecated */
|
|
16
|
+
readJSON(path: string): any;
|
|
17
|
+
/** @deprecated */
|
|
10
18
|
exists(path: string): boolean;
|
|
11
|
-
|
|
19
|
+
/** @deprecated */
|
|
20
|
+
rm(path: string, options?: RmOptions): Promise<void>;
|
|
21
|
+
/** @deprecated */
|
|
12
22
|
readdir(path: string): Promise<string[]>;
|
|
13
|
-
|
|
14
|
-
|
|
23
|
+
/** @deprecated */
|
|
24
|
+
createWriteSteam(path: string): WriteStream;
|
|
25
|
+
/** @deprecated */
|
|
26
|
+
createReadStream(path: string): ReadStream;
|
|
15
27
|
}
|
|
@@ -1,33 +1,10 @@
|
|
|
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
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
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;
|
|
22
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
7
|
};
|
|
24
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
-
if (mod && mod.__esModule) return mod;
|
|
26
|
-
var result = {};
|
|
27
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
28
|
-
__setModuleDefault(result, mod);
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
31
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
32
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
33
10
|
};
|
|
@@ -45,8 +22,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
45
22
|
};
|
|
46
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
24
|
exports.PluginConfigService = void 0;
|
|
48
|
-
const Path = __importStar(require("path"));
|
|
49
|
-
const fs_1 = require("fs");
|
|
50
25
|
const makes_1 = require("../makes");
|
|
51
26
|
const decorators_1 = require("../decorators");
|
|
52
27
|
const env_1 = require("../env");
|
|
@@ -54,73 +29,61 @@ let PluginConfigService = class PluginConfigService {
|
|
|
54
29
|
constructor(pluginDir) {
|
|
55
30
|
this.pluginDir = pluginDir;
|
|
56
31
|
}
|
|
57
|
-
|
|
32
|
+
get fs() {
|
|
58
33
|
if (!this.pluginDir) {
|
|
59
34
|
throw new Error("Plugin dir missed");
|
|
60
35
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
});
|
|
36
|
+
const fs = new makes_1.FileSystem(this.pluginDir);
|
|
37
|
+
if (!fs.exists()) {
|
|
38
|
+
fs.mkdir();
|
|
65
39
|
}
|
|
66
|
-
return
|
|
40
|
+
return fs;
|
|
67
41
|
}
|
|
42
|
+
/** @deprecated */
|
|
43
|
+
dataPath(...parts) {
|
|
44
|
+
return this.fs.path(...parts);
|
|
45
|
+
}
|
|
46
|
+
/** @deprecated */
|
|
68
47
|
mkdir(path, options) {
|
|
69
|
-
|
|
70
|
-
yield makes_1.FS.mkdir(this.dataPath(path), options);
|
|
71
|
-
});
|
|
48
|
+
this.fs.mkdir(path, options);
|
|
72
49
|
}
|
|
50
|
+
/** @deprecated */
|
|
73
51
|
writeFile(path, data, options) {
|
|
74
52
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
-
yield
|
|
53
|
+
yield this.fs.writeFile(path, data, options);
|
|
76
54
|
});
|
|
77
55
|
}
|
|
56
|
+
/** @deprecated */
|
|
78
57
|
writeJSON(path, data, options) {
|
|
79
|
-
|
|
80
|
-
yield makes_1.FS.writeJSON(this.dataPath(path), data, options);
|
|
81
|
-
});
|
|
58
|
+
this.fs.writeJSON(path, data, options);
|
|
82
59
|
}
|
|
60
|
+
/** @deprecated */
|
|
83
61
|
readJSON(path) {
|
|
84
|
-
return
|
|
85
|
-
return makes_1.FS.readJSON(this.dataPath(path));
|
|
86
|
-
});
|
|
62
|
+
return this.fs.readJSON(path);
|
|
87
63
|
}
|
|
64
|
+
/** @deprecated */
|
|
88
65
|
exists(path) {
|
|
89
|
-
return
|
|
66
|
+
return this.fs.exists(path);
|
|
90
67
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
(0, fs_1.rm)(fullPath, options, (err) => {
|
|
96
|
-
if (err) {
|
|
97
|
-
reject(err);
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
resolve(undefined);
|
|
101
|
-
});
|
|
102
|
-
});
|
|
68
|
+
/** @deprecated */
|
|
69
|
+
rm(path, options) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
yield this.fs.rm(path, options);
|
|
103
72
|
});
|
|
104
73
|
}
|
|
74
|
+
/** @deprecated */
|
|
105
75
|
readdir(path) {
|
|
106
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
107
|
-
|
|
108
|
-
return new Promise((resolve, reject) => {
|
|
109
|
-
(0, fs_1.readdir)(fullPath, (err, files) => {
|
|
110
|
-
if (err) {
|
|
111
|
-
reject(err);
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
resolve(files);
|
|
115
|
-
});
|
|
116
|
-
});
|
|
77
|
+
return this.fs.readdir(path);
|
|
117
78
|
});
|
|
118
79
|
}
|
|
80
|
+
/** @deprecated */
|
|
119
81
|
createWriteSteam(path) {
|
|
120
|
-
return
|
|
82
|
+
return this.fs.createWriteStream(path);
|
|
121
83
|
}
|
|
84
|
+
/** @deprecated */
|
|
122
85
|
createReadStream(path) {
|
|
123
|
-
return
|
|
86
|
+
return this.fs.createReadStream(path);
|
|
124
87
|
}
|
|
125
88
|
};
|
|
126
89
|
exports.PluginConfigService = PluginConfigService;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wocker/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19-dev.1",
|
|
4
4
|
"author": "Kris Papercut <krispcut@gmail.com>",
|
|
5
5
|
"description": "Core of the Wocker",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"test-watch": "jest --colors --watchAll --coverage"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@kearisp/cli": "^2.0.
|
|
28
|
+
"@kearisp/cli": "^2.0.6",
|
|
29
29
|
"fs": "^0.0.1-security",
|
|
30
30
|
"path": "^0.12.7",
|
|
31
31
|
"reflect-metadata": "^0.2.2"
|