@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
@@ -45,6 +45,7 @@ defmodule ProjectName.Pipeline do
45
45
  S.setprop(out, "result", result)
46
46
  if err != nil, do: throw({:sdk_ret, Utility.make_error(ctx, err)})
47
47
 
48
+ S.setprop(ctx, "done_fired", true)
48
49
  # #PreDone-Hook
49
50
 
50
51
  post_done.()
@@ -54,9 +55,25 @@ defmodule ProjectName.Pipeline do
54
55
  e -> unexpected(ctx, e, __STACKTRACE__)
55
56
  catch
56
57
  {:sdk_ret, v} -> v
58
+ after
59
+ # A refusal, a failed step or a raise left before PreDone.
60
+ if S.getprop(ctx, "done_fired") != true do
61
+ late_done(ctx)
62
+ end
57
63
  end
58
64
  end
59
65
 
66
+ # PreDone on an exit that left before it. What the hook raises leaves
67
+ # cleaned, in place of the error already on its way out.
68
+ defp late_done(ctx) do
69
+ Utility.feature_hook(ctx, "PreDone")
70
+ rescue
71
+ e ->
72
+ if S.getprop(S.getprop(ctx, "ctrl"), "throw_err") != false do
73
+ reraise(Utility.clean_exception(ctx, e), __STACKTRACE__)
74
+ end
75
+ end
76
+
60
77
  # The catch path every entity call leaves through: an error a hook raised
61
78
  # never passed through make_error. Nil when the caller switched throwing off.
62
79
  def unexpected(ctx, e, st) do
