@voxgig/sdkgen 4.35.3 → 4.37.0

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 (270) hide show
  1. package/bin/voxgig-sdkgen +1 -1
  2. package/dist/cmp/ReadmeTop.js +1 -1
  3. package/dist/cmp/ReadmeTop.js.map +1 -1
  4. package/dist/helpers/opExample.d.ts +4 -1
  5. package/dist/helpers/opExample.js +11 -1
  6. package/dist/helpers/opExample.js.map +1 -1
  7. package/dist/helpers/opShape.d.ts +2 -1
  8. package/dist/helpers/opShape.js +53 -26
  9. package/dist/helpers/opShape.js.map +1 -1
  10. package/dist/helpers/pointPath.d.ts +2 -1
  11. package/dist/helpers/pointPath.js +17 -0
  12. package/dist/helpers/pointPath.js.map +1 -1
  13. package/dist/helpers/testPolicy.d.ts +48 -2
  14. package/dist/helpers/testPolicy.js +265 -0
  15. package/dist/helpers/testPolicy.js.map +1 -1
  16. package/dist/sdkgen.d.ts +7 -7
  17. package/dist/sdkgen.js +26 -4
  18. package/dist/sdkgen.js.map +1 -1
  19. package/dist/tsconfig.tsbuildinfo +1 -1
  20. package/package.json +1 -1
  21. package/project/.sdk/src/cmp/c/PrepareAuth_c.ts +10 -4
  22. package/project/.sdk/src/cmp/c/ReadmeEntity_c.ts +2 -2
  23. package/project/.sdk/src/cmp/c/ReadmeHowto_c.ts +2 -2
  24. package/project/.sdk/src/cmp/c/ReadmeQuick_c.ts +6 -5
  25. package/project/.sdk/src/cmp/c/ReadmeRef_c.ts +3 -3
  26. package/project/.sdk/src/cmp/c/ReadmeTopQuick_c.ts +2 -2
  27. package/project/.sdk/src/cmp/c/ReadmeTopTest_c.ts +2 -2
  28. package/project/.sdk/src/cmp/c/TestDirect_c.ts +2 -6
  29. package/project/.sdk/src/cmp/clojure/ReadmeEntity_clojure.ts +2 -2
  30. package/project/.sdk/src/cmp/clojure/ReadmeHowto_clojure.ts +2 -2
  31. package/project/.sdk/src/cmp/clojure/ReadmeQuick_clojure.ts +4 -4
  32. package/project/.sdk/src/cmp/clojure/ReadmeRef_clojure.ts +3 -3
  33. package/project/.sdk/src/cmp/clojure/ReadmeTopQuick_clojure.ts +2 -2
  34. package/project/.sdk/src/cmp/clojure/ReadmeTopTest_clojure.ts +2 -2
  35. package/project/.sdk/src/cmp/cpp/ReadmeEntity_cpp.ts +2 -2
  36. package/project/.sdk/src/cmp/cpp/ReadmeHowto_cpp.ts +2 -2
  37. package/project/.sdk/src/cmp/cpp/ReadmeQuick_cpp.ts +4 -4
  38. package/project/.sdk/src/cmp/cpp/ReadmeRef_cpp.ts +3 -3
  39. package/project/.sdk/src/cmp/cpp/ReadmeTopQuick_cpp.ts +2 -2
  40. package/project/.sdk/src/cmp/cpp/ReadmeTopTest_cpp.ts +2 -2
  41. package/project/.sdk/src/cmp/cpp/TestDirect_cpp.ts +2 -6
  42. package/project/.sdk/src/cmp/cpp/TestEntity_cpp.ts +51 -3
  43. package/project/.sdk/src/cmp/csharp/ReadmeEntity_csharp.ts +2 -2
  44. package/project/.sdk/src/cmp/csharp/ReadmeHowto_csharp.ts +2 -2
  45. package/project/.sdk/src/cmp/csharp/ReadmeQuick_csharp.ts +5 -5
  46. package/project/.sdk/src/cmp/csharp/ReadmeRef_csharp.ts +3 -3
  47. package/project/.sdk/src/cmp/csharp/ReadmeTopQuick_csharp.ts +3 -3
  48. package/project/.sdk/src/cmp/csharp/ReadmeTopTest_csharp.ts +2 -2
  49. package/project/.sdk/src/cmp/csharp/TestDirect_csharp.ts +41 -19
  50. package/project/.sdk/src/cmp/csharp/TestEntity_csharp.ts +105 -27
  51. package/project/.sdk/src/cmp/elixir/ReadmeEntity_elixir.ts +2 -2
  52. package/project/.sdk/src/cmp/elixir/ReadmeHowto_elixir.ts +2 -2
  53. package/project/.sdk/src/cmp/elixir/ReadmeQuick_elixir.ts +4 -4
  54. package/project/.sdk/src/cmp/elixir/ReadmeRef_elixir.ts +3 -3
  55. package/project/.sdk/src/cmp/elixir/ReadmeTopQuick_elixir.ts +2 -2
  56. package/project/.sdk/src/cmp/elixir/ReadmeTopTest_elixir.ts +2 -2
  57. package/project/.sdk/src/cmp/go/EntityOperation_go.ts +2 -2
  58. package/project/.sdk/src/cmp/go/Entity_go.ts +5 -4
  59. package/project/.sdk/src/cmp/go/MainEntity_go.ts +1 -1
  60. package/project/.sdk/src/cmp/go/Main_go.ts +9 -5
  61. package/project/.sdk/src/cmp/go/PrepareAuth_go.ts +24 -15
  62. package/project/.sdk/src/cmp/go/ReadmeEntity_go.ts +2 -2
  63. package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +2 -2
  64. package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +3 -3
  65. package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +4 -4
  66. package/project/.sdk/src/cmp/go/ReadmeRef_go.ts +4 -4
  67. package/project/.sdk/src/cmp/go/ReadmeTopTest_go.ts +2 -2
  68. package/project/.sdk/src/cmp/go/TestDirect_go.ts +61 -26
  69. package/project/.sdk/src/cmp/go/TestEntity_go.ts +115 -32
  70. package/project/.sdk/src/cmp/go-cli/fragment/words.fragment.go +1 -1
  71. package/project/.sdk/src/cmp/go-mcp/fragment/tools.fragment.go +1 -1
  72. package/project/.sdk/src/cmp/java/ReadmeEntity_java.ts +2 -2
  73. package/project/.sdk/src/cmp/java/ReadmeHowto_java.ts +2 -2
  74. package/project/.sdk/src/cmp/java/ReadmeQuick_java.ts +5 -5
  75. package/project/.sdk/src/cmp/java/ReadmeRef_java.ts +3 -3
  76. package/project/.sdk/src/cmp/java/ReadmeTopQuick_java.ts +3 -3
  77. package/project/.sdk/src/cmp/java/ReadmeTopTest_java.ts +2 -2
  78. package/project/.sdk/src/cmp/java/TestDirect_java.ts +40 -20
  79. package/project/.sdk/src/cmp/java/TestEntity_java.ts +107 -26
  80. package/project/.sdk/src/cmp/js/ReadmeEntity_js.ts +2 -2
  81. package/project/.sdk/src/cmp/js/ReadmeHowto_js.ts +2 -2
  82. package/project/.sdk/src/cmp/js/ReadmeQuick_js.ts +4 -4
  83. package/project/.sdk/src/cmp/js/ReadmeRef_js.ts +3 -3
  84. package/project/.sdk/src/cmp/js/ReadmeTopTest_js.ts +2 -2
  85. package/project/.sdk/src/cmp/js/TestDirect_js.ts +68 -13
  86. package/project/.sdk/src/cmp/js/TestEntity_js.ts +46 -4
  87. package/project/.sdk/src/cmp/kotlin/ReadmeEntity_kotlin.ts +2 -2
  88. package/project/.sdk/src/cmp/kotlin/ReadmeHowto_kotlin.ts +2 -2
  89. package/project/.sdk/src/cmp/kotlin/ReadmeQuick_kotlin.ts +5 -5
  90. package/project/.sdk/src/cmp/kotlin/ReadmeRef_kotlin.ts +3 -3
  91. package/project/.sdk/src/cmp/kotlin/ReadmeTopQuick_kotlin.ts +3 -3
  92. package/project/.sdk/src/cmp/kotlin/ReadmeTopTest_kotlin.ts +2 -2
  93. package/project/.sdk/src/cmp/kotlin/TestDirect_kotlin.ts +41 -21
  94. package/project/.sdk/src/cmp/kotlin/TestEntity_kotlin.ts +99 -22
  95. package/project/.sdk/src/cmp/lua/ReadmeEntity_lua.ts +2 -2
  96. package/project/.sdk/src/cmp/lua/ReadmeHowto_lua.ts +2 -2
  97. package/project/.sdk/src/cmp/lua/ReadmeQuick_lua.ts +4 -4
  98. package/project/.sdk/src/cmp/lua/ReadmeRef_lua.ts +3 -3
  99. package/project/.sdk/src/cmp/lua/ReadmeTopQuick_lua.ts +3 -3
  100. package/project/.sdk/src/cmp/lua/ReadmeTopTest_lua.ts +2 -2
  101. package/project/.sdk/src/cmp/lua/TestDirect_lua.ts +40 -16
  102. package/project/.sdk/src/cmp/lua/TestEntity_lua.ts +108 -30
  103. package/project/.sdk/src/cmp/ocaml/ReadmeEntity_ocaml.ts +2 -2
  104. package/project/.sdk/src/cmp/ocaml/ReadmeHowto_ocaml.ts +2 -2
  105. package/project/.sdk/src/cmp/ocaml/ReadmeQuick_ocaml.ts +4 -4
  106. package/project/.sdk/src/cmp/ocaml/ReadmeRef_ocaml.ts +3 -3
  107. package/project/.sdk/src/cmp/ocaml/ReadmeTopQuick_ocaml.ts +2 -2
  108. package/project/.sdk/src/cmp/ocaml/ReadmeTopTest_ocaml.ts +2 -2
  109. package/project/.sdk/src/cmp/perl/ReadmeEntity_perl.ts +2 -2
  110. package/project/.sdk/src/cmp/perl/ReadmeHowto_perl.ts +2 -2
  111. package/project/.sdk/src/cmp/perl/ReadmeQuick_perl.ts +4 -4
  112. package/project/.sdk/src/cmp/perl/ReadmeRef_perl.ts +3 -3
  113. package/project/.sdk/src/cmp/perl/ReadmeTopQuick_perl.ts +2 -2
  114. package/project/.sdk/src/cmp/perl/ReadmeTopTest_perl.ts +2 -2
  115. package/project/.sdk/src/cmp/perl/TestDirect_perl.ts +35 -16
  116. package/project/.sdk/src/cmp/perl/TestEntity_perl.ts +98 -22
  117. package/project/.sdk/src/cmp/php/ReadmeEntity_php.ts +2 -2
  118. package/project/.sdk/src/cmp/php/ReadmeHowto_php.ts +2 -2
  119. package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +4 -4
  120. package/project/.sdk/src/cmp/php/ReadmeRef_php.ts +3 -3
  121. package/project/.sdk/src/cmp/php/ReadmeTopQuick_php.ts +2 -2
  122. package/project/.sdk/src/cmp/php/ReadmeTopTest_php.ts +2 -2
  123. package/project/.sdk/src/cmp/php/TestDirect_php.ts +33 -16
  124. package/project/.sdk/src/cmp/php/TestEntity_php.ts +98 -29
  125. package/project/.sdk/src/cmp/py/ReadmeEntity_py.ts +2 -2
  126. package/project/.sdk/src/cmp/py/ReadmeHowto_py.ts +2 -2
  127. package/project/.sdk/src/cmp/py/ReadmeQuick_py.ts +4 -4
  128. package/project/.sdk/src/cmp/py/ReadmeRef_py.ts +3 -3
  129. package/project/.sdk/src/cmp/py/ReadmeTopQuick_py.ts +2 -2
  130. package/project/.sdk/src/cmp/py/ReadmeTopTest_py.ts +2 -2
  131. package/project/.sdk/src/cmp/py/TestDirect_py.ts +39 -16
  132. package/project/.sdk/src/cmp/py/TestEntity_py.ts +90 -27
  133. package/project/.sdk/src/cmp/rb/ReadmeEntity_rb.ts +2 -2
  134. package/project/.sdk/src/cmp/rb/ReadmeHowto_rb.ts +2 -2
  135. package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +4 -4
  136. package/project/.sdk/src/cmp/rb/ReadmeRef_rb.ts +3 -3
  137. package/project/.sdk/src/cmp/rb/ReadmeTopQuick_rb.ts +2 -2
  138. package/project/.sdk/src/cmp/rb/ReadmeTopTest_rb.ts +2 -2
  139. package/project/.sdk/src/cmp/rb/TestClean_rb.ts +1 -1
  140. package/project/.sdk/src/cmp/rb/TestDirect_rb.ts +33 -16
  141. package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +90 -25
  142. package/project/.sdk/src/cmp/rb/fragment/Main.fragment.rb +3 -3
  143. package/project/.sdk/src/cmp/rust/EntityOperation_rust.ts +1 -1
  144. package/project/.sdk/src/cmp/rust/Main_rust.ts +3 -1
  145. package/project/.sdk/src/cmp/rust/ReadmeEntity_rust.ts +2 -2
  146. package/project/.sdk/src/cmp/rust/ReadmeHowto_rust.ts +3 -3
  147. package/project/.sdk/src/cmp/rust/ReadmeModel_rust.ts +1 -1
  148. package/project/.sdk/src/cmp/rust/ReadmeQuick_rust.ts +5 -5
  149. package/project/.sdk/src/cmp/rust/ReadmeRef_rust.ts +4 -4
  150. package/project/.sdk/src/cmp/rust/ReadmeTopQuick_rust.ts +3 -3
  151. package/project/.sdk/src/cmp/rust/ReadmeTopTest_rust.ts +3 -3
  152. package/project/.sdk/src/cmp/rust/TestClean_rust.ts +1 -1
  153. package/project/.sdk/src/cmp/rust/TestDirect_rust.ts +40 -12
  154. package/project/.sdk/src/cmp/rust/TestEntity_rust.ts +109 -26
  155. package/project/.sdk/src/cmp/rust/fragment/Entity.fragment.rs +2 -2
  156. package/project/.sdk/src/cmp/scala/ReadmeEntity_scala.ts +2 -2
  157. package/project/.sdk/src/cmp/scala/ReadmeHowto_scala.ts +2 -2
  158. package/project/.sdk/src/cmp/scala/ReadmeQuick_scala.ts +5 -5
  159. package/project/.sdk/src/cmp/scala/ReadmeRef_scala.ts +3 -3
  160. package/project/.sdk/src/cmp/scala/ReadmeTopQuick_scala.ts +3 -3
  161. package/project/.sdk/src/cmp/scala/ReadmeTopTest_scala.ts +2 -2
  162. package/project/.sdk/src/cmp/scala/TestDirect_scala.ts +2 -6
  163. package/project/.sdk/src/cmp/scala/TestEntity_scala.ts +36 -7
  164. package/project/.sdk/src/cmp/swift/ReadmeEntity_swift.ts +2 -2
  165. package/project/.sdk/src/cmp/swift/ReadmeHowto_swift.ts +2 -2
  166. package/project/.sdk/src/cmp/swift/ReadmeQuick_swift.ts +5 -5
  167. package/project/.sdk/src/cmp/swift/ReadmeRef_swift.ts +3 -3
  168. package/project/.sdk/src/cmp/swift/ReadmeTopQuick_swift.ts +2 -2
  169. package/project/.sdk/src/cmp/swift/ReadmeTopTest_swift.ts +2 -2
  170. package/project/.sdk/src/cmp/ts/ReadmeEntity_ts.ts +2 -2
  171. package/project/.sdk/src/cmp/ts/ReadmeExamplesTest_ts.ts +49 -19
  172. package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +2 -2
  173. package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +4 -4
  174. package/project/.sdk/src/cmp/ts/ReadmeRef_ts.ts +3 -3
  175. package/project/.sdk/src/cmp/ts/ReadmeTopTest_ts.ts +3 -3
  176. package/project/.sdk/src/cmp/ts/TestDirect_ts.ts +54 -23
  177. package/project/.sdk/src/cmp/ts/TestEntity_ts.ts +49 -4
  178. package/project/.sdk/src/cmp/zig/ReadmeEntity_zig.ts +2 -2
  179. package/project/.sdk/src/cmp/zig/ReadmeHowto_zig.ts +2 -2
  180. package/project/.sdk/src/cmp/zig/ReadmeQuick_zig.ts +4 -4
  181. package/project/.sdk/src/cmp/zig/ReadmeRef_zig.ts +3 -3
  182. package/project/.sdk/src/cmp/zig/ReadmeTopQuick_zig.ts +2 -2
  183. package/project/.sdk/src/cmp/zig/ReadmeTopTest_zig.ts +2 -2
  184. package/project/.sdk/tm/c/core/sdk.h +2 -2
  185. package/project/.sdk/tm/c/tests/primary_utility_test.c +37 -0
  186. package/project/.sdk/tm/c/utility/fetcher.c +31 -1
  187. package/project/.sdk/tm/c/utility/make_url.c +6 -2
  188. package/project/.sdk/tm/clojure/src/sdk/core.clj +21 -3
  189. package/project/.sdk/tm/clojure/test/sdk/test/pipeline.clj +34 -0
  190. package/project/.sdk/tm/cpp/test/primary_utility_test.cpp +37 -0
  191. package/project/.sdk/tm/cpp/utility/pipeline.hpp +28 -2
  192. package/project/.sdk/tm/csharp/test/PrimaryUtilityTest.cs +40 -0
  193. package/project/.sdk/tm/csharp/utility/Fetcher.cs +27 -0
  194. package/project/.sdk/tm/csharp/utility/MakeUrl.cs +7 -2
  195. package/project/.sdk/tm/elixir/lib/projectname/utility.ex +30 -3
  196. package/project/.sdk/tm/elixir/test/pipeline_test.exs +23 -0
  197. package/project/.sdk/tm/go/core/helpers.go +1 -1
  198. package/project/.sdk/tm/go/core/types.go +9 -1
  199. package/project/.sdk/tm/go/test/feature_corpus_test.go +3 -4
  200. package/project/.sdk/tm/go/test/primary_utility_test.go +28 -0
  201. package/project/.sdk/tm/go/utility/fetcher.go +26 -0
  202. package/project/.sdk/tm/go/utility/make_url.go +5 -2
  203. package/project/.sdk/tm/java/test/FeatureCorpusTest.java +4 -5
  204. package/project/.sdk/tm/java/test/PrimaryUtilityTest.java +49 -0
  205. package/project/.sdk/tm/java/utility/Fetcher.java +24 -0
  206. package/project/.sdk/tm/java/utility/MakeUrl.java +6 -2
  207. package/project/.sdk/tm/js/src/utility/FetcherUtility.js +24 -0
  208. package/project/.sdk/tm/js/src/utility/MakeUrlUtility.js +6 -2
  209. package/project/.sdk/tm/js/test/feature/Corpus.test.js +7 -6
  210. package/project/.sdk/tm/js/test/live-entity.js +18 -6
  211. package/project/.sdk/tm/js/test/live-runner.js +15 -3
  212. package/project/.sdk/tm/js/test/utility/PrimaryUtility.test.js +25 -0
  213. package/project/.sdk/tm/kotlin/test/PrimaryUtilityTest.kt +48 -0
  214. package/project/.sdk/tm/kotlin/utility/Fetcher.kt +20 -0
  215. package/project/.sdk/tm/kotlin/utility/MakeSpecUrl.kt +6 -2
  216. package/project/.sdk/tm/lua/test/pipeline_test.lua +27 -0
  217. package/project/.sdk/tm/lua/test/primary_utility_test.lua +36 -0
  218. package/project/.sdk/tm/lua/utility/fetcher.lua +31 -0
  219. package/project/.sdk/tm/lua/utility/make_url.lua +6 -2
  220. package/project/.sdk/tm/ocaml/Makefile +5 -1
  221. package/project/.sdk/tm/ocaml/sdk_runtime.ml +36 -4
  222. package/project/.sdk/tm/ocaml/test/t_pipeline.ml +22 -0
  223. package/project/.sdk/tm/perl/t/primary_utility.t +22 -0
  224. package/project/.sdk/tm/perl/utility/fetcher.pm +18 -0
  225. package/project/.sdk/tm/perl/utility/make_url.pm +4 -2
  226. package/project/.sdk/tm/php/test/FeatureCorpusTest.php +6 -5
  227. package/project/.sdk/tm/php/test/PipelineTest.php +31 -7
  228. package/project/.sdk/tm/php/utility/Fetcher.php +34 -27
  229. package/project/.sdk/tm/php/utility/MakeOptions.php +2 -1
  230. package/project/.sdk/tm/php/utility/MakeUrl.php +6 -2
  231. package/project/.sdk/tm/py/pkg/utility/fetcher.py +23 -0
  232. package/project/.sdk/tm/py/pkg/utility/make_url.py +5 -2
  233. package/project/.sdk/tm/py/test/test_feature_corpus.py +5 -5
  234. package/project/.sdk/tm/py/test/test_primary_utility.py +21 -0
  235. package/project/.sdk/tm/rb/core/context.rb +1 -1
  236. package/project/.sdk/tm/rb/core/error.rb +20 -1
  237. package/project/.sdk/tm/rb/test/feature_corpus_test.rb +4 -5
  238. package/project/.sdk/tm/rb/test/feature_test.rb +2 -2
  239. package/project/.sdk/tm/rb/test/omni.rb +1 -1
  240. package/project/.sdk/tm/rb/test/pipeline_test.rb +19 -2
  241. package/project/.sdk/tm/rb/test/primary_utility_test.rb +28 -1
  242. package/project/.sdk/tm/rb/utility/fetcher.rb +20 -1
  243. package/project/.sdk/tm/rb/utility/make_error.rb +1 -1
  244. package/project/.sdk/tm/rb/utility/make_url.rb +4 -2
  245. package/project/.sdk/tm/rust/core/helpers.rs +1 -1
  246. package/project/.sdk/tm/rust/core/types.rs +2 -2
  247. package/project/.sdk/tm/rust/tests/primary_utility_test.rs +34 -0
  248. package/project/.sdk/tm/rust/utility/fetcher.rs +27 -0
  249. package/project/.sdk/tm/rust/utility/make_url.rs +7 -2
  250. package/project/.sdk/tm/scala/sdktest/SdkTestMain.scala +51 -1
  251. package/project/.sdk/tm/scala/utility/Fetcher.scala +16 -0
  252. package/project/.sdk/tm/scala/utility/Make.scala +6 -2
  253. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Fetcher.swift +24 -0
  254. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Make.swift +6 -2
  255. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +34 -0
  256. package/project/.sdk/tm/ts/src/utility/FetcherUtility.ts +24 -0
  257. package/project/.sdk/tm/ts/src/utility/MakeUrlUtility.ts +6 -2
  258. package/project/.sdk/tm/ts/test/feature/Corpus.test.ts +7 -6
  259. package/project/.sdk/tm/ts/test/live-entity.ts +20 -5
  260. package/project/.sdk/tm/ts/test/live-runner.ts +17 -3
  261. package/project/.sdk/tm/ts/test/utility/PrimaryUtility.test.ts +25 -0
  262. package/project/.sdk/tm/zig/core/utility.zig +30 -3
  263. package/project/.sdk/tm/zig/test/primary_utility_test.zig +28 -0
  264. package/project/sdkgen-package.json +1 -1
  265. package/src/cmp/ReadmeTop.ts +3 -3
  266. package/src/helpers/opExample.ts +16 -1
  267. package/src/helpers/opShape.ts +64 -30
  268. package/src/helpers/pointPath.ts +19 -0
  269. package/src/helpers/testPolicy.ts +316 -2
  270. package/src/sdkgen.ts +37 -5
