@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
@@ -183,16 +183,16 @@ fn respond(ctx: *Context, status: i64, data: Value, extra: []const h.Pair) Value
183
183
  return out;
184
184
  }
185
185
 
186
- fn resolve_match(ctx: *Context, explicit: Value) Value {
187
- if (h.sizeOf(explicit) > 0) return explicit;
188
- const srcs = [_]Value{ ctx.mtch, ctx.data };
189
- for (srcs) |src| {
190
- const v = h.getp(src, "id");
191
- if (!h.is_noval(v) and !h.veq(v, h.vstr("__UNDEFINED__"))) {
192
- return h.jo(&.{.{ "id", v }});
193
- }
186
+ fn held(src: Value, key: []const u8) bool {
187
+ const v = h.getp(src, key);
188
+ return !h.is_noval(v) and !h.veq(v, h.vstr("__UNDEFINED__"));
189
+ }
190
+
191
+ fn names_has(names: Value, key: []const u8) bool {
192
+ for (names.array.data.items) |n| {
193
+ if (n == .string and std.mem.eql(u8, n.string, key)) return true;
194
194
  }
195
- return h.omap();
195
+ return false;
196
196
  }
197
197
 
198
198
  fn point_terminal(p: Value) bool {
@@ -257,22 +257,51 @@ fn build_args(ctx: *Context, args: Value) Value {
257
257
  const qand = h.olist();
258
258
  const q = h.jo(&.{.{ "`$AND`", qand }});
259
259
 
260
- if (args == .object) {
261
- const keys = h.keysof_vec(args);
262
- for (keys) |key| {
263
- const is_id = std.mem.eql(u8, key, "id");
264
- const is_reqd = !h.is_empty(vs.select(h.A(), reqd_params, h.vstr(key)) catch h.olist()) or
265
- !h.is_empty(vs.select(h.A(), reqd_query, h.vstr(key)) catch h.olist());
260
+ const idfrom = h.getpath(&.{ "entity", entname, "id", "from" }, ctx.config);
266
261
 
267
- if (is_id or is_reqd) {
268
- const v = ctx.util().param(ctx, h.vstr(key));
269
- const ka = h.getp(op.alias, key);
262
+ const names = h.olist();
263
+ if (args == .object) {
264
+ for (h.keysof_vec(args)) |key| names.array.append(h.vstr(key)) catch {};
265
+ }
270
266
 
271
- const qor = h.ja(&.{h.jo(&.{.{ key, v }})});
272
- if (ka == .string) qor.array.append(h.jo(&.{.{ ka.string, v }})) catch {};
267
+ // With no id in the call, the entity's held id (or composite parts) stands in.
268
+ if (!held(args, "id")) {
269
+ var parts = h.getpath(&.{ "entity", entname, "id", "parts" }, ctx.config);
270
+ if (parts != .array) {
271
+ parts = if (std.mem.eql(u8, opname, "list")) h.olist() else h.ja(&.{h.vstr("id")});
272
+ }
273
+ for (parts.array.data.items) |part| {
274
+ if (part != .string) continue;
275
+ if (!names_has(names, part.string) and (held(ctx.mtch, part.string) or held(ctx.data, part.string))) {
276
+ names.array.append(part) catch {};
277
+ }
278
+ }
279
+ }
273
280
 
274
- qand.array.append(h.jo(&.{.{ "`$OR`", qor }})) catch {};
281
+ for (names.array.data.items) |name| {
282
+ const key = name.string;
283
+ const is_id = std.mem.eql(u8, key, "id");
284
+ const is_reqd = !h.is_empty(vs.select(h.A(), reqd_params, h.vstr(key)) catch h.olist()) or
285
+ !h.is_empty(vs.select(h.A(), reqd_query, h.vstr(key)) catch h.olist());
286
+
287
+ if (is_id or is_reqd) {
288
+ const v = ctx.util().param(ctx, h.vstr(key));
289
+ const ka = h.getp(op.alias, key);
290
+
291
+ const qor = h.ja(&.{h.jo(&.{.{ key, v }})});
292
+ if (ka == .string) qor.array.append(h.jo(&.{.{ ka.string, v }})) catch {};
293
+
294
+ // An alternative, never a replacement: a seed keeping the
295
+ // parameter flat is still found.
296
+ const kf = h.getp(idfrom, key);
297
+ if (kf == .string and !std.mem.eql(u8, kf.string, key)) {
298
+ var nest = v;
299
+ var segs = std.mem.splitBackwardsScalar(u8, kf.string, '.');
300
+ while (segs.next()) |seg| nest = h.jo(&.{.{ seg, nest }});
301
+ qor.array.append(nest) catch {};
275
302
  }
303
+
304
+ qand.array.append(h.jo(&.{.{ "`$OR`", qor }})) catch {};
276
305
  }
277
306
  }
278
307
 
@@ -299,8 +328,7 @@ fn test_fetch(entity: Value, ctx: *Context, _: []const u8, _: Value) err.E!Value
299
328
  };
300
329
 
301
330
  if (std.mem.eql(u8, op.name, "load")) {
302
- const m = resolve_match(ctx, ctx.reqmatch);
303
- const args = build_args(ctx, m);
331
+ const args = build_args(ctx, ctx.reqmatch);
304
332
  const found = vs.select(h.A(), entmap, args) catch h.olist();
305
333
  const ent = h.get_elem(found, h.vnum(0), h.vnull());
306
334
  if (h.is_noval(ent)) {
@@ -320,18 +348,10 @@ fn test_fetch(entity: Value, ctx: *Context, _: []const u8, _: Value) err.E!Value
320
348
  return respond(ctx, 200, h.clone(found), &.{});
321
349
  } else if (std.mem.eql(u8, op.name, "update") or std.mem.eql(u8, op.name, "patch")) {
322
350
  const reqdata = ctx.reqdata;
323
- var update_match = h.omap();
324
- if (reqdata == .object) {
325
- const idv = h.getp(reqdata, "id");
326
- if (!h.is_noval(idv)) h.setp(update_match, "id", idv);
327
- if (h.getp(op.alias, "id") == .string) {
328
- const alias_id = h.getp(op.alias, "id").string;
329
- const av = h.getp(reqdata, alias_id);
330
- if (!h.is_noval(av)) h.setp(update_match, alias_id, av);
331
- }
332
- }
333
- if (h.sizeOf(update_match) == 0) update_match = resolve_match(ctx, h.omap());
334
- const args = build_args(ctx, update_match);
351
+ // `$body` travels on the wire alone; the record is the rest.
352
+ const rec = if (reqdata == .object) h.clone(reqdata) else h.omap();
353
+ h.del_prop(rec, h.vstr("$body"));
354
+ const args = build_args(ctx, rec);
335
355
  const found = vs.select(h.A(), entmap, args) catch h.olist();
336
356
  var ent = h.get_elem(found, h.vnum(0), h.vnull());
337
357
  if (h.is_noval(ent)) {
@@ -339,16 +359,12 @@ fn test_fetch(entity: Value, ctx: *Context, _: []const u8, _: Value) err.E!Value
339
359
  return respond(ctx, 404, h.vnull(), &.{.{ "statusText", h.vstr("Not found") }});
340
360
  }
341
361
  if (ent == .object and reqdata == .object) {
342
- // `$body` travels on the wire alone; the record is the rest.
343
- const rec = h.clone(reqdata);
344
- h.del_prop(rec, h.vstr("$body"));
345
362
  ent = h.merge(h.ja(&.{ ent, rec }));
346
363
  }
347
364
  h.del_prop(ent, h.vstr("$KEY"));
348
365
  return respond(ctx, 200, h.clone(ent), &.{});
349
366
  } else if (std.mem.eql(u8, op.name, "remove")) {
350
- const m = resolve_match(ctx, ctx.reqmatch);
351
- const args = build_args(ctx, m);
367
+ const args = build_args(ctx, ctx.reqmatch);
352
368
  const found = vs.select(h.A(), entmap, args) catch h.olist();
353
369
  const ent = h.get_elem(found, h.vnum(0), h.vnull());
354
370
  if (ent == .object) {
@@ -40,6 +40,36 @@ fn replyPaging(_: i64, _: *sdk.Context, _: Value) fh.E!Value {
40
40
  }),
41
41
  );
42
42
  }
43
+ fn replyNextCursor(n: i64, _: *sdk.Context, _: Value) fh.E!Value {
44
+ const next = if (n == 1) h.vstr("c3") else if (n == 2) h.vstr("c6") else vnull();
45
+ return fh.fh_response(200, h.jo(&.{.{ "next", next }}), vnull());
46
+ }
47
+ fn replyNextUrl(n: i64, _: *sdk.Context, _: Value) fh.E!Value {
48
+ const next = if (n == 1) h.vstr("http://api.test/v2/w?cursor=c%2F3&limit=3") else if (n == 2) h.vstr("/v2/w?cursor=c6") else vnull();
49
+ return fh.fh_response(200, h.jo(&.{.{ "next", next }}), vnull());
50
+ }
51
+ fn replyLinkNext(n: i64, _: *sdk.Context, _: Value) fh.E!Value {
52
+ const headers = if (n == 1) h.jo(&.{.{ "link", h.vstr("<http://api.test/w?after=b3>; rel=\"next\"") }}) else if (n == 2) h.jo(&.{.{ "link", h.vstr("</w?after=b6>; rel=\"next\"") }}) else vnull();
53
+ return fh.fh_response(200, h.ja(&.{}), headers);
54
+ }
55
+ fn replyQueryOnlyLink(n: i64, _: *sdk.Context, _: Value) fh.E!Value {
56
+ const headers = if (n == 1) h.jo(&.{.{ "link", h.vstr("</v1/items?page=2>; rel=\"next\"") }}) else if (n == 2) h.jo(&.{.{ "link", h.vstr("<?page=3>; rel=\"next\"") }}) else vnull();
57
+ return fh.fh_response(200, h.ja(&.{}), headers);
58
+ }
59
+ fn replyPathRelativeLink(n: i64, _: *sdk.Context, _: Value) fh.E!Value {
60
+ const headers = if (n == 1) h.jo(&.{.{ "link", h.vstr("</v1/items?page=2>; rel=\"next\"") }}) else if (n == 2) h.jo(&.{.{ "link", h.vstr("<more?page=3>; rel=\"next\"") }}) else vnull();
61
+ return fh.fh_response(200, h.ja(&.{}), headers);
62
+ }
63
+ fn replyForeignLink(_: i64, _: *sdk.Context, _: Value) fh.E!Value {
64
+ return fh.fh_response(200, h.ja(&.{}), h.jo(&.{.{ "link", h.vstr("<https://elsewhere.test/w?after=b3>; rel=\"next\"") }}));
65
+ }
66
+ fn replySlashCursor(n: i64, _: *sdk.Context, _: Value) fh.E!Value {
67
+ const next = if (n == 1) h.vstr("/c3") else vnull();
68
+ return fh.fh_response(200, h.jo(&.{.{ "next", next }}), vnull());
69
+ }
70
+ fn replyEmptyList(_: i64, _: *sdk.Context, _: Value) fh.E!Value {
71
+ return fh.fh_response(200, h.ja(&.{}), vnull());
72
+ }
43
73
  fn replyCursor(_: i64, _: *sdk.Context, _: Value) fh.E!Value {
44
74
  return fh.fh_response(
45
75
  200,
@@ -1017,6 +1047,63 @@ test "feature paging: body cursor and explicit cursor" {
1017
1047
  try testing.expect(h.veq(h.getp(paging, "hasMore"), h.vbool(true)));
1018
1048
  }
1019
1049
 
1050
+ // The documented hasMore loop, one request per page.
1051
+ fn pagingWalk(reply: fh.ReplyFn, want: []const []const u8) !void {
1052
+ _ = try pagingWalkWith(reply, vnull(), want);
1053
+ }
1054
+
1055
+ fn pagingWalkWith(reply: fh.ReplyFn, options: Value, want: []const []const u8) !Value {
1056
+ const rec = fh.Recorder.new(reply);
1057
+ const f = sdk.PagingFeature.make();
1058
+ const hh = fh.fh_make(rec.fetcher(), &.{.{ .feat = f, .options = options }});
1059
+ const paging = h.omap();
1060
+ const ctrl = h.jo(&.{.{ "paging", paging }});
1061
+ _ = hh.op(.{ .op = "list", .path = "/w", .ctrl = ctrl });
1062
+ while (h.veq(h.getp(paging, "hasMore"), h.vbool(true)) and rec.calls.items.len < 4) {
1063
+ _ = hh.op(.{ .op = "list", .path = "/w", .ctrl = ctrl });
1064
+ }
1065
+ try testing.expectEqual(want.len, rec.calls.items.len);
1066
+ for (want, 0..) |url, i| try testing.expectEqualStrings(url, fh.rec_url(rec, i));
1067
+ try testing.expect(h.veq(h.getp(paging, "hasMore"), h.vbool(false)));
1068
+ return paging;
1069
+ }
1070
+
1071
+ test "feature paging: a link to another origin ends the walk" {
1072
+ if (!fh.fh_present(&.{"paging"})) return;
1073
+ const paging = try pagingWalkWith(replyForeignLink, vnull(), &.{"http://api.test/w?page=1"});
1074
+ try testing.expect(h.veq(h.getp(paging, "foreign"), h.vstr("https://elsewhere.test/w?after=b3")));
1075
+ }
1076
+
1077
+ test "feature paging: next cursor sends a value starting with a slash as the cursor" {
1078
+ if (!fh.fh_present(&.{"paging"})) return;
1079
+ _ = try pagingWalkWith(replySlashCursor, h.jo(&.{.{ "next", h.vstr("cursor") }}), &.{ "http://api.test/w?page=1", "http://api.test/w?cursor=%2Fc3" });
1080
+ }
1081
+
1082
+ test "feature paging: a body next is sent back as the cursor" {
1083
+ if (!fh.fh_present(&.{"paging"})) return;
1084
+ try pagingWalk(replyNextCursor, &.{ "http://api.test/w?page=1", "http://api.test/w?cursor=c3", "http://api.test/w?cursor=c6" });
1085
+ }
1086
+
1087
+ test "feature paging: a body next URL is the next request" {
1088
+ if (!fh.fh_present(&.{"paging"})) return;
1089
+ try pagingWalk(replyNextUrl, &.{ "http://api.test/w?page=1", "http://api.test/v2/w?cursor=c%2F3&limit=3", "http://api.test/v2/w?cursor=c6" });
1090
+ }
1091
+
1092
+ test "feature paging: a Link next URL is the next request" {
1093
+ if (!fh.fh_present(&.{"paging"})) return;
1094
+ try pagingWalk(replyLinkNext, &.{ "http://api.test/w?page=1", "http://api.test/w?after=b3", "http://api.test/w?after=b6" });
1095
+ }
1096
+
1097
+ test "feature paging: a query-only Link keeps the path" {
1098
+ if (!fh.fh_present(&.{"paging"})) return;
1099
+ try pagingWalk(replyQueryOnlyLink, &.{ "http://api.test/w?page=1", "http://api.test/v1/items?page=2", "http://api.test/v1/items?page=3" });
1100
+ }
1101
+
1102
+ test "feature paging: a path-relative Link resolves against the request" {
1103
+ if (!fh.fh_present(&.{"paging"})) return;
1104
+ try pagingWalk(replyPathRelativeLink, &.{ "http://api.test/w?page=1", "http://api.test/v1/items?page=2", "http://api.test/v1/more?page=3" });
1105
+ }
1106
+
1020
1107
  test "feature paging: non-list not paged" {
1021
1108
  if (!fh.fh_present(&.{"paging"})) return;
1022
1109
  const rec = fh.Recorder.new(null);
@@ -1072,6 +1159,28 @@ test "feature streaming: batches with chunksize" {
1072
1159
  try testing.expect(h.veq(h.ja(batches), want));
1073
1160
  }
1074
1161
 
1162
+ test "feature streaming: a failed result keeps no stream" {
1163
+ if (!fh.fh_present(&.{"streaming"})) return;
1164
+ const rec = fh.Recorder.new(reply503);
1165
+ const f = sdk.StreamingFeature.make();
1166
+ const sf: *sdk.StreamingFeature = @ptrCast(@alignCast(f.ptr));
1167
+ const hh = fh.fh_make(rec.fetcher(), &.{.{ .feat = f, .options = vnull() }});
1168
+ const res = hh.op(.{ .op = "list", .path = "/w" });
1169
+ try testing.expect(!res.result.?.streaming);
1170
+ try testing.expect(res.result.?.stream == null);
1171
+ try testing.expect(sf.opened == 0);
1172
+ }
1173
+
1174
+ test "feature streaming: an empty list streams nothing" {
1175
+ if (!fh.fh_present(&.{"streaming"})) return;
1176
+ const rec = fh.Recorder.new(replyEmptyList);
1177
+ const f = sdk.StreamingFeature.make();
1178
+ const hh = fh.fh_make(rec.fetcher(), &.{.{ .feat = f, .options = vnull() }});
1179
+ const res = hh.op(.{ .op = "list", .path = "/w" });
1180
+ const sf = res.result.?.stream orelse unreachable;
1181
+ try testing.expectEqual(@as(usize, 0), sf.call(sf.ctx).len);
1182
+ }
1183
+
1075
1184
  test "feature streaming: non-list not streamed" {
1076
1185
  if (!fh.fh_present(&.{"streaming"})) return;
1077
1186
  const f = sdk.StreamingFeature.make();
@@ -116,6 +116,7 @@ test "primary utility exists" {
116
116
  try testing.expect(utility.prepare_headers(ctx) == .object);
117
117
  try testing.expect(util.prepare_query_util(ctx) == .object);
118
118
  try testing.expect(util.prepare_params_util(ctx) == .object);
119
+ ctx.options = h.omap();
119
120
  try testing.expect((try utility.make_options(ctx)) == .object);
120
121
  _ = utility.clean(ctx, h.vstr("x"));
121
122
  }
@@ -143,6 +144,7 @@ test "primary make_options basic" {
143
144
  const client = baseClient();
144
145
  const utility = client.get_utility();
145
146
  const ctx = makeTestCtx(client, utility);
147
+ ctx.options = h.omap();
146
148
  const opts = try utility.make_options(ctx);
147
149
  try testing.expect(opts == .object);
148
150
  try testing.expect(!h.is_noval(h.getp(opts, "base")));
@@ -3,7 +3,7 @@
3
3
  "package": 1
4
4
  },
5
5
  "name": "@voxgig/sdkgen",
6
- "version": "4.51.0",
6
+ "version": "4.52.0",
7
7
  "provides": {
8
8
  "target": [
9
9
  "c",
@@ -64,8 +64,11 @@ shows exactly what \`direct\` would send.
64
64
 
65
65
  const TS_EXPLAIN = (fence: string): LangExplain => ({
66
66
  featureKind: `Features are the extension mechanism. A feature is an object with a
67
- \`hooks\` map. Each hook key is a pipeline stage name, and the value is
68
- a function that receives the context.
67
+ \`name\`, an \`init\` method, and a method named after each pipeline stage
68
+ it hooks; each method receives the context. A feature passed in \`extend\`
69
+ is installed, and its hooks fire, only while it is active:
70
+ \`feature.<name>.active\` decides, and where the options do not set it, the
71
+ feature's own \`active\` flag does.
69
72
 
70
73
  `,
71
74
  entityState: ({ eName, eLower, op, arg, matchIdF, idLit }) => `Entity instances are stateful. After a successful \`${op}\`, the entity
@@ -81,12 +81,12 @@ ${f.title}.
81
81
 
82
82
  `)
83
83
 
84
- if (0 < f.options.length) {
84
+ if (0 < f.options.length || 0 < f.extras.length) {
85
85
  ReadmeFeatureOptions({ feature: f })
86
86
  }
87
87
 
88
88
  Content(`Set \`feature.${f.name}.active\` to enable it${
89
- 0 < f.options.length ? ', then override any of the options above' : ''}.
89
+ 0 < f.options.length || 0 < f.extras.length ? ', then override any of the options above' : ''}.
90
90
 
91
91
  `)
92
92
 
@@ -104,15 +104,30 @@ activated earlier.
104
104
  const ReadmeFeatureOptions = cmp(function ReadmeFeatureOptions(props: any) {
105
105
  const f: FeatureDoc = props.feature
106
106
 
107
- Content(`| Option | Default |
107
+ if (0 < f.options.length) {
108
+ Content(`| Option | Default |
108
109
  |---|---|
109
110
  `)
110
- for (const o of f.options) {
111
- Content(`| \`${o.name}\` | ${o.code} |
111
+ for (const o of f.options) {
112
+ Content(`| \`${o.name}\` | ${o.code} |
113
+ `)
114
+ }
115
+ Content(`
112
116
  `)
113
117
  }
114
- Content(`
118
+
119
+ // An option with no default still changes what the feature does.
120
+ if (0 < f.extras.length) {
121
+ Content(`| Option | Type |
122
+ |---|---|
115
123
  `)
124
+ for (const o of f.extras) {
125
+ Content(`| \`${o.name}\` | ${o.type} |
126
+ `)
127
+ }
128
+ Content(`
129
+ `)
130
+ }
116
131
  })
117
132
 
118
133
 
@@ -38,7 +38,7 @@ function featureOptionSpec(feat: any): Record<string, any> {
38
38
  const config = (feat && feat.config) || {}
39
39
  const spec: Record<string, any> = {}
40
40
 
41
- if (true !== config.strict) {
41
+ if (false === config.strict) {
42
42
  spec[S_OPEN] = true
43
43
  }
44
44
 
@@ -73,7 +73,7 @@ function optionSpec(model: any, targetname?: string): Record<string, any> {
73
73
  const feature: Record<string, any> = {
74
74
  [S_CHILD]: {
75
75
  [S_OPEN]: true,
76
- active: false,
76
+ active: optional(sentinel('BOOLEAN')),
77
77
  },
78
78
  }
79
79