@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 { assertSemanticContext } from './semanticContext.js';
|
|
2
|
+
import { schemaScalarContext, SchemaAssessmentError, SchemaOperandContextError } from './schemaScalarContext.js';
|
|
3
|
+
import { scalarSchemaAssessment } from './scalarSchemaAssessment.js';
|
|
4
|
+
import { collectSemanticTypeDependencies } from './semanticTypeDependencies.js';
|
|
5
|
+
import { resolveSemanticType } from './schemaTypeIdentity.js';
|
|
6
|
+
const cache = new WeakMap();
|
|
7
|
+
const facetAssessors = new WeakMap();
|
|
8
|
+
const facetReaders = new WeakMap();
|
|
9
|
+
const recipeReaders = new WeakMap();
|
|
10
|
+
const generatedReaders = new WeakMap();
|
|
11
|
+
const generatedReceipts = new WeakMap();
|
|
12
|
+
const failureContexts = new WeakMap();
|
|
13
|
+
function makeKernel(context) {
|
|
14
|
+
const c = schemaScalarContext(context);
|
|
15
|
+
const originalFacet = (type, lexical, owner) => {
|
|
16
|
+
const original = context.originalContext();
|
|
17
|
+
createSchemaScalarKernel(original);
|
|
18
|
+
const { result, phase } = facetAssessors.get(original)(type, lexical, owner);
|
|
19
|
+
if (result.kind === 'resource-limit') {
|
|
20
|
+
context.budget.chargeWork();
|
|
21
|
+
throw new Error('Unreachable exhausted scalar budget');
|
|
22
|
+
}
|
|
23
|
+
if (result.kind !== 'checked') {
|
|
24
|
+
const selected = original.lookup(result.component);
|
|
25
|
+
const error = selected.kind !== 'found' ? new SchemaOperandContextError(result.component, result.rule)
|
|
26
|
+
: new SchemaAssessmentError(result.kind === 'unresolved' ? 'missing-prerequisite' : result.kind, result.rule, result.message, selected.node, result.source);
|
|
27
|
+
// The original datatype's own formation belongs to the original schema.
|
|
28
|
+
// A caller-supplied lexical operand can fail that valid datatype without
|
|
29
|
+
// making the original schema invalid.
|
|
30
|
+
if (phase === 'type')
|
|
31
|
+
failureContexts.set(error, original);
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
context.budget.chargeWork(result.obligations.length * 4 + 1);
|
|
35
|
+
return { operand: result.value, typeDependencies: result.typeDependencies, obligations: result.obligations.map(obligation => ({ ...obligation, contextId: obligation.contextId ?? original.contextId })) };
|
|
36
|
+
};
|
|
37
|
+
const originalRecipe = (reference, owner) => {
|
|
38
|
+
const original = context.originalContext();
|
|
39
|
+
createSchemaScalarKernel(original);
|
|
40
|
+
const selected = reference.kind === 'original-generated' ? original.sourceNode(reference.owner) : reference.kind === 'builtin' ? owner : (() => { const found = original.resolve(reference); return found.kind === 'found' ? found.node : owner; })();
|
|
41
|
+
const reader = recipeReaders.get(original), diagnostic = selected ?? owner;
|
|
42
|
+
reader.select(reference, diagnostic);
|
|
43
|
+
try {
|
|
44
|
+
return reader.read(reference, diagnostic);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
if (error instanceof SchemaAssessmentError || error instanceof SchemaOperandContextError)
|
|
48
|
+
failureContexts.set(error, original);
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const core = scalarSchemaAssessment(c, { schemaOperandsOnly: true, originalFacet, originalRecipe });
|
|
53
|
+
recipeReaders.set(context, { select: core.selectOperand, read: core.readOriginalRecipe });
|
|
54
|
+
const declaredPlan = (reference, owner) => {
|
|
55
|
+
const plan = core.ensure(reference, c.get(owner));
|
|
56
|
+
if (plan.primitive === 'NOTATION' && !plan.layers.some(layer => layer.facets.some(facet => facet.name === 'enumeration')))
|
|
57
|
+
c.fail(c.get(owner), 'enumeration-required-notation', 'NOTATION cannot be used directly as a declared datatype');
|
|
58
|
+
return plan;
|
|
59
|
+
};
|
|
60
|
+
facetReaders.set(context, {
|
|
61
|
+
read: (reference, owner) => { declaredPlan(reference, owner); return core.readFacetProperties(reference, c.get(owner)); },
|
|
62
|
+
compare: (left, right, owner) => core.compareFacetProperties(left, right, c.get(owner)),
|
|
63
|
+
annotations: (left, right, owner) => core.compareFacetAnnotations(left, right, c.get(owner)),
|
|
64
|
+
});
|
|
65
|
+
const input = (value) => context.budget.freeze(context.budget.snapshot(value));
|
|
66
|
+
// Reference ownership is issued by the prepared context; caller lexical and
|
|
67
|
+
// constraint data still take their own deep snapshot on every invocation.
|
|
68
|
+
const ownReference = (reference) => context.ownTypeReference(reference);
|
|
69
|
+
const publishedPlans = new WeakMap();
|
|
70
|
+
let publishedContentIdentities;
|
|
71
|
+
const issuedPlans = new WeakSet();
|
|
72
|
+
const publishPlan = (plan) => {
|
|
73
|
+
context.budget.chargeWork(3);
|
|
74
|
+
const cached = publishedPlans.get(plan);
|
|
75
|
+
if (cached)
|
|
76
|
+
return cached;
|
|
77
|
+
const owned = input(plan);
|
|
78
|
+
context.budget.chargeWork(2);
|
|
79
|
+
publishedPlans.set(plan, owned);
|
|
80
|
+
issuedPlans.add(owned);
|
|
81
|
+
return owned;
|
|
82
|
+
};
|
|
83
|
+
let obligations = [];
|
|
84
|
+
let typeReads;
|
|
85
|
+
const remember = (required) => {
|
|
86
|
+
for (const obligation of required) {
|
|
87
|
+
context.budget.chargeWork(8 + obligation.component.length);
|
|
88
|
+
if (!obligations.some(prior => prior.rule === obligation.rule && prior.component === obligation.component && (prior.contextId ?? context.contextId) === (obligation.contextId ?? context.contextId)))
|
|
89
|
+
obligations.push(obligation);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
const capture = (reference, owner) => {
|
|
93
|
+
const plan = declaredPlan(reference, owner);
|
|
94
|
+
remember(plan.obligations ?? []);
|
|
95
|
+
typeReads.add(core.typeDependencies(reference, c.get(owner)));
|
|
96
|
+
return plan;
|
|
97
|
+
};
|
|
98
|
+
const run = (operation) => context.budget.guard(() => {
|
|
99
|
+
try {
|
|
100
|
+
context.budget.chargeWork();
|
|
101
|
+
obligations = [];
|
|
102
|
+
typeReads = collectSemanticTypeDependencies(context);
|
|
103
|
+
const value = operation();
|
|
104
|
+
// Original references and source operands are immutable prepared data. The
|
|
105
|
+
// returned value is separately reserved before publishing; no partial plan.
|
|
106
|
+
context.budget.chargeWork(3);
|
|
107
|
+
const owned = typeof value === 'object' && value !== null && issuedPlans.has(value)
|
|
108
|
+
? { value, obligations: input(obligations) }
|
|
109
|
+
: context.budget.freeze(context.budget.snapshot({ value, obligations }));
|
|
110
|
+
const typeDependencies = typeReads.snapshot();
|
|
111
|
+
context.budget.chargeWork(24 + context.contextId.length);
|
|
112
|
+
return Object.freeze({ kind: 'checked', value: owned.value, contextId: context.contextId, authority: 'XSD10-schema-scalars-DT01-A-v1', obligations: owned.obligations, typeDependencies });
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
if (error instanceof SchemaOperandContextError) {
|
|
116
|
+
const origin = failureContexts.get(error);
|
|
117
|
+
return context.budget.freeze(context.budget.snapshot({ kind: 'unresolved', rule: error.rule, message: error.message,
|
|
118
|
+
component: error.component, ...(origin ? { contextId: origin.contextId } : {}) }));
|
|
119
|
+
}
|
|
120
|
+
if (!(error instanceof SchemaAssessmentError))
|
|
121
|
+
throw error;
|
|
122
|
+
const origin = failureContexts.get(error);
|
|
123
|
+
const result = { kind: error.category === 'missing-prerequisite' || error.category === 'scalar-indeterminate' ? 'unresolved' : error.category,
|
|
124
|
+
rule: error.rule, message: error.message, component: error.node.id, source: error.source, ...(origin ? { contextId: origin.contextId } : {}) };
|
|
125
|
+
return context.budget.freeze(context.budget.snapshot(result));
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
const assess = (reference, lexical, owner) => run(() => {
|
|
129
|
+
context.budget.chargeWork(4);
|
|
130
|
+
const frozen = { reference: ownReference(reference), lexical: input(lexical) }, node = c.get(owner);
|
|
131
|
+
const plan = capture(frozen.reference, owner);
|
|
132
|
+
return { type: frozen.reference, lexical: frozen.lexical, owner, operand: core.assess(frozen.reference, frozen.lexical, node), obligations: plan.obligations };
|
|
133
|
+
});
|
|
134
|
+
const assessValue = (reference, constraint, owner) => run(() => {
|
|
135
|
+
context.budget.chargeWork(4);
|
|
136
|
+
const safe = ownReference(reference), copied = input(constraint), node = c.get(owner);
|
|
137
|
+
const checked = core.assessConstraint(safe, copied, node), plan = capture(safe, owner);
|
|
138
|
+
return { type: safe, lexical: copied.lexical, owner, operand: checked.value, obligations: plan.obligations };
|
|
139
|
+
});
|
|
140
|
+
const contentIdentity = (reference, owner) => context.budget.guard(() => {
|
|
141
|
+
const safe = ownReference(reference);
|
|
142
|
+
if (!publishedContentIdentities) {
|
|
143
|
+
context.budget.chargeWork(3);
|
|
144
|
+
publishedContentIdentities = { children: new Map() };
|
|
145
|
+
}
|
|
146
|
+
context.budget.chargeWork(12);
|
|
147
|
+
const parts = [owner];
|
|
148
|
+
if (safe.kind === 'local')
|
|
149
|
+
parts.push('local', safe.target);
|
|
150
|
+
else if (safe.kind === 'original-generated')
|
|
151
|
+
parts.push('original-generated', safe.owner);
|
|
152
|
+
else if (safe.kind === 'builtin')
|
|
153
|
+
parts.push('builtin', safe.name.namespace, safe.name.local);
|
|
154
|
+
else {
|
|
155
|
+
parts.push('symbol', safe.role, safe.name.namespace, safe.name.local, safe.target === undefined ? 'without-target' : 'with-target');
|
|
156
|
+
if (safe.target !== undefined)
|
|
157
|
+
parts.push(safe.target);
|
|
158
|
+
}
|
|
159
|
+
let node = publishedContentIdentities;
|
|
160
|
+
for (const part of parts) {
|
|
161
|
+
context.budget.chargeWork(4 + part.length);
|
|
162
|
+
node = node?.children.get(part);
|
|
163
|
+
if (!node)
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
const prior = node?.receipt;
|
|
167
|
+
if (prior) {
|
|
168
|
+
context.budget.chargeWork(4);
|
|
169
|
+
return prior;
|
|
170
|
+
}
|
|
171
|
+
const result = run(() => { capture(safe, owner); return core.contentIdentity(safe, c.get(owner)); });
|
|
172
|
+
if (result.kind === 'checked') {
|
|
173
|
+
let location = publishedContentIdentities;
|
|
174
|
+
for (const part of parts) {
|
|
175
|
+
context.budget.chargeWork(4 + part.length);
|
|
176
|
+
let next = location.children.get(part);
|
|
177
|
+
if (!next) {
|
|
178
|
+
context.budget.chargeWork(3);
|
|
179
|
+
next = { children: new Map() };
|
|
180
|
+
location.children.set(part, next);
|
|
181
|
+
}
|
|
182
|
+
location = next;
|
|
183
|
+
}
|
|
184
|
+
context.budget.chargeWork(2);
|
|
185
|
+
location.receipt = result;
|
|
186
|
+
}
|
|
187
|
+
return result;
|
|
188
|
+
});
|
|
189
|
+
// Facet formation can assess primitive NOTATION before a usable declared
|
|
190
|
+
// restriction exists. This private path is not a declared-type certificate.
|
|
191
|
+
facetAssessors.set(context, (reference, lexical, owner) => {
|
|
192
|
+
// Called only from another guarded scalar operation in the same budget.
|
|
193
|
+
// Reserve the private phase/result envelope before the nested run can fail.
|
|
194
|
+
context.budget.chargeWork(3);
|
|
195
|
+
let phase = 'selection';
|
|
196
|
+
const result = run(() => {
|
|
197
|
+
context.budget.chargeWork(4);
|
|
198
|
+
const frozen = { reference: ownReference(reference), lexical: input(lexical) }, node = c.get(owner);
|
|
199
|
+
core.selectOperand(frozen.reference, node);
|
|
200
|
+
phase = 'type';
|
|
201
|
+
const plan = core.ensure(frozen.reference, node);
|
|
202
|
+
remember(plan.obligations ?? []);
|
|
203
|
+
typeReads.add(core.typeDependencies(frozen.reference, node));
|
|
204
|
+
phase = 'operand';
|
|
205
|
+
return core.assess(frozen.reference, frozen.lexical, node);
|
|
206
|
+
});
|
|
207
|
+
return { result, phase };
|
|
208
|
+
});
|
|
209
|
+
generatedReaders.set(context, (slot) => {
|
|
210
|
+
const result = run(() => {
|
|
211
|
+
const safe = ownReference(slot), selected = resolveSemanticType(context, safe);
|
|
212
|
+
if (selected.kind !== 'original-generated')
|
|
213
|
+
throw new SchemaOperandContextError(safe.owner, 'original-generated-membership');
|
|
214
|
+
const node = context.sourceNode(safe.owner);
|
|
215
|
+
const plan = core.ensure(safe, node);
|
|
216
|
+
remember(plan.obligations ?? []);
|
|
217
|
+
typeReads.add(core.typeDependencies(safe, node));
|
|
218
|
+
if (plan.primitive === 'NOTATION' && !plan.layers.some(layer => layer.facets.some(facet => facet.name === 'enumeration')))
|
|
219
|
+
c.fail(node, 'enumeration-required-notation', 'NOTATION cannot be used directly as a declared datatype');
|
|
220
|
+
for (const obligation of plan.obligations ?? [])
|
|
221
|
+
if (obligation.component === safe.owner && (obligation.contextId ?? context.contextId) === context.contextId && obligation.rule === 'raw-simple-facet-restriction-validity')
|
|
222
|
+
c.unresolved(node, obligation.rule, 'Generated scalar property restriction remains unresolved');
|
|
223
|
+
return { slot: safe, properties: core.contentProperties(safe, node) };
|
|
224
|
+
});
|
|
225
|
+
if (result.kind !== 'checked')
|
|
226
|
+
return result;
|
|
227
|
+
return context.budget.guard(() => {
|
|
228
|
+
context.budget.chargeWork(result.typeDependencies.length * 3 + 8);
|
|
229
|
+
const owned = context.budget.freeze(context.budget.snapshot({ slot: result.value.slot, properties: result.value.properties, obligations: result.obligations }));
|
|
230
|
+
const typeDependencies = Object.freeze(result.typeDependencies.filter(dependency => !(dependency.contextId === context.contextId && dependency.type.kind === 'original-generated' && dependency.type.owner === result.value.slot.owner)));
|
|
231
|
+
context.budget.chargeWork(24 + context.contextId.length);
|
|
232
|
+
const receipt = Object.freeze({ kind: 'checked', slot: owned.slot, contextId: context.contextId, authority: 'XSD10-original-generated-scalar-v1',
|
|
233
|
+
properties: owned.properties, typeDependencies, obligations: owned.obligations });
|
|
234
|
+
generatedReceipts.set(receipt, context);
|
|
235
|
+
return receipt;
|
|
236
|
+
});
|
|
237
|
+
});
|
|
238
|
+
return {
|
|
239
|
+
finiteImageBinaryWordViews: (views, owner) => run(() => {
|
|
240
|
+
const safe = input(views);
|
|
241
|
+
for (const view of safe) {
|
|
242
|
+
capture(ownReference(view.type), owner);
|
|
243
|
+
if (view.root)
|
|
244
|
+
capture(ownReference(view.root.type), owner);
|
|
245
|
+
for (const label of view.labels)
|
|
246
|
+
capture(ownReference(label.image), owner);
|
|
247
|
+
}
|
|
248
|
+
return core.finiteImageBinaryWordViews(safe, c.get(owner));
|
|
249
|
+
}),
|
|
250
|
+
regularBinaryWordViews: (views, owner) => run(() => {
|
|
251
|
+
const safe = input(views);
|
|
252
|
+
for (const view of safe) {
|
|
253
|
+
capture(ownReference(view.type), owner);
|
|
254
|
+
if (view.root)
|
|
255
|
+
capture(ownReference(view.root.type), owner);
|
|
256
|
+
}
|
|
257
|
+
return core.regularBinaryWordViews(safe, c.get(owner));
|
|
258
|
+
}),
|
|
259
|
+
// Unary CURRENT image only; empty admission does not exclude exclusive repeats.
|
|
260
|
+
privateAliasEndpointAdmission: (reference, owner) => run(() => {
|
|
261
|
+
const safe = ownReference(reference);
|
|
262
|
+
capture(safe, owner);
|
|
263
|
+
return core.privateAliasEndpointAdmission(safe, c.get(owner));
|
|
264
|
+
}),
|
|
265
|
+
privateAliasEndpointTuples: (inputTuple, owner) => run(() => {
|
|
266
|
+
const safe = input(inputTuple);
|
|
267
|
+
// Capture every role/constant before any local empty result, preserving
|
|
268
|
+
// genuine formation duties, source contexts and typed dependencies.
|
|
269
|
+
for (const role of safe.roles)
|
|
270
|
+
capture(ownReference(role.type), owner);
|
|
271
|
+
for (const constant of safe.constants)
|
|
272
|
+
capture(ownReference(constant.type), owner);
|
|
273
|
+
return core.privateAliasEndpointTuples(safe, c.get(owner));
|
|
274
|
+
}),
|
|
275
|
+
// Qualified word bound for the private alias sector's existing bound kinds.
|
|
276
|
+
privateAliasEndpointWordCapacity: (reference, owner) => run(() => {
|
|
277
|
+
const safe = ownReference(reference);
|
|
278
|
+
capture(safe, owner);
|
|
279
|
+
return core.privateAliasEndpointWordCapacity(safe, c.get(owner));
|
|
280
|
+
}),
|
|
281
|
+
describe: (reference, owner) => run(() => publishPlan(capture(ownReference(reference), owner))),
|
|
282
|
+
contentIdentity,
|
|
283
|
+
contentProperties: (reference, owner) => run(() => { const frozen = ownReference(reference); capture(frozen, owner); return core.contentProperties(frozen, c.get(owner)); }),
|
|
284
|
+
contentDerivation: (derived, base, owner) => run(() => { context.budget.chargeWork(4); const frozen = { derived: ownReference(derived), base: ownReference(base) }; capture(frozen.derived, owner); capture(frozen.base, owner); return core.contentDerivation(frozen.derived, frozen.base, c.get(owner)); }),
|
|
285
|
+
facetPropertiesEquivalent: (a, b, owner) => run(() => { context.budget.chargeWork(4); const frozen = { a: ownReference(a), b: ownReference(b) }; capture(frozen.a, owner); capture(frozen.b, owner); return core.facetPropertiesEquivalent(frozen.a, frozen.b, c.get(owner)); }),
|
|
286
|
+
assess, assessValue,
|
|
287
|
+
checkValue: (reference, constraint, owner) => run(() => { context.budget.chargeWork(4); const frozen = { reference: ownReference(reference), constraint: input(constraint) }; const plan = core.checkValue(frozen.reference, frozen.constraint, c.get(owner)); capture(frozen.reference, owner); return plan; }),
|
|
288
|
+
equivalent: (aType, a, bType, b, owner) => run(() => { context.budget.chargeWork(8); const frozen = { aType: ownReference(aType), a: input(a), bType: ownReference(bType), b: input(b) }; capture(frozen.aType, owner); capture(frozen.bType, owner); return core.equivalent(frozen.aType, frozen.a, frozen.bType, frozen.b, c.get(owner)); }),
|
|
289
|
+
compare: (aType, a, bType, b, owner) => run(() => {
|
|
290
|
+
context.budget.chargeWork(8);
|
|
291
|
+
const frozen = { aType: ownReference(aType), a: input(a), bType: ownReference(bType), b: input(b) }, node = c.get(owner), x = core.assess(frozen.aType, frozen.a, node), y = core.assess(frozen.bType, frozen.b, node);
|
|
292
|
+
capture(frozen.aType, owner);
|
|
293
|
+
capture(frozen.bType, owner);
|
|
294
|
+
const order = core.compare(x, y, node);
|
|
295
|
+
return order === undefined ? 'indeterminate' : order === 0 ? 'equal' : order < 0 ? 'less' : 'greater';
|
|
296
|
+
}),
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
export function createSchemaScalarKernel(context) {
|
|
300
|
+
assertSemanticContext(context);
|
|
301
|
+
let owner = cache.get(context);
|
|
302
|
+
if (!owner) {
|
|
303
|
+
owner = makeKernel(context);
|
|
304
|
+
cache.set(context, owner);
|
|
305
|
+
}
|
|
306
|
+
return owner;
|
|
307
|
+
}
|
|
308
|
+
/** Facet-only equality of two authentic contexts in one request. Annotations
|
|
309
|
+
* are reported separately; this is not complete component correspondence. */
|
|
310
|
+
export function compareSchemaFacetProperties(leftContext, leftReference, leftOwner, rightContext, rightReference, rightOwner) {
|
|
311
|
+
assertSemanticContext(leftContext);
|
|
312
|
+
assertSemanticContext(rightContext);
|
|
313
|
+
if (leftContext.budget !== rightContext.budget)
|
|
314
|
+
throw new TypeError('Scalar facet comparison requires the same authentic request and budget');
|
|
315
|
+
const budget = leftContext.budget;
|
|
316
|
+
return budget.guard(() => {
|
|
317
|
+
budget.chargeWork(12);
|
|
318
|
+
if (leftContext.originalContext() !== rightContext.originalContext())
|
|
319
|
+
throw new TypeError('Scalar facet comparison requires the same authentic request and budget');
|
|
320
|
+
const left = leftContext.ownTypeReference(leftReference), right = rightContext.ownTypeReference(rightReference);
|
|
321
|
+
const owners = budget.freeze(budget.snapshot({ left: leftOwner, right: rightOwner }));
|
|
322
|
+
budget.chargeWork(24 + leftContext.contextId.length + rightContext.contextId.length);
|
|
323
|
+
const operands = Object.freeze({
|
|
324
|
+
left: Object.freeze({ contextId: leftContext.contextId, reference: left, owner: owners.left }),
|
|
325
|
+
right: Object.freeze({ contextId: rightContext.contextId, reference: right, owner: owners.right }),
|
|
326
|
+
});
|
|
327
|
+
const obligations = [], typed = collectSemanticTypeDependencies(leftContext);
|
|
328
|
+
const remember = (required, context) => {
|
|
329
|
+
for (const obligation of required) {
|
|
330
|
+
budget.chargeWork(8 + obligation.rule.length + obligation.component.length + (obligation.contextId ?? context.contextId).length);
|
|
331
|
+
const qualified = { ...obligation, contextId: obligation.contextId ?? context.contextId };
|
|
332
|
+
let present = false;
|
|
333
|
+
for (const prior of obligations) {
|
|
334
|
+
budget.chargeWork(3 + prior.rule.length + prior.component.length + prior.contextId.length);
|
|
335
|
+
if (prior.rule === qualified.rule && prior.component === qualified.component && prior.contextId === qualified.contextId) {
|
|
336
|
+
present = true;
|
|
337
|
+
break;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
if (!present)
|
|
341
|
+
obligations.push(qualified);
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
const publish = (value) => {
|
|
345
|
+
const owned = budget.freeze(budget.snapshot(value)), typeDependencies = typed.snapshot();
|
|
346
|
+
budget.chargeWork(24);
|
|
347
|
+
return Object.freeze({ ...owned, typeDependencies });
|
|
348
|
+
};
|
|
349
|
+
let side = 'left';
|
|
350
|
+
try {
|
|
351
|
+
createSchemaScalarKernel(leftContext);
|
|
352
|
+
createSchemaScalarKernel(rightContext);
|
|
353
|
+
const leftReader = facetReaders.get(leftContext), rightReader = facetReaders.get(rightContext);
|
|
354
|
+
const left = leftReader.read(operands.left.reference, operands.left.owner);
|
|
355
|
+
remember(left.obligations, leftContext);
|
|
356
|
+
typed.add(left.typeDependencies);
|
|
357
|
+
side = 'right';
|
|
358
|
+
const right = rightReader.read(operands.right.reference, operands.right.owner);
|
|
359
|
+
remember(right.obligations, rightContext);
|
|
360
|
+
typed.add(right.typeDependencies);
|
|
361
|
+
side = 'comparison';
|
|
362
|
+
const value = leftReader.compare(left.evidence, right.evidence, operands.left.owner);
|
|
363
|
+
return publish({ kind: 'checked', value,
|
|
364
|
+
authority: 'XSD10-schema-scalar-facet-properties-v1', operands, obligations,
|
|
365
|
+
annotationCorrespondence: leftReader.annotations(left.evidence, right.evidence, operands.left.owner), sourceFacetAnnotations: { left: left.annotations, right: right.annotations } });
|
|
366
|
+
}
|
|
367
|
+
catch (error) {
|
|
368
|
+
if (!(error instanceof SchemaAssessmentError) && !(error instanceof SchemaOperandContextError))
|
|
369
|
+
throw error;
|
|
370
|
+
if (side === 'comparison')
|
|
371
|
+
return publish({ kind: 'unresolved', side,
|
|
372
|
+
rule: error.rule, message: error.message, operands, obligations });
|
|
373
|
+
const context = failureContexts.get(error) ?? (side === 'left' ? leftContext : rightContext);
|
|
374
|
+
const failure = error instanceof SchemaOperandContextError
|
|
375
|
+
? { kind: 'unresolved', rule: error.rule, message: error.message, component: error.component }
|
|
376
|
+
: { kind: error.category === 'missing-prerequisite' || error.category === 'scalar-indeterminate' ? 'unresolved' : error.category,
|
|
377
|
+
rule: error.rule, message: error.message, component: error.node.id, source: error.source };
|
|
378
|
+
return publish({ ...failure, side, contextId: context.contextId, operands, obligations });
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
export function checkOriginalGeneratedScalar(context, slot) {
|
|
383
|
+
assertSemanticContext(context);
|
|
384
|
+
createSchemaScalarKernel(context);
|
|
385
|
+
return generatedReaders.get(context)(slot);
|
|
386
|
+
}
|
|
387
|
+
export function assertOriginalGeneratedScalarReceipt(context, receipt) {
|
|
388
|
+
assertSemanticContext(context);
|
|
389
|
+
if (generatedReceipts.get(receipt) !== context)
|
|
390
|
+
throw new TypeError('Unauthenticated generated scalar receipt');
|
|
391
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Finite lexical candidates only. The exact base assessor decides membership. */
|
|
2
|
+
import type { GraphNode, LexicalValue } from './canonicalGraph.js';
|
|
3
|
+
import type { SchemaOperand } from './schemaDatatypeValues.js';
|
|
4
|
+
import type { AssessmentContext } from './schemaScalarContext.js';
|
|
5
|
+
export declare function schemaScalarWitnesses(value: SchemaOperand, original: LexicalValue, owner: GraphNode, c: AssessmentContext): Generator<LexicalValue>;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
export function* schemaScalarWitnesses(value, original, owner, c) {
|
|
2
|
+
c.step(owner);
|
|
3
|
+
yield original;
|
|
4
|
+
const atomic = (operand) => {
|
|
5
|
+
c.step(owner, 3);
|
|
6
|
+
const result = [], seen = new Set();
|
|
7
|
+
const add = (candidate) => {
|
|
8
|
+
c.text(candidate, owner);
|
|
9
|
+
c.step(owner, 2);
|
|
10
|
+
if (!seen.has(candidate)) {
|
|
11
|
+
seen.add(candidate);
|
|
12
|
+
result.push(candidate);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
if (operand.normalized !== undefined)
|
|
16
|
+
add(operand.normalized);
|
|
17
|
+
if (['string', 'anyURI', 'decimal', 'boolean'].includes(operand.family))
|
|
18
|
+
add(operand.canonical);
|
|
19
|
+
if (operand.family === 'decimal') {
|
|
20
|
+
c.text(operand.canonical, owner);
|
|
21
|
+
const negative = operand.canonical.startsWith('-'), unsigned = negative ? operand.canonical.slice(1) : operand.canonical;
|
|
22
|
+
c.step(owner, operand.canonical.length * 4 + 8);
|
|
23
|
+
const forms = [operand.canonical, (negative ? '-' : '') + '0' + unsigned,
|
|
24
|
+
operand.canonical + (operand.canonical.includes('.') ? '0' : '.0')];
|
|
25
|
+
for (const form of forms) {
|
|
26
|
+
add(form);
|
|
27
|
+
if (!negative) {
|
|
28
|
+
c.step(owner, form.length + 1);
|
|
29
|
+
add('+' + form);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (operand.family === 'boolean')
|
|
34
|
+
add(operand.canonical === 'true' ? '1' : '0');
|
|
35
|
+
if (operand.family === 'hexBinary') {
|
|
36
|
+
c.step(owner, operand.canonical.length * 2 + 2);
|
|
37
|
+
add(operand.canonical);
|
|
38
|
+
add(operand.canonical.toUpperCase());
|
|
39
|
+
}
|
|
40
|
+
if (operand.family === 'base64Binary') {
|
|
41
|
+
// Canonical binary data was issued as hexadecimal octets by the value
|
|
42
|
+
// owner. The primitive family is still checked by exact reassessment.
|
|
43
|
+
c.step(owner, operand.canonical.length * 4 + 8);
|
|
44
|
+
add(Buffer.from(operand.canonical, 'hex').toString('base64'));
|
|
45
|
+
}
|
|
46
|
+
if (operand.family === 'QName' || operand.family === 'NOTATION') {
|
|
47
|
+
// Canonical values here were privately issued by the shared value owner.
|
|
48
|
+
c.step(owner, 8 + 4 * operand.canonical.length);
|
|
49
|
+
const [namespace, local] = JSON.parse(operand.canonical);
|
|
50
|
+
for (const prefix in original.context.namespaces) {
|
|
51
|
+
const bound = original.context.namespaces[prefix];
|
|
52
|
+
c.text(prefix, owner);
|
|
53
|
+
c.text(bound, owner);
|
|
54
|
+
c.text(namespace, owner);
|
|
55
|
+
if (bound !== namespace)
|
|
56
|
+
continue;
|
|
57
|
+
c.step(owner, prefix.length + local.length + 1);
|
|
58
|
+
add(prefix ? prefix + ':' + local : local);
|
|
59
|
+
}
|
|
60
|
+
if (namespace === '' && original.context.namespaces[''] === undefined)
|
|
61
|
+
add(local);
|
|
62
|
+
}
|
|
63
|
+
return result;
|
|
64
|
+
};
|
|
65
|
+
if (value.family !== 'list') {
|
|
66
|
+
for (const candidate of atomic(value)) {
|
|
67
|
+
c.step(owner, 3);
|
|
68
|
+
yield { ...original, value: candidate };
|
|
69
|
+
}
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (!value.items)
|
|
73
|
+
return;
|
|
74
|
+
// XSD list items are atomic or unions of atomics. The product traversal is
|
|
75
|
+
// iterative even for long lists; no caller-supplied canonical values enter.
|
|
76
|
+
c.step(owner, value.items.length * 3 + 3);
|
|
77
|
+
const choices = [], positions = [];
|
|
78
|
+
for (const item of value.items) {
|
|
79
|
+
c.step(owner, 2);
|
|
80
|
+
const candidates = [];
|
|
81
|
+
for (const candidate of atomic(item)) {
|
|
82
|
+
c.text(candidate, owner);
|
|
83
|
+
if (candidate !== '' && !/[\t\r\n ]/.test(candidate)) {
|
|
84
|
+
c.step(owner);
|
|
85
|
+
candidates.push(candidate);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (!candidates.length)
|
|
89
|
+
return;
|
|
90
|
+
choices.push(candidates);
|
|
91
|
+
positions.push(0);
|
|
92
|
+
}
|
|
93
|
+
let more = true;
|
|
94
|
+
while (more) {
|
|
95
|
+
c.step(owner, choices.length + 3);
|
|
96
|
+
const tokens = [];
|
|
97
|
+
let length = Math.max(0, choices.length - 1);
|
|
98
|
+
for (let index = 0; index < choices.length; index++) {
|
|
99
|
+
c.step(owner, 2);
|
|
100
|
+
const token = choices[index][positions[index]];
|
|
101
|
+
c.text(token, owner);
|
|
102
|
+
length += token.length;
|
|
103
|
+
tokens.push(token);
|
|
104
|
+
}
|
|
105
|
+
c.step(owner, length + 3);
|
|
106
|
+
yield { ...original, value: tokens.join(' ') };
|
|
107
|
+
more = false;
|
|
108
|
+
for (let index = positions.length - 1; index >= 0; index--) {
|
|
109
|
+
c.step(owner, 3);
|
|
110
|
+
positions[index]++;
|
|
111
|
+
if (positions[index] < choices[index].length) {
|
|
112
|
+
more = true;
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
positions[index] = 0;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/** Supplied abstract scalar properties. No XML constructor or schema defaults are inferred. */
|
|
2
|
+
import type { LexicalValue, NodeId } from './canonicalGraph.js';
|
|
3
|
+
import type { SemanticBudget } from './semanticBudget.js';
|
|
4
|
+
import type { SemanticTypeReference } from './semanticTypeReference.js';
|
|
5
|
+
import type { FacetAnnotation } from './schemaFacetAnnotation.js';
|
|
6
|
+
export type ScalarFacet = Readonly<{
|
|
7
|
+
name: string;
|
|
8
|
+
lexical: LexicalValue;
|
|
9
|
+
fixed: boolean;
|
|
10
|
+
/** Explicit abstract absence for legacy layers. Exact payloads belong to a component. */
|
|
11
|
+
annotation?: 'absent';
|
|
12
|
+
/** Absent means a newly supplied operand of the intrinsic helper family. */
|
|
13
|
+
operand?: Readonly<{
|
|
14
|
+
type: SemanticTypeReference;
|
|
15
|
+
owner: NodeId;
|
|
16
|
+
context: 'original' | 'active';
|
|
17
|
+
}>;
|
|
18
|
+
}>;
|
|
19
|
+
/** Each layer is a conjunction; its pattern and enumeration entries are alternatives.
|
|
20
|
+
* A nonempty enumeration group denotes one set-valued facet component;
|
|
21
|
+
* a nonempty pattern group denotes one regular-expression branch union.
|
|
22
|
+
* P1 maps pattern operands to one expression by joining complete operands in
|
|
23
|
+
* supplied order with |, preserving singleton spelling and duplicate branches.
|
|
24
|
+
* Distinct inherited enumeration components remain present and are matched
|
|
25
|
+
* by typed set equality, without requiring caller construction history.
|
|
26
|
+
* Comparable nonfixed scalar facets normalize to their strongest effective
|
|
27
|
+
* bound/length/precision/whitespace property. Original operands remain retained.
|
|
28
|
+
* Fixed conflicts, incomparable order and inherited pattern/enum correspondence
|
|
29
|
+
* are never discarded by that normalization.
|
|
30
|
+
*/
|
|
31
|
+
export type RawScalarFacetLayer = Readonly<{
|
|
32
|
+
facets: readonly ScalarFacet[];
|
|
33
|
+
}>;
|
|
34
|
+
/** Exact supplied component inventory. Each entry is one scalar component,
|
|
35
|
+
* one enumeration value-set component, or one pattern expression component.
|
|
36
|
+
* Unlike facetLayers, scalar entries are never reduced to a normal form.
|
|
37
|
+
*/
|
|
38
|
+
export type RawScalarFacetComponent = Readonly<{
|
|
39
|
+
facets: readonly ScalarFacet[];
|
|
40
|
+
/** Annotation of the abstract component, including grouped pattern/enum. */
|
|
41
|
+
annotation?: FacetAnnotation;
|
|
42
|
+
}>;
|
|
43
|
+
/** An actual component in the formed immediate base's available replay table. */
|
|
44
|
+
export type RawBaseFacetComponent = Readonly<{
|
|
45
|
+
baseComponent: number;
|
|
46
|
+
}>;
|
|
47
|
+
/** A NEW component copying one genuine intrinsic builtin pattern property. */
|
|
48
|
+
export type RawBuiltinPatternFacetComponent = Readonly<{
|
|
49
|
+
builtinPattern: Readonly<{
|
|
50
|
+
name: string;
|
|
51
|
+
index: number;
|
|
52
|
+
}>;
|
|
53
|
+
}>;
|
|
54
|
+
export type RawFacetComponentEntry = RawScalarFacetComponent | RawBaseFacetComponent | RawBuiltinPatternFacetComponent;
|
|
55
|
+
export type RawSimpleFacetInput = Readonly<{
|
|
56
|
+
facetLayers: readonly RawScalarFacetLayer[];
|
|
57
|
+
facetBinding?: never;
|
|
58
|
+
facetComponentSet?: never;
|
|
59
|
+
} | {
|
|
60
|
+
facetComponentSet: readonly RawFacetComponentEntry[];
|
|
61
|
+
facetLayers?: never;
|
|
62
|
+
facetBinding?: never;
|
|
63
|
+
} | {
|
|
64
|
+
facetBinding: Readonly<{
|
|
65
|
+
kind: 'original';
|
|
66
|
+
type: SemanticTypeReference;
|
|
67
|
+
}>;
|
|
68
|
+
facetLayers?: never;
|
|
69
|
+
facetComponentSet?: never;
|
|
70
|
+
}>;
|
|
71
|
+
export type RawSimpleTypeProperties = Readonly<{
|
|
72
|
+
type: NodeId;
|
|
73
|
+
/** Required to establish anonymous helper namespace correspondence; empty means absent. */
|
|
74
|
+
targetNamespace?: string;
|
|
75
|
+
base: SemanticTypeReference;
|
|
76
|
+
final: readonly ('restriction' | 'list' | 'union')[];
|
|
77
|
+
variety: Readonly<{
|
|
78
|
+
kind: 'atomic';
|
|
79
|
+
} | {
|
|
80
|
+
kind: 'list';
|
|
81
|
+
item: SemanticTypeReference;
|
|
82
|
+
} | {
|
|
83
|
+
kind: 'union';
|
|
84
|
+
members: readonly SemanticTypeReference[];
|
|
85
|
+
}>;
|
|
86
|
+
provenance: Readonly<{
|
|
87
|
+
kind: 'actual-mapped';
|
|
88
|
+
original: NodeId;
|
|
89
|
+
} | {
|
|
90
|
+
kind: 'hypothetical-abstract';
|
|
91
|
+
originals: readonly NodeId[];
|
|
92
|
+
}>;
|
|
93
|
+
}> & RawSimpleFacetInput;
|
|
94
|
+
export declare function validateRawSimpleTypeShape(value: unknown, budget: SemanticBudget): value is RawSimpleTypeProperties;
|