@kingsworld/plugin-cron 4.0.1-pr-276.75fe492 → 4.0.1

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 (65) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/{esm/CronTask-CFQhlY0I.d.mts → cjs/CronTask-Cl3vuqLP.d.cts} +4 -4
  3. package/dist/cjs/CronTask-Cl3vuqLP.d.cts.map +1 -0
  4. package/dist/cjs/{CronTaskHandler-ZUQoGvcS.cjs → CronTaskHandler-Bq4LU7qH.cjs} +5 -6
  5. package/dist/cjs/{CronTaskHandler-ZUQoGvcS.cjs.map → CronTaskHandler-Bq4LU7qH.cjs.map} +1 -1
  6. package/dist/{esm/CronTaskHandler-CrRFxQDW.d.mts → cjs/CronTaskHandler-XGx_tZ1o.d.cts} +3 -3
  7. package/dist/cjs/CronTaskHandler-XGx_tZ1o.d.cts.map +1 -0
  8. package/dist/{esm/CronTaskStore-BB2K0ZmF.d.mts → cjs/CronTaskStore-BUQH8cdW.d.cts} +3 -3
  9. package/dist/cjs/CronTaskStore-BUQH8cdW.d.cts.map +1 -0
  10. package/dist/{esm/CronTaskTypes-D0hLmxra.d.mts → cjs/CronTaskTypes-BfXWfHg6.d.cts} +2 -2
  11. package/dist/cjs/CronTaskTypes-BfXWfHg6.d.cts.map +1 -0
  12. package/dist/cjs/index.cjs +2 -2
  13. package/dist/cjs/index.d.cts +6 -7
  14. package/dist/cjs/index.d.cts.map +1 -1
  15. package/dist/cjs/lib/CronTaskHandler.cjs +1 -1
  16. package/dist/cjs/lib/CronTaskHandler.d.cts +1 -1
  17. package/dist/cjs/lib/structures/CronTask.cjs.map +1 -1
  18. package/dist/cjs/lib/structures/CronTask.d.cts +1 -1
  19. package/dist/cjs/lib/structures/CronTaskStore.cjs.map +1 -1
  20. package/dist/cjs/lib/structures/CronTaskStore.d.cts +1 -1
  21. package/dist/cjs/lib/types/CronTaskTypes.d.cts +1 -1
  22. package/dist/cjs/lib/utils/normalizePattern.cjs +0 -1
  23. package/dist/cjs/lib/utils/normalizePattern.cjs.map +1 -1
  24. package/dist/cjs/lib/utils/normalizePattern.d.cts +1 -2
  25. package/dist/cjs/lib/utils/normalizePattern.d.cts.map +1 -1
  26. package/dist/cjs/register.cjs +1 -1
  27. package/dist/cjs/register.cjs.map +1 -1
  28. package/dist/cjs/register.d.cts +2 -3
  29. package/dist/cjs/register.d.cts.map +1 -1
  30. package/dist/{cjs/CronTask-CPIU4D6h.d.cts → esm/CronTask-DFQB8iCL.d.mts} +3 -5
  31. package/dist/esm/CronTask-DFQB8iCL.d.mts.map +1 -0
  32. package/dist/esm/{CronTaskHandler-BpMfN0Gk.mjs → CronTaskHandler-DiH4wqma.mjs} +5 -5
  33. package/dist/esm/{CronTaskHandler-BpMfN0Gk.mjs.map → CronTaskHandler-DiH4wqma.mjs.map} +1 -1
  34. package/dist/{cjs/CronTaskHandler-B1NV5U_-.d.cts → esm/CronTaskHandler-bxZeiSQD.d.mts} +2 -4
  35. package/dist/esm/CronTaskHandler-bxZeiSQD.d.mts.map +1 -0
  36. package/dist/{cjs/CronTaskStore-BK7iLYXq.d.cts → esm/CronTaskStore-Ei9TVxaS.d.mts} +2 -4
  37. package/dist/esm/CronTaskStore-Ei9TVxaS.d.mts.map +1 -0
  38. package/dist/{cjs/CronTaskTypes-BCLp38D3.d.cts → esm/CronTaskTypes-Dj8Ny7j5.d.mts} +1 -3
  39. package/dist/esm/CronTaskTypes-Dj8Ny7j5.d.mts.map +1 -0
  40. package/dist/esm/index.d.mts +6 -7
  41. package/dist/esm/index.d.mts.map +1 -1
  42. package/dist/esm/index.mjs +2 -2
  43. package/dist/esm/lib/CronTaskHandler.d.mts +1 -1
  44. package/dist/esm/lib/CronTaskHandler.mjs +1 -1
  45. package/dist/esm/lib/structures/CronTask.d.mts +1 -1
  46. package/dist/esm/lib/structures/CronTask.mjs.map +1 -1
  47. package/dist/esm/lib/structures/CronTaskStore.d.mts +1 -1
  48. package/dist/esm/lib/structures/CronTaskStore.mjs.map +1 -1
  49. package/dist/esm/lib/types/CronTaskTypes.d.mts +1 -1
  50. package/dist/esm/lib/utils/normalizePattern.d.mts +1 -2
  51. package/dist/esm/lib/utils/normalizePattern.d.mts.map +1 -1
  52. package/dist/esm/lib/utils/normalizePattern.mjs.map +1 -1
  53. package/dist/esm/register.d.mts +2 -3
  54. package/dist/esm/register.d.mts.map +1 -1
  55. package/dist/esm/register.mjs +1 -1
  56. package/dist/esm/register.mjs.map +1 -1
  57. package/package.json +4 -4
  58. package/dist/cjs/CronTask-CPIU4D6h.d.cts.map +0 -1
  59. package/dist/cjs/CronTaskHandler-B1NV5U_-.d.cts.map +0 -1
  60. package/dist/cjs/CronTaskStore-BK7iLYXq.d.cts.map +0 -1
  61. package/dist/cjs/CronTaskTypes-BCLp38D3.d.cts.map +0 -1
  62. package/dist/esm/CronTask-CFQhlY0I.d.mts.map +0 -1
  63. package/dist/esm/CronTaskHandler-CrRFxQDW.d.mts.map +0 -1
  64. package/dist/esm/CronTaskStore-BB2K0ZmF.d.mts.map +0 -1
  65. package/dist/esm/CronTaskTypes-D0hLmxra.d.mts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ # [@kingsworld/plugin-cron@4.0.1](https://github.com/Kings-World/sapphire-plugins/compare/@kingsworld/plugin-cron@4.0.0...@kingsworld/plugin-cron@4.0.1) - (2026-09-07)
