@builder6/server 0.7.11 → 0.8.0
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/dist/b6.server.d.ts +0 -1
- package/dist/b6.server.js +2 -135
- package/dist/b6.server.js.map +1 -1
- package/dist/bootstrap.d.ts +1 -0
- package/dist/{app.express.js → bootstrap.js} +4 -4
- package/dist/bootstrap.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +1 -1
- package/dist/main.js +2 -7
- package/dist/main.js.map +1 -1
- package/package.json +9 -12
- package/dist/app.express.d.ts +0 -2
- package/dist/app.express.js.map +0 -1
package/dist/b6.server.d.ts
CHANGED
package/dist/b6.server.js
CHANGED
|
@@ -1,138 +1,5 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
"use strict";
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const core_1 = require("@builder6/core");
|
|
7
|
-
const childProcess = require('child_process');
|
|
8
|
-
var semver = require('semver');
|
|
9
|
-
if (!semver.satisfies(process.version, '>=14.0.0')) {
|
|
10
|
-
console.log('Unsupported version of Node.js:', process.version);
|
|
11
|
-
console.log('Node-RED requires Node.js v18 or later');
|
|
12
|
-
process.exit(1);
|
|
13
|
-
}
|
|
14
|
-
var util = require('util');
|
|
15
|
-
var nopt = require('nopt');
|
|
16
|
-
var path = require('path');
|
|
17
|
-
const os = require('os');
|
|
18
|
-
var knownOpts = {
|
|
19
|
-
help: Boolean,
|
|
20
|
-
port: Number,
|
|
21
|
-
config: [path],
|
|
22
|
-
title: String,
|
|
23
|
-
userDir: [path],
|
|
24
|
-
npmPackages: String,
|
|
25
|
-
verbose: Boolean,
|
|
26
|
-
safe: Boolean,
|
|
27
|
-
version: Boolean,
|
|
28
|
-
define: [String, Array],
|
|
29
|
-
};
|
|
30
|
-
var shortHands = {
|
|
31
|
-
'?': ['--help'],
|
|
32
|
-
p: ['--port'],
|
|
33
|
-
s: ['--config'],
|
|
34
|
-
t: ['--help'],
|
|
35
|
-
u: ['--userDir'],
|
|
36
|
-
n: ['--npmPackages'],
|
|
37
|
-
v: ['--verbose'],
|
|
38
|
-
D: ['--define'],
|
|
39
|
-
};
|
|
40
|
-
nopt.invalidHandler = function (k, v, t) {
|
|
41
|
-
};
|
|
42
|
-
var parsedArgs = nopt(knownOpts, shortHands, process.argv, 2);
|
|
43
|
-
const States = {
|
|
44
|
-
STOPPED: 'stopped',
|
|
45
|
-
LOADING: 'loading',
|
|
46
|
-
INSTALLING: 'installing',
|
|
47
|
-
STARTING: 'starting',
|
|
48
|
-
RUNNING: 'running',
|
|
49
|
-
SAFE: 'safe',
|
|
50
|
-
CRASHED: 'crashed',
|
|
51
|
-
STOPPING: 'stopping',
|
|
52
|
-
};
|
|
53
|
-
class B6Server {
|
|
54
|
-
constructor(parsedArgs) {
|
|
55
|
-
this.userDir = process.env.B6_PLUGIN_DIR;
|
|
56
|
-
this.logger = new common_1.Logger(B6Server.name);
|
|
57
|
-
this.state = States.STOPPED;
|
|
58
|
-
this.parsedArgs = parsedArgs || {};
|
|
59
|
-
this.targetState = States.RUNNING;
|
|
60
|
-
this.config = {};
|
|
61
|
-
this.startTimes = [];
|
|
62
|
-
this.runDurations = [];
|
|
63
|
-
this.exitCallback = null;
|
|
64
|
-
this.healthPoll = null;
|
|
65
|
-
this.resourcePoll = null;
|
|
66
|
-
this.cpuAuditLogged = 0;
|
|
67
|
-
this.memoryAuditLogged = 0;
|
|
68
|
-
}
|
|
69
|
-
async loadConfig() {
|
|
70
|
-
this.config = {
|
|
71
|
-
...(0, core_1.getEnvConfigs)(),
|
|
72
|
-
};
|
|
73
|
-
if (this.parsedArgs.help) {
|
|
74
|
-
console.log('B6 Server v' + project.version);
|
|
75
|
-
console.log('Usage: b6server [-v] [-?] [--config b6.config.js] [--userDir DIR]');
|
|
76
|
-
console.log(' [--port PORT] [--title TITLE] [--safe] [services]');
|
|
77
|
-
console.log('');
|
|
78
|
-
console.log('Options:');
|
|
79
|
-
console.log(' -p, --port port to listen on');
|
|
80
|
-
console.log(' -s, --config specified config file');
|
|
81
|
-
console.log(' -n, --npmPackages install specified npm packages');
|
|
82
|
-
console.log(' -u, --userDir use specified user directory');
|
|
83
|
-
console.log(' -v, --verbose enable verbose output');
|
|
84
|
-
console.log(' --safe enable safe mode');
|
|
85
|
-
console.log(' --version show version information');
|
|
86
|
-
console.log(' -?, --help show this help');
|
|
87
|
-
console.log('');
|
|
88
|
-
console.log('Documentation can be found at https://builder6.com');
|
|
89
|
-
process.exit();
|
|
90
|
-
}
|
|
91
|
-
console.log('Builder6 Server v' + project.version);
|
|
92
|
-
console.log('Node.js ' + process.version);
|
|
93
|
-
console.log(os.type() +
|
|
94
|
-
' ' +
|
|
95
|
-
os.release() +
|
|
96
|
-
' ' +
|
|
97
|
-
os.arch() +
|
|
98
|
-
' ' +
|
|
99
|
-
os.endianness());
|
|
100
|
-
if (this.parsedArgs.verbose) {
|
|
101
|
-
this.config.verbose = true;
|
|
102
|
-
}
|
|
103
|
-
if (this.parsedArgs.safe ||
|
|
104
|
-
(process.env.B6_ENABLE_SAFE_MODE &&
|
|
105
|
-
!/^false$/i.test(process.env.B6_ENABLE_SAFE_MODE))) {
|
|
106
|
-
this.config.safeMode = true;
|
|
107
|
-
}
|
|
108
|
-
if (this.parsedArgs.port !== undefined) {
|
|
109
|
-
this.config.port = this.parsedArgs.port;
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
if (this.config.port === undefined) {
|
|
113
|
-
this.config.port = 5100;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
this.config.plugin = this.config.plugin || {
|
|
117
|
-
dir: process.env.B6_PLUGIN_DIR,
|
|
118
|
-
};
|
|
119
|
-
if (this.parsedArgs.npmPackages !== undefined) {
|
|
120
|
-
this.config.plugin.packages = this.parsedArgs.npmPackages;
|
|
121
|
-
}
|
|
122
|
-
if (this.parsedArgs.argv.remain.length > 0) {
|
|
123
|
-
this.config.plugin.services = this.parsedArgs.argv.remain[0];
|
|
124
|
-
}
|
|
125
|
-
this.logger.log('Loaded config', this.config);
|
|
126
|
-
}
|
|
127
|
-
async startApp() {
|
|
128
|
-
const ExpressApplication = require('./app.express');
|
|
129
|
-
this.app = await ExpressApplication.default();
|
|
130
|
-
await this.app.listen(this.config.port);
|
|
131
|
-
}
|
|
132
|
-
async bootstrap() {
|
|
133
|
-
await this.startApp();
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
const server = new B6Server(parsedArgs);
|
|
137
|
-
server.bootstrap();
|
|
3
|
+
const bootstrap_1 = require("./bootstrap");
|
|
4
|
+
(0, bootstrap_1.bootstrap)();
|
|
138
5
|
//# sourceMappingURL=b6.server.js.map
|
package/dist/b6.server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"b6.server.js","sourceRoot":"","sources":["../src/b6.server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"b6.server.js","sourceRoot":"","sources":["../src/b6.server.ts"],"names":[],"mappings":";;AAAA,2CAAsC;AAEtC,IAAA,qBAAS,GAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function bootstrap(): Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.bootstrap = bootstrap;
|
|
4
4
|
const core_1 = require("@nestjs/core");
|
|
5
5
|
const app_module_1 = require("./app.module");
|
|
6
6
|
const path_1 = require("path");
|
|
@@ -11,7 +11,7 @@ const express_1 = require("express");
|
|
|
11
11
|
const platform_ws_1 = require("@nestjs/platform-ws");
|
|
12
12
|
const session = require("express-session");
|
|
13
13
|
const project = require("../package.json");
|
|
14
|
-
async function
|
|
14
|
+
async function bootstrap() {
|
|
15
15
|
const app = await core_1.NestFactory.create(app_module_1.AppModule);
|
|
16
16
|
app.useWebSocketAdapter(new platform_ws_1.WsAdapter(app));
|
|
17
17
|
app.enableCors({
|
|
@@ -40,6 +40,6 @@ async function ExpressApplication() {
|
|
|
40
40
|
app.use((0, express_1.json)({ limit: '50mb' }));
|
|
41
41
|
app.use((0, express_1.urlencoded)({ extended: true, limit: '100mb', parameterLimit: 1000000 }));
|
|
42
42
|
app.use(compression());
|
|
43
|
-
|
|
43
|
+
await app.listen(process.env.B6_PORT ?? 5100);
|
|
44
44
|
}
|
|
45
|
-
//# sourceMappingURL=
|
|
45
|
+
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":";;AAaA,8BAwCC;AArDD,uCAA2C;AAC3C,6CAAyC;AACzC,+BAA4B;AAE5B,6CAAiE;AACjE,8CAA8C;AAC9C,2CAA2C;AAC3C,qCAA2C;AAC3C,qDAAgD;AAEhD,2CAA2C;AAC3C,2CAA2C;AAEpC,KAAK,UAAU,SAAS;IAC7B,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAyB,sBAAS,CAAC,CAAC;IACxE,GAAG,CAAC,mBAAmB,CAAC,IAAI,uBAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5C,GAAG,CAAC,UAAU,CAAC;QACb,MAAM,EAAE,UAAU,MAAM,EAAE,QAAQ;YAChC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACvB,CAAC;QACD,OAAO,EAAE,oCAAoC;QAC7C,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;IACH,GAAG,CAAC,GAAG,CACL,OAAO,CAAC;QACN,MAAM,EAAE,qBAAqB;QAC7B,MAAM,EAAE,KAAK;QACb,iBAAiB,EAAE,KAAK;KACzB,CAAC,CACH,CAAC;IAEF,MAAM,aAAa,GAAG,IAAI,yBAAe,EAAE;SACxC,QAAQ,CAAC,cAAc,CAAC;SACxB,cAAc,CAAC,8BAA8B,CAAC;SAC9C,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC;SAC3B,aAAa,EAAE;SACf,KAAK,EAAE,CAAC;IAEX,MAAM,eAAe,GAAG,GAAG,EAAE,CAC3B,uBAAa,CAAC,cAAc,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IACnD,uBAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,eAAe,CAAC,CAAC;IAEpD,GAAG,CAAC,eAAe,CAAC,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IACrD,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAEzB,GAAG,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC;IACxB,GAAG,CAAC,GAAG,CAAC,IAAA,cAAI,EAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IACjC,GAAG,CAAC,GAAG,CACL,IAAA,oBAAU,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC,CACxE,CAAC;IACF,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;IAEvB,MAAM,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC;AAChD,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './bootstrap';
|
package/dist/index.js
ADDED
|
@@ -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("./bootstrap"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B"}
|
package/dist/main.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
package/dist/main.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
async function bootstrap() {
|
|
6
|
-
const app = await (0, app_express_1.default)();
|
|
7
|
-
await app.listen(process.env.B6_PORT ?? 5100);
|
|
8
|
-
}
|
|
9
|
-
bootstrap();
|
|
3
|
+
const bootstrap_1 = require("./bootstrap");
|
|
4
|
+
(0, bootstrap_1.bootstrap)();
|
|
10
5
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;AAAA,2CAAsC;AAEtC,IAAA,qBAAS,GAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder6/server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "AGPL-3.0-only",
|
|
@@ -10,9 +10,6 @@
|
|
|
10
10
|
"views"
|
|
11
11
|
],
|
|
12
12
|
"main": "dist/index.js",
|
|
13
|
-
"bin": {
|
|
14
|
-
"b6server": "dist/b6.server.js"
|
|
15
|
-
},
|
|
16
13
|
"scripts": {
|
|
17
14
|
"build": "nest build",
|
|
18
15
|
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
@@ -29,13 +26,13 @@
|
|
|
29
26
|
"test:e2e": "jest --config ./test/jest-e2e.json"
|
|
30
27
|
},
|
|
31
28
|
"dependencies": {
|
|
32
|
-
"@builder6/core": "^0.
|
|
33
|
-
"@builder6/email": "^0.
|
|
34
|
-
"@builder6/moleculer": "^0.
|
|
35
|
-
"@builder6/pages": "^0.
|
|
36
|
-
"@builder6/query-mongodb": "^0.
|
|
37
|
-
"@builder6/rooms": "^0.
|
|
38
|
-
"@builder6/tables": "^0.
|
|
29
|
+
"@builder6/core": "^0.8.0",
|
|
30
|
+
"@builder6/email": "^0.8.0",
|
|
31
|
+
"@builder6/moleculer": "^0.8.0",
|
|
32
|
+
"@builder6/pages": "^0.8.0",
|
|
33
|
+
"@builder6/query-mongodb": "^0.8.0",
|
|
34
|
+
"@builder6/rooms": "^0.8.0",
|
|
35
|
+
"@builder6/tables": "^0.8.0",
|
|
39
36
|
"@nestjs/common": "^10.0.0",
|
|
40
37
|
"@nestjs/config": "^3.3.0",
|
|
41
38
|
"@nestjs/core": "^9.0.0",
|
|
@@ -117,5 +114,5 @@
|
|
|
117
114
|
"publishConfig": {
|
|
118
115
|
"access": "public"
|
|
119
116
|
},
|
|
120
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "22f6497633035f6a0f073dcfeb9fb35bbf75cf9a"
|
|
121
118
|
}
|
package/dist/app.express.d.ts
DELETED
package/dist/app.express.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app.express.js","sourceRoot":"","sources":["../src/app.express.ts"],"names":[],"mappings":";;AAaA,qCAwCC;AArDD,uCAA2C;AAC3C,6CAAyC;AACzC,+BAA4B;AAE5B,6CAAiE;AACjE,8CAA8C;AAC9C,2CAA2C;AAC3C,qCAA2C;AAC3C,qDAAgD;AAEhD,2CAA2C;AAC3C,2CAA2C;AAE5B,KAAK,UAAU,kBAAkB;IAC9C,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAyB,sBAAS,CAAC,CAAC;IACxE,GAAG,CAAC,mBAAmB,CAAC,IAAI,uBAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5C,GAAG,CAAC,UAAU,CAAC;QACb,MAAM,EAAE,UAAU,MAAM,EAAE,QAAQ;YAChC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACvB,CAAC;QACD,OAAO,EAAE,oCAAoC;QAC7C,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;IACH,GAAG,CAAC,GAAG,CACL,OAAO,CAAC;QACN,MAAM,EAAE,qBAAqB;QAC7B,MAAM,EAAE,KAAK;QACb,iBAAiB,EAAE,KAAK;KACzB,CAAC,CACH,CAAC;IAEF,MAAM,aAAa,GAAG,IAAI,yBAAe,EAAE;SACxC,QAAQ,CAAC,cAAc,CAAC;SACxB,cAAc,CAAC,8BAA8B,CAAC;SAC9C,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC;SAC3B,aAAa,EAAE;SACf,KAAK,EAAE,CAAC;IAEX,MAAM,eAAe,GAAG,GAAG,EAAE,CAC3B,uBAAa,CAAC,cAAc,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IACnD,uBAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,eAAe,CAAC,CAAC;IAEpD,GAAG,CAAC,eAAe,CAAC,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IACrD,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAEzB,GAAG,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC;IACxB,GAAG,CAAC,GAAG,CAAC,IAAA,cAAI,EAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IACjC,GAAG,CAAC,GAAG,CACL,IAAA,oBAAU,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC,CACxE,CAAC;IACF,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;IAEvB,OAAO,GAAG,CAAC;AACb,CAAC"}
|