@wildo-ai/saas-technical-doc 1.1.1
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/LICENSE +34 -0
- package/dist/esm/.builder.pid +9 -0
- package/dist/esm/build/csp-emit.d.ts +9 -0
- package/dist/esm/build/csp-emit.d.ts.map +1 -0
- package/dist/esm/build/csp-emit.js +8 -0
- package/dist/esm/build/csp-emit.js.map +1 -0
- package/dist/esm/build/load-materialized-frontend-providers.d.ts +9 -0
- package/dist/esm/build/load-materialized-frontend-providers.d.ts.map +1 -0
- package/dist/esm/build/load-materialized-frontend-providers.js +9 -0
- package/dist/esm/build/load-materialized-frontend-providers.js.map +1 -0
- package/dist/esm/companion/application-documentation/application-organization-role-documentation.d.ts +66 -0
- package/dist/esm/companion/application-documentation/application-organization-role-documentation.d.ts.map +1 -0
- package/dist/esm/companion/application-documentation/application-organization-role-documentation.js +195 -0
- package/dist/esm/companion/application-documentation/application-organization-role-documentation.js.map +1 -0
- package/dist/esm/companion/application-documentation/application-organization-unit-resource-documentation.d.ts +36 -0
- package/dist/esm/companion/application-documentation/application-organization-unit-resource-documentation.d.ts.map +1 -0
- package/dist/esm/companion/application-documentation/application-organization-unit-resource-documentation.js +71 -0
- package/dist/esm/companion/application-documentation/application-organization-unit-resource-documentation.js.map +1 -0
- package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.d.ts +37 -0
- package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.d.ts.map +1 -0
- package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.js +1865 -0
- package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.js.map +1 -0
- package/dist/esm/companion/application-documentation/technical-documentation-operational-evidence.d.ts +22 -0
- package/dist/esm/companion/application-documentation/technical-documentation-operational-evidence.d.ts.map +1 -0
- package/dist/esm/companion/application-documentation/technical-documentation-operational-evidence.js +31 -0
- package/dist/esm/companion/application-documentation/technical-documentation-operational-evidence.js.map +1 -0
- package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.d.ts +31 -0
- package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.d.ts.map +1 -0
- package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.js +33 -0
- package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.js.map +1 -0
- package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.d.ts +13 -0
- package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.d.ts.map +1 -0
- package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.js +93 -0
- package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.js.map +1 -0
- package/dist/esm/companion/content/application-consumer-documentation-content-loader.d.ts +52 -0
- package/dist/esm/companion/content/application-consumer-documentation-content-loader.d.ts.map +1 -0
- package/dist/esm/companion/content/application-consumer-documentation-content-loader.js +191 -0
- package/dist/esm/companion/content/application-consumer-documentation-content-loader.js.map +1 -0
- package/dist/esm/companion/index.d.ts +39 -0
- package/dist/esm/companion/index.d.ts.map +1 -0
- package/dist/esm/companion/index.js +39 -0
- package/dist/esm/companion/index.js.map +1 -0
- package/dist/esm/companion/openapi-generator.d.ts +94 -0
- package/dist/esm/companion/openapi-generator.d.ts.map +1 -0
- package/dist/esm/companion/openapi-generator.js +1562 -0
- package/dist/esm/companion/openapi-generator.js.map +1 -0
- package/dist/esm/companion/operation-projection.schemas.d.ts +797 -0
- package/dist/esm/companion/operation-projection.schemas.d.ts.map +1 -0
- package/dist/esm/companion/operation-projection.schemas.js +610 -0
- package/dist/esm/companion/operation-projection.schemas.js.map +1 -0
- package/dist/esm/companion/publish-result.types.d.ts +124 -0
- package/dist/esm/companion/publish-result.types.d.ts.map +1 -0
- package/dist/esm/companion/publish-result.types.js +28 -0
- package/dist/esm/companion/publish-result.types.js.map +1 -0
- package/dist/esm/companion/rendering/technical-documentation-authorized-bundle-reader.d.ts +26 -0
- package/dist/esm/companion/rendering/technical-documentation-authorized-bundle-reader.d.ts.map +1 -0
- package/dist/esm/companion/rendering/technical-documentation-authorized-bundle-reader.js +63 -0
- package/dist/esm/companion/rendering/technical-documentation-authorized-bundle-reader.js.map +1 -0
- package/dist/esm/companion/rendering/technical-documentation-build-measurement.d.ts +23 -0
- package/dist/esm/companion/rendering/technical-documentation-build-measurement.d.ts.map +1 -0
- package/dist/esm/companion/rendering/technical-documentation-build-measurement.js +104 -0
- package/dist/esm/companion/rendering/technical-documentation-build-measurement.js.map +1 -0
- package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.d.ts +9 -0
- package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.d.ts.map +1 -0
- package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.js +421 -0
- package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.js.map +1 -0
- package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.d.ts +72 -0
- package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.d.ts.map +1 -0
- package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.js +204 -0
- package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.js.map +1 -0
- package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.d.ts +9 -0
- package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.d.ts.map +1 -0
- package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.js +106 -0
- package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.js.map +1 -0
- package/dist/esm/companion/rendering/technical-documentation-mdx-escaping.d.ts +43 -0
- package/dist/esm/companion/rendering/technical-documentation-mdx-escaping.d.ts.map +1 -0
- package/dist/esm/companion/rendering/technical-documentation-mdx-escaping.js +88 -0
- package/dist/esm/companion/rendering/technical-documentation-mdx-escaping.js.map +1 -0
- package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.d.ts +7 -0
- package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.d.ts.map +1 -0
- package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.js +51 -0
- package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.js.map +1 -0
- package/dist/esm/companion/rendering/technical-documentation-render-model.d.ts +45 -0
- package/dist/esm/companion/rendering/technical-documentation-render-model.d.ts.map +1 -0
- package/dist/esm/companion/rendering/technical-documentation-render-model.js +178 -0
- package/dist/esm/companion/rendering/technical-documentation-render-model.js.map +1 -0
- package/dist/esm/companion/rendering/technical-documentation-search-index-renderer.d.ts +3 -0
- package/dist/esm/companion/rendering/technical-documentation-search-index-renderer.d.ts.map +1 -0
- package/dist/esm/companion/rendering/technical-documentation-search-index-renderer.js +49 -0
- package/dist/esm/companion/rendering/technical-documentation-search-index-renderer.js.map +1 -0
- package/dist/esm/companion/spec-to-operation-doc.d.ts +176 -0
- package/dist/esm/companion/spec-to-operation-doc.d.ts.map +1 -0
- package/dist/esm/companion/spec-to-operation-doc.js +326 -0
- package/dist/esm/companion/spec-to-operation-doc.js.map +1 -0
- package/dist/esm/companion/technical-documentation-asset-path.d.ts +16 -0
- package/dist/esm/companion/technical-documentation-asset-path.d.ts.map +1 -0
- package/dist/esm/companion/technical-documentation-asset-path.js +19 -0
- package/dist/esm/companion/technical-documentation-asset-path.js.map +1 -0
- package/dist/esm/companion/technical-documentation-capture-execution-port.d.ts +14 -0
- package/dist/esm/companion/technical-documentation-capture-execution-port.d.ts.map +1 -0
- package/dist/esm/companion/technical-documentation-capture-execution-port.js +1 -0
- package/dist/esm/companion/technical-documentation-capture-execution-port.js.map +1 -0
- package/dist/esm/companion/technical-documentation-diagram-materializer.d.ts +25 -0
- package/dist/esm/companion/technical-documentation-diagram-materializer.d.ts.map +1 -0
- package/dist/esm/companion/technical-documentation-diagram-materializer.js +86 -0
- package/dist/esm/companion/technical-documentation-diagram-materializer.js.map +1 -0
- package/dist/esm/companion/technical-documentation-placeholder-materializer.d.ts +17 -0
- package/dist/esm/companion/technical-documentation-placeholder-materializer.d.ts.map +1 -0
- package/dist/esm/companion/technical-documentation-placeholder-materializer.js +63 -0
- package/dist/esm/companion/technical-documentation-placeholder-materializer.js.map +1 -0
- package/dist/esm/companion/zod-to-openapi.d.ts +67 -0
- package/dist/esm/companion/zod-to-openapi.d.ts.map +1 -0
- package/dist/esm/companion/zod-to-openapi.js +211 -0
- package/dist/esm/companion/zod-to-openapi.js.map +1 -0
- package/dist/esm/companion-exports.d.ts +32 -0
- package/dist/esm/companion-exports.d.ts.map +1 -0
- package/dist/esm/companion-exports.js +32 -0
- package/dist/esm/companion-exports.js.map +1 -0
- package/dist/esm/config/define-tech-doc-config.d.ts +38 -0
- package/dist/esm/config/define-tech-doc-config.d.ts.map +1 -0
- package/dist/esm/config/define-tech-doc-config.js +40 -0
- package/dist/esm/config/define-tech-doc-config.js.map +1 -0
- package/dist/esm/config/index.d.ts +22 -0
- package/dist/esm/config/index.d.ts.map +1 -0
- package/dist/esm/config/index.js +22 -0
- package/dist/esm/config/index.js.map +1 -0
- package/dist/esm/config/wildo-tech-doc-config.schemas.d.ts +204 -0
- package/dist/esm/config/wildo-tech-doc-config.schemas.d.ts.map +1 -0
- package/dist/esm/config/wildo-tech-doc-config.schemas.js +192 -0
- package/dist/esm/config/wildo-tech-doc-config.schemas.js.map +1 -0
- package/dist/esm/content/application-consumer-documentation-content-manifest.schemas.d.ts +82 -0
- package/dist/esm/content/application-consumer-documentation-content-manifest.schemas.d.ts.map +1 -0
- package/dist/esm/content/application-consumer-documentation-content-manifest.schemas.js +114 -0
- package/dist/esm/content/application-consumer-documentation-content-manifest.schemas.js.map +1 -0
- package/dist/esm/content/application-consumer-documentation-content.techdoc.d.ts +420 -0
- package/dist/esm/content/application-consumer-documentation-content.techdoc.d.ts.map +1 -0
- package/dist/esm/content/application-consumer-documentation-content.techdoc.js +9619 -0
- package/dist/esm/content/application-consumer-documentation-content.techdoc.js.map +1 -0
- package/dist/esm/content.exports.d.ts +9 -0
- package/dist/esm/content.exports.d.ts.map +1 -0
- package/dist/esm/content.exports.js +9 -0
- package/dist/esm/content.exports.js.map +1 -0
- package/dist/esm/index.d.ts +26 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +26 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/openapi/api-reference-link-index.d.ts +98 -0
- package/dist/esm/openapi/api-reference-link-index.d.ts.map +1 -0
- package/dist/esm/openapi/api-reference-link-index.js +301 -0
- package/dist/esm/openapi/api-reference-link-index.js.map +1 -0
- package/dist/esm/openapi/api-reference-targets.d.ts +71 -0
- package/dist/esm/openapi/api-reference-targets.d.ts.map +1 -0
- package/dist/esm/openapi/api-reference-targets.js +114 -0
- package/dist/esm/openapi/api-reference-targets.js.map +1 -0
- package/dist/esm/openapi/index.d.ts +20 -0
- package/dist/esm/openapi/index.d.ts.map +1 -0
- package/dist/esm/openapi/index.js +20 -0
- package/dist/esm/openapi/index.js.map +1 -0
- package/dist/esm/openapi/openapi-generation-output.schemas.d.ts +80 -0
- package/dist/esm/openapi/openapi-generation-output.schemas.d.ts.map +1 -0
- package/dist/esm/openapi/openapi-generation-output.schemas.js +76 -0
- package/dist/esm/openapi/openapi-generation-output.schemas.js.map +1 -0
- package/dist/esm/openapi-reference-model.exports.d.ts +10 -0
- package/dist/esm/openapi-reference-model.exports.d.ts.map +1 -0
- package/dist/esm/openapi-reference-model.exports.js +10 -0
- package/dist/esm/openapi-reference-model.exports.js.map +1 -0
- package/dist/esm/runtime/AuthExchangePage.d.ts +84 -0
- package/dist/esm/runtime/AuthExchangePage.d.ts.map +1 -0
- package/dist/esm/runtime/AuthExchangePage.js +188 -0
- package/dist/esm/runtime/AuthExchangePage.js.map +1 -0
- package/dist/esm/runtime/DocsAuthContext.d.ts +119 -0
- package/dist/esm/runtime/DocsAuthContext.d.ts.map +1 -0
- package/dist/esm/runtime/DocsAuthContext.js +171 -0
- package/dist/esm/runtime/DocsAuthContext.js.map +1 -0
- package/dist/esm/runtime/decode-jwt-claims.d.ts +39 -0
- package/dist/esm/runtime/decode-jwt-claims.d.ts.map +1 -0
- package/dist/esm/runtime/decode-jwt-claims.js +86 -0
- package/dist/esm/runtime/decode-jwt-claims.js.map +1 -0
- package/dist/esm/runtime/docs-auth-client.d.ts +193 -0
- package/dist/esm/runtime/docs-auth-client.d.ts.map +1 -0
- package/dist/esm/runtime/docs-auth-client.js +211 -0
- package/dist/esm/runtime/docs-auth-client.js.map +1 -0
- package/dist/esm/runtime/docs-auth-session.schemas.d.ts +77 -0
- package/dist/esm/runtime/docs-auth-session.schemas.d.ts.map +1 -0
- package/dist/esm/runtime/docs-auth-session.schemas.js +50 -0
- package/dist/esm/runtime/docs-auth-session.schemas.js.map +1 -0
- package/dist/esm/runtime/frontend-provider-registry.techdoc.d.ts +17 -0
- package/dist/esm/runtime/frontend-provider-registry.techdoc.d.ts.map +1 -0
- package/dist/esm/runtime/frontend-provider-registry.techdoc.js +23 -0
- package/dist/esm/runtime/frontend-provider-registry.techdoc.js.map +1 -0
- package/dist/esm/runtime/index.d.ts +57 -0
- package/dist/esm/runtime/index.d.ts.map +1 -0
- package/dist/esm/runtime/index.js +76 -0
- package/dist/esm/runtime/index.js.map +1 -0
- package/dist/esm/runtime/openapi-reference-conservation.d.ts +20 -0
- package/dist/esm/runtime/openapi-reference-conservation.d.ts.map +1 -0
- package/dist/esm/runtime/openapi-reference-conservation.js +102 -0
- package/dist/esm/runtime/openapi-reference-conservation.js.map +1 -0
- package/dist/esm/runtime/openapi-reference-model.d.ts +224 -0
- package/dist/esm/runtime/openapi-reference-model.d.ts.map +1 -0
- package/dist/esm/runtime/openapi-reference-model.js +579 -0
- package/dist/esm/runtime/openapi-reference-model.js.map +1 -0
- package/dist/esm/runtime/openapi-reference-view.d.ts +13 -0
- package/dist/esm/runtime/openapi-reference-view.d.ts.map +1 -0
- package/dist/esm/runtime/openapi-reference-view.js +284 -0
- package/dist/esm/runtime/openapi-reference-view.js.map +1 -0
- package/dist/esm/runtime/use-docs-auth-session.d.ts +26 -0
- package/dist/esm/runtime/use-docs-auth-session.d.ts.map +1 -0
- package/dist/esm/runtime/use-docs-auth-session.js +34 -0
- package/dist/esm/runtime/use-docs-auth-session.js.map +1 -0
- package/dist/esm/runtime/use-docs-frontend-provider-registry.d.ts +3 -0
- package/dist/esm/runtime/use-docs-frontend-provider-registry.d.ts.map +1 -0
- package/dist/esm/runtime/use-docs-frontend-provider-registry.js +5 -0
- package/dist/esm/runtime/use-docs-frontend-provider-registry.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +117 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Roles relevant to the docs-site gating decisions.
|
|
4
|
+
*
|
|
5
|
+
* Mirrors the role axis the SaaS app uses on access tokens. The docs site
|
|
6
|
+
* itself only cares about ONE distinction: "is this user an org admin or
|
|
7
|
+
* not?" — used by the Navbar swizzle to hide the "Organization API" link
|
|
8
|
+
* and by the DocItem swizzle to gate `/api/organization/*` pages
|
|
9
|
+
* (saas-technical-doc.md K-11).
|
|
10
|
+
*
|
|
11
|
+
* `ORG_ADMIN` value matches the string carried by the access token's
|
|
12
|
+
* `role` claim issued by `auth-token-issuer.backend.service.ts`. The
|
|
13
|
+
* generic `OTHER` bucket covers every other role (regular org member,
|
|
14
|
+
* viewer, application-level admin, etc.) — none of them grant Org-API
|
|
15
|
+
* visibility on the docs site.
|
|
16
|
+
*/
|
|
17
|
+
export var DocsRole;
|
|
18
|
+
(function (DocsRole) {
|
|
19
|
+
DocsRole["ORG_ADMIN"] = "org_admin";
|
|
20
|
+
DocsRole["OTHER"] = "other";
|
|
21
|
+
})(DocsRole || (DocsRole = {}));
|
|
22
|
+
/**
|
|
23
|
+
* Subset of access-token claims the docs site cares about.
|
|
24
|
+
*
|
|
25
|
+
* The full access-token payload issued by the SaaS backend carries many
|
|
26
|
+
* more fields (organization id, application id, scopes, …) — we
|
|
27
|
+
* deliberately project only the minimum needed by the docs-site swizzles
|
|
28
|
+
* so that:
|
|
29
|
+
* 1. A future change to the access-token shape that adds fields
|
|
30
|
+
* doesn't ripple into the docs site.
|
|
31
|
+
* 2. The docs site never accidentally renders or transmits sensitive
|
|
32
|
+
* claims it has no business consuming.
|
|
33
|
+
*
|
|
34
|
+
* `userId` and `email` are present for display purposes ("Signed in as
|
|
35
|
+
* <email>" in the navbar — done by the Navbar swizzle, not this package).
|
|
36
|
+
*
|
|
37
|
+
* `role` is the gating axis (see {@link DocsRole}).
|
|
38
|
+
*
|
|
39
|
+
* `exp` (UNIX seconds) lets the context clear the in-memory session as
|
|
40
|
+
* soon as the access token expires — without ever calling the network.
|
|
41
|
+
* No refresh loop (K-9b): when `exp` passes, the user is anonymous again
|
|
42
|
+
* until they re-handshake from the SaaS app.
|
|
43
|
+
*/
|
|
44
|
+
export const DocsJwtClaimsSchema = z.strictObject({
|
|
45
|
+
userId: z.string().min(1),
|
|
46
|
+
email: z.email().optional(),
|
|
47
|
+
role: z.enum(DocsRole),
|
|
48
|
+
exp: z.number().int().positive(),
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=docs-auth-session.schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs-auth-session.schemas.js","sourceRoot":"","sources":["../../../../src/runtime/docs-auth-session.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAN,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,mCAAuB,CAAA;IACvB,2BAAe,CAAA;AACjB,CAAC,EAHW,QAAQ,KAAR,QAAQ,QAGnB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,YAAY,CAAC;IAChD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IAC3B,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;IACtB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\n\n/**\n * Roles relevant to the docs-site gating decisions.\n *\n * Mirrors the role axis the SaaS app uses on access tokens. The docs site\n * itself only cares about ONE distinction: \"is this user an org admin or\n * not?\" — used by the Navbar swizzle to hide the \"Organization API\" link\n * and by the DocItem swizzle to gate `/api/organization/*` pages\n * (saas-technical-doc.md K-11).\n *\n * `ORG_ADMIN` value matches the string carried by the access token's\n * `role` claim issued by `auth-token-issuer.backend.service.ts`. The\n * generic `OTHER` bucket covers every other role (regular org member,\n * viewer, application-level admin, etc.) — none of them grant Org-API\n * visibility on the docs site.\n */\nexport enum DocsRole {\n ORG_ADMIN = 'org_admin',\n OTHER = 'other',\n}\n\n/**\n * Subset of access-token claims the docs site cares about.\n *\n * The full access-token payload issued by the SaaS backend carries many\n * more fields (organization id, application id, scopes, …) — we\n * deliberately project only the minimum needed by the docs-site swizzles\n * so that:\n * 1. A future change to the access-token shape that adds fields\n * doesn't ripple into the docs site.\n * 2. The docs site never accidentally renders or transmits sensitive\n * claims it has no business consuming.\n *\n * `userId` and `email` are present for display purposes (\"Signed in as\n * <email>\" in the navbar — done by the Navbar swizzle, not this package).\n *\n * `role` is the gating axis (see {@link DocsRole}).\n *\n * `exp` (UNIX seconds) lets the context clear the in-memory session as\n * soon as the access token expires — without ever calling the network.\n * No refresh loop (K-9b): when `exp` passes, the user is anonymous again\n * until they re-handshake from the SaaS app.\n */\nexport const DocsJwtClaimsSchema = z.strictObject({\n userId: z.string().min(1),\n email: z.email().optional(),\n role: z.enum(DocsRole),\n exp: z.number().int().positive(),\n});\nexport type DocsJwtClaims = z.infer<typeof DocsJwtClaimsSchema>;\n\n/**\n * Public shape exposed by `useDocsAuthSession()` (saas-technical-doc.md K-11).\n *\n * Three mutually-exclusive states:\n * - `status: 'anonymous'` — no handoff has been completed.\n * - `status: 'exchanging'` — `/auth/exchange?code=…` is in flight.\n * - `status: 'authenticated'` — `claims` and `accessToken` are present.\n *\n * Consumers (the three swizzles) discriminate on `status` and never reach\n * for `accessToken`/`claims` while in the `anonymous` or `exchanging`\n * states — the type narrows correctly thanks to the discriminated union.\n *\n * Does NOT model an `error` state directly: errors during the exchange\n * are surfaced via the `AuthExchangePage` component's local UI, after\n * which the session falls back to `anonymous`. Keeping the session shape\n * tight prevents the swizzles from having to render error-recovery UI\n * for events they did not cause.\n */\nexport type DocsAuthSession =\n | { status: 'anonymous' }\n | { status: 'exchanging' }\n | { status: 'authenticated'; accessToken: string; claims: DocsJwtClaims };\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FrontendProviderEntry, FrontendProvidersBlock, ProviderCapability } from '@wildo-ai/saas-models/public-runtime';
|
|
2
|
+
export type FrontendTechdocProviderRef = string & {
|
|
3
|
+
readonly __brand: 'FrontendTechdocProviderRef';
|
|
4
|
+
};
|
|
5
|
+
export type FrontendTechdocProviderModule = FrontendProviderEntry;
|
|
6
|
+
export interface FrontendTechdocProviderRegistry {
|
|
7
|
+
readonly modules: ReadonlyMap<FrontendTechdocProviderRef, FrontendTechdocProviderModule>;
|
|
8
|
+
getProviderByRef(ref: FrontendTechdocProviderRef): FrontendTechdocProviderModule | undefined;
|
|
9
|
+
getProvidersByProviderCapability(providerCapability: ProviderCapability): ReadonlyArray<FrontendTechdocProviderModule>;
|
|
10
|
+
findProviderByProviderCapability(providerCapability: ProviderCapability): FrontendTechdocProviderModule | undefined;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Tech-doc runtime registry hydrated from the materialized frontend-provider
|
|
14
|
+
* block for the active docs service.
|
|
15
|
+
*/
|
|
16
|
+
export declare function createFrontendTechdocProviderRegistry(frontendProviders?: FrontendProvidersBlock): FrontendTechdocProviderRegistry;
|
|
17
|
+
//# sourceMappingURL=frontend-provider-registry.techdoc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontend-provider-registry.techdoc.d.ts","sourceRoot":"","sources":["../../../../src/runtime/frontend-provider-registry.techdoc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,sCAAsC,CAAC;AAE9C,MAAM,MAAM,0BAA0B,GAAG,MAAM,GAAG;IAChD,QAAQ,CAAC,OAAO,EAAE,4BAA4B,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,qBAAqB,CAAC;AAElE,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,OAAO,EAAE,WAAW,CAC3B,0BAA0B,EAC1B,6BAA6B,CAC9B,CAAC;IAEF,gBAAgB,CACd,GAAG,EAAE,0BAA0B,GAC9B,6BAA6B,GAAG,SAAS,CAAC;IAE7C,gCAAgC,CAC9B,kBAAkB,EAAE,kBAAkB,GACrC,aAAa,CAAC,6BAA6B,CAAC,CAAC;IAEhD,gCAAgC,CAC9B,kBAAkB,EAAE,kBAAkB,GACrC,6BAA6B,GAAG,SAAS,CAAC;CAC9C;AAED;;;GAGG;AACH,wBAAgB,qCAAqC,CACnD,iBAAiB,CAAC,EAAE,sBAAsB,GACzC,+BAA+B,CAwBjC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tech-doc runtime registry hydrated from the materialized frontend-provider
|
|
3
|
+
* block for the active docs service.
|
|
4
|
+
*/
|
|
5
|
+
export function createFrontendTechdocProviderRegistry(frontendProviders) {
|
|
6
|
+
const modules = new Map(Object.entries(frontendProviders?.providers ?? {}).map(([ref, provider]) => [
|
|
7
|
+
ref,
|
|
8
|
+
provider,
|
|
9
|
+
]));
|
|
10
|
+
return {
|
|
11
|
+
modules,
|
|
12
|
+
getProviderByRef(ref) {
|
|
13
|
+
return modules.get(ref);
|
|
14
|
+
},
|
|
15
|
+
getProvidersByProviderCapability(providerCapability) {
|
|
16
|
+
return [...modules.values()].filter((provider) => provider.providerCapabilities.includes(providerCapability));
|
|
17
|
+
},
|
|
18
|
+
findProviderByProviderCapability(providerCapability) {
|
|
19
|
+
return [...modules.values()].find((provider) => provider.providerCapabilities.includes(providerCapability));
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=frontend-provider-registry.techdoc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontend-provider-registry.techdoc.js","sourceRoot":"","sources":["../../../../src/runtime/frontend-provider-registry.techdoc.ts"],"names":[],"mappings":"AA+BA;;;GAGG;AACH,MAAM,UAAU,qCAAqC,CACnD,iBAA0C;IAE1C,MAAM,OAAO,GAAG,IAAI,GAAG,CACrB,MAAM,CAAC,OAAO,CAAC,iBAAiB,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC;QAC1E,GAAiC;QACjC,QAAyC;KAC1C,CAAC,CACH,CAAC;IAEF,OAAO;QACL,OAAO;QACP,gBAAgB,CAAC,GAA+B;YAC9C,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC1B,CAAC;QACD,gCAAgC,CAAC,kBAAsC;YACrE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAC/C,QAAQ,CAAC,oBAAoB,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAC3D,CAAC;QACJ,CAAC;QACD,gCAAgC,CAAC,kBAAsC;YACrE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAC7C,QAAQ,CAAC,oBAAoB,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAC3D,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type {\n FrontendProviderEntry,\n FrontendProvidersBlock,\n ProviderCapability,\n} from '@wildo-ai/saas-models/public-runtime';\n\nexport type FrontendTechdocProviderRef = string & {\n readonly __brand: 'FrontendTechdocProviderRef';\n};\n\nexport type FrontendTechdocProviderModule = FrontendProviderEntry;\n\nexport interface FrontendTechdocProviderRegistry {\n readonly modules: ReadonlyMap<\n FrontendTechdocProviderRef,\n FrontendTechdocProviderModule\n >;\n\n getProviderByRef(\n ref: FrontendTechdocProviderRef,\n ): FrontendTechdocProviderModule | undefined;\n\n getProvidersByProviderCapability(\n providerCapability: ProviderCapability,\n ): ReadonlyArray<FrontendTechdocProviderModule>;\n\n findProviderByProviderCapability(\n providerCapability: ProviderCapability,\n ): FrontendTechdocProviderModule | undefined;\n}\n\n/**\n * Tech-doc runtime registry hydrated from the materialized frontend-provider\n * block for the active docs service.\n */\nexport function createFrontendTechdocProviderRegistry(\n frontendProviders?: FrontendProvidersBlock,\n): FrontendTechdocProviderRegistry {\n const modules = new Map<FrontendTechdocProviderRef, FrontendTechdocProviderModule>(\n Object.entries(frontendProviders?.providers ?? {}).map(([ref, provider]) => [\n ref as FrontendTechdocProviderRef,\n provider as FrontendTechdocProviderModule,\n ]),\n );\n\n return {\n modules,\n getProviderByRef(ref: FrontendTechdocProviderRef) {\n return modules.get(ref);\n },\n getProvidersByProviderCapability(providerCapability: ProviderCapability) {\n return [...modules.values()].filter((provider) =>\n provider.providerCapabilities.includes(providerCapability),\n );\n },\n findProviderByProviderCapability(providerCapability: ProviderCapability) {\n return [...modules.values()].find((provider) =>\n provider.providerCapabilities.includes(providerCapability),\n );\n },\n };\n}\n"]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@wildo-ai/saas-technical-doc/runtime` — browser-only auth runtime
|
|
3
|
+
* for the Docusaurus-served docs site (saas-technical-doc.md K-9b).
|
|
4
|
+
*
|
|
5
|
+
* Public surface (consumed by the three Docusaurus swizzles per K-11):
|
|
6
|
+
*
|
|
7
|
+
* - `<DocsAuthProvider apiBaseUrl="…">` — Root swizzle wraps children.
|
|
8
|
+
* - `useDocsAuthSession()` — Navbar + DocItem swizzles read.
|
|
9
|
+
* - `<AuthExchangePage />` — mounted at `/auth/exchange`.
|
|
10
|
+
* - `DocsAuthClient` — direct access for the DocItem
|
|
11
|
+
* swizzle's "request handoff back
|
|
12
|
+
* to app" code path.
|
|
13
|
+
* - `DocsAuthClientError` + code type — typed error branch surface.
|
|
14
|
+
* - `DocsRole` / `DocsAuthSession` — discriminated-union types.
|
|
15
|
+
* - `useDocsFrontendProviderRegistry()` — read the materialized frontend
|
|
16
|
+
* provider registry for this docs
|
|
17
|
+
* service (search / future SDK
|
|
18
|
+
* widgets).
|
|
19
|
+
* - `decodeJwtClaims` — exposed so apps can decode
|
|
20
|
+
* access tokens issued by
|
|
21
|
+
* non-handoff flows (rare;
|
|
22
|
+
* reserved for advanced use).
|
|
23
|
+
*
|
|
24
|
+
* @wildo-boundary
|
|
25
|
+
* - This sub-tree MAY use React, `react-dom`, the browser `fetch`, and
|
|
26
|
+
* the browser `atob` global. It MUST NOT import:
|
|
27
|
+
* - Node built-ins (`fs`, `path`, …) — would break Docusaurus
|
|
28
|
+
* client bundle.
|
|
29
|
+
* - `@wildo-ai/saas-frontend-lib` — entire point of K-9b
|
|
30
|
+
* is to NOT pull this.
|
|
31
|
+
* - inversify — reserved for the SaaS
|
|
32
|
+
* app DI stack.
|
|
33
|
+
* - This sub-tree MAY import shared schemas + DTO types from
|
|
34
|
+
* `@wildo-ai/saas-models/public-runtime` (the lightweight subset
|
|
35
|
+
* allow-listed by `runtime-bundle-isolation.test.ts`).
|
|
36
|
+
* - This sub-tree MUST initialize `@wildo-ai/zod-decorators` at runtime
|
|
37
|
+
* entry — see the `ensureZodDecoratorsLoaded(z)` side-effect below.
|
|
38
|
+
* Skipping this leaves the docs runtime with an under-augmented Zod
|
|
39
|
+
* `ZodObject` declaration, which historically caused cross-package
|
|
40
|
+
* `z.infer` widening (the H-3 / M-7 cross-frontend-handoff incident,
|
|
41
|
+
* see `.cursor/plans/cross-app-jwt-propagation.md`).
|
|
42
|
+
* - The package's `./companion` and `./` (root) entries MUST NOT import
|
|
43
|
+
* from this sub-tree (see those files' boundary blocks).
|
|
44
|
+
*/
|
|
45
|
+
export * from './docs-auth-session.schemas';
|
|
46
|
+
export * from './decode-jwt-claims';
|
|
47
|
+
export * from './docs-auth-client';
|
|
48
|
+
export * from './DocsAuthContext';
|
|
49
|
+
export * from './frontend-provider-registry.techdoc';
|
|
50
|
+
export { FrontendProviderEntrySchema, FrontendProvidersBlockSchema, type FrontendProviderEntry, type FrontendProvidersBlock, } from '@wildo-ai/saas-models/public-runtime';
|
|
51
|
+
export * from './use-docs-auth-session';
|
|
52
|
+
export * from './use-docs-frontend-provider-registry';
|
|
53
|
+
export * from './AuthExchangePage';
|
|
54
|
+
export * from './openapi-reference-model';
|
|
55
|
+
export * from './openapi-reference-conservation';
|
|
56
|
+
export * from './openapi-reference-view';
|
|
57
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAuBH,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sCAAsC,CAAC;AACrD,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,sCAAsC,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uCAAuC,CAAC;AACtD,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@wildo-ai/saas-technical-doc/runtime` — browser-only auth runtime
|
|
3
|
+
* for the Docusaurus-served docs site (saas-technical-doc.md K-9b).
|
|
4
|
+
*
|
|
5
|
+
* Public surface (consumed by the three Docusaurus swizzles per K-11):
|
|
6
|
+
*
|
|
7
|
+
* - `<DocsAuthProvider apiBaseUrl="…">` — Root swizzle wraps children.
|
|
8
|
+
* - `useDocsAuthSession()` — Navbar + DocItem swizzles read.
|
|
9
|
+
* - `<AuthExchangePage />` — mounted at `/auth/exchange`.
|
|
10
|
+
* - `DocsAuthClient` — direct access for the DocItem
|
|
11
|
+
* swizzle's "request handoff back
|
|
12
|
+
* to app" code path.
|
|
13
|
+
* - `DocsAuthClientError` + code type — typed error branch surface.
|
|
14
|
+
* - `DocsRole` / `DocsAuthSession` — discriminated-union types.
|
|
15
|
+
* - `useDocsFrontendProviderRegistry()` — read the materialized frontend
|
|
16
|
+
* provider registry for this docs
|
|
17
|
+
* service (search / future SDK
|
|
18
|
+
* widgets).
|
|
19
|
+
* - `decodeJwtClaims` — exposed so apps can decode
|
|
20
|
+
* access tokens issued by
|
|
21
|
+
* non-handoff flows (rare;
|
|
22
|
+
* reserved for advanced use).
|
|
23
|
+
*
|
|
24
|
+
* @wildo-boundary
|
|
25
|
+
* - This sub-tree MAY use React, `react-dom`, the browser `fetch`, and
|
|
26
|
+
* the browser `atob` global. It MUST NOT import:
|
|
27
|
+
* - Node built-ins (`fs`, `path`, …) — would break Docusaurus
|
|
28
|
+
* client bundle.
|
|
29
|
+
* - `@wildo-ai/saas-frontend-lib` — entire point of K-9b
|
|
30
|
+
* is to NOT pull this.
|
|
31
|
+
* - inversify — reserved for the SaaS
|
|
32
|
+
* app DI stack.
|
|
33
|
+
* - This sub-tree MAY import shared schemas + DTO types from
|
|
34
|
+
* `@wildo-ai/saas-models/public-runtime` (the lightweight subset
|
|
35
|
+
* allow-listed by `runtime-bundle-isolation.test.ts`).
|
|
36
|
+
* - This sub-tree MUST initialize `@wildo-ai/zod-decorators` at runtime
|
|
37
|
+
* entry — see the `ensureZodDecoratorsLoaded(z)` side-effect below.
|
|
38
|
+
* Skipping this leaves the docs runtime with an under-augmented Zod
|
|
39
|
+
* `ZodObject` declaration, which historically caused cross-package
|
|
40
|
+
* `z.infer` widening (the H-3 / M-7 cross-frontend-handoff incident,
|
|
41
|
+
* see `.cursor/plans/cross-app-jwt-propagation.md`).
|
|
42
|
+
* - The package's `./companion` and `./` (root) entries MUST NOT import
|
|
43
|
+
* from this sub-tree (see those files' boundary blocks).
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* Boot the project's Zod decorator augmentation for this bundle.
|
|
47
|
+
*
|
|
48
|
+
* `@wildo-ai/saas-models/public-runtime` re-exports schemas authored
|
|
49
|
+
* against the augmented `ZodObject` interface declared by
|
|
50
|
+
* `@wildo-ai/zod-decorators`. Without `ensureZodDecoratorsLoaded(z)`
|
|
51
|
+
* being called once on this bundle's Zod instance, the docs runtime sees
|
|
52
|
+
* a schema graph whose `.shape` access paths and `z.infer` results don't
|
|
53
|
+
* match what the SaaS app sees — a silent contract drift that bit us in
|
|
54
|
+
* H-3 / M-7. The call is idempotent (guarded inside the function) so
|
|
55
|
+
* importing this module multiple times is a no-op after the first load.
|
|
56
|
+
*
|
|
57
|
+
* The bare-specifier import is allow-listed by
|
|
58
|
+
* `runtime-bundle-isolation.test.ts` (revised 2026-04-19); the package
|
|
59
|
+
* itself is browser-safe (it only mutates `z.ZodType.prototype`).
|
|
60
|
+
*/
|
|
61
|
+
import { z } from 'zod';
|
|
62
|
+
import { ensureZodDecoratorsLoaded } from '@wildo-ai/zod-decorators';
|
|
63
|
+
ensureZodDecoratorsLoaded(z);
|
|
64
|
+
export * from './docs-auth-session.schemas.js';
|
|
65
|
+
export * from './decode-jwt-claims.js';
|
|
66
|
+
export * from './docs-auth-client.js';
|
|
67
|
+
export * from './DocsAuthContext.js';
|
|
68
|
+
export * from './frontend-provider-registry.techdoc.js';
|
|
69
|
+
export { FrontendProviderEntrySchema, FrontendProvidersBlockSchema, } from '@wildo-ai/saas-models/public-runtime';
|
|
70
|
+
export * from './use-docs-auth-session.js';
|
|
71
|
+
export * from './use-docs-frontend-provider-registry.js';
|
|
72
|
+
export * from './AuthExchangePage.js';
|
|
73
|
+
export * from './openapi-reference-model.js';
|
|
74
|
+
export * from './openapi-reference-conservation.js';
|
|
75
|
+
export * from './openapi-reference-view.js';
|
|
76
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,yBAAyB,CAAC,CAAC,CAAC,CAAC;AAE7B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sCAAsC,CAAC;AACrD,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,GAG7B,MAAM,sCAAsC,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uCAAuC,CAAC;AACtD,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC","sourcesContent":["/**\n * `@wildo-ai/saas-technical-doc/runtime` — browser-only auth runtime\n * for the Docusaurus-served docs site (saas-technical-doc.md K-9b).\n *\n * Public surface (consumed by the three Docusaurus swizzles per K-11):\n *\n * - `<DocsAuthProvider apiBaseUrl=\"…\">` — Root swizzle wraps children.\n * - `useDocsAuthSession()` — Navbar + DocItem swizzles read.\n * - `<AuthExchangePage />` — mounted at `/auth/exchange`.\n * - `DocsAuthClient` — direct access for the DocItem\n * swizzle's \"request handoff back\n * to app\" code path.\n * - `DocsAuthClientError` + code type — typed error branch surface.\n * - `DocsRole` / `DocsAuthSession` — discriminated-union types.\n * - `useDocsFrontendProviderRegistry()` — read the materialized frontend\n * provider registry for this docs\n * service (search / future SDK\n * widgets).\n * - `decodeJwtClaims` — exposed so apps can decode\n * access tokens issued by\n * non-handoff flows (rare;\n * reserved for advanced use).\n *\n * @wildo-boundary\n * - This sub-tree MAY use React, `react-dom`, the browser `fetch`, and\n * the browser `atob` global. It MUST NOT import:\n * - Node built-ins (`fs`, `path`, …) — would break Docusaurus\n * client bundle.\n * - `@wildo-ai/saas-frontend-lib` — entire point of K-9b\n * is to NOT pull this.\n * - inversify — reserved for the SaaS\n * app DI stack.\n * - This sub-tree MAY import shared schemas + DTO types from\n * `@wildo-ai/saas-models/public-runtime` (the lightweight subset\n * allow-listed by `runtime-bundle-isolation.test.ts`).\n * - This sub-tree MUST initialize `@wildo-ai/zod-decorators` at runtime\n * entry — see the `ensureZodDecoratorsLoaded(z)` side-effect below.\n * Skipping this leaves the docs runtime with an under-augmented Zod\n * `ZodObject` declaration, which historically caused cross-package\n * `z.infer` widening (the H-3 / M-7 cross-frontend-handoff incident,\n * see `.cursor/plans/cross-app-jwt-propagation.md`).\n * - The package's `./companion` and `./` (root) entries MUST NOT import\n * from this sub-tree (see those files' boundary blocks).\n */\n\n/**\n * Boot the project's Zod decorator augmentation for this bundle.\n *\n * `@wildo-ai/saas-models/public-runtime` re-exports schemas authored\n * against the augmented `ZodObject` interface declared by\n * `@wildo-ai/zod-decorators`. Without `ensureZodDecoratorsLoaded(z)`\n * being called once on this bundle's Zod instance, the docs runtime sees\n * a schema graph whose `.shape` access paths and `z.infer` results don't\n * match what the SaaS app sees — a silent contract drift that bit us in\n * H-3 / M-7. The call is idempotent (guarded inside the function) so\n * importing this module multiple times is a no-op after the first load.\n *\n * The bare-specifier import is allow-listed by\n * `runtime-bundle-isolation.test.ts` (revised 2026-04-19); the package\n * itself is browser-safe (it only mutates `z.ZodType.prototype`).\n */\nimport { z } from 'zod';\nimport { ensureZodDecoratorsLoaded } from '@wildo-ai/zod-decorators';\n\nensureZodDecoratorsLoaded(z);\n\nexport * from './docs-auth-session.schemas';\nexport * from './decode-jwt-claims';\nexport * from './docs-auth-client';\nexport * from './DocsAuthContext';\nexport * from './frontend-provider-registry.techdoc';\nexport {\n FrontendProviderEntrySchema,\n FrontendProvidersBlockSchema,\n type FrontendProviderEntry,\n type FrontendProvidersBlock,\n} from '@wildo-ai/saas-models/public-runtime';\nexport * from './use-docs-auth-session';\nexport * from './use-docs-frontend-provider-registry';\nexport * from './AuthExchangePage';\nexport * from './openapi-reference-model';\nexport * from './openapi-reference-conservation';\nexport * from './openapi-reference-view';\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exact conservation boundary between one generated OpenAPI section and the
|
|
3
|
+
* ephemeral model consumed by the native Docusaurus renderer.
|
|
4
|
+
*
|
|
5
|
+
* The renderer is allowed to reshape navigation, never to change inventory.
|
|
6
|
+
* This module therefore compares identities from the original document with
|
|
7
|
+
* identities in the projected model instead of trusting diagnostic counts or
|
|
8
|
+
* reconstructing a second navigation document.
|
|
9
|
+
*/
|
|
10
|
+
import type { OpenApiSectionOutput } from '../openapi/openapi-generation-output.schemas';
|
|
11
|
+
import { type ApiReferenceModel } from './openapi-reference-model';
|
|
12
|
+
/**
|
|
13
|
+
* Verifies a supplied projection. Exported separately so negative tests and CI
|
|
14
|
+
* tools can prove the guard catches a future mapper that drops or duplicates a
|
|
15
|
+
* panel, rather than only exercising today's mapper implementation.
|
|
16
|
+
*/
|
|
17
|
+
export declare function assertApiReferenceModelConservation(section: OpenApiSectionOutput, model: ApiReferenceModel): void;
|
|
18
|
+
/** Builds the native renderer model and refuses any source-to-view loss. */
|
|
19
|
+
export declare function createConservedApiReferenceModel(section: OpenApiSectionOutput): ApiReferenceModel;
|
|
20
|
+
//# sourceMappingURL=openapi-reference-conservation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi-reference-conservation.d.ts","sourceRoot":"","sources":["../../../../src/runtime/openapi-reference-conservation.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAA2B,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAwE5F;;;;GAIG;AACH,wBAAgB,mCAAmC,CAAC,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAiBjH;AAED,4EAA4E;AAC5E,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,oBAAoB,GAAG,iBAAiB,CAIjG"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exact conservation boundary between one generated OpenAPI section and the
|
|
3
|
+
* ephemeral model consumed by the native Docusaurus renderer.
|
|
4
|
+
*
|
|
5
|
+
* The renderer is allowed to reshape navigation, never to change inventory.
|
|
6
|
+
* This module therefore compares identities from the original document with
|
|
7
|
+
* identities in the projected model instead of trusting diagnostic counts or
|
|
8
|
+
* reconstructing a second navigation document.
|
|
9
|
+
*/
|
|
10
|
+
import { createApiReferenceModel } from './openapi-reference-model.js';
|
|
11
|
+
const OPENAPI_HTTP_METHODS = new Set([
|
|
12
|
+
'get',
|
|
13
|
+
'put',
|
|
14
|
+
'post',
|
|
15
|
+
'delete',
|
|
16
|
+
'options',
|
|
17
|
+
'head',
|
|
18
|
+
'patch',
|
|
19
|
+
'trace',
|
|
20
|
+
]);
|
|
21
|
+
function isRecord(value) {
|
|
22
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
23
|
+
}
|
|
24
|
+
function sorted(values) {
|
|
25
|
+
return [...values].sort((left, right) => left.localeCompare(right));
|
|
26
|
+
}
|
|
27
|
+
function assertExactInventory(label, expected, actual) {
|
|
28
|
+
const expectedSorted = sorted(expected);
|
|
29
|
+
const actualSorted = sorted(actual);
|
|
30
|
+
if (new Set(expectedSorted).size !== expectedSorted.length) {
|
|
31
|
+
throw new Error(`API-reference renderer conservation: source ${label} contains duplicate identities`);
|
|
32
|
+
}
|
|
33
|
+
if (new Set(actualSorted).size !== actualSorted.length) {
|
|
34
|
+
throw new Error(`API-reference renderer conservation: rendered ${label} contains duplicate identities`);
|
|
35
|
+
}
|
|
36
|
+
if (expectedSorted.length !== actualSorted.length
|
|
37
|
+
|| expectedSorted.some((identity, index) => actualSorted[index] !== identity)) {
|
|
38
|
+
throw new Error(`API-reference renderer conservation: source and rendered ${label} inventories disagree`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function sourceOperationVariantRefs(document) {
|
|
42
|
+
if (!isRecord(document) || !isRecord(document.paths)) {
|
|
43
|
+
throw new Error('API-reference renderer conservation: document has no OpenAPI paths object');
|
|
44
|
+
}
|
|
45
|
+
const refs = [];
|
|
46
|
+
for (const [path, pathItem] of Object.entries(document.paths)) {
|
|
47
|
+
if (!isRecord(pathItem))
|
|
48
|
+
throw new Error(`API-reference renderer conservation: path item '${path}' is malformed`);
|
|
49
|
+
for (const [method, operation] of Object.entries(pathItem)) {
|
|
50
|
+
if (!OPENAPI_HTTP_METHODS.has(method))
|
|
51
|
+
continue;
|
|
52
|
+
if (!isRecord(operation) || !isRecord(operation['x-wildo']) || typeof operation['x-wildo'].operationVariantRef !== 'string') {
|
|
53
|
+
throw new Error(`API-reference renderer conservation: ${method.toUpperCase()} ${path} has no exact operation-variant identity`);
|
|
54
|
+
}
|
|
55
|
+
refs.push(operation['x-wildo'].operationVariantRef);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return refs;
|
|
59
|
+
}
|
|
60
|
+
function sourceResourceRefs(document) {
|
|
61
|
+
if (!isRecord(document) || !Array.isArray(document.tags)) {
|
|
62
|
+
throw new Error('API-reference renderer conservation: document has no OpenAPI resource tags');
|
|
63
|
+
}
|
|
64
|
+
return document.tags.map((tag, index) => {
|
|
65
|
+
if (!isRecord(tag) || !isRecord(tag['x-wildo']) || typeof tag['x-wildo'].resourceRef !== 'string') {
|
|
66
|
+
throw new Error(`API-reference renderer conservation: resource tag at index ${index} has no exact identity`);
|
|
67
|
+
}
|
|
68
|
+
return tag['x-wildo'].resourceRef;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function renderedOperationVariantRefs(model) {
|
|
72
|
+
return model.resources.flatMap((resource) => resource.families.flatMap((family) => family.variants.map((variant) => variant.variantRef)));
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Verifies a supplied projection. Exported separately so negative tests and CI
|
|
76
|
+
* tools can prove the guard catches a future mapper that drops or duplicates a
|
|
77
|
+
* panel, rather than only exercising today's mapper implementation.
|
|
78
|
+
*/
|
|
79
|
+
export function assertApiReferenceModelConservation(section, model) {
|
|
80
|
+
const sourceVariants = sourceOperationVariantRefs(section.document);
|
|
81
|
+
const sourceResources = sourceResourceRefs(section.document);
|
|
82
|
+
const renderedVariants = renderedOperationVariantRefs(model);
|
|
83
|
+
const renderedResources = model.resources.map((resource) => resource.resourceRef);
|
|
84
|
+
if (section.operationCount !== sourceVariants.length) {
|
|
85
|
+
throw new Error('API-reference renderer conservation: section operationCount disagrees with its OpenAPI document');
|
|
86
|
+
}
|
|
87
|
+
if (section.resourceCount !== sourceResources.length) {
|
|
88
|
+
throw new Error('API-reference renderer conservation: section resourceCount disagrees with its OpenAPI document');
|
|
89
|
+
}
|
|
90
|
+
if (model.operationCount !== renderedVariants.length) {
|
|
91
|
+
throw new Error('API-reference renderer conservation: model operationCount disagrees with its rendered variants');
|
|
92
|
+
}
|
|
93
|
+
assertExactInventory('operation variants', sourceVariants, renderedVariants);
|
|
94
|
+
assertExactInventory('resource tags', sourceResources, renderedResources);
|
|
95
|
+
}
|
|
96
|
+
/** Builds the native renderer model and refuses any source-to-view loss. */
|
|
97
|
+
export function createConservedApiReferenceModel(section) {
|
|
98
|
+
const model = createApiReferenceModel(section.document);
|
|
99
|
+
assertApiReferenceModelConservation(section, model);
|
|
100
|
+
return model;
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=openapi-reference-conservation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi-reference-conservation.js","sourceRoot":"","sources":["../../../../src/runtime/openapi-reference-conservation.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * Exact conservation boundary between one generated OpenAPI section and the\n * ephemeral model consumed by the native Docusaurus renderer.\n *\n * The renderer is allowed to reshape navigation, never to change inventory.\n * This module therefore compares identities from the original document with\n * identities in the projected model instead of trusting diagnostic counts or\n * reconstructing a second navigation document.\n */\n\nimport type { OpenApiSectionOutput } from '../openapi/openapi-generation-output.schemas';\nimport { createApiReferenceModel, type ApiReferenceModel } from './openapi-reference-model';\n\ntype UnknownRecord = Record<string, unknown>;\n\nconst OPENAPI_HTTP_METHODS: ReadonlySet<string> = new Set([\n 'get',\n 'put',\n 'post',\n 'delete',\n 'options',\n 'head',\n 'patch',\n 'trace',\n]);\n\nfunction isRecord(value: unknown): value is UnknownRecord {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction sorted(values: readonly string[]): readonly string[] {\n return [...values].sort((left, right) => left.localeCompare(right));\n}\n\nfunction assertExactInventory(label: string, expected: readonly string[], actual: readonly string[]): void {\n const expectedSorted = sorted(expected);\n const actualSorted = sorted(actual);\n if (new Set(expectedSorted).size !== expectedSorted.length) {\n throw new Error(`API-reference renderer conservation: source ${label} contains duplicate identities`);\n }\n if (new Set(actualSorted).size !== actualSorted.length) {\n throw new Error(`API-reference renderer conservation: rendered ${label} contains duplicate identities`);\n }\n if (expectedSorted.length !== actualSorted.length\n || expectedSorted.some((identity, index) => actualSorted[index] !== identity)) {\n throw new Error(`API-reference renderer conservation: source and rendered ${label} inventories disagree`);\n }\n}\n\nfunction sourceOperationVariantRefs(document: unknown): readonly string[] {\n if (!isRecord(document) || !isRecord(document.paths)) {\n throw new Error('API-reference renderer conservation: document has no OpenAPI paths object');\n }\n const refs: string[] = [];\n for (const [path, pathItem] of Object.entries(document.paths)) {\n if (!isRecord(pathItem)) throw new Error(`API-reference renderer conservation: path item '${path}' is malformed`);\n for (const [method, operation] of Object.entries(pathItem)) {\n if (!OPENAPI_HTTP_METHODS.has(method)) continue;\n if (!isRecord(operation) || !isRecord(operation['x-wildo']) || typeof operation['x-wildo'].operationVariantRef !== 'string') {\n throw new Error(`API-reference renderer conservation: ${method.toUpperCase()} ${path} has no exact operation-variant identity`);\n }\n refs.push(operation['x-wildo'].operationVariantRef);\n }\n }\n return refs;\n}\n\nfunction sourceResourceRefs(document: unknown): readonly string[] {\n if (!isRecord(document) || !Array.isArray(document.tags)) {\n throw new Error('API-reference renderer conservation: document has no OpenAPI resource tags');\n }\n return document.tags.map((tag, index) => {\n if (!isRecord(tag) || !isRecord(tag['x-wildo']) || typeof tag['x-wildo'].resourceRef !== 'string') {\n throw new Error(`API-reference renderer conservation: resource tag at index ${index} has no exact identity`);\n }\n return tag['x-wildo'].resourceRef;\n });\n}\n\nfunction renderedOperationVariantRefs(model: ApiReferenceModel): readonly string[] {\n return model.resources.flatMap((resource) => resource.families.flatMap((family) => family.variants.map((variant) => variant.variantRef)));\n}\n\n/**\n * Verifies a supplied projection. Exported separately so negative tests and CI\n * tools can prove the guard catches a future mapper that drops or duplicates a\n * panel, rather than only exercising today's mapper implementation.\n */\nexport function assertApiReferenceModelConservation(section: OpenApiSectionOutput, model: ApiReferenceModel): void {\n const sourceVariants = sourceOperationVariantRefs(section.document);\n const sourceResources = sourceResourceRefs(section.document);\n const renderedVariants = renderedOperationVariantRefs(model);\n const renderedResources = model.resources.map((resource) => resource.resourceRef);\n\n if (section.operationCount !== sourceVariants.length) {\n throw new Error('API-reference renderer conservation: section operationCount disagrees with its OpenAPI document');\n }\n if (section.resourceCount !== sourceResources.length) {\n throw new Error('API-reference renderer conservation: section resourceCount disagrees with its OpenAPI document');\n }\n if (model.operationCount !== renderedVariants.length) {\n throw new Error('API-reference renderer conservation: model operationCount disagrees with its rendered variants');\n }\n assertExactInventory('operation variants', sourceVariants, renderedVariants);\n assertExactInventory('resource tags', sourceResources, renderedResources);\n}\n\n/** Builds the native renderer model and refuses any source-to-view loss. */\nexport function createConservedApiReferenceModel(section: OpenApiSectionOutput): ApiReferenceModel {\n const model = createApiReferenceModel(section.document);\n assertApiReferenceModelConservation(section, model);\n return model;\n}\n"]}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-safe projection of one generated OpenAPI document.
|
|
3
|
+
*
|
|
4
|
+
* Navigation is derived in memory from the verified OpenAPI bytes. The model
|
|
5
|
+
* deliberately persists nothing and never invents API meaning: resource tags,
|
|
6
|
+
* `operationId`, standard OpenAPI method/path fields and `x-wildo` source
|
|
7
|
+
* identity are its only inputs.
|
|
8
|
+
*/
|
|
9
|
+
export interface ApiReferenceVariant {
|
|
10
|
+
readonly variantRef: string;
|
|
11
|
+
readonly anchorId: string;
|
|
12
|
+
readonly operationId: string;
|
|
13
|
+
readonly summary: string;
|
|
14
|
+
readonly description: string | null;
|
|
15
|
+
readonly method: string;
|
|
16
|
+
readonly path: string;
|
|
17
|
+
/** Source-projected authentication and authorization explanation. */
|
|
18
|
+
readonly access: ApiReferenceAccess;
|
|
19
|
+
readonly securitySchemes: readonly string[];
|
|
20
|
+
readonly parameters: readonly ApiReferenceParameter[];
|
|
21
|
+
readonly requestBody: ApiReferenceRequestBody | null;
|
|
22
|
+
readonly responses: readonly ApiReferenceResponse[];
|
|
23
|
+
readonly idempotent: boolean | null;
|
|
24
|
+
}
|
|
25
|
+
/** A standard OpenAPI parameter, normalized for a documentation renderer. */
|
|
26
|
+
export interface ApiReferenceParameter {
|
|
27
|
+
readonly name: string;
|
|
28
|
+
readonly location: string;
|
|
29
|
+
readonly required: boolean;
|
|
30
|
+
readonly description: string | null;
|
|
31
|
+
/** The exact OpenAPI Schema Object attached to this parameter. */
|
|
32
|
+
readonly schema: ApiReferenceSchemaNode | null;
|
|
33
|
+
/** Source-authored OpenAPI examples for this exact path/query/header parameter. */
|
|
34
|
+
readonly examples: readonly ApiReferenceExample[];
|
|
35
|
+
}
|
|
36
|
+
/** The available request representations for an operation. */
|
|
37
|
+
export interface ApiReferenceRequestBody {
|
|
38
|
+
/** Stable public target for this exact operation's request contract. */
|
|
39
|
+
readonly anchorId: string;
|
|
40
|
+
readonly required: boolean;
|
|
41
|
+
readonly mediaTypes: readonly ApiReferenceMediaType[];
|
|
42
|
+
}
|
|
43
|
+
/** A request or response representation declared by the OpenAPI contract. */
|
|
44
|
+
export interface ApiReferenceMediaType {
|
|
45
|
+
readonly mediaType: string;
|
|
46
|
+
/** The exact OpenAPI Schema Object attached to this representation. */
|
|
47
|
+
readonly schema: ApiReferenceSchemaNode | null;
|
|
48
|
+
/** OpenAPI examples, kept as contract data rather than renderer-authored samples. */
|
|
49
|
+
readonly examples: readonly ApiReferenceExample[];
|
|
50
|
+
}
|
|
51
|
+
/** One request or response example declared directly in the OpenAPI document. */
|
|
52
|
+
export interface ApiReferenceExample {
|
|
53
|
+
readonly name: string;
|
|
54
|
+
readonly summary: string | null;
|
|
55
|
+
readonly description: string | null;
|
|
56
|
+
/** Pretty-printed inline JSON when the OpenAPI example provides a serializable `value`. */
|
|
57
|
+
readonly jsonValue: string | null;
|
|
58
|
+
/** OpenAPI's alternative external example location, when supplied. */
|
|
59
|
+
readonly externalValue: string | null;
|
|
60
|
+
}
|
|
61
|
+
/** The browser-safe view of the generated `x-wildo.access` contract. */
|
|
62
|
+
export interface ApiReferenceAccess {
|
|
63
|
+
readonly authenticationMode: string;
|
|
64
|
+
readonly authenticationSummary: string;
|
|
65
|
+
readonly roleRequirements: readonly ApiReferenceRoleRequirement[];
|
|
66
|
+
}
|
|
67
|
+
/** One exact runtime role paired with the specification-owned explanation. */
|
|
68
|
+
export interface ApiReferenceRoleRequirement {
|
|
69
|
+
readonly role: string;
|
|
70
|
+
readonly label: string;
|
|
71
|
+
readonly businessRole: string | null;
|
|
72
|
+
readonly authorityBoundary: string | null;
|
|
73
|
+
}
|
|
74
|
+
/** One documented HTTP response. */
|
|
75
|
+
export interface ApiReferenceResponse {
|
|
76
|
+
/** Stable public target for this exact operation/status response contract. */
|
|
77
|
+
readonly anchorId: string;
|
|
78
|
+
readonly status: string;
|
|
79
|
+
readonly description: string | null;
|
|
80
|
+
readonly mediaTypes: readonly ApiReferenceMediaType[];
|
|
81
|
+
}
|
|
82
|
+
export interface ApiReferenceFamily {
|
|
83
|
+
readonly familyRef: string;
|
|
84
|
+
readonly anchorId: string;
|
|
85
|
+
readonly label: string;
|
|
86
|
+
readonly variants: readonly ApiReferenceVariant[];
|
|
87
|
+
}
|
|
88
|
+
export interface ApiReferenceResource {
|
|
89
|
+
readonly resourceRef: string;
|
|
90
|
+
readonly anchorId: string;
|
|
91
|
+
readonly label: string;
|
|
92
|
+
/** Source-owned category transported through the OpenAPI resource tag. */
|
|
93
|
+
readonly category: ApiReferenceResourceCategory | null;
|
|
94
|
+
readonly description: string | null;
|
|
95
|
+
readonly lifecycleRole: string | null;
|
|
96
|
+
readonly relationships: readonly ApiReferenceResourceRelationship[];
|
|
97
|
+
readonly families: readonly ApiReferenceFamily[];
|
|
98
|
+
}
|
|
99
|
+
/** A source-declared API-resource category, never inferred from resource names. */
|
|
100
|
+
export interface ApiReferenceResourceCategory {
|
|
101
|
+
readonly id: string;
|
|
102
|
+
/** Readable category fragment derived from the public target utility. */
|
|
103
|
+
readonly anchorId: string;
|
|
104
|
+
readonly label: string;
|
|
105
|
+
readonly description: string | null;
|
|
106
|
+
}
|
|
107
|
+
/** One reusable `components.schemas` contract from the same OpenAPI document. */
|
|
108
|
+
export interface ApiReferenceComponentSchema {
|
|
109
|
+
readonly name: string;
|
|
110
|
+
readonly anchorId: string;
|
|
111
|
+
readonly schema: ApiReferenceSchemaNode;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* A browser-safe, recursive projection of one OpenAPI 3.1 Schema Object.
|
|
115
|
+
*
|
|
116
|
+
* `$ref` nodes deliberately remain links instead of being resolved. This both
|
|
117
|
+
* preserves the document's canonical component boundary and makes recursive
|
|
118
|
+
* schemas cycle-safe without imposing a renderer-authored traversal limit.
|
|
119
|
+
*/
|
|
120
|
+
export interface ApiReferenceSchemaNode {
|
|
121
|
+
/** A JSON Schema boolean schema; `null` means this node is an object schema. */
|
|
122
|
+
readonly booleanSchema: boolean | null;
|
|
123
|
+
readonly referenceName: string | null;
|
|
124
|
+
readonly referenceAnchorId: string | null;
|
|
125
|
+
readonly types: readonly string[];
|
|
126
|
+
readonly description: string | null;
|
|
127
|
+
readonly format: string | null;
|
|
128
|
+
readonly properties: readonly ApiReferenceSchemaProperty[];
|
|
129
|
+
readonly items: ApiReferenceSchemaNode | null;
|
|
130
|
+
readonly compositions: readonly ApiReferenceSchemaComposition[];
|
|
131
|
+
readonly enumValues: readonly ApiReferenceSchemaEnumValue[];
|
|
132
|
+
readonly constValue: string | null;
|
|
133
|
+
readonly defaultValue: string | null;
|
|
134
|
+
readonly constraints: readonly ApiReferenceSchemaConstraint[];
|
|
135
|
+
/** `null` means the keyword is absent; a schema-valued keyword remains recursive. */
|
|
136
|
+
readonly additionalProperties: boolean | ApiReferenceSchemaNode | null;
|
|
137
|
+
}
|
|
138
|
+
/** One named child of an OpenAPI object schema. */
|
|
139
|
+
export interface ApiReferenceSchemaProperty {
|
|
140
|
+
readonly name: string;
|
|
141
|
+
readonly required: boolean;
|
|
142
|
+
readonly schema: ApiReferenceSchemaNode;
|
|
143
|
+
}
|
|
144
|
+
/** OpenAPI composition keywords are distinct contracts, not interchangeable labels. */
|
|
145
|
+
export declare enum ApiReferenceSchemaCompositionKind {
|
|
146
|
+
ONE_OF = "oneOf",
|
|
147
|
+
ANY_OF = "anyOf",
|
|
148
|
+
ALL_OF = "allOf"
|
|
149
|
+
}
|
|
150
|
+
export interface ApiReferenceSchemaComposition {
|
|
151
|
+
readonly kind: ApiReferenceSchemaCompositionKind;
|
|
152
|
+
readonly branches: readonly ApiReferenceSchemaNode[];
|
|
153
|
+
}
|
|
154
|
+
/** One JSON value admitted by an OpenAPI enum and its optional source description. */
|
|
155
|
+
export interface ApiReferenceSchemaEnumValue {
|
|
156
|
+
readonly jsonValue: string;
|
|
157
|
+
readonly description: string | null;
|
|
158
|
+
}
|
|
159
|
+
/** Standard Schema Object constraint keywords preserved without interpretation. */
|
|
160
|
+
export declare enum ApiReferenceSchemaConstraintKind {
|
|
161
|
+
MINIMUM = "minimum",
|
|
162
|
+
MAXIMUM = "maximum",
|
|
163
|
+
EXCLUSIVE_MINIMUM = "exclusiveMinimum",
|
|
164
|
+
EXCLUSIVE_MAXIMUM = "exclusiveMaximum",
|
|
165
|
+
MULTIPLE_OF = "multipleOf",
|
|
166
|
+
MIN_LENGTH = "minLength",
|
|
167
|
+
MAX_LENGTH = "maxLength",
|
|
168
|
+
PATTERN = "pattern",
|
|
169
|
+
MIN_ITEMS = "minItems",
|
|
170
|
+
MAX_ITEMS = "maxItems",
|
|
171
|
+
UNIQUE_ITEMS = "uniqueItems",
|
|
172
|
+
MIN_PROPERTIES = "minProperties",
|
|
173
|
+
MAX_PROPERTIES = "maxProperties"
|
|
174
|
+
}
|
|
175
|
+
export interface ApiReferenceSchemaConstraint {
|
|
176
|
+
readonly kind: ApiReferenceSchemaConstraintKind;
|
|
177
|
+
readonly jsonValue: string;
|
|
178
|
+
}
|
|
179
|
+
/** A compiled resource-relationship fact projected through the OpenAPI tag. */
|
|
180
|
+
export interface ApiReferenceResourceRelationship {
|
|
181
|
+
readonly relatedResourceName: string;
|
|
182
|
+
readonly relatedResourceLabel: string;
|
|
183
|
+
readonly foreignKeyField: string | null;
|
|
184
|
+
readonly resourceCardinality: string;
|
|
185
|
+
readonly relatedResourceCardinality: string;
|
|
186
|
+
readonly nature: string;
|
|
187
|
+
readonly lifecycleModel: string;
|
|
188
|
+
readonly onParentDelete: {
|
|
189
|
+
readonly enabled: boolean;
|
|
190
|
+
readonly mode: string;
|
|
191
|
+
readonly strategy: string;
|
|
192
|
+
readonly maxDepth: number;
|
|
193
|
+
} | null;
|
|
194
|
+
}
|
|
195
|
+
export interface ApiReferenceModel {
|
|
196
|
+
/** Standard OpenAPI document title, when authored by the generator. */
|
|
197
|
+
readonly title: string | null;
|
|
198
|
+
/** Standard CommonMark description; presentation never authors substitute prose. */
|
|
199
|
+
readonly description: string | null;
|
|
200
|
+
/** Exact OpenAPI server choices used to compose an operation URL. */
|
|
201
|
+
readonly servers: readonly ApiReferenceServer[];
|
|
202
|
+
/** Exact reusable authentication mechanisms declared by OpenAPI. */
|
|
203
|
+
readonly securitySchemes: readonly ApiReferenceSecurityScheme[];
|
|
204
|
+
readonly resources: readonly ApiReferenceResource[];
|
|
205
|
+
readonly componentSchemas: readonly ApiReferenceComponentSchema[];
|
|
206
|
+
readonly operationCount: number;
|
|
207
|
+
}
|
|
208
|
+
export interface ApiReferenceServer {
|
|
209
|
+
readonly url: string;
|
|
210
|
+
readonly description: string | null;
|
|
211
|
+
}
|
|
212
|
+
/** Browser-safe projection of an OpenAPI Security Scheme Object. */
|
|
213
|
+
export interface ApiReferenceSecurityScheme {
|
|
214
|
+
readonly name: string;
|
|
215
|
+
readonly type: string;
|
|
216
|
+
readonly scheme: string | null;
|
|
217
|
+
readonly bearerFormat: string | null;
|
|
218
|
+
readonly location: string | null;
|
|
219
|
+
readonly parameterName: string | null;
|
|
220
|
+
readonly description: string | null;
|
|
221
|
+
}
|
|
222
|
+
/** Creates the two-level resource → operation-family view from OpenAPI. */
|
|
223
|
+
export declare function createApiReferenceModel(document: unknown): ApiReferenceModel;
|
|
224
|
+
//# sourceMappingURL=openapi-reference-model.d.ts.map
|