@buildinternet/releases-api-types 0.42.0 → 0.43.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 +1 -1
- package/src/api-types.ts +21 -0
- package/src/schemas/lookups.ts +5 -4
- package/src/schemas/releases.ts +24 -0
- package/src/schemas/search.ts +8 -0
- package/src/schemas/shared.ts +9 -0
package/package.json
CHANGED
package/src/api-types.ts
CHANGED
|
@@ -1146,6 +1146,27 @@ export interface DigestPrefsRequest {
|
|
|
1146
1146
|
cadence: DigestCadence;
|
|
1147
1147
|
}
|
|
1148
1148
|
|
|
1149
|
+
/**
|
|
1150
|
+
* GET /v1/me/settings/notifications — one-shot bootstrap for `/account/notifications`.
|
|
1151
|
+
* Composes digest cadence + feed token + webhook list so the settings page can
|
|
1152
|
+
* render with a single round-trip instead of three independent mounts.
|
|
1153
|
+
*/
|
|
1154
|
+
export interface NotificationSettingsResponse {
|
|
1155
|
+
cadence: DigestCadence;
|
|
1156
|
+
feedToken: FeedToken | null;
|
|
1157
|
+
webhooks: UserWebhookListItem[];
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
/**
|
|
1161
|
+
* GET /v1/me/settings/developer — one-shot bootstrap for `/account/webhooks`
|
|
1162
|
+
* (Webhooks & API). `apiKeys` is `null` when the user-api-keys feature is off
|
|
1163
|
+
* so the UI can hide the keys section without a separate probe.
|
|
1164
|
+
*/
|
|
1165
|
+
export interface DeveloperSettingsResponse {
|
|
1166
|
+
webhooks: UserWebhookListItem[];
|
|
1167
|
+
apiKeys: UserApiKey[] | null;
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1149
1170
|
// ── Search ──
|
|
1150
1171
|
|
|
1151
1172
|
export type SearchOrgHit = z.infer<typeof SearchOrgHitSchema>;
|
package/src/schemas/lookups.ts
CHANGED
|
@@ -90,10 +90,11 @@ export const LookupProductBySlugResponseSchema = z.object({
|
|
|
90
90
|
});
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
|
-
* Response from `GET /v1/lookups/by-domain?domain=…`.
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
93
|
+
* Response from `GET /v1/lookups/by-domain?domain=…`. Resolves against the
|
|
94
|
+
* registry; on a complete miss may just-in-time materialize a stub from
|
|
95
|
+
* `/.well-known/releases.json` when listing is enabled (#2030). Both an org
|
|
96
|
+
* and product list can be present when a product alias points at the same
|
|
97
|
+
* domain its parent org owns.
|
|
97
98
|
*/
|
|
98
99
|
export const DomainLookupOrgSchema = z.object({
|
|
99
100
|
id: z.string(),
|
package/src/schemas/releases.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { SOURCE_TYPES } from "@buildinternet/releases-core/source-enums";
|
|
3
3
|
import { BREAKING_LEVELS } from "@buildinternet/releases-core/breaking";
|
|
4
|
+
import { KIND_VALUES } from "@buildinternet/releases-core/kinds";
|
|
4
5
|
import {
|
|
5
6
|
AppStoreSourceInfoSchema,
|
|
6
7
|
MediaItemSchema,
|
|
7
8
|
ReleaseCompositionSchema,
|
|
9
|
+
ReleaseThumbnailSchema,
|
|
8
10
|
ReleaseTypeSchema,
|
|
9
11
|
VideoSourceInfoSchema,
|
|
10
12
|
} from "./shared.js";
|
|
@@ -37,11 +39,20 @@ export const ReleaseLatestSourceSchema = z.object({
|
|
|
37
39
|
/** Owning org's GitHub handle, used to derive `github.com/<handle>.png` as the
|
|
38
40
|
* avatar fallback when `orgAvatarUrl` is unset. Additive — older responses omit it. */
|
|
39
41
|
orgGithubHandle: z.string().nullable().optional(),
|
|
42
|
+
/** Source classification (`sdk`, `platform`, `docs`, …) from `sources.kind`.
|
|
43
|
+
* Null when the source has no explicit kind — resolve against the product's
|
|
44
|
+
* kind via `resolveSourceKind`. Additive — older responses omit it. Lets read
|
|
45
|
+
* surfaces (e.g. the digest email) deprioritize/cluster SDK releases the way
|
|
46
|
+
* the web sources table does. */
|
|
47
|
+
kind: z.enum(KIND_VALUES).nullable().optional(),
|
|
40
48
|
});
|
|
41
49
|
|
|
42
50
|
export const ReleaseLatestProductSchema = z.object({
|
|
43
51
|
slug: z.string(),
|
|
44
52
|
name: z.string(),
|
|
53
|
+
/** Product classification from `products.kind`; the fallback `resolveSourceKind`
|
|
54
|
+
* consults when the source itself has no kind. Additive — older responses omit it. */
|
|
55
|
+
kind: z.enum(KIND_VALUES).nullable().optional(),
|
|
45
56
|
});
|
|
46
57
|
|
|
47
58
|
export const ReleaseLatestItemSchema = z.object({
|
|
@@ -75,6 +86,16 @@ export const ReleaseLatestItemSchema = z.object({
|
|
|
75
86
|
* omit this field; treat `undefined` as `null`. #1217.
|
|
76
87
|
*/
|
|
77
88
|
product: ReleaseLatestProductSchema.nullable().optional(),
|
|
89
|
+
/**
|
|
90
|
+
* Server-resolved grouping identity — `product.slug ?? source.slug` /
|
|
91
|
+
* `product.name ?? source.name`. The web releases feed keys and labels
|
|
92
|
+
* SDK/package-cluster rollups on these instead of reconstructing
|
|
93
|
+
* `product ?? source` client-side; the digest email mirrors that. Optional on
|
|
94
|
+
* the wire: older workers omit them, so clients fall back to deriving from
|
|
95
|
+
* `product ?? source`. Never null when present (`source` is always set). #1234
|
|
96
|
+
*/
|
|
97
|
+
groupSlug: z.string().optional(),
|
|
98
|
+
groupName: z.string().optional(),
|
|
78
99
|
coverageCount: z.number().int().min(0).optional(),
|
|
79
100
|
// Cached release-body size hint — see {@link ReleaseItemSchema} for the
|
|
80
101
|
// same fields on the org / collection feeds. #958.
|
|
@@ -105,6 +126,9 @@ export const ReleaseCoverageSiblingSchema = z.object({
|
|
|
105
126
|
sourceName: z.string(),
|
|
106
127
|
publishedAt: z.string().nullable(),
|
|
107
128
|
org: z.object({ slug: z.string(), name: z.string() }).nullable(),
|
|
129
|
+
/** First image/gif thumbnail for the counterpart release; null when it has
|
|
130
|
+
* none. Optional so an older server that omits it still validates. */
|
|
131
|
+
thumbnail: ReleaseThumbnailSchema.nullable().optional(),
|
|
108
132
|
});
|
|
109
133
|
|
|
110
134
|
/**
|
package/src/schemas/search.ts
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
AppStoreSourceInfoSchema,
|
|
5
5
|
MediaItemSchema,
|
|
6
6
|
OrgStatusSchema,
|
|
7
|
+
ReleaseThumbnailSchema,
|
|
7
8
|
ReleaseTypeSchema,
|
|
8
9
|
VideoSourceInfoSchema,
|
|
9
10
|
} from "./shared.js";
|
|
@@ -108,6 +109,11 @@ export const SearchReleaseHitSchema = z.object({
|
|
|
108
109
|
summary: z.string(),
|
|
109
110
|
titleGenerated: z.string().nullable().optional(),
|
|
110
111
|
titleShort: z.string().nullable().optional(),
|
|
112
|
+
/**
|
|
113
|
+
* Full markdown body. Omitted on list hits by default (summary + media
|
|
114
|
+
* cover the card/snippet surfaces). Opt in with `?include_content=true`
|
|
115
|
+
* on `/v1/search`. Fetch full body via `GET /v1/releases/:id` otherwise.
|
|
116
|
+
*/
|
|
111
117
|
content: z.string().optional(),
|
|
112
118
|
media: z.array(MediaItemSchema).optional(),
|
|
113
119
|
publishedAt: z.string().nullable(),
|
|
@@ -199,6 +205,8 @@ export const LookupResultPayloadSchema = z.object({
|
|
|
199
205
|
version: z.string().nullable(),
|
|
200
206
|
title: z.string(),
|
|
201
207
|
publishedAt: z.string().nullable(),
|
|
208
|
+
/** First image/gif thumbnail; null when the release has none. */
|
|
209
|
+
thumbnail: ReleaseThumbnailSchema.nullable().optional(),
|
|
202
210
|
}),
|
|
203
211
|
)
|
|
204
212
|
.optional(),
|
package/src/schemas/shared.ts
CHANGED
|
@@ -225,6 +225,15 @@ export const NoticeSchema = z
|
|
|
225
225
|
message: "notice.coordinate must be 'org' or 'org/slug'",
|
|
226
226
|
});
|
|
227
227
|
|
|
228
|
+
/**
|
|
229
|
+
* Display thumbnail derived server-side from a release's first image/gif media
|
|
230
|
+
* entry. Shared by the coverage, lookup, and related-release payloads.
|
|
231
|
+
*/
|
|
232
|
+
export const ReleaseThumbnailSchema = z.object({
|
|
233
|
+
url: z.string(),
|
|
234
|
+
alt: z.string().optional(),
|
|
235
|
+
});
|
|
236
|
+
|
|
228
237
|
export const OverviewPageItemSchema = z.object({
|
|
229
238
|
scope: z.enum(["org", "product"]),
|
|
230
239
|
orgSlug: z.string().nullable().optional(),
|