@zhin.js/plugin-qrcode 4.0.1 → 4.0.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.
|
@@ -4,8 +4,9 @@ import { raw } from '@zhin.js/core/runtime';
|
|
|
4
4
|
import { buildQrImageUrl } from "../lib/qrcode-lib.js";
|
|
5
5
|
export default defineCommand({
|
|
6
6
|
description: '根据文本或链接生成二维码图片',
|
|
7
|
+
params: { text: { type: 'string' } },
|
|
7
8
|
execute: ({ params, args }) => {
|
|
8
|
-
// [text
|
|
9
|
+
// [text] 单动态段只消费一个词;含空格的文本需拼上剩余 args
|
|
9
10
|
const text = [String(params.text ?? ''), ...args].join(' ').trim();
|
|
10
11
|
return raw({
|
|
11
12
|
type: 'image',
|
|
@@ -4,8 +4,9 @@ import { buildQrImageUrl } from '../src/qrcode-lib.js';
|
|
|
4
4
|
|
|
5
5
|
export default defineCommand({
|
|
6
6
|
description: '根据文本或链接生成二维码图片',
|
|
7
|
+
params: { text: { type: 'string' } },
|
|
7
8
|
execute: ({ params, args }) => {
|
|
8
|
-
// [text
|
|
9
|
+
// [text] 单动态段只消费一个词;含空格的文本需拼上剩余 args
|
|
9
10
|
const text = [String(params.text ?? ''), ...args].join(' ').trim();
|
|
10
11
|
return raw({
|
|
11
12
|
type: 'image',
|
|
@@ -3,6 +3,7 @@ import { defineCommand } from '@zhin.js/command';
|
|
|
3
3
|
const QR_API_BASE = 'https://api.qrserver.com/v1';
|
|
4
4
|
export default defineCommand({
|
|
5
5
|
description: '识别图片中的二维码内容',
|
|
6
|
+
params: { url: { type: 'string' } },
|
|
6
7
|
async execute({ params }) {
|
|
7
8
|
const imageUrl = String(params.url);
|
|
8
9
|
const apiUrl = `${QR_API_BASE}/read-qr-code/?fileurl=${encodeURIComponent(imageUrl)}`;
|
|
@@ -4,6 +4,7 @@ const QR_API_BASE = 'https://api.qrserver.com/v1';
|
|
|
4
4
|
|
|
5
5
|
export default defineCommand({
|
|
6
6
|
description: '识别图片中的二维码内容',
|
|
7
|
+
params: { url: { type: 'string' } },
|
|
7
8
|
async execute({ params }) {
|
|
8
9
|
const imageUrl = String(params.url);
|
|
9
10
|
const apiUrl = `${QR_API_BASE}/read-qr-code/?fileurl=${encodeURIComponent(imageUrl)}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/plugin-qrcode",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.3",
|
|
4
4
|
"description": "QR code generator & reader plugin for Zhin.js (Plugin Runtime)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
},
|
|
38
38
|
"license": "MIT",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@zhin.js/command": "1.0.
|
|
41
|
-
"@zhin.js/plugin-runtime": "1.1.
|
|
42
|
-
"@zhin.js/core": "1.5.
|
|
40
|
+
"@zhin.js/command": "1.0.7",
|
|
41
|
+
"@zhin.js/plugin-runtime": "1.1.3",
|
|
42
|
+
"@zhin.js/core": "1.5.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"typescript": "^6.0.3",
|
|
46
46
|
"vitest": "^4.1.10",
|
|
47
47
|
"zod": "^4.4.3",
|
|
48
|
-
"@zhin.js/agent": "1.1.
|
|
48
|
+
"@zhin.js/agent": "1.1.3"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"zod": "^4.0.0",
|
|
52
|
-
"@zhin.js/agent": "1.1.
|
|
52
|
+
"@zhin.js/agent": "1.1.3"
|
|
53
53
|
},
|
|
54
54
|
"peerDependenciesMeta": {
|
|
55
55
|
"@zhin.js/agent": {
|