@buildinternet/releases-api-types 0.8.1 → 0.10.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/api-types.ts +86 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buildinternet/releases-api-types",
3
- "version": "0.8.1",
3
+ "version": "0.10.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",
package/src/api-types.ts CHANGED
@@ -133,6 +133,7 @@ export interface SitemapPayload {
133
133
  orgs: Array<{ slug: string; lastActivity: string | null }>;
134
134
  sources: Array<{ orgSlug: string; slug: string; latestDate: string | null }>;
135
135
  products: Array<{ orgSlug: string; slug: string }>;
136
+ collections: Array<{ slug: string; updatedAt: string }>;
136
137
  }
137
138
 
138
139
  // ── Organizations ──
@@ -674,6 +675,91 @@ export interface TagDetail {
674
675
  products: TaxonomyProduct[];
675
676
  }
676
677
 
678
+ // ── Collections ──
679
+ //
680
+ // Curated, named groups of orgs that drive a public "playlist" page (e.g.
681
+ // /collections/frontier-ai-labs). Independent of the fixed `category` taxonomy.
682
+
683
+ export interface CollectionMemberOrg {
684
+ slug: string;
685
+ name: string;
686
+ domain: string | null;
687
+ avatarUrl: string | null;
688
+ description: string | null;
689
+ }
690
+
691
+ /** Item shape on GET /v1/collections (list). */
692
+ export interface CollectionListItem {
693
+ slug: string;
694
+ name: string;
695
+ description: string | null;
696
+ memberCount: number;
697
+ }
698
+
699
+ /** Detail shape on GET /v1/collections/:slug. */
700
+ export interface CollectionDetail {
701
+ slug: string;
702
+ name: string;
703
+ description: string | null;
704
+ orgs: CollectionMemberOrg[];
705
+ }
706
+
707
+ /**
708
+ * Cross-org release feed row. Same shape as `OrgReleaseItem` plus the origin
709
+ * `org` block, so the web's release card can render it identically — full
710
+ * `content` lets "Show more" expand to the body instead of the truncated
711
+ * `summary`.
712
+ */
713
+ export interface CollectionReleaseItem extends OrgReleaseItem {
714
+ org: { slug: string; name: string };
715
+ }
716
+
717
+ export interface CollectionReleasesResponse {
718
+ releases: CollectionReleaseItem[];
719
+ pagination: { nextCursor: string | null; limit: number };
720
+ }
721
+
722
+ /** Body for POST /v1/collections. `slug` derives from `name` via toSlug() if omitted. */
723
+ export interface CreateCollectionRequest {
724
+ slug?: string;
725
+ name: string;
726
+ description?: string | null;
727
+ }
728
+
729
+ /** Body for PATCH /v1/collections/:slug. All fields optional; slug rename is allowed. */
730
+ export interface UpdateCollectionRequest {
731
+ slug?: string;
732
+ name?: string;
733
+ description?: string | null;
734
+ }
735
+
736
+ /** A single member entry accepted by the member-write endpoints. */
737
+ export interface CollectionMemberInput {
738
+ /** Either `orgId` (org_…) or `orgSlug` is required; if both are given, `orgId` wins. */
739
+ orgId?: string;
740
+ orgSlug?: string;
741
+ /** Authoring position (default 0). For PUT, omit to use array index. */
742
+ position?: number;
743
+ }
744
+
745
+ /** Body for POST /v1/collections/:slug/members. */
746
+ export type AddCollectionMemberRequest = CollectionMemberInput;
747
+
748
+ /** Body for PUT /v1/collections/:slug/members. Replaces the full membership atomically. */
749
+ export interface ReplaceCollectionMembersRequest {
750
+ orgs: CollectionMemberInput[];
751
+ }
752
+
753
+ /** Bare row returned by POST/PATCH on /v1/collections. */
754
+ export interface CollectionRow {
755
+ id: string;
756
+ slug: string;
757
+ name: string;
758
+ description: string | null;
759
+ createdAt: string;
760
+ updatedAt: string;
761
+ }
762
+
677
763
  // ── Releases (enriched) ──
678
764
 
679
765
  /** Flat release shape returned by GET /v1/releases/:id with source metadata. */