@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,40 @@
|
|
|
1
|
+
/** Physical layout checks only; source interpretation and eligibility remain native responsibilities. */
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { assertLoadedSchemaInput } from '../loader/schemaInput.js';
|
|
4
|
+
/** Find a finite common directory using complete parent segments, including valid names beginning with two dots.
|
|
5
|
+
* @throws Error For cross-volume inputs, cancellation or an impossible ancestor search.
|
|
6
|
+
*/
|
|
7
|
+
export function commonSourceDirectory(root, files, check, paths = path) {
|
|
8
|
+
let common = paths.dirname(root);
|
|
9
|
+
for (const file of files) {
|
|
10
|
+
check();
|
|
11
|
+
if (paths.parse(file).root.toLowerCase() !== paths.parse(common).root.toLowerCase())
|
|
12
|
+
throw new Error('Cross-volume source relocation requires explicit consumer source configuration');
|
|
13
|
+
for (;;) {
|
|
14
|
+
check();
|
|
15
|
+
const relative = paths.relative(common, file);
|
|
16
|
+
if (relative !== '..' && !relative.startsWith('..' + paths.sep) && !paths.isAbsolute(relative))
|
|
17
|
+
break;
|
|
18
|
+
const parent = paths.dirname(common);
|
|
19
|
+
if (parent === common)
|
|
20
|
+
throw new Error('Unable to find common source directory');
|
|
21
|
+
common = parent;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return common;
|
|
25
|
+
}
|
|
26
|
+
/** Refuse local retrieval aliases that cannot be copied as a relocatable physical tree.
|
|
27
|
+
* @remarks HTTP aliases use generated offline URI records. Local symlink aliases remain unsupported;
|
|
28
|
+
* this scaffold does not invent filesystem links or rewrite original source bytes.
|
|
29
|
+
* @throws TypeError For unowned source input. Error For a nonrelocatable authenticated dependency or cancellation.
|
|
30
|
+
*/
|
|
31
|
+
export function assertCanonicalSourceLayout(input, check) {
|
|
32
|
+
assertLoadedSchemaInput(input);
|
|
33
|
+
const schemas = new Map(input.schemas.map(schema => [schema.key, schema.documentUri]));
|
|
34
|
+
for (const edge of input.edges) {
|
|
35
|
+
check();
|
|
36
|
+
if (edge.to && edge.referenceUri && new URL(edge.referenceUri).protocol === 'file:' && edge.referenceUri !== (schemas.get(edge.to) ?? edge.to)) {
|
|
37
|
+
throw new Error('Source relocation refuses import retrieval aliases; supply canonical source references or independently configured runtime inputs');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,8 +4,14 @@ export { generateGateway } from "./gateway/generateGateway.js";
|
|
|
4
4
|
export { buildSecurity, loadSecurityConfigFile, parseSecurityConfig, SecurityConfigError, type SecurityConfig, } from "./util/securityConfig.js";
|
|
5
5
|
export { generateTests } from "./test/generateTests.js";
|
|
6
6
|
export { runGenerationPipeline } from "./pipeline.js";
|
|
7
|
+
export type { PipelineOptions } from './pipeline.js';
|
|
8
|
+
export type { CheckedComponentOptions, CheckedInventory } from './checkedPipeline.js';
|
|
9
|
+
export { planCheckedComponents, formatCheckedComponentPlan, writeCheckedPlanningFile, CheckedPlanningError } from './checkedPlanning.js';
|
|
10
|
+
export type { CheckedComponentPlan, ComponentPlanBlocker } from './checkedPlanning.js';
|
|
11
|
+
export type { ComponentRecordProjectionSpec, ComponentRecordProjectionAssociation } from './compiler/componentRecordProjection.js';
|
|
7
12
|
export { loadStreamConfigFile, parseStreamConfig, StreamConfigError, type OperationStreamMetadata, type ShapeCatalogRef, type StreamConfig, } from "./util/streamConfig.js";
|
|
8
13
|
export { applyShapeCatalogs, type ApplyShapeCatalogsOptions } from "./compiler/shapeResolver.js";
|
|
14
|
+
export { checkedDirectRuntimeV1, checkedComponentRuntimeV1 } from './client/checkedDirectRuntime.js';
|
|
9
15
|
/**
|
|
10
16
|
* Compiles a WSDL file to TypeScript client code
|
|
11
17
|
*
|
|
@@ -35,4 +41,6 @@ export declare function compileWsdlToProject(input: {
|
|
|
35
41
|
/** In-memory stream configuration. Ignored when `streamConfigFile` is set. */
|
|
36
42
|
streamConfig?: import("./util/streamConfig.js").StreamConfig;
|
|
37
43
|
}): Promise<void>;
|
|
38
|
-
|
|
44
|
+
export { assessSchemaSource, serializeAssessmentReport, parseAssessmentReport, assessmentExitCode, ASSESSMENT_VERSION, ASSESSMENT_BASIS } from './compiler/checkedAssessment.js';
|
|
45
|
+
export type { ApplicationGroupsOptions, ApplicationGroupName } from './compiler/applicationGroups.js';
|
|
46
|
+
export type { CheckedAssessmentReport, AssessmentObligation, AssessedOperation, AssessmentStatus } from './compiler/checkedAssessment.js';
|
package/dist/index.js
CHANGED
|
@@ -27,8 +27,10 @@ export { generateGateway } from "./gateway/generateGateway.js";
|
|
|
27
27
|
export { buildSecurity, loadSecurityConfigFile, parseSecurityConfig, SecurityConfigError, } from "./util/securityConfig.js";
|
|
28
28
|
export { generateTests } from "./test/generateTests.js";
|
|
29
29
|
export { runGenerationPipeline } from "./pipeline.js";
|
|
30
|
+
export { planCheckedComponents, formatCheckedComponentPlan, writeCheckedPlanningFile, CheckedPlanningError } from './checkedPlanning.js';
|
|
30
31
|
export { loadStreamConfigFile, parseStreamConfig, StreamConfigError, } from "./util/streamConfig.js";
|
|
31
32
|
export { applyShapeCatalogs } from "./compiler/shapeResolver.js";
|
|
33
|
+
export { checkedDirectRuntimeV1, checkedComponentRuntimeV1 } from './client/checkedDirectRuntime.js';
|
|
32
34
|
// noinspection JSUnusedGlobalSymbols
|
|
33
35
|
/**
|
|
34
36
|
* Compiles a WSDL file to TypeScript client code
|
|
@@ -117,3 +119,4 @@ export async function compileWsdlToProject(input) {
|
|
|
117
119
|
generateCatalog(catalogFile, compiled);
|
|
118
120
|
}
|
|
119
121
|
}
|
|
122
|
+
export { assessSchemaSource, serializeAssessmentReport, parseAssessmentReport, assessmentExitCode, ASSESSMENT_VERSION, ASSESSMENT_BASIS } from './compiler/checkedAssessment.js';
|
package/dist/loader/fetch.d.ts
CHANGED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export declare const XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
|
|
2
|
+
export declare const XSD_NAMESPACE = "http://www.w3.org/2001/XMLSchema";
|
|
3
|
+
export declare const WSDL_NAMESPACE = "http://schemas.xmlsoap.org/wsdl/";
|
|
4
|
+
export declare const DEFAULT_SYNTAX_DEPTH = 256;
|
|
5
|
+
export type ExpandedName = Readonly<{
|
|
6
|
+
namespace: string;
|
|
7
|
+
local: string;
|
|
8
|
+
}>;
|
|
9
|
+
export type SourcePosition = Readonly<{
|
|
10
|
+
offset: number;
|
|
11
|
+
line: number;
|
|
12
|
+
column: number;
|
|
13
|
+
}>;
|
|
14
|
+
export type SyntaxSource = Readonly<{
|
|
15
|
+
uri: string;
|
|
16
|
+
digest: string;
|
|
17
|
+
path: string;
|
|
18
|
+
start: SourcePosition;
|
|
19
|
+
end: SourcePosition;
|
|
20
|
+
}>;
|
|
21
|
+
export type SyntaxAttribute = Readonly<{
|
|
22
|
+
name: ExpandedName;
|
|
23
|
+
lexicalName: string;
|
|
24
|
+
value: string;
|
|
25
|
+
}>;
|
|
26
|
+
export type SyntaxText = Readonly<{
|
|
27
|
+
kind: "text";
|
|
28
|
+
value: string;
|
|
29
|
+
source: SyntaxSource;
|
|
30
|
+
}>;
|
|
31
|
+
export type SyntaxElement = Readonly<{
|
|
32
|
+
kind: "element";
|
|
33
|
+
name: ExpandedName;
|
|
34
|
+
lexicalName: string;
|
|
35
|
+
attributes: readonly SyntaxAttribute[];
|
|
36
|
+
namespaces: Readonly<Record<string, string>>;
|
|
37
|
+
baseUri: string;
|
|
38
|
+
children: readonly SyntaxNode[];
|
|
39
|
+
source: SyntaxSource;
|
|
40
|
+
}>;
|
|
41
|
+
export type SyntaxNode = SyntaxElement | SyntaxText;
|
|
42
|
+
export type SyntaxDocument = Readonly<{
|
|
43
|
+
uri: string;
|
|
44
|
+
digest: string;
|
|
45
|
+
root: SyntaxElement;
|
|
46
|
+
}>;
|
|
47
|
+
export type LoadingErrorCategory = "invalid-schema" | "unsupported-capability" | "resource-limit" | "transport";
|
|
48
|
+
export declare class SchemaLoadingError extends Error {
|
|
49
|
+
readonly category: LoadingErrorCategory;
|
|
50
|
+
readonly source?: SyntaxSource | undefined;
|
|
51
|
+
constructor(category: LoadingErrorCategory, message: string, source?: SyntaxSource | undefined);
|
|
52
|
+
}
|
|
53
|
+
export declare function syntaxAttribute(node: SyntaxElement, local: string, namespace?: string): string | undefined;
|
|
54
|
+
export declare function syntaxElements(node: SyntaxElement, namespace?: string, local?: string): SyntaxElement[];
|
|
55
|
+
/** One range authority for name predicates and the private fixed-S4S pattern consumer. */
|
|
56
|
+
export declare const XML_NAME_RANGES: Readonly<{
|
|
57
|
+
start: string;
|
|
58
|
+
character: string;
|
|
59
|
+
}>;
|
|
60
|
+
/** Shared XML name grammar for loader QNames and schema-declared operands. */
|
|
61
|
+
export declare const isXmlNCName: (value: string) => boolean;
|
|
62
|
+
export declare const isXmlName: (value: string) => boolean;
|
|
63
|
+
export declare const isXmlNmtoken: (value: string) => boolean;
|
|
64
|
+
export declare function resolveLexicalQName(lexical: string, node: SyntaxElement): ExpandedName;
|
|
65
|
+
/** Decode private metadata text; original bytes remain the digest and snapshot authority.
|
|
66
|
+
* @remarks ISO-8859-1 maps every byte to the same code point, including C1 controls.
|
|
67
|
+
* HTTP charset headers are not encoding authority here. Runtime XML uses its existing policy.
|
|
68
|
+
* @throws SchemaLoadingError For malformed bytes or incompatible/unsupported declarations.
|
|
69
|
+
*/
|
|
70
|
+
export declare function decodeMetadataXml(bytes: Uint8Array): string;
|
|
71
|
+
/** Positions are one-based lines/columns and zero-based UTF-16 offsets in decoded XML. */
|
|
72
|
+
export interface OrderedSyntaxOptions {
|
|
73
|
+
/** Internal metadata boundary; payload/capsule callers retain the existing encoding policy. */
|
|
74
|
+
metadataEncoding?: boolean;
|
|
75
|
+
maxDepth?: number;
|
|
76
|
+
/** Optional bounded runtime boundary; legacy schema callers retain their policy. */
|
|
77
|
+
maxBytes?: number;
|
|
78
|
+
maxNodes?: number;
|
|
79
|
+
maxText?: number;
|
|
80
|
+
xml10Only?: boolean;
|
|
81
|
+
chargeWork?: (amount: number) => void;
|
|
82
|
+
reserveNode?: () => void;
|
|
83
|
+
}
|
|
84
|
+
export declare function parseOrderedSyntax(bytes: Uint8Array, uri: string, options?: OrderedSyntaxOptions): SyntaxDocument;
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
/** Ordered XML syntax boundary for the unreleased faithful compiler. */
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import { SaxesParser } from "saxes";
|
|
4
|
+
export const XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
|
|
5
|
+
export const XSD_NAMESPACE = "http://www.w3.org/2001/XMLSchema";
|
|
6
|
+
export const WSDL_NAMESPACE = "http://schemas.xmlsoap.org/wsdl/";
|
|
7
|
+
export const DEFAULT_SYNTAX_DEPTH = 256;
|
|
8
|
+
export class SchemaLoadingError extends Error {
|
|
9
|
+
category;
|
|
10
|
+
source;
|
|
11
|
+
constructor(category, message, source) {
|
|
12
|
+
super(message);
|
|
13
|
+
this.category = category;
|
|
14
|
+
this.source = source;
|
|
15
|
+
this.name = "SchemaLoadingError";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export function syntaxAttribute(node, local, namespace = "") {
|
|
19
|
+
return node.attributes.find(a => a.name.local === local && a.name.namespace === namespace)?.value;
|
|
20
|
+
}
|
|
21
|
+
export function syntaxElements(node, namespace, local) {
|
|
22
|
+
return node.children.filter((n) => n.kind === "element"
|
|
23
|
+
&& (namespace === undefined || n.name.namespace === namespace)
|
|
24
|
+
&& (local === undefined || n.name.local === local));
|
|
25
|
+
}
|
|
26
|
+
// XML 1.0 (fifth edition) NCName; QName values use default namespaces, attributes do not.
|
|
27
|
+
const ncStart = "A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u{10000}-\\u{EFFFF}";
|
|
28
|
+
/** One range authority for name predicates and the private fixed-S4S pattern consumer. */
|
|
29
|
+
export const XML_NAME_RANGES = Object.freeze({ start: ncStart + ':',
|
|
30
|
+
character: ncStart + ':\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040' });
|
|
31
|
+
const ncName = new RegExp(`^[${ncStart}][${ncStart}\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`, "u");
|
|
32
|
+
/** Shared XML name grammar for loader QNames and schema-declared operands. */
|
|
33
|
+
export const isXmlNCName = (value) => ncName.test(value);
|
|
34
|
+
const xmlName = new RegExp(`^[${XML_NAME_RANGES.start}][${XML_NAME_RANGES.character}]*$`, "u");
|
|
35
|
+
const xmlNmtoken = new RegExp(`^[${XML_NAME_RANGES.character}]+$`, "u");
|
|
36
|
+
export const isXmlName = (value) => xmlName.test(value);
|
|
37
|
+
export const isXmlNmtoken = (value) => xmlNmtoken.test(value);
|
|
38
|
+
export function resolveLexicalQName(lexical, node) {
|
|
39
|
+
const parts = lexical.replace(/^[\t\r\n ]+|[\t\r\n ]+$/g, "").split(":");
|
|
40
|
+
if (parts.length > 2 || parts.some(p => !ncName.test(p))) {
|
|
41
|
+
throw new SchemaLoadingError("invalid-schema", "Invalid lexical QName", node.source);
|
|
42
|
+
}
|
|
43
|
+
const prefix = parts.length === 2 ? parts[0] : "";
|
|
44
|
+
const namespace = node.namespaces[prefix];
|
|
45
|
+
if (prefix && !namespace)
|
|
46
|
+
throw new SchemaLoadingError("invalid-schema", "Unbound QName prefix", node.source);
|
|
47
|
+
return Object.freeze({ namespace: namespace ?? "", local: parts.at(-1) });
|
|
48
|
+
}
|
|
49
|
+
const xmlEncodingDeclaration = /^<\?xml\s[^?]*encoding\s*=\s*["']([^"']+)["']/i;
|
|
50
|
+
/** Decode private metadata text; original bytes remain the digest and snapshot authority.
|
|
51
|
+
* @remarks ISO-8859-1 maps every byte to the same code point, including C1 controls.
|
|
52
|
+
* HTTP charset headers are not encoding authority here. Runtime XML uses its existing policy.
|
|
53
|
+
* @throws SchemaLoadingError For malformed bytes or incompatible/unsupported declarations.
|
|
54
|
+
*/
|
|
55
|
+
export function decodeMetadataXml(bytes) {
|
|
56
|
+
return decodeXml(bytes, true, true);
|
|
57
|
+
}
|
|
58
|
+
function decodeXml(bytes, strictBom = false, metadata = false) {
|
|
59
|
+
let encoding = bytes[0] === 0xff && bytes[1] === 0xfe ? "utf-16le"
|
|
60
|
+
: bytes[0] === 0xfe && bytes[1] === 0xff ? "utf-16be" : "utf-8";
|
|
61
|
+
try {
|
|
62
|
+
const buffer = Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
63
|
+
// @why Sniff only an ASCII declaration, never guess Latin1 after UTF-8 failure.
|
|
64
|
+
// A BOM fixes the encoding and must agree with the decoded declaration.
|
|
65
|
+
if (metadata && encoding === 'utf-8' && !(bytes[0] === 0xef && bytes[1] === 0xbb && bytes[2] === 0xbf)) {
|
|
66
|
+
const end = buffer.indexOf('>');
|
|
67
|
+
const declaration = xmlEncodingDeclaration.exec(buffer.toString('latin1', 0, end < 0 ? 0 : end + 1))?.[1].toLowerCase();
|
|
68
|
+
if (declaration === 'iso-8859-1')
|
|
69
|
+
encoding = 'iso-8859-1';
|
|
70
|
+
}
|
|
71
|
+
// TextDecoder's ISO label aliases Windows-1252; Buffer supplies actual ISO byte identity.
|
|
72
|
+
const text = encoding === 'iso-8859-1' ? buffer.toString('latin1') : new TextDecoder(encoding, { fatal: true }).decode(bytes);
|
|
73
|
+
if (strictBom && text.startsWith('\ufeff'))
|
|
74
|
+
throw new SchemaLoadingError('invalid-schema', 'Multiple XML byte order marks');
|
|
75
|
+
const declared = xmlEncodingDeclaration.exec(text)?.[1].toLowerCase();
|
|
76
|
+
const allowed = encoding === 'iso-8859-1' ? [encoding] : encoding === 'utf-8' ? ['utf-8', 'utf8'] : ['utf-16', encoding];
|
|
77
|
+
if (declared && !allowed.includes(declared)) {
|
|
78
|
+
throw new SchemaLoadingError("unsupported-capability", "Unsupported XML byte encoding");
|
|
79
|
+
}
|
|
80
|
+
return text;
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
if (error instanceof SchemaLoadingError)
|
|
84
|
+
throw error;
|
|
85
|
+
throw new SchemaLoadingError("invalid-schema", "Invalid XML byte encoding");
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
export function parseOrderedSyntax(bytes, uri, options = {}) {
|
|
89
|
+
const maxDepth = options.maxDepth ?? DEFAULT_SYNTAX_DEPTH;
|
|
90
|
+
if (!Number.isSafeInteger(maxDepth) || maxDepth < 1)
|
|
91
|
+
throw new RangeError("maxDepth must be a positive safe integer");
|
|
92
|
+
for (const key of ['maxBytes', 'maxNodes', 'maxText']) {
|
|
93
|
+
const value = options[key];
|
|
94
|
+
if (value !== undefined && (!Number.isSafeInteger(value) || value < 1))
|
|
95
|
+
throw new RangeError(`${key} must be a positive safe integer`);
|
|
96
|
+
}
|
|
97
|
+
try {
|
|
98
|
+
new URL(uri);
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
throw new SchemaLoadingError("invalid-schema", "An absolute source URI is required");
|
|
102
|
+
}
|
|
103
|
+
if (options.maxBytes !== undefined && bytes.byteLength > options.maxBytes)
|
|
104
|
+
throw new SchemaLoadingError('resource-limit', 'XML byte limit');
|
|
105
|
+
// Reserve decoding, hash, line index and SAX token buffers before their bulk
|
|
106
|
+
// intrinsics. Tokens (including ignored comments/PI/DTD) are bounded by bytes.
|
|
107
|
+
const charge = (amount) => options.chargeWork?.(amount);
|
|
108
|
+
charge(4096 + bytes.byteLength * 64);
|
|
109
|
+
const digest = createHash("sha256").update(bytes).digest("hex");
|
|
110
|
+
const text = options.metadataEncoding ? decodeMetadataXml(bytes) : decodeXml(bytes, options.xml10Only);
|
|
111
|
+
const lines = [0];
|
|
112
|
+
for (let i = 0; i < text.length; i++) {
|
|
113
|
+
if (text[i] === "\r") {
|
|
114
|
+
if (text[i + 1] === "\n")
|
|
115
|
+
i++;
|
|
116
|
+
lines.push(i + 1);
|
|
117
|
+
}
|
|
118
|
+
else if (text[i] === "\n")
|
|
119
|
+
lines.push(i + 1);
|
|
120
|
+
}
|
|
121
|
+
const position = (offset) => {
|
|
122
|
+
let low = 0, high = lines.length;
|
|
123
|
+
while (low + 1 < high) {
|
|
124
|
+
const mid = (low + high) >>> 1;
|
|
125
|
+
if (lines[mid] <= offset)
|
|
126
|
+
low = mid;
|
|
127
|
+
else
|
|
128
|
+
high = mid;
|
|
129
|
+
}
|
|
130
|
+
return Object.freeze({ offset, line: low + 1, column: offset - lines[low] + 1 });
|
|
131
|
+
};
|
|
132
|
+
const source = (path, start, end) => Object.freeze({ uri, digest, path, start: position(start), end: position(end) });
|
|
133
|
+
const stack = [];
|
|
134
|
+
let root;
|
|
135
|
+
let tagStart = 0, cursor = 0;
|
|
136
|
+
const parser = new SaxesParser({ xmlns: true });
|
|
137
|
+
let nodes = 0, textUnits = 0;
|
|
138
|
+
const fail = (category, message) => {
|
|
139
|
+
throw new SchemaLoadingError(category, message, source(stack.at(-1)?.source.path ?? "/0", tagStart, parser.position));
|
|
140
|
+
};
|
|
141
|
+
parser.on("error", () => fail("invalid-schema", "Malformed XML or unresolved entity reference"));
|
|
142
|
+
parser.on("doctype", () => fail("unsupported-capability", "DTDs and entity declarations are forbidden"));
|
|
143
|
+
parser.on('xmldecl', declaration => {
|
|
144
|
+
if (options.xml10Only && declaration.version !== '1.0')
|
|
145
|
+
fail('unsupported-capability', 'Only XML 1.0 is supported');
|
|
146
|
+
});
|
|
147
|
+
const reserveNode = () => {
|
|
148
|
+
charge(512);
|
|
149
|
+
if (options.maxNodes !== undefined && nodes >= options.maxNodes)
|
|
150
|
+
fail('resource-limit', 'XML node limit');
|
|
151
|
+
options.reserveNode?.();
|
|
152
|
+
nodes++;
|
|
153
|
+
};
|
|
154
|
+
parser.on("opentagstart", () => { tagStart = text.lastIndexOf("<", parser.position - 1); });
|
|
155
|
+
parser.on("opentag", tag => {
|
|
156
|
+
if (stack.length >= maxDepth)
|
|
157
|
+
fail("resource-limit", `XML syntax depth exceeds ${maxDepth} elements`);
|
|
158
|
+
const parent = stack.at(-1);
|
|
159
|
+
reserveNode();
|
|
160
|
+
// Inherited maps/path copies can be larger than the current lexical tag.
|
|
161
|
+
charge(512 + (parent?.source.path.length ?? 0) * 4);
|
|
162
|
+
for (const prefix in parent?.namespaces)
|
|
163
|
+
charge(128 + (prefix.length + parent.namespaces[prefix].length) * 4);
|
|
164
|
+
for (const prefix in tag.ns)
|
|
165
|
+
if (Object.hasOwn(tag.ns, prefix))
|
|
166
|
+
charge(128 + (prefix.length + tag.ns[prefix].length) * 4);
|
|
167
|
+
const attributes = Object.values(tag.attributes).filter(a => a.uri !== "http://www.w3.org/2000/xmlns/")
|
|
168
|
+
.map(a => Object.freeze({ name: Object.freeze({ namespace: a.uri, local: a.local }), lexicalName: a.name, value: a.value }));
|
|
169
|
+
const namespaces = Object.freeze(Object.assign(Object.create(null), parent?.namespaces ?? { xml: XML_NAMESPACE, "": "" }, tag.ns));
|
|
170
|
+
const base = attributes.find(a => a.name.namespace === XML_NAMESPACE && a.name.local === "base")?.value;
|
|
171
|
+
let baseUri;
|
|
172
|
+
// Relative xml:base resolution may copy an inherited URI much larger than
|
|
173
|
+
// this tag. Charge its input/output envelope before the URL intrinsic.
|
|
174
|
+
if (base !== undefined)
|
|
175
|
+
charge(512 + (base.length + (parent?.baseUri ?? uri).length) * 16);
|
|
176
|
+
try {
|
|
177
|
+
baseUri = base === undefined ? parent?.baseUri ?? uri : new URL(base, parent?.baseUri ?? uri).href;
|
|
178
|
+
}
|
|
179
|
+
catch {
|
|
180
|
+
return fail("invalid-schema", "Invalid xml:base URI");
|
|
181
|
+
}
|
|
182
|
+
const node = { kind: "element", name: Object.freeze({ namespace: tag.uri, local: tag.local }), lexicalName: tag.name,
|
|
183
|
+
attributes: Object.freeze(attributes), namespaces, baseUri, children: [], source: source(parent ? `${parent.source.path}/${parent.children.length}` : "/0", tagStart, parser.position) };
|
|
184
|
+
if (parent)
|
|
185
|
+
parent.children.push(node);
|
|
186
|
+
else
|
|
187
|
+
root = node;
|
|
188
|
+
stack.push(node);
|
|
189
|
+
cursor = parser.position;
|
|
190
|
+
});
|
|
191
|
+
const appendText = (value, start, end) => {
|
|
192
|
+
const parent = stack.at(-1);
|
|
193
|
+
if (parent) {
|
|
194
|
+
if (options.maxText !== undefined && value.length > options.maxText - textUnits)
|
|
195
|
+
fail('resource-limit', 'XML text limit');
|
|
196
|
+
textUnits += value.length;
|
|
197
|
+
reserveNode();
|
|
198
|
+
charge(512 + value.length * 4 + parent.source.path.length * 4);
|
|
199
|
+
parent.children.push(Object.freeze({ kind: "text", value, source: source(`${parent.source.path}/${parent.children.length}`, start, end) }));
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
parser.on("text", value => { const end = text[parser.position - 1] === "<" ? parser.position - 1 : parser.position; appendText(value, cursor, end); cursor = end; });
|
|
203
|
+
parser.on("cdata", value => { appendText(value, cursor + 9, parser.position - 3); cursor = parser.position; });
|
|
204
|
+
parser.on("comment", () => { cursor = parser.position + 1; });
|
|
205
|
+
parser.on("processinginstruction", () => { cursor = parser.position; });
|
|
206
|
+
parser.on("closetag", () => {
|
|
207
|
+
const node = stack.pop();
|
|
208
|
+
node.source = source(node.source.path, node.source.start.offset, parser.position);
|
|
209
|
+
Object.freeze(node.children);
|
|
210
|
+
Object.freeze(node);
|
|
211
|
+
cursor = parser.position;
|
|
212
|
+
});
|
|
213
|
+
// Bounded cooperative checkpoints even while a SAX token is buffered.
|
|
214
|
+
for (let offset = 0; offset < text.length; offset += 1024) {
|
|
215
|
+
charge(1024);
|
|
216
|
+
parser.write(text.slice(offset, offset + 1024));
|
|
217
|
+
}
|
|
218
|
+
parser.close();
|
|
219
|
+
if (!root)
|
|
220
|
+
fail("invalid-schema", "Missing XML root element");
|
|
221
|
+
return Object.freeze({ uri, digest, root: root });
|
|
222
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Polynomial upper bound for cached resolution depth, including cycle closure. */
|
|
2
|
+
export type ResolutionArc = Readonly<{
|
|
3
|
+
to: string;
|
|
4
|
+
cost: 0 | 1;
|
|
5
|
+
}>;
|
|
6
|
+
export declare function resolutionDepthBound(root: string, graph: ReadonlyMap<string, readonly ResolutionArc[]>, terminals: ReadonlySet<string>): number;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export function resolutionDepthBound(root, graph, terminals) {
|
|
2
|
+
const arcs = (key) => terminals.has(key) ? [] : graph.get(key) ?? [];
|
|
3
|
+
const seen = new Set();
|
|
4
|
+
const order = [];
|
|
5
|
+
const stack = [{ key: root, exit: false }];
|
|
6
|
+
const reverse = new Map();
|
|
7
|
+
while (stack.length) {
|
|
8
|
+
const { key, exit } = stack.pop();
|
|
9
|
+
if (exit) {
|
|
10
|
+
order.push(key);
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
if (seen.has(key))
|
|
14
|
+
continue;
|
|
15
|
+
seen.add(key);
|
|
16
|
+
stack.push({ key, exit: true });
|
|
17
|
+
for (const edge of arcs(key)) {
|
|
18
|
+
const incoming = reverse.get(edge.to) ?? [];
|
|
19
|
+
incoming.push(key);
|
|
20
|
+
reverse.set(edge.to, incoming);
|
|
21
|
+
stack.push({ key: edge.to, exit: false });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const component = new Map();
|
|
25
|
+
const groups = [];
|
|
26
|
+
for (const rootKey of order.reverse()) {
|
|
27
|
+
if (component.has(rootKey))
|
|
28
|
+
continue;
|
|
29
|
+
const index = groups.length;
|
|
30
|
+
const members = [];
|
|
31
|
+
const pending = [rootKey];
|
|
32
|
+
while (pending.length) {
|
|
33
|
+
const key = pending.pop();
|
|
34
|
+
if (component.has(key))
|
|
35
|
+
continue;
|
|
36
|
+
component.set(key, index);
|
|
37
|
+
members.push(key);
|
|
38
|
+
for (const previous of reverse.get(key) ?? [])
|
|
39
|
+
pending.push(previous);
|
|
40
|
+
}
|
|
41
|
+
groups.push(members);
|
|
42
|
+
}
|
|
43
|
+
const internal = new Map();
|
|
44
|
+
const weights = groups.map((members, index) => members.reduce((sum, key) => {
|
|
45
|
+
const cost = arcs(key).reduce((max, edge) => component.get(edge.to) === index ? Math.max(max, edge.cost) : max, 0);
|
|
46
|
+
internal.set(key, cost);
|
|
47
|
+
return sum + cost;
|
|
48
|
+
}, 0));
|
|
49
|
+
// SCC indices follow source-to-sink order, so all exit heights are already known.
|
|
50
|
+
const heights = groups.map(() => 0);
|
|
51
|
+
for (let index = groups.length - 1; index >= 0; index--) {
|
|
52
|
+
let height = weights[index];
|
|
53
|
+
for (const key of groups[index]) {
|
|
54
|
+
for (const edge of arcs(key)) {
|
|
55
|
+
const target = component.get(edge.to);
|
|
56
|
+
if (target !== index) {
|
|
57
|
+
// An exit replaces that node's internal edge, rather than closing then exiting.
|
|
58
|
+
height = Math.max(height, weights[index] - internal.get(key) + edge.cost + heights[target]);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
heights[index] = height;
|
|
63
|
+
}
|
|
64
|
+
return heights[component.get(root)];
|
|
65
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { SyntaxDocument, SyntaxElement, SyntaxSource } from "./orderedSyntax.js";
|
|
2
|
+
import type { LoadingLimits, OfflineSchemaResource, ResourceMetadata, SchemaResourcePolicy } from "./schemaResources.js";
|
|
3
|
+
export type SchemaContext = Readonly<{
|
|
4
|
+
kind: "root" | "inline" | "include" | "import";
|
|
5
|
+
namespace: string;
|
|
6
|
+
}>;
|
|
7
|
+
export type SchemaInterpretation = Readonly<{
|
|
8
|
+
key: string;
|
|
9
|
+
syntax: SyntaxElement;
|
|
10
|
+
documentUri: string;
|
|
11
|
+
digest: string;
|
|
12
|
+
baseUri: string;
|
|
13
|
+
targetNamespace: string;
|
|
14
|
+
context: SchemaContext;
|
|
15
|
+
}>;
|
|
16
|
+
export type ResolutionEdge = Readonly<{
|
|
17
|
+
kind: "include" | "import" | "wsdl-import";
|
|
18
|
+
from: string;
|
|
19
|
+
to?: string;
|
|
20
|
+
referenceUri?: string;
|
|
21
|
+
source: SyntaxSource;
|
|
22
|
+
cycle: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
export type SchemaInput = Readonly<{
|
|
25
|
+
root: SyntaxDocument;
|
|
26
|
+
documents: readonly SyntaxDocument[];
|
|
27
|
+
schemas: readonly SchemaInterpretation[];
|
|
28
|
+
resources: readonly ResourceMetadata[];
|
|
29
|
+
resourceAliases: ReadonlyMap<string, string>;
|
|
30
|
+
edges: readonly ResolutionEdge[];
|
|
31
|
+
limits: LoadingLimits;
|
|
32
|
+
metrics: Readonly<{
|
|
33
|
+
resources: number;
|
|
34
|
+
totalBytes: number;
|
|
35
|
+
ioMs: number;
|
|
36
|
+
}>;
|
|
37
|
+
}>;
|
|
38
|
+
/** Internal bridge for one retained-source invocation. Returned bytes are data, not authority. */
|
|
39
|
+
export declare function copyOriginalSchemaResource(input: SchemaInput, uri: string, chargeWork: (amount: number) => void): Uint8Array;
|
|
40
|
+
export declare function assertLoadedSchemaInput(input: SchemaInput): void;
|
|
41
|
+
export declare function schemaInterpretationKey(node: SyntaxElement, targetNamespace: string, context: SchemaContext): string;
|
|
42
|
+
export type SchemaInputOptions = {
|
|
43
|
+
/** Generated logical root for independently authorized physical snapshots; confers no I/O authority. */
|
|
44
|
+
sourceUri?: string;
|
|
45
|
+
/** Diagnostic observation only; partial documents never establish loading completeness or eligibility. */
|
|
46
|
+
onDocument?: (document: SyntaxDocument) => void;
|
|
47
|
+
signal?: AbortSignal;
|
|
48
|
+
/** Optional request accounting used by the additive assessment boundary. */
|
|
49
|
+
chargeWork?: (amount: number) => void;
|
|
50
|
+
policy: SchemaResourcePolicy;
|
|
51
|
+
limits?: Partial<LoadingLimits>;
|
|
52
|
+
offlineResources?: ReadonlyMap<string, OfflineSchemaResource>;
|
|
53
|
+
/**
|
|
54
|
+
* Explicit resource locations for XSD imports without schemaLocation.
|
|
55
|
+
* @remarks Keys are exact namespace names (including the empty namespace).
|
|
56
|
+
* Locations resolve against the caller's working directory, never the importing
|
|
57
|
+
* document. Explicit schemaLocation attributes take precedence. Resource policy,
|
|
58
|
+
* digests, namespace matching and loading limits still apply; no namespace is fetched implicitly.
|
|
59
|
+
* @see https://www.w3.org/TR/2004/REC-xmlschema-1-20041028/#composition-schemaImport
|
|
60
|
+
*/
|
|
61
|
+
namespaceLocations?: ReadonlyMap<string, string>;
|
|
62
|
+
};
|
|
63
|
+
/** Prepare a closed input set from independently authorized physical metadata snapshots.
|
|
64
|
+
* @remarks Logical import URIs never initiate I/O here. The later native loader still checks their explicit origin/root
|
|
65
|
+
* permissions. Missing snapshots refuse rather than falling back to network or to artifact-embedded bytes.
|
|
66
|
+
* @returns The actual physical root URI and complete offline loading configuration.
|
|
67
|
+
* @throws SchemaLoadingError For non-file physical inputs, duplicates, denied roots or unavailable files.
|
|
68
|
+
*/
|
|
69
|
+
export declare function prepareSchemaSnapshotFiles(root: string, files: readonly {
|
|
70
|
+
readonly uri: string;
|
|
71
|
+
readonly file: string;
|
|
72
|
+
readonly canonicalUri?: string;
|
|
73
|
+
}[], options: Omit<SchemaInputOptions, 'offlineResources'>): Promise<{
|
|
74
|
+
source: string;
|
|
75
|
+
loading: SchemaInputOptions;
|
|
76
|
+
}>;
|
|
77
|
+
/** A fresh compilation-scoped snapshot, with no implicit network or filesystem permission. */
|
|
78
|
+
export declare function loadSchemaInput(source: string, options: SchemaInputOptions): Promise<SchemaInput>;
|
|
79
|
+
/** Internal faithful source entry; preserves syntax and the legacy public entry. */
|
|
80
|
+
export declare function loadSemanticSchemaInput(source: string, options: SchemaInputOptions): Promise<SchemaInput>;
|