verteilen-core 1.3.16 → 1.3.18

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.
@@ -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;
@@ -40,6 +42,8 @@ export interface Database extends DataHeader {
40
42
  }
41
43
  export interface Job extends DataHeader {
42
44
  index?: number;
45
+ title: string;
46
+ description: string;
43
47
  meta?: any;
44
48
  runtime_uuid?: string;
45
49
  category: number;
@@ -52,7 +56,13 @@ export interface Job extends DataHeader {
52
56
  permission?: LocalPermission;
53
57
  acl?: ACLType;
54
58
  }
55
- export interface Task extends DataHeader {
59
+ export interface TaskBase {
60
+ properties: Array<Property>;
61
+ logic?: TaskLogic;
62
+ jobs: Array<Job>;
63
+ jobs_uuid: Array<string>;
64
+ }
65
+ export interface TaskOption {
56
66
  title: string;
57
67
  description: string;
58
68
  setupjob: boolean;
@@ -60,10 +70,8 @@ export interface Task extends DataHeader {
60
70
  cronjobKey: string;
61
71
  multi: boolean;
62
72
  multiKey: string;
63
- properties: Array<Property>;
64
- logic?: TaskLogic;
65
- jobs: Array<Job>;
66
- jobs_uuid: Array<string>;
73
+ }
74
+ export interface Task extends DataHeader, TaskBase, TaskOption {
67
75
  permission?: LocalPermission;
68
76
  acl?: ACLType;
69
77
  }
@@ -33,6 +33,8 @@ exports.CreateDefaultTask = CreateDefaultTask;
33
33
  const CreateDefaultJob = () => {
34
34
  return {
35
35
  uuid: (0, uuid_1.v6)(),
36
+ title: "",
37
+ description: "",
36
38
  category: enum_1.JobCategory.Execution,
37
39
  type: enum_1.JobType.JAVASCRIPT,
38
40
  script: "",
@@ -1,7 +1,10 @@
1
1
  export declare enum TaskLogicType {
2
2
  GROUP = 0,
3
- ADD = 1,
4
- OR = 2
3
+ CONDITION = 1,
4
+ EXECUTION = 2,
5
+ Single = 3,
6
+ ADD = 4,
7
+ OR = 5
5
8
  }
6
9
  export declare enum SocketState {
7
10
  CONNECTING = 0,
@@ -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["ADD"] = 1] = "ADD";
8
- TaskLogicType[TaskLogicType["OR"] = 2] = "OR";
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
- job: string;
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/dist/lan/en.json CHANGED
@@ -412,5 +412,8 @@
412
412
  "no": "No",
413
413
  "next": "Next",
414
414
  "previous": "Previous",
415
- "goback": "Go Back"
415
+ "goback": "Go Back",
416
+ "logic": "Logic",
417
+ "use_logic": "Use Logic",
418
+ "remove_logic": "Remove Logic"
416
419
  }
@@ -412,5 +412,8 @@
412
412
  "no": "否",
413
413
  "next": "下一步",
414
414
  "previous": "上一歩",
415
- "goback": "返回"
415
+ "goback": "返回",
416
+ "logic": "邏輯",
417
+ "use_logic": "套用邏輯",
418
+ "remove_logic": "刪除邏輯"
416
419
  }
@@ -421,6 +421,9 @@ export declare const i18nDefaultData: {
421
421
  next: string;
422
422
  previous: string;
423
423
  goback: string;
424
+ logic: string;
425
+ use_logic: string;
426
+ remove_logic: string;
424
427
  };
425
428
  zh_TW: {
426
429
  login: {
@@ -837,6 +840,9 @@ export declare const i18nDefaultData: {
837
840
  next: string;
838
841
  previous: string;
839
842
  goback: string;
843
+ logic: string;
844
+ use_logic: string;
845
+ remove_logic: string;
840
846
  };
841
847
  };
842
848
  };
@@ -1256,6 +1262,9 @@ export declare const i18n: import("vue-i18n").I18n<{
1256
1262
  next: string;
1257
1263
  previous: string;
1258
1264
  goback: string;
1265
+ logic: string;
1266
+ use_logic: string;
1267
+ remove_logic: string;
1259
1268
  };
1260
1269
  zh_TW: {
1261
1270
  login: {
@@ -1672,6 +1681,9 @@ export declare const i18n: import("vue-i18n").I18n<{
1672
1681
  next: string;
1673
1682
  previous: string;
1674
1683
  goback: string;
1684
+ logic: string;
1685
+ use_logic: string;
1686
+ remove_logic: string;
1675
1687
  };
1676
1688
  }, {}, {}, string, true>;
1677
1689
  export declare const raw_i18n: I18n;
@@ -0,0 +1,2 @@
1
+ export declare class Log_Module {
2
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Log_Module = void 0;
4
+ class Log_Module {
5
+ }
6
+ exports.Log_Module = Log_Module;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verteilen-core",
3
- "version": "1.3.16",
3
+ "version": "1.3.18",
4
4
  "license": "MIT",
5
5
  "homepage": "https://verteilen.github.io/wiki/",
6
6
  "author": "Elly",
@@ -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
  /**
@@ -152,6 +154,8 @@ export interface Job extends DataHeader {
152
154
  * Database will store in the array.
153
155
  */
154
156
  index?:number
157
+ title: string
158
+ description: string
155
159
  /**
156
160
  * **Extra data**\
157
161
  * The extra metadata, just in case
@@ -219,10 +223,40 @@ export interface Job extends DataHeader {
219
223
  acl?: ACLType
220
224
  }
221
225
  /**
222
- * **Task Container**\
223
- * Specified different stage of the compute process
226
+ * **Task Base Container**\
227
+ * For different view to submit task update data
228
+ */
229
+ export interface TaskBase {
230
+ /**
231
+ * **Task Properties**\
232
+ * You could use properties to defined local region field
233
+ * And reference in the job execute context\
234
+ * **NOTICE: Order Matter**\
235
+ * The properties will generate base on the order in the list
236
+ */
237
+ properties: Array<Property>
238
+ /**
239
+ * **Task Logic**\
240
+ * Describe the logic flow of the task
241
+ */
242
+ logic?: TaskLogic
243
+ /**
244
+ * **Execute Jobs Context**\
245
+ * A list of jobs, define the context of the task\
246
+ * Base on the flags, task can run it in a different way
247
+ */
248
+ jobs: Array<Job>
249
+ /**
250
+ * **Jobs ID**\
251
+ * Store in disk
252
+ */
253
+ jobs_uuid: Array<string>
254
+ }
255
+ /**
256
+ * **Task Header Container**\
257
+ * For different view to submit task update data
224
258
  */
225
- export interface Task extends DataHeader {
259
+ export interface TaskOption {
226
260
  /**
227
261
  * **Task Name**\
228
262
  * The name of the task
@@ -262,30 +296,12 @@ export interface Task extends DataHeader {
262
296
  * Reference a database number in database
263
297
  */
264
298
  multiKey: string
265
- /**
266
- * **Task Properties**\
267
- * You could use properties to defined local region field
268
- * And reference in the job execute context\
269
- * **NOTICE: Order Matter**\
270
- * The properties will generate base on the order in the list
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>
299
+ }
300
+ /**
301
+ * **Task Container**\
302
+ * Specified different stage of the compute process
303
+ */
304
+ export interface Task extends DataHeader, TaskBase, TaskOption {
289
305
  /**
290
306
  * **Local Permission**\
291
307
  * Client-side only permission field\
@@ -423,6 +439,8 @@ export const CreateDefaultTask = () : Task => {
423
439
  export const CreateDefaultJob = () : Job => {
424
440
  return {
425
441
  uuid: uuidv6(),
442
+ title: "",
443
+ description: "",
426
444
  category: JobCategory.Execution,
427
445
  type: JobType.JAVASCRIPT,
428
446
  script: "",
@@ -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
  /**
@@ -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
- job: string
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
  }
package/src/lan/en.json CHANGED
@@ -412,5 +412,8 @@
412
412
  "no": "No",
413
413
  "next": "Next",
414
414
  "previous": "Previous",
415
- "goback": "Go Back"
415
+ "goback": "Go Back",
416
+ "logic": "Logic",
417
+ "use_logic": "Use Logic",
418
+ "remove_logic": "Remove Logic"
416
419
  }
@@ -412,5 +412,8 @@
412
412
  "no": "否",
413
413
  "next": "下一步",
414
414
  "previous": "上一歩",
415
- "goback": "返回"
415
+ "goback": "返回",
416
+ "logic": "邏輯",
417
+ "use_logic": "套用邏輯",
418
+ "remove_logic": "刪除邏輯"
416
419
  }
@@ -0,0 +1,5 @@
1
+
2
+
3
+ export class Log_Module {
4
+
5
+ }