@enonic-types/lib-scheduler 0.1.0 → 7.11.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.
Files changed (2) hide show
  1. package/package.json +1 -5
  2. package/scheduler.d.ts +115 -115
package/package.json CHANGED
@@ -1,15 +1,11 @@
1
1
  {
2
2
  "name": "@enonic-types/lib-scheduler",
3
- "version": "0.1.0",
3
+ "version": "7.11.0-B1",
4
4
  "description": "Type definitions for lib-scheduler.",
5
5
  "types": "scheduler.d.ts",
6
6
  "files": [
7
7
  "scheduler.d.ts"
8
8
  ],
9
- "scripts": {
10
- "pre": "npm run --prefix ../ pre",
11
- "packlist": "npx npm-packlist"
12
- },
13
9
  "repository": {
14
10
  "type": "git",
15
11
  "url": "git+https://github.com/enonic/xp.git#master"
package/scheduler.d.ts CHANGED
@@ -1,115 +1,115 @@
1
- /**
2
- * Scheduler functions.
3
- *
4
- * @example
5
- * var schedulerLib = require('/lib/xp/scheduler');
6
- *
7
- * @module scheduler
8
- */
9
- declare global {
10
- interface XpLibraries {
11
- '/lib/xp/scheduler': typeof import('./scheduler');
12
- }
13
- }
14
- export declare type EditorFn<T> = (value: T) => T;
15
- export declare type ScheduleType = 'CRON' | 'ONE_TIME';
16
- export interface Schedule {
17
- value: string;
18
- type: ScheduleType;
19
- timezone: string;
20
- }
21
- export interface CreateScheduledJobParams {
22
- name: string;
23
- description: string;
24
- descriptor: string;
25
- config: Record<string, unknown>;
26
- schedule: Schedule;
27
- user: string;
28
- enabled: boolean;
29
- }
30
- export interface OnTimeSchedule {
31
- value: string;
32
- type: ScheduleType;
33
- }
34
- export interface CronSchedule extends OnTimeSchedule {
35
- timeZone: string;
36
- }
37
- export interface ScheduleJob {
38
- name: string;
39
- descriptor: string;
40
- description: string;
41
- enabled: boolean;
42
- config?: Record<string, unknown> | null;
43
- user?: string | null;
44
- creator?: string | null;
45
- modifier?: string | null;
46
- createdTime?: string | null;
47
- modifiedTime?: string | null;
48
- lastRun?: string | null;
49
- lastTaskId?: string | null;
50
- schedule: OnTimeSchedule | CronSchedule;
51
- }
52
- /**
53
- * Creates a job to be scheduled.
54
- *
55
- * @example-ref examples/scheduler/create.js
56
- *
57
- * @param {object} params JSON with the parameters.
58
- * @param {string} params.name unique job name.
59
- * @param {string} params.description job description.
60
- * @param {string} params.descriptor descriptor of the task to be scheduled.
61
- * @param {object} params.config config of the task to be scheduled.
62
- * @param {object} params.schedule task time run config.
63
- * @param {string} params.schedule.value schedule value according to it's type.
64
- * @param {string} params.schedule.type schedule type (CRON | ONE_TIME).
65
- * @param {string} params.schedule.timezone time zone of cron scheduling.
66
- * @param {string} params.user key of the user that submitted the task.
67
- * @param {boolean} params.enabled job is active or not.
68
- */
69
- export declare function create(params: CreateScheduledJobParams): ScheduleJob;
70
- export interface ModifyScheduledJobParams {
71
- name: string;
72
- editor: EditorFn<ScheduleJob>;
73
- }
74
- /**
75
- * Modifies scheduled job.
76
- *
77
- * @example-ref examples/scheduler/modify.js
78
- *
79
- * @param {object} params JSON with the parameters.
80
- * @param {string} params.name unique job name.
81
- * @param {function} params.editor editor callback function, has editable existing job as a param.
82
- */
83
- export declare function modify(params: ModifyScheduledJobParams): ScheduleJob;
84
- export interface DeleteScheduledJobParams {
85
- name: string;
86
- }
87
- /**
88
- * Removes scheduled job.
89
- *
90
- * @example-ref examples/scheduler/delete.js
91
- *
92
- * @param {object} params JSON with the parameters.
93
- * @param {string} params.name job to be deleted name.
94
- */
95
- declare function _delete(params: DeleteScheduledJobParams): boolean;
96
- export { _delete as delete, };
97
- export interface GetScheduledJobParams {
98
- name: string;
99
- }
100
- /**
101
- * Fetches scheduled job.
102
- *
103
- * @example-ref examples/scheduler/get.js
104
- *
105
- * @param {object} params JSON with the parameters.
106
- * @param {string} params.name job to be deleted name.
107
- */
108
- export declare function get(params: GetScheduledJobParams): ScheduleJob;
109
- /**
110
- * Lists scheduled jobs.
111
- *
112
- * @example-ref examples/scheduler/list.js
113
- *
114
- */
115
- export declare function list(): ScheduleJob[];
1
+ /**
2
+ * Scheduler functions.
3
+ *
4
+ * @example
5
+ * var schedulerLib = require('/lib/xp/scheduler');
6
+ *
7
+ * @module scheduler
8
+ */
9
+ declare global {
10
+ interface XpLibraries {
11
+ '/lib/xp/scheduler': typeof import('./scheduler');
12
+ }
13
+ }
14
+ export declare type EditorFn<T> = (value: T) => T;
15
+ export declare type ScheduleType = 'CRON' | 'ONE_TIME';
16
+ export interface Schedule {
17
+ value: string;
18
+ type: ScheduleType;
19
+ timezone: string;
20
+ }
21
+ export interface CreateScheduledJobParams {
22
+ name: string;
23
+ description: string;
24
+ descriptor: string;
25
+ config: Record<string, unknown>;
26
+ schedule: Schedule;
27
+ user: string;
28
+ enabled: boolean;
29
+ }
30
+ export interface OnTimeSchedule {
31
+ value: string;
32
+ type: ScheduleType;
33
+ }
34
+ export interface CronSchedule extends OnTimeSchedule {
35
+ timeZone: string;
36
+ }
37
+ export interface ScheduleJob {
38
+ name: string;
39
+ descriptor: string;
40
+ description: string;
41
+ enabled: boolean;
42
+ config?: Record<string, unknown> | null;
43
+ user?: string | null;
44
+ creator?: string | null;
45
+ modifier?: string | null;
46
+ createdTime?: string | null;
47
+ modifiedTime?: string | null;
48
+ lastRun?: string | null;
49
+ lastTaskId?: string | null;
50
+ schedule: OnTimeSchedule | CronSchedule;
51
+ }
52
+ /**
53
+ * Creates a job to be scheduled.
54
+ *
55
+ * @example-ref examples/scheduler/create.js
56
+ *
57
+ * @param {object} params JSON with the parameters.
58
+ * @param {string} params.name unique job name.
59
+ * @param {string} params.description job description.
60
+ * @param {string} params.descriptor descriptor of the task to be scheduled.
61
+ * @param {object} params.config config of the task to be scheduled.
62
+ * @param {object} params.schedule task time run config.
63
+ * @param {string} params.schedule.value schedule value according to it's type.
64
+ * @param {string} params.schedule.type schedule type (CRON | ONE_TIME).
65
+ * @param {string} params.schedule.timezone time zone of cron scheduling.
66
+ * @param {string} params.user key of the user that submitted the task.
67
+ * @param {boolean} params.enabled job is active or not.
68
+ */
69
+ export declare function create(params: CreateScheduledJobParams): ScheduleJob;
70
+ export interface ModifyScheduledJobParams {
71
+ name: string;
72
+ editor: EditorFn<ScheduleJob>;
73
+ }
74
+ /**
75
+ * Modifies scheduled job.
76
+ *
77
+ * @example-ref examples/scheduler/modify.js
78
+ *
79
+ * @param {object} params JSON with the parameters.
80
+ * @param {string} params.name unique job name.
81
+ * @param {function} params.editor editor callback function, has editable existing job as a param.
82
+ */
83
+ export declare function modify(params: ModifyScheduledJobParams): ScheduleJob;
84
+ export interface DeleteScheduledJobParams {
85
+ name: string;
86
+ }
87
+ /**
88
+ * Removes scheduled job.
89
+ *
90
+ * @example-ref examples/scheduler/delete.js
91
+ *
92
+ * @param {object} params JSON with the parameters.
93
+ * @param {string} params.name job to be deleted name.
94
+ */
95
+ declare function _delete(params: DeleteScheduledJobParams): boolean;
96
+ export { _delete as delete, };
97
+ export interface GetScheduledJobParams {
98
+ name: string;
99
+ }
100
+ /**
101
+ * Fetches scheduled job.
102
+ *
103
+ * @example-ref examples/scheduler/get.js
104
+ *
105
+ * @param {object} params JSON with the parameters.
106
+ * @param {string} params.name job to be deleted name.
107
+ */
108
+ export declare function get(params: GetScheduledJobParams): ScheduleJob | null;
109
+ /**
110
+ * Lists scheduled jobs.
111
+ *
112
+ * @example-ref examples/scheduler/list.js
113
+ *
114
+ */
115
+ export declare function list(): ScheduleJob[];