@maiyunnet/kebab 2.0.2 → 2.0.4

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.
Files changed (49) hide show
  1. package/index.js +1 -1
  2. package/lib/sql.js +1 -3
  3. package/lib/text.js +5 -1
  4. package/package.json +1 -1
  5. package/tsconfig.json +1 -1
  6. package/index.ts +0 -33
  7. package/lib/buffer.ts +0 -152
  8. package/lib/captcha.ts +0 -63
  9. package/lib/consistent.ts +0 -219
  10. package/lib/core.ts +0 -880
  11. package/lib/crypto.ts +0 -384
  12. package/lib/db.ts +0 -719
  13. package/lib/dns.ts +0 -405
  14. package/lib/fs.ts +0 -527
  15. package/lib/jwt.ts +0 -276
  16. package/lib/kv.ts +0 -1489
  17. package/lib/lan.ts +0 -87
  18. package/lib/net/formdata.ts +0 -166
  19. package/lib/net/request.ts +0 -150
  20. package/lib/net/response.ts +0 -59
  21. package/lib/net.ts +0 -662
  22. package/lib/s3.ts +0 -235
  23. package/lib/scan.ts +0 -364
  24. package/lib/session.ts +0 -230
  25. package/lib/sql.ts +0 -1151
  26. package/lib/ssh/sftp.ts +0 -508
  27. package/lib/ssh/shell.ts +0 -123
  28. package/lib/ssh.ts +0 -191
  29. package/lib/text.ts +0 -615
  30. package/lib/time.ts +0 -254
  31. package/lib/ws.ts +0 -523
  32. package/lib/zip.ts +0 -447
  33. package/lib/zlib.ts +0 -350
  34. package/main.ts +0 -27
  35. package/sys/child.ts +0 -678
  36. package/sys/cmd.ts +0 -225
  37. package/sys/ctr.ts +0 -904
  38. package/sys/master.ts +0 -355
  39. package/sys/mod.ts +0 -1871
  40. package/sys/route.ts +0 -1113
  41. package/types/index.d.ts +0 -283
  42. package/www/example/ctr/main.ts +0 -9
  43. package/www/example/ctr/middle.ts +0 -26
  44. package/www/example/ctr/test.ts +0 -3218
  45. package/www/example/mod/test.ts +0 -47
  46. package/www/example/mod/testdata.ts +0 -30
  47. package/www/example/ws/mproxy.ts +0 -16
  48. package/www/example/ws/rproxy.ts +0 -14
  49. package/www/example/ws/test.ts +0 -36
@@ -1,47 +0,0 @@
1
- import * as lCore from '~/lib/core';
2
- import sMod from '~/sys/mod';
3
- import types from '~/types';
4
-
5
- /*
6
- CREATE TABLE `m_test` (
7
- `id` INT NOT NULL AUTO_INCREMENT,
8
- `token` CHAR(16) NOT NULL COLLATE 'ascii_bin',
9
- `point` POINT NOT NULL,
10
- `polygon` POLYGON NULL DEFAULT NULL,
11
- `json` JSON NULL DEFAULT NULL,
12
- `time_add` BIGINT NOT NULL,
13
- PRIMARY KEY (`id`) USING BTREE,
14
- UNIQUE INDEX `token` (`token`) USING BTREE,
15
- INDEX `time_add` (`time_add`) USING BTREE
16
- ) ENGINE=InnoDB COLLATE=utf8mb4_general_ci;
17
- */
18
-
19
- export default class extends sMod {
20
-
21
- protected static _$table = 'test';
22
-
23
- protected static _$primary = 'id';
24
-
25
- protected static _$key = 'token';
26
-
27
- /* eslint-disable @typescript-eslint/naming-convention */
28
-
29
- public id!: number;
30
-
31
- public token!: string;
32
-
33
- public point!: { 'x': number; 'y': number; };
34
-
35
- public polygon!: Array<Array<{ 'x': number; 'y': number; }>>;
36
-
37
- public json!: types.Json;
38
-
39
- public time_add!: number;
40
-
41
- /* eslint-enable */
42
-
43
- protected _keyGenerator(): string {
44
- return 'test_' + lCore.rand(0, 5).toString();
45
- }
46
-
47
- }
@@ -1,30 +0,0 @@
1
- import sMod from '~/sys/mod';
2
- /*
3
- CREATE TABLE `m_test_data_0` (
4
- `id` bigint NOT NULL AUTO_INCREMENT,
5
- `test_id` bigint NOT NULL,
6
- `content` varchar(128) COLLATE ascii_bin NOT NULL,
7
- `time_add` bigint NOT NULL,
8
- PRIMARY KEY (`id`)
9
- ) ENGINE=InnoDB DEFAULT CHARSET=ascii COLLATE=ascii_bin;
10
- */
11
-
12
- export default class extends sMod {
13
-
14
- protected static _$table = 'test_data';
15
-
16
- protected static _$primary = 'id';
17
-
18
- /* eslint-disable @typescript-eslint/naming-convention */
19
-
20
- public id!: number;
21
-
22
- public test_id!: number;
23
-
24
- public content!: string;
25
-
26
- public time_add!: number;
27
-
28
- /* eslint-enable */
29
-
30
- }
@@ -1,16 +0,0 @@
1
- import * as sCtr from '~/sys/ctr';
2
- import * as lWs from '~/lib/ws';
3
-
4
- export default class extends sCtr.Ctr {
5
-
6
- public async onLoad(): Promise<boolean> {
7
- console.log('WebSocket mproxy test onLoad.');
8
- const rtn = await lWs.mproxy(this, '123456');
9
- if (rtn > 0) {
10
- return false;
11
- }
12
- console.log('WebSocket mproxy error: ' + rtn);
13
- return false;
14
- }
15
-
16
- }
@@ -1,14 +0,0 @@
1
- import * as sCtr from '~/sys/ctr';
2
- import * as lWs from '~/lib/ws';
3
-
4
- export default class extends sCtr.Ctr {
5
-
6
- public async onLoad(): Promise<boolean> {
7
- console.log('WebSocket rproxy test onLoad.');
8
- if (await lWs.rproxy(this, `ws${this._config.const.https ? 's' : ''}://${this._config.const.host}/test`)) {
9
- return false;
10
- }
11
- return true;
12
- }
13
-
14
- }
@@ -1,36 +0,0 @@
1
- import * as sCtr from '~/sys/ctr';
2
- import * as lCrypto from '~/lib/crypto';
3
-
4
- export default class extends sCtr.Ctr {
5
-
6
- private _nick: string = '';
7
-
8
- public onLoad(): boolean {
9
- console.log('WebSocket test onLoad.');
10
- setTimeout(() => {
11
- if (!this._nick) {
12
- return;
13
- }
14
- this._writeText('Other message, host: ' + this._config.const.host);
15
- }, 2000);
16
- return true;
17
- }
18
-
19
- public onData(data: Buffer | string): string {
20
- if (typeof data !== 'string') {
21
- return '';
22
- }
23
- if (data.startsWith('Hello: ')) {
24
- this._nick = data.slice(7);
25
- return 'Base64: ' + lCrypto.base64Encode(data);
26
- }
27
- // --- 用户消息 ---
28
- return '<b>' + this._nick + ':</b> ' + data;
29
- }
30
-
31
- public onClose(): void {
32
- console.log('WebSocket test onClose, nick: ' + this._nick);
33
- this._nick = '';
34
- }
35
-
36
- }