@wocker/core 1.0.21-beta.0 → 1.0.21-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/makes/FS.js +17 -7
- package/lib/makes/FSManager.js +17 -7
- package/lib/makes/FileSystem.d.ts +1 -0
- package/lib/makes/FileSystem.js +21 -7
- package/lib/services/AppFileSystem.d.ts +3 -0
- package/lib/services/AppFileSystem.js +7 -0
- package/lib/services/DockerService.d.ts +3 -1
- package/lib/services/PluginFileSystem.d.ts +4 -0
- package/lib/services/PluginFileSystem.js +29 -0
- package/package.json +1 -1
package/lib/makes/FS.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
package/lib/makes/FSManager.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -12,6 +12,7 @@ export declare class FileSystem {
|
|
|
12
12
|
mkdir(path?: string, options?: fs.MakeDirectoryOptions): void;
|
|
13
13
|
readdir(...parts: string[]): Promise<string[]>;
|
|
14
14
|
readdirFiles(path?: string, options?: ReaddirOptions): Promise<string[]>;
|
|
15
|
+
readFile(path: string): Buffer<ArrayBufferLike>;
|
|
15
16
|
readJSON(...paths: string[]): any;
|
|
16
17
|
writeFile(path: string, data: string | Buffer | NodeJS.ArrayBufferView, options?: fs.WriteFileOptions): Promise<void>;
|
|
17
18
|
writeJSON(path: string, data: any, options?: WriteFileOptions): void;
|
package/lib/makes/FileSystem.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -93,6 +103,10 @@ class FileSystem {
|
|
|
93
103
|
});
|
|
94
104
|
});
|
|
95
105
|
}
|
|
106
|
+
readFile(path) {
|
|
107
|
+
const filePath = this.path(path);
|
|
108
|
+
return fs_1.default.readFileSync(filePath);
|
|
109
|
+
}
|
|
96
110
|
readJSON(...paths) {
|
|
97
111
|
const filePath = this.path(...paths);
|
|
98
112
|
const res = fs_1.default.readFileSync(filePath);
|
|
@@ -24,6 +24,8 @@ export declare namespace DockerServiceParams {
|
|
|
24
24
|
volumes?: string[];
|
|
25
25
|
ports?: string[];
|
|
26
26
|
cmd?: string[];
|
|
27
|
+
network?: string;
|
|
28
|
+
aliases?: string[];
|
|
27
29
|
};
|
|
28
30
|
type ImageList = {
|
|
29
31
|
tag?: string;
|
|
@@ -62,7 +64,7 @@ export declare abstract class DockerService {
|
|
|
62
64
|
abstract imageRm(tag: string, force?: boolean): Promise<void>;
|
|
63
65
|
abstract pullImage(tag: string): Promise<void>;
|
|
64
66
|
abstract attach(name: string | Container): Promise<NodeJS.ReadWriteStream>;
|
|
65
|
-
abstract attachStream(stream: NodeJS.ReadWriteStream): Promise<
|
|
67
|
+
abstract attachStream(stream: NodeJS.ReadWriteStream): Promise<NodeJS.ReadWriteStream>;
|
|
66
68
|
abstract exec(name: string, command?: DockerServiceParams.Exec | string[], tty?: boolean): Promise<Duplex>;
|
|
67
69
|
abstract logs(containerOrName: string | Container): Promise<NodeJS.ReadableStream>;
|
|
68
70
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.PluginFileSystem = void 0;
|
|
16
|
+
const decorators_1 = require("../decorators");
|
|
17
|
+
const env_1 = require("../env");
|
|
18
|
+
const makes_1 = require("../makes");
|
|
19
|
+
let PluginFileSystem = class PluginFileSystem extends makes_1.FileSystem {
|
|
20
|
+
constructor(pluginDir) {
|
|
21
|
+
super(pluginDir);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.PluginFileSystem = PluginFileSystem;
|
|
25
|
+
exports.PluginFileSystem = PluginFileSystem = __decorate([
|
|
26
|
+
(0, decorators_1.Injectable)(),
|
|
27
|
+
__param(0, (0, decorators_1.Inject)(env_1.PLUGIN_DIR_KEY)),
|
|
28
|
+
__metadata("design:paramtypes", [String])
|
|
29
|
+
], PluginFileSystem);
|