@buildinternet/releases-api-types 0.58.3 → 0.60.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/README.md +14 -6
- package/dist/api-types.d.ts +1168 -0
- package/dist/api-types.d.ts.map +1 -0
- package/dist/api-types.js +134 -0
- package/dist/schemas/account-profile.d.ts +29 -0
- package/dist/schemas/account-profile.d.ts.map +1 -0
- package/dist/schemas/account-profile.js +24 -0
- package/dist/schemas/ai-models.d.ts +67 -0
- package/dist/schemas/ai-models.d.ts.map +1 -0
- package/{src/schemas/ai-models.ts → dist/schemas/ai-models.js} +25 -31
- package/dist/schemas/api-keys.d.ts +71 -0
- package/dist/schemas/api-keys.d.ts.map +1 -0
- package/dist/schemas/api-keys.js +32 -0
- package/dist/schemas/classifications.d.ts +134 -0
- package/dist/schemas/classifications.d.ts.map +1 -0
- package/dist/schemas/classifications.js +96 -0
- package/dist/schemas/collections.d.ts +605 -0
- package/dist/schemas/collections.d.ts.map +1 -0
- package/dist/schemas/collections.js +320 -0
- package/dist/schemas/datasets.d.ts +34 -0
- package/dist/schemas/datasets.d.ts.map +1 -0
- package/dist/schemas/datasets.js +11 -0
- package/dist/schemas/errors.d.ts +43 -0
- package/dist/schemas/errors.d.ts.map +1 -0
- package/dist/schemas/errors.js +61 -0
- package/dist/schemas/feedback.d.ts +134 -0
- package/dist/schemas/feedback.d.ts.map +1 -0
- package/dist/schemas/feedback.js +76 -0
- package/dist/schemas/follows.d.ts +154 -0
- package/dist/schemas/follows.d.ts.map +1 -0
- package/dist/schemas/follows.js +42 -0
- package/dist/schemas/listing.d.ts +374 -0
- package/dist/schemas/listing.d.ts.map +1 -0
- package/dist/schemas/listing.js +175 -0
- package/dist/schemas/lookups.d.ts +285 -0
- package/dist/schemas/lookups.d.ts.map +1 -0
- package/{src/schemas/lookups.ts → dist/schemas/lookups.js} +67 -80
- package/dist/schemas/marketing-classifier.d.ts +32 -0
- package/dist/schemas/marketing-classifier.d.ts.map +1 -0
- package/{src/schemas/marketing-classifier.ts → dist/schemas/marketing-classifier.js} +14 -18
- package/dist/schemas/orgs.d.ts +950 -0
- package/dist/schemas/orgs.d.ts.map +1 -0
- package/dist/schemas/orgs.js +473 -0
- package/dist/schemas/overviews.d.ts +205 -0
- package/dist/schemas/overviews.d.ts.map +1 -0
- package/{src/schemas/overviews.ts → dist/schemas/overviews.js} +41 -54
- package/dist/schemas/products.d.ts +595 -0
- package/dist/schemas/products.d.ts.map +1 -0
- package/{src/schemas/products.ts → dist/schemas/products.js} +113 -136
- package/dist/schemas/publish-tokens.d.ts +55 -0
- package/dist/schemas/publish-tokens.d.ts.map +1 -0
- package/{src/schemas/publish-tokens.ts → dist/schemas/publish-tokens.js} +18 -29
- package/dist/schemas/recommendations.d.ts +52 -0
- package/dist/schemas/recommendations.d.ts.map +1 -0
- package/dist/schemas/recommendations.js +58 -0
- package/dist/schemas/related.d.ts +331 -0
- package/dist/schemas/related.d.ts.map +1 -0
- package/dist/schemas/related.js +115 -0
- package/dist/schemas/releases.d.ts +623 -0
- package/dist/schemas/releases.d.ts.map +1 -0
- package/dist/schemas/releases.js +414 -0
- package/dist/schemas/resolve.d.ts +259 -0
- package/dist/schemas/resolve.d.ts.map +1 -0
- package/{src/schemas/resolve.ts → dist/schemas/resolve.js} +2 -5
- package/dist/schemas/search.d.ts +475 -0
- package/dist/schemas/search.d.ts.map +1 -0
- package/dist/schemas/search.js +258 -0
- package/dist/schemas/semantic-alert-summary.d.ts +54 -0
- package/dist/schemas/semantic-alert-summary.d.ts.map +1 -0
- package/dist/schemas/semantic-alert-summary.js +57 -0
- package/dist/schemas/semantic-alerts.d.ts +41 -0
- package/dist/schemas/semantic-alerts.d.ts.map +1 -0
- package/dist/schemas/semantic-alerts.js +42 -0
- package/dist/schemas/shared.d.ts +247 -0
- package/dist/schemas/shared.d.ts.map +1 -0
- package/dist/schemas/shared.js +248 -0
- package/dist/schemas/site-notice.d.ts +35 -0
- package/dist/schemas/site-notice.d.ts.map +1 -0
- package/{src/schemas/site-notice.ts → dist/schemas/site-notice.js} +14 -18
- package/dist/schemas/sitemap.d.ts +97 -0
- package/dist/schemas/sitemap.d.ts.map +1 -0
- package/dist/schemas/sitemap.js +107 -0
- package/dist/schemas/sources.d.ts +1145 -0
- package/dist/schemas/sources.d.ts.map +1 -0
- package/dist/schemas/sources.js +645 -0
- package/dist/schemas/stats.d.ts +82 -0
- package/dist/schemas/stats.d.ts.map +1 -0
- package/dist/schemas/stats.js +59 -0
- package/dist/schemas/taxonomy.d.ts +344 -0
- package/dist/schemas/taxonomy.d.ts.map +1 -0
- package/{src/schemas/taxonomy.ts → dist/schemas/taxonomy.js} +47 -58
- package/dist/schemas/webhooks.d.ts +618 -0
- package/dist/schemas/webhooks.d.ts.map +1 -0
- package/dist/schemas/webhooks.js +191 -0
- package/dist/schemas/well-known.d.ts +302 -0
- package/dist/schemas/well-known.d.ts.map +1 -0
- package/dist/schemas/well-known.js +192 -0
- package/dist/schemas/workspace-integrations.d.ts +27 -0
- package/dist/schemas/workspace-integrations.d.ts.map +1 -0
- package/dist/schemas/workspace-integrations.js +22 -0
- package/package.json +16 -4
- package/src/api-types.ts +0 -2223
- package/src/schemas/account-profile.ts +0 -28
- package/src/schemas/ai-models.test.ts +0 -29
- package/src/schemas/classifications.ts +0 -109
- package/src/schemas/collections.ts +0 -346
- package/src/schemas/errors.test.ts +0 -55
- package/src/schemas/errors.ts +0 -81
- package/src/schemas/feedback.ts +0 -56
- package/src/schemas/listing.ts +0 -226
- package/src/schemas/orgs.ts +0 -533
- package/src/schemas/recommendations.ts +0 -39
- package/src/schemas/related.ts +0 -126
- package/src/schemas/releases.ts +0 -436
- package/src/schemas/search.ts +0 -274
- package/src/schemas/semantic-alert-summary.ts +0 -65
- package/src/schemas/shared.notice.test.ts +0 -36
- package/src/schemas/shared.ts +0 -267
- package/src/schemas/site-notice.test.ts +0 -67
- package/src/schemas/sitemap.ts +0 -114
- package/src/schemas/sources.ts +0 -674
- package/src/schemas/stats.ts +0 -62
- package/src/schemas/well-known.test.ts +0 -264
- package/src/schemas/well-known.ts +0 -252
- package/src/schemas/workspace-integrations.ts +0 -26
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "bun:test";
|
|
2
|
-
import { SiteNoticeSchema, SiteNoticeResponseSchema } from "./site-notice";
|
|
3
|
-
|
|
4
|
-
const valid = {
|
|
5
|
-
active: true,
|
|
6
|
-
message: "We shipped a new feed",
|
|
7
|
-
linkText: "See it",
|
|
8
|
-
href: "https://releases.sh/updates",
|
|
9
|
-
placement: "banner" as const,
|
|
10
|
-
color: "#0081e7",
|
|
11
|
-
dismissible: false,
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
describe("SiteNoticeSchema", () => {
|
|
15
|
-
it("accepts a fully-specified notice", () => {
|
|
16
|
-
expect(SiteNoticeSchema.safeParse(valid).success).toBe(true);
|
|
17
|
-
});
|
|
18
|
-
it("accepts a site-relative href and omitted link", () => {
|
|
19
|
-
const { href, linkText, ...rest } = valid;
|
|
20
|
-
expect(SiteNoticeSchema.safeParse({ ...rest, href: "/updates" }).success).toBe(true);
|
|
21
|
-
expect(SiteNoticeSchema.safeParse(rest).success).toBe(true);
|
|
22
|
-
});
|
|
23
|
-
it("rejects an over-length message", () => {
|
|
24
|
-
expect(SiteNoticeSchema.safeParse({ ...valid, message: "x".repeat(281) }).success).toBe(false);
|
|
25
|
-
});
|
|
26
|
-
it("rejects an empty message", () => {
|
|
27
|
-
expect(SiteNoticeSchema.safeParse({ ...valid, message: "" }).success).toBe(false);
|
|
28
|
-
});
|
|
29
|
-
it("rejects a bad placement", () => {
|
|
30
|
-
expect(SiteNoticeSchema.safeParse({ ...valid, placement: "footer" }).success).toBe(false);
|
|
31
|
-
});
|
|
32
|
-
it("rejects a non-hex color", () => {
|
|
33
|
-
expect(SiteNoticeSchema.safeParse({ ...valid, color: "blue" }).success).toBe(false);
|
|
34
|
-
expect(SiteNoticeSchema.safeParse({ ...valid, color: "#fff" }).success).toBe(false);
|
|
35
|
-
});
|
|
36
|
-
it("rejects an href that is neither absolute http(s) nor root-relative", () => {
|
|
37
|
-
expect(SiteNoticeSchema.safeParse({ ...valid, href: "ftp://x.y" }).success).toBe(false);
|
|
38
|
-
expect(SiteNoticeSchema.safeParse({ ...valid, href: "updates" }).success).toBe(false);
|
|
39
|
-
});
|
|
40
|
-
it("rejects linkText without an href (dead CTA)", () => {
|
|
41
|
-
const { href, ...noHref } = valid; // keeps linkText
|
|
42
|
-
expect(SiteNoticeSchema.safeParse(noHref).success).toBe(false);
|
|
43
|
-
});
|
|
44
|
-
it("accepts href without linkText", () => {
|
|
45
|
-
const { linkText, ...noLinkText } = valid;
|
|
46
|
-
expect(SiteNoticeSchema.safeParse(noLinkText).success).toBe(true);
|
|
47
|
-
});
|
|
48
|
-
it("rejects javascript:/data: schemes and protocol-relative hrefs", () => {
|
|
49
|
-
expect(SiteNoticeSchema.safeParse({ ...valid, href: "javascript:alert(1)" }).success).toBe(
|
|
50
|
-
false,
|
|
51
|
-
);
|
|
52
|
-
expect(SiteNoticeSchema.safeParse({ ...valid, href: "data:text/html,x" }).success).toBe(false);
|
|
53
|
-
expect(SiteNoticeSchema.safeParse({ ...valid, href: "//evil.com" }).success).toBe(false);
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
describe("SiteNoticeResponseSchema", () => {
|
|
58
|
-
it("accepts null", () => {
|
|
59
|
-
expect(SiteNoticeResponseSchema.safeParse({ notice: null }).success).toBe(true);
|
|
60
|
-
});
|
|
61
|
-
it("accepts a stored notice with updatedAt", () => {
|
|
62
|
-
const r = SiteNoticeResponseSchema.safeParse({
|
|
63
|
-
notice: { ...valid, updatedAt: "2026-06-11T00:00:00.000Z" },
|
|
64
|
-
});
|
|
65
|
-
expect(r.success).toBe(true);
|
|
66
|
-
});
|
|
67
|
-
});
|
package/src/schemas/sitemap.ts
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Per-source row in `GET /v1/sitemap`. `hasChangelog` and `hasHighlights`
|
|
5
|
-
* are `.optional()` for backwards compatibility — older clients ignore the
|
|
6
|
-
* fields, but the current handler always populates them (#875).
|
|
7
|
-
*/
|
|
8
|
-
export const SitemapSourceSchema = z.object({
|
|
9
|
-
/**
|
|
10
|
-
* Source id. `.optional()` for backwards compatibility — added #1190 so the
|
|
11
|
-
* web can route shadowed sources to `/sources/:id`; older/cached responses
|
|
12
|
-
* may omit it and the web degrades to the bare URL.
|
|
13
|
-
*/
|
|
14
|
-
id: z.string().optional(),
|
|
15
|
-
orgSlug: z.string(),
|
|
16
|
-
slug: z.string(),
|
|
17
|
-
latestDate: z.string().nullable(),
|
|
18
|
-
/**
|
|
19
|
-
* Whether this source has a stored GitHub CHANGELOG file. Used by the web
|
|
20
|
-
* sitemap to emit `/{org}/{src}/changelog` URLs only for sources where the
|
|
21
|
-
* route resolves.
|
|
22
|
-
*/
|
|
23
|
-
hasChangelog: z.boolean().optional(),
|
|
24
|
-
/**
|
|
25
|
-
* Whether this source has any rolling or monthly highlight summaries.
|
|
26
|
-
* Drives `/{org}/{src}/highlights` sitemap emission.
|
|
27
|
-
*/
|
|
28
|
-
hasHighlights: z.boolean().optional(),
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Bulk URL payload consumed by the web sitemap generator. Lists every
|
|
33
|
-
* orgs/sources/products/collections slug paired with the timestamp the web
|
|
34
|
-
* uses to drive `<lastmod>`. Soft-deleted / hidden / on_demand rows are
|
|
35
|
-
* excluded.
|
|
36
|
-
*/
|
|
37
|
-
export const SitemapPayloadSchema = z.object({
|
|
38
|
-
orgs: z.array(
|
|
39
|
-
z.object({
|
|
40
|
-
slug: z.string(),
|
|
41
|
-
lastActivity: z.string().nullable(),
|
|
42
|
-
/**
|
|
43
|
-
* Total releases across the org's sources — the same count org detail
|
|
44
|
-
* reports as `releaseCount`. With `hasOverview`, drives the web's index
|
|
45
|
-
* bar for the org and its products/sources. `.optional()` for backwards
|
|
46
|
-
* compatibility with older cached responses.
|
|
47
|
-
*/
|
|
48
|
-
releaseCount: z.number().int().optional(),
|
|
49
|
-
/** Whether the org has a generated overview page. */
|
|
50
|
-
hasOverview: z.boolean().optional(),
|
|
51
|
-
}),
|
|
52
|
-
),
|
|
53
|
-
sources: z.array(SitemapSourceSchema),
|
|
54
|
-
products: z.array(
|
|
55
|
-
z.object({
|
|
56
|
-
orgSlug: z.string(),
|
|
57
|
-
slug: z.string(),
|
|
58
|
-
/**
|
|
59
|
-
* Visible releases across the product's visible sources — the same count
|
|
60
|
-
* org detail reports per product. Drives the web's product index bar.
|
|
61
|
-
* `.optional()` for backwards compatibility with older cached responses.
|
|
62
|
-
*/
|
|
63
|
-
releaseCount: z.number().int().optional(),
|
|
64
|
-
}),
|
|
65
|
-
),
|
|
66
|
-
collections: z.array(z.object({ slug: z.string(), updatedAt: z.string() })),
|
|
67
|
-
/**
|
|
68
|
-
* Weekly collection digest permalinks (`/collections/:slug/digest/:week`),
|
|
69
|
-
* with `generatedAt` driving `<lastmod>`. `.optional()` for backwards
|
|
70
|
-
* compatibility with older cached responses. Small at 12 collections × 52
|
|
71
|
-
* weeks/year, so no dedicated `/sitemap/digests` surface (unlike releases).
|
|
72
|
-
*/
|
|
73
|
-
digests: z
|
|
74
|
-
.array(
|
|
75
|
-
z.object({
|
|
76
|
-
collectionSlug: z.string(),
|
|
77
|
-
weekStart: z.string(),
|
|
78
|
-
generatedAt: z.string(),
|
|
79
|
-
}),
|
|
80
|
-
)
|
|
81
|
-
.optional(),
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Per-release row previously returned by `GET /v1/sitemap/releases` (#1181,
|
|
86
|
-
* scoped down). Carries what the web needed to build the slugged canonical
|
|
87
|
-
* `/release/...` URL (`releasePath()` inputs) plus `fetchedAt` for `<lastmod>`.
|
|
88
|
-
*
|
|
89
|
-
* @deprecated The endpoint was retired in #2219 — its only consumer
|
|
90
|
-
* (`sitemap-releases.xml`) was removed in #2218 when release pages went
|
|
91
|
-
* `noindex`. Kept for one minor version per the deprecation lane; will be
|
|
92
|
-
* removed in a future minor.
|
|
93
|
-
*/
|
|
94
|
-
export const SitemapReleaseSchema = z.object({
|
|
95
|
-
id: z.string(),
|
|
96
|
-
title: z.string(),
|
|
97
|
-
titleShort: z.string().nullable(),
|
|
98
|
-
titleGenerated: z.string().nullable(),
|
|
99
|
-
version: z.string().nullable(),
|
|
100
|
-
publishedAt: z.string().nullable(),
|
|
101
|
-
fetchedAt: z.string(),
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Payload previously returned by the curated release sitemap endpoint.
|
|
106
|
-
*
|
|
107
|
-
* @deprecated The endpoint was retired in #2219 — its only consumer
|
|
108
|
-
* (`sitemap-releases.xml`) was removed in #2218 when release pages went
|
|
109
|
-
* `noindex`. Kept for one minor version per the deprecation lane; will be
|
|
110
|
-
* removed in a future minor.
|
|
111
|
-
*/
|
|
112
|
-
export const SitemapReleasesPayloadSchema = z.object({
|
|
113
|
-
releases: z.array(SitemapReleaseSchema),
|
|
114
|
-
});
|