@buildinternet/releases-api-types 0.53.0 → 0.54.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 +3 -0
- package/src/schemas/collections.ts +24 -1
- package/src/schemas/search.ts +11 -0
- package/src/schemas/shared.ts +3 -2
package/package.json
CHANGED
package/src/api-types.ts
CHANGED
|
@@ -275,6 +275,7 @@ import type {
|
|
|
275
275
|
CollectionWeeklyDigestListItemSchema,
|
|
276
276
|
CollectionWeeklyDigestsResponseSchema,
|
|
277
277
|
DigestCoveredReleaseSchema,
|
|
278
|
+
DigestSectionSchema,
|
|
278
279
|
CollectionWeeklyDigestDetailSchema,
|
|
279
280
|
} from "./schemas/collections.js";
|
|
280
281
|
import type {
|
|
@@ -625,6 +626,7 @@ export {
|
|
|
625
626
|
CollectionWeeklyDigestListItemSchema,
|
|
626
627
|
CollectionWeeklyDigestsResponseSchema,
|
|
627
628
|
DigestCoveredReleaseSchema,
|
|
629
|
+
DigestSectionSchema,
|
|
628
630
|
CollectionWeeklyDigestDetailSchema,
|
|
629
631
|
} from "./schemas/collections.js";
|
|
630
632
|
export {
|
|
@@ -1806,6 +1808,7 @@ export type CollectionDailySummariesResponse = z.infer<
|
|
|
1806
1808
|
export type CollectionWeeklyDigestListItem = z.infer<typeof CollectionWeeklyDigestListItemSchema>;
|
|
1807
1809
|
export type CollectionWeeklyDigestsResponse = z.infer<typeof CollectionWeeklyDigestsResponseSchema>;
|
|
1808
1810
|
export type DigestCoveredRelease = z.infer<typeof DigestCoveredReleaseSchema>;
|
|
1811
|
+
export type DigestSection = z.infer<typeof DigestSectionSchema>;
|
|
1809
1812
|
export type CollectionWeeklyDigestDetail = z.infer<typeof CollectionWeeklyDigestDetailSchema>;
|
|
1810
1813
|
|
|
1811
1814
|
// ── Releases (enriched) ──
|
|
@@ -273,8 +273,18 @@ export const CollectionWeeklyDigestsResponseSchema = z.object({
|
|
|
273
273
|
export const DigestCoveredReleaseSchema = z.object({
|
|
274
274
|
id: z.string(),
|
|
275
275
|
title: z.string(),
|
|
276
|
+
/** Internal `/release/*` path — fallback link only (see `url`). */
|
|
276
277
|
path: z.string(),
|
|
277
|
-
|
|
278
|
+
/** Upstream source URL. Primary link target when http(s); optional for older servers. */
|
|
279
|
+
url: z.string().nullable().optional(),
|
|
280
|
+
org: z.object({
|
|
281
|
+
slug: z.string(),
|
|
282
|
+
name: z.string(),
|
|
283
|
+
avatarUrl: z.string().nullable().optional(),
|
|
284
|
+
githubHandle: z.string().nullable().optional(),
|
|
285
|
+
}),
|
|
286
|
+
/** Product the release's source belongs to, when it has one. */
|
|
287
|
+
product: z.object({ slug: z.string(), name: z.string() }).nullable().optional(),
|
|
278
288
|
/**
|
|
279
289
|
* AI-scored importance 1–5. Null when unscored; optional for older
|
|
280
290
|
* servers. Cheap to project on the existing hydrate — powers the flame
|
|
@@ -283,6 +293,17 @@ export const DigestCoveredReleaseSchema = z.object({
|
|
|
283
293
|
importance: ImportanceScoreSchema,
|
|
284
294
|
});
|
|
285
295
|
|
|
296
|
+
/** One `###` section of a digest body, parsed server-side. */
|
|
297
|
+
export const DigestSectionSchema = z.object({
|
|
298
|
+
heading: z.string(),
|
|
299
|
+
/** Slug the digest page renders as the heading's `id` — link target `#anchor`. */
|
|
300
|
+
anchor: z.string(),
|
|
301
|
+
/** First sentence of the section, plain text. */
|
|
302
|
+
lede: z.string(),
|
|
303
|
+
/** Cited release ids in first-seen order; resolve against the detail's `releases`. */
|
|
304
|
+
releaseIds: z.array(z.string()),
|
|
305
|
+
});
|
|
306
|
+
|
|
286
307
|
/** Full row returned by `GET /v1/collections/:slug/digests/:weekStart`. */
|
|
287
308
|
export const CollectionWeeklyDigestDetailSchema = z.object({
|
|
288
309
|
id: z.string(),
|
|
@@ -297,4 +318,6 @@ export const CollectionWeeklyDigestDetailSchema = z.object({
|
|
|
297
318
|
* still resolves — a release deleted/suppressed after generation is
|
|
298
319
|
* dropped rather than surfaced as a dead link. */
|
|
299
320
|
releases: z.array(DigestCoveredReleaseSchema),
|
|
321
|
+
/** Parsed `###` sections. Optional for older servers. */
|
|
322
|
+
sections: z.array(DigestSectionSchema).optional(),
|
|
300
323
|
});
|
package/src/schemas/search.ts
CHANGED
|
@@ -110,6 +110,14 @@ export const SearchReleaseHitSchema = z.object({
|
|
|
110
110
|
summary: z.string(),
|
|
111
111
|
titleGenerated: z.string().nullable().optional(),
|
|
112
112
|
titleShort: z.string().nullable().optional(),
|
|
113
|
+
/**
|
|
114
|
+
* The release's upstream source URL, when it has one. Lets the web link
|
|
115
|
+
* search/lookup hits straight to the original page instead of the
|
|
116
|
+
* noindexed `/release/<id>` stub — see `releaseLinkProps()` in
|
|
117
|
+
* `web/src/lib/release-link.ts`. Optional for older servers / mid-deploy
|
|
118
|
+
* pin tolerance.
|
|
119
|
+
*/
|
|
120
|
+
url: z.string().nullable().optional(),
|
|
113
121
|
/**
|
|
114
122
|
* AI-scored importance 1–5 (5=landmark, 1=housekeeping). Null when
|
|
115
123
|
* unscored; optional for older servers / mid-deploy pin tolerance.
|
|
@@ -213,6 +221,9 @@ export const LookupResultPayloadSchema = z.object({
|
|
|
213
221
|
publishedAt: z.string().nullable(),
|
|
214
222
|
/** First image/gif thumbnail; null when the release has none. */
|
|
215
223
|
thumbnail: ReleaseThumbnailSchema.nullable().optional(),
|
|
224
|
+
/** The release's upstream source URL, when it has one. See
|
|
225
|
+
* `SearchReleaseHitSchema.url`. */
|
|
226
|
+
url: z.string().nullable().optional(),
|
|
216
227
|
}),
|
|
217
228
|
)
|
|
218
229
|
.optional(),
|
package/src/schemas/shared.ts
CHANGED
|
@@ -206,8 +206,9 @@ export const OverviewCitationSchema = z.object({
|
|
|
206
206
|
releaseId: z.string().nullable().optional(),
|
|
207
207
|
/**
|
|
208
208
|
* Canonical web URL of the on-registry release page for this source, when
|
|
209
|
-
* `releaseId` resolved (#1934).
|
|
210
|
-
*
|
|
209
|
+
* `releaseId` resolved (#1934). Kept for machine consumers; the web Sources
|
|
210
|
+
* footer links `sourceUrl` (the #2218 link policy — `/release/*` pages are
|
|
211
|
+
* noindexed).
|
|
211
212
|
*/
|
|
212
213
|
releaseWebUrl: z.string().nullable().optional(),
|
|
213
214
|
/**
|