@buildinternet/releases-api-types 0.59.0 → 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.
Files changed (126) hide show
  1. package/README.md +14 -6
  2. package/dist/api-types.d.ts +1168 -0
  3. package/dist/api-types.d.ts.map +1 -0
  4. package/dist/api-types.js +134 -0
  5. package/dist/schemas/account-profile.d.ts +29 -0
  6. package/dist/schemas/account-profile.d.ts.map +1 -0
  7. package/dist/schemas/account-profile.js +24 -0
  8. package/dist/schemas/ai-models.d.ts +67 -0
  9. package/dist/schemas/ai-models.d.ts.map +1 -0
  10. package/{src/schemas/ai-models.ts → dist/schemas/ai-models.js} +25 -31
  11. package/dist/schemas/api-keys.d.ts +71 -0
  12. package/dist/schemas/api-keys.d.ts.map +1 -0
  13. package/dist/schemas/api-keys.js +32 -0
  14. package/dist/schemas/classifications.d.ts +134 -0
  15. package/dist/schemas/classifications.d.ts.map +1 -0
  16. package/dist/schemas/classifications.js +96 -0
  17. package/dist/schemas/collections.d.ts +605 -0
  18. package/dist/schemas/collections.d.ts.map +1 -0
  19. package/dist/schemas/collections.js +320 -0
  20. package/dist/schemas/datasets.d.ts +34 -0
  21. package/dist/schemas/datasets.d.ts.map +1 -0
  22. package/dist/schemas/datasets.js +11 -0
  23. package/dist/schemas/errors.d.ts +43 -0
  24. package/dist/schemas/errors.d.ts.map +1 -0
  25. package/dist/schemas/errors.js +61 -0
  26. package/dist/schemas/feedback.d.ts +134 -0
  27. package/dist/schemas/feedback.d.ts.map +1 -0
  28. package/dist/schemas/feedback.js +76 -0
  29. package/dist/schemas/follows.d.ts +154 -0
  30. package/dist/schemas/follows.d.ts.map +1 -0
  31. package/dist/schemas/follows.js +42 -0
  32. package/dist/schemas/listing.d.ts +374 -0
  33. package/dist/schemas/listing.d.ts.map +1 -0
  34. package/dist/schemas/listing.js +175 -0
  35. package/dist/schemas/lookups.d.ts +285 -0
  36. package/dist/schemas/lookups.d.ts.map +1 -0
  37. package/{src/schemas/lookups.ts → dist/schemas/lookups.js} +67 -80
  38. package/dist/schemas/marketing-classifier.d.ts +32 -0
  39. package/dist/schemas/marketing-classifier.d.ts.map +1 -0
  40. package/{src/schemas/marketing-classifier.ts → dist/schemas/marketing-classifier.js} +14 -18
  41. package/dist/schemas/orgs.d.ts +950 -0
  42. package/dist/schemas/orgs.d.ts.map +1 -0
  43. package/dist/schemas/orgs.js +473 -0
  44. package/dist/schemas/overviews.d.ts +205 -0
  45. package/dist/schemas/overviews.d.ts.map +1 -0
  46. package/{src/schemas/overviews.ts → dist/schemas/overviews.js} +41 -54
  47. package/dist/schemas/products.d.ts +595 -0
  48. package/dist/schemas/products.d.ts.map +1 -0
  49. package/{src/schemas/products.ts → dist/schemas/products.js} +113 -136
  50. package/dist/schemas/publish-tokens.d.ts +55 -0
  51. package/dist/schemas/publish-tokens.d.ts.map +1 -0
  52. package/{src/schemas/publish-tokens.ts → dist/schemas/publish-tokens.js} +18 -29
  53. package/dist/schemas/recommendations.d.ts +52 -0
  54. package/dist/schemas/recommendations.d.ts.map +1 -0
  55. package/dist/schemas/recommendations.js +58 -0
  56. package/dist/schemas/related.d.ts +331 -0
  57. package/dist/schemas/related.d.ts.map +1 -0
  58. package/dist/schemas/related.js +115 -0
  59. package/dist/schemas/releases.d.ts +623 -0
  60. package/dist/schemas/releases.d.ts.map +1 -0
  61. package/dist/schemas/releases.js +414 -0
  62. package/dist/schemas/resolve.d.ts +259 -0
  63. package/dist/schemas/resolve.d.ts.map +1 -0
  64. package/{src/schemas/resolve.ts → dist/schemas/resolve.js} +2 -5
  65. package/dist/schemas/search.d.ts +475 -0
  66. package/dist/schemas/search.d.ts.map +1 -0
  67. package/dist/schemas/search.js +258 -0
  68. package/dist/schemas/semantic-alert-summary.d.ts +54 -0
  69. package/dist/schemas/semantic-alert-summary.d.ts.map +1 -0
  70. package/dist/schemas/semantic-alert-summary.js +57 -0
  71. package/dist/schemas/semantic-alerts.d.ts +41 -0
  72. package/dist/schemas/semantic-alerts.d.ts.map +1 -0
  73. package/dist/schemas/semantic-alerts.js +42 -0
  74. package/dist/schemas/shared.d.ts +247 -0
  75. package/dist/schemas/shared.d.ts.map +1 -0
  76. package/dist/schemas/shared.js +248 -0
  77. package/dist/schemas/site-notice.d.ts +35 -0
  78. package/dist/schemas/site-notice.d.ts.map +1 -0
  79. package/{src/schemas/site-notice.ts → dist/schemas/site-notice.js} +14 -18
  80. package/dist/schemas/sitemap.d.ts +97 -0
  81. package/dist/schemas/sitemap.d.ts.map +1 -0
  82. package/dist/schemas/sitemap.js +107 -0
  83. package/dist/schemas/sources.d.ts +1145 -0
  84. package/dist/schemas/sources.d.ts.map +1 -0
  85. package/dist/schemas/sources.js +645 -0
  86. package/dist/schemas/stats.d.ts +82 -0
  87. package/dist/schemas/stats.d.ts.map +1 -0
  88. package/dist/schemas/stats.js +59 -0
  89. package/dist/schemas/taxonomy.d.ts +344 -0
  90. package/dist/schemas/taxonomy.d.ts.map +1 -0
  91. package/{src/schemas/taxonomy.ts → dist/schemas/taxonomy.js} +47 -58
  92. package/dist/schemas/webhooks.d.ts +618 -0
  93. package/dist/schemas/webhooks.d.ts.map +1 -0
  94. package/dist/schemas/webhooks.js +191 -0
  95. package/dist/schemas/well-known.d.ts +302 -0
  96. package/dist/schemas/well-known.d.ts.map +1 -0
  97. package/dist/schemas/well-known.js +192 -0
  98. package/dist/schemas/workspace-integrations.d.ts +27 -0
  99. package/dist/schemas/workspace-integrations.d.ts.map +1 -0
  100. package/dist/schemas/workspace-integrations.js +22 -0
  101. package/package.json +16 -5
  102. package/src/api-types.ts +0 -2229
  103. package/src/schemas/account-profile.ts +0 -28
  104. package/src/schemas/ai-models.test.ts +0 -29
  105. package/src/schemas/classifications.ts +0 -109
  106. package/src/schemas/collections.ts +0 -346
  107. package/src/schemas/datasets.ts +0 -31
  108. package/src/schemas/errors.test.ts +0 -55
  109. package/src/schemas/errors.ts +0 -81
  110. package/src/schemas/feedback.ts +0 -56
  111. package/src/schemas/listing.ts +0 -226
  112. package/src/schemas/orgs.ts +0 -533
  113. package/src/schemas/recommendations.ts +0 -39
  114. package/src/schemas/related.ts +0 -126
  115. package/src/schemas/releases.ts +0 -449
  116. package/src/schemas/search.ts +0 -274
  117. package/src/schemas/semantic-alert-summary.ts +0 -65
  118. package/src/schemas/shared.notice.test.ts +0 -36
  119. package/src/schemas/shared.ts +0 -267
  120. package/src/schemas/site-notice.test.ts +0 -67
  121. package/src/schemas/sitemap.ts +0 -117
  122. package/src/schemas/sources.ts +0 -674
  123. package/src/schemas/stats.ts +0 -62
  124. package/src/schemas/well-known.test.ts +0 -264
  125. package/src/schemas/well-known.ts +0 -252
  126. 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
