@kingsworld/plugin-cron 2.0.0-next.e9b2a4a → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -0,0 +1,48 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ # [@kingsworld/plugin-cron@2.0.0](https://github.com/Kings-World/sapphire-plugins/tree/@kingsworld/plugin-cron@2.0.0) - (2024-09-12)
6
+
7
+ ## 🏠 Refactor
8
+
9
+ - Set option defaults and add more js docs ([179a2eb](https://github.com/Kings-World/sapphire-plugins/commit/179a2ebac74a3b2ded82500b8c8c6425f8af1e0f)) ([#35](https://github.com/Kings-World/sapphire-plugins/pull/35) by @SerenModz21)
10
+ - Improve the repo ([3546f66](https://github.com/Kings-World/sapphire-plugins/commit/3546f669d767764b622310dbf679ca8c86abfea6)) ([#26](https://github.com/Kings-World/sapphire-plugins/pull/26) by @Swiizyy)
11
+ - Switch to sapphire v5 changes ([3fcbf9e](https://github.com/Kings-World/sapphire-plugins/commit/3fcbf9ef0f541c4155875c38b406f5a1872f9de6))
12
+ - 💥 **Signed-off-by:** Seren_Modz 21 <seren@kings-world.net>
13
+ - Update to sapphire v5 ([61e68a9](https://github.com/Kings-World/sapphire-plugins/commit/61e68a983eeb2d3c5334217930114a9cf08dafe7))
14
+ - Switch to a monorepo ([7646fbb](https://github.com/Kings-World/sapphire-plugins/commit/7646fbb4ace71e7d3e939a29b89c72d213da36ce))
15
+ - 💥 **BREAKING CHANGE:** move to a monorepo
16
+
17
+ ## 🐛 Bug Fixes
18
+
19
+ - **cron:** Correct the cliff jumper org ([b7ee600](https://github.com/Kings-World/sapphire-plugins/commit/b7ee6007cca0d372edc27997268ec45db14304ac))
20
+ - Use luxon's system default instead of utc ([b56bf6b](https://github.com/Kings-World/sapphire-plugins/commit/b56bf6b9889ddf3c46f069fdf93043f074a16462)) ([#38](https://github.com/Kings-World/sapphire-plugins/pull/38) by @SerenModz21)
21
+ - Use the default export and actually register the hook ([5e271bf](https://github.com/Kings-World/sapphire-plugins/commit/5e271bfceb335be3e709831c9fad46c05f75b309))
22
+ - Ensure cts file extensions in dist/cjs ([907123a](https://github.com/Kings-World/sapphire-plugins/commit/907123a017210d3acca81f3373cbe5a3c102261f))
23
+ - Move readme ([e1c1f2d](https://github.com/Kings-World/sapphire-plugins/commit/e1c1f2d2b0a087489364db49b783de243af63244))
24
+
25
+ ## 📝 Documentation
26
+
27
+ - **cron:** Add public keyword for consistency ([7e098d9](https://github.com/Kings-World/sapphire-plugins/commit/7e098d99437ad4b671c4e559f3532ce33a51d5ee))
28
+ - **cron:** Fix plugin name ([bea107d](https://github.com/Kings-World/sapphire-plugins/commit/bea107d72fdb86f42845bfa51cd02e8c6c8690a3))
29
+ - **cron:** Improve readme ([ede60d2](https://github.com/Kings-World/sapphire-plugins/commit/ede60d209d13af296507407675543ad7c05c4410)) ([#27](https://github.com/Kings-World/sapphire-plugins/pull/27) by @Swiizyy)
30
+ - Improve the readme ([784b306](https://github.com/Kings-World/sapphire-plugins/commit/784b306295c815bfc824b0143dd8b3f98a705afc))
31
+ - Fix package misspelling in readme ([6106d42](https://github.com/Kings-World/sapphire-plugins/commit/6106d42f6c98f28e9abdec70628d128cbcffc5d1))
32
+ - Update context type in readme ([be0102e](https://github.com/Kings-World/sapphire-plugins/commit/be0102e816d7c711d0d531cd96eb0f9b64bab794))
33
+ - Fix the in spelling ([3f71cf9](https://github.com/Kings-World/sapphire-plugins/commit/3f71cf92f6c0b2c2d00fbe20ac35d362d9b84bb9))
34
+ - Fix plugin spelling ([6b395bd](https://github.com/Kings-World/sapphire-plugins/commit/6b395bd82affef3ae0be9aeb2653cc5b31ca339d))
35
+ - Fix incorrect word ([0149312](https://github.com/Kings-World/sapphire-plugins/commit/0149312285fd839ccbecd3f1f7ecfb39699ea97a))
36
+ - Finish contributing section and update repo name ([7b73668](https://github.com/Kings-World/sapphire-plugins/commit/7b7366865a376cf2e070359342505606e531b737))
37
+
38
+ ## 🚀 Features
39
+
40
+ - Allow disabling sentry instrumention and import automatically ([935821f](https://github.com/Kings-World/sapphire-plugins/commit/935821f4ed990ef97c3beb58901dbe96281da020))
41
+ - Add optional support for sentry's cron & add jsdoc ([555b5ae](https://github.com/Kings-World/sapphire-plugins/commit/555b5ae47535b06f5730dacdf041d38b01deda52))
42
+ - Update dependencies and release 1.1.0 ([b1aead8](https://github.com/Kings-World/sapphire-plugins/commit/b1aead83ba6ebd781c4bde554a8a3a459f6415c9))
43
+
44
+ ## 🪞 Styling
45
+
46
+ - Format readme ([7b1c49f](https://github.com/Kings-World/sapphire-plugins/commit/7b1c49fbfaa85f45264f3028da663fcfb87ef826))
47
+ - Format everything ([e7ba3e2](https://github.com/Kings-World/sapphire-plugins/commit/e7ba3e2810e80382c4bf4e95e8fdc3d3868aab95))
48
+
package/README.md CHANGED
@@ -54,7 +54,7 @@ const options = {
54
54
  disableSentry: false,
55
55
  /**
56
56
  * The timezone to use for the cron tasks
57
- * @default 'UTC'
57
+ * @default 'system'
58
58
  */
59
59
  defaultTimezone: 'Europe/London'
60
60
  }
@@ -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.0.0-next.e9b2a4a";
9
+ var version = "2.0.0";
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?: 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.0.0-next.e9b2a4a';\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?: 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.0.0';\n"]}
@@ -8,8 +8,7 @@ interface CronTaskHandlerOptions {
8
8
  * The default timezone to use for all cron tasks.
9
9
  * You can override this per task, using the timeZone option.
10
10
  * @see https://github.com/moment/luxon/blob/master/docs/zones.md#specifying-a-zone
11
- * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
12
- * @default 'UTC'
11
+ * @default 'system'
13
12
  */
14
13
  defaultTimezone: string;
15
14
  /**
@@ -122,8 +121,7 @@ declare class CronTaskHandler {
122
121
  * The default timezone to use for all cron tasks.
123
122
  * You can override this per task, using the timeZone option.
124
123
  * @see https://github.com/moment/luxon/blob/master/docs/zones.md#specifying-a-zone
125
- * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
126
- * @default 'UTC'
124
+ * @default 'system'
127
125
  */
128
126
  defaultTimezone: CronTaskHandlerOptions['defaultTimezone'];
129
127
  /**
@@ -12,8 +12,7 @@ var _CronTaskHandler = class _CronTaskHandler {
12
12
  * The default timezone to use for all cron tasks.
13
13
  * You can override this per task, using the timeZone option.
14
14
  * @see https://github.com/moment/luxon/blob/master/docs/zones.md#specifying-a-zone
15
- * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
16
- * @default 'UTC'
15
+ * @default 'system'
17
16
  */
18
17
  __publicField(this, "defaultTimezone");
19
18
  /**
@@ -29,7 +28,7 @@ var _CronTaskHandler = class _CronTaskHandler {
29
28
  * is installed and the {@linkcode disableSentry} option is set to false.
30
29
  */
31
30
  __publicField(this, "sentry");
32
- this.defaultTimezone = options?.defaultTimezone ?? "UTC";
31
+ this.defaultTimezone = options?.defaultTimezone ?? "system";
33
32
  this.disableSentry = options?.disableSentry ?? false;
34
33
  }
35
34
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/CronTaskHandler.ts"],"names":["container"],"mappings":";;;;;;;;AAIO,IAAM,gBAAA,GAAN,MAAM,gBAAgB,CAAA;AAAA,EAyBrB,YAAY,OAAkC,EAAA;AAjBrD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAO,aAAA,CAAA,IAAA,EAAA,iBAAA,CAAA,CAAA;AAQP;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAO,aAAA,CAAA,IAAA,EAAA,eAAA,CAAA,CAAA;AAOP;AAAA;AAAA;AAAA;AAAA;AAAA,IAAO,aAAA,CAAA,IAAA,EAAA,QAAA,CAAA,CAAA;AAGN,IAAK,IAAA,CAAA,eAAA,GAAkB,SAAS,eAAmB,IAAA,KAAA,CAAA;AACnD,IAAK,IAAA,CAAA,aAAA,GAAgB,SAAS,aAAiB,IAAA,KAAA,CAAA;AAAA,GAChD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMO,QAAW,GAAA;AACjB,IAAA,IAAA,CAAK,MAAM,QAAS,EAAA,CAAA;AAAA,GACrB;AAAA;AAAA;AAAA;AAAA,EAKO,OAAU,GAAA;AAChB,IAAA,IAAA,CAAK,MAAM,OAAQ,EAAA,CAAA;AAAA,GACpB;AAAA;AAAA;AAAA;AAAA,EAKA,IAAY,KAAQ,GAAA;AACnB,IAAO,OAAAA,mBAAA,CAAU,MAAO,CAAA,GAAA,CAAI,YAAY,CAAA,CAAA;AAAA,GACzC;AACD,CAAA,CAAA;AAnD6B,MAAA,CAAA,gBAAA,EAAA,iBAAA,CAAA,CAAA;AAAtB,IAAM,eAAN,GAAA","file":"CronTaskHandler.cjs","sourcesContent":["import { container } from '@sapphire/framework';\nimport type Sentry from '@sentry/node';\nimport type { CronTaskHandlerOptions } from './types/CronTaskTypes';\n\nexport class CronTaskHandler {\n\t/**\n\t * The default timezone to use for all cron tasks.\n\t * You can override this per task, using the timeZone option.\n\t * @see https://github.com/moment/luxon/blob/master/docs/zones.md#specifying-a-zone\n\t * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\n\t * @default 'UTC'\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?: CronTaskHandlerOptions) {\n\t\tthis.defaultTimezone = options?.defaultTimezone ?? 'UTC';\n\t\tthis.disableSentry = options?.disableSentry ?? false;\n\t}\n\n\t/**\n\t * Start all enabled cron jobs.\n\t * This gets called automatically when the Client is ready.\n\t */\n\tpublic startAll() {\n\t\tthis.store.startAll();\n\t}\n\n\t/**\n\t * Stop all running cron jobs.\n\t */\n\tpublic stopAll() {\n\t\tthis.store.stopAll();\n\t}\n\n\t/**\n\t * Get the cron task store.\n\t */\n\tprivate get store() {\n\t\treturn container.stores.get('cron-tasks');\n\t}\n}\n"]}
1
+ {"version":3,"sources":["../../../src/lib/CronTaskHandler.ts"],"names":["container"],"mappings":";;;;;;;;AAIO,IAAM,gBAAA,GAAN,MAAM,gBAAgB,CAAA;AAAA,EAwBrB,YAAY,OAAkC,EAAA;AAjBrD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAO,aAAA,CAAA,IAAA,EAAA,iBAAA,CAAA,CAAA;AAQP;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAO,aAAA,CAAA,IAAA,EAAA,eAAA,CAAA,CAAA;AAOP;AAAA;AAAA;AAAA;AAAA;AAAA,IAAO,aAAA,CAAA,IAAA,EAAA,QAAA,CAAA,CAAA;AAGN,IAAK,IAAA,CAAA,eAAA,GAAkB,SAAS,eAAmB,IAAA,QAAA,CAAA;AACnD,IAAK,IAAA,CAAA,aAAA,GAAgB,SAAS,aAAiB,IAAA,KAAA,CAAA;AAAA,GAChD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMO,QAAW,GAAA;AACjB,IAAA,IAAA,CAAK,MAAM,QAAS,EAAA,CAAA;AAAA,GACrB;AAAA;AAAA;AAAA;AAAA,EAKO,OAAU,GAAA;AAChB,IAAA,IAAA,CAAK,MAAM,OAAQ,EAAA,CAAA;AAAA,GACpB;AAAA;AAAA;AAAA;AAAA,EAKA,IAAY,KAAQ,GAAA;AACnB,IAAO,OAAAA,mBAAA,CAAU,MAAO,CAAA,GAAA,CAAI,YAAY,CAAA,CAAA;AAAA,GACzC;AACD,CAAA,CAAA;AAlD6B,MAAA,CAAA,gBAAA,EAAA,iBAAA,CAAA,CAAA;AAAtB,IAAM,eAAN,GAAA","file":"CronTaskHandler.cjs","sourcesContent":["import { container } from '@sapphire/framework';\nimport type Sentry from '@sentry/node';\nimport type { CronTaskHandlerOptions } from './types/CronTaskTypes';\n\nexport class CronTaskHandler {\n\t/**\n\t * The default timezone to use for all cron tasks.\n\t * You can override this per task, using the timeZone option.\n\t * @see https://github.com/moment/luxon/blob/master/docs/zones.md#specifying-a-zone\n\t * @default 'system'\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?: CronTaskHandlerOptions) {\n\t\tthis.defaultTimezone = options?.defaultTimezone ?? 'system';\n\t\tthis.disableSentry = options?.disableSentry ?? false;\n\t}\n\n\t/**\n\t * Start all enabled cron jobs.\n\t * This gets called automatically when the Client is ready.\n\t */\n\tpublic startAll() {\n\t\tthis.store.startAll();\n\t}\n\n\t/**\n\t * Stop all running cron jobs.\n\t */\n\tpublic stopAll() {\n\t\tthis.store.stopAll();\n\t}\n\n\t/**\n\t * Get the cron task store.\n\t */\n\tprivate get store() {\n\t\treturn container.stores.get('cron-tasks');\n\t}\n}\n"]}
@@ -8,8 +8,7 @@ interface CronTaskHandlerOptions {
8
8
  * The default timezone to use for all cron tasks.
9
9
  * You can override this per task, using the timeZone option.
10
10
  * @see https://github.com/moment/luxon/blob/master/docs/zones.md#specifying-a-zone
11
- * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
12
- * @default 'UTC'
11
+ * @default 'system'
13
12
  */
14
13
  defaultTimezone: string;
15
14
  /**
@@ -122,8 +121,7 @@ declare class CronTaskHandler {
122
121
  * The default timezone to use for all cron tasks.
123
122
  * You can override this per task, using the timeZone option.
124
123
  * @see https://github.com/moment/luxon/blob/master/docs/zones.md#specifying-a-zone
125
- * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
126
- * @default 'UTC'
124
+ * @default 'system'
127
125
  */
128
126
  defaultTimezone: CronTaskHandlerOptions['defaultTimezone'];
129
127
  /**
@@ -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.0.0-next.e9b2a4a";
7
+ var version = "2.0.0";
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?: 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.0.0-next.e9b2a4a';\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?: 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.0.0';\n"]}
@@ -7,8 +7,7 @@ var _CronTaskHandler = class _CronTaskHandler {
7
7
  * The default timezone to use for all cron tasks.
8
8
  * You can override this per task, using the timeZone option.
9
9
  * @see https://github.com/moment/luxon/blob/master/docs/zones.md#specifying-a-zone
10
- * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
11
- * @default 'UTC'
10
+ * @default 'system'
12
11
  */
13
12
  __publicField(this, "defaultTimezone");
14
13
  /**
@@ -24,7 +23,7 @@ var _CronTaskHandler = class _CronTaskHandler {
24
23
  * is installed and the {@linkcode disableSentry} option is set to false.
25
24
  */
26
25
  __publicField(this, "sentry");
27
- this.defaultTimezone = options?.defaultTimezone ?? "UTC";
26
+ this.defaultTimezone = options?.defaultTimezone ?? "system";
28
27
  this.disableSentry = options?.disableSentry ?? false;
29
28
  }
30
29
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/CronTaskHandler.ts"],"names":[],"mappings":";;;AAIO,IAAM,gBAAA,GAAN,MAAM,gBAAgB,CAAA;AAAA,EAyBrB,YAAY,OAAkC,EAAA;AAjBrD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAO,aAAA,CAAA,IAAA,EAAA,iBAAA,CAAA,CAAA;AAQP;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAO,aAAA,CAAA,IAAA,EAAA,eAAA,CAAA,CAAA;AAOP;AAAA;AAAA;AAAA;AAAA;AAAA,IAAO,aAAA,CAAA,IAAA,EAAA,QAAA,CAAA,CAAA;AAGN,IAAK,IAAA,CAAA,eAAA,GAAkB,SAAS,eAAmB,IAAA,KAAA,CAAA;AACnD,IAAK,IAAA,CAAA,aAAA,GAAgB,SAAS,aAAiB,IAAA,KAAA,CAAA;AAAA,GAChD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMO,QAAW,GAAA;AACjB,IAAA,IAAA,CAAK,MAAM,QAAS,EAAA,CAAA;AAAA,GACrB;AAAA;AAAA;AAAA;AAAA,EAKO,OAAU,GAAA;AAChB,IAAA,IAAA,CAAK,MAAM,OAAQ,EAAA,CAAA;AAAA,GACpB;AAAA;AAAA;AAAA;AAAA,EAKA,IAAY,KAAQ,GAAA;AACnB,IAAO,OAAA,SAAA,CAAU,MAAO,CAAA,GAAA,CAAI,YAAY,CAAA,CAAA;AAAA,GACzC;AACD,CAAA,CAAA;AAnD6B,MAAA,CAAA,gBAAA,EAAA,iBAAA,CAAA,CAAA;AAAtB,IAAM,eAAN,GAAA","file":"CronTaskHandler.mjs","sourcesContent":["import { container } from '@sapphire/framework';\nimport type Sentry from '@sentry/node';\nimport type { CronTaskHandlerOptions } from './types/CronTaskTypes';\n\nexport class CronTaskHandler {\n\t/**\n\t * The default timezone to use for all cron tasks.\n\t * You can override this per task, using the timeZone option.\n\t * @see https://github.com/moment/luxon/blob/master/docs/zones.md#specifying-a-zone\n\t * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\n\t * @default 'UTC'\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?: CronTaskHandlerOptions) {\n\t\tthis.defaultTimezone = options?.defaultTimezone ?? 'UTC';\n\t\tthis.disableSentry = options?.disableSentry ?? false;\n\t}\n\n\t/**\n\t * Start all enabled cron jobs.\n\t * This gets called automatically when the Client is ready.\n\t */\n\tpublic startAll() {\n\t\tthis.store.startAll();\n\t}\n\n\t/**\n\t * Stop all running cron jobs.\n\t */\n\tpublic stopAll() {\n\t\tthis.store.stopAll();\n\t}\n\n\t/**\n\t * Get the cron task store.\n\t */\n\tprivate get store() {\n\t\treturn container.stores.get('cron-tasks');\n\t}\n}\n"]}
1
+ {"version":3,"sources":["../../../src/lib/CronTaskHandler.ts"],"names":[],"mappings":";;;AAIO,IAAM,gBAAA,GAAN,MAAM,gBAAgB,CAAA;AAAA,EAwBrB,YAAY,OAAkC,EAAA;AAjBrD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAO,aAAA,CAAA,IAAA,EAAA,iBAAA,CAAA,CAAA;AAQP;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAO,aAAA,CAAA,IAAA,EAAA,eAAA,CAAA,CAAA;AAOP;AAAA;AAAA;AAAA;AAAA;AAAA,IAAO,aAAA,CAAA,IAAA,EAAA,QAAA,CAAA,CAAA;AAGN,IAAK,IAAA,CAAA,eAAA,GAAkB,SAAS,eAAmB,IAAA,QAAA,CAAA;AACnD,IAAK,IAAA,CAAA,aAAA,GAAgB,SAAS,aAAiB,IAAA,KAAA,CAAA;AAAA,GAChD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMO,QAAW,GAAA;AACjB,IAAA,IAAA,CAAK,MAAM,QAAS,EAAA,CAAA;AAAA,GACrB;AAAA;AAAA;AAAA;AAAA,EAKO,OAAU,GAAA;AAChB,IAAA,IAAA,CAAK,MAAM,OAAQ,EAAA,CAAA;AAAA,GACpB;AAAA;AAAA;AAAA;AAAA,EAKA,IAAY,KAAQ,GAAA;AACnB,IAAO,OAAA,SAAA,CAAU,MAAO,CAAA,GAAA,CAAI,YAAY,CAAA,CAAA;AAAA,GACzC;AACD,CAAA,CAAA;AAlD6B,MAAA,CAAA,gBAAA,EAAA,iBAAA,CAAA,CAAA;AAAtB,IAAM,eAAN,GAAA","file":"CronTaskHandler.mjs","sourcesContent":["import { container } from '@sapphire/framework';\nimport type Sentry from '@sentry/node';\nimport type { CronTaskHandlerOptions } from './types/CronTaskTypes';\n\nexport class CronTaskHandler {\n\t/**\n\t * The default timezone to use for all cron tasks.\n\t * You can override this per task, using the timeZone option.\n\t * @see https://github.com/moment/luxon/blob/master/docs/zones.md#specifying-a-zone\n\t * @default 'system'\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?: CronTaskHandlerOptions) {\n\t\tthis.defaultTimezone = options?.defaultTimezone ?? 'system';\n\t\tthis.disableSentry = options?.disableSentry ?? false;\n\t}\n\n\t/**\n\t * Start all enabled cron jobs.\n\t * This gets called automatically when the Client is ready.\n\t */\n\tpublic startAll() {\n\t\tthis.store.startAll();\n\t}\n\n\t/**\n\t * Stop all running cron jobs.\n\t */\n\tpublic stopAll() {\n\t\tthis.store.stopAll();\n\t}\n\n\t/**\n\t * Get the cron task store.\n\t */\n\tprivate get store() {\n\t\treturn container.stores.get('cron-tasks');\n\t}\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.0.0-next.e9b2a4a",
4
+ "version": "2.0.0",
5
5
  "author": "Seren_Modz 21 <seren@kings-world.net>",
6
6
  "license": "MIT",
7
7
  "main": "dist/cjs/index.cjs",