@wildo-ai/saas-technical-doc 1.1.4 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/build/csp-emit.d.ts.map +1 -1
- package/dist/esm/build/load-materialized-frontend-providers.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-administration-documentation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-administration-documentation.js.map +1 -1
- package/dist/esm/companion/application-documentation/application-authentication-documentation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-connection-documentation.d.ts +37 -0
- package/dist/esm/companion/application-documentation/application-connection-documentation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-connection-documentation.js +46 -5
- package/dist/esm/companion/application-documentation/application-connection-documentation.js.map +1 -1
- package/dist/esm/companion/application-documentation/application-documentation-chapters.d.ts +101 -0
- package/dist/esm/companion/application-documentation/application-documentation-chapters.d.ts.map +1 -0
- package/dist/esm/companion/application-documentation/application-documentation-chapters.js +205 -0
- package/dist/esm/companion/application-documentation/application-documentation-chapters.js.map +1 -0
- package/dist/esm/companion/application-documentation/application-domain-documentation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-domain-documentation.js.map +1 -1
- package/dist/esm/companion/application-documentation/application-integration-documentation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-integration-documentation.js.map +1 -1
- package/dist/esm/companion/application-documentation/application-organization-role-documentation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-organization-role-documentation.js.map +1 -1
- package/dist/esm/companion/application-documentation/application-organization-unit-resource-documentation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-organization-unit-resource-documentation.js +3 -0
- package/dist/esm/companion/application-documentation/application-organization-unit-resource-documentation.js.map +1 -1
- package/dist/esm/companion/application-documentation/docs-api-origin-substitution.d.ts +34 -0
- package/dist/esm/companion/application-documentation/docs-api-origin-substitution.d.ts.map +1 -0
- package/dist/esm/companion/application-documentation/docs-api-origin-substitution.js +45 -0
- package/dist/esm/companion/application-documentation/docs-api-origin-substitution.js.map +1 -0
- package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.d.ts +24 -10
- package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.js +25 -15
- package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.js.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-operational-evidence.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.d.ts +11 -3
- package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.js +9 -2
- package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.js.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.js +10 -4
- package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.js.map +1 -1
- package/dist/esm/companion/content/application-consumer-documentation-content-loader.d.ts.map +1 -1
- package/dist/esm/companion/index.d.ts +2 -0
- package/dist/esm/companion/index.d.ts.map +1 -1
- package/dist/esm/companion/index.js +2 -0
- package/dist/esm/companion/index.js.map +1 -1
- package/dist/esm/companion/manual-controller-route-projection.d.ts.map +1 -1
- package/dist/esm/companion/manual-controller-route-projection.js.map +1 -1
- package/dist/esm/companion/openapi-example-derivation.d.ts +53 -0
- package/dist/esm/companion/openapi-example-derivation.d.ts.map +1 -0
- package/dist/esm/companion/openapi-example-derivation.js +229 -0
- package/dist/esm/companion/openapi-example-derivation.js.map +1 -0
- package/dist/esm/companion/openapi-generator.d.ts +8 -4
- package/dist/esm/companion/openapi-generator.d.ts.map +1 -1
- package/dist/esm/companion/openapi-generator.js +323 -33
- package/dist/esm/companion/openapi-generator.js.map +1 -1
- package/dist/esm/companion/operation-projection.schemas.d.ts +57 -1
- package/dist/esm/companion/operation-projection.schemas.d.ts.map +1 -1
- package/dist/esm/companion/operation-projection.schemas.js +29 -0
- package/dist/esm/companion/operation-projection.schemas.js.map +1 -1
- package/dist/esm/companion/publish-result.types.d.ts.map +1 -1
- package/dist/esm/companion/publish-result.types.js.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-authorized-bundle-reader.d.ts.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.d.ts.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.js +8 -0
- package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.js.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.d.ts.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.js +20 -0
- package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.js.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.d.ts +2 -0
- package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.d.ts.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.js +48 -31
- package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.js.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-render-model.d.ts.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-render-model.js +26 -10
- package/dist/esm/companion/rendering/technical-documentation-render-model.js.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-search-index-renderer.d.ts.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-search-index-renderer.js.map +1 -1
- package/dist/esm/companion/spec-to-operation-doc.d.ts +52 -10
- package/dist/esm/companion/spec-to-operation-doc.d.ts.map +1 -1
- package/dist/esm/companion/spec-to-operation-doc.js +125 -7
- package/dist/esm/companion/spec-to-operation-doc.js.map +1 -1
- package/dist/esm/companion/technical-documentation-asset-path.d.ts.map +1 -1
- package/dist/esm/companion/technical-documentation-capture-execution-port.d.ts.map +1 -1
- package/dist/esm/companion/technical-documentation-capture-execution-port.js.map +1 -1
- package/dist/esm/companion/technical-documentation-diagram-definitions.d.ts.map +1 -1
- package/dist/esm/companion/technical-documentation-diagram-definitions.js.map +1 -1
- package/dist/esm/companion/technical-documentation-diagram-materializer.d.ts.map +1 -1
- package/dist/esm/companion/technical-documentation-diagram-materializer.js.map +1 -1
- package/dist/esm/companion/technical-documentation-placeholder-materializer.d.ts.map +1 -1
- package/dist/esm/companion/zod-to-openapi.d.ts.map +1 -1
- package/dist/esm/companion-exports.d.ts.map +1 -1
- package/dist/esm/config/define-tech-doc-config.d.ts.map +1 -1
- package/dist/esm/config/index.d.ts.map +1 -1
- package/dist/esm/config/wildo-tech-doc-config.schemas.d.ts.map +1 -1
- package/dist/esm/config/wildo-tech-doc-config.schemas.js.map +1 -1
- package/dist/esm/content/application-consumer-documentation-content-manifest.schemas.d.ts.map +1 -1
- package/dist/esm/content/application-consumer-documentation-content.techdoc.d.ts +27 -24
- package/dist/esm/content/application-consumer-documentation-content.techdoc.d.ts.map +1 -1
- package/dist/esm/content/application-consumer-documentation-content.techdoc.js +205 -82
- package/dist/esm/content/application-consumer-documentation-content.techdoc.js.map +1 -1
- package/dist/esm/content.exports.d.ts.map +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/openapi/api-reference-link-index.d.ts +3 -0
- package/dist/esm/openapi/api-reference-link-index.d.ts.map +1 -1
- package/dist/esm/openapi/api-reference-link-index.js +26 -15
- package/dist/esm/openapi/api-reference-link-index.js.map +1 -1
- package/dist/esm/openapi/api-reference-pages.d.ts +55 -0
- package/dist/esm/openapi/api-reference-pages.d.ts.map +1 -0
- package/dist/esm/openapi/api-reference-pages.js +229 -0
- package/dist/esm/openapi/api-reference-pages.js.map +1 -0
- package/dist/esm/openapi/api-reference-search.d.ts +53 -0
- package/dist/esm/openapi/api-reference-search.d.ts.map +1 -0
- package/dist/esm/openapi/api-reference-search.js +100 -0
- package/dist/esm/openapi/api-reference-search.js.map +1 -0
- package/dist/esm/openapi/api-reference-targets.d.ts +11 -0
- package/dist/esm/openapi/api-reference-targets.d.ts.map +1 -1
- package/dist/esm/openapi/api-reference-targets.js +8 -0
- package/dist/esm/openapi/api-reference-targets.js.map +1 -1
- package/dist/esm/openapi/index.d.ts +2 -0
- package/dist/esm/openapi/index.d.ts.map +1 -1
- package/dist/esm/openapi/index.js +2 -0
- package/dist/esm/openapi/index.js.map +1 -1
- package/dist/esm/openapi/openapi-generation-output.schemas.d.ts.map +1 -1
- package/dist/esm/openapi-reference-model.exports.d.ts +2 -0
- package/dist/esm/openapi-reference-model.exports.d.ts.map +1 -1
- package/dist/esm/openapi-reference-model.exports.js +2 -0
- package/dist/esm/openapi-reference-model.exports.js.map +1 -1
- package/dist/esm/runtime/AuthExchangePage.d.ts +45 -4
- package/dist/esm/runtime/AuthExchangePage.d.ts.map +1 -1
- package/dist/esm/runtime/AuthExchangePage.js +45 -12
- package/dist/esm/runtime/AuthExchangePage.js.map +1 -1
- package/dist/esm/runtime/DocsAuthContext.d.ts +2 -2
- package/dist/esm/runtime/DocsAuthContext.d.ts.map +1 -1
- package/dist/esm/runtime/DocsAuthContext.js +8 -4
- package/dist/esm/runtime/DocsAuthContext.js.map +1 -1
- package/dist/esm/runtime/DocsFrontendProviders.d.ts +30 -0
- package/dist/esm/runtime/DocsFrontendProviders.d.ts.map +1 -0
- package/dist/esm/runtime/DocsFrontendProviders.js +39 -0
- package/dist/esm/runtime/DocsFrontendProviders.js.map +1 -0
- package/dist/esm/runtime/DocsProviderComponent.d.ts +41 -0
- package/dist/esm/runtime/DocsProviderComponent.d.ts.map +1 -0
- package/dist/esm/runtime/DocsProviderComponent.js +17 -0
- package/dist/esm/runtime/DocsProviderComponent.js.map +1 -0
- package/dist/esm/runtime/decode-jwt-claims.d.ts.map +1 -1
- package/dist/esm/runtime/docs-auth-client.d.ts.map +1 -1
- package/dist/esm/runtime/docs-auth-session.schemas.d.ts.map +1 -1
- package/dist/esm/runtime/documentation-site-translator.d.ts +53 -0
- package/dist/esm/runtime/documentation-site-translator.d.ts.map +1 -0
- package/dist/esm/runtime/documentation-site-translator.js +51 -0
- package/dist/esm/runtime/documentation-site-translator.js.map +1 -0
- package/dist/esm/runtime/frontend-provider-registry.techdoc.d.ts +1 -2
- package/dist/esm/runtime/frontend-provider-registry.techdoc.d.ts.map +1 -1
- package/dist/esm/runtime/frontend-provider-registry.techdoc.js.map +1 -1
- package/dist/esm/runtime/index.d.ts +8 -0
- package/dist/esm/runtime/index.d.ts.map +1 -1
- package/dist/esm/runtime/index.js +8 -0
- package/dist/esm/runtime/index.js.map +1 -1
- package/dist/esm/runtime/openapi-reference-conservation.d.ts.map +1 -1
- package/dist/esm/runtime/openapi-reference-model.d.ts +30 -0
- package/dist/esm/runtime/openapi-reference-model.d.ts.map +1 -1
- package/dist/esm/runtime/openapi-reference-model.js +85 -11
- package/dist/esm/runtime/openapi-reference-model.js.map +1 -1
- package/dist/esm/runtime/openapi-reference-navigation.d.ts +50 -0
- package/dist/esm/runtime/openapi-reference-navigation.d.ts.map +1 -0
- package/dist/esm/runtime/openapi-reference-navigation.js +46 -0
- package/dist/esm/runtime/openapi-reference-navigation.js.map +1 -0
- package/dist/esm/runtime/openapi-reference-samples.d.ts +40 -0
- package/dist/esm/runtime/openapi-reference-samples.d.ts.map +1 -0
- package/dist/esm/runtime/openapi-reference-samples.js +169 -0
- package/dist/esm/runtime/openapi-reference-samples.js.map +1 -0
- package/dist/esm/runtime/openapi-reference-styles.d.ts +28 -0
- package/dist/esm/runtime/openapi-reference-styles.d.ts.map +1 -0
- package/dist/esm/runtime/openapi-reference-styles.js +292 -0
- package/dist/esm/runtime/openapi-reference-styles.js.map +1 -0
- package/dist/esm/runtime/openapi-reference-view.d.ts +40 -5
- package/dist/esm/runtime/openapi-reference-view.d.ts.map +1 -1
- package/dist/esm/runtime/openapi-reference-view.js +828 -82
- package/dist/esm/runtime/openapi-reference-view.js.map +1 -1
- package/dist/esm/runtime/openapi-reference-words-context.d.ts +12 -0
- package/dist/esm/runtime/openapi-reference-words-context.d.ts.map +1 -0
- package/dist/esm/runtime/openapi-reference-words-context.js +30 -0
- package/dist/esm/runtime/openapi-reference-words-context.js.map +1 -0
- package/dist/esm/runtime/openapi-reference-words.d.ts +205 -0
- package/dist/esm/runtime/openapi-reference-words.d.ts.map +1 -0
- package/dist/esm/runtime/openapi-reference-words.js +162 -0
- package/dist/esm/runtime/openapi-reference-words.js.map +1 -0
- package/dist/esm/runtime/provider-component-registry.techdoc.d.ts +31 -0
- package/dist/esm/runtime/provider-component-registry.techdoc.d.ts.map +1 -0
- package/dist/esm/runtime/provider-component-registry.techdoc.js +35 -0
- package/dist/esm/runtime/provider-component-registry.techdoc.js.map +1 -0
- package/dist/esm/runtime/use-docs-auth-session.d.ts.map +1 -1
- package/dist/esm/runtime/use-docs-frontend-provider-registry.d.ts +1 -0
- package/dist/esm/runtime/use-docs-frontend-provider-registry.d.ts.map +1 -1
- package/dist/esm/runtime/use-docs-frontend-provider-registry.js +10 -2
- package/dist/esm/runtime/use-docs-frontend-provider-registry.js.map +1 -1
- package/dist/esm/runtime/use-docs-provider-component.d.ts +29 -0
- package/dist/esm/runtime/use-docs-provider-component.d.ts.map +1 -0
- package/dist/esm/runtime/use-docs-provider-component.js +42 -0
- package/dist/esm/runtime/use-docs-provider-component.js.map +1 -0
- package/dist/esm/runtime/use-docs-provider-scripts.d.ts +37 -0
- package/dist/esm/runtime/use-docs-provider-scripts.d.ts.map +1 -0
- package/dist/esm/runtime/use-docs-provider-scripts.js +47 -0
- package/dist/esm/runtime/use-docs-provider-scripts.js.map +1 -0
- package/dist/esm/runtime/use-docs-provider-sdks.d.ts.map +1 -1
- package/dist/esm/runtime/use-docs-provider-sdks.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"technical-documentation-docusaurus-renderer.js","sourceRoot":"","sources":["../../../../src/companion/rend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;aACN,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,OAAO;QACL,SAAS,EAAE,6CAA6C,CAAC;YACvD,YAAY,EAAE,kCAAkC,CAAC,UAAU;YAC3D,WAAW,EAAE,uBAAuB;YACpC,eAAe,EAAE,CAAC;YAClB,gBAAgB,EAAE,8DAA8D;SACjF,CAAC;QACF,KAAK,EAAE;YACL,GAAG,SAAS;YACZ,GAAG,UAAU;YACb;gBACE,SAAS,EAAE,oDAAoD;gBAC/D,WAAW,EAAE,uBAAuB;gBACpC,UAAU,EAAE,gCAAgC,CAAC,gBAAgB;gBAC7D,cAAc,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;gBAC7D,sBAAsB,EAAE,0BAA0B;gBAClD,SAAS,EAAE,kBAAkB;gBAC7B,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;aAClE;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import {\n TechnicalDocumentationAssetResolutionStatus,\n TechnicalDocumentationLinkKind,\n TechnicalDocumentationOutputKind,\n TechnicalDocumentationRendererKind,\n type TechnicalDocumentationResolvedAssetBundleManifestV1,\n type TechnicalDocumentationApiReferenceTargetV1,\n type TechnicalDocumentationUnitV1,\n} from '@wildo-ai/saas-specifications/technical-documentation';\n\nimport { escapeMarkdownForMdx } from './technical-documentation-mdx-escaping';\nimport { isImplicitLeadSection, pruneUnpublishedSiteLinks } from './technical-documentation-markdown-links';\nimport {\n technicalDocumentationAssetFileStem,\n} from '../technical-documentation-asset-path';\nimport {\n createTechnicalDocumentationRendererExecution,\n type TechnicalDocumentationRenderModel,\n type TechnicalDocumentationRendererResult,\n ENGINE_UNIT_ROUTES,\n} from './technical-documentation-render-model';\n\n/**\n * Statuses whose asset carries real bytes at a real path, and therefore renders.\n *\n * `PLACEHOLDER` belongs here with `RESOLVED`: the framework materializes a stand-in image,\n * so the page shows a picture rather than a hole. That is the whole distinction from\n * `MISSING` — both mean \"the real capture has not run\", but only one of them SHIPS\n * something. Rendering is a question about bytes; whether provisional imagery may be\n * published at all is an environment policy decided at publication, not here.\n */\nconst RENDERABLE_ASSET_STATUSES: ReadonlySet<TechnicalDocumentationAssetResolutionStatus> = new Set([\n TechnicalDocumentationAssetResolutionStatus.PLACEHOLDER,\n TechnicalDocumentationAssetResolutionStatus.RESOLVED,\n]);\n\nconst DOCUSAURUS_RENDERER_REF = 'technical-documentation:renderer/docusaurus';\n\n/**\n * Reader-facing names for the product responsibilities in the portal.\n *\n * Folder names are stable routing mechanics, not customer copy: exposing\n * `user-administration` in the sidebar leaks a URL convention. A category\n * with a landing document links to that document and excludes it from the\n * dropdown, so readers select the category for orientation and expand it for\n * focused tasks. A landing may use the category's canonical root path or the\n * conventional nested `overview` path; the former keeps a public entry route\n * concise without introducing a redirect or duplicate document.\n */\nconst DOCUSAURUS_CATEGORY_LABEL_BY_DIRECTORY: Readonly<Record<string, string>> = {\n 'access-and-identity': 'Access and identity',\n /*\n * The per-resource pages nest under the page that lists them, which makes this a category the\n * moment an application publishes a resource of its own. It has a LANDING document at the\n * category's canonical root path — the overview — so a reader selects it for orientation and\n * expands it for one resource.\n *\n * The label is generic where the pages beneath it are not, and deliberately: an application's\n * own name for this part of its product is a fact only the application has, and it already\n * states it inside the page. Putting a projected value here would make the sidebar the one\n * surface whose words come from somewhere the renderer cannot see.\n */\n 'what-this-application-manages': 'What this application manages',\n integrations: 'Integrations',\n 'security-and-audit': 'Security and audit',\n 'user-administration': 'User administration',\n};\n\ntype DocusaurusJourneyItem = string | {\n readonly landingPath: string;\n readonly childPaths: readonly string[];\n};\n\ntype DocusaurusSidebarItem = string | {\n readonly type: 'category';\n readonly label: string;\n readonly collapsible: true;\n readonly collapsed: true;\n readonly link?: { readonly type: 'doc'; readonly id: string };\n readonly items: readonly DocusaurusSidebarItem[];\n};\n\n/**\n * A category is a reader journey, not an alphabetized file listing. Most\n * categories need no override; user administration does, because readers first\n * choose how accounts are managed and then follow the relevant task sequence.\n *\n * A journey landing is rendered as a clickable second-level category. It is\n * deliberately absent from that category's children: selecting the label opens\n * the explanation, while expanding it reveals the concrete tasks. Plain paths\n * remain direct children for work that spans several journeys.\n */\nconst DOCUSAURUS_CATEGORY_JOURNEY_BY_DIRECTORY: Readonly<Record<string, readonly DocusaurusJourneyItem[]>> = {\n 'security-and-audit': [\n // First in the section on purpose: somebody reaching this during an incident has no time to\n // browse, and every other page here is a capability rather than a response.\n 'security-and-audit/respond-to-leaked-credential',\n 'security-and-audit/investigate-event',\n 'security-and-audit/review-access-changes',\n 'security-and-audit/export-audit-records',\n {\n landingPath: 'security-and-audit/configure-siem',\n childPaths: [\n 'security-and-audit/siem-splunk',\n 'security-and-audit/siem-microsoft-sentinel',\n 'security-and-audit/siem-elastic',\n 'security-and-audit/operate-siem',\n ],\n },\n 'security-and-audit/protect-evidence',\n ],\n 'access-and-identity': [\n {\n landingPath: 'access-and-identity/sign-in-and-mfa',\n childPaths: [\n 'access-and-identity/complete-sign-in',\n 'access-and-identity/mfa-enrollment-and-recovery',\n 'access-and-identity/sign-in-troubleshoot',\n ],\n },\n {\n landingPath: 'access-and-identity/single-sign-on',\n childPaths: [\n 'access-and-identity/sso-configure',\n 'access-and-identity/sso-rollout-and-recovery',\n 'access-and-identity/sso-troubleshoot',\n ],\n },\n {\n landingPath: 'access-and-identity/api-keys',\n childPaths: [\n 'access-and-identity/api-keys-create-and-store',\n 'access-and-identity/api-keys-lifecycle',\n 'access-and-identity/api-keys-troubleshoot',\n ],\n },\n {\n landingPath: 'access-and-identity/oauth-provider',\n childPaths: [\n 'access-and-identity/oauth-register-client',\n 'access-and-identity/oauth-authorize-delegated-access',\n 'access-and-identity/oauth-operate-and-revoke',\n ],\n },\n ],\n 'user-administration': [\n {\n landingPath: 'user-administration/manage-users-manually',\n childPaths: [\n 'user-administration/invite-and-onboard-user',\n 'user-administration/roles-and-permissions',\n 'user-administration/change-user-access',\n 'user-administration/suspend-or-remove-user',\n ],\n },\n {\n landingPath: 'user-administration/manage-organization-units',\n childPaths: [\n 'user-administration/design-organization-unit-hierarchy',\n 'user-administration/assign-organization-unit-access',\n 'user-administration/operate-organization-units',\n ],\n },\n 'user-administration/review-users-and-access',\n 'user-administration/troubleshoot-user-access',\n {\n landingPath: 'user-administration/scim-provisioning',\n childPaths: [\n 'user-administration/scim-protocol-and-payloads',\n 'user-administration/scim-configure',\n 'user-administration/scim-microsoft-entra',\n 'user-administration/scim-okta',\n 'user-administration/scim-ldap-and-active-directory',\n 'user-administration/scim-map-profile-and-units',\n 'user-administration/scim-validate-and-roll-out',\n 'user-administration/scim-operate-and-troubleshoot',\n ],\n },\n ],\n integrations: [\n {\n landingPath: 'integrations/automation-platforms',\n childPaths: [\n 'integrations/automation/n8n',\n 'integrations/automation/zapier',\n 'integrations/automation/make',\n ],\n },\n {\n landingPath: 'integrations/ai-coding-tools',\n childPaths: [\n 'integrations/ai-tools/cursor',\n 'integrations/ai-tools/codex',\n 'integrations/ai-tools/claude-code',\n ],\n },\n {\n landingPath: 'integrations/rest-api',\n childPaths: [\n 'integrations/rest/conventions',\n 'integrations/rest/send-request',\n 'integrations/rest/read-collections',\n 'integrations/rest/write-and-reconcile',\n 'integrations/rest/troubleshoot',\n ],\n },\n {\n landingPath: 'integrations/webhooks',\n childPaths: [\n 'integrations/webhooks/configure-and-test',\n 'integrations/webhooks/verify-delivery',\n 'integrations/webhooks/operate-deliveries',\n 'integrations/webhooks/troubleshoot',\n ],\n },\n {\n landingPath: 'integrations/agents',\n childPaths: [\n 'integrations/mcp',\n 'integrations/a2a',\n ],\n },\n 'integrations/create-your-own-integration',\n ],\n};\n\nfunction renderDocusaurusCategoryItems(input: {\n readonly directory: string;\n readonly itemPaths: readonly string[];\n readonly unitTitleByPath: ReadonlyMap<string, string>;\n}): DocusaurusSidebarItem[] {\n const availablePaths = new Set(input.itemPaths);\n const claimedPaths = new Set<string>();\n const journey = DOCUSAURUS_CATEGORY_JOURNEY_BY_DIRECTORY[input.directory] ?? [];\n const renderedJourney = journey.flatMap((item): DocusaurusSidebarItem[] => {\n if (typeof item === 'string') {\n if (!availablePaths.has(item)) return [];\n claimedPaths.add(item);\n return [item];\n }\n\n const availableChildPaths = item.childPaths.filter((path) => availablePaths.has(path));\n for (const path of availableChildPaths) claimedPaths.add(path);\n if (!availablePaths.has(item.landingPath)) {\n // Applicability may omit a landing while retaining an independently\n // useful task. Never hide those tasks merely because their group cannot\n // be rendered as a linked category in this publication.\n return availableChildPaths;\n }\n\n const label = input.unitTitleByPath.get(item.landingPath);\n if (label === undefined) throw new Error(`technical-documentation Docusaurus journey landing is missing a reader title: ${item.landingPath}`);\n claimedPaths.add(item.landingPath);\n // A landing without applicable child tasks is a document, not an empty\n // disclosure control. This preserves the same no-duplicate/no-empty-arrow\n // rule used for top-level single-page responsibilities.\n if (availableChildPaths.length === 0) return [item.landingPath];\n return [{\n type: 'category',\n label,\n collapsible: true,\n collapsed: true,\n link: { type: 'doc', id: item.landingPath },\n items: availableChildPaths,\n }];\n });\n\n return [\n ...renderedJourney,\n ...input.itemPaths.filter((path) => !claimedPaths.has(path)).sort((left, right) => left.localeCompare(right)),\n ];\n}\n\n/**\n * Authors use tilde fences because this content module itself is a TypeScript\n * template literal. CommonMark accepts them, but the installed Docusaurus\n * Mermaid integration recognizes backtick fences only. Normalize just a\n * well-formed Mermaid pair at this renderer boundary: prose authors stay\n * renderer-neutral, while the renderer emits the fence syntax its MDX plugin\n * actually executes. Other fenced examples retain their authored delimiter.\n */\nfunction normalizeMermaidFencesForDocusaurus(markdown: string): string {\n let insideTildeMermaidFence = false;\n return markdown.split('\\n').map((line) => {\n if (/^\\s{0,3}~~~mermaid\\s*$/.test(line)) {\n insideTildeMermaidFence = true;\n return line.replace('~~~mermaid', '```mermaid');\n }\n if (insideTildeMermaidFence && /^\\s{0,3}~~~\\s*$/.test(line)) {\n insideTildeMermaidFence = false;\n return line.replace('~~~', '```');\n }\n return line;\n }).join('\\n');\n}\n\nfunction renderUnit(unit: TechnicalDocumentationUnitV1, model: TechnicalDocumentationRenderModel, assetPathByRef: ReadonlyMap<string, string>, resolveApiReferenceTarget?: (target: TechnicalDocumentationApiReferenceTargetV1) => string | null): string {\n const path = model.unitPathByRef.get(unit.unitRef) as string;\n // Every field below carries authored or derived PROSE into an `.mdx` file, so each one is a\n // site where a route template like `/organizations/{organizationId}/todos` would compile fine\n // and then crash the page in the reader's browser. Escaping is applied per field rather than\n // once over the assembled document on purpose: the assembly also emits `---` frontmatter and\n // Markdown punctuation this must not touch, and `title` is JSON-encoded rather than Markdown.\n const publishedPaths = new Set(model.unitPathByRef.values());\n const sections = unit.sections\n .map((section, index) => {\n const body = escapeMarkdownForMdx(pruneUnpublishedSiteLinks(normalizeMermaidFencesForDocusaurus(section.bodyMarkdown), publishedPaths, ENGINE_UNIT_ROUTES));\n // The lead section is what the author wrote between the title and the first `##`. It is\n // the page's opening, not a section called \"Overview\", so it renders without a heading.\n return isImplicitLeadSection(section, index) ? body : `## ${escapeMarkdownForMdx(section.heading)}\\n\\n${body}`;\n })\n .join('\\n\\n');\n const figures = unit.assetRequests.flatMap((request) => {\n const assetPath = assetPathByRef.get(request.assetRef);\n return assetPath === undefined ? [] : [``];\n });\n const links = unit.links.flatMap((link) => {\n const label = escapeMarkdownForMdx(link.label);\n if (link.kind === TechnicalDocumentationLinkKind.UNIT) {\n const target = model.unitPathByRef.get(link.targetUnitRef as string);\n if (target === undefined) throw new Error(`technical-documentation Docusaurus link target is absent: ${link.targetUnitRef}`);\n return [`- [${label}](/${target})`];\n }\n if (link.kind === TechnicalDocumentationLinkKind.EXTERNAL) return [`- [${label}](${link.externalUrl})`];\n if (link.kind === TechnicalDocumentationLinkKind.API_REFERENCE) {\n if (resolveApiReferenceTarget === undefined) throw new Error(`technical-documentation API-reference link was not resolved before Docusaurus rendering: ${link.linkRef}`);\n /*\n * A `null` resolution means the target is not published by THIS application — a guide links to\n * a resource the application has feature-gated off. It degrades to plain text; the rest of the\n * portal publishes (#472, decided 2026-09-08).\n *\n * This used to throw, from inside `renderUnit`, which runs BEFORE the generated tree is\n * synchronized — so one missing target wrote NOTHING AT ALL. Not a broken link: no portal.\n * With 43 hardcoded engine `apiReferenceTargets` naming resources an application may switch\n * off, any application not enabling all 43 could not publish documentation.\n *\n * The `undefined` guard above is a DIFFERENT failure and still throws: it means the caller\n * wired no resolver, so nothing was even asked. Degrading there would hide a wiring mistake.\n *\n * Reporting the degradation is the CALLER's job — see the resolver the companion supplies. A\n * portal that quietly drops links would be worse than one that failed loudly, which is why\n * this half is not the whole fix.\n */\n const href = resolveApiReferenceTarget(link.apiReferenceTarget as TechnicalDocumentationApiReferenceTargetV1);\n return href === null ? [`- ${label}`] : [`- [${label}](${href})`];\n }\n return [];\n });\n const assetSection = figures.length === 0 ? '' : `\\n\\n## Product view\\n\\n${figures.join('\\n\\n')}`;\n const relatedSection = links.length === 0 ? '' : `\\n\\n## Related\\n\\n${links.join('\\n')}`;\n const summary = escapeMarkdownForMdx(unit.summary);\n return `---\\nid: ${path.split('/').at(-1)}\\ntitle: ${JSON.stringify(unit.title)}\\nsidebar_label: ${JSON.stringify(unit.title)}\\n---\\n\\n${summary}\\n\\n${sections}${assetSection}${relatedSection}\\n`;\n}\n\nfunction renderDocusaurusSidebars(model: TechnicalDocumentationRenderModel): string {\n const rootDocumentPaths: string[] = [];\n const rootDocumentPathSet = new Set<string>();\n const categoryItems: DocusaurusSidebarItem[] = [];\n const claimedRootLandingPaths = new Set<string>();\n const pathsByDirectory = new Map<string, string[]>();\n const unitTitleByPath = new Map<string, string>();\n for (const unit of model.units) {\n const path = model.unitPathByRef.get(unit.unitRef) as string;\n unitTitleByPath.set(path, unit.title);\n const [directory] = path.split('/');\n if (directory === undefined || !path.includes('/')) {\n rootDocumentPaths.push(path);\n rootDocumentPathSet.add(path);\n continue;\n }\n const paths = pathsByDirectory.get(directory) ?? [];\n paths.push(path);\n pathsByDirectory.set(directory, paths);\n }\n\n for (const [directory, paths] of [...pathsByDirectory.entries()].sort(([left], [right]) => left.localeCompare(right))) {\n const label = DOCUSAURUS_CATEGORY_LABEL_BY_DIRECTORY[directory];\n if (label === undefined) throw new Error(`technical-documentation Docusaurus category is missing a reader label: ${directory}`);\n const overviewPath = `${directory}/overview`;\n // A root document and a child directory may deliberately share one route\n // identity (`user-administration` + `user-administration/*`). That exact\n // path relation—not mutable display copy—makes the root document the\n // category landing. Labels remain free to evolve without breaking IA.\n const rootLandingPath = rootDocumentPathSet.has(directory) ? directory : undefined;\n const landingPath = paths.includes(overviewPath) ? overviewPath : rootLandingPath;\n if (rootLandingPath !== undefined && landingPath === rootLandingPath) claimedRootLandingPaths.add(rootLandingPath);\n const itemPaths = paths.filter((path) => path !== overviewPath);\n const [onlyItemPath] = itemPaths;\n\n // A category with one identically named document is not a journey: rendering\n // both creates two adjacent controls with the same reader meaning. Flatten\n // only that exact shape. A differently named single document remains under\n // its responsibility label because the category still adds useful context.\n if (landingPath === undefined && itemPaths.length === 1 && onlyItemPath !== undefined && unitTitleByPath.get(onlyItemPath) === label) {\n categoryItems.push(onlyItemPath);\n continue;\n }\n\n const orderedItems = renderDocusaurusCategoryItems({ directory, itemPaths, unitTitleByPath });\n categoryItems.push({\n type: 'category',\n label,\n collapsible: true,\n // Docusaurus expands the category containing the active document. Keeping\n // other journeys collapsed makes the sidebar scale with the catalogue.\n collapsed: true,\n ...(landingPath === undefined ? {} : { link: { type: 'doc', id: landingPath } }),\n items: orderedItems,\n });\n }\n\n const rootItems = [\n ...rootDocumentPaths.filter((path) => !claimedRootLandingPaths.has(path)),\n ...categoryItems,\n ];\n return `${JSON.stringify({ docs: rootItems }, null, 2)}\\n`;\n}\n\nexport function renderTechnicalDocumentationDocusaurus(input: {\n readonly model: TechnicalDocumentationRenderModel;\n readonly resolvedAssetBundle: TechnicalDocumentationResolvedAssetBundleManifestV1;\n readonly assetBytesByPath: ReadonlyMap<string, Uint8Array>;\n /**\n * Resolves a guide's API-reference target to a public href, or returns `null` when this\n * application does not publish it — a link to a feature-gated resource. `null` degrades the link\n * to plain text rather than failing the render (#472). Reporting the degradation belongs to\n * whoever supplies this function; the renderer only renders.\n */\n readonly resolveApiReferenceTarget?: (target: TechnicalDocumentationApiReferenceTargetV1) => string | null;\n}): TechnicalDocumentationRendererResult {\n const assetPathByRef = new Map(input.resolvedAssetBundle.resolvedAssetSet.assets.flatMap((asset) =>\n RENDERABLE_ASSET_STATUSES.has(asset.status) ? [[asset.assetRef, asset.normalizedRelativePath as string]] : []));\n const sourceUnitRefsByAssetRef = new Map<string, string[]>();\n for (const unit of input.model.units) {\n for (const request of unit.assetRequests) {\n const owners = sourceUnitRefsByAssetRef.get(request.assetRef) ?? [];\n owners.push(unit.unitRef);\n sourceUnitRefsByAssetRef.set(request.assetRef, owners);\n }\n }\n const pageFiles = input.model.units.map((unit) => {\n const path = input.model.unitPathByRef.get(unit.unitRef) as string;\n return {\n // The full route identity is part of the output identity. Two valid pages\n // may share their final slug (`integrations/todos` and\n // `user-administration/users`) without sharing a file or a manifest row.\n outputRef: `technical-documentation:output/docusaurus/${path.split('/').join(':')}`,\n rendererRef: DOCUSAURUS_RENDERER_REF,\n outputKind: TechnicalDocumentationOutputKind.MARKDOWN_DOCUMENT,\n sourceUnitRefs: [unit.unitRef],\n normalizedRelativePath: `docusaurus/docs/${path}.mdx`,\n mediaType: 'text/mdx',\n bytes: Buffer.from(renderUnit(unit, input.model, assetPathByRef, input.resolveApiReferenceTarget), 'utf8'),\n } as const;\n });\n const assetFiles = input.resolvedAssetBundle.resolvedAssetSet.assets.flatMap((asset) => {\n if (!RENDERABLE_ASSET_STATUSES.has(asset.status)) return [];\n const path = asset.normalizedRelativePath as string;\n const bytes = input.assetBytesByPath.get(path);\n if (bytes === undefined) throw new Error(`technical-documentation Docusaurus asset bytes are absent: ${path}`);\n const sourceUnitRefs = [...(sourceUnitRefsByAssetRef.get(asset.assetRef) ?? [])].sort();\n if (sourceUnitRefs.length === 0) throw new Error(`technical-documentation resolved asset has no authorized unit owner: ${asset.assetRef}`);\n return [{\n outputRef: `technical-documentation:output/asset/${technicalDocumentationAssetFileStem(asset.assetRef)}`,\n rendererRef: DOCUSAURUS_RENDERER_REF,\n outputKind: TechnicalDocumentationOutputKind.ASSET,\n sourceUnitRefs,\n normalizedRelativePath: `docusaurus/static/${path}`,\n mediaType: asset.mediaType,\n bytes,\n }];\n });\n return {\n execution: createTechnicalDocumentationRendererExecution({\n rendererKind: TechnicalDocumentationRendererKind.DOCUSAURUS,\n rendererRef: DOCUSAURUS_RENDERER_REF,\n rendererVersion: 1,\n configurationRef: 'technical-documentation:renderer-configuration/docusaurus-v1',\n }),\n files: [\n ...pageFiles,\n ...assetFiles,\n {\n outputRef: 'technical-documentation:output/docusaurus-sidebars',\n rendererRef: DOCUSAURUS_RENDERER_REF,\n outputKind: TechnicalDocumentationOutputKind.NAVIGATION_INDEX,\n sourceUnitRefs: input.model.units.map((unit) => unit.unitRef),\n normalizedRelativePath: 'docusaurus/sidebars.json',\n mediaType: 'application/json',\n bytes: Buffer.from(renderDocusaurusSidebars(input.model), 'utf8'),\n },\n ],\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"technical-documentation-docusaurus-renderer.js","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-docusaurus-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2CAA2C,EAC3C,8BAA8B,EAC9B,gCAAgC,EAChC,kCAAkC,GAInC,MAAM,uDAAuD,CAAC;AAE/D,OAAO,EAAE,iDAAiD,EAAE,MAAM,iEAAiE,CAAC;AACpI,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAC5G,OAAO,EACL,mCAAmC,GACpC,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,6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SAAS,EAAE,oDAAoD;gBAC/D,WAAW,EAAE,uBAAuB;gBACpC,UAAU,EAAE,gCAAgC,CAAC,gBAAgB;gBAC7D,cAAc,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;gBAC7D,sBAAsB,EAAE,0BAA0B;gBAClD,SAAS,EAAE,kBAAkB;gBAC7B,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;aAClE;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import {\n TechnicalDocumentationAssetResolutionStatus,\n TechnicalDocumentationLinkKind,\n TechnicalDocumentationOutputKind,\n TechnicalDocumentationRendererKind,\n type TechnicalDocumentationResolvedAssetBundleManifestV1,\n type TechnicalDocumentationApiReferenceTargetV1,\n type TechnicalDocumentationUnitV1,\n} from '@wildo-ai/saas-specifications/technical-documentation';\n\nimport { APPLICATION_DOCUMENTATION_CHAPTER_ROUTE_DIRECTORY } from '../application-documentation/application-documentation-chapters';\nimport { escapeMarkdownForMdx } from './technical-documentation-mdx-escaping';\nimport { isImplicitLeadSection, pruneUnpublishedSiteLinks } from './technical-documentation-markdown-links';\nimport {\n technicalDocumentationAssetFileStem,\n} from '../technical-documentation-asset-path';\nimport {\n createTechnicalDocumentationRendererExecution,\n type TechnicalDocumentationRenderModel,\n type TechnicalDocumentationRendererResult,\n ENGINE_UNIT_ROUTES,\n} from './technical-documentation-render-model';\n\n/**\n * Statuses whose asset carries real bytes at a real path, and therefore renders.\n *\n * `PLACEHOLDER` belongs here with `RESOLVED`: the framework materializes a stand-in image,\n * so the page shows a picture rather than a hole. That is the whole distinction from\n * `MISSING` — both mean \"the real capture has not run\", but only one of them SHIPS\n * something. Rendering is a question about bytes; whether provisional imagery may be\n * published at all is an environment policy decided at publication, not here.\n */\nconst RENDERABLE_ASSET_STATUSES: ReadonlySet<TechnicalDocumentationAssetResolutionStatus> = new Set([\n TechnicalDocumentationAssetResolutionStatus.PLACEHOLDER,\n TechnicalDocumentationAssetResolutionStatus.RESOLVED,\n]);\n\nconst DOCUSAURUS_RENDERER_REF = 'technical-documentation:renderer/docusaurus';\n\n/**\n * Reader-facing names for the product responsibilities in the portal.\n *\n * Folder names are stable routing mechanics, not customer copy: exposing\n * `user-administration` in the sidebar leaks a URL convention. A category\n * with a landing document links to that document and excludes it from the\n * dropdown, so readers select the category for orientation and expand it for\n * focused tasks. A landing may use the category's canonical root path or the\n * conventional nested `overview` path; the former keeps a public entry route\n * concise without introducing a redirect or duplicate document.\n */\nconst DOCUSAURUS_CATEGORY_LABEL_BY_DIRECTORY: Readonly<Record<string, string>> = {\n 'access-and-identity': 'Access and identity',\n /*\n * The per-resource pages nest under the page that lists them, which makes this a category the\n * moment an application publishes a resource of its own. It has a LANDING document at the\n * category's canonical root path — the overview — so a reader selects it for orientation and\n * expands it for one resource.\n *\n * The label is generic where the pages beneath it are not, and deliberately: an application's\n * own name for this part of its product is a fact only the application has, and it already\n * states it inside the page. Putting a projected value here would make the sidebar the one\n * surface whose words come from somewhere the renderer cannot see.\n */\n 'what-this-application-manages': 'What this application manages',\n /*\n * The chapters the APPLICATION authored (#874): its business journeys, administrator tasks and\n * troubleshooting, written against its own resources. Generic for the reason the label above is —\n * each page carries its own title, and a sidebar word projected from the application would be the\n * one surface whose words come from somewhere this renderer cannot see.\n */\n [APPLICATION_DOCUMENTATION_CHAPTER_ROUTE_DIRECTORY]: 'Guides',\n integrations: 'Integrations',\n 'security-and-audit': 'Security and audit',\n 'user-administration': 'User administration',\n};\n\ntype DocusaurusJourneyItem = string | {\n readonly landingPath: string;\n readonly childPaths: readonly string[];\n};\n\ntype DocusaurusSidebarItem = string | {\n readonly type: 'category';\n readonly label: string;\n readonly collapsible: true;\n readonly collapsed: true;\n readonly link?: { readonly type: 'doc'; readonly id: string };\n readonly items: readonly DocusaurusSidebarItem[];\n};\n\n/**\n * A category is a reader journey, not an alphabetized file listing. Most\n * categories need no override; user administration does, because readers first\n * choose how accounts are managed and then follow the relevant task sequence.\n *\n * A journey landing is rendered as a clickable second-level category. It is\n * deliberately absent from that category's children: selecting the label opens\n * the explanation, while expanding it reveals the concrete tasks. Plain paths\n * remain direct children for work that spans several journeys.\n */\nconst DOCUSAURUS_CATEGORY_JOURNEY_BY_DIRECTORY: Readonly<Record<string, readonly DocusaurusJourneyItem[]>> = {\n 'security-and-audit': [\n // First in the section on purpose: somebody reaching this during an incident has no time to\n // browse, and every other page here is a capability rather than a response.\n 'security-and-audit/respond-to-leaked-credential',\n 'security-and-audit/investigate-event',\n 'security-and-audit/review-access-changes',\n 'security-and-audit/export-audit-records',\n {\n landingPath: 'security-and-audit/configure-siem',\n childPaths: [\n 'security-and-audit/siem-splunk',\n 'security-and-audit/siem-microsoft-sentinel',\n 'security-and-audit/siem-elastic',\n 'security-and-audit/operate-siem',\n ],\n },\n 'security-and-audit/protect-evidence',\n ],\n 'access-and-identity': [\n {\n landingPath: 'access-and-identity/sign-in-and-mfa',\n childPaths: [\n 'access-and-identity/complete-sign-in',\n 'access-and-identity/mfa-enrollment-and-recovery',\n 'access-and-identity/sign-in-troubleshoot',\n ],\n },\n {\n landingPath: 'access-and-identity/single-sign-on',\n childPaths: [\n 'access-and-identity/sso-configure',\n 'access-and-identity/sso-rollout-and-recovery',\n 'access-and-identity/sso-troubleshoot',\n ],\n },\n {\n landingPath: 'access-and-identity/api-keys',\n childPaths: [\n 'access-and-identity/api-keys-create-and-store',\n 'access-and-identity/api-keys-lifecycle',\n 'access-and-identity/api-keys-troubleshoot',\n ],\n },\n {\n landingPath: 'access-and-identity/oauth-provider',\n childPaths: [\n 'access-and-identity/oauth-register-client',\n 'access-and-identity/oauth-authorize-delegated-access',\n 'access-and-identity/oauth-operate-and-revoke',\n ],\n },\n ],\n 'user-administration': [\n {\n landingPath: 'user-administration/manage-users-manually',\n childPaths: [\n 'user-administration/invite-and-onboard-user',\n 'user-administration/roles-and-permissions',\n 'user-administration/change-user-access',\n 'user-administration/suspend-or-remove-user',\n ],\n },\n {\n landingPath: 'user-administration/manage-organization-units',\n childPaths: [\n 'user-administration/design-organization-unit-hierarchy',\n 'user-administration/assign-organization-unit-access',\n 'user-administration/operate-organization-units',\n ],\n },\n 'user-administration/review-users-and-access',\n 'user-administration/troubleshoot-user-access',\n {\n landingPath: 'user-administration/scim-provisioning',\n childPaths: [\n 'user-administration/scim-protocol-and-payloads',\n 'user-administration/scim-configure',\n 'user-administration/scim-microsoft-entra',\n 'user-administration/scim-okta',\n 'user-administration/scim-ldap-and-active-directory',\n 'user-administration/scim-map-profile-and-units',\n 'user-administration/scim-validate-and-roll-out',\n 'user-administration/scim-operate-and-troubleshoot',\n ],\n },\n ],\n integrations: [\n {\n landingPath: 'integrations/automation-platforms',\n childPaths: [\n 'integrations/automation/n8n',\n 'integrations/automation/zapier',\n 'integrations/automation/make',\n ],\n },\n {\n landingPath: 'integrations/ai-coding-tools',\n childPaths: [\n 'integrations/ai-tools/cursor',\n 'integrations/ai-tools/codex',\n 'integrations/ai-tools/claude-code',\n ],\n },\n {\n landingPath: 'integrations/rest-api',\n childPaths: [\n 'integrations/rest/conventions',\n 'integrations/rest/send-request',\n 'integrations/rest/read-collections',\n 'integrations/rest/write-and-reconcile',\n 'integrations/rest/troubleshoot',\n ],\n },\n {\n landingPath: 'integrations/webhooks',\n childPaths: [\n 'integrations/webhooks/configure-and-test',\n 'integrations/webhooks/verify-delivery',\n 'integrations/webhooks/operate-deliveries',\n 'integrations/webhooks/troubleshoot',\n ],\n },\n {\n landingPath: 'integrations/agents',\n childPaths: [\n 'integrations/mcp',\n 'integrations/a2a',\n ],\n },\n 'integrations/create-your-own-integration',\n ],\n};\n\nfunction renderDocusaurusCategoryItems(input: {\n readonly directory: string;\n readonly itemPaths: readonly string[];\n readonly unitTitleByPath: ReadonlyMap<string, string>;\n}): DocusaurusSidebarItem[] {\n const availablePaths = new Set(input.itemPaths);\n const claimedPaths = new Set<string>();\n const journey = DOCUSAURUS_CATEGORY_JOURNEY_BY_DIRECTORY[input.directory] ?? [];\n const renderedJourney = journey.flatMap((item): DocusaurusSidebarItem[] => {\n if (typeof item === 'string') {\n if (!availablePaths.has(item)) return [];\n claimedPaths.add(item);\n return [item];\n }\n\n const availableChildPaths = item.childPaths.filter((path) => availablePaths.has(path));\n for (const path of availableChildPaths) claimedPaths.add(path);\n if (!availablePaths.has(item.landingPath)) {\n // Applicability may omit a landing while retaining an independently\n // useful task. Never hide those tasks merely because their group cannot\n // be rendered as a linked category in this publication.\n return availableChildPaths;\n }\n\n const label = input.unitTitleByPath.get(item.landingPath);\n if (label === undefined) throw new Error(`technical-documentation Docusaurus journey landing is missing a reader title: ${item.landingPath}`);\n claimedPaths.add(item.landingPath);\n // A landing without applicable child tasks is a document, not an empty\n // disclosure control. This preserves the same no-duplicate/no-empty-arrow\n // rule used for top-level single-page responsibilities.\n if (availableChildPaths.length === 0) return [item.landingPath];\n return [{\n type: 'category',\n label,\n collapsible: true,\n collapsed: true,\n link: { type: 'doc', id: item.landingPath },\n items: availableChildPaths,\n }];\n });\n\n return [\n ...renderedJourney,\n ...input.itemPaths.filter((path) => !claimedPaths.has(path)).sort((left, right) => left.localeCompare(right)),\n ];\n}\n\n/**\n * Authors use tilde fences because this content module itself is a TypeScript\n * template literal. CommonMark accepts them, but the installed Docusaurus\n * Mermaid integration recognizes backtick fences only. Normalize just a\n * well-formed Mermaid pair at this renderer boundary: prose authors stay\n * renderer-neutral, while the renderer emits the fence syntax its MDX plugin\n * actually executes. Other fenced examples retain their authored delimiter.\n */\nfunction normalizeMermaidFencesForDocusaurus(markdown: string): string {\n let insideTildeMermaidFence = false;\n return markdown.split('\\n').map((line) => {\n if (/^\\s{0,3}~~~mermaid\\s*$/.test(line)) {\n insideTildeMermaidFence = true;\n return line.replace('~~~mermaid', '```mermaid');\n }\n if (insideTildeMermaidFence && /^\\s{0,3}~~~\\s*$/.test(line)) {\n insideTildeMermaidFence = false;\n return line.replace('~~~', '```');\n }\n return line;\n }).join('\\n');\n}\n\nfunction renderUnit(unit: TechnicalDocumentationUnitV1, model: TechnicalDocumentationRenderModel, assetPathByRef: ReadonlyMap<string, string>, resolveApiReferenceTarget?: (target: TechnicalDocumentationApiReferenceTargetV1) => string | null): string {\n const path = model.unitPathByRef.get(unit.unitRef) as string;\n // Every field below carries authored or derived PROSE into an `.mdx` file, so each one is a\n // site where a route template like `/organizations/{organizationId}/todos` would compile fine\n // and then crash the page in the reader's browser. Escaping is applied per field rather than\n // once over the assembled document on purpose: the assembly also emits `---` frontmatter and\n // Markdown punctuation this must not touch, and `title` is JSON-encoded rather than Markdown.\n const publishedPaths = new Set(model.unitPathByRef.values());\n const sections = unit.sections\n .map((section, index) => {\n const body = escapeMarkdownForMdx(pruneUnpublishedSiteLinks(normalizeMermaidFencesForDocusaurus(section.bodyMarkdown), publishedPaths, ENGINE_UNIT_ROUTES));\n // The lead section is what the author wrote between the title and the first `##`. It is\n // the page's opening, not a section called \"Overview\", so it renders without a heading.\n return isImplicitLeadSection(section, index) ? body : `## ${escapeMarkdownForMdx(section.heading)}\\n\\n${body}`;\n })\n .join('\\n\\n');\n const figures = unit.assetRequests.flatMap((request) => {\n const assetPath = assetPathByRef.get(request.assetRef);\n return assetPath === undefined ? [] : [``];\n });\n const links = unit.links.flatMap((link) => {\n const label = escapeMarkdownForMdx(link.label);\n if (link.kind === TechnicalDocumentationLinkKind.UNIT) {\n const target = model.unitPathByRef.get(link.targetUnitRef as string);\n if (target === undefined) throw new Error(`technical-documentation Docusaurus link target is absent: ${link.targetUnitRef}`);\n return [`- [${label}](/${target})`];\n }\n if (link.kind === TechnicalDocumentationLinkKind.EXTERNAL) return [`- [${label}](${link.externalUrl})`];\n if (link.kind === TechnicalDocumentationLinkKind.API_REFERENCE) {\n if (resolveApiReferenceTarget === undefined) throw new Error(`technical-documentation API-reference link was not resolved before Docusaurus rendering: ${link.linkRef}`);\n /*\n * A `null` resolution means the target is not published by THIS application — a guide links to\n * a resource the application has feature-gated off. It degrades to plain text; the rest of the\n * portal publishes (#472, decided 2026-09-08).\n *\n * This used to throw, from inside `renderUnit`, which runs BEFORE the generated tree is\n * synchronized — so one missing target wrote NOTHING AT ALL. Not a broken link: no portal.\n * With 43 hardcoded engine `apiReferenceTargets` naming resources an application may switch\n * off, any application not enabling all 43 could not publish documentation.\n *\n * The `undefined` guard above is a DIFFERENT failure and still throws: it means the caller\n * wired no resolver, so nothing was even asked. Degrading there would hide a wiring mistake.\n *\n * Reporting the degradation is the CALLER's job — see the resolver the companion supplies. A\n * portal that quietly drops links would be worse than one that failed loudly, which is why\n * this half is not the whole fix.\n */\n const href = resolveApiReferenceTarget(link.apiReferenceTarget as TechnicalDocumentationApiReferenceTargetV1);\n return href === null ? [`- ${label}`] : [`- [${label}](${href})`];\n }\n return [];\n });\n const assetSection = figures.length === 0 ? '' : `\\n\\n## Product view\\n\\n${figures.join('\\n\\n')}`;\n const relatedSection = links.length === 0 ? '' : `\\n\\n## Related\\n\\n${links.join('\\n')}`;\n const summary = escapeMarkdownForMdx(unit.summary);\n return `---\\nid: ${path.split('/').at(-1)}\\ntitle: ${JSON.stringify(unit.title)}\\nsidebar_label: ${JSON.stringify(unit.title)}\\n---\\n\\n${summary}\\n\\n${sections}${assetSection}${relatedSection}\\n`;\n}\n\nfunction renderDocusaurusSidebars(model: TechnicalDocumentationRenderModel): string {\n const rootDocumentPaths: string[] = [];\n const rootDocumentPathSet = new Set<string>();\n const categoryItems: DocusaurusSidebarItem[] = [];\n const claimedRootLandingPaths = new Set<string>();\n const pathsByDirectory = new Map<string, string[]>();\n const unitTitleByPath = new Map<string, string>();\n for (const unit of model.units) {\n const path = model.unitPathByRef.get(unit.unitRef) as string;\n unitTitleByPath.set(path, unit.title);\n const [directory] = path.split('/');\n if (directory === undefined || !path.includes('/')) {\n rootDocumentPaths.push(path);\n rootDocumentPathSet.add(path);\n continue;\n }\n const paths = pathsByDirectory.get(directory) ?? [];\n paths.push(path);\n pathsByDirectory.set(directory, paths);\n }\n\n for (const [directory, paths] of [...pathsByDirectory.entries()].sort(([left], [right]) => left.localeCompare(right))) {\n const label = DOCUSAURUS_CATEGORY_LABEL_BY_DIRECTORY[directory];\n if (label === undefined) throw new Error(`technical-documentation Docusaurus category is missing a reader label: ${directory}`);\n const overviewPath = `${directory}/overview`;\n // A root document and a child directory may deliberately share one route\n // identity (`user-administration` + `user-administration/*`). That exact\n // path relation—not mutable display copy—makes the root document the\n // category landing. Labels remain free to evolve without breaking IA.\n const rootLandingPath = rootDocumentPathSet.has(directory) ? directory : undefined;\n const landingPath = paths.includes(overviewPath) ? overviewPath : rootLandingPath;\n if (rootLandingPath !== undefined && landingPath === rootLandingPath) claimedRootLandingPaths.add(rootLandingPath);\n const itemPaths = paths.filter((path) => path !== overviewPath);\n const [onlyItemPath] = itemPaths;\n\n // A category with one identically named document is not a journey: rendering\n // both creates two adjacent controls with the same reader meaning. Flatten\n // only that exact shape. A differently named single document remains under\n // its responsibility label because the category still adds useful context.\n if (landingPath === undefined && itemPaths.length === 1 && onlyItemPath !== undefined && unitTitleByPath.get(onlyItemPath) === label) {\n categoryItems.push(onlyItemPath);\n continue;\n }\n\n const orderedItems = renderDocusaurusCategoryItems({ directory, itemPaths, unitTitleByPath });\n categoryItems.push({\n type: 'category',\n label,\n collapsible: true,\n // Docusaurus expands the category containing the active document. Keeping\n // other journeys collapsed makes the sidebar scale with the catalogue.\n collapsed: true,\n ...(landingPath === undefined ? {} : { link: { type: 'doc', id: landingPath } }),\n items: orderedItems,\n });\n }\n\n const rootItems = [\n ...rootDocumentPaths.filter((path) => !claimedRootLandingPaths.has(path)),\n ...categoryItems,\n ];\n return `${JSON.stringify({ docs: rootItems }, null, 2)}\\n`;\n}\n\nexport function renderTechnicalDocumentationDocusaurus(input: {\n readonly model: TechnicalDocumentationRenderModel;\n readonly resolvedAssetBundle: TechnicalDocumentationResolvedAssetBundleManifestV1;\n readonly assetBytesByPath: ReadonlyMap<string, Uint8Array>;\n /**\n * Resolves a guide's API-reference target to a public href, or returns `null` when this\n * application does not publish it — a link to a feature-gated resource. `null` degrades the link\n * to plain text rather than failing the render (#472). Reporting the degradation belongs to\n * whoever supplies this function; the renderer only renders.\n */\n readonly resolveApiReferenceTarget?: (target: TechnicalDocumentationApiReferenceTargetV1) => string | null;\n}): TechnicalDocumentationRendererResult {\n const assetPathByRef = new Map(input.resolvedAssetBundle.resolvedAssetSet.assets.flatMap((asset) =>\n RENDERABLE_ASSET_STATUSES.has(asset.status) ? [[asset.assetRef, asset.normalizedRelativePath as string]] : []));\n const sourceUnitRefsByAssetRef = new Map<string, string[]>();\n for (const unit of input.model.units) {\n for (const request of unit.assetRequests) {\n const owners = sourceUnitRefsByAssetRef.get(request.assetRef) ?? [];\n owners.push(unit.unitRef);\n sourceUnitRefsByAssetRef.set(request.assetRef, owners);\n }\n }\n const pageFiles = input.model.units.map((unit) => {\n const path = input.model.unitPathByRef.get(unit.unitRef) as string;\n return {\n // The full route identity is part of the output identity. Two valid pages\n // may share their final slug (`integrations/todos` and\n // `user-administration/users`) without sharing a file or a manifest row.\n outputRef: `technical-documentation:output/docusaurus/${path.split('/').join(':')}`,\n rendererRef: DOCUSAURUS_RENDERER_REF,\n outputKind: TechnicalDocumentationOutputKind.MARKDOWN_DOCUMENT,\n sourceUnitRefs: [unit.unitRef],\n normalizedRelativePath: `docusaurus/docs/${path}.mdx`,\n mediaType: 'text/mdx',\n bytes: Buffer.from(renderUnit(unit, input.model, assetPathByRef, input.resolveApiReferenceTarget), 'utf8'),\n } as const;\n });\n const assetFiles = input.resolvedAssetBundle.resolvedAssetSet.assets.flatMap((asset) => {\n if (!RENDERABLE_ASSET_STATUSES.has(asset.status)) return [];\n const path = asset.normalizedRelativePath as string;\n const bytes = input.assetBytesByPath.get(path);\n if (bytes === undefined) throw new Error(`technical-documentation Docusaurus asset bytes are absent: ${path}`);\n const sourceUnitRefs = [...(sourceUnitRefsByAssetRef.get(asset.assetRef) ?? [])].sort();\n if (sourceUnitRefs.length === 0) throw new Error(`technical-documentation resolved asset has no authorized unit owner: ${asset.assetRef}`);\n return [{\n outputRef: `technical-documentation:output/asset/${technicalDocumentationAssetFileStem(asset.assetRef)}`,\n rendererRef: DOCUSAURUS_RENDERER_REF,\n outputKind: TechnicalDocumentationOutputKind.ASSET,\n sourceUnitRefs,\n normalizedRelativePath: `docusaurus/static/${path}`,\n mediaType: asset.mediaType,\n bytes,\n }];\n });\n return {\n execution: createTechnicalDocumentationRendererExecution({\n rendererKind: TechnicalDocumentationRendererKind.DOCUSAURUS,\n rendererRef: DOCUSAURUS_RENDERER_REF,\n rendererVersion: 1,\n configurationRef: 'technical-documentation:renderer-configuration/docusaurus-v1',\n }),\n files: [\n ...pageFiles,\n ...assetFiles,\n {\n outputRef: 'technical-documentation:output/docusaurus-sidebars',\n rendererRef: DOCUSAURUS_RENDERER_REF,\n outputKind: TechnicalDocumentationOutputKind.NAVIGATION_INDEX,\n sourceUnitRefs: input.model.units.map((unit) => unit.unitRef),\n normalizedRelativePath: 'docusaurus/sidebars.json',\n mediaType: 'application/json',\n bytes: Buffer.from(renderDocusaurusSidebars(input.model), 'utf8'),\n },\n ],\n };\n}\n"]}
|
package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"technical-documentation-managed-tree-validator.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"technical-documentation-managed-tree-validator.d.ts","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-managed-tree-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,gDAAgD,EAErD,KAAK,mDAAmD,EACzD,MAAM,uDAAuD,CAAC;AAE/D,OAAO,EAEL,KAAK,kCAAkC,EACxC,MAAM,wCAAwC,CAAC;AAMhD,MAAM,WAAW,mCAAmC;IAClD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;CAC1C;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,8CAA8C,EAAE,mCAI3D,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,kDAAkD,EAAE,SAAS,MAAM,EAK9E,CAAC;AAEH;;;;;GAKG;AACH,wBAAgB,0CAA0C,CACxD,QAAQ,CAAC,EAAE,OAAO,CAAC,mCAAmC,CAAC,GACtD,mCAAmC,CAErC;AAED;;;;;;;GAOG;AACH,wBAAgB,qDAAqD,CACnE,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,GAC3B,SAAS,MAAM,EAAE,CASnB;AAED,MAAM,WAAW,iDAAiD;IAChE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC;AAgED,wBAAgB,yCAAyC,CAAC,KAAK,EAAE;IAC/D,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,kCAAkC,EAAE,CAAC;IAC9D,QAAQ,CAAC,gBAAgB,EAAE,gDAAgD,CAAC;IAC5E,QAAQ,CAAC,mBAAmB,EAAE,mDAAmD,CAAC;IAClF,QAAQ,CAAC,wBAAwB,EAAE,SAAS,MAAM,EAAE,CAAC;IACrD,QAAQ,CAAC,OAAO,EAAE,mCAAmC,CAAC;CACvD,GAAG,iDAAiD,CA0FpD"}
|
|
@@ -88,6 +88,25 @@ const INDEPENDENT_API_REFERENCE_ROUTES = new Set([
|
|
|
88
88
|
applicationConsumerDocumentationRoutePath(ApplicationConsumerDocumentationRoute.API_REFERENCE),
|
|
89
89
|
applicationConsumerDocumentationRoutePath(ApplicationConsumerDocumentationRoute.APPLICATION_ADMINISTRATION_API_REFERENCE),
|
|
90
90
|
]);
|
|
91
|
+
/** One readable page segment, the shape `apiReferenceResourcePageSlug` produces. */
|
|
92
|
+
const API_REFERENCE_RESOURCE_PAGE_SLUG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
93
|
+
/**
|
|
94
|
+
* Whether `path` is a resource's own page under an API-reference root (`/api/<slug>`, #1623).
|
|
95
|
+
*
|
|
96
|
+
* The page exists because the link index derives the href from the same page plan the site's build
|
|
97
|
+
* plugin registers routes from, so the validator only has to refuse what that plan cannot produce:
|
|
98
|
+
* a second path segment, or a segment in any other shape.
|
|
99
|
+
*/
|
|
100
|
+
function isApiReferenceResourcePage(path) {
|
|
101
|
+
for (const root of INDEPENDENT_API_REFERENCE_ROUTES) {
|
|
102
|
+
if (!path.startsWith(`${root}/`))
|
|
103
|
+
continue;
|
|
104
|
+
const slug = path.slice(root.length + 1);
|
|
105
|
+
if (API_REFERENCE_RESOURCE_PAGE_SLUG.test(slug))
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
91
110
|
function validateGeneratedMarkdownLinkClosure(input) {
|
|
92
111
|
for (const match of input.text.matchAll(GENERATED_MARKDOWN_LINK_PATTERN)) {
|
|
93
112
|
const destination = match[1];
|
|
@@ -100,6 +119,7 @@ function validateGeneratedMarkdownLinkClosure(input) {
|
|
|
100
119
|
const rootRelativePath = pathOnly.slice(1);
|
|
101
120
|
const docusaurusStaticPath = `docusaurus/static/${rootRelativePath}`;
|
|
102
121
|
if (input.docusaurusRoutes.has(pathOnly)
|
|
122
|
+
|| isApiReferenceResourcePage(pathOnly)
|
|
103
123
|
|| (input.sourcePath.startsWith('docusaurus/docs/') ? input.declaredByPath.has(docusaurusStaticPath) : input.declaredByPath.has(rootRelativePath)))
|
|
104
124
|
continue;
|
|
105
125
|
throw new Error(`technical-documentation generated link target is absent: ${input.sourcePath} -> ${destination}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"technical-documentation-managed-tree-validator.js","sourceRoot":"","sources":["../../../../src/companion/rendering/technical-documentation-managed-tree-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAChC,kCAAkC,EAClC,kDAAkD,GAInD,MAAM,uDAAuD,CAAC;AAE/D,OAAO,EACL,iCAAiC,GAElC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,qCAAqC,EACrC,yCAAyC,GAC1C,MAAM,qCAAqC,CAAC;AAQ7C;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,8CAA8C,GAAwC,MAAM,CAAC,MAAM,CAAC;IAC/G,gBAAgB,EAAE,KAAK;IACvB,iBAAiB,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI;IACpC,uBAAuB,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;CAC1C,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,kDAAkD,GAAsB,MAAM,CAAC,MAAM,CAAC;IACjG,qCAAqC;IACrC,uCAAuC;IACvC,6BAA6B;IAC7B,iCAAiC;CAClC,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,UAAU,0CAA0C,CACxD,QAAuD;IAEvD,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,8CAA8C,EAAE,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;AACnG,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,qDAAqD,CACnE,QAA4B;IAE5B,MAAM,SAAS,GAAG,IAAI,GAAG,CAAS,kDAAkD,CAAC,CAAC;IACtF,KAAK,MAAM,QAAQ,IAAI,QAAQ,IAAI,EAAE,EAAE,CAAC;QACtC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;QAChC,mFAAmF;QACnF,kEAAkE;QAClE,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;YAAE,SAAS,CA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C,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC;QAC7K,KAAK,MAAM,IAAI,IAAI,kBAAkB,EAAE,CAAC;YACtC;;;;;;eAMG;YACH,MAAM,MAAM,GAAG,cAAc,CAAC,GAAG,CAAC,qBAAqB,IAAI,EAAE,CAAC,CAAC;YAC/D,IAAI,MAAM,EAAE,UAAU,KAAK,gCAAgC,CAAC,KAAK,EAAE,CAAC;gBAClE,MAAM,IAAI,KAAK,CAAC,kFAAkF,IAAI,EAAE,CAAC,CAAC;YAC5G,CAAC;QACH,CAAC;IACH,CAAC;IACD,MAAM,MAAM,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC3D,IAAI,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,gBAAgB;QAAE,MAAM,IAAI,KAAK,CAAC,iDAAiD,SAAS,EAAE,CAAC,CAAC;IAC9H,IAAI,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,iBAAiB;QAAE,MAAM,IAAI,KAAK,CAAC,uDAAuD,UAAU,EAAE,CAAC,CAAC;IACvI,IAAI,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,uBAAuB;QAAE,MAAM,IAAI,KAAK,CAAC,yDAAyD,gBAAgB,EAAE,CAAC,CAAC;IAC3J,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AACD,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC","sourcesContent":["import {\n TechnicalDocumentationOutputKind,\n TechnicalDocumentationRendererKind,\n TechnicalDocumentationRenderOutputManifestV1Schema,\n type TechnicalDocumentationAuthorizedBundleManifestV1,\n type TechnicalDocumentationRenderOutputManifestV1,\n type TechnicalDocumentationResolvedAssetBundleManifestV1,\n} from '@wildo-ai/saas-specifications/technical-documentation';\n\nimport {\n technicalDocumentationSha256Bytes,\n type TechnicalDocumentationRenderedFile,\n} from './technical-documentation-render-model';\nimport {\n ApplicationConsumerDocumentationRoute,\n applicationConsumerDocumentationRoutePath,\n} from '../../openapi/api-reference-targets';\n\nexport interface TechnicalDocumentationOutputBudgets {\n readonly maximumPageCount: number;\n readonly maximumTotalBytes: number;\n readonly maximumSearchIndexBytes: number;\n}\n\n/**\n * Ceilings applied when an application declares none.\n *\n * The point is that ABSENCE is bounded, not that these numbers are precisely right. An\n * application which never thought about output size still gets a documentation tree that\n * cannot silently grow until a build host runs out of memory; one that genuinely outgrows\n * a ceiling raises it explicitly, and that edit is visible in review.\n *\n * Generous on purpose. A default tight enough to be \"safe\" for a small application would\n * fire on ordinary growth, and a limit that routinely fires is a limit people learn to\n * raise without reading — which is worse than no limit at all.\n */\nexport const TECHNICAL_DOCUMENTATION_DEFAULT_OUTPUT_BUDGETS: TechnicalDocumentationOutputBudgets = Object.freeze({\n maximumPageCount: 2_000,\n maximumTotalBytes: 512 * 1024 * 1024,\n maximumSearchIndexBytes: 64 * 1024 * 1024,\n});\n\n/**\n * Sentinels every application inherits, which an application can EXTEND but never remove.\n *\n * ## Why this set is so small\n *\n * A sentinel is matched with `String.includes` against every public file, so a generic\n * marker — `secret`, `token`, `password`, `Bearer` — would fire on the very guides that\n * teach authentication, error handling and webhook signature verification. Those documents\n * legitimately contain those words. A canary that cries on correct content gets removed,\n * and then it protects nothing.\n *\n * So the mandatory set is restricted to byte sequences that **cannot legitimately appear in\n * published product documentation** under any authoring style. A PEM private-key header\n * qualifies: documentation teaches readers to *use* a public key, never to read a private\n * one, so its presence in a public tree is a leak by construction rather than by judgement.\n *\n * Application-specific canaries — a restricted-content marker, a fixture value that must\n * stay internal — belong in the application's own declared list, which is UNIONED with this\n * one. The union direction is the safety property: an application must be able to add\n * canaries and must not be able to switch these off.\n */\nexport const TECHNICAL_DOCUMENTATION_MANDATORY_PUBLIC_SENTINELS: readonly string[] = Object.freeze([\n '-----BEGIN OPENSSH PRIVATE KEY-----',\n '-----BEGIN PGP PRIVATE KEY BLOCK-----',\n '-----BEGIN PRIVATE KEY-----',\n '-----BEGIN RSA PRIVATE KEY-----',\n]);\n\n/**\n * Resolves the effective budgets from an application's partial declaration.\n *\n * Per-field rather than all-or-nothing: an application that only needs a larger page\n * count should not have to restate — and thereby freeze a copy of — every other ceiling.\n */\nexport function resolveTechnicalDocumentationOutputBudgets(\n declared?: Partial<TechnicalDocumentationOutputBudgets>,\n): TechnicalDocumentationOutputBudgets {\n return Object.freeze({ ...TECHNICAL_DOCUMENTATION_DEFAULT_OUTPUT_BUDGETS, ...(declared ?? {}) });\n}\n\n/**\n * Unions the mandatory sentinels with an application's declared ones.\n *\n * A union, never a replacement — see\n * {@link TECHNICAL_DOCUMENTATION_MANDATORY_PUBLIC_SENTINELS}. Deduplicated and sorted so\n * the resolved set is a stable value: it is compared and reported, and an order that\n * varied with authoring order would make two identical policies look different.\n */\nexport function resolveTechnicalDocumentationForbiddenPublicSentinels(\n declared?: readonly string[],\n): readonly string[] {\n const sentinels = new Set<string>(TECHNICAL_DOCUMENTATION_MANDATORY_PUBLIC_SENTINELS);\n for (const sentinel of declared ?? []) {\n const trimmed = sentinel.trim();\n // An empty sentinel is skipped by the validator anyway; dropping it here keeps the\n // resolved set honest about how many canaries are actually armed.\n if (trimmed.length > 0) sentinels.add(trimmed);\n }\n return Object.freeze([...sentinels].sort());\n}\n\nexport interface TechnicalDocumentationManagedTreeValidationReport {\n readonly pageCount: number;\n readonly totalBytes: number;\n readonly searchIndexBytes: number;\n}\n\nconst GENERATED_MARKDOWN_LINK_PATTERN = /!?\\[[^\\]]*\\]\\(([^)\\s]+)(?:\\s+[\"'][^)]*)?\\)/g;\n\n/**\n * Routes published by the API-reference pipeline rather than the guide renderer.\n *\n * API-reference links enter a guide only through the semantic OpenAPI link index,\n * which proves the requested resource, operation, request, response or schema is\n * present before the renderer receives its public URL. The managed-tree validator\n * must therefore recognize the independently published route root while continuing\n * to require every ordinary guide and static-asset target to exist in this exact\n * render manifest.\n */\nconst INDEPENDENT_API_REFERENCE_ROUTES: ReadonlySet<string> = new Set([\n applicationConsumerDocumentationRoutePath(ApplicationConsumerDocumentationRoute.API_REFERENCE),\n applicationConsumerDocumentationRoutePath(ApplicationConsumerDocumentationRoute.APPLICATION_ADMINISTRATION_API_REFERENCE),\n]);\n\nfunction validateGeneratedMarkdownLinkClosure(input: {\n readonly sourcePath: string;\n readonly text: string;\n readonly declaredByPath: ReadonlyMap<string, TechnicalDocumentationRenderOutputManifestV1['outputs'][number]>;\n readonly docusaurusRoutes: ReadonlySet<string>;\n}): void {\n for (const match of input.text.matchAll(GENERATED_MARKDOWN_LINK_PATTERN)) {\n const destination = match[1];\n if (destination === undefined || destination.startsWith('#') || /^(?:https?:|mailto:)/i.test(destination)) continue;\n const pathOnly = destination.split(/[?#]/, 1)[0];\n if (pathOnly === undefined || pathOnly.length === 0) continue;\n if (pathOnly.startsWith('/')) {\n const rootRelativePath = pathOnly.slice(1);\n const docusaurusStaticPath = `docusaurus/static/${rootRelativePath}`;\n if (input.docusaurusRoutes.has(pathOnly)\n || (input.sourcePath.startsWith('docusaurus/docs/') ? input.declaredByPath.has(docusaurusStaticPath) : input.declaredByPath.has(rootRelativePath))) continue;\n throw new Error(`technical-documentation generated link target is absent: ${input.sourcePath} -> ${destination}`);\n }\n const resolvedPath = posixPath.normalize(posixPath.join(posixPath.dirname(input.sourcePath), pathOnly));\n if (resolvedPath.startsWith('../') || posixPath.isAbsolute(resolvedPath) || !input.declaredByPath.has(resolvedPath)) {\n throw new Error(`technical-documentation generated link target is absent: ${input.sourcePath} -> ${destination}`);\n }\n }\n}\n\nexport function validateTechnicalDocumentationManagedTree(input: {\n readonly manifest: unknown;\n readonly files: readonly TechnicalDocumentationRenderedFile[];\n readonly authorizedBundle: TechnicalDocumentationAuthorizedBundleManifestV1;\n readonly resolvedAssetBundle: TechnicalDocumentationResolvedAssetBundleManifestV1;\n readonly forbiddenPublicSentinels: readonly string[];\n readonly budgets: TechnicalDocumentationOutputBudgets;\n}): TechnicalDocumentationManagedTreeValidationReport {\n const manifest: TechnicalDocumentationRenderOutputManifestV1 = TechnicalDocumentationRenderOutputManifestV1Schema.parse(input.manifest);\n /*\n * Binding is an identity comparison between two independently produced manifests, which is a\n * check with two real sides. The `renderOutputDigest` recomputation that used to follow was not:\n * it hashed this manifest and compared the result against the copy stored inside it.\n */\n const boundBundle = manifest.authorizedBundleIdentity;\n if (boundBundle.ref !== input.authorizedBundle.bundleRef || boundBundle.version !== input.authorizedBundle.bundleVersion) {\n throw new Error('technical-documentation render manifest does not bind the authorized bundle');\n }\n const boundAssets = manifest.resolvedAssetBundleIdentity;\n if (boundAssets.ref !== input.resolvedAssetBundle.assetBundleRef || boundAssets.version !== input.resolvedAssetBundle.assetBundleVersion) {\n throw new Error('technical-documentation render manifest does not bind the resolved asset bundle');\n }\n\n const declaredByPath = new Map<string, TechnicalDocumentationRenderOutputManifestV1['outputs'][number]>(\n manifest.outputs.map((output) => [output.normalizedRelativePath, output]),\n );\n const docusaurusRoutes = new Set(manifest.outputs.flatMap((output) => {\n const path = output.normalizedRelativePath as string;\n return path.startsWith('docusaurus/docs/') && path.endsWith('.mdx')\n ? [`/${path.slice('docusaurus/docs/'.length, -'.mdx'.length)}`]\n : [];\n }));\n for (const apiReferenceRoute of INDEPENDENT_API_REFERENCE_ROUTES) docusaurusRoutes.add(apiReferenceRoute);\n const filesByPath = new Map<string, TechnicalDocumentationRenderedFile>();\n for (const file of input.files) {\n if (filesByPath.has(file.normalizedRelativePath)) throw new Error(`technical-documentation managed tree duplicates path: ${file.normalizedRelativePath}`);\n filesByPath.set(file.normalizedRelativePath, file);\n }\n if (filesByPath.size !== declaredByPath.size) throw new Error('technical-documentation managed tree inventory does not match its manifest');\n\n const authorizedUnitRefs = new Set(input.authorizedBundle.units.map((unit) => unit.unitRef));\n let totalBytes = 0;\n let pageCount = 0;\n let searchIndexBytes = 0;\n for (const [path, output] of declaredByPath) {\n const file = filesByPath.get(path);\n if (file === undefined) throw new Error(`technical-documentation managed output is missing: ${path}`);\n if (file.outputRef !== output.outputRef || file.rendererRef !== output.rendererRef || file.outputKind !== output.outputKind\n || file.mediaType !== output.mediaType || [...file.sourceUnitRefs].sort().join('\\0') !== output.sourceUnitRefs.join('\\0')) {\n throw new Error(`technical-documentation managed output metadata mismatch: ${path}`);\n }\n if (file.bytes.byteLength !== output.byteLength || technicalDocumentationSha256Bytes(file.bytes) !== output.byteDigest) {\n throw new Error(`technical-documentation managed output byte identity mismatch: ${path}`);\n }\n for (const sourceUnitRef of output.sourceUnitRefs) {\n if (!authorizedUnitRefs.has(sourceUnitRef)) throw new Error(`technical-documentation output cites an unauthorized unit: ${sourceUnitRef}`);\n }\n const text = Buffer.from(file.bytes).toString('utf8');\n for (const sentinel of input.forbiddenPublicSentinels) {\n if (sentinel.length > 0 && text.includes(sentinel)) throw new Error(`technical-documentation managed public tree contains forbidden sentinel in ${path}`);\n }\n if (output.outputKind === TechnicalDocumentationOutputKind.MARKDOWN_DOCUMENT) {\n validateGeneratedMarkdownLinkClosure({ sourcePath: path, text, declaredByPath, docusaurusRoutes });\n }\n totalBytes += file.bytes.byteLength;\n if (output.outputKind === TechnicalDocumentationOutputKind.HTML_PAGE || output.outputKind === TechnicalDocumentationOutputKind.MARKDOWN_DOCUMENT) pageCount += 1;\n if (path === 'indexes/search.json') searchIndexBytes = file.bytes.byteLength;\n }\n\n /**\n * Captures are source material, not unconditional public output. An API-only\n * publication deliberately has no page renderer that can reference a\n * screenshot, so it must not publish unused product imagery. Once the\n * Docusaurus content renderer participates, every resolved asset remains a\n * required managed output as before.\n */\n if (manifest.rendererExecutions.some((execution) => execution.rendererKind === TechnicalDocumentationRendererKind.DOCUSAURUS)) {\n const resolvedAssetPaths = input.resolvedAssetBundle.resolvedAssetSet.assets.flatMap((asset) => asset.normalizedRelativePath === null ? [] : [asset.normalizedRelativePath]);\n for (const path of resolvedAssetPaths) {\n /*\n * `docusaurus/static/<path>` is where the asset SHIPS — the directory the site serves. This\n * looked for the bare `<path>`, and passed only because a second renderer family published\n * every asset there as well. That family was read by nothing and was removed (#274), which\n * left the check looking for a file no renderer writes any more: the rule is \"a resolved asset\n * reaches the reader\", and the reader reaches it through the site.\n */\n const output = declaredByPath.get(`docusaurus/static/${path}`);\n if (output?.outputKind !== TechnicalDocumentationOutputKind.ASSET) {\n throw new Error(`technical-documentation resolved asset is absent from the managed output tree: ${path}`);\n }\n }\n }\n const report = { pageCount, totalBytes, searchIndexBytes };\n if (pageCount > input.budgets.maximumPageCount) throw new Error(`technical-documentation page budget exceeded: ${pageCount}`);\n if (totalBytes > input.budgets.maximumTotalBytes) throw new Error(`technical-documentation total-byte budget exceeded: ${totalBytes}`);\n if (searchIndexBytes > input.budgets.maximumSearchIndexBytes) throw new Error(`technical-documentation search-index budget exceeded: ${searchIndexBytes}`);\n return Object.freeze(report);\n}\nimport { posix as posixPath } from 'node:path';\n"]}
|
|
1
|
+
{"version":3,"file":"technical-documentation-managed-tree-validator.js","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-managed-tree-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAChC,kCAAkC,EAClC,kDAAkD,GAInD,MAAM,uDAAuD,CAAC;AAE/D,OAAO,EACL,iCAAiC,GAElC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,qCAAqC,EACrC,yCAAyC,GAC1C,MAAM,qCAAqC,CAAC;AAQ7C;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,8CAA8C,GAAwC,MAAM,CAAC,MAAM,CAAC;IAC/G,gBAAgB,EAAE,KAAK;IACvB,iBAAiB,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI;IACpC,uBAAuB,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;CAC1C,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,kDAAkD,GAAsB,MAAM,CAAC,MAAM,CAAC;IACjG,qCAAqC;IACrC,uCAAuC;I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qB,IAAI,EAAE,CAAC,CAAC;YAC/D,IAAI,MAAM,EAAE,UAAU,KAAK,gCAAgC,CAAC,KAAK,EAAE,CAAC;gBAClE,MAAM,IAAI,KAAK,CAAC,kFAAkF,IAAI,EAAE,CAAC,CAAC;YAC5G,CAAC;QACH,CAAC;IACH,CAAC;IACD,MAAM,MAAM,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC3D,IAAI,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,gBAAgB;QAAE,MAAM,IAAI,KAAK,CAAC,iDAAiD,SAAS,EAAE,CAAC,CAAC;IAC9H,IAAI,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,iBAAiB;QAAE,MAAM,IAAI,KAAK,CAAC,uDAAuD,UAAU,EAAE,CAAC,CAAC;IACvI,IAAI,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,uBAAuB;QAAE,MAAM,IAAI,KAAK,CAAC,yDAAyD,gBAAgB,EAAE,CAAC,CAAC;IAC3J,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AACD,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC","sourcesContent":["import {\n TechnicalDocumentationOutputKind,\n TechnicalDocumentationRendererKind,\n TechnicalDocumentationRenderOutputManifestV1Schema,\n type TechnicalDocumentationAuthorizedBundleManifestV1,\n type TechnicalDocumentationRenderOutputManifestV1,\n type TechnicalDocumentationResolvedAssetBundleManifestV1,\n} from '@wildo-ai/saas-specifications/technical-documentation';\n\nimport {\n technicalDocumentationSha256Bytes,\n type TechnicalDocumentationRenderedFile,\n} from './technical-documentation-render-model';\nimport {\n ApplicationConsumerDocumentationRoute,\n applicationConsumerDocumentationRoutePath,\n} from '../../openapi/api-reference-targets';\n\nexport interface TechnicalDocumentationOutputBudgets {\n readonly maximumPageCount: number;\n readonly maximumTotalBytes: number;\n readonly maximumSearchIndexBytes: number;\n}\n\n/**\n * Ceilings applied when an application declares none.\n *\n * The point is that ABSENCE is bounded, not that these numbers are precisely right. An\n * application which never thought about output size still gets a documentation tree that\n * cannot silently grow until a build host runs out of memory; one that genuinely outgrows\n * a ceiling raises it explicitly, and that edit is visible in review.\n *\n * Generous on purpose. A default tight enough to be \"safe\" for a small application would\n * fire on ordinary growth, and a limit that routinely fires is a limit people learn to\n * raise without reading — which is worse than no limit at all.\n */\nexport const TECHNICAL_DOCUMENTATION_DEFAULT_OUTPUT_BUDGETS: TechnicalDocumentationOutputBudgets = Object.freeze({\n maximumPageCount: 2_000,\n maximumTotalBytes: 512 * 1024 * 1024,\n maximumSearchIndexBytes: 64 * 1024 * 1024,\n});\n\n/**\n * Sentinels every application inherits, which an application can EXTEND but never remove.\n *\n * ## Why this set is so small\n *\n * A sentinel is matched with `String.includes` against every public file, so a generic\n * marker — `secret`, `token`, `password`, `Bearer` — would fire on the very guides that\n * teach authentication, error handling and webhook signature verification. Those documents\n * legitimately contain those words. A canary that cries on correct content gets removed,\n * and then it protects nothing.\n *\n * So the mandatory set is restricted to byte sequences that **cannot legitimately appear in\n * published product documentation** under any authoring style. A PEM private-key header\n * qualifies: documentation teaches readers to *use* a public key, never to read a private\n * one, so its presence in a public tree is a leak by construction rather than by judgement.\n *\n * Application-specific canaries — a restricted-content marker, a fixture value that must\n * stay internal — belong in the application's own declared list, which is UNIONED with this\n * one. The union direction is the safety property: an application must be able to add\n * canaries and must not be able to switch these off.\n */\nexport const TECHNICAL_DOCUMENTATION_MANDATORY_PUBLIC_SENTINELS: readonly string[] = Object.freeze([\n '-----BEGIN OPENSSH PRIVATE KEY-----',\n '-----BEGIN PGP PRIVATE KEY BLOCK-----',\n '-----BEGIN PRIVATE KEY-----',\n '-----BEGIN RSA PRIVATE KEY-----',\n]);\n\n/**\n * Resolves the effective budgets from an application's partial declaration.\n *\n * Per-field rather than all-or-nothing: an application that only needs a larger page\n * count should not have to restate — and thereby freeze a copy of — every other ceiling.\n */\nexport function resolveTechnicalDocumentationOutputBudgets(\n declared?: Partial<TechnicalDocumentationOutputBudgets>,\n): TechnicalDocumentationOutputBudgets {\n return Object.freeze({ ...TECHNICAL_DOCUMENTATION_DEFAULT_OUTPUT_BUDGETS, ...(declared ?? {}) });\n}\n\n/**\n * Unions the mandatory sentinels with an application's declared ones.\n *\n * A union, never a replacement — see\n * {@link TECHNICAL_DOCUMENTATION_MANDATORY_PUBLIC_SENTINELS}. Deduplicated and sorted so\n * the resolved set is a stable value: it is compared and reported, and an order that\n * varied with authoring order would make two identical policies look different.\n */\nexport function resolveTechnicalDocumentationForbiddenPublicSentinels(\n declared?: readonly string[],\n): readonly string[] {\n const sentinels = new Set<string>(TECHNICAL_DOCUMENTATION_MANDATORY_PUBLIC_SENTINELS);\n for (const sentinel of declared ?? []) {\n const trimmed = sentinel.trim();\n // An empty sentinel is skipped by the validator anyway; dropping it here keeps the\n // resolved set honest about how many canaries are actually armed.\n if (trimmed.length > 0) sentinels.add(trimmed);\n }\n return Object.freeze([...sentinels].sort());\n}\n\nexport interface TechnicalDocumentationManagedTreeValidationReport {\n readonly pageCount: number;\n readonly totalBytes: number;\n readonly searchIndexBytes: number;\n}\n\nconst GENERATED_MARKDOWN_LINK_PATTERN = /!?\\[[^\\]]*\\]\\(([^)\\s]+)(?:\\s+[\"'][^)]*)?\\)/g;\n\n/**\n * Routes published by the API-reference pipeline rather than the guide renderer.\n *\n * API-reference links enter a guide only through the semantic OpenAPI link index,\n * which proves the requested resource, operation, request, response or schema is\n * present before the renderer receives its public URL. The managed-tree validator\n * must therefore recognize the independently published route root while continuing\n * to require every ordinary guide and static-asset target to exist in this exact\n * render manifest.\n */\nconst INDEPENDENT_API_REFERENCE_ROUTES: ReadonlySet<string> = new Set([\n applicationConsumerDocumentationRoutePath(ApplicationConsumerDocumentationRoute.API_REFERENCE),\n applicationConsumerDocumentationRoutePath(ApplicationConsumerDocumentationRoute.APPLICATION_ADMINISTRATION_API_REFERENCE),\n]);\n\n/** One readable page segment, the shape `apiReferenceResourcePageSlug` produces. */\nconst API_REFERENCE_RESOURCE_PAGE_SLUG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;\n\n/**\n * Whether `path` is a resource's own page under an API-reference root (`/api/<slug>`, #1623).\n *\n * The page exists because the link index derives the href from the same page plan the site's build\n * plugin registers routes from, so the validator only has to refuse what that plan cannot produce:\n * a second path segment, or a segment in any other shape.\n */\nfunction isApiReferenceResourcePage(path: string): boolean {\n for (const root of INDEPENDENT_API_REFERENCE_ROUTES) {\n if (!path.startsWith(`${root}/`)) continue;\n const slug = path.slice(root.length + 1);\n if (API_REFERENCE_RESOURCE_PAGE_SLUG.test(slug)) return true;\n }\n return false;\n}\n\nfunction validateGeneratedMarkdownLinkClosure(input: {\n readonly sourcePath: string;\n readonly text: string;\n readonly declaredByPath: ReadonlyMap<string, TechnicalDocumentationRenderOutputManifestV1['outputs'][number]>;\n readonly docusaurusRoutes: ReadonlySet<string>;\n}): void {\n for (const match of input.text.matchAll(GENERATED_MARKDOWN_LINK_PATTERN)) {\n const destination = match[1];\n if (destination === undefined || destination.startsWith('#') || /^(?:https?:|mailto:)/i.test(destination)) continue;\n const pathOnly = destination.split(/[?#]/, 1)[0];\n if (pathOnly === undefined || pathOnly.length === 0) continue;\n if (pathOnly.startsWith('/')) {\n const rootRelativePath = pathOnly.slice(1);\n const docusaurusStaticPath = `docusaurus/static/${rootRelativePath}`;\n if (input.docusaurusRoutes.has(pathOnly)\n || isApiReferenceResourcePage(pathOnly)\n || (input.sourcePath.startsWith('docusaurus/docs/') ? input.declaredByPath.has(docusaurusStaticPath) : input.declaredByPath.has(rootRelativePath))) continue;\n throw new Error(`technical-documentation generated link target is absent: ${input.sourcePath} -> ${destination}`);\n }\n const resolvedPath = posixPath.normalize(posixPath.join(posixPath.dirname(input.sourcePath), pathOnly));\n if (resolvedPath.startsWith('../') || posixPath.isAbsolute(resolvedPath) || !input.declaredByPath.has(resolvedPath)) {\n throw new Error(`technical-documentation generated link target is absent: ${input.sourcePath} -> ${destination}`);\n }\n }\n}\n\nexport function validateTechnicalDocumentationManagedTree(input: {\n readonly manifest: unknown;\n readonly files: readonly TechnicalDocumentationRenderedFile[];\n readonly authorizedBundle: TechnicalDocumentationAuthorizedBundleManifestV1;\n readonly resolvedAssetBundle: TechnicalDocumentationResolvedAssetBundleManifestV1;\n readonly forbiddenPublicSentinels: readonly string[];\n readonly budgets: TechnicalDocumentationOutputBudgets;\n}): TechnicalDocumentationManagedTreeValidationReport {\n const manifest: TechnicalDocumentationRenderOutputManifestV1 = TechnicalDocumentationRenderOutputManifestV1Schema.parse(input.manifest);\n /*\n * Binding is an identity comparison between two independently produced manifests, which is a\n * check with two real sides. The `renderOutputDigest` recomputation that used to follow was not:\n * it hashed this manifest and compared the result against the copy stored inside it.\n */\n const boundBundle = manifest.authorizedBundleIdentity;\n if (boundBundle.ref !== input.authorizedBundle.bundleRef || boundBundle.version !== input.authorizedBundle.bundleVersion) {\n throw new Error('technical-documentation render manifest does not bind the authorized bundle');\n }\n const boundAssets = manifest.resolvedAssetBundleIdentity;\n if (boundAssets.ref !== input.resolvedAssetBundle.assetBundleRef || boundAssets.version !== input.resolvedAssetBundle.assetBundleVersion) {\n throw new Error('technical-documentation render manifest does not bind the resolved asset bundle');\n }\n\n const declaredByPath = new Map<string, TechnicalDocumentationRenderOutputManifestV1['outputs'][number]>(\n manifest.outputs.map((output) => [output.normalizedRelativePath, output]),\n );\n const docusaurusRoutes = new Set(manifest.outputs.flatMap((output) => {\n const path = output.normalizedRelativePath as string;\n return path.startsWith('docusaurus/docs/') && path.endsWith('.mdx')\n ? [`/${path.slice('docusaurus/docs/'.length, -'.mdx'.length)}`]\n : [];\n }));\n for (const apiReferenceRoute of INDEPENDENT_API_REFERENCE_ROUTES) docusaurusRoutes.add(apiReferenceRoute);\n const filesByPath = new Map<string, TechnicalDocumentationRenderedFile>();\n for (const file of input.files) {\n if (filesByPath.has(file.normalizedRelativePath)) throw new Error(`technical-documentation managed tree duplicates path: ${file.normalizedRelativePath}`);\n filesByPath.set(file.normalizedRelativePath, file);\n }\n if (filesByPath.size !== declaredByPath.size) throw new Error('technical-documentation managed tree inventory does not match its manifest');\n\n const authorizedUnitRefs = new Set(input.authorizedBundle.units.map((unit) => unit.unitRef));\n let totalBytes = 0;\n let pageCount = 0;\n let searchIndexBytes = 0;\n for (const [path, output] of declaredByPath) {\n const file = filesByPath.get(path);\n if (file === undefined) throw new Error(`technical-documentation managed output is missing: ${path}`);\n if (file.outputRef !== output.outputRef || file.rendererRef !== output.rendererRef || file.outputKind !== output.outputKind\n || file.mediaType !== output.mediaType || [...file.sourceUnitRefs].sort().join('\\0') !== output.sourceUnitRefs.join('\\0')) {\n throw new Error(`technical-documentation managed output metadata mismatch: ${path}`);\n }\n if (file.bytes.byteLength !== output.byteLength || technicalDocumentationSha256Bytes(file.bytes) !== output.byteDigest) {\n throw new Error(`technical-documentation managed output byte identity mismatch: ${path}`);\n }\n for (const sourceUnitRef of output.sourceUnitRefs) {\n if (!authorizedUnitRefs.has(sourceUnitRef)) throw new Error(`technical-documentation output cites an unauthorized unit: ${sourceUnitRef}`);\n }\n const text = Buffer.from(file.bytes).toString('utf8');\n for (const sentinel of input.forbiddenPublicSentinels) {\n if (sentinel.length > 0 && text.includes(sentinel)) throw new Error(`technical-documentation managed public tree contains forbidden sentinel in ${path}`);\n }\n if (output.outputKind === TechnicalDocumentationOutputKind.MARKDOWN_DOCUMENT) {\n validateGeneratedMarkdownLinkClosure({ sourcePath: path, text, declaredByPath, docusaurusRoutes });\n }\n totalBytes += file.bytes.byteLength;\n if (output.outputKind === TechnicalDocumentationOutputKind.HTML_PAGE || output.outputKind === TechnicalDocumentationOutputKind.MARKDOWN_DOCUMENT) pageCount += 1;\n if (path === 'indexes/search.json') searchIndexBytes = file.bytes.byteLength;\n }\n\n /**\n * Captures are source material, not unconditional public output. An API-only\n * publication deliberately has no page renderer that can reference a\n * screenshot, so it must not publish unused product imagery. Once the\n * Docusaurus content renderer participates, every resolved asset remains a\n * required managed output as before.\n */\n if (manifest.rendererExecutions.some((execution) => execution.rendererKind === TechnicalDocumentationRendererKind.DOCUSAURUS)) {\n const resolvedAssetPaths = input.resolvedAssetBundle.resolvedAssetSet.assets.flatMap((asset) => asset.normalizedRelativePath === null ? [] : [asset.normalizedRelativePath]);\n for (const path of resolvedAssetPaths) {\n /*\n * `docusaurus/static/<path>` is where the asset SHIPS — the directory the site serves. This\n * looked for the bare `<path>`, and passed only because a second renderer family published\n * every asset there as well. That family was read by nothing and was removed (#274), which\n * left the check looking for a file no renderer writes any more: the rule is \"a resolved asset\n * reaches the reader\", and the reader reaches it through the site.\n */\n const output = declaredByPath.get(`docusaurus/static/${path}`);\n if (output?.outputKind !== TechnicalDocumentationOutputKind.ASSET) {\n throw new Error(`technical-documentation resolved asset is absent from the managed output tree: ${path}`);\n }\n }\n }\n const report = { pageCount, totalBytes, searchIndexBytes };\n if (pageCount > input.budgets.maximumPageCount) throw new Error(`technical-documentation page budget exceeded: ${pageCount}`);\n if (totalBytes > input.budgets.maximumTotalBytes) throw new Error(`technical-documentation total-byte budget exceeded: ${totalBytes}`);\n if (searchIndexBytes > input.budgets.maximumSearchIndexBytes) throw new Error(`technical-documentation search-index budget exceeded: ${searchIndexBytes}`);\n return Object.freeze(report);\n}\nimport { posix as posixPath } from 'node:path';\n"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type OpenApiGenerationOutput } from '../../openapi/openapi-generation-output.schemas';
|
|
2
2
|
import { type TechnicalDocumentationRendererResult } from './technical-documentation-render-model';
|
|
3
|
+
/** Where the API reference's search entries land, relative to the generated API-reference root. */
|
|
4
|
+
export declare const API_REFERENCE_SEARCH_INDEX_RELATIVE_PATH = "indexes/api-reference-search.json";
|
|
3
5
|
export declare function renderVerifiedTechnicalDocumentationOpenApi(input: {
|
|
4
6
|
readonly documents: OpenApiGenerationOutput;
|
|
5
7
|
readonly sourceUnitRefs: readonly string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"technical-documentation-openapi-renderer.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"technical-documentation-openapi-renderer.d.ts","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-openapi-renderer.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAEL,KAAK,oCAAoC,EAC1C,MAAM,wCAAwC,CAAC;AAIhD,mGAAmG;AACnG,eAAO,MAAM,wCAAwC,sCAAsC,CAAC;AAE5F,wBAAgB,2CAA2C,CAAC,KAAK,EAAE;IACjE,QAAQ,CAAC,SAAS,EAAE,uBAAuB,CAAC;IAC5C,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5C,GAAG,oCAAoC,CAyDvC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { TechnicalDocumentationOutputKind, TechnicalDocumentationRendererKind } from '@wildo-ai/saas-specifications/technical-documentation';
|
|
2
2
|
import { stringify as stringifyYaml } from 'yaml';
|
|
3
|
+
import { buildApiReferenceSearchIndex } from '../../openapi/api-reference-search.js';
|
|
3
4
|
import { OPENAPI_OUTPUT_FILENAMES, } from '../../openapi/openapi-generation-output.schemas.js';
|
|
4
5
|
import { createTechnicalDocumentationRendererExecution, } from './technical-documentation-render-model.js';
|
|
5
6
|
const OPENAPI_RENDERER_REF = 'technical-documentation:renderer/openapi';
|
|
7
|
+
/** Where the API reference's search entries land, relative to the generated API-reference root. */
|
|
8
|
+
export const API_REFERENCE_SEARCH_INDEX_RELATIVE_PATH = 'indexes/api-reference-search.json';
|
|
6
9
|
export function renderVerifiedTechnicalDocumentationOpenApi(input) {
|
|
7
10
|
if (input.sourceUnitRefs.length === 0)
|
|
8
11
|
throw new Error('technical-documentation OpenAPI rendering requires authorized source units');
|
|
@@ -13,39 +16,53 @@ export function renderVerifiedTechnicalDocumentationOpenApi(input) {
|
|
|
13
16
|
rendererVersion: 1,
|
|
14
17
|
configurationRef: 'technical-documentation:renderer-configuration/openapi-3-1-0',
|
|
15
18
|
}),
|
|
16
|
-
files: input.documents.sections.flatMap((section) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
files: [...input.documents.sections.flatMap((section) => {
|
|
20
|
+
const sectionPath = section.section.toLowerCase().replaceAll('_', '-');
|
|
21
|
+
const sourceUnitRefs = [...input.sourceUnitRefs].sort();
|
|
22
|
+
const filenames = OPENAPI_OUTPUT_FILENAMES[section.section];
|
|
23
|
+
const yaml = stringifyYaml(section.document, { lineWidth: 0, sortMapEntries: false });
|
|
24
|
+
const json = `${JSON.stringify(section.document, null, 2)}\n`;
|
|
25
|
+
/**
|
|
26
|
+
* YAML and JSON are two deterministic serializations of one generator
|
|
27
|
+
* document. YAML is the reviewable/downloadable contract; JSON is the
|
|
28
|
+
* browser renderer input. Neither file contains renderer-authored API
|
|
29
|
+
* meaning.
|
|
30
|
+
*/
|
|
31
|
+
return [
|
|
32
|
+
{
|
|
33
|
+
outputRef: `technical-documentation:output/openapi/${sectionPath}/yaml`,
|
|
34
|
+
rendererRef: OPENAPI_RENDERER_REF,
|
|
35
|
+
outputKind: TechnicalDocumentationOutputKind.OPENAPI_DOCUMENT,
|
|
36
|
+
sourceUnitRefs,
|
|
37
|
+
normalizedRelativePath: `openapi/${filenames.yaml}`,
|
|
38
|
+
mediaType: 'application/yaml',
|
|
39
|
+
bytes: Buffer.from(yaml, 'utf8'),
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
outputRef: `technical-documentation:output/openapi/${sectionPath}/json`,
|
|
43
|
+
rendererRef: OPENAPI_RENDERER_REF,
|
|
44
|
+
outputKind: TechnicalDocumentationOutputKind.OPENAPI_DOCUMENT,
|
|
45
|
+
sourceUnitRefs,
|
|
46
|
+
normalizedRelativePath: `openapi/${filenames.json}`,
|
|
47
|
+
mediaType: 'application/json',
|
|
48
|
+
bytes: Buffer.from(json, 'utf8'),
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
}),
|
|
22
52
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* meaning.
|
|
53
|
+
* The API reference's entries in the site search (#1624): one per resource and per operation,
|
|
54
|
+
* derived from the documents above so a result can only name what the reference serves. Emitted
|
|
55
|
+
* even with no section, so the site's search page always has the file it imports.
|
|
27
56
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
outputRef: `technical-documentation:output/openapi/${sectionPath}/json`,
|
|
40
|
-
rendererRef: OPENAPI_RENDERER_REF,
|
|
41
|
-
outputKind: TechnicalDocumentationOutputKind.OPENAPI_DOCUMENT,
|
|
42
|
-
sourceUnitRefs,
|
|
43
|
-
normalizedRelativePath: `openapi/${filenames.json}`,
|
|
44
|
-
mediaType: 'application/json',
|
|
45
|
-
bytes: Buffer.from(json, 'utf8'),
|
|
46
|
-
},
|
|
47
|
-
];
|
|
48
|
-
}),
|
|
57
|
+
{
|
|
58
|
+
outputRef: 'technical-documentation:output/openapi/search-index',
|
|
59
|
+
rendererRef: OPENAPI_RENDERER_REF,
|
|
60
|
+
outputKind: TechnicalDocumentationOutputKind.NAVIGATION_INDEX,
|
|
61
|
+
sourceUnitRefs: [...input.sourceUnitRefs].sort(),
|
|
62
|
+
normalizedRelativePath: API_REFERENCE_SEARCH_INDEX_RELATIVE_PATH,
|
|
63
|
+
mediaType: 'application/json',
|
|
64
|
+
bytes: Buffer.from(`${JSON.stringify(buildApiReferenceSearchIndex(input.documents.sections))}\n`, 'utf8'),
|
|
65
|
+
}],
|
|
49
66
|
};
|
|
50
67
|
}
|
|
51
68
|
//# sourceMappingURL=technical-documentation-openapi-renderer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"technical-documentation-openapi-renderer.js","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-openapi-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,kCAAkC,EAAE,MAAM,uDAAuD,CAAC;AAC7I,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAElD,OAAO,EACL,wBAAwB,GAEzB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EACL,6CAA6C,GAE9C,MAAM,wCAAwC,CAAC;AAEhD,MAAM,oBAAoB,GAAG,0CAA0C,CAAC;AAExE,MAAM,UAAU,2CAA2C,CAAC,KAG3D;IACC,IAAI,KAAK,CAAC,cAAc,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC;IACrI,OAAO;QACL,SAAS,EAAE,6CAA6C,CAAC;YACvD,YAAY,EAAE,kCAAkC,CAAC,OAAO;YACxD,WAAW,EAAE,oBAAoB;YACjC,eAAe,EAAE,CAAC;YAClB,gBAAgB,EAAE,8DAA8D;SACjF,CAAC;QACF,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"technical-documentation-openapi-renderer.js","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-openapi-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,kCAAkC,EAAE,MAAM,uDAAuD,CAAC;AAC7I,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAElD,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EACL,wBAAwB,GAEzB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EACL,6CAA6C,GAE9C,MAAM,wCAAwC,CAAC;AAEhD,MAAM,oBAAoB,GAAG,0CAA0C,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AE,kBAAkB;wBAC7B,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC;qBACjC;oBACD;wBACE,SAAS,EAAE,0CAA0C,WAAW,OAAO;wBACvE,WAAW,EAAE,oBAAoB;wBACjC,UAAU,EAAE,gCAAgC,CAAC,gBAAgB;wBAC7D,cAAc;wBACd,sBAAsB,EAAE,WAAW,SAAS,CAAC,IAAI,EAAE;wBACnD,SAAS,EAAE,kBAAkB;wBAC7B,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC;qBACjC;iBACO,CAAC;YACb,CAAC,CAAC;YACF;;;;eAIG;YACH;gBACE,SAAS,EAAE,qDAAqD;gBAChE,WAAW,EAAE,oBAAoB;gBACjC,UAAU,EAAE,gCAAgC,CAAC,gBAAgB;gBAC7D,cAAc,EAAE,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC,IAAI,EAAE;gBAChD,sBAAsB,EAAE,wCAAwC;gBAChE,SAAS,EAAE,kBAAkB;gBAC7B,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,4BAA4B,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC;aAC1G,CAAC;KACH,CAAC;AACJ,CAAC","sourcesContent":["import { TechnicalDocumentationOutputKind, TechnicalDocumentationRendererKind } from '@wildo-ai/saas-specifications/technical-documentation';\nimport { stringify as stringifyYaml } from 'yaml';\n\nimport { buildApiReferenceSearchIndex } from '../../openapi/api-reference-search';\nimport {\n OPENAPI_OUTPUT_FILENAMES,\n type OpenApiGenerationOutput,\n} from '../../openapi/openapi-generation-output.schemas';\nimport {\n createTechnicalDocumentationRendererExecution,\n type TechnicalDocumentationRendererResult,\n} from './technical-documentation-render-model';\n\nconst OPENAPI_RENDERER_REF = 'technical-documentation:renderer/openapi';\n\n/** Where the API reference's search entries land, relative to the generated API-reference root. */\nexport const API_REFERENCE_SEARCH_INDEX_RELATIVE_PATH = 'indexes/api-reference-search.json';\n\nexport function renderVerifiedTechnicalDocumentationOpenApi(input: {\n readonly documents: OpenApiGenerationOutput;\n readonly sourceUnitRefs: readonly string[];\n}): TechnicalDocumentationRendererResult {\n if (input.sourceUnitRefs.length === 0) throw new Error('technical-documentation OpenAPI rendering requires authorized source units');\n return {\n execution: createTechnicalDocumentationRendererExecution({\n rendererKind: TechnicalDocumentationRendererKind.OPENAPI,\n rendererRef: OPENAPI_RENDERER_REF,\n rendererVersion: 1,\n configurationRef: 'technical-documentation:renderer-configuration/openapi-3-1-0',\n }),\n files: [...input.documents.sections.flatMap((section) => {\n const sectionPath = section.section.toLowerCase().replaceAll('_', '-');\n const sourceUnitRefs = [...input.sourceUnitRefs].sort();\n const filenames = OPENAPI_OUTPUT_FILENAMES[section.section];\n const yaml = stringifyYaml(section.document, { lineWidth: 0, sortMapEntries: false });\n const json = `${JSON.stringify(section.document, null, 2)}\\n`;\n /**\n * YAML and JSON are two deterministic serializations of one generator\n * document. YAML is the reviewable/downloadable contract; JSON is the\n * browser renderer input. Neither file contains renderer-authored API\n * meaning.\n */\n return [\n {\n outputRef: `technical-documentation:output/openapi/${sectionPath}/yaml`,\n rendererRef: OPENAPI_RENDERER_REF,\n outputKind: TechnicalDocumentationOutputKind.OPENAPI_DOCUMENT,\n sourceUnitRefs,\n normalizedRelativePath: `openapi/${filenames.yaml}`,\n mediaType: 'application/yaml',\n bytes: Buffer.from(yaml, 'utf8'),\n },\n {\n outputRef: `technical-documentation:output/openapi/${sectionPath}/json`,\n rendererRef: OPENAPI_RENDERER_REF,\n outputKind: TechnicalDocumentationOutputKind.OPENAPI_DOCUMENT,\n sourceUnitRefs,\n normalizedRelativePath: `openapi/${filenames.json}`,\n mediaType: 'application/json',\n bytes: Buffer.from(json, 'utf8'),\n },\n ] as const;\n }),\n /**\n * The API reference's entries in the site search (#1624): one per resource and per operation,\n * derived from the documents above so a result can only name what the reference serves. Emitted\n * even with no section, so the site's search page always has the file it imports.\n */\n {\n outputRef: 'technical-documentation:output/openapi/search-index',\n rendererRef: OPENAPI_RENDERER_REF,\n outputKind: TechnicalDocumentationOutputKind.NAVIGATION_INDEX,\n sourceUnitRefs: [...input.sourceUnitRefs].sort(),\n normalizedRelativePath: API_REFERENCE_SEARCH_INDEX_RELATIVE_PATH,\n mediaType: 'application/json',\n bytes: Buffer.from(`${JSON.stringify(buildApiReferenceSearchIndex(input.documents.sections))}\\n`, 'utf8'),\n }],\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"technical-documentation-render-model.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"technical-documentation-render-model.d.ts","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-render-model.ts"],"names":[],"mappings":"AAQA,OAAO,EAGL,gCAAgC,EAEhC,kCAAkC,EAClC,KAAK,gDAAgD,EACrD,KAAK,4CAA4C,EACjD,KAAK,yCAAyC,EAC9C,KAAK,yCAAyC,EAC9C,KAAK,mDAAmD,EACxD,KAAK,yCAAyC,EAC9C,KAAK,4BAA4B,EAClC,MAAM,uDAAuD,CAAC;AAE/D;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAE3E;AAED,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,wBAAwB,EAAE,yCAAyC,CAAC;IAC7E,QAAQ,CAAC,OAAO,EAAE,gDAAgD,CAAC,SAAS,CAAC,CAAC;IAC9E,QAAQ,CAAC,KAAK,EAAE,SAAS,4BAA4B,EAAE,CAAC;IACxD,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrD;AAED,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC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ESOURCE_PAGE_UNIT_REF_PREFIX } from '../application-documentation/technical-documentation-engine-content-bundle.js';
|
|
3
|
+
import { APPLICATION_DOCUMENTATION_CHAPTER_ROUTE_DIRECTORY, APPLICATION_DOCUMENTATION_CHAPTER_UNIT_REF_PREFIX, } from '../application-documentation/application-documentation-chapters.js';
|
|
3
4
|
import { createTechnicalDocumentationRenderOutputManifestV1, TechnicalDocumentationNormalizedRelativePathSchema, } from '@wildo-ai/saas-specifications/technical-documentation';
|
|
4
5
|
/**
|
|
5
6
|
* Names opaque emitted bytes, and detects their corruption when a reader compares this against the
|
|
@@ -124,25 +125,28 @@ export const ENGINE_UNIT_ROUTES = new Set(Object.values(ENGINE_UNIT_PATH_BY_SLUG
|
|
|
124
125
|
* it—so readers can find access, organization, security and integration
|
|
125
126
|
* material without learning Wildo vocabulary.
|
|
126
127
|
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
128
|
+
* Two namespaces are DERIVED rather than listed, because their units cannot be enumerated when this
|
|
129
|
+
* file is written: `unit/manages/<resource>`, the page per application resource, and
|
|
130
|
+
* `unit/guides/<slug>`, the chapters an application authors (#874). Both are RESERVED engine
|
|
131
|
+
* namespaces the projectors emit; the application supplies a subject or a slug and never a URL
|
|
132
|
+
* scheme. Any other unit — including one whose ref an application chose freely — still fails closed
|
|
133
|
+
* instead of acquiring an implicit route; that refusal is what this table is for.
|
|
131
134
|
*/
|
|
132
135
|
function pathForUnit(unit) {
|
|
133
136
|
const slug = slugForUnit(unit);
|
|
134
137
|
/*
|
|
135
|
-
*
|
|
138
|
+
* The first of TWO derived branches, both deliberately narrow.
|
|
136
139
|
*
|
|
137
140
|
* Every other route in this table is a constant, because a renderer owns audience-facing URLs
|
|
138
141
|
* and an authored page's URL is a decision somebody made. A page per application resource cannot
|
|
139
142
|
* work that way — the resources are not known when this file is written — so its route is
|
|
140
|
-
* DERIVED from the reserved `unit/manages/` namespace the projector emits.
|
|
143
|
+
* DERIVED from the reserved `unit/manages/` namespace the projector emits. The second branch,
|
|
144
|
+
* below, does the same for the reserved `unit/guides/` namespace of authored chapters (#874).
|
|
141
145
|
*
|
|
142
|
-
* What has NOT changed is the refusal
|
|
143
|
-
*
|
|
144
|
-
* routed at all. Anything outside
|
|
145
|
-
* missing decision rather than an implicit URL.
|
|
146
|
+
* What has NOT changed is the refusal at the end. A unit whose ref an application chose freely
|
|
147
|
+
* still fails closed; both derived namespaces are reserved by an engine projector, which is why
|
|
148
|
+
* their units can be routed at all. Anything outside the fixed table and these two namespaces is
|
|
149
|
+
* still a missing decision rather than an implicit URL.
|
|
146
150
|
*/
|
|
147
151
|
if (unit.unitRef.startsWith(APPLICATION_DOMAIN_RESOURCE_PAGE_UNIT_REF_PREFIX)) {
|
|
148
152
|
const resourceIdentifier = unit.unitRef.slice(APPLICATION_DOMAIN_RESOURCE_PAGE_UNIT_REF_PREFIX.length);
|
|
@@ -151,6 +155,18 @@ function pathForUnit(unit) {
|
|
|
151
155
|
}
|
|
152
156
|
return `${ENGINE_UNIT_PATH_BY_SLUG['what-this-application-manages']}/${resourceIdentifier}`;
|
|
153
157
|
}
|
|
158
|
+
/*
|
|
159
|
+
* The second derived branch, for authored chapters (#874). Checked BEFORE the fixed table on
|
|
160
|
+
* purpose: a chapter slug may coincide with an engine slug (`webhooks`), and the reserved prefix —
|
|
161
|
+
* not the slug — is what says whose page this is.
|
|
162
|
+
*/
|
|
163
|
+
if (unit.unitRef.startsWith(APPLICATION_DOCUMENTATION_CHAPTER_UNIT_REF_PREFIX)) {
|
|
164
|
+
const chapterSlug = unit.unitRef.slice(APPLICATION_DOCUMENTATION_CHAPTER_UNIT_REF_PREFIX.length);
|
|
165
|
+
if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(chapterSlug)) {
|
|
166
|
+
throw new Error(`technical-documentation chapter unit ${unit.unitRef} has no single-segment kebab-case slug`);
|
|
167
|
+
}
|
|
168
|
+
return `${APPLICATION_DOCUMENTATION_CHAPTER_ROUTE_DIRECTORY}/${chapterSlug}`;
|
|
169
|
+
}
|
|
154
170
|
if (unit.unitRef.startsWith('technical-documentation:unit/')) {
|
|
155
171
|
const path = ENGINE_UNIT_PATH_BY_SLUG[slug];
|
|
156
172
|
if (path !== undefined)
|