@ancplua/qyl-api-schema 6.0.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/api/workflow.tsp CHANGED
@@ -20,7 +20,7 @@ model WorkflowHeartbeatEvent {
20
20
  type: "heartbeat";
21
21
 
22
22
  @encodedName("application/json", "high_water_mark")
23
- highWaterMark: WorkflowSequence;
23
+ highWaterMark: WorkflowJournalPosition;
24
24
 
25
25
  timestamp: utcDateTime;
26
26
  }
@@ -30,10 +30,10 @@ model WorkflowCursorGapEvent {
30
30
  type: "cursor_gap";
31
31
 
32
32
  @encodedName("application/json", "oldest_available_sequence")
33
- oldestAvailableSequence: WorkflowSequence;
33
+ oldestAvailableSequence: WorkflowJournalPosition;
34
34
 
35
35
  @encodedName("application/json", "high_water_mark")
36
- highWaterMark: WorkflowSequence;
36
+ highWaterMark: WorkflowJournalPosition;
37
37
 
38
38
  timestamp: utcDateTime;
39
39
  }
@@ -45,6 +45,68 @@ union WorkflowStreamEvents {
45
45
  cursorGap: WorkflowCursorGapEvent,
46
46
  }
47
47
 
48
+ @doc("Which opaque graph cursor was rejected.")
49
+ enum WorkflowCursorKind {
50
+ node: "node",
51
+ edge: "edge",
52
+ }
53
+
54
+ @doc("Why an opaque graph cursor cannot be reused for this request.")
55
+ enum WorkflowCursorFailureReason {
56
+ invalid: "invalid",
57
+ wrongRun: "wrong_run",
58
+ wrongGeneration: "wrong_generation",
59
+ stale: "stale",
60
+ }
61
+
62
+ @doc("Opaque graph cursor is malformed, belongs to another run, or targets a stale generation.")
63
+ @error
64
+ model WorkflowCursorError extends ProblemDetails {
65
+ @statusCode _: 409;
66
+ title: "Invalid Workflow Cursor";
67
+
68
+ @encodedName("application/json", "cursor_kind")
69
+ cursorKind: WorkflowCursorKind;
70
+
71
+ reason: WorkflowCursorFailureReason;
72
+
73
+ @encodedName("application/json", "current_generation")
74
+ currentGeneration?: WorkflowGeneration;
75
+ }
76
+
77
+ @doc("Workflow run was durably deleted and can no longer accept events or publish projections.")
78
+ @error
79
+ model WorkflowRunDeletedError extends ProblemDetails {
80
+ @statusCode _: 410;
81
+ title: "Workflow Run Deleted";
82
+
83
+ @encodedName("application/json", "run_id")
84
+ runId: WorkflowRunId;
85
+ }
86
+
87
+ @doc("Workflow projection is rebuilding or temporarily unavailable after a retryable storage failure.")
88
+ @error
89
+ model WorkflowProjectionUnavailableError extends ProblemDetails {
90
+ @statusCode _: 503;
91
+ title: "Workflow Projection Unavailable";
92
+
93
+ @header("Retry-After")
94
+ @encodedName("application/json", "retry_after")
95
+ retryAfter: int32;
96
+
97
+ @encodedName("application/json", "projection_status")
98
+ projectionStatus: WorkflowProjectionStatus;
99
+ }
100
+
101
+ @doc("Workflow projection is non-retryably corrupt or incompatible. Internal storage details are intentionally omitted.")
102
+ @error
103
+ model WorkflowProjectionCorruptError extends ProblemDetails {
104
+ @statusCode _: 500;
105
+ title: "Workflow Projection Corrupt";
106
+ @encodedName("application/json", "projection_status")
107
+ projectionStatus: WorkflowProjectionStatus;
108
+ }
109
+
48
110
  @route("/api/v1/workflow-runs")
49
111
  @tag("Workflow runs")
50
112
  @useAuth(Qyl.Api.Contracts.QylApiKeyHeaderAuth)
