From 9e9d51ff1b5be7c622f7eaa28b1980639229a178 Mon Sep 17 00:00:00 2001 From: Meir Gottlieb Date: Mon, 29 Feb 2016 17:41:32 -0700 Subject: [PATCH] Added attribute record to job. --- agenda/agenda.d.ts | 87 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 86 insertions(+), 1 deletion(-) diff --git a/agenda/agenda.d.ts b/agenda/agenda.d.ts index 2e07c6762..3bc7b1c85 100644 --- a/agenda/agenda.d.ts +++ b/agenda/agenda.d.ts @@ -9,7 +9,7 @@ declare module "agenda" { import {EventEmitter} from "events"; - import {Db, Collection} from "mongodb"; + import {Db, Collection, ObjectID} from "mongodb"; interface Callback { (err?: Error): void; @@ -95,11 +95,96 @@ declare module "agenda" { } } + /** + * The database record associated with a job. + */ + interface JobAttributes { + /** + * The record identity. + */ + _id: ObjectID; + + /** + * The name of the job. + */ + name: string; + + /** + * The type of the job (single|normal). + */ + type: string; + + /** + * The job details. + */ + data: { [name: string]: any }; + + /** + * The priority of the job. + */ + priority: number; + + /** + * How often the job is repeated using a human-readable or cron format. + */ + repeatInterval: string | number; + + /** + * The timezone that conforms to [moment-timezone](http://momentjs.com/timezone/). + */ + repeatTimezone: string; + + /** + * Date/time the job was las modified. + */ + lastModifiedBy: string; + + /** + * Date/time the job will run next. + */ + nextRunAt: Date; + + /** + * Date/time the job was locked. + */ + lockedAt: Date; + + /** + * Date/time the job was last run. + */ + lastRunAt: Date; + + /** + * Date/time the job last finished running. + */ + lastFinishedAt: Date; + + /** + * The reason the job failed. + */ + failReason: string; + + /** + * The number of times the job has failed. + */ + failCount: number; + + /** + * The date/time the job last failed. + */ + failedAt: Date; + } + /** * A scheduled job. */ interface Job { + /** + * The database record associated with the job. + */ + attrs: JobAttributes; + /** * Specifies an interval on which the job should repeat. * @param interval A human-readable format String, a cron format String, or a Number.