@enonic-types/lib-scheduler 8.0.4-B2 → 8.1.0-B1
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/package.json +2 -2
- package/scheduler.d.ts +9 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enonic-types/lib-scheduler",
|
|
3
|
-
"version": "8.0
|
|
3
|
+
"version": "8.1.0-B1",
|
|
4
4
|
"description": "Type definitions for lib-scheduler.",
|
|
5
5
|
"types": "scheduler.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"homepage": "https://github.com/enonic/xp/tree/master#readme",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@enonic-types/core": "8.0
|
|
30
|
+
"@enonic-types/core": "8.1.0-B1"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
package/scheduler.d.ts
CHANGED
|
@@ -19,19 +19,24 @@ export interface CreateScheduledJobParams<Config extends Record<string, unknown>
|
|
|
19
19
|
description?: string;
|
|
20
20
|
descriptor: string;
|
|
21
21
|
config?: Config;
|
|
22
|
-
schedule: OneTimeSchedule | CronSchedule;
|
|
22
|
+
schedule: OneTimeSchedule | CronSchedule | FixedRateSchedule;
|
|
23
23
|
user?: UserKey;
|
|
24
24
|
enabled: boolean;
|
|
25
25
|
}
|
|
26
26
|
export interface OneTimeSchedule {
|
|
27
27
|
type: 'ONE_TIME';
|
|
28
28
|
value: string;
|
|
29
|
+
deleteAfterRun?: boolean;
|
|
29
30
|
}
|
|
30
31
|
export interface CronSchedule {
|
|
31
32
|
type: 'CRON';
|
|
32
33
|
value: string;
|
|
33
34
|
timeZone: string;
|
|
34
35
|
}
|
|
36
|
+
export interface FixedRateSchedule {
|
|
37
|
+
type: 'FIXED_RATE';
|
|
38
|
+
value: string;
|
|
39
|
+
}
|
|
35
40
|
export interface ScheduledJob<Config extends Record<string, unknown> = Record<string, unknown>> {
|
|
36
41
|
name: string;
|
|
37
42
|
descriptor: string;
|
|
@@ -45,7 +50,7 @@ export interface ScheduledJob<Config extends Record<string, unknown> = Record<st
|
|
|
45
50
|
modifiedTime: string;
|
|
46
51
|
lastRun?: string | null;
|
|
47
52
|
lastTaskId?: string | null;
|
|
48
|
-
schedule: OneTimeSchedule | CronSchedule;
|
|
53
|
+
schedule: OneTimeSchedule | CronSchedule | FixedRateSchedule;
|
|
49
54
|
}
|
|
50
55
|
/**
|
|
51
56
|
* Creates a job to be scheduled.
|
|
@@ -59,8 +64,9 @@ export interface ScheduledJob<Config extends Record<string, unknown> = Record<st
|
|
|
59
64
|
* @param {object} [params.config] config of the task to be scheduled.
|
|
60
65
|
* @param {object} params.schedule task time run config.
|
|
61
66
|
* @param {string} params.schedule.value schedule value according to its type.
|
|
62
|
-
* @param {string} params.schedule.type schedule type (CRON | ONE_TIME).
|
|
67
|
+
* @param {string} params.schedule.type schedule type (CRON | ONE_TIME | FIXED_RATE).
|
|
63
68
|
* @param {string} [params.schedule.timeZone] time zone of cron scheduling. Only applies when type is `CRON`.
|
|
69
|
+
* @param {boolean} [params.schedule.deleteAfterRun] delete the job once it has run, instead of keeping a record of its last run. Only applies when type is `ONE_TIME`.
|
|
64
70
|
* @param {string} [params.user] key of the user that submitted the task.
|
|
65
71
|
* @param {boolean} params.enabled job is active or not.
|
|
66
72
|
*/
|