@kingsworld/plugin-cron 4.0.2-next.1e20a7a → 4.0.2-next.2a391cb

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.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- //#region \0@oxc-project+runtime@0.148.0/helpers/esm/typeof.js
3
+ //#region \0@oxc-project+runtime@0.154.0/helpers/esm/typeof.js
4
4
  function _typeof(o) {
5
5
  "@babel/helpers - typeof";
6
6
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -11,7 +11,7 @@ function _typeof(o) {
11
11
  }
12
12
 
13
13
  //#endregion
14
- //#region \0@oxc-project+runtime@0.148.0/helpers/esm/toPrimitive.js
14
+ //#region \0@oxc-project+runtime@0.154.0/helpers/esm/toPrimitive.js
15
15
  function toPrimitive(t, r) {
16
16
  if ("object" != _typeof(t) || !t) return t;
17
17
  var e = t[Symbol.toPrimitive];
@@ -24,14 +24,14 @@ function toPrimitive(t, r) {
24
24
  }
25
25
 
26
26
  //#endregion
27
- //#region \0@oxc-project+runtime@0.148.0/helpers/esm/toPropertyKey.js
27
+ //#region \0@oxc-project+runtime@0.154.0/helpers/esm/toPropertyKey.js
28
28
  function toPropertyKey(t) {
29
29
  var i = toPrimitive(t, "string");
30
30
  return "symbol" == _typeof(i) ? i : i + "";
31
31
  }
32
32
 
33
33
  //#endregion
34
- //#region \0@oxc-project+runtime@0.148.0/helpers/esm/defineProperty.js
34
+ //#region \0@oxc-project+runtime@0.154.0/helpers/esm/defineProperty.js
35
35
  function _defineProperty(e, r, t) {
36
36
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
37
37
  value: t,
@@ -54,10 +54,10 @@ var CronTaskHandler = class {
54
54
  };
55
55
 
56
56
  //#endregion
57
- Object.defineProperty(exports, 'CronTaskHandler', {
57
+ Object.defineProperty(exports, "CronTaskHandler", {
58
58
  enumerable: true,
59
59
  get: function () {
60
60
  return CronTaskHandler;
61
61
  }
62
62
  });
63
- //# sourceMappingURL=CronTaskHandler-Bq4LU7qH.cjs.map
63
+ //# sourceMappingURL=CronTaskHandler-2O0UFQqz.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"CronTaskHandler-Bq4LU7qH.cjs","names":[],"sources":["../../src/lib/CronTaskHandler.ts"],"sourcesContent":["import type Sentry from '@sentry/node';\nimport type { CronTaskHandlerOptions } from './types/CronTaskTypes';\n\nexport class CronTaskHandler {\n\t/**\n\t * The default IANA/TZ timezone to use for all cron jobs.\n\t * You can override this per task, using the timezone option.\n\t * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\n\t */\n\tpublic defaultTimezone?: CronTaskHandlerOptions['defaultTimezone'];\n\n\t/**\n\t * The ability to opt-out of instrumenting cron jobs with Sentry.\n\t * If you don't use Sentry, you can ignore this option.\n\t * @see https://docs.sentry.io/product/crons/\n\t * @default false\n\t */\n\tpublic disableSentry: boolean;\n\n\t/**\n\t * The Sentry instance to use for instrumenting cron jobs.\n\t * This is only available when [`@sentry/node`](https://www.npmjs.com/package/@sentry/node)\n\t * is installed and the {@linkcode disableSentry} option is set to false.\n\t */\n\tpublic sentry?: typeof Sentry;\n\n\tpublic constructor(options?: Partial<CronTaskHandlerOptions>) {\n\t\tthis.defaultTimezone = options?.defaultTimezone;\n\t\tthis.disableSentry = options?.disableSentry ?? false;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAA,kBAAA,MAAA;CAuBA,AAAA,YAAA,SAAA;wBAjBA;wBAQA;wBAOA;EAGA,KAAA,kBAAA,SAAA;EACA,KAAA,gBAAA,SAAA,iBAAA;CACA;AACA"}
1
+ {"version":3,"file":"CronTaskHandler-2O0UFQqz.cjs","names":[],"sources":["../../src/lib/CronTaskHandler.ts"],"sourcesContent":["import type Sentry from '@sentry/node';\nimport type { CronTaskHandlerOptions } from './types/CronTaskTypes';\n\nexport class CronTaskHandler {\n\t/**\n\t * The default IANA/TZ timezone to use for all cron jobs.\n\t * You can override this per task, using the timezone option.\n\t * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\n\t */\n\tpublic defaultTimezone?: CronTaskHandlerOptions['defaultTimezone'];\n\n\t/**\n\t * The ability to opt-out of instrumenting cron jobs with Sentry.\n\t * If you don't use Sentry, you can ignore this option.\n\t * @see https://docs.sentry.io/product/crons/\n\t * @default false\n\t */\n\tpublic disableSentry: boolean;\n\n\t/**\n\t * The Sentry instance to use for instrumenting cron jobs.\n\t * This is only available when [`@sentry/node`](https://www.npmjs.com/package/@sentry/node)\n\t * is installed and the {@linkcode disableSentry} option is set to false.\n\t */\n\tpublic sentry?: typeof Sentry;\n\n\tpublic constructor(options?: Partial<CronTaskHandlerOptions>) {\n\t\tthis.defaultTimezone = options?.defaultTimezone;\n\t\tthis.disableSentry = options?.disableSentry ?? false;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAA,kBAAA,MAAA;CAuBA,AAAA,YAAA,SAAA;wBAjBA;wBAQA;wBAOA;EAGA,KAAA,kBAAA,SAAA;EACA,KAAA,gBAAA,SAAA,iBAAA;CACA;AACA"}
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
- const require_CronTaskHandler = require('./CronTaskHandler-Bq4LU7qH.cjs');
5
- const require_lib_structures_CronTask = require('./lib/structures/CronTask.cjs');
6
- const require_lib_structures_CronTaskStore = require('./lib/structures/CronTaskStore.cjs');
4
+ const require_CronTaskHandler = require("./CronTaskHandler-2O0UFQqz.cjs");
5
+ const require_lib_structures_CronTask = require("./lib/structures/CronTask.cjs");
6
+ const require_lib_structures_CronTaskStore = require("./lib/structures/CronTaskStore.cjs");
7
7
 
8
8
  //#region src/index.ts
9
9
  /**
@@ -12,7 +12,7 @@ const require_lib_structures_CronTaskStore = require('./lib/structures/CronTaskS
12
12
  *
13
13
  * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild
14
14
  */
15
- const version = "4.0.2-next.1e20a7a";
15
+ const version = "4.0.2-next.2a391cb";
16
16
 
17
17
  //#endregion
18
18
  exports.CronTask = require_lib_structures_CronTask.CronTask;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
- const require_CronTaskHandler = require('../CronTaskHandler-Bq4LU7qH.cjs');
4
+ const require_CronTaskHandler = require("../CronTaskHandler-2O0UFQqz.cjs");
5
5
 
6
6
  exports.CronTaskHandler = require_CronTaskHandler.CronTaskHandler;
@@ -1 +1 @@
1
- {"version":3,"file":"CronTask.cjs","names":[],"sources":["../../../../src/lib/structures/CronTask.ts"],"sourcesContent":["import type { Awaitable } from '@sapphire/framework';\nimport { Piece } from '@sapphire/pieces';\nimport type { Cron } from 'croner';\nimport type { CronJobOptions } from '../types/CronTaskTypes';\n\n/**\n * @example\n *\n * ```typescript\n * // ping.ts\n * import { CronTask } from '@kingsworld/plugin-cron';\n *\n * export class PingPong extends CronTask {\n * \tpublic constructor(context: CronTask.LoaderContext, options: CronTask.Options) {\n * \t\tsuper(context, {\n * \t\t\t...options,\n * \t\t\tpattern: '* * * * *'\n * \t\t});\n * \t}\n *\n * \tpublic run() {\n * \t\tthis.info('Ping Pong! 🏓'); // CronTask[ping] Ping Pong! 🏓\n * \t}\n * }\n * ```\n */\nexport abstract class CronTask<Options extends CronTask.Options = CronTask.Options> extends Piece<Options, 'cron-tasks'> {\n\tdeclare public job: Cron;\n\n\tpublic constructor(context: CronTask.LoaderContext, options: Options) {\n\t\tsuper(context, options);\n\t}\n\n\tpublic abstract run(): Awaitable<unknown>;\n\n\tpublic protect?(job: Cron): Awaitable<unknown>;\n\n\tpublic catch?(error: unknown, job: Cron): Awaitable<unknown>;\n\n\t/**\n\t * A helper function to log messages with the `CronTask[${name}]` prefix.\n\t * @param message The message to include after the prefix\n\t * @param other Extra parameters to pass to the logger\n\t * @example\n\t * this.info('Hello world!'); // CronTask[my-task] Hello world!\n\t */\n\tpublic info(message: string, ...other: unknown[]) {\n\t\tthis.container.logger.info(`CronTask[${this.name}] ${message}`, ...other);\n\t}\n\n\t/**\n\t * A helper function to log messages with the `CronTask[${name}]` prefix.\n\t * @param message The message to include after the prefix\n\t * @param other Extra parameters to pass to the logger\n\t * @example\n\t * this.error('Something went wrong!'); // CronTask[my-task] Something went wrong!\n\t */\n\tpublic error(message: string, ...other: unknown[]) {\n\t\tthis.container.logger.error(`CronTask[${this.name}] ${message}`, ...other);\n\t}\n\n\t/**\n\t * A helper function to log messages with the `CronTask[${name}]` prefix.\n\t * @param message The message to include after the prefix\n\t * @param other Extra parameters to pass to the logger\n\t * @example\n\t * this.warn('Something is not right!'); // CronTask[my-task] Something is not right!\n\t */\n\tpublic warn(message: string, ...other: unknown[]) {\n\t\tthis.container.logger.warn(`CronTask[${this.name}] ${message}`, ...other);\n\t}\n\n\t/**\n\t * A helper function to log messages with the `CronTask[${name}]` prefix.\n\t * @param message The message to include after the prefix\n\t * @param other Extra parameters to pass to the logger\n\t * @example\n\t * this.debug('Something is happening!'); // CronTask[my-task] Something is happening!\n\t */\n\tpublic debug(message: string, ...other: unknown[]) {\n\t\tthis.container.logger.debug(`CronTask[${this.name}] ${message}`, ...other);\n\t}\n\n\t/**\n\t * A helper function to log messages with the `CronTask[${name}]` prefix.\n\t * @param message The message to include after the prefix\n\t * @param other Extra parameters to pass to the logger\n\t * @example\n\t * this.trace('Loaded the file.'); // CronTask[my-task] Loaded the file.\n\t */\n\tpublic trace(message: string, ...other: unknown[]) {\n\t\tthis.container.logger.trace(`CronTask[${this.name}] ${message}`, ...other);\n\t}\n}\n\nexport namespace CronTask {\n\texport type Options = Piece.Options & CronJobOptions;\n\t/** @deprecated Use {@linkcode LoaderContext} instead. */\n\texport type Context = LoaderContext;\n\texport type LoaderContext = Piece.LoaderContext<'cron-tasks'>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAA,WAAA,cAAA,uBAAA;CAGA,AAAA,YAAA,SAAA,SAAA;EACA,MAAA,SAAA,OAAA;CACA;;;;;;;;CAeA,AAAA,KAAA,SAAA,GAAA,OAAA;EACA,KAAA,UAAA,OAAA,KAAA,YAAA,KAAA,KAAA,IAAA,WAAA,GAAA,KAAA;CACA;;;;;;;;CASA,AAAA,MAAA,SAAA,GAAA,OAAA;EACA,KAAA,UAAA,OAAA,MAAA,YAAA,KAAA,KAAA,IAAA,WAAA,GAAA,KAAA;CACA;;;;;;;;CASA,AAAA,KAAA,SAAA,GAAA,OAAA;EACA,KAAA,UAAA,OAAA,KAAA,YAAA,KAAA,KAAA,IAAA,WAAA,GAAA,KAAA;CACA;;;;;;;;CASA,AAAA,MAAA,SAAA,GAAA,OAAA;EACA,KAAA,UAAA,OAAA,MAAA,YAAA,KAAA,KAAA,IAAA,WAAA,GAAA,KAAA;CACA;;;;;;;;CASA,AAAA,MAAA,SAAA,GAAA,OAAA;EACA,KAAA,UAAA,OAAA,MAAA,YAAA,KAAA,KAAA,IAAA,WAAA,GAAA,KAAA;CACA;AACA"}
1
+ {"version":3,"file":"CronTask.cjs","names":["Piece"],"sources":["../../../../src/lib/structures/CronTask.ts"],"sourcesContent":["import type { Awaitable } from '@sapphire/framework';\nimport { Piece } from '@sapphire/pieces';\nimport type { Cron } from 'croner';\nimport type { CronJobOptions } from '../types/CronTaskTypes';\n\n/**\n * @example\n *\n * ```typescript\n * // ping.ts\n * import { CronTask } from '@kingsworld/plugin-cron';\n *\n * export class PingPong extends CronTask {\n * \tpublic constructor(context: CronTask.LoaderContext, options: CronTask.Options) {\n * \t\tsuper(context, {\n * \t\t\t...options,\n * \t\t\tpattern: '* * * * *'\n * \t\t});\n * \t}\n *\n * \tpublic run() {\n * \t\tthis.info('Ping Pong! 🏓'); // CronTask[ping] Ping Pong! 🏓\n * \t}\n * }\n * ```\n */\nexport abstract class CronTask<Options extends CronTask.Options = CronTask.Options> extends Piece<Options, 'cron-tasks'> {\n\tdeclare public job: Cron;\n\n\tpublic constructor(context: CronTask.LoaderContext, options: Options) {\n\t\tsuper(context, options);\n\t}\n\n\tpublic abstract run(): Awaitable<unknown>;\n\n\tpublic protect?(job: Cron): Awaitable<unknown>;\n\n\tpublic catch?(error: unknown, job: Cron): Awaitable<unknown>;\n\n\t/**\n\t * A helper function to log messages with the `CronTask[${name}]` prefix.\n\t * @param message The message to include after the prefix\n\t * @param other Extra parameters to pass to the logger\n\t * @example\n\t * this.info('Hello world!'); // CronTask[my-task] Hello world!\n\t */\n\tpublic info(message: string, ...other: unknown[]) {\n\t\tthis.container.logger.info(`CronTask[${this.name}] ${message}`, ...other);\n\t}\n\n\t/**\n\t * A helper function to log messages with the `CronTask[${name}]` prefix.\n\t * @param message The message to include after the prefix\n\t * @param other Extra parameters to pass to the logger\n\t * @example\n\t * this.error('Something went wrong!'); // CronTask[my-task] Something went wrong!\n\t */\n\tpublic error(message: string, ...other: unknown[]) {\n\t\tthis.container.logger.error(`CronTask[${this.name}] ${message}`, ...other);\n\t}\n\n\t/**\n\t * A helper function to log messages with the `CronTask[${name}]` prefix.\n\t * @param message The message to include after the prefix\n\t * @param other Extra parameters to pass to the logger\n\t * @example\n\t * this.warn('Something is not right!'); // CronTask[my-task] Something is not right!\n\t */\n\tpublic warn(message: string, ...other: unknown[]) {\n\t\tthis.container.logger.warn(`CronTask[${this.name}] ${message}`, ...other);\n\t}\n\n\t/**\n\t * A helper function to log messages with the `CronTask[${name}]` prefix.\n\t * @param message The message to include after the prefix\n\t * @param other Extra parameters to pass to the logger\n\t * @example\n\t * this.debug('Something is happening!'); // CronTask[my-task] Something is happening!\n\t */\n\tpublic debug(message: string, ...other: unknown[]) {\n\t\tthis.container.logger.debug(`CronTask[${this.name}] ${message}`, ...other);\n\t}\n\n\t/**\n\t * A helper function to log messages with the `CronTask[${name}]` prefix.\n\t * @param message The message to include after the prefix\n\t * @param other Extra parameters to pass to the logger\n\t * @example\n\t * this.trace('Loaded the file.'); // CronTask[my-task] Loaded the file.\n\t */\n\tpublic trace(message: string, ...other: unknown[]) {\n\t\tthis.container.logger.trace(`CronTask[${this.name}] ${message}`, ...other);\n\t}\n}\n\nexport namespace CronTask {\n\texport type Options = Piece.Options & CronJobOptions;\n\t/** @deprecated Use {@linkcode LoaderContext} instead. */\n\texport type Context = LoaderContext;\n\texport type LoaderContext = Piece.LoaderContext<'cron-tasks'>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAA,WAAA,cAAAA,uBAAA;CAGA,AAAA,YAAA,SAAA,SAAA;EACA,MAAA,SAAA,OAAA;CACA;;;;;;;;CAeA,AAAA,KAAA,SAAA,GAAA,OAAA;EACA,KAAA,UAAA,OAAA,KAAA,YAAA,KAAA,KAAA,IAAA,WAAA,GAAA,KAAA;CACA;;;;;;;;CASA,AAAA,MAAA,SAAA,GAAA,OAAA;EACA,KAAA,UAAA,OAAA,MAAA,YAAA,KAAA,KAAA,IAAA,WAAA,GAAA,KAAA;CACA;;;;;;;;CASA,AAAA,KAAA,SAAA,GAAA,OAAA;EACA,KAAA,UAAA,OAAA,KAAA,YAAA,KAAA,KAAA,IAAA,WAAA,GAAA,KAAA;CACA;;;;;;;;CASA,AAAA,MAAA,SAAA,GAAA,OAAA;EACA,KAAA,UAAA,OAAA,MAAA,YAAA,KAAA,KAAA,IAAA,WAAA,GAAA,KAAA;CACA;;;;;;;;CASA,AAAA,MAAA,SAAA,GAAA,OAAA;EACA,KAAA,UAAA,OAAA,MAAA,YAAA,KAAA,KAAA,IAAA,WAAA,GAAA,KAAA;CACA;AACA"}
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
- const require_lib_structures_CronTask = require('./CronTask.cjs');
5
- const require_lib_utils_normalizePattern = require('../utils/normalizePattern.cjs');
4
+ const require_lib_structures_CronTask = require("./CronTask.cjs");
5
+ const require_lib_utils_normalizePattern = require("../utils/normalizePattern.cjs");
6
6
  let _sapphire_pieces = require("@sapphire/pieces");
7
7
  let croner = require("croner");
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"CronTaskStore.cjs","names":[],"sources":["../../../../src/lib/structures/CronTaskStore.ts"],"sourcesContent":["import { Store } from '@sapphire/pieces';\nimport { Cron } from 'croner';\nimport { CronTask } from './CronTask';\nimport { normalizePattern } from '../utils/normalizePattern';\n\nexport class CronTaskStore extends Store<CronTask, 'cron-tasks'> {\n\tpublic constructor() {\n\t\tsuper(CronTask, { name: 'cron-tasks' });\n\t}\n\n\t/**\n\t * Loops over all tasks and pauses those that are running.\n\t *\n\t * @remarks\n\t * This method will only pause tasks that:\n\t * - Are enabled\n\t * - Are currently running\n\t * - Have not been permanently stopped\n\t *\n\t * @returns CronTaskStore\n\t */\n\tpublic pauseAll() {\n\t\tfor (const task of this.values()) {\n\t\t\tif (!task.enabled || !task.job.isRunning()) continue;\n\t\t\ttask.job.pause();\n\t\t}\n\n\t\tStore.logger?.(`[STORE => ${this.name}] [PAUSE] Paused all cronjob tasks.`);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Loops over all tasks and resumes those that are paused.\n\t *\n\t * @remarks\n\t * This method will only resume tasks that:\n\t * - Are enabled\n\t * - Are not currently running\n\t * - Have not been permanently stopped\n\t *\n\t * @returns CronTaskStore\n\t */\n\tpublic resumeAll() {\n\t\tfor (const task of this.values()) {\n\t\t\tif (!task.enabled || task.job.isRunning() || task.job.isStopped()) continue;\n\t\t\ttask.job.resume();\n\t\t}\n\n\t\tStore.logger?.(`[STORE => ${this.name}] [RESUME] Resumed all cronjob tasks.`);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Loops over all tasks and stops those that are running.\n\t *\n\t * @remarks\n\t * This method will only stop tasks that:\n\t * - Are enabled\n\t * - Have not been permanently stopped\n\t *\n\t * ⚠️ Stopping jobs is **permanent** and cannot be resumed afterwards!\n\t *\n\t * @returns CronTaskStore\n\t */\n\tpublic stopAll() {\n\t\tfor (const task of this.values()) {\n\t\t\tif (!task.enabled || task.job.isStopped()) continue;\n\t\t\ttask.job.stop();\n\t\t}\n\n\t\tStore.logger?.(`[STORE => ${this.name}] [STOP] Stopped all cronjob tasks.`);\n\t\treturn this;\n\t}\n\n\tpublic override set(key: string, value: CronTask): this {\n\t\tconst { pattern, timezone, protect, ...options } = value.options;\n\t\tconst { sentry, defaultTimezone } = this.container.cronTasks;\n\n\t\t// if a task with the same key already exists, stop it before creating a new one\n\t\tif (this.has(key)) {\n\t\t\tStore.logger?.(`[STORE => ${this.name}] [SET] Stopping existing cronjob task before creating a new one.`);\n\t\t\tthis.get(key)?.job.stop();\n\t\t}\n\n\t\tconst timeZone = timezone ?? defaultTimezone;\n\n\t\ttry {\n\t\t\tStore.logger?.(\n\t\t\t\t`[STORE => ${this.name}] [SET] Creating cronjob for ${key} with '${pattern}' as the pattern and '${timeZone}' for the timezone`\n\t\t\t);\n\n\t\t\tvalue.job = new Cron(\n\t\t\t\tpattern,\n\t\t\t\t{\n\t\t\t\t\tname: key,\n\t\t\t\t\ttimezone: timeZone,\n\t\t\t\t\tpaused: true, // we start the job manually once the client is ready\n\t\t\t\t\tprotect: value.protect?.bind(value) ?? protect,\n\t\t\t\t\tcatch: (error) => {\n\t\t\t\t\t\tvalue.error('Encountered an error while running the cron job', error);\n\t\t\t\t\t\tsentry?.captureException(error);\n\t\t\t\t\t\tvalue.catch?.bind(value)(error, value.job);\n\t\t\t\t\t},\n\t\t\t\t\t...options\n\t\t\t\t},\n\t\t\t\tasync () => {\n\t\t\t\t\t// we only want to monitor cron patterns and not single-use tasks that croner supports\n\t\t\t\t\tif (sentry && typeof pattern === 'string' && !pattern.includes(':')) {\n\t\t\t\t\t\tawait sentry.withMonitor(key, value.run.bind(value), {\n\t\t\t\t\t\t\tschedule: { type: 'crontab', value: normalizePattern(pattern) },\n\t\t\t\t\t\t\ttimezone: timeZone\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tawait value.run.bind(value)();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tvalue.error('Encountered an error while creating the cron job', error);\n\t\t\tvoid value.unload();\n\t\t}\n\n\t\treturn super.set(key, value);\n\t}\n\n\t/**\n\t * Deletes a task from the store and stops it if it's running.\n\t */\n\tpublic override delete(key: string) {\n\t\tconst task = this.get(key);\n\t\tif (task && !task.job.isStopped()) {\n\t\t\ttask.job.stop();\n\t\t}\n\n\t\treturn super.delete(key);\n\t}\n\n\t/**\n\t * Stops all running cron jobs and clears the store.\n\t */\n\tpublic override clear() {\n\t\tthis.stopAll();\n\t\treturn super.clear();\n\t}\n}\n"],"mappings":";;;;;;;;;AAKA,IAAA,gBAAA,cAAA,uBAAA;CACA,AAAA,cAAA;EACA,MAAA,0CAAA,EAAA,MAAA,aAAA,CAAA;CACA;;;;;;;;;;;;CAaA,AAAA,WAAA;EACA,KAAA,MAAA,QAAA,KAAA,OAAA,GAAA;GACA,IAAA,CAAA,KAAA,WAAA,CAAA,KAAA,IAAA,UAAA,GAAA;GACA,KAAA,IAAA,MAAA;EACA;EAEA,uBAAA,SAAA,aAAA,KAAA,KAAA,oCAAA;EACA,OAAA;CACA;;;;;;;;;;;;CAaA,AAAA,YAAA;EACA,KAAA,MAAA,QAAA,KAAA,OAAA,GAAA;GACA,IAAA,CAAA,KAAA,WAAA,KAAA,IAAA,UAAA,KAAA,KAAA,IAAA,UAAA,GAAA;GACA,KAAA,IAAA,OAAA;EACA;EAEA,uBAAA,SAAA,aAAA,KAAA,KAAA,sCAAA;EACA,OAAA;CACA;;;;;;;;;;;;;CAcA,AAAA,UAAA;EACA,KAAA,MAAA,QAAA,KAAA,OAAA,GAAA;GACA,IAAA,CAAA,KAAA,WAAA,KAAA,IAAA,UAAA,GAAA;GACA,KAAA,IAAA,KAAA;EACA;EAEA,uBAAA,SAAA,aAAA,KAAA,KAAA,oCAAA;EACA,OAAA;CACA;CAEA,AAAA,IAAA,KAAA,OAAA;EACA,MAAA,EAAA,SAAA,UAAA,SAAA,GAAA,YAAA,MAAA;EACA,MAAA,EAAA,QAAA,oBAAA,KAAA,UAAA;EAGA,IAAA,KAAA,IAAA,GAAA,GAAA;GACA,uBAAA,SAAA,aAAA,KAAA,KAAA,kEAAA;GACA,KAAA,IAAA,GAAA,CAAA,EAAA,IAAA,KAAA;EACA;EAEA,MAAA,WAAA,YAAA;EAEA,IAAA;GACA,uBAAA,SACA,aAAA,KAAA,KAAA,+BAAA,IAAA,SAAA,QAAA,wBAAA,SAAA,mBACA;GAEA,MAAA,MAAA,IAAA,YACA,SACA;IACA,MAAA;IACA,UAAA;IACA,QAAA;IACA,SAAA,MAAA,SAAA,KAAA,KAAA,KAAA;IACA,QAAA,UAAA;KACA,MAAA,MAAA,mDAAA,KAAA;KACA,QAAA,iBAAA,KAAA;KACA,MAAA,OAAA,KAAA,KAAA,CAAA,CAAA,OAAA,MAAA,GAAA;IACA;IACA,GAAA;GACA,GACA,YAAA;IAEA,IAAA,UAAA,OAAA,YAAA,YAAA,CAAA,QAAA,SAAA,GAAA,GACA,MAAA,OAAA,YAAA,KAAA,MAAA,IAAA,KAAA,KAAA,GAAA;KACA,UAAA;MAAA,MAAA;MAAA,OAAA,oDAAA,OAAA;KAAA;KACA,UAAA;IACA,CAAA;SAEA,MAAA,MAAA,IAAA,KAAA,KAAA,CAAA,CAAA;GAEA,CACA;EACA,SAAA,OAAA;GACA,MAAA,MAAA,oDAAA,KAAA;GACA,AAAA,MAAA,OAAA;EACA;EAEA,OAAA,MAAA,IAAA,KAAA,KAAA;CACA;;;;CAKA,AAAA,OAAA,KAAA;EACA,MAAA,OAAA,KAAA,IAAA,GAAA;EACA,IAAA,QAAA,CAAA,KAAA,IAAA,UAAA,GACA,KAAA,IAAA,KAAA;EAGA,OAAA,MAAA,OAAA,GAAA;CACA;;;;CAKA,AAAA,QAAA;EACA,KAAA,QAAA;EACA,OAAA,MAAA,MAAA;CACA;AACA"}
1
+ {"version":3,"file":"CronTaskStore.cjs","names":["Store","CronTask","Cron","normalizePattern"],"sources":["../../../../src/lib/structures/CronTaskStore.ts"],"sourcesContent":["import { Store } from '@sapphire/pieces';\nimport { Cron } from 'croner';\nimport { CronTask } from './CronTask';\nimport { normalizePattern } from '../utils/normalizePattern';\n\nexport class CronTaskStore extends Store<CronTask, 'cron-tasks'> {\n\tpublic constructor() {\n\t\tsuper(CronTask, { name: 'cron-tasks' });\n\t}\n\n\t/**\n\t * Loops over all tasks and pauses those that are running.\n\t *\n\t * @remarks\n\t * This method will only pause tasks that:\n\t * - Are enabled\n\t * - Are currently running\n\t * - Have not been permanently stopped\n\t *\n\t * @returns CronTaskStore\n\t */\n\tpublic pauseAll() {\n\t\tfor (const task of this.values()) {\n\t\t\tif (!task.enabled || !task.job.isRunning()) continue;\n\t\t\ttask.job.pause();\n\t\t}\n\n\t\tStore.logger?.(`[STORE => ${this.name}] [PAUSE] Paused all cronjob tasks.`);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Loops over all tasks and resumes those that are paused.\n\t *\n\t * @remarks\n\t * This method will only resume tasks that:\n\t * - Are enabled\n\t * - Are not currently running\n\t * - Have not been permanently stopped\n\t *\n\t * @returns CronTaskStore\n\t */\n\tpublic resumeAll() {\n\t\tfor (const task of this.values()) {\n\t\t\tif (!task.enabled || task.job.isRunning() || task.job.isStopped()) continue;\n\t\t\ttask.job.resume();\n\t\t}\n\n\t\tStore.logger?.(`[STORE => ${this.name}] [RESUME] Resumed all cronjob tasks.`);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Loops over all tasks and stops those that are running.\n\t *\n\t * @remarks\n\t * This method will only stop tasks that:\n\t * - Are enabled\n\t * - Have not been permanently stopped\n\t *\n\t * ⚠️ Stopping jobs is **permanent** and cannot be resumed afterwards!\n\t *\n\t * @returns CronTaskStore\n\t */\n\tpublic stopAll() {\n\t\tfor (const task of this.values()) {\n\t\t\tif (!task.enabled || task.job.isStopped()) continue;\n\t\t\ttask.job.stop();\n\t\t}\n\n\t\tStore.logger?.(`[STORE => ${this.name}] [STOP] Stopped all cronjob tasks.`);\n\t\treturn this;\n\t}\n\n\tpublic override set(key: string, value: CronTask): this {\n\t\tconst { pattern, timezone, protect, ...options } = value.options;\n\t\tconst { sentry, defaultTimezone } = this.container.cronTasks;\n\n\t\t// if a task with the same key already exists, stop it before creating a new one\n\t\tif (this.has(key)) {\n\t\t\tStore.logger?.(`[STORE => ${this.name}] [SET] Stopping existing cronjob task before creating a new one.`);\n\t\t\tthis.get(key)?.job.stop();\n\t\t}\n\n\t\tconst timeZone = timezone ?? defaultTimezone;\n\n\t\ttry {\n\t\t\tStore.logger?.(\n\t\t\t\t`[STORE => ${this.name}] [SET] Creating cronjob for ${key} with '${pattern}' as the pattern and '${timeZone}' for the timezone`\n\t\t\t);\n\n\t\t\tvalue.job = new Cron(\n\t\t\t\tpattern,\n\t\t\t\t{\n\t\t\t\t\tname: key,\n\t\t\t\t\ttimezone: timeZone,\n\t\t\t\t\tpaused: true, // we start the job manually once the client is ready\n\t\t\t\t\tprotect: value.protect?.bind(value) ?? protect,\n\t\t\t\t\tcatch: (error) => {\n\t\t\t\t\t\tvalue.error('Encountered an error while running the cron job', error);\n\t\t\t\t\t\tsentry?.captureException(error);\n\t\t\t\t\t\tvalue.catch?.bind(value)(error, value.job);\n\t\t\t\t\t},\n\t\t\t\t\t...options\n\t\t\t\t},\n\t\t\t\tasync () => {\n\t\t\t\t\t// we only want to monitor cron patterns and not single-use tasks that croner supports\n\t\t\t\t\tif (sentry && typeof pattern === 'string' && !pattern.includes(':')) {\n\t\t\t\t\t\tawait sentry.withMonitor(key, value.run.bind(value), {\n\t\t\t\t\t\t\tschedule: { type: 'crontab', value: normalizePattern(pattern) },\n\t\t\t\t\t\t\ttimezone: timeZone\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tawait value.run.bind(value)();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tvalue.error('Encountered an error while creating the cron job', error);\n\t\t\tvoid value.unload();\n\t\t}\n\n\t\treturn super.set(key, value);\n\t}\n\n\t/**\n\t * Deletes a task from the store and stops it if it's running.\n\t */\n\tpublic override delete(key: string) {\n\t\tconst task = this.get(key);\n\t\tif (task && !task.job.isStopped()) {\n\t\t\ttask.job.stop();\n\t\t}\n\n\t\treturn super.delete(key);\n\t}\n\n\t/**\n\t * Stops all running cron jobs and clears the store.\n\t */\n\tpublic override clear() {\n\t\tthis.stopAll();\n\t\treturn super.clear();\n\t}\n}\n"],"mappings":";;;;;;;;;AAKA,IAAA,gBAAA,cAAAA,uBAAA;CACA,AAAA,cAAA;EACA,MAAAC,0CAAA,EAAA,MAAA,aAAA,CAAA;CACA;;;;;;;;;;;;CAaA,AAAA,WAAA;EACA,KAAA,MAAA,QAAA,KAAA,OAAA,GAAA;GACA,IAAA,CAAA,KAAA,WAAA,CAAA,KAAA,IAAA,UAAA,GAAA;GACA,KAAA,IAAA,MAAA;EACA;EAEA,uBAAA,SAAA,aAAA,KAAA,KAAA,oCAAA;EACA,OAAA;CACA;;;;;;;;;;;;CAaA,AAAA,YAAA;EACA,KAAA,MAAA,QAAA,KAAA,OAAA,GAAA;GACA,IAAA,CAAA,KAAA,WAAA,KAAA,IAAA,UAAA,KAAA,KAAA,IAAA,UAAA,GAAA;GACA,KAAA,IAAA,OAAA;EACA;EAEA,uBAAA,SAAA,aAAA,KAAA,KAAA,sCAAA;EACA,OAAA;CACA;;;;;;;;;;;;;CAcA,AAAA,UAAA;EACA,KAAA,MAAA,QAAA,KAAA,OAAA,GAAA;GACA,IAAA,CAAA,KAAA,WAAA,KAAA,IAAA,UAAA,GAAA;GACA,KAAA,IAAA,KAAA;EACA;EAEA,uBAAA,SAAA,aAAA,KAAA,KAAA,oCAAA;EACA,OAAA;CACA;CAEA,AAAA,IAAA,KAAA,OAAA;EACA,MAAA,EAAA,SAAA,UAAA,SAAA,GAAA,YAAA,MAAA;EACA,MAAA,EAAA,QAAA,oBAAA,KAAA,UAAA;EAGA,IAAA,KAAA,IAAA,GAAA,GAAA;GACA,uBAAA,SAAA,aAAA,KAAA,KAAA,kEAAA;GACA,KAAA,IAAA,GAAA,CAAA,EAAA,IAAA,KAAA;EACA;EAEA,MAAA,WAAA,YAAA;EAEA,IAAA;GACA,uBAAA,SACA,aAAA,KAAA,KAAA,+BAAA,IAAA,SAAA,QAAA,wBAAA,SAAA,mBACA;GAEA,MAAA,MAAA,IAAAC,YACA,SACA;IACA,MAAA;IACA,UAAA;IACA,QAAA;IACA,SAAA,MAAA,SAAA,KAAA,KAAA,KAAA;IACA,QAAA,UAAA;KACA,MAAA,MAAA,mDAAA,KAAA;KACA,QAAA,iBAAA,KAAA;KACA,MAAA,OAAA,KAAA,KAAA,CAAA,CAAA,OAAA,MAAA,GAAA;IACA;IACA,GAAA;GACA,GACA,YAAA;IAEA,IAAA,UAAA,OAAA,YAAA,YAAA,CAAA,QAAA,SAAA,GAAA,GACA,MAAA,OAAA,YAAA,KAAA,MAAA,IAAA,KAAA,KAAA,GAAA;KACA,UAAA;MAAA,MAAA;MAAA,OAAAC,oDAAA,OAAA;KAAA;KACA,UAAA;IACA,CAAA;SAEA,MAAA,MAAA,IAAA,KAAA,KAAA,CAAA,CAAA;GAEA,CACA;EACA,SAAA,OAAA;GACA,MAAA,MAAA,oDAAA,KAAA;GACA,AAAA,MAAA,OAAA;EACA;EAEA,OAAA,MAAA,IAAA,KAAA,KAAA;CACA;;;;CAKA,AAAA,OAAA,KAAA;EACA,MAAA,OAAA,KAAA,IAAA,GAAA;EACA,IAAA,QAAA,CAAA,KAAA,IAAA,UAAA,GACA,KAAA,IAAA,KAAA;EAGA,OAAA,MAAA,OAAA,GAAA;CACA;;;;CAKA,AAAA,QAAA;EACA,KAAA,QAAA;EACA,OAAA,MAAA,MAAA;CACA;AACA"}
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
- const require_CronTaskHandler = require('./CronTaskHandler-Bq4LU7qH.cjs');
5
- const require_lib_structures_CronTaskStore = require('./lib/structures/CronTaskStore.cjs');
6
- require('./index.cjs');
4
+ const require_CronTaskHandler = require("./CronTaskHandler-2O0UFQqz.cjs");
5
+ const require_lib_structures_CronTaskStore = require("./lib/structures/CronTaskStore.cjs");
6
+ require("./index.cjs");
7
7
  let _sapphire_framework = require("@sapphire/framework");
8
8
 
9
9
  //#region src/register.ts
@@ -1 +1 @@
1
- {"version":3,"file":"register.cjs","names":[],"sources":["../../src/register.ts"],"sourcesContent":["import './index';\n\nimport { container, Plugin, postInitialization, postLogin, preGenericsInitialization, preLogin, SapphireClient } from '@sapphire/framework';\nimport type { ClientOptions } from 'discord.js';\nimport { CronTaskHandler, CronTaskStore } from './index';\n\nexport class CronTaskPlugin extends Plugin {\n\tpublic static override [preGenericsInitialization](this: SapphireClient, options: ClientOptions) {\n\t\tcontainer.cronTasks = new CronTaskHandler(options.cronTasks);\n\t}\n\n\tpublic static override [postInitialization](this: SapphireClient) {\n\t\tthis.stores.register(new CronTaskStore());\n\t}\n\n\tpublic static override async [preLogin](this: SapphireClient) {\n\t\tif (container.cronTasks.disableSentry) return;\n\t\tcontainer.cronTasks.sentry = await import('@sentry/node').catch(() => undefined);\n\t}\n\n\tpublic static override [postLogin](this: SapphireClient) {\n\t\tthis.stores.get('cron-tasks').resumeAll();\n\t}\n}\n\nSapphireClient.plugins.registerPreGenericsInitializationHook(CronTaskPlugin[preGenericsInitialization], 'Cron-Task-PreGenericsInitialization');\n\nSapphireClient.plugins.registerPostInitializationHook(CronTaskPlugin[postInitialization], 'Cron-Task-PostInitialization');\n\nSapphireClient.plugins.registerPreLoginHook(CronTaskPlugin[preLogin], 'Cron-Task-PreLogin');\n\nSapphireClient.plugins.registerPostLoginHook(CronTaskPlugin[postLogin], 'Cron-Task-PostLogin');\n"],"mappings":";;;;;;;;;AAMA,IAAA,iBAAA,cAAA,2BAAA;CACA,QAAA,+CAAA,SAAA;EACA,8BAAA,YAAA,IAAA,wCAAA,QAAA,SAAA;CACA;CAEA,QAAA,0CAAA;EACA,KAAA,OAAA,SAAA,IAAA,mDAAA,CAAA;CACA;CAEA,cAAA,gCAAA;EACA,IAAA,8BAAA,UAAA,eAAA;EACA,8BAAA,UAAA,SAAA,MAAA,OAAA,eAAA,CAAA,YAAA,MAAA;CACA;CAEA,QAAA,iCAAA;EACA,KAAA,OAAA,IAAA,YAAA,CAAA,CAAA,UAAA;CACA;AACA;AAEA,mCAAA,QAAA,sCAAA,eAAA,gDAAA,qCAAA;AAEA,mCAAA,QAAA,+BAAA,eAAA,yCAAA,8BAAA;AAEA,mCAAA,QAAA,qBAAA,eAAA,+BAAA,oBAAA;AAEA,mCAAA,QAAA,sBAAA,eAAA,gCAAA,qBAAA"}
1
+ {"version":3,"file":"register.cjs","names":["Plugin","preGenericsInitialization","CronTaskHandler","postInitialization","CronTaskStore","preLogin","container","postLogin","SapphireClient"],"sources":["../../src/register.ts"],"sourcesContent":["import './index';\n\nimport { container, Plugin, postInitialization, postLogin, preGenericsInitialization, preLogin, SapphireClient } from '@sapphire/framework';\nimport type { ClientOptions } from 'discord.js';\nimport { CronTaskHandler, CronTaskStore } from './index';\n\nexport class CronTaskPlugin extends Plugin {\n\tpublic static override [preGenericsInitialization](this: SapphireClient, options: ClientOptions) {\n\t\tcontainer.cronTasks = new CronTaskHandler(options.cronTasks);\n\t}\n\n\tpublic static override [postInitialization](this: SapphireClient) {\n\t\tthis.stores.register(new CronTaskStore());\n\t}\n\n\tpublic static override async [preLogin](this: SapphireClient) {\n\t\tif (container.cronTasks.disableSentry) return;\n\t\tcontainer.cronTasks.sentry = await import('@sentry/node').catch(() => undefined);\n\t}\n\n\tpublic static override [postLogin](this: SapphireClient) {\n\t\tthis.stores.get('cron-tasks').resumeAll();\n\t}\n}\n\nSapphireClient.plugins.registerPreGenericsInitializationHook(CronTaskPlugin[preGenericsInitialization], 'Cron-Task-PreGenericsInitialization');\n\nSapphireClient.plugins.registerPostInitializationHook(CronTaskPlugin[postInitialization], 'Cron-Task-PostInitialization');\n\nSapphireClient.plugins.registerPreLoginHook(CronTaskPlugin[preLogin], 'Cron-Task-PreLogin');\n\nSapphireClient.plugins.registerPostLoginHook(CronTaskPlugin[postLogin], 'Cron-Task-PostLogin');\n"],"mappings":";;;;;;;;;AAMA,IAAA,iBAAA,cAAAA,2BAAA;CACA,QAAAC,+CAAA,SAAA;EACA,8BAAA,YAAA,IAAAC,wCAAA,QAAA,SAAA;CACA;CAEA,QAAAC,0CAAA;EACA,KAAA,OAAA,SAAA,IAAAC,mDAAA,CAAA;CACA;CAEA,cAAAC,gCAAA;EACA,IAAAC,8BAAA,UAAA,eAAA;EACA,8BAAA,UAAA,SAAA,MAAA,OAAA,eAAA,CAAA,YAAA,MAAA;CACA;CAEA,QAAAC,iCAAA;EACA,KAAA,OAAA,IAAA,YAAA,CAAA,CAAA,UAAA;CACA;AACA;AAEAC,mCAAA,QAAA,sCAAA,eAAAP,gDAAA,qCAAA;AAEAO,mCAAA,QAAA,+BAAA,eAAAL,yCAAA,8BAAA;AAEAK,mCAAA,QAAA,qBAAA,eAAAH,+BAAA,oBAAA;AAEAG,mCAAA,QAAA,sBAAA,eAAAD,gCAAA,qBAAA"}
@@ -1,4 +1,4 @@
1
- //#region \0@oxc-project+runtime@0.148.0/helpers/esm/typeof.js
1
+ //#region \0@oxc-project+runtime@0.154.0/helpers/esm/typeof.js
2
2
  function _typeof(o) {
3
3
  "@babel/helpers - typeof";
4
4
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -9,7 +9,7 @@ function _typeof(o) {
9
9
  }
10
10
 
11
11
  //#endregion
12
- //#region \0@oxc-project+runtime@0.148.0/helpers/esm/toPrimitive.js
12
+ //#region \0@oxc-project+runtime@0.154.0/helpers/esm/toPrimitive.js
13
13
  function toPrimitive(t, r) {
14
14
  if ("object" != _typeof(t) || !t) return t;
15
15
  var e = t[Symbol.toPrimitive];
@@ -22,14 +22,14 @@ function toPrimitive(t, r) {
22
22
  }
23
23
 
24
24
  //#endregion
25
- //#region \0@oxc-project+runtime@0.148.0/helpers/esm/toPropertyKey.js
25
+ //#region \0@oxc-project+runtime@0.154.0/helpers/esm/toPropertyKey.js
26
26
  function toPropertyKey(t) {
27
27
  var i = toPrimitive(t, "string");
28
28
  return "symbol" == _typeof(i) ? i : i + "";
29
29
  }
30
30
 
31
31
  //#endregion
32
- //#region \0@oxc-project+runtime@0.148.0/helpers/esm/defineProperty.js
32
+ //#region \0@oxc-project+runtime@0.154.0/helpers/esm/defineProperty.js
33
33
  function _defineProperty(e, r, t) {
34
34
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
35
35
  value: t,
@@ -53,4 +53,4 @@ var CronTaskHandler = class {
53
53
 
54
54
  //#endregion
55
55
  export { CronTaskHandler as t };
56
- //# sourceMappingURL=CronTaskHandler-DiH4wqma.mjs.map
56
+ //# sourceMappingURL=CronTaskHandler-CSnptO8A.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"CronTaskHandler-DiH4wqma.mjs","names":[],"sources":["../../src/lib/CronTaskHandler.ts"],"sourcesContent":["import type Sentry from '@sentry/node';\nimport type { CronTaskHandlerOptions } from './types/CronTaskTypes';\n\nexport class CronTaskHandler {\n\t/**\n\t * The default IANA/TZ timezone to use for all cron jobs.\n\t * You can override this per task, using the timezone option.\n\t * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\n\t */\n\tpublic defaultTimezone?: CronTaskHandlerOptions['defaultTimezone'];\n\n\t/**\n\t * The ability to opt-out of instrumenting cron jobs with Sentry.\n\t * If you don't use Sentry, you can ignore this option.\n\t * @see https://docs.sentry.io/product/crons/\n\t * @default false\n\t */\n\tpublic disableSentry: boolean;\n\n\t/**\n\t * The Sentry instance to use for instrumenting cron jobs.\n\t * This is only available when [`@sentry/node`](https://www.npmjs.com/package/@sentry/node)\n\t * is installed and the {@linkcode disableSentry} option is set to false.\n\t */\n\tpublic sentry?: typeof Sentry;\n\n\tpublic constructor(options?: Partial<CronTaskHandlerOptions>) {\n\t\tthis.defaultTimezone = options?.defaultTimezone;\n\t\tthis.disableSentry = options?.disableSentry ?? false;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAA,kBAAA,MAAA;CAuBA,AAAA,YAAA,SAAA;wBAjBA;wBAQA;wBAOA;EAGA,KAAA,kBAAA,SAAA;EACA,KAAA,gBAAA,SAAA,iBAAA;CACA;AACA"}
1
+ {"version":3,"file":"CronTaskHandler-CSnptO8A.mjs","names":[],"sources":["../../src/lib/CronTaskHandler.ts"],"sourcesContent":["import type Sentry from '@sentry/node';\nimport type { CronTaskHandlerOptions } from './types/CronTaskTypes';\n\nexport class CronTaskHandler {\n\t/**\n\t * The default IANA/TZ timezone to use for all cron jobs.\n\t * You can override this per task, using the timezone option.\n\t * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\n\t */\n\tpublic defaultTimezone?: CronTaskHandlerOptions['defaultTimezone'];\n\n\t/**\n\t * The ability to opt-out of instrumenting cron jobs with Sentry.\n\t * If you don't use Sentry, you can ignore this option.\n\t * @see https://docs.sentry.io/product/crons/\n\t * @default false\n\t */\n\tpublic disableSentry: boolean;\n\n\t/**\n\t * The Sentry instance to use for instrumenting cron jobs.\n\t * This is only available when [`@sentry/node`](https://www.npmjs.com/package/@sentry/node)\n\t * is installed and the {@linkcode disableSentry} option is set to false.\n\t */\n\tpublic sentry?: typeof Sentry;\n\n\tpublic constructor(options?: Partial<CronTaskHandlerOptions>) {\n\t\tthis.defaultTimezone = options?.defaultTimezone;\n\t\tthis.disableSentry = options?.disableSentry ?? false;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAA,kBAAA,MAAA;CAuBA,AAAA,YAAA,SAAA;wBAjBA;wBAQA;wBAOA;EAGA,KAAA,kBAAA,SAAA;EACA,KAAA,gBAAA,SAAA,iBAAA;CACA;AACA"}
@@ -1,4 +1,4 @@
1
- import { t as CronTaskHandler } from "./CronTaskHandler-DiH4wqma.mjs";
1
+ import { t as CronTaskHandler } from "./CronTaskHandler-CSnptO8A.mjs";
2
2
  import { CronTask } from "./lib/structures/CronTask.mjs";
3
3
  import { CronTaskStore } from "./lib/structures/CronTaskStore.mjs";
4
4
 
@@ -9,7 +9,7 @@ import { CronTaskStore } from "./lib/structures/CronTaskStore.mjs";
9
9
  *
10
10
  * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild
11
11
  */
12
- const version = "4.0.2-next.1e20a7a";
12
+ const version = "4.0.2-next.2a391cb";
13
13
 
14
14
  //#endregion
15
15
  export { CronTask, CronTaskHandler, CronTaskStore, version };
@@ -1,3 +1,3 @@
1
- import { t as CronTaskHandler } from "../CronTaskHandler-DiH4wqma.mjs";
1
+ import { t as CronTaskHandler } from "../CronTaskHandler-CSnptO8A.mjs";
2
2
 
3
3
  export { CronTaskHandler };
@@ -1,4 +1,4 @@
1
- import { t as CronTaskHandler } from "./CronTaskHandler-DiH4wqma.mjs";
1
+ import { t as CronTaskHandler } from "./CronTaskHandler-CSnptO8A.mjs";
2
2
  import { CronTaskStore } from "./lib/structures/CronTaskStore.mjs";
3
3
  import "./index.mjs";
4
4
  import { Plugin, SapphireClient, container, postInitialization, postLogin, preGenericsInitialization, preLogin } from "@sapphire/framework";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kingsworld/plugin-cron",
3
3
  "description": "A simple @sapphire/framework plugin that aims to make use of the croner package and allow users to make cron jobs within their Sapphire discord bot.",
4
- "version": "4.0.2-next.1e20a7a",
4
+ "version": "4.0.2-next.2a391cb",
5
5
  "author": "Seren_Modz 21 <seren@kings-world.net>",
6
6
  "license": "MIT",
7
7
  "main": "dist/cjs/index.cjs",
@@ -45,9 +45,9 @@
45
45
  },
46
46
  "devDependencies": {
47
47
  "@favware/cliff-jumper": "6.1.0",
48
- "@sentry/node": "10.75.2",
49
- "@types/node": "24.13.6",
50
- "tsdown": "0.23.0",
48
+ "@sentry/node": "10.76.2",
49
+ "@types/node": "24.19.2",
50
+ "tsdown": "0.23.1",
51
51
  "typescript": "6.0.3"
52
52
  },
53
53
  "homepage": "https://github.com/Kings-World/sapphire-plugins",