@techspokes/typescript-wsdl-client 1.1.4 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +81 -35
- package/dist/app/generateApp.d.ts +0 -1
- package/dist/app/generateApp.js +8 -6
- package/dist/app/generateCheckedApp.d.ts +38 -0
- package/dist/app/generateCheckedApp.js +108 -0
- package/dist/checkedPipeline.d.ts +155 -0
- package/dist/checkedPipeline.js +448 -0
- package/dist/checkedPlanning.d.ts +123 -0
- package/dist/checkedPlanning.js +245 -0
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +123 -5
- package/dist/client/checkedDirectRuntime.d.ts +96 -0
- package/dist/client/checkedDirectRuntime.js +43 -0
- package/dist/client/directClientRuntime.d.ts +74 -0
- package/dist/client/directClientRuntime.js +165 -0
- package/dist/client/directClientVersion.d.ts +6 -0
- package/dist/client/directClientVersion.js +6 -0
- package/dist/client/generateClient.d.ts +0 -1
- package/dist/client/generateClient.js +26 -12
- package/dist/client/generateDirectClient.d.ts +32 -0
- package/dist/client/generateDirectClient.js +268 -0
- package/dist/client/generateOperations.d.ts +0 -1
- package/dist/client/generateTypes.d.ts +0 -1
- package/dist/client/generateUtils.d.ts +0 -1
- package/dist/client/generateUtils.js +3 -1
- package/dist/compiler/applicationGroups.d.ts +53 -0
- package/dist/compiler/applicationGroups.js +403 -0
- package/dist/compiler/buildCanonicalGraph.d.ts +6 -0
- package/dist/compiler/buildCanonicalGraph.js +381 -0
- package/dist/compiler/canonicalGraph.d.ts +197 -0
- package/dist/compiler/canonicalGraph.js +37 -0
- package/dist/compiler/catalogErrors.d.ts +17 -0
- package/dist/compiler/catalogErrors.js +86 -0
- package/dist/compiler/catalogProvenance.d.ts +14 -0
- package/dist/compiler/catalogProvenance.js +229 -0
- package/dist/compiler/checkedAssessment.d.ts +90 -0
- package/dist/compiler/checkedAssessment.js +300 -0
- package/dist/compiler/checkedComponentSource.d.ts +16 -0
- package/dist/compiler/checkedComponentSource.js +31 -0
- package/dist/compiler/checkedSourcePreparation.d.ts +72 -0
- package/dist/compiler/checkedSourcePreparation.js +202 -0
- package/dist/compiler/complexTypeContent.d.ts +58 -0
- package/dist/compiler/complexTypeContent.js +558 -0
- package/dist/compiler/componentCorrespondence.d.ts +32 -0
- package/dist/compiler/componentCorrespondence.js +140 -0
- package/dist/compiler/componentRecordProjection.d.ts +109 -0
- package/dist/compiler/componentRecordProjection.js +319 -0
- package/dist/compiler/componentSoapPreparation.d.ts +20 -0
- package/dist/compiler/componentSoapPreparation.js +36 -0
- package/dist/compiler/composeCanonicalGraph.d.ts +68 -0
- package/dist/compiler/composeCanonicalGraph.js +252 -0
- package/dist/compiler/dataOwnership.d.ts +21 -0
- package/dist/compiler/dataOwnership.js +167 -0
- package/dist/compiler/datatypeValues.d.ts +46 -0
- package/dist/compiler/datatypeValues.js +275 -0
- package/dist/compiler/directCodec.d.ts +116 -0
- package/dist/compiler/directCodec.js +377 -0
- package/dist/compiler/directExecutionPolicy.d.ts +9 -0
- package/dist/compiler/directExecutionPolicy.js +17 -0
- package/dist/compiler/directOperation.d.ts +114 -0
- package/dist/compiler/directOperation.js +373 -0
- package/dist/compiler/directSoap.d.ts +66 -0
- package/dist/compiler/directSoap.js +391 -0
- package/dist/compiler/directSoapSource.d.ts +38 -0
- package/dist/compiler/directSoapSource.js +233 -0
- package/dist/compiler/directSourceCapsule.d.ts +169 -0
- package/dist/compiler/directSourceCapsule.js +727 -0
- package/dist/compiler/directStructure.d.ts +128 -0
- package/dist/compiler/directStructure.js +543 -0
- package/dist/compiler/directStructurePlan.d.ts +149 -0
- package/dist/compiler/directStructurePlan.js +623 -0
- package/dist/compiler/directValues.d.ts +128 -0
- package/dist/compiler/directValues.js +1116 -0
- package/dist/compiler/finiteRe01Construction.d.ts +69 -0
- package/dist/compiler/finiteRe01Construction.js +422 -0
- package/dist/compiler/finiteRe01Verification.d.ts +218 -0
- package/dist/compiler/finiteRe01Verification.js +1217 -0
- package/dist/compiler/generateCatalog.d.ts +0 -1
- package/dist/compiler/graphTraversal.d.ts +10 -0
- package/dist/compiler/graphTraversal.js +37 -0
- package/dist/compiler/hypotheticalScopedIdentity.d.ts +22 -0
- package/dist/compiler/hypotheticalScopedIdentity.js +81 -0
- package/dist/compiler/occurrenceAnalysis.d.ts +66 -0
- package/dist/compiler/occurrenceAnalysis.js +316 -0
- package/dist/compiler/originalSourceMembership.d.ts +5 -0
- package/dist/compiler/originalSourceMembership.js +31 -0
- package/dist/compiler/particleAttribution.d.ts +16 -0
- package/dist/compiler/particleAttribution.js +494 -0
- package/dist/compiler/particleDeclarationConsistency.d.ts +23 -0
- package/dist/compiler/particleDeclarationConsistency.js +206 -0
- package/dist/compiler/particleExtension.d.ts +21 -0
- package/dist/compiler/particleExtension.js +123 -0
- package/dist/compiler/particleLocalAssessment.d.ts +19 -0
- package/dist/compiler/particleLocalAssessment.js +92 -0
- package/dist/compiler/particleRestriction.d.ts +23 -0
- package/dist/compiler/particleRestriction.js +494 -0
- package/dist/compiler/particleSemanticView.d.ts +51 -0
- package/dist/compiler/particleSemanticView.js +310 -0
- package/dist/compiler/particleWildcardRelation.d.ts +87 -0
- package/dist/compiler/particleWildcardRelation.js +143 -0
- package/dist/compiler/projectionScalar.d.ts +32 -0
- package/dist/compiler/projectionScalar.js +184 -0
- package/dist/compiler/re01CandidateAssignments.d.ts +95 -0
- package/dist/compiler/re01CandidateAssignments.js +341 -0
- package/dist/compiler/re01CandidateCorrespondence.d.ts +85 -0
- package/dist/compiler/re01CandidateCorrespondence.js +701 -0
- package/dist/compiler/re01TypeProperties.d.ts +70 -0
- package/dist/compiler/re01TypeProperties.js +120 -0
- package/dist/compiler/re01TypePropertyValidation.d.ts +22 -0
- package/dist/compiler/re01TypePropertyValidation.js +161 -0
- package/dist/compiler/resolveCanonicalGraph.d.ts +41 -0
- package/dist/compiler/resolveCanonicalGraph.js +240 -0
- package/dist/compiler/scalarSchemaAssessment.d.ts +424 -0
- package/dist/compiler/scalarSchemaAssessment.js +5198 -0
- package/dist/compiler/schemaAttributeGroupProperties.d.ts +16 -0
- package/dist/compiler/schemaAttributeGroupProperties.js +53 -0
- package/dist/compiler/schemaAttributeProperties.d.ts +9 -0
- package/dist/compiler/schemaAttributeProperties.js +11 -0
- package/dist/compiler/schemaAttributeUses.d.ts +110 -0
- package/dist/compiler/schemaAttributeUses.js +798 -0
- package/dist/compiler/schemaBinaryWordReconstruction.d.ts +9 -0
- package/dist/compiler/schemaBinaryWordReconstruction.js +33 -0
- package/dist/compiler/schemaBuiltinFacets.d.ts +13 -0
- package/dist/compiler/schemaBuiltinFacets.js +51 -0
- package/dist/compiler/schemaCalendarImages.d.ts +7 -0
- package/dist/compiler/schemaCalendarImages.js +204 -0
- package/dist/compiler/schemaCalendarLanguage.d.ts +10 -0
- package/dist/compiler/schemaCalendarLanguage.js +227 -0
- package/dist/compiler/schemaCompiler.d.ts +0 -1
- package/dist/compiler/schemaComponentEquality.d.ts +27 -0
- package/dist/compiler/schemaComponentEquality.js +446 -0
- package/dist/compiler/schemaConstructionAssessment.d.ts +79 -0
- package/dist/compiler/schemaConstructionAssessment.js +745 -0
- package/dist/compiler/schemaDatatypeValues.d.ts +3 -0
- package/dist/compiler/schemaDatatypeValues.js +2 -0
- package/dist/compiler/schemaDecimalLanguage.d.ts +6 -0
- package/dist/compiler/schemaDecimalLanguage.js +102 -0
- package/dist/compiler/schemaDeclarationPrimitives.d.ts +39 -0
- package/dist/compiler/schemaDeclarationPrimitives.js +211 -0
- package/dist/compiler/schemaDocumentSyntax.d.ts +54 -0
- package/dist/compiler/schemaDocumentSyntax.js +294 -0
- package/dist/compiler/schemaDurationLanguage.d.ts +10 -0
- package/dist/compiler/schemaDurationLanguage.js +170 -0
- package/dist/compiler/schemaElementInstance.d.ts +30 -0
- package/dist/compiler/schemaElementInstance.js +45 -0
- package/dist/compiler/schemaElementProperties.d.ts +15 -0
- package/dist/compiler/schemaElementProperties.js +23 -0
- package/dist/compiler/schemaEndpointWordCapacity.d.ts +35 -0
- package/dist/compiler/schemaEndpointWordCapacity.js +39 -0
- package/dist/compiler/schemaExactCalendar.d.ts +72 -0
- package/dist/compiler/schemaExactCalendar.js +264 -0
- package/dist/compiler/schemaFacetAnnotation.d.ts +31 -0
- package/dist/compiler/schemaFacetAnnotation.js +199 -0
- package/dist/compiler/schemaGeneratedScalarShape.d.ts +34 -0
- package/dist/compiler/schemaGeneratedScalarShape.js +178 -0
- package/dist/compiler/schemaIdentityConstraints.d.ts +72 -0
- package/dist/compiler/schemaIdentityConstraints.js +362 -0
- package/dist/compiler/schemaIeeeLanguage.d.ts +42 -0
- package/dist/compiler/schemaIeeeLanguage.js +759 -0
- package/dist/compiler/schemaIntegerImages.d.ts +10 -0
- package/dist/compiler/schemaIntegerImages.js +113 -0
- package/dist/compiler/schemaLexicalPredicates.d.ts +28 -0
- package/dist/compiler/schemaLexicalPredicates.js +63 -0
- package/dist/compiler/schemaNotationProperties.d.ts +31 -0
- package/dist/compiler/schemaNotationProperties.js +84 -0
- package/dist/compiler/schemaNumericImageConditions.d.ts +23 -0
- package/dist/compiler/schemaNumericImageConditions.js +66 -0
- package/dist/compiler/schemaParticleWildcardProperties.d.ts +19 -0
- package/dist/compiler/schemaParticleWildcardProperties.js +43 -0
- package/dist/compiler/schemaPattern.d.ts +1061 -0
- package/dist/compiler/schemaPattern.js +581 -0
- package/dist/compiler/schemaRegularLanguage.d.ts +66 -0
- package/dist/compiler/schemaRegularLanguage.js +1166 -0
- package/dist/compiler/schemaScalarContext.d.ts +85 -0
- package/dist/compiler/schemaScalarContext.js +78 -0
- package/dist/compiler/schemaScalarKernel.d.ts +181 -0
- package/dist/compiler/schemaScalarKernel.js +391 -0
- package/dist/compiler/schemaScalarWitnesses.d.ts +5 -0
- package/dist/compiler/schemaScalarWitnesses.js +118 -0
- package/dist/compiler/schemaSimpleTypeProperties.d.ts +94 -0
- package/dist/compiler/schemaSimpleTypeProperties.js +103 -0
- package/dist/compiler/schemaSourceGrammar.d.ts +26 -0
- package/dist/compiler/schemaSourceGrammar.js +290 -0
- package/dist/compiler/schemaSourceLexical.d.ts +3 -0
- package/dist/compiler/schemaSourceLexical.js +12 -0
- package/dist/compiler/schemaSourceValues.d.ts +50 -0
- package/dist/compiler/schemaSourceValues.js +225 -0
- package/dist/compiler/schemaSourceWildcards.d.ts +27 -0
- package/dist/compiler/schemaSourceWildcards.js +249 -0
- package/dist/compiler/schemaSymbolicSequences.d.ts +15 -0
- package/dist/compiler/schemaSymbolicSequences.js +99 -0
- package/dist/compiler/schemaSymbolicValueSets.d.ts +31 -0
- package/dist/compiler/schemaSymbolicValueSets.js +149 -0
- package/dist/compiler/schemaSyntaxAssessment.d.ts +24 -0
- package/dist/compiler/schemaSyntaxAssessment.js +361 -0
- package/dist/compiler/schemaTemporalAliases.d.ts +5 -0
- package/dist/compiler/schemaTemporalAliases.js +195 -0
- package/dist/compiler/schemaTokenImages.d.ts +8 -0
- package/dist/compiler/schemaTokenImages.js +142 -0
- package/dist/compiler/schemaTypeIdentity.d.ts +38 -0
- package/dist/compiler/schemaTypeIdentity.js +80 -0
- package/dist/compiler/schemaTypeRelations.d.ts +37 -0
- package/dist/compiler/schemaTypeRelations.js +576 -0
- package/dist/compiler/schemaUri.d.ts +12 -0
- package/dist/compiler/schemaUri.js +103 -0
- package/dist/compiler/schemaValueContext.d.ts +25 -0
- package/dist/compiler/schemaValueContext.js +1 -0
- package/dist/compiler/schemaValueImages.d.ts +9 -0
- package/dist/compiler/schemaValueImages.js +142 -0
- package/dist/compiler/schemaValueSequences.d.ts +14 -0
- package/dist/compiler/schemaValueSequences.js +19 -0
- package/dist/compiler/semanticBudget.d.ts +67 -0
- package/dist/compiler/semanticBudget.js +193 -0
- package/dist/compiler/semanticCatalog.d.ts +121 -0
- package/dist/compiler/semanticCatalog.js +160 -0
- package/dist/compiler/semanticContext.d.ts +183 -0
- package/dist/compiler/semanticContext.js +1207 -0
- package/dist/compiler/semanticTypeDependencies.d.ts +7 -0
- package/dist/compiler/semanticTypeDependencies.js +64 -0
- package/dist/compiler/semanticTypeReference.d.ts +23 -0
- package/dist/compiler/semanticTypeReference.js +36 -0
- package/dist/compiler/shapeResolver.d.ts +1 -1
- package/dist/compiler/shapeResolver.js +7 -9
- package/dist/compiler/soapHeaders.d.ts +16 -0
- package/dist/compiler/soapHeaders.js +42 -0
- package/dist/compiler/sourceSchemaBinding.d.ts +25 -0
- package/dist/compiler/sourceSchemaBinding.js +39 -0
- package/dist/compiler/standardSchemaComponents.d.ts +71 -0
- package/dist/compiler/standardSchemaComponents.js +74 -0
- package/dist/compiler/standardSchemaConstruction.d.ts +20 -0
- package/dist/compiler/standardSchemaConstruction.js +34 -0
- package/dist/compiler/structuralCompanions.d.ts +15 -0
- package/dist/compiler/structuralCompanions.js +232 -0
- package/dist/compiler/validateSemanticGraph.d.ts +4 -0
- package/dist/compiler/validateSemanticGraph.js +376 -0
- package/dist/compiler/wildcardAlgebra.d.ts +25 -0
- package/dist/compiler/wildcardAlgebra.js +155 -0
- package/dist/compiler/wsdlPolicyRequirements.d.ts +43 -0
- package/dist/compiler/wsdlPolicyRequirements.js +239 -0
- package/dist/config.d.ts +0 -1
- package/dist/gateway/generateCheckedGateway.d.ts +32 -0
- package/dist/gateway/generateCheckedGateway.js +293 -0
- package/dist/gateway/generateGateway.d.ts +0 -1
- package/dist/gateway/generateGateway.js +2 -2
- package/dist/gateway/generators.d.ts +0 -1
- package/dist/gateway/helpers.d.ts +0 -1
- package/dist/generation/componentShape.d.ts +14 -0
- package/dist/generation/componentShape.js +269 -0
- package/dist/generation/preamble.d.ts +0 -1
- package/dist/generation/sourceLayout.d.ts +13 -0
- package/dist/generation/sourceLayout.js +40 -0
- package/dist/generation/writeGeneratedSource.d.ts +0 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +3 -0
- package/dist/loader/fetch.d.ts +0 -1
- package/dist/loader/orderedSyntax.d.ts +84 -0
- package/dist/loader/orderedSyntax.js +222 -0
- package/dist/loader/resolutionDepth.d.ts +6 -0
- package/dist/loader/resolutionDepth.js +65 -0
- package/dist/loader/schemaInput.d.ts +80 -0
- package/dist/loader/schemaInput.js +249 -0
- package/dist/loader/schemaResources.d.ts +60 -0
- package/dist/loader/schemaResources.js +333 -0
- package/dist/loader/wsdlLoader.d.ts +0 -1
- package/dist/openapi/casing.d.ts +0 -1
- package/dist/openapi/generateOpenAPI.d.ts +0 -1
- package/dist/openapi/generateOpenAPI.js +2 -2
- package/dist/openapi/generatePaths.d.ts +0 -1
- package/dist/openapi/generateSchemas.d.ts +0 -1
- package/dist/openapi/security.d.ts +0 -1
- package/dist/pipeline.d.ts +6 -2
- package/dist/pipeline.js +13 -0
- package/dist/test/generateCheckedTests.d.ts +17 -0
- package/dist/test/generateCheckedTests.js +60 -0
- package/dist/test/generateTests.d.ts +0 -1
- package/dist/test/generateTests.js +2 -2
- package/dist/test/generators.d.ts +0 -1
- package/dist/test/mockData.d.ts +0 -1
- package/dist/test/mockData.js +20 -14
- package/dist/util/attributeWildcards.d.ts +0 -1
- package/dist/util/builder.d.ts +0 -1
- package/dist/util/catalogMeta.d.ts +0 -1
- package/dist/util/checkedCliDiagnostics.d.ts +11 -0
- package/dist/util/checkedCliDiagnostics.js +22 -0
- package/dist/util/cli.d.ts +0 -1
- package/dist/util/errors.d.ts +0 -1
- package/dist/util/imports.d.ts +0 -1
- package/dist/util/runtimeSource.d.ts +0 -1
- package/dist/util/runtimeSource.js +3 -5
- package/dist/util/securityConfig.d.ts +0 -1
- package/dist/util/streamConfig.d.ts +0 -1
- package/dist/util/tools.d.ts +0 -1
- package/dist/util/xmlWhitespace.d.ts +2 -0
- package/dist/util/xmlWhitespace.js +4 -0
- package/dist/xsd/primitives.d.ts +0 -1
- package/docs/agent-skill.md +2 -0
- package/docs/api-reference.md +1 -1
- package/docs/checked-gateway.md +210 -0
- package/docs/checked-generation.md +161 -0
- package/docs/cli-reference.md +43 -1
- package/docs/concepts.md +136 -1
- package/docs/configuration.md +5 -1
- package/docs/corpus.md +33 -0
- package/docs/direct-values.md +311 -0
- package/docs/examples/checked-forecast.wsdl +19 -0
- package/docs/gateway-guide.md +1 -1
- package/docs/generated-code.md +10 -5
- package/docs/mapping-contract.md +114 -0
- package/docs/migration-playbook.md +1 -1
- package/docs/output-anatomy.md +1 -1
- package/docs/start-here.md +8 -2
- package/docs/supported-patterns.md +17 -5
- package/docs/testing.md +117 -31
- package/llms.txt +7 -7
- package/package.json +79 -25
- package/src/generation/preambles/direct-client/typescript.preamble +3 -0
- package/src/runtime/checkedGatewayHost.tpl.txt +157 -0
- package/src/runtime/streamXml.ts +1 -1
- package/dist/app/generateApp.d.ts.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/client/generateClient.d.ts.map +0 -1
- package/dist/client/generateOperations.d.ts.map +0 -1
- package/dist/client/generateTypes.d.ts.map +0 -1
- package/dist/client/generateUtils.d.ts.map +0 -1
- package/dist/compiler/generateCatalog.d.ts.map +0 -1
- package/dist/compiler/schemaCompiler.d.ts.map +0 -1
- package/dist/compiler/shapeResolver.d.ts.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/gateway/generateGateway.d.ts.map +0 -1
- package/dist/gateway/generators.d.ts.map +0 -1
- package/dist/gateway/helpers.d.ts.map +0 -1
- package/dist/generation/preamble.d.ts.map +0 -1
- package/dist/generation/writeGeneratedSource.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/loader/fetch.d.ts.map +0 -1
- package/dist/loader/wsdlLoader.d.ts.map +0 -1
- package/dist/openapi/casing.d.ts.map +0 -1
- package/dist/openapi/generateOpenAPI.d.ts.map +0 -1
- package/dist/openapi/generatePaths.d.ts.map +0 -1
- package/dist/openapi/generateSchemas.d.ts.map +0 -1
- package/dist/openapi/security.d.ts.map +0 -1
- package/dist/pipeline.d.ts.map +0 -1
- package/dist/runtime/jsonArray.d.ts +0 -24
- package/dist/runtime/jsonArray.d.ts.map +0 -1
- package/dist/runtime/jsonArray.js +0 -52
- package/dist/runtime/ndjson.d.ts +0 -24
- package/dist/runtime/ndjson.d.ts.map +0 -1
- package/dist/runtime/ndjson.js +0 -30
- package/dist/runtime/streamXml.d.ts +0 -45
- package/dist/runtime/streamXml.d.ts.map +0 -1
- package/dist/runtime/streamXml.js +0 -212
- package/dist/test/generateTests.d.ts.map +0 -1
- package/dist/test/generators.d.ts.map +0 -1
- package/dist/test/mockData.d.ts.map +0 -1
- package/dist/util/attributeWildcards.d.ts.map +0 -1
- package/dist/util/builder.d.ts.map +0 -1
- package/dist/util/catalogMeta.d.ts.map +0 -1
- package/dist/util/cli.d.ts.map +0 -1
- package/dist/util/errors.d.ts.map +0 -1
- package/dist/util/imports.d.ts.map +0 -1
- package/dist/util/runtimeSource.d.ts.map +0 -1
- package/dist/util/securityConfig.d.ts.map +0 -1
- package/dist/util/streamConfig.d.ts.map +0 -1
- package/dist/util/tools.d.ts.map +0 -1
- package/dist/xsd/primitives.d.ts.map +0 -1
- package/docs/AGENTS.md +0 -47
- package/docs/README.md +0 -56
- package/docs/architecture.md +0 -149
- package/docs/decisions/001-test-generation.md +0 -36
- package/docs/decisions/002-streamable-responses.md +0 -330
- package/docs/file-naming-and-path-organization.md +0 -213
- package/docs/releases/README.md +0 -94
- package/docs/releases/v0.20.0.md +0 -22
- package/docs/releases/v0.21.0.md +0 -30
- package/docs/releases/v0.22.0.md +0 -30
- package/docs/releases/v0.23.0.md +0 -31
- package/docs/releases/v0.24.0.md +0 -38
- package/docs/releases/v0.25.0.md +0 -31
- package/docs/releases/v0.25.2.md +0 -32
- package/docs/releases/v0.26.0.md +0 -32
- package/docs/releases/v0.27.0.md +0 -31
- package/docs/releases/v0.28.0.md +0 -32
- package/docs/releases/v0.29.0.md +0 -32
- package/docs/releases/v0.30.0.md +0 -30
- package/docs/releases/v0.30.1.md +0 -31
- package/docs/releases/v0.30.2.md +0 -30
- package/docs/releases/v0.30.3.md +0 -33
- package/docs/releases/v0.31.0.md +0 -33
- package/docs/releases/v0.32.0.md +0 -33
- package/docs/releases/v0.33.0.md +0 -34
- package/docs/releases/v0.34.0.md +0 -30
- package/docs/releases/v0.35.0.md +0 -33
- package/docs/releases/v0.36.0.md +0 -32
- package/docs/releases/v0.37.0.md +0 -33
- package/docs/releases/v0.38.0.md +0 -35
- package/docs/releases/v0.39.0.md +0 -35
- package/docs/releases/v0.40.0.md +0 -45
- package/docs/releases/v0.40.1.md +0 -34
- package/docs/releases/v1.0.0.md +0 -42
- package/docs/releases/v1.0.1.md +0 -38
- package/docs/releases/v1.0.2.md +0 -51
- package/docs/releases/v1.0.3.md +0 -37
- package/docs/releases/v1.0.4.md +0 -45
- package/docs/releases/v1.0.5.md +0 -41
- package/docs/releases/v1.0.6.md +0 -35
- package/docs/releases/v1.0.7.md +0 -36
- package/docs/releases/v1.1.0.md +0 -42
- package/docs/releases/v1.1.1.md +0 -44
- package/docs/releases/v1.1.2.md +0 -42
- package/docs/releases/v1.1.3.md +0 -36
- package/docs/releases/v1.1.4.md +0 -36
- package/docs/roadmap/README.md +0 -107
- package/docs/roadmap/v1.0-capability-conformance-framework.md +0 -582
- package/docs/roadmap/v1.0-choice-union-mode.md +0 -90
- package/docs/roadmap/v1.0-contract-audit.md +0 -75
- package/docs/roadmap/v1.0-json-array-streaming.md +0 -101
- package/docs/roadmap/v1.0-openapi-fastify-compatibility.md +0 -99
- package/docs/roadmap/v1.0-release-candidate-gates.md +0 -92
- package/docs/roadmap/v1.0-wsdl-coverage-matrix.md +0 -200
- package/docs/roadmap/v1.0-xs-anyattribute-wildcard-bag.md +0 -932
- package/src/runtime/jsonArray.ts +0 -55
- package/src/runtime/ndjson.ts +0 -32
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
import { isApplicationUnmetered } from './semanticBudget.js';
|
|
2
|
+
import { directDataOwnership, directLimit } from './directExecutionPolicy.js';
|
|
3
|
+
/** Shared retained-operation SOAP 1.1 exchange; profile-specific authority stays explicit. */
|
|
4
|
+
import { checkSemanticBudget } from './semanticBudget.js';
|
|
5
|
+
import { DataOwnershipLimitError } from './dataOwnership.js';
|
|
6
|
+
import { Agent } from 'node:http';
|
|
7
|
+
import { Agent as HttpsAgent } from 'node:https';
|
|
8
|
+
import { types } from 'node:util';
|
|
9
|
+
import { WSDL } from 'soap/lib/wsdl/index.js';
|
|
10
|
+
import { Client } from 'soap/lib/client.js';
|
|
11
|
+
import { HttpClient } from 'soap/lib/http.js';
|
|
12
|
+
import { inspectDirectOperation } from './directOperation.js';
|
|
13
|
+
import { createDirectValueMapping, inspectDirectValueMapping, createComponentDirectionalMapping, inspectComponentValueMapping } from './directValues.js';
|
|
14
|
+
import { decodeDirectXml, encodeDirectXml, decodeComponentXml, encodeComponentXml, DIRECT_XML_LIMITS } from './directCodec.js';
|
|
15
|
+
import { prepareDirectSoapSource, prepareComponentSoapWsdl, DirectSoapSourceError } from './directSoapSource.js';
|
|
16
|
+
import { isXmlNCName, resolveLexicalQName, SchemaLoadingError, syntaxElements, syntaxAttribute, WSDL_NAMESPACE } from '../loader/orderedSyntax.js';
|
|
17
|
+
import { decodeComponentRecordXml, inspectComponentRecordProjection } from './componentRecordProjection.js';
|
|
18
|
+
import { assessComponentSoapHeader } from './soapHeaders.js';
|
|
19
|
+
const SOAP = 'http://schemas.xmlsoap.org/soap/envelope/';
|
|
20
|
+
class Stop extends Error {
|
|
21
|
+
kind;
|
|
22
|
+
rule;
|
|
23
|
+
constructor(kind, rule) {
|
|
24
|
+
super(rule);
|
|
25
|
+
this.kind = kind;
|
|
26
|
+
this.rule = rule;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const same = (a, b) => a.namespace === b.namespace && a.local === b.local;
|
|
30
|
+
/** Shared entry guard: consumers must call before reading any SOAP option. */
|
|
31
|
+
export function directSoapOptionsShape(options, check, additional = []) {
|
|
32
|
+
if (!options || typeof options !== 'object' || types.isProxy(options)
|
|
33
|
+
|| ![null, Object.prototype].includes(Object.getPrototypeOf(options)))
|
|
34
|
+
return 'data-only SOAP options required';
|
|
35
|
+
const allowed = new Set(['service', 'port', 'endpoint', 'allowEndpoint', 'signal', 'timeoutMs', 'limits', 'capabilities', ...additional]);
|
|
36
|
+
for (const key of Reflect.ownKeys(options)) {
|
|
37
|
+
check();
|
|
38
|
+
const descriptor = Object.getOwnPropertyDescriptor(options, key);
|
|
39
|
+
if (typeof key !== 'string' || !allowed.has(key) || !descriptor || !('value' in descriptor))
|
|
40
|
+
return 'SOAP option or capability';
|
|
41
|
+
}
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
/** Authentication and fresh-value validation precede dependency bootstrap and all HTTP I/O. */
|
|
45
|
+
export async function exchangeDirectSoap(contract, inputMapping, application, options) {
|
|
46
|
+
const input = inspectDirectValueMapping(inputMapping, contract);
|
|
47
|
+
return exchangeSoap(contract, input, application, options, {
|
|
48
|
+
component: false, encode: encodeDirectXml, decode: decodeDirectXml, create: createDirectValueMapping,
|
|
49
|
+
prepare: async (selection, check) => {
|
|
50
|
+
const { source } = inspectDirectOperation(contract);
|
|
51
|
+
const { wsdlText } = prepareDirectSoapSource(contract, selection, check);
|
|
52
|
+
const wsdl = new WSDL(wsdlText, source.root.uri, { wsdl_options: { overrideImportLocation: () => { throw new Stop('unsupported', 'dependency import forbidden'); } } });
|
|
53
|
+
await new Promise((resolve, reject) => wsdl.onReady(error => error ? reject(error) : resolve()));
|
|
54
|
+
return wsdl;
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
export async function exchangeComponentSoap(contract, inputMapping, application, options, responseProjection) {
|
|
59
|
+
const { mapping: input } = inspectComponentValueMapping(inputMapping, contract);
|
|
60
|
+
if (responseProjection !== undefined) {
|
|
61
|
+
inspectComponentRecordProjection(responseProjection, contract);
|
|
62
|
+
return exchangeSoap(contract, input, application, options, {
|
|
63
|
+
component: true,
|
|
64
|
+
encode(owner, mapping, value, controls) {
|
|
65
|
+
if (mapping.kind !== 'component-mapping')
|
|
66
|
+
throw new TypeError('SOAP input requires the native input mapping');
|
|
67
|
+
return encodeComponentXml(owner, mapping, value, controls);
|
|
68
|
+
},
|
|
69
|
+
decode(owner, mapping, bytes, controls) {
|
|
70
|
+
if (mapping.kind === 'component-record-projection')
|
|
71
|
+
return decodeComponentRecordXml(owner, mapping, bytes, controls);
|
|
72
|
+
return decodeComponentXml(owner, mapping, bytes, { ...controls, selectPayload(root) {
|
|
73
|
+
const selected = controls.selectPayload(root);
|
|
74
|
+
if (selected.mapping.kind !== 'component-mapping')
|
|
75
|
+
throw new TypeError('Normal component decoding requires its exact mapping');
|
|
76
|
+
return { payload: selected.payload, mapping: selected.mapping };
|
|
77
|
+
} });
|
|
78
|
+
},
|
|
79
|
+
create(owner, direction, controls) {
|
|
80
|
+
return direction.kind === 'output' ? responseProjection : createComponentDirectionalMapping(owner, input, direction, controls);
|
|
81
|
+
},
|
|
82
|
+
prepare: (selection, check) => prepareComponentSoapWsdl(contract, selection, check),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return exchangeSoap(contract, input, application, options, {
|
|
86
|
+
component: true, encode: encodeComponentXml, decode: decodeComponentXml,
|
|
87
|
+
create: (owner, direction, controls) => createComponentDirectionalMapping(owner, input, direction, controls),
|
|
88
|
+
prepare: (selection, check) => prepareComponentSoapWsdl(contract, selection, check),
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
async function exchangeSoap(contract, input, application, options, profile) {
|
|
92
|
+
const { context } = inspectDirectOperation(contract);
|
|
93
|
+
if (input.direction.kind !== 'input')
|
|
94
|
+
throw new TypeError('SOAP request requires the exact input mapping');
|
|
95
|
+
const { budget } = context;
|
|
96
|
+
const fail = (kind, rule, phase) => Object.freeze({ kind, rule,
|
|
97
|
+
...(profile.component && phase ? { phase } : {}), usage: Object.freeze({ ...budget.usage() }) });
|
|
98
|
+
let signal;
|
|
99
|
+
const check = () => { checkSemanticBudget(budget); if (signal?.aborted)
|
|
100
|
+
throw new Stop('cancelled', 'cooperative-cancellation'); };
|
|
101
|
+
const stop = (kind, rule) => { throw new Stop(kind, rule); };
|
|
102
|
+
let agent;
|
|
103
|
+
let controller;
|
|
104
|
+
let deadline;
|
|
105
|
+
const abort = () => controller?.abort();
|
|
106
|
+
try {
|
|
107
|
+
check();
|
|
108
|
+
// Options are a closed capability surface. Never silently discard security,
|
|
109
|
+
// headers, endpoint agents, redirects, streaming or other caller extensions.
|
|
110
|
+
const optionRule = directSoapOptionsShape(options, check, profile.component ? ['ca'] : []);
|
|
111
|
+
if (optionRule)
|
|
112
|
+
return fail('unsupported', optionRule);
|
|
113
|
+
signal = options.signal;
|
|
114
|
+
if (signal !== undefined && !(signal instanceof AbortSignal))
|
|
115
|
+
return fail('unsupported', 'native AbortSignal required');
|
|
116
|
+
const allowEndpoint = options.allowEndpoint;
|
|
117
|
+
check();
|
|
118
|
+
let selectedEndpoint = options.endpoint;
|
|
119
|
+
if (profile.component && selectedEndpoint === undefined) {
|
|
120
|
+
const { source } = inspectDirectOperation(contract);
|
|
121
|
+
const services = source.documents.flatMap(d => syntaxElements(d.root, WSDL_NAMESPACE, 'service').filter(n => syntaxAttribute(d.root, 'targetNamespace') === options.service?.namespace && syntaxAttribute(n, 'name') === options.service?.local));
|
|
122
|
+
const ports = services.flatMap(n => syntaxElements(n, WSDL_NAMESPACE, 'port').filter(p => syntaxAttribute(p, 'name') === options.port));
|
|
123
|
+
const addresses = ports.flatMap(p => syntaxElements(p, 'http://schemas.xmlsoap.org/wsdl/soap/', 'address'));
|
|
124
|
+
if (services.length !== 1 || ports.length !== 1 || addresses.length !== 1 || !syntaxAttribute(addresses[0], 'location')) {
|
|
125
|
+
return fail('unsupported', 'Select one SOAP service/port address or supply an endpoint override');
|
|
126
|
+
}
|
|
127
|
+
selectedEndpoint = syntaxAttribute(addresses[0], 'location');
|
|
128
|
+
}
|
|
129
|
+
const config = directDataOwnership(budget).freeze(directDataOwnership(budget).snapshot({ service: options.service, port: options.port, endpoint: selectedEndpoint,
|
|
130
|
+
timeoutMs: options.timeoutMs ?? (profile.component || isApplicationUnmetered(budget) ? 0 : 15_000), limits: options.limits ?? {},
|
|
131
|
+
ca: options.ca, capabilities: options.capabilities ?? [] }));
|
|
132
|
+
if (!Array.isArray(config.capabilities) || config.capabilities.length)
|
|
133
|
+
return fail('unsupported', 'SOAP capability');
|
|
134
|
+
if (!Number.isSafeInteger(config.timeoutMs) || config.timeoutMs < 0 || config.timeoutMs > 2_147_483_647)
|
|
135
|
+
throw new RangeError('SOAP timeout must be a positive timer integer');
|
|
136
|
+
const limits = { maxBytes: directLimit(budget, DIRECT_XML_LIMITS.maxBytes), maxDepth: directLimit(budget, DIRECT_XML_LIMITS.maxDepth),
|
|
137
|
+
maxNodes: directLimit(budget, DIRECT_XML_LIMITS.maxNodes), maxText: directLimit(budget, DIRECT_XML_LIMITS.maxText), ...config.limits };
|
|
138
|
+
for (const [key, value] of Object.entries(limits)) {
|
|
139
|
+
if (!['maxBytes', 'maxDepth', 'maxNodes', 'maxText'].includes(key) || !Number.isSafeInteger(value) || value < 1)
|
|
140
|
+
throw new RangeError('Invalid SOAP XML limit');
|
|
141
|
+
}
|
|
142
|
+
if (typeof config.endpoint !== 'string' || typeof config.port !== 'string' || !isXmlNCName(config.port)
|
|
143
|
+
|| !config.service || typeof config.service.namespace !== 'string' || !isXmlNCName(config.service.local))
|
|
144
|
+
return fail('unsupported', 'explicit SOAP selection');
|
|
145
|
+
let endpoint;
|
|
146
|
+
try {
|
|
147
|
+
endpoint = new URL(config.endpoint);
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
return fail('unsupported', 'explicit HTTP(S) endpoint required');
|
|
151
|
+
}
|
|
152
|
+
if (profile.component) {
|
|
153
|
+
if (!['http:', 'https:'].includes(endpoint.protocol) || endpoint.username || endpoint.password || endpoint.hash || endpoint.search)
|
|
154
|
+
return fail('unsupported', 'explicit HTTP(S) endpoint required');
|
|
155
|
+
if (config.ca !== undefined && (typeof config.ca !== 'string' || endpoint.protocol !== 'https:'))
|
|
156
|
+
return fail('unsupported', 'HTTPS PEM trust anchor required');
|
|
157
|
+
const policy = contract.policy;
|
|
158
|
+
if (!policy)
|
|
159
|
+
return fail('unsupported', 'component policy authority required');
|
|
160
|
+
if (policy.kind === 'https-transport') {
|
|
161
|
+
if (endpoint.protocol !== 'https:')
|
|
162
|
+
return fail('unsupported', 'policy requires HTTPS');
|
|
163
|
+
if (policy.requireClientCertificate || policy.includeTimestamp || !['Strict', 'Lax'].includes(policy.layout))
|
|
164
|
+
return fail('unsupported', 'message security or client certificate capability required');
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
else if (endpoint.protocol !== 'http:' || endpoint.hostname !== '127.0.0.1' || !endpoint.port || endpoint.port === '1'
|
|
168
|
+
|| endpoint.username || endpoint.password || endpoint.hash || endpoint.search)
|
|
169
|
+
return fail('unsupported', 'owned loopback HTTP endpoint required');
|
|
170
|
+
if (!(profile.component && allowEndpoint === undefined)
|
|
171
|
+
&& (typeof allowEndpoint !== 'function' || allowEndpoint(new URL(endpoint.href)) !== true))
|
|
172
|
+
return fail('unsupported', 'endpoint authorization');
|
|
173
|
+
const action = contract.binding.action;
|
|
174
|
+
if (/[^\x20-\x21\x23-\x7e]|\\/.test(action))
|
|
175
|
+
return fail('unsupported', 'unsafe SOAPAction');
|
|
176
|
+
const elements = (node) => {
|
|
177
|
+
check();
|
|
178
|
+
return node.children.filter((child) => child.kind === 'element');
|
|
179
|
+
};
|
|
180
|
+
const encoded = profile.encode(contract, input, application, { signal, limits });
|
|
181
|
+
if (!('bytes' in encoded))
|
|
182
|
+
return fail(encoded.kind, encoded.rule, 'input');
|
|
183
|
+
const output = profile.create(contract, { kind: 'output' }, { signal });
|
|
184
|
+
if (!('direction' in output))
|
|
185
|
+
return fail(output.kind, output.rule);
|
|
186
|
+
const faults = new Map();
|
|
187
|
+
for (const fault of contract.faults) {
|
|
188
|
+
check();
|
|
189
|
+
const mapping = profile.create(contract, { kind: 'fault', name: fault.name }, { signal });
|
|
190
|
+
if (!('direction' in mapping))
|
|
191
|
+
return fail(mapping.kind, mapping.rule);
|
|
192
|
+
faults.set(fault.name, mapping);
|
|
193
|
+
}
|
|
194
|
+
const shape = (node) => {
|
|
195
|
+
const children = elements(node);
|
|
196
|
+
if (node.attributes.length || node.children.some(n => n.kind === 'text' && /[^\t\r\n ]/.test(n.value)))
|
|
197
|
+
stop('protocol', 'SOAP protocol attributes or text');
|
|
198
|
+
return children;
|
|
199
|
+
};
|
|
200
|
+
const ignoredHeaders = [];
|
|
201
|
+
const bodyRoot = (root, incoming = false) => {
|
|
202
|
+
if (!same(root.name, { namespace: SOAP, local: 'Envelope' }))
|
|
203
|
+
stop('protocol', 'SOAP 1.1 Envelope required');
|
|
204
|
+
const children = shape(root);
|
|
205
|
+
if (children[0]?.name.namespace === SOAP && children[0].name.local === 'Header') {
|
|
206
|
+
if (profile.component && incoming) {
|
|
207
|
+
const assessed = assessComponentSoapHeader(children[0], check);
|
|
208
|
+
if (assessed.kind !== 'ignored-optional-headers')
|
|
209
|
+
stop(assessed.kind, assessed.rule);
|
|
210
|
+
else
|
|
211
|
+
for (const name of assessed.headers) {
|
|
212
|
+
check();
|
|
213
|
+
ignoredHeaders.push(name);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
else if (shape(children[0]).length)
|
|
217
|
+
stop('unsupported', 'incoming SOAP headers');
|
|
218
|
+
children.shift();
|
|
219
|
+
}
|
|
220
|
+
if (children.length !== 1 || !same(children[0].name, { namespace: SOAP, local: 'Body' }))
|
|
221
|
+
stop('protocol', 'one SOAP Body required');
|
|
222
|
+
const body = shape(children[0]);
|
|
223
|
+
if (body.length !== 1)
|
|
224
|
+
stop('protocol', 'one SOAP Body payload required');
|
|
225
|
+
return body[0];
|
|
226
|
+
};
|
|
227
|
+
const wsdl = await profile.prepare(config, check);
|
|
228
|
+
check();
|
|
229
|
+
// HTTP and codec byte limits bound buffering and output copies directly.
|
|
230
|
+
agent = endpoint.protocol === 'https:' ? new HttpsAgent({ keepAlive: false, maxSockets: 1, rejectUnauthorized: true,
|
|
231
|
+
...(config.ca === undefined ? {} : { ca: config.ca }) }) : new Agent({ keepAlive: false, maxSockets: 1 });
|
|
232
|
+
controller = new AbortController();
|
|
233
|
+
signal?.addEventListener('abort', abort, { once: true });
|
|
234
|
+
let timedOut = false;
|
|
235
|
+
if (config.timeoutMs > 0)
|
|
236
|
+
deadline = setTimeout(() => { timedOut = true; controller.abort(); }, config.timeoutMs);
|
|
237
|
+
const complete = new Error('direct raw response captured');
|
|
238
|
+
let response;
|
|
239
|
+
let hookFailure;
|
|
240
|
+
class BufferedHttp extends HttpClient {
|
|
241
|
+
request(url, data, callback, headers, _options) {
|
|
242
|
+
try {
|
|
243
|
+
check();
|
|
244
|
+
if (url !== endpoint.href || headers.SOAPAction !== `"${action}"` || headers['Content-Type'] !== 'text/xml; charset=utf-8')
|
|
245
|
+
stop('protocol', 'dependency dispatch mismatch');
|
|
246
|
+
if (Buffer.byteLength(data) > limits.maxBytes)
|
|
247
|
+
stop('resource-limit', 'SOAP request byte limit');
|
|
248
|
+
const outgoing = profile.decode(contract, input, Buffer.from(data), { signal, limits,
|
|
249
|
+
uri: 'urn:typescript-wsdl-client:outgoing-soap', selectPayload: root => ({ payload: bodyRoot(root), mapping: input }) });
|
|
250
|
+
if (!('validated' in outgoing))
|
|
251
|
+
stop(outgoing.kind, outgoing.rule);
|
|
252
|
+
check();
|
|
253
|
+
}
|
|
254
|
+
catch (error) {
|
|
255
|
+
hookFailure = error;
|
|
256
|
+
callback(complete);
|
|
257
|
+
// The dependency ignores this return value; no HTTP request is made.
|
|
258
|
+
const rejected = Promise.reject(complete);
|
|
259
|
+
void rejected.catch(() => { });
|
|
260
|
+
return rejected;
|
|
261
|
+
}
|
|
262
|
+
return super.request(url, data, (error, res, bytes) => {
|
|
263
|
+
// Never throw through HttpClient's detached then-handler.
|
|
264
|
+
try {
|
|
265
|
+
check();
|
|
266
|
+
if (error)
|
|
267
|
+
hookFailure = error;
|
|
268
|
+
else if (!res || !Buffer.isBuffer(bytes))
|
|
269
|
+
stop('transport', 'raw response bytes unavailable');
|
|
270
|
+
else
|
|
271
|
+
response = { bytes, status: res.status, contentType: String(res.headers['content-type'] ?? ''), encoding: String(res.headers['content-encoding'] ?? '') };
|
|
272
|
+
}
|
|
273
|
+
catch (failure) {
|
|
274
|
+
hookFailure = failure;
|
|
275
|
+
}
|
|
276
|
+
// No response object/data on this sentinel: node-soap cannot enter
|
|
277
|
+
// xmlToObject, including its special err.response parsing path.
|
|
278
|
+
callback(complete);
|
|
279
|
+
}, headers, { responseType: 'arraybuffer', decompress: false, maxRedirects: 0, maxContentLength: limits.maxBytes,
|
|
280
|
+
maxBodyLength: limits.maxBytes, proxy: false, httpAgent: agent, httpsAgent: agent, signal: controller.signal, timeout: config.timeoutMs });
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
const client = new Client(wsdl, endpoint.href, { httpClient: new BufferedHttp() });
|
|
284
|
+
// Every lookup is own and explicit; the dependency's first-port shortcut is
|
|
285
|
+
// never consulted. Source checks above bind these names to the native handle.
|
|
286
|
+
const own = (object, key) => Object.getOwnPropertyDescriptor(object, key)?.value;
|
|
287
|
+
const service = own(client, config.service.local);
|
|
288
|
+
const port = service && typeof service === 'object' ? own(service, config.port) : undefined;
|
|
289
|
+
const method = port && typeof port === 'object' ? own(port, contract.selector.operation) : undefined;
|
|
290
|
+
if (typeof method !== 'function')
|
|
291
|
+
return fail('unsupported', 'dependency selected method unavailable');
|
|
292
|
+
check();
|
|
293
|
+
await new Promise((resolve, reject) => method({ _xml: Buffer.from(encoded.bytes).toString('utf8') }, (error) => error === complete ? resolve() : reject(error), {}, { SOAPAction: `"${action}"` }));
|
|
294
|
+
check();
|
|
295
|
+
if (timedOut)
|
|
296
|
+
return fail('transport', 'SOAP deadline exceeded');
|
|
297
|
+
if (hookFailure)
|
|
298
|
+
throw hookFailure;
|
|
299
|
+
if (!response)
|
|
300
|
+
return fail('transport', 'incomplete HTTP response');
|
|
301
|
+
const observed = response;
|
|
302
|
+
if (observed.encoding && observed.encoding.toLowerCase() !== 'identity')
|
|
303
|
+
return fail('unsupported', 'HTTP compression');
|
|
304
|
+
const media = /^text\/xml(?:\s*;\s*charset\s*=\s*(?:"(utf-8|utf-16|utf-16le|utf-16be)"|(utf-8|utf-16|utf-16le|utf-16be)))?\s*$/i.exec(observed.contentType);
|
|
305
|
+
if (!media)
|
|
306
|
+
return fail('protocol', 'SOAP response Content-Type');
|
|
307
|
+
if (observed.status !== 200 && observed.status !== 500)
|
|
308
|
+
return fail('transport', 'SOAP HTTP status');
|
|
309
|
+
// Header charset is a protocol assertion, checked against actual BOM bytes.
|
|
310
|
+
const charset = (media[1] ?? media[2])?.toLowerCase();
|
|
311
|
+
const bom = observed.bytes[0] === 0xff && observed.bytes[1] === 0xfe ? 'utf-16le'
|
|
312
|
+
: observed.bytes[0] === 0xfe && observed.bytes[1] === 0xff ? 'utf-16be' : 'utf-8';
|
|
313
|
+
if (charset && charset !== bom && !(charset === 'utf-16' && bom.startsWith('utf-16')))
|
|
314
|
+
return fail('protocol', 'SOAP charset disagrees with bytes');
|
|
315
|
+
let faultInfo;
|
|
316
|
+
const decoded = profile.decode(contract, output, observed.bytes, { signal, limits, uri: endpoint.href,
|
|
317
|
+
selectPayload: root => {
|
|
318
|
+
const payload = bodyRoot(root, true);
|
|
319
|
+
if (!same(payload.name, { namespace: SOAP, local: 'Fault' })) {
|
|
320
|
+
if (observed.status !== 200)
|
|
321
|
+
stop('protocol', 'HTTP 500 requires SOAP Fault');
|
|
322
|
+
return { payload, mapping: output };
|
|
323
|
+
}
|
|
324
|
+
const children = shape(payload);
|
|
325
|
+
const names = children.map(n => n.name.namespace === '' ? n.name.local : '');
|
|
326
|
+
if (names.join(',') !== 'faultcode,faultstring,detail' && names.join(',') !== 'faultcode,faultstring,faultactor,detail')
|
|
327
|
+
stop('protocol', 'SOAP Fault children');
|
|
328
|
+
const text = (node) => {
|
|
329
|
+
if (node.attributes.some(a => !(node.name.local === 'faultstring' && a.name.namespace === 'http://www.w3.org/XML/1998/namespace' && a.name.local === 'lang')) || elements(node).length)
|
|
330
|
+
stop('protocol', 'SOAP Fault scalar child');
|
|
331
|
+
return node.children.map(n => n.kind === 'text' ? n.value : '').join('');
|
|
332
|
+
};
|
|
333
|
+
let code;
|
|
334
|
+
try {
|
|
335
|
+
code = resolveLexicalQName(text(children[0]), children[0]);
|
|
336
|
+
}
|
|
337
|
+
catch (error) {
|
|
338
|
+
if (error instanceof SchemaLoadingError)
|
|
339
|
+
return stop('protocol', 'SOAP Fault code QName');
|
|
340
|
+
throw error;
|
|
341
|
+
}
|
|
342
|
+
if (!code.namespace)
|
|
343
|
+
stop('protocol', 'SOAP Fault code namespace required');
|
|
344
|
+
const string = text(children[1]);
|
|
345
|
+
const actor = names[2] === 'faultactor' ? text(children[2]) : undefined;
|
|
346
|
+
const detail = shape(children.at(-1));
|
|
347
|
+
if (detail.length !== 1)
|
|
348
|
+
stop('protocol', 'one declared SOAP Fault detail required');
|
|
349
|
+
const matches = contract.faults.filter(f => same(f.root.element.name, detail[0].name));
|
|
350
|
+
if (matches.length !== 1)
|
|
351
|
+
stop('protocol', 'unknown or ambiguous SOAP Fault detail');
|
|
352
|
+
faultInfo = { name: matches[0].name, code, codeNode: children[0], string, ...(actor === undefined ? {} : { actor }) };
|
|
353
|
+
directDataOwnership(budget).freeze(faultInfo);
|
|
354
|
+
return { payload: detail[0], mapping: faults.get(faultInfo.name) };
|
|
355
|
+
} });
|
|
356
|
+
if (!('validated' in decoded))
|
|
357
|
+
return fail(decoded.kind, decoded.rule, 'response');
|
|
358
|
+
check();
|
|
359
|
+
check();
|
|
360
|
+
return Object.freeze({ kind: faultInfo ? 'soap-fault' : 'soap-response', admitted: false, decoded,
|
|
361
|
+
responseBytes: new Uint8Array(observed.bytes), status: observed.status, ...(faultInfo ? { fault: faultInfo } : {}),
|
|
362
|
+
...(ignoredHeaders.length ? { ignoredHeaders: Object.freeze(ignoredHeaders) } : {}), usage: Object.freeze({ ...budget.usage() }) });
|
|
363
|
+
}
|
|
364
|
+
catch (error) {
|
|
365
|
+
if (budget.exhausted())
|
|
366
|
+
return fail('resource-limit', 'request-budget');
|
|
367
|
+
if (error instanceof DataOwnershipLimitError)
|
|
368
|
+
return fail('resource-limit', error.message);
|
|
369
|
+
if (signal?.aborted)
|
|
370
|
+
return fail('cancelled', 'cooperative-cancellation');
|
|
371
|
+
if (error instanceof DirectSoapSourceError)
|
|
372
|
+
return fail(error.kind, error.message);
|
|
373
|
+
if (error instanceof Stop)
|
|
374
|
+
return fail(error.kind, error.rule);
|
|
375
|
+
if (error instanceof SchemaLoadingError)
|
|
376
|
+
return fail(error.category === 'resource-limit' ? 'resource-limit' : error.category === 'invalid-schema' ? 'protocol' : 'unsupported', 'SOAP protocol XML');
|
|
377
|
+
if (error instanceof Error && 'code' in error) {
|
|
378
|
+
if (error.code === 'ERR_BAD_RESPONSE' && error.message.startsWith('maxContentLength size of '))
|
|
379
|
+
return fail('resource-limit', 'HTTP response byte limit');
|
|
380
|
+
return fail('transport', error.code === 'ERR_CANCELED' ? 'SOAP deadline exceeded' : 'HTTP exchange failed');
|
|
381
|
+
}
|
|
382
|
+
throw error;
|
|
383
|
+
}
|
|
384
|
+
finally {
|
|
385
|
+
if (deadline)
|
|
386
|
+
clearTimeout(deadline);
|
|
387
|
+
signal?.removeEventListener('abort', abort);
|
|
388
|
+
controller?.abort();
|
|
389
|
+
agent?.destroy();
|
|
390
|
+
}
|
|
391
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { DirectOperationContract } from './directOperation.js';
|
|
2
|
+
import type { ExpandedName } from '../loader/orderedSyntax.js';
|
|
3
|
+
import { WSDL } from 'soap/lib/wsdl/index.js';
|
|
4
|
+
export declare const DIRECT_SOAP_SOURCE_MAX_BYTES: number;
|
|
5
|
+
export declare class DirectSoapSourceError extends Error {
|
|
6
|
+
readonly kind: 'unsupported' | 'resource-limit';
|
|
7
|
+
constructor(message: string, kind?: 'unsupported' | 'resource-limit');
|
|
8
|
+
}
|
|
9
|
+
export declare function prepareDirectSoapSource(contract: DirectOperationContract, config: {
|
|
10
|
+
service: ExpandedName;
|
|
11
|
+
port: string;
|
|
12
|
+
}, check: () => void): {
|
|
13
|
+
original: Uint8Array<ArrayBufferLike>;
|
|
14
|
+
wsdlText: string;
|
|
15
|
+
};
|
|
16
|
+
/** Check each native operation before sharing its source metadata.
|
|
17
|
+
* @param contract Authentic component operation.
|
|
18
|
+
* @param config Exact service and port.
|
|
19
|
+
* @param check Invocation cancellation/resource checks.
|
|
20
|
+
* @returns No metadata or portable authority.
|
|
21
|
+
* @throws For foreign handles, unsupported source profile, action or selection.
|
|
22
|
+
*/
|
|
23
|
+
export declare function validateComponentSoapSelection(contract: DirectOperationContract, config: {
|
|
24
|
+
service: ExpandedName;
|
|
25
|
+
port: string;
|
|
26
|
+
}, check: () => void): void;
|
|
27
|
+
/** Build the existing SOAP dependency from the exact authorized snapshot, with no file/network import fallback.
|
|
28
|
+
* @remarks Acyclic metadata resources are decoded independently under the native metadata policy. Original bytes and native semantics
|
|
29
|
+
* are unchanged. The dependency receives private aliases and a fresh prefilled cache; its import hook accepts only
|
|
30
|
+
* unambiguous native source edges to already prepared resources. This grants no endpoint or policy enforcement.
|
|
31
|
+
* @returns A prepared node-soap WSDL for the exact original service/port/binding.
|
|
32
|
+
* @throws DirectSoapSourceError For incompatible source/profile, unsafe dependency names, cycles or ambiguous imports.
|
|
33
|
+
* Caller cancellation/resource exceptions propagate unchanged.
|
|
34
|
+
*/
|
|
35
|
+
export declare function prepareComponentSoapWsdl(contract: DirectOperationContract, config: {
|
|
36
|
+
service: ExpandedName;
|
|
37
|
+
port: string;
|
|
38
|
+
}, check: () => void): Promise<WSDL>;
|