make-app-service
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesemake-app-service
make-app-service
Use this skill for Make App Service API work in .
apps/servicemake-app-serviceapps/uiapps/serviceIt does not own record-action behavior (), sorting behavior (), filtering behavior (), grouping behavior (), Make AI 助手 transport semantics (), UI layout (), authentication implementation (), single-app permission logic (), runtime build/start contracts (), DSL modeling (), Make CLI execution (), or CanvasTable rendering/editing ().
make-app-actionsmake-app-sortmake-app-filtermake-app-groupmake-ai-assistantmakeuimake-app-authmake-app-permissionmake-app-runtimemakedslmakeclicanvas-table-integration此技能用于目录下的Make App Service API开发工作。
apps/servicemake-app-serviceapps/uiapps/service它不负责记录动作行为()、排序行为()、过滤行为()、分组行为()、Make AI 助手传输语义()、UI布局()、认证实现()、单应用权限逻辑()、运行时构建/启动契约()、DSL建模()、Make CLI执行()或CanvasTable渲染/编辑()。
make-app-actionsmake-app-sortmake-app-filtermake-app-groupmake-ai-assistantmakeuimake-app-authmake-app-permissionmake-app-runtimemakedslmakeclicanvas-table-integrationQuick start
快速开始
- Inspect ,
apps/docs/api.md,apps/service/srcor host-equivalent config entry, existing tests, and the host project's declared data flow.apps/service/src/config.ts - Preserve the host API contract. Update before or with any Service route or response-shape change.
apps/docs/api.md - For Make Deploy's default route split, treat published browser-facing Service routes as . Prefix-free
/api/**,/app/**, or/auth/**routes may be local compatibility only; do not document them as the published UI contract unless the deploy route actually exposes them./health - Classify every route before implementation. Ordinary direct Make proxies preserve completed 2xx, 4xx, and 5xx status, Content-Type, and body; file downloads also preserve Content-Disposition and stream bytes. Make AI assistant is an explicit exception for errors: apply the selected adapter's safe public-error contract below, not generic raw-error passthrough. A genuine aggregation/normalization route may define its own successful result only when names it as non-proxy; ordinary completed Make errors remain unchanged.
apps/docs/api.md - For a new Make POC Service, use the platform layered source tree by default: ,
app.ts,server.ts,config.ts,logger.ts,make-client/,services/, with tests beside the route/adapter/helper they cover.utils/ - Do not read local DSL/YAML as a published runtime data source. Runtime schema and data come from Make/backend APIs or the host Service adapter.
- Use shared adapters for Make Meta/Data/Preset calls, candidate APIs, lookup, files, and schema normalization. Build Make adapter URLs and from normalized runtime config, not from route-local domains or UI input.
appKey - Implement the default single-app permission proxy through , including
make-app-permission; do not omit it from a generated or refactored Make App./api/make/app/principal/permission - Preserve permission-trimmed Schema collections independently: normalize and
fieldsseparately; missingcreateFieldsmeans an empty create collection with no fallback tocreateFields. Preserve unknown response properties, includingfields, but leave their permission semantics toeditableFields.make-app-permission - If Schema is cached, isolate permission-trimmed results by tenant, principal/session, App, and access generation, and expose explicit invalidation for permission refresh.
- For Make record actions, implement the documented route before edit UI and the
record-write-permissionroute for batch edit; userecords/bulkfor target, permission, one-request semantics, and the established complete UI-Service response contract. Do not apply generic passthrough/normalization rules to alter either action route's successful or failed response shape.make-app-actions - For cancellable or supersedable requests, propagate a request-scoped from the Service boundary into every downstream adapter; read
AbortSignalbefore implementation.references/service-api-contracts.md - If the Make App Service change is for Make AI 助手, AI助手, AI 对话框, SSE, Agent Gateway, or , use
@qfei-design/make-ai-assistantfor the Make App AI Chat protocol first. Service then implements only its documented route handlers, proxy adapter, config validation, logging, cancellation, and tests.make-ai-assistant - Add or update Service tests for every changed route, adapter, validation path, and error path.
- Read only the needed reference files from the map below.
- 查看、
apps/docs/api.md、apps/service/src或宿主等效配置入口、现有测试,以及宿主项目声明的数据流。apps/service/src/config.ts - 保留宿主API契约。在更改任何Service路由或响应形态之前或同时更新。
apps/docs/api.md - 对于Make Deploy的默认路由拆分,将发布的面向浏览器的Service路由视为。无前缀的
/api/**、/app/**或/auth/**路由可能仅为本地兼容;不要将它们记录为发布的UI契约,除非部署路由确实暴露了这些接口。/health - 在实现前对每个路由进行分类。普通的直接Make代理会保留完整的2xx、4xx和5xx状态码、Content-Type和响应体;文件下载还会保留Content-Disposition和流字节。Make AI助手是错误处理的显式例外: 应用下方选定适配器的安全公共错误契约,而非通用的原始错误透传。真正的聚合/规范化路由仅当将其标记为非代理时,才可定义自己的成功结果;普通的已完成Make错误保持不变。
apps/docs/api.md - 对于新的Make POC Service,默认使用平台分层源码结构:、
app.ts、server.ts、config.ts、logger.ts、make-client/、services/,测试文件与所覆盖的路由/适配器/工具函数放在同一目录下。utils/ - 不要将本地DSL/YAML作为发布版的运行时数据源。运行时Schema和数据来自Make/后端API或宿主Service适配器。
- Make Meta/Data/Preset调用、候选API、查找、文件及Schema规范化使用共享适配器。根据规范化的运行时配置构建Make适配器URL和,不要从路由本地域名或UI输入构建。
appKey - 通过实现默认的单应用权限代理,包括
make-app-permission接口;在生成或重构的Make App中不得省略该接口。/api/make/app/principal/permission - 独立保留权限裁剪后的Schema集合:分别规范化和
fields;若createFields缺失,则表示创建集合为空,不得回退到createFields。保留未知的响应属性(包括fields),但其权限语义由editableFields负责。make-app-permission - 若Schema被缓存,需按租户、主体/会话、应用及访问世代隔离权限裁剪后的结果,并提供明确的失效接口供权限刷新使用。
- 对于Make记录动作,在编辑UI之前实现已文档化的路由,以及用于批量编辑的
record-write-permission路由;使用records/bulk处理目标、权限、单请求语义及已确立的完整UI-Service响应契约。不要应用通用透传/规范化规则来修改任何一个动作路由的成功或失败响应形态。make-app-actions - 对于可取消或可被取代的请求,将请求作用域的从Service边界传播到每个下游适配器;实现前请阅读
AbortSignal。references/service-api-contracts.md - 若Make App Service的变更涉及Make AI 助手、AI助手、AI 对话框、SSE、Agent Gateway或,优先使用
@qfei-design/make-ai-assistant的Make App AI Chat协议。Service仅实现其文档化的路由处理器、代理适配器、配置校验、日志、取消逻辑及测试。make-ai-assistant - 为每个变更的路由、适配器、校验路径和错误路径添加或更新Service测试。
- 仅从下方的映射表中读取所需的参考文件。
Topic reference map
主题参考映射
| Task / topic | Read |
|---|---|
| Service route shapes and UI-Service response contracts | |
Request cancellation, client disconnect handling, downstream | |
| Service folder structure, layering, logging, errors | |
Make Data API adapter rules, schema | |
| Test requirements, contract checks, safety review | |
| Single-app permission proxy, Make IAM principal permission, app-scope permission payloads | Use |
| Auth proxy, cookies, unified login, 401/403 behavior | Use |
Service build output, port | Use |
| UI layout, forms, detail display, visual states | Use |
| Make field/table rendering in CanvasTable | Use |
| Record sorting, sortable capabilities, Preset sort, records sort | Use |
| Advanced filter package behavior and Preset filter | Use |
| Record grouping, groupable capabilities, Preset group, record-groups, groupFilter | Use |
| Record action precheck, strict selection target, one-request batch update | Use |
| Make App AI 助手, AI助手, AI 对话框, SSE, Agent Gateway, assistant capabilities, interface domain config | Use |
| 任务/主题 | 参考文档 |
|---|---|
| Service路由形态与UI-Service响应契约 | |
请求取消、客户端断开处理、下游 | |
| Service目录结构、分层、日志、错误 | |
Make Data API适配器规则、Schema | |
| 测试要求、契约检查、安全审查 | |
| 单应用权限代理、Make IAM主体权限、应用范围权限载荷 | 使用 |
| 认证代理、Cookie、统一登录、401/403行为 | 使用 |
Service构建输出、端口 | 使用 |
| UI布局、表单、详情展示、视觉状态 | 使用 |
| CanvasTable中的Make字段/表格渲染 | 使用 |
| 记录排序、可排序能力、Preset排序、记录排序 | 使用 |
| 高级过滤包行为与Preset过滤 | 使用 |
| 记录分组、可分组能力、Preset分组、记录组、groupFilter | 使用 |
| 记录动作预检查、严格选择目标、单请求批量更新 | 使用 |
| Make App AI 助手、AI助手、AI 对话框、SSE、Agent Gateway、助手能力、接口域配置 | 使用 |
Scope boundary
范围边界
- defines Service-owned app APIs such as schema, records, candidates, lookup options, file proxy, and thin custom orchestration.
make-app-service - Every new Make App Service uses for the default request Trace ID: validate or create it at the boundary, return
make-app-observability, carry safe context into logs, and forward only validated trace headers to Make Gateway. This Skill owns the route and adapter implementation, whileX-Log-Idowns the cross-boundary invariant and audit.make-app-observability - It may document route names, query/body shapes, response envelopes, and adapter behavior.
- It may define Service-side Make adapter config semantics and environment variable names used by Service source, such as and
MAKE_APP_KEY, while leaving deployment injection to runtime/operations.MAKE_API_BASE_URL - It must not decide authentication implementation or OAuth/session mechanics; those belong to . It may still mount and document the App Service auth proxy path required by the host contract, normally
make-app-authand/api/make/auth/**for Make Deploy Service-fronted Apps that use/api/make/oauth/**.gatewayBaseUrl: "/api/make" - It must not define single-app permission logic, IAM permission matching, route guards, operation buttons, or field editability; those belong to . It should still provide the Service layering, logging, tests, and docs needed by that permission proxy.
make-app-permission - It must not decide build output, Service port, Docker/K8s entrypoint, package scripts, workspace manifests, or publish readiness; those belong to .
make-app-runtime - It must not define business models, entities, field meanings, relations, or DSL YAML; those belong to .
makedsl - It must not decide UI layout, component choice, Drawer layout, or CanvasTable rendering; those belong to and
makeui.canvas-table-integration - It must not define Make AI 助手 SSE event semantics or capability negotiation; those belong to . The current Make App AI adapter does not carry Artifact payloads.
make-ai-assistant - It must not hard-code environment-to-domain mapping. Make API base URL, gateway routing, and secret injection come from runtime config, backend/operations, or Make tooling.
- 定义Service负责的应用API,如Schema、记录、候选、查找选项、文件代理及轻量自定义编排。
make-app-service - 每个新的Make App Service都使用提供默认请求Trace ID:在边界处校验或生成Trace ID,返回
make-app-observability,将安全上下文带入日志,仅将经过校验的追踪头转发到Make Gateway。此技能负责路由和适配器实现,而X-Log-Id负责跨边界的不变量和审计。make-app-observability - 它可以记录路由名称、查询/请求体形态、响应信封及适配器行为。
- 它可以定义Service端Make适配器配置语义及Service源码使用的环境变量名称,如和
MAKE_APP_KEY,但部署注入由运行时/运维负责。MAKE_API_BASE_URL - 它不得决定认证实现或OAuth/会话机制;这些属于。它仍可挂载并记录宿主契约要求的App Service认证代理路径,对于使用
make-app-auth的Make Deploy Service前置应用,通常为gatewayBaseUrl: "/api/make"和/api/make/auth/**。/api/make/oauth/** - 它不得定义单应用权限逻辑、IAM权限匹配、路由守卫、操作按钮或字段可编辑性;这些属于。它仍应提供该权限代理所需的Service分层、日志、测试和文档。
make-app-permission - 它不得决定构建输出、Service端口、Docker/K8s入口点、包脚本、工作区清单或发布就绪状态;这些属于。
make-app-runtime - 它不得定义业务模型、实体、字段含义、关系或DSL YAML;这些属于。
makedsl - 它不得决定UI布局、组件选择、Drawer布局或CanvasTable渲染;这些属于和
makeui。canvas-table-integration - 它不得定义Make AI 助手SSE事件语义或能力协商;这些属于。当前的Make App AI适配器不承载Artifact载荷。
make-ai-assistant - 它不得硬编码环境到域名的映射。Make API基础URL、网关路由和密钥注入来自运行时配置、后端/运维或Make工具。
Default Service responsibilities
默认Service职责
Generated or refactored Make App Service code should provide these capabilities when the UI needs them and the host project does not already have equivalent routes:
- public health/config: ,
/api/healthfor published UI access;/api/configmay exist as local or k8s-probe compatibility/health - runtime schema: ,
/api/schema/api/entities/:entityKey/fields - default single-app permissions: through
/api/make/app/principal/permissionmake-app-permission - Make App AI assistant routes only when requested by the host and specified by : expose the exact
make-ai-assistant18-operation allowlist for capabilities, paginated Agents, multi-session chats, feedback, messages/history, response events/snapshot/cancel, uploads/parts/complete, and content bytes; never a generic proxy/api/make/app/ai/v1/** - records: list, get, create, update, delete, cell update
- record actions when the list is writable: row-write permission precheck and one-request batch field update through
make-app-actions - current-user Entity Preset: get and sparse filter/sort update when filtering or sorting is enabled
- lookup options and safe lookup relation updates
- user candidates and department candidates
- file upload/delete/download proxy
- thin custom orchestration when requested, for example OCR result creation
Keep route handlers small. Put Make/backend calls in adapter modules, cross-route business orchestration in , and pure schema/value helpers in .
services/utils/当UI需要且宿主项目尚未提供等效路由时,生成或重构的Make App Service代码应提供以下能力:
- 公共健康检查/配置:供发布版UI访问的、
/api/health;/api/config可能作为本地或k8s探针兼容接口存在/health - 运行时Schema:、
/api/schema/api/entities/:entityKey/fields - 默认单应用权限:通过提供的
make-app-permission/api/make/app/principal/permission - 仅当宿主要求且指定时才提供Make App AI助手路由:暴露精确的
make-ai-assistant18个操作白名单,涵盖能力、分页Agent、多会话聊天、反馈、消息/历史、响应事件/快照/取消、上传/分片/完成及内容字节;绝不能是通用代理/api/make/app/ai/v1/** - 记录:列表、查询、创建、更新、删除、单元格更新
- 列表可写时的记录动作:通过提供行写入权限预检查和单请求批量字段更新
make-app-actions - 当前用户Entity Preset:启用过滤或排序时,支持查询及稀疏过滤/排序更新
- 查找选项及安全的查找关系更新
- 用户候选与部门候选
- 文件上传/删除/下载代理
- 按需提供轻量自定义编排,例如OCR结果创建
保持路由处理器精简。将Make/后端调用放在适配器模块中,跨路由业务编排放在目录下,纯Schema/值工具函数放在目录下。
services/utils/Hard rules
硬性规则
- is the UI-Service contract source. Do not change Service route behavior without updating it.
apps/docs/api.md - For Make Deploy Service-fronted Apps that use ,
gatewayBaseUrl: "/api/make"must document published browser paths underapps/docs/api.md, for example/api/make/**,/api/make/auth/**, and/api/make/oauth/**. Do not document prefix-free/api/make/app/**as the published path unless the deploy HTTPRoute exposes it. Older/app/**projects may keep/apiand/api/auth/**only as an explicit legacy contract./api/app/** - New generated Make POC Services and non-trivial generated/refactored code must use a layered, componentized source structure instead of flat route/adapter/helper files. For new Make POC Services, default to the platform tree:
apps/service,app.ts,server.ts,config.ts,logger.tsfor Make/backend adapters,make-client/for multi-step orchestration,services/for pure helpers, and colocated tests.utils/ - A flat tree is a readiness defect for generated POC work when it mixes route registration, Make request construction, schema normalization, lookup/file orchestration, config parsing, logging, and helpers side by side. Split it before reporting the Service as complete.
apps/service/src - Route handlers in or
app.tsonly validate input, call a service/adapter, map Service-owned preflight errors, log safe boundary context, and send the documented response. Ordinary direct Make proxies preserve completed HTTP status, Content-Type, and body for 2xx, 4xx, and 5xx; the selected Make AI assistant adapter instead follows its explicit safe-error contract. Do not put raw Make payload construction, schema variant parsing, record lookup orchestration, file proxy mapping, or custom workflow steps directly into route handlers.routes/ - A UI-facing aggregation route may use a documented normalized success shape only when explicitly marks it as non-proxy. Start from the default route-response-mode table in
apps/docs/api.md, then document any host-specific exception and its migration. Ordinary completed Make errors remain unchanged; the selected Make AI assistant error contract is a separately documented exception.references/service-api-contracts.md - Service route handlers validate query/body/path params before calling Make adapters and return 400 for invalid client input.
- Service adapters own Make request details such as ,
appKey, Make response code checks, pagination translation, file body mapping, and consuming a prepared login/session forwarding context. Auth/session mechanics and shared forwarding helpers belong toX-Make-Target; publish/runtime proxy header contracts belong tomake-app-auth.make-app-runtime - Make-backed record read APIs must call Make gateway Data API through the Service Make adapter. Published runtime uses k8s-internal ; local preview with
/make/data/v1/recordusesMAKE_APP_LOCAL_PREVIEW=truefieldmakecli configure resolve --target local-preview --output=jsonplusmake_api_origin. This applies to record list, record detail, lookup target-record reads, and any custom Service route that reads Make records./api/make/data/v1/record - Service Make adapters must forward the incoming request's established login context to Make gateway for Make-backed data reads and writes. At minimum, preserve the browser session header when the host uses cookie/unified-login auth, preserve an existing
Cookieheader only when the host contract already uses bearer auth, and apply the host gateway context headers such asAuthorizationandX-Forwarded-Hostthrough the shared auth/runtime helper. Do not invent auth policy here; useX-Forwarded-Protofor auth mechanics, but do not drop the login context before calling gateway.make-app-auth - Published/runtime Service APIs must never use as a data source. Do not shell out to
makecli,makecli, local makecli config, or makecli JSON stdout to serve schema, records, candidates, lookup options, files, or custom API data. Online Service containers do not have makecli, so runtime data must come from Make gateway/API adapters.npx makecli - Make-backed Service config must read its authoritative from deployment-injected
appKey; generated production code must not invent, hard-code, or let UI input override that scope. A documented protocol route may carryMAKE_APP_KEYin its query or body only when the Service validates exact equality withappKeybefore calling an adapter.MAKE_APP_KEY - If is missing for a Service that calls Make Meta/Data APIs, config loading must fail with a clear non-secret error before the Service is reported ready. Local test fixtures may inject
MAKE_APP_KEYexplicitly.MAKE_APP_KEY - New generated Service code reads Make adapter runtime config from or the host equivalent.
apps/service/src/config.tsis the preferred published gateway-origin env var;MAKE_API_BASE_URLis a compatibility alias only. Local preview derives its public gateway origin fromMAKE_SERVER_URLinstead of deployment env.makecli configure resolve --target local-preview --output=json - If neither nor
MAKE_API_BASE_URLis configured for a Make-backed Service, config loading must fail with a clear non-secret error before the Service is reported ready.MAKE_SERVER_URL - Published /
MAKE_API_BASE_URLvalues are strict k8s gateway origins such asMAKE_SERVER_URL. New generated Service code must not puthttp://make-gateway.make-dev,/make,/api/make,/meta,/data, or another service path scope in this env var. Local-preview resolve output must be consumed as/auth; if older makecli fallback returns or reads a path-scoped publicmake_api_originAPI base, normalize that only inside the local-preview adapter./api/make - Make platform adapters own the service path scope. Generated Service code derives upstream URLs from an explicit runtime mode: local preview uses public gateway origin + ; published uses k8s gateway origin +
/api/make/**, such as/make/**andhttp://make-gateway.make-dev/make/meta/**.http://make-gateway.make-dev/make/data/** - For the Make App AI assistant adapter, follow : the browser calls the fixed
make-ai-assistant18-operation family through same origin; local preview Service upstreams use/api/make/app/ai/v1/**plusmake_api_origin; published Service upstreams use the strict origin from/api/make/app/ai/v1/**or its compatibility aliasMAKE_API_BASE_URLplusMAKE_SERVER_URL. Service must read deployed scope from/make/app/ai/v1/**and reject every query/bodyMAKE_APP_KEYthat differs from it; every non-GET/HEAD request requires one HTTP(S) same-originappKeychecked against the selected Host. Do not add an assistant-only/AI Gateway/Agent Gateway origin, token, environment variable, or hard-coded domain. Preserve bare JSON objects, empty 204 responses,Origin, SSE, and bytes as separate success modes, and do not narrow valid protocol DTOs in a host validator. For AI errors, preserve bounded schema-valid flatMake-AI-Api-Versionwith its HTTP status, including extensible unknown codes; malformed/non-public upstream errors become a safe Service error without leaking raw diagnostics. Never remap a valid public typed error to 502.{code,message,requestId?,details?} - If the same Service calls other gateway services, those adapters define their own explicit service scopes from the same gateway origin. Do not strip out of
/make, and do not overload a path-scoped base URL to reach unrelated services.MAKE_API_BASE_URL - Service-to-gateway calls inside the cluster must not use the browser-facing prefix.
/api/makebelongs to same-origin browser access, Service ingress, and local-preview public gateway calls; published Service internal upstream URLs use gateway-origin plus/api/make/**./make - Service source must not hard-code concrete Make dev/test/prod domains, infer namespace-local gateway addresses, or map deployment environments to domains.
- Runtime Service code must not require ,
apps/dsl/**, or copied/dsl/**files to start or serve schema/data in published Apps.*.yaml - Schema APIs normalize backend schema variants before UI sees them. Handle known variants such as ,
entity.properties.fields, or the host-documented equivalent at the Service/API boundary, and preserve fieldentity.fields/capabilities.sortablefor sorting and grouping.capabilities.groupable - Permission-trimmed Schema normalization keeps and
fieldsas separate collections. Normalize each collection independently; a missing or invalidcreateFieldsbecomescreateFieldsand never falls back to[]. Preservefieldsas response metadata when the host contract requires lossless forwarding, but do not use it to derive current edit behavior.editableFields - Schema caches and in-flight reuse must not share permission-trimmed entities across principals. Key by tenant, principal/session identity, App, and access generation (or use a request-local cache), and provide an invalidation/reload path that permission refresh can call before data refresh.
- Record list and detail are separate contracts. Do not implement detail by calling list and guessing the first row when a single-record Make call exists.
- Entity Preset GET/PATCH routes must use the Make Preset adapter with
/preset/v1/entity/MakeService.GetResource, preserve the established login context, and update only submitted dimensions. UseMakeService.UpdateResource,make-app-sort, andmake-app-filterfor dimension semantics.make-app-group - Preset sort and records sort must share shape validation and authoritatively validate fields against current runtime schema . Reject invalid, duplicate, non-sortable, or more-than-five rules before Make calls.
capabilities.sortable === true - Sparse Preset updates must preserve sibling dimensions; saving sort must not send filter/group, saving filter must not send sort/group, and saving group must not send filter/sort.
- User and department candidates come from Service routes such as and
GET /api/usersor the host equivalent; do not use local demo arrays in generated Service.GET /api/departments - Lookup option APIs must resolve target object/field from schema metadata and return . Do not expose full target records to selector UIs by default.
{ options, total } - File routes proxy upload/delete/download through Service. UI should not expose raw backend file URLs when a Service download proxy is available.
- Browser resource tags such as cannot attach
<img src>. When Make file downloads require a bearer token, keep the URL browser-facing through a Service download proxy, verify the current App session first, and let only the Service adapter attach the deployment-injected token. Do not put Make tokens or rawAuthorizationURLs in UI state, public config, JSX, or logs./data/v1/download/** - Add boundary logs at route/adapter entry, success, and failure. Redact tokens, cookies, Authorization, API keys, signed download query strings, and unnecessary personal data.
- For cancellable or supersedable work, a client disconnect must abort downstream work through a request-scoped . Do not stop at ignoring a stale response, and do not treat an expected
AbortSignalas a user-visible 5xx failure.AbortError - Tests are required for route contracts, invalid input, adapter payloads, direct Make response status/body passthrough, and any schema/value normalization added by this skill.
- Do not report a generated or refactored Make App Service complete without the default principal permission proxy from and its required tests.
make-app-permission - For and
record-write-permission, followrecords/bulk: precheck the complete target with one Makemake-app-actionscall, parse the explicit-selection HTTP 200 / business-code/data/v1/permissiondenial and its20000032losslessly from the raw response before JavaScriptnoPermissionRecordIdscoercion and generic Make error mapping, keep select-all 403 denial ID-less, reuse the target for one MakeNumbercall, and never split diagnostics or loop single-record updates./data/v1/field
- 是UI-Service契约的来源。未更新该文档不得更改Service路由行为。
apps/docs/api.md - 对于使用的Make Deploy Service前置应用,
gatewayBaseUrl: "/api/make"必须记录apps/docs/api.md下的发布版浏览器路径,例如/api/make/**、/api/make/auth/**和/api/make/oauth/**。除非部署的HTTPRoute暴露了无前缀的/api/make/app/**,否则不得将其记录为发布路径。较旧的/app/**项目可仅将/api和/api/auth/**作为显式遗留契约保留。/api/app/** - 新生成的Make POC Service及非平凡的生成/重构代码必须使用分层、组件化的源码结构,而非扁平的路由/适配器/工具文件。对于新的Make POC Service,默认使用平台目录结构:
apps/service、app.ts、server.ts、config.ts、用于Make/后端适配器的logger.ts、用于多步编排的make-client/、用于纯工具函数的services/,以及同位置的测试文件。utils/ - 若生成的POC工作中目录结构扁平,混合了路由注册、Make请求构建、Schema规范化、查找/文件编排、配置解析、日志和工具函数,则属于就绪缺陷。在报告Service完成前必须拆分。
apps/service/src - 或
app.ts中的路由处理器仅负责校验输入、调用服务/适配器、映射Service侧的前置校验错误、记录安全边界上下文并发送文档化的响应。普通的直接Make代理会保留2xx、4xx和5xx的完整HTTP状态、Content-Type和响应体;而选定的Make AI助手适配器则遵循其明确的安全错误契约。不要将原始Make载荷构建、Schema变体解析、记录查找编排、文件代理映射或自定义工作流步骤直接放在路由处理器中。routes/ - 面向UI的聚合路由仅当显式标记为非代理时,才可使用文档化的规范化成功形态。从
apps/docs/api.md中的默认路由-响应模式表开始,然后记录任何宿主特定的异常及其迁移方式。普通的已完成Make错误保持不变;选定的Make AI助手错误契约是单独记录的例外。references/service-api-contracts.md - Service路由处理器在调用Make适配器前校验查询/请求体/路径参数,对无效的客户端输入返回400。
- Service适配器负责Make请求细节,如、
appKey、Make响应码检查、分页转换、文件体映射,以及使用准备好的登录/会话转发上下文。认证/会话机制和共享转发助手属于X-Make-Target;发布/运行时代理头契约属于make-app-auth。make-app-runtime - 基于Make的记录读取API必须通过Service Make适配器调用Make网关Data API。发布版运行时使用k8s内部的;设置了
/make/data/v1/record的本地预览使用MAKE_APP_LOCAL_PREVIEW=true输出的makecli configure resolve --target local-preview --output=json字段加上make_api_origin。这适用于记录列表、记录详情、查找目标记录读取,以及任何读取Make记录的自定义Service路由。/api/make/data/v1/record - Service Make适配器必须将传入请求的已建立登录上下文转发到Make网关,以供基于Make的数据读写使用。至少,当宿主使用Cookie/统一登录认证时保留浏览器会话头,仅当宿主契约已使用Bearer认证时保留现有的
Cookie头,并通过共享的认证/运行时助手应用宿主网关上下文头(如Authorization和X-Forwarded-Host)。不要在此处发明认证策略;认证机制使用X-Forwarded-Proto,但在调用网关前不得丢弃登录上下文。make-app-auth - 发布版/运行时Service API绝不能将用作数据源。不要通过shell调用
makecli、makecli、本地makecli配置或makecli JSON标准输出来提供Schema、记录、候选、查找选项、文件或自定义API数据。在线Service容器没有makecli,因此运行时数据必须来自Make网关/API适配器。npx makecli - 基于Make的Service配置必须从部署注入的中读取其权威
MAKE_APP_KEY;生成的生产代码不得发明、硬编码或让UI输入覆盖该范围。仅当Service在调用适配器前校验了查询或请求体中的appKey与appKey完全相等时,文档化的协议路由才可在查询或请求体中携带MAKE_APP_KEY。appKey - 若调用Make Meta/Data API的Service缺少,配置加载必须在Service报告就绪前失败,并返回清晰的非涉密错误。本地测试夹具可显式注入
MAKE_APP_KEY。MAKE_APP_KEY - 新生成的Service代码从或宿主等效文件读取Make适配器运行时配置。
apps/service/src/config.ts是首选的发布版网关源环境变量;MAKE_API_BASE_URL仅是兼容别名。本地预览从MAKE_SERVER_URL派生其公共网关源,而非部署环境变量。makecli configure resolve --target local-preview --output=json - 若基于Make的Service既未配置也未配置
MAKE_API_BASE_URL,配置加载必须在Service报告就绪前失败,并返回清晰的非涉密错误。MAKE_SERVER_URL - 发布版的/
MAKE_API_BASE_URL值是严格的k8s网关源,如MAKE_SERVER_URL。新生成的Service代码不得在此环境变量中放入http://make-gateway.make-dev、/make、/api/make、/meta、/data或其他服务路径作用域。本地预览解析输出必须作为/auth使用;若较旧的makecli回退返回或读取了带路径作用域的公共make_api_originAPI基础路径,仅在本地预览适配器内部进行规范化。/api/make - Make平台适配器负责服务路径作用域。生成的Service代码根据显式运行时模式派生出上游URL:本地预览使用公共网关源 + ;发布版使用k8s网关源 +
/api/make/**,例如/make/**和http://make-gateway.make-dev/make/meta/**。http://make-gateway.make-dev/make/data/** - 对于Make App AI助手适配器,遵循:浏览器通过同源调用固定的
make-ai-assistant18个操作系列;本地预览Service上游使用/api/make/app/ai/v1/**加上make_api_origin;发布版Service上游使用/api/make/app/ai/v1/**或其兼容别名MAKE_API_BASE_URL中的严格源加上MAKE_SERVER_URL。Service必须从/make/app/ai/v1/**读取已部署的范围,并拒绝所有与之不同的查询/请求体MAKE_APP_KEY;每个非GET/HEAD请求都需要检查一个HTTP(S)同源appKey是否与选定的Host匹配。不得添加仅用于助手的/AI Gateway/Agent Gateway源、令牌、环境变量或硬编码域名。将裸JSON对象、空204响应、Origin、SSE和字节作为单独的成功模式保留,不要在宿主校验器中缩小有效协议DTO的范围。对于AI错误,保留带HTTP状态的、符合Schema的有限扁平Make-AI-Api-Version结构,包括可扩展的未知代码;格式错误/非公开的上游错误将转换为安全的Service错误,不会泄露原始诊断信息。绝不能将有效的公共类型化错误重映射为502。{code,message,requestId?,details?} - 若同一Service调用其他网关服务,这些适配器从同一网关源定义自己的显式服务作用域。不要从中剥离
MAKE_API_BASE_URL,也不要重载带路径作用域的基础URL来访问不相关的服务。/make - 集群内的Service到网关调用不得使用面向浏览器的前缀。
/api/make属于同源浏览器访问、Service入口和本地预览公共网关调用;发布版Service内部上游URL使用网关源加上/api/make/**。/make - Service源码不得硬编码具体的Make开发/测试/生产域名,不得推断命名空间本地网关地址,也不得将部署环境映射到域名。
- 运行时Service代码在发布版应用中启动或提供Schema/数据时,不得依赖、
apps/dsl/**或复制的/dsl/**文件。*.yaml - Schema API在UI看到后端Schema变体之前对其进行规范化。在Service/API边界处理已知变体,如、
entity.properties.fields或宿主文档化的等效变体,并保留字段的entity.fields/capabilities.sortable以供排序和分组使用。capabilities.groupable - 权限裁剪后的Schema规范化将和
fields作为独立集合保留。分别规范化每个集合;缺失或无效的createFields将变为createFields,绝不会回退到[]。当宿主契约要求无损转发时,保留fields作为响应元数据,但不要用它来推导当前编辑行为。editableFields - Schema缓存与处理中请求的复用不得在不同主体间共享权限裁剪后的实体。按租户、主体/会话身份、应用和访问世代(或使用请求本地缓存)作为键,并提供失效/重载路径,供权限刷新在数据刷新前调用。
- 记录列表和详情是独立的契约。当存在单记录Make调用时,不得通过调用列表接口并猜测第一条记录来实现详情接口。
- Entity Preset GET/PATCH路由必须使用Make Preset 适配器,配合
/preset/v1/entity/MakeService.GetResource,保留已建立的登录上下文,且仅更新提交的维度。使用MakeService.UpdateResource、make-app-sort和make-app-filter处理维度语义。make-app-group - Preset排序和记录排序必须共享形态校验,并根据当前运行时Schema的权威地校验字段。在调用Make前,拒绝无效、重复、不可排序或超过五条的规则。
capabilities.sortable === true - 稀疏Preset更新必须保留兄弟维度;保存排序时不得发送过滤/分组,保存过滤时不得发送排序/分组,保存分组时不得发送过滤/排序。
- 用户和部门候选数据来自Service路由,如和
GET /api/users或宿主等效路由;不要在生成的Service中使用本地演示数组。GET /api/departments - 查找选项API必须从Schema元数据解析目标对象/字段,并返回。默认情况下,不得向选择器UI暴露完整的目标记录。
{ options, total } - 文件路由通过Service代理上传/删除/下载。当存在Service下载代理时,UI不应暴露原始后端文件URL。
- 浏览器资源标签(如)无法附加
<img src>。当Make文件下载需要Bearer令牌时,通过Service下载代理保持URL面向浏览器,首先验证当前应用会话,仅让Service适配器附加部署注入的令牌。不要将Make令牌或原始AuthorizationURL放在UI状态、公共配置、JSX或日志中。/data/v1/download/** - 在路由/适配器入口、成功和失败时添加边界日志。对令牌、Cookie、Authorization、API密钥、签名下载查询字符串及不必要的个人数据进行脱敏。
- 对于可取消或可被取代的工作,客户端断开必须通过请求作用域的中止下游工作。不要仅忽略过期响应,也不要将预期的
AbortSignal视为用户可见的5xx失败。AbortError - 必须为路由契约、无效输入、适配器载荷、直接Make响应状态/体透传以及此技能添加的任何Schema/值规范化编写测试。
- 若没有提供的默认主体权限代理及其所需测试,不得报告生成或重构的Make App Service已完成。
make-app-permission - 对于和
record-write-permission,遵循records/bulk: 通过一次Makemake-app-actions调用预检查完整目标,在JavaScript/data/v1/permission强制转换和通用Make错误映射之前,从原始响应中无损地解析显式选择的HTTP 200 / 业务码Number拒绝及其20000032,保持全选403拒绝无ID,将目标复用于一次MakenoPermissionRecordIds调用,绝不能拆分诊断信息或循环执行单记录更新。/data/v1/field
Default route baseline
默认路由基线
Prefer these UI-Service contracts for new Make App Service projects unless the host project already documents equivalent routes:
text
GET /api/health
GET /health
GET /api/config
GET /api/make/app/principal/permission
GET /api/schema
GET /api/entities/:entityKey/fields
GET /api/entities/:entityKey/preset
PATCH /api/entities/:entityKey/preset
GET /api/entities/:entityKey/records
GET /api/entities/:entityKey/records/:recordID
POST /api/entities/:entityKey/records
POST /api/make/app/entities/:objectKey/record-write-permission
POST /api/make/app/entities/:objectKey/records/bulk
PATCH /api/entities/:entityKey/records/:recordID
DELETE /api/entities/:entityKey/records/:recordID
PATCH /api/entities/:entityKey/records/:recordID/cells/:fieldKey
GET /api/users
GET /api/departments
GET /api/lookup-options
POST /api/entities/:entityKey/records/:recordID/files/:fieldKey
DELETE /api/entities/:entityKey/records/:recordID/files/:fieldKey
GET /api/files/download/*Lookup relation update routes are optional and should be generated only when the UI needs editable lookup relationships and the Service can preserve a full snapshot safely.
qfei_relation对于新的Make App Service项目,优先使用以下UI-Service契约,除非宿主项目已经记录了等效路由:
text
GET /api/health
GET /health
GET /api/config
GET /api/make/app/principal/permission
GET /api/schema
GET /api/entities/:entityKey/fields
GET /api/entities/:entityKey/preset
PATCH /api/entities/:entityKey/preset
GET /api/entities/:entityKey/records
GET /api/entities/:entityKey/records/:recordID
POST /api/entities/:entityKey/records
POST /api/make/app/entities/:objectKey/record-write-permission
POST /api/make/app/entities/:objectKey/records/bulk
PATCH /api/entities/:entityKey/records/:recordID
DELETE /api/entities/:entityKey/records/:recordID
PATCH /api/entities/:entityKey/records/:recordID/cells/:fieldKey
GET /api/users
GET /api/departments
GET /api/lookup-options
POST /api/entities/:entityKey/records/:recordID/files/:fieldKey
DELETE /api/entities/:entityKey/records/:recordID/files/:fieldKey
GET /api/files/download/*查找关系更新路由是可选的,仅当UI需要可编辑的查找关系且Service能够安全地保留完整的快照时才应生成。
qfei_relationCollaboration rules
协作规则
- With : this skill provides Service contracts and normalized API shapes;
makeuidecides how UI renders them.makeui - With : this skill provides Service layering and tests;
make-app-permissionowns the principal permission route, IAM upstream path, App scope payload, and frontend permission contract.make-app-permission - With : this skill provides schema/records/candidate APIs and owns Service-side disconnect-to-downstream cancellation; table rendering, editing UI, and browser-side virtual-page scheduling stay in the canvas skill.
canvas-table-integration - With : this skill implements and tests Preset/records routes and Make adapters;
make-app-sortowns sortable rules, draft/save timing, and header linkage.make-app-sort - With : this skill implements and tests Preset/records routes and Make adapters;
make-app-filterowns package filter behavior, hydration, and save timing.make-app-filter - With : this skill implements and tests Preset group, record-groups, records groupFilter, and Make adapters;
make-app-groupowns groupable rules, groupFilter composition, grouped data timing, and CanvasTable grouped-flow coordination.make-app-group - With : this skill implements and tests
make-app-actions,record-write-permission, strict target parsing, Make adapters, and error mapping;records/bulkowns selection intent, action timing, permission-key choice, frozen snapshots, and UI feedback.make-app-actions - With : this skill implements Make App AI route handlers, proxy adapters, runtime config validation, safe logs, AbortSignal propagation, and Service tests;
make-ai-assistantowns package integration, the v1 18-operation DTO/response/stream semantics, multi-session behavior, and interface-domain rules.make-ai-assistant - With : this skill may preserve Service-fronted app route shape, but auth proxy and session behavior stay in auth.
make-app-auth - With : this skill writes Service source and tests; runtime build/start/port checks stay in runtime.
make-app-runtime
- 与协作:此技能提供Service契约和规范化API形态;
makeui决定UI如何渲染它们。makeui - 与协作:此技能提供Service分层和测试;
make-app-permission负责主体权限路由、IAM上游路径、应用范围载荷及前端权限契约。make-app-permission - 与协作:此技能提供Schema/记录/候选API,并负责Service端的断连到下游取消;表格渲染、编辑UI和浏览器端虚拟页调度保留在canvas技能中。
canvas-table-integration - 与协作:此技能实现并测试Preset/记录路由和Make适配器;
make-app-sort负责可排序规则、草稿/保存时机及表头联动。make-app-sort - 与协作:此技能实现并测试Preset/记录路由和Make适配器;
make-app-filter负责过滤包行为、hydration及保存时机。make-app-filter - 与协作:此技能实现并测试Preset分组、记录组、记录groupFilter及Make适配器;
make-app-group负责可分组规则、groupFilter组合、分组数据时机及CanvasTable分组流协调。make-app-group - 与协作:此技能实现并测试
make-app-actions、record-write-permission、严格目标解析、Make适配器及错误映射;records/bulk负责选择意图、动作时机、权限键选择、冻结快照及UI反馈。make-app-actions - 与协作:此技能实现Make App AI路由处理器、代理适配器、运行时配置校验、安全日志、AbortSignal传播及Service测试;
make-ai-assistant负责包集成、v1 18个操作的DTO/响应/流语义、多会话行为及接口域规则。make-ai-assistant - 与协作:此技能可保留Service前置应用的路由形态,但认证代理和会话行为由auth负责。
make-app-auth - 与协作:此技能编写Service源码和测试;运行时构建/启动/端口检查由runtime负责。
make-app-runtime