koishi-plugin-onebot-info-image 0.2.0-alpha.9 → 0.3.1-beta.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.
@@ -1,5 +1,8 @@
1
1
  import { Context } from 'koishi';
2
2
  import { type ImageStyle, ImageType, UnifiedUserInfo, UnifiedContextInfo } from './type';
3
+ export declare const getSourceHanSerifSCStyleUserInfoHtmlStr: (userInfo: any, contextInfo: any, avatarBase64: any, groupAvatarBase64: any, fontBase64: any, enableDarkMode: any, hidePhoneNumber?: boolean) => Promise<string>;
4
+ export declare const getFlatMinimalUserInfoHtmlStr: (userInfo: any, contextInfo: any, avatarBase64: any, groupAvatarBase64: any, fontBase64: any, enableDarkMode: any, hidePhoneNumber?: boolean) => Promise<string>;
5
+ export declare const getLXGWWenKaiUserInfoHtmlStr: (userInfo: any, contextInfo: any, avatarBase64: any, groupAvatarBase64: any, fontBase64: any, enableDarkMode: any, hidePhoneNumber?: boolean) => Promise<string>;
3
6
  /**
4
7
  * 渲染用户信息为图片并返回 base64 编码。
5
8
  * @param ctx Koishi Context 实例
@@ -11,4 +14,4 @@ import { type ImageStyle, ImageType, UnifiedUserInfo, UnifiedContextInfo } from
11
14
  * @param screenshotQuality 截图质量
12
15
  * @returns Promise<string> 图片的 base64 编码
13
16
  */
14
- export declare function renderUserInfo(ctx: Context, userInfo: UnifiedUserInfo, contextInfo: UnifiedContextInfo, imageStyle: ImageStyle, enableDarkMode: boolean, imageType: ImageType, screenshotQuality: number): Promise<string>;
17
+ export declare function renderUserInfo(ctx: Context, userInfo: UnifiedUserInfo, contextInfo: UnifiedContextInfo, imageStyle: ImageStyle, enableDarkMode: boolean, imageType: ImageType, screenshotQuality: number, hidePhoneNumber?: boolean): Promise<string>;
package/lib/type.d.ts CHANGED
@@ -1,11 +1,15 @@
1
1
  export declare const IMAGE_STYLES: {
2
2
  readonly SOURCE_HAN_SERIF_SC: "思源宋体SourceHanSerifSC";
3
3
  readonly LXGW_WENKAI: "落霞孤鹜文楷LXGWWenKai";
4
+ readonly FLAT_MINIMAL: "扁平化简约FlatMinimal";
4
5
  };
5
6
  export type ImageStyle = typeof IMAGE_STYLES[keyof typeof IMAGE_STYLES];
7
+ export type ImageStyleKey = keyof typeof IMAGE_STYLES;
8
+ export declare const IMAGE_STYLE_KEY_ARR: ImageStyleKey[];
6
9
  export declare const FONT_FILES: {
7
10
  readonly 思源宋体SourceHanSerifSC: "SourceHanSerifSC-Medium.otf";
8
11
  readonly 落霞孤鹜文楷LXGWWenKai: "LXGWWenKaiMono-Regular.ttf";
12
+ readonly 扁平化简约FlatMinimal: "LXGWWenKaiMono-Regular.ttf";
9
13
  };
10
14
  export declare const IMAGE_TYPES: {
11
15
  readonly PNG: "png";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-onebot-info-image",
3
3
  "description": "用onebot api获取用户详细信息/群管理员列表信息,可以发纯文本/合并转发/渲染图片。 现在只做了lagrange和napcat的适配",
4
- "version": "0.2.0-alpha.9+20250929",
4
+ "version": "0.3.1-beta.1+20251219",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -22,7 +22,11 @@
22
22
  "onebot"
23
23
  ],
