@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
@@ -2,7 +2,6 @@ import { z } from "zod";
2
2
  import { KIND_VALUES } from "@buildinternet/releases-core/kinds";
3
3
  import { CategorySchema, ListResponseSchema, NoticeSchema, ReleaseItemSchema } from "./shared.js";
4
4
  import { SourceTypeSchema, SourceFeedPaginationSchema } from "./sources.js";
5
-
6
5
  /**
7
6
  * Raw `products` table row, returned by `POST /v1/products` and
8
7
  * `PATCH /v1/products/:slug`. The OSS CLI types these responses against
@@ -13,27 +12,24 @@ import { SourceTypeSchema, SourceFeedPaginationSchema } from "./sources.js";
13
12
  * indexed for semantic search.
14
13
  */
15
14
  export const ProductRowSchema = z.object({
16
- id: z.string(),
17
- name: z.string(),
18
- slug: z.string(),
19
- orgId: z.string(),
20
- url: z.string().nullable(),
21
- description: z.string().nullable(),
22
- category: CategorySchema.nullable(),
23
- kind: z.enum(KIND_VALUES).nullable().optional(),
24
- avatarUrl: z.string().nullable().optional(),
25
- createdAt: z.string(),
26
- embeddedAt: z.string().nullable(),
27
- deletedAt: z.string().nullable(),
28
- });
29
-
15
+ id: z.string(),
16
+ name: z.string(),
17
+ slug: z.string(),
18
+ orgId: z.string(),
19
+ url: z.string().nullable(),
20
+ description: z.string().nullable(),
21
+ category: CategorySchema.nullable(),
22
+ kind: z.enum(KIND_VALUES).nullable().optional(),
23
+ avatarUrl: z.string().nullable().optional(),
24
+ createdAt: z.string(),
25
+ embeddedAt: z.string().nullable(),
26
+ deletedAt: z.string().nullable(),
27
+ });
30
28
  /** 201 body of POST /v1/products — ProductRow plus an optional non-blocking
31
29
  * warning emitted when the new slug shadows an existing same-org source (#1190). */
32
30
  export const ProductCreateResponseSchema = ProductRowSchema.extend({
33
- warning: z.string().optional(),
31
+ warning: z.string().optional(),
34
32
  });
35
- export type ProductCreateResponse = z.infer<typeof ProductCreateResponseSchema>;
36
-
37
33
  /**
38
34
  * Per-product row returned by `GET /v1/products`. Adds `sourceCount` to
39
35
  * the row shape but omits the internal `embeddedAt` / `deletedAt` columns
@@ -42,36 +38,33 @@ export type ProductCreateResponse = z.infer<typeof ProductCreateResponseSchema>;
42
38
  * list surfaces can render the avatar without a per-row detail round-trip.
43
39
  */
44
40
  export const ProductListItemSchema = z.object({
45
- id: z.string(),
46
- name: z.string(),
47
- slug: z.string(),
48
- orgId: z.string(),
49
- url: z.string().nullable(),
50
- description: z.string().nullable(),
51
- category: CategorySchema.nullable(),
52
- kind: z.enum(KIND_VALUES).nullable().optional(),
53
- avatarUrl: z.string().nullable().optional(),
54
- createdAt: z.string(),
55
- sourceCount: z.number().int().min(0),
56
- });
57
-
41
+ id: z.string(),
42
+ name: z.string(),
43
+ slug: z.string(),
44
+ orgId: z.string(),
45
+ url: z.string().nullable(),
46
+ description: z.string().nullable(),
47
+ category: CategorySchema.nullable(),
48
+ kind: z.enum(KIND_VALUES).nullable().optional(),
49
+ avatarUrl: z.string().nullable().optional(),
50
+ createdAt: z.string(),
51
+ sourceCount: z.number().int().min(0),
52
+ });
58
53
  export const ProductListResponseSchema = ListResponseSchema(ProductListItemSchema);
59
-
60
54
  /**
61
55
  * Embedded source row returned in `ProductDetail.sources`. The detail
62
56
  * handler explicitly selects only this small subset; reuses the shared
63
57
  * `SourceTypeSchema` enum so source types stay in one place.
64
58
  */
