yz-yuki-plugin 2.0.5-1 → 2.0.5-10

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.
Files changed (68) hide show
  1. package/.puppeteerrc.cjs +1 -1
  2. package/CHANGELOG.md +2 -0
  3. package/README.md +15 -21
  4. package/defaultConfig/bilibili/config.yaml +6 -0
  5. package/defaultConfig/help/help.yaml +2 -2
  6. package/lib/apps/bilibili.js +6 -6
  7. package/lib/apps/help.js +1 -1
  8. package/lib/apps/version.js +1 -1
  9. package/lib/apps/weibo.js +1 -1
  10. package/lib/components/dynamic/Footer.js +1 -1
  11. package/lib/components/help/Help.js +1 -1
  12. package/lib/components/version/Version.js +1 -1
  13. package/lib/index.js +2 -2
  14. package/lib/main.js +11 -0
  15. package/lib/models/bilibili/bilibili.main.api.js +125 -0
  16. package/lib/models/bilibili/{bilibili.get.web.data.js → bilibili.main.get.web.data.js} +19 -10
  17. package/lib/models/bilibili/{bilibili.models.js → bilibili.main.models.js} +57 -45
  18. package/lib/models/bilibili/{bilibili.query.js → bilibili.main.query.js} +3 -3
  19. package/lib/models/bilibili/{bilibili.task.js → bilibili.main.task.js} +26 -30
  20. package/lib/models/bilibili/bilibili.risk.buid.fp.js +77 -0
  21. package/lib/models/bilibili/bilibili.risk.dm.img.js +17 -0
  22. package/lib/models/bilibili/{bilibili.ticket.js → bilibili.risk.ticket.js} +1 -1
  23. package/lib/models/bilibili/bilibili.risk.w_webid.js +43 -0
  24. package/lib/models/weibo/weibo.get.web.data.js +1 -1
  25. package/lib/models/weibo/weibo.query.js +1 -1
  26. package/lib/models/weibo/weibo.task.js +8 -6
  27. package/lib/utils/config.js +3 -3
  28. package/lib/utils/image.js +4 -4
  29. package/package.json +20 -35
  30. package/lib/apps/bilibili.d.ts +0 -6
  31. package/lib/apps/help.d.ts +0 -6
  32. package/lib/apps/index.d.ts +0 -4
  33. package/lib/apps/version.d.ts +0 -6
  34. package/lib/apps/weibo.d.ts +0 -6
  35. package/lib/components/dynamic/Account.d.ts +0 -13
  36. package/lib/components/dynamic/Content.d.ts +0 -12
  37. package/lib/components/dynamic/Footer.d.ts +0 -11
  38. package/lib/components/dynamic/ForwardContent.d.ts +0 -6
  39. package/lib/components/dynamic/LogoText.d.ts +0 -9
  40. package/lib/components/dynamic/MainPage.d.ts +0 -34
  41. package/lib/components/help/Help.d.ts +0 -12
  42. package/lib/components/index.d.ts +0 -5
  43. package/lib/components/loginQrcode/Page.d.ts +0 -7
  44. package/lib/components/version/Version.d.ts +0 -8
  45. package/lib/index.d.ts +0 -5
  46. package/lib/main.d.ts +0 -1
  47. package/lib/models/bilibili/bilibili.api.d.ts +0 -70
  48. package/lib/models/bilibili/bilibili.api.js +0 -78
  49. package/lib/models/bilibili/bilibili.buid.fp.d.ts +0 -2
  50. package/lib/models/bilibili/bilibili.get.web.data.d.ts +0 -9
  51. package/lib/models/bilibili/bilibili.models.d.ts +0 -63
  52. package/lib/models/bilibili/bilibili.query.d.ts +0 -49
  53. package/lib/models/bilibili/bilibili.task.d.ts +0 -77
  54. package/lib/models/bilibili/bilibili.ticket.d.ts +0 -12
  55. package/lib/models/bilibili/bilibili.wbi.d.ts +0 -11
  56. package/lib/models/help/help.d.ts +0 -8
  57. package/lib/models/version/version.d.ts +0 -17
  58. package/lib/models/weibo/weibo.api.d.ts +0 -18
  59. package/lib/models/weibo/weibo.get.web.data.d.ts +0 -11
  60. package/lib/models/weibo/weibo.query.d.ts +0 -38
  61. package/lib/models/weibo/weibo.task.d.ts +0 -84
  62. package/lib/utils/config.d.ts +0 -73
  63. package/lib/utils/image.d.ts +0 -15
  64. package/lib/utils/paths.d.ts +0 -22
  65. package/lib/utils/puppeteer.render.d.ts +0 -40
  66. package/public/output.css +0 -1
  67. package/resources/img/readme/mini-help.jpg +0 -0
  68. /package/lib/models/bilibili/{bilibili.wbi.js → bilibili.risk.wbi.js} +0 -0