24
24
  "peerDependencies": {
25
- "koishi": "^4.18.7"
25
+ "koishi": "^4.18.7",
26
+ "@koishijs/plugin-console": "^5.30.0"
27
+ },
28
+ "devDependencies": {
29
+ "@koishijs/client": "^5.30.10"
26
30
  },
27
31
  "koishi": {
28
32
  "description": {
@@ -33,6 +37,9 @@
33
37
  "required": [
34
38
  "puppeteer",
35
39
  "http"
40
+ ],
41
+ "optional": [
42
+ "console"
36
43
  ]
37
44
  }
38
45
  }
package/readme.md CHANGED
@@ -6,21 +6,37 @@
6
6
 
7
7
  推荐使用Napcat
8
8
 
9
+ ### 更新日志
10
+ - **0.3.1-beta.1+20251219**
11
+ - 微调flat模板 aui的样式捏
12
+ - **0.3.0-beta.1+20251219**
13
+ - 增加配置页面webui里面嵌入的html预览捏
14
+ - **0.2.3-beta.1+20251218**
15
+ - 手机号可以强制隐藏捏
16
+ - **0.2.2-beta.1+20251218**
17
+ - 新增:aui指令允许使用qq号进行查询
18
+ - **前面的版本号**
19
+ - 忘了。反正你看到的features都是前面更新的
20
+
9
21
  #### Napcat平台渲染效果:
10
22
  ##### 用户信息:
