@voxgig/sdkgen 4.51.0 → 4.52.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 (289) hide show
  1. package/bin/voxgig-sdkgen +1 -1
  2. package/dist/cmp/ReadmeExplanation.js +5 -2
  3. package/dist/cmp/ReadmeExplanation.js.map +1 -1
  4. package/dist/cmp/ReadmeFeatures.js +20 -6
  5. package/dist/cmp/ReadmeFeatures.js.map +1 -1
  6. package/dist/helpers/optspec.js +2 -2
  7. package/dist/helpers/optspec.js.map +1 -1
  8. package/dist/tsconfig.tsbuildinfo +1 -1
  9. package/model/sdkgen.aontu +1 -1
  10. package/package.json +1 -1
  11. package/project/.sdk/model/feature/audit.aontu +1 -1
  12. package/project/.sdk/model/feature/cache.aontu +1 -1
  13. package/project/.sdk/model/feature/clienttrack.aontu +1 -1
  14. package/project/.sdk/model/feature/cost.aontu +1 -1
  15. package/project/.sdk/model/feature/debug.aontu +1 -1
  16. package/project/.sdk/model/feature/idempotency.aontu +1 -1
  17. package/project/.sdk/model/feature/log.aontu +1 -1
  18. package/project/.sdk/model/feature/metrics.aontu +3 -1
  19. package/project/.sdk/model/feature/netsim.aontu +1 -1
  20. package/project/.sdk/model/feature/paging.aontu +4 -1
  21. package/project/.sdk/model/feature/proxy.aontu +1 -1
  22. package/project/.sdk/model/feature/ratelimit.aontu +3 -3
  23. package/project/.sdk/model/feature/rbac.aontu +1 -1
  24. package/project/.sdk/model/feature/retry.aontu +1 -1
  25. package/project/.sdk/model/feature/secrets.aontu +1 -1
  26. package/project/.sdk/model/feature/streaming.aontu +1 -1
  27. package/project/.sdk/model/feature/telemetry.aontu +2 -2
  28. package/project/.sdk/model/feature/test.aontu +1 -1
  29. package/project/.sdk/model/feature/timeout.aontu +1 -1
  30. package/project/.sdk/model/feature/validate.aontu +1 -1
  31. package/project/.sdk/src/cmp/c/TestClean_c.ts +12 -11
  32. package/project/.sdk/src/cmp/c/fragment/Entity.fragment.c +17 -10
  33. package/project/.sdk/src/cmp/clojure/fragment/Entity.fragment.clj +18 -1
  34. package/project/.sdk/src/cmp/cpp/TestClean_cpp.ts +2 -1
  35. package/project/.sdk/src/cmp/csharp/fragment/EntityBase.fragment.cs +30 -2
  36. package/project/.sdk/src/cmp/csharp/fragment/Main.fragment.cs +31 -12
  37. package/project/.sdk/src/cmp/elixir/TestClean_elixir.ts +2 -1
  38. package/project/.sdk/src/cmp/elixir/fragment/Main.fragment.ex +51 -15
  39. package/project/.sdk/src/cmp/elixir/fragment/Pipeline.fragment.ex +17 -0
  40. package/project/.sdk/src/cmp/go/fragment/Entity.fragment.go +42 -2
  41. package/project/.sdk/src/cmp/go/fragment/Main.fragment.go +42 -14
  42. package/project/.sdk/src/cmp/java/TestClean_java.ts +9 -4
  43. package/project/.sdk/src/cmp/java/fragment/EntityBase.fragment.java +21 -0
  44. package/project/.sdk/src/cmp/js/ReadmeHowto_js.ts +13 -8
  45. package/project/.sdk/src/cmp/js/fragment/EntityBase.fragment.js +26 -2
  46. package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +8 -0
  47. package/project/.sdk/src/cmp/js/fragment/EntityListOp.fragment.js +8 -0
  48. package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +8 -0
  49. package/project/.sdk/src/cmp/js/fragment/EntityPatchOp.fragment.js +8 -0
  50. package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +8 -0
  51. package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +8 -0
  52. package/project/.sdk/src/cmp/js/fragment/Main.fragment.js +12 -5
  53. package/project/.sdk/src/cmp/kotlin/TestClean_kotlin.ts +9 -4
  54. package/project/.sdk/src/cmp/kotlin/fragment/EntityBase.fragment.kt +19 -0
  55. package/project/.sdk/src/cmp/lua/TestClean_lua.ts +2 -1
  56. package/project/.sdk/src/cmp/lua/fragment/Entity.fragment.lua +42 -5
  57. package/project/.sdk/src/cmp/lua/fragment/Main.fragment.lua +44 -10
  58. package/project/.sdk/src/cmp/lua/utility_lua.ts +2 -1
  59. package/project/.sdk/src/cmp/ocaml/TestClean_ocaml.ts +2 -1
  60. package/project/.sdk/src/cmp/ocaml/fragment/RunOp.fragment.ml +36 -21
  61. package/project/.sdk/src/cmp/perl/TestClean_perl.ts +1 -1
  62. package/project/.sdk/src/cmp/perl/fragment/Entity.fragment.pm +21 -0
  63. package/project/.sdk/src/cmp/perl/fragment/Main.fragment.pm +31 -12
  64. package/project/.sdk/src/cmp/php/fragment/Entity.fragment.php +33 -4
  65. package/project/.sdk/src/cmp/php/fragment/Main.fragment.php +13 -6
  66. package/project/.sdk/src/cmp/py/fragment/Entity.fragment.py +25 -2
  67. package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +26 -12
  68. package/project/.sdk/src/cmp/rb/TestClean_rb.ts +1 -1
  69. package/project/.sdk/src/cmp/rb/fragment/Entity.fragment.rb +23 -2
  70. package/project/.sdk/src/cmp/rb/fragment/Main.fragment.rb +27 -11
  71. package/project/.sdk/src/cmp/rust/TestClean_rust.ts +14 -17
  72. package/project/.sdk/src/cmp/rust/fragment/Entity.fragment.rs +22 -2
  73. package/project/.sdk/src/cmp/scala/TestClean_scala.ts +11 -11
  74. package/project/.sdk/src/cmp/scala/fragment/EntityBase.fragment.scala +14 -0
  75. package/project/.sdk/src/cmp/swift/TestClean_swift.ts +11 -11
  76. package/project/.sdk/src/cmp/swift/fragment/EntityBase.fragment.swift +9 -0
  77. package/project/.sdk/src/cmp/swift/fragment/Main.fragment.swift +24 -10
  78. package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +13 -8
  79. package/project/.sdk/src/cmp/ts/fragment/EntityBase.fragment.ts +26 -2
  80. package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +8 -0
  81. package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +8 -0
  82. package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +8 -0
  83. package/project/.sdk/src/cmp/ts/fragment/EntityPatchOp.fragment.ts +8 -0
  84. package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.ts +8 -0
  85. package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +8 -0
  86. package/project/.sdk/src/cmp/ts/fragment/Main.fragment.ts +12 -5
  87. package/project/.sdk/src/cmp/zig/TestClean_zig.ts +11 -11
  88. package/project/.sdk/src/cmp/zig/fragment/Entity.fragment.zig +17 -10
  89. package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +41 -6
  90. package/project/.sdk/tm/c/feature/metrics.c +7 -0
  91. package/project/.sdk/tm/c/feature/paging.c +231 -2
  92. package/project/.sdk/tm/c/feature/ratelimit.c +5 -9
  93. package/project/.sdk/tm/c/feature/retry.c +51 -4
  94. package/project/.sdk/tm/c/feature/streaming.c +2 -1
  95. package/project/.sdk/tm/c/feature/telemetry.c +19 -18
  96. package/project/.sdk/tm/c/feature/test.c +78 -54
  97. package/project/.sdk/tm/c/tests/feature_test.c +184 -0
  98. package/project/.sdk/tm/c/tests/primary_utility_test.c +2 -0
  99. package/project/.sdk/tm/c/utility/make_options.c +80 -9
  100. package/project/.sdk/tm/clojure/src/sdk/core.clj +31 -11
  101. package/project/.sdk/tm/clojure/src/sdk/features.clj +198 -70
  102. package/project/.sdk/tm/clojure/test/sdk/test/feature.clj +70 -1
  103. package/project/.sdk/tm/cpp/core/types.hpp +137 -68
  104. package/project/.sdk/tm/cpp/feature/audit.hpp +6 -1
  105. package/project/.sdk/tm/cpp/feature/metrics.hpp +19 -0
  106. package/project/.sdk/tm/cpp/feature/paging.hpp +160 -2
  107. package/project/.sdk/tm/cpp/feature/ratelimit.hpp +18 -14
  108. package/project/.sdk/tm/cpp/feature/retry.hpp +46 -5
  109. package/project/.sdk/tm/cpp/feature/streaming.hpp +2 -1
  110. package/project/.sdk/tm/cpp/feature/telemetry.hpp +17 -10
  111. package/project/.sdk/tm/cpp/feature/test.hpp +63 -53
  112. package/project/.sdk/tm/cpp/test/feature_test.cpp +137 -0
  113. package/project/.sdk/tm/cpp/utility/pipeline.hpp +35 -5
  114. package/project/.sdk/tm/csharp/feature/AuditFeature.cs +8 -1
  115. package/project/.sdk/tm/csharp/feature/MetricsFeature.cs +23 -0
  116. package/project/.sdk/tm/csharp/feature/PagingFeature.cs +130 -3
  117. package/project/.sdk/tm/csharp/feature/RatelimitFeature.cs +26 -19
  118. package/project/.sdk/tm/csharp/feature/RetryFeature.cs +41 -7
  119. package/project/.sdk/tm/csharp/feature/StreamingFeature.cs +2 -1
  120. package/project/.sdk/tm/csharp/feature/TelemetryFeature.cs +11 -9
  121. package/project/.sdk/tm/csharp/feature/TestFeature.cs +55 -67
  122. package/project/.sdk/tm/csharp/test/FeatureTest.cs +162 -0
  123. package/project/.sdk/tm/csharp/utility/MakeOptions.cs +89 -12
  124. package/project/.sdk/tm/elixir/lib/projectname/feature/metrics.ex +13 -0
  125. package/project/.sdk/tm/elixir/lib/projectname/feature/paging.ex +110 -5
  126. package/project/.sdk/tm/elixir/lib/projectname/feature/ratelimit.ex +6 -12
  127. package/project/.sdk/tm/elixir/lib/projectname/feature/retry.ex +33 -9
  128. package/project/.sdk/tm/elixir/lib/projectname/feature/streaming.ex +2 -1
  129. package/project/.sdk/tm/elixir/lib/projectname/feature/telemetry.ex +7 -7
  130. package/project/.sdk/tm/elixir/lib/projectname/feature/test.ex +52 -48
  131. package/project/.sdk/tm/elixir/lib/projectname/utility.ex +59 -35
  132. package/project/.sdk/tm/elixir/test/feature_test.exs +137 -0
  133. package/project/.sdk/tm/go/feature/audit_feature.go +1 -3
  134. package/project/.sdk/tm/go/feature/base_feature.go +11 -0
  135. package/project/.sdk/tm/go/feature/metrics_feature.go +14 -0
  136. package/project/.sdk/tm/go/feature/paging_feature.go +108 -2
  137. package/project/.sdk/tm/go/feature/ratelimit_feature.go +19 -17
  138. package/project/.sdk/tm/go/feature/retry_feature.go +81 -9
  139. package/project/.sdk/tm/go/feature/streaming_feature.go +2 -1
  140. package/project/.sdk/tm/go/feature/telemetry_feature.go +18 -11
  141. package/project/.sdk/tm/go/feature/test_feature.go +65 -55
  142. package/project/.sdk/tm/go/test/feature_corpus_test.go +209 -28
  143. package/project/.sdk/tm/go/test/feature_test.go +32 -0
  144. package/project/.sdk/tm/go/utility/make_options.go +111 -6
  145. package/project/.sdk/tm/java/core/SdkClient.java +43 -14
  146. package/project/.sdk/tm/java/feature/AuditFeature.java +5 -1
  147. package/project/.sdk/tm/java/feature/MetricsFeature.java +31 -0
  148. package/project/.sdk/tm/java/feature/PagingFeature.java +156 -2
  149. package/project/.sdk/tm/java/feature/RatelimitFeature.java +15 -13
  150. package/project/.sdk/tm/java/feature/RetryFeature.java +33 -6
  151. package/project/.sdk/tm/java/feature/StreamingFeature.java +2 -1
  152. package/project/.sdk/tm/java/feature/TelemetryFeature.java +17 -9
  153. package/project/.sdk/tm/java/feature/TestFeature.java +50 -63
  154. package/project/.sdk/tm/java/test/FeatureCorpusTest.java +170 -17
  155. package/project/.sdk/tm/java/utility/MakeOptions.java +128 -14
  156. package/project/.sdk/tm/js/src/feature/metrics/MetricsFeature.js +8 -3
  157. package/project/.sdk/tm/js/src/feature/paging/PagingFeature.js +99 -1
  158. package/project/.sdk/tm/js/src/feature/ratelimit/RatelimitFeature.js +5 -9
  159. package/project/.sdk/tm/js/src/feature/retry/RetryFeature.js +25 -3
  160. package/project/.sdk/tm/js/src/feature/streaming/StreamingFeature.js +2 -1
  161. package/project/.sdk/tm/js/src/feature/telemetry/TelemetryFeature.js +11 -6
  162. package/project/.sdk/tm/js/src/feature/test/TestFeature.js +38 -1
  163. package/project/.sdk/tm/js/src/utility/MakeOptionsUtility.js +55 -6
  164. package/project/.sdk/tm/js/test/feature/Corpus.test.js +95 -25
  165. package/project/.sdk/tm/js/test/feature.test.js +14 -1
  166. package/project/.sdk/tm/kotlin/core/SdkClient.kt +23 -10
  167. package/project/.sdk/tm/kotlin/feature/AuditFeature.kt +5 -1
  168. package/project/.sdk/tm/kotlin/feature/MetricsFeature.kt +22 -0
  169. package/project/.sdk/tm/kotlin/feature/PagingFeature.kt +125 -2
  170. package/project/.sdk/tm/kotlin/feature/RatelimitFeature.kt +16 -13
  171. package/project/.sdk/tm/kotlin/feature/RetryFeature.kt +36 -14
  172. package/project/.sdk/tm/kotlin/feature/StreamingFeature.kt +4 -0
  173. package/project/.sdk/tm/kotlin/feature/TelemetryFeature.kt +12 -10
  174. package/project/.sdk/tm/kotlin/feature/TestFeature.kt +45 -48
  175. package/project/.sdk/tm/kotlin/test/FeatureTest.kt +114 -0
  176. package/project/.sdk/tm/kotlin/utility/MakeOptions.kt +83 -14
  177. package/project/.sdk/tm/lua/feature/debug_feature.lua +2 -3
  178. package/project/.sdk/tm/lua/feature/metrics_feature.lua +5 -0
  179. package/project/.sdk/tm/lua/feature/paging_feature.lua +143 -2
  180. package/project/.sdk/tm/lua/feature/ratelimit_feature.lua +5 -9
  181. package/project/.sdk/tm/lua/feature/retry_feature.lua +43 -5
  182. package/project/.sdk/tm/lua/feature/streaming_feature.lua +2 -1
  183. package/project/.sdk/tm/lua/feature/telemetry_feature.lua +18 -7
  184. package/project/.sdk/tm/lua/feature/test_feature.lua +60 -62
  185. package/project/.sdk/tm/lua/test/feature_test.lua +100 -3
  186. package/project/.sdk/tm/lua/utility/make_options.lua +55 -13
  187. package/project/.sdk/tm/ocaml/sdk_features.ml +286 -60
  188. package/project/.sdk/tm/ocaml/sdk_runtime.ml +34 -11
  189. package/project/.sdk/tm/ocaml/test/t_feature.ml +72 -1
  190. package/project/.sdk/tm/perl/feature/debug_feature.pm +2 -2
  191. package/project/.sdk/tm/perl/feature/metrics_feature.pm +5 -0
  192. package/project/.sdk/tm/perl/feature/paging_feature.pm +139 -2
  193. package/project/.sdk/tm/perl/feature/ratelimit_feature.pm +5 -11
  194. package/project/.sdk/tm/perl/feature/retry_feature.pm +22 -4
  195. package/project/.sdk/tm/perl/feature/streaming_feature.pm +2 -0
  196. package/project/.sdk/tm/perl/feature/telemetry_feature.pm +17 -8
  197. package/project/.sdk/tm/perl/feature/test_feature.pm +45 -50
  198. package/project/.sdk/tm/perl/t/feature.t +2 -2
  199. package/project/.sdk/tm/perl/t/feature_corpus.t +126 -23
  200. package/project/.sdk/tm/perl/utility/make_options.pm +33 -10
  201. package/project/.sdk/tm/php/feature/MetricsFeature.php +8 -0
  202. package/project/.sdk/tm/php/feature/PagingFeature.php +128 -1
  203. package/project/.sdk/tm/php/feature/RatelimitFeature.php +5 -9
  204. package/project/.sdk/tm/php/feature/RetryFeature.php +27 -3
  205. package/project/.sdk/tm/php/feature/StreamingFeature.php +2 -1
  206. package/project/.sdk/tm/php/feature/TelemetryFeature.php +10 -7
  207. package/project/.sdk/tm/php/feature/TestFeature.php +55 -47
  208. package/project/.sdk/tm/php/test/FeatureCorpusTest.php +151 -16
  209. package/project/.sdk/tm/php/utility/MakeOptions.php +40 -13
  210. package/project/.sdk/tm/py/pkg/feature/metrics_feature.py +7 -0
  211. package/project/.sdk/tm/py/pkg/feature/paging_feature.py +86 -1
  212. package/project/.sdk/tm/py/pkg/feature/ratelimit_feature.py +13 -16
  213. package/project/.sdk/tm/py/pkg/feature/retry_feature.py +31 -6
  214. package/project/.sdk/tm/py/pkg/feature/streaming_feature.py +2 -1
  215. package/project/.sdk/tm/py/pkg/feature/telemetry_feature.py +10 -6
  216. package/project/.sdk/tm/py/pkg/feature/test_feature.py +56 -53
  217. package/project/.sdk/tm/py/pkg/utility/make_options.py +68 -20
  218. package/project/.sdk/tm/py/test/test_feature.py +11 -1
  219. package/project/.sdk/tm/py/test/test_feature_corpus.py +111 -16
  220. package/project/.sdk/tm/py-data/pkg/fetch.py +6 -3
  221. package/project/.sdk/tm/py-data/test/test_fetch.py +7 -4
  222. package/project/.sdk/tm/rb/feature/debug_feature.rb +2 -2
  223. package/project/.sdk/tm/rb/feature/metrics_feature.rb +8 -0
  224. package/project/.sdk/tm/rb/feature/paging_feature.rb +87 -1
  225. package/project/.sdk/tm/rb/feature/ratelimit_feature.rb +12 -16
  226. package/project/.sdk/tm/rb/feature/retry_feature.rb +19 -3
  227. package/project/.sdk/tm/rb/feature/streaming_feature.rb +2 -1
  228. package/project/.sdk/tm/rb/feature/telemetry_feature.rb +11 -6
  229. package/project/.sdk/tm/rb/feature/test_feature.rb +42 -49
  230. package/project/.sdk/tm/rb/test/feature_corpus_test.rb +108 -24
  231. package/project/.sdk/tm/rb/test/feature_test.rb +1 -1
  232. package/project/.sdk/tm/rb/utility/make_options.rb +32 -11
  233. package/project/.sdk/tm/rust/feature/audit.rs +2 -2
  234. package/project/.sdk/tm/rust/feature/metrics.rs +24 -1
  235. package/project/.sdk/tm/rust/feature/paging.rs +189 -3
  236. package/project/.sdk/tm/rust/feature/ratelimit.rs +5 -10
  237. package/project/.sdk/tm/rust/feature/retry.rs +59 -6
  238. package/project/.sdk/tm/rust/feature/streaming.rs +3 -2
  239. package/project/.sdk/tm/rust/feature/support.rs +4 -0
  240. package/project/.sdk/tm/rust/feature/telemetry.rs +22 -11
  241. package/project/.sdk/tm/rust/feature/test.rs +63 -57
  242. package/project/.sdk/tm/rust/tests/feature_test.rs +174 -0
  243. package/project/.sdk/tm/rust/tests/primary_utility_test.rs +1 -0
  244. package/project/.sdk/tm/rust/utility/make_options.rs +122 -27
  245. package/project/.sdk/tm/scala/core/SdkClient.scala +45 -11
  246. package/project/.sdk/tm/scala/feature/AuditFeature.scala +6 -1
  247. package/project/.sdk/tm/scala/feature/MetricsFeature.scala +31 -1
  248. package/project/.sdk/tm/scala/feature/PagingFeature.scala +122 -2
  249. package/project/.sdk/tm/scala/feature/RatelimitFeature.scala +14 -11
  250. package/project/.sdk/tm/scala/feature/RetryFeature.scala +29 -7
  251. package/project/.sdk/tm/scala/feature/StreamingFeature.scala +2 -1
  252. package/project/.sdk/tm/scala/feature/TelemetryFeature.scala +12 -10
  253. package/project/.sdk/tm/scala/feature/TestFeature.scala +44 -44
  254. package/project/.sdk/tm/scala/sdktest/SdkTestMain.scala +41 -0
  255. package/project/.sdk/tm/scala/utility/Make.scala +96 -13
  256. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/AuditFeature.swift +3 -2
  257. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/MetricsFeature.swift +20 -0
  258. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/PagingFeature.swift +102 -2
  259. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/RatelimitFeature.swift +19 -13
  260. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/RetryFeature.swift +40 -5
  261. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/StreamingFeature.swift +2 -1
  262. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/TelemetryFeature.swift +11 -9
  263. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/TestFeature.swift +55 -49
  264. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/MakeOptions.swift +51 -13
  265. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/FeatureTest.swift +111 -0
  266. package/project/.sdk/tm/ts/src/feature/metrics/MetricsFeature.ts +5 -0
  267. package/project/.sdk/tm/ts/src/feature/paging/PagingFeature.ts +99 -1
  268. package/project/.sdk/tm/ts/src/feature/ratelimit/RatelimitFeature.ts +5 -9
  269. package/project/.sdk/tm/ts/src/feature/retry/RetryFeature.ts +25 -3
  270. package/project/.sdk/tm/ts/src/feature/streaming/StreamingFeature.ts +2 -1
  271. package/project/.sdk/tm/ts/src/feature/telemetry/TelemetryFeature.ts +11 -6
  272. package/project/.sdk/tm/ts/src/feature/test/TestFeature.ts +8 -7
  273. package/project/.sdk/tm/ts/src/utility/MakeOptionsUtility.ts +57 -6
  274. package/project/.sdk/tm/ts/test/feature/Corpus.test.ts +95 -25
  275. package/project/.sdk/tm/ts/test/feature.test.ts +14 -1
  276. package/project/.sdk/tm/zig/core/utility.zig +107 -8
  277. package/project/.sdk/tm/zig/feature/metrics.zig +19 -0
  278. package/project/.sdk/tm/zig/feature/paging.zig +172 -4
  279. package/project/.sdk/tm/zig/feature/ratelimit.zig +5 -11
  280. package/project/.sdk/tm/zig/feature/retry.zig +41 -3
  281. package/project/.sdk/tm/zig/feature/streaming.zig +2 -0
  282. package/project/.sdk/tm/zig/feature/telemetry.zig +15 -9
  283. package/project/.sdk/tm/zig/feature/test.zig +56 -40
  284. package/project/.sdk/tm/zig/test/feature_test.zig +109 -0
  285. package/project/.sdk/tm/zig/test/primary_utility_test.zig +2 -0
  286. package/project/sdkgen-package.json +1 -1
  287. package/src/cmp/ReadmeExplanation.ts +5 -2
  288. package/src/cmp/ReadmeFeatures.ts +21 -6
  289. package/src/helpers/optspec.ts +2 -2
