@buildinternet/releases-api-types 0.25.0 → 0.27.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 +1 -1
- package/src/api-types.ts +6 -0
- package/src/schemas/orgs.ts +12 -2
- package/src/schemas/releases.ts +2 -0
- package/src/schemas/search.ts +11 -1
- package/src/schemas/shared.ts +6 -0
- package/src/schemas/sources.ts +20 -0
package/package.json
CHANGED
package/src/api-types.ts
CHANGED
|
@@ -90,6 +90,7 @@ import type {
|
|
|
90
90
|
DeleteSourceReleasesResponseSchema,
|
|
91
91
|
InsertReleaseResponseSchema,
|
|
92
92
|
BatchReleasesResponseSchema,
|
|
93
|
+
RawSnapshotResponseSchema,
|
|
93
94
|
OversizedChangelogFileRowSchema,
|
|
94
95
|
OversizedChangelogFilesResponseSchema,
|
|
95
96
|
FetchableSourcesResponseSchema,
|
|
@@ -316,6 +317,7 @@ export {
|
|
|
316
317
|
DeleteSourceReleasesResponseSchema,
|
|
317
318
|
InsertReleaseResponseSchema,
|
|
318
319
|
BatchReleasesResponseSchema,
|
|
320
|
+
RawSnapshotResponseSchema,
|
|
319
321
|
OversizedChangelogFileRowSchema,
|
|
320
322
|
OversizedChangelogFilesResponseSchema,
|
|
321
323
|
FetchableSourcesResponseSchema,
|
|
@@ -572,6 +574,7 @@ export type DeleteSourceResponse = z.infer<typeof DeleteSourceResponseSchema>;
|
|
|
572
574
|
export type DeleteSourceReleasesResponse = z.infer<typeof DeleteSourceReleasesResponseSchema>;
|
|
573
575
|
export type InsertReleaseResponse = z.infer<typeof InsertReleaseResponseSchema>;
|
|
574
576
|
export type BatchReleasesResponse = z.infer<typeof BatchReleasesResponseSchema>;
|
|
577
|
+
export type RawSnapshotResponse = z.infer<typeof RawSnapshotResponseSchema>;
|
|
575
578
|
export type OversizedChangelogFileRow = z.infer<typeof OversizedChangelogFileRowSchema>;
|
|
576
579
|
export type OversizedChangelogFilesResponse = z.infer<typeof OversizedChangelogFilesResponseSchema>;
|
|
577
580
|
export type FetchableSourcesResponse = z.infer<typeof FetchableSourcesResponseSchema>;
|
|
@@ -703,6 +706,8 @@ export interface ReleaseDetail {
|
|
|
703
706
|
composition?: ReleaseComposition | null;
|
|
704
707
|
/** App Store platform + icon, present only when `sourceType === "appstore"`. */
|
|
705
708
|
appStore?: { platform: "ios" | "macos"; iconUrl: string | null } | null;
|
|
709
|
+
/** Video provider tag, present only when `sourceType === "video"`. */
|
|
710
|
+
video?: { provider: "youtube" | "vimeo" | "wistia" } | null;
|
|
706
711
|
}
|
|
707
712
|
|
|
708
713
|
export type ReleaseCoverageSibling = z.infer<typeof ReleaseCoverageSiblingSchema>;
|
|
@@ -902,6 +907,7 @@ export type OverviewPlanAction = "missing" | "refresh" | "skip";
|
|
|
902
907
|
export interface OverviewManifestRow {
|
|
903
908
|
orgSlug: string;
|
|
904
909
|
orgName: string;
|
|
910
|
+
orgCreatedAt: string;
|
|
905
911
|
discovery: "curated" | "agent" | "on_demand";
|
|
906
912
|
overviewUpdatedAt: string | null;
|
|
907
913
|
overviewGeneratedAt: string | null;
|
package/src/schemas/orgs.ts
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
OverviewPageItemSchema,
|
|
8
8
|
PaginationSchema,
|
|
9
9
|
ReleaseItemSchema,
|
|
10
|
+
VideoSourceInfoSchema,
|
|
10
11
|
} from "./shared.js";
|
|
11
12
|
import { SourceListItemSchema } from "./sources.js";
|
|
12
13
|
import { ProductListItemSchema } from "./products.js";
|
|
@@ -20,6 +21,7 @@ export const OrgListItemSchema = z.object({
|
|
|
20
21
|
description: z.string().nullable(),
|
|
21
22
|
category: CategorySchema.nullable(),
|
|
22
23
|
avatarUrl: z.string().nullable(),
|
|
24
|
+
featured: z.boolean(),
|
|
23
25
|
sourceCount: z.number().int().min(0),
|
|
24
26
|
releaseCount: z.number().int().min(0),
|
|
25
27
|
recentReleaseCount: z.number().int().min(0),
|
|
@@ -108,11 +110,15 @@ export const UpdateOrgBodySchema = z.object({
|
|
|
108
110
|
isHidden: z.boolean().optional(),
|
|
109
111
|
/** Admin-only: opt the org into automatic AI content — org overviews AND per-release summaries (single backend flag `auto_generate_content`). */
|
|
110
112
|
autoGenerateContent: z.boolean().optional(),
|
|
113
|
+
/** Admin-only: promote this org on the home-page featured rail. */
|
|
114
|
+
featured: z.boolean().optional(),
|
|
115
|
+
/** Admin-only: promote or demote the org's discovery status (curated/agent/on_demand). */
|
|
116
|
+
discovery: z.enum(["curated", "agent", "on_demand"]).optional(),
|
|
111
117
|
});
|
|
112
118
|
|
|
113
119
|
// Org detail's products query selects a strict subset of `ProductListItem` —
|
|
114
|
-
// no category/orgId
|
|
115
|
-
//
|
|
120
|
+
// no category/orgId because the parent already names the org; createdAt is
|
|
121
|
+
// included for age-based filtering by consumers.
|
|
116
122
|
const OrgDetailProductSchema = ProductListItemSchema.pick({
|
|
117
123
|
id: true,
|
|
118
124
|
slug: true,
|
|
@@ -121,6 +127,7 @@ const OrgDetailProductSchema = ProductListItemSchema.pick({
|
|
|
121
127
|
description: true,
|
|
122
128
|
sourceCount: true,
|
|
123
129
|
kind: true,
|
|
130
|
+
createdAt: true,
|
|
124
131
|
}).extend({
|
|
125
132
|
releaseCount: z.number().int().min(0),
|
|
126
133
|
});
|
|
@@ -341,6 +348,7 @@ export const OrgReleaseItemSchema = ReleaseItemSchema.extend({
|
|
|
341
348
|
name: z.string(),
|
|
342
349
|
type: z.string(),
|
|
343
350
|
appStore: AppStoreSourceInfoSchema.optional(),
|
|
351
|
+
video: VideoSourceInfoSchema.optional(),
|
|
344
352
|
}),
|
|
345
353
|
/**
|
|
346
354
|
* Owning product, when the release's source is grouped under a product.
|
|
@@ -427,6 +435,8 @@ export const OrgDetailSchema = z.object({
|
|
|
427
435
|
isHidden: z.boolean().optional(),
|
|
428
436
|
/** Admin display flag: org is opted into automatic overviews + per-release summaries. Optional on the wire for older workers mid-deploy. */
|
|
429
437
|
autoGenerateContent: z.boolean().optional(),
|
|
438
|
+
/** Admin display flag: org is promoted on the home-page featured rail. Optional on the wire for older workers mid-deploy. */
|
|
439
|
+
featured: z.boolean().optional(),
|
|
430
440
|
/** Admin display flag: all ingest paused for this org. */
|
|
431
441
|
fetchPaused: z.boolean().optional(),
|
|
432
442
|
/** How the org row was created. `on_demand` orgs are excluded from overview generation regardless of `autoGenerateContent`. */
|
package/src/schemas/releases.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
MediaItemSchema,
|
|
6
6
|
ReleaseCompositionSchema,
|
|
7
7
|
ReleaseTypeSchema,
|
|
8
|
+
VideoSourceInfoSchema,
|
|
8
9
|
} from "./shared.js";
|
|
9
10
|
|
|
10
11
|
// ReleaseCompositionSchema lives in ./shared.js (single source of truth) — both
|
|
@@ -200,6 +201,7 @@ export const ReleaseDetailResponseSchema = z.object({
|
|
|
200
201
|
org: ReleaseDetailOrgSchema.nullable(),
|
|
201
202
|
composition: ReleaseCompositionSchema.nullable(),
|
|
202
203
|
appStore: AppStoreSourceInfoSchema.nullable().optional(),
|
|
204
|
+
video: VideoSourceInfoSchema.nullable().optional(),
|
|
203
205
|
});
|
|
204
206
|
|
|
205
207
|
/**
|
package/src/schemas/search.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { KIND_VALUES } from "@buildinternet/releases-core/kinds";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
AppStoreSourceInfoSchema,
|
|
5
|
+
MediaItemSchema,
|
|
6
|
+
ReleaseTypeSchema,
|
|
7
|
+
VideoSourceInfoSchema,
|
|
8
|
+
} from "./shared.js";
|
|
4
9
|
import { SourceTypeSchema } from "./sources.js";
|
|
5
10
|
import { LookupStatusSchema } from "./lookups.js";
|
|
6
11
|
|
|
@@ -71,6 +76,11 @@ export const SearchReleaseHitSchema = z.object({
|
|
|
71
76
|
* otherwise. Powers the compact app-update treatment on the search card. #1206
|
|
72
77
|
*/
|
|
73
78
|
appStore: AppStoreSourceInfoSchema.nullable().optional(),
|
|
79
|
+
/**
|
|
80
|
+
* Video provider tag for `type: "video"` sources, absent otherwise. Powers
|
|
81
|
+
* the thumbnail-forward video row on search cards. #video
|
|
82
|
+
*/
|
|
83
|
+
video: VideoSourceInfoSchema.nullable().optional(),
|
|
74
84
|
orgSlug: z.string().nullable(),
|
|
75
85
|
orgName: z.string().nullable().optional(),
|
|
76
86
|
/** Owning product slug — present when the source belongs to a product. Lets
|
package/src/schemas/shared.ts
CHANGED
|
@@ -22,6 +22,12 @@ export const AppStoreSourceInfoSchema = z.object({
|
|
|
22
22
|
iconUrl: z.string().nullable(),
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
+
/** Video provider tag, present only when `sourceType === "video"`. Thumbnail
|
|
26
|
+
* and watch URL reuse the release's existing `media[]` / `url`. */
|
|
27
|
+
export const VideoSourceInfoSchema = z.object({
|
|
28
|
+
provider: z.enum(["youtube", "vimeo", "wistia"]),
|
|
29
|
+
});
|
|
30
|
+
|
|
25
31
|
export const PaginationSchema = z.object({
|
|
26
32
|
page: z.number().int().min(1),
|
|
27
33
|
pageSize: z.number().int().min(1),
|
package/src/schemas/sources.ts
CHANGED
|
@@ -246,6 +246,8 @@ export const SourcePatchInputSchema = z.object({
|
|
|
246
246
|
changeDetectedAt: z.string().nullable().optional(),
|
|
247
247
|
lastPolledAt: z.string().nullable().optional(),
|
|
248
248
|
kind: z.enum(KIND_VALUES).nullable().optional(),
|
|
249
|
+
/** Admin-only: promote or demote the source's discovery status (curated/agent/on_demand). */
|
|
250
|
+
discovery: SourceDiscoverySchema.optional(),
|
|
249
251
|
});
|
|
250
252
|
|
|
251
253
|
/** Body accepted by `POST /v1/sources`. */
|
|
@@ -559,6 +561,24 @@ export const BatchReleasesResponseSchema = z.object({
|
|
|
559
561
|
total: z.number().int().min(0),
|
|
560
562
|
});
|
|
561
563
|
|
|
564
|
+
// ── Raw page snapshot (POST /sources/:slug/raw-snapshot) ──
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Response for `POST /v1/sources/:slug/raw-snapshot` (#1283). On a store or a
|
|
568
|
+
* content-hash dedup hit, all fields are present; `stored` is `false` for the
|
|
569
|
+
* dedup case. When the `RAW_SNAPSHOTS` bucket is unbound the capture soft-fails
|
|
570
|
+
* with `{ stored: false, reason: "no_binding" }` and the snapshot fields are
|
|
571
|
+
* omitted — capture is best-effort and never errors ingest.
|
|
572
|
+
*/
|
|
573
|
+
export const RawSnapshotResponseSchema = z.object({
|
|
574
|
+
stored: z.boolean(),
|
|
575
|
+
r2Key: z.string().optional(),
|
|
576
|
+
contentHash: z.string().optional(),
|
|
577
|
+
bytes: z.number().int().min(0).optional(),
|
|
578
|
+
// Only set on the soft-fail path; bounded so consumers can branch on it.
|
|
579
|
+
reason: z.enum(["no_binding"]).optional(),
|
|
580
|
+
});
|
|
581
|
+
|
|
562
582
|
// ── Oversized changelog files (GET /sources/changelog-files/oversized) ──
|
|
563
583
|
|
|
564
584
|
/**
|