@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
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Content } from 'jostraca'
|
|
2
2
|
import { cmp } from '../helpers/component'
|
|
3
3
|
|
|
4
|
-
import { featureDocs, honoursActivationOrder } from './FeatureDocs'
|
|
4
|
+
import { featureDocs, codeList, honoursActivationOrder } from './FeatureDocs'
|
|
5
5
|
import type { FeatureDoc } from './FeatureDocs'
|
|
6
|
+
import { originName } from '../helpers/packageMeta'
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
const ReadmeRefFeatures = cmp(function ReadmeRefFeatures(props: any) {
|
|
@@ -15,30 +16,37 @@ const ReadmeRefFeatures = cmp(function ReadmeRefFeatures(props: any) {
|
|
|
15
16
|
return
|
|
16
17
|
}
|
|
17
18
|
|
|
19
|
+
const on = features.filter((f: FeatureDoc) => f.on).map((f: FeatureDoc) => f.name)
|
|
20
|
+
const ordered = honoursActivationOrder({ name: originName(model, target.name) })
|
|
21
|
+
const wrapping = features.filter((f) => f.wraps)
|
|
22
|
+
const hooked = features.filter((f) => 'none' === f.transport)
|
|
23
|
+
// Order decides nothing until one wrapping feature sits inside another.
|
|
24
|
+
const nests = 1 < wrapping.length
|
|
25
|
+
|
|
18
26
|
// Emitted INSIDE the per-language `## Features` section, after its summary
|
|
19
27
|
// table and activation snippet, so these are subsections of it rather than
|
|
20
28
|
// a competing heading.
|
|
21
29
|
Content(`
|
|
22
30
|
### Configuring features
|
|
23
31
|
|
|
24
|
-
Each feature is inactive until switched on, and an SDK with no feature
|
|
25
|
-
configured does no feature work at all.
|
|
26
|
-
|
|
32
|
+
${0 === on.length ? `Each feature is inactive until switched on, and an SDK with no feature
|
|
33
|
+
configured does no feature work at all.` : `${codeList(on)} ${1 === on.length ? 'is' : 'are'} active by default${
|
|
34
|
+
on.length < features.length ? '; every other feature is inactive until switched on' : ''}.`}
|
|
35
|
+
Every option below keeps its default unless you name it.
|
|
27
36
|
|
|
28
|
-
${
|
|
29
|
-
'The array form of
|
|
30
|
-
'This SDK takes
|
|
37
|
+
${!nests ? '' : (ordered ?
|
|
38
|
+
'The array form of `feature` is significant: several features wrap the\ntransport, and the order you list them in is the order they nest.' :
|
|
39
|
+
'This SDK takes `feature` as a map and composes the transport-wrapping\nfeatures in a fixed catalog order, so activation order does not change\nnesting here.') + '\n\n'}`)
|
|
31
40
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (0 < wrapping.length) {
|
|
41
|
+
if (nests) {
|
|
42
|
+
const hookedNames = hooked.map((f) => '`' + f.name + '`').join(', ')
|
|
43
|
+
const hookedLine = 0 === hooked.length ? '' : '\n' + hookedNames + (1 === hooked.length ?
|
|
44
|
+
' attaches to pipeline hooks\nrather than the transport, so its order does not affect what it observes.\n' :
|
|
45
|
+
' attach to pipeline hooks\nrather than the transport, so their order does not affect what they observe.\n')
|
|
38
46
|
Content(`#### Ordering
|
|
39
47
|
|
|
40
48
|
${wrapping.map((f) => '`' + f.name + '`').join(', ')} wrap the transport. Each
|
|
41
|
-
wraps whatever is already installed${
|
|
49
|
+
wraps whatever is already installed${ordered ?
|
|
42
50
|
', so **activation order is nesting order**:\na feature activated later sits OUTSIDE one activated earlier, and sees the call\nfirst.' :
|
|
43
51
|
'. This SDK fixes that order in its own\ncatalog rather than taking it from the caller.'}
|
|
44
52
|
|
|
@@ -48,12 +56,9 @@ sits inside it, so a response served from the cache never reaches \\\`cost\\\` a
|
|
|
48
56
|
correctly charged nothing; reverse them and every cache hit is billed for money
|
|
49
57
|
that was never spent.
|
|
50
58
|
` : `That decides behaviour, not just sequence: a feature that short-circuits the
|
|
51
|
-
call, such as a cache serving a hit, stops every feature nested inside it from
|
|
59
|
+
call${features.some((f) => 'cache' === f.name) ? ', such as a cache serving a hit,' : ''} stops every feature nested inside it from
|
|
52
60
|
ever seeing that call.
|
|
53
|
-
`}
|
|
54
|
-
${hooked.map((f) => '`' + f.name + '`').join(', ')} attach to pipeline hooks
|
|
55
|
-
rather than the transport, so their order does not affect what they observe.
|
|
56
|
-
|
|
61
|
+
`}${hookedLine}
|
|
57
62
|
`)
|
|
58
63
|
}
|
|
59
64
|
|
|
@@ -75,7 +80,7 @@ ${f.title}.
|
|
|
75
80
|
|---|---|
|
|
76
81
|
`)
|
|
77
82
|
for (const o of f.options) {
|
|
78
|
-
Content(`| \`${o.name}\` |
|
|
83
|
+
Content(`| \`${o.name}\` | ${o.code} |
|
|
79
84
|
`)
|
|
80
85
|
}
|
|
81
86
|
Content(`
|
|
@@ -114,13 +119,9 @@ its default unless you name it.
|
|
|
114
119
|
`)
|
|
115
120
|
|
|
116
121
|
if (f.wraps) {
|
|
117
|
-
Content(`- Wraps the transport: its place in the activation order decides what it
|
|
122
|
+
Content(nests ? `- Wraps the transport: its place in the activation order decides what it
|
|
118
123
|
sees. See [Ordering](#ordering) above.
|
|
119
|
-
`
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
Content(`- Attaches to pipeline hooks, not the transport, so activation order does
|
|
123
|
-
not change what it observes.
|
|
124
|
+
` : `- Wraps the transport.
|
|
124
125
|
`)
|
|
125
126
|
}
|
|
126
127
|
|
|
@@ -130,7 +131,18 @@ its default unless you name it.
|
|
|
130
131
|
`)
|
|
131
132
|
}
|
|
132
133
|
|
|
133
|
-
|
|
134
|
+
if ('none' === f.transport) {
|
|
135
|
+
Content(`- Attaches to pipeline hooks, not the transport, so activation order does
|
|
136
|
+
not change what it observes.
|
|
137
|
+
`)
|
|
138
|
+
}
|
|
139
|
+
else if (0 < f.hooks.length) {
|
|
140
|
+
Content(`- Also attaches to pipeline hooks.
|
|
141
|
+
`)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
Content(`- ${f.on ? `Active by default: set \`feature.${f.name}.active\` to false to switch it off.` :
|
|
145
|
+
'Inactive by default: leaving it out costs nothing at runtime.'}
|
|
134
146
|
|
|
135
147
|
`)
|
|
136
148
|
}
|
package/src/cmp/ReadmeStation.ts
CHANGED
|
@@ -2,13 +2,10 @@
|
|
|
2
2
|
import { Content } from 'jostraca'
|
|
3
3
|
import { cmp } from '../helpers/component'
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from '../types'
|
|
9
|
-
|
|
10
|
-
import { envName, packageName } from '../helpers/packageMeta'
|
|
11
|
-
|
|
5
|
+
import { originName, packageName } from '../helpers/packageMeta'
|
|
6
|
+
import { targetFeatures } from '../helpers/applicability'
|
|
7
|
+
import { fact } from '../helpers/facts'
|
|
8
|
+
import { KIT } from '../types'
|
|
12
9
|
|
|
13
10
|
|
|
14
11
|
// Targets where station.connect(SDK) is the idiomatic binding; everything
|
|
@@ -25,9 +22,7 @@ const ReadmeStation = cmp(function ReadmeStation(props: any) {
|
|
|
25
22
|
const { target } = props
|
|
26
23
|
const { model } = props.ctx$
|
|
27
24
|
|
|
28
|
-
const
|
|
29
|
-
{ only_active: false, required: false }) || {}
|
|
30
|
-
const station = Object.values(features)
|
|
25
|
+
const station = Object.values(targetFeatures(model, target))
|
|
31
26
|
.find((f: any) => 'station' === f?.name)
|
|
32
27
|
if (null == station) { return }
|
|
33
28
|
|
|
@@ -35,11 +30,12 @@ const ReadmeStation = cmp(function ReadmeStation(props: any) {
|
|
|
35
30
|
// main.slug in the embedded config); an untagged instance ref IS the
|
|
36
31
|
// slug, so this is also the default instance name.
|
|
37
32
|
const slug = model.name
|
|
38
|
-
const env =
|
|
33
|
+
const env = fact(model.main[KIT], 'env').prefix
|
|
39
34
|
const secretbase = env.toLowerCase()
|
|
40
35
|
const secretname = secretbase + '.apikey'
|
|
41
|
-
const
|
|
42
|
-
const
|
|
36
|
+
const origin = originName(model, target.name)
|
|
37
|
+
const connect = CONNECT_TARGETS.includes(origin)
|
|
38
|
+
const selfreg = SELF_REGISTER_TARGETS.includes(origin)
|
|
43
39
|
|
|
44
40
|
Content(`
|
|
45
41
|
## Use with Station
|
|
@@ -47,7 +43,8 @@ const ReadmeStation = cmp(function ReadmeStation(props: any) {
|
|
|
47
43
|
This SDK ships as a [voxgig/station](https://github.com/voxgig/station)
|
|
48
44
|
plugin: bind it to a local \`Station\` and outbound configuration,
|
|
49
45
|
credentials, and observability move to one place. The feature is
|
|
50
|
-
present
|
|
46
|
+
present ${fact(station, 'on') ? 'and **on by default**.' :
|
|
47
|
+
'but **off by default** — nothing changes until you bind.'}
|
|
51
48
|
|
|
52
49
|
### Declarative: \`station.json\` + \`station.sdk()\`
|
|
53
50
|
|
|
@@ -86,7 +83,7 @@ SDK features are configured in the same file too: fleet-wide, per api,
|
|
|
86
83
|
or per instance. \`station.check()\` resolves and constructs every
|
|
87
84
|
active instance without sending a request — run it in CI.
|
|
88
85
|
|
|
89
|
-
|
|
86
|
+
${fact(model.main[KIT], 'auth').apikey ? `### The secret name derives from the instance
|
|
90
87
|
|
|
91
88
|
The credential comes from [sekreto](https://github.com/voxgig/sekreto)
|
|
92
89
|
under a name derived from the **instance** name — the instance token
|
|
@@ -102,7 +99,7 @@ vault later and application code does not change; sekreto's own
|
|
|
102
99
|
documentation covers the stores. The key stays out of \`options()\` and
|
|
103
100
|
\`prepare()\` output; \`station.tap(...)\` shows live traffic.
|
|
104
101
|
|
|
105
|
-
### Imperative: ${connect ? '`connect()`' : 'inverted binding'} — the retrofit path
|
|
102
|
+
` : ''}### Imperative: ${connect ? '`connect()`' : 'inverted binding'} — the retrofit path
|
|
106
103
|
|
|
107
104
|
${connect
|
|
108
105
|
? `Bind by passing the SDK class to the station:
|