@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.
- package/bin/voxgig-sdkgen +1 -1
- package/dist/cmp/ReadmeIntro.js +21 -6
- package/dist/cmp/ReadmeIntro.js.map +1 -1
- package/dist/cmp/ReadmeTop.js +3 -7
- package/dist/cmp/ReadmeTop.js.map +1 -1
- package/dist/helpers/alongside.d.ts +3 -0
- package/dist/helpers/alongside.js +38 -0
- package/dist/helpers/alongside.js.map +1 -0
- package/dist/helpers/opShape.d.ts +2 -1
- package/dist/helpers/opShape.js +17 -0
- package/dist/helpers/opShape.js.map +1 -1
- package/dist/sdkgen.d.ts +3 -2
- package/dist/sdkgen.js +7 -4
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/project/.sdk/src/cmp/c/ReadmeIntro_c.ts +5 -27
- package/project/.sdk/src/cmp/clojure/ReadmeIntro_clojure.ts +5 -27
- package/project/.sdk/src/cmp/cpp/ReadmeIntro_cpp.ts +5 -27
- package/project/.sdk/src/cmp/csharp/ReadmeIntro_csharp.ts +5 -27
- package/project/.sdk/src/cmp/elixir/ReadmeIntro_elixir.ts +5 -27
- package/project/.sdk/src/cmp/go/ReadmeIntro_go.ts +7 -37
- package/project/.sdk/src/cmp/java/ReadmeIntro_java.ts +5 -27
- package/project/.sdk/src/cmp/js/ReadmeIntro_js.ts +5 -27
- package/project/.sdk/src/cmp/kotlin/ReadmeIntro_kotlin.ts +5 -27
- package/project/.sdk/src/cmp/lua/ReadmeIntro_lua.ts +5 -27
- package/project/.sdk/src/cmp/ocaml/ReadmeIntro_ocaml.ts +5 -27
- package/project/.sdk/src/cmp/perl/ReadmeIntro_perl.ts +5 -27
- package/project/.sdk/src/cmp/php/ReadmeIntro_php.ts +6 -28
- package/project/.sdk/src/cmp/py/ReadmeIntro_py.ts +5 -27
- package/project/.sdk/src/cmp/rb/ReadmeIntro_rb.ts +6 -28
- package/project/.sdk/src/cmp/rust/ReadmeIntro_rust.ts +5 -27
- package/project/.sdk/src/cmp/scala/ReadmeIntro_scala.ts +5 -27
- package/project/.sdk/src/cmp/swift/ReadmeIntro_swift.ts +5 -27
- package/project/.sdk/src/cmp/ts/ReadmeIntro_ts.ts +6 -36
- package/project/.sdk/src/cmp/zig/ReadmeIntro_zig.ts +5 -27
- package/project/.sdk/tm/c/tests/feature_harness.h +19 -0
- package/project/.sdk/tm/c/tests/feature_test.c +2 -2
- package/project/.sdk/tm/c/tests/primary_utility_test.c +3 -3
- package/project/.sdk/tm/cpp/test/primary_utility_test.cpp +20 -3
- package/project/.sdk/tm/perl/t/primary_utility.t +2 -1
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +8 -1
- package/project/sdkgen-package.json +1 -1
- package/src/cmp/ReadmeIntro.ts +22 -8
- package/src/cmp/ReadmeTop.ts +1 -8
- package/src/helpers/alongside.ts +46 -0
- package/src/helpers/opShape.ts +17 -0
- package/src/sdkgen.ts +4 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content,
|
|
2
|
+
import { cmp, Content, introOps } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -9,16 +9,10 @@ import {
|
|
|
9
9
|
import { ocamlVarName } from './utility_ocaml'
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
const
|
|
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(
|
|
18
|
-
|
|
19
|
-
${tagline}
|
|
20
|
-
|
|
21
|
-
The ${target.title} SDK for the ${model.Name} API — an entity-oriented client
|
|
15
|
+
Content(`The ${target.title} SDK for the ${model.Name} API — an entity-oriented client
|
|
22
16
|
following idiomatic OCaml conventions (a dependency-free library that compiles
|
|
23
17
|
with the stock \`ocamlc\`).
|
|
24
18
|
|
|
@@ -35,20 +29,7 @@ with the stock \`ocamlc\`).
|
|
|
35
29
|
? `for example \`Sdk_client.${ocamlVarName(exampleEntity.name)} client Noval\` — each`
|
|
36
30
|
: 'each'
|
|
37
31
|
|
|
38
|
-
|
|
39
|
-
// expose (a read-only entity has just list+load); never claim
|
|
40
|
-
// create/update/remove exist when no entity has them.
|
|
41
|
-
const CANON_OPS = ['list', 'load', 'create', 'update', 'patch', 'remove']
|
|
42
|
-
const opSet = new Set<string>()
|
|
43
|
-
Object.values(entity || {}).forEach((e: any) => {
|
|
44
|
-
if (!e || e.active === false) return
|
|
45
|
-
Object.keys(e.op || {}).forEach((o: string) => {
|
|
46
|
-
if (e.op[o] && e.op[o].active !== false) opSet.add(o)
|
|
47
|
-
})
|
|
48
|
-
})
|
|
49
|
-
const opNames = CANON_OPS.filter((o) => opSet.has(o))
|
|
50
|
-
.concat([...opSet].filter((o) => !CANON_OPS.includes(o)))
|
|
51
|
-
const opList = (opNames.length ? opNames : ['list', 'load'])
|
|
32
|
+
const opList = introOps(model)
|
|
52
33
|
.map((o) => '`' + o + '`').join(', ')
|
|
53
34
|
|
|
54
35
|
Content(`The SDK exposes the API as capitalised, semantic **Entities** — ${example}
|
|
@@ -56,13 +37,10 @@ carrying a small, uniform set of operations (${opList}) instead of raw URL
|
|
|
56
37
|
paths and query strings. You work with named resources and verbs, which
|
|
57
38
|
keeps the cognitive load low.
|
|
58
39
|
|
|
59
|
-
> Other languages, the CLI, and MCP server live alongside this one — see
|
|
60
|
-
> the [top-level README](../README.md).
|
|
61
|
-
|
|
62
40
|
`)
|
|
63
41
|
})
|
|
64
42
|
|
|
65
43
|
|
|
66
44
|
export {
|
|
67
|
-
|
|
45
|
+
ReadmeIntroBody
|
|
68
46
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content,
|
|
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
|
|
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(
|
|
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 Perl conventions.
|
|
22
16
|
|
|
23
17
|
`)
|
|
@@ -33,20 +27,7 @@ following idiomatic Perl conventions.
|
|
|
33
27
|
? `for example \`$client->${nom(exampleEntity, 'Name')}\` — each`
|
|
34
28
|
: 'each'
|
|
35
29
|
|
|
36
|
-
|
|
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
|
-
|
|
43
|
+
ReadmeIntroBody
|
|
66
44
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, phpEntityAccessor,
|
|
2
|
+
import { cmp, Content, phpEntityAccessor, introOps } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -8,30 +8,15 @@ import {
|
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
const
|
|
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 representative entity (and its operations) from the model so the
|
|
17
15
|
// semantic-entity pitch names something real rather than a placeholder.
|
|
18
16
|
const entity = getModelPath(model, `main.${KIT}.entity`) || {}
|
|
19
17
|
const exampleEntity = Object.values(entity).find((e: any) => e && e.active !== false) as any
|
|
20
18
|
const eName = exampleEntity ? nom(exampleEntity, 'Name') : null
|
|
21
|
-
|
|
22
|
-
// actually expose (a read-only entity has just list+load), in canonical
|
|
23
|
-
// order; never claim create/update/remove exist when no entity has them.
|
|
24
|
-
const CANON_OPS = ['list', 'load', 'create', 'update', 'patch', 'remove']
|
|
25
|
-
const opSet = new Set<string>()
|
|
26
|
-
Object.values(entity || {}).forEach((e: any) => {
|
|
27
|
-
if (!e || e.active === false) return
|
|
28
|
-
Object.keys(e.op || {}).forEach((o: string) => {
|
|
29
|
-
if (e.op[o] && e.op[o].active !== false) opSet.add(o)
|
|
30
|
-
})
|
|
31
|
-
})
|
|
32
|
-
const opnames = CANON_OPS.filter((o) => opSet.has(o))
|
|
33
|
-
.concat([...opSet].filter((o) => !CANON_OPS.includes(o)))
|
|
34
|
-
const opList = (opnames.length > 0 ? opnames : ['list', 'load']).join('`/`')
|
|
19
|
+
const opList = introOps(model).join('`/`')
|
|
35
20
|
|
|
36
21
|
const semantic = eName
|
|
37
22
|
? `The SDK exposes the API as capitalised, semantic **Entities** — for example \`$client->${phpEntityAccessor(eName)}()\` — with named operations (\`${opList}\`) instead of raw URL paths and query strings. Working with resources and verbs keeps call sites self-describing and reduces cognitive load.
|
|
@@ -39,19 +24,12 @@ const ReadmeIntro = cmp(function ReadmeIntro(props: any) {
|
|
|
39
24
|
`
|
|
40
25
|
: ''
|
|
41
26
|
|
|
42
|
-
Content(
|
|
27
|
+
Content(`The ${target.title} SDK for the ${model.Name} API — an entity-oriented client using PHP conventions.
|
|
43
28
|
|
|
44
|
-
${
|
|
45
|
-
|
|
46
|
-
The ${target.title} SDK for the ${model.Name} API — an entity-oriented client using PHP conventions.
|
|
47
|
-
|
|
48
|
-
${semantic}> Other languages, the CLI, and MCP server live alongside this one — see
|
|
49
|
-
> the [top-level README](../README.md).
|
|
50
|
-
|
|
51
|
-
`)
|
|
29
|
+
${semantic}`)
|
|
52
30
|
})
|
|
53
31
|
|
|
54
32
|
|
|
55
33
|
export {
|
|
56
|
-
|
|
34
|
+
ReadmeIntroBody
|
|
57
35
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content,
|
|
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
|
|
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(
|
|
17
|
-
|
|
18
|
-
${tagline}
|
|
19
|
-
|
|
20
|
-
The ${target.title} SDK for the ${model.Name} API — an entity-oriented client following Pythonic conventions.
|
|
14
|
+
Content(`The ${target.title} SDK for the ${model.Name} API — an entity-oriented client following Pythonic 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
|
-
|
|
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
|
-
|
|
42
|
+
ReadmeIntroBody
|
|
65
43
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content,
|
|
2
|
+
import { cmp, Content, introOps } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -8,30 +8,15 @@ import {
|
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
const
|
|
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 representative entity (and its operations) from the model so the
|
|
17
15
|
// semantic-entity pitch names something real rather than a placeholder.
|
|
18
16
|
const entity = getModelPath(model, `main.${KIT}.entity`) || {}
|
|
19
17
|
const exampleEntity = Object.values(entity).find((e: any) => e && e.active !== false) as any
|
|
20
18
|
const eName = exampleEntity ? nom(exampleEntity, 'Name') : null
|
|
21
|
-
|
|
22
|
-
// actually expose (a read-only entity has just list+load), in canonical
|
|
23
|
-
// order; never claim create/update/remove exist when no entity has them.
|
|
24
|
-
const CANON_OPS = ['list', 'load', 'create', 'update', 'patch', 'remove']
|
|
25
|
-
const opSet = new Set<string>()
|
|
26
|
-
Object.values(entity || {}).forEach((e: any) => {
|
|
27
|
-
if (!e || e.active === false) return
|
|
28
|
-
Object.keys(e.op || {}).forEach((o: string) => {
|
|
29
|
-
if (e.op[o] && e.op[o].active !== false) opSet.add(o)
|
|
30
|
-
})
|
|
31
|
-
})
|
|
32
|
-
const opnames = CANON_OPS.filter((o) => opSet.has(o))
|
|
33
|
-
.concat([...opSet].filter((o) => !CANON_OPS.includes(o)))
|
|
34
|
-
const opList = (opnames.length > 0 ? opnames : ['list', 'load']).join('`/`')
|
|
19
|
+
const opList = introOps(model).join('`/`')
|
|
35
20
|
|
|
36
21
|
const semantic = eName
|
|
37
22
|
? `The SDK exposes the API as capitalised, semantic **Entities** — for example \`client.${eName}\` — with named operations (\`${opList}\`) instead of raw URL paths and query strings. Working with resources and verbs keeps call sites self-describing and reduces cognitive load.
|
|
@@ -39,19 +24,12 @@ const ReadmeIntro = cmp(function ReadmeIntro(props: any) {
|
|
|
39
24
|
`
|
|
40
25
|
: ''
|
|
41
26
|
|
|
42
|
-
Content(
|
|
27
|
+
Content(`The ${target.title} SDK for the ${model.Name} API — an entity-oriented client using idiomatic Ruby conventions.
|
|
43
28
|
|
|
44
|
-
${
|
|
45
|
-
|
|
46
|
-
The ${target.title} SDK for the ${model.Name} API — an entity-oriented client using idiomatic Ruby conventions.
|
|
47
|
-
|
|
48
|
-
${semantic}> Other languages, the CLI, and MCP server live alongside this one — see
|
|
49
|
-
> the [top-level README](../README.md).
|
|
50
|
-
|
|
51
|
-
`)
|
|
29
|
+
${semantic}`)
|
|
52
30
|
})
|
|
53
31
|
|
|
54
32
|
|
|
55
33
|
export {
|
|
56
|
-
|
|
34
|
+
ReadmeIntroBody
|
|
57
35
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content,
|
|
2
|
+
import { cmp, Content, introOps } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -9,16 +9,10 @@ import {
|
|
|
9
9
|
import { rustVarName, rustMethodName } from './utility_rust'
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
const
|
|
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(
|
|
18
|
-
|
|
19
|
-
${tagline}
|
|
20
|
-
|
|
21
|
-
The ${target.title} SDK for the ${model.Name} API — an entity-oriented client following idiomatic Rust conventions.
|
|
15
|
+
Content(`The ${target.title} SDK for the ${model.Name} API — an entity-oriented client following idiomatic Rust 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.${rustMethodName(exampleEntity.name)}(Value::Noval)\` — each`
|
|
34
28
|
: 'each'
|
|
35
29
|
|
|
36
|
-
|
|
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
|
-
|
|
43
|
+
ReadmeIntroBody
|
|
66
44
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content,
|
|
2
|
+
import { cmp, Content, introOps } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -9,16 +9,10 @@ import {
|
|
|
9
9
|
import { scalaVarName } from './utility_scala'
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
const
|
|
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(
|
|
18
|
-
|
|
19
|
-
${tagline}
|
|
20
|
-
|
|
21
|
-
The ${target.title} SDK for the ${model.Name} API — an entity-oriented client following idiomatic Scala conventions.
|
|
15
|
+
Content(`The ${target.title} SDK for the ${model.Name} API — an entity-oriented client following idiomatic Scala 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.${scalaVarName(exampleEntity.name)}(null)\` — each`
|
|
34
28
|
: 'each'
|
|
35
29
|
|
|
36
|
-
|
|
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
|
-
|
|
43
|
+
ReadmeIntroBody
|
|
66
44
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content,
|
|
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
|
|
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(
|
|
16
|
-
|
|
17
|
-
${tagline}
|
|
18
|
-
|
|
19
|
-
The ${target.title} SDK for the ${model.Name} API — an entity-oriented client following idiomatic Swift conventions.
|
|
13
|
+
Content(`The ${target.title} SDK for the ${model.Name} API — an entity-oriented client following idiomatic Swift conventions.
|
|
20
14
|
|
|
21
15
|
`)
|
|
22
16
|
|
|
@@ -31,20 +25,7 @@ The ${target.title} SDK for the ${model.Name} API — an entity-oriented client
|
|
|
31
25
|
? `for example \`client.${exampleEntity.Name}()\` — each`
|
|
32
26
|
: 'each'
|
|
33
27
|
|
|
34
|
-
|
|
35
|
-
// expose (a read-only entity has just list+load); never claim
|
|
36
|
-
// create/update/remove exist when no entity has them.
|
|
37
|
-
const CANON_OPS = ['list', 'load', 'create', 'update', 'patch', 'remove']
|
|
38
|
-
const opSet = new Set<string>()
|
|
39
|
-
Object.values(entity || {}).forEach((e: any) => {
|
|
40
|
-
if (!e || e.active === false) return
|
|
41
|
-
Object.keys(e.op || {}).forEach((o: string) => {
|
|
42
|
-
if (e.op[o] && e.op[o].active !== false) opSet.add(o)
|
|
43
|
-
})
|
|
44
|
-
})
|
|
45
|
-
const opNames = CANON_OPS.filter((o) => opSet.has(o))
|
|
46
|
-
.concat([...opSet].filter((o) => !CANON_OPS.includes(o)))
|
|
47
|
-
const opList = (opNames.length ? opNames : ['list', 'load'])
|
|
28
|
+
const opList = introOps(model)
|
|
48
29
|
.map((o) => '`' + o + '`').join(', ')
|
|
49
30
|
|
|
50
31
|
Content(`The SDK exposes the API as capitalised, semantic **Entities** — ${example}
|
|
@@ -52,13 +33,10 @@ carrying a small, uniform set of operations (${opList}) instead of raw URL
|
|
|
52
33
|
paths and query strings. You work with named resources and verbs, which
|
|
53
34
|
keeps the cognitive load low.
|
|
54
35
|
|
|
55
|
-
> Other languages, the CLI, and MCP server live alongside this one — see
|
|
56
|
-
> the [top-level README](../README.md).
|
|
57
|
-
|
|
58
36
|
`)
|
|
59
37
|
})
|
|
60
38
|
|
|
61
39
|
|
|
62
40
|
export {
|
|
63
|
-
|
|
41
|
+
ReadmeIntroBody
|
|
64
42
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content,
|
|
2
|
+
import { cmp, Content, introOps } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -8,57 +8,27 @@ import {
|
|
|
8
8
|
} from '@voxgig/apidef'
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
const
|
|
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
|
-
|
|
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
|
-
|
|
37
|
-
const siblings = Object.entries(targets)
|
|
38
|
-
.filter(([name, t]: any) => name !== target.name && false !== t.active)
|
|
39
|
-
.map(([name]: any) => name)
|
|
40
|
-
.sort()
|
|
41
|
-
|
|
42
|
-
const siblingNote = 0 === siblings.length ? '' : `
|
|
43
|
-
> Also generated from this model: ${siblings.map((s: string) => '`' + s + '`').join(', ')} — see
|
|
44
|
-
> the [top-level README](../README.md).
|
|
45
|
-
`
|
|
46
|
-
|
|
47
|
-
Content(`# ${model.Name} ${target.title} SDK
|
|
48
|
-
|
|
49
|
-
${tagline}
|
|
50
|
-
|
|
51
|
-
The ${target.title} SDK for the ${model.Name} API — a type-safe, entity-oriented client with full async/await support.
|
|
21
|
+
Content(`The ${target.title} SDK for the ${model.Name} API — a type-safe, entity-oriented client with full async/await support.
|
|
52
22
|
|
|
53
23
|
The API is exposed as capitalised, semantic **Entities** — e.g.
|
|
54
24
|
\`client.${eName}()\` — each with a small set of operations (${opList})
|
|
55
25
|
instead of raw URL paths and query parameters. This keeps the surface
|
|
56
26
|
predictable and low-friction for both humans and AI agents.
|
|
57
|
-
|
|
27
|
+
|
|
58
28
|
`)
|
|
59
29
|
})
|
|
60
30
|
|
|
61
31
|
|
|
62
32
|
export {
|
|
63
|
-
|
|
33
|
+
ReadmeIntroBody
|
|
64
34
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content,
|
|
2
|
+
import { cmp, Content, introOps } from '@voxgig/sdkgen'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
KIT,
|
|
@@ -9,16 +9,10 @@ import {
|
|
|
9
9
|
import { zigVarName } from './utility_zig'
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
const
|
|
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(
|
|
18
|
-
|
|
19
|
-
${tagline}
|
|
20
|
-
|
|
21
|
-
The ${target.title} SDK for the ${model.Name} API — an entity-oriented client following idiomatic Zig conventions.
|
|
15
|
+
Content(`The ${target.title} SDK for the ${model.Name} API — an entity-oriented client following idiomatic Zig 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.${zigVarName(exampleEntity.name)}(h.vnull())\` — each`
|
|
34
28
|
: 'each'
|
|
35
29
|
|
|
36
|
-
|
|
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
|
-
|
|
43
|
+
ReadmeIntroBody
|
|
66
44
|
}
|
|
@@ -21,6 +21,25 @@
|
|
|
21
21
|
|
|
22
22
|
#define FH __attribute__((unused)) static
|
|
23
23
|
|
|
24
|
+
// ---- environment ------------------------------------------------------------
|
|
25
|
+
|
|
26
|
+
// MinGW declares neither setenv nor unsetenv.
|
|
27
|
+
FH void fh_setenv(const char* key, const char* val) {
|
|
28
|
+
#ifdef _WIN32
|
|
29
|
+
_putenv_s(key, val);
|
|
30
|
+
#else
|
|
31
|
+
setenv(key, val, 1);
|
|
32
|
+
#endif
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
FH void fh_unsetenv(const char* key) {
|
|
36
|
+
#ifdef _WIN32
|
|
37
|
+
_putenv_s(key, "");
|
|
38
|
+
#else
|
|
39
|
+
unsetenv(key);
|
|
40
|
+
#endif
|
|
41
|
+
}
|
|
42
|
+
|
|
24
43
|
// ---- feature presence -------------------------------------------------------
|
|
25
44
|
|
|
26
45
|
FH bool fh_has_feature(const char* name) {
|