@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.
Files changed (125) 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 -4
  102. package/src/api-types.ts +0 -2223
  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/errors.test.ts +0 -55
  108. package/src/schemas/errors.ts +0 -81
  109. package/src/schemas/feedback.ts +0 -56
  110. package/src/schemas/listing.ts +0 -226
  111. package/src/schemas/orgs.ts +0 -533
  112. package/src/schemas/recommendations.ts +0 -39
  113. package/src/schemas/related.ts +0 -126
  114. package/src/schemas/releases.ts +0 -436
  115. package/src/schemas/search.ts +0 -274
  116. package/src/schemas/semantic-alert-summary.ts +0 -65
  117. package/src/schemas/shared.notice.test.ts +0 -36
  118. package/src/schemas/shared.ts +0 -267
  119. package/src/schemas/site-notice.test.ts +0 -67
  120. package/src/schemas/sitemap.ts +0 -114
  121. package/src/schemas/sources.ts +0 -674
  122. package/src/schemas/stats.ts +0 -62
  123. package/src/schemas/well-known.test.ts +0 -264
  124. package/src/schemas/well-known.ts +0 -252
  125. 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,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
- });