@techspokes/typescript-wsdl-client 1.1.3 → 1.1.5

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.
Files changed (360) hide show
  1. package/README.md +50 -1
  2. package/dist/app/generateApp.d.ts.map +1 -1
  3. package/dist/app/generateApp.js +8 -6
  4. package/dist/cli.js +49 -5
  5. package/dist/client/checkedDirectRuntime.d.ts +59 -0
  6. package/dist/client/checkedDirectRuntime.d.ts.map +1 -0
  7. package/dist/client/checkedDirectRuntime.js +23 -0
  8. package/dist/client/directClientRuntime.d.ts +49 -0
  9. package/dist/client/directClientRuntime.d.ts.map +1 -0
  10. package/dist/client/directClientRuntime.js +112 -0
  11. package/dist/client/directClientVersion.d.ts +4 -0
  12. package/dist/client/directClientVersion.d.ts.map +1 -0
  13. package/dist/client/directClientVersion.js +3 -0
  14. package/dist/client/generateClient.d.ts.map +1 -1
  15. package/dist/client/generateClient.js +22 -9
  16. package/dist/client/generateDirectClient.d.ts +14 -0
  17. package/dist/client/generateDirectClient.d.ts.map +1 -0
  18. package/dist/client/generateDirectClient.js +136 -0
  19. package/dist/compiler/buildCanonicalGraph.d.ts +7 -0
  20. package/dist/compiler/buildCanonicalGraph.d.ts.map +1 -0
  21. package/dist/compiler/buildCanonicalGraph.js +381 -0
  22. package/dist/compiler/canonicalGraph.d.ts +198 -0
  23. package/dist/compiler/canonicalGraph.d.ts.map +1 -0
  24. package/dist/compiler/canonicalGraph.js +37 -0
  25. package/dist/compiler/catalogErrors.d.ts +18 -0
  26. package/dist/compiler/catalogErrors.d.ts.map +1 -0
  27. package/dist/compiler/catalogErrors.js +86 -0
  28. package/dist/compiler/catalogProvenance.d.ts +15 -0
  29. package/dist/compiler/catalogProvenance.d.ts.map +1 -0
  30. package/dist/compiler/catalogProvenance.js +229 -0
  31. package/dist/compiler/checkedAssessment.d.ts +91 -0
  32. package/dist/compiler/checkedAssessment.d.ts.map +1 -0
  33. package/dist/compiler/checkedAssessment.js +300 -0
  34. package/dist/compiler/checkedSourcePreparation.d.ts +35 -0
  35. package/dist/compiler/checkedSourcePreparation.d.ts.map +1 -0
  36. package/dist/compiler/checkedSourcePreparation.js +131 -0
  37. package/dist/compiler/complexTypeContent.d.ts +59 -0
  38. package/dist/compiler/complexTypeContent.d.ts.map +1 -0
  39. package/dist/compiler/complexTypeContent.js +558 -0
  40. package/dist/compiler/composeCanonicalGraph.d.ts +69 -0
  41. package/dist/compiler/composeCanonicalGraph.d.ts.map +1 -0
  42. package/dist/compiler/composeCanonicalGraph.js +252 -0
  43. package/dist/compiler/dataOwnership.d.ts +22 -0
  44. package/dist/compiler/dataOwnership.d.ts.map +1 -0
  45. package/dist/compiler/dataOwnership.js +157 -0
  46. package/dist/compiler/datatypeValues.d.ts +47 -0
  47. package/dist/compiler/datatypeValues.d.ts.map +1 -0
  48. package/dist/compiler/datatypeValues.js +275 -0
  49. package/dist/compiler/directCodec.d.ts +59 -0
  50. package/dist/compiler/directCodec.d.ts.map +1 -0
  51. package/dist/compiler/directCodec.js +192 -0
  52. package/dist/compiler/directExecutionPolicy.d.ts +10 -0
  53. package/dist/compiler/directExecutionPolicy.d.ts.map +1 -0
  54. package/dist/compiler/directExecutionPolicy.js +17 -0
  55. package/dist/compiler/directOperation.d.ts +72 -0
  56. package/dist/compiler/directOperation.d.ts.map +1 -0
  57. package/dist/compiler/directOperation.js +282 -0
  58. package/dist/compiler/directSoap.d.ts +42 -0
  59. package/dist/compiler/directSoap.d.ts.map +1 -0
  60. package/dist/compiler/directSoap.js +298 -0
  61. package/dist/compiler/directSoapSource.d.ts +15 -0
  62. package/dist/compiler/directSoapSource.d.ts.map +1 -0
  63. package/dist/compiler/directSoapSource.js +86 -0
  64. package/dist/compiler/directSourceCapsule.d.ts +97 -0
  65. package/dist/compiler/directSourceCapsule.d.ts.map +1 -0
  66. package/dist/compiler/directSourceCapsule.js +305 -0
  67. package/dist/compiler/directStructure.d.ts +51 -0
  68. package/dist/compiler/directStructure.d.ts.map +1 -0
  69. package/dist/compiler/directStructure.js +252 -0
  70. package/dist/compiler/directStructurePlan.d.ts +16 -0
  71. package/dist/compiler/directStructurePlan.d.ts.map +1 -0
  72. package/dist/compiler/directStructurePlan.js +58 -0
  73. package/dist/compiler/directValues.d.ts +69 -0
  74. package/dist/compiler/directValues.d.ts.map +1 -0
  75. package/dist/compiler/directValues.js +282 -0
  76. package/dist/compiler/finiteRe01Verification.d.ts +140 -0
  77. package/dist/compiler/finiteRe01Verification.d.ts.map +1 -0
  78. package/dist/compiler/finiteRe01Verification.js +830 -0
  79. package/dist/compiler/graphTraversal.d.ts +11 -0
  80. package/dist/compiler/graphTraversal.d.ts.map +1 -0
  81. package/dist/compiler/graphTraversal.js +37 -0
  82. package/dist/compiler/hypotheticalScopedIdentity.d.ts +23 -0
  83. package/dist/compiler/hypotheticalScopedIdentity.d.ts.map +1 -0
  84. package/dist/compiler/hypotheticalScopedIdentity.js +81 -0
  85. package/dist/compiler/occurrenceAnalysis.d.ts +65 -0
  86. package/dist/compiler/occurrenceAnalysis.d.ts.map +1 -0
  87. package/dist/compiler/occurrenceAnalysis.js +300 -0
  88. package/dist/compiler/originalSourceMembership.d.ts +6 -0
  89. package/dist/compiler/originalSourceMembership.d.ts.map +1 -0
  90. package/dist/compiler/originalSourceMembership.js +31 -0
  91. package/dist/compiler/particleAttribution.d.ts +17 -0
  92. package/dist/compiler/particleAttribution.d.ts.map +1 -0
  93. package/dist/compiler/particleAttribution.js +474 -0
  94. package/dist/compiler/particleDeclarationConsistency.d.ts +24 -0
  95. package/dist/compiler/particleDeclarationConsistency.d.ts.map +1 -0
  96. package/dist/compiler/particleDeclarationConsistency.js +197 -0
  97. package/dist/compiler/particleExtension.d.ts +22 -0
  98. package/dist/compiler/particleExtension.d.ts.map +1 -0
  99. package/dist/compiler/particleExtension.js +119 -0
  100. package/dist/compiler/particleLocalAssessment.d.ts +20 -0
  101. package/dist/compiler/particleLocalAssessment.d.ts.map +1 -0
  102. package/dist/compiler/particleLocalAssessment.js +92 -0
  103. package/dist/compiler/particleRestriction.d.ts +24 -0
  104. package/dist/compiler/particleRestriction.d.ts.map +1 -0
  105. package/dist/compiler/particleRestriction.js +489 -0
  106. package/dist/compiler/particleSemanticView.d.ts +50 -0
  107. package/dist/compiler/particleSemanticView.d.ts.map +1 -0
  108. package/dist/compiler/particleSemanticView.js +297 -0
  109. package/dist/compiler/particleWildcardRelation.d.ts +88 -0
  110. package/dist/compiler/particleWildcardRelation.d.ts.map +1 -0
  111. package/dist/compiler/particleWildcardRelation.js +143 -0
  112. package/dist/compiler/re01CandidateCorrespondence.d.ts +64 -0
  113. package/dist/compiler/re01CandidateCorrespondence.d.ts.map +1 -0
  114. package/dist/compiler/re01CandidateCorrespondence.js +572 -0
  115. package/dist/compiler/re01TypeProperties.d.ts +71 -0
  116. package/dist/compiler/re01TypeProperties.d.ts.map +1 -0
  117. package/dist/compiler/re01TypeProperties.js +120 -0
  118. package/dist/compiler/re01TypePropertyValidation.d.ts +23 -0
  119. package/dist/compiler/re01TypePropertyValidation.d.ts.map +1 -0
  120. package/dist/compiler/re01TypePropertyValidation.js +161 -0
  121. package/dist/compiler/resolveCanonicalGraph.d.ts +38 -0
  122. package/dist/compiler/resolveCanonicalGraph.d.ts.map +1 -0
  123. package/dist/compiler/resolveCanonicalGraph.js +170 -0
  124. package/dist/compiler/scalarSchemaAssessment.d.ts +425 -0
  125. package/dist/compiler/scalarSchemaAssessment.d.ts.map +1 -0
  126. package/dist/compiler/scalarSchemaAssessment.js +5198 -0
  127. package/dist/compiler/schemaAttributeGroupProperties.d.ts +17 -0
  128. package/dist/compiler/schemaAttributeGroupProperties.d.ts.map +1 -0
  129. package/dist/compiler/schemaAttributeGroupProperties.js +53 -0
  130. package/dist/compiler/schemaAttributeProperties.d.ts +10 -0
  131. package/dist/compiler/schemaAttributeProperties.d.ts.map +1 -0
  132. package/dist/compiler/schemaAttributeProperties.js +11 -0
  133. package/dist/compiler/schemaAttributeUses.d.ts +90 -0
  134. package/dist/compiler/schemaAttributeUses.d.ts.map +1 -0
  135. package/dist/compiler/schemaAttributeUses.js +725 -0
  136. package/dist/compiler/schemaBinaryWordReconstruction.d.ts +10 -0
  137. package/dist/compiler/schemaBinaryWordReconstruction.d.ts.map +1 -0
  138. package/dist/compiler/schemaBinaryWordReconstruction.js +33 -0
  139. package/dist/compiler/schemaBuiltinFacets.d.ts +14 -0
  140. package/dist/compiler/schemaBuiltinFacets.d.ts.map +1 -0
  141. package/dist/compiler/schemaBuiltinFacets.js +51 -0
  142. package/dist/compiler/schemaCalendarImages.d.ts +8 -0
  143. package/dist/compiler/schemaCalendarImages.d.ts.map +1 -0
  144. package/dist/compiler/schemaCalendarImages.js +204 -0
  145. package/dist/compiler/schemaCalendarLanguage.d.ts +11 -0
  146. package/dist/compiler/schemaCalendarLanguage.d.ts.map +1 -0
  147. package/dist/compiler/schemaCalendarLanguage.js +227 -0
  148. package/dist/compiler/schemaComponentEquality.d.ts +28 -0
  149. package/dist/compiler/schemaComponentEquality.d.ts.map +1 -0
  150. package/dist/compiler/schemaComponentEquality.js +446 -0
  151. package/dist/compiler/schemaConstructionAssessment.d.ts +46 -0
  152. package/dist/compiler/schemaConstructionAssessment.d.ts.map +1 -0
  153. package/dist/compiler/schemaConstructionAssessment.js +663 -0
  154. package/dist/compiler/schemaDatatypeValues.d.ts +4 -0
  155. package/dist/compiler/schemaDatatypeValues.d.ts.map +1 -0
  156. package/dist/compiler/schemaDatatypeValues.js +2 -0
  157. package/dist/compiler/schemaDecimalLanguage.d.ts +7 -0
  158. package/dist/compiler/schemaDecimalLanguage.d.ts.map +1 -0
  159. package/dist/compiler/schemaDecimalLanguage.js +102 -0
  160. package/dist/compiler/schemaDeclarationPrimitives.d.ts +34 -0
  161. package/dist/compiler/schemaDeclarationPrimitives.d.ts.map +1 -0
  162. package/dist/compiler/schemaDeclarationPrimitives.js +194 -0
  163. package/dist/compiler/schemaDocumentSyntax.d.ts +55 -0
  164. package/dist/compiler/schemaDocumentSyntax.d.ts.map +1 -0
  165. package/dist/compiler/schemaDocumentSyntax.js +294 -0
  166. package/dist/compiler/schemaDurationLanguage.d.ts +11 -0
  167. package/dist/compiler/schemaDurationLanguage.d.ts.map +1 -0
  168. package/dist/compiler/schemaDurationLanguage.js +170 -0
  169. package/dist/compiler/schemaElementProperties.d.ts +16 -0
  170. package/dist/compiler/schemaElementProperties.d.ts.map +1 -0
  171. package/dist/compiler/schemaElementProperties.js +23 -0
  172. package/dist/compiler/schemaEndpointWordCapacity.d.ts +36 -0
  173. package/dist/compiler/schemaEndpointWordCapacity.d.ts.map +1 -0
  174. package/dist/compiler/schemaEndpointWordCapacity.js +39 -0
  175. package/dist/compiler/schemaExactCalendar.d.ts +73 -0
  176. package/dist/compiler/schemaExactCalendar.d.ts.map +1 -0
  177. package/dist/compiler/schemaExactCalendar.js +264 -0
  178. package/dist/compiler/schemaFacetAnnotation.d.ts +32 -0
  179. package/dist/compiler/schemaFacetAnnotation.d.ts.map +1 -0
  180. package/dist/compiler/schemaFacetAnnotation.js +199 -0
  181. package/dist/compiler/schemaGeneratedScalarShape.d.ts +35 -0
  182. package/dist/compiler/schemaGeneratedScalarShape.d.ts.map +1 -0
  183. package/dist/compiler/schemaGeneratedScalarShape.js +176 -0
  184. package/dist/compiler/schemaIdentityConstraints.d.ts +73 -0
  185. package/dist/compiler/schemaIdentityConstraints.d.ts.map +1 -0
  186. package/dist/compiler/schemaIdentityConstraints.js +362 -0
  187. package/dist/compiler/schemaIeeeLanguage.d.ts +43 -0
  188. package/dist/compiler/schemaIeeeLanguage.d.ts.map +1 -0
  189. package/dist/compiler/schemaIeeeLanguage.js +759 -0
  190. package/dist/compiler/schemaIntegerImages.d.ts +11 -0
  191. package/dist/compiler/schemaIntegerImages.d.ts.map +1 -0
  192. package/dist/compiler/schemaIntegerImages.js +113 -0
  193. package/dist/compiler/schemaLexicalPredicates.d.ts +29 -0
  194. package/dist/compiler/schemaLexicalPredicates.d.ts.map +1 -0
  195. package/dist/compiler/schemaLexicalPredicates.js +63 -0
  196. package/dist/compiler/schemaNotationProperties.d.ts +32 -0
  197. package/dist/compiler/schemaNotationProperties.d.ts.map +1 -0
  198. package/dist/compiler/schemaNotationProperties.js +84 -0
  199. package/dist/compiler/schemaNumericImageConditions.d.ts +24 -0
  200. package/dist/compiler/schemaNumericImageConditions.d.ts.map +1 -0
  201. package/dist/compiler/schemaNumericImageConditions.js +66 -0
  202. package/dist/compiler/schemaParticleWildcardProperties.d.ts +20 -0
  203. package/dist/compiler/schemaParticleWildcardProperties.d.ts.map +1 -0
  204. package/dist/compiler/schemaParticleWildcardProperties.js +43 -0
  205. package/dist/compiler/schemaPattern.d.ts +1062 -0
  206. package/dist/compiler/schemaPattern.d.ts.map +1 -0
  207. package/dist/compiler/schemaPattern.js +581 -0
  208. package/dist/compiler/schemaRegularLanguage.d.ts +67 -0
  209. package/dist/compiler/schemaRegularLanguage.d.ts.map +1 -0
  210. package/dist/compiler/schemaRegularLanguage.js +1166 -0
  211. package/dist/compiler/schemaScalarContext.d.ts +81 -0
  212. package/dist/compiler/schemaScalarContext.d.ts.map +1 -0
  213. package/dist/compiler/schemaScalarContext.js +78 -0
  214. package/dist/compiler/schemaScalarKernel.d.ts +182 -0
  215. package/dist/compiler/schemaScalarKernel.d.ts.map +1 -0
  216. package/dist/compiler/schemaScalarKernel.js +391 -0
  217. package/dist/compiler/schemaScalarWitnesses.d.ts +6 -0
  218. package/dist/compiler/schemaScalarWitnesses.d.ts.map +1 -0
  219. package/dist/compiler/schemaScalarWitnesses.js +118 -0
  220. package/dist/compiler/schemaSimpleTypeProperties.d.ts +95 -0
  221. package/dist/compiler/schemaSimpleTypeProperties.d.ts.map +1 -0
  222. package/dist/compiler/schemaSimpleTypeProperties.js +103 -0
  223. package/dist/compiler/schemaSourceGrammar.d.ts +27 -0
  224. package/dist/compiler/schemaSourceGrammar.d.ts.map +1 -0
  225. package/dist/compiler/schemaSourceGrammar.js +290 -0
  226. package/dist/compiler/schemaSourceLexical.d.ts +4 -0
  227. package/dist/compiler/schemaSourceLexical.d.ts.map +1 -0
  228. package/dist/compiler/schemaSourceLexical.js +12 -0
  229. package/dist/compiler/schemaSourceValues.d.ts +51 -0
  230. package/dist/compiler/schemaSourceValues.d.ts.map +1 -0
  231. package/dist/compiler/schemaSourceValues.js +225 -0
  232. package/dist/compiler/schemaSourceWildcards.d.ts +28 -0
  233. package/dist/compiler/schemaSourceWildcards.d.ts.map +1 -0
  234. package/dist/compiler/schemaSourceWildcards.js +247 -0
  235. package/dist/compiler/schemaSymbolicSequences.d.ts +16 -0
  236. package/dist/compiler/schemaSymbolicSequences.d.ts.map +1 -0
  237. package/dist/compiler/schemaSymbolicSequences.js +99 -0
  238. package/dist/compiler/schemaSymbolicValueSets.d.ts +32 -0
  239. package/dist/compiler/schemaSymbolicValueSets.d.ts.map +1 -0
  240. package/dist/compiler/schemaSymbolicValueSets.js +149 -0
  241. package/dist/compiler/schemaSyntaxAssessment.d.ts +25 -0
  242. package/dist/compiler/schemaSyntaxAssessment.d.ts.map +1 -0
  243. package/dist/compiler/schemaSyntaxAssessment.js +361 -0
  244. package/dist/compiler/schemaTemporalAliases.d.ts +6 -0
  245. package/dist/compiler/schemaTemporalAliases.d.ts.map +1 -0
  246. package/dist/compiler/schemaTemporalAliases.js +195 -0
  247. package/dist/compiler/schemaTokenImages.d.ts +9 -0
  248. package/dist/compiler/schemaTokenImages.d.ts.map +1 -0
  249. package/dist/compiler/schemaTokenImages.js +142 -0
  250. package/dist/compiler/schemaTypeIdentity.d.ts +39 -0
  251. package/dist/compiler/schemaTypeIdentity.d.ts.map +1 -0
  252. package/dist/compiler/schemaTypeIdentity.js +78 -0
  253. package/dist/compiler/schemaTypeRelations.d.ts +38 -0
  254. package/dist/compiler/schemaTypeRelations.d.ts.map +1 -0
  255. package/dist/compiler/schemaTypeRelations.js +576 -0
  256. package/dist/compiler/schemaUri.d.ts +13 -0
  257. package/dist/compiler/schemaUri.d.ts.map +1 -0
  258. package/dist/compiler/schemaUri.js +103 -0
  259. package/dist/compiler/schemaValueContext.d.ts +26 -0
  260. package/dist/compiler/schemaValueContext.d.ts.map +1 -0
  261. package/dist/compiler/schemaValueContext.js +1 -0
  262. package/dist/compiler/schemaValueImages.d.ts +10 -0
  263. package/dist/compiler/schemaValueImages.d.ts.map +1 -0
  264. package/dist/compiler/schemaValueImages.js +142 -0
  265. package/dist/compiler/schemaValueSequences.d.ts +15 -0
  266. package/dist/compiler/schemaValueSequences.d.ts.map +1 -0
  267. package/dist/compiler/schemaValueSequences.js +19 -0
  268. package/dist/compiler/semanticBudget.d.ts +50 -0
  269. package/dist/compiler/semanticBudget.d.ts.map +1 -0
  270. package/dist/compiler/semanticBudget.js +178 -0
  271. package/dist/compiler/semanticCatalog.d.ts +122 -0
  272. package/dist/compiler/semanticCatalog.d.ts.map +1 -0
  273. package/dist/compiler/semanticCatalog.js +160 -0
  274. package/dist/compiler/semanticContext.d.ts +172 -0
  275. package/dist/compiler/semanticContext.d.ts.map +1 -0
  276. package/dist/compiler/semanticContext.js +1168 -0
  277. package/dist/compiler/semanticTypeDependencies.d.ts +8 -0
  278. package/dist/compiler/semanticTypeDependencies.d.ts.map +1 -0
  279. package/dist/compiler/semanticTypeDependencies.js +64 -0
  280. package/dist/compiler/semanticTypeReference.d.ts +24 -0
  281. package/dist/compiler/semanticTypeReference.d.ts.map +1 -0
  282. package/dist/compiler/semanticTypeReference.js +36 -0
  283. package/dist/compiler/shapeResolver.d.ts +1 -0
  284. package/dist/compiler/shapeResolver.d.ts.map +1 -1
  285. package/dist/compiler/shapeResolver.js +7 -9
  286. package/dist/compiler/sourceSchemaBinding.d.ts +26 -0
  287. package/dist/compiler/sourceSchemaBinding.d.ts.map +1 -0
  288. package/dist/compiler/sourceSchemaBinding.js +39 -0
  289. package/dist/compiler/structuralCompanions.d.ts +16 -0
  290. package/dist/compiler/structuralCompanions.d.ts.map +1 -0
  291. package/dist/compiler/structuralCompanions.js +232 -0
  292. package/dist/compiler/validateSemanticGraph.d.ts +5 -0
  293. package/dist/compiler/validateSemanticGraph.d.ts.map +1 -0
  294. package/dist/compiler/validateSemanticGraph.js +376 -0
  295. package/dist/compiler/wildcardAlgebra.d.ts +26 -0
  296. package/dist/compiler/wildcardAlgebra.d.ts.map +1 -0
  297. package/dist/compiler/wildcardAlgebra.js +155 -0
  298. package/dist/gateway/generateGateway.d.ts.map +1 -1
  299. package/dist/gateway/generateGateway.js +2 -2
  300. package/dist/index.d.ts +3 -0
  301. package/dist/index.d.ts.map +1 -1
  302. package/dist/index.js +2 -0
  303. package/dist/loader/orderedSyntax.d.ts +77 -0
  304. package/dist/loader/orderedSyntax.d.ts.map +1 -0
  305. package/dist/loader/orderedSyntax.js +202 -0
  306. package/dist/loader/resolutionDepth.d.ts +7 -0
  307. package/dist/loader/resolutionDepth.d.ts.map +1 -0
  308. package/dist/loader/resolutionDepth.js +65 -0
  309. package/dist/loader/schemaInput.d.ts +53 -0
  310. package/dist/loader/schemaInput.d.ts.map +1 -0
  311. package/dist/loader/schemaInput.js +212 -0
  312. package/dist/loader/schemaResources.d.ts +59 -0
  313. package/dist/loader/schemaResources.d.ts.map +1 -0
  314. package/dist/loader/schemaResources.js +292 -0
  315. package/dist/openapi/generateOpenAPI.d.ts.map +1 -1
  316. package/dist/openapi/generateOpenAPI.js +2 -2
  317. package/dist/test/generateTests.d.ts.map +1 -1
  318. package/dist/test/generateTests.js +2 -2
  319. package/dist/util/xmlWhitespace.d.ts +3 -0
  320. package/dist/util/xmlWhitespace.d.ts.map +1 -0
  321. package/dist/util/xmlWhitespace.js +4 -0
  322. package/docs/README.md +14 -1
  323. package/docs/architecture.md +9 -0
  324. package/docs/cli-reference.md +21 -1
  325. package/docs/content-model-analysis.md +92 -0
  326. package/docs/content-model-baseline.md +121 -0
  327. package/docs/content-model-catalog.md +116 -0
  328. package/docs/content-model-companions.md +90 -0
  329. package/docs/content-model-composition.md +103 -0
  330. package/docs/content-model-decisions.md +79 -0
  331. package/docs/content-model-gateway-feasibility.md +169 -0
  332. package/docs/content-model-graph.md +121 -0
  333. package/docs/content-model-loading.md +163 -0
  334. package/docs/content-model-matching.md +85 -0
  335. package/docs/content-model-readiness.md +144 -0
  336. package/docs/content-model-resolution.md +81 -0
  337. package/docs/content-model-s02-handoff.md +98 -0
  338. package/docs/content-model-s06-au-01.md +425 -0
  339. package/docs/content-model-s06-dt-01.md +386 -0
  340. package/docs/content-model-s06-pw-01.md +350 -0
  341. package/docs/content-model-s06-re-01-resolver-implementation.md +869 -0
  342. package/docs/content-model-s06-re-01-resolver.md +513 -0
  343. package/docs/content-model-s06-re-01-scalar-witnesses.md +1423 -0
  344. package/docs/content-model-s06-re-01-support-reconstruction.md +6337 -0
  345. package/docs/content-model-s06-re-01.md +7477 -0
  346. package/docs/content-model-s06-research-handoff.md +909 -0
  347. package/docs/content-model-shipped-fix.md +83 -0
  348. package/docs/content-model-soap-feasibility.md +165 -0
  349. package/docs/decisions/002-streamable-responses.md +2 -0
  350. package/docs/decisions/003-content-model-contracts.md +280 -0
  351. package/docs/direct-values.md +311 -0
  352. package/docs/generated-code.md +4 -0
  353. package/docs/reference-validation.md +243 -0
  354. package/docs/releases/v1.1.4.md +36 -0
  355. package/docs/releases/v1.1.5.md +38 -0
  356. package/docs/roadmap/README.md +2 -2
  357. package/docs/supported-patterns.md +13 -5
  358. package/package.json +27 -13
  359. package/src/generation/preambles/direct-client/typescript.preamble +3 -0
  360. package/src/runtime/clientStreamMethods.tpl.txt +1 -1