@@ -210,12 +210,19 @@ func (e *EntyClass) Stream(action string, args map[string]any, callopts map[stri
210
210
  go func() {
211
211
  defer close(out)
212
212
 
213
+ predone := false
214
+
213
215
  // A panicking hook or stream function leaves through MakeError, as
214
216
  // runOp's does. A goroutine the stream function starts is out of reach.
215
217
  defer func() {
216
218
  if r := recover(); r != nil {
217
219
  sendData(e.recovered(ctx, r))
218
220
  }
221
+ if !predone {
222
+ if herr := e.lateDone(ctx); herr != nil {
223
+ send(core.StreamItem{Err: herr})
224
+ }
225
+ }
219
226
  }()
220
227
 
221
228
  // A failed step leaves through MakeError, as an operation's does.
@@ -224,6 +231,9 @@ func (e *EntyClass) Stream(action string, args map[string]any, callopts map[stri
224
231
  return
225
232
  }
226
233
 
234
+ predone = true
235
+ utility.FeatureHook(ctx, "PreDone")
236
+
227
237
  // Inbound: prefer the streaming feature's incremental iterator; else
228
238
  // fall back to the materialised items so Stream always yields.
229
239
  if ctx.Result != nil && ctx.Result.Stream != nil {
@@ -243,7 +253,7 @@ func (e *EntyClass) Stream(action string, args map[string]any, callopts map[stri
243
253
  return out
244
254
  }
245
255
 
246
- // The steps an operation runs, with their hooks; the first that fails hands
256
+ // The steps before PreDone, with their hooks; the first that fails hands
247
257
  // back its error.
248
258
  func (e *EntyClass) streamSteps(ctx *core.Context) error {
249
259
  utility := e.utility
@@ -283,7 +293,6 @@ func (e *EntyClass) streamSteps(ctx *core.Context) error {
283
293
  return err
284
294
  }
285
295
 
286
- utility.FeatureHook(ctx, "PreDone")
287
296
  return nil
288
297
  }
289
298
 
@@ -302,10 +311,18 @@ func (e *EntyClass) streamSteps(ctx *core.Context) error {
302
311
  func (e *EntyClass) runOp(ctx *core.Context, postDone func()) (out any, err error) {
303
312
  utility := e.utility
304
313
 
314
+ predone := false
315
+
305
316
  defer func() {
306
317
  if r := recover(); r != nil {
307
318
  out, err = e.recovered(ctx, r)
308
319
  }
320
+ // A refusal, a failed step or a panic left before PreDone.
321
+ if !predone {
322
+ if herr := e.lateDone(ctx); herr != nil {
323
+ out, err = nil, herr
324
+ }
325
+ }
309
326
  }()
310
327
 
311
328
  // #PrePoint-Hook
@@ -348,6 +365,7 @@ func (e *EntyClass) runOp(ctx *core.Context, postDone func()) (out any, err erro
348
365
  return utility.MakeError(ctx, err)
349
366
  }
350
367
 
368
+ predone = true
351
369
  // #PreDone-Hook
352
370
 
353
371
  postDone()
@@ -372,6 +390,28 @@ func (e *EntyClass) runOp(ctx *core.Context, postDone func()) (out any, err erro
372
390
  return out, nil
373
391
  }
374
392
 
393
+ // PreDone on an exit that left before it. What the hook panics with leaves
394
+ // cleaned, in place of the error already on its way out; nil under
395
+ // `throw: false`.
396
+ func (e *EntyClass) lateDone(ctx *core.Context) (herr error) {
397
+ defer func() {
398
+ if r := recover(); r != nil {
399
+ var ok bool
400
+ if herr, ok = r.(error); !ok {
401
+ herr = fmt.Errorf("%v", r)
402
+ }
403
+ if cerr, ok := e.utility.Clean(ctx, herr).(error); ok {
404
+ herr = cerr
405
+ }
406
+ if ctx.Ctrl.Throw != nil && !*ctx.Ctrl.Throw {
407
+ herr = nil
408
+ }
409
+ }
410
+ }()
411
+ e.utility.FeatureHook(ctx, "PreDone")
412
+ return nil
413
+ }
414
+
375
415
  // A hook, fetcher or parser that panics never reached MakeError, and its
376
416
  // message can quote the request.
377
417
  func (e *EntyClass) recovered(ctx *core.Context, r any) (any, error) {
@@ -52,30 +52,58 @@ func NewProjectNameSDK(options map[string]any) (*ProjectNameSDK, error) {
52
52
  // declares `transport: 'wrap'` wrap whatever is current, so `test`
53
53
  // must be added before them to sit at the base of the chain.
54
54
  featureOpts := ToMapAny(vs.GetProp(sdk.options, "feature"))
55
+ active := func(fname string) bool {
56
+ ab, _ := ToMapAny(featureOpts[fname])["active"].(bool)
57
+ return ab
58
+ }
59
+ // An extend feature is active by its option, else by its own flag.
60
+ extActive := func(feat Feature) bool {
61
+ if ab, ok := ToMapAny(featureOpts[feat.GetName()])["active"].(bool); ok {
62
+ return ab
63
+ }
64
+ return feat.GetActive()
65
+ }
66
+
67
+ var extList []any
68
+ if el, ok := vs.GetProp(sdk.options, "extend").([]any); ok {
69
+ extList = el
70
+ }
71
+ carried := func(fname string) Feature {
72
+ for _, f := range extList {
73
+ if feat, ok := f.(Feature); ok && feat.GetName() == fname {
74
+ return feat
75
+ }
76
+ }
77
+ return nil
78
+ }
79
+
80
+ placed := map[Feature]bool{}
55
81
  if featureOpts != nil {
56
82
  if fo, ok := vs.GetPath(sdk.options, []any{"__derived__", "featureorder"}).([]any); ok {
57
83
  for _, n := range fo {
58
84
  fname, _ := n.(string)
59
- fopts := ToMapAny(featureOpts[fname])
60
- if fopts != nil {
61
- if active, ok := fopts["active"]; ok {
62
- if ab, ok := active.(bool); ok && ab {
63
- sdk.utility.FeatureAdd(sdk.rootctx, makeFeature(fname))
64
- }
85
+ if !active(fname) {
86
+ continue
87
+ }
88
+ gen := makeFeature(fname)
89
+ // An active name with no generated class is legal when an
90
+ // extend-supplied instance carries that name (station's adopt
91
+ // path): the instance takes the slot the order gives its name.
92
+ if gen == nil || gen.GetName() != fname {
93
+ if feat := carried(fname); feat != nil {
94
+ placed[feat] = true
95
+ sdk.utility.FeatureAdd(sdk.rootctx, feat)
96
+ continue
65
97
  }
66
98
  }
99
+ sdk.utility.FeatureAdd(sdk.rootctx, gen)
67
100
  }
68
101
  }
69
102
  }
70
103
 
71
- // Add extension features.
72
- if extend := vs.GetProp(sdk.options, "extend"); extend != nil {
73
- if extList, ok := extend.([]any); ok {
74
- for _, f := range extList {
75
- if feat, ok := f.(Feature); ok {
76
- sdk.utility.FeatureAdd(sdk.rootctx, feat)
77
- }
78
- }
104
+ for _, f := range extList {
105
+ if feat, ok := f.(Feature); ok && !placed[feat] && extActive(feat) {
106
+ sdk.utility.FeatureAdd(sdk.rootctx, feat)
79
107
  }
80
108
  }
81
109
 
@@ -917,9 +917,13 @@ public class CleanTest {
917
917
  forms(sinks, "mistyped:rejected", e);
918
918
  }
919
919
 
920
- // A number is registered as the text a message quotes it in.
921
- ${sdk} numeric = construct(jm("apikey", 918273645));
922
- numbered = numeric.getUtility().clean.apply(numeric.getRootCtx(), "found 918273645");
920
+ // A number is registered as the text the refusal quotes it in.
921
+ try {
922
+ new ${sdk}(offline(jm("apikey", 918273645)));
923
+ }
924
+ catch (RuntimeException e) {
925
+ numbered = String.valueOf(e.getMessage());
926
+ }
923
927
 
924
928
  for (boolean unexpected : new boolean[] {false, true}) {
925
929
  ${sdk} hooked = makeSdk(SCENARIOS.get(0), sinks, null, new ThrowFeature(unexpected));
@@ -991,7 +995,8 @@ public class CleanTest {
991
995
 
992
996
  assertEquals(0, leaked.size(), "credential leaked through: " + String.join("; ", leaked));
993
997
 
994
- assertEquals("found " + MASK, numbered);
998
+ assertTrue(null != numbered && ((String) numbered).contains(MASK) &&
999
+ !((String) numbered).contains("918273645"), "a numeric credential: " + numbered);
995
1000
  assertEquals(jm(MASK, 1, MASK + "#1", 2, "plain", 3), named);
996
1001
 
997
1002
  // The positive half: the slot the credential travelled in is masked,
@@ -112,6 +112,7 @@ public abstract class EntityBase implements SdkEntity {
112
112
  // ctrl.throw is false).
113
113
  protected Object runOp(Context ctx, Runnable postDone) {
114
114
  Utility utility = this.utility;
115
+ boolean predone = false;
115
116
 
116
117
  try {
117
118
  // #PrePoint-Hook
@@ -139,6 +140,7 @@ public abstract class EntityBase implements SdkEntity {
139
140
  Object result = utility.makeResult.apply(ctx);
140
141
  ctx.out.put("result", result);
141
142
 
143
+ predone = true;
142
144
  // #PreDone-Hook
143
145
 
144
146
  postDone.run();
@@ -167,6 +169,25 @@ public abstract class EntityBase implements SdkEntity {
167
169
  catch (RuntimeException err) {
168
170
  return unexpected(ctx, err);
169
171
  }
172
+ finally {
173
+ // A refusal, a failed step or a throw left before PreDone.
174
+ if (!predone) {
175
+ lateDone(ctx);
176
+ }
177
+ }
178
+ }
179
+
180
+ // PreDone on an exit that left before it. What the hook throws leaves
181
+ // cleaned, in place of the error already on its way out.
182
+ private void lateDone(Context ctx) {
183
+ try {
184
+ this.utility.featureHook.apply(ctx, "PreDone");
185
+ }
186
+ catch (RuntimeException err) {
187
+ if (!Boolean.FALSE.equals(ctx.ctrl.throwing)) {
188
+ throw cleanError(ctx, err);
189
+ }
190
+ }
170
191
  }
171
192
 
172
193
  // The catch path. An error already finalised by makeError (e.g. via done)
@@ -168,21 +168,26 @@ const testClient = client.tester()
168
168
 
169
169
  ${stateSection}### Add custom middleware
170
170
 
171
- Pass features via the \`extend\` option:
171
+ Pass features via the \`extend\` option. A feature is an object with a
172
+ \`name\`, an \`init\` method, and a method named after each pipeline stage it
173
+ hooks. It is installed, and its hooks fire, only while it is active:
174
+ \`feature.<name>.active\` decides, and where the options do not set it, the
175
+ object's own \`active\` flag does:
172
176
 
173
177
  \`\`\`js
174
178
  const logger = {
175
- hooks: {
176
- PreRequest: (ctx) => {
177
- console.log('Requesting:', ctx.spec.method, ctx.spec.path)
178
- },
179
- PreResponse: (ctx) => {
180
- console.log('Status:', ctx.out.request?.status)
181
- },
179
+ name: 'logger',
180
+ init() {},
181
+ PreRequest(ctx) {
182
+ console.log('Requesting:', ctx.spec.method, ctx.spec.path)
183
+ },
184
+ PreResponse(ctx) {
185
+ console.log('Status:', ctx.out.request?.status)
182
186
  },
183
187
  }
184
188
 
185
189
  const client = new ${model.const.Name}SDK({${apikeyExtendField}
190
+ feature: { logger: { active: true } },
186
191
  extend: [logger],
187
192
  })
188
193
  \`\`\`
@@ -126,8 +126,15 @@ class ProjectNameEntityBase {
126
126
  ...(args || {}),
127
127
  }, this._entctx)
128
128
 
129
+ let predone = false
130
+
129
131
  try {
130
132
  const failed = await this._streamSteps(ctx)
133
+ if (null == failed) {
134
+ predone = true
135
+ const fres = featureHook(ctx, 'PreDone')
136
+ if (fres instanceof Promise) { await fres }
137
+ }
131
138
  const result = ctx.result
132
139
 
133
140
  // Inbound: prefer the streaming feature's incremental iterator; else
@@ -166,10 +173,15 @@ class ProjectNameEntityBase {
166
173
  const e = this._unexpected(ctx, err)
167
174
  if (e && true !== signal?.aborted) { throw e }
168
175
  }
176
+ finally {
177
+ if (!predone) {
178
+ await this._lateDone(ctx)
179
+ }
180
+ }
169
181
  }
170
182
 
171
183
 
172
- // The steps an operation runs, with their hooks; the first that fails
184
+ // The steps before PreDone, with their hooks; the first that fails
173
185
  // hands back its error.
174
186
  async _streamSteps(ctx) {
175
187
  const {
@@ -192,8 +204,20 @@ class ProjectNameEntityBase {
192
204
 
193
205
  fres = featureHook(ctx, 'PreResult'); if (fres instanceof Promise) { await fres }
194
206
  ctx.out.result = await makeResult(ctx); if (ctx.out.result instanceof Error) { return ctx.out.result }
207
+ }
208
+
195
209
 
196
- fres = featureHook(ctx, 'PreDone'); if (fres instanceof Promise) { await fres }
210
+ // PreDone on an exit that left before it. What the hook throws leaves
211
+ // cleaned, in place of the error already on its way out.
212
+ async _lateDone(ctx) {
213
+ try {
214
+ const fres = this._utility.featureHook(ctx, 'PreDone')
215
+ if (fres instanceof Promise) { await fres }
216
+ }
217
+ catch (err) {
218
+ const e = this._unexpected(ctx, err)
219
+ if (e) { throw e }
220
+ }
197
221
  }
198
222
 
199
223
 
@@ -26,6 +26,7 @@ class EntityOperation {
26
26
  } = utility
27
27
 
28
28
  let fres = undefined
29
+ let predone = false
29
30
 
30
31
  let ctx = makeContext({
31
32
  opname: 'create',
@@ -76,6 +77,7 @@ class EntityOperation {
76
77
  }
77
78
 
78
79
 
80
+ predone = true
79
81
  // #PreDone-Hook
80
82
 
81
83
  if (null != ctx.result) {
@@ -114,6 +116,12 @@ class EntityOperation {
114
116
  return undefined
115
117
  }
116
118
  }
119
+ finally {
120
+ // A refusal, a failed step or a throw left before PreDone.
121
+ if (!predone) {
122
+ await this._lateDone(ctx)
123
+ }
124
+ }
117
125
  }
118
126
 
119
127
  // EJECT-END
@@ -27,6 +27,7 @@ class EntityOperation {
27
27
  } = utility
28
28
 
29
29
  let fres = undefined
30
+ let predone = false
30
31
 
31
32
  let ctx = makeContext({
32
33
  opname: 'list',
@@ -77,6 +78,7 @@ class EntityOperation {
77
78
  }
78
79
 
79
80
 
81
+ predone = true
80
82
  // #PreDone-Hook
81
83
 
82
84
  if (null != ctx.result) {
@@ -108,6 +110,12 @@ class EntityOperation {
108
110
  return undefined
109
111
  }
110
112
  }
113
+ finally {
114
+ // A refusal, a failed step or a throw left before PreDone.
115
+ if (!predone) {
116
+ await this._lateDone(ctx)
117
+ }
118
+ }
111
119
  }
112
120
 
113
121
  // EJECT-END
@@ -27,6 +27,7 @@ class EntityOperation {
27
27
  } = utility
28
28
 
29
29
  let fres = undefined
30
+ let predone = false
30
31
 
31
32
  let ctx = makeContext({
32
33
  opname: 'load',
@@ -77,6 +78,7 @@ class EntityOperation {
77
78
  }
78
79
 
79
80
 
81
+ predone = true
80
82
  // #PreDone-Hook
81
83
 
82
84
  if (null != ctx.result) {
@@ -119,6 +121,12 @@ class EntityOperation {
119
121
  return undefined
120
122
  }
121
123
  }
124
+ finally {
125
+ // A refusal, a failed step or a throw left before PreDone.
126
+ if (!predone) {
127
+ await this._lateDone(ctx)
128
+ }
129
+ }
122
130
  }
123
131
 
124
132
  // EJECT-END
@@ -27,6 +27,7 @@ class EntityOperation {
27
27
  } = utility
28
28
 
29
29
  let fres = undefined
30
+ let predone = false
30
31
 
31
32
  let ctx = makeContext({
32
33
  opname: 'patch',
@@ -78,6 +79,7 @@ class EntityOperation {
78
79
  }
79
80
 
80
81
 
82
+ predone = true
81
83
  // #PreDone-Hook
82
84
 
83
85
  if (null != ctx.result) {
@@ -120,6 +122,12 @@ class EntityOperation {
120
122
  return undefined
121
123
  }
122
124
  }
125
+ finally {
126
+ // A refusal, a failed step or a throw left before PreDone.
127
+ if (!predone) {
128
+ await this._lateDone(ctx)
129
+ }
130
+ }
123
131
  }
124
132
 
125
133
  // EJECT-END
@@ -27,6 +27,7 @@ class EntityOperation {
27
27
  } = utility
28
28
 
29
29
  let fres = undefined
30
+ let predone = false
30
31
 
31
32
  let ctx = makeContext({
32
33
  opname: 'remove',
@@ -78,6 +79,7 @@ class EntityOperation {
78
79
  }
79
80
 
80
81
 
82
+ predone = true
81
83
  // #PreDone-Hook
82
84
 
83
85
  if (null != ctx.result) {
@@ -126,6 +128,12 @@ class EntityOperation {
126
128
  return undefined
127
129
  }
128
130
  }
131
+ finally {
132
+ // A refusal, a failed step or a throw left before PreDone.
133
+ if (!predone) {
134
+ await this._lateDone(ctx)
135
+ }
136
+ }
129
137
  }
130
138
 
131
139
  // EJECT-END
@@ -27,6 +27,7 @@ class EntityOperation {
27
27
  } = utility
28
28
 
29
29
  let fres = undefined
30
+ let predone = false
30
31
 
31
32
  let ctx = makeContext({
32
33
  opname: 'update',
@@ -78,6 +79,7 @@ class EntityOperation {
78
79
  }
79
80
 
80
81
 
82
+ predone = true
81
83
  // #PreDone-Hook
82
84
 
83
85
  if (null != ctx.result) {
@@ -120,6 +122,12 @@ class EntityOperation {
120
122
  return undefined
121
123
  }
122
124
  }
125
+ finally {
126
+ // A refusal, a failed step or a throw left before PreDone.
127
+ if (!predone) {
128
+ await this._lateDone(ctx)
129
+ }
130
+ }
123
131
  }
124
132
 
125
133
  // EJECT-END
@@ -67,23 +67,30 @@ class ProjectNameSDK {
67
67
  const extend = this._options.extend || []
68
68
 
69
69
  const featureorder = getpath(this._options, '__derived__.featureorder') || []
70
+ const placed = new Set()
70
71
  for (const fname of featureorder) {
71
72
  const fopts = this._options.feature[fname] || {}
72
73
  if (fopts.active) {
73
74
  // An active name with no generated class is legal when an
74
75
  // extend-supplied instance carries that name (station's adopt
75
- // path): the instance is added below, positioned by its own
76
- // __after__ entry, so skip it here rather than fail construction.
77
- if (!this._rootctx.config.hasFeature(fname) &&
78
- extend.some((f) => fname === f.name)) {
76
+ // path): the instance takes the slot the order gives its name.
77
+ const carried = this._rootctx.config.hasFeature(fname) ? undefined :
78
+ extend.find((f) => fname === f.name)
79
+ if (null != carried) {
80
+ placed.add(carried)
81
+ featureAdd(this._rootctx, carried)
79
82
  continue
80
83
  }
81
84
  featureAdd(this._rootctx, this._rootctx.config.makeFeature(fname))
82
85
  }
83
86
  }
84
87
 
88
+ // An extend feature is active by its option, else by its own flag.
85
89
  for (let f of extend) {
86
- featureAdd(this._rootctx, f)
90
+ const fa = this._options.feature[f.name]?.active
91
+ if (!placed.has(f) && (true === fa || (null == fa && true === f.active))) {
92
+ featureAdd(this._rootctx, f)
93
+ }
87
94
  }
88
95
 
89
96
  for (let f of this._features) {
@@ -652,9 +652,13 @@ class CleanTest {
652
652
  sinks.addAll(surfaces("mistyped:rejected", e))
653
653
  }
654
654
 
655
- // A number is registered as the text a message quotes it in.
656
- val numeric = construct(linkedMapOf<String, Any?>("apikey" to 918273645))
657
- val numbered = numeric.getUtility().clean(numeric.getRootCtx(), "found 918273645")
655
+ // A number is registered as the text the refusal quotes it in.
656
+ val numbered = try {
657
+ ${SDK}(offline(linkedMapOf<String, Any?>("apikey" to 918273645)))
658
+ null
659
+ } catch (e: RuntimeException) {
660
+ e.message
661
+ }
658
662
 
659
663
  for (unexpected in listOf(false, true)) {
660
664
  val hooked = makeSdk(scenarios[0], sinks, null, ThrowFeature(unexpected))
@@ -715,7 +719,8 @@ class CleanTest {
715
719
  assertEquals(0, leaked.size, "credential leaked through: " +
716
720
  leaked.joinToString("; ") { it.first + " [" + it.second.joinToString(", ") + "]" })
717
721
 
718
- assertEquals("found " + mask, numbered)
722
+ assertTrue(null != numbered && numbered.contains(mask) && !numbered.contains("918273645"),
723
+ "a numeric credential: " + numbered)
719
724
  assertEquals(linkedMapOf<String, Any?>(mask to 1, mask + "#1" to 2, "plain" to 3), named)
720
725
 
721
726
  // The positive half: the slot the credential travelled in is masked,
@@ -85,6 +85,7 @@ abstract class EntityBase(nm: String, clientIn: SdkClient, entoptsIn: MutableMap
85
85
 
86
86
  protected fun runOp(ctx: Context, postDone: () -> Unit): Any? {
87
87
  val utility = this.utility
88
+ var predone = false
88
89
 
89
90
  try {
90
91
  // #PrePoint-Hook
@@ -112,6 +113,7 @@ abstract class EntityBase(nm: String, clientIn: SdkClient, entoptsIn: MutableMap
112
113
  val result = utility.makeResult(ctx)
113
114
  ctx.out["result"] = result
114
115
 
116
+ predone = true
115
117
  // #PreDone-Hook
116
118
 
117
119
  postDone()
@@ -138,6 +140,23 @@ abstract class EntityBase(nm: String, clientIn: SdkClient, entoptsIn: MutableMap
138
140
  return out
139
141
  } catch (err: RuntimeException) {
140
142
  return unexpected(ctx, err)
143
+ } finally {
144
+ // A refusal, a failed step or a throw left before PreDone.
145
+ if (!predone) {
146
+ lateDone(ctx)
147
+ }
148
+ }
149
+ }
150
+
151
+ // PreDone on an exit that left before it. What the hook throws leaves
152
+ // cleaned, in place of the error already on its way out.
153
+ private fun lateDone(ctx: Context) {
154
+ try {
155
+ this.utility.featureHook(ctx, "PreDone")
156
+ } catch (err: RuntimeException) {
157
+ if (ctx.ctrl.throwing != false) {
158
+ throw cleanError(ctx, err)
159
+ }
141
160
  }
142
161
  }
143
162
 
@@ -889,7 +889,8 @@ describe("clean", function()
889
889
  local client = construct({
890
890
  apikey = CANARY.apikey,
891
891
  feature = {
892
- secrets = { active = false, name = "ZZNAME-feat123", token = "ZZTOKEN-feat456" },
892
+ secrets = { active = false, name = "ZZNAME-feat123",
893
+ providers = { { name = "static", token = "ZZTOKEN-feat456" } } },
893
894
  rbac = { active = false, rules = { ["zztoken.load"] = "PLAINRULE-k7j5h3g1" } },
894
895
  test = { active = false, entity = { zztoken = { ZZTOKEN01 = { note = "PLAINRECORD-t5r3e1w9" } } } },
895
896
  },