@techspokes/typescript-wsdl-client 1.1.4 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (422) hide show
  1. package/README.md +81 -35
  2. package/dist/app/generateApp.d.ts +0 -1
  3. package/dist/app/generateApp.js +8 -6
  4. package/dist/app/generateCheckedApp.d.ts +38 -0
  5. package/dist/app/generateCheckedApp.js +108 -0
  6. package/dist/checkedPipeline.d.ts +155 -0
  7. package/dist/checkedPipeline.js +448 -0
  8. package/dist/checkedPlanning.d.ts +123 -0
  9. package/dist/checkedPlanning.js +245 -0
  10. package/dist/cli.d.ts +0 -1
  11. package/dist/cli.js +123 -5
  12. package/dist/client/checkedDirectRuntime.d.ts +96 -0
  13. package/dist/client/checkedDirectRuntime.js +43 -0
  14. package/dist/client/directClientRuntime.d.ts +74 -0
  15. package/dist/client/directClientRuntime.js +165 -0
  16. package/dist/client/directClientVersion.d.ts +6 -0
  17. package/dist/client/directClientVersion.js +6 -0
  18. package/dist/client/generateClient.d.ts +0 -1
  19. package/dist/client/generateClient.js +26 -12
  20. package/dist/client/generateDirectClient.d.ts +32 -0
  21. package/dist/client/generateDirectClient.js +268 -0
  22. package/dist/client/generateOperations.d.ts +0 -1
  23. package/dist/client/generateTypes.d.ts +0 -1
  24. package/dist/client/generateUtils.d.ts +0 -1
  25. package/dist/client/generateUtils.js +3 -1
  26. package/dist/compiler/applicationGroups.d.ts +53 -0
  27. package/dist/compiler/applicationGroups.js +403 -0
  28. package/dist/compiler/buildCanonicalGraph.d.ts +6 -0
  29. package/dist/compiler/buildCanonicalGraph.js +381 -0
  30. package/dist/compiler/canonicalGraph.d.ts +197 -0
  31. package/dist/compiler/canonicalGraph.js +37 -0
  32. package/dist/compiler/catalogErrors.d.ts +17 -0
  33. package/dist/compiler/catalogErrors.js +86 -0
  34. package/dist/compiler/catalogProvenance.d.ts +14 -0
  35. package/dist/compiler/catalogProvenance.js +229 -0
  36. package/dist/compiler/checkedAssessment.d.ts +90 -0
  37. package/dist/compiler/checkedAssessment.js +300 -0
  38. package/dist/compiler/checkedComponentSource.d.ts +16 -0
  39. package/dist/compiler/checkedComponentSource.js +31 -0
  40. package/dist/compiler/checkedSourcePreparation.d.ts +72 -0
  41. package/dist/compiler/checkedSourcePreparation.js +202 -0
  42. package/dist/compiler/complexTypeContent.d.ts +58 -0
  43. package/dist/compiler/complexTypeContent.js +558 -0
  44. package/dist/compiler/componentCorrespondence.d.ts +32 -0
  45. package/dist/compiler/componentCorrespondence.js +140 -0
  46. package/dist/compiler/componentRecordProjection.d.ts +109 -0
  47. package/dist/compiler/componentRecordProjection.js +319 -0
  48. package/dist/compiler/componentSoapPreparation.d.ts +20 -0
  49. package/dist/compiler/componentSoapPreparation.js +36 -0
  50. package/dist/compiler/composeCanonicalGraph.d.ts +68 -0
  51. package/dist/compiler/composeCanonicalGraph.js +252 -0
  52. package/dist/compiler/dataOwnership.d.ts +21 -0
  53. package/dist/compiler/dataOwnership.js +167 -0
  54. package/dist/compiler/datatypeValues.d.ts +46 -0
  55. package/dist/compiler/datatypeValues.js +275 -0
  56. package/dist/compiler/directCodec.d.ts +116 -0
  57. package/dist/compiler/directCodec.js +377 -0
  58. package/dist/compiler/directExecutionPolicy.d.ts +9 -0
  59. package/dist/compiler/directExecutionPolicy.js +17 -0
  60. package/dist/compiler/directOperation.d.ts +114 -0
  61. package/dist/compiler/directOperation.js +373 -0
  62. package/dist/compiler/directSoap.d.ts +66 -0
  63. package/dist/compiler/directSoap.js +391 -0
  64. package/dist/compiler/directSoapSource.d.ts +38 -0
  65. package/dist/compiler/directSoapSource.js +233 -0
  66. package/dist/compiler/directSourceCapsule.d.ts +169 -0
  67. package/dist/compiler/directSourceCapsule.js +727 -0
  68. package/dist/compiler/directStructure.d.ts +128 -0
  69. package/dist/compiler/directStructure.js +543 -0
  70. package/dist/compiler/directStructurePlan.d.ts +149 -0
  71. package/dist/compiler/directStructurePlan.js +623 -0
  72. package/dist/compiler/directValues.d.ts +128 -0
  73. package/dist/compiler/directValues.js +1116 -0
  74. package/dist/compiler/finiteRe01Construction.d.ts +69 -0
  75. package/dist/compiler/finiteRe01Construction.js +422 -0
  76. package/dist/compiler/finiteRe01Verification.d.ts +218 -0
  77. package/dist/compiler/finiteRe01Verification.js +1217 -0
  78. package/dist/compiler/generateCatalog.d.ts +0 -1
  79. package/dist/compiler/graphTraversal.d.ts +10 -0
  80. package/dist/compiler/graphTraversal.js +37 -0
  81. package/dist/compiler/hypotheticalScopedIdentity.d.ts +22 -0
  82. package/dist/compiler/hypotheticalScopedIdentity.js +81 -0
  83. package/dist/compiler/occurrenceAnalysis.d.ts +66 -0
  84. package/dist/compiler/occurrenceAnalysis.js +316 -0
  85. package/dist/compiler/originalSourceMembership.d.ts +5 -0
  86. package/dist/compiler/originalSourceMembership.js +31 -0
  87. package/dist/compiler/particleAttribution.d.ts +16 -0
  88. package/dist/compiler/particleAttribution.js +494 -0
  89. package/dist/compiler/particleDeclarationConsistency.d.ts +23 -0
  90. package/dist/compiler/particleDeclarationConsistency.js +206 -0
  91. package/dist/compiler/particleExtension.d.ts +21 -0
  92. package/dist/compiler/particleExtension.js +123 -0
  93. package/dist/compiler/particleLocalAssessment.d.ts +19 -0
  94. package/dist/compiler/particleLocalAssessment.js +92 -0
  95. package/dist/compiler/particleRestriction.d.ts +23 -0
  96. package/dist/compiler/particleRestriction.js +494 -0
  97. package/dist/compiler/particleSemanticView.d.ts +51 -0
  98. package/dist/compiler/particleSemanticView.js +310 -0
  99. package/dist/compiler/particleWildcardRelation.d.ts +87 -0
  100. package/dist/compiler/particleWildcardRelation.js +143 -0
  101. package/dist/compiler/projectionScalar.d.ts +32 -0
  102. package/dist/compiler/projectionScalar.js +184 -0
  103. package/dist/compiler/re01CandidateAssignments.d.ts +95 -0
  104. package/dist/compiler/re01CandidateAssignments.js +341 -0
  105. package/dist/compiler/re01CandidateCorrespondence.d.ts +85 -0
  106. package/dist/compiler/re01CandidateCorrespondence.js +701 -0
  107. package/dist/compiler/re01TypeProperties.d.ts +70 -0
  108. package/dist/compiler/re01TypeProperties.js +120 -0
  109. package/dist/compiler/re01TypePropertyValidation.d.ts +22 -0
  110. package/dist/compiler/re01TypePropertyValidation.js +161 -0
  111. package/dist/compiler/resolveCanonicalGraph.d.ts +41 -0
  112. package/dist/compiler/resolveCanonicalGraph.js +240 -0
  113. package/dist/compiler/scalarSchemaAssessment.d.ts +424 -0
  114. package/dist/compiler/scalarSchemaAssessment.js +5198 -0
  115. package/dist/compiler/schemaAttributeGroupProperties.d.ts +16 -0
  116. package/dist/compiler/schemaAttributeGroupProperties.js +53 -0
  117. package/dist/compiler/schemaAttributeProperties.d.ts +9 -0
  118. package/dist/compiler/schemaAttributeProperties.js +11 -0
  119. package/dist/compiler/schemaAttributeUses.d.ts +110 -0
  120. package/dist/compiler/schemaAttributeUses.js +798 -0
  121. package/dist/compiler/schemaBinaryWordReconstruction.d.ts +9 -0
  122. package/dist/compiler/schemaBinaryWordReconstruction.js +33 -0
  123. package/dist/compiler/schemaBuiltinFacets.d.ts +13 -0
  124. package/dist/compiler/schemaBuiltinFacets.js +51 -0
  125. package/dist/compiler/schemaCalendarImages.d.ts +7 -0
  126. package/dist/compiler/schemaCalendarImages.js +204 -0
  127. package/dist/compiler/schemaCalendarLanguage.d.ts +10 -0
  128. package/dist/compiler/schemaCalendarLanguage.js +227 -0
  129. package/dist/compiler/schemaCompiler.d.ts +0 -1
  130. package/dist/compiler/schemaComponentEquality.d.ts +27 -0
  131. package/dist/compiler/schemaComponentEquality.js +446 -0
  132. package/dist/compiler/schemaConstructionAssessment.d.ts +79 -0
  133. package/dist/compiler/schemaConstructionAssessment.js +745 -0
  134. package/dist/compiler/schemaDatatypeValues.d.ts +3 -0
  135. package/dist/compiler/schemaDatatypeValues.js +2 -0
  136. package/dist/compiler/schemaDecimalLanguage.d.ts +6 -0
  137. package/dist/compiler/schemaDecimalLanguage.js +102 -0
  138. package/dist/compiler/schemaDeclarationPrimitives.d.ts +39 -0
  139. package/dist/compiler/schemaDeclarationPrimitives.js +211 -0
  140. package/dist/compiler/schemaDocumentSyntax.d.ts +54 -0
  141. package/dist/compiler/schemaDocumentSyntax.js +294 -0
  142. package/dist/compiler/schemaDurationLanguage.d.ts +10 -0
  143. package/dist/compiler/schemaDurationLanguage.js +170 -0
  144. package/dist/compiler/schemaElementInstance.d.ts +30 -0
  145. package/dist/compiler/schemaElementInstance.js +45 -0
  146. package/dist/compiler/schemaElementProperties.d.ts +15 -0
  147. package/dist/compiler/schemaElementProperties.js +23 -0
  148. package/dist/compiler/schemaEndpointWordCapacity.d.ts +35 -0
  149. package/dist/compiler/schemaEndpointWordCapacity.js +39 -0
  150. package/dist/compiler/schemaExactCalendar.d.ts +72 -0
  151. package/dist/compiler/schemaExactCalendar.js +264 -0
  152. package/dist/compiler/schemaFacetAnnotation.d.ts +31 -0
  153. package/dist/compiler/schemaFacetAnnotation.js +199 -0
  154. package/dist/compiler/schemaGeneratedScalarShape.d.ts +34 -0
  155. package/dist/compiler/schemaGeneratedScalarShape.js +178 -0
  156. package/dist/compiler/schemaIdentityConstraints.d.ts +72 -0
  157. package/dist/compiler/schemaIdentityConstraints.js +362 -0
  158. package/dist/compiler/schemaIeeeLanguage.d.ts +42 -0
  159. package/dist/compiler/schemaIeeeLanguage.js +759 -0
  160. package/dist/compiler/schemaIntegerImages.d.ts +10 -0
  161. package/dist/compiler/schemaIntegerImages.js +113 -0
  162. package/dist/compiler/schemaLexicalPredicates.d.ts +28 -0
  163. package/dist/compiler/schemaLexicalPredicates.js +63 -0
  164. package/dist/compiler/schemaNotationProperties.d.ts +31 -0
  165. package/dist/compiler/schemaNotationProperties.js +84 -0
  166. package/dist/compiler/schemaNumericImageConditions.d.ts +23 -0
  167. package/dist/compiler/schemaNumericImageConditions.js +66 -0
  168. package/dist/compiler/schemaParticleWildcardProperties.d.ts +19 -0
  169. package/dist/compiler/schemaParticleWildcardProperties.js +43 -0
  170. package/dist/compiler/schemaPattern.d.ts +1061 -0
  171. package/dist/compiler/schemaPattern.js +581 -0
  172. package/dist/compiler/schemaRegularLanguage.d.ts +66 -0
  173. package/dist/compiler/schemaRegularLanguage.js +1166 -0
  174. package/dist/compiler/schemaScalarContext.d.ts +85 -0
  175. package/dist/compiler/schemaScalarContext.js +78 -0
  176. package/dist/compiler/schemaScalarKernel.d.ts +181 -0
  177. package/dist/compiler/schemaScalarKernel.js +391 -0
  178. package/dist/compiler/schemaScalarWitnesses.d.ts +5 -0
  179. package/dist/compiler/schemaScalarWitnesses.js +118 -0
  180. package/dist/compiler/schemaSimpleTypeProperties.d.ts +94 -0
  181. package/dist/compiler/schemaSimpleTypeProperties.js +103 -0
  182. package/dist/compiler/schemaSourceGrammar.d.ts +26 -0
  183. package/dist/compiler/schemaSourceGrammar.js +290 -0
  184. package/dist/compiler/schemaSourceLexical.d.ts +3 -0
  185. package/dist/compiler/schemaSourceLexical.js +12 -0
  186. package/dist/compiler/schemaSourceValues.d.ts +50 -0
  187. package/dist/compiler/schemaSourceValues.js +225 -0
  188. package/dist/compiler/schemaSourceWildcards.d.ts +27 -0
  189. package/dist/compiler/schemaSourceWildcards.js +249 -0
  190. package/dist/compiler/schemaSymbolicSequences.d.ts +15 -0
  191. package/dist/compiler/schemaSymbolicSequences.js +99 -0
  192. package/dist/compiler/schemaSymbolicValueSets.d.ts +31 -0
  193. package/dist/compiler/schemaSymbolicValueSets.js +149 -0
  194. package/dist/compiler/schemaSyntaxAssessment.d.ts +24 -0
  195. package/dist/compiler/schemaSyntaxAssessment.js +361 -0
  196. package/dist/compiler/schemaTemporalAliases.d.ts +5 -0
  197. package/dist/compiler/schemaTemporalAliases.js +195 -0
  198. package/dist/compiler/schemaTokenImages.d.ts +8 -0
  199. package/dist/compiler/schemaTokenImages.js +142 -0
  200. package/dist/compiler/schemaTypeIdentity.d.ts +38 -0
  201. package/dist/compiler/schemaTypeIdentity.js +80 -0
  202. package/dist/compiler/schemaTypeRelations.d.ts +37 -0
  203. package/dist/compiler/schemaTypeRelations.js +576 -0
  204. package/dist/compiler/schemaUri.d.ts +12 -0
  205. package/dist/compiler/schemaUri.js +103 -0
  206. package/dist/compiler/schemaValueContext.d.ts +25 -0
  207. package/dist/compiler/schemaValueContext.js +1 -0
  208. package/dist/compiler/schemaValueImages.d.ts +9 -0
  209. package/dist/compiler/schemaValueImages.js +142 -0
  210. package/dist/compiler/schemaValueSequences.d.ts +14 -0
  211. package/dist/compiler/schemaValueSequences.js +19 -0
  212. package/dist/compiler/semanticBudget.d.ts +67 -0
  213. package/dist/compiler/semanticBudget.js +193 -0
  214. package/dist/compiler/semanticCatalog.d.ts +121 -0
  215. package/dist/compiler/semanticCatalog.js +160 -0
  216. package/dist/compiler/semanticContext.d.ts +183 -0
  217. package/dist/compiler/semanticContext.js +1207 -0
  218. package/dist/compiler/semanticTypeDependencies.d.ts +7 -0
  219. package/dist/compiler/semanticTypeDependencies.js +64 -0
  220. package/dist/compiler/semanticTypeReference.d.ts +23 -0
  221. package/dist/compiler/semanticTypeReference.js +36 -0
  222. package/dist/compiler/shapeResolver.d.ts +1 -1
  223. package/dist/compiler/shapeResolver.js +7 -9
  224. package/dist/compiler/soapHeaders.d.ts +16 -0
  225. package/dist/compiler/soapHeaders.js +42 -0
  226. package/dist/compiler/sourceSchemaBinding.d.ts +25 -0
  227. package/dist/compiler/sourceSchemaBinding.js +39 -0
  228. package/dist/compiler/standardSchemaComponents.d.ts +71 -0
  229. package/dist/compiler/standardSchemaComponents.js +74 -0
  230. package/dist/compiler/standardSchemaConstruction.d.ts +20 -0
  231. package/dist/compiler/standardSchemaConstruction.js +34 -0
  232. package/dist/compiler/structuralCompanions.d.ts +15 -0
  233. package/dist/compiler/structuralCompanions.js +232 -0
  234. package/dist/compiler/validateSemanticGraph.d.ts +4 -0
  235. package/dist/compiler/validateSemanticGraph.js +376 -0
  236. package/dist/compiler/wildcardAlgebra.d.ts +25 -0
  237. package/dist/compiler/wildcardAlgebra.js +155 -0
  238. package/dist/compiler/wsdlPolicyRequirements.d.ts +43 -0
  239. package/dist/compiler/wsdlPolicyRequirements.js +239 -0
  240. package/dist/config.d.ts +0 -1
  241. package/dist/gateway/generateCheckedGateway.d.ts +32 -0
  242. package/dist/gateway/generateCheckedGateway.js +293 -0
  243. package/dist/gateway/generateGateway.d.ts +0 -1
  244. package/dist/gateway/generateGateway.js +2 -2
  245. package/dist/gateway/generators.d.ts +0 -1
  246. package/dist/gateway/helpers.d.ts +0 -1
  247. package/dist/generation/componentShape.d.ts +14 -0
  248. package/dist/generation/componentShape.js +269 -0
  249. package/dist/generation/preamble.d.ts +0 -1
  250. package/dist/generation/sourceLayout.d.ts +13 -0
  251. package/dist/generation/sourceLayout.js +40 -0
  252. package/dist/generation/writeGeneratedSource.d.ts +0 -1
  253. package/dist/index.d.ts +9 -1
  254. package/dist/index.js +3 -0
  255. package/dist/loader/fetch.d.ts +0 -1
  256. package/dist/loader/orderedSyntax.d.ts +84 -0
  257. package/dist/loader/orderedSyntax.js +222 -0
  258. package/dist/loader/resolutionDepth.d.ts +6 -0
  259. package/dist/loader/resolutionDepth.js +65 -0
  260. package/dist/loader/schemaInput.d.ts +80 -0
  261. package/dist/loader/schemaInput.js +249 -0
  262. package/dist/loader/schemaResources.d.ts +60 -0
  263. package/dist/loader/schemaResources.js +333 -0
  264. package/dist/loader/wsdlLoader.d.ts +0 -1
  265. package/dist/openapi/casing.d.ts +0 -1
  266. package/dist/openapi/generateOpenAPI.d.ts +0 -1
  267. package/dist/openapi/generateOpenAPI.js +2 -2
  268. package/dist/openapi/generatePaths.d.ts +0 -1
  269. package/dist/openapi/generateSchemas.d.ts +0 -1
  270. package/dist/openapi/security.d.ts +0 -1
  271. package/dist/pipeline.d.ts +6 -2
  272. package/dist/pipeline.js +13 -0
  273. package/dist/test/generateCheckedTests.d.ts +17 -0
  274. package/dist/test/generateCheckedTests.js +60 -0
  275. package/dist/test/generateTests.d.ts +0 -1
  276. package/dist/test/generateTests.js +2 -2
  277. package/dist/test/generators.d.ts +0 -1
  278. package/dist/test/mockData.d.ts +0 -1
  279. package/dist/test/mockData.js +20 -14
  280. package/dist/util/attributeWildcards.d.ts +0 -1
  281. package/dist/util/builder.d.ts +0 -1
  282. package/dist/util/catalogMeta.d.ts +0 -1
  283. package/dist/util/checkedCliDiagnostics.d.ts +11 -0
  284. package/dist/util/checkedCliDiagnostics.js +22 -0
  285. package/dist/util/cli.d.ts +0 -1
  286. package/dist/util/errors.d.ts +0 -1
  287. package/dist/util/imports.d.ts +0 -1
  288. package/dist/util/runtimeSource.d.ts +0 -1
  289. package/dist/util/runtimeSource.js +3 -5
  290. package/dist/util/securityConfig.d.ts +0 -1
  291. package/dist/util/streamConfig.d.ts +0 -1
  292. package/dist/util/tools.d.ts +0 -1
  293. package/dist/util/xmlWhitespace.d.ts +2 -0
  294. package/dist/util/xmlWhitespace.js +4 -0
  295. package/dist/xsd/primitives.d.ts +0 -1
  296. package/docs/agent-skill.md +2 -0
  297. package/docs/api-reference.md +1 -1
  298. package/docs/checked-gateway.md +210 -0
  299. package/docs/checked-generation.md +161 -0
  300. package/docs/cli-reference.md +43 -1
  301. package/docs/concepts.md +136 -1
  302. package/docs/configuration.md +5 -1
  303. package/docs/corpus.md +33 -0
  304. package/docs/direct-values.md +311 -0
  305. package/docs/examples/checked-forecast.wsdl +19 -0
  306. package/docs/gateway-guide.md +1 -1
  307. package/docs/generated-code.md +10 -5
  308. package/docs/mapping-contract.md +114 -0
  309. package/docs/migration-playbook.md +1 -1
  310. package/docs/output-anatomy.md +1 -1
  311. package/docs/start-here.md +8 -2
  312. package/docs/supported-patterns.md +17 -5
  313. package/docs/testing.md +117 -31
  314. package/llms.txt +7 -7
  315. package/package.json +79 -25
  316. package/src/generation/preambles/direct-client/typescript.preamble +3 -0
  317. package/src/runtime/checkedGatewayHost.tpl.txt +157 -0
  318. package/src/runtime/streamXml.ts +1 -1
  319. package/dist/app/generateApp.d.ts.map +0 -1
  320. package/dist/cli.d.ts.map +0 -1
  321. package/dist/client/generateClient.d.ts.map +0 -1
  322. package/dist/client/generateOperations.d.ts.map +0 -1
  323. package/dist/client/generateTypes.d.ts.map +0 -1
  324. package/dist/client/generateUtils.d.ts.map +0 -1
  325. package/dist/compiler/generateCatalog.d.ts.map +0 -1
  326. package/dist/compiler/schemaCompiler.d.ts.map +0 -1
  327. package/dist/compiler/shapeResolver.d.ts.map +0 -1
  328. package/dist/config.d.ts.map +0 -1
  329. package/dist/gateway/generateGateway.d.ts.map +0 -1
  330. package/dist/gateway/generators.d.ts.map +0 -1
  331. package/dist/gateway/helpers.d.ts.map +0 -1
  332. package/dist/generation/preamble.d.ts.map +0 -1
  333. package/dist/generation/writeGeneratedSource.d.ts.map +0 -1
  334. package/dist/index.d.ts.map +0 -1
  335. package/dist/loader/fetch.d.ts.map +0 -1
  336. package/dist/loader/wsdlLoader.d.ts.map +0 -1
  337. package/dist/openapi/casing.d.ts.map +0 -1
  338. package/dist/openapi/generateOpenAPI.d.ts.map +0 -1
  339. package/dist/openapi/generatePaths.d.ts.map +0 -1
  340. package/dist/openapi/generateSchemas.d.ts.map +0 -1
  341. package/dist/openapi/security.d.ts.map +0 -1
  342. package/dist/pipeline.d.ts.map +0 -1
  343. package/dist/runtime/jsonArray.d.ts +0 -24
  344. package/dist/runtime/jsonArray.d.ts.map +0 -1
  345. package/dist/runtime/jsonArray.js +0 -52
  346. package/dist/runtime/ndjson.d.ts +0 -24
  347. package/dist/runtime/ndjson.d.ts.map +0 -1
  348. package/dist/runtime/ndjson.js +0 -30
  349. package/dist/runtime/streamXml.d.ts +0 -45
  350. package/dist/runtime/streamXml.d.ts.map +0 -1
  351. package/dist/runtime/streamXml.js +0 -212
  352. package/dist/test/generateTests.d.ts.map +0 -1
  353. package/dist/test/generators.d.ts.map +0 -1
  354. package/dist/test/mockData.d.ts.map +0 -1
  355. package/dist/util/attributeWildcards.d.ts.map +0 -1
  356. package/dist/util/builder.d.ts.map +0 -1
  357. package/dist/util/catalogMeta.d.ts.map +0 -1
  358. package/dist/util/cli.d.ts.map +0 -1
  359. package/dist/util/errors.d.ts.map +0 -1
  360. package/dist/util/imports.d.ts.map +0 -1
  361. package/dist/util/runtimeSource.d.ts.map +0 -1
  362. package/dist/util/securityConfig.d.ts.map +0 -1
  363. package/dist/util/streamConfig.d.ts.map +0 -1
  364. package/dist/util/tools.d.ts.map +0 -1
  365. package/dist/xsd/primitives.d.ts.map +0 -1
  366. package/docs/AGENTS.md +0 -47
  367. package/docs/README.md +0 -56
  368. package/docs/architecture.md +0 -149
  369. package/docs/decisions/001-test-generation.md +0 -36
  370. package/docs/decisions/002-streamable-responses.md +0 -330
  371. package/docs/file-naming-and-path-organization.md +0 -213
  372. package/docs/releases/README.md +0 -94
  373. package/docs/releases/v0.20.0.md +0 -22
  374. package/docs/releases/v0.21.0.md +0 -30
  375. package/docs/releases/v0.22.0.md +0 -30
  376. package/docs/releases/v0.23.0.md +0 -31
  377. package/docs/releases/v0.24.0.md +0 -38
  378. package/docs/releases/v0.25.0.md +0 -31
  379. package/docs/releases/v0.25.2.md +0 -32
  380. package/docs/releases/v0.26.0.md +0 -32
  381. package/docs/releases/v0.27.0.md +0 -31
  382. package/docs/releases/v0.28.0.md +0 -32
  383. package/docs/releases/v0.29.0.md +0 -32
  384. package/docs/releases/v0.30.0.md +0 -30
  385. package/docs/releases/v0.30.1.md +0 -31
  386. package/docs/releases/v0.30.2.md +0 -30
  387. package/docs/releases/v0.30.3.md +0 -33
  388. package/docs/releases/v0.31.0.md +0 -33
  389. package/docs/releases/v0.32.0.md +0 -33
  390. package/docs/releases/v0.33.0.md +0 -34
  391. package/docs/releases/v0.34.0.md +0 -30
  392. package/docs/releases/v0.35.0.md +0 -33
  393. package/docs/releases/v0.36.0.md +0 -32
  394. package/docs/releases/v0.37.0.md +0 -33
  395. package/docs/releases/v0.38.0.md +0 -35
  396. package/docs/releases/v0.39.0.md +0 -35
  397. package/docs/releases/v0.40.0.md +0 -45
  398. package/docs/releases/v0.40.1.md +0 -34
  399. package/docs/releases/v1.0.0.md +0 -42
  400. package/docs/releases/v1.0.1.md +0 -38
  401. package/docs/releases/v1.0.2.md +0 -51
  402. package/docs/releases/v1.0.3.md +0 -37
  403. package/docs/releases/v1.0.4.md +0 -45
  404. package/docs/releases/v1.0.5.md +0 -41
  405. package/docs/releases/v1.0.6.md +0 -35
  406. package/docs/releases/v1.0.7.md +0 -36
  407. package/docs/releases/v1.1.0.md +0 -42
  408. package/docs/releases/v1.1.1.md +0 -44
  409. package/docs/releases/v1.1.2.md +0 -42
  410. package/docs/releases/v1.1.3.md +0 -36
  411. package/docs/releases/v1.1.4.md +0 -36
  412. package/docs/roadmap/README.md +0 -107
  413. package/docs/roadmap/v1.0-capability-conformance-framework.md +0 -582
  414. package/docs/roadmap/v1.0-choice-union-mode.md +0 -90
  415. package/docs/roadmap/v1.0-contract-audit.md +0 -75
  416. package/docs/roadmap/v1.0-json-array-streaming.md +0 -101
  417. package/docs/roadmap/v1.0-openapi-fastify-compatibility.md +0 -99
  418. package/docs/roadmap/v1.0-release-candidate-gates.md +0 -92
  419. package/docs/roadmap/v1.0-wsdl-coverage-matrix.md +0 -200
  420. package/docs/roadmap/v1.0-xs-anyattribute-wildcard-bag.md +0 -932
  421. package/src/runtime/jsonArray.ts +0 -55
  422. package/src/runtime/ndjson.ts +0 -32
