@sapphire/plugin-scheduled-tasks 9.0.0-next.d9aa006.0 → 9.0.0-next.dede596.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +6 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.ts +3 -1
- package/dist/cjs/register.cjs +4 -7
- package/dist/cjs/register.cjs.map +1 -1
- package/dist/cjs/register.d.ts +0 -1
- package/dist/esm/index.d.mts +3 -1
- package/dist/esm/index.mjs +2 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/register.d.mts +0 -1
- package/dist/esm/register.mjs +1 -4
- package/dist/esm/register.mjs.map +1 -1
- package/package.json +5 -6
package/dist/cjs/index.cjs
CHANGED
|
@@ -5,10 +5,15 @@ var ScheduledTask_cjs = require('./lib/structures/ScheduledTask.cjs');
|
|
|
5
5
|
var ScheduledTaskStore_cjs = require('./lib/structures/ScheduledTaskStore.cjs');
|
|
6
6
|
var ScheduledTaskEvents_cjs = require('./lib/types/ScheduledTaskEvents.cjs');
|
|
7
7
|
var ScheduledTaskTypes_cjs = require('./lib/types/ScheduledTaskTypes.cjs');
|
|
8
|
+
var _load_cjs = require('./listeners/_load.cjs');
|
|
8
9
|
|
|
9
10
|
// src/index.ts
|
|
10
|
-
var version = "9.0.0-next.
|
|
11
|
+
var version = "9.0.0-next.dede596.0";
|
|
11
12
|
|
|
13
|
+
Object.defineProperty(exports, 'loadListeners', {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return _load_cjs.loadListeners; }
|
|
16
|
+
});
|
|
12
17
|
exports.version = version;
|
|
13
18
|
Object.keys(ScheduledTaskHandler_cjs).forEach(function (k) {
|
|
14
19
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";AAIA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";AAIA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,SAAS,qBAAqB;AA8BvB,IAAM,UAAkB","sourcesContent":["import type { ScheduledTaskHandler } from './lib/ScheduledTaskHandler';\nimport type { ScheduledTaskStore } from './lib/structures/ScheduledTaskStore';\nimport type { ScheduledTaskHandlerOptions } from './lib/types/ScheduledTaskTypes';\n\nexport * from './lib/ScheduledTaskHandler';\nexport * from './lib/structures/ScheduledTask';\nexport * from './lib/structures/ScheduledTaskStore';\nexport * from './lib/types/ScheduledTaskEvents';\nexport * from './lib/types/ScheduledTaskTypes';\n\nexport { loadListeners } from './listeners/_load';\n\ndeclare module '@sapphire/pieces' {\n\tinterface Container {\n\t\ttasks: ScheduledTaskHandler;\n\t}\n\n\tinterface StoreRegistryEntries {\n\t\t'scheduled-tasks': ScheduledTaskStore;\n\t}\n}\n\ndeclare module 'discord.js' {\n\texport interface ClientOptions {\n\t\ttasks?: ScheduledTaskHandlerOptions;\n\t\t/**\n\t\t * If the the pre-included scheduled task error listeners should be loaded\n\t\t * @default false\n\t\t */\n\t\tloadScheduledTaskErrorListeners?: boolean;\n\t}\n}\n\n/**\n * The [@sapphire/plugin-scheduled-tasks](https://github.com/sapphiredev/plugins/blob/main/packages/scheduled-tasks) 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 */\n// eslint-disable-next-line @typescript-eslint/no-inferrable-types\nexport const version: string = '9.0.0-next.dede596.0';\n"]}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -202,6 +202,8 @@ declare module 'discord.js' {
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
declare function loadListeners(): void;
|
|
206
|
+
|
|
205
207
|
declare module '@sapphire/pieces' {
|
|
206
208
|
interface Container {
|
|
207
209
|
tasks: ScheduledTaskHandler;
|
|
@@ -228,4 +230,4 @@ declare module 'discord.js' {
|
|
|
228
230
|
*/
|
|
229
231
|
declare const version: string;
|
|
230
232
|
|
|
231
|
-
export { type BullClient, ScheduledTask, type ScheduledTaskCreateRepeatedTask, type ScheduledTaskCustomJobOptions, ScheduledTaskEvents, ScheduledTaskHandler, type ScheduledTaskHandlerOptions, type ScheduledTaskJob, type ScheduledTaskListOptions, type ScheduledTaskListRepeatedOptions, type ScheduledTaskListRepeatedReturnType, type ScheduledTaskOptions, ScheduledTaskStore, type ScheduledTasks, type ScheduledTasksTaskOptions, version };
|
|
233
|
+
export { type BullClient, ScheduledTask, type ScheduledTaskCreateRepeatedTask, type ScheduledTaskCustomJobOptions, ScheduledTaskEvents, ScheduledTaskHandler, type ScheduledTaskHandlerOptions, type ScheduledTaskJob, type ScheduledTaskListOptions, type ScheduledTaskListRepeatedOptions, type ScheduledTaskListRepeatedReturnType, type ScheduledTaskOptions, ScheduledTaskStore, type ScheduledTasks, type ScheduledTasksTaskOptions, loadListeners, version };
|
package/dist/cjs/register.cjs
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
require('./index.cjs');
|
|
4
3
|
var framework = require('@sapphire/framework');
|
|
5
|
-
var
|
|
6
|
-
var ScheduledTaskStore_cjs = require('./lib/structures/ScheduledTaskStore.cjs');
|
|
7
|
-
var _load_cjs = require('./listeners/_load.cjs');
|
|
4
|
+
var index_cjs = require('./index.cjs');
|
|
8
5
|
|
|
9
6
|
var __defProp = Object.defineProperty;
|
|
10
7
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -22,15 +19,15 @@ var _ScheduledTasksPlugin = class _ScheduledTasksPlugin extends framework.Plugin
|
|
|
22
19
|
* @since 1.0.0
|
|
23
20
|
*/
|
|
24
21
|
static [framework.preGenericsInitialization](options) {
|
|
25
|
-
framework.container.tasks = new
|
|
22
|
+
framework.container.tasks = new index_cjs.ScheduledTaskHandler(options.tasks);
|
|
26
23
|
}
|
|
27
24
|
/**
|
|
28
25
|
* @since 1.0.0
|
|
29
26
|
*/
|
|
30
27
|
static [framework.postInitialization](options) {
|
|
31
|
-
this.stores.register(new
|
|
28
|
+
this.stores.register(new index_cjs.ScheduledTaskStore());
|
|
32
29
|
if (options.loadScheduledTaskErrorListeners === true) {
|
|
33
|
-
|
|
30
|
+
index_cjs.loadListeners();
|
|
34
31
|
}
|
|
35
32
|
}
|
|
36
33
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/register.ts"],"names":[],"mappings":";;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/register.ts"],"names":[],"mappings":";;;;;;;;;AAAA,SAAS,WAAW,QAAQ,oBAAoB,WAAW,2BAA2B,sBAAsB;AAE5G,SAAS,eAAe,sBAAsB,0BAA0B;AAMjE,IAAM,wBAAN,MAAM,8BAA6B,OAAO;AAAA,EAA1C;AAAA;AACN,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAIP,QAAe,yBAAyB,EAAwB,SAA8B;AAC7F,cAAU,QAAQ,IAAI,qBAAqB,QAAQ,KAAK;AAAA,EACzD;AAAA;AAAA;AAAA;AAAA,EAKA,QAAe,kBAAkB,EAAwB,SAA8B;AACtF,SAAK,OAAO,SAAS,IAAI,mBAAmB,CAAC;AAE7C,QAAI,QAAQ,oCAAoC,MAAM;AACrD,oBAAc;AAAA,IACf;AAAA,EACD;AAAA;AAAA;AAAA;AAAA,EAKA,QAAe,SAAS,IAA8B;AACrD,SAAK,UAAU,MAAM,eAAe;AAAA,EACrC;AACD;AA1BiD;AAA1C,IAAM,uBAAN;AA4BP,eAAe,QAAQ;AAAA,EACtB,qBAAqB,yBAAyB;AAAA,EAC9C;AACD;AAEA,eAAe,QAAQ,+BAA+B,qBAAqB,kBAAkB,GAAG,mCAAmC;AAEnI,eAAe,QAAQ,sBAAsB,qBAAqB,SAAS,GAAG,0BAA0B","sourcesContent":["import { container, Plugin, postInitialization, postLogin, preGenericsInitialization, SapphireClient } from '@sapphire/framework';\nimport type { ClientOptions } from 'discord.js';\nimport { loadListeners, ScheduledTaskHandler, ScheduledTaskStore } from './index';\n\n/**\n * A plugin for scheduling tasks in a SapphireClient.\n * @since 1.0.0\n */\nexport class ScheduledTasksPlugin extends Plugin {\n\tpublic service: string | undefined;\n\t/**\n\t * @since 1.0.0\n\t */\n\tpublic static [preGenericsInitialization](this: SapphireClient, options: ClientOptions): void {\n\t\tcontainer.tasks = new ScheduledTaskHandler(options.tasks);\n\t}\n\n\t/**\n\t * @since 1.0.0\n\t */\n\tpublic static [postInitialization](this: SapphireClient, options: ClientOptions): void {\n\t\tthis.stores.register(new ScheduledTaskStore());\n\n\t\tif (options.loadScheduledTaskErrorListeners === true) {\n\t\t\tloadListeners();\n\t\t}\n\t}\n\n\t/**\n\t * @since 1.0.0\n\t */\n\tpublic static [postLogin](this: SapphireClient): void {\n\t\tvoid container.tasks.createRepeated();\n\t}\n}\n\nSapphireClient.plugins.registerPreGenericsInitializationHook(\n\tScheduledTasksPlugin[preGenericsInitialization],\n\t'Scheduled-Task-PreGenericsInitialization'\n);\n\nSapphireClient.plugins.registerPostInitializationHook(ScheduledTasksPlugin[postInitialization], 'Scheduled-Task-PostInitialization');\n\nSapphireClient.plugins.registerPostLoginHook(ScheduledTasksPlugin[postLogin], 'Scheduled-Task-PostLogin');\n"]}
|
package/dist/cjs/register.d.ts
CHANGED
package/dist/esm/index.d.mts
CHANGED
|
@@ -202,6 +202,8 @@ declare module 'discord.js' {
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
declare function loadListeners(): void;
|
|
206
|
+
|
|
205
207
|
declare module '@sapphire/pieces' {
|
|
206
208
|
interface Container {
|
|
207
209
|
tasks: ScheduledTaskHandler;
|
|
@@ -228,4 +230,4 @@ declare module 'discord.js' {
|
|
|
228
230
|
*/
|
|
229
231
|
declare const version: string;
|
|
230
232
|
|
|
231
|
-
export { type BullClient, ScheduledTask, type ScheduledTaskCreateRepeatedTask, type ScheduledTaskCustomJobOptions, ScheduledTaskEvents, ScheduledTaskHandler, type ScheduledTaskHandlerOptions, type ScheduledTaskJob, type ScheduledTaskListOptions, type ScheduledTaskListRepeatedOptions, type ScheduledTaskListRepeatedReturnType, type ScheduledTaskOptions, ScheduledTaskStore, type ScheduledTasks, type ScheduledTasksTaskOptions, version };
|
|
233
|
+
export { type BullClient, ScheduledTask, type ScheduledTaskCreateRepeatedTask, type ScheduledTaskCustomJobOptions, ScheduledTaskEvents, ScheduledTaskHandler, type ScheduledTaskHandlerOptions, type ScheduledTaskJob, type ScheduledTaskListOptions, type ScheduledTaskListRepeatedOptions, type ScheduledTaskListRepeatedReturnType, type ScheduledTaskOptions, ScheduledTaskStore, type ScheduledTasks, type ScheduledTasksTaskOptions, loadListeners, version };
|
package/dist/esm/index.mjs
CHANGED
|
@@ -4,8 +4,9 @@ export * from './lib/structures/ScheduledTask.mjs';
|
|
|
4
4
|
export * from './lib/structures/ScheduledTaskStore.mjs';
|
|
5
5
|
export * from './lib/types/ScheduledTaskEvents.mjs';
|
|
6
6
|
export * from './lib/types/ScheduledTaskTypes.mjs';
|
|
7
|
+
export { loadListeners } from './listeners/_load.mjs';
|
|
7
8
|
|
|
8
|
-
var version = "9.0.0-next.
|
|
9
|
+
var version = "9.0.0-next.dede596.0";
|
|
9
10
|
|
|
10
11
|
export { version };
|
|
11
12
|
//# sourceMappingURL=out.js.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;AAIA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;AAIA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,SAAS,qBAAqB;AA8BvB,IAAM,UAAkB","sourcesContent":["import type { ScheduledTaskHandler } from './lib/ScheduledTaskHandler';\nimport type { ScheduledTaskStore } from './lib/structures/ScheduledTaskStore';\nimport type { ScheduledTaskHandlerOptions } from './lib/types/ScheduledTaskTypes';\n\nexport * from './lib/ScheduledTaskHandler';\nexport * from './lib/structures/ScheduledTask';\nexport * from './lib/structures/ScheduledTaskStore';\nexport * from './lib/types/ScheduledTaskEvents';\nexport * from './lib/types/ScheduledTaskTypes';\n\nexport { loadListeners } from './listeners/_load';\n\ndeclare module '@sapphire/pieces' {\n\tinterface Container {\n\t\ttasks: ScheduledTaskHandler;\n\t}\n\n\tinterface StoreRegistryEntries {\n\t\t'scheduled-tasks': ScheduledTaskStore;\n\t}\n}\n\ndeclare module 'discord.js' {\n\texport interface ClientOptions {\n\t\ttasks?: ScheduledTaskHandlerOptions;\n\t\t/**\n\t\t * If the the pre-included scheduled task error listeners should be loaded\n\t\t * @default false\n\t\t */\n\t\tloadScheduledTaskErrorListeners?: boolean;\n\t}\n}\n\n/**\n * The [@sapphire/plugin-scheduled-tasks](https://github.com/sapphiredev/plugins/blob/main/packages/scheduled-tasks) 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 */\n// eslint-disable-next-line @typescript-eslint/no-inferrable-types\nexport const version: string = '9.0.0-next.dede596.0';\n"]}
|
package/dist/esm/register.d.mts
CHANGED
package/dist/esm/register.mjs
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { __name, __publicField } from './chunk-PYETHG4R.mjs';
|
|
2
|
-
import './index.mjs';
|
|
3
2
|
import { SapphireClient, preGenericsInitialization, postInitialization, postLogin, Plugin, container } from '@sapphire/framework';
|
|
4
|
-
import { ScheduledTaskHandler } from './
|
|
5
|
-
import { ScheduledTaskStore } from './lib/structures/ScheduledTaskStore.mjs';
|
|
6
|
-
import { loadListeners } from './listeners/_load.mjs';
|
|
3
|
+
import { ScheduledTaskHandler, ScheduledTaskStore, loadListeners } from './index.mjs';
|
|
7
4
|
|
|
8
5
|
var _ScheduledTasksPlugin = class _ScheduledTasksPlugin extends Plugin {
|
|
9
6
|
constructor() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/register.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/register.ts"],"names":[],"mappings":";;;;;;AAAA,SAAS,WAAW,QAAQ,oBAAoB,WAAW,2BAA2B,sBAAsB;AAE5G,SAAS,eAAe,sBAAsB,0BAA0B;AAMjE,IAAM,wBAAN,MAAM,8BAA6B,OAAO;AAAA,EAA1C;AAAA;AACN,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAIP,QAAe,yBAAyB,EAAwB,SAA8B;AAC7F,cAAU,QAAQ,IAAI,qBAAqB,QAAQ,KAAK;AAAA,EACzD;AAAA;AAAA;AAAA;AAAA,EAKA,QAAe,kBAAkB,EAAwB,SAA8B;AACtF,SAAK,OAAO,SAAS,IAAI,mBAAmB,CAAC;AAE7C,QAAI,QAAQ,oCAAoC,MAAM;AACrD,oBAAc;AAAA,IACf;AAAA,EACD;AAAA;AAAA;AAAA;AAAA,EAKA,QAAe,SAAS,IAA8B;AACrD,SAAK,UAAU,MAAM,eAAe;AAAA,EACrC;AACD;AA1BiD;AAA1C,IAAM,uBAAN;AA4BP,eAAe,QAAQ;AAAA,EACtB,qBAAqB,yBAAyB;AAAA,EAC9C;AACD;AAEA,eAAe,QAAQ,+BAA+B,qBAAqB,kBAAkB,GAAG,mCAAmC;AAEnI,eAAe,QAAQ,sBAAsB,qBAAqB,SAAS,GAAG,0BAA0B","sourcesContent":["import { container, Plugin, postInitialization, postLogin, preGenericsInitialization, SapphireClient } from '@sapphire/framework';\nimport type { ClientOptions } from 'discord.js';\nimport { loadListeners, ScheduledTaskHandler, ScheduledTaskStore } from './index';\n\n/**\n * A plugin for scheduling tasks in a SapphireClient.\n * @since 1.0.0\n */\nexport class ScheduledTasksPlugin extends Plugin {\n\tpublic service: string | undefined;\n\t/**\n\t * @since 1.0.0\n\t */\n\tpublic static [preGenericsInitialization](this: SapphireClient, options: ClientOptions): void {\n\t\tcontainer.tasks = new ScheduledTaskHandler(options.tasks);\n\t}\n\n\t/**\n\t * @since 1.0.0\n\t */\n\tpublic static [postInitialization](this: SapphireClient, options: ClientOptions): void {\n\t\tthis.stores.register(new ScheduledTaskStore());\n\n\t\tif (options.loadScheduledTaskErrorListeners === true) {\n\t\t\tloadListeners();\n\t\t}\n\t}\n\n\t/**\n\t * @since 1.0.0\n\t */\n\tpublic static [postLogin](this: SapphireClient): void {\n\t\tvoid container.tasks.createRepeated();\n\t}\n}\n\nSapphireClient.plugins.registerPreGenericsInitializationHook(\n\tScheduledTasksPlugin[preGenericsInitialization],\n\t'Scheduled-Task-PreGenericsInitialization'\n);\n\nSapphireClient.plugins.registerPostInitializationHook(ScheduledTasksPlugin[postInitialization], 'Scheduled-Task-PostInitialization');\n\nSapphireClient.plugins.registerPostLoginHook(ScheduledTasksPlugin[postLogin], 'Scheduled-Task-PostLogin');\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sapphire/plugin-scheduled-tasks",
|
|
3
|
-
"version": "9.0.0-next.
|
|
3
|
+
"version": "9.0.0-next.dede596.0",
|
|
4
4
|
"description": "Plugin for @sapphire/framework to have scheduled tasks",
|
|
5
5
|
"author": "@sapphire",
|
|
6
6
|
"license": "MIT",
|
|
@@ -48,14 +48,14 @@
|
|
|
48
48
|
"check-update": "cliff-jumper --dry-run"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@sapphire/stopwatch": "^1.5.
|
|
52
|
-
"@sapphire/utilities": "^3.
|
|
51
|
+
"@sapphire/stopwatch": "^1.5.1",
|
|
52
|
+
"@sapphire/utilities": "^3.14.0",
|
|
53
53
|
"bullmq": "3.15.8",
|
|
54
54
|
"tslib": "^2.6.2"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@favware/cliff-jumper": "^2.2.3",
|
|
58
|
-
"@favware/rollup-type-bundler": "^3.2.
|
|
58
|
+
"@favware/rollup-type-bundler": "^3.2.1",
|
|
59
59
|
"concurrently": "^8.2.2",
|
|
60
60
|
"tsup": "^8.0.1",
|
|
61
61
|
"tsx": "^4.6.2",
|
|
@@ -69,8 +69,7 @@
|
|
|
69
69
|
"directory": "packages/scheduled-tasks"
|
|
70
70
|
},
|
|
71
71
|
"files": [
|
|
72
|
-
"dist/"
|
|
73
|
-
"!dist/.tsbuildinfo"
|
|
72
|
+
"dist/"
|
|
74
73
|
],
|
|
75
74
|
"engines": {
|
|
76
75
|
"node": ">=v18",
|