65
59
  export const ProductDetailSourceSchema = z.object({
66
- id: z.string(),
67
- slug: z.string(),
68
- name: z.string(),
69
- type: SourceTypeSchema,
70
- url: z.string(),
71
- metadata: z.string().nullable().optional(),
72
- kind: z.enum(KIND_VALUES).nullable().optional(),
73
- });
74
-
60
+ id: z.string(),
61
+ slug: z.string(),
62
+ name: z.string(),
63
+ type: SourceTypeSchema,
64
+ url: z.string(),
65
+ metadata: z.string().nullable().optional(),
66
+ kind: z.enum(KIND_VALUES).nullable().optional(),
67
+ });
75
68
  /**
76
69
  * Returned by `GET /v1/products/:identifier` (and the org-scoped twin).
77
70
  * Spreads the raw product row and adds `sources`, `tags`, `aliases`.
@@ -82,16 +75,15 @@ export const ProductDetailSourceSchema = z.object({
82
75
  * `ProductDetail` without the embedded feed.
83
76
  */
84
77
  export const ProductDetailSchema = ProductRowSchema.extend({
85
- sources: z.array(ProductDetailSourceSchema),
86
- tags: z.array(z.string()),
87
- aliases: z.array(z.string()),
88
- /** Embedded release feed — set by the web format adapter (PR #1207), absent on bare product detail. */
89
- releases: z.array(ReleaseItemSchema).optional(),
90
- /** Cursor pagination for the embedded release feed — set by the web format adapter (PR #1207), absent on bare product detail. */
91
- pagination: SourceFeedPaginationSchema.optional(),
92
- notice: NoticeSchema.nullable().optional(),
93
- });
94
-
78
+ sources: z.array(ProductDetailSourceSchema),
79
+ tags: z.array(z.string()),
80
+ aliases: z.array(z.string()),
81
+ /** Embedded release feed — set by the web format adapter (PR #1207), absent on bare product detail. */
82
+ releases: z.array(ReleaseItemSchema).optional(),
83
+ /** Cursor pagination for the embedded release feed — set by the web format adapter (PR #1207), absent on bare product detail. */
84
+ pagination: SourceFeedPaginationSchema.optional(),
85
+ notice: NoticeSchema.nullable().optional(),
86
+ });
95
87
  /**
96
88
  * Body accepted by `POST /v1/products`. `category` is a non-empty string at
97
89
  * the wire boundary so callers can pass either a canonical slug or one of
@@ -101,34 +93,32 @@ export const ProductDetailSchema = ProductRowSchema.extend({
101
93
  * bypassed into persisting an invalid `""` value.
102
94
  */
103
95
  export const CreateProductBodySchema = z.object({
104
- name: z.string().min(1),
105
- orgId: z.string().optional(),
106
- orgSlug: z.string().optional(),
107
- slug: z.string().optional(),
108
- url: z.string().optional(),
109
- description: z.string().optional(),
110
- category: z.string().min(1).optional(),
111
- tags: z.array(z.string()).optional(),
112
- kind: z.enum(KIND_VALUES).nullable().optional(),
113
- });
114
-
96
+ name: z.string().min(1),
97
+ orgId: z.string().optional(),
98
+ orgSlug: z.string().optional(),
99
+ slug: z.string().optional(),
100
+ url: z.string().optional(),
101
+ description: z.string().optional(),
102
+ category: z.string().min(1).optional(),
103
+ tags: z.array(z.string()).optional(),
104
+ kind: z.enum(KIND_VALUES).nullable().optional(),
105
+ });
115
106
  /**
116
107
  * Body accepted by `PATCH /v1/products/:slug`. Same alias-allowed string rule
117
108
  * as create, plus `null` to explicitly clear the overlay. Empty strings stay
118
109
  * rejected so callers must pick between a slug/alias or `null`.
119
110
  */
120
111
  export const UpdateProductBodySchema = z.object({
121
- name: z.string().optional(),
122
- url: z.string().nullable().optional(),
123
- description: z.string().nullable().optional(),
124
- category: z.string().min(1).nullable().optional(),
125
- tags: z.array(z.string()).optional(),
126
- aliases: z.array(z.string()).optional(),
127
- kind: z.enum(KIND_VALUES).nullable().optional(),
128
- avatarUrl: z.string().nullable().optional(),
129
- notice: NoticeSchema.nullable().optional(),
130
- });
131
-
112
+ name: z.string().optional(),
113
+ url: z.string().nullable().optional(),
114
+ description: z.string().nullable().optional(),
115
+ category: z.string().min(1).nullable().optional(),
116
+ tags: z.array(z.string()).optional(),
117
+ aliases: z.array(z.string()).optional(),
118
+ kind: z.enum(KIND_VALUES).nullable().optional(),
119
+ avatarUrl: z.string().nullable().optional(),
120
+ notice: NoticeSchema.nullable().optional(),
121
+ });
132
122
  /**
133
123
  * Body accepted by `POST /v1/products/adopt`.
134
124
  *
@@ -137,14 +127,13 @@ export const UpdateProductBodySchema = z.object({
137
127
  * `slug` and `url` must be omitted (the existing product's values stand).
138
128
  */