@@ -0,0 +1,120 @@
1
+ import { assertSemanticTypeReferenceShape } from './semanticTypeReference.js';
2
+ export const RE01_DERIVATION_DOMAIN = 'RE01-derivation-B-v1';
3
+ /** Runtime data-shape boundary, shared by preparation and property consumers. */
4
+ export function assertRawComplexTypeShape(value, budget) {
5
+ const fail = () => { throw new TypeError('Invalid raw complex type properties'); };
6
+ const object = (v, fields) => {
7
+ budget.chargeWork(3);
8
+ if (!v || typeof v !== 'object' || Array.isArray(v))
9
+ return fail();
10
+ const prototype = Object.getPrototypeOf(v);
11
+ if (prototype !== Object.prototype && prototype !== null)
12
+ return fail();
13
+ for (const key of fields) {
14
+ budget.chargeWork(46 + key.length);
15
+ const field = Object.getOwnPropertyDescriptor(v, key);
16
+ if (field && !('value' in field))
17
+ return fail();
18
+ }
19
+ for (const key in v) {
20
+ budget.chargeWork(46 + key.length + fields.length);
21
+ const field = Object.getOwnPropertyDescriptor(v, key);
22
+ if (!field || !('value' in field) || !fields.includes(key))
23
+ return fail();
24
+ }
25
+ return v;
26
+ };
27
+ const id = (v) => { budget.chargeWork(); if (typeof v !== 'string' || !v)
28
+ fail(); };
29
+ const list = (v, item) => {
30
+ budget.chargeWork();
31
+ if (!Array.isArray(v))
32
+ return fail();
33
+ for (let index = 0; index < v.length; index++) {
34
+ budget.chargeWork(60);
35
+ const field = Object.getOwnPropertyDescriptor(v, index);
36
+ if (!field || !('value' in field))
37
+ return fail();
38
+ item(field.value);
39
+ }
40
+ };
41
+ const method = (v) => { budget.chargeWork(); if (v !== 'restriction' && v !== 'extension')
42
+ fail(); };
43
+ const reference = (v) => {
44
+ assertSemanticTypeReferenceShape(v, budget);
45
+ const kind = object(v, ['kind', 'owner', 'target', 'name', 'role', 'lexical']);
46
+ if (kind['kind'] === 'original-generated') {
47
+ id(kind['owner']);
48
+ return;
49
+ }
50
+ const r = object(v, ['kind', 'target', 'name', 'role', 'lexical']);
51
+ if (r['kind'] === 'local') {
52
+ id(r['target']);
53
+ return;
54
+ }
55
+ if (r['kind'] !== 'symbol' && r['kind'] !== 'builtin')
56
+ return fail();
57
+ const name = object(r['name'], ['namespace', 'local']);
58
+ if (typeof name['namespace'] !== 'string')
59
+ return fail();
60
+ id(name['local']);
61
+ if (r['kind'] === 'symbol' && r['role'] !== 'type')
62
+ return fail();
63
+ if (r['target'] !== undefined)
64
+ id(r['target']);
65
+ };
66
+ const r = object(value, ['type', 'targetNamespace', 'derivation', 'abstract', 'final', 'block', 'content', 'attributeUses', 'wildcard', 'provenance']);
67
+ id(r['type']);
68
+ if (r['targetNamespace'] !== undefined && typeof r['targetNamespace'] !== 'string')
69
+ return fail();
70
+ const d = object(r['derivation'], ['base', 'method']);
71
+ method(d['method']);
72
+ reference(d['base']);
73
+ if (typeof r['abstract'] !== 'boolean')
74
+ return fail();
75
+ list(r['final'], method);
76
+ list(r['block'], method);
77
+ list(r['attributeUses'], id);
78
+ const content = object(r['content'], ['kind', 'type', 'particle', 'original']);
79
+ if (content['kind'] === 'simple' || content['kind'] === 'opaque-builtin') {
80
+ if ('particle' in content || 'original' in content)
81
+ return fail();
82
+ reference(content['type']);
83
+ }
84
+ else if (content['kind'] === 'mixed' || content['kind'] === 'element-only') {
85
+ if ('type' in content)
86
+ return fail();
87
+ id(content['particle']);
88
+ if (content['original'] !== undefined) {
89
+ const original = object(content['original'], ['owner', 'particle']);
90
+ id(original['owner']);
91
+ id(original['particle']);
92
+ }
93
+ }
94
+ else if (content['kind'] !== 'empty' || 'type' in content || 'particle' in content || 'original' in content)
95
+ return fail();
96
+ if (r['wildcard'] !== undefined) {
97
+ const w = object(r['wildcard'], ['namespace', 'processContents', 'sources']);
98
+ if (w['processContents'] !== 'strict' && w['processContents'] !== 'lax' && w['processContents'] !== 'skip')
99
+ return fail();
100
+ const n = object(w['namespace'], ['kind', 'namespaces']);
101
+ if (n['kind'] !== 'set' && n['kind'] !== 'not')
102
+ return fail();
103
+ list(n['namespaces'], ns => { budget.chargeWork(); if (typeof ns !== 'string')
104
+ fail(); });
105
+ list(w['sources'], id);
106
+ }
107
+ const provenance = object(r['provenance'], ['kind', 'original', 'originals']);
108
+ if (provenance['kind'] === 'actual-mapped') {
109
+ if ('originals' in provenance)
110
+ return fail();
111
+ id(provenance['original']);
112
+ }
113
+ else if (provenance['kind'] === 'hypothetical-abstract') {
114
+ if ('original' in provenance)
115
+ return fail();
116
+ list(provenance['originals'], id);
117
+ }
118
+ else
119
+ fail();
120
+ }
@@ -0,0 +1,23 @@
1
+ /** Structural checks of explicit abstract properties, separate from source mapping. */
2
+ import type { NodeId } from './canonicalGraph.js';
3
+ import type { SemanticContext } from './semanticContext.js';
4
+ import type { ResourceLimitFailure } from './semanticBudget.js';
5
+ import { RE01_DERIVATION_DOMAIN } from './re01TypeProperties.js';
6
+ import type { RawComplexTypeProperties } from './re01TypeProperties.js';
7
+ import type { CorrespondenceReceipt } from './re01CandidateCorrespondence.js';
8
+ export type RawTypeValidation = Readonly<{
9
+ kind: 'checked-structure';
10
+ contract: typeof RE01_DERIVATION_DOMAIN;
11
+ component: NodeId;
12
+ context: string;
13
+ properties: RawComplexTypeProperties;
14
+ mappingAuthority: 'none';
15
+ remaining: readonly ['effective-property-mapping', 'complete-type-validity', 'endpoint-correspondence', 'all-original-property-correspondence'];
16
+ }> | Readonly<{
17
+ kind: 'invalid-input' | 'unresolved';
18
+ rule: string;
19
+ component: NodeId;
20
+ }> | ResourceLimitFailure;
21
+ /** The context has already copied data and rejected accessors. No caller labels authenticate actual mapping. */
22
+ export declare function validateRawComplexTypeProperties(context: SemanticContext, typeId: NodeId, correspondence?: CorrespondenceReceipt): RawTypeValidation;
23
+ //# sourceMappingURL=re01TypePropertyValidation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"re01TypePropertyValidation.d.ts","sourceRoot":"","sources":["../../src/compiler/re01TypePropertyValidation.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,OAAO,KAAK,EAAY,MAAM,EAAY,MAAM,qBAAqB,CAAC;AAKtE,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAC,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,yBAAyB,CAAC;AAEtE,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,kCAAkC,CAAC;AAG5E,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC,IAAI,EAAE,mBAAmB,CAAC;IAAC,QAAQ,EAAE,OAAO,sBAAsB,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IACtF,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,wBAAwB,CAAC;IACtD,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,SAAS,CAAC,4BAA4B,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,sCAAsC,CAAC,CAAC;CACjJ,CAAC,GAAG,QAAQ,CAAC;IAAC,IAAI,EAAE,eAAe,GAAG,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAC,CAAC,GAAG,oBAAoB,CAAC;AAK9G,gHAAgH;AAChH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EACvF,cAAc,CAAC,EAAE,qBAAqB,GAAG,iBAAiB,CA+G3D"}
@@ -0,0 +1,161 @@
1
+ import { resolveSemanticType, semanticTypeKey } from './schemaTypeIdentity.js';
2
+ import { XSD_NAMESPACE } from '../loader/orderedSyntax.js';
3
+ import { assertSemanticContext, SemanticContextAccessError } from './semanticContext.js';
4
+ import { RE01_DERIVATION_DOMAIN } from './re01TypeProperties.js';
5
+ import { assertCandidateCorrespondence } from './re01CandidateCorrespondence.js';
6
+ import { deriveRawComplexContent, particleContentNode } from './complexTypeContent.js';
7
+ class InvalidRawType extends Error {
8
+ rule;
9
+ unresolved;
10
+ constructor(rule, unresolved = false) {
11
+ super(rule);
12
+ this.rule = rule;
13
+ this.unresolved = unresolved;
14
+ }
15
+ }
16
+ /** The context has already copied data and rejected accessors. No caller labels authenticate actual mapping. */
17
+ export function validateRawComplexTypeProperties(context, typeId, correspondence) {
18
+ assertSemanticContext(context);
19
+ if (correspondence)
20
+ assertCandidateCorrespondence(context, correspondence);
21
+ const b = context.budget;
22
+ return b.guard(() => {
23
+ try {
24
+ b.chargeWork(3 + typeId.length);
25
+ const fail = (rule, unresolved = false) => { throw new InvalidRawType(rule, unresolved); };
26
+ const node = (id, kind) => {
27
+ b.chargeWork(3);
28
+ const result = context.lookup(id);
29
+ if (result.kind !== 'found')
30
+ return fail(`raw-type-${result.kind}`, true);
31
+ if (kind !== undefined && result.node.kind !== kind)
32
+ return fail('raw-type-reference-role');
33
+ return result.node;
34
+ };
35
+ const reference = (value, simple = false) => {
36
+ b.chargeWork(3);
37
+ const result = resolveSemanticType(context, value);
38
+ if (result.kind === 'builtin') {
39
+ if (simple && result.name.local === 'anyType')
40
+ return fail('raw-type-content-role');
41
+ return semanticTypeKey(context, result.identity);
42
+ }
43
+ if (result.kind === 'original-generated')
44
+ return semanticTypeKey(context, result.identity);
45
+ if (result.kind === 'wrong-role')
46
+ return fail('raw-type-reference-role');
47
+ if (result.kind !== 'component')
48
+ return fail(`raw-type-${result.kind}`, true);
49
+ if (simple && result.node.kind !== 'simpleType')
50
+ return fail('raw-type-content-role');
51
+ return semanticTypeKey(context, result.identity);
52
+ };
53
+ const methods = (value) => {
54
+ b.chargeWork(2);
55
+ const seen = new Set();
56
+ for (const method of value) {
57
+ b.chargeWork(5);
58
+ if (seen.has(method))
59
+ return fail('raw-type-methods');
60
+ seen.add(method);
61
+ }
62
+ };
63
+ const owner = node(typeId, 'complexType');
64
+ if (owner.kind !== 'complexType')
65
+ return fail('raw-type-owner');
66
+ const supplied = context.rawTypeProperties(typeId);
67
+ if (!supplied)
68
+ return fail('missing-raw-complex-type-properties', true);
69
+ // assertRawComplexTypeShape is the single shape gate in the authenticated
70
+ // context factory. These checks add selected-context consistency only.
71
+ const raw = supplied;
72
+ if (raw.type !== typeId || raw.abstract !== owner.abstract)
73
+ return fail('raw-type-owner-properties');
74
+ if (raw.targetNamespace !== undefined && owner.identity.kind === 'global' &&
75
+ b.compareText(raw.targetNamespace, owner.identity.name.namespace) !== 0)
76
+ return fail('raw-type-target-namespace');
77
+ if (raw.targetNamespace === undefined && owner.identity.kind === 'scoped' && !context.sourceNode(owner.id))
78
+ return fail('missing-raw-type-target-namespace', true);
79
+ methods(raw.final);
80
+ methods(raw.block);
81
+ const derivation = raw.derivation;
82
+ if (derivation.method !== (owner.derivation?.kind ?? 'restriction'))
83
+ return fail('raw-type-derivation');
84
+ const base = reference(derivation.base);
85
+ const ur = { kind: 'builtin', name: { namespace: XSD_NAMESPACE, local: 'anyType' } };
86
+ // Canonical Reference cannot encode the private scalar slot. That explicit
87
+ // semantic base replaces only the unrepresentable source placeholder;
88
+ // ordinary bases retain the existing representation-coherence check.
89
+ if (derivation.base.kind !== 'original-generated') {
90
+ const canonicalBase = owner.derivation ? reference(owner.derivation.base) : reference(ur);
91
+ if (b.compareText(base, canonicalBase) !== 0)
92
+ return fail('raw-type-derivation');
93
+ }
94
+ const content = raw.content;
95
+ switch (content.kind) {
96
+ case 'empty': break;
97
+ case 'simple':
98
+ reference(content.type, true);
99
+ break;
100
+ case 'mixed':
101
+ case 'element-only':
102
+ if (content.original) {
103
+ const mapped = deriveRawComplexContent(context, typeId);
104
+ if (mapped.kind === 'resource-limit')
105
+ return mapped;
106
+ if (mapped.kind !== 'checked' || particleContentNode(context, mapped.view, content.particle)?.kind !== 'particle')
107
+ return fail('raw-type-original-particle', true);
108
+ }
109
+ else
110
+ node(content.particle, 'particle');
111
+ break;
112
+ case 'opaque-builtin':
113
+ if (b.compareText(reference(content.type), reference(ur)) !== 0)
114
+ return fail('raw-type-content');
115
+ break;
116
+ }
117
+ b.chargeWork();
118
+ const uses = new Set();
119
+ for (const id of raw.attributeUses) {
120
+ const use = node(id, 'attributeUse');
121
+ b.chargeWork(4 + use.id.length);
122
+ if (use.kind !== 'attributeUse' || use.use === 'prohibited' || uses.has(use.id))
123
+ return fail('raw-type-attribute-uses');
124
+ uses.add(use.id);
125
+ }
126
+ for (const id of raw.wildcard?.sources ?? []) {
127
+ b.chargeWork();
128
+ node(id, 'attributeWildcard');
129
+ }
130
+ const provenance = raw.provenance;
131
+ if (provenance.kind === 'actual-mapped') {
132
+ b.chargeWork(1 + (correspondence?.originalProperties.length ?? 0));
133
+ if (!correspondence?.originalProperties.includes(typeId) || provenance.original !== typeId)
134
+ return fail('unauthenticated-actual-type-mapping', true);
135
+ }
136
+ for (const original of provenance.kind === 'hypothetical-abstract' ? provenance.originals : []) {
137
+ b.chargeWork(2);
138
+ if (!context.sourceNode(original))
139
+ return fail('raw-type-provenance');
140
+ }
141
+ b.chargeWork(160 + context.contextId.length + typeId.length);
142
+ // The returned raw value was frozen by the context. It remains supplied
143
+ // data: neither this label nor these references prove effective mapping.
144
+ return Object.freeze({ kind: 'checked-structure', contract: RE01_DERIVATION_DOMAIN,
145
+ component: typeId, context: context.contextId, properties: supplied, mappingAuthority: 'none',
146
+ remaining: Object.freeze(['effective-property-mapping', 'complete-type-validity', 'endpoint-correspondence',
147
+ 'all-original-property-correspondence']) });
148
+ }
149
+ catch (error) {
150
+ if (error instanceof InvalidRawType) {
151
+ b.chargeWork(5);
152
+ return Object.freeze({ kind: error.unresolved ? 'unresolved' : 'invalid-input', rule: error.rule, component: typeId });
153
+ }
154
+ if (error instanceof SemanticContextAccessError) {
155
+ b.chargeWork(5);
156
+ return Object.freeze({ kind: error.code === 'reference' ? 'invalid-input' : 'unresolved', rule: `raw-type-${error.code}`, component: typeId });
157
+ }
158
+ throw error;
159
+ }
160
+ });
161
+ }
@@ -0,0 +1,38 @@
1
+ import type { CanonicalGraph, GraphNode, NodeId, Reference } from "./canonicalGraph.js";
2
+ import type { SyntaxSource } from "../loader/orderedSyntax.js";
3
+ export declare class SemanticError extends Error {
4
+ readonly category: "invalid-schema" | "unsupported-capability" | "incompatible-artifact" | "resource-limit";
5
+ readonly component?: NodeId | undefined;
6
+ readonly source?: SyntaxSource | undefined;
7
+ readonly related: readonly SyntaxSource[];
8
+ constructor(category: "invalid-schema" | "unsupported-capability" | "incompatible-artifact" | "resource-limit", message: string, component?: NodeId | undefined, source?: SyntaxSource | undefined, related?: readonly SyntaxSource[]);
9
+ }
10
+ export type SemanticLimits = {
11
+ maxNodes?: number;
12
+ maxSteps?: number;
13
+ requestBudget?: import("./semanticBudget.js").SemanticBudget;
14
+ };
15
+ export declare function semanticBudget(limits?: SemanticLimits): {
16
+ maxNodes: number;
17
+ readonly steps: number;
18
+ step(node?: GraphNode): void;
19
+ };
20
+ /** Count structural data before retaining another input or serializing a copy. */
21
+ export declare function countSemanticData(value: unknown, budget: ReturnType<typeof semanticBudget>, node?: GraphNode): void;
22
+ export type ResolvedLink = Readonly<{
23
+ owner: NodeId;
24
+ path: string;
25
+ reference: Reference;
26
+ target?: NodeId;
27
+ }>;
28
+ export type ResolvedGraph = Readonly<{
29
+ graph: CanonicalGraph;
30
+ links: readonly ResolvedLink[];
31
+ metrics: Readonly<{
32
+ steps: number;
33
+ }>;
34
+ }>;
35
+ /** Resolve against a node index, never against generated names or an asserted stored target. */
36
+ export declare function referenceTarget(reference: Reference, nodes: ReadonlyMap<NodeId, GraphNode>, owner: GraphNode): NodeId | undefined;
37
+ export declare function resolveCanonicalGraph(graph: CanonicalGraph, limits?: SemanticLimits): ResolvedGraph;
38
+ //# sourceMappingURL=resolveCanonicalGraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveCanonicalGraph.d.ts","sourceRoot":"","sources":["../../src/compiler/resolveCanonicalGraph.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,cAAc,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAItF,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAE7D,qBAAa,aAAc,SAAQ,KAAK;IAC1B,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,wBAAwB,GAAG,uBAAuB,GAAG,gBAAgB;IACrH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY;IAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE;gBADnF,QAAQ,EAAE,gBAAgB,GAAG,wBAAwB,GAAG,uBAAuB,GAAG,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAC7H,SAAS,CAAC,EAAE,MAAM,YAAA,EAAW,MAAM,CAAC,EAAE,YAAY,YAAA,EAAW,OAAO,GAAE,SAAS,YAAY,EAAO;CAG9G;AACD,MAAM,MAAM,cAAc,GAAG;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,qBAAqB,EAAE,cAAc,CAAA;CAAC,CAAC;AAClI,wBAAgB,cAAc,CAAC,MAAM,GAAE,cAAmB;;;gBAIG,SAAS;EAIrE;AAED,kFAAkF;AAClF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAYnH;AACD,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,SAAS,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAAC;AAC1G,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;IAAC,KAAK,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC,CAAA;CAAC,CAAC,CAAC;AAElI,gGAAgG;AAChG,wBAAgB,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAYjI;AASD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,EAAE,MAAM,GAAE,cAAmB,GAAG,aAAa,CAwEvG"}
@@ -0,0 +1,170 @@
1
+ /** Pure S05 reference assessment. Definitions and use-site occurrences remain canonical. */
2
+ import { deepFreeze, DEFAULT_GRAPH_NODES, globalId, isBuiltinType } from "./canonicalGraph.js";
3
+ import { positiveLimit } from "./catalogErrors.js";
4
+ import { referenceSlots, containedNodes } from "./graphTraversal.js";
5
+ import { syntaxAttribute, XSD_NAMESPACE } from "../loader/orderedSyntax.js";
6
+ export class SemanticError extends Error {
7
+ category;
8
+ component;
9
+ source;
10
+ related;
11
+ constructor(category, message, component, source, related = []) {
12
+ super(message);
13
+ this.category = category;
14
+ this.component = component;
15
+ this.source = source;
16
+ this.related = related;
17
+ this.name = "SemanticError";
18
+ }
19
+ }
20
+ export function semanticBudget(limits = {}) {
21
+ const maxNodes = positiveLimit(limits.maxNodes, DEFAULT_GRAPH_NODES, "maxNodes");
22
+ const maxSteps = positiveLimit(limits.maxSteps, 1_000_000, "maxSteps");
23
+ let steps = 0;
24
+ return { maxNodes, get steps() { return steps; }, step(node) {
25
+ limits.requestBudget?.chargeWork(64);
26
+ if (++steps > maxSteps)
27
+ throw new SemanticError("resource-limit", `Semantic traversal exceeds ${maxSteps} steps`, node?.id, node?.context.source);
28
+ } };
29
+ }
30
+ /** Count structural data before retaining another input or serializing a copy. */
31
+ export function countSemanticData(value, budget, node) {
32
+ const stack = [value];
33
+ while (stack.length) {
34
+ const item = stack.pop();
35
+ budget.step(node);
36
+ if (typeof item === "string")
37
+ for (let i = 0; i < item.length; i++)
38
+ budget.step(node);
39
+ else if (item && typeof item === "object")
40
+ for (const key in item) {
41
+ if (!Object.hasOwn(item, key))
42
+ continue;
43
+ budget.step(node);
44
+ for (let i = 0; i < key.length; i++)
45
+ budget.step(node);
46
+ stack.push(item[key]);
47
+ }
48
+ }
49
+ }
50
+ /** Resolve against a node index, never against generated names or an asserted stored target. */
51
+ export function referenceTarget(reference, nodes, owner) {
52
+ if (reference.kind === "builtin") {
53
+ if (reference.name.namespace !== XSD_NAMESPACE || !isBuiltinType(reference.name.local))
54
+ throw new SemanticError("invalid-schema", "Unknown builtin type", owner.id, owner.context.source);
55
+ return undefined;
56
+ }
57
+ const id = reference.kind === "symbol" ? globalId(reference.role, reference.name) : reference.target;
58
+ const target = nodes.get(id);
59
+ if (!target)
60
+ throw new SemanticError("invalid-schema", `Missing reference target ${id}`, owner.id, reference.kind === "symbol" ? reference.lexical.context.source : owner.context.source);
61
+ if (reference.kind === "symbol" && (target.identity.kind !== "global" || target.identity.role !== reference.role || (reference.target !== undefined && reference.target !== id))) {
62
+ throw new SemanticError("invalid-schema", `Reference role/identity mismatch ${id}`, owner.id, reference.lexical.context.source);
63
+ }
64
+ return id;
65
+ }
66
+ function interpretation(key) {
67
+ if (!key.startsWith("["))
68
+ return { namespace: "", document: key };
69
+ const tuple = JSON.parse(key);
70
+ return { namespace: tuple[3], document: tuple[1] };
71
+ }
72
+ export function resolveCanonicalGraph(graph, limits = {}) {
73
+ const budget = semanticBudget(limits);
74
+ if (graph.nodes.length > budget.maxNodes)
75
+ throw new SemanticError("resource-limit", `Resolution exceeds ${budget.maxNodes} graph nodes`);
76
+ // Separate precharged graph traversal covers initial index and retained-import table preparation.
77
+ limits.requestBudget?.freeze(graph);
78
+ const nodes = new Map(graph.nodes.map(n => [n.id, n]));
79
+ if (nodes.size !== graph.nodes.length)
80
+ throw new SemanticError("invalid-schema", "Duplicate graph identities");
81
+ // Imports authorize foreign namespaces in the declaring interpretation only.
82
+ // Including/importing documents do not lend their import permissions to a reference.
83
+ const imports = new Map(), unknownImports = new Set();
84
+ const sourceKey = (source) => JSON.stringify([source.uri, source.digest, source.path]);
85
+ const importSyntax = new Map(graph.schemaRetained.filter(r => r.syntax.name.namespace === XSD_NAMESPACE && r.syntax.name.local === "import")
86
+ .map(r => [sourceKey(r.syntax.source), r.syntax]));
87
+ for (const edge of graph.loading.edges) {
88
+ budget.step();
89
+ if (edge.kind !== "import")
90
+ continue;
91
+ const syntax = importSyntax.get(sourceKey(edge.source));
92
+ const ns = syntax ? syntaxAttribute(syntax, "namespace") ?? "" : edge.to ? interpretation(edge.to).namespace : undefined;
93
+ if (ns === undefined) {
94
+ unknownImports.add(edge.from);
95
+ continue;
96
+ }
97
+ if (ns === interpretation(edge.from).namespace)
98
+ throw new SemanticError("invalid-schema", "Import must authorize a different namespace", undefined, edge.source);
99
+ const values = imports.get(edge.from) ?? new Set();
100
+ values.add(ns);
101
+ imports.set(edge.from, values);
102
+ }
103
+ const links = [];
104
+ for (const node of graph.nodes) {
105
+ budget.step(node);
106
+ for (const slot of referenceSlots(node)) {
107
+ budget.step(node);
108
+ const ref = slot.reference, target = referenceTarget(ref, nodes, node);
109
+ if (ref.kind === "symbol" && node.kind !== "wsdl") {
110
+ for (const origin of graph.origins[node.id] ?? []) {
111
+ budget.step(node);
112
+ if (ref.name.namespace === origin.context.effectiveNamespace)
113
+ continue;
114
+ if (!imports.get(origin.interpretation)?.has(ref.name.namespace)) {
115
+ if (unknownImports.has(origin.interpretation))
116
+ throw new SemanticError("incompatible-artifact", "Catalog lacks namespace evidence for an unlocated import; regenerate from original source", node.id, ref.lexical.context.source);
117
+ throw new SemanticError("invalid-schema", `Reference namespace ${ref.name.namespace} is not imported`, node.id, ref.lexical.context.source);
118
+ }
119
+ }
120
+ }
121
+ links.push({ owner: node.id, path: slot.path, reference: ref, ...(target ? { target } : {}) });
122
+ }
123
+ }
124
+ // Only expansion/base edges enter this DAG. Element -> type and particle -> element
125
+ // are deliberately excluded: crossing an element admits complete recursive values.
126
+ const forbidden = (n) => {
127
+ limits.requestBudget?.freeze(n);
128
+ const result = [...containedNodes(n)];
129
+ for (const slot of referenceSlots(n)) {
130
+ const expansion = n.kind === "simpleType" || n.kind === "complexType" || n.kind === "attributeGroupUse" ||
131
+ (n.kind === "particle" && n.term.kind === "group") || (n.kind === "element" && slot.path === "substitutionGroup");
132
+ if (expansion) {
133
+ const target = referenceTarget(slot.reference, nodes, n);
134
+ if (target)
135
+ result.push(target);
136
+ }
137
+ }
138
+ return result;
139
+ };
140
+ const done = new Set(), active = new Set();
141
+ for (const root of graph.nodes) {
142
+ if (done.has(root.id))
143
+ continue;
144
+ const stack = [{ node: root, edges: forbidden(root), index: 0 }];
145
+ active.add(root.id);
146
+ while (stack.length) {
147
+ budget.step(stack[stack.length - 1].node);
148
+ const frame = stack[stack.length - 1];
149
+ if (frame.index === frame.edges.length) {
150
+ active.delete(frame.node.id);
151
+ done.add(frame.node.id);
152
+ stack.pop();
153
+ continue;
154
+ }
155
+ const id = frame.edges[frame.index++], child = nodes.get(id);
156
+ if (!child)
157
+ throw new SemanticError("invalid-schema", `Missing structural target ${id}`, frame.node.id, frame.node.context.source);
158
+ if (active.has(id)) {
159
+ const cycle = stack.slice(stack.findIndex(f => f.node.id === id));
160
+ throw new SemanticError("invalid-schema", `Forbidden component cycle: ${cycle.map(f => f.node.id).join(" -> ")} -> ${id}`, frame.node.id, frame.node.context.source, cycle.map(f => f.node.context.source));
161
+ }
162
+ if (!done.has(id)) {
163
+ active.add(id);
164
+ stack.push({ node: child, edges: forbidden(child), index: 0 });
165
+ }
166
+ }
167
+ }
168
+ const result = { graph, links, metrics: { steps: budget.steps } };
169
+ return limits.requestBudget ? limits.requestBudget.freeze(result) : deepFreeze(result);
170
+ }