@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,293 @@
1
+ /**
2
+ * Lowers issued direct mappings into HTTP documentation and a checked gateway.
3
+ * @since 1.1.6
4
+ * @constraints Serialized descriptions never issue native source or execution authority.
5
+ */
6
+ import { mkdir, writeFile } from 'node:fs/promises';
7
+ import path from 'node:path';
8
+ import { componentSourceCapsuleBytes, inspectReconstructedComponentSource, inspectComponentSourceService } from '../compiler/directSourceCapsule.js';
9
+ import { lowerComponentShape } from '../generation/componentShape.js';
10
+ import { checkSemanticBudget } from '../compiler/semanticBudget.js';
11
+ import { inspectDirectOperation } from '../compiler/directOperation.js';
12
+ import { inspectComponentValueMapping } from '../compiler/directValues.js';
13
+ import { composeGeneratedSource, resolvePreamble } from '../generation/preamble.js';
14
+ const draft07 = 'http://json-schema.org/draft-07/schema#';
15
+ /** Lower component mappings through the existing checked gateway emitter, retaining native supplemental validation. */
16
+ export async function generateComponentGateway(expected, options) {
17
+ inspectReconstructedComponentSource(expected);
18
+ return generateGatewayFromReconstruction(expected, options);
19
+ }
20
+ async function generateGatewayFromReconstruction(expected, options) {
21
+ if (options.signal?.aborted)
22
+ throw new Error('Checked gateway generation cancelled');
23
+ inspectReconstructedComponentSource(expected);
24
+ const capsule = { bytes: componentSourceCapsuleBytes(expected, options.signal) };
25
+ const runtime = 'checkedComponentRuntimeV1';
26
+ if (!options.routePath.startsWith('/') || options.routePath.split('/').slice(1)
27
+ .some(segment => !segment || !/^(?:[A-Za-z0-9._~-]|%[0-9A-Fa-f]{2})+$/.test(segment))) {
28
+ throw new TypeError('Checked routePath requires literal nonempty path segments');
29
+ }
30
+ const input = expected.mappings.find(mapping => mapping.direction.kind === 'input');
31
+ const output = expected.mappings.find(mapping => mapping.direction.kind === 'output');
32
+ if (!input || !output)
33
+ throw new TypeError('Issued input and output mappings required');
34
+ const schema = (mapping, role) => {
35
+ const { budget } = inspectDirectOperation(expected.contract).context;
36
+ return lowerComponentShape(expected.contract, mapping, role, () => {
37
+ checkSemanticBudget(budget);
38
+ if (options.signal?.aborted)
39
+ throw new Error('Checked gateway generation cancelled');
40
+ }).schema;
41
+ };
42
+ const request = schema(input, 'Request'), response = schema(output, 'Response');
43
+ const faults = expected.mappings.filter(mapping => mapping.direction.kind === 'fault').map(mapping => {
44
+ if (mapping.direction.kind !== 'fault')
45
+ throw new TypeError('Declared fault mapping required');
46
+ return { name: mapping.direction.name, value: schema(mapping, `Fault_${expected.mappings.filter(item => item.direction.kind === 'fault').indexOf(mapping)}`) };
47
+ });
48
+ const faultVariants = faults.map(fault => ({
49
+ type: 'object', additionalProperties: false, required: ['fault', 'value'],
50
+ properties: {
51
+ value: fault.value,
52
+ fault: {
53
+ type: 'object', additionalProperties: false, required: ['name', 'code', 'string'],
54
+ properties: {
55
+ name: { const: fault.name }, string: { type: 'string' }, actor: { type: 'string' },
56
+ code: { type: 'object', additionalProperties: false, required: ['namespace', 'local'],
57
+ properties: { namespace: { type: 'string' }, local: { type: 'string' } } },
58
+ },
59
+ },
60
+ },
61
+ }));
62
+ const fault = faultVariants.length ? { oneOf: faultVariants } : { not: {} };
63
+ const schemas = { request: { $schema: draft07, ...request }, response: { $schema: draft07, ...response }, fault: { $schema: draft07, ...fault } };
64
+ const grouped = expected.mappings.some(mapping => mapping.kind === 'component-mapping'
65
+ && inspectComponentValueMapping(mapping, expected.contract).applicationGroups);
66
+ const components = Object.create(null);
67
+ const documented = (value, dictionary = false) => {
68
+ if (Array.isArray(value))
69
+ return value.map(item => documented(item));
70
+ if (!value || typeof value !== 'object')
71
+ return value;
72
+ const record = value, result = Object.create(null);
73
+ // @why Property names belong to the application; definitions and $id are keywords only at schema nodes.
74
+ if (dictionary) {
75
+ for (const [key, item] of Object.entries(record))
76
+ result[key] = documented(item);
77
+ return result;
78
+ }
79
+ if (Object.hasOwn(record, 'definitions'))
80
+ for (const [key, definition] of Object.entries(record.definitions)) {
81
+ const resolved = documented(definition);
82
+ if (components[key] && JSON.stringify(components[key]) !== JSON.stringify(resolved))
83
+ throw new TypeError(`applicationGroups OpenAPI component collision ${key}`);
84
+ components[key] = resolved;
85
+ }
86
+ for (const [key, item] of Object.entries(record)) {
87
+ if (key === 'definitions' || key === '$id')
88
+ continue;
89
+ result[key] = ['const', 'enum', 'default', 'examples'].includes(key) ? item
90
+ : key === '$ref' && typeof item === 'string' && item.startsWith('#/definitions/') ? item.replace('#/definitions/', '#/components/schemas/')
91
+ : documented(item, ['properties', 'patternProperties', 'dependencies', 'dependentSchemas'].includes(key));
92
+ }
93
+ return result;
94
+ };
95
+ const documentation = grouped ? { request: documented(request), response: documented(response), fault: documented(fault) } : { request, response, fault };
96
+ const doc = {
97
+ openapi: '3.1.1', jsonSchemaDialect: 'https://json-schema.org/draft/2020-12/schema',
98
+ info: { title: expected.selection.service.local, version: '1.0.0' },
99
+ ...(grouped ? { components: { schemas: components } } : {}),
100
+ 'x-checked-model': { model: 'checked-components-v1', scope: 'native-component-structured-soap11',
101
+ ...(expected.responseProjection
102
+ ? { responseProjection: { spec: expected.responseProjection.spec, delivery: 'buffered', retainedValue: 'complete-companion-payload' } } : {}),
103
+ documentationDialect: '2020-12', runtimeDialect: 'draft-07', jsonShapeComplete: false,
104
+ supplementalValidation: ['native-source-compatibility', 'native-xml-scalar-and-particle'], admitted: false,
105
+ selection: { selector: expected.contract.selector, ...expected.selection } },
106
+ paths: { [options.routePath]: { post: { operationId: expected.contract.selector.operation,
107
+ ...(expected.responseProjection
108
+ ? { 'x-response-projection': { spec: expected.responseProjection.spec, delivery: 'buffered', retainedValue: 'complete-companion-payload' } } : {}),
109
+ requestBody: { required: true, content: { 'application/json': { schema: documentation.request } } },
110
+ responses: { '200': { description: 'Independently validated SOAP response', content: { 'application/json': { schema: documentation.response } } },
111
+ '400': { description: 'Invalid HTTP request; no SOAP request is dispatched' },
112
+ '502': { description: 'Declared SOAP fault or refused upstream response', content: { 'application/json': { schema: { oneOf: [documentation.fault,
113
+ { type: 'object', additionalProperties: false, required: ['kind', 'rule'], properties: { kind: { type: 'string' }, rule: { type: 'string' } } }] } } } },
114
+ '500': { description: 'Incompatible artifacts or gateway configuration' } } } } },
115
+ };
116
+ let clientImport = path.relative(options.gatewayDir, path.join(options.clientDir, 'client.js')).replace(/\\/g, '/');
117
+ if (!clientImport.startsWith('.'))
118
+ clientImport = './' + clientImport;
119
+ const literal = (value) => JSON.stringify(value).replace(/\u2028/g, '\\u2028').replace(/\u2029/g, '\\u2029');
120
+ // language=TypeScript
121
+ const body = `import type {FastifyPluginAsync} from 'fastify';
122
+ import {Ajv} from 'ajv';
123
+ import {types} from 'node:util';
124
+ import {${runtime}} from '@techspokes/typescript-wsdl-client';
125
+ import {createClient, expectedCapsuleBase64, type Options, type Request} from ${literal(clientImport)};
126
+
127
+ export interface CheckedGatewayOptions { readonly clientOptions: Options }
128
+ // @constraints JSON parsing preserves XML names such as __proto__ as ordinary own data properties.
129
+ export const schemas = JSON.parse(${literal(JSON.stringify(schemas))}) as {request: Record<string, unknown>; response: Record<string, unknown>; fault: Record<string, unknown>};
130
+ export const expectedOpenApiJson = ${literal(JSON.stringify(doc))};
131
+
132
+ // @constraints Read only data properties before composing per-request cancellation.
133
+ function dataCopy<T extends object>(value: T): T {
134
+ if (!value || typeof value !== 'object' || types.isProxy(value)
135
+ || ![Object.prototype, null].includes(Object.getPrototypeOf(value) as object | null)) throw new TypeError('Data-only checked gateway options required');
136
+ const copy: Record<string, unknown> = Object.create(null) as Record<string, unknown>;
137
+ for (const key of Reflect.ownKeys(value)) {
138
+ const descriptor = Object.getOwnPropertyDescriptor(value, key)!;
139
+ if (typeof key !== 'string' || !Object.hasOwn(descriptor, 'value')) throw new TypeError('Data-only checked gateway options required');
140
+ copy[key] = descriptor.value;
141
+ }
142
+ return copy as T;
143
+ }
144
+
145
+ const plugin: FastifyPluginAsync<CheckedGatewayOptions> = async (fastify, options) => {
146
+ if (expectedCapsuleBase64 !== ${literal(Buffer.from(capsule.bytes).toString('base64'))}) throw new Error('incompatible-artifact: generated gateway/client mismatch; regenerate the complete project');
147
+ const client = createClient(${runtime});
148
+ const ajv = new Ajv({coerceTypes: false, useDefaults: false, removeAdditional: false, ownProperties: true, strict: true, allErrors: true});
149
+ const validateRequest = ajv.compile(schemas.request);
150
+ const validateResponse = ajv.compile(schemas.response);
151
+ const validateFault = ajv.compile(schemas.fault);
152
+ const base = dataCopy(options.clientOptions);
153
+ const soap = dataCopy(base.soap);
154
+ fastify.post(${literal(options.routePath)}, {
155
+ schema: {body: schemas.request},
156
+ validatorCompiler: () => validateRequest,
157
+ // @constraints Serialization preserves every validated member and never establishes validity.
158
+ serializerCompiler: () => value => JSON.stringify(value),
159
+ }, async (request, reply) => {
160
+ const controller = new AbortController();
161
+ const disconnected = () => {if (!reply.raw.writableEnded) controller.abort();};
162
+ request.raw.once('aborted', disconnected);
163
+ reply.raw.once('close', disconnected);
164
+ if (request.raw.aborted || reply.raw.destroyed) controller.abort();
165
+ try {
166
+ const signal = soap.signal ? AbortSignal.any([soap.signal, controller.signal]) : controller.signal;
167
+ const result = await client[${literal(expected.contract.selector.operation)}](request.body as Request,
168
+ {...base, soap: {...soap, signal}});
169
+ if (result.kind === 'soap-response') {
170
+ if (!validateResponse(result.value)) return reply.code(502).send({kind: 'value-invalid', rule: 'http-response-shape'});
171
+ return reply.type('application/json').serializer(value => JSON.stringify(value)).send(result.value);
172
+ }
173
+ if (result.kind === 'soap-fault') {
174
+ const fault = {name: result.fault.name, code: {namespace: result.fault.code.namespace, local: result.fault.code.local},
175
+ string: result.fault.string, ...(result.fault.actor === undefined ? {} : {actor: result.fault.actor})};
176
+ const value = {fault, value: result.value};
177
+ if (!validateFault(value)) return reply.code(502).send({kind: 'value-invalid', rule: 'http-fault-shape'});
178
+ return reply.code(502).type('application/json').serializer(value => JSON.stringify(value)).send(value);
179
+ }
180
+ const status = result.kind === 'incompatible-artifact' || result.kind === 'missing-authority' ? 500
181
+ : result.kind === 'cancelled' ? 499 : result.phase === 'input' ? 400 : 502;
182
+ return reply.code(status).send({kind: result.kind, rule: result.rule});
183
+ } finally {
184
+ request.raw.removeListener('aborted', disconnected);
185
+ reply.raw.removeListener('close', disconnected);
186
+ }
187
+ });
188
+ };
189
+ export default plugin;
190
+ `;
191
+ if (options.signal?.aborted)
192
+ throw new Error('Checked gateway generation cancelled');
193
+ const source = composeGeneratedSource(body, resolvePreamble('gateway'));
194
+ const emit = async () => {
195
+ inspectReconstructedComponentSource(expected);
196
+ checkSemanticBudget(inspectDirectOperation(expected.contract).context.budget);
197
+ if (options.signal?.aborted)
198
+ throw new Error('Checked gateway generation cancelled');
199
+ await mkdir(options.gatewayDir, { recursive: true });
200
+ await mkdir(path.dirname(options.openapiFile), { recursive: true });
201
+ await writeFile(path.join(options.gatewayDir, 'plugin.ts'), source, 'utf8');
202
+ await writeFile(path.join(options.gatewayDir, 'schemas.json'), JSON.stringify(schemas, null, 2) + '\n', 'utf8');
203
+ await writeFile(options.openapiFile, JSON.stringify(doc, null, 2) + '\n', 'utf8');
204
+ };
205
+ if (options.emit !== false)
206
+ await emit();
207
+ return { doc, emit };
208
+ }
209
+ /** Compose per-operation checked routers without merging native source, service or binding identities.
210
+ * @returns One OpenAPI document and exact operation-to-route mapping, both descriptions rather than authority.
211
+ * @throws For mixed native handles, invalid/colliding paths, cancellation or filesystem failures.
212
+ */
213
+ export async function generateComponentServiceGateway(expected, options) {
214
+ const operations = inspectComponentSourceService(expected), routes = Object.create(null);
215
+ const paths = Object.create(null);
216
+ const documents = [];
217
+ const emissions = [];
218
+ const tick = () => {
219
+ checkSemanticBudget(inspectDirectOperation(operations[0].contract).context.budget);
220
+ if (options.signal?.aborted)
221
+ throw new Error('Checked gateway generation cancelled');
222
+ };
223
+ for (const [index, operation] of operations.entries()) {
224
+ tick();
225
+ const name = operation.contract.selector.operation, routePath = `${options.basePath}/${encodeURIComponent(name)}`;
226
+ const result = await generateComponentGateway(operation, { clientDir: path.join(options.clientDir, 'operations', String(index)),
227
+ gatewayDir: path.join(options.gatewayDir, 'routes', String(index)), openapiFile: path.join(options.gatewayDir, 'routes', String(index), 'openapi.json'), routePath, signal: options.signal, emit: false });
228
+ emissions.push(result.emit);
229
+ const doc = result.doc;
230
+ documents.push(doc);
231
+ routes[name] = routePath;
232
+ for (const [route, value] of Object.entries(doc.paths)) {
233
+ if (Object.hasOwn(paths, route))
234
+ throw new TypeError('Duplicate checked route');
235
+ paths[route] = value;
236
+ }
237
+ }
238
+ const { responseProjection: firstProjection, ...serviceModel } = documents[0]['x-checked-model'];
239
+ void firstProjection;
240
+ const componentSchemas = Object.create(null);
241
+ for (const document of documents) {
242
+ const schemas = document.components?.schemas ?? {};
243
+ for (const [name, schema] of Object.entries(schemas)) {
244
+ if (componentSchemas[name] && JSON.stringify(componentSchemas[name]) !== JSON.stringify(schema))
245
+ throw new TypeError(`applicationGroups OpenAPI component collision ${name}`);
246
+ componentSchemas[name] = schema;
247
+ }
248
+ }
249
+ const doc = { ...documents[0], ...(Object.keys(componentSchemas).length ? { components: { schemas: componentSchemas } } : {}), 'x-checked-model': { ...serviceModel,
250
+ selection: { service: operations[0].selection.service, port: operations[0].selection.port,
251
+ selectors: operations.map(operation => operation.contract.selector) } }, paths };
252
+ let clientImport = path.relative(options.gatewayDir, path.join(options.clientDir, 'client.js')).replaceAll('\\', '/');
253
+ if (!clientImport.startsWith('.'))
254
+ clientImport = './' + clientImport;
255
+ const literal = (value) => JSON.stringify(value).replace(/\u2028/g, '\\u2028').replace(/\u2029/g, '\\u2029');
256
+ const names = operations.map(operation => operation.contract.selector.operation);
257
+ const lines = ["import type {FastifyPluginAsync} from 'fastify';", "import {types} from 'node:util';",
258
+ `import type {Options} from ${literal(clientImport)};`,
259
+ ...operations.map((_, index) => `import operation_${index} from './routes/${index}/plugin.js';`),
260
+ 'export interface CheckedGatewayOptions {readonly clientOptions: Options; readonly capsules: Readonly<Record<string, Uint8Array>>}',
261
+ `export const expectedOpenApiJson = ${literal(JSON.stringify(doc))};`,
262
+ 'function data(value: unknown, allowed: readonly string[]): Record<string, unknown> {',
263
+ " if (!value || typeof value !== 'object' || types.isProxy(value) || ![null, Object.prototype].includes(Object.getPrototypeOf(value) as object | null)) throw new TypeError('Data-only service options required');",
264
+ ' const result: Record<string, unknown> = Object.create(null) as Record<string, unknown>;',
265
+ ' for (const key of Reflect.ownKeys(value)) {',
266
+ ' const descriptor = Object.getOwnPropertyDescriptor(value, key)!;',
267
+ " if (typeof key !== 'string' || !allowed.includes(key) || !Object.hasOwn(descriptor, 'value')) throw new TypeError('Unsupported service option');",
268
+ ' result[key] = descriptor.value;', ' }', ' return result;', '}',
269
+ 'const plugin: FastifyPluginAsync<CheckedGatewayOptions> = async (fastify, options) => {',
270
+ " const outer = data(options, ['clientOptions', 'capsules', 'prefix']);",
271
+ " const clientOptions = data(outer.clientOptions, ['localSource', 'fileRoots', 'sourceResources', 'sourceOrigins', 'sourceUri', 'namespaceLocations', 'standardLibraries', 'recordSources', 'soap']) as unknown as Options;",
272
+ ` const capsules = data(outer.capsules, ${literal(names)});`,
273
+ ...operations.map((operation, index) => ` if (!Object.hasOwn(capsules, ${literal(operation.contract.selector.operation)})) throw new TypeError('Missing operation capsule');
274
+ await fastify.register(operation_${index}, {clientOptions: {...clientOptions, capsule: capsules[${literal(operation.contract.selector.operation)}] as Uint8Array}});`),
275
+ '};', 'export default plugin;', '',
276
+ ];
277
+ tick();
278
+ const source = composeGeneratedSource(lines.join('\n'), resolvePreamble('gateway'));
279
+ const emit = async () => {
280
+ tick();
281
+ for (const write of emissions) {
282
+ tick();
283
+ await write();
284
+ }
285
+ await mkdir(options.gatewayDir, { recursive: true });
286
+ await mkdir(path.dirname(options.openapiFile), { recursive: true });
287
+ await writeFile(path.join(options.gatewayDir, 'plugin.ts'), source, 'utf8');
288
+ await writeFile(options.openapiFile, JSON.stringify(doc, null, 2) + '\n', 'utf8');
289
+ };
290
+ if (options.emit !== false)
291
+ await emit();
292
+ return { doc, routes: Object.freeze(routes), emit };
293
+ }
@@ -83,4 +83,3 @@ export interface GenerateGatewayOptions {
83
83
  * });