@@ -147,27 +147,8 @@ function TestFeature:init(ctx, options)
147
147
  entmap = {}
148
148
  end
149
149
 
150
- -- For single-entity ops (load, remove) with an empty explicit match, fall
151
- -- back to the id the entity client already knows from a prior create/load
152
- -- (in fctx.match / fctx.data). Mirrors the TS mock where param() resolves
153
- -- the id from that accumulated state.
154
- local function resolve_match(explicit)
155
- if type(explicit) == "table" and next(explicit) ~= nil then
156
- return explicit
157
- end
158
- local function id_of(src)
159
- if src == nil then return nil end
160
- local v = vs.getprop(src, "id")
161
- if v ~= nil and v ~= "__UNDEFINED__" then return v end
162
- return nil
163
- end
164
- local v = id_of(fctx.match) or id_of(fctx.data)
165
- if v ~= nil then return { id = v } end
166
- return {}
167
- end
168
-
169
150
  if op.name == "load" then
170
- local args = test_self:build_args(fctx, op, resolve_match(fctx.reqmatch))
151
+ local args = test_self:build_args(fctx, op, fctx.reqmatch)
171
152
  local found = vs.select(entmap, args)
172
153
  local ent = vs.getelem(found, 0)
173
154
  if ent == nil then
@@ -192,26 +173,7 @@ function TestFeature:init(ctx, options)
192
173
  return respond(200, out, nil)
