@buildinternet/releases-api-types 0.9.0 → 0.11.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 +33 -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.11.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.19.0",
|
|
21
21
|
"zod": "^4.3.6"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
package/src/api-types.ts
CHANGED
|
@@ -19,6 +19,7 @@ import type {
|
|
|
19
19
|
ReleaseItemSchema,
|
|
20
20
|
ReleaseSummaryItemSchema,
|
|
21
21
|
OverviewPageItemSchema,
|
|
22
|
+
OverviewCitationSchema,
|
|
22
23
|
} from "./schemas/shared.js";
|
|
23
24
|
import type {
|
|
24
25
|
OrgListItemSchema,
|
|
@@ -68,6 +69,7 @@ export {
|
|
|
68
69
|
ReleaseItemSchema,
|
|
69
70
|
ReleaseSummaryItemSchema,
|
|
70
71
|
OverviewPageItemSchema,
|
|
72
|
+
OverviewCitationSchema,
|
|
71
73
|
CategorySchema,
|
|
72
74
|
} from "./schemas/shared.js";
|
|
73
75
|
export {
|
|
@@ -133,6 +135,7 @@ export interface SitemapPayload {
|
|
|
133
135
|
orgs: Array<{ slug: string; lastActivity: string | null }>;
|
|
134
136
|
sources: Array<{ orgSlug: string; slug: string; latestDate: string | null }>;
|
|
135
137
|
products: Array<{ orgSlug: string; slug: string }>;
|
|
138
|
+
collections: Array<{ slug: string; updatedAt: string }>;
|
|
136
139
|
}
|
|
137
140
|
|
|
138
141
|
// ── Organizations ──
|
|
@@ -491,6 +494,7 @@ export interface UnifiedSearchResponse {
|
|
|
491
494
|
// ── Overview Pages ──
|
|
492
495
|
|
|
493
496
|
export type OverviewPageItem = z.infer<typeof OverviewPageItemSchema>;
|
|
497
|
+
export type OverviewCitation = z.infer<typeof OverviewCitationSchema>;
|
|
494
498
|
|
|
495
499
|
/** @deprecated Use OverviewPageItem */
|
|
496
500
|
export type KnowledgePageItem = OverviewPageItem;
|
|
@@ -684,15 +688,19 @@ export interface CollectionMemberOrg {
|
|
|
684
688
|
name: string;
|
|
685
689
|
domain: string | null;
|
|
686
690
|
avatarUrl: string | null;
|
|
691
|
+
/** GitHub handle from org_accounts; lets the avatar fall back to github.com/<handle>.png. */
|
|
692
|
+
githubHandle: string | null;
|
|
687
693
|
description: string | null;
|
|
688
694
|
}
|
|
689
695
|
|
|
690
|
-
/** Item shape on GET /v1/collections (list). */
|
|
696
|
+
/** Item shape on GET /v1/collections (list) and GET /v1/orgs/:slug/collections. */
|
|
691
697
|
export interface CollectionListItem {
|
|
692
698
|
slug: string;
|
|
693
699
|
name: string;
|
|
694
700
|
description: string | null;
|
|
695
701
|
memberCount: number;
|
|
702
|
+
/** First few members for inline preview on the list page (capped at 3). */
|
|
703
|
+
previewMembers?: CollectionMemberOrg[];
|
|
696
704
|
}
|
|
697
705
|
|
|
698
706
|
/** Detail shape on GET /v1/collections/:slug. */
|
|
@@ -703,6 +711,30 @@ export interface CollectionDetail {
|
|
|
703
711
|
orgs: CollectionMemberOrg[];
|
|
704
712
|
}
|
|
705
713
|
|
|
714
|
+
/**
|
|
715
|
+
* Cross-org release feed row. Same shape as `OrgReleaseItem` plus the origin
|
|
716
|
+
* `org` block, so the web's release card can render it identically — full
|
|
717
|
+
* `content` lets "Show more" expand to the body instead of the truncated
|
|
718
|
+
* `summary`.
|
|
719
|
+
*/
|
|
720
|
+
export interface CollectionReleaseItem extends OrgReleaseItem {
|
|
721
|
+
org: { slug: string; name: string };
|
|
722
|
+
/**
|
|
723
|
+
* Product the release belongs to, if the source is bound to one. Powers
|
|
724
|
+
* the timeline's same-product rollup ("3 earlier Claude Code releases
|
|
725
|
+
* today") on the collections view. `null` for orgs without products or
|
|
726
|
+
* standalone sources. Optional on the wire so older workers mid-rollout
|
|
727
|
+
* (and hand-constructed test fixtures) don't trip the typecheck — clients
|
|
728
|
+
* should treat missing and `null` identically.
|
|
729
|
+
*/
|
|
730
|
+
product?: { slug: string; name: string } | null;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
export interface CollectionReleasesResponse {
|
|
734
|
+
releases: CollectionReleaseItem[];
|
|
735
|
+
pagination: { nextCursor: string | null; limit: number };
|
|
736
|
+
}
|
|
737
|
+
|
|
706
738
|
/** Body for POST /v1/collections. `slug` derives from `name` via toSlug() if omitted. */
|
|
707
739
|
export interface CreateCollectionRequest {
|
|
708
740
|
slug?: string;
|
package/src/schemas/shared.ts
CHANGED
|
@@ -68,6 +68,22 @@ export const ReleaseSummaryItemSchema = z.object({
|
|
|
68
68
|
generatedAt: z.string(),
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Inline citation attached to an overview page (#846). Each row maps a
|
|
73
|
+
* character span in `OverviewPageItem.content` back to a release URL the
|
|
74
|
+
* model cited via Anthropic's search_result blocks. Optional everywhere it
|
|
75
|
+
* appears — pages generated before #846 lands have none, and consumers
|
|
76
|
+
* should degrade gracefully.
|
|
77
|
+
*/
|
|
78
|
+
export const OverviewCitationSchema = z.object({
|
|
79
|
+
startIndex: z.number().int().min(0),
|
|
80
|
+
endIndex: z.number().int().min(0),
|
|
81
|
+
sourceUrl: z.string(),
|
|
82
|
+
title: z.string().nullable().optional(),
|
|
83
|
+
citedText: z.string(),
|
|
84
|
+
releaseId: z.string().nullable().optional(),
|
|
85
|
+
});
|
|
86
|
+
|
|
71
87
|
export const OverviewPageItemSchema = z.object({
|
|
72
88
|
scope: z.enum(["org", "product"]),
|
|
73
89
|
orgSlug: z.string().nullable().optional(),
|
|
@@ -77,4 +93,5 @@ export const OverviewPageItemSchema = z.object({
|
|
|
77
93
|
lastContributingReleaseAt: z.string().nullable(),
|
|
78
94
|
generatedAt: z.string(),
|
|
79
95
|
updatedAt: z.string(),
|
|
96
|
+
citations: z.array(OverviewCitationSchema).optional(),
|
|
80
97
|
});
|