@whyour/qinglong 0.19.7 → 0.19.8
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/package.json +1 -1
- package/static/build/data/auth.js +0 -36
- package/static/build/protos/system.js +0 -112
- package/static/build/system.js +0 -32
package/package.json
CHANGED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AuthModel = exports.AuthDataType = exports.LoginStatus = exports.AuthInfo = void 0;
|
|
4
|
-
const _1 = require(".");
|
|
5
|
-
const sequelize_1 = require("sequelize");
|
|
6
|
-
class AuthInfo {
|
|
7
|
-
constructor(options) {
|
|
8
|
-
this.ip = options.ip;
|
|
9
|
-
this.info = options.info;
|
|
10
|
-
this.type = options.type;
|
|
11
|
-
this.id = options.id;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.AuthInfo = AuthInfo;
|
|
15
|
-
var LoginStatus;
|
|
16
|
-
(function (LoginStatus) {
|
|
17
|
-
LoginStatus[LoginStatus["success"] = 0] = "success";
|
|
18
|
-
LoginStatus[LoginStatus["fail"] = 1] = "fail";
|
|
19
|
-
})(LoginStatus || (exports.LoginStatus = LoginStatus = {}));
|
|
20
|
-
var AuthDataType;
|
|
21
|
-
(function (AuthDataType) {
|
|
22
|
-
AuthDataType["loginLog"] = "loginLog";
|
|
23
|
-
AuthDataType["authToken"] = "authToken";
|
|
24
|
-
AuthDataType["notification"] = "notification";
|
|
25
|
-
AuthDataType["removeLogFrequency"] = "removeLogFrequency";
|
|
26
|
-
AuthDataType["systemConfig"] = "systemConfig";
|
|
27
|
-
})(AuthDataType || (exports.AuthDataType = AuthDataType = {}));
|
|
28
|
-
exports.AuthModel = _1.sequelize.define('Auth', {
|
|
29
|
-
ip: sequelize_1.DataTypes.STRING,
|
|
30
|
-
type: sequelize_1.DataTypes.STRING,
|
|
31
|
-
info: {
|
|
32
|
-
type: sequelize_1.DataTypes.JSON,
|
|
33
|
-
allowNull: true,
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
//# sourceMappingURL=auth.js.map
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SystemClient = exports.SystemService = exports.SystemRunResponse = exports.SystemRunRequest = exports.protobufPackage = void 0;
|
|
7
|
-
/* eslint-disable */
|
|
8
|
-
const grpc_js_1 = require("@grpc/grpc-js");
|
|
9
|
-
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
-
exports.protobufPackage = "com.ql.system";
|
|
11
|
-
function createBaseSystemRunRequest() {
|
|
12
|
-
return { command: "" };
|
|
13
|
-
}
|
|
14
|
-
exports.SystemRunRequest = {
|
|
15
|
-
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
16
|
-
if (message.command !== "") {
|
|
17
|
-
writer.uint32(10).string(message.command);
|
|
18
|
-
}
|
|
19
|
-
return writer;
|
|
20
|
-
},
|
|
21
|
-
decode(input, length) {
|
|
22
|
-
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
23
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
24
|
-
const message = createBaseSystemRunRequest();
|
|
25
|
-
while (reader.pos < end) {
|
|
26
|
-
const tag = reader.uint32();
|
|
27
|
-
switch (tag >>> 3) {
|
|
28
|
-
case 1:
|
|
29
|
-
if (tag !== 10) {
|
|
30
|
-
break;
|
|
31
|
-
}
|
|
32
|
-
message.command = reader.string();
|
|
33
|
-
continue;
|
|
34
|
-
}
|
|
35
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
reader.skipType(tag & 7);
|
|
39
|
-
}
|
|
40
|
-
return message;
|
|
41
|
-
},
|
|
42
|
-
fromJSON(object) {
|
|
43
|
-
return { command: isSet(object.command) ? String(object.command) : "" };
|
|
44
|
-
},
|
|
45
|
-
toJSON(message) {
|
|
46
|
-
const obj = {};
|
|
47
|
-
message.command !== undefined && (obj.command = message.command);
|
|
48
|
-
return obj;
|
|
49
|
-
},
|
|
50
|
-
create(base) {
|
|
51
|
-
return exports.SystemRunRequest.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
52
|
-
},
|
|
53
|
-
fromPartial(object) {
|
|
54
|
-
var _a;
|
|
55
|
-
const message = createBaseSystemRunRequest();
|
|
56
|
-
message.command = (_a = object.command) !== null && _a !== void 0 ? _a : "";
|
|
57
|
-
return message;
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
function createBaseSystemRunResponse() {
|
|
61
|
-
return {};
|
|
62
|
-
}
|
|
63
|
-
exports.SystemRunResponse = {
|
|
64
|
-
encode(_, writer = minimal_1.default.Writer.create()) {
|
|
65
|
-
return writer;
|
|
66
|
-
},
|
|
67
|
-
decode(input, length) {
|
|
68
|
-
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
69
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
70
|
-
const message = createBaseSystemRunResponse();
|
|
71
|
-
while (reader.pos < end) {
|
|
72
|
-
const tag = reader.uint32();
|
|
73
|
-
switch (tag >>> 3) {
|
|
74
|
-
}
|
|
75
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
reader.skipType(tag & 7);
|
|
79
|
-
}
|
|
80
|
-
return message;
|
|
81
|
-
},
|
|
82
|
-
fromJSON(_) {
|
|
83
|
-
return {};
|
|
84
|
-
},
|
|
85
|
-
toJSON(_) {
|
|
86
|
-
const obj = {};
|
|
87
|
-
return obj;
|
|
88
|
-
},
|
|
89
|
-
create(base) {
|
|
90
|
-
return exports.SystemRunResponse.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
91
|
-
},
|
|
92
|
-
fromPartial(_) {
|
|
93
|
-
const message = createBaseSystemRunResponse();
|
|
94
|
-
return message;
|
|
95
|
-
},
|
|
96
|
-
};
|
|
97
|
-
exports.SystemService = {
|
|
98
|
-
run: {
|
|
99
|
-
path: "/com.ql.system.System/Run",
|
|
100
|
-
requestStream: false,
|
|
101
|
-
responseStream: false,
|
|
102
|
-
requestSerialize: (value) => Buffer.from(exports.SystemRunRequest.encode(value).finish()),
|
|
103
|
-
requestDeserialize: (value) => exports.SystemRunRequest.decode(value),
|
|
104
|
-
responseSerialize: (value) => Buffer.from(exports.SystemRunResponse.encode(value).finish()),
|
|
105
|
-
responseDeserialize: (value) => exports.SystemRunResponse.decode(value),
|
|
106
|
-
},
|
|
107
|
-
};
|
|
108
|
-
exports.SystemClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.SystemService, "com.ql.system.System");
|
|
109
|
-
function isSet(value) {
|
|
110
|
-
return value !== null && value !== undefined;
|
|
111
|
-
}
|
|
112
|
-
//# sourceMappingURL=system.js.map
|
package/static/build/system.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const grpc_js_1 = require("@grpc/grpc-js");
|
|
7
|
-
const logger_1 = __importDefault(require("./loaders/logger"));
|
|
8
|
-
const system_1 = require("./protos/system");
|
|
9
|
-
const cross_spawn_1 = __importDefault(require("cross-spawn"));
|
|
10
|
-
const server = new grpc_js_1.Server({ 'grpc.enable_http_proxy': 0 });
|
|
11
|
-
server.addService(system_1.SystemService, {
|
|
12
|
-
run: async (call, callback) => {
|
|
13
|
-
if (call.request.command) {
|
|
14
|
-
const cp = (0, cross_spawn_1.default)(call.request.command, {
|
|
15
|
-
shell: '/bin/bash',
|
|
16
|
-
detached: true,
|
|
17
|
-
});
|
|
18
|
-
cp.unref();
|
|
19
|
-
return callback(null, { code: 200 });
|
|
20
|
-
}
|
|
21
|
-
return callback(null, { status: 1 });
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
server.bindAsync(`0.0.0.0:33445`, grpc_js_1.ServerCredentials.createInsecure(), (err, port) => {
|
|
25
|
-
if (err) {
|
|
26
|
-
throw err;
|
|
27
|
-
}
|
|
28
|
-
server.start();
|
|
29
|
-
logger_1.default.debug(`✌️ 系统服务启动成功!`);
|
|
30
|
-
console.debug(`✌️ 系统服务启动成功!`);
|
|
31
|
-
});
|
|
32
|
-
//# sourceMappingURL=system.js.map
|