@@ -0,0 +1,381 @@
1
+ /** Pure two-phase construction from the repository-owned S03 adapter; no I/O or expansion. */
2
+ import { resolveLexicalQName, syntaxAttribute, syntaxElements, XSD_NAMESPACE, WSDL_NAMESPACE } from "../loader/orderedSyntax.js";
3
+ import { DEFAULT_GRAPH_NODES, GRAPH_MODEL, GraphError, globalId, scopedId, deepFreeze, isBuiltinType, wsdlReferenceRoles } from "./canonicalGraph.js";
4
+ import { mapNodeReferences } from "./graphTraversal.js";
5
+ const declarationRoles = Object.assign(Object.create(null), { element: "element", attribute: "attribute", simpleType: "type", complexType: "type", group: "group", attributeGroup: "attributeGroup" });
6
+ const particleKinds = new Set(["sequence", "choice", "all", "element", "group", "any"]);
7
+ const facetKinds = new Set(["enumeration", "pattern", "whiteSpace", "length", "minLength", "maxLength", "minInclusive", "minExclusive", "maxInclusive", "maxExclusive", "totalDigits", "fractionDigits"]);
8
+ export function buildCanonicalGraph(input, options = {}) {
9
+ let allocated = 0;
10
+ const chargeText = (text) => options.requestBudget?.chargeWork(64 + text.length * 16);
11
+ const maxNodes = options.maxNodes ?? DEFAULT_GRAPH_NODES;
12
+ if (!Number.isSafeInteger(maxNodes) || maxNodes < 1)
13
+ throw new RangeError("maxNodes must be a positive safe integer");
14
+ // Precharge the source-sized reservation/indexing scans independently of source preparation.
15
+ options.requestBudget?.freeze(input);
16
+ const nodes = new Map();
17
+ const scopedRoles = new Map();
18
+ const reserved = new Map();
19
+ const origins = Object.create(null);
20
+ const annotations = [];
21
+ const schemaRetained = [];
22
+ const fail = (node, message) => { throw new GraphError("invalid-schema", message, node.source); };
23
+ const elementOnly = (node) => {
24
+ if (node.children.some(c => c.kind === "text" && /[^\t\r\n ]/.test(c.value)))
25
+ fail(node, "Non-whitespace text in element-only schema content");
26
+ };
27
+ const context = (node, schema) => {
28
+ options.requestBudget?.freeze(node);
29
+ chargeText(node.source.uri);
30
+ chargeText(node.source.path);
31
+ chargeText(node.baseUri);
32
+ chargeText(schema.targetNamespace);
33
+ for (const [prefix, namespace] of Object.entries(node.namespaces)) {
34
+ chargeText(prefix);
35
+ chargeText(namespace);
36
+ }
37
+ return ({ namespaces: node.namespaces, baseUri: node.baseUri, source: node.source,
38
+ effectiveNamespace: schema.targetNamespace, chameleon: schema.context.kind === "include" && !syntaxAttribute(schema.syntax, "targetNamespace"), schemaAttributes: schema.syntax.attributes });
39
+ };
40
+ const lexical = (value, node, scope) => { chargeText(value); return { value, context: context(node, scope.schema) }; };
41
+ const required = (node, name) => syntaxAttribute(node, name) ?? fail(node, `Missing ${name} attribute`);
42
+ const bool = (node, name, fallback = false) => {
43
+ const v = syntaxAttribute(node, name);
44
+ if (v === undefined)
45
+ return fallback;
46
+ if (["true", "1"].includes(v.trim()))
47
+ return true;
48
+ if (["false", "0"].includes(v.trim()))
49
+ return false;
50
+ return fail(node, `Invalid ${name} boolean`);
51
+ };
52
+ const choice = (node, attr, allowed, fallback) => {
53
+ const value = syntaxAttribute(node, attr)?.trim() ?? fallback;
54
+ if (!allowed.includes(value))
55
+ return fail(node, `Invalid ${attr} value`);
56
+ return value;
57
+ };
58
+ const named = (node, namespace) => {
59
+ const local = required(node, "name");
60
+ chargeText(local);
61
+ chargeText(namespace);
62
+ // Validate NCName through the adapter without letting the default namespace define identity.
63
+ const resolved = resolveLexicalQName(local, node);
64
+ if (local.includes(":"))
65
+ return fail(node, "Declaration name must be an NCName");
66
+ return { namespace, local: resolved.local };
67
+ };
68
+ const occurrence = (node) => {
69
+ const finite = (v) => {
70
+ const trimmed = v.trim();
71
+ if (!/^[+-]?\d+$/.test(trimmed))
72
+ return fail(node, "Occurrence must be a nonnegative integer");
73
+ const canonical = trimmed.replace(/^[+-]/, "").replace(/^0+(?=\d)/, "");
74
+ if (trimmed.startsWith("-") && canonical !== "0")
75
+ return fail(node, "Occurrence must be a nonnegative integer");
76
+ return canonical;
77
+ };
78
+ const min = finite(syntaxAttribute(node, "minOccurs") ?? "1");
79
+ const rawMax = syntaxAttribute(node, "maxOccurs")?.trim() ?? "1";
80
+ const max = rawMax === "unbounded" ? rawMax : finite(rawMax);
81
+ if (max !== "unbounded" && (min.length > max.length || (min.length === max.length && min > max)))
82
+ return fail(node, "Occurrence minimum exceeds maximum");
83
+ return { min, max };
84
+ };
85
+ const ref = (value, role, node, scope) => {
86
+ chargeText(value);
87
+ const lexicalName = resolveLexicalQName(value, node);
88
+ // XSD chameleon adoption changes component interpretation, never lexical namespace bindings.
89
+ const name = !lexicalName.namespace && context(node, scope.schema).chameleon
90
+ ? { namespace: scope.schema.targetNamespace, local: lexicalName.local } : lexicalName;
91
+ if (role === "type" && name.namespace === XSD_NAMESPACE && isBuiltinType(name.local))
92
+ return { kind: "builtin", name, lexical: lexical(value, node, scope) };
93
+ return { kind: "symbol", role, name, lexical: lexical(value, node, scope) };
94
+ };
95
+ const builtin = (local) => ({ kind: "builtin", name: { namespace: XSD_NAMESPACE, local } });
96
+ const idFor = (node, scope, role) => {
97
+ chargeText(node.source.path);
98
+ chargeText(scope.owner);
99
+ chargeText(scope.rootPath);
100
+ const id = scopedId(scope.owner, node.source.path.slice(scope.rootPath.length) || "/", role);
101
+ scopedRoles.set(id, role);
102
+ return id;
103
+ };
104
+ const base = (node, scope, id, identity, consumed = []) => {
105
+ if (allocated >= maxNodes)
106
+ throw new GraphError("resource-limit", `Canonical graph exceeds ${maxNodes} nodes`, node.source);
107
+ options.requestBudget?.reserveNodes(1);
108
+ allocated += 1;
109
+ // Retained syntax/namespaces are charged before constructing the record.
110
+ options.requestBudget?.freeze(node);
111
+ if (node.name.namespace === XSD_NAMESPACE)
112
+ elementOnly(node);
113
+ return { id,
114
+ identity: identity ?? { kind: "scoped", owner: scope.owner, path: node.source.path.slice(scope.rootPath.length) || "/", role: scopedRoles.get(id) },
115
+ context: context(node, scope.schema), declaredAttributes: node.attributes,
116
+ annotations: syntaxElements(node, XSD_NAMESPACE, "annotation"), syntaxDetails: [],
117
+ retained: syntaxElements(node).filter(c => c.name.namespace !== XSD_NAMESPACE || (c.name.local !== "annotation" && !consumed.includes(c.name.local))) };
118
+ };
119
+ const put = (node, scope) => {
120
+ options.requestBudget?.chargeWork(1024);
121
+ if (nodes.has(node.id))
122
+ throw new GraphError("invalid-schema", "Duplicate scoped graph identity", node.context.source);
123
+ if (nodes.size >= maxNodes)
124
+ throw new GraphError("resource-limit", `Canonical graph exceeds ${maxNodes} nodes`, node.context.source);
125
+ nodes.set(node.id, node);
126
+ origins[node.id] = [{ interpretation: scope.schema.key, context: node.context }];
127
+ return node.id;
128
+ };
129
+ const valueConstraint = (node, scope) => {
130
+ const d = syntaxAttribute(node, "default"), f = syntaxAttribute(node, "fixed");
131
+ if (d !== undefined && f !== undefined)
132
+ return fail(node, "Default and fixed are mutually exclusive");
133
+ return d !== undefined ? { kind: "default", lexical: lexical(d, node, scope) } : f !== undefined ? { kind: "fixed", lexical: lexical(f, node, scope) } : undefined;
134
+ };
135
+ const facets = (node, scope) => syntaxElements(node, XSD_NAMESPACE).filter(n => facetKinds.has(n.name.local)).map(n => ({ name: n.name.local,
136
+ lexical: lexical(required(n, "value"), n, scope), fixed: bool(n, "fixed"), syntax: n }));
137
+ const wildcard = (node, scope) => ({ namespace: lexical(syntaxAttribute(node, "namespace") ?? "##any", node, scope),
138
+ processContents: choice(node, "processContents", ["strict", "lax", "skip"], "strict") });
139
+ const one = (nodes, node, description) => {
140
+ if (nodes.length > 1)
141
+ return fail(node, `Multiple ${description}`);
142
+ return nodes[0];
143
+ };
144
+ const typeFor = (node, scope, fallback) => {
145
+ const type = syntaxAttribute(node, "type");
146
+ const inline = one(syntaxElements(node, XSD_NAMESPACE).filter(c => ["simpleType", "complexType"].includes(c.name.local)), node, "inline types");
147
+ if (type && inline)
148
+ return fail(node, "Named and inline types are mutually exclusive");
149
+ return type !== undefined ? ref(type, "type", node, scope) : inline ? { kind: "local", target: buildType(inline, scope) } : builtin(fallback);
150
+ };
151
+ const declaration = (node, scope, role, global) => {
152
+ if (syntaxAttribute(node, "ref") !== undefined)
153
+ return fail(node, "Reference is a use, not a declaration");
154
+ if (global && (syntaxAttribute(node, "minOccurs") !== undefined || syntaxAttribute(node, "maxOccurs") !== undefined || syntaxAttribute(node, "form") !== undefined))
155
+ return fail(node, "Global declarations cannot carry occurrence or form");
156
+ const form = choice(node, "form", ["qualified", "unqualified"], choice(scope.schema.syntax, role === "element" ? "elementFormDefault" : "attributeFormDefault", ["qualified", "unqualified"], "unqualified"));
157
+ const name = named(node, global || form === "qualified" ? scope.schema.targetNamespace : "");
158
+ const id = global ? globalId(role, name) : idFor(node, scope, role);
159
+ const inner = { schema: scope.schema, owner: id, rootPath: node.source.path };
160
+ const common = { ...base(node, scope, id, global, ["simpleType", "complexType"]), name, type: typeFor(node, inner, role === "element" ? "anyType" : "anySimpleType"), value: valueConstraint(node, scope) };
161
+ if (role === "attribute") {
162
+ if (syntaxElements(node, XSD_NAMESPACE, "complexType").length)
163
+ return fail(node, "Attributes require simple types");
164
+ return put({ ...common, kind: "attribute" }, scope);
165
+ }
166
+ const sg = syntaxAttribute(node, "substitutionGroup");
167
+ return put({ ...common, kind: "element", nillable: bool(node, "nillable"), abstract: bool(node, "abstract"), substitutionGroup: sg === undefined ? undefined : ref(sg, "element", node, scope) }, scope);
168
+ };
169
+ const particle = (node, scope) => {
170
+ const id = idFor(node, scope, "particle"), occurs = occurrence(node);
171
+ const common = { ...base(node, scope, id, undefined, ["sequence", "choice", "all", "element", "group", "any"]), kind: "particle", occurs };
172
+ const kind = node.name.local;
173
+ if (["sequence", "choice", "all"].includes(kind)) {
174
+ const children = syntaxElements(node, XSD_NAMESPACE).filter(c => particleKinds.has(c.name.local));
175
+ if (children.some(c => c.name.local === "all"))
176
+ return fail(node, "XSD 1.0 all cannot be nested inside a compositor");
177
+ if (kind === "all" && (occurs.max !== "1" || !["0", "1"].includes(occurs.min)))
178
+ return fail(node, "XSD 1.0 all requires min 0/1 and max 1");
179
+ if (kind === "all" && children.some(c => c.name.local !== "element" || !["0", "1"].includes(occurrence(c).min) || !["0", "1"].includes(occurrence(c).max)))
180
+ return fail(node, "XSD 1.0 all children must be elements with 0/1 bounds");
181
+ return put({ ...common, term: { kind: kind, children: children.map(c => particle(c, scope)) } }, scope);
182
+ }
183
+ if (kind === "any")
184
+ return put({ ...common, term: { kind: "any", wildcard: wildcard(node, scope) } }, scope);
185
+ if (kind === "group") {
186
+ if (syntaxAttribute(node, "name") !== undefined || syntaxElements(node, XSD_NAMESPACE).some(c => particleKinds.has(c.name.local)))
187
+ return fail(node, "Group uses require only a reference");
188
+ return put({ ...common, term: { kind: "group", reference: ref(required(node, "ref"), "group", node, scope) } }, scope);
189
+ }
190
+ const r = syntaxAttribute(node, "ref");
191
+ if (r !== undefined && ["name", "type", "form", "default", "fixed", "nillable"].some(a => syntaxAttribute(node, a) !== undefined))
192
+ return fail(node, "Element references cannot redeclare their target");
193
+ if (r !== undefined && syntaxElements(node, XSD_NAMESPACE).some(c => c.name.local !== "annotation"))
194
+ return fail(node, "Element references cannot contain declarations");
195
+ return put({ ...common, term: { kind: "element", declaration: r !== undefined ? ref(r, "element", node, scope) : { kind: "local", target: declaration(node, scope, "element") } } }, scope);
196
+ };
197
+ const attributes = (node, scope) => syntaxElements(node, XSD_NAMESPACE).filter(c => ["attribute", "attributeGroup", "anyAttribute"].includes(c.name.local)).map(c => {
198
+ const id = idFor(c, scope, "attributeUse"), common = base(c, scope, id, undefined, ["simpleType"]);
199
+ if (c.name.local === "anyAttribute")
200
+ return put({ ...common, kind: "attributeWildcard", wildcard: wildcard(c, scope) }, scope);
201
+ if (c.name.local === "attributeGroup")
202
+ return put({ ...common, kind: "attributeGroupUse", reference: ref(required(c, "ref"), "attributeGroup", c, scope) }, scope);
203
+ const r = syntaxAttribute(c, "ref");
204
+ if (r !== undefined && ["name", "type", "form"].some(a => syntaxAttribute(c, a) !== undefined))
205
+ return fail(c, "Attribute references cannot redeclare their target");
206
+ if (r !== undefined && syntaxElements(c, XSD_NAMESPACE).some(n => n.name.local !== "annotation"))
207
+ return fail(c, "Attribute references cannot contain declarations");
208
+ return put({ ...common, kind: "attributeUse", declaration: r !== undefined ? ref(r, "attribute", c, scope) : { kind: "local", target: declaration(c, scope, "attribute") },
209
+ use: choice(c, "use", ["optional", "required", "prohibited"], "optional"), value: valueConstraint(c, scope) }, scope);
210
+ });
211
+ const buildType = (node, scope, global) => {
212
+ const id = global?.kind === "global" ? globalId("type", global.name) : idFor(node, scope, "type");
213
+ const inner = { schema: scope.schema, owner: id, rootPath: node.source.path };
214
+ const inlineSimple = (container) => {
215
+ const inline = one(syntaxElements(container, XSD_NAMESPACE, "simpleType"), container, "inline simple types");
216
+ return inline ? { kind: "local", target: buildType(inline, inner) } : undefined;
217
+ };
218
+ if (node.name.local === "simpleType") {
219
+ const body = one(syntaxElements(node, XSD_NAMESPACE).filter(c => ["restriction", "list", "union"].includes(c.name.local)), node, "simple type varieties") ?? fail(node, "Simple type requires restriction, list or union");
220
+ elementOnly(body);
221
+ const common = { ...base(node, scope, id, global, ["restriction", "list", "union"]), kind: "simpleType",
222
+ annotations: [...syntaxElements(node, XSD_NAMESPACE, "annotation"), ...syntaxElements(body, XSD_NAMESPACE, "annotation")], syntaxDetails: [body],
223
+ retained: [...syntaxElements(node).filter(c => c.name.namespace !== XSD_NAMESPACE || !["annotation", "restriction", "list", "union"].includes(c.name.local)),
224
+ ...syntaxElements(body).filter(c => c.name.namespace !== XSD_NAMESPACE || !["annotation", "simpleType", ...(body.name.local === "restriction" ? [...facetKinds] : [])].includes(c.name.local))] };
225
+ if (body.name.local === "union") {
226
+ const members = (syntaxAttribute(body, "memberTypes")?.trim().split(/\s+/).filter(Boolean) ?? []).map(v => ref(v, "type", body, inner));
227
+ for (const c of syntaxElements(body, XSD_NAMESPACE, "simpleType"))
228
+ members.push({ kind: "local", target: buildType(c, inner) });
229
+ if (!members.length)
230
+ return fail(body, "Union requires members");
231
+ return put({ ...common, variety: { kind: "union", members } }, scope);
232
+ }
233
+ const attr = body.name.local === "list" ? "itemType" : "base";
234
+ const value = syntaxAttribute(body, attr), inline = inlineSimple(body);
235
+ if (value !== undefined && inline)
236
+ return fail(body, "Named and inline scalar references are mutually exclusive");
237
+ const reference = value !== undefined ? ref(value, "type", body, inner) : inline ?? fail(body, `Missing ${attr} or inline type`);
238
+ return put({ ...common, variety: body.name.local === "list" ? { kind: "list", item: reference } : { kind: "restriction", base: reference, facets: facets(body, inner) } }, scope);
239
+ }
240
+ const wrapper = one(syntaxElements(node, XSD_NAMESPACE).filter(c => ["simpleContent", "complexContent"].includes(c.name.local)), node, "content wrappers");
241
+ const body = wrapper ? one(syntaxElements(wrapper, XSD_NAMESPACE).filter(c => ["extension", "restriction"].includes(c.name.local)), wrapper, "derivations") ?? fail(wrapper, "Missing content derivation") : node;
242
+ if (wrapper) {
243
+ elementOnly(wrapper);
244
+ elementOnly(body);
245
+ }
246
+ if (wrapper && syntaxElements(node, XSD_NAMESPACE).some(c => particleKinds.has(c.name.local) || ["attribute", "attributeGroup", "anyAttribute"].includes(c.name.local)))
247
+ return fail(node, "Content wrappers cannot coexist with direct content");
248
+ const content = one(syntaxElements(body, XSD_NAMESPACE).filter(c => particleKinds.has(c.name.local)), body, "content particles");
249
+ if (content && !["sequence", "choice", "all", "group"].includes(content.name.local))
250
+ return fail(content, "Complex type content requires a compositor or group reference");
251
+ if (content && wrapper?.name.local === "simpleContent")
252
+ return fail(content, "Simple content cannot contain a particle");
253
+ return put({ ...base(node, scope, id, global, ["simpleContent", "complexContent", "sequence", "choice", "all", "group", "attribute", "attributeGroup", "anyAttribute"]),
254
+ kind: "complexType", mixed: wrapper ? bool(wrapper, "mixed", bool(node, "mixed")) : bool(node, "mixed"), abstract: bool(node, "abstract"),
255
+ annotations: [...syntaxElements(node, XSD_NAMESPACE, "annotation"), ...(wrapper ? [...syntaxElements(wrapper, XSD_NAMESPACE, "annotation"), ...syntaxElements(body, XSD_NAMESPACE, "annotation")] : [])],
256
+ syntaxDetails: wrapper ? [wrapper] : [],
257
+ retained: [...syntaxElements(node).filter(c => c.name.namespace !== XSD_NAMESPACE || !["annotation", "simpleContent", "complexContent", ...particleKinds, "attribute", "attributeGroup", "anyAttribute"].includes(c.name.local)),
258
+ ...(wrapper ? [...syntaxElements(wrapper).filter(c => c.name.namespace !== XSD_NAMESPACE || !["annotation", "extension", "restriction"].includes(c.name.local)),
259
+ ...syntaxElements(body).filter(c => c.name.namespace !== XSD_NAMESPACE || !["annotation", ...(wrapper.name.local === "simpleContent" && body.name.local === "restriction" ? ["simpleType"] : []), ...particleKinds, ...facetKinds, "attribute", "attributeGroup", "anyAttribute"].includes(c.name.local))] : [])],
260
+ content: content ? particle(content, inner) : undefined, attributes: attributes(body, inner),
261
+ derivation: wrapper ? { kind: body.name.local, contentKind: wrapper.name.local === "simpleContent" ? "simple" : "complex",
262
+ base: ref(required(body, "base"), "type", body, inner), inlineType: wrapper.name.local === "simpleContent" && body.name.local === "restriction" ? inlineSimple(body) : undefined,
263
+ facets: facets(body, inner) } : undefined }, scope);
264
+ };
265
+ // Phase 1: reserve global symbol space, independent of interpretation keys and traversal order.
266
+ for (const schema of input.schemas) {
267
+ elementOnly(schema.syntax);
268
+ annotations.push(...syntaxElements(schema.syntax, XSD_NAMESPACE, "annotation"));
269
+ for (const child of syntaxElements(schema.syntax)) {
270
+ if (child.name.namespace !== XSD_NAMESPACE || !["annotation", ...Object.keys(declarationRoles)].includes(child.name.local))
271
+ schemaRetained.push({ context: context(child, schema), syntax: child });
272
+ }
273
+ for (const node of syntaxElements(schema.syntax, XSD_NAMESPACE)) {
274
+ const role = declarationRoles[node.name.local];
275
+ if (!role)
276
+ continue;
277
+ const name = named(node, schema.targetNamespace), id = globalId(role, name), prior = reserved.get(id);
278
+ if (prior) {
279
+ if (prior.node.source.digest !== node.source.digest || prior.node.source.path !== node.source.path)
280
+ fail(node, "Conflicting global symbol declarations");
281
+ }
282
+ else {
283
+ if (reserved.size >= maxNodes)
284
+ throw new GraphError("resource-limit", `Canonical graph exceeds ${maxNodes} declarations`, node.source);
285
+ reserved.set(id, { node, schema });
286
+ }
287
+ }
288
+ }
289
+ // Phase 2: build complete bodies. References are linked afterward, never expanded into stubs.
290
+ for (const [id, { node, schema }] of reserved) {
291
+ const scope = { schema, owner: id, rootPath: node.source.path };
292
+ const role = declarationRoles[node.name.local], identity = { kind: "global", role, name: named(node, schema.targetNamespace) };
293
+ if (role === "type")
294
+ buildType(node, scope, identity);
295
+ else if (role === "element" || role === "attribute")
296
+ declaration(node, scope, role, identity);
297
+ else if (role === "group") {
298
+ const content = one(syntaxElements(node, XSD_NAMESPACE).filter(c => ["sequence", "choice", "all"].includes(c.name.local)), node, "group content") ?? fail(node, "Group requires compositor content");
299
+ if (syntaxAttribute(content, "minOccurs") !== undefined || syntaxAttribute(content, "maxOccurs") !== undefined)
300
+ fail(content, "Group definition content cannot carry occurrence bounds");
301
+ put({ ...base(node, scope, id, identity, ["sequence", "choice", "all"]), kind: "group", content: particle(content, scope) }, scope);
302
+ }
303
+ else
304
+ put({ ...base(node, scope, id, identity, ["attribute", "attributeGroup", "anyAttribute"]), kind: "attributeGroup", attributes: attributes(node, scope) }, scope);
305
+ }
306
+ // WSDL references remain ordered and role-qualified for later operation/binding planning.
307
+ for (const doc of input.documents) {
308
+ if (doc.root.name.namespace !== WSDL_NAMESPACE)
309
+ continue;
310
+ const namespace = syntaxAttribute(doc.root, "targetNamespace") ?? "";
311
+ const schema = { key: doc.uri, syntax: doc.root, documentUri: doc.uri, digest: doc.digest, baseUri: doc.root.baseUri, targetNamespace: namespace, context: { kind: "root", namespace } };
312
+ for (const node of syntaxElements(doc.root, WSDL_NAMESPACE).filter(n => ["message", "portType", "binding", "service"].includes(n.name.local))) {
313
+ const role = node.name.local, name = named(node, namespace), id = globalId(role, name);
314
+ const scope = { schema, owner: id, rootPath: node.source.path };
315
+ const references = [];
316
+ const visit = (n) => {
317
+ options.requestBudget?.freeze(n);
318
+ const roles = wsdlReferenceRoles(n);
319
+ for (const [attribute, targetRole] of Object.entries(roles)) {
320
+ const value = syntaxAttribute(n, attribute);
321
+ if (value !== undefined)
322
+ references.push({ path: n.source.path.slice(node.source.path.length) || "/", attribute, reference: ref(value, targetRole, n, scope) });
323
+ }
324
+ for (const c of syntaxElements(n))
325
+ visit(c);
326
+ };
327
+ visit(node);
328
+ put({ ...base(node, scope, id, { kind: "global", role, name }), retained: [], kind: "wsdl", role, name, syntax: node, references }, scope);
329
+ }
330
+ }
331
+ const link = (r) => {
332
+ options.requestBudget?.chargeWork(128);
333
+ if (r.kind !== "symbol")
334
+ return r;
335
+ chargeText(r.name.namespace);
336
+ chargeText(r.name.local);
337
+ const target = globalId(r.role, r.name);
338
+ return { ...r, ...(nodes.has(target) ? { target } : {}) };
339
+ };
340
+ const linkNode = (node) => mapNodeReferences(node, link);
341
+ // All loading contexts remain provenance; they do not multiply global symbols or local bodies.
342
+ const ownerCache = new Map();
343
+ const rootOwner = (n) => {
344
+ options.requestBudget?.chargeWork(64 + n.id.length * 4);
345
+ if (n.identity.kind === "global")
346
+ return n.id;
347
+ const prior = ownerCache.get(n.id);
348
+ if (prior)
349
+ return prior;
350
+ const owner = rootOwner(nodes.get(n.identity.owner));
351
+ ownerCache.set(n.id, owner);
352
+ return owner;
353
+ };
354
+ const owned = new Map();
355
+ for (const n of nodes.values()) {
356
+ const owner = rootOwner(n), group = owned.get(owner) ?? [];
357
+ group.push(n);
358
+ owned.set(owner, group);
359
+ }
360
+ for (const schema of input.schemas)
361
+ for (const node of syntaxElements(schema.syntax, XSD_NAMESPACE)) {
362
+ const role = declarationRoles[node.name.local];
363
+ if (!role)
364
+ continue;
365
+ const id = globalId(role, named(node, schema.targetNamespace));
366
+ if (!origins[id].some(o => o.interpretation === schema.key)) {
367
+ const paths = new Map();
368
+ const visit = (n) => { options.requestBudget?.freeze(n); paths.set(n.source.path, n); for (const c of syntaxElements(n))
369
+ visit(c); };
370
+ visit(node);
371
+ for (const n of owned.get(id) ?? [])
372
+ origins[n.id].push({ interpretation: schema.key, context: context(paths.get(n.context.source.path), schema) });
373
+ }
374
+ }
375
+ const data = [...nodes.values()];
376
+ const ordered = options.requestBudget ? options.requestBudget.sorted(data, (a, b) => options.requestBudget.compareText(a.id, b.id)) : data.sort((a, b) => a.id < b.id ? -1 : a.id > b.id ? 1 : 0);
377
+ const result = { model: GRAPH_MODEL, nodes: ordered.map(linkNode),
378
+ globals: ordered.filter(n => n.identity.kind === "global").map(n => n.id), origins,
379
+ schemaAnnotations: annotations, schemaRetained, loading: { limits: input.limits, edges: input.edges } };
380
+ return options.requestBudget ? options.requestBudget.freeze(result) : deepFreeze(result);
381
+ }
@@ -0,0 +1,197 @@
1
+ import type { ExpandedName, SyntaxAttribute, SyntaxElement, SyntaxSource } from "../loader/orderedSyntax.js";
2
+ export declare const GRAPH_MODEL: "xsd10-faithful-v1";
3
+ export declare const DEFAULT_GRAPH_NODES = 100000;
4
+ export declare const isBuiltinType: (local: string) => boolean;
5
+ export type NodeId = string;
6
+ export type SymbolRole = "element" | "attribute" | "type" | "group" | "attributeGroup" | "message" | "portType" | "binding" | "service";
7
+ export type Identity = Readonly<{
8
+ kind: "global";
9
+ role: SymbolRole;
10
+ name: ExpandedName;
11
+ } | {
12
+ kind: "scoped";
13
+ owner: NodeId;
14
+ path: string;
15
+ role: string;
16
+ }>;
17
+ export type GraphContext = Readonly<{
18
+ namespaces: Readonly<Record<string, string>>;
19
+ baseUri: string;
20
+ source: SyntaxSource;
21
+ effectiveNamespace: string;
22
+ chameleon: boolean;
23
+ schemaAttributes: readonly SyntaxAttribute[];
24
+ }>;
25
+ export type LexicalValue = Readonly<{
26
+ value: string;
27
+ context: GraphContext;
28
+ }>;
29
+ export type Reference = Readonly<{
30
+ kind: "symbol";
31
+ role: SymbolRole;
32
+ name: ExpandedName;
33
+ lexical: LexicalValue;
34
+ target?: NodeId;
35
+ } | {
36
+ kind: "builtin";
37
+ name: ExpandedName;
38
+ lexical?: LexicalValue;
39
+ } | {
40
+ kind: "local";
41
+ target: NodeId;
42
+ }>;
43
+ /** Canonical unsigned decimal strings; no Number conversion or derived occurrence summaries. */
44
+ export type Occurs = Readonly<{
45
+ min: string;
46
+ max: string | "unbounded";
47
+ }>;
48
+ export type ValueConstraint = Readonly<{
49
+ kind: "default" | "fixed";
50
+ lexical: LexicalValue;
51
+ }>;
52
+ export type Facet = Readonly<{
53
+ name: string;
54
+ lexical: LexicalValue;
55
+ fixed: boolean;
56
+ syntax: SyntaxElement;
57
+ }>;
58
+ export type Wildcard = Readonly<{
59
+ namespace: LexicalValue;
60
+ processContents: "strict" | "lax" | "skip";
61
+ }>;
62
+ type NodeBase = Readonly<{
63
+ id: NodeId;
64
+ identity: Identity;
65
+ context: GraphContext;
66
+ declaredAttributes: readonly SyntaxAttribute[];
67
+ annotations: readonly SyntaxElement[];
68
+ /** Unsupported/uninterpreted declarations remain visible for S06 capability assessment. */
69
+ retained: readonly SyntaxElement[];
70
+ /** Ordered restriction/list/union or content-wrapper syntax, including unassessed attributes. */
71
+ syntaxDetails: readonly SyntaxElement[];
72
+ }>;
73
+ export type ElementNode = NodeBase & Readonly<{
74
+ kind: "element";
75
+ name: ExpandedName;
76
+ type: Reference;
77
+ nillable: boolean;
78
+ abstract: boolean;
79
+ value?: ValueConstraint;
80
+ substitutionGroup?: Reference;
81
+ }>;
82
+ export type AttributeNode = NodeBase & Readonly<{
83
+ kind: "attribute";
84
+ name: ExpandedName;
85
+ type: Reference;
86
+ value?: ValueConstraint;
87
+ }>;
88
+ export type ParticleNode = NodeBase & Readonly<{
89
+ kind: "particle";
90
+ occurs: Occurs;
91
+ term: Readonly<{
92
+ kind: "sequence" | "choice" | "all";
93
+ children: readonly NodeId[];
94
+ } | {
95
+ kind: "element";
96
+ declaration: Reference;
97
+ } | {
98
+ kind: "group";
99
+ reference: Reference;
100
+ } | {
101
+ kind: "any";
102
+ wildcard: Wildcard;
103
+ }>;
104
+ }>;
105
+ export type AttributeUseNode = NodeBase & Readonly<{
106
+ kind: "attributeUse";
107
+ declaration: Reference;
108
+ use: "optional" | "required" | "prohibited";
109
+ value?: ValueConstraint;
110
+ }>;
111
+ export type AttributeGroupUseNode = NodeBase & Readonly<{
112
+ kind: "attributeGroupUse";
113
+ reference: Reference;
114
+ }>;
115
+ export type AttributeWildcardNode = NodeBase & Readonly<{
116
+ kind: "attributeWildcard";
117
+ wildcard: Wildcard;
118
+ }>;
119
+ export type SimpleTypeNode = NodeBase & Readonly<{
120
+ kind: "simpleType";
121
+ variety: Readonly<{
122
+ kind: "restriction";
123
+ base: Reference;
124
+ facets: readonly Facet[];
125
+ } | {
126
+ kind: "list";
127
+ item: Reference;
128
+ } | {
129
+ kind: "union";
130
+ members: readonly Reference[];
131
+ }>;
132
+ }>;
133
+ export type ComplexTypeNode = NodeBase & Readonly<{
134
+ kind: "complexType";
135
+ mixed: boolean;
136
+ abstract: boolean;
137
+ content?: NodeId;
138
+ attributes: readonly NodeId[];
139
+ derivation?: Readonly<{
140
+ kind: "extension" | "restriction";
141
+ contentKind: "simple" | "complex";
142
+ base: Reference;
143
+ inlineType?: Reference;
144
+ facets: readonly Facet[];
145
+ }>;
146
+ }>;
147
+ export type GroupNode = NodeBase & Readonly<{
148
+ kind: "group";
149
+ content: NodeId;
150
+ }>;
151
+ export type AttributeGroupNode = NodeBase & Readonly<{
152
+ kind: "attributeGroup";
153
+ attributes: readonly NodeId[];
154
+ }>;
155
+ /** WSDL names/references and ordered binding syntax; transport interpretation remains downstream. */
156
+ export type WsdlNode = NodeBase & Readonly<{
157
+ kind: "wsdl";
158
+ role: "message" | "portType" | "binding" | "service";
159
+ name: ExpandedName;
160
+ references: readonly Readonly<{
161
+ path: string;
162
+ attribute: string;
163
+ reference: Reference;
164
+ }>[];
165
+ syntax: SyntaxElement;
166
+ }>;
167
+ export type GraphNode = ElementNode | AttributeNode | ParticleNode | AttributeUseNode | AttributeGroupUseNode | AttributeWildcardNode | SimpleTypeNode | ComplexTypeNode | GroupNode | AttributeGroupNode | WsdlNode;
168
+ export type GraphOrigin = Readonly<{
169
+ interpretation: string;
170
+ context: GraphContext;
171
+ }>;
172
+ export type CanonicalGraph = Readonly<{
173
+ model: typeof GRAPH_MODEL;
174
+ nodes: readonly GraphNode[];
175
+ globals: readonly NodeId[];
176
+ origins: Readonly<Record<NodeId, readonly GraphOrigin[]>>;
177
+ schemaAnnotations: readonly SyntaxElement[];
178
+ schemaRetained: readonly Readonly<{
179
+ context: GraphContext;
180
+ syntax: SyntaxElement;
181
+ }>[];
182
+ /** Includes/imports are provenance, never symbol identity or eager composition. */
183
+ loading: Readonly<{
184
+ limits: import("../loader/schemaResources.js").LoadingLimits;
185
+ edges: readonly import("../loader/schemaInput.js").ResolutionEdge[];
186
+ }>;
187
+ }>;
188
+ export declare class GraphError extends Error {
189
+ readonly category: "invalid-schema" | "resource-limit";
190
+ readonly source?: SyntaxSource | undefined;
191
+ constructor(category: "invalid-schema" | "resource-limit", message: string, source?: SyntaxSource | undefined);
192
+ }
193
+ export declare function globalId(role: SymbolRole, name: ExpandedName): NodeId;
194
+ export declare function scopedId(owner: NodeId, path: string, role: string): NodeId;
195
+ export declare function wsdlReferenceRoles(node: SyntaxElement): Record<string, SymbolRole>;
196
+ export declare function deepFreeze<T>(value: T): T;
197
+ export {};
@@ -0,0 +1,37 @@
1
+ /** Internal, language-neutral S04 contract. S05 resolves and composes these references. */
2
+ import { createHash } from "node:crypto";
3
+ import { WSDL_NAMESPACE } from "../loader/orderedSyntax.js";
4
+ export const GRAPH_MODEL = "xsd10-faithful-v1";
5
+ export const DEFAULT_GRAPH_NODES = 100_000;
6
+ const builtinTypes = new Set("anyType anySimpleType string boolean decimal float double duration dateTime time date gYearMonth gYear gMonthDay gDay gMonth hexBinary base64Binary anyURI QName NOTATION normalizedString token language NMTOKEN NMTOKENS Name NCName ID IDREF IDREFS ENTITY ENTITIES integer nonPositiveInteger negativeInteger long int short byte nonNegativeInteger unsignedLong unsignedInt unsignedShort unsignedByte positiveInteger".split(" "));
7
+ export const isBuiltinType = (local) => builtinTypes.has(local);
8
+ export class GraphError 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 = "GraphError";
16
+ }
17
+ }
18
+ export function globalId(role, name) {
19
+ return JSON.stringify(["global", role, name.namespace, name.local]);
20
+ }
21
+ export function scopedId(owner, path, role) {
22
+ return "scoped:" + createHash("sha256").update(JSON.stringify([owner, path, role])).digest("hex");
23
+ }
24
+ export function wsdlReferenceRoles(node) {
25
+ if (node.name.namespace !== WSDL_NAMESPACE)
26
+ return {};
27
+ return node.name.local === "part" ? { element: "element", type: "type" } : node.name.local === "binding" ? { type: "portType" }
28
+ : node.name.local === "port" ? { binding: "binding" } : ["input", "output", "fault"].includes(node.name.local) ? { message: "message" } : {};
29
+ }
30
+ export function deepFreeze(value) {
31
+ if (value && typeof value === "object" && !Object.isFrozen(value)) {
32
+ for (const child of Object.values(value))
33
+ deepFreeze(child);
34
+ Object.freeze(value);
35
+ }
36
+ return value;
37
+ }
@@ -0,0 +1,17 @@
1
+ export declare class CatalogError extends Error {
2
+ readonly category: "incompatible-artifact" | "invalid-schema" | "resource-limit";
3
+ readonly field?: string | undefined;
4
+ constructor(category: "incompatible-artifact" | "invalid-schema" | "resource-limit", message: string, field?: string | undefined);
5
+ }
6
+ export declare const DEFAULT_CATALOG_BYTES: number;
7
+ export declare const DEFAULT_CATALOG_DEPTH = 1024;
8
+ export type CatalogLimits = {
9
+ maxBytes?: number;
10
+ maxDepth?: number;
11
+ maxNodes?: number;
12
+ };
13
+ /** Property ordering is display ordering; array ordering always remains semantic. */
14
+ export declare function canonicalJson(value: unknown): string;
15
+ export declare function positiveLimit(value: number | undefined, fallback: number, name: string): number;
16
+ /** Scan nesting before JSON.parse can allocate an arbitrarily deep input. */
17
+ export declare function parseCatalogJson(text: string, limits?: CatalogLimits): unknown;