@techspokes/typescript-wsdl-client 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/README.md +50 -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/generateClient.d.ts.map +1 -1
- package/dist/client/generateClient.js +22 -9
- 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/generated-code.md +4 -0
- package/docs/reference-validation.md +243 -0
- package/docs/releases/v1.1.4.md +36 -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 +27 -13
- package/src/generation/preambles/direct-client/typescript.preamble +3 -0
- package/src/runtime/clientStreamMethods.tpl.txt +1 -1
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { directLimit } from '../compiler/directExecutionPolicy.js';
|
|
2
|
+
import { DIRECT_CLIENT_RUNTIME_VERSION, DIRECT_CLIENT_RUNTIME_REPAIR } from './directClientVersion.js';
|
|
3
|
+
/** Internal native-plan generator. Deliberately absent from index.ts and the CLI. */
|
|
4
|
+
import { checkSemanticBudget } from '../compiler/semanticBudget.js';
|
|
5
|
+
import { writeFileSync } from 'node:fs';
|
|
6
|
+
import { inspectDirectOperation } from '../compiler/directOperation.js';
|
|
7
|
+
import { inspectDirectValueMapping } from '../compiler/directValues.js';
|
|
8
|
+
import { checkDirectSourceCompatibility, createDirectSourceCapsule } from '../compiler/directSourceCapsule.js';
|
|
9
|
+
import { composeGeneratedSource, resolvePreamble } from '../generation/preamble.js';
|
|
10
|
+
const MAX_SOURCE_BYTES = 512 * 1024;
|
|
11
|
+
const generatedArtifacts = new WeakMap();
|
|
12
|
+
/** Roles are separate declarations, so equal local names never merge namespace identities. */
|
|
13
|
+
export function generateDirectClient(expected, signal) {
|
|
14
|
+
const { budget } = inspectDirectOperation(expected.contract).context;
|
|
15
|
+
const failure = (kind, rule) => ({ kind, rule,
|
|
16
|
+
repair: 'Regenerate matched internal direct artifacts from an explicitly authorized source.', usage: Object.freeze({ ...budget.usage() }) });
|
|
17
|
+
try {
|
|
18
|
+
const compatible = checkDirectSourceCompatibility(expected, expected.contract, expected.selection, signal);
|
|
19
|
+
if (compatible.kind !== 'compatible-direct')
|
|
20
|
+
return compatible;
|
|
21
|
+
const capsule = createDirectSourceCapsule(expected.contract, expected.selection, signal);
|
|
22
|
+
if (capsule.kind !== 'direct-capsule')
|
|
23
|
+
return capsule;
|
|
24
|
+
// Bound every variable emission before building strings. Six bytes per UTF-16
|
|
25
|
+
// unit covers JSON escapes; fixed per-slot/role costs cover TypeScript syntax.
|
|
26
|
+
let bound = 16_384 + Math.ceil(capsule.bytes.byteLength / 3) * 4;
|
|
27
|
+
for (const mapping of expected.mappings) {
|
|
28
|
+
inspectDirectValueMapping(mapping, expected.contract);
|
|
29
|
+
if (mapping.direction.kind === 'fault')
|
|
30
|
+
bound += mapping.direction.name.length * 6 + 512;
|
|
31
|
+
for (const slot of mapping.slots)
|
|
32
|
+
bound += 256 + slot.element.name.local.length * 6;
|
|
33
|
+
}
|
|
34
|
+
const selector = expected.contract.selector;
|
|
35
|
+
bound += 6 * (selector.operation.length * 2 + selector.portType.namespace.length + selector.portType.local.length
|
|
36
|
+
+ selector.binding.namespace.length + selector.binding.local.length + expected.selection.service.namespace.length
|
|
37
|
+
+ expected.selection.service.local.length + expected.selection.port.length);
|
|
38
|
+
if (bound > directLimit(budget, MAX_SOURCE_BYTES))
|
|
39
|
+
return failure('resource-limit', 'generated-source-byte-limit');
|
|
40
|
+
const literal = (text) => JSON.stringify(text).replace(/\u2028/g, '\\u2028').replace(/\u2029/g, '\\u2029');
|
|
41
|
+
const primitive = (name) => {
|
|
42
|
+
if (name === 'string')
|
|
43
|
+
return 'string';
|
|
44
|
+
if (name === 'boolean')
|
|
45
|
+
return 'boolean';
|
|
46
|
+
if (name === 'int')
|
|
47
|
+
return 'number';
|
|
48
|
+
throw new TypeError('Unsupported native scalar plan');
|
|
49
|
+
};
|
|
50
|
+
const shape = (supplied) => {
|
|
51
|
+
const mapping = inspectDirectValueMapping(supplied, expected.contract);
|
|
52
|
+
if (mapping.rootBuiltin)
|
|
53
|
+
return primitive(mapping.rootBuiltin.local);
|
|
54
|
+
if (!mapping.slots.length)
|
|
55
|
+
return 'Readonly<Record<string, never>>';
|
|
56
|
+
return '{\n' + mapping.slots.map(slot => {
|
|
57
|
+
if (signal?.aborted)
|
|
58
|
+
throw new Error('cancelled');
|
|
59
|
+
const item = primitive(slot.builtin.local), { min, max } = slot.particle.occurs;
|
|
60
|
+
const type = max === 'unbounded' ? min === '1' ? `readonly [${item}, ...${item}[]]` : `readonly ${item}[]` : item;
|
|
61
|
+
return ` readonly ${literal(slot.element.name.local)}${max === '1' && min === '0' ? '?' : ''}: ${type};`;
|
|
62
|
+
}).join('\n') + '\n}';
|
|
63
|
+
};
|
|
64
|
+
const mappings = expected.mappings;
|
|
65
|
+
const input = mappings.find(m => m.direction.kind === 'input');
|
|
66
|
+
const output = mappings.find(m => m.direction.kind === 'output');
|
|
67
|
+
const faults = mappings.filter(m => m.direction.kind === 'fault');
|
|
68
|
+
const lines = [
|
|
69
|
+
'// Checked direct client; inject checkedDirectRuntimeV1 from the package root.',
|
|
70
|
+
'// Generation remains internal; this unreleased binding supports only the documented direct grammar.',
|
|
71
|
+
'// Static number types require native int32 validation; native checks enforce exact shapes.',
|
|
72
|
+
`export type Request = ${shape(input)};`,
|
|
73
|
+
`export type Response = ${shape(output)};`,
|
|
74
|
+
...faults.map((m, i) => `export type Fault_${i} = ${shape(m)};`),
|
|
75
|
+
'export interface Usage { readonly nodes: number; readonly work: number }',
|
|
76
|
+
'export interface Name { readonly namespace: string; readonly local: string }',
|
|
77
|
+
'export interface Options {',
|
|
78
|
+
' readonly localSource: string; readonly fileRoots: readonly string[]; readonly capsule: Uint8Array;',
|
|
79
|
+
' readonly soap: { readonly service: Name; readonly port: string; readonly endpoint: string;',
|
|
80
|
+
' readonly allowEndpoint: (endpoint: URL) => boolean; readonly signal?: AbortSignal;',
|
|
81
|
+
' readonly timeoutMs?: number; readonly capabilities?: readonly string[];',
|
|
82
|
+
' readonly limits?: { readonly maxBytes?: number; readonly maxDepth?: number; readonly maxNodes?: number; readonly maxText?: number } };',
|
|
83
|
+
'}',
|
|
84
|
+
'export interface Failure {',
|
|
85
|
+
' readonly kind: "incompatible-artifact" | "unsupported" | "missing-authority" | "resource-limit" | "cancelled" | "inconclusive" | "invalid-schema" | "scalar-invalid" | "value-invalid" | "xml-invalid" | "mismatch" | "transport" | "protocol";',
|
|
86
|
+
' readonly rule: string; readonly repair?: string; readonly usage: Usage;',
|
|
87
|
+
'}',
|
|
88
|
+
'export interface NativeSuccess { readonly kind: "soap-response" | "soap-fault"; readonly value: unknown;',
|
|
89
|
+
' readonly admitted: false; readonly status: number; readonly usage: Usage; readonly responseBytes: Uint8Array;',
|
|
90
|
+
' readonly fault?: { readonly name: string; readonly code: Name; readonly string: string; readonly actor?: string }; }',
|
|
91
|
+
`export interface Runtime { readonly version: ${literal(DIRECT_CLIENT_RUNTIME_VERSION)}; execute(expectedBase64: string, input: unknown, options: Options, version: ${literal(DIRECT_CLIENT_RUNTIME_VERSION)}): Promise<Failure | NativeSuccess> }`,
|
|
92
|
+
'type Common = { readonly admitted: false; readonly status: number; readonly usage: Usage; readonly responseBytes: Uint8Array };',
|
|
93
|
+
'export type DeclaredFault = ' + (faults.length ? faults.map((m, i) => {
|
|
94
|
+
if (m.direction.kind !== 'fault')
|
|
95
|
+
throw new TypeError('fault direction');
|
|
96
|
+
return `(Common & { readonly kind: "soap-fault"; readonly value: Fault_${i}; readonly fault: { readonly name: ${literal(m.direction.name)}; readonly code: Name; readonly string: string; readonly actor?: string } })`;
|
|
97
|
+
}).join(' | ') : 'never') + ';',
|
|
98
|
+
'export type Result = Failure | (Common & { readonly kind: "soap-response"; readonly value: Response }) | DeclaredFault;',
|
|
99
|
+
`const capsule = ${literal(Buffer.from(capsule.bytes).toString('base64'))};`,
|
|
100
|
+
`export const selection = ${literal(JSON.stringify({ selector: expected.contract.selector, ...expected.selection }))};`,
|
|
101
|
+
'export function createClient(runtime: Runtime) {',
|
|
102
|
+
' return Object.freeze({',
|
|
103
|
+
` [${literal(expected.contract.selector.operation)}]: async (input: Request, options: Options): Promise<Result> => {`,
|
|
104
|
+
` if (runtime.version !== ${literal(DIRECT_CLIENT_RUNTIME_VERSION)}) return {kind: "incompatible-artifact", rule: "generated-runtime-version", repair: ${literal(DIRECT_CLIENT_RUNTIME_REPAIR)}, usage: {nodes: 0, work: 0}};`,
|
|
105
|
+
' // The installed native binding pins the literal capsule before issuing fresh authority.',
|
|
106
|
+
` return await runtime.execute(capsule, input, options, ${literal(DIRECT_CLIENT_RUNTIME_VERSION)}) as Result;`,
|
|
107
|
+
' },',
|
|
108
|
+
' });',
|
|
109
|
+
'}',
|
|
110
|
+
'',
|
|
111
|
+
];
|
|
112
|
+
const source = composeGeneratedSource(lines.join('\n'), resolvePreamble('direct-client'));
|
|
113
|
+
if (Buffer.byteLength(source) > directLimit(budget, MAX_SOURCE_BYTES))
|
|
114
|
+
return failure('resource-limit', 'generated-source-byte-limit');
|
|
115
|
+
if (signal?.aborted)
|
|
116
|
+
return failure('cancelled', 'cooperative-cancellation');
|
|
117
|
+
const result = Object.freeze({ kind: 'generated-direct-client', source, capsule: capsule.bytes, admitted: false, usage: Object.freeze({ ...budget.usage() }) });
|
|
118
|
+
generatedArtifacts.set(result, budget);
|
|
119
|
+
return result;
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
if (budget.exhausted())
|
|
123
|
+
return failure('resource-limit', 'request-budget');
|
|
124
|
+
if (signal?.aborted)
|
|
125
|
+
return failure('cancelled', 'cooperative-cancellation');
|
|
126
|
+
throw error;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/** Only authentic bounded artifacts may be written; prior semantic failure remains terminal. */
|
|
130
|
+
export function writeDirectClient(file, generated) {
|
|
131
|
+
const budget = generatedArtifacts.get(generated);
|
|
132
|
+
if (!budget)
|
|
133
|
+
throw new TypeError('Authentic generated artifact required');
|
|
134
|
+
checkSemanticBudget(budget);
|
|
135
|
+
writeFileSync(file, generated.source, 'utf8');
|
|
136
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SchemaInput } from "../loader/schemaInput.js";
|
|
2
|
+
import type { CanonicalGraph } from "./canonicalGraph.js";
|
|
3
|
+
export declare function buildCanonicalGraph(input: SchemaInput, options?: {
|
|
4
|
+
maxNodes?: number;
|
|
5
|
+
requestBudget?: import("./semanticBudget.js").SemanticBudget;
|
|
6
|
+
}): CanonicalGraph;
|
|
7
|
+
//# sourceMappingURL=buildCanonicalGraph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildCanonicalGraph.d.ts","sourceRoot":"","sources":["../../src/compiler/buildCanonicalGraph.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,WAAW,EAAuB,MAAM,0BAA0B,CAAC;AAEhF,OAAO,KAAK,EAAC,cAAc,EAAwI,MAAM,qBAAqB,CAAC;AAS/L,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,GAAE;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,qBAAqB,EAAE,cAAc,CAAA;CAAM,GAAG,cAAc,CAmSvK"}
|
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
/** Pure two-phase construction from the repository-owned S03 adapter; no I/O or expansion. */
|
|
2
|
+
import { resolveLexicalQName, syntaxAttribute, syntaxElements, XSD_NAMESPACE, WSDL_NAMESPACE } from "../loader/orderedSyntax.js";
|
|
3
|
+
import { DEFAULT_GRAPH_NODES, GRAPH_MODEL, GraphError, globalId, scopedId, deepFreeze, isBuiltinType, wsdlReferenceRoles } from "./canonicalGraph.js";
|
|
4
|
+
import { mapNodeReferences } from "./graphTraversal.js";
|
|
5
|
+
const declarationRoles = Object.assign(Object.create(null), { element: "element", attribute: "attribute", simpleType: "type", complexType: "type", group: "group", attributeGroup: "attributeGroup" });
|
|
6
|
+
const particleKinds = new Set(["sequence", "choice", "all", "element", "group", "any"]);
|
|
7
|
+
const facetKinds = new Set(["enumeration", "pattern", "whiteSpace", "length", "minLength", "maxLength", "minInclusive", "minExclusive", "maxInclusive", "maxExclusive", "totalDigits", "fractionDigits"]);
|
|
8
|
+
export function buildCanonicalGraph(input, options = {}) {
|
|
9
|
+
let allocated = 0;
|
|
10
|
+
const chargeText = (text) => options.requestBudget?.chargeWork(64 + text.length * 16);
|
|
11
|
+
const maxNodes = options.maxNodes ?? DEFAULT_GRAPH_NODES;
|
|
12
|
+
if (!Number.isSafeInteger(maxNodes) || maxNodes < 1)
|
|
13
|
+
throw new RangeError("maxNodes must be a positive safe integer");
|
|
14
|
+
// Precharge the source-sized reservation/indexing scans independently of source preparation.
|
|
15
|
+
options.requestBudget?.freeze(input);
|
|
16
|
+
const nodes = new Map();
|
|
17
|
+
const scopedRoles = new Map();
|
|
18
|
+
const reserved = new Map();
|
|
19
|
+
const origins = Object.create(null);
|
|
20
|
+
const annotations = [];
|
|
21
|
+
const schemaRetained = [];
|
|
22
|
+
const fail = (node, message) => { throw new GraphError("invalid-schema", message, node.source); };
|
|
23
|
+
const elementOnly = (node) => {
|
|
24
|
+
if (node.children.some(c => c.kind === "text" && /[^\t\r\n ]/.test(c.value)))
|
|
25
|
+
fail(node, "Non-whitespace text in element-only schema content");
|
|
26
|
+
};
|
|
27
|
+
const context = (node, schema) => {
|
|
28
|
+
options.requestBudget?.freeze(node);
|
|
29
|
+
chargeText(node.source.uri);
|
|
30
|
+
chargeText(node.source.path);
|
|
31
|
+
chargeText(node.baseUri);
|
|
32
|
+
chargeText(schema.targetNamespace);
|
|
33
|
+
for (const [prefix, namespace] of Object.entries(node.namespaces)) {
|
|
34
|
+
chargeText(prefix);
|
|
35
|
+
chargeText(namespace);
|
|
36
|
+
}
|
|
37
|
+
return ({ namespaces: node.namespaces, baseUri: node.baseUri, source: node.source,
|
|
38
|
+
effectiveNamespace: schema.targetNamespace, chameleon: schema.context.kind === "include" && !syntaxAttribute(schema.syntax, "targetNamespace"), schemaAttributes: schema.syntax.attributes });
|
|
39
|
+
};
|
|
40
|
+
const lexical = (value, node, scope) => { chargeText(value); return { value, context: context(node, scope.schema) }; };
|
|
41
|
+
const required = (node, name) => syntaxAttribute(node, name) ?? fail(node, `Missing ${name} attribute`);
|
|
42
|
+
const bool = (node, name, fallback = false) => {
|
|
43
|
+
const v = syntaxAttribute(node, name);
|
|
44
|
+
if (v === undefined)
|
|
45
|
+
return fallback;
|
|
46
|
+
if (["true", "1"].includes(v.trim()))
|
|
47
|
+
return true;
|
|
48
|
+
if (["false", "0"].includes(v.trim()))
|
|
49
|
+
return false;
|
|
50
|
+
return fail(node, `Invalid ${name} boolean`);
|
|
51
|
+
};
|
|
52
|
+
const choice = (node, attr, allowed, fallback) => {
|
|
53
|
+
const value = syntaxAttribute(node, attr)?.trim() ?? fallback;
|
|
54
|
+
if (!allowed.includes(value))
|
|
55
|
+
return fail(node, `Invalid ${attr} value`);
|
|
56
|
+
return value;
|
|
57
|
+
};
|
|
58
|
+
const named = (node, namespace) => {
|
|
59
|
+
const local = required(node, "name");
|
|
60
|
+
chargeText(local);
|
|
61
|
+
chargeText(namespace);
|
|
62
|
+
// Validate NCName through the adapter without letting the default namespace define identity.
|
|
63
|
+
const resolved = resolveLexicalQName(local, node);
|
|
64
|
+
if (local.includes(":"))
|
|
65
|
+
return fail(node, "Declaration name must be an NCName");
|
|
66
|
+
return { namespace, local: resolved.local };
|
|
67
|
+
};
|
|
68
|
+
const occurrence = (node) => {
|
|
69
|
+
const finite = (v) => {
|
|
70
|
+
const trimmed = v.trim();
|
|
71
|
+
if (!/^[+-]?\d+$/.test(trimmed))
|
|
72
|
+
return fail(node, "Occurrence must be a nonnegative integer");
|
|
73
|
+
const canonical = trimmed.replace(/^[+-]/, "").replace(/^0+(?=\d)/, "");
|
|
74
|
+
if (trimmed.startsWith("-") && canonical !== "0")
|
|
75
|
+
return fail(node, "Occurrence must be a nonnegative integer");
|
|
76
|
+
return canonical;
|
|
77
|
+
};
|
|
78
|
+
const min = finite(syntaxAttribute(node, "minOccurs") ?? "1");
|
|
79
|
+
const rawMax = syntaxAttribute(node, "maxOccurs")?.trim() ?? "1";
|
|
80
|
+
const max = rawMax === "unbounded" ? rawMax : finite(rawMax);
|
|
81
|
+
if (max !== "unbounded" && (min.length > max.length || (min.length === max.length && min > max)))
|
|
82
|
+
return fail(node, "Occurrence minimum exceeds maximum");
|
|
83
|
+
return { min, max };
|
|
84
|
+
};
|
|
85
|
+
const ref = (value, role, node, scope) => {
|
|
86
|
+
chargeText(value);
|
|
87
|
+
const lexicalName = resolveLexicalQName(value, node);
|
|
88
|
+
// XSD chameleon adoption changes component interpretation, never lexical namespace bindings.
|
|
89
|
+
const name = !lexicalName.namespace && context(node, scope.schema).chameleon
|
|
90
|
+
? { namespace: scope.schema.targetNamespace, local: lexicalName.local } : lexicalName;
|
|
91
|
+
if (role === "type" && name.namespace === XSD_NAMESPACE && isBuiltinType(name.local))
|
|
92
|
+
return { kind: "builtin", name, lexical: lexical(value, node, scope) };
|
|
93
|
+
return { kind: "symbol", role, name, lexical: lexical(value, node, scope) };
|
|
94
|
+
};
|
|
95
|
+
const builtin = (local) => ({ kind: "builtin", name: { namespace: XSD_NAMESPACE, local } });
|
|
96
|
+
const idFor = (node, scope, role) => {
|
|
97
|
+
chargeText(node.source.path);
|
|
98
|
+
chargeText(scope.owner);
|
|
99
|
+
chargeText(scope.rootPath);
|
|
100
|
+
const id = scopedId(scope.owner, node.source.path.slice(scope.rootPath.length) || "/", role);
|
|
101
|
+
scopedRoles.set(id, role);
|
|
102
|
+
return id;
|
|
103
|
+
};
|
|
104
|
+
const base = (node, scope, id, identity, consumed = []) => {
|
|
105
|
+
if (allocated >= maxNodes)
|
|
106
|
+
throw new GraphError("resource-limit", `Canonical graph exceeds ${maxNodes} nodes`, node.source);
|
|
107
|
+
options.requestBudget?.reserveNodes(1);
|
|
108
|
+
allocated += 1;
|
|
109
|
+
// Retained syntax/namespaces are charged before constructing the record.
|
|
110
|
+
options.requestBudget?.freeze(node);
|
|
111
|
+
if (node.name.namespace === XSD_NAMESPACE)
|
|
112
|
+
elementOnly(node);
|
|
113
|
+
return { id,
|
|
114
|
+
identity: identity ?? { kind: "scoped", owner: scope.owner, path: node.source.path.slice(scope.rootPath.length) || "/", role: scopedRoles.get(id) },
|
|
115
|
+
context: context(node, scope.schema), declaredAttributes: node.attributes,
|
|
116
|
+
annotations: syntaxElements(node, XSD_NAMESPACE, "annotation"), syntaxDetails: [],
|
|
117
|
+
retained: syntaxElements(node).filter(c => c.name.namespace !== XSD_NAMESPACE || (c.name.local !== "annotation" && !consumed.includes(c.name.local))) };
|
|
118
|
+
};
|
|
119
|
+
const put = (node, scope) => {
|
|
120
|
+
options.requestBudget?.chargeWork(1024);
|
|
121
|
+
if (nodes.has(node.id))
|
|
122
|
+
throw new GraphError("invalid-schema", "Duplicate scoped graph identity", node.context.source);
|
|
123
|
+
if (nodes.size >= maxNodes)
|
|
124
|
+
throw new GraphError("resource-limit", `Canonical graph exceeds ${maxNodes} nodes`, node.context.source);
|
|
125
|
+
nodes.set(node.id, node);
|
|
126
|
+
origins[node.id] = [{ interpretation: scope.schema.key, context: node.context }];
|
|
127
|
+
return node.id;
|
|
128
|
+
};
|
|
129
|
+
const valueConstraint = (node, scope) => {
|
|
130
|
+
const d = syntaxAttribute(node, "default"), f = syntaxAttribute(node, "fixed");
|
|
131
|
+
if (d !== undefined && f !== undefined)
|
|
132
|
+
return fail(node, "Default and fixed are mutually exclusive");
|
|
133
|
+
return d !== undefined ? { kind: "default", lexical: lexical(d, node, scope) } : f !== undefined ? { kind: "fixed", lexical: lexical(f, node, scope) } : undefined;
|
|
134
|
+
};
|
|
135
|
+
const facets = (node, scope) => syntaxElements(node, XSD_NAMESPACE).filter(n => facetKinds.has(n.name.local)).map(n => ({ name: n.name.local,
|
|
136
|
+
lexical: lexical(required(n, "value"), n, scope), fixed: bool(n, "fixed"), syntax: n }));
|
|
137
|
+
const wildcard = (node, scope) => ({ namespace: lexical(syntaxAttribute(node, "namespace") ?? "##any", node, scope),
|
|
138
|
+
processContents: choice(node, "processContents", ["strict", "lax", "skip"], "strict") });
|
|
139
|
+
const one = (nodes, node, description) => {
|
|
140
|
+
if (nodes.length > 1)
|
|
141
|
+
return fail(node, `Multiple ${description}`);
|
|
142
|
+
return nodes[0];
|
|
143
|
+
};
|
|
144
|
+
const typeFor = (node, scope, fallback) => {
|
|
145
|
+
const type = syntaxAttribute(node, "type");
|
|
146
|
+
const inline = one(syntaxElements(node, XSD_NAMESPACE).filter(c => ["simpleType", "complexType"].includes(c.name.local)), node, "inline types");
|
|
147
|
+
if (type && inline)
|
|
148
|
+
return fail(node, "Named and inline types are mutually exclusive");
|
|
149
|
+
return type !== undefined ? ref(type, "type", node, scope) : inline ? { kind: "local", target: buildType(inline, scope) } : builtin(fallback);
|
|
150
|
+
};
|
|
151
|
+
const declaration = (node, scope, role, global) => {
|
|
152
|
+
if (syntaxAttribute(node, "ref") !== undefined)
|
|
153
|
+
return fail(node, "Reference is a use, not a declaration");
|
|
154
|
+
if (global && (syntaxAttribute(node, "minOccurs") !== undefined || syntaxAttribute(node, "maxOccurs") !== undefined || syntaxAttribute(node, "form") !== undefined))
|
|
155
|
+
return fail(node, "Global declarations cannot carry occurrence or form");
|
|
156
|
+
const form = choice(node, "form", ["qualified", "unqualified"], choice(scope.schema.syntax, role === "element" ? "elementFormDefault" : "attributeFormDefault", ["qualified", "unqualified"], "unqualified"));
|
|
157
|
+
const name = named(node, global || form === "qualified" ? scope.schema.targetNamespace : "");
|
|
158
|
+
const id = global ? globalId(role, name) : idFor(node, scope, role);
|
|
159
|
+
const inner = { schema: scope.schema, owner: id, rootPath: node.source.path };
|
|
160
|
+
const common = { ...base(node, scope, id, global, ["simpleType", "complexType"]), name, type: typeFor(node, inner, role === "element" ? "anyType" : "anySimpleType"), value: valueConstraint(node, scope) };
|
|
161
|
+
if (role === "attribute") {
|
|
162
|
+
if (syntaxElements(node, XSD_NAMESPACE, "complexType").length)
|
|
163
|
+
return fail(node, "Attributes require simple types");
|
|
164
|
+
return put({ ...common, kind: "attribute" }, scope);
|
|
165
|
+
}
|
|
166
|
+
const sg = syntaxAttribute(node, "substitutionGroup");
|
|
167
|
+
return put({ ...common, kind: "element", nillable: bool(node, "nillable"), abstract: bool(node, "abstract"), substitutionGroup: sg === undefined ? undefined : ref(sg, "element", node, scope) }, scope);
|
|
168
|
+
};
|
|
169
|
+
const particle = (node, scope) => {
|
|
170
|
+
const id = idFor(node, scope, "particle"), occurs = occurrence(node);
|
|
171
|
+
const common = { ...base(node, scope, id, undefined, ["sequence", "choice", "all", "element", "group", "any"]), kind: "particle", occurs };
|
|
172
|
+
const kind = node.name.local;
|
|
173
|
+
if (["sequence", "choice", "all"].includes(kind)) {
|
|
174
|
+
const children = syntaxElements(node, XSD_NAMESPACE).filter(c => particleKinds.has(c.name.local));
|
|
175
|
+
if (children.some(c => c.name.local === "all"))
|
|
176
|
+
return fail(node, "XSD 1.0 all cannot be nested inside a compositor");
|
|
177
|
+
if (kind === "all" && (occurs.max !== "1" || !["0", "1"].includes(occurs.min)))
|
|
178
|
+
return fail(node, "XSD 1.0 all requires min 0/1 and max 1");
|
|
179
|
+
if (kind === "all" && children.some(c => c.name.local !== "element" || !["0", "1"].includes(occurrence(c).min) || !["0", "1"].includes(occurrence(c).max)))
|
|
180
|
+
return fail(node, "XSD 1.0 all children must be elements with 0/1 bounds");
|
|
181
|
+
return put({ ...common, term: { kind: kind, children: children.map(c => particle(c, scope)) } }, scope);
|
|
182
|
+
}
|
|
183
|
+
if (kind === "any")
|
|
184
|
+
return put({ ...common, term: { kind: "any", wildcard: wildcard(node, scope) } }, scope);
|
|
185
|
+
if (kind === "group") {
|
|
186
|
+
if (syntaxAttribute(node, "name") !== undefined || syntaxElements(node, XSD_NAMESPACE).some(c => particleKinds.has(c.name.local)))
|
|
187
|
+
return fail(node, "Group uses require only a reference");
|
|
188
|
+
return put({ ...common, term: { kind: "group", reference: ref(required(node, "ref"), "group", node, scope) } }, scope);
|
|
189
|
+
}
|
|
190
|
+
const r = syntaxAttribute(node, "ref");
|
|
191
|
+
if (r !== undefined && ["name", "type", "form", "default", "fixed", "nillable"].some(a => syntaxAttribute(node, a) !== undefined))
|
|
192
|
+
return fail(node, "Element references cannot redeclare their target");
|
|
193
|
+
if (r !== undefined && syntaxElements(node, XSD_NAMESPACE).some(c => c.name.local !== "annotation"))
|
|
194
|
+
return fail(node, "Element references cannot contain declarations");
|
|
195
|
+
return put({ ...common, term: { kind: "element", declaration: r !== undefined ? ref(r, "element", node, scope) : { kind: "local", target: declaration(node, scope, "element") } } }, scope);
|
|
196
|
+
};
|
|
197
|
+
const attributes = (node, scope) => syntaxElements(node, XSD_NAMESPACE).filter(c => ["attribute", "attributeGroup", "anyAttribute"].includes(c.name.local)).map(c => {
|
|
198
|
+
const id = idFor(c, scope, "attributeUse"), common = base(c, scope, id, undefined, ["simpleType"]);
|
|
199
|
+
if (c.name.local === "anyAttribute")
|
|
200
|
+
return put({ ...common, kind: "attributeWildcard", wildcard: wildcard(c, scope) }, scope);
|
|
201
|
+
if (c.name.local === "attributeGroup")
|
|
202
|
+
return put({ ...common, kind: "attributeGroupUse", reference: ref(required(c, "ref"), "attributeGroup", c, scope) }, scope);
|
|
203
|
+
const r = syntaxAttribute(c, "ref");
|
|
204
|
+
if (r !== undefined && ["name", "type", "form"].some(a => syntaxAttribute(c, a) !== undefined))
|
|
205
|
+
return fail(c, "Attribute references cannot redeclare their target");
|
|
206
|
+
if (r !== undefined && syntaxElements(c, XSD_NAMESPACE).some(n => n.name.local !== "annotation"))
|
|
207
|
+
return fail(c, "Attribute references cannot contain declarations");
|
|
208
|
+
return put({ ...common, kind: "attributeUse", declaration: r !== undefined ? ref(r, "attribute", c, scope) : { kind: "local", target: declaration(c, scope, "attribute") },
|
|
209
|
+
use: choice(c, "use", ["optional", "required", "prohibited"], "optional"), value: valueConstraint(c, scope) }, scope);
|
|
210
|
+
});
|
|
211
|
+
const buildType = (node, scope, global) => {
|
|
212
|
+
const id = global?.kind === "global" ? globalId("type", global.name) : idFor(node, scope, "type");
|
|
213
|
+
const inner = { schema: scope.schema, owner: id, rootPath: node.source.path };
|
|
214
|
+
const inlineSimple = (container) => {
|
|
215
|
+
const inline = one(syntaxElements(container, XSD_NAMESPACE, "simpleType"), container, "inline simple types");
|
|
216
|
+
return inline ? { kind: "local", target: buildType(inline, inner) } : undefined;
|
|
217
|
+
};
|
|
218
|
+
if (node.name.local === "simpleType") {
|
|
219
|
+
const body = one(syntaxElements(node, XSD_NAMESPACE).filter(c => ["restriction", "list", "union"].includes(c.name.local)), node, "simple type varieties") ?? fail(node, "Simple type requires restriction, list or union");
|
|
220
|
+
elementOnly(body);
|
|
221
|
+
const common = { ...base(node, scope, id, global, ["restriction", "list", "union"]), kind: "simpleType",
|
|
222
|
+
annotations: [...syntaxElements(node, XSD_NAMESPACE, "annotation"), ...syntaxElements(body, XSD_NAMESPACE, "annotation")], syntaxDetails: [body],
|
|
223
|
+
retained: [...syntaxElements(node).filter(c => c.name.namespace !== XSD_NAMESPACE || !["annotation", "restriction", "list", "union"].includes(c.name.local)),
|
|
224
|
+
...syntaxElements(body).filter(c => c.name.namespace !== XSD_NAMESPACE || !["annotation", "simpleType", ...(body.name.local === "restriction" ? [...facetKinds] : [])].includes(c.name.local))] };
|
|
225
|
+
if (body.name.local === "union") {
|
|
226
|
+
const members = (syntaxAttribute(body, "memberTypes")?.trim().split(/\s+/).filter(Boolean) ?? []).map(v => ref(v, "type", body, inner));
|
|
227
|
+
for (const c of syntaxElements(body, XSD_NAMESPACE, "simpleType"))
|
|
228
|
+
members.push({ kind: "local", target: buildType(c, inner) });
|
|
229
|
+
if (!members.length)
|
|
230
|
+
return fail(body, "Union requires members");
|
|
231
|
+
return put({ ...common, variety: { kind: "union", members } }, scope);
|
|
232
|
+
}
|
|
233
|
+
const attr = body.name.local === "list" ? "itemType" : "base";
|
|
234
|
+
const value = syntaxAttribute(body, attr), inline = inlineSimple(body);
|
|
235
|
+
if (value !== undefined && inline)
|
|
236
|
+
return fail(body, "Named and inline scalar references are mutually exclusive");
|
|
237
|
+
const reference = value !== undefined ? ref(value, "type", body, inner) : inline ?? fail(body, `Missing ${attr} or inline type`);
|
|
238
|
+
return put({ ...common, variety: body.name.local === "list" ? { kind: "list", item: reference } : { kind: "restriction", base: reference, facets: facets(body, inner) } }, scope);
|
|
239
|
+
}
|
|
240
|
+
const wrapper = one(syntaxElements(node, XSD_NAMESPACE).filter(c => ["simpleContent", "complexContent"].includes(c.name.local)), node, "content wrappers");
|
|
241
|
+
const body = wrapper ? one(syntaxElements(wrapper, XSD_NAMESPACE).filter(c => ["extension", "restriction"].includes(c.name.local)), wrapper, "derivations") ?? fail(wrapper, "Missing content derivation") : node;
|
|
242
|
+
if (wrapper) {
|
|
243
|
+
elementOnly(wrapper);
|
|
244
|
+
elementOnly(body);
|
|
245
|
+
}
|
|
246
|
+
if (wrapper && syntaxElements(node, XSD_NAMESPACE).some(c => particleKinds.has(c.name.local) || ["attribute", "attributeGroup", "anyAttribute"].includes(c.name.local)))
|
|
247
|
+
return fail(node, "Content wrappers cannot coexist with direct content");
|
|
248
|
+
const content = one(syntaxElements(body, XSD_NAMESPACE).filter(c => particleKinds.has(c.name.local)), body, "content particles");
|
|
249
|
+
if (content && !["sequence", "choice", "all", "group"].includes(content.name.local))
|
|
250
|
+
return fail(content, "Complex type content requires a compositor or group reference");
|
|
251
|
+
if (content && wrapper?.name.local === "simpleContent")
|
|
252
|
+
return fail(content, "Simple content cannot contain a particle");
|
|
253
|
+
return put({ ...base(node, scope, id, global, ["simpleContent", "complexContent", "sequence", "choice", "all", "group", "attribute", "attributeGroup", "anyAttribute"]),
|
|
254
|
+
kind: "complexType", mixed: wrapper ? bool(wrapper, "mixed", bool(node, "mixed")) : bool(node, "mixed"), abstract: bool(node, "abstract"),
|
|
255
|
+
annotations: [...syntaxElements(node, XSD_NAMESPACE, "annotation"), ...(wrapper ? [...syntaxElements(wrapper, XSD_NAMESPACE, "annotation"), ...syntaxElements(body, XSD_NAMESPACE, "annotation")] : [])],
|
|
256
|
+
syntaxDetails: wrapper ? [wrapper] : [],
|
|
257
|
+
retained: [...syntaxElements(node).filter(c => c.name.namespace !== XSD_NAMESPACE || !["annotation", "simpleContent", "complexContent", ...particleKinds, "attribute", "attributeGroup", "anyAttribute"].includes(c.name.local)),
|
|
258
|
+
...(wrapper ? [...syntaxElements(wrapper).filter(c => c.name.namespace !== XSD_NAMESPACE || !["annotation", "extension", "restriction"].includes(c.name.local)),
|
|
259
|
+
...syntaxElements(body).filter(c => c.name.namespace !== XSD_NAMESPACE || !["annotation", ...(wrapper.name.local === "simpleContent" && body.name.local === "restriction" ? ["simpleType"] : []), ...particleKinds, ...facetKinds, "attribute", "attributeGroup", "anyAttribute"].includes(c.name.local))] : [])],
|
|
260
|
+
content: content ? particle(content, inner) : undefined, attributes: attributes(body, inner),
|
|
261
|
+
derivation: wrapper ? { kind: body.name.local, contentKind: wrapper.name.local === "simpleContent" ? "simple" : "complex",
|
|
262
|
+
base: ref(required(body, "base"), "type", body, inner), inlineType: wrapper.name.local === "simpleContent" && body.name.local === "restriction" ? inlineSimple(body) : undefined,
|
|
263
|
+
facets: facets(body, inner) } : undefined }, scope);
|
|
264
|
+
};
|
|
265
|
+
// Phase 1: reserve global symbol space, independent of interpretation keys and traversal order.
|
|
266
|
+
for (const schema of input.schemas) {
|
|
267
|
+
elementOnly(schema.syntax);
|
|
268
|
+
annotations.push(...syntaxElements(schema.syntax, XSD_NAMESPACE, "annotation"));
|
|
269
|
+
for (const child of syntaxElements(schema.syntax)) {
|
|
270
|
+
if (child.name.namespace !== XSD_NAMESPACE || !["annotation", ...Object.keys(declarationRoles)].includes(child.name.local))
|
|
271
|
+
schemaRetained.push({ context: context(child, schema), syntax: child });
|
|
272
|
+
}
|
|
273
|
+
for (const node of syntaxElements(schema.syntax, XSD_NAMESPACE)) {
|
|
274
|
+
const role = declarationRoles[node.name.local];
|
|
275
|
+
if (!role)
|
|
276
|
+
continue;
|
|
277
|
+
const name = named(node, schema.targetNamespace), id = globalId(role, name), prior = reserved.get(id);
|
|
278
|
+
if (prior) {
|
|
279
|
+
if (prior.node.source.digest !== node.source.digest || prior.node.source.path !== node.source.path)
|
|
280
|
+
fail(node, "Conflicting global symbol declarations");
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
if (reserved.size >= maxNodes)
|
|
284
|
+
throw new GraphError("resource-limit", `Canonical graph exceeds ${maxNodes} declarations`, node.source);
|
|
285
|
+
reserved.set(id, { node, schema });
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
// Phase 2: build complete bodies. References are linked afterward, never expanded into stubs.
|
|
290
|
+
for (const [id, { node, schema }] of reserved) {
|
|
291
|
+
const scope = { schema, owner: id, rootPath: node.source.path };
|
|
292
|
+
const role = declarationRoles[node.name.local], identity = { kind: "global", role, name: named(node, schema.targetNamespace) };
|
|
293
|
+
if (role === "type")
|
|
294
|
+
buildType(node, scope, identity);
|
|
295
|
+
else if (role === "element" || role === "attribute")
|
|
296
|
+
declaration(node, scope, role, identity);
|
|
297
|
+
else if (role === "group") {
|
|
298
|
+
const content = one(syntaxElements(node, XSD_NAMESPACE).filter(c => ["sequence", "choice", "all"].includes(c.name.local)), node, "group content") ?? fail(node, "Group requires compositor content");
|
|
299
|
+
if (syntaxAttribute(content, "minOccurs") !== undefined || syntaxAttribute(content, "maxOccurs") !== undefined)
|
|
300
|
+
fail(content, "Group definition content cannot carry occurrence bounds");
|
|
301
|
+
put({ ...base(node, scope, id, identity, ["sequence", "choice", "all"]), kind: "group", content: particle(content, scope) }, scope);
|
|
302
|
+
}
|
|
303
|
+
else
|
|
304
|
+
put({ ...base(node, scope, id, identity, ["attribute", "attributeGroup", "anyAttribute"]), kind: "attributeGroup", attributes: attributes(node, scope) }, scope);
|
|
305
|
+
}
|
|
306
|
+
// WSDL references remain ordered and role-qualified for later operation/binding planning.
|
|
307
|
+
for (const doc of input.documents) {
|
|
308
|
+
if (doc.root.name.namespace !== WSDL_NAMESPACE)
|
|
309
|
+
continue;
|
|
310
|
+
const namespace = syntaxAttribute(doc.root, "targetNamespace") ?? "";
|
|
311
|
+
const schema = { key: doc.uri, syntax: doc.root, documentUri: doc.uri, digest: doc.digest, baseUri: doc.root.baseUri, targetNamespace: namespace, context: { kind: "root", namespace } };
|
|
312
|
+
for (const node of syntaxElements(doc.root, WSDL_NAMESPACE).filter(n => ["message", "portType", "binding", "service"].includes(n.name.local))) {
|
|
313
|
+
const role = node.name.local, name = named(node, namespace), id = globalId(role, name);
|
|
314
|
+
const scope = { schema, owner: id, rootPath: node.source.path };
|
|
315
|
+
const references = [];
|
|
316
|
+
const visit = (n) => {
|
|
317
|
+
options.requestBudget?.freeze(n);
|
|
318
|
+
const roles = wsdlReferenceRoles(n);
|
|
319
|
+
for (const [attribute, targetRole] of Object.entries(roles)) {
|
|
320
|
+
const value = syntaxAttribute(n, attribute);
|
|
321
|
+
if (value !== undefined)
|
|
322
|
+
references.push({ path: n.source.path.slice(node.source.path.length) || "/", attribute, reference: ref(value, targetRole, n, scope) });
|
|
323
|
+
}
|
|
324
|
+
for (const c of syntaxElements(n))
|
|
325
|
+
visit(c);
|
|
326
|
+
};
|
|
327
|
+
visit(node);
|
|
328
|
+
put({ ...base(node, scope, id, { kind: "global", role, name }), retained: [], kind: "wsdl", role, name, syntax: node, references }, scope);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
const link = (r) => {
|
|
332
|
+
options.requestBudget?.chargeWork(128);
|
|
333
|
+
if (r.kind !== "symbol")
|
|
334
|
+
return r;
|
|
335
|
+
chargeText(r.name.namespace);
|
|
336
|
+
chargeText(r.name.local);
|
|
337
|
+
const target = globalId(r.role, r.name);
|
|
338
|
+
return { ...r, ...(nodes.has(target) ? { target } : {}) };
|
|
339
|
+
};
|
|
340
|
+
const linkNode = (node) => mapNodeReferences(node, link);
|
|
341
|
+
// All loading contexts remain provenance; they do not multiply global symbols or local bodies.
|
|
342
|
+
const ownerCache = new Map();
|
|
343
|
+
const rootOwner = (n) => {
|
|
344
|
+
options.requestBudget?.chargeWork(64 + n.id.length * 4);
|
|
345
|
+
if (n.identity.kind === "global")
|
|
346
|
+
return n.id;
|
|
347
|
+
const prior = ownerCache.get(n.id);
|
|
348
|
+
if (prior)
|
|
349
|
+
return prior;
|
|
350
|
+
const owner = rootOwner(nodes.get(n.identity.owner));
|
|
351
|
+
ownerCache.set(n.id, owner);
|
|
352
|
+
return owner;
|
|
353
|
+
};
|
|
354
|
+
const owned = new Map();
|
|
355
|
+
for (const n of nodes.values()) {
|
|
356
|
+
const owner = rootOwner(n), group = owned.get(owner) ?? [];
|
|
357
|
+
group.push(n);
|
|
358
|
+
owned.set(owner, group);
|
|
359
|
+
}
|
|
360
|
+
for (const schema of input.schemas)
|
|
361
|
+
for (const node of syntaxElements(schema.syntax, XSD_NAMESPACE)) {
|
|
362
|
+
const role = declarationRoles[node.name.local];
|
|
363
|
+
if (!role)
|
|
364
|
+
continue;
|
|
365
|
+
const id = globalId(role, named(node, schema.targetNamespace));
|
|
366
|
+
if (!origins[id].some(o => o.interpretation === schema.key)) {
|
|
367
|
+
const paths = new Map();
|
|
368
|
+
const visit = (n) => { options.requestBudget?.freeze(n); paths.set(n.source.path, n); for (const c of syntaxElements(n))
|
|
369
|
+
visit(c); };
|
|
370
|
+
visit(node);
|
|
371
|
+
for (const n of owned.get(id) ?? [])
|
|
372
|
+
origins[n.id].push({ interpretation: schema.key, context: context(paths.get(n.context.source.path), schema) });
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
const data = [...nodes.values()];
|
|
376
|
+
const ordered = options.requestBudget ? options.requestBudget.sorted(data, (a, b) => options.requestBudget.compareText(a.id, b.id)) : data.sort((a, b) => a.id < b.id ? -1 : a.id > b.id ? 1 : 0);
|
|
377
|
+
const result = { model: GRAPH_MODEL, nodes: ordered.map(linkNode),
|
|
378
|
+
globals: ordered.filter(n => n.identity.kind === "global").map(n => n.id), origins,
|
|
379
|
+
schemaAnnotations: annotations, schemaRetained, loading: { limits: input.limits, edges: input.edges } };
|
|
380
|
+
return options.requestBudget ? options.requestBudget.freeze(result) : deepFreeze(result);
|
|
381
|
+
}
|