@buildinternet/releases-api-types 0.45.1 → 0.47.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buildinternet/releases-api-types",
3
- "version": "0.45.1",
3
+ "version": "0.47.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.27.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 { SitemapSourceSchema, SitemapPayloadSchema } from "./schemas/sitemap.js";
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 { SitemapSourceSchema, SitemapPayloadSchema } from "./schemas/sitemap.js";
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
 
@@ -249,3 +249,46 @@ 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
+
280
+ /** Full row returned by `GET /v1/collections/:slug/digests/:weekStart`. */
281
+ export const CollectionWeeklyDigestDetailSchema = z.object({
282
+ id: z.string(),
283
+ weekStart: z.string(),
284
+ title: z.string(),
285
+ intro: z.string(),
286
+ body: z.string(),
287
+ releaseIds: z.array(z.string()),
288
+ releaseCount: z.number().int().nonnegative(),
289
+ generatedAt: z.string(),
290
+ /** Server-resolved minimal release info for every id in `releaseIds` that
291
+ * still resolves — a release deleted/suppressed after generation is
292
+ * dropped rather than surfaced as a dead link. */
293
+ releases: z.array(DigestCoveredReleaseSchema),
294
+ });
@@ -228,6 +228,16 @@ export const UnifiedSearchResponseSchema = z.object({
228
228
  // domain filter was applied.
229
229
  domain: z.string().optional(),
230
230
  domainStatus: z.enum(["matched", "not_found"]).optional(),
231
+ // Normalized `?category=` echo. Present only when a category filter was
232
+ // applied; the resolved canonical slug (aliases are folded to canonical).
233
+ // `categoryStatus` is always `matched` because an unknown category is a 400,
234
+ // not an empty envelope — categories are a fixed enum, unlike collections.
235
+ category: z.string().optional(),
236
+ categoryStatus: z.enum(["matched"]).optional(),
237
+ // Normalized `?collection=` echo + resolution outcome. `not_found` when the
238
+ // slug matched no collection (empty envelope, mirroring `domainStatus`).
239
+ collection: z.string().optional(),
240
+ collectionStatus: z.enum(["matched", "not_found"]).optional(),
231
241
  orgs: z.array(SearchOrgHitSchema),
232
242
  catalog: z.array(SearchCatalogHitSchema),
233
243
  sources: z.array(SearchSourceHitSchema),
@@ -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
  });