@zhin.js/plugin-short-url 4.0.2 → 4.0.5

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.
@@ -3,6 +3,7 @@ import { defineCommand } from '@zhin.js/command';
3
3
  import { expandUrl, isValidUrl } from "../../lib/short-url-lib.js";
4
4
  export default defineCommand({
5
5
  description: '展开一个短链接,显示原始地址',
6
+ params: { url: { type: 'string' } },
6
7
  async execute({ params }) {
7
8
  const url = String(params.url ?? '');
8
9
  if (!isValidUrl(url))
@@ -3,6 +3,7 @@ import { expandUrl, isValidUrl } from '../../src/short-url-lib.js';
3
3
 
4
4
  export default defineCommand({
5
5
  description: '展开一个短链接,显示原始地址',
6
+ params: { url: { type: 'string' } },
6
7
  async execute({ params }) {
7
8
  const url = String(params.url ?? '');
8
9
  if (!isValidUrl(url)) return '请提供有效的 HTTP/HTTPS 链接';
@@ -3,6 +3,7 @@ import { defineCommand } from '@zhin.js/command';
3
3
  import { isValidUrl, shortenUrl } from "../../lib/short-url-lib.js";
4
4
  export default defineCommand({
5
5
  description: '缩短一个 URL',
6
+ params: { url: { type: 'string' } },
6
7
  async execute({ params }) {
7
8
  const url = String(params.url ?? '');
8
9
  if (!isValidUrl(url))
@@ -3,6 +3,7 @@ import { isValidUrl, shortenUrl } from '../../src/short-url-lib.js';
3
3
 
4
4
  export default defineCommand({
5
5
  description: '缩短一个 URL',
6
+ params: { url: { type: 'string' } },
6
7
  async execute({ params }) {
7
8
  const url = String(params.url ?? '');
8
9
  if (!isValidUrl(url)) return '请提供有效的 HTTP/HTTPS 链接';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/plugin-short-url",
3
- "version": "4.0.2",
3
+ "version": "4.0.5",
4
4
  "description": "URL shortener plugin for Zhin.js — shorten & expand URLs (Plugin Runtime)",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -37,18 +37,18 @@
37
37
  },
38
38
  "license": "MIT",
39
39
  "dependencies": {
40
- "@zhin.js/command": "1.0.6",
41
- "@zhin.js/plugin-runtime": "1.1.2"
40
+ "@zhin.js/command": "1.0.9",
41
+ "@zhin.js/plugin-runtime": "1.1.5"
42
42
  },
43
43
  "devDependencies": {
44
44
  "typescript": "^6.0.3",
45
45
  "vitest": "^4.1.10",
46
46
  "zod": "^4.4.3",
47
- "@zhin.js/agent": "1.1.2"
47
+ "@zhin.js/agent": "1.1.5"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "zod": "^4.0.0",
51
- "@zhin.js/agent": "1.1.2"
51
+ "@zhin.js/agent": "1.1.5"
52
52
  },
53
53
  "peerDependenciesMeta": {
54
54
  "@zhin.js/agent": {