- });
@@ -1,117 +0,0 @@
1
- import { z } from "zod";
2
- import { DatasetDescriptionSchema } from "./datasets.js";
3
-
4
- /**
5
- * Per-source row in `GET /v1/sitemap`. `hasChangelog` and `hasHighlights`
6
- * are `.optional()` for backwards compatibility — older clients ignore the
7
- * fields, but the current handler always populates them (#875).
8
- */
9
- export const SitemapSourceSchema = z.object({
10
- /**
11
- * Source id. `.optional()` for backwards compatibility — added #1190 so the
12
- * web can route shadowed sources to `/sources/:id`; older/cached responses
13
- * may omit it and the web degrades to the bare URL.
14
- */
15
- id: z.string().optional(),
16
- /** Null explicitly disables; absence supports older API deploys. */
17
- dataset: DatasetDescriptionSchema.nullable().optional(),
18
- orgSlug: z.string(),
19
- slug: z.string(),
20
- latestDate: z.string().nullable(),
21
- /**
22
- * Whether this source has a stored GitHub CHANGELOG file. Used by the web
23
- * sitemap to emit `/{org}/{src}/changelog` URLs only for sources where the
24
- * route resolves.
25
- */
26
- hasChangelog: z.boolean().optional(),
27
- /**
28
- * Whether this source has any rolling or monthly highlight summaries.
29
- * Drives `/{org}/{src}/highlights` sitemap emission.
30
- */
31
- hasHighlights: z.boolean().optional(),
32
- });
33
-
34
- /**
35
- * Bulk URL payload consumed by the web sitemap generator. Lists every
36
- * orgs/sources/products/collections slug paired with the timestamp the web
37
- * uses to drive `<lastmod>`. Soft-deleted / hidden / on_demand rows are
38
- * excluded.
39
- */
40
- export const SitemapPayloadSchema = z.object({
41
- orgs: z.array(
42
- z.object({
43
- slug: z.string(),
44
- lastActivity: z.string().nullable(),
45
- /**
46
- * Total releases across the org's sources — the same count org detail
47
- * reports as `releaseCount`. With `hasOverview`, drives the web's index
48
- * bar for the org and its products/sources. `.optional()` for backwards
49
- * compatibility with older cached responses.
50
- */
51
- releaseCount: z.number().int().optional(),
52
- /** Whether the org has a generated overview page. */
53
- hasOverview: z.boolean().optional(),
54
- }),
55
- ),
56
- sources: z.array(SitemapSourceSchema),
57
- products: z.array(
58
- z.object({
59
- orgSlug: z.string(),
60
- slug: z.string(),
61
- /**
62
- * Visible releases across the product's visible sources — the same count
63
- * org detail reports per product. Drives the web's product index bar.
64
- * `.optional()` for backwards compatibility with older cached responses.
65
- */
66
- releaseCount: z.number().int().optional(),
67
- }),
68
- ),
69
- collections: z.array(z.object({ slug: z.string(), updatedAt: z.string() })),
70
- /**
71
- * Weekly collection digest permalinks (`/collections/:slug/digest/:week`),
72
- * with `generatedAt` driving `<lastmod>`. `.optional()` for backwards
73
- * compatibility with older cached responses. Small at 12 collections × 52
74
- * weeks/year, so no dedicated `/sitemap/digests` surface (unlike releases).
75
- */
76
- digests: z
77
- .array(
78
- z.object({
79
- collectionSlug: z.string(),
80
- weekStart: z.string(),
81
- generatedAt: z.string(),
82
- }),
83
- )
84
- .optional(),
85
- });
86
-
87
- /**
88
- * Per-release row previously returned by `GET /v1/sitemap/releases` (#1181,
89
- * scoped down). Carries what the web needed to build the slugged canonical
90
- * `/release/...` URL (`releasePath()` inputs) plus `fetchedAt` for `<lastmod>`.
91
- *
92
- * @deprecated The endpoint was retired in #2219 — its only consumer
93
- * (`sitemap-releases.xml`) was removed in #2218 when release pages went
94
- * `noindex`. Kept for one minor version per the deprecation lane; will be
95
- * removed in a future minor.
96
- */
97
- export const SitemapReleaseSchema = z.object({
98
- id: z.string(),
99
- title: z.string(),
100
- titleShort: z.string().nullable(),
101
- titleGenerated: z.string().nullable(),
102
- version: z.string().nullable(),
103
- publishedAt: z.string().nullable(),
104
- fetchedAt: z.string(),
105
- });
106
-
107
- /**
108
- * Payload previously returned by the curated release sitemap endpoint.
109
- *
110
- * @deprecated The endpoint was retired in #2219 — its only consumer
111
- * (`sitemap-releases.xml`) was removed in #2218 when release pages went
112
- * `noindex`. Kept for one minor version per the deprecation lane; will be
113
- * removed in a future minor.
114
- */
115
- export const SitemapReleasesPayloadSchema = z.object({
116
- releases: z.array(SitemapReleaseSchema),
117
- });