@buildinternet/releases-api-types 0.8.1 → 0.9.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 +70 -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.9.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
@@ -674,6 +674,76 @@ export interface TagDetail {
674
674
  products: TaxonomyProduct[];
675
675
  }
676
676
 
677
+ // ── Collections ──
678
+ //
679
+ // Curated, named groups of orgs that drive a public "playlist" page (e.g.
680
+ // /collections/frontier-ai-labs). Independent of the fixed `category` taxonomy.
681
+
682
+ export interface CollectionMemberOrg {
683
+ slug: string;
684
+ name: string;
685
+ domain: string | null;
686
+ avatarUrl: string | null;
687
+ description: string | null;
688
+ }
689
+
690
+ /** Item shape on GET /v1/collections (list). */
691
+ export interface CollectionListItem {
692
+ slug: string;
693
+ name: string;
694
+ description: string | null;
695
+ memberCount: number;
696
+ }
697
+
698
+ /** Detail shape on GET /v1/collections/:slug. */
699
+ export interface CollectionDetail {
700
+ slug: string;
701
+ name: string;
702
+ description: string | null;
703
+ orgs: CollectionMemberOrg[];
704
+ }
705
+
706
+ /** Body for POST /v1/collections. `slug` derives from `name` via toSlug() if omitted. */
707
+ export interface CreateCollectionRequest {
708
+ slug?: string;
709
+ name: string;
710
+ description?: string | null;
711
+ }
712
+
713
+ /** Body for PATCH /v1/collections/:slug. All fields optional; slug rename is allowed. */
714
+ export interface UpdateCollectionRequest {
715
+ slug?: string;
716
+ name?: string;
717
+ description?: string | null;
718
+ }
719
+
720
+ /** A single member entry accepted by the member-write endpoints. */
721
+ export interface CollectionMemberInput {
722
+ /** Either `orgId` (org_…) or `orgSlug` is required; if both are given, `orgId` wins. */
723
+ orgId?: string;
724
+ orgSlug?: string;
725
+ /** Authoring position (default 0). For PUT, omit to use array index. */
726
+ position?: number;
727
+ }
728
+
729
+ /** Body for POST /v1/collections/:slug/members. */
730
+ export type AddCollectionMemberRequest = CollectionMemberInput;
731
+
732
+ /** Body for PUT /v1/collections/:slug/members. Replaces the full membership atomically. */
733
+ export interface ReplaceCollectionMembersRequest {
734
+ orgs: CollectionMemberInput[];
735
+ }
736
+
737
+ /** Bare row returned by POST/PATCH on /v1/collections. */
738
+ export interface CollectionRow {
739
+ id: string;
740
+ slug: string;
741
+ name: string;
742
+ description: string | null;
743
+ createdAt: string;
744
+ updatedAt: string;
745
+ }
746
+
677
747
  // ── Releases (enriched) ──
678
748
 
679
749
  /** Flat release shape returned by GET /v1/releases/:id with source metadata. */