feat: add scoped history and artifacts
This commit is contained in:
@@ -0,0 +1,635 @@
|
||||
{
|
||||
"openapi": "3.0.3",
|
||||
"info": {
|
||||
"title": "TJWater Agent history API",
|
||||
"version": "2",
|
||||
"description": "Agent owned history, topics and paginated visible-text search. Topics group chats within one verified user/data scope; they do not grant business permissions."
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"bearerAuth": []
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
"/api/v1/sessions": {
|
||||
"get": {
|
||||
"summary": "List and search owned conversations",
|
||||
"description": "Without pagination/filter parameters the legacy full-list behavior remains available. Paged calls sort updated_at and id descending; cursors are scoped to owner, project, purpose and title query.",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "X-Project-Id",
|
||||
"in": "header",
|
||||
"required": false,
|
||||
"description": "Required for project scope; omit for personal scope",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "purpose",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"ordinary_chat",
|
||||
"task_collaboration",
|
||||
"task_execution"
|
||||
],
|
||||
"default": "ordinary_chat"
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"name": "task_id",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"name": "q",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"maxLength": 200
|
||||
},
|
||||
"description": "Case-insensitive substring in session title or visible user/assistant message text, across all topics unless topic_id is specified."
|
||||
},
|
||||
{
|
||||
"name": "limit",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 100,
|
||||
"default": 30
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"name": "cursor",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"maxLength": 2048
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"name": "topic_id",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "Optional topic UUID, or unclassified. Omitted means every topic plus unclassified in the verified scope."
|
||||
},
|
||||
{
|
||||
"name": "include_collaboration",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"description": "Include ordinary and manual task collaboration chats together; never task_execution. Default retains the explicit purpose filter."
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Owned history page",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/SessionPage"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid query or cursor; reload when the message boundary changed"
|
||||
},
|
||||
"401": {
|
||||
"description": "Authentication required"
|
||||
},
|
||||
"404": {
|
||||
"description": "Session missing or outside the verified owner and scope"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/session/{session_id}": {
|
||||
"get": {
|
||||
"summary": "Read owned conversation metadata and a recent message window",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "session_id",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "X-Project-Id",
|
||||
"in": "header",
|
||||
"required": false,
|
||||
"description": "Required for project scope; omit for personal scope",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "message_limit",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 100,
|
||||
"default": 40
|
||||
},
|
||||
"description": "Omit to retain legacy full-history reads"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Owned history page",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/SessionSummary"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"messages"
|
||||
],
|
||||
"properties": {
|
||||
"messages": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"message_page": {
|
||||
"$ref": "#/components/schemas/MessagePagination"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid query or cursor; reload when the message boundary changed"
|
||||
},
|
||||
"401": {
|
||||
"description": "Authentication required"
|
||||
},
|
||||
"404": {
|
||||
"description": "Session missing or outside the verified owner and scope"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/session/{session_id}/messages": {
|
||||
"get": {
|
||||
"summary": "Read older owned messages in chronological order",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "session_id",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "X-Project-Id",
|
||||
"in": "header",
|
||||
"required": false,
|
||||
"description": "Required for project scope; omit for personal scope",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "limit",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 100,
|
||||
"default": 40
|
||||
},
|
||||
"description": ""
|
||||
},
|
||||
{
|
||||
"name": "before",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"maxLength": 2048
|
||||
},
|
||||
"description": "Opaque boundary from message_page.before_cursor; omitted for the latest page"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Owned history page",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/MessagePage"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid query or cursor; reload when the message boundary changed"
|
||||
},
|
||||
"401": {
|
||||
"description": "Authentication required"
|
||||
},
|
||||
"404": {
|
||||
"description": "Session missing or outside the verified owner and scope"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/session/{session_id}/stream": {
|
||||
"get": {
|
||||
"summary": "Resume an owned session with a bounded initial snapshot",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "session_id",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "X-Project-Id",
|
||||
"in": "header",
|
||||
"required": false,
|
||||
"description": "Required for project scope; omit for personal scope",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "message_limit",
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 100,
|
||||
"default": 40
|
||||
},
|
||||
"description": "Omit for legacy full snapshots"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "SSE: initial state carries messages, optional message_page, session_id, is_streaming and run_status; following events retain their existing contracts. Closing this subscription does not stop generation.",
|
||||
"content": {
|
||||
"text/event-stream": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid query or cursor; reload when the message boundary changed"
|
||||
},
|
||||
"401": {
|
||||
"description": "Authentication required"
|
||||
},
|
||||
"404": {
|
||||
"description": "Session missing or outside the verified owner and scope"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/topics": {
|
||||
"get": {
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Owned topics",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"topics": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Topic"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 80
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Created topic",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Topic"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid name"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/topics/{topic_id}": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "topic_id",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
}
|
||||
}
|
||||
],
|
||||
"patch": {
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 80
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Renamed topic",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Topic"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Topic not found"
|
||||
}
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"description": "Removes the grouping; conversations are retained as unclassified.",
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "Removed"
|
||||
},
|
||||
"404": {
|
||||
"description": "Topic not found"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/session/{session_id}/topic": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "session_id",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"patch": {
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"topic_id"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"topic_id": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Membership updated"
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid membership"
|
||||
},
|
||||
"404": {
|
||||
"description": "Owned session or topic not found"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"securitySchemes": {
|
||||
"bearerAuth": {
|
||||
"type": "http",
|
||||
"scheme": "bearer"
|
||||
}
|
||||
},
|
||||
"schemas": {
|
||||
"SessionSummary": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"title"
|
||||
],
|
||||
"additionalProperties": true,
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"created_at": {
|
||||
"type": "string"
|
||||
},
|
||||
"updated_at": {
|
||||
"type": "string"
|
||||
},
|
||||
"purpose": {
|
||||
"type": "string"
|
||||
},
|
||||
"is_streaming": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"run_status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"running",
|
||||
"completed",
|
||||
"error",
|
||||
"aborted"
|
||||
]
|
||||
},
|
||||
"topic_id": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"topic_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"search_snippet": {
|
||||
"type": "string",
|
||||
"description": "Visible body text excerpt; never tool arguments or reasoning."
|
||||
}
|
||||
}
|
||||
},
|
||||
"SessionPage": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"sessions",
|
||||
"has_more",
|
||||
"next_cursor"
|
||||
],
|
||||
"properties": {
|
||||
"sessions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/SessionSummary"
|
||||
}
|
||||
},
|
||||
"has_more": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"next_cursor": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"MessagePagination": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"has_more",
|
||||
"before_cursor"
|
||||
],
|
||||
"properties": {
|
||||
"has_more": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"before_cursor": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"MessagePage": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"messages",
|
||||
"message_page"
|
||||
],
|
||||
"properties": {
|
||||
"messages": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
},
|
||||
"message_page": {
|
||||
"$ref": "#/components/schemas/MessagePagination"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Topic": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"name",
|
||||
"createdAt",
|
||||
"updatedAt"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 80
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+618
-8
@@ -283,6 +283,9 @@
|
||||
"title": "Gs Workspace",
|
||||
"type": "string"
|
||||
},
|
||||
"map_config": {
|
||||
"$ref": "#/components/schemas/ProjectMapConfig"
|
||||
},
|
||||
"map_extent": {
|
||||
"anyOf": [
|
||||
{
|
||||
@@ -346,6 +349,9 @@
|
||||
"title": "Gs Workspace",
|
||||
"type": "string"
|
||||
},
|
||||
"map_config": {
|
||||
"$ref": "#/components/schemas/ProjectMapConfig"
|
||||
},
|
||||
"map_extent": {
|
||||
"anyOf": [
|
||||
{
|
||||
@@ -428,6 +434,16 @@
|
||||
],
|
||||
"title": "Gs Workspace"
|
||||
},
|
||||
"map_config": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/ProjectMapConfig"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"map_extent": {
|
||||
"anyOf": [
|
||||
{
|
||||
@@ -1128,6 +1144,93 @@
|
||||
"title": "AgentTaskContext",
|
||||
"type": "object"
|
||||
},
|
||||
"AnswerUiBlock": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"block_id": {
|
||||
"pattern": "^[a-zA-Z0-9_-]{1,80}$",
|
||||
"title": "Block Id",
|
||||
"type": "string"
|
||||
},
|
||||
"fallback_text": {
|
||||
"maxLength": 4000,
|
||||
"minLength": 1,
|
||||
"title": "Fallback Text",
|
||||
"type": "string"
|
||||
},
|
||||
"spec": {
|
||||
"$ref": "#/components/schemas/AnswerUiSpec"
|
||||
},
|
||||
"version": {
|
||||
"const": "answer-ui@1",
|
||||
"title": "Version",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"version",
|
||||
"block_id",
|
||||
"fallback_text",
|
||||
"spec"
|
||||
],
|
||||
"title": "AnswerUiBlock",
|
||||
"type": "object"
|
||||
},
|
||||
"AnswerUiElement": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"children": {
|
||||
"items": {
|
||||
"pattern": "^[a-zA-Z0-9_-]{1,80}$",
|
||||
"type": "string"
|
||||
},
|
||||
"maxItems": 48,
|
||||
"title": "Children",
|
||||
"type": "array"
|
||||
},
|
||||
"props": {
|
||||
"additionalProperties": true,
|
||||
"title": "Props",
|
||||
"type": "object"
|
||||
},
|
||||
"type": {
|
||||
"title": "Type",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"props",
|
||||
"children"
|
||||
],
|
||||
"title": "AnswerUiElement",
|
||||
"type": "object"
|
||||
},
|
||||
"AnswerUiSpec": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"elements": {
|
||||
"patternProperties": {
|
||||
"^[a-zA-Z0-9_-]{1,80}$": {
|
||||
"$ref": "#/components/schemas/AnswerUiElement"
|
||||
}
|
||||
},
|
||||
"title": "Elements",
|
||||
"type": "object"
|
||||
},
|
||||
"root": {
|
||||
"pattern": "^[a-zA-Z0-9_-]{1,80}$",
|
||||
"title": "Root",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"root",
|
||||
"elements"
|
||||
],
|
||||
"title": "AnswerUiSpec",
|
||||
"type": "object"
|
||||
},
|
||||
"AuditLogResponse": {
|
||||
"description": "审计日志响应",
|
||||
"properties": {
|
||||
@@ -3681,6 +3784,14 @@
|
||||
"minLength": 1,
|
||||
"title": "Title",
|
||||
"type": "string"
|
||||
},
|
||||
"ui_blocks": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ReportUiBlock"
|
||||
},
|
||||
"maxItems": 8,
|
||||
"title": "Ui Blocks",
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -3778,6 +3889,14 @@
|
||||
"minLength": 1,
|
||||
"title": "Title",
|
||||
"type": "string"
|
||||
},
|
||||
"ui_blocks": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ReportUiBlock"
|
||||
},
|
||||
"maxItems": 8,
|
||||
"title": "Ui Blocks",
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -5923,6 +6042,39 @@
|
||||
"title": "Page[str]",
|
||||
"type": "object"
|
||||
},
|
||||
"PlaceSearchConfig": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"admin_code": {
|
||||
"pattern": "^(?:156)?[0-9]{6}$",
|
||||
"title": "Admin Code",
|
||||
"type": "string"
|
||||
},
|
||||
"enabled": {
|
||||
"default": false,
|
||||
"title": "Enabled",
|
||||
"type": "boolean"
|
||||
},
|
||||
"provider": {
|
||||
"const": "tianditu",
|
||||
"default": "tianditu",
|
||||
"title": "Provider",
|
||||
"type": "string"
|
||||
},
|
||||
"region": {
|
||||
"maxLength": 100,
|
||||
"minLength": 1,
|
||||
"title": "Region",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"admin_code",
|
||||
"region"
|
||||
],
|
||||
"title": "PlaceSearchConfig",
|
||||
"type": "object"
|
||||
},
|
||||
"PlaceSearchItem": {
|
||||
"properties": {
|
||||
"address": {
|
||||
@@ -5941,8 +6093,7 @@
|
||||
"title": "Category"
|
||||
},
|
||||
"district": {
|
||||
"const": "奉贤区",
|
||||
"default": "奉贤区",
|
||||
"minLength": 1,
|
||||
"title": "District",
|
||||
"type": "string"
|
||||
},
|
||||
@@ -5974,7 +6125,8 @@
|
||||
"name",
|
||||
"address",
|
||||
"longitude",
|
||||
"latitude"
|
||||
"latitude",
|
||||
"district"
|
||||
],
|
||||
"title": "PlaceSearchItem",
|
||||
"type": "object"
|
||||
@@ -6006,8 +6158,7 @@
|
||||
"type": "array"
|
||||
},
|
||||
"region": {
|
||||
"const": "奉贤区",
|
||||
"default": "奉贤区",
|
||||
"minLength": 1,
|
||||
"title": "Region",
|
||||
"type": "string"
|
||||
},
|
||||
@@ -6025,7 +6176,8 @@
|
||||
},
|
||||
"required": [
|
||||
"items",
|
||||
"total"
|
||||
"total",
|
||||
"region"
|
||||
],
|
||||
"title": "PlaceSearchResponse",
|
||||
"type": "object"
|
||||
@@ -6300,6 +6452,23 @@
|
||||
"title": "ProjectDatabaseUpsertRequest",
|
||||
"type": "object"
|
||||
},
|
||||
"ProjectMapConfig": {
|
||||
"additionalProperties": true,
|
||||
"properties": {
|
||||
"place_search": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/PlaceSearchConfig"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"title": "ProjectMapConfig",
|
||||
"type": "object"
|
||||
},
|
||||
"ProjectMemberCreateRequest": {
|
||||
"properties": {
|
||||
"project_role": {
|
||||
@@ -6407,6 +6576,9 @@
|
||||
"title": "Gs Workspace",
|
||||
"type": "string"
|
||||
},
|
||||
"map_config": {
|
||||
"$ref": "#/components/schemas/ProjectMapConfig"
|
||||
},
|
||||
"map_extent": {
|
||||
"anyOf": [
|
||||
{
|
||||
@@ -6774,6 +6946,54 @@
|
||||
"title": "RecoverExpiredLeasesResult",
|
||||
"type": "object"
|
||||
},
|
||||
"ReportUiBlock": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"block": {
|
||||
"$ref": "#/components/schemas/AnswerUiBlock"
|
||||
},
|
||||
"evidence_refs": {
|
||||
"items": {
|
||||
"maxLength": 128,
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"maxItems": 100,
|
||||
"minItems": 1,
|
||||
"title": "Evidence Refs",
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"block",
|
||||
"evidence_refs"
|
||||
],
|
||||
"title": "ReportUiBlock",
|
||||
"type": "object"
|
||||
},
|
||||
"ReverseGeocodingRequest": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"latitude": {
|
||||
"maximum": 90.0,
|
||||
"minimum": -90.0,
|
||||
"title": "Latitude",
|
||||
"type": "number"
|
||||
},
|
||||
"longitude": {
|
||||
"maximum": 180.0,
|
||||
"minimum": -180.0,
|
||||
"title": "Longitude",
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"longitude",
|
||||
"latitude"
|
||||
],
|
||||
"title": "ReverseGeocodingRequest",
|
||||
"type": "object"
|
||||
},
|
||||
"RunSimulationManuallyByDateRest": {
|
||||
"properties": {
|
||||
"duration": {
|
||||
@@ -6917,6 +7137,130 @@
|
||||
"title": "ScadaDeviceResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"ScadaLatestReadingResponse": {
|
||||
"additionalProperties": false,
|
||||
"description": "Latest persisted observation for one project SCADA device.",
|
||||
"properties": {
|
||||
"cleaned_value": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"title": "Cleaned Value"
|
||||
},
|
||||
"device_id": {
|
||||
"title": "Device Id",
|
||||
"type": "string"
|
||||
},
|
||||
"device_type": {
|
||||
"title": "Device Type",
|
||||
"type": "string"
|
||||
},
|
||||
"measurement_unit": {
|
||||
"title": "Measurement Unit",
|
||||
"type": "string"
|
||||
},
|
||||
"monitored_value": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"title": "Monitored Value"
|
||||
},
|
||||
"observed_at": {
|
||||
"anyOf": [
|
||||
{
|
||||
"format": "date-time",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"title": "Observed At"
|
||||
},
|
||||
"transmission_frequency": {
|
||||
"title": "Transmission Frequency",
|
||||
"type": "string"
|
||||
},
|
||||
"transmission_mode": {
|
||||
"title": "Transmission Mode",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"device_id",
|
||||
"device_type",
|
||||
"measurement_unit",
|
||||
"transmission_mode",
|
||||
"transmission_frequency"
|
||||
],
|
||||
"title": "ScadaLatestReadingResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"ScadaLatestReadingsResponse": {
|
||||
"additionalProperties": false,
|
||||
"description": "Bounded device page with each device's latest persisted observation.",
|
||||
"properties": {
|
||||
"items": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ScadaLatestReadingResponse"
|
||||
},
|
||||
"title": "Items",
|
||||
"type": "array"
|
||||
},
|
||||
"latest_observed_at": {
|
||||
"anyOf": [
|
||||
{
|
||||
"format": "date-time",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"title": "Latest Observed At"
|
||||
},
|
||||
"limit": {
|
||||
"maximum": 500.0,
|
||||
"minimum": 1.0,
|
||||
"title": "Limit",
|
||||
"type": "integer"
|
||||
},
|
||||
"observed_count": {
|
||||
"minimum": 0.0,
|
||||
"title": "Observed Count",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"minimum": 0.0,
|
||||
"title": "Offset",
|
||||
"type": "integer"
|
||||
},
|
||||
"total": {
|
||||
"minimum": 0.0,
|
||||
"title": "Total",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"items",
|
||||
"total",
|
||||
"limit",
|
||||
"offset",
|
||||
"observed_count"
|
||||
],
|
||||
"title": "ScadaLatestReadingsResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"ScadaReadingBatchItem": {
|
||||
"properties": {
|
||||
"cleaned_value": {
|
||||
@@ -7838,6 +8182,39 @@
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
"get_mutation_status",
|
||||
"query_nearby_elements",
|
||||
"list_regions",
|
||||
"get_region",
|
||||
"get_region_nodes",
|
||||
"get_node_connections",
|
||||
"query_network_extent",
|
||||
"list_major_nodes",
|
||||
"get_model_configuration",
|
||||
"list_model_configurations",
|
||||
"search_project_places",
|
||||
"reverse_geocode",
|
||||
"get_project_info",
|
||||
"export_project_model",
|
||||
"get_sensor_placement_candidate",
|
||||
"export_sensor_placement",
|
||||
"list_task_schedules",
|
||||
"get_task_run_history",
|
||||
"calculate_demand_allocation",
|
||||
"run_burst_simulation",
|
||||
"edit_model_element",
|
||||
"edit_model_configuration",
|
||||
"clean_scada_readings",
|
||||
"write_scada_readings",
|
||||
"delete_scada_readings",
|
||||
"save_simulation_scenario",
|
||||
"create_sensor_placement",
|
||||
"update_sensor_placement",
|
||||
"create_operational_task",
|
||||
"create_task_schedule",
|
||||
"update_task_schedule",
|
||||
"retry_operational_task",
|
||||
"cancel_task_run",
|
||||
"run_simulation",
|
||||
"run_contaminant_simulation",
|
||||
"analyze_valve_closure",
|
||||
@@ -33926,7 +34303,7 @@
|
||||
},
|
||||
"/api/v1/place-search-requests": {
|
||||
"post": {
|
||||
"description": "调用天地图地名搜索,固定上海市奉贤区范围,只返回前 10 个可定位候选,不提供分页。",
|
||||
"description": "调用天地图地名搜索,按当前项目 map_config.place_search 的行政区范围,只返回前 10 个可定位候选,不提供分页。",
|
||||
"operationId": "post_place_search_requests",
|
||||
"parameters": [
|
||||
{
|
||||
@@ -34026,7 +34403,7 @@
|
||||
"OAuth2PasswordBearer": []
|
||||
}
|
||||
],
|
||||
"summary": "Search Fengxian places",
|
||||
"summary": "Search project places",
|
||||
"tags": [
|
||||
"Place Search"
|
||||
]
|
||||
@@ -39027,6 +39404,114 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v1/reverse-geocoding-requests": {
|
||||
"post": {
|
||||
"description": "查询 EPSG:4326 地图取点的地名和地址,复用当前项目的地名搜索配置并保留输入坐标。",
|
||||
"operationId": "post_reverse_geocoding_requests",
|
||||
"parameters": [
|
||||
{
|
||||
"in": "header",
|
||||
"name": "X-Project-Id",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"title": "X-Project-Id",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ReverseGeocodingRequest"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/PlaceSearchItem"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Successful Response"
|
||||
},
|
||||
"401": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Authentication required"
|
||||
},
|
||||
"403": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Insufficient permission"
|
||||
},
|
||||
"404": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Resource not found"
|
||||
},
|
||||
"409": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Resource conflict"
|
||||
},
|
||||
"422": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Validation error"
|
||||
},
|
||||
"503": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Dependency unavailable"
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"OAuth2PasswordBearer": []
|
||||
}
|
||||
],
|
||||
"summary": "Reverse geocode a project map point",
|
||||
"tags": [
|
||||
"Place Search"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v1/rule-properties": {
|
||||
"get": {
|
||||
"description": "获取指定网络中的规则属性信息",
|
||||
@@ -47653,6 +48138,131 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v1/timeseries/scada-readings/latest": {
|
||||
"get": {
|
||||
"description": "Read one latest persisted row per project device without applying a time window.",
|
||||
"operationId": "get_timeseries_scada_readings_latest",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "返回设备数上限",
|
||||
"in": "query",
|
||||
"name": "limit",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"default": 100,
|
||||
"description": "返回设备数上限",
|
||||
"maximum": 500,
|
||||
"minimum": 1,
|
||||
"title": "Limit",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "设备目录偏移量",
|
||||
"in": "query",
|
||||
"name": "offset",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"default": 0,
|
||||
"description": "设备目录偏移量",
|
||||
"minimum": 0,
|
||||
"title": "Offset",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
{
|
||||
"in": "header",
|
||||
"name": "X-Project-Id",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"title": "X-Project-Id",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ScadaLatestReadingsResponse"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Successful Response"
|
||||
},
|
||||
"401": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Authentication required"
|
||||
},
|
||||
"403": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Insufficient permission"
|
||||
},
|
||||
"404": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Resource not found"
|
||||
},
|
||||
"409": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Resource conflict"
|
||||
},
|
||||
"422": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Validation error"
|
||||
},
|
||||
"503": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Dependency unavailable"
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"OAuth2PasswordBearer": []
|
||||
}
|
||||
],
|
||||
"summary": "获取SCADA设备最新数据",
|
||||
"tags": [
|
||||
"TimescaleDB - SCADA"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v1/timeseries/scada-readings/{device_id}/field": {
|
||||
"patch": {
|
||||
"description": "更新指定设备的字段值\n\n更新SCADA设备在特定时间的某个字段监测数据。\n\nArgs:\n device_id: 设备ID\n time: 数据时间戳\n field: 字段名称\n value: 字段新值\n\nReturns:\n 更新结果信息\n\nRaises:\n HTTPException: 当字段不存在或更新失败时返回400错误",
|
||||
|
||||
Reference in New Issue
Block a user