@techspokes/typescript-wsdl-client 1.1.5 → 1.2.0
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 +80 -68
- package/dist/app/generateApp.d.ts +0 -1
- package/dist/app/generateApp.js +1 -1
- package/dist/app/generateCheckedApp.d.ts +38 -0
- package/dist/app/generateCheckedApp.js +108 -0
- package/dist/checkedPipeline.d.ts +155 -0
- package/dist/checkedPipeline.js +448 -0
- package/dist/checkedPlanning.d.ts +123 -0
- package/dist/checkedPlanning.js +268 -0
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +92 -2
- package/dist/client/checkedDirectRuntime.d.ts +40 -3
- package/dist/client/checkedDirectRuntime.js +28 -8
- package/dist/client/directClientRuntime.d.ts +27 -2
- package/dist/client/directClientRuntime.js +142 -89
- package/dist/client/directClientVersion.d.ts +3 -1
- package/dist/client/directClientVersion.js +3 -0
- package/dist/client/generateClient.d.ts +0 -1
- package/dist/client/generateClient.js +98 -28
- package/dist/client/generateDirectClient.d.ts +21 -3
- package/dist/client/generateDirectClient.js +138 -6
- package/dist/client/generateOperations.d.ts +0 -1
- package/dist/client/generateOperations.js +30 -11
- package/dist/client/generateTypes.d.ts +0 -1
- package/dist/client/generateUtils.d.ts +0 -1
- package/dist/client/generateUtils.js +7 -1
- package/dist/compiler/applicationGroups.d.ts +53 -0
- package/dist/compiler/applicationGroups.js +403 -0
- package/dist/compiler/buildCanonicalGraph.d.ts +0 -1
- package/dist/compiler/canonicalGraph.d.ts +4 -16
- package/dist/compiler/canonicalGraph.js +1 -8
- package/dist/compiler/catalogErrors.d.ts +0 -1
- package/dist/compiler/catalogProvenance.d.ts +0 -1
- package/dist/compiler/checkedAssessment.d.ts +0 -1
- package/dist/compiler/checkedAssessment.js +1 -1
- package/dist/compiler/checkedComponentSource.d.ts +16 -0
- package/dist/compiler/checkedComponentSource.js +31 -0
- package/dist/compiler/checkedSourcePreparation.d.ts +38 -1
- package/dist/compiler/checkedSourcePreparation.js +71 -0
- package/dist/compiler/complexTypeContent.d.ts +5 -6
- package/dist/compiler/complexTypeContent.js +2 -2
- package/dist/compiler/componentCorrespondence.d.ts +32 -0
- package/dist/compiler/componentCorrespondence.js +140 -0
- package/dist/compiler/componentRecordProjection.d.ts +112 -0
- package/dist/compiler/componentRecordProjection.js +329 -0
- package/dist/compiler/componentSoapPreparation.d.ts +20 -0
- package/dist/compiler/componentSoapPreparation.js +36 -0
- package/dist/compiler/composeCanonicalGraph.d.ts +0 -1
- package/dist/compiler/dataOwnership.d.ts +0 -1
- package/dist/compiler/dataOwnership.js +14 -4
- package/dist/compiler/datatypeValues.d.ts +0 -1
- package/dist/compiler/declarationIdentity.d.ts +22 -0
- package/dist/compiler/declarationIdentity.js +9 -0
- package/dist/compiler/directCodec.d.ts +79 -2
- package/dist/compiler/directCodec.js +310 -92
- package/dist/compiler/directExecutionPolicy.d.ts +0 -1
- package/dist/compiler/directOperation.d.ts +72 -8
- package/dist/compiler/directOperation.js +164 -19
- package/dist/compiler/directSoap.d.ts +29 -5
- package/dist/compiler/directSoap.js +154 -44
- package/dist/compiler/directSoapSource.d.ts +24 -1
- package/dist/compiler/directSoapSource.js +166 -19
- package/dist/compiler/directSourceCapsule.d.ts +74 -2
- package/dist/compiler/directSourceCapsule.js +484 -6
- package/dist/compiler/directStructure.d.ts +83 -6
- package/dist/compiler/directStructure.js +353 -58
- package/dist/compiler/directStructurePlan.d.ts +144 -2
- package/dist/compiler/directStructurePlan.js +615 -30
- package/dist/compiler/directValues.d.ts +76 -5
- package/dist/compiler/directValues.js +967 -117
- package/dist/compiler/finiteRe01Construction.d.ts +69 -0
- package/dist/compiler/finiteRe01Construction.js +422 -0
- package/dist/compiler/finiteRe01Verification.d.ts +81 -3
- package/dist/compiler/finiteRe01Verification.js +391 -4
- package/dist/compiler/generateCatalog.d.ts +0 -1
- package/dist/compiler/graphTraversal.d.ts +0 -1
- package/dist/compiler/hypotheticalScopedIdentity.d.ts +0 -1
- package/dist/compiler/legacyDeclarations.d.ts +26 -0
- package/dist/compiler/legacyDeclarations.js +144 -0
- package/dist/compiler/occurrenceAnalysis.d.ts +2 -1
- package/dist/compiler/occurrenceAnalysis.js +23 -7
- package/dist/compiler/originalSourceMembership.d.ts +0 -1
- package/dist/compiler/particleAttribution.d.ts +0 -1
- package/dist/compiler/particleAttribution.js +20 -0
- package/dist/compiler/particleDeclarationConsistency.d.ts +0 -1
- package/dist/compiler/particleDeclarationConsistency.js +9 -0
- package/dist/compiler/particleExtension.d.ts +0 -1
- package/dist/compiler/particleExtension.js +5 -1
- package/dist/compiler/particleLocalAssessment.d.ts +0 -1
- package/dist/compiler/particleRestriction.d.ts +0 -1
- package/dist/compiler/particleRestriction.js +6 -1
- package/dist/compiler/particleSemanticView.d.ts +2 -1
- package/dist/compiler/particleSemanticView.js +16 -3
- package/dist/compiler/particleWildcardRelation.d.ts +0 -1
- package/dist/compiler/projectionScalar.d.ts +49 -0
- package/dist/compiler/projectionScalar.js +218 -0
- package/dist/compiler/re01CandidateAssignments.d.ts +95 -0
- package/dist/compiler/re01CandidateAssignments.js +341 -0
- package/dist/compiler/re01CandidateCorrespondence.d.ts +22 -1
- package/dist/compiler/re01CandidateCorrespondence.js +167 -38
- package/dist/compiler/re01TypeProperties.d.ts +0 -1
- package/dist/compiler/re01TypePropertyValidation.d.ts +0 -1
- package/dist/compiler/resolveCanonicalGraph.d.ts +5 -2
- package/dist/compiler/resolveCanonicalGraph.js +77 -7
- package/dist/compiler/rpcStringValues.d.ts +30 -0
- package/dist/compiler/rpcStringValues.js +196 -0
- package/dist/compiler/rpcTypedValues.d.ts +48 -0
- package/dist/compiler/rpcTypedValues.js +190 -0
- package/dist/compiler/scalarSchemaAssessment.d.ts +0 -1
- package/dist/compiler/schemaAttributeGroupProperties.d.ts +0 -1
- package/dist/compiler/schemaAttributeProperties.d.ts +0 -1
- package/dist/compiler/schemaAttributeUses.d.ts +22 -2
- package/dist/compiler/schemaAttributeUses.js +86 -13
- package/dist/compiler/schemaBinaryWordReconstruction.d.ts +0 -1
- package/dist/compiler/schemaBuiltinFacets.d.ts +0 -1
- package/dist/compiler/schemaCalendarImages.d.ts +0 -1
- package/dist/compiler/schemaCalendarLanguage.d.ts +0 -1
- package/dist/compiler/schemaCompiler.d.ts +0 -1
- package/dist/compiler/schemaCompiler.js +44 -109
- package/dist/compiler/schemaComponentEquality.d.ts +0 -1
- package/dist/compiler/schemaConstructionAssessment.d.ts +34 -1
- package/dist/compiler/schemaConstructionAssessment.js +88 -6
- package/dist/compiler/schemaDatatypeValues.d.ts +0 -1
- package/dist/compiler/schemaDecimalLanguage.d.ts +0 -1
- package/dist/compiler/schemaDeclarationPrimitives.d.ts +7 -2
- package/dist/compiler/schemaDeclarationPrimitives.js +18 -1
- package/dist/compiler/schemaDocumentSyntax.d.ts +0 -1
- package/dist/compiler/schemaDurationLanguage.d.ts +0 -1
- package/dist/compiler/schemaElementInstance.d.ts +30 -0
- package/dist/compiler/schemaElementInstance.js +45 -0
- package/dist/compiler/schemaElementProperties.d.ts +0 -1
- package/dist/compiler/schemaEndpointWordCapacity.d.ts +0 -1
- package/dist/compiler/schemaExactCalendar.d.ts +0 -1
- package/dist/compiler/schemaFacetAnnotation.d.ts +0 -1
- package/dist/compiler/schemaGeneratedScalarShape.d.ts +0 -1
- package/dist/compiler/schemaGeneratedScalarShape.js +2 -0
- package/dist/compiler/schemaIdentityConstraints.d.ts +0 -1
- package/dist/compiler/schemaIeeeLanguage.d.ts +0 -1
- package/dist/compiler/schemaIntegerImages.d.ts +0 -1
- package/dist/compiler/schemaLexicalPredicates.d.ts +0 -1
- package/dist/compiler/schemaNotationProperties.d.ts +0 -1
- package/dist/compiler/schemaNumericImageConditions.d.ts +0 -1
- package/dist/compiler/schemaParticleWildcardProperties.d.ts +0 -1
- package/dist/compiler/schemaPattern.d.ts +0 -1
- package/dist/compiler/schemaRegularLanguage.d.ts +0 -1
- package/dist/compiler/schemaScalarContext.d.ts +5 -1
- package/dist/compiler/schemaScalarKernel.d.ts +0 -1
- package/dist/compiler/schemaScalarWitnesses.d.ts +0 -1
- package/dist/compiler/schemaSimpleTypeProperties.d.ts +0 -1
- package/dist/compiler/schemaSourceGrammar.d.ts +0 -1
- package/dist/compiler/schemaSourceLexical.d.ts +0 -1
- package/dist/compiler/schemaSourceValues.d.ts +0 -1
- package/dist/compiler/schemaSourceWildcards.d.ts +1 -2
- package/dist/compiler/schemaSourceWildcards.js +3 -1
- package/dist/compiler/schemaSymbolicSequences.d.ts +0 -1
- package/dist/compiler/schemaSymbolicValueSets.d.ts +0 -1
- package/dist/compiler/schemaSyntaxAssessment.d.ts +0 -1
- package/dist/compiler/schemaTemporalAliases.d.ts +0 -1
- package/dist/compiler/schemaTokenImages.d.ts +0 -1
- package/dist/compiler/schemaTypeIdentity.d.ts +0 -1
- package/dist/compiler/schemaTypeIdentity.js +2 -0
- package/dist/compiler/schemaTypeRelations.d.ts +0 -1
- package/dist/compiler/schemaUri.d.ts +0 -1
- package/dist/compiler/schemaValueContext.d.ts +0 -1
- package/dist/compiler/schemaValueImages.d.ts +0 -1
- package/dist/compiler/schemaValueSequences.d.ts +0 -1
- package/dist/compiler/semanticBudget.d.ts +18 -1
- package/dist/compiler/semanticBudget.js +17 -2
- package/dist/compiler/semanticCatalog.d.ts +2 -3
- package/dist/compiler/semanticContext.d.ts +12 -1
- package/dist/compiler/semanticContext.js +39 -0
- package/dist/compiler/semanticTypeDependencies.d.ts +0 -1
- package/dist/compiler/semanticTypeReference.d.ts +0 -1
- package/dist/compiler/shapeResolver.d.ts +0 -1
- package/dist/compiler/soapHeaders.d.ts +16 -0
- package/dist/compiler/soapHeaders.js +42 -0
- package/dist/compiler/sourceSchemaBinding.d.ts +0 -1
- package/dist/compiler/standardSchemaComponents.d.ts +71 -0
- package/dist/compiler/standardSchemaComponents.js +74 -0
- package/dist/compiler/standardSchemaConstruction.d.ts +20 -0
- package/dist/compiler/standardSchemaConstruction.js +34 -0
- package/dist/compiler/structuralCompanions.d.ts +0 -1
- package/dist/compiler/validateSemanticGraph.d.ts +0 -1
- package/dist/compiler/wildcardAlgebra.d.ts +0 -1
- package/dist/compiler/wsdlPolicyRequirements.d.ts +43 -0
- package/dist/compiler/wsdlPolicyRequirements.js +239 -0
- package/dist/config.d.ts +0 -1
- package/dist/gateway/generateCheckedGateway.d.ts +32 -0
- package/dist/gateway/generateCheckedGateway.js +293 -0
- package/dist/gateway/generateComposedGateway.d.ts +16 -0
- package/dist/gateway/generateComposedGateway.js +65 -0
- package/dist/gateway/generateGateway.d.ts +0 -1
- package/dist/gateway/generateGateway.js +1 -0
- package/dist/gateway/generators.d.ts +0 -1
- package/dist/gateway/generators.js +19 -4
- package/dist/gateway/helpers.d.ts +1 -1
- package/dist/gateway/helpers.js +15 -0
- package/dist/generation/componentShape.d.ts +14 -0
- package/dist/generation/componentShape.js +293 -0
- package/dist/generation/preamble.d.ts +0 -1
- package/dist/generation/sourceLayout.d.ts +13 -0
- package/dist/generation/sourceLayout.js +40 -0
- package/dist/generation/writeGeneratedSource.d.ts +0 -1
- package/dist/index.d.ts +11 -2
- package/dist/index.js +4 -1
- package/dist/loader/fetch.d.ts +0 -1
- package/dist/loader/orderedSyntax.d.ts +12 -1
- package/dist/loader/orderedSyntax.js +40 -6
- package/dist/loader/resolutionDepth.d.ts +0 -1
- package/dist/loader/schemaInput.d.ts +28 -1
- package/dist/loader/schemaInput.js +41 -4
- package/dist/loader/schemaResources.d.ts +2 -1
- package/dist/loader/schemaResources.js +45 -4
- package/dist/loader/wsdlLoader.d.ts +0 -1
- package/dist/multiServicePipeline.d.ts +41 -0
- package/dist/multiServicePipeline.js +287 -0
- package/dist/openapi/casing.d.ts +0 -1
- package/dist/openapi/composeOpenAPI.d.ts +29 -0
- package/dist/openapi/composeOpenAPI.js +322 -0
- package/dist/openapi/generateOpenAPI.d.ts +0 -1
- package/dist/openapi/generatePaths.d.ts +0 -1
- package/dist/openapi/generateSchemas.d.ts +0 -1
- package/dist/openapi/security.d.ts +0 -1
- package/dist/pipeline.d.ts +7 -3
- package/dist/pipeline.js +15 -0
- package/dist/test/generateCheckedTests.d.ts +17 -0
- package/dist/test/generateCheckedTests.js +60 -0
- package/dist/test/generateTests.d.ts +0 -1
- package/dist/test/generators.d.ts +0 -1
- package/dist/test/mockData.d.ts +0 -1
- package/dist/test/mockData.js +20 -14
- package/dist/util/attributeWildcards.d.ts +0 -1
- package/dist/util/builder.d.ts +0 -1
- package/dist/util/catalogMeta.d.ts +0 -1
- package/dist/util/checkedCliDiagnostics.d.ts +11 -0
- package/dist/util/checkedCliDiagnostics.js +22 -0
- package/dist/util/cli.d.ts +0 -1
- package/dist/util/errors.d.ts +0 -1
- package/dist/util/imports.d.ts +0 -1
- package/dist/util/runtimeSource.d.ts +0 -1
- package/dist/util/runtimeSource.js +3 -5
- package/dist/util/securityConfig.d.ts +0 -1
- package/dist/util/streamConfig.d.ts +0 -1
- package/dist/util/tools.d.ts +0 -1
- package/dist/util/xmlWhitespace.d.ts +0 -1
- package/dist/xsd/primitives.d.ts +0 -1
- package/docs/agent-skill.md +12 -1
- package/docs/api-reference.md +127 -9
- package/docs/checked-gateway.md +212 -0
- package/docs/checked-generation.md +167 -0
- package/docs/cli-reference.md +48 -6
- package/docs/concepts.md +139 -5
- package/docs/configuration.md +15 -4
- package/docs/corpus.md +33 -0
- package/docs/direct-values.md +13 -13
- package/docs/examples/checked-forecast.wsdl +19 -0
- package/docs/gateway-guide.md +104 -27
- package/docs/generated-code.md +22 -11
- package/docs/mapping-contract.md +114 -0
- package/docs/migration-playbook.md +5 -1
- package/docs/migration.md +124 -6
- package/docs/output-anatomy.md +21 -18
- package/docs/production.md +7 -5
- package/docs/start-here.md +19 -3
- package/docs/supported-patterns.md +24 -3
- package/docs/testing.md +119 -31
- package/docs/troubleshooting.md +3 -1
- package/llms.txt +16 -8
- package/package.json +64 -23
- package/src/runtime/checkedGatewayHost.tpl.txt +157 -0
- package/src/runtime/clientStreamMethods.tpl.txt +156 -148
- package/src/runtime/operationsStreamHelper.tpl.txt +6 -6
- package/src/runtime/streamXml.ts +49 -21
- package/dist/app/generateApp.d.ts.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/client/checkedDirectRuntime.d.ts.map +0 -1
- package/dist/client/directClientRuntime.d.ts.map +0 -1
- package/dist/client/directClientVersion.d.ts.map +0 -1
- package/dist/client/generateClient.d.ts.map +0 -1
- package/dist/client/generateDirectClient.d.ts.map +0 -1
- package/dist/client/generateOperations.d.ts.map +0 -1
- package/dist/client/generateTypes.d.ts.map +0 -1
- package/dist/client/generateUtils.d.ts.map +0 -1
- package/dist/compiler/buildCanonicalGraph.d.ts.map +0 -1
- package/dist/compiler/canonicalGraph.d.ts.map +0 -1
- package/dist/compiler/catalogErrors.d.ts.map +0 -1
- package/dist/compiler/catalogProvenance.d.ts.map +0 -1
- package/dist/compiler/checkedAssessment.d.ts.map +0 -1
- package/dist/compiler/checkedSourcePreparation.d.ts.map +0 -1
- package/dist/compiler/complexTypeContent.d.ts.map +0 -1
- package/dist/compiler/composeCanonicalGraph.d.ts.map +0 -1
- package/dist/compiler/dataOwnership.d.ts.map +0 -1
- package/dist/compiler/datatypeValues.d.ts.map +0 -1
- package/dist/compiler/directCodec.d.ts.map +0 -1
- package/dist/compiler/directExecutionPolicy.d.ts.map +0 -1
- package/dist/compiler/directOperation.d.ts.map +0 -1
- package/dist/compiler/directSoap.d.ts.map +0 -1
- package/dist/compiler/directSoapSource.d.ts.map +0 -1
- package/dist/compiler/directSourceCapsule.d.ts.map +0 -1
- package/dist/compiler/directStructure.d.ts.map +0 -1
- package/dist/compiler/directStructurePlan.d.ts.map +0 -1
- package/dist/compiler/directValues.d.ts.map +0 -1
- package/dist/compiler/finiteRe01Verification.d.ts.map +0 -1
- package/dist/compiler/generateCatalog.d.ts.map +0 -1
- package/dist/compiler/graphTraversal.d.ts.map +0 -1
- package/dist/compiler/hypotheticalScopedIdentity.d.ts.map +0 -1
- package/dist/compiler/occurrenceAnalysis.d.ts.map +0 -1
- package/dist/compiler/originalSourceMembership.d.ts.map +0 -1
- package/dist/compiler/particleAttribution.d.ts.map +0 -1
- package/dist/compiler/particleDeclarationConsistency.d.ts.map +0 -1
- package/dist/compiler/particleExtension.d.ts.map +0 -1
- package/dist/compiler/particleLocalAssessment.d.ts.map +0 -1
- package/dist/compiler/particleRestriction.d.ts.map +0 -1
- package/dist/compiler/particleSemanticView.d.ts.map +0 -1
- package/dist/compiler/particleWildcardRelation.d.ts.map +0 -1
- package/dist/compiler/re01CandidateCorrespondence.d.ts.map +0 -1
- package/dist/compiler/re01TypeProperties.d.ts.map +0 -1
- package/dist/compiler/re01TypePropertyValidation.d.ts.map +0 -1
- package/dist/compiler/resolveCanonicalGraph.d.ts.map +0 -1
- package/dist/compiler/scalarSchemaAssessment.d.ts.map +0 -1
- package/dist/compiler/schemaAttributeGroupProperties.d.ts.map +0 -1
- package/dist/compiler/schemaAttributeProperties.d.ts.map +0 -1
- package/dist/compiler/schemaAttributeUses.d.ts.map +0 -1
- package/dist/compiler/schemaBinaryWordReconstruction.d.ts.map +0 -1
- package/dist/compiler/schemaBuiltinFacets.d.ts.map +0 -1
- package/dist/compiler/schemaCalendarImages.d.ts.map +0 -1
- package/dist/compiler/schemaCalendarLanguage.d.ts.map +0 -1
- package/dist/compiler/schemaCompiler.d.ts.map +0 -1
- package/dist/compiler/schemaComponentEquality.d.ts.map +0 -1
- package/dist/compiler/schemaConstructionAssessment.d.ts.map +0 -1
- package/dist/compiler/schemaDatatypeValues.d.ts.map +0 -1
- package/dist/compiler/schemaDecimalLanguage.d.ts.map +0 -1
- package/dist/compiler/schemaDeclarationPrimitives.d.ts.map +0 -1
- package/dist/compiler/schemaDocumentSyntax.d.ts.map +0 -1
- package/dist/compiler/schemaDurationLanguage.d.ts.map +0 -1
- package/dist/compiler/schemaElementProperties.d.ts.map +0 -1
- package/dist/compiler/schemaEndpointWordCapacity.d.ts.map +0 -1
- package/dist/compiler/schemaExactCalendar.d.ts.map +0 -1
- package/dist/compiler/schemaFacetAnnotation.d.ts.map +0 -1
- package/dist/compiler/schemaGeneratedScalarShape.d.ts.map +0 -1
- package/dist/compiler/schemaIdentityConstraints.d.ts.map +0 -1
- package/dist/compiler/schemaIeeeLanguage.d.ts.map +0 -1
- package/dist/compiler/schemaIntegerImages.d.ts.map +0 -1
- package/dist/compiler/schemaLexicalPredicates.d.ts.map +0 -1
- package/dist/compiler/schemaNotationProperties.d.ts.map +0 -1
- package/dist/compiler/schemaNumericImageConditions.d.ts.map +0 -1
- package/dist/compiler/schemaParticleWildcardProperties.d.ts.map +0 -1
- package/dist/compiler/schemaPattern.d.ts.map +0 -1
- package/dist/compiler/schemaRegularLanguage.d.ts.map +0 -1
- package/dist/compiler/schemaScalarContext.d.ts.map +0 -1
- package/dist/compiler/schemaScalarKernel.d.ts.map +0 -1
- package/dist/compiler/schemaScalarWitnesses.d.ts.map +0 -1
- package/dist/compiler/schemaSimpleTypeProperties.d.ts.map +0 -1
- package/dist/compiler/schemaSourceGrammar.d.ts.map +0 -1
- package/dist/compiler/schemaSourceLexical.d.ts.map +0 -1
- package/dist/compiler/schemaSourceValues.d.ts.map +0 -1
- package/dist/compiler/schemaSourceWildcards.d.ts.map +0 -1
- package/dist/compiler/schemaSymbolicSequences.d.ts.map +0 -1
- package/dist/compiler/schemaSymbolicValueSets.d.ts.map +0 -1
- package/dist/compiler/schemaSyntaxAssessment.d.ts.map +0 -1
- package/dist/compiler/schemaTemporalAliases.d.ts.map +0 -1
- package/dist/compiler/schemaTokenImages.d.ts.map +0 -1
- package/dist/compiler/schemaTypeIdentity.d.ts.map +0 -1
- package/dist/compiler/schemaTypeRelations.d.ts.map +0 -1
- package/dist/compiler/schemaUri.d.ts.map +0 -1
- package/dist/compiler/schemaValueContext.d.ts.map +0 -1
- package/dist/compiler/schemaValueImages.d.ts.map +0 -1
- package/dist/compiler/schemaValueSequences.d.ts.map +0 -1
- package/dist/compiler/semanticBudget.d.ts.map +0 -1
- package/dist/compiler/semanticCatalog.d.ts.map +0 -1
- package/dist/compiler/semanticContext.d.ts.map +0 -1
- package/dist/compiler/semanticTypeDependencies.d.ts.map +0 -1
- package/dist/compiler/semanticTypeReference.d.ts.map +0 -1
- package/dist/compiler/shapeResolver.d.ts.map +0 -1
- package/dist/compiler/sourceSchemaBinding.d.ts.map +0 -1
- package/dist/compiler/structuralCompanions.d.ts.map +0 -1
- package/dist/compiler/validateSemanticGraph.d.ts.map +0 -1
- package/dist/compiler/wildcardAlgebra.d.ts.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/gateway/generateGateway.d.ts.map +0 -1
- package/dist/gateway/generators.d.ts.map +0 -1
- package/dist/gateway/helpers.d.ts.map +0 -1
- package/dist/generation/preamble.d.ts.map +0 -1
- package/dist/generation/writeGeneratedSource.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/loader/fetch.d.ts.map +0 -1
- package/dist/loader/orderedSyntax.d.ts.map +0 -1
- package/dist/loader/resolutionDepth.d.ts.map +0 -1
- package/dist/loader/schemaInput.d.ts.map +0 -1
- package/dist/loader/schemaResources.d.ts.map +0 -1
- package/dist/loader/wsdlLoader.d.ts.map +0 -1
- package/dist/openapi/casing.d.ts.map +0 -1
- package/dist/openapi/generateOpenAPI.d.ts.map +0 -1
- package/dist/openapi/generatePaths.d.ts.map +0 -1
- package/dist/openapi/generateSchemas.d.ts.map +0 -1
- package/dist/openapi/security.d.ts.map +0 -1
- package/dist/pipeline.d.ts.map +0 -1
- package/dist/runtime/jsonArray.d.ts +0 -24
- package/dist/runtime/jsonArray.d.ts.map +0 -1
- package/dist/runtime/jsonArray.js +0 -52
- package/dist/runtime/ndjson.d.ts +0 -24
- package/dist/runtime/ndjson.d.ts.map +0 -1
- package/dist/runtime/ndjson.js +0 -30
- package/dist/runtime/streamXml.d.ts +0 -45
- package/dist/runtime/streamXml.d.ts.map +0 -1
- package/dist/runtime/streamXml.js +0 -212
- package/dist/test/generateTests.d.ts.map +0 -1
- package/dist/test/generators.d.ts.map +0 -1
- package/dist/test/mockData.d.ts.map +0 -1
- package/dist/util/attributeWildcards.d.ts.map +0 -1
- package/dist/util/builder.d.ts.map +0 -1
- package/dist/util/catalogMeta.d.ts.map +0 -1
- package/dist/util/cli.d.ts.map +0 -1
- package/dist/util/errors.d.ts.map +0 -1
- package/dist/util/imports.d.ts.map +0 -1
- package/dist/util/runtimeSource.d.ts.map +0 -1
- package/dist/util/securityConfig.d.ts.map +0 -1
- package/dist/util/streamConfig.d.ts.map +0 -1
- package/dist/util/tools.d.ts.map +0 -1
- package/dist/util/xmlWhitespace.d.ts.map +0 -1
- package/dist/xsd/primitives.d.ts.map +0 -1
- package/docs/AGENTS.md +0 -47
- package/docs/README.md +0 -69
- package/docs/architecture.md +0 -158
- package/docs/content-model-analysis.md +0 -92
- package/docs/content-model-baseline.md +0 -121
- package/docs/content-model-catalog.md +0 -116
- package/docs/content-model-companions.md +0 -90
- package/docs/content-model-composition.md +0 -103
- package/docs/content-model-decisions.md +0 -79
- package/docs/content-model-gateway-feasibility.md +0 -169
- package/docs/content-model-graph.md +0 -121
- package/docs/content-model-loading.md +0 -163
- package/docs/content-model-matching.md +0 -85
- package/docs/content-model-readiness.md +0 -144
- package/docs/content-model-resolution.md +0 -81
- package/docs/content-model-s02-handoff.md +0 -98
- package/docs/content-model-s06-au-01.md +0 -425
- package/docs/content-model-s06-dt-01.md +0 -386
- package/docs/content-model-s06-pw-01.md +0 -350
- package/docs/content-model-s06-re-01-resolver-implementation.md +0 -869
- package/docs/content-model-s06-re-01-resolver.md +0 -513
- package/docs/content-model-s06-re-01-scalar-witnesses.md +0 -1423
- package/docs/content-model-s06-re-01-support-reconstruction.md +0 -6337
- package/docs/content-model-s06-re-01.md +0 -7477
- package/docs/content-model-s06-research-handoff.md +0 -909
- package/docs/content-model-shipped-fix.md +0 -83
- package/docs/content-model-soap-feasibility.md +0 -165
- package/docs/decisions/001-test-generation.md +0 -36
- package/docs/decisions/002-streamable-responses.md +0 -332
- package/docs/decisions/003-content-model-contracts.md +0 -280
- package/docs/file-naming-and-path-organization.md +0 -213
- package/docs/reference-validation.md +0 -243
- package/docs/releases/README.md +0 -94
- package/docs/releases/v0.20.0.md +0 -22
- package/docs/releases/v0.21.0.md +0 -30
- package/docs/releases/v0.22.0.md +0 -30
- package/docs/releases/v0.23.0.md +0 -31
- package/docs/releases/v0.24.0.md +0 -38
- package/docs/releases/v0.25.0.md +0 -31
- package/docs/releases/v0.25.2.md +0 -32
- package/docs/releases/v0.26.0.md +0 -32
- package/docs/releases/v0.27.0.md +0 -31
- package/docs/releases/v0.28.0.md +0 -32
- package/docs/releases/v0.29.0.md +0 -32
- package/docs/releases/v0.30.0.md +0 -30
- package/docs/releases/v0.30.1.md +0 -31
- package/docs/releases/v0.30.2.md +0 -30
- package/docs/releases/v0.30.3.md +0 -33
- package/docs/releases/v0.31.0.md +0 -33
- package/docs/releases/v0.32.0.md +0 -33
- package/docs/releases/v0.33.0.md +0 -34
- package/docs/releases/v0.34.0.md +0 -30
- package/docs/releases/v0.35.0.md +0 -33
- package/docs/releases/v0.36.0.md +0 -32
- package/docs/releases/v0.37.0.md +0 -33
- package/docs/releases/v0.38.0.md +0 -35
- package/docs/releases/v0.39.0.md +0 -35
- package/docs/releases/v0.40.0.md +0 -45
- package/docs/releases/v0.40.1.md +0 -34
- package/docs/releases/v1.0.0.md +0 -42
- package/docs/releases/v1.0.1.md +0 -38
- package/docs/releases/v1.0.2.md +0 -51
- package/docs/releases/v1.0.3.md +0 -37
- package/docs/releases/v1.0.4.md +0 -45
- package/docs/releases/v1.0.5.md +0 -41
- package/docs/releases/v1.0.6.md +0 -35
- package/docs/releases/v1.0.7.md +0 -36
- package/docs/releases/v1.1.0.md +0 -42
- package/docs/releases/v1.1.1.md +0 -44
- package/docs/releases/v1.1.2.md +0 -42
- package/docs/releases/v1.1.3.md +0 -36
- package/docs/releases/v1.1.4.md +0 -36
- package/docs/releases/v1.1.5.md +0 -38
- package/docs/roadmap/README.md +0 -107
- package/docs/roadmap/v1.0-capability-conformance-framework.md +0 -582
- package/docs/roadmap/v1.0-choice-union-mode.md +0 -90
- package/docs/roadmap/v1.0-contract-audit.md +0 -75
- package/docs/roadmap/v1.0-json-array-streaming.md +0 -101
- package/docs/roadmap/v1.0-openapi-fastify-compatibility.md +0 -99
- package/docs/roadmap/v1.0-release-candidate-gates.md +0 -92
- package/docs/roadmap/v1.0-wsdl-coverage-matrix.md +0 -200
- package/docs/roadmap/v1.0-xs-anyattribute-wildcard-bag.md +0 -932
- package/src/runtime/jsonArray.ts +0 -55
- package/src/runtime/ndjson.ts +0 -32
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { DirectMessageRoot, DirectOperationContract } from './directOperation.js';
|
|
2
|
-
import type { ElementNode, Reference } from './canonicalGraph.js';
|
|
2
|
+
import type { AttributeNode, ElementNode, Reference } from './canonicalGraph.js';
|
|
3
3
|
import type { ExpandedName, SyntaxElement, SyntaxSource } from '../loader/orderedSyntax.js';
|
|
4
|
+
import type { DirectProjectionSlot } from './directStructurePlan.js';
|
|
5
|
+
import type { SemanticContext } from './semanticContext.js';
|
|
4
6
|
import type { ResolverUsage } from './semanticBudget.js';
|
|
7
|
+
import type { ProjectionScalarList } from './projectionScalar.js';
|
|
5
8
|
export type DirectDirection = Readonly<{
|
|
6
9
|
kind: 'input' | 'output';
|
|
7
10
|
} | {
|
|
@@ -9,7 +12,7 @@ export type DirectDirection = Readonly<{
|
|
|
9
12
|
name: string;
|
|
10
13
|
}>;
|
|
11
14
|
export interface DirectScalarDuty {
|
|
12
|
-
readonly declaration: ElementNode;
|
|
15
|
+
readonly declaration: ElementNode | AttributeNode;
|
|
13
16
|
readonly type: Reference;
|
|
14
17
|
readonly builtin: ExpandedName;
|
|
15
18
|
readonly lexical: string;
|
|
@@ -17,7 +20,74 @@ export interface DirectScalarDuty {
|
|
|
17
20
|
readonly payloadSource: SyntaxSource;
|
|
18
21
|
readonly payloadPath: string;
|
|
19
22
|
readonly schemaPath: string;
|
|
23
|
+
readonly fixedCanonical?: string;
|
|
24
|
+
readonly retainLexical?: true;
|
|
25
|
+
readonly list?: ProjectionScalarList;
|
|
20
26
|
}
|
|
27
|
+
export type DirectMatchedNode = Readonly<{
|
|
28
|
+
kind: 'unassessed';
|
|
29
|
+
declaration: ElementNode;
|
|
30
|
+
payloadPath: string;
|
|
31
|
+
payload: SyntaxElement;
|
|
32
|
+
} | {
|
|
33
|
+
kind: 'mixed-text';
|
|
34
|
+
declaration: ElementNode;
|
|
35
|
+
payloadPath: string;
|
|
36
|
+
value: string;
|
|
37
|
+
} | {
|
|
38
|
+
kind: 'scalar';
|
|
39
|
+
declaration: ElementNode;
|
|
40
|
+
payloadPath: string;
|
|
41
|
+
operand: number;
|
|
42
|
+
} | {
|
|
43
|
+
kind: 'record';
|
|
44
|
+
declaration: ElementNode;
|
|
45
|
+
payloadPath: string;
|
|
46
|
+
nil?: true;
|
|
47
|
+
keyed?: true;
|
|
48
|
+
namespaceChoices?: readonly string[];
|
|
49
|
+
dynamicDeclarations?: readonly ElementNode[];
|
|
50
|
+
namespaces?: Readonly<Record<string, string>>;
|
|
51
|
+
openAttributes?: readonly import('../loader/orderedSyntax.js').SyntaxAttribute[];
|
|
52
|
+
attributes: readonly Readonly<{
|
|
53
|
+
declaration: AttributeNode;
|
|
54
|
+
operand: number;
|
|
55
|
+
payloadPath: string;
|
|
56
|
+
bag?: true;
|
|
57
|
+
namespaceChoice?: true;
|
|
58
|
+
origin: 'present' | 'schema-default' | 'schema-fixed';
|
|
59
|
+
}>[];
|
|
60
|
+
text?: Extract<DirectMatchedNode, {
|
|
61
|
+
kind: 'scalar';
|
|
62
|
+
}>;
|
|
63
|
+
content?: readonly DirectMatchedNode[];
|
|
64
|
+
slots: readonly Readonly<{
|
|
65
|
+
slot: DirectProjectionSlot;
|
|
66
|
+
items: readonly DirectMatchedNode[];
|
|
67
|
+
}>[];
|
|
68
|
+
}>;
|
|
69
|
+
export type ProjectionStructuralResult = Readonly<{
|
|
70
|
+
kind: 'projection-match';
|
|
71
|
+
scope: 'structure-only';
|
|
72
|
+
scalarValidity: 'unassessed';
|
|
73
|
+
admitted: false;
|
|
74
|
+
root: ElementNode;
|
|
75
|
+
contextId: string;
|
|
76
|
+
tree: DirectMatchedNode;
|
|
77
|
+
occurrences: readonly DirectScalarDuty[];
|
|
78
|
+
usage: ResolverUsage;
|
|
79
|
+
}> | Readonly<{
|
|
80
|
+
kind: 'mismatch' | 'unsupported' | 'cancelled' | 'resource-limit';
|
|
81
|
+
rule: string;
|
|
82
|
+
schemaPath?: string;
|
|
83
|
+
payloadPath?: string;
|
|
84
|
+
usage: ResolverUsage;
|
|
85
|
+
}>;
|
|
86
|
+
export type ProjectionStructuralMatch = Extract<ProjectionStructuralResult, {
|
|
87
|
+
kind: 'projection-match';
|
|
88
|
+
}>;
|
|
89
|
+
/** Native context identity authenticates structure only, never source validity or operation admission. */
|
|
90
|
+
export declare function inspectProjectionStructuralMatch(match: unknown, context: SemanticContext): ProjectionStructuralMatch;
|
|
21
91
|
export type DirectStructuralResult = Readonly<{
|
|
22
92
|
kind: 'structural-match';
|
|
23
93
|
scope: 'structure-only';
|
|
@@ -27,6 +97,7 @@ export type DirectStructuralResult = Readonly<{
|
|
|
27
97
|
contextId: string;
|
|
28
98
|
direction: DirectDirection;
|
|
29
99
|
occurrences: readonly DirectScalarDuty[];
|
|
100
|
+
tree: DirectMatchedNode;
|
|
30
101
|
usage: ResolverUsage;
|
|
31
102
|
}> | Readonly<{
|
|
32
103
|
kind: 'mismatch' | 'unsupported' | 'cancelled' | 'resource-limit';
|
|
@@ -41,11 +112,17 @@ export type DirectStructuralMatch = Extract<DirectStructuralResult, {
|
|
|
41
112
|
/** Identity is checked before any receipt fields; no retrospective authentication. */
|
|
42
113
|
export declare function inspectDirectStructuralMatch(match: unknown, expectedContract: DirectOperationContract): DirectStructuralMatch;
|
|
43
114
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
115
|
+
* Match a data-only ordered XML tree against an actual native projection.
|
|
116
|
+
* @remarks The issued receipt establishes structure only, not source validity, scalar validity or operation admission.
|
|
117
|
+
* @constraints Plain records/arrays only; proxies and accessors are unsupported. No caller payload is frozen.
|
|
118
|
+
* @throws TypeError For malformed data-only trees or unauthenticated contexts.
|
|
119
|
+
* @returns A context-owned structural match or a mismatch, unsupported, cancellation or resource failure.
|
|
47
120
|
*/
|
|
121
|
+
export declare function matchDirectProjection(context: SemanticContext, root: ElementNode, payload: SyntaxElement, options?: Readonly<{
|
|
122
|
+
signal?: AbortSignal;
|
|
123
|
+
flatOnly?: boolean;
|
|
124
|
+
}>): ProjectionStructuralResult;
|
|
125
|
+
/** Operation-owned flat preview wrapper; structured projection matches cannot bypass this gate. */
|
|
48
126
|
export declare function matchDirectOperation(contract: DirectOperationContract, direction: DirectDirection, payload: SyntaxElement, options?: Readonly<{
|
|
49
127
|
signal?: AbortSignal;
|
|
50
128
|
}>): DirectStructuralResult;
|
|
51
|
-
//# sourceMappingURL=directStructure.d.ts.map
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
/** Internal direct case of the content-model matcher; never runtime admission. */
|
|
2
2
|
import { inspectDirectOperation } from './directOperation.js';
|
|
3
|
-
import {
|
|
3
|
+
import { planDirectProjection, flatDirectProjection, matchOrderedProjection, selectProjectionAttribute, isXmlCharacters, isXmlNamespaceBinding } from './directStructurePlan.js';
|
|
4
|
+
import { assertSemanticContext } from './semanticContext.js';
|
|
5
|
+
import { isXmlNCName } from '../loader/orderedSyntax.js';
|
|
6
|
+
const projectionIssued = new WeakMap();
|
|
7
|
+
/** Native context identity authenticates structure only, never source validity or operation admission. */
|
|
8
|
+
export function inspectProjectionStructuralMatch(match, context) {
|
|
9
|
+
assertSemanticContext(context);
|
|
10
|
+
if (!match || typeof match !== 'object' || projectionIssued.get(match) !== context)
|
|
11
|
+
throw new TypeError('Unauthenticated or foreign projection structural match');
|
|
12
|
+
return match;
|
|
13
|
+
}
|
|
4
14
|
const issued = new WeakMap();
|
|
5
15
|
/** Identity is checked before any receipt fields; no retrospective authentication. */
|
|
6
16
|
export function inspectDirectStructuralMatch(match, expectedContract) {
|
|
@@ -23,12 +33,14 @@ class Stop extends Error {
|
|
|
23
33
|
}
|
|
24
34
|
}
|
|
25
35
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
36
|
+
* Match a data-only ordered XML tree against an actual native projection.
|
|
37
|
+
* @remarks The issued receipt establishes structure only, not source validity, scalar validity or operation admission.
|
|
38
|
+
* @constraints Plain records/arrays only; proxies and accessors are unsupported. No caller payload is frozen.
|
|
39
|
+
* @throws TypeError For malformed data-only trees or unauthenticated contexts.
|
|
40
|
+
* @returns A context-owned structural match or a mismatch, unsupported, cancellation or resource failure.
|
|
29
41
|
*/
|
|
30
|
-
export function
|
|
31
|
-
|
|
42
|
+
export function matchDirectProjection(context, root, payload, options = {}) {
|
|
43
|
+
assertSemanticContext(context);
|
|
32
44
|
const { budget } = context;
|
|
33
45
|
const check = () => { budget.chargeWork(); if (options.signal?.aborted)
|
|
34
46
|
throw new Stop('cancelled', 'cooperative-cancellation'); };
|
|
@@ -62,28 +74,27 @@ export function matchDirectOperation(contract, direction, payload, options = {})
|
|
|
62
74
|
// Reserve fixed closures/state, diagnostics and terminal publication before input work.
|
|
63
75
|
budget.chargeWork(4096);
|
|
64
76
|
check();
|
|
65
|
-
const
|
|
66
|
-
if (!record(suppliedDirection))
|
|
67
|
-
return malformed();
|
|
68
|
-
if (!['input', 'output', 'fault'].includes(suppliedDirection.kind))
|
|
69
|
-
return fail('unsupported', 'unknown-direction');
|
|
70
|
-
const ownedDirection = suppliedDirection.kind === 'fault'
|
|
71
|
-
? { kind: 'fault', name: suppliedDirection.name } : { kind: suppliedDirection.kind };
|
|
72
|
-
let root;
|
|
73
|
-
if (ownedDirection.kind === 'fault') {
|
|
74
|
-
budget.chargeWork(64 + contract.faults.length * 32);
|
|
75
|
-
if (typeof ownedDirection.name !== 'string')
|
|
76
|
-
return fail('unsupported', 'unknown-fault');
|
|
77
|
-
const selected = contract.faults.find(f => budget.compareText(f.name, ownedDirection.name) === 0);
|
|
78
|
-
if (!selected)
|
|
79
|
-
return fail('unsupported', 'unknown-fault');
|
|
80
|
-
root = selected.root;
|
|
81
|
-
}
|
|
82
|
-
else
|
|
83
|
-
root = contract[ownedDirection.kind];
|
|
84
|
-
const schemaPath = root.element.context.source.path;
|
|
77
|
+
const schemaPath = root.context.source.path;
|
|
85
78
|
const unsupported = () => fail('unsupported', 'native-direct-shape', schemaPath);
|
|
86
|
-
const
|
|
79
|
+
const plan = planDirectProjection(context, root, check, unsupported);
|
|
80
|
+
if (options.flatOnly)
|
|
81
|
+
flatDirectProjection(plan, check, unsupported);
|
|
82
|
+
const records = new Map(plan.records.map(record => [record.type.id, record]));
|
|
83
|
+
const wildcardPlans = new Map([[root, plan]]);
|
|
84
|
+
const wildcardValue = (element) => {
|
|
85
|
+
let selected = wildcardPlans.get(element);
|
|
86
|
+
if (!selected) {
|
|
87
|
+
selected = planDirectProjection(context, element, check, unsupported);
|
|
88
|
+
budget.chargeWork(64 + selected.records.length * 64);
|
|
89
|
+
for (const record of selected.records) {
|
|
90
|
+
check();
|
|
91
|
+
if (!records.has(record.type.id))
|
|
92
|
+
records.set(record.type.id, record);
|
|
93
|
+
}
|
|
94
|
+
wildcardPlans.set(element, selected);
|
|
95
|
+
}
|
|
96
|
+
return selected.root;
|
|
97
|
+
};
|
|
87
98
|
// Count syntax nodes before copying. Descriptor reads reject accessors without invoking
|
|
88
99
|
// them. A tree may not reuse a node, including cyclic input; proxies are out of contract.
|
|
89
100
|
budget.chargeWork(128);
|
|
@@ -155,25 +166,12 @@ export function matchDirectOperation(contract, direction, payload, options = {})
|
|
|
155
166
|
if (node.attributes.length)
|
|
156
167
|
fail('unsupported', 'payload-attributes', declaration.context.source.path, path);
|
|
157
168
|
};
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
return mismatch('root-name', root.element, '/0');
|
|
169
|
+
if (!same(owned.name, root.name))
|
|
170
|
+
return mismatch('root-name', root, '/0');
|
|
161
171
|
budget.chargeWork(64);
|
|
162
172
|
const occurrences = [];
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
budget.chargeWork(64);
|
|
166
|
-
const parts = [];
|
|
167
|
-
let length = 0;
|
|
168
|
-
for (const child of node.children) {
|
|
169
|
-
check();
|
|
170
|
-
if (child.kind !== 'text')
|
|
171
|
-
return mismatch('scalar-child', declaration, path);
|
|
172
|
-
budget.chargeWork(32 + child.value.length * 4);
|
|
173
|
-
parts.push(child.value);
|
|
174
|
-
length += child.value.length;
|
|
175
|
-
}
|
|
176
|
-
budget.chargeWork(256 + length * 4 + path.length * 4);
|
|
173
|
+
const operand = (node, declaration, builtin, lexical, path, fixedCanonical, retainLexical, list) => {
|
|
174
|
+
budget.chargeWork(256 + lexical.length * 4 + path.length * 4);
|
|
177
175
|
// Project only typed retained facts. Generic snapshots deliberately preserve
|
|
178
176
|
// unknown values; caller extension fields must not become receipt authority.
|
|
179
177
|
const namespaces = Object.create(null);
|
|
@@ -188,22 +186,261 @@ export function matchDirectOperation(contract, direction, payload, options = {})
|
|
|
188
186
|
const payloadSource = budget.snapshot({ uri: s.uri, digest: s.digest, path: s.path,
|
|
189
187
|
start: { offset: s.start.offset, line: s.start.line, column: s.start.column },
|
|
190
188
|
end: { offset: s.end.offset, line: s.end.line, column: s.end.column } });
|
|
191
|
-
occurrences.push({ declaration, type: declaration.type, builtin, lexical
|
|
192
|
-
payloadSource, payloadPath: path, schemaPath: declaration.context.source.path
|
|
189
|
+
occurrences.push({ declaration, type: declaration.type, builtin, lexical, namespaces,
|
|
190
|
+
payloadSource, payloadPath: path, schemaPath: declaration.context.source.path,
|
|
191
|
+
...(fixedCanonical === undefined ? {} : { fixedCanonical }), ...(retainLexical ? { retainLexical } : {}), ...(list ? { list } : {}) });
|
|
193
192
|
};
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
193
|
+
const text = (node, declaration, path) => {
|
|
194
|
+
budget.chargeWork(64);
|
|
195
|
+
const parts = [];
|
|
196
|
+
for (const child of node.children) {
|
|
197
|
+
check();
|
|
198
|
+
if (child.kind !== 'text')
|
|
199
|
+
return mismatch('scalar-child', declaration, path);
|
|
200
|
+
budget.chargeWork(32 + child.value.length * 4);
|
|
201
|
+
parts.push(child.value);
|
|
202
|
+
}
|
|
203
|
+
return parts.join('');
|
|
204
|
+
};
|
|
205
|
+
const elementOperand = (node, declaration, builtin, path, shape, retainLexical, list) => {
|
|
206
|
+
const lexical = text(node, declaration, path);
|
|
207
|
+
operand(node, declaration, builtin, lexical === '' && shape.constraint ? shape.constraint.lexical : lexical, path, shape.constraint?.kind === 'fixed' ? shape.constraint.canonical : undefined, retainLexical, list);
|
|
208
|
+
};
|
|
209
|
+
const leaf = (node, declaration, builtin, path, shape, retainLexical, list) => {
|
|
210
|
+
attributes(node, declaration, path);
|
|
211
|
+
elementOperand(node, declaration, builtin, path, shape, retainLexical, list);
|
|
212
|
+
};
|
|
213
|
+
const roots = [];
|
|
214
|
+
const frames = [{ node: owned, declaration: root, value: plan.root, path: '/0', into: roots }];
|
|
215
|
+
while (frames.length) {
|
|
216
|
+
check();
|
|
217
|
+
const frame = frames.pop();
|
|
218
|
+
const { declaration, path: parentPath } = frame;
|
|
219
|
+
let node = frame.node;
|
|
220
|
+
budget.chargeWork(128 + parentPath.length * 4);
|
|
221
|
+
if (node.kind === 'text') {
|
|
222
|
+
if (!isXmlCharacters(node.value))
|
|
223
|
+
return mismatch('xml-characters', declaration, parentPath);
|
|
224
|
+
frame.into.push({ kind: 'mixed-text', declaration, payloadPath: parentPath, value: node.value });
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
if (frame.unassessed) {
|
|
228
|
+
const pending = [node];
|
|
229
|
+
while (pending.length) {
|
|
230
|
+
check();
|
|
231
|
+
const value = pending.pop();
|
|
232
|
+
budget.chargeWork(64);
|
|
233
|
+
if (value.kind === 'text') {
|
|
234
|
+
if (!isXmlCharacters(value.value))
|
|
235
|
+
return mismatch('xml-characters', declaration, value.source.path);
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
238
|
+
if (!isXmlNCName(value.name.local) || !isXmlCharacters(value.name.namespace) || value.name.namespace === 'http://www.w3.org/2000/xmlns/')
|
|
239
|
+
return mismatch('expanded-name-required', declaration, value.source.path);
|
|
240
|
+
for (const prefix in value.namespaces) {
|
|
241
|
+
check();
|
|
242
|
+
if (!isXmlNamespaceBinding(prefix, value.namespaces[prefix]))
|
|
243
|
+
return mismatch('namespace-binding', declaration, value.source.path);
|
|
244
|
+
}
|
|
245
|
+
const identities = new Set();
|
|
246
|
+
for (const attribute of value.attributes) {
|
|
247
|
+
check();
|
|
248
|
+
const key = JSON.stringify([attribute.name.namespace, attribute.name.local]);
|
|
249
|
+
budget.chargeWork(64 + key.length * 4 + attribute.value.length);
|
|
250
|
+
if (!isXmlNCName(attribute.name.local) || attribute.name.local === 'xmlns' && attribute.name.namespace === '' || attribute.name.namespace === 'http://www.w3.org/2000/xmlns/' || !isXmlCharacters(attribute.name.namespace))
|
|
251
|
+
return mismatch('attribute-name', declaration, value.source.path);
|
|
252
|
+
if (!isXmlCharacters(attribute.value))
|
|
253
|
+
return mismatch('xml-characters', declaration, value.source.path);
|
|
254
|
+
if (identities.has(key))
|
|
255
|
+
return mismatch('duplicate-attribute', declaration, value.source.path);
|
|
256
|
+
identities.add(key);
|
|
257
|
+
}
|
|
258
|
+
for (const child of value.children) {
|
|
259
|
+
check();
|
|
260
|
+
pending.push(child);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
frame.into.push({ kind: 'unassessed', declaration, payloadPath: parentPath, payload: node });
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
let nil = false;
|
|
267
|
+
const nilAttributes = node.attributes.filter(attribute => {
|
|
268
|
+
check();
|
|
269
|
+
return attribute.name.namespace === 'http://www.w3.org/2001/XMLSchema-instance' && attribute.name.local === 'nil';
|
|
270
|
+
});
|
|
271
|
+
if (nilAttributes.length) {
|
|
272
|
+
if (options.flatOnly)
|
|
273
|
+
return fail('unsupported', 'payload-attributes', declaration.context.source.path, parentPath);
|
|
274
|
+
if (nilAttributes.length !== 1)
|
|
275
|
+
return mismatch('duplicate-nil', declaration, parentPath);
|
|
276
|
+
const lexical = nilAttributes[0].value.replace(/^[\t\r\n ]+|[\t\r\n ]+$/g, '');
|
|
277
|
+
if (!['true', '1', 'false', '0'].includes(lexical))
|
|
278
|
+
return mismatch('nil-lexical', declaration, parentPath);
|
|
279
|
+
nil = lexical === 'true' || lexical === '1';
|
|
280
|
+
if (nil && !frame.value.nillable)
|
|
281
|
+
return mismatch('non-nillable', declaration, parentPath);
|
|
282
|
+
if (nil && frame.value.constraint?.kind === 'fixed')
|
|
283
|
+
return mismatch('nil-fixed-value', declaration, parentPath);
|
|
284
|
+
if (nil && node.children.length)
|
|
285
|
+
return mismatch('nil-content', declaration, parentPath);
|
|
286
|
+
node = { ...node, attributes: node.attributes.filter(attribute => { check(); return !nilAttributes.includes(attribute); }) };
|
|
287
|
+
}
|
|
288
|
+
if (frame.value.kind === 'scalar') {
|
|
289
|
+
if (nil) {
|
|
290
|
+
attributes(node, declaration, parentPath);
|
|
291
|
+
frame.into.push({ kind: 'record', nil: true, declaration, payloadPath: parentPath, attributes: [], slots: [] });
|
|
292
|
+
continue;
|
|
293
|
+
}
|
|
294
|
+
const operand = occurrences.length;
|
|
295
|
+
leaf(node, declaration, frame.value.builtin, parentPath, frame.value, frame.value.retainLexical, frame.value.list);
|
|
296
|
+
frame.into.push({ kind: 'scalar', declaration, payloadPath: parentPath, operand });
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
const record = records.get(frame.value.type);
|
|
300
|
+
if (!record)
|
|
301
|
+
return unsupported();
|
|
302
|
+
if (record.contextual)
|
|
303
|
+
for (const prefix in node.namespaces) {
|
|
304
|
+
check();
|
|
305
|
+
if (!isXmlNamespaceBinding(prefix, node.namespaces[prefix]))
|
|
306
|
+
return mismatch('namespace-binding', declaration, parentPath);
|
|
307
|
+
}
|
|
308
|
+
// @why XSD 1.0 cvc-complex-type.2.1 forbids even whitespace character children for empty content.
|
|
309
|
+
if (record.content === 'empty' && node.children.length)
|
|
310
|
+
return mismatch('empty-content', declaration, parentPath);
|
|
311
|
+
const matchedAttributes = [];
|
|
312
|
+
const openAttributes = [];
|
|
313
|
+
const attributeChannel = (expected) => ({ ...(expected.bag ? { bag: true } : {}),
|
|
314
|
+
...(expected.bag && expected.declaration.name.namespace && (record.attributeWildcard
|
|
315
|
+
|| record.attributes.some(other => other !== expected && other.declaration.name.local === expected.declaration.name.local)) ? { namespaceChoice: true } : {}) });
|
|
316
|
+
if (!record.attributes.length && !record.attributeWildcard)
|
|
317
|
+
attributes(node, declaration, parentPath);
|
|
318
|
+
else {
|
|
319
|
+
const present = new Set();
|
|
320
|
+
for (let index = 0; index < node.attributes.length; index++) {
|
|
321
|
+
check();
|
|
322
|
+
const attribute = node.attributes[index];
|
|
323
|
+
const path = `${parentPath}/attributes/${index}`;
|
|
324
|
+
let expected = record.attributes.find(item => { check(); return same(item.declaration.name, attribute.name); });
|
|
325
|
+
let dynamic = false;
|
|
326
|
+
if (!expected) {
|
|
327
|
+
const selected = selectProjectionAttribute(context, record, attribute.name, check, unsupported);
|
|
328
|
+
if (!selected)
|
|
329
|
+
return mismatch('unknown-attribute', declaration, path);
|
|
330
|
+
if (!selected.attribute) {
|
|
331
|
+
if (!isXmlNCName(attribute.name.local) || attribute.name.local === 'xmlns' && attribute.name.namespace === ''
|
|
332
|
+
|| attribute.name.namespace === 'http://www.w3.org/2000/xmlns/' || !isXmlCharacters(attribute.name.namespace))
|
|
333
|
+
return mismatch('attribute-name', declaration, path);
|
|
334
|
+
if (!isXmlCharacters(attribute.value))
|
|
335
|
+
return mismatch('xml-characters', declaration, path);
|
|
336
|
+
const key = JSON.stringify([attribute.name.namespace, attribute.name.local]);
|
|
337
|
+
if (present.has(key))
|
|
338
|
+
return mismatch('duplicate-attribute', declaration, path);
|
|
339
|
+
present.add(key);
|
|
340
|
+
openAttributes.push(attribute);
|
|
341
|
+
continue;
|
|
342
|
+
}
|
|
343
|
+
expected = selected.attribute;
|
|
344
|
+
dynamic = true;
|
|
345
|
+
}
|
|
346
|
+
if (present.has(expected.declaration.id))
|
|
347
|
+
return mismatch('duplicate-attribute', declaration, path);
|
|
348
|
+
budget.chargeWork(128 + expected.declaration.id.length);
|
|
349
|
+
present.add(expected.declaration.id);
|
|
350
|
+
matchedAttributes.push({ declaration: expected.declaration, operand: occurrences.length, payloadPath: path, origin: 'present',
|
|
351
|
+
...(dynamic ? { bag: true, ...(attribute.name.namespace ? { namespaceChoice: true } : {}) } : attributeChannel(expected)) });
|
|
352
|
+
operand(node, expected.declaration, expected.builtin, attribute.value, path, expected.constraint?.kind === 'fixed' ? expected.constraint.canonical : undefined, expected.retainLexical, expected.list);
|
|
353
|
+
}
|
|
354
|
+
for (const expected of record.attributes) {
|
|
355
|
+
check();
|
|
356
|
+
if (expected.required && !present.has(expected.declaration.id))
|
|
357
|
+
return mismatch('missing-required-attribute', declaration, parentPath);
|
|
358
|
+
if (!present.has(expected.declaration.id) && expected.constraint) {
|
|
359
|
+
budget.chargeWork(128 + expected.declaration.id.length * 4);
|
|
360
|
+
const path = `${parentPath}/@schema-${expected.constraint.kind}/${encodeURIComponent(expected.declaration.id)}`;
|
|
361
|
+
matchedAttributes.push({ declaration: expected.declaration, operand: occurrences.length, payloadPath: path,
|
|
362
|
+
...attributeChannel(expected),
|
|
363
|
+
origin: expected.constraint.kind === 'fixed' ? 'schema-fixed' : 'schema-default' });
|
|
364
|
+
operand(node, expected.declaration, expected.builtin, expected.constraint.lexical, path, expected.constraint.kind === 'fixed' ? expected.constraint.canonical : undefined, expected.retainLexical, expected.list);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
if (nil) {
|
|
369
|
+
frame.into.push({ kind: 'record', nil: true, declaration, payloadPath: parentPath, slots: [], attributes: matchedAttributes,
|
|
370
|
+
openAttributes,
|
|
371
|
+
...(record.contextual ? { namespaces: node.namespaces } : {}) });
|
|
372
|
+
continue;
|
|
373
|
+
}
|
|
374
|
+
if (record.content === 'simple') {
|
|
375
|
+
if (!record.text)
|
|
376
|
+
throw new TypeError('Missing native simple content plan');
|
|
377
|
+
const path = `${parentPath}/text`, index = occurrences.length;
|
|
378
|
+
elementOperand(node, declaration, record.text.builtin, path, frame.value, record.text.retainLexical, record.text.list);
|
|
379
|
+
frame.into.push({ kind: 'record', declaration, payloadPath: parentPath, slots: [], attributes: matchedAttributes,
|
|
380
|
+
openAttributes, ...(record.contextual ? { namespaces: node.namespaces } : {}),
|
|
381
|
+
text: { kind: 'scalar', declaration, payloadPath: path, operand: index } });
|
|
382
|
+
continue;
|
|
383
|
+
}
|
|
384
|
+
const slots = record.slots;
|
|
385
|
+
if (record.ordered) {
|
|
386
|
+
const elements = [];
|
|
387
|
+
for (let index = 0; index < node.children.length; index++) {
|
|
388
|
+
check();
|
|
389
|
+
const child = node.children[index], path = `${parentPath}/children/${index}`;
|
|
390
|
+
budget.chargeWork(64);
|
|
391
|
+
if (child.kind === 'text') {
|
|
392
|
+
budget.chargeWork(child.value.length * 2);
|
|
393
|
+
if (record.content !== 'mixed' && /[^\t\r\n ]/.test(child.value))
|
|
394
|
+
return mismatch('complex-text', declaration, path);
|
|
395
|
+
}
|
|
396
|
+
else
|
|
397
|
+
elements.push({ node: child, path });
|
|
398
|
+
}
|
|
399
|
+
const selected = matchOrderedProjection(context, record, elements.map(item => { check(); return item.node.name; }), check);
|
|
400
|
+
if (!selected)
|
|
401
|
+
return mismatch('ordered-particle-language', declaration, parentPath);
|
|
402
|
+
const content = [];
|
|
403
|
+
frame.into.push({ kind: 'record', declaration, payloadPath: parentPath, slots: [], attributes: matchedAttributes, content,
|
|
404
|
+
openAttributes,
|
|
405
|
+
...(record.contextual ? { namespaces: node.namespaces } : {}),
|
|
406
|
+
namespaceChoices: slots.filter(slot => !record.fixedOrder && slots.some(other => other !== slot && other.element.name.local === slot.element.name.local)).map(slot => slot.element.name.local),
|
|
407
|
+
dynamicDeclarations: selected.filter(slot => !('value' in slot) && slot.element).map(slot => slot.element),
|
|
408
|
+
...(record.keyed ? { keyed: true } : {}) });
|
|
409
|
+
let selectedIndex = elements.length - 1;
|
|
410
|
+
for (let index = node.children.length - 1; index >= 0; index--) {
|
|
411
|
+
check();
|
|
412
|
+
const child = node.children[index];
|
|
413
|
+
if (child.kind === 'text') {
|
|
414
|
+
if (record.content === 'mixed')
|
|
415
|
+
frames.push({ node: child, path: `${parentPath}/children/${index}`, declaration, value: frame.value, into: content });
|
|
416
|
+
continue;
|
|
417
|
+
}
|
|
418
|
+
const item = elements[selectedIndex], slot = selected[selectedIndex--];
|
|
419
|
+
if (!slot.element) {
|
|
420
|
+
frames.push({ node: item.node, path: item.path, declaration, value: frame.value, unassessed: true, into: content });
|
|
421
|
+
continue;
|
|
422
|
+
}
|
|
423
|
+
frames.push({ node: item.node, path: item.path, declaration: slot.element,
|
|
424
|
+
value: 'value' in slot ? slot.value : wildcardValue(slot.element), into: content });
|
|
425
|
+
}
|
|
426
|
+
continue;
|
|
427
|
+
}
|
|
428
|
+
budget.chargeWork(64 + slots.length * 128);
|
|
429
|
+
const matchedSlots = slots.map(slot => { check(); return { slot, items: [] }; });
|
|
430
|
+
frame.into.push({ kind: 'record', declaration, payloadPath: parentPath, slots: matchedSlots, attributes: matchedAttributes,
|
|
431
|
+
openAttributes,
|
|
432
|
+
...(record.contextual ? { namespaces: node.namespaces } : {}) });
|
|
433
|
+
const children = [];
|
|
197
434
|
let cursor = 0, count = 0;
|
|
198
|
-
for (let index = 0; index <
|
|
435
|
+
for (let index = 0; index < node.children.length; index++) {
|
|
199
436
|
check();
|
|
200
|
-
const child =
|
|
437
|
+
const child = node.children[index];
|
|
201
438
|
budget.chargeWork(64);
|
|
202
|
-
const path =
|
|
439
|
+
const path = `${parentPath}/children/${index}`;
|
|
203
440
|
if (child.kind === 'text') {
|
|
204
441
|
budget.chargeWork(child.value.length * 2);
|
|
205
442
|
if (/[^\t\r\n ]/.test(child.value))
|
|
206
|
-
return mismatch('complex-text',
|
|
443
|
+
return mismatch('complex-text', declaration, path);
|
|
207
444
|
continue;
|
|
208
445
|
}
|
|
209
446
|
while (cursor < slots.length && !same(child.name, slots[cursor].element.name)) {
|
|
@@ -216,27 +453,85 @@ export function matchDirectOperation(contract, direction, payload, options = {})
|
|
|
216
453
|
}
|
|
217
454
|
const slot = slots[cursor];
|
|
218
455
|
if (!slot)
|
|
219
|
-
return mismatch('unexpected-child',
|
|
456
|
+
return mismatch('unexpected-child', declaration, path);
|
|
220
457
|
if (slot.particle.occurs.max === '1' && count === 1)
|
|
221
458
|
return mismatch('duplicate-singleton', slot.element, path);
|
|
222
|
-
|
|
459
|
+
children.push({ node: child, declaration: slot.element, value: slot.value, path, into: matchedSlots[cursor].items });
|
|
223
460
|
count++;
|
|
224
461
|
}
|
|
225
462
|
for (; cursor < slots.length; cursor++, count = 0) {
|
|
226
463
|
check();
|
|
227
464
|
const slot = slots[cursor];
|
|
228
465
|
if (slot.particle.occurs.min === '1' && count === 0)
|
|
229
|
-
return mismatch('missing-required', slot.element,
|
|
466
|
+
return mismatch('missing-required', slot.element, `${parentPath}/end`);
|
|
467
|
+
}
|
|
468
|
+
// @why Preserve document order and record boundaries without recursive JS calls.
|
|
469
|
+
for (let i = children.length - 1; i >= 0; i--) {
|
|
470
|
+
check();
|
|
471
|
+
frames.push(children[i]);
|
|
230
472
|
}
|
|
231
473
|
}
|
|
232
474
|
check();
|
|
233
475
|
budget.chargeWork(512);
|
|
234
|
-
const result = { kind: '
|
|
235
|
-
root, contextId: context.contextId,
|
|
476
|
+
const result = { kind: 'projection-match', scope: 'structure-only', scalarValidity: 'unassessed', admitted: false,
|
|
477
|
+
root, contextId: context.contextId, tree: roots[0], occurrences, usage: { ...budget.usage() } };
|
|
236
478
|
budget.freeze(result);
|
|
237
479
|
check();
|
|
238
480
|
// Capture final accounting after publication traversal; the record is already reserved.
|
|
239
481
|
const published = Object.freeze({ ...result, usage: Object.freeze({ ...budget.usage() }) });
|
|
482
|
+
projectionIssued.set(published, context);
|
|
483
|
+
return published;
|
|
484
|
+
});
|
|
485
|
+
return guarded.kind === 'resource-limit' ? Object.freeze({ kind: 'resource-limit', rule: 'request-budget', usage: budget.usage() }) : guarded;
|
|
486
|
+
}
|
|
487
|
+
catch (error) {
|
|
488
|
+
if (budget.exhausted())
|
|
489
|
+
return Object.freeze({ kind: 'resource-limit', rule: 'request-budget', usage: budget.usage() });
|
|
490
|
+
if (error instanceof Stop)
|
|
491
|
+
return Object.freeze({ kind: error.kind, rule: error.rule, schemaPath: error.schemaPath, payloadPath: error.payloadPath, usage: Object.freeze({ ...budget.usage() }) });
|
|
492
|
+
throw error;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
/** Operation-owned flat preview wrapper; structured projection matches cannot bypass this gate. */
|
|
496
|
+
export function matchDirectOperation(contract, direction, payload, options = {}) {
|
|
497
|
+
const { context } = inspectDirectOperation(contract);
|
|
498
|
+
const { budget } = context;
|
|
499
|
+
try {
|
|
500
|
+
const guarded = budget.guard(() => {
|
|
501
|
+
const supplied = budget.snapshot(direction);
|
|
502
|
+
if (!supplied || typeof supplied !== 'object' || Array.isArray(supplied))
|
|
503
|
+
throw new TypeError('Direct direction requires a data-only record');
|
|
504
|
+
if (!['input', 'output', 'fault'].includes(supplied.kind))
|
|
505
|
+
throw new Stop('unsupported', 'unknown-direction');
|
|
506
|
+
const ownedDirection = supplied.kind === 'fault' ? { kind: 'fault', name: supplied.name } : { kind: supplied.kind };
|
|
507
|
+
let root;
|
|
508
|
+
if (ownedDirection.kind === 'fault') {
|
|
509
|
+
budget.chargeWork(64 + contract.faults.length * 32);
|
|
510
|
+
if (typeof ownedDirection.name !== 'string')
|
|
511
|
+
throw new Stop('unsupported', 'unknown-fault');
|
|
512
|
+
const selected = contract.faults.find(fault => budget.compareText(fault.name, ownedDirection.name) === 0);
|
|
513
|
+
if (!selected)
|
|
514
|
+
throw new Stop('unsupported', 'unknown-fault');
|
|
515
|
+
root = selected.root;
|
|
516
|
+
}
|
|
517
|
+
else {
|
|
518
|
+
const selected = contract[ownedDirection.kind];
|
|
519
|
+
if ('parts' in selected)
|
|
520
|
+
throw new Stop('unsupported', 'direct-document-root-required');
|
|
521
|
+
root = selected;
|
|
522
|
+
}
|
|
523
|
+
const matched = matchDirectProjection(context, root.element, payload, { ...options, flatOnly: true });
|
|
524
|
+
if (matched.kind !== 'projection-match')
|
|
525
|
+
return matched;
|
|
526
|
+
inspectProjectionStructuralMatch(matched, context);
|
|
527
|
+
budget.chargeWork(512);
|
|
528
|
+
const result = { kind: 'structural-match', scope: matched.scope, scalarValidity: matched.scalarValidity, admitted: false,
|
|
529
|
+
root, contextId: context.contextId, direction: ownedDirection, occurrences: matched.occurrences, tree: matched.tree, usage: { ...budget.usage() } };
|
|
530
|
+
budget.freeze(result);
|
|
531
|
+
budget.chargeWork();
|
|
532
|
+
if (options.signal?.aborted)
|
|
533
|
+
throw new Stop('cancelled', 'cooperative-cancellation');
|
|
534
|
+
const published = Object.freeze({ ...result, usage: Object.freeze({ ...budget.usage() }) });
|
|
240
535
|
issued.set(published, contract);
|
|
241
536
|
return published;
|
|
242
537
|
});
|