yz-yuki-plugin 2.0.5-2 → 2.0.5-3
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/.puppeteerrc.cjs +1 -1
- package/README.md +15 -21
- package/defaultConfig/help/help.yaml +2 -2
- package/lib/apps/bilibili.js +1 -1
- package/lib/apps/help.js +1 -1
- package/lib/apps/version.js +1 -1
- package/lib/apps/weibo.js +1 -1
- package/lib/components/dynamic/Footer.js +1 -1
- package/lib/components/help/Help.js +1 -1
- package/lib/components/version/Version.js +1 -1
- package/lib/index.js +1 -1
- package/lib/main.js +11 -0
- package/lib/models/bilibili/bilibili.buid.fp.js +77 -0
- package/lib/models/bilibili/bilibili.models.js +12 -2
- package/lib/models/bilibili/bilibili.query.js +1 -1
- package/lib/models/bilibili/bilibili.task.js +1 -1
- package/lib/models/weibo/weibo.get.web.data.js +1 -1
- package/lib/models/weibo/weibo.query.js +1 -1
- package/lib/models/weibo/weibo.task.js +1 -1
- package/lib/utils/config.js +3 -3
- package/lib/utils/image.js +4 -4
- package/package.json +16 -33
- package/lib/apps/bilibili.d.ts +0 -6
- package/lib/apps/help.d.ts +0 -6
- package/lib/apps/index.d.ts +0 -4
- package/lib/apps/version.d.ts +0 -6
- package/lib/apps/weibo.d.ts +0 -6
- package/lib/components/dynamic/Account.d.ts +0 -13
- package/lib/components/dynamic/Content.d.ts +0 -12
- package/lib/components/dynamic/Footer.d.ts +0 -11
- package/lib/components/dynamic/ForwardContent.d.ts +0 -6
- package/lib/components/dynamic/LogoText.d.ts +0 -9
- package/lib/components/dynamic/MainPage.d.ts +0 -34
- package/lib/components/help/Help.d.ts +0 -12
- package/lib/components/index.d.ts +0 -5
- package/lib/components/loginQrcode/Page.d.ts +0 -7
- package/lib/components/version/Version.d.ts +0 -8
- package/lib/index.d.ts +0 -5
- package/lib/main.d.ts +0 -1
- package/lib/models/bilibili/bilibili.api.d.ts +0 -70
- package/lib/models/bilibili/bilibili.buid.fp.d.ts +0 -2
- package/lib/models/bilibili/bilibili.get.web.data.d.ts +0 -9
- package/lib/models/bilibili/bilibili.models.d.ts +0 -63
- package/lib/models/bilibili/bilibili.query.d.ts +0 -49
- package/lib/models/bilibili/bilibili.task.d.ts +0 -77
- package/lib/models/bilibili/bilibili.ticket.d.ts +0 -12
- package/lib/models/bilibili/bilibili.wbi.d.ts +0 -11
- package/lib/models/help/help.d.ts +0 -8
- package/lib/models/version/version.d.ts +0 -17
- package/lib/models/weibo/weibo.api.d.ts +0 -18
- package/lib/models/weibo/weibo.get.web.data.d.ts +0 -11
- package/lib/models/weibo/weibo.query.d.ts +0 -38
- package/lib/models/weibo/weibo.task.d.ts +0 -84
- package/lib/utils/config.d.ts +0 -73
- package/lib/utils/image.d.ts +0 -15
- package/lib/utils/paths.d.ts +0 -22
- package/lib/utils/puppeteer.render.d.ts +0 -40
- package/public/output.css +0 -1
- package/resources/img/readme/mini-help.jpg +0 -0
package/lib/index.d.ts
DELETED
package/lib/main.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -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,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,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
|
-
}
|
package/lib/utils/config.d.ts
DELETED
|
@@ -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;
|
package/lib/utils/image.d.ts
DELETED
|
@@ -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 };
|
package/lib/utils/paths.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare const pluginName: string;
|
|
2
|
-
export declare const _paths: {
|
|
3
|
-
root: string;
|
|
4
|
-
botData: string;
|
|
5
|
-
botYukiData: string;
|
|
6
|
-
botTempPath: string;
|
|
7
|
-
pluginPath: string;
|
|
8
|
-
pluginResources: string;
|
|
9
|
-
pluginName: string;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* 使用import.meta.url得到require
|
|
13
|
-
* @param basePath
|
|
14
|
-
* @returns
|
|
15
|
-
* 这并不是
|
|
16
|
-
* ***
|
|
17
|
-
* import { createRequire } from "module"
|
|
18
|
-
* ***
|
|
19
|
-
* 原型为
|
|
20
|
-
* new URL(path, import.meta.url).href
|
|
21
|
-
*/
|
|
22
|
-
export declare const createRequire: (basePath: string) => (path: string) => string;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Puppeteer } from 'react-puppeteer';
|
|
2
|
-
export type ScreenshotOptions = {
|
|
3
|
-
SOptions?: {
|
|
4
|
-
type: 'jpeg' | 'png' | 'webp';
|
|
5
|
-
quality: number;
|
|
6
|
-
};
|
|
7
|
-
tab?: string;
|
|
8
|
-
timeout?: number;
|
|
9
|
-
isSplit?: boolean;
|
|
10
|
-
addStyle?: string;
|
|
11
|
-
header?: {
|
|
12
|
-
[key: string]: string;
|
|
13
|
-
};
|
|
14
|
-
pageSplitHeight?: number;
|
|
15
|
-
pageWidth?: number;
|
|
16
|
-
modelName?: string;
|
|
17
|
-
saveHtmlfile?: boolean;
|
|
18
|
-
};
|
|
19
|
-
export declare class YukiPuppeteerRender {
|
|
20
|
-
private puppeteerInstance;
|
|
21
|
-
constructor(puppeteerInstance: Puppeteer);
|
|
22
|
-
/**
|
|
23
|
-
* 截图并返回buffer
|
|
24
|
-
* @param htmlPath 绝对路径
|
|
25
|
-
* @param tab 截图元素位 默认 body
|
|
26
|
-
* @param type 图片类型,默认png
|
|
27
|
-
* @param quality 清晰度,默认100
|
|
28
|
-
* @param timeout 响应检查,默认120000
|
|
29
|
-
* @param isSplit 是否分割图片 booelan,默认undefined,如果为undefined则截取整个页面为一张图片,如果为true则按照 pageSplitHeight 高度分割全部页面,如果为false则截取页面的第一个默认pageSplitHeight高度的页面
|
|
30
|
-
* @param pageSplitHeight 分割图片高度,默认 8000。
|
|
31
|
-
* @param pageWidth 页面宽度,默认 900
|
|
32
|
-
* @param addStyle 额外的 CSS 样式 示例 '.ql-editor { max-height: 100% !important; overflow-x: hidden; }'
|
|
33
|
-
* @param header 请求头 { [key: string]: string },示例:{ 'referer': 'https://space.bilibili.com' }
|
|
34
|
-
* @param modelName 调用模块名称,默认yuki-plugin
|
|
35
|
-
* @returns {false | {img: buffer[]}}
|
|
36
|
-
*/
|
|
37
|
-
yukiScreenshot(htmlPath: string, Options?: ScreenshotOptions): Promise<false | {
|
|
38
|
-
img: Buffer[];
|
|
39
|
-
}>;
|
|
40
|
-
}
|