@voxgig/sdkgen 4.41.1 → 4.43.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 (48) hide show
  1. package/bin/voxgig-sdkgen +1 -1
  2. package/dist/cmp/ReadmeIntro.js +21 -6
  3. package/dist/cmp/ReadmeIntro.js.map +1 -1
  4. package/dist/cmp/ReadmeTop.js +3 -7
  5. package/dist/cmp/ReadmeTop.js.map +1 -1
  6. package/dist/helpers/alongside.d.ts +3 -0
  7. package/dist/helpers/alongside.js +38 -0
  8. package/dist/helpers/alongside.js.map +1 -0
  9. package/dist/helpers/opShape.d.ts +2 -1
  10. package/dist/helpers/opShape.js +17 -0
  11. package/dist/helpers/opShape.js.map +1 -1
  12. package/dist/sdkgen.d.ts +3 -2
  13. package/dist/sdkgen.js +7 -4
  14. package/dist/sdkgen.js.map +1 -1
  15. package/dist/tsconfig.tsbuildinfo +1 -1
  16. package/package.json +1 -1
  17. package/project/.sdk/src/cmp/c/ReadmeIntro_c.ts +5 -27
  18. package/project/.sdk/src/cmp/clojure/ReadmeIntro_clojure.ts +5 -27
  19. package/project/.sdk/src/cmp/cpp/ReadmeIntro_cpp.ts +5 -27
  20. package/project/.sdk/src/cmp/csharp/ReadmeIntro_csharp.ts +5 -27
  21. package/project/.sdk/src/cmp/elixir/ReadmeIntro_elixir.ts +5 -27
  22. package/project/.sdk/src/cmp/go/ReadmeIntro_go.ts +7 -37
  23. package/project/.sdk/src/cmp/java/ReadmeIntro_java.ts +5 -27
  24. package/project/.sdk/src/cmp/js/ReadmeIntro_js.ts +5 -27
  25. package/project/.sdk/src/cmp/kotlin/ReadmeIntro_kotlin.ts +5 -27
  26. package/project/.sdk/src/cmp/lua/ReadmeIntro_lua.ts +5 -27
  27. package/project/.sdk/src/cmp/ocaml/ReadmeIntro_ocaml.ts +5 -27
  28. package/project/.sdk/src/cmp/perl/ReadmeIntro_perl.ts +5 -27
  29. package/project/.sdk/src/cmp/php/ReadmeIntro_php.ts +6 -28
  30. package/project/.sdk/src/cmp/py/ReadmeIntro_py.ts +5 -27
  31. package/project/.sdk/src/cmp/rb/ReadmeIntro_rb.ts +6 -28
  32. package/project/.sdk/src/cmp/rust/ReadmeIntro_rust.ts +5 -27
  33. package/project/.sdk/src/cmp/scala/ReadmeIntro_scala.ts +5 -27
  34. package/project/.sdk/src/cmp/swift/ReadmeIntro_swift.ts +5 -27
  35. package/project/.sdk/src/cmp/ts/ReadmeIntro_ts.ts +6 -36
  36. package/project/.sdk/src/cmp/zig/ReadmeIntro_zig.ts +5 -27
  37. package/project/.sdk/tm/c/tests/feature_harness.h +19 -0
  38. package/project/.sdk/tm/c/tests/feature_test.c +2 -2
  39. package/project/.sdk/tm/c/tests/primary_utility_test.c +3 -3
  40. package/project/.sdk/tm/cpp/test/primary_utility_test.cpp +20 -3
  41. package/project/.sdk/tm/perl/t/primary_utility.t +2 -1
  42. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +8 -1
  43. package/project/sdkgen-package.json +1 -1
  44. package/src/cmp/ReadmeIntro.ts +22 -8
  45. package/src/cmp/ReadmeTop.ts +1 -8
  46. package/src/helpers/alongside.ts +46 -0
  47. package/src/helpers/opShape.ts +17 -0
  48. package/src/sdkgen.ts +4 -1
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, modelText } from '@voxgig/sdkgen'
2
+ import { cmp, Content, introOps } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -9,16 +9,10 @@ import {
9
9
  import { cIdent, cVarName } from './utility_c'
10
10
 
11
11
 
12
- const ReadmeIntro = cmp(function ReadmeIntro(props: any) {
12
+ const ReadmeIntroBody = cmp(function ReadmeIntroBody(props: any) {
13
13
  const { target, ctx$: { model } } = props
14
- const info = modelText(model)
15
- const tagline = info.tagline || ''
16
14
 
17
- Content(`# ${model.Name} ${target.title} SDK
18
-
19
- ${tagline}
20
-
21
- The ${target.title} SDK for the ${model.Name} API — an entity-oriented client following idiomatic C conventions (explicit structs, function-pointer vtables, and a trailing \`PNError**\` out-param for errors).
15
+ Content(`The ${target.title} SDK for the ${model.Name} API — an entity-oriented client following idiomatic C conventions (explicit structs, function-pointer vtables, and a trailing \`PNError**\` out-param for errors).
22
16
 
23
17
  `)
24
18
 
@@ -34,20 +28,7 @@ The ${target.title} SDK for the ${model.Name} API — an entity-oriented client
34
28
  ? `for example \`${ident}_${cVarName(exampleEntity.name)}(client, NULL)\` — each`
35
29
  : 'each'
36
30
 
37
- // Model-driven op list — only the operations the active entities actually
38
- // expose (a read-only entity has just list+load); never claim
39
- // create/update/remove exist when no entity has them.
40
- const CANON_OPS = ['list', 'load', 'create', 'update', 'patch', 'remove']
41
- const opSet = new Set<string>()
42
- Object.values(entity || {}).forEach((e: any) => {
43
- if (!e || e.active === false) return
44
- Object.keys(e.op || {}).forEach((o: string) => {
45
- if (e.op[o] && e.op[o].active !== false) opSet.add(o)
46
- })
47
- })
48
- const opNames = CANON_OPS.filter((o) => opSet.has(o))
49
- .concat([...opSet].filter((o) => !CANON_OPS.includes(o)))
50
- const opList = (opNames.length ? opNames : ['list', 'load'])
31
+ const opList = introOps(model)
51
32
  .map((o) => '`' + o + '`').join(', ')
52
33
 
53
34
  Content(`The SDK exposes the API as capitalised, semantic **Entities** — ${example}
@@ -55,13 +36,10 @@ carrying a small, uniform set of operations (${opList}) instead of raw URL
55
36
  paths and query strings. You work with named resources and verbs, which
56
37
  keeps the cognitive load low.
57
38
 
58
- > Other languages, the CLI, and MCP server live alongside this one — see
59
- > the [top-level README](../README.md).
60
-
61
39
  `)
62
40
  })
63
41
 
64
42
 
65
43
  export {
66
- ReadmeIntro
44
+ ReadmeIntroBody
67
45
  }
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, modelText } from '@voxgig/sdkgen'
2
+ import { cmp, Content, introOps } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -7,16 +7,10 @@ import {
7
7
  } from '@voxgig/apidef'
8
8
 
9
9
 
10
- const ReadmeIntro = cmp(function ReadmeIntro(props: any) {
10
+ const ReadmeIntroBody = cmp(function ReadmeIntroBody(props: any) {
11
11
  const { target, ctx$: { model } } = props
12
- const info = modelText(model)
13
- const tagline = info.tagline || ''
14
12
 
15
- Content(`# ${model.Name} ${target.title} SDK
16
-
17
- ${tagline}
18
-
19
- The ${target.title} SDK for the ${model.Name} API — an entity-oriented client
13
+ Content(`The ${target.title} SDK for the ${model.Name} API — an entity-oriented client
20
14
  following idiomatic Clojure conventions (plain functions, immutable data, and
21
15
  the vendored \`voxgig.struct\` value model).
22
16
 
@@ -33,20 +27,7 @@ the vendored \`voxgig.struct\` value model).
33
27
  ? `for example \`(api/${exampleEntity.name} client nil)\` — each`
34
28
  : 'each'
35
29
 
36
- // Model-driven op list — only the operations the active entities actually
37
- // expose (a read-only entity has just list+load); never claim
38
- // create/update/remove exist when no entity has them.
39
- const CANON_OPS = ['list', 'load', 'create', 'update', 'patch', 'remove']
40
- const opSet = new Set<string>()
41
- Object.values(entity || {}).forEach((e: any) => {
42
- if (!e || e.active === false) return
43
- Object.keys(e.op || {}).forEach((o: string) => {
44
- if (e.op[o] && e.op[o].active !== false) opSet.add(o)
45
- })
46
- })
47
- const opNames = CANON_OPS.filter((o) => opSet.has(o))
48
- .concat([...opSet].filter((o) => !CANON_OPS.includes(o)))
49
- const opList = (opNames.length ? opNames : ['list', 'load'])
30
+ const opList = introOps(model)
50
31
  .map((o) => '`' + o + '`').join(', ')
51
32
 
52
33
  Content(`The SDK exposes the API as capitalised, semantic **Entities** — ${example}
@@ -54,13 +35,10 @@ carrying a small, uniform set of operations (${opList}) instead of raw URL
54
35
  paths and query strings. You work with named resources and verbs, which
55
36
  keeps the cognitive load low.
56
37
 
57
- > Other languages, the CLI, and MCP server live alongside this one — see
58
- > the [top-level README](../README.md).
59
-
60
38
  `)
61
39
  })
62
40
 
63
41
 
64
42
  export {
65
- ReadmeIntro
43
+ ReadmeIntroBody
66
44
  }
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, modelText } from '@voxgig/sdkgen'
2
+ import { cmp, Content, introOps } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -9,16 +9,10 @@ import {
9
9
  import { cppVarName } from './utility_cpp'
10
10
 
11
11
 
12
- const ReadmeIntro = cmp(function ReadmeIntro(props: any) {
12
+ const ReadmeIntroBody = cmp(function ReadmeIntroBody(props: any) {
13
13
  const { target, ctx$: { model } } = props
14
- const info = modelText(model)
15
- const tagline = info.tagline || ''
16
14
 
17
- Content(`# ${model.Name} ${target.title} SDK
18
-
19
- ${tagline}
20
-
21
- The ${target.title} SDK for the ${model.Name} API — a header-only,
15
+ Content(`The ${target.title} SDK for the ${model.Name} API — a header-only,
22
16
  entity-oriented client following idiomatic modern C++ (C++17) conventions.
23
17
 
24
18
  `)
@@ -34,20 +28,7 @@ entity-oriented client following idiomatic modern C++ (C++17) conventions.
34
28
  ? `for example \`client->${cppVarName(exampleEntity.name)}()\` — each`
35
29
  : 'each'
36
30
 
37
- // Model-driven op list — only the operations the active entities actually
38
- // expose (a read-only entity has just list+load); never claim
39
- // create/update/remove exist when no entity has them.
40
- const CANON_OPS = ['list', 'load', 'create', 'update', 'patch', 'remove']
41
- const opSet = new Set<string>()
42
- Object.values(entity || {}).forEach((e: any) => {
43
- if (!e || e.active === false) return
44
- Object.keys(e.op || {}).forEach((o: string) => {
45
- if (e.op[o] && e.op[o].active !== false) opSet.add(o)
46
- })
47
- })
48
- const opNames = CANON_OPS.filter((o) => opSet.has(o))
49
- .concat([...opSet].filter((o) => !CANON_OPS.includes(o)))
50
- const opList = (opNames.length ? opNames : ['list', 'load'])
31
+ const opList = introOps(model)
51
32
  .map((o) => '`' + o + '`').join(', ')
52
33
 
53
34
  Content(`The SDK exposes the API as capitalised, semantic **Entities** — ${example}
@@ -57,13 +38,10 @@ keeps the cognitive load low. Every value flows through a single dynamic
57
38
  \`sdk::Value\` type (a JSON-like variant), so there is no schema-driven code to
58
39
  regenerate when the API changes.
59
40
 
60
- > Other languages, the CLI, and MCP server live alongside this one — see
61
- > the [top-level README](../README.md).
62
-
63
41
  `)
64
42
  })
65
43
 
66
44
 
67
45
  export {
68
- ReadmeIntro
46
+ ReadmeIntroBody
69
47
  }
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, modelText } from '@voxgig/sdkgen'
2
+ import { cmp, Content, introOps } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -8,16 +8,10 @@ import {
8
8
  } from '@voxgig/apidef'
9
9
 
10
10
 
11
- const ReadmeIntro = cmp(function ReadmeIntro(props: any) {
11
+ const ReadmeIntroBody = cmp(function ReadmeIntroBody(props: any) {
12
12
  const { target, ctx$: { model } } = props
13
- const info = modelText(model)
14
- const tagline = info.tagline || ''
15
13
 
16
- Content(`# ${model.Name} ${target.title} SDK
17
-
18
- ${tagline}
19
-
20
- The ${target.title} SDK for the ${model.Name} API — an entity-oriented client following idiomatic C# conventions.
14
+ Content(`The ${target.title} SDK for the ${model.Name} API — an entity-oriented client following idiomatic C# conventions.
21
15
 
22
16
  `)
23
17
 
@@ -32,20 +26,7 @@ The ${target.title} SDK for the ${model.Name} API — an entity-oriented client
32
26
  ? `for example \`client.${nom(exampleEntity, 'Name')}()\` — each`
33
27
  : 'each'
34
28
 
35
- // Model-driven op list — only the operations the active entities actually
36
- // expose (a read-only entity has just list+load); never claim
37
- // create/update/remove exist when no entity has them.
38
- const CANON_OPS = ['list', 'load', 'create', 'update', 'patch', 'remove']
39
- const opSet = new Set<string>()
40
- Object.values(entity || {}).forEach((e: any) => {
41
- if (!e || e.active === false) return
42
- Object.keys(e.op || {}).forEach((o: string) => {
43
- if (e.op[o] && e.op[o].active !== false) opSet.add(o)
44
- })
45
- })
46
- const opNames = CANON_OPS.filter((o) => opSet.has(o))
47
- .concat([...opSet].filter((o) => !CANON_OPS.includes(o)))
48
- const opList = (opNames.length ? opNames : ['list', 'load'])
29
+ const opList = introOps(model)
49
30
  .map((o) => '`' + o + '`').join(', ')
50
31
 
51
32
  Content(`The SDK exposes the API as capitalised, semantic **Entities** — ${example}
@@ -53,13 +34,10 @@ carrying a small, uniform set of operations (${opList}) instead of raw URL
53
34
  paths and query strings. You work with named resources and verbs, which
54
35
  keeps the cognitive load low.
55
36
 
56
- > Other languages, the CLI, and MCP server live alongside this one — see
57
- > the [top-level README](../README.md).
58
-
59
37
  `)
60
38
  })
61
39
 
62
40
 
63
41
  export {
64
- ReadmeIntro
42
+ ReadmeIntroBody
65
43
  }
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, elixirAccessor, entityCollection, modelText } from '@voxgig/sdkgen'
2
+ import { cmp, Content, elixirAccessor, entityCollection, introOps } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -8,16 +8,10 @@ import {
8
8
  } from '@voxgig/apidef'
9
9
 
10
10
 
11
- const ReadmeIntro = cmp(function ReadmeIntro(props: any) {
11
+ const ReadmeIntroBody = cmp(function ReadmeIntroBody(props: any) {
12
12
  const { target, ctx$: { model } } = props
13
- const info = modelText(model)
14
- const tagline = info.tagline || ''
15
13
 
16
- Content(`# ${model.Name} ${target.title} SDK
17
-
18
- ${tagline}
19
-
20
- The ${target.title} SDK for the ${model.Name} API — an entity-oriented client
14
+ Content(`The ${target.title} SDK for the ${model.Name} API — an entity-oriented client
21
15
  following idiomatic, functional Elixir conventions.
22
16
 
23
17
  `)
@@ -33,20 +27,7 @@ following idiomatic, functional Elixir conventions.
33
27
  ? `for example \`${model.const.Name}.${elixirAccessor(exampleEntity, entityCollection(model))}(sdk)\` — each`
34
28
  : 'each'
35
29
 
36
- // Model-driven op list — only the operations the active entities actually
37
- // expose (a read-only entity has just list+load); never claim
38
- // create/update/remove exist when no entity has them.
39
- const CANON_OPS = ['list', 'load', 'create', 'update', 'patch', 'remove']
40
- const opSet = new Set<string>()
41
- Object.values(entity || {}).forEach((e: any) => {
42
- if (!e || e.active === false) return
43
- Object.keys(e.op || {}).forEach((o: string) => {
44
- if (e.op[o] && e.op[o].active !== false) opSet.add(o)
45
- })
46
- })
47
- const opNames = CANON_OPS.filter((o) => opSet.has(o))
48
- .concat([...opSet].filter((o) => !CANON_OPS.includes(o)))
49
- const opList = (opNames.length ? opNames : ['list', 'load'])
30
+ const opList = introOps(model)
50
31
  .map((o) => '`' + o + '`').join(', ')
51
32
 
52
33
  Content(`The SDK exposes the API as capitalised, semantic **Entities** — ${example}
@@ -54,13 +35,10 @@ carrying a small, uniform set of operations (${opList}) instead of raw URL
54
35
  paths and query strings. You work with named resources and verbs, which
55
36
  keeps the cognitive load low.
56
37
 
57
- > Other languages, the CLI, and MCP server live alongside this one — see
58
- > the [top-level README](../README.md).
59
-
60
38
  `)
61
39
  })
62
40
 
63
41
 
64
42
  export {
65
- ReadmeIntro
43
+ ReadmeIntroBody
66
44
  }
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, modelText } from '@voxgig/sdkgen'
2
+ import { cmp, Content, introOps } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -8,10 +8,8 @@ import {
8
8
  } from '@voxgig/apidef'
9
9
 
10
10
 
11
- const ReadmeIntro = cmp(function ReadmeIntro(props: any) {
11
+ const ReadmeIntroBody = cmp(function ReadmeIntroBody(props: any) {
12
12
  const { target, ctx$: { model } } = props
13
- const info = modelText(model)
14
- const tagline = info.tagline || ''
15
13
 
16
14
  // Derive a real entity accessor from the model for the semantic-entity
17
15
  // note (fall back to a generic name if the model has no entities).
@@ -19,47 +17,19 @@ const ReadmeIntro = cmp(function ReadmeIntro(props: any) {
19
17
  const exampleEntity = Object.values(entity).find((e: any) => e && e.active !== false) as any
20
18
  const eName = exampleEntity ? nom(exampleEntity, 'Name') : 'Entity'
21
19
 
22
- // Model-driven op list — only the operations the active entities actually
23
- // expose (a read-only entity has just List+Load); never claim
24
- // Create/Update/Remove exist when no entity has them. Go method names are
25
- // capitalised, so present the ops that way.
26
- const CANON_OPS = ['list', 'load', 'create', 'update', 'patch', 'remove']
20
+ // Go method names are capitalised.
27
21
  const cap = (o: string) => o.charAt(0).toUpperCase() + o.slice(1)
28
- const opSet = new Set<string>()
29
- Object.values(entity || {}).forEach((e: any) => {
30
- if (!e || e.active === false) return
31
- Object.keys(e.op || {}).forEach((o: string) => {
32
- if (e.op[o] && e.op[o].active !== false) opSet.add(o)
33
- })
34
- })
35
- const opNames = CANON_OPS.filter((o) => opSet.has(o))
36
- .concat([...opSet].filter((o) => !CANON_OPS.includes(o)))
37
- const opList = (opNames.length ? opNames : ['list', 'load'])
22
+ const opList = introOps(model)
38
23
  .map((o) => '`' + cap(o) + '`').join(', ')
39
24
 
40
- const targets = getModelPath(model, `main.${KIT}.target`) || {}
41
- const siblings = Object.entries(targets)
42
- .filter(([name, t]: any) => name !== target.name && false !== t.active)
43
- .map(([name]: any) => name)
44
- .sort()
45
-
46
- const siblingNote = 0 === siblings.length ? '' : `
47
- > Also generated from this model: ${siblings.map((s: string) => '`' + s + '`').join(', ')} — see
48
- > the [top-level README](../README.md).
49
- `
50
-
51
- Content(`# ${model.Name} ${target.title} SDK
52
-
53
- ${tagline}
54
-
55
- The ${target.title} SDK for the ${model.Name} API — an entity-oriented client using standard Go conventions. No generics required; data flows as \`map[string]any\`.
25
+ Content(`The ${target.title} SDK for the ${model.Name} API — an entity-oriented client using standard Go conventions. No generics required; data flows as \`map[string]any\`.
56
26
 
57
27
  It exposes the API as capitalised, semantic **Entities** — e.g. \`client.${eName}(nil)\` — each with the same small set of operations (${opList}) instead of raw URL paths and query strings. You call meaning, not endpoints, which keeps the cognitive load low.
58
- ${siblingNote}
28
+
59
29
  `)
60
30
  })
61
31
 
62
32
 
63
33
  export {
64
- ReadmeIntro
34
+ ReadmeIntroBody
65
35
  }
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, modelText } from '@voxgig/sdkgen'
2
+ import { cmp, Content, introOps } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -9,16 +9,10 @@ import {
9
9
  import { javaVarName } from './utility_java'
10
10
 
11
11
 
12
- const ReadmeIntro = cmp(function ReadmeIntro(props: any) {
12
+ const ReadmeIntroBody = cmp(function ReadmeIntroBody(props: any) {
13
13
  const { target, ctx$: { model } } = props
14
- const info = modelText(model)
15
- const tagline = info.tagline || ''
16
14
 
17
- Content(`# ${model.Name} ${target.title} SDK
18
-
19
- ${tagline}
20
-
21
- The ${target.title} SDK for the ${model.Name} API — an entity-oriented client following idiomatic Java conventions.
15
+ Content(`The ${target.title} SDK for the ${model.Name} API — an entity-oriented client following idiomatic Java conventions.
22
16
 
23
17
  `)
24
18
 
@@ -33,20 +27,7 @@ The ${target.title} SDK for the ${model.Name} API — an entity-oriented client
33
27
  ? `for example \`client.${javaVarName(exampleEntity.name)}(null)\` — each`
34
28
  : 'each'
35
29
 
36
- // Model-driven op list — only the operations the active entities actually
37
- // expose (a read-only entity has just list+load); never claim
38
- // create/update/remove exist when no entity has them.
39
- const CANON_OPS = ['list', 'load', 'create', 'update', 'patch', 'remove']
40
- const opSet = new Set<string>()
41
- Object.values(entity || {}).forEach((e: any) => {
42
- if (!e || e.active === false) return
43
- Object.keys(e.op || {}).forEach((o: string) => {
44
- if (e.op[o] && e.op[o].active !== false) opSet.add(o)
45
- })
46
- })
47
- const opNames = CANON_OPS.filter((o) => opSet.has(o))
48
- .concat([...opSet].filter((o) => !CANON_OPS.includes(o)))
49
- const opList = (opNames.length ? opNames : ['list', 'load'])
30
+ const opList = introOps(model)
50
31
  .map((o) => '`' + o + '`').join(', ')
51
32
 
52
33
  Content(`The SDK exposes the API as capitalised, semantic **Entities** — ${example}
@@ -54,13 +35,10 @@ carrying a small, uniform set of operations (${opList}) instead of raw URL
54
35
  paths and query strings. You work with named resources and verbs, which
55
36
  keeps the cognitive load low.
56
37
 
57
- > Other languages, the CLI, and MCP server live alongside this one — see
58
- > the [top-level README](../README.md).
59
-
60
38
  `)
61
39
  })
62
40
 
63
41
 
64
42
  export {
65
- ReadmeIntro
43
+ ReadmeIntroBody
66
44
  }
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, modelText } from '@voxgig/sdkgen'
2
+ import { cmp, Content, introOps } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -8,49 +8,27 @@ import {
8
8
  } from '@voxgig/apidef'
9
9
 
10
10
 
11
- const ReadmeIntro = cmp(function ReadmeIntro(props: any) {
11
+ const ReadmeIntroBody = cmp(function ReadmeIntroBody(props: any) {
12
12
  const { target, ctx$: { model } } = props
13
- const info = modelText(model)
14
- const tagline = info.tagline || ''
15
13
 
16
14
  const entity = getModelPath(model, `main.${KIT}.entity`)
17
15
  const exampleEntity = Object.values(entity).find((e: any) => e.active !== false) as any
18
16
  const eName = exampleEntity ? nom(exampleEntity, 'Name') : 'Entity'
19
17
 
20
- // Model-driven op list — only the operations the active entities actually
21
- // expose (a read-only entity has just list+load); never claim
22
- // create/update/remove exist when no entity has them.
23
- const CANON_OPS = ['list', 'load', 'create', 'update', 'patch', 'remove']
24
- const opSet = new Set<string>()
25
- Object.values(entity || {}).forEach((e: any) => {
26
- if (!e || e.active === false) return
27
- Object.keys(e.op || {}).forEach((o: string) => {
28
- if (e.op[o] && e.op[o].active !== false) opSet.add(o)
29
- })
30
- })
31
- const opNames = CANON_OPS.filter((o) => opSet.has(o))
32
- .concat([...opSet].filter((o) => !CANON_OPS.includes(o)))
33
- const opList = (opNames.length ? opNames : ['list', 'load'])
18
+ const opList = introOps(model)
34
19
  .map((o) => '`' + o + '`').join(', ')
35
20
 
36
- Content(`# ${model.Name} ${target.title} SDK
37
-
38
- ${tagline}
39
-
40
- The ${target.title} SDK for the ${model.Name} API — an entity-oriented client with full async/await support.
21
+ Content(`The ${target.title} SDK for the ${model.Name} API — an entity-oriented client with full async/await support.
41
22
 
42
23
  The API is exposed as capitalised, semantic **Entities** — e.g.
43
24
  \`client.${eName}()\` — each with a small set of operations (${opList})
44
25
  instead of raw URL paths and query parameters. This keeps the surface
45
26
  predictable and low-friction for both humans and AI agents.
46
27
 
47
- > Other languages, the CLI, and MCP server live alongside this one — see
48
- > the [top-level README](../README.md).
49
-
50
28
  `)
51
29
  })
52
30
 
53
31
 
54
32
  export {
55
- ReadmeIntro
33
+ ReadmeIntroBody
56
34
  }
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, modelText } from '@voxgig/sdkgen'
2
+ import { cmp, Content, introOps } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -9,16 +9,10 @@ import {
9
9
  import { kotlinVarName } from './utility_kotlin'
10
10
 
11
11
 
12
- const ReadmeIntro = cmp(function ReadmeIntro(props: any) {
12
+ const ReadmeIntroBody = cmp(function ReadmeIntroBody(props: any) {
13
13
  const { target, ctx$: { model } } = props
14
- const info = modelText(model)
15
- const tagline = info.tagline || ''
16
14
 
17
- Content(`# ${model.Name} ${target.title} SDK
18
-
19
- ${tagline}
20
-
21
- The ${target.title} SDK for the ${model.Name} API — an entity-oriented client following idiomatic Kotlin conventions.
15
+ Content(`The ${target.title} SDK for the ${model.Name} API — an entity-oriented client following idiomatic Kotlin conventions.
22
16
 
23
17
  `)
24
18
 
@@ -33,20 +27,7 @@ The ${target.title} SDK for the ${model.Name} API — an entity-oriented client
33
27
  ? `for example \`client.${kotlinVarName(exampleEntity.name)}(null)\` — each`
34
28
  : 'each'
35
29
 
36
- // Model-driven op list — only the operations the active entities actually
37
- // expose (a read-only entity has just list+load); never claim
38
- // create/update/remove exist when no entity has them.
39
- const CANON_OPS = ['list', 'load', 'create', 'update', 'patch', 'remove']
40
- const opSet = new Set<string>()
41
- Object.values(entity || {}).forEach((e: any) => {
42
- if (!e || e.active === false) return
43
- Object.keys(e.op || {}).forEach((o: string) => {
44
- if (e.op[o] && e.op[o].active !== false) opSet.add(o)
45
- })
46
- })
47
- const opNames = CANON_OPS.filter((o) => opSet.has(o))
48
- .concat([...opSet].filter((o) => !CANON_OPS.includes(o)))
49
- const opList = (opNames.length ? opNames : ['list', 'load'])
30
+ const opList = introOps(model)
50
31
  .map((o) => '`' + o + '`').join(', ')
51
32
 
52
33
  Content(`The SDK exposes the API as capitalised, semantic **Entities** — ${example}
@@ -54,13 +35,10 @@ carrying a small, uniform set of operations (${opList}) instead of raw URL
54
35
  paths and query strings. You work with named resources and verbs, which
55
36
  keeps the cognitive load low.
56
37
 
57
- > Other languages, the CLI, and MCP server live alongside this one — see
58
- > the [top-level README](../README.md).
59
-
60
38
  `)
61
39
  })
62
40
 
63
41
 
64
42
  export {
65
- ReadmeIntro
43
+ ReadmeIntroBody
66
44
  }
@@ -1,5 +1,5 @@
1
1
 
2
- import { cmp, Content, modelText } from '@voxgig/sdkgen'
2
+ import { cmp, Content, introOps } from '@voxgig/sdkgen'
3
3
 
4
4
  import {
5
5
  KIT,
@@ -8,10 +8,8 @@ import {
8
8
  } from '@voxgig/apidef'
9
9
 
10
10
 
11
- const ReadmeIntro = cmp(function ReadmeIntro(props: any) {
11
+ const ReadmeIntroBody = cmp(function ReadmeIntroBody(props: any) {
12
12
  const { target, ctx$: { model } } = props
13
- const info = modelText(model)
14
- const tagline = info.tagline || ''
15
13
 
16
14
  // Derive a real entity accessor from the model for the semantic-entity
17
15
  // note (fall back to a generic name if the model has no entities).
@@ -19,37 +17,17 @@ const ReadmeIntro = cmp(function ReadmeIntro(props: any) {
19
17
  const exampleEntity = Object.values(entity).find((e: any) => e && e.active !== false) as any
20
18
  const eName = exampleEntity ? nom(exampleEntity, 'Name') : 'Entity'
21
19
 
22
- // Model-driven op list — only the operations the active entities actually
23
- // expose (a read-only entity has just list+load); never claim
24
- // create/update/remove exist when no entity has them.
25
- const CANON_OPS = ['list', 'load', 'create', 'update', 'patch', 'remove']
26
- const opSet = new Set<string>()
27
- Object.values(entity || {}).forEach((e: any) => {
28
- if (!e || e.active === false) return
29
- Object.keys(e.op || {}).forEach((o: string) => {
30
- if (e.op[o] && e.op[o].active !== false) opSet.add(o)
31
- })
32
- })
33
- const opNames = CANON_OPS.filter((o) => opSet.has(o))
34
- .concat([...opSet].filter((o) => !CANON_OPS.includes(o)))
35
- const opList = (opNames.length ? opNames : ['list', 'load'])
20
+ const opList = introOps(model)
36
21
  .map((o) => '`' + o + '`').join(', ')
37
22
 
38
- Content(`# ${model.Name} ${target.title} SDK
39
-
40
- ${tagline}
41
-
42
- The ${target.title} SDK for the ${model.Name} API — an entity-oriented client using Lua conventions.
23
+ Content(`The ${target.title} SDK for the ${model.Name} API — an entity-oriented client using Lua conventions.
43
24
 
44
25
  It exposes the API as capitalised, semantic **Entities** — e.g. \`client:${eName}()\` — each with the same small set of operations (${opList}) instead of raw URL paths and query strings. You call meaning, not endpoints, which keeps the cognitive load low.
45
26
 
46
- > Other languages, the CLI, and MCP server live alongside this one — see
47
- > the [top-level README](../README.md).
48
-
49
27
  `)
50
28
  })
51
29
 
52
30
 
53
31
  export {
54
- ReadmeIntro
32
+ ReadmeIntroBody
55
33
  }