84
84
  */
85
85
  export declare function generateGateway(opts: GenerateGatewayOptions): Promise<void>;
86
- //# sourceMappingURL=generateGateway.d.ts.map
@@ -21,6 +21,7 @@
21
21
  * routes.ts - Route registration module
22
22
  */
23
23
  import fs from "node:fs";
24
+ import { readLegacyCatalogFile } from "../compiler/semanticCatalog.js";
24
25
  import path from "node:path";
25
26
  import * as yaml from "js-yaml";
26
27
  import { buildParamSchemasForOperation, getJsonSchemaRefName, isNumericStatus, resolveClientMeta, resolveOperationMeta, } from "./helpers.js";
@@ -126,8 +127,7 @@ export async function generateGateway(opts) {
126
127
  // Load catalog if provided (for operation metadata)
127
128
  let catalog = undefined;
128
129
  if (opts.catalogFile && fs.existsSync(opts.catalogFile)) {
129
- const catalogRaw = fs.readFileSync(opts.catalogFile, "utf8");
130
- catalog = JSON.parse(catalogRaw);
130
+ catalog = readLegacyCatalogFile(opts.catalogFile);
131
131
  }
132
132
  // Resolve client metadata for full handler generation
133
133
  const clientMeta = resolveClientMeta({
@@ -170,4 +170,3 @@ export declare function emitTypeCheckFixture(outDir: string, clientMeta: ClientM
170
170
  * @param {any} [catalog] - Compiled catalog for detecting ArrayOf* wrapper types to unwrap
171
171
  */
172
172
  export declare function emitRouteFilesWithHandlers(outDir: string, routesDir: string, versionSlug: string, serviceSlug: string, operations: OperationMetadata[], importsMode: "js" | "ts" | "bare", clientMeta: ClientMeta, catalog?: any): void;
173
- //# sourceMappingURL=generators.d.ts.map
@@ -256,4 +256,3 @@ export declare function resolveOperationMeta(operationId: string, operationSlug:
256
256
  * @returns Number of unique schema components reachable via $ref
257
257
  */
258
258
  export declare function measureSchemaRefComplexity(startSchemaName: string, allSchemas: Record<string, any>, limit?: number): number;
259
- //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1,14 @@
1
+ import type { DirectOperationContract } from '../compiler/directOperation.js';
2
+ type Schema = Record<string, unknown>;
3
+ /** Lower an authenticated mapping to recursive TypeScript and JSON shape descriptions.
4
+ * @remarks Scalar restrictions, fixed/default semantics, ordered occurrence correlation and strict wildcard
5
+ * declaration membership require native validation. These descriptions never grant source/runtime authority.
6
+ * @returns Role-scoped definitions and root descriptions; no native handles or retrieval paths are emitted.
7
+ * @throws TypeError For foreign mappings or unsupported scalar representation. Caller cancellation propagates.
8
+ */
9
+ export declare function lowerComponentShape(contract: DirectOperationContract, supplied: unknown, role: string, check: () => void): {
10
+ type: string;
11
+ declarations: readonly string[];
12
+ schema: Schema;
13
+ };
14
+ export {};
@@ -0,0 +1,269 @@
1
+ /** Documentation/static shape lowering only; source, scalar facets and particle languages remain native duties. */
2
+ import { inspectDirectOperation } from '../compiler/directOperation.js';
3
+ import { inspectComponentValueMapping } from '../compiler/directValues.js';
4
+ import { projectionScalarRepresentation, inspectOrderedProjectionWildcards, inspectUnassessedProjectionWildcards } from '../compiler/directStructurePlan.js';
5
+ import { createHash } from 'node:crypto';
6
+ import { isComponentRecordProjection, inspectComponentRecordProjection } from '../compiler/componentRecordProjection.js';
7
+ import { applicationRecordName } from '../compiler/applicationGroups.js';
8
+ const literal = (value) => JSON.stringify(value).replace(/\u2028/g, '\\u2028').replace(/\u2029/g, '\\u2029');
9
+ /** Lower an authenticated mapping to recursive TypeScript and JSON shape descriptions.
10
+ * @remarks Scalar restrictions, fixed/default semantics, ordered occurrence correlation and strict wildcard
11
+ * declaration membership require native validation. These descriptions never grant source/runtime authority.
12
+ * @returns Role-scoped definitions and root descriptions; no native handles or retrieval paths are emitted.
13
+ * @throws TypeError For foreign mappings or unsupported scalar representation. Caller cancellation propagates.
14
+ */
15
+ export function lowerComponentShape(contract, supplied, role, check) {
16
+ if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(role))
17
+ throw new TypeError('TypeScript role identifier required');
18
+ if (isComponentRecordProjection(supplied)) {
19
+ const owned = inspectComponentRecordProjection(supplied, contract);
20
+ return lowerComponentShape(owned.companion, owned.mapping, role, check);
21
+ }
22
+ const { projection, applicationGroups } = inspectComponentValueMapping(supplied, contract), { context } = inspectDirectOperation(contract);
23
+ const names = new Map(projection.records.map((record, index) => [record.type.id, applicationGroups
24
+ ? applicationRecordName(record.type.id) : `${role}_Record_${index}`]));
25
+ const definitions = Object.create(null);
26
+ const declarations = [];
27
+ const lexicalAttribute = { type: 'object', minProperties: 1, maxProperties: 1, additionalProperties: { anyOf: [
28
+ { type: 'string' }, { type: 'number' }, { type: 'boolean' }, { type: 'array', items: { anyOf: [{ type: 'string' }, { type: 'number' }, { type: 'boolean' }] } },
29
+ { type: 'object', additionalProperties: false, required: ['$namespace', '$value'], properties: {
30
+ $namespace: { type: 'string', minLength: 1 }, $value: {}
31
+ } }
32
+ ] } };
33
+ const lexicalAttributeType = 'Readonly<Record<string, string | number | boolean | readonly (string | number | boolean)[] | {readonly "$namespace": string; readonly "$value": unknown}>>';
34
+ const openName = applicationGroups ? 'ApplicationOpenValue' : `${role}_OpenValue`;
35
+ let openDeclared = false;
36
+ const openShape = () => {
37
+ if (!openDeclared) {
38
+ openDeclared = true;
39
+ const attribute = { type: 'object', minProperties: 1, maxProperties: 1, additionalProperties: { anyOf: [{ type: 'string' },
40
+ { type: 'object', additionalProperties: false, required: ['$namespace', '$value'], properties: { $namespace: { type: 'string', minLength: 1 }, $value: { type: 'string' } } }] } };
41
+ definitions[openName] = { type: 'object', additionalProperties: false, required: ['$namespace', '$content'], properties: {
42
+ $namespace: { type: 'string' }, $namespaces: { type: 'object', additionalProperties: { type: 'string' } }, $attributes: { type: 'array', items: attribute },
43
+ $content: { type: 'array', items: { anyOf: [
44
+ { type: 'object', additionalProperties: false, required: ['$value'], properties: { $value: { type: 'string' } } },
45
+ { type: 'object', minProperties: 1, maxProperties: 1, additionalProperties: { $ref: '#/definitions/' + openName } },
46
+ ] } },
47
+ } };
48
+ declarations.push(`export type ${openName} = {readonly "$namespace": string; readonly "$namespaces"?: Readonly<Record<string, string>>; `
49
+ + 'readonly "$attributes"?: readonly Readonly<Record<string, string | {readonly "$namespace": string; readonly "$value": string}>>[]; '
50
+ + `readonly "$content": readonly ({readonly "$value": string} | Readonly<Record<string, ${openName}>>)[]};`);
51
+ }
52
+ return { type: `Readonly<Record<string, ${openName}>>`, schema: { type: 'object', minProperties: 1, maxProperties: 1,
53
+ additionalProperties: { $ref: '#/definitions/' + openName } } };
54
+ };
55
+ const scalar = (value) => {
56
+ check();
57
+ // @why A list-level pattern retains one lexical witness; its HTTP value is a string rather than an item array.
58
+ const item = value.retainLexical ? value : value.list ?? value;
59
+ const type = item.retainLexical ? 'string' : projectionScalarRepresentation(item.builtin);
60
+ if (!type)
61
+ throw new TypeError('Unsupported native scalar representation');
62
+ const schema = type === 'number' ? { type: 'integer', minimum: -2147483648, maximum: 2147483647 }
63
+ : type === 'string' ? { type, pattern: '^[\\u0009\\u000A\\u000D\\u0020-\\uD7FF\\uE000-\\uFFFD\\u{10000}-\\u{10FFFF}]*$' } : { type };
64
+ return value.list && !value.retainLexical ? { type: `readonly ${type}[]`, schema: { type: 'array', items: schema } } : { type, schema };
65
+ };
66
+ const shape = (value) => {
67
+ check();
68
+ const ordinary = (() => {
69
+ if (value.kind === 'scalar')
70
+ return scalar(value);
71
+ const name = names.get(value.type);
72
+ if (!name)
73
+ throw new TypeError('Missing native projection record');
74
+ return { type: name, schema: { $ref: '#/definitions/' + name } };
75
+ })();
76
+ if (!value.nillable || value.constraint?.kind === 'fixed')
77
+ return ordinary;
78
+ const record = value.kind === 'record' ? projection.records.find(record => record.type.id === value.type) : undefined;
79
+ const attributes = record?.attributes ?? [];
80
+ const properties = Object.create(null);
81
+ properties.$nil = { const: true };
82
+ const required = ['$nil'], members = ['readonly "$nil": true'];
83
+ for (const attribute of attributes) {
84
+ if (attribute.bag)
85
+ continue;
86
+ check();
87
+ const key = attribute.declaration.name.local, description = scalar(attribute);
88
+ properties[key] = description.schema;
89
+ if (attribute.required)
90
+ required.push(key);
91
+ members.push(`readonly ${literal(key)}${attribute.required ? '' : '?'}: ${description.type}`);
92
+ }
93
+ const bag = attributeBag(attributes, !!record?.attributeWildcard);
94
+ if (bag) {
95
+ properties.$attributes = bag.schema;
96
+ members.push(`readonly "$attributes"${bag.required ? '' : '?'}: ${bag.type}`);
97
+ if (bag.required)
98
+ required.push('$attributes');
99
+ }
100
+ if (record?.contextual) {
101
+ properties.$namespaces = { type: 'object', additionalProperties: { type: 'string' } };
102
+ members.push('readonly "$namespaces"?: Readonly<Record<string, string>>');
103
+ }
104
+ // @why Nil and ordinary values are disjoint: source data cannot use reserved $nil, and nil has no content fields.
105
+ return { type: `(${ordinary.type} | {${members.join('; ')}})`, schema: { anyOf: [ordinary.schema,
106
+ { type: 'object', additionalProperties: false, properties, required }] } };
107
+ };
108
+ const attributeBag = (attributes, open = false) => {
109
+ const entries = attributes.filter(attribute => attribute.bag).map(attribute => {
110
+ const key = attribute.declaration.name.local, description = scalar(attribute);
111
+ const ambiguous = !!attribute.declaration.name.namespace && (open || attributes.some(other => other !== attribute && other.declaration.name.local === key));
112
+ const value = ambiguous ? { type: `{readonly "$namespace": ${literal(attribute.declaration.name.namespace)}; readonly "$value": ${description.type}}`,
113
+ schema: { type: 'object', additionalProperties: false, required: ['$namespace', '$value'], properties: {
114
+ $namespace: { const: attribute.declaration.name.namespace }, $value: description.schema
115
+ } } } : description;
116
+ return { type: `{readonly ${literal(key)}: ${value.type}}`, schema: { type: 'object', additionalProperties: false,
117
+ required: [key], properties: { [key]: value.schema } } };
118
+ });
119
+ if (open)
120
+ entries.push({ type: lexicalAttributeType, schema: lexicalAttribute });
121
+ return entries.length ? { type: `readonly (${entries.map(entry => entry.type).join(' | ')})[]`,
122
+ schema: { type: 'array', items: { anyOf: entries.map(entry => entry.schema) } }, required: attributes.some(attribute => attribute.bag && attribute.required) } : undefined;
123
+ };
124
+ const groupObject = (nodes) => {
125
+ const properties = Object.create(null);
126
+ const required = [], members = [];
127
+ const visit = (node) => {
128
+ check();
129
+ if (!node.slot && !node.target) {
130
+ for (const child of node.children)
131
+ visit(child);
132
+ return;
133
+ }
134
+ const key = node.slot?.element.name.local ?? node.target.resolved.propertyName;
135
+ let description;
136
+ if (node.slot)
137
+ description = shape(node.slot.value);
138
+ else {
139
+ const name = node.target.resolved.typeName;
140
+ if (node.alternatives) {
141
+ const alternatives = node.children.map((child, index) => {
142
+ const alternative = node.alternatives[index].resolved.typeName, body = groupObject(child.children);
143
+ definitions[alternative] = body.schema;
144
+ declarations.push(`export type ${alternative} = ${body.type};`);
145
+ return { type: alternative, schema: { $ref: '#/definitions/' + alternative } };
146
+ });
147
+ definitions[name] = { anyOf: alternatives.map(a => a.schema) };
148
+ declarations.push(`export type ${name} = ${alternatives.map(a => a.type).join(' | ')};`);
149
+ }
150
+ else {
151
+ const body = groupObject(node.children);
152
+ definitions[name] = body.schema;
153
+ declarations.push(`export type ${name} = ${body.type};`);
154
+ }
155
+ description = { type: name, schema: { $ref: '#/definitions/' + name } };
156
+ }
157
+ const repeated = node.particle.occurs.max !== '1', mandatory = node.particle.occurs.min !== '0';
158
+ if (repeated)
159
+ description = { type: `readonly (${description.type})[]`, schema: { type: 'array', items: description.schema,
160
+ minItems: Number(node.particle.occurs.min), ...(node.particle.occurs.max === 'unbounded' ? {} : { maxItems: Number(node.particle.occurs.max) }) } };
161
+ properties[key] = description.schema;
162
+ if (mandatory)
163
+ required.push(key);
164
+ members.push(`readonly ${literal(key)}${mandatory ? '' : '?'}: ${description.type}`);
165
+ };
166
+ for (const node of nodes)
167
+ visit(node);
168
+ return { type: `{${members.join('; ')}}`, schema: { type: 'object', properties, required, additionalProperties: false } };
169
+ };
170
+ for (const record of projection.records) {
171
+ check();
172
+ const name = names.get(record.type.id);
173
+ const properties = Object.create(null);
174
+ const required = [], members = [];
175
+ const member = (key, value, mandatory) => {
176
+ check();
177
+ properties[key] = value.schema;
178
+ if (mandatory)
179
+ required.push(key);
180
+ members.push(` readonly ${literal(key)}${mandatory ? '' : '?'}: ${value.type};`);
181
+ };
182
+ for (const attribute of record.attributes)
183
+ if (!attribute.bag)
184
+ member(attribute.declaration.name.local, scalar(attribute), attribute.required);
185
+ const bag = attributeBag(record.attributes, !!record.attributeWildcard);
186
+ if (bag)
187
+ member('$attributes', bag, bag.required);
188
+ if (record.contextual)
189
+ member('$namespaces', { type: 'Readonly<Record<string, string>>', schema: { type: 'object', additionalProperties: { type: 'string' } } }, false);
190
+ if (record.text)
191
+ member('$value', scalar(record.text), true);
192
+ const group = applicationGroups?.records[record.type.id];
193
+ if (group) {
194
+ const description = groupObject(group.children);
195
+ const schema = description.schema;
196
+ Object.assign(properties, schema.properties);
197
+ required.push(...schema.required);
198
+ members.push(description.type.slice(1, -1));
199
+ }
200
+ else if (record.ordered) {
201
+ const variants = new Map();
202
+ for (const slot of record.slots) {
203
+ check();
204
+ const value = shape(slot.value), expanded = slot.element.name, key = literal(expanded);
205
+ if (record.keyed) {
206
+ const ambiguous = !record.fixedOrder && record.slots.some(other => other !== slot && other.element.name.local === expanded.local);
207
+ const scalarValue = slot.value.kind === 'scalar' ? scalar(slot.value) : value;
208
+ const holder = ambiguous ? { type: slot.value.kind === 'scalar'
209
+ ? `{readonly "$namespace": ${literal(expanded.namespace)}; readonly "$value": ${scalarValue.type}}`
210
+ : `(${value.type} & {readonly "$namespace": ${literal(expanded.namespace)}})`,
211
+ schema: slot.value.kind === 'scalar' ? { type: 'object', additionalProperties: false, required: ['$namespace', '$value'], properties: {
212
+ $namespace: { const: expanded.namespace }, $value: scalarValue.schema
213
+ } }
214
+ // @why Native validation owns the record's fixed fields; this structural superset must preserve the identity holder.
215
+ : { type: 'object', required: ['$namespace'], properties: { $namespace: { const: expanded.namespace } }, additionalProperties: true } } : value;
216
+ if (ambiguous && slot.value.kind === 'scalar' && slot.value.nillable && slot.value.constraint?.kind !== 'fixed') {
217
+ holder.type = `(${holder.type} | {readonly "$namespace": ${literal(expanded.namespace)}; readonly "$nil": true})`;
218
+ holder.schema = { anyOf: [holder.schema, { type: 'object', additionalProperties: false, required: ['$namespace', '$nil'], properties: {
219
+ $namespace: { const: expanded.namespace }, $nil: { const: true }
220
+ } }] };
221
+ }
222
+ variants.set(key, { type: `{readonly ${literal(expanded.local)}: ${holder.type}}`, schema: {
223
+ type: 'object', additionalProperties: false, required: [expanded.local], properties: { [expanded.local]: holder.schema }
224
+ } });
225
+ continue;
226
+ }
227
+ variants.set(key, { type: `{readonly name: {readonly namespace: ${literal(expanded.namespace)}; readonly local: ${literal(expanded.local)}}; readonly value: ${value.type}}`,
228
+ schema: { type: 'object', additionalProperties: false, required: ['name', 'value'], properties: {
229
+ name: { type: 'object', additionalProperties: false, required: ['namespace', 'local'], properties: { namespace: { const: expanded.namespace }, local: { const: expanded.local } } }, value: value.schema
230
+ } } });
231
+ }
232
+ if (record.content === 'mixed')
233
+ variants.set('$value', { type: '{readonly "$value": string}', schema: {
234
+ type: 'object', additionalProperties: false, required: ['$value'], properties: { $value: { type: 'string' } }
235
+ } });
236
+ if (inspectOrderedProjectionWildcards(context, record))
237
+ variants.set('*', record.keyed ? {
238
+ type: 'Readonly<Record<string, Readonly<{"$namespace": string; [key: string]: unknown}>>>',
239
+ schema: { type: 'object', minProperties: 1, maxProperties: 1, additionalProperties: { type: 'object',
240
+ required: ['$namespace'], properties: { $namespace: { type: 'string' }, $namespaces: { type: 'object', additionalProperties: { type: 'string' } },
241
+ $attributes: { type: 'array', items: lexicalAttribute }, $content: { type: 'array', items: { type: 'object' } }, $value: {} }, additionalProperties: true } },
242
+ } : {
243
+ type: '{readonly name: {readonly namespace: string; readonly local: string}; readonly value: unknown}',
244
+ schema: { type: 'object', additionalProperties: false, required: ['name', 'value'], properties: { name: { type: 'object', additionalProperties: false,
245
+ required: ['namespace', 'local'], properties: { namespace: { type: 'string' }, local: { type: 'string' } } }, value: {} } },
246
+ });
247
+ if (record.keyed && inspectUnassessedProjectionWildcards(context, record))
248
+ variants.set('*', openShape());
249
+ const entries = [...variants.values()];
250
+ member('$content', { type: `readonly (${entries.map(entry => entry.type).join(' | ') || 'never'})[]`,
251
+ schema: { type: 'array', items: entries.length ? { anyOf: entries.map(entry => entry.schema) } : { not: {} } } }, true);
252
+ }
253
+ else
254
+ for (const slot of record.slots) {
255
+ check();
256
+ const value = shape(slot.value), repeated = slot.particle.occurs.max !== '1';
257
+ member(slot.element.name.local, repeated ? { type: slot.particle.occurs.min === '1'
258
+ ? `readonly [${value.type}, ...(${value.type})[]]` : `readonly (${value.type})[]`, schema: { type: 'array', items: value.schema,
259
+ minItems: Number(slot.particle.occurs.min) } } : value, repeated || slot.particle.occurs.min === '1');
260
+ }
261
+ declarations.push(`export type ${name} = ${members.length ? '{\n' + members.join('\n') + '\n}' : 'Readonly<Record<string, never>>'};`);
262
+ definitions[name] = { type: 'object', properties, required, additionalProperties: false };
263
+ }
264
+ const root = shape(projection.root);
265
+ const id = 'urn:checked-component:shape:' + createHash('sha256').update(JSON.stringify({ selector: contract.selector, role })).digest('hex');
266
+ // @why Nested identified fault schemas must not expose a root-only $ref that recurses during Ajv resource resolution.
267
+ const rootSchema = root.schema.$ref ? { allOf: [root.schema] } : root.schema;
268
+ return { type: root.type, declarations, schema: { $id: id, ...rootSchema, definitions } };
269
+ }
@@ -14,4 +14,3 @@ export declare const resolvePreamble: (artifact: string) => string;
14
14
  * @constraints Embedded fragments must not pass through this composer separately.
15
15
  */
16
16
  export declare function composeGeneratedSource(body: string, preamble: string): string;
17
- //# sourceMappingURL=preamble.d.ts.map
@@ -0,0 +1,13 @@
1
+ /** Physical layout checks only; source interpretation and eligibility remain native responsibilities. */
2
+ import path from 'node:path';
3
+ import type { SchemaInput } from '../loader/schemaInput.js';
4
+ /** Find a finite common directory using complete parent segments, including valid names beginning with two dots.
5
+ * @throws Error For cross-volume inputs, cancellation or an impossible ancestor search.
6
+ */
7
+ export declare function commonSourceDirectory(root: string, files: readonly string[], check: () => void, paths?: Pick<typeof path, 'dirname' | 'parse' | 'relative' | 'isAbsolute' | 'sep'>): string;
8
+ /** Refuse local retrieval aliases that cannot be copied as a relocatable physical tree.
9
+ * @remarks HTTP aliases use generated offline URI records. Local symlink aliases remain unsupported;
10
+ * this scaffold does not invent filesystem links or rewrite original source bytes.
11
+ * @throws TypeError For unowned source input. Error For a nonrelocatable authenticated dependency or cancellation.
12
+ */
13
+ export declare function assertCanonicalSourceLayout(input: SchemaInput, check: () => void): void;