node-karin 1.14.0 → 1.14.2
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 +14 -0
- package/README.md +2 -2
- package/dist/index.d.ts +22 -1
- package/dist/index.mjs +29 -10
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
+
## [1.14.2](https://github.com/KarinJS/Karin/compare/core-v1.14.1...core-v1.14.2) (2026-01-30)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### 🎡 Continuous Integration
|
|
7
|
+
|
|
8
|
+
* **workflow:** 移除docker构建 ([#606](https://github.com/KarinJS/Karin/issues/606)) ([302190a](https://github.com/KarinJS/Karin/commit/302190a5bd499b747c3c82ce443979c92825f05c))
|
|
9
|
+
|
|
10
|
+
## [1.14.1](https://github.com/KarinJS/Karin/compare/core-v1.14.0...core-v1.14.1) (2025-12-25)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### 🐛 Bug Fixes
|
|
14
|
+
|
|
15
|
+
* 添加定时任务执行策略选项 ([#604](https://github.com/KarinJS/Karin/issues/604)) ([7f81df5](https://github.com/KarinJS/Karin/commit/7f81df561156dba7f65d44d46dbec7583eddbcf6))
|
|
16
|
+
|
|
3
17
|
## [1.14.0](https://github.com/KarinJS/Karin/compare/core-v1.13.8...core-v1.14.0) (2025-12-12)
|
|
4
18
|
|
|
5
19
|
|
package/README.md
CHANGED
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
|
|
39
39
|
我们提供多个文档站点供您访问,解决可能出现的访问困难:
|
|
40
40
|
|
|
41
|
-
- **主文档站**: [https://karinjs.com](https://karinjs.com)
|
|
41
|
+
- **主文档站**: [https://karinjs.com](https://karinjs.com)
|
|
42
42
|
- **镜像站点**:
|
|
43
|
-
- [
|
|
43
|
+
- [自建镜像(雾里)](https://github.com/shiwuliya): [https://karin.wuliya.cn](https://karin.wuliya.cn)
|
|
44
44
|
- [Vercel 镜像(憨憨)](https://github.com/hanhan258): [https://karin.hanhanz.top](https://karin.hanhanz.top)
|
|
45
45
|
- Deno 镜像: [https://karin.deno.dev](https://karin.deno.dev)
|
|
46
46
|
- [自建CDN镜像(ikechan8370)](https://github.com/ikechan8370): [https://karin.chaite.cloud](https://karin.chaite.cloud)
|
package/dist/index.d.ts
CHANGED
|
@@ -6924,6 +6924,13 @@ interface AdapterOptions {
|
|
|
6924
6924
|
*/
|
|
6925
6925
|
type Log<T extends boolean> = T extends true ? (id: string, log: string) => void : (log: string) => void;
|
|
6926
6926
|
|
|
6927
|
+
/** 任务执行策略枚举 */
|
|
6928
|
+
declare enum TaskExecutionType {
|
|
6929
|
+
/** 默认策略,允许并发执行 */
|
|
6930
|
+
DEFAULT = "default",
|
|
6931
|
+
/** 跳过策略,如果上一次任务未完成,则直接跳过本次执行 */
|
|
6932
|
+
SKIP = "skip"
|
|
6933
|
+
}
|
|
6927
6934
|
/** 定时任务方法 */
|
|
6928
6935
|
interface Task {
|
|
6929
6936
|
/** 插件包基本属性 */
|
|
@@ -6940,6 +6947,14 @@ interface Task {
|
|
|
6940
6947
|
log: Log<false>;
|
|
6941
6948
|
/** schedule */
|
|
6942
6949
|
schedule?: Job;
|
|
6950
|
+
/**
|
|
6951
|
+
* 任务执行策略
|
|
6952
|
+
* - `default`: 默认策略,允许并发执行,即不检查上一次任务是否完成
|
|
6953
|
+
* - `skip`: 跳过策略,如果上一次任务未完成,则直接跳过本次执行
|
|
6954
|
+
*/
|
|
6955
|
+
type: TaskExecutionType;
|
|
6956
|
+
/** 运行状态 */
|
|
6957
|
+
running: boolean;
|
|
6943
6958
|
}
|
|
6944
6959
|
|
|
6945
6960
|
/**
|
|
@@ -7046,6 +7061,12 @@ interface TaskOptions {
|
|
|
7046
7061
|
name?: string;
|
|
7047
7062
|
/** 是否启用日志 */
|
|
7048
7063
|
log?: boolean;
|
|
7064
|
+
/**
|
|
7065
|
+
* 任务执行策略
|
|
7066
|
+
* - `default`: 默认策略,允许并发执行,即不检查上一次任务是否完成
|
|
7067
|
+
* - `skip`: 跳过策略,如果上一次任务未完成,则直接跳过本次执行
|
|
7068
|
+
*/
|
|
7069
|
+
type?: TaskExecutionType | `${TaskExecutionType}`;
|
|
7049
7070
|
}
|
|
7050
7071
|
/**
|
|
7051
7072
|
* 构建定时任务
|
|
@@ -17795,4 +17816,4 @@ type Client = RedisClientType & {
|
|
|
17795
17816
|
*/
|
|
17796
17817
|
declare const start: () => Promise<void>;
|
|
17797
17818
|
|
|
17798
|
-
export { type Accept, type AccordionItemProps, type AccordionKV, type AccordionProProps, type AccordionProResult, type AccordionProps, type AccordionResult, type AccountInfo, type Adapter, AdapterBase, type AdapterCommunication, AdapterConvertKarin, type AdapterInfo, AdapterOneBot, type AdapterOptions, type AdapterPlatform, type AdapterProtocol, type AdapterStandard, type AdapterType, type Adapters, type AddDependenciesParams, type AddTaskResult, type AfterForwardMessageCallback, type AfterMessageCallback, type AllPluginMethods, type Apps, type ArrayField, type AtElement, type Author, BASE_ROUTER, BATCH_UPDATE_PLUGINS_ROUTER, BOT_CONNECT, BOT_DISCONNECT, type BaseContact, BaseEvent, type BaseEventOptions, type BaseEventType, type BaseForwardCallback, type BaseMessageCallback, type BasketballElement, Bot, type BoundingBox, type BubbleFaceElement, type Button, type ButtonElement, CHECK_PLUGIN_ROUTER, CLOSE_TERMINAL_ROUTER, CONSOLE_ROUTER, CREATE_TERMINAL_ROUTER, type Cache, type CacheEntry, type CheckboxField, type CheckboxGroupProps, type CheckboxProps, type CheckboxResult, type Children, type CmdFnc, type Command, type CommandClass, type CompareMode, type ComponentConfig, type ComponentProps, type ComponentType, type Components, type ComponentsClass, type Config, type Contact, type ContactElement, type Count, type CreateGroupFolderResponse, type CreatePty, type CreateTask, type CreateTaskParams, type CreateTaskResult, type CronProps, type CustomMusicElement, type CustomNodeElement, type DbStreamStatus, type DbStreams, type DefineConfig, type DependenciesManage, type DependenciesManageBase, type Dependency, type DiceElement, type DirectContact, DirectMessage, type DirectMessageOptions, type DirectNodeElement, type DirectSender, type DividerField, type DividerProps, type DownloadFileErrorResult, type DownloadFileOptions, type DownloadFileResponse, type DownloadFileResult, type DownloadFileSuccessResult, type DownloadFilesOptions, EVENT_COUNT, EXIT_ROUTER, type ElementTypes, type Elements, type Env, type Event, type EventCallCallback, type EventCallHookItem, type EventParent, type EventToSubEvent, type ExecOptions$1 as ExecOptions, type ExecReturn, type ExecType, type ExtendedAxiosRequestConfig, FILE_CHANGE, type FaceElement, type FieldType, type FileElement, type FileList, type FileListMap, type FileToUrlHandler, type FileToUrlResult, type FormField, type ForwardMessageCallback, type ForwardOptions, type FriendContact, type FriendData, FriendDecreaseNotice, type FriendDecreaseOptions, FriendIncreaseNotice, type FriendIncreaseOptions, FriendMessage, type FriendMessageOptions, type FriendNoticeEventMap, type FriendRequestEventMap, type FriendRequestOptions, type FriendSender, type FrontendInstalledPluginListResponse, GET_BOTS_ROUTER, GET_CONFIG_ROUTER, GET_DEPENDENCIES_LIST_ROUTER, GET_LOADED_COMMAND_PLUGIN_CACHE_LIST_ROUTER, GET_LOCAL_PLUGIN_FRONTEND_LIST_ROUTER, GET_LOCAL_PLUGIN_LIST_ROUTER, GET_LOG_FILE_LIST_ROUTER, GET_LOG_FILE_ROUTER, GET_LOG_ROUTER, GET_NETWORK_STATUS_ROUTER, GET_NPMRC_LIST_ROUTER, GET_NPM_BASE_CONFIG_ROUTER, GET_NPM_CONFIG_ROUTER, GET_ONLINE_PLUGIN_LIST_ROUTER, GET_PLUGIN_APPS_ROUTER, GET_PLUGIN_CONFIG_ROUTER, GET_PLUGIN_FILE_ROUTER, GET_PLUGIN_LIST_PLUGIN_ADMIN_ROUTER, GET_PLUGIN_LIST_ROUTER, GET_PLUGIN_MARKET_LIST_ROUTER, GET_TASK_LIST_ROUTER, GET_TASK_STATUS_ROUTER, GET_TERMINAL_LIST_ROUTER, GET_UPDATABLE_PLUGINS_ROUTER, GET_WEBUI_PLUGIN_LIST_ROUTER, GET_WEBUI_PLUGIN_VERSIONS_ROUTER, type GeneralHookCallback, type GeneralHookItem, type GetAiCharactersResponse, type GetAtAllCountResponse, type GetBot, type GetCommitHashOptions, type GetConfigRequest, type GetConfigResponse, type GetGroupFileListResponse, type GetGroupFileSystemInfoResponse, type GetGroupHighlightsResponse, type GetGroupMuteListResponse, type GetPluginLocalOptions, type GetPluginLocalReturn, type GetPluginReturn, type GetPluginType, type GetRkeyResponse, type GiftElement, type GitLocalBranches, type GitPullOptions, type GitPullResult, type GitRemoteBranches, type GithubConfig, type GoToOptions, GroupAdminChangedNotice, type GroupAdminChangedOptions, GroupApplyRequest, type GroupApplyRequestOptions, GroupCardChangedNotice, type GroupCardChangedOptions, type GroupContact, type GroupData, GroupFileUploadedNotice, type GroupFileUploadedOptions, GroupHlightsChangedNotice, type GroupHlightsChangedOptions, GroupHonorChangedNotice, type GroupHonorChangedOptions, type GroupInfo, GroupInviteRequest, type GroupInviteRequestOptions, GroupLuckKingNotice, type GroupLuckKingOptions, GroupMemberBanNotice, type GroupMemberBanOptions, type GroupMemberData, GroupMemberDecreaseNotice, type GroupMemberDecreaseOptions, GroupMemberIncreaseNotice, type GroupMemberIncreaseOptions, type GroupMemberInfo, GroupMemberTitleUpdatedNotice, type GroupMemberUniqueTitleChangedOptions, GroupMessage, type GroupMessageOptions, GroupMessageReactionNotice, type GroupMessageReactionOptions, GroupNotice, type GroupNoticeEventMap, GroupPokeNotice, type GroupPokeOptions, GroupRecallNotice, type GroupRecallOptions, type GroupRequestEventMap, type GroupSender, GroupSignInNotice, type GroupSignInOptions, type GroupTempContact, GroupTempMessage, type GroupTempMessageOptions, type GroupTempSender, GroupWholeBanNotice, type GroupWholeBanOptions, type Groups, type GroupsObjectValue, type GuildContact, GuildMessage, type GuildMessageOptions, type GuildSender, HTTPStatusCode, type Handler, type HandlerType, type HookCache, type HookCallback, type HookEmitForward, type HookEmitMessage, type HookNext, type HookOptions, type HooksType, INSTALL_PLUGIN_ROUTER, INSTALL_WEBUI_PLUGIN_ROUTER, IS_PLUGIN_CONFIG_EXIST_ROUTER, type Icon, type ImageElement, type ImportModuleResult, type InputGroupProps, type InputProps, type InputResult, type JsonElement, type JwtVerifyBase, type JwtVerifyError, type JwtVerifyExpired, type JwtVerifyResult, type JwtVerifySuccess, type JwtVerifyUnauthorized, type KarinButton, KarinConvertAdapter, type KarinPluginAppsType, type KeyboardElement, LOGIN_ROUTER, type LoadPluginResult, type LoadedPluginCacheList, type LocalApiResponse, type LocationElement, type Log, LogMethodNames, Logger, LoggerLevel, type LongMsgElement, MANAGE_DEPENDENCIES_ROUTER, type MarkdownElement, type MarkdownTplElement, type MarketFaceElement, type Message, MessageBase$1 as MessageBase, type MessageEventMap, type MessageEventSub, type MessageHookItem, type MessageOptions, type MessageResponse, type MusicElement, type MusicPlatform, type NetworkStatus, type NodeElement, type NormalMessageCallback, type Notice, type NoticeAndRequest, NoticeBase, type NoticeEventMap, type NoticeEventSub, type NoticeOptions, type NpmBaseConfigResponse, type NpmRegistryResponse, type NpmrcFileResponse, type NumberField, type ObjectArrayField, type ObjectField, createMessage as OneBotCreateMessage, createNotice as OneBotCreateNotice, createRequest as OneBotCreateRequest, type Option, type Options, PING_ROUTER, PLUGIN_ADMIN_ROUTER, type PM2, type Package, type Parser, type PasmsgElement, type Permission, type PingRequestResult, type PkgData, type PkgEnv, type PkgInfo, Plugin$1 as Plugin, type PluginAdminCustomInstall, type PluginAdminCustomInstallApp, type PluginAdminInstall, type PluginAdminListResponse, type PluginAdminMarketInstall, type PluginAdminMarketInstallApp, type PluginAdminParams, type PluginAdminResult, type PluginAdminUninstall, type PluginAdminUpdate, type PluginFile, type PluginFncTypes, type PluginLists, type PluginMarketAuthor, type PluginMarketLocalBase, type PluginMarketLocalOptions, type PluginMarketOptions, type PluginMarketRequest, type PluginMarketResponse, type PluginOptions, type PluginRule, type PluginUpdateInfo, type PnpmDependencies, type PnpmDependency, type Point, PrivateApplyRequest, type PrivateApplyRequestOptions, PrivateFileUploadedNotice, type PrivateFileUploadedOptions, PrivatePokeNotice, type PrivatePokeOptions, PrivateRecallNotice, type PrivateRecallOptions, type Privates, type PrivatesObjectValue, type PuppeteerLifeCycleEvent, type QQBotButton, type QQButtonTextType, type QQGroupFileInfo, type QQGroupFolderInfo, type QQGroupHonorInfo, RECV_MSG, REFRESH_ROUTER, RESTART_ROUTER, type RaceResult, type Radio, type RadioField, type RadioGroupProps, type RadioResult, type RawElement, type ReadyMusicElement, ReceiveLikeNotice, type ReceiveLikeOptions, type RecordElement, type Redis, type RemoveDependenciesParams, type Render, type RenderResult, Renderer, type Renders$1 as Renders, type Reply, type ReplyElement, type Request, RequestBase, type RequestEventMap, type RequestEventSub, type RequestOptions, type RequireFunction, type RequireFunctionSync, type RequireOptions, type Role, type RpsElement, SAVE_CONFIG_ROUTER, SAVE_NPMRC_ROUTER, SAVE_PLUGIN_CONFIG_ROUTER, SEND_MSG, SET_LOG_LEVEL_ROUTER, SYSTEM_INFO_ROUTER, SYSTEM_STATUS_KARIN_ROUTER, SYSTEM_STATUS_ROUTER, SYSTEM_STATUS_WS_ROUTER, type SandBoxAccountInfo, type SandboxMsgRecord, type SandboxSendApi, type SandboxSendSendFriendMsg, type SandboxSendSendGroupMsg, type SandboxSendSendMsg, type SaveConfigResponse, type SaveResult, type Scene, type ScreenshotClip, type ScreenshotOptions, type SectionField, type SelectField, type SelectItem, type SelectProps, type SendElement, type SendForwardMessageResponse, type SendMessage, type SendMsgHookItem, type SendMsgResults, type Sender, type SenderBase, type SenderGroup$1 as SenderGroup, type Sex$1 as Sex, type ShareElement, type Snapka, type SnapkaResult, type SrcReply, type StandardResult, type SwitchField, type SwitchProps, type SwitchResult, TASK_DELETE_ROUTER, TASK_LIST_ROUTER, TASK_LOGS_ROUTER, TASK_RUN_ROUTER, type Task, type TaskCallbacks, type TaskEntity, type TaskExecutor, type TaskFilter, type TaskStatus, type TaskType, type TerminalInstance, type TerminalShell, type TestNetworkRequestDetail, type TextElement, type TextField, type TitleField, UNINSTALL_PLUGIN_ROUTER, UNINSTALL_WEBUI_PLUGIN_ROUTER, UPDATE_CORE_ROUTER, UPDATE_PLUGIN_ROUTER, UPDATE_TASK_STATUS_ROUTER, UPDATE_WEBUI_PLUGIN_VERSION_ROUTER, type UnionMessage, type UnregisterBot, type UpgradeDependenciesParams, type UserInfo, type ValidationRule, type ValueType, type VideoElement, WS_CLOSE, WS_CLOSE_ONEBOT, WS_CLOSE_PUPPETEER, WS_CLOSE_SANDBOX, WS_CONNECTION, WS_CONNECTION_ONEBOT, WS_CONNECTION_PUPPETEER, WS_CONNECTION_SANDBOX, WS_CONNECTION_TERMINAL, WS_SNAPKA, type WaitForOptions, Watch, Watcher, type WeatherElement, type XmlElement, type YamlComment, YamlEditor, type YamlValue, absPath, accordion, accordionItem, accordionPro, app, applyComments, authMiddleware, base64, buffer, buildError, buildGithub, buttonHandle, cacheMap, callRender, changelog, checkGitPluginUpdate, checkPkgUpdate, checkPort, clearRequire, clearRequireFile, comment, index$1 as common, components, index as config, contact$1 as contact, contactDirect, contactFriend, contactGroup, contactGroupTemp, contactGuild, convertOneBotMessageToKarin, copyConfig, copyConfigSync, copyFiles, copyFilesSync, createAccessTokenExpiredResponse, createBadRequestResponse, createDirectMessage, createForbiddenResponse, createFriendDecreaseNotice, createFriendIncreaseNotice, createFriendMessage, createGroupAdminChangedNotice, createGroupApplyRequest, createGroupCardChangedNotice, createGroupFileUploadedNotice, createGroupHlightsChangedNotice, createGroupHonorChangedNotice, createGroupInviteRequest, createGroupLuckKingNotice, createGroupMemberAddNotice, createGroupMemberBanNotice, createGroupMemberDelNotice, createGroupMemberTitleUpdatedNotice, createGroupMessage, createGroupMessageReactionNotice, createGroupPokeNotice, createGroupRecallNotice, createGroupSignInNotice, createGroupTempMessage, createGroupWholeBanNotice, createGuildMessage, createINIParser, createMethodNotAllowedResponse, createNotFoundResponse, createOneBotClient, createOneBotHttp, createOneBotWsServer, createPayloadTooLargeResponse, createPluginDir, createPrivateApplyRequest, createPrivateFileUploadedNotice, createPrivatePokeNotice, createPrivateRecallNotice, createRawMessage, createReceiveLikeNotice, createRefreshTokenExpiredResponse, createResponse, createServerErrorResponse, createSuccessResponse, createTaskDatabase, createUnauthorizedResponse, cron, db, debug, karin as default, defineConfig, disconnectAllOneBotServer, divider, downFile, downloadFile, errorToString, exec, executeTask, existToMkdir, existToMkdirSync, exists, existsSync, ffmpeg, ffplay, ffprobe, fs as file, fileToBase64, fileToUrl, fileToUrlHandlerKey, filesByExt, formatLogString, formatPath, formatTime$1 as formatTime, index$3 as fs, getAllBot, getAllBotID, getAllBotList, getAllFiles, getAllFilesSync, getBot, getBotCount, getCommit, getDefaultBranch, getFastGithub, getFastRegistry, getFileMessage, getFiles, getHash, getLocalBranches, getLocalCommitHash, getMimeType, getPackageJson, getPid, getPkgVersion, getPluginInfo, getPlugins, getRelPath, getRemoteBranches, getRemoteCommitHash, getRemotePkgVersion, getRender, getRenderCount, getRenderList, getRequestIp, getTaskCallback, getTaskDatabase, getTime, gitPull, handler$1 as handler, hooks, importModule, imports, ini, initOneBotAdapter, initTaskSystem, input, isClass, isDir, isDirSync, isDocker, isFile, isFileSync, isIPv4Loop, isIPv6Loop, isLinux, isLocalRequest, isLoopback, isMac, isPathEqual, isPlugin, isPublic, isRoot, isSubPath, isWin, json$1 as json, karin, karinToQQBot, key, killApp, lock, lockMethod, lockProp, log, logger, logs, makeForward, makeMessage, type messageType, mkdir, mkdirSync, parseChangelog, parseGithubUrl, pingRequest, pkgRoot, qqbotToKarin, raceRequest, randomStr, range, read, readFile, readJson, readJsonSync, redis, registerBot, registerRender, removeTaskCallback, render, renderHtml, renderMultiHtml, renderTpl, requireFile, requireFileSync, restart, restartDirect, rmSync, router, satisfies, save, type screenshot, segment, select, sendMsg$1 as sendMsg, sender, senderDirect, senderFriend, senderGroup, senderGroupTemp, senderGuild, sep, server, setTaskCallback, setTaskDatabase, splitPath, start, stream, stringifyError, switchComponent, index$2 as system, taskAdd, taskExists, taskGet, taskList, taskSystem, taskUpdateLogs, taskUpdateStatus, unregisterBot, unregisterRender, updateAllGitPlugin, updateAllPkg, updateGitPlugin, updatePkg, updateTaskLogs, updateTaskStatus, uptime$1 as uptime, urlToPath, waitPort, watch, watchAndMerge, write, writeJson, writeJsonSync, yaml };
|
|
17819
|
+
export { type Accept, type AccordionItemProps, type AccordionKV, type AccordionProProps, type AccordionProResult, type AccordionProps, type AccordionResult, type AccountInfo, type Adapter, AdapterBase, type AdapterCommunication, AdapterConvertKarin, type AdapterInfo, AdapterOneBot, type AdapterOptions, type AdapterPlatform, type AdapterProtocol, type AdapterStandard, type AdapterType, type Adapters, type AddDependenciesParams, type AddTaskResult, type AfterForwardMessageCallback, type AfterMessageCallback, type AllPluginMethods, type Apps, type ArrayField, type AtElement, type Author, BASE_ROUTER, BATCH_UPDATE_PLUGINS_ROUTER, BOT_CONNECT, BOT_DISCONNECT, type BaseContact, BaseEvent, type BaseEventOptions, type BaseEventType, type BaseForwardCallback, type BaseMessageCallback, type BasketballElement, Bot, type BoundingBox, type BubbleFaceElement, type Button, type ButtonElement, CHECK_PLUGIN_ROUTER, CLOSE_TERMINAL_ROUTER, CONSOLE_ROUTER, CREATE_TERMINAL_ROUTER, type Cache, type CacheEntry, type CheckboxField, type CheckboxGroupProps, type CheckboxProps, type CheckboxResult, type Children, type CmdFnc, type Command, type CommandClass, type CompareMode, type ComponentConfig, type ComponentProps, type ComponentType, type Components, type ComponentsClass, type Config, type Contact, type ContactElement, type Count, type CreateGroupFolderResponse, type CreatePty, type CreateTask, type CreateTaskParams, type CreateTaskResult, type CronProps, type CustomMusicElement, type CustomNodeElement, type DbStreamStatus, type DbStreams, type DefineConfig, type DependenciesManage, type DependenciesManageBase, type Dependency, type DiceElement, type DirectContact, DirectMessage, type DirectMessageOptions, type DirectNodeElement, type DirectSender, type DividerField, type DividerProps, type DownloadFileErrorResult, type DownloadFileOptions, type DownloadFileResponse, type DownloadFileResult, type DownloadFileSuccessResult, type DownloadFilesOptions, EVENT_COUNT, EXIT_ROUTER, type ElementTypes, type Elements, type Env, type Event, type EventCallCallback, type EventCallHookItem, type EventParent, type EventToSubEvent, type ExecOptions$1 as ExecOptions, type ExecReturn, type ExecType, type ExtendedAxiosRequestConfig, FILE_CHANGE, type FaceElement, type FieldType, type FileElement, type FileList, type FileListMap, type FileToUrlHandler, type FileToUrlResult, type FormField, type ForwardMessageCallback, type ForwardOptions, type FriendContact, type FriendData, FriendDecreaseNotice, type FriendDecreaseOptions, FriendIncreaseNotice, type FriendIncreaseOptions, FriendMessage, type FriendMessageOptions, type FriendNoticeEventMap, type FriendRequestEventMap, type FriendRequestOptions, type FriendSender, type FrontendInstalledPluginListResponse, GET_BOTS_ROUTER, GET_CONFIG_ROUTER, GET_DEPENDENCIES_LIST_ROUTER, GET_LOADED_COMMAND_PLUGIN_CACHE_LIST_ROUTER, GET_LOCAL_PLUGIN_FRONTEND_LIST_ROUTER, GET_LOCAL_PLUGIN_LIST_ROUTER, GET_LOG_FILE_LIST_ROUTER, GET_LOG_FILE_ROUTER, GET_LOG_ROUTER, GET_NETWORK_STATUS_ROUTER, GET_NPMRC_LIST_ROUTER, GET_NPM_BASE_CONFIG_ROUTER, GET_NPM_CONFIG_ROUTER, GET_ONLINE_PLUGIN_LIST_ROUTER, GET_PLUGIN_APPS_ROUTER, GET_PLUGIN_CONFIG_ROUTER, GET_PLUGIN_FILE_ROUTER, GET_PLUGIN_LIST_PLUGIN_ADMIN_ROUTER, GET_PLUGIN_LIST_ROUTER, GET_PLUGIN_MARKET_LIST_ROUTER, GET_TASK_LIST_ROUTER, GET_TASK_STATUS_ROUTER, GET_TERMINAL_LIST_ROUTER, GET_UPDATABLE_PLUGINS_ROUTER, GET_WEBUI_PLUGIN_LIST_ROUTER, GET_WEBUI_PLUGIN_VERSIONS_ROUTER, type GeneralHookCallback, type GeneralHookItem, type GetAiCharactersResponse, type GetAtAllCountResponse, type GetBot, type GetCommitHashOptions, type GetConfigRequest, type GetConfigResponse, type GetGroupFileListResponse, type GetGroupFileSystemInfoResponse, type GetGroupHighlightsResponse, type GetGroupMuteListResponse, type GetPluginLocalOptions, type GetPluginLocalReturn, type GetPluginReturn, type GetPluginType, type GetRkeyResponse, type GiftElement, type GitLocalBranches, type GitPullOptions, type GitPullResult, type GitRemoteBranches, type GithubConfig, type GoToOptions, GroupAdminChangedNotice, type GroupAdminChangedOptions, GroupApplyRequest, type GroupApplyRequestOptions, GroupCardChangedNotice, type GroupCardChangedOptions, type GroupContact, type GroupData, GroupFileUploadedNotice, type GroupFileUploadedOptions, GroupHlightsChangedNotice, type GroupHlightsChangedOptions, GroupHonorChangedNotice, type GroupHonorChangedOptions, type GroupInfo, GroupInviteRequest, type GroupInviteRequestOptions, GroupLuckKingNotice, type GroupLuckKingOptions, GroupMemberBanNotice, type GroupMemberBanOptions, type GroupMemberData, GroupMemberDecreaseNotice, type GroupMemberDecreaseOptions, GroupMemberIncreaseNotice, type GroupMemberIncreaseOptions, type GroupMemberInfo, GroupMemberTitleUpdatedNotice, type GroupMemberUniqueTitleChangedOptions, GroupMessage, type GroupMessageOptions, GroupMessageReactionNotice, type GroupMessageReactionOptions, GroupNotice, type GroupNoticeEventMap, GroupPokeNotice, type GroupPokeOptions, GroupRecallNotice, type GroupRecallOptions, type GroupRequestEventMap, type GroupSender, GroupSignInNotice, type GroupSignInOptions, type GroupTempContact, GroupTempMessage, type GroupTempMessageOptions, type GroupTempSender, GroupWholeBanNotice, type GroupWholeBanOptions, type Groups, type GroupsObjectValue, type GuildContact, GuildMessage, type GuildMessageOptions, type GuildSender, HTTPStatusCode, type Handler, type HandlerType, type HookCache, type HookCallback, type HookEmitForward, type HookEmitMessage, type HookNext, type HookOptions, type HooksType, INSTALL_PLUGIN_ROUTER, INSTALL_WEBUI_PLUGIN_ROUTER, IS_PLUGIN_CONFIG_EXIST_ROUTER, type Icon, type ImageElement, type ImportModuleResult, type InputGroupProps, type InputProps, type InputResult, type JsonElement, type JwtVerifyBase, type JwtVerifyError, type JwtVerifyExpired, type JwtVerifyResult, type JwtVerifySuccess, type JwtVerifyUnauthorized, type KarinButton, KarinConvertAdapter, type KarinPluginAppsType, type KeyboardElement, LOGIN_ROUTER, type LoadPluginResult, type LoadedPluginCacheList, type LocalApiResponse, type LocationElement, type Log, LogMethodNames, Logger, LoggerLevel, type LongMsgElement, MANAGE_DEPENDENCIES_ROUTER, type MarkdownElement, type MarkdownTplElement, type MarketFaceElement, type Message, MessageBase$1 as MessageBase, type MessageEventMap, type MessageEventSub, type MessageHookItem, type MessageOptions, type MessageResponse, type MusicElement, type MusicPlatform, type NetworkStatus, type NodeElement, type NormalMessageCallback, type Notice, type NoticeAndRequest, NoticeBase, type NoticeEventMap, type NoticeEventSub, type NoticeOptions, type NpmBaseConfigResponse, type NpmRegistryResponse, type NpmrcFileResponse, type NumberField, type ObjectArrayField, type ObjectField, createMessage as OneBotCreateMessage, createNotice as OneBotCreateNotice, createRequest as OneBotCreateRequest, type Option, type Options, PING_ROUTER, PLUGIN_ADMIN_ROUTER, type PM2, type Package, type Parser, type PasmsgElement, type Permission, type PingRequestResult, type PkgData, type PkgEnv, type PkgInfo, Plugin$1 as Plugin, type PluginAdminCustomInstall, type PluginAdminCustomInstallApp, type PluginAdminInstall, type PluginAdminListResponse, type PluginAdminMarketInstall, type PluginAdminMarketInstallApp, type PluginAdminParams, type PluginAdminResult, type PluginAdminUninstall, type PluginAdminUpdate, type PluginFile, type PluginFncTypes, type PluginLists, type PluginMarketAuthor, type PluginMarketLocalBase, type PluginMarketLocalOptions, type PluginMarketOptions, type PluginMarketRequest, type PluginMarketResponse, type PluginOptions, type PluginRule, type PluginUpdateInfo, type PnpmDependencies, type PnpmDependency, type Point, PrivateApplyRequest, type PrivateApplyRequestOptions, PrivateFileUploadedNotice, type PrivateFileUploadedOptions, PrivatePokeNotice, type PrivatePokeOptions, PrivateRecallNotice, type PrivateRecallOptions, type Privates, type PrivatesObjectValue, type PuppeteerLifeCycleEvent, type QQBotButton, type QQButtonTextType, type QQGroupFileInfo, type QQGroupFolderInfo, type QQGroupHonorInfo, RECV_MSG, REFRESH_ROUTER, RESTART_ROUTER, type RaceResult, type Radio, type RadioField, type RadioGroupProps, type RadioResult, type RawElement, type ReadyMusicElement, ReceiveLikeNotice, type ReceiveLikeOptions, type RecordElement, type Redis, type RemoveDependenciesParams, type Render, type RenderResult, Renderer, type Renders$1 as Renders, type Reply, type ReplyElement, type Request, RequestBase, type RequestEventMap, type RequestEventSub, type RequestOptions, type RequireFunction, type RequireFunctionSync, type RequireOptions, type Role, type RpsElement, SAVE_CONFIG_ROUTER, SAVE_NPMRC_ROUTER, SAVE_PLUGIN_CONFIG_ROUTER, SEND_MSG, SET_LOG_LEVEL_ROUTER, SYSTEM_INFO_ROUTER, SYSTEM_STATUS_KARIN_ROUTER, SYSTEM_STATUS_ROUTER, SYSTEM_STATUS_WS_ROUTER, type SandBoxAccountInfo, type SandboxMsgRecord, type SandboxSendApi, type SandboxSendSendFriendMsg, type SandboxSendSendGroupMsg, type SandboxSendSendMsg, type SaveConfigResponse, type SaveResult, type Scene, type ScreenshotClip, type ScreenshotOptions, type SectionField, type SelectField, type SelectItem, type SelectProps, type SendElement, type SendForwardMessageResponse, type SendMessage, type SendMsgHookItem, type SendMsgResults, type Sender, type SenderBase, type SenderGroup$1 as SenderGroup, type Sex$1 as Sex, type ShareElement, type Snapka, type SnapkaResult, type SrcReply, type StandardResult, type SwitchField, type SwitchProps, type SwitchResult, TASK_DELETE_ROUTER, TASK_LIST_ROUTER, TASK_LOGS_ROUTER, TASK_RUN_ROUTER, type Task, type TaskCallbacks, type TaskEntity, TaskExecutionType, type TaskExecutor, type TaskFilter, type TaskStatus, type TaskType, type TerminalInstance, type TerminalShell, type TestNetworkRequestDetail, type TextElement, type TextField, type TitleField, UNINSTALL_PLUGIN_ROUTER, UNINSTALL_WEBUI_PLUGIN_ROUTER, UPDATE_CORE_ROUTER, UPDATE_PLUGIN_ROUTER, UPDATE_TASK_STATUS_ROUTER, UPDATE_WEBUI_PLUGIN_VERSION_ROUTER, type UnionMessage, type UnregisterBot, type UpgradeDependenciesParams, type UserInfo, type ValidationRule, type ValueType, type VideoElement, WS_CLOSE, WS_CLOSE_ONEBOT, WS_CLOSE_PUPPETEER, WS_CLOSE_SANDBOX, WS_CONNECTION, WS_CONNECTION_ONEBOT, WS_CONNECTION_PUPPETEER, WS_CONNECTION_SANDBOX, WS_CONNECTION_TERMINAL, WS_SNAPKA, type WaitForOptions, Watch, Watcher, type WeatherElement, type XmlElement, type YamlComment, YamlEditor, type YamlValue, absPath, accordion, accordionItem, accordionPro, app, applyComments, authMiddleware, base64, buffer, buildError, buildGithub, buttonHandle, cacheMap, callRender, changelog, checkGitPluginUpdate, checkPkgUpdate, checkPort, clearRequire, clearRequireFile, comment, index$1 as common, components, index as config, contact$1 as contact, contactDirect, contactFriend, contactGroup, contactGroupTemp, contactGuild, convertOneBotMessageToKarin, copyConfig, copyConfigSync, copyFiles, copyFilesSync, createAccessTokenExpiredResponse, createBadRequestResponse, createDirectMessage, createForbiddenResponse, createFriendDecreaseNotice, createFriendIncreaseNotice, createFriendMessage, createGroupAdminChangedNotice, createGroupApplyRequest, createGroupCardChangedNotice, createGroupFileUploadedNotice, createGroupHlightsChangedNotice, createGroupHonorChangedNotice, createGroupInviteRequest, createGroupLuckKingNotice, createGroupMemberAddNotice, createGroupMemberBanNotice, createGroupMemberDelNotice, createGroupMemberTitleUpdatedNotice, createGroupMessage, createGroupMessageReactionNotice, createGroupPokeNotice, createGroupRecallNotice, createGroupSignInNotice, createGroupTempMessage, createGroupWholeBanNotice, createGuildMessage, createINIParser, createMethodNotAllowedResponse, createNotFoundResponse, createOneBotClient, createOneBotHttp, createOneBotWsServer, createPayloadTooLargeResponse, createPluginDir, createPrivateApplyRequest, createPrivateFileUploadedNotice, createPrivatePokeNotice, createPrivateRecallNotice, createRawMessage, createReceiveLikeNotice, createRefreshTokenExpiredResponse, createResponse, createServerErrorResponse, createSuccessResponse, createTaskDatabase, createUnauthorizedResponse, cron, db, debug, karin as default, defineConfig, disconnectAllOneBotServer, divider, downFile, downloadFile, errorToString, exec, executeTask, existToMkdir, existToMkdirSync, exists, existsSync, ffmpeg, ffplay, ffprobe, fs as file, fileToBase64, fileToUrl, fileToUrlHandlerKey, filesByExt, formatLogString, formatPath, formatTime$1 as formatTime, index$3 as fs, getAllBot, getAllBotID, getAllBotList, getAllFiles, getAllFilesSync, getBot, getBotCount, getCommit, getDefaultBranch, getFastGithub, getFastRegistry, getFileMessage, getFiles, getHash, getLocalBranches, getLocalCommitHash, getMimeType, getPackageJson, getPid, getPkgVersion, getPluginInfo, getPlugins, getRelPath, getRemoteBranches, getRemoteCommitHash, getRemotePkgVersion, getRender, getRenderCount, getRenderList, getRequestIp, getTaskCallback, getTaskDatabase, getTime, gitPull, handler$1 as handler, hooks, importModule, imports, ini, initOneBotAdapter, initTaskSystem, input, isClass, isDir, isDirSync, isDocker, isFile, isFileSync, isIPv4Loop, isIPv6Loop, isLinux, isLocalRequest, isLoopback, isMac, isPathEqual, isPlugin, isPublic, isRoot, isSubPath, isWin, json$1 as json, karin, karinToQQBot, key, killApp, lock, lockMethod, lockProp, log, logger, logs, makeForward, makeMessage, type messageType, mkdir, mkdirSync, parseChangelog, parseGithubUrl, pingRequest, pkgRoot, qqbotToKarin, raceRequest, randomStr, range, read, readFile, readJson, readJsonSync, redis, registerBot, registerRender, removeTaskCallback, render, renderHtml, renderMultiHtml, renderTpl, requireFile, requireFileSync, restart, restartDirect, rmSync, router, satisfies, save, type screenshot, segment, select, sendMsg$1 as sendMsg, sender, senderDirect, senderFriend, senderGroup, senderGroupTemp, senderGuild, sep, server, setTaskCallback, setTaskDatabase, splitPath, start, stream, stringifyError, switchComponent, index$2 as system, taskAdd, taskExists, taskGet, taskList, taskSystem, taskUpdateLogs, taskUpdateStatus, unregisterBot, unregisterRender, updateAllGitPlugin, updateAllPkg, updateGitPlugin, updatePkg, updateTaskLogs, updateTaskStatus, uptime$1 as uptime, urlToPath, waitPort, watch, watchAndMerge, write, writeJson, writeJsonSync, yaml };
|
package/dist/index.mjs
CHANGED
|
@@ -5394,21 +5394,22 @@ var init_dist2 = __esm({
|
|
|
5394
5394
|
*/
|
|
5395
5395
|
async sendApi(action, params, timeout2 = this._options.timeout) {
|
|
5396
5396
|
const echo = (++this.echo).toString();
|
|
5397
|
-
const
|
|
5397
|
+
const realAction = this._formatAction(action);
|
|
5398
|
+
const request22 = JSON.stringify({ echo, action: realAction, params });
|
|
5398
5399
|
return new Promise((resolve, reject) => {
|
|
5399
5400
|
const timeoutId = setTimeout(() => {
|
|
5400
|
-
reject(this._formatApiError(
|
|
5401
|
+
reject(this._formatApiError(realAction, request22, "\u8BF7\u6C42\u8D85\u65F6"));
|
|
5401
5402
|
}, timeout2 * 1e3);
|
|
5402
|
-
this.emit("sendApi", { echo, action, params, request: request22 });
|
|
5403
|
+
this.emit("sendApi", { echo, action: realAction, params, request: request22 });
|
|
5403
5404
|
this._socket.send(request22);
|
|
5404
5405
|
this.once(`echo:${echo}`, (data) => {
|
|
5405
5406
|
clearTimeout(timeoutId);
|
|
5406
5407
|
if (data.status === "ok") {
|
|
5407
5408
|
resolve(data.data);
|
|
5408
5409
|
} else {
|
|
5409
|
-
reject(this._formatApiError(
|
|
5410
|
+
reject(this._formatApiError(realAction, request22, data));
|
|
5410
5411
|
}
|
|
5411
|
-
this.emit("response", { echo, action, params, request: request22, data });
|
|
5412
|
+
this.emit("response", { echo, action: realAction, params, request: request22, data });
|
|
5412
5413
|
});
|
|
5413
5414
|
});
|
|
5414
5415
|
}
|
|
@@ -5863,14 +5864,15 @@ var init_dist2 = __esm({
|
|
|
5863
5864
|
* @returns 返回API响应 注意: 返回的是response.data,而不是response
|
|
5864
5865
|
*/
|
|
5865
5866
|
async sendApi(action, params, timeout2 = this._options.timeout) {
|
|
5866
|
-
const
|
|
5867
|
+
const realAction = this._formatAction(action);
|
|
5868
|
+
const host2 = `${this._options.httpHost}/${realAction}`;
|
|
5867
5869
|
const request22 = JSON.stringify(params);
|
|
5868
|
-
this.emit("sendApi", { action, params, request: request22, echo: "" });
|
|
5870
|
+
this.emit("sendApi", { action: realAction, params, request: request22, echo: "" });
|
|
5869
5871
|
const data = await http_default.post(host2, request22, { timeout: timeout2, headers: this._options.headers });
|
|
5870
5872
|
if (data.data.status === "ok") {
|
|
5871
5873
|
return data.data.data;
|
|
5872
5874
|
} else {
|
|
5873
|
-
throw this._formatApiError(
|
|
5875
|
+
throw this._formatApiError(realAction, request22, data.data);
|
|
5874
5876
|
}
|
|
5875
5877
|
}
|
|
5876
5878
|
/**
|
|
@@ -22858,6 +22860,12 @@ var init_tools2 = __esm({
|
|
|
22858
22860
|
};
|
|
22859
22861
|
}
|
|
22860
22862
|
});
|
|
22863
|
+
|
|
22864
|
+
// src/types/plugin/task.ts
|
|
22865
|
+
var init_task2 = __esm({
|
|
22866
|
+
"src/types/plugin/task.ts"() {
|
|
22867
|
+
}
|
|
22868
|
+
});
|
|
22861
22869
|
var seq, pkgLoads, loadMainFile, pkgLoadModule, isType, pkgCache, createFile2, cacheClassPlugin, findPkgByFile, pkgSort, pkgHotReload;
|
|
22862
22870
|
var init_load = __esm({
|
|
22863
22871
|
"src/plugin/admin/load.ts"() {
|
|
@@ -22871,6 +22879,7 @@ var init_load = __esm({
|
|
|
22871
22879
|
init_import();
|
|
22872
22880
|
init_internal();
|
|
22873
22881
|
init_list();
|
|
22882
|
+
init_task2();
|
|
22874
22883
|
init_versionCheck();
|
|
22875
22884
|
seq = 0;
|
|
22876
22885
|
pkgLoads = async (pkg2, allPromises) => {
|
|
@@ -22984,12 +22993,19 @@ var init_load = __esm({
|
|
|
22984
22993
|
if (isType(val, "task")) {
|
|
22985
22994
|
val.schedule = schedule.scheduleJob(val.cron, async () => {
|
|
22986
22995
|
try {
|
|
22996
|
+
if (val.type === "skip" /* SKIP */ && val.running) {
|
|
22997
|
+
val.log(`[\u5B9A\u65F6\u4EFB\u52A1][${val.name}][${val.cron}]: \u4E0A\u4E00\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\uFF0C\u8DF3\u8FC7\u672C\u6B21\u6267\u884C`);
|
|
22998
|
+
return;
|
|
22999
|
+
}
|
|
23000
|
+
val.running = true;
|
|
22987
23001
|
val.log(`[\u5B9A\u65F6\u4EFB\u52A1][${val.name}][${val.cron}]: \u5F00\u59CB\u6267\u884C`);
|
|
22988
23002
|
const result2 = val.fnc();
|
|
22989
23003
|
if (util5.types.isPromise(result2)) await result2;
|
|
22990
23004
|
val.log(`[\u5B9A\u65F6\u4EFB\u52A1][${val.name}][${val.cron}]: \u6267\u884C\u5B8C\u6210`);
|
|
22991
23005
|
} catch (error) {
|
|
22992
23006
|
errorHandler.taskStart(val.name, val.name, error);
|
|
23007
|
+
} finally {
|
|
23008
|
+
val.running = false;
|
|
22993
23009
|
}
|
|
22994
23010
|
});
|
|
22995
23011
|
cache3.count.task++;
|
|
@@ -23973,7 +23989,7 @@ var init_config4 = __esm({
|
|
|
23973
23989
|
for (const item of list2) {
|
|
23974
23990
|
if (item === npmName) return "npm";
|
|
23975
23991
|
if (item === gitName) return "git";
|
|
23976
|
-
if (item === rootName) return "
|
|
23992
|
+
if (item === rootName) return "git";
|
|
23977
23993
|
}
|
|
23978
23994
|
return null;
|
|
23979
23995
|
};
|
|
@@ -27735,6 +27751,7 @@ __export(export_exports, {
|
|
|
27735
27751
|
|
|
27736
27752
|
// src/core/karin/task.ts
|
|
27737
27753
|
init_tools2();
|
|
27754
|
+
init_task2();
|
|
27738
27755
|
var task = (name, cron2, fnc2, options = {}) => {
|
|
27739
27756
|
if (!name) throw new Error("[task]: \u7F3A\u5C11\u53C2\u6570[name]");
|
|
27740
27757
|
if (!cron2) throw new Error("[task]: \u7F3A\u5C11\u53C2\u6570[cron]");
|
|
@@ -27746,7 +27763,9 @@ var task = (name, cron2, fnc2, options = {}) => {
|
|
|
27746
27763
|
log: createLogger2(options.log, false),
|
|
27747
27764
|
schedule: void 0,
|
|
27748
27765
|
file: createFile("task", options.name || "task"),
|
|
27749
|
-
pkg: createPkg2()
|
|
27766
|
+
pkg: createPkg2(),
|
|
27767
|
+
type: options.type || "default" /* DEFAULT */,
|
|
27768
|
+
running: false
|
|
27750
27769
|
};
|
|
27751
27770
|
};
|
|
27752
27771
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-karin",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.2",
|
|
4
4
|
"description": "Lightweight, efficient, concise, and stable robot framework.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node",
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
"yaml": "2.7.0"
|
|
160
160
|
},
|
|
161
161
|
"devDependencies": {
|
|
162
|
-
"@karinjs/node-pty": "^1.1.
|
|
162
|
+
"@karinjs/node-pty": "^1.1.3",
|
|
163
163
|
"@karinjs/plugin-webui-network-monitor": "^1.0.3",
|
|
164
164
|
"@karinjs/plugins-list": "^1.7.0",
|
|
165
165
|
"@types/express": "^5.0.3",
|