139
129
  export const AdoptProductBodySchema = z.object({
140
- sourceOrgSlug: z.string().min(1),
141
- targetOrgSlug: z.string().min(1),
142
- slug: z.string().optional(),
143
- url: z.string().optional(),
144
- mergeInto: z.string().optional(),
145
- dryRun: z.boolean().optional(),
146
- });
147
-
130
+ sourceOrgSlug: z.string().min(1),
131
+ targetOrgSlug: z.string().min(1),
132
+ slug: z.string().optional(),
133
+ url: z.string().optional(),
134
+ mergeInto: z.string().optional(),
135
+ dryRun: z.boolean().optional(),
136
+ });
148
137
  /**
149
138
  * Live (non-dryRun) result from `POST /v1/products/adopt`.
150
139
  *
@@ -152,99 +141,87 @@ export const AdoptProductBodySchema = z.object({
152
141
  * existing product's slug, signalling that no new product was created.
153
142
  */
154
143
  export const ProductAdoptResultSchema = z.object({
155
- product: ProductRowSchema,
156
- mergedInto: z.string().optional(),
157
- sourcesMoved: z.number().int().min(0),
158
- accountsMoved: z.number().int().min(0),
159
- sourceOrgDeleted: z.string(),
144
+ product: ProductRowSchema,
145
+ mergedInto: z.string().optional(),
146
+ sourcesMoved: z.number().int().min(0),
147
+ accountsMoved: z.number().int().min(0),
148
+ sourceOrgDeleted: z.string(),
160
149
  });
161
-
162
150
  /** Dry-run preview from `POST /v1/products/adopt` with `dryRun: true`. */
163
151
  export const ProductAdoptDryRunSchema = z.object({
164
- dryRun: z.literal(true),
165
- mergeInto: z.string().optional(),
166
- product: z.object({
167
- name: z.string(),
168
- slug: z.string(),
169
- url: z.string().nullable(),
170
- orgSlug: z.string(),
171
- }),
172
- sourcesToMove: z.array(z.string()),
173
- sourceOrgToDelete: z.string(),
152
+ dryRun: z.literal(true),
153
+ mergeInto: z.string().optional(),
154
+ product: z.object({
155
+ name: z.string(),
156
+ slug: z.string(),
157
+ url: z.string().nullable(),
158
+ orgSlug: z.string(),
159
+ }),
160
+ sourcesToMove: z.array(z.string()),
161
+ sourceOrgToDelete: z.string(),
174
162
  });
175
-
176
163
  /** Response shape returned by `POST /v1/products/adopt` (union of live + dry-run). */
177
164
  export const ProductAdoptResponseSchema = z.union([
178
- ProductAdoptResultSchema,
179
- ProductAdoptDryRunSchema,
165
+ ProductAdoptResultSchema,
166
+ ProductAdoptDryRunSchema,
180
167
  ]);
181
-
182
168
  /** Response shape returned by `DELETE /v1/products/:identifier`. */
183
169
  export const ProductDeleteResponseSchema = z.object({
184
- deleted: z.literal(true),
185
- hard: z.literal(true).optional(),
186
- deletedAt: z.string().optional(),
170
+ deleted: z.literal(true),
171
+ hard: z.literal(true).optional(),
172
+ deletedAt: z.string().optional(),
187
173
  });
188
-
189
174
  /**
190
175
  * Tag list returned by `GET /v1/products/:identifier/tags`. Tag names are
191
176
  * sorted alphabetically; the empty array is returned when the product has
192
177
  * no tags rather than 404.
193
178
  */
194
179
  export const ProductTagsListResponseSchema = z.array(z.string());
195
-
196
180
  /** Body accepted by `PUT` and `DELETE` `/v1/products/:identifier/tags`. */