6
+
7
+ ## 🏠 Refactor
8
+
9
+ - Prefer string.replaceAll() over string.replace() ([cc697d4](https://github.com/Kings-World/sapphire-plugins/commit/cc697d4ab96624e0fb394329ceaae6e33ab05b1e)) ([#275](https://github.com/Kings-World/sapphire-plugins/pull/275) by @SerenModz21)
10
+
5
11
  # [@kingsworld/plugin-cron@4.0.0](https://github.com/Kings-World/sapphire-plugins/compare/@kingsworld/plugin-cron@3.0.6...@kingsworld/plugin-cron@4.0.0) - (2026-04-10)
6
12
 
7
13
  ## 🐛 Bug Fixes
@@ -1,8 +1,8 @@
1
- import { t as CronJobOptions } from "./CronTaskTypes-D0hLmxra.mjs";
1
+
2
+ import { t as CronJobOptions } from "./CronTaskTypes-BfXWfHg6.cjs";
2
3
  import { Piece } from "@sapphire/pieces";
3
- import { Cron } from "croner";
4
4
  import { Awaitable } from "@sapphire/framework";
5
-
5
+ import { Cron } from "croner";
6
6
  //#region src/lib/structures/CronTask.d.ts
7
7
  /**
8
8
  * @example
@@ -80,4 +80,4 @@ declare namespace CronTask {
80
80
  }
81
81
  //#endregion
82
82
  export { CronTask as t };
83
- //# sourceMappingURL=CronTask-CFQhlY0I.d.mts.map
83
+ //# sourceMappingURL=CronTask-Cl3vuqLP.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CronTask-Cl3vuqLP.d.cts","names":[],"sources":["../../src/lib/structures/CronTask.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;uBA0BsB,SAAS,gBAAgB,SAAS,UAAU,SAAS,iBAAiB,MAAM;EAClF,KAAK;EAED,YAAA,SAAS,SAAS,eAAe,SAAS;WAI7C,OAAO;EAEhB,SAAS,KAAK,OAAO;EAErB,OAAO,gBAAgB,KAAK,OAAO;;;;;;;;EASnC,KAAK,oBAAoB;;;;;;;;EAWzB,MAAM,oBAAoB;;;;;;;;EAW1B,KAAK,oBAAoB;;;;;;;;EAWzB,MAAM,oBAAoB;;;;;;;;EAW1B,MAAM,oBAAoB;;kBAKjB;OACJ,UAAU,MAAM,UAAU;;OAE1B,UAAU;OACV,gBAAgB,MAAM"}
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
-
4
- //#region \0@oxc-project+runtime@0.127.0/helpers/typeof.js
3
+ //#region \0@oxc-project+runtime@0.148.0/helpers/esm/typeof.js
5
4
  function _typeof(o) {
6
5
  "@babel/helpers - typeof";
7
6
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -12,7 +11,7 @@ function _typeof(o) {
12
11
  }
13
12
 
14
13
  //#endregion
15
- //#region \0@oxc-project+runtime@0.127.0/helpers/toPrimitive.js
14
+ //#region \0@oxc-project+runtime@0.148.0/helpers/esm/toPrimitive.js
16
15
  function toPrimitive(t, r) {
17
16
  if ("object" != _typeof(t) || !t) return t;
18
17
  var e = t[Symbol.toPrimitive];
@@ -25,14 +24,14 @@ function toPrimitive(t, r) {
25
24
  }
26
25
 
27
26
  //#endregion
28
- //#region \0@oxc-project+runtime@0.127.0/helpers/toPropertyKey.js
27
+ //#region \0@oxc-project+runtime@0.148.0/helpers/esm/toPropertyKey.js
29
28
  function toPropertyKey(t) {
30
29
  var i = toPrimitive(t, "string");
31
30
  return "symbol" == _typeof(i) ? i : i + "";
32
31
  }
33
32
 
34
33
  //#endregion
35
- //#region \0@oxc-project+runtime@0.127.0/helpers/defineProperty.js
34
+ //#region \0@oxc-project+runtime@0.148.0/helpers/esm/defineProperty.js
36
35
  function _defineProperty(e, r, t) {
37
36
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
38
37
  value: t,
@@ -61,4 +60,4 @@ Object.defineProperty(exports, 'CronTaskHandler', {
61
60
  return CronTaskHandler;
62
61
  }
63
62
  });
64
- //# sourceMappingURL=CronTaskHandler-ZUQoGvcS.cjs.map
63
+ //# sourceMappingURL=CronTaskHandler-Bq4LU7qH.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"CronTaskHandler-ZUQoGvcS.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,0BAAA;wBAQA,wBAAA;wBAOA,iBAAA;AAGA,OAAA,kBAAA,SAAA;AACA,OAAA,gBAAA,SAAA,iBAAA"}
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,6 +1,6 @@
1
- import { n as CronTaskHandlerOptions } from "./CronTaskTypes-D0hLmxra.mjs";
2
- import Sentry from "@sentry/node";
3
1
 
2
+ import { n as CronTaskHandlerOptions } from "./CronTaskTypes-BfXWfHg6.cjs";
3
+ import Sentry from "@sentry/node";
4
4
  //#region src/lib/CronTaskHandler.d.ts
5
5
  declare class CronTaskHandler {
6
6
  /**
@@ -26,4 +26,4 @@ declare class CronTaskHandler {
26
26
  }
27
27
  //#endregion
28
28
  export { CronTaskHandler as t };
29
- //# sourceMappingURL=CronTaskHandler-CrRFxQDW.d.mts.map
29
+ //# sourceMappingURL=CronTaskHandler-XGx_tZ1o.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CronTaskHandler-XGx_tZ1o.d.cts","names":[],"sources":["../../src/lib/CronTaskHandler.ts"],"mappings":";;;;cAGa;;;;;;EAML,kBAAkB;;;;;;;EAQlB;;;;;;EAOA,gBAAgB;EAEJ,YAAA,UAAU,QAAQ"}
@@ -1,6 +1,6 @@
1
- import { t as CronTask } from "./CronTask-CFQhlY0I.mjs";
2
- import { Store } from "@sapphire/pieces";
3
1
 
2
+ import { t as CronTask } from "./CronTask-Cl3vuqLP.cjs";
3
+ import { Store } from "@sapphire/pieces";
4
4
  //#region src/lib/structures/CronTaskStore.d.ts
5
5
  declare class CronTaskStore extends Store<CronTask, 'cron-tasks'> {
6
6
  constructor();
@@ -53,4 +53,4 @@ declare class CronTaskStore extends Store<CronTask, 'cron-tasks'> {
53
53
  }
54
54
  //#endregion
55
55
  export { CronTaskStore as t };
56
- //# sourceMappingURL=CronTaskStore-BB2K0ZmF.d.mts.map
56
+ //# sourceMappingURL=CronTaskStore-BUQH8cdW.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CronTaskStore-BUQH8cdW.d.cts","names":[],"sources":["../../src/lib/structures/CronTaskStore.ts"],"mappings":";;;;cAKa,sBAAsB,MAAM;;;;;;;;;;;;;EAgBjC;;;;;;;;;;;;EAqBA;;;;;;;;;;;;;EAsBA;EAUS,IAAI,aAAa,OAAO;;;;EAsDxB,OAAO;;;;EAYP"}
@@ -1,5 +1,5 @@
1
- import { CronOptions } from "croner";
2
1
 
2
+ import { CronOptions } from "croner";
3
3
  //#region src/lib/types/CronTaskTypes.d.ts
4
4
  interface CronTaskHandlerOptions {
5
5
  /**
@@ -26,4 +26,4 @@ interface CronJobOptions extends Pick<CronOptions, 'maxRuns' | 'unref' | 'timezo
26
26
  }
27
27
  //#endregion
28
28
  export { CronTaskHandlerOptions as n, CronJobOptions as t };
29
- //# sourceMappingURL=CronTaskTypes-D0hLmxra.d.mts.map
29
+ //# sourceMappingURL=CronTaskTypes-BfXWfHg6.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CronTaskTypes-BfXWfHg6.d.cts","names":[],"sources":["../../src/lib/types/CronTaskTypes.ts"],"mappings":";;;UAEiB;;;;;EAKhB;;;;;;;EAQA;;UAGgB,uBAAuB,KAAK;EAC5C,kBAAkB;;;;;;EAMlB"}
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
- const require_CronTaskHandler = require('./CronTaskHandler-ZUQoGvcS.cjs');
4
+ const require_CronTaskHandler = require('./CronTaskHandler-Bq4LU7qH.cjs');
5
5
  const require_lib_structures_CronTask = require('./lib/structures/CronTask.cjs');
6
6
  const require_lib_structures_CronTaskStore = require('./lib/structures/CronTaskStore.cjs');
7
7
 
@@ -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.1-pr-276.75fe492";
15
+ const version = "4.0.1";
16
16
 
17
17
  //#endregion
18
18
  exports.CronTask = require_lib_structures_CronTask.CronTask;
@@ -1,9 +1,8 @@
1
1
 
2
- import { n as CronTaskHandlerOptions, t as CronJobOptions } from "./CronTaskTypes-BCLp38D3.cjs";
3
- import { t as CronTask } from "./CronTask-CPIU4D6h.cjs";
4
- import { t as CronTaskStore } from "./CronTaskStore-BK7iLYXq.cjs";
5
- import { t as CronTaskHandler } from "./CronTaskHandler-B1NV5U_-.cjs";
6
-
2
+ import { n as CronTaskHandlerOptions, t as CronJobOptions } from "./CronTaskTypes-BfXWfHg6.cjs";
3
+ import { t as CronTask } from "./CronTask-Cl3vuqLP.cjs";
4
+ import { t as CronTaskStore } from "./CronTaskStore-BUQH8cdW.cjs";
5
+ import { t as CronTaskHandler } from "./CronTaskHandler-XGx_tZ1o.cjs";
7
6
  //#region src/index.d.ts
8
7
  declare module '@sapphire/pieces' {
9
8
  interface Container {
@@ -24,7 +23,7 @@ declare module 'discord.js' {
24
23
  *
25
24
  * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild
26
25
  */
27
- declare const version: string;
26
+ export declare const version: string;
28
27
  //#endregion
29
- export { CronJobOptions, CronTask, CronTaskHandler, CronTaskHandlerOptions, CronTaskStore, version };
28
+ export { CronJobOptions, CronTask, CronTaskHandler, CronTaskHandlerOptions, CronTaskStore };
30
29
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;;YAUW,SAAA;IACT,SAAA,EAAW,eAAA;EAAA;EAAA,UAGF,oBAAA;IACT,YAAA,EAAc,aAAA;EAAA;AAAA;AAAA;EAAA,UAKE,aAAA;IAChB,SAAA,GAAY,OAAA,CAAQ,sBAAA;EAAA;AAAA;;;;;;;cAUT,OAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;YAUW;IACT,WAAW;;YAGF;IACT,cAAc;;;;YAKE;IAChB,YAAY,QAAQ;;;;;;;;;qBAUT"}
@@ -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-ZUQoGvcS.cjs');
4
+ const require_CronTaskHandler = require('../CronTaskHandler-Bq4LU7qH.cjs');
5
5
 
6
6
  exports.CronTaskHandler = require_CronTaskHandler.CronTaskHandler;
@@ -1,3 +1,3 @@
1
1
 
2
- import { t as CronTaskHandler } from "../CronTaskHandler-B1NV5U_-.cjs";
2
+ import { t as CronTaskHandler } from "../CronTaskHandler-XGx_tZ1o.cjs";
3
3
  export { 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;AACA,QAAA,SAAA,QAAA;;;;;;;;;CAgBA,AAAA,KAAA,SAAA,GAAA,OAAA;AACA,OAAA,UAAA,OAAA,KAAA,YAAA,KAAA,KAAA,IAAA,WAAA,GAAA,MAAA;;;;;;;;;CAUA,AAAA,MAAA,SAAA,GAAA,OAAA;AACA,OAAA,UAAA,OAAA,MAAA,YAAA,KAAA,KAAA,IAAA,WAAA,GAAA,MAAA;;;;;;;;;CAUA,AAAA,KAAA,SAAA,GAAA,OAAA;AACA,OAAA,UAAA,OAAA,KAAA,YAAA,KAAA,KAAA,IAAA,WAAA,GAAA,MAAA;;;;;;;;;CAUA,AAAA,MAAA,SAAA,GAAA,OAAA;AACA,OAAA,UAAA,OAAA,MAAA,YAAA,KAAA,KAAA,IAAA,WAAA,GAAA,MAAA;;;;;;;;;CAUA,AAAA,MAAA,SAAA,GAAA,OAAA;AACA,OAAA,UAAA,OAAA,MAAA,YAAA,KAAA,KAAA,IAAA,WAAA,GAAA,MAAA"}
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,3 +1,3 @@
1
1
 
2
- import { t as CronTask } from "../../CronTask-CPIU4D6h.cjs";
2
+ import { t as CronTask } from "../../CronTask-Cl3vuqLP.cjs";
3
3
  export { CronTask };
@@ -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;AACA,QAAA,0CAAA,EAAA,MAAA,cAAA,CAAA;;;;;;;;;;;;;CAcA,AAAA,WAAA;AACA,OAAA,MAAA,QAAA,KAAA,QAAA,EAAA;AACA,OAAA,CAAA,KAAA,WAAA,CAAA,KAAA,IAAA,WAAA,CAAA;AACA,QAAA,IAAA,OAAA;;AAGA,yBAAA,SAAA,aAAA,KAAA,KAAA,qCAAA;AACA,SAAA;;;;;;;;;;;;;CAcA,AAAA,YAAA;AACA,OAAA,MAAA,QAAA,KAAA,QAAA,EAAA;AACA,OAAA,CAAA,KAAA,WAAA,KAAA,IAAA,WAAA,IAAA,KAAA,IAAA,WAAA,CAAA;AACA,QAAA,IAAA,QAAA;;AAGA,yBAAA,SAAA,aAAA,KAAA,KAAA,uCAAA;AACA,SAAA;;;;;;;;;;;;;;CAeA,AAAA,UAAA;AACA,OAAA,MAAA,QAAA,KAAA,QAAA,EAAA;AACA,OAAA,CAAA,KAAA,WAAA,KAAA,IAAA,WAAA,CAAA;AACA,QAAA,IAAA,MAAA;;AAGA,yBAAA,SAAA,aAAA,KAAA,KAAA,qCAAA;AACA,SAAA;;CAGA,AAAA,IAAA,KAAA,OAAA;EACA,MAAA,EAAA,SAAA,UAAA,SAAA,GAAA,YAAA,MAAA;EACA,MAAA,EAAA,QAAA,oBAAA,KAAA,UAAA;AAGA,MAAA,KAAA,IAAA,IAAA,EAAA;AACA,0BAAA,SAAA,aAAA,KAAA,KAAA,mEAAA;AACA,QAAA,IAAA,IAAA,EAAA,IAAA,MAAA;;EAGA,MAAA,WAAA,YAAA;AAEA,MAAA;AACA,0BAAA,SACA,aAAA,KAAA,KAAA,+BAAA,IAAA,SAAA,QAAA,wBAAA,SAAA,oBACA;AAEA,SAAA,MAAA,IAAA,YACA,SACA;IACA,MAAA;IACA,UAAA;IACA,QAAA;IACA,SAAA,MAAA,SAAA,KAAA,MAAA,IAAA;IACA,QAAA,UAAA;AACA,WAAA,MAAA,mDAAA,MAAA;AACA,aAAA,iBAAA,MAAA;AACA,WAAA,OAAA,KAAA,MAAA,CAAA,OAAA,MAAA,IAAA;;IAEA,GAAA;IACA,EACA,YAAA;AAEA,QAAA,UAAA,OAAA,YAAA,YAAA,CAAA,QAAA,SAAA,IAAA,CACA,OAAA,OAAA,YAAA,KAAA,MAAA,IAAA,KAAA,MAAA,EAAA;KACA,UAAA;MAAA,MAAA;MAAA,OAAA,oDAAA,QAAA;MAAA;KACA,UAAA;KACA,CAAA;QAEA,OAAA,MAAA,IAAA,KAAA,MAAA,EAAA;KAGA;WACA,OAAA;AACA,SAAA,MAAA,oDAAA,MAAA;AACA,GAAA,MAAA,QAAA;;AAGA,SAAA,MAAA,IAAA,KAAA,MAAA;;;;;CAMA,AAAA,OAAA,KAAA;EACA,MAAA,OAAA,KAAA,IAAA,IAAA;AACA,MAAA,QAAA,CAAA,KAAA,IAAA,WAAA,CACA,MAAA,IAAA,MAAA;AAGA,SAAA,MAAA,OAAA,IAAA;;;;;CAMA,AAAA,QAAA;AACA,OAAA,SAAA;AACA,SAAA,MAAA,OAAA"}
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,3 +1,3 @@
1
1
 
2
- import { t as CronTaskStore } from "../../CronTaskStore-BK7iLYXq.cjs";
2
+ import { t as CronTaskStore } from "../../CronTaskStore-BUQH8cdW.cjs";
3
3
  export { CronTaskStore };
@@ -1,3 +1,3 @@
1
1
 
2
- import { n as CronTaskHandlerOptions, t as CronJobOptions } from "../../CronTaskTypes-BCLp38D3.cjs";
2
+ import { n as CronTaskHandlerOptions, t as CronJobOptions } from "../../CronTaskTypes-BfXWfHg6.cjs";
3
3
  export { CronJobOptions, CronTaskHandlerOptions };
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
-
5
4
  //#region src/lib/utils/normalizePattern.ts
6
5
  const predefined = {
7
6
  "@annually": "0 0 1 1 *",
@@ -1 +1 @@
1
- {"version":3,"file":"normalizePattern.cjs","names":[],"sources":["../../../../src/lib/utils/normalizePattern.ts"],"sourcesContent":["/*\n * Credits to Sapphire for this\n * https://github.com/sapphiredev/utilities/blob/main/packages/cron/src/lib/constants.ts#L26-L57\n * https://github.com/sapphiredev/utilities/blob/main/packages/cron/src/lib/Cron.ts#L91\n */\n\nconst predefined = {\n\t'@annually': '0 0 1 1 *',\n\t'@yearly': '0 0 1 1 *',\n\t'@monthly': '0 0 1 * *',\n\t'@weekly': '0 0 * * 0',\n\t'@daily': '0 0 * * *',\n\t'@hourly': '0 * * * *'\n} as const;\n\nconst cronTokens: Record<string, number> = {\n\tjan: 1,\n\tfeb: 2,\n\tmar: 3,\n\tapr: 4,\n\tmay: 5,\n\tjun: 6,\n\tjul: 7,\n\taug: 8,\n\tsep: 9,\n\toct: 10,\n\tnov: 11,\n\tdec: 12,\n\tsun: 0,\n\tmon: 1,\n\ttue: 2,\n\twed: 3,\n\tthu: 4,\n\tfri: 5,\n\tsat: 6\n} as const;\n\nconst tokensRegex = new RegExp(Object.keys(cronTokens).join('|'), 'g');\n\nexport function normalizePattern(pattern: string): string {\n\tif (Reflect.has(predefined, pattern)) return Reflect.get(predefined, pattern);\n\treturn pattern.replaceAll(tokensRegex, (match) => String(Reflect.get(cronTokens, match)));\n}\n"],"mappings":";;;;;AAMA,MAAA,aAAA;CACA,aAAA;CACA,WAAA;CACA,YAAA;CACA,WAAA;CACA,UAAA;CACA,WAAA;CACA;AAEA,MAAA,aAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA;AAEA,MAAA,cAAA,IAAA,OAAA,OAAA,KAAA,WAAA,CAAA,KAAA,IAAA,EAAA,IAAA;AAEA,SAAA,iBAAA,SAAA;AACA,KAAA,QAAA,IAAA,YAAA,QAAA,CAAA,QAAA,QAAA,IAAA,YAAA,QAAA;AACA,QAAA,QAAA,WAAA,cAAA,UAAA,OAAA,QAAA,IAAA,YAAA,MAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"normalizePattern.cjs","names":[],"sources":["../../../../src/lib/utils/normalizePattern.ts"],"sourcesContent":["/*\n * Credits to Sapphire for this\n * https://github.com/sapphiredev/utilities/blob/main/packages/cron/src/lib/constants.ts#L26-L57\n * https://github.com/sapphiredev/utilities/blob/main/packages/cron/src/lib/Cron.ts#L91\n */\n\nconst predefined = {\n\t'@annually': '0 0 1 1 *',\n\t'@yearly': '0 0 1 1 *',\n\t'@monthly': '0 0 1 * *',\n\t'@weekly': '0 0 * * 0',\n\t'@daily': '0 0 * * *',\n\t'@hourly': '0 * * * *'\n} as const;\n\nconst cronTokens: Record<string, number> = {\n\tjan: 1,\n\tfeb: 2,\n\tmar: 3,\n\tapr: 4,\n\tmay: 5,\n\tjun: 6,\n\tjul: 7,\n\taug: 8,\n\tsep: 9,\n\toct: 10,\n\tnov: 11,\n\tdec: 12,\n\tsun: 0,\n\tmon: 1,\n\ttue: 2,\n\twed: 3,\n\tthu: 4,\n\tfri: 5,\n\tsat: 6\n} as const;\n\nconst tokensRegex = new RegExp(Object.keys(cronTokens).join('|'), 'g');\n\nexport function normalizePattern(pattern: string): string {\n\tif (Reflect.has(predefined, pattern)) return Reflect.get(predefined, pattern);\n\treturn pattern.replaceAll(tokensRegex, (match) => String(Reflect.get(cronTokens, match)));\n}\n"],"mappings":";;;;AAMA,MAAA,aAAA;CACA,aAAA;CACA,WAAA;CACA,YAAA;CACA,WAAA;CACA,UAAA;CACA,WAAA;AACA;AAEA,MAAA,aAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;AACA;AAEA,MAAA,cAAA,IAAA,OAAA,OAAA,KAAA,UAAA,CAAA,CAAA,KAAA,GAAA,GAAA,GAAA;AAEA,SAAA,iBAAA,SAAA;CACA,IAAA,QAAA,IAAA,YAAA,OAAA,GAAA,OAAA,QAAA,IAAA,YAAA,OAAA;CACA,OAAA,QAAA,WAAA,cAAA,UAAA,OAAA,QAAA,IAAA,YAAA,KAAA,CAAA,CAAA;AACA"}
@@ -1,6 +1,5 @@
1
1
 
2
2
  //#region src/lib/utils/normalizePattern.d.ts
3
- declare function normalizePattern(pattern: string): string;
3
+ export declare function normalizePattern(pattern: string): string;
4
4
  //#endregion
5
- export { normalizePattern };
6
5
  //# sourceMappingURL=normalizePattern.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalizePattern.d.cts","names":[],"sources":["../../../../src/lib/utils/normalizePattern.ts"],"mappings":";;iBAuCgB,gBAAA,CAAiB,OAAA"}
1
+ {"version":3,"file":"normalizePattern.d.cts","names":[],"sources":["../../../../src/lib/utils/normalizePattern.ts"],"mappings":";;wBAuCgB,iBAAiB"}
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
- const require_CronTaskHandler = require('./CronTaskHandler-ZUQoGvcS.cjs');
4
+ const require_CronTaskHandler = require('./CronTaskHandler-Bq4LU7qH.cjs');
5
5
  const require_lib_structures_CronTaskStore = require('./lib/structures/CronTaskStore.cjs');
6
6
  require('./index.cjs');
7
7
  let _sapphire_framework = require("@sapphire/framework");
@@ -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;AACA,gCAAA,YAAA,IAAA,wCAAA,QAAA,UAAA;;CAGA,QAAA,0CAAA;AACA,OAAA,OAAA,SAAA,IAAA,oDAAA,CAAA;;CAGA,cAAA,gCAAA;AACA,MAAA,8BAAA,UAAA,cAAA;AACA,gCAAA,UAAA,SAAA,MAAA,OAAA,gBAAA,YAAA,OAAA;;CAGA,QAAA,iCAAA;AACA,OAAA,OAAA,IAAA,aAAA,CAAA,WAAA;;;AAIA,mCAAA,QAAA,sCAAA,eAAA,gDAAA,sCAAA;AAEA,mCAAA,QAAA,+BAAA,eAAA,yCAAA,+BAAA;AAEA,mCAAA,QAAA,qBAAA,eAAA,+BAAA,qBAAA;AAEA,mCAAA,QAAA,sBAAA,eAAA,gCAAA,sBAAA"}
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,14 +1,13 @@
1
1
 
2
+ import "./index.cjs";
2
3
  import { Plugin, SapphireClient, postInitialization, postLogin, preGenericsInitialization, preLogin } from "@sapphire/framework";
3
4
  import { ClientOptions } from "discord.js";
4
-
5
5
  //#region src/register.d.ts
6
- declare class CronTaskPlugin extends Plugin {
6
+ export declare class CronTaskPlugin extends Plugin {
7
7
  static [preGenericsInitialization](this: SapphireClient, options: ClientOptions): void;
8
8
  static [postInitialization](this: SapphireClient): void;
9
9
  static [preLogin](this: SapphireClient): Promise<void>;
10
10
  static [postLogin](this: SapphireClient): void;
11
11
  }
12
12
  //#endregion
13
- export { CronTaskPlugin };
14
13
  //# sourceMappingURL=register.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"register.d.cts","names":[],"sources":["../../src/register.ts"],"mappings":";;;;;cAMa,cAAA,SAAuB,MAAA;EAAA,QACX,yBAAA,EAA2B,IAAA,EAAM,cAAA,EAAgB,OAAA,EAAS,aAAA;EAAA,QAI1D,kBAAA,EAAoB,IAAA,EAAM,cAAA;EAAA,QAIpB,QAAA,EAAU,IAAA,EAAM,cAAA,GAAc,OAAA;EAAA,QAKpC,SAAA,EAAW,IAAA,EAAM,cAAA;AAAA"}
1
+ {"version":3,"file":"register.d.cts","names":[],"sources":["../../src/register.ts"],"mappings":";;;;;qBAMa,uBAAuB;UACX,2BAA2B,MAAM,gBAAgB,SAAS;UAI1D,oBAAoB,MAAM;UAIpB,UAAU,MAAM,iBAAc;UAKpC,WAAW,MAAM"}
@@ -1,9 +1,7 @@
1
-
2
- import { t as CronJobOptions } from "./CronTaskTypes-BCLp38D3.cjs";
1
+ import { t as CronJobOptions } from "./CronTaskTypes-Dj8Ny7j5.mjs";
3
2
  import { Piece } from "@sapphire/pieces";
4
- import { Awaitable } from "@sapphire/framework";
5
3
  import { Cron } from "croner";
6
-
4
+ import { Awaitable } from "@sapphire/framework";
7
5
  //#region src/lib/structures/CronTask.d.ts
8
6
  /**
9
7
  * @example
@@ -81,4 +79,4 @@ declare namespace CronTask {
81
79
  }
82
80
  //#endregion
83
81
  export { CronTask as t };
84
- //# sourceMappingURL=CronTask-CPIU4D6h.d.cts.map
82
+ //# sourceMappingURL=CronTask-DFQB8iCL.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CronTask-DFQB8iCL.d.mts","names":[],"sources":["../../src/lib/structures/CronTask.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;uBA0BA,SAAA,gBAAA,SAAA,UAAA,SAAA,iBAAA,MAAA;EAAA,KAAA;EAAA,YAAA,SAAA,SAAA,eAAA,SAAA;WAAA,OAAA;EAAA,SAAA,KAAA,OAAA;EAAA,OAAA,gBAAA,KAAA,OAAA;;;;;;;;EAAA,KAAA,oBAAA;;;;;;;;EAAA,MAAA,oBAAA;;;;;;;;EAAA,KAAA,oBAAA;;;;;;;;EAAA,MAAA,oBAAA;;;;;;;;EAAA,MAAA,oBAAA;;kBAqEA;OAAA,UAAA,MAAA,UAAA;;OAAA,UAAA;OAAA,gBAAA,MAAA"}
@@ -1,4 +1,4 @@
1
- //#region \0@oxc-project+runtime@0.127.0/helpers/typeof.js
1
+ //#region \0@oxc-project+runtime@0.148.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.127.0/helpers/toPrimitive.js
12
+ //#region \0@oxc-project+runtime@0.148.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.127.0/helpers/toPropertyKey.js
25
+ //#region \0@oxc-project+runtime@0.148.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.127.0/helpers/defineProperty.js
32
+ //#region \0@oxc-project+runtime@0.148.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-BpMfN0Gk.mjs.map
56
+ //# sourceMappingURL=CronTaskHandler-DiH4wqma.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"CronTaskHandler-BpMfN0Gk.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,0BAAA;wBAQA,wBAAA;wBAOA,iBAAA;AAGA,OAAA,kBAAA,SAAA;AACA,OAAA,gBAAA,SAAA,iBAAA"}
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,7 +1,5 @@
1
-
2
- import { n as CronTaskHandlerOptions } from "./CronTaskTypes-BCLp38D3.cjs";
1
+ import { n as CronTaskHandlerOptions } from "./CronTaskTypes-Dj8Ny7j5.mjs";
3
2
  import Sentry from "@sentry/node";
4
-
5
3
  //#region src/lib/CronTaskHandler.d.ts
6
4
  declare class CronTaskHandler {
7
5
  /**
@@ -27,4 +25,4 @@ declare class CronTaskHandler {
27
25
  }
28
26
  //#endregion
29
27
  export { CronTaskHandler as t };
30
- //# sourceMappingURL=CronTaskHandler-B1NV5U_-.d.cts.map
28
+ //# sourceMappingURL=CronTaskHandler-bxZeiSQD.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CronTaskHandler-bxZeiSQD.d.mts","names":[],"sources":["../../src/lib/CronTaskHandler.ts"],"mappings":";;;cAGA;;;;;;EAAA,kBAAA;;;;;;;EAAA;;;;;;EAAA,gBAAA;EAAA,YAAA,UAAA,QAAA"}
@@ -1,7 +1,5 @@
1
-
2
- import { t as CronTask } from "./CronTask-CPIU4D6h.cjs";
1
+ import { t as CronTask } from "./CronTask-DFQB8iCL.mjs";
3
2
  import { Store } from "@sapphire/pieces";
4
-
5
3
  //#region src/lib/structures/CronTaskStore.d.ts
6
4
  declare class CronTaskStore extends Store<CronTask, 'cron-tasks'> {
7
5
  constructor();
@@ -54,4 +52,4 @@ declare class CronTaskStore extends Store<CronTask, 'cron-tasks'> {
54
52
  }
55
53
  //#endregion
56
54
  export { CronTaskStore as t };
57
- //# sourceMappingURL=CronTaskStore-BK7iLYXq.d.cts.map
55
+ //# sourceMappingURL=CronTaskStore-Ei9TVxaS.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CronTaskStore-Ei9TVxaS.d.mts","names":[],"sources":["../../src/lib/structures/CronTaskStore.ts"],"mappings":";;;cAKA,sBAAA,MAAA;EAAA;;;;;;;;;;;;EAAA;;;;;;;;;;;;EAAA;;;;;;;;;;;;;EAAA;EAAA,IAAA,aAAA,OAAA;;;;EAAA,OAAA;;;;EAAA"}
@@ -1,6 +1,4 @@
1
-
2
1
  import { CronOptions } from "croner";
3
-
4
2
  //#region src/lib/types/CronTaskTypes.d.ts
5
3
  interface CronTaskHandlerOptions {
6
4
  /**
@@ -27,4 +25,4 @@ interface CronJobOptions extends Pick<CronOptions, 'maxRuns' | 'unref' | 'timezo
27
25
  }
28
26
  //#endregion
29
27
  export { CronTaskHandlerOptions as n, CronJobOptions as t };
30
- //# sourceMappingURL=CronTaskTypes-BCLp38D3.d.cts.map
28
+ //# sourceMappingURL=CronTaskTypes-Dj8Ny7j5.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CronTaskTypes-Dj8Ny7j5.d.mts","names":[],"sources":["../../src/lib/types/CronTaskTypes.ts"],"mappings":";;UAEA;;;;;EAAA;;;;;;;EAAA;;UAgBA,uBAAA,KAAA;EAAA,kBAAA;;;;;;EAAA"}
@@ -1,8 +1,7 @@
1
- import { n as CronTaskHandlerOptions, t as CronJobOptions } from "./CronTaskTypes-D0hLmxra.mjs";
2
- import { t as CronTask } from "./CronTask-CFQhlY0I.mjs";
3
- import { t as CronTaskStore } from "./CronTaskStore-BB2K0ZmF.mjs";
4
- import { t as CronTaskHandler } from "./CronTaskHandler-CrRFxQDW.mjs";
5
-
1
+ import { n as CronTaskHandlerOptions, t as CronJobOptions } from "./CronTaskTypes-Dj8Ny7j5.mjs";
2
+ import { t as CronTask } from "./CronTask-DFQB8iCL.mjs";
3
+ import { t as CronTaskStore } from "./CronTaskStore-Ei9TVxaS.mjs";
4
+ import { t as CronTaskHandler } from "./CronTaskHandler-bxZeiSQD.mjs";
6
5
  //#region src/index.d.ts
7
6
  declare module '@sapphire/pieces' {
8
7
  interface Container {
@@ -23,7 +22,7 @@ declare module 'discord.js' {
23
22
  *
24
23
  * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild
25
24
  */
26
- declare const version: string;
25
+ export declare const version: string;
27
26
  //#endregion
28
- export { CronJobOptions, CronTask, CronTaskHandler, CronTaskHandlerOptions, CronTaskStore, version };
27
+ export { CronJobOptions, CronTask, CronTaskHandler, CronTaskHandlerOptions, CronTaskStore };
29
28
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;YAO0C,SAAA;IAAA,SAAA,EAAA,eAAA;EAAA;EAAA,UAAA,oBAAA;IAAA,YAAA,EAAA,aAAA;EAAA;AAAA;AAAA;EAAA,UAQb,aAAA;IAAA,SAAA,GAAA,OAAA,CAAA,sBAAA;EAAA;AAAA;;;;;;;cAgB7B,OAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;YAWa;IAAA,WAAA;;YAAA;IAAA,cAAA;;;;YAUS;IAAA,YAAA,QAAA;;;;;;;;;qBAUtB"}
@@ -1,4 +1,4 @@
1
- import { t as CronTaskHandler } from "./CronTaskHandler-BpMfN0Gk.mjs";
1
+ import { t as CronTaskHandler } from "./CronTaskHandler-DiH4wqma.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.1-pr-276.75fe492";
12
+ const version = "4.0.1";
13
13
 
14
14
  //#endregion
15
15
  export { CronTask, CronTaskHandler, CronTaskStore, version };
@@ -1,2 +1,2 @@
1
- import { t as CronTaskHandler } from "../CronTaskHandler-CrRFxQDW.mjs";
1
+ import { t as CronTaskHandler } from "../CronTaskHandler-bxZeiSQD.mjs";
2
2
  export { CronTaskHandler };
@@ -1,3 +1,3 @@
1
- import { t as CronTaskHandler } from "../CronTaskHandler-BpMfN0Gk.mjs";
1
+ import { t as CronTaskHandler } from "../CronTaskHandler-DiH4wqma.mjs";
2
2
 
3
3
  export { CronTaskHandler };
@@ -1,2 +1,2 @@
1
- import { t as CronTask } from "../../CronTask-CFQhlY0I.mjs";
1
+ import { t as CronTask } from "../../CronTask-DFQB8iCL.mjs";
2
2
  export { CronTask };
@@ -1 +1 @@
1
- {"version":3,"file":"CronTask.mjs","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,MAAA;CAGA,AAAA,YAAA,SAAA,SAAA;AACA,QAAA,SAAA,QAAA;;;;;;;;;CAgBA,AAAA,KAAA,SAAA,GAAA,OAAA;AACA,OAAA,UAAA,OAAA,KAAA,YAAA,KAAA,KAAA,IAAA,WAAA,GAAA,MAAA;;;;;;;;;CAUA,AAAA,MAAA,SAAA,GAAA,OAAA;AACA,OAAA,UAAA,OAAA,MAAA,YAAA,KAAA,KAAA,IAAA,WAAA,GAAA,MAAA;;;;;;;;;CAUA,AAAA,KAAA,SAAA,GAAA,OAAA;AACA,OAAA,UAAA,OAAA,KAAA,YAAA,KAAA,KAAA,IAAA,WAAA,GAAA,MAAA;;;;;;;;;CAUA,AAAA,MAAA,SAAA,GAAA,OAAA;AACA,OAAA,UAAA,OAAA,MAAA,YAAA,KAAA,KAAA,IAAA,WAAA,GAAA,MAAA;;;;;;;;;CAUA,AAAA,MAAA,SAAA,GAAA,OAAA;AACA,OAAA,UAAA,OAAA,MAAA,YAAA,KAAA,KAAA,IAAA,WAAA,GAAA,MAAA"}
1
+ {"version":3,"file":"CronTask.mjs","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,MAAA;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,2 +1,2 @@
1
- import { t as CronTaskStore } from "../../CronTaskStore-BB2K0ZmF.mjs";
1
+ import { t as CronTaskStore } from "../../CronTaskStore-Ei9TVxaS.mjs";
2
2
  export { CronTaskStore };
@@ -1 +1 @@
1
- {"version":3,"file":"CronTaskStore.mjs","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,MAAA;CACA,AAAA,cAAA;AACA,QAAA,UAAA,EAAA,MAAA,cAAA,CAAA;;;;;;;;;;;;;CAcA,AAAA,WAAA;AACA,OAAA,MAAA,QAAA,KAAA,QAAA,EAAA;AACA,OAAA,CAAA,KAAA,WAAA,CAAA,KAAA,IAAA,WAAA,CAAA;AACA,QAAA,IAAA,OAAA;;AAGA,QAAA,SAAA,aAAA,KAAA,KAAA,qCAAA;AACA,SAAA;;;;;;;;;;;;;CAcA,AAAA,YAAA;AACA,OAAA,MAAA,QAAA,KAAA,QAAA,EAAA;AACA,OAAA,CAAA,KAAA,WAAA,KAAA,IAAA,WAAA,IAAA,KAAA,IAAA,WAAA,CAAA;AACA,QAAA,IAAA,QAAA;;AAGA,QAAA,SAAA,aAAA,KAAA,KAAA,uCAAA;AACA,SAAA;;;;;;;;;;;;;;CAeA,AAAA,UAAA;AACA,OAAA,MAAA,QAAA,KAAA,QAAA,EAAA;AACA,OAAA,CAAA,KAAA,WAAA,KAAA,IAAA,WAAA,CAAA;AACA,QAAA,IAAA,MAAA;;AAGA,QAAA,SAAA,aAAA,KAAA,KAAA,qCAAA;AACA,SAAA;;CAGA,AAAA,IAAA,KAAA,OAAA;EACA,MAAA,EAAA,SAAA,UAAA,SAAA,GAAA,YAAA,MAAA;EACA,MAAA,EAAA,QAAA,oBAAA,KAAA,UAAA;AAGA,MAAA,KAAA,IAAA,IAAA,EAAA;AACA,SAAA,SAAA,aAAA,KAAA,KAAA,mEAAA;AACA,QAAA,IAAA,IAAA,EAAA,IAAA,MAAA;;EAGA,MAAA,WAAA,YAAA;AAEA,MAAA;AACA,SAAA,SACA,aAAA,KAAA,KAAA,+BAAA,IAAA,SAAA,QAAA,wBAAA,SAAA,oBACA;AAEA,SAAA,MAAA,IAAA,KACA,SACA;IACA,MAAA;IACA,UAAA;IACA,QAAA;IACA,SAAA,MAAA,SAAA,KAAA,MAAA,IAAA;IACA,QAAA,UAAA;AACA,WAAA,MAAA,mDAAA,MAAA;AACA,aAAA,iBAAA,MAAA;AACA,WAAA,OAAA,KAAA,MAAA,CAAA,OAAA,MAAA,IAAA;;IAEA,GAAA;IACA,EACA,YAAA;AAEA,QAAA,UAAA,OAAA,YAAA,YAAA,CAAA,QAAA,SAAA,IAAA,CACA,OAAA,OAAA,YAAA,KAAA,MAAA,IAAA,KAAA,MAAA,EAAA;KACA,UAAA;MAAA,MAAA;MAAA,OAAA,iBAAA,QAAA;MAAA;KACA,UAAA;KACA,CAAA;QAEA,OAAA,MAAA,IAAA,KAAA,MAAA,EAAA;KAGA;WACA,OAAA;AACA,SAAA,MAAA,oDAAA,MAAA;AACA,GAAA,MAAA,QAAA;;AAGA,SAAA,MAAA,IAAA,KAAA,MAAA;;;;;CAMA,AAAA,OAAA,KAAA;EACA,MAAA,OAAA,KAAA,IAAA,IAAA;AACA,MAAA,QAAA,CAAA,KAAA,IAAA,WAAA,CACA,MAAA,IAAA,MAAA;AAGA,SAAA,MAAA,OAAA,IAAA;;;;;CAMA,AAAA,QAAA;AACA,OAAA,SAAA;AACA,SAAA,MAAA,OAAA"}
1
+ {"version":3,"file":"CronTaskStore.mjs","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,MAAA;CACA,AAAA,cAAA;EACA,MAAA,UAAA,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,MAAA,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,MAAA,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,MAAA,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,MAAA,SAAA,aAAA,KAAA,KAAA,kEAAA;GACA,KAAA,IAAA,GAAA,CAAA,EAAA,IAAA,KAAA;EACA;EAEA,MAAA,WAAA,YAAA;EAEA,IAAA;GACA,MAAA,SACA,aAAA,KAAA,KAAA,+BAAA,IAAA,SAAA,QAAA,wBAAA,SAAA,mBACA;GAEA,MAAA,MAAA,IAAA,KACA,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,iBAAA,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,2 +1,2 @@
1
- import { n as CronTaskHandlerOptions, t as CronJobOptions } from "../../CronTaskTypes-D0hLmxra.mjs";
1
+ import { n as CronTaskHandlerOptions, t as CronJobOptions } from "../../CronTaskTypes-Dj8Ny7j5.mjs";
2
2
  export { CronJobOptions, CronTaskHandlerOptions };
@@ -1,5 +1,4 @@
1
1
  //#region src/lib/utils/normalizePattern.d.ts
2
- declare function normalizePattern(pattern: string): string;
2
+ export declare function normalizePattern(pattern: string): string;
3
3
  //#endregion
4
- export { normalizePattern };
5
4
  //# sourceMappingURL=normalizePattern.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalizePattern.d.mts","names":[],"sources":["../../../../src/lib/utils/normalizePattern.ts"],"mappings":";iBAuCA,gBAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"normalizePattern.d.mts","names":[],"sources":["../../../../src/lib/utils/normalizePattern.ts"],"mappings":";wBAuCA,iBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"normalizePattern.mjs","names":[],"sources":["../../../../src/lib/utils/normalizePattern.ts"],"sourcesContent":["/*\n * Credits to Sapphire for this\n * https://github.com/sapphiredev/utilities/blob/main/packages/cron/src/lib/constants.ts#L26-L57\n * https://github.com/sapphiredev/utilities/blob/main/packages/cron/src/lib/Cron.ts#L91\n */\n\nconst predefined = {\n\t'@annually': '0 0 1 1 *',\n\t'@yearly': '0 0 1 1 *',\n\t'@monthly': '0 0 1 * *',\n\t'@weekly': '0 0 * * 0',\n\t'@daily': '0 0 * * *',\n\t'@hourly': '0 * * * *'\n} as const;\n\nconst cronTokens: Record<string, number> = {\n\tjan: 1,\n\tfeb: 2,\n\tmar: 3,\n\tapr: 4,\n\tmay: 5,\n\tjun: 6,\n\tjul: 7,\n\taug: 8,\n\tsep: 9,\n\toct: 10,\n\tnov: 11,\n\tdec: 12,\n\tsun: 0,\n\tmon: 1,\n\ttue: 2,\n\twed: 3,\n\tthu: 4,\n\tfri: 5,\n\tsat: 6\n} as const;\n\nconst tokensRegex = new RegExp(Object.keys(cronTokens).join('|'), 'g');\n\nexport function normalizePattern(pattern: string): string {\n\tif (Reflect.has(predefined, pattern)) return Reflect.get(predefined, pattern);\n\treturn pattern.replaceAll(tokensRegex, (match) => String(Reflect.get(cronTokens, match)));\n}\n"],"mappings":";AAMA,MAAA,aAAA;CACA,aAAA;CACA,WAAA;CACA,YAAA;CACA,WAAA;CACA,UAAA;CACA,WAAA;CACA;AAEA,MAAA,aAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA;AAEA,MAAA,cAAA,IAAA,OAAA,OAAA,KAAA,WAAA,CAAA,KAAA,IAAA,EAAA,IAAA;AAEA,SAAA,iBAAA,SAAA;AACA,KAAA,QAAA,IAAA,YAAA,QAAA,CAAA,QAAA,QAAA,IAAA,YAAA,QAAA;AACA,QAAA,QAAA,WAAA,cAAA,UAAA,OAAA,QAAA,IAAA,YAAA,MAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"normalizePattern.mjs","names":[],"sources":["../../../../src/lib/utils/normalizePattern.ts"],"sourcesContent":["/*\n * Credits to Sapphire for this\n * https://github.com/sapphiredev/utilities/blob/main/packages/cron/src/lib/constants.ts#L26-L57\n * https://github.com/sapphiredev/utilities/blob/main/packages/cron/src/lib/Cron.ts#L91\n */\n\nconst predefined = {\n\t'@annually': '0 0 1 1 *',\n\t'@yearly': '0 0 1 1 *',\n\t'@monthly': '0 0 1 * *',\n\t'@weekly': '0 0 * * 0',\n\t'@daily': '0 0 * * *',\n\t'@hourly': '0 * * * *'\n} as const;\n\nconst cronTokens: Record<string, number> = {\n\tjan: 1,\n\tfeb: 2,\n\tmar: 3,\n\tapr: 4,\n\tmay: 5,\n\tjun: 6,\n\tjul: 7,\n\taug: 8,\n\tsep: 9,\n\toct: 10,\n\tnov: 11,\n\tdec: 12,\n\tsun: 0,\n\tmon: 1,\n\ttue: 2,\n\twed: 3,\n\tthu: 4,\n\tfri: 5,\n\tsat: 6\n} as const;\n\nconst tokensRegex = new RegExp(Object.keys(cronTokens).join('|'), 'g');\n\nexport function normalizePattern(pattern: string): string {\n\tif (Reflect.has(predefined, pattern)) return Reflect.get(predefined, pattern);\n\treturn pattern.replaceAll(tokensRegex, (match) => String(Reflect.get(cronTokens, match)));\n}\n"],"mappings":";AAMA,MAAA,aAAA;CACA,aAAA;CACA,WAAA;CACA,YAAA;CACA,WAAA;CACA,UAAA;CACA,WAAA;AACA;AAEA,MAAA,aAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;CACA,KAAA;AACA;AAEA,MAAA,cAAA,IAAA,OAAA,OAAA,KAAA,UAAA,CAAA,CAAA,KAAA,GAAA,GAAA,GAAA;AAEA,SAAA,iBAAA,SAAA;CACA,IAAA,QAAA,IAAA,YAAA,OAAA,GAAA,OAAA,QAAA,IAAA,YAAA,OAAA;CACA,OAAA,QAAA,WAAA,cAAA,UAAA,OAAA,QAAA,IAAA,YAAA,KAAA,CAAA,CAAA;AACA"}
@@ -1,13 +1,12 @@
1
+ import "./index.mjs";
1
2
  import { Plugin, SapphireClient, postInitialization, postLogin, preGenericsInitialization, preLogin } from "@sapphire/framework";
2
3
  import { ClientOptions } from "discord.js";
3
-
4
4
  //#region src/register.d.ts
5
- declare class CronTaskPlugin extends Plugin {
5
+ export declare class CronTaskPlugin extends Plugin {
6
6
  static [preGenericsInitialization](this: SapphireClient, options: ClientOptions): void;
7
7
  static [postInitialization](this: SapphireClient): void;
8
8
  static [preLogin](this: SapphireClient): Promise<void>;
9
9
  static [postLogin](this: SapphireClient): void;
10
10
  }
11
11
  //#endregion
12
- export { CronTaskPlugin };
13
12
  //# sourceMappingURL=register.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"register.d.mts","names":[],"sources":["../../src/register.ts"],"mappings":";;;;cAMA,cAAA,SAAA,MAAA;EAAA,QAAA,yBAAA,EAAA,IAAA,EAAA,cAAA,EAAA,OAAA,EAAA,aAAA;EAAA,QAAA,kBAAA,EAAA,IAAA,EAAA,cAAA;EAAA,QAAA,QAAA,EAAA,IAAA,EAAA,cAAA,GAAA,OAAA;EAAA,QAAA,SAAA,EAAA,IAAA,EAAA,cAAA;AAAA"}
1
+ {"version":3,"file":"register.d.mts","names":[],"sources":["../../src/register.ts"],"mappings":";;;;qBAMA,uBAAA;UAAA,2BAAA,MAAA,gBAAA,SAAA;UAAA,oBAAA,MAAA;UAAA,UAAA,MAAA,iBAAA;UAAA,WAAA,MAAA"}
@@ -1,4 +1,4 @@
1
- import { t as CronTaskHandler } from "./CronTaskHandler-BpMfN0Gk.mjs";
1
+ import { t as CronTaskHandler } from "./CronTaskHandler-DiH4wqma.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";
@@ -1 +1 @@
1
- {"version":3,"file":"register.mjs","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,OAAA;CACA,QAAA,2BAAA,SAAA;AACA,YAAA,YAAA,IAAA,gBAAA,QAAA,UAAA;;CAGA,QAAA,sBAAA;AACA,OAAA,OAAA,SAAA,IAAA,eAAA,CAAA;;CAGA,cAAA,YAAA;AACA,MAAA,UAAA,UAAA,cAAA;AACA,YAAA,UAAA,SAAA,MAAA,OAAA,gBAAA,YAAA,OAAA;;CAGA,QAAA,aAAA;AACA,OAAA,OAAA,IAAA,aAAA,CAAA,WAAA;;;AAIA,eAAA,QAAA,sCAAA,eAAA,4BAAA,sCAAA;AAEA,eAAA,QAAA,+BAAA,eAAA,qBAAA,+BAAA;AAEA,eAAA,QAAA,qBAAA,eAAA,WAAA,qBAAA;AAEA,eAAA,QAAA,sBAAA,eAAA,YAAA,sBAAA"}
1
+ {"version":3,"file":"register.mjs","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,OAAA;CACA,QAAA,2BAAA,SAAA;EACA,UAAA,YAAA,IAAA,gBAAA,QAAA,SAAA;CACA;CAEA,QAAA,sBAAA;EACA,KAAA,OAAA,SAAA,IAAA,cAAA,CAAA;CACA;CAEA,cAAA,YAAA;EACA,IAAA,UAAA,UAAA,eAAA;EACA,UAAA,UAAA,SAAA,MAAA,OAAA,eAAA,CAAA,YAAA,MAAA;CACA;CAEA,QAAA,aAAA;EACA,KAAA,OAAA,IAAA,YAAA,CAAA,CAAA,UAAA;CACA;AACA;AAEA,eAAA,QAAA,sCAAA,eAAA,4BAAA,qCAAA;AAEA,eAAA,QAAA,+BAAA,eAAA,qBAAA,8BAAA;AAEA,eAAA,QAAA,qBAAA,eAAA,WAAA,oBAAA;AAEA,eAAA,QAAA,sBAAA,eAAA,YAAA,qBAAA"}
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.1-pr-276.75fe492",
4
+ "version": "4.0.1",
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.51.0",
49
- "@types/node": "24.12.2",
50
- "tsdown": "0.21.10",
48
+ "@sentry/node": "10.73.0",
49
+ "@types/node": "24.13.3",
50
+ "tsdown": "0.23.0",
51
51
  "typescript": "6.0.3"
52
52
  },
53
53
  "homepage": "https://github.com/Kings-World/sapphire-plugins",
@@ -1 +0,0 @@
1
- {"version":3,"file":"CronTask-CPIU4D6h.d.cts","names":[],"sources":["../../src/lib/structures/CronTask.ts"],"mappings":";;;;;;;;;AA0BA;;;;;;;;;;;;;;;;;;;uBAAsB,QAAA,iBAAyB,QAAA,CAAS,OAAA,GAAU,QAAA,CAAS,OAAA,UAAiB,KAAA,CAAM,OAAA;EAClF,GAAA,EAAK,IAAA;cAED,OAAA,EAAS,QAAA,CAAS,aAAA,EAAe,OAAA,EAAS,OAAA;EAAA,SAI7C,GAAA,CAAA,GAAO,SAAA;EAEhB,OAAA,CAAA,CAAS,GAAA,EAAK,IAAA,GAAO,SAAA;EAErB,KAAA,CAAA,CAAO,KAAA,WAAgB,GAAA,EAAK,IAAA,GAAO,SAAA;EAVtB;;;;;;;EAmBb,IAAA,CAAK,OAAA,aAAoB,KAAA;EAbT;;;;;;;EAwBhB,KAAA,CAAM,OAAA,aAAoB,KAAA;EApBH;;;;;;;EA+BvB,IAAA,CAAK,OAAA,aAAoB,KAAA;EAAzB;;;;;;;EAWA,KAAA,CAAM,OAAA,aAAoB,KAAA;EAWA;;;AAKlC;;;;EALQ,KAAA,CAAM,OAAA,aAAoB,KAAA;AAAA;AAAA,kBAKjB,QAAA;EAAA,KACJ,OAAA,GAAU,KAAA,CAAM,OAAA,GAAU,cAAA;EAGS;EAAA,KADnC,OAAA,GAAU,aAAA;EAAA,KACV,aAAA,GAAgB,KAAA,CAAM,aAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"CronTaskHandler-B1NV5U_-.d.cts","names":[],"sources":["../../src/lib/CronTaskHandler.ts"],"mappings":";;;;;cAGa,eAAA;;AAAb;;;;EAMQ,eAAA,GAAkB,sBAAA;EAiBY;;;;;;EAT9B,aAAA;EAOA;;;;;EAAA,MAAA,UAAgB,MAAA;cAEJ,OAAA,GAAU,OAAA,CAAQ,sBAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"CronTaskStore-BK7iLYXq.d.cts","names":[],"sources":["../../src/lib/structures/CronTaskStore.ts"],"mappings":";;;;;cAKa,aAAA,SAAsB,KAAA,CAAM,QAAA;;EAA5B;;;;;;;;;;;EAgBL,QAAA,CAAA;EAqBA;;;;;;;;;;;EAAA,SAAA,CAAA;;;;;;;;;;;;;EAsBA,OAAA,CAAA;EAUS,GAAA,CAAI,GAAA,UAAa,KAAA,EAAO,QAAA;;;;EAsDxB,MAAA,CAAO,GAAA;;;;EAYP,KAAA,CAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"CronTaskTypes-BCLp38D3.d.cts","names":[],"sources":["../../src/lib/types/CronTaskTypes.ts"],"mappings":";;;;UAEiB,sBAAA;;AAAjB;;;EAKC,eAAA;EAQa;AAGd;;;;;EAHC,aAAA;AAAA;AAAA,UAGgB,cAAA,SAAuB,IAAA,CAAK,WAAA;EAC5C,OAAA,WAAkB,IAAA;EAD0B;;;;;EAO5C,OAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"CronTask-CFQhlY0I.d.mts","names":[],"sources":["../../src/lib/structures/CronTask.ts"],"mappings":";;;;;;;;AA0BA;;;;;;;;;;;;;;;;;;;uBAAA,QAAA,iBAAA,QAAA,CAAA,OAAA,GAAA,QAAA,CAAA,OAAA,UAAA,KAAA,CAAA,OAAA;EAAA,GAAA,EAAA,IAAA;EAAA,WAAA,CAAA,OAAA,EAAA,QAAA,CAAA,aAAA,EAAA,OAAA,EAAA,OAAA;EAAA,SAAA,GAAA,CAAA,GAAA,SAAA;EAAA,OAAA,CAAA,CAAA,GAAA,EAAA,IAAA,GAAA,SAAA;EAAA,KAAA,CAAA,CAAA,KAAA,WAAA,GAAA,EAAA,IAAA,GAAA,SAAA;EAAA;;;;;;;EAAA,IAAA,CAAA,OAAA,aAAA,KAAA;EAAA;;;;;;;EAAA,KAAA,CAAA,OAAA,aAAA,KAAA;EAAA;;;;;;;EAAA,IAAA,CAAA,OAAA,aAAA,KAAA;EAAA;;;;;;;EAAA,KAAA,CAAA,OAAA,aAAA,KAAA;EAAA;;;AAqEA;;;;EArEA,KAAA,CAAA,OAAA,aAAA,KAAA;AAAA;AAAA,kBAqEA,QAAA;EAAA,KAAA,OAAA,GAAA,KAAA,CAAA,OAAA,GAAA,cAAA;EAAA;EAAA,KAAA,OAAA,GAAA,aAAA;EAAA,KAAA,aAAA,GAAA,KAAA,CAAA,aAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"CronTaskHandler-CrRFxQDW.d.mts","names":[],"sources":["../../src/lib/CronTaskHandler.ts"],"mappings":";;;;cAGA,eAAA;;AAAA;;;;EAAA,eAAA,GAAA,sBAAA;EAAA;;;;;;EAAA,aAAA;EAAA;;;;;EAAA,MAAA,UAAA,MAAA;EAAA,WAAA,CAAA,OAAA,GAAA,OAAA,CAAA,sBAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"CronTaskStore-BB2K0ZmF.d.mts","names":[],"sources":["../../src/lib/structures/CronTaskStore.ts"],"mappings":";;;;cAKA,aAAA,SAAA,KAAA,CAAA,QAAA;EAAA,WAAA,CAAA;EAAA;;;;;;;;;;;EAAA,QAAA,CAAA;EAAA;;;;;;;;;;;EAAA,SAAA,CAAA;;;;;;;;;;;;;EAAA,OAAA,CAAA;EAAA,GAAA,CAAA,GAAA,UAAA,KAAA,EAAA,QAAA;;;;EAAA,MAAA,CAAA,GAAA;;;;EAAA,KAAA,CAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"CronTaskTypes-D0hLmxra.d.mts","names":[],"sources":["../../src/lib/types/CronTaskTypes.ts"],"mappings":";;;UAEA,sBAAA;;AAAA;;;EAAA,eAAA;EAAA;AAgBA;;;;;EAhBA,aAAA;AAAA;AAAA,UAgBA,cAAA,SAAA,IAAA,CAAA,WAAA;EAAA,OAAA,WAAA,IAAA;EAAA;;;;;EAAA,OAAA;AAAA"}