@perk-net/perk-pushplus-sdk 1.2.0 → 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/README.md +60 -5
- package/dist/index.cjs +263 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +220 -15
- package/dist/index.d.ts +220 -15
- package/dist/index.global.js +263 -5
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +263 -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 +24 -0
- package/src/api/excel-api.ts +29 -0
- package/src/api/form-api.ts +3 -0
- package/src/api/friend-api.ts +38 -1
- package/src/api/open-base.ts +40 -0
- package/src/api/qqbot-api.ts +75 -0
- package/src/api/topic-user-api.ts +40 -1
- package/src/client.ts +3 -0
- package/src/config.ts +1 -1
- package/src/enums.ts +2 -0
- package/src/index.ts +10 -0
- package/src/models.ts +123 -13
- package/src/multipart.ts +62 -0
package/dist/index.js
CHANGED
|
@@ -9,6 +9,7 @@ var Channel = /* @__PURE__ */ ((Channel2) => {
|
|
|
9
9
|
Channel2["EXTENSION"] = "extension";
|
|
10
10
|
Channel2["APP"] = "app";
|
|
11
11
|
Channel2["CLAWBOT"] = "clawbot";
|
|
12
|
+
Channel2["QQ"] = "qq";
|
|
12
13
|
return Channel2;
|
|
13
14
|
})(Channel || {});
|
|
14
15
|
var Template = /* @__PURE__ */ ((Template2) => {
|
|
@@ -373,6 +374,26 @@ var AbstractApi = class {
|
|
|
373
374
|
}
|
|
374
375
|
return parseApiResponse(resp);
|
|
375
376
|
}
|
|
377
|
+
/**
|
|
378
|
+
* 执行带二进制请求体的请求并返回原始 ApiResponse(不进行 code 校验)。
|
|
379
|
+
* 用于 multipart 上传等场景。
|
|
380
|
+
*/
|
|
381
|
+
async executeRaw(method, path, headers, body) {
|
|
382
|
+
const url = this.resolveUrl(path);
|
|
383
|
+
const resp = await callExecuteRaw(this.http, {
|
|
384
|
+
method,
|
|
385
|
+
url,
|
|
386
|
+
headers: headers != null ? headers : void 0,
|
|
387
|
+
body
|
|
388
|
+
});
|
|
389
|
+
if (!isSuccessfulHttpStatus(resp.statusCode)) {
|
|
390
|
+
throw new PushPlusError(
|
|
391
|
+
`PushPlus \u63A5\u53E3 HTTP \u8C03\u7528\u5931\u8D25: status=${resp.statusCode}, body=${resp.body}`,
|
|
392
|
+
resp.statusCode
|
|
393
|
+
);
|
|
394
|
+
}
|
|
395
|
+
return parseApiResponse(resp);
|
|
396
|
+
}
|
|
376
397
|
/** 执行请求并直接返回 data;非 200 抛出异常。 */
|
|
377
398
|
async executeForData(method, path, headers, body) {
|
|
378
399
|
var _a;
|
|
@@ -503,6 +524,39 @@ var _OpenAbstractApi = class _OpenAbstractApi extends AbstractApi {
|
|
|
503
524
|
(_b = resp.code) != null ? _b : -1
|
|
504
525
|
);
|
|
505
526
|
}
|
|
527
|
+
/** 以 multipart 上传文件(自动携带 access-key;code=401 时刷新后重试一次)。 */
|
|
528
|
+
executeOpenMultipart(path, multipart) {
|
|
529
|
+
return this.executeOpenRaw("POST", path, multipart.body, {
|
|
530
|
+
"Content-Type": multipart.contentType
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* 执行带二进制 body 的开放接口请求;当返回 code=401 时自动刷新 key 并重试一次。
|
|
535
|
+
*/
|
|
536
|
+
async executeOpenRaw(method, path, body, extraHeaders) {
|
|
537
|
+
var _a, _b;
|
|
538
|
+
const headers = { ...await this.headersWithAccessKey(), ...extraHeaders != null ? extraHeaders : {} };
|
|
539
|
+
const resp = await this.executeRaw(method, path, headers, body);
|
|
540
|
+
if (isApiSuccess(resp)) {
|
|
541
|
+
return resp.data;
|
|
542
|
+
}
|
|
543
|
+
if (resp.code === _OpenAbstractApi.CODE_ACCESS_KEY_INVALID) {
|
|
544
|
+
this.accessKeyManager.invalidate();
|
|
545
|
+
const retryHeaders = { ...await this.headersWithAccessKey(), ...extraHeaders != null ? extraHeaders : {} };
|
|
546
|
+
const retry = await this.executeRaw(method, path, retryHeaders, body);
|
|
547
|
+
if (isApiSuccess(retry)) {
|
|
548
|
+
return retry.data;
|
|
549
|
+
}
|
|
550
|
+
throw new PushPlusError(
|
|
551
|
+
`PushPlus \u5F00\u653E\u63A5\u53E3\u4E1A\u52A1\u5931\u8D25(\u91CD\u8BD5\u540E): code=${retry.code}, msg=${retry.msg}`,
|
|
552
|
+
(_a = retry.code) != null ? _a : -1
|
|
553
|
+
);
|
|
554
|
+
}
|
|
555
|
+
throw new PushPlusError(
|
|
556
|
+
`PushPlus \u5F00\u653E\u63A5\u53E3\u4E1A\u52A1\u5931\u8D25: code=${resp.code}, msg=${resp.msg}`,
|
|
557
|
+
(_b = resp.code) != null ? _b : -1
|
|
558
|
+
);
|
|
559
|
+
}
|
|
506
560
|
};
|
|
507
561
|
_OpenAbstractApi.HEADER_ACCESS_KEY = "access-key";
|
|
508
562
|
/** PushPlus AccessKey 失效相关的业务码(用于触发自动重试)。 */
|
|
@@ -565,6 +619,50 @@ var ClawBotApi = class extends OpenAbstractApi {
|
|
|
565
619
|
}
|
|
566
620
|
};
|
|
567
621
|
|
|
622
|
+
// src/multipart.ts
|
|
623
|
+
function buildFileMultipart(fileName, contentType, fileBytes) {
|
|
624
|
+
if (fileBytes == null || fileBytes.byteLength === 0) {
|
|
625
|
+
throw new PushPlusError("\u4E0A\u4F20\u6587\u4EF6\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A");
|
|
626
|
+
}
|
|
627
|
+
const safeName = fileName && fileName.trim() ? fileName : "file";
|
|
628
|
+
const mime = contentType && contentType.trim() ? contentType : "application/octet-stream";
|
|
629
|
+
const boundary = "----PushPlusBoundary" + randomBoundarySuffix();
|
|
630
|
+
const crlf = "\r\n";
|
|
631
|
+
const enc = new TextEncoder();
|
|
632
|
+
const head = enc.encode(
|
|
633
|
+
`--${boundary}${crlf}Content-Disposition: form-data; name="file"; filename="${escapeFileName(safeName)}"${crlf}Content-Type: ${mime}${crlf}${crlf}`
|
|
634
|
+
);
|
|
635
|
+
const tail = enc.encode(`${crlf}--${boundary}--${crlf}`);
|
|
636
|
+
const body = new Uint8Array(head.byteLength + fileBytes.byteLength + tail.byteLength);
|
|
637
|
+
body.set(head, 0);
|
|
638
|
+
body.set(fileBytes, head.byteLength);
|
|
639
|
+
body.set(tail, head.byteLength + fileBytes.byteLength);
|
|
640
|
+
return { contentType: `multipart/form-data; boundary=${boundary}`, body };
|
|
641
|
+
}
|
|
642
|
+
async function toFileBytes(file) {
|
|
643
|
+
if (file instanceof Uint8Array) {
|
|
644
|
+
return file;
|
|
645
|
+
}
|
|
646
|
+
if (file instanceof ArrayBuffer) {
|
|
647
|
+
return new Uint8Array(file);
|
|
648
|
+
}
|
|
649
|
+
if (typeof Blob !== "undefined" && file instanceof Blob) {
|
|
650
|
+
const ab = await file.arrayBuffer();
|
|
651
|
+
return new Uint8Array(ab);
|
|
652
|
+
}
|
|
653
|
+
throw new PushPlusError(`\u4E0D\u652F\u6301\u7684\u4E0A\u4F20\u6587\u4EF6\u7C7B\u578B: ${Object.prototype.toString.call(file)}`);
|
|
654
|
+
}
|
|
655
|
+
function escapeFileName(name) {
|
|
656
|
+
return name.replace(/"/g, "_").replace(/\r/g, " ").replace(/\n/g, " ");
|
|
657
|
+
}
|
|
658
|
+
function randomBoundarySuffix() {
|
|
659
|
+
let s = "";
|
|
660
|
+
for (let i = 0; i < 32; i++) {
|
|
661
|
+
s += Math.floor(Math.random() * 16).toString(16);
|
|
662
|
+
}
|
|
663
|
+
return s;
|
|
664
|
+
}
|
|
665
|
+
|
|
568
666
|
// src/api/doc-api.ts
|
|
569
667
|
var DocApi = class extends OpenAbstractApi {
|
|
570
668
|
constructor(config, http, mgr) {
|
|
@@ -582,6 +680,19 @@ var DocApi = class extends OpenAbstractApi {
|
|
|
582
680
|
create(title) {
|
|
583
681
|
return this.executeOpen("POST", "/push/api/open/doc/create", { title });
|
|
584
682
|
}
|
|
683
|
+
/**
|
|
684
|
+
* 导入 Word(.docx)创建文档。
|
|
685
|
+
*
|
|
686
|
+
* 标题默认取文件名;创建后默认关闭分享,需再调用 publish 才会同步到分享页。
|
|
687
|
+
*/
|
|
688
|
+
async importWord(file, fileName = "document.docx") {
|
|
689
|
+
const bytes = await toFileBytes(file);
|
|
690
|
+
const name = fileName && fileName.trim() ? fileName : "document.docx";
|
|
691
|
+
return this.executeOpenMultipart(
|
|
692
|
+
"/push/api/open/doc/import",
|
|
693
|
+
buildFileMultipart(name, guessDocxContentType(name), bytes)
|
|
694
|
+
);
|
|
695
|
+
}
|
|
585
696
|
/** 获取文档元信息与 HTML 草稿正文。 */
|
|
586
697
|
content(docCode) {
|
|
587
698
|
return this.executeOpen(
|
|
@@ -623,6 +734,9 @@ var DocApi = class extends OpenAbstractApi {
|
|
|
623
734
|
return this.executeOpen("POST", "/push/api/open/doc/updateShare", body);
|
|
624
735
|
}
|
|
625
736
|
};
|
|
737
|
+
function guessDocxContentType(name) {
|
|
738
|
+
return name.toLowerCase().endsWith(".docx") ? "application/vnd.openxmlformats-officedocument.wordprocessingml.document" : "application/octet-stream";
|
|
739
|
+
}
|
|
626
740
|
|
|
627
741
|
// src/api/excel-api.ts
|
|
628
742
|
var ExcelApi = class extends OpenAbstractApi {
|
|
@@ -641,6 +755,19 @@ var ExcelApi = class extends OpenAbstractApi {
|
|
|
641
755
|
create(title) {
|
|
642
756
|
return this.executeOpen("POST", "/push/api/open/excel/create", { title });
|
|
643
757
|
}
|
|
758
|
+
/**
|
|
759
|
+
* 导入 Excel(.xlsx / .xls)创建表格。
|
|
760
|
+
*
|
|
761
|
+
* 标题默认取文件名;创建后默认关闭分享,需再调用 publish 才会同步到分享页。
|
|
762
|
+
*/
|
|
763
|
+
async importExcel(file, fileName = "workbook.xlsx") {
|
|
764
|
+
const bytes = await toFileBytes(file);
|
|
765
|
+
const name = fileName && fileName.trim() ? fileName : "workbook.xlsx";
|
|
766
|
+
return this.executeOpenMultipart(
|
|
767
|
+
"/push/api/open/excel/import",
|
|
768
|
+
buildFileMultipart(name, guessExcelContentType(name), bytes)
|
|
769
|
+
);
|
|
770
|
+
}
|
|
644
771
|
/** 获取表格元信息与整表 JSON 草稿。 */
|
|
645
772
|
content(docCode) {
|
|
646
773
|
return this.executeOpen(
|
|
@@ -711,6 +838,16 @@ function stringifyJsonContent(content) {
|
|
|
711
838
|
throw new PushPlusError(`\u5E8F\u5217\u5316\u8868\u683C\u5185\u5BB9\u5931\u8D25: ${e.message}`, -1, { cause: e });
|
|
712
839
|
}
|
|
713
840
|
}
|
|
841
|
+
function guessExcelContentType(name) {
|
|
842
|
+
const lower = name.toLowerCase();
|
|
843
|
+
if (lower.endsWith(".xlsx")) {
|
|
844
|
+
return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
845
|
+
}
|
|
846
|
+
if (lower.endsWith(".xls")) {
|
|
847
|
+
return "application/vnd.ms-excel";
|
|
848
|
+
}
|
|
849
|
+
return "application/octet-stream";
|
|
850
|
+
}
|
|
714
851
|
|
|
715
852
|
// src/api/form-api.ts
|
|
716
853
|
var FormApi = class extends OpenAbstractApi {
|
|
@@ -806,6 +943,40 @@ var FriendApi = class extends OpenAbstractApi {
|
|
|
806
943
|
async editRemark(id, remark) {
|
|
807
944
|
await this.executeOpen("POST", "/api/open/friend/editRemark", { id, remark });
|
|
808
945
|
}
|
|
946
|
+
/**
|
|
947
|
+
* 5. 将好友加入黑名单。
|
|
948
|
+
*
|
|
949
|
+
* 加入后将解除双方好友关系,对方无法再添加你。不能将自己加入黑名单,仅可将已有好友加入黑名单。
|
|
950
|
+
*
|
|
951
|
+
* @param friendId 好友 id(好友列表中的 friendId 字段)
|
|
952
|
+
*/
|
|
953
|
+
async addBlacklist(friendId) {
|
|
954
|
+
await this.executeOpen(
|
|
955
|
+
"POST",
|
|
956
|
+
this.appendQuery("/api/open/friend/addBlacklist", { friendId })
|
|
957
|
+
);
|
|
958
|
+
}
|
|
959
|
+
/** 6. 好友黑名单列表。 */
|
|
960
|
+
blacklistList(query) {
|
|
961
|
+
return this.executeOpen(
|
|
962
|
+
"POST",
|
|
963
|
+
"/api/open/friend/blacklistList",
|
|
964
|
+
query != null ? query : {}
|
|
965
|
+
);
|
|
966
|
+
}
|
|
967
|
+
/**
|
|
968
|
+
* 7. 解除好友黑名单。
|
|
969
|
+
*
|
|
970
|
+
* 解除后不会自动恢复好友关系,需重新扫码添加。
|
|
971
|
+
*
|
|
972
|
+
* @param id 黑名单记录 ID(黑名单列表中的 id 字段)
|
|
973
|
+
*/
|
|
974
|
+
async removeBlacklist(id) {
|
|
975
|
+
await this.executeOpen(
|
|
976
|
+
"POST",
|
|
977
|
+
this.appendQuery("/api/open/friend/removeBlacklist", { id })
|
|
978
|
+
);
|
|
979
|
+
}
|
|
809
980
|
};
|
|
810
981
|
|
|
811
982
|
// src/api/image-api.ts
|
|
@@ -854,7 +1025,7 @@ var ImageApi = class extends OpenAbstractApi {
|
|
|
854
1025
|
}
|
|
855
1026
|
const fileName = options.fileName || "file";
|
|
856
1027
|
const contentType = options.contentType || guessContentTypeByName(fileName) || "application/octet-stream";
|
|
857
|
-
const boundary = "----PushPlusBoundary" +
|
|
1028
|
+
const boundary = "----PushPlusBoundary" + randomBoundarySuffix2();
|
|
858
1029
|
const body = buildMultipartBody(boundary, uploadToken, fileName, contentType, bytes);
|
|
859
1030
|
const resp = await callExecuteRaw(this.http, {
|
|
860
1031
|
method: "POST",
|
|
@@ -940,7 +1111,7 @@ function buildMultipartBody(boundary, uploadToken, fileName, contentType, fileBy
|
|
|
940
1111
|
const crlf = "\r\n";
|
|
941
1112
|
const enc = new TextEncoder();
|
|
942
1113
|
const head = enc.encode(
|
|
943
|
-
`--${boundary}${crlf}Content-Disposition: form-data; name="token"${crlf}${crlf}${uploadToken}${crlf}--${boundary}${crlf}Content-Disposition: form-data; name="file"; filename="${
|
|
1114
|
+
`--${boundary}${crlf}Content-Disposition: form-data; name="token"${crlf}${crlf}${uploadToken}${crlf}--${boundary}${crlf}Content-Disposition: form-data; name="file"; filename="${escapeFileName2(fileName)}"${crlf}Content-Type: ${contentType}${crlf}${crlf}`
|
|
944
1115
|
);
|
|
945
1116
|
const tail = enc.encode(`${crlf}--${boundary}--${crlf}`);
|
|
946
1117
|
const out = new Uint8Array(head.byteLength + fileBytes.byteLength + tail.byteLength);
|
|
@@ -949,7 +1120,7 @@ function buildMultipartBody(boundary, uploadToken, fileName, contentType, fileBy
|
|
|
949
1120
|
out.set(tail, head.byteLength + fileBytes.byteLength);
|
|
950
1121
|
return out;
|
|
951
1122
|
}
|
|
952
|
-
function
|
|
1123
|
+
function escapeFileName2(name) {
|
|
953
1124
|
return name.replace(/"/g, "_").replace(/\r/g, " ").replace(/\n/g, " ");
|
|
954
1125
|
}
|
|
955
1126
|
function guessContentTypeByName(name) {
|
|
@@ -962,7 +1133,7 @@ function guessContentTypeByName(name) {
|
|
|
962
1133
|
if (lower.endsWith(".svg")) return "image/svg+xml";
|
|
963
1134
|
return null;
|
|
964
1135
|
}
|
|
965
|
-
function
|
|
1136
|
+
function randomBoundarySuffix2() {
|
|
966
1137
|
let s = "";
|
|
967
1138
|
for (let i = 0; i < 32; i++) {
|
|
968
1139
|
s += Math.floor(Math.random() * 16).toString(16);
|
|
@@ -1154,6 +1325,55 @@ var PreApi = class extends OpenAbstractApi {
|
|
|
1154
1325
|
}
|
|
1155
1326
|
};
|
|
1156
1327
|
|
|
1328
|
+
// src/api/qqbot-api.ts
|
|
1329
|
+
var SEND_TYPE_QQ_GROUP = 2;
|
|
1330
|
+
var QqBotApi = class extends OpenAbstractApi {
|
|
1331
|
+
constructor(config, http, mgr) {
|
|
1332
|
+
super(config, http, mgr);
|
|
1333
|
+
}
|
|
1334
|
+
/** 1. 获取绑定链接与绑定码;refresh 为 true 时旧绑定码失效并重新生成。 */
|
|
1335
|
+
getBindLink(refresh = false) {
|
|
1336
|
+
const path = refresh ? this.appendQuery("/api/open/qqBot/getBindLink", { refresh: true }) : "/api/open/qqBot/getBindLink";
|
|
1337
|
+
return this.executeOpen("GET", path);
|
|
1338
|
+
}
|
|
1339
|
+
/** 2. 查询绑定状态。 */
|
|
1340
|
+
botInfo() {
|
|
1341
|
+
return this.executeOpen("GET", "/api/open/qqBot/botInfo");
|
|
1342
|
+
}
|
|
1343
|
+
/** 3. 解绑 QQ 机器人。 */
|
|
1344
|
+
async unbind() {
|
|
1345
|
+
await this.executeOpen("GET", "/api/open/qqBot/unbind");
|
|
1346
|
+
}
|
|
1347
|
+
/** 4. 获取机器人已加入的 QQ 群列表。 */
|
|
1348
|
+
async groupList() {
|
|
1349
|
+
var _a;
|
|
1350
|
+
return (_a = await this.executeOpen("GET", "/api/open/qqBot/groupList")) != null ? _a : [];
|
|
1351
|
+
}
|
|
1352
|
+
/** 5. 获取 QQ 机器人渠道配置列表。 */
|
|
1353
|
+
list(q) {
|
|
1354
|
+
return this.executeOpen("POST", "/api/open/qqBot/list", q != null ? q : {});
|
|
1355
|
+
}
|
|
1356
|
+
/** 6. 新增渠道配置,用于把消息发送到指定 QQ 群;发给自己无需创建配置。 */
|
|
1357
|
+
async add(req) {
|
|
1358
|
+
await this.executeOpen("POST", "/api/open/qqBot/add", withDefaultSendType(req));
|
|
1359
|
+
}
|
|
1360
|
+
/** 7. 修改渠道配置;配置编码不可修改。 */
|
|
1361
|
+
async edit(req) {
|
|
1362
|
+
await this.executeOpen("POST", "/api/open/qqBot/edit", withDefaultSendType(req));
|
|
1363
|
+
}
|
|
1364
|
+
/** 8. 删除渠道配置。 */
|
|
1365
|
+
async delete(id) {
|
|
1366
|
+
await this.executeOpen(
|
|
1367
|
+
"DELETE",
|
|
1368
|
+
this.appendQuery("/api/open/qqBot/delete", { id })
|
|
1369
|
+
);
|
|
1370
|
+
}
|
|
1371
|
+
};
|
|
1372
|
+
function withDefaultSendType(req) {
|
|
1373
|
+
var _a;
|
|
1374
|
+
return { ...req, sendType: (_a = req.sendType) != null ? _a : SEND_TYPE_QQ_GROUP };
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1157
1377
|
// src/api/setting-api.ts
|
|
1158
1378
|
var SettingApi = class extends OpenAbstractApi {
|
|
1159
1379
|
constructor(config, http, mgr) {
|
|
@@ -1305,6 +1525,42 @@ var TopicUserApi = class extends OpenAbstractApi {
|
|
|
1305
1525
|
async editRemark(id, remark) {
|
|
1306
1526
|
await this.executeOpen("POST", "/api/open/topicUser/editRemark", { id, remark });
|
|
1307
1527
|
}
|
|
1528
|
+
/**
|
|
1529
|
+
* 4. 将订阅人加入黑名单。
|
|
1530
|
+
*
|
|
1531
|
+
* 加入后将移出群组,对方无法再加入该群组。积分群组不支持黑名单。不能将自己加入黑名单。
|
|
1532
|
+
*
|
|
1533
|
+
* @param topicRelationId 用户编号(订阅人列表中的 id 字段)
|
|
1534
|
+
*/
|
|
1535
|
+
async addBlacklist(topicRelationId) {
|
|
1536
|
+
const path = this.appendQuery("/api/open/topicUser/addBlacklist", { topicRelationId });
|
|
1537
|
+
await this.executeOpen("POST", path);
|
|
1538
|
+
}
|
|
1539
|
+
/**
|
|
1540
|
+
* 5. 订阅人黑名单列表。
|
|
1541
|
+
*
|
|
1542
|
+
* `query.params.topicId` 必填。
|
|
1543
|
+
*/
|
|
1544
|
+
blacklistList(query) {
|
|
1545
|
+
return this.executeOpen(
|
|
1546
|
+
"POST",
|
|
1547
|
+
"/api/open/topicUser/blacklistList",
|
|
1548
|
+
query
|
|
1549
|
+
);
|
|
1550
|
+
}
|
|
1551
|
+
/**
|
|
1552
|
+
* 6. 解除订阅人黑名单。
|
|
1553
|
+
*
|
|
1554
|
+
* 解除后不会自动恢复群组订阅,对方可重新加入该群组。
|
|
1555
|
+
*
|
|
1556
|
+
* @param id 黑名单记录 ID(黑名单列表中的 id 字段)
|
|
1557
|
+
*/
|
|
1558
|
+
async removeBlacklist(id) {
|
|
1559
|
+
await this.executeOpen(
|
|
1560
|
+
"POST",
|
|
1561
|
+
this.appendQuery("/api/open/topicUser/removeBlacklist", { id })
|
|
1562
|
+
);
|
|
1563
|
+
}
|
|
1308
1564
|
};
|
|
1309
1565
|
|
|
1310
1566
|
// src/api/user-api.ts
|
|
@@ -1369,7 +1625,7 @@ function resolveConfig(input) {
|
|
|
1369
1625
|
logRequest: (_g = cfg.logRequest) != null ? _g : false,
|
|
1370
1626
|
rateLimitGuardEnabled: (_h = cfg.rateLimitGuardEnabled) != null ? _h : true,
|
|
1371
1627
|
rateLimitCooldownMs: (_i = cfg.rateLimitCooldownMs) != null ? _i : 0,
|
|
1372
|
-
userAgent: (_j = cfg.userAgent) != null ? _j : `@perk-net/perk-pushplus-sdk/1.2.
|
|
1628
|
+
userAgent: (_j = cfg.userAgent) != null ? _j : `@perk-net/perk-pushplus-sdk/1.2.1`
|
|
1373
1629
|
};
|
|
1374
1630
|
}
|
|
1375
1631
|
|
|
@@ -1461,6 +1717,7 @@ var PushPlusClient = class _PushPlusClient {
|
|
|
1461
1717
|
this.webhook = new WebhookApi(this.config, this.httpRequester, this.accessKeyManager);
|
|
1462
1718
|
this.channel = new ChannelApi(this.config, this.httpRequester, this.accessKeyManager);
|
|
1463
1719
|
this.clawBot = new ClawBotApi(this.config, this.httpRequester, this.accessKeyManager);
|
|
1720
|
+
this.qqBot = new QqBotApi(this.config, this.httpRequester, this.accessKeyManager);
|
|
1464
1721
|
this.setting = new SettingApi(this.config, this.httpRequester, this.accessKeyManager);
|
|
1465
1722
|
this.pre = new PreApi(this.config, this.httpRequester, this.accessKeyManager);
|
|
1466
1723
|
this.image = new ImageApi(this.config, this.httpRequester, this.accessKeyManager);
|
|
@@ -1700,6 +1957,6 @@ function batchSendRequest() {
|
|
|
1700
1957
|
return new BatchSendRequestBuilder();
|
|
1701
1958
|
}
|
|
1702
1959
|
|
|
1703
|
-
export { AbstractApi, AccessKeyApi, AccessKeyManager, BatchSendRequestBuilder, CallbackEvent, CallbackParser, Channel, ChannelApi, ClawBotApi, DEFAULT_BASE_URL, DocApi, ErrorCode, ExcelApi, FetchHttpRequester, FormApi, FormStatus, FormStatusDescription, FriendApi, ImageApi, MessageApi, MessageTokenApi, OpenAbstractApi, OpenMessageApi, PreApi, PushPlusClient, PushPlusClientBuilder, PushPlusError, PushPlusException, RateLimitGuard, SendRequestBuilder, SendStatus, SendStatusDescription, SettingApi, ShareLogin, SharePerm, Template, TopicApi, TopicUserApi, UserApi, WebhookApi, WebhookType, WebhookTypeDescription, batchSendRequest, callExecuteRaw, errorCodeFromValue, isRateLimitedCode, isSuccessfulHttpStatus, parseCallback, resolveConfig, sendRequest };
|
|
1960
|
+
export { AbstractApi, AccessKeyApi, AccessKeyManager, BatchSendRequestBuilder, CallbackEvent, CallbackParser, Channel, ChannelApi, ClawBotApi, DEFAULT_BASE_URL, DocApi, ErrorCode, ExcelApi, FetchHttpRequester, FormApi, FormStatus, FormStatusDescription, FriendApi, ImageApi, MessageApi, MessageTokenApi, OpenAbstractApi, OpenMessageApi, PreApi, PushPlusClient, PushPlusClientBuilder, PushPlusError, PushPlusException, QqBotApi, RateLimitGuard, SendRequestBuilder, SendStatus, SendStatusDescription, SettingApi, ShareLogin, SharePerm, Template, TopicApi, TopicUserApi, UserApi, WebhookApi, WebhookType, WebhookTypeDescription, batchSendRequest, callExecuteRaw, errorCodeFromValue, isRateLimitedCode, isSuccessfulHttpStatus, parseCallback, resolveConfig, sendRequest };
|
|
1704
1961
|
//# sourceMappingURL=index.js.map
|
|
1705
1962
|
//# sourceMappingURL=index.js.map
|