@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,195 @@
1
+ /** Complete fixed-value calendar aliases under the accepted DT A coordinates. */
2
+ import { showInstant } from './schemaExactCalendar.js';
3
+ export function* calendarAliasExpressions(calendar, owner, c) {
4
+ const budget = { charge: work => c.step(owner, work), text: text => { c.text(text, owner); },
5
+ arithmetic: digits => c.step(owner, (digits + 2) ** 2) };
6
+ const value = calendar.seconds;
7
+ budget.arithmetic(value.digits + value.scale + 4);
8
+ const power = 10n ** BigInt(value.scale);
9
+ const shifted = (seconds) => {
10
+ budget.arithmetic(value.digits + value.scale + 8);
11
+ c.step(owner, 4);
12
+ return { ...value, coefficient: value.coefficient + BigInt(seconds) * power };
13
+ };
14
+ const quote = (text) => {
15
+ c.text(text, owner);
16
+ c.step(owner, text.length * 2 + 1);
17
+ return text.replace(/[\\.\-^?*+{}()\[\]|]/g, '\\$&');
18
+ };
19
+ const two = (value) => { c.step(owner, 4); return value.toString().padStart(2, '0'); };
20
+ const offsets = function* () {
21
+ yield 0;
22
+ if (calendar.zoned)
23
+ for (let minute = 1; minute <= 840; minute++) {
24
+ c.step(owner, 2);
25
+ yield minute;
26
+ yield -minute;
27
+ }
28
+ };
29
+ const expression = (instant, zone, second60 = false, hour24 = false) => {
30
+ c.text(instant, owner);
31
+ c.step(owner, instant.length * 3 + 12);
32
+ const match = /^(-?[0-9]+)-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]+))?Z$/.exec(instant);
33
+ const [, year, month, day, h, m, s, fraction = ''] = match;
34
+ const hour = hour24 ? '24' : h, second = second60 ? '60' : s;
35
+ const suffix = fraction ? '[.]' + fraction + '0*' : '([.]0+)?';
36
+ const clock = hour + ':' + m + ':' + second;
37
+ const zeroClock = h === '00' && m === '00' && s === '00' && !fraction;
38
+ let text;
39
+ switch (calendar.family) {
40
+ case 'dateTime':
41
+ text = quote(year + '-' + month + '-' + day + 'T' + clock) + suffix;
42
+ break;
43
+ case 'time':
44
+ text = quote(clock) + suffix;
45
+ break;
46
+ case 'date':
47
+ if (!zeroClock)
48
+ return undefined;
49
+ text = quote(year + '-' + month + '-' + day);
50
+ break;
51
+ case 'gYear':
52
+ if (!zeroClock || month !== '01' || day !== '01')
53
+ return undefined;
54
+ text = quote(year);
55
+ break;
56
+ case 'gYearMonth':
57
+ if (!zeroClock || day !== '01')
58
+ return undefined;
59
+ text = quote(year + '-' + month);
60
+ break;
61
+ case 'gMonthDay':
62
+ if (!zeroClock || year !== '2000')
63
+ return undefined;
64
+ text = quote('--' + month + '-' + day);
65
+ break;
66
+ case 'gDay':
67
+ if (!zeroClock || year !== '2000' || month !== '01')
68
+ return undefined;
69
+ text = quote('---' + day);
70
+ break;
71
+ case 'gMonth':
72
+ if (!zeroClock || year !== '2000' || day !== '01')
73
+ return undefined;
74
+ text = quote('--' + month);
75
+ break;
76
+ }
77
+ c.step(owner, text.length + zone.length * 2 + 1);
78
+ return text + quote(zone);
79
+ };
80
+ for (const offset of offsets()) {
81
+ c.step(owner, 4);
82
+ const local = shifted(offset * 60), instant = showInstant(local, budget);
83
+ const zone = calendar.zoned ? (offset < 0 ? '-' : '+') + two(Math.floor(Math.abs(offset) / 60)) + ':' + two(Math.abs(offset) % 60) : '';
84
+ c.step(owner, 4);
85
+ const zones = calendar.zoned && offset === 0 ? ['Z', '+00:00', '-00:00'] : [zone];
86
+ for (const zone of zones) {
87
+ const normal = expression(instant, zone);
88
+ if (normal !== undefined)
89
+ yield normal;
90
+ if (calendar.family !== 'dateTime' && calendar.family !== 'time')
91
+ continue;
92
+ // Second 60 is an overflow into the next minute, including fractions.
93
+ if (/T[0-9]{2}:[0-9]{2}:00(?:\.[0-9]+)?Z$/.test(instant)) {
94
+ budget.arithmetic(local.digits + local.scale + 8);
95
+ c.step(owner, 4);
96
+ const priorMinute = showInstant({ ...local, coefficient: local.coefficient - 60n * power }, budget);
97
+ const overflow = expression(priorMinute, zone, true);
98
+ if (overflow !== undefined)
99
+ yield overflow;
100
+ }
101
+ if (/T00:00:00Z$/.test(instant)) {
102
+ budget.arithmetic(local.digits + local.scale + 8);
103
+ c.step(owner, 4);
104
+ const priorDay = showInstant({ ...local, coefficient: local.coefficient - 86400n * power }, budget);
105
+ const midnight = expression(priorDay, zone, false, true);
106
+ if (midnight !== undefined)
107
+ yield midnight;
108
+ }
109
+ }
110
+ }
111
+ }
112
+ /** Finite field decompositions, each with its complete infinite zero aliases. */
113
+ export function* durationAliasExpressions(duration, owner, c, canMatch) {
114
+ const digits = duration.digits + duration.seconds.scale + 8;
115
+ const arithmetic = () => c.step(owner, (digits + 2) ** 2);
116
+ arithmetic();
117
+ const months = duration.months < 0n ? -duration.months : duration.months;
118
+ const seconds = duration.seconds.coefficient < 0n ? -duration.seconds.coefficient : duration.seconds.coefficient;
119
+ const power = 10n ** BigInt(duration.seconds.scale), unit = 60n * power;
120
+ const sign = duration.months < 0n || duration.seconds.coefficient < 0n ? '\\-' : '';
121
+ const integer = (number) => { arithmetic(); c.step(owner, digits + 4); return number === 0n ? '0+' : '0*' + number; };
122
+ const field = (number, suffix) => {
123
+ const value = integer(number);
124
+ c.step(owner, value.length + 8);
125
+ return number === 0n ? '(' + value + suffix + ')?' : value + suffix;
126
+ };
127
+ const second = (coefficient) => {
128
+ arithmetic();
129
+ c.step(owner, digits * 4 + 8);
130
+ const whole = coefficient / power, remainder = coefficient % power;
131
+ const fraction = remainder === 0n ? '([.]0+)?' : '[.]' + remainder.toString().padStart(duration.seconds.scale, '0').replace(/0+$/, '') + '0*';
132
+ return integer(whole) + fraction + 'S';
133
+ };
134
+ const zeroTime = () => {
135
+ c.step(owner, 4);
136
+ const choices = [];
137
+ for (let mask = 1; mask < 8; mask++) {
138
+ c.step(owner, 64);
139
+ choices.push('T' + (mask & 1 ? '0+H' : '') + (mask & 2 ? '0+M' : '') + (mask & 4 ? '0+([.]0+)?S' : ''));
140
+ }
141
+ c.step(owner, 256);
142
+ return '(' + choices.join('|') + ')?';
143
+ };
144
+ const branch = (y, m, d, h, minute, remainder) => {
145
+ const prefix = sign + 'P' + field(y, 'Y') + field(m, 'M') + field(d, 'D');
146
+ c.step(owner, prefix.length + digits * 8 + 64);
147
+ return h === 0n && minute === 0n && remainder === 0n ? prefix + zeroTime()
148
+ : prefix + 'T' + field(h, 'H') + field(minute, 'M') + (remainder === 0n ? '(' + second(0n) + ')?' : second(remainder));
149
+ };
150
+ if (months === 0n && seconds === 0n) {
151
+ for (let mask = 1; mask < 64; mask++) {
152
+ c.step(owner, 96);
153
+ const date = (mask & 1 ? '0+Y' : '') + (mask & 2 ? '0+M' : '') + (mask & 4 ? '0+D' : '');
154
+ const time = (mask & 8 ? '0+H' : '') + (mask & 16 ? '0+M' : '') + (mask & 32 ? '0+([.]0+)?S' : '');
155
+ yield '\\-?P' + date + (time ? 'T' + time : '');
156
+ }
157
+ return;
158
+ }
159
+ // A conventional decomposition supplies a cheap complete-language branch
160
+ // before exhaustive finite alternatives; no failure of it proves absence.
161
+ arithmetic();
162
+ const y = months / 12n, m = months % 12n, d = seconds / (86400n * power);
163
+ const rest = seconds - d * 86400n * power, h = rest / (3600n * power), restHour = rest - h * 3600n * power;
164
+ const minute = restHour / unit;
165
+ yield branch(y, m, d, h, minute, restHour - minute * unit);
166
+ for (let year = 0n; year * 12n <= months; year++) {
167
+ arithmetic();
168
+ const month = months - year * 12n;
169
+ const datePrefix = sign + 'P' + field(year, 'Y') + field(month, 'M');
170
+ c.step(owner, datePrefix.length + 128);
171
+ if (!canMatch(datePrefix + '([0-9]+D)?(T([0-9]+H)?([0-9]+M)?([0-9]+([.][0-9]+)?S)?)?'))
172
+ continue;
173
+ for (let day = 0n; day * 86400n * power <= seconds; day++) {
174
+ arithmetic();
175
+ const remaining = seconds - day * 86400n * power, prefix = datePrefix + field(day, 'D');
176
+ c.step(owner, prefix.length + 96);
177
+ if (!canMatch(prefix + '(T([0-9]+H)?([0-9]+M)?([0-9]+([.][0-9]+)?S)?)?'))
178
+ continue;
179
+ for (let hour = 0n; hour * 3600n * power <= remaining; hour++) {
180
+ arithmetic();
181
+ const afterHour = remaining - hour * 3600n * power;
182
+ c.step(owner, prefix.length + digits * 4 + 96);
183
+ if (!canMatch(prefix + 'T' + field(hour, 'H') + '([0-9]+M)?([0-9]+([.][0-9]+)?S)?')) {
184
+ if (hour !== 0n || afterHour !== 0n)
185
+ continue;
186
+ }
187
+ for (let min = 0n; min * unit <= afterHour; min++) {
188
+ arithmetic();
189
+ const remainingSeconds = afterHour - min * unit;
190
+ yield branch(year, month, day, hour, min, remainingSeconds);
191
+ }
192
+ }
193
+ }
194
+ }
195
+ }
@@ -0,0 +1,8 @@
1
+ /** Finite token-boundary transducers with complete source-owned value labels. */
2
+ import type { SchemaPatternContext } from './schemaValueContext.js';
3
+ import type { RegularLanguage } from './schemaRegularLanguage.js';
4
+ import { schemaRegularLanguages } from './schemaRegularLanguage.js';
5
+ import type { SymbolicSequence } from './schemaSymbolicSequences.js';
6
+ export declare function schemaTokenImages<Owner, Label>(c: SchemaPatternContext<Owner>, regular: ReturnType<typeof schemaRegularLanguages<Owner>>, token: (owner: Owner) => RegularLanguage, labels: (paths: RegularLanguage, position: number, rejected: readonly number[], owner: Owner) => readonly Label[], whitespace: (codepoint: number, owner: Owner) => Label): {
7
+ image: (source: RegularLanguage, rejectedCount: number, maximumPosition: number, mode: "list" | "string", owner: Owner) => SymbolicSequence<Label>;
8
+ };
@@ -0,0 +1,142 @@
1
+ import { schemaRegularLanguages } from './schemaRegularLanguage.js';
2
+ export function schemaTokenImages(c, regular, token, labels, whitespace) {
3
+ const image = (source, rejectedCount, maximumPosition, mode, owner) => {
4
+ const program = regular.automaton(source, owner), tokenDomain = token(owner);
5
+ const maskCost = Math.min(Number.MAX_SAFE_INTEGER, (rejectedCount + 4) ** 2);
6
+ const masks = (operations = 1) => c.step(owner, Math.min(Number.MAX_SAFE_INTEGER, maskCost * operations));
7
+ c.step(owner, rejectedCount + 16);
8
+ masks(2);
9
+ const all = (1n << BigInt(rejectedCount)) - 1n;
10
+ const inputs = [], states = [], known = new Map();
11
+ const intern = (state) => {
12
+ c.step(owner, 64);
13
+ masks(2);
14
+ const key = state.at + ':' + state.failed + ':' + state.position + ':' + state.after, before = known.get(key);
15
+ if (before !== undefined)
16
+ return before;
17
+ c.step(owner, 6);
18
+ const index = states.length;
19
+ known.set(key, index);
20
+ inputs.push(state);
21
+ states.push({ accepting: program.states[state.at].accepting && state.failed === all, edges: [] });
22
+ return index;
23
+ };
24
+ const start = intern({ at: program.start, failed: 0n, position: 0, after: false });
25
+ const gaps = [9, 10, 13, 32];
26
+ c.step(owner, program.states.length * 3 + 6);
27
+ const pathCache = new Map(), labelCache = new WeakMap();
28
+ const incoming = program.states.map(() => []), productive = new Set(), pending = [];
29
+ for (let at = 0; at < program.states.length; at++) {
30
+ if (program.states[at].accepting) {
31
+ c.step(owner, 2);
32
+ productive.add(at);
33
+ pending.push(at);
34
+ }
35
+ for (const edge of program.states[at].transitions) {
36
+ c.step(owner);
37
+ incoming[edge.to].push(at);
38
+ }
39
+ }
40
+ while (pending.length)
41
+ for (const at of incoming[pending.pop()]) {
42
+ c.step(owner);
43
+ if (!productive.has(at)) {
44
+ c.step(owner, 2);
45
+ productive.add(at);
46
+ pending.push(at);
47
+ }
48
+ }
49
+ for (let cursor = 0; cursor < inputs.length; cursor++) {
50
+ const from = inputs[cursor];
51
+ c.step(owner);
52
+ if (mode === 'string')
53
+ for (const edge of program.states[from.at].transitions)
54
+ for (const cp of gaps) {
55
+ c.step(owner);
56
+ if (cp < edge.lo || cp > edge.hi)
57
+ continue;
58
+ const to = intern({ ...from, at: edge.to, after: false });
59
+ c.step(owner, 3);
60
+ states[cursor].edges.push({ to, label: whitespace(cp, owner) });
61
+ }
62
+ if (from.after)
63
+ continue;
64
+ for (let end = 0; end < program.states.length; end++) {
65
+ c.step(owner);
66
+ const endpoint = program.states[end];
67
+ if (!productive.has(end))
68
+ continue;
69
+ if (!endpoint.accepting && !endpoint.transitions.some(edge => gaps.some(cp => edge.lo <= cp && edge.hi >= cp)))
70
+ continue;
71
+ c.step(owner, 32);
72
+ const key = from.at + ':' + end;
73
+ let paths = pathCache.get(key);
74
+ if (!paths) {
75
+ paths = regular.intersect([regular.paths(program, [from.at], new Set([end]), owner), tokenDomain], owner);
76
+ c.step(owner, 2);
77
+ pathCache.set(key, paths);
78
+ }
79
+ if (regular.witness(paths, owner) === undefined)
80
+ continue;
81
+ c.step(owner, rejectedCount * 3 + 6);
82
+ const missing = [];
83
+ for (let bit = 0; bit < rejectedCount; bit++) {
84
+ masks(2);
85
+ if (!(from.failed & (1n << BigInt(bit))))
86
+ missing.push(bit);
87
+ }
88
+ masks();
89
+ const limit = 1n << BigInt(missing.length);
90
+ for (let mask = 0n; mask < limit;) {
91
+ c.step(owner, missing.length * 3 + 6);
92
+ const rejected = [];
93
+ let failed = from.failed;
94
+ for (let bit = 0; bit < missing.length; bit++) {
95
+ masks(2);
96
+ if (mask & (1n << BigInt(bit))) {
97
+ rejected.push(missing[bit]);
98
+ masks(2);
99
+ failed |= 1n << BigInt(missing[bit]);
100
+ }
101
+ }
102
+ masks();
103
+ mask++;
104
+ c.step(owner, rejected.length * 16 + 6);
105
+ const labelKey = from.position + ':' + JSON.stringify(rejected);
106
+ let table = labelCache.get(paths);
107
+ if (!table) {
108
+ c.step(owner, 2);
109
+ table = new Map();
110
+ labelCache.set(paths, table);
111
+ }
112
+ let selected = table.get(labelKey);
113
+ if (!selected) {
114
+ selected = labels(paths, from.position, rejected, owner);
115
+ c.step(owner, 2);
116
+ table.set(labelKey, selected);
117
+ }
118
+ if (!selected.length)
119
+ continue;
120
+ const position = Math.min(maximumPosition, from.position + 1), destinations = [];
121
+ if (mode === 'string')
122
+ destinations.push(intern({ at: end, failed, position, after: true }));
123
+ else {
124
+ if (endpoint.accepting)
125
+ destinations.push(intern({ at: end, failed, position, after: true }));
126
+ for (const edge of endpoint.transitions) {
127
+ c.step(owner);
128
+ if (edge.lo <= 32 && edge.hi >= 32)
129
+ destinations.push(intern({ at: edge.to, failed, position, after: false }));
130
+ }
131
+ }
132
+ c.step(owner, destinations.length * selected.length * 3 + 2);
133
+ for (const to of destinations)
134
+ for (const label of selected)
135
+ states[cursor].edges.push({ to, label });
136
+ }
137
+ }
138
+ }
139
+ return { start, states };
140
+ };
141
+ return { image };
142
+ }
@@ -0,0 +1,38 @@
1
+ /** Internal semantic type identities. Call within the shared request guard. */
2
+ import type { AttributeNode, ComplexTypeNode, ElementNode, NodeId, SimpleTypeNode } from './canonicalGraph.js';
3
+ import type { ExpandedName } from '../loader/orderedSyntax.js';
4
+ import type { SemanticContext } from './semanticContext.js';
5
+ import type { OriginalGeneratedScalarReference, SemanticTypeIdentity, SemanticTypeReference } from './semanticTypeReference.js';
6
+ export type SemanticTypeResolution = Readonly<{
7
+ kind: 'component';
8
+ node: SimpleTypeNode | ComplexTypeNode;
9
+ identity: Readonly<{
10
+ kind: 'component';
11
+ id: NodeId;
12
+ }>;
13
+ }> | Readonly<{
14
+ kind: 'builtin';
15
+ name: ExpandedName;
16
+ identity: Readonly<{
17
+ kind: 'builtin';
18
+ name: ExpandedName;
19
+ }>;
20
+ }> | Readonly<{
21
+ kind: 'original-generated';
22
+ slot: OriginalGeneratedScalarReference;
23
+ identity: OriginalGeneratedScalarReference;
24
+ }> | Readonly<{
25
+ kind: 'missing';
26
+ reference: SemanticTypeReference;
27
+ }> | Readonly<{
28
+ kind: 'outside-context';
29
+ reference: SemanticTypeReference;
30
+ }> | Readonly<{
31
+ kind: 'wrong-role';
32
+ reference: SemanticTypeReference;
33
+ component: NodeId;
34
+ }>;
35
+ export declare function resolveSemanticType(context: SemanticContext, reference: SemanticTypeReference): SemanticTypeResolution;
36
+ export declare function declaredType(context: SemanticContext, node: ElementNode | AttributeNode): SemanticTypeReference;
37
+ /** Collision-free key only; supplied identity data is not lookup authority. */
38
+ export declare function semanticTypeKey(context: SemanticContext, identity: SemanticTypeIdentity): string;
@@ -0,0 +1,80 @@
1
+ import { isBuiltinType } from './canonicalGraph.js';
2
+ import { XSD_NAMESPACE } from '../loader/orderedSyntax.js';
3
+ import { assertSemanticContext, SemanticContextAccessError } from './semanticContext.js';
4
+ export function resolveSemanticType(context, reference) {
5
+ assertSemanticContext(context);
6
+ const budget = context.budget;
7
+ const kind = ownField(context, reference, 'kind');
8
+ budget.chargeWork(8);
9
+ if (kind === 'original-generated') {
10
+ const found = context.lookupScalarSlot(reference);
11
+ return found.kind === 'found' ? Object.freeze({ kind: 'original-generated', slot: found.slot, identity: found.slot })
12
+ : Object.freeze({ kind: found.kind, reference: budget.freeze(budget.snapshot(reference)) });
13
+ }
14
+ let found;
15
+ try {
16
+ found = context.resolve(reference);
17
+ }
18
+ catch (error) {
19
+ if (error instanceof SemanticContextAccessError && error.code === 'reference') {
20
+ budget.chargeWork(4);
21
+ throw new TypeError('Malformed semantic type reference');
22
+ }
23
+ throw error;
24
+ }
25
+ if (found.kind === 'builtin') {
26
+ if (found.name.namespace !== XSD_NAMESPACE || !isBuiltinType(found.name.local))
27
+ throw new TypeError('Unknown builtin type');
28
+ return Object.freeze({ kind: 'builtin', name: found.name, identity: Object.freeze({ kind: 'builtin', name: found.name }) });
29
+ }
30
+ if (found.kind === 'standard-element')
31
+ return Object.freeze({ kind: 'wrong-role', reference: budget.freeze(budget.snapshot(reference)), component: found.declaration.id });
32
+ if (found.kind !== 'found')
33
+ return Object.freeze({ kind: found.kind, reference: budget.freeze(budget.snapshot(reference)) });
34
+ if (context.originalSourceComponentAbsent(found.node.id) || found.node.kind !== 'simpleType' && found.node.kind !== 'complexType')
35
+ return Object.freeze({ kind: 'wrong-role', reference: budget.freeze(budget.snapshot(reference)), component: found.node.id });
36
+ return Object.freeze({ kind: 'component', node: found.node, identity: Object.freeze({ kind: 'component', id: found.node.id }) });
37
+ }
38
+ export function declaredType(context, node) {
39
+ assertSemanticContext(context);
40
+ context.budget.chargeWork(48);
41
+ const field = node && typeof node === 'object' ? Object.getOwnPropertyDescriptor(node, 'id') : undefined;
42
+ if (!field || !('value' in field) || typeof field.value !== 'string')
43
+ throw new TypeError('Unauthenticated declaration');
44
+ const found = context.lookup(field.value);
45
+ if (found.kind !== 'found' || found.node !== node || node.kind !== 'element' && node.kind !== 'attribute')
46
+ throw new TypeError('Unauthenticated declaration');
47
+ return node.kind === 'element' ? context.rawElementProperties(node.id)?.type ?? node.type
48
+ : context.rawAttributeProperties(node.id)?.type ?? node.type;
49
+ }
50
+ /** Own primitive data only: a key cannot establish membership or validity. */
51
+ function ownField(context, value, name) {
52
+ context.budget.chargeWork(56 + name.length);
53
+ if (!value || typeof value !== 'object')
54
+ throw new TypeError('Expected own semantic identity data');
55
+ const field = Object.getOwnPropertyDescriptor(value, name);
56
+ if (!field || !('value' in field))
57
+ throw new TypeError('Semantic identity fields must be own data');
58
+ return field.value;
59
+ }
60
+ function stringField(context, value, name) {
61
+ const field = ownField(context, value, name);
62
+ if (typeof field !== 'string')
63
+ throw new TypeError('Semantic identity field must be a string');
64
+ return field;
65
+ }
66
+ /** Collision-free key only; supplied identity data is not lookup authority. */
67
+ export function semanticTypeKey(context, identity) {
68
+ assertSemanticContext(context);
69
+ const budget = context.budget, kind = stringField(context, identity, 'kind');
70
+ if (kind === 'component' || kind === 'original-generated') {
71
+ const id = stringField(context, identity, kind === 'component' ? 'id' : 'owner');
72
+ budget.chargeWork(id.length * 2 + 20);
73
+ return (kind === 'component' ? 'component:' : 'generated:') + id.length + ':' + id;
74
+ }
75
+ if (kind !== 'builtin')
76
+ throw new TypeError('Malformed semantic type identity');
77
+ const name = ownField(context, identity, 'name'), namespace = stringField(context, name, 'namespace'), local = stringField(context, name, 'local');
78
+ budget.chargeWork((namespace.length + local.length) * 2 + 20);
79
+ return 'builtin:' + namespace.length + ':' + namespace + ':' + local.length + ':' + local;
80
+ }
@@ -0,0 +1,37 @@
1
+ import type { SemanticTypeReference as Reference, SemanticTypeDependency } from './semanticTypeReference.js';
2
+ /** XSD 1.0 dated local relations. Success never certifies component/schema validity. */
3
+ import type { GraphNode, NodeId } from './canonicalGraph.js';
4
+ import type { SemanticContext } from './semanticContext.js';
5
+ import type { ResourceLimitFailure } from './semanticBudget.js';
6
+ export type DerivationMethod = 'extension' | 'restriction' | 'list' | 'union';
7
+ export type RelationReceipt<T = boolean> = Readonly<{
8
+ kind: 'checked';
9
+ value: T;
10
+ contextId: string;
11
+ authority: 'XSD10-local-relations-v1';
12
+ obligations: readonly ('component-validity' | 'complete-substitution-universe')[];
13
+ dependencies: readonly string[];
14
+ typeDependencies: readonly SemanticTypeDependency[];
15
+ }>;
16
+ export type RelationFailure = Readonly<{
17
+ kind: 'unresolved' | 'invalid-input';
18
+ rule: string;
19
+ component?: string;
20
+ message: string;
21
+ }>;
22
+ export type RelationResult<T = boolean> = RelationReceipt<T> | RelationFailure | ResourceLimitFailure;
23
+ export type SubstitutionOptions = Readonly<{
24
+ mode: 'affiliation' | 'substitutability';
25
+ blocking?: readonly ('extension' | 'restriction' | 'substitution')[];
26
+ }>;
27
+ export declare class RelationProblem extends Error {
28
+ readonly result: RelationFailure;
29
+ constructor(result: RelationFailure);
30
+ }
31
+ /** The graph mapping owns legal syntax; this parser diagnoses token-list errors locally. */
32
+ export declare function declarationMethods(context: SemanticContext, node: GraphNode, property: 'final' | 'block'): readonly (DerivationMethod | 'substitution')[];
33
+ export declare const checkTypeDerivation: (context: SemanticContext, derived: Reference, base: Reference, excluded: readonly DerivationMethod[]) => RelationResult;
34
+ export declare const checkImmediateTypeFinal: (context: SemanticContext, derived: Reference) => RelationResult;
35
+ export declare const immediateTypeBase: (context: SemanticContext, reference: Reference) => RelationResult<Reference | undefined>;
36
+ export declare const checkSubstitution: (context: SemanticContext, member: NodeId, head: NodeId, options: SubstitutionOptions) => RelationResult;
37
+ export declare const effectiveSubstitutionMembers: (context: SemanticContext, head: NodeId) => RelationResult<readonly NodeId[]>;