@voxgig/sdkgen 4.44.3 → 4.46.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 (161) hide show
  1. package/bin/voxgig-sdkgen +1 -1
  2. package/dist/action/check.js +15 -0
  3. package/dist/action/check.js.map +1 -1
  4. package/dist/action/copies.js +1 -0
  5. package/dist/action/copies.js.map +1 -1
  6. package/dist/action/doctor.d.ts +21 -2
  7. package/dist/action/doctor.js +166 -9
  8. package/dist/action/doctor.js.map +1 -1
  9. package/dist/action/package.js +9 -0
  10. package/dist/action/package.js.map +1 -1
  11. package/dist/action/remove.js +2 -1
  12. package/dist/action/remove.js.map +1 -1
  13. package/dist/action/target.d.ts +2 -1
  14. package/dist/action/target.js +50 -11
  15. package/dist/action/target.js.map +1 -1
  16. package/dist/cmp/AgentGuide.js +19 -8
  17. package/dist/cmp/AgentGuide.js.map +1 -1
  18. package/dist/cmp/AgentGuideContent.d.ts +6 -4
  19. package/dist/cmp/AgentGuideContent.js +51 -32
  20. package/dist/cmp/AgentGuideContent.js.map +1 -1
  21. package/dist/cmp/AgentGuideFeature.js +7 -4
  22. package/dist/cmp/AgentGuideFeature.js.map +1 -1
  23. package/dist/cmp/AgentGuideTop.js +84 -46
  24. package/dist/cmp/AgentGuideTop.js.map +1 -1
  25. package/dist/cmp/Changelog.js +12 -1
  26. package/dist/cmp/Changelog.js.map +1 -1
  27. package/dist/cmp/Deploy.js +22 -20
  28. package/dist/cmp/Deploy.js.map +1 -1
  29. package/dist/cmp/ExternalTarget.js +5 -5
  30. package/dist/cmp/ExternalTarget.js.map +1 -1
  31. package/dist/cmp/Feature.js +10 -3
  32. package/dist/cmp/Feature.js.map +1 -1
  33. package/dist/cmp/FeatureDocs.d.ts +6 -4
  34. package/dist/cmp/FeatureDocs.js +14 -39
  35. package/dist/cmp/FeatureDocs.js.map +1 -1
  36. package/dist/cmp/FeatureHook.d.ts +7 -1
  37. package/dist/cmp/FeatureHook.js +34 -1
  38. package/dist/cmp/FeatureHook.js.map +1 -1
  39. package/dist/cmp/PublishWorkflow.js +30 -6
  40. package/dist/cmp/PublishWorkflow.js.map +1 -1
  41. package/dist/cmp/ReadmeErrors.js +521 -18
  42. package/dist/cmp/ReadmeErrors.js.map +1 -1
  43. package/dist/cmp/ReadmeExplanation.js +280 -44
  44. package/dist/cmp/ReadmeExplanation.js.map +1 -1
  45. package/dist/cmp/ReadmeFeatures.js +16 -7
  46. package/dist/cmp/ReadmeFeatures.js.map +1 -1
  47. package/dist/cmp/ReadmeIntro.js +3 -2
  48. package/dist/cmp/ReadmeIntro.js.map +1 -1
  49. package/dist/cmp/ReadmeRefFeatures.js +34 -24
  50. package/dist/cmp/ReadmeRefFeatures.js.map +1 -1
  51. package/dist/cmp/ReadmeStation.js +11 -8
  52. package/dist/cmp/ReadmeStation.js.map +1 -1
  53. package/dist/cmp/ReadmeTop.js +472 -373
  54. package/dist/cmp/ReadmeTop.js.map +1 -1
  55. package/dist/cmp/ReadmeUnions.js +8 -2
  56. package/dist/cmp/ReadmeUnions.js.map +1 -1
  57. package/dist/cmp/Security.js +3 -2
  58. package/dist/cmp/Security.js.map +1 -1
  59. package/dist/helpers/applicability.d.ts +2 -1
  60. package/dist/helpers/applicability.js +26 -0
  61. package/dist/helpers/applicability.js.map +1 -1
  62. package/dist/helpers/copymerge.d.ts +3 -0
  63. package/dist/helpers/copymerge.js +43 -10
  64. package/dist/helpers/copymerge.js.map +1 -1
  65. package/dist/helpers/doccheck.d.ts +11 -0
  66. package/dist/helpers/doccheck.js +146 -0
  67. package/dist/helpers/doccheck.js.map +1 -0
  68. package/dist/helpers/doctext.d.ts +11 -0
  69. package/dist/helpers/doctext.js +84 -0
  70. package/dist/helpers/doctext.js.map +1 -0
  71. package/dist/helpers/exampleCall.d.ts +16 -0
  72. package/dist/helpers/exampleCall.js +334 -0
  73. package/dist/helpers/exampleCall.js.map +1 -0
  74. package/dist/helpers/exportnames.d.ts +4 -0
  75. package/dist/helpers/exportnames.js +35 -0
  76. package/dist/helpers/exportnames.js.map +1 -0
  77. package/dist/helpers/facts.d.ts +4 -0
  78. package/dist/helpers/facts.js +92 -0
  79. package/dist/helpers/facts.js.map +1 -0
  80. package/dist/helpers/modelcheck.d.ts +2 -1
  81. package/dist/helpers/modelcheck.js +13 -0
  82. package/dist/helpers/modelcheck.js.map +1 -1
  83. package/dist/helpers/opExample.d.ts +9 -2
  84. package/dist/helpers/opExample.js +22 -2
  85. package/dist/helpers/opExample.js.map +1 -1
  86. package/dist/helpers/opShape.d.ts +2 -1
  87. package/dist/helpers/opShape.js +12 -0
  88. package/dist/helpers/opShape.js.map +1 -1
  89. package/dist/helpers/packageMeta.js +21 -8
  90. package/dist/helpers/packageMeta.js.map +1 -1
  91. package/dist/helpers/semver.d.ts +2 -1
  92. package/dist/helpers/semver.js +7 -0
  93. package/dist/helpers/semver.js.map +1 -1
  94. package/dist/helpers/shipped.d.ts +2 -1
  95. package/dist/helpers/shipped.js +4 -0
  96. package/dist/helpers/shipped.js.map +1 -1
  97. package/dist/sdkgen.d.ts +2 -1
  98. package/dist/sdkgen.js +29 -6
  99. package/dist/sdkgen.js.map +1 -1
  100. package/dist/testkit.d.ts +1 -0
  101. package/dist/testkit.js +23 -19
  102. package/dist/testkit.js.map +1 -1
  103. package/dist/tsconfig.tsbuildinfo +1 -1
  104. package/dist/utility.js +2 -1
  105. package/dist/utility.js.map +1 -1
  106. package/model/fact.aontu +59 -0
  107. package/model/sdkgen.aontu +6 -2
  108. package/package.json +3 -1
  109. package/project/.sdk/src/cmp/c/ReadmeQuick_c.ts +1 -1
  110. package/project/.sdk/src/cmp/c/ReadmeTopQuick_c.ts +1 -1
  111. package/project/.sdk/src/cmp/clojure/ReadmeEntity_clojure.ts +12 -3
  112. package/project/.sdk/src/cmp/scala/ReadmeRef_scala.ts +4 -1
  113. package/project/.sdk/src/cmp/swift/ReadmeQuick_swift.ts +1 -0
  114. package/project/.sdk/src/cmp/swift/ReadmeRef_swift.ts +3 -0
  115. package/project/.sdk/src/cmp/swift/ReadmeTopQuick_swift.ts +2 -1
  116. package/project/.sdk/src/cmp/zig/ReadmeOptions_zig.ts +1 -1
  117. package/project/.sdk/src/cmp/zig/ReadmeQuick_zig.ts +2 -2
  118. package/project/.sdk/src/cmp/zig/ReadmeTopQuick_zig.ts +2 -2
  119. package/project/sdkgen-package.json +1 -1
  120. package/src/action/check.ts +21 -0
  121. package/src/action/copies.ts +2 -0
  122. package/src/action/doctor.ts +244 -13
  123. package/src/action/package.ts +10 -0
  124. package/src/action/remove.ts +2 -1
  125. package/src/action/target.ts +66 -15
  126. package/src/cmp/AgentGuide.ts +24 -10
  127. package/src/cmp/AgentGuideContent.ts +53 -32
  128. package/src/cmp/AgentGuideFeature.ts +8 -5
  129. package/src/cmp/AgentGuideTop.ts +108 -47
  130. package/src/cmp/Changelog.ts +13 -2
  131. package/src/cmp/Deploy.ts +23 -21
  132. package/src/cmp/ExternalTarget.ts +6 -6
  133. package/src/cmp/Feature.ts +11 -4
  134. package/src/cmp/FeatureDocs.ts +21 -40
  135. package/src/cmp/FeatureHook.ts +38 -1
  136. package/src/cmp/PublishWorkflow.ts +33 -7
  137. package/src/cmp/ReadmeErrors.ts +555 -25
  138. package/src/cmp/ReadmeExplanation.ts +316 -52
  139. package/src/cmp/ReadmeFeatures.ts +18 -8
  140. package/src/cmp/ReadmeIntro.ts +3 -2
  141. package/src/cmp/ReadmeRefFeatures.ts +39 -27
  142. package/src/cmp/ReadmeStation.ts +12 -14
  143. package/src/cmp/ReadmeTop.ts +528 -387
  144. package/src/cmp/ReadmeUnions.ts +10 -2
  145. package/src/cmp/Security.ts +3 -2
  146. package/src/helpers/applicability.ts +28 -0
  147. package/src/helpers/copymerge.ts +58 -10
  148. package/src/helpers/doccheck.ts +174 -0
  149. package/src/helpers/doctext.ts +113 -0
  150. package/src/helpers/exampleCall.ts +415 -0
  151. package/src/helpers/exportnames.ts +47 -0
  152. package/src/helpers/facts.ts +119 -0
  153. package/src/helpers/modelcheck.ts +16 -0
  154. package/src/helpers/opExample.ts +34 -2
  155. package/src/helpers/opShape.ts +13 -0
  156. package/src/helpers/packageMeta.ts +21 -8
  157. package/src/helpers/semver.ts +9 -0
  158. package/src/helpers/shipped.ts +5 -0
  159. package/src/sdkgen.ts +31 -2
  160. package/src/testkit.ts +30 -20
  161. package/src/utility.ts +2 -1
