@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,77 @@
1
+ export declare const XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
2
+ export declare const XSD_NAMESPACE = "http://www.w3.org/2001/XMLSchema";
3
+ export declare const WSDL_NAMESPACE = "http://schemas.xmlsoap.org/wsdl/";
4
+ export declare const DEFAULT_SYNTAX_DEPTH = 256;
5
+ export type ExpandedName = Readonly<{
6
+ namespace: string;
7
+ local: string;
8
+ }>;
9
+ export type SourcePosition = Readonly<{
10
+ offset: number;
11
+ line: number;
12
+ column: number;
13
+ }>;
14
+ export type SyntaxSource = Readonly<{
15
+ uri: string;
16
+ digest: string;
17
+ path: string;
18
+ start: SourcePosition;
19
+ end: SourcePosition;
20
+ }>;
21
+ export type SyntaxAttribute = Readonly<{
22
+ name: ExpandedName;
23
+ lexicalName: string;
24
+ value: string;
25
+ }>;
26
+ export type SyntaxText = Readonly<{
27
+ kind: "text";
28
+ value: string;
29
+ source: SyntaxSource;
30
+ }>;
31
+ export type SyntaxElement = Readonly<{
32
+ kind: "element";
33
+ name: ExpandedName;
34
+ lexicalName: string;
35
+ attributes: readonly SyntaxAttribute[];
36
+ namespaces: Readonly<Record<string, string>>;
37
+ baseUri: string;
38
+ children: readonly SyntaxNode[];
39
+ source: SyntaxSource;
40
+ }>;
41
+ export type SyntaxNode = SyntaxElement | SyntaxText;
42
+ export type SyntaxDocument = Readonly<{
43
+ uri: string;
44
+ digest: string;
45
+ root: SyntaxElement;
46
+ }>;
47
+ export type LoadingErrorCategory = "invalid-schema" | "unsupported-capability" | "resource-limit" | "transport";
48
+ export declare class SchemaLoadingError extends Error {
49
+ readonly category: LoadingErrorCategory;
50
+ readonly source?: SyntaxSource | undefined;
51
+ constructor(category: LoadingErrorCategory, message: string, source?: SyntaxSource | undefined);
52
+ }
53
+ export declare function syntaxAttribute(node: SyntaxElement, local: string, namespace?: string): string | undefined;
54
+ export declare function syntaxElements(node: SyntaxElement, namespace?: string, local?: string): SyntaxElement[];
55
+ /** One range authority for name predicates and the private fixed-S4S pattern consumer. */
56
+ export declare const XML_NAME_RANGES: Readonly<{
57
+ start: string;
58
+ character: string;
59
+ }>;
60
+ /** Shared XML name grammar for loader QNames and schema-declared operands. */
61
+ export declare const isXmlNCName: (value: string) => boolean;
62
+ export declare const isXmlName: (value: string) => boolean;
63
+ export declare const isXmlNmtoken: (value: string) => boolean;
64
+ export declare function resolveLexicalQName(lexical: string, node: SyntaxElement): ExpandedName;
65
+ /** Positions are one-based lines/columns and zero-based UTF-16 offsets in decoded XML. */
66
+ export interface OrderedSyntaxOptions {
67
+ maxDepth?: number;
68
+ /** Optional bounded runtime boundary; legacy schema callers retain their policy. */
69
+ maxBytes?: number;
70
+ maxNodes?: number;
71
+ maxText?: number;
72
+ xml10Only?: boolean;
73
+ chargeWork?: (amount: number) => void;
74
+ reserveNode?: () => void;
75
+ }
76
+ export declare function parseOrderedSyntax(bytes: Uint8Array, uri: string, options?: OrderedSyntaxOptions): SyntaxDocument;
77
+ //# sourceMappingURL=orderedSyntax.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orderedSyntax.d.ts","sourceRoot":"","sources":["../../src/loader/orderedSyntax.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,yCAAyC,CAAC;AACpE,eAAO,MAAM,aAAa,qCAAqC,CAAC;AAChE,eAAO,MAAM,cAAc,qCAAqC,CAAC;AACjE,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,CAAC,CAAC;AACxE,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,CAAC,CAAC;AACtF,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,cAAc,CAAC;IACtB,GAAG,EAAE,cAAc,CAAC;CACrB,CAAC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACrC,IAAI,EAAE,YAAY,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAC,CAAC,CAAC;AACvF,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;IACnC,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,YAAY,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,SAAS,eAAe,EAAE,CAAC;IACvC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,SAAS,UAAU,EAAE,CAAC;IAChC,MAAM,EAAE,YAAY,CAAC;CACtB,CAAC,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG,UAAU,CAAC;AACpD,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,aAAa,CAAA;CAAC,CAAC,CAAC;AAE1F,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG,wBAAwB,GAAG,gBAAgB,GAAG,WAAW,CAAC;AAChH,qBAAa,kBAAmB,SAAQ,KAAK;IAC/B,QAAQ,CAAC,QAAQ,EAAE,oBAAoB;IAAmB,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY;gBAA/E,QAAQ,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,EAAW,MAAM,CAAC,EAAE,YAAY,YAAA;CAIrG;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,SAAK,GAAG,MAAM,GAAG,SAAS,CAEtG;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,aAAa,EAAE,CAIvG;AAID,0FAA0F;AAC1F,eAAO,MAAM,eAAe;;;EAC4C,CAAC;AAEzE,8EAA8E;AAC9E,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,KAAG,OAA6B,CAAC;AAG1E,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,KAAG,OAA8B,CAAC;AACzE,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,OAAiC,CAAC;AAC/E,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,YAAY,CAStF;AAmBD,0FAA0F;AAC1F,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oFAAoF;IACpF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AACD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,oBAAyB,GAAG,cAAc,CAgGrH"}
@@ -0,0 +1,202 @@
1
+ /** Ordered XML syntax boundary for the unreleased faithful compiler. */
2
+ import { createHash } from "node:crypto";
3
+ import { SaxesParser } from "saxes";
4
+ export const XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
5
+ export const XSD_NAMESPACE = "http://www.w3.org/2001/XMLSchema";
6
+ export const WSDL_NAMESPACE = "http://schemas.xmlsoap.org/wsdl/";
7
+ export const DEFAULT_SYNTAX_DEPTH = 256;
8
+ export class SchemaLoadingError extends Error {
9
+ category;
10
+ source;
11
+ constructor(category, message, source) {
12
+ super(message);
13
+ this.category = category;
14
+ this.source = source;
15
+ this.name = "SchemaLoadingError";
16
+ }
17
+ }
18
+ export function syntaxAttribute(node, local, namespace = "") {
19
+ return node.attributes.find(a => a.name.local === local && a.name.namespace === namespace)?.value;
20
+ }
21
+ export function syntaxElements(node, namespace, local) {
22
+ return node.children.filter((n) => n.kind === "element"
23
+ && (namespace === undefined || n.name.namespace === namespace)
24
+ && (local === undefined || n.name.local === local));
25
+ }
26
+ // XML 1.0 (fifth edition) NCName; QName values use default namespaces, attributes do not.
27
+ const ncStart = "A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u{10000}-\\u{EFFFF}";
28
+ /** One range authority for name predicates and the private fixed-S4S pattern consumer. */
29
+ export const XML_NAME_RANGES = Object.freeze({ start: ncStart + ':',
30
+ character: ncStart + ':\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040' });
31
+ const ncName = new RegExp(`^[${ncStart}][${ncStart}\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`, "u");
32
+ /** Shared XML name grammar for loader QNames and schema-declared operands. */
33
+ export const isXmlNCName = (value) => ncName.test(value);
34
+ const xmlName = new RegExp(`^[${XML_NAME_RANGES.start}][${XML_NAME_RANGES.character}]*$`, "u");
35
+ const xmlNmtoken = new RegExp(`^[${XML_NAME_RANGES.character}]+$`, "u");
36
+ export const isXmlName = (value) => xmlName.test(value);
37
+ export const isXmlNmtoken = (value) => xmlNmtoken.test(value);
38
+ export function resolveLexicalQName(lexical, node) {
39
+ const parts = lexical.replace(/^[\t\r\n ]+|[\t\r\n ]+$/g, "").split(":");
40
+ if (parts.length > 2 || parts.some(p => !ncName.test(p))) {
41
+ throw new SchemaLoadingError("invalid-schema", "Invalid lexical QName", node.source);
42
+ }
43
+ const prefix = parts.length === 2 ? parts[0] : "";
44
+ const namespace = node.namespaces[prefix];
45
+ if (prefix && !namespace)
46
+ throw new SchemaLoadingError("invalid-schema", "Unbound QName prefix", node.source);
47
+ return Object.freeze({ namespace: namespace ?? "", local: parts.at(-1) });
48
+ }
49
+ function decodeXml(bytes, strictBom = false) {
50
+ const encoding = bytes[0] === 0xff && bytes[1] === 0xfe ? "utf-16le"
51
+ : bytes[0] === 0xfe && bytes[1] === 0xff ? "utf-16be" : "utf-8";
52
+ try {
53
+ const text = new TextDecoder(encoding, { fatal: true }).decode(bytes);
54
+ if (strictBom && text.startsWith('\ufeff'))
55
+ throw new SchemaLoadingError('invalid-schema', 'Multiple XML byte order marks');
56
+ const declared = /^<\?xml\s[^?]*encoding\s*=\s*["']([^"']+)["']/i.exec(text)?.[1].toLowerCase();
57
+ if (declared && !(encoding === "utf-8" ? ["utf-8", "utf8"] : ["utf-16", encoding]).includes(declared)) {
58
+ throw new SchemaLoadingError("unsupported-capability", "Unsupported XML byte encoding");
59
+ }
60
+ return text;
61
+ }
62
+ catch (error) {
63
+ if (error instanceof SchemaLoadingError)
64
+ throw error;
65
+ throw new SchemaLoadingError("invalid-schema", "Invalid XML byte encoding");
66
+ }
67
+ }
68
+ export function parseOrderedSyntax(bytes, uri, options = {}) {
69
+ const maxDepth = options.maxDepth ?? DEFAULT_SYNTAX_DEPTH;
70
+ if (!Number.isSafeInteger(maxDepth) || maxDepth < 1)
71
+ throw new RangeError("maxDepth must be a positive safe integer");
72
+ for (const key of ['maxBytes', 'maxNodes', 'maxText']) {
73
+ const value = options[key];
74
+ if (value !== undefined && (!Number.isSafeInteger(value) || value < 1))
75
+ throw new RangeError(`${key} must be a positive safe integer`);
76
+ }
77
+ try {
78
+ new URL(uri);
79
+ }
80
+ catch {
81
+ throw new SchemaLoadingError("invalid-schema", "An absolute source URI is required");
82
+ }
83
+ if (options.maxBytes !== undefined && bytes.byteLength > options.maxBytes)
84
+ throw new SchemaLoadingError('resource-limit', 'XML byte limit');
85
+ // Reserve decoding, hash, line index and SAX token buffers before their bulk
86
+ // intrinsics. Tokens (including ignored comments/PI/DTD) are bounded by bytes.
87
+ const charge = (amount) => options.chargeWork?.(amount);
88
+ charge(4096 + bytes.byteLength * 64);
89
+ const digest = createHash("sha256").update(bytes).digest("hex");
90
+ const text = decodeXml(bytes, options.xml10Only);
91
+ const lines = [0];
92
+ for (let i = 0; i < text.length; i++) {
93
+ if (text[i] === "\r") {
94
+ if (text[i + 1] === "\n")
95
+ i++;
96
+ lines.push(i + 1);
97
+ }
98
+ else if (text[i] === "\n")
99
+ lines.push(i + 1);
100
+ }
101
+ const position = (offset) => {
102
+ let low = 0, high = lines.length;
103
+ while (low + 1 < high) {
104
+ const mid = (low + high) >>> 1;
105
+ if (lines[mid] <= offset)
106
+ low = mid;
107
+ else
108
+ high = mid;
109
+ }
110
+ return Object.freeze({ offset, line: low + 1, column: offset - lines[low] + 1 });
111
+ };
112
+ const source = (path, start, end) => Object.freeze({ uri, digest, path, start: position(start), end: position(end) });
113
+ const stack = [];
114
+ let root;
115
+ let tagStart = 0, cursor = 0;
116
+ const parser = new SaxesParser({ xmlns: true });
117
+ let nodes = 0, textUnits = 0;
118
+ const fail = (category, message) => {
119
+ throw new SchemaLoadingError(category, message, source(stack.at(-1)?.source.path ?? "/0", tagStart, parser.position));
120
+ };
121
+ parser.on("error", () => fail("invalid-schema", "Malformed XML or unresolved entity reference"));
122
+ parser.on("doctype", () => fail("unsupported-capability", "DTDs and entity declarations are forbidden"));
123
+ parser.on('xmldecl', declaration => {
124
+ if (options.xml10Only && declaration.version !== '1.0')
125
+ fail('unsupported-capability', 'Only XML 1.0 is supported');
126
+ });
127
+ const reserveNode = () => {
128
+ charge(512);
129
+ if (options.maxNodes !== undefined && nodes >= options.maxNodes)
130
+ fail('resource-limit', 'XML node limit');
131
+ options.reserveNode?.();
132
+ nodes++;
133
+ };
134
+ parser.on("opentagstart", () => { tagStart = text.lastIndexOf("<", parser.position - 1); });
135
+ parser.on("opentag", tag => {
136
+ if (stack.length >= maxDepth)
137
+ fail("resource-limit", `XML syntax depth exceeds ${maxDepth} elements`);
138
+ const parent = stack.at(-1);
139
+ reserveNode();
140
+ // Inherited maps/path copies can be larger than the current lexical tag.
141
+ charge(512 + (parent?.source.path.length ?? 0) * 4);
142
+ for (const prefix in parent?.namespaces)
143
+ charge(128 + (prefix.length + parent.namespaces[prefix].length) * 4);
144
+ for (const prefix in tag.ns)
145
+ if (Object.hasOwn(tag.ns, prefix))
146
+ charge(128 + (prefix.length + tag.ns[prefix].length) * 4);
147
+ const attributes = Object.values(tag.attributes).filter(a => a.uri !== "http://www.w3.org/2000/xmlns/")
148
+ .map(a => Object.freeze({ name: Object.freeze({ namespace: a.uri, local: a.local }), lexicalName: a.name, value: a.value }));
149
+ const namespaces = Object.freeze(Object.assign(Object.create(null), parent?.namespaces ?? { xml: XML_NAMESPACE, "": "" }, tag.ns));
150
+ const base = attributes.find(a => a.name.namespace === XML_NAMESPACE && a.name.local === "base")?.value;
151
+ let baseUri;
152
+ // Relative xml:base resolution may copy an inherited URI much larger than
153
+ // this tag. Charge its input/output envelope before the URL intrinsic.
154
+ if (base !== undefined)
155
+ charge(512 + (base.length + (parent?.baseUri ?? uri).length) * 16);
156
+ try {
157
+ baseUri = base === undefined ? parent?.baseUri ?? uri : new URL(base, parent?.baseUri ?? uri).href;
158
+ }
159
+ catch {
160
+ return fail("invalid-schema", "Invalid xml:base URI");
161
+ }
162
+ const node = { kind: "element", name: Object.freeze({ namespace: tag.uri, local: tag.local }), lexicalName: tag.name,
163
+ attributes: Object.freeze(attributes), namespaces, baseUri, children: [], source: source(parent ? `${parent.source.path}/${parent.children.length}` : "/0", tagStart, parser.position) };
164
+ if (parent)
165
+ parent.children.push(node);
166
+ else
167
+ root = node;
168
+ stack.push(node);
169
+ cursor = parser.position;
170
+ });
171
+ const appendText = (value, start, end) => {
172
+ const parent = stack.at(-1);
173
+ if (parent) {
174
+ if (options.maxText !== undefined && value.length > options.maxText - textUnits)
175
+ fail('resource-limit', 'XML text limit');
176
+ textUnits += value.length;
177
+ reserveNode();
178
+ charge(512 + value.length * 4 + parent.source.path.length * 4);
179
+ parent.children.push(Object.freeze({ kind: "text", value, source: source(`${parent.source.path}/${parent.children.length}`, start, end) }));
180
+ }
181
+ };
182
+ parser.on("text", value => { const end = text[parser.position - 1] === "<" ? parser.position - 1 : parser.position; appendText(value, cursor, end); cursor = end; });
183
+ parser.on("cdata", value => { appendText(value, cursor + 9, parser.position - 3); cursor = parser.position; });
184
+ parser.on("comment", () => { cursor = parser.position + 1; });
185
+ parser.on("processinginstruction", () => { cursor = parser.position; });
186
+ parser.on("closetag", () => {
187
+ const node = stack.pop();
188
+ node.source = source(node.source.path, node.source.start.offset, parser.position);
189
+ Object.freeze(node.children);
190
+ Object.freeze(node);
191
+ cursor = parser.position;
192
+ });
193
+ // Bounded cooperative checkpoints even while a SAX token is buffered.
194
+ for (let offset = 0; offset < text.length; offset += 1024) {
195
+ charge(1024);
196
+ parser.write(text.slice(offset, offset + 1024));
197
+ }
198
+ parser.close();
199
+ if (!root)
200
+ fail("invalid-schema", "Missing XML root element");
201
+ return Object.freeze({ uri, digest, root: root });
202
+ }
@@ -0,0 +1,7 @@
1
+ /** Polynomial upper bound for cached resolution depth, including cycle closure. */
2
+ export type ResolutionArc = Readonly<{
3
+ to: string;
4
+ cost: 0 | 1;
5
+ }>;
6
+ export declare function resolutionDepthBound(root: string, graph: ReadonlyMap<string, readonly ResolutionArc[]>, terminals: ReadonlySet<string>): number;
7
+ //# sourceMappingURL=resolutionDepth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolutionDepth.d.ts","sourceRoot":"","sources":["../../src/loader/resolutionDepth.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAA;CAAC,CAAC,CAAC;AAEhE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,CAAC,EAAE,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,CAyD/I"}
@@ -0,0 +1,65 @@
1
+ export function resolutionDepthBound(root, graph, terminals) {
2
+ const arcs = (key) => terminals.has(key) ? [] : graph.get(key) ?? [];
3
+ const seen = new Set();
4
+ const order = [];
5
+ const stack = [{ key: root, exit: false }];
6
+ const reverse = new Map();
7
+ while (stack.length) {
8
+ const { key, exit } = stack.pop();
9
+ if (exit) {
10
+ order.push(key);
11
+ continue;
12
+ }
13
+ if (seen.has(key))
14
+ continue;
15
+ seen.add(key);
16
+ stack.push({ key, exit: true });
17
+ for (const edge of arcs(key)) {
18
+ const incoming = reverse.get(edge.to) ?? [];
19
+ incoming.push(key);
20
+ reverse.set(edge.to, incoming);
21
+ stack.push({ key: edge.to, exit: false });
22
+ }
23
+ }
24
+ const component = new Map();
25
+ const groups = [];
26
+ for (const rootKey of order.reverse()) {
27
+ if (component.has(rootKey))
28
+ continue;
29
+ const index = groups.length;
30
+ const members = [];
31
+ const pending = [rootKey];
32
+ while (pending.length) {
33
+ const key = pending.pop();
34
+ if (component.has(key))
35
+ continue;
36
+ component.set(key, index);
37
+ members.push(key);
38
+ for (const previous of reverse.get(key) ?? [])
39
+ pending.push(previous);
40
+ }
41
+ groups.push(members);
42
+ }
43
+ const internal = new Map();
44
+ const weights = groups.map((members, index) => members.reduce((sum, key) => {
45
+ const cost = arcs(key).reduce((max, edge) => component.get(edge.to) === index ? Math.max(max, edge.cost) : max, 0);
46
+ internal.set(key, cost);
47
+ return sum + cost;
48
+ }, 0));
49
+ // SCC indices follow source-to-sink order, so all exit heights are already known.
50
+ const heights = groups.map(() => 0);
51
+ for (let index = groups.length - 1; index >= 0; index--) {
52
+ let height = weights[index];
53
+ for (const key of groups[index]) {
54
+ for (const edge of arcs(key)) {
55
+ const target = component.get(edge.to);
56
+ if (target !== index) {
57
+ // An exit replaces that node's internal edge, rather than closing then exiting.
58
+ height = Math.max(height, weights[index] - internal.get(key) + edge.cost + heights[target]);
59
+ }
60
+ }
61
+ }
62
+ heights[index] = height;
63
+ }
64
+ return heights[component.get(root)];
65
+ }
@@ -0,0 +1,53 @@
1
+ import type { SyntaxDocument, SyntaxElement, SyntaxSource } from "./orderedSyntax.js";
2
+ import type { LoadingLimits, OfflineSchemaResource, ResourceMetadata, SchemaResourcePolicy } from "./schemaResources.js";
3
+ export type SchemaContext = Readonly<{
4
+ kind: "root" | "inline" | "include" | "import";
5
+ namespace: string;
6
+ }>;
7
+ export type SchemaInterpretation = Readonly<{
8
+ key: string;
9
+ syntax: SyntaxElement;
10
+ documentUri: string;
11
+ digest: string;
12
+ baseUri: string;
13
+ targetNamespace: string;
14
+ context: SchemaContext;
15
+ }>;
16
+ export type ResolutionEdge = Readonly<{
17
+ kind: "include" | "import" | "wsdl-import";
18
+ from: string;
19
+ to?: string;
20
+ referenceUri?: string;
21
+ source: SyntaxSource;
22
+ cycle: boolean;
23
+ }>;
24
+ export type SchemaInput = Readonly<{
25
+ root: SyntaxDocument;
26
+ documents: readonly SyntaxDocument[];
27
+ schemas: readonly SchemaInterpretation[];
28
+ resources: readonly ResourceMetadata[];
29
+ edges: readonly ResolutionEdge[];
30
+ limits: LoadingLimits;
31
+ metrics: Readonly<{
32
+ resources: number;
33
+ totalBytes: number;
34
+ ioMs: number;
35
+ }>;
36
+ }>;
37
+ /** Internal bridge for one retained-source invocation. Returned bytes are data, not authority. */
38
+ export declare function copyOriginalSchemaResource(input: SchemaInput, uri: string, chargeWork: (amount: number) => void): Uint8Array;
39
+ export declare function assertLoadedSchemaInput(input: SchemaInput): void;
40
+ export declare function schemaInterpretationKey(node: SyntaxElement, targetNamespace: string, context: SchemaContext): string;
41
+ export type SchemaInputOptions = {
42
+ signal?: AbortSignal;
43
+ /** Optional request accounting used by the additive assessment boundary. */
44
+ chargeWork?: (amount: number) => void;
45
+ policy: SchemaResourcePolicy;
46
+ limits?: Partial<LoadingLimits>;
47
+ offlineResources?: ReadonlyMap<string, OfflineSchemaResource>;
48
+ };
49
+ /** A fresh compilation-scoped snapshot, with no implicit network or filesystem permission. */
50
+ export declare function loadSchemaInput(source: string, options: SchemaInputOptions): Promise<SchemaInput>;
51
+ /** Internal faithful source entry; preserves syntax and the legacy public entry. */
52
+ export declare function loadSemanticSchemaInput(source: string, options: SchemaInputOptions): Promise<SchemaInput>;
53
+ //# sourceMappingURL=schemaInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemaInput.d.ts","sourceRoot":"","sources":["../../src/loader/schemaInput.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,cAAc,EAAE,aAAa,EAAE,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAEpF,OAAO,KAAK,EAAC,aAAa,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AAKvH,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAC,CAAC,CAAC;AAC1G,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,aAAa,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,aAAa,CAAC;CACxB,CAAC,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IACpC,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,aAAa,CAAC;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IACjC,IAAI,EAAE,cAAc,CAAC;IACrB,SAAS,EAAE,SAAS,cAAc,EAAE,CAAC;IACrC,OAAO,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACzC,SAAS,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACvC,KAAK,EAAE,SAAS,cAAc,EAAE,CAAC;IACjC,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,QAAQ,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;CAC1E,CAAC,CAAC;AAMH,kGAAkG;AAClG,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,UAAU,CAM5H;AACD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAEhE;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,MAAM,CAEpH;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAChC,gBAAgB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;CAC/D,CAAC;AAEF,8FAA8F;AAC9F,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CAEjG;AAED,oFAAoF;AACpF,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CAEzG"}
@@ -0,0 +1,212 @@
1
+ /** Contextual schema traversal; consumes ordered syntax, never payload hints. */
2
+ import { parseOrderedSyntax, SchemaLoadingError, syntaxAttribute, syntaxElements, XSD_NAMESPACE, WSDL_NAMESPACE } from "./orderedSyntax.js";
3
+ import { SchemaResourceLoader, resolveResourceUri } from "./schemaResources.js";
4
+ import { resolutionDepthBound } from "./resolutionDepth.js";
5
+ import { normalizeWhitespace } from '../util/xmlWhitespace.js';
6
+ // Source-syntax evidence is issued only by this loader, never by a copied shape.
7
+ const loadedInputs = new WeakSet();
8
+ // Private original authorized snapshot; never reconstructed from syntax/digests.
9
+ const originalSources = new WeakMap();
10
+ /** Internal bridge for one retained-source invocation. Returned bytes are data, not authority. */
11
+ export function copyOriginalSchemaResource(input, uri, chargeWork) {
12
+ assertLoadedSchemaInput(input);
13
+ const bytes = originalSources.get(input)?.get(uri);
14
+ if (!bytes)
15
+ throw new TypeError('Original semantic source bytes unavailable');
16
+ chargeWork(512 + bytes.byteLength * 8);
17
+ return new Uint8Array(bytes);
18
+ }
19
+ export function assertLoadedSchemaInput(input) {
20
+ if (!loadedInputs.has(input))
21
+ throw new TypeError("Unauthenticated loaded schema input");
22
+ }
23
+ export function schemaInterpretationKey(node, targetNamespace, context) {
24
+ return JSON.stringify([node.source.digest, node.source.uri, node.baseUri, targetNamespace, context.kind, context.namespace, node.source.path]);
25
+ }
26
+ /** A fresh compilation-scoped snapshot, with no implicit network or filesystem permission. */
27
+ export function loadSchemaInput(source, options) {
28
+ return loadSchemaInputWithValues(source, options, false);
29
+ }
30
+ /** Internal faithful source entry; preserves syntax and the legacy public entry. */
31
+ export function loadSemanticSchemaInput(source, options) {
32
+ return loadSchemaInputWithValues(source, options, true);
33
+ }
34
+ async function loadSchemaInputWithValues(source, options, semanticValues) {
35
+ const loader = await SchemaResourceLoader.create(options.policy, options.limits, options.offlineResources, options.chargeWork, options.signal);
36
+ const documents = new Map();
37
+ const originalBytes = new Map();
38
+ const schemas = new Map();
39
+ const edges = [];
40
+ const active = new Set();
41
+ const wsdlVisited = new Set();
42
+ const depthGraph = new Map();
43
+ const depthTargets = new Map();
44
+ const recordDepthArc = (from, to, cost) => {
45
+ const target = JSON.stringify([to, cost]);
46
+ const targets = depthTargets.get(from) ?? new Set();
47
+ if (targets.has(target))
48
+ return;
49
+ targets.add(target);
50
+ depthTargets.set(from, targets);
51
+ const arcs = depthGraph.get(from) ?? [];
52
+ arcs.push({ to, cost });
53
+ depthGraph.set(from, arcs);
54
+ };
55
+ const recordEdge = (edge) => {
56
+ options.chargeWork?.(256);
57
+ const frozen = Object.freeze(edge);
58
+ edges.push(frozen);
59
+ if (edge.to)
60
+ recordDepthArc(edge.from, edge.to, 1);
61
+ };
62
+ const checkDepth = (depth, node) => {
63
+ if (depth > loader.limits.resolutionDepth)
64
+ throw new SchemaLoadingError("resource-limit", `Schema resolution depth exceeds ${loader.limits.resolutionDepth} edges`, node?.source);
65
+ };
66
+ const getDocument = async (uri) => {
67
+ const resource = await loader.fetchResource(uri);
68
+ let doc = documents.get(resource.uri);
69
+ if (!doc) {
70
+ doc = parseOrderedSyntax(resource.bytes, resource.uri, { maxDepth: loader.limits.syntaxDepth });
71
+ if (semanticValues) {
72
+ options.chargeWork?.(128);
73
+ originalBytes.set(resource.uri, resource.bytes);
74
+ }
75
+ documents.set(resource.uri, doc);
76
+ }
77
+ return doc;
78
+ };
79
+ const is = (node, namespace, local) => node.name.namespace === namespace && node.name.local === local;
80
+ // Only XSD anyURI properties use this mapping. Original syntax and namespace
81
+ // bindings, WSDL transport names, and arbitrary resource URLs remain intact.
82
+ // Source byte/resource limits govern this phase, before semantic preparation.
83
+ const xsdUri = (node, name) => {
84
+ const value = syntaxAttribute(node, name);
85
+ options.chargeWork?.(64 + (value?.length ?? 0) * 16);
86
+ return value === undefined || !semanticValues ? value : normalizeWhitespace(value, 'collapse');
87
+ };
88
+ // Cached interpretations still consume resolution depth on a later, deeper route.
89
+ const checkCachedDepth = (key, depth) => {
90
+ if (depth + resolutionDepthBound(key, depthGraph, active) > loader.limits.resolutionDepth) {
91
+ throw new SchemaLoadingError("resource-limit", `Schema resolution depth exceeds ${loader.limits.resolutionDepth} edges`, schemas.get(key)?.syntax.source ?? documents.get(key)?.root.source);
92
+ }
93
+ };
94
+ const referencedDocument = async (reference, node) => {
95
+ try {
96
+ const referenceUri = resolveResourceUri(reference, node.baseUri);
97
+ return { referenceUri, doc: await getDocument(referenceUri) };
98
+ }
99
+ catch (error) {
100
+ if (error instanceof SchemaLoadingError && !error.source)
101
+ throw new SchemaLoadingError(error.category, error.message, node.source);
102
+ throw error;
103
+ }
104
+ };
105
+ const interpret = async (node, context, depth) => {
106
+ options.chargeWork?.(4096 + (node.source.path.length + node.source.uri.length + node.baseUri.length + context.namespace.length) * 32 + node.children.length * 128);
107
+ checkDepth(depth, node);
108
+ if (!is(node, XSD_NAMESPACE, "schema"))
109
+ throw new SchemaLoadingError("invalid-schema", "Expected an XSD schema root", node.source);
110
+ const declaredValue = xsdUri(node, "targetNamespace");
111
+ if (semanticValues && declaredValue === '')
112
+ throw new SchemaLoadingError("invalid-schema", "A present schema target namespace must not be empty", node.source);
113
+ const declaredNamespace = declaredValue ?? "";
114
+ const targetNamespace = context.kind === "include" && !declaredNamespace ? context.namespace : declaredNamespace;
115
+ if (context.kind === "include" && declaredNamespace && declaredNamespace !== context.namespace) {
116
+ throw new SchemaLoadingError("invalid-schema", "Included schema target namespace differs from its including schema", node.source);
117
+ }
118
+ if (context.kind === "import" && targetNamespace !== context.namespace) {
119
+ throw new SchemaLoadingError("invalid-schema", "Imported schema target namespace differs from the declared import namespace", node.source);
120
+ }
121
+ const key = schemaInterpretationKey(node, targetNamespace, context);
122
+ if (schemas.has(key)) {
123
+ if (!active.has(key))
124
+ checkCachedDepth(key, depth);
125
+ return key;
126
+ }
127
+ const instance = Object.freeze({ key, syntax: node, documentUri: node.source.uri, digest: node.source.digest, baseUri: node.baseUri, targetNamespace, context: Object.freeze(context) });
128
+ schemas.set(key, instance);
129
+ active.add(key);
130
+ for (const child of syntaxElements(node, XSD_NAMESPACE)) {
131
+ if (child.name.local !== "include" && child.name.local !== "import")
132
+ continue;
133
+ const kind = child.name.local;
134
+ const location = xsdUri(child, "schemaLocation");
135
+ const importedNamespace = xsdUri(child, "namespace");
136
+ const missingLocation = semanticValues ? location === undefined : !location;
137
+ if (missingLocation && kind === "include")
138
+ throw new SchemaLoadingError("invalid-schema", "Schema include requires schemaLocation", child.source);
139
+ if (missingLocation) {
140
+ recordEdge({ kind, from: key, source: child.source, cycle: false });
141
+ continue;
142
+ }
143
+ checkDepth(depth + 1, child);
144
+ const namespace = kind === "include" ? targetNamespace : importedNamespace ?? "";
145
+ if (kind === "import" && namespace === targetNamespace)
146
+ throw new SchemaLoadingError("invalid-schema", "Schema import must name a different namespace", child.source);
147
+ const { referenceUri, doc } = await referencedDocument(location, child);
148
+ const childDeclaredNamespace = xsdUri(doc.root, "targetNamespace");
149
+ // A successfully supplied import referent must match both presence and
150
+ // value. An explicit empty import namespace without a referent is not
151
+ // by itself forbidden by the anyURI datatype or src-import clause 3.
152
+ if (semanticValues && kind === 'import' && (importedNamespace === undefined) !== (childDeclaredNamespace === undefined)) {
153
+ throw new SchemaLoadingError("invalid-schema", "Imported schema target namespace presence differs from the declared import namespace", child.source);
154
+ }
155
+ const childContext = { kind, namespace };
156
+ const childNamespace = kind === "include" ? childDeclaredNamespace || namespace : childDeclaredNamespace ?? "";
157
+ const childKey = schemaInterpretationKey(doc.root, childNamespace, childContext);
158
+ const cycle = active.has(childKey);
159
+ const to = await interpret(doc.root, childContext, depth + 1);
160
+ recordEdge({ kind, from: key, to, referenceUri, source: child.source, cycle });
161
+ }
162
+ active.delete(key);
163
+ return key;
164
+ };
165
+ const visitWsdl = async (doc, depth) => {
166
+ checkDepth(depth, doc.root);
167
+ if (!is(doc.root, WSDL_NAMESPACE, "definitions"))
168
+ throw new SchemaLoadingError("invalid-schema", "Expected WSDL 1.1 definitions", doc.root.source);
169
+ if (wsdlVisited.has(doc.uri)) {
170
+ if (!active.has(doc.uri))
171
+ checkCachedDepth(doc.uri, depth);
172
+ return;
173
+ }
174
+ wsdlVisited.add(doc.uri);
175
+ active.add(doc.uri);
176
+ for (const child of syntaxElements(doc.root, WSDL_NAMESPACE)) {
177
+ if (child.name.local === "types") {
178
+ for (const schema of syntaxElements(child, XSD_NAMESPACE, "schema")) {
179
+ const key = await interpret(schema, { kind: "inline", namespace: "" }, depth);
180
+ recordDepthArc(doc.uri, key, 0);
181
+ }
182
+ }
183
+ else if (child.name.local === "import") {
184
+ const location = syntaxAttribute(child, "location");
185
+ if (!location)
186
+ throw new SchemaLoadingError("invalid-schema", "WSDL import requires location", child.source);
187
+ checkDepth(depth + 1, child);
188
+ const { referenceUri, doc: imported } = await referencedDocument(location, child);
189
+ if ((syntaxAttribute(imported.root, "targetNamespace") ?? "") !== (syntaxAttribute(child, "namespace") ?? "")) {
190
+ throw new SchemaLoadingError("invalid-schema", "WSDL import namespace mismatch", child.source);
191
+ }
192
+ const cycle = active.has(imported.uri);
193
+ await visitWsdl(imported, depth + 1);
194
+ recordEdge({ kind: "wsdl-import", from: doc.uri, to: imported.uri, referenceUri, source: child.source, cycle });
195
+ }
196
+ }
197
+ active.delete(doc.uri);
198
+ };
199
+ const root = await getDocument(resolveResourceUri(source));
200
+ if (is(root.root, XSD_NAMESPACE, "schema"))
201
+ await interpret(root.root, { kind: "root", namespace: "" }, 0);
202
+ else if (is(root.root, WSDL_NAMESPACE, "definitions"))
203
+ await visitWsdl(root, 0);
204
+ else
205
+ throw new SchemaLoadingError("unsupported-capability", "Only WSDL 1.1 or XSD schema inputs are accepted; payload hints cannot resolve schemas", root.root.source);
206
+ const input = Object.freeze({ root, documents: Object.freeze([...documents.values()]), schemas: Object.freeze([...schemas.values()]),
207
+ resources: loader.metadata, edges: Object.freeze(edges), limits: loader.limits, metrics: loader.metrics });
208
+ loadedInputs.add(input);
209
+ if (semanticValues)
210
+ originalSources.set(input, originalBytes);
211
+ return input;
212
+ }