@@ -1,70 +0,0 @@
1
- export declare class BiliApi {
2
- static BILIBIL_API: {
3
- biliDynamicInfoList: string;
4
- biliUpFollowFans: string;
5
- biliSpaceUserInfo: string;
6
- biliSpaceUserInfoWbi: string;
7
- biliSearchUp: string;
8
- biliSearchUpWbi: string;
9
- biliLiveStatus: string;
10
- biliCard: string;
11
- biliStat: string;
12
- biliLiveUserInfo: string;
13
- biliOpusDetail: string;
14
- };
15
- /**header */
16
- static BILIBILI_HEADERS: {
17
- Accept: string;
18
- 'Accept-Language': string;
19
- 'Accept-Encoding': string;
20
- 'Content-type': string;
21
- Cookie: string;
22
- pragma: string;
23
- 'Cache-control': string;
24
- DNT: string;
25
- 'Sec-GPC': string;
26
- 'sec-ch-ua-platform': string;
27
- 'sec-ch-ua-mobile': string;
28
- 'Sec-Fetch-Dest': string;
29
- 'Sec-Fetch-Mode': string;
30
- 'Sec-Fetch-Site': string;
31
- 'Sec-Fetch-User': string;
32
- TE: string;
33
- 'Upgrade-Insecure-Requests': string;
34
- 'User-Agent': string;
35
- };
36
- /**Login header */
37
- static BIlIBILI_LOGIN_HEADERS: {
38
- Accept: string;
39
- 'Accept-Language': string;
40
- 'Accept-Encoding': string;
41
- DNT: string;
42
- 'Sec-GPC': string;
43
- 'Upgrade-Insecure-Requests': string;
44
- 'Sec-Fetch-Dest': string;
45
- 'Sec-Fetch-Mode': string;
46
- 'Sec-Fetch-Site': string;
47
- 'Sec-Fetch-User': string;
48
- TE: string;
49
- };
50
- /**FullArticle header */
51
- static BILIBILI_ARTICLE_HEADERS: {
52
- Accept: string;
53
- 'Accept-Language': string;
54
- 'Accept-Encoding': string;
55
- 'Content-type': string;
56
- Cookie: string;
57
- pragma: string;
58
- 'Cache-control': string;
59
- DNT: string;
60
- 'Sec-GPC': string;
61
- 'sec-ch-ua-mobile': string;
62
- 'Sec-Fetch-Dest': string;
63
- 'Sec-Fetch-Mode': string;
64
- 'Sec-Fetch-Site': string;
65
- 'Sec-Fetch-User': string;
66
- TE: string;
67
- 'Upgrade-Insecure-Requests': string;
68
- 'User-Agent': string;
69
- };
70
- }
@@ -1,78 +0,0 @@
1
- class BiliApi {
2
- static BILIBIL_API = {
3
- //获取动态资源列表 wbi/无wbi parama = { host_mid: uid, timezone_offset: -480, platform: 'web', features: 'itemOpusStyle,listOnlyfans,opusBigCover,onlyfansVote', web_location: "333.999", ...getDmImg(), "x-bili-device-req-json": { "platform": "web", "device": "pc" }, "x-bili-web-req-json": { "spm_id": "333.999" }, w_rid, wts }
4
- biliDynamicInfoList: `https://api.bilibili.com/x/polymer/web-dynamic/v1/feed/space`,
5
- //获取关注数与粉丝数 parama = { vmid: uid }
6
- biliUpFollowFans: `https://api.bilibili.com/x/relation/stat`,
7
- //通过uid获取up详情 parama = { mid: uid, jsonp: jsonp }
8
- biliSpaceUserInfo: `https://api.bilibili.com/x/space/acc/info`,
9
- //parama = { mid: uid, jsonp: jsonp }
10
- biliSpaceUserInfoWbi: `https://api.bilibili.com/x/space/wbi/acc/info`,
11
- //通过关键词${upKeyword}搜索up主 parama = { keyword: 'upKeyword', page: 1, search_type: 'bili_user', order: 'totalrank', pagesize: 5 }
12
- biliSearchUp: `https://api.bilibili.com/x/web-interface/search/type`,
13
- //通过关键词${upKeyword}搜索up主 parama = { keyword: 'upKeyword', page: 1, search_type: 'bili_user', order: 'totalrank' },需要wbi签名
14
- biliSearchUpWbi: `https://api.bilibili.com/x/web-interface/wbi/search/type`,
15
- biliLiveStatus: 'https://api.live.bilibili.com/room/v1/Room/get_status_info_by_uids',
16
- biliCard: 'https://api.bilibili.com/x/web-interface/card',
17
- biliStat: 'https://api.bilibili.com/x/relation/stat',
18
- biliLiveUserInfo: 'https://api.live.bilibili.com/live_user/v1/Master/info',
19
- biliOpusDetail: 'https://api.bilibili.com/x/polymer/web-dynamic/v1/opus/detail'
20
- };
21
- /**header */
22
- static BILIBILI_HEADERS = {
23
- 'Accept': '*/*',
24
- 'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
25
- 'Accept-Encoding': 'gzip, deflate, br',
26
- 'Content-type': 'application/json;charset=UTF-8',
27
- 'Cookie': '',
28
- 'pragma': 'no-cache',
29
- 'Cache-control': 'max-age=0',
30
- 'DNT': '1',
31
- 'Sec-GPC': '1',
32
- 'sec-ch-ua-platform': '',
33
- 'sec-ch-ua-mobile': '?0',
34
- 'Sec-Fetch-Dest': 'empty',
35
- 'Sec-Fetch-Mode': 'cors',
36
- 'Sec-Fetch-Site': 'same-site',
37
- 'Sec-Fetch-User': '?0',
38
- 'TE': 'trailers',
39
- 'Upgrade-Insecure-Requests': '1',
40
- 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0'
41
- };
42
- /**Login header */
43
- static BIlIBILI_LOGIN_HEADERS = {
44
- 'Accept': '*/*',
45
- 'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
46
- 'Accept-Encoding': 'gzip, deflate, br',
47
- 'DNT': '1',
48
- 'Sec-GPC': '1',
49
- 'Upgrade-Insecure-Requests': '1',
50
- 'Sec-Fetch-Dest': 'document',
51
- 'Sec-Fetch-Mode': 'navigate',
52
- 'Sec-Fetch-Site': 'none',
53
- 'Sec-Fetch-User': '?1',
54
- 'TE': 'trailers'
55
- };
56
- /**FullArticle header */
57
- static BILIBILI_ARTICLE_HEADERS = {
58
- 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8',
59
- 'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
60
- 'Accept-Encoding': 'gzip, deflate, br',
61
- 'Content-type': 'text/html; charset=utf-8',
62
- 'Cookie': '',
63
- 'pragma': 'no-cache',
64
- 'Cache-control': 'no-cache',
65
- 'DNT': '1',
66
- 'Sec-GPC': '1',
67
- 'sec-ch-ua-mobile': '?0',
68
- 'Sec-Fetch-Dest': 'document',
69
- 'Sec-Fetch-Mode': 'navigate',
70
- 'Sec-Fetch-Site': 'same-site',
71
- 'Sec-Fetch-User': '?1',
72
- 'TE': 'trailers',
73
- 'Upgrade-Insecure-Requests': '1',
74
- 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0'
75
- };
76
- }
77
-
78
- export { BiliApi };
@@ -1,2 +0,0 @@
1
- declare function gen_buvid_fp(uuid: any, seed: any): string;
2
- export { gen_buvid_fp };
@@ -1,9 +0,0 @@
1
- export declare class BiliGetWebData {
2
- constructor(e?: any);
3
- /**通过uid获取up动态数据表*/
4
- getBiliDynamicListDataByUid(uid: any): Promise<import("axios").AxiosResponse<any, any>>;
5
- /**通过uid获取up详情*/
6
- getBilibiUserInfoByUid(uid: any): Promise<import("axios").AxiosResponse<any, any>>;
7
- /**通过关键词搜索up*/
8
- searchBiliUserInfoByKeyword(keyword: string): Promise<import("axios").AxiosResponse<any, any>>;
9
- }
@@ -1,63 +0,0 @@
1
- import { EventType } from 'yunzai';
2
- /**
3
- * *******************************************************************
4
- * Login 相关
5
- * *******************************************************************
6
- */
7
- /**申请登陆二维码(web端) */
8
- export declare function applyLoginQRCode(e: EventType): Promise<string>;
9
- /**处理扫码结果 */
10
- export declare function pollLoginQRCode(e: EventType, qrcodeKey: string): Promise<string>;
11
- /**查看app扫码登陆获取的ck的有效状态*/
12
- export declare function checkBiliLogin(e: EventType): Promise<void>;
13
- /**退出B站账号登录,将会删除redis缓存的LoginCK,并在服务器注销该登录 Token (SESSDATA)*/
14
- export declare function exitBiliLogin(e: EventType): Promise<void>;
15
- /**
16
- * *******************************************************************
17
- * cookie相关
18
- * *******************************************************************
19
- */
20
- /**保存扫码登录的loginCK*/
21
- export declare function saveLoginCookie(e: EventType, biliLoginCk: string): Promise<void>;
22
- /** 覆盖保存手动获取绑定的B站ck */
23
- export declare function saveLocalBiliCk(data: any): Promise<void>;
24
- /** 读取缓存的tempCK */
25
- export declare function readTempCk(): Promise<string>;
26
- /**保存tempCK*/
27
- export declare function saveTempCk(newTempCk: any): Promise<void>;
28
- /** 综合获取ck,返回优先级:localCK > loginCK > tempCK */
29
- export declare function readSyncCookie(): Promise<{
30
- cookie: any;
31
- mark: string;
32
- }>;
33
- /**
34
- * 综合读取、筛选 传入的或本地或redis存储的cookie的item
35
- * @param {string} mark 读取存储的CK类型,'localCK' 'tempCK' 'loginCK' 或传入值 'xxx'并进行筛选
36
- * @param {Array} items 选取获取CK的项 选全部值:items[0] = 'all' ,或选取其中的值 ['buvid3', 'buvid4', '_uuid', 'SESSDATA', 'DedeUserID', 'DedeUserID__ckMd5', 'bili_jct', 'b_nut', 'b_lsid']
37
- * @param {boolean} isInverted 控制正取和反取,true为反取,false为正取
38
- * @returns {string}
39
- **/
40
- export declare function readSavedCookieItems(mark: string, items: Array<string>, isInverted?: boolean): Promise<string>;
41
- export declare function readSavedCookieOtherItems(mark: string, items: Array<string>): Promise<string>;
42
- /** 生成 _uuid */
43
- export declare function genUUID(): Promise<string>;
44
- /**生成 b_lsid */
45
- export declare function gen_b_lsid(): Promise<string>;
46
- /**获取新的tempCK*/
47
- export declare function getNewTempCk(): Promise<void>;
48
- /**
49
- * 请求参数POST接口(ExClimbWuzhi)过校验
50
- * @param cookie 请求所需的cookie
51
- * @returns 返回POST请求的结果
52
- */
53
- export declare function postGateway(cookie: string): Promise<import("axios").AxiosResponse<any, any>>;
54
- /**生成buvid_fp
55
- * @param {string} uuid
56
- */
57
- export declare function get_buvid_fp(cookie: string): Promise<string>;
58
- /**
59
- * 获取有效bili_ticket并添加到cookie
60
- * @param {string} cookie
61
- * @returns {Promise<{ cookie: string; }>} 返回包含最新有效的bili_ticket的cookie
62
- */
63
- export declare function cookieWithBiliTicket(cookie: string): Promise<string>;
@@ -1,49 +0,0 @@
1
- export declare class BiliQuery {
2
- /**
3
- * 序列化动态数据
4
- * @param data - 动态数据对象
5
- * @returns 序列化后的动态数据对象
6
- */
7
- static formatDynamicData(data: any): Promise<{
8
- uid: any;
9
- data: {
10
- [key: string]: any;
11
- };
12
- }>;
13
- /**
14
- * 动态内容富文本节点解析
15
- * @param nodes - 动态内容富文本节点
16
- * @returns 解析后的动态内容富文本
17
- */
18
- static parseRichTextNodes: (nodes: any[] | string | any) => any;
19
- /**获取完整B站文章内容
20
- * @param postUrl - 文章链接: https://www.bilibili.com/read/cvxxxx 或者 https://www.bilibili.com/opus/xxxx
21
- * @returns {Json} 完整的B站文章内容json数据
22
- */
23
- static getFullArticleContent(postUrl: string): Promise<{
24
- readInfo: any;
25
- articleType: string;
26
- }>;
27
- /**解析旧版完整文章内容 */
28
- static praseFullOldTypeArticleContent(content: string): string;
29
- /**解析新版完整文章内容
30
- * @param paragraphs - MODULE_TYPE_CONTENT 类型文章的段落数组
31
- */
32
- static praseFullNewTypeArticleContent: (paragraphs: any[] | any) => {
33
- content: string;
34
- img: any[];
35
- };
36
- static formatUrl(url: string): string;
37
- /**
38
- * 生成动态消息文字内容
39
- * @param upName - UP主名称
40
- * @param formatData - 动态数据
41
- * @param isForward - 是否为转发动态
42
- * @param setData - 设置数据
43
- * @returns 生成的动态消息文字内容
44
- */
45
- static formatTextDynamicData(upName: string, data: any, isForward: boolean, setData: any): Promise<any>;
46
- static dynamicContentLimit(content: string, setData: any): string;
47
- /**根据关键字更新 up 的动态类型 */
48
- static typeHandle(up: any, msg: string, type: string): unknown[];
49
- }
@@ -1,77 +0,0 @@
1
- import { EventType } from 'yunzai';
2
- import { MainProps } from '@/components/dynamic/MainPage';
3
- import { ScreenshotOptions } from '@/utils/puppeteer.render';
4
- export declare class BiliTask {
5
- taskName: string;
6
- groupKey: string;
7
- privateKey: string;
8
- e?: EventType;
9
- constructor(e?: EventType);
10
- hendleEventDynamicData(uid: string | number, count?: number): Promise<any>;
11
- runTask(): Promise<void>;
12
- /**
13
- * 处理Bilibili数据,获取动态列表并构建 uid 映射
14
- * @param biliPushData Bilibili推送数据
15
- * @param uidMap uid 映射
16
- * @param dynamicList 动态列表
17
- * @param lastLiveStatus 最后直播状态
18
- */
19
- processBiliData(biliPushData: {
20
- group?: {
21
- [chatId: string]: {
22
- bot_id: string;
23
- uid: string;
24
- name: string;
25
- type: string[];
26
- }[];
27
- };
28
- private?: {
29
- [chatId: string]: {
30
- bot_id: string;
31
- uid: string;
32
- name: string;
33
- type: string[];
34
- }[];
35
- };
36
- }, biliConfigData: any, uidMap: Map<any, Map<string, any>>, dynamicList: any): Promise<void>;
37
- /**
38
- * 推送动态消息
39
- * @param uidMap uid 映射
40
- * @param dynamicList 动态列表
41
- * @param now 当前时间戳
42
- * @param interval 推送间隔时间
43
- * @param biliConfigData Bilibili配置数据
44
- */
45
- pushDynamicMessages(uidMap: Map<any, Map<string, any>>, dynamicList: any, now: number, interval: number, biliConfigData: any): Promise<void>;
46
- sendDynamic(chatId: string | number, bot_id: string | number, upName: string, pushDynamicData: any, biliConfigData: any, chatType: string): Promise<string>;
47
- /**
48
- * 构建渲染数据
49
- * @param extentData 扩展数据
50
- * @param urlQrcodeData URL 二维码数据
51
- * @param boxGrid 是否启用九宫格样式
52
- * @returns 渲染数据
53
- */
54
- buildRenderData(extentData: any, urlQrcodeData: string, boxGrid: boolean): MainProps;
55
- /**
56
- * 渲染动态卡片
57
- * @param uid 用户 ID
58
- * @param renderData 渲染数据
59
- * @param ScreenshotOptionsData 截图选项数据
60
- * @returns 图片数据
61
- */
62
- renderDynamicCard(uid: string, renderData: MainProps, ScreenshotOptionsData: ScreenshotOptions): Promise<Buffer[] | null>;
63
- /**
64
- * 发送消息
65
- * @param chatId 聊天 ID
66
- * @param bot_id 机器人 ID
67
- * @param chatType 聊天类型
68
- * @param message 消息内容
69
- */
70
- sendMessage(chatId: string | number, bot_id: string | number, chatType: string, message: any): Promise<void>;
71
- /**
72
- * 随机延时
73
- * @param min 最小延时时间
74
- * @param max 最大延时时间
75
- */
76
- randomDelay(min: number, max: number): Promise<void>;
77
- }
@@ -1,12 +0,0 @@
1
- /**
2
- * Get Bilibili web ticket
3
- * @param {string | null} csrf CSRF token, can be empty or null, or the cookie's bili_jct value
4
- * @returns {Promise<{ code: number, ticket: string, created_at: number, ttl: number }>}
5
- * Promise that resolves to an object containing code, ticket, created_at, and ttl values
6
- */
7
- export declare function getBiliTicket(csrf: string | null): Promise<{
8
- code?: number;
9
- ticket?: string;
10
- created_at?: number;
11
- ttl?: number;
12
- }>;
@@ -1,11 +0,0 @@
1
- /**
2
- * https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/misc/sign/wbi.md#javascript
3
- * 对实际请求参数进行 wbi 签名, 生成 wbi 签名
4
- * @param {object} params 除了 wbi 签名外的全部请求参数,例如 api get请求的查询参数 { uid: 12345678, jsonp: jsonp}
5
- * @param {object} headers 必需要 referer 和 UA 两个请求头
6
- */
7
- export declare function getWbiSign(params: any, headers: any, cookie: string): Promise<{
8
- query: string;
9
- w_rid: string;
10
- time_stamp: number;
11
- }>;
@@ -1,8 +0,0 @@
1
- import { EventType } from 'yunzai';
2
- export default class Help {
3
- e?: EventType;
4
- model: string;
5
- constructor(e?: EventType);
6
- static get(e?: EventType): Promise<any[]>;
7
- getData(): Promise<any[]>;
8
- }
@@ -1,17 +0,0 @@
1
- export default class VersionData {
2
- model: string;
3
- cache: any;
4
- versionPath: string;
5
- constructor();
6
- /**
7
- * CHANGELOG.md内容支持示例:
8
- * # 1.0.0
9
- * * 新增功能3
10
- * * 新增功能4
11
- *
12
- * # 0.1.0
13
- * * 新增功能1
14
- * * 新增功能2
15
- */
16
- getChangelogContent(): Promise<any>;
17
- }
@@ -1,18 +0,0 @@
1
- export declare class WeiboApi {
2
- static WEIBO_API: {
3
- weiboGetIndex: string;
4
- weiboAjaxSearch: string;
5
- };
6
- /**统一设置header */
7
- static WEIBO_HEADERS: {
8
- Accept: string;
9
- 'Accept-language': string;
10
- Authority: string;
11
- 'Cache-control': string;
12
- 'Sec-fetch-dest': string;
13
- 'Sec-fetch-mode': string;
14
- 'Sec-fetch-site': string;
15
- 'Upgrade-insecure-requests': string;
16
- 'User-agent': string;
17
- };
18
- }
@@ -1,11 +0,0 @@
1
- import { EventType } from 'yunzai';
2
- export declare class WeiboGetWebData {
3
- e?: EventType;
4
- constructor(e?: EventType);
5
- /**通过uid获取博主信息 */
6
- getBloggerInfo(target: any): Promise<import("axios").AxiosResponse<any, any>>;
7
- /**通过关键词搜索微博大v */
8
- searchBloggerInfo(keyword: string): Promise<import("axios").AxiosResponse<any, any>>;
9
- /**获取主页动态资源相关数组 */
10
- getBloggerDynamicList(target: any): Promise<any>;
11
- }
@@ -1,38 +0,0 @@
1
- export declare class WeiboQuery {
2
- /**获取文章id */
3
- static getDynamicId(post: any): any;
4
- /**获取指定动态类型的原始数据 */
5
- static filterCardTypeCustom(raw_post: any): boolean;
6
- /**转换微博动态创建时间:(created_at)转换为 UNIX 时间戳(以毫秒为单位) */
7
- static getDynamicCreatetDate(raw_post: any): number;
8
- /**分类动态,返回标识 */
9
- static MakeCategory(raw_post: any): "DYNAMIC_TYPE_AV" | "DYNAMIC_TYPE_DRAW" | "DYNAMIC_TYPE_ARTICLE" | "DYNAMIC_TYPE_FORWARD";
10
- /**筛选正文 */
11
- static filterText(raw_text: string): string;
12
- /** 获取并生成微博动态渲染数据 */
13
- static formatDynamicData(raw_post: any): Promise<{
14
- uid: any;
15
- data: {
16
- [key: string]: any;
17
- };
18
- }>;
19
- /**
20
- * 动态内容富文本节点解析
21
- * @param nodes - 动态内容富文本节点
22
- * @returns 解析后的动态内容富文本
23
- */
24
- static parseRichTextNodes: (nodes: any[] | string | any) => any;
25
- /**
26
- * 生成动态消息文字内容
27
- * @param upName - UP主名称
28
- * @param formatData - 动态数据
29
- * @param isForward - 是否为转发动态
30
- * @param setData - 设置数据
31
- * @returns 生成的动态消息文字内容
32
- */
33
- static formatTextDynamicData(upName: string, raw_post: any, isForward?: boolean, setData?: any): Promise<false | any[] | "continue">;
34
- static dynamicContentLimit(content: string, setData: any): string;
35
- static formatUrl(url: string): string;
36
- /**推送类型设置 */
37
- static typeHandle(up: any, msg: string, type: string): unknown[];
38
- }
@@ -1,84 +0,0 @@
1
- import { EventType } from 'yunzai';
2
- import { MainProps } from '@/components/dynamic/MainPage';
3
- import { ScreenshotOptions } from '@/utils/puppeteer.render';
4
- export declare class WeiboTask {
5
- taskName: string;
6
- groupKey: string;
7
- privateKey: string;
8
- e?: EventType;
9
- constructor(e?: any);
10
- runTask(): Promise<void>;
11
- /**
12
- * 处理微博数据,获取动态列表并构建 uid 映射
13
- * @param weiboPushData 微博推送数据
14
- * @param uidMap uid 映射
15
- * @param dynamicList 动态列表
16
- */
17
- processWeiboData(weiboPushData: {
18
- group?: {
19
- [chatId: string]: {
20
- bot_id: string;
21
- uid: string;
22
- name: string;
23
- type: string[];
24
- }[];
25
- };
26
- private?: {
27
- [chatId: string]: {
28
- bot_id: string;
29
- uid: string;
30
- name: string;
31
- type: string[];
32
- }[];
33
- };
34
- }, uidMap: Map<any, Map<string, any>>, dynamicList: any): Promise<void>;
35
- /**
36
- * 推送动态消息
37
- * @param uidMap uid 映射
38
- * @param dynamicList 动态列表
39
- * @param now 当前时间戳
40
- * @param interval 推送间隔时间
41
- * @param weiboConfigData 微博配置数据
42
- */
43
- pushDynamicMessages(uidMap: Map<any, Map<string, any>>, dynamicList: any, now: number, interval: number, weiboConfigData: any): Promise<void>;
44
- /**
45
- * 发送动态消息
46
- * @param chatId 聊天 ID
47
- * @param bot_id 机器人 ID
48
- * @param upName 用户名
49
- * @param pushDynamicData 推送动态数据
50
- * @param weiboConfigData 微博配置数据
51
- * @param chatType 聊天类型
52
- */
53
- sendDynamic(chatId: string | number, bot_id: string | number, upName: string, pushDynamicData: any, weiboConfigData: any, chatType: string): Promise<string>;
54
- /**
55
- * 构建渲染数据
56
- * @param extentData 扩展数据
57
- * @param urlQrcodeData URL 二维码数据
58
- * @param boxGrid 是否启用九宫格样式
59
- * @returns 渲染数据
60
- */
61
- buildRenderData(extentData: any, urlQrcodeData: string, boxGrid: boolean): MainProps;
62
- /**
63
- * 渲染动态卡片
64
- * @param uid 用户 ID
65
- * @param renderData 渲染数据
66
- * @param ScreenshotOptionsData 截图选项数据
67
- * @returns 图片数据
68
- */
69
- renderDynamicCard(uid: string | number, renderData: MainProps, ScreenshotOptionsData: ScreenshotOptions): Promise<Buffer[] | null>;
70
- /**
71
- * 发送消息
72
- * @param chatId 聊天 ID
73
- * @param bot_id 机器人 ID
74
- * @param chatType 聊天类型
75
- * @param message 消息内容
76
- */
77
- sendMessage(chatId: string | number, bot_id: string | number, chatType: string, message: any): Promise<void>;
78
- /**
79
- * 随机延时
80
- * @param min 最小延时时间
81
- * @param max 最大延时时间
82
- */
83
- randomDelay(min: number, max: number): Promise<void>;
84
- }
@@ -1,73 +0,0 @@
1
- import chokidar from 'chokidar';
2
- /**
3
- * Config 类用于管理配置文件的读取和监听
4
- */
5
- declare class Config {
6
- readonly defaultConfigPath: string;
7
- readonly userConfigPath: string;
8
- defaultConfig: Record<string, any>;
9
- userConfig: Record<string, any>;
10
- watcher: Record<string, chokidar.FSWatcher>;
11
- constructor();
12
- /** 操作并创建配置文件到指定目录 */
13
- initConfigFiles(): void;
14
- /**
15
- * 通用获取配置文件数据方法
16
- * @param typeDir 配置文件目录类型对应路径 defaultConfig: defaultConfig 或 config: yunzai/data/yuki-plugin/config
17
- * @param appDir 配置app目录
18
- * @param functionName 配置文件名称,不包含.yaml后缀
19
- * @returns {object} 配置数据
20
- */
21
- getConfigData(typeDir: string, appDir: string, functionName: string): any;
22
- /**
23
- * 获取配置文件路径
24
- * @param typeDir 配置文件目录类型对应路径 defaultConfig: defaultConfig 或 config: yunzai/data/yuki-plugin/config
25
- * @param appDir 配置app目录
26
- * @param functionName 配置文件名称,不包含.yaml后缀
27
- * @returns {string} 配置文件路径
28
- */
29
- getConfigFilePath(typeDir: string, appDir: string, functionName: string): string;
30
- /**
31
- * 监听配置文件的变化
32
- * @param configFilePath 文件路径
33
- * @param typeDir 配置文件目录类型对应路径 defaultConfig: defaultConfig 或 config: yunzai/data/yuki-plugin/config
34
- * @param appDir 配置app目录
35
- * @param functionName 配置文件名称,不包含.yaml后缀
36
- */
37
- watch(configFilePath: string, typeDir: string, appDir: string, functionName: string): void;
38
- /**
39
- * 获取默认配置
40
- * @param appDir 配置app目录
41
- * @param functionName 配置文件名称,不包含.yaml后缀
42
- */
43
- getDefaultConfig(appDir: string, functionName: string): any;
44
- /**
45
- * 获取用户配置
46
- * @param appDir 配置app目录
47
- * @param functionName 配置文件名称,不包含.yaml后缀
48
- */
49
- getUserConfig(appDir: string, functionName: string): any;
50
- /**
51
- * 保存配置文件
52
- * @param typeDir 插件为起始的配置文件目录
53
- * @param appDir 配置app目录
54
- * @param functionName 配置文件名称,不包含.yaml后缀
55
- * @param data 配置数据
56
- */
57
- saveConfig(typeDir: string, appDir: string, functionName: string, data: any): void;
58
- /**
59
- * 更新并保存配置项
60
- * @param appDir 配置app目录
61
- * @param functionName 配置文件名称,不包含.yaml后缀
62
- * @param key 配置项的键
63
- * @param value 配置项的值
64
- */
65
- updateConfigItem(appDir: string, functionName: string, key: string, value: any): void;
66
- /** 读取package.json文件,获取指定key的值
67
- * @param keyName 要获取的key名称
68
- * @param path package.json文件路径
69
- */
70
- getPackageJsonKey(keyName: string, path: string): string | null;
71
- }
72
- declare const _default: Config;
73
- export default _default;
@@ -1,15 +0,0 @@
1
- import { ComponentCreateOpsionType } from 'react-puppeteer';
2
- import { ScreenshotOptions } from '@/utils/puppeteer.render';
3
- /**
4
- * 渲染列队中的任务
5
- * @param uid 唯一标识符
6
- * @param page 组件名称
7
- * @param props 传入的组件参数
8
- * @param ComponentCreateOpsion 组件创建选项
9
- * @param ScreenshotOptions 截图选项
10
- * @returns {false | {img: buffer[]}}
11
- */
12
- declare const renderPage: <T = any>(uid: number | string, page: string, props?: T, ScreenshotOptions?: ScreenshotOptions, ComponentCreateOpsion?: ComponentCreateOpsionType) => Promise<false | {
13
- img: Buffer[];
14
- }>;
15
- export { renderPage };