193
174
 
194
175
  elseif op.name == "update" or op.name == "patch" then
195
- -- Match the existing entity by id only (or its alias). reqdata also
196
- -- contains the new field values, which would otherwise cause select
197
- -- to filter out the entity we want to update. When reqdata has no id,
198
- -- fall back to the id the entity client carries from a prior
199
- -- create/load (in fctx.match / fctx.data), mirroring the TS mock
200
- -- where param(ctx,'id') resolves from accumulated state.
201
- local update_match = {}
202
- if type(fctx.reqdata) == "table" then
203
- if fctx.reqdata["id"] ~= nil then update_match["id"] = fctx.reqdata["id"] end
204
- if op.alias_map ~= nil then
205
- local alias_id = vs.getprop(op.alias_map, "id")
206
- if alias_id ~= nil and fctx.reqdata[alias_id] ~= nil then
207
- update_match[alias_id] = fctx.reqdata[alias_id]
208
- end
209
- end
210
- end
211
- if next(update_match) == nil then
212
- update_match = resolve_match({})
213
- end
214
- local args = test_self:build_args(fctx, op, update_match)
176
+ local args = test_self:build_args(fctx, op, record(fctx.reqdata))
215
177
  local found = vs.select(entmap, args)
216
178
  local ent = vs.getelem(found, 0)
