@cat-factory/contracts 0.303.0 → 0.304.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.
|
@@ -122,6 +122,64 @@ export declare const createPublicServiceContract: {
|
|
|
122
122
|
} & {
|
|
123
123
|
readonly minScope: "admin";
|
|
124
124
|
};
|
|
125
|
+
/**
|
|
126
|
+
* Delete a board service, its whole subtree and the run history under it: the inverse of the
|
|
127
|
+
* create, and the act a headless deployment could not perform at all.
|
|
128
|
+
*
|
|
129
|
+
* The one board write whose absence forced a browser. Tearing a service down is ordinary
|
|
130
|
+
* housekeeping for a caller that provisions boards (an environment rebuilt per test pass, a
|
|
131
|
+
* repository retired, a frame raised against the wrong repository), and until this endpoint the
|
|
132
|
+
* only door was the app's own, which no API key can reach: a key authenticates on `/api/v1`
|
|
133
|
+
* alone. So a caller could create a service, fill it with work, and then had to ask a person to
|
|
134
|
+
* clean it up.
|
|
135
|
+
*
|
|
136
|
+
* Delegates to the SAME teardown-then-remove sequence the app's delete uses, guard included: a
|
|
137
|
+
* service holding UNFINISHED tasks is refused (422, `reason: 'service_has_unfinished_tasks'`)
|
|
138
|
+
* rather than discarding in-flight work, so a caller that means it deletes those tasks first
|
|
139
|
+
* (`DELETE /api/v1/tasks/{taskId}`, which stops a live run) and calls this again. `admin`, like
|
|
140
|
+
* every destructive operation here.
|
|
141
|
+
*
|
|
142
|
+
* The frame is resolved on exactly the population `GET /api/v1/services` reports, so an ARCHIVED
|
|
143
|
+
* one is a 404 here as it is absent there: archiving is the app's non-destructive alternative to
|
|
144
|
+
* this call, and a surface that published neither the archive nor the restore has no business
|
|
145
|
+
* deleting through one.
|
|
146
|
+
*/
|
|
147
|
+
export declare const deletePublicServiceContract: {
|
|
148
|
+
readonly method: "delete";
|
|
149
|
+
readonly requestPathParamsSchema: import("valibot").ObjectSchema<{
|
|
150
|
+
serviceId: import("valibot").StringSchema<undefined>;
|
|
151
|
+
}, undefined> & import("@toad-contracts/core").StandardObjectKeysV1<unknown, unknown>;
|
|
152
|
+
readonly pathResolver: ({ serviceId }: {
|
|
153
|
+
serviceId: string;
|
|
154
|
+
}) => string;
|
|
155
|
+
readonly responsesByStatusCode: {
|
|
156
|
+
readonly '4xx': import("valibot").ObjectSchema<{
|
|
157
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
158
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
159
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
160
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
161
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
162
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
163
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
164
|
+
}, undefined>, undefined>, undefined>;
|
|
165
|
+
}, undefined>;
|
|
166
|
+
}, undefined>;
|
|
167
|
+
readonly '5xx': import("valibot").ObjectSchema<{
|
|
168
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
169
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
170
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
171
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
172
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
173
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
174
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
175
|
+
}, undefined>, undefined>, undefined>;
|
|
176
|
+
}, undefined>;
|
|
177
|
+
}, undefined>;
|
|
178
|
+
readonly 204: typeof ContractNoBody;
|
|
179
|
+
};
|
|
180
|
+
} & {
|
|
181
|
+
readonly minScope: "admin";
|
|
182
|
+
};
|
|
125
183
|
/**
|
|
126
184
|
* Declare that this task must wait for another one. Idempotent: an edge that already exists is
|
|
127
185
|
* returned as-is rather than toggled off, which is what separates this from the app's own toggle
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-board.d.ts","sourceRoot":"","sources":["../../src/routes/public-board.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqB,MAAM,yBAAyB,CAAA;AAsC3E;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOnC,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQvC,CAAA;AAID;;;;GAIG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAS3C,CAAA;AAED,0EAA0E;AAC1E,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAS9C,CAAA;AAID,wFAAwF;AACxF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQ3C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAS5C,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAS5C,CAAA"}
|
|
1
|
+
{"version":3,"file":"public-board.d.ts","sourceRoot":"","sources":["../../src/routes/public-board.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqB,MAAM,yBAAyB,CAAA;AAsC3E;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOnC,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQvC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQvC,CAAA;AAID;;;;GAIG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAS3C,CAAA;AAED,0EAA0E;AAC1E,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAS9C,CAAA;AAID,wFAAwF;AACxF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQ3C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAS5C,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAS5C,CAAA"}
|
|
@@ -10,7 +10,7 @@ import { errorResponses, singleStringParam, withMinScope } from './_shared.js';
|
|
|
10
10
|
// it drives, as opposed to what it needs to run one task) and they share a scope argument that is
|
|
11
11
|
// worth stating once.
|
|
12
12
|
//
|
|
13
|
-
// **Scope.**
|
|
13
|
+
// **Scope.** Creating and deleting a service are `admin`; the task-level writes are `write`.
|
|
14
14
|
//
|
|
15
15
|
// The split follows what each act CHANGES rather than how destructive it feels. Creating a service
|
|
16
16
|
// is board STRUCTURE, which is what `admin` already covers on this surface for keys and the
|
|
@@ -54,6 +54,34 @@ export const createPublicServiceContract = withMinScope('admin', defineApiContra
|
|
|
54
54
|
requestBodySchema: createPublicServiceSchema,
|
|
55
55
|
responsesByStatusCode: { 201: publicServiceSchema, ...errorResponses },
|
|
56
56
|
}));
|
|
57
|
+
/**
|
|
58
|
+
* Delete a board service, its whole subtree and the run history under it: the inverse of the
|
|
59
|
+
* create, and the act a headless deployment could not perform at all.
|
|
60
|
+
*
|
|
61
|
+
* The one board write whose absence forced a browser. Tearing a service down is ordinary
|
|
62
|
+
* housekeeping for a caller that provisions boards (an environment rebuilt per test pass, a
|
|
63
|
+
* repository retired, a frame raised against the wrong repository), and until this endpoint the
|
|
64
|
+
* only door was the app's own, which no API key can reach: a key authenticates on `/api/v1`
|
|
65
|
+
* alone. So a caller could create a service, fill it with work, and then had to ask a person to
|
|
66
|
+
* clean it up.
|
|
67
|
+
*
|
|
68
|
+
* Delegates to the SAME teardown-then-remove sequence the app's delete uses, guard included: a
|
|
69
|
+
* service holding UNFINISHED tasks is refused (422, `reason: 'service_has_unfinished_tasks'`)
|
|
70
|
+
* rather than discarding in-flight work, so a caller that means it deletes those tasks first
|
|
71
|
+
* (`DELETE /api/v1/tasks/{taskId}`, which stops a live run) and calls this again. `admin`, like
|
|
72
|
+
* every destructive operation here.
|
|
73
|
+
*
|
|
74
|
+
* The frame is resolved on exactly the population `GET /api/v1/services` reports, so an ARCHIVED
|
|
75
|
+
* one is a 404 here as it is absent there: archiving is the app's non-destructive alternative to
|
|
76
|
+
* this call, and a surface that published neither the archive nor the restore has no business
|
|
77
|
+
* deleting through one.
|
|
78
|
+
*/
|
|
79
|
+
export const deletePublicServiceContract = withMinScope('admin', defineApiContract({
|
|
80
|
+
method: 'delete',
|
|
81
|
+
requestPathParamsSchema: singleStringParam('serviceId'),
|
|
82
|
+
pathResolver: ({ serviceId }) => `/api/v1/services/${serviceId}`,
|
|
83
|
+
responsesByStatusCode: { 204: ContractNoBody, ...errorResponses },
|
|
84
|
+
}));
|
|
57
85
|
// ---- task ordering ----------------------------------------------------------
|
|
58
86
|
/**
|
|
59
87
|
* Declare that this task must wait for another one. Idempotent: an edge that already exists is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-board.js","sourceRoot":"","sources":["../../src/routes/public-board.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,8BAA8B,EAC9B,gCAAgC,EAChC,4BAA4B,EAC5B,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE9E,8EAA8E;AAC9E,8FAA8F;AAC9F,EAAE;AACF,kGAAkG;AAClG,mGAAmG;AACnG,kGAAkG;AAClG,sBAAsB;AACtB,EAAE;AACF,
|
|
1
|
+
{"version":3,"file":"public-board.js","sourceRoot":"","sources":["../../src/routes/public-board.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,8BAA8B,EAC9B,gCAAgC,EAChC,4BAA4B,EAC5B,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE9E,8EAA8E;AAC9E,8FAA8F;AAC9F,EAAE;AACF,kGAAkG;AAClG,mGAAmG;AACnG,kGAAkG;AAClG,sBAAsB;AACtB,EAAE;AACF,6FAA6F;AAC7F,EAAE;AACF,mGAAmG;AACnG,4FAA4F;AAC5F,4FAA4F;AAC5F,+FAA+F;AAC/F,iGAAiG;AACjG,iF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