@@ -7,10 +7,11 @@ const types_1 = require("../types");
7
7
  const opShape_1 = require("../helpers/opShape");
8
8
  const opExample_1 = require("../helpers/opExample");
9
9
  const naming_1 = require("../helpers/naming");
10
- const DEFAULT_LANG = {
11
- entity: (call, op) => `Entity operations reject on failure, so wrap them in \`try\` / \`catch\`:
10
+ const exampleCall_1 = require("../helpers/exampleCall");
11
+ const packageMeta_1 = require("../helpers/packageMeta");
12
+ const TS_ENTITY = (fence) => ({ call, op }) => `Entity operations reject on failure, so wrap them in \`try\` / \`catch\`:
12
13
 
13
- \`\`\`ts
14
+ \`\`\`${fence}
14
15
  try {
15
16
  const ${call.resultVar} = await ${call.expr}
16
17
  console.log(${'list' === op ? call.resultVar + '.map((item) => item.data())' : call.resultVar + '.data()'})
@@ -19,12 +20,12 @@ try {
19
20
  }
20
21
  \`\`\`
21
22
 
22
- `,
23
- direct: `The low-level \`direct()\` method does **not** throw — it returns the
23
+ `;
24
+ const TS_DIRECT = (fence) => `The low-level \`direct()\` method does **not** throw — it returns the
24
25
  result envelope. Branch on \`ok\`; on failure \`status\` holds the HTTP status
25
26
  (for error responses) and \`err\` holds the error:
26
27
 
27
- \`\`\`ts
28
+ \`\`\`${fence}
28
29
  const result = await client.direct({
29
30
  path: '/api/resource/{id}',
30
31
  method: 'GET',
@@ -36,11 +37,26 @@ if (!result.ok) {
36
37
  }
37
38
  \`\`\`
38
39
 
40
+ `;
41
+ // The direct() paragraph every row shares, with its own name for the call and for not failing.
42
+ function directLead(call, fails, returns) {
43
+ return `\`${call}\` does **not** ${fails} — it
44
+ returns ${returns}. Branch on \`ok\`; on failure \`status\` holds the HTTP
45
+ status (for error responses) and \`err\` holds a transport error:
46
+
47
+ `;
48
+ }
49
+ // A language with no row writes neutral prose and no code.
50
+ const DEFAULT_LANG = {
51
+ direct: `The low-level \`direct\` method does not fail on an error response — it
52
+ returns the result envelope. Branch on \`ok\`; on failure \`status\` holds the
53
+ HTTP status (for error responses) and \`err\` holds the error.
54
+
39
55
  `,
40
56
  };
41
57
  const LANGS = {
42
58
  py: {
43
- entity: (call, op) => `Entity operations raise on failure, so wrap them in \`try\` / \`except\`:
59
+ entity: ({ call, op }) => `Entity operations raise on failure, so wrap them in \`try\` / \`except\`:
44
60
 
45
61
  \`\`\`python
46
62
  try:
@@ -69,7 +85,7 @@ if not result["ok"]:
69
85
  `,
70
86
  },
71
87
  php: {
72
- entity: (call, op) => `Entity operations throw a \`\\Throwable\` on failure, so wrap them in
88
+ entity: ({ call, op }) => `Entity operations throw a \`\\Throwable\` on failure, so wrap them in
73
89
  \`try\` / \`catch\`:
74
90
 
75
91
  \`\`\`php
@@ -101,7 +117,7 @@ if (! $result["ok"]) {
101
117
  `,
102
118
  },
103
119
  rb: {
104
- entity: (call, op) => `Entity operations raise on failure, so rescue them:
120
+ entity: ({ call, op }) => `Entity operations raise on failure, so rescue them:
105
121
 
106
122
  \`\`\`ruby
107
123
  begin
@@ -129,7 +145,7 @@ warn "request failed: #{result["err"] || "HTTP #{result["status"]}"}" unless res
129
145
  `,
130
146
  },
131
147
  lua: {
132
- entity: (call, op) => `Entity operations return \`(value, err)\`. Check \`err\` before using
148
+ entity: ({ call, op }) => `Entity operations return \`(value, err)\`. Check \`err\` before using
133
149
  the value:
134
150
 
135
151
  \`\`\`lua
@@ -152,7 +168,7 @@ if err then error(err) end
152
168
  `,
153
169
  },
154
170
  go: {
155
- entity: (call, op) => `Every entity operation returns \`(value, error)\`. Check \`err\` before
171
+ entity: ({ call, op }) => `Every entity operation returns \`(value, error)\`. Check \`err\` before
156
172
  using the value — there is no exception to catch:
157
173
 
158
174
  \`\`\`go
@@ -179,13 +195,500 @@ if err != nil {
179
195
  _ = result
180
196
  \`\`\`
181
197
 
198
+ `,
199
+ },
200
+ ts: {
201
+ entity: TS_ENTITY('ts'),
202
+ direct: TS_DIRECT('ts'),
203
+ },
204
+ js: {
205
+ entity: TS_ENTITY('js'),
206
+ direct: TS_DIRECT('js'),
207
+ },
208
+ c: {
209
+ entity: (x) => {
210
+ const { v, factory, arg } = (0, exampleCall_1.exampleParts)('c', x);
211
+ const call = `${v}->vt->${x.op}(${v}, ${arg}, NULL, &err)`;
212
+ const ok = 'list' === x.op ? ` for (size_t i = 0; ${v}s[i]; i++) {
213
+ printf("%s\\n", voxgig_to_json(${v}s[i]->vt->data(${v}s[i], NULL)));
214
+ }` : ` printf("%s\\n", voxgig_to_json(${v}->vt->data(${v}, NULL)));`;
215
+ return `Entity operations set \`*err\` on failure, so check \`err\` after each call:
216
+
217
+ \`\`\`c
218
+ Entity* ${v} = ${factory};
219
+ PNError* err = NULL;
220
+ ${'list' === x.op ? `Entity** ${v}s = ${call};` : `${call};`}
221
+ if (err) {
222
+ fprintf(stderr, "${x.op} failed: %s\\n", err->msg);
223
+ } else {
224
+ ${ok}
225
+ }
226
+ \`\`\`
227
+
228
+ `;
229
+ },
230
+ direct: directLead('sdk_direct()', 'set `*err` for an error response', 'the result map') +
231
+ `\`\`\`c
232
+ PNError* err = NULL;
233
+ voxgig_value* result = sdk_direct(client, cmap(3,
234
+ "path", v_str("/api/resource/{id}"),
235
+ "method", v_str("GET"),
236
+ "params", cmap(1, "id", v_str("example_id"))), &err);
237
+
238
+ if (!voxgig_as_bool(getp(result, "ok"))) {
239
+ fprintf(stderr, "request failed: %lld %s\\n",
240
+ (long long)to_int(getp(result, "status")), voxgig_to_json(getp(result, "err")));
241
+ }
242
+ \`\`\`
243
+
244
+ `,
245
+ },
246
+ cpp: {
247
+ entity: (x) => {
248
+ const { v, factory, arg } = (0, exampleCall_1.exampleParts)('cpp', x);
249
+ const call = `${factory}->${x.op}(${arg}, Value::undef())`;
250
+ const body = 'list' === x.op ? ` std::vector<SdkEntityPtr> ${v}s = ${call};
251
+ for (const auto& ${v} : ${v}s) {
252
+ std::cout << Struct::jsonify(${v}->data()) << std::endl;
253
+ }` : ` SdkEntityPtr ${v} = ${call};
254
+ std::cout << Struct::jsonify(${v}->data()) << std::endl;`;
255
+ return `Entity operations throw \`SdkErrorPtr\` on failure, so wrap them in \`try\` / \`catch\`:
256
+
257
+ \`\`\`cpp
258
+ try {
259
+ ${body}
260
+ } catch (const SdkErrorPtr& err) {
261
+ std::cerr << "${x.op} failed: " << err->msg << std::endl;
262
+ }
263
+ \`\`\`
264
+
265
+ `;
266
+ },
267
+ direct: directLead('direct()', 'throw', 'the result `Value`') +
268
+ `\`\`\`cpp
269
+ Value result = client->direct(vmap({
270
+ {"path", Value("/api/resource/{id}")},
271
+ {"method", Value("GET")},
272
+ {"params", vmap({{"id", Value("example_id")}})},
273
+ }));
274
+
275
+ if (!(getp(result, "ok") == Value(true))) {
276
+ std::cerr << "request failed: " << Helpers::toInt(getp(result, "status")) << " "
277
+ << Struct::jsonify(getp(result, "err")) << std::endl;
278
+ }
279
+ \`\`\`
280
+
281
+ `,
282
+ },
283
+ rust: {
284
+ entity: (x) => {
285
+ const { v, factory, arg } = (0, exampleCall_1.exampleParts)('rust', x);
286
+ const ok = 'list' === x.op ? ` Ok(${v}s) => {
287
+ for ${v} in &${v}s {
288
+ println!("{:?}", ${v}.data(None));
289
+ }
290
+ }` : ` Ok(${v}) => println!("{:?}", ${v}.data(None)),`;
291
+ return `Entity operations return a \`Result\`, so match on \`Ok\` and \`Err\`:
292
+
293
+ \`\`\`rust
294
+ match ${factory}.${x.op}(${arg}, Value::Noval) {
295
+ ${ok}
296
+ Err(err) => eprintln!("${x.op} failed: {}", err),
297
+ }
298
+ \`\`\`
299
+
300
+ `;
301
+ },
302
+ direct: directLead('direct()', 'return `Err` for an error response', '`Ok` with the result map') +
303
+ `\`\`\`rust
304
+ match client.direct(jo(vec![
305
+ ("path", Value::str("/api/resource/{id}")),
306
+ ("method", Value::str("GET")),
307
+ ("params", jo(vec![("id", Value::str("example_id"))])),
308
+ ])) {
309
+ Ok(result) => {
310
+ if getp(&result, "ok") != Value::Bool(true) {
311
+ eprintln!("request failed: {:?} {:?}", getp(&result, "status"), getp(&result, "err"));
312
+ }
313
+ }
314
+ Err(err) => eprintln!("request failed: {}", err),
315
+ }
316
+ \`\`\`
317
+
318
+ `,
319
+ },
320
+ zig: {
321
+ entity: (x) => {
322
+ const { v, factory, arg } = (0, exampleCall_1.exampleParts)('zig', x);
323
+ const ok = 'list' === x.op ? ` .ok => |${v}s| {
324
+ for (${v}s) |${v}| {
325
+ std.debug.print("{s}\\n", .{h.stringify(${v}.asEntity().data(null))});
326
+ }
327
+ },` : ('remove' === x.op ? ` .ok => std.debug.print("removed\\n", .{}),` :
328
+ ` .ok => |${v}| std.debug.print("{s}\\n", .{h.stringify(${v}.asEntity().data(null))}),`);
329
+ return `Entity operations return a union of \`.ok\` and \`.err\`, so \`switch\` on the result:
330
+
331
+ \`\`\`zig
332
+ switch (${factory}.${x.op}(${arg}, h.vnull())) {
333
+ ${ok}
334
+ .err => |e| std.debug.print("${x.op} failed: {s}\\n", .{e.msg}),
335
+ }
336
+ \`\`\`
337
+
338
+ `;
339
+ },
340
+ direct: directLead('direct()', 'fail on an error response', 'the result map') +
341
+ `\`\`\`zig
342
+ const result = client.direct(h.jo(&.{
343
+ .{ "path", h.vstr("/api/resource/{id}") },
344
+ .{ "method", h.vstr("GET") },
345
+ .{ "params", h.jo(&.{.{ "id", h.vstr("example_id") }}) },
346
+ }));
347
+
348
+ if (!(h.get_bool(result, "ok") orelse false)) {
349
+ std.debug.print("request failed: {d} {s}\\n", .{
350
+ h.to_int(h.getp(result, "status")), h.stringify(h.getp(result, "err")),
351
+ });
352
+ }
353
+ \`\`\`
354
+
355
+ `,
356
+ },
357
+ ocaml: {
358
+ entity: (x) => {
359
+ const { v, factory, arg } = (0, exampleCall_1.exampleParts)('ocaml', x);
360
+ const body = 'list' === x.op ? ` let ${v}s = ${factory}.e_list ${arg} Noval in
361
+ List.iter (fun e -> print_endline (stringify (e.e_data_get ()))) ${v}s` :
362
+ ` let ${v} = ${factory}.e_${x.op} ${arg} Noval in
363
+ print_endline (stringify (${v}.e_data_get ()))`;
364
+ return `Entity operations raise \`Sdk_error.E\` on failure, so wrap them in \`try\` ... \`with\`:
365
+
366
+ \`\`\`ocaml
367
+ (try
368
+ ${body}
369
+ with Sdk_error.E err -> Printf.eprintf "${x.op} failed: %s\\n" (Sdk_error.message err))
370
+ \`\`\`
371
+
372
+ `;
373
+ },
374
+ direct: directLead('Sdk_client.direct', 'raise', 'the result map') +
375
+ `\`\`\`ocaml
376
+ let result = Sdk_client.direct client (jo [
377
+ ("path", Str "/api/resource/{id}");
378
+ ("method", Str "GET");
379
+ ("params", jo [("id", Str "example_id")]);
380
+ ]) in
381
+ (match getp result "ok" with
382
+ | Bool true -> ()
383
+ | _ ->
384
+ Printf.eprintf "request failed: %s %s\\n"
385
+ (stringify (getp result "status")) (stringify (getp result "err")))
386
+ \`\`\`
387
+
388
+ `,
389
+ },
390
+ perl: {
391
+ entity: (x) => {
392
+ const { v, factory, arg } = (0, exampleCall_1.exampleParts)('perl', x);
393
+ return `Entity operations die on failure, so wrap them in \`eval\` and check \`$@\`:
394
+
395
+ \`\`\`perl
396
+ my $${'list' === x.op ? v + 's' : v} = eval { ${factory}->${x.op}(${arg}) };
397
+ if (my $err = $@) {
398
+ warn "${x.op} failed: $err";
399
+ }
400
+ \`\`\`
401
+
402
+ `;
403
+ },
404
+ direct: directLead('direct', 'die', 'the result hashref') +
405
+ `\`\`\`perl
406
+ my $result = $client->direct({
407
+ 'path' => '/api/resource/{id}',
408
+ 'method' => 'GET',
409
+ 'params' => { 'id' => 'example_id' },
410
+ });
411
+
412
+ unless ($result->{ok}) {
413
+ warn 'request failed: ', ($result->{status} // ''), ' ', ($result->{err} // ''), "\\n";
414
+ }
415
+ \`\`\`
416
+
417
+ `,
418
+ },
419
+ java: {
420
+ entity: (x) => {
421
+ const { v, factory, arg } = (0, exampleCall_1.exampleParts)('java', x);
422
+ const body = 'list' === x.op ? ` List<?> ${v}s = (List<?>) ${factory}.list(${arg}, null);
423
+ for (Object item : ${v}s) {
424
+ System.out.println(((SdkEntity) item).data());
425
+ }` : ` SdkEntity ${v} = (SdkEntity) ${factory}.${x.op}(${arg}, null);
426
+ System.out.println(${v}.data());`;
427
+ return `Entity operations throw a \`RuntimeException\` on failure, so wrap them in
428
+ \`try\` / \`catch\`:
429
+
430
+ \`\`\`java
431
+ try {
432
+ ${body}
433
+ }
434
+ catch (RuntimeException err) {
435
+ System.out.println("${x.op} failed: " + err.getMessage());
436
+ }
437
+ \`\`\`
438
+
439
+ `;
440
+ },
441
+ direct: directLead('direct()', 'throw', 'the result map') +
442
+ `\`\`\`java
443
+ Map<String, Object> result = client.direct(Map.of(
444
+ "path", "/api/resource/{id}",
445
+ "method", "GET",
446
+ "params", Map.of("id", "example_id")));
447
+
448
+ if (!Boolean.TRUE.equals(result.get("ok"))) {
449
+ System.out.println("request failed: " + result.get("status") + " " + result.get("err"));
450
+ }
451
+ \`\`\`
452
+
453
+ `,
454
+ },
455
+ kotlin: {
456
+ entity: (x) => {
457
+ const { v, factory, arg } = (0, exampleCall_1.exampleParts)('kotlin', x);
458
+ const body = 'list' === x.op ? ` val ${v}s = ${factory}.list(${arg}, null) as List<*>
459
+ for (item in ${v}s) {
460
+ println((item as SdkEntity).data())
461
+ }` : ` val ${v} = ${factory}.${x.op}(${arg}, null) as SdkEntity
462
+ println(${v}.data())`;
463
+ return `Entity operations throw a \`RuntimeException\` on failure, so wrap them in
464
+ \`try\` / \`catch\`:
465
+
466
+ \`\`\`kotlin
467
+ try {
468
+ ${body}
469
+ }
470
+ catch (err: RuntimeException) {
471
+ println("${x.op} failed: " + err.message)
472
+ }
473
+ \`\`\`
474
+
475
+ `;
476
+ },
477
+ direct: directLead('direct()', 'throw', 'the result map') +
478
+ `\`\`\`kotlin
479
+ val result = client.direct(mutableMapOf<String, Any?>(
480
+ "path" to "/api/resource/{id}",
481
+ "method" to "GET",
482
+ "params" to mapOf("id" to "example_id")))
483
+
484
+ if (result["ok"] != true) {
485
+ println("request failed: " + result["status"] + " " + result["err"])
486
+ }
487
+ \`\`\`
488
+
489
+ `,
490
+ },
491
+ scala: {
492
+ entity: (x) => {
493
+ const { v, factory, arg } = (0, exampleCall_1.exampleParts)('scala', x);
494
+ const body = 'list' === x.op ? ` val ${v}s = ${factory}.list(${arg}, null).asInstanceOf[java.util.List[SdkEntity]]
495
+ ${v}s.forEach(item => println(item.data()))` :
496
+ ` val ${v} = ${factory}.${x.op}(${arg}, null).asInstanceOf[SdkEntity]
497
+ println(${v}.data())`;
498
+ return `Entity operations throw a \`RuntimeException\` on failure, so wrap them in
499
+ \`try\` / \`catch\`:
500
+
501
+ \`\`\`scala
502
+ try {
503
+ ${body}
504
+ }
505
+ catch {
506
+ case err: RuntimeException => println("${x.op} failed: " + err.getMessage)
507
+ }
508
+ \`\`\`
509
+
510
+ `;
511
+ },
512
+ direct: directLead('direct()', 'throw', 'the result map') +
513
+ `\`\`\`scala
514
+ val result = client.direct(java.util.Map.of(
515
+ "path", "/api/resource/{id}",
516
+ "method", "GET",
517
+ "params", java.util.Map.of("id", "example_id")))
518
+
519
+ if (java.lang.Boolean.TRUE != result.get("ok")) {
520
+ println("request failed: " + result.get("status") + " " + result.get("err"))
521
+ }
522
+ \`\`\`
523
+
524
+ `,
525
+ },
526
+ csharp: {
527
+ entity: (x) => {
528
+ const { v, factory, arg } = (0, exampleCall_1.exampleParts)('csharp', x);
529
+ const method = x.op.charAt(0).toUpperCase() + x.op.slice(1);
530
+ const body = 'list' === x.op ? ` var ${v}List = (List<object?>)${factory}.List(${arg})!;
531
+ foreach (var ${v}Item in ${v}List)
532
+ {
533
+ Console.WriteLine(StructUtils.Jsonify(((IEntity)${v}Item!).Data()));
534
+ }` : ` var ${v} = (IEntity)${factory}.${method}(${arg})!;
535
+ Console.WriteLine(StructUtils.Jsonify(${v}.Data()));`;
536
+ return `Entity operations throw on failure, so wrap them in \`try\` / \`catch\`:
537
+
538
+ \`\`\`csharp
539
+ try
540
+ {
541
+ ${body}
542
+ }
543
+ catch (Exception err)
544
+ {
545
+ Console.WriteLine($"${x.op} failed: {err.Message}");
546
+ }
547
+ \`\`\`
548
+
549
+ `;
550
+ },
551
+ direct: directLead('Direct()', 'throw', 'the result dictionary') +
552
+ `\`\`\`csharp
553
+ var result = client.Direct(new Dictionary<string, object?>
554
+ {
555
+ ["path"] = "/api/resource/{id}",
556
+ ["method"] = "GET",
557
+ ["params"] = new Dictionary<string, object?> { ["id"] = "example_id" },
558
+ });
559
+
560
+ if (!Equals(result["ok"], true))
561
+ {
562
+ result.TryGetValue("status", out var status);
563
+ result.TryGetValue("err", out var err);
564
+ Console.WriteLine($"request failed: {status} {err}");
565
+ }
566
+ \`\`\`
567
+
568
+ `,
569
+ },
570
+ swift: {
571
+ entity: (x) => {
572
+ const { v, factory, arg } = (0, exampleCall_1.exampleParts)('swift', x);
573
+ const body = 'list' === x.op ? ` let ${v}List = try ${factory}.list(${arg}, nil)
574
+ for ${v}Item in ${v}List.asList?.items ?? [] {
575
+ if let ${v}Entity = ${v}Item.asNative as? Entity {
576
+ print(${v}Entity.data())
577
+ }
578
+ }` : ` let ${v} = try ${factory}.${x.op}(${arg}, nil)
579
+ if let ${v}Entity = ${v}.asNative as? Entity {
580
+ print(${v}Entity.data())
581
+ }`;
582
+ return `Entity operations throw on failure, so call them with \`try\` inside \`do\` / \`catch\`:
583
+
584
+ \`\`\`swift
585
+ do {
586
+ ${body}
587
+ }
588
+ catch {
589
+ print("${x.op} failed: \\(error)")
590
+ }
591
+ \`\`\`
592
+
593
+ `;
594
+ },
595
+ direct: directLead('direct()', 'throw', 'the result map') +
596
+ `\`\`\`swift
597
+ let result = client.direct(VMap([
598
+ ("path", .string("/api/resource/{id}")),
599
+ ("method", .string("GET")),
600
+ ("params", .map([("id", .string("example_id"))])),
601
+ ]))
602
+
603
+ if result.entries["ok"] != .bool(true) {
604
+ print("request failed:", result.entries["status"] ?? .noval, result.entries["err"] ?? .noval)
605
+ }
606
+ \`\`\`
607
+
608
+ `,
609
+ },
610
+ elixir: {
611
+ entity: (x) => {
612
+ const { v, factory, arg } = (0, exampleCall_1.exampleParts)('elixir', x);
613
+ const mod = `${x.model.const.Name}.Entity.${(0, exampleCall_1.entityName)(x.ent)}`;
614
+ const args = '' === arg ? v : `${v}, ${arg}`;
615
+ const body = 'list' === x.op ? ` ${v}s = ${mod}.list(${args})
616
+ for i <- 0..(Voxgig.Struct.size(${v}s) - 1)//1 do
617
+ IO.puts(Voxgig.Struct.jsonify(${mod}.data_get(Voxgig.Struct.getelem(${v}s, i))))
618
+ end` : ` ${v} = ${mod}.${x.op}(${args})
619
+ IO.puts(Voxgig.Struct.jsonify(${mod}.data_get(${v})))`;
620
+ return `Entity operations raise on failure, so wrap them in \`try\` / \`rescue\`:
621
+
622
+ \`\`\`elixir
623
+ try do
624
+ ${v} = ${factory}
625
+ ${body}
626
+ rescue
627
+ err -> IO.puts("${x.op} failed: " <> inspect(err))
628
+ end
629
+ \`\`\`
630
+
631
+ `;
632
+ },
633
+ direct: (model) => directLead('direct/2', 'raise', 'a result node') +
634
+ `\`\`\`elixir
635
+ result = ${model.const.Name}.direct(sdk, ${model.const.Name}.Helpers.deep(%{
636
+ "path" => "/api/resource/{id}",
637
+ "method" => "GET",
638
+ "params" => %{"id" => "example_id"}
639
+ }))
640
+
641
+ unless Voxgig.Struct.getprop(result, "ok") do
642
+ IO.puts("request failed: " <> inspect(Voxgig.Struct.getprop(result, "status")) <>
643
+ " " <> inspect(Voxgig.Struct.getprop(result, "err")))
644
+ end
645
+ \`\`\`
646
+
647
+ `,
648
+ },
649
+ clojure: {
650
+ entity: (x) => {
651
+ const { v, factory, arg } = (0, exampleCall_1.exampleParts)('clojure', x);
652
+ const ns = 'e-' + x.ent.name;
653
+ const body = 'list' === x.op ? ` (doseq [${v} (${ns}/list ${factory} ${arg} nil)]
654
+ (println ((:data-get ${v}))))` : ` (let [${v} (${ns}/${x.op} ${factory} ${arg} nil)]
655
+ (println ((:data-get ${v}))))`;
656
+ return `Entity operations throw on failure, so wrap them in \`try\` / \`catch\`:
657
+
658
+ \`\`\`clojure
659
+ (require '[sdk.api :as api]
660
+ '[sdk.entity.${x.ent.name} :as ${ns}]
661
+ '[voxgig.struct :as vs])
662
+
663
+ (try
664
+ ${body}
665
+ (catch Exception err
666
+ (println "${x.op} failed:" (.getMessage err))))
667
+ \`\`\`
668
+
669
+ `;
670
+ },
671
+ direct: directLead('api/direct', 'throw', 'the result map') +
672
+ `\`\`\`clojure
673
+ (def result
674
+ (api/direct client
675
+ (vs/jm "path" "/api/resource/{id}"
676
+ "method" "GET"
677
+ "params" (vs/jm "id" "example_id"))))
678
+
679
+ (when-not (vs/getprop result "ok")
680
+ (println "request failed:" (vs/getprop result "status") (vs/getprop result "err")))
681
+ \`\`\`
682
+
182
683
  `,
183
684
  },
184
685
  };
185
686
  const ReadmeErrors = (0, component_1.cmp)(function ReadmeErrors(props) {
186
687
  const { target, ctx$ } = props;
187
688
  const { model } = ctx$;
188
- const lang = LANGS[target.name] || DEFAULT_LANG;
689
+ // An alias writes its origin's row.
690
+ const origin = (0, packageMeta_1.originName)(model, target.name);
691
+ const lang = LANGS[origin] || DEFAULT_LANG;
189
692
  // Pick a real example entity WITH a real op (prefer a read op) so the
190
693
  // error-handling snippet never references a phantom entity or fabricates a
191
694
  // `.load()` on an op-less one (e.g. Cloudsmith's `Abort`). primaryOp is null
@@ -197,14 +700,14 @@ const ReadmeErrors = (0, component_1.cmp)(function ReadmeErrors(props) {
197
700
  ## Error handling
198
701
 
199
702
  `);
200
- if (ex && primaryOp) {
201
- const eName = ex.Name || (ex.name[0].toUpperCase() + ex.name.slice(1));
202
- const eLower = (0, naming_1.exampleVarName)(eName.toLowerCase(), target.name);
703
+ if (ex && primaryOp && lang.entity) {
704
+ const eName = (0, exampleCall_1.entityName)(ex);
705
+ const eLower = (0, naming_1.exampleVarName)(eName.toLowerCase(), origin);
203
706
  const idF = (0, opShape_1.entityIdField)(ex);
204
- const call = (0, opExample_1.primaryOpCall)((0, opExample_1.helperLang)(target.name), eName, eLower, primaryOp, idF, ex);
205
- (0, jostraca_1.Content)(lang.entity(call, primaryOp));
707
+ const call = (0, opExample_1.primaryOpCall)((0, opExample_1.helperLang)(origin), eName, eLower, primaryOp, idF, ex);
708
+ (0, jostraca_1.Content)(lang.entity({ model, ent: ex, op: primaryOp, idF, call }));
206
709
  }
207
- (0, jostraca_1.Content)(lang.direct);
710
+ (0, jostraca_1.Content)('function' === typeof lang.direct ? lang.direct(model) : lang.direct);
208
711
  });
209
712
  exports.ReadmeErrors = ReadmeErrors;
210
713
  //# sourceMappingURL=ReadmeErrors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReadmeErrors.js","sourceRoot":"","sources":["../../src/cmp/ReadmeErrors.ts"],"names":[],"mappings":";;;AACA,uCAAkC;AAClC,oDAA0C;AAE1C,oCAGiB;AAEjB,gDAAqE;AACrE,oDAAgE;AAEhE,8CAA+D;AAY/D,MAAM,YAAY,GAAe;IAC/B,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC;;;;UAId,IAAI,CAAC,SAAS,YAAY,IAAI,CAAC,IAAI;gBAC7B,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,6BAA6B,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,SAAS;;mBAExF,EAAE;;;;CAIpB;IACC,MAAM,EAAE;;;;;;;;;;;;;;;;CAgBT;CACA,CAAA;AAGD,MAAM,KAAK,GAA+B;IACxC,EAAE,EAAE;QACF,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC;;;;MAIpB,IAAI,CAAC,SAAS,MAAM,IAAI,CAAC,IAAI;Y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