yz-yuki-plugin 2.0.5-1 → 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.
Files changed (59) hide show
  1. package/.puppeteerrc.cjs +1 -1
  2. package/README.md +15 -21
  3. package/defaultConfig/help/help.yaml +2 -2
  4. package/lib/apps/bilibili.js +2 -2
  5. package/lib/apps/help.js +1 -1
  6. package/lib/apps/version.js +1 -1
  7. package/lib/apps/weibo.js +1 -1
  8. package/lib/components/dynamic/Footer.js +1 -1
  9. package/lib/components/help/Help.js +1 -1
  10. package/lib/components/version/Version.js +1 -1
  11. package/lib/index.js +1 -1
  12. package/lib/main.js +11 -0
  13. package/lib/models/bilibili/bilibili.buid.fp.js +77 -0
  14. package/lib/models/bilibili/bilibili.models.js +55 -43
  15. package/lib/models/bilibili/bilibili.query.js +1 -1
  16. package/lib/models/bilibili/bilibili.task.js +1 -1
  17. package/lib/models/weibo/weibo.get.web.data.js +1 -1
  18. package/lib/models/weibo/weibo.query.js +1 -1
  19. package/lib/models/weibo/weibo.task.js +1 -1
  20. package/lib/utils/config.js +3 -3
  21. package/lib/utils/image.js +4 -4
  22. package/package.json +16 -33
  23. package/lib/apps/bilibili.d.ts +0 -6
  24. package/lib/apps/help.d.ts +0 -6
  25. package/lib/apps/index.d.ts +0 -4
  26. package/lib/apps/version.d.ts +0 -6
  27. package/lib/apps/weibo.d.ts +0 -6
  28. package/lib/components/dynamic/Account.d.ts +0 -13
  29. package/lib/components/dynamic/Content.d.ts +0 -12
  30. package/lib/components/dynamic/Footer.d.ts +0 -11
  31. package/lib/components/dynamic/ForwardContent.d.ts +0 -6
  32. package/lib/components/dynamic/LogoText.d.ts +0 -9
  33. package/lib/components/dynamic/MainPage.d.ts +0 -34
  34. package/lib/components/help/Help.d.ts +0 -12
  35. package/lib/components/index.d.ts +0 -5
  36. package/lib/components/loginQrcode/Page.d.ts +0 -7
  37. package/lib/components/version/Version.d.ts +0 -8
  38. package/lib/index.d.ts +0 -5
  39. package/lib/main.d.ts +0 -1
  40. package/lib/models/bilibili/bilibili.api.d.ts +0 -70
  41. package/lib/models/bilibili/bilibili.buid.fp.d.ts +0 -2
  42. package/lib/models/bilibili/bilibili.get.web.data.d.ts +0 -9
  43. package/lib/models/bilibili/bilibili.models.d.ts +0 -63
  44. package/lib/models/bilibili/bilibili.query.d.ts +0 -49
  45. package/lib/models/bilibili/bilibili.task.d.ts +0 -77
  46. package/lib/models/bilibili/bilibili.ticket.d.ts +0 -12
  47. package/lib/models/bilibili/bilibili.wbi.d.ts +0 -11
  48. package/lib/models/help/help.d.ts +0 -8
  49. package/lib/models/version/version.d.ts +0 -17
  50. package/lib/models/weibo/weibo.api.d.ts +0 -18
  51. package/lib/models/weibo/weibo.get.web.data.d.ts +0 -11
  52. package/lib/models/weibo/weibo.query.d.ts +0 -38
  53. package/lib/models/weibo/weibo.task.d.ts +0 -84
  54. package/lib/utils/config.d.ts +0 -73
  55. package/lib/utils/image.d.ts +0 -15
  56. package/lib/utils/paths.d.ts +0 -22
  57. package/lib/utils/puppeteer.render.d.ts +0 -40
  58. package/public/output.css +0 -1
  59. package/resources/img/readme/mini-help.jpg +0 -0
@@ -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 };
@@ -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
- }
package/public/output.css DELETED
@@ -1 +0,0 @@
1
- *,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.13 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.m-auto{margin:auto}.mb-3{margin-bottom:.75rem}.ml-7{margin-left:1.75rem}.mt-3{margin-top:.75rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-72{height:18rem}.max-h-96{max-height:24rem}.w-32{width:8rem}.w-72{width:18rem}.w-96{width:24rem}.p-1{padding:.25rem}.p-5{padding:1.25rem}.text-center{text-align:center}.text-lg{font-size:1.125rem;line-height:1.75rem}.italic{font-style:italic}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity))}
Binary file