@cat-factory/contracts 0.277.0 → 0.279.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/debug-api.d.ts +361 -0
- package/dist/debug-api.d.ts.map +1 -1
- package/dist/debug-api.js +96 -0
- package/dist/debug-api.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/mergeTrackRecord.d.ts +14 -0
- package/dist/mergeTrackRecord.d.ts.map +1 -1
- package/dist/mergeTrackRecord.js +15 -0
- package/dist/mergeTrackRecord.js.map +1 -1
- package/dist/public-merge-evidence.d.ts +94 -0
- package/dist/public-merge-evidence.d.ts.map +1 -0
- package/dist/public-merge-evidence.js +106 -0
- package/dist/public-merge-evidence.js.map +1 -0
- package/dist/public-spend.d.ts +204 -0
- package/dist/public-spend.d.ts.map +1 -0
- package/dist/public-spend.js +207 -0
- package/dist/public-spend.js.map +1 -0
- package/dist/routes/debug-api.d.ts +186 -0
- package/dist/routes/debug-api.d.ts.map +1 -1
- package/dist/routes/debug-api.js +14 -1
- package/dist/routes/debug-api.js.map +1 -1
- package/dist/routes/index.d.ts +1 -0
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +1 -0
- package/dist/routes/index.js.map +1 -1
- package/dist/routes/public-api.d.ts +91 -2
- package/dist/routes/public-api.d.ts.map +1 -1
- package/dist/routes/public-api.js +41 -3
- package/dist/routes/public-api.js.map +1 -1
- package/dist/routes/public-merge-evidence.d.ts +248 -0
- package/dist/routes/public-merge-evidence.d.ts.map +1 -0
- package/dist/routes/public-merge-evidence.js +80 -0
- package/dist/routes/public-merge-evidence.js.map +1 -0
- package/package.json +1 -1
|
@@ -1091,7 +1091,22 @@ export declare const listPublicNotificationsContract: {
|
|
|
1091
1091
|
} & {
|
|
1092
1092
|
readonly minScope: "read";
|
|
1093
1093
|
};
|
|
1094
|
-
/**
|
|
1094
|
+
/**
|
|
1095
|
+
* Act on a notification (run its typed side-effect, then resolve it). Requires an `admin` key.
|
|
1096
|
+
*
|
|
1097
|
+
* All-optional body, matching the session-authed twin (`routes/notifications.ts`): on a
|
|
1098
|
+
* `merge_review` / `pipeline_complete` card, `reviewEffort` records how much review the pull
|
|
1099
|
+
* request needed in the SAME request that confirms the merge, so the app's one-tap
|
|
1100
|
+
* confirm-and-tag has a headless equivalent rather than a two-call approximation of one.
|
|
1101
|
+
*
|
|
1102
|
+
* Additive on every axis. The route mounts `optionalJsonBody`, so a caller that has always sent
|
|
1103
|
+
* no body at all still gets the historical behaviour; the four SDK clients render an all-optional
|
|
1104
|
+
* body as an OMITTABLE parameter, so `act(id)` keeps compiling and `act(id, { reviewEffort })` is
|
|
1105
|
+
* the new form. Tagging LATER through `POST /api/v1/merge-records/:recordId/effort`
|
|
1106
|
+
* (`./public-merge-evidence.ts`) stays the right call for a caller that learns the effort after
|
|
1107
|
+
* the fact, and remains a rung LOWER than this route: tagging a landed pull request merges
|
|
1108
|
+
* nothing, where this merges one for real.
|
|
1109
|
+
*/
|
|
1095
1110
|
export declare const actPublicNotificationContract: {
|
|
1096
1111
|
readonly method: "post";
|
|
1097
1112
|
readonly requestPathParamsSchema: import("valibot").ObjectSchema<{
|
|
@@ -1100,7 +1115,9 @@ export declare const actPublicNotificationContract: {
|
|
|
1100
1115
|
readonly pathResolver: ({ id }: {
|
|
1101
1116
|
id: string;
|
|
1102
1117
|
}) => string;
|
|
1103
|
-
readonly requestBodySchema:
|
|
1118
|
+
readonly requestBodySchema: import("valibot").ObjectSchema<{
|
|
1119
|
+
readonly reviewEffort: import("valibot").OptionalSchema<import("valibot").NullableSchema<import("valibot").PicklistSchema<["none", "minor", "major"], undefined>, undefined>, undefined>;
|
|
1120
|
+
}, undefined>;
|
|
1104
1121
|
readonly responsesByStatusCode: {
|
|
1105
1122
|
readonly '4xx': import("valibot").ObjectSchema<{
|
|
1106
1123
|
readonly error: import("valibot").ObjectSchema<{
|
|
@@ -1412,6 +1429,78 @@ export declare const getPublicUsageContract: {
|
|
|
1412
1429
|
} & {
|
|
1413
1430
|
readonly minScope: "read";
|
|
1414
1431
|
};
|
|
1432
|
+
/**
|
|
1433
|
+
* The workspace's spend over a window, sliced by ONE dimension: the TCO read the period
|
|
1434
|
+
* breakdown above cannot produce: it groups by `(billing, vendor, provider, model)` within the
|
|
1435
|
+
* current calendar month, and carries no board-shape axis at all.
|
|
1436
|
+
*
|
|
1437
|
+
* A sub-resource of `/usage` rather than a surface of its own, because it is the same money
|
|
1438
|
+
* from the same ledger: `/usage` answers the budget question ("what has this period cost, and
|
|
1439
|
+
* are runs paused"), this answers the attribution one ("what did this repository / ticket /
|
|
1440
|
+
* run cost"). Scoped in SQL to the key's own workspace and its account, so `read` is the whole
|
|
1441
|
+
* scope story here too.
|
|
1442
|
+
*/
|
|
1443
|
+
export declare const getPublicSpendContract: {
|
|
1444
|
+
readonly method: "get";
|
|
1445
|
+
readonly pathResolver: () => string;
|
|
1446
|
+
readonly requestQuerySchema: import("valibot").ObjectSchema<{
|
|
1447
|
+
readonly dimension: import("valibot").PicklistSchema<["model", "agentKind", "service", "repo", "taskType", "ticket", "run"], undefined>;
|
|
1448
|
+
readonly window: import("valibot").OptionalSchema<import("valibot").PicklistSchema<["24h", "7d", "30d", "90d"], undefined>, undefined>;
|
|
1449
|
+
readonly limit: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").RegexAction<string, "Must be a whole number">, import("valibot").TransformAction<any, number>, import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 1, undefined>, import("valibot").MaxValueAction<number, 500, undefined>]>, undefined>;
|
|
1450
|
+
}, undefined>;
|
|
1451
|
+
readonly responsesByStatusCode: {
|
|
1452
|
+
readonly '4xx': import("valibot").ObjectSchema<{
|
|
1453
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
1454
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
1455
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
1456
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
1457
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
1458
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
1459
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
1460
|
+
}, undefined>, undefined>, undefined>;
|
|
1461
|
+
}, undefined>;
|
|
1462
|
+
}, undefined>;
|
|
1463
|
+
readonly '5xx': import("valibot").ObjectSchema<{
|
|
1464
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
1465
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
1466
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
1467
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
1468
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
1469
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
1470
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
1471
|
+
}, undefined>, undefined>, undefined>;
|
|
1472
|
+
}, undefined>;
|
|
1473
|
+
}, undefined>;
|
|
1474
|
+
readonly 200: import("valibot").ObjectSchema<{
|
|
1475
|
+
readonly dimension: import("valibot").PicklistSchema<["model", "agentKind", "service", "repo", "taskType", "ticket", "run"], undefined>;
|
|
1476
|
+
readonly window: import("valibot").PicklistSchema<["24h", "7d", "30d", "90d"], undefined>;
|
|
1477
|
+
readonly generatedAt: import("valibot").NumberSchema<undefined>;
|
|
1478
|
+
readonly since: import("valibot").NumberSchema<undefined>;
|
|
1479
|
+
readonly currency: import("valibot").StringSchema<undefined>;
|
|
1480
|
+
readonly source: import("valibot").PicklistSchema<["ledger", "daily-rollup"], undefined>;
|
|
1481
|
+
readonly rolledUpThrough: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
1482
|
+
readonly totals: import("valibot").ObjectSchema<{
|
|
1483
|
+
readonly inputTokens: import("valibot").NumberSchema<undefined>;
|
|
1484
|
+
readonly outputTokens: import("valibot").NumberSchema<undefined>;
|
|
1485
|
+
readonly calls: import("valibot").NumberSchema<undefined>;
|
|
1486
|
+
readonly meteredCost: import("valibot").NumberSchema<undefined>;
|
|
1487
|
+
readonly subscriptionCost: import("valibot").NumberSchema<undefined>;
|
|
1488
|
+
}, undefined>;
|
|
1489
|
+
readonly truncated: import("valibot").BooleanSchema<undefined>;
|
|
1490
|
+
readonly rows: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
1491
|
+
readonly key: import("valibot").StringSchema<undefined>;
|
|
1492
|
+
readonly label: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
1493
|
+
readonly inputTokens: import("valibot").NumberSchema<undefined>;
|
|
1494
|
+
readonly outputTokens: import("valibot").NumberSchema<undefined>;
|
|
1495
|
+
readonly calls: import("valibot").NumberSchema<undefined>;
|
|
1496
|
+
readonly meteredCost: import("valibot").NumberSchema<undefined>;
|
|
1497
|
+
readonly subscriptionCost: import("valibot").NumberSchema<undefined>;
|
|
1498
|
+
}, undefined>, undefined>;
|
|
1499
|
+
}, undefined>;
|
|
1500
|
+
};
|
|
1501
|
+
} & {
|
|
1502
|
+
readonly minScope: "read";
|
|
1503
|
+
};
|
|
1415
1504
|
/** List the workspace's live keys: metadata only; a secret is never readable back. */
|
|
1416
1505
|
export declare const listPublicKeysContract: {
|
|
1417
1506
|
readonly method: "get";
|
|
@@ -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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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CASzC,CAAA;AAED,mDAAmD;AACnD,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAS7C,CAAA;AAID;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOrC,CAAA;AAID;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOlC,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQlC,CAAA;AAaD,sFAAsF;AACtF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOlC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQnC,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQnC,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ContractNoBody, defineApiContract } from '@toad-contracts/valibot';
|
|
2
2
|
import { createHeadlessPublicApiKeySchema, createPublicApiKeySchema, createdPublicApiKeySchema, HEADLESS_KEY_MINT_SCOPE, publicApiKeyListResultSchema, } from '../public-api-keys.js';
|
|
3
|
-
import { notificationSchema } from '../notifications.js';
|
|
3
|
+
import { actNotificationSchema, notificationSchema } from '../notifications.js';
|
|
4
4
|
import { createPublicJobSchema, createPublicTaskSchema, listPublicJobsQuerySchema, listPublicServiceTasksQuerySchema, publicJobAcceptedSchema, publicIdentitySchema, publicJobListSchema, publicJobSchema, publicNotificationListSchema, publicPipelineListSchema, publicRunSchema, publicServiceListSchema, publicTaskListSchema, publicTaskSchema, publicUsageSchema, startPublicTaskSchema, updatePublicTaskSchema, } from '../public-api.js';
|
|
5
|
+
import { publicSpendQuerySchema, publicSpendSchema } from '../public-spend.js';
|
|
5
6
|
import { publicTaskTypeListSchema } from '../public-task-types.js';
|
|
6
7
|
import { errorResponses, singleStringParam, withMinScope } from './_shared.js';
|
|
7
8
|
// ---------------------------------------------------------------------------
|
|
@@ -185,18 +186,38 @@ export const listPublicPipelinesContract = withMinScope('read', defineApiContrac
|
|
|
185
186
|
// (merge a `merge_review` / `pipeline_complete` PR, retry a `ci_failed` / `test_failed`
|
|
186
187
|
// run), `dismiss` waves a card off. `act` performs a real GitHub merge, so it is the
|
|
187
188
|
// top of the scope ladder (`admin`); `dismiss` is `write`; the list is `read`.
|
|
189
|
+
//
|
|
190
|
+
// Recording the reviewer EFFORT a merge took does not sit at that top rung, and is not on this
|
|
191
|
+
// route at all: `POST /api/v1/merge-records/:recordId/effort` (`write`, see
|
|
192
|
+
// `./public-merge-evidence.ts`) is where a headless caller tags a landed pull request, before or
|
|
193
|
+
// after the `act` that merged it.
|
|
188
194
|
/** List the workspace's OPEN notifications (the inbox). */
|
|
189
195
|
export const listPublicNotificationsContract = withMinScope('read', defineApiContract({
|
|
190
196
|
method: 'get',
|
|
191
197
|
pathResolver: () => '/api/v1/notifications',
|
|
192
198
|
responsesByStatusCode: { 200: publicNotificationListSchema, ...errorResponses },
|
|
193
199
|
}));
|
|
194
|
-
/**
|
|
200
|
+
/**
|
|
201
|
+
* Act on a notification (run its typed side-effect, then resolve it). Requires an `admin` key.
|
|
202
|
+
*
|
|
203
|
+
* All-optional body, matching the session-authed twin (`routes/notifications.ts`): on a
|
|
204
|
+
* `merge_review` / `pipeline_complete` card, `reviewEffort` records how much review the pull
|
|
205
|
+
* request needed in the SAME request that confirms the merge, so the app's one-tap
|
|
206
|
+
* confirm-and-tag has a headless equivalent rather than a two-call approximation of one.
|
|
207
|
+
*
|
|
208
|
+
* Additive on every axis. The route mounts `optionalJsonBody`, so a caller that has always sent
|
|
209
|
+
* no body at all still gets the historical behaviour; the four SDK clients render an all-optional
|
|
210
|
+
* body as an OMITTABLE parameter, so `act(id)` keeps compiling and `act(id, { reviewEffort })` is
|
|
211
|
+
* the new form. Tagging LATER through `POST /api/v1/merge-records/:recordId/effort`
|
|
212
|
+
* (`./public-merge-evidence.ts`) stays the right call for a caller that learns the effort after
|
|
213
|
+
* the fact, and remains a rung LOWER than this route: tagging a landed pull request merges
|
|
214
|
+
* nothing, where this merges one for real.
|
|
215
|
+
*/
|
|
195
216
|
export const actPublicNotificationContract = withMinScope('admin', defineApiContract({
|
|
196
217
|
method: 'post',
|
|
197
218
|
requestPathParamsSchema: idParams,
|
|
198
219
|
pathResolver: ({ id }) => `/api/v1/notifications/${id}/act`,
|
|
199
|
-
requestBodySchema:
|
|
220
|
+
requestBodySchema: actNotificationSchema,
|
|
200
221
|
responsesByStatusCode: { 200: notificationSchema, ...errorResponses },
|
|
201
222
|
}));
|
|
202
223
|
/** Dismiss a notification without acting on it. */
|
|
@@ -236,6 +257,23 @@ export const getPublicUsageContract = withMinScope('read', defineApiContract({
|
|
|
236
257
|
pathResolver: () => '/api/v1/usage',
|
|
237
258
|
responsesByStatusCode: { 200: publicUsageSchema, ...errorResponses },
|
|
238
259
|
}));
|
|
260
|
+
/**
|
|
261
|
+
* The workspace's spend over a window, sliced by ONE dimension: the TCO read the period
|
|
262
|
+
* breakdown above cannot produce: it groups by `(billing, vendor, provider, model)` within the
|
|
263
|
+
* current calendar month, and carries no board-shape axis at all.
|
|
264
|
+
*
|
|
265
|
+
* A sub-resource of `/usage` rather than a surface of its own, because it is the same money
|
|
266
|
+
* from the same ledger: `/usage` answers the budget question ("what has this period cost, and
|
|
267
|
+
* are runs paused"), this answers the attribution one ("what did this repository / ticket /
|
|
268
|
+
* run cost"). Scoped in SQL to the key's own workspace and its account, so `read` is the whole
|
|
269
|
+
* scope story here too.
|
|
270
|
+
*/
|
|
271
|
+
export const getPublicSpendContract = withMinScope('read', defineApiContract({
|
|
272
|
+
method: 'get',
|
|
273
|
+
pathResolver: () => '/api/v1/usage/spend',
|
|
274
|
+
requestQuerySchema: publicSpendQuerySchema,
|
|
275
|
+
responsesByStatusCode: { 200: publicSpendSchema, ...errorResponses },
|
|
276
|
+
}));
|
|
239
277
|
// ---- headless key provisioning (`admin` scope) -----------------------------
|
|
240
278
|
// The external counterpart of the session-authed `/public-api-keys` routes above, and the same
|
|
241
279
|
// class of gap the outbound webhook had: a deployment whose operator is headless could reach
|
|
@@ -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,gCAAgC,EAChC,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;
|
|
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,gCAAgC,EAChC,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAC/E,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,iCAAiC,EACjC,uBAAuB,EACvB,oBAAoB,EACpB,mBAAm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GAAG,YAAY,CAChD,uBAAuB,EACvB,iBAAiB,CAAC;IAChB,MAAM,EAAE,KAAK;IACb,YAAY,EAAE,GAAG,EAAE,CAAC,cAAc;IAClC,qBAAqB,EAAE,EAAE,GAAG,EAAE,4BAA4B,EAAE,GAAG,cAAc,EAAE;CAChF,CAAC,CACH,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,YAAY,CACjD,uBAAuB,EACvB,iBAAiB,CAAC;IAChB,MAAM,EAAE,MAAM;IACd,YAAY,EAAE,GAAG,EAAE,CAAC,cAAc;IAClC,iBAAiB,EAAE,gCAAgC;IACnD,qBAAqB,EAAE,EAAE,GAAG,EAAE,yBAAyB,EAAE,GAAG,cAAc,EAAE;CAC7E,CAAC,CACH,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,YAAY,CACjD,uBAAuB,EACvB,iBAAiB,CAAC;IAChB,MAAM,EAAE,QAAQ;IAChB,uBAAuB,EAAE,WAAW;IACpC,YAAY,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,gBAAgB,KAAK,EAAE;IACpD,qBAAqB,EAAE,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE;CAClE,CAAC,CACH,CAAA"}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The merge decision a RUN left behind: its change class, the merger's scores, what happened,
|
|
3
|
+
* and the effort tag if one has been recorded.
|
|
4
|
+
*
|
|
5
|
+
* The entry point of the loop for a caller that started the run and holds its id, and the read
|
|
6
|
+
* that hands it the `recordId` the tag route takes. A run whose pipeline had no `merger` step
|
|
7
|
+
* (or whose merge path never got far enough to classify) has no record, and that is a `404`
|
|
8
|
+
* rather than an empty object: "this run made no merge decision" is a fact about the run.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getPublicRunMergeRecordContract: {
|
|
11
|
+
readonly method: "get";
|
|
12
|
+
readonly requestPathParamsSchema: import("valibot").ObjectSchema<{
|
|
13
|
+
runId: import("valibot").StringSchema<undefined>;
|
|
14
|
+
}, undefined> & import("@toad-contracts/core").StandardObjectKeysV1<unknown, unknown>;
|
|
15
|
+
readonly pathResolver: ({ runId }: {
|
|
16
|
+
runId: string;
|
|
17
|
+
}) => string;
|
|
18
|
+
readonly responsesByStatusCode: {
|
|
19
|
+
readonly '4xx': import("valibot").ObjectSchema<{
|
|
20
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
21
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
22
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
23
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
24
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
25
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
26
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
27
|
+
}, undefined>, undefined>, undefined>;
|
|
28
|
+
}, undefined>;
|
|
29
|
+
}, undefined>;
|
|
30
|
+
readonly '5xx': import("valibot").ObjectSchema<{
|
|
31
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
32
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
33
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
34
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
35
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
36
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
37
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
38
|
+
}, undefined>, undefined>, undefined>;
|
|
39
|
+
}, undefined>;
|
|
40
|
+
}, undefined>;
|
|
41
|
+
readonly 200: import("valibot").ObjectSchema<{
|
|
42
|
+
readonly recordId: import("valibot").StringSchema<undefined>;
|
|
43
|
+
readonly taskId: import("valibot").StringSchema<undefined>;
|
|
44
|
+
readonly runId: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
45
|
+
readonly changeClass: import("valibot").PicklistSchema<["docs", "test", "dependency", "config", "source", "schema", "unknown"], undefined>;
|
|
46
|
+
readonly changedFileCount: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
47
|
+
readonly complexity: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
48
|
+
readonly risk: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
49
|
+
readonly impact: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
50
|
+
readonly mergePresetId: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
51
|
+
readonly mergePresetName: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
52
|
+
readonly decision: import("valibot").PicklistSchema<["pending_review", "auto_merged", "human_merged", "external_merged", "rejected"], undefined>;
|
|
53
|
+
readonly reviewEffort: import("valibot").NullableSchema<import("valibot").PicklistSchema<["none", "minor", "major"], undefined>, undefined>;
|
|
54
|
+
readonly prNumber: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
55
|
+
readonly prUrl: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
56
|
+
readonly repoId: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
57
|
+
readonly provider: import("valibot").NullableSchema<import("valibot").PicklistSchema<["github", "gitlab"], undefined>, undefined>;
|
|
58
|
+
readonly createdAt: import("valibot").NumberSchema<undefined>;
|
|
59
|
+
readonly resolvedAt: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
60
|
+
readonly taggedAt: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
61
|
+
}, undefined>;
|
|
62
|
+
};
|
|
63
|
+
} & {
|
|
64
|
+
readonly minScope: "read";
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Every change class's accumulated track record for the key's workspace, as ONE aggregate.
|
|
68
|
+
*
|
|
69
|
+
* Registered ahead of the point read below so `rollups` cannot be taken for a record id. It
|
|
70
|
+
* cannot be one today (record ids are `mtr_*`), but the ordering is what keeps that true of a
|
|
71
|
+
* future id scheme rather than of this one.
|
|
72
|
+
*/
|
|
73
|
+
export declare const listPublicMergeClassRollupsContract: {
|
|
74
|
+
readonly method: "get";
|
|
75
|
+
readonly pathResolver: () => string;
|
|
76
|
+
readonly responsesByStatusCode: {
|
|
77
|
+
readonly '4xx': import("valibot").ObjectSchema<{
|
|
78
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
79
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
80
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
81
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
82
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
83
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
84
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
85
|
+
}, undefined>, undefined>, undefined>;
|
|
86
|
+
}, undefined>;
|
|
87
|
+
}, undefined>;
|
|
88
|
+
readonly '5xx': import("valibot").ObjectSchema<{
|
|
89
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
90
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
91
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
92
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
93
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
94
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
95
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
96
|
+
}, undefined>, undefined>, undefined>;
|
|
97
|
+
}, undefined>;
|
|
98
|
+
}, undefined>;
|
|
99
|
+
readonly 200: import("valibot").ObjectSchema<{
|
|
100
|
+
readonly rollups: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
101
|
+
readonly changeClass: import("valibot").PicklistSchema<["docs", "test", "dependency", "config", "source", "schema", "unknown"], undefined>;
|
|
102
|
+
readonly total: import("valibot").NumberSchema<undefined>;
|
|
103
|
+
readonly merged: import("valibot").NumberSchema<undefined>;
|
|
104
|
+
readonly autoMerged: import("valibot").NumberSchema<undefined>;
|
|
105
|
+
readonly humanMerged: import("valibot").NumberSchema<undefined>;
|
|
106
|
+
readonly externalMerged: import("valibot").NumberSchema<undefined>;
|
|
107
|
+
readonly rejected: import("valibot").NumberSchema<undefined>;
|
|
108
|
+
readonly pendingReview: import("valibot").NumberSchema<undefined>;
|
|
109
|
+
readonly effort: import("valibot").ObjectSchema<{
|
|
110
|
+
readonly none: import("valibot").NumberSchema<undefined>;
|
|
111
|
+
readonly minor: import("valibot").NumberSchema<undefined>;
|
|
112
|
+
readonly major: import("valibot").NumberSchema<undefined>;
|
|
113
|
+
readonly untagged: import("valibot").NumberSchema<undefined>;
|
|
114
|
+
}, undefined>;
|
|
115
|
+
}, undefined>, undefined>;
|
|
116
|
+
}, undefined>;
|
|
117
|
+
};
|
|
118
|
+
} & {
|
|
119
|
+
readonly minScope: "read";
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* One record by id: the read-back beside the tag write, so a caller holding a `recordId` (from
|
|
123
|
+
* a `merge_tag_request` card's payload, say) can see WHAT it is about to tag rather than tagging
|
|
124
|
+
* an opaque id.
|
|
125
|
+
*/
|
|
126
|
+
export declare const getPublicMergeRecordContract: {
|
|
127
|
+
readonly method: "get";
|
|
128
|
+
readonly requestPathParamsSchema: import("valibot").ObjectSchema<{
|
|
129
|
+
recordId: import("valibot").StringSchema<undefined>;
|
|
130
|
+
}, undefined> & import("@toad-contracts/core").StandardObjectKeysV1<unknown, unknown>;
|
|
131
|
+
readonly pathResolver: ({ recordId }: {
|
|
132
|
+
recordId: string;
|
|
133
|
+
}) => string;
|
|
134
|
+
readonly responsesByStatusCode: {
|
|
135
|
+
readonly '4xx': import("valibot").ObjectSchema<{
|
|
136
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
137
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
138
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
139
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
140
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
141
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
142
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
143
|
+
}, undefined>, undefined>, undefined>;
|
|
144
|
+
}, undefined>;
|
|
145
|
+
}, undefined>;
|
|
146
|
+
readonly '5xx': import("valibot").ObjectSchema<{
|
|
147
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
148
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
149
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
150
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
151
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
152
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
153
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
154
|
+
}, undefined>, undefined>, undefined>;
|
|
155
|
+
}, undefined>;
|
|
156
|
+
}, undefined>;
|
|
157
|
+
readonly 200: import("valibot").ObjectSchema<{
|
|
158
|
+
readonly recordId: import("valibot").StringSchema<undefined>;
|
|
159
|
+
readonly taskId: import("valibot").StringSchema<undefined>;
|
|
160
|
+
readonly runId: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
161
|
+
readonly changeClass: import("valibot").PicklistSchema<["docs", "test", "dependency", "config", "source", "schema", "unknown"], undefined>;
|
|
162
|
+
readonly changedFileCount: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
163
|
+
readonly complexity: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
164
|
+
readonly risk: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
165
|
+
readonly impact: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
166
|
+
readonly mergePresetId: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
167
|
+
readonly mergePresetName: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
168
|
+
readonly decision: import("valibot").PicklistSchema<["pending_review", "auto_merged", "human_merged", "external_merged", "rejected"], undefined>;
|
|
169
|
+
readonly reviewEffort: import("valibot").NullableSchema<import("valibot").PicklistSchema<["none", "minor", "major"], undefined>, undefined>;
|
|
170
|
+
readonly prNumber: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
171
|
+
readonly prUrl: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
172
|
+
readonly repoId: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
173
|
+
readonly provider: import("valibot").NullableSchema<import("valibot").PicklistSchema<["github", "gitlab"], undefined>, undefined>;
|
|
174
|
+
readonly createdAt: import("valibot").NumberSchema<undefined>;
|
|
175
|
+
readonly resolvedAt: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
176
|
+
readonly taggedAt: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
177
|
+
}, undefined>;
|
|
178
|
+
};
|
|
179
|
+
} & {
|
|
180
|
+
readonly minScope: "read";
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* Tag (or clear, with `null`) the reviewer effort a human spent on the pull request a record
|
|
184
|
+
* covers. `write`, not `admin`: this records evidence about a decision that already happened.
|
|
185
|
+
*
|
|
186
|
+
* Idempotent (the same tag applied twice leaves the same row) and orthogonal to the decision, so
|
|
187
|
+
* a record may be tagged whenever the effort becomes known, including long after the merge.
|
|
188
|
+
*/
|
|
189
|
+
export declare const tagPublicMergeReviewEffortContract: {
|
|
190
|
+
readonly method: "post";
|
|
191
|
+
readonly requestPathParamsSchema: import("valibot").ObjectSchema<{
|
|
192
|
+
recordId: import("valibot").StringSchema<undefined>;
|
|
193
|
+
}, undefined> & import("@toad-contracts/core").StandardObjectKeysV1<unknown, unknown>;
|
|
194
|
+
readonly pathResolver: ({ recordId }: {
|
|
195
|
+
recordId: string;
|
|
196
|
+
}) => string;
|
|
197
|
+
readonly requestBodySchema: import("valibot").ObjectSchema<{
|
|
198
|
+
readonly reviewEffort: import("valibot").NullableSchema<import("valibot").PicklistSchema<["none", "minor", "major"], undefined>, undefined>;
|
|
199
|
+
}, undefined>;
|
|
200
|
+
readonly responsesByStatusCode: {
|
|
201
|
+
readonly '4xx': import("valibot").ObjectSchema<{
|
|
202
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
203
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
204
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
205
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
206
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
207
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
208
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
209
|
+
}, undefined>, undefined>, undefined>;
|
|
210
|
+
}, undefined>;
|
|
211
|
+
}, undefined>;
|
|
212
|
+
readonly '5xx': import("valibot").ObjectSchema<{
|
|
213
|
+
readonly error: import("valibot").ObjectSchema<{
|
|
214
|
+
readonly code: import("valibot").StringSchema<undefined>;
|
|
215
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
216
|
+
readonly details: import("valibot").OptionalSchema<import("valibot").UnknownSchema, undefined>;
|
|
217
|
+
readonly issues: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
218
|
+
readonly path: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
219
|
+
readonly message: import("valibot").StringSchema<undefined>;
|
|
220
|
+
}, undefined>, undefined>, undefined>;
|
|
221
|
+
}, undefined>;
|
|
222
|
+
}, undefined>;
|
|
223
|
+
readonly 200: import("valibot").ObjectSchema<{
|
|
224
|
+
readonly recordId: import("valibot").StringSchema<undefined>;
|
|
225
|
+
readonly taskId: import("valibot").StringSchema<undefined>;
|
|
226
|
+
readonly runId: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
227
|
+
readonly changeClass: import("valibot").PicklistSchema<["docs", "test", "dependency", "config", "source", "schema", "unknown"], undefined>;
|
|
228
|
+
readonly changedFileCount: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
229
|
+
readonly complexity: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
230
|
+
readonly risk: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
231
|
+
readonly impact: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
232
|
+
readonly mergePresetId: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
233
|
+
readonly mergePresetName: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
234
|
+
readonly decision: import("valibot").PicklistSchema<["pending_review", "auto_merged", "human_merged", "external_merged", "rejected"], undefined>;
|
|
235
|
+
readonly reviewEffort: import("valibot").NullableSchema<import("valibot").PicklistSchema<["none", "minor", "major"], undefined>, undefined>;
|
|
236
|
+
readonly prNumber: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
237
|
+
readonly prUrl: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
238
|
+
readonly repoId: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
239
|
+
readonly provider: import("valibot").NullableSchema<import("valibot").PicklistSchema<["github", "gitlab"], undefined>, undefined>;
|
|
240
|
+
readonly createdAt: import("valibot").NumberSchema<undefined>;
|
|
241
|
+
readonly resolvedAt: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
242
|
+
readonly taggedAt: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
243
|
+
}, undefined>;
|
|
244
|
+
};
|
|
245
|
+
} & {
|
|
246
|
+
readonly minScope: "write";
|
|
247
|
+
};
|
|
248
|
+
//# sourceMappingURL=public-merge-evidence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-merge-evidence.d.ts","sourceRoot":"","sources":["../../src/routes/public-merge-evidence.ts"],"names":[],"mappings":"AAiCA;;;;;;;;GAQG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQ3C,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAO/C,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQxC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAS9C,CAAA"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { defineApiContract } from '@toad-contracts/valibot';
|
|
2
|
+
import { tagReviewEffortSchema } from '../mergeTrackRecord.js';
|
|
3
|
+
import { publicMergeClassRollupListSchema, publicMergeRecordSchema, } from '../public-merge-evidence.js';
|
|
4
|
+
import { errorResponses, singleStringParam, withMinScope } from './_shared.js';
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
// Route contracts for the public MERGE-EVIDENCE surface: absolute `/api/v1` paths,
|
|
7
|
+
// authenticated in-controller by a public-API key. The wire shapes and the reasoning behind
|
|
8
|
+
// them live in `../public-merge-evidence.ts`; the feature itself is
|
|
9
|
+
// `backend/docs/adr/0046-merge-track-record.md`.
|
|
10
|
+
//
|
|
11
|
+
// The scope split is the whole point of the surface, and it is deliberately NOT the one `act`
|
|
12
|
+
// carries. `POST /api/v1/notifications/:id/act` is `admin` because it MERGES a pull request for
|
|
13
|
+
// real; TAGGING how much review an already-landed pull request needed performs no external
|
|
14
|
+
// side-effect and cannot merge anything, so it is `write`, and the reads are `read` like every
|
|
15
|
+
// other read on this API. An integration that watches a board and records review effort
|
|
16
|
+
// therefore needs neither merge rights nor the ability to delete a task, where before the only
|
|
17
|
+
// way to record a tag at all was through the `admin`-scoped `act`.
|
|
18
|
+
//
|
|
19
|
+
// The two workspace-scoped point routes are addressed by RECORD id and re-apply the key's
|
|
20
|
+
// workspace to the row they load, which is the rule every point read on this API follows
|
|
21
|
+
// (`/api/v1/debug/llm-calls/:callId`, `/api/v1/artifacts/:artifactId/blob`). The run-scoped read
|
|
22
|
+
// is under `/api/v1/runs/:runId/*` and therefore carries that prefix's ONE access semantic
|
|
23
|
+
// instead: a run this key could already reach through `GET /jobs/:id` or
|
|
24
|
+
// `GET /tasks/:taskId/run`. See `PublicEvidenceController` for why a prefix may carry only one.
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
const runIdParams = singleStringParam('runId');
|
|
27
|
+
const recordIdParams = singleStringParam('recordId');
|
|
28
|
+
/**
|
|
29
|
+
* The merge decision a RUN left behind: its change class, the merger's scores, what happened,
|
|
30
|
+
* and the effort tag if one has been recorded.
|
|
31
|
+
*
|
|
32
|
+
* The entry point of the loop for a caller that started the run and holds its id, and the read
|
|
33
|
+
* that hands it the `recordId` the tag route takes. A run whose pipeline had no `merger` step
|
|
34
|
+
* (or whose merge path never got far enough to classify) has no record, and that is a `404`
|
|
35
|
+
* rather than an empty object: "this run made no merge decision" is a fact about the run.
|
|
36
|
+
*/
|
|
37
|
+
export const getPublicRunMergeRecordContract = withMinScope('read', defineApiContract({
|
|
38
|
+
method: 'get',
|
|
39
|
+
requestPathParamsSchema: runIdParams,
|
|
40
|
+
pathResolver: ({ runId }) => `/api/v1/runs/${runId}/merge-record`,
|
|
41
|
+
responsesByStatusCode: { 200: publicMergeRecordSchema, ...errorResponses },
|
|
42
|
+
}));
|
|
43
|
+
/**
|
|
44
|
+
* Every change class's accumulated track record for the key's workspace, as ONE aggregate.
|
|
45
|
+
*
|
|
46
|
+
* Registered ahead of the point read below so `rollups` cannot be taken for a record id. It
|
|
47
|
+
* cannot be one today (record ids are `mtr_*`), but the ordering is what keeps that true of a
|
|
48
|
+
* future id scheme rather than of this one.
|
|
49
|
+
*/
|
|
50
|
+
export const listPublicMergeClassRollupsContract = withMinScope('read', defineApiContract({
|
|
51
|
+
method: 'get',
|
|
52
|
+
pathResolver: () => '/api/v1/merge-records/rollups',
|
|
53
|
+
responsesByStatusCode: { 200: publicMergeClassRollupListSchema, ...errorResponses },
|
|
54
|
+
}));
|
|
55
|
+
/**
|
|
56
|
+
* One record by id: the read-back beside the tag write, so a caller holding a `recordId` (from
|
|
57
|
+
* a `merge_tag_request` card's payload, say) can see WHAT it is about to tag rather than tagging
|
|
58
|
+
* an opaque id.
|
|
59
|
+
*/
|
|
60
|
+
export const getPublicMergeRecordContract = withMinScope('read', defineApiContract({
|
|
61
|
+
method: 'get',
|
|
62
|
+
requestPathParamsSchema: recordIdParams,
|
|
63
|
+
pathResolver: ({ recordId }) => `/api/v1/merge-records/${recordId}`,
|
|
64
|
+
responsesByStatusCode: { 200: publicMergeRecordSchema, ...errorResponses },
|
|
65
|
+
}));
|
|
66
|
+
/**
|
|
67
|
+
* Tag (or clear, with `null`) the reviewer effort a human spent on the pull request a record
|
|
68
|
+
* covers. `write`, not `admin`: this records evidence about a decision that already happened.
|
|
69
|
+
*
|
|
70
|
+
* Idempotent (the same tag applied twice leaves the same row) and orthogonal to the decision, so
|
|
71
|
+
* a record may be tagged whenever the effort becomes known, including long after the merge.
|
|
72
|
+
*/
|
|
73
|
+
export const tagPublicMergeReviewEffortContract = withMinScope('write', defineApiContract({
|
|
74
|
+
method: 'post',
|
|
75
|
+
requestPathParamsSchema: recordIdParams,
|
|
76
|
+
pathResolver: ({ recordId }) => `/api/v1/merge-records/${recordId}/effort`,
|
|
77
|
+
requestBodySchema: tagReviewEffortSchema,
|
|
78
|
+
responsesByStatusCode: { 200: publicMergeRecordSchema, ...errorResponses },
|
|
79
|
+
}));
|
|
80
|
+
//# sourceMappingURL=public-merge-evidence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-merge-evidence.js","sourceRoot":"","sources":["../../src/routes/public-merge-evidence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,EACL,gCAAgC,EAChC,uBAAuB,GACxB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE9E,8EAA8E;AAC9E,mFAAmF;AACnF,4FAA4F;AAC5F,oEAAoE;AACpE,iDAAiD;AACjD,EAAE;AACF,8FAA8F;AAC9F,gGAAgG;AAChG,2FAA2F;AAC3F,+FAA+F;AAC/F,wFAAwF;AACxF,+FAA+F;AAC/F,mEAAmE;AACnE,EAA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