@wildo-ai/saas-technical-doc 1.1.5 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/dist/esm/companion/openapi-example-derivation.d.ts +53 -0
  2. package/dist/esm/companion/openapi-example-derivation.d.ts.map +1 -0
  3. package/dist/esm/companion/openapi-example-derivation.js +229 -0
  4. package/dist/esm/companion/openapi-example-derivation.js.map +1 -0
  5. package/dist/esm/companion/openapi-generator.d.ts.map +1 -1
  6. package/dist/esm/companion/openapi-generator.js +284 -16
  7. package/dist/esm/companion/openapi-generator.js.map +1 -1
  8. package/dist/esm/companion/operation-projection.schemas.d.ts +36 -0
  9. package/dist/esm/companion/operation-projection.schemas.d.ts.map +1 -1
  10. package/dist/esm/companion/operation-projection.schemas.js +18 -0
  11. package/dist/esm/companion/operation-projection.schemas.js.map +1 -1
  12. package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.d.ts.map +1 -1
  13. package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.js +20 -0
  14. package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.js.map +1 -1
  15. package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.d.ts +2 -0
  16. package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.d.ts.map +1 -1
  17. package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.js +48 -31
  18. package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.js.map +1 -1
  19. package/dist/esm/companion/spec-to-operation-doc.d.ts +52 -10
  20. package/dist/esm/companion/spec-to-operation-doc.d.ts.map +1 -1
  21. package/dist/esm/companion/spec-to-operation-doc.js +125 -7
  22. package/dist/esm/companion/spec-to-operation-doc.js.map +1 -1
  23. package/dist/esm/content/application-consumer-documentation-content.techdoc.d.ts +10 -10
  24. package/dist/esm/content/application-consumer-documentation-content.techdoc.d.ts.map +1 -1
  25. package/dist/esm/content/application-consumer-documentation-content.techdoc.js +43 -28
  26. package/dist/esm/content/application-consumer-documentation-content.techdoc.js.map +1 -1
  27. package/dist/esm/openapi/api-reference-link-index.d.ts +3 -0
  28. package/dist/esm/openapi/api-reference-link-index.d.ts.map +1 -1
  29. package/dist/esm/openapi/api-reference-link-index.js +26 -15
  30. package/dist/esm/openapi/api-reference-link-index.js.map +1 -1
  31. package/dist/esm/openapi/api-reference-pages.d.ts +55 -0
  32. package/dist/esm/openapi/api-reference-pages.d.ts.map +1 -0
  33. package/dist/esm/openapi/api-reference-pages.js +229 -0
  34. package/dist/esm/openapi/api-reference-pages.js.map +1 -0
  35. package/dist/esm/openapi/api-reference-search.d.ts +53 -0
  36. package/dist/esm/openapi/api-reference-search.d.ts.map +1 -0
  37. package/dist/esm/openapi/api-reference-search.js +100 -0
  38. package/dist/esm/openapi/api-reference-search.js.map +1 -0
  39. package/dist/esm/openapi/api-reference-targets.d.ts +11 -0
  40. package/dist/esm/openapi/api-reference-targets.d.ts.map +1 -1
  41. package/dist/esm/openapi/api-reference-targets.js +8 -0
  42. package/dist/esm/openapi/api-reference-targets.js.map +1 -1
  43. package/dist/esm/openapi/index.d.ts +2 -0
  44. package/dist/esm/openapi/index.d.ts.map +1 -1
  45. package/dist/esm/openapi/index.js +2 -0
  46. package/dist/esm/openapi/index.js.map +1 -1
  47. package/dist/esm/openapi-reference-model.exports.d.ts +2 -0
  48. package/dist/esm/openapi-reference-model.exports.d.ts.map +1 -1
  49. package/dist/esm/openapi-reference-model.exports.js +2 -0
  50. package/dist/esm/openapi-reference-model.exports.js.map +1 -1
  51. package/dist/esm/runtime/AuthExchangePage.d.ts +45 -4
  52. package/dist/esm/runtime/AuthExchangePage.d.ts.map +1 -1
  53. package/dist/esm/runtime/AuthExchangePage.js +45 -12
  54. package/dist/esm/runtime/AuthExchangePage.js.map +1 -1
  55. package/dist/esm/runtime/DocsFrontendProviders.d.ts +15 -1
  56. package/dist/esm/runtime/DocsFrontendProviders.d.ts.map +1 -1
  57. package/dist/esm/runtime/DocsFrontendProviders.js +16 -3
  58. package/dist/esm/runtime/DocsFrontendProviders.js.map +1 -1
  59. package/dist/esm/runtime/DocsProviderComponent.d.ts +41 -0
  60. package/dist/esm/runtime/DocsProviderComponent.d.ts.map +1 -0
  61. package/dist/esm/runtime/DocsProviderComponent.js +17 -0
  62. package/dist/esm/runtime/DocsProviderComponent.js.map +1 -0
  63. package/dist/esm/runtime/documentation-site-translator.d.ts +53 -0
  64. package/dist/esm/runtime/documentation-site-translator.d.ts.map +1 -0
  65. package/dist/esm/runtime/documentation-site-translator.js +51 -0
  66. package/dist/esm/runtime/documentation-site-translator.js.map +1 -0
  67. package/dist/esm/runtime/index.d.ts +6 -0
  68. package/dist/esm/runtime/index.d.ts.map +1 -1
  69. package/dist/esm/runtime/index.js +6 -0
  70. package/dist/esm/runtime/index.js.map +1 -1
  71. package/dist/esm/runtime/openapi-reference-model.d.ts +25 -0
  72. package/dist/esm/runtime/openapi-reference-model.d.ts.map +1 -1
  73. package/dist/esm/runtime/openapi-reference-model.js +82 -13
  74. package/dist/esm/runtime/openapi-reference-model.js.map +1 -1
  75. package/dist/esm/runtime/openapi-reference-navigation.d.ts +50 -0
  76. package/dist/esm/runtime/openapi-reference-navigation.d.ts.map +1 -0
  77. package/dist/esm/runtime/openapi-reference-navigation.js +46 -0
  78. package/dist/esm/runtime/openapi-reference-navigation.js.map +1 -0
  79. package/dist/esm/runtime/openapi-reference-samples.d.ts +40 -0
  80. package/dist/esm/runtime/openapi-reference-samples.d.ts.map +1 -0
  81. package/dist/esm/runtime/openapi-reference-samples.js +169 -0
  82. package/dist/esm/runtime/openapi-reference-samples.js.map +1 -0
  83. package/dist/esm/runtime/openapi-reference-styles.d.ts +28 -0
  84. package/dist/esm/runtime/openapi-reference-styles.d.ts.map +1 -0
  85. package/dist/esm/runtime/openapi-reference-styles.js +292 -0
  86. package/dist/esm/runtime/openapi-reference-styles.js.map +1 -0
  87. package/dist/esm/runtime/openapi-reference-view.d.ts +40 -5
  88. package/dist/esm/runtime/openapi-reference-view.d.ts.map +1 -1
  89. package/dist/esm/runtime/openapi-reference-view.js +828 -82
  90. package/dist/esm/runtime/openapi-reference-view.js.map +1 -1
  91. package/dist/esm/runtime/openapi-reference-words-context.d.ts +12 -0
  92. package/dist/esm/runtime/openapi-reference-words-context.d.ts.map +1 -0
  93. package/dist/esm/runtime/openapi-reference-words-context.js +30 -0
  94. package/dist/esm/runtime/openapi-reference-words-context.js.map +1 -0
  95. package/dist/esm/runtime/openapi-reference-words.d.ts +205 -0
  96. package/dist/esm/runtime/openapi-reference-words.d.ts.map +1 -0
  97. package/dist/esm/runtime/openapi-reference-words.js +162 -0
  98. package/dist/esm/runtime/openapi-reference-words.js.map +1 -0
  99. package/dist/esm/runtime/provider-component-registry.techdoc.d.ts +31 -0
  100. package/dist/esm/runtime/provider-component-registry.techdoc.d.ts.map +1 -0
  101. package/dist/esm/runtime/provider-component-registry.techdoc.js +35 -0
  102. package/dist/esm/runtime/provider-component-registry.techdoc.js.map +1 -0
  103. package/dist/esm/runtime/use-docs-provider-component.d.ts +29 -0
  104. package/dist/esm/runtime/use-docs-provider-component.d.ts.map +1 -0
  105. package/dist/esm/runtime/use-docs-provider-component.js +42 -0
  106. package/dist/esm/runtime/use-docs-provider-component.js.map +1 -0
  107. package/dist/esm/runtime/use-docs-provider-scripts.d.ts +12 -5
  108. package/dist/esm/runtime/use-docs-provider-scripts.d.ts.map +1 -1
  109. package/dist/esm/runtime/use-docs-provider-scripts.js +15 -8
  110. package/dist/esm/runtime/use-docs-provider-scripts.js.map +1 -1
  111. package/dist/tsconfig.build.tsbuildinfo +1 -1
  112. package/package.json +6 -6
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-reference-pages.js","sourceRoot":"","sources":["../../../../src/openapi/api-reference-pages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,yBAAyB,C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ACD,KAAK;QACL,kBAAkB;KACnB,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,+BAA+B,CAAC,QAAgB,EAAE,kBAAoD;IACpH,OAAO,kBAAkB,CAAC,QAAQ,CAAC,IAAI,kBAAkB,CAAC,QAAQ,CAAC,OAAO,CAAC,kCAAkC,EAAE,EAAE,CAAC,CAAC,CAAC;AACtH,CAAC;AAED,8GAA8G;AAC9G,MAAM,UAAU,4BAA4B,CAAC,kBAAoD;IAC/F,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,+CAA+C,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AACxJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,eAAuB,EAAE,QAAgB,EAAE,IAAsD;IACpI,MAAM,IAAI,GAAG,+BAA+B,CAAC,QAAQ,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAChF,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,GAAG,eAAe,IAAI,QAAQ,EAAE,CAAC;IAChE,OAAO,QAAQ,KAAK,YAAY,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,eAAe,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,eAAe,IAAI,IAAI,IAAI,QAAQ,EAAE,CAAC;AACnH,CAAC","sourcesContent":["/**\n * A page per resource for the API reference, instead of one client-rendered route (#1623).\n *\n * The reference was one route that downloaded and parsed the whole published document on every\n * visit — 9,650,190 bytes for Wonder Todos, measured 2026-09-25 — and addressed every resource,\n * operation and response by `#fragment` state on a ~10,000 px page. Nothing had a page of its own, so\n * nothing had static HTML: not for a reader without JavaScript, not for print, not for the site's\n * search index.\n *\n * This module splits one verified OpenAPI document into what a statically built portal serves:\n *\n * - one PAGE per resource (`/api/<slug>`), carrying that resource's operations and ONLY the\n * components they reach, so a page is complete on its own;\n * - one light INDEX document for the section root: every tag, and every operation reduced to its\n * identity and access, which is all the category grid and the in-page search read;\n * - the map from every public fragment to the page it now lives on, so a link written for the\n * single-page reference (`/api#operation-…`) still reaches its target, and so the link index\n * builds guide links from the same answer.\n *\n * It is pure and imports nothing browser- or Node-specific, so the build plugin that registers the\n * routes and the publication step that writes guide links compute the same plan.\n */\n\nimport {\n ApiReferenceTargetKind,\n apiReferenceResourcePageSlug,\n apiReferenceTargetFragment,\n} from './api-reference-targets';\n\ntype JsonRecord = Record<string, unknown>;\n\nconst HTTP_METHODS: ReadonlySet<string> = new Set(['get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace']);\n\n/** Path segments the section roots already use; a resource page may never shadow one. */\nconst RESERVED_PAGE_SLUGS: ReadonlySet<string> = new Set(['application-administration']);\n\nconst isRecord = (value: unknown): value is JsonRecord => typeof value === 'object' && value !== null && !Array.isArray(value);\n\n/** One resource's page: its slug, its resource name, and the self-sufficient document it renders. */\nexport interface ApiReferenceResourcePage {\n readonly slug: string;\n readonly resourceName: string;\n readonly document: JsonRecord;\n}\n\nexport interface ApiReferencePagePlan {\n /** The section root's document: every tag, and every operation reduced to identity and access. */\n readonly indexDocument: JsonRecord;\n readonly pages: readonly ApiReferenceResourcePage[];\n /** Every public fragment that lives on a resource page, with that page's slug. */\n readonly pageSlugByFragment: Readonly<Record<string, string>>;\n}\n\nfunction resourceNameOf(operation: JsonRecord): string {\n const metadata = operation['x-wildo'];\n const resourceRef = isRecord(metadata) && typeof metadata.resourceRef === 'string' ? metadata.resourceRef : '';\n const name = resourceRef.match(/^technical-documentation:resource\\/([^/]+)$/)?.[1];\n if (name === undefined) throw new Error(`API-reference page plan: operation '${String(operation.operationId)}' has no canonical resource identity`);\n return name;\n}\n\nfunction familyNameOf(operation: JsonRecord): string {\n const metadata = operation['x-wildo'];\n const familyRef = isRecord(metadata) && typeof metadata.operationFamilyRef === 'string' ? metadata.operationFamilyRef : '';\n const name = familyRef.match(/\\/operation-family\\/([^/]+)$/)?.[1];\n if (name === undefined) throw new Error(`API-reference page plan: operation '${String(operation.operationId)}' has no canonical family identity`);\n return name;\n}\n\n/** Every `#/components/<kind>/<name>` reference in `node`, recursively. */\nfunction collectReferences(node: unknown, into: Set<string>): void {\n if (Array.isArray(node)) {\n for (const entry of node) collectReferences(entry, into);\n return;\n }\n if (!isRecord(node)) return;\n if (typeof node.$ref === 'string' && node.$ref.startsWith('#/components/')) into.add(node.$ref);\n for (const value of Object.values(node)) collectReferences(value, into);\n}\n\n/**\n * The components a set of operations reaches, closed transitively: a schema that references another\n * schema brings it along, and a shared response brings the schema its body names.\n */\nfunction componentClosure(paths: JsonRecord, components: JsonRecord): { readonly schemas: JsonRecord; readonly responses: JsonRecord } {\n const componentSchemas = isRecord(components.schemas) ? components.schemas : {};\n const componentResponses = isRecord(components.responses) ? components.responses : {};\n const pending = new Set<string>();\n collectReferences(paths, pending);\n const schemas: JsonRecord = {};\n const responses: JsonRecord = {};\n const visited = new Set<string>();\n while (pending.size > 0) {\n const [reference] = pending;\n pending.delete(reference!);\n if (visited.has(reference!)) continue;\n visited.add(reference!);\n const [, kind, name] = reference!.match(/^#\\/components\\/([^/]+)\\/(.+)$/) ?? [];\n const target = kind === 'schemas' ? componentSchemas[name!] : kind === 'responses' ? componentResponses[name!] : undefined;\n if (target === undefined) continue;\n if (kind === 'schemas') schemas[name!] = target;\n else responses[name!] = target;\n const more = new Set<string>();\n collectReferences(target, more);\n for (const next of more) if (!visited.has(next)) pending.add(next);\n }\n return { schemas, responses };\n}\n\n/**\n * An operation as the index needs it: identity, summary, method, path and access — the fields the\n * category grid and the in-page search read. Parameters, bodies and responses stay on the page, and\n * so does the role prose (the index shows role LABELS), which is most of an operation's weight.\n */\nfunction indexOperation(operation: JsonRecord): JsonRecord {\n const metadata = isRecord(operation['x-wildo']) ? operation['x-wildo'] : {};\n const access = isRecord(metadata.access) ? metadata.access : {};\n const roleRequirements = Array.isArray(access.roleRequirements)\n ? access.roleRequirements.map((requirement) => (isRecord(requirement) ? { role: requirement.role, label: requirement.label } : requirement))\n : [];\n return {\n operationId: operation.operationId,\n ...(operation.summary === undefined ? {} : { summary: operation.summary }),\n ...(operation.tags === undefined ? {} : { tags: operation.tags }),\n ...(operation.security === undefined ? {} : { security: operation.security }),\n 'x-wildo': {\n resourceRef: metadata.resourceRef,\n operationFamilyRef: metadata.operationFamilyRef,\n operationVariantRef: metadata.operationVariantRef,\n path: metadata.path,\n httpVerb: metadata.httpVerb,\n ...(metadata.aliasOfPath === undefined ? {} : { aliasOfPath: metadata.aliasOfPath }),\n access: { authenticationMode: access.authenticationMode, authenticationSummary: access.authenticationSummary, roleRequirements },\n },\n };\n}\n\n/** Split one verified OpenAPI document into resource pages, an index, and the fragment → page map. */\nexport function buildApiReferencePagePlan(document: unknown): ApiReferencePagePlan {\n if (!isRecord(document) || !isRecord(document.paths)) throw new Error('API-reference page plan: document has no OpenAPI paths object');\n const components = isRecord(document.components) ? document.components : {};\n\n const operationsByResource = new Map<string, Array<{ readonly path: string; readonly method: string; readonly operation: JsonRecord }>>();\n for (const [path, pathItem] of Object.entries(document.paths)) {\n if (!isRecord(pathItem)) continue;\n for (const [method, operation] of Object.entries(pathItem)) {\n if (!HTTP_METHODS.has(method) || !isRecord(operation)) continue;\n const resourceName = resourceNameOf(operation);\n operationsByResource.set(resourceName, [...(operationsByResource.get(resourceName) ?? []), { path, method, operation }]);\n }\n }\n\n const pageSlugByFragment: Record<string, string> = {};\n const claim = (fragment: string, slug: string): void => {\n const owner = pageSlugByFragment[fragment];\n if (owner !== undefined && owner !== slug) throw new Error(`API-reference page plan: fragment '${fragment}' belongs to two pages ('${owner}', '${slug}')`);\n pageSlugByFragment[fragment] = slug;\n };\n const slugByResource = new Map<string, string>();\n const pages: ApiReferenceResourcePage[] = [];\n const indexPaths: Record<string, JsonRecord> = {};\n\n for (const resourceName of [...operationsByResource.keys()].sort((left, right) => left.localeCompare(right))) {\n const slug = apiReferenceResourcePageSlug(resourceName);\n if (RESERVED_PAGE_SLUGS.has(slug)) throw new Error(`API-reference page plan: resource '${resourceName}' would shadow the reserved route '${slug}'`);\n const clash = [...slugByResource.entries()].find(([, existing]) => existing === slug);\n if (clash !== undefined) throw new Error(`API-reference page plan: resources '${clash[0]}' and '${resourceName}' share the page '${slug}'`);\n slugByResource.set(resourceName, slug);\n\n const paths: Record<string, JsonRecord> = {};\n claim(apiReferenceTargetFragment({ kind: ApiReferenceTargetKind.RESOURCE, resourceName }), slug);\n for (const { path, method, operation } of operationsByResource.get(resourceName)!) {\n paths[path] = { ...(paths[path] ?? {}), [method]: operation };\n indexPaths[path] = { ...(indexPaths[path] ?? {}), [method]: indexOperation(operation) };\n const operationId = String(operation.operationId);\n claim(apiReferenceTargetFragment({ kind: ApiReferenceTargetKind.OPERATION_FAMILY, resourceName, operationName: familyNameOf(operation) }), slug);\n claim(apiReferenceTargetFragment({ kind: ApiReferenceTargetKind.OPERATION, operationId }), slug);\n if (isRecord(operation.requestBody)) claim(apiReferenceTargetFragment({ kind: ApiReferenceTargetKind.REQUEST, operationId }), slug);\n for (const status of Object.keys(isRecord(operation.responses) ? operation.responses : {})) {\n claim(apiReferenceTargetFragment({ kind: ApiReferenceTargetKind.RESPONSE, operationId, status }), slug);\n }\n }\n const closure = componentClosure(paths, components);\n // A reusable schema lives on the first page (by slug) that reaches it; later pages link to it there.\n for (const schemaName of Object.keys(closure.schemas)) {\n const fragment = apiReferenceTargetFragment({ kind: ApiReferenceTargetKind.COMPONENT_SCHEMA, schemaName });\n if (pageSlugByFragment[fragment] === undefined) pageSlugByFragment[fragment] = slug;\n }\n pages.push({\n slug,\n resourceName,\n document: {\n openapi: document.openapi,\n ...(isRecord(document.info) ? { info: { title: document.info.title, version: document.info.version } } : {}),\n ...(document.servers === undefined ? {} : { servers: document.servers }),\n // Every tag, so a relationship to another resource is labelled by that resource's own name.\n ...(document.tags === undefined ? {} : { tags: document.tags }),\n paths,\n components: {\n schemas: closure.schemas,\n ...(Object.keys(closure.responses).length > 0 ? { responses: closure.responses } : {}),\n ...(components.securitySchemes === undefined ? {} : { securitySchemes: components.securitySchemes }),\n },\n },\n });\n }\n\n return {\n indexDocument: {\n openapi: document.openapi,\n ...(document.info === undefined ? {} : { info: document.info }),\n ...(document.servers === undefined ? {} : { servers: document.servers }),\n ...(document.tags === undefined ? {} : { tags: document.tags }),\n paths: indexPaths,\n components: components.securitySchemes === undefined ? {} : { securitySchemes: components.securitySchemes },\n },\n pages,\n pageSlugByFragment,\n };\n}\n\n/**\n * The page slug of `fragment`, reading a request or response fragment as its operation's\n * (`operation-x--response-200` lives wherever `operation-x` does). That lets a landing page carry the\n * map WITHOUT the request and response anchors, which were most of its bytes (572 KB of the 1.6 MB\n * Wonder Todos index, measured 2026-09-25): see `withoutOperationSubFragments`.\n */\nexport function apiReferencePageSlugForFragment(fragment: string, pageSlugByFragment: Readonly<Record<string, string>>): string | undefined {\n return pageSlugByFragment[fragment] ?? pageSlugByFragment[fragment.replace(/--(request|response-[a-z0-9-]+)$/, '')];\n}\n\n/** The fragment map without request and response anchors, which `apiReferencePageSlugForFragment` derives. */\nexport function withoutOperationSubFragments(pageSlugByFragment: Readonly<Record<string, string>>): Readonly<Record<string, string>> {\n return Object.fromEntries(Object.entries(pageSlugByFragment).filter(([fragment]) => !/^operation-.+--(request|response-[a-z0-9-]+)$/.test(fragment)));\n}\n\n/**\n * The href of a public fragment in a section whose resources have pages: the resource page when the\n * fragment lives on one (`/api/tasks#operation-create-task`), the section root otherwise (a category\n * lives on the index). A resource's own fragment is its page, with no fragment.\n */\nexport function apiReferencePageHref(sectionRootPath: string, fragment: string, plan: Pick<ApiReferencePagePlan, 'pageSlugByFragment'>): string {\n const slug = apiReferencePageSlugForFragment(fragment, plan.pageSlugByFragment);\n if (slug === undefined) return `${sectionRootPath}#${fragment}`;\n return fragment === `resource-${slug}` ? `${sectionRootPath}/${slug}` : `${sectionRootPath}/${slug}#${fragment}`;\n}\n"]}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * The API reference's entries in the portal's site search (#1624).
3
+ *
4
+ * The site search read only the consumer-documentation prose units, so a reader who typed an
5
+ * endpoint — `assign task`, `/tasks/{taskId}/assign` — into the search box found nothing, and the
6
+ * reference's own in-page filter worked only on `/api`, one section at a time.
7
+ *
8
+ * The entries are derived from the SAME verified OpenAPI documents the reference renders, through
9
+ * the same model and the same page plan, so a search result links to the page and anchor the
10
+ * reference actually serves and cannot describe an operation the reference does not show.
11
+ *
12
+ * Pure, and free of browser- and Node-specific imports, like the page plan it reads.
13
+ */
14
+ import { OpenApiSection, type OpenApiSectionOutput } from './openapi-generation-output.schemas';
15
+ /** What a search entry points at. */
16
+ export declare enum ApiReferenceSearchEntryKind {
17
+ /** A resource's own page: its description and every operation on it. */
18
+ RESOURCE = "RESOURCE",
19
+ /** One operation, with every path that reaches it. */
20
+ OPERATION = "OPERATION"
21
+ }
22
+ /** The heading each section's pages carry, shown beside a result so two sections never read alike. */
23
+ export declare const API_REFERENCE_SECTION_TITLES: Readonly<Record<OpenApiSection, string>>;
24
+ export interface ApiReferenceSearchEntry {
25
+ readonly kind: ApiReferenceSearchEntryKind;
26
+ readonly title: string;
27
+ /** The first paragraph of the description, shortened; `null` when the document gives none. */
28
+ readonly summary: string | null;
29
+ readonly section: OpenApiSection;
30
+ readonly sectionTitle: string;
31
+ readonly resourceLabel: string;
32
+ /** The operation family (`Read`, `Assign`…); `null` on a resource entry. */
33
+ readonly familyLabel: string | null;
34
+ /** Upper-case HTTP method; `null` on a resource entry. */
35
+ readonly method: string | null;
36
+ /** The operation's canonical path first, then every alias that reaches the same operation. */
37
+ readonly paths: readonly string[];
38
+ /** The page, and on it the anchor, the reference serves this entry at. */
39
+ readonly href: string;
40
+ }
41
+ export interface ApiReferenceSearchIndex {
42
+ readonly schemaVersion: 1;
43
+ readonly entries: readonly ApiReferenceSearchEntry[];
44
+ }
45
+ /**
46
+ * One entry per resource and one per operation, across every published section.
47
+ *
48
+ * An alias variant (`aliasOfPath` set) is not an entry of its own: the reference shows it under its
49
+ * canonical operation, so its path joins that operation's `paths`, and searching the alias lands
50
+ * where the reference puts it. An alias whose canonical operation is absent keeps an entry of its own.
51
+ */
52
+ export declare function buildApiReferenceSearchIndex(sections: readonly Pick<OpenApiSectionOutput, 'section' | 'document'>[]): ApiReferenceSearchIndex;
53
+ //# sourceMappingURL=api-reference-search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-reference-search.d.ts","sourceRoot":"","sources":["../../../../src/openapi/api-reference-search.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAEhG,qCAAqC;AACrC,oBAAY,2BAA2B;IACrC,wEAAwE;IACxE,QAAQ,aAAa;IACrB,sDAAsD;IACtD,SAAS,cAAc;CACxB;AAED,sGAAsG;AACtG,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAGjF,CAAC;AAEF,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,EAAE,2BAA2B,CAAC;IAC3C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,8FAA8F;IAC9F,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,0DAA0D;IAC1D,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,8FAA8F;IAC9F,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,0EAA0E;IAC1E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,SAAS,uBAAuB,EAAE,CAAC;CACtD;AAiBD;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,SAAS,IAAI,CAAC,oBAAoB,EAAE,SAAS,GAAG,UAAU,CAAC,EAAE,GAAG,uBAAuB,CA8C7I"}
@@ -0,0 +1,100 @@
1
+ /**
2
+ * The API reference's entries in the portal's site search (#1624).
3
+ *
4
+ * The site search read only the consumer-documentation prose units, so a reader who typed an
5
+ * endpoint — `assign task`, `/tasks/{taskId}/assign` — into the search box found nothing, and the
6
+ * reference's own in-page filter worked only on `/api`, one section at a time.
7
+ *
8
+ * The entries are derived from the SAME verified OpenAPI documents the reference renders, through
9
+ * the same model and the same page plan, so a search result links to the page and anchor the
10
+ * reference actually serves and cannot describe an operation the reference does not show.
11
+ *
12
+ * Pure, and free of browser- and Node-specific imports, like the page plan it reads.
13
+ */
14
+ import { createApiReferenceModel } from '../runtime/openapi-reference-model.js';
15
+ import { apiReferenceRouteForSection } from './api-reference-link-index.js';
16
+ import { apiReferencePageHref, buildApiReferencePagePlan } from './api-reference-pages.js';
17
+ import { ApiReferenceTargetKind, apiReferenceTargetFragment, applicationConsumerDocumentationRoutePath } from './api-reference-targets.js';
18
+ import { OpenApiSection } from './openapi-generation-output.schemas.js';
19
+ /** What a search entry points at. */
20
+ export var ApiReferenceSearchEntryKind;
21
+ (function (ApiReferenceSearchEntryKind) {
22
+ /** A resource's own page: its description and every operation on it. */
23
+ ApiReferenceSearchEntryKind["RESOURCE"] = "RESOURCE";
24
+ /** One operation, with every path that reaches it. */
25
+ ApiReferenceSearchEntryKind["OPERATION"] = "OPERATION";
26
+ })(ApiReferenceSearchEntryKind || (ApiReferenceSearchEntryKind = {}));
27
+ /** The heading each section's pages carry, shown beside a result so two sections never read alike. */
28
+ export const API_REFERENCE_SECTION_TITLES = {
29
+ [OpenApiSection.API_REFERENCE]: 'API reference',
30
+ [OpenApiSection.APPLICATION_ADMINISTRATION_API_REFERENCE]: 'Application administration API reference',
31
+ };
32
+ /** Bounds one summary, so a long description cannot make the index the size of the document. */
33
+ const SUMMARY_CHARACTER_LIMIT = 240;
34
+ function searchSummary(description) {
35
+ const paragraph = description?.trim().split(/\n\s*\n/u)[0]?.replace(/\s+/gu, ' ').trim() ?? '';
36
+ if (paragraph.length === 0)
37
+ return null;
38
+ return paragraph.length <= SUMMARY_CHARACTER_LIMIT ? paragraph : `${paragraph.slice(0, SUMMARY_CHARACTER_LIMIT - 1).trimEnd()}…`;
39
+ }
40
+ function resourceNameOf(resourceRef) {
41
+ const name = resourceRef.match(/^technical-documentation:resource\/([^/]+)$/u)?.[1];
42
+ if (name === undefined)
43
+ throw new Error(`API-reference search: resource '${resourceRef}' has no canonical resource identity`);
44
+ return name;
45
+ }
46
+ /**
47
+ * One entry per resource and one per operation, across every published section.
48
+ *
49
+ * An alias variant (`aliasOfPath` set) is not an entry of its own: the reference shows it under its
50
+ * canonical operation, so its path joins that operation's `paths`, and searching the alias lands
51
+ * where the reference puts it. An alias whose canonical operation is absent keeps an entry of its own.
52
+ */
53
+ export function buildApiReferenceSearchIndex(sections) {
54
+ const entries = [];
55
+ for (const { section, document } of sections) {
56
+ const model = createApiReferenceModel(document);
57
+ const plan = buildApiReferencePagePlan(document);
58
+ const sectionRootPath = applicationConsumerDocumentationRoutePath(apiReferenceRouteForSection(section));
59
+ const sectionTitle = API_REFERENCE_SECTION_TITLES[section];
60
+ for (const resource of model.resources) {
61
+ const resourceName = resourceNameOf(resource.resourceRef);
62
+ entries.push({
63
+ kind: ApiReferenceSearchEntryKind.RESOURCE,
64
+ title: resource.label,
65
+ summary: searchSummary(resource.description),
66
+ section,
67
+ sectionTitle,
68
+ resourceLabel: resource.label,
69
+ familyLabel: null,
70
+ method: null,
71
+ paths: [],
72
+ href: apiReferencePageHref(sectionRootPath, apiReferenceTargetFragment({ kind: ApiReferenceTargetKind.RESOURCE, resourceName }), plan),
73
+ });
74
+ for (const family of resource.families) {
75
+ const aliasesOf = (canonical) => family.variants
76
+ .filter((variant) => variant.aliasOfPath === canonical.path && variant.method === canonical.method)
77
+ .map((variant) => variant.path);
78
+ const canonicalKeys = new Set(family.variants.filter((variant) => variant.aliasOfPath === null).map((variant) => `${variant.method} ${variant.path}`));
79
+ // An alias whose canonical operation is not in this family has nothing to join, so it stands alone.
80
+ const listed = family.variants.filter((variant) => variant.aliasOfPath === null || !canonicalKeys.has(`${variant.method} ${variant.aliasOfPath}`));
81
+ for (const variant of listed) {
82
+ entries.push({
83
+ kind: ApiReferenceSearchEntryKind.OPERATION,
84
+ title: variant.summary,
85
+ summary: searchSummary(variant.description),
86
+ section,
87
+ sectionTitle,
88
+ resourceLabel: resource.label,
89
+ familyLabel: family.label,
90
+ method: variant.method.toUpperCase(),
91
+ paths: [variant.path, ...aliasesOf(variant)],
92
+ href: apiReferencePageHref(sectionRootPath, apiReferenceTargetFragment({ kind: ApiReferenceTargetKind.OPERATION, operationId: variant.operationId }), plan),
93
+ });
94
+ }
95
+ }
96
+ }
97
+ }
98
+ return { schemaVersion: 1, entries };
99
+ }
100
+ //# sourceMappingURL=api-reference-search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-reference-search.js","sourceRoot":"","sources":["../../../../src/openapi/api-reference-search.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,uBAAuB,EAA4B,MAAM,oCAAoC,CAAC;AACvG,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,yCAAyC,EAAE,MAAM,yBAAyB,CAAC;AACxI,OAAO,EAA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,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,EAAE,aAAa,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC;AACvC,CAAC","sourcesContent":["/**\n * The API reference's entries in the portal's site search (#1624).\n *\n * The site search read only the consumer-documentation prose units, so a reader who typed an\n * endpoint — `assign task`, `/tasks/{taskId}/assign` — into the search box found nothing, and the\n * reference's own in-page filter worked only on `/api`, one section at a time.\n *\n * The entries are derived from the SAME verified OpenAPI documents the reference renders, through\n * the same model and the same page plan, so a search result links to the page and anchor the\n * reference actually serves and cannot describe an operation the reference does not show.\n *\n * Pure, and free of browser- and Node-specific imports, like the page plan it reads.\n */\n\nimport { createApiReferenceModel, type ApiReferenceVariant } from '../runtime/openapi-reference-model';\nimport { apiReferenceRouteForSection } from './api-reference-link-index';\nimport { apiReferencePageHref, buildApiReferencePagePlan } from './api-reference-pages';\nimport { ApiReferenceTargetKind, apiReferenceTargetFragment, applicationConsumerDocumentationRoutePath } from './api-reference-targets';\nimport { OpenApiSection, type OpenApiSectionOutput } from './openapi-generation-output.schemas';\n\n/** What a search entry points at. */\nexport enum ApiReferenceSearchEntryKind {\n /** A resource's own page: its description and every operation on it. */\n RESOURCE = 'RESOURCE',\n /** One operation, with every path that reaches it. */\n OPERATION = 'OPERATION',\n}\n\n/** The heading each section's pages carry, shown beside a result so two sections never read alike. */\nexport const API_REFERENCE_SECTION_TITLES: Readonly<Record<OpenApiSection, string>> = {\n [OpenApiSection.API_REFERENCE]: 'API reference',\n [OpenApiSection.APPLICATION_ADMINISTRATION_API_REFERENCE]: 'Application administration API reference',\n};\n\nexport interface ApiReferenceSearchEntry {\n readonly kind: ApiReferenceSearchEntryKind;\n readonly title: string;\n /** The first paragraph of the description, shortened; `null` when the document gives none. */\n readonly summary: string | null;\n readonly section: OpenApiSection;\n readonly sectionTitle: string;\n readonly resourceLabel: string;\n /** The operation family (`Read`, `Assign`…); `null` on a resource entry. */\n readonly familyLabel: string | null;\n /** Upper-case HTTP method; `null` on a resource entry. */\n readonly method: string | null;\n /** The operation's canonical path first, then every alias that reaches the same operation. */\n readonly paths: readonly string[];\n /** The page, and on it the anchor, the reference serves this entry at. */\n readonly href: string;\n}\n\nexport interface ApiReferenceSearchIndex {\n readonly schemaVersion: 1;\n readonly entries: readonly ApiReferenceSearchEntry[];\n}\n\n/** Bounds one summary, so a long description cannot make the index the size of the document. */\nconst SUMMARY_CHARACTER_LIMIT = 240;\n\nfunction searchSummary(description: string | null): string | null {\n const paragraph = description?.trim().split(/\\n\\s*\\n/u)[0]?.replace(/\\s+/gu, ' ').trim() ?? '';\n if (paragraph.length === 0) return null;\n return paragraph.length <= SUMMARY_CHARACTER_LIMIT ? paragraph : `${paragraph.slice(0, SUMMARY_CHARACTER_LIMIT - 1).trimEnd()}…`;\n}\n\nfunction resourceNameOf(resourceRef: string): string {\n const name = resourceRef.match(/^technical-documentation:resource\\/([^/]+)$/u)?.[1];\n if (name === undefined) throw new Error(`API-reference search: resource '${resourceRef}' has no canonical resource identity`);\n return name;\n}\n\n/**\n * One entry per resource and one per operation, across every published section.\n *\n * An alias variant (`aliasOfPath` set) is not an entry of its own: the reference shows it under its\n * canonical operation, so its path joins that operation's `paths`, and searching the alias lands\n * where the reference puts it. An alias whose canonical operation is absent keeps an entry of its own.\n */\nexport function buildApiReferenceSearchIndex(sections: readonly Pick<OpenApiSectionOutput, 'section' | 'document'>[]): ApiReferenceSearchIndex {\n const entries: ApiReferenceSearchEntry[] = [];\n for (const { section, document } of sections) {\n const model = createApiReferenceModel(document);\n const plan = buildApiReferencePagePlan(document);\n const sectionRootPath = applicationConsumerDocumentationRoutePath(apiReferenceRouteForSection(section));\n const sectionTitle = API_REFERENCE_SECTION_TITLES[section];\n for (const resource of model.resources) {\n const resourceName = resourceNameOf(resource.resourceRef);\n entries.push({\n kind: ApiReferenceSearchEntryKind.RESOURCE,\n title: resource.label,\n summary: searchSummary(resource.description),\n section,\n sectionTitle,\n resourceLabel: resource.label,\n familyLabel: null,\n method: null,\n paths: [],\n href: apiReferencePageHref(sectionRootPath, apiReferenceTargetFragment({ kind: ApiReferenceTargetKind.RESOURCE, resourceName }), plan),\n });\n for (const family of resource.families) {\n const aliasesOf = (canonical: ApiReferenceVariant): readonly string[] => family.variants\n .filter((variant) => variant.aliasOfPath === canonical.path && variant.method === canonical.method)\n .map((variant) => variant.path);\n const canonicalKeys = new Set(family.variants.filter((variant) => variant.aliasOfPath === null).map((variant) => `${variant.method} ${variant.path}`));\n // An alias whose canonical operation is not in this family has nothing to join, so it stands alone.\n const listed = family.variants.filter((variant) => variant.aliasOfPath === null || !canonicalKeys.has(`${variant.method} ${variant.aliasOfPath}`));\n for (const variant of listed) {\n entries.push({\n kind: ApiReferenceSearchEntryKind.OPERATION,\n title: variant.summary,\n summary: searchSummary(variant.description),\n section,\n sectionTitle,\n resourceLabel: resource.label,\n familyLabel: family.label,\n method: variant.method.toUpperCase(),\n paths: [variant.path, ...aliasesOf(variant)],\n href: apiReferencePageHref(sectionRootPath, apiReferenceTargetFragment({ kind: ApiReferenceTargetKind.OPERATION, operationId: variant.operationId }), plan),\n });\n }\n }\n }\n }\n return { schemaVersion: 1, entries };\n}\n"]}
@@ -68,4 +68,15 @@ export declare function applicationConsumerDocumentationRoutePath(route: Applica
68
68
  export declare function applicationConsumerDocumentationTargetPath(route: ApplicationConsumerDocumentationRoute, target?: ApiReferencePublicTarget): string;
69
69
  /** Produces a readable fragment for one API-reference contract target. */
70
70
  export declare function apiReferenceTargetFragment(target: ApiReferencePublicTarget): string;
71
+ /**
72
+ * Converts a declared identifier to public URL vocabulary without silently
73
+ * accepting arbitrary punctuation. The generated model separately rejects
74
+ * collisions, so this readable form never needs an opaque digest suffix.
75
+ */
76
+ /**
77
+ * The path segment of a resource's own API-reference page (`/api/<slug>`), #1623. It is the readable
78
+ * part of the resource's fragment (`resource-<slug>`), so a page and the anchor that used to address
79
+ * the same resource on the single-page reference can never name it differently.
80
+ */
81
+ export declare function apiReferenceResourcePageSlug(resourceName: string): string;
71
82
  //# sourceMappingURL=api-reference-targets.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-reference-targets.d.ts","sourceRoot":"","sources":["../../../../src/openapi/api-reference-targets.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,mFAAmF;AACnF,oBAAY,qCAAqC;IAC/C,WAAW,gBAAgB;IAC3B,mBAAmB,wBAAwB;IAC3C,mBAAmB,wBAAwB;IAC3C,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,wCAAwC,6CAA6C;CACtF;AAED,wFAAwF;AACxF,oBAAY,sBAAsB;IAChC,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,gBAAgB,qBAAqB;IACrC,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,gBAAgB,qBAAqB;CACtC;AAED;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB,GAChC;IAAE,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC,QAAQ,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GACjF;IAAE,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC,QAAQ,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GACjF;IAAE,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC,gBAAgB,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GACzH;IAAE,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC,SAAS,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACjF;IAAE,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC,OAAO,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAC/E;IAAE,QAAQ,CAAC,IA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AC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GACjF;IAAE,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC,gBAAgB,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GACzH;IAAE,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC,SAAS,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACjF;IAAE,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC,OAAO,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAC/E;IAAE,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC,QAAQ,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACzG;IAAE,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC,gBAAgB,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5F,+EAA+E;AAC/E,wBAAgB,yCAAyC,CAAC,KAAK,EAAE,qCAAqC,GAAG,MAAM,CAmB9G;AAED;;;;;GAKG;AACH,wBAAgB,0CAA0C,CACxD,KAAK,EAAE,qCAAqC,EAC5C,MAAM,CAAC,EAAE,wBAAwB,GAChC,MAAM,CAQR;AAED,0EAA0E;AAC1E,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,wBAAwB,GAAG,MAAM,CAqBnF;AAED;;;;GAIG;AACH;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEzE"}
@@ -93,6 +93,14 @@ export function apiReferenceTargetFragment(target) {
93
93
  * accepting arbitrary punctuation. The generated model separately rejects
94
94
  * collisions, so this readable form never needs an opaque digest suffix.
95
95
  */
96
+ /**
97
+ * The path segment of a resource's own API-reference page (`/api/<slug>`), #1623. It is the readable
98
+ * part of the resource's fragment (`resource-<slug>`), so a page and the anchor that used to address
99
+ * the same resource on the single-page reference can never name it differently.
100
+ */
101
+ export function apiReferenceResourcePageSlug(resourceName) {
102
+ return readableFragmentPart(resourceName);
103
+ }
96
104
  function readableFragmentPart(value) {
97
105
  let decoded;
98
106
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"api-reference-targets.js","sourceRoot":"","sources":["../../../../src/openapi/api-reference-targets.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,mFAAmF;AACnF,MAAM,CAAN,IAAY,qCAOX;AAPD,WAAY,qCAAqC;IAC/C,oEAA2B,CAAA;IAC3B,oFAA2C,CAAA;IAC3C,oFAA2C,CAAA;IAC3C,sEAA6B,CAAA;IAC7B,wEAA+B,CAAA;IAC/B,8HAAqF,CAAA;AACvF,CAAC,EAPW,qCAAqC,KAArC,qCAAqC,QAOhD;AAED,wFAAwF;AACxF,MAAM,CAAN,IAAY,sBAQX;AARD,WAAY,sBAAsB;IAChC,+CAAqB,CAAA;IACrB,+CAAqB,CAAA;IACrB,+DAAqC,CAAA;IACrC,iDAAuB,CAAA;IACvB,6CAAmB,CAAA;IACnB,+CAAqB,CAAA;IACrB,+DAAqC,CAAA;AACvC,CAAC,EARW,sBAAsB,KAAtB,sBAAsB,QAQjC;AAkBD,+EAA+E;AAC/E,MAAM,UAAU,yCAAyC,CAAC,KAA4C;IACpG,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,qCAAqC,CAAC,WAAW;YACpD,OAAO,cAAc,CAAC;QACxB,KAAK,qCAAqC,CAAC,mBAAmB;YAC5D,OAAO,sBAAsB,CAAC;QAChC,KAAK,qCAAqC,CAAC,mBAAmB;YAC5D,OAAO,sBAAsB,CAAC;QAChC,KAAK,qCAAqC,CAAC,YAAY;YACrD,OAAO,eAAe,CAAC;QACzB,KAAK,qCAAqC,CAAC,aAAa;YACtD,OAAO,MAAM,CAAC;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AC;QACjE,KAAK,sBAAsB,CAAC,OAAO;YACjC,OAAO,aAAa,oBAAoB,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC;QAC1E,KAAK,sBAAsB,CAAC,QAAQ;YAClC,OAAO,aAAa,oBAAoB,CAAC,MAAM,CAAC,WAAW,CAAC,cAAc,oBAAoB,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAClH,KAAK,sBAAsB,CAAC,gBAAgB;YAC1C,OAAO,UAAU,oBAAoB,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;QAC7D,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,gBAAgB,GAAU,MAAM,CAAC;YACvC,MAAM,IAAI,KAAK,CAAC,qCAAqC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;QAC3F,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,oBAAoB,CAAC,KAAa;IACzC,IAAI,OAAe,CAAC;IACpB,IAAI,CAAC;QACH,OAAO,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,8DAA8D,KAAK,GAAG,CAAC,CAAC;IAC1F,CAAC;IACD,MAAM,UAAU,GAAG,OAAO;SACvB,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC;SACtC,OAAO,CAAC,uBAAuB,EAAE,OAAO,CAAC;SACzC,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC;SACxB,WAAW,EAAE,CAAC;IACjB,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CAAC,8DAA8D,KAAK,GAAG,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["/**\n * Public API-reference targets and fragments.\n *\n * Source documentation refers to semantic API identities; the generated\n * reference resolves those identities into these readable public fragments.\n * Do not use OpenAPI array positions, encoded internal refs, or a hand-built\n * URL as a cross-document target: each of those changes for reasons unrelated\n * to the consumer contract.\n */\n\n/** Stable portal roots owned by the application-consumer documentation product. */\nexport enum ApplicationConsumerDocumentationRoute {\n GET_STARTED = 'GET_STARTED',\n ACCESS_AND_IDENTITY = 'ACCESS_AND_IDENTITY',\n USER_ADMINISTRATION = 'USER_ADMINISTRATION',\n INTEGRATIONS = 'INTEGRATIONS',\n API_REFERENCE = 'API_REFERENCE',\n APPLICATION_ADMINISTRATION_API_REFERENCE = 'APPLICATION_ADMINISTRATION_API_REFERENCE',\n}\n\n/** The public contract part a documentation link can target inside an API reference. */\nexport enum ApiReferenceTargetKind {\n CATEGORY = 'CATEGORY',\n RESOURCE = 'RESOURCE',\n OPERATION_FAMILY = 'OPERATION_FAMILY',\n OPERATION = 'OPERATION',\n REQUEST = 'REQUEST',\n RESPONSE = 'RESPONSE',\n COMPONENT_SCHEMA = 'COMPONENT_SCHEMA',\n}\n\n/**\n * Readable identity material used only to construct a public fragment.\n *\n * A later generated link index maps canonical `x-wildo` identities to this\n * shape. Keeping the public shape separate stops an internal namespaced ref\n * from leaking into copied URLs while retaining an exact resolver boundary.\n */\nexport type ApiReferencePublicTarget =\n | { readonly kind: ApiReferenceTargetKind.CATEGORY; readonly categoryName: string }\n | { readonly kind: ApiReferenceTargetKind.RESOURCE; readonly resourceName: string }\n | { readonly kind: ApiReferenceTargetKind.OPERATION_FAMILY; readonly resourceName: string; readonly operationName: string }\n | { readonly kind: ApiReferenceTargetKind.OPERATION; readonly operationId: string }\n | { readonly kind: ApiReferenceTargetKind.REQUEST; readonly operationId: string }\n | { readonly kind: ApiReferenceTargetKind.RESPONSE; readonly operationId: string; readonly status: string }\n | { readonly kind: ApiReferenceTargetKind.COMPONENT_SCHEMA; readonly schemaName: string };\n\n/** Resolves a stable, human-readable route path for a built-in portal root. */\nexport function applicationConsumerDocumentationRoutePath(route: ApplicationConsumerDocumentationRoute): string {\n switch (route) {\n case ApplicationConsumerDocumentationRoute.GET_STARTED:\n return '/get-started';\n case ApplicationConsumerDocumentationRoute.ACCESS_AND_IDENTITY:\n return '/access-and-identity';\n case ApplicationConsumerDocumentationRoute.USER_ADMINISTRATION:\n return '/user-administration';\n case ApplicationConsumerDocumentationRoute.INTEGRATIONS:\n return '/integrations';\n case ApplicationConsumerDocumentationRoute.API_REFERENCE:\n return '/api';\n case ApplicationConsumerDocumentationRoute.APPLICATION_ADMINISTRATION_API_REFERENCE:\n return '/api/application-administration';\n default: {\n const exhaustiveRoute: never = route;\n throw new Error(`Unsupported application-consumer documentation route: ${String(exhaustiveRoute)}`);\n }\n }\n}\n\n/**\n * Resolves a relative documentation URL suitable for prefixing with an\n * application-owned docs base URL. API contract targets are deliberately\n * confined to an API-reference root: a guide cannot silently become a second\n * endpoint-reference renderer merely by carrying an API fragment.\n */\nexport function applicationConsumerDocumentationTargetPath(\n route: ApplicationConsumerDocumentationRoute,\n target?: ApiReferencePublicTarget,\n): string {\n const routePath = applicationConsumerDocumentationRoutePath(route);\n if (target === undefined) return routePath;\n if (route !== ApplicationConsumerDocumentationRoute.API_REFERENCE\n && route !== ApplicationConsumerDocumentationRoute.APPLICATION_ADMINISTRATION_API_REFERENCE) {\n throw new Error(`Documentation route '${route}' cannot target an API-reference contract`);\n }\n return `${routePath}#${apiReferenceTargetFragment(target)}`;\n}\n\n/** Produces a readable fragment for one API-reference contract target. */\nexport function apiReferenceTargetFragment(target: ApiReferencePublicTarget): string {\n switch (target.kind) {\n case ApiReferenceTargetKind.CATEGORY:\n return `category-${readableFragmentPart(target.categoryName)}`;\n case ApiReferenceTargetKind.RESOURCE:\n return `resource-${readableFragmentPart(target.resourceName)}`;\n case ApiReferenceTargetKind.OPERATION_FAMILY:\n return `resource-${readableFragmentPart(target.resourceName)}--operation-${readableFragmentPart(target.operationName)}`;\n case ApiReferenceTargetKind.OPERATION:\n return `operation-${readableFragmentPart(target.operationId)}`;\n case ApiReferenceTargetKind.REQUEST:\n return `operation-${readableFragmentPart(target.operationId)}--request`;\n case ApiReferenceTargetKind.RESPONSE:\n return `operation-${readableFragmentPart(target.operationId)}--response-${readableFragmentPart(target.status)}`;\n case ApiReferenceTargetKind.COMPONENT_SCHEMA:\n return `schema-${readableFragmentPart(target.schemaName)}`;\n default: {\n const exhaustiveTarget: never = target;\n throw new Error(`Unsupported API-reference target: ${JSON.stringify(exhaustiveTarget)}`);\n }\n }\n}\n\n/**\n * Converts a declared identifier to public URL vocabulary without silently\n * accepting arbitrary punctuation. The generated model separately rejects\n * collisions, so this readable form never needs an opaque digest suffix.\n */\nfunction readableFragmentPart(value: string): string {\n let decoded: string;\n try {\n decoded = decodeURIComponent(value);\n } catch {\n throw new Error(`API-reference public fragment cannot represent identifier '${value}'`);\n }\n const normalized = decoded\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2')\n .replace(/[:_\\s]+/g, '-')\n .toLowerCase();\n if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(normalized)) {\n throw new Error(`API-reference public fragment cannot represent identifier '${value}'`);\n }\n return normalized;\n}\n"]}
1
+ {"version":3,"file":"api-reference-targets.js","sourceRoot":"","sources":["../../../../src/openapi/api-reference-targets.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,mFAAmF;AACnF,MAAM,CAAN,IAAY,qCAOX;AAPD,WAAY,qCAAqC;IAC/C,oEAA2B,CAAA;IAC3B,oFAA2C,CAAA;IAC3C,oFAA2C,CAAA;IAC3C,sEAA6B,CAAA;IAC7B,wEAA+B,CAAA;IAC/B,8HAAqF,CAAA;AACvF,CAAC,EAPW,qCAAqC,KAArC,qCAAqC,QAOhD;AAED,wFAAwF;AACxF,MAAM,CAAN,IAAY,sBAQX;AARD,WAAY,sBAAsB;IAChC,+CAAqB,CAAA;IACrB,+CAAqB,CAAA;IACrB,+DAAqC,CAAA;IACrC,iDAAuB,CAAA;IACvB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AI,CAAC;QACH,OAAO,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,8DAA8D,KAAK,GAAG,CAAC,CAAC;IAC1F,CAAC;IACD,MAAM,UAAU,GAAG,OAAO;SACvB,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC;SACtC,OAAO,CAAC,uBAAuB,EAAE,OAAO,CAAC;SACzC,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC;SACxB,WAAW,EAAE,CAAC;IACjB,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CAAC,8DAA8D,KAAK,GAAG,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["/**\n * Public API-reference targets and fragments.\n *\n * Source documentation refers to semantic API identities; the generated\n * reference resolves those identities into these readable public fragments.\n * Do not use OpenAPI array positions, encoded internal refs, or a hand-built\n * URL as a cross-document target: each of those changes for reasons unrelated\n * to the consumer contract.\n */\n\n/** Stable portal roots owned by the application-consumer documentation product. */\nexport enum ApplicationConsumerDocumentationRoute {\n GET_STARTED = 'GET_STARTED',\n ACCESS_AND_IDENTITY = 'ACCESS_AND_IDENTITY',\n USER_ADMINISTRATION = 'USER_ADMINISTRATION',\n INTEGRATIONS = 'INTEGRATIONS',\n API_REFERENCE = 'API_REFERENCE',\n APPLICATION_ADMINISTRATION_API_REFERENCE = 'APPLICATION_ADMINISTRATION_API_REFERENCE',\n}\n\n/** The public contract part a documentation link can target inside an API reference. */\nexport enum ApiReferenceTargetKind {\n CATEGORY = 'CATEGORY',\n RESOURCE = 'RESOURCE',\n OPERATION_FAMILY = 'OPERATION_FAMILY',\n OPERATION = 'OPERATION',\n REQUEST = 'REQUEST',\n RESPONSE = 'RESPONSE',\n COMPONENT_SCHEMA = 'COMPONENT_SCHEMA',\n}\n\n/**\n * Readable identity material used only to construct a public fragment.\n *\n * A later generated link index maps canonical `x-wildo` identities to this\n * shape. Keeping the public shape separate stops an internal namespaced ref\n * from leaking into copied URLs while retaining an exact resolver boundary.\n */\nexport type ApiReferencePublicTarget =\n | { readonly kind: ApiReferenceTargetKind.CATEGORY; readonly categoryName: string }\n | { readonly kind: ApiReferenceTargetKind.RESOURCE; readonly resourceName: string }\n | { readonly kind: ApiReferenceTargetKind.OPERATION_FAMILY; readonly resourceName: string; readonly operationName: string }\n | { readonly kind: ApiReferenceTargetKind.OPERATION; readonly operationId: string }\n | { readonly kind: ApiReferenceTargetKind.REQUEST; readonly operationId: string }\n | { readonly kind: ApiReferenceTargetKind.RESPONSE; readonly operationId: string; readonly status: string }\n | { readonly kind: ApiReferenceTargetKind.COMPONENT_SCHEMA; readonly schemaName: string };\n\n/** Resolves a stable, human-readable route path for a built-in portal root. */\nexport function applicationConsumerDocumentationRoutePath(route: ApplicationConsumerDocumentationRoute): string {\n switch (route) {\n case ApplicationConsumerDocumentationRoute.GET_STARTED:\n return '/get-started';\n case ApplicationConsumerDocumentationRoute.ACCESS_AND_IDENTITY:\n return '/access-and-identity';\n case ApplicationConsumerDocumentationRoute.USER_ADMINISTRATION:\n return '/user-administration';\n case ApplicationConsumerDocumentationRoute.INTEGRATIONS:\n return '/integrations';\n case ApplicationConsumerDocumentationRoute.API_REFERENCE:\n return '/api';\n case ApplicationConsumerDocumentationRoute.APPLICATION_ADMINISTRATION_API_REFERENCE:\n return '/api/application-administration';\n default: {\n const exhaustiveRoute: never = route;\n throw new Error(`Unsupported application-consumer documentation route: ${String(exhaustiveRoute)}`);\n }\n }\n}\n\n/**\n * Resolves a relative documentation URL suitable for prefixing with an\n * application-owned docs base URL. API contract targets are deliberately\n * confined to an API-reference root: a guide cannot silently become a second\n * endpoint-reference renderer merely by carrying an API fragment.\n */\nexport function applicationConsumerDocumentationTargetPath(\n route: ApplicationConsumerDocumentationRoute,\n target?: ApiReferencePublicTarget,\n): string {\n const routePath = applicationConsumerDocumentationRoutePath(route);\n if (target === undefined) return routePath;\n if (route !== ApplicationConsumerDocumentationRoute.API_REFERENCE\n && route !== ApplicationConsumerDocumentationRoute.APPLICATION_ADMINISTRATION_API_REFERENCE) {\n throw new Error(`Documentation route '${route}' cannot target an API-reference contract`);\n }\n return `${routePath}#${apiReferenceTargetFragment(target)}`;\n}\n\n/** Produces a readable fragment for one API-reference contract target. */\nexport function apiReferenceTargetFragment(target: ApiReferencePublicTarget): string {\n switch (target.kind) {\n case ApiReferenceTargetKind.CATEGORY:\n return `category-${readableFragmentPart(target.categoryName)}`;\n case ApiReferenceTargetKind.RESOURCE:\n return `resource-${readableFragmentPart(target.resourceName)}`;\n case ApiReferenceTargetKind.OPERATION_FAMILY:\n return `resource-${readableFragmentPart(target.resourceName)}--operation-${readableFragmentPart(target.operationName)}`;\n case ApiReferenceTargetKind.OPERATION:\n return `operation-${readableFragmentPart(target.operationId)}`;\n case ApiReferenceTargetKind.REQUEST:\n return `operation-${readableFragmentPart(target.operationId)}--request`;\n case ApiReferenceTargetKind.RESPONSE:\n return `operation-${readableFragmentPart(target.operationId)}--response-${readableFragmentPart(target.status)}`;\n case ApiReferenceTargetKind.COMPONENT_SCHEMA:\n return `schema-${readableFragmentPart(target.schemaName)}`;\n default: {\n const exhaustiveTarget: never = target;\n throw new Error(`Unsupported API-reference target: ${JSON.stringify(exhaustiveTarget)}`);\n }\n }\n}\n\n/**\n * Converts a declared identifier to public URL vocabulary without silently\n * accepting arbitrary punctuation. The generated model separately rejects\n * collisions, so this readable form never needs an opaque digest suffix.\n */\n/**\n * The path segment of a resource's own API-reference page (`/api/<slug>`), #1623. It is the readable\n * part of the resource's fragment (`resource-<slug>`), so a page and the anchor that used to address\n * the same resource on the single-page reference can never name it differently.\n */\nexport function apiReferenceResourcePageSlug(resourceName: string): string {\n return readableFragmentPart(resourceName);\n}\n\nfunction readableFragmentPart(value: string): string {\n let decoded: string;\n try {\n decoded = decodeURIComponent(value);\n } catch {\n throw new Error(`API-reference public fragment cannot represent identifier '${value}'`);\n }\n const normalized = decoded\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2')\n .replace(/[:_\\s]+/g, '-')\n .toLowerCase();\n if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(normalized)) {\n throw new Error(`API-reference public fragment cannot represent identifier '${value}'`);\n }\n return normalized;\n}\n"]}
@@ -17,4 +17,6 @@
17
17
  export * from './openapi-generation-output.schemas';
18
18
  export * from './api-reference-targets';
19
19
  export * from './api-reference-link-index';
20
+ export * from './api-reference-pages';
21
+ export * from './api-reference-search';
20
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/openapi/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,qCAAqC,CAAC;AACpD,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/openapi/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,qCAAqC,CAAC;AACpD,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC"}
@@ -17,4 +17,6 @@
17
17
  export * from './openapi-generation-output.schemas.js';
18
18
  export * from './api-reference-targets.js';
19
19
  export * from './api-reference-link-index.js';
20
+ export * from './api-reference-pages.js';
21
+ export * from './api-reference-search.js';
20
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/openapi/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,qCAAqC,CAAC;AACpD,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC","sourcesContent":["/**\n * `@wildo-ai/saas-technical-doc` — OpenAPI generation surface.\n *\n * Schemas describing the output of the companion's OpenAPI generation route\n * (saas-technical-doc.md Steps 3 & 4). The generator IMPLEMENTATION lives\n * under `../companion/` and is re-exported via the package's `./companion`\n * subpath export. This sub-tree only ships the type-level contract so it is\n * safely consumable from:\n * - the companion (Node) — to populate the response shape;\n * - the docs site (browser, build-time) — to import the canonical output\n * filenames so the Docusaurus plugin config stays in lockstep;\n * - any CI tooling that needs to inspect a generated artefact.\n *\n * @wildo-boundary\n * No React, no `react-dom`, no Node `fs`/`path` imports. Pure schemas.\n */\n\nexport * from './openapi-generation-output.schemas';\nexport * from './api-reference-targets';\nexport * from './api-reference-link-index';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/openapi/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,qCAAqC,CAAC;AACpD,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC","sourcesContent":["/**\n * `@wildo-ai/saas-technical-doc` — OpenAPI generation surface.\n *\n * Schemas describing the output of the companion's OpenAPI generation route\n * (saas-technical-doc.md Steps 3 & 4). The generator IMPLEMENTATION lives\n * under `../companion/` and is re-exported via the package's `./companion`\n * subpath export. This sub-tree only ships the type-level contract so it is\n * safely consumable from:\n * - the companion (Node) — to populate the response shape;\n * - the docs site (browser, build-time) — to import the canonical output\n * filenames so the Docusaurus plugin config stays in lockstep;\n * - any CI tooling that needs to inspect a generated artefact.\n *\n * @wildo-boundary\n * No React, no `react-dom`, no Node `fs`/`path` imports. Pure schemas.\n */\n\nexport * from './openapi-generation-output.schemas';\nexport * from './api-reference-targets';\nexport * from './api-reference-link-index';\nexport * from './api-reference-pages';\nexport * from './api-reference-search';\n"]}
@@ -6,5 +6,7 @@
6
6
  * React/auth runtime barrel. Docusaurus may consume the same projection.
7
7
  */
8
8
  export * from './runtime/openapi-reference-model';
9
+ export * from './runtime/openapi-reference-navigation';
9
10
  export * from './runtime/openapi-reference-conservation';
11
+ export * from './openapi/api-reference-pages';
10
12
  //# sourceMappingURL=openapi-reference-model.exports.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"openapi-reference-model.exports.d.ts","sourceRoot":"","sources":["../../../src/openapi-reference-model.exports.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,mCAAmC,CAAC;AAClD,cAAc,0CAA0C,CAAC"}
1
+ {"version":3,"file":"openapi-reference-model.exports.d.ts","sourceRoot":"","sources":["../../../src/openapi-reference-model.exports.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,mCAAmC,CAAC;AAClD,cAAc,wCAAwC,CAAC;AACvD,cAAc,0CAA0C,CAAC;AACzD,cAAc,+BAA+B,CAAC"}
@@ -6,5 +6,7 @@
6
6
  * React/auth runtime barrel. Docusaurus may consume the same projection.
7
7
  */
8
8
  export * from './runtime/openapi-reference-model.js';
9
+ export * from './runtime/openapi-reference-navigation.js';
9
10
  export * from './runtime/openapi-reference-conservation.js';
11
+ export * from './openapi/api-reference-pages.js';
10
12
  //# sourceMappingURL=openapi-reference-model.exports.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"openapi-reference-model.exports.js","sourceRoot":"","sources":["../../../src/openapi-reference-model.exports.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,mCAAmC,CAAC;AAClD,cAAc,0CAA0C,CAAC","sourcesContent":["/**\n * Browser-safe and Node-safe OpenAPI reference-model entrypoint.\n *\n * Managed publication uses this narrow subpath to verify that the native\n * renderer conserves the generated OpenAPI inventory without importing the\n * React/auth runtime barrel. Docusaurus may consume the same projection.\n */\n\nexport * from './runtime/openapi-reference-model';\nexport * from './runtime/openapi-reference-conservation';\n"]}
1
+ {"version":3,"file":"openapi-reference-model.exports.js","sourceRoot":"","sources":["../../../src/openapi-reference-model.exports.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,mCAAmC,CAAC;AAClD,cAAc,wCAAwC,CAAC;AACvD,cAAc,0CAA0C,CAAC;AACzD,cAAc,+BAA+B,CAAC","sourcesContent":["/**\n * Browser-safe and Node-safe OpenAPI reference-model entrypoint.\n *\n * Managed publication uses this narrow subpath to verify that the native\n * renderer conserves the generated OpenAPI inventory without importing the\n * React/auth runtime barrel. Docusaurus may consume the same projection.\n */\n\nexport * from './runtime/openapi-reference-model';\nexport * from './runtime/openapi-reference-navigation';\nexport * from './runtime/openapi-reference-conservation';\nexport * from './openapi/api-reference-pages';\n"]}
@@ -1,4 +1,38 @@
1
1
  import { type FC, type ReactNode } from 'react';
2
+ import { type DocumentationSiteTranslator } from './documentation-site-translator';
3
+ /**
4
+ * Every word the default hand-off page shows a reader (#1992). The runtime has no label pack; the site
5
+ * words them through its translator (see {@link createAuthExchangeWords}), so an untranslated one shows
6
+ * its id rather than English.
7
+ */
8
+ export interface AuthExchangeWords {
9
+ readonly signingIn: string;
10
+ readonly signingInDetail: string;
11
+ readonly signedIn: string;
12
+ readonly redirectingTo: (returnPath: string) => string;
13
+ readonly missingCode: string;
14
+ readonly missingCodeDetail: string;
15
+ readonly goToDocsHome: string;
16
+ readonly signInFailed: string;
17
+ /** The link was refused: expired, already used, or never valid. */
18
+ readonly linkRefused: string;
19
+ /** The exchange could not complete: the application did not answer, or answered with an error. */
20
+ readonly exchangeFailed: string;
21
+ }
22
+ /** The prefix every hand-off page word's id carries in the site's `code.json`. */
23
+ export declare const AUTH_EXCHANGE_WORD_ID_PREFIX = "docs.authExchange.";
24
+ /** The hand-off page's words through the site's translator: each member reads `docs.authExchange.<member>`. */
25
+ export declare function createAuthExchangeWords({ translate }: Pick<DocumentationSiteTranslator, 'translate'>): AuthExchangeWords;
26
+ /**
27
+ * Why a hand-off did not sign the reader in — decides which word the page shows. The technical cause
28
+ * stays in `error` for a `render` consumer and for logs; it is not a sentence for a reader.
29
+ */
30
+ export declare enum AuthExchangeFailure {
31
+ /** The application answered, and refused the code: expired, already used, or never valid. */
32
+ LINK_REFUSED = "link_refused",
33
+ /** The exchange did not complete: no answer, or an error answer. */
34
+ EXCHANGE_FAILED = "exchange_failed"
35
+ }
2
36
  /**
3
37
  * Status of the auth-code exchange the page is performing.
4
38
  *
@@ -35,25 +69,32 @@ export type AuthExchangeStatus = 'pending' | 'exchanging' | 'success' | 'error'
35
69
  * and a stray re-mount in React 18 strict-mode dev would burn the
36
70
  * code with the second call returning `invalid_or_expired_code`.
37
71
  *
38
- * Visual layer: this component renders a minimal centered "Signing you
39
- * in…" / error block. Apps that want to brand it can either pass a
72
+ * Visual layer: this component renders a minimal centered status block
73
+ * in the words the site passes as `words` (#1992). Apps that want to brand it can either pass a
40
74
  * `render` prop (consumer-controlled UI for each status) or skip this
41
75
  * component entirely and call `useDocsAuthSession().beginExchange(code)`
42
76
  * from their own page. The default rendering deliberately uses inline
43
77
  * styles (no Tailwind / no CSS imports) so the component can be mounted
44
78
  * by any Docusaurus theme without dragging in extra build pipeline.
45
79
  */
46
- export declare const AuthExchangePage: FC<{
80
+ export declare const AuthExchangePage: FC<({
47
81
  /**
48
82
  * Override the default rendering. Receives the current status and (when
49
83
  * the page reaches a terminal state) a recovery URL the consumer can
50
84
  * link back to.
51
85
  */
52
- render?: (props: {
86
+ render: (props: {
53
87
  status: AuthExchangeStatus;
54
88
  returnPath: string;
55
89
  error: string | null;
90
+ failure: AuthExchangeFailure | null;
56
91
  }) => ReactNode;
92
+ words?: undefined;
93
+ } | {
94
+ render?: undefined;
95
+ /** The default rendering's words, worded by the site (#1992). Required unless `render` replaces it. */
96
+ words: AuthExchangeWords;
97
+ }) & {
57
98
  /**
58
99
  * Post-success navigation. **SPA hosts (Docusaurus, react-router,
59
100
  * Vite/React-Router apps) MUST pass a client-side router push** — the
@@ -1 +1 @@
1
- {"version":3,"file":"AuthExchangePage.d.ts","sourceRoot":"","sources":["../../../../src/runtime/AuthEx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"react/jsx-run
2
2
  import { useEffect, useRef, useState } from 'react';
3
3
  import { isSameOriginRedirectPath } from '@wildo-ai/saas-models/public-runtime';
4
4
  import { useDocsAuthSession } from './use-docs-auth-session.js';
5
+ import { fillMessage } from './documentation-site-translator.js';
6
+ /** The prefix every hand-off page word's id carries in the site's `code.json`. */
7
+ export const AUTH_EXCHANGE_WORD_ID_PREFIX = 'docs.authExchange.';
8
+ /** The hand-off page's words through the site's translator: each member reads `docs.authExchange.<member>`. */
9
+ export function createAuthExchangeWords({ translate }) {
10
+ const word = (member, values = {}) => fillMessage(translate(`${AUTH_EXCHANGE_WORD_ID_PREFIX}${member}`), values);
11
+ return {
12
+ signingIn: word('signingIn'),
13
+ signingInDetail: word('signingInDetail'),
14
+ signedIn: word('signedIn'),
15
+ redirectingTo: (returnPath) => word('redirectingTo', { path: returnPath }),
16
+ missingCode: word('missingCode'),
17
+ missingCodeDetail: word('missingCodeDetail'),
18
+ goToDocsHome: word('goToDocsHome'),
19
+ signInFailed: word('signInFailed'),
20
+ linkRefused: word('linkRefused'),
21
+ exchangeFailed: word('exchangeFailed'),
22
+ };
23
+ }
24
+ /**
25
+ * Why a hand-off did not sign the reader in — decides which word the page shows. The technical cause
26
+ * stays in `error` for a `render` consumer and for logs; it is not a sentence for a reader.
27
+ */
28
+ export var AuthExchangeFailure;
29
+ (function (AuthExchangeFailure) {
30
+ /** The application answered, and refused the code: expired, already used, or never valid. */
31
+ AuthExchangeFailure["LINK_REFUSED"] = "link_refused";
32
+ /** The exchange did not complete: no answer, or an error answer. */
33
+ AuthExchangeFailure["EXCHANGE_FAILED"] = "exchange_failed";
34
+ })(AuthExchangeFailure || (AuthExchangeFailure = {}));
5
35
  /**
6
36
  * Page component mounted at `/auth/exchange` on the docs site
7
37
  * (saas-technical-doc.md Step 5).
@@ -26,18 +56,19 @@ import { useDocsAuthSession } from './use-docs-auth-session.js';
26
56
  * and a stray re-mount in React 18 strict-mode dev would burn the
27
57
  * code with the second call returning `invalid_or_expired_code`.
28
58
  *
29
- * Visual layer: this component renders a minimal centered "Signing you
30
- * in…" / error block. Apps that want to brand it can either pass a
59
+ * Visual layer: this component renders a minimal centered status block
60
+ * in the words the site passes as `words` (#1992). Apps that want to brand it can either pass a
31
61
  * `render` prop (consumer-controlled UI for each status) or skip this
32
62
  * component entirely and call `useDocsAuthSession().beginExchange(code)`
33
63
  * from their own page. The default rendering deliberately uses inline
34
64
  * styles (no Tailwind / no CSS imports) so the component can be mounted
35
65
  * by any Docusaurus theme without dragging in extra build pipeline.
36
66
  */
37
- export const AuthExchangePage = ({ render, onSuccessNavigate }) => {
67
+ export const AuthExchangePage = ({ render, words, onSuccessNavigate }) => {
38
68
  const { beginExchange } = useDocsAuthSession();
39
69
  const [status, setStatus] = useState('pending');
40
70
  const [error, setError] = useState(null);
71
+ const [failure, setFailure] = useState(null);
41
72
  const [returnPath, setReturnPath] = useState('/');
42
73
  const hasRunRef = useRef(false);
43
74
  useEffect(() => {
@@ -94,7 +125,8 @@ export const AuthExchangePage = ({ render, onSuccessNavigate }) => {
94
125
  : urlSafeReturn;
95
126
  setReturnPath(safeReturn);
96
127
  if (claims === null) {
97
- setError('This sign-in link could not be exchanged. It may have expired or already been used. Please re-open the docs from the application.');
128
+ setError('The exchange returned no session claims: the code was refused.');
129
+ setFailure(AuthExchangeFailure.LINK_REFUSED);
98
130
  setStatus('error');
99
131
  return;
100
132
  }
@@ -111,13 +143,14 @@ export const AuthExchangePage = ({ render, onSuccessNavigate }) => {
111
143
  }, 0);
112
144
  })
113
145
  .catch((cause) => {
114
- setError(cause instanceof Error ? cause.message : 'Sign-in failed');
146
+ setError(cause instanceof Error ? cause.message : String(cause));
147
+ setFailure(AuthExchangeFailure.EXCHANGE_FAILED);
115
148
  setStatus('error');
116
149
  });
117
150
  }, [beginExchange, onSuccessNavigate]);
118
151
  if (render)
119
- return _jsx(_Fragment, { children: render({ status, returnPath, error }) });
120
- return _jsx(DefaultExchangeUi, { status: status, returnPath: returnPath, error: error });
152
+ return _jsx(_Fragment, { children: render({ status, returnPath, error, failure }) });
153
+ return _jsx(DefaultExchangeUi, { status: status, returnPath: returnPath, failure: failure, words: words });
121
154
  };
122
155
  /**
123
156
  * Minimal client-side validation of the `return` query parameter.
@@ -166,7 +199,7 @@ function sanitizeReturnPath(raw) {
166
199
  * Default zero-style status block. Apps that brand the docs site override
167
200
  * this via the `render` prop on `<AuthExchangePage>`.
168
201
  */
169
- const DefaultExchangeUi = ({ status, returnPath, error }) => {
202
+ const DefaultExchangeUi = ({ status, returnPath, failure, words }) => {
170
203
  const containerStyle = {
171
204
  maxWidth: 480,
172
205
  margin: '6rem auto',
@@ -175,14 +208,14 @@ const DefaultExchangeUi = ({ status, returnPath, error }) => {
175
208
  textAlign: 'center',
176
209
  };
177
210
  if (status === 'pending' || status === 'exchanging') {
178
- return (_jsxs("div", { style: containerStyle, children: [_jsx("h1", { style: { fontSize: '1.25rem' }, children: "Signing you in\u2026" }), _jsx("p", { style: { color: '#666' }, children: "This will only take a moment." })] }));
211
+ return (_jsxs("div", { style: containerStyle, children: [_jsx("h1", { style: { fontSize: '1.25rem' }, children: words.signingIn }), _jsx("p", { style: { color: '#666' }, children: words.signingInDetail })] }));
179
212
  }
180
213
  if (status === 'success') {
181
- return (_jsxs("div", { style: containerStyle, children: [_jsx("h1", { style: { fontSize: '1.25rem' }, children: "You're signed in." }), _jsxs("p", { style: { color: '#666' }, children: ["Redirecting to ", returnPath, "\u2026"] })] }));
214
+ return (_jsxs("div", { style: containerStyle, children: [_jsx("h1", { style: { fontSize: '1.25rem' }, children: words.signedIn }), _jsx("p", { style: { color: '#666' }, children: words.redirectingTo(returnPath) })] }));
182
215
  }
183
216
  if (status === 'missingCode') {
184
- return (_jsxs("div", { style: containerStyle, children: [_jsx("h1", { style: { fontSize: '1.25rem' }, children: "This page requires a sign-in code." }), _jsx("p", { style: { color: '#666' }, children: "Please open the documentation from the application." }), _jsx("p", { children: _jsx("a", { href: "/", children: "Go to docs home" }) })] }));
217
+ return (_jsxs("div", { style: containerStyle, children: [_jsx("h1", { style: { fontSize: '1.25rem' }, children: words.missingCode }), _jsx("p", { style: { color: '#666' }, children: words.missingCodeDetail }), _jsx("p", { children: _jsx("a", { href: "/", children: words.goToDocsHome }) })] }));
185
218
  }
186
- return (_jsxs("div", { style: containerStyle, children: [_jsx("h1", { style: { fontSize: '1.25rem' }, children: "Sign-in failed" }), _jsx("p", { style: { color: '#666' }, children: error ?? 'Unknown error.' }), _jsx("p", { children: _jsx("a", { href: "/", children: "Go to docs home" }) })] }));
219
+ return (_jsxs("div", { style: containerStyle, children: [_jsx("h1", { style: { fontSize: '1.25rem' }, children: words.signInFailed }), _jsx("p", { style: { color: '#666' }, children: failure === AuthExchangeFailure.LINK_REFUSED ? words.linkRefused : words.exchangeFailed }), _jsx("p", { children: _jsx("a", { href: "/", children: words.goToDocsHome }) })] }));
187
220
  };
188
221
  //# sourceMappingURL=AuthExchangePage.js.map