verteilen-core 1.3.8 → 1.3.9

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.
@@ -85,3 +85,6 @@ export interface Node extends DataHeader {
85
85
  permission?: LocalPermission;
86
86
  acl?: ACLType;
87
87
  }
88
+ export declare const CreateDefaultProject: () => Project;
89
+ export declare const CreateDefaultTask: () => Task;
90
+ export declare const CreateDefaultJob: () => Job;
@@ -1,2 +1,45 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateDefaultJob = exports.CreateDefaultTask = exports.CreateDefaultProject = void 0;
4
+ const enum_1 = require("./enum");
5
+ const uuid_1 = require("uuid");
6
+ const CreateDefaultProject = () => {
7
+ return {
8
+ uuid: (0, uuid_1.v6)(),
9
+ title: "",
10
+ description: "",
11
+ tasks: [],
12
+ tasks_uuid: [],
13
+ database_uuid: ""
14
+ };
15
+ };
16
+ exports.CreateDefaultProject = CreateDefaultProject;
17
+ const CreateDefaultTask = () => {
18
+ return {
19
+ uuid: (0, uuid_1.v6)(),
20
+ title: "Default",
21
+ description: "",
22
+ setupjob: false,
23
+ cronjob: false,
24
+ cronjobKey: "",
25
+ multi: false,
26
+ multiKey: "",
27
+ properties: [],
28
+ jobs: [],
29
+ jobs_uuid: [],
30
+ };
31
+ };
32
+ exports.CreateDefaultTask = CreateDefaultTask;
33
+ const CreateDefaultJob = () => {
34
+ return {
35
+ uuid: (0, uuid_1.v6)(),
36
+ category: enum_1.JobCategory.Execution,
37
+ type: enum_1.JobType.JAVASCRIPT,
38
+ script: "",
39
+ string_args: [],
40
+ number_args: [],
41
+ boolean_args: [],
42
+ id_args: [],
43
+ };
44
+ };
45
+ exports.CreateDefaultJob = CreateDefaultJob;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "verteilen-core",
3
- "version": "1.3.8",
3
+ "version": "1.3.9",
4
4
  "license": "MIT",
5
5
  "homepage": "https://verteilen.github.io/wiki/",
6
6
  "author": "Elly",
@@ -6,9 +6,10 @@
6
6
  /**
7
7
  * Defined the basic compute use data structure
8
8
  */
9
- import { DataType, DataTypeBase, JobType, JobType2, ServiceMode } from "./enum"
9
+ import { DataType, DataTypeBase, JobCategory, JobType, JobType2, ServiceMode } from "./enum"
10
10
  import { ACLType, LocalPermission as LocalPermission } from "./server"
11
11
  import { TaskLogic } from "./struct"
12
+ import { v6 as uuidv6 } from 'uuid'
12
13
 
13
14
  export interface DatabaseConfigTrigger {
14
15
  types: Array<DataTypeBase>
@@ -389,4 +390,45 @@ export interface Node extends DataHeader {
389
390
  * Could be public, protected, private
390
391
  */
391
392
  acl?: ACLType
393
+ }
394
+
395
+
396
+ export const CreateDefaultProject = () : Project => {
397
+ return {
398
+ uuid: uuidv6(),
399
+ title: "",
400
+ description: "",
401
+ tasks: [],
402
+ tasks_uuid: [],
403
+ database_uuid: ""
404
+ }
405
+ }
406
+
407
+ export const CreateDefaultTask = () : Task => {
408
+ return {
409
+ uuid: uuidv6(),
410
+ title: "Default",
411
+ description: "",
412
+ setupjob: false,
413
+ cronjob: false,
414
+ cronjobKey: "",
415
+ multi: false,
416
+ multiKey: "",
417
+ properties: [],
418
+ jobs: [],
419
+ jobs_uuid: [],
420
+ }
421
+ }
422
+
423
+ export const CreateDefaultJob = () : Job => {
424
+ return {
425
+ uuid: uuidv6(),
426
+ category: JobCategory.Execution,
427
+ type: JobType.JAVASCRIPT,
428
+ script: "",
429
+ string_args: [],
430
+ number_args: [],
431
+ boolean_args: [],
432
+ id_args: [],
433
+ }
392
434
  }