11
- ![napcat_aui_source](https://gitee.com/vincent-zyu/koishi-plugin-onebot-image/releases/download/example_image/napcat_aui_source.png)
12
- ![napcat_aui_lxgw](https://gitee.com/vincent-zyu/koishi-plugin-onebot-image/releases/download/example_image/napcat_aui_lxgw.png)
23
+ ![https://gitee.com/vincent-zyu/koishi-plugin-onebot-image/releases/download/example_image/napcat_aui_source.png](https://gitee.com/vincent-zyu/koishi-plugin-onebot-image/releases/download/example_image/napcat_aui_source.png)
24
+ ![https://gitee.com/vincent-zyu/koishi-plugin-onebot-image/releases/download/example_image/napcat_aui_lxgw.png](https://gitee.com/vincent-zyu/koishi-plugin-onebot-image/releases/download/example_image/napcat_aui_lxgw.png)
25
+ ![https://gitee.com/vincent-zyu/koishi-plugin-onebot-image/releases/download/example_image/napcat_aui_flat.png](https://gitee.com/vincent-zyu/koishi-plugin-onebot-image/releases/download/example_image/napcat_aui_flat.png)
13
26
  ##### 群管理列表:
14
- ![napcat_al_source](https://gitee.com/vincent-zyu/koishi-plugin-onebot-image/releases/download/example_image/napcat_al_source.png)
15
- ![napcat_al_lxgw](https://gitee.com/vincent-zyu/koishi-plugin-onebot-image/releases/download/example_image/napcat_al_lxgw.png)
27
+ ![https://gitee.com/vincent-zyu/koishi-plugin-onebot-image/releases/download/example_image/napcat_al_source.pnge](https://gitee.com/vincent-zyu/koishi-plugin-onebot-image/releases/download/example_image/napcat_al_source.png)
28
+ ![https://gitee.com/vincent-zyu/koishi-plugin-onebot-image/releases/download/example_image/napcat_al_lxgw.png](https://gitee.com/vincent-zyu/koishi-plugin-onebot-image/releases/download/example_image/napcat_al_lxgw.png)
29
+ ![https://gitee.com/vincent-zyu/koishi-plugin-onebot-image/releases/download/example_image/napcat_al_flat.png](https://gitee.com/vincent-zyu/koishi-plugin-onebot-image/releases/download/example_image/napcat_al_flat.png)
16
30
 
17
31
  ## dev
18
32
  ### 查看git大文件
19
33
  ```shell
20
34
  git rev-list --objects --all | git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | Where-Object { $_ -match '^blob' } | ForEach-Object { $parts = $_ -split ' ', 4; [PSCustomObject]@{ Size = [int]$parts[2]; Name = $parts[3] } } | Sort-Object Size -Descending | Select-Object -First 20
35
+
36
+ git rev-list --objects --all | git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | Where-Object { $_ -match '^blob' } | ForEach-Object { $parts = $_ -split ' ', 4; [PSCustomObject]@{ Size = [int]$parts[2]; File = $parts[3] } } | Sort-Object Size -Descending | Select-Object -First 20 | ForEach-Object { "{0,10} KB {1}" -f ([math]::Round($_.Size/1KB, 2)), $_.File }
21
37
  ```
22
38
 
23
- ### 发布到gitworkflow
39
+ ### 发布到git workflow
24
40
  #### 开发环境:
25
41
  ```shell
26
42
  cd G:\GGames\Minecraft\shuyeyun\qq-bot\koishi-dev\koishi-dev-3\external\onebot-info-image
@@ -39,7 +55,7 @@ yarn && yarn build
39
55
  yarn
40
56
  ```
41
57
 
42
-
58
+ ### 发布到npm workflow
43
59
  ```shell
44
60
  # ensure plugin dir name is *onebot-info-image*, without koishi-plugin prefix then:
45
61
  cd G:\GGames\Minecraft\shuyeyun\qq-bot\koishi-dev\koishi-dev-3
@@ -53,7 +69,7 @@ Invoke-WebRequest -Uri "https://www.google.com" -Method Head -UseBasicParsing
53
69
  npm login --registry https://registry.npmjs.org
54
70
  # login npm in browser
55
71
  npm run pub onebot-info-image -- --registry https://registry.npmjs.org
56
- npm dist-tag add koishi-plugin-onebot-info-image@0.2.0-alpha.8+20250929 latest --registry https://registry.npmjs.org
72
+ npm dist-tag add koishi-plugin-onebot-info-image@0.2.0-alpha.11+20251013 latest --registry https://registry.npmjs.org
57
73
 
58
74
  npm view koishi-plugin-onebot-info-image
59
75
  npm-stat.com
@@ -1,3 +0,0 @@
1
- import { Context } from 'koishi';
2
- import { type ImageStyle, ImageType, UnifiedAdminInfo, UnifiedContextInfo } from './type';
3
- export declare function renderAdminList(ctx: Context, admins: UnifiedAdminInfo[], contextInfo: UnifiedContextInfo, imageStyle: ImageStyle, enableDarkMode: boolean, imageType: ImageType, screenshotQuality: number): Promise<string>;
package/lib/utils.d.ts DELETED
@@ -1,27 +0,0 @@
1
- import { Context } from 'koishi';
2
- import { type ImageStyle } from './type';
3
- /**
4
- * 生成当前时间戳字符串
5
- * @returns 格式为 YYYY/MM/DD HH:MM:SS 的时间戳字符串
6
- */
7
- export declare function generateTimestamp(): string;
8
- /**
9
- * 获取群头像的 Base64 编码
10
- * @param ctx Koishi Context 实例
11
- * @param groupId 群号
12
- * @returns Promise<string> 群头像的 base64 编码
13
- */
14
- export declare function getGroupAvatarBase64(ctx: Context, groupId: string): Promise<string>;
15
- /**
16
- * 获取字体文件的 Base64 编码
17
- * @param ctx Koishi Context 实例
18
- * @param imageStyle 图片样式
19
- * @returns Promise<string> 字体文件的 base64 编码
20
- */
21
- export declare function getFontBase64(ctx: Context, imageStyle: ImageStyle): Promise<string>;
22
- /**
23
- * 验证并下载字体文件
24
- * @param ctx Koishi Context 实例
25
- * @returns Promise<void>
26
- */
27
- export declare function validateFonts(ctx: Context): Promise<void>;