@voxgig/sdkgen 4.36.0 → 4.38.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/helpers/flowGuard.js +4 -4
- package/dist/helpers/flowGuard.js.map +1 -1
- package/dist/helpers/liveDiscovery.d.ts +7 -0
- package/dist/helpers/liveDiscovery.js +20 -0
- package/dist/helpers/liveDiscovery.js.map +1 -0
- package/dist/helpers/opShape.d.ts +2 -1
- package/dist/helpers/opShape.js +4 -0
- package/dist/helpers/opShape.js.map +1 -1
- package/dist/helpers/pointPath.d.ts +2 -1
- package/dist/helpers/pointPath.js +6 -0
- package/dist/helpers/pointPath.js.map +1 -1
- package/dist/helpers/testPolicy.d.ts +14 -4
- package/dist/helpers/testPolicy.js +152 -54
- package/dist/helpers/testPolicy.js.map +1 -1
- package/dist/sdkgen.d.ts +8 -6
- package/dist/sdkgen.js +11 -5
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utility.js +7 -3
- package/dist/utility.js.map +1 -1
- package/package.json +1 -1
- package/project/.sdk/src/cmp/c/TestDirect_c.ts +3 -2
- package/project/.sdk/src/cmp/cpp/TestDirect_cpp.ts +3 -2
- package/project/.sdk/src/cmp/cpp/TestEntity_cpp.ts +33 -10
- package/project/.sdk/src/cmp/csharp/TestDirect_csharp.ts +12 -12
- package/project/.sdk/src/cmp/csharp/TestEntity_csharp.ts +73 -28
- package/project/.sdk/src/cmp/go/Entity_go.ts +1 -1
- package/project/.sdk/src/cmp/go/MainEntity_go.ts +1 -1
- package/project/.sdk/src/cmp/go/Main_go.ts +7 -3
- package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +3 -3
- package/project/.sdk/src/cmp/go/ReadmeRef_go.ts +1 -1
- package/project/.sdk/src/cmp/go/TestDirect_go.ts +12 -10
- package/project/.sdk/src/cmp/go/TestEntity_go.ts +67 -23
- package/project/.sdk/src/cmp/go-cli/fragment/words.fragment.go +1 -1
- package/project/.sdk/src/cmp/go-mcp/fragment/tools.fragment.go +1 -1
- package/project/.sdk/src/cmp/java/TestDirect_java.ts +12 -11
- package/project/.sdk/src/cmp/java/TestEntity_java.ts +71 -23
- package/project/.sdk/src/cmp/js/TestDirect_js.ts +13 -12
- package/project/.sdk/src/cmp/js/TestEntity_js.ts +41 -17
- package/project/.sdk/src/cmp/kotlin/TestDirect_kotlin.ts +12 -10
- package/project/.sdk/src/cmp/kotlin/TestEntity_kotlin.ts +64 -23
- package/project/.sdk/src/cmp/lua/TestDirect_lua.ts +9 -5
- package/project/.sdk/src/cmp/lua/TestEntity_lua.ts +61 -23
- package/project/.sdk/src/cmp/perl/TestDirect_perl.ts +9 -5
- package/project/.sdk/src/cmp/perl/TestEntity_perl.ts +58 -24
- package/project/.sdk/src/cmp/php/TestDirect_php.ts +9 -5
- package/project/.sdk/src/cmp/php/TestEntity_php.ts +61 -23
- package/project/.sdk/src/cmp/py/TestDirect_py.ts +10 -6
- package/project/.sdk/src/cmp/py/TestEntity_py.ts +59 -27
- package/project/.sdk/src/cmp/rb/TestDirect_rb.ts +9 -5
- package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +59 -23
- package/project/.sdk/src/cmp/rust/EntityOperation_rust.ts +1 -1
- package/project/.sdk/src/cmp/rust/Main_rust.ts +3 -1
- package/project/.sdk/src/cmp/rust/ReadmeHowto_rust.ts +1 -1
- package/project/.sdk/src/cmp/rust/ReadmeModel_rust.ts +1 -1
- package/project/.sdk/src/cmp/rust/ReadmeQuick_rust.ts +1 -1
- package/project/.sdk/src/cmp/rust/ReadmeRef_rust.ts +1 -1
- package/project/.sdk/src/cmp/rust/ReadmeTopQuick_rust.ts +1 -1
- package/project/.sdk/src/cmp/rust/ReadmeTopTest_rust.ts +1 -1
- package/project/.sdk/src/cmp/rust/TestClean_rust.ts +1 -1
- package/project/.sdk/src/cmp/rust/TestDirect_rust.ts +9 -8
- package/project/.sdk/src/cmp/rust/TestEntity_rust.ts +57 -25
- package/project/.sdk/src/cmp/rust/fragment/Entity.fragment.rs +2 -2
- package/project/.sdk/src/cmp/scala/TestDirect_scala.ts +3 -2
- package/project/.sdk/src/cmp/scala/TestEntity_scala.ts +36 -9
- package/project/.sdk/src/cmp/ts/TestDirect_ts.ts +15 -32
- package/project/.sdk/src/cmp/ts/TestEntity_ts.ts +41 -17
- package/project/.sdk/tm/c/core/sdk.h +2 -2
- package/project/.sdk/tm/c/tests/transport_test.c +33 -0
- package/project/.sdk/tm/c/utility/fetcher.c +151 -2
- package/project/.sdk/tm/c/utility/make_url.c +8 -6
- package/project/.sdk/tm/clojure/src/sdk/core.clj +17 -10
- package/project/.sdk/tm/clojure/test/sdk/test/pipeline.clj +38 -0
- package/project/.sdk/tm/cpp/utility/pipeline.hpp +5 -4
- package/project/.sdk/tm/csharp/test/PrimaryUtilityTest.cs +69 -0
- package/project/.sdk/tm/csharp/utility/Fetcher.cs +3 -1
- package/project/.sdk/tm/csharp/utility/MakeUrl.cs +5 -4
- package/project/.sdk/tm/elixir/lib/projectname/utility.ex +10 -6
- package/project/.sdk/tm/elixir/test/pipeline_test.exs +61 -0
- package/project/.sdk/tm/go/core/helpers.go +1 -1
- package/project/.sdk/tm/go/core/types.go +9 -1
- package/project/.sdk/tm/go/test/primary_utility_test.go +60 -0
- package/project/.sdk/tm/go/utility/fetcher.go +15 -4
- package/project/.sdk/tm/go/utility/make_url.go +4 -3
- package/project/.sdk/tm/java/test/PrimaryUtilityTest.java +47 -0
- package/project/.sdk/tm/java/utility/MakeUrl.java +5 -4
- package/project/.sdk/tm/js/src/utility/MakeUrlUtility.js +5 -3
- package/project/.sdk/tm/js/test/live-runner.js +4 -3
- package/project/.sdk/tm/js/test/utility/PrimaryUtility.test.js +40 -0
- package/project/.sdk/tm/kotlin/test/PrimaryUtilityTest.kt +41 -0
- package/project/.sdk/tm/kotlin/utility/MakeSpecUrl.kt +4 -3
- package/project/.sdk/tm/lua/test/primary_utility_test.lua +61 -0
- package/project/.sdk/tm/lua/utility/fetcher.lua +54 -6
- package/project/.sdk/tm/lua/utility/make_url.lua +5 -4
- package/project/.sdk/tm/ocaml/sdk_runtime.ml +5 -5
- package/project/.sdk/tm/perl/t/primary_utility.t +54 -0
- package/project/.sdk/tm/perl/utility/fetcher.pm +65 -11
- package/project/.sdk/tm/perl/utility/make_url.pm +4 -3
- package/project/.sdk/tm/php/test/PipelineTest.php +52 -0
- package/project/.sdk/tm/php/utility/Fetcher.php +81 -15
- package/project/.sdk/tm/php/utility/MakeUrl.php +5 -3
- package/project/.sdk/tm/py/pkg/utility/fetcher.py +1 -0
- package/project/.sdk/tm/py/pkg/utility/make_url.py +5 -4
- package/project/.sdk/tm/py/test/test_primary_utility.py +52 -0
- package/project/.sdk/tm/rb/test/primary_utility_test.rb +46 -0
- package/project/.sdk/tm/rb/utility/fetcher.rb +41 -5
- package/project/.sdk/tm/rb/utility/make_url.rb +5 -3
- package/project/.sdk/tm/rust/core/helpers.rs +1 -1
- package/project/.sdk/tm/rust/core/types.rs +2 -2
- package/project/.sdk/tm/rust/tests/primary_utility_test.rs +65 -0
- package/project/.sdk/tm/rust/utility/make_url.rs +7 -6
- package/project/.sdk/tm/scala/sdktest/SdkTestMain.scala +47 -1
- package/project/.sdk/tm/scala/utility/Make.scala +8 -6
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Fetcher.swift +59 -15
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Make.swift +4 -4
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +72 -0
- package/project/.sdk/tm/ts/src/utility/MakeUrlUtility.ts +5 -3
- package/project/.sdk/tm/ts/test/live-runner.ts +4 -3
- package/project/.sdk/tm/ts/test/utility/PrimaryUtility.test.ts +40 -0
- package/project/.sdk/tm/zig/core/utility.zig +5 -5
- package/project/sdkgen-package.json +1 -1
- package/src/helpers/flowGuard.ts +4 -4
- package/src/helpers/liveDiscovery.ts +31 -0
- package/src/helpers/opShape.ts +6 -0
- package/src/helpers/pointPath.ts +8 -0
- package/src/helpers/testPolicy.ts +193 -55
- package/src/sdkgen.ts +13 -3
- package/src/utility.ts +10 -4
|
@@ -25,13 +25,13 @@ import {
|
|
|
25
25
|
buildIdNames,
|
|
26
26
|
getMatchEntries,
|
|
27
27
|
isAuthActive,
|
|
28
|
-
entityDataIdField, envName, envToken,
|
|
28
|
+
entityDataIdField, entityRecordIdField, envName, envToken,
|
|
29
29
|
serverVarEnv,
|
|
30
30
|
serverVariables,
|
|
31
31
|
invalidRequest,
|
|
32
32
|
liveFlowNeeds, liveStrict, liveStrictNote,
|
|
33
33
|
liveRouteExamples, liveStepExamples, flowLoadRoute, flowLoadReadsRecord,
|
|
34
|
-
|
|
34
|
+
liveGates, liveExcludedLines, liveExcludedSummary, LIVE_GETONLY_ENV,
|
|
35
35
|
liveEntity,
|
|
36
36
|
} from '@voxgig/sdkgen'
|
|
37
37
|
|
|
@@ -42,6 +42,17 @@ import { formatRubyValue } from './utility_rb'
|
|
|
42
42
|
// the ids it binds, and a create-less load reading the first listed record.
|
|
43
43
|
function liveFlowGate(entity: any, needs: any, entidEnv: string): string {
|
|
44
44
|
let out = ''
|
|
45
|
+
if (null != needs.examples) {
|
|
46
|
+
out += ` if setup[:live]
|
|
47
|
+
{ ${needs.examples
|
|
48
|
+
.map(([k, ex]: any) => JSON.stringify(k) + ' => ' + formatRubyValue(ex)).join(', ')} }.each do |_live_key, _live_ex|
|
|
49
|
+
if setup[:synthetic_only] || setup[:idmap][_live_key].nil?
|
|
50
|
+
setup[:idmap][_live_key] = _live_ex
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
`
|
|
55
|
+
}
|
|
45
56
|
if (0 < needs.keys.length) {
|
|
46
57
|
out += ` if setup[:live]
|
|
47
58
|
[${needs.keys.map((k: string) => JSON.stringify(k)).join(', ')}].each do |_live_key|
|
|
@@ -59,6 +70,14 @@ function liveFlowGate(entity: any, needs: any, entidEnv: string): string {
|
|
|
59
70
|
`
|
|
60
71
|
}
|
|
61
72
|
out += ' client = setup[:client]\n'
|
|
73
|
+
if (null != needs.record) {
|
|
74
|
+
out += ` if setup[:live]
|
|
75
|
+
Runner.live_existing(setup, LIVE_STRICT, ${JSON.stringify(entity.name)}) do
|
|
76
|
+
[{ "id" => setup[:idmap][${JSON.stringify(needs.record)}] }]
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
`
|
|
80
|
+
}
|
|
62
81
|
if (null != needs.discover) {
|
|
63
82
|
const match = Object.entries(needs.discover)
|
|
64
83
|
.map(([k, v]: any) => `${JSON.stringify(k)} => setup[:idmap][${JSON.stringify(v)}]`)
|
|
@@ -265,18 +284,17 @@ ${failureTests(model, entity)}${validateListTest(model, entity)}` : ''}${validat
|
|
|
265
284
|
})
|
|
266
285
|
}
|
|
267
286
|
|
|
268
|
-
const getOnly
|
|
269
|
-
if
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
Content(` skip(${formatRubyValue(liveExcludedSummary(getOnly))})
|
|
287
|
+
for (const { getOnly, plan, runs } of liveGates(entity, basicflow)) {
|
|
288
|
+
Content(` if setup[:live]${getOnly ? ` && ENV[${formatRubyValue(LIVE_GETONLY_ENV)}] == "TRUE"` : ''}
|
|
289
|
+
${liveExcludedLines(plan).map((line) => ' puts ' + formatRubyValue(line) + '\n').join('')}`)
|
|
290
|
+
if (!runs) {
|
|
291
|
+
Content(` skip(${formatRubyValue(liveExcludedSummary(plan))})
|
|
274
292
|
end
|
|
275
293
|
|
|
276
294
|
`)
|
|
277
295
|
}
|
|
278
296
|
else {
|
|
279
|
-
flowBody(
|
|
297
|
+
flowBody(plan.flow)
|
|
280
298
|
Content(` return
|
|
281
299
|
end
|
|
282
300
|
|
|
@@ -302,7 +320,7 @@ end
|
|
|
302
320
|
entity_data_file = File.join(__dir__, "..", "..", ".sdk", "test", "entity", "${entity.name}", "${entity.Name}TestData.json")
|
|
303
321
|
entity_data_source = File.read(entity_data_file, encoding: "UTF-8")
|
|
304
322
|
entity_data = JSON.parse(entity_data_source)
|
|
305
|
-
|
|
323
|
+
${fixtureIdentity(entity)}
|
|
306
324
|
options = {}
|
|
307
325
|
options["entity"] = entity_data["existing"]
|
|
308
326
|
|
|
@@ -428,7 +446,7 @@ const generateCreate: OpGen = (ctx, step, index) => {
|
|
|
428
446
|
assert !${datavar}.nil?
|
|
429
447
|
`)
|
|
430
448
|
if (null != ctx.entity.id) {
|
|
431
|
-
Content(` assert !${datavar}[
|
|
449
|
+
Content(` assert !${datavar}[${rid(ctx.entity)}].nil?
|
|
432
450
|
`)
|
|
433
451
|
}
|
|
434
452
|
}
|
|
@@ -467,7 +485,7 @@ const generateList: OpGen = (ctx, step, index) => {
|
|
|
467
485
|
Content(` }
|
|
468
486
|
`)
|
|
469
487
|
}
|
|
470
|
-
Content(liveFill(entity, step, matchvar))
|
|
488
|
+
Content(liveFill(entity, step, matchvar, flow))
|
|
471
489
|
|
|
472
490
|
Content(`
|
|
473
491
|
${listvar}_result = ${entvar}.list(${matchvar}, nil)
|
|
@@ -487,7 +505,7 @@ const generateList: OpGen = (ctx, step, index) => {
|
|
|
487
505
|
Content(`
|
|
488
506
|
found_item = Vs.select(
|
|
489
507
|
Runner.entity_list_to_data(${listvar}_result),
|
|
490
|
-
{
|
|
508
|
+
{ ${rid(entity)} => ${refDataVar}[${rid(entity)}] })
|
|
491
509
|
assert !Vs.isempty(found_item)
|
|
492
510
|
`)
|
|
493
511
|
} else if ('ItemNotExists' === validator.apply && hasRefData && hasDataId) {
|
|
@@ -495,7 +513,7 @@ const generateList: OpGen = (ctx, step, index) => {
|
|
|
495
513
|
Content(`
|
|
496
514
|
not_found_item = Vs.select(
|
|
497
515
|
Runner.entity_list_to_data(${listvar}_result),
|
|
498
|
-
{
|
|
516
|
+
{ ${rid(entity)} => ${refDataVar}[${rid(entity)}] })
|
|
499
517
|
assert Vs.isempty(not_found_item)
|
|
500
518
|
`)
|
|
501
519
|
}
|
|
@@ -528,7 +546,7 @@ const generateUpdate: OpGen = (ctx, step, index) => {
|
|
|
528
546
|
Content(` ${datavar}_up = {
|
|
529
547
|
`)
|
|
530
548
|
if (hasEntIdU) {
|
|
531
|
-
Content(` "id" => ${srcdatavar}[
|
|
549
|
+
Content(` "id" => ${srcdatavar}[${rid(entity)}],
|
|
532
550
|
`)
|
|
533
551
|
}
|
|
534
552
|
|
|
@@ -563,7 +581,7 @@ const generateUpdate: OpGen = (ctx, step, index) => {
|
|
|
563
581
|
assert !${resdatavar}.nil?
|
|
564
582
|
`)
|
|
565
583
|
if (hasEntIdU) {
|
|
566
|
-
Content(` assert_equal ${resdatavar}[
|
|
584
|
+
Content(` assert_equal ${resdatavar}[${rid(entity)}], ${datavar}_up["id"]
|
|
567
585
|
`)
|
|
568
586
|
}
|
|
569
587
|
|
|
@@ -621,17 +639,17 @@ const generateLoad: OpGen = (ctx, step, index) => {
|
|
|
621
639
|
}
|
|
622
640
|
if (hasEntId) {
|
|
623
641
|
Content(` ${matchvar} = {
|
|
624
|
-
"id" => ${srcdatavar}[
|
|
642
|
+
"id" => ${srcdatavar}[${rid(entity)}],
|
|
625
643
|
}
|
|
626
|
-
${loadMatch(entity, step, matchvar, srcdatavar)}${liveFill(entity, step, matchvar)} ${datavar}_loaded = ${entvar}.load(${matchvar}, nil)
|
|
644
|
+
${loadMatch(entity, step, matchvar, srcdatavar)}${liveFill(entity, step, matchvar, flow)} ${datavar}_loaded = ${entvar}.load(${matchvar}, nil)
|
|
627
645
|
${datavar}_load_result = Helpers.to_map(${datavar}_loaded.respond_to?(:data_get) ? ${datavar}_loaded.data_get : ${datavar}_loaded)
|
|
628
646
|
assert !${datavar}_load_result.nil?
|
|
629
|
-
assert_equal ${datavar}_load_result[
|
|
647
|
+
assert_equal ${datavar}_load_result[${rid(entity)}], ${srcdatavar}[${rid(entity)}]
|
|
630
648
|
`)
|
|
631
649
|
}
|
|
632
650
|
else {
|
|
633
651
|
Content(` ${matchvar} = {}
|
|
634
|
-
${loadMatch(entity, step, matchvar, srcdatavar)}${liveFill(entity, step, matchvar)} ${datavar}_loaded = ${entvar}.load(${matchvar}, nil)
|
|
652
|
+
${loadMatch(entity, step, matchvar, srcdatavar)}${liveFill(entity, step, matchvar, flow)} ${datavar}_loaded = ${entvar}.load(${matchvar}, nil)
|
|
635
653
|
assert !${datavar}_loaded.nil?
|
|
636
654
|
`)
|
|
637
655
|
}
|
|
@@ -660,7 +678,7 @@ const generateRemove: OpGen = (ctx, step, index) => {
|
|
|
660
678
|
}
|
|
661
679
|
// Always match the prior-created entity by id to avoid mock-order flakes.
|
|
662
680
|
Content(` ${matchvar} = {
|
|
663
|
-
"id" => ${srcdatavar}[
|
|
681
|
+
"id" => ${srcdatavar}[${rid(entity)}],
|
|
664
682
|
}
|
|
665
683
|
${parentMatch(step, matchvar)} ${entvar}.remove(${matchvar}, nil)
|
|
666
684
|
`)
|
|
@@ -668,12 +686,30 @@ ${parentMatch(step, matchvar)} ${entvar}.remove(${matchvar}, nil)
|
|
|
668
686
|
|
|
669
687
|
|
|
670
688
|
|
|
689
|
+
// The record field the entity's identity is read from, as a Ruby string.
|
|
690
|
+
function rid(entity: any): string {
|
|
691
|
+
return JSON.stringify(entityRecordIdField(entity))
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
// The fixture keeps each record's key in `id`; an entity keeping its identity
|
|
696
|
+
// in another field reads the key from there too.
|
|
697
|
+
function fixtureIdentity(entity: any): string {
|
|
698
|
+
const field = entityRecordIdField(entity)
|
|
699
|
+
return 'id' === field ? '' : `
|
|
700
|
+
((entity_data["existing"] || {})[${JSON.stringify(entity.name)}] || {}).each_value do |rec|
|
|
701
|
+
rec[${JSON.stringify(field)}] = rec["id"] if rec.is_a?(Hash) && !rec["id"].nil?
|
|
702
|
+
end
|
|
703
|
+
`
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
|
|
671
707
|
// A child's route names its parents, and an entity no earlier step has
|
|
672
708
|
// filled knows none of them, so the call itself gives each parent id. A live
|
|
673
709
|
// ENTID may key a parent by its field name, the fixture by its own name.
|
|
674
710
|
// A live step sends each example its route requires and the step leaves unbound.
|
|
675
|
-
function liveFill(entity: any, step: any, matchvar: string): string {
|
|
676
|
-
const fills = liveStepExamples(entity, step)
|
|
711
|
+
function liveFill(entity: any, step: any, matchvar: string, flow: any): string {
|
|
712
|
+
const fills = liveStepExamples(entity, step, flow)
|
|
677
713
|
return 0 === fills.length ? '' : ` if setup[:live]
|
|
678
714
|
${fills.map(([k, ex]) => ` ${matchvar}[${JSON.stringify(k)}] = ${formatRubyValue(ex)}\n`).join('')} end
|
|
679
715
|
`
|
|
@@ -9,7 +9,7 @@ const EntityOperation = cmp(function Operation(props: any) {
|
|
|
9
9
|
const { model } = props.ctx$
|
|
10
10
|
const { ff, opname, entity, entrep, cls } = props
|
|
11
11
|
|
|
12
|
-
// The op marker sits inside `impl
|
|
12
|
+
// The op marker sits inside `impl ProjectNameEntityBase for EntyClass`
|
|
13
13
|
// indented one level; indent the whole spliced method by the marker's
|
|
14
14
|
// own leading whitespace so the emitted rust nests correctly.
|
|
15
15
|
let { indent } = props
|
|
@@ -207,8 +207,10 @@ pub use crate::core::result::{SdkResult, StreamFn};
|
|
|
207
207
|
pub use crate::core::sdk::{test_sdk, ${model.const.Name}SDK};
|
|
208
208
|
pub use crate::core::spec::Spec;
|
|
209
209
|
pub use crate::core::types::{
|
|
210
|
-
Entity, Feature, FeatureRef, FetcherFn, OutVal, ${model.const.Name}
|
|
210
|
+
Entity, Feature, FeatureRef, FetcherFn, OutVal, ${model.const.Name}EntityBase,
|
|
211
211
|
};
|
|
212
|
+
// The trait's former name, kept so code written against it still compiles.
|
|
213
|
+
pub use crate::core::types::${model.const.Name}EntityBase as ${model.const.Name}Entity;
|
|
212
214
|
pub use crate::core::utility_type::Utility;
|
|
213
215
|
pub use crate::feature::base::BaseFeature;
|
|
214
216
|
pub use crate::utility::jsonparse::json_parse;
|
|
@@ -116,7 +116,7 @@ println!("{:?}", getp(&fetchdef, "headers"));
|
|
|
116
116
|
Create a mock client for unit testing — no server required:
|
|
117
117
|
|
|
118
118
|
\`\`\`rust
|
|
119
|
-
use ${rustcrate}::{jo, test_sdk, ${model.const.Name}
|
|
119
|
+
use ${rustcrate}::{jo, test_sdk, ${model.const.Name}EntityBase, Entity, Value};
|
|
120
120
|
|
|
121
121
|
let client = test_sdk(Value::Noval, Value::Noval);
|
|
122
122
|
|
|
@@ -100,7 +100,7 @@ ${opRows}
|
|
|
100
100
|
Entity operations return the entity on \`Ok\`, and \`list\` a \`Vec\` of
|
|
101
101
|
entities, one per record; \`data(None)\` reads an entity's record. \`Err\` is
|
|
102
102
|
the branded error. The operations are methods of the
|
|
103
|
-
\`${model.const.Name}
|
|
103
|
+
\`${model.const.Name}EntityBase\` trait and \`data\` of the \`Entity\` trait, so
|
|
104
104
|
import both.
|
|
105
105
|
|
|
106
106
|
The \`direct()\` escape hatch resolves to \`Ok\` even on a non-2xx response —
|
|
@@ -48,7 +48,7 @@ const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
|
|
|
48
48
|
Content(`### 1. Create a client
|
|
49
49
|
|
|
50
50
|
\`\`\`rust
|
|
51
|
-
use ${rustcrate}::{getp, jo, ${model.const.Name}
|
|
51
|
+
use ${rustcrate}::{getp, jo, ${model.const.Name}EntityBase, ${model.const.Name}SDK, Entity, Value};
|
|
52
52
|
|
|
53
53
|
let client = ${ctor};
|
|
54
54
|
\`\`\`
|
|
@@ -77,7 +77,7 @@ Complete API reference for the ${model.Name} ${target.title} SDK.
|
|
|
77
77
|
`)
|
|
78
78
|
|
|
79
79
|
Content(`\`\`\`rust
|
|
80
|
-
use ${rustcrate}::{jo, ${model.const.Name}
|
|
80
|
+
use ${rustcrate}::{jo, ${model.const.Name}EntityBase, ${model.const.Name}SDK, Entity, Value};
|
|
81
81
|
|
|
82
82
|
let client = ${model.const.Name}SDK::new(options);
|
|
83
83
|
\`\`\`
|
|
@@ -38,7 +38,7 @@ const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
|
|
|
38
38
|
: `${model.const.Name}SDK::new(Value::Noval)`
|
|
39
39
|
|
|
40
40
|
Content(`\`\`\`rust
|
|
41
|
-
use ${rustcrate}::{jo, ${model.const.Name}
|
|
41
|
+
use ${rustcrate}::{jo, ${model.const.Name}EntityBase, ${model.const.Name}SDK, Entity, Value};
|
|
42
42
|
|
|
43
43
|
let client = ${ctor};
|
|
44
44
|
|
|
@@ -34,7 +34,7 @@ const ReadmeTopTest = cmp(function ReadmeTopTest(props: any) {
|
|
|
34
34
|
const { entity: exampleEntity, primaryOp } = pickExampleEntity(entity)
|
|
35
35
|
|
|
36
36
|
Content(`\`\`\`rust
|
|
37
|
-
use ${rustcrate}::{jo, test_sdk, ${model.const.Name}
|
|
37
|
+
use ${rustcrate}::{jo, test_sdk, ${model.const.Name}EntityBase, Entity, Value};
|
|
38
38
|
|
|
39
39
|
let client = test_sdk(Value::Noval, Value::Noval);
|
|
40
40
|
`)
|
|
@@ -135,7 +135,7 @@ use ${rustcrate}::core::types::OutVal;
|
|
|
135
135
|
use ${rustcrate}::utility::clean;
|
|
136
136
|
use ${rustcrate}::utility::voxgigstruct as vs;
|
|
137
137
|
use ${rustcrate}::{
|
|
138
|
-
Context, CtxSpec, Entity, Feature, FeatureRef, ${Name}
|
|
138
|
+
Context, CtxSpec, Entity, Feature, FeatureRef, ${Name}EntityBase, ${Name}Error, ${Name}SDK, Value,
|
|
139
139
|
};
|
|
140
140
|
|
|
141
141
|
// Generated: the credential's wire placement is fixed when the SDK is built.
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
serverVarEnv,
|
|
16
16
|
serverVariables,
|
|
17
17
|
pointParts,
|
|
18
|
+
pointSlash,
|
|
18
19
|
pointPlaceholders,
|
|
19
20
|
liveStrict,
|
|
20
21
|
liveStrictNote,
|
|
@@ -24,6 +25,7 @@ import {
|
|
|
24
25
|
liveQueryExamples,
|
|
25
26
|
liveEntity,
|
|
26
27
|
liveDirectGetOnly, liveExcludedLines, liveExcludedSummary, LIVE_GETONLY_ENV,
|
|
28
|
+
liveDirectDiscovery,
|
|
27
29
|
} from '@voxgig/sdkgen'
|
|
28
30
|
|
|
29
31
|
|
|
@@ -134,7 +136,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
134
136
|
|
|
135
137
|
// Load point info.
|
|
136
138
|
const loadPoint = loadOp?.points?.[0]
|
|
137
|
-
const loadPath = loadPoint ? normalizePathParams(pointParts(loadPoint), loadPoint?.g?.params || [], loadPoint?.r?.param) : ''
|
|
139
|
+
const loadPath = loadPoint ? normalizePathParams(pointParts(loadPoint), loadPoint?.g?.params || [], loadPoint?.r?.param) + pointSlash(loadPoint) : ''
|
|
138
140
|
const allLoadParams = loadPoint?.g?.params || []
|
|
139
141
|
// Only path params that actually appear in the URL template drive the
|
|
140
142
|
// direct-test path-param setup and URL-substitution asserts.
|
|
@@ -152,7 +154,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
152
154
|
|
|
153
155
|
// List point info.
|
|
154
156
|
const listPoint = listOp?.points?.[0]
|
|
155
|
-
const listPath = listPoint ? normalizePathParams(pointParts(listPoint), listPoint?.g?.params || [], listPoint?.r?.param) : ''
|
|
157
|
+
const listPath = listPoint ? normalizePathParams(pointParts(listPoint), listPoint?.g?.params || [], listPoint?.r?.param) + pointSlash(listPoint) : ''
|
|
156
158
|
const listParams = listPoint?.g?.params || []
|
|
157
159
|
|
|
158
160
|
const entidEnvVar = `${PROJECTNAME}_TEST_${envToken(entity.name)}_ENTID`
|
|
@@ -392,8 +394,10 @@ fn ${evar}_direct_load() {}
|
|
|
392
394
|
else if (hasLoad && loadPoint) {
|
|
393
395
|
const examples = 0 < loadParams.length &&
|
|
394
396
|
loadParams.every((p: any) => undefined !== p.ex && null !== p.ex)
|
|
395
|
-
const
|
|
396
|
-
const
|
|
397
|
+
const discovery = liveDirectDiscovery(entity, loadParams, listPoint)
|
|
398
|
+
const discover = null != discovery
|
|
399
|
+
const idParam = discovery?.param
|
|
400
|
+
const idField = discovery?.field
|
|
397
401
|
const loadLiveIdKeys: string[] = examples ? [] :
|
|
398
402
|
discover ? listParams.map(liveKey).concat(loadParams.filter((p: any) => idParam !== p.n).map(liveKey)) :
|
|
399
403
|
loadParams.map(liveKey)
|
|
@@ -454,10 +458,7 @@ ${liveQueryBlock(loadPoint)} if setup.live {
|
|
|
454
458
|
live_empty("The account has no ${entity.name} record to load");
|
|
455
459
|
return;
|
|
456
460
|
}
|
|
457
|
-
let
|
|
458
|
-
if found.is_noval() {
|
|
459
|
-
found = getp(&first, "id");
|
|
460
|
-
}
|
|
461
|
+
let found = getp(&first, "${idField}");
|
|
461
462
|
if found.is_noval() {
|
|
462
463
|
live_miss(LIVE_STRICT, "Live load blocked: discovery returned no usable identity");
|
|
463
464
|
return;
|
|
@@ -18,11 +18,11 @@ import {
|
|
|
18
18
|
each,
|
|
19
19
|
buildIdNames,
|
|
20
20
|
getMatchEntries,
|
|
21
|
-
isAuthActive, envName, envToken,
|
|
21
|
+
isAuthActive, envName, envToken, entityRecordIdField,
|
|
22
22
|
serverVarEnv,
|
|
23
23
|
serverVariables,
|
|
24
24
|
liveFlowNeeds, liveStrict, liveStrictNote,
|
|
25
|
-
|
|
25
|
+
liveGates, liveExcludedLines, liveExcludedSummary, LIVE_GETONLY_ENV,
|
|
26
26
|
liveRouteExamples, liveStepExamples,
|
|
27
27
|
liveEntity,
|
|
28
28
|
} from '@voxgig/sdkgen'
|
|
@@ -48,6 +48,12 @@ type OpGen = (ctx: GenCtx, step: ModelEntityFlowStep, index: number) => void
|
|
|
48
48
|
function liveFlowGate(entity: any, needs: any, entidEnv: string, method: string,
|
|
49
49
|
strict: boolean, hasSteps: boolean): string {
|
|
50
50
|
let out = ''
|
|
51
|
+
for (const [k, ex] of needs.examples || []) {
|
|
52
|
+
out += ` if setup.live && (setup.synthetic_only || getp(&setup.idmap, ${JSON.stringify(k)}).is_noval()) {
|
|
53
|
+
setp(&setup.idmap, ${JSON.stringify(k)}, ${rustLit(ex)});
|
|
54
|
+
}
|
|
55
|
+
`
|
|
56
|
+
}
|
|
51
57
|
if (0 < needs.keys.length) {
|
|
52
58
|
out += ` if setup.live {
|
|
53
59
|
for live_key in [${needs.keys.map((k: string) => JSON.stringify(k)).join(', ')}] {
|
|
@@ -70,6 +76,14 @@ function liveFlowGate(entity: any, needs: any, entidEnv: string, method: string,
|
|
|
70
76
|
return out
|
|
71
77
|
}
|
|
72
78
|
out += ' let client = setup.client.clone();\n'
|
|
79
|
+
if (null != needs.record) {
|
|
80
|
+
out += ` if setup.live && !live_existing(&setup.data, LIVE_STRICT, ${JSON.stringify(entity.name)}, || {
|
|
81
|
+
Ok(ja(vec![jo(vec![("id", getp(&setup.idmap, ${JSON.stringify(needs.record)}))])]))
|
|
82
|
+
}) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
`
|
|
86
|
+
}
|
|
73
87
|
if (null != needs.discover) {
|
|
74
88
|
const match = Object.entries(needs.discover)
|
|
75
89
|
.map(([k, v]: any) => `(${JSON.stringify(k)}, getp(&setup.idmap, ${JSON.stringify(v)}))`)
|
|
@@ -184,7 +198,7 @@ use common::*;
|
|
|
184
198
|
|
|
185
199
|
use ${rustcrate}::core::helpers::{getp, getpath, ja, jo, now_ms, setp, to_map};
|
|
186
200
|
use ${rustcrate}::utility::voxgigstruct as vs;
|
|
187
|
-
use ${rustcrate}::{test_sdk, Entity, ${model.const.Name}
|
|
201
|
+
use ${rustcrate}::{test_sdk, Entity, ${model.const.Name}EntityBase, ${model.const.Name}SDK, Value};
|
|
188
202
|
|
|
189
203
|
${liveStrictNote(strict, '//')}
|
|
190
204
|
const LIVE_STRICT: bool = ${strict};
|
|
@@ -289,19 +303,18 @@ ${skipBlock}`)
|
|
|
289
303
|
`)
|
|
290
304
|
}
|
|
291
305
|
|
|
292
|
-
const getOnly
|
|
293
|
-
if (
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
Content(` eprintln!("skip: {}", ${JSON.stringify(liveExcludedSummary(getOnly))});
|
|
306
|
+
for (const { getOnly, plan, runs } of liveGates(entity, basicflow)) {
|
|
307
|
+
Content(` if setup.live${getOnly ? ` && std::env::var(${JSON.stringify(LIVE_GETONLY_ENV)}).map(|v| v == "TRUE").unwrap_or(false)` : ''} {
|
|
308
|
+
${liveExcludedLines(plan).map((line) => ' println!("{}", ' + JSON.stringify(line) + ');\n').join('')}`)
|
|
309
|
+
if (!runs) {
|
|
310
|
+
Content(` eprintln!("skip: {}", ${JSON.stringify(liveExcludedSummary(plan))});
|
|
298
311
|
return;
|
|
299
312
|
}
|
|
300
313
|
|
|
301
314
|
`)
|
|
302
315
|
}
|
|
303
316
|
else {
|
|
304
|
-
flowBody(
|
|
317
|
+
flowBody(plan.flow)
|
|
305
318
|
Content(` return;
|
|
306
319
|
}
|
|
307
320
|
|
|
@@ -328,7 +341,7 @@ ${liveExcludedLines(getOnly).map((line) => ' println!("{}", ' + JSON.stri
|
|
|
328
341
|
entity_data_file.push("${entity.Name}TestData.json");
|
|
329
342
|
|
|
330
343
|
let entity_data = read_json(&entity_data_file);
|
|
331
|
-
|
|
344
|
+
${fixtureIdentity(entity)}
|
|
332
345
|
let options = jo(vec![("entity", getp(&entity_data, "existing"))]);
|
|
333
346
|
|
|
334
347
|
let client = test_sdk(options, extra.clone());
|
|
@@ -472,7 +485,7 @@ const generateCreate: OpGen = (ctx, step, index) => {
|
|
|
472
485
|
`)
|
|
473
486
|
if (null != ctx.entity.id) {
|
|
474
487
|
Content(` assert!(
|
|
475
|
-
!getp(&${datavar},
|
|
488
|
+
!getp(&${datavar}, ${rid(ctx.entity)}).is_noval(),
|
|
476
489
|
"expected created entity to have an id"
|
|
477
490
|
);
|
|
478
491
|
`)
|
|
@@ -511,7 +524,7 @@ const generateList: OpGen = (ctx, step, index) => {
|
|
|
511
524
|
`)
|
|
512
525
|
}
|
|
513
526
|
}
|
|
514
|
-
Content(liveFill(entity, step, matchvar))
|
|
527
|
+
Content(liveFill(entity, step, matchvar, flow))
|
|
515
528
|
|
|
516
529
|
Content(`
|
|
517
530
|
let ${listvar} = ${entvar}
|
|
@@ -535,7 +548,7 @@ const generateList: OpGen = (ctx, step, index) => {
|
|
|
535
548
|
Content(`
|
|
536
549
|
let found_item = vs::select(
|
|
537
550
|
&entity_list_to_data(&${listvar}),
|
|
538
|
-
&jo(vec![(
|
|
551
|
+
&jo(vec![(${rid(entity)}, getp(&${refDataVar}, ${rid(entity)}))]),
|
|
539
552
|
);
|
|
540
553
|
assert!(
|
|
541
554
|
!vs::is_empty(&found_item),
|
|
@@ -547,7 +560,7 @@ const generateList: OpGen = (ctx, step, index) => {
|
|
|
547
560
|
Content(`
|
|
548
561
|
let not_found_item = vs::select(
|
|
549
562
|
&entity_list_to_data(&${listvar}),
|
|
550
|
-
&jo(vec![(
|
|
563
|
+
&jo(vec![(${rid(entity)}, getp(&${refDataVar}, ${rid(entity)}))]),
|
|
551
564
|
);
|
|
552
565
|
assert!(
|
|
553
566
|
vs::is_empty(¬_found_item),
|
|
@@ -584,7 +597,7 @@ const generateUpdate: OpGen = (ctx, step, index) => {
|
|
|
584
597
|
Content(` let ${datavar}_up = Value::empty_map();
|
|
585
598
|
`)
|
|
586
599
|
if (hasEntIdU) {
|
|
587
|
-
Content(` setp(&${datavar}_up, "id", getp(&${srcdatavar},
|
|
600
|
+
Content(` setp(&${datavar}_up, "id", getp(&${srcdatavar}, ${rid(entity)}));
|
|
588
601
|
`)
|
|
589
602
|
}
|
|
590
603
|
|
|
@@ -628,7 +641,7 @@ const generateUpdate: OpGen = (ctx, step, index) => {
|
|
|
628
641
|
`)
|
|
629
642
|
if (hasEntIdU) {
|
|
630
643
|
Content(` assert_eq!(
|
|
631
|
-
getp(&${resdatavar},
|
|
644
|
+
getp(&${resdatavar}, ${rid(entity)}),
|
|
632
645
|
getp(&${datavar}_up, "id"),
|
|
633
646
|
"expected update result id to match"
|
|
634
647
|
);
|
|
@@ -695,8 +708,8 @@ const generateLoad: OpGen = (ctx, step, index) => {
|
|
|
695
708
|
`)
|
|
696
709
|
}
|
|
697
710
|
if (hasEntId) {
|
|
698
|
-
Content(` let ${matchvar} = jo(vec![("id", getp(&${srcdatavar},
|
|
699
|
-
${loadMatch(entity, step, matchvar, srcdatavar)}${liveFill(entity, step, matchvar)} let ${datavar}_loaded = ${entvar}
|
|
711
|
+
Content(` let ${matchvar} = jo(vec![("id", getp(&${srcdatavar}, ${rid(entity)}))]);
|
|
712
|
+
${loadMatch(entity, step, matchvar, srcdatavar)}${liveFill(entity, step, matchvar, flow)} let ${datavar}_loaded = ${entvar}
|
|
700
713
|
.load(${matchvar}.clone(), Value::Noval)
|
|
701
714
|
.expect("load failed");
|
|
702
715
|
let ${datavar}_load_result = to_map(&${datavar}_loaded.data(None));
|
|
@@ -705,15 +718,15 @@ ${loadMatch(entity, step, matchvar, srcdatavar)}${liveFill(entity, step, matchva
|
|
|
705
718
|
"expected load result to be a map"
|
|
706
719
|
);
|
|
707
720
|
assert_eq!(
|
|
708
|
-
getp(&${datavar}_load_result,
|
|
709
|
-
getp(&${srcdatavar},
|
|
721
|
+
getp(&${datavar}_load_result, ${rid(entity)}),
|
|
722
|
+
getp(&${srcdatavar}, ${rid(entity)}),
|
|
710
723
|
"expected load result id to match"
|
|
711
724
|
);
|
|
712
725
|
`)
|
|
713
726
|
}
|
|
714
727
|
else {
|
|
715
728
|
Content(` let ${matchvar} = Value::empty_map();
|
|
716
|
-
${loadMatch(entity, step, matchvar, srcdatavar)}${liveFill(entity, step, matchvar)} let ${datavar}_loaded = ${entvar}
|
|
729
|
+
${loadMatch(entity, step, matchvar, srcdatavar)}${liveFill(entity, step, matchvar, flow)} let ${datavar}_loaded = ${entvar}
|
|
717
730
|
.load(${matchvar}.clone(), Value::Noval)
|
|
718
731
|
.expect("load failed");
|
|
719
732
|
// load resolves to the ENTITY; the record is reached through data().
|
|
@@ -744,7 +757,7 @@ const generateRemove: OpGen = (ctx, step, index) => {
|
|
|
744
757
|
`)
|
|
745
758
|
}
|
|
746
759
|
// Always match the prior-created entity by id to avoid mock-order flakes.
|
|
747
|
-
Content(` let ${matchvar} = jo(vec![("id", getp(&${srcdatavar},
|
|
760
|
+
Content(` let ${matchvar} = jo(vec![("id", getp(&${srcdatavar}, ${rid(entity)}))]);
|
|
748
761
|
${parentMatch(step, matchvar)} ${entvar}
|
|
749
762
|
.remove(${matchvar}.clone(), Value::Noval)
|
|
750
763
|
.expect("remove failed");
|
|
@@ -752,6 +765,25 @@ ${parentMatch(step, matchvar)} ${entvar}
|
|
|
752
765
|
}
|
|
753
766
|
|
|
754
767
|
|
|
768
|
+
// The record field the entity's identity is read from, as a Rust string.
|
|
769
|
+
function rid(entity: any): string {
|
|
770
|
+
return JSON.stringify(entityRecordIdField(entity))
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
|
|
774
|
+
// The fixture keeps each record's key in `id`; an entity keeping its identity
|
|
775
|
+
// in another field reads the key from there too.
|
|
776
|
+
function fixtureIdentity(entity: any): string {
|
|
777
|
+
return 'id' === entityRecordIdField(entity) ? '' : `
|
|
778
|
+
for (_, fixture_rec) in vs::items_vec(&to_map(&getpath(&["existing", "${entity.name}"], &entity_data))) {
|
|
779
|
+
if matches!(fixture_rec, Value::Map(_)) && !getp(&fixture_rec, "id").is_noval() {
|
|
780
|
+
setp(&fixture_rec, ${rid(entity)}, getp(&fixture_rec, "id"));
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
`
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
|
|
755
787
|
// A child's route names its parents, and an entity no earlier step has
|
|
756
788
|
// filled knows none of them, so the call itself gives each parent id. A live
|
|
757
789
|
// ENTID may key a parent by its field name, the fixture by its own name.
|
|
@@ -763,8 +795,8 @@ function rustLit(value: any): string {
|
|
|
763
795
|
|
|
764
796
|
|
|
765
797
|
// A live step sends each example its route requires and the step leaves unbound.
|
|
766
|
-
function liveFill(entity: any, step: any, matchvar: string): string {
|
|
767
|
-
const fills = liveStepExamples(entity, step)
|
|
798
|
+
function liveFill(entity: any, step: any, matchvar: string, flow: any): string {
|
|
799
|
+
const fills = liveStepExamples(entity, step, flow)
|
|
768
800
|
return 0 === fills.length ? '' : ` if setup.live {
|
|
769
801
|
${fills.map(([k, ex]) => ` setp(&${matchvar}, ${JSON.stringify(k)}, ${rustLit(ex)});\n`).join('')} }
|
|
770
802
|
`
|
|
@@ -10,7 +10,7 @@ use crate::core::context::{Context, CtxSpec};
|
|
|
10
10
|
use crate::core::error::ProjectNameError;
|
|
11
11
|
use crate::core::helpers::{get_bool, getp, setp, to_map};
|
|
12
12
|
use crate::core::sdk::ProjectNameSDK;
|
|
13
|
-
use crate::core::types::{Entity,
|
|
13
|
+
use crate::core::types::{Entity, ProjectNameEntityBase};
|
|
14
14
|
use crate::core::utility_type::Utility;
|
|
15
15
|
use crate::utility::voxgigstruct as vs;
|
|
16
16
|
use crate::utility::voxgigstruct::Value;
|
|
@@ -302,7 +302,7 @@ impl Entity for EntyClass {
|
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
impl
|
|
305
|
+
impl ProjectNameEntityBase for EntyClass {
|
|
306
306
|
// #LoadOp
|
|
307
307
|
|
|
308
308
|
// #ListOp
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
cmp,
|
|
13
13
|
snakify,
|
|
14
14
|
pointParts,
|
|
15
|
+
pointSlash,
|
|
15
16
|
pointPlaceholders,
|
|
16
17
|
pointIsGraphql,
|
|
17
18
|
graphqlDirectSkip,
|
|
@@ -83,7 +84,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
83
84
|
// Load point info.
|
|
84
85
|
const loadPoint = loadOp?.points?.[0]
|
|
85
86
|
const loadPath = loadPoint
|
|
86
|
-
? normalizePathParams(pointParts(loadPoint), loadPoint?.g?.params || [], loadPoint?.r?.param)
|
|
87
|
+
? normalizePathParams(pointParts(loadPoint), loadPoint?.g?.params || [], loadPoint?.r?.param) + pointSlash(loadPoint)
|
|
87
88
|
: ''
|
|
88
89
|
const allLoadParams = loadPoint?.g?.params || []
|
|
89
90
|
// Only path params that actually appear in the URL template drive the
|
|
@@ -103,7 +104,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
103
104
|
// List point info.
|
|
104
105
|
const listPoint = listOp?.points?.[0]
|
|
105
106
|
const listPath = listPoint
|
|
106
|
-
? normalizePathParams(pointParts(listPoint), listPoint?.g?.params || [], listPoint?.r?.param)
|
|
107
|
+
? normalizePathParams(pointParts(listPoint), listPoint?.g?.params || [], listPoint?.r?.param) + pointSlash(listPoint)
|
|
107
108
|
: ''
|
|
108
109
|
const listParams = listPoint?.g?.params || []
|
|
109
110
|
|