From 38659cc40ea2ae2218a41add1114cc280be5d283 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Wed, 18 Feb 2026 03:35:15 +0800 Subject: [PATCH] temp --- test/examples.ts | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 test/examples.ts diff --git a/test/examples.ts b/test/examples.ts new file mode 100644 index 0000000..39c4f58 --- /dev/null +++ b/test/examples.ts @@ -0,0 +1,52 @@ + +import { createQueryApi } from '../src/query-api.ts'; +const api = { + "app_domain_manager": { + /** + * 获取域名信息,可以通过id或者domain进行查询 + * + * @param data - Request parameters + * @param data.data - {object} + */ + "get": { + "path": "app_domain_manager", + "key": "get", + "description": "获取域名信息,可以通过id或者domain进行查询", + "metadata": { + "args": { + "data": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "domain": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "viewItem": { + "api": { + "url": "/api/router" + }, + "type": "api", + "title": "路由" + }, + "url": "/api/router", + "source": "query-proxy-api" + } + } + } +} as const; +const queryApi = createQueryApi({ api }); +export { queryApi }; + +queryApi.app_domain_manager.get({ + data: { + id: '123', + domain: 'example.com' + } +}) \ No newline at end of file