@voxgig/sdkgen 4.45.0 → 4.47.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/check.js +73 -4
- package/dist/action/check.js.map +1 -1
- package/dist/action/copies.js +1 -0
- package/dist/action/copies.js.map +1 -1
- package/dist/action/doctor.d.ts +26 -2
- package/dist/action/doctor.js +208 -11
- package/dist/action/doctor.js.map +1 -1
- package/dist/action/package.d.ts +1 -1
- package/dist/action/package.js +15 -16
- package/dist/action/package.js.map +1 -1
- package/dist/action/remove.js +16 -4
- package/dist/action/remove.js.map +1 -1
- package/dist/action/resolve.d.ts +1 -0
- package/dist/action/resolve.js +10 -4
- package/dist/action/resolve.js.map +1 -1
- package/dist/action/target.d.ts +2 -1
- package/dist/action/target.js +50 -11
- package/dist/action/target.js.map +1 -1
- package/dist/admin/status.d.ts +7 -1
- package/dist/admin/status.js +34 -5
- package/dist/admin/status.js.map +1 -1
- package/dist/cmp/AgentGuide.js +46 -23
- package/dist/cmp/AgentGuide.js.map +1 -1
- package/dist/cmp/AgentGuideContent.d.ts +9 -7
- package/dist/cmp/AgentGuideContent.js +73 -43
- package/dist/cmp/AgentGuideContent.js.map +1 -1
- package/dist/cmp/AgentGuideFeature.js +19 -9
- package/dist/cmp/AgentGuideFeature.js.map +1 -1
- package/dist/cmp/AgentGuideTop.js +95 -49
- package/dist/cmp/AgentGuideTop.js.map +1 -1
- package/dist/cmp/Changelog.js +45 -4
- package/dist/cmp/Changelog.js.map +1 -1
- package/dist/cmp/Deploy.js +73 -35
- package/dist/cmp/Deploy.js.map +1 -1
- package/dist/cmp/Entity.js +1 -1
- package/dist/cmp/Entity.js.map +1 -1
- package/dist/cmp/ExternalTarget.js +10 -5
- package/dist/cmp/ExternalTarget.js.map +1 -1
- package/dist/cmp/Feature.js +12 -5
- package/dist/cmp/Feature.js.map +1 -1
- package/dist/cmp/FeatureDocs.d.ts +6 -4
- package/dist/cmp/FeatureDocs.js +14 -39
- package/dist/cmp/FeatureDocs.js.map +1 -1
- package/dist/cmp/FeatureHook.d.ts +7 -1
- package/dist/cmp/FeatureHook.js +34 -1
- package/dist/cmp/FeatureHook.js.map +1 -1
- package/dist/cmp/Main.js +1 -1
- package/dist/cmp/Main.js.map +1 -1
- package/dist/cmp/PublishWorkflow.js +89 -55
- package/dist/cmp/PublishWorkflow.js.map +1 -1
- package/dist/cmp/ReadmeErrors.js +521 -18
- package/dist/cmp/ReadmeErrors.js.map +1 -1
- package/dist/cmp/ReadmeExplanation.js +280 -44
- package/dist/cmp/ReadmeExplanation.js.map +1 -1
- package/dist/cmp/ReadmeFeatures.js +16 -7
- package/dist/cmp/ReadmeFeatures.js.map +1 -1
- package/dist/cmp/ReadmeIntro.js +4 -3
- package/dist/cmp/ReadmeIntro.js.map +1 -1
- package/dist/cmp/ReadmeModel.js +2 -2
- package/dist/cmp/ReadmeModel.js.map +1 -1
- package/dist/cmp/ReadmeRefFeatures.js +34 -24
- package/dist/cmp/ReadmeRefFeatures.js.map +1 -1
- package/dist/cmp/ReadmeStation.js +12 -9
- package/dist/cmp/ReadmeStation.js.map +1 -1
- package/dist/cmp/ReadmeTop.js +479 -382
- package/dist/cmp/ReadmeTop.js.map +1 -1
- package/dist/cmp/ReadmeUnions.js +8 -2
- package/dist/cmp/ReadmeUnions.js.map +1 -1
- package/dist/cmp/Registered.js +1 -1
- package/dist/cmp/Registered.js.map +1 -1
- package/dist/cmp/Security.js +26 -5
- package/dist/cmp/Security.js.map +1 -1
- package/dist/cmp/Test.js +1 -1
- package/dist/cmp/Test.js.map +1 -1
- package/dist/helpers/alongside.d.ts +2 -3
- package/dist/helpers/alongside.js +16 -15
- package/dist/helpers/alongside.js.map +1 -1
- package/dist/helpers/applicability.d.ts +3 -1
- package/dist/helpers/applicability.js +40 -1
- package/dist/helpers/applicability.js.map +1 -1
- package/dist/helpers/component.js +9 -1
- package/dist/helpers/component.js.map +1 -1
- package/dist/helpers/copymerge.d.ts +3 -0
- package/dist/helpers/copymerge.js +43 -10
- package/dist/helpers/copymerge.js.map +1 -1
- package/dist/helpers/definitionPlan.js +0 -1
- package/dist/helpers/definitionPlan.js.map +1 -1
- package/dist/helpers/doccheck.d.ts +11 -0
- package/dist/helpers/doccheck.js +146 -0
- package/dist/helpers/doccheck.js.map +1 -0
- package/dist/helpers/doctext.d.ts +11 -0
- package/dist/helpers/doctext.js +85 -0
- package/dist/helpers/doctext.js.map +1 -0
- package/dist/helpers/exampleCall.d.ts +16 -0
- package/dist/helpers/exampleCall.js +334 -0
- package/dist/helpers/exampleCall.js.map +1 -0
- package/dist/helpers/exportnames.d.ts +4 -0
- package/dist/helpers/exportnames.js +35 -0
- package/dist/helpers/exportnames.js.map +1 -0
- package/dist/helpers/facts.d.ts +2 -1
- package/dist/helpers/facts.js +210 -5
- package/dist/helpers/facts.js.map +1 -1
- package/dist/helpers/flowGuard.d.ts +1 -1
- package/dist/helpers/flowGuard.js +20 -7
- package/dist/helpers/flowGuard.js.map +1 -1
- package/dist/helpers/generated.d.ts +1 -0
- package/dist/helpers/generated.js +1 -1
- package/dist/helpers/generated.js.map +1 -1
- package/dist/helpers/graphqlPoint.d.ts +2 -1
- package/dist/helpers/graphqlPoint.js +17 -0
- package/dist/helpers/graphqlPoint.js.map +1 -1
- package/dist/helpers/guardModel.d.ts +2 -0
- package/dist/helpers/guardModel.js +41 -0
- package/dist/helpers/guardModel.js.map +1 -0
- package/dist/helpers/manifest.d.ts +2 -1
- package/dist/helpers/manifest.js +16 -0
- package/dist/helpers/manifest.js.map +1 -1
- package/dist/helpers/mcpTools.d.ts +2 -1
- package/dist/helpers/mcpTools.js +8 -1
- package/dist/helpers/mcpTools.js.map +1 -1
- package/dist/helpers/modelcheck.d.ts +2 -1
- package/dist/helpers/modelcheck.js +13 -0
- package/dist/helpers/modelcheck.js.map +1 -1
- package/dist/helpers/opExample.d.ts +9 -2
- package/dist/helpers/opExample.js +22 -2
- package/dist/helpers/opExample.js.map +1 -1
- package/dist/helpers/opShape.d.ts +2 -1
- package/dist/helpers/opShape.js +29 -17
- package/dist/helpers/opShape.js.map +1 -1
- package/dist/helpers/packageMeta.d.ts +6 -4
- package/dist/helpers/packageMeta.js +88 -53
- package/dist/helpers/packageMeta.js.map +1 -1
- package/dist/helpers/placement.d.ts +15 -0
- package/dist/helpers/placement.js +76 -0
- package/dist/helpers/placement.js.map +1 -0
- package/dist/helpers/semver.d.ts +3 -1
- package/dist/helpers/semver.js +28 -0
- package/dist/helpers/semver.js.map +1 -1
- package/dist/helpers/serverVars.js +3 -2
- package/dist/helpers/serverVars.js.map +1 -1
- package/dist/helpers/shipped.d.ts +2 -1
- package/dist/helpers/shipped.js +12 -0
- package/dist/helpers/shipped.js.map +1 -1
- package/dist/helpers/sourcestring.d.ts +3 -0
- package/dist/helpers/sourcestring.js +43 -0
- package/dist/helpers/sourcestring.js.map +1 -0
- package/dist/helpers/stdrep.d.ts +1 -1
- package/dist/helpers/stdrep.js +5 -1
- package/dist/helpers/stdrep.js.map +1 -1
- package/dist/helpers/surface.d.ts +7 -0
- package/dist/helpers/surface.js +69 -0
- package/dist/helpers/surface.js.map +1 -0
- package/dist/helpers/targetguard.d.ts +13 -0
- package/dist/helpers/targetguard.js +65 -0
- package/dist/helpers/targetguard.js.map +1 -0
- package/dist/helpers/text.d.ts +3 -1
- package/dist/helpers/text.js +16 -0
- package/dist/helpers/text.js.map +1 -1
- package/dist/helpers/textguard.d.ts +31 -0
- package/dist/helpers/textguard.js +157 -0
- package/dist/helpers/textguard.js.map +1 -0
- package/dist/helpers/title.d.ts +4 -0
- package/dist/helpers/title.js +52 -0
- package/dist/helpers/title.js.map +1 -0
- package/dist/sdkgen.d.ts +4 -6
- package/dist/sdkgen.js +72 -63
- package/dist/sdkgen.js.map +1 -1
- package/dist/testkit.d.ts +7 -2
- package/dist/testkit.js +27 -20
- package/dist/testkit.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utility.js +2 -1
- package/dist/utility.js.map +1 -1
- package/model/fact.aontu +150 -0
- package/model/sdkgen.aontu +15 -3
- package/package.json +3 -1
- package/project/.sdk/src/cmp/c/ReadmeQuick_c.ts +2 -2
- package/project/.sdk/src/cmp/c/ReadmeTopQuick_c.ts +1 -1
- package/project/.sdk/src/cmp/clojure/ReadmeEntity_clojure.ts +12 -3
- package/project/.sdk/src/cmp/clojure/ReadmeQuick_clojure.ts +1 -1
- package/project/.sdk/src/cmp/cpp/ReadmeQuick_cpp.ts +1 -1
- package/project/.sdk/src/cmp/csharp/ReadmeQuick_csharp.ts +1 -1
- package/project/.sdk/src/cmp/elixir/ReadmeQuick_elixir.ts +1 -1
- package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +1 -1
- package/project/.sdk/src/cmp/java/ReadmeQuick_java.ts +1 -1
- package/project/.sdk/src/cmp/js/ReadmeQuick_js.ts +1 -1
- package/project/.sdk/src/cmp/kotlin/ReadmeQuick_kotlin.ts +1 -1
- package/project/.sdk/src/cmp/lua/ReadmeQuick_lua.ts +1 -1
- package/project/.sdk/src/cmp/ocaml/ReadmeQuick_ocaml.ts +1 -1
- package/project/.sdk/src/cmp/perl/ReadmeQuick_perl.ts +1 -1
- package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +1 -1
- package/project/.sdk/src/cmp/py/ReadmeQuick_py.ts +1 -1
- package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +1 -1
- package/project/.sdk/src/cmp/rust/ReadmeQuick_rust.ts +1 -1
- package/project/.sdk/src/cmp/scala/ReadmeQuick_scala.ts +1 -1
- package/project/.sdk/src/cmp/scala/ReadmeRef_scala.ts +4 -1
- package/project/.sdk/src/cmp/swift/ReadmeQuick_swift.ts +2 -1
- package/project/.sdk/src/cmp/swift/ReadmeRef_swift.ts +3 -0
- package/project/.sdk/src/cmp/swift/ReadmeTopQuick_swift.ts +2 -1
- package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +1 -1
- package/project/.sdk/src/cmp/ts/TestDefinition_ts.ts +3 -1
- package/project/.sdk/src/cmp/zig/ReadmeOptions_zig.ts +1 -1
- package/project/.sdk/src/cmp/zig/ReadmeQuick_zig.ts +3 -3
- package/project/.sdk/src/cmp/zig/ReadmeTopQuick_zig.ts +2 -2
- package/project/.sdk/tm/ocaml/test/feature/secrets/t_secrets.ml +3 -1
- package/project/.sdk/tm/php/test/feature/secrets/SecretsTest.php +2 -1
- package/project/.sdk/tm/zig/test/feature/secrets/secrets_test.zig +11 -2
- package/project/sdkgen-package.json +1 -1
- package/src/action/check.ts +99 -4
- package/src/action/copies.ts +2 -0
- package/src/action/doctor.ts +304 -15
- package/src/action/package.ts +11 -13
- package/src/action/remove.ts +20 -5
- package/src/action/resolve.ts +11 -4
- package/src/action/target.ts +66 -15
- package/src/admin/status.ts +25 -5
- package/src/cmp/AgentGuide.ts +52 -25
- package/src/cmp/AgentGuideContent.ts +75 -43
- package/src/cmp/AgentGuideFeature.ts +21 -10
- package/src/cmp/AgentGuideTop.ts +119 -49
- package/src/cmp/Changelog.ts +56 -5
- package/src/cmp/Deploy.ts +81 -40
- package/src/cmp/Entity.ts +1 -1
- package/src/cmp/ExternalTarget.ts +12 -6
- package/src/cmp/Feature.ts +13 -6
- package/src/cmp/FeatureDocs.ts +21 -40
- package/src/cmp/FeatureHook.ts +38 -1
- package/src/cmp/Main.ts +1 -1
- package/src/cmp/PublishWorkflow.ts +94 -60
- package/src/cmp/ReadmeErrors.ts +555 -25
- package/src/cmp/ReadmeExplanation.ts +316 -52
- package/src/cmp/ReadmeFeatures.ts +18 -8
- package/src/cmp/ReadmeIntro.ts +4 -3
- package/src/cmp/ReadmeModel.ts +2 -2
- package/src/cmp/ReadmeRefFeatures.ts +39 -27
- package/src/cmp/ReadmeStation.ts +13 -16
- package/src/cmp/ReadmeTop.ts +538 -397
- package/src/cmp/ReadmeUnions.ts +10 -2
- package/src/cmp/Registered.ts +1 -1
- package/src/cmp/Security.ts +35 -7
- package/src/cmp/Test.ts +1 -1
- package/src/helpers/alongside.ts +16 -19
- package/src/helpers/applicability.ts +44 -1
- package/src/helpers/component.ts +11 -1
- package/src/helpers/copymerge.ts +58 -10
- package/src/helpers/definitionPlan.ts +0 -1
- package/src/helpers/doccheck.ts +174 -0
- package/src/helpers/doctext.ts +115 -0
- package/src/helpers/exampleCall.ts +415 -0
- package/src/helpers/exportnames.ts +47 -0
- package/src/helpers/facts.ts +259 -5
- package/src/helpers/flowGuard.ts +22 -7
- package/src/helpers/generated.ts +3 -1
- package/src/helpers/graphqlPoint.ts +20 -1
- package/src/helpers/guardModel.ts +50 -0
- package/src/helpers/manifest.ts +19 -0
- package/src/helpers/mcpTools.ts +11 -1
- package/src/helpers/modelcheck.ts +16 -0
- package/src/helpers/opExample.ts +34 -2
- package/src/helpers/opShape.ts +29 -16
- package/src/helpers/packageMeta.ts +89 -52
- package/src/helpers/placement.ts +114 -0
- package/src/helpers/semver.ts +35 -0
- package/src/helpers/serverVars.ts +4 -2
- package/src/helpers/shipped.ts +13 -0
- package/src/helpers/sourcestring.ts +47 -0
- package/src/helpers/stdrep.ts +6 -1
- package/src/helpers/surface.ts +82 -0
- package/src/helpers/targetguard.ts +91 -0
- package/src/helpers/text.ts +22 -0
- package/src/helpers/textguard.ts +208 -0
- package/src/helpers/title.ts +59 -0
- package/src/sdkgen.ts +82 -78
- package/src/testkit.ts +42 -20
- package/src/utility.ts +2 -1
package/dist/cmp/ReadmeTop.js
CHANGED
|
@@ -7,13 +7,16 @@ const types_1 = require("../types");
|
|
|
7
7
|
const utility_1 = require("../utility");
|
|
8
8
|
const optional_1 = require("../helpers/optional");
|
|
9
9
|
const FeatureDocs_1 = require("./FeatureDocs");
|
|
10
|
+
const FeatureHook_1 = require("./FeatureHook");
|
|
10
11
|
const opShape_1 = require("../helpers/opShape");
|
|
11
12
|
const opExample_1 = require("../helpers/opExample");
|
|
12
13
|
const mcpTools_1 = require("../helpers/mcpTools");
|
|
13
14
|
const canonType_1 = require("../helpers/canonType");
|
|
14
15
|
const naming_1 = require("../helpers/naming");
|
|
15
16
|
const text_1 = require("../helpers/text");
|
|
16
|
-
const
|
|
17
|
+
const facts_1 = require("../helpers/facts");
|
|
18
|
+
const surface_1 = require("../helpers/surface");
|
|
19
|
+
const copymerge_1 = require("../helpers/copymerge");
|
|
17
20
|
const packageMeta_1 = require("../helpers/packageMeta");
|
|
18
21
|
const SDKGEN_REPO = 'https://github.com/voxgig/sdkgen';
|
|
19
22
|
const VOXGIG_SDK = 'https://voxgig.com/sdk/';
|
|
@@ -66,221 +69,173 @@ function entityExample(lang, Name, call) {
|
|
|
66
69
|
default: return '';
|
|
67
70
|
}
|
|
68
71
|
}
|
|
69
|
-
const
|
|
70
|
-
const {
|
|
71
|
-
|
|
72
|
-
if (model.name && !model.Name)
|
|
73
|
-
(0, jostraca_1.names)(model, model.name);
|
|
74
|
-
const info = (0, text_1.modelText)(model);
|
|
75
|
-
const def = (model.main && model.main.def) || {};
|
|
76
|
-
const productName = info.title || `${model.Name} API`;
|
|
77
|
-
const tagline = info.tagline
|
|
78
|
-
|| def.tagline
|
|
79
|
-
|| `${productName} client, generated from the OpenAPI spec.`;
|
|
80
|
-
const aboutMd = info.about_md || '';
|
|
81
|
-
const homepage = info.homepage || '';
|
|
82
|
-
const docsUrl = info.docs_url || '';
|
|
83
|
-
const entityDesc = info.entity_desc || {};
|
|
84
|
-
const apiSummary = (info.summary || '').trim();
|
|
85
|
-
const apiWebsite = (info.website || '').trim();
|
|
86
|
-
const websiteLine = apiWebsite
|
|
87
|
-
? `Learn more about ${productName} at ` +
|
|
88
|
-
`[${apiWebsite.replace(/^https?:\/\//, '').replace(/\/$/, '')}](${apiWebsite}).`
|
|
89
|
-
: '';
|
|
90
|
-
// Attribution for API metadata sourced from a third-party catalogue (e.g.
|
|
91
|
-
// freepublicapis.com). Rendered only when the model carries an
|
|
92
|
-
// `info.meta_source` URL, so first-party SDKs never show it. The link points
|
|
93
|
-
// back to the catalogue that kindly supplied the metadata.
|
|
94
|
-
const metaSource = (info.meta_source || '').trim();
|
|
95
|
-
const metaSourceLine = metaSource
|
|
96
|
-
? `Metadata kindly supplied by ` +
|
|
97
|
-
`[${metaSource.replace(/^https?:\/\//, '').replace(/\/$/, '')}](${metaSource}).`
|
|
98
|
-
: '';
|
|
99
|
-
const entity = (0, types_1.getModelPath)(model, `main.${types_1.KIT}.entity`);
|
|
100
|
-
const target = (0, types_1.getModelPath)(model, `main.${types_1.KIT}.target`);
|
|
101
|
-
const feature = (0, types_1.getModelPath)(model, `main.${types_1.KIT}.feature`);
|
|
102
|
-
(0, jostraca_1.each)(entity, (ent) => { if (!ent.Name)
|
|
103
|
-
(0, jostraca_1.names)(ent, ent.name); });
|
|
104
|
-
(0, jostraca_1.each)(feature, (feat) => { if (!feat.Name)
|
|
105
|
-
(0, jostraca_1.names)(feat, feat.name); });
|
|
106
|
-
const activeEntities = (0, jostraca_1.each)(entity).filter((e) => e.active !== false);
|
|
107
|
-
const activeTargets = (0, jostraca_1.each)(target).filter((t) => t.active !== false);
|
|
108
|
-
const hasCli = activeTargets.some((t) => t.name === 'go-cli');
|
|
109
|
-
const hasMcp = activeTargets.some((t) => t.name === 'go-mcp');
|
|
110
|
-
const docsOrder = (0, types_1.getModelPath)(model, `main.${types_1.KIT}.config.docs_order`, { only_active: false, required: false }) || [];
|
|
111
|
-
const orderOf = (name) => {
|
|
112
|
-
const i = docsOrder.indexOf(name);
|
|
113
|
-
if (i !== -1)
|
|
114
|
-
return i;
|
|
115
|
-
if (name === 'go-cli')
|
|
116
|
-
return docsOrder.length + 1;
|
|
117
|
-
if (name === 'go-mcp')
|
|
118
|
-
return docsOrder.length + 2;
|
|
119
|
-
return docsOrder.length;
|
|
120
|
-
};
|
|
121
|
-
const ordered = activeTargets
|
|
122
|
-
.slice()
|
|
123
|
-
.sort((a, b) => orderOf(a.name) - orderOf(b.name));
|
|
124
|
-
const isCliOrMcp = (t) => t.name === 'go-cli' || t.name === 'go-mcp';
|
|
125
|
-
const sdkTargets = ordered.filter((t) => !(0, alongside_1.isConsumer)(t));
|
|
126
|
-
// The CLI and the MCP server have surfaces of their own below.
|
|
127
|
-
const consumerTargets = ordered.filter((t) => (0, alongside_1.isConsumer)(t) && !isCliOrMcp(t));
|
|
128
|
-
const docTargets = ordered.filter((t) => !isCliOrMcp(t));
|
|
129
|
-
const pkgTargets = activeTargets
|
|
130
|
-
.filter((t) => (0, packageMeta_1.hasPackageName)(model, t.name))
|
|
131
|
-
.sort((a, b) => orderOf(a.name) - orderOf(b.name));
|
|
132
|
-
const langList = sdkTargets.map((t) => t.title).join(', ');
|
|
133
|
-
const leadTarget = pickLeadTarget(sdkTargets);
|
|
134
|
-
(0, jostraca_1.File)({ name: 'README.md' }, () => {
|
|
135
|
-
(0, jostraca_1.Content)(`# ${model.Name} SDK
|
|
72
|
+
const ReadmeTopTitle = (0, component_1.cmp)(function ReadmeTopTitle(props) {
|
|
73
|
+
const { model, tagline, apiSummary, websiteLine, metaSourceLine } = props.s;
|
|
74
|
+
(0, jostraca_1.Content)(`# ${model.Name} SDK
|
|
136
75
|
|
|
137
76
|
${tagline}
|
|
138
77
|
|
|
139
78
|
`);
|
|
140
|
-
|
|
141
|
-
|
|
79
|
+
if (apiSummary) {
|
|
80
|
+
(0, jostraca_1.Content)(`${apiSummary}
|
|
142
81
|
|
|
143
82
|
`);
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
83
|
+
}
|
|
84
|
+
if (websiteLine) {
|
|
85
|
+
(0, jostraca_1.Content)(`${websiteLine}
|
|
147
86
|
|
|
148
87
|
`);
|
|
149
|
-
|
|
150
|
-
|
|
88
|
+
}
|
|
89
|
+
(0, jostraca_1.Content)(`${(0, packageMeta_1.nonAffiliation)(model)}
|
|
151
90
|
|
|
152
91
|
`);
|
|
153
|
-
|
|
154
|
-
|
|
92
|
+
if ((0, packageMeta_1.isDefaultPublisher)(model)) {
|
|
93
|
+
(0, jostraca_1.Content)(`Learn more about Voxgig SDKs at [voxgig.com/sdk](${VOXGIG_SDK}).
|
|
155
94
|
|
|
156
95
|
`);
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
96
|
+
}
|
|
97
|
+
// THE GENERATED SITE, LINKED FROM THE TOP, because the repository was the
|
|
98
|
+
// one place it could not be found from. `docs_url` further down is the
|
|
99
|
+
// UPSTREAM API's documentation, not this, and a reader who lands on the
|
|
100
|
+
// repo rather than arriving from a link had no route to the site at all.
|
|
101
|
+
// Empty unless the project actually publishes one -- see docsSiteUrl.
|
|
102
|
+
const siteUrl = (0, packageMeta_1.docsSiteUrl)(model);
|
|
103
|
+
if (siteUrl) {
|
|
104
|
+
(0, jostraca_1.Content)(`Full documentation for this SDK: [${siteUrl}](${siteUrl})
|
|
166
105
|
|
|
167
106
|
`);
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
107
|
+
}
|
|
108
|
+
if (metaSourceLine) {
|
|
109
|
+
(0, jostraca_1.Content)(`${metaSourceLine}
|
|
171
110
|
|
|
172
111
|
`);
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
const ReadmeTopSurfaceLine = (0, component_1.cmp)(function ReadmeTopSurfaceLine(props) {
|
|
115
|
+
const { hasCli, hasMcp, sdkTargets, consumerTargets, langList, definition } = props.s;
|
|
116
|
+
if (sdkTargets.length > 1) {
|
|
117
|
+
const surfaces = [];
|
|
118
|
+
surfaces.push(`${langList} SDKs`);
|
|
119
|
+
if (hasCli)
|
|
120
|
+
surfaces.push('a CLI with an interactive REPL');
|
|
121
|
+
if (hasMcp)
|
|
122
|
+
surfaces.push('an MCP server for AI agents');
|
|
123
|
+
consumerTargets.forEach((t) => surfaces.push(`the ${(0, facts_1.fact)(t, 'title')} package`));
|
|
124
|
+
const surfaceList = surfaces.length > 1
|
|
125
|
+
? surfaces.slice(0, -1).join(', ') + ', and ' + surfaces[surfaces.length - 1]
|
|
126
|
+
: surfaces[0];
|
|
127
|
+
(0, jostraca_1.Content)(`> ${surfaceList} — all generated from one ${definition} by [@voxgig/sdkgen](${SDKGEN_REPO}).
|
|
186
128
|
|
|
187
129
|
`);
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
const ReadmeTopFeatureLine = (0, component_1.cmp)(function ReadmeTopFeatureLine(props) {
|
|
133
|
+
const { model } = props.s;
|
|
134
|
+
// FEATURES BELONG BESIDE THE TARGETS. What an SDK can do is as much a
|
|
135
|
+
// reason to choose it as which language it is in, and a reader who has to
|
|
136
|
+
// scroll past every language section to discover that retries, caching and
|
|
137
|
+
// tracing are built in has already decided it is a thin HTTP wrapper.
|
|
138
|
+
// Named here, in one line, with the detail left to each target's README.
|
|
139
|
+
const features = (0, FeatureDocs_1.featureDocs)(model);
|
|
140
|
+
if (0 < features.length) {
|
|
141
|
+
const on = features.filter((f) => f.on).map((f) => f.name);
|
|
142
|
+
const state = 0 === on.length ? `opt-in,
|
|
143
|
+
> inactive until switched on, and configured per client.` : `configured per client.
|
|
144
|
+
> ${(0, FeatureDocs_1.codeList)(on)} ${1 === on.length ? 'runs' : 'run'} by default${on.length < features.length ?
|
|
145
|
+
'; the rest are opt-in, inactive until switched on' : ''}.`;
|
|
146
|
+
(0, jostraca_1.Content)(`> **Features:** ${features.map((f) => '`' + f.name + '`').join(', ')} — ${state} See the Features
|
|
198
147
|
> section of any SDK README below for what each one does.
|
|
199
148
|
|
|
200
149
|
`);
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
const ReadmeTopAbout = (0, component_1.cmp)(function ReadmeTopAbout(props) {
|
|
153
|
+
const { text, productName, aboutMd } = props.s;
|
|
154
|
+
if (aboutMd) {
|
|
155
|
+
(0, jostraca_1.Content)(`## About ${productName}
|
|
204
156
|
|
|
205
|
-
${aboutMd
|
|
157
|
+
${aboutMd}
|
|
206
158
|
|
|
207
159
|
`);
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
160
|
+
}
|
|
161
|
+
else if (text.desc.text) {
|
|
162
|
+
(0, jostraca_1.Content)(`${text.desc.text}
|
|
211
163
|
|
|
212
164
|
`);
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
const ReadmeTopEntityModel = (0, component_1.cmp)(function ReadmeTopEntityModel(props) {
|
|
168
|
+
const { model, activeEntities, sdkTargets } = props.s;
|
|
169
|
+
if (activeEntities.length > 0) {
|
|
170
|
+
const entNames = activeEntities.map((e) => e.Name);
|
|
171
|
+
const entCount = entNames.length;
|
|
172
|
+
const entList = entCount > 1
|
|
173
|
+
? entNames.slice(0, -1).join(', ') + ' and ' + entNames[entNames.length - 1]
|
|
174
|
+
: entNames[0];
|
|
175
|
+
const NAME_INLINE_MAX = 6;
|
|
176
|
+
const inlineNames = entCount <= NAME_INLINE_MAX;
|
|
177
|
+
const surface = inlineNames
|
|
178
|
+
? `a small set of **semantic entities** — ${entList} —`
|
|
179
|
+
: `**${entCount} semantic entities**`;
|
|
180
|
+
const seeEntities = inlineNames
|
|
181
|
+
? ''
|
|
182
|
+
: ' See the [Entities](#entities) table below for the full list.';
|
|
183
|
+
const exEnt = activeEntities[0];
|
|
184
|
+
const ex = exEnt.Name;
|
|
185
|
+
const exLower = (0, naming_1.exampleVarName)(ex.toLowerCase(), 'ts');
|
|
186
|
+
// The example call uses the entity's PRIMARY op — an op it actually
|
|
187
|
+
// exposes (prefer list -> the array, then load -> the record, else a
|
|
188
|
+
// create with its required fields). A create-only entity therefore never
|
|
189
|
+
// shows a phantom .list()/.load() that would not compile. If it exposes
|
|
190
|
+
// only remove (or nothing), the op line is omitted entirely.
|
|
191
|
+
const primaryOp = (0, opShape_1.entityPrimaryOp)(exEnt);
|
|
192
|
+
let exCall = '';
|
|
193
|
+
const exIdField = (0, opShape_1.entityIdField)(exEnt);
|
|
194
|
+
const exListArg = (0, opExample_1.listMatchArg)('ts', exEnt);
|
|
195
|
+
const exLoadArg = (0, opExample_1.matchArg)('ts', exEnt, 'load', exIdField, (0, opExample_1.idLiteral)(exEnt, 'load', exIdField));
|
|
196
|
+
if ('list' === primaryOp) {
|
|
197
|
+
exCall = `const items = await client.${ex}().list(${exListArg})`;
|
|
213
198
|
}
|
|
214
|
-
if (
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
const
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
.filter((it) => (it.name !== exIdF && it.name !== 'id') || !it.optional);
|
|
255
|
-
const required = shapeItems.filter((it) => !it.optional);
|
|
256
|
-
const chosen = required.length ? required : shapeItems.slice(0, 3);
|
|
257
|
-
const bodyLines = chosen.map((it) => ` ${(0, naming_1.jsKey)(it.name)}: ${tsExampleLiteral(it.type)},`);
|
|
258
|
-
const body = bodyLines.length ? `\n${bodyLines.join('\n')}\n` : '';
|
|
259
|
-
exCall = `const ${exLower} = await client.${ex}().${primaryOp}({${body}})`;
|
|
260
|
-
}
|
|
261
|
-
const CANON_OPS = ['list', 'load', 'create', 'update', 'patch', 'remove'];
|
|
262
|
-
const opSet = new Set();
|
|
263
|
-
activeEntities.forEach((e) => Object.keys(e.op || {})
|
|
264
|
-
.forEach((o) => { if (e.op[o] && e.op[o].active !== false)
|
|
265
|
-
opSet.add(o); }));
|
|
266
|
-
const opNames = CANON_OPS.filter((o) => opSet.has(o)).concat([...opSet].filter((o) => !CANON_OPS.includes(o)));
|
|
267
|
-
const opList = (opNames.length ? opNames : ['list', 'load']).map((o) => '`' + o + '`').join(', ');
|
|
268
|
-
// In the SDK's own language: ts when it has one, else the first the
|
|
269
|
-
// example helpers can write, else no example at all.
|
|
270
|
-
const lang = exampleLang(model, sdkTargets);
|
|
271
|
-
let snippet = '';
|
|
272
|
-
if ('ts' === lang) {
|
|
273
|
-
snippet = `const client = new ${model.Name}SDK()${exCall ? '\n' + exCall : ''}`;
|
|
274
|
-
}
|
|
275
|
-
else if (null != lang) {
|
|
276
|
-
const call = ['list', 'load', 'create', 'update', 'patch'].includes(String(primaryOp))
|
|
277
|
-
? (0, opExample_1.primaryOpCall)(lang, ex, (0, naming_1.exampleVarName)(ex.toLowerCase(), lang), primaryOp, exIdField, exEnt)
|
|
278
|
-
: null;
|
|
279
|
-
snippet = entityExample(lang, model.Name, call);
|
|
280
|
-
}
|
|
281
|
-
const exBlock = '' === snippet ? '.' :
|
|
282
|
-
`:\n\n\`\`\`${EXAMPLE_FENCE[lang]}\n${snippet}\n\`\`\``;
|
|
283
|
-
(0, jostraca_1.Content)(`## Entities, not endpoints
|
|
199
|
+
else if ('load' === primaryOp) {
|
|
200
|
+
exCall = `const ${exLower} = await client.${ex}().load(${exLoadArg})`;
|
|
201
|
+
}
|
|
202
|
+
else if ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp) {
|
|
203
|
+
const exIdF = (0, opShape_1.entityIdField)(exEnt);
|
|
204
|
+
// Drop the id only when the request shape says it is OPTIONAL. It is
|
|
205
|
+
// server-assigned on a normal create, but an op whose id comes from a
|
|
206
|
+
// PATH PARAMETER requires it, and the typed CreateData then rejects a
|
|
207
|
+
// body without it. Same rule as dataArg in helpers/opExample.
|
|
208
|
+
const shapeItems = (0, opExample_1.requestExampleItems)(exEnt, primaryOp)
|
|
209
|
+
.filter((it) => (it.name !== exIdF && it.name !== 'id') || !it.optional);
|
|
210
|
+
const required = shapeItems.filter((it) => !it.optional);
|
|
211
|
+
const chosen = required.length ? required : shapeItems.slice(0, 3);
|
|
212
|
+
const bodyLines = chosen.map((it) => ` ${(0, naming_1.jsKey)(it.name)}: ${tsExampleLiteral(it.type)},`);
|
|
213
|
+
const body = bodyLines.length ? `\n${bodyLines.join('\n')}\n` : '';
|
|
214
|
+
exCall = `const ${exLower} = await client.${ex}().${primaryOp}({${body}})`;
|
|
215
|
+
}
|
|
216
|
+
const CANON_OPS = ['list', 'load', 'create', 'update', 'patch', 'remove'];
|
|
217
|
+
const opSet = new Set();
|
|
218
|
+
activeEntities.forEach((e) => Object.keys(e.op || {})
|
|
219
|
+
.forEach((o) => { if (e.op[o] && e.op[o].active !== false)
|
|
220
|
+
opSet.add(o); }));
|
|
221
|
+
const opNames = CANON_OPS.filter((o) => opSet.has(o)).concat([...opSet].filter((o) => !CANON_OPS.includes(o)));
|
|
222
|
+
const opList = (opNames.length ? opNames : ['list', 'load']).map((o) => '`' + o + '`').join(', ');
|
|
223
|
+
// In the SDK's own language: ts when it has one, else the first the
|
|
224
|
+
// example helpers can write, else no example at all.
|
|
225
|
+
const lang = exampleLang(model, sdkTargets);
|
|
226
|
+
let snippet = '';
|
|
227
|
+
if ('ts' === lang) {
|
|
228
|
+
snippet = `const client = new ${model.Name}SDK()${exCall ? '\n' + exCall : ''}`;
|
|
229
|
+
}
|
|
230
|
+
else if (null != lang) {
|
|
231
|
+
const call = ['list', 'load', 'create', 'update', 'patch'].includes(String(primaryOp))
|
|
232
|
+
? (0, opExample_1.primaryOpCall)(lang, ex, (0, naming_1.exampleVarName)(ex.toLowerCase(), lang), primaryOp, exIdField, exEnt)
|
|
233
|
+
: null;
|
|
234
|
+
snippet = entityExample(lang, model.Name, call);
|
|
235
|
+
}
|
|
236
|
+
const exBlock = '' === snippet ? '.' :
|
|
237
|
+
`:\n\n\`\`\`${EXAMPLE_FENCE[lang]}\n${snippet}\n\`\`\``;
|
|
238
|
+
(0, jostraca_1.Content)(`## Entities, not endpoints
|
|
284
239
|
|
|
285
240
|
This SDK exposes the API as ${surface} that you
|
|
286
241
|
call directly, instead of assembling URL paths and query strings.${seeEntities} Entities are
|
|
@@ -291,122 +246,141 @@ Thinking in entities keeps the mental model small — for people and AI agents a
|
|
|
291
246
|
rather than reasoning about raw HTTP routes and query parameters.
|
|
292
247
|
|
|
293
248
|
`);
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
const ReadmeTopTesting = (0, component_1.cmp)(function ReadmeTopTesting(props) {
|
|
252
|
+
const { ctx$, sdkTargets } = props.s;
|
|
253
|
+
if (sdkTargets.length > 0) {
|
|
254
|
+
(0, jostraca_1.Content)(`## Offline unit testing
|
|
297
255
|
|
|
298
256
|
Every SDK ships a built-in **test mode** that swaps the HTTP transport for
|
|
299
257
|
an in-memory mock, so your unit tests run fully offline — no server, no
|
|
300
258
|
network, and no credentials:
|
|
301
259
|
|
|
302
260
|
`);
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
261
|
+
sdkTargets.forEach((tgt) => {
|
|
262
|
+
const Test = (0, optional_1.optionalComponent)(ctx$, tgt, 'ReadmeTopTest');
|
|
263
|
+
if (Test) {
|
|
264
|
+
(0, jostraca_1.Content)(`### ${(0, facts_1.fact)(tgt, 'title')}
|
|
307
265
|
|
|
308
266
|
`);
|
|
309
|
-
|
|
310
|
-
|
|
267
|
+
Test['ReadmeTopTest']({ target: tgt });
|
|
268
|
+
(0, jostraca_1.Content)(`
|
|
311
269
|
`);
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
const ReadmeTopPackages = (0, component_1.cmp)(function ReadmeTopPackages(props) {
|
|
275
|
+
const { model, pkgTargets } = props.s;
|
|
276
|
+
// 3. Packages — real published package name + install command per
|
|
277
|
+
// ecosystem. A package that is NOT yet live on its registry (the fleet
|
|
278
|
+
// default: 'pending') must NOT advertise a `npm install ...` that 404s —
|
|
279
|
+
// its Install cell links to the target README's install section instead,
|
|
280
|
+
// as do go-cli and go-mcp, which the Go proxy cannot install.
|
|
281
|
+
if (pkgTargets.length > 0) {
|
|
282
|
+
(0, jostraca_1.Content)(`## Packages
|
|
322
283
|
|
|
323
284
|
| Language | Package | Install |
|
|
324
285
|
| --- | --- | --- |
|
|
325
286
|
`);
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
})
|
|
349
|
-
|
|
287
|
+
pkgTargets.forEach((tgt) => {
|
|
288
|
+
const state = (0, packageMeta_1.registryState)(model, tgt.name);
|
|
289
|
+
const readme = (0, facts_1.fact)(tgt, 'docs').readme;
|
|
290
|
+
let cell;
|
|
291
|
+
if ('active' === state) {
|
|
292
|
+
const cmd = installCommand(tgt, model);
|
|
293
|
+
cell = cmd
|
|
294
|
+
? '`' + cmd + '`'
|
|
295
|
+
: readme ? `see [${tgt.name}/README.md](${tgt.name}/README.md#install)` : `see \`${tgt.name}/\``;
|
|
296
|
+
}
|
|
297
|
+
else if ('tag' === state) {
|
|
298
|
+
const cmd = (0, packageMeta_1.vendorCommand)(model, tgt.name);
|
|
299
|
+
cell = cmd
|
|
300
|
+
? '`' + cmd + '`'
|
|
301
|
+
: 'build from source — ' + (readme ? `[${tgt.name}/README.md](${tgt.name}/README.md)` : `\`${tgt.name}/\``);
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
// The target README always gives a route that works without a
|
|
305
|
+
// tag, which a repository may not have.
|
|
306
|
+
cell = readme ? `publish pending — [install from source](${tgt.name}/README.md#install)` :
|
|
307
|
+
`publish pending — install from source in \`${tgt.name}/\``;
|
|
308
|
+
}
|
|
309
|
+
(0, jostraca_1.Content)(`| ${(0, facts_1.fact)(tgt, 'title')} | \`${(0, packageMeta_1.packageName)(model, tgt.name)}\` | ${cell} |
|
|
310
|
+
`);
|
|
311
|
+
});
|
|
312
|
+
(0, jostraca_1.Content)(`
|
|
350
313
|
`);
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
const ReadmeTopQuickstart = (0, component_1.cmp)(function ReadmeTopQuickstart(props) {
|
|
317
|
+
const { model, ctx$, leadTarget } = props.s;
|
|
318
|
+
if (leadTarget) {
|
|
319
|
+
(0, jostraca_1.Content)(`## Quickstart
|
|
354
320
|
|
|
355
|
-
### ${leadTarget
|
|
321
|
+
### ${(0, facts_1.fact)(leadTarget, 'title')}
|
|
356
322
|
|
|
357
323
|
`);
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
${'' === placement ? '' : placement + '\n\n'}
|
|
324
|
+
const LeadQuick = (0, optional_1.optionalComponent)(ctx$, leadTarget, 'ReadmeTopQuick');
|
|
325
|
+
if (LeadQuick) {
|
|
326
|
+
LeadQuick['ReadmeTopQuick']({ target: leadTarget });
|
|
327
|
+
}
|
|
328
|
+
const placement = (0, utility_1.credentialPlacement)(model);
|
|
329
|
+
(0, jostraca_1.Content)(`
|
|
330
|
+
${'' === placement ? '' : placement + '\n\n'}${(0, facts_1.fact)(leadTarget, 'docs').readme ?
|
|
331
|
+
`See the [${(0, facts_1.fact)(leadTarget, 'title')} README](${leadTarget.name}/README.md) for the full guide.` : ''}
|
|
365
332
|
|
|
366
333
|
`);
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
const ReadmeTopSurfaces = (0, component_1.cmp)(function ReadmeTopSurfaces(props) {
|
|
337
|
+
const { hasCli, hasMcp, cliTargets, mcpTargets, sdkTargets, consumerTargets, langList } = props.s;
|
|
338
|
+
const paths = (targets) => targets.map((t) => `\`${t.name}/\``).join(' ');
|
|
339
|
+
if (sdkTargets.length > 0 || hasCli || hasMcp || consumerTargets.length > 0) {
|
|
340
|
+
(0, jostraca_1.Content)(`## Surfaces
|
|
370
341
|
|
|
371
342
|
| Surface | Path |
|
|
372
343
|
| --- | --- |
|
|
373
344
|
`);
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
(0, jostraca_1.Content)(`| **SDK** (${langList}) | ${paths} |
|
|
345
|
+
if (sdkTargets.length > 0) {
|
|
346
|
+
(0, jostraca_1.Content)(`| **SDK** (${langList}) | ${paths(sdkTargets)} |
|
|
377
347
|
`);
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
348
|
+
}
|
|
349
|
+
if (hasCli) {
|
|
350
|
+
(0, jostraca_1.Content)(`| **CLI** | ${paths(cliTargets)} |
|
|
381
351
|
`);
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
352
|
+
}
|
|
353
|
+
if (hasMcp) {
|
|
354
|
+
(0, jostraca_1.Content)(`| **MCP server** | ${paths(mcpTargets)} |
|
|
385
355
|
`);
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
356
|
+
}
|
|
357
|
+
consumerTargets.forEach((t) => {
|
|
358
|
+
(0, jostraca_1.Content)(`| **${(0, facts_1.fact)(t, 'title')}** | \`${t.name}/\` |
|
|
389
359
|
`);
|
|
390
|
-
|
|
391
|
-
|
|
360
|
+
});
|
|
361
|
+
(0, jostraca_1.Content)(`
|
|
392
362
|
`);
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
const ReadmeTopMcp = (0, component_1.cmp)(function ReadmeTopMcp(props) {
|
|
366
|
+
const { model, hasMcp, mcpTargets } = props.s;
|
|
367
|
+
if (hasMcp) {
|
|
368
|
+
const mcp = mcpTargets[0].name;
|
|
369
|
+
const mcpOps = (0, mcpTools_1.mcpTools)(model, mcp).map((tool) => tool.op);
|
|
370
|
+
const mcpWrite = true === mcpTargets[0].tool?.write;
|
|
371
|
+
const toggle = `\`main: kit: target: '${mcp}': tool: write: true\``;
|
|
372
|
+
const opText = mcpOps.length < 2 ? mcpOps.join('') :
|
|
373
|
+
mcpOps.slice(0, -1).join(', ') + ' and ' + mcpOps[mcpOps.length - 1];
|
|
374
|
+
// What the server reads and writes is what it registers, not the flag.
|
|
375
|
+
const reads = mcpOps.some((op) => mcpTools_1.MCP_WRITE_OPS.includes(op)) ? '' : mcpWrite ?
|
|
376
|
+
' It only reads, as no entity has a create, update, patch or remove a plain call runs.' :
|
|
377
|
+
` It only reads: create, update, patch and remove become tools when the SDK's model sets
|
|
404
378
|
${toggle}.`;
|
|
405
|
-
|
|
379
|
+
(0, jostraca_1.Content)(0 === mcpOps.length ? `## Use it from an AI agent (MCP)
|
|
406
380
|
|
|
407
381
|
The generated MCP server has no tools for this SDK: no entity has a list or
|
|
408
382
|
load a plain call runs${mcpWrite ? ', or a create, update, patch or remove' :
|
|
409
|
-
|
|
383
|
+
`, and create, update, patch and remove are off until the SDK's model sets
|
|
410
384
|
${toggle}`}.
|
|
411
385
|
|
|
412
386
|
` : `## Use it from an AI agent (MCP)
|
|
@@ -416,7 +390,7 @@ The generated MCP server exposes this SDK's ${opText} operations as
|
|
|
416
390
|
can call directly.${reads} Build and register it:
|
|
417
391
|
|
|
418
392
|
\`\`\`bash
|
|
419
|
-
cd
|
|
393
|
+
cd ${mcp} && go build -o ${model.name}-mcp .
|
|
420
394
|
\`\`\`
|
|
421
395
|
|
|
422
396
|
Then add it to your agent's MCP config (Claude Desktop, Cursor, etc.):
|
|
@@ -432,54 +406,62 @@ Then add it to your agent's MCP config (Claude Desktop, Cursor, etc.):
|
|
|
432
406
|
\`\`\`
|
|
433
407
|
|
|
434
408
|
`);
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
const ReadmeTopEntities = (0, component_1.cmp)(function ReadmeTopEntities(props) {
|
|
412
|
+
const { activeEntities } = props.s;
|
|
413
|
+
if (activeEntities.length > 0) {
|
|
414
|
+
(0, jostraca_1.Content)(`## Entities
|
|
438
415
|
|
|
439
416
|
The API exposes ${activeEntities.length === 1 ? 'one entity' : activeEntities.length + ' entities'}:
|
|
440
417
|
|
|
441
418
|
| Entity | Description | API path |
|
|
442
419
|
| --- | --- | --- |
|
|
443
420
|
`);
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
`);
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
421
|
+
activeEntities.map((ent) => {
|
|
422
|
+
const ops = ent.op || {};
|
|
423
|
+
const opNames = Object.keys(ops).filter((o) => ops[o]?.active !== false);
|
|
424
|
+
const entdesc = (0, facts_1.fact)(ent, 'desc').cell ||
|
|
425
|
+
`The ${ent.Name} entity${opNames.length ? ' (' + opNames.join(', ') + ')' : ''}.`;
|
|
426
|
+
const path = (0, opShape_1.entityPath)(ent);
|
|
427
|
+
(0, jostraca_1.Content)(`| **${ent.Name}** | ${entdesc} | \`${path}\` |
|
|
428
|
+
`);
|
|
429
|
+
});
|
|
430
|
+
const opUnion = new Set();
|
|
431
|
+
activeEntities.forEach((e) => Object.keys(e.op || {})
|
|
432
|
+
.forEach((o) => { if (e.op[o]?.active !== false)
|
|
433
|
+
opUnion.add(o); }));
|
|
434
|
+
const opAvail = ['load', 'list', 'create', 'update', 'patch', 'remove'].filter((o) => opUnion.has(o));
|
|
435
|
+
const opBold = (opAvail.length ? opAvail : ['load', 'list']).map((o) => '**' + o + '**').join(', ');
|
|
436
|
+
(0, jostraca_1.Content)(`
|
|
460
437
|
The operations available across these entities are ${opBold} — see each entity's
|
|
461
438
|
own list above for exactly which it supports.
|
|
462
439
|
|
|
463
440
|
`);
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
const ReadmeTopOtherLanguages = (0, component_1.cmp)(function ReadmeTopOtherLanguages(props) {
|
|
444
|
+
const { ctx$, sdkTargets, leadTarget } = props.s;
|
|
445
|
+
const otherTargets = sdkTargets.filter((t) => leadTarget && t.name !== leadTarget.name);
|
|
446
|
+
if (otherTargets.length > 0) {
|
|
447
|
+
(0, jostraca_1.Content)(`## Quickstart in other languages
|
|
468
448
|
|
|
469
449
|
`);
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
450
|
+
otherTargets.forEach((tgt) => {
|
|
451
|
+
const Quick = (0, optional_1.optionalComponent)(ctx$, tgt, 'ReadmeTopQuick');
|
|
452
|
+
if (Quick) {
|
|
453
|
+
(0, jostraca_1.Content)(`### ${(0, facts_1.fact)(tgt, 'title')}
|
|
474
454
|
|
|
475
455
|
`);
|
|
476
|
-
|
|
477
|
-
|
|
456
|
+
Quick['ReadmeTopQuick']({ target: tgt });
|
|
457
|
+
(0, jostraca_1.Content)(`
|
|
478
458
|
`);
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
const ReadmeTopDirect = (0, component_1.cmp)(function ReadmeTopDirect() {
|
|
464
|
+
(0, jostraca_1.Content)(`## Direct and prepare
|
|
483
465
|
|
|
484
466
|
For endpoints the entity model doesn't cover, use the low-level methods:
|
|
485
467
|
|
|
@@ -490,73 +472,80 @@ Both accept a map with \`path\`, \`method\`, \`params\`, \`query\`,
|
|
|
490
472
|
\`headers\`, and \`body\`. See the [How-to guides](#how-to-guides) below.
|
|
491
473
|
|
|
492
474
|
`);
|
|
493
|
-
|
|
475
|
+
});
|
|
476
|
+
const ReadmeTopHowtoGuides = (0, component_1.cmp)(function ReadmeTopHowtoGuides(props) {
|
|
477
|
+
const { ctx$, sdkTargets } = props.s;
|
|
478
|
+
(0, jostraca_1.Content)(`## How-to guides
|
|
494
479
|
|
|
495
480
|
### Make a direct API call
|
|
496
481
|
|
|
497
482
|
When the entity interface does not cover an endpoint, use \`direct\`:
|
|
498
483
|
|
|
499
484
|
`);
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
485
|
+
sdkTargets.forEach((tgt) => {
|
|
486
|
+
const Howto = (0, optional_1.optionalComponent)(ctx$, tgt, 'ReadmeTopHowto');
|
|
487
|
+
if (Howto) {
|
|
488
|
+
Howto['ReadmeTopHowto']({ target: tgt });
|
|
489
|
+
}
|
|
490
|
+
});
|
|
491
|
+
});
|
|
492
|
+
const ReadmeTopAdvanced = (0, component_1.cmp)(function ReadmeTopAdvanced(props) {
|
|
493
|
+
const { feature } = props.s;
|
|
494
|
+
(0, jostraca_1.Content)(`## Advanced
|
|
507
495
|
|
|
508
496
|
> Everyday use only needs the sections above. This explains the internals
|
|
509
497
|
> behind every call — relevant when writing custom features.
|
|
510
498
|
|
|
511
|
-
Every
|
|
499
|
+
Every entity operation runs the same ${(0, FeatureHook_1.pipelineLength)()}-stage pipeline:
|
|
512
500
|
|
|
513
|
-
1. **
|
|
514
|
-
2. **Spec** — build the HTTP specification (URL, method, headers, body).
|
|
515
|
-
3. **Request** — send the HTTP request.
|
|
516
|
-
4. **Response** — receive and parse the response.
|
|
517
|
-
5. **Result** — extract the result data for the caller.
|
|
501
|
+
${FeatureHook_1.PIPELINE_STAGES.map((s, i) => (i + 1) + '. **' + s.name + '** — ' + s.purpose).join('\n')}
|
|
518
502
|
|
|
519
|
-
A feature hook fires
|
|
520
|
-
\`
|
|
503
|
+
A feature hook fires before each stage (e.g. \`${FeatureHook_1.PIPELINE_STAGES[0].hook}\`, \`${FeatureHook_1.PIPELINE_STAGES[1].hook}\`,
|
|
504
|
+
\`${FeatureHook_1.PIPELINE_STAGES[2].hook}\`), so features can inspect or modify the pipeline without
|
|
521
505
|
forking the SDK.
|
|
522
506
|
|
|
523
|
-
### Features
|
|
524
|
-
|
|
525
507
|
`);
|
|
526
|
-
|
|
508
|
+
const active = (0, jostraca_1.each)(feature).filter((feat) => feat.active);
|
|
509
|
+
if (0 < active.length) {
|
|
510
|
+
(0, jostraca_1.Content)(`### Features
|
|
511
|
+
|
|
512
|
+
| Feature | Purpose |
|
|
527
513
|
| --- | --- |
|
|
528
514
|
`);
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
return;
|
|
532
|
-
const purpose = feat.title || feat.Name || feat.name;
|
|
515
|
+
for (const feat of active) {
|
|
516
|
+
const purpose = (0, facts_1.fact)(feat, 'title').cell || feat.Name || feat.name;
|
|
533
517
|
(0, jostraca_1.Content)(`| **${feat.Name || feat.name}Feature** | ${purpose} |
|
|
534
518
|
`);
|
|
535
|
-
}
|
|
519
|
+
}
|
|
536
520
|
(0, jostraca_1.Content)(`
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
`
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
521
|
+
`);
|
|
522
|
+
}
|
|
523
|
+
(0, jostraca_1.Content)(`Pass custom features via the \`extend\` option at construction time.
|
|
524
|
+
|
|
525
|
+
`);
|
|
526
|
+
});
|
|
527
|
+
const ReadmeTopCustomizing = (0, component_1.cmp)(function ReadmeTopCustomizing(props) {
|
|
528
|
+
const { model, sdkTargets, docTargets, definition } = props.s;
|
|
529
|
+
// 11c. Customization: model-driven declarations, in-repo templates and
|
|
530
|
+
// components, regeneration that overwrites, customising in `.sdk`, and a
|
|
531
|
+
// map of which paths are the project's to edit. Every SDK repo carries
|
|
532
|
+
// its own generator, so this belongs in every README. A repository that
|
|
533
|
+
// regenerates `.sdk` in full says so, since its copies do not merge.
|
|
534
|
+
const mapTarget = sdkTargets[0] || docTargets[0];
|
|
535
|
+
const targetDir = mapTarget ? `\`<target>/\`, such as \`${mapTarget.name}/\`` : `\`<target>/\``;
|
|
536
|
+
const merging = copymerge_1.MERGE === (0, copymerge_1.copyMode)(model.main?.[types_1.KIT]?.copies);
|
|
537
|
+
const mergeNote = merging ?
|
|
538
|
+
`An add merges toolchain updates into the
|
|
550
539
|
edited copies, and \`voxgig-sdkgen doctor\` reports any drift from what a
|
|
551
540
|
resync would write.` :
|
|
552
|
-
|
|
541
|
+
`This repository regenerates \`.sdk\` in full
|
|
553
542
|
(\`main: kit: copies: 'overwrite'\`): set it to \`'merge'\` before
|
|
554
543
|
customising, so that an add merges toolchain updates into the edited
|
|
555
544
|
copies.`;
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
545
|
+
const copiesRow = merging ?
|
|
546
|
+
`Yes. They are this project's copies, and \`target add\` merges toolchain updates into your edits.` :
|
|
547
|
+
`Only after setting \`copies\` to \`'merge'\`. This repository regenerates them in full.`;
|
|
548
|
+
(0, jostraca_1.Content)(`## Customizing this SDK
|
|
560
549
|
|
|
561
550
|
This repository contains its own generator (\`.sdk/\`), so the SDK is
|
|
562
551
|
customizable without forking any upstream tool:
|
|
@@ -590,7 +579,7 @@ customizable without forking any upstream tool:
|
|
|
590
579
|
| \`.sdk/model/text.aontu\` | The README wording, in \`main.kit.text\`: the tagline, the summary and the entity descriptions | Yes. The scaffold writes it once and never again. |
|
|
591
580
|
| \`.sdk/model/guide/guide.aontu\` | How the spec's paths map onto entities and operations | Yes. The scaffold writes it once and never again. |
|
|
592
581
|
| \`.sdk/model/\`, the rest | The API model built from the spec, and the target and feature definitions | Not by hand. Generation, \`target add\` and a new scaffold run rewrite it, apart from a feature or target this project defines itself. |
|
|
593
|
-
| \`.sdk/def/\` | The
|
|
582
|
+
| \`.sdk/def/\` | The ${definition} | Replace it when the API changes. Generation rebuilds the model from it. |
|
|
594
583
|
| \`.sdk/src/cmp/<target>/\`, \`.sdk/tm/<target>/\` | The components and templates that generate each target | ${copiesRow} |
|
|
595
584
|
| \`.sdk/test/\` | The shared test cases the generated tests run | No. |
|
|
596
585
|
| ${targetDir} | One generated SDK per target, with its own tests | No. Generation overwrites it. |
|
|
@@ -613,58 +602,166 @@ How-to: [customize and propagate templates](https://github.com/voxgig/sdkgen/blo
|
|
|
613
602
|
The full story: [voxgig.com/sdk/custom](https://voxgig.com/sdk/custom).
|
|
614
603
|
|
|
615
604
|
`);
|
|
616
|
-
|
|
617
|
-
|
|
605
|
+
});
|
|
606
|
+
const ReadmeTopPerLanguage = (0, component_1.cmp)(function ReadmeTopPerLanguage(props) {
|
|
607
|
+
const { docTargets } = props.s;
|
|
608
|
+
if (docTargets.length > 0) {
|
|
609
|
+
(0, jostraca_1.Content)(`## Per-language documentation
|
|
618
610
|
|
|
619
611
|
`);
|
|
620
|
-
|
|
621
|
-
|
|
612
|
+
docTargets.filter((tgt) => (0, facts_1.fact)(tgt, 'docs').readme).forEach((tgt) => {
|
|
613
|
+
(0, jostraca_1.Content)(`- [${(0, facts_1.fact)(tgt, 'title')}](${tgt.name}/README.md)
|
|
622
614
|
`);
|
|
623
|
-
|
|
624
|
-
|
|
615
|
+
});
|
|
616
|
+
(0, jostraca_1.Content)(`
|
|
625
617
|
`);
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
618
|
+
}
|
|
619
|
+
});
|
|
620
|
+
const ReadmeTopUpstream = (0, component_1.cmp)(function ReadmeTopUpstream(props) {
|
|
621
|
+
const { text, definition, definitionFull, model } = props.s;
|
|
622
|
+
const upstream = text.upstream;
|
|
623
|
+
const docs = text.docs_url;
|
|
624
|
+
(0, jostraca_1.Content)(`## Upstream API
|
|
631
625
|
|
|
632
|
-
This SDK is generated from the upstream
|
|
633
|
-
unofficial client and is not affiliated with the API provider
|
|
626
|
+
This SDK is generated from the upstream ${definitionFull}.${(0, packageMeta_1.publisherInfo)(model).official ? '' : ` It is an
|
|
627
|
+
unofficial client and is not affiliated with the API provider.`}
|
|
634
628
|
|
|
635
|
-
The
|
|
629
|
+
The ${definition}(s) this SDK was generated from are kept in the
|
|
636
630
|
[\`.sdk/def/\`](.sdk/def/) folder.
|
|
637
631
|
|
|
638
632
|
`);
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
633
|
+
if (upstream.raw) {
|
|
634
|
+
// A per-tenant server URL carries an OpenAPI server variable —
|
|
635
|
+
// `https://{instance}.dreamapply.com/api` — and is the right thing to
|
|
636
|
+
// SHOW, because it tells the reader the host is theirs to fill in. It is
|
|
637
|
+
// not a thing to LINK: the braces are not a resolvable address, so a
|
|
638
|
+
// markdown link renders as clickable and dead. Show it as code instead.
|
|
639
|
+
const templated = /[{}]/.test(upstream.raw);
|
|
640
|
+
(0, jostraca_1.Content)(templated
|
|
641
|
+
? `- Upstream API: ${upstream.code}
|
|
648
642
|
`
|
|
649
|
-
|
|
643
|
+
: `- Upstream API: [${upstream.inline}](${upstream.link})
|
|
650
644
|
`);
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
645
|
+
}
|
|
646
|
+
if (docs.raw && docs.raw !== upstream.raw) {
|
|
647
|
+
(0, jostraca_1.Content)(`- Documentation: [${docs.inline}](${docs.link})
|
|
654
648
|
`);
|
|
655
|
-
|
|
656
|
-
|
|
649
|
+
}
|
|
650
|
+
(0, jostraca_1.Content)(`
|
|
657
651
|
`);
|
|
658
|
-
|
|
652
|
+
});
|
|
653
|
+
const ReadmeTopSecurity = (0, component_1.cmp)(function ReadmeTopSecurity(props) {
|
|
654
|
+
const { model } = props.s;
|
|
655
|
+
(0, jostraca_1.Content)(`## Security
|
|
659
656
|
|
|
660
657
|
Please report security issues ${(0, packageMeta_1.securityContact)(model)}. See [SECURITY.md](SECURITY.md).
|
|
661
658
|
Do not open public issues for suspected vulnerabilities.
|
|
662
659
|
|
|
663
660
|
`);
|
|
664
|
-
|
|
661
|
+
});
|
|
662
|
+
const ReadmeTopFooter = (0, component_1.cmp)(function ReadmeTopFooter(props) {
|
|
663
|
+
const { productName, definition } = props.s;
|
|
664
|
+
(0, jostraca_1.Content)(`---
|
|
665
665
|
|
|
666
|
-
Generated from the ${productName}
|
|
666
|
+
Generated from the ${productName} ${definition} by [@voxgig/sdkgen](${SDKGEN_REPO}).
|
|
667
667
|
`);
|
|
668
|
+
});
|
|
669
|
+
const ReadmeTop = (0, component_1.cmp)(function ReadmeTop(props) {
|
|
670
|
+
const { ctx$ } = props;
|
|
671
|
+
const { model } = ctx$;
|
|
672
|
+
if (model.name && !model.Name)
|
|
673
|
+
(0, jostraca_1.names)(model, model.name);
|
|
674
|
+
const info = (0, text_1.modelText)(model);
|
|
675
|
+
const def = (model.main && model.main.def) || {};
|
|
676
|
+
const text = (0, facts_1.fact)(model.main[types_1.KIT], 'text');
|
|
677
|
+
const productName = (0, facts_1.fact)(model.main[types_1.KIT], 'apiName').inline;
|
|
678
|
+
const kind = (0, facts_1.fact)(model.main[types_1.KIT], 'definitionKind');
|
|
679
|
+
const definition = (0, text_1.definitionName)(kind);
|
|
680
|
+
const definitionFull = (0, text_1.definitionName)(kind, true);
|
|
681
|
+
const tagline = text.tagline.inline
|
|
682
|
+
|| `${productName} client, generated from the ${definition}.`;
|
|
683
|
+
const aboutMd = text.about_md.text;
|
|
684
|
+
const apiSummary = text.summary.inline;
|
|
685
|
+
const websiteLine = text.website.raw
|
|
686
|
+
? `Learn more about ${productName} at [${text.website.label}](${text.website.link}).`
|
|
687
|
+
: '';
|
|
688
|
+
// Attribution for API metadata sourced from a third-party catalogue (e.g.
|
|
689
|
+
// freepublicapis.com). Rendered only when the model carries an
|
|
690
|
+
// `info.meta_source` URL, so first-party SDKs never show it. The link points
|
|
691
|
+
// back to the catalogue that kindly supplied the metadata.
|
|
692
|
+
const metaSourceLine = text.meta_source.raw
|
|
693
|
+
? `Metadata kindly supplied by [${text.meta_source.label}](${text.meta_source.link}).`
|
|
694
|
+
: '';
|
|
695
|
+
const entity = (0, types_1.getModelPath)(model, `main.${types_1.KIT}.entity`);
|
|
696
|
+
const target = (0, types_1.getModelPath)(model, `main.${types_1.KIT}.target`);
|
|
697
|
+
const feature = (0, types_1.getModelPath)(model, `main.${types_1.KIT}.feature`);
|
|
698
|
+
(0, jostraca_1.each)(entity, (ent) => { if (!ent.Name)
|
|
699
|
+
(0, jostraca_1.names)(ent, ent.name); });
|
|
700
|
+
(0, jostraca_1.each)(feature, (feat) => { if (!feat.Name)
|
|
701
|
+
(0, jostraca_1.names)(feat, feat.name); });
|
|
702
|
+
const activeEntities = (0, jostraca_1.each)(entity).filter((e) => e.active !== false);
|
|
703
|
+
const activeTargets = (0, facts_1.fact)(model.main[types_1.KIT], 'active').map((name) => target[name]);
|
|
704
|
+
const cliTargets = activeTargets.filter((t) => 'cli' === (0, surface_1.surfaceOf)(t));
|
|
705
|
+
const mcpTargets = activeTargets.filter((t) => 'mcp' === (0, surface_1.surfaceOf)(t));
|
|
706
|
+
const hasCli = 0 < cliTargets.length;
|
|
707
|
+
const hasMcp = 0 < mcpTargets.length;
|
|
708
|
+
const ordered = (0, surface_1.documentOrder)(model, activeTargets);
|
|
709
|
+
const isCliOrMcp = (t) => ['cli', 'mcp'].includes((0, surface_1.surfaceOf)(t));
|
|
710
|
+
const sdkTargets = ordered.filter((t) => 'sdk' === (0, surface_1.surfaceOf)(t));
|
|
711
|
+
// The CLI and the MCP server have surfaces of their own below.
|
|
712
|
+
const consumerTargets = ordered.filter((t) => 'sdk' !== (0, surface_1.surfaceOf)(t) && !isCliOrMcp(t));
|
|
713
|
+
const docTargets = ordered.filter((t) => !isCliOrMcp(t));
|
|
714
|
+
const pkgTargets = ordered.filter((t) => (0, packageMeta_1.hasPackageName)(model, t.name));
|
|
715
|
+
const langList = sdkTargets.map((t) => (0, facts_1.fact)(t, 'title')).join(', ');
|
|
716
|
+
const leadTarget = pickLeadTarget(sdkTargets);
|
|
717
|
+
const s = {
|
|
718
|
+
model,
|
|
719
|
+
ctx$,
|
|
720
|
+
info,
|
|
721
|
+
def,
|
|
722
|
+
text,
|
|
723
|
+
productName,
|
|
724
|
+
definition,
|
|
725
|
+
definitionFull,
|
|
726
|
+
tagline,
|
|
727
|
+
aboutMd,
|
|
728
|
+
apiSummary,
|
|
729
|
+
websiteLine,
|
|
730
|
+
metaSourceLine,
|
|
731
|
+
feature,
|
|
732
|
+
activeEntities,
|
|
733
|
+
hasCli,
|
|
734
|
+
hasMcp,
|
|
735
|
+
cliTargets,
|
|
736
|
+
mcpTargets,
|
|
737
|
+
sdkTargets,
|
|
738
|
+
consumerTargets,
|
|
739
|
+
docTargets,
|
|
740
|
+
pkgTargets,
|
|
741
|
+
langList,
|
|
742
|
+
leadTarget,
|
|
743
|
+
};
|
|
744
|
+
(0, jostraca_1.File)({ name: 'README.md' }, () => {
|
|
745
|
+
ReadmeTopTitle({ s });
|
|
746
|
+
ReadmeTopSurfaceLine({ s });
|
|
747
|
+
ReadmeTopFeatureLine({ s });
|
|
748
|
+
ReadmeTopAbout({ s });
|
|
749
|
+
ReadmeTopEntityModel({ s });
|
|
750
|
+
ReadmeTopTesting({ s });
|
|
751
|
+
ReadmeTopPackages({ s });
|
|
752
|
+
ReadmeTopQuickstart({ s });
|
|
753
|
+
ReadmeTopSurfaces({ s });
|
|
754
|
+
ReadmeTopMcp({ s });
|
|
755
|
+
ReadmeTopEntities({ s });
|
|
756
|
+
ReadmeTopOtherLanguages({ s });
|
|
757
|
+
ReadmeTopDirect({ s });
|
|
758
|
+
ReadmeTopHowtoGuides({ s });
|
|
759
|
+
ReadmeTopAdvanced({ s });
|
|
760
|
+
ReadmeTopCustomizing({ s });
|
|
761
|
+
ReadmeTopPerLanguage({ s });
|
|
762
|
+
ReadmeTopUpstream({ s });
|
|
763
|
+
ReadmeTopSecurity({ s });
|
|
764
|
+
ReadmeTopFooter({ s });
|
|
668
765
|
});
|
|
669
766
|
});
|
|
670
767
|
exports.ReadmeTop = ReadmeTop;
|