217
179
  if ent == nil then
@@ -226,7 +188,7 @@ function TestFeature:init(ctx, options)
226
188
  return respond(200, out, nil)
227
189
 
228
190
  elseif op.name == "remove" then
229
- local args = test_self:build_args(fctx, op, resolve_match(fctx.reqmatch))
191
+ local args = test_self:build_args(fctx, op, fctx.reqmatch)
230
192
  local found = vs.select(entmap, args)
231
193
  local ent = vs.getelem(found, 0)
232
194
  -- Remove only the first matched entity. If nothing matches,
@@ -382,6 +344,12 @@ local function pick_point(points)
382
344
  return point
383
345
  end
384
346
 
347
+ local function held(src, key)
348
+ if src == nil then return false end
349
+ local v = vs.getprop(src, key)
350
+ return v ~= nil and v ~= "__UNDEFINED__"
351
+ end
352
+
385
353
  function TestFeature:build_args(ctx, op, args)
386
354
  local opname = op.name
387
355
 
@@ -400,32 +368,62 @@ function TestFeature:build_args(ctx, op, args)
400
368
  local qand = {}
401
369
  local q = { ["`$AND`"] = qand }
402
370
 
371
+ local ename = ctx.entity:get_name()
372
+ local idfrom = vs.getpath(ctx.config, "entity." .. ename .. ".id.from")
373
+
374
+ local names = {}
403
375
  if args ~= nil then