197
181
  export const ProductTagsBodySchema = z.object({
198
- tags: z.array(z.string()),
182
+ tags: z.array(z.string()),
199
183
  });
200
-
201
184
  /** Response shape returned by `PUT` and `DELETE` `/v1/products/:identifier/tags`. */
202
185
  export const ProductTagsMutationResponseSchema = z.object({
203
- ok: z.literal(true),
186
+ ok: z.literal(true),
204
187
  });
205
-
206
188
  // ── Product activity (/products/:slug/activity, /orgs/:orgSlug/products/:productSlug/activity) ──
207
-
208
189
  const ProductActivityWeeklyBucketSchema = z.object({
209
- weekStart: z.string(),
210
- count: z.number().int().min(0),
211
- earliestVersion: z.string().nullable(),
212
- latestVersion: z.string().nullable(),
190
+ weekStart: z.string(),
191
+ count: z.number().int().min(0),
192
+ earliestVersion: z.string().nullable(),
193
+ latestVersion: z.string().nullable(),
213
194
  });
214
-
215
195
  const ProductActivitySourceSchema = z.object({
216
- slug: z.string(),
217
- name: z.string(),
218
- releaseCount: z.number().int().min(0),
219
- avgReleasesPerWeek: z.number(),
220
- earliestVersion: z.string().nullable(),
221
- latestVersion: z.string().nullable(),
222
- latestDate: z.string().nullable(),
223
- weeklyBuckets: z.array(ProductActivityWeeklyBucketSchema),
224
- });
225
-
196
+ slug: z.string(),
197
+ name: z.string(),
198
+ releaseCount: z.number().int().min(0),
199
+ avgReleasesPerWeek: z.number(),
200
+ earliestVersion: z.string().nullable(),
201
+ latestVersion: z.string().nullable(),
202
+ latestDate: z.string().nullable(),
203
+ weeklyBuckets: z.array(ProductActivityWeeklyBucketSchema),
204
+ });
226
205
  /**
227
206
  * Response shape for `GET /v1/products/:slug/activity` and the org-scoped twin.
228
207
  * Returns per-source weekly release buckets plus an aggregate rollup — used for
229
208
  * timeline visualization on the product detail page.
230
209
  */
231
210
  export const ProductActivityResponseSchema = z.object({
232
- product: z.object({ slug: z.string(), name: z.string() }),
233
- range: z.object({ from: z.string(), to: z.string() }),
234
- sources: z.array(ProductActivitySourceSchema),
235
- aggregateWeekly: z.array(z.object({ weekStart: z.string(), count: z.number().int().min(0) })),
211
+ product: z.object({ slug: z.string(), name: z.string() }),
212
+ range: z.object({ from: z.string(), to: z.string() }),
213
+ sources: z.array(ProductActivitySourceSchema),
214
+ aggregateWeekly: z.array(z.object({ weekStart: z.string(), count: z.number().int().min(0) })),
236
215
  });
237
-
238
216
  // ── Product heatmap (/products/:slug/heatmap, /orgs/:orgSlug/products/:productSlug/heatmap) ──
239
-
240
217
  /**
241
218
  * Response shape for `GET /v1/products/:slug/heatmap` and the org-scoped twin.
242
219
  * Returns daily release counts for the trailing 365 days — used for
243
220
  * contribution-graph visualization on the product detail page.
244
221
  */
245
222
  export const ProductHeatmapResponseSchema = z.object({
246
- product: z.object({ slug: z.string(), name: z.string() }),
247
- range: z.object({ from: z.string(), to: z.string() }),
248
- dailyCounts: z.array(z.object({ date: z.string(), count: z.number().int().min(0) })),
249
- total: z.number().int().min(0),
223
+ product: z.object({ slug: z.string(), name: z.string() }),
224
+ range: z.object({ from: z.string(), to: z.string() }),
225
+ dailyCounts: z.array(z.object({ date: z.string(), count: z.number().int().min(0) })),
226
+ total: z.number().int().min(0),
250
227
  });
