@buildinternet/releases-api-types 0.58.3 → 0.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -6
- package/dist/api-types.d.ts +1168 -0
- package/dist/api-types.d.ts.map +1 -0
- package/dist/api-types.js +134 -0
- package/dist/schemas/account-profile.d.ts +29 -0
- package/dist/schemas/account-profile.d.ts.map +1 -0
- package/dist/schemas/account-profile.js +24 -0
- package/dist/schemas/ai-models.d.ts +67 -0
- package/dist/schemas/ai-models.d.ts.map +1 -0
- package/{src/schemas/ai-models.ts → dist/schemas/ai-models.js} +25 -31
- package/dist/schemas/api-keys.d.ts +71 -0
- package/dist/schemas/api-keys.d.ts.map +1 -0
- package/dist/schemas/api-keys.js +32 -0
- package/dist/schemas/classifications.d.ts +134 -0
- package/dist/schemas/classifications.d.ts.map +1 -0
- package/dist/schemas/classifications.js +96 -0
- package/dist/schemas/collections.d.ts +605 -0
- package/dist/schemas/collections.d.ts.map +1 -0
- package/dist/schemas/collections.js +320 -0
- package/dist/schemas/datasets.d.ts +34 -0
- package/dist/schemas/datasets.d.ts.map +1 -0
- package/dist/schemas/datasets.js +11 -0
- package/dist/schemas/errors.d.ts +43 -0
- package/dist/schemas/errors.d.ts.map +1 -0
- package/dist/schemas/errors.js +61 -0
- package/dist/schemas/feedback.d.ts +134 -0
- package/dist/schemas/feedback.d.ts.map +1 -0
- package/dist/schemas/feedback.js +76 -0
- package/dist/schemas/follows.d.ts +154 -0
- package/dist/schemas/follows.d.ts.map +1 -0
- package/dist/schemas/follows.js +42 -0
- package/dist/schemas/listing.d.ts +374 -0
- package/dist/schemas/listing.d.ts.map +1 -0
- package/dist/schemas/listing.js +175 -0
- package/dist/schemas/lookups.d.ts +285 -0
- package/dist/schemas/lookups.d.ts.map +1 -0
- package/{src/schemas/lookups.ts → dist/schemas/lookups.js} +67 -80
- package/dist/schemas/marketing-classifier.d.ts +32 -0
- package/dist/schemas/marketing-classifier.d.ts.map +1 -0
- package/{src/schemas/marketing-classifier.ts → dist/schemas/marketing-classifier.js} +14 -18
- package/dist/schemas/orgs.d.ts +950 -0
- package/dist/schemas/orgs.d.ts.map +1 -0
- package/dist/schemas/orgs.js +473 -0
- package/dist/schemas/overviews.d.ts +205 -0
- package/dist/schemas/overviews.d.ts.map +1 -0
- package/{src/schemas/overviews.ts → dist/schemas/overviews.js} +41 -54
- package/dist/schemas/products.d.ts +595 -0
- package/dist/schemas/products.d.ts.map +1 -0
- package/{src/schemas/products.ts → dist/schemas/products.js} +113 -136
- package/dist/schemas/publish-tokens.d.ts +55 -0
- package/dist/schemas/publish-tokens.d.ts.map +1 -0
- package/{src/schemas/publish-tokens.ts → dist/schemas/publish-tokens.js} +18 -29
- package/dist/schemas/recommendations.d.ts +52 -0
- package/dist/schemas/recommendations.d.ts.map +1 -0
- package/dist/schemas/recommendations.js +58 -0
- package/dist/schemas/related.d.ts +331 -0
- package/dist/schemas/related.d.ts.map +1 -0
- package/dist/schemas/related.js +115 -0
- package/dist/schemas/releases.d.ts +623 -0
- package/dist/schemas/releases.d.ts.map +1 -0
- package/dist/schemas/releases.js +414 -0
- package/dist/schemas/resolve.d.ts +259 -0
- package/dist/schemas/resolve.d.ts.map +1 -0
- package/{src/schemas/resolve.ts → dist/schemas/resolve.js} +2 -5
- package/dist/schemas/search.d.ts +475 -0
- package/dist/schemas/search.d.ts.map +1 -0
- package/dist/schemas/search.js +258 -0
- package/dist/schemas/semantic-alert-summary.d.ts +54 -0
- package/dist/schemas/semantic-alert-summary.d.ts.map +1 -0
- package/dist/schemas/semantic-alert-summary.js +57 -0
- package/dist/schemas/semantic-alerts.d.ts +41 -0
- package/dist/schemas/semantic-alerts.d.ts.map +1 -0
- package/dist/schemas/semantic-alerts.js +42 -0
- package/dist/schemas/shared.d.ts +247 -0
- package/dist/schemas/shared.d.ts.map +1 -0
- package/dist/schemas/shared.js +248 -0
- package/dist/schemas/site-notice.d.ts +35 -0
- package/dist/schemas/site-notice.d.ts.map +1 -0
- package/{src/schemas/site-notice.ts → dist/schemas/site-notice.js} +14 -18
- package/dist/schemas/sitemap.d.ts +97 -0
- package/dist/schemas/sitemap.d.ts.map +1 -0
- package/dist/schemas/sitemap.js +107 -0
- package/dist/schemas/sources.d.ts +1145 -0
- package/dist/schemas/sources.d.ts.map +1 -0
- package/dist/schemas/sources.js +645 -0
- package/dist/schemas/stats.d.ts +82 -0
- package/dist/schemas/stats.d.ts.map +1 -0
- package/dist/schemas/stats.js +59 -0
- package/dist/schemas/taxonomy.d.ts +344 -0
- package/dist/schemas/taxonomy.d.ts.map +1 -0
- package/{src/schemas/taxonomy.ts → dist/schemas/taxonomy.js} +47 -58
- package/dist/schemas/webhooks.d.ts +618 -0
- package/dist/schemas/webhooks.d.ts.map +1 -0
- package/dist/schemas/webhooks.js +191 -0
- package/dist/schemas/well-known.d.ts +302 -0
- package/dist/schemas/well-known.d.ts.map +1 -0
- package/dist/schemas/well-known.js +192 -0
- package/dist/schemas/workspace-integrations.d.ts +27 -0
- package/dist/schemas/workspace-integrations.d.ts.map +1 -0
- package/dist/schemas/workspace-integrations.js +22 -0
- package/package.json +16 -4
- package/src/api-types.ts +0 -2223
- package/src/schemas/account-profile.ts +0 -28
- package/src/schemas/ai-models.test.ts +0 -29
- package/src/schemas/classifications.ts +0 -109
- package/src/schemas/collections.ts +0 -346
- package/src/schemas/errors.test.ts +0 -55
- package/src/schemas/errors.ts +0 -81
- package/src/schemas/feedback.ts +0 -56
- package/src/schemas/listing.ts +0 -226
- package/src/schemas/orgs.ts +0 -533
- package/src/schemas/recommendations.ts +0 -39
- package/src/schemas/related.ts +0 -126
- package/src/schemas/releases.ts +0 -436
- package/src/schemas/search.ts +0 -274
- package/src/schemas/semantic-alert-summary.ts +0 -65
- package/src/schemas/shared.notice.test.ts +0 -36
- package/src/schemas/shared.ts +0 -267
- package/src/schemas/site-notice.test.ts +0 -67
- package/src/schemas/sitemap.ts +0 -114
- package/src/schemas/sources.ts +0 -674
- package/src/schemas/stats.ts +0 -62
- package/src/schemas/well-known.test.ts +0 -264
- package/src/schemas/well-known.ts +0 -252
- package/src/schemas/workspace-integrations.ts +0 -26
package/src/api-types.ts
DELETED
|
@@ -1,2223 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared API response types — single source of truth for the wire protocol.
|
|
3
|
-
* Consumed by: web frontend, MCP worker, OSS CLI, and the API worker.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type { z } from "zod";
|
|
7
|
-
|
|
8
|
-
export type {
|
|
9
|
-
SourceType,
|
|
10
|
-
SourceDiscovery,
|
|
11
|
-
SourceFetchPriority,
|
|
12
|
-
} from "@buildinternet/releases-core/source-enums";
|
|
13
|
-
// Re-export above doesn't create local bindings; import for use in interfaces below.
|
|
14
|
-
import type { SourceType, SourceFetchPriority } from "@buildinternet/releases-core/source-enums";
|
|
15
|
-
import type { ApiScope } from "@buildinternet/releases-core/api-token";
|
|
16
|
-
import type { BreakingLevel } from "@buildinternet/releases-core/breaking";
|
|
17
|
-
import type {
|
|
18
|
-
AiLaneIdSchema,
|
|
19
|
-
AiLaneModelsPutSchema,
|
|
20
|
-
AiLaneStateSchema,
|
|
21
|
-
OpenRouterCatalogModelSchema,
|
|
22
|
-
AiLaneModelsResponseSchema,
|
|
23
|
-
} from "./schemas/ai-models.js";
|
|
24
|
-
import type {
|
|
25
|
-
MarketingClassifierThresholdPutSchema,
|
|
26
|
-
MarketingFilteredSourceSchema,
|
|
27
|
-
MarketingClassifierStateSchema,
|
|
28
|
-
} from "./schemas/marketing-classifier.js";
|
|
29
|
-
import type {
|
|
30
|
-
MediaItemSchema,
|
|
31
|
-
PaginationSchema,
|
|
32
|
-
StatsSchema,
|
|
33
|
-
ReleaseTypeSchema,
|
|
34
|
-
ReleaseCompositionSchema,
|
|
35
|
-
ReleaseItemSchema,
|
|
36
|
-
ReleaseSummaryItemSchema,
|
|
37
|
-
OverviewPageItemSchema,
|
|
38
|
-
OverviewCitationSchema,
|
|
39
|
-
OrgStatusSchema,
|
|
40
|
-
ReleaseLocationItemSchema,
|
|
41
|
-
} from "./schemas/shared.js";
|
|
42
|
-
import type {
|
|
43
|
-
OrgListItemSchema,
|
|
44
|
-
OrgListResponseSchema,
|
|
45
|
-
OrgAccountItemSchema,
|
|
46
|
-
OrgAccountsResponseSchema,
|
|
47
|
-
OrgTagsResponseSchema,
|
|
48
|
-
CreateOrgBodySchema,
|
|
49
|
-
UpdateOrgBodySchema,
|
|
50
|
-
SetOrgAvatarBodySchema,
|
|
51
|
-
SetOrgAvatarResponseSchema,
|
|
52
|
-
OrgDetailSchema,
|
|
53
|
-
OrgCatalogItemSchema,
|
|
54
|
-
OrgCatalogResponseSchema,
|
|
55
|
-
OrgCollectionsResponseSchema,
|
|
56
|
-
AddOrgAccountBodySchema,
|
|
57
|
-
IgnoredUrlItemSchema,
|
|
58
|
-
OrgIgnoredUrlsResponseSchema,
|
|
59
|
-
AddIgnoredUrlBodySchema,
|
|
60
|
-
AddIgnoredUrlResponseSchema,
|
|
61
|
-
DeleteIgnoredUrlResponseSchema,
|
|
62
|
-
OrgTagsBodySchema,
|
|
63
|
-
OrgTagsMutationResponseSchema,
|
|
64
|
-
CreateTagBodySchema,
|
|
65
|
-
TagRowSchema,
|
|
66
|
-
OrgActivityResponseSchema,
|
|
67
|
-
OrgHeatmapResponseSchema,
|
|
68
|
-
OrgSparklinesResponseSchema,
|
|
69
|
-
OrgReleaseItemSchema,
|
|
70
|
-
OrgFeedPaginationSchema,
|
|
71
|
-
OrgReleasesFeedResponseSchema,
|
|
72
|
-
OrgRecentReleaseItemSchema,
|
|
73
|
-
OrgRecentReleasesResponseSchema,
|
|
74
|
-
DeleteOrgAccountResponseSchema,
|
|
75
|
-
} from "./schemas/orgs.js";
|
|
76
|
-
import type {
|
|
77
|
-
UploadAvatarResponseSchema,
|
|
78
|
-
WorkspaceProfileFieldsSchema,
|
|
79
|
-
PatchWorkspaceProfileBodySchema,
|
|
80
|
-
WorkspaceProfileResponseSchema,
|
|
81
|
-
} from "./schemas/account-profile.js";
|
|
82
|
-
import type {
|
|
83
|
-
UploadsIntegrationStatusSchema,
|
|
84
|
-
UploadsOAuthConnectResponseSchema,
|
|
85
|
-
UploadsOAuthCallbackBodySchema,
|
|
86
|
-
UploadsOAuthCallbackResponseSchema,
|
|
87
|
-
} from "./schemas/workspace-integrations.js";
|
|
88
|
-
import type {
|
|
89
|
-
SourceListItemSchema,
|
|
90
|
-
SourceWithOrgSchema,
|
|
91
|
-
SourceListResponseSchema,
|
|
92
|
-
SourceListResultSchema,
|
|
93
|
-
SourceDetailSchema,
|
|
94
|
-
SourceFeedPaginationSchema,
|
|
95
|
-
SourceMutationResponseSchema,
|
|
96
|
-
AppStoreMaterializeResponseSchema,
|
|
97
|
-
SourceOrgRefSchema,
|
|
98
|
-
SourcePatchInputSchema,
|
|
99
|
-
CreateSourceBodySchema,
|
|
100
|
-
ChangelogFileSummarySchema,
|
|
101
|
-
SourceChangelogResponseSchema,
|
|
102
|
-
SourceActivityResponseSchema,
|
|
103
|
-
SourceHeatmapResponseSchema,
|
|
104
|
-
SourceKnownReleaseItemSchema,
|
|
105
|
-
SourceKnownReleasesResponseSchema,
|
|
106
|
-
SourceRecentReleasesResponseSchema,
|
|
107
|
-
SourceSessionsResponseSchema,
|
|
108
|
-
SourceSummaryRowSchema,
|
|
109
|
-
SourceSummariesResponseSchema,
|
|
110
|
-
CreateSourceSummaryBodySchema,
|
|
111
|
-
CreateSourceSummaryResponseSchema,
|
|
112
|
-
SourceFetchResponseSchema,
|
|
113
|
-
SourceContentHashResponseSchema,
|
|
114
|
-
SourceContentHashBodySchema,
|
|
115
|
-
ChangelogTokensResponseSchema,
|
|
116
|
-
SourceMetadataResponseSchema,
|
|
117
|
-
ChangelogProbeResponseSchema,
|
|
118
|
-
DeleteSourceResponseSchema,
|
|
119
|
-
DeleteSourceReleasesResponseSchema,
|
|
120
|
-
InsertReleaseResponseSchema,
|
|
121
|
-
BatchReleasesResponseSchema,
|
|
122
|
-
RawSnapshotResponseSchema,
|
|
123
|
-
OversizedChangelogFileRowSchema,
|
|
124
|
-
OversizedChangelogFilesResponseSchema,
|
|
125
|
-
FetchableSourcesResponseSchema,
|
|
126
|
-
FeedSourcesResponseSchema,
|
|
127
|
-
ChangedSourcesResponseSchema,
|
|
128
|
-
} from "./schemas/sources.js";
|
|
129
|
-
import type {
|
|
130
|
-
ProductRowSchema,
|
|
131
|
-
ProductCreateResponseSchema,
|
|
132
|
-
ProductListItemSchema,
|
|
133
|
-
ProductListResponseSchema,
|
|
134
|
-
ProductDetailSourceSchema,
|
|
135
|
-
ProductDetailSchema,
|
|
136
|
-
CreateProductBodySchema,
|
|
137
|
-
UpdateProductBodySchema,
|
|
138
|
-
AdoptProductBodySchema,
|
|
139
|
-
ProductAdoptResultSchema,
|
|
140
|
-
ProductAdoptDryRunSchema,
|
|
141
|
-
ProductAdoptResponseSchema,
|
|
142
|
-
ProductDeleteResponseSchema,
|
|
143
|
-
ProductTagsListResponseSchema,
|
|
144
|
-
ProductTagsBodySchema,
|
|
145
|
-
ProductTagsMutationResponseSchema,
|
|
146
|
-
ProductActivityResponseSchema,
|
|
147
|
-
ProductHeatmapResponseSchema,
|
|
148
|
-
} from "./schemas/products.js";
|
|
149
|
-
import type {
|
|
150
|
-
ReleaseLatestSourceSchema,
|
|
151
|
-
ReleaseLatestProductSchema,
|
|
152
|
-
ReleaseLatestItemSchema,
|
|
153
|
-
ReleaseLatestResponseSchema,
|
|
154
|
-
ReleaseCoverageSiblingSchema,
|
|
155
|
-
ReleaseCoverageRowSchema,
|
|
156
|
-
ReleaseCoverageResponseSchema,
|
|
157
|
-
LinkReleaseCoverageBodySchema,
|
|
158
|
-
LinkReleaseCoverageResponseSchema,
|
|
159
|
-
UnlinkReleaseCoverageResponseSchema,
|
|
160
|
-
ReleaseWithMediaRowSchema,
|
|
161
|
-
ReleasesWithMediaResponseSchema,
|
|
162
|
-
ReleaseDetailOrgSchema,
|
|
163
|
-
ReleaseDetailResponseSchema,
|
|
164
|
-
UpdateReleaseBodySchema,
|
|
165
|
-
ReleasePatchResponseSchema,
|
|
166
|
-
ReleaseDeleteResponseSchema,
|
|
167
|
-
ReleaseBatchDeleteBodySchema,
|
|
168
|
-
ReleaseBatchDeleteResponseSchema,
|
|
169
|
-
ReleaseSuppressResponseSchema,
|
|
170
|
-
ReleaseUnsuppressResponseSchema,
|
|
171
|
-
ReleaseSuppressBodySchema,
|
|
172
|
-
ReleaseBatchSuppressBodySchema,
|
|
173
|
-
ReleaseBatchSuppressResponseSchema,
|
|
174
|
-
ReleaseStreamMessageSchema,
|
|
175
|
-
} from "./schemas/releases.js";
|
|
176
|
-
import type {
|
|
177
|
-
LookupStatusSchema,
|
|
178
|
-
LookupBodySchema,
|
|
179
|
-
LookupSourceSchema,
|
|
180
|
-
LookupReleaseSchema,
|
|
181
|
-
LookupRelatedOrgSchema,
|
|
182
|
-
LookupResponseSchema,
|
|
183
|
-
LookupSourceBySlugResponseSchema,
|
|
184
|
-
LookupProductBySlugResponseSchema,
|
|
185
|
-
DomainLookupOrgSchema,
|
|
186
|
-
DomainLookupProductSchema,
|
|
187
|
-
DomainLookupResponseSchema,
|
|
188
|
-
} from "./schemas/lookups.js";
|
|
189
|
-
import type {
|
|
190
|
-
SearchOrgHitSchema,
|
|
191
|
-
SearchCatalogHitSchema,
|
|
192
|
-
SearchSourceHitSchema,
|
|
193
|
-
SearchReleaseHitSchema,
|
|
194
|
-
SearchChunkHitSchema,
|
|
195
|
-
SearchCollectionHitSchema,
|
|
196
|
-
LookupResultPayloadSchema,
|
|
197
|
-
UnifiedSearchResponseSchema,
|
|
198
|
-
} from "./schemas/search.js";
|
|
199
|
-
import type {
|
|
200
|
-
TaxonomyOrgSchema,
|
|
201
|
-
TaxonomyProductSchema,
|
|
202
|
-
CategoryListItemSchema,
|
|
203
|
-
CategoryListResponseSchema,
|
|
204
|
-
CategoryDetailSchema,
|
|
205
|
-
UpdateCategoryRequestSchema,
|
|
206
|
-
UpdateCategoryResponseSchema,
|
|
207
|
-
CategoryFeedPaginationSchema,
|
|
208
|
-
CategoryReleasesResponseSchema,
|
|
209
|
-
TagDetailSchema,
|
|
210
|
-
} from "./schemas/taxonomy.js";
|
|
211
|
-
import type {
|
|
212
|
-
StatsSourceActivitySchema,
|
|
213
|
-
StatsRecentActivitySchema,
|
|
214
|
-
StatsResponseSchema,
|
|
215
|
-
} from "./schemas/stats.js";
|
|
216
|
-
import type {
|
|
217
|
-
FeedbackTypeSchema,
|
|
218
|
-
FeedbackStatusSchema,
|
|
219
|
-
FeedbackItemSchema,
|
|
220
|
-
FeedbackListResponseSchema,
|
|
221
|
-
FeedbackUpdateBodySchema,
|
|
222
|
-
FeedbackDeleteResponseSchema,
|
|
223
|
-
} from "./schemas/feedback.js";
|
|
224
|
-
import type {
|
|
225
|
-
ClassificationSummarySchema,
|
|
226
|
-
ClassificationRecentResponseSchema,
|
|
227
|
-
ClassificationRecentItemSchema,
|
|
228
|
-
} from "./schemas/classifications.js";
|
|
229
|
-
import type { SemanticAlertSummarySchema } from "./schemas/semantic-alert-summary.js";
|
|
230
|
-
import type {
|
|
231
|
-
RecommendationNotifyAddedBodySchema,
|
|
232
|
-
RecommendationNotifyAddedResultSchema,
|
|
233
|
-
} from "./schemas/recommendations.js";
|
|
234
|
-
import type {
|
|
235
|
-
SitemapSourceSchema,
|
|
236
|
-
SitemapPayloadSchema,
|
|
237
|
-
SitemapReleaseSchema,
|
|
238
|
-
SitemapReleasesPayloadSchema,
|
|
239
|
-
} from "./schemas/sitemap.js";
|
|
240
|
-
import type {
|
|
241
|
-
RelatedScopeSchema,
|
|
242
|
-
RelatedReleaseThumbnailSchema,
|
|
243
|
-
RelatedReleaseSourceSchema,
|
|
244
|
-
RelatedReleaseItemSchema,
|
|
245
|
-
RelatedSourceItemSchema,
|
|
246
|
-
RelatedReleasesOkResponseSchema,
|
|
247
|
-
RelatedReleasesDegradedResponseSchema,
|
|
248
|
-
RelatedReleasesResponseSchema,
|
|
249
|
-
RelatedSourcesOkResponseSchema,
|
|
250
|
-
RelatedSourcesDegradedResponseSchema,
|
|
251
|
-
RelatedSourcesResponseSchema,
|
|
252
|
-
} from "./schemas/related.js";
|
|
253
|
-
import type {
|
|
254
|
-
CollectionMemberOrgSchema,
|
|
255
|
-
ProductParentOrgSchema,
|
|
256
|
-
CollectionMemberProductSchema,
|
|
257
|
-
CollectionMemberSchema,
|
|
258
|
-
CollectionListItemSchema,
|
|
259
|
-
CollectionListResponseSchema,
|
|
260
|
-
CollectionDetailSchema,
|
|
261
|
-
CollectionReleaseItemSchema,
|
|
262
|
-
CollectionFeedPaginationSchema,
|
|
263
|
-
CollectionReleasesResponseSchema,
|
|
264
|
-
CollectionRowSchema,
|
|
265
|
-
CreateCollectionRequestSchema,
|
|
266
|
-
UpdateCollectionRequestSchema,
|
|
267
|
-
CollectionMemberInputSchema,
|
|
268
|
-
AddCollectionMemberRequestSchema,
|
|
269
|
-
ReplaceCollectionMembersRequestSchema,
|
|
270
|
-
ResolvedCollectionMemberSchema,
|
|
271
|
-
ReplaceCollectionMembersResponseSchema,
|
|
272
|
-
AddCollectionMemberResponseSchema,
|
|
273
|
-
CollectionDailySummarySchema,
|
|
274
|
-
CollectionDailySummariesResponseSchema,
|
|
275
|
-
CollectionWeeklyDigestListItemSchema,
|
|
276
|
-
CollectionWeeklyDigestsResponseSchema,
|
|
277
|
-
DigestCoveredReleaseSchema,
|
|
278
|
-
DigestSectionSchema,
|
|
279
|
-
CollectionWeeklyDigestDetailSchema,
|
|
280
|
-
} from "./schemas/collections.js";
|
|
281
|
-
import type {
|
|
282
|
-
OrgOverviewResponseSchema,
|
|
283
|
-
IncomingOverviewCitationSchema,
|
|
284
|
-
RegenerateOverviewBodySchema,
|
|
285
|
-
RegenerateOverviewResponseSchema,
|
|
286
|
-
ProductOverviewResponseSchema,
|
|
287
|
-
OverviewInputsCheckResponseSchema,
|
|
288
|
-
OverviewInputsFullResponseSchema,
|
|
289
|
-
OverviewInputsResponseSchema,
|
|
290
|
-
PlaybookResponseSchema,
|
|
291
|
-
UpdatePlaybookNotesBodySchema,
|
|
292
|
-
UpdatePlaybookNotesResponseSchema,
|
|
293
|
-
} from "./schemas/overviews.js";
|
|
294
|
-
|
|
295
|
-
export {
|
|
296
|
-
MediaItemSchema,
|
|
297
|
-
PaginationSchema,
|
|
298
|
-
ListResponseSchema,
|
|
299
|
-
StatsSchema,
|
|
300
|
-
ReleaseTypeSchema,
|
|
301
|
-
ReleaseCompositionSchema,
|
|
302
|
-
ReleaseItemSchema,
|
|
303
|
-
ReleaseSummaryItemSchema,
|
|
304
|
-
OverviewPageItemSchema,
|
|
305
|
-
OverviewCitationSchema,
|
|
306
|
-
OrgStatusSchema,
|
|
307
|
-
ReleaseLocationItemSchema,
|
|
308
|
-
CategorySchema,
|
|
309
|
-
NoticeSchema,
|
|
310
|
-
} from "./schemas/shared.js";
|
|
311
|
-
export { SiteNoticeSchema, SiteNoticeResponseSchema } from "./schemas/site-notice.js";
|
|
312
|
-
export {
|
|
313
|
-
AiLaneIdSchema,
|
|
314
|
-
AiLaneModelsPutSchema,
|
|
315
|
-
AiLaneStateSchema,
|
|
316
|
-
OpenRouterCatalogModelSchema,
|
|
317
|
-
AiLaneModelsResponseSchema,
|
|
318
|
-
} from "./schemas/ai-models.js";
|
|
319
|
-
export {
|
|
320
|
-
MarketingClassifierThresholdPutSchema,
|
|
321
|
-
MarketingFilteredSourceSchema,
|
|
322
|
-
MarketingClassifierStateSchema,
|
|
323
|
-
MARKETING_THRESHOLD_MIN,
|
|
324
|
-
MARKETING_THRESHOLD_MAX,
|
|
325
|
-
} from "./schemas/marketing-classifier.js";
|
|
326
|
-
export {
|
|
327
|
-
OrgListItemSchema,
|
|
328
|
-
OrgListResponseSchema,
|
|
329
|
-
OrgAccountItemSchema,
|
|
330
|
-
OrgAccountsResponseSchema,
|
|
331
|
-
OrgTagsResponseSchema,
|
|
332
|
-
CreateOrgBodySchema,
|
|
333
|
-
UpdateOrgBodySchema,
|
|
334
|
-
SetOrgAvatarBodySchema,
|
|
335
|
-
SetOrgAvatarResponseSchema,
|
|
336
|
-
OrgDetailSchema,
|
|
337
|
-
OrgCatalogItemSchema,
|
|
338
|
-
OrgCatalogResponseSchema,
|
|
339
|
-
OrgCollectionsResponseSchema,
|
|
340
|
-
AddOrgAccountBodySchema,
|
|
341
|
-
IgnoredUrlItemSchema,
|
|
342
|
-
OrgIgnoredUrlsResponseSchema,
|
|
343
|
-
AddIgnoredUrlBodySchema,
|
|
344
|
-
AddIgnoredUrlResponseSchema,
|
|
345
|
-
DeleteIgnoredUrlResponseSchema,
|
|
346
|
-
OrgTagsBodySchema,
|
|
347
|
-
OrgTagsMutationResponseSchema,
|
|
348
|
-
CreateTagBodySchema,
|
|
349
|
-
TagRowSchema,
|
|
350
|
-
OrgActivityResponseSchema,
|
|
351
|
-
OrgHeatmapResponseSchema,
|
|
352
|
-
OrgSparklinesResponseSchema,
|
|
353
|
-
OrgReleaseItemSchema,
|
|
354
|
-
OrgFeedPaginationSchema,
|
|
355
|
-
OrgReleasesFeedResponseSchema,
|
|
356
|
-
OrgRecentReleaseItemSchema,
|
|
357
|
-
OrgRecentReleasesResponseSchema,
|
|
358
|
-
DeleteOrgAccountResponseSchema,
|
|
359
|
-
} from "./schemas/orgs.js";
|
|
360
|
-
export {
|
|
361
|
-
UploadAvatarResponseSchema,
|
|
362
|
-
WorkspaceProfileFieldsSchema,
|
|
363
|
-
PatchWorkspaceProfileBodySchema,
|
|
364
|
-
WorkspaceProfileResponseSchema,
|
|
365
|
-
} from "./schemas/account-profile.js";
|
|
366
|
-
export {
|
|
367
|
-
UploadsIntegrationStatusSchema,
|
|
368
|
-
UploadsOAuthConnectResponseSchema,
|
|
369
|
-
UploadsOAuthCallbackBodySchema,
|
|
370
|
-
UploadsOAuthCallbackResponseSchema,
|
|
371
|
-
} from "./schemas/workspace-integrations.js";
|
|
372
|
-
export {
|
|
373
|
-
CreateStubOrgBodySchema,
|
|
374
|
-
StubFromDomainBodySchema,
|
|
375
|
-
ReleasesJsonConfigSchema,
|
|
376
|
-
ReleasesJsonDomainReleaseSchema,
|
|
377
|
-
ReleasesJsonDomainSchema,
|
|
378
|
-
ReleasesJsonProductSchema,
|
|
379
|
-
ReleasesJsonRegistriesSchema,
|
|
380
|
-
ReleasesJsonRepoProductSchema,
|
|
381
|
-
ReleasesJsonRepoReleaseSchema,
|
|
382
|
-
ReleasesJsonRepoSchema,
|
|
383
|
-
SyncWellKnownResponseSchema,
|
|
384
|
-
} from "./schemas/well-known.js";
|
|
385
|
-
export type {
|
|
386
|
-
CreateStubOrgBody,
|
|
387
|
-
StubFromDomainBody,
|
|
388
|
-
ReleasesJsonConfig,
|
|
389
|
-
ReleasesJsonDomain,
|
|
390
|
-
ReleasesJsonDomainRelease,
|
|
391
|
-
ReleasesJsonProduct,
|
|
392
|
-
ReleasesJsonRepo,
|
|
393
|
-
ReleasesJsonRepoRelease,
|
|
394
|
-
} from "./schemas/well-known.js";
|
|
395
|
-
export {
|
|
396
|
-
ListingValidateBodySchema,
|
|
397
|
-
ListingActivateBodySchema,
|
|
398
|
-
ListingIssueSchema,
|
|
399
|
-
ListingSetupStepSchema,
|
|
400
|
-
ListingLocationSchema,
|
|
401
|
-
ListingOrgPointerSchema,
|
|
402
|
-
ListingValidationResultSchema,
|
|
403
|
-
ListingActivateResultSchema,
|
|
404
|
-
ListingClaimBodySchema,
|
|
405
|
-
ListingClaimVerifyBodySchema,
|
|
406
|
-
OrgClaimStatusSchema,
|
|
407
|
-
ClaimMethodSchema,
|
|
408
|
-
OrgClaimSchema,
|
|
409
|
-
ClaimCheckOutcomeSchema,
|
|
410
|
-
ClaimVerifyResultSchema,
|
|
411
|
-
ListingClaimsResultSchema,
|
|
412
|
-
AdminOrgClaimSchema,
|
|
413
|
-
ListOrgClaimsResponseSchema,
|
|
414
|
-
RevokeOrgClaimBodySchema,
|
|
415
|
-
ListingPromoteBodySchema,
|
|
416
|
-
ListingPromoteLocatorOutcomeSchema,
|
|
417
|
-
ListingPromoteLocatorSchema,
|
|
418
|
-
ListingPromoteResultSchema,
|
|
419
|
-
ListingCapabilitiesSchema,
|
|
420
|
-
type ListingValidateBody,
|
|
421
|
-
type ListingActivateBody,
|
|
422
|
-
type ListingIssue,
|
|
423
|
-
type ListingSetupStep,
|
|
424
|
-
type ListingLocation,
|
|
425
|
-
type ListingValidationResult,
|
|
426
|
-
type ListingActivateResult,
|
|
427
|
-
type ListingClaimBody,
|
|
428
|
-
type ListingClaimVerifyBody,
|
|
429
|
-
type OrgClaimStatus,
|
|
430
|
-
type ClaimMethod,
|
|
431
|
-
type OrgClaim,
|
|
432
|
-
type ClaimCheckOutcome,
|
|
433
|
-
type ClaimVerifyResult,
|
|
434
|
-
type ListingClaimsResult,
|
|
435
|
-
type AdminOrgClaim,
|
|
436
|
-
type ListOrgClaimsResponse,
|
|
437
|
-
type RevokeOrgClaimBody,
|
|
438
|
-
type ListingPromoteBody,
|
|
439
|
-
type ListingPromoteLocatorOutcome,
|
|
440
|
-
type ListingPromoteLocator,
|
|
441
|
-
type ListingPromoteResult,
|
|
442
|
-
type ListingCapabilities,
|
|
443
|
-
} from "./schemas/listing.js";
|
|
444
|
-
export {
|
|
445
|
-
CreatePublishTokenBodySchema,
|
|
446
|
-
CreatedPublishTokenSchema,
|
|
447
|
-
PublishTokenSchema,
|
|
448
|
-
ListPublishTokensResponseSchema,
|
|
449
|
-
RevokePublishTokenResponseSchema,
|
|
450
|
-
type CreatePublishTokenBody,
|
|
451
|
-
type CreatedPublishToken,
|
|
452
|
-
type PublishToken,
|
|
453
|
-
type ListPublishTokensResponse,
|
|
454
|
-
type RevokePublishTokenResponse,
|
|
455
|
-
} from "./schemas/publish-tokens.js";
|
|
456
|
-
export {
|
|
457
|
-
SourceListItemSchema,
|
|
458
|
-
SourceWithOrgSchema,
|
|
459
|
-
SourceListResponseSchema,
|
|
460
|
-
SourceListResultSchema,
|
|
461
|
-
SourceDetailSchema,
|
|
462
|
-
SourceFeedPaginationSchema,
|
|
463
|
-
SourceMutationResponseSchema,
|
|
464
|
-
AppStoreMaterializeResponseSchema,
|
|
465
|
-
SourceOrgRefSchema,
|
|
466
|
-
SourcePatchInputSchema,
|
|
467
|
-
CreateSourceBodySchema,
|
|
468
|
-
ChangelogFileSummarySchema,
|
|
469
|
-
SourceChangelogResponseSchema,
|
|
470
|
-
SourceActivityResponseSchema,
|
|
471
|
-
SourceHeatmapResponseSchema,
|
|
472
|
-
SourceKnownReleaseItemSchema,
|
|
473
|
-
SourceKnownReleasesResponseSchema,
|
|
474
|
-
SourceRecentReleasesResponseSchema,
|
|
475
|
-
SourceSessionsResponseSchema,
|
|
476
|
-
SourceSummaryRowSchema,
|
|
477
|
-
SourceSummariesResponseSchema,
|
|
478
|
-
CreateSourceSummaryBodySchema,
|
|
479
|
-
CreateSourceSummaryResponseSchema,
|
|
480
|
-
SourceFetchResponseSchema,
|
|
481
|
-
SourceContentHashResponseSchema,
|
|
482
|
-
SourceContentHashBodySchema,
|
|
483
|
-
ChangelogTokensResponseSchema,
|
|
484
|
-
SourceMetadataResponseSchema,
|
|
485
|
-
ChangelogProbeResponseSchema,
|
|
486
|
-
DeleteSourceResponseSchema,
|
|
487
|
-
DeleteSourceReleasesResponseSchema,
|
|
488
|
-
InsertReleaseResponseSchema,
|
|
489
|
-
BatchReleasesResponseSchema,
|
|
490
|
-
RawSnapshotResponseSchema,
|
|
491
|
-
OversizedChangelogFileRowSchema,
|
|
492
|
-
OversizedChangelogFilesResponseSchema,
|
|
493
|
-
FetchableSourcesResponseSchema,
|
|
494
|
-
FeedSourcesResponseSchema,
|
|
495
|
-
ChangedSourcesResponseSchema,
|
|
496
|
-
} from "./schemas/sources.js";
|
|
497
|
-
export {
|
|
498
|
-
ProductRowSchema,
|
|
499
|
-
ProductCreateResponseSchema,
|
|
500
|
-
ProductListItemSchema,
|
|
501
|
-
ProductListResponseSchema,
|
|
502
|
-
ProductDetailSourceSchema,
|
|
503
|
-
ProductDetailSchema,
|
|
504
|
-
CreateProductBodySchema,
|
|
505
|
-
UpdateProductBodySchema,
|
|
506
|
-
AdoptProductBodySchema,
|
|
507
|
-
ProductAdoptResultSchema,
|
|
508
|
-
ProductAdoptDryRunSchema,
|
|
509
|
-
ProductAdoptResponseSchema,
|
|
510
|
-
ProductDeleteResponseSchema,
|
|
511
|
-
ProductTagsListResponseSchema,
|
|
512
|
-
ProductTagsBodySchema,
|
|
513
|
-
ProductTagsMutationResponseSchema,
|
|
514
|
-
ProductActivityResponseSchema,
|
|
515
|
-
ProductHeatmapResponseSchema,
|
|
516
|
-
} from "./schemas/products.js";
|
|
517
|
-
export {
|
|
518
|
-
LookupStatusSchema,
|
|
519
|
-
LookupBodySchema,
|
|
520
|
-
LookupSourceSchema,
|
|
521
|
-
LookupReleaseSchema,
|
|
522
|
-
LookupRelatedOrgSchema,
|
|
523
|
-
LookupResponseSchema,
|
|
524
|
-
LookupSourceBySlugResponseSchema,
|
|
525
|
-
LookupProductBySlugResponseSchema,
|
|
526
|
-
DomainLookupOrgSchema,
|
|
527
|
-
DomainLookupProductSchema,
|
|
528
|
-
DomainLookupResponseSchema,
|
|
529
|
-
} from "./schemas/lookups.js";
|
|
530
|
-
export {
|
|
531
|
-
TaxonomyOrgSchema,
|
|
532
|
-
TaxonomyProductSchema,
|
|
533
|
-
CategoryListItemSchema,
|
|
534
|
-
CategoryListResponseSchema,
|
|
535
|
-
CategoryDetailSchema,
|
|
536
|
-
UpdateCategoryRequestSchema,
|
|
537
|
-
UpdateCategoryResponseSchema,
|
|
538
|
-
CategoryReleaseItemSchema,
|
|
539
|
-
CategoryFeedPaginationSchema,
|
|
540
|
-
CategoryReleasesResponseSchema,
|
|
541
|
-
TagDetailSchema,
|
|
542
|
-
} from "./schemas/taxonomy.js";
|
|
543
|
-
export {
|
|
544
|
-
ReleaseLatestSourceSchema,
|
|
545
|
-
ReleaseLatestProductSchema,
|
|
546
|
-
ReleaseLatestItemSchema,
|
|
547
|
-
ReleaseLatestResponseSchema,
|
|
548
|
-
ReleaseCoverageSiblingSchema,
|
|
549
|
-
ReleaseCoverageRowSchema,
|
|
550
|
-
ReleaseCoverageResponseSchema,
|
|
551
|
-
LinkReleaseCoverageBodySchema,
|
|
552
|
-
LinkReleaseCoverageResponseSchema,
|
|
553
|
-
UnlinkReleaseCoverageResponseSchema,
|
|
554
|
-
ReleaseWithMediaRowSchema,
|
|
555
|
-
ReleasesWithMediaResponseSchema,
|
|
556
|
-
ReleaseDetailOrgSchema,
|
|
557
|
-
ReleaseDetailResponseSchema,
|
|
558
|
-
UpdateReleaseBodySchema,
|
|
559
|
-
ReleasePatchResponseSchema,
|
|
560
|
-
ReleaseDeleteResponseSchema,
|
|
561
|
-
ReleaseBatchDeleteBodySchema,
|
|
562
|
-
ReleaseBatchDeleteResponseSchema,
|
|
563
|
-
ReleaseSuppressResponseSchema,
|
|
564
|
-
ReleaseUnsuppressResponseSchema,
|
|
565
|
-
ReleaseSuppressBodySchema,
|
|
566
|
-
ReleaseBatchSuppressBodySchema,
|
|
567
|
-
ReleaseBatchSuppressResponseSchema,
|
|
568
|
-
ReleaseStreamMessageSchema,
|
|
569
|
-
} from "./schemas/releases.js";
|
|
570
|
-
export {
|
|
571
|
-
SearchOrgHitSchema,
|
|
572
|
-
SearchCatalogHitSchema,
|
|
573
|
-
SearchSourceHitSchema,
|
|
574
|
-
SearchReleaseHitSchema,
|
|
575
|
-
SearchChunkHitSchema,
|
|
576
|
-
SearchCollectionHitSchema,
|
|
577
|
-
LookupResultPayloadSchema,
|
|
578
|
-
UnifiedSearchResponseSchema,
|
|
579
|
-
} from "./schemas/search.js";
|
|
580
|
-
export {
|
|
581
|
-
StatsSourceActivitySchema,
|
|
582
|
-
StatsRecentActivitySchema,
|
|
583
|
-
StatsResponseSchema,
|
|
584
|
-
} from "./schemas/stats.js";
|
|
585
|
-
export {
|
|
586
|
-
FeedbackTypeSchema,
|
|
587
|
-
FeedbackStatusSchema,
|
|
588
|
-
FeedbackItemSchema,
|
|
589
|
-
FeedbackListResponseSchema,
|
|
590
|
-
FeedbackUpdateBodySchema,
|
|
591
|
-
FeedbackDeleteResponseSchema,
|
|
592
|
-
} from "./schemas/feedback.js";
|
|
593
|
-
export {
|
|
594
|
-
ClassificationSummarySchema,
|
|
595
|
-
ClassificationRecentResponseSchema,
|
|
596
|
-
ClassificationRecentItemSchema,
|
|
597
|
-
} from "./schemas/classifications.js";
|
|
598
|
-
export { SemanticAlertSummarySchema } from "./schemas/semantic-alert-summary.js";
|
|
599
|
-
export {
|
|
600
|
-
RecommendationNotifyAddedBodySchema,
|
|
601
|
-
RecommendationNotifyAddedResultSchema,
|
|
602
|
-
} from "./schemas/recommendations.js";
|
|
603
|
-
export {
|
|
604
|
-
SitemapSourceSchema,
|
|
605
|
-
SitemapPayloadSchema,
|
|
606
|
-
SitemapReleaseSchema,
|
|
607
|
-
SitemapReleasesPayloadSchema,
|
|
608
|
-
} from "./schemas/sitemap.js";
|
|
609
|
-
export { errorEnvelopeSchema, decodeApiError, isApiError } from "./schemas/errors.js";
|
|
610
|
-
export type { ErrorEnvelope, DecodedApiError } from "./schemas/errors.js";
|
|
611
|
-
export {
|
|
612
|
-
RelatedScopeSchema,
|
|
613
|
-
RelatedReleaseThumbnailSchema,
|
|
614
|
-
RelatedReleaseSourceSchema,
|
|
615
|
-
RelatedReleaseItemSchema,
|
|
616
|
-
RelatedSourceItemSchema,
|
|
617
|
-
RelatedReleasesOkResponseSchema,
|
|
618
|
-
RelatedReleasesDegradedResponseSchema,
|
|
619
|
-
RelatedReleasesResponseSchema,
|
|
620
|
-
RelatedSourcesOkResponseSchema,
|
|
621
|
-
RelatedSourcesDegradedResponseSchema,
|
|
622
|
-
RelatedSourcesResponseSchema,
|
|
623
|
-
} from "./schemas/related.js";
|
|
624
|
-
export {
|
|
625
|
-
CollectionMemberOrgSchema,
|
|
626
|
-
ProductParentOrgSchema,
|
|
627
|
-
CollectionMemberProductSchema,
|
|
628
|
-
CollectionMemberSchema,
|
|
629
|
-
CollectionListItemSchema,
|
|
630
|
-
CollectionListResponseSchema,
|
|
631
|
-
CollectionDetailSchema,
|
|
632
|
-
CollectionReleaseItemSchema,
|
|
633
|
-
CollectionFeedPaginationSchema,
|
|
634
|
-
CollectionReleasesResponseSchema,
|
|
635
|
-
CollectionRowSchema,
|
|
636
|
-
CreateCollectionRequestSchema,
|
|
637
|
-
UpdateCollectionRequestSchema,
|
|
638
|
-
CollectionMemberInputSchema,
|
|
639
|
-
AddCollectionMemberRequestSchema,
|
|
640
|
-
ReplaceCollectionMembersRequestSchema,
|
|
641
|
-
ResolvedCollectionMemberSchema,
|
|
642
|
-
ReplaceCollectionMembersResponseSchema,
|
|
643
|
-
AddCollectionMemberResponseSchema,
|
|
644
|
-
CollectionDailySummarySchema,
|
|
645
|
-
CollectionDailySummariesResponseSchema,
|
|
646
|
-
CollectionWeeklyDigestListItemSchema,
|
|
647
|
-
CollectionWeeklyDigestsResponseSchema,
|
|
648
|
-
DigestCoveredReleaseSchema,
|
|
649
|
-
DigestSectionSchema,
|
|
650
|
-
CollectionWeeklyDigestDetailSchema,
|
|
651
|
-
} from "./schemas/collections.js";
|
|
652
|
-
export {
|
|
653
|
-
OrgOverviewResponseSchema,
|
|
654
|
-
IncomingOverviewCitationSchema,
|
|
655
|
-
RegenerateOverviewBodySchema,
|
|
656
|
-
RegenerateOverviewResponseSchema,
|
|
657
|
-
ProductOverviewResponseSchema,
|
|
658
|
-
OverviewInputsCheckResponseSchema,
|
|
659
|
-
OverviewInputsFullResponseSchema,
|
|
660
|
-
OverviewInputsResponseSchema,
|
|
661
|
-
PlaybookResponseSchema,
|
|
662
|
-
UpdatePlaybookNotesBodySchema,
|
|
663
|
-
UpdatePlaybookNotesResponseSchema,
|
|
664
|
-
} from "./schemas/overviews.js";
|
|
665
|
-
export { ResolveResponseSchema } from "./schemas/resolve.js";
|
|
666
|
-
export type { ResolveResponse } from "./schemas/resolve.js";
|
|
667
|
-
|
|
668
|
-
// ── Media ──
|
|
669
|
-
|
|
670
|
-
export type MediaItem = z.infer<typeof MediaItemSchema>;
|
|
671
|
-
|
|
672
|
-
export type AiLaneId = z.infer<typeof AiLaneIdSchema>;
|
|
673
|
-
export type AiLaneModelsPut = z.infer<typeof AiLaneModelsPutSchema>;
|
|
674
|
-
export type AiLaneState = z.infer<typeof AiLaneStateSchema>;
|
|
675
|
-
export type OpenRouterCatalogModel = z.infer<typeof OpenRouterCatalogModelSchema>;
|
|
676
|
-
export type AiLaneModelsResponse = z.infer<typeof AiLaneModelsResponseSchema>;
|
|
677
|
-
|
|
678
|
-
export type MarketingClassifierThresholdPut = z.infer<typeof MarketingClassifierThresholdPutSchema>;
|
|
679
|
-
export type MarketingFilteredSource = z.infer<typeof MarketingFilteredSourceSchema>;
|
|
680
|
-
export type MarketingClassifierState = z.infer<typeof MarketingClassifierStateSchema>;
|
|
681
|
-
|
|
682
|
-
// ── Stub tier (#1947) ──
|
|
683
|
-
|
|
684
|
-
export type OrgStatus = z.infer<typeof OrgStatusSchema>;
|
|
685
|
-
export type ReleaseLocationItem = z.infer<typeof ReleaseLocationItemSchema>;
|
|
686
|
-
|
|
687
|
-
// ── Stats ──
|
|
688
|
-
|
|
689
|
-
export type Stats = z.infer<typeof StatsSchema>;
|
|
690
|
-
|
|
691
|
-
// ── Pagination ──
|
|
692
|
-
|
|
693
|
-
export type Pagination = z.infer<typeof PaginationSchema>;
|
|
694
|
-
|
|
695
|
-
export interface ListResponse<T> {
|
|
696
|
-
items: T[];
|
|
697
|
-
pagination: Pagination;
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
// === User-owned API keys (relu_) — self-serve surface served by /v1/api-keys ===
|
|
701
|
-
|
|
702
|
-
/** A user-owned API key (relu_) as returned by GET /v1/api-keys. */
|
|
703
|
-
export interface UserApiKey {
|
|
704
|
-
id: string;
|
|
705
|
-
name: string | null;
|
|
706
|
-
start: string | null;
|
|
707
|
-
scope: ApiScope | null;
|
|
708
|
-
enabled: boolean | null;
|
|
709
|
-
remaining: number | null;
|
|
710
|
-
lastRequest: string | null; // ISO 8601
|
|
711
|
-
createdAt: string; // ISO 8601
|
|
712
|
-
expiresAt: string | null; // ISO 8601
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
/** POST /v1/api-keys create response — includes the full key string exactly once. */
|
|
716
|
-
export interface CreatedUserApiKey extends Omit<UserApiKey, "enabled" | "lastRequest"> {
|
|
717
|
-
key: string;
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
/** GET /v1/api-keys response envelope. */
|
|
721
|
-
export interface ListUserApiKeysResponse {
|
|
722
|
-
apiKeys: UserApiKey[];
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
/** POST /v1/api-keys request body. Self-serve mints are capped at read server-side. */
|
|
726
|
-
export interface CreateUserApiKeyBody {
|
|
727
|
-
name: string;
|
|
728
|
-
scope?: ApiScope;
|
|
729
|
-
expiresInDays?: number;
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
// ── Sitemap (bulk URL emission) ──
|
|
733
|
-
|
|
734
|
-
export type SitemapSource = z.infer<typeof SitemapSourceSchema>;
|
|
735
|
-
export type SitemapPayload = z.infer<typeof SitemapPayloadSchema>;
|
|
736
|
-
/** @deprecated The `GET /v1/sitemap/releases` endpoint was retired in #2219. */
|
|
737
|
-
export type SitemapRelease = z.infer<typeof SitemapReleaseSchema>;
|
|
738
|
-
/** @deprecated The `GET /v1/sitemap/releases` endpoint was retired in #2219. */
|
|
739
|
-
export type SitemapReleasesPayload = z.infer<typeof SitemapReleasesPayloadSchema>;
|
|
740
|
-
|
|
741
|
-
// ── Related (Vectorize neighbors) ──
|
|
742
|
-
|
|
743
|
-
export type RelatedScope = z.infer<typeof RelatedScopeSchema>;
|
|
744
|
-
export type RelatedReleaseThumbnail = z.infer<typeof RelatedReleaseThumbnailSchema>;
|
|
745
|
-
export type RelatedReleaseSource = z.infer<typeof RelatedReleaseSourceSchema>;
|
|
746
|
-
export type RelatedReleaseItem = z.infer<typeof RelatedReleaseItemSchema>;
|
|
747
|
-
export type RelatedSourceItem = z.infer<typeof RelatedSourceItemSchema>;
|
|
748
|
-
export type RelatedReleasesOkResponse = z.infer<typeof RelatedReleasesOkResponseSchema>;
|
|
749
|
-
export type RelatedReleasesDegradedResponse = z.infer<typeof RelatedReleasesDegradedResponseSchema>;
|
|
750
|
-
export type RelatedReleasesResponse = z.infer<typeof RelatedReleasesResponseSchema>;
|
|
751
|
-
export type RelatedSourcesOkResponse = z.infer<typeof RelatedSourcesOkResponseSchema>;
|
|
752
|
-
export type RelatedSourcesDegradedResponse = z.infer<typeof RelatedSourcesDegradedResponseSchema>;
|
|
753
|
-
export type RelatedSourcesResponse = z.infer<typeof RelatedSourcesResponseSchema>;
|
|
754
|
-
|
|
755
|
-
// ── Organizations ──
|
|
756
|
-
|
|
757
|
-
export type OrgListItem = z.infer<typeof OrgListItemSchema>;
|
|
758
|
-
export type OrgListResponse = z.infer<typeof OrgListResponseSchema>;
|
|
759
|
-
export type OrgAccountItem = z.infer<typeof OrgAccountItemSchema>;
|
|
760
|
-
export type OrgAccountsResponse = z.infer<typeof OrgAccountsResponseSchema>;
|
|
761
|
-
export type OrgTagsResponse = z.infer<typeof OrgTagsResponseSchema>;
|
|
762
|
-
export type CreateOrgBody = z.infer<typeof CreateOrgBodySchema>;
|
|
763
|
-
export type UpdateOrgBody = z.infer<typeof UpdateOrgBodySchema>;
|
|
764
|
-
export type SetOrgAvatarBody = z.infer<typeof SetOrgAvatarBodySchema>;
|
|
765
|
-
export type SetOrgAvatarResponse = z.infer<typeof SetOrgAvatarResponseSchema>;
|
|
766
|
-
export type UploadAvatarResponse = z.infer<typeof UploadAvatarResponseSchema>;
|
|
767
|
-
export type WorkspaceProfileFields = z.infer<typeof WorkspaceProfileFieldsSchema>;
|
|
768
|
-
export type PatchWorkspaceProfileBody = z.infer<typeof PatchWorkspaceProfileBodySchema>;
|
|
769
|
-
export type WorkspaceProfileResponse = z.infer<typeof WorkspaceProfileResponseSchema>;
|
|
770
|
-
export type UploadsIntegrationStatus = z.infer<typeof UploadsIntegrationStatusSchema>;
|
|
771
|
-
export type UploadsOAuthConnectResponse = z.infer<typeof UploadsOAuthConnectResponseSchema>;
|
|
772
|
-
export type UploadsOAuthCallbackBody = z.infer<typeof UploadsOAuthCallbackBodySchema>;
|
|
773
|
-
export type UploadsOAuthCallbackResponse = z.infer<typeof UploadsOAuthCallbackResponseSchema>;
|
|
774
|
-
export type OrgDetail = z.infer<typeof OrgDetailSchema>;
|
|
775
|
-
|
|
776
|
-
export type OrgCatalogItem = z.infer<typeof OrgCatalogItemSchema>;
|
|
777
|
-
export type OrgCatalogResponse = z.infer<typeof OrgCatalogResponseSchema>;
|
|
778
|
-
export type OrgCollectionsResponse = z.infer<typeof OrgCollectionsResponseSchema>;
|
|
779
|
-
export type AddOrgAccountBody = z.infer<typeof AddOrgAccountBodySchema>;
|
|
780
|
-
export type IgnoredUrlItem = z.infer<typeof IgnoredUrlItemSchema>;
|
|
781
|
-
export type OrgIgnoredUrlsResponse = z.infer<typeof OrgIgnoredUrlsResponseSchema>;
|
|
782
|
-
export type AddIgnoredUrlBody = z.infer<typeof AddIgnoredUrlBodySchema>;
|
|
783
|
-
export type AddIgnoredUrlResponse = z.infer<typeof AddIgnoredUrlResponseSchema>;
|
|
784
|
-
export type DeleteIgnoredUrlResponse = z.infer<typeof DeleteIgnoredUrlResponseSchema>;
|
|
785
|
-
export type OrgTagsBody = z.infer<typeof OrgTagsBodySchema>;
|
|
786
|
-
export type OrgTagsMutationResponse = z.infer<typeof OrgTagsMutationResponseSchema>;
|
|
787
|
-
export type CreateTagBody = z.infer<typeof CreateTagBodySchema>;
|
|
788
|
-
export type TagRow = z.infer<typeof TagRowSchema>;
|
|
789
|
-
export type OrgActivityResponse = z.infer<typeof OrgActivityResponseSchema>;
|
|
790
|
-
export type OrgHeatmapResponse = z.infer<typeof OrgHeatmapResponseSchema>;
|
|
791
|
-
export type OrgSparklinesResponse = z.infer<typeof OrgSparklinesResponseSchema>;
|
|
792
|
-
export type OrgReleaseItem = z.infer<typeof OrgReleaseItemSchema>;
|
|
793
|
-
export type OrgFeedPagination = z.infer<typeof OrgFeedPaginationSchema>;
|
|
794
|
-
export type OrgReleasesFeedResponse = z.infer<typeof OrgReleasesFeedResponseSchema>;
|
|
795
|
-
export type OrgRecentReleaseItem = z.infer<typeof OrgRecentReleaseItemSchema>;
|
|
796
|
-
export type OrgRecentReleasesResponse = z.infer<typeof OrgRecentReleasesResponseSchema>;
|
|
797
|
-
export type DeleteOrgAccountResponse = z.infer<typeof DeleteOrgAccountResponseSchema>;
|
|
798
|
-
|
|
799
|
-
// ── Sources ──
|
|
800
|
-
|
|
801
|
-
export type SourceListItem = z.infer<typeof SourceListItemSchema>;
|
|
802
|
-
export type SourceWithOrg = z.infer<typeof SourceWithOrgSchema>;
|
|
803
|
-
export type SourceListResponse = z.infer<typeof SourceListResponseSchema>;
|
|
804
|
-
export type SourceListResult = z.infer<typeof SourceListResultSchema>;
|
|
805
|
-
export type SourcePatchInput = z.infer<typeof SourcePatchInputSchema>;
|
|
806
|
-
export type CreateSourceBody = z.infer<typeof CreateSourceBodySchema>;
|
|
807
|
-
export type ChangelogFileSummary = z.infer<typeof ChangelogFileSummarySchema>;
|
|
808
|
-
export type SourceChangelogResponse = z.infer<typeof SourceChangelogResponseSchema>;
|
|
809
|
-
export type SourceDetail = z.infer<typeof SourceDetailSchema>;
|
|
810
|
-
export type SourceFeedPagination = z.infer<typeof SourceFeedPaginationSchema>;
|
|
811
|
-
export type SourceMutationResponse = z.infer<typeof SourceMutationResponseSchema>;
|
|
812
|
-
export type AppStoreMaterializeResponse = z.infer<typeof AppStoreMaterializeResponseSchema>;
|
|
813
|
-
export type SourceOrgRef = z.infer<typeof SourceOrgRefSchema>;
|
|
814
|
-
export type SourceActivityResponse = z.infer<typeof SourceActivityResponseSchema>;
|
|
815
|
-
export type SourceHeatmapResponse = z.infer<typeof SourceHeatmapResponseSchema>;
|
|
816
|
-
export type SourceKnownReleaseItem = z.infer<typeof SourceKnownReleaseItemSchema>;
|
|
817
|
-
export type SourceKnownReleasesResponse = z.infer<typeof SourceKnownReleasesResponseSchema>;
|
|
818
|
-
export type SourceRecentReleasesResponse = z.infer<typeof SourceRecentReleasesResponseSchema>;
|
|
819
|
-
export type SourceSessionsResponse = z.infer<typeof SourceSessionsResponseSchema>;
|
|
820
|
-
export type SourceSummaryRow = z.infer<typeof SourceSummaryRowSchema>;
|
|
821
|
-
export type SourceSummariesResponse = z.infer<typeof SourceSummariesResponseSchema>;
|
|
822
|
-
export type CreateSourceSummaryBody = z.infer<typeof CreateSourceSummaryBodySchema>;
|
|
823
|
-
export type CreateSourceSummaryResponse = z.infer<typeof CreateSourceSummaryResponseSchema>;
|
|
824
|
-
export type SourceFetchResponse = z.infer<typeof SourceFetchResponseSchema>;
|
|
825
|
-
export type SourceContentHashResponse = z.infer<typeof SourceContentHashResponseSchema>;
|
|
826
|
-
export type SourceContentHashBody = z.infer<typeof SourceContentHashBodySchema>;
|
|
827
|
-
export type ChangelogTokensResponse = z.infer<typeof ChangelogTokensResponseSchema>;
|
|
828
|
-
export type SourceMetadataResponse = z.infer<typeof SourceMetadataResponseSchema>;
|
|
829
|
-
export type ChangelogProbeResponse = z.infer<typeof ChangelogProbeResponseSchema>;
|
|
830
|
-
export type DeleteSourceResponse = z.infer<typeof DeleteSourceResponseSchema>;
|
|
831
|
-
export type DeleteSourceReleasesResponse = z.infer<typeof DeleteSourceReleasesResponseSchema>;
|
|
832
|
-
export type InsertReleaseResponse = z.infer<typeof InsertReleaseResponseSchema>;
|
|
833
|
-
export type BatchReleasesResponse = z.infer<typeof BatchReleasesResponseSchema>;
|
|
834
|
-
export type RawSnapshotResponse = z.infer<typeof RawSnapshotResponseSchema>;
|
|
835
|
-
export type OversizedChangelogFileRow = z.infer<typeof OversizedChangelogFileRowSchema>;
|
|
836
|
-
export type OversizedChangelogFilesResponse = z.infer<typeof OversizedChangelogFilesResponseSchema>;
|
|
837
|
-
export type FetchableSourcesResponse = z.infer<typeof FetchableSourcesResponseSchema>;
|
|
838
|
-
export type FeedSourcesResponse = z.infer<typeof FeedSourcesResponseSchema>;
|
|
839
|
-
export type ChangedSourcesResponse = z.infer<typeof ChangedSourcesResponseSchema>;
|
|
840
|
-
|
|
841
|
-
// ── Admin telemetry: orgs rollup ──
|
|
842
|
-
|
|
843
|
-
export interface OrgsRollupRow {
|
|
844
|
-
/** Org slug, or "—" for sources without an org. */
|
|
845
|
-
orgSlug: string;
|
|
846
|
-
sourceCount: number;
|
|
847
|
-
/** Sources with no release on file or `latestDate` older than `staleDays`. */
|
|
848
|
-
staleCount: number;
|
|
849
|
-
/** Most-recent release across all of the org's sources, or null. */
|
|
850
|
-
mostRecentRelease: string | null;
|
|
851
|
-
mostRecentAgeDays: number | null;
|
|
852
|
-
/** True iff every source in the org is stale (and the org has at least one source). */
|
|
853
|
-
allStale: boolean;
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
export interface OrgsRollupResponse extends ListResponse<OrgsRollupRow> {
|
|
857
|
-
meta: {
|
|
858
|
-
/** Stale cutoff used server-side, in days. */
|
|
859
|
-
staleDays: number;
|
|
860
|
-
totalOrgs: number;
|
|
861
|
-
/** Orgs where every source is stale. */
|
|
862
|
-
dormantOrgs: number;
|
|
863
|
-
/** Orgs with at least one stale source. */
|
|
864
|
-
anyStaleOrgs: number;
|
|
865
|
-
};
|
|
866
|
-
}
|
|
867
|
-
|
|
868
|
-
// ── Admin telemetry: stuck sources ──
|
|
869
|
-
|
|
870
|
-
/**
|
|
871
|
-
* A source whose recent fetch history is all errors with no reachability — a
|
|
872
|
-
* candidate for pausing. "Stuck" means: within the last `window` non-`dry_run`
|
|
873
|
-
* fetch attempts, every one was an `error` (zero `success`/`no_change`) and
|
|
874
|
-
* there were at least `minAttempts` of them.
|
|
875
|
-
*
|
|
876
|
-
* This keys off the `fetch_log` error streak rather than
|
|
877
|
-
* `sources.consecutive_errors`, because the scrape/agent fetch path never bumps
|
|
878
|
-
* that column (a source can fail for days with `consecutive_errors = 0`).
|
|
879
|
-
*/
|
|
880
|
-
export interface StuckSource {
|
|
881
|
-
sourceId: string;
|
|
882
|
-
sourceSlug: string;
|
|
883
|
-
name: string;
|
|
884
|
-
type: SourceType;
|
|
885
|
-
url: string;
|
|
886
|
-
kind: string | null;
|
|
887
|
-
orgSlug: string | null;
|
|
888
|
-
orgName: string | null;
|
|
889
|
-
/** Current fetch tier — `paused` rows only appear when `includePaused`. */
|
|
890
|
-
fetchPriority: SourceFetchPriority;
|
|
891
|
-
/** True when this is the org's primary changelog (Firebase's was). */
|
|
892
|
-
isPrimary: boolean;
|
|
893
|
-
isHidden: boolean;
|
|
894
|
-
/** Non-`dry_run` attempts examined in the window (all errors when stuck). */
|
|
895
|
-
recentAttempts: number;
|
|
896
|
-
/**
|
|
897
|
-
* Failed or degraded attempts (`error`, `crawl_timeout`, `blocked`) among the
|
|
898
|
-
* examined attempts (equals `recentAttempts` when stuck).
|
|
899
|
-
*/
|
|
900
|
-
recentErrors: number;
|
|
901
|
-
/** Most-recent fetch attempt timestamp (ISO), or null. */
|
|
902
|
-
lastAttemptAt: string | null;
|
|
903
|
-
/** Most-recent error message. */
|
|
904
|
-
lastError: string | null;
|
|
905
|
-
/** Most-recent error category, when the fetcher classified it. */
|
|
906
|
-
lastErrorCategory: string | null;
|
|
907
|
-
/** Last time the source was reachable (`success`/`no_change`), ISO; null = never. */
|
|
908
|
-
lastSuccessAt: string | null;
|
|
909
|
-
/** `sources.last_fetched_at` — null when the source has never fetched. */
|
|
910
|
-
lastFetchedAt: string | null;
|
|
911
|
-
/** When the source row was created (ISO) — proxy for how long it's failed. */
|
|
912
|
-
sourceCreatedAt: string | null;
|
|
913
|
-
}
|
|
914
|
-
|
|
915
|
-
export interface StuckSourcesResponse extends ListResponse<StuckSource> {
|
|
916
|
-
meta: {
|
|
917
|
-
/** Recent non-`dry_run` attempts examined per source. */
|
|
918
|
-
window: number;
|
|
919
|
-
/** Minimum attempts in the window required to flag a source. */
|
|
920
|
-
minAttempts: number;
|
|
921
|
-
/** Whether already-paused sources were included. */
|
|
922
|
-
includePaused: boolean;
|
|
923
|
-
};
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
// ── Admin telemetry: provider / ingest health ──
|
|
927
|
-
|
|
928
|
-
/**
|
|
929
|
-
* A source flagged as "overdue for evaluation" — `sources.last_fetched_at`
|
|
930
|
-
* (written on every successful check, including `no_change`) is older than
|
|
931
|
-
* the health scan's threshold, or null. This is deliberately independent of
|
|
932
|
-
* release recency: a source can be perfectly healthy (actively checked, just
|
|
933
|
-
* quiet) while its latest release is months old, and conversely every source
|
|
934
|
-
* can look quiet-but-fine by release date while the thing that checks them —
|
|
935
|
-
* ingest, extraction, the AI provider — has silently stopped running. See the
|
|
936
|
-
* 2026-07-23 spend-cap outage (#2168): `last_fetched_at` froze across every
|
|
937
|
-
* affected source for six days while nothing else changed.
|
|
938
|
-
*/
|
|
939
|
-
export interface ProviderHealthSource {
|
|
940
|
-
sourceId: string;
|
|
941
|
-
sourceSlug: string;
|
|
942
|
-
name: string;
|
|
943
|
-
type: SourceType;
|
|
944
|
-
orgSlug: string | null;
|
|
945
|
-
orgName: string | null;
|
|
946
|
-
fetchPriority: SourceFetchPriority;
|
|
947
|
-
isPrimary: boolean;
|
|
948
|
-
/** `sources.last_fetched_at` — null when the source has never been fetched successfully. */
|
|
949
|
-
lastFetchedAt: string | null;
|
|
950
|
-
/** Days since `lastFetchedAt` (or since the source was created, if never fetched). */
|
|
951
|
-
daysSinceFetched: number;
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
export interface ProviderHealthResponse extends ListResponse<ProviderHealthSource> {
|
|
955
|
-
meta: {
|
|
956
|
-
/** A source is "overdue" once its last successful check exceeds this many days. */
|
|
957
|
-
overdueThresholdDays: number;
|
|
958
|
-
/** Active (non-paused, non-deleted) sources considered by the scan. */
|
|
959
|
-
totalActiveSources: number;
|
|
960
|
-
/** Sources whose last successful check is older than the threshold, or never. */
|
|
961
|
-
overdueSources: number;
|
|
962
|
-
/** Distinct orgs with at least one overdue source. */
|
|
963
|
-
overdueOrgs: number;
|
|
964
|
-
/** Distinct orgs represented among active sources. */
|
|
965
|
-
totalOrgs: number;
|
|
966
|
-
/**
|
|
967
|
-
* Active sources that should still be polling but whose SourceActor mirror
|
|
968
|
-
* is unmanaged / missing `nextAlarmAt` (#2286). Independent of overdue
|
|
969
|
-
* last-check — a freshly fetched source can still have a dead alarm.
|
|
970
|
-
*/
|
|
971
|
-
unmanagedActors: number;
|
|
972
|
-
};
|
|
973
|
-
}
|
|
974
|
-
|
|
975
|
-
// ── Releases ──
|
|
976
|
-
|
|
977
|
-
/**
|
|
978
|
-
* Release type — mirrors `RELEASE_TYPES` in `@buildinternet/releases-core/schema`.
|
|
979
|
-
* Optional on the wire so older API responses (mid-deploy or pinned old workers)
|
|
980
|
-
* degrade gracefully — consumers that see `undefined` should treat it as `"feature"`.
|
|
981
|
-
*/
|
|
982
|
-
export type ReleaseType = z.infer<typeof ReleaseTypeSchema>;
|
|
983
|
-
|
|
984
|
-
export type ReleaseItem = z.infer<typeof ReleaseItemSchema>;
|
|
985
|
-
export type ReleaseComposition = z.infer<typeof ReleaseCompositionSchema>;
|
|
986
|
-
|
|
987
|
-
/**
|
|
988
|
-
* One entry in a {@link WhatsChangedResponse} — a release in the requested
|
|
989
|
-
* upgrade range; a slim, release-derived projection. `breaking`/`migrationNotes`
|
|
990
|
-
* come from #1696 (`"unknown"` until classified or for non-dev-facing kinds).
|
|
991
|
-
*/
|
|
992
|
-
export interface WhatsChangedEntry {
|
|
993
|
-
version: string | null;
|
|
994
|
-
publishedAt: string | null;
|
|
995
|
-
/** AI-generated title when present, else the raw release title. */
|
|
996
|
-
title: string | null;
|
|
997
|
-
summary: string | null;
|
|
998
|
-
breaking: BreakingLevel;
|
|
999
|
-
migrationNotes: string | null;
|
|
1000
|
-
url: string | null;
|
|
1001
|
-
/**
|
|
1002
|
-
* Absolute canonical web URL — the slugged `/release/<id>-<slug>` form
|
|
1003
|
-
* (#1906), built from `WEB_BASE_URL`. Distinct from `url` (the upstream
|
|
1004
|
-
* source URL); lets an upgrade-planning agent link the release detail page.
|
|
1005
|
-
*/
|
|
1006
|
-
webUrl: string | null;
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
/**
|
|
1010
|
-
* Response of `GET /v1/whats-changed` (#1697, upgrade intelligence Phase 1) —
|
|
1011
|
-
* the changelog entries in the half-open version range `(from, to]` for a
|
|
1012
|
-
* package (`from` exclusive, `to` inclusive). `status: "unknown"` (still
|
|
1013
|
-
* HTTP 200 — a valid answer, not an error) when the package can't be resolved
|
|
1014
|
-
* read-only from the catalog (e.g. an npm/PyPI name absent until #1345).
|
|
1015
|
-
* `entries` are ordered oldest→newest; a range wider than the token budget is
|
|
1016
|
-
* truncated (newest entries kept), flagged by `truncated` + `truncatedAtTokens`.
|
|
1017
|
-
*/
|
|
1018
|
-
export interface WhatsChangedResponse {
|
|
1019
|
-
status: "resolved" | "unknown";
|
|
1020
|
-
package: string;
|
|
1021
|
-
ecosystem: "npm" | "pypi" | "github" | null;
|
|
1022
|
-
from: string;
|
|
1023
|
-
to: string;
|
|
1024
|
-
source: { sourceId: string; sourceSlug: string; orgSlug: string } | null;
|
|
1025
|
-
entries: WhatsChangedEntry[];
|
|
1026
|
-
count: number;
|
|
1027
|
-
truncated: boolean;
|
|
1028
|
-
truncatedAtTokens?: number;
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
|
-
export interface ReleaseDetail {
|
|
1032
|
-
id: string;
|
|
1033
|
-
sourceId: string;
|
|
1034
|
-
version: string | null;
|
|
1035
|
-
title: string;
|
|
1036
|
-
content: string;
|
|
1037
|
-
/** AI-generated summary (#852, renamed in #860). Nullable — most rows unpopulated. */
|
|
1038
|
-
summary: string | null;
|
|
1039
|
-
/**
|
|
1040
|
-
* AI-generated self-contained news-headline form of the release (#852,
|
|
1041
|
-
* renamed in #860). Nullable because most rows are unpopulated — fall
|
|
1042
|
-
* back to `title` for display. `.optional()` for the same mid-deploy /
|
|
1043
|
-
* pinned-worker reason as `type` on {@link ReleaseItem}.
|
|
1044
|
-
*/
|
|
1045
|
-
titleGenerated?: string | null;
|
|
1046
|
-
/** AI-generated smart-brevity headline (#852, renamed in #860). Same fallback as `titleGenerated`. */
|
|
1047
|
-
titleShort?: string | null;
|
|
1048
|
-
/**
|
|
1049
|
-
* Machine-readable breaking-change level (#1696). `.optional()` for mid-deploy
|
|
1050
|
-
* / pinned-worker tolerance; absent or `"unknown"` means not classified (the
|
|
1051
|
-
* fail-open default). Populated live at ingest for developer-facing source
|
|
1052
|
-
* kinds; history is `"unknown"` pending a backfill. Route population + the web
|
|
1053
|
-
* chip are #1696 follow-ups.
|
|
1054
|
-
*/
|
|
1055
|
-
breaking?: BreakingLevel;
|
|
1056
|
-
/** Explicit upgrade/migration steps lifted from the body (#1696); null when the body gives none. */
|
|
1057
|
-
migrationNotes?: string | null;
|
|
1058
|
-
/**
|
|
1059
|
-
* AI-scored release importance, 1 (housekeeping) to 5 (landmark). Scored at
|
|
1060
|
-
* ingest by the release-content pass; fail-open — null/absent means not
|
|
1061
|
-
* scored. Additive — older servers omit it.
|
|
1062
|
-
*/
|
|
1063
|
-
importance?: number | null;
|
|
1064
|
-
url: string | null;
|
|
1065
|
-
/**
|
|
1066
|
-
* Canonical releases.sh detail-page URL (friendly form: ID + current
|
|
1067
|
-
* title slug). Additive — older servers omit it.
|
|
1068
|
-
*/
|
|
1069
|
-
webUrl?: string;
|
|
1070
|
-
media: MediaItem[];
|
|
1071
|
-
publishedAt: string | null;
|
|
1072
|
-
fetchedAt: string;
|
|
1073
|
-
sourceName: string;
|
|
1074
|
-
sourceSlug: string;
|
|
1075
|
-
sourceType: string;
|
|
1076
|
-
/**
|
|
1077
|
-
* Owning org. `avatarUrl` is the resolved `organizations.avatar_url`
|
|
1078
|
-
* (nullable; `.optional()` for mid-deploy / pinned-worker tolerance).
|
|
1079
|
-
* `discovery` and `isHidden` are additive — older servers omit them.
|
|
1080
|
-
*/
|
|
1081
|
-
org: {
|
|
1082
|
-
slug: string;
|
|
1083
|
-
name: string;
|
|
1084
|
-
avatarUrl?: string | null;
|
|
1085
|
-
/** How the org was created. Additive — older servers omit it. */
|
|
1086
|
-
discovery?: "curated" | "agent" | "on_demand";
|
|
1087
|
-
/** Whether the org is hidden from public listings. Additive — older servers omit it. */
|
|
1088
|
-
isHidden?: boolean;
|
|
1089
|
-
} | null;
|
|
1090
|
-
/**
|
|
1091
|
-
* Owning product, when the source is grouped under one (`sources.product_id`).
|
|
1092
|
-
* `null` when ungrouped; `.optional()` so older servers that omit it still type.
|
|
1093
|
-
*/
|
|
1094
|
-
product?: { slug: string; name: string } | null;
|
|
1095
|
-
/** Release type. See {@link ReleaseType}. */
|
|
1096
|
-
type?: ReleaseType;
|
|
1097
|
-
/** Per-category item counts from the AI release-content pass. See {@link ReleaseComposition}. */
|
|
1098
|
-
composition?: ReleaseComposition | null;
|
|
1099
|
-
/** App Store platform + icon, present only when `sourceType === "appstore"`. */
|
|
1100
|
-
appStore?: { platform: "ios" | "macos"; iconUrl: string | null } | null;
|
|
1101
|
-
/** Video provider tag, present only when `sourceType === "video"`. */
|
|
1102
|
-
video?: { provider: "youtube" | "vimeo" | "wistia" } | null;
|
|
1103
|
-
/**
|
|
1104
|
-
* Whether the release's source is hidden from public listings. Additive —
|
|
1105
|
-
* older servers omit it; treat `undefined` as `false`.
|
|
1106
|
-
*/
|
|
1107
|
-
sourceIsHidden?: boolean;
|
|
1108
|
-
}
|
|
1109
|
-
|
|
1110
|
-
export type ReleaseCoverageSibling = z.infer<typeof ReleaseCoverageSiblingSchema>;
|
|
1111
|
-
export type ReleaseCoverageRow = z.infer<typeof ReleaseCoverageRowSchema>;
|
|
1112
|
-
export type ReleaseCoverageResponse = z.infer<typeof ReleaseCoverageResponseSchema>;
|
|
1113
|
-
export type LinkReleaseCoverageBody = z.infer<typeof LinkReleaseCoverageBodySchema>;
|
|
1114
|
-
export type LinkReleaseCoverageResponse = z.infer<typeof LinkReleaseCoverageResponseSchema>;
|
|
1115
|
-
export type UnlinkReleaseCoverageResponse = z.infer<typeof UnlinkReleaseCoverageResponseSchema>;
|
|
1116
|
-
|
|
1117
|
-
export type ReleaseLatestSource = z.infer<typeof ReleaseLatestSourceSchema>;
|
|
1118
|
-
export type ReleaseLatestProduct = z.infer<typeof ReleaseLatestProductSchema>;
|
|
1119
|
-
export type ReleaseLatestItem = z.infer<typeof ReleaseLatestItemSchema>;
|
|
1120
|
-
export type ReleaseLatestResponse = z.infer<typeof ReleaseLatestResponseSchema>;
|
|
1121
|
-
|
|
1122
|
-
export type ReleaseWithMediaRow = z.infer<typeof ReleaseWithMediaRowSchema>;
|
|
1123
|
-
export type ReleasesWithMediaResponse = z.infer<typeof ReleasesWithMediaResponseSchema>;
|
|
1124
|
-
|
|
1125
|
-
export type ReleaseDetailOrg = z.infer<typeof ReleaseDetailOrgSchema>;
|
|
1126
|
-
export type ReleaseDetailResponse = z.infer<typeof ReleaseDetailResponseSchema>;
|
|
1127
|
-
export type UpdateReleaseBody = z.infer<typeof UpdateReleaseBodySchema>;
|
|
1128
|
-
export type ReleasePatchResponse = z.infer<typeof ReleasePatchResponseSchema>;
|
|
1129
|
-
export type ReleaseDeleteResponse = z.infer<typeof ReleaseDeleteResponseSchema>;
|
|
1130
|
-
export type ReleaseBatchDeleteBody = z.infer<typeof ReleaseBatchDeleteBodySchema>;
|
|
1131
|
-
export type ReleaseBatchDeleteResponse = z.infer<typeof ReleaseBatchDeleteResponseSchema>;
|
|
1132
|
-
export type ReleaseSuppressResponse = z.infer<typeof ReleaseSuppressResponseSchema>;
|
|
1133
|
-
export type ReleaseUnsuppressResponse = z.infer<typeof ReleaseUnsuppressResponseSchema>;
|
|
1134
|
-
export type ReleaseSuppressBody = z.infer<typeof ReleaseSuppressBodySchema>;
|
|
1135
|
-
export type ReleaseBatchSuppressBody = z.infer<typeof ReleaseBatchSuppressBodySchema>;
|
|
1136
|
-
export type ReleaseBatchSuppressResponse = z.infer<typeof ReleaseBatchSuppressResponseSchema>;
|
|
1137
|
-
export type ReleaseStreamMessage = z.infer<typeof ReleaseStreamMessageSchema>;
|
|
1138
|
-
|
|
1139
|
-
export type ReleaseSummaryItem = z.infer<typeof ReleaseSummaryItemSchema>;
|
|
1140
|
-
|
|
1141
|
-
// ── Follows ──
|
|
1142
|
-
|
|
1143
|
-
/** What a user can follow. */
|
|
1144
|
-
export type FollowTarget = "org" | "product";
|
|
1145
|
-
|
|
1146
|
-
/** A user's follow, enriched for rendering (returned by GET /v1/me/follows). */
|
|
1147
|
-
export interface Follow {
|
|
1148
|
-
targetType: FollowTarget;
|
|
1149
|
-
targetId: string;
|
|
1150
|
-
name: string;
|
|
1151
|
-
slug: string;
|
|
1152
|
-
avatarUrl: string | null;
|
|
1153
|
-
/** Owning org slug for product follows (null for org follows). */
|
|
1154
|
-
orgSlug: string | null;
|
|
1155
|
-
createdAt: string;
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1158
|
-
/** GET /v1/me/follows response. */
|
|
1159
|
-
export interface FollowsListResponse {
|
|
1160
|
-
follows: Follow[];
|
|
1161
|
-
}
|
|
1162
|
-
|
|
1163
|
-
/** POST /v1/me/follows request body. */
|
|
1164
|
-
export interface FollowRequest {
|
|
1165
|
-
targetType: FollowTarget;
|
|
1166
|
-
targetId: string;
|
|
1167
|
-
}
|
|
1168
|
-
|
|
1169
|
-
/** POST/DELETE /v1/me/follows response. */
|
|
1170
|
-
export interface FollowMutationResponse {
|
|
1171
|
-
success: true;
|
|
1172
|
-
following: boolean;
|
|
1173
|
-
}
|
|
1174
|
-
|
|
1175
|
-
/**
|
|
1176
|
-
* A user's personalized feed token, including the full re-revealable feed URL.
|
|
1177
|
-
* The token is reversible (stored recoverably) because the feed serves only
|
|
1178
|
-
* public release data and carries no PII — so the URL can be re-displayed and
|
|
1179
|
-
* copied on any visit (see #1519 design, decision 6). One per user.
|
|
1180
|
-
*/
|
|
1181
|
-
export interface FeedToken {
|
|
1182
|
-
/** Absolute, tokenized Atom URL — e.g. https://api.releases.sh/v1/feed/relf_…_….atom */
|
|
1183
|
-
feedUrl: string;
|
|
1184
|
-
/** Non-secret public handle (for masked display). */
|
|
1185
|
-
lookupId: string;
|
|
1186
|
-
createdAt: string;
|
|
1187
|
-
lastUsedAt: string | null;
|
|
1188
|
-
}
|
|
1189
|
-
|
|
1190
|
-
/** `GET /v1/me/feed/token` — the token, or null if the user has none yet. */
|
|
1191
|
-
export interface FeedTokenResponse {
|
|
1192
|
-
token: FeedToken | null;
|
|
1193
|
-
}
|
|
1194
|
-
|
|
1195
|
-
/** Cursor pagination shape for GET /v1/me/feed (same as other release feeds). */
|
|
1196
|
-
export type PersonalizedFeedPagination = OrgFeedPagination;
|
|
1197
|
-
|
|
1198
|
-
/**
|
|
1199
|
-
* GET /v1/me/feed response — the personalized release feed. Reuses the same item
|
|
1200
|
-
* shape as /v1/releases/latest (ReleaseLatestItem); cursor-paginated like other
|
|
1201
|
-
* feed-shaped surfaces.
|
|
1202
|
-
*/
|
|
1203
|
-
export interface PersonalizedFeedResponse {
|
|
1204
|
-
items: ReleaseLatestItem[];
|
|
1205
|
-
pagination: PersonalizedFeedPagination;
|
|
1206
|
-
}
|
|
1207
|
-
|
|
1208
|
-
// ── User webhooks ──
|
|
1209
|
-
|
|
1210
|
-
/** High-level delivery posture derived from summary columns (no AE query). */
|
|
1211
|
-
export type WebhookDeliveryHealth =
|
|
1212
|
-
| "never_delivered"
|
|
1213
|
-
| "healthy"
|
|
1214
|
-
| "degraded"
|
|
1215
|
-
| "failing"
|
|
1216
|
-
| "paused"
|
|
1217
|
-
| "auto_paused";
|
|
1218
|
-
|
|
1219
|
-
/** Self-serve webhook filter scope. */
|
|
1220
|
-
export type UserWebhookScope = "org" | "follows";
|
|
1221
|
-
|
|
1222
|
-
/** Optional per-event filter on release taxonomy type. */
|
|
1223
|
-
export type UserWebhookReleaseTypeFilter = "feature" | "rollup";
|
|
1224
|
-
|
|
1225
|
-
/** Webhook delivery output format. */
|
|
1226
|
-
export type UserWebhookFormat = "json" | "slack" | "discord";
|
|
1227
|
-
|
|
1228
|
-
/** A user-owned webhook subscription row (no signing secret). */
|
|
1229
|
-
export interface UserWebhookSubscription {
|
|
1230
|
-
id: string;
|
|
1231
|
-
userId: string;
|
|
1232
|
-
scope: UserWebhookScope;
|
|
1233
|
-
orgId: string | null;
|
|
1234
|
-
url: string;
|
|
1235
|
-
sourceId: string | null;
|
|
1236
|
-
productId: string | null;
|
|
1237
|
-
releaseType: UserWebhookReleaseTypeFilter | null;
|
|
1238
|
-
format: UserWebhookFormat;
|
|
1239
|
-
enabled: boolean;
|
|
1240
|
-
description: string | null;
|
|
1241
|
-
secretVersion: number;
|
|
1242
|
-
createdAt: string;
|
|
1243
|
-
lastSuccessAt: string | null;
|
|
1244
|
-
lastErrorAt: string | null;
|
|
1245
|
-
lastErrorMsg: string | null;
|
|
1246
|
-
consecutiveFailures: number;
|
|
1247
|
-
disabledReason: string | null;
|
|
1248
|
-
failureStreakStartedAt: string | null;
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
|
-
/** Delivery health fields returned on user webhook read paths. */
|
|
1252
|
-
export interface UserWebhookDeliveryHealth {
|
|
1253
|
-
deliveryHealth: WebhookDeliveryHealth;
|
|
1254
|
-
deliveryHealthSummary: string;
|
|
1255
|
-
}
|
|
1256
|
-
|
|
1257
|
-
/** List item returned by GET /v1/me/webhooks — includes org/source display fields. */
|
|
1258
|
-
export interface UserWebhookListItem
|
|
1259
|
-
extends Omit<UserWebhookSubscription, "userId">, UserWebhookDeliveryHealth {
|
|
1260
|
-
orgSlug: string | null;
|
|
1261
|
-
orgName: string | null;
|
|
1262
|
-
sourceSlug: string | null;
|
|
1263
|
-
sourceName: string | null;
|
|
1264
|
-
productSlug: string | null;
|
|
1265
|
-
productName: string | null;
|
|
1266
|
-
}
|
|
1267
|
-
|
|
1268
|
-
/** GET /v1/me/webhooks response. */
|
|
1269
|
-
export interface UserWebhookListResponse {
|
|
1270
|
-
subscriptions: UserWebhookListItem[];
|
|
1271
|
-
}
|
|
1272
|
-
|
|
1273
|
-
/** POST /v1/me/webhooks response — signing key shown once at creation (omitted for slack/discord). */
|
|
1274
|
-
export interface CreateUserWebhookResponse
|
|
1275
|
-
extends UserWebhookSubscription, UserWebhookDeliveryHealth {
|
|
1276
|
-
orgSlug: string | null;
|
|
1277
|
-
orgName: string | null;
|
|
1278
|
-
signingKey?: string;
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
|
-
/** POST /v1/me/webhooks/:id/rotate-secret response. */
|
|
1282
|
-
export interface RotateUserWebhookSecretResponse {
|
|
1283
|
-
secretVersion: number;
|
|
1284
|
-
signingKey: string;
|
|
1285
|
-
}
|
|
1286
|
-
|
|
1287
|
-
/** POST /v1/me/webhooks/:id/test response. */
|
|
1288
|
-
export interface TestUserWebhookResponse {
|
|
1289
|
-
enqueued: true;
|
|
1290
|
-
eventId: string;
|
|
1291
|
-
}
|
|
1292
|
-
|
|
1293
|
-
// ── Workspace webhooks ──
|
|
1294
|
-
|
|
1295
|
-
/** Workspace member role (Better Auth `member.role`, not `user.role`). */
|
|
1296
|
-
export type WorkspaceMemberRole = "owner" | "admin" | "member";
|
|
1297
|
-
|
|
1298
|
-
/**
|
|
1299
|
-
* A workspace-owned webhook subscription row (no signing secret). Workspace
|
|
1300
|
-
* webhooks are org-scoped only; there is no workspace follows scope.
|
|
1301
|
-
*/
|
|
1302
|
-
export interface WorkspaceWebhookSubscription extends Omit<
|
|
1303
|
-
UserWebhookSubscription,
|
|
1304
|
-
"userId" | "scope"
|
|
1305
|
-
> {
|
|
1306
|
-
workspaceId: string;
|
|
1307
|
-
scope: "org";
|
|
1308
|
-
}
|
|
1309
|
-
|
|
1310
|
-
/** List item returned by GET /v1/workspaces/:workspaceId/webhooks. */
|
|
1311
|
-
export interface WorkspaceWebhookListItem extends Omit<UserWebhookListItem, "scope"> {
|
|
1312
|
-
workspaceId: string;
|
|
1313
|
-
scope: "org";
|
|
1314
|
-
}
|
|
1315
|
-
|
|
1316
|
-
/** GET /v1/workspaces/:workspaceId/webhooks response. */
|
|
1317
|
-
export interface WorkspaceWebhookListResponse {
|
|
1318
|
-
subscriptions: WorkspaceWebhookListItem[];
|
|
1319
|
-
/** The caller's role in the workspace. */
|
|
1320
|
-
role: WorkspaceMemberRole;
|
|
1321
|
-
/** True for owners and admins: create, edit, rotate, and delete. Members can view and test. */
|
|
1322
|
-
canManage: boolean;
|
|
1323
|
-
}
|
|
1324
|
-
|
|
1325
|
-
/** POST /v1/workspaces/:workspaceId/webhooks response — signing key shown once (omitted for slack/discord). */
|
|
1326
|
-
export interface CreateWorkspaceWebhookResponse
|
|
1327
|
-
extends WorkspaceWebhookSubscription, UserWebhookDeliveryHealth {
|
|
1328
|
-
orgSlug: string | null;
|
|
1329
|
-
orgName: string | null;
|
|
1330
|
-
signingKey?: string;
|
|
1331
|
-
}
|
|
1332
|
-
|
|
1333
|
-
/** One Analytics Engine delivery-attempt row from GET …/webhooks/:id/deliveries. */
|
|
1334
|
-
export interface WebhookDeliveryRow {
|
|
1335
|
-
timestamp?: string;
|
|
1336
|
-
event_id?: string;
|
|
1337
|
-
error_message?: string | null;
|
|
1338
|
-
error_code?: string | null;
|
|
1339
|
-
outcome?: string;
|
|
1340
|
-
/** Delivery format — "json" (signed raw event) or a chat card (`slack` / `discord`). Empty on pre-format rows. */
|
|
1341
|
-
format?: UserWebhookFormat | "";
|
|
1342
|
-
http_status?: number;
|
|
1343
|
-
latency_ms?: number;
|
|
1344
|
-
attempt?: number;
|
|
1345
|
-
}
|
|
1346
|
-
|
|
1347
|
-
// ── Digest emails ──
|
|
1348
|
-
|
|
1349
|
-
/** How often a user wants a digest email. `off` = no emails. */
|
|
1350
|
-
export type DigestCadence = "off" | "daily" | "weekly";
|
|
1351
|
-
|
|
1352
|
-
/** GET /v1/me/digest response — the caller's current cadence. */
|
|
1353
|
-
export interface DigestPrefsResponse {
|
|
1354
|
-
cadence: DigestCadence;
|
|
1355
|
-
}
|
|
1356
|
-
|
|
1357
|
-
/** PUT /v1/me/digest request body. */
|
|
1358
|
-
export interface DigestPrefsRequest {
|
|
1359
|
-
cadence: DigestCadence;
|
|
1360
|
-
}
|
|
1361
|
-
|
|
1362
|
-
/** One collection whose weekly digest the caller gets by email (#2459). */
|
|
1363
|
-
export interface CollectionDigestSubscription {
|
|
1364
|
-
collectionSlug: string;
|
|
1365
|
-
collectionName: string;
|
|
1366
|
-
/** ISO-8601. */
|
|
1367
|
-
createdAt: string;
|
|
1368
|
-
}
|
|
1369
|
-
|
|
1370
|
-
/** GET /v1/me/collection-digests response, newest first. */
|
|
1371
|
-
export interface CollectionDigestSubscriptionsResponse {
|
|
1372
|
-
subscriptions: CollectionDigestSubscription[];
|
|
1373
|
-
}
|
|
1374
|
-
|
|
1375
|
-
/** PUT / DELETE /v1/me/collection-digests/:slug response. Both are idempotent. */
|
|
1376
|
-
export interface CollectionDigestSubscriptionResponse {
|
|
1377
|
-
collectionSlug: string;
|
|
1378
|
-
subscribed: boolean;
|
|
1379
|
-
}
|
|
1380
|
-
|
|
1381
|
-
// ── Semantic alerts (#2304 Phase 1) ──
|
|
1382
|
-
|
|
1383
|
-
/** Hard cap on saved semantic alerts per account. Enforced on create. */
|
|
1384
|
-
export const SEMANTIC_ALERT_MAX_PER_USER = 5;
|
|
1385
|
-
|
|
1386
|
-
/** Freeform interest text, after trim. User-private — never an analytics label. */
|
|
1387
|
-
export const SEMANTIC_ALERT_QUERY_MAX_CHARS = 500;
|
|
1388
|
-
|
|
1389
|
-
/** Default selected-choice probability. Phase 2 matcher uses this unless overridden. */
|
|
1390
|
-
export const SEMANTIC_ALERT_THRESHOLD_DEFAULT = 0.8;
|
|
1391
|
-
|
|
1392
|
-
export const SEMANTIC_ALERT_THRESHOLD_MIN = 0.5;
|
|
1393
|
-
export const SEMANTIC_ALERT_THRESHOLD_MAX = 1;
|
|
1394
|
-
|
|
1395
|
-
/**
|
|
1396
|
-
* v1 candidate pool. Matching (Phase 2) scores only releases that already hit
|
|
1397
|
-
* the caller's follow graph. Not a per-alert setting.
|
|
1398
|
-
*/
|
|
1399
|
-
export const SEMANTIC_ALERT_CANDIDATE_POOL = "follows" as const;
|
|
1400
|
-
|
|
1401
|
-
/** One saved semantic alert. Query text is returned only to the owning user. */
|
|
1402
|
-
export interface SemanticAlert {
|
|
1403
|
-
id: string;
|
|
1404
|
-
query: string;
|
|
1405
|
-
enabled: boolean;
|
|
1406
|
-
/** Inclusive match probability in [0.50, 1.00]. Default 0.80. */
|
|
1407
|
-
threshold: number;
|
|
1408
|
-
/** Stored preference. Phase 1 does not send email. */
|
|
1409
|
-
deliverEmail: boolean;
|
|
1410
|
-
/** Stored preference. Phase 1 does not send webhook deliveries. */
|
|
1411
|
-
deliverWebhook: boolean;
|
|
1412
|
-
/** Optional link to one of the caller's `/v1/me/webhooks` subscriptions. */
|
|
1413
|
-
webhookSubscriptionId: string | null;
|
|
1414
|
-
createdAt: string;
|
|
1415
|
-
updatedAt: string;
|
|
1416
|
-
}
|
|
1417
|
-
|
|
1418
|
-
/**
|
|
1419
|
-
* Claimed-match activity for one alert (#2320). Counts are rows in
|
|
1420
|
-
* `semantic_alert_matches` (notified matches only — below-threshold scores
|
|
1421
|
-
* are not stored). Present on list and notifications-bootstrap rows.
|
|
1422
|
-
*/
|
|
1423
|
-
export interface SemanticAlertActivity {
|
|
1424
|
-
/** Matches in the last 7 days. Included in `matches30d`. */
|
|
1425
|
-
matches7d: number;
|
|
1426
|
-
/** Matches in the last 30 days. */
|
|
1427
|
-
matches30d: number;
|
|
1428
|
-
/** Newest claim, or null when the alert has never matched. */
|
|
1429
|
-
lastMatchedAt: string | null;
|
|
1430
|
-
/** Newest claim's release, when that row still exists. */
|
|
1431
|
-
lastMatch: {
|
|
1432
|
-
releaseId: string;
|
|
1433
|
-
title: string;
|
|
1434
|
-
/** Canonical site path, `/release/rel_…`. */
|
|
1435
|
-
path: string;
|
|
1436
|
-
} | null;
|
|
1437
|
-
}
|
|
1438
|
-
|
|
1439
|
-
/** A list row: the saved alert plus recent match activity. */
|
|
1440
|
-
export interface SemanticAlertListItem extends SemanticAlert {
|
|
1441
|
-
activity: SemanticAlertActivity;
|
|
1442
|
-
}
|
|
1443
|
-
|
|
1444
|
-
/** GET /v1/me/semantic-alerts. `candidatePool` is the locked v1 scope. */
|
|
1445
|
-
export interface SemanticAlertListResponse {
|
|
1446
|
-
alerts: SemanticAlertListItem[];
|
|
1447
|
-
candidatePool: typeof SEMANTIC_ALERT_CANDIDATE_POOL;
|
|
1448
|
-
maxAlerts: number;
|
|
1449
|
-
}
|
|
1450
|
-
|
|
1451
|
-
/**
|
|
1452
|
-
* GET /v1/me/settings/notifications — one-shot bootstrap for `/account/notifications`.
|
|
1453
|
-
* Composes digest cadence + feed token + webhook list so the settings page can
|
|
1454
|
-
* render with a single round-trip instead of three independent mounts.
|
|
1455
|
-
* `semanticAlerts` is `null` when `semantic-alerts-enabled` is off (hide the
|
|
1456
|
-
* section); an array, possibly empty, when the lane is on.
|
|
1457
|
-
*/
|
|
1458
|
-
export interface NotificationSettingsResponse {
|
|
1459
|
-
cadence: DigestCadence;
|
|
1460
|
-
feedToken: FeedToken | null;
|
|
1461
|
-
webhooks: UserWebhookListItem[];
|
|
1462
|
-
semanticAlerts: SemanticAlertListItem[] | null;
|
|
1463
|
-
}
|
|
1464
|
-
|
|
1465
|
-
/**
|
|
1466
|
-
* GET /v1/me/settings/developer — one-shot bootstrap for `/account/webhooks`
|
|
1467
|
-
* (Webhooks & API). `apiKeys` is `null` when the user-api-keys feature is off
|
|
1468
|
-
* so the UI can hide the keys section without a separate probe.
|
|
1469
|
-
*/
|
|
1470
|
-
export interface DeveloperSettingsResponse {
|
|
1471
|
-
webhooks: UserWebhookListItem[];
|
|
1472
|
-
apiKeys: UserApiKey[] | null;
|
|
1473
|
-
}
|
|
1474
|
-
|
|
1475
|
-
/** GET /v1/me/workspaces — one row per workspace the caller belongs to. */
|
|
1476
|
-
export interface MeWorkspace {
|
|
1477
|
-
/** Better Auth organization id. */
|
|
1478
|
-
id: string;
|
|
1479
|
-
name: string;
|
|
1480
|
-
slug: string;
|
|
1481
|
-
logo: string | null;
|
|
1482
|
-
/** Workspace membership role (`member.role`, not `user.role`). */
|
|
1483
|
-
role: WorkspaceMemberRole;
|
|
1484
|
-
/** The caller's active workspace (see docs/architecture/workspaces.md). */
|
|
1485
|
-
active: boolean;
|
|
1486
|
-
createdAt: string;
|
|
1487
|
-
}
|
|
1488
|
-
|
|
1489
|
-
export interface MeWorkspacesResponse {
|
|
1490
|
-
workspaces: MeWorkspace[];
|
|
1491
|
-
}
|
|
1492
|
-
|
|
1493
|
-
// ── Search ──
|
|
1494
|
-
|
|
1495
|
-
export type SearchOrgHit = z.infer<typeof SearchOrgHitSchema>;
|
|
1496
|
-
export type SearchCatalogHit = z.infer<typeof SearchCatalogHitSchema>;
|
|
1497
|
-
|
|
1498
|
-
export type SearchSourceHit = z.infer<typeof SearchSourceHitSchema>;
|
|
1499
|
-
|
|
1500
|
-
export interface RawSourceHit extends SearchSourceHit {
|
|
1501
|
-
productName?: string;
|
|
1502
|
-
productCategory?: string;
|
|
1503
|
-
/** Owning org's avatar URL — folded onto the catalog hit for the byline avatar. */
|
|
1504
|
-
orgAvatarUrl?: string | null;
|
|
1505
|
-
/** Entity taxonomy kind from the `sources.kind` column. */
|
|
1506
|
-
entityKind?: string | null;
|
|
1507
|
-
}
|
|
1508
|
-
|
|
1509
|
-
/**
|
|
1510
|
-
* Fold source hits into the catalog list. Sources under a matched product
|
|
1511
|
-
* are dropped (product wins); orphan sources become `entryType: "source"`.
|
|
1512
|
-
*/
|
|
1513
|
-
export function foldSourcesIntoCatalog(
|
|
1514
|
-
existingProducts: SearchCatalogHit[],
|
|
1515
|
-
rawSources: RawSourceHit[],
|
|
1516
|
-
): SearchCatalogHit[] {
|
|
1517
|
-
const result: SearchCatalogHit[] = existingProducts.map((p) => ({
|
|
1518
|
-
...p,
|
|
1519
|
-
entryType: "product" as const,
|
|
1520
|
-
}));
|
|
1521
|
-
const seen = new Set(result.map((p) => p.slug));
|
|
1522
|
-
for (const s of rawSources) {
|
|
1523
|
-
if (s.productSlug) {
|
|
1524
|
-
if (seen.has(s.productSlug)) continue;
|
|
1525
|
-
result.push({
|
|
1526
|
-
slug: s.productSlug,
|
|
1527
|
-
name: s.productName ?? s.name,
|
|
1528
|
-
orgSlug: s.orgSlug,
|
|
1529
|
-
orgName: s.orgName,
|
|
1530
|
-
orgAvatarUrl: s.orgAvatarUrl ?? null,
|
|
1531
|
-
category: s.productCategory ?? null,
|
|
1532
|
-
entryType: "product",
|
|
1533
|
-
kind: undefined,
|
|
1534
|
-
});
|
|
1535
|
-
seen.add(s.productSlug);
|
|
1536
|
-
} else {
|
|
1537
|
-
result.push({
|
|
1538
|
-
slug: s.slug,
|
|
1539
|
-
name: s.name,
|
|
1540
|
-
orgSlug: s.orgSlug,
|
|
1541
|
-
orgName: s.orgName,
|
|
1542
|
-
orgAvatarUrl: s.orgAvatarUrl ?? null,
|
|
1543
|
-
category: null,
|
|
1544
|
-
entryType: "source",
|
|
1545
|
-
kind: (s.entityKind as SearchCatalogHit["kind"]) ?? undefined,
|
|
1546
|
-
sourceSlug: s.slug,
|
|
1547
|
-
sourceType: s.type,
|
|
1548
|
-
});
|
|
1549
|
-
}
|
|
1550
|
-
}
|
|
1551
|
-
return result;
|
|
1552
|
-
}
|
|
1553
|
-
|
|
1554
|
-
export type SearchReleaseHit = z.infer<typeof SearchReleaseHitSchema>;
|
|
1555
|
-
export type SearchChunkHit = z.infer<typeof SearchChunkHitSchema>;
|
|
1556
|
-
export type SearchCollectionHit = z.infer<typeof SearchCollectionHitSchema>;
|
|
1557
|
-
|
|
1558
|
-
/**
|
|
1559
|
-
* Merge collection hits from three independent sources into one ordered,
|
|
1560
|
-
* deduped array on the wire:
|
|
1561
|
-
*
|
|
1562
|
-
* 1. Direct lexical matches — name/slug/description LIKE.
|
|
1563
|
-
* 2. Direct semantic matches — vector hit (hybrid/semantic only).
|
|
1564
|
-
* 3. Member rollups — collections containing one of the result orgs.
|
|
1565
|
-
*
|
|
1566
|
-
* A direct row always wins for a given slug; member rollups attach their
|
|
1567
|
-
* `matchedOrgSlugs` to a winning direct row so the UI keeps the "shown
|
|
1568
|
-
* because" affordance. Within each `via` bucket, rows order by score desc
|
|
1569
|
-
* (missing scores last) then by name.
|
|
1570
|
-
*
|
|
1571
|
-
* Pure: no DB, no Workers runtime. Used by both `/v1/search` and the MCP
|
|
1572
|
-
* `search` tool so the merge stays in lockstep across surfaces.
|
|
1573
|
-
*/
|
|
1574
|
-
export function mergeCollectionHits(
|
|
1575
|
-
direct: SearchCollectionHit[],
|
|
1576
|
-
semantic: SearchCollectionHit[],
|
|
1577
|
-
member: SearchCollectionHit[],
|
|
1578
|
-
limit: number,
|
|
1579
|
-
): SearchCollectionHit[] {
|
|
1580
|
-
// Pure: never mutate caller-owned objects. Always replace map entries with
|
|
1581
|
-
// shallow copies so two callers (e.g. API and MCP merging from the same
|
|
1582
|
-
// upstream list) can't see each other's writes.
|
|
1583
|
-
const bySlug = new Map<string, SearchCollectionHit>();
|
|
1584
|
-
for (const c of direct) bySlug.set(c.slug, { ...c });
|
|
1585
|
-
for (const c of semantic) {
|
|
1586
|
-
const existing = bySlug.get(c.slug);
|
|
1587
|
-
if (existing) {
|
|
1588
|
-
if (c.score !== undefined && (existing.score === undefined || c.score > existing.score)) {
|
|
1589
|
-
bySlug.set(c.slug, { ...existing, score: c.score });
|
|
1590
|
-
}
|
|
1591
|
-
} else {
|
|
1592
|
-
bySlug.set(c.slug, { ...c });
|
|
1593
|
-
}
|
|
1594
|
-
}
|
|
1595
|
-
for (const c of member) {
|
|
1596
|
-
const existing = bySlug.get(c.slug);
|
|
1597
|
-
if (existing) {
|
|
1598
|
-
bySlug.set(c.slug, { ...existing, matchedOrgSlugs: c.matchedOrgSlugs });
|
|
1599
|
-
} else {
|
|
1600
|
-
bySlug.set(c.slug, { ...c });
|
|
1601
|
-
}
|
|
1602
|
-
}
|
|
1603
|
-
return [...bySlug.values()]
|
|
1604
|
-
.toSorted((a, b) => {
|
|
1605
|
-
if (a.via !== b.via) return a.via === "direct" ? -1 : 1;
|
|
1606
|
-
const sa = a.score ?? -Infinity;
|
|
1607
|
-
const sb = b.score ?? -Infinity;
|
|
1608
|
-
if (sa !== sb) return sb - sa;
|
|
1609
|
-
return a.name.localeCompare(b.name);
|
|
1610
|
-
})
|
|
1611
|
-
.slice(0, limit);
|
|
1612
|
-
}
|
|
1613
|
-
|
|
1614
|
-
// ── Lookups ──
|
|
1615
|
-
|
|
1616
|
-
export type LookupStatus = z.infer<typeof LookupStatusSchema>;
|
|
1617
|
-
export type LookupBody = z.infer<typeof LookupBodySchema>;
|
|
1618
|
-
export type LookupSourceRow = z.infer<typeof LookupSourceSchema>;
|
|
1619
|
-
export type LookupReleaseRow = z.infer<typeof LookupReleaseSchema>;
|
|
1620
|
-
export type LookupRelatedOrg = z.infer<typeof LookupRelatedOrgSchema>;
|
|
1621
|
-
export type LookupResponse = z.infer<typeof LookupResponseSchema>;
|
|
1622
|
-
export type LookupSourceBySlugResponse = z.infer<typeof LookupSourceBySlugResponseSchema>;
|
|
1623
|
-
export type LookupProductBySlugResponse = z.infer<typeof LookupProductBySlugResponseSchema>;
|
|
1624
|
-
export type DomainLookupOrg = z.infer<typeof DomainLookupOrgSchema>;
|
|
1625
|
-
export type DomainLookupProduct = z.infer<typeof DomainLookupProductSchema>;
|
|
1626
|
-
export type DomainLookupResponse = z.infer<typeof DomainLookupResponseSchema>;
|
|
1627
|
-
|
|
1628
|
-
// Slim wire payload embedded in a search response when the query is a GitHub
|
|
1629
|
-
// coordinate. `LookupResultPayload` is the search-embedded slim variant;
|
|
1630
|
-
// `LookupResponse` (above) is the thicker payload returned by POST /v1/lookups.
|
|
1631
|
-
export type LookupResultPayload = z.infer<typeof LookupResultPayloadSchema>;
|
|
1632
|
-
export type UnifiedSearchResponse = z.infer<typeof UnifiedSearchResponseSchema>;
|
|
1633
|
-
|
|
1634
|
-
// ── Overview Pages ──
|
|
1635
|
-
|
|
1636
|
-
export type OverviewPageItem = z.infer<typeof OverviewPageItemSchema>;
|
|
1637
|
-
export type OverviewCitation = z.infer<typeof OverviewCitationSchema>;
|
|
1638
|
-
|
|
1639
|
-
/** @deprecated Use OverviewPageItem */
|
|
1640
|
-
export type KnowledgePageItem = OverviewPageItem;
|
|
1641
|
-
|
|
1642
|
-
export type OrgOverviewResponse = z.infer<typeof OrgOverviewResponseSchema>;
|
|
1643
|
-
export type IncomingOverviewCitation = z.infer<typeof IncomingOverviewCitationSchema>;
|
|
1644
|
-
export type RegenerateOverviewBody = z.infer<typeof RegenerateOverviewBodySchema>;
|
|
1645
|
-
export type RegenerateOverviewResponse = z.infer<typeof RegenerateOverviewResponseSchema>;
|
|
1646
|
-
export type ProductOverviewResponse = z.infer<typeof ProductOverviewResponseSchema>;
|
|
1647
|
-
export type OverviewInputsCheckResponse = z.infer<typeof OverviewInputsCheckResponseSchema>;
|
|
1648
|
-
export type OverviewInputsFullResponse = z.infer<typeof OverviewInputsFullResponseSchema>;
|
|
1649
|
-
export type OverviewInputsResponse = z.infer<typeof OverviewInputsResponseSchema>;
|
|
1650
|
-
export type PlaybookResponse = z.infer<typeof PlaybookResponseSchema>;
|
|
1651
|
-
export type UpdatePlaybookNotesBody = z.infer<typeof UpdatePlaybookNotesBodySchema>;
|
|
1652
|
-
export type UpdatePlaybookNotesResponse = z.infer<typeof UpdatePlaybookNotesResponseSchema>;
|
|
1653
|
-
|
|
1654
|
-
// ── Overview Manifest (admin planning) ──
|
|
1655
|
-
|
|
1656
|
-
export type OverviewStaleness = "missing" | "behind" | "fresh";
|
|
1657
|
-
/**
|
|
1658
|
-
* `opted_out` — the org has `autoGenerateContent=false`, so the overview-regen
|
|
1659
|
-
* eligibility filter skips it regardless of staleness. Surfaced so an
|
|
1660
|
-
* orchestrator planning a sweep doesn't queue a regen that will never run
|
|
1661
|
-
* (#1795).
|
|
1662
|
-
*/
|
|
1663
|
-
export type OverviewPlanAction = "missing" | "refresh" | "skip" | "opted_out";
|
|
1664
|
-
|
|
1665
|
-
/**
|
|
1666
|
-
* Per-org row returned by GET /v1/admin/overviews. Designed for orchestrators
|
|
1667
|
-
* planning a maintenance sweep — `releasesSinceOverview` is the freshness
|
|
1668
|
-
* signal that matters, not date diff alone.
|
|
1669
|
-
*/
|
|
1670
|
-
export interface OverviewManifestRow {
|
|
1671
|
-
orgSlug: string;
|
|
1672
|
-
orgName: string;
|
|
1673
|
-
orgCreatedAt: string;
|
|
1674
|
-
discovery: "curated" | "agent" | "on_demand";
|
|
1675
|
-
overviewUpdatedAt: string | null;
|
|
1676
|
-
overviewGeneratedAt: string | null;
|
|
1677
|
-
lastContributingReleaseAt: string | null;
|
|
1678
|
-
orgLastActivity: string | null;
|
|
1679
|
-
releasesSinceOverview: number;
|
|
1680
|
-
recentReleaseCount: number;
|
|
1681
|
-
staleness: OverviewStaleness;
|
|
1682
|
-
/**
|
|
1683
|
-
* Whether the org is opted into automatic AI content. When `false`, the
|
|
1684
|
-
* overview-regen cron skips it — the staleness signal alone is
|
|
1685
|
-
* misleading without this (#1795). Older workers may omit it mid-deploy.
|
|
1686
|
-
*/
|
|
1687
|
-
autoGenerateContent?: boolean;
|
|
1688
|
-
/** Only populated when ?format=plan. */
|
|
1689
|
-
action?: OverviewPlanAction;
|
|
1690
|
-
/** Only populated when ?format=plan. */
|
|
1691
|
-
needsFetch?: boolean;
|
|
1692
|
-
}
|
|
1693
|
-
|
|
1694
|
-
export type OverviewManifestResponse = ListResponse<OverviewManifestRow>;
|
|
1695
|
-
|
|
1696
|
-
// ── Overview inputs (?check=true) ──
|
|
1697
|
-
|
|
1698
|
-
/**
|
|
1699
|
-
* Lightweight pre-flight payload returned by GET /v1/orgs/:slug/overview/inputs?check=true.
|
|
1700
|
-
* Skips the heavy release-content hydration so an orchestrator can decide whether
|
|
1701
|
-
* to dispatch without paying for the full payload.
|
|
1702
|
-
*/
|
|
1703
|
-
export interface OverviewInputsCheck {
|
|
1704
|
-
orgSlug: string;
|
|
1705
|
-
selected: number;
|
|
1706
|
-
totalAvailable: number;
|
|
1707
|
-
hasExistingContent: boolean;
|
|
1708
|
-
wouldRegenerate: boolean;
|
|
1709
|
-
windowDays: number;
|
|
1710
|
-
}
|
|
1711
|
-
|
|
1712
|
-
/** @deprecated Use UnifiedSearchResponse */
|
|
1713
|
-
export type SearchResult = SearchReleaseHit;
|
|
1714
|
-
/** @deprecated Use UnifiedSearchResponse */
|
|
1715
|
-
export interface SearchResponse {
|
|
1716
|
-
query: string;
|
|
1717
|
-
results: SearchResult[];
|
|
1718
|
-
}
|
|
1719
|
-
|
|
1720
|
-
// ── Activity ──
|
|
1721
|
-
|
|
1722
|
-
export interface WeeklyBucket {
|
|
1723
|
-
weekStart: string;
|
|
1724
|
-
count: number;
|
|
1725
|
-
earliestVersion: string | null;
|
|
1726
|
-
latestVersion: string | null;
|
|
1727
|
-
}
|
|
1728
|
-
|
|
1729
|
-
/**
|
|
1730
|
-
* @deprecated Use SourceActivityResponse (Zod-derived).
|
|
1731
|
-
* The hand-written interface is kept for callsite compatibility — shape is identical.
|
|
1732
|
-
*/
|
|
1733
|
-
export type SourceActivity = SourceActivityResponse;
|
|
1734
|
-
|
|
1735
|
-
// ── Org Activity (Zod-derived aliases) ──
|
|
1736
|
-
// The old hand-written OrgActivitySource / OrgActivity / OrgSparklines /
|
|
1737
|
-
// OrgHeatmap / OrgReleaseItem interfaces have been
|
|
1738
|
-
// replaced by Zod-derived types in the Organizations section above. Keeping
|
|
1739
|
-
// the interface names as deprecated aliases so callsites don't need an
|
|
1740
|
-
// immediate churn.
|
|
1741
|
-
|
|
1742
|
-
/** @deprecated Use OrgActivityResponse */
|
|
1743
|
-
export type OrgActivity = OrgActivityResponse;
|
|
1744
|
-
|
|
1745
|
-
/** @deprecated Use OrgSparklinesResponse */
|
|
1746
|
-
export type OrgSparklines = OrgSparklinesResponse;
|
|
1747
|
-
|
|
1748
|
-
/** @deprecated Use OrgHeatmapResponse */
|
|
1749
|
-
export type OrgHeatmap = OrgHeatmapResponse;
|
|
1750
|
-
|
|
1751
|
-
// ── Org Sparklines (per-source/product breakdown) ──
|
|
1752
|
-
// (covered above)
|
|
1753
|
-
|
|
1754
|
-
// ── Source Heatmap ──
|
|
1755
|
-
// (covered by SourceHeatmapResponse above)
|
|
1756
|
-
|
|
1757
|
-
/**
|
|
1758
|
-
* @deprecated Use SourceHeatmapResponse (Zod-derived).
|
|
1759
|
-
* The hand-written interface is kept for callsite compatibility — shape is identical.
|
|
1760
|
-
*/
|
|
1761
|
-
export type SourceHeatmap = SourceHeatmapResponse;
|
|
1762
|
-
|
|
1763
|
-
// ── Org Releases ──
|
|
1764
|
-
// (covered by OrgReleaseItem / OrgReleasesFeedResponse above)
|
|
1765
|
-
|
|
1766
|
-
// Source-scoped release feed — the source identity is encoded in the URL, so
|
|
1767
|
-
// items omit the redundant `source` block carried by the org feed.
|
|
1768
|
-
export interface SourceReleasesResponse {
|
|
1769
|
-
releases: ReleaseItem[];
|
|
1770
|
-
pagination: { nextCursor: string | null; limit: number };
|
|
1771
|
-
}
|
|
1772
|
-
|
|
1773
|
-
// ── Products ──
|
|
1774
|
-
|
|
1775
|
-
// `Category` lives in @buildinternet/releases-core/categories — import it from
|
|
1776
|
-
// there. CategorySchema is re-exported here for OpenAPI / Zod consumers only.
|
|
1777
|
-
export type ProductRow = z.infer<typeof ProductRowSchema>;
|
|
1778
|
-
export type ProductCreateResponse = z.infer<typeof ProductCreateResponseSchema>;
|
|
1779
|
-
export type ProductListItem = z.infer<typeof ProductListItemSchema>;
|
|
1780
|
-
export type ProductListResponse = z.infer<typeof ProductListResponseSchema>;
|
|
1781
|
-
export type ProductDetailSource = z.infer<typeof ProductDetailSourceSchema>;
|
|
1782
|
-
export type ProductDetail = z.infer<typeof ProductDetailSchema>;
|
|
1783
|
-
export type CreateProductBody = z.infer<typeof CreateProductBodySchema>;
|
|
1784
|
-
export type UpdateProductBody = z.infer<typeof UpdateProductBodySchema>;
|
|
1785
|
-
export type AdoptProductBody = z.infer<typeof AdoptProductBodySchema>;
|
|
1786
|
-
export type ProductAdoptResult = z.infer<typeof ProductAdoptResultSchema>;
|
|
1787
|
-
export type ProductAdoptDryRun = z.infer<typeof ProductAdoptDryRunSchema>;
|
|
1788
|
-
export type ProductAdoptResponse = z.infer<typeof ProductAdoptResponseSchema>;
|
|
1789
|
-
export type ProductDeleteResponse = z.infer<typeof ProductDeleteResponseSchema>;
|
|
1790
|
-
export type ProductTagsListResponse = z.infer<typeof ProductTagsListResponseSchema>;
|
|
1791
|
-
export type ProductTagsBody = z.infer<typeof ProductTagsBodySchema>;
|
|
1792
|
-
export type ProductTagsMutationResponse = z.infer<typeof ProductTagsMutationResponseSchema>;
|
|
1793
|
-
export type ProductActivityResponse = z.infer<typeof ProductActivityResponseSchema>;
|
|
1794
|
-
export type ProductHeatmapResponse = z.infer<typeof ProductHeatmapResponseSchema>;
|
|
1795
|
-
|
|
1796
|
-
// ── Taxonomy (categories + tags) ──
|
|
1797
|
-
|
|
1798
|
-
export type TaxonomyOrg = z.infer<typeof TaxonomyOrgSchema>;
|
|
1799
|
-
export type TaxonomyProduct = z.infer<typeof TaxonomyProductSchema>;
|
|
1800
|
-
export type CategoryDetail = z.infer<typeof CategoryDetailSchema>;
|
|
1801
|
-
export type CategoryListItem = z.infer<typeof CategoryListItemSchema>;
|
|
1802
|
-
export type CategoryListResponse = z.infer<typeof CategoryListResponseSchema>;
|
|
1803
|
-
export type UpdateCategoryRequest = z.infer<typeof UpdateCategoryRequestSchema>;
|
|
1804
|
-
export type UpdateCategoryResponse = z.infer<typeof UpdateCategoryResponseSchema>;
|
|
1805
|
-
export type CategoryFeedPagination = z.infer<typeof CategoryFeedPaginationSchema>;
|
|
1806
|
-
export type CategoryReleasesResponse = z.infer<typeof CategoryReleasesResponseSchema>;
|
|
1807
|
-
export type TagDetail = z.infer<typeof TagDetailSchema>;
|
|
1808
|
-
|
|
1809
|
-
/**
|
|
1810
|
-
* Aggregated release feed row for a category rollup — same wire shape as
|
|
1811
|
-
* `CollectionReleaseItem` (both surfaces use `formatAggregateReleaseRow` in
|
|
1812
|
-
* `apps/api/src/utils.ts`). Aliased rather than duplicated so renderers
|
|
1813
|
-
* can treat them as one.
|
|
1814
|
-
*/
|
|
1815
|
-
export type CategoryReleaseItem = CollectionReleaseItem;
|
|
1816
|
-
|
|
1817
|
-
// ── Collections ──
|
|
1818
|
-
//
|
|
1819
|
-
// Curated, named groups of orgs that drive a public "playlist" page (e.g.
|
|
1820
|
-
// /collections/frontier-ai-labs). Independent of the fixed `category` taxonomy.
|
|
1821
|
-
|
|
1822
|
-
export type CollectionMemberOrg = z.infer<typeof CollectionMemberOrgSchema>;
|
|
1823
|
-
export type ProductParentOrg = z.infer<typeof ProductParentOrgSchema>;
|
|
1824
|
-
export type CollectionMemberProduct = z.infer<typeof CollectionMemberProductSchema>;
|
|
1825
|
-
export type CollectionMember = z.infer<typeof CollectionMemberSchema>;
|
|
1826
|
-
export type CollectionListItem = z.infer<typeof CollectionListItemSchema>;
|
|
1827
|
-
export type CollectionListResponse = z.infer<typeof CollectionListResponseSchema>;
|
|
1828
|
-
export type CollectionDetail = z.infer<typeof CollectionDetailSchema>;
|
|
1829
|
-
export type CollectionReleaseItem = z.infer<typeof CollectionReleaseItemSchema>;
|
|
1830
|
-
export type CollectionFeedPagination = z.infer<typeof CollectionFeedPaginationSchema>;
|
|
1831
|
-
export type CollectionReleasesResponse = z.infer<typeof CollectionReleasesResponseSchema>;
|
|
1832
|
-
export type CollectionRow = z.infer<typeof CollectionRowSchema>;
|
|
1833
|
-
export type CreateCollectionRequest = z.infer<typeof CreateCollectionRequestSchema>;
|
|
1834
|
-
export type UpdateCollectionRequest = z.infer<typeof UpdateCollectionRequestSchema>;
|
|
1835
|
-
export type CollectionMemberInput = z.infer<typeof CollectionMemberInputSchema>;
|
|
1836
|
-
export type AddCollectionMemberRequest = z.infer<typeof AddCollectionMemberRequestSchema>;
|
|
1837
|
-
export type ReplaceCollectionMembersRequest = z.infer<typeof ReplaceCollectionMembersRequestSchema>;
|
|
1838
|
-
export type ResolvedCollectionMember = z.infer<typeof ResolvedCollectionMemberSchema>;
|
|
1839
|
-
export type ReplaceCollectionMembersResponse = z.infer<
|
|
1840
|
-
typeof ReplaceCollectionMembersResponseSchema
|
|
1841
|
-
>;
|
|
1842
|
-
export type AddCollectionMemberResponse = z.infer<typeof AddCollectionMemberResponseSchema>;
|
|
1843
|
-
export type CollectionDailySummary = z.infer<typeof CollectionDailySummarySchema>;
|
|
1844
|
-
export type CollectionDailySummariesResponse = z.infer<
|
|
1845
|
-
typeof CollectionDailySummariesResponseSchema
|
|
1846
|
-
>;
|
|
1847
|
-
export type CollectionWeeklyDigestListItem = z.infer<typeof CollectionWeeklyDigestListItemSchema>;
|
|
1848
|
-
export type CollectionWeeklyDigestsResponse = z.infer<typeof CollectionWeeklyDigestsResponseSchema>;
|
|
1849
|
-
export type DigestCoveredRelease = z.infer<typeof DigestCoveredReleaseSchema>;
|
|
1850
|
-
export type DigestSection = z.infer<typeof DigestSectionSchema>;
|
|
1851
|
-
export type CollectionWeeklyDigestDetail = z.infer<typeof CollectionWeeklyDigestDetailSchema>;
|
|
1852
|
-
|
|
1853
|
-
// ── Releases (enriched) ──
|
|
1854
|
-
|
|
1855
|
-
/** Flat release shape returned by GET /v1/releases/:id with source metadata. */
|
|
1856
|
-
export interface ReleaseWithSource {
|
|
1857
|
-
id: string;
|
|
1858
|
-
sourceId: string;
|
|
1859
|
-
version: string | null;
|
|
1860
|
-
title: string;
|
|
1861
|
-
content: string;
|
|
1862
|
-
/** AI-generated summary (#852, renamed in #860). Nullable — most rows unpopulated. */
|
|
1863
|
-
summary: string | null;
|
|
1864
|
-
/** AI-generated headline (#852, renamed in #860). See {@link ReleaseDetail.titleGenerated}. */
|
|
1865
|
-
titleGenerated?: string | null;
|
|
1866
|
-
/** AI-generated smart-brevity headline (#852, renamed in #860). */
|
|
1867
|
-
titleShort?: string | null;
|
|
1868
|
-
/** AI-scored importance 1–5. See {@link ReleaseDetail.importance}. */
|
|
1869
|
-
importance?: number | null;
|
|
1870
|
-
url: string | null;
|
|
1871
|
-
contentHash: string | null;
|
|
1872
|
-
metadata: string | null;
|
|
1873
|
-
publishedAt: string | null;
|
|
1874
|
-
suppressed: boolean;
|
|
1875
|
-
suppressedReason: string | null;
|
|
1876
|
-
fetchedAt: string;
|
|
1877
|
-
sourceName: string | null;
|
|
1878
|
-
sourceSlug: string | null;
|
|
1879
|
-
}
|
|
1880
|
-
|
|
1881
|
-
export interface LatestRelease {
|
|
1882
|
-
id: string;
|
|
1883
|
-
title: string;
|
|
1884
|
-
version: string | null;
|
|
1885
|
-
publishedAt: string | null;
|
|
1886
|
-
sourceName: string;
|
|
1887
|
-
sourceSlug: string;
|
|
1888
|
-
/**
|
|
1889
|
-
* Source type (`github`/`scrape`/`feed`/`agent`/`appstore`/`video`). Lets the
|
|
1890
|
-
* live feed render the source-type icon for a freshly-arrived event. Additive —
|
|
1891
|
-
* older buffered events / pinned workers omit it.
|
|
1892
|
-
*/
|
|
1893
|
-
sourceType?: string;
|
|
1894
|
-
/**
|
|
1895
|
-
* Owning-org context, resolved at publish time so the live feed can render an
|
|
1896
|
-
* avatar + org name the instant an event arrives. Nested to match
|
|
1897
|
-
* {@link ReleaseDetail.org} and the build-event input. Additive/nullable:
|
|
1898
|
-
* absent for orphan sources or older buffered events. Avatar fallback chain:
|
|
1899
|
-
* `avatarUrl` → `github.com/<githubHandle>.png` → an initial.
|
|
1900
|
-
*/
|
|
1901
|
-
org?: {
|
|
1902
|
-
slug: string;
|
|
1903
|
-
name: string;
|
|
1904
|
-
avatarUrl: string | null;
|
|
1905
|
-
githubHandle: string | null;
|
|
1906
|
-
} | null;
|
|
1907
|
-
/** AI-generated summary (#852, renamed in #860). Nullable — most rows unpopulated. */
|
|
1908
|
-
summary: string | null;
|
|
1909
|
-
/** AI-generated headline (#852, renamed in #860). See {@link ReleaseDetail.titleGenerated}. */
|
|
1910
|
-
titleGenerated?: string | null;
|
|
1911
|
-
/** AI-generated smart-brevity headline (#852, renamed in #860). */
|
|
1912
|
-
titleShort?: string | null;
|
|
1913
|
-
/** AI-scored importance 1–5. See {@link ReleaseDetail.importance}. */
|
|
1914
|
-
importance?: number | null;
|
|
1915
|
-
media: MediaItem[];
|
|
1916
|
-
/**
|
|
1917
|
-
* Cached release-body size — `LENGTH(content)` and `countTokensSafe(content)`
|
|
1918
|
-
* snapshotted at ingest, so clients can advertise "this release is ~1.5K
|
|
1919
|
-
* tokens" without round-tripping the body. Both fields are optional and
|
|
1920
|
-
* nullable: pre-existing rows land null until the backfill script
|
|
1921
|
-
* populates them. See #958.
|
|
1922
|
-
*/
|
|
1923
|
-
contentChars?: number | null;
|
|
1924
|
-
contentTokens?: number | null;
|
|
1925
|
-
/**
|
|
1926
|
-
* Owning product, when the release's source is grouped under a product.
|
|
1927
|
-
* `null` / `undefined` when the source has no `product_id`. Additive — older
|
|
1928
|
-
* API responses omit this field; treat `undefined` as `null`. #1217.
|
|
1929
|
-
*/
|
|
1930
|
-
product?: { slug: string; name: string } | null;
|
|
1931
|
-
}
|
|
1932
|
-
|
|
1933
|
-
// ── Stats ──
|
|
1934
|
-
//
|
|
1935
|
-
// `Stats` (flat counts) lives near the top of this file alongside the other
|
|
1936
|
-
// shared schema-derived aliases. The richer summary shape is the combined
|
|
1937
|
-
// hybrid response served at `GET /v1/stats` — flat counts plus per-source
|
|
1938
|
-
// rollups.
|
|
1939
|
-
|
|
1940
|
-
export type StatsSourceActivity = z.infer<typeof StatsSourceActivitySchema>;
|
|
1941
|
-
export type StatsRecentActivity = z.infer<typeof StatsRecentActivitySchema>;
|
|
1942
|
-
export type StatsResponse = z.infer<typeof StatsResponseSchema>;
|
|
1943
|
-
/**
|
|
1944
|
-
* The richer subset of the `GET /v1/stats` response — period + totals +
|
|
1945
|
-
* sourceHealth + sourceActivity + recentActivity. The full wire shape
|
|
1946
|
-
* (`StatsResponse`) merges these fields with the flat back-compat `Stats`
|
|
1947
|
-
* counts.
|
|
1948
|
-
*/
|
|
1949
|
-
export type StatsSummary = Omit<StatsResponse, "orgs" | "sources" | "releases" | "products">;
|
|
1950
|
-
|
|
1951
|
-
// ── Feedback ──
|
|
1952
|
-
export type FeedbackType = z.infer<typeof FeedbackTypeSchema>;
|
|
1953
|
-
export type FeedbackStatus = z.infer<typeof FeedbackStatusSchema>;
|
|
1954
|
-
export type FeedbackItem = z.infer<typeof FeedbackItemSchema>;
|
|
1955
|
-
export type FeedbackListResponse = z.infer<typeof FeedbackListResponseSchema>;
|
|
1956
|
-
export type FeedbackUpdateBody = z.infer<typeof FeedbackUpdateBodySchema>;
|
|
1957
|
-
export type FeedbackDeleteResponse = z.infer<typeof FeedbackDeleteResponseSchema>;
|
|
1958
|
-
|
|
1959
|
-
// ── Classification analytics ──
|
|
1960
|
-
export type ClassificationSummary = z.infer<typeof ClassificationSummarySchema>;
|
|
1961
|
-
export type ClassificationRecentResponse = z.infer<typeof ClassificationRecentResponseSchema>;
|
|
1962
|
-
export type ClassificationRecentItem = z.infer<typeof ClassificationRecentItemSchema>;
|
|
1963
|
-
|
|
1964
|
-
export type SemanticAlertSummary = z.infer<typeof SemanticAlertSummarySchema>;
|
|
1965
|
-
|
|
1966
|
-
// ── Recommendations ──
|
|
1967
|
-
export type RecommendationNotifyAddedBody = z.infer<typeof RecommendationNotifyAddedBodySchema>;
|
|
1968
|
-
export type RecommendationNotifyAddedResult = z.infer<typeof RecommendationNotifyAddedResultSchema>;
|
|
1969
|
-
|
|
1970
|
-
// ── Fetch log ──
|
|
1971
|
-
|
|
1972
|
-
export interface FetchLogEntry {
|
|
1973
|
-
id: string;
|
|
1974
|
-
sourceName: string;
|
|
1975
|
-
sourceSlug: string;
|
|
1976
|
-
status: string;
|
|
1977
|
-
releasesFound: number;
|
|
1978
|
-
releasesInserted: number;
|
|
1979
|
-
durationMs: number | null;
|
|
1980
|
-
error: string | null;
|
|
1981
|
-
createdAt: string;
|
|
1982
|
-
}
|
|
1983
|
-
|
|
1984
|
-
/**
|
|
1985
|
-
* The managed-agent session currently fetching a source, surfaced read-side on
|
|
1986
|
-
* the fetch-log view so an operator/agent can tell "a fetch is in flight" from
|
|
1987
|
-
* "stuck/dead" without waiting for a terminal `fetch_log` row (#1360). Only
|
|
1988
|
-
* running, non-stale sessions are reported (the StatusHub DO drops sessions idle
|
|
1989
|
-
* past its staleness cutoff), so the presence of this object means a fetch is
|
|
1990
|
-
* live; `startedAt` says how long it has been running.
|
|
1991
|
-
*/
|
|
1992
|
-
export interface ActiveFetchSession {
|
|
1993
|
-
sessionId: string;
|
|
1994
|
-
/** Always `running` today — only running sessions are surfaced. */
|
|
1995
|
-
status: string;
|
|
1996
|
-
/** Session start, epoch ms. */
|
|
1997
|
-
startedAt: number;
|
|
1998
|
-
/** Last session activity, epoch ms. */
|
|
1999
|
-
lastUpdatedAt: number;
|
|
2000
|
-
}
|
|
2001
|
-
|
|
2002
|
-
// ── Usage ──
|
|
2003
|
-
|
|
2004
|
-
export interface UsageBreakdownRow {
|
|
2005
|
-
label: string | null;
|
|
2006
|
-
totalInput: number;
|
|
2007
|
-
totalOutput: number;
|
|
2008
|
-
count: number;
|
|
2009
|
-
}
|
|
2010
|
-
|
|
2011
|
-
export interface UsageStatsResponse {
|
|
2012
|
-
totals: { totalInput: number; totalOutput: number; count: number };
|
|
2013
|
-
byOperation: UsageBreakdownRow[];
|
|
2014
|
-
byModel: UsageBreakdownRow[];
|
|
2015
|
-
bySource: UsageBreakdownRow[];
|
|
2016
|
-
}
|
|
2017
|
-
|
|
2018
|
-
// ── Sessions ──
|
|
2019
|
-
|
|
2020
|
-
/**
|
|
2021
|
-
* Where the session error originated.
|
|
2022
|
-
* - `provider`: managed-agents service / Anthropic-side (e.g. unknown_error, model_overloaded, retries_exhausted)
|
|
2023
|
-
* - `us`: this codebase / our agent setup (e.g. parser failure, no tools called, timeout)
|
|
2024
|
-
*/
|
|
2025
|
-
export type SessionErrorSource = "provider" | "us";
|
|
2026
|
-
|
|
2027
|
-
export interface Session {
|
|
2028
|
-
sessionId: string;
|
|
2029
|
-
company: string;
|
|
2030
|
-
type: "onboard" | "update";
|
|
2031
|
-
/**
|
|
2032
|
-
* Sub-agent **role** label that ran this session — `"coordinator"` is the
|
|
2033
|
-
* parent orchestrator (typically Sonnet) when a multi-agent session
|
|
2034
|
-
* delegates, `"sonnet"` / `"haiku"` are direct single-agent runs.
|
|
2035
|
-
* `"deterministic"` marks the #1878/#1881 update path that skips the
|
|
2036
|
-
* Managed-Agents (Haiku) session entirely — no Anthropic session runs, so
|
|
2037
|
-
* it must never be reported as `"haiku"`. Surfaces on the detail GET.
|
|
2038
|
-
*
|
|
2039
|
-
* This is a logical role label, not the runtime model identifier. The
|
|
2040
|
-
* resolved Anthropic model string (e.g. `claude-sonnet-5-5`,
|
|
2041
|
-
* `claude-haiku-5-5`) lives on `usage.model` when the session reported
|
|
2042
|
-
* one — consult that field for the concrete model.
|
|
2043
|
-
*/
|
|
2044
|
-
agent?: "sonnet" | "haiku" | "coordinator" | "deterministic";
|
|
2045
|
-
/** Identifies the client that started this session (e.g. hostname). */
|
|
2046
|
-
runner?: string;
|
|
2047
|
-
/** Correlation ID for end-to-end tracing across CLI → API → managed agent. */
|
|
2048
|
-
correlationId?: string;
|
|
2049
|
-
/** Anthropic session ID for linking to console logs. */
|
|
2050
|
-
anthropicSessionId?: string;
|
|
2051
|
-
status: "running" | "complete" | "error" | "cancelled";
|
|
2052
|
-
step?: string;
|
|
2053
|
-
sourcesFound?: number;
|
|
2054
|
-
sourcesValidated?: number;
|
|
2055
|
-
totalSources?: number;
|
|
2056
|
-
sourcesFetched?: number;
|
|
2057
|
-
releasesFound?: number;
|
|
2058
|
-
releasesInserted?: number;
|
|
2059
|
-
currentAction?: string;
|
|
2060
|
-
startedAt: number;
|
|
2061
|
-
lastUpdatedAt: number;
|
|
2062
|
-
error?: string;
|
|
2063
|
-
/** Where the error originated. Absent on legacy sessions; treat as `"us"`. */
|
|
2064
|
-
errorSource?: SessionErrorSource;
|
|
2065
|
-
/** Provider error type (e.g. `unknown_error`, `model_overloaded_error`). */
|
|
2066
|
-
errorType?: string;
|
|
2067
|
-
/** Stop reason from the final `session.status_idle` event (e.g. `retries_exhausted`). */
|
|
2068
|
-
stopReason?: string;
|
|
2069
|
-
/** Number of provider `session.error` events observed before terminal. */
|
|
2070
|
-
retryCount?: number;
|
|
2071
|
-
/** Non-fatal warnings collected during the session. */
|
|
2072
|
-
warnings?: string[];
|
|
2073
|
-
/**
|
|
2074
|
-
* Token usage + estimated cost from the managed-agents session. `estimatedUsd`
|
|
2075
|
-
* is a snapshot of Anthropic list prices at session-completion time.
|
|
2076
|
-
*/
|
|
2077
|
-
usage?: {
|
|
2078
|
-
inputTokens?: number;
|
|
2079
|
-
outputTokens?: number;
|
|
2080
|
-
cacheWriteTokens?: number;
|
|
2081
|
-
cacheReadTokens?: number;
|
|
2082
|
-
model?: string;
|
|
2083
|
-
estimatedUsd?: number;
|
|
2084
|
-
};
|
|
2085
|
-
/**
|
|
2086
|
-
* Final agent-reported state for terminal `onboard` sessions — the JSON
|
|
2087
|
-
* blob the agent passed to its `releases_report_state` tool, plus an
|
|
2088
|
-
* `agentSessionId` field stitched in server-side. Empty on `update`
|
|
2089
|
-
* sessions and pre-report errors. Typed as `Record<string, unknown>`
|
|
2090
|
-
* because the shape is owned by the discovery system prompt and may
|
|
2091
|
-
* grow new fields without a wire bump; the keys produced today are:
|
|
2092
|
-
*
|
|
2093
|
-
* - `product` (`string`) — company name
|
|
2094
|
-
* - `domain` (`string | null`) — discovered domain
|
|
2095
|
-
* - `githubOrg` (`string | null`) — discovered GitHub org
|
|
2096
|
-
* - `startedAt`, `updatedAt` (ISO strings)
|
|
2097
|
-
* - `status` (e.g. `"awaiting_review"`)
|
|
2098
|
-
* - `sources` (`Array<{ url, type, slug, label, confidence,
|
|
2099
|
-
* validated, validationError?, releaseCount, releasesFetched,
|
|
2100
|
-
* fetched, contentDepth }>`)
|
|
2101
|
-
* - `agentSessionId` (`string`) — Anthropic session ID, useful for
|
|
2102
|
-
* cross-referencing console logs
|
|
2103
|
-
*/
|
|
2104
|
-
result?: Record<string, unknown>;
|
|
2105
|
-
activeSources?: string[];
|
|
2106
|
-
cancelRequested?: boolean;
|
|
2107
|
-
}
|
|
2108
|
-
|
|
2109
|
-
export type SessionListResponse = ListResponse<Session>;
|
|
2110
|
-
|
|
2111
|
-
// ── Admin URL Lists ──
|
|
2112
|
-
// `IgnoredUrlItem` is now the Zod-derived type exported in the Organizations
|
|
2113
|
-
// section. The hand-written interface below is removed to avoid a duplicate
|
|
2114
|
-
// identifier; callsites that imported it from here continue to work because
|
|
2115
|
-
// the Zod-derived alias has the same shape.
|
|
2116
|
-
|
|
2117
|
-
export interface BlockedUrlItem {
|
|
2118
|
-
id: string;
|
|
2119
|
-
pattern: string;
|
|
2120
|
-
type: "exact" | "domain";
|
|
2121
|
-
reason: string | null;
|
|
2122
|
-
createdAt: string;
|
|
2123
|
-
}
|
|
2124
|
-
|
|
2125
|
-
export type IgnoredUrlListResponse = ListResponse<IgnoredUrlItem>;
|
|
2126
|
-
export type BlockedUrlListResponse = ListResponse<BlockedUrlItem>;
|
|
2127
|
-
|
|
2128
|
-
// ── Embed (admin) ──
|
|
2129
|
-
|
|
2130
|
-
export interface EmbedBackfillResponse {
|
|
2131
|
-
processed: number;
|
|
2132
|
-
succeeded: number;
|
|
2133
|
-
failed: number;
|
|
2134
|
-
remaining: number;
|
|
2135
|
-
dryRun?: boolean;
|
|
2136
|
-
}
|
|
2137
|
-
|
|
2138
|
-
/**
|
|
2139
|
-
* Cascade-scope preview returned by `GET /v1/admin/orgs/:slug/dependents`.
|
|
2140
|
-
* Backs the confirmation prompt in CLI/web before a hard-delete on an org —
|
|
2141
|
-
* post-#690 Phase C, hard-deleting an org cascades into every source row
|
|
2142
|
-
* tied to it and every per-source dependent table listed below.
|
|
2143
|
-
*/
|
|
2144
|
-
export interface OrgDependentsResponse {
|
|
2145
|
-
org: { id: string; slug: string; name: string };
|
|
2146
|
-
counts: {
|
|
2147
|
-
sources: number;
|
|
2148
|
-
releases: number;
|
|
2149
|
-
fetchLog: number;
|
|
2150
|
-
sourceChangelogFiles: number;
|
|
2151
|
-
sourceChangelogChunks: number;
|
|
2152
|
-
releaseSummaries: number;
|
|
2153
|
-
mediaAssets: number;
|
|
2154
|
-
webhookSubscriptions: number;
|
|
2155
|
-
};
|
|
2156
|
-
}
|
|
2157
|
-
|
|
2158
|
-
export interface EmbedStatusResponse {
|
|
2159
|
-
releases: { total: number; embedded: number; unembedded: number };
|
|
2160
|
-
entities: {
|
|
2161
|
-
total: number;
|
|
2162
|
-
embedded: number;
|
|
2163
|
-
unembedded: number;
|
|
2164
|
-
breakdown: {
|
|
2165
|
-
org: { total: number; embedded: number; unembedded: number };
|
|
2166
|
-
product: { total: number; embedded: number; unembedded: number };
|
|
2167
|
-
source: { total: number; embedded: number; unembedded: number };
|
|
2168
|
-
};
|
|
2169
|
-
};
|
|
2170
|
-
chunks: { total: number; embedded: number; unembedded: number };
|
|
2171
|
-
}
|
|
2172
|
-
|
|
2173
|
-
// ── Evaluate (URL recommendation) ──
|
|
2174
|
-
|
|
2175
|
-
/**
|
|
2176
|
-
* Returned verbatim by GET /v1/evaluate. Lives in the public api-types package
|
|
2177
|
-
* so external consumers (CLI, third-party clients) can import the shape
|
|
2178
|
-
* without depending on worker-internal AI helpers.
|
|
2179
|
-
*/
|
|
2180
|
-
export interface EvaluationResult {
|
|
2181
|
-
recommendedMethod: "feed" | "github" | "markdown" | "scrape" | "crawl";
|
|
2182
|
-
recommendedUrl: string;
|
|
2183
|
-
feedUrl?: string;
|
|
2184
|
-
feedType?: "rss" | "atom" | "jsonfeed";
|
|
2185
|
-
githubRepo?: string;
|
|
2186
|
-
pageStructure: "single-page" | "index" | "unknown";
|
|
2187
|
-
alternatives: Array<{ url: string; method: string; note: string }>;
|
|
2188
|
-
confidence: "high" | "medium" | "low";
|
|
2189
|
-
provider?: string;
|
|
2190
|
-
notes?: string;
|
|
2191
|
-
}
|
|
2192
|
-
|
|
2193
|
-
/**
|
|
2194
|
-
* Identity returned by `GET /v1/tokens/me` — the caller introspecting its own
|
|
2195
|
-
* credential. `kind: "root"` is the static break-glass key (synthetic identity,
|
|
2196
|
-
* no DB row); `kind: "token"` is a DB-backed `relk_` token.
|
|
2197
|
-
*/
|
|
2198
|
-
export interface TokenIdentity {
|
|
2199
|
-
kind: "root" | "token";
|
|
2200
|
-
/** Display label; "root" for the static key, "local-dev" when no secret is bound. */
|
|
2201
|
-
name: string;
|
|
2202
|
-
/** e.g. ["read","write"] or ["*"] for root. */
|
|
2203
|
-
scopes: string[];
|
|
2204
|
-
principalType: "internal" | "agent" | "user";
|
|
2205
|
-
principalId?: string | null;
|
|
2206
|
-
/**
|
|
2207
|
-
* Stable internal principal id for consumption telemetry (#1719). Same value the
|
|
2208
|
-
* auth middleware attaches (`relk_` row id, `relu_${keyId}`, …) — never the raw
|
|
2209
|
-
* secret. Returned on self-introspection so MCP can distinguish `relu_` keys.
|
|
2210
|
-
*/
|
|
2211
|
-
tokenId?: string | null;
|
|
2212
|
-
/**
|
|
2213
|
-
* Owning user id for a user-scoped principal (`relu_` key) — the Better Auth
|
|
2214
|
-
* `apikey.referenceId`. Lets a consumer bucket all of an account's credentials
|
|
2215
|
-
* together. Null for the static root key and machine (`relk_`) tokens, which
|
|
2216
|
-
* have no owning user. Distinct from `principalId`, which carries an
|
|
2217
|
-
* agent/internal id for machine tokens. Used by the MCP worker to bucket
|
|
2218
|
-
* `relu_` keys per-account on the rate-limit account tier (#1729).
|
|
2219
|
-
*/
|
|
2220
|
-
userId?: string | null;
|
|
2221
|
-
expiresAt?: string | null;
|
|
2222
|
-
lastUsedAt?: string | null;
|
|
2223
|
-
}
|