@voxgig/create-sdkgen 0.4.0 → 0.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.
Files changed (52) hide show
  1. package/bin/create-sdkgen +12 -13
  2. package/dist/tsconfig.tsbuildinfo +1 -1
  3. package/package.json +8 -10
  4. package/project/standard/.sdk/package.json +2 -2
  5. package/project/standard/.sdk/test/.model-config/model-config.json +5 -1
  6. package/project/standard/.sdk/test/primary/{inward.jsonic → clean.jsonic} +0 -1
  7. package/project/standard/.sdk/test/primary/done.jsonic +0 -1
  8. package/project/standard/.sdk/test/primary/{outward.jsonic → featureAdd.jsonic} +0 -1
  9. package/project/standard/.sdk/test/primary/featureHook.jsonic +2 -0
  10. package/project/standard/.sdk/test/primary/featureInit.jsonic +2 -0
  11. package/project/standard/.sdk/test/primary/fetcher.jsonic +2 -0
  12. package/project/standard/.sdk/test/primary/makeContext.jsonic +4 -0
  13. package/project/standard/.sdk/test/primary/makeError.jsonic +16 -0
  14. package/project/standard/.sdk/test/primary/makeFetchDef.jsonic +2 -0
  15. package/project/standard/.sdk/test/primary/{options.jsonic → makeOptions.jsonic} +5 -6
  16. package/project/standard/.sdk/test/primary/{request.jsonic → makeRequest.jsonic} +7 -13
  17. package/project/standard/.sdk/test/primary/makeResponse.jsonic +22 -0
  18. package/project/standard/.sdk/test/primary/makeResult.jsonic +2 -0
  19. package/project/standard/.sdk/test/primary/{spec.jsonic → makeSpec.jsonic} +9 -5
  20. package/project/standard/.sdk/test/primary/makeTarget.jsonic +2 -0
  21. package/project/standard/.sdk/test/primary/makeUrl.jsonic +21 -0
  22. package/project/standard/.sdk/test/primary/operator.jsonic +10 -53
  23. package/project/standard/.sdk/test/primary/{findparam.jsonic → param.jsonic} +6 -7
  24. package/project/standard/.sdk/test/primary/prepareAuth.jsonic +13 -0
  25. package/project/standard/.sdk/test/primary/prepareBody.jsonic +18 -0
  26. package/project/standard/.sdk/test/primary/prepareHeaders.jsonic +4 -0
  27. package/project/standard/.sdk/test/primary/prepareMethod.jsonic +10 -0
  28. package/project/standard/.sdk/test/primary/prepareParams.jsonic +9 -0
  29. package/project/standard/.sdk/test/primary/preparePath.jsonic +2 -0
  30. package/project/standard/.sdk/test/primary/prepareQuery.jsonic +8 -0
  31. package/project/standard/.sdk/test/primary/primary-test-index.jsonic +28 -21
  32. package/project/standard/.sdk/test/primary/resultBasic.jsonic +14 -0
  33. package/project/standard/.sdk/test/primary/resultBody.jsonic +4 -0
  34. package/project/standard/.sdk/test/primary/resultHeaders.jsonic +7 -0
  35. package/project/standard/.sdk/test/primary/transformRequest.jsonic +8 -0
  36. package/project/standard/.sdk/test/primary/transformResponse.jsonic +10 -0
  37. package/project/standard/.sdk/test/test.json +578 -682
  38. package/project/standard/.sdk/test/primary/auth.jsonic +0 -20
  39. package/project/standard/.sdk/test/primary/body.jsonic +0 -27
  40. package/project/standard/.sdk/test/primary/context.jsonic +0 -5
  41. package/project/standard/.sdk/test/primary/error.jsonic +0 -19
  42. package/project/standard/.sdk/test/primary/fullurl.jsonic +0 -50
  43. package/project/standard/.sdk/test/primary/headers.jsonic +0 -12
  44. package/project/standard/.sdk/test/primary/method.jsonic +0 -11
  45. package/project/standard/.sdk/test/primary/params.jsonic +0 -10
  46. package/project/standard/.sdk/test/primary/query.jsonic +0 -9
  47. package/project/standard/.sdk/test/primary/reqform.jsonic +0 -9
  48. package/project/standard/.sdk/test/primary/resbasic.jsonic +0 -15
  49. package/project/standard/.sdk/test/primary/resbody.jsonic +0 -5
  50. package/project/standard/.sdk/test/primary/resform.jsonic +0 -11
  51. package/project/standard/.sdk/test/primary/resheaders.jsonic +0 -9
  52. package/project/standard/.sdk/test/primary/response.jsonic +0 -20
@@ -16631,58 +16631,20 @@
16631
16631
  ]
16632
16632
  }
16633
16633
  },
