verteilen-core 1.4.21 → 1.4.22

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 (100) hide show
  1. package/dist/client/analysis.d.ts +0 -17
  2. package/dist/client/analysis.js +0 -22
  3. package/dist/client/client.d.ts +0 -17
  4. package/dist/client/client.js +4 -34
  5. package/dist/client/cluster.d.ts +0 -3
  6. package/dist/client/cluster.js +0 -32
  7. package/dist/client/database.d.ts +0 -16
  8. package/dist/client/database.js +0 -16
  9. package/dist/client/execute.d.ts +0 -33
  10. package/dist/client/execute.js +0 -38
  11. package/dist/client/javascript.d.ts +0 -23
  12. package/dist/client/javascript.js +0 -34
  13. package/dist/client/job_database.d.ts +0 -4
  14. package/dist/client/job_database.js +0 -4
  15. package/dist/client/job_execute.d.ts +0 -28
  16. package/dist/client/job_execute.js +0 -29
  17. package/dist/client/os.d.ts +0 -26
  18. package/dist/client/os.js +0 -32
  19. package/dist/client/resource.d.ts +0 -3
  20. package/dist/client/resource.js +0 -8
  21. package/dist/client/shell.d.ts +0 -16
  22. package/dist/client/shell.js +0 -21
  23. package/dist/computed.d.ts +0 -13
  24. package/dist/computed.js +32 -29
  25. package/dist/index.js +0 -4
  26. package/dist/interface/base.d.ts +0 -261
  27. package/dist/interface/base.js +0 -8
  28. package/dist/interface/bus.d.ts +0 -73
  29. package/dist/interface/enum.d.ts +0 -67
  30. package/dist/interface/enum.js +0 -74
  31. package/dist/interface/execute.d.ts +0 -46
  32. package/dist/interface/log.d.ts +0 -54
  33. package/dist/interface/plugin.d.ts +0 -192
  34. package/dist/interface/record.d.ts +0 -13
  35. package/dist/interface/server.d.ts +0 -20
  36. package/dist/interface/server.js +0 -8
  37. package/dist/interface/struct.d.ts +1 -140
  38. package/dist/interface/table.d.ts +0 -39
  39. package/dist/interface/ui.d.ts +0 -104
  40. package/dist/interface/ui.js +0 -8
  41. package/dist/interface.d.ts +0 -30
  42. package/dist/interface.js +18 -44
  43. package/dist/plugins/i18n.d.ts +0 -19
  44. package/dist/plugins/i18n.js +0 -24
  45. package/dist/script/console_manager.d.ts +0 -3
  46. package/dist/script/console_manager.js +0 -3
  47. package/dist/script/console_server_manager.d.ts +0 -3
  48. package/dist/script/console_server_manager.js +0 -3
  49. package/dist/script/execute/base.d.ts +2 -98
  50. package/dist/script/execute/base.js +0 -105
  51. package/dist/script/execute/feedback.d.ts +0 -34
  52. package/dist/script/execute/feedback.js +0 -46
  53. package/dist/script/execute/region_job.js +0 -6
  54. package/dist/script/execute/region_project.js +0 -17
  55. package/dist/script/execute/region_subtask.js +0 -5
  56. package/dist/script/execute/region_task.d.ts +5 -41
  57. package/dist/script/execute/region_task.js +0 -75
  58. package/dist/script/execute/runner.d.ts +0 -7
  59. package/dist/script/execute/runner.js +0 -15
  60. package/dist/script/execute/util_parser.d.ts +0 -41
  61. package/dist/script/execute/util_parser.js +1 -47
  62. package/dist/script/execute_manager.d.ts +0 -38
  63. package/dist/script/execute_manager.js +0 -54
  64. package/dist/script/socket_manager.d.ts +0 -79
  65. package/dist/script/socket_manager.js +0 -84
  66. package/dist/script/webhook_server_manager.js +1 -1
  67. package/dist/server/detail/console_handle.d.ts +0 -13
  68. package/dist/server/detail/console_handle.js +0 -14
  69. package/dist/server/detail/log_handle.d.ts +0 -5
  70. package/dist/server/detail/log_handle.js +0 -5
  71. package/dist/server/detail.d.ts +4 -32
  72. package/dist/server/detail.js +0 -43
  73. package/dist/server/io.d.ts +0 -21
  74. package/dist/server/io.js +0 -18
  75. package/dist/server/io2.d.ts +0 -19
  76. package/dist/server/io2.js +0 -54
  77. package/dist/server/module/account.d.ts +0 -6
  78. package/dist/server/module/account.js +0 -11
  79. package/dist/server/module/project.d.ts +1 -50
  80. package/dist/server/module/project.js +0 -49
  81. package/dist/server/plugin.d.ts +0 -51
  82. package/dist/server/plugin.js +0 -13
  83. package/dist/server/server.d.ts +0 -21
  84. package/dist/server/server.js +0 -10
  85. package/dist/server/server2.d.ts +0 -4
  86. package/dist/server/server2.js +0 -9
  87. package/dist/server.d.ts +0 -3
  88. package/dist/server.js +0 -3
  89. package/jest.config.js +11 -0
  90. package/package.json +3 -2
  91. package/src/client/client.ts +1 -1
  92. package/src/computed.ts +1 -5
  93. package/src/interface/struct.ts +1 -1
  94. package/src/script/webhook_server_manager.ts +1 -1
  95. package/test/call/print.ts +1 -1
  96. package/tsconfig.json +4 -4
  97. package/dist/util/port.d.ts +0 -1
  98. package/dist/util/port.js +0 -15
  99. package/jest.config.ts +0 -12
  100. package/src/util/port.ts +0 -15
