@talonic/docs 0.21.78 → 0.21.83

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/dist/content.d.ts CHANGED
@@ -122,6 +122,142 @@ interface RawSection {
122
122
  mentions: string[];
123
123
  }
124
124
 
125
+ /** The audience values an operation may declare. */
126
+ type Audience = 'public' | 'partner' | 'internal';
127
+ /** Audiences rendered on public docs pages. */
128
+ declare const PUBLIC_AUDIENCES: readonly Audience[];
129
+ /** One operation of a spec with its location. */
130
+ interface SpecOperation {
131
+ method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'PATCH';
132
+ path: string;
133
+ op: Record<string, any>;
134
+ audience: Audience;
135
+ }
136
+ /**
137
+ * The audience an operation declares; an operation without one reads as
138
+ * `public` (the shape of a spec published before the field existed).
139
+ */
140
+ declare function getOperationAudience(op: Record<string, any> | undefined): Audience;
141
+ /** The spec's operations whose audience is in `audiences` (default: public). */
142
+ declare function listSpecOperations(spec: Record<string, any>, audiences?: readonly Audience[]): SpecOperation[];
143
+ /**
144
+ * A copy of `spec` whose `paths` hold only operations in `audiences`; path
145
+ * items left empty are dropped. Components are left as they are (the API's
146
+ * publisher already prunes them).
147
+ */
148
+ declare function filterOpenApiByAudience(spec: Record<string, any>, audiences?: readonly Audience[]): Record<string, any>;
149
+
150
+ type Json = Record<string, any>;
151
+ /** Normalised `METHOD /path` key; path params collapse so `{id}` = `:id`. */
152
+ declare function endpointKey(method: string, path: string): string;
153
+ /** One structured endpoint block for a spec operation. */
154
+ declare function buildEndpointBlock(spec: Json, o: SpecOperation): DocBlock;
155
+ /** A nav group whose children are the generated reference sections. */
156
+ interface GeneratedNavGroup {
157
+ id: string;
158
+ label: string;
159
+ children: {
160
+ id: string;
161
+ label: string;
162
+ }[];
163
+ }
164
+ /** The generated reference: one section per tag holding its undocumented public operations. */
165
+ interface GeneratedReference {
166
+ sections: RawSection[];
167
+ nav: GeneratedNavGroup;
168
+ /** Endpoint keys that received a generated block. */
169
+ generatedKeys: string[];
170
+ }
171
+ /** Nav group id of the generated reference. */
172
+ declare const GENERATED_REFERENCE_GROUP = "endpoint-reference";
173
+ /**
174
+ * Builds the generated reference for every public operation that `covered`
175
+ * does not already document.
176
+ */
177
+ declare function buildGeneratedReference(spec: Json, covered: Set<string>): GeneratedReference;
178
+
179
+ /** The generated endpoint reference over the bundled (public) spec. */
180
+ declare const GENERATED_API_REFERENCE: GeneratedReference;
181
+
182
+ /** A docs domain. */
183
+ type DocsDomain = 'api' | 'platform' | 'sdk' | 'mcp';
184
+ /** One page address, optionally an anchor within it. */
185
+ interface DocsAddress {
186
+ domain: DocsDomain;
187
+ slug: string;
188
+ /** Heading or endpoint anchor within the page, without `#`. */
189
+ anchor?: string;
190
+ }
191
+ /** One permanent redirect. */
192
+ interface DocsRedirect {
193
+ from: DocsAddress;
194
+ to: DocsAddress;
195
+ /** Why the page moved (one line, for the changelog and reviewers). */
196
+ reason: string;
197
+ /** ISO date the redirect was added. */
198
+ since: string;
199
+ }
200
+ /**
201
+ * Every redirect, oldest first.
202
+ *
203
+ * 2026-11-25: the Platform Guide moved to the Start / Guides / Apps / Admin /
204
+ * Changelog structure (docs-overhaul-plan §1-2). Merged pages point at the
205
+ * guide that now covers their outcome; mechanics pages moved to the internal
206
+ * engineering guide (`docs/engineering/platform-internals/`) point at the
207
+ * customer page for the same task.
208
+ */
209
+ declare const DOCS_REDIRECTS: DocsRedirect[];
210
+ /** `domain/slug[#anchor]` form of an address. */
211
+ declare function addressKey(a: DocsAddress): string;
212
+ /**
213
+ * Where an old address lives now, or `null` when it is not redirected.
214
+ * An anchor-specific redirect wins over the page redirect; a page redirect
215
+ * keeps the requested anchor unless the target names its own.
216
+ */
217
+ declare function resolveDocsRedirect(from: DocsAddress, redirects?: DocsRedirect[]): DocsAddress | null;
218
+
219
+ /** A denylist category from docs-overhaul-plan §0. */
220
+ type TermCategory = 'pipeline' | 'learning' | 'knowledge' | 'vendor' | 'codename';
221
+ /** One denylisted term. */
222
+ interface TermRule {
223
+ id: string;
224
+ category: TermCategory;
225
+ pattern: RegExp;
226
+ /** What to say instead (outcome language). */
227
+ hint: string;
228
+ }
229
+ /** The denylist. Patterns are matched against prose with literals removed. */
230
+ declare const TERM_RULES: TermRule[];
231
+ /**
232
+ * Pages where customers install or connect an AI client, so vendor and
233
+ * product names are the instructions themselves (docs-overhaul-plan §0).
234
+ */
235
+ declare const INSTALL_PAGE_SLUGS: Set<string>;
236
+ /** One denylist hit. */
237
+ interface TermHit {
238
+ /** Where: `<domain>/<slug>`, `openapi`, or `llms.txt`. */
239
+ source: string;
240
+ /** Field within the source, e.g. `content[3].text` or `paths./v1/x.get.description`. */
241
+ location: string;
242
+ rule: string;
243
+ category: TermCategory;
244
+ match: string;
245
+ excerpt: string;
246
+ }
247
+ /** Hits of the denylist in one piece of prose. */
248
+ declare function scanText(text: string | undefined, source: string, location: string, opts?: {
249
+ allowVendor?: boolean;
250
+ }): TermHit[];
251
+ /** Hits in one docs section (title, meta, body, FAQ, related labels, mentions). */
252
+ declare function scanSection(domain: string, s: RawSection): TermHit[];
253
+ /**
254
+ * Hits in the public prose of an OpenAPI spec: info, tags, operation
255
+ * summaries/descriptions, parameter, request, response and schema
256
+ * descriptions. Property names, enum values and examples are literals and are
257
+ * not scanned. Callers pass the already-published (public) spec.
258
+ */
259
+ declare function scanOpenApi(spec: Record<string, any>): TermHit[];
260
+
125
261
  /** Get a single platform section by slug, or null if not found. */
