node-karin 1.3.14 → 1.3.15

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
@@ -1,5 +1,30 @@
1
1
  # 更新日志
2
2
 
3
+ ## [1.3.16](https://github.com/KarinJS/Karin/compare/core-v1.3.15...core-v1.3.16) (2025-02-23)
4
+
5
+
6
+ ### 🐛 Bug Fixes
7
+
8
+ * ci ([7606096](https://github.com/KarinJS/Karin/commit/76060969ea778e9a79543514a2fa1f45a0d2ea3a))
9
+
10
+ ## [1.3.15](https://github.com/KarinJS/Karin/compare/core-v1.3.14...core-v1.3.15) (2025-02-23)
11
+
12
+
13
+ ### 🐛 Bug Fixes
14
+
15
+ * 补充api 获取本地插件列表 ([181daf6](https://github.com/KarinJS/Karin/commit/181daf6e8ac3ca7acb41853c51e21d2c4d1b7310))
16
+ * 重构插件配置页面 ([47f423e](https://github.com/KarinJS/Karin/commit/47f423e37e748dee9c83ee6fa38c913e1d126545))
17
+
18
+
19
+ ### 💄 Styles
20
+
21
+ * 手风琴pro ([1cc4085](https://github.com/KarinJS/Karin/commit/1cc40855c88e67be5f9cb5bd993fc9db9ddce24a))
22
+
23
+
24
+ ### ✅ Tests
25
+
26
+ * 重构插件配置组件 ([e49fde0](https://github.com/KarinJS/Karin/commit/e49fde0dae4c97e7f720e8dfa849362eef38a33e))
27
+
3
28
  ## [1.3.14](https://github.com/KarinJS/Karin/compare/core-v1.3.13...core-v1.3.14) (2025-02-18)
4
29
 
5
30
 
package/dist/index.d.ts CHANGED
@@ -9999,6 +9999,8 @@ interface ComponentProps {
9999
9999
  description?: string;
10000
10000
  /** 每个渲染的组件都包裹了一个div,这里可以自定义这个div的className */
10001
10001
  className?: string;
10002
+ /** 组件本身的className */
10003
+ componentClassName?: string;
10002
10004
  }
10003
10005
 
10004
10006
  /**
@@ -10014,35 +10016,6 @@ interface DividerProps extends ComponentProps {
10014
10016
  descPosition?: number;
10015
10017
  }
10016
10018
 
10017
- /**
10018
- * 输入类型枚举
10019
- */
10020
- declare enum InputDataType {
10021
- /** 字符串 */
10022
- STRING = "string",
10023
- /** 数字 */
10024
- NUMBER = "number",
10025
- /** 布尔值 */
10026
- BOOLEAN = "boolean",
10027
- /** 日期 */
10028
- DATE = "date",
10029
- /** 时间 */
10030
- TIME = "time",
10031
- /** 日期时间 */
10032
- DATETIME = "datetime",
10033
- /** 邮箱 */
10034
- EMAIL = "email",
10035
- /** URL */
10036
- URL = "url",
10037
- /** 电话 */
10038
- TEL = "tel",
10039
- /** 密码 */
10040
- PASSWORD = "password",
10041
- /** 颜色 */
10042
- COLOR = "color",
10043
- /** JSON */
10044
- JSON = "json"
10045
- }
10046
10019
  /**
10047
10020
  * 验证规则接口
10048
10021
  */
@@ -10101,6 +10074,8 @@ interface InputProps extends ComponentProps {
10101
10074
  radius?: 'none' | 'sm' | 'md' | 'lg' | 'full';
10102
10075
  /** 标签 */
10103
10076
  label?: string;
10077
+ /** 值 */
10078
+ value?: string;
10104
10079
  /** 默认值 */
10105
10080
  defaultValue?: string;
10106
10081
  /** 提示信息 */
@@ -10137,14 +10112,14 @@ interface InputProps extends ComponentProps {
10137
10112
  isInvalid?: boolean;
10138
10113
  /** 禁用动画 */
10139
10114
  disableAnimation?: boolean;
10140
- /** 类名 */
10141
- classNames?: Partial<Record<'base' | 'label' | 'inputWrapper' | 'innerWrapper' | 'mainWrapper' | 'input' | 'clearButton' | 'helperWrapper' | 'description' | 'errorMessage', string>>;
10142
10115
  /** 自定义字段 验证规则 */
10143
10116
  rules?: ValidationRule[];
10144
10117
  /** 自定义字段 输入框宽度 */
10145
10118
  width?: string;
10146
10119
  /** 自定义字段 输入框高度 */
10147
10120
  height?: string;
10121
+ /** 自动补全 */
10122
+ autoComplete?: string;
10148
10123
  }
10149
10124
  /**
10150
10125
  * 输入框组类型
@@ -10155,14 +10130,16 @@ interface InputGroupProps extends ComponentProps {
10155
10130
  label?: string;
10156
10131
  /** 输入框模板 */
10157
10132
  template: InputProps;
10133
+ /** 数据 */
10134
+ data: string[];
10158
10135
  /** 输入框一行最多显示多少个 默认3个 */
10159
10136
  itemsPerRow?: number;
10160
10137
  /** 输入框最大显示多少行 超出后滚动 默认3行 */
10161
10138
  maxRows?: number;
10162
10139
  /** 输入框最大输入框数量 默认100 0不限制 */
10163
10140
  maxInputs?: number;
10164
- /** 数据 */
10165
- data: string[];
10141
+ /** 删除输入框提示 默认: 删除成功 */
10142
+ deleteSuccessTips?: string;
10166
10143
  }
10167
10144
 
10168
10145
  /**
@@ -10194,6 +10171,8 @@ interface SwitchProps extends ComponentProps {
10194
10171
  isDisabled?: boolean;
10195
10172
  /** 是否禁用动画 */
10196
10173
  disableAnimation?: boolean;
10174
+ /** 标签 */
10175
+ label?: string;
10197
10176
  }
10198
10177
 
10199
10178
  /**
@@ -10337,7 +10316,109 @@ interface Radio extends ComponentProps {
10337
10316
  disableAnimation?: boolean;
10338
10317
  }
10339
10318
 
10319
+ /**
10320
+ * 手风琴(折叠面板) 类型
10321
+ */
10322
+ interface Accordion extends ComponentProps {
10323
+ /** 标签 */
10324
+ label?: string;
10325
+ /** 子组件 */
10326
+ children?: AccordionItemProps[];
10327
+ /** 标题 */
10328
+ title?: string;
10329
+ /**
10330
+ * 样式
10331
+ * - light: 浅色
10332
+ * - shadow: 阴影
10333
+ * - bordered: 边框
10334
+ * - splitted: 分割
10335
+ */
10336
+ variant?: 'light' | 'shadow' | 'bordered' | 'splitted';
10337
+ /**
10338
+ * 选择模式
10339
+ * - none: 无
10340
+ * - single: 单选
10341
+ * - multiple: 多选
10342
+ */
10343
+ selectionMode?: 'none' | 'single' | 'multiple';
10344
+ /**
10345
+ * 选择行为
10346
+ * - toggle: 切换
10347
+ * - replace: 替换
10348
+ */
10349
+ selectionBehavior?: 'toggle' | 'replace';
10350
+ /** 是否所有 Accordion 项目都应缩小 */
10351
+ isCompact?: boolean;
10352
+ /** 是否禁用 */
10353
+ isDisabled?: boolean;
10354
+ /** 是否在每个手风琴项目的底部显示分隔线 */
10355
+ showDivider?: boolean;
10356
+ /** 是否隐藏指示器 */
10357
+ hideIndicator?: boolean;
10358
+ /** 是否禁用动画 */
10359
+ disableAnimation?: boolean;
10360
+ /** 是否禁用指示器动画 */
10361
+ disableIndicatorAnimation?: boolean;
10362
+ /** 是否不允许空选择 */
10363
+ disallowEmptySelection?: boolean;
10364
+ /** 是否保持内容挂载 */
10365
+ keepContentMounted?: boolean;
10366
+ /** 是否全宽 */
10367
+ fullWidth?: boolean;
10368
+ /** 禁用的键 */
10369
+ disabledKeys?: string[];
10370
+ /** 选中项 */
10371
+ selectedKeys?: string[];
10372
+ /** 默认选中项 */
10373
+ defaultSelectedKeys?: string[];
10374
+ }
10375
+ /**
10376
+ * 手风琴子组件类型 `也就是每一项手风琴`
10377
+ */
10378
+ interface AccordionItemProps extends ComponentProps {
10379
+ componentType: 'accordion-item';
10380
+ /** 子组件 */
10381
+ children: Children[];
10382
+ /** 标题 */
10383
+ title?: string;
10384
+ /** 副标题 */
10385
+ subtitle?: string;
10386
+ /** 折叠项展开指示器,通常为箭头图标 */
10387
+ indicator?: boolean;
10388
+ /** 折叠项开始内容,通常是图标或头像 */
10389
+ /** 折叠项结束内容,通常是图标或头像 */
10390
+ /** 用于修改 framer 运动动画的 props。使用 variants API 创建您自己的动画 */
10391
+ /** 是否紧凑模式 */
10392
+ isCompact?: boolean;
10393
+ /** 是否禁用 */
10394
+ isDisabled?: boolean;
10395
+ /** 关闭时是否保持挂载 AccordionItem 内容 */
10396
+ keepContentMounted?: boolean;
10397
+ /** 是否隐藏 AccordionItem 指示器 */
10398
+ hideIndicator?: boolean;
10399
+ /** 是否禁用 AccordionItem 动画 */
10400
+ disableAnimation?: boolean;
10401
+ /** 是否禁用 AccordionItem 指示器动画 */
10402
+ disableIndicatorAnimation?: boolean;
10403
+ }
10404
+ /** 手风琴 */
10405
+ interface AccordionProps extends Accordion {
10406
+ componentType: 'accordion';
10407
+ }
10408
+ /**
10409
+ * 手风琴Pro
10410
+ */
10411
+ interface AccordionProProps extends Omit<Accordion, 'children'> {
10412
+ componentType: 'accordion-pro';
10413
+ /** 渲染数据 */
10414
+ data: Record<string, any>[];
10415
+ /** 子组件 pro只有一个 因为是模板 */
10416
+ children: Omit<AccordionItemProps, 'componentType'>;
10417
+ }
10418
+
10340
10419
  type Children = InputProps | SwitchProps | DividerProps | CheckboxProps | CheckboxGroupProps | RadioGroupProps | InputGroupProps;
10420
+ /** 组件配置类型 */
10421
+ type ComponentConfig = InputProps | SwitchProps | RadioGroupProps | CheckboxGroupProps | AccordionProps | AccordionProProps | AccordionItemProps | DividerProps | InputGroupProps;
10341
10422
 
10342
10423
  type Option = {
10343
10424
  label: string;
@@ -10475,106 +10556,6 @@ type AccordionProResult = AccordionResult;
10475
10556
  */
10476
10557
  type SaveResult = InputResult | SwitchResult | RadioResult | CheckboxResult | AccordionResult | AccordionProResult;
10477
10558
 
10478
- /**
10479
- * 手风琴(折叠面板) 类型
10480
- */
10481
- interface Accordion extends ComponentProps {
10482
- /** 标签 */
10483
- label?: string;
10484
- /** 子组件 */
10485
- children?: AccordionItemProps[];
10486
- /** 标题 */
10487
- title?: string;
10488
- /**
10489
- * 样式
10490
- * - light: 浅色
10491
- * - shadow: 阴影
10492
- * - bordered: 边框
10493
- * - splitted: 分割
10494
- */
10495
- variant?: 'light' | 'shadow' | 'bordered' | 'splitted';
10496
- /**
10497
- * 选择模式
10498
- * - none: 无
10499
- * - single: 单选
10500
- * - multiple: 多选
10501
- */
10502
- selectionMode?: 'none' | 'single' | 'multiple';
10503
- /**
10504
- * 选择行为
10505
- * - toggle: 切换
10506
- * - replace: 替换
10507
- */
10508
- selectionBehavior?: 'toggle' | 'replace';
10509
- /** 是否所有 Accordion 项目都应缩小 */
10510
- isCompact?: boolean;
10511
- /** 是否禁用 */
10512
- isDisabled?: boolean;
10513
- /** 是否在每个手风琴项目的底部显示分隔线 */
10514
- showDivider?: boolean;
10515
- /** 是否隐藏指示器 */
10516
- hideIndicator?: boolean;
10517
- /** 是否禁用动画 */
10518
- disableAnimation?: boolean;
10519
- /** 是否禁用指示器动画 */
10520
- disableIndicatorAnimation?: boolean;
10521
- /** 是否不允许空选择 */
10522
- disallowEmptySelection?: boolean;
10523
- /** 是否保持内容挂载 */
10524
- keepContentMounted?: boolean;
10525
- /** 是否全宽 */
10526
- fullWidth?: boolean;
10527
- /** 禁用的键 */
10528
- disabledKeys?: string[];
10529
- /** 选中项 */
10530
- selectedKeys?: string[];
10531
- /** 默认选中项 */
10532
- defaultSelectedKeys?: string[];
10533
- }
10534
- /**
10535
- * 手风琴子组件类型 `也就是每一项手风琴`
10536
- */
10537
- interface AccordionItemProps extends ComponentProps {
10538
- componentType: 'accordion-item';
10539
- /** 子组件 */
10540
- children: Children[];
10541
- /** 标题 */
10542
- title?: string;
10543
- /** 副标题 */
10544
- subtitle?: string;
10545
- /** 折叠项展开指示器,通常为箭头图标 */
10546
- indicator?: boolean;
10547
- /** 折叠项开始内容,通常是图标或头像 */
10548
- /** 折叠项结束内容,通常是图标或头像 */
10549
- /** 用于修改 framer 运动动画的 props。使用 variants API 创建您自己的动画 */
10550
- /** 是否紧凑模式 */
10551
- isCompact?: boolean;
10552
- /** 是否禁用 */
10553
- isDisabled?: boolean;
10554
- /** 关闭时是否保持挂载 AccordionItem 内容 */
10555
- keepContentMounted?: boolean;
10556
- /** 是否隐藏 AccordionItem 指示器 */
10557
- hideIndicator?: boolean;
10558
- /** 是否禁用 AccordionItem 动画 */
10559
- disableAnimation?: boolean;
10560
- /** 是否禁用 AccordionItem 指示器动画 */
10561
- disableIndicatorAnimation?: boolean;
10562
- }
10563
- /** 手风琴 */
10564
- interface AccordionProps extends Accordion {
10565
- componentType: 'accordion';
10566
- }
10567
- /**
10568
- * 手风琴Pro
10569
- */
10570
- interface AccordionProProps extends Omit<Accordion, 'children'> {
10571
- componentType: 'accordion-pro';
10572
- /** 渲染数据 */
10573
- data: Record<string, any>[];
10574
- /** 子组件 pro只有一个 因为是模板 */
10575
- children?: Omit<AccordionItemProps, 'componentType'>;
10576
- }
10577
-
10578
10559
  /**
10579
10560
  * 手风琴组件
10580
10561
  */
@@ -11134,6 +11115,54 @@ interface PluginUpdateInfo extends PluginLists {
11134
11115
  updateCount?: number;
11135
11116
  }
11136
11117
 
11118
+ /** 本地插件列表 请自行添加[] */
11119
+ interface LocalApiResponse {
11120
+ /** 插件id */
11121
+ id: string;
11122
+ /** 是否存在配置文件 无需配置 */
11123
+ hasConfig?: boolean;
11124
+ /** 插件类型 无需配置 */
11125
+ type?: 'git' | 'npm' | 'app';
11126
+ /** 插件名称 前端优先展示 */
11127
+ name?: string;
11128
+ /** 插件版本 可不填 会自动读取package.json中的version */
11129
+ version?: string;
11130
+ /** 插件描述 可不填 会自动读取package.json中的version */
11131
+ description?: string;
11132
+ /** 插件作者 */
11133
+ author?: {
11134
+ /** 名字 */
11135
+ name?: string;
11136
+ /** 主页 */
11137
+ home?: string;
11138
+ /** 头像 */
11139
+ avatar?: string;
11140
+ }[];
11141
+ /** 插件图标 前端优先展示 */
11142
+ icon?: {
11143
+ /** 图标名称 */
11144
+ name?: string;
11145
+ /** 图标大小 */
11146
+ size?: number;
11147
+ /** 图标颜色 */
11148
+ color?: string;
11149
+ };
11150
+ }
11151
+ /** 获取配置请求参数 */
11152
+ interface GetConfigRequest {
11153
+ /** 插件名称 */
11154
+ name: string;
11155
+ /** 插件类型 */
11156
+ type: 'git' | 'npm' | 'app';
11157
+ }
11158
+ /** 获取配置响应 */
11159
+ interface GetConfigResponse {
11160
+ /** 组件配置参数 */
11161
+ options: ComponentConfig[];
11162
+ /** 插件信息 */
11163
+ info: LocalApiResponse;
11164
+ }
11165
+
11137
11166
  /**
11138
11167
  * @public
11139
11168
  * @description 日志管理器
@@ -11155,4 +11184,4 @@ declare let level: ReturnType<typeof createLevelDB>;
11155
11184
  */
11156
11185
  declare const start: () => Promise<void>;
11157
11186
 
11158
- export { type Accept, type AccordionItemProps, type AccordionKV, type AccordionProProps, type AccordionProResult, type AccordionProps, type AccordionResult, type AccountInfo, type Adapter, AdapterBase, type AdapterCommunication, type AdapterInfo, AdapterOneBot, type AdapterOptions, type AdapterPlatform, type AdapterProtocol, type AdapterStandard, type AdapterType, type Adapters, type AllPluginMethods, type AnonymousSegment, type Apps, type ArrayField, type AtElement, type AtSegment, type BaseContact, BaseEvent, type BaseEventOptions, type BaseEventType, type BasketballElement, Bot, type BoundingBox, type BubbleFaceElement, type Button, type ButtonElement, type Cache, type CacheEntry, type CheckboxField, type CheckboxGroupProps, type CheckboxProps, type CheckboxResult, type Children, type CmdFnc, type Command, type CommandClass, type ComponentProps, type ComponentType, type Components, type ComponentsClass, type Config, type Contact, type ContactElement, type ContactSegment, type Count, type CreateGroupFolderResponse, type CustomMusicElement, type CustomMusicSegment, type CustomNodeElement, type CustomNodeSegments, type DbStreamStatus, type DbStreams, type DiceElement, type DiceSegment, type DirectContact, DirectMessage, type DirectMessageOptions, type DirectNodeElement, type DirectNodeSegment, type DirectSender, type DividerField, type DividerProps, type DownloadFileOptions, type DownloadFileResponse, EVENT_COUNT, type ElementTypes, type Elements, type Env, type Event, type EventParent, type EventToSubEvent, type ExecOptions, type ExecReturn, type ExecType, FILE_CHANGE, type FaceElement, type FaceSegment, type FieldType, type FileElement, type FileList, type FileListMap, type FileSegment, type FileToUrlHandler, type FileToUrlResult, type FormField, type ForwardOptions, type ForwardSegment, type FriendContact, type FriendData, FriendDecreaseNotice, type FriendDecreaseOptions, FriendIncreaseNotice, type FriendIncreaseOptions, FriendMessage, type FriendMessageOptions, type FriendNoticeEventMap, type FriendRequestEventMap, type FriendRequestOptions, type FriendSender, type GetAtAllCountResponse, type GetBot, type GetGroupFileListResponse, type GetGroupFileSystemInfoResponse, type GetGroupHighlightsResponse, type GetGroupInfo, type GetGroupMemberInfo, type GetGroupMuteListResponse, type GetMsg, type GetPluginReturn, type GetPluginType, type GiftElement, 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, type Handler, type HandlerType, type HonorInfoList, type ImageElement, type ImageSegment, InputDataType, type InputGroupProps, type InputProps, type InputResult, type JsonElement, type JsonSegment, type KarinButton, type KeyboardElement, type LocationElement, type LocationSegment, type Log, type Logger, type LoggerExpand, type LoggerLevel, type LoggerOptions, type LongMsgElement, type MarkdownElement, type MarkdownTplElement, type MarketFaceElement, type Message$2 as Message, MessageBase, type MessageEventMap, type MessageEventSub, type MessageOptions, type MessageResponse, type MetaEventBase, type MusicElement, type MusicPlatform, type MusicSegment, type NodeElement, type Notice, type NoticeAndRequest, NoticeBase, type NoticeEventMap, type NoticeEventSub, type NoticeOptions, type NumberField, type OB11AllEvent, OB11ApiAction, type OB11ApiParams, type OB11ApiRequest, OB11Event, type OB11EventBase, type OB11FriendSender, type OB11GroupMessage, type OB11GroupSender, type OB11GroupTempMessage, type OB11Message, OB11MessageSubType, OB11MessageType, type OB11Meta, type OB11NodeSegment, type OB11Notice, type OB11NoticeBaseType, OB11NoticeType, type OB11OtherFriendMessage, type OB11PrivateMessage, type OB11Request, type OB11RequestBaseType, OB11RequestType, type OB11Segment, type OB11SegmentBase, type OB11SegmentType, OB11Sex, type OB11serInfo, type ObjectArrayField, type ObjectField, type OneBot11FriendAdd, type OneBot11FriendRecall, type OneBot11FriendRequest, type OneBot11GroupAdmin, type OneBot11GroupBan, type OneBot11GroupCard, type OneBot11GroupDecrease, type OneBot11GroupEssence, type OneBot11GroupIncrease, type OneBot11GroupMessageReaction, type OneBot11GroupMessageReactionLagrange, type OneBot11GroupRecall, type OneBot11GroupRequest, type OneBot11GroupUpload, type OneBot11Heartbeat, type OneBot11Honor, type OneBot11Lifecycle, type OneBot11LuckyKing, type OneBot11Poke, type OnlinePluginInfo, type Option, type Options, type PM2, type Package, type Parser, type PasmsgElement, type Permission, type PkgData, type PkgInfo, Plugin, type PluginFile, type PluginFncTypes, type PluginLists, type PluginOptions, type PluginRule, type PluginUpdateInfo, type Point, type PokeSegment, 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, type Radio, type RadioField, type RadioGroupProps, type RadioResult, type RawElement, type ReadyMusicElement, ReceiveLikeNotice, type ReceiveLikeOptions, type RecordElement, type RecordSegment, type Redis, type Render, type RenderResult, Renderer, type Renders, type Reply, type ReplyElement, type ReplySegment, type Request, RequestBase, type RequestEventMap, type RequestEventSub, type RequestOptions, type RequireFunction, type RequireFunctionSync, type RequireOptions, type Role, type RpsElement, type RpsSegment, SEND_MSG, type SandBoxAccountInfo, type SandboxMsgRecord, type SandboxSendApi, type SandboxSendSendFriendMsg, type SandboxSendSendGroupMsg, type SandboxSendSendMsg, type SaveResult, type Scene, type ScreenshotClip, type ScreenshotOptions, type SectionField, type Segment, type SelectField, type SendElement, type SendForwardMessageResponse, type SendMessage, type SendMsgResults, type Sender, type SenderBase, type SenderGroup, type Sex, type ShakeSegment, type ShareElement, type ShareSegment, type SrcReply, type SwitchField, type SwitchProps, type SwitchResult, type Task, type TextElement, type TextField, type TextSegment, type TitleField, type UnregisterBot, type UserInfo, type ValidationRule, type ValueType, type VideoElement, type VideoSegment, type WaitForOptions, Watch, Watcher, type WeatherElement, type XmlElement, type XmlSegment, type YamlComment, YamlEditor, type YamlValue, absPath, accordion, accordionItem, accordionPro, app, applyComments, base64, buffer, buttonHandle, callRender, changelog, checkGitPluginUpdate, checkPkgUpdate, clearRequire, clearRequireFile, comment, index$1 as common, components, index as config, contact, contactDirect, contactFriend, contactGroup, contactGroupTemp, contactGuild, copyConfig, copyConfigSync, copyFiles, copyFilesSync, createDirectMessage, createFriendDecreaseNotice, createFriendIncreaseNotice, createFriendMessage, createGroupAdminChangedNotice, createGroupApplyRequest, createGroupCardChangedNotice, createGroupFileUploadedNotice, createGroupHlightsChangedNotice, createGroupHonorChangedNotice, createGroupInviteRequest, createGroupLuckKingNotice, createGroupMemberAddNotice, createGroupMemberBanNotice, createGroupMemberDelNotice, createGroupMemberTitleUpdatedNotice, createGroupMessage, createGroupMessageReactionNotice, createGroupPokeNotice, createGroupRecallNotice, createGroupSignInNotice, createGroupTempMessage, createGroupWholeBanNotice, createGuildMessage, createInnerLogger, createPluginDir, createPrivateApplyRequest, createPrivateFileUploadedNotice, createPrivatePokeNotice, createPrivateRecallNotice, createRawMessage, createReceiveLikeNotice, debug, karin as default, divider, downFile, errorToString, exec, existToMkdir, existToMkdirSync, exists, existsSync, ffmpeg, ffplay, ffprobe, fs as file, fileToUrl, fileToUrlHandlerKey, filesByExt, formatTime$1 as formatTime, index$3 as fs, getAllBot, getAllBotID, getAllBotList, getBot, getBotCount, getCommit, getFiles, getHash, getPid, getPkgVersion, getPluginInfo, getPlugins, getRelPath, getRemotePkgVersion, getRender, getRenderCount, getRenderList, getRequestIp, getTime, handler$1 as handler, importModule, initOneBot, input, isClass, isDir, isDirSync, isDocker, isFile, isFileSync, isIPv4Loop, isIPv6Loop, isLinux, isLocalRequest, isLoopback, isMac, isPlugin, isRoot, isStatic, isSubPath, isWin, json$1 as json, karin, karinToQQBot, key, level, lock, lockMethod, lockProp, log, logger, logs, makeForward, makeMessage, type messageType, mkdir, mkdirSync, parseChangelog, pkgRoot, qqbotToKarin, randomStr, range, read, readFile, readJson, readJsonSync, redis, registerBot, registerRender, render, renderHtml, renderMultiHtml, requireFile, requireFileSync, restart, restartDirect, rmSync, save, type screenshot, segment, sendMsg, sender, senderDirect, senderFriend, senderGroup, senderGroupTemp, senderGuild, sep, server, splitPath, start, stream, stringifyError, switchComponent, index$2 as system, unregisterBot, unregisterRender, updateAllGitPlugin, updateAllPkg, updateGitPlugin, updatePkg, uptime$1 as uptime, urlToPath, watch, watchAndMerge, write, writeJson, writeJsonSync, yaml };
11187
+ export { type Accept, type AccordionItemProps, type AccordionKV, type AccordionProProps, type AccordionProResult, type AccordionProps, type AccordionResult, type AccountInfo, type Adapter, AdapterBase, type AdapterCommunication, type AdapterInfo, AdapterOneBot, type AdapterOptions, type AdapterPlatform, type AdapterProtocol, type AdapterStandard, type AdapterType, type Adapters, type AllPluginMethods, type AnonymousSegment, type Apps, type ArrayField, type AtElement, type AtSegment, type BaseContact, BaseEvent, type BaseEventOptions, type BaseEventType, type BasketballElement, Bot, type BoundingBox, type BubbleFaceElement, type Button, type ButtonElement, type Cache, type CacheEntry, type CheckboxField, type CheckboxGroupProps, type CheckboxProps, type CheckboxResult, type Children, type CmdFnc, type Command, type CommandClass, type ComponentConfig, type ComponentProps, type ComponentType, type Components, type ComponentsClass, type Config, type Contact, type ContactElement, type ContactSegment, type Count, type CreateGroupFolderResponse, type CustomMusicElement, type CustomMusicSegment, type CustomNodeElement, type CustomNodeSegments, type DbStreamStatus, type DbStreams, type DiceElement, type DiceSegment, type DirectContact, DirectMessage, type DirectMessageOptions, type DirectNodeElement, type DirectNodeSegment, type DirectSender, type DividerField, type DividerProps, type DownloadFileOptions, type DownloadFileResponse, EVENT_COUNT, type ElementTypes, type Elements, type Env, type Event, type EventParent, type EventToSubEvent, type ExecOptions, type ExecReturn, type ExecType, FILE_CHANGE, type FaceElement, type FaceSegment, type FieldType, type FileElement, type FileList, type FileListMap, type FileSegment, type FileToUrlHandler, type FileToUrlResult, type FormField, type ForwardOptions, type ForwardSegment, type FriendContact, type FriendData, FriendDecreaseNotice, type FriendDecreaseOptions, FriendIncreaseNotice, type FriendIncreaseOptions, FriendMessage, type FriendMessageOptions, type FriendNoticeEventMap, type FriendRequestEventMap, type FriendRequestOptions, type FriendSender, type GetAtAllCountResponse, type GetBot, type GetConfigRequest, type GetConfigResponse, type GetGroupFileListResponse, type GetGroupFileSystemInfoResponse, type GetGroupHighlightsResponse, type GetGroupInfo, type GetGroupMemberInfo, type GetGroupMuteListResponse, type GetMsg, type GetPluginReturn, type GetPluginType, type GiftElement, 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, type Handler, type HandlerType, type HonorInfoList, type ImageElement, type ImageSegment, type InputGroupProps, type InputProps, type InputResult, type JsonElement, type JsonSegment, type KarinButton, type KeyboardElement, type LocalApiResponse, type LocationElement, type LocationSegment, type Log, type Logger, type LoggerExpand, type LoggerLevel, type LoggerOptions, type LongMsgElement, type MarkdownElement, type MarkdownTplElement, type MarketFaceElement, type Message$2 as Message, MessageBase, type MessageEventMap, type MessageEventSub, type MessageOptions, type MessageResponse, type MetaEventBase, type MusicElement, type MusicPlatform, type MusicSegment, type NodeElement, type Notice, type NoticeAndRequest, NoticeBase, type NoticeEventMap, type NoticeEventSub, type NoticeOptions, type NumberField, type OB11AllEvent, OB11ApiAction, type OB11ApiParams, type OB11ApiRequest, OB11Event, type OB11EventBase, type OB11FriendSender, type OB11GroupMessage, type OB11GroupSender, type OB11GroupTempMessage, type OB11Message, OB11MessageSubType, OB11MessageType, type OB11Meta, type OB11NodeSegment, type OB11Notice, type OB11NoticeBaseType, OB11NoticeType, type OB11OtherFriendMessage, type OB11PrivateMessage, type OB11Request, type OB11RequestBaseType, OB11RequestType, type OB11Segment, type OB11SegmentBase, type OB11SegmentType, OB11Sex, type OB11serInfo, type ObjectArrayField, type ObjectField, type OneBot11FriendAdd, type OneBot11FriendRecall, type OneBot11FriendRequest, type OneBot11GroupAdmin, type OneBot11GroupBan, type OneBot11GroupCard, type OneBot11GroupDecrease, type OneBot11GroupEssence, type OneBot11GroupIncrease, type OneBot11GroupMessageReaction, type OneBot11GroupMessageReactionLagrange, type OneBot11GroupRecall, type OneBot11GroupRequest, type OneBot11GroupUpload, type OneBot11Heartbeat, type OneBot11Honor, type OneBot11Lifecycle, type OneBot11LuckyKing, type OneBot11Poke, type OnlinePluginInfo, type Option, type Options, type PM2, type Package, type Parser, type PasmsgElement, type Permission, type PkgData, type PkgInfo, Plugin, type PluginFile, type PluginFncTypes, type PluginLists, type PluginOptions, type PluginRule, type PluginUpdateInfo, type Point, type PokeSegment, 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, type Radio, type RadioField, type RadioGroupProps, type RadioResult, type RawElement, type ReadyMusicElement, ReceiveLikeNotice, type ReceiveLikeOptions, type RecordElement, type RecordSegment, type Redis, type Render, type RenderResult, Renderer, type Renders, type Reply, type ReplyElement, type ReplySegment, type Request, RequestBase, type RequestEventMap, type RequestEventSub, type RequestOptions, type RequireFunction, type RequireFunctionSync, type RequireOptions, type Role, type RpsElement, type RpsSegment, SEND_MSG, type SandBoxAccountInfo, type SandboxMsgRecord, type SandboxSendApi, type SandboxSendSendFriendMsg, type SandboxSendSendGroupMsg, type SandboxSendSendMsg, type SaveResult, type Scene, type ScreenshotClip, type ScreenshotOptions, type SectionField, type Segment, type SelectField, type SendElement, type SendForwardMessageResponse, type SendMessage, type SendMsgResults, type Sender, type SenderBase, type SenderGroup, type Sex, type ShakeSegment, type ShareElement, type ShareSegment, type SrcReply, type SwitchField, type SwitchProps, type SwitchResult, type Task, type TextElement, type TextField, type TextSegment, type TitleField, type UnregisterBot, type UserInfo, type ValidationRule, type ValueType, type VideoElement, type VideoSegment, type WaitForOptions, Watch, Watcher, type WeatherElement, type XmlElement, type XmlSegment, type YamlComment, YamlEditor, type YamlValue, absPath, accordion, accordionItem, accordionPro, app, applyComments, base64, buffer, buttonHandle, callRender, changelog, checkGitPluginUpdate, checkPkgUpdate, clearRequire, clearRequireFile, comment, index$1 as common, components, index as config, contact, contactDirect, contactFriend, contactGroup, contactGroupTemp, contactGuild, copyConfig, copyConfigSync, copyFiles, copyFilesSync, createDirectMessage, createFriendDecreaseNotice, createFriendIncreaseNotice, createFriendMessage, createGroupAdminChangedNotice, createGroupApplyRequest, createGroupCardChangedNotice, createGroupFileUploadedNotice, createGroupHlightsChangedNotice, createGroupHonorChangedNotice, createGroupInviteRequest, createGroupLuckKingNotice, createGroupMemberAddNotice, createGroupMemberBanNotice, createGroupMemberDelNotice, createGroupMemberTitleUpdatedNotice, createGroupMessage, createGroupMessageReactionNotice, createGroupPokeNotice, createGroupRecallNotice, createGroupSignInNotice, createGroupTempMessage, createGroupWholeBanNotice, createGuildMessage, createInnerLogger, createPluginDir, createPrivateApplyRequest, createPrivateFileUploadedNotice, createPrivatePokeNotice, createPrivateRecallNotice, createRawMessage, createReceiveLikeNotice, debug, karin as default, divider, downFile, errorToString, exec, existToMkdir, existToMkdirSync, exists, existsSync, ffmpeg, ffplay, ffprobe, fs as file, fileToUrl, fileToUrlHandlerKey, filesByExt, formatTime$1 as formatTime, index$3 as fs, getAllBot, getAllBotID, getAllBotList, getBot, getBotCount, getCommit, getFiles, getHash, getPid, getPkgVersion, getPluginInfo, getPlugins, getRelPath, getRemotePkgVersion, getRender, getRenderCount, getRenderList, getRequestIp, getTime, handler$1 as handler, importModule, initOneBot, input, isClass, isDir, isDirSync, isDocker, isFile, isFileSync, isIPv4Loop, isIPv6Loop, isLinux, isLocalRequest, isLoopback, isMac, isPlugin, isRoot, isStatic, isSubPath, isWin, json$1 as json, karin, karinToQQBot, key, level, lock, lockMethod, lockProp, log, logger, logs, makeForward, makeMessage, type messageType, mkdir, mkdirSync, parseChangelog, pkgRoot, qqbotToKarin, randomStr, range, read, readFile, readJson, readJsonSync, redis, registerBot, registerRender, render, renderHtml, renderMultiHtml, requireFile, requireFileSync, restart, restartDirect, rmSync, save, type screenshot, segment, sendMsg, sender, senderDirect, senderFriend, senderGroup, senderGroupTemp, senderGuild, sep, server, splitPath, start, stream, stringifyError, switchComponent, index$2 as system, unregisterBot, unregisterRender, updateAllGitPlugin, updateAllPkg, updateGitPlugin, updatePkg, uptime$1 as uptime, urlToPath, watch, watchAndMerge, write, writeJson, writeJsonSync, yaml };
package/dist/index.js CHANGED
@@ -14,9 +14,9 @@ var __export = (target, all) => {
14
14
  __defProp(target, name, { get: all[name], enumerable: true });
15
15
  };
16
16
 
17
- // ../../node_modules/.pnpm/tsup@8.3.6_tsx@4.19.2_typescript@5.7.3/node_modules/tsup/assets/esm_shims.js
17
+ // ../../node_modules/.pnpm/tsup@8.3.6_tsx@4.19.3_typescript@5.7.3/node_modules/tsup/assets/esm_shims.js
18
18
  var init_esm_shims = __esm({
19
- "../../node_modules/.pnpm/tsup@8.3.6_tsx@4.19.2_typescript@5.7.3/node_modules/tsup/assets/esm_shims.js"() {
19
+ "../../node_modules/.pnpm/tsup@8.3.6_tsx@4.19.3_typescript@5.7.3/node_modules/tsup/assets/esm_shims.js"() {
20
20
  "use strict";
21
21
  }
22
22
  });
@@ -268,7 +268,7 @@ var init_logger2 = __esm({
268
268
  });
269
269
 
270
270
  // src/env/index.ts
271
- var isWin, isDev, isTsx, setProcessEnv, setVersion, setRuntime;
271
+ var isWin, isDev, isTsx, isTs, setProcessEnv, setVersion, setRuntime;
272
272
  var init_env = __esm({
273
273
  "src/env/index.ts"() {
274
274
  "use strict";
@@ -276,6 +276,7 @@ var init_env = __esm({
276
276
  isWin = () => process.platform === "win32";
277
277
  isDev = () => process.env.NODE_ENV === "development";
278
278
  isTsx = () => process.env.RUNTIME === "tsx";
279
+ isTs = () => isTsx();
279
280
  setProcessEnv = (key, value) => {
280
281
  process.env[key] = value + "";
281
282
  return value;
@@ -10022,7 +10023,7 @@ import fs21 from "node:fs";
10022
10023
  import path15 from "node:path";
10023
10024
  import util3 from "node:util";
10024
10025
  import { pathToFileURL } from "node:url";
10025
- var getWebConfigPathFromPkg, getNpmPluginConfigPath, getLocalPluginConfigPath, getConfigPath, loadConfig, getConfig, saveConfig, isConfigExist;
10026
+ var getWebConfigPathFromPkg, getNpmPluginConfigPath, getLocalPluginConfigPath, getConfigPath, loadConfig, getWebConfig, getConfig, saveConfig, isConfigExist;
10026
10027
  var init_config3 = __esm({
10027
10028
  "src/server/api/plugins/config.ts"() {
10028
10029
  "use strict";
@@ -10078,26 +10079,35 @@ var init_config3 = __esm({
10078
10079
  const result = await import(`${pathToFileURL(configPath2).toString()}${isDev() ? "?t=" + Date.now() : ""}`);
10079
10080
  return result.default;
10080
10081
  };
10081
- getConfig = async (req, res) => {
10082
- const options = req.body;
10083
- if (!["git", "npm"].includes(options.type)) {
10084
- createServerErrorResponse(res, "\u4E0D\u652F\u6301\u7684\u63D2\u4EF6\u7C7B\u578B");
10085
- return;
10082
+ getWebConfig = async (type, id, fnc2) => {
10083
+ if (!["git", "npm"].includes(type)) {
10084
+ return null;
10086
10085
  }
10087
- const webConfig = getConfigPath(options);
10086
+ const webConfig = getConfigPath({ type, name: id });
10088
10087
  if (!webConfig) {
10089
- createSuccessResponse(res, null);
10090
- return;
10088
+ return null;
10091
10089
  }
10092
10090
  const baseName = path15.basename(webConfig, path15.extname(webConfig));
10093
10091
  if (baseName !== "web.config") {
10092
+ return null;
10093
+ }
10094
+ return await loadConfig(webConfig);
10095
+ };
10096
+ getConfig = async (req, res) => {
10097
+ const options = req.body;
10098
+ if (!options.type || !options.name) {
10099
+ createServerErrorResponse(res, "\u53C2\u6570\u9519\u8BEF");
10100
+ return;
10101
+ }
10102
+ const config2 = await getWebConfig(options.type, options.name, () => {
10094
10103
  logger.error(`[plugin] \u63D2\u4EF6${options.name}\u7684web\u914D\u7F6E\u6587\u4EF6\u540D\u79F0\u4E0D\u6B63\u786E: \u9700\u8981\u4EE5 web.config \u547D\u540D`);
10095
10104
  createSuccessResponse(res, null);
10096
- return;
10105
+ });
10106
+ if (!config2) {
10107
+ return createServerErrorResponse(res, "\u53C2\u6570\u9519\u8BEF");
10097
10108
  }
10098
10109
  const list2 = [];
10099
- const { components: components2 } = await loadConfig(webConfig);
10100
- let result = components2();
10110
+ let result = config2.components();
10101
10111
  result = util3.types.isPromise(result) ? await result : result;
10102
10112
  result.forEach((item) => {
10103
10113
  if (typeof (item == null ? void 0 : item.toJSON) === "function") {
@@ -10108,12 +10118,16 @@ var init_config3 = __esm({
10108
10118
  }
10109
10119
  }
10110
10120
  });
10111
- createSuccessResponse(res, list2);
10121
+ const data = {
10122
+ options: list2,
10123
+ info: config2.info
10124
+ };
10125
+ createSuccessResponse(res, data);
10112
10126
  };
10113
10127
  saveConfig = async (req, res) => {
10114
10128
  const options = req.body;
10115
10129
  const configPath2 = getConfigPath(options);
10116
- if (!configPath2) return;
10130
+ if (!configPath2) return createServerErrorResponse(res, "\u53C2\u6570\u9519\u8BEF");
10117
10131
  const { save: save2 } = await loadConfig(configPath2);
10118
10132
  const result = save2(options.config);
10119
10133
  const response = util3.types.isPromise(result) ? await result : result;
@@ -10459,6 +10473,62 @@ var init_install = __esm({
10459
10473
  }
10460
10474
  });
10461
10475
 
10476
+ // src/server/api/plugins/local.ts
10477
+ var getLocalList;
10478
+ var init_local = __esm({
10479
+ "src/server/api/plugins/local.ts"() {
10480
+ "use strict";
10481
+ init_esm_shims();
10482
+ init_env();
10483
+ init_config3();
10484
+ init_list();
10485
+ init_router();
10486
+ init_response();
10487
+ getLocalList = async (req, res) => {
10488
+ const { isForce } = req.body;
10489
+ const [npm, git] = await Promise.all([
10490
+ getPlugins("npm", true, isForce ?? false),
10491
+ getPlugins("git", true, isForce ?? false)
10492
+ ]);
10493
+ const list2 = [...npm, ...git];
10494
+ const result = [];
10495
+ await Promise.allSettled(list2.map(async (val) => {
10496
+ var _a, _b;
10497
+ const pkg2 = val.pkgData;
10498
+ if (isTs() && ((_a = pkg2.karin) == null ? void 0 : _a["ts-web"])) {
10499
+ const config2 = await getWebConfig(val.type, val.name);
10500
+ if (config2 && config2.info) {
10501
+ result.push({
10502
+ ...config2.info,
10503
+ id: val.name,
10504
+ version: config2.info.version ?? pkg2.version,
10505
+ description: config2.info.description ?? pkg2.description,
10506
+ hasConfig: true,
10507
+ type: val.type
10508
+ });
10509
+ }
10510
+ return;
10511
+ }
10512
+ if ((_b = pkg2.karin) == null ? void 0 : _b.web) {
10513
+ const config2 = await getWebConfig(val.type, val.name);
10514
+ if (config2 && config2.info) {
10515
+ result.push({
10516
+ ...config2.info,
10517
+ id: val.name,
10518
+ version: config2.info.version ?? pkg2.version,
10519
+ description: config2.info.description ?? pkg2.description,
10520
+ hasConfig: true,
10521
+ type: val.type
10522
+ });
10523
+ }
10524
+ }
10525
+ }));
10526
+ createSuccessResponse(res, result);
10527
+ };
10528
+ router.post("/plugin/local", getLocalList);
10529
+ }
10530
+ });
10531
+
10462
10532
  // src/server/api/plugins/test-url.ts
10463
10533
  import axios6 from "axios";
10464
10534
  var github, testUrl, githubMirror, speedTest, testGithub;
@@ -11098,6 +11168,7 @@ var init_plugins = __esm({
11098
11168
  init_config3();
11099
11169
  init_admin2();
11100
11170
  init_install();
11171
+ init_local();
11101
11172
  init_test_url();
11102
11173
  init_list();
11103
11174
  init_router();
@@ -16709,7 +16780,8 @@ var init_accordion = __esm({
16709
16780
  ...config2,
16710
16781
  key,
16711
16782
  componentType: "accordion-pro",
16712
- data: config2.data || []
16783
+ data: config2.data || [],
16784
+ children: config2.children
16713
16785
  });
16714
16786
  createAccordionItem = (key, config2 = {}) => ({
16715
16787
  key,
@@ -17958,6 +18030,7 @@ var init_index = __esm({
17958
18030
  init_db2();
17959
18031
  init_render2();
17960
18032
  init_onebot();
18033
+ init_debug2();
17961
18034
  init_root();
17962
18035
  init_service();
17963
18036
  init_karin();