@buildinternet/releases-api-types 0.46.0 → 0.48.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 +26 -2
- package/src/schemas/collections.ts +50 -1
- package/src/schemas/related.ts +6 -0
- package/src/schemas/search.ts +6 -0
- package/src/schemas/sitemap.ts +38 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buildinternet/releases-api-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.48.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",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"README.md"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@buildinternet/releases-core": "^0.
|
|
20
|
+
"@buildinternet/releases-core": "^0.28.0",
|
|
21
21
|
"zod": "^4.4.3"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
package/src/api-types.ts
CHANGED
|
@@ -203,7 +203,12 @@ import type {
|
|
|
203
203
|
FeedbackUpdateBodySchema,
|
|
204
204
|
FeedbackDeleteResponseSchema,
|
|
205
205
|
} from "./schemas/feedback.js";
|
|
206
|
-
import type {
|
|
206
|
+
import type {
|
|
207
|
+
SitemapSourceSchema,
|
|
208
|
+
SitemapPayloadSchema,
|
|
209
|
+
SitemapReleaseSchema,
|
|
210
|
+
SitemapReleasesPayloadSchema,
|
|
211
|
+
} from "./schemas/sitemap.js";
|
|
207
212
|
import type {
|
|
208
213
|
RelatedScopeSchema,
|
|
209
214
|
RelatedReleaseThumbnailSchema,
|
|
@@ -239,6 +244,10 @@ import type {
|
|
|
239
244
|
AddCollectionMemberResponseSchema,
|
|
240
245
|
CollectionDailySummarySchema,
|
|
241
246
|
CollectionDailySummariesResponseSchema,
|
|
247
|
+
CollectionWeeklyDigestListItemSchema,
|
|
248
|
+
CollectionWeeklyDigestsResponseSchema,
|
|
249
|
+
DigestCoveredReleaseSchema,
|
|
250
|
+
CollectionWeeklyDigestDetailSchema,
|
|
242
251
|
} from "./schemas/collections.js";
|
|
243
252
|
import type {
|
|
244
253
|
OrgOverviewResponseSchema,
|
|
@@ -510,7 +519,12 @@ export {
|
|
|
510
519
|
FeedbackUpdateBodySchema,
|
|
511
520
|
FeedbackDeleteResponseSchema,
|
|
512
521
|
} from "./schemas/feedback.js";
|
|
513
|
-
export {
|
|
522
|
+
export {
|
|
523
|
+
SitemapSourceSchema,
|
|
524
|
+
SitemapPayloadSchema,
|
|
525
|
+
SitemapReleaseSchema,
|
|
526
|
+
SitemapReleasesPayloadSchema,
|
|
527
|
+
} from "./schemas/sitemap.js";
|
|
514
528
|
export { errorEnvelopeSchema, decodeApiError, isApiError } from "./schemas/errors.js";
|
|
515
529
|
export type { ErrorEnvelope, DecodedApiError } from "./schemas/errors.js";
|
|
516
530
|
export {
|
|
@@ -548,6 +562,10 @@ export {
|
|
|
548
562
|
AddCollectionMemberResponseSchema,
|
|
549
563
|
CollectionDailySummarySchema,
|
|
550
564
|
CollectionDailySummariesResponseSchema,
|
|
565
|
+
CollectionWeeklyDigestListItemSchema,
|
|
566
|
+
CollectionWeeklyDigestsResponseSchema,
|
|
567
|
+
DigestCoveredReleaseSchema,
|
|
568
|
+
CollectionWeeklyDigestDetailSchema,
|
|
551
569
|
} from "./schemas/collections.js";
|
|
552
570
|
export {
|
|
553
571
|
OrgOverviewResponseSchema,
|
|
@@ -623,6 +641,8 @@ export interface CreateUserApiKeyBody {
|
|
|
623
641
|
|
|
624
642
|
export type SitemapSource = z.infer<typeof SitemapSourceSchema>;
|
|
625
643
|
export type SitemapPayload = z.infer<typeof SitemapPayloadSchema>;
|
|
644
|
+
export type SitemapRelease = z.infer<typeof SitemapReleaseSchema>;
|
|
645
|
+
export type SitemapReleasesPayload = z.infer<typeof SitemapReleasesPayloadSchema>;
|
|
626
646
|
|
|
627
647
|
// ── Related (Vectorize neighbors) ──
|
|
628
648
|
|
|
@@ -1527,6 +1547,10 @@ export type CollectionDailySummary = z.infer<typeof CollectionDailySummarySchema
|
|
|
1527
1547
|
export type CollectionDailySummariesResponse = z.infer<
|
|
1528
1548
|
typeof CollectionDailySummariesResponseSchema
|
|
1529
1549
|
>;
|
|
1550
|
+
export type CollectionWeeklyDigestListItem = z.infer<typeof CollectionWeeklyDigestListItemSchema>;
|
|
1551
|
+
export type CollectionWeeklyDigestsResponse = z.infer<typeof CollectionWeeklyDigestsResponseSchema>;
|
|
1552
|
+
export type DigestCoveredRelease = z.infer<typeof DigestCoveredReleaseSchema>;
|
|
1553
|
+
export type CollectionWeeklyDigestDetail = z.infer<typeof CollectionWeeklyDigestDetailSchema>;
|
|
1530
1554
|
|
|
1531
1555
|
// ── Releases (enriched) ──
|
|
1532
1556
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { ReleaseItemSchema } from "./shared.js";
|
|
2
|
+
import { ImportanceScoreSchema, ReleaseItemSchema } from "./shared.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* One org as it appears inside a collection's preview list or detail page.
|
|
@@ -249,3 +249,52 @@ export const CollectionDailySummarySchema = z.object({
|
|
|
249
249
|
export const CollectionDailySummariesResponseSchema = z.object({
|
|
250
250
|
summaries: z.array(CollectionDailySummarySchema),
|
|
251
251
|
});
|
|
252
|
+
|
|
253
|
+
// ── Weekly digests ────────────────────────────────────────────────
|
|
254
|
+
|
|
255
|
+
/** List row on `GET /v1/collections/:slug/digests` — newest-first, no body. */
|
|
256
|
+
export const CollectionWeeklyDigestListItemSchema = z.object({
|
|
257
|
+
id: z.string(),
|
|
258
|
+
/** ET Monday starting the covered week, YYYY-MM-DD. */
|
|
259
|
+
weekStart: z.string(),
|
|
260
|
+
title: z.string(),
|
|
261
|
+
intro: z.string(),
|
|
262
|
+
releaseCount: z.number().int().nonnegative(),
|
|
263
|
+
generatedAt: z.string(),
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
/** Cursor pagination shape matches the other paginated list surfaces. */
|
|
267
|
+
export const CollectionWeeklyDigestsResponseSchema = z.object({
|
|
268
|
+
digests: z.array(CollectionWeeklyDigestListItemSchema),
|
|
269
|
+
pagination: CollectionFeedPaginationSchema,
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
/** Minimal, server-resolved release info for a digest's "Releases covered" list. */
|
|
273
|
+
export const DigestCoveredReleaseSchema = z.object({
|
|
274
|
+
id: z.string(),
|
|
275
|
+
title: z.string(),
|
|
276
|
+
path: z.string(),
|
|
277
|
+
org: z.object({ slug: z.string(), name: z.string() }),
|
|
278
|
+
/**
|
|
279
|
+
* AI-scored importance 1–5. Null when unscored; optional for older
|
|
280
|
+
* servers. Cheap to project on the existing hydrate — powers the flame
|
|
281
|
+
* marker on the collapsed "Releases covered" list.
|
|
282
|
+
*/
|
|
283
|
+
importance: ImportanceScoreSchema,
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
/** Full row returned by `GET /v1/collections/:slug/digests/:weekStart`. */
|
|
287
|
+
export const CollectionWeeklyDigestDetailSchema = z.object({
|
|
288
|
+
id: z.string(),
|
|
289
|
+
weekStart: z.string(),
|
|
290
|
+
title: z.string(),
|
|
291
|
+
intro: z.string(),
|
|
292
|
+
body: z.string(),
|
|
293
|
+
releaseIds: z.array(z.string()),
|
|
294
|
+
releaseCount: z.number().int().nonnegative(),
|
|
295
|
+
generatedAt: z.string(),
|
|
296
|
+
/** Server-resolved minimal release info for every id in `releaseIds` that
|
|
297
|
+
* still resolves — a release deleted/suppressed after generation is
|
|
298
|
+
* dropped rather than surfaced as a dead link. */
|
|
299
|
+
releases: z.array(DigestCoveredReleaseSchema),
|
|
300
|
+
});
|
package/src/schemas/related.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { ImportanceScoreSchema } from "./shared.js";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Anchor scope for related-* lookups. `org` filters the Vectorize query by
|
|
@@ -38,6 +39,11 @@ export const RelatedReleaseItemSchema = z.object({
|
|
|
38
39
|
summary: z.string(),
|
|
39
40
|
titleGenerated: z.string().nullable(),
|
|
40
41
|
titleShort: z.string().nullable(),
|
|
42
|
+
/**
|
|
43
|
+
* AI-scored importance 1–5 (5=landmark, 1=housekeeping). Null when
|
|
44
|
+
* unscored; optional for older servers / mid-deploy pin tolerance.
|
|
45
|
+
*/
|
|
46
|
+
importance: ImportanceScoreSchema,
|
|
41
47
|
thumbnail: RelatedReleaseThumbnailSchema.nullable(),
|
|
42
48
|
score: z.number(),
|
|
43
49
|
source: RelatedReleaseSourceSchema,
|
package/src/schemas/search.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { KIND_VALUES } from "@buildinternet/releases-core/kinds";
|
|
3
3
|
import {
|
|
4
4
|
AppStoreSourceInfoSchema,
|
|
5
|
+
ImportanceScoreSchema,
|
|
5
6
|
MediaItemSchema,
|
|
6
7
|
OrgStatusSchema,
|
|
7
8
|
ReleaseThumbnailSchema,
|
|
@@ -109,6 +110,11 @@ export const SearchReleaseHitSchema = z.object({
|
|
|
109
110
|
summary: z.string(),
|
|
110
111
|
titleGenerated: z.string().nullable().optional(),
|
|
111
112
|
titleShort: z.string().nullable().optional(),
|
|
113
|
+
/**
|
|
114
|
+
* AI-scored importance 1–5 (5=landmark, 1=housekeeping). Null when
|
|
115
|
+
* unscored; optional for older servers / mid-deploy pin tolerance.
|
|
116
|
+
*/
|
|
117
|
+
importance: ImportanceScoreSchema,
|
|
112
118
|
/**
|
|
113
119
|
* Full markdown body. Omitted on list hits by default (summary + media
|
|
114
120
|
* cover the card/snippet surfaces). Opt in with `?include_content=true`
|
package/src/schemas/sitemap.ts
CHANGED
|
@@ -39,4 +39,42 @@ export const SitemapPayloadSchema = z.object({
|
|
|
39
39
|
sources: z.array(SitemapSourceSchema),
|
|
40
40
|
products: z.array(z.object({ orgSlug: z.string(), slug: z.string() })),
|
|
41
41
|
collections: z.array(z.object({ slug: z.string(), updatedAt: z.string() })),
|
|
42
|
+
/**
|
|
43
|
+
* Weekly collection digest permalinks (`/collections/:slug/digest/:week`),
|
|
44
|
+
* with `generatedAt` driving `<lastmod>`. `.optional()` for backwards
|
|
45
|
+
* compatibility with older cached responses. Small at 12 collections × 52
|
|
46
|
+
* weeks/year, so no dedicated `/sitemap/digests` surface (unlike releases).
|
|
47
|
+
*/
|
|
48
|
+
digests: z
|
|
49
|
+
.array(
|
|
50
|
+
z.object({
|
|
51
|
+
collectionSlug: z.string(),
|
|
52
|
+
weekStart: z.string(),
|
|
53
|
+
generatedAt: z.string(),
|
|
54
|
+
}),
|
|
55
|
+
)
|
|
56
|
+
.optional(),
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Per-release row in `GET /v1/sitemap/releases` (#1181, scoped down). Carries
|
|
61
|
+
* exactly what the web needs to build the slugged canonical `/release/...`
|
|
62
|
+
* URL (`releasePath()` inputs) plus `fetchedAt` for `<lastmod>`.
|
|
63
|
+
*/
|
|
64
|
+
export const SitemapReleaseSchema = z.object({
|
|
65
|
+
id: z.string(),
|
|
66
|
+
title: z.string(),
|
|
67
|
+
titleShort: z.string().nullable(),
|
|
68
|
+
titleGenerated: z.string().nullable(),
|
|
69
|
+
version: z.string().nullable(),
|
|
70
|
+
publishedAt: z.string().nullable(),
|
|
71
|
+
fetchedAt: z.string(),
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Payload for the curated release sitemap: visible releases with a summary
|
|
76
|
+
* and importance at or above the experiment threshold, newest first, capped.
|
|
77
|
+
*/
|
|
78
|
+
export const SitemapReleasesPayloadSchema = z.object({
|
|
79
|
+
releases: z.array(SitemapReleaseSchema),
|
|
42
80
|
});
|