alemonjs 2.1.56 → 2.1.57
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/lib/app/api/schedule.d.ts +17 -0
- package/lib/app/api/schedule.js +12 -0
- package/lib/app/hook-use/me.d.ts +1 -0
- package/lib/app/hook-use/me.js +9 -0
- package/lib/app/index.d.ts +2 -0
- package/lib/app/index.js +2 -0
- package/lib/app/load_modules/loadChild.js +4 -0
- package/lib/app/schedule-store.d.ts +20 -0
- package/lib/app/schedule-store.js +230 -0
- package/lib/cbp/connects/client.js +1 -0
- package/lib/client.js +1 -0
- package/lib/index.js +2 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/schedule/index.d.ts +23 -0
- package/lib/types/schedule/index.js +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ScheduleCallback, CronExpression } from '../../types/schedule';
|
|
2
|
+
export declare const setInterval: (callback: ScheduleCallback, ms: number) => string;
|
|
3
|
+
export declare const setTimeout: (callback: ScheduleCallback, ms: number) => string;
|
|
4
|
+
export declare const setCron: (expression: CronExpression, callback: ScheduleCallback) => string;
|
|
5
|
+
export declare const clearInterval: (id: import("../..").ScheduleId) => boolean;
|
|
6
|
+
export declare const clearTimeout: (id: import("../..").ScheduleId) => boolean;
|
|
7
|
+
export declare const pauseSchedule: (id: import("../..").ScheduleId) => boolean;
|
|
8
|
+
export declare const resumeSchedule: (id: import("../..").ScheduleId) => boolean;
|
|
9
|
+
export declare const listSchedule: (appName?: string) => Array<{
|
|
10
|
+
id: import("../..").ScheduleId;
|
|
11
|
+
type: import("../..").ScheduleItem["type"];
|
|
12
|
+
status: import("../..").ScheduleStatus;
|
|
13
|
+
ms?: number;
|
|
14
|
+
cron?: string;
|
|
15
|
+
appName?: string;
|
|
16
|
+
createdAt: number;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { scheduleCancel, scheduleList, schedulePause, scheduleResume, scheduleCron, scheduleInterval, scheduleTimeout } from '../schedule-store.js';
|
|
2
|
+
|
|
3
|
+
const setInterval = (callback, ms) => scheduleInterval(callback, ms);
|
|
4
|
+
const setTimeout = (callback, ms) => scheduleTimeout(callback, ms);
|
|
5
|
+
const setCron = (expression, callback) => scheduleCron(expression, callback);
|
|
6
|
+
const clearInterval = scheduleCancel;
|
|
7
|
+
const clearTimeout = scheduleCancel;
|
|
8
|
+
const pauseSchedule = schedulePause;
|
|
9
|
+
const resumeSchedule = scheduleResume;
|
|
10
|
+
const listSchedule = scheduleList;
|
|
11
|
+
|
|
12
|
+
export { clearInterval, clearTimeout, listSchedule, pauseSchedule, resumeSchedule, setCron, setInterval, setTimeout };
|
package/lib/app/hook-use/me.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { GuildInfo, Result, User } from './common';
|
|
2
2
|
export declare const useMe: () => readonly [{
|
|
3
3
|
info: () => Promise<Result<User | null>>;
|
|
4
|
+
isMentionMe: () => Result<boolean>;
|
|
4
5
|
guilds: () => Promise<Result<GuildInfo[]>>;
|
|
5
6
|
threads: () => Promise<Result<User | null>>;
|
|
6
7
|
friends: () => Promise<Result<User | null>>;
|
package/lib/app/hook-use/me.js
CHANGED
|
@@ -28,6 +28,14 @@ const useMe = () => {
|
|
|
28
28
|
return createResult(ResultCode.Fail, 'Failed to get bot information', null);
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
+
const isMentionMe = () => {
|
|
32
|
+
try {
|
|
33
|
+
return createResult(ResultCode.Warn, 'No bot information found', false);
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return createResult(ResultCode.Fail, 'Failed to get bot information', false);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
31
39
|
const guilds = async () => {
|
|
32
40
|
try {
|
|
33
41
|
const results = await sendAction({
|
|
@@ -80,6 +88,7 @@ const useMe = () => {
|
|
|
80
88
|
};
|
|
81
89
|
const control = {
|
|
82
90
|
info,
|
|
91
|
+
isMentionMe,
|
|
83
92
|
guilds,
|
|
84
93
|
threads,
|
|
85
94
|
friends
|
package/lib/app/index.d.ts
CHANGED
|
@@ -16,7 +16,9 @@ export * from './event-processor-event.js';
|
|
|
16
16
|
export * from './event-processor-middleware.js';
|
|
17
17
|
export * from './event-processor-subscribe.js';
|
|
18
18
|
export * from './hook-use/index.js';
|
|
19
|
+
export * from './api/schedule.js';
|
|
19
20
|
export * from './hook-event-context.js';
|
|
21
|
+
export * from './schedule-store.js';
|
|
20
22
|
export * from './event-utils.js';
|
|
21
23
|
export * from './message-api.js';
|
|
22
24
|
export * from './message-format.js';
|
package/lib/app/index.js
CHANGED
|
@@ -33,7 +33,9 @@ export { useRole } from './hook-use/role.js';
|
|
|
33
33
|
export { useUser } from './hook-use/user.js';
|
|
34
34
|
export { useObserver, useSubscribe } from './hook-use/subscribe.js';
|
|
35
35
|
export { createEvent, useEvent } from './hook-use/event.js';
|
|
36
|
+
export { clearInterval, clearTimeout, listSchedule, pauseSchedule, resumeSchedule, setCron, setInterval, setTimeout } from './api/schedule.js';
|
|
36
37
|
export { getCurrentEvent, getCurrentNext, withEventContext } from './hook-event-context.js';
|
|
38
|
+
export { registerAppDir, scheduleCancel, scheduleCancelAll, scheduleCancelByApp, scheduleCron, scheduleInterval, scheduleList, schedulePause, scheduleResume, scheduleTimeout, unregisterAppDir } from './schedule-store.js';
|
|
37
39
|
export { createEventValue, createSelects, onSelects, onState, unChildren, unState, useState } from './event-utils.js';
|
|
38
40
|
export { MessageDirect, createDataFormat, format, getMessageIntent, sendToChannel, sendToUser } from './message-api.js';
|
|
39
41
|
export { Format, FormatButtonGroup, FormatMarkDown } from './message-format.js';
|
|
@@ -4,6 +4,7 @@ import { showErrorModule, getRecursiveDirFiles, createEventName } from '../../co
|
|
|
4
4
|
import { ChildrenApp } from '../store.js';
|
|
5
5
|
import { registerExpose } from '../expose.js';
|
|
6
6
|
import { ResultCode, fileSuffixMiddleware } from '../../core/variable.js';
|
|
7
|
+
import { registerAppDir, scheduleCancelByApp, unregisterAppDir } from '../schedule-store.js';
|
|
7
8
|
import module$1 from 'module';
|
|
8
9
|
|
|
9
10
|
const initRequire = () => { };
|
|
@@ -20,6 +21,7 @@ const loadChildren = async (mainPath, appName) => {
|
|
|
20
21
|
}
|
|
21
22
|
const mainDir = dirname(mainPath);
|
|
22
23
|
const App = new ChildrenApp(appName);
|
|
24
|
+
registerAppDir(appName, mainDir);
|
|
23
25
|
try {
|
|
24
26
|
const moduleApp = await import(`file://${mainPath}`);
|
|
25
27
|
if (!moduleApp?.default) {
|
|
@@ -44,6 +46,8 @@ const loadChildren = async (mainPath, appName) => {
|
|
|
44
46
|
App.pushCycle(app);
|
|
45
47
|
const unMounted = async (e) => {
|
|
46
48
|
showErrorModule(e);
|
|
49
|
+
scheduleCancelByApp(appName);
|
|
50
|
+
unregisterAppDir(appName);
|
|
47
51
|
App.un();
|
|
48
52
|
try {
|
|
49
53
|
if (app?.unMounted) {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ScheduleId, ScheduleItem, ScheduleStatus, ScheduleCallback, CronExpression } from '../types/schedule';
|
|
2
|
+
export declare const registerAppDir: (appName: string, mainDir: string) => void;
|
|
3
|
+
export declare const unregisterAppDir: (appName: string) => void;
|
|
4
|
+
export declare const scheduleInterval: (callback: ScheduleCallback, ms: number, appName?: string) => ScheduleId;
|
|
5
|
+
export declare const scheduleTimeout: (callback: ScheduleCallback, ms: number, appName?: string) => ScheduleId;
|
|
6
|
+
export declare const scheduleCron: (expression: CronExpression, callback: ScheduleCallback, appName?: string) => ScheduleId;
|
|
7
|
+
export declare const schedulePause: (id: ScheduleId) => boolean;
|
|
8
|
+
export declare const scheduleResume: (id: ScheduleId) => boolean;
|
|
9
|
+
export declare const scheduleCancel: (id: ScheduleId) => boolean;
|
|
10
|
+
export declare const scheduleCancelByApp: (appName: string) => number;
|
|
11
|
+
export declare const scheduleCancelAll: () => number;
|
|
12
|
+
export declare const scheduleList: (appName?: string) => Array<{
|
|
13
|
+
id: ScheduleId;
|
|
14
|
+
type: ScheduleItem["type"];
|
|
15
|
+
status: ScheduleStatus;
|
|
16
|
+
ms?: number;
|
|
17
|
+
cron?: string;
|
|
18
|
+
appName?: string;
|
|
19
|
+
createdAt: number;
|
|
20
|
+
}>;
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { ResultCode } from '../core/variable.js';
|
|
2
|
+
import { CronJob } from 'cron';
|
|
3
|
+
|
|
4
|
+
const scheduleMap = new Map();
|
|
5
|
+
const appDirMap = new Map();
|
|
6
|
+
const registerAppDir = (appName, mainDir) => {
|
|
7
|
+
appDirMap.set(appName, mainDir);
|
|
8
|
+
};
|
|
9
|
+
const unregisterAppDir = (appName) => {
|
|
10
|
+
appDirMap.delete(appName);
|
|
11
|
+
};
|
|
12
|
+
const extractCallerPaths = () => {
|
|
13
|
+
const stack = new Error().stack;
|
|
14
|
+
if (!stack) {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
const paths = [];
|
|
18
|
+
const lineRegex = /(?:file:\/\/|\(|\s)(\/[^):]+)/g;
|
|
19
|
+
let m;
|
|
20
|
+
while ((m = lineRegex.exec(stack)) !== null) {
|
|
21
|
+
paths.push(m[1]);
|
|
22
|
+
}
|
|
23
|
+
return paths;
|
|
24
|
+
};
|
|
25
|
+
const resolveAppName = () => {
|
|
26
|
+
const callerPaths = extractCallerPaths();
|
|
27
|
+
for (const filePath of callerPaths) {
|
|
28
|
+
for (const [name, dir] of appDirMap) {
|
|
29
|
+
if (filePath.startsWith(dir)) {
|
|
30
|
+
return name;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return 'main';
|
|
35
|
+
};
|
|
36
|
+
const generateId = () => {
|
|
37
|
+
return Date.now().toString(36) + Math.random().toString(36).substring(2, 15);
|
|
38
|
+
};
|
|
39
|
+
const safeInvoke = (callback, id, type) => {
|
|
40
|
+
try {
|
|
41
|
+
const result = callback();
|
|
42
|
+
if (result instanceof Promise) {
|
|
43
|
+
result.catch(err => {
|
|
44
|
+
logger.error({
|
|
45
|
+
code: ResultCode.Fail,
|
|
46
|
+
message: `Schedule ${type} error [${id}]: ${err?.message ?? err}`,
|
|
47
|
+
data: null
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
logger.error({
|
|
54
|
+
code: ResultCode.Fail,
|
|
55
|
+
message: `Schedule ${type} error [${id}]: ${err?.message ?? err}`,
|
|
56
|
+
data: null
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const scheduleInterval = (callback, ms, appName) => {
|
|
61
|
+
if (ms <= 0) {
|
|
62
|
+
throw new Error('Interval ms must be greater than 0');
|
|
63
|
+
}
|
|
64
|
+
const resolvedApp = appName ?? resolveAppName();
|
|
65
|
+
const id = generateId();
|
|
66
|
+
const timer = setInterval(() => {
|
|
67
|
+
safeInvoke(callback, id, 'interval');
|
|
68
|
+
}, ms);
|
|
69
|
+
const item = {
|
|
70
|
+
id,
|
|
71
|
+
type: 'interval',
|
|
72
|
+
status: 'active',
|
|
73
|
+
callback,
|
|
74
|
+
ms,
|
|
75
|
+
_timer: timer,
|
|
76
|
+
appName: resolvedApp,
|
|
77
|
+
createdAt: Date.now()
|
|
78
|
+
};
|
|
79
|
+
scheduleMap.set(id, item);
|
|
80
|
+
return id;
|
|
81
|
+
};
|
|
82
|
+
const scheduleTimeout = (callback, ms, appName) => {
|
|
83
|
+
if (ms < 0) {
|
|
84
|
+
throw new Error('Timeout ms must be >= 0');
|
|
85
|
+
}
|
|
86
|
+
const resolvedApp = appName ?? resolveAppName();
|
|
87
|
+
const id = generateId();
|
|
88
|
+
const timer = setTimeout(() => {
|
|
89
|
+
safeInvoke(callback, id, 'timeout');
|
|
90
|
+
const item = scheduleMap.get(id);
|
|
91
|
+
if (item) {
|
|
92
|
+
item.status = 'stopped';
|
|
93
|
+
item._timer = null;
|
|
94
|
+
}
|
|
95
|
+
scheduleMap.delete(id);
|
|
96
|
+
}, ms);
|
|
97
|
+
const item = {
|
|
98
|
+
id,
|
|
99
|
+
type: 'timeout',
|
|
100
|
+
status: 'active',
|
|
101
|
+
callback,
|
|
102
|
+
ms,
|
|
103
|
+
_timer: timer,
|
|
104
|
+
appName: resolvedApp,
|
|
105
|
+
createdAt: Date.now()
|
|
106
|
+
};
|
|
107
|
+
scheduleMap.set(id, item);
|
|
108
|
+
return id;
|
|
109
|
+
};
|
|
110
|
+
const scheduleCron = (expression, callback, appName) => {
|
|
111
|
+
const resolvedApp = appName ?? resolveAppName();
|
|
112
|
+
const id = generateId();
|
|
113
|
+
const job = CronJob.from({
|
|
114
|
+
cronTime: expression,
|
|
115
|
+
onTick: () => {
|
|
116
|
+
safeInvoke(callback, id, 'cron');
|
|
117
|
+
},
|
|
118
|
+
start: true
|
|
119
|
+
});
|
|
120
|
+
const item = {
|
|
121
|
+
id,
|
|
122
|
+
type: 'cron',
|
|
123
|
+
status: 'active',
|
|
124
|
+
callback,
|
|
125
|
+
cron: expression,
|
|
126
|
+
_timer: job,
|
|
127
|
+
appName: resolvedApp,
|
|
128
|
+
createdAt: Date.now()
|
|
129
|
+
};
|
|
130
|
+
scheduleMap.set(id, item);
|
|
131
|
+
return id;
|
|
132
|
+
};
|
|
133
|
+
const clearTimer = (item) => {
|
|
134
|
+
if (item._timer === null || item._timer === undefined) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (item.type === 'cron') {
|
|
138
|
+
void item._timer.stop();
|
|
139
|
+
}
|
|
140
|
+
else if (item.type === 'interval') {
|
|
141
|
+
clearInterval(item._timer);
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
clearTimeout(item._timer);
|
|
145
|
+
}
|
|
146
|
+
item._timer = null;
|
|
147
|
+
};
|
|
148
|
+
const schedulePause = (id) => {
|
|
149
|
+
const item = scheduleMap.get(id);
|
|
150
|
+
if (item?.status !== 'active') {
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
clearTimer(item);
|
|
154
|
+
item.status = 'paused';
|
|
155
|
+
return true;
|
|
156
|
+
};
|
|
157
|
+
const scheduleResume = (id) => {
|
|
158
|
+
const item = scheduleMap.get(id);
|
|
159
|
+
if (item?.status !== 'paused') {
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
if (item.type === 'interval' && item.ms) {
|
|
163
|
+
item._timer = setInterval(() => {
|
|
164
|
+
safeInvoke(item.callback, id, 'interval');
|
|
165
|
+
}, item.ms);
|
|
166
|
+
item.status = 'active';
|
|
167
|
+
return true;
|
|
168
|
+
}
|
|
169
|
+
if (item.type === 'cron' && item.cron) {
|
|
170
|
+
const job = CronJob.from({
|
|
171
|
+
cronTime: item.cron,
|
|
172
|
+
onTick: () => {
|
|
173
|
+
safeInvoke(item.callback, id, 'cron');
|
|
174
|
+
},
|
|
175
|
+
start: true
|
|
176
|
+
});
|
|
177
|
+
item._timer = job;
|
|
178
|
+
item.status = 'active';
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
return false;
|
|
182
|
+
};
|
|
183
|
+
const scheduleCancel = (id) => {
|
|
184
|
+
const item = scheduleMap.get(id);
|
|
185
|
+
if (!item) {
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
clearTimer(item);
|
|
189
|
+
item.status = 'stopped';
|
|
190
|
+
scheduleMap.delete(id);
|
|
191
|
+
return true;
|
|
192
|
+
};
|
|
193
|
+
const scheduleCancelByApp = (appName) => {
|
|
194
|
+
let count = 0;
|
|
195
|
+
for (const [id, item] of scheduleMap) {
|
|
196
|
+
if (item.appName === appName) {
|
|
197
|
+
scheduleCancel(id);
|
|
198
|
+
count++;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return count;
|
|
202
|
+
};
|
|
203
|
+
const scheduleCancelAll = () => {
|
|
204
|
+
let count = 0;
|
|
205
|
+
for (const [id] of scheduleMap) {
|
|
206
|
+
scheduleCancel(id);
|
|
207
|
+
count++;
|
|
208
|
+
}
|
|
209
|
+
return count;
|
|
210
|
+
};
|
|
211
|
+
const scheduleList = (appName) => {
|
|
212
|
+
const result = [];
|
|
213
|
+
for (const [, item] of scheduleMap) {
|
|
214
|
+
if (appName && item.appName !== appName) {
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
result.push({
|
|
218
|
+
id: item.id,
|
|
219
|
+
type: item.type,
|
|
220
|
+
status: item.status,
|
|
221
|
+
ms: item.ms,
|
|
222
|
+
cron: item.cron,
|
|
223
|
+
appName: item.appName,
|
|
224
|
+
createdAt: item.createdAt
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
return result;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
export { registerAppDir, scheduleCancel, scheduleCancelAll, scheduleCancelByApp, scheduleCron, scheduleInterval, scheduleList, schedulePause, scheduleResume, scheduleTimeout, unregisterAppDir };
|
|
@@ -17,6 +17,7 @@ import '../../app/hook-event-context.js';
|
|
|
17
17
|
import { apiResolves, apiTimeouts, actionResolves, actionTimeouts, FULL_RECEIVE_HEADER } from '../processor/config.js';
|
|
18
18
|
import { setDirectSend } from '../processor/transport.js';
|
|
19
19
|
import '../../app/message-format-old.js';
|
|
20
|
+
import 'cron';
|
|
20
21
|
import '../../app/event-utils.js';
|
|
21
22
|
import '../../app/message-api.js';
|
|
22
23
|
import { createWSConnector } from './base.js';
|
package/lib/client.js
CHANGED
|
@@ -28,6 +28,7 @@ import './app/event-processor.js';
|
|
|
28
28
|
import './app/event-response.js';
|
|
29
29
|
import './app/hook-event-context.js';
|
|
30
30
|
import './app/message-format-old.js';
|
|
31
|
+
import 'cron';
|
|
31
32
|
import './app/event-utils.js';
|
|
32
33
|
import './app/message-api.js';
|
|
33
34
|
import './process/platform.js';
|
package/lib/index.js
CHANGED
|
@@ -40,7 +40,9 @@ export { useRole } from './app/hook-use/role.js';
|
|
|
40
40
|
export { useUser } from './app/hook-use/user.js';
|
|
41
41
|
export { useObserver, useSubscribe } from './app/hook-use/subscribe.js';
|
|
42
42
|
export { createEvent, useEvent } from './app/hook-use/event.js';
|
|
43
|
+
export { clearInterval, clearTimeout, listSchedule, pauseSchedule, resumeSchedule, setCron, setInterval, setTimeout } from './app/api/schedule.js';
|
|
43
44
|
export { getCurrentEvent, getCurrentNext, withEventContext } from './app/hook-event-context.js';
|
|
45
|
+
export { registerAppDir, scheduleCancel, scheduleCancelAll, scheduleCancelByApp, scheduleCron, scheduleInterval, scheduleList, schedulePause, scheduleResume, scheduleTimeout, unregisterAppDir } from './app/schedule-store.js';
|
|
44
46
|
export { createEventValue, createSelects, onSelects, onState, unChildren, unState, useState } from './app/event-utils.js';
|
|
45
47
|
export { MessageDirect, createDataFormat, format, getMessageIntent, sendToChannel, sendToUser } from './app/message-api.js';
|
|
46
48
|
export { Format, FormatButtonGroup, FormatMarkDown } from './app/message-format.js';
|
package/lib/types/index.d.ts
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type ScheduleId = string;
|
|
2
|
+
export type ScheduleType = 'interval' | 'timeout' | 'cron';
|
|
3
|
+
export type ScheduleStatus = 'active' | 'paused' | 'stopped';
|
|
4
|
+
export type CronExpression = string;
|
|
5
|
+
export type ScheduleCallback = () => void | Promise<void>;
|
|
6
|
+
export interface ScheduleItem {
|
|
7
|
+
id: ScheduleId;
|
|
8
|
+
type: ScheduleType;
|
|
9
|
+
status: ScheduleStatus;
|
|
10
|
+
callback: ScheduleCallback;
|
|
11
|
+
ms?: number;
|
|
12
|
+
cron?: CronExpression;
|
|
13
|
+
_timer?: any;
|
|
14
|
+
appName?: string;
|
|
15
|
+
createdAt: number;
|
|
16
|
+
}
|
|
17
|
+
export type ScheduleMap = Map<ScheduleId, ScheduleItem>;
|
|
18
|
+
export interface ScheduleTools {
|
|
19
|
+
setInterval: (callback: ScheduleCallback, ms: number) => ScheduleId;
|
|
20
|
+
setTimeout: (callback: ScheduleCallback, ms: number) => ScheduleId;
|
|
21
|
+
setCron: (expression: CronExpression, callback: ScheduleCallback) => ScheduleId;
|
|
22
|
+
cancel: (id: ScheduleId) => boolean;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alemonjs",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.57",
|
|
4
4
|
"description": "bot script",
|
|
5
5
|
"author": "lemonade",
|
|
6
6
|
"license": "MIT",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"axios": "^1.14.0",
|
|
32
32
|
"chalk": "^5.6.2",
|
|
33
33
|
"commander": "^13.1.0",
|
|
34
|
+
"cron": "^4.4.0",
|
|
34
35
|
"file-type": "21.0.0",
|
|
35
36
|
"flatted": "^3.3.3",
|
|
36
37
|
"koa": "^3.0.1",
|