@voxgig/sdkgen 4.4.1 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/voxgig-sdkgen +1 -1
- package/dist/cmp/FeatureDocs.d.ts +16 -0
- package/dist/cmp/FeatureDocs.js +72 -0
- package/dist/cmp/FeatureDocs.js.map +1 -0
- package/dist/cmp/Readme.js +2 -0
- package/dist/cmp/Readme.js.map +1 -1
- package/dist/cmp/ReadmeFeatures.d.ts +2 -0
- package/dist/cmp/ReadmeFeatures.js +95 -0
- package/dist/cmp/ReadmeFeatures.js.map +1 -0
- package/dist/cmp/ReadmeRef.js +4 -0
- package/dist/cmp/ReadmeRef.js.map +1 -1
- package/dist/cmp/ReadmeRefFeatures.d.ts +2 -0
- package/dist/cmp/ReadmeRefFeatures.js +130 -0
- package/dist/cmp/ReadmeRefFeatures.js.map +1 -0
- package/dist/cmp/ReadmeTop.js +46 -0
- package/dist/cmp/ReadmeTop.js.map +1 -1
- package/dist/helpers/opShape.js +5 -1
- package/dist/helpers/opShape.js.map +1 -1
- package/dist/sdkgen.d.ts +3 -2
- package/dist/sdkgen.js +30 -10
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utility.d.ts +2 -1
- package/dist/utility.js +17 -1
- package/dist/utility.js.map +1 -1
- package/package.json +1 -1
- package/project/.sdk/src/cmp/c/ReadmeRef_c.ts +5 -0
- package/project/.sdk/src/cmp/clojure/ReadmeRef_clojure.ts +5 -0
- package/project/.sdk/src/cmp/cpp/ReadmeRef_cpp.ts +5 -0
- package/project/.sdk/src/cmp/csharp/ReadmeRef_csharp.ts +5 -0
- package/project/.sdk/src/cmp/dart/ReadmeRef_dart.ts +5 -0
- package/project/.sdk/src/cmp/elixir/ReadmeRef_elixir.ts +5 -0
- package/project/.sdk/src/cmp/go/ReadmeRef_go.ts +5 -0
- package/project/.sdk/src/cmp/go/TestDirect_go.ts +123 -2
- package/project/.sdk/src/cmp/java/ReadmeRef_java.ts +5 -0
- package/project/.sdk/src/cmp/js/ReadmeRef_js.ts +5 -0
- package/project/.sdk/src/cmp/js/TestDirect_js.ts +62 -0
- package/project/.sdk/src/cmp/kotlin/ReadmeRef_kotlin.ts +5 -0
- package/project/.sdk/src/cmp/lean/ReadmeRef_lean.ts +27 -3
- package/project/.sdk/src/cmp/lua/ReadmeRef_lua.ts +5 -0
- package/project/.sdk/src/cmp/ocaml/ReadmeRef_ocaml.ts +5 -0
- package/project/.sdk/src/cmp/perl/ReadmeRef_perl.ts +5 -0
- package/project/.sdk/src/cmp/php/ReadmeRef_php.ts +5 -0
- package/project/.sdk/src/cmp/py/ReadmeRef_py.ts +5 -0
- package/project/.sdk/src/cmp/rb/ReadmeRef_rb.ts +5 -0
- package/project/.sdk/src/cmp/rust/ReadmeRef_rust.ts +5 -0
- package/project/.sdk/src/cmp/scala/ReadmeRef_scala.ts +5 -0
- package/project/.sdk/src/cmp/seneca-provider/Extras_seneca-provider.ts +19 -1
- package/project/.sdk/src/cmp/seneca-provider/Main_seneca-provider.ts +27 -2
- package/project/.sdk/src/cmp/swift/ReadmeRef_swift.ts +5 -0
- package/project/.sdk/src/cmp/ts/Config_ts.ts +4 -1
- package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +9 -4
- package/project/.sdk/src/cmp/ts/ReadmeModel_ts.ts +8 -3
- package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +3 -2
- package/project/.sdk/src/cmp/ts/ReadmeRef_ts.ts +7 -2
- package/project/.sdk/src/cmp/ts/ReadmeTopQuick_ts.ts +3 -2
- package/project/.sdk/src/cmp/ts/TestDirect_ts.ts +5 -2
- package/project/.sdk/src/cmp/ts/TestEntity_ts.ts +5 -2
- package/project/.sdk/src/cmp/zig/ReadmeRef_zig.ts +5 -0
- package/project/.sdk/tm/clojure/src/sdk/core.clj +6 -2
- package/project/.sdk/tm/clojure/src/sdk/features.clj +175 -0
- package/project/.sdk/tm/csharp/utility/MakeOptions.cs +5 -0
- package/project/.sdk/tm/dart/lib/utility/MakeOptionsUtility.dart +4 -0
- package/project/.sdk/tm/dart/test/feature_test.dart +54 -0
- package/project/.sdk/tm/elixir/lib/projectname/utility.ex +4 -1
- package/project/.sdk/tm/go/feature/test_feature.go +17 -6
- package/project/.sdk/tm/go/test/feature_corpus_test.go +10 -3
- package/project/.sdk/tm/java/test/FeatureCorpusTest.java +5 -4
- package/project/.sdk/tm/js/src/feature/test/TestFeature.js +8 -1
- package/project/.sdk/tm/js/src/utility/MakeOptionsUtility.js +3 -1
- package/project/.sdk/tm/js/test/feature/Corpus.test.js +13 -3
- package/project/.sdk/tm/js/test/feature.test.js +19 -9
- package/project/.sdk/tm/lean/src/SdkFeatures.lean +186 -1
- package/project/.sdk/tm/lua/feature/test_feature.lua +21 -7
- package/project/.sdk/tm/lua/test/feature_test.lua +18 -18
- package/project/.sdk/tm/lua/utility/make_options.lua +2 -0
- package/project/.sdk/tm/ocaml/sdk_features.ml +5 -0
- package/project/.sdk/tm/ocaml/sdk_runtime.ml +4 -1
- package/project/.sdk/tm/perl/t/feature_corpus.t +5 -4
- package/project/.sdk/tm/perl/utility/make_options.pm +4 -1
- package/project/.sdk/tm/php/feature/TestFeature.php +19 -8
- package/project/.sdk/tm/php/test/FeatureCorpusTest.php +7 -4
- package/project/.sdk/tm/php/utility/MakeOptions.php +2 -1
- package/project/.sdk/tm/py/pkg/feature/test_feature.py +15 -4
- package/project/.sdk/tm/py/pkg/utility/make_options.py +2 -0
- package/project/.sdk/tm/py/test/test_feature.py +40 -0
- package/project/.sdk/tm/py/test/test_feature_corpus.py +14 -3
- package/project/.sdk/tm/rb/test/feature_corpus_test.rb +12 -4
- package/project/.sdk/tm/rb/utility/make_options.rb +4 -1
- package/project/.sdk/tm/ts/src/feature/test/TestFeature.ts +15 -1
- package/project/.sdk/tm/ts/src/utility/MakeOptionsUtility.ts +3 -1
- package/project/.sdk/tm/ts/src/utility/PrepareAuthUtility.ts +20 -0
- package/project/.sdk/tm/ts/test/feature/Corpus.test.ts +13 -3
- package/project/.sdk/tm/ts/test/feature.test.ts +19 -9
- package/project/sdkgen-package.json +1 -1
- package/src/cmp/FeatureDocs.ts +100 -0
- package/src/cmp/Readme.ts +2 -0
- package/src/cmp/ReadmeFeatures.ts +113 -0
- package/src/cmp/ReadmeRef.ts +4 -0
- package/src/cmp/ReadmeRefFeatures.ts +149 -0
- package/src/cmp/ReadmeTop.ts +48 -0
- package/src/helpers/opShape.ts +5 -1
- package/src/sdkgen.ts +28 -7
- package/src/utility.ts +21 -1
package/dist/utility.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utility.js","sourceRoot":"","sources":["../src/utility.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"utility.js","sourceRoot":"","sources":["../src/utility.ts"],"names":[],"mappings":";;;;;;QAkHE,WAAW;QACX,WAAW;QACX,YAAY;QACZ,iBAAiB;QACjB,eAAe;QAIf,YAAY;QACZ,UAAU;QACV,iBAAiB;QACjB,gBAAgB;QAChB,KAAK;QACL,gBAAgB;AA9HlB,0DAA4B;AAE5B,uCAA+C;AAE/C,2CAAkD;AAElD,qDAAsD;AACtD,uDAAsD;AAGtD,6EAA6E;AAC7E,EAAE;AACF,yEAAyE;AACzE,0EAA0E;AAC1E,wEAAwE;AACxE,qEAAqE;AACrE,6EAA6E;AAC7E,oEAAoE;AACpE,SAAS,WAAW,CAAC,IAAS,EAAE,IAAY;IAC1C,MAAM,IAAI,GAAG,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAA;IAClE,MAAM,QAAQ,GAAG,mBAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;IACtD,OAAO,QAAQ,CAAA;AACjB,CAAC;AAGD,sEAAsE;AACtE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;IAC1B,CAAC;IAED,MAAM,GAAG,GAAG;QACV,IAAI;QACJ,OAAO,EAAE,WAAW;QACpB,OAAO;QACP,MAAM,EAAE,UAAU;KACnB,CAAA;IAED,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAA;AAC3C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { cmp, each, Content, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape } from '@voxgig/sdkgen'
|
|
3
|
+
import { ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
3
4
|
|
|
4
5
|
import {
|
|
5
6
|
KIT,
|
|
@@ -387,6 +388,10 @@ ${Name}SDK* client = ${ident}_sdk_new(cmap(1,
|
|
|
387
388
|
\`\`\`
|
|
388
389
|
|
|
389
390
|
`)
|
|
391
|
+
// The shared feature reference: options, defaults, usage and the
|
|
392
|
+
// considerations. Model facts, identical in every target, so they are
|
|
393
|
+
// written once in cmp/ReadmeRefFeatures.ts rather than here.
|
|
394
|
+
ReadmeRefFeatures({ target })
|
|
390
395
|
}
|
|
391
396
|
|
|
392
397
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { cmp, each, Content, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape } from '@voxgig/sdkgen'
|
|
3
|
+
import { ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
3
4
|
|
|
4
5
|
import {
|
|
5
6
|
KIT,
|
|
@@ -396,6 +397,10 @@ Features are activated via the \`feature\` option:
|
|
|
396
397
|
\`\`\`
|
|
397
398
|
|
|
398
399
|
`)
|
|
400
|
+
// The shared feature reference: options, defaults, usage and the
|
|
401
|
+
// considerations. Model facts, identical in every target, so they are
|
|
402
|
+
// written once in cmp/ReadmeRefFeatures.ts rather than here.
|
|
403
|
+
ReadmeRefFeatures({ target })
|
|
399
404
|
}
|
|
400
405
|
|
|
401
406
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { cmp, each, Content, canonToType, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape } from '@voxgig/sdkgen'
|
|
3
|
+
import { ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
3
4
|
|
|
4
5
|
import {
|
|
5
6
|
KIT,
|
|
@@ -374,6 +375,10 @@ auto client = std::make_shared<${model.const.Name}SDK>(vmap({
|
|
|
374
375
|
\`\`\`
|
|
375
376
|
|
|
376
377
|
`)
|
|
378
|
+
// The shared feature reference: options, defaults, usage and the
|
|
379
|
+
// considerations. Model facts, identical in every target, so they are
|
|
380
|
+
// written once in cmp/ReadmeRefFeatures.ts rather than here.
|
|
381
|
+
ReadmeRefFeatures({ target })
|
|
377
382
|
}
|
|
378
383
|
|
|
379
384
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { cmp, each, Content, canonToType, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape } from '@voxgig/sdkgen'
|
|
3
|
+
import { ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
3
4
|
|
|
4
5
|
import {
|
|
5
6
|
KIT,
|
|
@@ -379,6 +380,10 @@ var client = new ${model.const.Name}SDK(new Dictionary<string, object?>
|
|
|
379
380
|
\`\`\`
|
|
380
381
|
|
|
381
382
|
`)
|
|
383
|
+
// The shared feature reference: options, defaults, usage and the
|
|
384
|
+
// considerations. Model facts, identical in every target, so they are
|
|
385
|
+
// written once in cmp/ReadmeRefFeatures.ts rather than here.
|
|
386
|
+
ReadmeRefFeatures({ target })
|
|
382
387
|
}
|
|
383
388
|
|
|
384
389
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { cmp, each, Content, canonToType, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape, safeVarName, exampleVarName, matchArg, idLiteral } from '@voxgig/sdkgen'
|
|
3
|
+
import { ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
3
4
|
|
|
4
5
|
import {
|
|
5
6
|
KIT,
|
|
@@ -381,6 +382,10 @@ final client = ${model.const.Name}SDK({
|
|
|
381
382
|
\`\`\`
|
|
382
383
|
|
|
383
384
|
`)
|
|
385
|
+
// The shared feature reference: options, defaults, usage and the
|
|
386
|
+
// considerations. Model facts, identical in every target, so they are
|
|
387
|
+
// written once in cmp/ReadmeRefFeatures.ts rather than here.
|
|
388
|
+
ReadmeRefFeatures({ target })
|
|
384
389
|
}
|
|
385
390
|
|
|
386
391
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { cmp, each, Content, canonToType, File, isAuthActive, entityIdField, opRequestShape } from '@voxgig/sdkgen'
|
|
3
|
+
import { ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
3
4
|
|
|
4
5
|
import {
|
|
5
6
|
KIT,
|
|
@@ -322,6 +323,10 @@ sdk = ${Name}.new(${Name}.Helpers.deep(%{
|
|
|
322
323
|
\`\`\`
|
|
323
324
|
|
|
324
325
|
`)
|
|
326
|
+
// The shared feature reference: options, defaults, usage and the
|
|
327
|
+
// considerations. Model facts, identical in every target, so they are
|
|
328
|
+
// written once in cmp/ReadmeRefFeatures.ts rather than here.
|
|
329
|
+
ReadmeRefFeatures({ target })
|
|
325
330
|
}
|
|
326
331
|
|
|
327
332
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { cmp, each, Content, canonToType, File, isAuthActive, entityIdField, entityOps, opRequestShape } from '@voxgig/sdkgen'
|
|
3
|
+
import { ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
3
4
|
|
|
4
5
|
import {
|
|
5
6
|
KIT,
|
|
@@ -407,6 +408,10 @@ client := sdk.New${model.const.Name}SDK(map[string]any{
|
|
|
407
408
|
\`\`\`
|
|
408
409
|
|
|
409
410
|
`)
|
|
411
|
+
// The shared feature reference: options, defaults, usage and the
|
|
412
|
+
// considerations. Model facts, identical in every target, so they are
|
|
413
|
+
// written once in cmp/ReadmeRefFeatures.ts rather than here.
|
|
414
|
+
ReadmeRefFeatures({ target })
|
|
410
415
|
}
|
|
411
416
|
|
|
412
417
|
})
|
|
@@ -92,6 +92,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
92
92
|
|
|
93
93
|
// Get load point info
|
|
94
94
|
const loadPoint = loadOp?.points?.[0]
|
|
95
|
+
const loadIsGraphql = 'graphql' === (loadPoint as any)?.kind
|
|
95
96
|
const loadPath = loadPoint ? normalizePathParams(loadPoint.parts || [], loadPoint?.args?.params || [], loadPoint?.rename?.param) : ''
|
|
96
97
|
const allLoadParams = loadPoint?.args?.params || []
|
|
97
98
|
// Some upstream OpenAPI specs declare a parameter as `in: path` even when
|
|
@@ -118,6 +119,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
118
119
|
|
|
119
120
|
// Get list point info
|
|
120
121
|
const listPoint = listOp?.points?.[0]
|
|
122
|
+
const listIsGraphql = 'graphql' === (listPoint as any)?.kind
|
|
121
123
|
const listPath = listPoint ? normalizePathParams(listPoint.parts || [], listPoint?.args?.params || [], listPoint?.rename?.param) : ''
|
|
122
124
|
const listParams = listPoint?.args?.params || []
|
|
123
125
|
|
|
@@ -170,7 +172,11 @@ func Test${entity.Name}Direct(t *testing.T) {
|
|
|
170
172
|
`)
|
|
171
173
|
|
|
172
174
|
// Generate list test first (load needs list results in live mode)
|
|
173
|
-
if (hasList && listPoint) {
|
|
175
|
+
if (hasList && listPoint && listIsGraphql) {
|
|
176
|
+
generateDirectGraphqlGo('list', entity, listPoint, liveFail)
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (hasList && listPoint && !listIsGraphql) {
|
|
174
180
|
const listParamStr = listParams.length > 0
|
|
175
181
|
? listParams.map((p: any, i: number) =>
|
|
176
182
|
`"${p.name}": "direct0${i + 1}"`).join(', ')
|
|
@@ -323,8 +329,12 @@ ${listSkipBlock} client := setup.client
|
|
|
323
329
|
`)
|
|
324
330
|
}
|
|
325
331
|
|
|
332
|
+
if (hasLoad && loadPoint && loadIsGraphql) {
|
|
333
|
+
generateDirectGraphqlGo('load', entity, loadPoint, liveFail)
|
|
334
|
+
}
|
|
335
|
+
|
|
326
336
|
// Generate load test - in live mode, first list to get a real entity ID
|
|
327
|
-
if (hasLoad && loadPoint) {
|
|
337
|
+
if (hasLoad && loadPoint && !loadIsGraphql) {
|
|
328
338
|
const loadParamStr = loadParams.length > 0
|
|
329
339
|
? loadParams.map((p: any, i: number) =>
|
|
330
340
|
`"${p.name}": "direct0${i + 1}"`).join(', ')
|
|
@@ -606,6 +616,117 @@ var _ = json.Unmarshal
|
|
|
606
616
|
})
|
|
607
617
|
|
|
608
618
|
|
|
619
|
+
// GraphQL-backed op needs POST+body, not a REST-shaped GET+params Direct()
|
|
620
|
+
// call — reuse apidef's own point.graphql.doc via the SDK's Graphql() hatch.
|
|
621
|
+
// Mirrors TestDirect_ts.ts's generateDirectGraphql.
|
|
622
|
+
function generateDirectGraphqlGo(
|
|
623
|
+
opname: 'load' | 'list',
|
|
624
|
+
entity: ModelEntity,
|
|
625
|
+
point: any,
|
|
626
|
+
liveFail: string,
|
|
627
|
+
) {
|
|
628
|
+
const doc: string = point.graphql.doc
|
|
629
|
+
const vars: any[] = point.graphql.vars || []
|
|
630
|
+
|
|
631
|
+
const mockVarLines = vars.map((v: any, i: number) =>
|
|
632
|
+
`\t\tvariables["${v.name}"] = "direct0${i + 1}"`).join('\n')
|
|
633
|
+
|
|
634
|
+
const liveVarLines = vars.map((v: any) => {
|
|
635
|
+
const from = v.from || v.name
|
|
636
|
+
const key = ('id' === from ? entity.name : from.replace(/_id$/, '')) + '01'
|
|
637
|
+
return `\t\tvariables["${v.name}"] = setup.idmap["${key}"]`
|
|
638
|
+
}).join('\n')
|
|
639
|
+
|
|
640
|
+
const liveIdKeys = vars.map((v: any) => {
|
|
641
|
+
const from = v.from || v.name
|
|
642
|
+
return ('id' === from ? entity.name : from.replace(/_id$/, '')) + '01'
|
|
643
|
+
})
|
|
644
|
+
|
|
645
|
+
const skipBlock = liveIdKeys.length > 0
|
|
646
|
+
? `\t\tif setup.live {
|
|
647
|
+
\t\t\tfor _, _liveKey := range []string{${liveIdKeys.map(k => `"${k}"`).join(', ')}} {
|
|
648
|
+
\t\t\t\tif v := setup.idmap[_liveKey]; v == nil {
|
|
649
|
+
\t\t\t\t\tt.Skipf("live test needs %s via *_ENTID env var (synthetic IDs only)", _liveKey)
|
|
650
|
+
\t\t\t\t\treturn
|
|
651
|
+
\t\t\t\t}
|
|
652
|
+
\t\t\t}
|
|
653
|
+
\t\t}
|
|
654
|
+
`
|
|
655
|
+
: ''
|
|
656
|
+
|
|
657
|
+
// Asserted against the OUTGOING request body, not the mocked response —
|
|
658
|
+
// response-shape correctness is the entity-level tests' job. The mock
|
|
659
|
+
// JSON-encodes a map body to a string (see makeFetchDefUtil), so this
|
|
660
|
+
// is a substring check, same as the ts/js mocks.
|
|
661
|
+
const varAsserts = vars.map((_v: any, i: number) =>
|
|
662
|
+
`\t\t\tif !strings.Contains(bodyStr, "direct0${i + 1}") {\n` +
|
|
663
|
+
`\t\t\t\tt.Fatalf("expected body to contain direct0${i + 1}, got %v", bodyStr)\n` +
|
|
664
|
+
`\t\t\t}`).join('\n')
|
|
665
|
+
|
|
666
|
+
Content(` t.Run("direct-${opname}-${entity.name}", func(t *testing.T) {
|
|
667
|
+
setup := ${entity.name}DirectSetup(map[string]any{"id": "direct01"})
|
|
668
|
+
_mode := "unit"
|
|
669
|
+
if setup.live {
|
|
670
|
+
_mode = "live"
|
|
671
|
+
}
|
|
672
|
+
if _shouldSkip, _reason := isControlSkipped("direct", "direct-${opname}-${entity.name}", _mode); _shouldSkip {
|
|
673
|
+
if _reason == "" {
|
|
674
|
+
_reason = "skipped via sdk-test-control.json"
|
|
675
|
+
}
|
|
676
|
+
t.Skip(_reason)
|
|
677
|
+
return
|
|
678
|
+
}
|
|
679
|
+
${skipBlock} client := setup.client
|
|
680
|
+
|
|
681
|
+
variables := map[string]any{}
|
|
682
|
+
if setup.live {
|
|
683
|
+
${liveVarLines || '\t\t// no variables'}
|
|
684
|
+
} else {
|
|
685
|
+
${mockVarLines || '\t\t// no variables'}
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
result, err := client.Graphql(${JSON.stringify(doc)}, variables, nil)
|
|
689
|
+
|
|
690
|
+
if setup.live {
|
|
691
|
+
// Live mode is lenient: synthetic ids frequently fail server-side
|
|
692
|
+
// validation. Skip rather than fail when the call doesn't come
|
|
693
|
+
// back clean.
|
|
694
|
+
if err != nil {
|
|
695
|
+
t.${liveFail}("graphql call failed (likely synthetic IDs against live API): %v", err)
|
|
696
|
+
}
|
|
697
|
+
if result["ok"] != true {
|
|
698
|
+
t.${liveFail}("graphql call not ok (likely synthetic IDs against live API): %v", result)
|
|
699
|
+
}
|
|
700
|
+
} else {
|
|
701
|
+
if err != nil {
|
|
702
|
+
t.Fatalf("direct failed: %v", err)
|
|
703
|
+
}
|
|
704
|
+
if result["ok"] != true {
|
|
705
|
+
t.Fatalf("expected ok to be true, got %v", result["ok"])
|
|
706
|
+
}
|
|
707
|
+
if core.ToInt(result["status"]) != 200 {
|
|
708
|
+
t.Fatalf("expected status 200, got %v", result["status"])
|
|
709
|
+
}
|
|
710
|
+
if result["data"] == nil {
|
|
711
|
+
t.Fatal("expected data to be non-nil")
|
|
712
|
+
}
|
|
713
|
+
if len(*setup.calls) != 1 {
|
|
714
|
+
t.Fatalf("expected 1 call, got %d", len(*setup.calls))
|
|
715
|
+
}
|
|
716
|
+
call := (*setup.calls)[0]
|
|
717
|
+
initMap, _ := call["init"].(map[string]any)
|
|
718
|
+
if initMap["method"] != "POST" {
|
|
719
|
+
t.Fatalf("expected method POST, got %v", initMap["method"])
|
|
720
|
+
}
|
|
721
|
+
bodyStr, _ := initMap["body"].(string)
|
|
722
|
+
${varAsserts}
|
|
723
|
+
}
|
|
724
|
+
})
|
|
725
|
+
|
|
726
|
+
`)
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
|
|
609
730
|
export {
|
|
610
731
|
TestDirect
|
|
611
732
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { cmp, each, Content, canonToType, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape } from '@voxgig/sdkgen'
|
|
3
|
+
import { ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
3
4
|
|
|
4
5
|
import {
|
|
5
6
|
KIT,
|
|
@@ -377,6 +378,10 @@ ${SDK} client = new ${SDK}(options);
|
|
|
377
378
|
\`\`\`
|
|
378
379
|
|
|
379
380
|
`)
|
|
381
|
+
// The shared feature reference: options, defaults, usage and the
|
|
382
|
+
// considerations. Model facts, identical in every target, so they are
|
|
383
|
+
// written once in cmp/ReadmeRefFeatures.ts rather than here.
|
|
384
|
+
ReadmeRefFeatures({ target })
|
|
380
385
|
}
|
|
381
386
|
|
|
382
387
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { cmp, each, Content, canonToType, File, isAuthActive, entityIdField, opRequestShape, safeVarName, exampleVarName, jsKey } from '@voxgig/sdkgen'
|
|
3
|
+
import { ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
3
4
|
|
|
4
5
|
import {
|
|
5
6
|
KIT,
|
|
@@ -405,6 +406,10 @@ const client = new ${model.Name}SDK({
|
|
|
405
406
|
\`\`\`
|
|
406
407
|
|
|
407
408
|
`)
|
|
409
|
+
// The shared feature reference: options, defaults, usage and the
|
|
410
|
+
// considerations. Model facts, identical in every target, so they are
|
|
411
|
+
// written once in cmp/ReadmeRefFeatures.ts rather than here.
|
|
412
|
+
ReadmeRefFeatures({ target })
|
|
408
413
|
}
|
|
409
414
|
|
|
410
415
|
})
|
|
@@ -141,6 +141,11 @@ function generateDirectLoad(model: Model, entity: ModelEntity) {
|
|
|
141
141
|
return
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
+
if ('graphql' === (loadPoint as any).kind) {
|
|
145
|
+
generateDirectGraphqlJs('load', entity, loadPoint)
|
|
146
|
+
return
|
|
147
|
+
}
|
|
148
|
+
|
|
144
149
|
const loadParams = loadPoint.args?.params || []
|
|
145
150
|
const loadPath = normalizePathParams(loadPoint.parts || [], loadParams, loadPoint.rename?.param)
|
|
146
151
|
|
|
@@ -238,6 +243,11 @@ function generateDirectList(model: Model, entity: ModelEntity) {
|
|
|
238
243
|
return
|
|
239
244
|
}
|
|
240
245
|
|
|
246
|
+
if ('graphql' === (listPoint as any).kind) {
|
|
247
|
+
generateDirectGraphqlJs('list', entity, listPoint)
|
|
248
|
+
return
|
|
249
|
+
}
|
|
250
|
+
|
|
241
251
|
const listParams = listPoint.args?.params || []
|
|
242
252
|
const listPath = normalizePathParams(listPoint.parts || [], listParams, listPoint.rename?.param)
|
|
243
253
|
|
|
@@ -297,6 +307,58 @@ ${paramAsserts} }
|
|
|
297
307
|
}
|
|
298
308
|
|
|
299
309
|
|
|
310
|
+
// GraphQL-backed op needs POST+body, not a REST-shaped GET+params direct()
|
|
311
|
+
// call — reuse apidef's own point.graphql.doc via the SDK's graphql() hatch.
|
|
312
|
+
// Mirrors TestDirect_ts.ts's generateDirectGraphql.
|
|
313
|
+
function generateDirectGraphqlJs(
|
|
314
|
+
opname: 'load' | 'list',
|
|
315
|
+
entity: ModelEntity,
|
|
316
|
+
point: any,
|
|
317
|
+
) {
|
|
318
|
+
const doc: string = point.graphql.doc
|
|
319
|
+
const vars: any[] = point.graphql.vars || []
|
|
320
|
+
|
|
321
|
+
const mockVarLines = vars.map((v: any, i: number) =>
|
|
322
|
+
` variables[${JSON.stringify(v.name)}] = 'direct0${i + 1}'`).join('\n')
|
|
323
|
+
|
|
324
|
+
const liveVarLines = vars.map((v: any) => {
|
|
325
|
+
const from = v.from || v.name
|
|
326
|
+
const key = ('id' === from ? entity.name : from.replace(/_id$/, '')) + '01'
|
|
327
|
+
return ` variables[${JSON.stringify(v.name)}] = setup.idmap['${key}']`
|
|
328
|
+
}).join('\n')
|
|
329
|
+
|
|
330
|
+
// Asserted against the OUTGOING request body, not the mocked response —
|
|
331
|
+
// response-shape correctness is the entity-level tests' job.
|
|
332
|
+
const varAsserts = vars.map((_v: any, i: number) =>
|
|
333
|
+
' assert(calls[0].init.body.includes(\'direct0' + (i + 1) + '\'))\n').join('')
|
|
334
|
+
|
|
335
|
+
Content(`
|
|
336
|
+
test('direct-${opname}-${entity.name}', async () => {
|
|
337
|
+
const setup = directSetup()
|
|
338
|
+
const { client, calls } = setup
|
|
339
|
+
|
|
340
|
+
const variables = {}
|
|
341
|
+
if (setup.live) {
|
|
342
|
+
${liveVarLines || ' // no variables'}
|
|
343
|
+
} else {
|
|
344
|
+
${mockVarLines || ' // no variables'}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
const result = await client.graphql(${JSON.stringify(doc)}, variables)
|
|
348
|
+
|
|
349
|
+
assert(result.ok === true)
|
|
350
|
+
assert(result.status === 200)
|
|
351
|
+
assert(null != result.data)
|
|
352
|
+
|
|
353
|
+
if (!setup.live) {
|
|
354
|
+
assert(calls.length === 1)
|
|
355
|
+
assert(calls[0].init.method === 'POST')
|
|
356
|
+
${varAsserts} }
|
|
357
|
+
})
|
|
358
|
+
`)
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
|
|
300
362
|
// Replace raw OpenAPI parameter names in path parts with model parameter names.
|
|
301
363
|
// Path parts may have e.g. {subBreed} while model params use sub_breed.
|
|
302
364
|
// When a rename mapping exists (e.g. closureId -> id), path parts contain the
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { cmp, each, Content, canonToType, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape } from '@voxgig/sdkgen'
|
|
3
|
+
import { ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
3
4
|
|
|
4
5
|
import {
|
|
5
6
|
KIT,
|
|
@@ -376,6 +377,10 @@ val client = ${SDK}(mutableMapOf<String, Any?>("feature" to feature))
|
|
|
376
377
|
\`\`\`
|
|
377
378
|
|
|
378
379
|
`)
|
|
380
|
+
// The shared feature reference: options, defaults, usage and the
|
|
381
|
+
// considerations. Model facts, identical in every target, so they are
|
|
382
|
+
// written once in cmp/ReadmeRefFeatures.ts rather than here.
|
|
383
|
+
ReadmeRefFeatures({ target })
|
|
379
384
|
}
|
|
380
385
|
|
|
381
386
|
})
|
|
@@ -1,7 +1,25 @@
|
|
|
1
|
-
import { cmp, Content } from '@voxgig/sdkgen'
|
|
1
|
+
import { cmp, Content, File, ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
|
|
4
|
+
// Lean emitted no REFERENCE.md at all. Every other per-language ReadmeRef
|
|
5
|
+
// opens the File itself; this one only called Content(), so its module table
|
|
6
|
+
// was written into no file and dropped, and lean was the one target shipping
|
|
7
|
+
// no reference. Opening the File fixes that and gives the shared feature
|
|
8
|
+
// reference somewhere to land.
|
|
9
|
+
const ReadmeRef = cmp(function ReadmeRef(props: any) {
|
|
10
|
+
const { target, ctx$ } = props
|
|
11
|
+
const { model } = ctx$
|
|
12
|
+
|
|
13
|
+
File({ name: 'REFERENCE.md' }, () => {
|
|
14
|
+
|
|
15
|
+
Content(`# ${model.Name} ${target.title} SDK Reference
|
|
16
|
+
|
|
17
|
+
Complete API reference for the ${model.Name} ${target.title} SDK.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## Modules
|
|
21
|
+
|
|
22
|
+
| Module | Purpose |
|
|
5
23
|
| --- | --- |
|
|
6
24
|
| \`SdkClient\` | \`Sdk.newSdk\` / \`Sdk.testSdk\` and the per-entity op namespaces |
|
|
7
25
|
| \`SdkConfig\` | the embedded API model (JSON) |
|
|
@@ -10,7 +28,13 @@ const ReadmeRef = cmp(function ReadmeRef(_props: any) {
|
|
|
10
28
|
| \`SdkJson\` | JSON text to struct \`Value\` |
|
|
11
29
|
| \`VoxgigStruct\` | the vendored voxgig struct value model |
|
|
12
30
|
|
|
31
|
+
|
|
32
|
+
## Features
|
|
33
|
+
|
|
13
34
|
`)
|
|
35
|
+
|
|
36
|
+
ReadmeRefFeatures({ target })
|
|
37
|
+
})
|
|
14
38
|
})
|
|
15
39
|
|
|
16
40
|
export { ReadmeRef }
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { cmp, each, Content, canonToType, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape, safeVarName, exampleVarName } from '@voxgig/sdkgen'
|
|
3
|
+
import { ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
3
4
|
|
|
4
5
|
import {
|
|
5
6
|
KIT,
|
|
@@ -398,6 +399,10 @@ local client = sdk.new({
|
|
|
398
399
|
\`\`\`
|
|
399
400
|
|
|
400
401
|
`)
|
|
402
|
+
// The shared feature reference: options, defaults, usage and the
|
|
403
|
+
// considerations. Model facts, identical in every target, so they are
|
|
404
|
+
// written once in cmp/ReadmeRefFeatures.ts rather than here.
|
|
405
|
+
ReadmeRefFeatures({ target })
|
|
401
406
|
}
|
|
402
407
|
|
|
403
408
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { cmp, each, Content, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape } from '@voxgig/sdkgen'
|
|
3
|
+
import { ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
3
4
|
|
|
4
5
|
import {
|
|
5
6
|
KIT,
|
|
@@ -391,6 +392,10 @@ let client = Sdk_client.make (jo [
|
|
|
391
392
|
\`\`\`
|
|
392
393
|
|
|
393
394
|
`)
|
|
395
|
+
// The shared feature reference: options, defaults, usage and the
|
|
396
|
+
// considerations. Model facts, identical in every target, so they are
|
|
397
|
+
// written once in cmp/ReadmeRefFeatures.ts rather than here.
|
|
398
|
+
ReadmeRefFeatures({ target })
|
|
394
399
|
}
|
|
395
400
|
|
|
396
401
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { cmp, each, Content, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape } from '@voxgig/sdkgen'
|
|
3
|
+
import { ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
3
4
|
|
|
4
5
|
import {
|
|
5
6
|
KIT,
|
|
@@ -386,6 +387,10 @@ my $client = ${model.const.Name}SDK->new({
|
|
|
386
387
|
\`\`\`
|
|
387
388
|
|
|
388
389
|
`)
|
|
390
|
+
// The shared feature reference: options, defaults, usage and the
|
|
391
|
+
// considerations. Model facts, identical in every target, so they are
|
|
392
|
+
// written once in cmp/ReadmeRefFeatures.ts rather than here.
|
|
393
|
+
ReadmeRefFeatures({ target })
|
|
389
394
|
}
|
|
390
395
|
|
|
391
396
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { cmp, each, Content, canonToType, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape, phpEntityAccessor } from '@voxgig/sdkgen'
|
|
3
|
+
import { ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
3
4
|
|
|
4
5
|
import {
|
|
5
6
|
KIT,
|
|
@@ -390,6 +391,10 @@ $client = new ${model.const.Name}SDK([
|
|
|
390
391
|
\`\`\`
|
|
391
392
|
|
|
392
393
|
`)
|
|
394
|
+
// The shared feature reference: options, defaults, usage and the
|
|
395
|
+
// considerations. Model facts, identical in every target, so they are
|
|
396
|
+
// written once in cmp/ReadmeRefFeatures.ts rather than here.
|
|
397
|
+
ReadmeRefFeatures({ target })
|
|
393
398
|
}
|
|
394
399
|
|
|
395
400
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { cmp, each, Content, canonToType, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape, safeVarName, exampleVarName, matchArg, idLiteral } from '@voxgig/sdkgen'
|
|
3
|
+
import { ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
3
4
|
|
|
4
5
|
import {
|
|
5
6
|
KIT,
|
|
@@ -403,6 +404,10 @@ client = ${model.const.Name}SDK({
|
|
|
403
404
|
\`\`\`
|
|
404
405
|
|
|
405
406
|
`)
|
|
407
|
+
// The shared feature reference: options, defaults, usage and the
|
|
408
|
+
// considerations. Model facts, identical in every target, so they are
|
|
409
|
+
// written once in cmp/ReadmeRefFeatures.ts rather than here.
|
|
410
|
+
ReadmeRefFeatures({ target })
|
|
406
411
|
}
|
|
407
412
|
|
|
408
413
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { cmp, each, Content, canonToType, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape, safeVarName, exampleVarName } from '@voxgig/sdkgen'
|
|
3
|
+
import { ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
3
4
|
|
|
4
5
|
import {
|
|
5
6
|
KIT,
|
|
@@ -396,6 +397,10 @@ client = ${model.const.Name}SDK.new({
|
|
|
396
397
|
\`\`\`
|
|
397
398
|
|
|
398
399
|
`)
|
|
400
|
+
// The shared feature reference: options, defaults, usage and the
|
|
401
|
+
// considerations. Model facts, identical in every target, so they are
|
|
402
|
+
// written once in cmp/ReadmeRefFeatures.ts rather than here.
|
|
403
|
+
ReadmeRefFeatures({ target })
|
|
399
404
|
}
|
|
400
405
|
|
|
401
406
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { cmp, each, Content, canonToType, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape } from '@voxgig/sdkgen'
|
|
3
|
+
import { ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
3
4
|
|
|
4
5
|
import {
|
|
5
6
|
KIT,
|
|
@@ -373,6 +374,10 @@ let client = ${model.const.Name}SDK::new(jo(vec![
|
|
|
373
374
|
\`\`\`
|
|
374
375
|
|
|
375
376
|
`)
|
|
377
|
+
// The shared feature reference: options, defaults, usage and the
|
|
378
|
+
// considerations. Model facts, identical in every target, so they are
|
|
379
|
+
// written once in cmp/ReadmeRefFeatures.ts rather than here.
|
|
380
|
+
ReadmeRefFeatures({ target })
|
|
376
381
|
}
|
|
377
382
|
|
|
378
383
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { cmp, each, Content, canonToType, canonKey, canonScalarKey, File, isAuthActive, entityIdField, opRequestShape } from '@voxgig/sdkgen'
|
|
3
|
+
import { ReadmeRefFeatures } from '@voxgig/sdkgen'
|
|
3
4
|
|
|
4
5
|
import {
|
|
5
6
|
KIT,
|
|
@@ -377,6 +378,10 @@ val client = new ${SDK}(options)
|
|
|
377
378
|
\`\`\`
|
|
378
379
|
|
|
379
380
|
`)
|
|
381
|
+
// The shared feature reference: options, defaults, usage and the
|
|
382
|
+
// considerations. Model facts, identical in every target, so they are
|
|
383
|
+
// written once in cmp/ReadmeRefFeatures.ts rather than here.
|
|
384
|
+
ReadmeRefFeatures({ target })
|
|
380
385
|
}
|
|
381
386
|
|
|
382
387
|
})
|