@@ -0,0 +1,55 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Owner-minted publish tokens (#2373): a verified domain owner mints a `relk_`
4
+ * token bound to ONE source, usable only on that source's
5
+ * `POST …/releases/batch` route (e.g. from the publish-changelog GitHub Action).
6
+ * Served by the session-only `/v1/me/publish-tokens` routes.
7
+ */
8
+ /** POST /v1/me/publish-tokens request body. */
9
+ export declare const CreatePublishTokenBodySchema: z.ZodObject<{
10
+ sourceId: z.ZodString;
11
+ name: z.ZodString;
12
+ }, z.core.$strict>;
13
+ export type CreatePublishTokenBody = z.infer<typeof CreatePublishTokenBodySchema>;
14
+ /** POST /v1/me/publish-tokens 201 response. `token` is shown exactly once. */
15
+ export declare const CreatedPublishTokenSchema: z.ZodObject<{
16
+ token: z.ZodString;
17
+ id: z.ZodString;
18
+ sourceId: z.ZodString;
19
+ name: z.ZodString;
20
+ createdAt: z.ZodString;
21
+ }, z.core.$strict>;
22
+ export type CreatedPublishToken = z.infer<typeof CreatedPublishTokenSchema>;
23
+ /** One publish token as listed back to its owner — never the secret. */
24
+ export declare const PublishTokenSchema: z.ZodObject<{
25
+ id: z.ZodString;
26
+ name: z.ZodString;
27
+ sourceId: z.ZodString;
28
+ sourceSlug: z.ZodNullable<z.ZodString>;
29
+ orgSlug: z.ZodNullable<z.ZodString>;
30
+ createdAt: z.ZodString;
31
+ lastUsedAt: z.ZodNullable<z.ZodString>;
32
+ revokedAt: z.ZodNullable<z.ZodString>;
33
+ }, z.core.$strict>;
34
+ export type PublishToken = z.infer<typeof PublishTokenSchema>;
35
+ /** GET /v1/me/publish-tokens response. */
36
+ export declare const ListPublishTokensResponseSchema: z.ZodObject<{
37
+ publishTokens: z.ZodArray<z.ZodObject<{
38
+ id: z.ZodString;
39
+ name: z.ZodString;
40
+ sourceId: z.ZodString;
41
+ sourceSlug: z.ZodNullable<z.ZodString>;
42
+ orgSlug: z.ZodNullable<z.ZodString>;
43
+ createdAt: z.ZodString;
44
+ lastUsedAt: z.ZodNullable<z.ZodString>;
45
+ revokedAt: z.ZodNullable<z.ZodString>;
46
+ }, z.core.$strict>>;
47
+ }, z.core.$strict>;
48
+ export type ListPublishTokensResponse = z.infer<typeof ListPublishTokensResponseSchema>;
49
+ /** DELETE /v1/me/publish-tokens/:id response. */
50
+ export declare const RevokePublishTokenResponseSchema: z.ZodObject<{
51
+ id: z.ZodString;
52
+ revokedAt: z.ZodString;
53
+ }, z.core.$strict>;
54
+ export type RevokePublishTokenResponse = z.infer<typeof RevokePublishTokenResponseSchema>;
55
+ //# sourceMappingURL=publish-tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publish-tokens.d.ts","sourceRoot":"","sources":["../../src/schemas/publish-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AAEH,+CAA+C;AAC/C,eAAO,MAAM,4BAA4B;;;kBAGvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,8EAA8E;AAC9E,eAAO,MAAM,yBAAyB;;;;;;kBAMpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,wEAAwE;AACxE,eAAO,MAAM,kBAAkB;;;;;;;;;kBAS7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,0CAA0C;AAC1C,eAAO,MAAM,+BAA+B;;;;;;;;;;;kBAE1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF,iDAAiD;AACjD,eAAO,MAAM,gCAAgC;;;kBAG3C,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC"}
@@ -1,51 +1,40 @@
1
1
  import { z } from "zod";
2
-
3
2
  /**
4
3
  * Owner-minted publish tokens (#2373): a verified domain owner mints a `relk_`
5
4
  * token bound to ONE source, usable only on that source's
6
5
  * `POST …/releases/batch` route (e.g. from the publish-changelog GitHub Action).
7
6
  * Served by the session-only `/v1/me/publish-tokens` routes.
8
7
  */
9
-
10
8
  /** POST /v1/me/publish-tokens request body. */
11
9
  export const CreatePublishTokenBodySchema = z.strictObject({
12
- sourceId: z.string().min(1).max(64),
13
- name: z.string().trim().min(1).max(200),
10
+ sourceId: z.string().min(1).max(64),
11
+ name: z.string().trim().min(1).max(200),
14
12
  });
15
- export type CreatePublishTokenBody = z.infer<typeof CreatePublishTokenBodySchema>;
16
-
17
13
  /** POST /v1/me/publish-tokens 201 response. `token` is shown exactly once. */
18
14
  export const CreatedPublishTokenSchema = z.strictObject({
19
- token: z.string(),
20
- id: z.string(),
21
- sourceId: z.string(),
22
- name: z.string(),
23
- createdAt: z.string(),
15
+ token: z.string(),
16
+ id: z.string(),
17
+ sourceId: z.string(),
18
+ name: z.string(),
19
+ createdAt: z.string(),
24
20
  });
25
- export type CreatedPublishToken = z.infer<typeof CreatedPublishTokenSchema>;
26
-
27
21
  /** One publish token as listed back to its owner — never the secret. */
28
22
  export const PublishTokenSchema = z.strictObject({
29
- id: z.string(),
30
- name: z.string(),
31
- sourceId: z.string(),
32
- sourceSlug: z.string().nullable(),
33
- orgSlug: z.string().nullable(),
34
- createdAt: z.string(),
35
- lastUsedAt: z.string().nullable(),
36
- revokedAt: z.string().nullable(),
23
+ id: z.string(),
24
+ name: z.string(),
25
+ sourceId: z.string(),
26
+ sourceSlug: z.string().nullable(),
27
+ orgSlug: z.string().nullable(),
28
+ createdAt: z.string(),
29
+ lastUsedAt: z.string().nullable(),
30
+ revokedAt: z.string().nullable(),
37
31
  });
38
- export type PublishToken = z.infer<typeof PublishTokenSchema>;
39
-
40
32
  /** GET /v1/me/publish-tokens response. */
41
33
  export const ListPublishTokensResponseSchema = z.strictObject({
42
- publishTokens: z.array(PublishTokenSchema),
34
+ publishTokens: z.array(PublishTokenSchema),
43
35
  });
44
- export type ListPublishTokensResponse = z.infer<typeof ListPublishTokensResponseSchema>;
45
-
46
36
  /** DELETE /v1/me/publish-tokens/:id response. */
47
37
  export const RevokePublishTokenResponseSchema = z.strictObject({
48
- id: z.string(),
49
- revokedAt: z.string(),
38
+ id: z.string(),
39
+ revokedAt: z.string(),
50
40
  });
51
- export type RevokePublishTokenResponse = z.infer<typeof RevokePublishTokenResponseSchema>;
@@ -0,0 +1,52 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * `POST /v1/admin/recommendations/:id/notify-added` body.
4
+ *
5
+ * Resolves a live registry listing (org required, source optional) and
6
+ * emails the submitter's `contactEmail` that their suggestion was added.
7
+ * Opt-in only — triage / close / archive never send this.
8
+ */
9
+ export declare const RecommendationNotifyAddedBodySchema: z.ZodObject<{
10
+ orgSlug: z.ZodString;
11
+ sourceSlug: z.ZodOptional<z.ZodString>;
12
+ }, z.core.$strip>;
13
+ /**
14
+ * `POST /v1/admin/recommendations/:id/notify-added` success body.
15
+ *
16
+ * `sent: false` + `reason: "already_notified"` is the idempotent replay —
17
+ * a second call does not email again.
18
+ */
19
+ export declare const RecommendationNotifyAddedResultSchema: z.ZodObject<{
20
+ ok: z.ZodLiteral<true>;
21
+ sent: z.ZodBoolean;
22
+ reason: z.ZodOptional<z.ZodEnum<{
23
+ already_notified: "already_notified";
24
+ }>>;
25
+ notifiedAt: z.ZodNullable<z.ZodNumber>;
26
+ registryUrl: z.ZodOptional<z.ZodString>;
27
+ contactEmail: z.ZodOptional<z.ZodString>;
28
+ }, z.core.$strip>;
29
+ /** `POST /v1/recommendations` field limits, shared with the handler's sanitizer. */
30
+ export declare const RECOMMENDATION_URL_MAX_CHARS = 2048;
31
+ export declare const RECOMMENDATION_NOTE_MAX_CHARS = 4000;
32
+ export declare const RECOMMENDATION_CONTACT_EMAIL_MAX_CHARS = 200;
33
+ /**
34
+ * `POST /v1/recommendations` body — suggest a changelog the registry should
35
+ * track. `note` and `contactEmail` are optional; a contact email gets an
36
+ * acknowledgement and, later, an opt-in "it's been added" notice.
37
+ */
38
+ export declare const RecommendationSubmitBodySchema: z.ZodObject<{
39
+ type: z.ZodEnum<{
40
+ source: "source";
41
+ }>;
42
+ url: z.ZodString;
43
+ note: z.ZodOptional<z.ZodString>;
44
+ contactEmail: z.ZodOptional<z.ZodString>;
45
+ surface: z.ZodOptional<z.ZodString>;
46
+ }, z.core.$strip>;
47
+ /** `POST /v1/recommendations` 202 response. */
48
+ export declare const RecommendationSubmitResponseSchema: z.ZodObject<{
49
+ ok: z.ZodLiteral<true>;
50
+ id: z.ZodString;
51
+ }, z.core.$strip>;
52
+ //# sourceMappingURL=recommendations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recommendations.d.ts","sourceRoot":"","sources":["../../src/schemas/recommendations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;GAMG;AACH,eAAO,MAAM,mCAAmC;;;iBAc9C,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;iBAOhD,CAAC;AAEH,oFAAoF;AACpF,eAAO,MAAM,4BAA4B,OAAO,CAAC;AACjD,eAAO,MAAM,6BAA6B,OAAO,CAAC;AAClD,eAAO,MAAM,sCAAsC,MAAM,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;iBASzC,CAAC;AAEH,+CAA+C;AAC/C,eAAO,MAAM,kCAAkC;;;iBAG7C,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { z } from "zod";
2
+ import { RECOMMENDATION_TYPES } from "@buildinternet/releases-core/schema";
3
+ /**
4
+ * `POST /v1/admin/recommendations/:id/notify-added` body.
5
+ *
6
+ * Resolves a live registry listing (org required, source optional) and
7
+ * emails the submitter's `contactEmail` that their suggestion was added.
8
+ * Opt-in only — triage / close / archive never send this.
9
+ */
10
+ export const RecommendationNotifyAddedBodySchema = z.object({
11
+ orgSlug: z
12
+ .string()
13
+ .min(1)
14
+ .describe("Org slug or `org_…` id of the onboarded listing. Required so the email can link a live registry URL."),
15
+ sourceSlug: z
16
+ .string()
17
+ .min(1)
18
+ .optional()
19
+ .describe("Optional source slug or `src_…` id under that org. When set, the email links the source page."),
20
+ });
21
+ /**
22
+ * `POST /v1/admin/recommendations/:id/notify-added` success body.
23
+ *
24
+ * `sent: false` + `reason: "already_notified"` is the idempotent replay —
25
+ * a second call does not email again.
26
+ */
27
+ export const RecommendationNotifyAddedResultSchema = z.object({
28
+ ok: z.literal(true),
29
+ sent: z.boolean(),
30
+ reason: z.enum(["already_notified"]).optional(),
31
+ notifiedAt: z.number().nullable(),
32
+ registryUrl: z.string().optional(),
33
+ contactEmail: z.string().optional(),
34
+ });
35
+ /** `POST /v1/recommendations` field limits, shared with the handler's sanitizer. */
36
+ export const RECOMMENDATION_URL_MAX_CHARS = 2048;
37
+ export const RECOMMENDATION_NOTE_MAX_CHARS = 4000;
38
+ export const RECOMMENDATION_CONTACT_EMAIL_MAX_CHARS = 200;
39
+ /**
40
+ * `POST /v1/recommendations` body — suggest a changelog the registry should
41
+ * track. `note` and `contactEmail` are optional; a contact email gets an
42
+ * acknowledgement and, later, an opt-in "it's been added" notice.
43
+ */
44
+ export const RecommendationSubmitBodySchema = z.object({
45
+ type: z.enum(RECOMMENDATION_TYPES),
46
+ url: z
47
+ .string()
48
+ .max(RECOMMENDATION_URL_MAX_CHARS)
49
+ .describe("http(s) URL of the changelog or project."),
50
+ note: z.string().max(RECOMMENDATION_NOTE_MAX_CHARS).optional(),
51
+ contactEmail: z.string().max(RECOMMENDATION_CONTACT_EMAIL_MAX_CHARS).optional(),
52
+ surface: z.string().max(32).optional(),
53
+ });
54
+ /** `POST /v1/recommendations` 202 response. */
55
+ export const RecommendationSubmitResponseSchema = z.object({
56
+ ok: z.literal(true),
57
+ id: z.string(),
58
+ });