@stacksjs/scheduler 0.61.24 → 0.63.0

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/dist/index.js CHANGED
@@ -7,9 +7,6 @@ import {spawn} from "child_process";
7
7
 
8
8
  // src/errors.ts
9
9
  class CronError extends Error {
10
- constructor() {
11
- super(...arguments);
12
- }
13
10
  }
14
11
 
15
12
  class ExclusiveParametersError extends CronError {
@@ -330,7 +327,7 @@ class CronTime {
330
327
  let actualMinute;
331
328
  let actualHour;
332
329
  let maybeJumpingPoint = date;
333
- const iterationLimit = 1440;
330
+ const iterationLimit = 60 * 24;
334
331
  let iteration = 0;
335
332
  do {
336
333
  if (++iteration > iterationLimit) {
@@ -738,14 +735,13 @@ class Schedule {
738
735
  return this;
739
736
  }
740
737
  }
741
-
742
- // src/index.ts
743
- var src_default = Schedule;
744
738
  export {
745
739
  timeout,
746
740
  sendAt,
747
- src_default as default,
748
741
  Schedule,
749
742
  CronTime,
750
743
  CronJob as BunCronJob
751
744
  };
745
+
746
+ //# debugId=738B38A4FFD4123F64756E2164756E21
747
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,15 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/schedule.ts", "../src/job.ts", "../src/errors.ts", "../src/time.ts", "../src/constants.ts", "../src/utils.ts"],
4
+ "sourcesContent": [
5
+ "import { log } from '@stacksjs/cli'\nimport type { DateTime } from 'luxon'\nimport { CronJob } from './job'\nimport { CronTime } from './time'\n\nexport class Schedule {\n private cronPattern = ''\n private timezone = 'America/Los_Angeles'\n private readonly task: () => void\n // private cmd?: string\n\n constructor(task: () => void) {\n this.task = task\n }\n\n everySecond() {\n this.cronPattern = '* * * * * *'\n return this\n }\n\n everyMinute() {\n this.cronPattern = '0 * * * * *'\n return this\n }\n\n everyTwoMinutes() {\n this.cronPattern = '*/2 * * * * *'\n return this\n }\n\n everyFiveMinutes() {\n this.cronPattern = '*/5 * * * *'\n return this\n }\n\n everyTenMinutes() {\n this.cronPattern = '*/10 * * * *'\n return this\n }\n\n everyThirtyMinutes() {\n this.cronPattern = '*/30 * * * *'\n return this\n }\n\n hourly() {\n this.cronPattern = '0 0 * * * *'\n return this\n }\n\n daily() {\n this.cronPattern = '0 0 0 * * *'\n return this\n }\n\n weekly() {\n this.cronPattern = '0 0 0 * * 0'\n return this\n }\n\n monthly() {\n this.cronPattern = '0 0 0 1 * *'\n return this\n }\n\n yearly() {\n this.cronPattern = '0 0 0 1 1 *'\n return this\n }\n\n onDays(days: number[]) {\n const dayPattern = days.join(',')\n this.cronPattern = `0 0 0 * * ${dayPattern}`\n return this\n }\n\n // between(startTime: string, endTime: string) {\n // // This method is a placeholder. Actual implementation will vary based on requirements.\n // // Cron does not directly support \"between\" times without additional logic.\n // console.warn('The \"between\" method is not directly supported by cron patterns and requires additional logic.')\n // return this\n // }\n\n at(time: string) {\n // Assuming time is in \"HH:MM\" format\n const [hour, minute] = time.split(':').map(Number)\n this.cronPattern = `${minute} ${hour} * * *`\n return this\n }\n\n setTimeZone(timezone: string) {\n this.timezone = timezone\n return this\n }\n\n start() {\n new CronJob(this.cronPattern, this.task, null, true, this.timezone)\n log.info(`Scheduled task with pattern: ${this.cronPattern} in timezone: ${this.timezone}`)\n }\n\n // job and action methods need to be added and they accept a path string param\n job(path: string) {\n log.info(`Scheduling job: ${path}`)\n return this\n }\n\n action(path: string) {\n log.info(`Scheduling action: ${path}`)\n return this\n }\n\n static command(cmd: string) {\n log.info(`Executing command: ${cmd}`)\n // this.cmd = cmd\n return this\n }\n}\n\nexport function sendAt(cronTime: string | Date | DateTime): DateTime {\n return new CronTime(cronTime).sendAt()\n}\n\nexport function timeout(cronTime: string | Date | DateTime): number {\n return new CronTime(cronTime).getTimeout()\n}\n\nexport type Scheduler = typeof Schedule\n\nexport default Schedule\n",
6
+ "/**\n * Many thanks to https://github.com/kelektiv/node-cron for the inspiration\n */\n\nimport { spawn } from 'node:child_process'\nimport { CronError, ExclusiveParametersError } from './errors'\nimport { CronTime } from './time'\nimport type {\n CronCallback,\n CronCommand,\n CronContext,\n CronJobParams,\n CronOnCompleteCallback,\n CronOnCompleteCommand,\n WithOnComplete,\n} from './types/cron'\nimport { getTimeZoneAndOffset } from './utils'\n\nexport class CronJob<OC extends CronOnCompleteCommand | null = null, C = null> {\n cronTime: CronTime\n running = false\n unrefTimeout = false\n lastExecution: Date | null = null\n runOnce = false\n context: CronContext<C>\n onComplete?: WithOnComplete<OC> extends true ? CronOnCompleteCallback : undefined\n\n private _timeout?: NodeJS.Timeout\n private _callbacks: CronCallback<C, WithOnComplete<OC>>[] = []\n private _errorHandler?: (error: Error) => void\n\n constructor(\n cronTime: CronJobParams<OC, C>['cronTime'],\n onTick: CronJobParams<OC, C>['onTick'],\n onComplete?: CronJobParams<OC, C>['onComplete'],\n start?: CronJobParams<OC, C>['start'],\n timeZone?: CronJobParams<OC, C>['timeZone'],\n context?: CronJobParams<OC, C>['context'],\n runOnInit?: CronJobParams<OC, C>['runOnInit'],\n utcOffset?: null,\n unrefTimeout?: CronJobParams<OC, C>['unrefTimeout'],\n errorHandler?: (error: Error) => void,\n )\n constructor(\n cronTime: CronJobParams<OC, C>['cronTime'],\n onTick: CronJobParams<OC, C>['onTick'],\n onComplete?: CronJobParams<OC, C>['onComplete'],\n start?: CronJobParams<OC, C>['start'],\n timeZone?: null,\n context?: CronJobParams<OC, C>['context'],\n runOnInit?: CronJobParams<OC, C>['runOnInit'],\n utcOffset?: CronJobParams<OC, C>['utcOffset'],\n unrefTimeout?: CronJobParams<OC, C>['unrefTimeout'],\n errorHandler?: (error: Error) => void,\n )\n constructor(\n cronTime: CronJobParams<OC, C>['cronTime'],\n onTick: CronJobParams<OC, C>['onTick'],\n onComplete?: CronJobParams<OC, C>['onComplete'],\n start?: CronJobParams<OC, C>['start'],\n timeZone?: CronJobParams<OC, C>['timeZone'],\n context?: CronJobParams<OC, C>['context'],\n runOnInit?: CronJobParams<OC, C>['runOnInit'],\n utcOffset?: CronJobParams<OC, C>['utcOffset'],\n unrefTimeout?: CronJobParams<OC, C>['unrefTimeout'],\n errorHandler?: (error: Error) => void,\n ) {\n this._errorHandler = errorHandler\n this.context = (context ?? this) as CronContext<C>\n\n const { timeZone: tz, utcOffset: uo } = getTimeZoneAndOffset(timeZone, utcOffset)\n\n this.cronTime = new CronTime(cronTime, tz, uo as null | undefined)\n\n if (unrefTimeout != null) this.unrefTimeout = unrefTimeout\n\n if (onComplete != null) {\n // casting to the correct type since we just made sure that WithOnComplete<OC> = true\n this.onComplete = this._fnWrap(onComplete) as WithOnComplete<OC> extends true ? CronOnCompleteCallback : undefined\n }\n\n if (this.cronTime.realDate) this.runOnce = true\n\n this.addCallback(this._fnWrap(onTick))\n\n if (runOnInit) {\n this.lastExecution = new Date()\n this.fireOnTick()\n }\n\n if (start) this.start()\n }\n\n static from<OC extends CronOnCompleteCommand | null = null, C = null>(params: CronJobParams<OC, C>) {\n // runtime check for JS users\n if (params.timeZone != null && params.utcOffset != null) throw new ExclusiveParametersError('timeZone', 'utcOffset')\n\n if (params.timeZone != null) {\n return new CronJob<OC, C>(\n params.cronTime,\n params.onTick,\n params.onComplete,\n params.start,\n params.timeZone,\n params.context,\n params.runOnInit,\n params.utcOffset,\n params.unrefTimeout,\n )\n }\n\n if (params.utcOffset != null) {\n return new CronJob<OC, C>(\n params.cronTime,\n params.onTick,\n params.onComplete,\n params.start,\n null,\n params.context,\n params.runOnInit,\n params.utcOffset,\n params.unrefTimeout,\n )\n }\n\n return new CronJob<OC, C>(\n params.cronTime,\n params.onTick,\n params.onComplete,\n params.start,\n params.timeZone,\n params.context,\n params.runOnInit,\n params.utcOffset,\n params.unrefTimeout,\n )\n }\n\n private _fnWrap(cmd: CronCommand<C, boolean>): CronCallback<C, boolean> {\n switch (typeof cmd) {\n case 'function': {\n return cmd\n }\n\n case 'string': {\n const [command, ...args] = cmd.split(' ')\n\n return spawn.bind(undefined, command ?? cmd, args, {}) as () => void\n }\n\n case 'object': {\n return spawn.bind(undefined, cmd.command, cmd.args ?? [], cmd.options ?? {}) as () => void\n }\n }\n }\n\n addCallback(callback: CronCallback<C, WithOnComplete<OC>>) {\n if (typeof callback === 'function') this._callbacks.push(callback)\n }\n\n setTime(time: CronTime) {\n if (!(time instanceof CronTime)) throw new CronError('time must be an instance of CronTime.')\n\n const wasRunning = this.running\n this.stop()\n\n this.cronTime = time\n if (time.realDate) this.runOnce = true\n\n if (wasRunning) this.start()\n }\n\n nextDate() {\n return this.cronTime.sendAt()\n }\n\n fireOnTick() {\n try {\n for (const callback of this._callbacks) {\n void callback.call(\n this.context,\n this.onComplete as WithOnComplete<OC> extends true ? CronOnCompleteCallback : never,\n )\n }\n } catch (error) {\n if (this._errorHandler && error instanceof Error) {\n this._errorHandler(error)\n } else {\n // Handle the case where no error handler is provided or the caught object is not an Error\n console.error('An error occurred in the cron job callback:', error)\n }\n }\n }\n\n nextDates(i?: number) {\n return this.cronTime.sendAt(i ?? 0)\n }\n\n start() {\n if (this.running) return\n\n const MAXDELAY = 2147483647 // The maximum number of milliseconds setTimeout will wait.\n let timeout = this.cronTime.getTimeout()\n let remaining = 0\n let startTime: number\n\n const setCronTimeout = (t: number) => {\n this._timeout = setTimeout(callbackWrapper, t) as NodeJS.Timeout\n if (this.unrefTimeout && typeof this._timeout.unref === 'function') this._timeout.unref()\n }\n\n // The callback wrapper checks if it needs to sleep another period or not\n // and does the real callback logic when it’s time.\n const callbackWrapper = () => {\n const diff = startTime + timeout - Date.now()\n\n if (diff > 0) {\n let newTimeout = this.cronTime.getTimeout()\n\n if (newTimeout > diff) newTimeout = diff\n\n remaining += newTimeout\n }\n\n // If there is sleep time remaining, calculate how long and go to sleep\n // again. This processing might make us miss the deadline by a few ms\n // times the number of sleep sessions. Given a MAXDELAY of almost a\n // month, this should be no issue.\n if (remaining) {\n if (remaining > MAXDELAY) {\n remaining -= MAXDELAY\n timeout = MAXDELAY\n } else {\n timeout = remaining\n remaining = 0\n }\n\n setCronTimeout(timeout)\n } else {\n // We have arrived at the correct point in time.\n this.lastExecution = new Date()\n\n this.running = false\n\n // start before calling back so the callbacks have the ability to stop the cron job\n if (!this.runOnce) this.start()\n\n this.fireOnTick()\n }\n }\n\n if (timeout >= 0) {\n this.running = true\n\n // Don't try to sleep more than MAXDELAY ms at a time.\n\n if (timeout > MAXDELAY) {\n remaining = timeout - MAXDELAY\n timeout = MAXDELAY\n }\n\n setCronTimeout(timeout)\n } else {\n this.stop()\n }\n }\n\n lastDate() {\n return this.lastExecution\n }\n\n /**\n * Stop the cronjob.\n */\n stop() {\n if (this._timeout) clearTimeout(this._timeout)\n this.running = false\n if (typeof this.onComplete === 'function') void this.onComplete.call(this.context)\n }\n}\n",
7
+ "export class CronError extends Error {}\n\nexport class ExclusiveParametersError extends CronError {\n constructor(param1: string, param2: string) {\n super(`You can't specify both ${param1} and ${param2}`)\n }\n}\n",
8
+ "import type { Zone } from 'luxon'\nimport { DateTime } from 'luxon'\n\nimport {\n ALIASES,\n CONSTRAINTS,\n MONTH_CONSTRAINTS,\n PARSE_DEFAULTS,\n PRESETS,\n RE_RANGE,\n RE_WILDCARDS,\n TIME_UNITS,\n TIME_UNITS_LEN,\n TIME_UNITS_MAP,\n} from './constants'\nimport { CronError, ExclusiveParametersError } from './errors'\nimport type { CronJobParams, DayOfMonthRange, MonthRange, Ranges, TimeUnit, TimeUnitField } from './types/cron'\nimport { getRecordKeys } from './utils'\n\nexport class CronTime {\n source: string | DateTime\n timeZone?: string\n utcOffset?: number\n realDate = false\n\n private second: TimeUnitField<'second'> = {}\n private minute: TimeUnitField<'minute'> = {}\n private hour: TimeUnitField<'hour'> = {}\n private dayOfMonth: TimeUnitField<'dayOfMonth'> = {}\n private month: TimeUnitField<'month'> = {}\n private dayOfWeek: TimeUnitField<'dayOfWeek'> = {}\n\n constructor(source: CronJobParams['cronTime'], timeZone?: CronJobParams['timeZone'], utcOffset?: null)\n constructor(source: CronJobParams['cronTime'], timeZone?: null, utcOffset?: CronJobParams['utcOffset'])\n constructor(\n source: CronJobParams['cronTime'],\n timeZone?: CronJobParams['timeZone'],\n utcOffset?: CronJobParams['utcOffset'],\n ) {\n // runtime check for JS users\n if (timeZone != null && utcOffset != null) throw new ExclusiveParametersError('timeZone', 'utcOffset')\n\n if (timeZone) {\n const dt = DateTime.fromObject({}, { zone: timeZone })\n if (!dt.isValid) throw new CronError('Invalid timezone.')\n\n this.timeZone = timeZone\n }\n\n if (utcOffset != null) this.utcOffset = utcOffset\n\n if (source instanceof Date || source instanceof DateTime) {\n this.source = source instanceof Date ? DateTime.fromJSDate(source) : source\n this.realDate = true\n } else {\n this.source = source\n this._parse(this.source)\n this._verifyParse()\n }\n }\n\n private _getWeekDay(date: DateTime) {\n return date.weekday === 7 ? 0 : date.weekday\n }\n\n /**\n * Ensure that the syntax parsed correctly and correct the specified values if needed.\n */\n private _verifyParse() {\n const months = getRecordKeys(this.month)\n const daysOfMonth = getRecordKeys(this.dayOfMonth)\n\n let isOk = false\n\n /**\n * if a dayOfMonth is not found in all months, we only need to fix the last\n * wrong month to prevent infinite loop\n */\n let lastWrongMonth: MonthRange | null = null\n for (const m of months) {\n const con = MONTH_CONSTRAINTS[m]\n\n for (const day of daysOfMonth) {\n if (day <= con) isOk = true\n }\n\n if (!isOk) {\n // save the month in order to be fixed if all months fails (infinite loop)\n lastWrongMonth = m\n console.warn(`Month '${m}' is limited to '${con}' days.`)\n }\n }\n\n // infinite loop detected (dayOfMonth is not found in all months)\n if (!isOk && lastWrongMonth !== null) {\n const notOkCon = MONTH_CONSTRAINTS[lastWrongMonth]\n for (const notOkDay of daysOfMonth) {\n if (notOkDay > notOkCon) {\n delete this.dayOfMonth[notOkDay]\n const fixedDay = (notOkDay % notOkCon) as DayOfMonthRange\n this.dayOfMonth[fixedDay] = true\n }\n }\n }\n }\n\n /**\n * Calculate the \"next\" scheduled time\n */\n sendAt(): DateTime\n sendAt(i: number): DateTime[]\n sendAt(i?: number): DateTime | DateTime[] {\n let date = this.realDate && this.source instanceof DateTime ? this.source : DateTime.local()\n if (this.timeZone) date = date.setZone(this.timeZone)\n\n if (this.utcOffset !== undefined) {\n const sign = this.utcOffset < 0 ? '-' : '+'\n\n const offsetHours = Math.trunc(this.utcOffset / 60)\n const offsetHoursStr = String(Math.abs(offsetHours)).padStart(2, '0')\n\n const offsetMins = Math.abs(this.utcOffset - offsetHours * 60)\n const offsetMinsStr = String(offsetMins).padStart(2, '0')\n\n const utcZone = `UTC${sign}${offsetHoursStr}:${offsetMinsStr}`\n\n date = date.setZone(utcZone)\n\n if (!date.isValid) throw new CronError('ERROR: You specified an invalid UTC offset.')\n }\n\n if (this.realDate) {\n if (DateTime.local() > date) throw new CronError('WARNING: Date in past. Will never be fired.')\n\n return date\n }\n\n if (i === undefined || Number.isNaN(i) || i < 0) {\n // just get the next scheduled time\n return this.getNextDateFrom(date)\n }\n\n // return the next schedule times\n const dates: DateTime[] = []\n for (; i > 0; i--) {\n date = this.getNextDateFrom(date)\n dates.push(date)\n }\n\n return dates\n }\n\n /**\n * Get the number of milliseconds in the future at which to fire our callbacks.\n */\n getTimeout() {\n return Math.max(-1, this.sendAt().toMillis() - DateTime.local().toMillis())\n }\n\n /**\n * writes out a cron string\n */\n toString() {\n return this.toJSON().join(' ')\n }\n\n /**\n * Json representation of the parsed cron syntax.\n */\n toJSON() {\n return TIME_UNITS.map((unit) => {\n return this._wcOrAll(unit)\n })\n }\n\n /**\n * Get next date matching the specified cron time.\n *\n * Algorithm:\n * - Start with a start date and a parsed crontime.\n * - Loop until 5 seconds have passed, or we found the next date.\n * - Within the loop:\n * - If it took longer than 5 seconds to select a date, throw an exception.\n * - Find the next month to run at.\n * - Find the next day of the month to run at.\n * - Find the next day of the week to run at.\n * - Find the next hour to run at.\n * - Find the next minute to run at.\n * - Find the next second to run at.\n * - Check that the chosen time does not equal the current execution.\n * - Return the selected date object.\n */\n getNextDateFrom(start: Date | DateTime, timeZone?: string | Zone) {\n if (start instanceof Date) start = DateTime.fromJSDate(start)\n\n let date = start\n const firstDate = start.toMillis()\n if (timeZone) date = date.setZone(timeZone)\n\n if (!this.realDate) {\n if (date.millisecond > 0) date = date.set({ millisecond: 0, second: date.second + 1 })\n }\n\n if (!date.isValid) throw new CronError('ERROR: You specified an invalid date.')\n\n /**\n * maximum match interval is 8 years:\n * crontab has '* * 29 2 *' and we are on 1 March 2096:\n * next matching time will be 29 February 2104\n * source: https://github.com/cronie-crond/cronie/blob/0d669551680f733a4bdd6bab082a0b3d6d7f089c/src/cronnext.c#L401-L403\n */\n const maxMatch = DateTime.now().plus({ years: 8 })\n\n // determine next date\n while (true) {\n const diff = date.toMillis() - start.toMillis()\n\n // hard stop if the current date is after the maximum match interval\n if (date > maxMatch) {\n throw new CronError(\n `Something went wrong. No execution date was found in the next 8 years.\n Please provide the following string if you would like to help debug:\n Time Zone: ${timeZone?.toString() ?? '\"\"'} - Cron String: ${this.source.toString()} - UTC offset: ${\n date.offset\n } - current Date: ${DateTime.local().toString()}`,\n )\n }\n\n if (!(date.month in this.month) && Object.keys(this.month).length !== 12) {\n date = date.plus({ months: 1 })\n date = date.set({ day: 1, hour: 0, minute: 0, second: 0 })\n\n if (this._forwardDSTJump(0, 0, date)) {\n const [isDone, newDate] = this._findPreviousDSTJump(date)\n date = newDate\n if (isDone) break\n }\n continue\n }\n\n if (\n !(date.day in this.dayOfMonth) &&\n Object.keys(this.dayOfMonth).length !== 31 &&\n !(this._getWeekDay(date) in this.dayOfWeek && Object.keys(this.dayOfWeek).length !== 7)\n ) {\n date = date.plus({ days: 1 })\n date = date.set({ hour: 0, minute: 0, second: 0 })\n\n if (this._forwardDSTJump(0, 0, date)) {\n const [isDone, newDate] = this._findPreviousDSTJump(date)\n date = newDate\n if (isDone) break\n }\n continue\n }\n\n if (\n !(this._getWeekDay(date) in this.dayOfWeek) &&\n Object.keys(this.dayOfWeek).length !== 7 &&\n !(date.day in this.dayOfMonth && Object.keys(this.dayOfMonth).length !== 31)\n ) {\n date = date.plus({ days: 1 })\n date = date.set({ hour: 0, minute: 0, second: 0 })\n if (this._forwardDSTJump(0, 0, date)) {\n const [isDone, newDate] = this._findPreviousDSTJump(date)\n date = newDate\n if (isDone) break\n }\n continue\n }\n\n if (!(date.hour in this.hour) && Object.keys(this.hour).length !== 24) {\n const expectedHour = date.hour === 23 && diff > 86400000 ? 0 : date.hour + 1\n const expectedMinute = date.minute // expect no change.\n\n date = date.set({ hour: expectedHour })\n date = date.set({ minute: 0, second: 0 })\n\n // When this is the case, Asking luxon to go forward by 1 hour actually made us go forward by more hours...\n // This indicates that somewhere between these two time points, a forward DST adjustment has happened.\n // When this happens, the job should be scheduled to execute as though the time has come when the jump is made.\n // Therefore, the job should be scheduled on the first tick after the forward jump.\n if (this._forwardDSTJump(expectedHour, expectedMinute, date)) {\n const [isDone, newDate] = this._findPreviousDSTJump(date)\n date = newDate\n if (isDone) break\n }\n // backwards jumps do not seem to have any problems (i.e. double activations),\n // so they need not be handled in a similar way.\n\n continue\n }\n\n if (!(date.minute in this.minute) && Object.keys(this.minute).length !== 60) {\n const expectedMinute = date.minute === 59 && diff > 3600000 ? 0 : date.minute + 1\n const expectedHour = date.hour + (expectedMinute === 60 ? 1 : 0)\n\n date = date.set({ minute: expectedMinute })\n date = date.set({ second: 0 })\n\n // Same case as with hours: DST forward jump.\n // This must be accounted for if a minute increment pushed us to a jumping point.\n if (this._forwardDSTJump(expectedHour, expectedMinute, date)) {\n const [isDone, newDate] = this._findPreviousDSTJump(date)\n date = newDate\n if (isDone) break\n }\n\n continue\n }\n\n if (!(date.second in this.second) && Object.keys(this.second).length !== 60) {\n const expectedSecond = date.second === 59 && diff > 60000 ? 0 : date.second + 1\n const expectedMinute = date.minute + (expectedSecond === 60 ? 1 : 0)\n const expectedHour = date.hour + (expectedMinute === 60 ? 1 : 0)\n\n date = date.set({ second: expectedSecond })\n\n // Seconds can cause it too, imagine 21:59:59 -> 23:00:00.\n if (this._forwardDSTJump(expectedHour, expectedMinute, date)) {\n const [isDone, newDate] = this._findPreviousDSTJump(date)\n date = newDate\n if (isDone) break\n }\n\n continue\n }\n\n if (date.toMillis() === firstDate) {\n const expectedSecond = date.second + 1\n const expectedMinute = date.minute + (expectedSecond === 60 ? 1 : 0)\n const expectedHour = date.hour + (expectedMinute === 60 ? 1 : 0)\n\n date = date.set({ second: expectedSecond })\n\n // Same as always.\n if (this._forwardDSTJump(expectedHour, expectedMinute, date)) {\n const [isDone, newDate] = this._findPreviousDSTJump(date)\n date = newDate\n if (isDone) break\n }\n\n continue\n }\n\n break\n }\n\n return date\n }\n\n /**\n * Search backwards in time 1 minute at a time, to detect a DST forward jump.\n * When the jump is found, the range of the jump is investigated to check for acceptable cron times.\n *\n * A pair is returned, whose first is a boolean representing if an acceptable time was found inside the jump,\n * and whose second is a DateTime representing the first millisecond after the jump.\n *\n * The input date is expected to be decently close to a DST jump.\n * Up to a day in the past is checked before an error is thrown.\n * @param date\n * @return [boolean, DateTime]\n */\n private _findPreviousDSTJump(date: DateTime): [boolean, DateTime] {\n let expectedMinute: number\n let expectedHour: number\n let actualMinute: number\n let actualHour: number\n\n /** @type DateTime */\n let maybeJumpingPoint = date\n\n // representing one day of backwards checking. If this is hit, the input must be wrong.\n const iterationLimit = 60 * 24\n let iteration = 0\n do {\n if (++iteration > iterationLimit) {\n throw new CronError(\n `ERROR: This DST checking related function assumes the input DateTime (${\n date.toISO() ?? date.toMillis()\n }) is within 24 hours of a DST jump.`,\n )\n }\n\n expectedMinute = maybeJumpingPoint.minute - 1\n expectedHour = maybeJumpingPoint.hour\n\n if (expectedMinute < 0) {\n expectedMinute += 60\n expectedHour = (expectedHour + 24 - 1) % 24 // Subtract 1 hour, but we must account for the -1 case.\n }\n\n maybeJumpingPoint = maybeJumpingPoint.minus({ minute: 1 })\n\n actualMinute = maybeJumpingPoint.minute\n actualHour = maybeJumpingPoint.hour\n } while (expectedMinute === actualMinute && expectedHour === actualHour)\n\n // Setting the seconds and milliseconds to zero is necessary for two reasons:\n // Firstly, the range checking function needs the earliest moment after the jump.\n // Secondly, this DateTime may be used for scheduling jobs, if there existed a job in the skipped range.\n const afterJumpingPoint = maybeJumpingPoint\n .plus({ minute: 1 }) // back to the first minute _after_ the jump\n .set({ second: 0, millisecond: 0 })\n\n // Get the lower bound of the range to check as well. This only has to be accurate down to minutes.\n const beforeJumpingPoint = afterJumpingPoint.minus({ second: 1 })\n\n if (date.month + 1 in this.month && date.day in this.dayOfMonth && this._getWeekDay(date) in this.dayOfWeek) {\n return [this._checkTimeInSkippedRange(beforeJumpingPoint, afterJumpingPoint), afterJumpingPoint]\n }\n\n // no valid time in the range for sure, units that didn't change from the skip mismatch.\n return [false, afterJumpingPoint]\n }\n\n /**\n * Given 2 DateTimes, which represent 1 second before and immediately after a DST forward jump,\n * checks if a time in the skipped range would have been a valid CronJob time.\n *\n * Could technically work with just one of these values, extracting the other by adding or subtracting seconds.\n * However, this couples the input DateTime to actually being tied to a DST jump,\n * which would make the function harder to test.\n * This way the logic just tests a range of minutes and hours, regardless if there are skipped time points underneath.\n *\n * Assumes the DST jump started no earlier than 0:00 and jumped forward by at least 1 minute, to at most 23:59.\n * i.e. The day is assumed constant, but the jump is not assumed to be an hour long.\n * Empirically, it is almost always one hour, but very, very rarely 30 minutes.\n *\n * Assumes dayOfWeek, dayOfMonth and month match all match, so only the hours, minutes and seconds are to be checked.\n * @param {DateTime} beforeJumpingPoint\n * @param {DateTime} afterJumpingPoint\n * @returns {boolean} True if a valid CronJob time exists within the skipped DST range, false otherwise.\n */\n private _checkTimeInSkippedRange(beforeJumpingPoint: DateTime, afterJumpingPoint: DateTime) {\n // start by getting the first minute & hour inside the skipped range.\n const startingMinute = (beforeJumpingPoint.minute + 1) % 60\n const startingHour = (beforeJumpingPoint.hour + (startingMinute === 0 ? 1 : 0)) % 24\n\n const hourRangeSize = afterJumpingPoint.hour - startingHour + 1\n const isHourJump = startingMinute === 0 && afterJumpingPoint.minute === 0\n\n // There exist DST jumps other than 1 hour long, and the function is built to deal with it.\n // It may be overkill to assume some cases, but it shouldn't cost much at runtime.\n // https://en.wikipedia.org/wiki/Daylight_saving_time_by_country\n if (hourRangeSize === 2 && isHourJump) {\n // Exact 1 hour jump, most common real-world case.\n // There is no need to check minutes and seconds, as any value would suffice.\n return startingHour in this.hour\n }\n\n if (hourRangeSize === 1) {\n // less than 1 hour jump, rare but does exist.\n return (\n startingHour in this.hour && this._checkTimeInSkippedRangeSingleHour(startingMinute, afterJumpingPoint.minute)\n )\n }\n\n // non-round or multi-hour jump. (does not exist in the real world at the time of writing)\n return this._checkTimeInSkippedRangeMultiHour(\n startingHour,\n startingMinute,\n afterJumpingPoint.hour,\n afterJumpingPoint.minute,\n )\n }\n\n /**\n * Component of checking if a CronJob time existed in a DateTime range skipped by DST.\n * This subroutine makes a further assumption that the skipped range is fully contained in one hour,\n * and that all other larger units are valid for the job.\n *\n * for example a jump from 02:00:00 to 02:30:00, but not from 02:00:00 to 03:00:00.\n * @see _checkTimeInSkippedRange\n *\n * This is done by checking if any minute in startMinute - endMinute is valid, excluding endMinute.\n * For endMinute, there is only a match if the 0th second is a valid time.\n */\n private _checkTimeInSkippedRangeSingleHour(startMinute: number, endMinute: number) {\n for (let minute = startMinute; minute < endMinute; ++minute) {\n if (minute in this.minute) return true\n }\n\n // Unless the very last second of the jump matched, there is no match.\n return endMinute in this.minute && 0 in this.second\n }\n\n /**\n * Component of checking if a CronJob time existed in a DateTime range skipped by DST.\n * This subroutine assumes the jump touches at least 2 hours, but the jump does not necessarily fully contain these hours.\n *\n * @see _checkTimeInSkippedRange\n *\n * This is done by defining the minutes to check for the first and last hour,\n * and checking all 60 minutes for any hours in between them.\n *\n * If any hour x minute combination is a valid time, true is returned.\n * The endMinute x endHour combination is only checked with the 0th second, since the rest would be out of the range.\n *\n * @param startHour {number}\n * @param startMinute {number}\n * @param endHour {number}\n * @param endMinute {number}\n */\n private _checkTimeInSkippedRangeMultiHour(\n startHour: number,\n startMinute: number,\n endHour: number,\n endMinute: number,\n ) {\n if (startHour >= endHour) {\n throw new CronError(\n `ERROR: This DST checking related function assumes the forward jump starting hour (${startHour}) is less than the end hour (${endHour})`,\n )\n }\n\n /** @type number[] */\n const firstHourMinuteRange = Array.from({ length: 60 - startMinute }, (_, k) => startMinute + k)\n /** @type {number[]} The final minute is not contained on purpose. Every minute in this range represents one for which any second is valid. */\n const lastHourMinuteRange = Array.from({ length: endMinute }, (_, k) => k)\n /** @type number[] */\n const middleHourMinuteRange = Array.from({ length: 60 }, (_, k) => k)\n\n /** @type (number) => number[] */\n const selectRange = (forHour: number) => {\n if (forHour === startHour) return firstHourMinuteRange\n if (forHour === endHour) return lastHourMinuteRange\n return middleHourMinuteRange\n }\n\n // Include the endHour: Selecting the right range still ensures no values outside the skip are checked.\n for (let hour = startHour; hour <= endHour; ++hour) {\n if (!(hour in this.hour)) continue\n\n // The hour matches, so if the minute is in the range, we have a match!\n const usingRange = selectRange(hour)\n\n for (const minute of usingRange) {\n // All minutes in any of the selected ranges represent minutes which are fully contained in the jump,\n // So we need not check the seconds. If the minute is in there, it is a match.\n if (minute in this.minute) return true\n }\n }\n\n // The endMinute of the endHour was not checked in the loop, because only the 0th second of it is in the range.\n // Arriving here means no match was found yet, but this final check may turn up as a match.\n return endHour in this.hour && endMinute in this.minute && 0 in this.second\n }\n\n /**\n * Given expected and actual hours and minutes, report if a DST forward jump occurred.\n *\n * This is the case when the expected is smaller than the acutal.\n *\n * It is not sufficient to check only hours, because some parts of the world apply DST by shifting in minutes.\n * Better to account for it by checking minutes too, before an Australian of Lord Howe Island call us.\n * @param expectedHour\n * @param expectedMinute\n * @param {DateTime} actualDate\n */\n private _forwardDSTJump(expectedHour: number, expectedMinute: number, actualDate: DateTime) {\n const actualHour = actualDate.hour\n const actualMinute = actualDate.minute\n\n const didHoursJumped = expectedHour % 24 < actualHour\n const didMinutesJumped = expectedMinute % 60 < actualMinute\n\n return didHoursJumped || didMinutesJumped\n }\n\n /**\n * wildcard, or all params in array (for to string)\n */\n private _wcOrAll(unit: TimeUnit) {\n if (this._hasAll(unit)) return '*'\n\n const all = []\n for (const time in this[unit]) all.push(time)\n\n return all.join(',')\n }\n\n private _hasAll(unit: TimeUnit) {\n const constraints = CONSTRAINTS[unit]\n const low = constraints[0]\n const high = unit === TIME_UNITS_MAP.DAY_OF_WEEK ? constraints[1] - 1 : constraints[1]\n\n for (let i = low, n = high; i < n; i++) {\n if (!(i in this[unit])) return false\n }\n\n return true\n }\n\n /**\n * Parse the cron syntax into something useful for selecting the next execution time.\n *\n * Algorithm:\n * - Replace preset\n * - Replace aliases in the source.\n * - Trim string and split for processing.\n * - Loop over split options (ms -> month):\n * - Get the value (or default) in the current position.\n * - Parse the value.\n */\n private _parse(source: string) {\n source = source.toLowerCase()\n\n if (Object.keys(PRESETS).includes(source)) source = PRESETS[source as keyof typeof PRESETS]\n\n source = source.replace(/[a-z]{1,3}/gi, (alias: string) => {\n if (Object.keys(ALIASES).includes(alias)) return ALIASES[alias as keyof typeof ALIASES].toString()\n\n throw new CronError(`Unknown alias: ${alias}`)\n })\n\n const units = source.trim().split(/\\s+/)\n\n // seconds are optional\n if (units.length < TIME_UNITS_LEN - 1) throw new CronError('Too few fields')\n\n if (units.length > TIME_UNITS_LEN) throw new CronError('Too many fields')\n\n const unitsLen = units.length\n for (const unit of TIME_UNITS) {\n const i = TIME_UNITS.indexOf(unit)\n // If the split source string doesn't contain all digits,\n // assume defaults for first n missing digits.\n // This adds support for 5-digit standard cron syntax\n const cur = units[i - (TIME_UNITS_LEN - unitsLen)] ?? PARSE_DEFAULTS[unit]\n this._parseField(cur, unit)\n }\n }\n\n /**\n * Parse individual field from the cron syntax provided.\n *\n * Algorithm:\n * - Split field by commas aand check for wildcards to ensure proper user.\n * - Replace wildcard values with <low>-<high> boundaries.\n * - Split field by commas and then iterate over ranges inside field.\n * - If range matches pattern then map over matches using replace (to parse the range by the regex pattern)\n * - Starting with the lower bounds of the range iterate by step up to the upper bounds and toggle the CronTime field value flag on.\n */\n\n private _parseField(value: string, unit: TimeUnit) {\n const typeObj = this[unit] as TimeUnitField<typeof unit>\n let pointer: Ranges[typeof unit]\n\n const constraints = CONSTRAINTS[unit]\n const low = constraints[0]\n const high = constraints[1]\n\n const fields = value.split(',')\n fields.forEach((field) => {\n const wildcardIndex = field.indexOf('*')\n if (wildcardIndex !== -1 && wildcardIndex !== 0) {\n throw new CronError(`Field (${field}) has an invalid wildcard expression`)\n }\n })\n\n // \"*\" is a shortcut to [low-high] range for the field\n value = value.replace(RE_WILDCARDS, `${low}-${high}`)\n\n // commas separate information, so split based on those\n const allRanges = value.split(',')\n\n for (const range of allRanges) {\n const match = [...range.matchAll(RE_RANGE)][0]\n if (match?.[1] !== undefined) {\n const [, mLower, mUpper, mStep] = match\n let lower = Number.parseInt(mLower, 10)\n let upper = mUpper !== undefined ? Number.parseInt(mUpper, 10) : undefined\n\n const wasStepDefined = mStep !== undefined\n const step = Number.parseInt(mStep ?? '1', 10)\n if (step === 0) throw new CronError(`Field (${unit}) has a step of zero`)\n\n if (upper !== undefined && lower > upper) throw new CronError(`Field (${unit}) has an invalid range`)\n\n const isOutOfRange =\n lower < low || (upper !== undefined && upper > high) || (upper === undefined && lower > high)\n\n if (isOutOfRange) throw new CronError(`Field value (${value}) is out of range`)\n\n // Positive integer higher than constraints[0]\n lower = Math.min(Math.max(low, ~~Math.abs(lower)), high)\n\n // Positive integer lower than constraints[1]\n if (upper !== undefined) {\n upper = Math.min(high, ~~Math.abs(upper))\n } else {\n // If step is provided, the default upper range is the highest value\n upper = wasStepDefined ? high : lower\n }\n\n // Count from the lower barrier to the upper\n // forcing type cast here since we checked above that\n // we are between constraint bounds\n pointer = lower as typeof pointer\n\n do {\n typeObj[pointer] = true // mutates the field objects values inside CronTime\n pointer += step\n } while (pointer <= upper)\n\n // merge day 7 into day 0 (both Sunday), and remove day 7\n // since we work with day-of-week 0-6 under the hood\n if (unit === 'dayOfWeek') {\n if (!typeObj[0] && !!typeObj[7]) typeObj[0] = typeObj[7]\n // delete typeObj[7]\n typeObj[7] = undefined\n }\n } else {\n throw new CronError(`Field (${unit}) cannot be parsed`)\n }\n }\n }\n}\n",
9
+ "export const CONSTRAINTS = Object.freeze({\n second: [0, 59],\n minute: [0, 59],\n hour: [0, 23],\n dayOfMonth: [1, 31],\n month: [1, 12],\n dayOfWeek: [0, 7],\n} as const)\nexport const MONTH_CONSTRAINTS = Object.freeze({\n 1: 31,\n 2: 29, // support leap year...not perfect\n 3: 31,\n 4: 30,\n 5: 31,\n 6: 30,\n 7: 31,\n 8: 31,\n 9: 30,\n 10: 31,\n 11: 30,\n 12: 31,\n} as const)\nexport const PARSE_DEFAULTS = Object.freeze({\n second: '0',\n minute: '*',\n hour: '*',\n dayOfMonth: '*',\n month: '*',\n dayOfWeek: '*',\n} as const)\nexport const ALIASES = Object.freeze({\n jan: 1,\n feb: 2,\n mar: 3,\n apr: 4,\n may: 5,\n jun: 6,\n jul: 7,\n aug: 8,\n sep: 9,\n oct: 10,\n nov: 11,\n dec: 12,\n sun: 0,\n mon: 1,\n tue: 2,\n wed: 3,\n thu: 4,\n fri: 5,\n sat: 6,\n} as const)\nexport const TIME_UNITS_MAP = Object.freeze({\n SECOND: 'second',\n MINUTE: 'minute',\n HOUR: 'hour',\n DAY_OF_MONTH: 'dayOfMonth',\n MONTH: 'month',\n DAY_OF_WEEK: 'dayOfWeek',\n} as const)\nexport const TIME_UNITS = Object.freeze(Object.values(TIME_UNITS_MAP)) as [\n 'second',\n 'minute',\n 'hour',\n 'dayOfMonth',\n 'month',\n 'dayOfWeek',\n]\nexport const TIME_UNITS_LEN: number = TIME_UNITS.length\nexport const PRESETS = Object.freeze({\n '@yearly': '0 0 0 1 1 *',\n '@monthly': '0 0 0 1 * *',\n '@weekly': '0 0 0 * * 0',\n '@daily': '0 0 0 * * *',\n '@hourly': '0 0 * * * *',\n '@minutely': '0 * * * * *',\n '@secondly': '* * * * * *',\n '@weekdays': '0 0 0 * * 1-5',\n '@weekends': '0 0 0 * * 0,6',\n} as const)\nexport const RE_WILDCARDS = /\\*/g\nexport const RE_RANGE = /^(\\d+)(?:-(\\d+))?(?:\\/(\\d+))?$/g\n",
10
+ "import { ExclusiveParametersError } from './errors'\nimport type { Ranges } from './types/cron'\n\nexport function getRecordKeys<K extends Ranges[keyof Ranges]>(record: Partial<Record<K, boolean>>) {\n return Object.keys(record) as unknown as (keyof typeof record)[]\n}\n\nexport function getTimeZoneAndOffset(timeZone?: string | null, utcOffset?: number | null) {\n if (timeZone != null && utcOffset != null) throw new ExclusiveParametersError('timeZone', 'utcOffset')\n\n if (timeZone != null) return { timeZone, utcOffset: null }\n\n if (utcOffset != null) return { timeZone: null, utcOffset }\n\n return { timeZone: null, utcOffset: null }\n}\n"
11
+ ],
12
+ "mappings": ";;AAAA;;;ACIA;;;ACJO,MAAM,kBAAkB,MAAM;AAAC;AAE/B;AAAA,MAAM,iCAAiC,UAAU;AAAA,EACtD,WAAW,CAAC,QAAgB,QAAgB;AAC1C,UAAM,0BAA0B,cAAc,QAAQ;AAAA;AAE1D;;;ACLA;;;ACDO,IAAM,cAAc,OAAO,OAAO;AAAA,EACvC,QAAQ,CAAC,GAAG,EAAE;AAAA,EACd,QAAQ,CAAC,GAAG,EAAE;AAAA,EACd,MAAM,CAAC,GAAG,EAAE;AAAA,EACZ,YAAY,CAAC,GAAG,EAAE;AAAA,EAClB,OAAO,CAAC,GAAG,EAAE;AAAA,EACb,WAAW,CAAC,GAAG,CAAC;AAClB,CAAU;AACH,IAAM,oBAAoB,OAAO,OAAO;AAAA,EAC7C,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,CAAU;AACH,IAAM,iBAAiB,OAAO,OAAO;AAAA,EAC1C,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,YAAY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G;AACP,SAAK,cAAc;AACnB,WAAO;AAAA;AAAA,EAGT,MAAM,CAAC,MAAgB;AACrB,UAAM,aAAa,KAAK,KAAK,GAAG;AAChC,SAAK,cAAc,aAAa;AAChC,WAAO;AAAA;AAAA,EAUT,EAAE,CAAC,OAAc;AAEf,WAAO,MAAM,UAAU,MAAK,MAAM,GAAG,EAAE,IAAI,MAAM;AACjD,SAAK,cAAc,GAAG,UAAU;AAChC,WAAO;AAAA;AAAA,EAGT,WAAW,CAAC,UAAkB;AAC5B,SAAK,WAAW;AAChB,WAAO;AAAA;AAAA,EAGT,KAAK,GAAG;AACN,QAAI,QAAQ,KAAK,aAAa,KAAK,MAAM,MAAM,MAAM,KAAK,QAAQ;AAClE,QAAI,KAAK,gCAAgC,KAAK,4BAA4B,KAAK,UAAU;AAAA;AAAA,EAI3F,GAAG,CAAC,MAAc;AAChB,QAAI,KAAK,mBAAmB,MAAM;AAClC,WAAO;AAAA;AAAA,EAGT,MAAM,CAAC,MAAc;AACnB,QAAI,KAAK,sBAAsB,MAAM;AACrC,WAAO;AAAA;AAAA,SAGF,OAAO,CAAC,KAAa;AAC1B,QAAI,KAAK,sBAAsB,KAAK;AAEpC,WAAO;AAAA;AAEX;",
13
+ "debugId": "738B38A4FFD4123F64756E2164756E21",
14
+ "names": []
15
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/scheduler",
3
3
  "type": "module",
4
- "version": "0.61.24",
4
+ "version": "0.63.0",
5
5
  "description": "The Stacks scheduler.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -48,13 +48,13 @@
48
48
  "prepublishOnly": "bun run build"
49
49
  },
50
50
  "peerDependencies": {
51
- "luxon": "^3.4.4"
51
+ "luxon": "^3.5.0"
52
52
  },
53
53
  "dependencies": {
54
- "luxon": "^3.4.4"
54
+ "luxon": "^3.5.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@fast-check/jest": "^1.8.2",
57
+ "@fast-check/jest": "^2.0.1",
58
58
  "@stacksjs/development": "latest",
59
59
  "@types/luxon": "^3.4.2",
60
60
  "@types/sinon": "^17.0.3",
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Schedule } from './schedule'
1
+ export { Schedule } from './schedule'
2
2
 
3
3
  export { CronJob as BunCronJob } from './job'
4
4
  export { CronTime } from './time'
@@ -13,8 +13,8 @@ export type {
13
13
  Ranges,
14
14
  TimeUnit,
15
15
  } from './types/cron'
16
- export * from './types/utils'
17
16
 
17
+ export * from './types/utils'
18
18
  export * from './schedule'
19
19
 
20
- export default Schedule
20
+ // export default Schedule