feat: ship loose-offline dbsync (validate, agent push, LWW audit)
Add UUID/FK channel checks, agent whitelist/push APIs, bindings, super-admin LWW audit with rollback, reconcile rate limits, and sync docs. Default customers stay opt-in; company conflict UI is removed. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -281,6 +281,141 @@ paths:
|
||||
responses:
|
||||
"200": { description: OK }
|
||||
|
||||
/api/v1/admin/sync/channels:
|
||||
get:
|
||||
operationId: listSyncChannels
|
||||
summary: 列出同步通道
|
||||
parameters: [{ $ref: "#/components/parameters/Authorization" }]
|
||||
responses: { "200": { description: OK } }
|
||||
post:
|
||||
operationId: createSyncChannel
|
||||
summary: 创建同步通道(UUID PK + FK 闭包校验)
|
||||
parameters: [{ $ref: "#/components/parameters/Authorization" }]
|
||||
responses: { "200": { description: OK }, "400": { description: Bad Request } }
|
||||
/api/v1/admin/sync/channels/{id}:
|
||||
get:
|
||||
operationId: getSyncChannel
|
||||
summary: 获取同步通道
|
||||
parameters:
|
||||
- { $ref: "#/components/parameters/Authorization" }
|
||||
- { $ref: "#/components/parameters/Id" }
|
||||
responses: { "200": { description: OK } }
|
||||
put:
|
||||
operationId: updateSyncChannel
|
||||
summary: 更新同步通道
|
||||
parameters:
|
||||
- { $ref: "#/components/parameters/Authorization" }
|
||||
- { $ref: "#/components/parameters/Id" }
|
||||
responses: { "200": { description: OK } }
|
||||
delete:
|
||||
operationId: deleteSyncChannel
|
||||
summary: 删除同步通道
|
||||
parameters:
|
||||
- { $ref: "#/components/parameters/Authorization" }
|
||||
- { $ref: "#/components/parameters/Id" }
|
||||
responses: { "200": { description: OK } }
|
||||
/api/v1/admin/sync/test:
|
||||
post:
|
||||
operationId: testSyncEndpoints
|
||||
summary: 测试本地/线上库连接
|
||||
parameters: [{ $ref: "#/components/parameters/Authorization" }]
|
||||
responses: { "200": { description: OK } }
|
||||
/api/v1/admin/sync/channels/{id}/prepare:
|
||||
post:
|
||||
operationId: prepareSyncChannel
|
||||
summary: 准备同步(outbox/触发器)
|
||||
parameters:
|
||||
- { $ref: "#/components/parameters/Authorization" }
|
||||
- { $ref: "#/components/parameters/Id" }
|
||||
responses: { "200": { description: OK } }
|
||||
/api/v1/admin/sync/channels/{id}/start:
|
||||
post:
|
||||
operationId: startSyncChannel
|
||||
summary: 启动同步
|
||||
parameters:
|
||||
- { $ref: "#/components/parameters/Authorization" }
|
||||
- { $ref: "#/components/parameters/Id" }
|
||||
responses: { "200": { description: OK } }
|
||||
/api/v1/admin/sync/channels/{id}/stop:
|
||||
post:
|
||||
operationId: stopSyncChannel
|
||||
summary: 停止同步
|
||||
parameters:
|
||||
- { $ref: "#/components/parameters/Authorization" }
|
||||
- { $ref: "#/components/parameters/Id" }
|
||||
responses: { "200": { description: OK } }
|
||||
/api/v1/admin/sync/channels/{id}/reconcile:
|
||||
post:
|
||||
operationId: reconcileSyncChannel
|
||||
summary: 同步修复(对账,有限流)
|
||||
parameters:
|
||||
- { $ref: "#/components/parameters/Authorization" }
|
||||
- { $ref: "#/components/parameters/Id" }
|
||||
responses: { "200": { description: OK }, "429": { description: Too Many Requests } }
|
||||
/api/v1/admin/sync/channels/{id}/ingest:
|
||||
post:
|
||||
operationId: ingestSyncRows
|
||||
summary: 外部行写入通道 local
|
||||
parameters:
|
||||
- { $ref: "#/components/parameters/Authorization" }
|
||||
- { $ref: "#/components/parameters/Id" }
|
||||
responses: { "200": { description: OK } }
|
||||
/api/v1/admin/sync/bindings:
|
||||
get:
|
||||
operationId: listSyncBindings
|
||||
summary: 列出本机库↔线上库绑定
|
||||
parameters: [{ $ref: "#/components/parameters/Authorization" }]
|
||||
responses: { "200": { description: OK } }
|
||||
post:
|
||||
operationId: ensureSyncBinding
|
||||
summary: 登记/更新绑定
|
||||
parameters: [{ $ref: "#/components/parameters/Authorization" }]
|
||||
responses: { "200": { description: OK } }
|
||||
/api/v1/admin/sync/conflicts:
|
||||
get:
|
||||
operationId: listSyncConflicts
|
||||
summary: 已废弃(公司侧 403)
|
||||
parameters: [{ $ref: "#/components/parameters/Authorization" }]
|
||||
responses: { "403": { description: Forbidden } }
|
||||
/api/v1/agent/sync/channels/{id}/whitelist:
|
||||
get:
|
||||
operationId: agentSyncWhitelist
|
||||
summary: 本机 agent 拉取表白名单
|
||||
parameters:
|
||||
- { $ref: "#/components/parameters/Authorization" }
|
||||
- { $ref: "#/components/parameters/Id" }
|
||||
responses: { "200": { description: OK } }
|
||||
/api/v1/agent/sync/channels/{id}/push:
|
||||
post:
|
||||
operationId: agentSyncPush
|
||||
summary: 本机 agent 推变更到线上 A
|
||||
parameters:
|
||||
- { $ref: "#/components/parameters/Authorization" }
|
||||
- { $ref: "#/components/parameters/Id" }
|
||||
responses: { "200": { description: OK } }
|
||||
/api/v1/agent/sync/channels/{id}/push/batch:
|
||||
post:
|
||||
operationId: agentSyncPushBatch
|
||||
summary: 本机 agent 批量推送
|
||||
parameters:
|
||||
- { $ref: "#/components/parameters/Authorization" }
|
||||
- { $ref: "#/components/parameters/Id" }
|
||||
responses: { "200": { description: OK } }
|
||||
/api/v1/platform/dbsync/lww-overrides:
|
||||
get:
|
||||
operationId: platformLwwOverrides
|
||||
summary: 超管 LWW 覆盖审计
|
||||
parameters: [{ $ref: "#/components/parameters/Authorization" }]
|
||||
responses: { "200": { description: OK }, "403": { description: Forbidden } }
|
||||
/api/v1/platform/dbsync/lww-overrides/{id}/rollback:
|
||||
post:
|
||||
operationId: platformLwwRollback
|
||||
summary: 超管按落败快照回滚线上单行
|
||||
parameters:
|
||||
- { $ref: "#/components/parameters/Authorization" }
|
||||
- { $ref: "#/components/parameters/Id" }
|
||||
responses: { "200": { description: OK }, "400": { description: Bad Request } }
|
||||
|
||||
components:
|
||||
parameters:
|
||||
Authorization:
|
||||
|
||||
Reference in New Issue
Block a user