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

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 (156) hide show
  1. package/dist/esm/build/csp-emit.d.ts.map +1 -1
  2. package/dist/esm/build/load-materialized-frontend-providers.d.ts.map +1 -1
  3. package/dist/esm/companion/application-documentation/application-authentication-documentation.d.ts.map +1 -1
  4. package/dist/esm/companion/application-documentation/application-connection-documentation.d.ts.map +1 -1
  5. package/dist/esm/companion/application-documentation/application-documentation-chapters.d.ts.map +1 -1
  6. package/dist/esm/companion/application-documentation/application-organization-role-documentation.d.ts.map +1 -1
  7. package/dist/esm/companion/application-documentation/application-organization-unit-resource-documentation.d.ts.map +1 -1
  8. package/dist/esm/companion/application-documentation/docs-api-origin-substitution.d.ts.map +1 -1
  9. package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.d.ts.map +1 -1
  10. package/dist/esm/companion/application-documentation/technical-documentation-operational-evidence.d.ts.map +1 -1
  11. package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.d.ts.map +1 -1
  12. package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.d.ts.map +1 -1
  13. package/dist/esm/companion/content/application-consumer-documentation-content-loader.d.ts.map +1 -1
  14. package/dist/esm/companion/index.d.ts.map +1 -1
  15. package/dist/esm/companion/manual-controller-route-projection.d.ts.map +1 -1
  16. package/dist/esm/companion/openapi-example-derivation.d.ts +53 -0
  17. package/dist/esm/companion/openapi-example-derivation.d.ts.map +1 -0
  18. package/dist/esm/companion/openapi-example-derivation.js +229 -0
  19. package/dist/esm/companion/openapi-example-derivation.js.map +1 -0
  20. package/dist/esm/companion/openapi-generator.d.ts.map +1 -1
  21. package/dist/esm/companion/openapi-generator.js +284 -16
  22. package/dist/esm/companion/openapi-generator.js.map +1 -1
  23. package/dist/esm/companion/operation-projection.schemas.d.ts +36 -0
  24. package/dist/esm/companion/operation-projection.schemas.d.ts.map +1 -1
  25. package/dist/esm/companion/operation-projection.schemas.js +18 -0
  26. package/dist/esm/companion/operation-projection.schemas.js.map +1 -1
  27. package/dist/esm/companion/publish-result.types.d.ts.map +1 -1
  28. package/dist/esm/companion/rendering/technical-documentation-authorized-bundle-reader.d.ts.map +1 -1
  29. package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.d.ts.map +1 -1
  30. package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.d.ts.map +1 -1
  31. package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.js +20 -0
  32. package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.js.map +1 -1
  33. package/dist/esm/companion/rendering/technical-documentation-markdown-links.d.ts.map +1 -1
  34. package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.d.ts +2 -0
  35. package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.d.ts.map +1 -1
  36. package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.js +48 -31
  37. package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.js.map +1 -1
  38. package/dist/esm/companion/rendering/technical-documentation-render-model.d.ts.map +1 -1
  39. package/dist/esm/companion/rendering/technical-documentation-search-index-renderer.d.ts.map +1 -1
  40. package/dist/esm/companion/spec-to-operation-doc.d.ts +52 -10
  41. package/dist/esm/companion/spec-to-operation-doc.d.ts.map +1 -1
  42. package/dist/esm/companion/spec-to-operation-doc.js +125 -7
  43. package/dist/esm/companion/spec-to-operation-doc.js.map +1 -1
  44. package/dist/esm/companion/technical-documentation-asset-path.d.ts.map +1 -1
  45. package/dist/esm/companion/technical-documentation-capture-execution-port.d.ts.map +1 -1
  46. package/dist/esm/companion/technical-documentation-diagram-definitions.d.ts.map +1 -1
  47. package/dist/esm/companion/technical-documentation-diagram-materializer.d.ts.map +1 -1
  48. package/dist/esm/companion/technical-documentation-placeholder-materializer.d.ts.map +1 -1
  49. package/dist/esm/companion/zod-to-openapi.d.ts.map +1 -1
  50. package/dist/esm/companion-exports.d.ts.map +1 -1
  51. package/dist/esm/config/define-tech-doc-config.d.ts.map +1 -1
  52. package/dist/esm/config/index.d.ts.map +1 -1
  53. package/dist/esm/config/wildo-tech-doc-config.schemas.d.ts.map +1 -1
  54. package/dist/esm/content/application-consumer-documentation-content-manifest.schemas.d.ts.map +1 -1
  55. package/dist/esm/content/application-consumer-documentation-content.techdoc.d.ts +10 -10
  56. package/dist/esm/content/application-consumer-documentation-content.techdoc.d.ts.map +1 -1
  57. package/dist/esm/content/application-consumer-documentation-content.techdoc.js +43 -28
  58. package/dist/esm/content/application-consumer-documentation-content.techdoc.js.map +1 -1
  59. package/dist/esm/content.exports.d.ts.map +1 -1
  60. package/dist/esm/index.d.ts.map +1 -1
  61. package/dist/esm/openapi/api-reference-link-index.d.ts +3 -0
  62. package/dist/esm/openapi/api-reference-link-index.d.ts.map +1 -1
  63. package/dist/esm/openapi/api-reference-link-index.js +26 -15
  64. package/dist/esm/openapi/api-reference-link-index.js.map +1 -1
  65. package/dist/esm/openapi/api-reference-pages.d.ts +55 -0
  66. package/dist/esm/openapi/api-reference-pages.d.ts.map +1 -0
  67. package/dist/esm/openapi/api-reference-pages.js +229 -0
  68. package/dist/esm/openapi/api-reference-pages.js.map +1 -0
  69. package/dist/esm/openapi/api-reference-search.d.ts +53 -0
  70. package/dist/esm/openapi/api-reference-search.d.ts.map +1 -0
  71. package/dist/esm/openapi/api-reference-search.js +100 -0
  72. package/dist/esm/openapi/api-reference-search.js.map +1 -0
  73. package/dist/esm/openapi/api-reference-targets.d.ts +11 -0
  74. package/dist/esm/openapi/api-reference-targets.d.ts.map +1 -1
  75. package/dist/esm/openapi/api-reference-targets.js +8 -0
  76. package/dist/esm/openapi/api-reference-targets.js.map +1 -1
  77. package/dist/esm/openapi/index.d.ts +2 -0
  78. package/dist/esm/openapi/index.d.ts.map +1 -1
  79. package/dist/esm/openapi/index.js +2 -0
  80. package/dist/esm/openapi/index.js.map +1 -1
  81. package/dist/esm/openapi/openapi-generation-output.schemas.d.ts.map +1 -1
  82. package/dist/esm/openapi-reference-model.exports.d.ts +2 -0
  83. package/dist/esm/openapi-reference-model.exports.d.ts.map +1 -1
  84. package/dist/esm/openapi-reference-model.exports.js +2 -0
  85. package/dist/esm/openapi-reference-model.exports.js.map +1 -1
  86. package/dist/esm/runtime/AuthExchangePage.d.ts +45 -4
  87. package/dist/esm/runtime/AuthExchangePage.d.ts.map +1 -1
  88. package/dist/esm/runtime/AuthExchangePage.js +45 -12
  89. package/dist/esm/runtime/AuthExchangePage.js.map +1 -1
  90. package/dist/esm/runtime/DocsAuthContext.d.ts.map +1 -1
  91. package/dist/esm/runtime/DocsFrontendProviders.d.ts +15 -1
  92. package/dist/esm/runtime/DocsFrontendProviders.d.ts.map +1 -1
  93. package/dist/esm/runtime/DocsFrontendProviders.js +16 -3
  94. package/dist/esm/runtime/DocsFrontendProviders.js.map +1 -1
  95. package/dist/esm/runtime/DocsProviderComponent.d.ts +41 -0
  96. package/dist/esm/runtime/DocsProviderComponent.d.ts.map +1 -0
  97. package/dist/esm/runtime/DocsProviderComponent.js +17 -0
  98. package/dist/esm/runtime/DocsProviderComponent.js.map +1 -0
  99. package/dist/esm/runtime/decode-jwt-claims.d.ts.map +1 -1
  100. package/dist/esm/runtime/docs-auth-client.d.ts.map +1 -1
  101. package/dist/esm/runtime/docs-auth-session.schemas.d.ts.map +1 -1
  102. package/dist/esm/runtime/documentation-site-translator.d.ts +53 -0
  103. package/dist/esm/runtime/documentation-site-translator.d.ts.map +1 -0
  104. package/dist/esm/runtime/documentation-site-translator.js +51 -0
  105. package/dist/esm/runtime/documentation-site-translator.js.map +1 -0
  106. package/dist/esm/runtime/frontend-provider-registry.techdoc.d.ts.map +1 -1
  107. package/dist/esm/runtime/index.d.ts +6 -0
  108. package/dist/esm/runtime/index.d.ts.map +1 -1
  109. package/dist/esm/runtime/index.js +6 -0
  110. package/dist/esm/runtime/index.js.map +1 -1
  111. package/dist/esm/runtime/openapi-reference-conservation.d.ts.map +1 -1
  112. package/dist/esm/runtime/openapi-reference-model.d.ts +25 -0
  113. package/dist/esm/runtime/openapi-reference-model.d.ts.map +1 -1
  114. package/dist/esm/runtime/openapi-reference-model.js +82 -13
  115. package/dist/esm/runtime/openapi-reference-model.js.map +1 -1
  116. package/dist/esm/runtime/openapi-reference-navigation.d.ts +50 -0
  117. package/dist/esm/runtime/openapi-reference-navigation.d.ts.map +1 -0
  118. package/dist/esm/runtime/openapi-reference-navigation.js +46 -0
  119. package/dist/esm/runtime/openapi-reference-navigation.js.map +1 -0
  120. package/dist/esm/runtime/openapi-reference-samples.d.ts +40 -0
  121. package/dist/esm/runtime/openapi-reference-samples.d.ts.map +1 -0
  122. package/dist/esm/runtime/openapi-reference-samples.js +169 -0
  123. package/dist/esm/runtime/openapi-reference-samples.js.map +1 -0
  124. package/dist/esm/runtime/openapi-reference-styles.d.ts +28 -0
  125. package/dist/esm/runtime/openapi-reference-styles.d.ts.map +1 -0
  126. package/dist/esm/runtime/openapi-reference-styles.js +292 -0
  127. package/dist/esm/runtime/openapi-reference-styles.js.map +1 -0
  128. package/dist/esm/runtime/openapi-reference-view.d.ts +40 -5
  129. package/dist/esm/runtime/openapi-reference-view.d.ts.map +1 -1
  130. package/dist/esm/runtime/openapi-reference-view.js +828 -82
  131. package/dist/esm/runtime/openapi-reference-view.js.map +1 -1
  132. package/dist/esm/runtime/openapi-reference-words-context.d.ts +12 -0
  133. package/dist/esm/runtime/openapi-reference-words-context.d.ts.map +1 -0
  134. package/dist/esm/runtime/openapi-reference-words-context.js +30 -0
  135. package/dist/esm/runtime/openapi-reference-words-context.js.map +1 -0
  136. package/dist/esm/runtime/openapi-reference-words.d.ts +205 -0
  137. package/dist/esm/runtime/openapi-reference-words.d.ts.map +1 -0
  138. package/dist/esm/runtime/openapi-reference-words.js +162 -0
  139. package/dist/esm/runtime/openapi-reference-words.js.map +1 -0
  140. package/dist/esm/runtime/provider-component-registry.techdoc.d.ts +31 -0
  141. package/dist/esm/runtime/provider-component-registry.techdoc.d.ts.map +1 -0
  142. package/dist/esm/runtime/provider-component-registry.techdoc.js +35 -0
  143. package/dist/esm/runtime/provider-component-registry.techdoc.js.map +1 -0
  144. package/dist/esm/runtime/use-docs-auth-session.d.ts.map +1 -1
  145. package/dist/esm/runtime/use-docs-frontend-provider-registry.d.ts.map +1 -1
  146. package/dist/esm/runtime/use-docs-provider-component.d.ts +29 -0
  147. package/dist/esm/runtime/use-docs-provider-component.d.ts.map +1 -0
  148. package/dist/esm/runtime/use-docs-provider-component.js +42 -0
  149. package/dist/esm/runtime/use-docs-provider-component.js.map +1 -0
  150. package/dist/esm/runtime/use-docs-provider-scripts.d.ts +12 -5
  151. package/dist/esm/runtime/use-docs-provider-scripts.d.ts.map +1 -1
  152. package/dist/esm/runtime/use-docs-provider-scripts.js +15 -8
  153. package/dist/esm/runtime/use-docs-provider-scripts.js.map +1 -1
  154. package/dist/esm/runtime/use-docs-provider-sdks.d.ts.map +1 -1
  155. package/dist/tsconfig.build.tsbuildinfo +1 -1
  156. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"AuthExchangePage.js","sourceRoot":"","sources":["../../../../src/runtime/AuthExchangePage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAA+C,MAAM,OAAO,CAAC;AACjG,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAoB7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAiCxB,CAAC,EAAE,MAAM,EAAE,iBAAiB,EAAE,EAAE,EAAE;IACrC,MAAM,EAAE,aAAa,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAE/C,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAqB,SAAS,CAAC,CAAC;IACpE,MAAM,CAAC,KAAK,EAAE,QAAQ,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,EAAE,MAAM,EAAE,oEAAyD,EACpF,sBACE,YAAG,IAAI,EAAC,GAAG,gCAAoB,GAC7B,IACA,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,eAAK,KAAK,EAAE,cAAc,aACxB,aAAI,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,+BAAqB,EACvD,YAAG,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,YAAG,KAAK,IAAI,gBAAgB,GAAK,EAC5D,sBACE,YAAG,IAAI,EAAC,GAAG,gCAAoB,GAC7B,IACA,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useEffect, useRef, useState, type CSSProperties, type FC, type ReactNode } from 'react';\nimport { isSameOriginRedirectPath } from '@wildo-ai/saas-models/public-runtime';\nimport { useDocsAuthSession } from './use-docs-auth-session';\n\n/**\n * Status of the auth-code exchange the page is performing.\n *\n * - `pending` — initial mount; effect has not yet run.\n * - `exchanging`— the `/auth/token/exchange` POST is in flight.\n * - `success` — tokens received; about to navigate to `returnPath`.\n * - `error` — exchange failed; the page renders a fallback message\n * and a manual link back to the docs root.\n * - `missingCode`— landed on `/auth/exchange` without `?code=…` (someone\n * bookmarked the page or arrived via a stale link).\n */\nexport type AuthExchangeStatus =\n | 'pending'\n | 'exchanging'\n | 'success'\n | 'error'\n | 'missingCode';\n\n/**\n * Page component mounted at `/auth/exchange` on the docs site\n * (saas-technical-doc.md Step 5).\n *\n * Lifecycle on mount:\n *\n * 1. Read `?code=` and `?return=` from `window.location.search`.\n * 2. If `code` is missing → render the missingCode UI (no network call).\n * 3. Else call `useDocsAuthSession().beginExchange(code)`, which POSTs\n * `/auth/token/exchange` and updates the in-memory context.\n * 4. On success, navigate to `returnPath` (defaults to `/`) using the\n * consumer-supplied `onSuccessNavigate` (Docusaurus / react-router\n * hosts MUST pass a client-side `history.push` — see the prop\n * docstring below for why a full reload is incorrect here).\n * 5. On failure, render the error UI with a link back to `/`.\n *\n * Why a single component (rather than splitting effect + render):\n *\n * - Keeps the exchange contract trivially auditable from one file.\n * - The effect intentionally runs ONCE per mount (`hasRunRef` guard) —\n * `code` values are single-use AUTH_CODE_EXCHANGE consumable tokens\n * and a stray re-mount in React 18 strict-mode dev would burn the\n * code with the second call returning `invalid_or_expired_code`.\n *\n * Visual layer: this component renders a minimal centered \"Signing you\n * in…\" / error block. Apps that want to brand it can either pass a\n * `render` prop (consumer-controlled UI for each status) or skip this\n * component entirely and call `useDocsAuthSession().beginExchange(code)`\n * from their own page. The default rendering deliberately uses inline\n * styles (no Tailwind / no CSS imports) so the component can be mounted\n * by any Docusaurus theme without dragging in extra build pipeline.\n */\nexport const AuthExchangePage: FC<{\n /**\n * Override the default rendering. Receives the current status and (when\n * the page reaches a terminal state) a recovery URL the consumer can\n * link back to.\n */\n render?: (props: { status: AuthExchangeStatus; returnPath: string; error: string | null }) => ReactNode;\n /**\n * Post-success navigation. **SPA hosts (Docusaurus, react-router,\n * Vite/React-Router apps) MUST pass a client-side router push** — the\n * default `window.location.assign` triggers a full browser navigation\n * which destroys the in-memory `DocsAuthProvider` state we just\n * populated (the entire JS bundle re-executes from scratch on the\n * destination page, the React tree re-mounts, and `session` resets to\n * `'anonymous'`). For a Docusaurus consumer that looks like:\n *\n * ```tsx\n * import { useHistory } from '@docusaurus/router';\n *\n * function AuthExchangeRoute() {\n * const history = useHistory();\n * return <AuthExchangePage onSuccessNavigate={(p) => history.push(p)} />;\n * }\n * ```\n *\n * The default `window.location.assign` only works for plain-HTML hosts\n * that have no in-memory client state to preserve across the redirect.\n * It is kept as the default so the runtime stays usable in those hosts\n * with zero ceremony, but for SPAs failing to override it would\n * silently break the entire handoff (the user lands on the destination\n * page anonymous and any role-gated content rejects them).\n */\n onSuccessNavigate?: (returnPath: string) => void;\n}> = ({ render, onSuccessNavigate }) => {\n const { beginExchange } = useDocsAuthSession();\n\n const [status, setStatus] = useState<AuthExchangeStatus>('pending');\n const [error, setError] = useState<string | null>(null);\n const [returnPath, setReturnPath] = useState<string>('/');\n\n const hasRunRef = useRef(false);\n\n useEffect(() => {\n if (hasRunRef.current) return;\n hasRunRef.current = true;\n\n /**\n * SSR / build-time safety: Docusaurus may evaluate page modules in\n * Node during the static build pre-render pass. `window` is undefined\n * there. Bailing out keeps the static HTML emission clean — the real\n * exchange runs on hydration in the browser.\n */\n if (typeof window === 'undefined') return;\n\n const params = new URLSearchParams(window.location.search);\n const code = params.get('code');\n /**\n * URL `?return=` is kept as a defense-in-depth fallback for codes\n * minted before the cross-app-jwt-propagation.md Step 5 metadata\n * roll-out (which carries `returnPath` inside the exchange response\n * envelope). The post-exchange `safeReturn` resolution below prefers\n * the response-borne value because the issuer signs both into the\n * same code and the response value cannot be tampered with by\n * rewriting only the URL query string.\n */\n const rawUrlReturn = params.get('return') ?? '/';\n const urlSafeReturn = sanitizeReturnPath(rawUrlReturn);\n setReturnPath(urlSafeReturn);\n\n if (!code) {\n setStatus('missingCode');\n return;\n }\n\n setStatus('exchanging');\n beginExchange(code)\n .then(({ claims, returnPath: responseReturnPath }) => {\n /**\n * Source-of-truth ordering for navigation target:\n * 1. `responseReturnPath` — issuer-supplied via the exchange\n * response's TOP-LEVEL `returnPath` field (NOT a `metadata`\n * sub-field — the response has no `metadata` envelope; see\n * `TokenExchangeResponseSchema`). Sanitized again here even\n * though the issuer already validates at minting time; an\n * attacker who can intercept the response body should not be\n * able to weaponise it.\n * 2. `urlSafeReturn` — the URL `?return=` query parameter\n * (already sanitized above). Used when codes were minted\n * without a `returnPath` (OAuth2 callbacks, by contract)\n * OR when the response otherwise omits it.\n * 3. `/` — the docs root. Final fallback so the user is never\n * stranded on `/auth/exchange`.\n */\n const safeReturn = responseReturnPath\n ? sanitizeReturnPath(responseReturnPath)\n : urlSafeReturn;\n setReturnPath(safeReturn);\n\n if (claims === null) {\n setError(\n 'This sign-in link could not be exchanged. It may have expired or already been used. Please re-open the docs from the application.',\n );\n setStatus('error');\n return;\n }\n setStatus('success');\n // Navigate AFTER the React state flush so any other consumers of\n // `useDocsAuthSession()` see the authenticated session before the\n // page disappears. The default `window.location.assign` is the\n // plain-HTML fallback; SPA hosts override via `onSuccessNavigate`\n // (see prop docstring — full reload would tear down the in-memory\n // provider state we just populated).\n const navigate =\n onSuccessNavigate ?? ((path: string) => window.location.assign(path));\n window.setTimeout(() => {\n navigate(safeReturn);\n }, 0);\n })\n .catch((cause: unknown) => {\n setError(cause instanceof Error ? cause.message : 'Sign-in failed');\n setStatus('error');\n });\n }, [beginExchange, onSuccessNavigate]);\n\n if (render) return <>{render({ status, returnPath, error })}</>;\n\n return <DefaultExchangeUi status={status} returnPath={returnPath} error={error} />;\n};\n\n/**\n * Minimal client-side validation of the `return` query parameter.\n *\n * The cross-frontend handoff endpoint already validates `returnPath` at\n * the schema boundary (see `CrossFrontendHandoff_ReturnPathSchema` in\n * `authentication.shared.dto.schemas.ts`). This duplicate check is\n * defense-in-depth: anyone could construct a docs URL like\n * `/auth/exchange?code=…&return=https://evil.com` directly without\n * going through the backend. Without this guard, the `location.assign`\n * fallback (used by plain-HTML hosts when `onSuccessNavigate` is not\n * supplied) would happily redirect to that origin.\n *\n * The ORIGIN question is delegated to the shared\n * {@link isSameOriginRedirectPath} predicate on the bundle-safe seam, and\n * that delegation is a fix, not tidying. This function was a verbatim copy\n * of the SaaS-app receiver's copy, which was itself a copy of the issuer\n * schema's rules — and all three admitted `/<TAB>/evil.com`, because the\n * URL parser strips ASCII tab / LF / CR from the input BEFORE parsing, so\n * the target the browser sees is `//evil.com`. Every copy banned `\\`; none\n * banned the whitespace that becomes a `/`. Three mirrors reflected the\n * same hole, which is why the answer now has one home.\n *\n * The character rules are KEPT as defence-in-depth for the concerns the\n * origin predicate deliberately does not own: path traversal (`..`), markup\n * injection (`<>\"`) and the length ceiling.\n */\nfunction sanitizeReturnPath(raw: string): string {\n // Authoritative: `//evil.com`, `/\\evil.com` and the stripped-control-character\n // family all fail here, in one parse-based check.\n if (!isSameOriginRedirectPath(raw)) return '/';\n if (raw.includes('..')) return '/';\n if (raw.includes('\\\\')) return '/';\n if (raw.includes('://')) return '/';\n if (/[<>\"]/.test(raw)) return '/';\n if (raw.length > 256) return '/';\n return raw;\n}\n\n/**\n * Default zero-style status block. Apps that brand the docs site override\n * this via the `render` prop on `<AuthExchangePage>`.\n */\nconst DefaultExchangeUi: FC<{\n status: AuthExchangeStatus;\n returnPath: string;\n error: string | null;\n}> = ({ status, returnPath, error }) => {\n const containerStyle: CSSProperties = {\n maxWidth: 480,\n margin: '6rem auto',\n padding: '2rem',\n fontFamily: 'system-ui, sans-serif',\n textAlign: 'center',\n };\n\n if (status === 'pending' || status === 'exchanging') {\n return (\n <div style={containerStyle}>\n <h1 style={{ fontSize: '1.25rem' }}>Signing you in…</h1>\n <p style={{ color: '#666' }}>This will only take a moment.</p>\n </div>\n );\n }\n\n if (status === 'success') {\n return (\n <div style={containerStyle}>\n <h1 style={{ fontSize: '1.25rem' }}>You&apos;re signed in.</h1>\n <p style={{ color: '#666' }}>Redirecting to {returnPath}…</p>\n </div>\n );\n }\n\n if (status === 'missingCode') {\n return (\n <div style={containerStyle}>\n <h1 style={{ fontSize: '1.25rem' }}>This page requires a sign-in code.</h1>\n <p style={{ color: '#666' }}>Please open the documentation from the application.</p>\n <p>\n <a href=\"/\">Go to docs home</a>\n </p>\n </div>\n );\n }\n\n return (\n <div style={containerStyle}>\n <h1 style={{ fontSize: '1.25rem' }}>Sign-in failed</h1>\n <p style={{ color: '#666' }}>{error ?? 'Unknown error.'}</p>\n <p>\n <a href=\"/\">Go to docs home</a>\n </p>\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"AuthExchangePage.js","sourceRoot":"","sources":["../../../src/runtime/AuthExchangePage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAA+C,MAAM,OAAO,CAAC;AACjG,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAy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AC,eAAe,GAAK,IACpD,CACP,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,CACL,eAAK,KAAK,EAAE,cAAc,aACxB,aAAI,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAG,KAAK,CAAC,QAAQ,GAAM,EACzD,YAAG,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,YAAG,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,GAAK,IAC9D,CACP,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,KAAK,aAAa,EAAE,CAAC;QAC7B,OAAO,CACL,eAAK,KAAK,EAAE,cAAc,aACxB,aAAI,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAG,KAAK,CAAC,WAAW,GAAM,EAC5D,YAAG,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,YAAG,KAAK,CAAC,iBAAiB,GAAK,EAC1D,sBACE,YAAG,IAAI,EAAC,GAAG,YAAE,KAAK,CAAC,YAAY,GAAK,GAClC,IACA,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,eAAK,KAAK,EAAE,cAAc,aACxB,aAAI,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAG,KAAK,CAAC,YAAY,GAAM,EAC7D,YAAG,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,YAAG,OAAO,KAAK,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,GAAK,EAC1H,sBACE,YAAG,IAAI,EAAC,GAAG,YAAE,KAAK,CAAC,YAAY,GAAK,GAClC,IACA,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useEffect, useRef, useState, type CSSProperties, type FC, type ReactNode } from 'react';\nimport { isSameOriginRedirectPath } from '@wildo-ai/saas-models/public-runtime';\nimport { useDocsAuthSession } from './use-docs-auth-session';\nimport { fillMessage, type DocumentationSiteTranslator } from './documentation-site-translator';\n\n/**\n * Every word the default hand-off page shows a reader (#1992). The runtime has no label pack; the site\n * words them through its translator (see {@link createAuthExchangeWords}), so an untranslated one shows\n * its id rather than English.\n */\nexport interface AuthExchangeWords {\n readonly signingIn: string;\n readonly signingInDetail: string;\n readonly signedIn: string;\n readonly redirectingTo: (returnPath: string) => string;\n readonly missingCode: string;\n readonly missingCodeDetail: string;\n readonly goToDocsHome: string;\n readonly signInFailed: string;\n /** The link was refused: expired, already used, or never valid. */\n readonly linkRefused: string;\n /** The exchange could not complete: the application did not answer, or answered with an error. */\n readonly exchangeFailed: string;\n}\n\n/** The prefix every hand-off page word's id carries in the site's `code.json`. */\nexport const AUTH_EXCHANGE_WORD_ID_PREFIX = 'docs.authExchange.';\n\n/** The hand-off page's words through the site's translator: each member reads `docs.authExchange.<member>`. */\nexport function createAuthExchangeWords({ translate }: Pick<DocumentationSiteTranslator, 'translate'>): AuthExchangeWords {\n const word = (member: keyof AuthExchangeWords, values: Readonly<Record<string, string>> = {}): string =>\n fillMessage(translate(`${AUTH_EXCHANGE_WORD_ID_PREFIX}${member}`), values);\n return {\n signingIn: word('signingIn'),\n signingInDetail: word('signingInDetail'),\n signedIn: word('signedIn'),\n redirectingTo: (returnPath) => word('redirectingTo', { path: returnPath }),\n missingCode: word('missingCode'),\n missingCodeDetail: word('missingCodeDetail'),\n goToDocsHome: word('goToDocsHome'),\n signInFailed: word('signInFailed'),\n linkRefused: word('linkRefused'),\n exchangeFailed: word('exchangeFailed'),\n };\n}\n\n/**\n * Why a hand-off did not sign the reader in — decides which word the page shows. The technical cause\n * stays in `error` for a `render` consumer and for logs; it is not a sentence for a reader.\n */\nexport enum AuthExchangeFailure {\n /** The application answered, and refused the code: expired, already used, or never valid. */\n LINK_REFUSED = 'link_refused',\n /** The exchange did not complete: no answer, or an error answer. */\n EXCHANGE_FAILED = 'exchange_failed',\n}\n\n/**\n * Status of the auth-code exchange the page is performing.\n *\n * - `pending` — initial mount; effect has not yet run.\n * - `exchanging`— the `/auth/token/exchange` POST is in flight.\n * - `success` — tokens received; about to navigate to `returnPath`.\n * - `error` — exchange failed; the page renders a fallback message\n * and a manual link back to the docs root.\n * - `missingCode`— landed on `/auth/exchange` without `?code=…` (someone\n * bookmarked the page or arrived via a stale link).\n */\nexport type AuthExchangeStatus =\n | 'pending'\n | 'exchanging'\n | 'success'\n | 'error'\n | 'missingCode';\n\n/**\n * Page component mounted at `/auth/exchange` on the docs site\n * (saas-technical-doc.md Step 5).\n *\n * Lifecycle on mount:\n *\n * 1. Read `?code=` and `?return=` from `window.location.search`.\n * 2. If `code` is missing → render the missingCode UI (no network call).\n * 3. Else call `useDocsAuthSession().beginExchange(code)`, which POSTs\n * `/auth/token/exchange` and updates the in-memory context.\n * 4. On success, navigate to `returnPath` (defaults to `/`) using the\n * consumer-supplied `onSuccessNavigate` (Docusaurus / react-router\n * hosts MUST pass a client-side `history.push` — see the prop\n * docstring below for why a full reload is incorrect here).\n * 5. On failure, render the error UI with a link back to `/`.\n *\n * Why a single component (rather than splitting effect + render):\n *\n * - Keeps the exchange contract trivially auditable from one file.\n * - The effect intentionally runs ONCE per mount (`hasRunRef` guard) —\n * `code` values are single-use AUTH_CODE_EXCHANGE consumable tokens\n * and a stray re-mount in React 18 strict-mode dev would burn the\n * code with the second call returning `invalid_or_expired_code`.\n *\n * Visual layer: this component renders a minimal centered status block\n * in the words the site passes as `words` (#1992). Apps that want to brand it can either pass a\n * `render` prop (consumer-controlled UI for each status) or skip this\n * component entirely and call `useDocsAuthSession().beginExchange(code)`\n * from their own page. The default rendering deliberately uses inline\n * styles (no Tailwind / no CSS imports) so the component can be mounted\n * by any Docusaurus theme without dragging in extra build pipeline.\n */\nexport const AuthExchangePage: FC<({\n /**\n * Override the default rendering. Receives the current status and (when\n * the page reaches a terminal state) a recovery URL the consumer can\n * link back to.\n */\n render: (props: { status: AuthExchangeStatus; returnPath: string; error: string | null; failure: AuthExchangeFailure | null }) => ReactNode;\n words?: undefined;\n} | {\n render?: undefined;\n /** The default rendering's words, worded by the site (#1992). Required unless `render` replaces it. */\n words: AuthExchangeWords;\n}) & {\n /**\n * Post-success navigation. **SPA hosts (Docusaurus, react-router,\n * Vite/React-Router apps) MUST pass a client-side router push** — the\n * default `window.location.assign` triggers a full browser navigation\n * which destroys the in-memory `DocsAuthProvider` state we just\n * populated (the entire JS bundle re-executes from scratch on the\n * destination page, the React tree re-mounts, and `session` resets to\n * `'anonymous'`). For a Docusaurus consumer that looks like:\n *\n * ```tsx\n * import { useHistory } from '@docusaurus/router';\n *\n * function AuthExchangeRoute() {\n * const history = useHistory();\n * return <AuthExchangePage onSuccessNavigate={(p) => history.push(p)} />;\n * }\n * ```\n *\n * The default `window.location.assign` only works for plain-HTML hosts\n * that have no in-memory client state to preserve across the redirect.\n * It is kept as the default so the runtime stays usable in those hosts\n * with zero ceremony, but for SPAs failing to override it would\n * silently break the entire handoff (the user lands on the destination\n * page anonymous and any role-gated content rejects them).\n */\n onSuccessNavigate?: (returnPath: string) => void;\n}> = ({ render, words, onSuccessNavigate }) => {\n const { beginExchange } = useDocsAuthSession();\n\n const [status, setStatus] = useState<AuthExchangeStatus>('pending');\n const [error, setError] = useState<string | null>(null);\n const [failure, setFailure] = useState<AuthExchangeFailure | null>(null);\n const [returnPath, setReturnPath] = useState<string>('/');\n\n const hasRunRef = useRef(false);\n\n useEffect(() => {\n if (hasRunRef.current) return;\n hasRunRef.current = true;\n\n /**\n * SSR / build-time safety: Docusaurus may evaluate page modules in\n * Node during the static build pre-render pass. `window` is undefined\n * there. Bailing out keeps the static HTML emission clean — the real\n * exchange runs on hydration in the browser.\n */\n if (typeof window === 'undefined') return;\n\n const params = new URLSearchParams(window.location.search);\n const code = params.get('code');\n /**\n * URL `?return=` is kept as a defense-in-depth fallback for codes\n * minted before the cross-app-jwt-propagation.md Step 5 metadata\n * roll-out (which carries `returnPath` inside the exchange response\n * envelope). The post-exchange `safeReturn` resolution below prefers\n * the response-borne value because the issuer signs both into the\n * same code and the response value cannot be tampered with by\n * rewriting only the URL query string.\n */\n const rawUrlReturn = params.get('return') ?? '/';\n const urlSafeReturn = sanitizeReturnPath(rawUrlReturn);\n setReturnPath(urlSafeReturn);\n\n if (!code) {\n setStatus('missingCode');\n return;\n }\n\n setStatus('exchanging');\n beginExchange(code)\n .then(({ claims, returnPath: responseReturnPath }) => {\n /**\n * Source-of-truth ordering for navigation target:\n * 1. `responseReturnPath` — issuer-supplied via the exchange\n * response's TOP-LEVEL `returnPath` field (NOT a `metadata`\n * sub-field — the response has no `metadata` envelope; see\n * `TokenExchangeResponseSchema`). Sanitized again here even\n * though the issuer already validates at minting time; an\n * attacker who can intercept the response body should not be\n * able to weaponise it.\n * 2. `urlSafeReturn` — the URL `?return=` query parameter\n * (already sanitized above). Used when codes were minted\n * without a `returnPath` (OAuth2 callbacks, by contract)\n * OR when the response otherwise omits it.\n * 3. `/` — the docs root. Final fallback so the user is never\n * stranded on `/auth/exchange`.\n */\n const safeReturn = responseReturnPath\n ? sanitizeReturnPath(responseReturnPath)\n : urlSafeReturn;\n setReturnPath(safeReturn);\n\n if (claims === null) {\n setError('The exchange returned no session claims: the code was refused.');\n setFailure(AuthExchangeFailure.LINK_REFUSED);\n setStatus('error');\n return;\n }\n setStatus('success');\n // Navigate AFTER the React state flush so any other consumers of\n // `useDocsAuthSession()` see the authenticated session before the\n // page disappears. The default `window.location.assign` is the\n // plain-HTML fallback; SPA hosts override via `onSuccessNavigate`\n // (see prop docstring — full reload would tear down the in-memory\n // provider state we just populated).\n const navigate =\n onSuccessNavigate ?? ((path: string) => window.location.assign(path));\n window.setTimeout(() => {\n navigate(safeReturn);\n }, 0);\n })\n .catch((cause: unknown) => {\n setError(cause instanceof Error ? cause.message : String(cause));\n setFailure(AuthExchangeFailure.EXCHANGE_FAILED);\n setStatus('error');\n });\n }, [beginExchange, onSuccessNavigate]);\n\n if (render) return <>{render({ status, returnPath, error, failure })}</>;\n\n return <DefaultExchangeUi status={status} returnPath={returnPath} failure={failure} words={words} />;\n};\n\n/**\n * Minimal client-side validation of the `return` query parameter.\n *\n * The cross-frontend handoff endpoint already validates `returnPath` at\n * the schema boundary (see `CrossFrontendHandoff_ReturnPathSchema` in\n * `authentication.shared.dto.schemas.ts`). This duplicate check is\n * defense-in-depth: anyone could construct a docs URL like\n * `/auth/exchange?code=…&return=https://evil.com` directly without\n * going through the backend. Without this guard, the `location.assign`\n * fallback (used by plain-HTML hosts when `onSuccessNavigate` is not\n * supplied) would happily redirect to that origin.\n *\n * The ORIGIN question is delegated to the shared\n * {@link isSameOriginRedirectPath} predicate on the bundle-safe seam, and\n * that delegation is a fix, not tidying. This function was a verbatim copy\n * of the SaaS-app receiver's copy, which was itself a copy of the issuer\n * schema's rules — and all three admitted `/<TAB>/evil.com`, because the\n * URL parser strips ASCII tab / LF / CR from the input BEFORE parsing, so\n * the target the browser sees is `//evil.com`. Every copy banned `\\`; none\n * banned the whitespace that becomes a `/`. Three mirrors reflected the\n * same hole, which is why the answer now has one home.\n *\n * The character rules are KEPT as defence-in-depth for the concerns the\n * origin predicate deliberately does not own: path traversal (`..`), markup\n * injection (`<>\"`) and the length ceiling.\n */\nfunction sanitizeReturnPath(raw: string): string {\n // Authoritative: `//evil.com`, `/\\evil.com` and the stripped-control-character\n // family all fail here, in one parse-based check.\n if (!isSameOriginRedirectPath(raw)) return '/';\n if (raw.includes('..')) return '/';\n if (raw.includes('\\\\')) return '/';\n if (raw.includes('://')) return '/';\n if (/[<>\"]/.test(raw)) return '/';\n if (raw.length > 256) return '/';\n return raw;\n}\n\n/**\n * Default zero-style status block. Apps that brand the docs site override\n * this via the `render` prop on `<AuthExchangePage>`.\n */\nconst DefaultExchangeUi: FC<{\n status: AuthExchangeStatus;\n returnPath: string;\n failure: AuthExchangeFailure | null;\n words: AuthExchangeWords;\n}> = ({ status, returnPath, failure, words }) => {\n const containerStyle: CSSProperties = {\n maxWidth: 480,\n margin: '6rem auto',\n padding: '2rem',\n fontFamily: 'system-ui, sans-serif',\n textAlign: 'center',\n };\n\n if (status === 'pending' || status === 'exchanging') {\n return (\n <div style={containerStyle}>\n <h1 style={{ fontSize: '1.25rem' }}>{words.signingIn}</h1>\n <p style={{ color: '#666' }}>{words.signingInDetail}</p>\n </div>\n );\n }\n\n if (status === 'success') {\n return (\n <div style={containerStyle}>\n <h1 style={{ fontSize: '1.25rem' }}>{words.signedIn}</h1>\n <p style={{ color: '#666' }}>{words.redirectingTo(returnPath)}</p>\n </div>\n );\n }\n\n if (status === 'missingCode') {\n return (\n <div style={containerStyle}>\n <h1 style={{ fontSize: '1.25rem' }}>{words.missingCode}</h1>\n <p style={{ color: '#666' }}>{words.missingCodeDetail}</p>\n <p>\n <a href=\"/\">{words.goToDocsHome}</a>\n </p>\n </div>\n );\n }\n\n return (\n <div style={containerStyle}>\n <h1 style={{ fontSize: '1.25rem' }}>{words.signInFailed}</h1>\n <p style={{ color: '#666' }}>{failure === AuthExchangeFailure.LINK_REFUSED ? words.linkRefused : words.exchangeFailed}</p>\n <p>\n <a href=\"/\">{words.goToDocsHome}</a>\n </p>\n </div>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DocsAuthContext.d.ts","sourceRoot":"","sources":["../../../../src/runtime/DocsAuthContext.tsx"],"names":[],"mappings":"AACA,OAAO,EAQL,KAAK,OAAO,EACZ,KAAK,EAAE,EACP,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEnF,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAGlF,OAAO,EAEL,KAAK,+BAA+B,EACpC,KAAK,+BAA+B,EACrC,MAAM,sCAAsC,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,uBAAuB;IACtC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eAAe,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAGlF,OAAO,EAEL,KAAK,+BAA+B,EACpC,KAAK,+BAA+B,EACrC,MAAM,sCAAsC,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,wBAAwB,EAAE,+BAA+B,CAAC;IACnE,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAC9D,KAAK,IAAI,IAAI,CAAC;CACf;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,CAAC,oBAAoB,GAAG,IAAI,CACf,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,sBAAsB,CAAC;IAC3C;;;;;;;;;;;;;OAaG;IACH,uBAAuB,CAAC,EAAE,+BAA+B,CAAC;IAC1D;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC;;;OAGG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB,CA8HA,CAAC"}
@@ -1,16 +1,30 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import type { FrontendProvidersBlock } from '@wildo-ai/saas-models/public-runtime';
3
3
  import { type FrontendTechdocProviderRegistry, type GeneratedTechdocProviderModules } from './frontend-provider-registry.techdoc';
4
+ import type { ProviderComponentLoaderContribution } from '@wildo-ai/external-connectors-public/techdoc';
5
+ import { type DocsProviderComponentRegistry } from './provider-component-registry.techdoc';
4
6
  /** Provider execution belongs to the public documentation surface, independently of reader authentication. */
5
7
  export declare const DocsFrontendProvidersContext: import("react").Context<FrontendTechdocProviderRegistry>;
8
+ /**
9
+ * The components the live docs providers contribute (#1703), built once per registry by
10
+ * `DocsFrontendProviders` and read by `useDocsProviderComponent`. Absent outside it — an
11
+ * auth-provider-only mount offers no provider components.
12
+ */
13
+ export declare const DocsProviderComponentsContext: import("react").Context<DocsProviderComponentRegistry>;
6
14
  /**
7
15
  * Join build-time DATA with browser CODE without constructing an authentication client.
8
16
  * The Root swizzle mounts this outside its optional DocsAuthProvider. SDKs activate only in an
9
17
  * effect and stop on unmount, including on standalone documentation sites with no application API.
10
18
  */
11
- export declare function DocsFrontendProviders({ children, frontendProviders, frontendProviderModules, }: {
19
+ export declare function DocsFrontendProviders({ children, frontendProviders, frontendProviderModules, providerComponentLoaders, }: {
12
20
  children: ReactNode;
13
21
  frontendProviders?: FrontendProvidersBlock;
14
22
  frontendProviderModules?: GeneratedTechdocProviderModules;
23
+ /**
24
+ * Loaders for provider components an ENGINE provider module declares but cannot import (#1703) —
25
+ * the documentation site's facet-library door. A provider package that ships its own component needs
26
+ * nothing here. Pass a module-level constant: a new array each render rebuilds the component registry.
27
+ */
28
+ providerComponentLoaders?: ReadonlyArray<ProviderComponentLoaderContribution>;
15
29
  }): ReactNode;
16
30
  //# sourceMappingURL=DocsFrontendProviders.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocsFrontendProviders.d.ts","sourceRoot":"","sources":["../../../../src/runtime/DocsFrontendProviders.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CA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@ -1,16 +1,23 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { createContext, useMemo } from 'react';
3
3
  import { createFrontendTechdocProviderRegistry, } from './frontend-provider-registry.techdoc.js';
4
+ import { createDocsProviderComponentRegistry, } from './provider-component-registry.techdoc.js';
4
5
  import { useDocsProviderSdks } from './use-docs-provider-sdks.js';
5
6
  import { useDocsProviderScripts } from './use-docs-provider-scripts.js';
6
7
  /** Provider execution belongs to the public documentation surface, independently of reader authentication. */
7
8
  export const DocsFrontendProvidersContext = createContext(undefined);
9
+ /**
10
+ * The components the live docs providers contribute (#1703), built once per registry by
11
+ * `DocsFrontendProviders` and read by `useDocsProviderComponent`. Absent outside it — an
12
+ * auth-provider-only mount offers no provider components.
13
+ */
14
+ export const DocsProviderComponentsContext = createContext(undefined);
8
15
  /**
9
16
  * Join build-time DATA with browser CODE without constructing an authentication client.
10
17
  * The Root swizzle mounts this outside its optional DocsAuthProvider. SDKs activate only in an
11
18
  * effect and stop on unmount, including on standalone documentation sites with no application API.
12
19
  */
13
- export function DocsFrontendProviders({ children, frontendProviders, frontendProviderModules, }) {
20
+ export function DocsFrontendProviders({ children, frontendProviders, frontendProviderModules, providerComponentLoaders, }) {
14
21
  const registry = useMemo(() => createFrontendTechdocProviderRegistry({
15
22
  entries: frontendProviders,
16
23
  modules: frontendProviderModules,
@@ -19,8 +26,14 @@ export function DocsFrontendProviders({ children, frontendProviders, frontendPro
19
26
  console.warn(`[wildo-provider] ${diagnostic.kind}: ${diagnostic.message}`);
20
27
  },
21
28
  }), [frontendProviders, frontendProviderModules]);
29
+ // Memoised with the provider registry: the component registry caches what it loaded, and a new one
30
+ // per render would re-run every slot's load effect.
31
+ const componentRegistry = useMemo(() => createDocsProviderComponentRegistry({
32
+ providerRegistry: registry,
33
+ ...(providerComponentLoaders !== undefined ? { providerComponentLoaders } : {}),
34
+ }), [registry, providerComponentLoaders]);
22
35
  useDocsProviderSdks(registry);
23
- useDocsProviderScripts(registry);
24
- return _jsx(DocsFrontendProvidersContext.Provider, { value: registry, children: children });
36
+ useDocsProviderScripts(registry, componentRegistry);
37
+ return (_jsx(DocsFrontendProvidersContext.Provider, { value: registry, children: _jsx(DocsProviderComponentsContext.Provider, { value: componentRegistry, children: children }) }));
25
38
  }
26
39
  //# sourceMappingURL=DocsFrontendProviders.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocsFrontendProviders.js","sourceRoot":"","sources":["../../../../src/runtime/DocsFrontendProviders.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAkB,MAAM,OAAO,CAAC;AAE/D,OAAO,EACL,qCAAqC,GAGtC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,8GAA8G;AAC9G,MAAM,CAAC,MAAM,4BAA4B,GAAG,aAAa,CAA8C,SAAS,CAAC,CAAC;AAElH;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,EACpC,QAAQ,EACR,iBAAiB,EACjB,uBAAuB,GAKxB;IACC,MAAM,QAAQ,GAAG,OAAO,CACtB,GAAG,EAAE,CAAC,qCAAqC,CAAC;QAC1C,OAAO,EAAE,iBAAiB;QAC1B,OAAO,EAAE,uBAAuB;QAChC,YAAY,EAAE,CAAC,UAAU,EAAE,EAAE;YAC3B,sCAAsC;YACtC,OAAO,CAAC,IAAI,CAAC,oBAAoB,UAAU,CAAC,IAAI,KAAK,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC;QAC7E,CAAC;KACF,CAAC,EACF,CAAC,iBAAiB,EAAE,uBAAuB,CAAC,CAC7C,CAAC;IACF,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAC9B,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IACjC,OAAO,KAAC,4BAA4B,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,YAAG,QAAQ,GAAyC,CAAC;AACpH,CAAC","sourcesContent":["import { createContext, useMemo, type ReactNode } from 'react';\nimport type { FrontendProvidersBlock } from '@wildo-ai/saas-models/public-runtime';\nimport {\n createFrontendTechdocProviderRegistry,\n type FrontendTechdocProviderRegistry,\n type GeneratedTechdocProviderModules,\n} from './frontend-provider-registry.techdoc';\nimport { useDocsProviderSdks } from './use-docs-provider-sdks';\nimport { useDocsProviderScripts } from './use-docs-provider-scripts';\n\n/** Provider execution belongs to the public documentation surface, independently of reader authentication. */\nexport const DocsFrontendProvidersContext = createContext<FrontendTechdocProviderRegistry | undefined>(undefined);\n\n/**\n * Join build-time DATA with browser CODE without constructing an authentication client.\n * The Root swizzle mounts this outside its optional DocsAuthProvider. SDKs activate only in an\n * effect and stop on unmount, including on standalone documentation sites with no application API.\n */\nexport function DocsFrontendProviders({\n children,\n frontendProviders,\n frontendProviderModules,\n}: {\n children: ReactNode;\n frontendProviders?: FrontendProvidersBlock;\n frontendProviderModules?: GeneratedTechdocProviderModules;\n}): ReactNode {\n const registry = useMemo(\n () => createFrontendTechdocProviderRegistry({\n entries: frontendProviders,\n modules: frontendProviderModules,\n onDiagnostic: (diagnostic) => {\n // eslint-disable-next-line no-console\n console.warn(`[wildo-provider] ${diagnostic.kind}: ${diagnostic.message}`);\n },\n }),\n [frontendProviders, frontendProviderModules],\n );\n useDocsProviderSdks(registry);\n useDocsProviderScripts(registry);\n return <DocsFrontendProvidersContext.Provider value={registry}>{children}</DocsFrontendProvidersContext.Provider>;\n}\n"]}
1
+ {"version":3,"file":"DocsFrontendProviders.js","sourceRoot":"","sources":["../../../src/runtime/DocsFrontendProviders.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAkB,MAAM,OAAO,CAAC;AAE/D,OAAO,EACL,qCAAqC,GAGtC,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACL,mCAAmC,GAEpC,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,mBAAmB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,iBAAiB,YAAG,QAAQ,GAA0C,GAC/E,CACzC,CAAC;AACJ,CAAC","sourcesContent":["import { createContext, useMemo, type ReactNode } from 'react';\nimport type { FrontendProvidersBlock } from '@wildo-ai/saas-models/public-runtime';\nimport {\n createFrontendTechdocProviderRegistry,\n type FrontendTechdocProviderRegistry,\n type GeneratedTechdocProviderModules,\n} from './frontend-provider-registry.techdoc';\nimport type { ProviderComponentLoaderContribution } from '@wildo-ai/external-connectors-public/techdoc';\nimport {\n createDocsProviderComponentRegistry,\n type DocsProviderComponentRegistry,\n} from './provider-component-registry.techdoc';\nimport { useDocsProviderSdks } from './use-docs-provider-sdks';\nimport { useDocsProviderScripts } from './use-docs-provider-scripts';\n\n/** Provider execution belongs to the public documentation surface, independently of reader authentication. */\nexport const DocsFrontendProvidersContext = createContext<FrontendTechdocProviderRegistry | undefined>(undefined);\n\n/**\n * The components the live docs providers contribute (#1703), built once per registry by\n * `DocsFrontendProviders` and read by `useDocsProviderComponent`. Absent outside it — an\n * auth-provider-only mount offers no provider components.\n */\nexport const DocsProviderComponentsContext = createContext<DocsProviderComponentRegistry | undefined>(undefined);\n\n/**\n * Join build-time DATA with browser CODE without constructing an authentication client.\n * The Root swizzle mounts this outside its optional DocsAuthProvider. SDKs activate only in an\n * effect and stop on unmount, including on standalone documentation sites with no application API.\n */\nexport function DocsFrontendProviders({\n children,\n frontendProviders,\n frontendProviderModules,\n providerComponentLoaders,\n}: {\n children: ReactNode;\n frontendProviders?: FrontendProvidersBlock;\n frontendProviderModules?: GeneratedTechdocProviderModules;\n /**\n * Loaders for provider components an ENGINE provider module declares but cannot import (#1703) —\n * the documentation site's facet-library door. A provider package that ships its own component needs\n * nothing here. Pass a module-level constant: a new array each render rebuilds the component registry.\n */\n providerComponentLoaders?: ReadonlyArray<ProviderComponentLoaderContribution>;\n}): ReactNode {\n const registry = useMemo(\n () => createFrontendTechdocProviderRegistry({\n entries: frontendProviders,\n modules: frontendProviderModules,\n onDiagnostic: (diagnostic) => {\n // eslint-disable-next-line no-console\n console.warn(`[wildo-provider] ${diagnostic.kind}: ${diagnostic.message}`);\n },\n }),\n [frontendProviders, frontendProviderModules],\n );\n // Memoised with the provider registry: the component registry caches what it loaded, and a new one\n // per render would re-run every slot's load effect.\n const componentRegistry = useMemo(\n () => createDocsProviderComponentRegistry({\n providerRegistry: registry,\n ...(providerComponentLoaders !== undefined ? { providerComponentLoaders } : {}),\n }),\n [registry, providerComponentLoaders],\n );\n useDocsProviderSdks(registry);\n useDocsProviderScripts(registry, componentRegistry);\n return (\n <DocsFrontendProvidersContext.Provider value={registry}>\n <DocsProviderComponentsContext.Provider value={componentRegistry}>{children}</DocsProviderComponentsContext.Provider>\n </DocsFrontendProvidersContext.Provider>\n );\n}\n"]}
@@ -0,0 +1,41 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { ProviderCapability } from '@wildo-ai/saas-models/public-runtime';
3
+ /**
4
+ * @wildo_source:part:start engine.saas-technical-doc.provider-component.slot facet:layer:runtime facet:family:technical-doc
5
+ *
6
+ * `<DocsProviderComponent>` — places ONE provider's component on a documentation page (#1703), from
7
+ * the provider's own `components[capability]` declaration, the same one the application and the website
8
+ * read. Mount it inside `DocsFrontendProviders`.
9
+ *
10
+ * - **Nothing of the vendor reaches the prerendered HTML.** Docusaurus renders every page at build time;
11
+ * the component loads from an effect, which never runs there, and the registry refuses to load where
12
+ * there is no browser document. The build renders only the reserved box — this is the effect-based
13
+ * equivalent of a `<BrowserOnly>` boundary, with the box kept so the page does not shift.
14
+ * - **No layout shift.** `reservedMinHeight` applies to the box in every state.
15
+ * - **Consent: nobody is asked here, so a provider resting on a consent purpose never loads** on the
16
+ * documentation site, and the box renders `consentRequired`; a component that fails to load renders
17
+ * `unavailable`. Both REQUIRED, so a page cannot place a component and ship a silent blank where it
18
+ * would have been.
19
+ * - **The words are the site's.** The documentation runtime has no label pack of its own, so every state
20
+ * a reader sees is passed in — write them with Docusaurus `<Translate>` so they are translated with
21
+ * the rest of the site. The box holds a `role="status"` live region from the first render, filled
22
+ * when a refusal or failure appears, so a screen reader announces it.
23
+ * - **The vendor's scripts load with the component**, not on every documentation page.
24
+ */
25
+ export interface DocsProviderComponentProps<TProps extends object> {
26
+ /** The capability the component fills. */
27
+ capability: ProviderCapability;
28
+ /** The provider the page chose, or `undefined` while nothing is chosen. */
29
+ providerRef: string | undefined;
30
+ /** The props the loaded component receives — the capability's slot contract. */
31
+ componentProps: TProps;
32
+ /** Rendered when the provider rests on a consent purpose, which the documentation site never grants. */
33
+ consentRequired: ReactNode;
34
+ /** Rendered when the component could not be loaded. Required for the same reason: a failure must say so. */
35
+ unavailable: ReactNode;
36
+ /** CSS length reserved for the box in every state, so the page does not shift when the component loads. */
37
+ reservedMinHeight?: string;
38
+ }
39
+ export declare function DocsProviderComponent<TProps extends object>({ capability, providerRef, componentProps, consentRequired, unavailable, reservedMinHeight, }: DocsProviderComponentProps<TProps>): ReactNode;
40
+ /** @wildo_source:part:end engine.saas-technical-doc.provider-component.slot */
41
+ //# sourceMappingURL=DocsProviderComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocsProviderComponent.d.ts","sourceRoot":"","sources":["../../../src/runtime/DocsProviderComponent.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAI/E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,0BAA0B,CAAC,MAAM,SAAS,MAAM;IAC/D,0CAA0C;IAC1C,UAAU,EAAE,kBAAkB,CAAC;IAC/B,2EAA2E;IAC3E,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,gFAAgF;IAChF,cAAc,EAAE,MAAM,CAAC;IACvB,wGAAwG;IACxG,eAAe,EAAE,SAAS,CAAC;IAC3B,4GAA4G;IAC5G,WAAW,EAAE,SAAS,CAAC;IACvB,2GAA2G;IAC3G,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,qBAAqB,CAAC,MAAM,SAAS,MAAM,EAAE,EAC3D,UAAU,EACV,WAAW,EACX,cAAc,EACd,eAAe,EACf,WAAW,EACX,iBAAiB,GAClB,EAAE,0BAA0B,CAAC,MAAM,CAAC,GAAG,SAAS,CA4BhD;AACD,+EAA+E"}
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ProviderComponentStatus } from '@wildo-ai/external-connectors-public/techdoc';
3
+ import { useDocsProviderComponent } from './use-docs-provider-component.js';
4
+ export function DocsProviderComponent({ capability, providerRef, componentProps, consentRequired, unavailable, reservedMinHeight, }) {
5
+ const { status, Component } = useDocsProviderComponent(capability, providerRef);
6
+ // The registry cannot know a capability's props; the page states them through `componentProps`.
7
+ const Loaded = status === ProviderComponentStatus.READY && Component !== null
8
+ ? Component
9
+ : null;
10
+ // The live region is present from the first render and FILLED when a refusal appears, so a screen
11
+ // reader announces it; a region inserted already filled is often not announced at all.
12
+ const content = Loaded !== null
13
+ ? _jsx(Loaded, { ...componentProps })
14
+ : (_jsxs("div", { role: "status", children: [status === ProviderComponentStatus.CONSENT_REQUIRED ? consentRequired : null, status === ProviderComponentStatus.UNAVAILABLE ? unavailable : null] }));
15
+ return (_jsx("div", { "data-docs-provider-component": capability, "data-docs-provider-component-state": status, "aria-busy": status === ProviderComponentStatus.LOADING ? true : undefined, style: reservedMinHeight !== undefined ? { minHeight: reservedMinHeight } : undefined, children: content }));
16
+ }
17
+ //# sourceMappingURL=DocsProviderComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocsProviderComponent.js","sourceRoot":"","sources":["../../../src/runtime/DocsProviderComponent.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAGvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAuCzE,MAAM,UAAU,qBAAqB,CAAwB,EAC3D,UAAU,EACV,WAAW,EACX,cAAc,EACd,eAAe,EACf,WAAW,EACX,iBAAiB,GACkB;IACnC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,wBAAwB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;IAEhF,gGAAgG;IAChG,MAAM,MAAM,GAAG,MAAM,KAAK,uBAAuB,CAAC,KAAK,IAAI,SAAS,KAAK,IAAI;QAC3E,CAAC,CAAE,SAAoD;QACvD,CAAC,CAAC,IAAI,CAAC;IACT,kGAAkG;IAClG,uFAAuF;IACvF,MAAM,OAAO,GAAc,MAAM,KAAK,IAAI;QACxC,CAAC,CAAC,KAAC,MAAM,OAAK,cAAc,GAAI;QAChC,CAAC,CAAC,CACA,eAAK,IAAI,EAAC,QAAQ,aACf,MAAM,KAAK,uBAAuB,CAAC,gBAAgB,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,EAC5E,MAAM,KAAK,uBAAuB,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,IAChE,CACP,CAAC;IAEJ,OAAO,CACL,8CACgC,UAAU,wCACJ,MAAM,eAC/B,MAAM,KAAK,uBAAuB,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EACxE,KAAK,EAAE,iBAAiB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC,SAAS,YAEpF,OAAO,GACJ,CACP,CAAC;AACJ,CAAC","sourcesContent":["import React, { type ReactNode } from 'react';\nimport { ProviderComponentStatus } from '@wildo-ai/external-connectors-public/techdoc';\nimport type { ProviderCapability } from '@wildo-ai/saas-models/public-runtime';\n\nimport { useDocsProviderComponent } from './use-docs-provider-component';\n\n/**\n * @wildo_source:part:start engine.saas-technical-doc.provider-component.slot facet:layer:runtime facet:family:technical-doc\n *\n * `<DocsProviderComponent>` — places ONE provider's component on a documentation page (#1703), from\n * the provider's own `components[capability]` declaration, the same one the application and the website\n * read. Mount it inside `DocsFrontendProviders`.\n *\n * - **Nothing of the vendor reaches the prerendered HTML.** Docusaurus renders every page at build time;\n * the component loads from an effect, which never runs there, and the registry refuses to load where\n * there is no browser document. The build renders only the reserved box — this is the effect-based\n * equivalent of a `<BrowserOnly>` boundary, with the box kept so the page does not shift.\n * - **No layout shift.** `reservedMinHeight` applies to the box in every state.\n * - **Consent: nobody is asked here, so a provider resting on a consent purpose never loads** on the\n * documentation site, and the box renders `consentRequired`; a component that fails to load renders\n * `unavailable`. Both REQUIRED, so a page cannot place a component and ship a silent blank where it\n * would have been.\n * - **The words are the site's.** The documentation runtime has no label pack of its own, so every state\n * a reader sees is passed in — write them with Docusaurus `<Translate>` so they are translated with\n * the rest of the site. The box holds a `role=\"status\"` live region from the first render, filled\n * when a refusal or failure appears, so a screen reader announces it.\n * - **The vendor's scripts load with the component**, not on every documentation page.\n */\nexport interface DocsProviderComponentProps<TProps extends object> {\n /** The capability the component fills. */\n capability: ProviderCapability;\n /** The provider the page chose, or `undefined` while nothing is chosen. */\n providerRef: string | undefined;\n /** The props the loaded component receives — the capability's slot contract. */\n componentProps: TProps;\n /** Rendered when the provider rests on a consent purpose, which the documentation site never grants. */\n consentRequired: ReactNode;\n /** Rendered when the component could not be loaded. Required for the same reason: a failure must say so. */\n unavailable: ReactNode;\n /** CSS length reserved for the box in every state, so the page does not shift when the component loads. */\n reservedMinHeight?: string;\n}\n\nexport function DocsProviderComponent<TProps extends object>({\n capability,\n providerRef,\n componentProps,\n consentRequired,\n unavailable,\n reservedMinHeight,\n}: DocsProviderComponentProps<TProps>): ReactNode {\n const { status, Component } = useDocsProviderComponent(capability, providerRef);\n\n // The registry cannot know a capability's props; the page states them through `componentProps`.\n const Loaded = status === ProviderComponentStatus.READY && Component !== null\n ? (Component as unknown as React.ComponentType<TProps>)\n : null;\n // The live region is present from the first render and FILLED when a refusal appears, so a screen\n // reader announces it; a region inserted already filled is often not announced at all.\n const content: ReactNode = Loaded !== null\n ? <Loaded {...componentProps} />\n : (\n <div role=\"status\">\n {status === ProviderComponentStatus.CONSENT_REQUIRED ? consentRequired : null}\n {status === ProviderComponentStatus.UNAVAILABLE ? unavailable : null}\n </div>\n );\n\n return (\n <div\n data-docs-provider-component={capability}\n data-docs-provider-component-state={status}\n aria-busy={status === ProviderComponentStatus.LOADING ? true : undefined}\n style={reservedMinHeight !== undefined ? { minHeight: reservedMinHeight } : undefined}\n >\n {content}\n </div>\n );\n}\n/** @wildo_source:part:end engine.saas-technical-doc.provider-component.slot */\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"decode-jwt-claims.d.ts","sourceRoot":"","sources":["../../../../src/runtime/decode-jwt-claims.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,6BAA6B,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAoCnE"}
1
+ {"version":3,"file":"decode-jwt-claims.d.ts","sourceRoot":"","sources":["../../../src/runtime/decode-jwt-claims.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,6BAA6B,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAoCnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"docs-auth-client.d.ts","sourceRoot":"","sources":["../../../../src/runtime/docs-auth-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EACL,6BAA6B,EAK7B,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,EAC3B,MAAM,sCAAsC,CAAC;AAM9C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time/docs-auth-session.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,oBAAY,QAAQ;IAClB,SAAS,cAAc;IACvB,KAAK,UAAU;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,mBAAmB;;;;;kBAK9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,eAAe,GACvB;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GACvB;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,GACxB;IAAE,MAAM,EAAE,eAAe,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,aAAa,CAAA;CAAE,CAAC"}
1
+ {"version":3,"file":"docs-auth-session.schemas.d.ts","sourceRoot":"","sources":["../../../src/runtime/docs-auth-session.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,oBAAY,QAAQ;IAClB,SAAS,cAAc;IACvB,KAAK,UAAU;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,mBAAmB;;;;;kBAK9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,eAAe,GACvB;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GACvB;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,GACxB;IAAE,MAAM,EAAE,eAAe,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,aAAa,CAAA;CAAE,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * How a documentation site words the engine's documentation pages (#1992): its translation lookup, its
3
+ * plural rule and its locale.
4
+ *
5
+ * On a Docusaurus site these are `translate({ id })` from `@docusaurus/Translate`,
6
+ * `usePluralForm().selectMessage` from `@docusaurus/theme-common` and `i18n.currentLocale`; the words
7
+ * live in the site's `i18n/<locale>/code.json`. The runtime takes them as functions so it imports
8
+ * nothing of Docusaurus, and so the ids stay the engine's one contract rather than being restated by
9
+ * every site.
10
+ *
11
+ * `translate` returns the MESSAGE, placeholders and all: the engine picks the plural form first and
12
+ * places the values after, so a value that happens to contain `|` or `{…}` cannot be read as syntax.
13
+ */
14
+ export interface DocumentationSiteTranslator {
15
+ /** The reader's locale, a BCP 47 tag (`en`, `fr-FR`), for the locale's list pattern. */
16
+ readonly locale: string;
17
+ /** The message for `id` in the reader's locale, with its `{name}` placeholders as written; the id itself when missing. */
18
+ readonly translate: (id: string) => string;
19
+ /** The form of a `|`-separated plural message that fits `count` in the reader's locale. */
20
+ readonly selectPlural: (count: number, pluralForms: string) => string;
21
+ }
22
+ /** `template` with each `{name}` replaced by its value; a placeholder with no value is left as written. */
23
+ export declare function fillMessage(template: string, values: Readonly<Record<string, string>>): string;
24
+ /**
25
+ * `template` split around its placeholders: text at even positions, placeholder NAMES at odd ones — for a
26
+ * reader that places an element rather than a string at each placeholder.
27
+ */
28
+ export declare function splitMessagePlaceholders(template: string): readonly string[];
29
+ /** How the items of a list relate, which decides the word the locale joins them with. */
30
+ export declare enum DocumentationListKind {
31
+ /** All of them — "a, b and c". */
32
+ CONJUNCTION = "conjunction",
33
+ /** Any one of them — "a, b or c". */
34
+ DISJUNCTION = "disjunction"
35
+ }
36
+ /** One piece of a list laid out in the reader's locale: the item at `index`, or the words between items. */
37
+ export type DocumentationListPart = {
38
+ readonly item: number;
39
+ } | {
40
+ readonly separator: string;
41
+ };
42
+ /** Whether a laid-out part is an item's position rather than the words between items. */
43
+ export declare function isDocumentationListItem(part: DocumentationListPart): part is {
44
+ readonly item: number;
45
+ };
46
+ /**
47
+ * The layout of a list of `itemCount` items in `locale` — where each item goes and what the locale puts
48
+ * between them — from `Intl.ListFormat`, so the joining words come from the platform's locale data rather
49
+ * than from an English `', '` or `' or '` written into the view. The items themselves may be anything,
50
+ * which is why this returns positions rather than joining strings.
51
+ */
52
+ export declare function documentationListLayout(locale: string, itemCount: number, kind: DocumentationListKind): readonly DocumentationListPart[];
53
+ //# sourceMappingURL=documentation-site-translator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documentation-site-translator.d.ts","sourceRoot":"","sources":["../../../src/runtime/documentation-site-translator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,2BAA2B;IAC1C,wFAAwF;IACxF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,0HAA0H;IAC1H,QAAQ,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3C,2FAA2F;IAC3F,QAAQ,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC;CACvE;AASD,2GAA2G;AAC3G,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAG9F;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAE5E;AAED,yFAAyF;AACzF,oBAAY,qBAAqB;IAC/B,kCAAkC;IAClC,WAAW,gBAAgB;IAC3B,qCAAqC;IACrC,WAAW,gBAAgB;CAC5B;AAED,4GAA4G;AAC5G,MAAM,MAAM,qBAAqB,GAC7B;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnC,yFAAyF;AACzF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI,IAAI;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAEtG;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,GAAG,SAAS,qBAAqB,EAAE,CAUxI"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * A message's `{name}` placeholders, found in one place so every reader of a template agrees on the syntax.
3
+ * Kept private, and a fresh RegExp built per use: a global RegExp carries `lastIndex` between calls, so a
4
+ * shared one would share that state. Readers go through {@link fillMessage} or {@link splitMessagePlaceholders}.
5
+ */
6
+ const MESSAGE_PLACEHOLDER_SOURCE = String.raw `\{(\w+)\}`;
7
+ /** `template` with each `{name}` replaced by its value; a placeholder with no value is left as written. */
8
+ export function fillMessage(template, values) {
9
+ // Own values only: `{constructor}` or `{toString}` must not resolve to what every object inherits.
10
+ return template.replace(new RegExp(MESSAGE_PLACEHOLDER_SOURCE, 'g'), (placeholder, name) => (Object.hasOwn(values, name) ? values[name] : undefined) ?? placeholder);
11
+ }
12
+ /**
13
+ * `template` split around its placeholders: text at even positions, placeholder NAMES at odd ones — for a
14
+ * reader that places an element rather than a string at each placeholder.
15
+ */
16
+ export function splitMessagePlaceholders(template) {
17
+ return template.split(new RegExp(MESSAGE_PLACEHOLDER_SOURCE));
18
+ }
19
+ /** How the items of a list relate, which decides the word the locale joins them with. */
20
+ export var DocumentationListKind;
21
+ (function (DocumentationListKind) {
22
+ /** All of them — "a, b and c". */
23
+ DocumentationListKind["CONJUNCTION"] = "conjunction";
24
+ /** Any one of them — "a, b or c". */
25
+ DocumentationListKind["DISJUNCTION"] = "disjunction";
26
+ })(DocumentationListKind || (DocumentationListKind = {}));
27
+ /** Whether a laid-out part is an item's position rather than the words between items. */
28
+ export function isDocumentationListItem(part) {
29
+ return Object.hasOwn(part, 'item');
30
+ }
31
+ /**
32
+ * The layout of a list of `itemCount` items in `locale` — where each item goes and what the locale puts
33
+ * between them — from `Intl.ListFormat`, so the joining words come from the platform's locale data rather
34
+ * than from an English `', '` or `' or '` written into the view. The items themselves may be anything,
35
+ * which is why this returns positions rather than joining strings.
36
+ */
37
+ export function documentationListLayout(locale, itemCount, kind) {
38
+ if (itemCount <= 0)
39
+ return [];
40
+ const markers = Array.from({ length: itemCount }, (_, index) => `\u0000${index}\u0000`);
41
+ const formatted = new Intl.ListFormat(locale, { type: kind, style: 'long' }).format(markers);
42
+ const parts = [];
43
+ for (const [index, segment] of formatted.split(/\u0000(\d+)\u0000/).entries()) {
44
+ if (index % 2 === 1)
45
+ parts.push({ item: Number(segment) });
46
+ else if (segment.length > 0)
47
+ parts.push({ separator: segment });
48
+ }
49
+ return parts;
50
+ }
51
+ //# sourceMappingURL=documentation-site-translator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documentation-site-translator.js","sourceRoot":"","sources":["../../../src/runtime/documentation-site-translator.ts"],"names":[],"mappings":"AAsBA;;;;GAIG;AACH,MAAM,0BAA0B,GAAG,MAAM,CAAC,GAAG,CAAA,WAAW,CAAC;AAEzD,2GAA2G;AAC3G,MAAM,UAAU,WAAW,CAAC,QAAgB,EAAE,MAAwC;IACpF,mGAAmG;IACnG,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,0BAA0B,EAAE,GAAG,CAAC,EAAE,CAAC,WAAW,EAAE,IAAY,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC,CAAC;AAC/K,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,QAAgB;IACvD,OA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AAS,EAAE,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/**\n * How a documentation site words the engine's documentation pages (#1992): its translation lookup, its\n * plural rule and its locale.\n *\n * On a Docusaurus site these are `translate({ id })` from `@docusaurus/Translate`,\n * `usePluralForm().selectMessage` from `@docusaurus/theme-common` and `i18n.currentLocale`; the words\n * live in the site's `i18n/<locale>/code.json`. The runtime takes them as functions so it imports\n * nothing of Docusaurus, and so the ids stay the engine's one contract rather than being restated by\n * every site.\n *\n * `translate` returns the MESSAGE, placeholders and all: the engine picks the plural form first and\n * places the values after, so a value that happens to contain `|` or `{…}` cannot be read as syntax.\n */\nexport interface DocumentationSiteTranslator {\n /** The reader's locale, a BCP 47 tag (`en`, `fr-FR`), for the locale's list pattern. */\n readonly locale: string;\n /** The message for `id` in the reader's locale, with its `{name}` placeholders as written; the id itself when missing. */\n readonly translate: (id: string) => string;\n /** The form of a `|`-separated plural message that fits `count` in the reader's locale. */\n readonly selectPlural: (count: number, pluralForms: string) => string;\n}\n\n/**\n * A message's `{name}` placeholders, found in one place so every reader of a template agrees on the syntax.\n * Kept private, and a fresh RegExp built per use: a global RegExp carries `lastIndex` between calls, so a\n * shared one would share that state. Readers go through {@link fillMessage} or {@link splitMessagePlaceholders}.\n */\nconst MESSAGE_PLACEHOLDER_SOURCE = String.raw`\\{(\\w+)\\}`;\n\n/** `template` with each `{name}` replaced by its value; a placeholder with no value is left as written. */\nexport function fillMessage(template: string, values: Readonly<Record<string, string>>): string {\n // Own values only: `{constructor}` or `{toString}` must not resolve to what every object inherits.\n return template.replace(new RegExp(MESSAGE_PLACEHOLDER_SOURCE, 'g'), (placeholder, name: string) => (Object.hasOwn(values, name) ? values[name] : undefined) ?? placeholder);\n}\n\n/**\n * `template` split around its placeholders: text at even positions, placeholder NAMES at odd ones — for a\n * reader that places an element rather than a string at each placeholder.\n */\nexport function splitMessagePlaceholders(template: string): readonly string[] {\n return template.split(new RegExp(MESSAGE_PLACEHOLDER_SOURCE));\n}\n\n/** How the items of a list relate, which decides the word the locale joins them with. */\nexport enum DocumentationListKind {\n /** All of them — \"a, b and c\". */\n CONJUNCTION = 'conjunction',\n /** Any one of them — \"a, b or c\". */\n DISJUNCTION = 'disjunction',\n}\n\n/** One piece of a list laid out in the reader's locale: the item at `index`, or the words between items. */\nexport type DocumentationListPart =\n | { readonly item: number }\n | { readonly separator: string };\n\n/** Whether a laid-out part is an item's position rather than the words between items. */\nexport function isDocumentationListItem(part: DocumentationListPart): part is { readonly item: number } {\n return Object.hasOwn(part, 'item');\n}\n\n/**\n * The layout of a list of `itemCount` items in `locale` — where each item goes and what the locale puts\n * between them — from `Intl.ListFormat`, so the joining words come from the platform's locale data rather\n * than from an English `', '` or `' or '` written into the view. The items themselves may be anything,\n * which is why this returns positions rather than joining strings.\n */\nexport function documentationListLayout(locale: string, itemCount: number, kind: DocumentationListKind): readonly DocumentationListPart[] {\n if (itemCount <= 0) return [];\n const markers = Array.from({ length: itemCount }, (_, index) => `\\u0000${index}\\u0000`);\n const formatted = new Intl.ListFormat(locale, { type: kind, style: 'long' }).format(markers);\n const parts: DocumentationListPart[] = [];\n for (const [index, segment] of formatted.split(/\\u0000(\\d+)\\u0000/).entries()) {\n if (index % 2 === 1) parts.push({ item: Number(segment) });\n else if (segment.length > 0) parts.push({ separator: segment });\n }\n return parts;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"frontend-provider-registry.techdoc.d.ts","sourceRoot":"","sources":["../../../../src/runtime/frontend-provider-registry.techdoc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAEL,KAAK,mCAAmC,EACxC,KAAK,+BAA+B,EACpC,KAAK,+BAA+B,EACrC,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEnF,YAAY,EACV,6BAA6B,EAC7B,0BAA0B,EAC1B,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,8CAA8C,CAAC;AAEtD,MAAM,WAAW,0CAA0C;IACzD,sEAAsE;IACtE,QAAQ,CAAC,OAAO,CAAC,EAAE,sBAAsB,CAAC;IAC1C;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,+BAA+B,CAAC;IACnD,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,mCAAmC,KAAK,IAAI,CAAC;CACnF;AAED;;GAEG;AACH,wBAAgB,qCAAqC,CACnD,KAAK,CAAC,EAAE,0CAA0C,GACjD,+BAA+B,CAMjC"}
1
+ {"version":3,"file":"frontend-provider-registry.techdoc.d.ts","sourceRoot":"","sources":["../../../src/runtime/frontend-provider-registry.techdoc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAEL,KAAK,mCAAmC,EACxC,KAAK,+BAA+B,EACpC,KAAK,+BAA+B,EACrC,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEnF,YAAY,EACV,6BAA6B,EAC7B,0BAA0B,EAC1B,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,8CAA8C,CAAC;AAEtD,MAAM,WAAW,0CAA0C;IACzD,sEAAsE;IACtE,QAAQ,CAAC,OAAO,CAAC,EAAE,sBAAsB,CAAC;IAC1C;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,+BAA+B,CAAC;IACnD,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,mCAAmC,KAAK,IAAI,CAAC;CACnF;AAED;;GAEG;AACH,wBAAgB,qCAAqC,CACnD,KAAK,CAAC,EAAE,0CAA0C,GACjD,+BAA+B,CAMjC"}
@@ -53,8 +53,14 @@ export * from './use-docs-auth-session';
53
53
  export * from './use-docs-frontend-provider-registry';
54
54
  export * from './use-docs-provider-sdks';
55
55
  export * from './use-docs-provider-scripts';
56
+ export * from './provider-component-registry.techdoc';
57
+ export * from './use-docs-provider-component';
58
+ export * from './DocsProviderComponent';
56
59
  export * from './AuthExchangePage';
57
60
  export * from './openapi-reference-model';
61
+ export * from './openapi-reference-navigation';
58
62
  export * from './openapi-reference-conservation';
59
63
  export * from './openapi-reference-view';
64
+ export * from './openapi-reference-words';
65
+ export * from './documentation-site-translator';
60
66
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAuBH,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sCAAsC,CAAC;AACrD,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,sCAAsC,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uCAAuC,CAAC;AACtD,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAuBH,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sCAAsC,CAAC;AACrD,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,sCAAsC,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uCAAuC,CAAC;AACtD,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC"}
@@ -72,8 +72,14 @@ export * from './use-docs-auth-session.js';
72
72
  export * from './use-docs-frontend-provider-registry.js';
73
73
  export * from './use-docs-provider-sdks.js';
74
74
  export * from './use-docs-provider-scripts.js';
75
+ export * from './provider-component-registry.techdoc.js';
76
+ export * from './use-docs-provider-component.js';
77
+ export * from './DocsProviderComponent.js';
75
78
  export * from './AuthExchangePage.js';
76
79
  export * from './openapi-reference-model.js';
80
+ export * from './openapi-reference-navigation.js';
77
81
  export * from './openapi-reference-conservation.js';
78
82
  export * from './openapi-reference-view.js';
83
+ export * from './openapi-reference-words.js';
84
+ export * from './documentation-site-translator.js';
79
85
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,yBAAyB,CAAC,CAAC,CAAC,CAAC;AAE7B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sCAAsC,CAAC;AACrD,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,GAG7B,MAAM,sCAAsC,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uCAAuC,CAAC;AACtD,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC","sourcesContent":["/**\n * `@wildo-ai/saas-technical-doc/runtime` — browser-only auth runtime\n * for the Docusaurus-served docs site (saas-technical-doc.md K-9b).\n *\n * Public surface (consumed by the three Docusaurus swizzles per K-11):\n *\n * - `<DocsAuthProvider apiBaseUrl=\"…\">` — Root swizzle wraps children.\n * - `useDocsAuthSession()` — Navbar + DocItem swizzles read.\n * - `<AuthExchangePage />` — mounted at `/auth/exchange`.\n * - `DocsAuthClient` — direct access for the DocItem\n * swizzle's \"request handoff back\n * to app\" code path.\n * - `DocsAuthClientError` + code type — typed error branch surface.\n * - `DocsRole` / `DocsAuthSession` — discriminated-union types.\n * - `useDocsFrontendProviderRegistry()` — read the materialized frontend\n * provider registry for this docs\n * service (search / future SDK\n * widgets).\n * - `decodeJwtClaims` — exposed so apps can decode\n * access tokens issued by\n * non-handoff flows (rare;\n * reserved for advanced use).\n *\n * @wildo-boundary\n * - This sub-tree MAY use React, `react-dom`, the browser `fetch`, and\n * the browser `atob` global. It MUST NOT import:\n * - Node built-ins (`fs`, `path`, …) — would break Docusaurus\n * client bundle.\n * - `@wildo-ai/saas-frontend-lib` — entire point of K-9b\n * is to NOT pull this.\n * - inversify — reserved for the SaaS\n * app DI stack.\n * - This sub-tree MAY import shared schemas + DTO types from\n * `@wildo-ai/saas-models/public-runtime` (the lightweight subset\n * allow-listed by `runtime-bundle-isolation.test.ts`).\n * - This sub-tree MUST initialize `@wildo-ai/zod-decorators` at runtime\n * entry — see the `ensureZodDecoratorsLoaded(z)` side-effect below.\n * Skipping this leaves the docs runtime with an under-augmented Zod\n * `ZodObject` declaration, which historically caused cross-package\n * `z.infer` widening (the H-3 / M-7 cross-frontend-handoff incident,\n * see `.cursor/plans/cross-app-jwt-propagation.md`).\n * - The package's `./companion` and `./` (root) entries MUST NOT import\n * from this sub-tree (see those files' boundary blocks).\n */\n\n/**\n * Boot the project's Zod decorator augmentation for this bundle.\n *\n * `@wildo-ai/saas-models/public-runtime` re-exports schemas authored\n * against the augmented `ZodObject` interface declared by\n * `@wildo-ai/zod-decorators`. Without `ensureZodDecoratorsLoaded(z)`\n * being called once on this bundle's Zod instance, the docs runtime sees\n * a schema graph whose `.shape` access paths and `z.infer` results don't\n * match what the SaaS app sees — a silent contract drift that bit us in\n * H-3 / M-7. The call is idempotent (guarded inside the function) so\n * importing this module multiple times is a no-op after the first load.\n *\n * The bare-specifier import is allow-listed by\n * `runtime-bundle-isolation.test.ts` (revised 2026-04-19); the package\n * itself is browser-safe (it only mutates `z.ZodType.prototype`).\n */\nimport { z } from 'zod';\nimport { ensureZodDecoratorsLoaded } from '@wildo-ai/zod-decorators';\n\nensureZodDecoratorsLoaded(z);\n\nexport * from './docs-auth-session.schemas';\nexport * from './decode-jwt-claims';\nexport * from './docs-auth-client';\nexport * from './DocsAuthContext';\nexport * from './DocsFrontendProviders';\nexport * from './frontend-provider-registry.techdoc';\nexport {\n FrontendProviderEntrySchema,\n FrontendProvidersBlockSchema,\n type FrontendProviderEntry,\n type FrontendProvidersBlock,\n} from '@wildo-ai/saas-models/public-runtime';\nexport * from './use-docs-auth-session';\nexport * from './use-docs-frontend-provider-registry';\nexport * from './use-docs-provider-sdks';\nexport * from './use-docs-provider-scripts';\nexport * from './AuthExchangePage';\nexport * from './openapi-reference-model';\nexport * from './openapi-reference-conservation';\nexport * from './openapi-reference-view';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,yBAAyB,CAAC,CAAC,CAAC,CAAC;AAE7B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sCAAsC,CAAC;AACrD,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,GAG7B,MAAM,sCAAsC,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uCAAuC,CAAC;AACtD,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC","sourcesContent":["/**\n * `@wildo-ai/saas-technical-doc/runtime` — browser-only auth runtime\n * for the Docusaurus-served docs site (saas-technical-doc.md K-9b).\n *\n * Public surface (consumed by the three Docusaurus swizzles per K-11):\n *\n * - `<DocsAuthProvider apiBaseUrl=\"…\">` — Root swizzle wraps children.\n * - `useDocsAuthSession()` — Navbar + DocItem swizzles read.\n * - `<AuthExchangePage />` — mounted at `/auth/exchange`.\n * - `DocsAuthClient` — direct access for the DocItem\n * swizzle's \"request handoff back\n * to app\" code path.\n * - `DocsAuthClientError` + code type — typed error branch surface.\n * - `DocsRole` / `DocsAuthSession` — discriminated-union types.\n * - `useDocsFrontendProviderRegistry()` — read the materialized frontend\n * provider registry for this docs\n * service (search / future SDK\n * widgets).\n * - `decodeJwtClaims` — exposed so apps can decode\n * access tokens issued by\n * non-handoff flows (rare;\n * reserved for advanced use).\n *\n * @wildo-boundary\n * - This sub-tree MAY use React, `react-dom`, the browser `fetch`, and\n * the browser `atob` global. It MUST NOT import:\n * - Node built-ins (`fs`, `path`, …) — would break Docusaurus\n * client bundle.\n * - `@wildo-ai/saas-frontend-lib` — entire point of K-9b\n * is to NOT pull this.\n * - inversify — reserved for the SaaS\n * app DI stack.\n * - This sub-tree MAY import shared schemas + DTO types from\n * `@wildo-ai/saas-models/public-runtime` (the lightweight subset\n * allow-listed by `runtime-bundle-isolation.test.ts`).\n * - This sub-tree MUST initialize `@wildo-ai/zod-decorators` at runtime\n * entry — see the `ensureZodDecoratorsLoaded(z)` side-effect below.\n * Skipping this leaves the docs runtime with an under-augmented Zod\n * `ZodObject` declaration, which historically caused cross-package\n * `z.infer` widening (the H-3 / M-7 cross-frontend-handoff incident,\n * see `.cursor/plans/cross-app-jwt-propagation.md`).\n * - The package's `./companion` and `./` (root) entries MUST NOT import\n * from this sub-tree (see those files' boundary blocks).\n */\n\n/**\n * Boot the project's Zod decorator augmentation for this bundle.\n *\n * `@wildo-ai/saas-models/public-runtime` re-exports schemas authored\n * against the augmented `ZodObject` interface declared by\n * `@wildo-ai/zod-decorators`. Without `ensureZodDecoratorsLoaded(z)`\n * being called once on this bundle's Zod instance, the docs runtime sees\n * a schema graph whose `.shape` access paths and `z.infer` results don't\n * match what the SaaS app sees — a silent contract drift that bit us in\n * H-3 / M-7. The call is idempotent (guarded inside the function) so\n * importing this module multiple times is a no-op after the first load.\n *\n * The bare-specifier import is allow-listed by\n * `runtime-bundle-isolation.test.ts` (revised 2026-04-19); the package\n * itself is browser-safe (it only mutates `z.ZodType.prototype`).\n */\nimport { z } from 'zod';\nimport { ensureZodDecoratorsLoaded } from '@wildo-ai/zod-decorators';\n\nensureZodDecoratorsLoaded(z);\n\nexport * from './docs-auth-session.schemas';\nexport * from './decode-jwt-claims';\nexport * from './docs-auth-client';\nexport * from './DocsAuthContext';\nexport * from './DocsFrontendProviders';\nexport * from './frontend-provider-registry.techdoc';\nexport {\n FrontendProviderEntrySchema,\n FrontendProvidersBlockSchema,\n type FrontendProviderEntry,\n type FrontendProvidersBlock,\n} from '@wildo-ai/saas-models/public-runtime';\nexport * from './use-docs-auth-session';\nexport * from './use-docs-frontend-provider-registry';\nexport * from './use-docs-provider-sdks';\nexport * from './use-docs-provider-scripts';\nexport * from './provider-component-registry.techdoc';\nexport * from './use-docs-provider-component';\nexport * from './DocsProviderComponent';\nexport * from './AuthExchangePage';\nexport * from './openapi-reference-model';\nexport * from './openapi-reference-navigation';\nexport * from './openapi-reference-conservation';\nexport * from './openapi-reference-view';\nexport * from './openapi-reference-words';\nexport * from './documentation-site-translator';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"openapi-reference-conservation.d.ts","sourceRoot":"","sources":["../../../../src/runtime/openapi-reference-conservation.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAA2B,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAwE5F;;;;GAIG;AACH,wBAAgB,mCAAmC,CAAC,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAiBjH;AAED,4EAA4E;AAC5E,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,oBAAoB,GAAG,iBAAiB,CAIjG"}
1
+ {"version":3,"file":"openapi-reference-conservation.d.ts","sourceRoot":"","sources":["../../../src/runtime/openapi-reference-conservation.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAA2B,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAwE5F;;;;GAIG;AACH,wBAAgB,mCAAmC,CAAC,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAiBjH;AAED,4EAA4E;AAC5E,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,oBAAoB,GAAG,iBAAiB,CAIjG"}
@@ -14,14 +14,33 @@ export interface ApiReferenceVariant {
14
14
  readonly description: string | null;
15
15
  readonly method: string;
16
16
  readonly path: string;
17
+ /**
18
+ * The canonical path when this route is the same operation reached through a parent
19
+ * (`x-wildo.aliasOfPath`), else `null`. The variant stays a variant — conservation counts it — and
20
+ * the view presents it under the canonical operation instead of as a duplicate.
21
+ */
22
+ readonly aliasOfPath: string | null;
17
23
  /** Source-projected authentication and authorization explanation. */
18
24
  readonly access: ApiReferenceAccess;
19
25
  readonly securitySchemes: readonly string[];
20
26
  readonly parameters: readonly ApiReferenceParameter[];
21
27
  readonly requestBody: ApiReferenceRequestBody | null;
22
28
  readonly responses: readonly ApiReferenceResponse[];
29
+ /** Documented failure modes from `x-wildo.errorScenarios`, in authored order. */
30
+ readonly errorScenarios: readonly ApiReferenceErrorScenario[];
23
31
  readonly idempotent: boolean | null;
24
32
  }
33
+ /**
34
+ * One documented failure mode, with each identifier named by the error-body field a client reads
35
+ * it from: `error.type`, `error.customMessageReference` and `error.code` are three fields.
36
+ */
37
+ export interface ApiReferenceErrorScenario {
38
+ readonly status: string;
39
+ readonly when: string;
40
+ readonly errorType: string | null;
41
+ readonly customMessageReference: string | null;
42
+ readonly errorCode: string | null;
43
+ }
25
44
  /** A standard OpenAPI parameter, normalized for a documentation renderer. */
26
45
  export interface ApiReferenceParameter {
27
46
  readonly name: string;
@@ -94,6 +113,11 @@ export interface ApiReferenceResource {
94
113
  readonly description: string | null;
95
114
  readonly lifecycleRole: string | null;
96
115
  readonly relationships: readonly ApiReferenceResourceRelationship[];
116
+ /**
117
+ * The reusable schema that IS this resource's representation (`x-wildo.objectSchema`), when the
118
+ * generator published one: "the Tasks object", shown once on the resource page.
119
+ */
120
+ readonly objectSchemaName: string | null;
97
121
  readonly families: readonly ApiReferenceFamily[];
98
122
  }
99
123
  /** A source-declared API-resource category, never inferred from resource names. */
@@ -125,6 +149,7 @@ export interface ApiReferenceSchemaNode {
125
149
  readonly types: readonly string[];
126
150
  readonly description: string | null;
127
151
  readonly format: string | null;
152
+ /** In the order the contract declares them — the view decides reading order, not the model. */
128
153
  readonly properties: readonly ApiReferenceSchemaProperty[];
129
154
  readonly items: ApiReferenceSchemaNode | null;
130
155
  readonly compositions: readonly ApiReferenceSchemaComposition[];