@buildinternet/releases-api-types 0.19.0 → 0.20.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/package.json +2 -2
- package/src/api-types.ts +5 -0
- package/src/schemas/orgs.ts +2 -0
- package/src/schemas/releases.ts +8 -1
- package/src/schemas/shared.ts +17 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buildinternet/releases-api-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "Wire protocol — request/response types for the Releases registry API. Shared by web, workers, and clients.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@buildinternet/releases-core": "^0.21.0",
|
|
21
|
-
"zod": "^4.3
|
|
21
|
+
"zod": "^4.4.3"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
package/src/api-types.ts
CHANGED
|
@@ -16,6 +16,7 @@ import type {
|
|
|
16
16
|
StatsSchema,
|
|
17
17
|
ErrorResponseSchema,
|
|
18
18
|
ReleaseTypeSchema,
|
|
19
|
+
ReleaseCompositionSchema,
|
|
19
20
|
ReleaseItemSchema,
|
|
20
21
|
ReleaseSummaryItemSchema,
|
|
21
22
|
OverviewPageItemSchema,
|
|
@@ -222,6 +223,7 @@ export {
|
|
|
222
223
|
StatsSchema,
|
|
223
224
|
ErrorResponseSchema,
|
|
224
225
|
ReleaseTypeSchema,
|
|
226
|
+
ReleaseCompositionSchema,
|
|
225
227
|
ReleaseItemSchema,
|
|
226
228
|
ReleaseSummaryItemSchema,
|
|
227
229
|
OverviewPageItemSchema,
|
|
@@ -571,6 +573,7 @@ export interface OrgsRollupResponse extends ListResponse<OrgsRollupRow> {
|
|
|
571
573
|
export type ReleaseType = z.infer<typeof ReleaseTypeSchema>;
|
|
572
574
|
|
|
573
575
|
export type ReleaseItem = z.infer<typeof ReleaseItemSchema>;
|
|
576
|
+
export type ReleaseComposition = z.infer<typeof ReleaseCompositionSchema>;
|
|
574
577
|
|
|
575
578
|
export interface ReleaseDetail {
|
|
576
579
|
id: string;
|
|
@@ -599,6 +602,8 @@ export interface ReleaseDetail {
|
|
|
599
602
|
org: { slug: string; name: string } | null;
|
|
600
603
|
/** Release type. See {@link ReleaseType}. */
|
|
601
604
|
type?: ReleaseType;
|
|
605
|
+
/** Per-category item counts from the AI release-content pass. See {@link ReleaseComposition}. */
|
|
606
|
+
composition?: ReleaseComposition | null;
|
|
602
607
|
}
|
|
603
608
|
|
|
604
609
|
export type ReleaseCoverageRow = z.infer<typeof ReleaseCoverageRowSchema>;
|
package/src/schemas/orgs.ts
CHANGED
|
@@ -78,6 +78,8 @@ export const UpdateOrgBodySchema = z.object({
|
|
|
78
78
|
avatarUrl: z.string().nullable().optional(),
|
|
79
79
|
tags: z.array(z.string()).optional(),
|
|
80
80
|
aliases: z.array(z.string()).optional(),
|
|
81
|
+
/** Admin-only: pause/unpause all ingest for this org without touching sources (#1057). */
|
|
82
|
+
fetchPaused: z.boolean().optional(),
|
|
81
83
|
});
|
|
82
84
|
|
|
83
85
|
// Org detail's products query selects a strict subset of `ProductListItem` —
|
package/src/schemas/releases.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { SOURCE_TYPES } from "@buildinternet/releases-core/source-enums";
|
|
3
|
-
import { MediaItemSchema, ReleaseTypeSchema } from "./shared.js";
|
|
3
|
+
import { MediaItemSchema, ReleaseCompositionSchema, ReleaseTypeSchema } from "./shared.js";
|
|
4
|
+
|
|
5
|
+
// ReleaseCompositionSchema lives in ./shared.js (single source of truth) — both
|
|
6
|
+
// this file and ReleaseItemSchema reference it from there.
|
|
4
7
|
|
|
5
8
|
/**
|
|
6
9
|
* Per-row shape returned by `GET /v1/releases/latest`. Distinct from the
|
|
@@ -36,6 +39,7 @@ export const ReleaseLatestItemSchema = z.object({
|
|
|
36
39
|
// same fields on the org / collection feeds. #958.
|
|
37
40
|
contentChars: z.number().int().min(0).nullable().optional(),
|
|
38
41
|
contentTokens: z.number().int().min(0).nullable().optional(),
|
|
42
|
+
composition: ReleaseCompositionSchema.nullable().optional(),
|
|
39
43
|
});
|
|
40
44
|
|
|
41
45
|
export const ReleaseLatestResponseSchema = z.object({
|
|
@@ -155,6 +159,7 @@ export const ReleaseDetailResponseSchema = z.object({
|
|
|
155
159
|
sourceSlug: z.string().nullable(),
|
|
156
160
|
sourceType: z.enum(SOURCE_TYPES).nullable(),
|
|
157
161
|
org: ReleaseDetailOrgSchema.nullable(),
|
|
162
|
+
composition: ReleaseCompositionSchema.nullable(),
|
|
158
163
|
});
|
|
159
164
|
|
|
160
165
|
/**
|
|
@@ -177,6 +182,8 @@ export const UpdateReleaseBodySchema = z
|
|
|
177
182
|
summary: z.string().nullable().optional(),
|
|
178
183
|
titleGenerated: z.string().nullable().optional(),
|
|
179
184
|
titleShort: z.string().nullable().optional(),
|
|
185
|
+
// `null` removes `$.composition` from metadata; an object replaces it.
|
|
186
|
+
composition: ReleaseCompositionSchema.nullable().optional(),
|
|
180
187
|
})
|
|
181
188
|
.strict();
|
|
182
189
|
|
package/src/schemas/shared.ts
CHANGED
|
@@ -46,6 +46,19 @@ export const StatsSchema = z.object({
|
|
|
46
46
|
|
|
47
47
|
export const ReleaseTypeSchema = z.enum(RELEASE_TYPES);
|
|
48
48
|
|
|
49
|
+
/**
|
|
50
|
+
* Per-category item counts produced by the AI release-content pass and
|
|
51
|
+
* persisted on `releases.metadata.composition`. Surfaces as a chip on the
|
|
52
|
+
* release detail UI ("12 fixes · 3 features"); `null` when the row hasn't
|
|
53
|
+
* been through the AI pass yet, the body was empty/boilerplate, or all
|
|
54
|
+
* three counts came back zero (we filter that case out on the parse side).
|
|
55
|
+
*/
|
|
56
|
+
export const ReleaseCompositionSchema = z.object({
|
|
57
|
+
bugs: z.number().int().min(0),
|
|
58
|
+
features: z.number().int().min(0),
|
|
59
|
+
enhancements: z.number().int().min(0),
|
|
60
|
+
});
|
|
61
|
+
|
|
49
62
|
export const ReleaseItemSchema = z.object({
|
|
50
63
|
id: z.string().optional(),
|
|
51
64
|
version: z.string().nullable(),
|
|
@@ -89,6 +102,10 @@ export const ReleaseItemSchema = z.object({
|
|
|
89
102
|
// when null. See #958.
|
|
90
103
|
contentChars: z.number().int().min(0).nullable().optional(),
|
|
91
104
|
contentTokens: z.number().int().min(0).nullable().optional(),
|
|
105
|
+
// Per-category item counts produced by the AI release-content pass and
|
|
106
|
+
// stored on `releases.metadata.composition`. `null`/`undefined` when the
|
|
107
|
+
// row hasn't been through the AI pass yet or the body was boilerplate.
|
|
108
|
+
composition: ReleaseCompositionSchema.nullable().optional(),
|
|
92
109
|
});
|
|
93
110
|
|
|
94
111
|
export const ReleaseSummaryItemSchema = z.object({
|