404
- local keys = vs.keysof(args)
405
- if keys ~= nil then
406
- for _, key in ipairs(keys) do
407
- local is_id = (key == "id")
408
- local is_reqd = not vs.isempty(vs.select(reqd_from_params, key))
409
- or not vs.isempty(vs.select(reqd_from_query, key))
410
-
411
- if is_id or is_reqd then
412
- local v = ctx.utility.param(ctx, key)
413
- local ka = nil
414
- if op.alias ~= nil then
415
- ka = vs.getprop(op.alias, key)
416
- end
417
-
418
- local qor = { { [key] = v } }
419
- if ka ~= nil and type(ka) == "string" then
420
- table.insert(qor, { [ka] = v })
421
- end
422
-
423
- table.insert(qand, { ["`$OR`"] = qor })
424
- end
376
+ for _, key in ipairs(vs.keysof(args) or {}) do table.insert(names, key) end
377
+ end
378
+
379
+ -- With no id in the call, the entity's held id (or composite parts) stands in.
380
+ if not held(args, "id") then
381
+ local parts = vs.getpath(ctx.config, "entity." .. ename .. ".id.parts")
382
+ if not vs.islist(parts) then
383
+ parts = (opname == "list") and {} or { "id" }
384
+ end
385
+ for _, part in ipairs(parts) do
386
+ local pname = tostring(part)
387
+ local seen = false
388
+ for _, n in ipairs(names) do seen = seen or n == pname end
389
+ if not seen and (held(ctx.match, pname) or held(ctx.data, pname)) then
390
+ table.insert(names, pname)
425
391
  end
