feat(portal-shell): add lib/api skeleton with errors and types

M1 Task 1: 创建 4 层数据抽象层的骨架文件

- errors.ts: ApiError + GraphQLErrorCode 枚举

- types.ts: Pagination / PaginatedResult / UseQueryResult / UseMutationResult

- internal.ts: normalizeError 把 ApolloError 转为 ApiError

- index.ts: barrel 出口
This commit is contained in:
SpecialX
2026-07-17 12:06:01 +08:00
parent 117c89396d
commit 989603e318
4 changed files with 86 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
/**
* API 层统一出口
*
* widget 通过 `import { useParentChildren } from "@/lib/api"` 调用。
* 各 domain 文件在 M2 阶段逐步加入。
*
* 关联spec §2.2
*/
export * from "./errors";
export * from "./types";