refactor: migrate from Rollup to Bun for build configuration

feat: update adapter to use globalThis for origin resolution

fix: remove unused ClientQuery export from query.ts

chore: update tsconfig to include test files and set rootDir

feat: add create-query functionality for dynamic API generation

feat: implement QueryApi with enhanced type inference from JSON Schema

test: add comprehensive API tests for QueryApi functionality

test: create demo routes and schemas for testing purposes

docs: add type inference demo for QueryApi usage
This commit is contained in:
2026-02-17 21:39:41 +08:00
parent 7adedc0552
commit ecb69ba326
18 changed files with 1106 additions and 591 deletions

30
test/api.ts Normal file
View File

@@ -0,0 +1,30 @@
import { QueryApi } from '../src/query-api.ts';
export const queryApi = new QueryApi();
export const api = {
"test": {
"test": {
"path": "test",
"key": "test",
"id": "rWfTW4jLlwPWN_LdYXPBO",
"description": "test route",
"type": "route",
"middleware": [],
"metadata": {
"args": {
"a": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "string",
"description": "arg a"
}
}
}
}
},
// Additional routes can be added here
} as const;
const res = await queryApi.post(api.test.test, {
a: 'test'
});