126
262
  declare function getPlatformSection(slug: string): DocSection | null;
127
263
  /** Get all platform sections in reading order. */
@@ -139,4 +275,4 @@ declare function getMcpSection(slug: string): DocSection | null;
139
275
  /** Get all MCP sections in reading order. */
140
276
  declare function getAllMcpSections(): DocSection[];
141
277
 
142
- export { type DocBlock, type DocSection, type HttpMethod, type Param, type RawSection, getAllApiSections, getAllMcpSections, getAllPlatformSections, getAllSdkSections, getApiSection, getMcpSection, getPlatformSection, getSdkSection };
278
+ export { type Audience, DOCS_REDIRECTS, type DocBlock, type DocSection, type DocsAddress, type DocsDomain, type DocsRedirect, GENERATED_API_REFERENCE, GENERATED_REFERENCE_GROUP, type HttpMethod, INSTALL_PAGE_SLUGS, PUBLIC_AUDIENCES, type Param, type RawSection, type SpecOperation, TERM_RULES, type TermCategory, type TermHit, type TermRule, addressKey, buildEndpointBlock, buildGeneratedReference, endpointKey, filterOpenApiByAudience, getAllApiSections, getAllMcpSections, getAllPlatformSections, getAllSdkSections, getApiSection, getMcpSection, getOperationAudience, getPlatformSection, getSdkSection, listSpecOperations, resolveDocsRedirect, scanOpenApi, scanSection, scanText };