feat(workbench): integrate operational workflows and map state

This commit is contained in:
2026-09-24 04:34:46 +08:00
parent 1752b9ef84
commit 436d5500f1
76 changed files with 5081 additions and 1937 deletions
+95 -593
View File
@@ -124,75 +124,6 @@ export interface paths {
patch?: never;
trace?: never;
};
"/api/sample/v1/tasks": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/** Tasks */
get: operations["tasks_api_sample_v1_tasks_get"];
put?: never;
/** Submit */
post: operations["submit_api_sample_v1_tasks_post"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/sample/v1/tasks/{task_id}": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/** Task */
get: operations["task_api_sample_v1_tasks__task_id__get"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/sample/v1/tasks/{task_id}/feedback": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/** Feedback */
post: operations["feedback_api_sample_v1_tasks__task_id__feedback_post"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/sample/v1/tasks/{task_id}/transitions": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/** Transition */
post: operations["transition_api_sample_v1_tasks__task_id__transitions_post"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/sample/v1/test-data": {
parameters: {
query?: never;
@@ -288,38 +219,6 @@ export interface paths {
export type webhooks = Record<string, never>;
export interface components {
schemas: {
/** AddFeedback */
AddFeedback: {
applicable_time: components["schemas"]["TimeRange"];
/** Asset Ids */
asset_ids: string[];
/** Attachment Refs */
attachment_refs: string[];
/** Expected Revision */
expected_revision: number;
/**
* Feedback Id
* Format: uuid
*/
feedback_id: string;
/**
* Finding
* @enum {string}
*/
finding: "instrument_fault" | "no_instrument_fault" | "uncertain";
/** Notes */
notes: string;
/**
* Occurred At
* Format: date-time
*/
occurred_at: string;
/**
* Request Id
* Format: uuid
*/
request_id: string;
};
/** Alert */
Alert: {
/** Alert Id */
@@ -390,26 +289,6 @@ export interface components {
*/
user_id: string;
};
/** CreateTask */
CreateTask: {
analysis_window: components["schemas"]["TimeRange"];
/** Asset Ids */
asset_ids: string[];
/** Evidence Refs */
evidence_refs: components["schemas"]["ObjectRef"][];
/**
* Request Id
* Format: uuid
*/
request_id: string;
/** Requested Check */
requested_check: string;
source: components["schemas"]["SourceLink"];
/** Summary */
summary: string;
/** Title */
title: string;
};
/** CreateTestDataRecord */
CreateTestDataRecord: {
/** Label */
@@ -459,22 +338,28 @@ export interface components {
* Format: uuid
*/
request_id: string;
/** Scheduled At */
scheduled_at?: string | null;
/** Scenario Code */
scenario_code?: string | null;
/** Scheduled At */
scheduled_at?: string | null;
/**
* Status
* @default draft
* @enum {string}
*/
status: "draft" | "open" | "in_progress" | "completed" | "cancelled";
status: "draft" | "open" | "in_progress" | "awaiting_reply" | "completed" | "cancelled";
/** Subtasks */
subtasks?: components["schemas"]["WorkbenchRuntimeWorkOrderSubtask"][] | null;
/** Summary */
summary: string;
/** Title */
title: string;
/** Work Order Type */
work_order_type?: "general" | "water_quality_complaint";
/**
* Work Order Type
* @default general
* @enum {string}
*/
work_order_type: "general" | "water_quality_complaint" | "burst_report";
};
/** DeleteResource */
DeleteResource: {
@@ -902,13 +787,6 @@ export interface components {
*/
updated_at: string;
};
/** TaskPage */
TaskPage: {
/** Items */
items: components["schemas"]["Task"][];
/** Next Cursor */
next_cursor: string | null;
};
/** TestDataRecord */
TestDataRecord: {
/**
@@ -983,23 +861,6 @@ export interface components {
*/
start: string;
};
/** Transition */
Transition: {
/** Expected Revision */
expected_revision: number;
/** Reason */
reason: string;
/**
* Request Id
* Format: uuid
*/
request_id: string;
/**
* Target Status
* @enum {string}
*/
target_status: "pending" | "processing" | "pending_review" | "completed";
};
/** UpdateTestDataRecord */
UpdateTestDataRecord: {
/**
@@ -1038,13 +899,30 @@ export interface components {
* @default false
*/
clear_assignee: boolean;
/**
* Clear Location
* @default false
*/
clear_location: boolean;
/**
* Clear Scenario Code
* @default false
*/
clear_scenario_code: boolean;
/**
* Clear Scheduled At
* @default false
*/
clear_scheduled_at: boolean;
/**
* Clear Subtasks
* @default false
*/
clear_subtasks: boolean;
/** Expected Revision */
expected_revision: number;
/** Location */
location?: string | null;
/** Priority */
priority?: ("low" | "normal" | "high" | "urgent") | null;
/**
@@ -1052,10 +930,14 @@ export interface components {
* Format: uuid
*/
request_id: string;
/** Scenario Code */
scenario_code?: string | null;
/** Scheduled At */
scheduled_at?: string | null;
/** Status */
status?: ("draft" | "open" | "in_progress" | "completed" | "cancelled") | null;
status?: ("draft" | "open" | "in_progress" | "awaiting_reply" | "completed" | "cancelled") | null;
/** Subtasks */
subtasks?: components["schemas"]["WorkbenchRuntimeWorkOrderSubtask"][] | null;
/** Summary */
summary?: string | null;
/** Title */
@@ -1091,15 +973,17 @@ export interface components {
project_id: string;
/** Revision */
revision: number;
/** Scheduled At */
scheduled_at: string | null;
/** Scenario Code */
scenario_code?: string | null;
/** Scheduled At */
scheduled_at: string | null;
/**
* Status
* @enum {string}
*/
status: "draft" | "open" | "in_progress" | "completed" | "cancelled";
status: "draft" | "open" | "in_progress" | "awaiting_reply" | "completed" | "cancelled";
/** Subtasks */
subtasks?: components["schemas"]["WorkbenchRuntimeWorkOrderSubtask"][] | null;
/** Summary */
summary: string;
/** Title */
@@ -1116,8 +1000,12 @@ export interface components {
* Format: uuid
*/
work_order_id: string;
/** Work Order Type */
work_order_type?: "general" | "water_quality_complaint";
/**
* Work Order Type
* @default general
* @enum {string}
*/
work_order_type: "general" | "water_quality_complaint" | "burst_report";
};
/** WorkOrderPage */
WorkOrderPage: {
@@ -1126,6 +1014,57 @@ export interface components {
/** Next Cursor */
next_cursor: string | null;
};
/** WorkbenchRuntimeWorkOrderStage */
WorkbenchRuntimeWorkOrderStage: {
/** Description */
description: string;
/** Id */
id: string;
/** Owner */
owner: string;
/** Sequence */
sequence: number;
/**
* Status
* @enum {string}
*/
status: "done" | "current" | "pending" | "blocked" | "skipped";
/** Time Label */
time_label: string;
/** Title */
title: string;
};
/** WorkbenchRuntimeWorkOrderSubtask */
WorkbenchRuntimeWorkOrderSubtask: {
/** Assignee */
assignee: string;
/** Duration Minutes */
duration_minutes: number;
/** Id */
id: string;
/** Location */
location: string;
/** Reply Requirements */
reply_requirements: string[];
/** Reply Window Minutes */
reply_window_minutes: number;
/**
* Scheduled At
* Format: date-time
*/
scheduled_at: string;
/** Stages */
stages: components["schemas"]["WorkbenchRuntimeWorkOrderStage"][];
/**
* Status
* @enum {string}
*/
status: "pending" | "running" | "blocked" | "completed" | "cancelled";
/** Summary */
summary: string;
/** Title */
title: string;
};
};
responses: never;
parameters: never;
@@ -1812,443 +1751,6 @@ export interface operations {
};
};
};
tasks_api_sample_v1_tasks_get: {
parameters: {
query?: {
limit?: number;
cursor?: string | null;
source_task_id?: string | null;
};
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Successful Response */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["TaskPage"];
};
};
/** @description Unauthorized */
401: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Forbidden */
403: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Not Found */
404: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Conflict */
409: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Unprocessable Entity */
422: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Bad Gateway */
502: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Service Unavailable */
503: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
};
};
submit_api_sample_v1_tasks_post: {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody: {
content: {
"application/json": components["schemas"]["CreateTask"];
};
};
responses: {
/** @description Successful Response */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Task"];
};
};
/** @description Unauthorized */
401: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Forbidden */
403: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Not Found */
404: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Conflict */
409: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Unprocessable Entity */
422: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Bad Gateway */
502: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Service Unavailable */
503: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
};
};
task_api_sample_v1_tasks__task_id__get: {
parameters: {
query?: never;
header?: never;
path: {
task_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Successful Response */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Task"];
};
};
/** @description Unauthorized */
401: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Forbidden */
403: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Not Found */
404: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Conflict */
409: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Unprocessable Entity */
422: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Bad Gateway */
502: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Service Unavailable */
503: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
};
};
feedback_api_sample_v1_tasks__task_id__feedback_post: {
parameters: {
query?: never;
header?: never;
path: {
task_id: string;
};
cookie?: never;
};
requestBody: {
content: {
"application/json": components["schemas"]["AddFeedback"];
};
};
responses: {
/** @description Successful Response */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Task"];
};
};
/** @description Unauthorized */
401: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Forbidden */
403: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Not Found */
404: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Conflict */
409: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Unprocessable Entity */
422: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Bad Gateway */
502: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Service Unavailable */
503: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
};
};
transition_api_sample_v1_tasks__task_id__transitions_post: {
parameters: {
query?: never;
header?: never;
path: {
task_id: string;
};
cookie?: never;
};
requestBody: {
content: {
"application/json": components["schemas"]["Transition"];
};
};
responses: {
/** @description Successful Response */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Task"];
};
};
/** @description Unauthorized */
401: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Forbidden */
403: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Not Found */
404: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Conflict */
409: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Unprocessable Entity */
422: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Bad Gateway */
502: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
/** @description Service Unavailable */
503: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SampleError"];
};
};
};
};
test_data_api_sample_v1_test_data_get: {
parameters: {
query?: {