@@ -1,6 +1,9 @@
1
1
  import { KIT } from '../types'
2
2
 
3
3
  import { flowSteps } from './buildIdNames'
4
+ import { primaryPoint } from './graphqlPoint'
5
+ import { getMatchEntries } from './getMatchEntries'
6
+ import { pointFacts } from './resolved'
4
7
 
5
8
 
6
9
  function liveStrict(model: any, target?: string): boolean {
@@ -72,6 +75,317 @@ function liveFlowNeeds(entity: any, flow: any): LiveFlowNeeds {
72
75
  }
73
76
 
74
77
 
75
- export type { LiveFlowNeeds }
78
+ // The *_ENTID key, the same in the live entity harness and every live test.
79
+ function liveIdKey(entityName: string, paramName: string): string {
80
+ return ('id' === paramName ? entityName : paramName.replace(/_id$/, '')) + '01'
81
+ }
82
+
83
+
84
+ function scalar(value: any): string | number | boolean | undefined {
85
+ return 'string' === typeof value || 'number' === typeof value || 'boolean' === typeof value ?
86
+ value : undefined
87
+ }
88
+
89
+
90
+ function scalarExample(arg: any): string | number | boolean | undefined {
91
+ return scalar(arg?.ex)
92
+ }
93
+
94
+
95
+ function liveExampleIds(entity: any): [string, string | number | boolean][] {
96
+ const ids: Record<string, string | number | boolean> = {}
97
+ for (const opname of ['list', 'load']) {
98
+ const points = entity?.op?.[opname]?.points
99
+ const point: any = null == points ? undefined : primaryPoint(points, entity.name, opname)
100
+ for (const arg of point?.g?.params || []) {
101
+ const key = liveIdKey(entity.name, arg.n)
102
+ const ex = scalarExample(arg)
103
+ if (undefined === ids[key] && undefined !== ex) ids[key] = ex
104
+ }
105
+ }
106
+ return Object.keys(ids).sort().map((key) => [key, ids[key]])
107
+ }
108
+
109
+
110
+ function liveQueryExamples(point: any): [string, string | number | boolean][] {
111
+ return (point?.g?.query || [])
112
+ .filter((arg: any) => arg.r && undefined !== scalarExample(arg))
113
+ .map((arg: any) => [arg.or || arg.n, scalarExample(arg)])
114
+ }
115
+
116
+
117
+ const plainPoints = (entity: any, opname: string): any[] => (entity?.op?.[opname]?.points || [])
118
+ .filter((point: any) => false !== point.a && null == point.q?.$action)
119
+
120
+
121
+ function routeExamples(point: any, bound: string[], pathBound: boolean):
122
+ [string, string | number | boolean][] | undefined {
123
+ const params = pathBound ? [] : point.g?.params || []
124
+ const args = [...params, ...(point.g?.query || []).filter((arg: any) => arg.r)]
125
+ const fill: [string, string | number | boolean][] = []
126
+ for (const arg of args) {
127
+ if (bound.includes(arg.n) || fill.some(([name]) => name === arg.n)) continue
128
+ const ex = scalarExample(arg)
129
+ if (undefined !== ex) fill.push([arg.n, ex])
130
+ else if (false !== arg.r) return undefined
131
+ }
132
+ return fill
133
+ }
134
+
135
+
136
+ // The live entity harness's route: the first whose required parameters are
137
+ // all bound or exemplified. A load of a known record binds its own path.
138
+ function liveRouteExamples(entity: any, opname: string, bound: string[], pathBound = false):
139
+ [string, string | number | boolean][] {
140
+ for (const point of plainPoints(entity, opname)) {
141
+ const fill = routeExamples(point, bound, pathBound)
142
+ if (null != fill) return fill
143
+ }
144
+ return []
145
+ }
146
+
76
147
 
77
- export { liveStrict, liveStrictNote, liveFlowNeeds }
148
+ function liveStepExamples(entity: any, step: any): [string, string | number | boolean][] {
149
+ if ('list' !== step?.o && 'load' !== step?.o) return []
150
+ const bound = getMatchEntries(step).map(([name]) => name)
151
+ const known = 'load' === step.o && null != entity?.id
152
+ const route = known ? flowLoadRoute(entity, step) : undefined
153
+ return null == route ? liveRouteExamples(entity, step.o, bound, known) :
154
+ routeExamples(route.point, bound, true) ?? []
155
+ }
156
+
157
+
158
+ const SCALAR_FIELD = ['`$STRING`', '`$INTEGER`', '`$NUMBER`', '`$BOOLEAN`']
159
+
160
+ type FlowRouteArg = { name: string, field?: string, idmap: string[] }
161
+
162
+ type FlowLoadRoute = { route: string, point: any, args: FlowRouteArg[], offline: boolean }
163
+
164
+
165
+ // The scalar field of the record a route parameter reads: the entity id's
166
+ // mapping for it, else its namesake; a dotted mapping reads into an object.
167
+ function recordField(entity: any, name: string): string | undefined {
168
+ const field = entity?.id?.from?.[name] ?? name
169
+ if ('string' !== typeof field || field.includes('.')) return undefined
170
+ const def: any = Object.values(entity?.fields || {}).find((f: any) => f?.n === field)
171
+ return SCALAR_FIELD.includes(def?.t) ? field : undefined
172
+ }
173
+
174
+
175
+ // The route a flow's load of a known record takes: the first the runtime
176
+ // tries that takes the id and whose other path parameters the record holds
177
+ // or the step binds, read from the record first. Without an id it is the route
178
+ // the step binds, filled from the record offline only. Undefined keeps the match.
179
+ function flowLoadRoute(entity: any, step: any): FlowLoadRoute | undefined {
180
+ if ('load' !== step?.o) return undefined
181
+ const keyed = null != entity?.id
182
+ const bound = new Map(getMatchEntries(step)
183
+ .filter(([name, binding]) => 'string' === typeof binding && (keyed || 'id' !== name)) as
184
+ [string, string][])
185
+ const order = [...bound.keys()]
186
+ const rank = (arg: FlowRouteArg) => order.includes(arg.name) ? order.indexOf(arg.name) : order.length
187
+ for (const point of plainPoints(entity, 'load')) {
188
+ const names = [...new Set<string>((point.g?.params || []).map((arg: any) => arg.n))]
189
+ if (keyed && !names.includes('id')) continue
190
+ const args: FlowRouteArg[] = names.filter((name) => !keyed || 'id' !== name).map((name) => {
191
+ const binding = bound.get(name)
192
+ return {
193
+ name, field: recordField(entity, name),
194
+ idmap: null == binding || binding === name ? [name] : [name, binding],
195
+ }
196
+ })
197
+ if (args.every((arg) => bound.has(arg.name) || (keyed && null != arg.field))) {
198
+ return {
199
+ route: routeOf(point), point, args: args.sort((a, b) => rank(a) - rank(b)), offline: !keyed,
200
+ }
201
+ }
202
+ }
203
+ return undefined
204
+ }
205
+
206
+
207
+ function flowLoadReadsRecord(entity: any, step: any): boolean {
208
+ return (flowLoadRoute(entity, step)?.args || []).some((arg) => null != arg.field)
209
+ }
210
+
211
+
212
+ // The flow, each load of a known record naming its route and record fields.
213
+ function liveFlowRoutes(entity: any, flow: any): any {
214
+ if (!Array.isArray(flow?.step)) return flow
215
+ const step = flow.step.map((step: any) => {
216
+ const route = flowLoadRoute(entity, step)
217
+ return null == route || route.offline ? step : {
218
+ ...step, route: route.route,
219
+ record: Object.fromEntries(route.args.filter((arg) => null != arg.field)
220
+ .map((arg) => [arg.name, arg.field])),
221
+ }
222
+ })
223
+ return { ...flow, step }
224
+ }
225
+
226
+
227
+ // The first value a parameter's enum allows; apidef already takes a schema
228
+ // default as the example.
229
+ function enumExample(facts: any, arg: any): string | number | boolean | undefined {
230
+ const where = 'param' === arg.k ? 'path' : arg.k
231
+ const def = (Array.isArray(facts?.parameters) ? facts.parameters : [])
232
+ .find((param: any) => param?.name === (arg.or ?? arg.n) && (null == param.in || param.in === where))
233
+ const values = (def?.schema ?? def)?.enum
234
+ return Array.isArray(values) ? scalar(values[0]) : undefined
235
+ }
236
+
237
+
238
+ // The entity as a live test reads it: a required parameter with no example
239
+ // takes the first value its definition's enum allows.
240
+ function liveEntity(ctx$: any, entity: any): any {
241
+ let filled = false
242
+ const op: any = {}
243
+ for (const [name, operation] of Object.entries(entity?.op || {}) as [string, any][]) {
244
+ op[name] = !Array.isArray(operation?.points) ? operation : {
245
+ ...operation,
246
+ points: operation.points.map((point: any) => {
247
+ if (null == point?.g) return point
248
+ const facts = pointFacts(ctx$, point)
249
+ const g = { ...point.g }
250
+ for (const kind of ['params', 'query'].filter((kind) => Array.isArray(g[kind]))) {
251
+ g[kind] = g[kind].map((arg: any) => {
252
+ const ex = !arg?.r || undefined !== scalarExample(arg) ? undefined : enumExample(facts, arg)
253
+ if (undefined === ex) return arg
254
+ filled = true
255
+ return { ...arg, ex }
256
+ })
257
+ }
258
+ return { ...point, g }
259
+ }),
260
+ }
261
+ }
262
+ return filled ? { ...entity, op } : entity
263
+ }
264
+
265
+
266
+ // Set by the GET-only guard of a read-only live run.
267
+ const LIVE_GETONLY_ENV = 'VOXGIG_GETONLY_GUARD'
268
+
269
+ type LiveExcluded = { id: string, reason: string }
270
+
271
+ type LiveGetOnly = {
272
+ excluded: LiveExcluded[]
273
+ // the steps left to run, as a flow
274
+ flow: any
275
+ }
276
+
277
+
278
+ // The steps of a flow the live harness runs, as its step ids count them.
279
+ function liveFlowSteps(flow: any): any[] {
280
+ return Object.values(flow?.step || {})
281
+ .filter((step: any) => false !== step?.a || true === step?.unreachable)
282
+ }
283
+
284
+
285
+ function liveStepId(entity: any, step: any, index: number): string {
286
+ return entity.name + '.' + step.o + '.' + index
287
+ }
288
+
289
+
290
+ const GETONLY = 'GET-only live run: '
291
+
292
+ const isGet = (point: any) => 'GET' === String(point?.m).toUpperCase()
293
+
294
+ const routeOf = (point: any) => String(point?.m).toUpperCase() + ' ' + point?.o
295
+
296
+
297
+ function writeRoute(entity: any, opname: string): string | undefined {
298
+ const points: any[] = (entity?.op?.[opname]?.points || []).filter((point: any) => false !== point.a)
299
+ return 0 === points.length || points.some(isGet) ? undefined : routeOf(points[0])
300
+ }
301
+
302
+
303
+ // Why a GET-only live run sends no request to a route: undefined for a GET.
304
+ function liveGetOnlyReason(point: any): string | undefined {
305
+ return isGet(point) ? undefined : GETONLY + 'needs ' + routeOf(point)
306
+ }
307
+
308
+
309
+ // What a GET-only live run leaves out of a flow: each step no GET route
310
+ // reaches, and each step that acts on a record only such a step gives.
311
+ // Undefined when every step can run.
312
+ function liveGetOnly(entity: any, flow: any): LiveGetOnly | undefined {
313
+ const steps = liveFlowSteps(flow)
314
+ const reasons = new Map<any, string>()
315
+ for (const step of steps) {
316
+ const route = writeRoute(entity, step.o)
317
+ if (null != route) reasons.set(step, 'needs ' + route)
318
+ }
319
+ if (0 === reasons.size) return undefined
320
+
321
+ const id = (step: any) => liveStepId(entity, step, steps.indexOf(step))
322
+ const left = () => steps.filter((step) => !reasons.has(step))
323
+ const create = steps.find((step) => 'create' === step.o && reasons.has(step))
324
+ const sources = steps.filter((step) => ['create', 'list'].includes(step.o) && reasons.has(step))
325
+ if (null != entity?.id && 0 < sources.length) {
326
+ for (const step of null == create ? [] : left()) {
327
+ if (['update', 'remove'].includes(step.o)) {
328
+ reasons.set(step, 'acts on the record ' + id(create) + ' makes')
329
+ }
330
+ else if ('list' === step.o && (step.v || []).some((v: any) => 'ItemNotExists' === v?.apply)) {
331
+ reasons.set(step, 'checks a removal this run does not make')
332
+ }
333
+ }
334
+ if (!left().some((step) => 'list' === step.o)) {
335
+ for (const step of left().filter((step) => 'load' === step.o)) {
336
+ reasons.set(step, 'reads a record only ' + sources.map(id).join(', ') + ' gives')
337
+ }
338
+ }
339
+ }
340
+
341
+ return {
342
+ excluded: steps.filter((step) => reasons.has(step))
343
+ .map((step) => ({ id: id(step), reason: GETONLY + reasons.get(step) })),
344
+ flow: { ...flow, step: left() },
345
+ }
346
+ }
347
+
348
+
349
+ type LiveKeyExcluded = LiveExcluded & { key: string }
350
+
351
+
352
+ // The ids a live direct test needs that a GET-only run cannot get, unless
353
+ // *_ENTID gives them: of a record only a non-GET create makes, no GET list finds.
354
+ function liveDirectGetOnly(model: any, entity: any, test: string, keys: string[]): LiveKeyExcluded[] {
355
+ const entities = model?.main?.[KIT]?.entity || {}
356
+ const out: LiveKeyExcluded[] = []
357
+ for (const key of keys) {
358
+ const owner = liveIdKey(entity.name, 'id') === key ? entity : entities[key.replace(/01$/, '')]
359
+ const make = null == owner ? undefined : writeRoute(owner, 'create')
360
+ const listed = (owner?.op?.list?.points || []).some((point: any) => false !== point.a && isGet(point))
361
+ if (null != make && !listed) {
362
+ out.push({ key, id: test, reason: GETONLY + 'needs ' + key + ', which only ' + make + ' gives' })
363
+ }
364
+ }
365
+ return out
366
+ }
367
+
368
+
369
+ // The lines the live harness prints for the steps a run leaves out.
370
+ function liveExcludedLines(plan: { excluded: LiveExcluded[] }): string[] {
371
+ return plan.excluded.map(({ id, reason }) =>
372
+ 'LIVE STEP ' + JSON.stringify({ id, state: 'excluded', attempted: false, reason }))
373
+ }
374
+
375
+
376
+ // Why a test whose every step is left out skips, as the live harness says it.
377
+ function liveExcludedSummary(plan: { excluded: LiveExcluded[] }): string {
378
+ return 'Live coverage incomplete: ' +
379
+ plan.excluded.map(({ id, reason }) => id + ' excluded (' + reason + ')').join('; ')
380
+ }
381
+
382
+
383
+ export type { LiveFlowNeeds, LiveExcluded, LiveGetOnly, LiveKeyExcluded, FlowRouteArg, FlowLoadRoute }
384
+
385
+ export {
386
+ liveStrict, liveStrictNote, liveFlowNeeds,
387
+ liveIdKey, liveExampleIds, liveQueryExamples, liveRouteExamples, liveStepExamples,
388
+ flowLoadRoute, flowLoadReadsRecord, liveFlowRoutes,
389
+ liveEntity, LIVE_GETONLY_ENV, liveFlowSteps, liveStepId, liveGetOnly, liveGetOnlyReason,
390
+ liveDirectGetOnly, liveExcludedLines, liveExcludedSummary,
391
+ }
package/src/sdkgen.ts CHANGED
@@ -71,19 +71,25 @@ import type { DepEntry } from './helpers/collectDeps'
71
71
  import { canonToType, canonToDtype, canonKey, canonScalarKey } from './helpers/canonType'
72
72
  import { canonToSpec, entityDataSpec, entityOpSpec, entitySpecs, validateSeeds } from './helpers/canonSpec'
73
73
  import { optionSpec, featureOptionSpec, entitySpecMap } from './helpers/optspec'
74
- import { OP_SUFFIX, opTypeName, opParams, opReachable, opNeedsAction, ownPoint, opActions, entityActions, entityPath, opRequestShape, entityIdField, entityDataIdField, entityOps, invalidRequest, entityPrimaryOp, pickExampleEntity, entityClassName, entityTypeCollisions, warnEntityTypeCollisions, ungeneratedOps, warnUngeneratedOps, deriveEntityNames, entityCollection } from './helpers/opShape'
74
+ import { OP_SUFFIX, opTypeName, opParams, opReachable, opNeedsAction, ownPoint, opActions, entityActions, entityPath, opRequestShape, entityIdField, entityDataIdField, entityOps, invalidRequest, entityPrimaryOp, pickExampleEntity, entityClassName, entityConstructorName, entityTypeCollisions, warnEntityTypeCollisions, ungeneratedOps, warnUngeneratedOps, deriveEntityNames, entityCollection } from './helpers/opShape'
75
75
  import { isReservedName, safeVarName, exampleVarName, phpEntityAccessor, entityCacheField, isRbCoreConstant, isRbSdkConstant, rbSafeTypeName, isSwiftSdkType, swiftSafeTypeName, isPhpReservedType, isPhpSdkClass, phpSafeTypeName, isTsReservedType, isTsSdkType, tsSafeTypeName, isElixirReservedType, elixirSafeTypeName, elixirTypeNames, elixirTypeName, elixirAccessorNames, elixirAccessor, tsTypeName, rbTypeName, phpTypeName, swiftTypeName, jsProp, jsOptProp, jsKey, jsQuote, luaKey, luaString, prefixLeadingDigit } from './helpers/naming'
76
76
  import { serverVariables, hasServerVariables, serverVarEnv } from './helpers/serverVars'
77
77
  import { mcpTools, MCP_READ_OPS, MCP_WRITE_OPS } from './helpers/mcpTools'
78
78
  import type { McpTool } from './helpers/mcpTools'
79
79
  import {
80
- primaryOpCall, idLiteral, requiredItems, matchExampleItems, matchArg, listMatchArg, seededList, dataArg, javaMap, javaMapOf, javaMapItems, litFor,
80
+ primaryOpCall, idLiteral, requiredItems, requestExampleItems, sendsId, matchExampleItems, matchArg, listMatchArg, seededList, dataArg, javaMap, javaMapOf, javaMapItems, litFor,
81
81
  litPair, litString,
82
82
  } from './helpers/opExample'
83
83
  import type { ExampleLang, LiteralLang } from './helpers/opExample'
84
- import { liveStrict, liveStrictNote, liveFlowNeeds } from './helpers/testPolicy'
85
- import type { LiveFlowNeeds } from './helpers/testPolicy'
86
- import { pointSegments, pointParts, pointTerminalParam, pointPathKey }
84
+ import {
85
+ liveStrict, liveStrictNote, liveFlowNeeds,
86
+ liveIdKey, liveExampleIds, liveQueryExamples, liveRouteExamples, liveStepExamples,
87
+ flowLoadRoute, flowLoadReadsRecord, liveFlowRoutes,
88
+ liveEntity, LIVE_GETONLY_ENV, liveFlowSteps, liveStepId, liveGetOnly, liveGetOnlyReason,
89
+ liveDirectGetOnly, liveExcludedLines, liveExcludedSummary,
90
+ } from './helpers/testPolicy'
91
+ import type { LiveFlowNeeds, LiveExcluded, LiveGetOnly, LiveKeyExcluded, FlowRouteArg, FlowLoadRoute } from './helpers/testPolicy'
92
+ import { pointSegments, pointParts, pointPlaceholders, pointTerminalParam, pointPathKey }
87
93
  from './helpers/pointPath'
88
94
  import { pointIsGraphql, ownPointFirst, primaryPoint, graphqlDirectSkip } from './helpers/graphqlPoint'
89
95
  import type { PathSegment } from './helpers/pointPath'
@@ -994,6 +1000,11 @@ export type {
994
1000
  McpTool,
995
1001
  DepEntry,
996
1002
  LiveFlowNeeds,
1003
+ LiveExcluded,
1004
+ LiveGetOnly,
1005
+ LiveKeyExcluded,
1006
+ FlowRouteArg,
1007
+ FlowLoadRoute,
997
1008
  PathSegment,
998
1009
  FeatureSource,
999
1010
  DoctorReport,
@@ -1120,6 +1131,7 @@ export {
1120
1131
 
1121
1132
  pointSegments,
1122
1133
  pointParts,
1134
+ pointPlaceholders,
1123
1135
  pointTerminalParam,
1124
1136
  pointPathKey,
1125
1137
  pointIsGraphql,
@@ -1156,6 +1168,7 @@ export {
1156
1168
  entityPrimaryOp,
1157
1169
  pickExampleEntity,
1158
1170
  entityClassName,
1171
+ entityConstructorName,
1159
1172
  entityTypeCollisions,
1160
1173
  warnEntityTypeCollisions,
1161
1174
  ungeneratedOps,
@@ -1200,9 +1213,28 @@ export {
1200
1213
  liveStrict,
1201
1214
  liveStrictNote,
1202
1215
  liveFlowNeeds,
1216
+ liveIdKey,
1217
+ liveExampleIds,
1218
+ liveQueryExamples,
1219
+ liveRouteExamples,
1220
+ liveStepExamples,
1221
+ flowLoadRoute,
1222
+ flowLoadReadsRecord,
1223
+ liveFlowRoutes,
1224
+ liveEntity,
1225
+ LIVE_GETONLY_ENV,
1226
+ liveFlowSteps,
1227
+ liveStepId,
1228
+ liveGetOnly,
1229
+ liveGetOnlyReason,
1230
+ liveDirectGetOnly,
1231
+ liveExcludedLines,
1232
+ liveExcludedSummary,
1203
1233
  primaryOpCall,
1204
1234
  idLiteral,
1205
1235
  requiredItems,
1236
+ requestExampleItems,
1237
+ sendsId,
1206
1238
  matchExampleItems,
1207
1239
  matchArg,
1208
1240
  listMatchArg,