verteilen-core 1.3.16 → 1.3.17
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/interface/base.d.ts +11 -5
- package/dist/interface/enum.d.ts +5 -2
- package/dist/interface/enum.js +5 -2
- package/dist/interface/struct.d.ts +4 -2
- package/dist/server/module/log.d.ts +2 -0
- package/dist/server/module/log.js +6 -0
- package/package.json +1 -1
- package/src/interface/base.ts +41 -27
- package/src/interface/enum.ts +6 -1
- package/src/interface/struct.ts +40 -2
- package/src/server/module/log.ts +5 -0
package/dist/interface/base.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export interface DatabaseConfigTrigger {
|
|
|
6
6
|
}
|
|
7
7
|
export interface DataHeader {
|
|
8
8
|
uuid: string;
|
|
9
|
+
createDate?: string;
|
|
10
|
+
updateDate?: string;
|
|
9
11
|
}
|
|
10
12
|
export interface DatabaseContainer {
|
|
11
13
|
name: string;
|
|
@@ -52,7 +54,13 @@ export interface Job extends DataHeader {
|
|
|
52
54
|
permission?: LocalPermission;
|
|
53
55
|
acl?: ACLType;
|
|
54
56
|
}
|
|
55
|
-
export interface
|
|
57
|
+
export interface TaskBase {
|
|
58
|
+
properties: Array<Property>;
|
|
59
|
+
logic?: TaskLogic;
|
|
60
|
+
jobs: Array<Job>;
|
|
61
|
+
jobs_uuid: Array<string>;
|
|
62
|
+
}
|
|
63
|
+
export interface TaskOption {
|
|
56
64
|
title: string;
|
|
57
65
|
description: string;
|
|
58
66
|
setupjob: boolean;
|
|
@@ -60,10 +68,8 @@ export interface Task extends DataHeader {
|
|
|
60
68
|
cronjobKey: string;
|
|
61
69
|
multi: boolean;
|
|
62
70
|
multiKey: string;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
jobs: Array<Job>;
|
|
66
|
-
jobs_uuid: Array<string>;
|
|
71
|
+
}
|
|
72
|
+
export interface Task extends DataHeader, TaskBase, TaskOption {
|
|
67
73
|
permission?: LocalPermission;
|
|
68
74
|
acl?: ACLType;
|
|
69
75
|
}
|
package/dist/interface/enum.d.ts
CHANGED
package/dist/interface/enum.js
CHANGED
|
@@ -4,8 +4,11 @@ exports.DatabaseTemplateText = exports.ProjectTemplateText = exports.JobType2Tex
|
|
|
4
4
|
var TaskLogicType;
|
|
5
5
|
(function (TaskLogicType) {
|
|
6
6
|
TaskLogicType[TaskLogicType["GROUP"] = 0] = "GROUP";
|
|
7
|
-
TaskLogicType[TaskLogicType["
|
|
8
|
-
TaskLogicType[TaskLogicType["
|
|
7
|
+
TaskLogicType[TaskLogicType["CONDITION"] = 1] = "CONDITION";
|
|
8
|
+
TaskLogicType[TaskLogicType["EXECUTION"] = 2] = "EXECUTION";
|
|
9
|
+
TaskLogicType[TaskLogicType["Single"] = 3] = "Single";
|
|
10
|
+
TaskLogicType[TaskLogicType["ADD"] = 4] = "ADD";
|
|
11
|
+
TaskLogicType[TaskLogicType["OR"] = 5] = "OR";
|
|
9
12
|
})(TaskLogicType || (exports.TaskLogicType = TaskLogicType = {}));
|
|
10
13
|
var SocketState;
|
|
11
14
|
(function (SocketState) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DatabaseContainer, Project } from "./base";
|
|
1
|
+
import { DatabaseContainer, Job, Project } from "./base";
|
|
2
2
|
import ws from 'ws';
|
|
3
3
|
import { ServiceMode, TaskLogicType } from "./enum";
|
|
4
4
|
import { ACLType, LocalPermission } from "./server";
|
|
@@ -188,8 +188,10 @@ export interface ServiceConfig {
|
|
|
188
188
|
}
|
|
189
189
|
export interface TaskLogicUnit {
|
|
190
190
|
type: TaskLogicType;
|
|
191
|
-
|
|
191
|
+
job_uuid?: string;
|
|
192
|
+
job?: Job;
|
|
192
193
|
children: Array<TaskLogicUnit>;
|
|
194
|
+
children2?: Array<TaskLogicUnit>;
|
|
193
195
|
}
|
|
194
196
|
export interface TaskLogic {
|
|
195
197
|
group: Array<TaskLogicUnit>;
|
package/package.json
CHANGED
package/src/interface/base.ts
CHANGED
|
@@ -23,6 +23,8 @@ export interface DataHeader{
|
|
|
23
23
|
* Contains 36 characters
|
|
24
24
|
*/
|
|
25
25
|
uuid: string
|
|
26
|
+
createDate?: string
|
|
27
|
+
updateDate?: string
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
/**
|
|
@@ -219,10 +221,40 @@ export interface Job extends DataHeader {
|
|
|
219
221
|
acl?: ACLType
|
|
220
222
|
}
|
|
221
223
|
/**
|
|
222
|
-
* **Task Container**\
|
|
223
|
-
*
|
|
224
|
+
* **Task Base Container**\
|
|
225
|
+
* For different view to submit task update data
|
|
226
|
+
*/
|
|
227
|
+
export interface TaskBase {
|
|
228
|
+
/**
|
|
229
|
+
* **Task Properties**\
|
|
230
|
+
* You could use properties to defined local region field
|
|
231
|
+
* And reference in the job execute context\
|
|
232
|
+
* **NOTICE: Order Matter**\
|
|
233
|
+
* The properties will generate base on the order in the list
|
|
234
|
+
*/
|
|
235
|
+
properties: Array<Property>
|
|
236
|
+
/**
|
|
237
|
+
* **Task Logic**\
|
|
238
|
+
* Describe the logic flow of the task
|
|
239
|
+
*/
|
|
240
|
+
logic?: TaskLogic
|
|
241
|
+
/**
|
|
242
|
+
* **Execute Jobs Context**\
|
|
243
|
+
* A list of jobs, define the context of the task\
|
|
244
|
+
* Base on the flags, task can run it in a different way
|
|
245
|
+
*/
|
|
246
|
+
jobs: Array<Job>
|
|
247
|
+
/**
|
|
248
|
+
* **Jobs ID**\
|
|
249
|
+
* Store in disk
|
|
250
|
+
*/
|
|
251
|
+
jobs_uuid: Array<string>
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* **Task Header Container**\
|
|
255
|
+
* For different view to submit task update data
|
|
224
256
|
*/
|
|
225
|
-
export interface
|
|
257
|
+
export interface TaskOption {
|
|
226
258
|
/**
|
|
227
259
|
* **Task Name**\
|
|
228
260
|
* The name of the task
|
|
@@ -262,30 +294,12 @@ export interface Task extends DataHeader {
|
|
|
262
294
|
* Reference a database number in database
|
|
263
295
|
*/
|
|
264
296
|
multiKey: string
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
*/
|
|
272
|
-
properties: Array<Property>
|
|
273
|
-
/**
|
|
274
|
-
* **Task Logic**\
|
|
275
|
-
* Describe the logic flow of the task
|
|
276
|
-
*/
|
|
277
|
-
logic?: TaskLogic
|
|
278
|
-
/**
|
|
279
|
-
* **Execute Jobs Context**\
|
|
280
|
-
* A list of jobs, define the context of the task\
|
|
281
|
-
* Base on the flags, task can run it in a different way
|
|
282
|
-
*/
|
|
283
|
-
jobs: Array<Job>
|
|
284
|
-
/**
|
|
285
|
-
* **Jobs ID**\
|
|
286
|
-
* Store in disk
|
|
287
|
-
*/
|
|
288
|
-
jobs_uuid: Array<string>
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* **Task Container**\
|
|
300
|
+
* Specified different stage of the compute process
|
|
301
|
+
*/
|
|
302
|
+
export interface Task extends DataHeader, TaskBase, TaskOption {
|
|
289
303
|
/**
|
|
290
304
|
* **Local Permission**\
|
|
291
305
|
* Client-side only permission field\
|
package/src/interface/enum.ts
CHANGED
|
@@ -7,8 +7,13 @@
|
|
|
7
7
|
* Enum library, including translation which will be use in Vue
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* **SubTask Logic Type**\
|
|
12
|
+
* Define the container logic type\
|
|
13
|
+
* It effect the decoder behaviour
|
|
14
|
+
*/
|
|
10
15
|
export enum TaskLogicType {
|
|
11
|
-
GROUP, ADD, OR
|
|
16
|
+
GROUP, CONDITION, EXECUTION, Single, ADD, OR
|
|
12
17
|
}
|
|
13
18
|
|
|
14
19
|
/**
|
package/src/interface/struct.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* All kinds of data structure
|
|
8
8
|
* It's a mess, i know
|
|
9
9
|
*/
|
|
10
|
-
import { DatabaseContainer, Project } from "./base"
|
|
10
|
+
import { DatabaseContainer, Job, Project } from "./base"
|
|
11
11
|
import ws from 'ws'
|
|
12
12
|
import { ServiceMode, TaskLogicType } from "./enum"
|
|
13
13
|
import { ACLType, LocalPermission } from "./server"
|
|
@@ -328,10 +328,48 @@ export interface ServiceConfig {
|
|
|
328
328
|
|
|
329
329
|
export interface TaskLogicUnit {
|
|
330
330
|
type: TaskLogicType
|
|
331
|
-
|
|
331
|
+
/**
|
|
332
|
+
* **Attach Job ID**
|
|
333
|
+
*/
|
|
334
|
+
job_uuid?: string
|
|
335
|
+
/**
|
|
336
|
+
* **Attach Job Container (Runtime)**
|
|
337
|
+
*/
|
|
338
|
+
job?: Job
|
|
339
|
+
/**
|
|
340
|
+
* **Common Logic Group**
|
|
341
|
+
*/
|
|
332
342
|
children: Array<TaskLogicUnit>
|
|
343
|
+
/**
|
|
344
|
+
* **False Logic Group**
|
|
345
|
+
* - Group
|
|
346
|
+
* - Condition
|
|
347
|
+
* - Execution (True)
|
|
348
|
+
* - Execution (False) <- This part
|
|
349
|
+
*/
|
|
350
|
+
children2?: Array<TaskLogicUnit>
|
|
333
351
|
}
|
|
334
352
|
|
|
353
|
+
/**
|
|
354
|
+
* **Job Logic Container**\
|
|
355
|
+
* The strategy pattern for a single subtask to use\
|
|
356
|
+
* For example:
|
|
357
|
+
* - Group
|
|
358
|
+
* - Condition
|
|
359
|
+
* - Add
|
|
360
|
+
* - Or
|
|
361
|
+
* - Single
|
|
362
|
+
* - Single
|
|
363
|
+
* - Or
|
|
364
|
+
* - Single
|
|
365
|
+
* - Single
|
|
366
|
+
* - Execution (True)
|
|
367
|
+
* - Single
|
|
368
|
+
* - Single
|
|
369
|
+
* - Execution (False)
|
|
370
|
+
* - Single
|
|
371
|
+
* - Single
|
|
372
|
+
*/
|
|
335
373
|
export interface TaskLogic {
|
|
336
374
|
group: Array<TaskLogicUnit>
|
|
337
375
|
}
|