@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,663 @@
|
|
|
1
|
+
import { containedNodes } from './graphTraversal.js';
|
|
2
|
+
import { assertSemanticContext } from './semanticContext.js';
|
|
3
|
+
import { checkActualSchemaSyntax } from './schemaSyntaxAssessment.js';
|
|
4
|
+
import { checkDeclaration } from './schemaDeclarationPrimitives.js';
|
|
5
|
+
import { assessAttributeUse, assessRawAttributeUses, assessCandidateAttributeUses, assessSourceAttributeUses } from './schemaAttributeUses.js';
|
|
6
|
+
import { createSchemaScalarKernel } from './schemaScalarKernel.js';
|
|
7
|
+
import { checkImmediateTypeFinal, immediateTypeBase } from './schemaTypeRelations.js';
|
|
8
|
+
import { deriveActualComplexContent, deriveRawComplexContent, deriveOriginalComplexPropertyContent, deriveOriginalContentSubtree, particleContentNode, deriveBuiltinAnyTypeContent, deriveModelGroupContent, originalUrWildcardSource } from './complexTypeContent.js';
|
|
9
|
+
import { validateRawComplexTypeProperties } from './re01TypePropertyValidation.js';
|
|
10
|
+
import { isXmlNCName, XSD_NAMESPACE } from '../loader/orderedSyntax.js';
|
|
11
|
+
import { wildcardNamespaces, namespaceExpressible } from './wildcardAlgebra.js';
|
|
12
|
+
import { readParticleWildcard } from './schemaParticleWildcardProperties.js';
|
|
13
|
+
import { SemanticError } from './resolveCanonicalGraph.js';
|
|
14
|
+
import { occurrenceAlgebra } from './occurrenceAnalysis.js';
|
|
15
|
+
import { checkComplexParticleContent } from './particleLocalAssessment.js';
|
|
16
|
+
import { prepareSemanticParticleView } from './particleSemanticView.js';
|
|
17
|
+
import { checkParticleRestriction } from './particleRestriction.js';
|
|
18
|
+
import { checkRawParticleExtension } from './particleExtension.js';
|
|
19
|
+
import { assertCandidateCorrespondence } from './re01CandidateCorrespondence.js';
|
|
20
|
+
import { declaredType, resolveSemanticType, semanticTypeKey } from './schemaTypeIdentity.js';
|
|
21
|
+
import { collectSemanticTypeDependencies } from './semanticTypeDependencies.js';
|
|
22
|
+
import { collectIdentityConstraintDependencies } from './schemaIdentityConstraints.js';
|
|
23
|
+
const issued = new WeakMap();
|
|
24
|
+
class ConstructionAbort extends Error {
|
|
25
|
+
result;
|
|
26
|
+
constructor(result) {
|
|
27
|
+
super(result.kind);
|
|
28
|
+
this.result = result;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const ANY = Object.freeze({ kind: 'builtin', name: Object.freeze({ namespace: XSD_NAMESPACE, local: 'anyType' }) });
|
|
32
|
+
const local = (target) => ({ kind: 'local', target });
|
|
33
|
+
/** Original syntax under a prohibited use/zero particle has no local component. */
|
|
34
|
+
export function isAbsentOriginalSourceComponent(context, id) {
|
|
35
|
+
assertSemanticContext(context);
|
|
36
|
+
if (context.kind !== 'actual')
|
|
37
|
+
return false;
|
|
38
|
+
return context.originalSourceComponentAbsent(id);
|
|
39
|
+
}
|
|
40
|
+
export function assertComponentConstruction(context, receipt) {
|
|
41
|
+
assertSemanticContext(context);
|
|
42
|
+
if (issued.get(receipt) !== context)
|
|
43
|
+
throw new TypeError('Unauthenticated or foreign component construction receipt');
|
|
44
|
+
}
|
|
45
|
+
export function checkComponentConstruction(context, id, options = {}) {
|
|
46
|
+
assertSemanticContext(context);
|
|
47
|
+
const b = context.budget;
|
|
48
|
+
return b.guard(() => {
|
|
49
|
+
b.chargeWork(60);
|
|
50
|
+
if (!options || typeof options !== 'object')
|
|
51
|
+
throw new TypeError('Construction options require data');
|
|
52
|
+
const field = Object.getOwnPropertyDescriptor(options, 'correspondence');
|
|
53
|
+
if (field && !('value' in field))
|
|
54
|
+
throw new TypeError('Construction options require data');
|
|
55
|
+
const correspondence = field?.value;
|
|
56
|
+
if (correspondence)
|
|
57
|
+
assertCandidateCorrespondence(context, correspondence);
|
|
58
|
+
const fail = (rule, message, kind = 'invalid-schema', originContextId, component = id) => {
|
|
59
|
+
b.chargeWork(12 + rule.length + message.length + component.length + (originContextId?.length ?? 0));
|
|
60
|
+
throw new ConstructionAbort(Object.freeze({ kind: kind === 'invalid-schema' && context.kind === 'candidate'
|
|
61
|
+
&& (originContextId === undefined || originContextId === context.contextId) ? 'candidate-rejected' : kind,
|
|
62
|
+
rule, component, message, ...(originContextId === undefined ? {} : { contextId: originContextId }) }));
|
|
63
|
+
};
|
|
64
|
+
try {
|
|
65
|
+
b.chargeWork(12);
|
|
66
|
+
const found = context.lookup(id);
|
|
67
|
+
if (found.kind !== 'found')
|
|
68
|
+
return fail('component-membership', 'Component is unavailable in the selected context', 'unresolved');
|
|
69
|
+
const node = found.node, receipts = [], dependencies = new Set(), builtins = new Set();
|
|
70
|
+
const typeDependencies = collectSemanticTypeDependencies(context);
|
|
71
|
+
const identityConstraintDependencies = collectIdentityConstraintDependencies(context);
|
|
72
|
+
const obligations = [];
|
|
73
|
+
const requireNode = (target) => {
|
|
74
|
+
b.chargeWork(2 + target.length);
|
|
75
|
+
const lookup = context.lookup(target);
|
|
76
|
+
if (lookup.kind !== 'found')
|
|
77
|
+
return fail('component-dependency', 'A required component is unavailable', 'unresolved');
|
|
78
|
+
dependencies.add(target);
|
|
79
|
+
return lookup.node;
|
|
80
|
+
};
|
|
81
|
+
const reference = (ref) => {
|
|
82
|
+
if (ref.kind === 'original-generated') {
|
|
83
|
+
const resolved = resolveSemanticType(context, ref);
|
|
84
|
+
if (resolved.kind !== 'original-generated')
|
|
85
|
+
return fail('scalar-slot-membership', 'A required scalar slot is unavailable', 'unresolved');
|
|
86
|
+
b.chargeWork(4);
|
|
87
|
+
typeDependencies.add([{ contextId: context.contextId, type: resolved.identity }]);
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
const lookup = context.resolve(ref);
|
|
91
|
+
b.chargeWork(3);
|
|
92
|
+
if (lookup.kind === 'builtin') {
|
|
93
|
+
b.chargeWork(lookup.name.local.length);
|
|
94
|
+
builtins.add(lookup.name.local);
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
if (lookup.kind !== 'found')
|
|
98
|
+
return fail('component-dependency', 'A required reference is unavailable', 'unresolved');
|
|
99
|
+
b.chargeWork(lookup.node.id.length);
|
|
100
|
+
dependencies.add(lookup.node.id);
|
|
101
|
+
return lookup.node;
|
|
102
|
+
};
|
|
103
|
+
const obligation = (rule, component = id, contextId = context.contextId) => {
|
|
104
|
+
b.chargeWork(6 + rule.length + component.length + contextId.length);
|
|
105
|
+
obligations.push({ rule, component, contextId });
|
|
106
|
+
};
|
|
107
|
+
const scalarObligations = (items) => {
|
|
108
|
+
for (const item of items) {
|
|
109
|
+
b.chargeWork();
|
|
110
|
+
const ownerContext = item.contextId ?? context.contextId;
|
|
111
|
+
if (ownerContext !== context.contextId && ownerContext !== context.originalContext().contextId)
|
|
112
|
+
return fail('scalar-obligation-context', 'Scalar premise has no authenticated interpretation context', 'unresolved');
|
|
113
|
+
if (ownerContext === context.contextId && item.rule === 'raw-simple-content-derivation-validity' && item.component !== id)
|
|
114
|
+
requireNode(item.component);
|
|
115
|
+
else
|
|
116
|
+
obligation(item.rule, item.component, ownerContext);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
const declarationObligation = (pending, owner) => {
|
|
120
|
+
if (pending === 'declared-type-component-validity')
|
|
121
|
+
return;
|
|
122
|
+
const rules = ['element-default-mixed-emptiable', 'simple-content-base-mixed-emptiable',
|
|
123
|
+
'raw-simple-content-derivation-validity', 'raw-simple-facet-restriction-validity'];
|
|
124
|
+
for (const rule of rules) {
|
|
125
|
+
b.chargeWork(2 + rule.length + pending.length);
|
|
126
|
+
if (!pending.startsWith(rule + ':'))
|
|
127
|
+
continue;
|
|
128
|
+
const component = pending.slice(rule.length + 1);
|
|
129
|
+
if (rule === 'element-default-mixed-emptiable') {
|
|
130
|
+
// Actual declarations already require their TYPE. A property-only
|
|
131
|
+
// VALUE read needs this mixed fact without promoting that TYPE to FULL.
|
|
132
|
+
const mapped = content(component);
|
|
133
|
+
if (mapped.content.kind !== 'mixed')
|
|
134
|
+
return fail('e-props-correct.2', 'Element value constraint requires simple or mixed content');
|
|
135
|
+
const view = checked(prepareSemanticParticleView(context, mapped, 'restriction'));
|
|
136
|
+
if (!view.view.root.summary.schemaEmptiable)
|
|
137
|
+
return fail('e-props-correct.2', 'Mixed element value constraint requires formal particle emptiability');
|
|
138
|
+
}
|
|
139
|
+
else
|
|
140
|
+
scalarObligations([{ rule, component }]);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
obligation(pending, owner);
|
|
144
|
+
};
|
|
145
|
+
const checked = (result) => {
|
|
146
|
+
if (result.kind === 'resource-limit')
|
|
147
|
+
throw new ConstructionAbort(result);
|
|
148
|
+
if (result.kind !== 'checked') {
|
|
149
|
+
const failed = result;
|
|
150
|
+
// Scalar owners distinguish an intrinsically invalid original type
|
|
151
|
+
// from a candidate operand merely evaluated in that original type.
|
|
152
|
+
// Preserve the former's owning context and component; do not infer
|
|
153
|
+
// actual invalidity from the datatype lookup context alone.
|
|
154
|
+
if (failed.contextId !== undefined && failed.contextId !== context.contextId
|
|
155
|
+
&& failed.contextId !== context.originalContext().contextId)
|
|
156
|
+
return fail('construction-failure-context', 'Local failure has no authenticated originating context', 'unresolved');
|
|
157
|
+
return fail(failed.rule, failed.message ?? 'Required local owner did not check its premise', failed.kind === 'unsupported-capability' ? 'unsupported-capability' : failed.kind === 'unresolved' ? 'unresolved'
|
|
158
|
+
: failed.kind === 'candidate-rejected' ? 'candidate-rejected' : 'invalid-schema', failed.contextId, failed.contextId === undefined ? id : failed.component ?? id);
|
|
159
|
+
}
|
|
160
|
+
if ('typeDependencies' in result)
|
|
161
|
+
typeDependencies.add(result.typeDependencies);
|
|
162
|
+
if ('identityConstraintDependencies' in result)
|
|
163
|
+
identityConstraintDependencies.add(result.identityConstraintDependencies);
|
|
164
|
+
b.chargeWork();
|
|
165
|
+
receipts.push(result);
|
|
166
|
+
return result;
|
|
167
|
+
};
|
|
168
|
+
const scalar = createSchemaScalarKernel(context);
|
|
169
|
+
const scalarResult = (result) => {
|
|
170
|
+
const value = checked(result);
|
|
171
|
+
scalarObligations(value.obligations);
|
|
172
|
+
return value.value;
|
|
173
|
+
};
|
|
174
|
+
const relation = (result) => {
|
|
175
|
+
const value = checked(result);
|
|
176
|
+
for (const dependency of value.dependencies) {
|
|
177
|
+
b.chargeWork(2 + dependency.length);
|
|
178
|
+
if (dependency.startsWith('builtin:'))
|
|
179
|
+
builtins.add(dependency.slice(8));
|
|
180
|
+
else
|
|
181
|
+
requireNode(dependency);
|
|
182
|
+
}
|
|
183
|
+
for (const pending of value.obligations)
|
|
184
|
+
if (pending !== 'component-validity')
|
|
185
|
+
obligation(pending);
|
|
186
|
+
return value.value;
|
|
187
|
+
};
|
|
188
|
+
const attributes = (result) => {
|
|
189
|
+
const value = checked(result);
|
|
190
|
+
scalarObligations(value.scalarObligations);
|
|
191
|
+
for (const use of value.value.schemaOperands) {
|
|
192
|
+
b.chargeWork(2);
|
|
193
|
+
requireNode(use.declaration.id);
|
|
194
|
+
reference(declaredType(context, use.declaration));
|
|
195
|
+
}
|
|
196
|
+
for (const declaration of value.value.declarations) {
|
|
197
|
+
b.chargeWork();
|
|
198
|
+
requireNode(declaration.component);
|
|
199
|
+
scalarObligations(declaration.scalarObligations);
|
|
200
|
+
for (const pending of declaration.obligations) {
|
|
201
|
+
b.chargeWork();
|
|
202
|
+
declarationObligation(pending, declaration.component);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
// The aggregate driver supplies type validity and original/raw
|
|
206
|
+
// correspondence. Source syntax is checked here and on generated deps.
|
|
207
|
+
};
|
|
208
|
+
if (context.kind === 'actual')
|
|
209
|
+
checked(checkActualSchemaSyntax(context, id));
|
|
210
|
+
if (isAbsentOriginalSourceComponent(context, id)) {
|
|
211
|
+
// Referenced globals remain semantic components even when their source
|
|
212
|
+
// use maps to nothing. Other hidden local syntax is checked separately.
|
|
213
|
+
for (const slot of context.references(id)) {
|
|
214
|
+
if (slot.reference.kind === 'original-generated')
|
|
215
|
+
return fail('source-only-scalar-slot', 'Suppressed original source cannot supply a semantic scalar slot', 'unresolved');
|
|
216
|
+
b.chargeWork();
|
|
217
|
+
const target = context.resolve(slot.reference);
|
|
218
|
+
if (target.kind === 'found' && target.node.identity.kind === 'global')
|
|
219
|
+
requireNode(target.node.id);
|
|
220
|
+
}
|
|
221
|
+
b.chargeWork(20 + receipts.length + dependencies.size);
|
|
222
|
+
const receipt = Object.freeze({ kind: 'checked', authority: 'XSD10-component-construction-v1',
|
|
223
|
+
scope: 'original-source-syntax-only', contextId: context.contextId, component: id, receipts: Object.freeze(receipts),
|
|
224
|
+
dependencies: Object.freeze([...dependencies]), builtinDependencies: Object.freeze([]), typeDependencies: typeDependencies.snapshot(),
|
|
225
|
+
identityConstraintDependencies: identityConstraintDependencies.snapshot(),
|
|
226
|
+
obligations: Object.freeze([]), discharged: Object.freeze([]) });
|
|
227
|
+
b.chargeWork();
|
|
228
|
+
issued.set(receipt, context);
|
|
229
|
+
return receipt;
|
|
230
|
+
}
|
|
231
|
+
if (context.kind === 'candidate' && node.kind === 'particle' && node.occurs.max === '0') {
|
|
232
|
+
occurrenceAlgebra(b.chargeWork).validate(node.occurs);
|
|
233
|
+
return fail('p-props-correct', 'A particle component must have a positive maximum occurrence');
|
|
234
|
+
}
|
|
235
|
+
if (context.kind === 'candidate' && context.originalSourceComponentAbsent(id)) {
|
|
236
|
+
// This frozen factory field records exact source binding, without a NOTATION lookup.
|
|
237
|
+
if (context.notationUniverse !== 'source-bound')
|
|
238
|
+
return fail('original-source-component-admission', 'Authentic original component membership has not been established', 'unresolved', context.contextId);
|
|
239
|
+
return fail('original-source-only-component', 'Retained source-only syntax does not denote an original semantic component', 'candidate-rejected', context.contextId);
|
|
240
|
+
}
|
|
241
|
+
if (node.identity.kind === 'global') {
|
|
242
|
+
b.chargeWork(node.identity.name.local.length + 2);
|
|
243
|
+
if (!isXmlNCName(node.identity.name.local))
|
|
244
|
+
return fail('component-name', 'Global component name must be an XML NCName');
|
|
245
|
+
}
|
|
246
|
+
const rawComplex = node.kind === 'complexType' ? context.rawTypeProperties(id) : undefined;
|
|
247
|
+
const originalComplex = node.kind === 'complexType' ? context.originalComplexPropertySource(id) : undefined;
|
|
248
|
+
const originalContent = originalComplex ? checked(deriveOriginalComplexPropertyContent(context, id)).view : undefined;
|
|
249
|
+
const sourceContent = originalContent ?? (rawComplex && 'particle' in rawComplex.content && rawComplex.content.original
|
|
250
|
+
? checked(deriveRawComplexContent(context, id)).view : undefined);
|
|
251
|
+
const rawSimple = node.kind === 'simpleType' ? context.rawSimpleTypeProperties(id) : undefined;
|
|
252
|
+
const rawGroup = node.kind === 'attributeGroup' ? context.rawAttributeGroupProperties(id) : undefined;
|
|
253
|
+
const particleChildren = node.kind === 'particle' && 'children' in node.term
|
|
254
|
+
? context.originalCompositorChildren(id) ?? node.term.children : undefined;
|
|
255
|
+
const content = (target) => checked(context.kind === 'actual'
|
|
256
|
+
? deriveActualComplexContent(context, target) : deriveOriginalComplexPropertyContent(context, target)).view;
|
|
257
|
+
const particleLegal = (view) => {
|
|
258
|
+
const legal = checked(checkComplexParticleContent(context, view));
|
|
259
|
+
if (!legal.value)
|
|
260
|
+
return fail(legal.failedRule ?? 'particle-local-legality', 'Particle content violates its local constraints');
|
|
261
|
+
};
|
|
262
|
+
const borrowedParticle = (target) => {
|
|
263
|
+
const handle = context.originalUrWildcard(target);
|
|
264
|
+
if (!handle)
|
|
265
|
+
return undefined;
|
|
266
|
+
const leaf = originalUrWildcardSource(context.originalContext(), handle);
|
|
267
|
+
// Preparation authenticates this immutable terminal leaf. It is not
|
|
268
|
+
// an F component, and borrowing its provenance never requires FULL(owner).
|
|
269
|
+
occurrenceAlgebra(b.chargeWork).validate(leaf.occurs);
|
|
270
|
+
if (leaf.term.kind !== 'any' || leaf.occurs.min !== '0' || leaf.occurs.max !== 'unbounded'
|
|
271
|
+
|| leaf.term.wildcard.namespace.value !== '##any' || leaf.term.wildcard.processContents !== 'lax')
|
|
272
|
+
return fail('original-ur-wildcard', 'Invalid borrowed native UR wildcard', 'unresolved', undefined, target);
|
|
273
|
+
return leaf;
|
|
274
|
+
};
|
|
275
|
+
if (sourceContent) {
|
|
276
|
+
if (originalComplex) {
|
|
277
|
+
b.chargeWork(100 + context.contextId.length + context.originalContext().contextId.length + id.length);
|
|
278
|
+
receipts.push(Object.freeze({ kind: 'checked-original-input', authority: 'XSD10-original-complex-input-v1',
|
|
279
|
+
contextId: context.contextId, originalContextId: context.originalContext().contextId, component: id,
|
|
280
|
+
scope: 'guarded-original-particle-empty-input', remaining: Object.freeze(['actual-source-qualification', 'complete-type-validity']) }));
|
|
281
|
+
reference(originalComplex.derivation?.base ?? ANY);
|
|
282
|
+
}
|
|
283
|
+
else if (rawComplex) {
|
|
284
|
+
reference(rawComplex.derivation.base);
|
|
285
|
+
for (const use of rawComplex.attributeUses) {
|
|
286
|
+
b.chargeWork();
|
|
287
|
+
requireNode(use);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
const pending = 'particle' in sourceContent.content ? [sourceContent.content.particle] : [], seen = new Set();
|
|
291
|
+
while (pending.length) {
|
|
292
|
+
b.chargeWork(4);
|
|
293
|
+
const target = pending.pop();
|
|
294
|
+
if (seen.has(target))
|
|
295
|
+
continue;
|
|
296
|
+
seen.add(target);
|
|
297
|
+
const item = particleContentNode(context, sourceContent, target);
|
|
298
|
+
if (!item)
|
|
299
|
+
return fail('original-content-frontier', 'Original content dependency is unavailable', 'unresolved', undefined, target);
|
|
300
|
+
const privateParticle = context.lookup(target).kind === 'missing' && sourceContent.synthetic.includes(target);
|
|
301
|
+
if (!privateParticle) {
|
|
302
|
+
if (context.originalSourceComponentAbsent(target) || item.kind === 'particle' && item.occurs.max === '0' && context.sourceNode(target))
|
|
303
|
+
return fail('original-content-source-only', 'Source-only content traversal is not supported', 'unresolved', undefined, target);
|
|
304
|
+
requireNode(target);
|
|
305
|
+
}
|
|
306
|
+
if (item.kind === 'group') {
|
|
307
|
+
b.chargeWork();
|
|
308
|
+
pending.push(item.content);
|
|
309
|
+
continue;
|
|
310
|
+
}
|
|
311
|
+
if (item.kind !== 'particle')
|
|
312
|
+
return fail('original-content-frontier', 'Content edge must denote a particle or group', 'unresolved', undefined, target);
|
|
313
|
+
if (privateParticle) {
|
|
314
|
+
occurrenceAlgebra(b.chargeWork).validate(item.occurs);
|
|
315
|
+
if (item.term.kind === 'sequence' && item.occurs.min === '1' && item.occurs.max === '1') {
|
|
316
|
+
// Exact mapper-owned composition, never a new H component.
|
|
317
|
+
}
|
|
318
|
+
else if (item.term.kind === 'any' && sourceContent.urTypeWildcards.includes(target)
|
|
319
|
+
&& item.occurs.min === '0' && item.occurs.max === 'unbounded'
|
|
320
|
+
&& namespaceExpressible(wildcardNamespaces(item.term.wildcard, b.chargeWork), b.chargeWork)
|
|
321
|
+
&& item.term.wildcard.processContents === 'lax') {
|
|
322
|
+
// Authenticated native ur wildcard; ordinary fresh wildcards never enter this branch.
|
|
323
|
+
}
|
|
324
|
+
else
|
|
325
|
+
return fail('original-content-shape', 'Unsupported private content shape', 'unresolved', undefined, target);
|
|
326
|
+
particleLegal(checked(deriveOriginalContentSubtree(context, sourceContent, target)).view);
|
|
327
|
+
}
|
|
328
|
+
if ('children' in item.term) {
|
|
329
|
+
const children = context.originalCompositorChildren(item.id) ?? item.term.children;
|
|
330
|
+
b.chargeWork(children.length);
|
|
331
|
+
pending.push(...children);
|
|
332
|
+
}
|
|
333
|
+
else if (item.term.kind === 'group') {
|
|
334
|
+
const group = reference(item.term.reference);
|
|
335
|
+
if (group?.kind !== 'group')
|
|
336
|
+
return fail('particle-properties', 'Group use must reference a model group');
|
|
337
|
+
b.chargeWork();
|
|
338
|
+
pending.push(group.id);
|
|
339
|
+
}
|
|
340
|
+
else if (item.term.kind === 'element') {
|
|
341
|
+
const declaration = reference(item.term.declaration);
|
|
342
|
+
if (declaration?.kind !== 'element')
|
|
343
|
+
return fail('particle-properties', 'Element use must reference a declaration');
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
else if (rawComplex) {
|
|
348
|
+
reference(rawComplex.derivation.base);
|
|
349
|
+
for (const use of rawComplex.attributeUses) {
|
|
350
|
+
b.chargeWork();
|
|
351
|
+
requireNode(use);
|
|
352
|
+
}
|
|
353
|
+
if (rawComplex.content.kind === 'simple' || rawComplex.content.kind === 'opaque-builtin')
|
|
354
|
+
reference(rawComplex.content.type);
|
|
355
|
+
else if ('particle' in rawComplex.content)
|
|
356
|
+
requireNode(rawComplex.content.particle);
|
|
357
|
+
}
|
|
358
|
+
else if (rawSimple) {
|
|
359
|
+
reference(rawSimple.base);
|
|
360
|
+
if (rawSimple.variety.kind === 'list')
|
|
361
|
+
reference(rawSimple.variety.item);
|
|
362
|
+
else if (rawSimple.variety.kind === 'union')
|
|
363
|
+
for (const member of rawSimple.variety.members) {
|
|
364
|
+
b.chargeWork();
|
|
365
|
+
reference(member);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
else if (rawGroup) {
|
|
369
|
+
for (const use of rawGroup.attributeUses) {
|
|
370
|
+
b.chargeWork();
|
|
371
|
+
requireNode(use);
|
|
372
|
+
}
|
|
373
|
+
for (const source of rawGroup.wildcard?.sources ?? []) {
|
|
374
|
+
b.chargeWork();
|
|
375
|
+
requireNode(source);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
for (const slot of context.references(id)) {
|
|
380
|
+
b.chargeWork();
|
|
381
|
+
reference(slot.reference);
|
|
382
|
+
}
|
|
383
|
+
if (node.kind === 'complexType' || node.kind === 'attributeGroup')
|
|
384
|
+
b.chargeWork(node.attributes.length + 2);
|
|
385
|
+
if (node.kind === 'particle' && 'children' in node.term)
|
|
386
|
+
b.chargeWork(node.term.children.length + 2);
|
|
387
|
+
for (const child of particleChildren ?? containedNodes(node)) {
|
|
388
|
+
b.chargeWork();
|
|
389
|
+
if (!(node.kind === 'particle' && 'children' in node.term && borrowedParticle(child)))
|
|
390
|
+
requireNode(child);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
let re01;
|
|
394
|
+
let ownRawSimpleContentChecked = false;
|
|
395
|
+
switch (node.kind) {
|
|
396
|
+
case 'element':
|
|
397
|
+
case 'attribute': {
|
|
398
|
+
reference(declaredType(context, node));
|
|
399
|
+
const result = checked(checkDeclaration(context, id));
|
|
400
|
+
scalarObligations(result.scalarObligations);
|
|
401
|
+
for (const pending of result.obligations) {
|
|
402
|
+
b.chargeWork();
|
|
403
|
+
declarationObligation(pending, id);
|
|
404
|
+
}
|
|
405
|
+
break;
|
|
406
|
+
}
|
|
407
|
+
case 'simpleType':
|
|
408
|
+
scalarResult(scalar.describe(local(id), id));
|
|
409
|
+
if (!relation(checkImmediateTypeFinal(context, local(id))))
|
|
410
|
+
return fail('st-props-correct.final', 'Immediate base prohibits this simple derivation');
|
|
411
|
+
break;
|
|
412
|
+
case 'complexType': {
|
|
413
|
+
if (context.kind === 'candidate' && !originalContent) {
|
|
414
|
+
const validation = validateRawComplexTypeProperties(context, id, correspondence);
|
|
415
|
+
if (validation.kind === 'resource-limit')
|
|
416
|
+
throw new ConstructionAbort(validation);
|
|
417
|
+
if (validation.kind !== 'checked-structure')
|
|
418
|
+
return fail(validation.rule, 'Raw complex properties are not structurally qualified', validation.kind === 'unresolved' ? 'unresolved' : 'invalid-schema');
|
|
419
|
+
b.chargeWork();
|
|
420
|
+
receipts.push(validation);
|
|
421
|
+
}
|
|
422
|
+
const base = rawComplex?.derivation.base ?? node.derivation?.base ?? ANY;
|
|
423
|
+
const method = rawComplex?.derivation.method ?? node.derivation?.kind ?? 'restriction';
|
|
424
|
+
const baseNode = reference(base);
|
|
425
|
+
if (!relation(checkImmediateTypeFinal(context, local(id))))
|
|
426
|
+
return fail('ct-props-correct.final', 'Immediate base prohibits this complex derivation');
|
|
427
|
+
const uses = context.kind === 'actual' ? assessSourceAttributeUses(context, id) : assessCandidateAttributeUses(context, id);
|
|
428
|
+
attributes(uses);
|
|
429
|
+
if (originalContent && uses.kind === 'checked') {
|
|
430
|
+
for (const use of uses.value.uses) {
|
|
431
|
+
b.chargeWork();
|
|
432
|
+
requireNode(use.id);
|
|
433
|
+
}
|
|
434
|
+
for (const source of uses.value.wildcard?.sources ?? []) {
|
|
435
|
+
b.chargeWork();
|
|
436
|
+
requireNode(source);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
const ownContent = content(id), own = ownContent.content;
|
|
440
|
+
const ownScalar = own.kind === 'simple' ? context.kind === 'actual' ? local(id) : own.type : undefined;
|
|
441
|
+
const baseSimple = base.kind === 'original-generated' || (base.kind === 'builtin' ? base.name.local !== 'anyType' : baseNode?.kind === 'simpleType');
|
|
442
|
+
if (baseNode && baseNode.kind !== 'complexType' && baseNode.kind !== 'simpleType')
|
|
443
|
+
return fail('ct-props-correct.1', 'Complex base reference must identify a type');
|
|
444
|
+
if (baseSimple) {
|
|
445
|
+
if (method !== 'extension' || own.kind !== 'simple')
|
|
446
|
+
return fail('cos-ct-extends.2', 'A simple base requires extension with that same simple content');
|
|
447
|
+
const a = scalarResult(scalar.contentIdentity(ownScalar, id)), z = scalarResult(scalar.contentIdentity(base, id));
|
|
448
|
+
if (b.compareText(a.definition, z.definition) !== 0)
|
|
449
|
+
return fail('cos-ct-extends.2.1', 'Simple-base extension must preserve exact scalar component identity');
|
|
450
|
+
ownRawSimpleContentChecked = true;
|
|
451
|
+
break;
|
|
452
|
+
}
|
|
453
|
+
const ur = base.kind === 'builtin' && base.name.local === 'anyType';
|
|
454
|
+
const baseContent = baseNode?.kind === 'complexType' ? content(baseNode.id)
|
|
455
|
+
: ur ? checked(deriveBuiltinAnyTypeContent(context, id)).view : undefined;
|
|
456
|
+
const prior = baseContent?.content;
|
|
457
|
+
if (!prior || own.kind === 'opaque-builtin' || prior.kind === 'opaque-builtin')
|
|
458
|
+
return fail('complex-content-properties', 'Complex content comparison requires concrete content properties', 'unresolved');
|
|
459
|
+
const baseScalar = prior?.kind === 'simple' ? context.kind === 'actual' && baseNode ? local(baseNode.id) : prior.type : undefined;
|
|
460
|
+
if (ownScalar)
|
|
461
|
+
scalarResult(scalar.describe(ownScalar, id));
|
|
462
|
+
if ('particle' in own)
|
|
463
|
+
particleLegal(ownContent);
|
|
464
|
+
if (method === 'restriction' && ur)
|
|
465
|
+
ownRawSimpleContentChecked = own.kind === 'simple';
|
|
466
|
+
else if (own.kind === 'simple' && prior?.kind === 'simple') {
|
|
467
|
+
if (method === 'extension') {
|
|
468
|
+
const a = scalarResult(scalar.contentIdentity(ownScalar, id)), z = scalarResult(scalar.contentIdentity(baseScalar, id));
|
|
469
|
+
if (b.compareText(a.definition, z.definition) !== 0)
|
|
470
|
+
return fail('cos-ct-extends.1.4.1', 'Extension must preserve exact simple content identity');
|
|
471
|
+
}
|
|
472
|
+
else if (!scalarResult(scalar.contentDerivation(ownScalar, baseScalar, id)))
|
|
473
|
+
return fail('derivation-ok-restriction.5.2', 'Simple content is not derived from the base content');
|
|
474
|
+
ownRawSimpleContentChecked = true;
|
|
475
|
+
}
|
|
476
|
+
else if (own.kind === 'empty' && prior?.kind === 'empty') {
|
|
477
|
+
// Exact local empty/empty branches of extension 1.4.2 and restriction 5.3.
|
|
478
|
+
}
|
|
479
|
+
else if (method === 'restriction' && baseContent && (own.kind === 'simple' && prior?.kind === 'mixed' || own.kind === 'empty' && prior && 'particle' in prior)) {
|
|
480
|
+
const normalizedBase = checked(prepareSemanticParticleView(context, baseContent, 'restriction'));
|
|
481
|
+
if (!normalizedBase.view.root.summary.schemaEmptiable)
|
|
482
|
+
return fail('derivation-ok-restriction.5', 'This content restriction requires a formally emptiable base particle');
|
|
483
|
+
ownRawSimpleContentChecked = own.kind === 'simple';
|
|
484
|
+
for (let index = obligations.length - 1; index >= 0; index--) {
|
|
485
|
+
b.chargeWork();
|
|
486
|
+
if (obligations[index].rule === 'simple-content-base-mixed-emptiable' && obligations[index].component === baseNode?.id && obligations[index].contextId === context.contextId)
|
|
487
|
+
obligations.splice(index, 1);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
else if (method === 'restriction' && baseContent && 'particle' in own && prior && (prior.kind === 'empty' || 'particle' in prior)) {
|
|
491
|
+
if (own.kind === 'mixed' && prior.kind !== 'mixed')
|
|
492
|
+
return fail('derivation-ok-restriction.5.4', 'Mixed restriction requires mixed base content');
|
|
493
|
+
const derivedView = checked(prepareSemanticParticleView(context, ownContent, 'restriction'));
|
|
494
|
+
const baseView = checked(prepareSemanticParticleView(context, baseContent, 'restriction'));
|
|
495
|
+
const restriction = checked(checkParticleRestriction(context, derivedView.view, baseView.view, { deferScalarObligations: true }));
|
|
496
|
+
scalarObligations(restriction.scalarObligations);
|
|
497
|
+
if (!restriction.value)
|
|
498
|
+
return fail('derivation-ok-restriction.5.4', 'Particle restriction is not satisfied');
|
|
499
|
+
}
|
|
500
|
+
else if (method === 'extension' && 'particle' in own && prior?.kind === 'empty') {
|
|
501
|
+
// Extension1.4.3.2.1 imposes no nonempty prefix when the base is empty.
|
|
502
|
+
}
|
|
503
|
+
else if (method === 'extension' && baseContent && 'particle' in own && prior && 'particle' in prior) {
|
|
504
|
+
if (own.kind !== prior.kind)
|
|
505
|
+
return fail('cos-ct-extends.1.4.3', 'Particle extension must preserve mixed versus element-only variety');
|
|
506
|
+
const extension = checked(checkRawParticleExtension(context, ownContent, baseContent));
|
|
507
|
+
if (!extension.value)
|
|
508
|
+
return fail('cos-particle-extend', 'Raw extension does not preserve the original particle or its exact first member');
|
|
509
|
+
scalarObligations(extension.scalarObligations);
|
|
510
|
+
for (const pending of extension.obligations) {
|
|
511
|
+
b.chargeWork();
|
|
512
|
+
if (pending !== 'component-validity')
|
|
513
|
+
declarationObligation(pending, id);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
else if (method === 'extension' && (own.kind === 'empty' && prior && 'particle' in prior || own.kind === 'simple' && prior?.kind === 'mixed'))
|
|
517
|
+
return fail('cos-ct-extends.1.4', 'Extension cannot remove or change the base content variety');
|
|
518
|
+
else if (own.kind === 'simple' && prior?.kind !== 'mixed')
|
|
519
|
+
return fail('complex-content-relation', 'Simple content is incompatible with the base content');
|
|
520
|
+
else if (prior?.kind === 'simple')
|
|
521
|
+
return fail('complex-content-relation', 'Nonsimple content cannot replace simple base content');
|
|
522
|
+
else
|
|
523
|
+
return fail('complex-content-relation', 'Content varieties do not satisfy a permitted extension or restriction branch');
|
|
524
|
+
if (method === 'extension') {
|
|
525
|
+
b.chargeWork(4);
|
|
526
|
+
const seen = new Set();
|
|
527
|
+
let ancestor = base;
|
|
528
|
+
let primitive = false;
|
|
529
|
+
while (true) {
|
|
530
|
+
const n = reference(ancestor);
|
|
531
|
+
if (ancestor.kind === 'builtin' && ancestor.name.local === 'anyType') {
|
|
532
|
+
primitive = base.kind === 'builtin' && base.name.local === 'anyType';
|
|
533
|
+
re01 = Object.freeze({ target: id, ancestor, primitive });
|
|
534
|
+
break;
|
|
535
|
+
}
|
|
536
|
+
const next = relation(immediateTypeBase(context, ancestor));
|
|
537
|
+
if (!next)
|
|
538
|
+
return fail('re01-ancestor', 'No ancestor with immediate anyType base is available', 'unresolved');
|
|
539
|
+
if (next.kind === 'builtin' && next.name.local === 'anyType') {
|
|
540
|
+
primitive = baseNode !== undefined && n?.id === baseNode.id;
|
|
541
|
+
re01 = Object.freeze({ target: id, ancestor, primitive });
|
|
542
|
+
break;
|
|
543
|
+
}
|
|
544
|
+
const key = n?.id ?? (ancestor.kind === 'builtin' ? `builtin:${ancestor.name.local}`
|
|
545
|
+
: ancestor.kind === 'original-generated' ? semanticTypeKey(context, ancestor) : '');
|
|
546
|
+
b.chargeWork(3 + key.length);
|
|
547
|
+
if (seen.has(key))
|
|
548
|
+
return fail('ct-props-correct.3', 'Type ancestry is cyclic');
|
|
549
|
+
seen.add(key);
|
|
550
|
+
ancestor = next;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
break;
|
|
554
|
+
}
|
|
555
|
+
case 'attributeUse':
|
|
556
|
+
attributes(assessAttributeUse(context, id));
|
|
557
|
+
break;
|
|
558
|
+
case 'attributeGroup':
|
|
559
|
+
attributes(context.kind === 'actual' ? assessSourceAttributeUses(context, id) : assessRawAttributeUses(context, id));
|
|
560
|
+
break;
|
|
561
|
+
case 'attributeGroupUse': {
|
|
562
|
+
const target = reference(node.reference);
|
|
563
|
+
if (target?.kind !== 'attributeGroup')
|
|
564
|
+
return fail('src-attribute-group', 'Attribute group use must reference an attribute group');
|
|
565
|
+
break;
|
|
566
|
+
}
|
|
567
|
+
case 'attributeWildcard': {
|
|
568
|
+
const namespace = wildcardNamespaces(node.wildcard, b.chargeWork);
|
|
569
|
+
if (!namespaceExpressible(namespace, b.chargeWork) || !['strict', 'lax', 'skip'].includes(node.wildcard.processContents))
|
|
570
|
+
return fail('wildcard-properties', 'Wildcard property domain is invalid');
|
|
571
|
+
break;
|
|
572
|
+
}
|
|
573
|
+
case 'particle': {
|
|
574
|
+
occurrenceAlgebra(b.chargeWork).validate(node.occurs);
|
|
575
|
+
if (node.occurs.max === '0')
|
|
576
|
+
return fail('p-props-correct', 'A particle component must have a positive maximum occurrence');
|
|
577
|
+
if (node.term.kind === 'element') {
|
|
578
|
+
const declaration = reference(node.term.declaration);
|
|
579
|
+
if (declaration?.kind !== 'element')
|
|
580
|
+
return fail('particle-properties', 'Element particle must reference an element declaration');
|
|
581
|
+
if (declaration.identity.kind === 'global') {
|
|
582
|
+
if (context.membership !== 'complete-actual-plus-additions')
|
|
583
|
+
obligation('complete-substitution-universe');
|
|
584
|
+
b.chargeWork(3);
|
|
585
|
+
const pending = [declaration.id], seen = new Set();
|
|
586
|
+
while (pending.length) {
|
|
587
|
+
b.chargeWork(2);
|
|
588
|
+
const head = pending.pop();
|
|
589
|
+
if (seen.has(head))
|
|
590
|
+
continue;
|
|
591
|
+
seen.add(head);
|
|
592
|
+
for (const member of context.incomingAffiliates(head)) {
|
|
593
|
+
b.chargeWork();
|
|
594
|
+
requireNode(member);
|
|
595
|
+
pending.push(member);
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
else if (node.term.kind === 'group') {
|
|
601
|
+
const group = reference(node.term.reference);
|
|
602
|
+
if (group?.kind !== 'group')
|
|
603
|
+
return fail('particle-properties', 'Group particle must reference a model group');
|
|
604
|
+
}
|
|
605
|
+
else if (node.term.kind === 'any') {
|
|
606
|
+
const wildcard = readParticleWildcard(context, node);
|
|
607
|
+
if (!namespaceExpressible(wildcard.namespace, b.chargeWork) ||
|
|
608
|
+
!['strict', 'lax', 'skip'].includes(wildcard.processContents))
|
|
609
|
+
return fail('wildcard-properties', 'Particle wildcard namespace is not expressible');
|
|
610
|
+
}
|
|
611
|
+
else
|
|
612
|
+
for (const child of particleChildren ?? node.term.children) {
|
|
613
|
+
b.chargeWork();
|
|
614
|
+
const item = borrowedParticle(child) ?? requireNode(child);
|
|
615
|
+
if (item.kind !== 'particle')
|
|
616
|
+
return fail('particle-properties', 'Model group children must be particles');
|
|
617
|
+
if (node.term.kind === 'all' && (item.term.kind !== 'element' || !['0', '1'].includes(item.occurs.min) || !['0', '1'].includes(item.occurs.max)))
|
|
618
|
+
return fail('cos-all-limited', 'All children must be element particles with zero/one bounds');
|
|
619
|
+
}
|
|
620
|
+
if ('children' in node.term)
|
|
621
|
+
particleLegal(checked(deriveModelGroupContent(context, id)).view);
|
|
622
|
+
if (node.term.kind === 'all' && (node.occurs.max !== '1' || !['0', '1'].includes(node.occurs.min)))
|
|
623
|
+
return fail('cos-all-limited', 'All particle must have max1 and min0/1');
|
|
624
|
+
break;
|
|
625
|
+
}
|
|
626
|
+
case 'group': {
|
|
627
|
+
const root = requireNode(node.content);
|
|
628
|
+
if (root.kind !== 'particle' || !('children' in root.term) || root.occurs.min !== '1' || root.occurs.max !== '1')
|
|
629
|
+
return fail('src-group', 'Named group content requires a compositor with occurrence1..1');
|
|
630
|
+
particleLegal(checked(deriveModelGroupContent(context, id)).view);
|
|
631
|
+
break;
|
|
632
|
+
}
|
|
633
|
+
case 'wsdl': return fail('xsd-component-only', 'WSDL interpretation is not an XSD component premise', 'unresolved');
|
|
634
|
+
}
|
|
635
|
+
b.chargeWork(obligations.length + dependencies.size + builtins.size + receipts.length + 20);
|
|
636
|
+
const pending = obligations.filter(item => !(ownRawSimpleContentChecked && item.contextId === context.contextId && item.component === id && item.rule === 'raw-simple-content-derivation-validity'));
|
|
637
|
+
dependencies.delete(id);
|
|
638
|
+
const receipt = Object.freeze({ kind: 'checked', authority: 'XSD10-component-construction-v1',
|
|
639
|
+
scope: 'local-component-premises', contextId: context.contextId, component: id, receipts: Object.freeze(receipts),
|
|
640
|
+
dependencies: Object.freeze([...dependencies]), builtinDependencies: Object.freeze([...builtins]), re01,
|
|
641
|
+
typeDependencies: typeDependencies.snapshot(), identityConstraintDependencies: identityConstraintDependencies.snapshot(),
|
|
642
|
+
obligations: b.freeze(b.snapshot(pending)),
|
|
643
|
+
discharged: ownRawSimpleContentChecked
|
|
644
|
+
? b.freeze(b.snapshot([{ rule: 'raw-simple-content-derivation-validity', component: id, contextId: context.contextId }])) : Object.freeze([]) });
|
|
645
|
+
b.chargeWork();
|
|
646
|
+
issued.set(receipt, context);
|
|
647
|
+
return receipt;
|
|
648
|
+
}
|
|
649
|
+
catch (error) {
|
|
650
|
+
if (error instanceof ConstructionAbort)
|
|
651
|
+
return error.result;
|
|
652
|
+
if (error instanceof SemanticError) {
|
|
653
|
+
if (b.exhausted())
|
|
654
|
+
throw error;
|
|
655
|
+
b.chargeWork(12 + error.category.length + error.message.length + id.length);
|
|
656
|
+
return Object.freeze({ kind: error.category === 'invalid-schema'
|
|
657
|
+
? context.kind === 'candidate' ? 'candidate-rejected' : 'invalid-schema' : 'unresolved',
|
|
658
|
+
rule: error.category, component: id, message: error.message });
|
|
659
|
+
}
|
|
660
|
+
throw error;
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
}
|