426
392
  end
427
393
  end
428
394
 
395
+ for _, key in ipairs(names) do
396
+ local is_id = (key == "id")
397
+ local is_reqd = not vs.isempty(vs.select(reqd_from_params, key))
398
+ or not vs.isempty(vs.select(reqd_from_query, key))
399
+
400
+ if is_id or is_reqd then
401
+ local v = ctx.utility.param(ctx, key)
402
+ local ka = nil
403
+ if op.alias ~= nil then
404
+ ka = vs.getprop(op.alias, key)
405
+ end
406
+
407
+ local qor = { { [key] = v } }
408
+ if ka ~= nil and type(ka) == "string" then
409
+ table.insert(qor, { [ka] = v })
410
+ end
411
+
412
+ -- An alternative, never a replacement: a seed keeping the parameter
413
+ -- flat is still found.
414
+ local kf = idfrom ~= nil and vs.getprop(idfrom, key) or nil
415
+ if type(kf) == "string" and kf ~= key then
416
+ local segs = {}
417
+ for seg in string.gmatch(kf, "[^.]+") do table.insert(segs, seg) end
418
+ local nest = v
419
+ for i = #segs, 1, -1 do nest = { [segs[i]] = nest } end
420
+ table.insert(qor, nest)
421
+ end
422
+
423
+ table.insert(qand, { ["`$OR`"] = qor })
424
+ end
425
+ end
426
+
429
427
  q["`$AND`"] = qand
430
428
 
431
429
  if ctx.ctrl.explain ~= nil then
