@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.
- 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 -5
- package/src/api-types.ts +0 -2229
- 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/datasets.ts +0 -31
- 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 -449
- 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 -117
- 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
|
@@ -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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
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
|
-
|
|
179
|
-
|
|
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
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
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
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
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
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
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
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
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
|
-
|
|
13
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
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
|
-
|
|
49
|
-
|
|
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
|
+
});
|