@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,225 @@
|
|
|
1
|
+
/** Fixed S4S datatype values. No application components, lookup callbacks or hints. */
|
|
2
|
+
import { XSD_NAMESPACE } from '../loader/orderedSyntax.js';
|
|
3
|
+
import { builtinParents, schemaDatatypeValues } from './schemaDatatypeValues.js';
|
|
4
|
+
import { schemaValueSequences } from './schemaValueSequences.js';
|
|
5
|
+
import { fixedS4SPatterns } from './schemaPattern.js';
|
|
6
|
+
import { occurrenceAlgebra } from './occurrenceAnalysis.js';
|
|
7
|
+
const builtins = ['anySimpleType', 'string', 'boolean', 'decimal', 'float', 'double', 'duration', 'dateTime',
|
|
8
|
+
'time', 'date', 'gYearMonth', 'gYear', 'gMonthDay', 'gDay', 'gMonth', 'hexBinary', 'base64Binary',
|
|
9
|
+
'anyURI', 'QName', 'NOTATION', 'NMTOKENS', 'IDREFS', 'ENTITIES', ...Object.keys(builtinParents)];
|
|
10
|
+
const utility = ['formChoice', 'reducedDerivationControl', 'derivationSet', 'typeDerivationControl',
|
|
11
|
+
'fullDerivationSet', 'allNNI', 'blockSet', 'namespaceList', 'public', 'derivationControl', 'simpleDerivationSet'];
|
|
12
|
+
// Exact fixed restrictions from the dated REC S4S. These are instance datatype
|
|
13
|
+
// grammars, not the stronger XPath/component representation rules.
|
|
14
|
+
const selectorPattern = String.raw `(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*(\|(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*)*`;
|
|
15
|
+
const fieldPattern = String.raw `(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*))))(\|(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*)))))*`;
|
|
16
|
+
const definitions = Object.freeze({
|
|
17
|
+
...Object.fromEntries(builtins.map(name => [name, { kind: 'builtin', name }])),
|
|
18
|
+
formChoice: { kind: 'enum', base: 'NMTOKEN', values: ['qualified', 'unqualified'] },
|
|
19
|
+
derivationControl: { kind: 'enum', base: 'NMTOKEN', values: ['substitution', 'extension', 'restriction', 'list', 'union'] },
|
|
20
|
+
reducedDerivationControl: { kind: 'enum', base: 'derivationControl', values: ['extension', 'restriction'] },
|
|
21
|
+
typeDerivationControl: { kind: 'enum', base: 'derivationControl', values: ['extension', 'restriction', 'list', 'union'] },
|
|
22
|
+
'#simpleDerivation': { kind: 'enum', base: 'derivationControl', values: ['list', 'union', 'restriction'] },
|
|
23
|
+
'#block': { kind: 'enum', base: 'derivationControl', values: ['extension', 'restriction', 'substitution'] },
|
|
24
|
+
'#all': { kind: 'enum', base: 'token', values: ['#all'] },
|
|
25
|
+
'#reducedList': { kind: 'list', item: 'reducedDerivationControl' },
|
|
26
|
+
'#typeList': { kind: 'list', item: 'typeDerivationControl' },
|
|
27
|
+
'#simpleList': { kind: 'list', item: '#simpleDerivation' },
|
|
28
|
+
'#blockList': { kind: 'list', item: '#block' },
|
|
29
|
+
derivationSet: { kind: 'union', members: ['#all', '#reducedList'] },
|
|
30
|
+
fullDerivationSet: { kind: 'union', members: ['#all', '#typeList'] },
|
|
31
|
+
simpleDerivationSet: { kind: 'union', members: ['#all', '#simpleList'] },
|
|
32
|
+
blockSet: { kind: 'union', members: ['#all', '#blockList'] },
|
|
33
|
+
'#unbounded': { kind: 'enum', base: 'NMTOKEN', values: ['unbounded'] },
|
|
34
|
+
allNNI: { kind: 'union', members: ['nonNegativeInteger', '#unbounded'] },
|
|
35
|
+
'#namespaceSpecial': { kind: 'enum', base: 'token', values: ['##any', '##other'] },
|
|
36
|
+
'#namespaceItemSpecial': { kind: 'enum', base: 'token', values: ['##targetNamespace', '##local'] },
|
|
37
|
+
'#namespaceItem': { kind: 'union', members: ['anyURI', '#namespaceItemSpecial'] },
|
|
38
|
+
'#namespaceList': { kind: 'list', item: '#namespaceItem' },
|
|
39
|
+
namespaceList: { kind: 'union', members: ['#namespaceSpecial', '#namespaceList'] },
|
|
40
|
+
public: { kind: 'enum', base: 'token', values: [] }, // no additional facet
|
|
41
|
+
'#use': { kind: 'enum', base: 'NMTOKEN', values: ['prohibited', 'optional', 'required'] },
|
|
42
|
+
'#process': { kind: 'enum', base: 'NMTOKEN', values: ['skip', 'lax', 'strict'] },
|
|
43
|
+
'#whiteSpace': { kind: 'enum', base: 'NMTOKEN', values: ['preserve', 'replace', 'collapse'] },
|
|
44
|
+
'#xmlSpace': { kind: 'enum', base: 'NCName', values: ['default', 'preserve'] },
|
|
45
|
+
'#zeroOne': { kind: 'enum', base: 'nonNegativeInteger', values: ['0', '1'] },
|
|
46
|
+
'#one': { kind: 'enum', base: 'nonNegativeInteger', values: ['1'] },
|
|
47
|
+
'#maxZeroOne': { kind: 'enum', base: 'allNNI', values: ['0', '1'] },
|
|
48
|
+
'#maxOne': { kind: 'enum', base: 'allNNI', values: ['1'] },
|
|
49
|
+
'#qnames': { kind: 'list', item: 'QName' },
|
|
50
|
+
'#schemaLocations': { kind: 'list', item: 'anyURI' },
|
|
51
|
+
'#selector': { kind: 'pattern', base: 'token', value: selectorPattern },
|
|
52
|
+
'#field': { kind: 'pattern', base: 'token', value: fieldPattern },
|
|
53
|
+
});
|
|
54
|
+
const named = new Set([...builtins, ...utility]);
|
|
55
|
+
class SourceValueProblem extends Error {
|
|
56
|
+
kind;
|
|
57
|
+
rule;
|
|
58
|
+
source;
|
|
59
|
+
constructor(kind, rule, message, source) {
|
|
60
|
+
super(message);
|
|
61
|
+
this.kind = kind;
|
|
62
|
+
this.rule = rule;
|
|
63
|
+
this.source = source;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Internal fixed descriptor factory. Handles are authentic only in this factory.
|
|
68
|
+
* Name/lexical/diagnostic records are borrowed immutable data from the authentic
|
|
69
|
+
* DTD-free ordered source traversal; this leaf does not establish membership.
|
|
70
|
+
*/
|
|
71
|
+
export function createSchemaSourceValues(budget) {
|
|
72
|
+
const handles = new WeakMap();
|
|
73
|
+
const issued = new Map();
|
|
74
|
+
const context = {
|
|
75
|
+
step: (_owner, count = 1) => budget.chargeWork(count),
|
|
76
|
+
text: (value, _owner) => { budget.chargeWork(2 + value.length * 4); return value; },
|
|
77
|
+
fail: (owner, rule, message, source) => { throw new SourceValueProblem('invalid-schema', rule, message, source ?? owner.source); },
|
|
78
|
+
unsupported: (owner, rule, message, source) => { throw new SourceValueProblem('unsupported-capability', rule, message, source ?? owner.source); },
|
|
79
|
+
unresolved: (owner, rule, message, source) => { throw new SourceValueProblem('unresolved', rule, message, source ?? owner.source); },
|
|
80
|
+
notation: (namespace, local, owner) => {
|
|
81
|
+
budget.chargeWork(4 + namespace.length + local.length);
|
|
82
|
+
if (namespace !== XSD_NAMESPACE || !['XMLSchemaStructures', 'XML'].includes(local)) {
|
|
83
|
+
context.fail(owner, 'notation-declaration', 'NOTATION QName is absent from the fixed S4S assessment schema');
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
const values = schemaDatatypeValues(context);
|
|
88
|
+
const sequence = schemaValueSequences({ step: context.step,
|
|
89
|
+
isInvalidSchema: (error) => error instanceof SourceValueProblem && error.kind === 'invalid-schema' });
|
|
90
|
+
const patterns = fixedS4SPatterns({ ...context, algebra: occurrenceAlgebra(() => budget.chargeWork()) });
|
|
91
|
+
const fixed = (name) => {
|
|
92
|
+
budget.chargeWork(4 + name.length);
|
|
93
|
+
if (!Object.hasOwn(definitions, name))
|
|
94
|
+
throw new TypeError('Unknown fixed source value descriptor');
|
|
95
|
+
const existing = issued.get(name);
|
|
96
|
+
if (existing)
|
|
97
|
+
return existing;
|
|
98
|
+
budget.chargeWork(5);
|
|
99
|
+
const type = Object.freeze({});
|
|
100
|
+
issued.set(name, type);
|
|
101
|
+
handles.set(type, name);
|
|
102
|
+
return type;
|
|
103
|
+
};
|
|
104
|
+
const evaluate = (name, lexical, owner) => {
|
|
105
|
+
budget.chargeWork(8 + name.length);
|
|
106
|
+
const descriptor = definitions[name];
|
|
107
|
+
const result = (value) => ({ value, members: [], facts: [] });
|
|
108
|
+
if (descriptor.kind === 'builtin') {
|
|
109
|
+
// Declared use is separate from the primitive facet-formation entry.
|
|
110
|
+
if (name === 'NOTATION')
|
|
111
|
+
context.fail(owner, 'enumeration-required-notation', 'NOTATION requires an enumeration-derived declared datatype', lexical.context.source);
|
|
112
|
+
// cvc-simple-type / key-vde: the authentic loader rejects every DOCTYPE,
|
|
113
|
+
// so this source infoset's unparsedEntities set is known empty. This is
|
|
114
|
+
// a concrete source failure, not application-component ENTITY authority.
|
|
115
|
+
if (name === 'ENTITY') {
|
|
116
|
+
values.atomic('NCName', lexical, owner);
|
|
117
|
+
context.fail(owner, 'cvc-simple-type', 'ENTITY has no declared unparsed entity in this DTD-free source document', lexical.context.source);
|
|
118
|
+
}
|
|
119
|
+
if (name === 'ENTITIES') {
|
|
120
|
+
const tokens = values.listTokens(lexical, owner);
|
|
121
|
+
if (tokens.tokens.length === 0)
|
|
122
|
+
values.listOperand(tokens, [], owner, 'ENTITIES');
|
|
123
|
+
context.fail(owner, 'cvc-simple-type', 'ENTITIES has no declared unparsed entities in this DTD-free source document', lexical.context.source);
|
|
124
|
+
}
|
|
125
|
+
const value = values.builtin(name, lexical, owner), out = result(value);
|
|
126
|
+
if (name === 'ID' || name === 'IDREF') {
|
|
127
|
+
budget.chargeWork(4);
|
|
128
|
+
out.facts.push({ kind: name, value: value.canonical, source: lexical.context.source });
|
|
129
|
+
}
|
|
130
|
+
else if (name === 'IDREFS') {
|
|
131
|
+
for (const item of value.items ?? []) {
|
|
132
|
+
budget.chargeWork(4);
|
|
133
|
+
out.facts.push({ kind: 'IDREF', value: item.canonical, source: lexical.context.source });
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return out;
|
|
137
|
+
}
|
|
138
|
+
if (descriptor.kind === 'enum') {
|
|
139
|
+
const value = evaluate(descriptor.base, lexical, owner);
|
|
140
|
+
let accepted = descriptor.values.length === 0;
|
|
141
|
+
for (const expected of descriptor.values) {
|
|
142
|
+
budget.chargeWork(4);
|
|
143
|
+
const assessed = evaluate(descriptor.base, { value: expected, context: lexical.context }, owner);
|
|
144
|
+
if (values.sameValue(value.value, assessed.value, owner)) {
|
|
145
|
+
accepted = true;
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (!accepted)
|
|
150
|
+
context.fail(owner, 'cvc-enumeration-valid', 'Value is outside the fixed S4S enumeration', lexical.context.source);
|
|
151
|
+
return value;
|
|
152
|
+
}
|
|
153
|
+
if (descriptor.kind === 'pattern') {
|
|
154
|
+
const value = evaluate(descriptor.base, lexical, owner);
|
|
155
|
+
const compiled = patterns.compile({ value: descriptor.value, context: lexical.context }, owner);
|
|
156
|
+
if (!patterns.acceptsOperand(compiled, value.value.canonical, owner)) {
|
|
157
|
+
context.fail(owner, 'cvc-pattern-valid', 'Value does not satisfy the fixed S4S pattern', lexical.context.source);
|
|
158
|
+
}
|
|
159
|
+
return value;
|
|
160
|
+
}
|
|
161
|
+
if (descriptor.kind === 'list') {
|
|
162
|
+
const tokens = values.listTokens(lexical, owner);
|
|
163
|
+
budget.chargeWork(tokens.tokens.length * 3 + 3);
|
|
164
|
+
const items = [], facts = [], members = [];
|
|
165
|
+
for (const token of tokens.tokens) {
|
|
166
|
+
budget.chargeWork(4);
|
|
167
|
+
const item = evaluate(descriptor.item, { value: token, context: lexical.context }, owner);
|
|
168
|
+
budget.chargeWork(item.facts.length + item.members.length + 2);
|
|
169
|
+
items.push(item.value);
|
|
170
|
+
facts.push(...item.facts);
|
|
171
|
+
members.push(...item.members);
|
|
172
|
+
}
|
|
173
|
+
return { value: values.listOperand(tokens, items, owner), facts, members };
|
|
174
|
+
}
|
|
175
|
+
budget.chargeWork(descriptor.members.length + 3);
|
|
176
|
+
const choices = sequence.chooseUnionMember(descriptor.members, owner);
|
|
177
|
+
let state = choices.next(), chosen;
|
|
178
|
+
while (!state.done) {
|
|
179
|
+
budget.chargeWork(2);
|
|
180
|
+
try {
|
|
181
|
+
chosen = evaluate(state.value, lexical, owner);
|
|
182
|
+
state = choices.next(chosen.value);
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
chosen = undefined;
|
|
186
|
+
state = choices.throw(error);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (!state.value || !chosen)
|
|
190
|
+
return context.fail(owner, 'cvc-datatype-valid', 'No fixed S4S union member accepts this value', lexical.context.source);
|
|
191
|
+
budget.chargeWork(chosen.members.length + 3);
|
|
192
|
+
return { ...chosen, members: [state.value.request, ...chosen.members] };
|
|
193
|
+
};
|
|
194
|
+
return Object.freeze({
|
|
195
|
+
/** Closed internal grammar domain; this never accepts caller descriptors. */
|
|
196
|
+
fixed,
|
|
197
|
+
lookup: (name) => budget.guard(() => {
|
|
198
|
+
budget.chargeWork(5 + name.namespace.length + name.local.length);
|
|
199
|
+
// The immutable October 2004 XML import has no named types. Its space
|
|
200
|
+
// restriction is anonymous and cannot be resolved by an XML QName.
|
|
201
|
+
return name.namespace === XSD_NAMESPACE && named.has(name.local)
|
|
202
|
+
? Object.freeze({ kind: 'found', type: fixed(name.local) }) : Object.freeze({ kind: 'missing' });
|
|
203
|
+
}),
|
|
204
|
+
assess: (type, lexical, owner) => {
|
|
205
|
+
const name = handles.get(type);
|
|
206
|
+
if (name === undefined)
|
|
207
|
+
throw new TypeError('Source datatype handle was not issued by this factory');
|
|
208
|
+
return budget.guard(() => {
|
|
209
|
+
try {
|
|
210
|
+
const value = evaluate(name, lexical, owner);
|
|
211
|
+
budget.chargeWork(value.members.length + 8);
|
|
212
|
+
// Preserve opaque issued handles: a deep snapshot would create copies.
|
|
213
|
+
return Object.freeze({ kind: 'checked', type, value: budget.freeze(budget.snapshot(value.value)),
|
|
214
|
+
selectedMembers: Object.freeze(value.members.map(fixed)),
|
|
215
|
+
identityFacts: budget.freeze(budget.snapshot(value.facts)), obligations: Object.freeze([]) });
|
|
216
|
+
}
|
|
217
|
+
catch (error) {
|
|
218
|
+
if (!(error instanceof SourceValueProblem))
|
|
219
|
+
throw error;
|
|
220
|
+
return budget.freeze(budget.snapshot({ kind: error.kind, rule: error.rule, message: error.message, source: error.source }));
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
},
|
|
224
|
+
});
|
|
225
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ExpandedName, SyntaxElement, SyntaxSource } from '../loader/orderedSyntax.js';
|
|
2
|
+
import type { SemanticBudget, ResourceLimitFailure } from './semanticBudget.js';
|
|
3
|
+
export type SourceTypedId = Readonly<{
|
|
4
|
+
value: string;
|
|
5
|
+
source: SyntaxSource;
|
|
6
|
+
}>;
|
|
7
|
+
export type SourceWildcardObligation = Readonly<{
|
|
8
|
+
category: 'foreign-attribute-assessment' | 'annotation-payload-assessment';
|
|
9
|
+
rule: string;
|
|
10
|
+
source: SyntaxSource;
|
|
11
|
+
name: ExpandedName;
|
|
12
|
+
message?: string;
|
|
13
|
+
}>;
|
|
14
|
+
export type SourceWildcardResult = Readonly<{
|
|
15
|
+
kind: 'checked';
|
|
16
|
+
remaining: readonly SourceWildcardObligation[];
|
|
17
|
+
ids: readonly SourceTypedId[];
|
|
18
|
+
}> | Readonly<{
|
|
19
|
+
kind: 'invalid-schema';
|
|
20
|
+
rule: string;
|
|
21
|
+
message: string;
|
|
22
|
+
source: SyntaxSource;
|
|
23
|
+
}> | ResourceLimitFailure;
|
|
24
|
+
/** The dated October 2004 XML import declares lang as xs:language. */
|
|
25
|
+
export declare function validSchemaXmlLanguage(value: string, budget: SemanticBudget): boolean;
|
|
26
|
+
/** Pure borrowed-syntax clauses. Only the authentic document owner issues aggregate authority. */
|
|
27
|
+
export declare function assessSchemaSourceWildcards(root: SyntaxElement, budget: SemanticBudget): SourceWildcardResult;
|
|
28
|
+
//# sourceMappingURL=schemaSourceWildcards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaSourceWildcards.d.ts","sourceRoot":"","sources":["../../src/compiler/schemaSourceWildcards.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAC,YAAY,EAAE,aAAa,EAAE,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAC1F,OAAO,KAAK,EAAC,cAAc,EAAE,oBAAoB,EAAC,MAAM,qBAAqB,CAAC;AAW9E,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAC,CAAC,CAAC;AAC5E,MAAM,MAAM,wBAAwB,GAAG,QAAQ,CAAC;IAC9C,QAAQ,EAAE,8BAA8B,GAAG,+BAA+B,CAAC;IAC3E,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,YAAY,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC1E,CAAC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IAAC,IAAI,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,SAAS,wBAAwB,EAAE,CAAC;IAAC,GAAG,EAAE,SAAS,aAAa,EAAE,CAAA;CAAC,CAAC,GACzI,QAAQ,CAAC;IAAC,IAAI,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAC,CAAC,GACvF,oBAAoB,CAAC;AAEzB,sEAAsE;AACtE,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAGrF;AAQD,kGAAkG;AAClG,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,cAAc,GAAG,oBAAoB,CA8J7G"}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fixed S4S instance assessment: dated 2004 Structures/Datatypes Appendix A,
|
|
3
|
+
* cvc-assess-elt, cvc-elt/type/complex-type/attribute/wildcard and cvc-id/key.
|
|
4
|
+
* Parent-selected local declarations outrank global lookup. Application Gamma
|
|
5
|
+
* and schema-location hints never extend this distinct assessment universe.
|
|
6
|
+
* Imported XML declarations are fixed by https://www.w3.org/2004/10/xml.xsd.
|
|
7
|
+
*/
|
|
8
|
+
import { XML_NAMESPACE, XSD_NAMESPACE } from '../loader/orderedSyntax.js';
|
|
9
|
+
import { normalizeWhitespace } from './schemaDatatypeValues.js';
|
|
10
|
+
import { createSchemaSourceValues } from './schemaSourceValues.js';
|
|
11
|
+
import { abstractSourceRole, assessSourceGrammar, globalSourceRole, namedSourceRole, sourceRoleTypeName } from './schemaSourceGrammar.js';
|
|
12
|
+
const XSI_NAMESPACE = 'http://www.w3.org/2001/XMLSchema-instance';
|
|
13
|
+
const xsiTypes = Object.freeze({ type: 'QName', nil: 'boolean',
|
|
14
|
+
schemaLocation: '#schemaLocations', noNamespaceSchemaLocation: 'anyURI' });
|
|
15
|
+
/** The dated October 2004 XML import declares lang as xs:language. */
|
|
16
|
+
export function validSchemaXmlLanguage(value, budget) {
|
|
17
|
+
budget.chargeWork(4 + value.length * 4);
|
|
18
|
+
return /^[A-Za-z]{1,8}(?:-[A-Za-z0-9]{1,8})*$/.test(normalizeWhitespace(value, 'collapse'));
|
|
19
|
+
}
|
|
20
|
+
class SourceProblem extends Error {
|
|
21
|
+
rule;
|
|
22
|
+
source;
|
|
23
|
+
constructor(rule, message, source) {
|
|
24
|
+
super(message);
|
|
25
|
+
this.rule = rule;
|
|
26
|
+
this.source = source;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/** Pure borrowed-syntax clauses. Only the authentic document owner issues aggregate authority. */
|
|
30
|
+
export function assessSchemaSourceWildcards(root, budget) {
|
|
31
|
+
return budget.guard(() => {
|
|
32
|
+
budget.chargeWork(30);
|
|
33
|
+
const remaining = [], ids = [], references = [];
|
|
34
|
+
const idValues = new Set(), values = createSchemaSourceValues(budget);
|
|
35
|
+
const stack = [{ node: root, payload: false }];
|
|
36
|
+
const fail = (node, message, rule = 'schema-for-schemas') => {
|
|
37
|
+
budget.chargeWork(6 + message.length + rule.length);
|
|
38
|
+
throw new SourceProblem(rule, message, node.source);
|
|
39
|
+
};
|
|
40
|
+
const pending = (node, name, category, rule, message) => {
|
|
41
|
+
budget.chargeWork(8);
|
|
42
|
+
remaining.push({ category, rule, source: node.source, name, ...(message === undefined ? {} : { message }) });
|
|
43
|
+
};
|
|
44
|
+
const facts = (node, entries, category) => {
|
|
45
|
+
for (const entry of entries) {
|
|
46
|
+
budget.chargeWork(5 + entry.value.length);
|
|
47
|
+
if (entry.kind === 'ID') {
|
|
48
|
+
if (idValues.has(entry.value))
|
|
49
|
+
fail(node, 'Schema IDs must be unique within their schema validation root', 'schema-id');
|
|
50
|
+
budget.chargeWork(4);
|
|
51
|
+
idValues.add(entry.value);
|
|
52
|
+
ids.push({ value: entry.value, source: entry.source });
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
budget.chargeWork(3);
|
|
56
|
+
references.push({ ...entry, category });
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const assess = (node, type, lexical, name, category) => {
|
|
61
|
+
budget.chargeWork(6);
|
|
62
|
+
const result = values.assess(type, { value: lexical, context: { namespaces: node.namespaces, source: node.source } }, node);
|
|
63
|
+
if (result.kind === 'resource-limit') {
|
|
64
|
+
budget.chargeWork();
|
|
65
|
+
throw new Error('Unreachable exhausted source budget');
|
|
66
|
+
}
|
|
67
|
+
if (result.kind === 'invalid-schema')
|
|
68
|
+
return fail(node, `${result.rule}: ${result.message}`);
|
|
69
|
+
if (result.kind !== 'checked') {
|
|
70
|
+
pending(node, name, category, result.rule, result.message);
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
facts(node, result.identityFacts, category);
|
|
74
|
+
for (const obligation of result.obligations) {
|
|
75
|
+
budget.chargeWork();
|
|
76
|
+
pending(node, obligation.name ?? name, category, obligation.rule);
|
|
77
|
+
}
|
|
78
|
+
return result.value;
|
|
79
|
+
};
|
|
80
|
+
try {
|
|
81
|
+
while (stack.length) {
|
|
82
|
+
budget.chargeWork(12);
|
|
83
|
+
const frame = stack.pop(), { node, payload } = frame;
|
|
84
|
+
const category = payload ? 'annotation-payload-assessment' : 'foreign-attribute-assessment';
|
|
85
|
+
budget.chargeWork(node.name.namespace.length + node.name.local.length);
|
|
86
|
+
const declaration = frame.role ?? globalSourceRole(node.name);
|
|
87
|
+
let role = declaration, simpleType, typeName;
|
|
88
|
+
for (const attr of node.attributes) {
|
|
89
|
+
budget.chargeWork(7 + attr.name.namespace.length + attr.name.local.length);
|
|
90
|
+
if (attr.name.namespace !== XSI_NAMESPACE || !Object.hasOwn(xsiTypes, attr.name.local))
|
|
91
|
+
continue;
|
|
92
|
+
const assessed = assess(node, values.fixed(xsiTypes[attr.name.local]), attr.value, attr.name, category);
|
|
93
|
+
if (attr.name.local === 'nil' && declaration !== undefined)
|
|
94
|
+
fail(node, 'A non-nillable S4S declaration forbids xsi:nil presence');
|
|
95
|
+
if (attr.name.local === 'type' && assessed) {
|
|
96
|
+
budget.chargeWork(assessed.canonical.length * 3 + 4);
|
|
97
|
+
const pair = JSON.parse(assessed.canonical);
|
|
98
|
+
typeName = { namespace: pair[0], local: pair[1] };
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (typeName) {
|
|
102
|
+
budget.chargeWork(8 + typeName.namespace.length + typeName.local.length);
|
|
103
|
+
const complex = namedSourceRole(typeName);
|
|
104
|
+
if (complex !== undefined) {
|
|
105
|
+
if (abstractSourceRole(complex))
|
|
106
|
+
fail(node, 'An abstract fixed S4S type cannot assess an element');
|
|
107
|
+
if (declaration !== undefined && sourceRoleTypeName(declaration) !== typeName.local) {
|
|
108
|
+
fail(node, 'xsi:type does not match the declared S4S type under blockDefault=#all');
|
|
109
|
+
}
|
|
110
|
+
role = complex;
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
const lookup = values.lookup(typeName);
|
|
114
|
+
if (lookup.kind === 'resource-limit') {
|
|
115
|
+
budget.chargeWork();
|
|
116
|
+
throw new Error('Unreachable exhausted source budget');
|
|
117
|
+
}
|
|
118
|
+
if (lookup.kind === 'found') {
|
|
119
|
+
if (declaration !== undefined)
|
|
120
|
+
fail(node, 'A simple xsi:type cannot replace this S4S complex declaration');
|
|
121
|
+
role = undefined;
|
|
122
|
+
simpleType = lookup.type;
|
|
123
|
+
}
|
|
124
|
+
else if (declaration !== undefined)
|
|
125
|
+
fail(node, 'xsi:type is absent from the fixed S4S assessment type universe');
|
|
126
|
+
// Undeclared + genuinely absent type follows lax ur-type fallback.
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
// The fixed imported XML schema has no global element declarations.
|
|
130
|
+
// Undeclared XML names therefore use the same lax fallback as other
|
|
131
|
+
// genuinely absent declarations; descendants are still assessed.
|
|
132
|
+
if (simpleType) {
|
|
133
|
+
budget.chargeWork(5);
|
|
134
|
+
const chunks = [];
|
|
135
|
+
for (const child of node.children) {
|
|
136
|
+
budget.chargeWork(3);
|
|
137
|
+
if (child.kind === 'element')
|
|
138
|
+
fail(node, 'A simple item type forbids element children');
|
|
139
|
+
else {
|
|
140
|
+
budget.chargeWork(child.value.length + 1);
|
|
141
|
+
chunks.push(child.value);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
for (const attr of node.attributes) {
|
|
145
|
+
budget.chargeWork(4);
|
|
146
|
+
if (attr.name.namespace !== XSI_NAMESPACE || !Object.hasOwn(xsiTypes, attr.name.local)) {
|
|
147
|
+
fail(node, 'A simple item type permits only the four builtin schema-instance attributes');
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
budget.chargeWork(chunks.length + 1);
|
|
151
|
+
assess(node, simpleType, chunks.join(''), typeName, category);
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
const grammar = assessSourceGrammar(role ?? 'anyType', node, budget);
|
|
155
|
+
if (grammar.kind !== 'checked')
|
|
156
|
+
return budget.freeze(budget.snapshot(grammar));
|
|
157
|
+
budget.chargeWork(3);
|
|
158
|
+
const assessedAttributes = new Map();
|
|
159
|
+
for (const item of grammar.attributes) {
|
|
160
|
+
budget.chargeWork(3);
|
|
161
|
+
const attr = node.attributes[item.index], assessed = assess(node, values.fixed(item.type), attr.value, attr.name, category);
|
|
162
|
+
if (assessed) {
|
|
163
|
+
budget.chargeWork(2);
|
|
164
|
+
assessedAttributes.set(attr.name.local, assessed);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
for (const attr of node.attributes) {
|
|
168
|
+
budget.chargeWork(6 + attr.name.namespace.length + attr.name.local.length);
|
|
169
|
+
if (attr.name.namespace !== XML_NAMESPACE)
|
|
170
|
+
continue;
|
|
171
|
+
if (attr.name.local === 'lang') {
|
|
172
|
+
assess(node, values.fixed('language'), attr.value, attr.name, category);
|
|
173
|
+
}
|
|
174
|
+
else if (attr.name.local === 'space')
|
|
175
|
+
assess(node, values.fixed('#xmlSpace'), attr.value, attr.name, category);
|
|
176
|
+
else if (attr.name.local === 'base')
|
|
177
|
+
assess(node, values.fixed('anyURI'), attr.value, attr.name, category);
|
|
178
|
+
else if (attr.name.local === 'id') {
|
|
179
|
+
// This is the sole wildcard ID declaration in the closed schema;
|
|
180
|
+
// XML expanded-name uniqueness already enforces 5.1. Clause 5.2
|
|
181
|
+
// forbids it when the selected type has an ID use, even absent.
|
|
182
|
+
if (grammar.hasIdAttributeUse)
|
|
183
|
+
fail(node, 'A wildcard ID cannot replace an ID attribute use', 'cvc-complex-type.5.2');
|
|
184
|
+
assess(node, values.fixed('ID'), attr.value, attr.name, category);
|
|
185
|
+
}
|
|
186
|
+
// Other XML attribute names are absent from the complete inventory.
|
|
187
|
+
}
|
|
188
|
+
// Seven fixed S4S keys belong to each schema declaration; ID/IDREF
|
|
189
|
+
// duties belong to the outer physical schema validation root.
|
|
190
|
+
let scope = frame.scope;
|
|
191
|
+
if (declaration === 'schema') {
|
|
192
|
+
budget.chargeWork(7);
|
|
193
|
+
scope = { parent: scope, direct: new Map(), identities: new Set() };
|
|
194
|
+
}
|
|
195
|
+
const name = assessedAttributes.get('name')?.canonical;
|
|
196
|
+
if (node.name.namespace === XSD_NAMESPACE && ['key', 'unique', 'keyref'].includes(node.name.local)) {
|
|
197
|
+
if (name === undefined)
|
|
198
|
+
fail(node, 'S4S identity-constraint key requires an assessed name');
|
|
199
|
+
for (let current = frame.scope; current; current = current.parent) {
|
|
200
|
+
budget.chargeWork(4 + name.length);
|
|
201
|
+
if (current.identities.has(name))
|
|
202
|
+
fail(node, 'Duplicate S4S descendant identity-constraint key', 'schema-key');
|
|
203
|
+
current.identities.add(name);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
if (frame.parentSchema && node.name.namespace === XSD_NAMESPACE) {
|
|
207
|
+
const local = node.name.local, key = local === 'simpleType' || local === 'complexType' ? 'type'
|
|
208
|
+
: ['element', 'attribute', 'group', 'attributeGroup', 'notation'].includes(local) ? local : undefined;
|
|
209
|
+
if (key !== undefined) {
|
|
210
|
+
if (name === undefined)
|
|
211
|
+
fail(node, 'S4S schema key requires an assessed name');
|
|
212
|
+
let members = frame.parentSchema.direct.get(key);
|
|
213
|
+
if (!members) {
|
|
214
|
+
budget.chargeWork(3);
|
|
215
|
+
members = new Set();
|
|
216
|
+
frame.parentSchema.direct.set(key, members);
|
|
217
|
+
}
|
|
218
|
+
budget.chargeWork(3 + name.length);
|
|
219
|
+
if (members.has(name))
|
|
220
|
+
fail(node, 'Duplicate S4S schema declaration key', key === 'notation' ? 'schema-notation-key' : 'schema-key');
|
|
221
|
+
members.add(name);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
const childrenArePayload = payload || declaration === 'appinfo' || declaration === 'documentation';
|
|
225
|
+
for (let index = grammar.children.length - 1; index >= 0; index--) {
|
|
226
|
+
budget.chargeWork(7);
|
|
227
|
+
const child = grammar.children[index], syntax = node.children[child.index];
|
|
228
|
+
if (syntax.kind !== 'element')
|
|
229
|
+
throw new Error('Source grammar selected a non-element child');
|
|
230
|
+
stack.push({ node: syntax, payload: childrenArePayload, role: child.role, scope,
|
|
231
|
+
...(declaration === 'schema' ? { parentSchema: scope } : {}) });
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
for (const reference of references) {
|
|
235
|
+
budget.chargeWork(3 + reference.value.length);
|
|
236
|
+
if (!idValues.has(reference.value))
|
|
237
|
+
throw new SourceProblem('cvc-id', 'IDREF has no ID in its physical schema validation root', reference.source);
|
|
238
|
+
}
|
|
239
|
+
return budget.freeze(budget.snapshot({ kind: 'checked', remaining, ids }));
|
|
240
|
+
}
|
|
241
|
+
catch (error) {
|
|
242
|
+
if (!(error instanceof SourceProblem))
|
|
243
|
+
throw error;
|
|
244
|
+
return budget.freeze(budget.snapshot({ kind: 'invalid-schema', rule: error.rule, message: error.message, source: error.source }));
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Finite subset products over source-owned, decidable typed token predicates. */
|
|
2
|
+
import type { SchemaPatternContext } from './schemaValueContext.js';
|
|
3
|
+
export type SymbolicSequence<Label> = Readonly<{
|
|
4
|
+
start: number;
|
|
5
|
+
states: readonly Readonly<{
|
|
6
|
+
accepting: boolean;
|
|
7
|
+
edges: readonly Readonly<{
|
|
8
|
+
to: number;
|
|
9
|
+
label: Label;
|
|
10
|
+
}>[];
|
|
11
|
+
}>[];
|
|
12
|
+
}>;
|
|
13
|
+
export declare function schemaSymbolicSequences<Owner, Label>(c: SchemaPatternContext<Owner>, satisfiable: (positive: readonly Label[], negative: readonly Label[], owner: Owner) => boolean, family?: (label: Label) => string): {
|
|
14
|
+
differenceExists: (a: SymbolicSequence<Label>, b: SymbolicSequence<Label>, owner: Owner) => boolean;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=schemaSymbolicSequences.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaSymbolicSequences.d.ts","sourceRoot":"","sources":["../../src/compiler/schemaSymbolicSequences.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,yBAAyB,CAAC;AAClE,MAAM,MAAM,gBAAgB,CAAC,KAAK,IAAI,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,QAAQ,CAAC;QACvF,SAAS,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,SAAS,QAAQ,CAAC;YAAC,EAAE,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,KAAK,CAAA;SAAC,CAAC,EAAE,CAAC;KAC5E,CAAC,EAAE,CAAA;CAAC,CAAC,CAAC;AACP,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,oBAAoB,CAAC,KAAK,CAAC,EAClF,WAAW,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,KAAK,OAAO,EAC9F,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM;0BACJ,gBAAgB,CAAC,KAAK,CAAC,KAAK,gBAAgB,CAAC,KAAK,CAAC,SAAS,KAAK,KAAG,OAAO;EAmDzG"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export function schemaSymbolicSequences(c, satisfiable, family) {
|
|
2
|
+
const differenceExists = (a, b, owner) => {
|
|
3
|
+
const key = (pair) => { c.step(owner, (pair.a.length + pair.b.length) * 16 + 4); return JSON.stringify(pair); };
|
|
4
|
+
c.step(owner, 6);
|
|
5
|
+
const initial = { a: [a.start], b: [b.start] }, pending = [initial], seen = new Set([key(initial)]);
|
|
6
|
+
for (let cursor = 0; cursor < pending.length; cursor++) {
|
|
7
|
+
const pair = pending[cursor];
|
|
8
|
+
c.step(owner, pair.a.length + pair.b.length + 2);
|
|
9
|
+
if (pair.a.some(state => a.states[state].accepting) && !pair.b.some(state => b.states[state].accepting))
|
|
10
|
+
return true;
|
|
11
|
+
c.step(owner, 4);
|
|
12
|
+
const labels = [], indices = new Map();
|
|
13
|
+
const index = (label) => {
|
|
14
|
+
c.step(owner);
|
|
15
|
+
let value = indices.get(label);
|
|
16
|
+
if (value === undefined) {
|
|
17
|
+
c.step(owner, 3);
|
|
18
|
+
value = labels.length;
|
|
19
|
+
indices.set(label, value);
|
|
20
|
+
labels.push(label);
|
|
21
|
+
}
|
|
22
|
+
return value;
|
|
23
|
+
};
|
|
24
|
+
c.step(owner, pair.a.length + pair.b.length + 3);
|
|
25
|
+
const ae = [], be = [];
|
|
26
|
+
for (const state of pair.a)
|
|
27
|
+
for (const edge of a.states[state].edges) {
|
|
28
|
+
c.step(owner, 3);
|
|
29
|
+
ae.push({ to: edge.to, index: index(edge.label) });
|
|
30
|
+
}
|
|
31
|
+
for (const state of pair.b)
|
|
32
|
+
for (const edge of b.states[state].edges) {
|
|
33
|
+
c.step(owner, 3);
|
|
34
|
+
be.push({ to: edge.to, index: index(edge.label) });
|
|
35
|
+
}
|
|
36
|
+
c.step(owner, ae.length + labels.length + 8);
|
|
37
|
+
const anchors = [...new Set(ae.map(edge => edge.index))];
|
|
38
|
+
const maskCost = Math.min(Number.MAX_SAFE_INTEGER, (labels.length + 4) ** 2);
|
|
39
|
+
const masks = (operations = 1) => c.step(owner, Math.min(Number.MAX_SAFE_INTEGER, maskCost * operations));
|
|
40
|
+
for (let anchorAt = 0; anchorAt < anchors.length; anchorAt++) {
|
|
41
|
+
const anchor = anchors[anchorAt], tag = family?.(labels[anchor]);
|
|
42
|
+
c.step(owner, labels.length * 3 + anchors.length + 8);
|
|
43
|
+
const forced = new Set(anchors.slice(0, anchorAt));
|
|
44
|
+
if (family)
|
|
45
|
+
for (let bit = 0; bit < labels.length; bit++)
|
|
46
|
+
if (family(labels[bit]) !== tag)
|
|
47
|
+
forced.add(bit);
|
|
48
|
+
const remaining = labels.flatMap((_label, bit) => bit === anchor || forced.has(bit) ? [] : [bit]);
|
|
49
|
+
const positive = [labels[anchor]], negative = [...forced].map(bit => labels[bit]);
|
|
50
|
+
if (!satisfiable(positive, negative, owner))
|
|
51
|
+
continue;
|
|
52
|
+
c.step(owner, 5);
|
|
53
|
+
masks();
|
|
54
|
+
const cells = [{ positive, negative, mask: 1n << BigInt(anchor), at: 0 }];
|
|
55
|
+
while (cells.length) {
|
|
56
|
+
c.step(owner);
|
|
57
|
+
const cell = cells.pop();
|
|
58
|
+
if (cell.at < remaining.length) {
|
|
59
|
+
const bit = remaining[cell.at], label = labels[bit];
|
|
60
|
+
c.step(owner, cell.positive.length + cell.negative.length + 8);
|
|
61
|
+
const admitted = [...cell.positive, label], rejected = [...cell.negative, label];
|
|
62
|
+
if (satisfiable(admitted, cell.negative, owner)) {
|
|
63
|
+
c.step(owner, 5);
|
|
64
|
+
masks(2);
|
|
65
|
+
cells.push({ ...cell, positive: admitted, mask: cell.mask | (1n << BigInt(bit)), at: cell.at + 1 });
|
|
66
|
+
}
|
|
67
|
+
if (satisfiable(cell.positive, rejected, owner)) {
|
|
68
|
+
c.step(owner, 5);
|
|
69
|
+
cells.push({ ...cell, negative: rejected, at: cell.at + 1 });
|
|
70
|
+
}
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
const mask = cell.mask;
|
|
74
|
+
c.step(owner, ae.length + be.length + 4);
|
|
75
|
+
const aa = new Set(), bb = new Set();
|
|
76
|
+
for (const edge of ae) {
|
|
77
|
+
masks(2);
|
|
78
|
+
if (mask & (1n << BigInt(edge.index)))
|
|
79
|
+
aa.add(edge.to);
|
|
80
|
+
}
|
|
81
|
+
for (const edge of be) {
|
|
82
|
+
masks(2);
|
|
83
|
+
if (mask & (1n << BigInt(edge.index)))
|
|
84
|
+
bb.add(edge.to);
|
|
85
|
+
}
|
|
86
|
+
c.step(owner, aa.size ** 2 + bb.size ** 2 + aa.size + bb.size + 5);
|
|
87
|
+
const next = { a: [...aa].sort((x, y) => x - y), b: [...bb].sort((x, y) => x - y) }, identity = key(next);
|
|
88
|
+
if (!seen.has(identity)) {
|
|
89
|
+
c.step(owner, identity.length + 4);
|
|
90
|
+
seen.add(identity);
|
|
91
|
+
pending.push(next);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return false;
|
|
97
|
+
};
|
|
98
|
+
return { differenceExists };
|
|
99
|
+
}
|