@comfyorg/sdk 0.1.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/README.md +236 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +27 -0
- package/dist/low/errors.d.ts +73 -0
- package/dist/low/errors.js +104 -0
- package/dist/low/generated/index.d.ts +1 -0
- package/dist/low/generated/index.js +2 -0
- package/dist/low/generated/types.gen.d.ts +528 -0
- package/dist/low/generated/types.gen.js +2 -0
- package/dist/low/generated/zod.gen.d.ts +455 -0
- package/dist/low/generated/zod.gen.js +204 -0
- package/dist/low/index.d.ts +21 -0
- package/dist/low/index.js +21 -0
- package/dist/low/models.d.ts +47 -0
- package/dist/low/models.js +16 -0
- package/dist/low/sse.d.ts +24 -0
- package/dist/low/sse.js +44 -0
- package/dist/low/transport.d.ts +128 -0
- package/dist/low/transport.js +285 -0
- package/dist/sdk/abortable-sleep.d.ts +13 -0
- package/dist/sdk/abortable-sleep.js +31 -0
- package/dist/sdk/assets.d.ts +74 -0
- package/dist/sdk/assets.js +200 -0
- package/dist/sdk/client.d.ts +70 -0
- package/dist/sdk/client.js +120 -0
- package/dist/sdk/core.d.ts +33 -0
- package/dist/sdk/core.js +89 -0
- package/dist/sdk/events.d.ts +60 -0
- package/dist/sdk/events.js +84 -0
- package/dist/sdk/exceptions.d.ts +79 -0
- package/dist/sdk/exceptions.js +114 -0
- package/dist/sdk/hashing.d.ts +14 -0
- package/dist/sdk/hashing.js +28 -0
- package/dist/sdk/index.d.ts +13 -0
- package/dist/sdk/index.js +12 -0
- package/dist/sdk/jobs.d.ts +47 -0
- package/dist/sdk/jobs.js +145 -0
- package/dist/sdk/outputs.d.ts +26 -0
- package/dist/sdk/outputs.js +48 -0
- package/dist/sdk/workflows.d.ts +32 -0
- package/dist/sdk/workflows.js +45 -0
- package/package.json +52 -0
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
export type ClientOptions = {
|
|
2
|
+
baseUrl: 'http://127.0.0.1:8189' | 'https://api.comfy.org' | 'https://{deployment}.comfy.org' | (string & {});
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* A user-owned record identified by a server-assigned UUID, backing an immutable blob whose content carries a server-computed blake3 hash. `hash` may be computed lazily: an asset record (and its retrievable bytes) can exist before its hash is filled in.
|
|
6
|
+
*/
|
|
7
|
+
export type Asset = {
|
|
8
|
+
id: string;
|
|
9
|
+
/**
|
|
10
|
+
* `blake3:<hex>`; null while lazily computed.
|
|
11
|
+
*/
|
|
12
|
+
hash: string | null;
|
|
13
|
+
size_bytes: number;
|
|
14
|
+
content_type: string;
|
|
15
|
+
file_path?: string | null;
|
|
16
|
+
/**
|
|
17
|
+
* On create responses: distinguishes a brand-new blob (true) from a dedup hit against bytes the platform already had (false).
|
|
18
|
+
*/
|
|
19
|
+
created_new?: boolean;
|
|
20
|
+
created_at: string;
|
|
21
|
+
/**
|
|
22
|
+
* Short-lived content URL (signed, or proxy-served).
|
|
23
|
+
*/
|
|
24
|
+
url: string;
|
|
25
|
+
url_expires_at: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* One execution of a workflow. Durable from creation until `expires_at`; `outputs` populates incrementally during execution.
|
|
29
|
+
*/
|
|
30
|
+
export type Job = {
|
|
31
|
+
id: string;
|
|
32
|
+
status: JobStatus;
|
|
33
|
+
created_at: string;
|
|
34
|
+
started_at: string | null;
|
|
35
|
+
completed_at: string | null;
|
|
36
|
+
/**
|
|
37
|
+
* Retention deadline — a platform property, not an API constant.
|
|
38
|
+
*/
|
|
39
|
+
expires_at: string;
|
|
40
|
+
queue_position: number | null;
|
|
41
|
+
/**
|
|
42
|
+
* The latest progress snapshot; same data the SSE stream pushes.
|
|
43
|
+
*/
|
|
44
|
+
progress: Progress | null;
|
|
45
|
+
outputs: Array<Output>;
|
|
46
|
+
error: JobError | null;
|
|
47
|
+
/**
|
|
48
|
+
* Values are nullable (a metric not yet available — e.g. `execution_ms` before a job starts running — is `null`, not omitted); the example below is deliberately all-non-null purely to work around a Spectral/nimma lint-tooling crash on a literal `null` inside a schema `example` combined with `additionalProperties.nullable: true` — the schema itself is unchanged and still allows null values at runtime.
|
|
49
|
+
*/
|
|
50
|
+
metrics?: {
|
|
51
|
+
[key: string]: number | null;
|
|
52
|
+
};
|
|
53
|
+
urls: JobUrls;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Lifecycle: queued → running → succeeded | failed | expired;
|
|
57
|
+
* a cancel request moves running → canceling → canceled.
|
|
58
|
+
* Terminal states: succeeded, canceled, failed, expired.
|
|
59
|
+
*
|
|
60
|
+
*/
|
|
61
|
+
export type JobStatus = 'queued' | 'running' | 'succeeded' | 'canceling' | 'canceled' | 'failed' | 'expired';
|
|
62
|
+
/**
|
|
63
|
+
* Embedded follow-up links — follow these, don't build URLs.
|
|
64
|
+
*/
|
|
65
|
+
export type JobUrls = {
|
|
66
|
+
self: string;
|
|
67
|
+
events: string;
|
|
68
|
+
cancel: string;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Server-computed progress snapshot (node-count and sampler-step weighted). Complete per snapshot — one fully re-syncs a client.
|
|
72
|
+
*/
|
|
73
|
+
export type Progress = {
|
|
74
|
+
/**
|
|
75
|
+
* Overall fraction, server-computed.
|
|
76
|
+
*/
|
|
77
|
+
value: number;
|
|
78
|
+
nodes_done: number;
|
|
79
|
+
nodes_total: number;
|
|
80
|
+
current_node?: string | null;
|
|
81
|
+
current_node_class?: string | null;
|
|
82
|
+
step?: number | null;
|
|
83
|
+
steps?: number | null;
|
|
84
|
+
message?: string | null;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* A committed job output. Outputs are assets: `id` is the asset UUID, retrievable via GET /api/v2/assets/{id} for as long as the job is retained. `hash` is lazily computed and may be null on the retrieval hot path.
|
|
88
|
+
*/
|
|
89
|
+
export type Output = {
|
|
90
|
+
node_id: string;
|
|
91
|
+
name: string;
|
|
92
|
+
type: OutputType;
|
|
93
|
+
content_type: string;
|
|
94
|
+
size_bytes: number;
|
|
95
|
+
/**
|
|
96
|
+
* Asset UUID.
|
|
97
|
+
*/
|
|
98
|
+
id: string;
|
|
99
|
+
/**
|
|
100
|
+
* `blake3:<hex>`; null until lazily computed.
|
|
101
|
+
*/
|
|
102
|
+
hash: string | null;
|
|
103
|
+
url: string;
|
|
104
|
+
url_expires_at: string;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Normalized output kind — nothing silently dropped.
|
|
108
|
+
*/
|
|
109
|
+
export type OutputType = 'image' | 'video' | 'audio' | 'text' | 'file' | 'latent';
|
|
110
|
+
/**
|
|
111
|
+
* Execution failure detail, carried in `job.error` (not an HTTP error).
|
|
112
|
+
*/
|
|
113
|
+
export type JobError = {
|
|
114
|
+
code: string;
|
|
115
|
+
message: string;
|
|
116
|
+
node_id?: string | null;
|
|
117
|
+
class_type?: string | null;
|
|
118
|
+
traceback?: string | null;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Shared error envelope with machine-readable codes. Core codes (v1):
|
|
122
|
+
* `invalid_workflow` (422), `workflow_format_ui` (422),
|
|
123
|
+
* `missing_asset` (422), `hash_mismatch` (409), `blob_not_found`
|
|
124
|
+
* (404), `idempotency_key_reuse` (422),
|
|
125
|
+
* `queue_full` (429 + Retry-After), `insufficient_credits` (402),
|
|
126
|
+
* `not_found` (404), `unauthorized` (401), `forbidden` (403).
|
|
127
|
+
*
|
|
128
|
+
*/
|
|
129
|
+
export type ErrorEnvelope = {
|
|
130
|
+
error: {
|
|
131
|
+
code: string;
|
|
132
|
+
message: string;
|
|
133
|
+
details?: {
|
|
134
|
+
[key: string]: unknown;
|
|
135
|
+
} | null;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* Client-generated UUID (recommended). Single-use: the first request to present a key is processed; any later request with the same key is rejected `422` `idempotency_key_reuse` (reject-on-duplicate, no response replay). Keys expire after 24h.
|
|
140
|
+
*/
|
|
141
|
+
export type IdempotencyKey = string;
|
|
142
|
+
export type JobId = string;
|
|
143
|
+
export type AssetId = string;
|
|
144
|
+
/**
|
|
145
|
+
* Content hash, written `blake3:<hex>`.
|
|
146
|
+
*/
|
|
147
|
+
export type BlakeHash = string;
|
|
148
|
+
export type PostAssetsData = {
|
|
149
|
+
body: {
|
|
150
|
+
/**
|
|
151
|
+
* The raw bytes.
|
|
152
|
+
*/
|
|
153
|
+
file: Blob | File;
|
|
154
|
+
content_type: string;
|
|
155
|
+
/**
|
|
156
|
+
* Placement path / filename (global-namespace-root form, e.g. `photo.png` or `models/checkpoints/x.safetensors`).
|
|
157
|
+
*/
|
|
158
|
+
file_path: string;
|
|
159
|
+
/**
|
|
160
|
+
* Optional client-computed blake3 (`blake3:<hex>`). Verified against the server-computed hash; mismatch is rejected with 409 `hash_mismatch` and no asset is minted.
|
|
161
|
+
*/
|
|
162
|
+
expected_hash?: string;
|
|
163
|
+
/**
|
|
164
|
+
* Category tags (e.g. `input`).
|
|
165
|
+
*/
|
|
166
|
+
tags?: Array<string>;
|
|
167
|
+
};
|
|
168
|
+
headers?: {
|
|
169
|
+
/**
|
|
170
|
+
* Client-generated UUID (recommended). Single-use: the first request to present a key is processed; any later request with the same key is rejected `422` `idempotency_key_reuse` (reject-on-duplicate, no response replay). Keys expire after 24h.
|
|
171
|
+
*/
|
|
172
|
+
'Idempotency-Key'?: string;
|
|
173
|
+
};
|
|
174
|
+
path?: never;
|
|
175
|
+
query?: never;
|
|
176
|
+
url: '/api/v2/assets';
|
|
177
|
+
};
|
|
178
|
+
export type PostAssetsErrors = {
|
|
179
|
+
/**
|
|
180
|
+
* `unauthorized` — missing or invalid credentials.
|
|
181
|
+
*/
|
|
182
|
+
401: ErrorEnvelope;
|
|
183
|
+
/**
|
|
184
|
+
* `forbidden` — authenticated but not allowed.
|
|
185
|
+
*/
|
|
186
|
+
403: ErrorEnvelope;
|
|
187
|
+
/**
|
|
188
|
+
* `hash_mismatch`.
|
|
189
|
+
*/
|
|
190
|
+
409: ErrorEnvelope;
|
|
191
|
+
/**
|
|
192
|
+
* `idempotency_key_reuse` or validation failure.
|
|
193
|
+
*/
|
|
194
|
+
422: ErrorEnvelope;
|
|
195
|
+
/**
|
|
196
|
+
* `upstream_error` — an unexpected failure reaching or processing the request in this implementation's backing services. The message is always a generic, safe-to-display string; implementation detail (the specific upstream, its error text, transport failures) is never included here — see each implementation's own error-mapping notes. Every operation in this contract can fail this way.
|
|
197
|
+
*/
|
|
198
|
+
500: ErrorEnvelope;
|
|
199
|
+
};
|
|
200
|
+
export type PostAssetsError = PostAssetsErrors[keyof PostAssetsErrors];
|
|
201
|
+
export type PostAssetsResponses = {
|
|
202
|
+
/**
|
|
203
|
+
* Bytes deduped to an existing blob; asset minted over it.
|
|
204
|
+
*/
|
|
205
|
+
200: Asset;
|
|
206
|
+
/**
|
|
207
|
+
* New blob stored; asset minted.
|
|
208
|
+
*/
|
|
209
|
+
201: Asset;
|
|
210
|
+
};
|
|
211
|
+
export type PostAssetsResponse = PostAssetsResponses[keyof PostAssetsResponses];
|
|
212
|
+
export type AssetFromHashData = {
|
|
213
|
+
body: {
|
|
214
|
+
hash: string;
|
|
215
|
+
file_path?: string;
|
|
216
|
+
tags?: Array<string>;
|
|
217
|
+
};
|
|
218
|
+
path?: never;
|
|
219
|
+
query?: never;
|
|
220
|
+
url: '/api/v2/assets/from-hash';
|
|
221
|
+
};
|
|
222
|
+
export type AssetFromHashErrors = {
|
|
223
|
+
/**
|
|
224
|
+
* `unauthorized` — missing or invalid credentials.
|
|
225
|
+
*/
|
|
226
|
+
401: ErrorEnvelope;
|
|
227
|
+
/**
|
|
228
|
+
* `forbidden` — authenticated but not allowed.
|
|
229
|
+
*/
|
|
230
|
+
403: ErrorEnvelope;
|
|
231
|
+
/**
|
|
232
|
+
* `blob_not_found` — no blob the caller may mint from.
|
|
233
|
+
*/
|
|
234
|
+
404: ErrorEnvelope;
|
|
235
|
+
/**
|
|
236
|
+
* `upstream_error` — an unexpected failure reaching or processing the request in this implementation's backing services. The message is always a generic, safe-to-display string; implementation detail (the specific upstream, its error text, transport failures) is never included here — see each implementation's own error-mapping notes. Every operation in this contract can fail this way.
|
|
237
|
+
*/
|
|
238
|
+
500: ErrorEnvelope;
|
|
239
|
+
};
|
|
240
|
+
export type AssetFromHashError = AssetFromHashErrors[keyof AssetFromHashErrors];
|
|
241
|
+
export type AssetFromHashResponses = {
|
|
242
|
+
/**
|
|
243
|
+
* An identical reference already existed; returned as-is.
|
|
244
|
+
*/
|
|
245
|
+
200: Asset;
|
|
246
|
+
/**
|
|
247
|
+
* Asset minted over the existing blob.
|
|
248
|
+
*/
|
|
249
|
+
201: Asset;
|
|
250
|
+
};
|
|
251
|
+
export type AssetFromHashResponse = AssetFromHashResponses[keyof AssetFromHashResponses];
|
|
252
|
+
export type HeadAssetByHashData = {
|
|
253
|
+
body?: never;
|
|
254
|
+
path: {
|
|
255
|
+
/**
|
|
256
|
+
* Content hash, written `blake3:<hex>`.
|
|
257
|
+
*/
|
|
258
|
+
hash: string;
|
|
259
|
+
};
|
|
260
|
+
query?: never;
|
|
261
|
+
url: '/api/v2/assets/by-hash/{hash}';
|
|
262
|
+
};
|
|
263
|
+
export type HeadAssetByHashErrors = {
|
|
264
|
+
/**
|
|
265
|
+
* `unauthorized` — missing or invalid credentials.
|
|
266
|
+
*/
|
|
267
|
+
401: ErrorEnvelope;
|
|
268
|
+
/**
|
|
269
|
+
* No blob the caller may mint from.
|
|
270
|
+
*/
|
|
271
|
+
404: unknown;
|
|
272
|
+
/**
|
|
273
|
+
* `upstream_error` — an unexpected failure reaching or processing the request in this implementation's backing services. The message is always a generic, safe-to-display string; implementation detail (the specific upstream, its error text, transport failures) is never included here — see each implementation's own error-mapping notes. Every operation in this contract can fail this way.
|
|
274
|
+
*/
|
|
275
|
+
500: ErrorEnvelope;
|
|
276
|
+
};
|
|
277
|
+
export type HeadAssetByHashError = HeadAssetByHashErrors[keyof HeadAssetByHashErrors];
|
|
278
|
+
export type HeadAssetByHashResponses = {
|
|
279
|
+
/**
|
|
280
|
+
* Blob present and mintable by the caller.
|
|
281
|
+
*/
|
|
282
|
+
200: unknown;
|
|
283
|
+
};
|
|
284
|
+
export type GetAssetData = {
|
|
285
|
+
body?: never;
|
|
286
|
+
path: {
|
|
287
|
+
id: string;
|
|
288
|
+
};
|
|
289
|
+
query?: never;
|
|
290
|
+
url: '/api/v2/assets/{id}';
|
|
291
|
+
};
|
|
292
|
+
export type GetAssetErrors = {
|
|
293
|
+
/**
|
|
294
|
+
* `unauthorized` — missing or invalid credentials.
|
|
295
|
+
*/
|
|
296
|
+
401: ErrorEnvelope;
|
|
297
|
+
/**
|
|
298
|
+
* `forbidden` — authenticated but not allowed.
|
|
299
|
+
*/
|
|
300
|
+
403: ErrorEnvelope;
|
|
301
|
+
/**
|
|
302
|
+
* `not_found`.
|
|
303
|
+
*/
|
|
304
|
+
404: ErrorEnvelope;
|
|
305
|
+
/**
|
|
306
|
+
* `upstream_error` — an unexpected failure reaching or processing the request in this implementation's backing services. The message is always a generic, safe-to-display string; implementation detail (the specific upstream, its error text, transport failures) is never included here — see each implementation's own error-mapping notes. Every operation in this contract can fail this way.
|
|
307
|
+
*/
|
|
308
|
+
500: ErrorEnvelope;
|
|
309
|
+
};
|
|
310
|
+
export type GetAssetError = GetAssetErrors[keyof GetAssetErrors];
|
|
311
|
+
export type GetAssetResponses = {
|
|
312
|
+
/**
|
|
313
|
+
* The asset.
|
|
314
|
+
*/
|
|
315
|
+
200: Asset;
|
|
316
|
+
};
|
|
317
|
+
export type GetAssetResponse = GetAssetResponses[keyof GetAssetResponses];
|
|
318
|
+
export type GetAssetContentData = {
|
|
319
|
+
body?: never;
|
|
320
|
+
headers?: {
|
|
321
|
+
/**
|
|
322
|
+
* Standard HTTP range, e.g. `bytes=0-1048575`.
|
|
323
|
+
*/
|
|
324
|
+
Range?: string;
|
|
325
|
+
};
|
|
326
|
+
path: {
|
|
327
|
+
id: string;
|
|
328
|
+
};
|
|
329
|
+
query?: never;
|
|
330
|
+
url: '/api/v2/assets/{id}/content';
|
|
331
|
+
};
|
|
332
|
+
export type GetAssetContentErrors = {
|
|
333
|
+
/**
|
|
334
|
+
* `unauthorized` — missing or invalid credentials.
|
|
335
|
+
*/
|
|
336
|
+
401: ErrorEnvelope;
|
|
337
|
+
/**
|
|
338
|
+
* `forbidden` — authenticated but not allowed.
|
|
339
|
+
*/
|
|
340
|
+
403: ErrorEnvelope;
|
|
341
|
+
/**
|
|
342
|
+
* `not_found`.
|
|
343
|
+
*/
|
|
344
|
+
404: ErrorEnvelope;
|
|
345
|
+
/**
|
|
346
|
+
* Range not satisfiable.
|
|
347
|
+
*/
|
|
348
|
+
416: unknown;
|
|
349
|
+
/**
|
|
350
|
+
* `upstream_error` — an unexpected failure reaching or processing the request in this implementation's backing services. The message is always a generic, safe-to-display string; implementation detail (the specific upstream, its error text, transport failures) is never included here — see each implementation's own error-mapping notes. Every operation in this contract can fail this way.
|
|
351
|
+
*/
|
|
352
|
+
500: ErrorEnvelope;
|
|
353
|
+
};
|
|
354
|
+
export type GetAssetContentError = GetAssetContentErrors[keyof GetAssetContentErrors];
|
|
355
|
+
export type GetAssetContentResponses = {
|
|
356
|
+
/**
|
|
357
|
+
* The full content.
|
|
358
|
+
*/
|
|
359
|
+
200: Blob | File;
|
|
360
|
+
/**
|
|
361
|
+
* Partial content for a ranged request.
|
|
362
|
+
*/
|
|
363
|
+
206: Blob | File;
|
|
364
|
+
};
|
|
365
|
+
export type GetAssetContentResponse = GetAssetContentResponses[keyof GetAssetContentResponses];
|
|
366
|
+
export type PostJobsData = {
|
|
367
|
+
body: {
|
|
368
|
+
/**
|
|
369
|
+
* API-format workflow graph, verbatim.
|
|
370
|
+
*/
|
|
371
|
+
workflow: {
|
|
372
|
+
[key: string]: unknown;
|
|
373
|
+
};
|
|
374
|
+
};
|
|
375
|
+
headers?: {
|
|
376
|
+
/**
|
|
377
|
+
* Client-generated UUID (recommended). Single-use: the first request to present a key is processed; any later request with the same key is rejected `422` `idempotency_key_reuse` (reject-on-duplicate, no response replay). Keys expire after 24h.
|
|
378
|
+
*/
|
|
379
|
+
'Idempotency-Key'?: string;
|
|
380
|
+
};
|
|
381
|
+
path?: never;
|
|
382
|
+
query?: never;
|
|
383
|
+
url: '/api/v2/jobs';
|
|
384
|
+
};
|
|
385
|
+
export type PostJobsErrors = {
|
|
386
|
+
/**
|
|
387
|
+
* `unauthorized` — missing or invalid credentials.
|
|
388
|
+
*/
|
|
389
|
+
401: ErrorEnvelope;
|
|
390
|
+
/**
|
|
391
|
+
* `insufficient_credits` (Cloud / serverless only).
|
|
392
|
+
*/
|
|
393
|
+
402: ErrorEnvelope;
|
|
394
|
+
/**
|
|
395
|
+
* `forbidden` — authenticated but not allowed.
|
|
396
|
+
*/
|
|
397
|
+
403: ErrorEnvelope;
|
|
398
|
+
/**
|
|
399
|
+
* `invalid_workflow` (with per-node details), `workflow_format_ui`, `missing_asset`, or `idempotency_key_reuse`.
|
|
400
|
+
*/
|
|
401
|
+
422: ErrorEnvelope;
|
|
402
|
+
/**
|
|
403
|
+
* `queue_full` — bounded queue depth reached.
|
|
404
|
+
*/
|
|
405
|
+
429: ErrorEnvelope;
|
|
406
|
+
/**
|
|
407
|
+
* `upstream_error` — an unexpected failure reaching or processing the request in this implementation's backing services. The message is always a generic, safe-to-display string; implementation detail (the specific upstream, its error text, transport failures) is never included here — see each implementation's own error-mapping notes. Every operation in this contract can fail this way.
|
|
408
|
+
*/
|
|
409
|
+
500: ErrorEnvelope;
|
|
410
|
+
};
|
|
411
|
+
export type PostJobsError = PostJobsErrors[keyof PostJobsErrors];
|
|
412
|
+
export type PostJobsResponses = {
|
|
413
|
+
/**
|
|
414
|
+
* Job created and queued.
|
|
415
|
+
*/
|
|
416
|
+
201: Job;
|
|
417
|
+
};
|
|
418
|
+
export type PostJobsResponse = PostJobsResponses[keyof PostJobsResponses];
|
|
419
|
+
export type GetJobData = {
|
|
420
|
+
body?: never;
|
|
421
|
+
path: {
|
|
422
|
+
id: string;
|
|
423
|
+
};
|
|
424
|
+
query?: never;
|
|
425
|
+
url: '/api/v2/jobs/{id}';
|
|
426
|
+
};
|
|
427
|
+
export type GetJobErrors = {
|
|
428
|
+
/**
|
|
429
|
+
* `unauthorized` — missing or invalid credentials.
|
|
430
|
+
*/
|
|
431
|
+
401: ErrorEnvelope;
|
|
432
|
+
/**
|
|
433
|
+
* `forbidden` — authenticated but not allowed.
|
|
434
|
+
*/
|
|
435
|
+
403: ErrorEnvelope;
|
|
436
|
+
/**
|
|
437
|
+
* `not_found`.
|
|
438
|
+
*/
|
|
439
|
+
404: ErrorEnvelope;
|
|
440
|
+
/**
|
|
441
|
+
* `upstream_error` — an unexpected failure reaching or processing the request in this implementation's backing services. The message is always a generic, safe-to-display string; implementation detail (the specific upstream, its error text, transport failures) is never included here — see each implementation's own error-mapping notes. Every operation in this contract can fail this way.
|
|
442
|
+
*/
|
|
443
|
+
500: ErrorEnvelope;
|
|
444
|
+
};
|
|
445
|
+
export type GetJobError = GetJobErrors[keyof GetJobErrors];
|
|
446
|
+
export type GetJobResponses = {
|
|
447
|
+
/**
|
|
448
|
+
* The job.
|
|
449
|
+
*/
|
|
450
|
+
200: Job;
|
|
451
|
+
};
|
|
452
|
+
export type GetJobResponse = GetJobResponses[keyof GetJobResponses];
|
|
453
|
+
export type GetJobEventsData = {
|
|
454
|
+
body?: never;
|
|
455
|
+
path: {
|
|
456
|
+
id: string;
|
|
457
|
+
};
|
|
458
|
+
query?: never;
|
|
459
|
+
url: '/api/v2/jobs/{id}/events';
|
|
460
|
+
};
|
|
461
|
+
export type GetJobEventsErrors = {
|
|
462
|
+
/**
|
|
463
|
+
* `unauthorized` — missing or invalid credentials.
|
|
464
|
+
*/
|
|
465
|
+
401: ErrorEnvelope;
|
|
466
|
+
/**
|
|
467
|
+
* `forbidden` — authenticated but not allowed.
|
|
468
|
+
*/
|
|
469
|
+
403: ErrorEnvelope;
|
|
470
|
+
/**
|
|
471
|
+
* `not_found`.
|
|
472
|
+
*/
|
|
473
|
+
404: ErrorEnvelope;
|
|
474
|
+
/**
|
|
475
|
+
* `too_many_streams` — the caller already has the maximum number of concurrent GET .../events streams open. Close an existing stream (or wait for one to reach a terminal status) before opening another; GET /api/v2/jobs/{id} remains available as a plain poll regardless of this limit.
|
|
476
|
+
*/
|
|
477
|
+
429: ErrorEnvelope;
|
|
478
|
+
/**
|
|
479
|
+
* `upstream_error` — an unexpected failure reaching or processing the request in this implementation's backing services. The message is always a generic, safe-to-display string; implementation detail (the specific upstream, its error text, transport failures) is never included here — see each implementation's own error-mapping notes. Every operation in this contract can fail this way.
|
|
480
|
+
*/
|
|
481
|
+
500: ErrorEnvelope;
|
|
482
|
+
/**
|
|
483
|
+
* `not_implemented` — this deployment does not yet serve live event streaming. GET /api/v2/jobs/{id} remains available as a plain poll in the meantime.
|
|
484
|
+
*/
|
|
485
|
+
501: ErrorEnvelope;
|
|
486
|
+
};
|
|
487
|
+
export type GetJobEventsError = GetJobEventsErrors[keyof GetJobEventsErrors];
|
|
488
|
+
export type GetJobEventsResponses = {
|
|
489
|
+
/**
|
|
490
|
+
* Stream of `event:`/`data:` frames. Data payloads are the JSON schemas listed in x-sse-events.
|
|
491
|
+
*/
|
|
492
|
+
200: string;
|
|
493
|
+
};
|
|
494
|
+
export type GetJobEventsResponse = GetJobEventsResponses[keyof GetJobEventsResponses];
|
|
495
|
+
export type CancelJobData = {
|
|
496
|
+
body?: never;
|
|
497
|
+
path: {
|
|
498
|
+
id: string;
|
|
499
|
+
};
|
|
500
|
+
query?: never;
|
|
501
|
+
url: '/api/v2/jobs/{id}/cancel';
|
|
502
|
+
};
|
|
503
|
+
export type CancelJobErrors = {
|
|
504
|
+
/**
|
|
505
|
+
* `unauthorized` — missing or invalid credentials.
|
|
506
|
+
*/
|
|
507
|
+
401: ErrorEnvelope;
|
|
508
|
+
/**
|
|
509
|
+
* `forbidden` — authenticated but not allowed.
|
|
510
|
+
*/
|
|
511
|
+
403: ErrorEnvelope;
|
|
512
|
+
/**
|
|
513
|
+
* `not_found`.
|
|
514
|
+
*/
|
|
515
|
+
404: ErrorEnvelope;
|
|
516
|
+
/**
|
|
517
|
+
* `upstream_error` — an unexpected failure reaching or processing the request in this implementation's backing services. The message is always a generic, safe-to-display string; implementation detail (the specific upstream, its error text, transport failures) is never included here — see each implementation's own error-mapping notes. Every operation in this contract can fail this way.
|
|
518
|
+
*/
|
|
519
|
+
500: ErrorEnvelope;
|
|
520
|
+
};
|
|
521
|
+
export type CancelJobError = CancelJobErrors[keyof CancelJobErrors];
|
|
522
|
+
export type CancelJobResponses = {
|
|
523
|
+
/**
|
|
524
|
+
* Current job state.
|
|
525
|
+
*/
|
|
526
|
+
200: Job;
|
|
527
|
+
};
|
|
528
|
+
export type CancelJobResponse = CancelJobResponses[keyof CancelJobResponses];
|