16634
- "auth": {
16635
- "DEF": {
16636
- "client": {
16637
- "a": {
16638
- "test": {
16639
- "options": {
16640
- "apikey": "APIKEY01"
16641
- }
16642
- }
16643
- },
16644
- "b": {
16645
- "test": {
16646
- "options": {}
16647
- }
16648
- }
16649
- }
16650
- },
16634
+ "clean": {
16651
16635
  "basic": {
16652
- "set": [
16653
- {
16654
- "ctx": {
16655
- "spec": {
16656
- "headers": {}
16657
- }
16658
- },
16659
- "client": "a",
16660
- "match": {
16661
- "out": {
16662
- "headers": {
16663
- "authorization": "Bearer APIKEY01"
16664
- }
16665
- }
16666
- }
16667
- }
16668
- ]
16636
+ "set": []
16669
16637
  }
16670
16638
  },
16671
- "body": {
16639
+ "done": {
16672
16640
  "basic": {
16673
16641
  "set": [
16674
16642
  {
16675
16643
  "ctx": {
16676
- "op": {
16677
- "kind": "req",
16678
- "reqform": "`data.foo`",
16679
- "check": {
16680
- "nobody": true
16681
- },
16682
- "data": {
16683
- "foo": {
16684
- "x": 1
16685
- }
16644
+ "result": {
16645
+ "ok": true,
16646
+ "resdata": {
16647
+ "x": 1
16686
16648
  }
16687
16649
  }
16688
16650
  },
@@ -16692,142 +16654,91 @@
16692
16654
  },
16693
16655
  {
16694
16656
  "ctx": {
16695
- "op": {
16696
- "kind": "req",
16697
- "reqform": "`data.bar`",
16698
- "check": {
16699
- "nobody": false
16700
- },
16701
- "data": {
16702
- "foo": {
16703
- "x": 2
16704
- }
16705
- }
16706
- }
16707
- }
16708
- },
16709
- {
16710
- "ctx": {
16711
- "op": {
16712
- "kind": "req",
16713
- "reqform": "`data.bar`",
16714
- "check": {
16715
- "nobody": true
16716
- },
16717
- "data": {
16718
- "foo": {
16719
- "x": 3
16720
- }
16721
- }
16657
+ "result": {
16658
+ "ok": false
16722
16659
  }
16723
16660
  },
16724
- "err": "empty"
16661
+ "err": "unknown operation: unknown error"
16725
16662
  }
16726
16663
  ]
16727
16664
  }
16728
16665
  },
16729
- "context": {
16666
+ "featureAdd": {
16667
+ "basic": {
16668
+ "set": []
16669
+ }
16670
+ },
16671
+ "featureHook": {
16672
+ "basic": {
16673
+ "set": []
16674
+ }
16675
+ },
16676
+ "featureInit": {
16677
+ "basic": {
16678
+ "set": []
16679
+ }
16680
+ },
16681
+ "fetcher": {
16682
+ "basic": {
16683
+ "set": []
16684
+ }
16685
+ },
16686
+ "makeContext": {
16730
16687
  "basic": {
16731
16688
  "set": [
16732
16689
  {
16733
16690
  "in": {
16734
- "op": {
16735
- "kind": "req"
16736
- }
16691
+ "opname": "create"
16737
16692
  },
16738
16693
  "match": {
16739
16694
  "out": {
16740
16695
  "op": {
16741
- "kind": "req"
16742
- }
16743
- }
16744
- }
16745
- }
16746
- ]
16747
- }
16748
- },
16749
- "done": {
16750
- "basic": {
16751
- "set": [
16752
- {
16753
- "ctx": {
16754
- "result": {
16755
- "ok": true,
16756
- "resdata": {
16757
- "x": 1
16696
+ "name": "create",
16697
+ "input": "data"
16758
16698
  }
16759
16699
  }
16760
- },
16761
- "out": {
16762
- "x": 1
16763
16700
  }
16764
- },
16765
- {
16766
- "ctx": {
16767
- "result": {
16768
- "ok": false
16769
- }
16770
- },
16771
- "err": "unknown operation: unknown error"
16772
16701
  }
16773
16702
  ]
16774
16703
  }
16775
16704
  },
16776
- "error": {
16705
+ "makeError": {
16777
16706
  "basic": {
16778
16707
  "set": [
16779
- {
16780
- "args": [],
16781
- "err": "SDK: unknown operation: unknown error"
16782
- },
16783
16708
  {
16784
16709
  "args": [
16785
16710
  {}
16786
16711
  ],
16787
- "err": "SDK: unknown operation: unknown error"
16712
+ "err": "SolardemoSDK: unknown operation: unknown error"
16788
16713
  },
16789
16714
  {
16790
16715
  "args": [
16791
16716
  {},
16792
16717
  {}
16793
16718
  ],
16794
- "err": "SDK: unknown operation: unknown error"
16795
- },
16796
- {
16797
- "args": [
16798
- {
16799
- "op": {}
16800
- }
16801
- ],
16802
- "err": "SDK: unknown operation: unknown error"
16719
+ "err": "SolardemoSDK: unknown operation: unknown error"
16803
16720
  },
16804
16721
  {
16805
16722
  "args": [
16806
16723
  {
16807
- "op": {
16808
- "name": "foo"
16809
- }
16724
+ "opname": "foo"
16810
16725
  }
16811
16726
  ],
16812
- "err": "SDK: foo: unknown error"
16727
+ "err": "SolardemoSDK: foo: unknown error"
16813
16728
  },
16814
16729
  {
16815
16730
  "args": [
16816
16731
  {
16817
- "op": {
16818
- "name": "foo"
16819
- },
16732
+ "opname": "foo",
16820
16733
  "result": {}
16821
16734
  }
16822
16735
  ],
16823
- "err": "SDK: foo: unknown error"
16736
+ "err": "SolardemoSDK: foo: unknown error"
16824
16737
  },
16825
16738
  {
16826
16739
  "args": [
16827
16740
  {
16828
- "op": {
16829
- "name": "foo"
16830
- },
16741
+ "opname": "foo",
16831
16742
  "result": {
16832
16743
  "err": {
16833
16744
  "message": "bar"
@@ -16835,86 +16746,334 @@
16835
16746
  }
16836
16747
  }
16837
16748
  ],
16838
- "err": "SDK: foo: bar"
16749
+ "err": "SolardemoSDK: foo: bar"
16839
16750
  },
16840
16751
  {
16841
16752
  "args": [
16842
16753
  {
16843
- "op": {
16844
- "name": "foo"
16845
- }
16754
+ "opname": "foo"
16846
16755
  },
16847
16756
  {
16848
16757
  "message": "zed"
16849
16758
  }
16850
16759
  ],
16851
- "err": "SDK: foo: zed"
16760
+ "err": "SolardemoSDK: foo: zed"
16852
16761
  },
16853
16762
  {
16854
16763
  "args": [
16855
16764
  {
16856
- "op": {
16857
- "name": "o0"
16858
- }
16765
+ "opname": "o0"
16859
16766
  },
16860
16767
  {
16861
16768
  "message": "e0"
16862
16769
  }
16863
16770
  ],
16864
- "err": "SDK: o0: e0",
16771
+ "err": "SolardemoSDK: o0: e0",
16865
16772
  "match": {
16866
16773
  "err": {
16867
- "message": "SDK: o0: e0"
16774
+ "message": "SolardemoSDK: o0: e0"
16775
+ }
16776
+ }
16777
+ }
16778
+ ]
16779
+ }
16780
+ },
16781
+ "makeFetchDef": {
16782
+ "basic": {
16783
+ "set": []
16784
+ }
16785
+ },
16786
+ "makeOptions": {
16787
+ "basic": {
16788
+ "set": [
16789
+ {
16790
+ "in": {
16791
+ "config": {},
16792
+ "options": {}
16793
+ },
16794
+ "match": {
16795
+ "out": {
16796
+ "base": "http://localhost:8000",
16797
+ "entity": {},
16798
+ "prefix": "",
16799
+ "suffix": ""
16800
+ }
16801
+ }
16802
+ },
16803
+ {
16804
+ "in": {
16805
+ "options": {},
16806
+ "config": {
16807
+ "options": {
16808
+ "base": "http://cbase.example",
16809
+ "prefix": "cpre-",
16810
+ "suffix": "csuf-",
16811
+ "entity": {
16812
+ "foo": {}
16813
+ }
16814
+ }
16815
+ }
16816
+ },
16817
+ "match": {
16818
+ "out": {
16819
+ "base": "http://cbase.example",
16820
+ "prefix": "cpre-",
16821
+ "suffix": "csuf-",
16822
+ "entity": {
16823
+ "foo": {
16824
+ "alias": {}
16825
+ }
16826
+ }
16827
+ }
16828
+ }
16829
+ },
16830
+ {
16831
+ "in": {
16832
+ "options": {
16833
+ "base": "http://cbase.example",
16834
+ "prefix": "cpre-",
16835
+ "suffix": "csuf-",
16836
+ "entity": {
16837
+ "foo": {}
16838
+ }
16839
+ },
16840
+ "config": {}
16841
+ },
16842
+ "match": {
16843
+ "out": {
16844
+ "base": "http://cbase.example",
16845
+ "prefix": "cpre-",
16846
+ "suffix": "csuf-",
16847
+ "entity": {
16848
+ "foo": {
16849
+ "alias": {}
16850
+ }
16851
+ }
16852
+ }
16853
+ }
16854
+ }
16855
+ ]
16856
+ }
16857
+ },
16858
+ "makeRequest": {
16859
+ "basic": {
16860
+ "set": [
16861
+ {
16862
+ "ctx": {
16863
+ "spec": {
16864
+ "base": "http://localhost/base-",
16865
+ "prefix": "prefix-",
16866
+ "suffix": "suffix-",
16867
+ "path": "/p0",
16868
+ "params": {},
16869
+ "query": {},
16870
+ "headers": {},
16871
+ "method": "GET",
16872
+ "body": "__UNDEF__",
16873
+ "alias": {}
16874
+ }
16875
+ },
16876
+ "match": {
16877
+ "ctx": {
16878
+ "response": "__EXISTS__",
16879
+ "result": "__EXISTS__"
16880
+ }
16881
+ }
16882
+ }
16883
+ ]
16884
+ }
16885
+ },
16886
+ "makeResponse": {
16887
+ "basic": {
16888
+ "set": [
16889
+ {
16890
+ "ctx": {
16891
+ "response": {
16892
+ "status": 201,
16893
+ "statusText": "OK1",
16894
+ "headers": {
16895
+ "h1": "v1"
16896
+ },
16897
+ "body": {
16898
+ "b": 1
16899
+ }
16900
+ },
16901
+ "spec": {
16902
+ "step": ""
16903
+ },
16904
+ "result": {
16905
+ "ok": false,
16906
+ "status": -1,
16907
+ "statusText": ""
16908
+ },
16909
+ "target": {
16910
+ "transform": {}
16911
+ }
16912
+ },
16913
+ "match": {
16914
+ "ctx": {
16915
+ "result": {
16916
+ "ok": true,
16917
+ "status": 201,
16918
+ "statusText": "OK1",
16919
+ "body": {
16920
+ "b": 1
16921
+ }
16922
+ }
16923
+ }
16924
+ }
16925
+ }
16926
+ ]
16927
+ }
16928
+ },
16929
+ "makeResult": {
16930
+ "basic": {
16931
+ "set": []
16932
+ }
16933
+ },
16934
+ "makeSpec": {
16935
+ "DEF": {
16936
+ "setup": {
16937
+ "a": {
16938
+ "base": "BASE-",
16939
+ "prefix": "PREFIX-",
16940
+ "suffix": "SUFFIX-"
16941
+ }
16942
+ }
16943
+ },
16944
+ "basic": {
16945
+ "set": [
16946
+ {
16947
+ "ctx": {
16948
+ "opname": "list",
16949
+ "target": {
16950
+ "parts": [],
16951
+ "args": {
16952
+ "params": []
16953
+ },
16954
+ "params": [],
16955
+ "alias": {},
16956
+ "transform": {}
16957
+ }
16958
+ },
16959
+ "match": {
16960
+ "ctx": {
16961
+ "spec": {
16962
+ "base": "BASE-",
16963
+ "prefix": "PREFIX-",
16964
+ "suffix": "SUFFIX-",
16965
+ "method": "GET",
16966
+ "params": {},
16967
+ "query": {},
16968
+ "headers": {
16969
+ "content-type": "application/json"
16970
+ },
16971
+ "step": "start"
16972
+ }
16973
+ }
16974
+ }
16975
+ }
16976
+ ]
16977
+ }
16978
+ },
16979
+ "makeTarget": {
16980
+ "basic": {
16981
+ "set": []
16982
+ }
16983
+ },
16984
+ "makeUrl": {
16985
+ "basic": {
16986
+ "set": [
16987
+ {
16988
+ "ctx": {
16989
+ "spec": {
16990
+ "base": "base-",
16991
+ "prefix": "prefix-",
16992
+ "suffix": "suffix-",
16993
+ "path": "/p0/{a}",
16994
+ "params": {
16995
+ "a": "A"
16996
+ },
16997
+ "query": {},
16998
+ "alias": {}
16999
+ },
17000
+ "result": {
17001
+ "resmatch": {}
17002
+ }
17003
+ },
17004
+ "out": "base-/prefix-/p0/A/suffix-"
17005
+ }
17006
+ ]
17007
+ }
17008
+ },
17009
+ "operator": {
17010
+ "basic": {
17011
+ "set": [
17012
+ {
17013
+ "in": {
17014
+ "entity": "Foo",
17015
+ "name": "load",
17016
+ "input": "match",
17017
+ "targets": []
17018
+ },
17019
+ "match": {
17020
+ "out": {
17021
+ "entity": "Foo",
17022
+ "name": "load",
17023
+ "input": "match",
17024
+ "targets": []
16868
17025
  }
16869
17026
  }
16870
17027
  }
16871
17028
  ]
16872
17029
  }
16873
17030
  },
16874
- "findparam": {
17031
+ "param": {
16875
17032
  "DEF": {
16876
17033
  "ctx0": {
16877
- "op": {}
17034
+ "target": {
17035
+ "alias": {}
17036
+ }
16878
17037
  },
16879
17038
  "ctx1": {
16880
- "op": {
16881
- "kind": "res"
17039
+ "target": {
17040
+ "alias": {}
16882
17041
  }
16883
17042
  },
16884
17043
  "ctx2": {
16885
- "op": {
16886
- "kind": "res",
16887
- "match": {}
16888
- }
17044
+ "target": {
17045
+ "alias": {}
17046
+ },
17047
+ "reqmatch": {}
16889
17048
  },
16890
17049
  "ctx3": {
16891
- "op": {
16892
- "kind": "res",
16893
- "match": {
16894
- "a": "A"
16895
- }
17050
+ "target": {
17051
+ "alias": {}
17052
+ },
17053
+ "reqmatch": {
17054
+ "a": "A"
16896
17055
  }
16897
17056
  },
16898
17057
  "ctx4": {
16899
- "op": {
16900
- "kind": "res",
16901
- "match": {
16902
- "a": "A"
16903
- },
17058
+ "target": {
16904
17059
  "alias": {}
17060
+ },
17061
+ "reqmatch": {
17062
+ "a": "A"
16905
17063
  }
16906
17064
  },
16907
17065
  "ctx5": {
16908
- "op": {
16909
- "kind": "res",
16910
- "match": {
16911
- "a": "A"
16912
- },
17066
+ "target": {
16913
17067
  "alias": {
16914
17068
  "b": "a"
16915
17069
  }
16916
17070
  },
16917
- "spec": {}
17071
+ "reqmatch": {
17072
+ "a": "A"
17073
+ },
17074
+ "spec": {
17075
+ "alias": {}
17076
+ }
16918
17077
  }
16919
17078
  },
16920
17079
  "basic": {
@@ -16923,7 +17082,9 @@
16923
17082
  "mark": 10,
16924
17083
  "args": [
16925
17084
  {
16926
- "op": {}
17085
+ "target": {
17086
+ "alias": {}
17087
+ }
16927
17088
  },
16928
17089
  "a"
16929
17090
  ]
@@ -16932,8 +17093,8 @@
16932
17093
  "mark": 20,
16933
17094
  "args": [
16934
17095
  {
16935
- "op": {
16936
- "kind": "res"
17096
+ "target": {
17097
+ "alias": {}
16937
17098
  }
16938
17099
  },
16939
17100
  "a"
@@ -16943,10 +17104,10 @@
16943
17104
  "mark": 30,
16944
17105
  "args": [
16945
17106
  {
16946
- "op": {
16947
- "kind": "res",
16948
- "match": {}
16949
- }
17107
+ "target": {
17108
+ "alias": {}
17109
+ },
17110
+ "reqmatch": {}
16950
17111
  },
16951
17112
  "a"
16952
17113
  ]
@@ -16955,11 +17116,11 @@
16955
17116
  "mark": 40,
16956
17117
  "args": [
16957
17118
  {
16958
- "op": {
16959
- "kind": "res",
16960
- "match": {
16961
- "a": "A"
16962
- }
17119
+ "target": {
17120
+ "alias": {}
17121
+ },
17122
+ "reqmatch": {
17123
+ "a": "A"
16963
17124
  }
16964
17125
  },
16965
17126
  "a"
@@ -16970,11 +17131,11 @@
16970
17131
  "mark": 50,
16971
17132
  "args": [
16972
17133
  {
16973
- "op": {
16974
- "kind": "res",
16975
- "match": {
16976
- "a": "A"
16977
- }
17134
+ "target": {
17135
+ "alias": {}
17136
+ },
17137
+ "reqmatch": {
17138
+ "a": "A"
16978
17139
  }
16979
17140
  },
16980
17141
  "b"
@@ -16984,12 +17145,11 @@
16984
17145
  "mark": 60,
16985
17146
  "args": [
16986
17147
  {
16987
- "op": {
16988
- "kind": "res",
16989
- "match": {
16990
- "a": "A"
16991
- },
17148
+ "target": {
16992
17149
  "alias": {}
17150
+ },
17151
+ "reqmatch": {
17152
+ "a": "A"
16993
17153
  }
16994
17154
  },
16995
17155
  "b"
@@ -16999,16 +17159,17 @@
16999
17159
  "mark": 70,
17000
17160
  "args": [
17001
17161
  {
17002
- "op": {
17003
- "kind": "res",
17004
- "match": {
17005
- "a": "A"
17006
- },
17162
+ "target": {
17007
17163
  "alias": {
17008
17164
  "b": "a"
17009
17165
  }
17010
17166
  },
17011
- "spec": {}
17167
+ "reqmatch": {
17168
+ "a": "A"
17169
+ },
17170
+ "spec": {
17171
+ "alias": {}
17172
+ }
17012
17173
  },
17013
17174
  "a"
17014
17175
  ],
@@ -17018,16 +17179,17 @@
17018
17179
  "mark": 80,
17019
17180
  "args": [
17020
17181
  {
17021
- "op": {
17022
- "kind": "res",
17023
- "match": {
17024
- "a": "A"
17025
- },
17182
+ "target": {
17026
17183
  "alias": {
17027
17184
  "b": "a"
17028
17185
  }
17029
17186
  },
17030
- "spec": {}
17187
+ "reqmatch": {
17188
+ "a": "A"
17189
+ },
17190
+ "spec": {
17191
+ "alias": {}
17192
+ }
17031
17193
  },
17032
17194
  "b"
17033
17195
  ],
@@ -17045,346 +17207,178 @@
17045
17207
  ]
17046
17208
  }
17047
17209
  },
17048
- "fullurl": {
17210
+ "prepareAuth": {
17211
+ "DEF": {
17212
+ "setup": {
17213
+ "a": {
17214
+ "apikey": "APIKEY01"
17215
+ }
17216
+ }
17217
+ },
17049
17218
  "basic": {
17050
17219
  "set": [
17051
17220
  {
17052
17221
  "ctx": {
17053
- "op": {
17054
- "params": [
17055
- "a"
17056
- ]
17057
- },
17058
17222
  "spec": {
17059
- "base": "base-",
17060
- "prefix": "prefix-",
17061
- "suffix": "suffix-",
17062
- "path": "/p0/{a}",
17063
- "params": {
17064
- "a": "A"
17065
- },
17066
- "query": {
17067
- "b": "B"
17068
- },
17069
- "alias": {}
17223
+ "headers": {}
17070
17224
  }
17071
17225
  },
17072
- "out": "base-/prefix-/p0/A/suffix-?b=B"
17073
- },
17074
- {
17075
- "ctx": {
17076
- "op": {
17077
- "kind": "res",
17078
- "params": [
17079
- "foo_id"
17080
- ],
17081
- "alias": {
17082
- "foo_id": "id"
17083
- },
17084
- "match": {
17085
- "id": "A"
17226
+ "match": {
17227
+ "ctx": {
17228
+ "spec": {
17229
+ "headers": {
17230
+ "authorization": " APIKEY01"
17231
+ }
17086
17232
  }
17087
- },
17088
- "spec": {
17089
- "base": "base-",
17090
- "prefix": "prefix-",
17091
- "suffix": "suffix-",
17092
- "path": "/p0/{foo_id}",
17093
- "params": {},
17094
- "alias": {}
17095
17233
  }
17096
- },
17097
- "out": "base-/prefix-/p0/A/suffix-"
17234
+ }
17098
17235
  }
17099
17236
  ]
17100
17237
  }
17101
17238
  },
17102
- "headers": {
17103
- "DEF": {
17104
- "client": {
17105
- "a": {
17106
- "test": {
17107
- "options": {
17108
- "headers": {
17109
- "foo": "FOO",
17110
- "bar": "BAR",
17111
- "accept": "*/*"
17112
- }
17113
- }
17114
- }
17115
- }
17116
- }
17117
- },
17239
+ "prepareBody": {
17118
17240
  "basic": {
17119
17241
  "set": [
17120
17242
  {
17121
- "ctx": {},
17243
+ "ctx": {
17244
+ "opname": "create",
17245
+ "target": {
17246
+ "transform": {
17247
+ "req": "`reqdata.foo`"
17248
+ }
17249
+ },
17250
+ "reqdata": {
17251
+ "foo": {
17252
+ "x": 1
17253
+ }
17254
+ }
17255
+ },
17122
17256
  "out": {
17123
- "content-type": "application/json",
17124
- "accept": "application/json"
17257
+ "x": 1
17125
17258
  }
17126
17259
  },
17127
17260
  {
17128
- "ctx": {},
17129
- "client": "a",
17130
- "out": {
17131
- "foo": "FOO",
17132
- "bar": "BAR",
17133
- "content-type": "application/json",
17134
- "accept": "*/*"
17261
+ "ctx": {
17262
+ "opname": "create",
17263
+ "target": {
17264
+ "transform": {
17265
+ "req": "`reqdata.bar`"
17266
+ }
17267
+ },
17268
+ "reqdata": {
17269
+ "foo": {
17270
+ "x": 2
17271
+ }
17272
+ }
17135
17273
  }
17136
17274
  }
17137
17275
  ]
17138
17276
  }
17139
17277
  },
17140
- "inward": {
17278
+ "prepareHeaders": {
17141
17279
  "basic": {
17142
- "set": []
17280
+ "set": [
17281
+ {
17282
+ "ctx": {},
17283
+ "out": {
17284
+ "content-type": "application/json"
17285
+ }
17286
+ }
17287
+ ]
17143
17288
  }
17144
17289
  },
17145
- "method": {
17290
+ "prepareMethod": {
17146
17291
  "basic": {
17147
17292
  "set": [
17148
17293
  {
17149
17294
  "ctx": {
17150
- "op": {
17151
- "name": "create"
17152
- }
17295
+ "opname": "create"
17153
17296
  },
17154
17297
  "out": "POST"
17155
17298
  },
17156
17299
  {
17157
17300
  "ctx": {
17158
- "op": {
17159
- "name": "update"
17160
- }
17301
+ "opname": "update"
17161
17302
  },
17162
17303
  "out": "PUT"
17163
17304
  },
17164
17305
  {
17165
17306
  "ctx": {
17166
- "op": {
17167
- "name": "list"
17168
- }
17307
+ "opname": "list"
17169
17308
  },
17170
17309
  "out": "GET"
17171
17310
  },
17172
17311
  {
17173
17312
  "ctx": {
17174
- "op": {
17175
- "name": "load"
17176
- }
17313
+ "opname": "load"
17177
17314
  },
17178
17315
  "out": "GET"
17179
17316
  },
17180
17317
  {
17181
17318
  "ctx": {
17182
- "op": {
17183
- "name": "remove"
17184
- }
17319
+ "opname": "remove"
17185
17320
  },
17186
17321
  "out": "DELETE"
17187
17322
  },
17188
17323
  {
17189
17324
  "ctx": {
17190
- "op": {
17191
- "name": "bad"
17192
- }
17325
+ "opname": "bad"
17193
17326
  }
17194
17327
  }
17195
17328
  ]
17196
17329
  }
17197
17330
  },
17198
- "operator": {
17331
+ "prepareParams": {
17199
17332
  "basic": {
17200
17333
  "set": [
17201
17334
  {
17202
17335
  "ctx": {
17203
- "op": {
17204
- "entity": "Foo",
17205
- "name": "load",
17206
- "path": "/foo/{foo_id}",
17207
- "params": [
17208
- "foo_id"
17209
- ],
17210
- "alias": {
17211
- "foo_id": "id",
17212
- "id": "foo_id"
17336
+ "target": {
17337
+ "args": {
17338
+ "params": []
17213
17339
  },
17214
- "match": {},
17215
- "data": {},
17216
- "state": {},
17217
- "reqform": "`data`",
17218
- "resform": "`body`",
17219
- "check": {}
17220
- }
17221
- },
17222
- "match": {
17223
- "ctx": {
17224
- "op": {
17225
- "kind": "",
17226
- "entity": "Foo",
17227
- "name": "load",
17228
- "path": "/foo/{foo_id}",
17229
- "params": [
17230
- "foo_id"
17231
- ],
17232
- "alias": {
17233
- "foo_id": "id",
17234
- "id": "foo_id"
17235
- },
17236
- "match": {},
17237
- "data": {},
17238
- "state": {},
17239
- "reqform": "`data`",
17240
- "resform": "`body`",
17241
- "check": {}
17242
- }
17340
+ "params": [],
17341
+ "alias": {}
17243
17342
  }
17244
- }
17245
- },
17246
- {
17247
- "ctx": {
17248
- "op": {}
17249
17343
  },
17250
- "err": "Invalid data: Expected field entity to be string, but found no value. | Expected field kind to be exactly equal to one of req, res, but found no value. | Expected field name to be string, but found no value. | Expected field path to be string, but found no value. | Expected field reqform to be one of string, object, function, but found no value. | Expected field resform to be one of string, object, function, but found no value."
17344
+ "out": {}
17251
17345
  },
17252
17346
  {
17253
17347
  "ctx": {
17254
- "op": {
17255
- "entity": 11,
17256
- "name": 22,
17257
- "path": 33,
17258
- "params": [
17259
- 44
17260
- ],
17261
- "alias": {
17262
- "foo_id": 55
17263
- },
17264
- "match": 101,
17265
- "data": 102,
17266
- "state": 103,
17267
- "reqform": 66,
17268
- "resform": 77,
17269
- "check": 88
17270
- }
17271
- },
17272
- "err": "Invalid data: Expected field alias.foo_id to be string, but found number: 55. | Expected field check to be object, but found number: 88. | Expected field data to be one of {}, [], but found number: 102. | Expected field data to be array, but found number: 102. | Expected field entity to be string, but found number: 11. | Expected field kind to be exactly equal to one of req, res, but found no value. | Expected field match to be object, but found number: 101. | Expected field name to be string, but found number: 22. | Expected field path to be string, but found number: 33. | Expected field reqform to be one of string, object, function, but found number: 66. | Expected field resform to be one of string, object, function, but found number: 77. | Expected field state to be object, but found number: 103."
17273
- }
17274
- ]
17275
- }
17276
- },
17277
- "options": {
17278
- "basic": {
17279
- "set": [
17280
- {
17281
- "in": {
17282
- "prep": {
17283
- "config": {},
17284
- "options": {}
17285
- }
17286
- },
17287
- "match": {
17288
- "out": {
17289
- "base": "http://localhost:8000",
17290
- "entity": {},
17291
- "prefix": "",
17292
- "suffix": ""
17293
- }
17294
- }
17295
- },
17296
- {
17297
- "in": {
17298
- "prep": {
17299
- "options": {},
17300
- "config": {
17301
- "options": {
17302
- "base": "http://cbase.example",
17303
- "prefix": "cpre-",
17304
- "suffix": "csuf-",
17305
- "entity": {
17306
- "foo": {}
17348
+ "target": {
17349
+ "args": {
17350
+ "params": [
17351
+ {
17352
+ "name": "a"
17307
17353
  }
17308
- }
17309
- }
17310
- }
17311
- },
17312
- "match": {
17313
- "out": {
17314
- "base": "http://cbase.example",
17315
- "prefix": "cpre-",
17316
- "suffix": "csuf-",
17317
- "entity": {
17318
- "foo": {
17319
- "alias": {}
17320
- }
17321
- }
17322
- }
17323
- }
17324
- },
17325
- {
17326
- "in": {
17327
- "prep": {
17328
- "options": {
17329
- "base": "http://cbase.example",
17330
- "prefix": "cpre-",
17331
- "suffix": "csuf-",
17332
- "entity": {
17333
- "foo": {}
17334
- }
17354
+ ]
17335
17355
  },
17336
- "config": {}
17337
- }
17338
- },
17339
- "match": {
17340
- "out": {
17341
- "base": "http://cbase.example",
17342
- "prefix": "cpre-",
17343
- "suffix": "csuf-",
17344
- "entity": {
17345
- "foo": {
17346
- "alias": {}
17347
- }
17348
- }
17349
- }
17350
- }
17351
- }
17352
- ]
17353
- }
17354
- },
17355
- "outward": {
17356
- "basic": {
17357
- "set": []
17358
- }
17359
- },
17360
- "params": {
17361
- "basic": {
17362
- "set": [
17363
- {
17364
- "ctx": {
17365
- "op": {}
17366
- },
17367
- "out": {}
17368
- },
17369
- {
17370
- "ctx": {
17371
- "op": {
17372
17356
  "params": [
17373
17357
  "a"
17374
- ]
17375
- }
17358
+ ],
17359
+ "alias": {}
17360
+ },
17361
+ "reqmatch": {}
17376
17362
  },
17377
17363
  "out": {}
17378
17364
  },
17379
17365
  {
17380
17366
  "ctx": {
17381
- "op": {
17367
+ "target": {
17368
+ "args": {
17369
+ "params": [
17370
+ {
17371
+ "name": "a"
17372
+ }
17373
+ ]
17374
+ },
17382
17375
  "params": [
17383
17376
  "a"
17384
17377
  ],
17385
- "match": {
17386
- "a": "A"
17387
- }
17378
+ "alias": {}
17379
+ },
17380
+ "reqmatch": {
17381
+ "a": "A"
17388
17382
  }
17389
17383
  },
17390
17384
  "out": {
@@ -17393,28 +17387,44 @@
17393
17387
  },
17394
17388
  {
17395
17389
  "ctx": {
17396
- "op": {
17390
+ "target": {
17391
+ "args": {
17392
+ "params": [
17393
+ {
17394
+ "name": "a"
17395
+ }
17396
+ ]
17397
+ },
17397
17398
  "params": [
17398
17399
  "a"
17399
17400
  ],
17400
- "match": {
17401
- "b": "B"
17402
- }
17401
+ "alias": {}
17402
+ },
17403
+ "reqmatch": {
17404
+ "b": "B"
17403
17405
  }
17404
17406
  },
17405
17407
  "out": {}
17406
17408
  },
17407
17409
  {
17408
17410
  "ctx": {
17409
- "op": {
17411
+ "target": {
17412
+ "args": {
17413
+ "params": [
17414
+ {
17415
+ "name": "a"
17416
+ }
17417
+ ]
17418
+ },
17410
17419
  "params": [
17411
17420
  "a"
17412
17421
  ],
17413
- "match": {
17414
- "a": "A"
17415
- }
17422
+ "alias": {}
17416
17423
  },
17417
- "b": "B"
17424
+ "reqmatch": {
17425
+ "a": "A",
17426
+ "b": "B"
17427
+ }
17418
17428
  },
17419
17429
  "out": {
17420
17430
  "a": "A"
@@ -17423,37 +17433,49 @@
17423
17433
  ]
17424
17434
  }
17425
17435
  },
17426
- "query": {
17436
+ "preparePath": {
17437
+ "basic": {
17438
+ "set": []
17439
+ }
17440
+ },
17441
+ "prepareQuery": {
17427
17442
  "basic": {
17428
17443
  "set": [
17429
17444
  {
17430
17445
  "mark": 10,
17431
17446
  "ctx": {
17432
- "op": {}
17447
+ "target": {
17448
+ "params": [],
17449
+ "alias": {}
17450
+ },
17451
+ "reqmatch": {}
17433
17452
  },
17434
17453
  "out": {}
17435
17454
  },
17436
17455
  {
17437
17456
  "mark": 20,
17438
17457
  "ctx": {
17439
- "op": {
17458
+ "target": {
17440
17459
  "params": [
17441
17460
  "a"
17442
- ]
17443
- }
17461
+ ],
17462
+ "alias": {}
17463
+ },
17464
+ "reqmatch": {}
17444
17465
  },
17445
17466
  "out": {}
17446
17467
  },
17447
17468
  {
17448
17469
  "mark": 30,
17449
17470
  "ctx": {
17450
- "op": {
17471
+ "target": {
17451
17472
  "params": [
17452
17473
  "a"
17453
17474
  ],
17454
- "match": {
17455
- "a": "A"
17456
- }
17475
+ "alias": {}
17476
+ },
17477
+ "reqmatch": {
17478
+ "a": "A"
17457
17479
  }
17458
17480
  },
17459
17481
  "out": {}
@@ -17461,13 +17483,14 @@
17461
17483
  {
17462
17484
  "mark": 40,
17463
17485
  "ctx": {
17464
- "op": {
17486
+ "target": {
17465
17487
  "params": [
17466
17488
  "a"
17467
17489
  ],
17468
- "match": {
17469
- "b": "B"
17470
- }
17490
+ "alias": {}
17491
+ },
17492
+ "reqmatch": {
17493
+ "b": "B"
17471
17494
  }
17472
17495
  },
17473
17496
  "out": {
@@ -17477,129 +17500,54 @@
17477
17500
  {
17478
17501
  "mark": 50,
17479
17502
  "ctx": {
17480
- "op": {
17503
+ "target": {
17481
17504
  "params": [
17482
17505
  "a"
17483
17506
  ],
17484
- "match": {
17485
- "a": "A",
17486
- "b": "B"
17487
- }
17488
- }
17489
- },
17490
- "out": {
17491
- "b": "B"
17492
- }
17493
- }
17494
- ]
17495
- }
17496
- },
17497
- "reqform": {
17498
- "basic": {
17499
- "set": [
17500
- {
17501
- "ctx": {
17502
- "spec": {
17503
- "step": ""
17507
+ "alias": {}
17504
17508
  },
17505
- "op": {
17506
- "reqform": "`data.foo`",
17507
- "data": {
17508
- "foo": {
17509
- "x": 1
17510
- }
17511
- }
17509
+ "reqmatch": {
17510
+ "a": "A",
17511
+ "b": "B"
17512
17512
  }
17513
17513
  },
17514
17514
  "out": {
17515
- "x": 1
17516
- },
17517
- "match": {
17518
- "ctx": {
17519
- "spec": {
17520
- "step": "reqform"
17521
- }
17522
- }
17515
+ "b": "B"
17523
17516
  }
17524
17517
  }
17525
17518
  ]
17526
17519
  }
17527
17520
  },
17528
- "request": {
17529
- "DEF": {
17530
- "client": {
17531
- "a": {
17532
- "test": {
17533
- "options": {
17534
- "base": "b0",
17535
- "system": {
17536
- "fetch": "`fetch`"
17537
- }
17538
- }
17539
- }
17540
- }
17541
- }
17542
- },
17521
+ "resultBasic": {
17543
17522
  "basic": {
17544
17523
  "set": [
17545
17524
  {
17546
17525
  "ctx": {
17547
- "op": {
17548
- "params": []
17526
+ "response": {
17527
+ "status": 200,
17528
+ "statusText": "OK"
17549
17529
  },
17550
- "spec": {
17551
- "base": "http://localhost/base-",
17552
- "prefix": "prefix-",
17553
- "suffix": "suffix-",
17554
- "path": "/p0",
17555
- "params": {},
17556
- "query": {},
17557
- "alias": {}
17558
- }
17530
+ "result": {}
17559
17531
  },
17560
- "client": "a",
17561
17532
  "match": {
17562
17533
  "out": {
17563
- "native": "__EXISTS__",
17564
- "err": "__UNDEF__"
17534
+ "status": 200,
17535
+ "statusText": "OK"
17565
17536
  }
17566
17537
  }
17567
- }
17568
- ]
17569
- }
17570
- },
17571
- "resbasic": {
17572
- "basic": {
17573
- "set": [
17574
- {
17575
- "ctx": {
17576
- "response": {
17577
- "native": {
17578
- "status": 200,
17579
- "reason": "OK"
17580
- }
17581
- },
17582
- "result": {}
17583
- },
17584
- "out": {
17585
- "status": 200,
17586
- "reason": "OK"
17587
- }
17588
17538
  },
17589
17539
  {
17590
17540
  "ctx": {
17591
17541
  "response": {
17592
- "native": {
17593
- "status": 500,
17594
- "reason": "r01"
17595
- }
17542
+ "status": 500,
17543
+ "statusText": "r01"
17596
17544
  },
17597
17545
  "result": {}
17598
17546
  },
17599
17547
  "match": {
17600
17548
  "out": {
17601
17549
  "status": 500,
17602
- "reason": "r01",
17550
+ "statusText": "r01",
17603
17551
  "err": {
17604
17552
  "message": "request: 500: r01"
17605
17553
  }
@@ -17609,79 +17557,48 @@
17609
17557
  {
17610
17558
  "ctx": {
17611
17559
  "response": {
17612
- "native": {
17613
- "status": 400,
17614
- "reason": "BAD"
17615
- },
17560
+ "status": 400,
17561
+ "statusText": "BAD"
17562
+ },
17563
+ "result": {
17616
17564
  "err": {
17617
17565
  "message": "Foo"
17618
17566
  }
17619
- },
17620
- "result": {}
17621
- },
17622
- "out": {
17623
- "status": 400,
17624
- "reason": "BAD",
17625
- "err": {
17626
- "message": "Foo: request: 400: BAD"
17627
17567
  }
17628
- }
17629
- }
17630
- ]
17631
- }
17632
- },
17633
- "resbody": {
17634
- "basic": {
17635
- "set": [
17636
- {
17637
- "ctx": {
17638
- "response": {
17639
- "native": {
17640
- "body": {
17641
- "a": "A",
17642
- "b": "B"
17643
- }
17644
- }
17645
- },
17646
- "result": {}
17647
17568
  },
17648
- "out": {
17649
- "body": {
17650
- "a": "A",
17651
- "b": "B"
17569
+ "match": {
17570
+ "out": {
17571
+ "status": 400,
17572
+ "statusText": "BAD",
17573
+ "err": {
17574
+ "message": "Foo: request: 400: BAD"
17575
+ }
17652
17576
  }
17653
17577
  }
17654
17578
  }
17655
17579
  ]
17656
17580
  }
17657
17581
  },
17658
- "resform": {
17582
+ "resultBody": {
17659
17583
  "basic": {
17660
17584
  "set": [
17661
17585
  {
17662
17586
  "ctx": {
17663
- "result": {
17664
- "ok": true,
17587
+ "response": {
17665
17588
  "body": {
17666
- "foo": {
17667
- "x": 1
17668
- }
17589
+ "a": "A",
17590
+ "b": "B"
17669
17591
  }
17670
17592
  },
17671
- "spec": {
17672
- "step": ""
17673
- },
17674
- "op": {
17675
- "resform": "`body.foo`"
17676
- }
17677
- },
17678
- "out": {
17679
- "x": 1
17593
+ "result": {}
17680
17594
  },
17681
17595
  "match": {
17682
17596
  "ctx": {
17683
- "spec": {
17684
- "step": "resform"
17597
+ "result": {
17598
+ "body": {
17599
+ "a": "A",
17600
+ "b": "B"
17601
+ }
17685
17602
  }
17686
17603
  }
17687
17604
  }
@@ -17689,27 +17606,19 @@
17689
17606
  ]
17690
17607
  }
17691
17608
  },
17692
- "resheaders": {
17609
+ "resultHeaders": {
17693
17610
  "basic": {
17694
17611
  "set": [
17695
17612
  {
17696
17613
  "ctx": {
17697
17614
  "response": {
17698
- "native": {
17699
- "headers": {
17700
- "a": "A",
17701
- "B": "B"
17702
- }
17615
+ "headers": {
17616
+ "a": "A",
17617
+ "B": "B"
17703
17618
  }
17704
17619
  },
17705
17620
  "result": {}
17706
17621
  },
17707
- "out": {
17708
- "headers": {
17709
- "a": "A",
17710
- "b": "B"
17711
- }
17712
- },
17713
17622
  "match": {
17714
17623
  "ctx": {
17715
17624
  "result": {
@@ -17724,37 +17633,32 @@
17724
17633
  ]
17725
17634
  }
17726
17635
  },
17727
- "response": {
17636
+ "transformRequest": {
17728
17637
  "basic": {
17729
17638
  "set": [
17730
17639
  {
17731
17640
  "ctx": {
17732
- "response": {
17733
- "native": {
17734
- "status": 201,
17735
- "reason": "OK1",
17736
- "headers": {
17737
- "h1": "v1"
17738
- },
17739
- "body": {
17740
- "b": 1
17741
- }
17641
+ "spec": {
17642
+ "step": ""
17643
+ },
17644
+ "target": {
17645
+ "transform": {
17646
+ "req": "`reqdata.foo`"
17742
17647
  }
17743
17648
  },
17744
- "spec": {}
17649
+ "reqdata": {
17650
+ "foo": {
17651
+ "x": 1
17652
+ }
17653
+ }
17654
+ },
17655
+ "out": {
17656
+ "x": 1
17745
17657
  },
17746
17658
  "match": {
17747
17659
  "ctx": {
17748
- "result": {
17749
- "ok": true,
17750
- "status": 201,
17751
- "reason": "OK1",
17752
- "headers": {
17753
- "h1": "v1"
17754
- },
17755
- "body": {
17756
- "b": 1
17757
- }
17660
+ "spec": {
17661
+ "step": "reqform"
17758
17662
  }
17759
17663
  }
17760
17664
  }
@@ -17762,43 +17666,35 @@
17762
17666
  ]
17763
17667
  }
17764
17668
  },
17765
- "spec": {
17766
- "DEF": {
17767
- "client": {
17768
- "a": {
17769
- "test": {
17770
- "options": {
17771
- "base": "BASE-",
17772
- "prefix": "PREFIX-",
17773
- "suffix": "SUFFIX-"
17774
- }
17775
- }
17776
- }
17777
- }
17778
- },
17669
+ "transformResponse": {
17779
17670
  "basic": {
17780
17671
  "set": [
17781
17672
  {
17782
17673
  "ctx": {
17783
- "op": {
17784
- "name": "list"
17674
+ "result": {
17675
+ "ok": true,
17676
+ "body": {
17677
+ "foo": {
17678
+ "x": 1
17679
+ }
17680
+ }
17681
+ },
17682
+ "spec": {
17683
+ "step": ""
17684
+ },
17685
+ "target": {
17686
+ "transform": {
17687
+ "res": "`body.foo`"
17688
+ }
17785
17689
  }
17786
17690
  },
17787
- "client": "a",
17691
+ "out": {
17692
+ "x": 1
17693
+ },
17788
17694
  "match": {
17789
17695
  "ctx": {
17790
17696
  "spec": {
17791
- "base": "BASE-",
17792
- "prefix": "PREFIX-",
17793
- "suffix": "SUFFIX-",
17794
- "method": "GET",
17795
- "params": {},
17796
- "query": {},
17797
- "headers": {
17798
- "content-type": "application/json"
17799
- },
17800
- "step": "start",
17801
- "alias": {}
17697
+ "step": "resform"
17802
17698
  }
17803
17699
  }
17804
17700
  }