@wildo-ai/saas-technical-doc 1.1.3 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/companion/application-documentation/application-connection-documentation.d.ts +37 -0
- package/dist/esm/companion/application-documentation/application-connection-documentation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/application-connection-documentation.js +46 -5
- package/dist/esm/companion/application-documentation/application-connection-documentation.js.map +1 -1
- package/dist/esm/companion/application-documentation/application-documentation-chapters.d.ts +101 -0
- package/dist/esm/companion/application-documentation/application-documentation-chapters.d.ts.map +1 -0
- package/dist/esm/companion/application-documentation/application-documentation-chapters.js +205 -0
- package/dist/esm/companion/application-documentation/application-documentation-chapters.js.map +1 -0
- package/dist/esm/companion/application-documentation/application-organization-unit-resource-documentation.js +3 -0
- package/dist/esm/companion/application-documentation/application-organization-unit-resource-documentation.js.map +1 -1
- package/dist/esm/companion/application-documentation/docs-api-origin-substitution.d.ts +34 -0
- package/dist/esm/companion/application-documentation/docs-api-origin-substitution.d.ts.map +1 -0
- package/dist/esm/companion/application-documentation/docs-api-origin-substitution.js +45 -0
- package/dist/esm/companion/application-documentation/docs-api-origin-substitution.js.map +1 -0
- package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.d.ts +24 -10
- package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.js +25 -15
- package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.js.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.d.ts +11 -3
- package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.js +9 -2
- package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.js.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.d.ts.map +1 -1
- package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.js +10 -4
- package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.js.map +1 -1
- package/dist/esm/companion/index.d.ts +2 -0
- package/dist/esm/companion/index.d.ts.map +1 -1
- package/dist/esm/companion/index.js +2 -0
- package/dist/esm/companion/index.js.map +1 -1
- package/dist/esm/companion/openapi-generator.d.ts +8 -4
- package/dist/esm/companion/openapi-generator.d.ts.map +1 -1
- package/dist/esm/companion/openapi-generator.js +43 -17
- package/dist/esm/companion/openapi-generator.js.map +1 -1
- package/dist/esm/companion/operation-projection.schemas.d.ts +21 -1
- package/dist/esm/companion/operation-projection.schemas.d.ts.map +1 -1
- package/dist/esm/companion/operation-projection.schemas.js +11 -0
- package/dist/esm/companion/operation-projection.schemas.js.map +1 -1
- package/dist/esm/companion/publish-result.types.d.ts +37 -4
- package/dist/esm/companion/publish-result.types.d.ts.map +1 -1
- package/dist/esm/companion/publish-result.types.js.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.d.ts.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.js +8 -0
- package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.js.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-render-model.d.ts.map +1 -1
- package/dist/esm/companion/rendering/technical-documentation-render-model.js +26 -10
- package/dist/esm/companion/rendering/technical-documentation-render-model.js.map +1 -1
- package/dist/esm/content/application-consumer-documentation-content.techdoc.d.ts +18 -15
- package/dist/esm/content/application-consumer-documentation-content.techdoc.d.ts.map +1 -1
- package/dist/esm/content/application-consumer-documentation-content.techdoc.js +169 -61
- package/dist/esm/content/application-consumer-documentation-content.techdoc.js.map +1 -1
- package/dist/esm/runtime/DocsAuthContext.d.ts +2 -2
- package/dist/esm/runtime/DocsAuthContext.d.ts.map +1 -1
- package/dist/esm/runtime/DocsAuthContext.js +8 -4
- package/dist/esm/runtime/DocsAuthContext.js.map +1 -1
- package/dist/esm/runtime/DocsFrontendProviders.d.ts +16 -0
- package/dist/esm/runtime/DocsFrontendProviders.d.ts.map +1 -0
- package/dist/esm/runtime/DocsFrontendProviders.js +26 -0
- package/dist/esm/runtime/DocsFrontendProviders.js.map +1 -0
- package/dist/esm/runtime/frontend-provider-registry.techdoc.d.ts +1 -2
- package/dist/esm/runtime/frontend-provider-registry.techdoc.d.ts.map +1 -1
- package/dist/esm/runtime/frontend-provider-registry.techdoc.js.map +1 -1
- package/dist/esm/runtime/index.d.ts +2 -0
- package/dist/esm/runtime/index.d.ts.map +1 -1
- package/dist/esm/runtime/index.js +2 -0
- package/dist/esm/runtime/index.js.map +1 -1
- package/dist/esm/runtime/openapi-reference-model.d.ts +5 -0
- package/dist/esm/runtime/openapi-reference-model.d.ts.map +1 -1
- package/dist/esm/runtime/openapi-reference-model.js +5 -0
- package/dist/esm/runtime/openapi-reference-model.js.map +1 -1
- package/dist/esm/runtime/openapi-reference-view.js +1 -1
- package/dist/esm/runtime/openapi-reference-view.js.map +1 -1
- package/dist/esm/runtime/use-docs-frontend-provider-registry.d.ts +1 -0
- package/dist/esm/runtime/use-docs-frontend-provider-registry.d.ts.map +1 -1
- package/dist/esm/runtime/use-docs-frontend-provider-registry.js +10 -2
- package/dist/esm/runtime/use-docs-frontend-provider-registry.js.map +1 -1
- package/dist/esm/runtime/use-docs-provider-scripts.d.ts +30 -0
- package/dist/esm/runtime/use-docs-provider-scripts.d.ts.map +1 -0
- package/dist/esm/runtime/use-docs-provider-scripts.js +40 -0
- package/dist/esm/runtime/use-docs-provider-scripts.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -24
- package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.d.ts +0 -0
- package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.d.ts.map +0 -0
- package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.js +0 -0
- package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.js.map +0 -0
package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type EngineDocumentationSpecificationCatalogIdentityV1, type TechnicalDocumentationEnvironmentEvidenceSnapshotV1, type TechnicalDocumentationPrivateDerivationManifestV1 } from '@wildo-ai/saas-specifications/technical-documentation';
|
|
1
|
+
import { type EngineDocumentationSpecificationCatalogIdentityV1, type TechnicalDocumentationEnvironmentEvidenceSnapshotV1, type TechnicalDocumentationPrivateDerivationManifestV1, type TechnicalDocumentationUnitV1 } from '@wildo-ai/saas-specifications/technical-documentation';
|
|
2
2
|
import type { EngineDocumentationSpecificationCatalogV1 } from '@wildo-ai/saas-specifications/companion';
|
|
3
3
|
import type { LoadedApplicationConsumerDocumentationContentBundleV1 } from '../content/application-consumer-documentation-content-loader';
|
|
4
4
|
import { type ApplicationOrganizationRolesDocumentationFact } from './technical-documentation-engine-content-bundle';
|
|
@@ -25,6 +25,12 @@ export interface CreateTechnicalDocumentationPrivateDerivationInput {
|
|
|
25
25
|
readonly applicationAdministrationFact: ApplicationAdministrationDocumentationFact;
|
|
26
26
|
readonly applicationIntegrationFact: ApplicationIntegrationDocumentationFact;
|
|
27
27
|
readonly applicationDomainFact: ApplicationDomainDocumentationFact;
|
|
28
|
+
/**
|
|
29
|
+
* The chapters the application authored, already joined to its documentation plan by
|
|
30
|
+
* `projectApplicationDocumentationChapters` (#874). Optional and empty-by-default: an application
|
|
31
|
+
* that has authored none publishes its derived pages alone.
|
|
32
|
+
*/
|
|
33
|
+
readonly applicationDocumentationChapterUnits?: readonly TechnicalDocumentationUnitV1[];
|
|
28
34
|
/** This derivation's own identity; the authorized bundle names it. */
|
|
29
35
|
readonly derivationRef: string;
|
|
30
36
|
readonly derivationVersion: number;
|
|
@@ -34,8 +40,10 @@ export interface CreateTechnicalDocumentationPrivateDerivationInput {
|
|
|
34
40
|
* Joins exact framework and environment identities into the private semantic artifact.
|
|
35
41
|
*
|
|
36
42
|
* This reusable function performs no application-design discovery and chooses
|
|
37
|
-
* no output path. Application content
|
|
38
|
-
*
|
|
43
|
+
* no output path. Application-authored content enters only as units already
|
|
44
|
+
* joined to the application's accepted documentation plan
|
|
45
|
+
* (`projectApplicationDocumentationChapters`, #874) — this function never reads
|
|
46
|
+
* an application file itself.
|
|
39
47
|
*/
|
|
40
48
|
export declare function createTechnicalDocumentationPrivateDerivation(input: CreateTechnicalDocumentationPrivateDerivationInput): TechnicalDocumentationPrivateDerivationManifestV1;
|
|
41
49
|
//# sourceMappingURL=technical-documentation-private-derivation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"technical-documentation-private-derivation.d.ts","sourceRoot":"","sources":["../../../../../src/companion/application-documentation/technical-documentation-private-derivation.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iDAAiD,EACtD,KAAK,mDAAmD,EACxD,KAAK,iDAAiD,
|
|
1
|
+
{"version":3,"file":"technical-documentation-private-derivation.d.ts","sourceRoot":"","sources":["../../../../../src/companion/application-documentation/technical-documentation-private-derivation.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iDAAiD,EACtD,KAAK,mDAAmD,EACxD,KAAK,iDAAiD,EACtD,KAAK,4BAA4B,EAClC,MAAM,uDAAuD,CAAC;AAC/D,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,yCAAyC,CAAC;AAEzG,OAAO,KAAK,EAAE,qDAAqD,EAAE,MAAM,8DAA8D,CAAC;AAC1I,OAAO,EAEL,KAAK,6CAA6C,EACnD,MAAM,iDAAiD,CAAC;AACzD,OAAO,KAAK,EAAE,qDAAqD,EAAE,MAAM,wDAAwD,CAAC;AACpI,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,wCAAwC,CAAC;AACrG,OAAO,KAAK,EAAE,0CAA0C,EAAE,MAAM,4CAA4C,CAAC;AAC7G,OAAO,KAAK,EAAE,0CAA0C,EAAE,MAAM,4CAA4C,CAAC;AAC7G,OAAO,KAAK,EAAE,uCAAuC,EA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
|
|
|
6
6
|
* Joins exact framework and environment identities into the private semantic artifact.
|
|
7
7
|
*
|
|
8
8
|
* This reusable function performs no application-design discovery and chooses
|
|
9
|
-
* no output path. Application content
|
|
10
|
-
*
|
|
9
|
+
* no output path. Application-authored content enters only as units already
|
|
10
|
+
* joined to the application's accepted documentation plan
|
|
11
|
+
* (`projectApplicationDocumentationChapters`, #874) — this function never reads
|
|
12
|
+
* an application file itself.
|
|
11
13
|
*/
|
|
12
14
|
export function createTechnicalDocumentationPrivateDerivation(input) {
|
|
13
15
|
const engineUnits = projectEngineApplicationConsumerContentBundle(input.engineContentBundle, input.engineSpecificationCatalog, undefined, {
|
|
@@ -25,6 +27,11 @@ export function createTechnicalDocumentationPrivateDerivation(input) {
|
|
|
25
27
|
throw new Error(`duplicate engine technical-documentation unitRef: ${unit.unitRef}`);
|
|
26
28
|
unitsByRef.set(unit.unitRef, unit);
|
|
27
29
|
}
|
|
30
|
+
for (const unit of input.applicationDocumentationChapterUnits ?? []) {
|
|
31
|
+
if (unitsByRef.has(unit.unitRef))
|
|
32
|
+
throw new Error(`application documentation chapter collides with an existing unitRef: ${unit.unitRef}`);
|
|
33
|
+
unitsByRef.set(unit.unitRef, unit);
|
|
34
|
+
}
|
|
28
35
|
return createTechnicalDocumentationPrivateDerivationManifestV1({
|
|
29
36
|
schemaVersion: 1,
|
|
30
37
|
engineContentBundleIdentity: input.engineContentBundle.identity,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"technical-documentation-private-derivation.js","sourceRoot":"","sources":["../../../../../src/companion/application-documentation/technical-documentation-private-derivation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uDAAuD,GAKxD,MAAM,uDAAuD,CAAC;AAI/D,OAAO,EACL,6CAA6C,GAE9C,MAAM,iDAAiD,CAAC;AAQzD,MAAM,CAAC,MAAM,wDAAwD,GAAG,yDAAyD,CAAC;AAClI,MAAM,CAAC,MAAM,4DAA4D,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"technical-documentation-private-derivation.js","sourceRoot":"","sources":["../../../../../src/companion/application-documentation/technical-documentation-private-derivation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uDAAuD,GAKxD,MAAM,uDAAuD,CAAC;AAI/D,OAAO,EACL,6CAA6C,GAE9C,MAAM,iDAAiD,CAAC;AAQzD,MAAM,CAAC,MAAM,wDAAwD,GAAG,yDAAyD,CAAC;AAClI,MAAM,CAAC,MAAM,4DAA4D,GAAG,CAAC,CAAC;AA6B9E;;;;;;;;GAQG;AACH,MAAM,UAAU,6CAA6C,CAC3D,KAAyD;IAEzD,MAAM,WAAW,GAAG,6CAA6C,CAC/D,KAAK,CAAC,mBAAmB,EACzB,KAAK,CAAC,0BAA0B,EAChC,SAAS,EACT;QACE,iBAAiB,EAAE,KAAK,CAAC,gCAAgC;QACzD,yBAAyB,EAAE,KAAK,CAAC,wCAAwC;QACzE,UAAU,EAAE,KAAK,CAAC,yBAAyB;QAC3C,cAAc,EAAE,KAAK,CAAC,6BAA6B;QACnD,cAAc,EAAE,KAAK,CAAC,6BAA6B;QACnD,WAAW,EAAE,KAAK,CAAC,0BAA0B;QAC7C,MAAM,EAAE,KAAK,CAAC,qBAAqB;KACpC,CACF,CAAC;IACF,MAAM,UAAU,GAAG,IAAI,GAAG,EAAwC,CAAC;IACnE,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE,CAAC;QAC/B,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,qDAAqD,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QACvH,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACrC,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,oCAAoC,IAAI,EAAE,EAAE,CAAC;QACpE,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,wEAAwE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAC1I,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,uDAAuD,CAAC;QAC7D,aAAa,EAAE,CAAC;QAChB,2BAA2B,EAAE,KAAK,CAAC,mBAAmB,CAAC,QAAQ;QAC/D,2BAA2B,EAAE,KAAK,CAAC,2BAA2B;QAC9D,kCAAkC,EAAE,KAAK,CAAC,kCAAkC;QAC5E,YAAY,EAAE,wDAAwD;QACtE,gBAAgB,EAAE,4DAA4D;QAC9E,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;QAC1C,KAAK,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC;QAC/B,SAAS,EAAE,KAAK,CAAC,SAAS;KAC3B,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {\n createTechnicalDocumentationPrivateDerivationManifestV1,\n type EngineDocumentationSpecificationCatalogIdentityV1,\n type TechnicalDocumentationEnvironmentEvidenceSnapshotV1,\n type TechnicalDocumentationPrivateDerivationManifestV1,\n type TechnicalDocumentationUnitV1,\n} from '@wildo-ai/saas-specifications/technical-documentation';\nimport type { EngineDocumentationSpecificationCatalogV1 } from '@wildo-ai/saas-specifications/companion';\n\nimport type { LoadedApplicationConsumerDocumentationContentBundleV1 } from '../content/application-consumer-documentation-content-loader';\nimport {\n projectEngineApplicationConsumerContentBundle,\n type ApplicationOrganizationRolesDocumentationFact,\n} from './technical-documentation-engine-content-bundle';\nimport type { ApplicationOrganizationUnitResourcesDocumentationFact } from './application-organization-unit-resource-documentation';\nimport type { ApplicationConnectionDocumentationFact } from './application-connection-documentation';\nimport type { ApplicationAuthenticationDocumentationFact } from './application-authentication-documentation';\nimport type { ApplicationAdministrationDocumentationFact } from './application-administration-documentation';\nimport type { ApplicationIntegrationDocumentationFact } from './application-integration-documentation';\nimport type { ApplicationDomainDocumentationFact } from './application-domain-documentation';\n\nexport const TECHNICAL_DOCUMENTATION_PRIVATE_DERIVATION_PROJECTOR_REF = 'technical-documentation:projector/private-derivation-v1';\nexport const TECHNICAL_DOCUMENTATION_PRIVATE_DERIVATION_PROJECTOR_VERSION = 1;\n\nexport interface CreateTechnicalDocumentationPrivateDerivationInput {\n readonly engineContentBundle: LoadedApplicationConsumerDocumentationContentBundleV1;\n readonly environmentEvidenceSnapshot: TechnicalDocumentationEnvironmentEvidenceSnapshotV1;\n /** Exact safe fact catalog used to compose the engine-content units. */\n readonly engineSpecificationCatalog: EngineDocumentationSpecificationCatalogV1;\n readonly engineSpecificationCatalogIdentity: EngineDocumentationSpecificationCatalogIdentityV1;\n /** Resolved organization roles and their application-authored semantic specifications. */\n readonly applicationOrganizationRolesFact: ApplicationOrganizationRolesDocumentationFact;\n /** Exact resources opted into organization-unit narrowing by backend startup configuration. */\n readonly applicationOrganizationUnitResourcesFact: ApplicationOrganizationUnitResourcesDocumentationFact;\n readonly applicationConnectionFact: ApplicationConnectionDocumentationFact;\n readonly applicationAuthenticationFact: ApplicationAuthenticationDocumentationFact;\n readonly applicationAdministrationFact: ApplicationAdministrationDocumentationFact;\n readonly applicationIntegrationFact: ApplicationIntegrationDocumentationFact;\n readonly applicationDomainFact: ApplicationDomainDocumentationFact;\n /**\n * The chapters the application authored, already joined to its documentation plan by\n * `projectApplicationDocumentationChapters` (#874). Optional and empty-by-default: an application\n * that has authored none publishes its derived pages alone.\n */\n readonly applicationDocumentationChapterUnits?: readonly TechnicalDocumentationUnitV1[];\n /** This derivation's own identity; the authorized bundle names it. */\n readonly derivationRef: string;\n readonly derivationVersion: number;\n readonly derivedAt: string;\n}\n\n/**\n * Joins exact framework and environment identities into the private semantic artifact.\n *\n * This reusable function performs no application-design discovery and chooses\n * no output path. Application-authored content enters only as units already\n * joined to the application's accepted documentation plan\n * (`projectApplicationDocumentationChapters`, #874) — this function never reads\n * an application file itself.\n */\nexport function createTechnicalDocumentationPrivateDerivation(\n input: CreateTechnicalDocumentationPrivateDerivationInput,\n): TechnicalDocumentationPrivateDerivationManifestV1 {\n const engineUnits = projectEngineApplicationConsumerContentBundle(\n input.engineContentBundle,\n input.engineSpecificationCatalog,\n undefined,\n {\n organizationRoles: input.applicationOrganizationRolesFact,\n organizationUnitResources: input.applicationOrganizationUnitResourcesFact,\n connection: input.applicationConnectionFact,\n authentication: input.applicationAuthenticationFact,\n administration: input.applicationAdministrationFact,\n integration: input.applicationIntegrationFact,\n domain: input.applicationDomainFact,\n },\n );\n const unitsByRef = new Map<string, TechnicalDocumentationUnitV1>();\n for (const unit of engineUnits) {\n if (unitsByRef.has(unit.unitRef)) throw new Error(`duplicate engine technical-documentation unitRef: ${unit.unitRef}`);\n unitsByRef.set(unit.unitRef, unit);\n }\n for (const unit of input.applicationDocumentationChapterUnits ?? []) {\n if (unitsByRef.has(unit.unitRef)) throw new Error(`application documentation chapter collides with an existing unitRef: ${unit.unitRef}`);\n unitsByRef.set(unit.unitRef, unit);\n }\n\n return createTechnicalDocumentationPrivateDerivationManifestV1({\n schemaVersion: 1,\n engineContentBundleIdentity: input.engineContentBundle.identity,\n environmentEvidenceSnapshot: input.environmentEvidenceSnapshot,\n engineSpecificationCatalogIdentity: input.engineSpecificationCatalogIdentity,\n projectorRef: TECHNICAL_DOCUMENTATION_PRIVATE_DERIVATION_PROJECTOR_REF,\n projectorVersion: TECHNICAL_DOCUMENTATION_PRIVATE_DERIVATION_PROJECTOR_VERSION,\n derivationRef: input.derivationRef,\n derivationVersion: input.derivationVersion,\n units: [...unitsByRef.values()],\n derivedAt: input.derivedAt,\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"technical-documentation-publication-policy.d.ts","sourceRoot":"","sources":["../../../../../src/companion/application-documentation/technical-documentation-publication-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,6BAA6B,EAO7B,KAAK,gDAAgD,EACrD,KAAK,iDAAiD,EAGvD,MAAM,uDAAuD,CAAC;
|
|
1
|
+
{"version":3,"file":"technical-documentation-publication-policy.d.ts","sourceRoot":"","sources":["../../../../../src/companion/application-documentation/technical-documentation-publication-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,6BAA6B,EAO7B,KAAK,gDAAgD,EACrD,KAAK,iDAAiD,EAGvD,MAAM,uDAAuD,CAAC;AAsE/D,MAAM,WAAW,kDAAkD;IACjE,QAAQ,CAAC,iBAAiB,EAAE,iDAAiD,CAAC;IAC9E,QAAQ,CAAC,OAAO,EAAE,6BAA6B,CAAC,aAAa,CAAC;IAC9D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,2FAA2F;IAC3F,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,2EAA2E;AAC3E,wBAAgB,6CAA6C,CAC3D,KAAK,EAAE,kDAAkD,GACxD,gDAAgD,CA2ClD"}
|
package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.js
CHANGED
|
@@ -4,11 +4,17 @@ function recreateUnit(unit, overrides) {
|
|
|
4
4
|
return createTechnicalDocumentationUnitV1({ ...unit, ...overrides });
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
|
-
* Authorizes one
|
|
7
|
+
* Authorizes one unit for the public consumer portal.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* ONE rule set for every tier — engine pages, companion projections and the
|
|
10
|
+
* chapters an application authors (#874). An authored chapter is withheld by the
|
|
11
|
+
* same three checks as any other unit: not `APPROVED` (its author marked it a
|
|
12
|
+
* draft), applicability not proven, or provenance not `PUBLIC` (its author
|
|
13
|
+
* classified it `RESTRICTED`). There is deliberately no chapter-specific branch
|
|
14
|
+
* here: a second gate for one tier is a gate that drifts from the first.
|
|
15
|
+
*
|
|
16
|
+
* Authenticated/internal publication lanes remain absent; a `RESTRICTED` chapter
|
|
17
|
+
* is therefore withheld outright rather than routed to a private portal.
|
|
12
18
|
*/
|
|
13
19
|
function projectPublicUnit(sourceUnit, manifest) {
|
|
14
20
|
if (sourceUnit.editorialStatus !== TechnicalDocumentationEditorialStatus.APPROVED) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"technical-documentation-publication-policy.js","sourceRoot":"","sources":["../../../../../src/companion/application-documentation/technical-documentation-publication-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sCAAsC,EACtC,6BAA6B,EAC7B,qCAAqC,EACrC,yCAAyC,EACzC,uCAAuC,EACvC,0CAA0C,EAC1C,sDAAsD,EACtD,kCAAkC,GAKnC,MAAM,uDAAuD,CAAC;AAE/D,OAAO,EAAE,2CAA2C,EAAE,MAAM,gDAAgD,CAAC;AAS7G,SAAS,YAAY,CACnB,IAAkC,EAClC,SAAgD;IAEhD,OAAO,kCAAkC,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC;AACvE,CAAC;AAED;;;;;;GAMG;AACH,SAAS,iBAAiB,CACxB,UAAwC,EACxC,QAA2D;IAE3D,IAAI,UAAU,CAAC,eAAe,KAAK,qCAAqC,CAAC,QAAQ,EAAE,CAAC;QAClF,OAAO;YACL,UAAU;YACV,aAAa,EAAE,IAAI;YACnB,QAAQ,EAAE,yCAAyC,CAAC,QAAQ;YAC5D,MAAM,EAAE,uCAAuC,CAAC,sBAAsB;SACvE,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,2CAA2C,CAAC,UAAU,CAAC,yBAAyB,EAAE,QAAQ,CAAC,2BAA2B,CAAC,CAAC,UAAU,EAAE,CAAC;QACxI,OAAO;YACL,UAAU;YACV,aAAa,EAAE,IAAI;YACnB,QAAQ,EAAE,yCAAyC,CAAC,QAAQ;YAC5D,MAAM,EAAE,uCAAuC,CAAC,wBAAwB;SACzE,C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,oBAAoB,EAAE,SAAS,CAAC,aAAa,EAAE,WAAW,IAAI,IAAI;KACnE,CAAC,CAAC,CAAC;IAEJ,OAAO,sDAAsD,CAAC;QAC5D,aAAa,EAAE,CAAC;QAChB,OAAO,EAAE,6BAA6B,CAAC,aAAa;QACpD,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,kBAAkB,EAAE;YAClB,GAAG,EAAE,KAAK,CAAC,iBAAiB,CAAC,aAAa;YAC1C,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB;SACnD;QACD,KAAK;QACL,SAAS;KACV,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {\n TechnicalDocumentationAssetAccessClass,\n TechnicalDocumentationChannel,\n TechnicalDocumentationEditorialStatus,\n TechnicalDocumentationPublicationDecision,\n TechnicalDocumentationPublicationReason,\n TechnicalDocumentationSourceClassification,\n createTechnicalDocumentationAuthorizedBundleManifestV1,\n createTechnicalDocumentationUnitV1,\n type TechnicalDocumentationAuthorizedBundleManifestV1,\n type TechnicalDocumentationPrivateDerivationManifestV1,\n type TechnicalDocumentationUnitPublicationDecisionV1,\n type TechnicalDocumentationUnitV1,\n} from '@wildo-ai/saas-specifications/technical-documentation';\n\nimport { evaluateTechnicalDocumentationApplicability } from './technical-documentation-operational-evidence';\n\ninterface PolicyProjectionCandidate {\n readonly sourceUnit: TechnicalDocumentationUnitV1;\n readonly publishedUnit: TechnicalDocumentationUnitV1 | null;\n readonly decision: TechnicalDocumentationPublicationDecision;\n readonly reason: TechnicalDocumentationPublicationReason;\n}\n\nfunction recreateUnit(\n unit: TechnicalDocumentationUnitV1,\n overrides: Partial<TechnicalDocumentationUnitV1>,\n): TechnicalDocumentationUnitV1 {\n return createTechnicalDocumentationUnitV1({ ...unit, ...overrides });\n}\n\n/**\n * Authorizes one framework unit for the public consumer portal.\n *\n * Application editorial overlays and authenticated/internal publication lanes\n * are intentionally absent. Application-specific authoring will re-enter later\n * through the app-creator acceptance flow, not through this framework policy.\n */\nfunction projectPublicUnit(\n sourceUnit: TechnicalDocumentationUnitV1,\n manifest: TechnicalDocumentationPrivateDerivationManifestV1,\n): PolicyProjectionCandidate {\n if (sourceUnit.editorialStatus !== TechnicalDocumentationEditorialStatus.APPROVED) {\n return {\n sourceUnit,\n publishedUnit: null,\n decision: TechnicalDocumentationPublicationDecision.SUPPRESS,\n reason: TechnicalDocumentationPublicationReason.EDITORIAL_NOT_APPROVED,\n };\n }\n if (!evaluateTechnicalDocumentationApplicability(sourceUnit.applicabilityRequirements, manifest.environmentEvidenceSnapshot).applicable) {\n return {\n sourceUnit,\n publishedUnit: null,\n decision: TechnicalDocumentationPublicationDecision.SUPPRESS,\n reason: TechnicalDocumentationPublicationReason.APPLICABILITY_NOT_PROVEN,\n };\n }\n if (sourceUnit.provenance.some((source) => source.classification !== TechnicalDocumentationSourceClassification.PUBLIC)) {\n return {\n sourceUnit,\n publishedUnit: null,\n decision: TechnicalDocumentationPublicationDecision.SUPPRESS,\n reason: TechnicalDocumentationPublicationReason.RESTRICTED_SOURCE,\n };\n }\n\n const assetRequests = sourceUnit.assetRequests.filter((asset) => asset.accessClass === TechnicalDocumentationAssetAccessClass.PUBLIC);\n const redacted = assetRequests.length !== sourceUnit.assetRequests.length;\n return {\n sourceUnit,\n publishedUnit: recreateUnit(sourceUnit, { assetRequests }),\n decision: redacted ? TechnicalDocumentationPublicationDecision.REDACT : TechnicalDocumentationPublicationDecision.INCLUDE,\n reason: redacted ? TechnicalDocumentationPublicationReason.RESTRICTED_ASSET_REDACTED : TechnicalDocumentationPublicationReason.INCLUDED_BY_POLICY,\n };\n}\n\nexport interface ProjectTechnicalDocumentationAuthorizedBundleInput {\n readonly privateDerivation: TechnicalDocumentationPrivateDerivationManifestV1;\n readonly channel: TechnicalDocumentationChannel.PUBLIC_PORTAL;\n readonly policyRef: string;\n readonly policyVersion: number;\n /** This bundle's own identity; the render manifest and the publication pointer name it. */\n readonly bundleRef: string;\n readonly bundleVersion: number;\n}\n\n/** Projects and minimizes the public framework bundle before rendering. */\nexport function projectTechnicalDocumentationAuthorizedBundle(\n input: ProjectTechnicalDocumentationAuthorizedBundleInput,\n): TechnicalDocumentationAuthorizedBundleManifestV1 {\n const initial = input.privateDerivation.units.map((unit) => projectPublicUnit(unit, input.privateDerivation));\n const emittedUnitRefs = new Set(initial.flatMap((candidate) => candidate.publishedUnit === null ? [] : [candidate.publishedUnit.unitRef]));\n const finalized = initial.map((candidate) => {\n if (candidate.publishedUnit === null) return candidate;\n const links = candidate.publishedUnit.links.filter((link) => link.targetUnitRef === null || emittedUnitRefs.has(link.targetUnitRef));\n if (links.length === candidate.publishedUnit.links.length) return candidate;\n return {\n ...candidate,\n publishedUnit: recreateUnit(candidate.publishedUnit, { links }),\n decision: TechnicalDocumentationPublicationDecision.REDACT,\n reason: TechnicalDocumentationPublicationReason.ACCESS_CLASS_MISMATCH,\n };\n });\n const units = finalized.flatMap((candidate) => candidate.publishedUnit === null ? [] : [candidate.publishedUnit]);\n const decisions: TechnicalDocumentationUnitPublicationDecisionV1[] = finalized.map((candidate) => ({\n unitRef: candidate.sourceUnit.unitRef,\n decision: candidate.decision,\n reason: candidate.reason,\n /*\n * Both versions name the SAME unit version, and that is correct: a redaction narrows a unit's\n * content without minting a new authored version. `decision` is what distinguishes INCLUDE\n * from REDACT — it always was; the digest pair merely made the difference visible as two hex\n * strings nobody could read.\n */\n sourceUnitVersion: candidate.sourceUnit.unitVersion,\n publishedUnitVersion: candidate.publishedUnit?.unitVersion ?? null,\n }));\n\n return createTechnicalDocumentationAuthorizedBundleManifestV1({\n schemaVersion: 1,\n channel: TechnicalDocumentationChannel.PUBLIC_PORTAL,\n policyRef: input.policyRef,\n policyVersion: input.policyVersion,\n bundleRef: input.bundleRef,\n bundleVersion: input.bundleVersion,\n derivationIdentity: {\n ref: input.privateDerivation.derivationRef,\n version: input.privateDerivation.derivationVersion,\n },\n units,\n decisions,\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"technical-documentation-publication-policy.js","sourceRoot":"","sources":["../../../../../src/companion/application-documentation/technical-documentation-publication-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sCAAsC,EACtC,6BAA6B,EAC7B,qCAAqC,EACrC,yCAAyC,EACzC,uCAAuC,EACvC,0CAA0C,EAC1C,sDAAsD,EACtD,kCAAkC,GAKnC,MAAM,uDAAuD,CAAC;AAE/D,OAAO,EAAE,2CAA2C,EAAE,MAAM,gDAAgD,CAAC;AAS7G,SAAS,YAAY,CACnB,IAAkC,EAClC,SAAgD;IAEhD,OAAO,kCAAkC,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC;AACvE,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAS,iBAAiB,CACxB,UAAwC,EACxC,QAA2D;IAE3D,IAAI,UAAU,CAAC,eAAe,KAAK,qCAAqC,CAAC,QAAQ,EAAE,CAAC;QAClF,OAAO;YACL,UAAU;YACV,aAAa,EAAE,IAAI;YACnB,QAAQ,EAAE,yCAAyC,CAAC,QAAQ;YAC5D,MAAM,EAAE,uCAAuC,CAAC,sBAAsB;SACvE,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,2CAA2C,CAAC,UAAU,CAAC,yBAAyB,EAAE,QAAQ,CAAC,2BAA2B,CAAC,CAAC,UAAU,EAAE,CAAC;QACxI,OAAO;YACL,UAAU;YACV,aAAa,EAAE,IAAI;YACnB,QAAQ,EAAE,yCAAyC,CAAC,QAAQ;YAC5D,MAAM,EAAE,uCAAuC,CAAC,wBAAwB;SACzE,CAAC;IACJ,CAAC;IACD,IAAI,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,cAAc,KAAK,0CAA0C,CAAC,MAAM,CAAC,EAAE,CAAC;QACxH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CAAC,aAAa;QACpD,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,kBAAkB,EAAE;YAClB,GAAG,EAAE,KAAK,CAAC,iBAAiB,CAAC,aAAa;YAC1C,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB;SACnD;QACD,KAAK;QACL,SAAS;KACV,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {\n TechnicalDocumentationAssetAccessClass,\n TechnicalDocumentationChannel,\n TechnicalDocumentationEditorialStatus,\n TechnicalDocumentationPublicationDecision,\n TechnicalDocumentationPublicationReason,\n TechnicalDocumentationSourceClassification,\n createTechnicalDocumentationAuthorizedBundleManifestV1,\n createTechnicalDocumentationUnitV1,\n type TechnicalDocumentationAuthorizedBundleManifestV1,\n type TechnicalDocumentationPrivateDerivationManifestV1,\n type TechnicalDocumentationUnitPublicationDecisionV1,\n type TechnicalDocumentationUnitV1,\n} from '@wildo-ai/saas-specifications/technical-documentation';\n\nimport { evaluateTechnicalDocumentationApplicability } from './technical-documentation-operational-evidence';\n\ninterface PolicyProjectionCandidate {\n readonly sourceUnit: TechnicalDocumentationUnitV1;\n readonly publishedUnit: TechnicalDocumentationUnitV1 | null;\n readonly decision: TechnicalDocumentationPublicationDecision;\n readonly reason: TechnicalDocumentationPublicationReason;\n}\n\nfunction recreateUnit(\n unit: TechnicalDocumentationUnitV1,\n overrides: Partial<TechnicalDocumentationUnitV1>,\n): TechnicalDocumentationUnitV1 {\n return createTechnicalDocumentationUnitV1({ ...unit, ...overrides });\n}\n\n/**\n * Authorizes one unit for the public consumer portal.\n *\n * ONE rule set for every tier — engine pages, companion projections and the\n * chapters an application authors (#874). An authored chapter is withheld by the\n * same three checks as any other unit: not `APPROVED` (its author marked it a\n * draft), applicability not proven, or provenance not `PUBLIC` (its author\n * classified it `RESTRICTED`). There is deliberately no chapter-specific branch\n * here: a second gate for one tier is a gate that drifts from the first.\n *\n * Authenticated/internal publication lanes remain absent; a `RESTRICTED` chapter\n * is therefore withheld outright rather than routed to a private portal.\n */\nfunction projectPublicUnit(\n sourceUnit: TechnicalDocumentationUnitV1,\n manifest: TechnicalDocumentationPrivateDerivationManifestV1,\n): PolicyProjectionCandidate {\n if (sourceUnit.editorialStatus !== TechnicalDocumentationEditorialStatus.APPROVED) {\n return {\n sourceUnit,\n publishedUnit: null,\n decision: TechnicalDocumentationPublicationDecision.SUPPRESS,\n reason: TechnicalDocumentationPublicationReason.EDITORIAL_NOT_APPROVED,\n };\n }\n if (!evaluateTechnicalDocumentationApplicability(sourceUnit.applicabilityRequirements, manifest.environmentEvidenceSnapshot).applicable) {\n return {\n sourceUnit,\n publishedUnit: null,\n decision: TechnicalDocumentationPublicationDecision.SUPPRESS,\n reason: TechnicalDocumentationPublicationReason.APPLICABILITY_NOT_PROVEN,\n };\n }\n if (sourceUnit.provenance.some((source) => source.classification !== TechnicalDocumentationSourceClassification.PUBLIC)) {\n return {\n sourceUnit,\n publishedUnit: null,\n decision: TechnicalDocumentationPublicationDecision.SUPPRESS,\n reason: TechnicalDocumentationPublicationReason.RESTRICTED_SOURCE,\n };\n }\n\n const assetRequests = sourceUnit.assetRequests.filter((asset) => asset.accessClass === TechnicalDocumentationAssetAccessClass.PUBLIC);\n const redacted = assetRequests.length !== sourceUnit.assetRequests.length;\n return {\n sourceUnit,\n publishedUnit: recreateUnit(sourceUnit, { assetRequests }),\n decision: redacted ? TechnicalDocumentationPublicationDecision.REDACT : TechnicalDocumentationPublicationDecision.INCLUDE,\n reason: redacted ? TechnicalDocumentationPublicationReason.RESTRICTED_ASSET_REDACTED : TechnicalDocumentationPublicationReason.INCLUDED_BY_POLICY,\n };\n}\n\nexport interface ProjectTechnicalDocumentationAuthorizedBundleInput {\n readonly privateDerivation: TechnicalDocumentationPrivateDerivationManifestV1;\n readonly channel: TechnicalDocumentationChannel.PUBLIC_PORTAL;\n readonly policyRef: string;\n readonly policyVersion: number;\n /** This bundle's own identity; the render manifest and the publication pointer name it. */\n readonly bundleRef: string;\n readonly bundleVersion: number;\n}\n\n/** Projects and minimizes the public framework bundle before rendering. */\nexport function projectTechnicalDocumentationAuthorizedBundle(\n input: ProjectTechnicalDocumentationAuthorizedBundleInput,\n): TechnicalDocumentationAuthorizedBundleManifestV1 {\n const initial = input.privateDerivation.units.map((unit) => projectPublicUnit(unit, input.privateDerivation));\n const emittedUnitRefs = new Set(initial.flatMap((candidate) => candidate.publishedUnit === null ? [] : [candidate.publishedUnit.unitRef]));\n const finalized = initial.map((candidate) => {\n if (candidate.publishedUnit === null) return candidate;\n const links = candidate.publishedUnit.links.filter((link) => link.targetUnitRef === null || emittedUnitRefs.has(link.targetUnitRef));\n if (links.length === candidate.publishedUnit.links.length) return candidate;\n return {\n ...candidate,\n publishedUnit: recreateUnit(candidate.publishedUnit, { links }),\n decision: TechnicalDocumentationPublicationDecision.REDACT,\n reason: TechnicalDocumentationPublicationReason.ACCESS_CLASS_MISMATCH,\n };\n });\n const units = finalized.flatMap((candidate) => candidate.publishedUnit === null ? [] : [candidate.publishedUnit]);\n const decisions: TechnicalDocumentationUnitPublicationDecisionV1[] = finalized.map((candidate) => ({\n unitRef: candidate.sourceUnit.unitRef,\n decision: candidate.decision,\n reason: candidate.reason,\n /*\n * Both versions name the SAME unit version, and that is correct: a redaction narrows a unit's\n * content without minting a new authored version. `decision` is what distinguishes INCLUDE\n * from REDACT — it always was; the digest pair merely made the difference visible as two hex\n * strings nobody could read.\n */\n sourceUnitVersion: candidate.sourceUnit.unitVersion,\n publishedUnitVersion: candidate.publishedUnit?.unitVersion ?? null,\n }));\n\n return createTechnicalDocumentationAuthorizedBundleManifestV1({\n schemaVersion: 1,\n channel: TechnicalDocumentationChannel.PUBLIC_PORTAL,\n policyRef: input.policyRef,\n policyVersion: input.policyVersion,\n bundleRef: input.bundleRef,\n bundleVersion: input.bundleVersion,\n derivationIdentity: {\n ref: input.privateDerivation.derivationRef,\n version: input.privateDerivation.derivationVersion,\n },\n units,\n decisions,\n });\n}\n"]}
|
|
@@ -32,10 +32,12 @@ export * from './rendering/technical-documentation-render-model';
|
|
|
32
32
|
export * from './rendering/technical-documentation-search-index-renderer';
|
|
33
33
|
export * from './application-documentation/technical-documentation-engine-content-bundle';
|
|
34
34
|
export * from './application-documentation/application-domain-documentation';
|
|
35
|
+
export * from './application-documentation/application-documentation-chapters';
|
|
35
36
|
export * from './application-documentation/application-integration-documentation';
|
|
36
37
|
export * from './application-documentation/application-administration-documentation';
|
|
37
38
|
export * from './application-documentation/application-authentication-documentation';
|
|
38
39
|
export * from './application-documentation/application-connection-documentation';
|
|
40
|
+
export * from './application-documentation/docs-api-origin-substitution';
|
|
39
41
|
export * from './application-documentation/application-organization-role-documentation';
|
|
40
42
|
export * from './application-documentation/application-organization-unit-resource-documentation';
|
|
41
43
|
export * from './application-documentation/technical-documentation-operational-evidence';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/companion/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,sCAAsC,CAAC;AACrD,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6DAA6D,CAAC;AAC5E,cAAc,kDAAkD,CAAC;AACjE,cAAc,sCAAsC,CAAC;AACrD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,oDAAoD,CAAC;AACnE,cAAc,8DAA8D,CAAC;AAC7E,cAAc,yDAAyD,CAAC;AACxE,cAAc,uDAAuD,CAAC;AACtE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,sDAAsD,CAAC;AACrE,cAAc,kDAAkD,CAAC;AACjE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,2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32,10 +32,12 @@ export * from './rendering/technical-documentation-render-model.js';
|
|
|
32
32
|
export * from './rendering/technical-documentation-search-index-renderer.js';
|
|
33
33
|
export * from './application-documentation/technical-documentation-engine-content-bundle.js';
|
|
34
34
|
export * from './application-documentation/application-domain-documentation.js';
|
|
35
|
+
export * from './application-documentation/application-documentation-chapters.js';
|
|
35
36
|
export * from './application-documentation/application-integration-documentation.js';
|
|
36
37
|
export * from './application-documentation/application-administration-documentation.js';
|
|
37
38
|
export * from './application-documentation/application-authentication-documentation.js';
|
|
38
39
|
export * from './application-documentation/application-connection-documentation.js';
|
|
40
|
+
export * from './application-documentation/docs-api-origin-substitution.js';
|
|
39
41
|
export * from './application-documentation/application-organization-role-documentation.js';
|
|
40
42
|
export * from './application-documentation/application-organization-unit-resource-documentation.js';
|
|
41
43
|
export * from './application-documentation/technical-documentation-operational-evidence.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/companion/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,sCAAsC,CAAC;AACrD,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6DAA6D,CAAC;AAC5E,cAAc,kDAAkD,CAAC;AACjE,cAAc,sCAAsC,CAAC;AACrD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,oDAAoD,CAAC;AACnE,cAAc,8DAA8D,CAAC;AAC7E,cAAc,yDAAyD,CAAC;AACxE,cAAc,uDAAuD,CAAC;AACtE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,sDAAsD,CAAC;AACrE,cAAc,kDAAkD,CAAC;AACjE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,2EAA2E,CAAC;AAC1F,cAAc,8DAA8D,CAAC;AAC7E,cAAc,mEAAmE,CAAC;AAClF,cAAc,sEAAsE,CAAC;AACrF,cAAc,sEAAsE,CAAC;AACrF,cAAc,kEAAkE,CAAC;AACjF,cAAc,yEAAyE,CAAC;AACxF,cAAc,kFAAkF,CAAC;AACjG,cAAc,0EAA0E,CAAC;AACzF,cAAc,wEAAwE,CAAC;AACvF,cAAc,wEAAwE,CAAC","sourcesContent":["/**\n * `@wildo-ai/saas-technical-doc/companion` — implementation surface.\n *\n * Pure-function OpenAPI projection, its input contract, and Node-side verification/materialization utilities for an exact engine-owned\n * application-consumer documentation content bundle. Consumed by:\n * - `examples/<app>/.wildo-saas/wildo-dev-companion/` controllers\n * that call `generateOpenApiDocuments(input)` to produce\n * the normal and application-administration YAML/JSON OpenAPI documents.\n *\n * @wildo-boundary\n * Re-exports only companion-side OpenAPI and application-consumer content projection surfaces. All are React-free; the content loader is Node-only and\n * never enters the browser runtime closure. Reusable authored content and portable identities are owned by the separate `./content`\n * entry point.\n */\n\nexport * from './operation-projection.schemas';\nexport * from './openapi-generator';\nexport * from './manual-controller-route-projection';\nexport * from './publish-result.types';\nexport * from './zod-to-openapi';\nexport * from './spec-to-operation-doc';\nexport * from './content/application-consumer-documentation-content-loader';\nexport * from './technical-documentation-capture-execution-port';\nexport * from './technical-documentation-asset-path';\nexport * from './technical-documentation-diagram-materializer';\nexport * from './technical-documentation-placeholder-materializer';\nexport * from './rendering/technical-documentation-authorized-bundle-reader';\nexport * from './rendering/technical-documentation-docusaurus-renderer';\nexport * from './rendering/technical-documentation-build-measurement';\nexport * from './rendering/technical-documentation-managed-tree-validator';\nexport * from './rendering/technical-documentation-openapi-renderer';\nexport * from './rendering/technical-documentation-render-model';\nexport * from './rendering/technical-documentation-search-index-renderer';\nexport * from './application-documentation/technical-documentation-engine-content-bundle';\nexport * from './application-documentation/application-domain-documentation';\nexport * from './application-documentation/application-integration-documentation';\nexport * from './application-documentation/application-administration-documentation';\nexport * from './application-documentation/application-authentication-documentation';\nexport * from './application-documentation/application-connection-documentation';\nexport * from './application-documentation/application-organization-role-documentation';\nexport * from './application-documentation/application-organization-unit-resource-documentation';\nexport * from './application-documentation/technical-documentation-operational-evidence';\nexport * from './application-documentation/technical-documentation-private-derivation';\nexport * from './application-documentation/technical-documentation-publication-policy';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/companion/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,sCAAsC,CAAC;AACrD,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6DAA6D,CAAC;AAC5E,cAAc,kDAAkD,CAAC;AACjE,cAAc,sCAAsC,CAAC;AACrD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,oDAAoD,CAAC;AACnE,cAAc,8DAA8D,CAAC;AAC7E,cAAc,yDAAyD,CAAC;AACxE,cAAc,uDAAuD,CAAC;AACtE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,sDAAsD,CAAC;AACrE,cAAc,kDAAkD,CAAC;AACjE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,2EAA2E,CAAC;AAC1F,cAAc,8DAA8D,CAAC;AAC7E,cAAc,gEAAgE,CAAC;AAC/E,cAAc,mEAAmE,CAAC;AAClF,cAAc,sEAAsE,CAAC;AACrF,cAAc,sEAAsE,CAAC;AACrF,cAAc,kEAAkE,CAAC;AACjF,cAAc,0DAA0D,CAAC;AACzE,cAAc,yEAAyE,CAAC;AACxF,cAAc,kFAAkF,CAAC;AACjG,cAAc,0EAA0E,CAAC;AACzF,cAAc,wEAAwE,CAAC;AACvF,cAAc,wEAAwE,CAAC","sourcesContent":["/**\n * `@wildo-ai/saas-technical-doc/companion` — implementation surface.\n *\n * Pure-function OpenAPI projection, its input contract, and Node-side verification/materialization utilities for an exact engine-owned\n * application-consumer documentation content bundle. Consumed by:\n * - `examples/<app>/.wildo-saas/wildo-dev-companion/` controllers\n * that call `generateOpenApiDocuments(input)` to produce\n * the normal and application-administration YAML/JSON OpenAPI documents.\n *\n * @wildo-boundary\n * Re-exports only companion-side OpenAPI and application-consumer content projection surfaces. All are React-free; the content loader is Node-only and\n * never enters the browser runtime closure. Reusable authored content and portable identities are owned by the separate `./content`\n * entry point.\n */\n\nexport * from './operation-projection.schemas';\nexport * from './openapi-generator';\nexport * from './manual-controller-route-projection';\nexport * from './publish-result.types';\nexport * from './zod-to-openapi';\nexport * from './spec-to-operation-doc';\nexport * from './content/application-consumer-documentation-content-loader';\nexport * from './technical-documentation-capture-execution-port';\nexport * from './technical-documentation-asset-path';\nexport * from './technical-documentation-diagram-materializer';\nexport * from './technical-documentation-placeholder-materializer';\nexport * from './rendering/technical-documentation-authorized-bundle-reader';\nexport * from './rendering/technical-documentation-docusaurus-renderer';\nexport * from './rendering/technical-documentation-build-measurement';\nexport * from './rendering/technical-documentation-managed-tree-validator';\nexport * from './rendering/technical-documentation-openapi-renderer';\nexport * from './rendering/technical-documentation-render-model';\nexport * from './rendering/technical-documentation-search-index-renderer';\nexport * from './application-documentation/technical-documentation-engine-content-bundle';\nexport * from './application-documentation/application-domain-documentation';\nexport * from './application-documentation/application-documentation-chapters';\nexport * from './application-documentation/application-integration-documentation';\nexport * from './application-documentation/application-administration-documentation';\nexport * from './application-documentation/application-authentication-documentation';\nexport * from './application-documentation/application-connection-documentation';\nexport * from './application-documentation/docs-api-origin-substitution';\nexport * from './application-documentation/application-organization-role-documentation';\nexport * from './application-documentation/application-organization-unit-resource-documentation';\nexport * from './application-documentation/technical-documentation-operational-evidence';\nexport * from './application-documentation/technical-documentation-private-derivation';\nexport * from './application-documentation/technical-documentation-publication-policy';\n"]}
|
|
@@ -35,10 +35,14 @@
|
|
|
35
35
|
* cross this contract.
|
|
36
36
|
*
|
|
37
37
|
* @wildo-boundary
|
|
38
|
-
* Imports
|
|
39
|
-
* projection contract, the lightweight public runtime constants
|
|
40
|
-
* specification-prose cleanup. No serializer
|
|
41
|
-
* barrel
|
|
38
|
+
* Imports the portable OpenAPI output contract, the local operation
|
|
39
|
+
* projection contract, the lightweight public runtime constants (header
|
|
40
|
+
* keys) and specification-prose cleanup. No serializer or React enters this
|
|
41
|
+
* semantic generator. The saas-models ROOT barrel does, for the atoms not
|
|
42
|
+
* carved into `public-runtime`: the error definitions, collection query
|
|
43
|
+
* parameters, pagination request schema, the M2M webhook delivery contract
|
|
44
|
+
* and the Idempotency-Key vocabulary. A module has ONE public door, so the
|
|
45
|
+
* vocabulary is not re-exported from `public-runtime` as well.
|
|
42
46
|
*/
|
|
43
47
|
import { OpenApiSection, type OpenApiGenerationOutput } from '../openapi/openapi-generation-output.schemas';
|
|
44
48
|
import { type OperationProjection } from './operation-projection.schemas';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openapi-generator.d.ts","sourceRoot":"","sources":["../../../../src/companion/openapi-generator.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"openapi-generator.d.ts","sourceRoot":"","sources":["../../../../src/companion/openapi-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAeH,OAAO,EACL,cAAc,EACd,KAAK,uBAAuB,EAE7B,MAAM,8CAA8C,CAAC;AAEtD,OAAO,EAOL,KAAK,mBAAmB,EACzB,MAAM,gCAAgC,CAAC;AAIxC;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,aAAa,CAAC,mBAAmB,CAAC,GAC7C,aAAa,CAAC,mBAAmB,CAAC,CAUpC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mCAAmC,CACjD,UAAU,EAAE,aAAa,CAAC,mBAAmB,CAAC,GAC7C,QAAQ,CAAC,MAAM,CAAC,cAAc,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAqBtE;AAy7CD;;;;;;;;;;;GAWG;AACH,oBAAY,0BAA0B;IACpC,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAmkBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,OAAO,GAAG,uBAAuB,CAyBnF"}
|
|
@@ -35,13 +35,17 @@
|
|
|
35
35
|
* cross this contract.
|
|
36
36
|
*
|
|
37
37
|
* @wildo-boundary
|
|
38
|
-
* Imports
|
|
39
|
-
* projection contract, the lightweight public runtime constants
|
|
40
|
-
* specification-prose cleanup. No serializer
|
|
41
|
-
* barrel
|
|
38
|
+
* Imports the portable OpenAPI output contract, the local operation
|
|
39
|
+
* projection contract, the lightweight public runtime constants (header
|
|
40
|
+
* keys) and specification-prose cleanup. No serializer or React enters this
|
|
41
|
+
* semantic generator. The saas-models ROOT barrel does, for the atoms not
|
|
42
|
+
* carved into `public-runtime`: the error definitions, collection query
|
|
43
|
+
* parameters, pagination request schema, the M2M webhook delivery contract
|
|
44
|
+
* and the Idempotency-Key vocabulary. A module has ONE public door, so the
|
|
45
|
+
* vocabulary is not re-exported from `public-runtime` as well.
|
|
42
46
|
*/
|
|
43
47
|
import { WildoHeaderKeys } from '@wildo-ai/saas-models/public-runtime';
|
|
44
|
-
import { COLLECTION_QUERY_PARAMETERS, ERROR_DEFINITIONS, ErrorHandling_Strategy, ErrorSeverity, ErrorType, M2M_WEBHOOK_DELIVERY_CONTRACT, Resources_PaginationRequestSchema, } from '@wildo-ai/saas-models';
|
|
48
|
+
import { COLLECTION_QUERY_PARAMETERS, ERROR_DEFINITIONS, IDEMPOTENCY_KEY_MAX_LENGTH, IdempotencyKeyRefusalCode, ErrorHandling_Strategy, ErrorSeverity, ErrorType, M2M_WEBHOOK_DELIVERY_CONTRACT, Resources_PaginationRequestSchema, } from '@wildo-ai/saas-models';
|
|
45
49
|
import { OpenApiSection, } from '../openapi/openapi-generation-output.schemas.js';
|
|
46
50
|
import { OpenApiGenerationInputSchema, OPENAPI_RESOURCE_IDENTITY_CONTRACT_VERSION, OperationProjectionAuthenticationMode, OperationProjectionVariantType, } from './operation-projection.schemas.js';
|
|
47
51
|
import { stripImplementationNoise } from './spec-to-operation-doc.js';
|
|
@@ -836,6 +840,19 @@ function buildOperationObject(op, operationId, errorResponseSchema) {
|
|
|
836
840
|
+ 'Required for this sensitive operation and consumed when the request is authorized.',
|
|
837
841
|
});
|
|
838
842
|
}
|
|
843
|
+
if (op.idempotencyKey !== undefined) {
|
|
844
|
+
parameters.push({
|
|
845
|
+
name: op.idempotencyKey.headerName,
|
|
846
|
+
in: 'header',
|
|
847
|
+
required: op.idempotencyKey.required,
|
|
848
|
+
schema: { type: 'string', minLength: 1 },
|
|
849
|
+
examples: { 'One key per intended change': { value: '"8e03978e-40d5-43e8-bc93-6894a57f9324"' } },
|
|
850
|
+
description: 'Your identity for this one intended change: a quoted string (or a bare token) of 1 to '
|
|
851
|
+
+ `${IDEMPOTENCY_KEY_MAX_LENGTH} printable ASCII characters (a UUID is typical). Send a new key for each new change and `
|
|
852
|
+
+ 'the SAME key when you retry it, so a retry after a lost response receives the first outcome instead of running again.'
|
|
853
|
+
+ (op.idempotencyKey.required ? ' Required: a request without it is refused.' : ' Optional: a request without it runs, but its retries are not deduplicated.'),
|
|
854
|
+
});
|
|
855
|
+
}
|
|
839
856
|
if (op.acceptsIfMatch) {
|
|
840
857
|
parameters.push({
|
|
841
858
|
name: WildoHeaderKeys.IF_MATCH,
|
|
@@ -986,6 +1003,10 @@ const FRAMEWORK_OWNED_PROPERTY_DESCRIPTIONS = Object.freeze({
|
|
|
986
1003
|
createdAt: 'When the record was created, set by the application and never accepted from a client.',
|
|
987
1004
|
updatedAt: 'When the record last changed, set by the application on every write.',
|
|
988
1005
|
organizationId: 'The organization this record belongs to. It scopes every read and write: a caller only ever addresses records in an organization they are a member of.',
|
|
1006
|
+
// retention-authority: N/A — an API consumer's ENGLISH description of what the two values mean,
|
|
1007
|
+
// rendered into the OpenAPI document. There is no emitter to consume here: the audience is a
|
|
1008
|
+
// person reading a schema, and the sentence has to say `active` and `retained` in words for the
|
|
1009
|
+
// document to be worth anything. It decides nothing and is read by no code.
|
|
989
1010
|
retentionStatus: 'Whether the record is still `active` or has been `retained` — kept for a legal or accounting obligation after the person it concerned was erased. A retained record has had its personal detail removed.',
|
|
990
1011
|
impersonalizedAt: 'When personal detail was stripped from this record, if it ever was. Absent on a record that has not been through erasure.',
|
|
991
1012
|
data: 'The page of records this response carries.',
|
|
@@ -1193,19 +1214,24 @@ function buildResponsesObject(op, responseBodySchema, errorResponseSchema) {
|
|
|
1193
1214
|
};
|
|
1194
1215
|
}
|
|
1195
1216
|
}
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
};
|
|
1217
|
+
// A framework-owned outcome merged into an operation's response map, beside whatever its specification authored.
|
|
1218
|
+
const mergeFrameworkError = (code, description) => {
|
|
1219
|
+
const existing = responses[code];
|
|
1220
|
+
if (isPlainObject(existing) && typeof existing['description'] === 'string') {
|
|
1221
|
+
existing['description'] = `${existing['description']}\n\n${description}`;
|
|
1222
|
+
existing['content'] = { 'application/json': { schema: errorResponseSchema } };
|
|
1223
|
+
return;
|
|
1224
|
+
}
|
|
1225
|
+
responses[code] = {
|
|
1226
|
+
description,
|
|
1227
|
+
content: { 'application/json': { schema: errorResponseSchema } },
|
|
1208
1228
|
};
|
|
1229
|
+
};
|
|
1230
|
+
if (op.idempotencyKey !== undefined) {
|
|
1231
|
+
mergeFrameworkError('400', `The \`${op.idempotencyKey.headerName}\` header is malformed (\`error.code\` \`${IdempotencyKeyRefusalCode.MALFORMED}\`)`
|
|
1232
|
+
+ (op.idempotencyKey.required ? `, or missing (\`${IdempotencyKeyRefusalCode.REQUIRED}\`).` : '.'));
|
|
1233
|
+
}
|
|
1234
|
+
if (op.acceptsIfMatch) {
|
|
1209
1235
|
mergeFrameworkError('400', 'The optional `If-Match` header is present but does not contain a non-negative integer resource version.');
|
|
1210
1236
|
mergeFrameworkError('409', 'The `If-Match` version no longer matches the current resource version, so the mutation was not applied.');
|
|
1211
1237
|
}
|