@perk-net/perk-pushplus-sdk 1.1.1 → 1.2.1
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/README.md +71 -2
- package/dist/index.cjs +454 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +406 -1
- package/dist/index.d.ts +406 -1
- package/dist/index.global.js +454 -5
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +448 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api/base.ts +27 -1
- package/src/api/doc-api.ts +101 -0
- package/src/api/excel-api.ts +143 -0
- package/src/api/form-api.ts +95 -0
- package/src/api/friend-api.ts +38 -1
- package/src/api/open-base.ts +40 -0
- package/src/api/topic-user-api.ts +40 -1
- package/src/client.ts +9 -0
- package/src/config.ts +1 -1
- package/src/enums.ts +37 -0
- package/src/index.ts +27 -0
- package/src/models.ts +215 -0
- package/src/multipart.ts +62 -0
package/dist/index.d.cts
CHANGED
|
@@ -227,6 +227,35 @@ declare enum WebhookType {
|
|
|
227
227
|
CUSTOM = 12
|
|
228
228
|
}
|
|
229
229
|
declare const WebhookTypeDescription: Record<number, string>;
|
|
230
|
+
/**
|
|
231
|
+
* push 表单状态。
|
|
232
|
+
*
|
|
233
|
+
* 0-草稿,1-收集中,2-已停止。
|
|
234
|
+
*/
|
|
235
|
+
declare enum FormStatus {
|
|
236
|
+
DRAFT = 0,
|
|
237
|
+
COLLECTING = 1,
|
|
238
|
+
STOPPED = 2
|
|
239
|
+
}
|
|
240
|
+
declare const FormStatusDescription: Record<FormStatus, string>;
|
|
241
|
+
/**
|
|
242
|
+
* push 文档 / 表格分享权限。
|
|
243
|
+
*
|
|
244
|
+
* 0-关闭分享,1-开启分享(仅可查看)。
|
|
245
|
+
*/
|
|
246
|
+
declare enum SharePerm {
|
|
247
|
+
CLOSED = 0,
|
|
248
|
+
VIEW = 1
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* push 文档 / 表格打开分享页是否需要登录。
|
|
252
|
+
*
|
|
253
|
+
* 0-免登录,1-需登录。
|
|
254
|
+
*/
|
|
255
|
+
declare enum ShareLogin {
|
|
256
|
+
ANONYMOUS = 0,
|
|
257
|
+
REQUIRED = 1
|
|
258
|
+
}
|
|
230
259
|
/**
|
|
231
260
|
* PushPlus 接口业务返回码语义。
|
|
232
261
|
*
|
|
@@ -616,6 +645,18 @@ interface TopicUserListQuery {
|
|
|
616
645
|
/** 例如 { topicId }。 */
|
|
617
646
|
params?: Record<string, unknown>;
|
|
618
647
|
}
|
|
648
|
+
/** 群组订阅人黑名单列表项。 */
|
|
649
|
+
interface TopicUserBlacklistItem {
|
|
650
|
+
/** 黑名单记录 ID;解除黑名单时使用。 */
|
|
651
|
+
id?: number;
|
|
652
|
+
/** 被拉黑用户 ID。 */
|
|
653
|
+
userId?: number;
|
|
654
|
+
nickName?: string;
|
|
655
|
+
openId?: string;
|
|
656
|
+
headImgUrl?: string;
|
|
657
|
+
/** 拉黑时间。 */
|
|
658
|
+
createTime?: string;
|
|
659
|
+
}
|
|
619
660
|
interface WebhookItem {
|
|
620
661
|
id?: number;
|
|
621
662
|
webhookCode?: string;
|
|
@@ -656,6 +697,17 @@ interface FriendItem {
|
|
|
656
697
|
interface FriendQrCode {
|
|
657
698
|
qrCodeImgUrl?: string;
|
|
658
699
|
}
|
|
700
|
+
/** 好友黑名单列表项。 */
|
|
701
|
+
interface FriendBlacklistItem {
|
|
702
|
+
/** 黑名单记录 ID;解除黑名单时使用。 */
|
|
703
|
+
id?: number;
|
|
704
|
+
/** 被拉黑好友 ID。 */
|
|
705
|
+
friendId?: number;
|
|
706
|
+
nickName?: string;
|
|
707
|
+
headImgUrl?: string;
|
|
708
|
+
/** 拉黑时间。 */
|
|
709
|
+
createTime?: string;
|
|
710
|
+
}
|
|
659
711
|
interface ClawBotInfo {
|
|
660
712
|
createTime?: string;
|
|
661
713
|
/** 是否有对话令牌(文档为字符串/数字混用,统一用 number 兼容)。 */
|
|
@@ -814,6 +866,175 @@ interface ImageItem {
|
|
|
814
866
|
/** 创建时间。 */
|
|
815
867
|
createTime?: string;
|
|
816
868
|
}
|
|
869
|
+
/** 我的表单分页查询。官方结构为 `{current, pageSize, params:{keyword, status}}`。 */
|
|
870
|
+
interface FormListQuery {
|
|
871
|
+
/** 当前所在分页数,默认 1。 */
|
|
872
|
+
current?: number;
|
|
873
|
+
/** 每页大小,默认 20,最大 50。 */
|
|
874
|
+
pageSize?: number;
|
|
875
|
+
params?: {
|
|
876
|
+
/** 按标题关键词搜索。 */
|
|
877
|
+
keyword?: string;
|
|
878
|
+
/** 表单状态:0草稿 / 1收集中 / 2已停止。 */
|
|
879
|
+
status?: number;
|
|
880
|
+
[key: string]: unknown;
|
|
881
|
+
};
|
|
882
|
+
}
|
|
883
|
+
/** 表单封面页配置。 */
|
|
884
|
+
interface FormCover {
|
|
885
|
+
enabled?: boolean;
|
|
886
|
+
image?: string;
|
|
887
|
+
buttonText?: string;
|
|
888
|
+
}
|
|
889
|
+
/** 表单主题外观。 */
|
|
890
|
+
interface FormTheme {
|
|
891
|
+
primaryColor?: string;
|
|
892
|
+
backgroundColor?: string;
|
|
893
|
+
headerImage?: string;
|
|
894
|
+
backgroundImage?: string;
|
|
895
|
+
cover?: FormCover;
|
|
896
|
+
}
|
|
897
|
+
/** 表单收集 / 展示设置。 */
|
|
898
|
+
interface FormSettings {
|
|
899
|
+
endTime?: string | null;
|
|
900
|
+
maxResponses?: number | null;
|
|
901
|
+
oncePerUser?: boolean;
|
|
902
|
+
allowAnonymous?: boolean;
|
|
903
|
+
password?: string;
|
|
904
|
+
showQuestionNumber?: boolean;
|
|
905
|
+
onePerPage?: boolean;
|
|
906
|
+
showPrevButton?: boolean;
|
|
907
|
+
hideTitle?: boolean;
|
|
908
|
+
hideCopyright?: boolean;
|
|
909
|
+
hideAd?: boolean;
|
|
910
|
+
showOutline?: boolean;
|
|
911
|
+
thankText?: string;
|
|
912
|
+
redirectEnabled?: boolean;
|
|
913
|
+
redirectUrl?: string;
|
|
914
|
+
allowEdit?: boolean;
|
|
915
|
+
}
|
|
916
|
+
/**
|
|
917
|
+
* 表单题目。不同题型字段不同,除常用字段外可携带任意扩展属性。
|
|
918
|
+
*
|
|
919
|
+
* type 常用取值:input / textarea / radio / checkbox / select / number / date / rate 等。
|
|
920
|
+
*/
|
|
921
|
+
interface FormItem {
|
|
922
|
+
id?: string;
|
|
923
|
+
type?: string;
|
|
924
|
+
alias?: string;
|
|
925
|
+
label?: string;
|
|
926
|
+
description?: string;
|
|
927
|
+
required?: boolean;
|
|
928
|
+
placeholder?: string;
|
|
929
|
+
options?: unknown[];
|
|
930
|
+
rows?: unknown[];
|
|
931
|
+
columns?: unknown[];
|
|
932
|
+
allowOther?: boolean;
|
|
933
|
+
[key: string]: unknown;
|
|
934
|
+
}
|
|
935
|
+
/** 表单列表项 / 创建、复制结果(不含题目明细)。 */
|
|
936
|
+
interface FormListItem {
|
|
937
|
+
id?: number;
|
|
938
|
+
formCode?: string;
|
|
939
|
+
fillUrl?: string;
|
|
940
|
+
title?: string;
|
|
941
|
+
description?: string;
|
|
942
|
+
status?: number;
|
|
943
|
+
responseCount?: number;
|
|
944
|
+
publishTime?: string;
|
|
945
|
+
createTime?: string;
|
|
946
|
+
updateTime?: string;
|
|
947
|
+
}
|
|
948
|
+
/** 保存表单设计请求。 */
|
|
949
|
+
interface FormSaveRequest {
|
|
950
|
+
id: number;
|
|
951
|
+
title: string;
|
|
952
|
+
description?: string;
|
|
953
|
+
items?: FormItem[];
|
|
954
|
+
theme?: FormTheme;
|
|
955
|
+
settings?: FormSettings;
|
|
956
|
+
}
|
|
957
|
+
/** 表单详情(含草稿题目、主题、设置)。 */
|
|
958
|
+
interface FormDetail extends FormListItem {
|
|
959
|
+
items?: FormItem[];
|
|
960
|
+
theme?: FormTheme;
|
|
961
|
+
settings?: FormSettings;
|
|
962
|
+
publishDirty?: boolean;
|
|
963
|
+
}
|
|
964
|
+
/** 草稿题目与发布快照差异。 */
|
|
965
|
+
interface FormPublishDiff {
|
|
966
|
+
dirty?: boolean;
|
|
967
|
+
breaking?: boolean;
|
|
968
|
+
responseCount?: number;
|
|
969
|
+
added?: string[];
|
|
970
|
+
removed?: string[];
|
|
971
|
+
typeChanged?: string[];
|
|
972
|
+
optionChanged?: string[];
|
|
973
|
+
}
|
|
974
|
+
/** 发布表单结果。 */
|
|
975
|
+
interface FormPublishResult {
|
|
976
|
+
id?: number;
|
|
977
|
+
formCode?: string;
|
|
978
|
+
fillUrl?: string;
|
|
979
|
+
title?: string;
|
|
980
|
+
status?: number;
|
|
981
|
+
previousStatus?: number;
|
|
982
|
+
publishDirty?: boolean;
|
|
983
|
+
publishTime?: string;
|
|
984
|
+
}
|
|
985
|
+
/** 文档 / 表格分页查询。官方结构为 `{current, pageSize, params:{keyword, shareEnabled}}`。 */
|
|
986
|
+
interface DocListQuery {
|
|
987
|
+
/** 当前所在分页数,默认 1。 */
|
|
988
|
+
current?: number;
|
|
989
|
+
/** 每页大小,默认 20,最大 50。 */
|
|
990
|
+
pageSize?: number;
|
|
991
|
+
params?: {
|
|
992
|
+
keyword?: string;
|
|
993
|
+
/** true 时仅返回已开启分享的记录。 */
|
|
994
|
+
shareEnabled?: boolean;
|
|
995
|
+
[key: string]: unknown;
|
|
996
|
+
};
|
|
997
|
+
}
|
|
998
|
+
/** 文档 / 表格列表项。 */
|
|
999
|
+
interface DocListItem {
|
|
1000
|
+
docCode?: string;
|
|
1001
|
+
shareUrl?: string;
|
|
1002
|
+
title?: string;
|
|
1003
|
+
sharePerm?: number;
|
|
1004
|
+
shareLogin?: number;
|
|
1005
|
+
perm?: number;
|
|
1006
|
+
published?: boolean;
|
|
1007
|
+
publishTime?: string;
|
|
1008
|
+
createTime?: string;
|
|
1009
|
+
updateTime?: string;
|
|
1010
|
+
}
|
|
1011
|
+
/** 文档信息(不含正文)。 */
|
|
1012
|
+
interface DocVo extends DocListItem {
|
|
1013
|
+
publishDirty?: boolean;
|
|
1014
|
+
}
|
|
1015
|
+
/** 文档内容(HTML 草稿)。 */
|
|
1016
|
+
interface DocContent extends DocVo {
|
|
1017
|
+
content?: string;
|
|
1018
|
+
}
|
|
1019
|
+
/** 表格信息(不含正文)。与文档结构相同,独立类型便于区分。 */
|
|
1020
|
+
interface ExcelVo extends DocListItem {
|
|
1021
|
+
publishDirty?: boolean;
|
|
1022
|
+
}
|
|
1023
|
+
/** 表格内容(整表 JSON 字符串草稿)。 */
|
|
1024
|
+
interface ExcelContent extends ExcelVo {
|
|
1025
|
+
/** 整表草稿 JSON 字符串。 */
|
|
1026
|
+
content?: string;
|
|
1027
|
+
}
|
|
1028
|
+
/** 按区域写入单元格请求。 */
|
|
1029
|
+
interface ExcelWriteCellsRequest {
|
|
1030
|
+
docCode: string;
|
|
1031
|
+
/** 工作表名称;不传则写入活动表 / 第一张表。 */
|
|
1032
|
+
sheetName?: string;
|
|
1033
|
+
/** 起始单元格,如 A1。 */
|
|
1034
|
+
range: string;
|
|
1035
|
+
/** 二维数组,外层为行、内层为列。 */
|
|
1036
|
+
values: unknown[][];
|
|
1037
|
+
}
|
|
817
1038
|
|
|
818
1039
|
/**
|
|
819
1040
|
* API 基类,提供请求执行与统一错误处理。
|
|
@@ -832,6 +1053,11 @@ declare abstract class AbstractApi {
|
|
|
832
1053
|
* 执行请求并返回原始 ApiResponse(不进行 code 校验)。
|
|
833
1054
|
*/
|
|
834
1055
|
protected execute<T>(method: string, path: string, headers: Record<string, string> | undefined | null, body: unknown): Promise<ApiResponse<T>>;
|
|
1056
|
+
/**
|
|
1057
|
+
* 执行带二进制请求体的请求并返回原始 ApiResponse(不进行 code 校验)。
|
|
1058
|
+
* 用于 multipart 上传等场景。
|
|
1059
|
+
*/
|
|
1060
|
+
protected executeRaw<T>(method: string, path: string, headers: Record<string, string> | undefined | null, body: Uint8Array): Promise<ApiResponse<T>>;
|
|
835
1061
|
/** 执行请求并直接返回 data;非 200 抛出异常。 */
|
|
836
1062
|
protected executeForData<T>(method: string, path: string, headers: Record<string, string> | undefined | null, body: unknown): Promise<T>;
|
|
837
1063
|
}
|
|
@@ -876,6 +1102,13 @@ declare class AccessKeyManager {
|
|
|
876
1102
|
private isValid;
|
|
877
1103
|
}
|
|
878
1104
|
|
|
1105
|
+
/** 二进制文件输入。 */
|
|
1106
|
+
type FileInput = Uint8Array | ArrayBuffer | Blob;
|
|
1107
|
+
interface FileMultipart {
|
|
1108
|
+
contentType: string;
|
|
1109
|
+
body: Uint8Array;
|
|
1110
|
+
}
|
|
1111
|
+
|
|
879
1112
|
/**
|
|
880
1113
|
* 开放接口基类。会自动在 header 中带上 access-key,
|
|
881
1114
|
* 并在收到 401 类业务错误时尝试重试一次(刷新 AccessKey 后重试)。
|
|
@@ -891,6 +1124,12 @@ declare abstract class OpenAbstractApi extends AbstractApi {
|
|
|
891
1124
|
* 执行带 access-key 的请求;当返回 code=401 时自动刷新 key 并重试一次。
|
|
892
1125
|
*/
|
|
893
1126
|
protected executeOpen<T>(method: string, path: string, body?: unknown): Promise<T>;
|
|
1127
|
+
/** 以 multipart 上传文件(自动携带 access-key;code=401 时刷新后重试一次)。 */
|
|
1128
|
+
protected executeOpenMultipart<T>(path: string, multipart: FileMultipart): Promise<T>;
|
|
1129
|
+
/**
|
|
1130
|
+
* 执行带二进制 body 的开放接口请求;当返回 code=401 时自动刷新 key 并重试一次。
|
|
1131
|
+
*/
|
|
1132
|
+
protected executeOpenRaw<T>(method: string, path: string, body: Uint8Array, extraHeaders?: Record<string, string>): Promise<T>;
|
|
894
1133
|
}
|
|
895
1134
|
|
|
896
1135
|
/**
|
|
@@ -925,6 +1164,129 @@ declare class ClawBotApi extends OpenAbstractApi {
|
|
|
925
1164
|
getMsg(): Promise<ClawBotMessage[]>;
|
|
926
1165
|
}
|
|
927
1166
|
|
|
1167
|
+
/**
|
|
1168
|
+
* 开放接口 - push 文档。
|
|
1169
|
+
*
|
|
1170
|
+
* 文档:https://www.pushplus.plus/doc/ecosystem/doc/
|
|
1171
|
+
* 基础路径:`/push/api/open/doc`
|
|
1172
|
+
*
|
|
1173
|
+
* 文档开放接口不单独提供推送接口。发布后请通过 `client.send` 推送分享页:
|
|
1174
|
+
* `template=doc`,`pushId=docCode`。
|
|
1175
|
+
*/
|
|
1176
|
+
declare class DocApi extends OpenAbstractApi {
|
|
1177
|
+
constructor(config: ResolvedPushPlusConfig, http: HttpRequester, mgr: AccessKeyManager);
|
|
1178
|
+
/** 我的文档分页。 */
|
|
1179
|
+
list(query?: DocListQuery): Promise<PageResult<DocListItem>>;
|
|
1180
|
+
/** 创建空白文档。 */
|
|
1181
|
+
create(title: string): Promise<DocVo>;
|
|
1182
|
+
/**
|
|
1183
|
+
* 导入 Word(.docx)创建文档。
|
|
1184
|
+
*
|
|
1185
|
+
* 标题默认取文件名;创建后默认关闭分享,需再调用 publish 才会同步到分享页。
|
|
1186
|
+
*/
|
|
1187
|
+
importWord(file: FileInput, fileName?: string): Promise<DocVo>;
|
|
1188
|
+
/** 获取文档元信息与 HTML 草稿正文。 */
|
|
1189
|
+
content(docCode: string): Promise<DocContent>;
|
|
1190
|
+
/** 保存 HTML 草稿(不影响分享页,需再 publish)。 */
|
|
1191
|
+
saveContent(docCode: string, content: string): Promise<DocVo>;
|
|
1192
|
+
/** 将草稿同步为分享页快照。 */
|
|
1193
|
+
publish(docCode: string): Promise<DocVo>;
|
|
1194
|
+
/** 重命名。 */
|
|
1195
|
+
rename(docCode: string, title: string): Promise<void>;
|
|
1196
|
+
/** 删除文档。 */
|
|
1197
|
+
delete(docCode: string): Promise<void>;
|
|
1198
|
+
/**
|
|
1199
|
+
* 更新分享设置。
|
|
1200
|
+
*
|
|
1201
|
+
* @param sharePerm 0 关闭 / 1 开启(仅可查看)
|
|
1202
|
+
* @param shareLogin 0 免登录 / 1 需登录;不传则沿用原值
|
|
1203
|
+
*/
|
|
1204
|
+
updateShare(docCode: string, sharePerm: number, shareLogin?: number): Promise<DocVo>;
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
/**
|
|
1208
|
+
* 开放接口 - push 表格。
|
|
1209
|
+
*
|
|
1210
|
+
* 文档:https://www.pushplus.plus/doc/ecosystem/sheet/
|
|
1211
|
+
* 基础路径:`/push/api/open/excel`
|
|
1212
|
+
*
|
|
1213
|
+
* 表格开放接口不单独提供推送接口。发布后请通过 `client.send` 推送分享页:
|
|
1214
|
+
* `template=excel`,`pushId=docCode`。
|
|
1215
|
+
*/
|
|
1216
|
+
declare class ExcelApi extends OpenAbstractApi {
|
|
1217
|
+
constructor(config: ResolvedPushPlusConfig, http: HttpRequester, mgr: AccessKeyManager);
|
|
1218
|
+
/** 我的表格分页。 */
|
|
1219
|
+
list(query?: DocListQuery): Promise<PageResult<DocListItem>>;
|
|
1220
|
+
/** 创建空白表格。 */
|
|
1221
|
+
create(title: string): Promise<ExcelVo>;
|
|
1222
|
+
/**
|
|
1223
|
+
* 导入 Excel(.xlsx / .xls)创建表格。
|
|
1224
|
+
*
|
|
1225
|
+
* 标题默认取文件名;创建后默认关闭分享,需再调用 publish 才会同步到分享页。
|
|
1226
|
+
*/
|
|
1227
|
+
importExcel(file: FileInput, fileName?: string): Promise<ExcelVo>;
|
|
1228
|
+
/** 获取表格元信息与整表 JSON 草稿。 */
|
|
1229
|
+
content(docCode: string): Promise<ExcelContent>;
|
|
1230
|
+
/**
|
|
1231
|
+
* 整表覆盖保存草稿。
|
|
1232
|
+
*
|
|
1233
|
+
* `content` 可为 JSON 字符串,或工作簿对象(SDK 会序列化)。
|
|
1234
|
+
*/
|
|
1235
|
+
saveContent(docCode: string, content: string | object): Promise<ExcelVo>;
|
|
1236
|
+
/**
|
|
1237
|
+
* 从指定起始单元格起,按二维数组向右向下写入(草稿)。
|
|
1238
|
+
*
|
|
1239
|
+
* @param range 起始单元格,如 A1
|
|
1240
|
+
* @param values 外层为行、内层为列
|
|
1241
|
+
* @param sheetName 工作表名称;不传则写入活动表 / 第一张表
|
|
1242
|
+
*/
|
|
1243
|
+
writeCells(docCode: string, range: string, values: unknown[][], sheetName?: string): Promise<ExcelVo>;
|
|
1244
|
+
/** 将草稿同步为分享页快照。 */
|
|
1245
|
+
publish(docCode: string): Promise<ExcelVo>;
|
|
1246
|
+
/** 重命名。 */
|
|
1247
|
+
rename(docCode: string, title: string): Promise<void>;
|
|
1248
|
+
/** 删除表格。 */
|
|
1249
|
+
delete(docCode: string): Promise<void>;
|
|
1250
|
+
/**
|
|
1251
|
+
* 更新分享设置。
|
|
1252
|
+
*
|
|
1253
|
+
* @param sharePerm 0 关闭 / 1 开启(仅可查看)
|
|
1254
|
+
* @param shareLogin 0 免登录 / 1 需登录;不传则沿用原值
|
|
1255
|
+
*/
|
|
1256
|
+
updateShare(docCode: string, sharePerm: number, shareLogin?: number): Promise<ExcelVo>;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
/**
|
|
1260
|
+
* 开放接口 - push 表单。
|
|
1261
|
+
*
|
|
1262
|
+
* 文档:https://www.pushplus.plus/doc/ecosystem/form/
|
|
1263
|
+
* 基础路径:`/push/api/open/form`
|
|
1264
|
+
*
|
|
1265
|
+
* 表单开放接口不单独提供推送接口。发布后请通过 `client.send` 推送填写页:
|
|
1266
|
+
* `template=form`,`pushId=formCode`。
|
|
1267
|
+
*/
|
|
1268
|
+
declare class FormApi extends OpenAbstractApi {
|
|
1269
|
+
constructor(config: ResolvedPushPlusConfig, http: HttpRequester, mgr: AccessKeyManager);
|
|
1270
|
+
/** 我的表单分页。 */
|
|
1271
|
+
list(query?: FormListQuery): Promise<PageResult<FormListItem>>;
|
|
1272
|
+
/** 创建空白表单(草稿)。 */
|
|
1273
|
+
create(title: string): Promise<FormListItem>;
|
|
1274
|
+
/** 基于已有表单复制一份新草稿。 */
|
|
1275
|
+
copy(id: number): Promise<FormListItem>;
|
|
1276
|
+
/** 保存表单设计(仅更新草稿;已发布需再调用 publish)。 */
|
|
1277
|
+
save(req: FormSaveRequest): Promise<void>;
|
|
1278
|
+
/** 表单详情(含草稿题目、主题、设置)。 */
|
|
1279
|
+
detail(id: number): Promise<FormDetail>;
|
|
1280
|
+
/** 草稿与发布快照的题目差异。 */
|
|
1281
|
+
publishDiff(id: number): Promise<FormPublishDiff>;
|
|
1282
|
+
/** 发布表单,开始收集。 */
|
|
1283
|
+
publish(id: number): Promise<FormPublishResult>;
|
|
1284
|
+
/** 停止收集。 */
|
|
1285
|
+
stop(id: number): Promise<void>;
|
|
1286
|
+
/** 删除表单(不可恢复)。 */
|
|
1287
|
+
delete(id: number): Promise<void>;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
928
1290
|
/**
|
|
929
1291
|
* 开放接口 - 好友功能(文档「十. 好友功能接口」)。
|
|
930
1292
|
*/
|
|
@@ -943,6 +1305,24 @@ declare class FriendApi extends OpenAbstractApi {
|
|
|
943
1305
|
delete(friendId: number): Promise<void>;
|
|
944
1306
|
/** 4. 修改好友备注。 */
|
|
945
1307
|
editRemark(id: number, remark: string): Promise<void>;
|
|
1308
|
+
/**
|
|
1309
|
+
* 5. 将好友加入黑名单。
|
|
1310
|
+
*
|
|
1311
|
+
* 加入后将解除双方好友关系,对方无法再添加你。不能将自己加入黑名单,仅可将已有好友加入黑名单。
|
|
1312
|
+
*
|
|
1313
|
+
* @param friendId 好友 id(好友列表中的 friendId 字段)
|
|
1314
|
+
*/
|
|
1315
|
+
addBlacklist(friendId: number): Promise<void>;
|
|
1316
|
+
/** 6. 好友黑名单列表。 */
|
|
1317
|
+
blacklistList(query?: PageQuery): Promise<PageResult<FriendBlacklistItem>>;
|
|
1318
|
+
/**
|
|
1319
|
+
* 7. 解除好友黑名单。
|
|
1320
|
+
*
|
|
1321
|
+
* 解除后不会自动恢复好友关系,需重新扫码添加。
|
|
1322
|
+
*
|
|
1323
|
+
* @param id 黑名单记录 ID(黑名单列表中的 id 字段)
|
|
1324
|
+
*/
|
|
1325
|
+
removeBlacklist(id: number): Promise<void>;
|
|
946
1326
|
}
|
|
947
1327
|
|
|
948
1328
|
/**
|
|
@@ -1212,6 +1592,28 @@ declare class TopicUserApi extends OpenAbstractApi {
|
|
|
1212
1592
|
deleteUser(topicRelationId: number): Promise<string>;
|
|
1213
1593
|
/** 3. 修改订阅人备注。 */
|
|
1214
1594
|
editRemark(id: number, remark: string): Promise<void>;
|
|
1595
|
+
/**
|
|
1596
|
+
* 4. 将订阅人加入黑名单。
|
|
1597
|
+
*
|
|
1598
|
+
* 加入后将移出群组,对方无法再加入该群组。积分群组不支持黑名单。不能将自己加入黑名单。
|
|
1599
|
+
*
|
|
1600
|
+
* @param topicRelationId 用户编号(订阅人列表中的 id 字段)
|
|
1601
|
+
*/
|
|
1602
|
+
addBlacklist(topicRelationId: number): Promise<void>;
|
|
1603
|
+
/**
|
|
1604
|
+
* 5. 订阅人黑名单列表。
|
|
1605
|
+
*
|
|
1606
|
+
* `query.params.topicId` 必填。
|
|
1607
|
+
*/
|
|
1608
|
+
blacklistList(query: TopicUserListQuery): Promise<PageResult<TopicUserBlacklistItem>>;
|
|
1609
|
+
/**
|
|
1610
|
+
* 6. 解除订阅人黑名单。
|
|
1611
|
+
*
|
|
1612
|
+
* 解除后不会自动恢复群组订阅,对方可重新加入该群组。
|
|
1613
|
+
*
|
|
1614
|
+
* @param id 黑名单记录 ID(黑名单列表中的 id 字段)
|
|
1615
|
+
*/
|
|
1616
|
+
removeBlacklist(id: number): Promise<void>;
|
|
1215
1617
|
}
|
|
1216
1618
|
|
|
1217
1619
|
/**
|
|
@@ -1286,6 +1688,9 @@ declare class PushPlusClient {
|
|
|
1286
1688
|
readonly setting: SettingApi;
|
|
1287
1689
|
readonly pre: PreApi;
|
|
1288
1690
|
readonly image: ImageApi;
|
|
1691
|
+
readonly form: FormApi;
|
|
1692
|
+
readonly doc: DocApi;
|
|
1693
|
+
readonly excel: ExcelApi;
|
|
1289
1694
|
constructor(options?: PushPlusClientOptions);
|
|
1290
1695
|
/** 与 Java SDK 风格一致的 Builder 入口。 */
|
|
1291
1696
|
static builder(): PushPlusClientBuilder;
|
|
@@ -1376,4 +1781,4 @@ declare const CallbackParser: {
|
|
|
1376
1781
|
parse: typeof parseCallback;
|
|
1377
1782
|
};
|
|
1378
1783
|
|
|
1379
|
-
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, ErrorCode, FetchHttpRequester, FriendApi, 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, Template, type TopicAddRequest, TopicApi, type TopicDetail, type TopicEditRequest, type TopicItem, type TopicListQuery, type TopicQrCode, TopicUserApi, 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 };
|
|
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 };
|