@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,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public API-reference targets and fragments.
|
|
3
|
+
*
|
|
4
|
+
* Source documentation refers to semantic API identities; the generated
|
|
5
|
+
* reference resolves those identities into these readable public fragments.
|
|
6
|
+
* Do not use OpenAPI array positions, encoded internal refs, or a hand-built
|
|
7
|
+
* URL as a cross-document target: each of those changes for reasons unrelated
|
|
8
|
+
* to the consumer contract.
|
|
9
|
+
*/
|
|
10
|
+
/** Stable portal roots owned by the application-consumer documentation product. */
|
|
11
|
+
export declare enum ApplicationConsumerDocumentationRoute {
|
|
12
|
+
GET_STARTED = "GET_STARTED",
|
|
13
|
+
ACCESS_AND_IDENTITY = "ACCESS_AND_IDENTITY",
|
|
14
|
+
USER_ADMINISTRATION = "USER_ADMINISTRATION",
|
|
15
|
+
INTEGRATIONS = "INTEGRATIONS",
|
|
16
|
+
API_REFERENCE = "API_REFERENCE",
|
|
17
|
+
APPLICATION_ADMINISTRATION_API_REFERENCE = "APPLICATION_ADMINISTRATION_API_REFERENCE"
|
|
18
|
+
}
|
|
19
|
+
/** The public contract part a documentation link can target inside an API reference. */
|
|
20
|
+
export declare enum ApiReferenceTargetKind {
|
|
21
|
+
CATEGORY = "CATEGORY",
|
|
22
|
+
RESOURCE = "RESOURCE",
|
|
23
|
+
OPERATION_FAMILY = "OPERATION_FAMILY",
|
|
24
|
+
OPERATION = "OPERATION",
|
|
25
|
+
REQUEST = "REQUEST",
|
|
26
|
+
RESPONSE = "RESPONSE",
|
|
27
|
+
COMPONENT_SCHEMA = "COMPONENT_SCHEMA"
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Readable identity material used only to construct a public fragment.
|
|
31
|
+
*
|
|
32
|
+
* A later generated link index maps canonical `x-wildo` identities to this
|
|
33
|
+
* shape. Keeping the public shape separate stops an internal namespaced ref
|
|
34
|
+
* from leaking into copied URLs while retaining an exact resolver boundary.
|
|
35
|
+
*/
|
|
36
|
+
export type ApiReferencePublicTarget = {
|
|
37
|
+
readonly kind: ApiReferenceTargetKind.CATEGORY;
|
|
38
|
+
readonly categoryName: string;
|
|
39
|
+
} | {
|
|
40
|
+
readonly kind: ApiReferenceTargetKind.RESOURCE;
|
|
41
|
+
readonly resourceName: string;
|
|
42
|
+
} | {
|
|
43
|
+
readonly kind: ApiReferenceTargetKind.OPERATION_FAMILY;
|
|
44
|
+
readonly resourceName: string;
|
|
45
|
+
readonly operationName: string;
|
|
46
|
+
} | {
|
|
47
|
+
readonly kind: ApiReferenceTargetKind.OPERATION;
|
|
48
|
+
readonly operationId: string;
|
|
49
|
+
} | {
|
|
50
|
+
readonly kind: ApiReferenceTargetKind.REQUEST;
|
|
51
|
+
readonly operationId: string;
|
|
52
|
+
} | {
|
|
53
|
+
readonly kind: ApiReferenceTargetKind.RESPONSE;
|
|
54
|
+
readonly operationId: string;
|
|
55
|
+
readonly status: string;
|
|
56
|
+
} | {
|
|
57
|
+
readonly kind: ApiReferenceTargetKind.COMPONENT_SCHEMA;
|
|
58
|
+
readonly schemaName: string;
|
|
59
|
+
};
|
|
60
|
+
/** Resolves a stable, human-readable route path for a built-in portal root. */
|
|
61
|
+
export declare function applicationConsumerDocumentationRoutePath(route: ApplicationConsumerDocumentationRoute): string;
|
|
62
|
+
/**
|
|
63
|
+
* Resolves a relative documentation URL suitable for prefixing with an
|
|
64
|
+
* application-owned docs base URL. API contract targets are deliberately
|
|
65
|
+
* confined to an API-reference root: a guide cannot silently become a second
|
|
66
|
+
* endpoint-reference renderer merely by carrying an API fragment.
|
|
67
|
+
*/
|
|
68
|
+
export declare function applicationConsumerDocumentationTargetPath(route: ApplicationConsumerDocumentationRoute, target?: ApiReferencePublicTarget): string;
|
|
69
|
+
/** Produces a readable fragment for one API-reference contract target. */
|
|
70
|
+
export declare function apiReferenceTargetFragment(target: ApiReferencePublicTarget): string;
|
|
71
|
+
//# sourceMappingURL=api-reference-targets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-reference-targets.d.ts","sourceRoot":"","sources":["../../../../src/openapi/api-reference-targets.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,mFAAmF;AACnF,oBAAY,qCAAqC;IAC/C,WAAW,gBAAgB;IAC3B,mBAAmB,wBAAwB;IAC3C,mBAAmB,wBAAwB;IAC3C,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,wCAAwC,6CAA6C;CACtF;AAED,wFAAwF;AACxF,oBAAY,sBAAsB;IAChC,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,gBAAgB,qBAAqB;IACrC,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,gBAAgB,qBAAqB;CACtC;AAED;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB,GAChC;IAAE,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC,QAAQ,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GACjF;IAAE,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC,QAAQ,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GACjF;IAAE,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC,gBAAgB,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GACzH;IAAE,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC,SAAS,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACjF;IAAE,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC,OAAO,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAC/E;IAAE,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC,QAAQ,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACzG;IAAE,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC,gBAAgB,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5F,+EAA+E;AAC/E,wBAAgB,yCAAyC,CAAC,KAAK,EAAE,qCAAqC,GAAG,MAAM,CAmB9G;AAED;;;;;GAKG;AACH,wBAAgB,0CAA0C,CACxD,KAAK,EAAE,qCAAqC,EAC5C,MAAM,CAAC,EAAE,wBAAwB,GAChC,MAAM,CAQR;AAED,0EAA0E;AAC1E,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,wBAAwB,GAAG,MAAM,CAqBnF"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public API-reference targets and fragments.
|
|
3
|
+
*
|
|
4
|
+
* Source documentation refers to semantic API identities; the generated
|
|
5
|
+
* reference resolves those identities into these readable public fragments.
|
|
6
|
+
* Do not use OpenAPI array positions, encoded internal refs, or a hand-built
|
|
7
|
+
* URL as a cross-document target: each of those changes for reasons unrelated
|
|
8
|
+
* to the consumer contract.
|
|
9
|
+
*/
|
|
10
|
+
/** Stable portal roots owned by the application-consumer documentation product. */
|
|
11
|
+
export var ApplicationConsumerDocumentationRoute;
|
|
12
|
+
(function (ApplicationConsumerDocumentationRoute) {
|
|
13
|
+
ApplicationConsumerDocumentationRoute["GET_STARTED"] = "GET_STARTED";
|
|
14
|
+
ApplicationConsumerDocumentationRoute["ACCESS_AND_IDENTITY"] = "ACCESS_AND_IDENTITY";
|
|
15
|
+
ApplicationConsumerDocumentationRoute["USER_ADMINISTRATION"] = "USER_ADMINISTRATION";
|
|
16
|
+
ApplicationConsumerDocumentationRoute["INTEGRATIONS"] = "INTEGRATIONS";
|
|
17
|
+
ApplicationConsumerDocumentationRoute["API_REFERENCE"] = "API_REFERENCE";
|
|
18
|
+
ApplicationConsumerDocumentationRoute["APPLICATION_ADMINISTRATION_API_REFERENCE"] = "APPLICATION_ADMINISTRATION_API_REFERENCE";
|
|
19
|
+
})(ApplicationConsumerDocumentationRoute || (ApplicationConsumerDocumentationRoute = {}));
|
|
20
|
+
/** The public contract part a documentation link can target inside an API reference. */
|
|
21
|
+
export var ApiReferenceTargetKind;
|
|
22
|
+
(function (ApiReferenceTargetKind) {
|
|
23
|
+
ApiReferenceTargetKind["CATEGORY"] = "CATEGORY";
|
|
24
|
+
ApiReferenceTargetKind["RESOURCE"] = "RESOURCE";
|
|
25
|
+
ApiReferenceTargetKind["OPERATION_FAMILY"] = "OPERATION_FAMILY";
|
|
26
|
+
ApiReferenceTargetKind["OPERATION"] = "OPERATION";
|
|
27
|
+
ApiReferenceTargetKind["REQUEST"] = "REQUEST";
|
|
28
|
+
ApiReferenceTargetKind["RESPONSE"] = "RESPONSE";
|
|
29
|
+
ApiReferenceTargetKind["COMPONENT_SCHEMA"] = "COMPONENT_SCHEMA";
|
|
30
|
+
})(ApiReferenceTargetKind || (ApiReferenceTargetKind = {}));
|
|
31
|
+
/** Resolves a stable, human-readable route path for a built-in portal root. */
|
|
32
|
+
export function applicationConsumerDocumentationRoutePath(route) {
|
|
33
|
+
switch (route) {
|
|
34
|
+
case ApplicationConsumerDocumentationRoute.GET_STARTED:
|
|
35
|
+
return '/get-started';
|
|
36
|
+
case ApplicationConsumerDocumentationRoute.ACCESS_AND_IDENTITY:
|
|
37
|
+
return '/access-and-identity';
|
|
38
|
+
case ApplicationConsumerDocumentationRoute.USER_ADMINISTRATION:
|
|
39
|
+
return '/user-administration';
|
|
40
|
+
case ApplicationConsumerDocumentationRoute.INTEGRATIONS:
|
|
41
|
+
return '/integrations';
|
|
42
|
+
case ApplicationConsumerDocumentationRoute.API_REFERENCE:
|
|
43
|
+
return '/api';
|
|
44
|
+
case ApplicationConsumerDocumentationRoute.APPLICATION_ADMINISTRATION_API_REFERENCE:
|
|
45
|
+
return '/api/application-administration';
|
|
46
|
+
default: {
|
|
47
|
+
const exhaustiveRoute = route;
|
|
48
|
+
throw new Error(`Unsupported application-consumer documentation route: ${String(exhaustiveRoute)}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Resolves a relative documentation URL suitable for prefixing with an
|
|
54
|
+
* application-owned docs base URL. API contract targets are deliberately
|
|
55
|
+
* confined to an API-reference root: a guide cannot silently become a second
|
|
56
|
+
* endpoint-reference renderer merely by carrying an API fragment.
|
|
57
|
+
*/
|
|
58
|
+
export function applicationConsumerDocumentationTargetPath(route, target) {
|
|
59
|
+
const routePath = applicationConsumerDocumentationRoutePath(route);
|
|
60
|
+
if (target === undefined)
|
|
61
|
+
return routePath;
|
|
62
|
+
if (route !== ApplicationConsumerDocumentationRoute.API_REFERENCE
|
|
63
|
+
&& route !== ApplicationConsumerDocumentationRoute.APPLICATION_ADMINISTRATION_API_REFERENCE) {
|
|
64
|
+
throw new Error(`Documentation route '${route}' cannot target an API-reference contract`);
|
|
65
|
+
}
|
|
66
|
+
return `${routePath}#${apiReferenceTargetFragment(target)}`;
|
|
67
|
+
}
|
|
68
|
+
/** Produces a readable fragment for one API-reference contract target. */
|
|
69
|
+
export function apiReferenceTargetFragment(target) {
|
|
70
|
+
switch (target.kind) {
|
|
71
|
+
case ApiReferenceTargetKind.CATEGORY:
|
|
72
|
+
return `category-${readableFragmentPart(target.categoryName)}`;
|
|
73
|
+
case ApiReferenceTargetKind.RESOURCE:
|
|
74
|
+
return `resource-${readableFragmentPart(target.resourceName)}`;
|
|
75
|
+
case ApiReferenceTargetKind.OPERATION_FAMILY:
|
|
76
|
+
return `resource-${readableFragmentPart(target.resourceName)}--operation-${readableFragmentPart(target.operationName)}`;
|
|
77
|
+
case ApiReferenceTargetKind.OPERATION:
|
|
78
|
+
return `operation-${readableFragmentPart(target.operationId)}`;
|
|
79
|
+
case ApiReferenceTargetKind.REQUEST:
|
|
80
|
+
return `operation-${readableFragmentPart(target.operationId)}--request`;
|
|
81
|
+
case ApiReferenceTargetKind.RESPONSE:
|
|
82
|
+
return `operation-${readableFragmentPart(target.operationId)}--response-${readableFragmentPart(target.status)}`;
|
|
83
|
+
case ApiReferenceTargetKind.COMPONENT_SCHEMA:
|
|
84
|
+
return `schema-${readableFragmentPart(target.schemaName)}`;
|
|
85
|
+
default: {
|
|
86
|
+
const exhaustiveTarget = target;
|
|
87
|
+
throw new Error(`Unsupported API-reference target: ${JSON.stringify(exhaustiveTarget)}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Converts a declared identifier to public URL vocabulary without silently
|
|
93
|
+
* accepting arbitrary punctuation. The generated model separately rejects
|
|
94
|
+
* collisions, so this readable form never needs an opaque digest suffix.
|
|
95
|
+
*/
|
|
96
|
+
function readableFragmentPart(value) {
|
|
97
|
+
let decoded;
|
|
98
|
+
try {
|
|
99
|
+
decoded = decodeURIComponent(value);
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
throw new Error(`API-reference public fragment cannot represent identifier '${value}'`);
|
|
103
|
+
}
|
|
104
|
+
const normalized = decoded
|
|
105
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1-$2')
|
|
106
|
+
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2')
|
|
107
|
+
.replace(/[:_\s]+/g, '-')
|
|
108
|
+
.toLowerCase();
|
|
109
|
+
if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(normalized)) {
|
|
110
|
+
throw new Error(`API-reference public fragment cannot represent identifier '${value}'`);
|
|
111
|
+
}
|
|
112
|
+
return normalized;
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=api-reference-targets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-reference-targets.js","sourceRoot":"","sources":["../../../../src/openapi/api-reference-targets.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * Public API-reference targets and fragments.\n *\n * Source documentation refers to semantic API identities; the generated\n * reference resolves those identities into these readable public fragments.\n * Do not use OpenAPI array positions, encoded internal refs, or a hand-built\n * URL as a cross-document target: each of those changes for reasons unrelated\n * to the consumer contract.\n */\n\n/** Stable portal roots owned by the application-consumer documentation product. */\nexport enum ApplicationConsumerDocumentationRoute {\n GET_STARTED = 'GET_STARTED',\n ACCESS_AND_IDENTITY = 'ACCESS_AND_IDENTITY',\n USER_ADMINISTRATION = 'USER_ADMINISTRATION',\n INTEGRATIONS = 'INTEGRATIONS',\n API_REFERENCE = 'API_REFERENCE',\n APPLICATION_ADMINISTRATION_API_REFERENCE = 'APPLICATION_ADMINISTRATION_API_REFERENCE',\n}\n\n/** The public contract part a documentation link can target inside an API reference. */\nexport enum ApiReferenceTargetKind {\n CATEGORY = 'CATEGORY',\n RESOURCE = 'RESOURCE',\n OPERATION_FAMILY = 'OPERATION_FAMILY',\n OPERATION = 'OPERATION',\n REQUEST = 'REQUEST',\n RESPONSE = 'RESPONSE',\n COMPONENT_SCHEMA = 'COMPONENT_SCHEMA',\n}\n\n/**\n * Readable identity material used only to construct a public fragment.\n *\n * A later generated link index maps canonical `x-wildo` identities to this\n * shape. Keeping the public shape separate stops an internal namespaced ref\n * from leaking into copied URLs while retaining an exact resolver boundary.\n */\nexport type ApiReferencePublicTarget =\n | { readonly kind: ApiReferenceTargetKind.CATEGORY; readonly categoryName: string }\n | { readonly kind: ApiReferenceTargetKind.RESOURCE; readonly resourceName: string }\n | { readonly kind: ApiReferenceTargetKind.OPERATION_FAMILY; readonly resourceName: string; readonly operationName: string }\n | { readonly kind: ApiReferenceTargetKind.OPERATION; readonly operationId: string }\n | { readonly kind: ApiReferenceTargetKind.REQUEST; readonly operationId: string }\n | { readonly kind: ApiReferenceTargetKind.RESPONSE; readonly operationId: string; readonly status: string }\n | { readonly kind: ApiReferenceTargetKind.COMPONENT_SCHEMA; readonly schemaName: string };\n\n/** Resolves a stable, human-readable route path for a built-in portal root. */\nexport function applicationConsumerDocumentationRoutePath(route: ApplicationConsumerDocumentationRoute): string {\n switch (route) {\n case ApplicationConsumerDocumentationRoute.GET_STARTED:\n return '/get-started';\n case ApplicationConsumerDocumentationRoute.ACCESS_AND_IDENTITY:\n return '/access-and-identity';\n case ApplicationConsumerDocumentationRoute.USER_ADMINISTRATION:\n return '/user-administration';\n case ApplicationConsumerDocumentationRoute.INTEGRATIONS:\n return '/integrations';\n case ApplicationConsumerDocumentationRoute.API_REFERENCE:\n return '/api';\n case ApplicationConsumerDocumentationRoute.APPLICATION_ADMINISTRATION_API_REFERENCE:\n return '/api/application-administration';\n default: {\n const exhaustiveRoute: never = route;\n throw new Error(`Unsupported application-consumer documentation route: ${String(exhaustiveRoute)}`);\n }\n }\n}\n\n/**\n * Resolves a relative documentation URL suitable for prefixing with an\n * application-owned docs base URL. API contract targets are deliberately\n * confined to an API-reference root: a guide cannot silently become a second\n * endpoint-reference renderer merely by carrying an API fragment.\n */\nexport function applicationConsumerDocumentationTargetPath(\n route: ApplicationConsumerDocumentationRoute,\n target?: ApiReferencePublicTarget,\n): string {\n const routePath = applicationConsumerDocumentationRoutePath(route);\n if (target === undefined) return routePath;\n if (route !== ApplicationConsumerDocumentationRoute.API_REFERENCE\n && route !== ApplicationConsumerDocumentationRoute.APPLICATION_ADMINISTRATION_API_REFERENCE) {\n throw new Error(`Documentation route '${route}' cannot target an API-reference contract`);\n }\n return `${routePath}#${apiReferenceTargetFragment(target)}`;\n}\n\n/** Produces a readable fragment for one API-reference contract target. */\nexport function apiReferenceTargetFragment(target: ApiReferencePublicTarget): string {\n switch (target.kind) {\n case ApiReferenceTargetKind.CATEGORY:\n return `category-${readableFragmentPart(target.categoryName)}`;\n case ApiReferenceTargetKind.RESOURCE:\n return `resource-${readableFragmentPart(target.resourceName)}`;\n case ApiReferenceTargetKind.OPERATION_FAMILY:\n return `resource-${readableFragmentPart(target.resourceName)}--operation-${readableFragmentPart(target.operationName)}`;\n case ApiReferenceTargetKind.OPERATION:\n return `operation-${readableFragmentPart(target.operationId)}`;\n case ApiReferenceTargetKind.REQUEST:\n return `operation-${readableFragmentPart(target.operationId)}--request`;\n case ApiReferenceTargetKind.RESPONSE:\n return `operation-${readableFragmentPart(target.operationId)}--response-${readableFragmentPart(target.status)}`;\n case ApiReferenceTargetKind.COMPONENT_SCHEMA:\n return `schema-${readableFragmentPart(target.schemaName)}`;\n default: {\n const exhaustiveTarget: never = target;\n throw new Error(`Unsupported API-reference target: ${JSON.stringify(exhaustiveTarget)}`);\n }\n }\n}\n\n/**\n * Converts a declared identifier to public URL vocabulary without silently\n * accepting arbitrary punctuation. The generated model separately rejects\n * collisions, so this readable form never needs an opaque digest suffix.\n */\nfunction readableFragmentPart(value: string): string {\n let decoded: string;\n try {\n decoded = decodeURIComponent(value);\n } catch {\n throw new Error(`API-reference public fragment cannot represent identifier '${value}'`);\n }\n const normalized = decoded\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2')\n .replace(/[:_\\s]+/g, '-')\n .toLowerCase();\n if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(normalized)) {\n throw new Error(`API-reference public fragment cannot represent identifier '${value}'`);\n }\n return normalized;\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@wildo-ai/saas-technical-doc` — OpenAPI generation surface.
|
|
3
|
+
*
|
|
4
|
+
* Schemas describing the output of the companion's OpenAPI generation route
|
|
5
|
+
* (saas-technical-doc.md Steps 3 & 4). The generator IMPLEMENTATION lives
|
|
6
|
+
* under `../companion/` and is re-exported via the package's `./companion`
|
|
7
|
+
* subpath export. This sub-tree only ships the type-level contract so it is
|
|
8
|
+
* safely consumable from:
|
|
9
|
+
* - the companion (Node) — to populate the response shape;
|
|
10
|
+
* - the docs site (browser, build-time) — to import the canonical output
|
|
11
|
+
* filenames so the Docusaurus plugin config stays in lockstep;
|
|
12
|
+
* - any CI tooling that needs to inspect a generated artefact.
|
|
13
|
+
*
|
|
14
|
+
* @wildo-boundary
|
|
15
|
+
* No React, no `react-dom`, no Node `fs`/`path` imports. Pure schemas.
|
|
16
|
+
*/
|
|
17
|
+
export * from './openapi-generation-output.schemas';
|
|
18
|
+
export * from './api-reference-targets';
|
|
19
|
+
export * from './api-reference-link-index';
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/openapi/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,qCAAqC,CAAC;AACpD,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@wildo-ai/saas-technical-doc` — OpenAPI generation surface.
|
|
3
|
+
*
|
|
4
|
+
* Schemas describing the output of the companion's OpenAPI generation route
|
|
5
|
+
* (saas-technical-doc.md Steps 3 & 4). The generator IMPLEMENTATION lives
|
|
6
|
+
* under `../companion/` and is re-exported via the package's `./companion`
|
|
7
|
+
* subpath export. This sub-tree only ships the type-level contract so it is
|
|
8
|
+
* safely consumable from:
|
|
9
|
+
* - the companion (Node) — to populate the response shape;
|
|
10
|
+
* - the docs site (browser, build-time) — to import the canonical output
|
|
11
|
+
* filenames so the Docusaurus plugin config stays in lockstep;
|
|
12
|
+
* - any CI tooling that needs to inspect a generated artefact.
|
|
13
|
+
*
|
|
14
|
+
* @wildo-boundary
|
|
15
|
+
* No React, no `react-dom`, no Node `fs`/`path` imports. Pure schemas.
|
|
16
|
+
*/
|
|
17
|
+
export * from './openapi-generation-output.schemas.js';
|
|
18
|
+
export * from './api-reference-targets.js';
|
|
19
|
+
export * from './api-reference-link-index.js';
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/openapi/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,qCAAqC,CAAC;AACpD,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC","sourcesContent":["/**\n * `@wildo-ai/saas-technical-doc` — OpenAPI generation surface.\n *\n * Schemas describing the output of the companion's OpenAPI generation route\n * (saas-technical-doc.md Steps 3 & 4). The generator IMPLEMENTATION lives\n * under `../companion/` and is re-exported via the package's `./companion`\n * subpath export. This sub-tree only ships the type-level contract so it is\n * safely consumable from:\n * - the companion (Node) — to populate the response shape;\n * - the docs site (browser, build-time) — to import the canonical output\n * filenames so the Docusaurus plugin config stays in lockstep;\n * - any CI tooling that needs to inspect a generated artefact.\n *\n * @wildo-boundary\n * No React, no `react-dom`, no Node `fs`/`path` imports. Pure schemas.\n */\n\nexport * from './openapi-generation-output.schemas';\nexport * from './api-reference-targets';\nexport * from './api-reference-link-index';\n"]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Consumer-facing API-reference section.
|
|
4
|
+
*
|
|
5
|
+
* This is intentionally not named after the framework's internal resource
|
|
6
|
+
* scopes. Organization-scoped, user-self, anonymous and ordinary
|
|
7
|
+
* authenticated operations all belong to the normal API reference. Only an
|
|
8
|
+
* operation whose accepted authorities are exclusively application
|
|
9
|
+
* administration roles belongs to the administration reference.
|
|
10
|
+
*/
|
|
11
|
+
export declare enum OpenApiSection {
|
|
12
|
+
/** The API consumed by customers, employees and external integrations. */
|
|
13
|
+
API_REFERENCE = "api_reference",
|
|
14
|
+
/** Privileged API for administrators of the generated application itself. */
|
|
15
|
+
APPLICATION_ADMINISTRATION_API_REFERENCE = "application_administration_api_reference"
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Filename emitted into `<app>/technical-doc/openapi/` for each section.
|
|
19
|
+
*
|
|
20
|
+
* Locked stable names:
|
|
21
|
+
* - normal API reference → `api.{yaml,json}`
|
|
22
|
+
* - application administration →
|
|
23
|
+
* `application-administration-api.{yaml,json}`
|
|
24
|
+
*
|
|
25
|
+
* Pinned here (rather than at a consumer call site) so every generated-output
|
|
26
|
+
* adapter stays in lockstep with the generator without re-declaring filenames.
|
|
27
|
+
*/
|
|
28
|
+
export declare const OPENAPI_OUTPUT_FILENAMES: Readonly<Record<OpenApiSection, Readonly<{
|
|
29
|
+
yaml: string;
|
|
30
|
+
json: string;
|
|
31
|
+
}>>>;
|
|
32
|
+
/**
|
|
33
|
+
* Per-section summary of what the generator produced.
|
|
34
|
+
*
|
|
35
|
+
* `operationCount` and `resourceCount` are diagnostic metadata returned
|
|
36
|
+
* over the wire by the companion route (Step 3) so the caller can render
|
|
37
|
+
* a "Generated 47 operations across 12 resources" confirmation in the
|
|
38
|
+
* companion UI without re-parsing the YAML.
|
|
39
|
+
*/
|
|
40
|
+
export declare const OpenApiSectionOutputSchema: z.ZodObject<{
|
|
41
|
+
section: z.ZodEnum<typeof OpenApiSection>;
|
|
42
|
+
operationCount: z.ZodNumber;
|
|
43
|
+
resourceCount: z.ZodNumber;
|
|
44
|
+
/**
|
|
45
|
+
* The sole semantic OpenAPI document. Format serialization belongs to the
|
|
46
|
+
* OpenAPI renderer so a caller cannot provide divergent YAML and JSON bytes.
|
|
47
|
+
*/
|
|
48
|
+
document: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
49
|
+
}, z.core.$strict>;
|
|
50
|
+
export type OpenApiSectionOutput = z.infer<typeof OpenApiSectionOutputSchema>;
|
|
51
|
+
/**
|
|
52
|
+
* Top-level contract returned by the companion's
|
|
53
|
+
* `POST /companion/api/technical-doc/generate-openapi` route (Step 3).
|
|
54
|
+
*
|
|
55
|
+
* One entry per emitted section. A section is omitted entirely if it
|
|
56
|
+
* contains zero operations after source sectioning (for example, an app with
|
|
57
|
+
* no application-administration-only operations has no administration entry).
|
|
58
|
+
*
|
|
59
|
+
* The renderer consumes this same shape and writes both serializations to its
|
|
60
|
+
* stable generated OpenAPI directory. YAML remains human-reviewable; JSON is
|
|
61
|
+
* the browser renderer's contract. Neither serialization is independently
|
|
62
|
+
* authored.
|
|
63
|
+
*/
|
|
64
|
+
export declare const OpenApiGenerationOutputSchema: z.ZodObject<{
|
|
65
|
+
/** ISO-8601 timestamp of when the generation completed. */
|
|
66
|
+
generatedAt: z.ZodISODateTime;
|
|
67
|
+
/** The sections actually produced (zero-operation sections are omitted). */
|
|
68
|
+
sections: z.ZodArray<z.ZodObject<{
|
|
69
|
+
section: z.ZodEnum<typeof OpenApiSection>;
|
|
70
|
+
operationCount: z.ZodNumber;
|
|
71
|
+
resourceCount: z.ZodNumber;
|
|
72
|
+
/**
|
|
73
|
+
* The sole semantic OpenAPI document. Format serialization belongs to the
|
|
74
|
+
* OpenAPI renderer so a caller cannot provide divergent YAML and JSON bytes.
|
|
75
|
+
*/
|
|
76
|
+
document: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
77
|
+
}, z.core.$strict>>;
|
|
78
|
+
}, z.core.$strict>;
|
|
79
|
+
export type OpenApiGenerationOutput = z.infer<typeof OpenApiGenerationOutputSchema>;
|
|
80
|
+
//# sourceMappingURL=openapi-generation-output.schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi-generation-output.schemas.d.ts","sourceRoot":"","sources":["../../../../src/openapi/openapi-generation-output.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AACH,oBAAY,cAAc;IACxB,0EAA0E;IAC1E,aAAa,kBAAkB;IAC/B,6EAA6E;IAC7E,wCAAwC,6CAA6C;CACtF;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,MAAM,CAAC,cAAc,EAAE,QAAQ,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAS/G,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B;;;;IAIrC;;;OAGG;;kBAEH,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,6BAA6B;IACxC,2DAA2D;;IAE3D,4EAA4E;;;;;QAxB5E;;;WAGG;;;kBAuBH,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Consumer-facing API-reference section.
|
|
4
|
+
*
|
|
5
|
+
* This is intentionally not named after the framework's internal resource
|
|
6
|
+
* scopes. Organization-scoped, user-self, anonymous and ordinary
|
|
7
|
+
* authenticated operations all belong to the normal API reference. Only an
|
|
8
|
+
* operation whose accepted authorities are exclusively application
|
|
9
|
+
* administration roles belongs to the administration reference.
|
|
10
|
+
*/
|
|
11
|
+
export var OpenApiSection;
|
|
12
|
+
(function (OpenApiSection) {
|
|
13
|
+
/** The API consumed by customers, employees and external integrations. */
|
|
14
|
+
OpenApiSection["API_REFERENCE"] = "api_reference";
|
|
15
|
+
/** Privileged API for administrators of the generated application itself. */
|
|
16
|
+
OpenApiSection["APPLICATION_ADMINISTRATION_API_REFERENCE"] = "application_administration_api_reference";
|
|
17
|
+
})(OpenApiSection || (OpenApiSection = {}));
|
|
18
|
+
/**
|
|
19
|
+
* Filename emitted into `<app>/technical-doc/openapi/` for each section.
|
|
20
|
+
*
|
|
21
|
+
* Locked stable names:
|
|
22
|
+
* - normal API reference → `api.{yaml,json}`
|
|
23
|
+
* - application administration →
|
|
24
|
+
* `application-administration-api.{yaml,json}`
|
|
25
|
+
*
|
|
26
|
+
* Pinned here (rather than at a consumer call site) so every generated-output
|
|
27
|
+
* adapter stays in lockstep with the generator without re-declaring filenames.
|
|
28
|
+
*/
|
|
29
|
+
export const OPENAPI_OUTPUT_FILENAMES = {
|
|
30
|
+
[OpenApiSection.API_REFERENCE]: {
|
|
31
|
+
yaml: 'api.yaml',
|
|
32
|
+
json: 'api.json',
|
|
33
|
+
},
|
|
34
|
+
[OpenApiSection.APPLICATION_ADMINISTRATION_API_REFERENCE]: {
|
|
35
|
+
yaml: 'application-administration-api.yaml',
|
|
36
|
+
json: 'application-administration-api.json',
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Per-section summary of what the generator produced.
|
|
41
|
+
*
|
|
42
|
+
* `operationCount` and `resourceCount` are diagnostic metadata returned
|
|
43
|
+
* over the wire by the companion route (Step 3) so the caller can render
|
|
44
|
+
* a "Generated 47 operations across 12 resources" confirmation in the
|
|
45
|
+
* companion UI without re-parsing the YAML.
|
|
46
|
+
*/
|
|
47
|
+
export const OpenApiSectionOutputSchema = z.strictObject({
|
|
48
|
+
section: z.enum(OpenApiSection),
|
|
49
|
+
operationCount: z.number().int().nonnegative(),
|
|
50
|
+
resourceCount: z.number().int().nonnegative(),
|
|
51
|
+
/**
|
|
52
|
+
* The sole semantic OpenAPI document. Format serialization belongs to the
|
|
53
|
+
* OpenAPI renderer so a caller cannot provide divergent YAML and JSON bytes.
|
|
54
|
+
*/
|
|
55
|
+
document: z.record(z.string(), z.unknown()),
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* Top-level contract returned by the companion's
|
|
59
|
+
* `POST /companion/api/technical-doc/generate-openapi` route (Step 3).
|
|
60
|
+
*
|
|
61
|
+
* One entry per emitted section. A section is omitted entirely if it
|
|
62
|
+
* contains zero operations after source sectioning (for example, an app with
|
|
63
|
+
* no application-administration-only operations has no administration entry).
|
|
64
|
+
*
|
|
65
|
+
* The renderer consumes this same shape and writes both serializations to its
|
|
66
|
+
* stable generated OpenAPI directory. YAML remains human-reviewable; JSON is
|
|
67
|
+
* the browser renderer's contract. Neither serialization is independently
|
|
68
|
+
* authored.
|
|
69
|
+
*/
|
|
70
|
+
export const OpenApiGenerationOutputSchema = z.strictObject({
|
|
71
|
+
/** ISO-8601 timestamp of when the generation completed. */
|
|
72
|
+
generatedAt: z.iso.datetime(),
|
|
73
|
+
/** The sections actually produced (zero-operation sections are omitted). */
|
|
74
|
+
sections: z.array(OpenApiSectionOutputSchema).max(2),
|
|
75
|
+
});
|
|
76
|
+
//# sourceMappingURL=openapi-generation-output.schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi-generation-output.schemas.js","sourceRoot":"","sources":["../../../../src/openapi/openapi-generation-output.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AACH,MAAM,CAAN,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,0EAA0E;IAC1E,iDAA+B,CAAA;IAC/B,6EAA6E;IAC7E,uGAAqF,CAAA;AACvF,CAAC,EALW,cAAc,KAAd,cAAc,QAKzB;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAA+E;IAClH,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE;QAC9B,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,UAAU;KACjB;IACD,CAAC,cAAc,CAAC,wCAAwC,CAAC,EAAE;QACzD,IAAI,EAAE,qCAAqC;QAC3C,IAAI,EAAE,qCAAqC;KAC5C;CACF,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,YAAY,CAAC;IACvD,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;IAC/B,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IAC9C,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IAC7C;;;OAGG;IACH,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;CAC5C,CAAC,CAAC;AAGH;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,YAAY,CAAC;IAC1D,2DAA2D;IAC3D,WAAW,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE;IAC7B,4EAA4E;IAC5E,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;CACrD,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\n\n/**\n * Consumer-facing API-reference section.\n *\n * This is intentionally not named after the framework's internal resource\n * scopes. Organization-scoped, user-self, anonymous and ordinary\n * authenticated operations all belong to the normal API reference. Only an\n * operation whose accepted authorities are exclusively application\n * administration roles belongs to the administration reference.\n */\nexport enum OpenApiSection {\n /** The API consumed by customers, employees and external integrations. */\n API_REFERENCE = 'api_reference',\n /** Privileged API for administrators of the generated application itself. */\n APPLICATION_ADMINISTRATION_API_REFERENCE = 'application_administration_api_reference',\n}\n\n/**\n * Filename emitted into `<app>/technical-doc/openapi/` for each section.\n *\n * Locked stable names:\n * - normal API reference → `api.{yaml,json}`\n * - application administration →\n * `application-administration-api.{yaml,json}`\n *\n * Pinned here (rather than at a consumer call site) so every generated-output\n * adapter stays in lockstep with the generator without re-declaring filenames.\n */\nexport const OPENAPI_OUTPUT_FILENAMES: Readonly<Record<OpenApiSection, Readonly<{ yaml: string; json: string }>>> = {\n [OpenApiSection.API_REFERENCE]: {\n yaml: 'api.yaml',\n json: 'api.json',\n },\n [OpenApiSection.APPLICATION_ADMINISTRATION_API_REFERENCE]: {\n yaml: 'application-administration-api.yaml',\n json: 'application-administration-api.json',\n },\n};\n\n/**\n * Per-section summary of what the generator produced.\n *\n * `operationCount` and `resourceCount` are diagnostic metadata returned\n * over the wire by the companion route (Step 3) so the caller can render\n * a \"Generated 47 operations across 12 resources\" confirmation in the\n * companion UI without re-parsing the YAML.\n */\nexport const OpenApiSectionOutputSchema = z.strictObject({\n section: z.enum(OpenApiSection),\n operationCount: z.number().int().nonnegative(),\n resourceCount: z.number().int().nonnegative(),\n /**\n * The sole semantic OpenAPI document. Format serialization belongs to the\n * OpenAPI renderer so a caller cannot provide divergent YAML and JSON bytes.\n */\n document: z.record(z.string(), z.unknown()),\n});\nexport type OpenApiSectionOutput = z.infer<typeof OpenApiSectionOutputSchema>;\n\n/**\n * Top-level contract returned by the companion's\n * `POST /companion/api/technical-doc/generate-openapi` route (Step 3).\n *\n * One entry per emitted section. A section is omitted entirely if it\n * contains zero operations after source sectioning (for example, an app with\n * no application-administration-only operations has no administration entry).\n *\n * The renderer consumes this same shape and writes both serializations to its\n * stable generated OpenAPI directory. YAML remains human-reviewable; JSON is\n * the browser renderer's contract. Neither serialization is independently\n * authored.\n */\nexport const OpenApiGenerationOutputSchema = z.strictObject({\n /** ISO-8601 timestamp of when the generation completed. */\n generatedAt: z.iso.datetime(),\n /** The sections actually produced (zero-operation sections are omitted). */\n sections: z.array(OpenApiSectionOutputSchema).max(2),\n});\nexport type OpenApiGenerationOutput = z.infer<typeof OpenApiGenerationOutputSchema>;\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-safe and Node-safe OpenAPI reference-model entrypoint.
|
|
3
|
+
*
|
|
4
|
+
* Managed publication uses this narrow subpath to verify that the native
|
|
5
|
+
* renderer conserves the generated OpenAPI inventory without importing the
|
|
6
|
+
* React/auth runtime barrel. Docusaurus may consume the same projection.
|
|
7
|
+
*/
|
|
8
|
+
export * from './runtime/openapi-reference-model';
|
|
9
|
+
export * from './runtime/openapi-reference-conservation';
|
|
10
|
+
//# sourceMappingURL=openapi-reference-model.exports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi-reference-model.exports.d.ts","sourceRoot":"","sources":["../../../src/openapi-reference-model.exports.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,mCAAmC,CAAC;AAClD,cAAc,0CAA0C,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-safe and Node-safe OpenAPI reference-model entrypoint.
|
|
3
|
+
*
|
|
4
|
+
* Managed publication uses this narrow subpath to verify that the native
|
|
5
|
+
* renderer conserves the generated OpenAPI inventory without importing the
|
|
6
|
+
* React/auth runtime barrel. Docusaurus may consume the same projection.
|
|
7
|
+
*/
|
|
8
|
+
export * from './runtime/openapi-reference-model.js';
|
|
9
|
+
export * from './runtime/openapi-reference-conservation.js';
|
|
10
|
+
//# sourceMappingURL=openapi-reference-model.exports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi-reference-model.exports.js","sourceRoot":"","sources":["../../../src/openapi-reference-model.exports.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,mCAAmC,CAAC;AAClD,cAAc,0CAA0C,CAAC","sourcesContent":["/**\n * Browser-safe and Node-safe OpenAPI reference-model entrypoint.\n *\n * Managed publication uses this narrow subpath to verify that the native\n * renderer conserves the generated OpenAPI inventory without importing the\n * React/auth runtime barrel. Docusaurus may consume the same projection.\n */\n\nexport * from './runtime/openapi-reference-model';\nexport * from './runtime/openapi-reference-conservation';\n"]}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { type FC, type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Status of the auth-code exchange the page is performing.
|
|
4
|
+
*
|
|
5
|
+
* - `pending` — initial mount; effect has not yet run.
|
|
6
|
+
* - `exchanging`— the `/auth/token/exchange` POST is in flight.
|
|
7
|
+
* - `success` — tokens received; about to navigate to `returnPath`.
|
|
8
|
+
* - `error` — exchange failed; the page renders a fallback message
|
|
9
|
+
* and a manual link back to the docs root.
|
|
10
|
+
* - `missingCode`— landed on `/auth/exchange` without `?code=…` (someone
|
|
11
|
+
* bookmarked the page or arrived via a stale link).
|
|
12
|
+
*/
|
|
13
|
+
export type AuthExchangeStatus = 'pending' | 'exchanging' | 'success' | 'error' | 'missingCode';
|
|
14
|
+
/**
|
|
15
|
+
* Page component mounted at `/auth/exchange` on the docs site
|
|
16
|
+
* (saas-technical-doc.md Step 5).
|
|
17
|
+
*
|
|
18
|
+
* Lifecycle on mount:
|
|
19
|
+
*
|
|
20
|
+
* 1. Read `?code=` and `?return=` from `window.location.search`.
|
|
21
|
+
* 2. If `code` is missing → render the missingCode UI (no network call).
|
|
22
|
+
* 3. Else call `useDocsAuthSession().beginExchange(code)`, which POSTs
|
|
23
|
+
* `/auth/token/exchange` and updates the in-memory context.
|
|
24
|
+
* 4. On success, navigate to `returnPath` (defaults to `/`) using the
|
|
25
|
+
* consumer-supplied `onSuccessNavigate` (Docusaurus / react-router
|
|
26
|
+
* hosts MUST pass a client-side `history.push` — see the prop
|
|
27
|
+
* docstring below for why a full reload is incorrect here).
|
|
28
|
+
* 5. On failure, render the error UI with a link back to `/`.
|
|
29
|
+
*
|
|
30
|
+
* Why a single component (rather than splitting effect + render):
|
|
31
|
+
*
|
|
32
|
+
* - Keeps the exchange contract trivially auditable from one file.
|
|
33
|
+
* - The effect intentionally runs ONCE per mount (`hasRunRef` guard) —
|
|
34
|
+
* `code` values are single-use AUTH_CODE_EXCHANGE consumable tokens
|
|
35
|
+
* and a stray re-mount in React 18 strict-mode dev would burn the
|
|
36
|
+
* code with the second call returning `invalid_or_expired_code`.
|
|
37
|
+
*
|
|
38
|
+
* Visual layer: this component renders a minimal centered "Signing you
|
|
39
|
+
* in…" / error block. Apps that want to brand it can either pass a
|
|
40
|
+
* `render` prop (consumer-controlled UI for each status) or skip this
|
|
41
|
+
* component entirely and call `useDocsAuthSession().beginExchange(code)`
|
|
42
|
+
* from their own page. The default rendering deliberately uses inline
|
|
43
|
+
* styles (no Tailwind / no CSS imports) so the component can be mounted
|
|
44
|
+
* by any Docusaurus theme without dragging in extra build pipeline.
|
|
45
|
+
*/
|
|
46
|
+
export declare const AuthExchangePage: FC<{
|
|
47
|
+
/**
|
|
48
|
+
* Override the default rendering. Receives the current status and (when
|
|
49
|
+
* the page reaches a terminal state) a recovery URL the consumer can
|
|
50
|
+
* link back to.
|
|
51
|
+
*/
|
|
52
|
+
render?: (props: {
|
|
53
|
+
status: AuthExchangeStatus;
|
|
54
|
+
returnPath: string;
|
|
55
|
+
error: string | null;
|
|
56
|
+
}) => ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* Post-success navigation. **SPA hosts (Docusaurus, react-router,
|
|
59
|
+
* Vite/React-Router apps) MUST pass a client-side router push** — the
|
|
60
|
+
* default `window.location.assign` triggers a full browser navigation
|
|
61
|
+
* which destroys the in-memory `DocsAuthProvider` state we just
|
|
62
|
+
* populated (the entire JS bundle re-executes from scratch on the
|
|
63
|
+
* destination page, the React tree re-mounts, and `session` resets to
|
|
64
|
+
* `'anonymous'`). For a Docusaurus consumer that looks like:
|
|
65
|
+
*
|
|
66
|
+
* ```tsx
|
|
67
|
+
* import { useHistory } from '@docusaurus/router';
|
|
68
|
+
*
|
|
69
|
+
* function AuthExchangeRoute() {
|
|
70
|
+
* const history = useHistory();
|
|
71
|
+
* return <AuthExchangePage onSuccessNavigate={(p) => history.push(p)} />;
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* The default `window.location.assign` only works for plain-HTML hosts
|
|
76
|
+
* that have no in-memory client state to preserve across the redirect.
|
|
77
|
+
* It is kept as the default so the runtime stays usable in those hosts
|
|
78
|
+
* with zero ceremony, but for SPAs failing to override it would
|
|
79
|
+
* silently break the entire handoff (the user lands on the destination
|
|
80
|
+
* page anonymous and any role-gated content rejects them).
|
|
81
|
+
*/
|
|
82
|
+
onSuccessNavigate?: (returnPath: string) => void;
|
|
83
|
+
}>;
|
|
84
|
+
//# sourceMappingURL=AuthExchangePage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthExchangePage.d.ts","sourceRoot":"","sources":["../../../../src/runtime/AuthExchangePage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmD,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIjG;;;;;;;;;;GAUG;AACH,MAAM,MAAM,kBAAkB,GAC1B,SAAS,GACT,YAAY,GACZ,SAAS,GACT,OAAO,GACP,aAAa,CAAC;AAElB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC;IAChC;;;;OAIG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,kBAAkB,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,KAAK,SAAS,CAAC;IACxG;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD,CA8FA,CAAC"}
|