@techspokes/typescript-wsdl-client 1.1.4 → 1.1.8
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 +81 -35
- package/dist/app/generateApp.d.ts +0 -1
- package/dist/app/generateApp.js +8 -6
- 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 +245 -0
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +123 -5
- package/dist/client/checkedDirectRuntime.d.ts +96 -0
- package/dist/client/checkedDirectRuntime.js +43 -0
- package/dist/client/directClientRuntime.d.ts +74 -0
- package/dist/client/directClientRuntime.js +165 -0
- package/dist/client/directClientVersion.d.ts +6 -0
- package/dist/client/directClientVersion.js +6 -0
- package/dist/client/generateClient.d.ts +0 -1
- package/dist/client/generateClient.js +26 -12
- package/dist/client/generateDirectClient.d.ts +32 -0
- package/dist/client/generateDirectClient.js +268 -0
- package/dist/client/generateOperations.d.ts +0 -1
- package/dist/client/generateTypes.d.ts +0 -1
- package/dist/client/generateUtils.d.ts +0 -1
- package/dist/client/generateUtils.js +3 -1
- package/dist/compiler/applicationGroups.d.ts +53 -0
- package/dist/compiler/applicationGroups.js +403 -0
- package/dist/compiler/buildCanonicalGraph.d.ts +6 -0
- package/dist/compiler/buildCanonicalGraph.js +381 -0
- package/dist/compiler/canonicalGraph.d.ts +197 -0
- package/dist/compiler/canonicalGraph.js +37 -0
- package/dist/compiler/catalogErrors.d.ts +17 -0
- package/dist/compiler/catalogErrors.js +86 -0
- package/dist/compiler/catalogProvenance.d.ts +14 -0
- package/dist/compiler/catalogProvenance.js +229 -0
- package/dist/compiler/checkedAssessment.d.ts +90 -0
- package/dist/compiler/checkedAssessment.js +300 -0
- package/dist/compiler/checkedComponentSource.d.ts +16 -0
- package/dist/compiler/checkedComponentSource.js +31 -0
- package/dist/compiler/checkedSourcePreparation.d.ts +72 -0
- package/dist/compiler/checkedSourcePreparation.js +202 -0
- package/dist/compiler/complexTypeContent.d.ts +58 -0
- package/dist/compiler/complexTypeContent.js +558 -0
- package/dist/compiler/componentCorrespondence.d.ts +32 -0
- package/dist/compiler/componentCorrespondence.js +140 -0
- package/dist/compiler/componentRecordProjection.d.ts +109 -0
- package/dist/compiler/componentRecordProjection.js +319 -0
- package/dist/compiler/componentSoapPreparation.d.ts +20 -0
- package/dist/compiler/componentSoapPreparation.js +36 -0
- package/dist/compiler/composeCanonicalGraph.d.ts +68 -0
- package/dist/compiler/composeCanonicalGraph.js +252 -0
- package/dist/compiler/dataOwnership.d.ts +21 -0
- package/dist/compiler/dataOwnership.js +167 -0
- package/dist/compiler/datatypeValues.d.ts +46 -0
- package/dist/compiler/datatypeValues.js +275 -0
- package/dist/compiler/directCodec.d.ts +116 -0
- package/dist/compiler/directCodec.js +377 -0
- package/dist/compiler/directExecutionPolicy.d.ts +9 -0
- package/dist/compiler/directExecutionPolicy.js +17 -0
- package/dist/compiler/directOperation.d.ts +114 -0
- package/dist/compiler/directOperation.js +373 -0
- package/dist/compiler/directSoap.d.ts +66 -0
- package/dist/compiler/directSoap.js +391 -0
- package/dist/compiler/directSoapSource.d.ts +38 -0
- package/dist/compiler/directSoapSource.js +233 -0
- package/dist/compiler/directSourceCapsule.d.ts +169 -0
- package/dist/compiler/directSourceCapsule.js +727 -0
- package/dist/compiler/directStructure.d.ts +128 -0
- package/dist/compiler/directStructure.js +543 -0
- package/dist/compiler/directStructurePlan.d.ts +149 -0
- package/dist/compiler/directStructurePlan.js +623 -0
- package/dist/compiler/directValues.d.ts +128 -0
- package/dist/compiler/directValues.js +1116 -0
- package/dist/compiler/finiteRe01Construction.d.ts +69 -0
- package/dist/compiler/finiteRe01Construction.js +422 -0
- package/dist/compiler/finiteRe01Verification.d.ts +218 -0
- package/dist/compiler/finiteRe01Verification.js +1217 -0
- package/dist/compiler/generateCatalog.d.ts +0 -1
- package/dist/compiler/graphTraversal.d.ts +10 -0
- package/dist/compiler/graphTraversal.js +37 -0
- package/dist/compiler/hypotheticalScopedIdentity.d.ts +22 -0
- package/dist/compiler/hypotheticalScopedIdentity.js +81 -0
- package/dist/compiler/occurrenceAnalysis.d.ts +66 -0
- package/dist/compiler/occurrenceAnalysis.js +316 -0
- package/dist/compiler/originalSourceMembership.d.ts +5 -0
- package/dist/compiler/originalSourceMembership.js +31 -0
- package/dist/compiler/particleAttribution.d.ts +16 -0
- package/dist/compiler/particleAttribution.js +494 -0
- package/dist/compiler/particleDeclarationConsistency.d.ts +23 -0
- package/dist/compiler/particleDeclarationConsistency.js +206 -0
- package/dist/compiler/particleExtension.d.ts +21 -0
- package/dist/compiler/particleExtension.js +123 -0
- package/dist/compiler/particleLocalAssessment.d.ts +19 -0
- package/dist/compiler/particleLocalAssessment.js +92 -0
- package/dist/compiler/particleRestriction.d.ts +23 -0
- package/dist/compiler/particleRestriction.js +494 -0
- package/dist/compiler/particleSemanticView.d.ts +51 -0
- package/dist/compiler/particleSemanticView.js +310 -0
- package/dist/compiler/particleWildcardRelation.d.ts +87 -0
- package/dist/compiler/particleWildcardRelation.js +143 -0
- package/dist/compiler/projectionScalar.d.ts +32 -0
- package/dist/compiler/projectionScalar.js +184 -0
- package/dist/compiler/re01CandidateAssignments.d.ts +95 -0
- package/dist/compiler/re01CandidateAssignments.js +341 -0
- package/dist/compiler/re01CandidateCorrespondence.d.ts +85 -0
- package/dist/compiler/re01CandidateCorrespondence.js +701 -0
- package/dist/compiler/re01TypeProperties.d.ts +70 -0
- package/dist/compiler/re01TypeProperties.js +120 -0
- package/dist/compiler/re01TypePropertyValidation.d.ts +22 -0
- package/dist/compiler/re01TypePropertyValidation.js +161 -0
- package/dist/compiler/resolveCanonicalGraph.d.ts +41 -0
- package/dist/compiler/resolveCanonicalGraph.js +240 -0
- package/dist/compiler/scalarSchemaAssessment.d.ts +424 -0
- package/dist/compiler/scalarSchemaAssessment.js +5198 -0
- package/dist/compiler/schemaAttributeGroupProperties.d.ts +16 -0
- package/dist/compiler/schemaAttributeGroupProperties.js +53 -0
- package/dist/compiler/schemaAttributeProperties.d.ts +9 -0
- package/dist/compiler/schemaAttributeProperties.js +11 -0
- package/dist/compiler/schemaAttributeUses.d.ts +110 -0
- package/dist/compiler/schemaAttributeUses.js +798 -0
- package/dist/compiler/schemaBinaryWordReconstruction.d.ts +9 -0
- package/dist/compiler/schemaBinaryWordReconstruction.js +33 -0
- package/dist/compiler/schemaBuiltinFacets.d.ts +13 -0
- package/dist/compiler/schemaBuiltinFacets.js +51 -0
- package/dist/compiler/schemaCalendarImages.d.ts +7 -0
- package/dist/compiler/schemaCalendarImages.js +204 -0
- package/dist/compiler/schemaCalendarLanguage.d.ts +10 -0
- package/dist/compiler/schemaCalendarLanguage.js +227 -0
- package/dist/compiler/schemaCompiler.d.ts +0 -1
- package/dist/compiler/schemaComponentEquality.d.ts +27 -0
- package/dist/compiler/schemaComponentEquality.js +446 -0
- package/dist/compiler/schemaConstructionAssessment.d.ts +79 -0
- package/dist/compiler/schemaConstructionAssessment.js +745 -0
- package/dist/compiler/schemaDatatypeValues.d.ts +3 -0
- package/dist/compiler/schemaDatatypeValues.js +2 -0
- package/dist/compiler/schemaDecimalLanguage.d.ts +6 -0
- package/dist/compiler/schemaDecimalLanguage.js +102 -0
- package/dist/compiler/schemaDeclarationPrimitives.d.ts +39 -0
- package/dist/compiler/schemaDeclarationPrimitives.js +211 -0
- package/dist/compiler/schemaDocumentSyntax.d.ts +54 -0
- package/dist/compiler/schemaDocumentSyntax.js +294 -0
- package/dist/compiler/schemaDurationLanguage.d.ts +10 -0
- package/dist/compiler/schemaDurationLanguage.js +170 -0
- package/dist/compiler/schemaElementInstance.d.ts +30 -0
- package/dist/compiler/schemaElementInstance.js +45 -0
- package/dist/compiler/schemaElementProperties.d.ts +15 -0
- package/dist/compiler/schemaElementProperties.js +23 -0
- package/dist/compiler/schemaEndpointWordCapacity.d.ts +35 -0
- package/dist/compiler/schemaEndpointWordCapacity.js +39 -0
- package/dist/compiler/schemaExactCalendar.d.ts +72 -0
- package/dist/compiler/schemaExactCalendar.js +264 -0
- package/dist/compiler/schemaFacetAnnotation.d.ts +31 -0
- package/dist/compiler/schemaFacetAnnotation.js +199 -0
- package/dist/compiler/schemaGeneratedScalarShape.d.ts +34 -0
- package/dist/compiler/schemaGeneratedScalarShape.js +178 -0
- package/dist/compiler/schemaIdentityConstraints.d.ts +72 -0
- package/dist/compiler/schemaIdentityConstraints.js +362 -0
- package/dist/compiler/schemaIeeeLanguage.d.ts +42 -0
- package/dist/compiler/schemaIeeeLanguage.js +759 -0
- package/dist/compiler/schemaIntegerImages.d.ts +10 -0
- package/dist/compiler/schemaIntegerImages.js +113 -0
- package/dist/compiler/schemaLexicalPredicates.d.ts +28 -0
- package/dist/compiler/schemaLexicalPredicates.js +63 -0
- package/dist/compiler/schemaNotationProperties.d.ts +31 -0
- package/dist/compiler/schemaNotationProperties.js +84 -0
- package/dist/compiler/schemaNumericImageConditions.d.ts +23 -0
- package/dist/compiler/schemaNumericImageConditions.js +66 -0
- package/dist/compiler/schemaParticleWildcardProperties.d.ts +19 -0
- package/dist/compiler/schemaParticleWildcardProperties.js +43 -0
- package/dist/compiler/schemaPattern.d.ts +1061 -0
- package/dist/compiler/schemaPattern.js +581 -0
- package/dist/compiler/schemaRegularLanguage.d.ts +66 -0
- package/dist/compiler/schemaRegularLanguage.js +1166 -0
- package/dist/compiler/schemaScalarContext.d.ts +85 -0
- package/dist/compiler/schemaScalarContext.js +78 -0
- package/dist/compiler/schemaScalarKernel.d.ts +181 -0
- package/dist/compiler/schemaScalarKernel.js +391 -0
- package/dist/compiler/schemaScalarWitnesses.d.ts +5 -0
- package/dist/compiler/schemaScalarWitnesses.js +118 -0
- package/dist/compiler/schemaSimpleTypeProperties.d.ts +94 -0
- package/dist/compiler/schemaSimpleTypeProperties.js +103 -0
- package/dist/compiler/schemaSourceGrammar.d.ts +26 -0
- package/dist/compiler/schemaSourceGrammar.js +290 -0
- package/dist/compiler/schemaSourceLexical.d.ts +3 -0
- package/dist/compiler/schemaSourceLexical.js +12 -0
- package/dist/compiler/schemaSourceValues.d.ts +50 -0
- package/dist/compiler/schemaSourceValues.js +225 -0
- package/dist/compiler/schemaSourceWildcards.d.ts +27 -0
- package/dist/compiler/schemaSourceWildcards.js +249 -0
- package/dist/compiler/schemaSymbolicSequences.d.ts +15 -0
- package/dist/compiler/schemaSymbolicSequences.js +99 -0
- package/dist/compiler/schemaSymbolicValueSets.d.ts +31 -0
- package/dist/compiler/schemaSymbolicValueSets.js +149 -0
- package/dist/compiler/schemaSyntaxAssessment.d.ts +24 -0
- package/dist/compiler/schemaSyntaxAssessment.js +361 -0
- package/dist/compiler/schemaTemporalAliases.d.ts +5 -0
- package/dist/compiler/schemaTemporalAliases.js +195 -0
- package/dist/compiler/schemaTokenImages.d.ts +8 -0
- package/dist/compiler/schemaTokenImages.js +142 -0
- package/dist/compiler/schemaTypeIdentity.d.ts +38 -0
- package/dist/compiler/schemaTypeIdentity.js +80 -0
- package/dist/compiler/schemaTypeRelations.d.ts +37 -0
- package/dist/compiler/schemaTypeRelations.js +576 -0
- package/dist/compiler/schemaUri.d.ts +12 -0
- package/dist/compiler/schemaUri.js +103 -0
- package/dist/compiler/schemaValueContext.d.ts +25 -0
- package/dist/compiler/schemaValueContext.js +1 -0
- package/dist/compiler/schemaValueImages.d.ts +9 -0
- package/dist/compiler/schemaValueImages.js +142 -0
- package/dist/compiler/schemaValueSequences.d.ts +14 -0
- package/dist/compiler/schemaValueSequences.js +19 -0
- package/dist/compiler/semanticBudget.d.ts +67 -0
- package/dist/compiler/semanticBudget.js +193 -0
- package/dist/compiler/semanticCatalog.d.ts +121 -0
- package/dist/compiler/semanticCatalog.js +160 -0
- package/dist/compiler/semanticContext.d.ts +183 -0
- package/dist/compiler/semanticContext.js +1207 -0
- package/dist/compiler/semanticTypeDependencies.d.ts +7 -0
- package/dist/compiler/semanticTypeDependencies.js +64 -0
- package/dist/compiler/semanticTypeReference.d.ts +23 -0
- package/dist/compiler/semanticTypeReference.js +36 -0
- package/dist/compiler/shapeResolver.d.ts +1 -1
- package/dist/compiler/shapeResolver.js +7 -9
- package/dist/compiler/soapHeaders.d.ts +16 -0
- package/dist/compiler/soapHeaders.js +42 -0
- package/dist/compiler/sourceSchemaBinding.d.ts +25 -0
- package/dist/compiler/sourceSchemaBinding.js +39 -0
- 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 +15 -0
- package/dist/compiler/structuralCompanions.js +232 -0
- package/dist/compiler/validateSemanticGraph.d.ts +4 -0
- package/dist/compiler/validateSemanticGraph.js +376 -0
- package/dist/compiler/wildcardAlgebra.d.ts +25 -0
- package/dist/compiler/wildcardAlgebra.js +155 -0
- 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/generateGateway.d.ts +0 -1
- package/dist/gateway/generateGateway.js +2 -2
- package/dist/gateway/generators.d.ts +0 -1
- package/dist/gateway/helpers.d.ts +0 -1
- package/dist/generation/componentShape.d.ts +14 -0
- package/dist/generation/componentShape.js +269 -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 +9 -1
- package/dist/index.js +3 -0
- package/dist/loader/fetch.d.ts +0 -1
- package/dist/loader/orderedSyntax.d.ts +84 -0
- package/dist/loader/orderedSyntax.js +222 -0
- package/dist/loader/resolutionDepth.d.ts +6 -0
- package/dist/loader/resolutionDepth.js +65 -0
- package/dist/loader/schemaInput.d.ts +80 -0
- package/dist/loader/schemaInput.js +249 -0
- package/dist/loader/schemaResources.d.ts +60 -0
- package/dist/loader/schemaResources.js +333 -0
- package/dist/loader/wsdlLoader.d.ts +0 -1
- package/dist/openapi/casing.d.ts +0 -1
- package/dist/openapi/generateOpenAPI.d.ts +0 -1
- package/dist/openapi/generateOpenAPI.js +2 -2
- 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 +6 -2
- package/dist/pipeline.js +13 -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/generateTests.js +2 -2
- 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 +2 -0
- package/dist/util/xmlWhitespace.js +4 -0
- package/dist/xsd/primitives.d.ts +0 -1
- package/docs/agent-skill.md +2 -0
- package/docs/api-reference.md +1 -1
- package/docs/checked-gateway.md +210 -0
- package/docs/checked-generation.md +161 -0
- package/docs/cli-reference.md +43 -1
- package/docs/concepts.md +136 -1
- package/docs/configuration.md +5 -1
- package/docs/corpus.md +33 -0
- package/docs/direct-values.md +311 -0
- package/docs/examples/checked-forecast.wsdl +19 -0
- package/docs/gateway-guide.md +1 -1
- package/docs/generated-code.md +10 -5
- package/docs/mapping-contract.md +114 -0
- package/docs/migration-playbook.md +1 -1
- package/docs/output-anatomy.md +1 -1
- package/docs/start-here.md +8 -2
- package/docs/supported-patterns.md +17 -5
- package/docs/testing.md +117 -31
- package/llms.txt +7 -7
- package/package.json +79 -25
- package/src/generation/preambles/direct-client/typescript.preamble +3 -0
- package/src/runtime/checkedGatewayHost.tpl.txt +157 -0
- package/src/runtime/streamXml.ts +1 -1
- package/dist/app/generateApp.d.ts.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/client/generateClient.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/generateCatalog.d.ts.map +0 -1
- package/dist/compiler/schemaCompiler.d.ts.map +0 -1
- package/dist/compiler/shapeResolver.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/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/xsd/primitives.d.ts.map +0 -1
- package/docs/AGENTS.md +0 -47
- package/docs/README.md +0 -56
- package/docs/architecture.md +0 -149
- package/docs/decisions/001-test-generation.md +0 -36
- package/docs/decisions/002-streamable-responses.md +0 -330
- package/docs/file-naming-and-path-organization.md +0 -213
- 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/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
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/** Explicit XSD type properties, separate from canonical XML source contributions. */
|
|
2
|
+
import type { NodeId, Reference } from './canonicalGraph.js';
|
|
3
|
+
import type { NamespaceConstraint, WildcardProcess } from './wildcardAlgebra.js';
|
|
4
|
+
import type { SemanticBudget } from './semanticBudget.js';
|
|
5
|
+
import type { SemanticTypeReference } from './semanticTypeReference.js';
|
|
6
|
+
export declare const RE01_DERIVATION_DOMAIN: "RE01-derivation-B-v1";
|
|
7
|
+
export type ComplexDerivationMethod = 'extension' | 'restriction';
|
|
8
|
+
declare const originalParticleAuthority: unique symbol;
|
|
9
|
+
/** Opaque selection of an actual source-mapped particle, never a validity receipt. */
|
|
10
|
+
export type OriginalComplexParticleHandle = Readonly<{
|
|
11
|
+
owner: NodeId;
|
|
12
|
+
particle: NodeId;
|
|
13
|
+
[originalParticleAuthority]: true;
|
|
14
|
+
}>;
|
|
15
|
+
declare const originalUrWildcardAuthority: unique symbol;
|
|
16
|
+
/** Unchanged actual-source native UR leaf, never a caller-supplied origin flag. */
|
|
17
|
+
export type OriginalUrWildcardHandle = Readonly<{
|
|
18
|
+
owner: NodeId;
|
|
19
|
+
particle: NodeId;
|
|
20
|
+
[originalUrWildcardAuthority]: true;
|
|
21
|
+
}>;
|
|
22
|
+
export type RawComplexContent = Readonly<{
|
|
23
|
+
kind: 'empty';
|
|
24
|
+
} | {
|
|
25
|
+
kind: 'simple';
|
|
26
|
+
type: SemanticTypeReference;
|
|
27
|
+
} | {
|
|
28
|
+
kind: 'mixed' | 'element-only';
|
|
29
|
+
particle: NodeId;
|
|
30
|
+
original?: OriginalComplexParticleHandle;
|
|
31
|
+
} | {
|
|
32
|
+
kind: 'opaque-builtin';
|
|
33
|
+
type: Reference;
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* This is supplied data, not a checked semantic receipt. In particular the
|
|
37
|
+
* actual-mapped label does not authenticate effective-property computation.
|
|
38
|
+
* The aggregate owner must compare with privately issued actual owner evidence.
|
|
39
|
+
*/
|
|
40
|
+
export type RawComplexTypeProperties = Readonly<{
|
|
41
|
+
type: NodeId;
|
|
42
|
+
/** Explicit semantic namespace for anonymous helpers; empty means absent.
|
|
43
|
+
* Omission supplies no namespace fact for a fresh scoped helper. */
|
|
44
|
+
targetNamespace?: string;
|
|
45
|
+
derivation: Readonly<{
|
|
46
|
+
base: SemanticTypeReference;
|
|
47
|
+
method: ComplexDerivationMethod;
|
|
48
|
+
}>;
|
|
49
|
+
abstract: boolean;
|
|
50
|
+
final: readonly ComplexDerivationMethod[];
|
|
51
|
+
block: readonly ComplexDerivationMethod[];
|
|
52
|
+
content: RawComplexContent;
|
|
53
|
+
/** Complete effective AU identities, including inherited uses; never a QName map. */
|
|
54
|
+
attributeUses: readonly NodeId[];
|
|
55
|
+
wildcard?: Readonly<{
|
|
56
|
+
namespace: NamespaceConstraint;
|
|
57
|
+
processContents: WildcardProcess;
|
|
58
|
+
sources: readonly NodeId[];
|
|
59
|
+
}>;
|
|
60
|
+
provenance: Readonly<{
|
|
61
|
+
kind: 'actual-mapped';
|
|
62
|
+
original: NodeId;
|
|
63
|
+
} | {
|
|
64
|
+
kind: 'hypothetical-abstract';
|
|
65
|
+
originals: readonly NodeId[];
|
|
66
|
+
}>;
|
|
67
|
+
}>;
|
|
68
|
+
/** Runtime data-shape boundary, shared by preparation and property consumers. */
|
|
69
|
+
export declare function assertRawComplexTypeShape(value: unknown, budget: SemanticBudget): asserts value is RawComplexTypeProperties;
|
|
70
|
+
export {};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { assertSemanticTypeReferenceShape } from './semanticTypeReference.js';
|
|
2
|
+
export const RE01_DERIVATION_DOMAIN = 'RE01-derivation-B-v1';
|
|
3
|
+
/** Runtime data-shape boundary, shared by preparation and property consumers. */
|
|
4
|
+
export function assertRawComplexTypeShape(value, budget) {
|
|
5
|
+
const fail = () => { throw new TypeError('Invalid raw complex type properties'); };
|
|
6
|
+
const object = (v, fields) => {
|
|
7
|
+
budget.chargeWork(3);
|
|
8
|
+
if (!v || typeof v !== 'object' || Array.isArray(v))
|
|
9
|
+
return fail();
|
|
10
|
+
const prototype = Object.getPrototypeOf(v);
|
|
11
|
+
if (prototype !== Object.prototype && prototype !== null)
|
|
12
|
+
return fail();
|
|
13
|
+
for (const key of fields) {
|
|
14
|
+
budget.chargeWork(46 + key.length);
|
|
15
|
+
const field = Object.getOwnPropertyDescriptor(v, key);
|
|
16
|
+
if (field && !('value' in field))
|
|
17
|
+
return fail();
|
|
18
|
+
}
|
|
19
|
+
for (const key in v) {
|
|
20
|
+
budget.chargeWork(46 + key.length + fields.length);
|
|
21
|
+
const field = Object.getOwnPropertyDescriptor(v, key);
|
|
22
|
+
if (!field || !('value' in field) || !fields.includes(key))
|
|
23
|
+
return fail();
|
|
24
|
+
}
|
|
25
|
+
return v;
|
|
26
|
+
};
|
|
27
|
+
const id = (v) => { budget.chargeWork(); if (typeof v !== 'string' || !v)
|
|
28
|
+
fail(); };
|
|
29
|
+
const list = (v, item) => {
|
|
30
|
+
budget.chargeWork();
|
|
31
|
+
if (!Array.isArray(v))
|
|
32
|
+
return fail();
|
|
33
|
+
for (let index = 0; index < v.length; index++) {
|
|
34
|
+
budget.chargeWork(60);
|
|
35
|
+
const field = Object.getOwnPropertyDescriptor(v, index);
|
|
36
|
+
if (!field || !('value' in field))
|
|
37
|
+
return fail();
|
|
38
|
+
item(field.value);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const method = (v) => { budget.chargeWork(); if (v !== 'restriction' && v !== 'extension')
|
|
42
|
+
fail(); };
|
|
43
|
+
const reference = (v) => {
|
|
44
|
+
assertSemanticTypeReferenceShape(v, budget);
|
|
45
|
+
const kind = object(v, ['kind', 'owner', 'target', 'name', 'role', 'lexical']);
|
|
46
|
+
if (kind['kind'] === 'original-generated') {
|
|
47
|
+
id(kind['owner']);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const r = object(v, ['kind', 'target', 'name', 'role', 'lexical']);
|
|
51
|
+
if (r['kind'] === 'local') {
|
|
52
|
+
id(r['target']);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (r['kind'] !== 'symbol' && r['kind'] !== 'builtin')
|
|
56
|
+
return fail();
|
|
57
|
+
const name = object(r['name'], ['namespace', 'local']);
|
|
58
|
+
if (typeof name['namespace'] !== 'string')
|
|
59
|
+
return fail();
|
|
60
|
+
id(name['local']);
|
|
61
|
+
if (r['kind'] === 'symbol' && r['role'] !== 'type')
|
|
62
|
+
return fail();
|
|
63
|
+
if (r['target'] !== undefined)
|
|
64
|
+
id(r['target']);
|
|
65
|
+
};
|
|
66
|
+
const r = object(value, ['type', 'targetNamespace', 'derivation', 'abstract', 'final', 'block', 'content', 'attributeUses', 'wildcard', 'provenance']);
|
|
67
|
+
id(r['type']);
|
|
68
|
+
if (r['targetNamespace'] !== undefined && typeof r['targetNamespace'] !== 'string')
|
|
69
|
+
return fail();
|
|
70
|
+
const d = object(r['derivation'], ['base', 'method']);
|
|
71
|
+
method(d['method']);
|
|
72
|
+
reference(d['base']);
|
|
73
|
+
if (typeof r['abstract'] !== 'boolean')
|
|
74
|
+
return fail();
|
|
75
|
+
list(r['final'], method);
|
|
76
|
+
list(r['block'], method);
|
|
77
|
+
list(r['attributeUses'], id);
|
|
78
|
+
const content = object(r['content'], ['kind', 'type', 'particle', 'original']);
|
|
79
|
+
if (content['kind'] === 'simple' || content['kind'] === 'opaque-builtin') {
|
|
80
|
+
if ('particle' in content || 'original' in content)
|
|
81
|
+
return fail();
|
|
82
|
+
reference(content['type']);
|
|
83
|
+
}
|
|
84
|
+
else if (content['kind'] === 'mixed' || content['kind'] === 'element-only') {
|
|
85
|
+
if ('type' in content)
|
|
86
|
+
return fail();
|
|
87
|
+
id(content['particle']);
|
|
88
|
+
if (content['original'] !== undefined) {
|
|
89
|
+
const original = object(content['original'], ['owner', 'particle']);
|
|
90
|
+
id(original['owner']);
|
|
91
|
+
id(original['particle']);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
else if (content['kind'] !== 'empty' || 'type' in content || 'particle' in content || 'original' in content)
|
|
95
|
+
return fail();
|
|
96
|
+
if (r['wildcard'] !== undefined) {
|
|
97
|
+
const w = object(r['wildcard'], ['namespace', 'processContents', 'sources']);
|
|
98
|
+
if (w['processContents'] !== 'strict' && w['processContents'] !== 'lax' && w['processContents'] !== 'skip')
|
|
99
|
+
return fail();
|
|
100
|
+
const n = object(w['namespace'], ['kind', 'namespaces']);
|
|
101
|
+
if (n['kind'] !== 'set' && n['kind'] !== 'not')
|
|
102
|
+
return fail();
|
|
103
|
+
list(n['namespaces'], ns => { budget.chargeWork(); if (typeof ns !== 'string')
|
|
104
|
+
fail(); });
|
|
105
|
+
list(w['sources'], id);
|
|
106
|
+
}
|
|
107
|
+
const provenance = object(r['provenance'], ['kind', 'original', 'originals']);
|
|
108
|
+
if (provenance['kind'] === 'actual-mapped') {
|
|
109
|
+
if ('originals' in provenance)
|
|
110
|
+
return fail();
|
|
111
|
+
id(provenance['original']);
|
|
112
|
+
}
|
|
113
|
+
else if (provenance['kind'] === 'hypothetical-abstract') {
|
|
114
|
+
if ('original' in provenance)
|
|
115
|
+
return fail();
|
|
116
|
+
list(provenance['originals'], id);
|
|
117
|
+
}
|
|
118
|
+
else
|
|
119
|
+
fail();
|
|
120
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Structural checks of explicit abstract properties, separate from source mapping. */
|
|
2
|
+
import type { NodeId } from './canonicalGraph.js';
|
|
3
|
+
import type { SemanticContext } from './semanticContext.js';
|
|
4
|
+
import type { ResourceLimitFailure } from './semanticBudget.js';
|
|
5
|
+
import { RE01_DERIVATION_DOMAIN } from './re01TypeProperties.js';
|
|
6
|
+
import type { RawComplexTypeProperties } from './re01TypeProperties.js';
|
|
7
|
+
import type { CorrespondenceReceipt } from './re01CandidateCorrespondence.js';
|
|
8
|
+
export type RawTypeValidation = Readonly<{
|
|
9
|
+
kind: 'checked-structure';
|
|
10
|
+
contract: typeof RE01_DERIVATION_DOMAIN;
|
|
11
|
+
component: NodeId;
|
|
12
|
+
context: string;
|
|
13
|
+
properties: RawComplexTypeProperties;
|
|
14
|
+
mappingAuthority: 'none';
|
|
15
|
+
remaining: readonly ['effective-property-mapping', 'complete-type-validity', 'endpoint-correspondence', 'all-original-property-correspondence'];
|
|
16
|
+
}> | Readonly<{
|
|
17
|
+
kind: 'invalid-input' | 'unresolved';
|
|
18
|
+
rule: string;
|
|
19
|
+
component: NodeId;
|
|
20
|
+
}> | ResourceLimitFailure;
|
|
21
|
+
/** The context has already copied data and rejected accessors. No caller labels authenticate actual mapping. */
|
|
22
|
+
export declare function validateRawComplexTypeProperties(context: SemanticContext, typeId: NodeId, correspondence?: CorrespondenceReceipt): RawTypeValidation;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { resolveSemanticType, semanticTypeKey } from './schemaTypeIdentity.js';
|
|
2
|
+
import { XSD_NAMESPACE } from '../loader/orderedSyntax.js';
|
|
3
|
+
import { assertSemanticContext, SemanticContextAccessError } from './semanticContext.js';
|
|
4
|
+
import { RE01_DERIVATION_DOMAIN } from './re01TypeProperties.js';
|
|
5
|
+
import { assertCandidateCorrespondence } from './re01CandidateCorrespondence.js';
|
|
6
|
+
import { deriveRawComplexContent, particleContentNode } from './complexTypeContent.js';
|
|
7
|
+
class InvalidRawType extends Error {
|
|
8
|
+
rule;
|
|
9
|
+
unresolved;
|
|
10
|
+
constructor(rule, unresolved = false) {
|
|
11
|
+
super(rule);
|
|
12
|
+
this.rule = rule;
|
|
13
|
+
this.unresolved = unresolved;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/** The context has already copied data and rejected accessors. No caller labels authenticate actual mapping. */
|
|
17
|
+
export function validateRawComplexTypeProperties(context, typeId, correspondence) {
|
|
18
|
+
assertSemanticContext(context);
|
|
19
|
+
if (correspondence)
|
|
20
|
+
assertCandidateCorrespondence(context, correspondence);
|
|
21
|
+
const b = context.budget;
|
|
22
|
+
return b.guard(() => {
|
|
23
|
+
try {
|
|
24
|
+
b.chargeWork(3 + typeId.length);
|
|
25
|
+
const fail = (rule, unresolved = false) => { throw new InvalidRawType(rule, unresolved); };
|
|
26
|
+
const node = (id, kind) => {
|
|
27
|
+
b.chargeWork(3);
|
|
28
|
+
const result = context.lookup(id);
|
|
29
|
+
if (result.kind !== 'found')
|
|
30
|
+
return fail(`raw-type-${result.kind}`, true);
|
|
31
|
+
if (kind !== undefined && result.node.kind !== kind)
|
|
32
|
+
return fail('raw-type-reference-role');
|
|
33
|
+
return result.node;
|
|
34
|
+
};
|
|
35
|
+
const reference = (value, simple = false) => {
|
|
36
|
+
b.chargeWork(3);
|
|
37
|
+
const result = resolveSemanticType(context, value);
|
|
38
|
+
if (result.kind === 'builtin') {
|
|
39
|
+
if (simple && result.name.local === 'anyType')
|
|
40
|
+
return fail('raw-type-content-role');
|
|
41
|
+
return semanticTypeKey(context, result.identity);
|
|
42
|
+
}
|
|
43
|
+
if (result.kind === 'original-generated')
|
|
44
|
+
return semanticTypeKey(context, result.identity);
|
|
45
|
+
if (result.kind === 'wrong-role')
|
|
46
|
+
return fail('raw-type-reference-role');
|
|
47
|
+
if (result.kind !== 'component')
|
|
48
|
+
return fail(`raw-type-${result.kind}`, true);
|
|
49
|
+
if (simple && result.node.kind !== 'simpleType')
|
|
50
|
+
return fail('raw-type-content-role');
|
|
51
|
+
return semanticTypeKey(context, result.identity);
|
|
52
|
+
};
|
|
53
|
+
const methods = (value) => {
|
|
54
|
+
b.chargeWork(2);
|
|
55
|
+
const seen = new Set();
|
|
56
|
+
for (const method of value) {
|
|
57
|
+
b.chargeWork(5);
|
|
58
|
+
if (seen.has(method))
|
|
59
|
+
return fail('raw-type-methods');
|
|
60
|
+
seen.add(method);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const owner = node(typeId, 'complexType');
|
|
64
|
+
if (owner.kind !== 'complexType')
|
|
65
|
+
return fail('raw-type-owner');
|
|
66
|
+
const supplied = context.rawTypeProperties(typeId);
|
|
67
|
+
if (!supplied)
|
|
68
|
+
return fail('missing-raw-complex-type-properties', true);
|
|
69
|
+
// assertRawComplexTypeShape is the single shape gate in the authenticated
|
|
70
|
+
// context factory. These checks add selected-context consistency only.
|
|
71
|
+
const raw = supplied;
|
|
72
|
+
if (raw.type !== typeId || raw.abstract !== owner.abstract)
|
|
73
|
+
return fail('raw-type-owner-properties');
|
|
74
|
+
if (raw.targetNamespace !== undefined && owner.identity.kind === 'global' &&
|
|
75
|
+
b.compareText(raw.targetNamespace, owner.identity.name.namespace) !== 0)
|
|
76
|
+
return fail('raw-type-target-namespace');
|
|
77
|
+
if (raw.targetNamespace === undefined && owner.identity.kind === 'scoped' && !context.sourceNode(owner.id))
|
|
78
|
+
return fail('missing-raw-type-target-namespace', true);
|
|
79
|
+
methods(raw.final);
|
|
80
|
+
methods(raw.block);
|
|
81
|
+
const derivation = raw.derivation;
|
|
82
|
+
if (derivation.method !== (owner.derivation?.kind ?? 'restriction'))
|
|
83
|
+
return fail('raw-type-derivation');
|
|
84
|
+
const base = reference(derivation.base);
|
|
85
|
+
const ur = { kind: 'builtin', name: { namespace: XSD_NAMESPACE, local: 'anyType' } };
|
|
86
|
+
// Canonical Reference cannot encode the private scalar slot. That explicit
|
|
87
|
+
// semantic base replaces only the unrepresentable source placeholder;
|
|
88
|
+
// ordinary bases retain the existing representation-coherence check.
|
|
89
|
+
if (derivation.base.kind !== 'original-generated') {
|
|
90
|
+
const canonicalBase = owner.derivation ? reference(owner.derivation.base) : reference(ur);
|
|
91
|
+
if (b.compareText(base, canonicalBase) !== 0)
|
|
92
|
+
return fail('raw-type-derivation');
|
|
93
|
+
}
|
|
94
|
+
const content = raw.content;
|
|
95
|
+
switch (content.kind) {
|
|
96
|
+
case 'empty': break;
|
|
97
|
+
case 'simple':
|
|
98
|
+
reference(content.type, true);
|
|
99
|
+
break;
|
|
100
|
+
case 'mixed':
|
|
101
|
+
case 'element-only':
|
|
102
|
+
if (content.original) {
|
|
103
|
+
const mapped = deriveRawComplexContent(context, typeId);
|
|
104
|
+
if (mapped.kind === 'resource-limit')
|
|
105
|
+
return mapped;
|
|
106
|
+
if (mapped.kind !== 'checked' || particleContentNode(context, mapped.view, content.particle)?.kind !== 'particle')
|
|
107
|
+
return fail('raw-type-original-particle', true);
|
|
108
|
+
}
|
|
109
|
+
else
|
|
110
|
+
node(content.particle, 'particle');
|
|
111
|
+
break;
|
|
112
|
+
case 'opaque-builtin':
|
|
113
|
+
if (b.compareText(reference(content.type), reference(ur)) !== 0)
|
|
114
|
+
return fail('raw-type-content');
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
b.chargeWork();
|
|
118
|
+
const uses = new Set();
|
|
119
|
+
for (const id of raw.attributeUses) {
|
|
120
|
+
const use = node(id, 'attributeUse');
|
|
121
|
+
b.chargeWork(4 + use.id.length);
|
|
122
|
+
if (use.kind !== 'attributeUse' || use.use === 'prohibited' || uses.has(use.id))
|
|
123
|
+
return fail('raw-type-attribute-uses');
|
|
124
|
+
uses.add(use.id);
|
|
125
|
+
}
|
|
126
|
+
for (const id of raw.wildcard?.sources ?? []) {
|
|
127
|
+
b.chargeWork();
|
|
128
|
+
node(id, 'attributeWildcard');
|
|
129
|
+
}
|
|
130
|
+
const provenance = raw.provenance;
|
|
131
|
+
if (provenance.kind === 'actual-mapped') {
|
|
132
|
+
b.chargeWork(1 + (correspondence?.originalProperties.length ?? 0));
|
|
133
|
+
if (!correspondence?.originalProperties.includes(typeId) || provenance.original !== typeId)
|
|
134
|
+
return fail('unauthenticated-actual-type-mapping', true);
|
|
135
|
+
}
|
|
136
|
+
for (const original of provenance.kind === 'hypothetical-abstract' ? provenance.originals : []) {
|
|
137
|
+
b.chargeWork(2);
|
|
138
|
+
if (!context.sourceNode(original))
|
|
139
|
+
return fail('raw-type-provenance');
|
|
140
|
+
}
|
|
141
|
+
b.chargeWork(160 + context.contextId.length + typeId.length);
|
|
142
|
+
// The returned raw value was frozen by the context. It remains supplied
|
|
143
|
+
// data: neither this label nor these references prove effective mapping.
|
|
144
|
+
return Object.freeze({ kind: 'checked-structure', contract: RE01_DERIVATION_DOMAIN,
|
|
145
|
+
component: typeId, context: context.contextId, properties: supplied, mappingAuthority: 'none',
|
|
146
|
+
remaining: Object.freeze(['effective-property-mapping', 'complete-type-validity', 'endpoint-correspondence',
|
|
147
|
+
'all-original-property-correspondence']) });
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
if (error instanceof InvalidRawType) {
|
|
151
|
+
b.chargeWork(5);
|
|
152
|
+
return Object.freeze({ kind: error.unresolved ? 'unresolved' : 'invalid-input', rule: error.rule, component: typeId });
|
|
153
|
+
}
|
|
154
|
+
if (error instanceof SemanticContextAccessError) {
|
|
155
|
+
b.chargeWork(5);
|
|
156
|
+
return Object.freeze({ kind: error.code === 'reference' ? 'invalid-input' : 'unresolved', rule: `raw-type-${error.code}`, component: typeId });
|
|
157
|
+
}
|
|
158
|
+
throw error;
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { CanonicalGraph, GraphNode, NodeId, Reference } from "./canonicalGraph.js";
|
|
2
|
+
import type { SyntaxSource } from "../loader/orderedSyntax.js";
|
|
3
|
+
import type { StandardSchemaLibrary, StandardSchemaElementDeclaration } from './standardSchemaComponents.js';
|
|
4
|
+
export declare class SemanticError extends Error {
|
|
5
|
+
readonly category: "invalid-schema" | "unsupported-capability" | "incompatible-artifact" | "resource-limit";
|
|
6
|
+
readonly component?: NodeId | undefined;
|
|
7
|
+
readonly source?: SyntaxSource | undefined;
|
|
8
|
+
readonly related: readonly SyntaxSource[];
|
|
9
|
+
constructor(category: "invalid-schema" | "unsupported-capability" | "incompatible-artifact" | "resource-limit", message: string, component?: NodeId | undefined, source?: SyntaxSource | undefined, related?: readonly SyntaxSource[]);
|
|
10
|
+
}
|
|
11
|
+
export type SemanticLimits = {
|
|
12
|
+
maxNodes?: number;
|
|
13
|
+
maxSteps?: number;
|
|
14
|
+
requestBudget?: import("./semanticBudget.js").SemanticBudget;
|
|
15
|
+
standardLibraries?: readonly StandardSchemaLibrary[];
|
|
16
|
+
};
|
|
17
|
+
export declare function semanticBudget(limits?: SemanticLimits): {
|
|
18
|
+
maxNodes: number;
|
|
19
|
+
readonly steps: number;
|
|
20
|
+
step(node?: GraphNode): void;
|
|
21
|
+
};
|
|
22
|
+
/** Count structural data before retaining another input or serializing a copy. */
|
|
23
|
+
export declare function countSemanticData(value: unknown, budget: ReturnType<typeof semanticBudget>, node?: GraphNode): void;
|
|
24
|
+
export type ResolvedLink = Readonly<{
|
|
25
|
+
owner: NodeId;
|
|
26
|
+
path: string;
|
|
27
|
+
reference: Reference;
|
|
28
|
+
target?: NodeId;
|
|
29
|
+
}>;
|
|
30
|
+
export type ResolvedGraph = Readonly<{
|
|
31
|
+
graph: CanonicalGraph;
|
|
32
|
+
links: readonly ResolvedLink[];
|
|
33
|
+
metrics: Readonly<{
|
|
34
|
+
steps: number;
|
|
35
|
+
}>;
|
|
36
|
+
}>;
|
|
37
|
+
/** Native acquired dependencies only; copied graph reports cannot recreate this association. */
|
|
38
|
+
export declare function standardSchemaLibrariesForResolved(resolved: ResolvedGraph): readonly StandardSchemaLibrary[] | undefined;
|
|
39
|
+
/** Resolve against a node index, never against generated names or an asserted stored target. */
|
|
40
|
+
export declare function referenceTarget(reference: Reference, nodes: ReadonlyMap<NodeId, GraphNode>, owner: GraphNode, standards?: ReadonlyMap<NodeId, StandardSchemaElementDeclaration>): NodeId | undefined;
|
|
41
|
+
export declare function resolveCanonicalGraph(graph: CanonicalGraph, limits?: SemanticLimits): ResolvedGraph;
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/** Pure S05 reference assessment. Definitions and use-site occurrences remain canonical. */
|
|
2
|
+
import { deepFreeze, DEFAULT_GRAPH_NODES, globalId, isBuiltinType } from "./canonicalGraph.js";
|
|
3
|
+
import { positiveLimit } from "./catalogErrors.js";
|
|
4
|
+
import { referenceSlots, containedNodes } from "./graphTraversal.js";
|
|
5
|
+
import { syntaxAttribute, XSD_NAMESPACE } from "../loader/orderedSyntax.js";
|
|
6
|
+
import { normalizeWhitespace } from '../util/xmlWhitespace.js';
|
|
7
|
+
import { standardSchemaElement, inspectStandardSchemaElement } from './standardSchemaComponents.js';
|
|
8
|
+
export class SemanticError extends Error {
|
|
9
|
+
category;
|
|
10
|
+
component;
|
|
11
|
+
source;
|
|
12
|
+
related;
|
|
13
|
+
constructor(category, message, component, source, related = []) {
|
|
14
|
+
super(message);
|
|
15
|
+
this.category = category;
|
|
16
|
+
this.component = component;
|
|
17
|
+
this.source = source;
|
|
18
|
+
this.related = related;
|
|
19
|
+
this.name = "SemanticError";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/** Internal missing-symbol detail; source resolution must distinguish absent import resources from disproved declarations. */
|
|
23
|
+
class MissingReferenceError extends SemanticError {
|
|
24
|
+
constructor(reference, owner, id) {
|
|
25
|
+
super('invalid-schema', `Missing reference target ${id}`, owner.id, reference.kind === 'symbol' ? reference.lexical.context.source : owner.context.source);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export function semanticBudget(limits = {}) {
|
|
29
|
+
const maxNodes = positiveLimit(limits.maxNodes, DEFAULT_GRAPH_NODES, "maxNodes");
|
|
30
|
+
const maxSteps = positiveLimit(limits.maxSteps, 1_000_000, "maxSteps");
|
|
31
|
+
let steps = 0;
|
|
32
|
+
return { maxNodes, get steps() { return steps; }, step(node) {
|
|
33
|
+
limits.requestBudget?.chargeWork(64);
|
|
34
|
+
if (++steps > maxSteps)
|
|
35
|
+
throw new SemanticError("resource-limit", `Semantic traversal exceeds ${maxSteps} steps`, node?.id, node?.context.source);
|
|
36
|
+
} };
|
|
37
|
+
}
|
|
38
|
+
/** Count structural data before retaining another input or serializing a copy. */
|
|
39
|
+
export function countSemanticData(value, budget, node) {
|
|
40
|
+
const stack = [value];
|
|
41
|
+
while (stack.length) {
|
|
42
|
+
const item = stack.pop();
|
|
43
|
+
budget.step(node);
|
|
44
|
+
if (typeof item === "string")
|
|
45
|
+
for (let i = 0; i < item.length; i++)
|
|
46
|
+
budget.step(node);
|
|
47
|
+
else if (item && typeof item === "object")
|
|
48
|
+
for (const key in item) {
|
|
49
|
+
if (!Object.hasOwn(item, key))
|
|
50
|
+
continue;
|
|
51
|
+
budget.step(node);
|
|
52
|
+
for (let i = 0; i < key.length; i++)
|
|
53
|
+
budget.step(node);
|
|
54
|
+
stack.push(item[key]);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const resolvedStandards = new WeakMap();
|
|
59
|
+
/** Native acquired dependencies only; copied graph reports cannot recreate this association. */
|
|
60
|
+
export function standardSchemaLibrariesForResolved(resolved) {
|
|
61
|
+
return resolvedStandards.get(resolved);
|
|
62
|
+
}
|
|
63
|
+
/** Resolve against a node index, never against generated names or an asserted stored target. */
|
|
64
|
+
export function referenceTarget(reference, nodes, owner, standards) {
|
|
65
|
+
if (reference.kind === "builtin") {
|
|
66
|
+
if (reference.name.namespace !== XSD_NAMESPACE || !isBuiltinType(reference.name.local))
|
|
67
|
+
throw new SemanticError("invalid-schema", "Unknown builtin type", owner.id, owner.context.source);
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
const id = reference.kind === "symbol" ? globalId(reference.role, reference.name) : reference.target;
|
|
71
|
+
const target = nodes.get(id);
|
|
72
|
+
if (!target) {
|
|
73
|
+
const supplied = standards?.get(id);
|
|
74
|
+
if (!supplied)
|
|
75
|
+
throw new MissingReferenceError(reference, owner, id);
|
|
76
|
+
inspectStandardSchemaElement(supplied);
|
|
77
|
+
if (reference.kind !== 'symbol' || reference.role !== 'element' || supplied.id !== id
|
|
78
|
+
|| reference.target !== undefined && reference.target !== id)
|
|
79
|
+
throw new SemanticError('invalid-schema', 'Standard declaration reference role/identity mismatch', owner.id, owner.context.source);
|
|
80
|
+
return id;
|
|
81
|
+
}
|
|
82
|
+
if (reference.kind === "symbol" && (target.identity.kind !== "global" || target.identity.role !== reference.role || (reference.target !== undefined && reference.target !== id))) {
|
|
83
|
+
throw new SemanticError("invalid-schema", `Reference role/identity mismatch ${id}`, owner.id, reference.lexical.context.source);
|
|
84
|
+
}
|
|
85
|
+
return id;
|
|
86
|
+
}
|
|
87
|
+
function interpretation(key) {
|
|
88
|
+
if (!key.startsWith("["))
|
|
89
|
+
return { namespace: "", document: key };
|
|
90
|
+
const tuple = JSON.parse(key);
|
|
91
|
+
return { namespace: tuple[3], document: tuple[1] };
|
|
92
|
+
}
|
|
93
|
+
export function resolveCanonicalGraph(graph, limits = {}) {
|
|
94
|
+
const budget = semanticBudget(limits);
|
|
95
|
+
if (graph.nodes.length > budget.maxNodes)
|
|
96
|
+
throw new SemanticError("resource-limit", `Resolution exceeds ${budget.maxNodes} graph nodes`);
|
|
97
|
+
// Separate precharged graph traversal covers initial index and retained-import table preparation.
|
|
98
|
+
limits.requestBudget?.freeze(graph);
|
|
99
|
+
const nodes = new Map(graph.nodes.map(n => [n.id, n]));
|
|
100
|
+
if (nodes.size !== graph.nodes.length)
|
|
101
|
+
throw new SemanticError("invalid-schema", "Duplicate graph identities");
|
|
102
|
+
const standards = new Map(), selectedLibraries = [];
|
|
103
|
+
for (const library of limits.standardLibraries ?? []) {
|
|
104
|
+
budget.step();
|
|
105
|
+
const declaration = standardSchemaElement(library, { namespace: XSD_NAMESPACE, local: 'schema' });
|
|
106
|
+
if (!declaration)
|
|
107
|
+
throw new SemanticError('unsupported-capability', 'Standard library supplies no implemented schema element');
|
|
108
|
+
if (standards.has(declaration.id))
|
|
109
|
+
throw new SemanticError('unsupported-capability', 'Duplicate standard library selection');
|
|
110
|
+
if (nodes.has(declaration.id))
|
|
111
|
+
throw new SemanticError('unsupported-capability', 'Acquired standard declaration conflicts with explicit schema source; select one source authority');
|
|
112
|
+
standards.set(declaration.id, declaration);
|
|
113
|
+
selectedLibraries.push(library);
|
|
114
|
+
}
|
|
115
|
+
// Imports authorize foreign namespaces in the declaring interpretation only.
|
|
116
|
+
// Including/importing documents do not lend their import permissions to a reference.
|
|
117
|
+
const imports = new Map(), unknownImports = new Set();
|
|
118
|
+
const unlocatedImports = new Map();
|
|
119
|
+
const sourceKey = (source) => JSON.stringify([source.uri, source.digest, source.path]);
|
|
120
|
+
const importSyntax = new Map(graph.schemaRetained.filter(r => r.syntax.name.namespace === XSD_NAMESPACE && r.syntax.name.local === "import")
|
|
121
|
+
.map(r => [sourceKey(r.syntax.source), r.syntax]));
|
|
122
|
+
for (const edge of graph.loading.edges) {
|
|
123
|
+
budget.step();
|
|
124
|
+
if (edge.kind !== "import")
|
|
125
|
+
continue;
|
|
126
|
+
const syntax = importSyntax.get(sourceKey(edge.source));
|
|
127
|
+
const ns = syntax ? normalizeWhitespace(syntaxAttribute(syntax, "namespace") ?? "", 'collapse') : edge.to ? interpretation(edge.to).namespace : undefined;
|
|
128
|
+
if (ns === undefined) {
|
|
129
|
+
unknownImports.add(edge.from);
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
if (ns === interpretation(edge.from).namespace)
|
|
133
|
+
throw new SemanticError("invalid-schema", "Import must authorize a different namespace", undefined, edge.source);
|
|
134
|
+
const values = imports.get(edge.from) ?? new Set();
|
|
135
|
+
values.add(ns);
|
|
136
|
+
imports.set(edge.from, values);
|
|
137
|
+
if (!edge.to && syntax && syntaxAttribute(syntax, 'schemaLocation') === undefined) {
|
|
138
|
+
const pending = unlocatedImports.get(edge.from) ?? new Set();
|
|
139
|
+
pending.add(ns);
|
|
140
|
+
unlocatedImports.set(edge.from, pending);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
const links = [];
|
|
144
|
+
let unresolvedImport;
|
|
145
|
+
for (const node of graph.nodes) {
|
|
146
|
+
budget.step(node);
|
|
147
|
+
for (const slot of referenceSlots(node)) {
|
|
148
|
+
budget.step(node);
|
|
149
|
+
const ref = slot.reference;
|
|
150
|
+
let target;
|
|
151
|
+
let unavailable;
|
|
152
|
+
try {
|
|
153
|
+
target = referenceTarget(ref, nodes, node, standards);
|
|
154
|
+
}
|
|
155
|
+
catch (error) {
|
|
156
|
+
if (error instanceof MissingReferenceError && ref.kind === 'symbol' && node.kind !== 'wsdl') {
|
|
157
|
+
for (const origin of graph.origins[node.id] ?? []) {
|
|
158
|
+
budget.step(node);
|
|
159
|
+
if (ref.name.namespace !== origin.context.effectiveNamespace && unlocatedImports.get(origin.interpretation)?.has(ref.name.namespace)) {
|
|
160
|
+
unavailable = new SemanticError('unsupported-capability', `Missing declaration in namespace ${ref.name.namespace}; supply the locationless import dependency explicitly`, node.id, ref.lexical.context.source);
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (!unavailable)
|
|
166
|
+
throw error;
|
|
167
|
+
}
|
|
168
|
+
// @why P1-D01: missing dependency evidence must not mask independent actual reference failures.
|
|
169
|
+
if (unavailable) {
|
|
170
|
+
unresolvedImport ??= unavailable;
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
if (ref.kind === "symbol" && node.kind !== "wsdl") {
|
|
174
|
+
for (const origin of graph.origins[node.id] ?? []) {
|
|
175
|
+
budget.step(node);
|
|
176
|
+
if (ref.name.namespace === origin.context.effectiveNamespace)
|
|
177
|
+
continue;
|
|
178
|
+
if (!imports.get(origin.interpretation)?.has(ref.name.namespace)) {
|
|
179
|
+
if (unknownImports.has(origin.interpretation))
|
|
180
|
+
throw new SemanticError("incompatible-artifact", "Catalog lacks namespace evidence for an unlocated import; regenerate from original source", node.id, ref.lexical.context.source);
|
|
181
|
+
throw new SemanticError("invalid-schema", `Reference namespace ${ref.name.namespace} is not imported`, node.id, ref.lexical.context.source);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
links.push({ owner: node.id, path: slot.path, reference: ref, ...(target ? { target } : {}) });
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (unresolvedImport)
|
|
189
|
+
throw unresolvedImport;
|
|
190
|
+
// Only expansion/base edges enter this DAG. Element -> type and particle -> element
|
|
191
|
+
// are deliberately excluded: crossing an element admits complete recursive values.
|
|
192
|
+
const forbidden = (n) => {
|
|
193
|
+
limits.requestBudget?.freeze(n);
|
|
194
|
+
const result = [...containedNodes(n)];
|
|
195
|
+
for (const slot of referenceSlots(n)) {
|
|
196
|
+
const expansion = n.kind === "simpleType" || n.kind === "complexType" || n.kind === "attributeGroupUse" ||
|
|
197
|
+
(n.kind === "particle" && n.term.kind === "group") || (n.kind === "element" && slot.path === "substitutionGroup");
|
|
198
|
+
if (expansion) {
|
|
199
|
+
const target = referenceTarget(slot.reference, nodes, n, standards);
|
|
200
|
+
if (target && standards.has(target))
|
|
201
|
+
throw new SemanticError('unsupported-capability', 'Substitution affiliation to an acquired standard element is not implemented', n.id, n.context.source);
|
|
202
|
+
if (target)
|
|
203
|
+
result.push(target);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return result;
|
|
207
|
+
};
|
|
208
|
+
const done = new Set(), active = new Set();
|
|
209
|
+
for (const root of graph.nodes) {
|
|
210
|
+
if (done.has(root.id))
|
|
211
|
+
continue;
|
|
212
|
+
const stack = [{ node: root, edges: forbidden(root), index: 0 }];
|
|
213
|
+
active.add(root.id);
|
|
214
|
+
while (stack.length) {
|
|
215
|
+
budget.step(stack[stack.length - 1].node);
|
|
216
|
+
const frame = stack[stack.length - 1];
|
|
217
|
+
if (frame.index === frame.edges.length) {
|
|
218
|
+
active.delete(frame.node.id);
|
|
219
|
+
done.add(frame.node.id);
|
|
220
|
+
stack.pop();
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
const id = frame.edges[frame.index++], child = nodes.get(id);
|
|
224
|
+
if (!child)
|
|
225
|
+
throw new SemanticError("invalid-schema", `Missing structural target ${id}`, frame.node.id, frame.node.context.source);
|
|
226
|
+
if (active.has(id)) {
|
|
227
|
+
const cycle = stack.slice(stack.findIndex(f => f.node.id === id));
|
|
228
|
+
throw new SemanticError("invalid-schema", `Forbidden component cycle: ${cycle.map(f => f.node.id).join(" -> ")} -> ${id}`, frame.node.id, frame.node.context.source, cycle.map(f => f.node.context.source));
|
|
229
|
+
}
|
|
230
|
+
if (!done.has(id)) {
|
|
231
|
+
active.add(id);
|
|
232
|
+
stack.push({ node: child, edges: forbidden(child), index: 0 });
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
const result = { graph, links, metrics: { steps: budget.steps } };
|
|
237
|
+
const frozen = limits.requestBudget ? limits.requestBudget.freeze(result) : deepFreeze(result);
|
|
238
|
+
resolvedStandards.set(frozen, Object.freeze(selectedLibraries));
|
|
239
|
+
return frozen;
|
|
240
|
+
}
|