@@ -1,22 +1,8 @@
1
1
  import WebSocket from "ws";
2
2
  import { Job, Libraries, Messager, Messager_log, Database, PluginNode } from "../interface";
3
- /**
4
- * The job execute worker\
5
- * This class should spawn by the cluster thread to prevent heavy calculation on the main thread
6
- */
7
3
  export declare class ClientJobExecute {
8
- /**
9
- * Project databases for references
10
- */
11
4
  database: Database | undefined;
12
- /**
13
- * User library for scripts
14
- */
15
5
  libraries: Libraries | undefined;
16
- /**
17
- * The job uuid\
18
- * This will put in the prefix of message
19
- */
20
6
  tag: string;
21
7
  runtime: string;
22
8
  private messager;
@@ -27,22 +13,8 @@ export declare class ClientJobExecute {
27
13
  private job;
28
14
  private plugin;
29
15
  constructor(_messager: Messager, _messager_log: Messager_log, _job: Job, _source: WebSocket | undefined, _plugin: PluginNode);
30
- /**
31
- * The entry function to execute the job container
32
- * @param job Target job
33
- */
34
16
  execute: () => Promise<string>;
35
17
  stop_all: () => void;
36
- /**
37
- * Execute the job that classify as run
38
- * @param job Target job
39
- * @returns Promise instance
40
- */
41
18
  private execute_job_exe;
42
- /**
43
- * Execute the job that classify as condition
44
- * @param job Target job
45
- * @returns Promise instance
46
- */
47
19
  private execute_job_con;
48
20
  }
@@ -3,23 +3,9 @@ import { i18n } from "../plugins/i18n";
3
3
  import { ClientJavascript } from "./javascript";
4
4
  import { ClientJobDatabase } from "./job_database";
5
5
  import { ClientOS } from "./os";
6
- /**
7
- * The job execute worker\
8
- * This class should spawn by the cluster thread to prevent heavy calculation on the main thread
9
- */
10
6
  export class ClientJobExecute {
11
- /**
12
- * Project databases for references
13
- */
14
7
  database;
15
- /**
16
- * User library for scripts
17
- */
18
8
  libraries;
19
- /**
20
- * The job uuid\
21
- * This will put in the prefix of message
22
- */
23
9
  tag;
24
10
  runtime;
25
11
  messager;
@@ -43,12 +29,7 @@ export class ClientJobExecute {
43
29
  this.libraries = process.env.libraries != undefined ? JSON.parse(process.env.libraries) : undefined;
44
30
  ClientJavascript.Init(_messager, _messager_log, this.os, this.para, () => this.libraries, () => this.database, () => this.job);
45
31
  }
46
- /**
47
- * The entry function to execute the job container
48
- * @param job Target job
49
- */
50
32
  execute = () => {
51
- // Output the job type message to let user know what is going on
52
33
  this.messager_log(`[Execute] ${this.job.uuid} ${this.job.category == JobCategory.Execution ? i18n.global.t(JobTypeText[this.job.type]) : i18n.global.t(JobType2Text[this.job.type])}`, this.tag, this.runtime);
53
34
  const child = this.job.category == JobCategory.Execution ? this.execute_job_exe() : this.execute_job_con();
54
35
  return child;
@@ -56,11 +37,6 @@ export class ClientJobExecute {
56
37
  stop_all = () => {
57
38
  this.os.stopall();
58
39
  };
59
- /**
60
- * Execute the job that classify as run
61
- * @param job Target job
62
- * @returns Promise instance
63
- */
64
40
  execute_job_exe = () => {
65
41
  return new Promise(async (resolve, reject) => {
66
42
  switch (this.job.type) {
@@ -156,11 +132,6 @@ export class ClientJobExecute {
156
132
  }
157
133
  });
158
134
  };
159
- /**
160
- * Execute the job that classify as condition
161
- * @param job Target job
162
- * @returns Promise instance
163
- */
164
135
  execute_job_con = () => {
165
136
  return new Promise(async (resolve, reject) => {
166
137
  switch (this.job.type) {
@@ -1,27 +1,11 @@
1
1
  import { Messager, Messager_log, OnePath, TwoPath } from "../interface";
2
2
  type getstring = () => string;
3
- /**
4
- * The operation system related actions utility\
5
- * If you want to do something related to things below
6
- * * File operation
7
- * * Folder checker
8
- * * Writing a file
9
- * * Call a exe file
10
- *
11
- * Please get a instance of this, and call the methods instead using fs youself
12
- */
13
3
  export declare class ClientOS {
14
4
  private messager;
15
5
  private messager_log;
16
6
  private tag;
17
7
  private runtime;
18
8
  private children;
19
- /**
20
- *
21
- * @param _tag The tag getter that put in the prefix of the message
22
- * @param _messager Message method
23
- * @param _messager_log Message method with output on the screen feature
24
- */
25
9
  constructor(_tag: getstring, _runtime: getstring, _messager: Messager, _messager_log: Messager_log);
26
10
  file_copy: (data: TwoPath) => void;
27
11
  dir_copy: (data: TwoPath) => void;
@@ -36,18 +20,8 @@ export declare class ClientOS {
36
20
  dir_create: (data: OnePath) => void;
37
21
  file_write: (data: TwoPath) => void;
38
22
  file_read: (data: OnePath) => string;
39
- /**
40
- * Kill all current running processes
41
- */
42
23
  stopall: () => void;
43
24
  lib_command: (command: string, args: string) => Promise<string>;
44
- /**
45
- * Call command on terminal
46
- * @param cwd The system location
47
- * @param command Command name, Or you can put filename here
48
- * @param args Arguments, It will split by space afterward
49
- * @returns
50
- */
51
25
  command: (command: string, args: string, cwd?: string) => Promise<string>;
52
26
  command_sync: (command: string, args: string, cwd?: string) => Promise<string>;
53
27
  command_exec: (command: string, args: string, cwd?: string) => void;
package/dist/client/os.js CHANGED
@@ -1,36 +1,15 @@
1
- // ========================
2
- //
3
- // Share Codebase
4
- //
5
- // ========================
6
1
  import { exec, spawn } from 'child_process';
7
2
  import tkill from 'tree-kill';
8
3
  import * as fs from "fs";
9
4
  import * as path from "path";
10
5
  import * as os from "os";
11
6
  import { DATA_FOLDER } from "../interface";
12
- /**
13
- * The operation system related actions utility\
14
- * If you want to do something related to things below
15
- * * File operation
16
- * * Folder checker
17
- * * Writing a file
18
- * * Call a exe file
19
- *
20
- * Please get a instance of this, and call the methods instead using fs youself
21
- */
22
7
  export class ClientOS {
23
8
  messager;
24
9
  messager_log;
25
10
  tag;
26
11
  runtime;
27
12
  children = [];
28
- /**
29
- *
30
- * @param _tag The tag getter that put in the prefix of the message
31
- * @param _messager Message method
32
- * @param _messager_log Message method with output on the screen feature
33
- */
34
13
  constructor(_tag, _runtime, _messager, _messager_log) {
35
14
  this.tag = _tag;
36
15
  this.runtime = _runtime;
@@ -95,9 +74,6 @@ export class ClientOS {
95
74
  file_read = (data) => {
96
75
  return fs.readFileSync(data.path).toString();
97
76
  };
98
- /**
99
- * Kill all current running processes
100
- */
101
77
  stopall = () => {
102
78
  this.children.forEach(x => {
103
79
  x.stdin.write('q');
@@ -110,13 +86,6 @@ export class ClientOS {
110
86
  const cc = process.platform == "win32" ? command : "./" + command;
111
87
  return this.command(cc, args, path.join(os.homedir(), DATA_FOLDER, "exe"));
112
88
  };
113
- /**
114
- * Call command on terminal
115
- * @param cwd The system location
116
- * @param command Command name, Or you can put filename here
117
- * @param args Arguments, It will split by space afterward
118
- * @returns
119
- */
120
89
  command = async (command, args, cwd) => {
121
90
  this.messager_log(`[OS Action] Command cwd: ${cwd}`, this.tag());
122
91
  this.messager_log(`[OS Action] Command command: ${command}`, this.tag());
@@ -128,7 +97,6 @@ export class ClientOS {
128
97
  stdio: ['pipe', 'pipe', 'pipe']
129
98
  });
130
99
  child.stdin.setDefaultEncoding('utf8');
131
- // The kill process detecter
132
100
  child.on('spawn', () => {
133
101
  this.children.push(child);
134
102
  this.messager_log(`[Command] Spawn process`, this.tag());
@@ -1,8 +1,5 @@
1
1
  import { ResourceType } from "../interface";
2
2
  import { SystemLoad } from "../interface/struct";
3
- /**
4
- * The resource query helper
5
- */
6
3
  export declare class ClientResource {
7
4
  is_query: boolean;
8
5
  Query: (src?: SystemLoad | undefined, type?: ResourceType) => Promise<SystemLoad>;
@@ -1,13 +1,5 @@
1
- // ========================
2
- //
3
- // Share Codebase
4
- //
5
- // ========================
6
1
  import si from "systeminformation";
7
2
  import { ResourceType } from "../interface";
8
- /**
9
- * The resource query helper
10
- */
11
3
  export class ClientResource {
12
4
  is_query = false;
13
5
  Query = async (src = undefined, type = ResourceType.ALL) => {
@@ -7,25 +7,9 @@ export declare class ClientShell {
7
7
  private os;
8
8
  private shell_workers;
9
9
  constructor(_messager: Messager, _messager_log: Messager, _client: Client);
10
- /**
11
- * Open shell console
12
- * @param input
13
- */
14
10
  open_shell: (data: number, source: WebSocket) => void;
15
- /**
16
- * Open shell console
17
- * @param input
18
- */
19
11
  enter_shell: (input: string, source: WebSocket) => void;
20
- /**
21
- * Open shell console
22
- * @param input
23
- */
24
12
  close_shell: (data: number, source: WebSocket) => void;
25
- /**
26
- * Open shell console
27
- * @param input
28
- */
29
13
  close_shell_all: (data: number) => void;
30
14
  shell_folder: (data: string, source: WebSocket) => void;
31
15
  disconnect: (source: WebSocket) => void;
@@ -1,8 +1,3 @@
1
- // ========================
2
- //
3
- // Share Codebase
4
- //
5
- // ========================
6
1
  import { spawn } from "child_process";
7
2
  import { ClientOS } from "./os";
8
3
  export class ClientShell {
@@ -15,10 +10,6 @@ export class ClientShell {
15
10
  this.messager = _messager;
16
11
  this.messager_log = _messager_log;
17
12
  }
18
- /**
19
- * Open shell console
20
- * @param input
21
- */
22
13
  open_shell = (data, source) => {
23
14
  if (this.shell_workers.find(x => x[0] == source)) {
24
15
  this.messager_log(`[Shell] Error the source already open the shell`);
@@ -70,10 +61,6 @@ export class ClientShell {
70
61
  workerFeedback(chunk.toString());
71
62
  });
72
63
  };
73
- /**
74
- * Open shell console
75
- * @param input
76
- */
77
64
  enter_shell = (input, source) => {
78
65
  const p = this.shell_workers.find(x => x[0] == source);
79
66
  if (p == undefined) {
@@ -86,10 +73,6 @@ export class ClientShell {
86
73
  else
87
74
  p[1].stdin?.write("pwd" + '\n');
88
75
  };
89
- /**
90
- * Open shell console
91
- * @param input
92
- */
93
76
  close_shell = (data, source) => {
94
77
  const p = this.shell_workers.find(x => x[0] == source);
95
78
  if (p == undefined) {
@@ -98,10 +81,6 @@ export class ClientShell {
98
81
  }
99
82
  p[1].kill();
100
83
  };
101
- /**
102
- * Open shell console
103
- * @param input
104
- */
105
84
  close_shell_all = (data) => {
106
85
  this.shell_workers.forEach(p => {
107
86
  if (p == undefined) {
@@ -1,6 +1,3 @@
1
- /**
2
- * Client
3
- */
4
1
  export * as ClientAnalysis from './client/analysis';
5
2
  export * as Client from './client/client';
6
3
  export * as ClientCluster from './client/cluster';
@@ -13,17 +10,7 @@ export * as ClientOS from './client/os';
13
10
  export * as ClientParameter from './client/database';
14
11
  export * as ClientResource from './client/resource';
15
12
  export * as ClientShell from './client/shell';
16
- /**
17
- * Scripts
18
- */
19
13
  export * as Execute_WebhookServerManager from './script/webhook_server_manager';
20
- /**
21
- * Server
22
- */
23
14
  export * as ServerWorker from './server/server2';
24
15
  export * as ServerIO from './server/io2';
25
16
  export * as ServerModule_Account from './server/module/account';
26
- /**
27
- * Util Components
28
- */
29
- export * as UtilPort from './util/port';
package/dist/computed.js CHANGED
@@ -1,29 +1,32 @@
1
- /**
2
- * Client
3
- */
4
- export * as ClientAnalysis from './client/analysis';
5
- export * as Client from './client/client';
6
- export * as ClientCluster from './client/cluster';
7
- export * as ClientExecute from './client/execute';
8
- export * as ClientJobExecute from './client/job_execute';
9
- export * as ClientJobParameter from './client/job_database';
10
- export * as ClientHttp from './client/http';
11
- export * as ClientJavascript from './client/javascript';
12
- export * as ClientOS from './client/os';
13
- export * as ClientParameter from './client/database';
14
- export * as ClientResource from './client/resource';
15
- export * as ClientShell from './client/shell';
16
- /**
17
- * Scripts
18
- */
19
- export * as Execute_WebhookServerManager from './script/webhook_server_manager';
20
- /**
21
- * Server
22
- */
23
- export * as ServerWorker from './server/server2';
24
- export * as ServerIO from './server/io2';
25
- export * as ServerModule_Account from './server/module/account';
26
- /**
27
- * Util Components
28
- */
29
- export * as UtilPort from './util/port';
1
+ import * as ClientAnalysis_1 from './client/analysis';
2
+ export { ClientAnalysis_1 as ClientAnalysis };
3
+ import * as Client_1 from './client/client';
4
+ export { Client_1 as Client };
5
+ import * as ClientCluster_1 from './client/cluster';
6
+ export { ClientCluster_1 as ClientCluster };
7
+ import * as ClientExecute_1 from './client/execute';
8
+ export { ClientExecute_1 as ClientExecute };
9
+ import * as ClientJobExecute_1 from './client/job_execute';
10
+ export { ClientJobExecute_1 as ClientJobExecute };
11
+ import * as ClientJobParameter_1 from './client/job_database';
12
+ export { ClientJobParameter_1 as ClientJobParameter };
13
+ import * as ClientHttp_1 from './client/http';
14
+ export { ClientHttp_1 as ClientHttp };
15
+ import * as ClientJavascript_1 from './client/javascript';
16
+ export { ClientJavascript_1 as ClientJavascript };
17
+ import * as ClientOS_1 from './client/os';
18
+ export { ClientOS_1 as ClientOS };
19
+ import * as ClientParameter_1 from './client/database';
20
+ export { ClientParameter_1 as ClientParameter };
21
+ import * as ClientResource_1 from './client/resource';
22
+ export { ClientResource_1 as ClientResource };
23
+ import * as ClientShell_1 from './client/shell';
24
+ export { ClientShell_1 as ClientShell };
25
+ import * as Execute_WebhookServerManager_1 from './script/webhook_server_manager';
26
+ export { Execute_WebhookServerManager_1 as Execute_WebhookServerManager };
27
+ import * as ServerWorker_1 from './server/server2';
28
+ export { ServerWorker_1 as ServerWorker };
29
+ import * as ServerIO_1 from './server/io2';
30
+ export { ServerIO_1 as ServerIO };
31
+ import * as ServerModule_Account_1 from './server/module/account';
32
+ export { ServerModule_Account_1 as ServerModule_Account };
package/dist/index.js CHANGED
@@ -1,8 +1,4 @@
1
- // ? Cannot be import in browser
2
1
  export * from './computed';
3
- // ? Can be import in browser
4
2
  export * from './interface';
5
- // ? Cannot be import in browser
6
3
  export * from './server';
7
- // ? Only for utility purpose, outside the application logic
8
4
  export * from './utility';