@buildinternet/releases-api-types 0.59.0 → 0.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -6
- package/dist/api-types.d.ts +1168 -0
- package/dist/api-types.d.ts.map +1 -0
- package/dist/api-types.js +134 -0
- package/dist/schemas/account-profile.d.ts +29 -0
- package/dist/schemas/account-profile.d.ts.map +1 -0
- package/dist/schemas/account-profile.js +24 -0
- package/dist/schemas/ai-models.d.ts +67 -0
- package/dist/schemas/ai-models.d.ts.map +1 -0
- package/{src/schemas/ai-models.ts → dist/schemas/ai-models.js} +25 -31
- package/dist/schemas/api-keys.d.ts +71 -0
- package/dist/schemas/api-keys.d.ts.map +1 -0
- package/dist/schemas/api-keys.js +32 -0
- package/dist/schemas/classifications.d.ts +134 -0
- package/dist/schemas/classifications.d.ts.map +1 -0
- package/dist/schemas/classifications.js +96 -0
- package/dist/schemas/collections.d.ts +605 -0
- package/dist/schemas/collections.d.ts.map +1 -0
- package/dist/schemas/collections.js +320 -0
- package/dist/schemas/datasets.d.ts +34 -0
- package/dist/schemas/datasets.d.ts.map +1 -0
- package/dist/schemas/datasets.js +11 -0
- package/dist/schemas/errors.d.ts +43 -0
- package/dist/schemas/errors.d.ts.map +1 -0
- package/dist/schemas/errors.js +61 -0
- package/dist/schemas/feedback.d.ts +134 -0
- package/dist/schemas/feedback.d.ts.map +1 -0
- package/dist/schemas/feedback.js +76 -0
- package/dist/schemas/follows.d.ts +154 -0
- package/dist/schemas/follows.d.ts.map +1 -0
- package/dist/schemas/follows.js +42 -0
- package/dist/schemas/listing.d.ts +374 -0
- package/dist/schemas/listing.d.ts.map +1 -0
- package/dist/schemas/listing.js +175 -0
- package/dist/schemas/lookups.d.ts +285 -0
- package/dist/schemas/lookups.d.ts.map +1 -0
- package/{src/schemas/lookups.ts → dist/schemas/lookups.js} +67 -80
- package/dist/schemas/marketing-classifier.d.ts +32 -0
- package/dist/schemas/marketing-classifier.d.ts.map +1 -0
- package/{src/schemas/marketing-classifier.ts → dist/schemas/marketing-classifier.js} +14 -18
- package/dist/schemas/orgs.d.ts +950 -0
- package/dist/schemas/orgs.d.ts.map +1 -0
- package/dist/schemas/orgs.js +473 -0
- package/dist/schemas/overviews.d.ts +205 -0
- package/dist/schemas/overviews.d.ts.map +1 -0
- package/{src/schemas/overviews.ts → dist/schemas/overviews.js} +41 -54
- package/dist/schemas/products.d.ts +595 -0
- package/dist/schemas/products.d.ts.map +1 -0
- package/{src/schemas/products.ts → dist/schemas/products.js} +113 -136
- package/dist/schemas/publish-tokens.d.ts +55 -0
- package/dist/schemas/publish-tokens.d.ts.map +1 -0
- package/{src/schemas/publish-tokens.ts → dist/schemas/publish-tokens.js} +18 -29
- package/dist/schemas/recommendations.d.ts +52 -0
- package/dist/schemas/recommendations.d.ts.map +1 -0
- package/dist/schemas/recommendations.js +58 -0
- package/dist/schemas/related.d.ts +331 -0
- package/dist/schemas/related.d.ts.map +1 -0
- package/dist/schemas/related.js +115 -0
- package/dist/schemas/releases.d.ts +623 -0
- package/dist/schemas/releases.d.ts.map +1 -0
- package/dist/schemas/releases.js +414 -0
- package/dist/schemas/resolve.d.ts +259 -0
- package/dist/schemas/resolve.d.ts.map +1 -0
- package/{src/schemas/resolve.ts → dist/schemas/resolve.js} +2 -5
- package/dist/schemas/search.d.ts +475 -0
- package/dist/schemas/search.d.ts.map +1 -0
- package/dist/schemas/search.js +258 -0
- package/dist/schemas/semantic-alert-summary.d.ts +54 -0
- package/dist/schemas/semantic-alert-summary.d.ts.map +1 -0
- package/dist/schemas/semantic-alert-summary.js +57 -0
- package/dist/schemas/semantic-alerts.d.ts +41 -0
- package/dist/schemas/semantic-alerts.d.ts.map +1 -0
- package/dist/schemas/semantic-alerts.js +42 -0
- package/dist/schemas/shared.d.ts +247 -0
- package/dist/schemas/shared.d.ts.map +1 -0
- package/dist/schemas/shared.js +248 -0
- package/dist/schemas/site-notice.d.ts +35 -0
- package/dist/schemas/site-notice.d.ts.map +1 -0
- package/{src/schemas/site-notice.ts → dist/schemas/site-notice.js} +14 -18
- package/dist/schemas/sitemap.d.ts +97 -0
- package/dist/schemas/sitemap.d.ts.map +1 -0
- package/dist/schemas/sitemap.js +107 -0
- package/dist/schemas/sources.d.ts +1145 -0
- package/dist/schemas/sources.d.ts.map +1 -0
- package/dist/schemas/sources.js +645 -0
- package/dist/schemas/stats.d.ts +82 -0
- package/dist/schemas/stats.d.ts.map +1 -0
- package/dist/schemas/stats.js +59 -0
- package/dist/schemas/taxonomy.d.ts +344 -0
- package/dist/schemas/taxonomy.d.ts.map +1 -0
- package/{src/schemas/taxonomy.ts → dist/schemas/taxonomy.js} +47 -58
- package/dist/schemas/webhooks.d.ts +618 -0
- package/dist/schemas/webhooks.d.ts.map +1 -0
- package/dist/schemas/webhooks.js +191 -0
- package/dist/schemas/well-known.d.ts +302 -0
- package/dist/schemas/well-known.d.ts.map +1 -0
- package/dist/schemas/well-known.js +192 -0
- package/dist/schemas/workspace-integrations.d.ts +27 -0
- package/dist/schemas/workspace-integrations.d.ts.map +1 -0
- package/dist/schemas/workspace-integrations.js +22 -0
- package/package.json +16 -5
- package/src/api-types.ts +0 -2229
- package/src/schemas/account-profile.ts +0 -28
- package/src/schemas/ai-models.test.ts +0 -29
- package/src/schemas/classifications.ts +0 -109
- package/src/schemas/collections.ts +0 -346
- package/src/schemas/datasets.ts +0 -31
- package/src/schemas/errors.test.ts +0 -55
- package/src/schemas/errors.ts +0 -81
- package/src/schemas/feedback.ts +0 -56
- package/src/schemas/listing.ts +0 -226
- package/src/schemas/orgs.ts +0 -533
- package/src/schemas/recommendations.ts +0 -39
- package/src/schemas/related.ts +0 -126
- package/src/schemas/releases.ts +0 -449
- package/src/schemas/search.ts +0 -274
- package/src/schemas/semantic-alert-summary.ts +0 -65
- package/src/schemas/shared.notice.test.ts +0 -36
- package/src/schemas/shared.ts +0 -267
- package/src/schemas/site-notice.test.ts +0 -67
- package/src/schemas/sitemap.ts +0 -117
- package/src/schemas/sources.ts +0 -674
- package/src/schemas/stats.ts +0 -62
- package/src/schemas/well-known.test.ts +0 -264
- package/src/schemas/well-known.ts +0 -252
- package/src/schemas/workspace-integrations.ts +0 -26
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orgs.d.ts","sourceRoot":"","sources":["../../src/schemas/orgs.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { KIND_VALUES } from "@buildinternet/releases-core/kinds";
|
|
3
|
+
import { BREAKING_LEVELS } from "@buildinternet/releases-core/breaking";
|
|
4
|
+
import { AppStoreSourceInfoSchema, CategorySchema, ImportanceScoreSchema, ListResponseSchema, NoticeSchema, OrgStatusSchema, OverviewPageItemSchema, PaginationSchema, ReleaseItemSchema, ReleaseLocationItemSchema, VideoSourceInfoSchema, } from "./shared.js";
|
|
5
|
+
import { SourceListItemSchema } from "./sources.js";
|
|
6
|
+
import { ProductListItemSchema } from "./products.js";
|
|
7
|
+
import { CollectionListItemSchema } from "./collections.js";
|
|
8
|
+
export const OrgListItemSchema = z.object({
|
|
9
|
+
id: z.string(),
|
|
10
|
+
slug: z.string(),
|
|
11
|
+
name: z.string(),
|
|
12
|
+
domain: z.string().nullable(),
|
|
13
|
+
description: z.string().nullable(),
|
|
14
|
+
category: CategorySchema.nullable(),
|
|
15
|
+
avatarUrl: z.string().nullable(),
|
|
16
|
+
featured: z.boolean(),
|
|
17
|
+
/**
|
|
18
|
+
* Org tier (#1947). Optional for mid-deploy tolerance; absent ⇒ `"tracked"`.
|
|
19
|
+
* A `"stub"` org has no processed sources yet — the UI renders a badge and a
|
|
20
|
+
* stub is excluded from release-ranked surfaces.
|
|
21
|
+
*/
|
|
22
|
+
status: OrgStatusSchema.optional(),
|
|
23
|
+
sourceCount: z.number().int().min(0),
|
|
24
|
+
releaseCount: z.number().int().min(0),
|
|
25
|
+
recentReleaseCount: z.number().int().min(0),
|
|
26
|
+
lastActivity: z.string().nullable(),
|
|
27
|
+
topProducts: z.array(z.string()),
|
|
28
|
+
/**
|
|
29
|
+
* Org-level alternate domains (`domain_aliases`, product-scoped aliases
|
|
30
|
+
* excluded), sorted. Surfaced next to the primary `domain` in catalog rows so
|
|
31
|
+
* a self-declared name reads against every domain the org actually controls.
|
|
32
|
+
* Optional for mid-deploy tolerance; absent ⇒ treat as none.
|
|
33
|
+
*/
|
|
34
|
+
aliasDomains: z.array(z.string()).optional(),
|
|
35
|
+
sparkline: z.array(z.number().int().min(0)).length(30),
|
|
36
|
+
/**
|
|
37
|
+
* Additive, admin-only field (#1947). Only populated on the
|
|
38
|
+
* `GET /v1/orgs?trackingRequested=1` demand-queue projection — absent on
|
|
39
|
+
* the public catalog listing.
|
|
40
|
+
*/
|
|
41
|
+
trackingRequestedAt: z.string().nullable().optional(),
|
|
42
|
+
});
|
|
43
|
+
/**
|
|
44
|
+
* Per-request side-channel for the orgs list (#746). `emptyOrgCount` is the
|
|
45
|
+
* number of orgs that match the same `q` filter but have zero indexed
|
|
46
|
+
* releases — used to label a "Show empty orgs" toggle without a second
|
|
47
|
+
* round-trip. The value is scoped by the search term but independent of
|
|
48
|
+
* `?includeEmpty=` so the toggle CTA can render a count whether the current
|
|
49
|
+
* response included empty orgs or not.
|
|
50
|
+
*/
|
|
51
|
+
export const OrgListMetaSchema = z.object({
|
|
52
|
+
emptyOrgCount: z.number().int().min(0),
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* `meta` is optional on the wire so older workers / pinned clients mid-deploy
|
|
56
|
+
* don't trip the schema check. New clients can treat missing as
|
|
57
|
+
* `emptyOrgCount: 0` (the toggle just won't render a count).
|
|
58
|
+
*/
|
|
59
|
+
export const OrgListResponseSchema = z.object({
|
|
60
|
+
items: z.array(OrgListItemSchema),
|
|
61
|
+
pagination: PaginationSchema,
|
|
62
|
+
meta: OrgListMetaSchema.optional(),
|
|
63
|
+
});
|
|
64
|
+
export const OrgAccountItemSchema = z.object({
|
|
65
|
+
platform: z.string(),
|
|
66
|
+
handle: z.string(),
|
|
67
|
+
});
|
|
68
|
+
export const OrgAccountsListResponseSchema = ListResponseSchema(OrgAccountItemSchema);
|
|
69
|
+
/**
|
|
70
|
+
* Response shape for `GET /v1/orgs/:slug/accounts`. Returns the paginated list
|
|
71
|
+
* by default; with `?platform=<name>` returns a single matching account or
|
|
72
|
+
* `null` when no row matches. The dual shape is preserved for compatibility
|
|
73
|
+
* with the OSS CLI which calls `?platform=` and expects a single row.
|
|
74
|
+
*/
|
|
75
|
+
export const OrgAccountsResponseSchema = z.union([
|
|
76
|
+
OrgAccountsListResponseSchema,
|
|
77
|
+
OrgAccountItemSchema,
|
|
78
|
+
z.null(),
|
|
79
|
+
]);
|
|
80
|
+
export const OrgTagsResponseSchema = ListResponseSchema(z.string());
|
|
81
|
+
/**
|
|
82
|
+
* Body accepted by `POST /v1/orgs`. `category` is a non-empty string at the
|
|
83
|
+
* wire boundary so callers can pass either a canonical slug or one of its
|
|
84
|
+
* configured aliases (resolved server-side via `resolveCategoryInput`).
|
|
85
|
+
* Responses always carry the canonical slug. Empty strings are rejected so
|
|
86
|
+
* the truthy-guard around `resolveCategoryInput` in the handler can't be
|
|
87
|
+
* bypassed into persisting an invalid `""` value.
|
|
88
|
+
*/
|
|
89
|
+
export const CreateOrgBodySchema = z.object({
|
|
90
|
+
name: z.string().min(1),
|
|
91
|
+
slug: z.string().optional(),
|
|
92
|
+
domain: z.string().optional(),
|
|
93
|
+
description: z.string().optional(),
|
|
94
|
+
category: z.string().min(1).optional(),
|
|
95
|
+
tags: z.array(z.string()).optional(),
|
|
96
|
+
/**
|
|
97
|
+
* Admin-only: opt the new org into automatic AI content (overviews +
|
|
98
|
+
* per-release summaries). Omitted → defaults to `true` server-side, since
|
|
99
|
+
* `POST /v1/orgs` only ever mints `curated` orgs and onboarding into the
|
|
100
|
+
* registry should mean it gets overviews. Pass `false` for a deliberate
|
|
101
|
+
* opt-out (#1795).
|
|
102
|
+
*/
|
|
103
|
+
autoGenerateContent: z.boolean().optional(),
|
|
104
|
+
});
|
|
105
|
+
/**
|
|
106
|
+
* Body accepted by `PATCH /v1/orgs/:slug`. Same alias-allowed string rule
|
|
107
|
+
* as create, plus `null` to explicitly clear the overlay. Empty strings
|
|
108
|
+
* stay rejected so callers must pick between a slug/alias or `null`.
|
|
109
|
+
*/
|
|
110
|
+
export const UpdateOrgBodySchema = z.object({
|
|
111
|
+
name: z.string().optional(),
|
|
112
|
+
slug: z.string().optional(),
|
|
113
|
+
domain: z.string().nullable().optional(),
|
|
114
|
+
description: z.string().nullable().optional(),
|
|
115
|
+
category: z.string().min(1).nullable().optional(),
|
|
116
|
+
avatarUrl: z.string().nullable().optional(),
|
|
117
|
+
tags: z.array(z.string()).optional(),
|
|
118
|
+
aliases: z.array(z.string()).optional(),
|
|
119
|
+
/** Admin-only: pause/unpause all ingest for this org without touching sources (#1057). */
|
|
120
|
+
fetchPaused: z.boolean().optional(),
|
|
121
|
+
/** Admin-only: hide the org from the homepage ticker + /v1/orgs directory. Stays reachable via detail, search, sitemap. */
|
|
122
|
+
isHidden: z.boolean().optional(),
|
|
123
|
+
/** Admin-only: opt the org into automatic AI content — org overviews AND per-release summaries (single backend flag `auto_generate_content`). */
|
|
124
|
+
autoGenerateContent: z.boolean().optional(),
|
|
125
|
+
/**
|
|
126
|
+
* Admin-only: manual override for the automated overview-regen cadence in
|
|
127
|
+
* days (#1895). `null` clears back to automatic (velocity-tiered: 7d
|
|
128
|
+
* default, 2d at high release velocity). A set value pins the cadence in
|
|
129
|
+
* either direction — faster for a hot org, slower for a bursty one.
|
|
130
|
+
*/
|
|
131
|
+
overviewCadenceDays: z.number().int().min(1).max(90).nullable().optional(),
|
|
132
|
+
/** Admin-only: promote this org on the home-page featured rail. */
|
|
133
|
+
featured: z.boolean().optional(),
|
|
134
|
+
/** Admin-only: promote or demote the org's discovery status (curated/agent/on_demand). */
|
|
135
|
+
discovery: z.enum(["curated", "agent", "on_demand"]).optional(),
|
|
136
|
+
notice: NoticeSchema.nullable().optional(),
|
|
137
|
+
});
|
|
138
|
+
/** Body for `POST /v1/orgs/:slug/avatar` — the remote image to mirror to R2 (#1406). */
|
|
139
|
+
export const SetOrgAvatarBodySchema = z.object({
|
|
140
|
+
sourceUrl: z.url(),
|
|
141
|
+
});
|
|
142
|
+
/** Response for `POST /v1/orgs/:slug/avatar` — the mirrored avatar's public URL + dims. */
|
|
143
|
+
export const SetOrgAvatarResponseSchema = z.object({
|
|
144
|
+
avatarUrl: z.string(),
|
|
145
|
+
key: z.string(),
|
|
146
|
+
width: z.number(),
|
|
147
|
+
height: z.number(),
|
|
148
|
+
});
|
|
149
|
+
// Org detail's products query selects a strict subset of `ProductListItem` —
|
|
150
|
+
// no category/orgId because the parent already names the org; createdAt is
|
|
151
|
+
// included for age-based filtering by consumers.
|
|
152
|
+
const OrgDetailProductSchema = ProductListItemSchema.pick({
|
|
153
|
+
id: true,
|
|
154
|
+
slug: true,
|
|
155
|
+
name: true,
|
|
156
|
+
url: true,
|
|
157
|
+
description: true,
|
|
158
|
+
sourceCount: true,
|
|
159
|
+
kind: true,
|
|
160
|
+
createdAt: true,
|
|
161
|
+
}).extend({
|
|
162
|
+
releaseCount: z.number().int().min(0),
|
|
163
|
+
});
|
|
164
|
+
const OrgDetailPlaybookSchema = z.object({
|
|
165
|
+
scope: z.literal("playbook"),
|
|
166
|
+
content: z.string(),
|
|
167
|
+
updatedAt: z.string(),
|
|
168
|
+
});
|
|
169
|
+
// ── Org catalog (/orgs/:slug/catalog) ──
|
|
170
|
+
const OrgCatalogProductItemSchema = z.object({
|
|
171
|
+
entryType: z.literal("product"),
|
|
172
|
+
kind: z.enum(KIND_VALUES).nullable().optional(),
|
|
173
|
+
id: z.string(),
|
|
174
|
+
slug: z.string(),
|
|
175
|
+
name: z.string(),
|
|
176
|
+
url: z.string().nullable(),
|
|
177
|
+
description: z.string().nullable(),
|
|
178
|
+
category: CategorySchema.nullable(),
|
|
179
|
+
});
|
|
180
|
+
const OrgCatalogSourceItemSchema = z.object({
|
|
181
|
+
entryType: z.literal("source"),
|
|
182
|
+
kind: z.enum(KIND_VALUES).nullable().optional(),
|
|
183
|
+
id: z.string(),
|
|
184
|
+
slug: z.string(),
|
|
185
|
+
name: z.string(),
|
|
186
|
+
type: z.string(),
|
|
187
|
+
url: z.string(),
|
|
188
|
+
productId: z.string().nullable(),
|
|
189
|
+
});
|
|
190
|
+
/**
|
|
191
|
+
* Combined product + source catalog for `GET /v1/orgs/:slug/catalog`.
|
|
192
|
+
* `entryType` discriminates between the two row shapes (`"product"` vs
|
|
193
|
+
* `"source"`). `kind` carries the entity taxonomy (platform/sdk/mobile/…).
|
|
194
|
+
* Products carry `category` and `description`; sources carry `type` and
|
|
195
|
+
* `productId`.
|
|
196
|
+
*/
|
|
197
|
+
export const OrgCatalogItemSchema = z.discriminatedUnion("entryType", [
|
|
198
|
+
OrgCatalogProductItemSchema,
|
|
199
|
+
OrgCatalogSourceItemSchema,
|
|
200
|
+
]);
|
|
201
|
+
export const OrgCatalogResponseSchema = z.object({
|
|
202
|
+
org: z.object({ id: z.string(), slug: z.string(), name: z.string() }),
|
|
203
|
+
items: z.array(OrgCatalogItemSchema),
|
|
204
|
+
});
|
|
205
|
+
// ── Org collections membership (/orgs/:slug/collections) ──
|
|
206
|
+
/**
|
|
207
|
+
* List of collections the org belongs to, returned by
|
|
208
|
+
* `GET /v1/orgs/:slug/collections`. Each item follows the same shape as
|
|
209
|
+
* `CollectionListItem` on `GET /v1/collections` — `previewMembers` is
|
|
210
|
+
* omitted here because the context (one org's collections) makes inline
|
|
211
|
+
* member previews redundant.
|
|
212
|
+
*/
|
|
213
|
+
export const OrgCollectionsResponseSchema = z.array(CollectionListItemSchema);
|
|
214
|
+
// ── Org accounts (/orgs/:slug/accounts) ──
|
|
215
|
+
/**
|
|
216
|
+
* Body accepted by `POST /v1/orgs/:slug/accounts`.
|
|
217
|
+
* Both `platform` and `handle` are required.
|
|
218
|
+
*/
|
|
219
|
+
export const AddOrgAccountBodySchema = z.object({
|
|
220
|
+
platform: z.string().min(1),
|
|
221
|
+
handle: z.string().min(1),
|
|
222
|
+
});
|
|
223
|
+
// ── Org ignored URLs (/orgs/:slug/ignored-urls) ──
|
|
224
|
+
export const IgnoredUrlItemSchema = z.object({
|
|
225
|
+
id: z.string(),
|
|
226
|
+
url: z.string(),
|
|
227
|
+
orgId: z.string(),
|
|
228
|
+
reason: z.string().nullable(),
|
|
229
|
+
ignoredAt: z.string(),
|
|
230
|
+
});
|
|
231
|
+
export const OrgIgnoredUrlsListResponseSchema = ListResponseSchema(IgnoredUrlItemSchema);
|
|
232
|
+
/**
|
|
233
|
+
* Response shape for `GET /v1/orgs/:slug/ignored-urls`. Returns the paginated
|
|
234
|
+
* list by default; with `?url=<encoded>&single=1` returns the matching single
|
|
235
|
+
* row or `null` when not present.
|
|
236
|
+
*/
|
|
237
|
+
export const OrgIgnoredUrlsResponseSchema = z.union([
|
|
238
|
+
OrgIgnoredUrlsListResponseSchema,
|
|
239
|
+
IgnoredUrlItemSchema,
|
|
240
|
+
z.null(),
|
|
241
|
+
]);
|
|
242
|
+
/**
|
|
243
|
+
* Body accepted by `POST /v1/orgs/:slug/ignored-urls`.
|
|
244
|
+
* `reason` is optional.
|
|
245
|
+
*/
|
|
246
|
+
export const AddIgnoredUrlBodySchema = z.object({
|
|
247
|
+
url: z.string().min(1),
|
|
248
|
+
reason: z.string().optional(),
|
|
249
|
+
});
|
|
250
|
+
/** Response shape for `POST /v1/orgs/:slug/ignored-urls`. */
|
|
251
|
+
export const AddIgnoredUrlResponseSchema = z.object({
|
|
252
|
+
ignored: z.literal(true),
|
|
253
|
+
});
|
|
254
|
+
/** Response shape for `DELETE /v1/orgs/:slug/ignored-urls/:url`. */
|
|
255
|
+
export const DeleteIgnoredUrlResponseSchema = z.object({
|
|
256
|
+
deleted: z.literal(true),
|
|
257
|
+
});
|
|
258
|
+
// ── Org tags (/orgs/:slug/tags and PUT /DELETE) ──
|
|
259
|
+
/** Body accepted by `PUT` and `DELETE` `/v1/orgs/:slug/tags`. */
|
|
260
|
+
export const OrgTagsBodySchema = z.object({
|
|
261
|
+
tags: z.array(z.string()),
|
|
262
|
+
});
|
|
263
|
+
/** Response shape returned by `PUT` and `DELETE` `/v1/orgs/:slug/tags`. */
|
|
264
|
+
export const OrgTagsMutationResponseSchema = z.object({
|
|
265
|
+
ok: z.literal(true),
|
|
266
|
+
});
|
|
267
|
+
// ── POST /tags (global tag creation) ──
|
|
268
|
+
/** Body accepted by `POST /v1/tags`. */
|
|
269
|
+
export const CreateTagBodySchema = z.object({
|
|
270
|
+
name: z.string().min(1),
|
|
271
|
+
});
|
|
272
|
+
/** Row returned by `POST /v1/tags` (201 on create, 200 if already exists). */
|
|
273
|
+
export const TagRowSchema = z.object({
|
|
274
|
+
id: z.string(),
|
|
275
|
+
name: z.string(),
|
|
276
|
+
slug: z.string(),
|
|
277
|
+
createdAt: z.string(),
|
|
278
|
+
});
|
|
279
|
+
// ── Org activity (/orgs/:slug/activity) ──
|
|
280
|
+
const OrgActivityWeeklyBucketSchema = z.object({
|
|
281
|
+
weekStart: z.string(),
|
|
282
|
+
count: z.number().int().min(0),
|
|
283
|
+
earliestVersion: z.string().nullable(),
|
|
284
|
+
latestVersion: z.string().nullable(),
|
|
285
|
+
});
|
|
286
|
+
const OrgActivitySourceSchema = z.object({
|
|
287
|
+
slug: z.string(),
|
|
288
|
+
name: z.string(),
|
|
289
|
+
releaseCount: z.number().int().min(0),
|
|
290
|
+
avgReleasesPerWeek: z.number(),
|
|
291
|
+
earliestVersion: z.string().nullable(),
|
|
292
|
+
latestVersion: z.string().nullable(),
|
|
293
|
+
latestDate: z.string().nullable(),
|
|
294
|
+
weeklyBuckets: z.array(OrgActivityWeeklyBucketSchema),
|
|
295
|
+
});
|
|
296
|
+
/**
|
|
297
|
+
* Response shape for `GET /v1/orgs/:slug/activity`. Returns per-source
|
|
298
|
+
* weekly release buckets plus an aggregate rollup — used for timeline
|
|
299
|
+
* visualization in the web org detail page.
|
|
300
|
+
*/
|
|
301
|
+
export const OrgActivityResponseSchema = z.object({
|
|
302
|
+
org: z.object({ slug: z.string(), name: z.string() }),
|
|
303
|
+
range: z.object({ from: z.string(), to: z.string() }),
|
|
304
|
+
sources: z.array(OrgActivitySourceSchema),
|
|
305
|
+
aggregateWeekly: z.array(z.object({ weekStart: z.string(), count: z.number().int().min(0) })),
|
|
306
|
+
});
|
|
307
|
+
// ── Org heatmap (/orgs/:slug/heatmap) ──
|
|
308
|
+
/**
|
|
309
|
+
* Response shape for `GET /v1/orgs/:slug/heatmap`. Returns daily release
|
|
310
|
+
* counts for the trailing 365 days — used for contribution-graph
|
|
311
|
+
* visualization in the web org detail page.
|
|
312
|
+
*/
|
|
313
|
+
export const OrgHeatmapResponseSchema = z.object({
|
|
314
|
+
org: z.object({ slug: z.string(), name: z.string() }),
|
|
315
|
+
range: z.object({ from: z.string(), to: z.string() }),
|
|
316
|
+
dailyCounts: z.array(z.object({ date: z.string(), count: z.number().int().min(0) })),
|
|
317
|
+
total: z.number().int().min(0),
|
|
318
|
+
});
|
|
319
|
+
// ── Org sparklines (/orgs/:slug/sparklines) ──
|
|
320
|
+
const SparklineSourceSchema = z.object({
|
|
321
|
+
slug: z.string(),
|
|
322
|
+
name: z.string(),
|
|
323
|
+
sparkline: z.array(z.number().int().min(0)).length(30),
|
|
324
|
+
});
|
|
325
|
+
/**
|
|
326
|
+
* Response shape for `GET /v1/orgs/:slug/sparklines`. Returns 30-day daily
|
|
327
|
+
* release counts per source and per product, plus an aggregate rollup.
|
|
328
|
+
*/
|
|
329
|
+
export const OrgSparklinesResponseSchema = z.object({
|
|
330
|
+
org: z.object({ slug: z.string(), name: z.string() }),
|
|
331
|
+
range: z.object({ from: z.string(), to: z.string() }),
|
|
332
|
+
aggregate: z.array(z.number().int().min(0)).length(30),
|
|
333
|
+
sources: z.array(SparklineSourceSchema),
|
|
334
|
+
products: z.array(SparklineSourceSchema),
|
|
335
|
+
});
|
|
336
|
+
// ── Org releases feed (/orgs/:slug/releases) ──
|
|
337
|
+
/**
|
|
338
|
+
* Release feed item on `GET /v1/orgs/:slug/releases`. Extends `ReleaseItem`
|
|
339
|
+
* with a `source` block identifying the originating source within the org.
|
|
340
|
+
* `id` is always present here, unlike the shared `ReleaseItem`.
|
|
341
|
+
*/
|
|
342
|
+
export const OrgReleaseItemSchema = ReleaseItemSchema.extend({
|
|
343
|
+
id: z.string(),
|
|
344
|
+
source: z.object({
|
|
345
|
+
slug: z.string(),
|
|
346
|
+
name: z.string(),
|
|
347
|
+
type: z.string(),
|
|
348
|
+
appStore: AppStoreSourceInfoSchema.optional(),
|
|
349
|
+
video: VideoSourceInfoSchema.optional(),
|
|
350
|
+
}),
|
|
351
|
+
/**
|
|
352
|
+
* Owning product, when the release's source is grouped under a product.
|
|
353
|
+
* `null` when the source has no `product_id`. Additive — older API responses
|
|
354
|
+
* omit this field; treat `undefined` as `null`. #1217.
|
|
355
|
+
*/
|
|
356
|
+
product: z.object({ slug: z.string(), name: z.string() }).nullable().optional(),
|
|
357
|
+
/**
|
|
358
|
+
* Server-resolved grouping identity — `COALESCE(product.slug, source.slug)` /
|
|
359
|
+
* `COALESCE(product.name, source.name)`. The web releases feed keys and labels
|
|
360
|
+
* SDK/package-cluster rollups on these instead of reconstructing
|
|
361
|
+
* `product ?? source` client-side. Optional on the wire: older workers omit
|
|
362
|
+
* them, so clients must fall back to deriving from `product ?? source`. Never
|
|
363
|
+
* null when present (`source` is always set). #1234
|
|
364
|
+
*/
|
|
365
|
+
groupSlug: z.string().optional(),
|
|
366
|
+
groupName: z.string().optional(),
|
|
367
|
+
});
|
|
368
|
+
/** Cursor pagination shape for the org releases feed. */
|
|
369
|
+
export const OrgFeedPaginationSchema = z.object({
|
|
370
|
+
nextCursor: z.string().nullable(),
|
|
371
|
+
limit: z.number().int().min(1),
|
|
372
|
+
});
|
|
373
|
+
/**
|
|
374
|
+
* Response shape for `GET /v1/orgs/:slug/releases`.
|
|
375
|
+
* Cursor-paginated; `nextCursor` is `null` when this is the last page.
|
|
376
|
+
*/
|
|
377
|
+
export const OrgReleasesFeedResponseSchema = z.object({
|
|
378
|
+
releases: z.array(OrgReleaseItemSchema),
|
|
379
|
+
pagination: OrgFeedPaginationSchema,
|
|
380
|
+
});
|
|
381
|
+
// ── Org recent releases (/orgs/:slug/recent-releases) ──
|
|
382
|
+
/**
|
|
383
|
+
* Row returned by `GET /v1/orgs/:slug/recent-releases`. This is the full
|
|
384
|
+
* `releasesVisible` row with `sourceName` and `sourceSlug` joined from
|
|
385
|
+
* `sourcesVisible` — intended for summarization / grouping by agents.
|
|
386
|
+
* Many fields are nullable because they may not be populated at ingest time.
|
|
387
|
+
*/
|
|
388
|
+
export const OrgRecentReleaseItemSchema = z.object({
|
|
389
|
+
id: z.string(),
|
|
390
|
+
sourceId: z.string(),
|
|
391
|
+
version: z.string().nullable(),
|
|
392
|
+
type: z.string().optional(),
|
|
393
|
+
title: z.string(),
|
|
394
|
+
content: z.string(),
|
|
395
|
+
summary: z.string().nullable(),
|
|
396
|
+
titleGenerated: z.string().nullable().optional(),
|
|
397
|
+
titleShort: z.string().nullable().optional(),
|
|
398
|
+
/**
|
|
399
|
+
* Machine-readable breaking-change level (#1696, surfaced on read paths in
|
|
400
|
+
* #1710). `.optional()` for mid-deploy tolerance; absent or `"unknown"`
|
|
401
|
+
* means not classified. List paths carry `breaking` only.
|
|
402
|
+
*/
|
|
403
|
+
breaking: z.enum(BREAKING_LEVELS).optional(),
|
|
404
|
+
importance: ImportanceScoreSchema,
|
|
405
|
+
url: z.string().nullable(),
|
|
406
|
+
contentHash: z.string().nullable(),
|
|
407
|
+
metadata: z.string().nullable(),
|
|
408
|
+
media: z.string().nullable(),
|
|
409
|
+
publishedAt: z.string().nullable(),
|
|
410
|
+
suppressed: z.number().optional(),
|
|
411
|
+
suppressedReason: z.string().nullable().optional(),
|
|
412
|
+
fetchedAt: z.string().optional(),
|
|
413
|
+
embeddedAt: z.string().nullable().optional(),
|
|
414
|
+
sourceName: z.string(),
|
|
415
|
+
sourceSlug: z.string(),
|
|
416
|
+
});
|
|
417
|
+
export const OrgRecentReleasesResponseSchema = z.array(OrgRecentReleaseItemSchema);
|
|
418
|
+
// ── Org accounts mutation responses ──
|
|
419
|
+
/** Response returned by `DELETE /v1/orgs/:slug/accounts/:platform/:handle`. */
|
|
420
|
+
export const DeleteOrgAccountResponseSchema = z.object({
|
|
421
|
+
deleted: z.literal(true),
|
|
422
|
+
});
|
|
423
|
+
export const OrgDetailSchema = z.object({
|
|
424
|
+
id: z.string(),
|
|
425
|
+
slug: z.string(),
|
|
426
|
+
name: z.string(),
|
|
427
|
+
domain: z.string().nullable(),
|
|
428
|
+
description: z.string().nullable().optional(),
|
|
429
|
+
category: CategorySchema.nullable().optional(),
|
|
430
|
+
avatarUrl: z.string().nullable(),
|
|
431
|
+
/** Admin display flag: true when the org is hidden from listings (homepage + /v1/orgs). Optional on the wire for older workers mid-deploy. */
|
|
432
|
+
isHidden: z.boolean().optional(),
|
|
433
|
+
/** Admin display flag: org is opted into automatic overviews + per-release summaries. Optional on the wire for older workers mid-deploy. */
|
|
434
|
+
autoGenerateContent: z.boolean().optional(),
|
|
435
|
+
/** Manual overview-regen cadence override in days (#1895); null = automatic velocity tier. Optional on the wire for older workers mid-deploy. */
|
|
436
|
+
overviewCadenceDays: z.number().int().nullable().optional(),
|
|
437
|
+
/** Admin display flag: org is promoted on the home-page featured rail. Optional on the wire for older workers mid-deploy. */
|
|
438
|
+
featured: z.boolean().optional(),
|
|
439
|
+
/** Admin display flag: all ingest paused for this org. */
|
|
440
|
+
fetchPaused: z.boolean().optional(),
|
|
441
|
+
/** How the org row was created. `on_demand` orgs are excluded from overview generation regardless of `autoGenerateContent`. */
|
|
442
|
+
discovery: z.enum(["curated", "agent", "on_demand"]).optional(),
|
|
443
|
+
/**
|
|
444
|
+
* Org tier (#1947). Optional for mid-deploy tolerance; absent ⇒ `"tracked"`.
|
|
445
|
+
* A `"stub"` org's `sources` array is empty — `locations` carries the declared
|
|
446
|
+
* release locations instead.
|
|
447
|
+
*/
|
|
448
|
+
status: OrgStatusSchema.optional(),
|
|
449
|
+
/**
|
|
450
|
+
* Declared release locations (#1947), present (and non-empty) for stub orgs.
|
|
451
|
+
* Same shape as a releases.json `releases[]` entry plus `basis`/`sourceId`.
|
|
452
|
+
* Omitted or empty for a tracked org with no locators.
|
|
453
|
+
*/
|
|
454
|
+
locations: z.array(ReleaseLocationItemSchema).optional(),
|
|
455
|
+
tags: z.array(z.string()).optional(),
|
|
456
|
+
sourceCount: z.number().int().min(0),
|
|
457
|
+
releaseCount: z.number().int().min(0),
|
|
458
|
+
releasesLast30Days: z.number().int().min(0),
|
|
459
|
+
avgReleasesPerWeek: z.number(),
|
|
460
|
+
lastFetchedAt: z.string().nullable(),
|
|
461
|
+
lastPolledAt: z.string().nullable(),
|
|
462
|
+
trackingSince: z.string(),
|
|
463
|
+
/** Row timestamps. Optional for older servers. */
|
|
464
|
+
createdAt: z.string().optional(),
|
|
465
|
+
updatedAt: z.string().optional(),
|
|
466
|
+
aliases: z.array(z.string()).optional(),
|
|
467
|
+
accounts: z.array(OrgAccountItemSchema),
|
|
468
|
+
products: z.array(OrgDetailProductSchema),
|
|
469
|
+
sources: z.array(SourceListItemSchema),
|
|
470
|
+
overview: OverviewPageItemSchema.nullable().optional(),
|
|
471
|
+
playbook: OrgDetailPlaybookSchema.nullable().optional(),
|
|
472
|
+
notice: NoticeSchema.nullable().optional(),
|
|
473
|
+
});
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Response shape returned by `GET /v1/orgs/:slug/overview` — the org-scoped
|
|
4
|
+
* knowledge page with inline citations, or `null` when no overview has been
|
|
5
|
+
* generated yet.
|
|
6
|
+
*/
|
|
7
|
+
export declare const OrgOverviewResponseSchema: z.ZodNullable<z.ZodObject<{
|
|
8
|
+
scope: z.ZodEnum<{
|
|
9
|
+
org: "org";
|
|
10
|
+
product: "product";
|
|
11
|
+
}>;
|
|
12
|
+
orgSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13
|
+
productSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
14
|
+
content: z.ZodString;
|
|
15
|
+
releaseCount: z.ZodNumber;
|
|
16
|
+
lastContributingReleaseAt: z.ZodNullable<z.ZodString>;
|
|
17
|
+
generatedAt: z.ZodString;
|
|
18
|
+
updatedAt: z.ZodString;
|
|
19
|
+
citations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
20
|
+
sourceUrl: z.ZodString;
|
|
21
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
|
+
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
23
|
+
releaseWebUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
24
|
+
startIndex: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
endIndex: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
citedText: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strip>>>;
|
|
28
|
+
}, z.core.$strip>>;
|
|
29
|
+
/**
|
|
30
|
+
* Incoming citation row attached to `POST /v1/orgs/:slug/overview`. A source the
|
|
31
|
+
* overview drew on — just `sourceUrl` (+ optional display `title`); `releaseId`
|
|
32
|
+
* is resolved server-side from `sourceUrl`. The legacy body-offset fields
|
|
33
|
+
* (`startIndex`/`endIndex`/`citedText`) are accepted-but-ignored for wire
|
|
34
|
+
* back-compat with older clients (#1934); they're no longer stored.
|
|
35
|
+
*/
|
|
36
|
+
export declare const IncomingOverviewCitationSchema: z.ZodObject<{
|
|
37
|
+
sourceUrl: z.ZodString;
|
|
38
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
39
|
+
startIndex: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
endIndex: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
citedText: z.ZodOptional<z.ZodString>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
/**
|
|
44
|
+
* Body accepted by `POST /v1/orgs/:slug/overview` — the agent-authored
|
|
45
|
+
* markdown content, the release count it was derived from, the timestamp of
|
|
46
|
+
* the most-recent contributing release, and optional inline citations.
|
|
47
|
+
*
|
|
48
|
+
* `content` is non-empty. `releaseCount` is a finite non-negative integer.
|
|
49
|
+
* `citations` is an array of `IncomingOverviewCitation`; the handler still
|
|
50
|
+
* cross-checks `endIndex <= content.length` since that bound is content-aware.
|
|
51
|
+
*/
|
|
52
|
+
export declare const RegenerateOverviewBodySchema: z.ZodObject<{
|
|
53
|
+
content: z.ZodString;
|
|
54
|
+
releaseCount: z.ZodNumber;
|
|
55
|
+
lastContributingReleaseAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
56
|
+
citations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
57
|
+
sourceUrl: z.ZodString;
|
|
58
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
59
|
+
startIndex: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
endIndex: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
citedText: z.ZodOptional<z.ZodString>;
|
|
62
|
+
}, z.core.$strip>>>;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
/** Response returned by `POST /v1/orgs/:slug/overview` on success. */
|
|
65
|
+
export declare const RegenerateOverviewResponseSchema: z.ZodObject<{
|
|
66
|
+
ok: z.ZodLiteral<true>;
|
|
67
|
+
citations: z.ZodNumber;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
/**
|
|
70
|
+
* Response shape returned by `GET /v1/products/:slug/overview` — the
|
|
71
|
+
* product-scoped knowledge page, or `null` when no overview exists.
|
|
72
|
+
* Does not include inline citations (products overview does not store them).
|
|
73
|
+
*/
|
|
74
|
+
export declare const ProductOverviewResponseSchema: z.ZodNullable<z.ZodObject<{
|
|
75
|
+
scope: z.ZodEnum<{
|
|
76
|
+
org: "org";
|
|
77
|
+
product: "product";
|
|
78
|
+
}>;
|
|
79
|
+
orgSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
80
|
+
productSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
81
|
+
content: z.ZodString;
|
|
82
|
+
releaseCount: z.ZodNumber;
|
|
83
|
+
lastContributingReleaseAt: z.ZodNullable<z.ZodString>;
|
|
84
|
+
generatedAt: z.ZodString;
|
|
85
|
+
updatedAt: z.ZodString;
|
|
86
|
+
citations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
87
|
+
sourceUrl: z.ZodString;
|
|
88
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
89
|
+
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
90
|
+
releaseWebUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
91
|
+
startIndex: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
endIndex: z.ZodOptional<z.ZodNumber>;
|
|
93
|
+
citedText: z.ZodOptional<z.ZodString>;
|
|
94
|
+
}, z.core.$strip>>>;
|
|
95
|
+
}, z.core.$strip>>;
|
|
96
|
+
/**
|
|
97
|
+
* Pre-flight payload returned by `GET /v1/orgs/:slug/overview/inputs?check=true`.
|
|
98
|
+
* Lets an orchestrator decide whether to dispatch a per-org sub-agent without
|
|
99
|
+
* paying for the full release-content hydration.
|
|
100
|
+
*/
|
|
101
|
+
export declare const OverviewInputsCheckResponseSchema: z.ZodObject<{
|
|
102
|
+
orgSlug: z.ZodString;
|
|
103
|
+
selected: z.ZodNumber;
|
|
104
|
+
totalAvailable: z.ZodNumber;
|
|
105
|
+
hasExistingContent: z.ZodBoolean;
|
|
106
|
+
wouldRegenerate: z.ZodBoolean;
|
|
107
|
+
windowDays: z.ZodNumber;
|
|
108
|
+
}, z.core.$strip>;
|
|
109
|
+
/**
|
|
110
|
+
* Full inputs payload returned by `GET /v1/orgs/:slug/overview/inputs` (without
|
|
111
|
+
* `?check=true`). Contains org metadata, active sources, the existing overview
|
|
112
|
+
* content if any, and the selected hydrated releases ready for the AI model.
|
|
113
|
+
*
|
|
114
|
+
* Typed loosely because the release shape includes hydrated media URLs that
|
|
115
|
+
* differ slightly from `ReleaseItem` — this avoids tight coupling to internal
|
|
116
|
+
* fields while still surfacing the discriminating top-level structure.
|
|
117
|
+
*/
|
|
118
|
+
export declare const OverviewInputsFullResponseSchema: z.ZodObject<{
|
|
119
|
+
org: z.ZodObject<{
|
|
120
|
+
id: z.ZodString;
|
|
121
|
+
slug: z.ZodString;
|
|
122
|
+
name: z.ZodString;
|
|
123
|
+
description: z.ZodNullable<z.ZodString>;
|
|
124
|
+
discovery: z.ZodString;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
127
|
+
id: z.ZodString;
|
|
128
|
+
slug: z.ZodString;
|
|
129
|
+
name: z.ZodString;
|
|
130
|
+
type: z.ZodString;
|
|
131
|
+
}, z.core.$strip>>;
|
|
132
|
+
existingContent: z.ZodNullable<z.ZodString>;
|
|
133
|
+
selected: z.ZodArray<z.ZodUnknown>;
|
|
134
|
+
totalAvailable: z.ZodNumber;
|
|
135
|
+
windowDays: z.ZodNumber;
|
|
136
|
+
}, z.core.$strip>;
|
|
137
|
+
/**
|
|
138
|
+
* Union of the two shapes `GET /v1/orgs/:slug/overview/inputs` can return.
|
|
139
|
+
* The pre-flight (`?check=true`) variant skips content hydration; the full
|
|
140
|
+
* variant carries org metadata + sources + selected releases. Single response
|
|
141
|
+
* entry — Zod union so OpenAPI emits one schema with the variants inlined.
|
|
142
|
+
*/
|
|
143
|
+
export declare const OverviewInputsResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
144
|
+
orgSlug: z.ZodString;
|
|
145
|
+
selected: z.ZodNumber;
|
|
146
|
+
totalAvailable: z.ZodNumber;
|
|
147
|
+
hasExistingContent: z.ZodBoolean;
|
|
148
|
+
wouldRegenerate: z.ZodBoolean;
|
|
149
|
+
windowDays: z.ZodNumber;
|
|
150
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
151
|
+
org: z.ZodObject<{
|
|
152
|
+
id: z.ZodString;
|
|
153
|
+
slug: z.ZodString;
|
|
154
|
+
name: z.ZodString;
|
|
155
|
+
description: z.ZodNullable<z.ZodString>;
|
|
156
|
+
discovery: z.ZodString;
|
|
157
|
+
}, z.core.$strip>;
|
|
158
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
159
|
+
id: z.ZodString;
|
|
160
|
+
slug: z.ZodString;
|
|
161
|
+
name: z.ZodString;
|
|
162
|
+
type: z.ZodString;
|
|
163
|
+
}, z.core.$strip>>;
|
|
164
|
+
existingContent: z.ZodNullable<z.ZodString>;
|
|
165
|
+
selected: z.ZodArray<z.ZodUnknown>;
|
|
166
|
+
totalAvailable: z.ZodNumber;
|
|
167
|
+
windowDays: z.ZodNumber;
|
|
168
|
+
}, z.core.$strip>]>;
|
|
169
|
+
/**
|
|
170
|
+
* Response returned by `GET /v1/orgs/:slug/playbook` — the playbook knowledge
|
|
171
|
+
* page (scope `"playbook"`), or `null` when no playbook exists for the org.
|
|
172
|
+
*
|
|
173
|
+
* The playbook `content` field holds a deterministic markdown header generated
|
|
174
|
+
* by `generatePlaybookHeader()` from `@releases/ai-internal/playbook`.
|
|
175
|
+
*/
|
|
176
|
+
export declare const PlaybookResponseSchema: z.ZodNullable<z.ZodObject<{
|
|
177
|
+
orgSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
178
|
+
productSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
179
|
+
content: z.ZodString;
|
|
180
|
+
releaseCount: z.ZodNumber;
|
|
181
|
+
lastContributingReleaseAt: z.ZodNullable<z.ZodString>;
|
|
182
|
+
generatedAt: z.ZodString;
|
|
183
|
+
updatedAt: z.ZodString;
|
|
184
|
+
citations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
185
|
+
sourceUrl: z.ZodString;
|
|
186
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
187
|
+
releaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
188
|
+
releaseWebUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
189
|
+
startIndex: z.ZodOptional<z.ZodNumber>;
|
|
190
|
+
endIndex: z.ZodOptional<z.ZodNumber>;
|
|
191
|
+
citedText: z.ZodOptional<z.ZodString>;
|
|
192
|
+
}, z.core.$strip>>>;
|
|
193
|
+
scope: z.ZodLiteral<"playbook">;
|
|
194
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
195
|
+
}, z.core.$strip>>;
|
|
196
|
+
/** Body accepted by `PATCH /v1/orgs/:slug/playbook/notes`. */
|
|
197
|
+
export declare const UpdatePlaybookNotesBodySchema: z.ZodObject<{
|
|
198
|
+
notes: z.ZodString;
|
|
199
|
+
}, z.core.$strip>;
|
|
200
|
+
/** Response returned by `PATCH /v1/orgs/:slug/playbook/notes` on success. */
|
|
201
|
+
export declare const UpdatePlaybookNotesResponseSchema: z.ZodObject<{
|
|
202
|
+
ok: z.ZodLiteral<true>;
|
|
203
|
+
notes: z.ZodNullable<z.ZodString>;
|
|
204
|
+
}, z.core.$strip>;
|
|
205
|
+
//# sourceMappingURL=overviews.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overviews.d.ts","sourceRoot":"","sources":["../../src/schemas/overviews.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;kBAEzB,CAAC;AAEd;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B;;;;;;iBAMzC,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;iBAKvC,CAAC;AAEH,sEAAsE;AACtE,eAAO,MAAM,gCAAgC;;;iBAG3C,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;kBAAoC,CAAC;AAE/E;;;;GAIG;AACH,eAAO,MAAM,iCAAiC;;;;;;;iBAO5C,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;iBAoB3C,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;mBAGvC,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;kBAGtB,CAAC;AAEd,8DAA8D;AAC9D,eAAO,MAAM,6BAA6B;;iBAExC,CAAC;AAEH,6EAA6E;AAC7E,eAAO,MAAM,iCAAiC;;;iBAG5C,CAAC"}
|