@voxgig/sdkgen 4.42.0 → 4.44.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/action/feature.js +16 -0
- package/dist/action/feature.js.map +1 -1
- package/dist/action/kind.js +3 -0
- package/dist/action/kind.js.map +1 -1
- package/dist/action/remove.js +4 -0
- package/dist/action/remove.js.map +1 -1
- package/dist/action/resolve.d.ts +1 -0
- package/dist/action/resolve.js +30 -0
- package/dist/action/resolve.js.map +1 -1
- package/dist/action/target.js +10 -4
- package/dist/action/target.js.map +1 -1
- package/dist/cmp/AgentGuideContent.js +12 -6
- package/dist/cmp/AgentGuideContent.js.map +1 -1
- package/dist/cmp/ReadmeIntro.js +21 -6
- package/dist/cmp/ReadmeIntro.js.map +1 -1
- package/dist/cmp/ReadmeTop.js +23 -9
- package/dist/cmp/ReadmeTop.js.map +1 -1
- 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 +2 -2
- package/dist/sdkgen.js +5 -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 +6 -25
- package/project/.sdk/src/cmp/clojure/ReadmeIntro_clojure.ts +6 -25
- package/project/.sdk/src/cmp/cpp/ReadmeIntro_cpp.ts +6 -25
- package/project/.sdk/src/cmp/csharp/ReadmeIntro_csharp.ts +6 -25
- package/project/.sdk/src/cmp/elixir/ReadmeIntro_elixir.ts +6 -25
- package/project/.sdk/src/cmp/go/ReadmeIntro_go.ts +7 -37
- package/project/.sdk/src/cmp/java/ReadmeIntro_java.ts +6 -25
- package/project/.sdk/src/cmp/js/ReadmeIntro_js.ts +6 -25
- package/project/.sdk/src/cmp/kotlin/ReadmeIntro_kotlin.ts +6 -25
- package/project/.sdk/src/cmp/lua/ReadmeIntro_lua.ts +6 -25
- package/project/.sdk/src/cmp/ocaml/ReadmeIntro_ocaml.ts +6 -25
- package/project/.sdk/src/cmp/perl/ReadmeIntro_perl.ts +6 -25
- package/project/.sdk/src/cmp/php/ReadmeIntro_php.ts +6 -25
- package/project/.sdk/src/cmp/py/ReadmeIntro_py.ts +6 -25
- package/project/.sdk/src/cmp/rb/ReadmeIntro_rb.ts +6 -25
- package/project/.sdk/src/cmp/rust/ReadmeIntro_rust.ts +6 -25
- package/project/.sdk/src/cmp/scala/ReadmeIntro_scala.ts +6 -25
- package/project/.sdk/src/cmp/swift/ReadmeIntro_swift.ts +6 -25
- package/project/.sdk/src/cmp/ts/ReadmeIntro_ts.ts +6 -36
- package/project/.sdk/src/cmp/zig/ReadmeIntro_zig.ts +6 -25
- package/project/sdkgen-package.json +1 -1
- package/src/action/feature.ts +20 -0
- package/src/action/kind.ts +4 -0
- package/src/action/remove.ts +4 -0
- package/src/action/resolve.ts +41 -0
- package/src/action/target.ts +11 -4
- package/src/cmp/AgentGuideContent.ts +12 -6
- package/src/cmp/ReadmeIntro.ts +22 -8
- package/src/cmp/ReadmeTop.ts +23 -9
- package/src/helpers/opShape.ts +17 -0
- package/src/sdkgen.ts +2 -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 { cIdent, cVarName } from './utility_c'
|
|
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 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
|
-
|
|
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,10 +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
|
-
|
|
39
|
+
`)
|
|
59
40
|
})
|
|
60
41
|
|
|
61
42
|
|
|
62
43
|
export {
|
|
63
|
-
|
|
44
|
+
ReadmeIntroBody
|
|
64
45
|
}
|
|
@@ -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
|
|
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
|
-
|
|
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,10 +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
|
-
|
|
38
|
+
`)
|
|
58
39
|
})
|
|
59
40
|
|
|
60
41
|
|
|
61
42
|
export {
|
|
62
|
-
|
|
43
|
+
ReadmeIntroBody
|
|
63
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 { cppVarName } from './utility_cpp'
|
|
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 — 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
|
-
|
|
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,10 +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
|
-
|
|
41
|
+
`)
|
|
61
42
|
})
|
|
62
43
|
|
|
63
44
|
|
|
64
45
|
export {
|
|
65
|
-
|
|
46
|
+
ReadmeIntroBody
|
|
66
47
|
}
|
|
@@ -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 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
|
-
|
|
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,10 +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
|
-
|
|
37
|
+
`)
|
|
57
38
|
})
|
|
58
39
|
|
|
59
40
|
|
|
60
41
|
export {
|
|
61
|
-
|
|
42
|
+
ReadmeIntroBody
|
|
62
43
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmp, Content, elixirAccessor, entityCollection,
|
|
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
|
|
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, 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
|
-
|
|
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,10 +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
|
-
|
|
38
|
+
`)
|
|
58
39
|
})
|
|
59
40
|
|
|
60
41
|
|
|
61
42
|
export {
|
|
62
|
-
|
|
43
|
+
ReadmeIntroBody
|
|
63
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,
|
|
@@ -8,10 +8,8 @@ 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 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
|
-
//
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
28
|
+
|
|
59
29
|
`)
|
|
60
30
|
})
|
|
61
31
|
|
|
62
32
|
|
|
63
33
|
export {
|
|
64
|
-
|
|
34
|
+
ReadmeIntroBody
|
|
65
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 { javaVarName } from './utility_java'
|
|
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 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
|
-
|
|
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,10 +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
|
-
|
|
38
|
+
`)
|
|
58
39
|
})
|
|
59
40
|
|
|
60
41
|
|
|
61
42
|
export {
|
|
62
|
-
|
|
43
|
+
ReadmeIntroBody
|
|
63
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,
|
|
@@ -8,46 +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
|
-
Content(
|
|
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
|
-
|
|
28
|
+
`)
|
|
48
29
|
})
|
|
49
30
|
|
|
50
31
|
|
|
51
32
|
export {
|
|
52
|
-
|
|
33
|
+
ReadmeIntroBody
|
|
53
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 { kotlinVarName } from './utility_kotlin'
|
|
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 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
|
-
|
|
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,10 +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
|
-
|
|
38
|
+
`)
|
|
58
39
|
})
|
|
59
40
|
|
|
60
41
|
|
|
61
42
|
export {
|
|
62
|
-
|
|
43
|
+
ReadmeIntroBody
|
|
63
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,
|
|
@@ -8,10 +8,8 @@ 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 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,34 +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
|
-
|
|
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(
|
|
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
|
-
|
|
27
|
+
`)
|
|
47
28
|
})
|
|
48
29
|
|
|
49
30
|
|
|
50
31
|
export {
|
|
51
|
-
|
|
32
|
+
ReadmeIntroBody
|
|
52
33
|
}
|
|
@@ -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,10 +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
|
-
|
|
40
|
+
`)
|
|
60
41
|
})
|
|
61
42
|
|
|
62
43
|
|
|
63
44
|
export {
|
|
64
|
-
|
|
45
|
+
ReadmeIntroBody
|
|
65
46
|
}
|