diff --git a/sdk/next-builder-sdk/contracts.json b/sdk/next-builder-sdk/contracts.json index b17e444..a24e312 100644 --- a/sdk/next-builder-sdk/contracts.json +++ b/sdk/next-builder-sdk/contracts.json @@ -4816,9 +4816,17 @@ "name": "instance", "type": "map", "description": "node instance" + }, + { + "name": "isRecordChangeHistory", + "type": "bool", + "description": "是否记录变更历史" } ], - "required": ["appId", "objectId", "instance"] + "required": ["appId", "objectId", "instance"], + "default": { + "isRecordChangeHistory": true + } }, "response": { "type": "object", @@ -4844,7 +4852,7 @@ "Org": 8888, "User": "easyops" }, - "body": "{\n \"objectId\": \"STORYBOARD_ROUTE\",\n \"instance\": {\n \"alias\": \"test-alias\",\n \"appId\": \"janice-test-create1\",\n \"children\": [],\n \"context\": null,\n \"contextModel\": [],\n \"exact\": true,\n \"hybrid\": false,\n \"id\": \"B-52633\",\n \"org\": 6620199,\n \"parent\": [],\n \"path\": \"${APP.homepage}/new\",\n \"previewSettings\": null,\n \"public\": false,\n \"tests\": [],\n \"type\": \"bricks\",\n \"userFlowNode\": []\n }\n}" + "body": "{\n \"objectId\": \"STORYBOARD_ROUTE\",\n isRecordChangeHistory: true,\n \"instance\": {\n \"alias\": \"test-alias\",\n \"appId\": \"janice-test-create1\",\n \"children\": [],\n \"context\": null,\n \"contextModel\": [],\n \"exact\": true,\n \"hybrid\": false,\n \"id\": \"B-52633\",\n \"org\": 6620199,\n \"parent\": [],\n \"path\": \"${APP.homepage}/new\",\n \"previewSettings\": null,\n \"public\": false,\n \"tests\": [],\n \"type\": \"bricks\",\n \"userFlowNode\": []\n }\n}" }, "response": { "headers": { @@ -4894,9 +4902,17 @@ }, { "ref": "InstanceRelationRequest.*" + }, + { + "name": "isRecordChangeHistory", + "type": "bool", + "description": "是否记录变更历史" } ], - "required": ["appId", "relationId", "objectId", "relationSideId"] + "required": ["appId", "relationId", "objectId", "relationSideId"], + "default": { + "isRecordChangeHistory": true + } }, "response": null, "examples": [ @@ -4958,8 +4974,16 @@ "name": "datas", "type": "map[]", "description": "导入实例数据列表,必须包含keys里面的字段" + }, + { + "name": "isRecordChangeHistory", + "type": "bool", + "description": "是否记录变更历史" } ], + "default": { + "isRecordChangeHistory": true + }, "required": ["appId"] }, "response": { @@ -5070,11 +5094,43 @@ "name": "linked", "type": "bool", "description": "是否linked sourceRoute关联的template" + }, + { + "name": "isRecordChangeHistory", + "type": "bool", + "description": "是否记录变更历史" } ], + "default": { + "isRecordChangeHistory": true + }, "required": ["sourceRouteId", "newAppId"] }, - "response": null + "response": null, + "examples": [ + { + "description": { + "zh": "克隆路由", + "en": "clone route" + }, + "request": { + "method": "POST", + "uri": "/api/v1/nextBuilder/clone_route", + "headers": { + "Content-Type": "application/json", + "Org": 8888, + "User": "easyops" + }, + "body": "{\n \"newAppId\": \"janice-test-create3\",\n \"sourceRouteId\": \"B-32737\",\n \"newParentRouteId\": \"B-52659\",\n \"linked\": false\n}" + }, + "response": { + "headers": { + "Content-Type": "application/json; charset=utf-8" + }, + "body": "{\n \"code\": 0,\n \"error\": \"\",\n \"message\": \"\",\n \"data\": {\n }\n}" + } + } + ] }, { "contract": "next_builder.storyboard.CloneBricks", @@ -5117,11 +5173,43 @@ "name": "linked", "type": "bool", "description": "是否导入linked sourceBrick关联的template" + }, + { + "name": "isRecordChangeHistory", + "type": "bool", + "description": "是否记录变更历史" } ], + "default": { + "isRecordChangeHistory": true + }, "required": ["sourceBrickId", "newParentBrickId", "newAppId"] }, - "response": null + "response": null, + "examples": [ + { + "description": { + "zh": "克隆路由", + "en": "clone route" + }, + "request": { + "method": "POST", + "uri": "/api/v1/nextBuilder/clone", + "headers": { + "Content-Type": "application/json", + "Org": 8888, + "User": "easyops" + }, + "body": "{\n \"newAppId\": \"janice-test-create3\",\n \"sourceBrickId\": \"B-32737\",\n \"newParentBrickId\": \"B-52659\",\n \"linked\": false\n}" + }, + "response": { + "headers": { + "Content-Type": "application/json; charset=utf-8" + }, + "body": "{\n \"code\": 0,\n \"error\": \"\",\n \"message\": \"\",\n \"data\": {\n }\n}" + } + } + ] }, { "contract": "next_builder.storyboard.DeleteNode", @@ -5153,8 +5241,16 @@ "name": "instanceId", "type": "instance_id", "description": "instance_id" + }, + { + "name": "isRecordChangeHistory", + "type": "bool", + "description": "是否记录变更历史" } ], + "default": { + "isRecordChangeHistory": true + }, "required": ["appId", "objectId", "instanceId"] }, "response": null, @@ -5202,11 +5298,42 @@ "name": "nodeId", "type": "string", "description": "storyboard node id" + }, + { + "name": "isRecordChangeHistory", + "type": "bool", + "description": "是否记录变更历史" } ], + "default": { + "isRecordChangeHistory": true + }, "required": ["nodeId"] }, - "response": null + "response": null, + "examples": [ + { + "description": { + "zh": "storyboard节点删除", + "en": "Delete Storyboard Node(递归删除)" + }, + "request": { + "method": "DELETE", + "uri": "/api/v1/nextBuilder/storyboard/B-123", + "headers": { + "Content-Type": "application/json", + "Org": 8888, + "User": "easyops" + } + }, + "response": { + "headers": { + "Content-Type": "application/json; charset=utf-8" + }, + "body": "{\n \"code\": 0,\n \"error\": \"\",\n \"message\": \"\",\n \"data\": {}\n}" + } + } + ] }, { "contract": "next_builder.storyboard.EditNode", @@ -5249,8 +5376,16 @@ "name": "instance", "type": "map", "description": "node instance" + }, + { + "name": "isRecordChangeHistory", + "type": "bool", + "description": "是否记录变更历史" } ], + "default": { + "isRecordChangeHistory": true + }, "required": ["appId", "objectId", "instance"] }, "response": { @@ -5467,8 +5602,16 @@ }, { "ref": "InstanceRelationRequest.*" + }, + { + "name": "isRecordChangeHistory", + "type": "bool", + "description": "是否记录变更历史" } ], + "default": { + "isRecordChangeHistory": true + }, "required": ["appId", "relationId", "objectId", "relationSideId"] }, "response": null, @@ -5569,8 +5712,16 @@ } ], "description": "关系列表值" + }, + { + "name": "isRecordChangeHistory", + "type": "bool", + "description": "是否记录变更历史" } ], + "default": { + "isRecordChangeHistory": true + }, "required": ["appId", "relationId"] }, "response": null, @@ -6149,7 +6300,7 @@ }, { "name": "ts", - "type": "int", + "type": "int64", "description": "时间戳, 返回比这时间戳更早的变更历史, 0 则表示从最新的变更开始查询" }, { @@ -6169,7 +6320,7 @@ "fields": [ { "name": "ts", - "type": "int", + "type": "int64", "description": "最后一条变更历史的时间戳,可用作下一次查询" }, { @@ -6259,9 +6410,19 @@ "type": "string", "description": "变更用户" }, + { + "name": "changeId", + "type": "int64", + "description": "变更的唯一id(ts)" + }, + { + "name": "rollbackId", + "type": "int64", + "description": "rollbackId(当操作是rollback)时使用, 表明回退到哪个步骤" + }, { "name": "ts", - "type": "int", + "type": "int64", "description": "变更时间戳" }, { @@ -6297,7 +6458,7 @@ "headers": { "Content-Type": "application/json; charset=utf-8" }, - "body": "{\n \"code\": 0,\n \"error\": \"\",\n \"message\": \"\",\n \"data\": {\n \"ts\": 1697097411,\n \"list\": [\n {\n \"user\": \"easyops\",\n \"action\": \"add\",\n \"category\": \"brick\",\n \"abstract\": {\n \"nodes\": \"修改确认弹窗\",\n \"nodesCount\": 1\n },\n \"uniqueKey\": \"606551146ac19\",\n \"ts\": 1697097523, \n \"oldHash\": \"\",\n \"newHash\": \"da5c3fe88801b786\"\n },\n {\n \"user\": \"easyops\",\n \"action\": \"append_relation\",\n \"relationId\": \"STORYBOARD_TEMPLATE_Project_Templates_PROJECT_MICRO_APP\",\n \"abstract\": {\n \"leftObjectId\": \"PROJECT_MICRO_APP\",\n \"leftNodes\": [\"\"],\n \"leftNodesCount\": 1,\n \"rightObjectId\": \"STORYBOARD_TEMPLATE\",\n \"rightNodes\": [\"tpl-aaa-bbb\"],\n \"rightNodesCount\": 1\n },\n \"uniqueKey\": \"606551146ac19|606551f92ad12\",\n \"ts\": 1697097411,\n \"oldHash\": \"b83f0932121f1dfa\",\n \"newHash\": \"da5c3fe88801b786\"\n }\n ]\n }\n}" + "body": "{\n \"code\": 0,\n \"error\": \"\",\n \"message\": \"\",\n \"data\": {\n \"ts\": 1697683490575143000,\n \"list\": [\n {\n \"user\": \"easyops\",\n \"action\": \"add\",\n \"category\": \"brick\",\n \"abstract\": {\n \"nodes\": \"修改确认弹窗\",\n \"nodesCount\": 1\n },\n \"uniqueKey\": \"606551146ac19\",\n \"ts\": 1697683490575143000,\n \"changeId\": 1697683490575143000,\n \"oldHash\": \"\",\n \"newHash\": \"da5c3fe88801b786\"\n },\n {\n \"user\": \"janice\",\n \"action\": \"rollback\",\n \"changeId\": 1697683490575144000,\n \"ts\": 1697683490575144000,\n \"rollbackId\": 1697683490575143000\n },\n {\n \"user\": \"easyops\",\n \"action\": \"append_relation\",\n \"relationId\": \"STORYBOARD_TEMPLATE_Project_Templates_PROJECT_MICRO_APP\",\n \"abstract\": {\n \"leftObjectId\": \"PROJECT_MICRO_APP\",\n \"leftNodes\": [\n \"\"\n ],\n \"leftNodesCount\": 1,\n \"rightObjectId\": \"STORYBOARD_TEMPLATE\",\n \"rightNodes\": [\n \"tpl-aaa-bbb\"\n ],\n \"rightNodesCount\": 1\n },\n \"uniqueKey\": \"606551146ac19|606551f92ad12\",\n \"ts\": 1697683490575143000,\n \"changeId\": 1697683490575143000,\n \"oldHash\": \"b83f0932121f1dfa\",\n \"newHash\": \"da5c3fe88801b786\"\n }\n ]\n }\n}" } } ] @@ -6373,18 +6534,13 @@ "type": "string", "description": "appId" }, - { - "name": "uniqueKey", - "type": "string", - "description": "变更对象的唯一标识,例如实例instanceId,关系两端id" - }, { "name": "ts", - "type": "int", + "type": "int64", "description": "变更时间戳" } ], - "required": ["appId", "uniqueKey", "ts"] + "required": ["appId", "ts"] }, "response": null, "examples": [ @@ -6401,7 +6557,7 @@ "Org": 8888, "User": "easyops" }, - "body": "{\n \"appId\": \"demo-app\",\n \"uniqueKey\": \"606551146ac19\",\n \"ts\": 1697097411\n}" + "body": "{\n \"appId\": \"demo-app\",\n \"ts\": 1697683490575143000\n}" }, "response": { "headers": { @@ -6423,7 +6579,7 @@ "Org": 8888, "User": "easyops" }, - "body": "{\n \"appId\": \"demo-app\",\n \"uniqueKey\": \"606551146ac19|606551146ac10\",\n \"ts\": 1697097412\n}" + "body": "{\n \"appId\": \"demo-app\",\n \"ts\": 1697683490575143000\n}" }, "response": { "headers": { diff --git a/sdk/next-builder-sdk/src/api/next_builder/storyboard/addNode.ts b/sdk/next-builder-sdk/src/api/next_builder/storyboard/addNode.ts index 48f301a..fd0dda5 100644 --- a/sdk/next-builder-sdk/src/api/next_builder/storyboard/addNode.ts +++ b/sdk/next-builder-sdk/src/api/next_builder/storyboard/addNode.ts @@ -7,6 +7,9 @@ export interface StoryboardApi_AddNodeRequestBody { /** node instance */ instance: Record; + + /** 是否记录变更历史 */ + isRecordChangeHistory?: boolean; } export interface StoryboardApi_AddNodeResponseBody { diff --git a/sdk/next-builder-sdk/src/api/next_builder/storyboard/appendRelation.ts b/sdk/next-builder-sdk/src/api/next_builder/storyboard/appendRelation.ts index 799ce1c..a9612c3 100644 --- a/sdk/next-builder-sdk/src/api/next_builder/storyboard/appendRelation.ts +++ b/sdk/next-builder-sdk/src/api/next_builder/storyboard/appendRelation.ts @@ -25,4 +25,7 @@ export const StoryboardApi_appendRelation = ( export interface StoryboardApi_AppendRelationRequestBody_2 { /** 关系Id */ relationId: string; + + /** 是否记录变更历史 */ + isRecordChangeHistory?: boolean; } diff --git a/sdk/next-builder-sdk/src/api/next_builder/storyboard/batchImportNodes.ts b/sdk/next-builder-sdk/src/api/next_builder/storyboard/batchImportNodes.ts index 78a9af2..7d0b162 100644 --- a/sdk/next-builder-sdk/src/api/next_builder/storyboard/batchImportNodes.ts +++ b/sdk/next-builder-sdk/src/api/next_builder/storyboard/batchImportNodes.ts @@ -10,6 +10,9 @@ export interface StoryboardApi_BatchImportNodesRequestBody { /** 导入实例数据列表,必须包含keys里面的字段 */ datas?: Record[]; + + /** 是否记录变更历史 */ + isRecordChangeHistory?: boolean; } export interface StoryboardApi_BatchImportNodesResponseBody { diff --git a/sdk/next-builder-sdk/src/api/next_builder/storyboard/cloneBricks.ts b/sdk/next-builder-sdk/src/api/next_builder/storyboard/cloneBricks.ts index 0fe9fbb..f8935cf 100644 --- a/sdk/next-builder-sdk/src/api/next_builder/storyboard/cloneBricks.ts +++ b/sdk/next-builder-sdk/src/api/next_builder/storyboard/cloneBricks.ts @@ -15,6 +15,9 @@ export interface StoryboardApi_CloneBricksRequestBody { /** 是否导入linked sourceBrick关联的template */ linked?: boolean; + + /** 是否记录变更历史 */ + isRecordChangeHistory?: boolean; } /** diff --git a/sdk/next-builder-sdk/src/api/next_builder/storyboard/cloneRoutes.ts b/sdk/next-builder-sdk/src/api/next_builder/storyboard/cloneRoutes.ts index 14e1efb..364cde9 100644 --- a/sdk/next-builder-sdk/src/api/next_builder/storyboard/cloneRoutes.ts +++ b/sdk/next-builder-sdk/src/api/next_builder/storyboard/cloneRoutes.ts @@ -15,6 +15,9 @@ export interface StoryboardApi_CloneRoutesRequestBody { /** 是否linked sourceRoute关联的template */ linked?: boolean; + + /** 是否记录变更历史 */ + isRecordChangeHistory?: boolean; } /** diff --git a/sdk/next-builder-sdk/src/api/next_builder/storyboard/deleteNode.ts b/sdk/next-builder-sdk/src/api/next_builder/storyboard/deleteNode.ts index 18218b8..d06d631 100644 --- a/sdk/next-builder-sdk/src/api/next_builder/storyboard/deleteNode.ts +++ b/sdk/next-builder-sdk/src/api/next_builder/storyboard/deleteNode.ts @@ -6,6 +6,9 @@ export interface StoryboardApi_DeleteNodeRequestParams { /** instance_id */ instanceId: string; + + /** 是否记录变更历史 */ + isRecordChangeHistory?: boolean; } /** diff --git a/sdk/next-builder-sdk/src/api/next_builder/storyboard/deleteStoryboardNode.ts b/sdk/next-builder-sdk/src/api/next_builder/storyboard/deleteStoryboardNode.ts index 5a59391..00c135b 100644 --- a/sdk/next-builder-sdk/src/api/next_builder/storyboard/deleteStoryboardNode.ts +++ b/sdk/next-builder-sdk/src/api/next_builder/storyboard/deleteStoryboardNode.ts @@ -1,14 +1,20 @@ import { http, HttpOptions } from "@next-core/http"; +export interface StoryboardApi_DeleteStoryboardNodeRequestParams { + /** 是否记录变更历史 */ + isRecordChangeHistory?: boolean; +} + /** * @description storyboard节点删除 * @endpoint DELETE /api/v1/nextBuilder/storyboard/:nodeId */ export const StoryboardApi_deleteStoryboardNode = ( nodeId: string | number, + params: StoryboardApi_DeleteStoryboardNodeRequestParams, options?: HttpOptions ): Promise => /**! @contract easyops.api.next_builder.storyboard.DeleteStoryboardNode@1.0.0 */ http.delete( `api/gateway/next_builder.storyboard.DeleteStoryboardNode/api/v1/nextBuilder/storyboard/${nodeId}`, - options + { ...options, params } ); diff --git a/sdk/next-builder-sdk/src/api/next_builder/storyboard/editNode.ts b/sdk/next-builder-sdk/src/api/next_builder/storyboard/editNode.ts index 58922ee..b2ee1e1 100644 --- a/sdk/next-builder-sdk/src/api/next_builder/storyboard/editNode.ts +++ b/sdk/next-builder-sdk/src/api/next_builder/storyboard/editNode.ts @@ -13,6 +13,9 @@ export interface StoryboardApi_EditNodeRequestBody { /** node instance */ instance: Record; + + /** 是否记录变更历史 */ + isRecordChangeHistory?: boolean; } export interface StoryboardApi_EditNodeResponseBody { diff --git a/sdk/next-builder-sdk/src/api/next_builder/storyboard/removeRelation.ts b/sdk/next-builder-sdk/src/api/next_builder/storyboard/removeRelation.ts index 6a74eec..faeb025 100644 --- a/sdk/next-builder-sdk/src/api/next_builder/storyboard/removeRelation.ts +++ b/sdk/next-builder-sdk/src/api/next_builder/storyboard/removeRelation.ts @@ -25,4 +25,7 @@ export const StoryboardApi_removeRelation = ( export interface StoryboardApi_RemoveRelationRequestBody_2 { /** 关系Id */ relationId: string; + + /** 是否记录变更历史 */ + isRecordChangeHistory?: boolean; } diff --git a/sdk/next-builder-sdk/src/api/next_builder/storyboard/updateMultiRelation.ts b/sdk/next-builder-sdk/src/api/next_builder/storyboard/updateMultiRelation.ts index be916b5..09b903e 100644 --- a/sdk/next-builder-sdk/src/api/next_builder/storyboard/updateMultiRelation.ts +++ b/sdk/next-builder-sdk/src/api/next_builder/storyboard/updateMultiRelation.ts @@ -3,6 +3,9 @@ import { http, HttpOptions } from "@next-core/http"; export interface StoryboardApi_UpdateMultiRelationRequestBody { /** 关系列表值 */ list?: StoryboardApi_UpdateMultiRelationRequestBody_list_item[]; + + /** 是否记录变更历史 */ + isRecordChangeHistory?: boolean; } /** diff --git a/sdk/next-builder-sdk/src/api/next_builder/workspace/getChangeHistory.ts b/sdk/next-builder-sdk/src/api/next_builder/workspace/getChangeHistory.ts index 3225234..7eaab17 100644 --- a/sdk/next-builder-sdk/src/api/next_builder/workspace/getChangeHistory.ts +++ b/sdk/next-builder-sdk/src/api/next_builder/workspace/getChangeHistory.ts @@ -54,6 +54,12 @@ export interface WorkspaceApi_GetChangeHistoryResponseBody_list_item { /** 变更用户 */ user?: string; + /** 变更的唯一id(ts) */ + changeId?: number; + + /** rollbackId(当操作是rollback)时使用, 表明回退到哪个步骤 */ + rollbackId?: number; + /** 变更时间戳 */ ts?: number; diff --git a/sdk/next-builder-sdk/src/api/next_builder/workspace/rollback.ts b/sdk/next-builder-sdk/src/api/next_builder/workspace/rollback.ts index 1cec3b2..b7d18a7 100644 --- a/sdk/next-builder-sdk/src/api/next_builder/workspace/rollback.ts +++ b/sdk/next-builder-sdk/src/api/next_builder/workspace/rollback.ts @@ -1,9 +1,6 @@ import { http, HttpOptions } from "@next-core/http"; export interface WorkspaceApi_RollbackRequestBody { - /** 变更对象的唯一标识,例如实例instanceId,关系两端id */ - uniqueKey: string; - /** 变更时间戳 */ ts: number; }