@@ -990,7 +990,11 @@ describe("feature", function()
990
990
  it("default id generation and no exporter", function()
991
991
  local h = make_client({ features = { { name = "telemetry" } } })
992
992
  h.op({ op = "load" })
993
- assert.is_truthy(string.match(h.client._telemetry.spans[1].traceId, "^t"))
993
+ local span = h.client._telemetry.spans[1]
994
+ assert.is_truthy(string.match(span.traceId, "^" .. string.rep("[0-9a-f]", 32) .. "$"))
995
+ assert.is_truthy(string.match(span.traceId, "[^0]"))
996
+ assert.is_truthy(string.match(span.spanId, "^" .. string.rep("[0-9a-f]", 16) .. "$"))
997
+ assert.is_truthy(string.match(span.spanId, "[^0]"))
994
998
  end)
995
999
 
996
1000
  it("injected idgen + clock", function()
@@ -1017,11 +1021,11 @@ describe("feature", function()
1017
1021
  -- debug -----------------------------------------------------------------
1018
1022
  if has_feature("debug") then describe("debug", function()
1019
1023
 
1020
- it("captures a redacted trace and honours on_entry + max", function()
1024
+ it("captures a redacted trace and honours onEntry + max", function()
1021
1025
  local seen = {}
1022
1026
  local h = make_client({ features = {
1023
1027
  { name = "debug", options = {
1024
- max = 1, on_entry = function(e) table.insert(seen, e) end } },
1028
+ max = 1, onEntry = function(e) table.insert(seen, e) end } },
1025
1029
  } })
1026
1030
  h.op({ op = "load", headers = { authorization = "Bearer secret" } })
1027
1031
  h.op({ op = "list" })
@@ -1229,6 +1233,82 @@ describe("feature", function()
1229
1233
  assert.is_true(res.result.paging.hasMore)
1230
1234
  end)
1231
1235
 
1236
+ -- The documented hasMore loop, one request per page.
1237
+ local function walk(reply, options)
1238
+ local rec = recording_server(reply)
1239
+ local h = make_client({ features = { { name = "paging", options = options } }, server = rec.server })
1240
+ local paging = {}
1241
+ local ctrl = { paging = paging }
1242
+ h.op({ op = "list", path = "/w", ctrl = ctrl })
1243
+ while paging.hasMore == true and #rec.calls < 4 do
1244
+ h.op({ op = "list", path = "/w", ctrl = ctrl })
1245
+ end
1246
+ local urls = {}
1247
+ for i, call in ipairs(rec.calls) do urls[i] = call.url end
1248
+ return urls, paging
1249
+ end
1250
+
1251
+ it("a body next that is not a URL is sent back as the cursor", function()
1252
+ local pages = { "c3", "c6" }
1253
+ local urls, paging = walk(function(n) return make_response(200, { next = pages[n] }) end)
1254
+ assert.are.same({ "http://api.test/w?page=1", "http://api.test/w?cursor=c3",
1255
+ "http://api.test/w?cursor=c6" }, urls)
1256
+ assert.is_false(paging.hasMore)
1257
+ end)
1258
+
1259
+ it("a body next URL is the next request", function()
1260
+ local pages = { "http://api.test/v2/w?cursor=c%2F3&limit=3", "/v2/w?cursor=c6" }
1261
+ local urls, paging = walk(function(n) return make_response(200, { next = pages[n] }) end)
1262
+ assert.are.same({ "http://api.test/w?page=1", "http://api.test/v2/w?cursor=c%2F3&limit=3",
1263
+ "http://api.test/v2/w?cursor=c6" }, urls)
1264
+ assert.is_false(paging.hasMore)
1265
+ end)
1266
+
1267
+ it("a Link next URL is the next request", function()
1268
+ local links = { '<http://api.test/w?after=b3>; rel="next"', '</w?after=b6>; rel="next"' }
1269
+ local urls, paging = walk(function(n)
1270
+ return make_response(200, {}, links[n] and { link = links[n] } or nil)
1271
+ end)
1272
+ assert.are.same({ "http://api.test/w?page=1", "http://api.test/w?after=b3",
1273
+ "http://api.test/w?after=b6" }, urls)
1274
+ assert.is_false(paging.hasMore)
1275
+ end)
1276
+
1277
+ it("a query-only Link keeps the path", function()
1278
+ local links = { '</v1/items?page=2>; rel="next"', '<?page=3>; rel="next"' }
1279
+ local urls = walk(function(n)
1280
+ return make_response(200, {}, links[n] and { link = links[n] } or nil)
1281
+ end)
1282
+ assert.are.same({ "http://api.test/w?page=1", "http://api.test/v1/items?page=2",
1283
+ "http://api.test/v1/items?page=3" }, urls)
1284
+ end)
1285
+
1286
+ it("a path-relative Link resolves against the request", function()
1287
+ local links = { '</v1/items?page=2>; rel="next"', '<more?page=3>; rel="next"' }
1288
+ local urls = walk(function(n)
1289
+ return make_response(200, {}, links[n] and { link = links[n] } or nil)
1290
+ end)
1291
+ assert.are.same({ "http://api.test/w?page=1", "http://api.test/v1/items?page=2",
1292
+ "http://api.test/v1/more?page=3" }, urls)
1293
+ end)
1294
+
1295
+ it("a link to another origin ends the walk", function()
1296
+ local urls, paging = walk(function()
1297
+ return make_response(200, {}, { link = '<https://elsewhere.test/w?after=b3>; rel="next"' })
1298
+ end)
1299
+ assert.are.same({ "http://api.test/w?page=1" }, urls)
1300
+ assert.is_false(paging.hasMore)
1301
+ assert.are.equal("https://elsewhere.test/w?after=b3", paging.foreign)
1302
+ end)
1303
+
1304
+ it("next cursor sends a value starting with a slash as the cursor", function()
1305
+ local pages = { "/c3" }
1306
+ local urls, paging = walk(function(n) return make_response(200, { next = pages[n] }) end,
1307
+ { next = "cursor" })
1308
+ assert.are.same({ "http://api.test/w?page=1", "http://api.test/w?cursor=%2Fc3" }, urls)
1309
+ assert.is_false(paging.hasMore)
1310
+ end)
1311
+
1232
1312
  it("non-list op is not paged", function()
1233
1313
  local rec = recording_server()
1234
1314
  local h = make_client({ features = {
@@ -1285,6 +1365,23 @@ describe("feature", function()
1285
1365
  assert.are.same({ { 1, 2 }, { 3, 4 }, { 5 } }, batches)
1286
1366
  end)
1287
1367
 
1368
+ it("a failed result keeps no stream", function()
1369
+ local rec = recording_server(function() return make_response(503, {}) end)
1370
+ local h = make_client({ features = { { name = "streaming" } }, server = rec.server })
1371
+ local res = h.op({ op = "list", path = "/w" })
1372
+ assert.is_nil(res.result.stream)
1373
+ assert.is_nil(res.result.streaming)
1374
+ end)
1375
+
1376
+ it("an empty list streams nothing", function()
1377
+ local rec = recording_server(function() return make_response(200, {}) end)
1378
+ local h = make_client({ features = { { name = "streaming" } }, server = rec.server })
1379
+ local res = h.op({ op = "list", path = "/w" })
1380
+ local seen = {}
1381
+ for item in res.result.stream() do table.insert(seen, item) end
1382
+ assert.are.same({}, seen)
1383
+ end)
1384
+
1288
1385
  it("non-list op is not streamed", function()
1289
1386
  local h = make_client({ features = { { name = "streaming" } } })
1290
1387
  local res = h.op({ op = "load" })
@@ -123,6 +123,37 @@ local function validated_entity_defaults(cfgentity, spec)
123
123
  return entity_defaults
124
124
  end
125
125
 
126
+ -- The model's options for a feature sit beneath the caller's, key by key: a
127
+ -- key the caller sets replaces the default whole, so a list is never merged.
128
+ local function feature_defaults(cfgfeature, feature)
129
+ if feature ~= nil and type(feature) ~= "table" then
130
+ return nil
131
+ end
132
+ local out = {}
133
+ for k, v in pairs(feature or {}) do
134
+ out[k] = v
135
+ end
136
+ local changed = false
137
+ for name, fdef in pairs(type(cfgfeature) == "table" and cfgfeature or {}) do
138
+ local dflt = type(fdef) == "table" and fdef["options"] or nil
139
+ local given = out[name]
140
+ if type(dflt) == "table" and (given ~= nil or dflt["active"] == true)
141
+ and (given == nil or type(given) == "table") then
142
+ local merged = vs.clone(dflt)
143
+ for k, v in pairs(given or {}) do
144
+ merged[k] = v
145
+ end
146
+ out[name] = merged
147
+ changed = true
148
+ end
149
+ end
150
+ if not changed then
151
+ return nil
152
+ end
153
+ return out
154
+ end
155
+
156
+
126
157
  local function make_options_util(ctx)
127
158
  local options = ctx.options or {}
128
159
 
@@ -213,6 +244,11 @@ local function make_options_util(ctx)
213
244
  opts.feature = fmap
214
245
  end
215
246
 
247
+ local fdefaults = feature_defaults(config["feature"], opts.feature)
248
+ if fdefaults ~= nil then
249
+ opts.feature = fdefaults
250
+ end
251
+
216
252
  -- THE OPTION SPEC IS GENERATED, NOT WRITTEN HERE.
217
253
  --
218
254
  -- `schema.OPTSPEC` is built from the model: `main.kit.optspec` for
@@ -345,15 +381,19 @@ local function make_options_util(ctx)
345
381
  opts["extend"] = extend
346
382
  end
347
383
 
348
- -- Resolve the feature add-order: an explicit list order (above) wins;
349
- -- otherwise order the map test-first, then the remaining names sorted, so
350
- -- the outcome is deterministic and `test` is always the base transport.
351
- if #featureorder == 0 then
384
+ -- Resolve the feature add-order: an explicit list order (above) wins, and
385
+ -- the names it leaves out follow it test-first, then sorted, so the outcome
386
+ -- is deterministic and `test` is the base transport of a map.
387
+ do
352
388
  local fmap = opts.feature
389
+ local given = {}
390
+ for _, n in ipairs(featureorder) do
391
+ given[n] = true
392
+ end
353
393
  local names = {}
354
394
  if type(fmap) == "table" then
355
395
  for k, _ in pairs(fmap) do
356
- if type(k) == "string" then
396
+ if type(k) == "string" and not given[k] then
357
397
  table.insert(names, k)
358
398
  end
359
399
  end
@@ -365,15 +405,14 @@ local function make_options_util(ctx)
365
405
  has_test = true
366
406
  end
367
407
  end
408
+ local rest = names
368
409
  if has_test then
369
- featureorder = { "test" }
410
+ rest = { "test" }
370
411
  for _, n in ipairs(names) do
371
412
  if n ~= "test" then
372
- table.insert(featureorder, n)
413
+ table.insert(rest, n)
373
414
  end
374
415
  end
375
- else
376
- featureorder = names
377
416
  end
378
417
  -- Station special case, mirroring test's: its transport wrap must
379
418
  -- sit immediately outside the base transport (inside every other
@@ -382,22 +421,25 @@ local function make_options_util(ctx)
382
421
  -- sorted default would init station last and wrap OUTSIDE the
383
422
  -- recording features, turning its wire-truth events into fiction.
384
423
  local si = nil
385
- for i, n in ipairs(featureorder) do
424
+ for i, n in ipairs(rest) do
386
425
  if n == "station" then
387
426
  si = i
388
427
  break
389
428
  end
390
429
  end
391
430
  if si ~= nil then
392
- table.remove(featureorder, si)
431
+ table.remove(rest, si)
393
432
  local ti = 0
394
- for i, n in ipairs(featureorder) do
433
+ for i, n in ipairs(rest) do
395
434
  if n == "test" then
396
435
  ti = i
397
436
  break
398
437
  end
399
438
  end
400
- table.insert(featureorder, ti + 1, "station")
439
+ table.insert(rest, ti + 1, "station")
440
+ end
441
+ for _, n in ipairs(rest) do
442
+ table.insert(featureorder, n)
401
443
  end
402
444
  end
403
445