@perk-net/perk-pushplus-sdk 1.2.1 → 1.2.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/dist/index.d.cts CHANGED
@@ -155,7 +155,9 @@ declare enum Channel {
155
155
  /** App 渠道(安卓/鸿蒙/iOS)。 */
156
156
  APP = "app",
157
157
  /** 微信 ClawBot。 */
158
- CLAWBOT = "clawbot"
158
+ CLAWBOT = "clawbot",
159
+ /** QQ 机器人;不带 option 发给自己,option 填配置编码则发到对应 QQ 群。 */
160
+ QQ = "qq"
159
161
  }
160
162
  /**
161
163
  * PushPlus 消息模板枚举。
@@ -511,6 +513,7 @@ interface SendCount {
511
513
  cpSendCount?: number;
512
514
  webhookSendCount?: number;
513
515
  mailSendCount?: number;
516
+ qqBotSendCount?: number;
514
517
  }
515
518
  interface UserLimitTime {
516
519
  /** 1-无限制,2-短期限制,3-永久限制。 */
@@ -722,6 +725,74 @@ interface ClawBotQrCode {
722
725
  url?: string;
723
726
  qrcode?: string;
724
727
  }
728
+ interface QqBotBindLink {
729
+ /** 带参分享链接,用于生成扫码二维码;已绑定用户再次获取时可能为空。 */
730
+ url?: string;
731
+ /** 绑定码。已是好友时扫码收不到加好友事件,需私聊发送该码;认领 QQ 群也用此码。 */
732
+ bindCode?: string;
733
+ /** 有效期秒数,默认 300。 */
734
+ expireSeconds?: number;
735
+ /** 为当前用户分配的官方机器人 appId。 */
736
+ botAppId?: string;
737
+ botName?: string;
738
+ botAvatar?: string;
739
+ }
740
+ interface QqBotInfo {
741
+ botId?: string;
742
+ username?: string;
743
+ avatar?: string;
744
+ appId?: string;
745
+ /** 官方分享链接,可用于拉机器人进群。 */
746
+ shareUrl?: string;
747
+ }
748
+ interface QqBotBindInfo {
749
+ /** 0-未绑定,1-已绑定。 */
750
+ isBind?: number;
751
+ /** 1-可接收,0-用户已关闭单聊接收。 */
752
+ receiveStatus?: number;
753
+ createTime?: string;
754
+ botInfo?: QqBotInfo;
755
+ }
756
+ interface QqGroupItem {
757
+ /** 群编号;新增渠道配置时作为 qqGroupId 使用。 */
758
+ id?: number;
759
+ groupOpenId?: string;
760
+ groupRemark?: string;
761
+ /** 1-在群,2-群消息接收关闭。 */
762
+ status?: number;
763
+ /** 群名称,接口未授权时为空。 */
764
+ groupName?: string;
765
+ groupFingerMemo?: string;
766
+ groupClassText?: string;
767
+ groupTags?: string[];
768
+ groupMemberNum?: number;
769
+ createTime?: string;
770
+ }
771
+ interface QqBotItem {
772
+ id?: number;
773
+ qqName?: string;
774
+ /** 配置编码;发送消息时作为 option 传入。 */
775
+ qqCode?: string;
776
+ /** 2-发到 QQ 群。 */
777
+ sendType?: number;
778
+ qqGroupId?: number;
779
+ groupRemark?: string;
780
+ groupOpenId?: string;
781
+ groupName?: string;
782
+ updateTime?: string;
783
+ }
784
+ interface QqBotSaveRequest {
785
+ /** 修改时必填。 */
786
+ id?: number;
787
+ /** 配置名称,必填,最多 64 个字符。 */
788
+ qqName?: string;
789
+ /** 配置编码,新增必填;仅支持字母、数字、下划线和中划线,创建后不可修改。 */
790
+ qqCode?: string;
791
+ /** 发送类型;留空时 SDK 自动填 2(发到 QQ 群)。 */
792
+ sendType?: number;
793
+ /** QQ 群编号,必填,取自 groupList 返回的 id。 */
794
+ qqGroupId?: number;
795
+ }
725
796
  interface MpItem {
726
797
  id?: number;
727
798
  nickName?: string;
@@ -1511,6 +1582,29 @@ declare class PreApi extends OpenAbstractApi {
1511
1582
  test(req: PreTestRequest): Promise<string>;
1512
1583
  }
1513
1584
 
1585
+ /**
1586
+ * 开放接口 - QQ 机器人(文档「九. QQ机器人接口」)。
1587
+ */
1588
+ declare class QqBotApi extends OpenAbstractApi {
1589
+ constructor(config: ResolvedPushPlusConfig, http: HttpRequester, mgr: AccessKeyManager);
1590
+ /** 1. 获取绑定链接与绑定码;refresh 为 true 时旧绑定码失效并重新生成。 */
1591
+ getBindLink(refresh?: boolean): Promise<QqBotBindLink>;
1592
+ /** 2. 查询绑定状态。 */
1593
+ botInfo(): Promise<QqBotBindInfo>;
1594
+ /** 3. 解绑 QQ 机器人。 */
1595
+ unbind(): Promise<void>;
1596
+ /** 4. 获取机器人已加入的 QQ 群列表。 */
1597
+ groupList(): Promise<QqGroupItem[]>;
1598
+ /** 5. 获取 QQ 机器人渠道配置列表。 */
1599
+ list(q?: PageQuery): Promise<PageResult<QqBotItem>>;
1600
+ /** 6. 新增渠道配置,用于把消息发送到指定 QQ 群;发给自己无需创建配置。 */
1601
+ add(req: QqBotSaveRequest): Promise<void>;
1602
+ /** 7. 修改渠道配置;配置编码不可修改。 */
1603
+ edit(req: QqBotSaveRequest): Promise<void>;
1604
+ /** 8. 删除渠道配置。 */
1605
+ delete(id: number): Promise<void>;
1606
+ }
1607
+
1514
1608
  /**
1515
1609
  * 开放接口 - 功能设置(文档「九. 功能设置接口」)。
1516
1610
  */
@@ -1685,6 +1779,7 @@ declare class PushPlusClient {
1685
1779
  readonly webhook: WebhookApi;
1686
1780
  readonly channel: ChannelApi;
1687
1781
  readonly clawBot: ClawBotApi;
1782
+ readonly qqBot: QqBotApi;
1688
1783
  readonly setting: SettingApi;
1689
1784
  readonly pre: PreApi;
1690
1785
  readonly image: ImageApi;
@@ -1781,4 +1876,4 @@ declare const CallbackParser: {
1781
1876
  parse: typeof parseCallback;
1782
1877
  };
1783
1878
 
1784
- export { AbstractApi, AccessKeyApi, AccessKeyManager, type AccessKeyResult, type ApiResponse, type BatchSendRequest, BatchSendRequestBuilder, type BatchSendResult, CallbackEvent, CallbackParser, type CallbackPayload, Channel, ChannelApi, ClawBotApi, type ClawBotInfo, type ClawBotMessage, type ClawBotQrCode, type CpItem, DEFAULT_BASE_URL, DocApi, type DocContent, type DocListItem, type DocListQuery, type DocVo, ErrorCode, ExcelApi, type ExcelContent, type ExcelVo, type ExcelWriteCellsRequest, FetchHttpRequester, type FileInput, FormApi, type FormCover, type FormDetail, type FormItem, type FormListItem, type FormListQuery, type FormPublishDiff, type FormPublishResult, type FormSaveRequest, type FormSettings, FormStatus, FormStatusDescription, type FormTheme, FriendApi, type FriendBlacklistItem, type FriendInfo, type FriendItem, type FriendQrCode, type HttpRawBody, type HttpRawRequestOptions, type HttpRequestOptions, type HttpRequester, type HttpResponse, ImageApi, type ImageFileInput, type ImageItem, type ImageUploadOptions, type ImageUploadResult, type ImageUploadToken, type MailDetail, type MailItem, MessageApi, type MessageCompleteInfo, type MessageItem, type MessageTokenAddRequest, MessageTokenApi, type MessageTokenEditRequest, type MessageTokenItem, type MessageTokenOption, type MpItem, OpenAbstractApi, OpenMessageApi, type PageQuery, type PageResult, PreApi, type PreDetail, type PreItem, type PreSaveRequest, type PreTestRequest, PushPlusClient, PushPlusClientBuilder, type PushPlusClientOptions, type PushPlusConfig, PushPlusError, PushPlusException, RateLimitGuard, type ResolvedPushPlusConfig, type SendCount, type SendMessageResult, type SendRequest, SendRequestBuilder, SendStatus, SendStatusDescription, SettingApi, ShareLogin, SharePerm, Template, type TopicAddRequest, TopicApi, type TopicDetail, type TopicEditRequest, type TopicItem, type TopicListQuery, type TopicQrCode, TopicUserApi, type TopicUserBlacklistItem, type TopicUserInfo, type TopicUserItem, type TopicUserListQuery, UserApi, type UserDefaultDetail, type UserDefaultItem, type UserDefaultSaveRequest, type UserInfo, type UserLimitTime, type VipInfo, WebhookApi, type WebhookItem, type WebhookSaveRequest, WebhookType, WebhookTypeDescription, batchSendRequest, callExecuteRaw, errorCodeFromValue, isRateLimitedCode, isSuccessfulHttpStatus, parseCallback, resolveConfig, sendRequest };
1879
+ export { AbstractApi, AccessKeyApi, AccessKeyManager, type AccessKeyResult, type ApiResponse, type BatchSendRequest, BatchSendRequestBuilder, type BatchSendResult, CallbackEvent, CallbackParser, type CallbackPayload, Channel, ChannelApi, ClawBotApi, type ClawBotInfo, type ClawBotMessage, type ClawBotQrCode, type CpItem, DEFAULT_BASE_URL, DocApi, type DocContent, type DocListItem, type DocListQuery, type DocVo, ErrorCode, ExcelApi, type ExcelContent, type ExcelVo, type ExcelWriteCellsRequest, FetchHttpRequester, type FileInput, FormApi, type FormCover, type FormDetail, type FormItem, type FormListItem, type FormListQuery, type FormPublishDiff, type FormPublishResult, type FormSaveRequest, type FormSettings, FormStatus, FormStatusDescription, type FormTheme, FriendApi, type FriendBlacklistItem, type FriendInfo, type FriendItem, type FriendQrCode, type HttpRawBody, type HttpRawRequestOptions, type HttpRequestOptions, type HttpRequester, type HttpResponse, ImageApi, type ImageFileInput, type ImageItem, type ImageUploadOptions, type ImageUploadResult, type ImageUploadToken, type MailDetail, type MailItem, MessageApi, type MessageCompleteInfo, type MessageItem, type MessageTokenAddRequest, MessageTokenApi, type MessageTokenEditRequest, type MessageTokenItem, type MessageTokenOption, type MpItem, OpenAbstractApi, OpenMessageApi, type PageQuery, type PageResult, PreApi, type PreDetail, type PreItem, type PreSaveRequest, type PreTestRequest, PushPlusClient, PushPlusClientBuilder, type PushPlusClientOptions, type PushPlusConfig, PushPlusError, PushPlusException, QqBotApi, type QqBotBindInfo, type QqBotBindLink, type QqBotInfo, type QqBotItem, type QqBotSaveRequest, type QqGroupItem, RateLimitGuard, type ResolvedPushPlusConfig, type SendCount, type SendMessageResult, type SendRequest, SendRequestBuilder, SendStatus, SendStatusDescription, SettingApi, ShareLogin, SharePerm, Template, type TopicAddRequest, TopicApi, type TopicDetail, type TopicEditRequest, type TopicItem, type TopicListQuery, type TopicQrCode, TopicUserApi, type TopicUserBlacklistItem, type TopicUserInfo, type TopicUserItem, type TopicUserListQuery, UserApi, type UserDefaultDetail, type UserDefaultItem, type UserDefaultSaveRequest, type UserInfo, type UserLimitTime, type VipInfo, WebhookApi, type WebhookItem, type WebhookSaveRequest, WebhookType, WebhookTypeDescription, batchSendRequest, callExecuteRaw, errorCodeFromValue, isRateLimitedCode, isSuccessfulHttpStatus, parseCallback, resolveConfig, sendRequest };
package/dist/index.d.ts CHANGED
@@ -155,7 +155,9 @@ declare enum Channel {
155
155
  /** App 渠道(安卓/鸿蒙/iOS)。 */
156
156
  APP = "app",
157
157
  /** 微信 ClawBot。 */
158
- CLAWBOT = "clawbot"
158
+ CLAWBOT = "clawbot",
159
+ /** QQ 机器人;不带 option 发给自己,option 填配置编码则发到对应 QQ 群。 */
160
+ QQ = "qq"
159
161
  }
160
162
  /**
161
163
  * PushPlus 消息模板枚举。
@@ -511,6 +513,7 @@ interface SendCount {
511
513
  cpSendCount?: number;
512
514
  webhookSendCount?: number;
513
515
  mailSendCount?: number;
516
+ qqBotSendCount?: number;
514
517
  }
515
518
  interface UserLimitTime {
516
519
  /** 1-无限制,2-短期限制,3-永久限制。 */
@@ -722,6 +725,74 @@ interface ClawBotQrCode {
722
725
  url?: string;
723
726
  qrcode?: string;
724
727
  }
728
+ interface QqBotBindLink {
729
+ /** 带参分享链接,用于生成扫码二维码;已绑定用户再次获取时可能为空。 */
730
+ url?: string;
731
+ /** 绑定码。已是好友时扫码收不到加好友事件,需私聊发送该码;认领 QQ 群也用此码。 */
732
+ bindCode?: string;
733
+ /** 有效期秒数,默认 300。 */
734
+ expireSeconds?: number;
735
+ /** 为当前用户分配的官方机器人 appId。 */
736
+ botAppId?: string;
737
+ botName?: string;
738
+ botAvatar?: string;
739
+ }
740
+ interface QqBotInfo {
741
+ botId?: string;
742
+ username?: string;
743
+ avatar?: string;
744
+ appId?: string;
745
+ /** 官方分享链接,可用于拉机器人进群。 */
746
+ shareUrl?: string;
747
+ }
748
+ interface QqBotBindInfo {
749
+ /** 0-未绑定,1-已绑定。 */
750
+ isBind?: number;
751
+ /** 1-可接收,0-用户已关闭单聊接收。 */
752
+ receiveStatus?: number;
753
+ createTime?: string;
754
+ botInfo?: QqBotInfo;
755
+ }
756
+ interface QqGroupItem {
757
+ /** 群编号;新增渠道配置时作为 qqGroupId 使用。 */
758
+ id?: number;
759
+ groupOpenId?: string;
760
+ groupRemark?: string;
761
+ /** 1-在群,2-群消息接收关闭。 */
762
+ status?: number;
763
+ /** 群名称,接口未授权时为空。 */
764
+ groupName?: string;
765
+ groupFingerMemo?: string;
766
+ groupClassText?: string;
767
+ groupTags?: string[];
768
+ groupMemberNum?: number;
769
+ createTime?: string;
770
+ }
771
+ interface QqBotItem {
772
+ id?: number;
773
+ qqName?: string;
774
+ /** 配置编码;发送消息时作为 option 传入。 */
775
+ qqCode?: string;
776
+ /** 2-发到 QQ 群。 */
777
+ sendType?: number;
778
+ qqGroupId?: number;
779
+ groupRemark?: string;
780
+ groupOpenId?: string;
781
+ groupName?: string;
782
+ updateTime?: string;
783
+ }
784
+ interface QqBotSaveRequest {
785
+ /** 修改时必填。 */
786
+ id?: number;
787
+ /** 配置名称,必填,最多 64 个字符。 */
788
+ qqName?: string;
789
+ /** 配置编码,新增必填;仅支持字母、数字、下划线和中划线,创建后不可修改。 */
790
+ qqCode?: string;
791
+ /** 发送类型;留空时 SDK 自动填 2(发到 QQ 群)。 */
792
+ sendType?: number;
793
+ /** QQ 群编号,必填,取自 groupList 返回的 id。 */
794
+ qqGroupId?: number;
795
+ }
725
796
  interface MpItem {
726
797
  id?: number;
727
798
  nickName?: string;
@@ -1511,6 +1582,29 @@ declare class PreApi extends OpenAbstractApi {
1511
1582
  test(req: PreTestRequest): Promise<string>;
1512
1583
  }
1513
1584
 
1585
+ /**
1586
+ * 开放接口 - QQ 机器人(文档「九. QQ机器人接口」)。
1587
+ */
1588
+ declare class QqBotApi extends OpenAbstractApi {
1589
+ constructor(config: ResolvedPushPlusConfig, http: HttpRequester, mgr: AccessKeyManager);
1590
+ /** 1. 获取绑定链接与绑定码;refresh 为 true 时旧绑定码失效并重新生成。 */
1591
+ getBindLink(refresh?: boolean): Promise<QqBotBindLink>;
1592
+ /** 2. 查询绑定状态。 */
1593
+ botInfo(): Promise<QqBotBindInfo>;
1594
+ /** 3. 解绑 QQ 机器人。 */
1595
+ unbind(): Promise<void>;
1596
+ /** 4. 获取机器人已加入的 QQ 群列表。 */
1597
+ groupList(): Promise<QqGroupItem[]>;
1598
+ /** 5. 获取 QQ 机器人渠道配置列表。 */
1599
+ list(q?: PageQuery): Promise<PageResult<QqBotItem>>;
1600
+ /** 6. 新增渠道配置,用于把消息发送到指定 QQ 群;发给自己无需创建配置。 */
1601
+ add(req: QqBotSaveRequest): Promise<void>;
1602
+ /** 7. 修改渠道配置;配置编码不可修改。 */
1603
+ edit(req: QqBotSaveRequest): Promise<void>;
1604
+ /** 8. 删除渠道配置。 */
1605
+ delete(id: number): Promise<void>;
1606
+ }
1607
+
1514
1608
  /**
1515
1609
  * 开放接口 - 功能设置(文档「九. 功能设置接口」)。
1516
1610
  */
@@ -1685,6 +1779,7 @@ declare class PushPlusClient {
1685
1779
  readonly webhook: WebhookApi;
1686
1780
  readonly channel: ChannelApi;
1687
1781
  readonly clawBot: ClawBotApi;
1782
+ readonly qqBot: QqBotApi;
1688
1783
  readonly setting: SettingApi;
1689
1784
  readonly pre: PreApi;
1690
1785
  readonly image: ImageApi;
@@ -1781,4 +1876,4 @@ declare const CallbackParser: {
1781
1876
  parse: typeof parseCallback;
1782
1877
  };
1783
1878
 
1784
- export { AbstractApi, AccessKeyApi, AccessKeyManager, type AccessKeyResult, type ApiResponse, type BatchSendRequest, BatchSendRequestBuilder, type BatchSendResult, CallbackEvent, CallbackParser, type CallbackPayload, Channel, ChannelApi, ClawBotApi, type ClawBotInfo, type ClawBotMessage, type ClawBotQrCode, type CpItem, DEFAULT_BASE_URL, DocApi, type DocContent, type DocListItem, type DocListQuery, type DocVo, ErrorCode, ExcelApi, type ExcelContent, type ExcelVo, type ExcelWriteCellsRequest, FetchHttpRequester, type FileInput, FormApi, type FormCover, type FormDetail, type FormItem, type FormListItem, type FormListQuery, type FormPublishDiff, type FormPublishResult, type FormSaveRequest, type FormSettings, FormStatus, FormStatusDescription, type FormTheme, FriendApi, type FriendBlacklistItem, type FriendInfo, type FriendItem, type FriendQrCode, type HttpRawBody, type HttpRawRequestOptions, type HttpRequestOptions, type HttpRequester, type HttpResponse, ImageApi, type ImageFileInput, type ImageItem, type ImageUploadOptions, type ImageUploadResult, type ImageUploadToken, type MailDetail, type MailItem, MessageApi, type MessageCompleteInfo, type MessageItem, type MessageTokenAddRequest, MessageTokenApi, type MessageTokenEditRequest, type MessageTokenItem, type MessageTokenOption, type MpItem, OpenAbstractApi, OpenMessageApi, type PageQuery, type PageResult, PreApi, type PreDetail, type PreItem, type PreSaveRequest, type PreTestRequest, PushPlusClient, PushPlusClientBuilder, type PushPlusClientOptions, type PushPlusConfig, PushPlusError, PushPlusException, RateLimitGuard, type ResolvedPushPlusConfig, type SendCount, type SendMessageResult, type SendRequest, SendRequestBuilder, SendStatus, SendStatusDescription, SettingApi, ShareLogin, SharePerm, Template, type TopicAddRequest, TopicApi, type TopicDetail, type TopicEditRequest, type TopicItem, type TopicListQuery, type TopicQrCode, TopicUserApi, type TopicUserBlacklistItem, type TopicUserInfo, type TopicUserItem, type TopicUserListQuery, UserApi, type UserDefaultDetail, type UserDefaultItem, type UserDefaultSaveRequest, type UserInfo, type UserLimitTime, type VipInfo, WebhookApi, type WebhookItem, type WebhookSaveRequest, WebhookType, WebhookTypeDescription, batchSendRequest, callExecuteRaw, errorCodeFromValue, isRateLimitedCode, isSuccessfulHttpStatus, parseCallback, resolveConfig, sendRequest };
1879
+ export { AbstractApi, AccessKeyApi, AccessKeyManager, type AccessKeyResult, type ApiResponse, type BatchSendRequest, BatchSendRequestBuilder, type BatchSendResult, CallbackEvent, CallbackParser, type CallbackPayload, Channel, ChannelApi, ClawBotApi, type ClawBotInfo, type ClawBotMessage, type ClawBotQrCode, type CpItem, DEFAULT_BASE_URL, DocApi, type DocContent, type DocListItem, type DocListQuery, type DocVo, ErrorCode, ExcelApi, type ExcelContent, type ExcelVo, type ExcelWriteCellsRequest, FetchHttpRequester, type FileInput, FormApi, type FormCover, type FormDetail, type FormItem, type FormListItem, type FormListQuery, type FormPublishDiff, type FormPublishResult, type FormSaveRequest, type FormSettings, FormStatus, FormStatusDescription, type FormTheme, FriendApi, type FriendBlacklistItem, type FriendInfo, type FriendItem, type FriendQrCode, type HttpRawBody, type HttpRawRequestOptions, type HttpRequestOptions, type HttpRequester, type HttpResponse, ImageApi, type ImageFileInput, type ImageItem, type ImageUploadOptions, type ImageUploadResult, type ImageUploadToken, type MailDetail, type MailItem, MessageApi, type MessageCompleteInfo, type MessageItem, type MessageTokenAddRequest, MessageTokenApi, type MessageTokenEditRequest, type MessageTokenItem, type MessageTokenOption, type MpItem, OpenAbstractApi, OpenMessageApi, type PageQuery, type PageResult, PreApi, type PreDetail, type PreItem, type PreSaveRequest, type PreTestRequest, PushPlusClient, PushPlusClientBuilder, type PushPlusClientOptions, type PushPlusConfig, PushPlusError, PushPlusException, QqBotApi, type QqBotBindInfo, type QqBotBindLink, type QqBotInfo, type QqBotItem, type QqBotSaveRequest, type QqGroupItem, RateLimitGuard, type ResolvedPushPlusConfig, type SendCount, type SendMessageResult, type SendRequest, SendRequestBuilder, SendStatus, SendStatusDescription, SettingApi, ShareLogin, SharePerm, Template, type TopicAddRequest, TopicApi, type TopicDetail, type TopicEditRequest, type TopicItem, type TopicListQuery, type TopicQrCode, TopicUserApi, type TopicUserBlacklistItem, type TopicUserInfo, type TopicUserItem, type TopicUserListQuery, UserApi, type UserDefaultDetail, type UserDefaultItem, type UserDefaultSaveRequest, type UserInfo, type UserLimitTime, type VipInfo, WebhookApi, type WebhookItem, type WebhookSaveRequest, WebhookType, WebhookTypeDescription, batchSendRequest, callExecuteRaw, errorCodeFromValue, isRateLimitedCode, isSuccessfulHttpStatus, parseCallback, resolveConfig, sendRequest };
@@ -12,6 +12,7 @@ var PerkPushPlus = (function (exports) {
12
12
  Channel2["EXTENSION"] = "extension";
13
13
  Channel2["APP"] = "app";
14
14
  Channel2["CLAWBOT"] = "clawbot";
15
+ Channel2["QQ"] = "qq";
15
16
  return Channel2;
16
17
  })(Channel || {});
17
18
  var Template = /* @__PURE__ */ ((Template2) => {
@@ -1327,6 +1328,55 @@ var PerkPushPlus = (function (exports) {
1327
1328
  }
1328
1329
  };
1329
1330
 
1331
+ // src/api/qqbot-api.ts
1332
+ var SEND_TYPE_QQ_GROUP = 2;
1333
+ var QqBotApi = class extends OpenAbstractApi {
1334
+ constructor(config, http, mgr) {
1335
+ super(config, http, mgr);
1336
+ }
1337
+ /** 1. 获取绑定链接与绑定码;refresh 为 true 时旧绑定码失效并重新生成。 */
1338
+ getBindLink(refresh = false) {
1339
+ const path = refresh ? this.appendQuery("/api/open/qqBot/getBindLink", { refresh: true }) : "/api/open/qqBot/getBindLink";
1340
+ return this.executeOpen("GET", path);
1341
+ }
1342
+ /** 2. 查询绑定状态。 */
1343
+ botInfo() {
1344
+ return this.executeOpen("GET", "/api/open/qqBot/botInfo");
1345
+ }
1346
+ /** 3. 解绑 QQ 机器人。 */
1347
+ async unbind() {
1348
+ await this.executeOpen("GET", "/api/open/qqBot/unbind");
1349
+ }
1350
+ /** 4. 获取机器人已加入的 QQ 群列表。 */
1351
+ async groupList() {
1352
+ var _a;
1353
+ return (_a = await this.executeOpen("GET", "/api/open/qqBot/groupList")) != null ? _a : [];
1354
+ }
1355
+ /** 5. 获取 QQ 机器人渠道配置列表。 */
1356
+ list(q) {
1357
+ return this.executeOpen("POST", "/api/open/qqBot/list", q != null ? q : {});
1358
+ }
1359
+ /** 6. 新增渠道配置,用于把消息发送到指定 QQ 群;发给自己无需创建配置。 */
1360
+ async add(req) {
1361
+ await this.executeOpen("POST", "/api/open/qqBot/add", withDefaultSendType(req));
1362
+ }
1363
+ /** 7. 修改渠道配置;配置编码不可修改。 */
1364
+ async edit(req) {
1365
+ await this.executeOpen("POST", "/api/open/qqBot/edit", withDefaultSendType(req));
1366
+ }
1367
+ /** 8. 删除渠道配置。 */
1368
+ async delete(id) {
1369
+ await this.executeOpen(
1370
+ "DELETE",
1371
+ this.appendQuery("/api/open/qqBot/delete", { id })
1372
+ );
1373
+ }
1374
+ };
1375
+ function withDefaultSendType(req) {
1376
+ var _a;
1377
+ return { ...req, sendType: (_a = req.sendType) != null ? _a : SEND_TYPE_QQ_GROUP };
1378
+ }
1379
+
1330
1380
  // src/api/setting-api.ts
1331
1381
  var SettingApi = class extends OpenAbstractApi {
1332
1382
  constructor(config, http, mgr) {
@@ -1670,6 +1720,7 @@ var PerkPushPlus = (function (exports) {
1670
1720
  this.webhook = new WebhookApi(this.config, this.httpRequester, this.accessKeyManager);
1671
1721
  this.channel = new ChannelApi(this.config, this.httpRequester, this.accessKeyManager);
1672
1722
  this.clawBot = new ClawBotApi(this.config, this.httpRequester, this.accessKeyManager);
1723
+ this.qqBot = new QqBotApi(this.config, this.httpRequester, this.accessKeyManager);
1673
1724
  this.setting = new SettingApi(this.config, this.httpRequester, this.accessKeyManager);
1674
1725
  this.pre = new PreApi(this.config, this.httpRequester, this.accessKeyManager);
1675
1726
  this.image = new ImageApi(this.config, this.httpRequester, this.accessKeyManager);
@@ -1937,6 +1988,7 @@ var PerkPushPlus = (function (exports) {
1937
1988
  exports.PushPlusClientBuilder = PushPlusClientBuilder;
1938
1989
  exports.PushPlusError = PushPlusError;
1939
1990
  exports.PushPlusException = PushPlusException;
1991
+ exports.QqBotApi = QqBotApi;
1940
1992
  exports.RateLimitGuard = RateLimitGuard;
1941
1993
  exports.SendRequestBuilder = SendRequestBuilder;
1942
1994
  exports.SendStatus = SendStatus;