@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
|
@@ -11,4 +11,3 @@ import type { CompiledCatalog } from "../compiler/schemaCompiler.js";
|
|
|
11
11
|
* @throws {Error} If a packaged preamble cannot be loaded or the TypeScript file cannot be written.
|
|
12
12
|
*/
|
|
13
13
|
export declare function generateOperations(outFile: string, compiled: CompiledCatalog): void;
|
|
14
|
-
//# sourceMappingURL=generateOperations.d.ts.map
|
|
@@ -20,4 +20,3 @@ import type { CompiledCatalog } from "../compiler/schemaCompiler.js";
|
|
|
20
20
|
* @throws {Error} If a packaged preamble cannot be loaded or the TypeScript file cannot be written.
|
|
21
21
|
*/
|
|
22
22
|
export declare function generateTypes(outFile: string, compiled: CompiledCatalog): void;
|
|
23
|
-
//# sourceMappingURL=generateTypes.d.ts.map
|
|
@@ -19,4 +19,3 @@ import type { CompiledCatalog } from "../compiler/schemaCompiler.js";
|
|
|
19
19
|
* @throws {Error} If a packaged preamble cannot be loaded or the TypeScript file cannot be written.
|
|
20
20
|
*/
|
|
21
21
|
export declare function generateUtils(outFile: string, compiled: CompiledCatalog): void;
|
|
22
|
-
//# sourceMappingURL=generateUtils.d.ts.map
|
|
@@ -48,7 +48,7 @@ export function generateUtils(outFile, compiled) {
|
|
|
48
48
|
return max === "unbounded" || (typeof max === "number" && max > 1);
|
|
49
49
|
}).sort(),
|
|
50
50
|
]));
|
|
51
|
-
const metas = JSON.stringify({ Attributes: attrSpec, ChildrenTypes: childType, RepeatedElements: repeatedElements }, null, 2);
|
|
51
|
+
const metas = JSON.stringify({ Attributes: attrSpec, AttributeTypes: compiled.meta.attrType ?? {}, ChildrenTypes: childType, RepeatedElements: repeatedElements }, null, 2);
|
|
52
52
|
const dataTypes = `/**
|
|
53
53
|
* ${clientName} WSDL data types for proper serialization/deserialization.
|
|
54
54
|
* Used to distinguish between XML attributes and elements during conversion.
|
|
@@ -56,6 +56,8 @@ export function generateUtils(outFile, compiled) {
|
|
|
56
56
|
export interface ${clientName}DataTypes {
|
|
57
57
|
/** Maps type names to lists of property names that should be treated as XML attributes */
|
|
58
58
|
Attributes: Record<string, readonly string[]>;
|
|
59
|
+
/** Maps attributes to their projected scalar types for XML response conversion. */
|
|
60
|
+
AttributeTypes?: Record<string, Readonly<Record<string, string>>>;
|
|
59
61
|
/** Maps type names to their child element types for recursive processing */
|
|
60
62
|
ChildrenTypes: Record<string, Readonly<Record<string, string>>>;
|
|
61
63
|
/** Maps type names to repeated child properties; optional for custom metadata compatibility. */
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { SemanticContext } from './semanticContext.js';
|
|
2
|
+
import type { SemanticParticle } from './particleSemanticView.js';
|
|
3
|
+
import type { DirectProjectionPlan, DirectProjectionSlot } from './directStructurePlan.js';
|
|
4
|
+
export interface ApplicationGroupName {
|
|
5
|
+
readonly target: string;
|
|
6
|
+
readonly propertyName?: string;
|
|
7
|
+
readonly typeName?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ApplicationGroupsOptions {
|
|
10
|
+
readonly names?: readonly ApplicationGroupName[];
|
|
11
|
+
}
|
|
12
|
+
export interface ApplicationGroupTarget {
|
|
13
|
+
readonly target: string;
|
|
14
|
+
readonly role: 'choice' | 'sequence' | 'alternative';
|
|
15
|
+
readonly source: string;
|
|
16
|
+
readonly defaults: {
|
|
17
|
+
readonly propertyName?: string;
|
|
18
|
+
readonly typeName: string;
|
|
19
|
+
};
|
|
20
|
+
readonly resolved: {
|
|
21
|
+
readonly propertyName?: string;
|
|
22
|
+
readonly typeName: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export interface ApplicationGroupRecord {
|
|
26
|
+
readonly source: string;
|
|
27
|
+
readonly disposition: 'grouped' | 'retained-ordered' | 'compact';
|
|
28
|
+
readonly reason: string;
|
|
29
|
+
}
|
|
30
|
+
export type GroupNode = {
|
|
31
|
+
readonly particle: SemanticParticle;
|
|
32
|
+
readonly slot?: DirectProjectionSlot;
|
|
33
|
+
readonly children: readonly GroupNode[];
|
|
34
|
+
readonly target?: ApplicationGroupTarget;
|
|
35
|
+
readonly alternatives?: readonly ApplicationGroupTarget[];
|
|
36
|
+
};
|
|
37
|
+
export interface ApplicationGroupPlan {
|
|
38
|
+
readonly records: Readonly<Record<string, GroupNode>>;
|
|
39
|
+
readonly targets: readonly ApplicationGroupTarget[];
|
|
40
|
+
readonly dispositions: readonly ApplicationGroupRecord[];
|
|
41
|
+
}
|
|
42
|
+
/** Stable private record symbol shared across operation directions and schema scopes. */
|
|
43
|
+
export declare const applicationRecordName: (id: string) => string;
|
|
44
|
+
/** Copy strict data-only generation options, rejecting malformed arrays before any source work. */
|
|
45
|
+
export declare function parseApplicationGroups(value: unknown): ApplicationGroupsOptions;
|
|
46
|
+
/** Derive finite group definitions from exact qualified records; no caller inventory is trusted. */
|
|
47
|
+
export declare function planApplicationGroups(context: SemanticContext, projection: DirectProjectionPlan, options: ApplicationGroupsOptions, checkpoint: () => void): ApplicationGroupPlan;
|
|
48
|
+
export declare class ApplicationGroupValueError extends Error {
|
|
49
|
+
}
|
|
50
|
+
/** Convert owned data between grouped and existing ordered values without adding XML wrappers.
|
|
51
|
+
* @constraints Input must first pass the bounded data-only owner; recursive calls are depth-limited.
|
|
52
|
+
*/
|
|
53
|
+
export declare function mapApplicationGroups(plan: ApplicationGroupPlan, projection: DirectProjectionPlan, input: unknown, direction: 'to-native' | 'from-native', check: () => void): unknown;
|
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
/** Source-derived application presentation; native particles and scalar owners retain admission duties. */
|
|
2
|
+
import { createHash } from 'node:crypto';
|
|
3
|
+
import { types } from 'node:util';
|
|
4
|
+
import { inspectProjectionGrammar } from './directStructurePlan.js';
|
|
5
|
+
import { deepFreeze } from './canonicalGraph.js';
|
|
6
|
+
const digest = (value) => createHash('sha256').update(JSON.stringify(value)).digest('hex');
|
|
7
|
+
/** Stable private record symbol shared across operation directions and schema scopes. */
|
|
8
|
+
export const applicationRecordName = (id) => 'ApplicationRecord_' + createHash('sha256').update(id).digest('hex').slice(0, 16);
|
|
9
|
+
const reserved = new Set(('break case catch class const continue debugger default delete do else enum export extends false finally for function if import in instanceof new null return super switch this throw true try typeof var void while with as implements interface let package private protected public static yield any bigint boolean constructor declare get module require number set string symbol type from of unknown never object readonly abstract async await namespace undefined NaN Infinity Record Readonly Array Promise Date Error Object String Number Boolean Map Set JSON').split(' '));
|
|
10
|
+
const metadata = new Set(['$value', '$content', '$attributes', '$namespace', '$namespaces', '$nil']);
|
|
11
|
+
/** Copy strict data-only generation options, rejecting malformed arrays before any source work. */
|
|
12
|
+
export function parseApplicationGroups(value) {
|
|
13
|
+
const record = (input, allowed) => {
|
|
14
|
+
if (!input || typeof input !== 'object' || types.isProxy(input) || ![Object.prototype, null].includes(Object.getPrototypeOf(input)))
|
|
15
|
+
throw new TypeError('applicationGroups requires data records');
|
|
16
|
+
const result = Object.create(null);
|
|
17
|
+
for (const key of Reflect.ownKeys(input)) {
|
|
18
|
+
const d = Object.getOwnPropertyDescriptor(input, key);
|
|
19
|
+
if (typeof key !== 'string' || !allowed.includes(key) || !('value' in d))
|
|
20
|
+
throw new TypeError('Unknown applicationGroups field or accessor');
|
|
21
|
+
result[key] = d.value;
|
|
22
|
+
}
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
const options = record(value, ['names']);
|
|
26
|
+
if (!Object.hasOwn(options, 'names'))
|
|
27
|
+
return {};
|
|
28
|
+
if (types.isProxy(options.names) || !Array.isArray(options.names) || Object.getPrototypeOf(options.names) !== Array.prototype)
|
|
29
|
+
throw new TypeError('applicationGroups.names requires a dense array');
|
|
30
|
+
const array = options.names, length = Object.getOwnPropertyDescriptor(array, 'length').value;
|
|
31
|
+
if (Reflect.ownKeys(array).length !== length + 1)
|
|
32
|
+
throw new TypeError('applicationGroups.names requires a dense array');
|
|
33
|
+
const names = [], seen = new Set();
|
|
34
|
+
for (let i = 0; i < length; i++) {
|
|
35
|
+
const d = Object.getOwnPropertyDescriptor(array, String(i));
|
|
36
|
+
if (!d || !('value' in d))
|
|
37
|
+
throw new TypeError(`applicationGroups.names[${i}] requires data`);
|
|
38
|
+
const item = record(d.value, ['target', 'propertyName', 'typeName']);
|
|
39
|
+
if (typeof item.target !== 'string' || !item.target || seen.has(item.target))
|
|
40
|
+
throw new TypeError(`applicationGroups.names[${i}] requires a unique target`);
|
|
41
|
+
seen.add(item.target);
|
|
42
|
+
if (!Object.hasOwn(item, 'propertyName') && !Object.hasOwn(item, 'typeName'))
|
|
43
|
+
throw new TypeError(`applicationGroups.names[${i}] requires an override`);
|
|
44
|
+
if (Object.hasOwn(item, 'propertyName') && (typeof item.propertyName !== 'string' || !/^\$[a-z][A-Za-z0-9]*$/.test(item.propertyName) || metadata.has(item.propertyName)))
|
|
45
|
+
throw new TypeError(`applicationGroups.names[${i}] invalid propertyName`);
|
|
46
|
+
if (Object.hasOwn(item, 'typeName') && (typeof item.typeName !== 'string' || !/^[A-Za-z_][A-Za-z0-9_]*$/.test(item.typeName) || reserved.has(item.typeName)))
|
|
47
|
+
throw new TypeError(`applicationGroups.names[${i}] invalid typeName`);
|
|
48
|
+
names.push(item);
|
|
49
|
+
}
|
|
50
|
+
return { names };
|
|
51
|
+
}
|
|
52
|
+
/** Derive finite group definitions from exact qualified records; no caller inventory is trusted. */
|
|
53
|
+
export function planApplicationGroups(context, projection, options, checkpoint) {
|
|
54
|
+
const check = () => { checkpoint(); context.budget.chargeWork(16); };
|
|
55
|
+
const records = new Map(), targets = [], dispositions = [];
|
|
56
|
+
const overrides = new Map((options.names ?? []).map(item => [item.target, item]));
|
|
57
|
+
const recordSymbols = [];
|
|
58
|
+
const sourceTypes = context.members.flatMap(id => {
|
|
59
|
+
check();
|
|
60
|
+
const found = context.lookup(id);
|
|
61
|
+
if (found.kind === 'found' && found.node.kind === 'complexType')
|
|
62
|
+
recordSymbols.push(applicationRecordName(found.node.id));
|
|
63
|
+
return found.kind === 'found' && (found.node.kind === 'complexType' || found.node.kind === 'simpleType') && found.node.identity.kind === 'global' ? [found.node] : [];
|
|
64
|
+
});
|
|
65
|
+
// @why Injective source spelling keeps separate operation mappings consistent without a mutable service-wide allocator.
|
|
66
|
+
const sourceStem = (name) => [...name].map(c => /^[A-Za-z0-9]$/.test(c) ? c : '_u' + c.codePointAt(0).toString(16) + '_').join('');
|
|
67
|
+
const shape = (p) => {
|
|
68
|
+
check();
|
|
69
|
+
return [p.kind, p.occurs, p.element ? [p.element.name, p.element.type.kind === 'local' ? p.element.type.target : p.element.type.name] : null, p.children.map(shape)];
|
|
70
|
+
};
|
|
71
|
+
const stem = (record) => {
|
|
72
|
+
const id = record.type.identity;
|
|
73
|
+
if (id.kind === 'global') {
|
|
74
|
+
const base = sourceStem(id.name.local);
|
|
75
|
+
return sourceTypes.filter(t => t.identity.kind === 'global' && t.identity.name.local === id.name.local).length > 1 ? base + '_' + digest(id.name.namespace).slice(0, 8) : base;
|
|
76
|
+
}
|
|
77
|
+
const owner = context.lookup(id.owner);
|
|
78
|
+
const name = owner.kind === 'found' && 'name' in owner.node ? owner.node.name.local : 'Anonymous';
|
|
79
|
+
return sourceStem(name) + '___Anonymous_' + digest([id.owner, id.path]).slice(0, 16);
|
|
80
|
+
};
|
|
81
|
+
for (const record of projection.records) {
|
|
82
|
+
check();
|
|
83
|
+
const grammar = inspectProjectionGrammar(context, record), source = record.type.identity.kind === 'global'
|
|
84
|
+
? `{${record.type.identity.name.namespace}}${record.type.identity.name.local}` : record.type.id;
|
|
85
|
+
if (!grammar) {
|
|
86
|
+
dispositions.push({ source, disposition: 'compact', reason: 'ordinary-record' });
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
let reason = record.keyed || record.content !== 'element-only' || record.attributeWildcard ? 'mixed-open-or-keyed-owner' : '';
|
|
90
|
+
const nullable = (p) => grammar.bodyNullable(p);
|
|
91
|
+
const leaves = (p) => new Set(p.element ? [p.element.id] : p.children.flatMap(c => [...leaves(c)]));
|
|
92
|
+
const lengths = (p) => {
|
|
93
|
+
check();
|
|
94
|
+
const items = p.children.map(lengths);
|
|
95
|
+
const min = p.kind === 'element' ? 1n : p.kind === 'choice' ? items.reduce((a, b) => a < b[0] ? a : b[0], items[0]?.[0] ?? 0n) : items.reduce((a, b) => a + b[0], 0n);
|
|
96
|
+
const max = p.kind === 'element' ? 1n : items.some(x => x[1] === undefined) ? undefined : p.kind === 'choice' ? items.reduce((a, b) => a > b[1] ? a : b[1], 0n) : items.reduce((a, b) => a + b[1], 0n);
|
|
97
|
+
return [min * BigInt(p.occurs.min), max === undefined || p.occurs.max === 'unbounded' ? undefined : max * BigInt(p.occurs.max)];
|
|
98
|
+
};
|
|
99
|
+
const last = (n) => {
|
|
100
|
+
check();
|
|
101
|
+
if (n.element)
|
|
102
|
+
return leaves(n);
|
|
103
|
+
const result = new Set();
|
|
104
|
+
for (const child of [...n.children].reverse()) {
|
|
105
|
+
for (const key of last(child))
|
|
106
|
+
result.add(key);
|
|
107
|
+
if (n.kind === 'sequence' && !child.summary.nullable)
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
return result;
|
|
111
|
+
};
|
|
112
|
+
const hasDelimiter = (p, unit = false) => {
|
|
113
|
+
check();
|
|
114
|
+
if (!unit && (p.occurs.min === '0' || p.occurs.min !== p.occurs.max))
|
|
115
|
+
return false;
|
|
116
|
+
if (p.kind === 'element')
|
|
117
|
+
return true;
|
|
118
|
+
return p.kind === 'choice' ? p.children.every(child => hasDelimiter(child)) : p.children.some(child => hasDelimiter(child));
|
|
119
|
+
};
|
|
120
|
+
const partitionable = (p, unit = false) => {
|
|
121
|
+
check();
|
|
122
|
+
// @why Globally disjoint leaf sites make a mandatory fixed-count marker recover item boundaries even beside optional fields.
|
|
123
|
+
if (hasDelimiter(p, unit))
|
|
124
|
+
return true;
|
|
125
|
+
if (p.kind === 'choice' && (unit || p.occurs.min === '1' && p.occurs.max === '1'))
|
|
126
|
+
return p.children.every(child => partitionable(child));
|
|
127
|
+
const [min, max] = lengths(unit ? { ...p, occurs: { min: '1', max: '1' } } : p);
|
|
128
|
+
if (min === max)
|
|
129
|
+
return true;
|
|
130
|
+
const first = grammar.first(p), end = last(p);
|
|
131
|
+
return !record.slots.some(s => end.has(s.element.id) && first.includes(JSON.stringify([s.element.name.namespace, s.element.name.local])));
|
|
132
|
+
};
|
|
133
|
+
const eligible = (p) => {
|
|
134
|
+
check();
|
|
135
|
+
if (p.kind === 'any' || p.kind === 'all')
|
|
136
|
+
reason ||= 'retained-native-compositor';
|
|
137
|
+
if ((p.kind === 'choice' || p.kind === 'sequence' && (p.occurs.max !== '1' || p.occurs.min !== '1')) && nullable(p))
|
|
138
|
+
reason ||= 'empty-capable-group-body';
|
|
139
|
+
if (p.kind !== 'element' && p.occurs.max !== '1') {
|
|
140
|
+
// @why A variable-width body whose end can start another item cannot recover occurrence boundaries.
|
|
141
|
+
if (!partitionable(p, true))
|
|
142
|
+
reason ||= 'ambiguous-group-partition';
|
|
143
|
+
}
|
|
144
|
+
for (const child of p.children)
|
|
145
|
+
eligible(child);
|
|
146
|
+
};
|
|
147
|
+
eligible(grammar.view.root);
|
|
148
|
+
if (reason) {
|
|
149
|
+
dispositions.push({ source, disposition: 'retained-ordered', reason });
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
const guard = digest(shape(grammar.view.root));
|
|
153
|
+
const target = (p, role, typeName, propertyName, parent) => {
|
|
154
|
+
const token = 'ag1:' + digest([record.type.id, p.source, p.origins, role, parent ?? null, guard, shape(p)]);
|
|
155
|
+
const defaults = { ...(propertyName ? { propertyName } : {}), typeName }, alias = overrides.get(token);
|
|
156
|
+
if (role === 'alternative' && alias?.propertyName !== undefined)
|
|
157
|
+
throw new TypeError(`applicationGroups target ${token} alternative ${source} does not support propertyName`);
|
|
158
|
+
const found = context.lookup(p.source), site = found.kind === 'found' && found.node.identity.kind === 'scoped' ? found.node.identity.path : p.source;
|
|
159
|
+
const item = { target: token, role, source: `${source} ${role} ${site}`, defaults, resolved: { ...defaults } };
|
|
160
|
+
targets.push(item);
|
|
161
|
+
return item;
|
|
162
|
+
};
|
|
163
|
+
const object = (p, contextStem, nested = false) => {
|
|
164
|
+
const counters = { choice: 0, sequence: 0 };
|
|
165
|
+
const visit = (p) => {
|
|
166
|
+
check();
|
|
167
|
+
if (p.kind === 'element')
|
|
168
|
+
return { particle: p, children: [], slot: grammar.slot(JSON.stringify([p.element.name.namespace, p.element.name.local])) };
|
|
169
|
+
const role = p.kind === 'choice' ? 'choice' : p.occurs.max !== '1' || p.occurs.min !== '1' ? 'sequence' : undefined;
|
|
170
|
+
if (!role)
|
|
171
|
+
return { particle: p, children: p.children.map(visit) };
|
|
172
|
+
const index = ++counters[role], suffix = index === 1 ? '' : String(index);
|
|
173
|
+
const title = role === 'choice' ? 'Choice' : 'Sequence';
|
|
174
|
+
const name = contextStem + (nested ? '___' : '') + title + suffix;
|
|
175
|
+
const own = target(p, role, name, '$' + role + suffix);
|
|
176
|
+
if (role === 'choice') {
|
|
177
|
+
const alternatives = p.children.map((child, i) => target(child, 'alternative', name + 'Alternative' + (i + 1), undefined, own.target));
|
|
178
|
+
return { particle: p, target: own, alternatives, children: p.children.map((child, i) => object(child, alternatives[i].defaults.typeName, true)) };
|
|
179
|
+
}
|
|
180
|
+
return { particle: p, target: own, children: object({ ...p, occurs: { min: '1', max: '1' } }, name, true).children };
|
|
181
|
+
};
|
|
182
|
+
// @why An alternative's own occurrence belongs to the alternative, not to a second wrapper around it.
|
|
183
|
+
return { particle: p, children: p.kind === 'sequence' && p.occurs.min === '1' && p.occurs.max === '1' ? p.children.map(visit) : [visit(p)] };
|
|
184
|
+
};
|
|
185
|
+
const root = grammar.view.root;
|
|
186
|
+
const wrapper = root.kind === 'choice' || root.occurs.max !== '1' || root.occurs.min !== '1'
|
|
187
|
+
? object({ ...root, kind: 'sequence', occurs: { min: '1', max: '1' }, children: [root] }, stem(record)) : object(root, stem(record));
|
|
188
|
+
records.set(record.type.id, wrapper);
|
|
189
|
+
dispositions.push({ source, disposition: 'grouped', reason: 'observable-nonempty-particle-boundaries' });
|
|
190
|
+
}
|
|
191
|
+
// @why Default collisions use identity suffixes; explicit collisions must never silently change requested names.
|
|
192
|
+
const used = new Map();
|
|
193
|
+
for (const name of ['Request', 'Response', 'Usage', 'Name', 'Options', 'Failure', 'NativeSuccess', 'Runtime', 'Common', 'Result', 'ApplicationOpenValue',
|
|
194
|
+
...Array.from({ length: projection.records.length + 1 }, (_, i) => 'Fault_' + i)])
|
|
195
|
+
used.set(name, 'generated-client');
|
|
196
|
+
for (const type of sourceTypes)
|
|
197
|
+
if (type.identity.kind === 'global')
|
|
198
|
+
used.set(type.identity.name.local, type.id);
|
|
199
|
+
for (const name of recordSymbols)
|
|
200
|
+
used.set(name, 'source-record');
|
|
201
|
+
for (const item of targets) {
|
|
202
|
+
let name = item.defaults.typeName;
|
|
203
|
+
if (used.has(name) && used.get(name) !== item.target) {
|
|
204
|
+
name += '_' + item.target.slice(4, 16);
|
|
205
|
+
item.defaults.typeName = name;
|
|
206
|
+
}
|
|
207
|
+
item.resolved.typeName = name;
|
|
208
|
+
used.set(name, item.target);
|
|
209
|
+
}
|
|
210
|
+
for (const item of targets) {
|
|
211
|
+
const alias = overrides.get(item.target);
|
|
212
|
+
if (alias?.typeName && (/^Fault_[0-9]+$/.test(alias.typeName) || used.has(alias.typeName) && used.get(alias.typeName) !== item.target))
|
|
213
|
+
throw new TypeError(`applicationGroups target ${item.target} ${item.source}: typeName collision ${alias.typeName}`);
|
|
214
|
+
if (alias?.typeName) {
|
|
215
|
+
used.set(alias.typeName, item.target);
|
|
216
|
+
item.resolved.typeName = alias.typeName;
|
|
217
|
+
}
|
|
218
|
+
if (alias?.propertyName)
|
|
219
|
+
item.resolved.propertyName = alias.propertyName;
|
|
220
|
+
}
|
|
221
|
+
const properties = (node, keys) => {
|
|
222
|
+
if (node.slot) {
|
|
223
|
+
keys.add(node.slot.element.name.local);
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
if (!node.target) {
|
|
227
|
+
for (const child of node.children)
|
|
228
|
+
properties(child, keys);
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
const key = node.target.resolved.propertyName;
|
|
232
|
+
if (keys.has(key))
|
|
233
|
+
throw new TypeError(`applicationGroups target ${node.target.target}: propertyName collision ${key}`);
|
|
234
|
+
keys.add(key);
|
|
235
|
+
if (node.alternatives)
|
|
236
|
+
for (const child of node.children)
|
|
237
|
+
properties(child, new Set());
|
|
238
|
+
else {
|
|
239
|
+
const bodyKeys = new Set();
|
|
240
|
+
for (const child of node.children)
|
|
241
|
+
properties(child, bodyKeys);
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
for (const node of records.values())
|
|
245
|
+
properties(node, new Set());
|
|
246
|
+
return deepFreeze({ records: Object.fromEntries(records), targets, dispositions });
|
|
247
|
+
}
|
|
248
|
+
export class ApplicationGroupValueError extends Error {
|
|
249
|
+
}
|
|
250
|
+
/** Convert owned data between grouped and existing ordered values without adding XML wrappers.
|
|
251
|
+
* @constraints Input must first pass the bounded data-only owner; recursive calls are depth-limited.
|
|
252
|
+
*/
|
|
253
|
+
export function mapApplicationGroups(plan, projection, input, direction, check) {
|
|
254
|
+
const records = new Map(projection.records.map(r => [r.type.id, r]));
|
|
255
|
+
const fail = (reason) => { throw new ApplicationGroupValueError(reason); };
|
|
256
|
+
const object = (value) => value && typeof value === 'object' && !Array.isArray(value) ? value : fail('group-object-required');
|
|
257
|
+
const bounds = (n, p) => {
|
|
258
|
+
if (BigInt(n) < BigInt(p.occurs.min) || p.occurs.max !== 'unbounded' && BigInt(n) > BigInt(p.occurs.max))
|
|
259
|
+
fail('group-occurrence-bound');
|
|
260
|
+
};
|
|
261
|
+
const value = (v, shape, depth) => {
|
|
262
|
+
check();
|
|
263
|
+
if (depth > 200)
|
|
264
|
+
fail('application-group-depth-limit');
|
|
265
|
+
if (shape.kind !== 'record')
|
|
266
|
+
return v;
|
|
267
|
+
const record = records.get(shape.type), data = object(v), result = { ...data };
|
|
268
|
+
if (data.$nil === true)
|
|
269
|
+
return result;
|
|
270
|
+
const group = plan.records[shape.type];
|
|
271
|
+
const child = (v, slot) => value(v, slot.value, depth + 1);
|
|
272
|
+
if (!group) {
|
|
273
|
+
if (record.ordered && Array.isArray(data.$content))
|
|
274
|
+
result.$content = data.$content.map((entry, index) => {
|
|
275
|
+
const item = object(entry);
|
|
276
|
+
const slot = record.keyed ? record.fixedOrder ? record.slots[index] : record.slots.find(s => {
|
|
277
|
+
const v = item[s.element.name.local];
|
|
278
|
+
return Object.hasOwn(item, s.element.name.local) && (!v || typeof v !== 'object' || !Object.hasOwn(v, '$namespace')
|
|
279
|
+
|| v.$namespace === s.element.name.namespace);
|
|
280
|
+
}) : record.slots.find(s => JSON.stringify(s.element.name) === JSON.stringify(item.name));
|
|
281
|
+
if (!slot)
|
|
282
|
+
return entry;
|
|
283
|
+
return record.keyed ? { [slot.element.name.local]: child(item[slot.element.name.local], slot) } : { ...item, value: child(item.value, slot) };
|
|
284
|
+
});
|
|
285
|
+
else
|
|
286
|
+
for (const slot of record.slots)
|
|
287
|
+
if (Object.hasOwn(data, slot.element.name.local)) {
|
|
288
|
+
const v = data[slot.element.name.local];
|
|
289
|
+
result[slot.element.name.local] = Array.isArray(v) && slot.particle.occurs.max !== '1' ? v.map(v => child(v, slot)) : child(v, slot);
|
|
290
|
+
}
|
|
291
|
+
return result;
|
|
292
|
+
}
|
|
293
|
+
const entries = direction === 'from-native' ? data.$content : [];
|
|
294
|
+
let cursor = 0;
|
|
295
|
+
const first = (n) => n.slot ? new Set([n.slot.element.name.local]) : new Set(n.children.flatMap(c => [...first(c)]));
|
|
296
|
+
const starts = (n) => entries[cursor] && first(n).has(entries[cursor].name.local);
|
|
297
|
+
const encodeObject = (nodes, data, extra = []) => {
|
|
298
|
+
const keys = new Set(extra);
|
|
299
|
+
const encode = (n) => {
|
|
300
|
+
check();
|
|
301
|
+
if (n.slot) {
|
|
302
|
+
const key = n.slot.element.name.local;
|
|
303
|
+
keys.add(key);
|
|
304
|
+
const present = Object.hasOwn(data, key), v = data[key];
|
|
305
|
+
const list = !present ? [] : n.particle.occurs.max !== '1' ? Array.isArray(v) ? v : fail('group-leaf-array-required') : [v];
|
|
306
|
+
bounds(list.length, n.particle);
|
|
307
|
+
for (const item of list)
|
|
308
|
+
entries.push({ name: n.slot.element.name, value: child(item, n.slot) });
|
|
309
|
+
}
|
|
310
|
+
else if (!n.target)
|
|
311
|
+
for (const c of n.children)
|
|
312
|
+
encode(c);
|
|
313
|
+
else {
|
|
314
|
+
const key = n.target.resolved.propertyName;
|
|
315
|
+
keys.add(key);
|
|
316
|
+
const v = data[key], list = !Object.hasOwn(data, key) ? [] : n.particle.occurs.max !== '1' ? Array.isArray(v) ? v : fail('group-array-required') : [v];
|
|
317
|
+
bounds(list.length, n.particle);
|
|
318
|
+
for (const item of list) {
|
|
319
|
+
const body = object(item);
|
|
320
|
+
if (n.particle.kind === 'choice') {
|
|
321
|
+
// @why Disjoint native leaf alphabets select one branch; full body validation still rejects partial or mixed branches.
|
|
322
|
+
const candidates = n.children.filter(c => hasSelection(c, body));
|
|
323
|
+
if (candidates.length !== 1)
|
|
324
|
+
fail('group-choice-branch');
|
|
325
|
+
encodeObject(candidates[0].children, body);
|
|
326
|
+
}
|
|
327
|
+
else
|
|
328
|
+
encodeObject(n.children, body);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
for (const n of nodes)
|
|
333
|
+
encode(n);
|
|
334
|
+
if (Object.keys(data).some(k => !keys.has(k)))
|
|
335
|
+
fail('unknown-application-group-key');
|
|
336
|
+
};
|
|
337
|
+
const hasSelection = (node, data) => {
|
|
338
|
+
check();
|
|
339
|
+
if (node.slot)
|
|
340
|
+
return Object.hasOwn(data, node.slot.element.name.local);
|
|
341
|
+
if (!node.target)
|
|
342
|
+
return node.children.some(child => hasSelection(child, data));
|
|
343
|
+
const key = node.target.resolved.propertyName;
|
|
344
|
+
if (!Object.hasOwn(data, key))
|
|
345
|
+
return false;
|
|
346
|
+
const member = data[key], items = node.particle.occurs.max === '1' ? [member] : Array.isArray(member) ? member : [];
|
|
347
|
+
// @why Synthetic keys may be equal in different alternatives; only disjoint native leaf sites identify a branch.
|
|
348
|
+
return items.some(item => !!item && typeof item === 'object' && !Array.isArray(item)
|
|
349
|
+
&& node.children.some(child => hasSelection(child, item)));
|
|
350
|
+
};
|
|
351
|
+
const decodeObject = (nodes) => {
|
|
352
|
+
const out = Object.create(null);
|
|
353
|
+
const decode = (n) => {
|
|
354
|
+
check();
|
|
355
|
+
if (n.slot) {
|
|
356
|
+
const items = [];
|
|
357
|
+
while (entries[cursor]?.name.local === n.slot.element.name.local && (n.particle.occurs.max === 'unbounded' || BigInt(items.length) < BigInt(n.particle.occurs.max)))
|
|
358
|
+
items.push(child(entries[cursor++].value, n.slot));
|
|
359
|
+
bounds(items.length, n.particle);
|
|
360
|
+
if (items.length || n.particle.occurs.max !== '1' && n.particle.occurs.min !== '0')
|
|
361
|
+
out[n.slot.element.name.local] = n.particle.occurs.max !== '1' ? items : items[0];
|
|
362
|
+
}
|
|
363
|
+
else if (!n.target)
|
|
364
|
+
for (const c of n.children)
|
|
365
|
+
decode(c);
|
|
366
|
+
else {
|
|
367
|
+
const items = [];
|
|
368
|
+
while (starts(n) && (n.particle.occurs.max === 'unbounded' || BigInt(items.length) < BigInt(n.particle.occurs.max))) {
|
|
369
|
+
const before = cursor;
|
|
370
|
+
const branch = n.particle.kind === 'choice' ? n.children.find(starts) : undefined;
|
|
371
|
+
items.push(decodeObject(branch ? branch.children : n.children));
|
|
372
|
+
if (cursor === before)
|
|
373
|
+
fail('zero-width-application-group');
|
|
374
|
+
}
|
|
375
|
+
bounds(items.length, n.particle);
|
|
376
|
+
if (items.length)
|
|
377
|
+
out[n.target.resolved.propertyName] = n.particle.occurs.max !== '1' ? items : items[0];
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
for (const n of nodes)
|
|
381
|
+
decode(n);
|
|
382
|
+
return out;
|
|
383
|
+
};
|
|
384
|
+
const extras = [...record.attributes.filter(a => !a.bag).map(a => a.declaration.name.local), ...(record.attributes.some(a => a.bag) ? ['$attributes'] : []),
|
|
385
|
+
...(record.contextual ? ['$namespaces'] : []), ...(Object.hasOwn(data, '$namespace') ? ['$namespace'] : [])];
|
|
386
|
+
if (direction === 'to-native') {
|
|
387
|
+
encodeObject(group.children, data, extras);
|
|
388
|
+
for (const key of Object.keys(result))
|
|
389
|
+
if (!extras.includes(key))
|
|
390
|
+
delete result[key];
|
|
391
|
+
result.$content = entries;
|
|
392
|
+
}
|
|
393
|
+
else {
|
|
394
|
+
delete result.$content;
|
|
395
|
+
// @why Source fields are own data: assignment to __proto__ would invoke an inherited setter and discard the field.
|
|
396
|
+
Object.defineProperties(result, Object.getOwnPropertyDescriptors(decodeObject(group.children)));
|
|
397
|
+
if (cursor !== entries.length)
|
|
398
|
+
fail('group-particle-language');
|
|
399
|
+
}
|
|
400
|
+
return result;
|
|
401
|
+
};
|
|
402
|
+
return value(input, projection.root, 0);
|
|
403
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SchemaInput } from "../loader/schemaInput.js";
|
|
2
|
+
import type { CanonicalGraph } from "./canonicalGraph.js";
|
|
3
|
+
export declare function buildCanonicalGraph(input: SchemaInput, options?: {
|
|
4
|
+
maxNodes?: number;
|
|
5
|
+
requestBudget?: import("./semanticBudget.js").SemanticBudget;
|
|
6
|
+
}): CanonicalGraph;
|