@kingsworld/plugin-cron 2.1.1-next.e2e763c → 2.1.1-next.e44b9ef

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,14 +16,14 @@ This plugin adds support for cron tasks to the Sapphire framework. It uses the [
16
16
 
17
17
  ## Features
18
18
 
19
- - Full TypeScript support
20
- - Includes ESM entrypoint
19
+ - Full TypeScript support
20
+ - Includes ESM entrypoint
21
21
 
22
22
  ## Installation
23
23
 
24
24
  `@kingsworld/plugin-cron` depends on the following packages. Be sure to install these along with this package!
25
25
 
26
- - [`@sapphire/framework`](https://www.npmjs.com/package/@sapphire/framework)
26
+ - [`@sapphire/framework`](https://www.npmjs.com/package/@sapphire/framework)
27
27
 
28
28
  You can use the following command to install this package along with `cron`, or replace `npm install` with your package manager of choice.
29
29
 
@@ -61,7 +61,7 @@ const options = {
61
61
  };
62
62
  ```
63
63
 
64
- - The `disableSentry` option is used to disable Sentry's cron monitoring. By default, it is set to `false`, which means Sentry cron monitoring is enabled if the `@sentry/node` package is installed and configured. This makes using Sentry an opt-in feature - you first opt in by installing `@sentry/node`. The `disableSentry` option then allows you to opt out in specific situations. You can set this to `true` to disable cron monitoring, which can be useful during development or if you haven't provided a Sentry DSN. If you don't use Sentry at all (i.e., `@sentry/node` is not installed), this option has no effect and can be safely ignored.
64
+ - The `disableSentry` option is used to disable Sentry's cron monitoring. By default, it is set to `false`, which means Sentry cron monitoring is enabled if the `@sentry/node` package is installed and configured. This makes using Sentry an opt-in feature - you first opt in by installing `@sentry/node`. The `disableSentry` option then allows you to opt out in specific situations. You can set this to `true` to disable cron monitoring, which can be useful during development or if you haven't provided a Sentry DSN. If you don't use Sentry at all (i.e., `@sentry/node` is not installed), this option has no effect and can be safely ignored.
65
65
 
66
66
  In order to use the cron tasks anywhere other than a piece (commands, arguments, preconditions, etc.), you must first import the `container` property of `@sapphire/framework`. For pieces, you can simply use `this.container.cron` to access this plugin's methods.
67
67
 
@@ -6,7 +6,7 @@ var CronTaskStore_cjs = require('./lib/structures/CronTaskStore.cjs');
6
6
  var CronTaskTypes_cjs = require('./lib/types/CronTaskTypes.cjs');
7
7
 
8
8
  // src/index.ts
9
- var version = "2.1.1-next.e2e763c";
9
+ var version = "2.1.1-next.e44b9ef";
10
10
 
11
11
  exports.version = version;
12
12
  Object.keys(CronTaskHandler_cjs).forEach(function (k) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;AA+BO,IAAM,OAAkB,GAAA","file":"index.cjs","sourcesContent":["import type { CronTaskStore } from './lib/structures/CronTaskStore';\nimport type { CronTaskHandler } from './lib/CronTaskHandler';\nimport type { CronTaskHandlerOptions } from './lib/types/CronTaskTypes';\n\nexport * from './lib/CronTaskHandler';\nexport * from './lib/structures/CronTask';\nexport * from './lib/structures/CronTaskStore';\nexport * from './lib/types/CronTaskTypes';\n\ndeclare module '@sapphire/pieces' {\n\tinterface Container {\n\t\tcron: CronTaskHandler;\n\t}\n\n\tinterface StoreRegistryEntries {\n\t\t'cron-tasks': CronTaskStore;\n\t}\n}\n\ndeclare module 'discord.js' {\n\texport interface ClientOptions {\n\t\tcron?: Partial<CronTaskHandlerOptions>;\n\t}\n}\n\n/**\n * The [@kingsworld/plugin-cron](https://github.com/Kings-World/sapphire-plugins/tree/main/packages/cron) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\nexport const version: string = '2.1.1-next.e2e763c';\n"]}
1
+ {"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;AA+BO,IAAM,OAAkB,GAAA","file":"index.cjs","sourcesContent":["import type { CronTaskStore } from './lib/structures/CronTaskStore';\nimport type { CronTaskHandler } from './lib/CronTaskHandler';\nimport type { CronTaskHandlerOptions } from './lib/types/CronTaskTypes';\n\nexport * from './lib/CronTaskHandler';\nexport * from './lib/structures/CronTask';\nexport * from './lib/structures/CronTaskStore';\nexport * from './lib/types/CronTaskTypes';\n\ndeclare module '@sapphire/pieces' {\n\tinterface Container {\n\t\tcron: CronTaskHandler;\n\t}\n\n\tinterface StoreRegistryEntries {\n\t\t'cron-tasks': CronTaskStore;\n\t}\n}\n\ndeclare module 'discord.js' {\n\texport interface ClientOptions {\n\t\tcron?: Partial<CronTaskHandlerOptions>;\n\t}\n}\n\n/**\n * The [@kingsworld/plugin-cron](https://github.com/Kings-World/sapphire-plugins/tree/main/packages/cron) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\nexport const version: string = '2.1.1-next.e44b9ef';\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/structures/CronTask.ts"],"names":["Piece"],"mappings":";;;;;;AA0BO,IAAe,SAAA,GAAf,MAAe,SAAA,SAAsEA,YAA6B,CAAA;AAAA,EAGjH,WAAA,CAAY,SAAiC,OAAkB,EAAA;AACrE,IAAA,KAAA,CAAM,SAAS,OAAO,CAAA;AAAA;AACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWO,IAAA,CAAK,YAAoB,KAAkB,EAAA;AACjD,IAAK,IAAA,CAAA,SAAA,CAAU,MAAO,CAAA,IAAA,CAAK,CAAY,SAAA,EAAA,IAAA,CAAK,IAAI,CAAK,EAAA,EAAA,OAAO,CAAI,CAAA,EAAA,GAAG,KAAK,CAAA;AAAA;AACzE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,KAAA,CAAM,YAAoB,KAAkB,EAAA;AAClD,IAAK,IAAA,CAAA,SAAA,CAAU,MAAO,CAAA,KAAA,CAAM,CAAY,SAAA,EAAA,IAAA,CAAK,IAAI,CAAK,EAAA,EAAA,OAAO,CAAI,CAAA,EAAA,GAAG,KAAK,CAAA;AAAA;AAC1E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,IAAA,CAAK,YAAoB,KAAkB,EAAA;AACjD,IAAK,IAAA,CAAA,SAAA,CAAU,MAAO,CAAA,IAAA,CAAK,CAAY,SAAA,EAAA,IAAA,CAAK,IAAI,CAAK,EAAA,EAAA,OAAO,CAAI,CAAA,EAAA,GAAG,KAAK,CAAA;AAAA;AACzE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,KAAA,CAAM,YAAoB,KAAkB,EAAA;AAClD,IAAK,IAAA,CAAA,SAAA,CAAU,MAAO,CAAA,KAAA,CAAM,CAAY,SAAA,EAAA,IAAA,CAAK,IAAI,CAAK,EAAA,EAAA,OAAO,CAAI,CAAA,EAAA,GAAG,KAAK,CAAA;AAAA;AAC1E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,KAAA,CAAM,YAAoB,KAAkB,EAAA;AAClD,IAAK,IAAA,CAAA,SAAA,CAAU,MAAO,CAAA,KAAA,CAAM,CAAY,SAAA,EAAA,IAAA,CAAK,IAAI,CAAK,EAAA,EAAA,OAAO,CAAI,CAAA,EAAA,GAAG,KAAK,CAAA;AAAA;AAE3E,CAAA;AA/DyH,MAAA,CAAA,SAAA,EAAA,UAAA,CAAA;AAAlH,IAAe,QAAf,GAAA","file":"CronTask.cjs","sourcesContent":["import type { Awaitable } from '@sapphire/framework';\nimport { Piece } from '@sapphire/pieces';\nimport type { CronJob } from 'cron';\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\tcronTime: '* * * * *'\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\tpublic declare job: CronJob<null, CronTask>;\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\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"]}
1
+ {"version":3,"sources":["../../../../src/lib/structures/CronTask.ts"],"names":["Piece"],"mappings":";;;;;;AA0BO,IAAe,SAAA,GAAf,MAAe,SAAA,SAAsEA,YAA6B,CAAA;AAAA,EAGjH,WAAA,CAAY,SAAiC,OAAkB,EAAA;AACrE,IAAA,KAAA,CAAM,SAAS,OAAO,CAAA;AAAA;AACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWO,IAAA,CAAK,YAAoB,KAAkB,EAAA;AACjD,IAAK,IAAA,CAAA,SAAA,CAAU,MAAO,CAAA,IAAA,CAAK,CAAY,SAAA,EAAA,IAAA,CAAK,IAAI,CAAK,EAAA,EAAA,OAAO,CAAI,CAAA,EAAA,GAAG,KAAK,CAAA;AAAA;AACzE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,KAAA,CAAM,YAAoB,KAAkB,EAAA;AAClD,IAAK,IAAA,CAAA,SAAA,CAAU,MAAO,CAAA,KAAA,CAAM,CAAY,SAAA,EAAA,IAAA,CAAK,IAAI,CAAK,EAAA,EAAA,OAAO,CAAI,CAAA,EAAA,GAAG,KAAK,CAAA;AAAA;AAC1E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,IAAA,CAAK,YAAoB,KAAkB,EAAA;AACjD,IAAK,IAAA,CAAA,SAAA,CAAU,MAAO,CAAA,IAAA,CAAK,CAAY,SAAA,EAAA,IAAA,CAAK,IAAI,CAAK,EAAA,EAAA,OAAO,CAAI,CAAA,EAAA,GAAG,KAAK,CAAA;AAAA;AACzE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,KAAA,CAAM,YAAoB,KAAkB,EAAA;AAClD,IAAK,IAAA,CAAA,SAAA,CAAU,MAAO,CAAA,KAAA,CAAM,CAAY,SAAA,EAAA,IAAA,CAAK,IAAI,CAAK,EAAA,EAAA,OAAO,CAAI,CAAA,EAAA,GAAG,KAAK,CAAA;AAAA;AAC1E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,KAAA,CAAM,YAAoB,KAAkB,EAAA;AAClD,IAAK,IAAA,CAAA,SAAA,CAAU,MAAO,CAAA,KAAA,CAAM,CAAY,SAAA,EAAA,IAAA,CAAK,IAAI,CAAK,EAAA,EAAA,OAAO,CAAI,CAAA,EAAA,GAAG,KAAK,CAAA;AAAA;AAE3E,CAAA;AA/DyH,MAAA,CAAA,SAAA,EAAA,UAAA,CAAA;AAAlH,IAAe,QAAf,GAAA","file":"CronTask.cjs","sourcesContent":["import type { Awaitable } from '@sapphire/framework';\nimport { Piece } from '@sapphire/pieces';\nimport type { CronJob } from 'cron';\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\tcronTime: '* * * * *'\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: CronJob<null, CronTask>;\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\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"]}
@@ -4,7 +4,7 @@ export * from './lib/structures/CronTask.mjs';
4
4
  export * from './lib/structures/CronTaskStore.mjs';
5
5
  export * from './lib/types/CronTaskTypes.mjs';
6
6
 
7
- var version = "2.1.1-next.e2e763c";
7
+ var version = "2.1.1-next.e44b9ef";
8
8
 
9
9
  export { version };
10
10
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AA+BO,IAAM,OAAkB,GAAA","file":"index.mjs","sourcesContent":["import type { CronTaskStore } from './lib/structures/CronTaskStore';\nimport type { CronTaskHandler } from './lib/CronTaskHandler';\nimport type { CronTaskHandlerOptions } from './lib/types/CronTaskTypes';\n\nexport * from './lib/CronTaskHandler';\nexport * from './lib/structures/CronTask';\nexport * from './lib/structures/CronTaskStore';\nexport * from './lib/types/CronTaskTypes';\n\ndeclare module '@sapphire/pieces' {\n\tinterface Container {\n\t\tcron: CronTaskHandler;\n\t}\n\n\tinterface StoreRegistryEntries {\n\t\t'cron-tasks': CronTaskStore;\n\t}\n}\n\ndeclare module 'discord.js' {\n\texport interface ClientOptions {\n\t\tcron?: Partial<CronTaskHandlerOptions>;\n\t}\n}\n\n/**\n * The [@kingsworld/plugin-cron](https://github.com/Kings-World/sapphire-plugins/tree/main/packages/cron) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\nexport const version: string = '2.1.1-next.e2e763c';\n"]}
1
+ {"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AA+BO,IAAM,OAAkB,GAAA","file":"index.mjs","sourcesContent":["import type { CronTaskStore } from './lib/structures/CronTaskStore';\nimport type { CronTaskHandler } from './lib/CronTaskHandler';\nimport type { CronTaskHandlerOptions } from './lib/types/CronTaskTypes';\n\nexport * from './lib/CronTaskHandler';\nexport * from './lib/structures/CronTask';\nexport * from './lib/structures/CronTaskStore';\nexport * from './lib/types/CronTaskTypes';\n\ndeclare module '@sapphire/pieces' {\n\tinterface Container {\n\t\tcron: CronTaskHandler;\n\t}\n\n\tinterface StoreRegistryEntries {\n\t\t'cron-tasks': CronTaskStore;\n\t}\n}\n\ndeclare module 'discord.js' {\n\texport interface ClientOptions {\n\t\tcron?: Partial<CronTaskHandlerOptions>;\n\t}\n}\n\n/**\n * The [@kingsworld/plugin-cron](https://github.com/Kings-World/sapphire-plugins/tree/main/packages/cron) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\nexport const version: string = '2.1.1-next.e44b9ef';\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/structures/CronTask.ts"],"names":[],"mappings":";;;AA0BO,IAAe,SAAA,GAAf,MAAe,SAAA,SAAsE,KAA6B,CAAA;AAAA,EAGjH,WAAA,CAAY,SAAiC,OAAkB,EAAA;AACrE,IAAA,KAAA,CAAM,SAAS,OAAO,CAAA;AAAA;AACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWO,IAAA,CAAK,YAAoB,KAAkB,EAAA;AACjD,IAAK,IAAA,CAAA,SAAA,CAAU,MAAO,CAAA,IAAA,CAAK,CAAY,SAAA,EAAA,IAAA,CAAK,IAAI,CAAK,EAAA,EAAA,OAAO,CAAI,CAAA,EAAA,GAAG,KAAK,CAAA;AAAA;AACzE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,KAAA,CAAM,YAAoB,KAAkB,EAAA;AAClD,IAAK,IAAA,CAAA,SAAA,CAAU,MAAO,CAAA,KAAA,CAAM,CAAY,SAAA,EAAA,IAAA,CAAK,IAAI,CAAK,EAAA,EAAA,OAAO,CAAI,CAAA,EAAA,GAAG,KAAK,CAAA;AAAA;AAC1E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,IAAA,CAAK,YAAoB,KAAkB,EAAA;AACjD,IAAK,IAAA,CAAA,SAAA,CAAU,MAAO,CAAA,IAAA,CAAK,CAAY,SAAA,EAAA,IAAA,CAAK,IAAI,CAAK,EAAA,EAAA,OAAO,CAAI,CAAA,EAAA,GAAG,KAAK,CAAA;AAAA;AACzE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,KAAA,CAAM,YAAoB,KAAkB,EAAA;AAClD,IAAK,IAAA,CAAA,SAAA,CAAU,MAAO,CAAA,KAAA,CAAM,CAAY,SAAA,EAAA,IAAA,CAAK,IAAI,CAAK,EAAA,EAAA,OAAO,CAAI,CAAA,EAAA,GAAG,KAAK,CAAA;AAAA;AAC1E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,KAAA,CAAM,YAAoB,KAAkB,EAAA;AAClD,IAAK,IAAA,CAAA,SAAA,CAAU,MAAO,CAAA,KAAA,CAAM,CAAY,SAAA,EAAA,IAAA,CAAK,IAAI,CAAK,EAAA,EAAA,OAAO,CAAI,CAAA,EAAA,GAAG,KAAK,CAAA;AAAA;AAE3E,CAAA;AA/DyH,MAAA,CAAA,SAAA,EAAA,UAAA,CAAA;AAAlH,IAAe,QAAf,GAAA","file":"CronTask.mjs","sourcesContent":["import type { Awaitable } from '@sapphire/framework';\nimport { Piece } from '@sapphire/pieces';\nimport type { CronJob } from 'cron';\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\tcronTime: '* * * * *'\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\tpublic declare job: CronJob<null, CronTask>;\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\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"]}
1
+ {"version":3,"sources":["../../../../src/lib/structures/CronTask.ts"],"names":[],"mappings":";;;AA0BO,IAAe,SAAA,GAAf,MAAe,SAAA,SAAsE,KAA6B,CAAA;AAAA,EAGjH,WAAA,CAAY,SAAiC,OAAkB,EAAA;AACrE,IAAA,KAAA,CAAM,SAAS,OAAO,CAAA;AAAA;AACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWO,IAAA,CAAK,YAAoB,KAAkB,EAAA;AACjD,IAAK,IAAA,CAAA,SAAA,CAAU,MAAO,CAAA,IAAA,CAAK,CAAY,SAAA,EAAA,IAAA,CAAK,IAAI,CAAK,EAAA,EAAA,OAAO,CAAI,CAAA,EAAA,GAAG,KAAK,CAAA;AAAA;AACzE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,KAAA,CAAM,YAAoB,KAAkB,EAAA;AAClD,IAAK,IAAA,CAAA,SAAA,CAAU,MAAO,CAAA,KAAA,CAAM,CAAY,SAAA,EAAA,IAAA,CAAK,IAAI,CAAK,EAAA,EAAA,OAAO,CAAI,CAAA,EAAA,GAAG,KAAK,CAAA;AAAA;AAC1E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,IAAA,CAAK,YAAoB,KAAkB,EAAA;AACjD,IAAK,IAAA,CAAA,SAAA,CAAU,MAAO,CAAA,IAAA,CAAK,CAAY,SAAA,EAAA,IAAA,CAAK,IAAI,CAAK,EAAA,EAAA,OAAO,CAAI,CAAA,EAAA,GAAG,KAAK,CAAA;AAAA;AACzE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,KAAA,CAAM,YAAoB,KAAkB,EAAA;AAClD,IAAK,IAAA,CAAA,SAAA,CAAU,MAAO,CAAA,KAAA,CAAM,CAAY,SAAA,EAAA,IAAA,CAAK,IAAI,CAAK,EAAA,EAAA,OAAO,CAAI,CAAA,EAAA,GAAG,KAAK,CAAA;AAAA;AAC1E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,KAAA,CAAM,YAAoB,KAAkB,EAAA;AAClD,IAAK,IAAA,CAAA,SAAA,CAAU,MAAO,CAAA,KAAA,CAAM,CAAY,SAAA,EAAA,IAAA,CAAK,IAAI,CAAK,EAAA,EAAA,OAAO,CAAI,CAAA,EAAA,GAAG,KAAK,CAAA;AAAA;AAE3E,CAAA;AA/DyH,MAAA,CAAA,SAAA,EAAA,UAAA,CAAA;AAAlH,IAAe,QAAf,GAAA","file":"CronTask.mjs","sourcesContent":["import type { Awaitable } from '@sapphire/framework';\nimport { Piece } from '@sapphire/pieces';\nimport type { CronJob } from 'cron';\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\tcronTime: '* * * * *'\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: CronJob<null, CronTask>;\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\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"]}
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 cron package and allow users to make cron jobs within their Sapphire discord bot.",
4
- "version": "2.1.1-next.e2e763c",
4
+ "version": "2.1.1-next.e44b9ef",
5
5
  "author": "Seren_Modz 21 <seren@kings-world.net>",
6
6
  "license": "MIT",
7
7
  "main": "dist/cjs/index.cjs",
@@ -46,14 +46,14 @@
46
46
  "check-update": "cliff-jumper --dry-run"
47
47
  },
48
48
  "dependencies": {
49
- "cron": "^3.2.1"
49
+ "cron": "^3.3.1"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@favware/cliff-jumper": "^5.0.0",
53
53
  "@favware/rollup-type-bundler": "^3.3.0",
54
- "@sentry/node": "^8.40.0",
54
+ "@sentry/node": "^8.45.0",
55
55
  "@types/luxon": "^3.4.2",
56
- "@types/node": "^22.9.3",
56
+ "@types/node": "^22.10.2",
57
57
  "concurrently": "^9.1.0",
58
58
  "tsup": "^8.3.5",
59
59
  "tsx": "^4.19.2",