@techspokes/typescript-wsdl-client 1.1.4 → 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/README.md +49 -1
- package/dist/app/generateApp.d.ts.map +1 -1
- package/dist/app/generateApp.js +8 -6
- package/dist/cli.js +49 -5
- package/dist/client/checkedDirectRuntime.d.ts +59 -0
- package/dist/client/checkedDirectRuntime.d.ts.map +1 -0
- package/dist/client/checkedDirectRuntime.js +23 -0
- package/dist/client/directClientRuntime.d.ts +49 -0
- package/dist/client/directClientRuntime.d.ts.map +1 -0
- package/dist/client/directClientRuntime.js +112 -0
- package/dist/client/directClientVersion.d.ts +4 -0
- package/dist/client/directClientVersion.d.ts.map +1 -0
- package/dist/client/directClientVersion.js +3 -0
- package/dist/client/generateDirectClient.d.ts +14 -0
- package/dist/client/generateDirectClient.d.ts.map +1 -0
- package/dist/client/generateDirectClient.js +136 -0
- package/dist/compiler/buildCanonicalGraph.d.ts +7 -0
- package/dist/compiler/buildCanonicalGraph.d.ts.map +1 -0
- package/dist/compiler/buildCanonicalGraph.js +381 -0
- package/dist/compiler/canonicalGraph.d.ts +198 -0
- package/dist/compiler/canonicalGraph.d.ts.map +1 -0
- package/dist/compiler/canonicalGraph.js +37 -0
- package/dist/compiler/catalogErrors.d.ts +18 -0
- package/dist/compiler/catalogErrors.d.ts.map +1 -0
- package/dist/compiler/catalogErrors.js +86 -0
- package/dist/compiler/catalogProvenance.d.ts +15 -0
- package/dist/compiler/catalogProvenance.d.ts.map +1 -0
- package/dist/compiler/catalogProvenance.js +229 -0
- package/dist/compiler/checkedAssessment.d.ts +91 -0
- package/dist/compiler/checkedAssessment.d.ts.map +1 -0
- package/dist/compiler/checkedAssessment.js +300 -0
- package/dist/compiler/checkedSourcePreparation.d.ts +35 -0
- package/dist/compiler/checkedSourcePreparation.d.ts.map +1 -0
- package/dist/compiler/checkedSourcePreparation.js +131 -0
- package/dist/compiler/complexTypeContent.d.ts +59 -0
- package/dist/compiler/complexTypeContent.d.ts.map +1 -0
- package/dist/compiler/complexTypeContent.js +558 -0
- package/dist/compiler/composeCanonicalGraph.d.ts +69 -0
- package/dist/compiler/composeCanonicalGraph.d.ts.map +1 -0
- package/dist/compiler/composeCanonicalGraph.js +252 -0
- package/dist/compiler/dataOwnership.d.ts +22 -0
- package/dist/compiler/dataOwnership.d.ts.map +1 -0
- package/dist/compiler/dataOwnership.js +157 -0
- package/dist/compiler/datatypeValues.d.ts +47 -0
- package/dist/compiler/datatypeValues.d.ts.map +1 -0
- package/dist/compiler/datatypeValues.js +275 -0
- package/dist/compiler/directCodec.d.ts +59 -0
- package/dist/compiler/directCodec.d.ts.map +1 -0
- package/dist/compiler/directCodec.js +192 -0
- package/dist/compiler/directExecutionPolicy.d.ts +10 -0
- package/dist/compiler/directExecutionPolicy.d.ts.map +1 -0
- package/dist/compiler/directExecutionPolicy.js +17 -0
- package/dist/compiler/directOperation.d.ts +72 -0
- package/dist/compiler/directOperation.d.ts.map +1 -0
- package/dist/compiler/directOperation.js +282 -0
- package/dist/compiler/directSoap.d.ts +42 -0
- package/dist/compiler/directSoap.d.ts.map +1 -0
- package/dist/compiler/directSoap.js +298 -0
- package/dist/compiler/directSoapSource.d.ts +15 -0
- package/dist/compiler/directSoapSource.d.ts.map +1 -0
- package/dist/compiler/directSoapSource.js +86 -0
- package/dist/compiler/directSourceCapsule.d.ts +97 -0
- package/dist/compiler/directSourceCapsule.d.ts.map +1 -0
- package/dist/compiler/directSourceCapsule.js +305 -0
- package/dist/compiler/directStructure.d.ts +51 -0
- package/dist/compiler/directStructure.d.ts.map +1 -0
- package/dist/compiler/directStructure.js +252 -0
- package/dist/compiler/directStructurePlan.d.ts +16 -0
- package/dist/compiler/directStructurePlan.d.ts.map +1 -0
- package/dist/compiler/directStructurePlan.js +58 -0
- package/dist/compiler/directValues.d.ts +69 -0
- package/dist/compiler/directValues.d.ts.map +1 -0
- package/dist/compiler/directValues.js +282 -0
- package/dist/compiler/finiteRe01Verification.d.ts +140 -0
- package/dist/compiler/finiteRe01Verification.d.ts.map +1 -0
- package/dist/compiler/finiteRe01Verification.js +830 -0
- package/dist/compiler/graphTraversal.d.ts +11 -0
- package/dist/compiler/graphTraversal.d.ts.map +1 -0
- package/dist/compiler/graphTraversal.js +37 -0
- package/dist/compiler/hypotheticalScopedIdentity.d.ts +23 -0
- package/dist/compiler/hypotheticalScopedIdentity.d.ts.map +1 -0
- package/dist/compiler/hypotheticalScopedIdentity.js +81 -0
- package/dist/compiler/occurrenceAnalysis.d.ts +65 -0
- package/dist/compiler/occurrenceAnalysis.d.ts.map +1 -0
- package/dist/compiler/occurrenceAnalysis.js +300 -0
- package/dist/compiler/originalSourceMembership.d.ts +6 -0
- package/dist/compiler/originalSourceMembership.d.ts.map +1 -0
- package/dist/compiler/originalSourceMembership.js +31 -0
- package/dist/compiler/particleAttribution.d.ts +17 -0
- package/dist/compiler/particleAttribution.d.ts.map +1 -0
- package/dist/compiler/particleAttribution.js +474 -0
- package/dist/compiler/particleDeclarationConsistency.d.ts +24 -0
- package/dist/compiler/particleDeclarationConsistency.d.ts.map +1 -0
- package/dist/compiler/particleDeclarationConsistency.js +197 -0
- package/dist/compiler/particleExtension.d.ts +22 -0
- package/dist/compiler/particleExtension.d.ts.map +1 -0
- package/dist/compiler/particleExtension.js +119 -0
- package/dist/compiler/particleLocalAssessment.d.ts +20 -0
- package/dist/compiler/particleLocalAssessment.d.ts.map +1 -0
- package/dist/compiler/particleLocalAssessment.js +92 -0
- package/dist/compiler/particleRestriction.d.ts +24 -0
- package/dist/compiler/particleRestriction.d.ts.map +1 -0
- package/dist/compiler/particleRestriction.js +489 -0
- package/dist/compiler/particleSemanticView.d.ts +50 -0
- package/dist/compiler/particleSemanticView.d.ts.map +1 -0
- package/dist/compiler/particleSemanticView.js +297 -0
- package/dist/compiler/particleWildcardRelation.d.ts +88 -0
- package/dist/compiler/particleWildcardRelation.d.ts.map +1 -0
- package/dist/compiler/particleWildcardRelation.js +143 -0
- package/dist/compiler/re01CandidateCorrespondence.d.ts +64 -0
- package/dist/compiler/re01CandidateCorrespondence.d.ts.map +1 -0
- package/dist/compiler/re01CandidateCorrespondence.js +572 -0
- package/dist/compiler/re01TypeProperties.d.ts +71 -0
- package/dist/compiler/re01TypeProperties.d.ts.map +1 -0
- package/dist/compiler/re01TypeProperties.js +120 -0
- package/dist/compiler/re01TypePropertyValidation.d.ts +23 -0
- package/dist/compiler/re01TypePropertyValidation.d.ts.map +1 -0
- package/dist/compiler/re01TypePropertyValidation.js +161 -0
- package/dist/compiler/resolveCanonicalGraph.d.ts +38 -0
- package/dist/compiler/resolveCanonicalGraph.d.ts.map +1 -0
- package/dist/compiler/resolveCanonicalGraph.js +170 -0
- package/dist/compiler/scalarSchemaAssessment.d.ts +425 -0
- package/dist/compiler/scalarSchemaAssessment.d.ts.map +1 -0
- package/dist/compiler/scalarSchemaAssessment.js +5198 -0
- package/dist/compiler/schemaAttributeGroupProperties.d.ts +17 -0
- package/dist/compiler/schemaAttributeGroupProperties.d.ts.map +1 -0
- package/dist/compiler/schemaAttributeGroupProperties.js +53 -0
- package/dist/compiler/schemaAttributeProperties.d.ts +10 -0
- package/dist/compiler/schemaAttributeProperties.d.ts.map +1 -0
- package/dist/compiler/schemaAttributeProperties.js +11 -0
- package/dist/compiler/schemaAttributeUses.d.ts +90 -0
- package/dist/compiler/schemaAttributeUses.d.ts.map +1 -0
- package/dist/compiler/schemaAttributeUses.js +725 -0
- package/dist/compiler/schemaBinaryWordReconstruction.d.ts +10 -0
- package/dist/compiler/schemaBinaryWordReconstruction.d.ts.map +1 -0
- package/dist/compiler/schemaBinaryWordReconstruction.js +33 -0
- package/dist/compiler/schemaBuiltinFacets.d.ts +14 -0
- package/dist/compiler/schemaBuiltinFacets.d.ts.map +1 -0
- package/dist/compiler/schemaBuiltinFacets.js +51 -0
- package/dist/compiler/schemaCalendarImages.d.ts +8 -0
- package/dist/compiler/schemaCalendarImages.d.ts.map +1 -0
- package/dist/compiler/schemaCalendarImages.js +204 -0
- package/dist/compiler/schemaCalendarLanguage.d.ts +11 -0
- package/dist/compiler/schemaCalendarLanguage.d.ts.map +1 -0
- package/dist/compiler/schemaCalendarLanguage.js +227 -0
- package/dist/compiler/schemaComponentEquality.d.ts +28 -0
- package/dist/compiler/schemaComponentEquality.d.ts.map +1 -0
- package/dist/compiler/schemaComponentEquality.js +446 -0
- package/dist/compiler/schemaConstructionAssessment.d.ts +46 -0
- package/dist/compiler/schemaConstructionAssessment.d.ts.map +1 -0
- package/dist/compiler/schemaConstructionAssessment.js +663 -0
- package/dist/compiler/schemaDatatypeValues.d.ts +4 -0
- package/dist/compiler/schemaDatatypeValues.d.ts.map +1 -0
- package/dist/compiler/schemaDatatypeValues.js +2 -0
- package/dist/compiler/schemaDecimalLanguage.d.ts +7 -0
- package/dist/compiler/schemaDecimalLanguage.d.ts.map +1 -0
- package/dist/compiler/schemaDecimalLanguage.js +102 -0
- package/dist/compiler/schemaDeclarationPrimitives.d.ts +34 -0
- package/dist/compiler/schemaDeclarationPrimitives.d.ts.map +1 -0
- package/dist/compiler/schemaDeclarationPrimitives.js +194 -0
- package/dist/compiler/schemaDocumentSyntax.d.ts +55 -0
- package/dist/compiler/schemaDocumentSyntax.d.ts.map +1 -0
- package/dist/compiler/schemaDocumentSyntax.js +294 -0
- package/dist/compiler/schemaDurationLanguage.d.ts +11 -0
- package/dist/compiler/schemaDurationLanguage.d.ts.map +1 -0
- package/dist/compiler/schemaDurationLanguage.js +170 -0
- package/dist/compiler/schemaElementProperties.d.ts +16 -0
- package/dist/compiler/schemaElementProperties.d.ts.map +1 -0
- package/dist/compiler/schemaElementProperties.js +23 -0
- package/dist/compiler/schemaEndpointWordCapacity.d.ts +36 -0
- package/dist/compiler/schemaEndpointWordCapacity.d.ts.map +1 -0
- package/dist/compiler/schemaEndpointWordCapacity.js +39 -0
- package/dist/compiler/schemaExactCalendar.d.ts +73 -0
- package/dist/compiler/schemaExactCalendar.d.ts.map +1 -0
- package/dist/compiler/schemaExactCalendar.js +264 -0
- package/dist/compiler/schemaFacetAnnotation.d.ts +32 -0
- package/dist/compiler/schemaFacetAnnotation.d.ts.map +1 -0
- package/dist/compiler/schemaFacetAnnotation.js +199 -0
- package/dist/compiler/schemaGeneratedScalarShape.d.ts +35 -0
- package/dist/compiler/schemaGeneratedScalarShape.d.ts.map +1 -0
- package/dist/compiler/schemaGeneratedScalarShape.js +176 -0
- package/dist/compiler/schemaIdentityConstraints.d.ts +73 -0
- package/dist/compiler/schemaIdentityConstraints.d.ts.map +1 -0
- package/dist/compiler/schemaIdentityConstraints.js +362 -0
- package/dist/compiler/schemaIeeeLanguage.d.ts +43 -0
- package/dist/compiler/schemaIeeeLanguage.d.ts.map +1 -0
- package/dist/compiler/schemaIeeeLanguage.js +759 -0
- package/dist/compiler/schemaIntegerImages.d.ts +11 -0
- package/dist/compiler/schemaIntegerImages.d.ts.map +1 -0
- package/dist/compiler/schemaIntegerImages.js +113 -0
- package/dist/compiler/schemaLexicalPredicates.d.ts +29 -0
- package/dist/compiler/schemaLexicalPredicates.d.ts.map +1 -0
- package/dist/compiler/schemaLexicalPredicates.js +63 -0
- package/dist/compiler/schemaNotationProperties.d.ts +32 -0
- package/dist/compiler/schemaNotationProperties.d.ts.map +1 -0
- package/dist/compiler/schemaNotationProperties.js +84 -0
- package/dist/compiler/schemaNumericImageConditions.d.ts +24 -0
- package/dist/compiler/schemaNumericImageConditions.d.ts.map +1 -0
- package/dist/compiler/schemaNumericImageConditions.js +66 -0
- package/dist/compiler/schemaParticleWildcardProperties.d.ts +20 -0
- package/dist/compiler/schemaParticleWildcardProperties.d.ts.map +1 -0
- package/dist/compiler/schemaParticleWildcardProperties.js +43 -0
- package/dist/compiler/schemaPattern.d.ts +1062 -0
- package/dist/compiler/schemaPattern.d.ts.map +1 -0
- package/dist/compiler/schemaPattern.js +581 -0
- package/dist/compiler/schemaRegularLanguage.d.ts +67 -0
- package/dist/compiler/schemaRegularLanguage.d.ts.map +1 -0
- package/dist/compiler/schemaRegularLanguage.js +1166 -0
- package/dist/compiler/schemaScalarContext.d.ts +81 -0
- package/dist/compiler/schemaScalarContext.d.ts.map +1 -0
- package/dist/compiler/schemaScalarContext.js +78 -0
- package/dist/compiler/schemaScalarKernel.d.ts +182 -0
- package/dist/compiler/schemaScalarKernel.d.ts.map +1 -0
- package/dist/compiler/schemaScalarKernel.js +391 -0
- package/dist/compiler/schemaScalarWitnesses.d.ts +6 -0
- package/dist/compiler/schemaScalarWitnesses.d.ts.map +1 -0
- package/dist/compiler/schemaScalarWitnesses.js +118 -0
- package/dist/compiler/schemaSimpleTypeProperties.d.ts +95 -0
- package/dist/compiler/schemaSimpleTypeProperties.d.ts.map +1 -0
- package/dist/compiler/schemaSimpleTypeProperties.js +103 -0
- package/dist/compiler/schemaSourceGrammar.d.ts +27 -0
- package/dist/compiler/schemaSourceGrammar.d.ts.map +1 -0
- package/dist/compiler/schemaSourceGrammar.js +290 -0
- package/dist/compiler/schemaSourceLexical.d.ts +4 -0
- package/dist/compiler/schemaSourceLexical.d.ts.map +1 -0
- package/dist/compiler/schemaSourceLexical.js +12 -0
- package/dist/compiler/schemaSourceValues.d.ts +51 -0
- package/dist/compiler/schemaSourceValues.d.ts.map +1 -0
- package/dist/compiler/schemaSourceValues.js +225 -0
- package/dist/compiler/schemaSourceWildcards.d.ts +28 -0
- package/dist/compiler/schemaSourceWildcards.d.ts.map +1 -0
- package/dist/compiler/schemaSourceWildcards.js +247 -0
- package/dist/compiler/schemaSymbolicSequences.d.ts +16 -0
- package/dist/compiler/schemaSymbolicSequences.d.ts.map +1 -0
- package/dist/compiler/schemaSymbolicSequences.js +99 -0
- package/dist/compiler/schemaSymbolicValueSets.d.ts +32 -0
- package/dist/compiler/schemaSymbolicValueSets.d.ts.map +1 -0
- package/dist/compiler/schemaSymbolicValueSets.js +149 -0
- package/dist/compiler/schemaSyntaxAssessment.d.ts +25 -0
- package/dist/compiler/schemaSyntaxAssessment.d.ts.map +1 -0
- package/dist/compiler/schemaSyntaxAssessment.js +361 -0
- package/dist/compiler/schemaTemporalAliases.d.ts +6 -0
- package/dist/compiler/schemaTemporalAliases.d.ts.map +1 -0
- package/dist/compiler/schemaTemporalAliases.js +195 -0
- package/dist/compiler/schemaTokenImages.d.ts +9 -0
- package/dist/compiler/schemaTokenImages.d.ts.map +1 -0
- package/dist/compiler/schemaTokenImages.js +142 -0
- package/dist/compiler/schemaTypeIdentity.d.ts +39 -0
- package/dist/compiler/schemaTypeIdentity.d.ts.map +1 -0
- package/dist/compiler/schemaTypeIdentity.js +78 -0
- package/dist/compiler/schemaTypeRelations.d.ts +38 -0
- package/dist/compiler/schemaTypeRelations.d.ts.map +1 -0
- package/dist/compiler/schemaTypeRelations.js +576 -0
- package/dist/compiler/schemaUri.d.ts +13 -0
- package/dist/compiler/schemaUri.d.ts.map +1 -0
- package/dist/compiler/schemaUri.js +103 -0
- package/dist/compiler/schemaValueContext.d.ts +26 -0
- package/dist/compiler/schemaValueContext.d.ts.map +1 -0
- package/dist/compiler/schemaValueContext.js +1 -0
- package/dist/compiler/schemaValueImages.d.ts +10 -0
- package/dist/compiler/schemaValueImages.d.ts.map +1 -0
- package/dist/compiler/schemaValueImages.js +142 -0
- package/dist/compiler/schemaValueSequences.d.ts +15 -0
- package/dist/compiler/schemaValueSequences.d.ts.map +1 -0
- package/dist/compiler/schemaValueSequences.js +19 -0
- package/dist/compiler/semanticBudget.d.ts +50 -0
- package/dist/compiler/semanticBudget.d.ts.map +1 -0
- package/dist/compiler/semanticBudget.js +178 -0
- package/dist/compiler/semanticCatalog.d.ts +122 -0
- package/dist/compiler/semanticCatalog.d.ts.map +1 -0
- package/dist/compiler/semanticCatalog.js +160 -0
- package/dist/compiler/semanticContext.d.ts +172 -0
- package/dist/compiler/semanticContext.d.ts.map +1 -0
- package/dist/compiler/semanticContext.js +1168 -0
- package/dist/compiler/semanticTypeDependencies.d.ts +8 -0
- package/dist/compiler/semanticTypeDependencies.d.ts.map +1 -0
- package/dist/compiler/semanticTypeDependencies.js +64 -0
- package/dist/compiler/semanticTypeReference.d.ts +24 -0
- package/dist/compiler/semanticTypeReference.d.ts.map +1 -0
- package/dist/compiler/semanticTypeReference.js +36 -0
- package/dist/compiler/shapeResolver.d.ts +1 -0
- package/dist/compiler/shapeResolver.d.ts.map +1 -1
- package/dist/compiler/shapeResolver.js +7 -9
- package/dist/compiler/sourceSchemaBinding.d.ts +26 -0
- package/dist/compiler/sourceSchemaBinding.d.ts.map +1 -0
- package/dist/compiler/sourceSchemaBinding.js +39 -0
- package/dist/compiler/structuralCompanions.d.ts +16 -0
- package/dist/compiler/structuralCompanions.d.ts.map +1 -0
- package/dist/compiler/structuralCompanions.js +232 -0
- package/dist/compiler/validateSemanticGraph.d.ts +5 -0
- package/dist/compiler/validateSemanticGraph.d.ts.map +1 -0
- package/dist/compiler/validateSemanticGraph.js +376 -0
- package/dist/compiler/wildcardAlgebra.d.ts +26 -0
- package/dist/compiler/wildcardAlgebra.d.ts.map +1 -0
- package/dist/compiler/wildcardAlgebra.js +155 -0
- package/dist/gateway/generateGateway.d.ts.map +1 -1
- package/dist/gateway/generateGateway.js +2 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/loader/orderedSyntax.d.ts +77 -0
- package/dist/loader/orderedSyntax.d.ts.map +1 -0
- package/dist/loader/orderedSyntax.js +202 -0
- package/dist/loader/resolutionDepth.d.ts +7 -0
- package/dist/loader/resolutionDepth.d.ts.map +1 -0
- package/dist/loader/resolutionDepth.js +65 -0
- package/dist/loader/schemaInput.d.ts +53 -0
- package/dist/loader/schemaInput.d.ts.map +1 -0
- package/dist/loader/schemaInput.js +212 -0
- package/dist/loader/schemaResources.d.ts +59 -0
- package/dist/loader/schemaResources.d.ts.map +1 -0
- package/dist/loader/schemaResources.js +292 -0
- package/dist/openapi/generateOpenAPI.d.ts.map +1 -1
- package/dist/openapi/generateOpenAPI.js +2 -2
- package/dist/test/generateTests.d.ts.map +1 -1
- package/dist/test/generateTests.js +2 -2
- package/dist/util/xmlWhitespace.d.ts +3 -0
- package/dist/util/xmlWhitespace.d.ts.map +1 -0
- package/dist/util/xmlWhitespace.js +4 -0
- package/docs/README.md +14 -1
- package/docs/architecture.md +9 -0
- package/docs/cli-reference.md +21 -1
- package/docs/content-model-analysis.md +92 -0
- package/docs/content-model-baseline.md +121 -0
- package/docs/content-model-catalog.md +116 -0
- package/docs/content-model-companions.md +90 -0
- package/docs/content-model-composition.md +103 -0
- package/docs/content-model-decisions.md +79 -0
- package/docs/content-model-gateway-feasibility.md +169 -0
- package/docs/content-model-graph.md +121 -0
- package/docs/content-model-loading.md +163 -0
- package/docs/content-model-matching.md +85 -0
- package/docs/content-model-readiness.md +144 -0
- package/docs/content-model-resolution.md +81 -0
- package/docs/content-model-s02-handoff.md +98 -0
- package/docs/content-model-s06-au-01.md +425 -0
- package/docs/content-model-s06-dt-01.md +386 -0
- package/docs/content-model-s06-pw-01.md +350 -0
- package/docs/content-model-s06-re-01-resolver-implementation.md +869 -0
- package/docs/content-model-s06-re-01-resolver.md +513 -0
- package/docs/content-model-s06-re-01-scalar-witnesses.md +1423 -0
- package/docs/content-model-s06-re-01-support-reconstruction.md +6337 -0
- package/docs/content-model-s06-re-01.md +7477 -0
- package/docs/content-model-s06-research-handoff.md +909 -0
- package/docs/content-model-shipped-fix.md +83 -0
- package/docs/content-model-soap-feasibility.md +165 -0
- package/docs/decisions/002-streamable-responses.md +2 -0
- package/docs/decisions/003-content-model-contracts.md +280 -0
- package/docs/direct-values.md +311 -0
- package/docs/reference-validation.md +243 -0
- package/docs/releases/v1.1.5.md +38 -0
- package/docs/roadmap/README.md +2 -2
- package/docs/supported-patterns.md +13 -5
- package/package.json +26 -13
- package/src/generation/preambles/direct-client/typescript.preamble +3 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SemanticContext } from './semanticContext.js';
|
|
2
|
+
import type { SemanticTypeDependency } from './semanticTypeReference.js';
|
|
3
|
+
/** Call inside the request guard; inputs are borrowed internal receipt data. */
|
|
4
|
+
export declare function collectSemanticTypeDependencies(context: SemanticContext): Readonly<{
|
|
5
|
+
add(required: readonly SemanticTypeDependency[]): void;
|
|
6
|
+
snapshot(): readonly SemanticTypeDependency[];
|
|
7
|
+
}>;
|
|
8
|
+
//# sourceMappingURL=semanticTypeDependencies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semanticTypeDependencies.d.ts","sourceRoot":"","sources":["../../src/compiler/semanticTypeDependencies.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,4BAA4B,CAAC;AASvE,gFAAgF;AAChF,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,eAAe,GAAG,QAAQ,CAAC;IAClF,GAAG,CAAC,QAAQ,EAAE,SAAS,sBAAsB,EAAE,GAAG,IAAI,CAAC;IACvD,QAAQ,IAAI,SAAS,sBAAsB,EAAE,CAAC;CAC/C,CAAC,CAwDD"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** Charged accumulation of already-owned type dependency facts; no validity authority. */
|
|
2
|
+
import { assertSemanticContext } from './semanticContext.js';
|
|
3
|
+
import { semanticTypeKey } from './schemaTypeIdentity.js';
|
|
4
|
+
const ownedByContext = new WeakMap();
|
|
5
|
+
/** Call inside the request guard; inputs are borrowed internal receipt data. */
|
|
6
|
+
export function collectSemanticTypeDependencies(context) {
|
|
7
|
+
assertSemanticContext(context);
|
|
8
|
+
const budget = context.budget;
|
|
9
|
+
budget.chargeWork(7);
|
|
10
|
+
let owned = ownedByContext.get(context);
|
|
11
|
+
if (!owned) {
|
|
12
|
+
budget.chargeWork(7);
|
|
13
|
+
owned = { facts: new Map(), keys: new WeakMap() };
|
|
14
|
+
ownedByContext.set(context, owned);
|
|
15
|
+
}
|
|
16
|
+
const facts = new Map();
|
|
17
|
+
let published;
|
|
18
|
+
return Object.freeze({
|
|
19
|
+
add(required) {
|
|
20
|
+
budget.chargeWork();
|
|
21
|
+
for (const dependency of required) {
|
|
22
|
+
budget.chargeWork(4);
|
|
23
|
+
if (!dependency || typeof dependency !== 'object')
|
|
24
|
+
throw new TypeError('Expected a semantic type dependency');
|
|
25
|
+
let key = owned.keys.get(dependency);
|
|
26
|
+
if (key === undefined) {
|
|
27
|
+
// No accessor execution and no lasting trust in a borrowed input's
|
|
28
|
+
// identity. Its current primitive values are checked on every visit.
|
|
29
|
+
budget.chargeWork(48);
|
|
30
|
+
const origin = Object.getOwnPropertyDescriptor(dependency, 'contextId');
|
|
31
|
+
const type = Object.getOwnPropertyDescriptor(dependency, 'type');
|
|
32
|
+
if (!origin || !('value' in origin) || typeof origin.value !== 'string' || !type || !('value' in type))
|
|
33
|
+
throw new TypeError('Expected own-data semantic type dependency fields');
|
|
34
|
+
const identity = semanticTypeKey(context, type.value);
|
|
35
|
+
budget.chargeWork(40 + origin.value.length * 2 + identity.length);
|
|
36
|
+
key = `${origin.value.length}:${origin.value}:${identity}`;
|
|
37
|
+
}
|
|
38
|
+
budget.chargeWork(2);
|
|
39
|
+
let fact = owned.facts.get(key);
|
|
40
|
+
if (!fact) {
|
|
41
|
+
fact = budget.freeze(budget.snapshot(dependency));
|
|
42
|
+
budget.chargeWork(4);
|
|
43
|
+
owned.facts.set(key, fact);
|
|
44
|
+
owned.keys.set(fact, key);
|
|
45
|
+
}
|
|
46
|
+
if (!facts.has(key)) {
|
|
47
|
+
budget.chargeWork(3);
|
|
48
|
+
facts.set(key, fact);
|
|
49
|
+
published = undefined;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
snapshot() {
|
|
54
|
+
budget.chargeWork(2);
|
|
55
|
+
if (published)
|
|
56
|
+
return published;
|
|
57
|
+
// Every member is a private owned immutable result. Only this array is
|
|
58
|
+
// newly copied/frozen; traversing those member graphs again adds no safety.
|
|
59
|
+
budget.chargeWork(3 + facts.size * 3);
|
|
60
|
+
published = Object.freeze([...facts.values()]);
|
|
61
|
+
return published;
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Internal semantic references. Canonical/public/persisted Reference is unchanged. */
|
|
2
|
+
import type { NodeId, Reference } from './canonicalGraph.js';
|
|
3
|
+
import type { ExpandedName } from '../loader/orderedSyntax.js';
|
|
4
|
+
import type { SemanticBudget } from './semanticBudget.js';
|
|
5
|
+
/** Plain selector data, not an issued component or validity receipt. */
|
|
6
|
+
export type OriginalGeneratedScalarReference = Readonly<{
|
|
7
|
+
kind: 'original-generated';
|
|
8
|
+
owner: NodeId;
|
|
9
|
+
}>;
|
|
10
|
+
export type SemanticTypeReference = Reference | OriginalGeneratedScalarReference;
|
|
11
|
+
export type SemanticTypeIdentity = Readonly<{
|
|
12
|
+
kind: 'component';
|
|
13
|
+
id: NodeId;
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'builtin';
|
|
16
|
+
name: ExpandedName;
|
|
17
|
+
}> | OriginalGeneratedScalarReference;
|
|
18
|
+
export type SemanticTypeDependency = Readonly<{
|
|
19
|
+
contextId: string;
|
|
20
|
+
type: SemanticTypeIdentity;
|
|
21
|
+
}>;
|
|
22
|
+
/** Checks only reference shape; authenticated context resolution owns membership. */
|
|
23
|
+
export declare function assertSemanticTypeReferenceShape(value: unknown, budget: SemanticBudget): asserts value is SemanticTypeReference;
|
|
24
|
+
//# sourceMappingURL=semanticTypeReference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semanticTypeReference.d.ts","sourceRoot":"","sources":["../../src/compiler/semanticTypeReference.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,OAAO,KAAK,EAAC,MAAM,EAAE,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAExD,wEAAwE;AACxE,MAAM,MAAM,gCAAgC,GAAG,QAAQ,CAAC;IAAC,IAAI,EAAE,oBAAoB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,CAAC,CAAC;AACrG,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,gCAAgC,CAAC;AACjF,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IAAC,IAAI,EAAE,WAAW,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAC,GAAG;IAAC,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,YAAY,CAAA;CAAC,CAAC,GAChH,gCAAgC,CAAC;AACrC,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,oBAAoB,CAAA;CAAC,CAAC,CAAC;AAE/F,qFAAqF;AACrF,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,KAAK,IAAI,qBAAqB,CAoB/H"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Checks only reference shape; authenticated context resolution owns membership. */
|
|
2
|
+
export function assertSemanticTypeReferenceShape(value, budget) {
|
|
3
|
+
const field = (input, key) => {
|
|
4
|
+
budget.chargeWork(44 + key.length);
|
|
5
|
+
if (!input || typeof input !== 'object' || Array.isArray(input))
|
|
6
|
+
throw new TypeError('Expected semantic type reference data');
|
|
7
|
+
const own = Object.getOwnPropertyDescriptor(input, key);
|
|
8
|
+
if (own && !('value' in own))
|
|
9
|
+
throw new TypeError('Semantic type references cannot contain accessors');
|
|
10
|
+
return own?.value;
|
|
11
|
+
};
|
|
12
|
+
const id = (input) => { budget.chargeWork(); if (typeof input !== 'string' || !input)
|
|
13
|
+
throw new TypeError('Expected semantic type identity'); };
|
|
14
|
+
const kind = field(value, 'kind');
|
|
15
|
+
if (kind === 'original-generated') {
|
|
16
|
+
id(field(value, 'owner'));
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (kind === 'local') {
|
|
20
|
+
id(field(value, 'target'));
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (kind !== 'symbol' && kind !== 'builtin')
|
|
24
|
+
throw new TypeError('Unknown semantic type reference kind');
|
|
25
|
+
const name = field(value, 'name');
|
|
26
|
+
if (typeof field(name, 'namespace') !== 'string')
|
|
27
|
+
throw new TypeError('Expected semantic type namespace');
|
|
28
|
+
id(field(name, 'local'));
|
|
29
|
+
if (kind === 'symbol') {
|
|
30
|
+
if (field(value, 'role') !== 'type')
|
|
31
|
+
throw new TypeError('Expected a type symbol');
|
|
32
|
+
const target = field(value, 'target');
|
|
33
|
+
if (target !== undefined)
|
|
34
|
+
id(target);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CompiledCatalog } from "./schemaCompiler.js";
|
|
2
2
|
import type { StreamConfig } from "../util/streamConfig.js";
|
|
3
|
+
export { prepareResolvedCompilationInput } from "./semanticCatalog.js";
|
|
3
4
|
export interface ApplyShapeCatalogsOptions {
|
|
4
5
|
/** Directory against which relative `catalogFile`/`wsdlSource` paths resolve. Defaults to process.cwd(). */
|
|
5
6
|
baseDir?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shapeResolver.d.ts","sourceRoot":"","sources":["../../src/compiler/shapeResolver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shapeResolver.d.ts","sourceRoot":"","sources":["../../src/compiler/shapeResolver.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAqC,KAAK,eAAe,EAAoB,MAAM,qBAAqB,CAAC;AAGhH,OAAO,KAAK,EAAkB,YAAY,EAAC,MAAM,yBAAyB,CAAC;AAM3E,OAAO,EAAC,+BAA+B,EAAC,MAAM,sBAAsB,CAAC;AAErE,MAAM,WAAW,yBAAyB;IACxC,4GAA4G;IAC5G,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,eAAe,EACzB,YAAY,EAAE,YAAY,EAC1B,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,IAAI,CAAC,CAoDf"}
|
|
@@ -14,12 +14,15 @@
|
|
|
14
14
|
* - Existing buffered generation stays byte-for-byte identical when no
|
|
15
15
|
* streamConfig.shapeCatalogs entries are declared.
|
|
16
16
|
*/
|
|
17
|
-
import fs from "node:fs";
|
|
18
17
|
import path from "node:path";
|
|
19
18
|
import { compileCatalog } from "./schemaCompiler.js";
|
|
20
19
|
import { loadWsdl } from "../loader/wsdlLoader.js";
|
|
21
20
|
import { resolveCompilerOptions } from "../config.js";
|
|
22
21
|
import { WsdlCompilationError } from "../util/errors.js";
|
|
22
|
+
import { readLegacyCatalogFile, CatalogError } from "./semanticCatalog.js";
|
|
23
|
+
// Internal faithful counterpart consumes namespace/role roots and the typed reader.
|
|
24
|
+
// Public StreamConfig generation continues to call the legacy adapter below.
|
|
25
|
+
export { prepareResolvedCompilationInput } from "./semanticCatalog.js";
|
|
23
26
|
/**
|
|
24
27
|
* Apply a parsed StreamConfig to a compiled catalog:
|
|
25
28
|
* 1. Verify every opted-in operation's record type is resolvable.
|
|
@@ -76,19 +79,14 @@ export async function applyShapeCatalogs(compiled, streamConfig, options = {}) {
|
|
|
76
79
|
async function loadCompanionCatalog(name, ref, baseDir, compiled) {
|
|
77
80
|
if (ref.catalogFile) {
|
|
78
81
|
const abs = path.resolve(baseDir, ref.catalogFile);
|
|
79
|
-
let text;
|
|
80
82
|
try {
|
|
81
|
-
|
|
83
|
+
return readLegacyCatalogFile(abs);
|
|
82
84
|
}
|
|
83
85
|
catch (err) {
|
|
86
|
+
if (err instanceof CatalogError)
|
|
87
|
+
throw err;
|
|
84
88
|
throw new WsdlCompilationError(`Failed to read companion catalog "${name}" at ${abs}: ${err.message}`, { suggestion: `Check that shapeCatalogs.${name}.catalogFile points to an existing catalog.json.` });
|
|
85
89
|
}
|
|
86
|
-
try {
|
|
87
|
-
return JSON.parse(text);
|
|
88
|
-
}
|
|
89
|
-
catch (err) {
|
|
90
|
-
throw new WsdlCompilationError(`Companion catalog "${name}" at ${abs} is not valid JSON: ${err.message}`);
|
|
91
|
-
}
|
|
92
90
|
}
|
|
93
91
|
if (ref.wsdlSource) {
|
|
94
92
|
// Relative paths resolve against baseDir; URLs pass through untouched.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { SchemaInput, SchemaInterpretation } from '../loader/schemaInput.js';
|
|
2
|
+
import type { SyntaxSource } from '../loader/orderedSyntax.js';
|
|
3
|
+
import { GraphError } from './canonicalGraph.js';
|
|
4
|
+
import { SemanticError } from './resolveCanonicalGraph.js';
|
|
5
|
+
import type { ResolvedGraph, SemanticLimits } from './resolveCanonicalGraph.js';
|
|
6
|
+
import type { ResourceLimitFailure, SemanticBudget } from './semanticBudget.js';
|
|
7
|
+
export type SourcePreparationFailure = Readonly<{
|
|
8
|
+
kind: 'source-preparation-failed';
|
|
9
|
+
stage: 'canonical-build' | 'reference-resolution';
|
|
10
|
+
category: GraphError['category'] | SemanticError['category'];
|
|
11
|
+
message: string;
|
|
12
|
+
source?: SyntaxSource;
|
|
13
|
+
}>;
|
|
14
|
+
export type BoundSourcePreparation = Readonly<{
|
|
15
|
+
kind: 'prepared';
|
|
16
|
+
resolved: ResolvedGraph;
|
|
17
|
+
}> | SourcePreparationFailure | ResourceLimitFailure;
|
|
18
|
+
/** Reads only private identity. A copied/forged resolved handle has no binding. */
|
|
19
|
+
export declare function sourceSchemasForResolvedGraph(resolved: ResolvedGraph): readonly SchemaInterpretation[] | undefined;
|
|
20
|
+
/** One issued source snapshot constructs both the immutable graph and its source universe. */
|
|
21
|
+
export declare function prepareBoundSourceGraph(input: SchemaInput, options: Readonly<{
|
|
22
|
+
budget: SemanticBudget;
|
|
23
|
+
sourceLimits?: SemanticLimits;
|
|
24
|
+
accountPreparation?: true;
|
|
25
|
+
}>): BoundSourcePreparation;
|
|
26
|
+
//# sourceMappingURL=sourceSchemaBinding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sourceSchemaBinding.d.ts","sourceRoot":"","sources":["../../src/compiler/sourceSchemaBinding.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,WAAW,EAAE,oBAAoB,EAAC,MAAM,0BAA0B,CAAC;AAChF,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAE7D,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAwB,aAAa,EAAC,MAAM,4BAA4B,CAAC;AAChF,OAAO,KAAK,EAAC,aAAa,EAAE,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAC9E,OAAO,KAAK,EAAC,oBAAoB,EAAE,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAE9E,MAAM,MAAM,wBAAwB,GAAG,QAAQ,CAAC;IAAC,IAAI,EAAE,2BAA2B,CAAC;IACjF,KAAK,EAAE,iBAAiB,GAAG,sBAAsB,CAAC;IAAC,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;IAChH,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,YAAY,CAAA;CAAC,CAAC,CAAC;AAC3C,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,aAAa,CAAA;CAAC,CAAC,GAAG,wBAAwB,GAAG,oBAAoB,CAAC;AAG7I,mFAAmF;AACnF,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,aAAa,GAAG,SAAS,oBAAoB,EAAE,GAAG,SAAS,CAElH;AAED,8FAA8F;AAC9F,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,CAAC;IAC5E,MAAM,EAAE,cAAc,CAAC;IAAC,YAAY,CAAC,EAAE,cAAc,CAAC;IAAC,kBAAkB,CAAC,EAAE,IAAI,CAAC;CAClF,CAAC,GAAG,sBAAsB,CAyB1B"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** Exact source-built resolved handles; no caller-issued association or validity receipt. */
|
|
2
|
+
import { assertLoadedSchemaInput } from '../loader/schemaInput.js';
|
|
3
|
+
import { buildCanonicalGraph } from './buildCanonicalGraph.js';
|
|
4
|
+
import { GraphError } from './canonicalGraph.js';
|
|
5
|
+
import { resolveCanonicalGraph, SemanticError } from './resolveCanonicalGraph.js';
|
|
6
|
+
const sourceBindings = new WeakMap();
|
|
7
|
+
/** Reads only private identity. A copied/forged resolved handle has no binding. */
|
|
8
|
+
export function sourceSchemasForResolvedGraph(resolved) {
|
|
9
|
+
return sourceBindings.get(resolved);
|
|
10
|
+
}
|
|
11
|
+
/** One issued source snapshot constructs both the immutable graph and its source universe. */
|
|
12
|
+
export function prepareBoundSourceGraph(input, options) {
|
|
13
|
+
assertLoadedSchemaInput(input);
|
|
14
|
+
const budget = options.budget;
|
|
15
|
+
return budget.guard(() => {
|
|
16
|
+
// The loader authenticates this exact input handle. Claim its complete
|
|
17
|
+
// immutable source tree before any build or caller access can intervene.
|
|
18
|
+
// The shared budget charges the freeze traversal before each field read.
|
|
19
|
+
const owned = budget.freeze(input);
|
|
20
|
+
let stage = 'canonical-build';
|
|
21
|
+
try {
|
|
22
|
+
const graph = buildCanonicalGraph(owned, { maxNodes: options.sourceLimits?.maxNodes, requestBudget: options.accountPreparation ? budget : undefined });
|
|
23
|
+
stage = 'reference-resolution';
|
|
24
|
+
// The fixed resolver deep-freezes its complete result before returning it.
|
|
25
|
+
// No caller code receives this exact handle before the private association.
|
|
26
|
+
const resolved = resolveCanonicalGraph(graph, { ...options.sourceLimits, requestBudget: options.accountPreparation ? budget : undefined });
|
|
27
|
+
budget.chargeWork(6);
|
|
28
|
+
sourceBindings.set(resolved, owned.schemas);
|
|
29
|
+
return Object.freeze({ kind: 'prepared', resolved });
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
if (!(error instanceof GraphError || error instanceof SemanticError))
|
|
33
|
+
throw error;
|
|
34
|
+
budget.chargeWork(200 + error.message.length);
|
|
35
|
+
return Object.freeze({ kind: 'source-preparation-failed', stage, category: error.category,
|
|
36
|
+
message: error.message, ...(error.source ? { source: error.source } : {}) });
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CanonicalGraph, NodeId } from "./canonicalGraph.js";
|
|
2
|
+
import type { SemanticLimits } from "./resolveCanonicalGraph.js";
|
|
3
|
+
export type StructuralCompanion = Readonly<{
|
|
4
|
+
graph: CanonicalGraph;
|
|
5
|
+
roots: readonly NodeId[];
|
|
6
|
+
}>;
|
|
7
|
+
export type StructuralMerge = Readonly<{
|
|
8
|
+
graph: CanonicalGraph;
|
|
9
|
+
copied: readonly NodeId[];
|
|
10
|
+
deduplicated: readonly NodeId[];
|
|
11
|
+
metrics: Readonly<{
|
|
12
|
+
steps: number;
|
|
13
|
+
}>;
|
|
14
|
+
}>;
|
|
15
|
+
export declare function mergeStructuralCompanions(primary: CanonicalGraph, companions: readonly StructuralCompanion[], limits?: SemanticLimits): StructuralMerge;
|
|
16
|
+
//# sourceMappingURL=structuralCompanions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structuralCompanions.d.ts","sourceRoot":"","sources":["../../src/compiler/structuralCompanions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,cAAc,EAA0B,MAAM,EAAC,MAAM,qBAAqB,CAAC;AAGxF,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAI/D,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IAAC,KAAK,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;CAAC,CAAC,CAAC;AAC9F,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACrC,KAAK,EAAE,cAAc,CAAC;IAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;CACvH,CAAC,CAAC;AAEH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,mBAAmB,EAAE,EAAE,MAAM,GAAE,cAAmB,GAAG,eAAe,CAuI3J"}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/** Required structural closures over one declared graph; no public-symbol renaming. */
|
|
2
|
+
import { deepFreeze, globalId } from "./canonicalGraph.js";
|
|
3
|
+
import { containedNodes, referenceSlots, mapNodeReferences } from "./graphTraversal.js";
|
|
4
|
+
import { referenceTarget, SemanticError, semanticBudget, countSemanticData } from "./resolveCanonicalGraph.js";
|
|
5
|
+
import { semanticGraphRepresentation } from "./catalogProvenance.js";
|
|
6
|
+
import { canonicalJson } from "./catalogErrors.js";
|
|
7
|
+
export function mergeStructuralCompanions(primary, companions, limits = {}) {
|
|
8
|
+
const budget = semanticBudget(limits);
|
|
9
|
+
if (primary.nodes.length > budget.maxNodes)
|
|
10
|
+
throw new SemanticError("resource-limit", `Primary input exceeds ${budget.maxNodes} graph nodes`);
|
|
11
|
+
const nodes = new Map(primary.nodes.map(n => { budget.step(n); return [n.id, n]; }));
|
|
12
|
+
const checkSize = () => { if (nodes.size > budget.maxNodes)
|
|
13
|
+
throw new SemanticError("resource-limit", `Companion graph exceeds ${budget.maxNodes} nodes`); };
|
|
14
|
+
checkSize();
|
|
15
|
+
// Bound normalization and provenance copying before recursive serialization allocates.
|
|
16
|
+
const countData = (value, node) => countSemanticData(value, budget, node);
|
|
17
|
+
const owned = (root, index) => {
|
|
18
|
+
const stack = [root.id], seen = new Set(), result = [];
|
|
19
|
+
while (stack.length) {
|
|
20
|
+
const id = stack.pop();
|
|
21
|
+
if (seen.has(id))
|
|
22
|
+
continue;
|
|
23
|
+
const node = index.get(id);
|
|
24
|
+
if (!node)
|
|
25
|
+
throw new SemanticError("invalid-schema", `Missing owned component ${id}`, root.id, root.context.source);
|
|
26
|
+
budget.step(node);
|
|
27
|
+
seen.add(id);
|
|
28
|
+
result.push(node);
|
|
29
|
+
for (const child of containedNodes(node)) {
|
|
30
|
+
budget.step(node);
|
|
31
|
+
stack.push(child);
|
|
32
|
+
}
|
|
33
|
+
for (const slot of referenceSlots(node))
|
|
34
|
+
if (slot.reference.kind === "local") {
|
|
35
|
+
budget.step(node);
|
|
36
|
+
stack.push(slot.reference.target);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
const representation = (root, index) => {
|
|
42
|
+
const declarations = owned(root, index);
|
|
43
|
+
countData(declarations, root);
|
|
44
|
+
return semanticGraphRepresentation({ ...primary, nodes: declarations, globals: [root.id], origins: {}, schemaAnnotations: [], schemaRetained: [], loading: { ...primary.loading, edges: [] } }, { referenceIdentityOnly: true });
|
|
45
|
+
};
|
|
46
|
+
const origins = Object.create(null), originKeys = new Map();
|
|
47
|
+
const addOrigins = (id, values, node) => {
|
|
48
|
+
const list = origins[id] ??= [], keys = originKeys.get(id) ?? new Set();
|
|
49
|
+
originKeys.set(id, keys);
|
|
50
|
+
for (const origin of values) {
|
|
51
|
+
countData(origin, node);
|
|
52
|
+
const key = canonicalJson(origin);
|
|
53
|
+
if (!keys.has(key)) {
|
|
54
|
+
keys.add(key);
|
|
55
|
+
list.push(origin);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
for (const node of primary.nodes) {
|
|
60
|
+
budget.step(node);
|
|
61
|
+
addOrigins(node.id, primary.origins[node.id] ?? [], node);
|
|
62
|
+
}
|
|
63
|
+
const edges = [...primary.loading.edges], retained = [...primary.schemaRetained], annotations = [...primary.schemaAnnotations];
|
|
64
|
+
countData([edges, retained, annotations]);
|
|
65
|
+
const edgeKeys = new Set(edges.map(canonicalJson)), retainedKeys = new Set(retained.map(canonicalJson)), annotationKeys = new Set(annotations.map(canonicalJson));
|
|
66
|
+
const copied = new Set(), deduplicated = new Set();
|
|
67
|
+
// Index requested pools before walking, so a cross-companion dependency is
|
|
68
|
+
// resolved by availability rather than the caller's request order.
|
|
69
|
+
const providers = new Map();
|
|
70
|
+
const pools = companions.map((companion, pool) => {
|
|
71
|
+
budget.step();
|
|
72
|
+
if (companion.graph.nodes.length > budget.maxNodes)
|
|
73
|
+
throw new SemanticError("resource-limit", `Companion input exceeds ${budget.maxNodes} graph nodes`);
|
|
74
|
+
const source = new Map(companion.graph.nodes.map(n => { budget.step(n); return [n.id, n]; }));
|
|
75
|
+
if (companion.roots.length)
|
|
76
|
+
for (const node of source.values()) {
|
|
77
|
+
budget.step(node);
|
|
78
|
+
if (node.identity.kind !== "global")
|
|
79
|
+
continue;
|
|
80
|
+
const available = providers.get(node.id) ?? [];
|
|
81
|
+
available.push(pool);
|
|
82
|
+
providers.set(node.id, available);
|
|
83
|
+
}
|
|
84
|
+
return { companion, source, selected: new Set() };
|
|
85
|
+
});
|
|
86
|
+
const queue = [];
|
|
87
|
+
const enqueueAvailable = (id, node) => {
|
|
88
|
+
for (const pool of providers.get(id) ?? []) {
|
|
89
|
+
budget.step(node);
|
|
90
|
+
queue.push({ pool, id });
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
pools.forEach(({ companion, source }, pool) => {
|
|
94
|
+
for (const root of companion.roots) {
|
|
95
|
+
budget.step();
|
|
96
|
+
const node = source.get(root);
|
|
97
|
+
if (!node || node.identity.kind !== "global")
|
|
98
|
+
throw new SemanticError("invalid-schema", `Companion root must identify a declared global component: ${root}`, root, node?.context.source);
|
|
99
|
+
queue.push({ pool, id: root });
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
for (const node of primary.nodes)
|
|
103
|
+
for (const { reference } of referenceSlots(node)) {
|
|
104
|
+
budget.step(node);
|
|
105
|
+
if (reference.kind === "symbol") {
|
|
106
|
+
const id = globalId(reference.role, reference.name);
|
|
107
|
+
if (!nodes.has(id))
|
|
108
|
+
enqueueAvailable(id, node);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
while (queue.length) {
|
|
112
|
+
const { pool, id } = queue.pop(), { source, selected } = pools[pool];
|
|
113
|
+
if (selected.has(id))
|
|
114
|
+
continue;
|
|
115
|
+
const node = source.get(id);
|
|
116
|
+
if (!node)
|
|
117
|
+
throw new SemanticError("invalid-schema", `Missing companion component ${id}`, id);
|
|
118
|
+
budget.step(node);
|
|
119
|
+
selected.add(id);
|
|
120
|
+
for (const child of containedNodes(node)) {
|
|
121
|
+
budget.step(node);
|
|
122
|
+
queue.push({ pool, id: child });
|
|
123
|
+
}
|
|
124
|
+
for (const { reference } of referenceSlots(node)) {
|
|
125
|
+
budget.step(node);
|
|
126
|
+
const candidate = reference.kind === "local" ? reference.target : reference.kind === "symbol" ? globalId(reference.role, reference.name) : undefined;
|
|
127
|
+
if (candidate && source.has(candidate)) {
|
|
128
|
+
referenceTarget(reference, source, node);
|
|
129
|
+
queue.push({ pool, id: candidate });
|
|
130
|
+
}
|
|
131
|
+
else if (candidate && reference.kind === "symbol" && !nodes.has(candidate) && providers.has(candidate)) {
|
|
132
|
+
for (const available of providers.get(candidate))
|
|
133
|
+
referenceTarget(reference, pools[available].source, node);
|
|
134
|
+
enqueueAvailable(candidate, node);
|
|
135
|
+
}
|
|
136
|
+
else
|
|
137
|
+
referenceTarget(reference, nodes, node);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
for (const { companion, source, selected } of pools) {
|
|
141
|
+
const interpretations = new Set(), contexts = new Set(), documents = new Set();
|
|
142
|
+
for (const id of selected) {
|
|
143
|
+
const node = source.get(id);
|
|
144
|
+
for (const origin of companion.graph.origins[id] ?? []) {
|
|
145
|
+
countData(origin, node);
|
|
146
|
+
interpretations.add(origin.interpretation);
|
|
147
|
+
contexts.add(canonicalJson([origin.context.source.uri, origin.context.source.digest, origin.context.effectiveNamespace]));
|
|
148
|
+
documents.add(canonicalJson([origin.context.source.uri, origin.context.source.digest]));
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
const mapping = new Map();
|
|
152
|
+
for (const id of [...selected].sort((a, b) => { budget.step(); return a < b ? -1 : a > b ? 1 : 0; })) {
|
|
153
|
+
const root = source.get(id);
|
|
154
|
+
if (root.identity.kind !== "global")
|
|
155
|
+
continue;
|
|
156
|
+
const current = nodes.get(id);
|
|
157
|
+
if (current) {
|
|
158
|
+
const a = representation(current, nodes), b = representation(root, source);
|
|
159
|
+
if (a.structure !== b.structure)
|
|
160
|
+
throw new SemanticError("invalid-schema", `Structural companion collision for ${id}; reconcile the original declarations`, id, root.context.source, [current.context.source]);
|
|
161
|
+
// Equal normalized positions identify corresponding scoped declarations.
|
|
162
|
+
const positions = new Map([...a.identities].map(([original, normalized]) => [normalized, original]));
|
|
163
|
+
for (const [original, normalized] of b.identities) {
|
|
164
|
+
budget.step(root);
|
|
165
|
+
mapping.set(original, positions.get(normalized));
|
|
166
|
+
}
|
|
167
|
+
deduplicated.add(id);
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
for (const node of owned(root, source)) {
|
|
171
|
+
budget.step(node);
|
|
172
|
+
nodes.set(node.id, node);
|
|
173
|
+
checkSize();
|
|
174
|
+
mapping.set(node.id, node.id);
|
|
175
|
+
}
|
|
176
|
+
copied.add(id);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
for (const id of selected) {
|
|
180
|
+
const target = mapping.get(id), node = source.get(id);
|
|
181
|
+
if (!target)
|
|
182
|
+
throw new SemanticError("invalid-schema", "Companion closure lost scoped ownership", id, node.context.source);
|
|
183
|
+
addOrigins(target, companion.graph.origins[id] ?? [], node);
|
|
184
|
+
}
|
|
185
|
+
for (const edge of companion.graph.loading.edges) {
|
|
186
|
+
budget.step();
|
|
187
|
+
if (!interpretations.has(edge.from))
|
|
188
|
+
continue;
|
|
189
|
+
countData(edge);
|
|
190
|
+
const key = canonicalJson(edge);
|
|
191
|
+
if (!edgeKeys.has(key)) {
|
|
192
|
+
edgeKeys.add(key);
|
|
193
|
+
edges.push(edge);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
for (const entry of companion.graph.schemaRetained) {
|
|
197
|
+
budget.step();
|
|
198
|
+
if (!contexts.has(canonicalJson([entry.context.source.uri, entry.context.source.digest, entry.context.effectiveNamespace])))
|
|
199
|
+
continue;
|
|
200
|
+
countData(entry);
|
|
201
|
+
const key = canonicalJson(entry);
|
|
202
|
+
if (!retainedKeys.has(key)) {
|
|
203
|
+
retainedKeys.add(key);
|
|
204
|
+
retained.push(entry);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
for (const annotation of companion.graph.schemaAnnotations) {
|
|
208
|
+
budget.step();
|
|
209
|
+
if (!documents.has(canonicalJson([annotation.source.uri, annotation.source.digest])))
|
|
210
|
+
continue;
|
|
211
|
+
countData(annotation);
|
|
212
|
+
const key = canonicalJson(annotation);
|
|
213
|
+
if (!annotationKeys.has(key)) {
|
|
214
|
+
annotationKeys.add(key);
|
|
215
|
+
annotations.push(annotation);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
const linked = [...nodes.values()].map(node => {
|
|
220
|
+
budget.step(node);
|
|
221
|
+
return mapNodeReferences(node, reference => {
|
|
222
|
+
budget.step(node);
|
|
223
|
+
if (reference.kind !== "symbol")
|
|
224
|
+
return reference;
|
|
225
|
+
const id = globalId(reference.role, reference.name);
|
|
226
|
+
if (reference.target !== undefined && reference.target !== id)
|
|
227
|
+
throw new SemanticError("invalid-schema", "Stored companion reference has a mismatched target", node.id, reference.lexical.context.source);
|
|
228
|
+
return nodes.has(id) ? { ...reference, target: id } : reference;
|
|
229
|
+
});
|
|
230
|
+
}).sort((a, b) => { budget.step(); return a.id < b.id ? -1 : a.id > b.id ? 1 : 0; });
|
|
231
|
+
return deepFreeze({ graph: { ...primary, nodes: linked, globals: linked.filter(n => n.identity.kind === "global").map(n => n.id).sort(), origins, schemaAnnotations: annotations, schemaRetained: retained, loading: { ...primary.loading, edges } }, copied: [...copied].sort(), deduplicated: [...deduplicated].sort(), metrics: { steps: budget.steps } });
|
|
232
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateSemanticGraph.d.ts","sourceRoot":"","sources":["../../src/compiler/validateSemanticGraph.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,cAAc,EAAmC,MAAM,qBAAqB,CAAC;AAoF1F,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,GAAE;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAM,GAAG,OAAO,CAAC,KAAK,IAAI,cAAc,CAqLxH"}
|