@cat-factory/contracts 0.132.0 → 0.133.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/dist/public-api.d.ts +85 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +70 -0
- package/dist/public-api.js.map +1 -1
- package/dist/routes/public-api.d.ts +228 -0
- package/dist/routes/public-api.d.ts.map +1 -1
- package/dist/routes/public-api.js +40 -1
- package/dist/routes/public-api.js.map +1 -1
- package/package.json +1 -1
package/dist/public-api.d.ts
CHANGED
|
@@ -54,4 +54,89 @@ export declare const initiativeAcceptedSchema: v.ObjectSchema<{
|
|
|
54
54
|
}, undefined>;
|
|
55
55
|
}, undefined>;
|
|
56
56
|
export type InitiativeAccepted = v.InferOutput<typeof initiativeAcceptedSchema>;
|
|
57
|
+
/**
|
|
58
|
+
* A task's lifecycle status as exposed externally. Mirrors the internal block-status
|
|
59
|
+
* members but is a DECOUPLED public type, so the external contract stays stable if the
|
|
60
|
+
* board ever adds an internal status. Unlike the coarse job status, a board task's real
|
|
61
|
+
* lifecycle status is the useful thing here (`planned` → `in_progress` → `pr_ready`/`done`).
|
|
62
|
+
*/
|
|
63
|
+
export declare const publicTaskStatusSchema: v.PicklistSchema<["planned", "ready", "in_progress", "blocked", "pr_ready", "done"], undefined>;
|
|
64
|
+
export type PublicTaskStatus = v.InferOutput<typeof publicTaskStatusSchema>;
|
|
65
|
+
/** A service (a board service frame) as exposed externally — a small projection of the frame block. */
|
|
66
|
+
export declare const publicServiceSchema: v.ObjectSchema<{
|
|
67
|
+
readonly serviceId: v.StringSchema<undefined>;
|
|
68
|
+
readonly title: v.StringSchema<undefined>;
|
|
69
|
+
readonly description: v.StringSchema<undefined>;
|
|
70
|
+
/** The service's architectural classification (service / frontend / library / …). */
|
|
71
|
+
readonly type: v.PicklistSchema<["frontend", "service", "library", "document", "api", "database", "queue", "integration", "external", "environment"], undefined>;
|
|
72
|
+
readonly status: v.PicklistSchema<["planned", "ready", "in_progress", "blocked", "pr_ready", "done"], undefined>;
|
|
73
|
+
}, undefined>;
|
|
74
|
+
export type PublicService = v.InferOutput<typeof publicServiceSchema>;
|
|
75
|
+
export declare const publicServiceListSchema: v.ObjectSchema<{
|
|
76
|
+
readonly services: v.ArraySchema<v.ObjectSchema<{
|
|
77
|
+
readonly serviceId: v.StringSchema<undefined>;
|
|
78
|
+
readonly title: v.StringSchema<undefined>;
|
|
79
|
+
readonly description: v.StringSchema<undefined>;
|
|
80
|
+
/** The service's architectural classification (service / frontend / library / …). */
|
|
81
|
+
readonly type: v.PicklistSchema<["frontend", "service", "library", "document", "api", "database", "queue", "integration", "external", "environment"], undefined>;
|
|
82
|
+
readonly status: v.PicklistSchema<["planned", "ready", "in_progress", "blocked", "pr_ready", "done"], undefined>;
|
|
83
|
+
}, undefined>, undefined>;
|
|
84
|
+
}, undefined>;
|
|
85
|
+
export type PublicServiceList = v.InferOutput<typeof publicServiceListSchema>;
|
|
86
|
+
/** A board task as exposed externally — a small projection of the task block. */
|
|
87
|
+
export declare const publicTaskSchema: v.ObjectSchema<{
|
|
88
|
+
readonly taskId: v.StringSchema<undefined>;
|
|
89
|
+
/** The enclosing service frame this task belongs to. */
|
|
90
|
+
readonly serviceId: v.StringSchema<undefined>;
|
|
91
|
+
readonly title: v.StringSchema<undefined>;
|
|
92
|
+
readonly description: v.StringSchema<undefined>;
|
|
93
|
+
readonly taskType: v.PicklistSchema<["feature", "bug", "document", "spike", "review", "recurring"], undefined>;
|
|
94
|
+
readonly status: v.PicklistSchema<["planned", "ready", "in_progress", "blocked", "pr_ready", "done"], undefined>;
|
|
95
|
+
/** 0..1 progress of the task's current run; 0 when not started. */
|
|
96
|
+
readonly progress: v.NumberSchema<undefined>;
|
|
97
|
+
/** The live run's id once the task has been started; null while `planned`. */
|
|
98
|
+
readonly executionId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
99
|
+
/** The web URL of the PR the run opened, once one exists; null otherwise. */
|
|
100
|
+
readonly pullRequestUrl: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
101
|
+
}, undefined>;
|
|
102
|
+
export type PublicTask = v.InferOutput<typeof publicTaskSchema>;
|
|
103
|
+
export declare const publicTaskListSchema: v.ObjectSchema<{
|
|
104
|
+
readonly tasks: v.ArraySchema<v.ObjectSchema<{
|
|
105
|
+
readonly taskId: v.StringSchema<undefined>;
|
|
106
|
+
/** The enclosing service frame this task belongs to. */
|
|
107
|
+
readonly serviceId: v.StringSchema<undefined>;
|
|
108
|
+
readonly title: v.StringSchema<undefined>;
|
|
109
|
+
readonly description: v.StringSchema<undefined>;
|
|
110
|
+
readonly taskType: v.PicklistSchema<["feature", "bug", "document", "spike", "review", "recurring"], undefined>;
|
|
111
|
+
readonly status: v.PicklistSchema<["planned", "ready", "in_progress", "blocked", "pr_ready", "done"], undefined>;
|
|
112
|
+
/** 0..1 progress of the task's current run; 0 when not started. */
|
|
113
|
+
readonly progress: v.NumberSchema<undefined>;
|
|
114
|
+
/** The live run's id once the task has been started; null while `planned`. */
|
|
115
|
+
readonly executionId: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
116
|
+
/** The web URL of the PR the run opened, once one exists; null otherwise. */
|
|
117
|
+
readonly pullRequestUrl: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
118
|
+
}, undefined>, undefined>;
|
|
119
|
+
}, undefined>;
|
|
120
|
+
export type PublicTaskList = v.InferOutput<typeof publicTaskListSchema>;
|
|
121
|
+
/**
|
|
122
|
+
* Create a task under a service. A deliberately MINIMAL external input mapped onto the
|
|
123
|
+
* internal `AddTaskInput` — it exposes only title/description/taskType, not the rich
|
|
124
|
+
* internal knobs (risk/model presets, pinned pipeline, agent config), so the public
|
|
125
|
+
* surface stays small and stable.
|
|
126
|
+
*/
|
|
127
|
+
export declare const createPublicTaskSchema: v.ObjectSchema<{
|
|
128
|
+
readonly title: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
|
|
129
|
+
readonly description: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 2000, undefined>]>, undefined>;
|
|
130
|
+
/** The kind of work; omitted → `feature`. `recurring` is not creatable here. */
|
|
131
|
+
readonly taskType: v.OptionalSchema<v.PicklistSchema<["feature", "bug", "document", "spike", "review"], undefined>, undefined>;
|
|
132
|
+
}, undefined>;
|
|
133
|
+
export type CreatePublicTaskInput = v.InferOutput<typeof createPublicTaskSchema>;
|
|
134
|
+
/**
|
|
135
|
+
* Start (run) a task. `pipelineId` is optional — it falls back to the task's pinned
|
|
136
|
+
* pipeline; a task with neither is rejected with `pipeline_required`.
|
|
137
|
+
*/
|
|
138
|
+
export declare const startPublicTaskSchema: v.ObjectSchema<{
|
|
139
|
+
readonly pipelineId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 120, undefined>]>, undefined>;
|
|
140
|
+
}, undefined>;
|
|
141
|
+
export type StartPublicTaskInput = v.InferOutput<typeof startPublicTaskSchema>;
|
|
57
142
|
//# sourceMappingURL=public-api.d.ts.map
|
package/dist/public-api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAmB5B,+BAA+B;AAC/B,eAAO,MAAM,yBAAyB;IACpC,wEAAwE;;IAExE,iEAAiE;;IAEjE,kFAAkF;;aAElF,CAAA;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,WAAW,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6EAA6E;;aAE7E,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAE/D,eAAO,MAAM,oBAAoB;;;QAf/B,wDAAwD;;;;;;QAMxD,mEAAmE;;QAEnE,8EAA8E;;QAE9E,6EAA6E;;;aAKG,CAAA;AAClF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEvE;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB;;;IAGjC,gFAAgF;;aAEhF,CAAA;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAEhF;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;aAEhC,CAAA;AACF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,qBAAqB,CAAC,CAAA"}
|
package/dist/public-api.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
+
import { blockTypeSchema, createTaskTypeSchema, taskTypeSchema } from './primitives.js';
|
|
2
3
|
// ---------------------------------------------------------------------------
|
|
3
4
|
// Public-API wire contracts (the `/api/v1` surface for external systems).
|
|
4
5
|
//
|
|
@@ -7,6 +8,12 @@ import * as v from 'valibot';
|
|
|
7
8
|
// headlessly and persists the result in the DB for asynchronous retrieval (poll
|
|
8
9
|
// `GET /jobs/:id` or subscribe to `GET /jobs/:id/events` over SSE). Nothing is
|
|
9
10
|
// committed to GitHub.
|
|
11
|
+
//
|
|
12
|
+
// Second use-case: "basic board workloads". A key holder lists the workspace's
|
|
13
|
+
// services, creates a task under one, starts it, and follows its status — the
|
|
14
|
+
// external counterparts of the SPA's board operations, scoped to the key's
|
|
15
|
+
// workspace (see the `publicTask` / `publicService` resources below). Board/engine
|
|
16
|
+
// internals are never leaked: these are deliberately small projections of a `Block`.
|
|
10
17
|
// ---------------------------------------------------------------------------
|
|
11
18
|
/** Start an initiative run. */
|
|
12
19
|
export const createInitiativeJobSchema = v.object({
|
|
@@ -47,4 +54,67 @@ export const initiativeAcceptedSchema = v.object({
|
|
|
47
54
|
status: publicJobStatusSchema,
|
|
48
55
|
links: v.object({ self: v.string(), events: v.string() }),
|
|
49
56
|
});
|
|
57
|
+
// ---------------------------------------------------------------------------
|
|
58
|
+
// Basic board workloads: services + tasks.
|
|
59
|
+
// ---------------------------------------------------------------------------
|
|
60
|
+
/**
|
|
61
|
+
* A task's lifecycle status as exposed externally. Mirrors the internal block-status
|
|
62
|
+
* members but is a DECOUPLED public type, so the external contract stays stable if the
|
|
63
|
+
* board ever adds an internal status. Unlike the coarse job status, a board task's real
|
|
64
|
+
* lifecycle status is the useful thing here (`planned` → `in_progress` → `pr_ready`/`done`).
|
|
65
|
+
*/
|
|
66
|
+
export const publicTaskStatusSchema = v.picklist([
|
|
67
|
+
'planned',
|
|
68
|
+
'ready',
|
|
69
|
+
'in_progress',
|
|
70
|
+
'blocked',
|
|
71
|
+
'pr_ready',
|
|
72
|
+
'done',
|
|
73
|
+
]);
|
|
74
|
+
/** A service (a board service frame) as exposed externally — a small projection of the frame block. */
|
|
75
|
+
export const publicServiceSchema = v.object({
|
|
76
|
+
serviceId: v.string(),
|
|
77
|
+
title: v.string(),
|
|
78
|
+
description: v.string(),
|
|
79
|
+
/** The service's architectural classification (service / frontend / library / …). */
|
|
80
|
+
type: blockTypeSchema,
|
|
81
|
+
status: publicTaskStatusSchema,
|
|
82
|
+
});
|
|
83
|
+
export const publicServiceListSchema = v.object({ services: v.array(publicServiceSchema) });
|
|
84
|
+
/** A board task as exposed externally — a small projection of the task block. */
|
|
85
|
+
export const publicTaskSchema = v.object({
|
|
86
|
+
taskId: v.string(),
|
|
87
|
+
/** The enclosing service frame this task belongs to. */
|
|
88
|
+
serviceId: v.string(),
|
|
89
|
+
title: v.string(),
|
|
90
|
+
description: v.string(),
|
|
91
|
+
taskType: taskTypeSchema,
|
|
92
|
+
status: publicTaskStatusSchema,
|
|
93
|
+
/** 0..1 progress of the task's current run; 0 when not started. */
|
|
94
|
+
progress: v.number(),
|
|
95
|
+
/** The live run's id once the task has been started; null while `planned`. */
|
|
96
|
+
executionId: v.nullable(v.string()),
|
|
97
|
+
/** The web URL of the PR the run opened, once one exists; null otherwise. */
|
|
98
|
+
pullRequestUrl: v.nullable(v.string()),
|
|
99
|
+
});
|
|
100
|
+
export const publicTaskListSchema = v.object({ tasks: v.array(publicTaskSchema) });
|
|
101
|
+
/**
|
|
102
|
+
* Create a task under a service. A deliberately MINIMAL external input mapped onto the
|
|
103
|
+
* internal `AddTaskInput` — it exposes only title/description/taskType, not the rich
|
|
104
|
+
* internal knobs (risk/model presets, pinned pipeline, agent config), so the public
|
|
105
|
+
* surface stays small and stable.
|
|
106
|
+
*/
|
|
107
|
+
export const createPublicTaskSchema = v.object({
|
|
108
|
+
title: v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(200)),
|
|
109
|
+
description: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(2000))),
|
|
110
|
+
/** The kind of work; omitted → `feature`. `recurring` is not creatable here. */
|
|
111
|
+
taskType: v.optional(createTaskTypeSchema),
|
|
112
|
+
});
|
|
113
|
+
/**
|
|
114
|
+
* Start (run) a task. `pipelineId` is optional — it falls back to the task's pinned
|
|
115
|
+
* pipeline; a task with neither is rejected with `pipeline_required`.
|
|
116
|
+
*/
|
|
117
|
+
export const startPublicTaskSchema = v.object({
|
|
118
|
+
pipelineId: v.optional(v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(120))),
|
|
119
|
+
});
|
|
50
120
|
//# sourceMappingURL=public-api.js.map
|
package/dist/public-api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-api.js","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;
|
|
1
|
+
{"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,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACrE,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACxE,gFAAgF;IAChF,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,oBAAoB,CAAC;CAC3C,CAAC,CAAA;AAGF;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;CACvF,CAAC,CAAA"}
|
|
@@ -203,4 +203,232 @@ export declare const getPublicJobContract: {
|
|
|
203
203
|
}, undefined>;
|
|
204
204
|
};
|
|
205
205
|
};
|
|
206
|
+
/** List the workspace's services (board service frames). */
|
|
207
|
+
export declare const listPublicServicesContract: {
|
|
208
|
+
readonly method: "get";
|
|
209
|
+
readonly pathResolver: () => string;
|
|
210
|
+
readonly responsesByStatusCode: {
|
|
211
|
+
readonly '4xx': import("valibot").ObjectSchema<{
|
|
212
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
213
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
214
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
215
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
216
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
217
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
218
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
219
|
+
}, undefined>, undefined>, undefined>;
|
|
220
|
+
}, undefined>;
|
|
221
|
+
}, undefined>;
|
|
222
|
+
readonly '5xx': import("valibot").ObjectSchema<{
|
|
223
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
224
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
225
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
226
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
227
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
228
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
229
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
230
|
+
}, undefined>, undefined>, undefined>;
|
|
231
|
+
}, undefined>;
|
|
232
|
+
}, undefined>;
|
|
233
|
+
readonly 200: import("valibot").ObjectSchema<{
|
|
234
|
+
readonly services: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
235
|
+
readonly serviceId: import("valibot").StringSchema<undefined>;
|
|
236
|
+
readonly title: import("valibot").StringSchema<undefined>;
|
|
237
|
+
readonly description: import("valibot").StringSchema<undefined>;
|
|
238
|
+
readonly type: import("valibot").PicklistSchema<["frontend", "service", "library", "document", "api", "database", "queue", "integration", "external", "environment"], undefined>;
|
|
239
|
+
readonly status: import("valibot").PicklistSchema<["planned", "ready", "in_progress", "blocked", "pr_ready", "done"], undefined>;
|
|
240
|
+
}, undefined>, undefined>;
|
|
241
|
+
}, undefined>;
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
/** Create a task under a service. */
|
|
245
|
+
export declare const createPublicTaskContract: {
|
|
246
|
+
readonly method: "post";
|
|
247
|
+
readonly requestPathParamsSchema: import("valibot").ObjectSchema<{
|
|
248
|
+
serviceId: import("valibot").StringSchema<undefined>;
|
|
249
|
+
}, undefined> & import("@toad-contracts/core").StandardObjectKeysV1<unknown, unknown>;
|
|
250
|
+
readonly pathResolver: ({ serviceId }: {
|
|
251
|
+
serviceId: string;
|
|
252
|
+
}) => string;
|
|
253
|
+
readonly requestBodySchema: import("valibot").ObjectSchema<{
|
|
254
|
+
readonly title: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").TrimAction, import("valibot").MinLengthAction<string, 1, undefined>, import("valibot").MaxLengthAction<string, 200, undefined>]>;
|
|
255
|
+
readonly description: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").TrimAction, import("valibot").MaxLengthAction<string, 2000, undefined>]>, undefined>;
|
|
256
|
+
readonly taskType: import("valibot").OptionalSchema<import("valibot").PicklistSchema<["feature", "bug", "document", "spike", "review"], undefined>, undefined>;
|
|
257
|
+
}, undefined>;
|
|
258
|
+
readonly responsesByStatusCode: {
|
|
259
|
+
readonly '4xx': import("valibot").ObjectSchema<{
|
|
260
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
261
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
262
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
263
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
264
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
265
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
266
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
267
|
+
}, undefined>, undefined>, undefined>;
|
|
268
|
+
}, undefined>;
|
|
269
|
+
}, undefined>;
|
|
270
|
+
readonly '5xx': import("valibot").ObjectSchema<{
|
|
271
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
272
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
273
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
274
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
275
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
276
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
277
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
278
|
+
}, undefined>, undefined>, undefined>;
|
|
279
|
+
}, undefined>;
|
|
280
|
+
}, undefined>;
|
|
281
|
+
readonly 201: import("valibot").ObjectSchema<{
|
|
282
|
+
readonly taskId: import("valibot").StringSchema<undefined>;
|
|
283
|
+
readonly serviceId: import("valibot").StringSchema<undefined>;
|
|
284
|
+
readonly title: import("valibot").StringSchema<undefined>;
|
|
285
|
+
readonly description: import("valibot").StringSchema<undefined>;
|
|
286
|
+
readonly taskType: import("valibot").PicklistSchema<["feature", "bug", "document", "spike", "review", "recurring"], undefined>;
|
|
287
|
+
readonly status: import("valibot").PicklistSchema<["planned", "ready", "in_progress", "blocked", "pr_ready", "done"], undefined>;
|
|
288
|
+
readonly progress: import("valibot").NumberSchema<undefined>;
|
|
289
|
+
readonly executionId: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
290
|
+
readonly pullRequestUrl: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
291
|
+
}, undefined>;
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
/** List a service's tasks (the whole subtree — tasks under the frame and its modules). */
|
|
295
|
+
export declare const listPublicServiceTasksContract: {
|
|
296
|
+
readonly method: "get";
|
|
297
|
+
readonly requestPathParamsSchema: import("valibot").ObjectSchema<{
|
|
298
|
+
serviceId: import("valibot").StringSchema<undefined>;
|
|
299
|
+
}, undefined> & import("@toad-contracts/core").StandardObjectKeysV1<unknown, unknown>;
|
|
300
|
+
readonly pathResolver: ({ serviceId }: {
|
|
301
|
+
serviceId: string;
|
|
302
|
+
}) => string;
|
|
303
|
+
readonly responsesByStatusCode: {
|
|
304
|
+
readonly '4xx': import("valibot").ObjectSchema<{
|
|
305
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
306
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
307
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
308
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
309
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
310
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
311
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
312
|
+
}, undefined>, undefined>, undefined>;
|
|
313
|
+
}, undefined>;
|
|
314
|
+
}, undefined>;
|
|
315
|
+
readonly '5xx': import("valibot").ObjectSchema<{
|
|
316
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
317
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
318
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
319
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
320
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
321
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
322
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
323
|
+
}, undefined>, undefined>, undefined>;
|
|
324
|
+
}, undefined>;
|
|
325
|
+
}, undefined>;
|
|
326
|
+
readonly 200: import("valibot").ObjectSchema<{
|
|
327
|
+
readonly tasks: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
328
|
+
readonly taskId: import("valibot").StringSchema<undefined>;
|
|
329
|
+
readonly serviceId: import("valibot").StringSchema<undefined>;
|
|
330
|
+
readonly title: import("valibot").StringSchema<undefined>;
|
|
331
|
+
readonly description: import("valibot").StringSchema<undefined>;
|
|
332
|
+
readonly taskType: import("valibot").PicklistSchema<["feature", "bug", "document", "spike", "review", "recurring"], undefined>;
|
|
333
|
+
readonly status: import("valibot").PicklistSchema<["planned", "ready", "in_progress", "blocked", "pr_ready", "done"], undefined>;
|
|
334
|
+
readonly progress: import("valibot").NumberSchema<undefined>;
|
|
335
|
+
readonly executionId: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
336
|
+
readonly pullRequestUrl: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
337
|
+
}, undefined>, undefined>;
|
|
338
|
+
}, undefined>;
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
/** Get a task's status. */
|
|
342
|
+
export declare const getPublicTaskContract: {
|
|
343
|
+
readonly method: "get";
|
|
344
|
+
readonly requestPathParamsSchema: import("valibot").ObjectSchema<{
|
|
345
|
+
taskId: import("valibot").StringSchema<undefined>;
|
|
346
|
+
}, undefined> & import("@toad-contracts/core").StandardObjectKeysV1<unknown, unknown>;
|
|
347
|
+
readonly pathResolver: ({ taskId }: {
|
|
348
|
+
taskId: string;
|
|
349
|
+
}) => string;
|
|
350
|
+
readonly responsesByStatusCode: {
|
|
351
|
+
readonly '4xx': import("valibot").ObjectSchema<{
|
|
352
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
353
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
354
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
355
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
356
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
357
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
358
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
359
|
+
}, undefined>, undefined>, undefined>;
|
|
360
|
+
}, undefined>;
|
|
361
|
+
}, undefined>;
|
|
362
|
+
readonly '5xx': import("valibot").ObjectSchema<{
|
|
363
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
364
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
365
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
366
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
367
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
368
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
369
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
370
|
+
}, undefined>, undefined>, undefined>;
|
|
371
|
+
}, undefined>;
|
|
372
|
+
}, undefined>;
|
|
373
|
+
readonly 200: import("valibot").ObjectSchema<{
|
|
374
|
+
readonly taskId: import("valibot").StringSchema<undefined>;
|
|
375
|
+
readonly serviceId: import("valibot").StringSchema<undefined>;
|
|
376
|
+
readonly title: import("valibot").StringSchema<undefined>;
|
|
377
|
+
readonly description: import("valibot").StringSchema<undefined>;
|
|
378
|
+
readonly taskType: import("valibot").PicklistSchema<["feature", "bug", "document", "spike", "review", "recurring"], undefined>;
|
|
379
|
+
readonly status: import("valibot").PicklistSchema<["planned", "ready", "in_progress", "blocked", "pr_ready", "done"], undefined>;
|
|
380
|
+
readonly progress: import("valibot").NumberSchema<undefined>;
|
|
381
|
+
readonly executionId: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
382
|
+
readonly pullRequestUrl: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
383
|
+
}, undefined>;
|
|
384
|
+
};
|
|
385
|
+
};
|
|
386
|
+
/** Start (run) a task. */
|
|
387
|
+
export declare const startPublicTaskContract: {
|
|
388
|
+
readonly method: "post";
|
|
389
|
+
readonly requestPathParamsSchema: import("valibot").ObjectSchema<{
|
|
390
|
+
taskId: import("valibot").StringSchema<undefined>;
|
|
391
|
+
}, undefined> & import("@toad-contracts/core").StandardObjectKeysV1<unknown, unknown>;
|
|
392
|
+
readonly pathResolver: ({ taskId }: {
|
|
393
|
+
taskId: string;
|
|
394
|
+
}) => string;
|
|
395
|
+
readonly requestBodySchema: import("valibot").ObjectSchema<{
|
|
396
|
+
readonly pipelineId: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").TrimAction, import("valibot").MinLengthAction<string, 1, undefined>, import("valibot").MaxLengthAction<string, 120, undefined>]>, undefined>;
|
|
397
|
+
}, undefined>;
|
|
398
|
+
readonly responsesByStatusCode: {
|
|
399
|
+
readonly '4xx': import("valibot").ObjectSchema<{
|
|
400
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
401
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
402
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
403
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
404
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
405
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
406
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
407
|
+
}, undefined>, undefined>, undefined>;
|
|
408
|
+
}, undefined>;
|
|
409
|
+
}, undefined>;
|
|
410
|
+
readonly '5xx': import("valibot").ObjectSchema<{
|
|
411
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
412
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
413
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
414
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
415
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
416
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
417
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
418
|
+
}, undefined>, undefined>, undefined>;
|
|
419
|
+
}, undefined>;
|
|
420
|
+
}, undefined>;
|
|
421
|
+
readonly 202: import("valibot").ObjectSchema<{
|
|
422
|
+
readonly taskId: import("valibot").StringSchema<undefined>;
|
|
423
|
+
readonly serviceId: import("valibot").StringSchema<undefined>;
|
|
424
|
+
readonly title: import("valibot").StringSchema<undefined>;
|
|
425
|
+
readonly description: import("valibot").StringSchema<undefined>;
|
|
426
|
+
readonly taskType: import("valibot").PicklistSchema<["feature", "bug", "document", "spike", "review", "recurring"], undefined>;
|
|
427
|
+
readonly status: import("valibot").PicklistSchema<["planned", "ready", "in_progress", "blocked", "pr_ready", "done"], undefined>;
|
|
428
|
+
readonly progress: import("valibot").NumberSchema<undefined>;
|
|
429
|
+
readonly executionId: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
430
|
+
readonly pullRequestUrl: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
431
|
+
}, undefined>;
|
|
432
|
+
};
|
|
433
|
+
};
|
|
206
434
|
//# sourceMappingURL=public-api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../../src/routes/public-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqB,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../../src/routes/public-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqB,MAAM,yBAAyB,CAAA;AAoC3E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIpC,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKrC,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKrC,CAAA;AAIF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKtC,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAK/B,CAAA;AAIF,4DAA4D;AAC5D,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIrC,CAAA;AAEF,qCAAqC;AACrC,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMnC,CAAA;AAEF,0FAA0F;AAC1F,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKzC,CAAA;AAEF,2BAA2B;AAC3B,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKhC,CAAA;AAEF,0BAA0B;AAC1B,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMlC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ContractNoBody, defineApiContract } from '@toad-contracts/valibot';
|
|
2
2
|
import { createPublicApiKeySchema, createdPublicApiKeySchema, publicApiKeyListResultSchema, } from '../public-api-keys.js';
|
|
3
|
-
import { createInitiativeJobSchema, initiativeAcceptedSchema, publicJobSchema, } from '../public-api.js';
|
|
3
|
+
import { createInitiativeJobSchema, createPublicTaskSchema, initiativeAcceptedSchema, publicJobSchema, publicServiceListSchema, publicTaskListSchema, publicTaskSchema, startPublicTaskSchema, } from '../public-api.js';
|
|
4
4
|
import { errorResponses, singleStringParam } from './_shared.js';
|
|
5
5
|
// ---------------------------------------------------------------------------
|
|
6
6
|
// Public-API route contracts. Two surfaces:
|
|
@@ -14,6 +14,8 @@ import { errorResponses, singleStringParam } from './_shared.js';
|
|
|
14
14
|
// public-API key (not the session gate), scoped to the key's workspace.
|
|
15
15
|
// ---------------------------------------------------------------------------
|
|
16
16
|
const idParams = singleStringParam('id');
|
|
17
|
+
const serviceIdParams = singleStringParam('serviceId');
|
|
18
|
+
const taskIdParams = singleStringParam('taskId');
|
|
17
19
|
// ---- key management (relative to `/workspaces/:workspaceId`) ---------------
|
|
18
20
|
export const listPublicApiKeysContract = defineApiContract({
|
|
19
21
|
method: 'get',
|
|
@@ -45,4 +47,41 @@ export const getPublicJobContract = defineApiContract({
|
|
|
45
47
|
pathResolver: ({ id }) => `/api/v1/jobs/${id}`,
|
|
46
48
|
responsesByStatusCode: { 200: publicJobSchema, ...errorResponses },
|
|
47
49
|
});
|
|
50
|
+
// ---- basic board workloads: services + tasks (key-authenticated) -----------
|
|
51
|
+
/** List the workspace's services (board service frames). */
|
|
52
|
+
export const listPublicServicesContract = defineApiContract({
|
|
53
|
+
method: 'get',
|
|
54
|
+
pathResolver: () => '/api/v1/services',
|
|
55
|
+
responsesByStatusCode: { 200: publicServiceListSchema, ...errorResponses },
|
|
56
|
+
});
|
|
57
|
+
/** Create a task under a service. */
|
|
58
|
+
export const createPublicTaskContract = defineApiContract({
|
|
59
|
+
method: 'post',
|
|
60
|
+
requestPathParamsSchema: serviceIdParams,
|
|
61
|
+
pathResolver: ({ serviceId }) => `/api/v1/services/${serviceId}/tasks`,
|
|
62
|
+
requestBodySchema: createPublicTaskSchema,
|
|
63
|
+
responsesByStatusCode: { 201: publicTaskSchema, ...errorResponses },
|
|
64
|
+
});
|
|
65
|
+
/** List a service's tasks (the whole subtree — tasks under the frame and its modules). */
|
|
66
|
+
export const listPublicServiceTasksContract = defineApiContract({
|
|
67
|
+
method: 'get',
|
|
68
|
+
requestPathParamsSchema: serviceIdParams,
|
|
69
|
+
pathResolver: ({ serviceId }) => `/api/v1/services/${serviceId}/tasks`,
|
|
70
|
+
responsesByStatusCode: { 200: publicTaskListSchema, ...errorResponses },
|
|
71
|
+
});
|
|
72
|
+
/** Get a task's status. */
|
|
73
|
+
export const getPublicTaskContract = defineApiContract({
|
|
74
|
+
method: 'get',
|
|
75
|
+
requestPathParamsSchema: taskIdParams,
|
|
76
|
+
pathResolver: ({ taskId }) => `/api/v1/tasks/${taskId}`,
|
|
77
|
+
responsesByStatusCode: { 200: publicTaskSchema, ...errorResponses },
|
|
78
|
+
});
|
|
79
|
+
/** Start (run) a task. */
|
|
80
|
+
export const startPublicTaskContract = defineApiContract({
|
|
81
|
+
method: 'post',
|
|
82
|
+
requestPathParamsSchema: taskIdParams,
|
|
83
|
+
pathResolver: ({ taskId }) => `/api/v1/tasks/${taskId}/start`,
|
|
84
|
+
requestBodySchema: startPublicTaskSchema,
|
|
85
|
+
responsesByStatusCode: { 202: publicTaskSchema, ...errorResponses },
|
|
86
|
+
});
|
|
48
87
|
//# sourceMappingURL=public-api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-api.js","sourceRoot":"","sources":["../../src/routes/public-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,eAAe,
|
|
1
|
+
{"version":3,"file":"public-api.js","sourceRoot":"","sources":["../../src/routes/public-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EACxB,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,kBAAkB,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