@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,8 @@
|
|
|
1
1
|
import { assertSemanticContext, contextsShareRequest, isSemanticCandidateOf, SemanticContextAccessError } from './semanticContext.js';
|
|
2
2
|
import { checkSchemaDocumentSyntax } from './schemaDocumentSyntax.js';
|
|
3
|
-
import { checkComponentConstruction, assertComponentConstruction } from './schemaConstructionAssessment.js';
|
|
4
|
-
import {
|
|
3
|
+
import { checkComponentConstruction, assertComponentConstruction, checkSimpleRestrictionPredicate, assertSimpleRestrictionPredicate } from './schemaConstructionAssessment.js';
|
|
4
|
+
import { assertStandardElementConstruction } from './standardSchemaConstruction.js';
|
|
5
|
+
import { checkCandidateCorrespondence, assertCandidateCorrespondence, re01Ancestor, checkAdditiveSimpleProperties, assertAdditiveSimpleProperties } from './re01CandidateCorrespondence.js';
|
|
5
6
|
import { immediateTypeBase } from './schemaTypeRelations.js';
|
|
6
7
|
import { XSD_NAMESPACE } from '../loader/orderedSyntax.js';
|
|
7
8
|
import { RE01_DERIVATION_DOMAIN } from './re01TypeProperties.js';
|
|
@@ -11,8 +12,10 @@ import { resolveSemanticType, semanticTypeKey } from './schemaTypeIdentity.js';
|
|
|
11
12
|
import { checkIdentityConstraintFormation } from './schemaIdentityConstraints.js';
|
|
12
13
|
import { deriveActualComplexContent, deriveOriginalComplexPropertyContent } from './complexTypeContent.js';
|
|
13
14
|
import { assertSemanticParticleView, prepareSemanticParticleView } from './particleSemanticView.js';
|
|
15
|
+
import { prepareAdditiveRestrictionRepresentative, prepareAdditiveExtensionMiddle } from './re01CandidateAssignments.js';
|
|
14
16
|
const issued = new WeakMap();
|
|
15
17
|
const issuedPrimitive = new WeakMap();
|
|
18
|
+
const proofContexts = new WeakMap();
|
|
16
19
|
class VerificationAbort extends Error {
|
|
17
20
|
result;
|
|
18
21
|
constructor(result) {
|
|
@@ -265,6 +268,10 @@ function createNativeFrontierOwner(actual) {
|
|
|
265
268
|
throw new VerificationAbort(result.kind === 'resource-limit' ? result
|
|
266
269
|
: { ...result, contextId: result.contextId ?? context.contextId });
|
|
267
270
|
assertComponentConstruction(context, result);
|
|
271
|
+
for (const standard of result.standardDependencies) {
|
|
272
|
+
charge();
|
|
273
|
+
assertStandardElementConstruction(context, standard);
|
|
274
|
+
}
|
|
268
275
|
for (const pending of result.obligations)
|
|
269
276
|
rejectPending(context, pending, requireTypes);
|
|
270
277
|
charge(4 + id.length);
|
|
@@ -395,13 +402,49 @@ function createNativeFrontierOwner(actual) {
|
|
|
395
402
|
throw error;
|
|
396
403
|
}
|
|
397
404
|
};
|
|
398
|
-
const
|
|
405
|
+
const inspectAdditive = (context) => {
|
|
406
|
+
assertSemanticContext(context);
|
|
407
|
+
if (!contextsShareRequest(actual, context) || !isSemanticCandidateOf(actual, context))
|
|
408
|
+
return fail('additive-context', 'An authenticated direct child of the actual request is required');
|
|
409
|
+
const deferredStart = deferred.length, typedStart = typedDependencies.length;
|
|
410
|
+
for (const id of actual.members) {
|
|
411
|
+
charge(16 + id.length);
|
|
412
|
+
const before = actual.lookup(id), after = context.lookup(id);
|
|
413
|
+
if (before.kind !== 'found' || after.kind !== 'found' || before.node !== after.node
|
|
414
|
+
|| actual.rawTypeProperties(id) !== context.rawTypeProperties(id)
|
|
415
|
+
|| actual.rawSimpleTypeProperties(id) !== context.rawSimpleTypeProperties(id)
|
|
416
|
+
|| actual.rawElementProperties(id) !== context.rawElementProperties(id)
|
|
417
|
+
|| actual.rawAttributeProperties(id) !== context.rawAttributeProperties(id)
|
|
418
|
+
|| actual.rawAttributeGroupProperties(id) !== context.rawAttributeGroupProperties(id)
|
|
419
|
+
|| actual.rawParticleWildcardProperties(id) !== context.rawParticleWildcardProperties(id)
|
|
420
|
+
|| actual.owner(id) !== context.owner(id))
|
|
421
|
+
return fail('additive-original-preservation', 'An additive construction changed an original component or scope', 'invalid-evidence', context, id);
|
|
422
|
+
}
|
|
423
|
+
checkNotations(context);
|
|
424
|
+
charge(4);
|
|
425
|
+
const roots = [];
|
|
426
|
+
for (const id of context.members) {
|
|
427
|
+
charge(2 + id.length);
|
|
428
|
+
if (actual.lookup(id).kind !== 'found') {
|
|
429
|
+
charge();
|
|
430
|
+
roots.push(id);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
return publish(close(context, roots), undefined, deferredStart, typedStart);
|
|
434
|
+
};
|
|
435
|
+
const validateAggregate = (proof, additive = []) => {
|
|
399
436
|
// A research session can inspect rejected alternatives. Only the selected
|
|
400
437
|
// forest contributes aggregate debts; context handles remain exact.
|
|
401
438
|
charge(4 + proof.length * 3);
|
|
402
439
|
const selected = new Set([actual.contextId]);
|
|
403
440
|
for (const step of proof)
|
|
404
441
|
selected.add(step.contextId);
|
|
442
|
+
for (const context of additive) {
|
|
443
|
+
charge(4 + context.contextId.length);
|
|
444
|
+
if (closures.get(context.contextId)?.context !== context)
|
|
445
|
+
return fail('additive-closure', 'Selected additive context lacks its native checked closure');
|
|
446
|
+
selected.add(context.contextId);
|
|
447
|
+
}
|
|
405
448
|
const selectedClosure = (contextId) => selected.has(contextId) ? closures.get(contextId) : undefined;
|
|
406
449
|
// A late property-only fact cannot reopen a closed FULL frontier. Its
|
|
407
450
|
// actual typed support must already be present in that exact context.
|
|
@@ -508,7 +551,13 @@ function createNativeFrontierOwner(actual) {
|
|
|
508
551
|
return fail(pending.obligation.rule, 'A correspondence scalar premise lacks concrete aggregate discharge', 'unresolved', actual, pending.obligation.component);
|
|
509
552
|
}
|
|
510
553
|
};
|
|
511
|
-
|
|
554
|
+
const retainActualDependencies = (dependencies) => {
|
|
555
|
+
for (const dependency of dependencies) {
|
|
556
|
+
charge(4 + dependency.contextId.length);
|
|
557
|
+
typedDependencies.push(Object.freeze({ from: actual, dependency }));
|
|
558
|
+
}
|
|
559
|
+
};
|
|
560
|
+
return { actualClosure, actualNotations, actualFrontier, inspect, inspectAdditive, primitive, closures, notationReceipts, validateAggregate, retainActualDependencies };
|
|
512
561
|
}
|
|
513
562
|
const frontierOwners = new WeakMap();
|
|
514
563
|
/** Internal native collection authority shared by supplied verification and research construction. */
|
|
@@ -550,6 +599,16 @@ export function assertFinitePrimitiveReceipt(actual, receipt) {
|
|
|
550
599
|
if (issuedPrimitive.get(receipt) !== actual)
|
|
551
600
|
throw new TypeError('Unauthenticated finite primitive receipt');
|
|
552
601
|
}
|
|
602
|
+
/** Inspect the exact checked contexts in proof order; diagnostic context IDs never reconstruct authority. */
|
|
603
|
+
export function inspectFiniteProofContexts(actual, receipt) {
|
|
604
|
+
assertSemanticContext(actual);
|
|
605
|
+
if (issued.get(receipt) !== actual && issuedPrimitive.get(receipt) !== actual)
|
|
606
|
+
throw new TypeError('Unauthenticated finite proof contexts');
|
|
607
|
+
const contexts = proofContexts.get(receipt);
|
|
608
|
+
if (!contexts)
|
|
609
|
+
throw new TypeError('Checked finite proof contexts unavailable');
|
|
610
|
+
return contexts;
|
|
611
|
+
}
|
|
553
612
|
export function verifyFiniteRe01Evidence(actual, target, supplied) {
|
|
554
613
|
return verifyFiniteRe01EvidenceWithFrontier(actual, target, supplied);
|
|
555
614
|
}
|
|
@@ -786,6 +845,8 @@ export function verifyFiniteRe01EvidenceWithFrontier(actual, target, supplied, p
|
|
|
786
845
|
actualComponents: actualClosure.components, actualPrimitiveNoChange: Object.freeze(actualPrimitiveNoChange), proof: Object.freeze(proof),
|
|
787
846
|
actualScalarSlots: actualClosure.scalarSlots,
|
|
788
847
|
actualNotations, actualIdentityConstraints: actualClosure.identityConstraints };
|
|
848
|
+
charge(32 + proof.length * 8);
|
|
849
|
+
const contexts = Object.freeze(proof.map(step => { charge(8); return nodes.get(step.evidence).context; }));
|
|
789
850
|
if (primitiveRoot) {
|
|
790
851
|
charge(12);
|
|
791
852
|
const result = Object.freeze({ ...common, kind: 'checked-primitive',
|
|
@@ -793,12 +854,14 @@ export function verifyFiniteRe01EvidenceWithFrontier(actual, target, supplied, p
|
|
|
793
854
|
claims: Object.freeze({ actualObligations: 'checked', primitiveTarget: 'checked', universalCoverage: false,
|
|
794
855
|
completeNegativeAnswer: false, searchTermination: false }) });
|
|
795
856
|
issuedPrimitive.set(result, actual);
|
|
857
|
+
proofContexts.set(result, contexts);
|
|
796
858
|
return result;
|
|
797
859
|
}
|
|
798
860
|
const result = Object.freeze({ ...common, kind: 'checked-candidate',
|
|
799
861
|
scope: 'supplied-construction-and-finite-evidence', root: root.id,
|
|
800
862
|
claims: Object.freeze({ actualObligations: 'checked', suppliedCandidate: 'checked', universalCoverage: false, completeNegativeAnswer: false, searchTermination: false }) });
|
|
801
863
|
issued.set(result, actual);
|
|
864
|
+
proofContexts.set(result, contexts);
|
|
802
865
|
return result;
|
|
803
866
|
}
|
|
804
867
|
catch (error) {
|
|
@@ -828,3 +891,327 @@ export function verifyDirectActualSchema(actual) {
|
|
|
828
891
|
}
|
|
829
892
|
});
|
|
830
893
|
}
|
|
894
|
+
const extensionChains = new WeakMap();
|
|
895
|
+
/** Authenticate actual-only extension ancestry; saved or copied receipt fields grant no authority. */
|
|
896
|
+
export function assertExtensionChainReceipt(actual, receipt) {
|
|
897
|
+
assertSemanticContext(actual);
|
|
898
|
+
if (extensionChains.get(receipt) !== actual)
|
|
899
|
+
throw new TypeError('Fresh matching extension-chain receipt required');
|
|
900
|
+
}
|
|
901
|
+
/** Close actual RE01 duties whose ancestry has no restriction after the designated ancestor.
|
|
902
|
+
* @remarks The 2004 Structures cos-ct-extends.1.5 note identifies this sufficient case as trivial.
|
|
903
|
+
* All component premises and aggregate dependencies are still checked by the existing native owner.
|
|
904
|
+
* No candidate context, endpoint replacement or primitive relabelling is used. The existing direct preview is unchanged.
|
|
905
|
+
* @returns Authenticated actual-only closure, an unresolved duty inventory, or the native failure.
|
|
906
|
+
* @throws TypeError For a non-actual context. Explicit request exhaustion remains sticky.
|
|
907
|
+
* @see https://www.w3.org/TR/2004/REC-xmlschema-1-20041028/#cos-ct-extends
|
|
908
|
+
*/
|
|
909
|
+
export function verifyExtensionChainActualSchema(actual) {
|
|
910
|
+
assertSemanticContext(actual);
|
|
911
|
+
if (actual.kind !== 'actual')
|
|
912
|
+
throw new TypeError('Actual source context required');
|
|
913
|
+
const { budget } = actual;
|
|
914
|
+
return budget.guard(() => {
|
|
915
|
+
try {
|
|
916
|
+
const owner = createNativeFrontierOwner(actual);
|
|
917
|
+
const extensionOnly = [], unresolved = [];
|
|
918
|
+
for (const requirement of owner.actualFrontier.requirements) {
|
|
919
|
+
budget.chargeWork(8);
|
|
920
|
+
if (requirement.primitive)
|
|
921
|
+
continue;
|
|
922
|
+
let reference = { kind: 'local', target: requirement.target };
|
|
923
|
+
const seen = new Set();
|
|
924
|
+
let established = false;
|
|
925
|
+
while (true) {
|
|
926
|
+
budget.chargeWork(8);
|
|
927
|
+
const resolved = resolveSemanticType(actual, reference);
|
|
928
|
+
if (resolved.kind !== 'component' || resolved.node.kind !== 'complexType')
|
|
929
|
+
break;
|
|
930
|
+
const node = resolved.node;
|
|
931
|
+
budget.chargeWork(4 + node.id.length);
|
|
932
|
+
if (seen.has(node.id))
|
|
933
|
+
break;
|
|
934
|
+
seen.add(node.id);
|
|
935
|
+
const next = immediateTypeBase(actual, reference);
|
|
936
|
+
if (next.kind === 'resource-limit')
|
|
937
|
+
throw new VerificationAbort(next);
|
|
938
|
+
if (next.kind !== 'checked' || !next.value)
|
|
939
|
+
break;
|
|
940
|
+
const base = resolveSemanticType(actual, next.value);
|
|
941
|
+
// @why The first derivation from anyType may be a restriction; every later edge must extend.
|
|
942
|
+
if (base.kind === 'builtin' && base.name.namespace === XSD_NAMESPACE && base.name.local === 'anyType') {
|
|
943
|
+
const designated = resolveSemanticType(actual, requirement.ancestor);
|
|
944
|
+
established = designated.kind === 'component' && designated.node === node;
|
|
945
|
+
break;
|
|
946
|
+
}
|
|
947
|
+
if (node.derivation?.kind !== 'extension')
|
|
948
|
+
break;
|
|
949
|
+
reference = next.value;
|
|
950
|
+
}
|
|
951
|
+
budget.chargeWork(2 + requirement.target.length);
|
|
952
|
+
(established ? extensionOnly : unresolved).push(requirement.target);
|
|
953
|
+
}
|
|
954
|
+
owner.validateAggregate([]);
|
|
955
|
+
budget.chargeWork(64 + extensionOnly.length + unresolved.length);
|
|
956
|
+
const result = Object.freeze({ kind: unresolved.length ? 'inconclusive-extension-chain' : 'checked-extension-chain',
|
|
957
|
+
basis: 'XSD-2004-extension-only-ancestry', frontier: owner.actualFrontier,
|
|
958
|
+
extensionOnly: Object.freeze(extensionOnly), unresolved: Object.freeze(unresolved) });
|
|
959
|
+
extensionChains.set(result, actual);
|
|
960
|
+
return result;
|
|
961
|
+
}
|
|
962
|
+
catch (error) {
|
|
963
|
+
if (error instanceof VerificationAbort)
|
|
964
|
+
return error.result;
|
|
965
|
+
throw error;
|
|
966
|
+
}
|
|
967
|
+
});
|
|
968
|
+
}
|
|
969
|
+
const additiveLocalClosures = new WeakMap();
|
|
970
|
+
/** Authenticate the exact native local closure; neither target correspondence nor actual RE01 is asserted. */
|
|
971
|
+
export function assertAdditiveLocalClosure(actual, receipt) {
|
|
972
|
+
assertSemanticContext(actual);
|
|
973
|
+
if (additiveLocalClosures.get(receipt) !== actual)
|
|
974
|
+
throw new TypeError('Fresh matching additive local closure required');
|
|
975
|
+
if (receipt.nativeProperties)
|
|
976
|
+
assertAdditiveSimpleProperties(actual, receipt.frontier.context, receipt.nativeProperties);
|
|
977
|
+
}
|
|
978
|
+
/** Check fresh extension/restriction representatives and their complete native dependencies without endpoint shadowing.
|
|
979
|
+
* @remarks Every original component and scope owner remains unchanged. This establishes local construction and
|
|
980
|
+
* aggregate discharge only; the representative-to-target correspondence and actual RE01 remain unassessed.
|
|
981
|
+
* @returns An authenticated local closure or explicit native unavailability/resource failure; never admission.
|
|
982
|
+
*/
|
|
983
|
+
export function verifyAdditiveRestrictionLocalClosure(actual, target) {
|
|
984
|
+
assertSemanticContext(actual);
|
|
985
|
+
const b = actual.budget;
|
|
986
|
+
return b.guard(() => {
|
|
987
|
+
try {
|
|
988
|
+
const owner = createNativeFrontierOwner(actual);
|
|
989
|
+
const prepared = prepareAdditiveRestrictionRepresentative(actual, target);
|
|
990
|
+
if (prepared.kind === 'resource-limit')
|
|
991
|
+
return prepared;
|
|
992
|
+
if (prepared.kind !== 'prepared-additive-restriction')
|
|
993
|
+
return Object.freeze({ kind: 'unresolved', rule: 'additive-preparation',
|
|
994
|
+
component: target, contextId: actual.contextId, message: 'The limited additive construction was unavailable' });
|
|
995
|
+
const frontier = owner.inspectAdditive(prepared.context);
|
|
996
|
+
if (frontier.requirements.some(requirement => !requirement.primitive))
|
|
997
|
+
return Object.freeze({ kind: 'unresolved',
|
|
998
|
+
rule: 'additive-nonprimitive-dependency', component: target, contextId: prepared.context.contextId,
|
|
999
|
+
message: 'The additive local closure still requires a nonprimitive derivation proof' });
|
|
1000
|
+
// Preparation debts are additional obligations, never successful producer annotations.
|
|
1001
|
+
if (prepared.scalarObligations.length)
|
|
1002
|
+
return Object.freeze({ kind: 'unresolved', rule: 'additive-preparation-scalar-obligations',
|
|
1003
|
+
component: target, contextId: actual.contextId, message: 'The proposal has scalar preparation obligations outside this local route' });
|
|
1004
|
+
owner.retainActualDependencies(prepared.typeDependencies);
|
|
1005
|
+
let nativeProperties;
|
|
1006
|
+
if (prepared.context.rawTypeProperties(prepared.representative)?.content.kind === 'simple') {
|
|
1007
|
+
const properties = checkAdditiveSimpleProperties(actual, prepared.context, target, prepared.intermediate, prepared.representative);
|
|
1008
|
+
if (properties.kind !== 'checked-additive-simple-properties')
|
|
1009
|
+
return properties;
|
|
1010
|
+
assertAdditiveSimpleProperties(actual, prepared.context, properties);
|
|
1011
|
+
if (properties.scalarObligations.length)
|
|
1012
|
+
return Object.freeze({ kind: 'unresolved', rule: 'additive-property-scalar-obligations',
|
|
1013
|
+
component: target, contextId: actual.contextId, message: 'Native property correspondence retains scalar obligations' });
|
|
1014
|
+
owner.retainActualDependencies(properties.typeDependencies);
|
|
1015
|
+
nativeProperties = properties;
|
|
1016
|
+
}
|
|
1017
|
+
owner.validateAggregate([], [prepared.context]);
|
|
1018
|
+
b.chargeWork(128);
|
|
1019
|
+
const result = Object.freeze({ kind: 'checked-additive-local-closure',
|
|
1020
|
+
actual: owner.actualFrontier, frontier, target, intermediate: prepared.intermediate, representative: prepared.representative,
|
|
1021
|
+
...(nativeProperties ? { nativeProperties } : {}),
|
|
1022
|
+
targetCorrespondence: 'unassessed', actualRe01: 'unassessed', admitted: false });
|
|
1023
|
+
additiveLocalClosures.set(result, actual);
|
|
1024
|
+
return result;
|
|
1025
|
+
}
|
|
1026
|
+
catch (error) {
|
|
1027
|
+
if (error instanceof VerificationAbort)
|
|
1028
|
+
return error.result;
|
|
1029
|
+
throw error;
|
|
1030
|
+
}
|
|
1031
|
+
});
|
|
1032
|
+
}
|
|
1033
|
+
const additiveSimplePredicates = new WeakMap();
|
|
1034
|
+
const simpleExtensionConstructions = new WeakMap();
|
|
1035
|
+
/** Authenticate the complete native premises; saved fields grant neither source nor runtime admission. */
|
|
1036
|
+
export function assertSimpleExtensionConstruction(actual, receipt) {
|
|
1037
|
+
assertSemanticContext(actual);
|
|
1038
|
+
if (simpleExtensionConstructions.get(receipt) !== actual)
|
|
1039
|
+
throw new TypeError('Fresh matching simple-extension construction required');
|
|
1040
|
+
assertExtensionChainReceipt(actual, receipt.complex);
|
|
1041
|
+
for (const predicate of receipt.simple)
|
|
1042
|
+
assertAdditiveSimplePredicate(actual, predicate);
|
|
1043
|
+
}
|
|
1044
|
+
/** Check the sufficient simple-content extension spine and its original-target alternative restriction.
|
|
1045
|
+
* @remarks Complex ancestry must consist solely of simple-content extensions and terminate at a simple type.
|
|
1046
|
+
* The designated ancestor is exactly anySimpleType; its fresh extension is independently constructed and
|
|
1047
|
+
* all original target restriction predicates and aggregate dependencies pass without replacing original bindings.
|
|
1048
|
+
* This collects native premises; the dated in-principle interpretation remains a separate qualification duty.
|
|
1049
|
+
* @returns Authenticated premises or unresolved targets/native failure, never admission or a general negative answer.
|
|
1050
|
+
* @see https://www.w3.org/TR/2004/REC-xmlschema-1-20041028/#cos-ct-extends
|
|
1051
|
+
*/
|
|
1052
|
+
export function verifySimpleExtensionConstruction(actual) {
|
|
1053
|
+
assertSemanticContext(actual);
|
|
1054
|
+
const b = actual.budget;
|
|
1055
|
+
return b.guard(() => {
|
|
1056
|
+
const complex = verifyExtensionChainActualSchema(actual);
|
|
1057
|
+
if (!('frontier' in complex))
|
|
1058
|
+
return complex;
|
|
1059
|
+
const simple = [], unresolved = [];
|
|
1060
|
+
for (const target of complex.unresolved) {
|
|
1061
|
+
b.chargeWork(16 + target.length);
|
|
1062
|
+
const designated = re01Ancestor(actual, target);
|
|
1063
|
+
if (designated.kind === 'resource-limit')
|
|
1064
|
+
return designated;
|
|
1065
|
+
const ancestor = designated.kind === 'checked' ? resolveSemanticType(actual, designated.ancestor) : undefined;
|
|
1066
|
+
let supported = ancestor?.kind === 'builtin' && ancestor.name.namespace === XSD_NAMESPACE && ancestor.name.local === 'anySimpleType';
|
|
1067
|
+
let reference = { kind: 'local', target };
|
|
1068
|
+
const seen = new Set();
|
|
1069
|
+
while (supported) {
|
|
1070
|
+
b.chargeWork(16);
|
|
1071
|
+
const selected = resolveSemanticType(actual, reference);
|
|
1072
|
+
if (selected.kind === 'builtin') {
|
|
1073
|
+
supported = selected.name.namespace === XSD_NAMESPACE && selected.name.local !== 'anyType';
|
|
1074
|
+
break;
|
|
1075
|
+
}
|
|
1076
|
+
if (selected.kind !== 'component') {
|
|
1077
|
+
supported = false;
|
|
1078
|
+
break;
|
|
1079
|
+
}
|
|
1080
|
+
if (selected.node.kind === 'simpleType')
|
|
1081
|
+
break;
|
|
1082
|
+
if (selected.node.kind !== 'complexType' || seen.has(selected.node.id)
|
|
1083
|
+
|| selected.node.derivation?.kind !== 'extension') {
|
|
1084
|
+
supported = false;
|
|
1085
|
+
break;
|
|
1086
|
+
}
|
|
1087
|
+
b.chargeWork(4 + selected.node.id.length);
|
|
1088
|
+
seen.add(selected.node.id);
|
|
1089
|
+
const content = deriveActualComplexContent(actual, selected.node.id);
|
|
1090
|
+
if (content.kind === 'resource-limit')
|
|
1091
|
+
return content;
|
|
1092
|
+
if (content.kind !== 'checked' || content.view.content.kind !== 'simple') {
|
|
1093
|
+
supported = false;
|
|
1094
|
+
break;
|
|
1095
|
+
}
|
|
1096
|
+
const next = immediateTypeBase(actual, reference);
|
|
1097
|
+
if (next.kind === 'resource-limit')
|
|
1098
|
+
return next;
|
|
1099
|
+
if (next.kind !== 'checked' || !next.value) {
|
|
1100
|
+
supported = false;
|
|
1101
|
+
break;
|
|
1102
|
+
}
|
|
1103
|
+
reference = next.value;
|
|
1104
|
+
}
|
|
1105
|
+
if (!supported) {
|
|
1106
|
+
unresolved.push(target);
|
|
1107
|
+
continue;
|
|
1108
|
+
}
|
|
1109
|
+
const paired = verifyAdditiveSimplePredicate(actual, target);
|
|
1110
|
+
if (paired.kind === 'resource-limit')
|
|
1111
|
+
return paired;
|
|
1112
|
+
if (paired.kind !== 'checked-additive-simple-predicate') {
|
|
1113
|
+
unresolved.push(target);
|
|
1114
|
+
continue;
|
|
1115
|
+
}
|
|
1116
|
+
assertAdditiveSimplePredicate(actual, paired);
|
|
1117
|
+
const middle = paired.frontier.context.rawTypeProperties(paired.intermediate);
|
|
1118
|
+
const base = middle ? resolveSemanticType(paired.frontier.context, middle.derivation.base) : undefined;
|
|
1119
|
+
if (middle?.derivation.method !== 'extension' || base?.kind !== 'builtin'
|
|
1120
|
+
|| base.name.namespace !== XSD_NAMESPACE || base.name.local !== 'anySimpleType') {
|
|
1121
|
+
unresolved.push(target);
|
|
1122
|
+
continue;
|
|
1123
|
+
}
|
|
1124
|
+
b.chargeWork(4);
|
|
1125
|
+
simple.push(paired);
|
|
1126
|
+
}
|
|
1127
|
+
b.chargeWork(64 + unresolved.length + simple.length);
|
|
1128
|
+
const result = Object.freeze({
|
|
1129
|
+
kind: unresolved.length ? 'inconclusive-simple-extension-construction' : 'checked-simple-extension-construction',
|
|
1130
|
+
basis: 'XSD-2004-simple-extension-spine', complex, simple: Object.freeze(simple), unresolved: Object.freeze(unresolved),
|
|
1131
|
+
datedInterpretation: 'unassessed', admitted: false
|
|
1132
|
+
});
|
|
1133
|
+
simpleExtensionConstructions.set(result, actual);
|
|
1134
|
+
return result;
|
|
1135
|
+
});
|
|
1136
|
+
}
|
|
1137
|
+
/** Authenticate the actual-target predicate and fresh-middle closure; this grants no dated or runtime admission. */
|
|
1138
|
+
export function assertAdditiveSimplePredicate(actual, receipt) {
|
|
1139
|
+
assertSemanticContext(actual);
|
|
1140
|
+
if (additiveSimplePredicates.get(receipt) !== actual)
|
|
1141
|
+
throw new TypeError('Fresh matching additive simple predicate required');
|
|
1142
|
+
assertSimpleRestrictionPredicate(receipt.frontier.context, receipt.predicate);
|
|
1143
|
+
}
|
|
1144
|
+
/** Close a fresh middle and evaluate the original target's simple restriction predicate without a renamed representative.
|
|
1145
|
+
* @remarks All original bindings are preserved and all consumed native dependencies are aggregated. The standards
|
|
1146
|
+
* interpretation of the alternative derivation remains unassessed; this is not actual RE01 or source eligibility.
|
|
1147
|
+
* @returns A fresh native paired predicate/closure or explicit unavailability/resource failure.
|
|
1148
|
+
*/
|
|
1149
|
+
export function verifyAdditiveSimplePredicate(actual, target) {
|
|
1150
|
+
assertSemanticContext(actual);
|
|
1151
|
+
const b = actual.budget;
|
|
1152
|
+
return b.guard(() => {
|
|
1153
|
+
try {
|
|
1154
|
+
const owner = createNativeFrontierOwner(actual);
|
|
1155
|
+
const prepared = prepareAdditiveExtensionMiddle(actual, target);
|
|
1156
|
+
if (prepared.kind === 'resource-limit')
|
|
1157
|
+
return prepared;
|
|
1158
|
+
if (prepared.kind !== 'prepared-additive-middle')
|
|
1159
|
+
return Object.freeze({ kind: 'unresolved', rule: 'additive-middle-preparation',
|
|
1160
|
+
component: target, contextId: actual.contextId, message: 'The limited additive middle was unavailable' });
|
|
1161
|
+
for (const id of prepared.context.members) {
|
|
1162
|
+
b.chargeWork(4 + id.length);
|
|
1163
|
+
if (actual.lookup(id).kind === 'found')
|
|
1164
|
+
continue;
|
|
1165
|
+
const found = prepared.context.lookup(id);
|
|
1166
|
+
let valid = found.kind === 'found';
|
|
1167
|
+
if (found.kind === 'found' && id === prepared.intermediate)
|
|
1168
|
+
valid = found.node.kind === 'complexType';
|
|
1169
|
+
else if (found.kind === 'found' && (found.node.kind === 'attribute' || found.node.kind === 'attributeUse')) {
|
|
1170
|
+
valid = prepared.context.owner(id) === prepared.intermediate;
|
|
1171
|
+
if (found.node.kind === 'attribute')
|
|
1172
|
+
valid &&= found.node.value === undefined;
|
|
1173
|
+
else {
|
|
1174
|
+
const declaration = prepared.context.resolve(found.node.declaration);
|
|
1175
|
+
valid &&= declaration.kind === 'found' && declaration.node.kind === 'attribute'
|
|
1176
|
+
&& (declaration.node.identity.kind === 'global' || prepared.context.owner(declaration.node.id) === prepared.intermediate);
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
else
|
|
1180
|
+
valid = false;
|
|
1181
|
+
if (!valid)
|
|
1182
|
+
return Object.freeze({ kind: 'unresolved', rule: 'additive-owned-attribute-scope', component: id,
|
|
1183
|
+
contextId: prepared.context.contextId, message: 'The simple middle family requires fresh-owned local declarations and uses' });
|
|
1184
|
+
}
|
|
1185
|
+
const frontier = owner.inspectAdditive(prepared.context);
|
|
1186
|
+
if (frontier.requirements.some(requirement => !requirement.primitive))
|
|
1187
|
+
return Object.freeze({ kind: 'unresolved',
|
|
1188
|
+
rule: 'additive-middle-nonprimitive-dependency', component: target, contextId: prepared.context.contextId,
|
|
1189
|
+
message: 'The additive middle has an unresolved nonprimitive dependency' });
|
|
1190
|
+
const predicate = checkSimpleRestrictionPredicate(prepared.context, target, prepared.intermediate);
|
|
1191
|
+
if (predicate.kind === 'resource-limit')
|
|
1192
|
+
return predicate;
|
|
1193
|
+
if (predicate.kind !== 'checked-simple-restriction-predicate')
|
|
1194
|
+
return Object.freeze({ kind: 'unresolved', rule: predicate.rule,
|
|
1195
|
+
component: target, contextId: prepared.context.contextId, message: 'The actual-target simple restriction predicate was unavailable' });
|
|
1196
|
+
assertSimpleRestrictionPredicate(prepared.context, predicate);
|
|
1197
|
+
if (prepared.scalarObligations.length || predicate.scalarObligations.length)
|
|
1198
|
+
return Object.freeze({ kind: 'unresolved',
|
|
1199
|
+
rule: 'additive-predicate-scalar-obligations', component: target, contextId: prepared.context.contextId,
|
|
1200
|
+
message: 'The additive predicate retains scalar obligations outside this local strategy' });
|
|
1201
|
+
owner.retainActualDependencies(prepared.typeDependencies);
|
|
1202
|
+
owner.retainActualDependencies(predicate.typeDependencies);
|
|
1203
|
+
owner.validateAggregate([], [prepared.context]);
|
|
1204
|
+
b.chargeWork(128);
|
|
1205
|
+
const result = Object.freeze({ kind: 'checked-additive-simple-predicate',
|
|
1206
|
+
actual: owner.actualFrontier, frontier, target, intermediate: prepared.intermediate, predicate,
|
|
1207
|
+
actualRe01: 'unassessed', datedInterpretation: 'unassessed', admitted: false });
|
|
1208
|
+
additiveSimplePredicates.set(result, actual);
|
|
1209
|
+
return result;
|
|
1210
|
+
}
|
|
1211
|
+
catch (error) {
|
|
1212
|
+
if (error instanceof VerificationAbort)
|
|
1213
|
+
return error.result;
|
|
1214
|
+
throw error;
|
|
1215
|
+
}
|
|
1216
|
+
});
|
|
1217
|
+
}
|
|
@@ -18,4 +18,3 @@ import type { CompiledCatalog } from "./schemaCompiler.js";
|
|
|
18
18
|
* @param {CompiledCatalog} compiled - The compiled WSDL catalog to write
|
|
19
19
|
*/
|
|
20
20
|
export declare function generateCatalog(outFile: string, compiled: CompiledCatalog): void;
|
|
21
|
-
//# sourceMappingURL=generateCatalog.d.ts.map
|
|
@@ -8,4 +8,3 @@ export type ReferenceSlot = Readonly<{
|
|
|
8
8
|
export declare function mapNodeReferences(node: GraphNode, map: (reference: Reference) => Reference): GraphNode;
|
|
9
9
|
export declare function referenceSlots(node: GraphNode): readonly ReferenceSlot[];
|
|
10
10
|
export declare function containedNodes(node: GraphNode): readonly NodeId[];
|
|
11
|
-
//# sourceMappingURL=graphTraversal.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type NodeId } from "./declarationIdentity.js";
|
|
2
|
+
export type LegacyGlobal = Readonly<{
|
|
3
|
+
kind: "complex" | "simple" | "element";
|
|
4
|
+
name: string;
|
|
5
|
+
ns: string;
|
|
6
|
+
node: unknown;
|
|
7
|
+
prefixes: Record<string, string>;
|
|
8
|
+
}>;
|
|
9
|
+
/** Index legacy declarations without importing the checked loader's source or acceptance policies.
|
|
10
|
+
* @constraints Paths count equal role/name peers within a parent, never text nodes or unrelated global declarations.
|
|
11
|
+
* @constraints Name allocation is local to this compilation; independent catalogs still require conservative conflict checks.
|
|
12
|
+
*/
|
|
13
|
+
export declare class LegacyDeclarations {
|
|
14
|
+
private readonly declarations;
|
|
15
|
+
private readonly names;
|
|
16
|
+
private readonly surfaces;
|
|
17
|
+
private readonly inlineByOwner;
|
|
18
|
+
constructor(globals: readonly LegacyGlobal[]);
|
|
19
|
+
type(ns: string, name: string): NodeId;
|
|
20
|
+
element(ns: string, name: string): NodeId;
|
|
21
|
+
surface(ns: string, name: string): NodeId;
|
|
22
|
+
name(id: NodeId): string;
|
|
23
|
+
inline(owner: NodeId, element: unknown): NodeId;
|
|
24
|
+
private walk;
|
|
25
|
+
private allocate;
|
|
26
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { globalId, scopedId } from "./declarationIdentity.js";
|
|
3
|
+
import { pascal, resolveQName } from "../util/tools.js";
|
|
4
|
+
const object = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
5
|
+
const local = (key) => key.slice(key.indexOf(":") + 1);
|
|
6
|
+
const attribute = (node, name) => object(node) && typeof node[`@_${name}`] === "string" ? node[`@_${name}`] : "";
|
|
7
|
+
const children = (node, role) => object(node) ? Object.entries(node)
|
|
8
|
+
.filter(([key]) => local(key) === role).flatMap(([, value]) => Array.isArray(value) ? value : [value]) : [];
|
|
9
|
+
/** Index legacy declarations without importing the checked loader's source or acceptance policies.
|
|
10
|
+
* @constraints Paths count equal role/name peers within a parent, never text nodes or unrelated global declarations.
|
|
11
|
+
* @constraints Name allocation is local to this compilation; independent catalogs still require conservative conflict checks.
|
|
12
|
+
*/
|
|
13
|
+
export class LegacyDeclarations {
|
|
14
|
+
declarations = new Map();
|
|
15
|
+
names = new Map();
|
|
16
|
+
surfaces = new Map();
|
|
17
|
+
inlineByOwner = new Map();
|
|
18
|
+
constructor(globals) {
|
|
19
|
+
const named = new Set(globals.filter(g => g.kind !== "element").map(g => this.type(g.ns, g.name)));
|
|
20
|
+
for (const g of globals) {
|
|
21
|
+
const id = g.kind === "element" ? this.element(g.ns, g.name) : this.type(g.ns, g.name);
|
|
22
|
+
if (g.kind === "element") {
|
|
23
|
+
const target = attribute(g.node, "type");
|
|
24
|
+
const q = target ? resolveQName(target, g.ns, g.prefixes) : undefined;
|
|
25
|
+
if (q && q.ns === g.ns && q.local === g.name && named.has(this.type(q.ns, q.local))) {
|
|
26
|
+
this.surfaces.set(id, this.type(q.ns, q.local));
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const body = g.kind === "element" ? children(g.node, "complexType")[0] : g.node;
|
|
31
|
+
const surface = g.kind === "element" && body ? scopedId(id, "complexType", "type") : id;
|
|
32
|
+
this.surfaces.set(id, surface);
|
|
33
|
+
this.declarations.set(surface, { id: surface, candidate: pascal(g.name), stem: pascal(g.name), anonymous: false });
|
|
34
|
+
if (body && g.kind !== "simple")
|
|
35
|
+
this.walk(surface, body, pascal(g.name), []);
|
|
36
|
+
}
|
|
37
|
+
this.allocate();
|
|
38
|
+
}
|
|
39
|
+
type(ns, name) { return globalId("type", { namespace: ns, local: name }); }
|
|
40
|
+
element(ns, name) { return globalId("element", { namespace: ns, local: name }); }
|
|
41
|
+
surface(ns, name) {
|
|
42
|
+
const id = this.element(ns, name);
|
|
43
|
+
return this.surfaces.get(id) ?? id;
|
|
44
|
+
}
|
|
45
|
+
name(id) {
|
|
46
|
+
const name = this.names.get(id);
|
|
47
|
+
if (!name)
|
|
48
|
+
throw new Error(`Missing legacy declaration name: ${id}`);
|
|
49
|
+
return name;
|
|
50
|
+
}
|
|
51
|
+
inline(owner, element) {
|
|
52
|
+
const id = object(element) ? this.inlineByOwner.get(owner)?.get(element) : undefined;
|
|
53
|
+
if (!id)
|
|
54
|
+
throw new Error(`Missing inline declaration in ${owner}`);
|
|
55
|
+
return id;
|
|
56
|
+
}
|
|
57
|
+
walk(owner, node, stem, path) {
|
|
58
|
+
if (!object(node))
|
|
59
|
+
return;
|
|
60
|
+
const peers = new Map();
|
|
61
|
+
for (const [key, value] of Object.entries(node)) {
|
|
62
|
+
const role = local(key);
|
|
63
|
+
if (!["sequence", "choice", "all", "element", "complexContent", "simpleContent", "extension", "restriction"].includes(role))
|
|
64
|
+
continue;
|
|
65
|
+
for (const child of Array.isArray(value) ? value : [value]) {
|
|
66
|
+
const xmlName = attribute(child, "name") || attribute(child, "ref").split(":").at(-1) || "";
|
|
67
|
+
const peer = JSON.stringify([role, xmlName]);
|
|
68
|
+
const ordinal = peers.get(peer) ?? 0;
|
|
69
|
+
peers.set(peer, ordinal + 1);
|
|
70
|
+
const childPath = [...path, JSON.stringify([role, xmlName, ordinal])];
|
|
71
|
+
if (role === "element") {
|
|
72
|
+
const body = children(child, "complexType")[0];
|
|
73
|
+
if (!body || !object(child))
|
|
74
|
+
continue;
|
|
75
|
+
const elementId = scopedId(owner, JSON.stringify(childPath), "element");
|
|
76
|
+
const id = scopedId(elementId, "complexType", "type");
|
|
77
|
+
const candidate = pascal(xmlName);
|
|
78
|
+
const childStem = `${stem}${candidate}`;
|
|
79
|
+
this.declarations.set(id, { id, candidate, stem: childStem, anonymous: true });
|
|
80
|
+
let byNode = this.inlineByOwner.get(owner);
|
|
81
|
+
if (!byNode)
|
|
82
|
+
this.inlineByOwner.set(owner, byNode = new WeakMap());
|
|
83
|
+
byNode.set(child, id);
|
|
84
|
+
this.walk(id, body, childStem, []);
|
|
85
|
+
}
|
|
86
|
+
else
|
|
87
|
+
this.walk(owner, child, stem, childPath);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
allocate() {
|
|
92
|
+
const groups = new Map();
|
|
93
|
+
for (const d of this.declarations.values()) {
|
|
94
|
+
const group = groups.get(d.candidate) ?? [];
|
|
95
|
+
group.push(d);
|
|
96
|
+
groups.set(d.candidate, group);
|
|
97
|
+
}
|
|
98
|
+
const proposed = new Map();
|
|
99
|
+
const fixed = new Set();
|
|
100
|
+
const preserved = new Set();
|
|
101
|
+
for (const [candidate, group] of groups) {
|
|
102
|
+
const named = group.filter(d => !d.anonymous);
|
|
103
|
+
if (group.length === 1 || named.length === 1) {
|
|
104
|
+
const declaration = group.length === 1 ? group[0] : named[0];
|
|
105
|
+
proposed.set(declaration.id, candidate);
|
|
106
|
+
preserved.add(declaration.id);
|
|
107
|
+
fixed.add(candidate);
|
|
108
|
+
}
|
|
109
|
+
for (const d of group) {
|
|
110
|
+
if (!proposed.has(d.id))
|
|
111
|
+
proposed.set(d.id, d.anonymous ? d.stem : d.candidate);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
// @why No traversal-order winner: every unresolved member of a collision receives an identity-derived suffix.
|
|
115
|
+
const counts = new Map();
|
|
116
|
+
for (const name of proposed.values())
|
|
117
|
+
counts.set(name, (counts.get(name) ?? 0) + 1);
|
|
118
|
+
const pending = [];
|
|
119
|
+
for (const d of this.declarations.values()) {
|
|
120
|
+
const name = proposed.get(d.id);
|
|
121
|
+
if (preserved.has(d.id) || (counts.get(name) === 1 && !fixed.has(name)))
|
|
122
|
+
this.names.set(d.id, name);
|
|
123
|
+
else
|
|
124
|
+
pending.push(d);
|
|
125
|
+
}
|
|
126
|
+
const used = new Set(this.names.values());
|
|
127
|
+
for (let length = 12; pending.length > 0; length += 4) {
|
|
128
|
+
if (length > 64)
|
|
129
|
+
throw new Error("Cannot allocate unique legacy declaration names");
|
|
130
|
+
const candidates = pending.map(d => `${proposed.get(d.id)}_${createHash("sha256").update(d.id).digest("hex").slice(0, length)}`);
|
|
131
|
+
const occurrences = new Map();
|
|
132
|
+
for (const name of candidates)
|
|
133
|
+
occurrences.set(name, (occurrences.get(name) ?? 0) + 1);
|
|
134
|
+
for (let i = pending.length - 1; i >= 0; i--) {
|
|
135
|
+
const name = candidates[i];
|
|
136
|
+
if (used.has(name) || occurrences.get(name) > 1)
|
|
137
|
+
continue;
|
|
138
|
+
this.names.set(pending[i].id, name);
|
|
139
|
+
used.add(name);
|
|
140
|
+
pending.splice(i, 1);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|