@@ -58,6 +120,7 @@ interface WorkflowRunsApi {
58
120
  | ValidationError
59
121
  | UnauthorizedError
60
122
  | ConflictError
123
+ | WorkflowRunDeletedError
61
124
  | ServiceUnavailableError
62
125
  | InternalServerError;
63
126
 
@@ -69,7 +132,8 @@ interface WorkflowRunsApi {
69
132
  @minValue(1)
70
133
  @maxValue(200)
71
134
  limit?: int32 = 50,
72
- @query cursor?: string,
135
+ @doc("Opaque continuation scoped to the project and status filter. Reuse it unchanged from next_cursor; do not parse, construct, or modify it.")
136
+ @query cursor?: WorkflowRunCursor,
73
137
  ):
74
138
  | WorkflowRunPage
75
139
  | ValidationError
@@ -86,6 +150,7 @@ interface WorkflowRunsApi {
86
150
  | WorkflowRun
87
151
  | UnauthorizedError
88
152
  | NotFoundError
153
+ | WorkflowRunDeletedError
89
154
  | ServiceUnavailableError
90
155
  | InternalServerError;
91
156
 
@@ -100,6 +165,7 @@ interface WorkflowRunsApi {
100
165
  | ValidationError
101
166
  | UnauthorizedError
102
167
  | NotFoundError
168
+ | WorkflowRunDeletedError
103
169
  | ConflictError
104
170
  | ServiceUnavailableError
105
171
  | InternalServerError;
@@ -109,7 +175,7 @@ interface WorkflowRunsApi {
109
175
  readEvents(
110
176
  ...Qyl.Api.Contracts.ProjectScopeHeader,
111
177
  @path("run_id") runId: WorkflowRunId,
112
- @query("after_sequence") afterSequence?: WorkflowSequence,
178
+ @query("after_sequence") afterSequence?: WorkflowJournalPosition,
113
179
  @query
114
180
  @minValue(1)
115
181
  @maxValue(1000)
@@ -123,6 +189,7 @@ interface WorkflowRunsApi {
123
189
  | ValidationError
124
190
  | UnauthorizedError
125
191
  | NotFoundError
192
+ | WorkflowRunDeletedError
126
193
  | ServiceUnavailableError
127
194
  | InternalServerError;
128
195
 
@@ -131,12 +198,14 @@ interface WorkflowRunsApi {
131
198
  getGraph(
132
199
  ...Qyl.Api.Contracts.ProjectScopeHeader,
133
200
  @path("run_id") runId: WorkflowRunId,
134
- @query("node_cursor") nodeCursor?: string,
201
+ @doc("Opaque node continuation. Reuse it unchanged from the preceding snapshot's next_node_cursor; do not parse, construct, or modify it.")
202
+ @query("node_cursor") nodeCursor?: WorkflowNodeCursor,
135
203
  @query("node_limit")
136
204
  @minValue(1)
137
205
  @maxValue(1000)
138
206
  nodeLimit?: int32 = 250,
139
- @query("edge_cursor") edgeCursor?: string,
207
+ @doc("Opaque edge continuation. Reuse it unchanged from the preceding snapshot's next_edge_cursor; do not parse, construct, or modify it.")
208
+ @query("edge_cursor") edgeCursor?: WorkflowEdgeCursor,
140
209
  @query("edge_limit")
141
210
  @minValue(1)
142
211
  @maxValue(2000)
@@ -146,8 +215,10 @@ interface WorkflowRunsApi {
146
215
  | ValidationError
147
216
  | UnauthorizedError
148
217
  | NotFoundError
149
- | ServiceUnavailableError
150
- | InternalServerError;
218
+ | WorkflowRunDeletedError
219
+ | WorkflowCursorError
220
+ | WorkflowProjectionUnavailableError
221
+ | WorkflowProjectionCorruptError;
151
222
 
152
223
  @get
153
224
  @route("/{run_id}/content/{content_ref}")
@@ -159,6 +230,7 @@ interface WorkflowRunsApi {
159
230
  | WorkflowContent
160
231
  | UnauthorizedError
161
232
  | NotFoundError
233
+ | WorkflowRunDeletedError
162
234
  | ServiceUnavailableError
163
235
  | InternalServerError;
164
236
 
@@ -173,6 +245,7 @@ interface WorkflowRunsApi {
173
245
  | ValidationError
174
246
  | UnauthorizedError
175
247
  | NotFoundError
248
+ | WorkflowRunDeletedError
176
249
  | ServiceUnavailableError
177
250
  | InternalServerError;
178
251
 
@@ -187,6 +260,7 @@ interface WorkflowRunsApi {
187
260
  | ValidationError
188
261
  | UnauthorizedError
189
262
  | NotFoundError
263
+ | WorkflowRunDeletedError
190
264
  | ConflictError
191
265
  | ServiceUnavailableError
192
266
  | InternalServerError;
@@ -210,6 +284,7 @@ interface WorkflowRunsApi {
210
284
  | ValidationError
211
285
  | UnauthorizedError
212
286
  | NotFoundError
287
+ | WorkflowRunDeletedError
213
288
  | ServiceUnavailableError
214
289
  | InternalServerError;
215
290
 
@@ -225,6 +300,7 @@ interface WorkflowRunsApi {
225
300
  | ValidationError
226
301
  | UnauthorizedError
227
302
  | NotFoundError
303
+ | WorkflowRunDeletedError
228
304
  | ConflictError
229
305
  | ServiceUnavailableError
230
306
  | InternalServerError;