@techspokes/typescript-wsdl-client 1.1.5 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +80 -68
- package/dist/app/generateApp.d.ts +0 -1
- package/dist/app/generateApp.js +1 -1
- package/dist/app/generateCheckedApp.d.ts +38 -0
- package/dist/app/generateCheckedApp.js +108 -0
- package/dist/checkedPipeline.d.ts +155 -0
- package/dist/checkedPipeline.js +448 -0
- package/dist/checkedPlanning.d.ts +123 -0
- package/dist/checkedPlanning.js +268 -0
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +92 -2
- package/dist/client/checkedDirectRuntime.d.ts +40 -3
- package/dist/client/checkedDirectRuntime.js +28 -8
- package/dist/client/directClientRuntime.d.ts +27 -2
- package/dist/client/directClientRuntime.js +142 -89
- package/dist/client/directClientVersion.d.ts +3 -1
- package/dist/client/directClientVersion.js +3 -0
- package/dist/client/generateClient.d.ts +0 -1
- package/dist/client/generateClient.js +98 -28
- package/dist/client/generateDirectClient.d.ts +21 -3
- package/dist/client/generateDirectClient.js +138 -6
- package/dist/client/generateOperations.d.ts +0 -1
- package/dist/client/generateOperations.js +30 -11
- package/dist/client/generateTypes.d.ts +0 -1
- package/dist/client/generateUtils.d.ts +0 -1
- package/dist/client/generateUtils.js +7 -1
- package/dist/compiler/applicationGroups.d.ts +53 -0
- package/dist/compiler/applicationGroups.js +403 -0
- package/dist/compiler/buildCanonicalGraph.d.ts +0 -1
- package/dist/compiler/canonicalGraph.d.ts +4 -16
- package/dist/compiler/canonicalGraph.js +1 -8
- package/dist/compiler/catalogErrors.d.ts +0 -1
- package/dist/compiler/catalogProvenance.d.ts +0 -1
- package/dist/compiler/checkedAssessment.d.ts +0 -1
- package/dist/compiler/checkedAssessment.js +1 -1
- package/dist/compiler/checkedComponentSource.d.ts +16 -0
- package/dist/compiler/checkedComponentSource.js +31 -0
- package/dist/compiler/checkedSourcePreparation.d.ts +38 -1
- package/dist/compiler/checkedSourcePreparation.js +71 -0
- package/dist/compiler/complexTypeContent.d.ts +5 -6
- package/dist/compiler/complexTypeContent.js +2 -2
- package/dist/compiler/componentCorrespondence.d.ts +32 -0
- package/dist/compiler/componentCorrespondence.js +140 -0
- package/dist/compiler/componentRecordProjection.d.ts +112 -0
- package/dist/compiler/componentRecordProjection.js +329 -0
- package/dist/compiler/componentSoapPreparation.d.ts +20 -0
- package/dist/compiler/componentSoapPreparation.js +36 -0
- package/dist/compiler/composeCanonicalGraph.d.ts +0 -1
- package/dist/compiler/dataOwnership.d.ts +0 -1
- package/dist/compiler/dataOwnership.js +14 -4
- package/dist/compiler/datatypeValues.d.ts +0 -1
- package/dist/compiler/declarationIdentity.d.ts +22 -0
- package/dist/compiler/declarationIdentity.js +9 -0
- package/dist/compiler/directCodec.d.ts +79 -2
- package/dist/compiler/directCodec.js +310 -92
- package/dist/compiler/directExecutionPolicy.d.ts +0 -1
- package/dist/compiler/directOperation.d.ts +72 -8
- package/dist/compiler/directOperation.js +164 -19
- package/dist/compiler/directSoap.d.ts +29 -5
- package/dist/compiler/directSoap.js +154 -44
- package/dist/compiler/directSoapSource.d.ts +24 -1
- package/dist/compiler/directSoapSource.js +166 -19
- package/dist/compiler/directSourceCapsule.d.ts +74 -2
- package/dist/compiler/directSourceCapsule.js +484 -6
- package/dist/compiler/directStructure.d.ts +83 -6
- package/dist/compiler/directStructure.js +353 -58
- package/dist/compiler/directStructurePlan.d.ts +144 -2
- package/dist/compiler/directStructurePlan.js +615 -30
- package/dist/compiler/directValues.d.ts +76 -5
- package/dist/compiler/directValues.js +967 -117
- package/dist/compiler/finiteRe01Construction.d.ts +69 -0
- package/dist/compiler/finiteRe01Construction.js +422 -0
- package/dist/compiler/finiteRe01Verification.d.ts +81 -3
- package/dist/compiler/finiteRe01Verification.js +391 -4
- package/dist/compiler/generateCatalog.d.ts +0 -1
- package/dist/compiler/graphTraversal.d.ts +0 -1
- package/dist/compiler/hypotheticalScopedIdentity.d.ts +0 -1
- package/dist/compiler/legacyDeclarations.d.ts +26 -0
- package/dist/compiler/legacyDeclarations.js +144 -0
- package/dist/compiler/occurrenceAnalysis.d.ts +2 -1
- package/dist/compiler/occurrenceAnalysis.js +23 -7
- package/dist/compiler/originalSourceMembership.d.ts +0 -1
- package/dist/compiler/particleAttribution.d.ts +0 -1
- package/dist/compiler/particleAttribution.js +20 -0
- package/dist/compiler/particleDeclarationConsistency.d.ts +0 -1
- package/dist/compiler/particleDeclarationConsistency.js +9 -0
- package/dist/compiler/particleExtension.d.ts +0 -1
- package/dist/compiler/particleExtension.js +5 -1
- package/dist/compiler/particleLocalAssessment.d.ts +0 -1
- package/dist/compiler/particleRestriction.d.ts +0 -1
- package/dist/compiler/particleRestriction.js +6 -1
- package/dist/compiler/particleSemanticView.d.ts +2 -1
- package/dist/compiler/particleSemanticView.js +16 -3
- package/dist/compiler/particleWildcardRelation.d.ts +0 -1
- package/dist/compiler/projectionScalar.d.ts +49 -0
- package/dist/compiler/projectionScalar.js +218 -0
- package/dist/compiler/re01CandidateAssignments.d.ts +95 -0
- package/dist/compiler/re01CandidateAssignments.js +341 -0
- package/dist/compiler/re01CandidateCorrespondence.d.ts +22 -1
- package/dist/compiler/re01CandidateCorrespondence.js +167 -38
- package/dist/compiler/re01TypeProperties.d.ts +0 -1
- package/dist/compiler/re01TypePropertyValidation.d.ts +0 -1
- package/dist/compiler/resolveCanonicalGraph.d.ts +5 -2
- package/dist/compiler/resolveCanonicalGraph.js +77 -7
- package/dist/compiler/rpcStringValues.d.ts +30 -0
- package/dist/compiler/rpcStringValues.js +196 -0
- package/dist/compiler/rpcTypedValues.d.ts +48 -0
- package/dist/compiler/rpcTypedValues.js +190 -0
- package/dist/compiler/scalarSchemaAssessment.d.ts +0 -1
- package/dist/compiler/schemaAttributeGroupProperties.d.ts +0 -1
- package/dist/compiler/schemaAttributeProperties.d.ts +0 -1
- package/dist/compiler/schemaAttributeUses.d.ts +22 -2
- package/dist/compiler/schemaAttributeUses.js +86 -13
- package/dist/compiler/schemaBinaryWordReconstruction.d.ts +0 -1
- package/dist/compiler/schemaBuiltinFacets.d.ts +0 -1
- package/dist/compiler/schemaCalendarImages.d.ts +0 -1
- package/dist/compiler/schemaCalendarLanguage.d.ts +0 -1
- package/dist/compiler/schemaCompiler.d.ts +0 -1
- package/dist/compiler/schemaCompiler.js +44 -109
- package/dist/compiler/schemaComponentEquality.d.ts +0 -1
- package/dist/compiler/schemaConstructionAssessment.d.ts +34 -1
- package/dist/compiler/schemaConstructionAssessment.js +88 -6
- package/dist/compiler/schemaDatatypeValues.d.ts +0 -1
- package/dist/compiler/schemaDecimalLanguage.d.ts +0 -1
- package/dist/compiler/schemaDeclarationPrimitives.d.ts +7 -2
- package/dist/compiler/schemaDeclarationPrimitives.js +18 -1
- package/dist/compiler/schemaDocumentSyntax.d.ts +0 -1
- package/dist/compiler/schemaDurationLanguage.d.ts +0 -1
- package/dist/compiler/schemaElementInstance.d.ts +30 -0
- package/dist/compiler/schemaElementInstance.js +45 -0
- package/dist/compiler/schemaElementProperties.d.ts +0 -1
- package/dist/compiler/schemaEndpointWordCapacity.d.ts +0 -1
- package/dist/compiler/schemaExactCalendar.d.ts +0 -1
- package/dist/compiler/schemaFacetAnnotation.d.ts +0 -1
- package/dist/compiler/schemaGeneratedScalarShape.d.ts +0 -1
- package/dist/compiler/schemaGeneratedScalarShape.js +2 -0
- package/dist/compiler/schemaIdentityConstraints.d.ts +0 -1
- package/dist/compiler/schemaIeeeLanguage.d.ts +0 -1
- package/dist/compiler/schemaIntegerImages.d.ts +0 -1
- package/dist/compiler/schemaLexicalPredicates.d.ts +0 -1
- package/dist/compiler/schemaNotationProperties.d.ts +0 -1
- package/dist/compiler/schemaNumericImageConditions.d.ts +0 -1
- package/dist/compiler/schemaParticleWildcardProperties.d.ts +0 -1
- package/dist/compiler/schemaPattern.d.ts +0 -1
- package/dist/compiler/schemaRegularLanguage.d.ts +0 -1
- package/dist/compiler/schemaScalarContext.d.ts +5 -1
- package/dist/compiler/schemaScalarKernel.d.ts +0 -1
- package/dist/compiler/schemaScalarWitnesses.d.ts +0 -1
- package/dist/compiler/schemaSimpleTypeProperties.d.ts +0 -1
- package/dist/compiler/schemaSourceGrammar.d.ts +0 -1
- package/dist/compiler/schemaSourceLexical.d.ts +0 -1
- package/dist/compiler/schemaSourceValues.d.ts +0 -1
- package/dist/compiler/schemaSourceWildcards.d.ts +1 -2
- package/dist/compiler/schemaSourceWildcards.js +3 -1
- package/dist/compiler/schemaSymbolicSequences.d.ts +0 -1
- package/dist/compiler/schemaSymbolicValueSets.d.ts +0 -1
- package/dist/compiler/schemaSyntaxAssessment.d.ts +0 -1
- package/dist/compiler/schemaTemporalAliases.d.ts +0 -1
- package/dist/compiler/schemaTokenImages.d.ts +0 -1
- package/dist/compiler/schemaTypeIdentity.d.ts +0 -1
- package/dist/compiler/schemaTypeIdentity.js +2 -0
- package/dist/compiler/schemaTypeRelations.d.ts +0 -1
- package/dist/compiler/schemaUri.d.ts +0 -1
- package/dist/compiler/schemaValueContext.d.ts +0 -1
- package/dist/compiler/schemaValueImages.d.ts +0 -1
- package/dist/compiler/schemaValueSequences.d.ts +0 -1
- package/dist/compiler/semanticBudget.d.ts +18 -1
- package/dist/compiler/semanticBudget.js +17 -2
- package/dist/compiler/semanticCatalog.d.ts +2 -3
- package/dist/compiler/semanticContext.d.ts +12 -1
- package/dist/compiler/semanticContext.js +39 -0
- package/dist/compiler/semanticTypeDependencies.d.ts +0 -1
- package/dist/compiler/semanticTypeReference.d.ts +0 -1
- package/dist/compiler/shapeResolver.d.ts +0 -1
- package/dist/compiler/soapHeaders.d.ts +16 -0
- package/dist/compiler/soapHeaders.js +42 -0
- package/dist/compiler/sourceSchemaBinding.d.ts +0 -1
- package/dist/compiler/standardSchemaComponents.d.ts +71 -0
- package/dist/compiler/standardSchemaComponents.js +74 -0
- package/dist/compiler/standardSchemaConstruction.d.ts +20 -0
- package/dist/compiler/standardSchemaConstruction.js +34 -0
- package/dist/compiler/structuralCompanions.d.ts +0 -1
- package/dist/compiler/validateSemanticGraph.d.ts +0 -1
- package/dist/compiler/wildcardAlgebra.d.ts +0 -1
- package/dist/compiler/wsdlPolicyRequirements.d.ts +43 -0
- package/dist/compiler/wsdlPolicyRequirements.js +239 -0
- package/dist/config.d.ts +0 -1
- package/dist/gateway/generateCheckedGateway.d.ts +32 -0
- package/dist/gateway/generateCheckedGateway.js +293 -0
- package/dist/gateway/generateComposedGateway.d.ts +16 -0
- package/dist/gateway/generateComposedGateway.js +65 -0
- package/dist/gateway/generateGateway.d.ts +0 -1
- package/dist/gateway/generateGateway.js +1 -0
- package/dist/gateway/generators.d.ts +0 -1
- package/dist/gateway/generators.js +19 -4
- package/dist/gateway/helpers.d.ts +1 -1
- package/dist/gateway/helpers.js +15 -0
- package/dist/generation/componentShape.d.ts +14 -0
- package/dist/generation/componentShape.js +293 -0
- package/dist/generation/preamble.d.ts +0 -1
- package/dist/generation/sourceLayout.d.ts +13 -0
- package/dist/generation/sourceLayout.js +40 -0
- package/dist/generation/writeGeneratedSource.d.ts +0 -1
- package/dist/index.d.ts +11 -2
- package/dist/index.js +4 -1
- package/dist/loader/fetch.d.ts +0 -1
- package/dist/loader/orderedSyntax.d.ts +12 -1
- package/dist/loader/orderedSyntax.js +40 -6
- package/dist/loader/resolutionDepth.d.ts +0 -1
- package/dist/loader/schemaInput.d.ts +28 -1
- package/dist/loader/schemaInput.js +41 -4
- package/dist/loader/schemaResources.d.ts +2 -1
- package/dist/loader/schemaResources.js +45 -4
- package/dist/loader/wsdlLoader.d.ts +0 -1
- package/dist/multiServicePipeline.d.ts +41 -0
- package/dist/multiServicePipeline.js +287 -0
- package/dist/openapi/casing.d.ts +0 -1
- package/dist/openapi/composeOpenAPI.d.ts +29 -0
- package/dist/openapi/composeOpenAPI.js +322 -0
- package/dist/openapi/generateOpenAPI.d.ts +0 -1
- package/dist/openapi/generatePaths.d.ts +0 -1
- package/dist/openapi/generateSchemas.d.ts +0 -1
- package/dist/openapi/security.d.ts +0 -1
- package/dist/pipeline.d.ts +7 -3
- package/dist/pipeline.js +15 -0
- package/dist/test/generateCheckedTests.d.ts +17 -0
- package/dist/test/generateCheckedTests.js +60 -0
- package/dist/test/generateTests.d.ts +0 -1
- package/dist/test/generators.d.ts +0 -1
- package/dist/test/mockData.d.ts +0 -1
- package/dist/test/mockData.js +20 -14
- package/dist/util/attributeWildcards.d.ts +0 -1
- package/dist/util/builder.d.ts +0 -1
- package/dist/util/catalogMeta.d.ts +0 -1
- package/dist/util/checkedCliDiagnostics.d.ts +11 -0
- package/dist/util/checkedCliDiagnostics.js +22 -0
- package/dist/util/cli.d.ts +0 -1
- package/dist/util/errors.d.ts +0 -1
- package/dist/util/imports.d.ts +0 -1
- package/dist/util/runtimeSource.d.ts +0 -1
- package/dist/util/runtimeSource.js +3 -5
- package/dist/util/securityConfig.d.ts +0 -1
- package/dist/util/streamConfig.d.ts +0 -1
- package/dist/util/tools.d.ts +0 -1
- package/dist/util/xmlWhitespace.d.ts +0 -1
- package/dist/xsd/primitives.d.ts +0 -1
- package/docs/agent-skill.md +12 -1
- package/docs/api-reference.md +127 -9
- package/docs/checked-gateway.md +212 -0
- package/docs/checked-generation.md +167 -0
- package/docs/cli-reference.md +48 -6
- package/docs/concepts.md +139 -5
- package/docs/configuration.md +15 -4
- package/docs/corpus.md +33 -0
- package/docs/direct-values.md +13 -13
- package/docs/examples/checked-forecast.wsdl +19 -0
- package/docs/gateway-guide.md +104 -27
- package/docs/generated-code.md +22 -11
- package/docs/mapping-contract.md +114 -0
- package/docs/migration-playbook.md +5 -1
- package/docs/migration.md +124 -6
- package/docs/output-anatomy.md +21 -18
- package/docs/production.md +7 -5
- package/docs/start-here.md +19 -3
- package/docs/supported-patterns.md +24 -3
- package/docs/testing.md +119 -31
- package/docs/troubleshooting.md +3 -1
- package/llms.txt +16 -8
- package/package.json +64 -23
- package/src/runtime/checkedGatewayHost.tpl.txt +157 -0
- package/src/runtime/clientStreamMethods.tpl.txt +156 -148
- package/src/runtime/operationsStreamHelper.tpl.txt +6 -6
- package/src/runtime/streamXml.ts +49 -21
- package/dist/app/generateApp.d.ts.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/client/checkedDirectRuntime.d.ts.map +0 -1
- package/dist/client/directClientRuntime.d.ts.map +0 -1
- package/dist/client/directClientVersion.d.ts.map +0 -1
- package/dist/client/generateClient.d.ts.map +0 -1
- package/dist/client/generateDirectClient.d.ts.map +0 -1
- package/dist/client/generateOperations.d.ts.map +0 -1
- package/dist/client/generateTypes.d.ts.map +0 -1
- package/dist/client/generateUtils.d.ts.map +0 -1
- package/dist/compiler/buildCanonicalGraph.d.ts.map +0 -1
- package/dist/compiler/canonicalGraph.d.ts.map +0 -1
- package/dist/compiler/catalogErrors.d.ts.map +0 -1
- package/dist/compiler/catalogProvenance.d.ts.map +0 -1
- package/dist/compiler/checkedAssessment.d.ts.map +0 -1
- package/dist/compiler/checkedSourcePreparation.d.ts.map +0 -1
- package/dist/compiler/complexTypeContent.d.ts.map +0 -1
- package/dist/compiler/composeCanonicalGraph.d.ts.map +0 -1
- package/dist/compiler/dataOwnership.d.ts.map +0 -1
- package/dist/compiler/datatypeValues.d.ts.map +0 -1
- package/dist/compiler/directCodec.d.ts.map +0 -1
- package/dist/compiler/directExecutionPolicy.d.ts.map +0 -1
- package/dist/compiler/directOperation.d.ts.map +0 -1
- package/dist/compiler/directSoap.d.ts.map +0 -1
- package/dist/compiler/directSoapSource.d.ts.map +0 -1
- package/dist/compiler/directSourceCapsule.d.ts.map +0 -1
- package/dist/compiler/directStructure.d.ts.map +0 -1
- package/dist/compiler/directStructurePlan.d.ts.map +0 -1
- package/dist/compiler/directValues.d.ts.map +0 -1
- package/dist/compiler/finiteRe01Verification.d.ts.map +0 -1
- package/dist/compiler/generateCatalog.d.ts.map +0 -1
- package/dist/compiler/graphTraversal.d.ts.map +0 -1
- package/dist/compiler/hypotheticalScopedIdentity.d.ts.map +0 -1
- package/dist/compiler/occurrenceAnalysis.d.ts.map +0 -1
- package/dist/compiler/originalSourceMembership.d.ts.map +0 -1
- package/dist/compiler/particleAttribution.d.ts.map +0 -1
- package/dist/compiler/particleDeclarationConsistency.d.ts.map +0 -1
- package/dist/compiler/particleExtension.d.ts.map +0 -1
- package/dist/compiler/particleLocalAssessment.d.ts.map +0 -1
- package/dist/compiler/particleRestriction.d.ts.map +0 -1
- package/dist/compiler/particleSemanticView.d.ts.map +0 -1
- package/dist/compiler/particleWildcardRelation.d.ts.map +0 -1
- package/dist/compiler/re01CandidateCorrespondence.d.ts.map +0 -1
- package/dist/compiler/re01TypeProperties.d.ts.map +0 -1
- package/dist/compiler/re01TypePropertyValidation.d.ts.map +0 -1
- package/dist/compiler/resolveCanonicalGraph.d.ts.map +0 -1
- package/dist/compiler/scalarSchemaAssessment.d.ts.map +0 -1
- package/dist/compiler/schemaAttributeGroupProperties.d.ts.map +0 -1
- package/dist/compiler/schemaAttributeProperties.d.ts.map +0 -1
- package/dist/compiler/schemaAttributeUses.d.ts.map +0 -1
- package/dist/compiler/schemaBinaryWordReconstruction.d.ts.map +0 -1
- package/dist/compiler/schemaBuiltinFacets.d.ts.map +0 -1
- package/dist/compiler/schemaCalendarImages.d.ts.map +0 -1
- package/dist/compiler/schemaCalendarLanguage.d.ts.map +0 -1
- package/dist/compiler/schemaCompiler.d.ts.map +0 -1
- package/dist/compiler/schemaComponentEquality.d.ts.map +0 -1
- package/dist/compiler/schemaConstructionAssessment.d.ts.map +0 -1
- package/dist/compiler/schemaDatatypeValues.d.ts.map +0 -1
- package/dist/compiler/schemaDecimalLanguage.d.ts.map +0 -1
- package/dist/compiler/schemaDeclarationPrimitives.d.ts.map +0 -1
- package/dist/compiler/schemaDocumentSyntax.d.ts.map +0 -1
- package/dist/compiler/schemaDurationLanguage.d.ts.map +0 -1
- package/dist/compiler/schemaElementProperties.d.ts.map +0 -1
- package/dist/compiler/schemaEndpointWordCapacity.d.ts.map +0 -1
- package/dist/compiler/schemaExactCalendar.d.ts.map +0 -1
- package/dist/compiler/schemaFacetAnnotation.d.ts.map +0 -1
- package/dist/compiler/schemaGeneratedScalarShape.d.ts.map +0 -1
- package/dist/compiler/schemaIdentityConstraints.d.ts.map +0 -1
- package/dist/compiler/schemaIeeeLanguage.d.ts.map +0 -1
- package/dist/compiler/schemaIntegerImages.d.ts.map +0 -1
- package/dist/compiler/schemaLexicalPredicates.d.ts.map +0 -1
- package/dist/compiler/schemaNotationProperties.d.ts.map +0 -1
- package/dist/compiler/schemaNumericImageConditions.d.ts.map +0 -1
- package/dist/compiler/schemaParticleWildcardProperties.d.ts.map +0 -1
- package/dist/compiler/schemaPattern.d.ts.map +0 -1
- package/dist/compiler/schemaRegularLanguage.d.ts.map +0 -1
- package/dist/compiler/schemaScalarContext.d.ts.map +0 -1
- package/dist/compiler/schemaScalarKernel.d.ts.map +0 -1
- package/dist/compiler/schemaScalarWitnesses.d.ts.map +0 -1
- package/dist/compiler/schemaSimpleTypeProperties.d.ts.map +0 -1
- package/dist/compiler/schemaSourceGrammar.d.ts.map +0 -1
- package/dist/compiler/schemaSourceLexical.d.ts.map +0 -1
- package/dist/compiler/schemaSourceValues.d.ts.map +0 -1
- package/dist/compiler/schemaSourceWildcards.d.ts.map +0 -1
- package/dist/compiler/schemaSymbolicSequences.d.ts.map +0 -1
- package/dist/compiler/schemaSymbolicValueSets.d.ts.map +0 -1
- package/dist/compiler/schemaSyntaxAssessment.d.ts.map +0 -1
- package/dist/compiler/schemaTemporalAliases.d.ts.map +0 -1
- package/dist/compiler/schemaTokenImages.d.ts.map +0 -1
- package/dist/compiler/schemaTypeIdentity.d.ts.map +0 -1
- package/dist/compiler/schemaTypeRelations.d.ts.map +0 -1
- package/dist/compiler/schemaUri.d.ts.map +0 -1
- package/dist/compiler/schemaValueContext.d.ts.map +0 -1
- package/dist/compiler/schemaValueImages.d.ts.map +0 -1
- package/dist/compiler/schemaValueSequences.d.ts.map +0 -1
- package/dist/compiler/semanticBudget.d.ts.map +0 -1
- package/dist/compiler/semanticCatalog.d.ts.map +0 -1
- package/dist/compiler/semanticContext.d.ts.map +0 -1
- package/dist/compiler/semanticTypeDependencies.d.ts.map +0 -1
- package/dist/compiler/semanticTypeReference.d.ts.map +0 -1
- package/dist/compiler/shapeResolver.d.ts.map +0 -1
- package/dist/compiler/sourceSchemaBinding.d.ts.map +0 -1
- package/dist/compiler/structuralCompanions.d.ts.map +0 -1
- package/dist/compiler/validateSemanticGraph.d.ts.map +0 -1
- package/dist/compiler/wildcardAlgebra.d.ts.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/gateway/generateGateway.d.ts.map +0 -1
- package/dist/gateway/generators.d.ts.map +0 -1
- package/dist/gateway/helpers.d.ts.map +0 -1
- package/dist/generation/preamble.d.ts.map +0 -1
- package/dist/generation/writeGeneratedSource.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/loader/fetch.d.ts.map +0 -1
- package/dist/loader/orderedSyntax.d.ts.map +0 -1
- package/dist/loader/resolutionDepth.d.ts.map +0 -1
- package/dist/loader/schemaInput.d.ts.map +0 -1
- package/dist/loader/schemaResources.d.ts.map +0 -1
- package/dist/loader/wsdlLoader.d.ts.map +0 -1
- package/dist/openapi/casing.d.ts.map +0 -1
- package/dist/openapi/generateOpenAPI.d.ts.map +0 -1
- package/dist/openapi/generatePaths.d.ts.map +0 -1
- package/dist/openapi/generateSchemas.d.ts.map +0 -1
- package/dist/openapi/security.d.ts.map +0 -1
- package/dist/pipeline.d.ts.map +0 -1
- package/dist/runtime/jsonArray.d.ts +0 -24
- package/dist/runtime/jsonArray.d.ts.map +0 -1
- package/dist/runtime/jsonArray.js +0 -52
- package/dist/runtime/ndjson.d.ts +0 -24
- package/dist/runtime/ndjson.d.ts.map +0 -1
- package/dist/runtime/ndjson.js +0 -30
- package/dist/runtime/streamXml.d.ts +0 -45
- package/dist/runtime/streamXml.d.ts.map +0 -1
- package/dist/runtime/streamXml.js +0 -212
- package/dist/test/generateTests.d.ts.map +0 -1
- package/dist/test/generators.d.ts.map +0 -1
- package/dist/test/mockData.d.ts.map +0 -1
- package/dist/util/attributeWildcards.d.ts.map +0 -1
- package/dist/util/builder.d.ts.map +0 -1
- package/dist/util/catalogMeta.d.ts.map +0 -1
- package/dist/util/cli.d.ts.map +0 -1
- package/dist/util/errors.d.ts.map +0 -1
- package/dist/util/imports.d.ts.map +0 -1
- package/dist/util/runtimeSource.d.ts.map +0 -1
- package/dist/util/securityConfig.d.ts.map +0 -1
- package/dist/util/streamConfig.d.ts.map +0 -1
- package/dist/util/tools.d.ts.map +0 -1
- package/dist/util/xmlWhitespace.d.ts.map +0 -1
- package/dist/xsd/primitives.d.ts.map +0 -1
- package/docs/AGENTS.md +0 -47
- package/docs/README.md +0 -69
- package/docs/architecture.md +0 -158
- package/docs/content-model-analysis.md +0 -92
- package/docs/content-model-baseline.md +0 -121
- package/docs/content-model-catalog.md +0 -116
- package/docs/content-model-companions.md +0 -90
- package/docs/content-model-composition.md +0 -103
- package/docs/content-model-decisions.md +0 -79
- package/docs/content-model-gateway-feasibility.md +0 -169
- package/docs/content-model-graph.md +0 -121
- package/docs/content-model-loading.md +0 -163
- package/docs/content-model-matching.md +0 -85
- package/docs/content-model-readiness.md +0 -144
- package/docs/content-model-resolution.md +0 -81
- package/docs/content-model-s02-handoff.md +0 -98
- package/docs/content-model-s06-au-01.md +0 -425
- package/docs/content-model-s06-dt-01.md +0 -386
- package/docs/content-model-s06-pw-01.md +0 -350
- package/docs/content-model-s06-re-01-resolver-implementation.md +0 -869
- package/docs/content-model-s06-re-01-resolver.md +0 -513
- package/docs/content-model-s06-re-01-scalar-witnesses.md +0 -1423
- package/docs/content-model-s06-re-01-support-reconstruction.md +0 -6337
- package/docs/content-model-s06-re-01.md +0 -7477
- package/docs/content-model-s06-research-handoff.md +0 -909
- package/docs/content-model-shipped-fix.md +0 -83
- package/docs/content-model-soap-feasibility.md +0 -165
- package/docs/decisions/001-test-generation.md +0 -36
- package/docs/decisions/002-streamable-responses.md +0 -332
- package/docs/decisions/003-content-model-contracts.md +0 -280
- package/docs/file-naming-and-path-organization.md +0 -213
- package/docs/reference-validation.md +0 -243
- package/docs/releases/README.md +0 -94
- package/docs/releases/v0.20.0.md +0 -22
- package/docs/releases/v0.21.0.md +0 -30
- package/docs/releases/v0.22.0.md +0 -30
- package/docs/releases/v0.23.0.md +0 -31
- package/docs/releases/v0.24.0.md +0 -38
- package/docs/releases/v0.25.0.md +0 -31
- package/docs/releases/v0.25.2.md +0 -32
- package/docs/releases/v0.26.0.md +0 -32
- package/docs/releases/v0.27.0.md +0 -31
- package/docs/releases/v0.28.0.md +0 -32
- package/docs/releases/v0.29.0.md +0 -32
- package/docs/releases/v0.30.0.md +0 -30
- package/docs/releases/v0.30.1.md +0 -31
- package/docs/releases/v0.30.2.md +0 -30
- package/docs/releases/v0.30.3.md +0 -33
- package/docs/releases/v0.31.0.md +0 -33
- package/docs/releases/v0.32.0.md +0 -33
- package/docs/releases/v0.33.0.md +0 -34
- package/docs/releases/v0.34.0.md +0 -30
- package/docs/releases/v0.35.0.md +0 -33
- package/docs/releases/v0.36.0.md +0 -32
- package/docs/releases/v0.37.0.md +0 -33
- package/docs/releases/v0.38.0.md +0 -35
- package/docs/releases/v0.39.0.md +0 -35
- package/docs/releases/v0.40.0.md +0 -45
- package/docs/releases/v0.40.1.md +0 -34
- package/docs/releases/v1.0.0.md +0 -42
- package/docs/releases/v1.0.1.md +0 -38
- package/docs/releases/v1.0.2.md +0 -51
- package/docs/releases/v1.0.3.md +0 -37
- package/docs/releases/v1.0.4.md +0 -45
- package/docs/releases/v1.0.5.md +0 -41
- package/docs/releases/v1.0.6.md +0 -35
- package/docs/releases/v1.0.7.md +0 -36
- package/docs/releases/v1.1.0.md +0 -42
- package/docs/releases/v1.1.1.md +0 -44
- package/docs/releases/v1.1.2.md +0 -42
- package/docs/releases/v1.1.3.md +0 -36
- package/docs/releases/v1.1.4.md +0 -36
- package/docs/releases/v1.1.5.md +0 -38
- package/docs/roadmap/README.md +0 -107
- package/docs/roadmap/v1.0-capability-conformance-framework.md +0 -582
- package/docs/roadmap/v1.0-choice-union-mode.md +0 -90
- package/docs/roadmap/v1.0-contract-audit.md +0 -75
- package/docs/roadmap/v1.0-json-array-streaming.md +0 -101
- package/docs/roadmap/v1.0-openapi-fastify-compatibility.md +0 -99
- package/docs/roadmap/v1.0-release-candidate-gates.md +0 -92
- package/docs/roadmap/v1.0-wsdl-coverage-matrix.md +0 -200
- package/docs/roadmap/v1.0-xs-anyattribute-wildcard-bag.md +0 -932
- package/src/runtime/jsonArray.ts +0 -55
- package/src/runtime/ndjson.ts +0 -32
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { SemanticBudget, SemanticBudgetLimits, ResolverUsage } from './semanticBudget.js';
|
|
2
2
|
import type { DirectOperationContract, DirectOperationSelector } from './directOperation.js';
|
|
3
|
-
import type { DirectValueMapping } from './directValues.js';
|
|
3
|
+
import type { DirectValueMapping, ComponentValueMapping } from './directValues.js';
|
|
4
|
+
import { ComponentSoapPreparation } from './componentSoapPreparation.js';
|
|
5
|
+
import type { SchemaInputOptions } from '../loader/schemaInput.js';
|
|
4
6
|
import type { SchemaResourcePolicy } from '../loader/schemaResources.js';
|
|
5
7
|
import type { ExpandedName } from '../loader/orderedSyntax.js';
|
|
8
|
+
import type { ComponentRecordProjection } from './componentRecordProjection.js';
|
|
9
|
+
import type { ApplicationGroupsOptions } from './applicationGroups.js';
|
|
6
10
|
export declare const DIRECT_CAPSULE_LIMITS: Readonly<{
|
|
7
11
|
maxBytes: number;
|
|
8
12
|
sourceBytes: number;
|
|
@@ -93,5 +97,73 @@ export declare function checkDirectSourceCompatibility(expected: unknown, contra
|
|
|
93
97
|
admitted: false;
|
|
94
98
|
usage: ResolverUsage;
|
|
95
99
|
}> | DirectCapsuleFailure;
|
|
100
|
+
export interface ReconstructedComponentSource {
|
|
101
|
+
readonly kind: 'reconstructed-component';
|
|
102
|
+
readonly contract: DirectOperationContract;
|
|
103
|
+
readonly mappings: readonly (ComponentValueMapping | ComponentRecordProjection)[];
|
|
104
|
+
readonly selection: DirectSourceSelection;
|
|
105
|
+
readonly responseProjection?: ComponentRecordProjection;
|
|
106
|
+
readonly admitted: false;
|
|
107
|
+
readonly usage: ResolverUsage;
|
|
108
|
+
}
|
|
109
|
+
/** Serialize native component provenance as data; no source, mapping or execution authority is serialized.
|
|
110
|
+
* @returns Deterministic original resource bytes and compatibility description, or explicit refusal.
|
|
111
|
+
* @throws TypeError For foreign operation handles. Caller cancellation is returned as a refusal.
|
|
112
|
+
*/
|
|
113
|
+
export declare function createComponentSourceCapsule(contract: DirectOperationContract, selection: DirectSourceSelection, signal?: AbortSignal, responseProjection?: ComponentRecordProjection): Promise<Readonly<{
|
|
114
|
+
kind: 'component-capsule';
|
|
115
|
+
bytes: Uint8Array;
|
|
116
|
+
admitted: false;
|
|
117
|
+
usage: ResolverUsage;
|
|
118
|
+
}> | DirectCapsuleFailure>;
|
|
119
|
+
/** Prepare a generator-owned operation once through the same native descriptor used by runtime reconstruction.
|
|
120
|
+
* @param contract Fresh source-owned operation, never a report or copied handle.
|
|
121
|
+
* @param selection Explicit resolved service and port.
|
|
122
|
+
* @param preparation Invocation-owned SOAP metadata reuse.
|
|
123
|
+
* @param signal Caller cancellation.
|
|
124
|
+
* @param responseProjection Optional native companion projection.
|
|
125
|
+
* @returns An authentic reconstruction retaining its exact issued capsule and mappings, or native refusal.
|
|
126
|
+
* @throws TypeError For foreign native operation identities.
|
|
127
|
+
* @constraints Runtime physical-source reconstruction is independent and unchanged.
|
|
128
|
+
*/
|
|
129
|
+
export declare function prepareComponentSourceForOperation(contract: DirectOperationContract, selection: DirectSourceSelection, preparation: ComponentSoapPreparation, signal?: AbortSignal, responseProjection?: ComponentRecordProjection, applicationGroups?: ApplicationGroupsOptions): Promise<ReconstructedComponentSource | DirectCapsuleFailure>;
|
|
130
|
+
/** Copy capsule data retained by an authentic reconstruction without repeating preparation.
|
|
131
|
+
* @param expected Fresh owned reconstruction.
|
|
132
|
+
* @param signal Caller cancellation.
|
|
133
|
+
* @returns Deterministic capsule bytes; the data grants no runtime authority.
|
|
134
|
+
* @throws TypeError For copied or foreign reconstruction identities; cancellation/resource failures propagate.
|
|
135
|
+
*/
|
|
136
|
+
export declare function componentSourceCapsuleBytes(expected: ReconstructedComponentSource, signal?: AbortSignal): Uint8Array;
|
|
137
|
+
/** Reconstruct from a physical root and caller-authorized dependencies; embedded bytes are comparison data only.
|
|
138
|
+
* @remarks Local imports may relocate together. All original resource bytes and explicit service/binding roots must match.
|
|
139
|
+
* Loading policy, offline snapshots and namespace locations are supplied independently by the caller, never the capsule.
|
|
140
|
+
* @returns Fresh native operation/mapping authority with admitted=false, or explicit refusal.
|
|
141
|
+
*/
|
|
142
|
+
export interface ComponentSourceReconstructionOptions {
|
|
143
|
+
loading: SchemaInputOptions;
|
|
144
|
+
limits?: SemanticBudgetLimits;
|
|
145
|
+
signal?: AbortSignal;
|
|
146
|
+
/** Caller permission; artifact identifiers alone never acquire a standard library. */
|
|
147
|
+
standardLibraries?: readonly string[];
|
|
148
|
+
/** Explicit physical companion roots, associated with exact outer binding/operation selectors. */
|
|
149
|
+
recordSources?: readonly {
|
|
150
|
+
readonly selector: DirectOperationSelector;
|
|
151
|
+
readonly source: string;
|
|
152
|
+
}[];
|
|
153
|
+
}
|
|
154
|
+
export declare function reconstructComponentSourceCapsule(bytes: Uint8Array, localSource: string, options: Readonly<ComponentSourceReconstructionOptions>): Promise<ReconstructedComponentSource | DirectCapsuleFailure>;
|
|
155
|
+
/** Private runtime seam retaining one sticky request for artifact reading, source qualification and exchange. */
|
|
156
|
+
export declare function reconstructComponentSourceCapsuleInRequest(bytes: Uint8Array, localSource: string, options: Readonly<ComponentSourceReconstructionOptions>, budget: SemanticBudget): Promise<ReconstructedComponentSource | DirectCapsuleFailure>;
|
|
157
|
+
/** Generator seam: expected bytes are checked against an already fresh, source-owned native operation.
|
|
158
|
+
* @remarks This accepts transient native authority only. Runtime consumers still reconstruct from independently
|
|
159
|
+
* authorized physical files. It permits service-wide generation to reuse one native whole-source qualification.
|
|
160
|
+
*/
|
|
161
|
+
export declare function reconstructComponentSourceCapsuleForOperation(bytes: Uint8Array, contract: DirectOperationContract, selection: DirectSourceSelection, signal?: AbortSignal, responseProjection?: ComponentRecordProjection): Promise<ReconstructedComponentSource | DirectCapsuleFailure>;
|
|
162
|
+
/** Authenticate transient reconstruction identity; saved/copy-shaped reports cannot be consumed by generators. */
|
|
163
|
+
export declare function inspectReconstructedComponentSource(value: ReconstructedComponentSource): ReconstructedComponentSource;
|
|
164
|
+
/** Group fresh operations for one service without merging source contexts or binding identities.
|
|
165
|
+
* @returns A deterministic operation order over the original native handles.
|
|
166
|
+
* @throws TypeError For foreign handles, duplicate operations, accessors or mixed sources/services/bindings.
|
|
167
|
+
*/
|
|
168
|
+
export declare function inspectComponentSourceService(values: readonly ReconstructedComponentSource[]): readonly ReconstructedComponentSource[];
|
|
96
169
|
export {};
|
|
97
|
-
//# sourceMappingURL=directSourceCapsule.d.ts.map
|
|
@@ -4,13 +4,20 @@ import { checkSemanticBudget } from './semanticBudget.js';
|
|
|
4
4
|
import { DataOwnershipLimitError } from './dataOwnership.js';
|
|
5
5
|
import { createHash } from 'node:crypto';
|
|
6
6
|
import { types } from 'node:util';
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
7
9
|
import { canonicalJson, parseCatalogJson, CatalogError } from './catalogErrors.js';
|
|
8
10
|
import { createApplicationBudget } from './semanticBudget.js';
|
|
9
|
-
import { inspectDirectOperation, selectDirectOperationInRequest } from './directOperation.js';
|
|
10
|
-
import { createDirectValueMapping, DIRECT_VALUE_VERSION, DIRECT_SCALAR_POLICY } from './directValues.js';
|
|
11
|
-
import { prepareDirectSoapSource, DirectSoapSourceError, DIRECT_SOAP_SOURCE_MAX_BYTES } from './directSoapSource.js';
|
|
11
|
+
import { inspectDirectOperation, selectDirectOperationInRequest, selectComponentOperationInRequest } from './directOperation.js';
|
|
12
|
+
import { createDirectValueMapping, createComponentValueMapping, inspectComponentValueMapping, DIRECT_VALUE_VERSION, DIRECT_SCALAR_POLICY } from './directValues.js';
|
|
13
|
+
import { prepareDirectSoapSource, prepareComponentSoapWsdl, DirectSoapSourceError, DIRECT_SOAP_SOURCE_MAX_BYTES } from './directSoapSource.js';
|
|
14
|
+
import { ComponentSoapPreparation } from './componentSoapPreparation.js';
|
|
15
|
+
import { copyOriginalSchemaResource } from '../loader/schemaInput.js';
|
|
12
16
|
import { SchemaResourceLoader, resolveResourceUri } from '../loader/schemaResources.js';
|
|
13
17
|
import { parseOrderedSyntax, syntaxElements, isXmlNCName, SchemaLoadingError } from '../loader/orderedSyntax.js';
|
|
18
|
+
import { createComponentRecordProjection, inspectComponentRecordProjection } from './componentRecordProjection.js';
|
|
19
|
+
import { acquireStandardSchemaLibrary, SCHEMA_ELEMENT_LIBRARY } from './standardSchemaComponents.js';
|
|
20
|
+
import { parseApplicationGroups } from './applicationGroups.js';
|
|
14
21
|
export const DIRECT_CAPSULE_LIMITS = Object.freeze({ maxBytes: 256 * 1024, sourceBytes: DIRECT_SOAP_SOURCE_MAX_BYTES });
|
|
15
22
|
const versions = Object.freeze({ capsuleFormat: 1, model: 'xsd10-faithful-v1', scope: 'direct-soap11-single-utf8-v1',
|
|
16
23
|
mapping: DIRECT_VALUE_VERSION, scalarPolicy: DIRECT_SCALAR_POLICY, runtimePolicy: 'owned-loopback-http-no-extensions-v1' });
|
|
@@ -52,7 +59,7 @@ function failure(error, budget) {
|
|
|
52
59
|
}
|
|
53
60
|
else
|
|
54
61
|
throw error;
|
|
55
|
-
return Object.freeze({ kind, rule, repair: 'Regenerate matched
|
|
62
|
+
return Object.freeze({ kind, rule, repair: 'Regenerate matched checked direct artifacts from explicitly authorized original WSDL using the checked-direct-v1 pipeline.', usage: Object.freeze({ ...budget.usage() }) });
|
|
56
63
|
}
|
|
57
64
|
function check(budget, signal) {
|
|
58
65
|
checkSemanticBudget(budget);
|
|
@@ -111,7 +118,7 @@ export function readDirectSourceCapsule(bytes, budget, signal) {
|
|
|
111
118
|
return failure(error, budget);
|
|
112
119
|
}
|
|
113
120
|
}
|
|
114
|
-
function
|
|
121
|
+
function capsuleJson(bytes, budget, signal) {
|
|
115
122
|
check(budget, signal);
|
|
116
123
|
if (!types.isUint8Array(bytes) || types.isProxy(bytes))
|
|
117
124
|
return reject('byte-input-required');
|
|
@@ -132,7 +139,10 @@ function read(bytes, budget, signal) {
|
|
|
132
139
|
catch {
|
|
133
140
|
return reject('capsule-utf8');
|
|
134
141
|
}
|
|
135
|
-
|
|
142
|
+
return parseCatalogJson(decoded, { maxBytes: directLimit(budget, DIRECT_CAPSULE_LIMITS.maxBytes), maxDepth: 16 });
|
|
143
|
+
}
|
|
144
|
+
function read(bytes, budget, signal) {
|
|
145
|
+
const parsed = record(capsuleJson(bytes, budget, signal), ['versions', 'source', 'compatibility', 'fingerprint']);
|
|
136
146
|
const actual = record(parsed.versions, Object.keys(versions));
|
|
137
147
|
for (const key of Object.keys(versions))
|
|
138
148
|
if (actual[key] !== versions[key])
|
|
@@ -303,3 +313,471 @@ export function checkDirectSourceCompatibility(expected, contract, selection, si
|
|
|
303
313
|
return failure(error, budget);
|
|
304
314
|
}
|
|
305
315
|
}
|
|
316
|
+
const componentVersions = Object.freeze({ ...versions, scope: 'component-soap11-utf8-graph-v1', mapping: 'component-values-v1',
|
|
317
|
+
runtimePolicy: 'explicit-http-verified-https-transport-v1' });
|
|
318
|
+
const scopedComponentVersions = Object.freeze({ ...componentVersions, scope: 'component-soap11-utf8-graph-v2', mapping: 'component-values-and-record-scope-v1' });
|
|
319
|
+
const rpcComponentVersions = Object.freeze({ ...componentVersions, scope: 'component-soap11-rpc-strings-v1', mapping: 'component-rpc-string-values-v1' });
|
|
320
|
+
const typedRpcComponentVersions = Object.freeze({ ...componentVersions, scope: 'component-soap11-rpc-typed-latin1-v1', mapping: 'component-rpc-typed-values-v1' });
|
|
321
|
+
const componentReconstructions = new WeakMap();
|
|
322
|
+
function componentFailure(error, budget) {
|
|
323
|
+
return Object.freeze({ ...failure(error, budget), repair: 'Regenerate matched component artifacts from explicitly authorized original WSDL and dependencies.' });
|
|
324
|
+
}
|
|
325
|
+
// @constraints Retrieval keys are compared only; artifact paths never initiate I/O. Local relative imports can relocate together.
|
|
326
|
+
function componentResourceKey(source, uri) {
|
|
327
|
+
if (uri === source.root.uri)
|
|
328
|
+
return 'root';
|
|
329
|
+
if (new URL(uri).protocol !== 'file:')
|
|
330
|
+
return 'uri:' + uri;
|
|
331
|
+
return 'file:' + path.relative(path.dirname(fileURLToPath(source.root.uri)), fileURLToPath(uri)).replaceAll('\\', '/');
|
|
332
|
+
}
|
|
333
|
+
function componentResources(contract, signal) {
|
|
334
|
+
const { source, context: { budget } } = inspectDirectOperation(contract);
|
|
335
|
+
const resources = source.resources.map(resource => {
|
|
336
|
+
check(budget, signal);
|
|
337
|
+
const bytes = copyOriginalSchemaResource(source, resource.uri, amount => { check(budget, signal); budget.chargeWork(amount); });
|
|
338
|
+
return { key: componentResourceKey(source, resource.uri), base64: Buffer.from(bytes).toString('base64'), digest: resource.digest };
|
|
339
|
+
}).sort((a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0);
|
|
340
|
+
if (new Set(resources.map(resource => resource.key)).size !== resources.length)
|
|
341
|
+
throw new Stop('unsupported', 'ambiguous-resource-key');
|
|
342
|
+
return resources;
|
|
343
|
+
}
|
|
344
|
+
async function componentDescriptor(contract, selection, signal, responseProjection, preparation, applicationGroups) {
|
|
345
|
+
const { context: { budget }, source } = inspectDirectOperation(contract);
|
|
346
|
+
const tick = () => check(budget, signal);
|
|
347
|
+
tick();
|
|
348
|
+
if (contract.basis !== 'native-component-premises-v1' || contract.correspondence !== 'dated-XSD-2004-components-v1')
|
|
349
|
+
throw new Stop('unsupported', 'component-capsule-version');
|
|
350
|
+
const owned = directDataOwnership(budget).snapshot(selection, tick);
|
|
351
|
+
record(owned, ['service', 'port']);
|
|
352
|
+
name(owned.service);
|
|
353
|
+
ncname(owned.port);
|
|
354
|
+
if (preparation)
|
|
355
|
+
await ComponentSoapPreparation.prototype.prepare.call(preparation, contract, owned, tick);
|
|
356
|
+
else
|
|
357
|
+
await prepareComponentSoapWsdl(contract, owned, tick);
|
|
358
|
+
if (responseProjection)
|
|
359
|
+
inspectComponentRecordProjection(responseProjection, contract);
|
|
360
|
+
const mappings = [];
|
|
361
|
+
const make = (direction) => {
|
|
362
|
+
tick();
|
|
363
|
+
const mapping = direction.kind === 'output' && responseProjection ? responseProjection : createComponentValueMapping(contract, direction, { signal }, applicationGroups);
|
|
364
|
+
if (mapping.kind !== 'component-mapping' && mapping.kind !== 'component-record-projection')
|
|
365
|
+
throw new Stop(mapping.kind === 'resource-limit' || mapping.kind === 'cancelled' ? mapping.kind : 'unsupported', mapping.rule);
|
|
366
|
+
mappings.push(mapping);
|
|
367
|
+
if ('parts' in mapping.root)
|
|
368
|
+
return { kind: 'rpc-typed-parts-v1', message: mapping.root.message,
|
|
369
|
+
wrapper: mapping.root.wrapper, bodyNamespace: mapping.root.bodyNamespace, encoding: contract.binding.encoding,
|
|
370
|
+
parts: mapping.root.parts.map(part => {
|
|
371
|
+
const resolved = inspectDirectOperation(contract).context.resolve(part.type);
|
|
372
|
+
const type = resolved.kind === 'builtin' ? resolved.name : resolved.kind === 'found' && resolved.node.identity.kind === 'global'
|
|
373
|
+
? resolved.node.identity.name : undefined;
|
|
374
|
+
if (!type)
|
|
375
|
+
throw new Stop('unsupported', 'rpc-named-type-required');
|
|
376
|
+
return { name: part.name, type };
|
|
377
|
+
}) };
|
|
378
|
+
return { element: mapping.root.element.name, message: mapping.root.message, part: mapping.root.part };
|
|
379
|
+
};
|
|
380
|
+
const input = make({ kind: 'input' }), output = make({ kind: 'output' });
|
|
381
|
+
const faults = contract.faults.map(fault => ({ name: fault.name, root: make({ kind: 'fault', name: fault.name }) }));
|
|
382
|
+
const compatibility = { selector: contract.selector, service: owned.service, port: owned.port,
|
|
383
|
+
action: contract.binding.action, input, output, faults };
|
|
384
|
+
let projection = null;
|
|
385
|
+
if (responseProjection) {
|
|
386
|
+
const { companion } = inspectComponentRecordProjection(responseProjection, contract);
|
|
387
|
+
if ('parts' in companion.output)
|
|
388
|
+
throw new Stop('unsupported', 'record-projection-requires-document-output');
|
|
389
|
+
const { context } = inspectDirectOperation(companion);
|
|
390
|
+
projection = { spec: responseProjection.spec, source: { selector: companion.selector, action: companion.binding.action,
|
|
391
|
+
output: { element: companion.output.element.name, message: companion.output.message, part: companion.output.part },
|
|
392
|
+
libraries: context.standardLibraryIds(), resources: componentResources(companion, signal) } };
|
|
393
|
+
}
|
|
394
|
+
const targets = new Set(mappings.flatMap(mapping => mapping.kind === 'component-mapping'
|
|
395
|
+
? (inspectComponentValueMapping(mapping, contract).applicationGroups?.targets ?? []).map(target => target.target) : []));
|
|
396
|
+
const groups = applicationGroups ? parseApplicationGroups(applicationGroups) : undefined;
|
|
397
|
+
const groupPlans = mappings.flatMap(mapping => mapping.kind === 'component-mapping'
|
|
398
|
+
? [inspectComponentValueMapping(mapping, contract).applicationGroups] : []);
|
|
399
|
+
const applicationGroupIdentity = groups ? hash(json({ version: 'application-groups-v1',
|
|
400
|
+
targets: [...new Map(groupPlans.flatMap(plan => plan.targets.map(target => [target.target, target]))).values()].sort((a, b) => a.target.localeCompare(b.target, 'en')),
|
|
401
|
+
records: [...new Map(groupPlans.flatMap(plan => plan.dispositions.map(record => [record.source, record]))).values()].sort((a, b) => a.source.localeCompare(b.source, 'en')) }, budget)) : undefined;
|
|
402
|
+
tick();
|
|
403
|
+
return { compatibility, resources: componentResources(contract, signal), mappings, libraries: inspectDirectOperation(contract).context.standardLibraryIds(), projection,
|
|
404
|
+
...(groups ? { applicationGroups: groups.names === undefined ? {} : { names: groups.names.filter(item => targets.has(item.target)) }, applicationGroupIdentity } : {}) };
|
|
405
|
+
}
|
|
406
|
+
/** Serialize native component provenance as data; no source, mapping or execution authority is serialized.
|
|
407
|
+
* @returns Deterministic original resource bytes and compatibility description, or explicit refusal.
|
|
408
|
+
* @throws TypeError For foreign operation handles. Caller cancellation is returned as a refusal.
|
|
409
|
+
*/
|
|
410
|
+
export async function createComponentSourceCapsule(contract, selection, signal, responseProjection) {
|
|
411
|
+
const { budget } = inspectDirectOperation(contract).context;
|
|
412
|
+
try {
|
|
413
|
+
const { compatibility, resources, libraries, projection } = await componentDescriptor(contract, selection, signal, responseProjection);
|
|
414
|
+
const capsule = componentCapsule({ compatibility, resources, libraries, projection }, budget);
|
|
415
|
+
const serialized = json(capsule, budget) + '\n';
|
|
416
|
+
if (Buffer.byteLength(serialized) > directLimit(budget, DIRECT_CAPSULE_LIMITS.maxBytes))
|
|
417
|
+
throw new Stop('resource-limit', 'capsule-byte-limit');
|
|
418
|
+
check(budget, signal);
|
|
419
|
+
return Object.freeze({ kind: 'component-capsule', bytes: Buffer.from(serialized), admitted: false, usage: Object.freeze({ ...budget.usage() }) });
|
|
420
|
+
}
|
|
421
|
+
catch (error) {
|
|
422
|
+
if (!budget.exhausted() && signal?.aborted)
|
|
423
|
+
return componentFailure(new Stop('cancelled', 'cooperative-cancellation'), budget);
|
|
424
|
+
return componentFailure(error, budget);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
function componentCapsule(derived, budget) {
|
|
428
|
+
const { compatibility, resources, libraries, projection } = derived;
|
|
429
|
+
const extended = libraries.length > 0 || projection !== null;
|
|
430
|
+
const rpc = 'kind' in compatibility.input && compatibility.input.kind === 'rpc-typed-parts-v1';
|
|
431
|
+
const typedRpc = rpc && compatibility.input.parts.some(part => part.type.namespace !== 'http://www.w3.org/2001/XMLSchema' || part.type.local !== 'string');
|
|
432
|
+
if (rpc && (extended || derived.applicationGroups))
|
|
433
|
+
throw new Stop('unsupported', 'rpc-artifact-extension');
|
|
434
|
+
const value = { versions: typedRpc ? typedRpcComponentVersions : rpc ? rpcComponentVersions : extended ? scopedComponentVersions : componentVersions, resources, compatibility,
|
|
435
|
+
...(extended ? { libraries, projection } : {}), ...(derived.applicationGroups ? { applicationGroups: derived.applicationGroups, applicationGroupIdentity: derived.applicationGroupIdentity } : {}) };
|
|
436
|
+
return { ...value, fingerprint: hash(json(value, budget)) };
|
|
437
|
+
}
|
|
438
|
+
/** Prepare a generator-owned operation once through the same native descriptor used by runtime reconstruction.
|
|
439
|
+
* @param contract Fresh source-owned operation, never a report or copied handle.
|
|
440
|
+
* @param selection Explicit resolved service and port.
|
|
441
|
+
* @param preparation Invocation-owned SOAP metadata reuse.
|
|
442
|
+
* @param signal Caller cancellation.
|
|
443
|
+
* @param responseProjection Optional native companion projection.
|
|
444
|
+
* @returns An authentic reconstruction retaining its exact issued capsule and mappings, or native refusal.
|
|
445
|
+
* @throws TypeError For foreign native operation identities.
|
|
446
|
+
* @constraints Runtime physical-source reconstruction is independent and unchanged.
|
|
447
|
+
*/
|
|
448
|
+
export async function prepareComponentSourceForOperation(contract, selection, preparation, signal, responseProjection, applicationGroups) {
|
|
449
|
+
const { budget } = inspectDirectOperation(contract).context;
|
|
450
|
+
try {
|
|
451
|
+
const derived = await componentDescriptor(contract, selection, signal, responseProjection, preparation, applicationGroups);
|
|
452
|
+
const capsule = componentCapsule(derived, budget);
|
|
453
|
+
if (Buffer.byteLength(json(capsule, budget) + '\n') > directLimit(budget, DIRECT_CAPSULE_LIMITS.maxBytes))
|
|
454
|
+
throw new Stop('resource-limit', 'capsule-byte-limit');
|
|
455
|
+
return issueComponentReconstruction(capsule, contract, derived, signal, responseProjection);
|
|
456
|
+
}
|
|
457
|
+
catch (error) {
|
|
458
|
+
if (!budget.exhausted() && signal?.aborted)
|
|
459
|
+
return componentFailure(new Stop('cancelled', 'cooperative-cancellation'), budget);
|
|
460
|
+
return componentFailure(error, budget);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
/** Copy capsule data retained by an authentic reconstruction without repeating preparation.
|
|
464
|
+
* @param expected Fresh owned reconstruction.
|
|
465
|
+
* @param signal Caller cancellation.
|
|
466
|
+
* @returns Deterministic capsule bytes; the data grants no runtime authority.
|
|
467
|
+
* @throws TypeError For copied or foreign reconstruction identities; cancellation/resource failures propagate.
|
|
468
|
+
*/
|
|
469
|
+
export function componentSourceCapsuleBytes(expected, signal) {
|
|
470
|
+
inspectReconstructedComponentSource(expected);
|
|
471
|
+
const { budget } = inspectDirectOperation(expected.contract).context;
|
|
472
|
+
check(budget, signal);
|
|
473
|
+
return Buffer.from(json(componentReconstructions.get(expected), budget) + '\n');
|
|
474
|
+
}
|
|
475
|
+
function readComponent(bytes, budget, signal) {
|
|
476
|
+
const value = capsuleJson(bytes, budget, signal);
|
|
477
|
+
const extended = !!value && typeof value === 'object' && (Object.hasOwn(value, 'libraries') || Object.hasOwn(value, 'projection'));
|
|
478
|
+
const grouped = !!value && typeof value === 'object' && Object.hasOwn(value, 'applicationGroups');
|
|
479
|
+
const parsed = record(value, [...(extended ? ['versions', 'resources', 'compatibility', 'libraries', 'projection', 'fingerprint']
|
|
480
|
+
: ['versions', 'resources', 'compatibility', 'fingerprint']), ...(grouped ? ['applicationGroups', 'applicationGroupIdentity'] : [])]);
|
|
481
|
+
if (grouped) {
|
|
482
|
+
try {
|
|
483
|
+
parseApplicationGroups(parsed.applicationGroups);
|
|
484
|
+
}
|
|
485
|
+
catch {
|
|
486
|
+
reject('application-group-configuration');
|
|
487
|
+
}
|
|
488
|
+
text(parsed.applicationGroupIdentity);
|
|
489
|
+
if (!/^[a-f0-9]{64}$/.test(parsed.applicationGroupIdentity))
|
|
490
|
+
reject('application-group-identity');
|
|
491
|
+
}
|
|
492
|
+
const typedRpc = !!parsed.versions && typeof parsed.versions === 'object' && parsed.versions.scope === typedRpcComponentVersions.scope;
|
|
493
|
+
const rpc = typedRpc || !!parsed.versions && typeof parsed.versions === 'object' && parsed.versions.scope === rpcComponentVersions.scope;
|
|
494
|
+
if (rpc && (extended || grouped))
|
|
495
|
+
reject('rpc-artifact-extension');
|
|
496
|
+
const expectedVersions = typedRpc ? typedRpcComponentVersions : rpc ? rpcComponentVersions : extended ? scopedComponentVersions : componentVersions;
|
|
497
|
+
const actual = record(parsed.versions, Object.keys(expectedVersions));
|
|
498
|
+
for (const key of Object.keys(expectedVersions))
|
|
499
|
+
if (actual[key] !== expectedVersions[key])
|
|
500
|
+
reject('unsupported-version-mode-or-policy');
|
|
501
|
+
validateComponentResources(parsed.resources, budget, signal);
|
|
502
|
+
const root = (value) => {
|
|
503
|
+
if (rpc) {
|
|
504
|
+
const r = record(value, ['kind', 'message', 'wrapper', 'bodyNamespace', 'encoding', 'parts']);
|
|
505
|
+
if (r.kind !== 'rpc-typed-parts-v1' || r.encoding !== 'http://schemas.xmlsoap.org/soap/encoding/')
|
|
506
|
+
reject('rpc-root-profile');
|
|
507
|
+
name(r.message);
|
|
508
|
+
name(r.wrapper);
|
|
509
|
+
text(r.bodyNamespace);
|
|
510
|
+
if (!Array.isArray(r.parts) || !r.parts.length)
|
|
511
|
+
return reject('rpc-parts-required');
|
|
512
|
+
const names = new Set();
|
|
513
|
+
for (const part of r.parts) {
|
|
514
|
+
check(budget, signal);
|
|
515
|
+
const p = record(part, ['name', 'type']);
|
|
516
|
+
ncname(p.name);
|
|
517
|
+
name(p.type);
|
|
518
|
+
if (names.has(p.name))
|
|
519
|
+
reject('duplicate-rpc-part');
|
|
520
|
+
names.add(p.name);
|
|
521
|
+
if (!typedRpc && (p.type.namespace !== 'http://www.w3.org/2001/XMLSchema' || p.type.local !== 'string'))
|
|
522
|
+
reject('rpc-part-type');
|
|
523
|
+
}
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
const r = record(value, ['element', 'message', 'part']);
|
|
527
|
+
name(r.element);
|
|
528
|
+
name(r.message);
|
|
529
|
+
ncname(r.part);
|
|
530
|
+
};
|
|
531
|
+
const selector = (value) => { const s = record(value, ['portType', 'binding', 'operation']); name(s.portType); name(s.binding); ncname(s.operation); };
|
|
532
|
+
if (extended) {
|
|
533
|
+
validateComponentLibraries(parsed.libraries);
|
|
534
|
+
if (parsed.projection !== null) {
|
|
535
|
+
const projection = record(parsed.projection, ['spec', 'source']);
|
|
536
|
+
const spec = record(projection.spec, ['version', 'scope', 'payloadPath', 'recordPath', 'opaqueExclusions']);
|
|
537
|
+
if (spec.version !== 'component-record-scope-v1' || spec.scope !== 'records-with-declared-wrapper-scope')
|
|
538
|
+
reject('unsupported-record-projection');
|
|
539
|
+
const path = (value) => { if (!Array.isArray(value) || !value.length)
|
|
540
|
+
reject('record-projection-path');
|
|
541
|
+
else
|
|
542
|
+
for (const entry of value) {
|
|
543
|
+
check(budget, signal);
|
|
544
|
+
name(entry);
|
|
545
|
+
} };
|
|
546
|
+
path(spec.payloadPath);
|
|
547
|
+
path(spec.recordPath);
|
|
548
|
+
if (!Array.isArray(spec.opaqueExclusions))
|
|
549
|
+
return reject('record-projection-exclusions');
|
|
550
|
+
for (const item of spec.opaqueExclusions) {
|
|
551
|
+
check(budget, signal);
|
|
552
|
+
const exclusion = record(item, ['path', 'reason']);
|
|
553
|
+
path(exclusion.path);
|
|
554
|
+
if (!['standard-schema-metadata', 'wrapper-declaration-universe'].includes(exclusion.reason))
|
|
555
|
+
reject('record-projection-exclusion');
|
|
556
|
+
}
|
|
557
|
+
const source = record(projection.source, ['selector', 'action', 'output', 'libraries', 'resources']);
|
|
558
|
+
selector(source.selector);
|
|
559
|
+
text(source.action);
|
|
560
|
+
root(source.output);
|
|
561
|
+
validateComponentLibraries(source.libraries);
|
|
562
|
+
validateComponentResources(source.resources, budget, signal);
|
|
563
|
+
}
|
|
564
|
+
if (!parsed.libraries.length && parsed.projection === null)
|
|
565
|
+
reject('empty-component-extension');
|
|
566
|
+
}
|
|
567
|
+
const c = record(parsed.compatibility, ['selector', 'service', 'port', 'action', 'input', 'output', 'faults']);
|
|
568
|
+
selector(c.selector);
|
|
569
|
+
name(c.service);
|
|
570
|
+
ncname(c.port);
|
|
571
|
+
text(c.action);
|
|
572
|
+
root(c.input);
|
|
573
|
+
root(c.output);
|
|
574
|
+
if (rpc) {
|
|
575
|
+
const parts = c.input.parts;
|
|
576
|
+
if (typedRpc !== parts.some(part => part.type.namespace !== 'http://www.w3.org/2001/XMLSchema' || part.type.local !== 'string'))
|
|
577
|
+
reject('rpc-type-version');
|
|
578
|
+
}
|
|
579
|
+
if (!Array.isArray(c.faults))
|
|
580
|
+
return reject('faults-required');
|
|
581
|
+
const names = new Set();
|
|
582
|
+
for (const entry of c.faults) {
|
|
583
|
+
check(budget, signal);
|
|
584
|
+
const fault = record(entry, ['name', 'root']);
|
|
585
|
+
ncname(fault.name);
|
|
586
|
+
root(fault.root);
|
|
587
|
+
if (names.has(fault.name))
|
|
588
|
+
reject('duplicate-fault');
|
|
589
|
+
names.add(fault.name);
|
|
590
|
+
}
|
|
591
|
+
text(parsed.fingerprint);
|
|
592
|
+
if (hash(json({ versions: actual, resources: parsed.resources, compatibility: c,
|
|
593
|
+
...(extended ? { libraries: parsed.libraries, projection: parsed.projection } : {}),
|
|
594
|
+
...(grouped ? { applicationGroups: parsed.applicationGroups, applicationGroupIdentity: parsed.applicationGroupIdentity } : {}) }, budget)) !== parsed.fingerprint)
|
|
595
|
+
reject('compatibility-fingerprint');
|
|
596
|
+
check(budget, signal);
|
|
597
|
+
return directDataOwnership(budget).freeze(parsed);
|
|
598
|
+
}
|
|
599
|
+
function validateComponentLibraries(value) {
|
|
600
|
+
if (!Array.isArray(value))
|
|
601
|
+
return reject('component-libraries-required');
|
|
602
|
+
let previous = '';
|
|
603
|
+
for (const id of value) {
|
|
604
|
+
if (typeof id !== 'string' || id !== SCHEMA_ELEMENT_LIBRARY || id <= previous)
|
|
605
|
+
reject('supported-sorted-unique-libraries-required');
|
|
606
|
+
previous = id;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
function validateComponentResources(value, budget, signal) {
|
|
610
|
+
if (!Array.isArray(value) || !value.length)
|
|
611
|
+
return reject('resources-required');
|
|
612
|
+
let previous = '';
|
|
613
|
+
for (const entry of value) {
|
|
614
|
+
check(budget, signal);
|
|
615
|
+
const resource = record(entry, ['key', 'base64', 'digest']);
|
|
616
|
+
text(resource.key);
|
|
617
|
+
text(resource.base64);
|
|
618
|
+
text(resource.digest);
|
|
619
|
+
if (resource.key <= previous)
|
|
620
|
+
reject('sorted-unique-resources-required');
|
|
621
|
+
previous = resource.key;
|
|
622
|
+
const original = Buffer.from(resource.base64, 'base64');
|
|
623
|
+
if (original.toString('base64') !== resource.base64 || hash(original) !== resource.digest)
|
|
624
|
+
reject('corrupt-source');
|
|
625
|
+
}
|
|
626
|
+
if (!value.some(resource => resource.key === 'root'))
|
|
627
|
+
reject('root-resource-required');
|
|
628
|
+
}
|
|
629
|
+
export async function reconstructComponentSourceCapsule(bytes, localSource, options) {
|
|
630
|
+
return reconstructComponentSourceCapsuleInRequest(bytes, localSource, options, createApplicationBudget(options.limits));
|
|
631
|
+
}
|
|
632
|
+
/** Private runtime seam retaining one sticky request for artifact reading, source qualification and exchange. */
|
|
633
|
+
export async function reconstructComponentSourceCapsuleInRequest(bytes, localSource, options, budget) {
|
|
634
|
+
try {
|
|
635
|
+
const capsule = readComponent(bytes, budget, options.signal);
|
|
636
|
+
const allowed = directDataOwnership(budget).snapshot(options.standardLibraries ?? [], () => check(budget, options.signal));
|
|
637
|
+
if (!Array.isArray(allowed) || allowed.some(id => id !== SCHEMA_ELEMENT_LIBRARY) || new Set(allowed).size !== allowed.length)
|
|
638
|
+
throw new Stop('unsupported', 'explicit-standard-library-permissions');
|
|
639
|
+
const sources = directDataOwnership(budget).snapshot(options.recordSources ?? [], () => check(budget, options.signal));
|
|
640
|
+
if (!Array.isArray(sources))
|
|
641
|
+
throw new Stop('unsupported', 'explicit-record-source-permissions');
|
|
642
|
+
let recordSource;
|
|
643
|
+
const sourceKeys = new Set();
|
|
644
|
+
for (const entry of sources) {
|
|
645
|
+
check(budget, options.signal);
|
|
646
|
+
const supplied = record(entry, ['selector', 'source']);
|
|
647
|
+
text(supplied.source);
|
|
648
|
+
const selector = record(supplied.selector, ['portType', 'binding', 'operation']);
|
|
649
|
+
name(selector.portType);
|
|
650
|
+
name(selector.binding);
|
|
651
|
+
ncname(selector.operation);
|
|
652
|
+
const key = json(selector, budget);
|
|
653
|
+
if (sourceKeys.has(key))
|
|
654
|
+
throw new Stop('unsupported', 'duplicate-record-source-permission');
|
|
655
|
+
sourceKeys.add(key);
|
|
656
|
+
if (key === json(capsule.compatibility.selector, budget))
|
|
657
|
+
recordSource = supplied.source;
|
|
658
|
+
}
|
|
659
|
+
if (capsule.projection && !recordSource)
|
|
660
|
+
throw new Stop('missing-authority', 'explicit-companion-source-required');
|
|
661
|
+
const contract = await selectPinnedComponentSource(capsule.resources, capsule.compatibility.selector, capsule.libraries ?? [], localSource, options, budget, allowed);
|
|
662
|
+
let responseProjection;
|
|
663
|
+
if (capsule.projection) {
|
|
664
|
+
const source = capsule.projection.source;
|
|
665
|
+
const companion = await selectPinnedComponentSource(source.resources, source.selector, source.libraries, recordSource, { ...options, loading: { ...options.loading, sourceUri: undefined } }, budget, allowed);
|
|
666
|
+
const projection = createComponentRecordProjection(contract, companion, capsule.projection.spec, { signal: options.signal });
|
|
667
|
+
if (projection.kind !== 'component-record-projection')
|
|
668
|
+
throw new Stop(projection.kind === 'resource-limit' || projection.kind === 'cancelled'
|
|
669
|
+
? projection.kind : 'incompatible-artifact', projection.rule);
|
|
670
|
+
responseProjection = projection;
|
|
671
|
+
}
|
|
672
|
+
return await reconstructComponentAgainst(capsule, contract, { service: capsule.compatibility.service, port: capsule.compatibility.port }, options.signal, responseProjection);
|
|
673
|
+
}
|
|
674
|
+
catch (error) {
|
|
675
|
+
if (!budget.exhausted() && options.signal?.aborted)
|
|
676
|
+
return componentFailure(new Stop('cancelled', 'cooperative-cancellation'), budget);
|
|
677
|
+
return componentFailure(error, budget);
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
async function selectPinnedComponentSource(resources, selector, libraries, localSource, options, budget, allowed) {
|
|
681
|
+
if (typeof localSource !== 'string' || new URL(resolveResourceUri(localSource)).protocol !== 'file:')
|
|
682
|
+
throw new Stop('missing-authority', 'new-local-file-required');
|
|
683
|
+
if (libraries.some(id => !allowed.includes(id)))
|
|
684
|
+
throw new Stop('missing-authority', 'explicit-standard-component-permission');
|
|
685
|
+
const loader = await SchemaResourceLoader.create({ fileRoots: options.loading.policy.fileRoots }, directLoadingLimits(budget, options.loading.limits), undefined, amount => { check(budget, options.signal); budget.chargeWork(amount); }, options.signal);
|
|
686
|
+
const physical = await loader.fetchResource(localSource), expectedRoot = resources.find(resource => resource.key === 'root');
|
|
687
|
+
if (physical.digest !== expectedRoot.digest || Buffer.from(physical.bytes).toString('base64') !== expectedRoot.base64)
|
|
688
|
+
reject('local-source-changed');
|
|
689
|
+
const offline = options.loading.offlineResources ? new Map(options.loading.offlineResources) : undefined;
|
|
690
|
+
offline?.set(physical.uri, physical);
|
|
691
|
+
const loading = { ...options.loading, ...(offline ? { offlineResources: offline } : {}) };
|
|
692
|
+
const selected = await selectComponentOperationInRequest(loading.sourceUri ?? physical.uri, selector, { loading, signal: options.signal,
|
|
693
|
+
standardLibraries: libraries.map(acquireStandardSchemaLibrary) }, budget);
|
|
694
|
+
if (selected.kind !== 'selected')
|
|
695
|
+
throw new Stop(selected.kind === 'loading-refused' ? 'missing-authority'
|
|
696
|
+
: selected.kind === 'selection-refused' ? 'incompatible-artifact' : selected.kind, selected.rule);
|
|
697
|
+
return selected.contract;
|
|
698
|
+
}
|
|
699
|
+
/** Generator seam: expected bytes are checked against an already fresh, source-owned native operation.
|
|
700
|
+
* @remarks This accepts transient native authority only. Runtime consumers still reconstruct from independently
|
|
701
|
+
* authorized physical files. It permits service-wide generation to reuse one native whole-source qualification.
|
|
702
|
+
*/
|
|
703
|
+
export async function reconstructComponentSourceCapsuleForOperation(bytes, contract, selection, signal, responseProjection) {
|
|
704
|
+
const { budget } = inspectDirectOperation(contract).context;
|
|
705
|
+
try {
|
|
706
|
+
return await reconstructComponentAgainst(readComponent(bytes, budget, signal), contract, selection, signal, responseProjection);
|
|
707
|
+
}
|
|
708
|
+
catch (error) {
|
|
709
|
+
if (!budget.exhausted() && signal?.aborted)
|
|
710
|
+
return componentFailure(new Stop('cancelled', 'cooperative-cancellation'), budget);
|
|
711
|
+
return componentFailure(error, budget);
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
async function reconstructComponentAgainst(capsule, contract, selection, signal, responseProjection) {
|
|
715
|
+
const { budget } = inspectDirectOperation(contract).context;
|
|
716
|
+
let derived;
|
|
717
|
+
try {
|
|
718
|
+
derived = await componentDescriptor(contract, selection, signal, responseProjection, undefined, capsule.applicationGroups);
|
|
719
|
+
}
|
|
720
|
+
catch (error) {
|
|
721
|
+
if (error instanceof TypeError && error.message.startsWith('applicationGroups'))
|
|
722
|
+
return reject('source-application-groups-changed');
|
|
723
|
+
throw error;
|
|
724
|
+
}
|
|
725
|
+
if (json(derived.applicationGroups ?? null, budget) !== json(capsule.applicationGroups ?? null, budget))
|
|
726
|
+
reject('source-application-groups-changed');
|
|
727
|
+
if (derived.applicationGroupIdentity !== capsule.applicationGroupIdentity)
|
|
728
|
+
reject('source-application-groups-changed');
|
|
729
|
+
if (json(derived.resources, budget) !== json(capsule.resources, budget))
|
|
730
|
+
reject('local-source-changed');
|
|
731
|
+
if (json(derived.compatibility, budget) !== json(capsule.compatibility, budget))
|
|
732
|
+
reject('source-contract-changed');
|
|
733
|
+
if (json(derived.libraries, budget) !== json(capsule.libraries ?? [], budget) || json(derived.projection, budget) !== json(capsule.projection ?? null, budget))
|
|
734
|
+
reject('source-projection-changed');
|
|
735
|
+
return issueComponentReconstruction(capsule, contract, derived, signal, responseProjection);
|
|
736
|
+
}
|
|
737
|
+
function issueComponentReconstruction(capsule, contract, derived, signal, responseProjection) {
|
|
738
|
+
const { budget } = inspectDirectOperation(contract).context;
|
|
739
|
+
check(budget, signal);
|
|
740
|
+
const result = Object.freeze({ kind: 'reconstructed-component', contract,
|
|
741
|
+
mappings: Object.freeze(derived.mappings), selection: Object.freeze({ service: derived.compatibility.service, port: derived.compatibility.port }),
|
|
742
|
+
...(responseProjection ? { responseProjection } : {}),
|
|
743
|
+
admitted: false, usage: Object.freeze({ ...budget.usage() }) });
|
|
744
|
+
componentReconstructions.set(result, capsule);
|
|
745
|
+
return result;
|
|
746
|
+
}
|
|
747
|
+
/** Authenticate transient reconstruction identity; saved/copy-shaped reports cannot be consumed by generators. */
|
|
748
|
+
export function inspectReconstructedComponentSource(value) {
|
|
749
|
+
if (!componentReconstructions.has(value))
|
|
750
|
+
throw new TypeError('Freshly reconstructed component source required');
|
|
751
|
+
inspectDirectOperation(value.contract);
|
|
752
|
+
return value;
|
|
753
|
+
}
|
|
754
|
+
/** Group fresh operations for one service without merging source contexts or binding identities.
|
|
755
|
+
* @returns A deterministic operation order over the original native handles.
|
|
756
|
+
* @throws TypeError For foreign handles, duplicate operations, accessors or mixed sources/services/bindings.
|
|
757
|
+
*/
|
|
758
|
+
export function inspectComponentSourceService(values) {
|
|
759
|
+
if (!Array.isArray(values) || types.isProxy(values) || !values.length)
|
|
760
|
+
throw new TypeError('Nonempty native component operations required');
|
|
761
|
+
const keys = Reflect.ownKeys(values);
|
|
762
|
+
if (keys.length !== values.length + 1)
|
|
763
|
+
throw new TypeError('Dense native operation array required');
|
|
764
|
+
const operations = [];
|
|
765
|
+
for (let index = 0; index < values.length; index++) {
|
|
766
|
+
const descriptor = Object.getOwnPropertyDescriptor(values, String(index));
|
|
767
|
+
if (!descriptor || !('value' in descriptor))
|
|
768
|
+
throw new TypeError('Data-only native operation array required');
|
|
769
|
+
operations.push(inspectReconstructedComponentSource(descriptor.value));
|
|
770
|
+
}
|
|
771
|
+
const first = operations[0], { source, context: { budget } } = inspectDirectOperation(first.contract), names = new Set();
|
|
772
|
+
for (const operation of operations) {
|
|
773
|
+
check(budget);
|
|
774
|
+
const inspection = inspectDirectOperation(operation.contract);
|
|
775
|
+
if (inspection.source !== source || inspection.context.budget !== budget
|
|
776
|
+
|| json(operation.selection, budget) !== json(first.selection, budget)
|
|
777
|
+
|| json(operation.contract.selector.binding, budget) !== json(first.contract.selector.binding, budget)
|
|
778
|
+
|| names.has(operation.contract.selector.operation))
|
|
779
|
+
throw new TypeError('One source/service/binding and unique operations required');
|
|
780
|
+
names.add(operation.contract.selector.operation);
|
|
781
|
+
}
|
|
782
|
+
return Object.freeze(operations.sort((a, b) => budget.compareText(a.contract.selector.operation, b.contract.selector.operation)));
|
|
783
|
+
}
|