diff --git a/contracts/manifest.json b/contracts/manifest.json index 49cf8d2..b01b367 100644 --- a/contracts/manifest.json +++ b/contracts/manifest.json @@ -3,7 +3,7 @@ "contracts": { "server": { "file": "server-v1.openapi.json", - "sha256": "b565d841061c9091f48ff3118bcc0cbb1b918b0cb8c2316d177570e8b2d8ba29" + "sha256": "de342f10ac2949eb337513b1d1cb6b595083be2fad2860c9ccd92eebe2758e6b" } } } diff --git a/contracts/peripheral-sample.openapi.json b/contracts/peripheral-sample.openapi.json new file mode 100644 index 0000000..c424336 --- /dev/null +++ b/contracts/peripheral-sample.openapi.json @@ -0,0 +1,3700 @@ +{ + "components": { + "schemas": { + "Alert": { + "additionalProperties": false, + "properties": { + "alert_id": { + "title": "Alert Id", + "type": "string" + }, + "message": { + "title": "Message", + "type": "string" + }, + "occurred_at": { + "format": "date-time", + "title": "Occurred At", + "type": "string" + }, + "origin": { + "enum": [ + "historical_replay", + "synthetic" + ], + "title": "Origin", + "type": "string" + }, + "point_id": { + "title": "Point Id", + "type": "string" + } + }, + "required": [ + "alert_id", + "point_id", + "occurred_at", + "message", + "origin" + ], + "title": "Alert", + "type": "object" + }, + "AlertPage": { + "additionalProperties": false, + "properties": { + "availability": { + "enum": [ + "available", + "not_configured" + ], + "title": "Availability", + "type": "string" + }, + "items": { + "items": { + "$ref": "#/components/schemas/Alert" + }, + "title": "Items", + "type": "array" + }, + "origin": { + "enum": [ + "historical_replay", + "synthetic" + ], + "title": "Origin", + "type": "string" + }, + "reason": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Reason" + }, + "source_id": { + "title": "Source Id", + "type": "string" + } + }, + "required": [ + "items", + "source_id", + "origin", + "availability", + "reason" + ], + "title": "AlertPage", + "type": "object" + }, + "Context": { + "additionalProperties": false, + "properties": { + "can_write": { + "title": "Can Write", + "type": "boolean" + }, + "managed_resources": { + "$ref": "#/components/schemas/ManagedResourceCapabilities" + }, + "origin": { + "const": "synthetic", + "title": "Origin", + "type": "string" + }, + "project_id": { + "format": "uuid", + "title": "Project Id", + "type": "string" + }, + "protocol_version": { + "const": "tjwater-peripheral-sample@1", + "title": "Protocol Version", + "type": "string" + }, + "scenarios": { + "items": { + "enum": [ + "normal", + "missing_data", + "unavailable", + "response_lost", + "duplicate_feedback", + "conflicting_feedback", + "late_state" + ], + "type": "string" + }, + "title": "Scenarios", + "type": "array" + }, + "state_transitions": { + "additionalProperties": { + "items": { + "type": "string" + }, + "type": "array" + }, + "title": "State Transitions", + "type": "object" + }, + "user_id": { + "format": "uuid", + "title": "User Id", + "type": "string" + } + }, + "required": [ + "protocol_version", + "origin", + "project_id", + "user_id", + "can_write", + "scenarios", + "state_transitions", + "managed_resources" + ], + "title": "Context", + "type": "object" + }, + "CreateTestDataRecord": { + "additionalProperties": false, + "properties": { + "label": { + "maxLength": 200, + "minLength": 1, + "title": "Label", + "type": "string" + }, + "notes": { + "default": "", + "maxLength": 4000, + "title": "Notes", + "type": "string" + }, + "observed_at": { + "format": "date-time", + "title": "Observed At", + "type": "string" + }, + "point_id": { + "maxLength": 128, + "minLength": 1, + "title": "Point Id", + "type": "string" + }, + "quality": { + "default": "valid", + "enum": [ + "valid", + "unknown", + "missing" + ], + "title": "Quality", + "type": "string" + }, + "request_id": { + "format": "uuid", + "title": "Request Id", + "type": "string" + }, + "unit": { + "maxLength": 32, + "minLength": 1, + "title": "Unit", + "type": "string" + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Value" + } + }, + "required": [ + "request_id", + "label", + "point_id", + "observed_at", + "value", + "unit" + ], + "title": "CreateTestDataRecord", + "type": "object" + }, + "CreateWorkOrder": { + "additionalProperties": false, + "properties": { + "assignee": { + "anyOf": [ + { + "maxLength": 200, + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Assignee" + }, + "priority": { + "default": "normal", + "enum": [ + "low", + "normal", + "high", + "urgent" + ], + "title": "Priority", + "type": "string" + }, + "request_id": { + "format": "uuid", + "title": "Request Id", + "type": "string" + }, + "scheduled_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Scheduled At" + }, + "status": { + "default": "draft", + "enum": [ + "draft", + "open", + "in_progress", + "completed", + "cancelled" + ], + "title": "Status", + "type": "string" + }, + "summary": { + "maxLength": 4000, + "minLength": 1, + "title": "Summary", + "type": "string" + }, + "title": { + "maxLength": 200, + "minLength": 1, + "title": "Title", + "type": "string" + } + }, + "required": [ + "request_id", + "title", + "summary" + ], + "title": "CreateWorkOrder", + "type": "object" + }, + "DeleteResource": { + "additionalProperties": false, + "properties": { + "expected_revision": { + "minimum": 1.0, + "title": "Expected Revision", + "type": "integer" + }, + "request_id": { + "format": "uuid", + "title": "Request Id", + "type": "string" + } + }, + "required": [ + "request_id", + "expected_revision" + ], + "title": "DeleteResource", + "type": "object" + }, + "DeletedResource": { + "additionalProperties": false, + "properties": { + "deleted": { + "const": true, + "title": "Deleted", + "type": "boolean" + }, + "resource_id": { + "format": "uuid", + "title": "Resource Id", + "type": "string" + }, + "resource_type": { + "enum": [ + "work_order", + "test_data_record" + ], + "title": "Resource Type", + "type": "string" + }, + "revision": { + "minimum": 2.0, + "title": "Revision", + "type": "integer" + } + }, + "required": [ + "resource_type", + "resource_id", + "revision", + "deleted" + ], + "title": "DeletedResource", + "type": "object" + }, + "DemoAlert": { + "additionalProperties": false, + "properties": { + "alert_id": { + "format": "uuid", + "title": "Alert Id", + "type": "string" + }, + "asset_id": { + "title": "Asset Id", + "type": "string" + }, + "cleared_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Cleared At" + }, + "code": { + "enum": [ + "communication_lost", + "low_level" + ], + "title": "Code", + "type": "string" + }, + "message": { + "title": "Message", + "type": "string" + }, + "occurred_at": { + "format": "date-time", + "title": "Occurred At", + "type": "string" + } + }, + "required": [ + "alert_id", + "asset_id", + "occurred_at", + "cleared_at", + "code", + "message" + ], + "title": "DemoAlert", + "type": "object" + }, + "DemoDataset": { + "additionalProperties": false, + "properties": { + "alerts": { + "items": { + "$ref": "#/components/schemas/DemoAlert" + }, + "title": "Alerts", + "type": "array" + }, + "device_states": { + "items": { + "$ref": "#/components/schemas/DemoDeviceState" + }, + "title": "Device States", + "type": "array" + }, + "generator_version": { + "const": "water-demo@2", + "title": "Generator Version", + "type": "string" + }, + "observations": { + "items": { + "$ref": "#/components/schemas/Observation" + }, + "title": "Observations", + "type": "array" + }, + "operations": { + "items": { + "$ref": "#/components/schemas/DemoOperation" + }, + "title": "Operations", + "type": "array" + }, + "origin": { + "const": "synthetic", + "title": "Origin", + "type": "string" + }, + "points": { + "items": { + "$ref": "#/components/schemas/Point" + }, + "title": "Points", + "type": "array" + }, + "project_id": { + "format": "uuid", + "title": "Project Id", + "type": "string" + }, + "seed": { + "title": "Seed", + "type": "string" + }, + "source_id": { + "title": "Source Id", + "type": "string" + }, + "source_revision": { + "title": "Source Revision", + "type": "string" + }, + "window": { + "$ref": "#/components/schemas/TimeRange" + } + }, + "required": [ + "generator_version", + "seed", + "origin", + "window", + "points", + "observations", + "device_states", + "alerts", + "operations", + "project_id", + "source_id", + "source_revision" + ], + "title": "DemoDataset", + "type": "object" + }, + "DemoDeviceState": { + "additionalProperties": false, + "properties": { + "asset_id": { + "title": "Asset Id", + "type": "string" + }, + "asset_type": { + "enum": [ + "pressure_sensor", + "pump", + "valve" + ], + "title": "Asset Type", + "type": "string" + }, + "observed_at": { + "format": "date-time", + "title": "Observed At", + "type": "string" + }, + "record_id": { + "format": "uuid", + "title": "Record Id", + "type": "string" + }, + "state": { + "enum": [ + "online", + "offline", + "running", + "stopped", + "open", + "closed" + ], + "title": "State", + "type": "string" + } + }, + "required": [ + "record_id", + "asset_id", + "asset_type", + "observed_at", + "state" + ], + "title": "DemoDeviceState", + "type": "object" + }, + "DemoOperation": { + "additionalProperties": false, + "properties": { + "actor": { + "const": "synthetic-generator", + "title": "Actor", + "type": "string" + }, + "asset_id": { + "title": "Asset Id", + "type": "string" + }, + "note": { + "title": "Note", + "type": "string" + }, + "occurred_at": { + "format": "date-time", + "title": "Occurred At", + "type": "string" + }, + "operation": { + "enum": [ + "pump_start", + "pump_stop", + "valve_open", + "valve_close" + ], + "title": "Operation", + "type": "string" + }, + "record_id": { + "format": "uuid", + "title": "Record Id", + "type": "string" + } + }, + "required": [ + "record_id", + "asset_id", + "occurred_at", + "operation", + "actor", + "note" + ], + "title": "DemoOperation", + "type": "object" + }, + "Feedback": { + "additionalProperties": false, + "properties": { + "applicable_time": { + "$ref": "#/components/schemas/TimeRange" + }, + "asset_ids": { + "items": { + "type": "string" + }, + "title": "Asset Ids", + "type": "array" + }, + "attachment_refs": { + "items": { + "type": "string" + }, + "title": "Attachment Refs", + "type": "array" + }, + "feedback_id": { + "format": "uuid", + "title": "Feedback Id", + "type": "string" + }, + "finding": { + "enum": [ + "instrument_fault", + "no_instrument_fault", + "uncertain" + ], + "title": "Finding", + "type": "string" + }, + "notes": { + "title": "Notes", + "type": "string" + }, + "occurred_at": { + "format": "date-time", + "title": "Occurred At", + "type": "string" + }, + "origin": { + "const": "synthetic", + "title": "Origin", + "type": "string" + }, + "recorded_at": { + "format": "date-time", + "title": "Recorded At", + "type": "string" + }, + "recorded_by": { + "title": "Recorded By", + "type": "string" + }, + "task_id": { + "format": "uuid", + "title": "Task Id", + "type": "string" + } + }, + "required": [ + "feedback_id", + "task_id", + "recorded_by", + "recorded_at", + "occurred_at", + "applicable_time", + "asset_ids", + "finding", + "notes", + "attachment_refs", + "origin" + ], + "title": "Feedback", + "type": "object" + }, + "HistoryEntry": { + "additionalProperties": false, + "properties": { + "actor": { + "title": "Actor", + "type": "string" + }, + "at": { + "format": "date-time", + "title": "At", + "type": "string" + }, + "from_status": { + "anyOf": [ + { + "enum": [ + "pending", + "processing", + "pending_review", + "completed" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "title": "From Status" + }, + "reason": { + "title": "Reason", + "type": "string" + }, + "sequence": { + "minimum": 1.0, + "title": "Sequence", + "type": "integer" + }, + "to_status": { + "enum": [ + "pending", + "processing", + "pending_review", + "completed" + ], + "title": "To Status", + "type": "string" + } + }, + "required": [ + "sequence", + "from_status", + "to_status", + "actor", + "at", + "reason" + ], + "title": "HistoryEntry", + "type": "object" + }, + "ManagedResourceCapabilities": { + "additionalProperties": false, + "properties": { + "test_data": { + "enum": [ + "available", + "not_configured" + ], + "title": "Test Data", + "type": "string" + }, + "work_orders": { + "enum": [ + "available", + "not_configured" + ], + "title": "Work Orders", + "type": "string" + } + }, + "required": [ + "work_orders", + "test_data" + ], + "title": "ManagedResourceCapabilities", + "type": "object" + }, + "ObjectRef": { + "additionalProperties": false, + "properties": { + "object_id": { + "format": "uuid", + "title": "Object Id", + "type": "string" + }, + "object_type": { + "enum": [ + "analysis_task", + "goal", + "state_snapshot", + "action_contract", + "validation", + "run", + "outcome", + "evidence", + "artifact", + "operation" + ], + "title": "Object Type", + "type": "string" + }, + "revision": { + "minimum": 1.0, + "title": "Revision", + "type": "integer" + } + }, + "required": [ + "object_type", + "object_id", + "revision" + ], + "title": "ObjectRef", + "type": "object" + }, + "Observation": { + "additionalProperties": false, + "properties": { + "observed_at": { + "format": "date-time", + "title": "Observed At", + "type": "string" + }, + "point_id": { + "title": "Point Id", + "type": "string" + }, + "quality": { + "enum": [ + "valid", + "unknown", + "missing" + ], + "title": "Quality", + "type": "string" + }, + "record_id": { + "title": "Record Id", + "type": "string" + }, + "unit": { + "title": "Unit", + "type": "string" + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Value" + } + }, + "required": [ + "record_id", + "point_id", + "observed_at", + "value", + "quality", + "unit" + ], + "title": "Observation", + "type": "object" + }, + "Observations": { + "additionalProperties": false, + "properties": { + "items": { + "items": { + "$ref": "#/components/schemas/Observation" + }, + "title": "Items", + "type": "array" + }, + "origin": { + "enum": [ + "historical_replay", + "synthetic" + ], + "title": "Origin", + "type": "string" + }, + "source_id": { + "title": "Source Id", + "type": "string" + }, + "source_revision": { + "title": "Source Revision", + "type": "string" + }, + "truncated": { + "title": "Truncated", + "type": "boolean" + } + }, + "required": [ + "origin", + "source_id", + "source_revision", + "items", + "truncated" + ], + "title": "Observations", + "type": "object" + }, + "Point": { + "additionalProperties": false, + "properties": { + "label": { + "title": "Label", + "type": "string" + }, + "origin": { + "enum": [ + "historical_replay", + "synthetic" + ], + "title": "Origin", + "type": "string" + }, + "point_id": { + "title": "Point Id", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + }, + "unit": { + "title": "Unit", + "type": "string" + } + }, + "required": [ + "point_id", + "label", + "unit", + "status", + "origin" + ], + "title": "Point", + "type": "object" + }, + "PointPage": { + "additionalProperties": false, + "properties": { + "items": { + "items": { + "$ref": "#/components/schemas/Point" + }, + "title": "Items", + "type": "array" + }, + "next_cursor": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Next Cursor" + }, + "origin": { + "enum": [ + "historical_replay", + "synthetic" + ], + "title": "Origin", + "type": "string" + }, + "source_id": { + "title": "Source Id", + "type": "string" + } + }, + "required": [ + "items", + "source_id", + "origin", + "next_cursor" + ], + "title": "PointPage", + "type": "object" + }, + "Receipt": { + "additionalProperties": false, + "properties": { + "request_id": { + "format": "uuid", + "title": "Request Id", + "type": "string" + }, + "result": { + "anyOf": [ + { + "$ref": "#/components/schemas/Task" + }, + { + "$ref": "#/components/schemas/ScenarioState" + }, + { + "$ref": "#/components/schemas/WorkOrder" + }, + { + "$ref": "#/components/schemas/TestDataRecord" + }, + { + "$ref": "#/components/schemas/DeletedResource" + } + ], + "title": "Result" + }, + "task_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Task Id" + } + }, + "required": [ + "request_id", + "task_id", + "result" + ], + "title": "Receipt", + "type": "object" + }, + "SampleError": { + "additionalProperties": false, + "properties": { + "code": { + "title": "Code", + "type": "string" + }, + "effect": { + "enum": [ + "none", + "unknown" + ], + "title": "Effect", + "type": "string" + }, + "message": { + "title": "Message", + "type": "string" + }, + "request_id": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Request Id" + } + }, + "required": [ + "code", + "message", + "request_id", + "effect" + ], + "title": "SampleError", + "type": "object" + }, + "ScenarioCommand": { + "additionalProperties": false, + "properties": { + "request_id": { + "format": "uuid", + "title": "Request Id", + "type": "string" + }, + "scenario": { + "enum": [ + "normal", + "missing_data", + "unavailable", + "response_lost", + "duplicate_feedback", + "conflicting_feedback", + "late_state" + ], + "title": "Scenario", + "type": "string" + } + }, + "required": [ + "request_id", + "scenario" + ], + "title": "ScenarioCommand", + "type": "object" + }, + "ScenarioState": { + "additionalProperties": false, + "properties": { + "revision": { + "minimum": 1.0, + "title": "Revision", + "type": "integer" + }, + "scenario": { + "enum": [ + "normal", + "missing_data", + "unavailable", + "response_lost", + "duplicate_feedback", + "conflicting_feedback", + "late_state" + ], + "title": "Scenario", + "type": "string" + } + }, + "required": [ + "scenario", + "revision" + ], + "title": "ScenarioState", + "type": "object" + }, + "SourceLink": { + "additionalProperties": false, + "properties": { + "object_id": { + "format": "uuid", + "title": "Object Id", + "type": "string" + }, + "object_type": { + "enum": [ + "validation", + "artifact" + ], + "title": "Object Type", + "type": "string" + }, + "revision": { + "minimum": 1.0, + "title": "Revision", + "type": "integer" + }, + "system": { + "const": "next", + "title": "System", + "type": "string" + }, + "task_id": { + "format": "uuid", + "title": "Task Id", + "type": "string" + } + }, + "required": [ + "system", + "task_id", + "object_type", + "object_id", + "revision" + ], + "title": "SourceLink", + "type": "object" + }, + "Task": { + "additionalProperties": false, + "properties": { + "analysis_window": { + "$ref": "#/components/schemas/TimeRange" + }, + "asset_ids": { + "items": { + "type": "string" + }, + "title": "Asset Ids", + "type": "array" + }, + "created_at": { + "format": "date-time", + "title": "Created At", + "type": "string" + }, + "created_by": { + "title": "Created By", + "type": "string" + }, + "evidence_refs": { + "items": { + "$ref": "#/components/schemas/ObjectRef" + }, + "title": "Evidence Refs", + "type": "array" + }, + "feedback": { + "items": { + "$ref": "#/components/schemas/Feedback" + }, + "title": "Feedback", + "type": "array" + }, + "history": { + "items": { + "$ref": "#/components/schemas/HistoryEntry" + }, + "title": "History", + "type": "array" + }, + "origin": { + "const": "synthetic", + "title": "Origin", + "type": "string" + }, + "project_id": { + "format": "uuid", + "title": "Project Id", + "type": "string" + }, + "requested_check": { + "title": "Requested Check", + "type": "string" + }, + "revision": { + "minimum": 1.0, + "title": "Revision", + "type": "integer" + }, + "source": { + "$ref": "#/components/schemas/SourceLink" + }, + "status": { + "enum": [ + "pending", + "processing", + "pending_review", + "completed" + ], + "title": "Status", + "type": "string" + }, + "summary": { + "title": "Summary", + "type": "string" + }, + "task_id": { + "format": "uuid", + "title": "Task Id", + "type": "string" + }, + "title": { + "title": "Title", + "type": "string" + }, + "updated_at": { + "format": "date-time", + "title": "Updated At", + "type": "string" + } + }, + "required": [ + "task_id", + "project_id", + "revision", + "title", + "summary", + "source", + "asset_ids", + "analysis_window", + "evidence_refs", + "requested_check", + "status", + "origin", + "created_at", + "updated_at", + "created_by", + "history", + "feedback" + ], + "title": "Task", + "type": "object" + }, + "TestDataRecord": { + "additionalProperties": false, + "properties": { + "created_at": { + "format": "date-time", + "title": "Created At", + "type": "string" + }, + "created_by": { + "title": "Created By", + "type": "string" + }, + "label": { + "title": "Label", + "type": "string" + }, + "notes": { + "title": "Notes", + "type": "string" + }, + "observed_at": { + "format": "date-time", + "title": "Observed At", + "type": "string" + }, + "origin": { + "const": "synthetic", + "title": "Origin", + "type": "string" + }, + "point_id": { + "title": "Point Id", + "type": "string" + }, + "project_id": { + "format": "uuid", + "title": "Project Id", + "type": "string" + }, + "quality": { + "enum": [ + "valid", + "unknown", + "missing" + ], + "title": "Quality", + "type": "string" + }, + "record_id": { + "format": "uuid", + "title": "Record Id", + "type": "string" + }, + "revision": { + "minimum": 1.0, + "title": "Revision", + "type": "integer" + }, + "unit": { + "title": "Unit", + "type": "string" + }, + "updated_at": { + "format": "date-time", + "title": "Updated At", + "type": "string" + }, + "updated_by": { + "title": "Updated By", + "type": "string" + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Value" + } + }, + "required": [ + "record_id", + "project_id", + "revision", + "label", + "point_id", + "observed_at", + "value", + "unit", + "quality", + "notes", + "origin", + "created_at", + "updated_at", + "created_by", + "updated_by" + ], + "title": "TestDataRecord", + "type": "object" + }, + "TestDataRecordPage": { + "additionalProperties": false, + "properties": { + "items": { + "items": { + "$ref": "#/components/schemas/TestDataRecord" + }, + "title": "Items", + "type": "array" + }, + "next_cursor": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Next Cursor" + } + }, + "required": [ + "items", + "next_cursor" + ], + "title": "TestDataRecordPage", + "type": "object" + }, + "TimeRange": { + "additionalProperties": false, + "properties": { + "end": { + "format": "date-time", + "title": "End", + "type": "string" + }, + "start": { + "format": "date-time", + "title": "Start", + "type": "string" + } + }, + "required": [ + "start", + "end" + ], + "title": "TimeRange", + "type": "object" + }, + "UpdateTestDataRecord": { + "additionalProperties": false, + "properties": { + "clear_value": { + "default": false, + "title": "Clear Value", + "type": "boolean" + }, + "expected_revision": { + "minimum": 1.0, + "title": "Expected Revision", + "type": "integer" + }, + "label": { + "anyOf": [ + { + "maxLength": 200, + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Label" + }, + "notes": { + "anyOf": [ + { + "maxLength": 4000, + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Notes" + }, + "observed_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Observed At" + }, + "point_id": { + "anyOf": [ + { + "maxLength": 128, + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Point Id" + }, + "quality": { + "anyOf": [ + { + "enum": [ + "valid", + "unknown", + "missing" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Quality" + }, + "request_id": { + "format": "uuid", + "title": "Request Id", + "type": "string" + }, + "unit": { + "anyOf": [ + { + "maxLength": 32, + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Unit" + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Value" + } + }, + "required": [ + "request_id", + "expected_revision" + ], + "title": "UpdateTestDataRecord", + "type": "object" + }, + "UpdateWorkOrder": { + "additionalProperties": false, + "properties": { + "assignee": { + "anyOf": [ + { + "maxLength": 200, + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Assignee" + }, + "clear_assignee": { + "default": false, + "title": "Clear Assignee", + "type": "boolean" + }, + "clear_scheduled_at": { + "default": false, + "title": "Clear Scheduled At", + "type": "boolean" + }, + "expected_revision": { + "minimum": 1.0, + "title": "Expected Revision", + "type": "integer" + }, + "priority": { + "anyOf": [ + { + "enum": [ + "low", + "normal", + "high", + "urgent" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Priority" + }, + "request_id": { + "format": "uuid", + "title": "Request Id", + "type": "string" + }, + "scheduled_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Scheduled At" + }, + "status": { + "anyOf": [ + { + "enum": [ + "draft", + "open", + "in_progress", + "completed", + "cancelled" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Status" + }, + "summary": { + "anyOf": [ + { + "maxLength": 4000, + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Summary" + }, + "title": { + "anyOf": [ + { + "maxLength": 200, + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Title" + } + }, + "required": [ + "request_id", + "expected_revision" + ], + "title": "UpdateWorkOrder", + "type": "object" + }, + "WorkOrder": { + "additionalProperties": false, + "properties": { + "assignee": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Assignee" + }, + "created_at": { + "format": "date-time", + "title": "Created At", + "type": "string" + }, + "created_by": { + "title": "Created By", + "type": "string" + }, + "origin": { + "const": "synthetic", + "title": "Origin", + "type": "string" + }, + "priority": { + "enum": [ + "low", + "normal", + "high", + "urgent" + ], + "title": "Priority", + "type": "string" + }, + "project_id": { + "format": "uuid", + "title": "Project Id", + "type": "string" + }, + "revision": { + "minimum": 1.0, + "title": "Revision", + "type": "integer" + }, + "scheduled_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Scheduled At" + }, + "status": { + "enum": [ + "draft", + "open", + "in_progress", + "completed", + "cancelled" + ], + "title": "Status", + "type": "string" + }, + "summary": { + "title": "Summary", + "type": "string" + }, + "title": { + "title": "Title", + "type": "string" + }, + "updated_at": { + "format": "date-time", + "title": "Updated At", + "type": "string" + }, + "updated_by": { + "title": "Updated By", + "type": "string" + }, + "work_order_id": { + "format": "uuid", + "title": "Work Order Id", + "type": "string" + } + }, + "required": [ + "work_order_id", + "project_id", + "revision", + "title", + "summary", + "status", + "priority", + "assignee", + "scheduled_at", + "origin", + "created_at", + "updated_at", + "created_by", + "updated_by" + ], + "title": "WorkOrder", + "type": "object" + }, + "WorkOrderPage": { + "additionalProperties": false, + "properties": { + "items": { + "items": { + "$ref": "#/components/schemas/WorkOrder" + }, + "title": "Items", + "type": "array" + }, + "next_cursor": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Next Cursor" + } + }, + "required": [ + "items", + "next_cursor" + ], + "title": "WorkOrderPage", + "type": "object" + } + } + }, + "info": { + "description": "测试监测与核查反馈样板,不是正式工单平台或设备控制服务。", + "title": "TJWater 外围系统模拟接入", + "version": "1.0.0" + }, + "openapi": "3.1.0", + "paths": { + "/api/sample/v1/context": { + "get": { + "operationId": "context_api_sample_v1_context_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Context" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unprocessable Entity" + }, + "502": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Bad Gateway" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Service Unavailable" + } + }, + "summary": "Context" + } + }, + "/api/sample/v1/demo-data": { + "get": { + "operationId": "demo_data_api_sample_v1_demo_data_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DemoDataset" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unprocessable Entity" + }, + "502": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Bad Gateway" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Service Unavailable" + } + }, + "summary": "Demo Data" + } + }, + "/api/sample/v1/monitoring/alerts": { + "get": { + "operationId": "alerts_api_sample_v1_monitoring_alerts_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AlertPage" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unprocessable Entity" + }, + "502": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Bad Gateway" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Service Unavailable" + } + }, + "summary": "Alerts" + } + }, + "/api/sample/v1/monitoring/observations": { + "get": { + "operationId": "observations_api_sample_v1_monitoring_observations_get", + "parameters": [ + { + "in": "query", + "name": "point_id", + "required": true, + "schema": { + "title": "Point Id", + "type": "string" + } + }, + { + "in": "query", + "name": "start", + "required": true, + "schema": { + "title": "Start", + "type": "string" + } + }, + { + "in": "query", + "name": "end", + "required": true, + "schema": { + "title": "End", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Observations" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unprocessable Entity" + }, + "502": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Bad Gateway" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Service Unavailable" + } + }, + "summary": "Observations" + } + }, + "/api/sample/v1/monitoring/points": { + "get": { + "operationId": "points_api_sample_v1_monitoring_points_get", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 500, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "cursor", + "required": false, + "schema": { + "anyOf": [ + { + "maxLength": 128, + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Cursor" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PointPage" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unprocessable Entity" + }, + "502": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Bad Gateway" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Service Unavailable" + } + }, + "summary": "Points" + } + }, + "/api/sample/v1/requests/{request_id}": { + "get": { + "operationId": "receipt_api_sample_v1_requests__request_id__get", + "parameters": [ + { + "in": "path", + "name": "request_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Request Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Receipt" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unprocessable Entity" + }, + "502": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Bad Gateway" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Service Unavailable" + } + }, + "summary": "Receipt" + } + }, + "/api/sample/v1/scenario": { + "get": { + "operationId": "scenario_api_sample_v1_scenario_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScenarioState" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unprocessable Entity" + }, + "502": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Bad Gateway" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Service Unavailable" + } + }, + "summary": "Scenario" + }, + "post": { + "operationId": "configure_scenario_api_sample_v1_scenario_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScenarioCommand" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScenarioState" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unprocessable Entity" + }, + "502": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Bad Gateway" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Service Unavailable" + } + }, + "summary": "Configure Scenario" + } + }, + "/api/sample/v1/test-data": { + "get": { + "operationId": "test_data_api_sample_v1_test_data_get", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 20, + "maximum": 100, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "cursor", + "required": false, + "schema": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Cursor" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestDataRecordPage" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unprocessable Entity" + }, + "502": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Bad Gateway" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Service Unavailable" + } + }, + "summary": "Test Data" + }, + "post": { + "operationId": "create_test_data_api_sample_v1_test_data_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTestDataRecord" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestDataRecord" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unprocessable Entity" + }, + "502": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Bad Gateway" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Service Unavailable" + } + }, + "summary": "Create Test Data" + } + }, + "/api/sample/v1/test-data/{record_id}": { + "delete": { + "operationId": "delete_test_data_api_sample_v1_test_data__record_id__delete", + "parameters": [ + { + "in": "path", + "name": "record_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Record Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteResource" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeletedResource" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unprocessable Entity" + }, + "502": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Bad Gateway" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Service Unavailable" + } + }, + "summary": "Delete Test Data" + }, + "get": { + "operationId": "test_data_record_api_sample_v1_test_data__record_id__get", + "parameters": [ + { + "in": "path", + "name": "record_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Record Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestDataRecord" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unprocessable Entity" + }, + "502": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Bad Gateway" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Service Unavailable" + } + }, + "summary": "Test Data Record" + }, + "patch": { + "operationId": "update_test_data_api_sample_v1_test_data__record_id__patch", + "parameters": [ + { + "in": "path", + "name": "record_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Record Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateTestDataRecord" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestDataRecord" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unprocessable Entity" + }, + "502": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Bad Gateway" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Service Unavailable" + } + }, + "summary": "Update Test Data" + } + }, + "/api/sample/v1/work-orders": { + "get": { + "operationId": "work_orders_api_sample_v1_work_orders_get", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 20, + "maximum": 100, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "cursor", + "required": false, + "schema": { + "anyOf": [ + { + "format": "uuid", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Cursor" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WorkOrderPage" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unprocessable Entity" + }, + "502": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Bad Gateway" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Service Unavailable" + } + }, + "summary": "Work Orders" + }, + "post": { + "operationId": "create_work_order_api_sample_v1_work_orders_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateWorkOrder" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WorkOrder" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unprocessable Entity" + }, + "502": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Bad Gateway" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Service Unavailable" + } + }, + "summary": "Create Work Order" + } + }, + "/api/sample/v1/work-orders/{work_order_id}": { + "delete": { + "operationId": "delete_work_order_api_sample_v1_work_orders__work_order_id__delete", + "parameters": [ + { + "in": "path", + "name": "work_order_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Work Order Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteResource" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeletedResource" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unprocessable Entity" + }, + "502": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Bad Gateway" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Service Unavailable" + } + }, + "summary": "Delete Work Order" + }, + "get": { + "operationId": "work_order_api_sample_v1_work_orders__work_order_id__get", + "parameters": [ + { + "in": "path", + "name": "work_order_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Work Order Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WorkOrder" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unprocessable Entity" + }, + "502": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Bad Gateway" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Service Unavailable" + } + }, + "summary": "Work Order" + }, + "patch": { + "operationId": "update_work_order_api_sample_v1_work_orders__work_order_id__patch", + "parameters": [ + { + "in": "path", + "name": "work_order_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Work Order Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateWorkOrder" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WorkOrder" + } + } + }, + "description": "Successful Response" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Unprocessable Entity" + }, + "502": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Bad Gateway" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SampleError" + } + } + }, + "description": "Service Unavailable" + } + }, + "summary": "Update Work Order" + } + }, + "/health": { + "get": { + "operationId": "health_health_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "summary": "Health" + } + } + } +} diff --git a/contracts/server-v1.openapi.json b/contracts/server-v1.openapi.json index 5b68dce..63c08ed 100644 --- a/contracts/server-v1.openapi.json +++ b/contracts/server-v1.openapi.json @@ -982,6 +982,41 @@ "title": "BurstLocationRequestRest", "type": "object" }, + "ElementGisProperties": { + "additionalProperties": false, + "properties": { + "element_id": { + "title": "Element Id", + "type": "string" + }, + "element_type": { + "enum": [ + "pipes", + "junctions", + "valves", + "reservoirs", + "pumps", + "tanks", + "scada" + ], + "title": "Element Type", + "type": "string" + }, + "groups": { + "items": { + "$ref": "#/components/schemas/GisAttributeGroup" + }, + "title": "Groups", + "type": "array" + } + }, + "required": [ + "element_type", + "element_id" + ], + "title": "ElementGisProperties", + "type": "object" + }, "ElementHistoryQuery": { "properties": { "elements": { @@ -1139,6 +1174,70 @@ "title": "ElementHistoryTarget", "type": "object" }, + "GisAttributeGroup": { + "additionalProperties": false, + "properties": { + "attributes": { + "title": "Attributes", + "type": "object" + }, + "dataset_key": { + "title": "Dataset Key", + "type": "string" + }, + "dataset_title": { + "title": "Dataset Title", + "type": "string" + }, + "layer_key": { + "title": "Layer Key", + "type": "string" + }, + "layer_name": { + "title": "Layer Name", + "type": "string" + }, + "match_distance_m": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Match Distance M" + }, + "match_method": { + "enum": [ + "node_pair", + "geometry" + ], + "title": "Match Method", + "type": "string" + }, + "source_date": { + "format": "date", + "title": "Source Date", + "type": "string" + }, + "source_fid": { + "title": "Source Fid", + "type": "integer" + } + }, + "required": [ + "dataset_key", + "dataset_title", + "source_date", + "layer_key", + "layer_name", + "source_fid", + "match_method" + ], + "title": "GisAttributeGroup", + "type": "object" + }, "HistoryElementType": { "enum": [ "pipe", @@ -2983,6 +3082,168 @@ "title": "SessionAuditEventRequest", "type": "object" }, + "TaskAlertCommand": { + "additionalProperties": false, + "properties": { + "alert_id": { + "minLength": 1, + "title": "Alert Id", + "type": "string" + }, + "condition_id": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Condition Id" + }, + "description": { + "minLength": 1, + "title": "Description", + "type": "string" + }, + "event_id": { + "format": "uuid", + "title": "Event Id", + "type": "string" + }, + "event_type": { + "enum": [ + "raised", + "acknowledged", + "resolved" + ], + "title": "Event Type", + "type": "string" + }, + "occurred_at": { + "format": "date-time", + "title": "Occurred At", + "type": "string" + }, + "severity": { + "enum": [ + "warning", + "critical" + ], + "title": "Severity", + "type": "string" + }, + "source": { + "$ref": "#/components/schemas/WorkbenchAlertSource" + }, + "title": { + "minLength": 1, + "title": "Title", + "type": "string" + } + }, + "required": [ + "event_id", + "alert_id", + "event_type", + "occurred_at", + "condition_id", + "source", + "title", + "description", + "severity" + ], + "title": "TaskAlertCommand", + "type": "object" + }, + "TaskAlertState": { + "additionalProperties": false, + "properties": { + "alert_id": { + "minLength": 1, + "title": "Alert Id", + "type": "string" + }, + "condition_id": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Condition Id" + }, + "description": { + "minLength": 1, + "title": "Description", + "type": "string" + }, + "occurred_at": { + "format": "date-time", + "title": "Occurred At", + "type": "string" + }, + "producer_id": { + "minLength": 1, + "title": "Producer Id", + "type": "string" + }, + "revision": { + "minimum": 1.0, + "title": "Revision", + "type": "integer" + }, + "severity": { + "enum": [ + "warning", + "critical" + ], + "title": "Severity", + "type": "string" + }, + "source": { + "$ref": "#/components/schemas/WorkbenchAlertSource" + }, + "status": { + "enum": [ + "active", + "acknowledged", + "resolved" + ], + "title": "Status", + "type": "string" + }, + "title": { + "minLength": 1, + "title": "Title", + "type": "string" + }, + "updated_at": { + "format": "date-time", + "title": "Updated At", + "type": "string" + } + }, + "required": [ + "alert_id", + "revision", + "producer_id", + "condition_id", + "source", + "title", + "description", + "occurred_at", + "severity", + "status", + "updated_at" + ], + "title": "TaskAlertState", + "type": "object" + }, "TiandituGeocodeRequest": { "properties": { "keyword": { @@ -3076,6 +3337,906 @@ ], "title": "WebSearchRequest", "type": "object" + }, + "WorkbenchAlertSource": { + "additionalProperties": false, + "properties": { + "run_id": { + "minLength": 1, + "title": "Run Id", + "type": "string" + }, + "task_id": { + "minLength": 1, + "title": "Task Id", + "type": "string" + }, + "task_type": { + "enum": [ + "scheduled_task", + "analysis_task", + "other_task" + ], + "title": "Task Type", + "type": "string" + } + }, + "required": [ + "task_type", + "task_id", + "run_id" + ], + "title": "WorkbenchAlertSource", + "type": "object" + }, + "WorkbenchAnalysisHistoryItem": { + "additionalProperties": false, + "properties": { + "created_at": { + "format": "date-time", + "title": "Created At", + "type": "string" + }, + "created_by": { + "minLength": 1, + "title": "Created By", + "type": "string" + }, + "has_results": { + "title": "Has Results", + "type": "boolean" + }, + "name": { + "minLength": 1, + "title": "Name", + "type": "string" + }, + "run_id": { + "minLength": 1, + "title": "Run Id", + "type": "string" + }, + "run_type": { + "minLength": 1, + "title": "Run Type", + "type": "string" + }, + "run_type_label": { + "minLength": 1, + "title": "Run Type Label", + "type": "string" + }, + "started_at": { + "format": "date-time", + "title": "Started At", + "type": "string" + }, + "status": { + "minLength": 1, + "title": "Status", + "type": "string" + }, + "status_label": { + "minLength": 1, + "title": "Status Label", + "type": "string" + } + }, + "required": [ + "run_id", + "name", + "run_type", + "run_type_label", + "status", + "status_label", + "created_by", + "created_at", + "started_at", + "has_results" + ], + "title": "WorkbenchAnalysisHistoryItem", + "type": "object" + }, + "WorkbenchAnalysisHistoryPage": { + "additionalProperties": false, + "properties": { + "items": { + "items": { + "$ref": "#/components/schemas/WorkbenchAnalysisHistoryItem" + }, + "title": "Items", + "type": "array" + }, + "limit": { + "minimum": 1.0, + "title": "Limit", + "type": "integer" + }, + "next_offset": { + "anyOf": [ + { + "minimum": 0.0, + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Next Offset" + }, + "offset": { + "minimum": 0.0, + "title": "Offset", + "type": "integer" + } + }, + "required": [ + "items", + "limit", + "offset", + "next_offset" + ], + "title": "WorkbenchAnalysisHistoryPage", + "type": "object" + }, + "WorkbenchRuntimeAlert": { + "additionalProperties": false, + "properties": { + "condition_id": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Condition Id" + }, + "description": { + "minLength": 1, + "title": "Description", + "type": "string" + }, + "id": { + "minLength": 1, + "title": "Id", + "type": "string" + }, + "occurred_at": { + "format": "date-time", + "title": "Occurred At", + "type": "string" + }, + "severity": { + "enum": [ + "warning", + "critical" + ], + "title": "Severity", + "type": "string" + }, + "source": { + "$ref": "#/components/schemas/WorkbenchAlertSource" + }, + "title": { + "minLength": 1, + "title": "Title", + "type": "string" + } + }, + "required": [ + "id", + "condition_id", + "source", + "title", + "description", + "occurred_at", + "severity" + ], + "title": "WorkbenchRuntimeAlert", + "type": "object" + }, + "WorkbenchRuntimeAnalysisFact": { + "additionalProperties": false, + "properties": { + "label": { + "minLength": 1, + "title": "Label", + "type": "string" + }, + "value": { + "minLength": 1, + "title": "Value", + "type": "string" + } + }, + "required": [ + "label", + "value" + ], + "title": "WorkbenchRuntimeAnalysisFact", + "type": "object" + }, + "WorkbenchRuntimeAnalysisResult": { + "additionalProperties": false, + "properties": { + "created_at": { + "format": "date-time", + "title": "Created At", + "type": "string" + }, + "facts": { + "items": { + "$ref": "#/components/schemas/WorkbenchRuntimeAnalysisFact" + }, + "title": "Facts", + "type": "array" + }, + "result_type": { + "minLength": 1, + "title": "Result Type", + "type": "string" + } + }, + "required": [ + "result_type", + "created_at", + "facts" + ], + "title": "WorkbenchRuntimeAnalysisResult", + "type": "object" + }, + "WorkbenchRuntimeCondition": { + "additionalProperties": false, + "properties": { + "detail": { + "minLength": 1, + "title": "Detail", + "type": "string" + }, + "evidence": { + "items": { + "minLength": 1, + "type": "string" + }, + "title": "Evidence", + "type": "array" + }, + "id": { + "minLength": 1, + "title": "Id", + "type": "string" + }, + "model_name": { + "const": "TJWater scheduler", + "title": "Model Name", + "type": "string" + }, + "recommendation": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Recommendation" + }, + "risk_level": { + "enum": [ + "normal", + "attention", + "critical" + ], + "title": "Risk Level", + "type": "string" + }, + "scheduled_at": { + "format": "date-time", + "title": "Scheduled At", + "type": "string" + }, + "session_id": { + "minLength": 1, + "title": "Session Id", + "type": "string" + }, + "status": { + "enum": [ + "pending", + "running", + "completed", + "warning", + "error" + ], + "title": "Status", + "type": "string" + }, + "summary": { + "minLength": 1, + "title": "Summary", + "type": "string" + }, + "task_id": { + "const": "backend-schedule", + "title": "Task Id", + "type": "string" + }, + "title": { + "minLength": 1, + "title": "Title", + "type": "string" + }, + "updated_at": { + "format": "date-time", + "title": "Updated At", + "type": "string" + } + }, + "required": [ + "id", + "task_id", + "session_id", + "title", + "summary", + "status", + "risk_level", + "scheduled_at", + "updated_at", + "detail", + "recommendation", + "evidence", + "model_name" + ], + "title": "WorkbenchRuntimeCondition", + "type": "object" + }, + "WorkbenchRuntimeLatestAnalysis": { + "additionalProperties": false, + "properties": { + "created_at": { + "format": "date-time", + "title": "Created At", + "type": "string" + }, + "created_by": { + "minLength": 1, + "title": "Created By", + "type": "string" + }, + "map_payload": { + "anyOf": [ + { + "additionalProperties": { + "$ref": "#/components/schemas/JsonValue" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Map Payload" + }, + "name": { + "minLength": 1, + "title": "Name", + "type": "string" + }, + "results": { + "items": { + "$ref": "#/components/schemas/WorkbenchRuntimeAnalysisResult" + }, + "title": "Results", + "type": "array" + }, + "run_id": { + "minLength": 1, + "title": "Run Id", + "type": "string" + }, + "run_type": { + "minLength": 1, + "title": "Run Type", + "type": "string" + }, + "run_type_label": { + "minLength": 1, + "title": "Run Type Label", + "type": "string" + }, + "started_at": { + "format": "date-time", + "title": "Started At", + "type": "string" + }, + "status": { + "minLength": 1, + "title": "Status", + "type": "string" + }, + "status_label": { + "minLength": 1, + "title": "Status Label", + "type": "string" + } + }, + "required": [ + "run_id", + "name", + "run_type", + "run_type_label", + "status", + "status_label", + "created_by", + "created_at", + "started_at", + "results", + "map_payload" + ], + "title": "WorkbenchRuntimeLatestAnalysis", + "type": "object" + }, + "WorkbenchRuntimeScenario": { + "additionalProperties": false, + "properties": { + "created_at": { + "format": "date-time", + "title": "Created At", + "type": "string" + }, + "description": { + "minLength": 1, + "title": "Description", + "type": "string" + }, + "id": { + "minLength": 1, + "title": "Id", + "type": "string" + }, + "name": { + "minLength": 1, + "title": "Name", + "type": "string" + }, + "run_id": { + "minLength": 1, + "title": "Run Id", + "type": "string" + }, + "run_status": { + "minLength": 1, + "title": "Run Status", + "type": "string" + }, + "run_type": { + "minLength": 1, + "title": "Run Type", + "type": "string" + }, + "run_type_label": { + "minLength": 1, + "title": "Run Type Label", + "type": "string" + }, + "status": { + "enum": [ + "draft", + "active", + "review" + ], + "title": "Status", + "type": "string" + } + }, + "required": [ + "id", + "run_id", + "name", + "description", + "status", + "run_type", + "run_type_label", + "run_status", + "created_at" + ], + "title": "WorkbenchRuntimeScenario", + "type": "object" + }, + "WorkbenchRuntimeSnapshot": { + "additionalProperties": false, + "properties": { + "alert_availability": { + "enum": [ + "ready", + "not_configured", + "degraded" + ], + "title": "Alert Availability", + "type": "string" + }, + "alerts": { + "items": { + "$ref": "#/components/schemas/WorkbenchRuntimeAlert" + }, + "title": "Alerts", + "type": "array" + }, + "artifact_availability": { + "enum": [ + "ready", + "not_configured", + "degraded" + ], + "title": "Artifact Availability", + "type": "string" + }, + "availability": { + "enum": [ + "ready", + "not_configured", + "degraded" + ], + "title": "Availability", + "type": "string" + }, + "conditions": { + "items": { + "$ref": "#/components/schemas/WorkbenchRuntimeCondition" + }, + "title": "Conditions", + "type": "array" + }, + "generated_at": { + "format": "date-time", + "title": "Generated At", + "type": "string" + }, + "latest_analysis": { + "anyOf": [ + { + "$ref": "#/components/schemas/WorkbenchRuntimeLatestAnalysis" + }, + { + "type": "null" + } + ] + }, + "scenario_availability": { + "enum": [ + "ready", + "not_configured", + "degraded" + ], + "title": "Scenario Availability", + "type": "string" + }, + "scenarios": { + "items": { + "$ref": "#/components/schemas/WorkbenchRuntimeScenario" + }, + "title": "Scenarios", + "type": "array" + }, + "schedule_availability": { + "enum": [ + "ready", + "not_configured", + "degraded" + ], + "title": "Schedule Availability", + "type": "string" + }, + "source": { + "enum": [ + "none", + "scheduled_tasks" + ], + "title": "Source", + "type": "string" + }, + "work_order_availability": { + "enum": [ + "ready", + "not_configured", + "degraded" + ], + "title": "Work Order Availability", + "type": "string" + }, + "work_orders": { + "items": { + "$ref": "#/components/schemas/WorkbenchRuntimeWorkOrder" + }, + "title": "Work Orders", + "type": "array" + } + }, + "required": [ + "availability", + "source", + "scenario_availability", + "artifact_availability", + "schedule_availability", + "work_order_availability", + "alert_availability", + "generated_at", + "conditions", + "alerts", + "scenarios", + "latest_analysis", + "work_orders" + ], + "title": "WorkbenchRuntimeSnapshot", + "type": "object" + }, + "WorkbenchRuntimeWorkOrder": { + "additionalProperties": false, + "properties": { + "code": { + "minLength": 1, + "title": "Code", + "type": "string" + }, + "detail": { + "minLength": 1, + "title": "Detail", + "type": "string" + }, + "dispatcher": { + "minLength": 1, + "title": "Dispatcher", + "type": "string" + }, + "duration_minutes": { + "minimum": 1.0, + "title": "Duration Minutes", + "type": "integer" + }, + "id": { + "minLength": 1, + "title": "Id", + "type": "string" + }, + "priority": { + "enum": [ + "normal", + "urgent" + ], + "title": "Priority", + "type": "string" + }, + "recommendation": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Recommendation" + }, + "risk_level": { + "enum": [ + "normal", + "attention", + "critical" + ], + "title": "Risk Level", + "type": "string" + }, + "scheduled_at": { + "format": "date-time", + "title": "Scheduled At", + "type": "string" + }, + "source": { + "minLength": 1, + "title": "Source", + "type": "string" + }, + "status": { + "enum": [ + "pending", + "running", + "awaiting_reply", + "completed" + ], + "title": "Status", + "type": "string" + }, + "subtasks": { + "items": { + "$ref": "#/components/schemas/WorkbenchRuntimeWorkOrderSubtask" + }, + "title": "Subtasks", + "type": "array" + }, + "summary": { + "minLength": 1, + "title": "Summary", + "type": "string" + }, + "title": { + "minLength": 1, + "title": "Title", + "type": "string" + }, + "updated_at": { + "format": "date-time", + "title": "Updated At", + "type": "string" + } + }, + "required": [ + "id", + "code", + "scheduled_at", + "title", + "summary", + "status", + "risk_level", + "updated_at", + "detail", + "recommendation", + "duration_minutes", + "source", + "dispatcher", + "priority", + "subtasks" + ], + "title": "WorkbenchRuntimeWorkOrder", + "type": "object" + }, + "WorkbenchRuntimeWorkOrderStage": { + "additionalProperties": false, + "properties": { + "description": { + "minLength": 1, + "title": "Description", + "type": "string" + }, + "id": { + "minLength": 1, + "title": "Id", + "type": "string" + }, + "owner": { + "minLength": 1, + "title": "Owner", + "type": "string" + }, + "sequence": { + "minimum": 1.0, + "title": "Sequence", + "type": "integer" + }, + "status": { + "enum": [ + "done", + "current", + "pending", + "blocked", + "skipped" + ], + "title": "Status", + "type": "string" + }, + "time_label": { + "minLength": 1, + "title": "Time Label", + "type": "string" + }, + "title": { + "minLength": 1, + "title": "Title", + "type": "string" + } + }, + "required": [ + "id", + "sequence", + "title", + "status", + "owner", + "time_label", + "description" + ], + "title": "WorkbenchRuntimeWorkOrderStage", + "type": "object" + }, + "WorkbenchRuntimeWorkOrderSubtask": { + "additionalProperties": false, + "properties": { + "assignee": { + "minLength": 1, + "title": "Assignee", + "type": "string" + }, + "duration_minutes": { + "minimum": 1.0, + "title": "Duration Minutes", + "type": "integer" + }, + "id": { + "minLength": 1, + "title": "Id", + "type": "string" + }, + "location": { + "minLength": 1, + "title": "Location", + "type": "string" + }, + "reply_requirements": { + "items": { + "minLength": 1, + "type": "string" + }, + "title": "Reply Requirements", + "type": "array" + }, + "reply_window_minutes": { + "minimum": 1.0, + "title": "Reply Window Minutes", + "type": "integer" + }, + "scheduled_at": { + "format": "date-time", + "title": "Scheduled At", + "type": "string" + }, + "stages": { + "items": { + "$ref": "#/components/schemas/WorkbenchRuntimeWorkOrderStage" + }, + "title": "Stages", + "type": "array" + }, + "status": { + "enum": [ + "pending", + "running", + "blocked", + "completed", + "cancelled" + ], + "title": "Status", + "type": "string" + }, + "summary": { + "minLength": 1, + "title": "Summary", + "type": "string" + }, + "title": { + "minLength": 1, + "title": "Title", + "type": "string" + } + }, + "required": [ + "id", + "title", + "summary", + "status", + "scheduled_at", + "location", + "assignee", + "duration_minutes", + "reply_window_minutes", + "stages", + "reply_requirements" + ], + "title": "WorkbenchRuntimeWorkOrderSubtask", + "type": "object" } }, "securitySchemes": { @@ -5689,9 +6850,32 @@ }, "/api/v1/analysis/runs": { "get": { - "description": "获取所有方案信息\n\n返回项目中所有方案的详细信息", + "description": "分页返回当前项目的持久分析运行。", "operationId": "get_analysis_runs", "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 100, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, { "in": "header", "name": "X-Project-Id", @@ -5787,7 +6971,7 @@ }, "/api/v1/analysis/runs/{run_id}": { "get": { - "description": "获取所有爆管定位结果\n\n返回项目中所有的爆管定位分析结果", + "description": "返回当前项目的一条持久分析运行。", "operationId": "get_analysis_runs_run_id", "parameters": [ { @@ -5895,7 +7079,7 @@ }, "/api/v1/analysis/runs/{run_id}/results": { "get": { - "description": "根据爆管事件ID查询爆管定位结果\n\n参数:\n burst_incident: 爆管事件的唯一标识符", + "description": "分页返回一条分析运行的持久结果。", "operationId": "get_analysis_runs_run_id_results", "parameters": [ { @@ -5926,6 +7110,29 @@ "title": "Result Type" } }, + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 100, + "maximum": 500, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "title": "Offset", + "type": "integer" + } + }, { "in": "header", "name": "X-Project-Id", @@ -9373,6 +10580,131 @@ ] } }, + "/api/v1/elements/{element_type}/{element_id}/gis-properties": { + "get": { + "description": "Return source GIS records linked to one current-project map element.", + "operationId": "get_elements_element_type_element_id_gis_properties", + "parameters": [ + { + "in": "path", + "name": "element_type", + "required": true, + "schema": { + "enum": [ + "pipes", + "junctions", + "valves", + "reservoirs", + "pumps", + "tanks", + "scada" + ], + "title": "Element Type", + "type": "string" + } + }, + { + "in": "path", + "name": "element_id", + "required": true, + "schema": { + "title": "Element Id", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ElementGisProperties" + } + } + }, + "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": "获取元素 GIS 台账属性", + "tags": [ + "Project Data" + ] + } + }, "/api/v1/emitters/properties": { "get": { "description": "获取指定连接点的发射器属性信息", @@ -38745,6 +40077,439 @@ "Web Search" ] } + }, + "/api/v1/workbench/analysis-runs": { + "get": { + "description": "Return a bounded, sanitized analysis history page for the workbench.", + "operationId": "get_workbench_analysis_runs", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 20, + "maximum": 100, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "required": false, + "schema": { + "default": 0, + "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/WorkbenchAnalysisHistoryPage" + } + } + }, + "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": "Workbench Analysis Runs", + "tags": [ + "Workbench Runtime" + ] + } + }, + "/api/v1/workbench/analysis-runs/{run_id}": { + "get": { + "description": "Return one authorized project's analysis run as a typed workbench artifact.", + "operationId": "get_workbench_analysis_runs_run_id", + "parameters": [ + { + "in": "path", + "name": "run_id", + "required": true, + "schema": { + "format": "uuid", + "title": "Run Id", + "type": "string" + } + }, + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WorkbenchRuntimeLatestAnalysis" + } + } + }, + "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": "Workbench Analysis Run", + "tags": [ + "Workbench Runtime" + ] + } + }, + "/api/v1/workbench/runtime": { + "get": { + "operationId": "get_workbench_runtime", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WorkbenchRuntimeSnapshot" + } + } + }, + "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": "Workbench Runtime", + "tags": [ + "Workbench Runtime" + ] + } + }, + "/api/v1/workbench/task-alert-events": { + "post": { + "operationId": "post_workbench_task_alert_events", + "parameters": [ + { + "in": "header", + "name": "X-Project-Id", + "required": true, + "schema": { + "title": "X-Project-Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TaskAlertCommand" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TaskAlertState" + } + } + }, + "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": "Push Task Alert Event", + "tags": [ + "Workbench Runtime" + ] + } } } }