tuyau-client
星标2
分支0
更新时间2026年3月2日 06:18
Using Tuyau (generated client) for type-safe API access
安装
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
文件资源管理器
2 个文件SKILL.md
readonly菜单
Using Tuyau (generated client) for type-safe API access
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run, write, and troubleshoot Japa browser tests that use Playwright; use when you add or change frontend functionality that should be covered by tests
Testing guidelines. Use when writing or updating tests.
Caching with @adonisjs/cache (keys, tags, invalidation). Use when adding or debugging cache behavior.
Lucid models/migrations conventions and safe workflows. Use when changing schema or models.
Writing documentation. Use when key functionality is added or changed
Frontend rules conventions. Use when working with frontend-related tasks.
| name | tuyau-client |
| description | Using Tuyau (generated client) for type-safe API access |
See also the full Tuyau documentation
node ace tuyau:generate in the project root after route/controller or request.validateUsing changes; this updates .adonisjs/api.ts and .adonisjs/index.ts.pnpm typecheckresources/react_app/utils/tuyau.ts via import { api } from '#web/utils/tuyau'.createTuyau({ api: generatedApi, baseUrl: '/' }), so relative calls work in loaders, actions, and components.api.$route('enquiries:sale').$get({ query: { page, pageSize } }).unwrap().api.$route('enquiries:sale.show', { id }).$get().unwrap().api.$route('column_layouts:update').$put({ mode, category, visibleColumns }).unwrap().api.$url('brokers:index').{ data, error, status, response }; use unwrap() to throw on non-2xx when you do not need custom narrowing.InferRequestType, InferResponseType, and InferErrorType from @tuyau/client to keep derived types in sync with backend contracts..unwrap() inside the query/mutation function so callers receive plain data..adonisjs/api.ts under routes.node ace tuyau:generate when backend API surface changes, then run pnpm typecheck to confirm the frontend remains aligned.