@maiyunnet/kebab 2.0.10 → 2.0.11
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/index.d.ts +3 -1
- package/index.js +3 -1
- package/lib/captcha.js +2 -2
- package/lib/consistent.js +1 -1
- package/lib/core.d.ts +3 -3
- package/lib/core.js +8 -8
- package/lib/crypto.js +2 -2
- package/lib/db.d.ts +2 -2
- package/lib/db.js +5 -5
- package/lib/dns.d.ts +1 -1
- package/lib/dns.js +5 -5
- package/lib/jwt.d.ts +3 -3
- package/lib/jwt.js +4 -4
- package/lib/kv.d.ts +2 -2
- package/lib/kv.js +2 -2
- package/lib/lan.js +1 -1
- package/lib/net/formdata.js +2 -2
- package/lib/net/request.d.ts +1 -1
- package/lib/net/request.js +1 -1
- package/lib/net/response.d.ts +1 -1
- package/lib/net.d.ts +2 -2
- package/lib/net.js +4 -4
- package/lib/s3.d.ts +1 -1
- package/lib/s3.js +2 -2
- package/lib/scan.d.ts +3 -3
- package/lib/scan.js +6 -6
- package/lib/session.d.ts +3 -3
- package/lib/session.js +6 -6
- package/lib/sql.d.ts +2 -2
- package/lib/sql.js +3 -3
- package/lib/ssh/sftp.js +2 -2
- package/lib/ssh/shell.js +1 -1
- package/lib/text.d.ts +1 -1
- package/lib/text.js +1 -1
- package/lib/time.d.ts +1 -1
- package/lib/time.js +1 -1
- package/lib/turnstile.d.ts +15 -0
- package/lib/turnstile.js +108 -0
- package/lib/ws.d.ts +2 -2
- package/lib/ws.js +2 -2
- package/lib/zip.d.ts +1 -1
- package/lib/zip.js +1 -1
- package/package.json +1 -1
- package/sys/child.js +6 -6
- package/sys/cmd.js +16 -6
- package/sys/master.js +8 -8
- package/sys/mod.d.ts +4 -4
- package/sys/mod.js +5 -5
- package/sys/route.d.ts +1 -1
- package/sys/route.js +8 -8
- package/www/example/ctr/main.d.ts +1 -1
- package/www/example/ctr/main.js +1 -1
- package/www/example/ctr/middle.d.ts +2 -2
- package/www/example/ctr/middle.js +1 -1
- package/www/example/ctr/test.d.ts +2 -2
- package/www/example/ctr/test.js +21 -21
- package/www/example/mod/test.d.ts +2 -2
- package/www/example/mod/test.js +2 -2
- package/www/example/mod/testdata.d.ts +1 -1
- package/www/example/mod/testdata.js +1 -1
- package/www/example/ws/mproxy.d.ts +1 -1
- package/www/example/ws/mproxy.js +2 -2
- package/www/example/ws/rproxy.d.ts +1 -1
- package/www/example/ws/rproxy.js +2 -2
- package/www/example/ws/test.d.ts +1 -1
- package/www/example/ws/test.js +2 -2
package/index.d.ts
CHANGED
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
* Date: 2019-3-30 12:46:41
|
|
4
4
|
* Last: 2020-3-8 21:04:24, 2022-07-22 14:20:34, 2023-5-24 01:34:57, 2025-6-13 14:49:27
|
|
5
5
|
* --- 本文件用来定义每个目录实体地址的常量 ---
|
|
6
|
+
* ------------------------
|
|
6
7
|
* --- npx tsc-alias -w ---
|
|
8
|
+
* ------------------------
|
|
7
9
|
*/
|
|
8
10
|
/** --- 当前系统版本号 --- */
|
|
9
|
-
export declare const VER = "2.0.
|
|
11
|
+
export declare const VER = "2.0.11";
|
|
10
12
|
/** --- 框架根目录,以 / 结尾 --- */
|
|
11
13
|
export declare const ROOT_PATH: string;
|
|
12
14
|
export declare const LIB_PATH: string;
|
package/index.js
CHANGED
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
* Date: 2019-3-30 12:46:41
|
|
5
5
|
* Last: 2020-3-8 21:04:24, 2022-07-22 14:20:34, 2023-5-24 01:34:57, 2025-6-13 14:49:27
|
|
6
6
|
* --- 本文件用来定义每个目录实体地址的常量 ---
|
|
7
|
+
* ------------------------
|
|
7
8
|
* --- npx tsc-alias -w ---
|
|
9
|
+
* ------------------------
|
|
8
10
|
*/
|
|
9
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
12
|
exports.MOD_CWD = exports.FTMP_CWD = exports.IND_CWD = exports.WWW_CWD = exports.LOG_CWD = exports.LIB_CWD = exports.VHOST_CWD = exports.CERT_CWD = exports.CONF_CWD = exports.ROOT_CWD = exports.SYS_PATH = exports.LIB_PATH = exports.ROOT_PATH = exports.VER = void 0;
|
|
11
13
|
/** --- 当前系统版本号 --- */
|
|
12
|
-
exports.VER = '2.0.
|
|
14
|
+
exports.VER = '2.0.11';
|
|
13
15
|
// --- 服务端用的路径 ---
|
|
14
16
|
/** --- /xxx/xxx --- */
|
|
15
17
|
const dirname = __dirname.replace(/\\/g, '/');
|
package/lib/captcha.js
CHANGED
|
@@ -42,8 +42,8 @@ exports.get = get;
|
|
|
42
42
|
*/
|
|
43
43
|
const svgCaptcha = __importStar(require("svg-captcha"));
|
|
44
44
|
const mime = __importStar(require("@litert/mime"));
|
|
45
|
-
const core = __importStar(require("
|
|
46
|
-
const kebab = __importStar(require("
|
|
45
|
+
const core = __importStar(require("../lib/core"));
|
|
46
|
+
const kebab = __importStar(require("../index"));
|
|
47
47
|
svgCaptcha.loadFont(kebab.LIB_PATH + 'captcha/zcool-addict-italic.ttf');
|
|
48
48
|
class Captcha {
|
|
49
49
|
constructor(opt) {
|
package/lib/consistent.js
CHANGED
|
@@ -45,7 +45,7 @@ exports.findInCircle = findInCircle;
|
|
|
45
45
|
* Date: 2022-09-12 10:51:16
|
|
46
46
|
* Last: 2022-09-12 10:51:20, 2023-3-17 10:52:04, 2023-11-15 11:45:28
|
|
47
47
|
*/
|
|
48
|
-
const crypto = __importStar(require("
|
|
48
|
+
const crypto = __importStar(require("../lib/crypto"));
|
|
49
49
|
class Consistent {
|
|
50
50
|
constructor(vcount) {
|
|
51
51
|
/** --- 虚拟节点数量 --- */
|
package/lib/core.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as http from 'http';
|
|
2
2
|
import * as http2 from 'http2';
|
|
3
3
|
import * as stream from 'stream';
|
|
4
|
-
import * as lResponse from '
|
|
5
|
-
import * as sCtr from '
|
|
6
|
-
import * as types from '
|
|
4
|
+
import * as lResponse from '../lib/net/response';
|
|
5
|
+
import * as sCtr from '../sys/ctr';
|
|
6
|
+
import * as types from '../types';
|
|
7
7
|
/** --- 全局参数 --- */
|
|
8
8
|
export declare const globalConfig: types.IConfig & {
|
|
9
9
|
'httpPort': number;
|
package/lib/core.js
CHANGED
|
@@ -66,14 +66,14 @@ exports.display = display;
|
|
|
66
66
|
*/
|
|
67
67
|
const cp = __importStar(require("child_process"));
|
|
68
68
|
const stream = __importStar(require("stream"));
|
|
69
|
-
const lTime = __importStar(require("
|
|
70
|
-
const lFs = __importStar(require("
|
|
71
|
-
const lText = __importStar(require("
|
|
72
|
-
const lNet = __importStar(require("
|
|
73
|
-
const lCrypto = __importStar(require("
|
|
74
|
-
const lResponse = __importStar(require("
|
|
75
|
-
const sCtr = __importStar(require("
|
|
76
|
-
const kebab = __importStar(require("
|
|
69
|
+
const lTime = __importStar(require("../lib/time"));
|
|
70
|
+
const lFs = __importStar(require("../lib/fs"));
|
|
71
|
+
const lText = __importStar(require("../lib/text"));
|
|
72
|
+
const lNet = __importStar(require("../lib/net"));
|
|
73
|
+
const lCrypto = __importStar(require("../lib/crypto"));
|
|
74
|
+
const lResponse = __importStar(require("../lib/net/response"));
|
|
75
|
+
const sCtr = __importStar(require("../sys/ctr"));
|
|
76
|
+
const kebab = __importStar(require("../index"));
|
|
77
77
|
/** --- 全局参数 --- */
|
|
78
78
|
exports.globalConfig = {};
|
|
79
79
|
/**
|
package/lib/crypto.js
CHANGED
|
@@ -61,8 +61,8 @@ exports.uuid = uuid;
|
|
|
61
61
|
*/
|
|
62
62
|
const crypto = __importStar(require("crypto"));
|
|
63
63
|
// --- 库和定义 ---
|
|
64
|
-
const lFs = __importStar(require("
|
|
65
|
-
const lCore = __importStar(require("
|
|
64
|
+
const lFs = __importStar(require("../lib/fs"));
|
|
65
|
+
const lCore = __importStar(require("../lib/core"));
|
|
66
66
|
// --- 非对称加密 ---
|
|
67
67
|
/**
|
|
68
68
|
* --- 创建非对称秘钥 ---
|
package/lib/db.d.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Last: 2020-4-13 15:34:45, 2022-09-12 13:10:34, 2023-5-24 18:29:38, 2024-7-11 14:37:54, 2024-8-25 00:32:53, 2024-9-22 17:30:47
|
|
5
5
|
*/
|
|
6
6
|
import * as mysql2 from 'mysql2/promise';
|
|
7
|
-
import * as ctr from '
|
|
8
|
-
import * as types from '
|
|
7
|
+
import * as ctr from '../sys/ctr';
|
|
8
|
+
import * as types from '../types';
|
|
9
9
|
/** --- query 返回的数据 --- */
|
|
10
10
|
export interface IData {
|
|
11
11
|
'rows': any[] | null;
|
package/lib/db.js
CHANGED
|
@@ -45,11 +45,11 @@ exports.getConnectionList = getConnectionList;
|
|
|
45
45
|
// --- 第三方 ---
|
|
46
46
|
const mysql2 = __importStar(require("mysql2/promise"));
|
|
47
47
|
// --- 库和定义 ---
|
|
48
|
-
const time = __importStar(require("
|
|
49
|
-
const lSql = __importStar(require("
|
|
50
|
-
const core = __importStar(require("
|
|
51
|
-
const text = __importStar(require("
|
|
52
|
-
const ctr = __importStar(require("
|
|
48
|
+
const time = __importStar(require("../lib/time"));
|
|
49
|
+
const lSql = __importStar(require("../lib/sql"));
|
|
50
|
+
const core = __importStar(require("../lib/core"));
|
|
51
|
+
const text = __importStar(require("../lib/text"));
|
|
52
|
+
const ctr = __importStar(require("../sys/ctr"));
|
|
53
53
|
/** --- 连接列表池 --- */
|
|
54
54
|
const connections = [];
|
|
55
55
|
/**
|
package/lib/dns.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Date: 2019-6-19
|
|
4
4
|
* Last: 2022-09-12 20:58:07, 2024-2-21 17:55:54, 2025-6-13 19:08:56
|
|
5
5
|
*/
|
|
6
|
-
import * as ctr from '
|
|
6
|
+
import * as ctr from '../sys/ctr';
|
|
7
7
|
/**
|
|
8
8
|
* 0.DNSPod:https://www.dnspod.cn/docs/index.html(腾讯云也请使用 DNSPod 的 API)
|
|
9
9
|
* 1.阿里云:https://help.aliyun.com/document_detail/29745.html
|
package/lib/dns.js
CHANGED
|
@@ -41,11 +41,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
41
41
|
exports.Dns = exports.ERecordLine = exports.RECORD_TYPE = exports.ESERVICE = void 0;
|
|
42
42
|
exports.get = get;
|
|
43
43
|
// --- 库和定义 ---
|
|
44
|
-
const net = __importStar(require("
|
|
45
|
-
const core = __importStar(require("
|
|
46
|
-
const text = __importStar(require("
|
|
47
|
-
const crypto = __importStar(require("
|
|
48
|
-
const response = __importStar(require("
|
|
44
|
+
const net = __importStar(require("../lib/net"));
|
|
45
|
+
const core = __importStar(require("../lib/core"));
|
|
46
|
+
const text = __importStar(require("../lib/text"));
|
|
47
|
+
const crypto = __importStar(require("../lib/crypto"));
|
|
48
|
+
const response = __importStar(require("../lib/net/response"));
|
|
49
49
|
/**
|
|
50
50
|
* 0.DNSPod:https://www.dnspod.cn/docs/index.html(腾讯云也请使用 DNSPod 的 API)
|
|
51
51
|
* 1.阿里云:https://help.aliyun.com/document_detail/29745.html
|
package/lib/jwt.d.ts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Date: 2023-1-31 20:34:47
|
|
4
4
|
* Last: 2023-1-31 20:34:47, 2023-12-8 13:55:09
|
|
5
5
|
*/
|
|
6
|
-
import * as kv from '
|
|
7
|
-
import * as ctr from '
|
|
8
|
-
import * as types from '
|
|
6
|
+
import * as kv from '../lib/kv';
|
|
7
|
+
import * as ctr from '../sys/ctr';
|
|
8
|
+
import * as types from '../types';
|
|
9
9
|
export interface IOptions {
|
|
10
10
|
'name'?: string;
|
|
11
11
|
'ttl'?: number;
|
package/lib/jwt.js
CHANGED
|
@@ -44,10 +44,10 @@ exports.decode = decode;
|
|
|
44
44
|
exports.block = block;
|
|
45
45
|
exports.get = get;
|
|
46
46
|
// --- 库和定义 ---
|
|
47
|
-
const lCore = __importStar(require("
|
|
48
|
-
const lTime = __importStar(require("
|
|
49
|
-
const lText = __importStar(require("
|
|
50
|
-
const lCrypto = __importStar(require("
|
|
47
|
+
const lCore = __importStar(require("../lib/core"));
|
|
48
|
+
const lTime = __importStar(require("../lib/time"));
|
|
49
|
+
const lText = __importStar(require("../lib/text"));
|
|
50
|
+
const lCrypto = __importStar(require("../lib/crypto"));
|
|
51
51
|
class Jwt {
|
|
52
52
|
/**
|
|
53
53
|
* --- 初始化函数,相当于 construct ---
|
package/lib/kv.d.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Last: 2020-3-28 18:54:04, 2022-09-12 23:24:45, 2022-09-22 01:06:22, 2024-2-21 13:32:56, 2024-8-21 16:59:57
|
|
5
5
|
*/
|
|
6
6
|
import * as redis from '@litert/redis';
|
|
7
|
-
import * as ctr from '
|
|
8
|
-
import * as types from '
|
|
7
|
+
import * as ctr from '../sys/ctr';
|
|
8
|
+
import * as types from '../types';
|
|
9
9
|
/** --- 连接信息 --- */
|
|
10
10
|
export interface IConnectionInfo {
|
|
11
11
|
'id': number;
|
package/lib/kv.js
CHANGED
|
@@ -46,8 +46,8 @@ exports.getConnectionList = getConnectionList;
|
|
|
46
46
|
// --- 第三方 ---
|
|
47
47
|
const redis = __importStar(require("@litert/redis"));
|
|
48
48
|
// --- 库和定义 ---
|
|
49
|
-
const time = __importStar(require("
|
|
50
|
-
const text = __importStar(require("
|
|
49
|
+
const time = __importStar(require("../lib/time"));
|
|
50
|
+
const text = __importStar(require("../lib/text"));
|
|
51
51
|
/** --- 连接列表(同一个 host、port、index、auth 只有一个连接) --- */
|
|
52
52
|
const connections = [];
|
|
53
53
|
/**
|
package/lib/lan.js
CHANGED
|
@@ -36,7 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.card = card;
|
|
37
37
|
exports.scan = scan;
|
|
38
38
|
const os = __importStar(require("os"));
|
|
39
|
-
const lCore = __importStar(require("
|
|
39
|
+
const lCore = __importStar(require("../lib/core"));
|
|
40
40
|
/**
|
|
41
41
|
* --- 获取当前网卡的 IP、MAC 信息 ---
|
|
42
42
|
*/
|
package/lib/net/formdata.js
CHANGED
|
@@ -41,8 +41,8 @@ exports.FormData = void 0;
|
|
|
41
41
|
*/
|
|
42
42
|
const stream = __importStar(require("stream"));
|
|
43
43
|
const mime = __importStar(require("@litert/mime"));
|
|
44
|
-
const core = __importStar(require("
|
|
45
|
-
const fs = __importStar(require("
|
|
44
|
+
const core = __importStar(require("../../lib/core"));
|
|
45
|
+
const fs = __importStar(require("../../lib/fs"));
|
|
46
46
|
class FormData extends stream.Readable {
|
|
47
47
|
constructor() {
|
|
48
48
|
super(...arguments);
|
package/lib/net/request.d.ts
CHANGED
package/lib/net/request.js
CHANGED
|
@@ -34,7 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.Request = void 0;
|
|
37
|
-
const net = __importStar(require("
|
|
37
|
+
const net = __importStar(require("../../lib/net"));
|
|
38
38
|
class Request {
|
|
39
39
|
constructor(url) {
|
|
40
40
|
/** --- get 或 post 的数据 --- */
|
package/lib/net/response.d.ts
CHANGED
package/lib/net.d.ts
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
import * as stream from 'stream';
|
|
8
8
|
import * as http from 'http';
|
|
9
9
|
import * as http2 from 'http2';
|
|
10
|
-
import * as ctr from '
|
|
11
|
-
import * as types from '
|
|
10
|
+
import * as ctr from '../sys/ctr';
|
|
11
|
+
import * as types from '../types';
|
|
12
12
|
import * as fd from './net/formdata';
|
|
13
13
|
import * as lRequest from './net/request';
|
|
14
14
|
import * as response from './net/response';
|
package/lib/net.js
CHANGED
|
@@ -57,10 +57,10 @@ const stream = __importStar(require("stream"));
|
|
|
57
57
|
// --- 第三方 ---
|
|
58
58
|
const hc = __importStar(require("@litert/http-client"));
|
|
59
59
|
// --- 库和定义 ---
|
|
60
|
-
const fs = __importStar(require("
|
|
61
|
-
const text = __importStar(require("
|
|
62
|
-
const time = __importStar(require("
|
|
63
|
-
const kebab = __importStar(require("
|
|
60
|
+
const fs = __importStar(require("../lib/fs"));
|
|
61
|
+
const text = __importStar(require("../lib/text"));
|
|
62
|
+
const time = __importStar(require("../lib/time"));
|
|
63
|
+
const kebab = __importStar(require("../index"));
|
|
64
64
|
// --- 自己 ---
|
|
65
65
|
const fd = __importStar(require("./net/formdata"));
|
|
66
66
|
const lRequest = __importStar(require("./net/request"));
|
package/lib/s3.d.ts
CHANGED
package/lib/s3.js
CHANGED
|
@@ -43,8 +43,8 @@ exports.get = get;
|
|
|
43
43
|
// --- 库和定义 ---
|
|
44
44
|
const s3 = __importStar(require("@aws-sdk/client-s3"));
|
|
45
45
|
const ls = __importStar(require("@aws-sdk/lib-storage"));
|
|
46
|
-
const lCore = __importStar(require("
|
|
47
|
-
const lText = __importStar(require("
|
|
46
|
+
const lCore = __importStar(require("../lib/core"));
|
|
47
|
+
const lText = __importStar(require("../lib/text"));
|
|
48
48
|
/**
|
|
49
49
|
* s3 文档:https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3/
|
|
50
50
|
*/
|
package/lib/scan.d.ts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Date: 2022-09-24 15:23:25
|
|
4
4
|
* Last: 2022-09-24 15:23:25, 2022-9-26 12:37:01, 2022-12-29 00:11:16
|
|
5
5
|
*/
|
|
6
|
-
import * as lDb from '
|
|
7
|
-
import * as lKv from '
|
|
8
|
-
import * as sCtr from '
|
|
6
|
+
import * as lDb from '../lib/db';
|
|
7
|
+
import * as lKv from '../lib/kv';
|
|
8
|
+
import * as sCtr from '../sys/ctr';
|
|
9
9
|
/** --- Scan 设置的选项 --- */
|
|
10
10
|
export interface IOptions {
|
|
11
11
|
'ttl'?: number;
|
package/lib/scan.js
CHANGED
|
@@ -56,12 +56,12 @@ CREATE TABLE IF NOT EXISTS `scan` (
|
|
|
56
56
|
KEY `time_exp` (`time_exp`)
|
|
57
57
|
) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci
|
|
58
58
|
*/
|
|
59
|
-
const lCore = __importStar(require("
|
|
60
|
-
const lDb = __importStar(require("
|
|
61
|
-
const lKv = __importStar(require("
|
|
62
|
-
const lSql = __importStar(require("
|
|
63
|
-
const lTime = __importStar(require("
|
|
64
|
-
const lText = __importStar(require("
|
|
59
|
+
const lCore = __importStar(require("../lib/core"));
|
|
60
|
+
const lDb = __importStar(require("../lib/db"));
|
|
61
|
+
const lKv = __importStar(require("../lib/kv"));
|
|
62
|
+
const lSql = __importStar(require("../lib/sql"));
|
|
63
|
+
const lTime = __importStar(require("../lib/time"));
|
|
64
|
+
const lText = __importStar(require("../lib/text"));
|
|
65
65
|
class Scan {
|
|
66
66
|
constructor(link, token, opt = {}) {
|
|
67
67
|
this._sql = null;
|
package/lib/session.d.ts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Date: 2019-6-5 22:01:40
|
|
4
4
|
* Last: 2020-3-30 00:11:15, 2022-12-29 00:10:28, 2023-5-24 18:59:27
|
|
5
5
|
*/
|
|
6
|
-
import * as db from '
|
|
7
|
-
import * as kv from '
|
|
8
|
-
import * as ctr from '
|
|
6
|
+
import * as db from '../lib/db';
|
|
7
|
+
import * as kv from '../lib/kv';
|
|
8
|
+
import * as ctr from '../sys/ctr';
|
|
9
9
|
export interface IOptions {
|
|
10
10
|
'name'?: string;
|
|
11
11
|
'ttl'?: number;
|
package/lib/session.js
CHANGED
|
@@ -53,12 +53,12 @@ CREATE TABLE `session` (
|
|
|
53
53
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci
|
|
54
54
|
*/
|
|
55
55
|
// --- 库和定义 ---
|
|
56
|
-
const core = __importStar(require("
|
|
57
|
-
const time = __importStar(require("
|
|
58
|
-
const db = __importStar(require("
|
|
59
|
-
const kv = __importStar(require("
|
|
60
|
-
const sql = __importStar(require("
|
|
61
|
-
const text = __importStar(require("
|
|
56
|
+
const core = __importStar(require("../lib/core"));
|
|
57
|
+
const time = __importStar(require("../lib/time"));
|
|
58
|
+
const db = __importStar(require("../lib/db"));
|
|
59
|
+
const kv = __importStar(require("../lib/kv"));
|
|
60
|
+
const sql = __importStar(require("../lib/sql"));
|
|
61
|
+
const text = __importStar(require("../lib/text"));
|
|
62
62
|
class Session {
|
|
63
63
|
constructor() {
|
|
64
64
|
/** --- 当前 Session 的 token --- */
|
package/lib/sql.d.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Date: 2019-5-27 20:18:50
|
|
4
4
|
* Last: 2020-3-29 19:37:25, 2022-07-24 22:38:11, 2023-5-24 18:49:18, 2023-6-13 22:20:21, 2023-12-11 13:58:54, 2023-12-14 13:14:40, 2023-12-21 00:04:40, 2024-4-11 19:29:29, 2024-9-2 17:15:28
|
|
5
5
|
*/
|
|
6
|
-
import * as ctr from '
|
|
7
|
-
import * as types from '
|
|
6
|
+
import * as ctr from '../sys/ctr';
|
|
7
|
+
import * as types from '../types';
|
|
8
8
|
export declare class Sql {
|
|
9
9
|
/** --- 前置 --- */
|
|
10
10
|
private readonly _pre;
|
package/lib/sql.js
CHANGED
|
@@ -43,12 +43,12 @@ exports.get = get;
|
|
|
43
43
|
exports.format = format;
|
|
44
44
|
exports.aoMix = aoMix;
|
|
45
45
|
exports.column = column;
|
|
46
|
-
const lText = __importStar(require("
|
|
47
|
-
const lCore = __importStar(require("
|
|
46
|
+
const lText = __importStar(require("../lib/text"));
|
|
47
|
+
const lCore = __importStar(require("../lib/core"));
|
|
48
48
|
// --- 第三方 ---
|
|
49
49
|
const mysql2 = __importStar(require("mysql2/promise"));
|
|
50
50
|
// --- 库和定义 ---
|
|
51
|
-
const ctr = __importStar(require("
|
|
51
|
+
const ctr = __importStar(require("../sys/ctr"));
|
|
52
52
|
/** --- filed 用 token --- */
|
|
53
53
|
let columnToken = '';
|
|
54
54
|
class Sql {
|
package/lib/ssh/sftp.js
CHANGED
|
@@ -35,8 +35,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.Connection = void 0;
|
|
37
37
|
// --- 库和定义 ---
|
|
38
|
-
const core = __importStar(require("
|
|
39
|
-
const text = __importStar(require("
|
|
38
|
+
const core = __importStar(require("../../lib/core"));
|
|
39
|
+
const text = __importStar(require("../../lib/text"));
|
|
40
40
|
class Connection {
|
|
41
41
|
constructor(sftp, path) {
|
|
42
42
|
this._client = sftp;
|
package/lib/ssh/shell.js
CHANGED
|
@@ -34,7 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.Connection = void 0;
|
|
37
|
-
const lCore = __importStar(require("
|
|
37
|
+
const lCore = __importStar(require("../../lib/core"));
|
|
38
38
|
class Connection {
|
|
39
39
|
constructor(stream) {
|
|
40
40
|
this._client = stream;
|
package/lib/text.d.ts
CHANGED
package/lib/text.js
CHANGED
|
@@ -66,7 +66,7 @@ exports.int2str = int2str;
|
|
|
66
66
|
* Date: 2019-5-15 16:49:39
|
|
67
67
|
* Last: 2020-04-06 20:51:06, 2022-9-29 15:18:16, 2022-12-29 00:01:30, 2024-3-6 17:53:14, 2024-5-31 17:29:52, 2025-6-13 15:47:02
|
|
68
68
|
*/
|
|
69
|
-
const kebab = __importStar(require("
|
|
69
|
+
const kebab = __importStar(require("../index"));
|
|
70
70
|
const fs = __importStar(require("./fs"));
|
|
71
71
|
/**
|
|
72
72
|
* --- 将文件大小格式化为带单位的字符串 ---
|
package/lib/time.d.ts
CHANGED
package/lib/time.js
CHANGED
|
@@ -43,7 +43,7 @@ exports.format = format;
|
|
|
43
43
|
* Date: 2019-6-6 12:04:15
|
|
44
44
|
* Last: 2020-3-29 23:41:21, 2024-1-18 17:16:50, 2024-8-5 10:55:21
|
|
45
45
|
*/
|
|
46
|
-
const sCtr = __importStar(require("
|
|
46
|
+
const sCtr = __importStar(require("../sys/ctr"));
|
|
47
47
|
/** --- 一小时的秒数 --- */
|
|
48
48
|
exports.HOUR = 3600;
|
|
49
49
|
/** --- 一天的秒数 --- */
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as sCtr from '../sys/ctr';
|
|
2
|
+
/**
|
|
3
|
+
* 0. CloudFlare:https://developers.cloudflare.com/turnstile/get-started/server-side-validation/
|
|
4
|
+
* 1. 腾讯云:https://cloud.tencent.com/document/product/1110/36926
|
|
5
|
+
*/
|
|
6
|
+
/** --- 厂家 --- */
|
|
7
|
+
export declare enum EFACTORY {
|
|
8
|
+
'CLOUDFLARE' = 0,
|
|
9
|
+
'TENCENT' = 1
|
|
10
|
+
}
|
|
11
|
+
export declare function verify(ctr: sCtr.Ctr, opt: {
|
|
12
|
+
'factory': EFACTORY;
|
|
13
|
+
'token': string;
|
|
14
|
+
'ip': string;
|
|
15
|
+
}): Promise<boolean>;
|
package/lib/turnstile.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
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
|
+
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
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.EFACTORY = void 0;
|
|
37
|
+
exports.verify = verify;
|
|
38
|
+
/**
|
|
39
|
+
* Project: Kebab, User: JianSuoQiYue
|
|
40
|
+
* Date: 2025-6-11
|
|
41
|
+
* Last: 2025-6-11 21:50:31
|
|
42
|
+
*/
|
|
43
|
+
const tc = __importStar(require("tencentcloud-sdk-nodejs"));
|
|
44
|
+
// --- 库和定义 ---
|
|
45
|
+
const lNet = __importStar(require("../lib/net"));
|
|
46
|
+
const lText = __importStar(require("../lib/text"));
|
|
47
|
+
/**
|
|
48
|
+
* 0. CloudFlare:https://developers.cloudflare.com/turnstile/get-started/server-side-validation/
|
|
49
|
+
* 1. 腾讯云:https://cloud.tencent.com/document/product/1110/36926
|
|
50
|
+
*/
|
|
51
|
+
/** --- 厂家 --- */
|
|
52
|
+
var EFACTORY;
|
|
53
|
+
(function (EFACTORY) {
|
|
54
|
+
EFACTORY[EFACTORY["CLOUDFLARE"] = 0] = "CLOUDFLARE";
|
|
55
|
+
EFACTORY[EFACTORY["TENCENT"] = 1] = "TENCENT";
|
|
56
|
+
})(EFACTORY || (exports.EFACTORY = EFACTORY = {}));
|
|
57
|
+
async function verify(ctr, opt) {
|
|
58
|
+
const config = ctr.getPrototype('_config');
|
|
59
|
+
switch (opt.factory) {
|
|
60
|
+
case EFACTORY.CLOUDFLARE: {
|
|
61
|
+
// --- CloudFlare 验证 ---
|
|
62
|
+
const res = await lNet.postJson('https://challenges.cloudflare.com/turnstile/v0/siteverify', {
|
|
63
|
+
'secret': config.turnstile['CF'].skey,
|
|
64
|
+
'response': opt.token,
|
|
65
|
+
'remoteip': opt.ip,
|
|
66
|
+
});
|
|
67
|
+
const content = await res.getContent();
|
|
68
|
+
if (!content) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
const str = content.toString();
|
|
72
|
+
const json = lText.parseJson(str);
|
|
73
|
+
if (!json) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
return json.success;
|
|
77
|
+
}
|
|
78
|
+
case EFACTORY.TENCENT: {
|
|
79
|
+
// --- 腾讯云验证 ---
|
|
80
|
+
const client = new tc.captcha.v20190722.Client({
|
|
81
|
+
'credential': {
|
|
82
|
+
'secretId': config.turnstile['TENCENT'].sid,
|
|
83
|
+
'secretKey': config.turnstile['TENCENT'].skey,
|
|
84
|
+
},
|
|
85
|
+
'profile': {
|
|
86
|
+
'signMethod': 'HmacSHA256', // 签名方法
|
|
87
|
+
'httpProfile': {
|
|
88
|
+
'reqMethod': 'POST', // 请求方法
|
|
89
|
+
'reqTimeout': 30, // 请求超时时间,默认60s
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
const io = opt.token.indexOf('|');
|
|
94
|
+
if (io === -1) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
const res = await client.DescribeCaptchaResult({
|
|
98
|
+
'CaptchaType': 9,
|
|
99
|
+
'Ticket': opt.token.slice(0, io),
|
|
100
|
+
'UserIp': opt.ip,
|
|
101
|
+
'Randstr': opt.token.slice(io + 1),
|
|
102
|
+
'CaptchaAppId': parseInt(config.turnstile['TENCENT'].aid), // --- 防止后期又不是 number 了还要改config,这样只需要更新代码无损升级 ---
|
|
103
|
+
'AppSecretKey': config.turnstile['TENCENT'].akey,
|
|
104
|
+
});
|
|
105
|
+
return res.CaptchaCode === 1;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
package/lib/ws.d.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import * as http from 'http';
|
|
7
7
|
import * as net from 'net';
|
|
8
|
-
import * as types from '
|
|
9
|
-
import * as sCtr from '
|
|
8
|
+
import * as types from '../types';
|
|
9
|
+
import * as sCtr from '../sys/ctr';
|
|
10
10
|
/** --- 一般用 SIMPLE --- */
|
|
11
11
|
export declare enum EFrameReceiveMode {
|
|
12
12
|
STANDARD = 0,
|
package/lib/ws.js
CHANGED
|
@@ -41,8 +41,8 @@ exports.rproxy = rproxy;
|
|
|
41
41
|
// --- 第三方 ---
|
|
42
42
|
const liws = __importStar(require("@litert/websocket"));
|
|
43
43
|
// --- 库 ---
|
|
44
|
-
const lText = __importStar(require("
|
|
45
|
-
const lNet = __importStar(require("
|
|
44
|
+
const lText = __importStar(require("../lib/text"));
|
|
45
|
+
const lNet = __importStar(require("../lib/net"));
|
|
46
46
|
/** --- 一般用 SIMPLE --- */
|
|
47
47
|
var EFrameReceiveMode;
|
|
48
48
|
(function (EFrameReceiveMode) {
|
package/lib/zip.d.ts
CHANGED
package/lib/zip.js
CHANGED
|
@@ -40,7 +40,7 @@ exports.Zip = void 0;
|
|
|
40
40
|
exports.get = get;
|
|
41
41
|
const jszip_1 = __importDefault(require("jszip"));
|
|
42
42
|
const mime = __importStar(require("@litert/mime"));
|
|
43
|
-
const lText = __importStar(require("
|
|
43
|
+
const lText = __importStar(require("../lib/text"));
|
|
44
44
|
/**
|
|
45
45
|
* --- 本库主要用于读取 zip,请尽量不要用来写入 zip,尤其是大文件 zip ---
|
|
46
46
|
*/
|
package/package.json
CHANGED
package/sys/child.js
CHANGED
|
@@ -43,13 +43,13 @@ const tls = __importStar(require("tls"));
|
|
|
43
43
|
const http = __importStar(require("http"));
|
|
44
44
|
const crypto = __importStar(require("crypto"));
|
|
45
45
|
// --- 库和定义 ---
|
|
46
|
-
const fs = __importStar(require("
|
|
47
|
-
const lCore = __importStar(require("
|
|
48
|
-
const lText = __importStar(require("
|
|
49
|
-
const sCtr = __importStar(require("
|
|
50
|
-
const kebab = __importStar(require("
|
|
46
|
+
const fs = __importStar(require("../lib/fs"));
|
|
47
|
+
const lCore = __importStar(require("../lib/core"));
|
|
48
|
+
const lText = __importStar(require("../lib/text"));
|
|
49
|
+
const sCtr = __importStar(require("../sys/ctr"));
|
|
50
|
+
const kebab = __importStar(require("../index"));
|
|
51
51
|
// --- 初始化 ---
|
|
52
|
-
const sRoute = __importStar(require("
|
|
52
|
+
const sRoute = __importStar(require("../sys/route"));
|
|
53
53
|
/** --- 10 秒往主线程发送一次心跳的 Timer --- */
|
|
54
54
|
const hbTimer = setInterval(function () {
|
|
55
55
|
if (!process.connected || !process.send) {
|
package/sys/cmd.js
CHANGED
|
@@ -39,12 +39,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
* Last: 2020-3-7 23:51:18, 2022-07-22 14:14:09, 2022-9-27 14:52:19, 2023-5-23 21:42:46, 2024-7-2 15:12:28
|
|
40
40
|
*/
|
|
41
41
|
const http = __importStar(require("http"));
|
|
42
|
-
const lFs = __importStar(require("
|
|
43
|
-
const lText = __importStar(require("
|
|
44
|
-
const lTime = __importStar(require("
|
|
45
|
-
const lCore = __importStar(require("
|
|
46
|
-
const lCrypto = __importStar(require("
|
|
47
|
-
const kebab = __importStar(require("
|
|
42
|
+
const lFs = __importStar(require("../lib/fs"));
|
|
43
|
+
const lText = __importStar(require("../lib/text"));
|
|
44
|
+
const lTime = __importStar(require("../lib/time"));
|
|
45
|
+
const lCore = __importStar(require("../lib/core"));
|
|
46
|
+
const lCrypto = __importStar(require("../lib/crypto"));
|
|
47
|
+
const kebab = __importStar(require("../index"));
|
|
48
48
|
/** --- 解析命令 --- */
|
|
49
49
|
const cmds = process.argv.slice(2);
|
|
50
50
|
/** --- 批量创建目录 --- */
|
|
@@ -169,6 +169,16 @@ async function run() {
|
|
|
169
169
|
config.s3['TENCENT'].skey = '';
|
|
170
170
|
config.s3['TENCENT'].region = '';
|
|
171
171
|
config.s3['TENCENT'].bucket = '';
|
|
172
|
+
// --- config - turnstile ---
|
|
173
|
+
config.turnstile ??= {};
|
|
174
|
+
config.turnstile['CF'] ??= {};
|
|
175
|
+
config.turnstile['CF'].sid ??= '';
|
|
176
|
+
config.turnstile['CF'].skey ??= '';
|
|
177
|
+
config.turnstile['TENCENT'] ??= {};
|
|
178
|
+
config.turnstile['TENCENT'].sid ??= '';
|
|
179
|
+
config.turnstile['TENCENT'].skey ??= '';
|
|
180
|
+
config.turnstile['TENCENT'].aid ??= '';
|
|
181
|
+
config.turnstile['TENCENT'].akey ??= '';
|
|
172
182
|
// --- 保存 config.json ---
|
|
173
183
|
if (!await lFs.putContent(kebab.CONF_CWD + 'config.json', lText.stringifyJson(config, 4))) {
|
|
174
184
|
lCore.display('KEBAB', 'CREATE', 'FILE', kebab.CONF_CWD + 'config.json', '[FAILED]');
|
package/sys/master.js
CHANGED
|
@@ -42,14 +42,14 @@ const os = __importStar(require("os"));
|
|
|
42
42
|
const cluster = __importStar(require("cluster"));
|
|
43
43
|
const http = __importStar(require("http"));
|
|
44
44
|
// --- 库和定义 ---
|
|
45
|
-
const kebab = __importStar(require("
|
|
46
|
-
const sRoute = __importStar(require("
|
|
47
|
-
const lCore = __importStar(require("
|
|
48
|
-
const lFs = __importStar(require("
|
|
49
|
-
const lText = __importStar(require("
|
|
50
|
-
const lCrypto = __importStar(require("
|
|
51
|
-
const lTime = __importStar(require("
|
|
52
|
-
const lZip = __importStar(require("
|
|
45
|
+
const kebab = __importStar(require("../index"));
|
|
46
|
+
const sRoute = __importStar(require("../sys/route"));
|
|
47
|
+
const lCore = __importStar(require("../lib/core"));
|
|
48
|
+
const lFs = __importStar(require("../lib/fs"));
|
|
49
|
+
const lText = __importStar(require("../lib/text"));
|
|
50
|
+
const lCrypto = __importStar(require("../lib/crypto"));
|
|
51
|
+
const lTime = __importStar(require("../lib/time"));
|
|
52
|
+
const lZip = __importStar(require("../lib/zip"));
|
|
53
53
|
/** --- 当前运行中的子进程列表 --- */
|
|
54
54
|
const workerList = {};
|
|
55
55
|
/**
|
package/sys/mod.d.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Date: 2019-6-4 21:35
|
|
4
4
|
* Last: 2020-4-14 13:33:51, 2022-07-23 16:01:34, 2022-09-06 22:59:26, 2023-5-24 19:11:37, 2023-6-13 21:47:58, 2023-7-10 18:54:03, 2023-8-23 17:03:16, 2023-12-11 15:21:22, 2023-12-20 23:12:03, 2024-3-8 16:05:29, 2024-3-20 19:58:15, 2024-8-11 21:14:54, 2024-10-5 14:00:22, 2024-12-14 19:58:34
|
|
5
5
|
*/
|
|
6
|
-
import * as lSql from '
|
|
7
|
-
import * as lDb from '
|
|
8
|
-
import * as sCtr from '
|
|
9
|
-
import * as types from '
|
|
6
|
+
import * as lSql from '../lib/sql';
|
|
7
|
+
import * as lDb from '../lib/db';
|
|
8
|
+
import * as sCtr from '../sys/ctr';
|
|
9
|
+
import * as types from '../types';
|
|
10
10
|
/** --- 条数列表 --- */
|
|
11
11
|
declare class Rows<T extends Mod> implements types.Rows<T> {
|
|
12
12
|
private readonly _items;
|
package/sys/mod.js
CHANGED
|
@@ -38,11 +38,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
38
38
|
* Date: 2019-6-4 21:35
|
|
39
39
|
* Last: 2020-4-14 13:33:51, 2022-07-23 16:01:34, 2022-09-06 22:59:26, 2023-5-24 19:11:37, 2023-6-13 21:47:58, 2023-7-10 18:54:03, 2023-8-23 17:03:16, 2023-12-11 15:21:22, 2023-12-20 23:12:03, 2024-3-8 16:05:29, 2024-3-20 19:58:15, 2024-8-11 21:14:54, 2024-10-5 14:00:22, 2024-12-14 19:58:34
|
|
40
40
|
*/
|
|
41
|
-
const lSql = __importStar(require("
|
|
42
|
-
const lTime = __importStar(require("
|
|
43
|
-
const lCore = __importStar(require("
|
|
44
|
-
const lText = __importStar(require("
|
|
45
|
-
const sCtr = __importStar(require("
|
|
41
|
+
const lSql = __importStar(require("../lib/sql"));
|
|
42
|
+
const lTime = __importStar(require("../lib/time"));
|
|
43
|
+
const lCore = __importStar(require("../lib/core"));
|
|
44
|
+
const lText = __importStar(require("../lib/text"));
|
|
45
|
+
const sCtr = __importStar(require("../sys/ctr"));
|
|
46
46
|
/** --- 条数列表 --- */
|
|
47
47
|
class Rows {
|
|
48
48
|
constructor(initialItems = []) {
|
package/sys/route.d.ts
CHANGED
package/sys/route.js
CHANGED
|
@@ -49,15 +49,15 @@ const stream = __importStar(require("stream"));
|
|
|
49
49
|
// --- 第三方 ---
|
|
50
50
|
const ws = __importStar(require("@litert/websocket"));
|
|
51
51
|
// --- 库和定义 ---
|
|
52
|
-
const lFs = __importStar(require("
|
|
53
|
-
const lZlib = __importStar(require("
|
|
54
|
-
const lCore = __importStar(require("
|
|
55
|
-
const lText = __importStar(require("
|
|
56
|
-
const lTime = __importStar(require("
|
|
57
|
-
const lResponse = __importStar(require("
|
|
58
|
-
const lWs = __importStar(require("
|
|
52
|
+
const lFs = __importStar(require("../lib/fs"));
|
|
53
|
+
const lZlib = __importStar(require("../lib/zlib"));
|
|
54
|
+
const lCore = __importStar(require("../lib/core"));
|
|
55
|
+
const lText = __importStar(require("../lib/text"));
|
|
56
|
+
const lTime = __importStar(require("../lib/time"));
|
|
57
|
+
const lResponse = __importStar(require("../lib/net/response"));
|
|
58
|
+
const lWs = __importStar(require("../lib/ws"));
|
|
59
59
|
const sCtr = __importStar(require("./ctr"));
|
|
60
|
-
const kebab = __importStar(require("
|
|
60
|
+
const kebab = __importStar(require("../index"));
|
|
61
61
|
/** --- 动态层 kebab.json 缓存(文件路径: 最终合并值) --- */
|
|
62
62
|
let kebabConfigs = {};
|
|
63
63
|
/**
|
package/www/example/ctr/main.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const ctr = __importStar(require("
|
|
36
|
+
const ctr = __importStar(require("../../../sys/ctr"));
|
|
37
37
|
class default_1 extends ctr.Ctr {
|
|
38
38
|
index() {
|
|
39
39
|
return `<a href="${this._config.const.urlBase}test">Hello world! Click here to visit demo.</a>`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as ctr from '
|
|
2
|
-
import * as types from '
|
|
1
|
+
import * as ctr from '../../../sys/ctr';
|
|
2
|
+
import * as types from '../../../types';
|
|
3
3
|
export default class extends ctr.Ctr {
|
|
4
4
|
onLoad(): string | boolean;
|
|
5
5
|
onUnload(rtn: string | boolean | types.DbValue[]): string | boolean | types.DbValue[];
|
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const ctr = __importStar(require("
|
|
36
|
+
const ctr = __importStar(require("../../../sys/ctr"));
|
|
37
37
|
class default_1 extends ctr.Ctr {
|
|
38
38
|
onLoad() {
|
|
39
39
|
if (this._config.const.path !== 'test/middle') {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as fs from 'fs';
|
|
2
|
-
import * as sCtr from '
|
|
3
|
-
import * as types from '
|
|
2
|
+
import * as sCtr from '../../../sys/ctr';
|
|
3
|
+
import * as types from '../../../types';
|
|
4
4
|
export default class extends sCtr.Ctr {
|
|
5
5
|
private _internalUrl;
|
|
6
6
|
onLoad(): Array<string | number> | boolean;
|
package/www/example/ctr/test.js
CHANGED
|
@@ -37,27 +37,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
// --- 库和定义 ---
|
|
40
|
-
const lCore = __importStar(require("
|
|
41
|
-
const lNet = __importStar(require("
|
|
42
|
-
const lDb = __importStar(require("
|
|
43
|
-
const lFs = __importStar(require("
|
|
44
|
-
const lText = __importStar(require("
|
|
45
|
-
const lCrypto = __importStar(require("
|
|
46
|
-
const lKv = __importStar(require("
|
|
47
|
-
const lCaptcha = __importStar(require("
|
|
48
|
-
const lTime = __importStar(require("
|
|
49
|
-
const lScan = __importStar(require("
|
|
50
|
-
const lSql = __importStar(require("
|
|
51
|
-
const lConsistent = __importStar(require("
|
|
52
|
-
const lSsh = __importStar(require("
|
|
53
|
-
const lJwt = __importStar(require("
|
|
54
|
-
const lWs = __importStar(require("
|
|
55
|
-
const lS3 = __importStar(require("
|
|
56
|
-
const lZip = __importStar(require("
|
|
57
|
-
const lBuffer = __importStar(require("
|
|
58
|
-
const lLan = __importStar(require("
|
|
59
|
-
const sCtr = __importStar(require("
|
|
60
|
-
const kebab = __importStar(require("
|
|
40
|
+
const lCore = __importStar(require("../../../lib/core"));
|
|
41
|
+
const lNet = __importStar(require("../../../lib/net"));
|
|
42
|
+
const lDb = __importStar(require("../../../lib/db"));
|
|
43
|
+
const lFs = __importStar(require("../../../lib/fs"));
|
|
44
|
+
const lText = __importStar(require("../../../lib/text"));
|
|
45
|
+
const lCrypto = __importStar(require("../../../lib/crypto"));
|
|
46
|
+
const lKv = __importStar(require("../../../lib/kv"));
|
|
47
|
+
const lCaptcha = __importStar(require("../../../lib/captcha"));
|
|
48
|
+
const lTime = __importStar(require("../../../lib/time"));
|
|
49
|
+
const lScan = __importStar(require("../../../lib/scan"));
|
|
50
|
+
const lSql = __importStar(require("../../../lib/sql"));
|
|
51
|
+
const lConsistent = __importStar(require("../../../lib/consistent"));
|
|
52
|
+
const lSsh = __importStar(require("../../../lib/ssh"));
|
|
53
|
+
const lJwt = __importStar(require("../../../lib/jwt"));
|
|
54
|
+
const lWs = __importStar(require("../../../lib/ws"));
|
|
55
|
+
const lS3 = __importStar(require("../../../lib/s3"));
|
|
56
|
+
const lZip = __importStar(require("../../../lib/zip"));
|
|
57
|
+
const lBuffer = __importStar(require("../../../lib/buffer"));
|
|
58
|
+
const lLan = __importStar(require("../../../lib/lan"));
|
|
59
|
+
const sCtr = __importStar(require("../../../sys/ctr"));
|
|
60
|
+
const kebab = __importStar(require("../../../index"));
|
|
61
61
|
// --- mod ---
|
|
62
62
|
const test_1 = __importDefault(require("../mod/test"));
|
|
63
63
|
const testdata_1 = __importDefault(require("../mod/testdata"));
|
package/www/example/mod/test.js
CHANGED
|
@@ -36,8 +36,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
const lCore = __importStar(require("
|
|
40
|
-
const mod_1 = __importDefault(require("
|
|
39
|
+
const lCore = __importStar(require("../../../lib/core"));
|
|
40
|
+
const mod_1 = __importDefault(require("../../../sys/mod"));
|
|
41
41
|
/*
|
|
42
42
|
CREATE TABLE `m_test` (
|
|
43
43
|
`id` int NOT NULL AUTO_INCREMENT,
|
|
@@ -3,7 +3,7 @@ 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
|
-
const mod_1 = __importDefault(require("
|
|
6
|
+
const mod_1 = __importDefault(require("../../../sys/mod"));
|
|
7
7
|
/*
|
|
8
8
|
CREATE TABLE `m_test_data_0` (
|
|
9
9
|
`id` bigint NOT NULL AUTO_INCREMENT,
|
package/www/example/ws/mproxy.js
CHANGED
|
@@ -33,8 +33,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const sCtr = __importStar(require("
|
|
37
|
-
const lWs = __importStar(require("
|
|
36
|
+
const sCtr = __importStar(require("../../../sys/ctr"));
|
|
37
|
+
const lWs = __importStar(require("../../../lib/ws"));
|
|
38
38
|
class default_1 extends sCtr.Ctr {
|
|
39
39
|
async onLoad() {
|
|
40
40
|
console.log('WebSocket mproxy test onLoad.');
|
package/www/example/ws/rproxy.js
CHANGED
|
@@ -33,8 +33,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const sCtr = __importStar(require("
|
|
37
|
-
const lWs = __importStar(require("
|
|
36
|
+
const sCtr = __importStar(require("../../../sys/ctr"));
|
|
37
|
+
const lWs = __importStar(require("../../../lib/ws"));
|
|
38
38
|
class default_1 extends sCtr.Ctr {
|
|
39
39
|
async onLoad() {
|
|
40
40
|
console.log('WebSocket rproxy test onLoad.');
|
package/www/example/ws/test.d.ts
CHANGED
package/www/example/ws/test.js
CHANGED
|
@@ -33,8 +33,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const sCtr = __importStar(require("
|
|
37
|
-
const lCrypto = __importStar(require("
|
|
36
|
+
const sCtr = __importStar(require("../../../sys/ctr"));
|
|
37
|
+
const lCrypto = __importStar(require("../../../lib/crypto"));
|
|
38
38
|
class default_1 extends sCtr.Ctr {
|
|
39
39
|
constructor() {
|
|
40
40
|
super(...arguments);
|